(q)
| 2495 | ${q.result}`};return{type:"tool_result",tool_use_id:K,content:`Launching skill: ${q.commandName}`}},renderToolResultMessage:M3K,renderToolUseMessage:X3K,renderToolUseProgressMessage:Bx8,renderToolUseRejectedMessage:P3K,renderToolUseErrorMessage:W3K}),Ndz=new Set(["type","progressMessage","contentLength","argNames","model","effort","source","pluginInfo","disableNonInteractive","skillRoot","context","agent","getPromptForCommand","frontmatterKeys","name","description","hasUserSpecifiedDescription","isEnabled","isHidden","aliases","isMcp","argumentHint","whenToUse","paths","version","disableModelInvocation","userInvocable","loadedFrom","immediate","userFacingName"])});import{randomUUID as Edz}from"crypto";function T3K({serverName:q,files:K}){let _=Edz();N(`LSP Diagnostics: Registering ${K.length} diagnostic file(s) from ${q} (ID: ${_})`),ja.set(_,{serverName:q,files:K,timestamp:Date.now(),attachmentSent:!1})}function G3K(q){switch(q){case"Error":return 1;case"Warning":return 2;case"Info":return 3;case"Hint":return 4;default:return 4}}function v3K(q){return g6({message:q.message,severity:q.severity,range:q.range,source:q.source||null,code:q.code||null})}function Rdz(q){let K=new Map,_=[];for(let z of q){if(!K.has(z.uri))K.set(z.uri,new Set),_.push({uri:z.uri,diagnostics:[]});let Y=K.get(z.uri),$=_.find((O)=>O.uri===z.uri),A=DK6.get(z.uri)||new Set;for(let O of z.diagnostics)try{let w=v3K(O);if(Y.has(w)||A.has(w))continue;Y.add(w),$.diagnostics.push(O)}catch(w){let j=x1(w),H=O.message?.substring(0,100)||"<no message>";H6(Error(`Failed to deduplicate diagnostic in ${z.uri}: ${j.message}. Diagnostic message: ${H}`)),$.diagnostics.push(O)}}return _.filter((z)=>z.diagnostics.length>0)}function k3K(){N(`LSP Diagnostics: Checking registry - ${ja.size} pending`);let q=[],K=new Set,_=[];for(let j of ja.values())if(!j.attachmentSent)q.push(...j.files),K.add(j.serverName),_.push(j);if(q.length===0)return[];let z;try{z=Rdz(q)}catch(j){let H=x1(j);H6(Error(`Failed to deduplicate LSP diagnostics: ${H.message}`)),z=q}for(let j of _)j.attachmentSent=!0;for(let[j,H]of ja)if(H.attachmentSent)ja.delete(j);let Y=q.reduce((j,H)=>j+H.diagnostics.length,0),$=z.reduce((j,H)=>j+H.diagnostics.length,0);if(Y>$)N(`LSP Diagnostics: Deduplication removed ${Y-$} duplicate diagnostic(s)`);let A=0,O=0;for(let j of z){if(j.diagnostics.sort((J,M)=>G3K(J.severity)-G3K(M.severity)),j.diagnostics.length>Ux8)O+=j.diagnostics.length-Ux8,j.diagnostics=j.diagnostics.slice(0,Ux8);let H=Z3K-A;if(j.diagnostics.length>H)O+=j.diagnostics.length-H,j.diagnostics=j.diagnostics.slice(0,H);A+=j.diagnostics.length}if(z=z.filter((j)=>j.diagnostics.length>0),O>0)N(`LSP Diagnostics: Volume limiting removed ${O} diagnostic(s) (max ${Ux8}/file, ${Z3K} total)`);for(let j of z){if(!DK6.has(j.uri))DK6.set(j.uri,new Set);let H=DK6.get(j.uri);for(let J of j.diagnostics)try{H.add(v3K(J))}catch(M){let X=x1(M),P=J.message?.substring(0,100)||"<no message>";H6(Error(`Failed to track delivered diagnostic in ${j.uri}: ${X.message}. Diagnostic message: ${P}`))}}let w=z.reduce((j,H)=>j+H.diagnostics.length,0);if(w===0)return N("LSP Diagnostics: No new diagnostics to deliver (all filtered by deduplication)"),[];return N(`LSP Diagnostics: Delivering ${z.length} file(s) with ${w} diagnostic(s) from ${K.size} server(s)`),[{serverName:Array.from(K).join(", "),files:z}]}function V3K(){N(`LSP Diagnostics: Clearing ${ja.size} pending diagnostic(s)`),ja.clear()}function N3K(){N(`LSP Diagnostics: Resetting all state (${ja.size} pending, ${DK6.size} files tracked)`),ja.clear(),DK6.clear()}function Qx8(q){if(DK6.has(q))N(`LSP Diagnostics: Clearing delivered diagnostics for ${q}`),DK6.delete(q)}var Ux8=10,Z3K=30,Ldz=500,ja,DK6;var OL6=y(()=>{gW6();_8();y8();E8();l8();ja=new Map,DK6=new nk({max:Ldz})});import{readFile as y3K}from"fs/promises";import{join as hdz,relative as Sdz,resolve as Lo1}from"path";function Cdz(q,K){let _=Lo1(q),z=Lo1(q,K),Y=Sdz(_,z);if(Y.startsWith("..")||Lo1(Y)===Y)return null;return z}async function v68(q,K=[]){let _={},z=hdz(q.path,".lsp.json");try{let Y=await y3K(z,"utf-8"),$=r8(Y),A=L.record(L.string(),$D6()).safeParse($);if(A.success)Object.assign(_,A.data);else{let O=`LSP config validation failed for .lsp.json in plugin ${q.name}: ${A.error.message}`;H6(Error(O)),K.push({type:"lsp-config-invalid",plugin:q.name,serverName:".lsp.json",validationError:A.error.message,source:"plugin"})}}catch(Y){if(!_7(Y)){let $=Y instanceof Error?`Failed to read/parse .lsp.json in plugin ${q.name}: ${Y.message}`:`Failed to read/parse .lsp.json file in plugin ${q.name}`;H6(x1(Y)),K.push({type:"lsp-config-invalid",plugin:q.name,serverName:".lsp.json",validationError:Y instanceof Error?`Failed to parse JSON: ${Y.message}`:"Failed to parse JSON file",source:"plugin"})}}if(q.manifest.lspServers){let Y=await bdz(q.manifest.lspServers,q.path,q.name,K);if(Y)Object.assign(_,Y)}return Object.keys(_).length>0?_:void 0}async function bdz(q,K,_,z){let Y={},$=Array.isArray(q)?q:[q];for(let A of $)if(typeof A==="string"){let O=Cdz(K,A);if(!O){let w=`Security: Path traversal attempt blocked in plugin ${_}: ${A}`;H6(Error(w)),N(w,{level:"warn"}),z.push({type:"lsp-config-invalid",plugin:_,serverName:A,validationError:"Invalid path: must be relative and within plugin directory",source:"plugin"});continue}try{let w=await y3K(O,"utf-8"),j=r8(w),H=L.record(L.string(),$D6()).safeParse(j);if(H.success)Object.assign(Y,H.data);else{let J=`LSP config validation failed for ${A} in plugin ${_}: ${H.error.message}`;H6(Error(J)),z.push({type:"lsp-config-invalid",plugin:_,serverName:A,validationError:H.error.message,source:"plugin"})}}catch(w){let j=w instanceof Error?`Failed to read/parse LSP config from ${A} in plugin ${_}: ${w.message}`:`Failed to read/parse LSP config file ${A} in plugin ${_}`;H6(x1(w)),z.push({type:"lsp-config-invalid",plugin:_,serverName:A,validationError:w instanceof Error?`Failed to parse JSON: ${w.message}`:"Failed to parse JSON file",source:"plugin"})}}else for(let[O,w]of Object.entries(A)){let j=$D6().safeParse(w);if(j.success)Y[O]=j.data;else{let H=`LSP config validation failed for inline server "${O}" in plugin ${_}: ${j.error.message}`;H6(Error(H)),z.push({type:"lsp-config-invalid",plugin:_,serverName:O,validationError:j.error.message,source:"plugin"})}}return Object.keys(Y).length>0?Y:void 0}function xdz(q,K,_,z){let Y=[],$=(w)=>{let j=dF(w,K);if(_)j=kk6(j,_);let{expanded:H,missingVars:J}=$N6(j);return Y.push(...J),H},A={...q};if(A.command)A.command=$(A.command);if(A.args)A.args=A.args.map((w)=>$(w));let O={CLAUDE_PLUGIN_ROOT:K.path,CLAUDE_PLUGIN_DATA:ei(K.source),...A.env||{}};for(let[w,j]of Object.entries(O))if(w!=="CLAUDE_PLUGIN_ROOT"&&w!=="CLAUDE_PLUGIN_DATA")O[w]=$(j);if(A.env=O,A.workspaceFolder)A.workspaceFolder=$(A.workspaceFolder);if(Y.length>0){let j=`Missing environment variables in plugin LSP config: ${[...new Set(Y)].join(", ")}`;H6(Error(j)),N(j,{level:"warn"})}return A}function Idz(q,K){let _={};for(let[z,Y]of Object.entries(q)){let $=`plugin:${K}:${z}`;_[$]={...Y,scope:"dynamic",source:K}}return _}async function E3K(q,K=[]){if(!q.enabled)return;let _=q.lspServers||await v68(q,K);if(!_)return;let z=q.manifest.userConfig?VG(Fi6(q)):void 0,Y={};for(let[$,A]of Object.entries(_))Y[$]=xdz(A,q,z,K);return Idz(Y,q.name)}var dx8=y(()=>{x7();_8();y8();E8();l8();aV();mu();BZ()});async function L3K(){let q={};try{let{enabled:K}=await ZJ(),_=await Promise.all(K.map(async(z)=>{let Y=[];try{let $=await E3K(z,Y);return{plugin:z,scopedServers:$,errors:Y}}catch($){return N(`Failed to load LSP servers for plugin ${z.name}: ${$}`,{level:"error"}),{plugin:z,scopedServers:void 0,errors:Y}}}));for(let{plugin:z,scopedServers:Y,errors:$}of _){let A=Y?Object.keys(Y).length:0;if(A>0)Object.assign(q,Y),N(`Loaded ${A} LSP server(s) from plugin: ${z.name}`);if($.length>0)N(`${$.length} error(s) loading LSP servers from plugin: ${z.name}`)}N(`Total LSP servers loaded: ${Object.keys(q).length}`)}catch(K){H6(x1(K)),N(`Error loading LSP servers: ${d6(K)}`)}return{servers:q}}var R3K=y(()=>{_8();y8();E8();dx8();bj()});var wL6=m((C3K)=>{Object.defineProperty(C3K,"__esModule",{value:!0});C3K.stringArray=C3K.array=C3K.func=C3K.error=C3K.number=C3K.string=C3K.boolean=void 0;function udz(q){return q===!0||q===!1}C3K.boolean=udz;function h3K(q){return typeof q==="string"||q instanceof String}C3K.string=h3K;function mdz(q){return typeof q==="number"||q instanceof Number}C3K.number=mdz;function pdz(q){return q instanceof Error}C3K.error=pdz;function Bdz(q){return typeof q==="function"}C3K.func=Bdz;function S3K(q){return Array.isArray(q)}C3K.array=S3K;function gdz(q){return S3K(q)&&q.every((K)=>h3K(K))}C3K.stringArray=gdz});var So1=m((_9K)=>{Object.defineProperty(_9K,"__esModule",{value:!0});_9K.Message=_9K.NotificationType9=_9K.NotificationType8=_9K.NotificationType7=_9K.NotificationType6=_9K.NotificationType5=_9K.NotificationType4=_9K.NotificationType3=_9K.NotificationType2=_9K.NotificationType1=_9K.NotificationType0=_9K.NotificationType=_9K.RequestType9=_9K.RequestType8=_9K.RequestType7=_9K.RequestType6=_9K.RequestType5=_9K.RequestType4=_9K.RequestType3=_9K.RequestType2=_9K.RequestType1=_9K.RequestType=_9K.RequestType0=_9K.AbstractMessageSignature=_9K.ParameterStructures=_9K.ResponseError=_9K.ErrorCodes=void 0;var hj6=wL6(),Ro1;(function(q){q.ParseError=-32700,q.InvalidRequest=-32600,q.MethodNotFound=-32601,q.InvalidParams=-32602,q.InternalError=-32603,q.jsonrpcReservedErrorRangeStart=-32099,q.serverErrorStart=-32099,q.MessageWriteError=-32099,q.MessageReadError=-32098,q.PendingResponseRejected=-32097,q.ConnectionInactive=-32096,q.ServerNotInitialized=-32002,q.UnknownErrorCode=-32001,q.jsonrpcReservedErrorRangeEnd=-32000,q.serverErrorEnd=-32000})(Ro1||(_9K.ErrorCodes=Ro1={}));class ho1 extends Error{constructor(q,K,_){super(K);this.code=hj6.number(q)?q:Ro1.UnknownErrorCode,this.data=_,Object.setPrototypeOf(this,ho1.prototype)}toJson(){let q={code:this.code,message:this.message};if(this.data!==void 0)q.data=this.data;return q}}_9K.ResponseError=ho1;class iG{constructor(q){this.kind=q}static is(q){return q===iG.auto||q===iG.byName||q===iG.byPosition}toString(){return this.kind}}_9K.ParameterStructures=iG;iG.auto=new iG("auto");iG.byPosition=new iG("byPosition");iG.byName=new iG("byName");class Uj{constructor(q,K){this.method=q,this.numberOfParams=K}get parameterStructures(){return iG.auto}}_9K.AbstractMessageSignature=Uj;class I3K extends Uj{constructor(q){super(q,0)}}_9K.RequestType0=I3K;class u3K extends Uj{constructor(q,K=iG.auto){super(q,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}}_9K.RequestType=u3K;class m3K extends Uj{constructor(q,K=iG.auto){super(q,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}}_9K.RequestType1=m3K;class p3K extends Uj{constructor(q){super(q,2)}}_9K.RequestType2=p3K;class B3K extends Uj{constructor(q){super(q,3)}}_9K.RequestType3=B3K;class g3K extends Uj{constructor(q){super(q,4)}}_9K.RequestType4=g3K;class F3K extends Uj{constructor(q){super(q,5)}}_9K.RequestType5=F3K;class U3K extends Uj{constructor(q){super(q,6)}}_9K.RequestType6=U3K;class Q3K extends Uj{constructor(q){super(q,7)}}_9K.RequestType7=Q3K;class d3K extends Uj{constructor(q){super(q,8)}}_9K.RequestType8=d3K;class c3K extends Uj{constructor(q){super(q,9)}}_9K.RequestType9=c3K;class l3K extends Uj{constructor(q,K=iG.auto){super(q,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}}_9K.NotificationType=l3K;class n3K extends Uj{constructor(q){super(q,0)}}_9K.NotificationType0=n3K;class i3K extends Uj{constructor(q,K=iG.auto){super(q,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}}_9K.NotificationType1=i3K;class r3K extends Uj{constructor(q){super(q,2)}}_9K.NotificationType2=r3K;class o3K extends Uj{constructor(q){super(q,3)}}_9K.NotificationType3=o3K;class a3K extends Uj{constructor(q){super(q,4)}}_9K.NotificationType4=a3K;class s3K extends Uj{constructor(q){super(q,5)}}_9K.NotificationType5=s3K;class t3K extends Uj{constructor(q){super(q,6)}}_9K.NotificationType6=t3K;class e3K extends Uj{constructor(q){super(q,7)}}_9K.NotificationType7=e3K;class q9K extends Uj{constructor(q){super(q,8)}}_9K.NotificationType8=q9K;class K9K extends Uj{constructor(q){super(q,9)}}_9K.NotificationType9=K9K;var x3K;(function(q){function K(Y){let $=Y;return $&&hj6.string($.method)&&(hj6.string($.id)||hj6.number($.id))}q.isRequest=K;function _(Y){let $=Y;return $&&hj6.string($.method)&&Y.id===void 0}q.isNotification=_;function z(Y){let $=Y;return $&&($.result!==void 0||!!$.error)&&(hj6.string($.id)||hj6.number($.id)||$.id===null)}q.isResponse=z})(x3K||(_9K.Message=x3K={}))});var bo1=m((A9K)=>{var Y9K;Object.defineProperty(A9K,"__esModule",{value:!0});A9K.LRUCache=A9K.LinkedMap=A9K.Touch=void 0;var rG;(function(q){q.None=0,q.First=1,q.AsOld=q.First,q.Last=2,q.AsNew=q.Last})(rG||(A9K.Touch=rG={}));class Co1{constructor(){this[Y9K]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(q){return this._map.has(q)}get(q,K=rG.None){let _=this._map.get(q);if(!_)return;if(K!==rG.None)this.touch(_,K);return _.value}set(q,K,_=rG.None){let z=this._map.get(q);if(z){if(z.value=K,_!==rG.None)this.touch(z,_)}else{switch(z={key:q,value:K,next:void 0,previous:void 0},_){case rG.None:this.addItemLast(z);break;case rG.First:this.addItemFirst(z);break;case rG.Last:this.addItemLast(z);break;default:this.addItemLast(z);break}this._map.set(q,z),this._size++}return this}delete(q){return!!this.remove(q)}remove(q){let K=this._map.get(q);if(!K)return;return this._map.delete(q),this.removeItem(K),this._size--,K.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let q=this._head;return this._map.delete(q.key),this.removeItem(q),this._size--,q.value}forEach(q,K){let _=this._state,z=this._head;while(z){if(K)q.bind(K)(z.value,z.key,this);else q(z.value,z.key,this);if(this._state!==_)throw Error("LinkedMap got modified during iteration.");z=z.next}}keys(){let q=this._state,K=this._head,_={[Symbol.iterator]:()=>{return _},next:()=>{if(this._state!==q)throw Error("LinkedMap got modified during iteration.");if(K){let z={value:K.key,done:!1};return K=K.next,z}else return{value:void 0,done:!0}}};return _}values(){let q=this._state,K=this._head,_={[Symbol.iterator]:()=>{return _},next:()=>{if(this._state!==q)throw Error("LinkedMap got modified during iteration.");if(K){let z={value:K.value,done:!1};return K=K.next,z}else return{value:void 0,done:!0}}};return _}entries(){let q=this._state,K=this._head,_={[Symbol.iterator]:()=>{return _},next:()=>{if(this._state!==q)throw Error("LinkedMap got modified during iteration.");if(K){let z={value:[K.key,K.value],done:!1};return K=K.next,z}else return{value:void 0,done:!0}}};return _}[(Y9K=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(q){if(q>=this.size)return;if(q===0){this.clear();return}let K=this._head,_=this.size;while(K&&_>q)this._map.delete(K.key),K=K.next,_--;if(this._head=K,this._size=_,K)K.previous=void 0;this._state++}addItemFirst(q){if(!this._head&&!this._tail)this._tail=q;else if(!this._head)throw Error("Invalid list");else q.next=this._head,this._head.previous=q;this._head=q,this._state++}addItemLast(q){if(!this._head&&!this._tail)this._head=q;else if(!this._tail)throw Error("Invalid list");else q.previous=this._tail,this._tail.next=q;this._tail=q,this._state++}removeItem(q){if(q===this._head&&q===this._tail)this._head=void 0,this._tail=void 0;else if(q===this._head){if(!q.next)throw Error("Invalid list");q.next.previous=void 0,this._head=q.next}else if(q===this._tail){if(!q.previous)throw Error("Invalid list");q.previous.next=void 0,this._tail=q.previous}else{let{next:K,previous:_}=q;if(!K||!_)throw Error("Invalid list");K.previous=_,_.next=K}q.next=void 0,q.previous=void 0,this._state++}touch(q,K){if(!this._head||!this._tail)throw Error("Invalid list");if(K!==rG.First&&K!==rG.Last)return;if(K===rG.First){if(q===this._head)return;let{next:_,previous:z}=q;if(q===this._tail)z.next=void 0,this._tail=z;else _.previous=z,z.next=_;q.previous=void 0,q.next=this._head,this._head.previous=q,this._head=q,this._state++}else if(K===rG.Last){if(q===this._tail)return;let{next:_,previous:z}=q;if(q===this._head)_.previous=void 0,this._head=_;else _.previous=z,z.next=_;q.next=void 0,q.previous=this._tail,this._tail.next=q,this._tail=q,this._state++}}toJSON(){let q=[];return this.forEach((K,_)=>{q.push([_,K])}),q}fromJSON(q){this.clear();for(let[K,_]of q)this.set(K,_)}}A9K.LinkedMap=Co1;class $9K extends Co1{constructor(q,K=1){super();this._limit=q,this._ratio=Math.min(Math.max(0,K),1)}get limit(){return this._limit}set limit(q){this._limit=q,this.checkTrim()}get ratio(){return this._ratio}set ratio(q){this._ratio=Math.min(Math.max(0,q),1),this.checkTrim()}get(q,K=rG.AsNew){return super.get(q,K)}peek(q){return super.get(q,rG.None)}set(q,K){return super.set(q,K,rG.Last),this.checkTrim(),this}checkTrim(){if(this.size>this._limit)this.trimOld(Math.round(this._limit*this._ratio))}}A9K.LRUCache=$9K});var J9K=m((j9K)=>{Object.defineProperty(j9K,"__esModule",{value:!0});j9K.Disposable=void 0;var w9K;(function(q){function K(_){return{dispose:_}}q.create=K})(w9K||(j9K.Disposable=w9K={}))});var fK6=m((M9K)=>{Object.defineProperty(M9K,"__esModule",{value:!0});var xo1;function Io1(){if(xo1===void 0)throw Error("No runtime abstraction layer installed");return xo1}(function(q){function K(_){if(_===void 0)throw Error("No runtime abstraction layer provided");xo1=_}q.install=K})(Io1||(Io1={}));M9K.default=Io1});var jL6=m((W9K)=>{Object.defineProperty(W9K,"__esModule",{value:!0});W9K.Emitter=W9K.Event=void 0;var vcz=fK6(),X9K;(function(q){let K={dispose(){}};q.None=function(){return K}})(X9K||(W9K.Event=X9K={}));class P9K{add(q,K=null,_){if(!this._callbacks)this._callbacks=[],this._contexts=[];if(this._callbacks.push(q),this._contexts.push(K),Array.isArray(_))_.push({dispose:()=>this.remove(q,K)})}remove(q,K=null){if(!this._callbacks)return;let _=!1;for(let z=0,Y=this._callbacks.length;z<Y;z++)if(this._callbacks[z]===q)if(this._contexts[z]===K){this._callbacks.splice(z,1),this._contexts.splice(z,1);return}else _=!0;if(_)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...q){if(!this._callbacks)return[];let K=[],_=this._callbacks.slice(0),z=this._contexts.slice(0);for(let Y=0,$=_.length;Y<$;Y++)try{K.push(_[Y].apply(z[Y],q))}catch(A){(0,vcz.default)().console.error(A)}return K}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class cx8{constructor(q){this._options=q}get event(){if(!this._event)this._event=(q,K,_)=>{if(!this._callbacks)this._callbacks=new P9K;if(this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty())this._options.onFirstListenerAdd(this);this._callbacks.add(q,K);let z={dispose:()=>{if(!this._callbacks)return;if(this._callbacks.remove(q,K),z.dispose=cx8._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty())this._options.onLastListenerRemove(this)}};if(Array.isArray(_))_.push(z);return z};return this._event}fire(q){if(this._callbacks)this._callbacks.invoke.call(this._callbacks,q)}dispose(){if(this._callbacks)this._callbacks.dispose(),this._callbacks=void 0}}W9K.Emitter=cx8;cx8._noop=function(){}});var nx8=m((Z9K)=>{Object.defineProperty(Z9K,"__esModule",{value:!0});Z9K.CancellationTokenSource=Z9K.CancellationToken=void 0;var Vcz=fK6(),Ncz=wL6(),uo1=jL6(),lx8;(function(q){q.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:uo1.Event.None}),q.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:uo1.Event.None});function K(_){let z=_;return z&&(z===q.None||z===q.Cancelled||Ncz.boolean(z.isCancellationRequested)&&!!z.onCancellationRequested)}q.is=K})(lx8||(Z9K.CancellationToken=lx8={}));var ycz=Object.freeze(function(q,K){let _=(0,Vcz.default)().timer.setTimeout(q.bind(K),0);return{dispose(){_.dispose()}}});class mo1{constructor(){this._isCancelled=!1}cancel(){if(!this._isCancelled){if(this._isCancelled=!0,this._emitter)this._emitter.fire(void 0),this.dispose()}}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){if(this._isCancelled)return ycz;if(!this._emitter)this._emitter=new uo1.Emitter;return this._emitter.event}dispose(){if(this._emitter)this._emitter.dispose(),this._emitter=void 0}}class f9K{get token(){if(!this._token)this._token=new mo1;return this._token}cancel(){if(!this._token)this._token=lx8.Cancelled;else this._token.cancel()}dispose(){if(!this._token)this._token=lx8.None;else if(this._token instanceof mo1)this._token.dispose()}}Z9K.CancellationTokenSource=f9K});var E9K=m((N9K)=>{Object.defineProperty(N9K,"__esModule",{value:!0});N9K.SharedArrayReceiverStrategy=N9K.SharedArraySenderStrategy=void 0;var Lcz=nx8(),k68;(function(q){q.Continue=0,q.Cancelled=1})(k68||(k68={}));class T9K{constructor(){this.buffers=new Map}enableCancellation(q){if(q.id===null)return;let K=new SharedArrayBuffer(4),_=new Int32Array(K,0,1);_[0]=k68.Continue,this.buffers.set(q.id,K),q.$cancellationData=K}async sendCancellation(q,K){let _=this.buffers.get(K);if(_===void 0)return;let z=new Int32Array(_,0,1);Atomics.store(z,0,k68.Cancelled)}cleanup(q){this.buffers.delete(q)}dispose(){this.buffers.clear()}}N9K.SharedArraySenderStrategy=T9K;class v9K{constructor(q){this.data=new Int32Array(q,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===k68.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class k9K{constructor(q){this.token=new v9K(q)}cancel(){}dispose(){}}class V9K{constructor(){this.kind="request"}createCancellationTokenSource(q){let K=q.$cancellationData;if(K===void 0)return new Lcz.CancellationTokenSource;return new k9K(K)}}N9K.SharedArrayReceiverStrategy=V9K});var po1=m((R9K)=>{Object.defineProperty(R9K,"__esModule",{value:!0});R9K.Semaphore=void 0;var hcz=fK6();class L9K{constructor(q=1){if(q<=0)throw Error("Capacity must be greater than 0");this._capacity=q,this._active=0,this._waiting=[]}lock(q){return new Promise((K,_)=>{this._waiting.push({thunk:q,resolve:K,reject:_}),this.runNext()})}get active(){return this._active}runNext(){if(this._waiting.length===0||this._active===this._capacity)return;(0,hcz.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let q=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let K=q.thunk();if(K instanceof Promise)K.then((_)=>{this._active--,q.resolve(_),this.runNext()},(_)=>{this._active--,q.reject(_),this.runNext()});else this._active--,q.resolve(K),this.runNext()}catch(K){this._active--,q.reject(K),this.runNext()}}}R9K.Semaphore=L9K});var I9K=m((b9K)=>{Object.defineProperty(b9K,"__esModule",{value:!0});b9K.ReadableStreamMessageReader=b9K.AbstractMessageReader=b9K.MessageReader=void 0;var go1=fK6(),HL6=wL6(),Bo1=jL6(),Scz=po1(),S9K;(function(q){function K(_){let z=_;return z&&HL6.func(z.listen)&&HL6.func(z.dispose)&&HL6.func(z.onError)&&HL6.func(z.onClose)&&HL6.func(z.onPartialMessage)}q.is=K})(S9K||(b9K.MessageReader=S9K={}));class Uo1{constructor(){this.errorEmitter=new Bo1.Emitter,this.closeEmitter=new Bo1.Emitter,this.partialMessageEmitter=new Bo1.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(q){this.errorEmitter.fire(this.asError(q))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(q){this.partialMessageEmitter.fire(q)}asError(q){if(q instanceof Error)return q;else return Error(`Reader received error. Reason: ${HL6.string(q.message)?q.message:"unknown"}`)}}b9K.AbstractMessageReader=Uo1;var Fo1;(function(q){function K(_){let z,Y,$,A=new Map,O,w=new Map;if(_===void 0||typeof _==="string")z=_??"utf-8";else{if(z=_.charset??"utf-8",_.contentDecoder!==void 0)$=_.contentDecoder,A.set($.name,$);if(_.contentDecoders!==void 0)for(let j of _.contentDecoders)A.set(j.name,j);if(_.contentTypeDecoder!==void 0)O=_.contentTypeDecoder,w.set(O.name,O);if(_.contentTypeDecoders!==void 0)for(let j of _.contentTypeDecoders)w.set(j.name,j)}if(O===void 0)O=(0,go1.default)().applicationJson.decoder,w.set(O.name,O);return{charset:z,contentDecoder:$,contentDecoders:A,contentTypeDecoder:O,contentTypeDecoders:w}}q.fromOptions=K})(Fo1||(Fo1={}));class C9K extends Uo1{constructor(q,K){super();this.readable=q,this.options=Fo1.fromOptions(K),this.buffer=(0,go1.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Scz.Semaphore(1)}set partialMessageTimeout(q){this._partialMessageTimeout=q}get partialMessageTimeout(){return this._partialMessageTimeout}listen(q){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=q;let K=this.readable.onData((_)=>{this.onData(_)});return this.readable.onError((_)=>this.fireError(_)),this.readable.onClose(()=>this.fireClose()),K}onData(q){try{this.buffer.append(q);while(!0){if(this.nextMessageLength===-1){let _=this.buffer.tryReadHeaders(!0);if(!_)return;let z=_.get("content-length");if(!z){this.fireError(Error(`Header must provide a Content-Length property. |
| 2496 | ${JSON.stringify(Object.fromEntries(_))}`));return}let Y=parseInt(z);if(isNaN(Y)){this.fireError(Error(`Content-Length value must be a number. Got ${z}`));return}this.nextMessageLength=Y}let K=this.buffer.tryReadBody(this.nextMessageLength);if(K===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let _=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(K):K,z=await this.options.contentTypeDecoder.decode(_,this.options);this.callback(z)}).catch((_)=>{this.fireError(_)})}}catch(K){this.fireError(K)}}clearPartialMessageTimer(){if(this.partialMessageTimer)this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0}setPartialMessageTimer(){if(this.clearPartialMessageTimer(),this._partialMessageTimeout<=0)return;this.partialMessageTimer=(0,go1.default)().timer.setTimeout((q,K)=>{if(this.partialMessageTimer=void 0,q===this.messageToken)this.firePartialMessage({messageToken:q,waitingTime:K}),this.setPartialMessageTimer()},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout)}}b9K.ReadableStreamMessageReader=C9K});var Q9K=m((F9K)=>{Object.defineProperty(F9K,"__esModule",{value:!0});F9K.WriteableStreamMessageWriter=F9K.AbstractMessageWriter=F9K.MessageWriter=void 0;var u9K=fK6(),V68=wL6(),xcz=po1(),m9K=jL6(),Icz="Content-Length: ",p9K=`\r |
| 2497 | `,B9K;(function(q){function K(_){let z=_;return z&&V68.func(z.dispose)&&V68.func(z.onClose)&&V68.func(z.onError)&&V68.func(z.write)}q.is=K})(B9K||(F9K.MessageWriter=B9K={}));class do1{constructor(){this.errorEmitter=new m9K.Emitter,this.closeEmitter=new m9K.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(q,K,_){this.errorEmitter.fire([this.asError(q),K,_])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(q){if(q instanceof Error)return q;else return Error(`Writer received error. Reason: ${V68.string(q.message)?q.message:"unknown"}`)}}F9K.AbstractMessageWriter=do1;var Qo1;(function(q){function K(_){if(_===void 0||typeof _==="string")return{charset:_??"utf-8",contentTypeEncoder:(0,u9K.default)().applicationJson.encoder};else return{charset:_.charset??"utf-8",contentEncoder:_.contentEncoder,contentTypeEncoder:_.contentTypeEncoder??(0,u9K.default)().applicationJson.encoder}}q.fromOptions=K})(Qo1||(Qo1={}));class g9K extends do1{constructor(q,K){super();this.writable=q,this.options=Qo1.fromOptions(K),this.errorCount=0,this.writeSemaphore=new xcz.Semaphore(1),this.writable.onError((_)=>this.fireError(_)),this.writable.onClose(()=>this.fireClose())}async write(q){return this.writeSemaphore.lock(async()=>{return this.options.contentTypeEncoder.encode(q,this.options).then((_)=>{if(this.options.contentEncoder!==void 0)return this.options.contentEncoder.encode(_);else return _}).then((_)=>{let z=[];return z.push(Icz,_.byteLength.toString(),p9K),z.push(p9K),this.doWrite(q,z,_)},(_)=>{throw this.fireError(_),_})})}async doWrite(q,K,_){try{return await this.writable.write(K.join(""),"ascii"),this.writable.write(_)}catch(z){return this.handleError(z,q),Promise.reject(z)}}handleError(q,K){this.errorCount++,this.fireError(q,K,this.errorCount)}end(){this.writable.end()}}F9K.WriteableStreamMessageWriter=g9K});var n9K=m((c9K)=>{Object.defineProperty(c9K,"__esModule",{value:!0});c9K.AbstractMessageBuffer=void 0;var pcz=13,Bcz=10,gcz=`\r |
| 2498 | `;class d9K{constructor(q="utf-8"){this._encoding=q,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(q){let K=typeof q==="string"?this.fromString(q,this._encoding):q;this._chunks.push(K),this._totalLength+=K.byteLength}tryReadHeaders(q=!1){if(this._chunks.length===0)return;let K=0,_=0,z=0,Y=0;q:while(_<this._chunks.length){let w=this._chunks[_];z=0;K:while(z<w.length){switch(w[z]){case pcz:switch(K){case 0:K=1;break;case 2:K=3;break;default:K=0}break;case Bcz:switch(K){case 1:K=2;break;case 3:K=4,z++;break q;default:K=0}break;default:K=0}z++}Y+=w.byteLength,_++}if(K!==4)return;let $=this._read(Y+z),A=new Map,O=this.toString($,"ascii").split(gcz);if(O.length<2)return A;for(let w=0;w<O.length-2;w++){let j=O[w],H=j.indexOf(":");if(H===-1)throw Error(`Message header must separate key and value using ':' |
| 2499 | ${j}`);let J=j.substr(0,H),M=j.substr(H+1).trim();A.set(q?J.toLowerCase():J,M)}return A}tryReadBody(q){if(this._totalLength<q)return;return this._read(q)}get numberOfBytes(){return this._totalLength}_read(q){if(q===0)return this.emptyBuffer();if(q>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===q){let Y=this._chunks[0];return this._chunks.shift(),this._totalLength-=q,this.asNative(Y)}if(this._chunks[0].byteLength>q){let Y=this._chunks[0],$=this.asNative(Y,q);return this._chunks[0]=Y.slice(q),this._totalLength-=q,$}let K=this.allocNative(q),_=0,z=0;while(q>0){let Y=this._chunks[z];if(Y.byteLength>q){let $=Y.slice(0,q);K.set($,_),_+=q,this._chunks[z]=Y.slice(q),this._totalLength-=q,q-=q}else K.set(Y,_),_+=Y.byteLength,this._chunks.shift(),this._totalLength-=Y.byteLength,q-=Y.byteLength}return K}}c9K.AbstractMessageBuffer=d9K});var z_K=m((t9K)=>{Object.defineProperty(t9K,"__esModule",{value:!0});t9K.createMessageConnection=t9K.ConnectionOptions=t9K.MessageStrategy=t9K.CancellationStrategy=t9K.CancellationSenderStrategy=t9K.CancellationReceiverStrategy=t9K.RequestCancellationReceiverStrategy=t9K.IdCancellationReceiverStrategy=t9K.ConnectionStrategy=t9K.ConnectionError=t9K.ConnectionErrors=t9K.LogTraceNotification=t9K.SetTraceNotification=t9K.TraceFormat=t9K.TraceValues=t9K.Trace=t9K.NullLogger=t9K.ProgressType=t9K.ProgressToken=void 0;var i9K=fK6(),BH=wL6(),D3=So1(),r9K=bo1(),N68=jL6(),co1=nx8(),L68;(function(q){q.type=new D3.NotificationType("$/cancelRequest")})(L68||(L68={}));var lo1;(function(q){function K(_){return typeof _==="string"||typeof _==="number"}q.is=K})(lo1||(t9K.ProgressToken=lo1={}));var y68;(function(q){q.type=new D3.NotificationType("$/progress")})(y68||(y68={}));class s9K{constructor(){}}t9K.ProgressType=s9K;var no1;(function(q){function K(_){return BH.func(_)}q.is=K})(no1||(no1={}));t9K.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var qA;(function(q){q[q.Off=0]="Off",q[q.Messages=1]="Messages",q[q.Compact=2]="Compact",q[q.Verbose=3]="Verbose"})(qA||(t9K.Trace=qA={}));var o9K;(function(q){q.Off="off",q.Messages="messages",q.Compact="compact",q.Verbose="verbose"})(o9K||(t9K.TraceValues=o9K={}));(function(q){function K(z){if(!BH.string(z))return q.Off;switch(z=z.toLowerCase(),z){case"off":return q.Off;case"messages":return q.Messages;case"compact":return q.Compact;case"verbose":return q.Verbose;default:return q.Off}}q.fromString=K;function _(z){switch(z){case q.Off:return"off";case q.Messages:return"messages";case q.Compact:return"compact";case q.Verbose:return"verbose";default:return"off"}}q.toString=_})(qA||(t9K.Trace=qA={}));var KR;(function(q){q.Text="text",q.JSON="json"})(KR||(t9K.TraceFormat=KR={}));(function(q){function K(_){if(!BH.string(_))return q.Text;if(_=_.toLowerCase(),_==="json")return q.JSON;else return q.Text}q.fromString=K})(KR||(t9K.TraceFormat=KR={}));var io1;(function(q){q.type=new D3.NotificationType("$/setTrace")})(io1||(t9K.SetTraceNotification=io1={}));var ix8;(function(q){q.type=new D3.NotificationType("$/logTrace")})(ix8||(t9K.LogTraceNotification=ix8={}));var E68;(function(q){q[q.Closed=1]="Closed",q[q.Disposed=2]="Disposed",q[q.AlreadyListening=3]="AlreadyListening"})(E68||(t9K.ConnectionErrors=E68={}));class JL6 extends Error{constructor(q,K){super(K);this.code=q,Object.setPrototypeOf(this,JL6.prototype)}}t9K.ConnectionError=JL6;var ro1;(function(q){function K(_){let z=_;return z&&BH.func(z.cancelUndispatched)}q.is=K})(ro1||(t9K.ConnectionStrategy=ro1={}));var rx8;(function(q){function K(_){let z=_;return z&&(z.kind===void 0||z.kind==="id")&&BH.func(z.createCancellationTokenSource)&&(z.dispose===void 0||BH.func(z.dispose))}q.is=K})(rx8||(t9K.IdCancellationReceiverStrategy=rx8={}));var oo1;(function(q){function K(_){let z=_;return z&&z.kind==="request"&&BH.func(z.createCancellationTokenSource)&&(z.dispose===void 0||BH.func(z.dispose))}q.is=K})(oo1||(t9K.RequestCancellationReceiverStrategy=oo1={}));var ox8;(function(q){q.Message=Object.freeze({createCancellationTokenSource(_){return new co1.CancellationTokenSource}});function K(_){return rx8.is(_)||oo1.is(_)}q.is=K})(ox8||(t9K.CancellationReceiverStrategy=ox8={}));var ax8;(function(q){q.Message=Object.freeze({sendCancellation(_,z){return _.sendNotification(L68.type,{id:z})},cleanup(_){}});function K(_){let z=_;return z&&BH.func(z.sendCancellation)&&BH.func(z.cleanup)}q.is=K})(ax8||(t9K.CancellationSenderStrategy=ax8={}));var sx8;(function(q){q.Message=Object.freeze({receiver:ox8.Message,sender:ax8.Message});function K(_){let z=_;return z&&ox8.is(z.receiver)&&ax8.is(z.sender)}q.is=K})(sx8||(t9K.CancellationStrategy=sx8={}));var tx8;(function(q){function K(_){let z=_;return z&&BH.func(z.handleMessage)}q.is=K})(tx8||(t9K.MessageStrategy=tx8={}));var a9K;(function(q){function K(_){let z=_;return z&&(sx8.is(z.cancellationStrategy)||ro1.is(z.connectionStrategy)||tx8.is(z.messageStrategy))}q.is=K})(a9K||(t9K.ConnectionOptions=a9K={}));var tm;(function(q){q[q.New=1]="New",q[q.Listening=2]="Listening",q[q.Closed=3]="Closed",q[q.Disposed=4]="Disposed"})(tm||(tm={}));function Fcz(q,K,_,z){let Y=_!==void 0?_:t9K.NullLogger,$=0,A=0,O=0,w="2.0",j=void 0,H=new Map,J=void 0,M=new Map,X=new Map,P,W=new r9K.LinkedMap,D=new Map,f=new Set,G=new Map,Z=qA.Off,T=KR.Text,v,V=tm.New,E=new N68.Emitter,S=new N68.Emitter,R=new N68.Emitter,x=new N68.Emitter,I=new N68.Emitter,B=z&&z.cancellationStrategy?z.cancellationStrategy:sx8.Message;function p(E6){if(E6===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E6.toString()}function C(E6){if(E6===null)return"res-unknown-"+(++O).toString();else return"res-"+E6.toString()}function g(){return"not-"+(++A).toString()}function F(E6,R6){if(D3.Message.isRequest(R6))E6.set(p(R6.id),R6);else if(D3.Message.isResponse(R6))E6.set(C(R6.id),R6);else E6.set(g(),R6)}function U(E6){return}function c(){return V===tm.Listening}function K6(){return V===tm.Closed}function t(){return V===tm.Disposed}function q6(){if(V===tm.New||V===tm.Listening)V=tm.Closed,S.fire(void 0)}function e(E6){E.fire([E6,void 0,void 0])}function i(E6){E.fire(E6)}q.onClose(q6),q.onError(e),K.onClose(q6),K.onError(i);function $6(){if(P||W.size===0)return;P=(0,i9K.default)().timer.setImmediate(()=>{P=void 0,j6()})}function M6(E6){if(D3.Message.isRequest(E6))w6(E6);else if(D3.Message.isNotification(E6))s(E6);else if(D3.Message.isResponse(E6))o(E6);else a(E6)}function j6(){if(W.size===0)return;let E6=W.shift();try{let R6=z?.messageStrategy;if(tx8.is(R6))R6.handleMessage(E6,M6);else M6(E6)}finally{$6()}}let G6=(E6)=>{try{if(D3.Message.isNotification(E6)&&E6.method===L68.type.method){let R6=E6.params.id,h6=p(R6),x6=W.get(h6);if(D3.Message.isRequest(x6)){let Q6=z?.connectionStrategy,Y6=Q6&&Q6.cancelUndispatched?Q6.cancelUndispatched(x6,U):U(x6);if(Y6&&(Y6.error!==void 0||Y6.result!==void 0)){W.delete(h6),G.delete(R6),Y6.id=x6.id,J6(Y6,E6.method,Date.now()),K.write(Y6).catch(()=>Y.error("Sending response for canceled message failed."));return}}let b6=G.get(R6);if(b6!==void 0){b6.cancel(),f6(E6);return}else f.add(R6)}F(W,E6)}finally{$6()}};function w6(E6){if(t())return;function R6(F6,W6,v6){let m6={jsonrpc:w,id:E6.id};if(F6 instanceof D3.ResponseError)m6.error=F6.toJson();else m6.result=F6===void 0?null:F6;J6(m6,W6,v6),K.write(m6).catch(()=>Y.error("Sending response failed."))}function h6(F6,W6,v6){let m6={jsonrpc:w,id:E6.id,error:F6.toJson()};J6(m6,W6,v6),K.write(m6).catch(()=>Y.error("Sending response failed."))}function x6(F6,W6,v6){if(F6===void 0)F6=null;let m6={jsonrpc:w,id:E6.id,result:F6};J6(m6,W6,v6),K.write(m6).catch(()=>Y.error("Sending response failed."))}X6(E6);let b6=H.get(E6.method),Q6,Y6;if(b6)Q6=b6.type,Y6=b6.handler;let _6=Date.now();if(Y6||j){let F6=E6.id??String(Date.now()),W6=rx8.is(B.receiver)?B.receiver.createCancellationTokenSource(F6):B.receiver.createCancellationTokenSource(E6);if(E6.id!==null&&f.has(E6.id))W6.cancel();if(E6.id!==null)G.set(F6,W6);try{let v6;if(Y6)if(E6.params===void 0){if(Q6!==void 0&&Q6.numberOfParams!==0){h6(new D3.ResponseError(D3.ErrorCodes.InvalidParams,`Request ${E6.method} defines ${Q6.numberOfParams} params but received none.`),E6.method,_6);return}v6=Y6(W6.token)}else if(Array.isArray(E6.params)){if(Q6!==void 0&&Q6.parameterStructures===D3.ParameterStructures.byName){h6(new D3.ResponseError(D3.ErrorCodes.InvalidParams,`Request ${E6.method} defines parameters by name but received parameters by position`),E6.method,_6);return}v6=Y6(...E6.params,W6.token)}else{if(Q6!==void 0&&Q6.parameterStructures===D3.ParameterStructures.byPosition){h6(new D3.ResponseError(D3.ErrorCodes.InvalidParams,`Request ${E6.method} defines parameters by position but received parameters by name`),E6.method,_6);return}v6=Y6(E6.params,W6.token)}else if(j)v6=j(E6.method,E6.params,W6.token);let m6=v6;if(!v6)G.delete(F6),x6(v6,E6.method,_6);else if(m6.then)m6.then((K8)=>{G.delete(F6),R6(K8,E6.method,_6)},(K8)=>{if(G.delete(F6),K8 instanceof D3.ResponseError)h6(K8,E6.method,_6);else if(K8&&BH.string(K8.message))h6(new D3.ResponseError(D3.ErrorCodes.InternalError,`Request ${E6.method} failed with message: ${K8.message}`),E6.method,_6);else h6(new D3.ResponseError(D3.ErrorCodes.InternalError,`Request ${E6.method} failed unexpectedly without providing any details.`),E6.method,_6)});else G.delete(F6),R6(v6,E6.method,_6)}catch(v6){if(G.delete(F6),v6 instanceof D3.ResponseError)R6(v6,E6.method,_6);else if(v6&&BH.string(v6.message))h6(new D3.ResponseError(D3.ErrorCodes.InternalError,`Request ${E6.method} failed with message: ${v6.message}`),E6.method,_6);else h6(new D3.ResponseError(D3.ErrorCodes.InternalError,`Request ${E6.method} failed unexpectedly without providing any details.`),E6.method,_6)}}else h6(new D3.ResponseError(D3.ErrorCodes.MethodNotFound,`Unhandled method ${E6.method}`),E6.method,_6)}function o(E6){if(t())return;if(E6.id===null)if(E6.error)Y.error(`Received response message without id: Error is: |
| 2500 | ${JSON.stringify(E6.error,void 0,4)}`);else Y.error("Received response message without id. No further error information provided.");else{let R6=E6.id,h6=D.get(R6);if(N6(E6,h6),h6!==void 0){D.delete(R6);try{if(E6.error){let x6=E6.error;h6.reject(new D3.ResponseError(x6.code,x6.message,x6.data))}else if(E6.result!==void 0)h6.resolve(E6.result);else throw Error("Should never happen.")}catch(x6){if(x6.message)Y.error(`Response handler '${h6.method}' failed with message: ${x6.message}`);else Y.error(`Response handler '${h6.method}' failed unexpectedly.`)}}}}function s(E6){if(t())return;let R6=void 0,h6;if(E6.method===L68.type.method){let x6=E6.params.id;f.delete(x6),f6(E6);return}else{let x6=M.get(E6.method);if(x6)h6=x6.handler,R6=x6.type}if(h6||J)try{if(f6(E6),h6)if(E6.params===void 0){if(R6!==void 0){if(R6.numberOfParams!==0&&R6.parameterStructures!==D3.ParameterStructures.byName)Y.error(`Notification ${E6.method} defines ${R6.numberOfParams} params but received none.`)}h6()}else if(Array.isArray(E6.params)){let x6=E6.params;if(E6.method===y68.type.method&&x6.length===2&&lo1.is(x6[0]))h6({token:x6[0],value:x6[1]});else{if(R6!==void 0){if(R6.parameterStructures===D3.ParameterStructures.byName)Y.error(`Notification ${E6.method} defines parameters by name but received parameters by position`);if(R6.numberOfParams!==E6.params.length)Y.error(`Notification ${E6.method} defines ${R6.numberOfParams} params but received ${x6.length} arguments`)}h6(...x6)}}else{if(R6!==void 0&&R6.parameterStructures===D3.ParameterStructures.byPosition)Y.error(`Notification ${E6.method} defines parameters by position but received parameters by name`);h6(E6.params)}else if(J)J(E6.method,E6.params)}catch(x6){if(x6.message)Y.error(`Notification handler '${E6.method}' failed with message: ${x6.message}`);else Y.error(`Notification handler '${E6.method}' failed unexpectedly.`)}else R.fire(E6)}function a(E6){if(!E6){Y.error("Received empty message.");return}Y.error(`Received message which is neither a response nor a notification message: |
nothing calls this directly
no test coverage detected