(q,K,_,z)
| 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: |
| 2501 | ${JSON.stringify(E6,null,4)}`);let R6=E6;if(BH.string(R6.id)||BH.number(R6.id)){let h6=R6.id,x6=D.get(h6);if(x6)x6.reject(Error("The received response has neither a result nor an error property."))}}function n(E6){if(E6===void 0||E6===null)return;switch(Z){case qA.Verbose:return JSON.stringify(E6,null,4);case qA.Compact:return JSON.stringify(E6);default:return}}function l(E6){if(Z===qA.Off||!v)return;if(T===KR.Text){let R6=void 0;if((Z===qA.Verbose||Z===qA.Compact)&&E6.params)R6=`Params: ${n(E6.params)} |
| 2502 | |
| 2503 | `;v.log(`Sending request '${E6.method} - (${E6.id})'.`,R6)}else Z6("send-request",E6)}function A6(E6){if(Z===qA.Off||!v)return;if(T===KR.Text){let R6=void 0;if(Z===qA.Verbose||Z===qA.Compact)if(E6.params)R6=`Params: ${n(E6.params)} |
| 2504 | |
| 2505 | `;else R6=`No parameters provided. |
| 2506 | |
| 2507 | `;v.log(`Sending notification '${E6.method}'.`,R6)}else Z6("send-notification",E6)}function J6(E6,R6,h6){if(Z===qA.Off||!v)return;if(T===KR.Text){let x6=void 0;if(Z===qA.Verbose||Z===qA.Compact){if(E6.error&&E6.error.data)x6=`Error data: ${n(E6.error.data)} |
| 2508 | |
| 2509 | `;else if(E6.result)x6=`Result: ${n(E6.result)} |
| 2510 | |
| 2511 | `;else if(E6.error===void 0)x6=`No result returned. |
| 2512 | |
| 2513 | `}v.log(`Sending response '${R6} - (${E6.id})'. Processing request took ${Date.now()-h6}ms`,x6)}else Z6("send-response",E6)}function X6(E6){if(Z===qA.Off||!v)return;if(T===KR.Text){let R6=void 0;if((Z===qA.Verbose||Z===qA.Compact)&&E6.params)R6=`Params: ${n(E6.params)} |
| 2514 | |
| 2515 | `;v.log(`Received request '${E6.method} - (${E6.id})'.`,R6)}else Z6("receive-request",E6)}function f6(E6){if(Z===qA.Off||!v||E6.method===ix8.type.method)return;if(T===KR.Text){let R6=void 0;if(Z===qA.Verbose||Z===qA.Compact)if(E6.params)R6=`Params: ${n(E6.params)} |
| 2516 | |
| 2517 | `;else R6=`No parameters provided. |
| 2518 | |
| 2519 | `;v.log(`Received notification '${E6.method}'.`,R6)}else Z6("receive-notification",E6)}function N6(E6,R6){if(Z===qA.Off||!v)return;if(T===KR.Text){let h6=void 0;if(Z===qA.Verbose||Z===qA.Compact){if(E6.error&&E6.error.data)h6=`Error data: ${n(E6.error.data)} |
| 2520 | |
| 2521 | `;else if(E6.result)h6=`Result: ${n(E6.result)} |
| 2522 | |
| 2523 | `;else if(E6.error===void 0)h6=`No result returned. |
| 2524 | |
| 2525 | `}if(R6){let x6=E6.error?` Request failed: ${E6.error.message} (${E6.error.code}).`:"";v.log(`Received response '${R6.method} - (${E6.id})' in ${Date.now()-R6.timerStart}ms.${x6}`,h6)}else v.log(`Received response ${E6.id} without active response promise.`,h6)}else Z6("receive-response",E6)}function Z6(E6,R6){if(!v||Z===qA.Off)return;let h6={isLSPMessage:!0,type:E6,message:R6,timestamp:Date.now()};v.log(h6)}function V6(){if(K6())throw new JL6(E68.Closed,"Connection is closed.");if(t())throw new JL6(E68.Disposed,"Connection is disposed.")}function y6(){if(c())throw new JL6(E68.AlreadyListening,"Connection is already listening")}function T6(){if(!c())throw Error("Call listen() first.")}function n6(E6){if(E6===void 0)return null;else return E6}function o6(E6){if(E6===null)return;else return E6}function I6(E6){return E6!==void 0&&E6!==null&&!Array.isArray(E6)&&typeof E6==="object"}function C6(E6,R6){switch(E6){case D3.ParameterStructures.auto:if(I6(R6))return o6(R6);else return[n6(R6)];case D3.ParameterStructures.byName:if(!I6(R6))throw Error("Received parameters by name but param is not an object literal.");return o6(R6);case D3.ParameterStructures.byPosition:return[n6(R6)];default:throw Error(`Unknown parameter structure ${E6.toString()}`)}}function l6(E6,R6){let h6,x6=E6.numberOfParams;switch(x6){case 0:h6=void 0;break;case 1:h6=C6(E6.parameterStructures,R6[0]);break;default:h6=[];for(let b6=0;b6<R6.length&&b6<x6;b6++)h6.push(n6(R6[b6]));if(R6.length<x6)for(let b6=R6.length;b6<x6;b6++)h6.push(null);break}return h6}let S6={sendNotification:(E6,...R6)=>{V6();let h6,x6;if(BH.string(E6)){h6=E6;let Q6=R6[0],Y6=0,_6=D3.ParameterStructures.auto;if(D3.ParameterStructures.is(Q6))Y6=1,_6=Q6;let F6=R6.length,W6=F6-Y6;switch(W6){case 0:x6=void 0;break;case 1:x6=C6(_6,R6[Y6]);break;default:if(_6===D3.ParameterStructures.byName)throw Error(`Received ${W6} parameters for 'by Name' notification parameter structure.`);x6=R6.slice(Y6,F6).map((v6)=>n6(v6));break}}else{let Q6=R6;h6=E6.method,x6=l6(E6,Q6)}let b6={jsonrpc:w,method:h6,params:x6};return A6(b6),K.write(b6).catch((Q6)=>{throw Y.error("Sending notification failed."),Q6})},onNotification:(E6,R6)=>{V6();let h6;if(BH.func(E6))J=E6;else if(R6)if(BH.string(E6))h6=E6,M.set(E6,{type:void 0,handler:R6});else h6=E6.method,M.set(E6.method,{type:E6,handler:R6});return{dispose:()=>{if(h6!==void 0)M.delete(h6);else J=void 0}}},onProgress:(E6,R6,h6)=>{if(X.has(R6))throw Error(`Progress handler for token ${R6} already registered`);return X.set(R6,h6),{dispose:()=>{X.delete(R6)}}},sendProgress:(E6,R6,h6)=>{return S6.sendNotification(y68.type,{token:R6,value:h6})},onUnhandledProgress:x.event,sendRequest:(E6,...R6)=>{V6(),T6();let h6,x6,b6=void 0;if(BH.string(E6)){h6=E6;let F6=R6[0],W6=R6[R6.length-1],v6=0,m6=D3.ParameterStructures.auto;if(D3.ParameterStructures.is(F6))v6=1,m6=F6;let K8=R6.length;if(co1.CancellationToken.is(W6))K8=K8-1,b6=W6;let H8=K8-v6;switch(H8){case 0:x6=void 0;break;case 1:x6=C6(m6,R6[v6]);break;default:if(m6===D3.ParameterStructures.byName)throw Error(`Received ${H8} parameters for 'by Name' request parameter structure.`);x6=R6.slice(v6,K8).map((M8)=>n6(M8));break}}else{let F6=R6;h6=E6.method,x6=l6(E6,F6);let W6=E6.numberOfParams;b6=co1.CancellationToken.is(F6[W6])?F6[W6]:void 0}let Q6=$++,Y6;if(b6)Y6=b6.onCancellationRequested(()=>{let F6=B.sender.sendCancellation(S6,Q6);if(F6===void 0)return Y.log(`Received no promise from cancellation strategy when cancelling id ${Q6}`),Promise.resolve();else return F6.catch(()=>{Y.log(`Sending cancellation messages for id ${Q6} failed`)})});let _6={jsonrpc:w,id:Q6,method:h6,params:x6};if(l(_6),typeof B.sender.enableCancellation==="function")B.sender.enableCancellation(_6);return new Promise(async(F6,W6)=>{let v6=(H8)=>{F6(H8),B.sender.cleanup(Q6),Y6?.dispose()},m6=(H8)=>{W6(H8),B.sender.cleanup(Q6),Y6?.dispose()},K8={method:h6,timerStart:Date.now(),resolve:v6,reject:m6};try{D.set(Q6,K8),await K.write(_6)}catch(H8){throw D.delete(Q6),K8.reject(new D3.ResponseError(D3.ErrorCodes.MessageWriteError,H8.message?H8.message:"Unknown reason")),Y.error("Sending request failed."),H8}})},onRequest:(E6,R6)=>{V6();let h6=null;if(no1.is(E6))h6=void 0,j=E6;else if(BH.string(E6)){if(h6=null,R6!==void 0)h6=E6,H.set(E6,{handler:R6,type:void 0})}else if(R6!==void 0)h6=E6.method,H.set(E6.method,{type:E6,handler:R6});return{dispose:()=>{if(h6===null)return;if(h6!==void 0)H.delete(h6);else j=void 0}}},hasPendingResponse:()=>{return D.size>0},trace:async(E6,R6,h6)=>{let x6=!1,b6=KR.Text;if(h6!==void 0)if(BH.boolean(h6))x6=h6;else x6=h6.sendNotification||!1,b6=h6.traceFormat||KR.Text;if(Z=E6,T=b6,Z===qA.Off)v=void 0;else v=R6;if(x6&&!K6()&&!t())await S6.sendNotification(io1.type,{value:qA.toString(E6)})},onError:E.event,onClose:S.event,onUnhandledNotification:R.event,onDispose:I.event,end:()=>{K.end()},dispose:()=>{if(t())return;V=tm.Disposed,I.fire(void 0);let E6=new D3.ResponseError(D3.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let R6 of D.values())R6.reject(E6);if(D=new Map,G=new Map,f=new Set,W=new r9K.LinkedMap,BH.func(K.dispose))K.dispose();if(BH.func(q.dispose))q.dispose()},listen:()=>{V6(),y6(),V=tm.Listening,q.listen(G6)},inspect:()=>{(0,i9K.default)().console.log("inspect")}};return S6.onNotification(ix8.type,(E6)=>{if(Z===qA.Off||!v)return;let R6=Z===qA.Verbose||Z===qA.Compact;v.log(E6.message,R6?E6.verbose:void 0)}),S6.onNotification(y68.type,(E6)=>{let R6=X.get(E6.token);if(R6)R6(E6.value);else x.fire(E6)}),S6}t9K.createMessageConnection=Fcz});var ex8=m((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});WK.ProgressType=WK.ProgressToken=WK.createMessageConnection=WK.NullLogger=WK.ConnectionOptions=WK.ConnectionStrategy=WK.AbstractMessageBuffer=WK.WriteableStreamMessageWriter=WK.AbstractMessageWriter=WK.MessageWriter=WK.ReadableStreamMessageReader=WK.AbstractMessageReader=WK.MessageReader=WK.SharedArrayReceiverStrategy=WK.SharedArraySenderStrategy=WK.CancellationToken=WK.CancellationTokenSource=WK.Emitter=WK.Event=WK.Disposable=WK.LRUCache=WK.Touch=WK.LinkedMap=WK.ParameterStructures=WK.NotificationType9=WK.NotificationType8=WK.NotificationType7=WK.NotificationType6=WK.NotificationType5=WK.NotificationType4=WK.NotificationType3=WK.NotificationType2=WK.NotificationType1=WK.NotificationType0=WK.NotificationType=WK.ErrorCodes=WK.ResponseError=WK.RequestType9=WK.RequestType8=WK.RequestType7=WK.RequestType6=WK.RequestType5=WK.RequestType4=WK.RequestType3=WK.RequestType2=WK.RequestType1=WK.RequestType0=WK.RequestType=WK.Message=WK.RAL=void 0;WK.MessageStrategy=WK.CancellationStrategy=WK.CancellationSenderStrategy=WK.CancellationReceiverStrategy=WK.ConnectionError=WK.ConnectionErrors=WK.LogTraceNotification=WK.SetTraceNotification=WK.TraceFormat=WK.TraceValues=WK.Trace=void 0;var $2=So1();Object.defineProperty(WK,"Message",{enumerable:!0,get:function(){return $2.Message}});Object.defineProperty(WK,"RequestType",{enumerable:!0,get:function(){return $2.RequestType}});Object.defineProperty(WK,"RequestType0",{enumerable:!0,get:function(){return $2.RequestType0}});Object.defineProperty(WK,"RequestType1",{enumerable:!0,get:function(){return $2.RequestType1}});Object.defineProperty(WK,"RequestType2",{enumerable:!0,get:function(){return $2.RequestType2}});Object.defineProperty(WK,"RequestType3",{enumerable:!0,get:function(){return $2.RequestType3}});Object.defineProperty(WK,"RequestType4",{enumerable:!0,get:function(){return $2.RequestType4}});Object.defineProperty(WK,"RequestType5",{enumerable:!0,get:function(){return $2.RequestType5}});Object.defineProperty(WK,"RequestType6",{enumerable:!0,get:function(){return $2.RequestType6}});Object.defineProperty(WK,"RequestType7",{enumerable:!0,get:function(){return $2.RequestType7}});Object.defineProperty(WK,"RequestType8",{enumerable:!0,get:function(){return $2.RequestType8}});Object.defineProperty(WK,"RequestType9",{enumerable:!0,get:function(){return $2.RequestType9}});Object.defineProperty(WK,"ResponseError",{enumerable:!0,get:function(){return $2.ResponseError}});Object.defineProperty(WK,"ErrorCodes",{enumerable:!0,get:function(){return $2.ErrorCodes}});Object.defineProperty(WK,"NotificationType",{enumerable:!0,get:function(){return $2.NotificationType}});Object.defineProperty(WK,"NotificationType0",{enumerable:!0,get:function(){return $2.NotificationType0}});Object.defineProperty(WK,"NotificationType1",{enumerable:!0,get:function(){return $2.NotificationType1}});Object.defineProperty(WK,"NotificationType2",{enumerable:!0,get:function(){return $2.NotificationType2}});Object.defineProperty(WK,"NotificationType3",{enumerable:!0,get:function(){return $2.NotificationType3}});Object.defineProperty(WK,"NotificationType4",{enumerable:!0,get:function(){return $2.NotificationType4}});Object.defineProperty(WK,"NotificationType5",{enumerable:!0,get:function(){return $2.NotificationType5}});Object.defineProperty(WK,"NotificationType6",{enumerable:!0,get:function(){return $2.NotificationType6}});Object.defineProperty(WK,"NotificationType7",{enumerable:!0,get:function(){return $2.NotificationType7}});Object.defineProperty(WK,"NotificationType8",{enumerable:!0,get:function(){return $2.NotificationType8}});Object.defineProperty(WK,"NotificationType9",{enumerable:!0,get:function(){return $2.NotificationType9}});Object.defineProperty(WK,"ParameterStructures",{enumerable:!0,get:function(){return $2.ParameterStructures}});var ao1=bo1();Object.defineProperty(WK,"LinkedMap",{enumerable:!0,get:function(){return ao1.LinkedMap}});Object.defineProperty(WK,"LRUCache",{enumerable:!0,get:function(){return ao1.LRUCache}});Object.defineProperty(WK,"Touch",{enumerable:!0,get:function(){return ao1.Touch}});var _lz=J9K();Object.defineProperty(WK,"Disposable",{enumerable:!0,get:function(){return _lz.Disposable}});var Y_K=jL6();Object.defineProperty(WK,"Event",{enumerable:!0,get:function(){return Y_K.Event}});Object.defineProperty(WK,"Emitter",{enumerable:!0,get:function(){return Y_K.Emitter}});var $_K=nx8();Object.defineProperty(WK,"CancellationTokenSource",{enumerable:!0,get:function(){return $_K.CancellationTokenSource}});Object.defineProperty(WK,"CancellationToken",{enumerable:!0,get:function(){return $_K.CancellationToken}});var A_K=E9K();Object.defineProperty(WK,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return A_K.SharedArraySenderStrategy}});Object.defineProperty(WK,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return A_K.SharedArrayReceiverStrategy}});var so1=I9K();Object.defineProperty(WK,"MessageReader",{enumerable:!0,get:function(){return so1.MessageReader}});Object.defineProperty(WK,"AbstractMessageReader",{enumerable:!0,get:function(){return so1.AbstractMessageReader}});Object.defineProperty(WK,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return so1.ReadableStreamMessageReader}});var to1=Q9K();Object.defineProperty(WK,"MessageWriter",{enumerable:!0,get:function(){return to1.MessageWriter}});Object.defineProperty(WK,"AbstractMessageWriter",{enumerable:!0,get:function(){return to1.AbstractMessageWriter}});Object.defineProperty(WK,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return to1.WriteableStreamMessageWriter}});var zlz=n9K();Object.defineProperty(WK,"AbstractMessageBuffer",{enumerable:!0,get:function(){return zlz.AbstractMessageBuffer}});var m0=z_K();Object.defineProperty(WK,"ConnectionStrategy",{enumerable:!0,get:function(){return m0.ConnectionStrategy}});Object.defineProperty(WK,"ConnectionOptions",{enumerable:!0,get:function(){return m0.ConnectionOptions}});Object.defineProperty(WK,"NullLogger",{enumerable:!0,get:function(){return m0.NullLogger}});Object.defineProperty(WK,"createMessageConnection",{enumerable:!0,get:function(){return m0.createMessageConnection}});Object.defineProperty(WK,"ProgressToken",{enumerable:!0,get:function(){return m0.ProgressToken}});Object.defineProperty(WK,"ProgressType",{enumerable:!0,get:function(){return m0.ProgressType}});Object.defineProperty(WK,"Trace",{enumerable:!0,get:function(){return m0.Trace}});Object.defineProperty(WK,"TraceValues",{enumerable:!0,get:function(){return m0.TraceValues}});Object.defineProperty(WK,"TraceFormat",{enumerable:!0,get:function(){return m0.TraceFormat}});Object.defineProperty(WK,"SetTraceNotification",{enumerable:!0,get:function(){return m0.SetTraceNotification}});Object.defineProperty(WK,"LogTraceNotification",{enumerable:!0,get:function(){return m0.LogTraceNotification}});Object.defineProperty(WK,"ConnectionErrors",{enumerable:!0,get:function(){return m0.ConnectionErrors}});Object.defineProperty(WK,"ConnectionError",{enumerable:!0,get:function(){return m0.ConnectionError}});Object.defineProperty(WK,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return m0.CancellationReceiverStrategy}});Object.defineProperty(WK,"CancellationSenderStrategy",{enumerable:!0,get:function(){return m0.CancellationSenderStrategy}});Object.defineProperty(WK,"CancellationStrategy",{enumerable:!0,get:function(){return m0.CancellationStrategy}});Object.defineProperty(WK,"MessageStrategy",{enumerable:!0,get:function(){return m0.MessageStrategy}});var Ylz=fK6();WK.RAL=Ylz.default});var M_K=m((J_K)=>{Object.defineProperty(J_K,"__esModule",{value:!0});var O_K=U6("util"),Ha=ex8();class qI8 extends Ha.AbstractMessageBuffer{constructor(q="utf-8"){super(q)}emptyBuffer(){return qI8.emptyBuffer}fromString(q,K){return Buffer.from(q,K)}toString(q,K){if(q instanceof Buffer)return q.toString(K);else return new O_K.TextDecoder(K).decode(q)}asNative(q,K){if(K===void 0)return q instanceof Buffer?q:Buffer.from(q);else return q instanceof Buffer?q.slice(0,K):Buffer.from(q,0,K)}allocNative(q){return Buffer.allocUnsafe(q)}}qI8.emptyBuffer=Buffer.allocUnsafe(0);class w_K{constructor(q){this.stream=q}onClose(q){return this.stream.on("close",q),Ha.Disposable.create(()=>this.stream.off("close",q))}onError(q){return this.stream.on("error",q),Ha.Disposable.create(()=>this.stream.off("error",q))}onEnd(q){return this.stream.on("end",q),Ha.Disposable.create(()=>this.stream.off("end",q))}onData(q){return this.stream.on("data",q),Ha.Disposable.create(()=>this.stream.off("data",q))}}class j_K{constructor(q){this.stream=q}onClose(q){return this.stream.on("close",q),Ha.Disposable.create(()=>this.stream.off("close",q))}onError(q){return this.stream.on("error",q),Ha.Disposable.create(()=>this.stream.off("error",q))}onEnd(q){return this.stream.on("end",q),Ha.Disposable.create(()=>this.stream.off("end",q))}write(q,K){return new Promise((_,z)=>{let Y=($)=>{if($===void 0||$===null)_();else z($)};if(typeof q==="string")this.stream.write(q,K,Y);else this.stream.write(q,Y)})}end(){this.stream.end()}}var H_K=Object.freeze({messageBuffer:Object.freeze({create:(q)=>new qI8(q)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(q,K)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(q,void 0,0),K.charset))}catch(_){return Promise.reject(_)}}}),decoder:Object.freeze({name:"application/json",decode:(q,K)=>{try{if(q instanceof Buffer)return Promise.resolve(JSON.parse(q.toString(K.charset)));else return Promise.resolve(JSON.parse(new O_K.TextDecoder(K.charset).decode(q)))}catch(_){return Promise.reject(_)}}})}),stream:Object.freeze({asReadableStream:(q)=>new w_K(q),asWritableStream:(q)=>new j_K(q)}),console,timer:Object.freeze({setTimeout(q,K,..._){let z=setTimeout(q,K,..._);return{dispose:()=>clearTimeout(z)}},setImmediate(q,...K){let _=setImmediate(q,...K);return{dispose:()=>clearImmediate(_)}},setInterval(q,K,..._){let z=setInterval(q,K,..._);return{dispose:()=>clearInterval(z)}}})});function eo1(){return H_K}(function(q){function K(){Ha.RAL.install(H_K)}q.install=K})(eo1||(eo1={}));J_K.default=eo1});var G_K=m((XY)=>{var jlz=XY&&XY.__createBinding||(Object.create?function(q,K,_,z){if(z===void 0)z=_;var Y=Object.getOwnPropertyDescriptor(K,_);if(!Y||("get"in Y?!K.__esModule:Y.writable||Y.configurable))Y={enumerable:!0,get:function(){return K[_]}};Object.defineProperty(q,z,Y)}:function(q,K,_,z){if(z===void 0)z=_;q[z]=K[_]}),Hlz=XY&&XY.__exportStar||function(q,K){for(var _ in q)if(_!=="default"&&!Object.prototype.hasOwnProperty.call(K,_))jlz(K,q,_)};Object.defineProperty(XY,"__esModule",{value:!0});XY.createMessageConnection=XY.createServerSocketTransport=XY.createClientSocketTransport=XY.createServerPipeTransport=XY.createClientPipeTransport=XY.generateRandomPipeName=XY.StreamMessageWriter=XY.StreamMessageReader=XY.SocketMessageWriter=XY.SocketMessageReader=XY.PortMessageWriter=XY.PortMessageReader=XY.IPCMessageWriter=XY.IPCMessageReader=void 0;var ML6=M_K();ML6.default.install();var X_K=U6("path"),Jlz=U6("os"),Mlz=U6("crypto"),KI8=U6("net"),_R=ex8();Hlz(ex8(),XY);class W_K extends _R.AbstractMessageReader{constructor(q){super();this.process=q;let K=this.process;K.on("error",(_)=>this.fireError(_)),K.on("close",()=>this.fireClose())}listen(q){return this.process.on("message",q),_R.Disposable.create(()=>this.process.off("message",q))}}XY.IPCMessageReader=W_K;class D_K extends _R.AbstractMessageWriter{constructor(q){super();this.process=q,this.errorCount=0;let K=this.process;K.on("error",(_)=>this.fireError(_)),K.on("close",()=>this.fireClose)}write(q){try{if(typeof this.process.send==="function")this.process.send(q,void 0,void 0,(K)=>{if(K)this.errorCount++,this.handleError(K,q);else this.errorCount=0});return Promise.resolve()}catch(K){return this.handleError(K,q),Promise.reject(K)}}handleError(q,K){this.errorCount++,this.fireError(q,K,this.errorCount)}end(){}}XY.IPCMessageWriter=D_K;class f_K extends _R.AbstractMessageReader{constructor(q){super();this.onData=new _R.Emitter,q.on("close",()=>this.fireClose),q.on("error",(K)=>this.fireError(K)),q.on("message",(K)=>{this.onData.fire(K)})}listen(q){return this.onData.event(q)}}XY.PortMessageReader=f_K;class Z_K extends _R.AbstractMessageWriter{constructor(q){super();this.port=q,this.errorCount=0,q.on("close",()=>this.fireClose()),q.on("error",(K)=>this.fireError(K))}write(q){try{return this.port.postMessage(q),Promise.resolve()}catch(K){return this.handleError(K,q),Promise.reject(K)}}handleError(q,K){this.errorCount++,this.fireError(q,K,this.errorCount)}end(){}}XY.PortMessageWriter=Z_K;class XL6 extends _R.ReadableStreamMessageReader{constructor(q,K="utf-8"){super((0,ML6.default)().stream.asReadableStream(q),K)}}XY.SocketMessageReader=XL6;class PL6 extends _R.WriteableStreamMessageWriter{constructor(q,K){super((0,ML6.default)().stream.asWritableStream(q),K);this.socket=q}dispose(){super.dispose(),this.socket.destroy()}}XY.SocketMessageWriter=PL6;class qa1 extends _R.ReadableStreamMessageReader{constructor(q,K){super((0,ML6.default)().stream.asReadableStream(q),K)}}XY.StreamMessageReader=qa1;class Ka1 extends _R.WriteableStreamMessageWriter{constructor(q,K){super((0,ML6.default)().stream.asWritableStream(q),K)}}XY.StreamMessageWriter=Ka1;var P_K=process.env.XDG_RUNTIME_DIR,Xlz=new Map([["linux",107],["darwin",103]]);function Plz(){let q=(0,Mlz.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${q}-sock`;let K;if(P_K)K=X_K.join(P_K,`vscode-ipc-${q}.sock`);else K=X_K.join(Jlz.tmpdir(),`vscode-${q}.sock`);let _=Xlz.get(process.platform);if(_!==void 0&&K.length>_)(0,ML6.default)().console.warn(`WARNING: IPC handle "${K}" is longer than ${_} characters.`);return K}XY.generateRandomPipeName=Plz;function Wlz(q,K="utf-8"){let _,z=new Promise((Y,$)=>{_=Y});return new Promise((Y,$)=>{let A=(0,KI8.createServer)((O)=>{A.close(),_([new XL6(O,K),new PL6(O,K)])});A.on("error",$),A.listen(q,()=>{A.removeListener("error",$),Y({onConnected:()=>{return z}})})})}XY.createClientPipeTransport=Wlz;function Dlz(q,K="utf-8"){let _=(0,KI8.createConnection)(q);return[new XL6(_,K),new PL6(_,K)]}XY.createServerPipeTransport=Dlz;function flz(q,K="utf-8"){let _,z=new Promise((Y,$)=>{_=Y});return new Promise((Y,$)=>{let A=(0,KI8.createServer)((O)=>{A.close(),_([new XL6(O,K),new PL6(O,K)])});A.on("error",$),A.listen(q,"127.0.0.1",()=>{A.removeListener("error",$),Y({onConnected:()=>{return z}})})})}XY.createClientSocketTransport=flz;function Zlz(q,K="utf-8"){let _=(0,KI8.createConnection)(q,"127.0.0.1");return[new XL6(_,K),new PL6(_,K)]}XY.createServerSocketTransport=Zlz;function Glz(q){let K=q;return K.read!==void 0&&K.addListener!==void 0}function Tlz(q){let K=q;return K.write!==void 0&&K.addListener!==void 0}function vlz(q,K,_,z){if(!_)_=_R.NullLogger;let Y=Glz(q)?new qa1(q):q,$=Tlz(K)?new Ka1(K):K;if(_R.ConnectionStrategy.is(z))z={connectionStrategy:z};return(0,_R.createMessageConnection)(Y,$,_,z)}XY.createMessageConnection=vlz});var T_K={};T8(T_K,{createLSPClient:()=>Vlz});import{spawn as klz}from"child_process";function Vlz(q,K){let _,z,Y,$=!1,A=!1,O,w=!1,j=[],H=[];function J(){if(A)throw O||Error(`LSP server ${q} failed to start`)}return{get capabilities(){return Y},get isInitialized(){return $},async start(M,X,P){try{if(_=klz(M,X,{stdio:["pipe","pipe","pipe"],env:{...Ym(),...P?.env},cwd:P?.cwd,windowsHide:!0}),!_.stdout||!_.stdin)throw Error("LSP server process stdio not available");let W=_;if(await new Promise((G,Z)=>{let T=()=>{V(),G()},v=(E)=>{V(),Z(E)},V=()=>{W.removeListener("spawn",T),W.removeListener("error",v)};W.once("spawn",T),W.once("error",v)}),_.stderr)_.stderr.on("data",(G)=>{let Z=G.toString().trim();if(Z)N(`[LSP SERVER ${q}] ${Z}`)});_.on("error",(G)=>{if(!w)A=!0,O=G,H6(Error(`LSP server ${q} failed to start: ${G.message}`))}),_.on("exit",(G,Z)=>{if(G!==0&&G!==null&&!w){$=!1,A=!1,O=void 0;let T=Error(`LSP server ${q} crashed with exit code ${G}`);H6(T),K?.(T)}}),_.stdin.on("error",(G)=>{if(!w)N(`LSP server ${q} stdin error: ${G.message}`)});let D=new ZK6.StreamMessageReader(_.stdout),f=new ZK6.StreamMessageWriter(_.stdin);z=ZK6.createMessageConnection(D,f),z.onError(([G,Z,T])=>{if(!w)A=!0,O=G,H6(Error(`LSP server ${q} connection error: ${G.message}`))}),z.onClose(()=>{if(!w)$=!1,N(`LSP server ${q} connection closed`)}),z.listen(),z.trace(ZK6.Trace.Verbose,{log:(G)=>{N(`[LSP PROTOCOL ${q}] ${G}`)}}).catch((G)=>{N(`Failed to enable tracing for ${q}: ${G.message}`)});for(let{method:G,handler:Z}of j)z.onNotification(G,Z),N(`Applied queued notification handler for ${q}.${G}`);j.length=0;for(let{method:G,handler:Z}of H)z.onRequest(G,Z),N(`Applied queued request handler for ${q}.${G}`);H.length=0,N(`LSP client started for ${q}`)}catch(W){throw H6(Error(`LSP server ${q} failed to start: ${W.message}`)),W}},async initialize(M){if(!z)throw Error("LSP client not started");J();try{let X=await z.sendRequest("initialize",M);return Y=X.capabilities,await z.sendNotification("initialized",{}),$=!0,N(`LSP server ${q} initialized`),X}catch(X){throw H6(Error(`LSP server ${q} initialize failed: ${X.message}`)),X}},async sendRequest(M,X){if(!z)throw Error("LSP client not started");if(J(),!$)throw Error("LSP server not initialized");try{return await z.sendRequest(M,X)}catch(P){throw H6(Error(`LSP server ${q} request ${M} failed: ${P.message}`)),P}},async sendNotification(M,X){if(!z)throw Error("LSP client not started");J();try{await z.sendNotification(M,X)}catch(P){H6(Error(`LSP server ${q} notification ${M} failed: ${P.message}`)),N(`Notification ${M} failed but continuing`)}},onNotification(M,X){if(!z){j.push({method:M,handler:X}),N(`Queued notification handler for ${q}.${M} (connection not ready)`);return}J(),z.onNotification(M,X)},onRequest(M,X){if(!z){H.push({method:M,handler:X}),N(`Queued request handler for ${q}.${M} (connection not ready)`);return}J(),z.onRequest(M,X)},async stop(){let M;w=!0;try{if(z)await z.sendRequest("shutdown",{}),await z.sendNotification("exit",{})}catch(X){let P=X;H6(Error(`LSP server ${q} stop failed: ${P.message}`)),M=P}finally{if(z){try{z.dispose()}catch(X){N(`Connection disposal failed for ${q}: ${d6(X)}`)}z=void 0}if(_){if(_.removeAllListeners("error"),_.removeAllListeners("exit"),_.stdin)_.stdin.removeAllListeners("error");if(_.stderr)_.stderr.removeAllListeners("data");try{_.kill()}catch(X){N(`Process kill failed for ${q} (may already be dead): ${d6(X)}`)}_=void 0}if($=!1,Y=void 0,w=!1,M)A=!0,O=M;N(`LSP client stopped for ${q}`)}if(M)throw M}}}var ZK6;var v_K=y(()=>{_8();y8();E8();bw6();ZK6=O6(G_K(),1)});import*as k_K from"path";import{pathToFileURL as Nlz}from"url";function V_K(q,K){if(K.restartOnCrash!==void 0)throw Error(`LSP server '${q}': restartOnCrash is not yet implemented. Remove this field from the configuration.`);if(K.shutdownTimeout!==void 0)throw Error(`LSP server '${q}': shutdownTimeout is not yet implemented. Remove this field from the configuration.`);let{createLSPClient:_}=(v_K(),Eq(T_K)),z="stopped",Y,$,A=0,O=0,w=_(q,(f)=>{z="error",$=f,O++});async function j(){if(z==="running"||z==="starting")return;let f=K.maxRestarts??3;if(z==="error"&&O>f){let Z=Error(`LSP server '${q}' exceeded max crash recovery attempts (${f})`);throw $=Z,H6(Z),Z}let G;try{z="starting",N(`Starting LSP server instance: ${q}`),await w.start(K.command,K.args||[],{env:K.env,cwd:K.workspaceFolder});let Z=K.workspaceFolder||Z8(),T=Nlz(Z).href,v={processId:process.pid,initializationOptions:K.initializationOptions??{},workspaceFolders:[{uri:T,name:k_K.basename(Z)}],rootPath:Z,rootUri:T,capabilities:{workspace:{configuration:!1,workspaceFolders:!1},textDocument:{synchronization:{dynamicRegistration:!1,willSave:!1,willSaveWaitUntil:!1,didSave:!0},publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[1,2]},versionSupport:!1,codeDescriptionSupport:!0,dataSupport:!1},hover:{dynamicRegistration:!1,contentFormat:["markdown","plaintext"]},definition:{dynamicRegistration:!1,linkSupport:!0},references:{dynamicRegistration:!1},documentSymbol:{dynamicRegistration:!1,hierarchicalDocumentSymbolSupport:!0},callHierarchy:{dynamicRegistration:!1}},general:{positionEncodings:["utf-16"]}}};if(G=w.initialize(v),K.startupTimeout!==void 0)await Llz(G,K.startupTimeout,`LSP server '${q}' timed out after ${K.startupTimeout}ms during initialization`);else await G;z="running",Y=new Date,O=0,N(`LSP server instance started: ${q}`)}catch(Z){throw w.stop().catch(()=>{}),G?.catch(()=>{}),z="error",$=Z,H6(Z),Z}}async function H(){if(z==="stopped"||z==="stopping")return;try{z="stopping",await w.stop(),z="stopped",N(`LSP server instance stopped: ${q}`)}catch(f){throw z="error",$=f,H6(f),f}}async function J(){try{await H()}catch(G){let Z=Error(`Failed to stop LSP server '${q}' during restart: ${d6(G)}`);throw H6(Z),Z}A++;let f=K.maxRestarts??3;if(A>f){let G=Error(`Max restart attempts (${f}) exceeded for server '${q}'`);throw H6(G),G}try{await j()}catch(G){let Z=Error(`Failed to start LSP server '${q}' during restart (attempt ${A}/${f}): ${d6(G)}`);throw H6(Z),Z}}function M(){return z==="running"&&w.isInitialized}async function X(f,G){if(!M()){let v=Error(`Cannot send request to LSP server '${q}': server is ${z}${$?`, last error: ${$.message}`:""}`);throw H6(v),v}let Z;for(let v=0;v<=_a1;v++)try{return await w.sendRequest(f,G)}catch(V){Z=V;let E=V.code;if(typeof E==="number"&&E===ylz&&v<_a1){let R=Elz*Math.pow(2,v);N(`LSP request '${f}' to '${q}' got ContentModified error, retrying in ${R}ms (attempt ${v+1}/${_a1})…`),await R7(R);continue}break}let T=Error(`LSP request '${f}' failed for server '${q}': ${Z?.message??"unknown error"}`);throw H6(T),T}async function P(f,G){if(!M()){let Z=Error(`Cannot send notification to LSP server '${q}': server is ${z}`);throw H6(Z),Z}try{await w.sendNotification(f,G)}catch(Z){let T=Error(`LSP notification '${f}' failed for server '${q}': ${d6(Z)}`);throw H6(T),T}}function W(f,G){w.onNotification(f,G)}function D(f,G){w.onRequest(f,G)}return{name:q,config:K,get state(){return z},get startTime(){return Y},get lastError(){return $},get restartCount(){return A},start:j,stop:H,restart:J,isHealthy:M,sendRequest:X,sendNotification:P,onNotification:W,onRequest:D}}function Llz(q,K,_){let z,Y=new Promise(($,A)=>{z=setTimeout((O,w)=>O(Error(w)),K,A,_)});return Promise.race([q,Y]).finally(()=>clearTimeout(z))}var ylz=-32801,_a1=3,Elz=500;var N_K=y(()=>{I7();_8();y8();E8()});import*as Ja from"path";import{pathToFileURL as R68}from"url";function y_K(){let q=new Map,K=new Map,_=new Map;async function z(){let P;try{P=(await L3K()).servers,N(`[LSP SERVER MANAGER] getAllLspServers returned ${Object.keys(P).length} server(s)`)}catch(W){throw H6(Error(`Failed to load LSP server configuration: ${W.message}`)),W}for(let[W,D]of Object.entries(P))try{if(!D.command)throw Error(`Server ${W} missing required 'command' field`);if(!D.extensionToLanguage||Object.keys(D.extensionToLanguage).length===0)throw Error(`Server ${W} missing required 'extensionToLanguage' field`);let f=Object.keys(D.extensionToLanguage);for(let Z of f){let T=Z.toLowerCase();if(!K.has(T))K.set(T,[]);let v=K.get(T);if(v)v.push(W)}let G=V_K(W,D);q.set(W,G),G.onRequest("workspace/configuration",(Z)=>{return N(`LSP: Received workspace/configuration request from ${W}`),Z.items.map(()=>null)})}catch(f){H6(Error(`Failed to initialize LSP server ${W}: ${f.message}`))}N(`LSP manager initialized with ${q.size} servers`)}async function Y(){let P=Array.from(q.entries()).filter(([,f])=>f.state==="running"||f.state==="error"),W=await Promise.allSettled(P.map(([,f])=>f.stop()));q.clear(),K.clear(),_.clear();let D=W.map((f,G)=>f.status==="rejected"?`${P[G][0]}: ${d6(f.reason)}`:null).filter((f)=>f!==null);if(D.length>0){let f=Error(`Failed to stop ${D.length} LSP server(s): ${D.join("; ")}`);throw H6(f),f}}function $(P){let W=Ja.extname(P).toLowerCase(),D=K.get(W);if(!D||D.length===0)return;let f=D[0];if(!f)return;return q.get(f)}async function A(P){let W=$(P);if(!W)return;if(W.state==="stopped"||W.state==="error")try{await W.start()}catch(D){throw H6(Error(`Failed to start LSP server for file ${P}: ${D.message}`)),D}return W}async function O(P,W,D){let f=await A(P);if(!f)return;try{return await f.sendRequest(W,D)}catch(G){throw H6(Error(`LSP request failed for file ${P}, method '${W}': ${G.message}`)),G}}function w(){return q}async function j(P,W){let D=await A(P);if(!D)return;let f=R68(Ja.resolve(P)).href;if(_.get(f)===D.name){N(`LSP: File already open, skipping didOpen for ${P}`);return}let G=Ja.extname(P).toLowerCase(),Z=D.config.extensionToLanguage[G]||"plaintext";try{await D.sendNotification("textDocument/didOpen",{textDocument:{uri:f,languageId:Z,version:1,text:W}}),_.set(f,D.name),N(`LSP: Sent didOpen for ${P} (languageId: ${Z})`)}catch(T){let v=Error(`Failed to sync file open ${P}: ${d6(T)}`);throw H6(v),v}}async function H(P,W){let D=$(P);if(!D||D.state!=="running")return j(P,W);let f=R68(Ja.resolve(P)).href;if(_.get(f)!==D.name)return j(P,W);try{await D.sendNotification("textDocument/didChange",{textDocument:{uri:f,version:1},contentChanges:[{text:W}]}),N(`LSP: Sent didChange for ${P}`)}catch(G){let Z=Error(`Failed to sync file change ${P}: ${d6(G)}`);throw H6(Z),Z}}async function J(P){let W=$(P);if(!W||W.state!=="running")return;try{await W.sendNotification("textDocument/didSave",{textDocument:{uri:R68(Ja.resolve(P)).href}}),N(`LSP: Sent didSave for ${P}`)}catch(D){let f=Error(`Failed to sync file save ${P}: ${d6(D)}`);throw H6(f),f}}async function M(P){let W=$(P);if(!W||W.state!=="running")return;let D=R68(Ja.resolve(P)).href;try{await W.sendNotification("textDocument/didClose",{textDocument:{uri:D}}),_.delete(D),N(`LSP: Sent didClose for ${P}`)}catch(f){let G=Error(`Failed to sync file close ${P}: ${d6(f)}`);throw H6(G),G}}function X(P){let W=R68(Ja.resolve(P)).href;return _.has(W)}return{initialize:z,shutdown:Y,getServerForFile:$,ensureServerStarted:A,sendRequest:O,getAllServers:w,openFile:j,changeFile:H,saveFile:J,closeFile:M,isFileOpen:X}}var E_K=y(()=>{_8();y8();E8();R3K();N_K()});import{fileURLToPath as Rlz}from"url";function hlz(q){switch(q){case 1:return"Error";case 2:return"Warning";case 3:return"Info";case 4:return"Hint";default:return"Error"}}function Slz(q){let K;try{K=q.uri.startsWith("file://")?Rlz(q.uri):q.uri}catch(z){let Y=x1(z);H6(Y),N(`Failed to convert URI to file path: ${q.uri}. Error: ${Y.message}. Using original URI as fallback.`),K=q.uri}let _=q.diagnostics.map((z)=>({message:z.message,severity:hlz(z.severity),range:{start:{line:z.range.start.line,character:z.range.start.character},end:{line:z.range.end.line,character:z.range.end.character}},source:z.source,code:z.code!==void 0&&z.code!==null?String(z.code):void 0}));return[{uri:K,diagnostics:_}]}function L_K(q){let K=q.getAllServers(),_=[],z=0,Y=new Map;for(let[A,O]of K.entries())try{if(!O||typeof O.onNotification!=="function"){let w=!O?"Server instance is null/undefined":"Server instance has no onNotification method";_.push({serverName:A,error:w});let j=Error(`${w} for ${A}`);H6(j),N(`Skipping handler registration for ${A}: ${w}`);continue}O.onNotification("textDocument/publishDiagnostics",(w)=>{N(`[PASSIVE DIAGNOSTICS] Handler invoked for ${A}! Params type: ${typeof w}`);try{if(!w||typeof w!=="object"||!("uri"in w)||!("diagnostics"in w)){let M=Error(`LSP server ${A} sent invalid diagnostic params (missing uri or diagnostics)`);H6(M),N(`Invalid diagnostic params from ${A}: ${g6(w)}`);return}let j=w;N(`Received diagnostics from ${A}: ${j.diagnostics.length} diagnostic(s) for ${j.uri}`);let H=Slz(j),J=H[0];if(!J||H.length===0||J.diagnostics.length===0){N(`Skipping empty diagnostics from ${A} for ${j.uri}`);return}try{T3K({serverName:A,files:H}),N(`LSP Diagnostics: Registered ${H.length} diagnostic file(s) from ${A} for async delivery`),Y.delete(A)}catch(M){let X=x1(M);H6(X),N(`Error registering LSP diagnostics from ${A}: URI: ${j.uri}, Diagnostic count: ${J.diagnostics.length}, Error: ${X.message}`);let P=Y.get(A)||{count:0,lastError:""};if(P.count++,P.lastError=X.message,Y.set(A,P),P.count>=3)N(`WARNING: LSP diagnostic handler for ${A} has failed ${P.count} times consecutively. Last error: ${P.lastError}. This may indicate a problem with the LSP server or diagnostic processing. Check logs for details.`)}}catch(j){let H=x1(j);H6(H),N(`Unexpected error processing diagnostics from ${A}: ${H.message}`);let J=Y.get(A)||{count:0,lastError:""};if(J.count++,J.lastError=H.message,Y.set(A,J),J.count>=3)N(`WARNING: LSP diagnostic handler for ${A} has failed ${J.count} times consecutively. Last error: ${J.lastError}. This may indicate a problem with the LSP server or diagnostic processing. Check logs for details.`)}}),N(`Registered diagnostics handler for ${A}`),z++}catch(w){let j=x1(w);_.push({serverName:A,error:j.message}),H6(j),N(`Failed to register diagnostics handler for ${A}: Error: ${j.message}`)}let $=K.size;if(_.length>0){let A=_.map((O)=>`${O.serverName} (${O.error})`).join(", ");H6(Error(`Failed to register diagnostics for ${_.length} LSP server(s): ${A}`)),N(`LSP notification handler registration: ${z}/${$} succeeded. Failed servers: ${A}. Diagnostics from failed servers will not be delivered.`)}else N(`LSP notification handlers registered successfully for all ${$} server(s)`);return{totalServers:$,successCount:z,registrationErrors:_,diagnosticFailures:Y}}var R_K=y(()=>{_8();y8();E8();l8();OL6()});function Ma(){if(oG==="failed")return;return sN}function WL6(){if(oG==="failed")return{status:"failed",error:h68||Error("Initialization failed")};if(oG==="not-started")return{status:"not-started"};if(oG==="pending")return{status:"pending"};return{status:"success"}}function h_K(){if(oG==="failed")return!1;let q=Ma();if(!q)return!1;let K=q.getAllServers();if(K.size===0)return!1;for(let _ of K.values())if(_.state!=="error")return!0;return!1}async function S_K(){if(oG==="success"||oG==="failed")return;if(oG==="pending"&&zI8)await zI8}function za1(){if(f9())return;if(N("[LSP MANAGER] initializeLspServerManager() called"),sN!==void 0&&oG!=="failed"){N("[LSP MANAGER] Already initialized or initializing, skipping");return}if(oG==="failed")sN=void 0,h68=void 0;sN=y_K(),oG="pending",N("[LSP MANAGER] Created manager instance, state=pending");let q=++_I8;N(`[LSP MANAGER] Starting async initialization (generation ${q})`),zI8=sN.initialize().then(()=>{if(q===_I8){if(oG="success",N("LSP server manager initialized successfully"),sN)L_K(sN)}}).catch((K)=>{if(q===_I8)oG="failed",h68=K,sN=void 0,H6(K),N(`Failed to initialize LSP server manager: ${d6(K)}`)})}function YI8(){if(oG==="not-started")return;if(N("[LSP MANAGER] reinitializeLspServerManager() called"),sN)sN.shutdown().catch((q)=>{N(`[LSP MANAGER] old instance shutdown during reinit failed: ${d6(q)}`)});sN=void 0,oG="not-started",h68=void 0,za1()}async function C_K(){if(sN===void 0)return;try{await sN.shutdown(),N("LSP server manager shut down successfully")}catch(q){H6(q),N(`Failed to shutdown LSP server manager: ${d6(q)}`)}finally{sN=void 0,oG="not-started",h68=void 0,zI8=void 0,_I8++}}var sN,oG="not-started",h68,_I8=0,zI8;var uQ=y(()=>{_8();m8();y8();E8();E_K();R_K()});var u_K={};T8(u_K,{scanForSecrets:()=>$a1,redactSecrets:()=>Ilz,getSecretLabel:()=>xlz});function blz(){if(Ya1===null)Ya1=x_K.map((q)=>({id:q.id,re:new RegExp(q.source,q.flags)}));return Ya1}function I_K(q){let K={aws:"AWS",gcp:"GCP",api:"API",pat:"PAT",ad:"AD",tf:"TF",oauth:"OAuth",npm:"NPM",pypi:"PyPI",jwt:"JWT",github:"GitHub",gitlab:"GitLab",openai:"OpenAI",digitalocean:"DigitalOcean",huggingface:"HuggingFace",hashicorp:"HashiCorp",sendgrid:"SendGrid"};return q.split("-").map((_)=>K[_]??Tf(_)).join(" ")}function $a1(q){let K=[],_=new Set;for(let z of blz()){if(_.has(z.id))continue;if(z.re.test(q))_.add(z.id),K.push({ruleId:z.id,label:I_K(z.id)})}return K}function xlz(q){return I_K(q)}function Ilz(q){b_K??=x_K.map((K)=>new RegExp(K.source,(K.flags??"").replace("g","")+"g"));for(let K of b_K)q=q.replace(K,(_,z)=>typeof z==="string"?_.replace(z,"[REDACTED]"):"[REDACTED]");return q}var Clz,x_K,Ya1=null,b_K=null;var Aa1=y(()=>{Clz=["sk","ant","api"].join("-"),x_K=[{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b"},{id:"gcp-api-key",source:`\\b(AIza[\\w-]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"anthropic-api-key",source:`\\b(${Clz}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i"}]});function $I8(q,K){{let{isTeamMemPath:_}=(YL(),Eq(Pi)),{scanForSecrets:z}=(Aa1(),Eq(u_K));if(!_(q))return null;let Y=z(K);if(Y.length===0)return null;return`Content contains potential secrets (${Y.map((A)=>A.label).join(", ")}) and cannot be written to team memory. Team memory is shared with all repository collaborators. Remove the sensitive content and try again.`}return null}function Oa1(q){if(!q||!q.trim())return[];let K=o$(q,(_)=>`$${_}`);if(!K.success)return q.split(/\s+/).filter(Boolean);return K.tokens.filter((_)=>typeof _==="string")}function AI8(q){if(!q)return[];let K=(_)=>typeof _==="string"&&_.trim()!==""&&!/^\d+$/.test(_);if(Array.isArray(q))return q.filter(K);if(typeof q==="string")return q.split(/\s+/).filter(K);return[]}function m_K(q,K){let _=q.slice(K.length);if(_.length===0)return;return _.map((z)=>`[${z}]`).join(" ")}function DL6(q,K,_=!0,z=[]){if(K===void 0||K===null)return q;let Y=Oa1(K),$=q;for(let A=0;A<z.length;A++){let O=z[A];if(!O)continue;q=q.replace(new RegExp(`\\$${O}(?![\\[\\w])`,"g"),Y[A]??"")}if(q=q.replace(/\$ARGUMENTS\[(\d+)\]/g,(A,O)=>{let w=parseInt(O,10);return Y[w]??""}),q=q.replace(/\$(\d+)(?!\w)/g,(A,O)=>{let w=parseInt(O,10);return Y[w]??""}),q=q.replaceAll("$ARGUMENTS",K),q===$&&_&&K)q=q+` |
| 2526 | |
| 2527 | ARGUMENTS: ${K}`;return q}var S68=y(()=>{NX()});function C68(q,K){if(!q.includes("<claude-code-hint"))return{hints:[],stripped:q};let _=Flz(K),z=[],Y=q.replace(plz,(A)=>{let O=glz(A),w=Number(O.v),j=O.type,H=O.value;if(!ulz.has(w))return N(`[claudeCodeHints] dropped hint with unsupported v=${O.v}`),"";if(!j||!mlz.has(j))return N(`[claudeCodeHints] dropped hint with unsupported type=${j}`),"";if(!H)return N("[claudeCodeHints] dropped hint with empty value"),"";return z.push({v:w,type:j,value:H,sourceCommand:_}),""}),$=z.length>0||Y!==q?Y.replace(/\n{3,}/g,` |
nothing calls this directly
no test coverage detected