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

Function E

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

Source from the content-addressed store, hash-verified

165`}return q&&q.eol||`
166`}function Hp6(q,K){return`\r
167`.indexOf(q.charAt(K))!==-1}var U41=y(()=>{KA8();Yh7()});function $h7(q,K=[],_=Jp6.DEFAULT){let z=null,Y=[],$=[];function A(w){if(Array.isArray(Y))Y.push(w);else if(z!==null)Y[z]=w}return d41(q,{onObjectBegin:()=>{let w={};A(w),$.push(Y),Y=w,z=null},onObjectProperty:(w)=>{z=w},onObjectEnd:()=>{Y=$.pop()},onArrayBegin:()=>{let w=[];A(w),$.push(Y),Y=w,z=null},onArrayEnd:()=>{Y=$.pop()},onLiteralValue:A,onError:(w,j,H)=>{K.push({error:w,offset:j,length:H})}},_),Y[0]}function Q41(q,K=[],_=Jp6.DEFAULT){let z={type:"array",offset:-1,length:-1,children:[],parent:void 0};function Y(w){if(z.type==="property")z.length=w-z.offset,z=z.parent}function $(w){return z.children.push(w),w}d41(q,{onObjectBegin:(w)=>{z=$({type:"object",offset:w,length:-1,parent:z,children:[]})},onObjectProperty:(w,j,H)=>{z=$({type:"property",offset:j,length:-1,parent:z,children:[]}),z.children.push({type:"string",value:w,offset:j,length:H,parent:z})},onObjectEnd:(w,j)=>{Y(w+j),z.length=w+j-z.offset,z=z.parent,Y(w+j)},onArrayBegin:(w,j)=>{z=$({type:"array",offset:w,length:-1,parent:z,children:[]})},onArrayEnd:(w,j)=>{z.length=w+j-z.offset,z=z.parent,Y(w+j)},onLiteralValue:(w,j,H)=>{$({type:QR5(w),offset:j,length:H,parent:z,value:w}),Y(j+H)},onSeparator:(w,j,H)=>{if(z.type==="property"){if(w===":")z.colonOffset=j;else if(w===",")Y(j)}},onError:(w,j,H)=>{K.push({error:w,offset:j,length:H})}},_);let O=z.children[0];if(O)delete O.parent;return O}function _A8(q,K){if(!q)return;let _=q;for(let z of K)if(typeof z==="string"){if(_.type!=="object"||!Array.isArray(_.children))return;let Y=!1;for(let $ of _.children)if(Array.isArray($.children)&&$.children[0].value===z&&$.children.length===2){_=$.children[1],Y=!0;break}if(!Y)return}else{let Y=z;if(_.type!=="array"||Y<0||!Array.isArray(_.children)||Y>=_.children.length)return;_=_.children[Y]}return _}function d41(q,K,_=Jp6.DEFAULT){let z=jp6(q,!1),Y=[];function $(B){return B?()=>B(z.getTokenOffset(),z.getTokenLength(),z.getTokenStartLine(),z.getTokenStartCharacter()):()=>!0}function A(B){return B?()=>B(z.getTokenOffset(),z.getTokenLength(),z.getTokenStartLine(),z.getTokenStartCharacter(),()=>Y.slice()):()=>!0}function O(B){return B?(p)=>B(p,z.getTokenOffset(),z.getTokenLength(),z.getTokenStartLine(),z.getTokenStartCharacter()):()=>!0}function w(B){return B?(p)=>B(p,z.getTokenOffset(),z.getTokenLength(),z.getTokenStartLine(),z.getTokenStartCharacter(),()=>Y.slice()):()=>!0}let j=A(K.onObjectBegin),H=w(K.onObjectProperty),J=$(K.onObjectEnd),M=A(K.onArrayBegin),X=$(K.onArrayEnd),P=w(K.onLiteralValue),W=O(K.onSeparator),D=$(K.onComment),f=O(K.onError),G=_&&_.disallowComments,Z=_&&_.allowTrailingComma;function T(){while(!0){let B=z.scan();switch(z.getTokenError()){case 4:v(14);break;case 5:v(15);break;case 3:v(13);break;case 1:if(!G)v(11);break;case 2:v(12);break;case 6:v(16);break}switch(B){case 12:case 13:if(G)v(10);else D();break;case 16:v(1);break;case 15:case 14:break;default:return B}}}function v(B,p=[],C=[]){if(f(B),p.length+C.length>0){let g=z.getToken();while(g!==17){if(p.indexOf(g)!==-1){T();break}else if(C.indexOf(g)!==-1)break;g=T()}}}function V(B){let p=z.getTokenValue();if(B)P(p);else H(p),Y.push(p);return T(),!0}function E(){switch(z.getToken()){case 11:let B=z.getTokenValue(),p=Number(B);if(isNaN(p))v(2),p=0;P(p);break;case 7:P(null);break;case 8:P(!0);break;case 9:P(!1);break;default:return!1}return T(),!0}function S(){if(z.getToken()!==10)return v(3,[],[2,5]),!1;if(V(!1),z.getToken()===6){if(W(":"),T(),!I())v(4,[],[2,5])}else v(5,[],[2,5]);return Y.pop(),!0}function R(){j(),T();let B=!1;while(z.getToken()!==2&&z.getToken()!==17){if(z.getToken()===5){if(!B)v(4,[],[]);if(W(","),T(),z.getToken()===2&&Z)break}else if(B)v(6,[],[]);if(!S())v(4,[],[2,5]);B=!0}if(J(),z.getToken()!==2)v(7,[2],[]);else T();return!0}function x(){M(),T();let B=!0,p=!1;while(z.getToken()!==4&&z.getToken()!==17){if(z.getToken()===5){if(!p)v(4,[],[]);if(W(","),T(),z.getToken()===4&&Z)break}else if(p)v(6,[],[]);if(B)Y.push(0),B=!1;else Y[Y.length-1]++;if(!I())v(4,[],[4,5]);p=!0}if(X(),!B)Y.pop();if(z.getToken()!==4)v(8,[4],[]);else T();return!0}function I(){switch(z.getToken()){case 3:return x();case 1:return R();case 10:return V(!0);default:return E()}}if(T(),z.getToken()===17){if(_.allowEmptyContent)return!0;return v(4,[],[]),!1}if(!I())return v(4,[],[]),!1;if(z.getToken()!==17)v(9,[],[]);return!0}function QR5(q){switch(typeof q){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!q)return"null";else if(Array.isArray(q))return"array";return"object"}default:return"null"}}var Jp6;var c41=y(()=>{KA8();(function(q){q.DEFAULT={allowTrailingComma:!1}})(Jp6||(Jp6={}))});function Ah7(q,K,_,z){let Y=K.slice(),A=Q41(q,[]),O=void 0,w=void 0;while(Y.length>0)if(w=Y.pop(),O=_A8(A,Y),O===void 0&&_!==void 0)if(typeof w==="string")_={[w]:_};else _=[_];else break;if(!O){if(_===void 0)throw Error("Can not delete in empty document");return D_6(q,{offset:A?A.offset:0,length:A?A.length:0,content:JSON.stringify(_)},z)}else if(O.type==="object"&&typeof w==="string"&&Array.isArray(O.children)){let j=_A8(O,[w]);if(j!==void 0)if(_===void 0){if(!j.parent)throw Error("Malformed AST");let H=O.children.indexOf(j.parent),J,M=j.parent.offset+j.parent.length;if(H>0){let X=O.children[H-1];J=X.offset+X.length}else if(J=O.offset+1,O.children.length>1)M=O.children[1].offset;return D_6(q,{offset:J,length:M-J,content:""},z)}else return D_6(q,{offset:j.offset,length:j.length,content:JSON.stringify(_)},z);else{if(_===void 0)return[];let H=`${JSON.stringify(w)}: ${JSON.stringify(_)}`,J=z.getInsertionIndex?z.getInsertionIndex(O.children.map((X)=>X.children[0].value)):O.children.length,M;if(J>0){let X=O.children[J-1];M={offset:X.offset+X.length,length:0,content:","+H}}else if(O.children.length===0)M={offset:O.offset+1,length:0,content:H};else M={offset:O.offset+1,length:0,content:H+","};return D_6(q,M,z)}}else if(O.type==="array"&&typeof w==="number"&&Array.isArray(O.children)){let j=w;if(j===-1){let H=`${JSON.stringify(_)}`,J;if(O.children.length===0)J={offset:O.offset+1,length:0,content:H};else{let M=O.children[O.children.length-1];J={offset:M.offset+M.length,length:0,content:","+H}}return D_6(q,J,z)}else if(_===void 0&&O.children.length>=0){let H=w,J=O.children[H],M;if(O.children.length===1)M={offset:O.offset+1,length:O.length-2,content:""};else if(O.children.length-1===H){let X=O.children[H-1],P=X.offset+X.length,W=O.offset+O.length;M={offset:P,length:W-2-P,content:""}}else M={offset:J.offset,length:O.children[H+1].offset-J.offset,content:""};return D_6(q,M,z)}else if(_!==void 0){let H,J=`${JSON.stringify(_)}`;if(!z.isArrayInsertion&&O.children.length>w){let M=O.children[w];H={offset:M.offset,length:M.length,content:J}}else if(O.children.length===0||w===0)H={offset:O.offset+1,length:0,content:O.children.length===0?J:J+","};else{let M=w>O.children.length?O.children.length:w,X=O.children[M-1];H={offset:X.offset+X.length,length:0,content:","+J}}return D_6(q,H,z)}else throw Error(`Can not ${_===void 0?"remove":z.isArrayInsertion?"insert":"modify"} Array index ${j} as length is not sufficient`)}else throw Error(`Can not add ${typeof w!=="number"?"index":"property"} to parent of type ${O.type}`)}function D_6(q,K,_){if(!_.formattingOptions)return[K];let z=zA8(q,K),Y=K.offset,$=K.offset+K.content.length;if(K.length===0||K.content.length===0){while(Y>0&&!Hp6(z,Y-1))Y--;while($<z.length&&!Hp6(z,$))$++}let A=F41(z,{offset:Y,length:$-Y},{..._.formattingOptions,keepLines:!1});for(let w=A.length-1;w>=0;w--){let j=A[w];z=zA8(z,j),Y=Math.min(Y,j.offset),$=Math.max($,j.offset+j.length),$+=j.content.length-j.length}let O=q.length-(z.length-$)-Y;return[{offset:Y,length:O,content:z.substring(Y,$)}]}function zA8(q,K){return q.substring(0,K.offset)+K.content+q.substring(K.offset+K.length)}var Oh7=y(()=>{U41();c41()});function Jh7(q,K,_,z){return Ah7(q,K,_,z)}function Mh7(q,K){let _=K.slice(0).sort((Y,$)=>{let A=Y.offset-$.offset;if(A===0)return Y.length-$.length;return A}),z=q.length;for(let Y=_.length-1;Y>=0;Y--){let $=_[Y];if($.offset+$.length<=z)q=zA8(q,$);else throw Error("Overlapping edit");z=$.offset}return q}var wh7,jh7,l41,Hh7;var Xh7=y(()=>{U41();Oh7();KA8();c41();(function(q){q[q.None=0]="None",q[q.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",q[q.UnexpectedEndOfString=2]="UnexpectedEndOfString",q[q.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",q[q.InvalidUnicode=4]="InvalidUnicode",q[q.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",q[q.InvalidCharacter=6]="InvalidCharacter"})(wh7||(wh7={}));(function(q){q[q.OpenBraceToken=1]="OpenBraceToken",q[q.CloseBraceToken=2]="CloseBraceToken",q[q.OpenBracketToken=3]="OpenBracketToken",q[q.CloseBracketToken=4]="CloseBracketToken",q[q.CommaToken=5]="CommaToken",q[q.ColonToken=6]="ColonToken",q[q.NullKeyword=7]="NullKeyword",q[q.TrueKeyword=8]="TrueKeyword",q[q.FalseKeyword=9]="FalseKeyword",q[q.StringLiteral=10]="StringLiteral",q[q.NumericLiteral=11]="NumericLiteral",q[q.LineCommentTrivia=12]="LineCommentTrivia",q[q.BlockCommentTrivia=13]="BlockCommentTrivia",q[q.LineBreakTrivia=14]="LineBreakTrivia",q[q.Trivia=15]="Trivia",q[q.Unknown=16]="Unknown",q[q.EOF=17]="EOF"})(jh7||(jh7={}));l41=$h7;(function(q){q[q.InvalidSymbol=1]="InvalidSymbol",q[q.InvalidNumberFormat=2]="InvalidNumberFormat",q[q.PropertyNameExpected=3]="PropertyNameExpected",q[q.ValueExpected=4]="ValueExpected",q[q.ColonExpected=5]="ColonExpected",q[q.CommaExpected=6]="CommaExpected",q[q.CloseBraceExpected=7]="CloseBraceExpected",q[q.CloseBracketExpected=8]="CloseBracketExpected",q[q.EndOfFileExpected=9]="EndOfFileExpected",q[q.InvalidCommentToken=10]="InvalidCommentToken",q[q.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",q[q.UnexpectedEndOfString=12]="UnexpectedEndOfString",q[q.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",q[q.InvalidUnicode=14]="InvalidUnicode",q[q.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",q[q.InvalidCharacter=16]="InvalidCharacter"})(Hh7||(Hh7={}))});import{open as lR5,readFile as nR5,stat as iR5}from"fs/promises";function Wh7(q,K){try{return{ok:!0,value:JSON.parse(kB(q))}}catch(_){if(K)H6(_);return{ok:!1}}}function Dh7(q){if(!q)return null;try{return l41(kB(q))}catch(K){return H6(K),null}}function oR5(q){let K=fh7,_=q.length,z=K(q);if(!z.error||z.done||z.read>=_)return z.values;let{values:Y,read:$}=z;while($<_){let A=typeof q==="string"?q.indexOf(`
168`,$):q.indexOf(10,$);if(A===-1)break;$=A+1;let O=K(q,$);if(O.values.length>0)Y=Y.concat(O.values);if(!O.error||O.done||O.read>=_)break;$=O.read}return Y}function aR5(q){let K=q.length,_=0;if(q[0]===239&&q[1]===187&&q[2]===191)_=3;let z=[];while(_<K){let Y=q.indexOf(10,_);if(Y===-1)Y=K;let $=q.toString("utf8",_,Y).trim();if(_=Y+1,!$)continue;try{z.push(JSON.parse($))}catch{}}return z}function sR5(q){let K=kB(q),_=K.length,z=0,Y=[];while(z<_){let $=K.indexOf(`
169`,z);if($===-1)$=_;let A=K.substring(z,$).trim();if(z=$+1,!A)continue;try{Y.push(JSON.parse(A))}catch{}}return Y}function LB(q){if(fh7)return oR5(q);if(typeof q==="string")return sR5(q);return aR5(q)}async function YA8(q){let O=[];try{let{size:K}=await iR5(q);if(K<=Mp6)return LB(await nR5(q));const _=Bz(O,await lR5(q,"r"),1);let z=Buffer.allocUnsafe(Mp6);let Y=0;let $=K-Mp6;while(Y<Mp6){let{bytesRead:M}=await _.read(z,Y,Mp6-Y,$+Y);if(M===0)break;Y+=M}let A=z.indexOf(10);if(A!==-1&&A<Y-1)return LB(z.subarray(A+1,Y));return LB(z.subarray(0,Y))}catch(w){var j=w,H=1}finally{var J=gz(O,j,H);J&&await J}}function Zh7(q,K){try{if(!q||q.trim()==="")return g6([K],null,4);let _=kB(q),z=l41(_);if(Array.isArray(z)){let Y=z.length,O=Jh7(_,Y===0?[0]:[Y],K,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});if(!O||O.length===0){let w=[...z,K];return g6(w,null,4)}return Mh7(_,O)}else return g6([K],null,4)}catch(_){return H6(_),g6([K],null,4)}}var rR5=8192,Ph7,m5,fh7,Mp6=104857600;var vO=y(()=>{Xh7();E8();VB();l8();Ph7=HP(Wh7,(q)=>q,50),m5=Object.assign(function(K,_=!0){if(!K)return null;let z=K.length>rR5?Wh7(K,_):Ph7(K,_);return z.ok?z.value:null},{cache:Ph7.cache});fh7=(()=>{if(typeof Bun>"u")return!1;let K=Bun.JSONL;if(!K?.parseChunk)return!1;return K.parseChunk})()});function Ue(q){switch(q){case"userSettings":return"user";case"projectSettings":return"project";case"localSettings":return"project, gitignored";case"flagSettings":return"cli flag";case"policySettings":return"managed"}}function tW6(q){switch(q){case"userSettings":return"User";case"projectSettings":return"Project";case"localSettings":return"Local";case"flagSettings":return"Flag";case"policySettings":return"Managed";case"plugin":return"Plugin";case"built-in":return"Built-in"}}function $A8(q){switch(q){case"userSettings":return"user settings";case"projectSettings":return"shared project settings";case"localSettings":return"project local settings";case"flagSettings":return"command line arguments";case"policySettings":return"enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"command configuration";case"session":return"current session"}}function Gh7(q){switch(q){case"userSettings":return"User settings";case"projectSettings":return"Shared project settings";case"localSettings":return"Project local settings";case"flagSettings":return"Command line arguments";case"policySettings":return"Enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"Command configuration";case"session":return"Current session"}}function Th7(q){if(q==="")return[];let K=q.split(",").map((z)=>z.trim()),_=[];for(let z of K)switch(z){case"user":_.push("userSettings");break;case"project":_.push("projectSettings");break;case"local":_.push("localSettings");break;default:throw Error(`Invalid setting source: ${z}. Valid options are: user, project, local`)}return _}function Jl(){let q=Ci8(),K=new Set(q);return K.add("policySettings"),K.add("flagSettings"),Array.from(K)}function $J(q){return Jl().includes(q)}var cT,Xp6,vh7="https://json.schemastore.org/claude-code-settings.json";var kO=y(()=>{v8();cT=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];Xp6=["localSettings","projectSettings","userSettings"]});function n41(q){AA8.set(q,Date.now())}function kh7(q,K){let _=AA8.get(q);if(_!==void 0&&Date.now()-_<K)return AA8.delete(q),!0;return!1}function Vh7(){AA8.clear()}var AA8;var OA8=y(()=>{AA8=new Map});import{join as tR5}from"path";var MP,RB;var qI=y(()=>{F4();vK();MP=_1(function(){switch(Z1()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),RB=_1(function(){return tR5(MP(),"managed-settings.d")})});function B6(q){let K;return()=>K??=q()}var eR5,qh5,Nh7;var yh7=y(()=>{x7();eR5=B6(()=>L.object({allowedDomains:L.array(L.string()).optional(),allowManagedDomainsOnly:L.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:L.array(L.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:L.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:L.boolean().optional(),httpProxyPort:L.number().optional(),socksProxyPort:L.number().optional()}).optional()),qh5=B6(()=>L.object({allowWrite:L.array(L.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:L.array(L.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:L.array(L.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:L.array(L.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:L.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),Nh7=B6(()=>L.object({enabled:L.boolean().optional(),failIfUnavailable:L.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:L.boolean().optional(),allowUnsandboxedCommands:L.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:eR5(),filesystem:qh5(),ignoreViolations:L.record(L.string(),L.array(L.string())).optional(),enableWeakerNestedSandbox:L.boolean().optional(),enableWeakerNetworkIsolation:L.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:L.array(L.string()).optional(),ripgrep:L.object({command:L.string(),args:L.array(L.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough())});function eW6(){return process.versions.bun!==void 0}function jj(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}function wA8(q,K){return{cmd:iW6(q)??q,args:K}}var i41=y(()=>{rk()});import{homedir as Kh5}from"os";import{join as r41}from"path";async function qD6(q){try{return!!await TO(q)}catch{return!1}}function Ah5(){return process.env.__CFBundleIdentifier==="com.conductor.app"}function Oh5(){if(process.env.CURSOR_TRACE_ID)return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("cursor"))return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("windsurf"))return"windsurf";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("antigravity"))return"antigravity";let q=process.env.__CFBundleIdentifier?.toLowerCase();if(q?.includes("vscodium"))return"codium";if(q?.includes("windsurf"))return"windsurf";if(q?.includes("com.google.android.studio"))return"androidstudio";if(q){for(let K of o41)if(q.includes(K))return K}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(process.platform==="darwin")return"pycharm";return"pycharm"}if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(Lh7())return"ssh-session";if(process.env.TERM){let K=process.env.TERM;if(K.includes("alacritty"))return"alacritty";if(K.includes("rxvt"))return"rxvt";if(K.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}function Lh7(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function KD6(){let q=process.env.CLAUDE_CODE_HOST_PLATFORM;if(q==="win32"||q==="darwin"||q==="linux")return q;return a1.platform}var XP,_h5,zh5,Yh5,Eh7,$h5,o41,wh5,a1;var y_=y(()=>{F4();H3();m8();i41();e7();rk();XP=_1(()=>{if(X8().existsSync(r41(c1(),".config.json")))return r41(c1(),".config.json");let q=`.claude${Aq1()}.json`;return r41(process.env.CLAUDE_CONFIG_DIR||Kh5(),q)}),_h5=_1(async()=>{try{let{default:q}=await Promise.resolve().then(() => (CK(),DW6));return await q.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}});zh5=_1(async()=>{let q=[];if(await qD6("npm"))q.push("npm");if(await qD6("yarn"))q.push("yarn");if(await qD6("pnpm"))q.push("pnpm");return q}),Yh5=_1(async()=>{let q=[];if(await qD6("bun"))q.push("bun");if(await qD6("deno"))q.push("deno");if(await qD6("node"))q.push("node");return q}),Eh7=_1(()=>{try{return X8().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(q){return!1}}),$h5=_1(()=>{try{if(!Eh7())return!1;let{cmd:q}=wA8("npm",[]);return q.startsWith("/mnt/c/")}catch(q){return!1}});o41=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];wh5=_1(()=>{if(i6(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(i6(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(i6(process.env.RENDER))return"render";if(i6(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(i6(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";try{if(X8().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase().startsWith("ec2"))return"aws-ec2"}catch{}if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(i6(process.env.GITHUB_ACTIONS))return"github-actions";if(i6(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(i6(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(X8().existsSync("/.dockerenv"))return"docker"}catch{}if(a1.platform==="darwin")return"unknown-darwin";if(a1.platform==="linux")return"unknown-linux";if(a1.platform==="win32")return"unknown-win32";return"unknown"});a1={hasInternetAccess:_h5,isCI:i6(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:Oh5(),isSSH:Lh7,getPackageManagers:zh5,getRuntimes:Yh5,isRunningWithBun:_1(eW6),isWslEnvironment:Eh7,isNpmFromWindowsPath:$h5,isConductor:Ah5,detectDeploymentEnvironment:wh5}});var A_,a41="∙",TE="✻",jA8="↑",Rh7="↓",Qe="↯",hh7="○",Sh7="◐",s41="●",Ch7="◉",t41="⏸",bh7="↻",xh7="←",NW="◇",Zh="◆",Ih7="※",uh7="▎",Pp6,HA8="·✔︎·",JA8="×";var zz=y(()=>{y_();A_=a1.platform==="darwin"?"⏺":"●",Pp6=["·|·","·/·","·—·","·\\·"]});var e41={};T8(e41,{PERMISSION_MODES:()=>pZ,INTERNAL_PERMISSION_MODES:()=>mh7,EXTERNAL_PERMISSION_MODES:()=>MA8});var MA8,mh7,pZ;var Wp6=y(()=>{MA8=["acceptEdits","bypassPermissions","default","dontAsk","plan"],mh7=[...MA8,"auto"],pZ=mh7});function Fh7(q){return!0}function XA8(q){return ph7[q]??ph7.default}function KI(q){return XA8(q).external}function vE(q){return pZ.includes(q)?q:"default"}function Ml(q){return XA8(q).title}function Uh7(q){return q==="default"||q===void 0}function Dp6(q){return XA8(q).symbol}function lT(q){return XA8(q).color}var Bh7,gh7,ph7;var yW=y(()=>{x7();zz();Wp6();Bh7=B6(()=>KK.enum(pZ)),gh7=B6(()=>KK.enum(MA8)),ph7={default:{title:"Default",shortTitle:"Default",symbol:"",color:"text",external:"default"},plan:{title:"Plan Mode",shortTitle:"Plan",symbol:t41,color:"planMode",external:"plan"},acceptEdits:{title:"Accept edits",shortTitle:"Accept",symbol:"⏵⏵",color:"autoAccept",external:"acceptEdits"},bypassPermissions:{title:"Bypass Permissions",shortTitle:"Bypass",symbol:"⏵⏵",color:"error",external:"bypassPermissions"},dontAsk:{title:"Don't Ask",shortTitle:"DontAsk",symbol:"⏵⏵",color:"error",external:"dontAsk"},...{auto:{title:"Auto mode",shortTitle:"Auto",symbol:"⏵⏵",color:"warning",external:"default"}}}});var Gh;var qK1=y(()=>{Gh=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged"]});var Qh7=()=>{};var _D6=y(()=>{qK1();Qh7()});var dh7,zD6="bash";var PA8=y(()=>{dh7=["bash","powershell"]});function jh5(){let q=L.object({type:L.literal("command").describe("Shell command hook type"),command:L.string().describe("Shell command to execute"),if:WA8(),shell:L.enum(dh7).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash."),timeout:L.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:L.string().optional().describe("Custom status message to display in spinner while hook runs"),once:L.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:L.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:L.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.")}),K=L.object({type:L.literal("prompt").describe("LLM prompt hook type"),prompt:L.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:WA8(),timeout:L.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:L.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),statusMessage:L.string().optional().describe("Custom status message to display in spinner while hook runs"),once:L.boolean().optional().describe("If true, hook runs once and is removed after execution")}),_=L.object({type:L.literal("http").describe("HTTP hook type"),url:L.string().url().describe("URL to POST the hook input JSON to"),if:WA8(),timeout:L.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:L.record(L.string(),L.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:L.array(L.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:L.string().optional().describe("Custom status message to display in spinner while hook runs"),once:L.boolean().optional().describe("If true, hook runs once and is removed after execution")}),z=L.object({type:L.literal("agent").describe("Agentic verifier hook type"),prompt:L.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:WA8(),timeout:L.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:L.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:L.string().optional().describe("Custom status message to display in spinner while hook runs"),once:L.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:q,PromptHookSchema:K,HttpHookSchema:_,AgentHookSchema:z}}var WA8,ch7,lh7,Th;var DA8=y(()=>{_D6();x7();PA8();WA8=B6(()=>L.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));ch7=B6(()=>{let{BashCommandHookSchema:q,PromptHookSchema:K,AgentHookSchema:_,HttpHookSchema:z}=jh5();return L.discriminatedUnion("type",[q,K,_,z])}),lh7=B6(()=>L.object({matcher:L.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:L.array(ch7()).describe("List of hooks to execute when the matcher matches")})),Th=B6(()=>L.partialRecord(L.enum(Gh),L.array(lh7())))});var KK1,Gu$,_K1,Hh5,nh7,Jh5,Mh5,Xh5,Ph5,Wh5,Dh5,fh5,hB,ih7;var f_6=y(()=>{x7();KK1=B6(()=>L.enum(["local","user","project","dynamic","enterprise","claudeai","managed"])),Gu$=B6(()=>L.enum(["stdio","sse","sse-ide","http","ws","sdk"])),_K1=B6(()=>L.object({type:L.literal("stdio").optional(),command:L.string().min(1,"Command cannot be empty"),args:L.array(L.string()).default([]),env:L.record(L.string(),L.string()).optional()})),Hh5=B6(()=>L.boolean()),nh7=B6(()=>L.object({clientId:L.string().optional(),callbackPort:L.number().int().positive().optional(),authServerMetadataUrl:L.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),xaa:Hh5().optional()})),Jh5=B6(()=>L.object({type:L.literal("sse"),url:L.string(),headers:L.record(L.string(),L.string()).optional(),headersHelper:L.string().optional(),oauth:nh7().optional()})),Mh5=B6(()=>L.object({type:L.literal("sse-ide"),url:L.string(),ideName:L.string(),ideRunningInWindows:L.boolean().optional()})),Xh5=B6(()=>L.object({type:L.literal("ws-ide"),url:L.string(),ideName:L.string(),authToken:L.string().optional(),ideRunningInWindows:L.boolean().optional()})),Ph5=B6(()=>L.object({type:L.literal("http"),url:L.string(),headers:L.record(L.string(),L.string()).optional(),headersHelper:L.string().optional(),oauth:nh7().optional()})),Wh5=B6(()=>L.object({type:L.literal("ws"),url:L.string(),headers:L.record(L.string(),L.string()).optional(),headersHelper:L.string().optional()})),Dh5=B6(()=>L.object({type:L.literal("sdk"),name:L.string()})),fh5=B6(()=>L.object({type:L.literal("claudeai-proxy"),url:L.string(),id:L.string()})),hB=B6(()=>L.union([_K1(),Jh5(),Mh5(),Xh5(),Ph5(),Wh5(),Dh5(),fh5()])),ih7=B6(()=>L.object({mcpServers:L.record(L.string(),hB())}))});function fp6(q,K){let _=q.toLowerCase();return K.autoUpdate??(_I.has(_)&&!Zh5.has(_))}function vh5(q){if(_I.has(q.toLowerCase()))return!1;if(Th5.test(q))return!0;return Gh5.test(q)}function ah7(q,K){let _=q.toLowerCase();if(!_I.has(_))return null;if(K.source==="github"){if(!(K.repo||"").toLowerCase().startsWith(`${fA8}/`))return`The name '${q}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${fA8}/' can use this name.`;return null}if(K.source==="git"&&K.url){let z=K.url.toLowerCase(),Y=z.includes("github.com/anthropics/"),$=z.includes("git@github.com:anthropics/");if(Y||$)return null;return`The name '${q}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${fA8}/' can use this name.`}return`The name '${q}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${fA8}' organization.`}function Gp6(q){return typeof q==="string"&&q.startsWith("./")}function SB(q){return q.source==="file"||q.source==="directory"}var _I,Zh5,Gh5,Th5,fA8="anthropics",Xl,YD6,rh7,YK1,$K1,sh7,AK1,kh5,ZA8,Vh5,Nh5,yh5,Eh5,Lh5,Rh5,oh7,hh5,Sh5,th7,Ch5,bh5,$D6,xh5,eh7,Ih5,Z_6,Zp6,zK1,qS7,uh5,OK1,de,AD6,mh5,ph5,yu$,Bh5,Tp6,gh5,Fh5,vp6,Eu$,Uh5,OD6;var BZ=y(()=>{x7();DA8();f_6();_I=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),Zh5=new Set(["knowledge-work-plugins"]);Gh5=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,Th5=/[^\u0020-\u007E]/;Xl=B6(()=>L.string().startsWith("./")),YD6=B6(()=>Xl().endsWith(".json")),rh7=B6(()=>L.union([Xl().refine((q)=>q.endsWith(".mcpb")||q.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),L.string().url().refine((q)=>q.endsWith(".mcpb")||q.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),YK1=B6(()=>Xl().endsWith(".md")),$K1=B6(()=>L.union([YK1(),Xl()])),sh7=B6(()=>L.string().min(1,"Marketplace must have a name").refine((q)=>!q.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((q)=>!q.includes("/")&&!q.includes("\\")&&!q.includes("..")&&q!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((q)=>!vh5(q),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine((q)=>q.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine((q)=>q.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'})),AK1=B6(()=>L.object({name:L.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:L.string().optional().describe("Contact email for support or feedback"),url:L.string().optional().describe("Website, GitHub profile, or organization URL")})),kh5=B6(()=>L.object({name:L.string().min(1,"Plugin name cannot be empty").refine((q)=>!q.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),version:L.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:L.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:AK1().optional().describe("Information about the plugin creator or maintainer"),homepage:L.string().url().optional().describe("Plugin homepage or documentation URL"),repository:L.string().optional().describe("Source code repository URL"),license:L.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:L.array(L.string()).optional().describe("Tags for plugin discovery and categorization"),dependencies:L.array(ph5()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),ZA8=B6(()=>L.object({description:L.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:L.lazy(()=>Th()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),Vh5=B6(()=>L.object({hooks:L.union([YD6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),L.lazy(()=>Th()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),L.array(L.union([YD6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),L.lazy(()=>Th()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),Nh5=B6(()=>L.object({source:$K1().optional().describe("Path to command markdown file, relative to plugin root"),content:L.string().optional().describe("Inline markdown content for the command"),description:L.string().optional().describe("Command description override"),argumentHint:L.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:L.string().optional().describe("Default model for this command"),allowedTools:L.array(L.string()).optional().describe("Tools allowed when command runs")}).refine((q)=>q.source&&!q.content||!q.source&&q.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),yh5=B6(()=>L.object({commands:L.union([$K1().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root"),L.array($K1().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional command files or skill directories"),L.record(L.string(),Nh5()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about""/plugin:about")')])})),Eh5=B6(()=>L.object({agents:L.union([YK1().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),L.array(YK1().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional agent files")])})),Lh5=B6(()=>L.object({skills:L.union([Xl().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),L.array(Xl().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional skill directories")])})),Rh5=B6(()=>L.object({outputStyles:L.union([Xl().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root"),L.array(Xl().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional output styles directories or files")])})),oh7=B6(()=>L.string().min(1)),hh5=B6(()=>L.string().min(2).refine((q)=>q.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),Sh5=B6(()=>L.object({mcpServers:L.union([YD6().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),rh7().describe("Path or URL to MCPB file containing MCP server configuration"),L.record(L.string(),hB()).describe("MCP server configurations keyed by server name"),L.array(L.union([YD6().describe("Path to MCP servers configuration file"),rh7().describe("Path or URL to MCPB file"),L.record(L.string(),hB()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),th7=B6(()=>L.object({type:L.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:L.string().describe("Human-readable label shown in the config dialog"),description:L.string().describe("Help text shown beneath the field in the config dialog"),required:L.boolean().optional().describe("If true, validation fails when this field is empty"),default:L.union([L.string(),L.number(),L.boolean(),L.array(L.string())]).optional().describe("Default value used when the user provides nothing"),multiple:L.boolean().optional().describe("For string type: allow an array of strings"),sensitive:L.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:L.number().optional().describe("Minimum value (number type only)"),max:L.number().optional().describe("Maximum value (number type only)")}).strict()),Ch5=B6(()=>L.object({userConfig:L.record(L.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),th7()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage (macOS keychain or .credentials.json). Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. "+"Note: sensitive values share a single keychain entry with OAuth tokens — keep "+"secret counts small to stay under the ~2KB stdin-safe limit (see INC-3028).")})),bh5=B6(()=>L.object({channels:L.array(L.object({server:L.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:L.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:L.record(L.string(),th7()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),$D6=B6(()=>L.strictObject({command:L.string().min(1).refine((q)=>{if(q.includes(" ")&&!q.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:L.array(oh7()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:L.record(hh5(),oh7()).refine((q)=>Object.keys(q).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:L.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:L.record(L.string(),L.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:L.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:L.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:L.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:L.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:L.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:L.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:L.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),xh5=B6(()=>L.object({lspServers:L.union([YD6().describe("Path to .lsp.json configuration file relative to plugin root"),L.record(L.string(),$D6()).describe("LSP server configurations keyed by server name"),L.array(L.union([YD6().describe("Path to LSP configuration file"),L.record(L.string(),$D6()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),eh7=B6(()=>L.string().refine((q)=>!q.includes("..")&&!q.includes("//"),"Package name cannot contain path traversal patterns").refine((q)=>{let K=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,_=/^[a-z0-9][a-z0-9-._]*$/;return K.test(q)||_.test(q)},"Invalid npm package name format")),Ih5=B6(()=>L.object({settings:L.record(L.string(),L.unknown()).optional().describe("Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)")})),Z_6=B6(()=>L.object({...kh5().shape,...Vh5().partial().shape,...yh5().partial().shape,...Eh5().partial().shape,...Lh5().partial().shape,...Rh5().partial().shape,...bh5().partial().shape,...Sh5().partial().shape,...xh5().partial().shape,...Ih5().partial().shape,...Ch5().partial().shape})),Zp6=B6(()=>L.discriminatedUnion("source",[L.object({source:L.literal("url"),url:L.string().url().describe("Direct URL to marketplace.json file"),headers:L.record(L.string(),L.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),L.object({source:L.literal("github"),repo:L.string().describe("GitHub repository in owner/repo format"),ref:L.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:L.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:L.array(L.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),L.object({source:L.literal("git"),url:L.string().describe("Full git repository URL"),ref:L.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:L.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:L.array(L.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),L.object({source:L.literal("npm"),package:eh7().describe("NPM package containing marketplace.json")}),L.object({source:L.literal("file"),path:L.string().describe("Local file path to marketplace.json")}),L.object({source:L.literal("directory"),path:L.string().describe("Local directory containing .claude-plugin/marketplace.json")}),L.object({source:L.literal("hostPattern"),hostPattern:L.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),L.object({source:L.literal("pathPattern"),pathPattern:L.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),L.object({source:L.literal("settings"),name:sh7().refine((q)=>!_I.has(q.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:L.array(uh5()).describe("Plugin entries declared inline in settings.json"),owner:AK1().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),zK1=B6(()=>L.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),qS7=B6(()=>L.union([Xl().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),L.object({source:L.literal("npm"),package:eh7().or(L.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:L.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:L.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),L.object({source:L.literal("pip"),package:L.string().describe("Python package name as it appears on PyPI"),version:L.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:L.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),L.object({source:L.literal("url"),url:L.string().describe("Full git repository URL (https:// or git@)"),ref:L.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:zK1().optional().describe("Specific commit SHA to use")}),L.object({source:L.literal("github"),repo:L.string().describe("GitHub repository in owner/repo format"),ref:L.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:zK1().optional().describe("Specific commit SHA to use")}),L.object({source:L.literal("git-subdir"),url:L.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:L.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:L.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:zK1().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded.")])),uh5=B6(()=>L.object({name:L.string().min(1,"Plugin name cannot be empty").refine((q)=>!q.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:qS7().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:L.string().optional(),version:L.string().optional(),strict:L.boolean().optional()}).refine((q)=>typeof q.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}));OK1=B6(()=>Z_6().partial().extend({name:L.string().min(1,"Plugin name cannot be empty").refine((q)=>!q.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:qS7().describe("Where to fetch the plugin from"),category:L.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:L.array(L.string()).optional().describe("Tags for searchability and discovery"),strict:L.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")})),de=B6(()=>L.object({name:sh7(),owner:AK1().describe("Marketplace maintainer or curator information"),plugins:L.array(OK1()).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:L.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:L.object({pluginRoot:L.string().optional().describe("Base path for relative plugin sources"),version:L.string().optional().describe("Marketplace version"),description:L.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:L.array(L.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.")})),AD6=B6(()=>L.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace")),mh5=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,ph5=B6(()=>L.union([L.string().regex(mh5,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((q)=>q.replace(/@\^[^@]*$/,"")),L.object({name:L.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:L.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform((q)=>q.marketplace?`${q.name}@${q.marketplace}`:q.name)])),yu$=B6(()=>L.union([AD6(),L.object({id:AD6().describe('Plugin identifier (e.g., "formatter@tools")'),version:L.string().optional().describe('Version constraint (e.g., "^2.0.0")'),required:L.boolean().optional().describe("If true, cannot be disabled"),config:L.record(L.string(),L.unknown()).optional().describe("Plugin-specific configuration")})])),Bh5=B6(()=>L.object({version:L.string().describe("Currently installed version"),installedAt:L.string().describe("ISO 8601 timestamp of installation"),lastUpdated:L.string().optional().describe("ISO 8601 timestamp of last update"),installPath:L.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:L.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")})),Tp6=B6(()=>L.object({version:L.literal(1).describe("Schema version 1"),plugins:L.record(AD6(),Bh5()).describe("Map of plugin IDs to their installation metadata")})),gh5=B6(()=>L.enum(["managed","user","project","local"])),Fh5=B6(()=>L.object({scope:gh5().describe("Installation scope"),projectPath:L.string().optional().describe("Project path (required for project/local scopes)"),installPath:L.string().describe("Absolute path to the versioned plugin directory"),version:L.string().optional().describe("Currently installed version"),installedAt:L.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:L.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:L.string().optional().describe("Git commit SHA for git-based plugins")})),vp6=B6(()=>L.object({version:L.literal(2).describe("Schema version 2"),plugins:L.record(AD6(),L.array(Fh5())).describe("Map of plugin IDs to arrays of installation entries")})),Eu$=B6(()=>L.union([Tp6(),vp6()])),Uh5=B6(()=>L.object({source:Zp6().describe("Where to fetch the marketplace from"),installLocation:L.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:L.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:L.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),OD6=B6(()=>L.record(L.string(),Uh5()))});function Z2(q){let K=q.replace(/[^a-zA-Z0-9_-]/g,"_");if(q.startsWith("claude.ai "))K=K.replace(/_+/g,"_").replace(/^_|_$/g,"");return K}function nT(q){let K=q.split("__"),[_,z,...Y]=K;if(_!=="mcp"||!z)return null;let $=Y.length>0?Y.join("__"):void 0;return{serverName:z,toolName:$}}function kE(q){return`mcp__${Z2(q)}__`}function G_6(q,K){return`${kE(q)}${Z2(K)}`}function wK1(q){return q.mcpInfo?G_6(q.mcpInfo.serverName,q.mcpInfo.toolName):q.name}function GA8(q,K){let _=`mcp__${Z2(K)}__`;return q.replace(_,"")}function TA8(q){let K=q.replace(/\s*\(MCP\)\s*$/,"");K=K.trim();let _=K.indexOf(" - ");if(_!==-1)return K.substring(_+3).trim();return K}var ok=()=>{};var v4="Agent",CB="Task",vA8="verification",KS7;var Z$=y(()=>{KS7=new Set(["Explore","Plan"])});var ak="TaskOutput";var zI="TaskStop",_S7=`
170- Stops a running background task by its ID

Callers 15

IFunction · 0.85
SFunction · 0.85
iFunction · 0.85
XFunction · 0.85
pFunction · 0.85
VFunction · 0.85
WxFunction · 0.85
sFunction · 0.85
renderItemFunction · 0.85
N6zFunction · 0.85
C1zFunction · 0.85
CN6Function · 0.85

Calls 15

vFunction · 0.85
PFunction · 0.85
xCFunction · 0.85
WwFunction · 0.85
VFunction · 0.85
C8Function · 0.85
d6Function · 0.85
OFunction · 0.85
RFunction · 0.85
gFunction · 0.85
iFunction · 0.85
G6Function · 0.85

Tested by

no test coverage detected