@embedder/embedder 1.1.1 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/_commonjsHelpers-C1uRMj_j.js +1 -0
- package/assets/cli-DIXdkQBM.js +887 -0
- package/assets/devtools-B4JKPJyU.js +1 -0
- package/assets/index-B3hJUcJE.js +1 -0
- package/assets/index-BCdeyKtY.js +1 -0
- package/assets/index-oEV_emLn.js +1 -0
- package/cli.js +2 -0
- package/package.json +15 -96
- package/LICENSE +0 -36
- package/bundle/embedder.js +0 -618
- package/bundle/gdb-debugger-python/gdb_bridge.py +0 -392
- package/bundle/gdb-debugger-python/requirements.txt +0 -1
- package/bundle/postinstall-for-users.js +0 -515
- package/bundle/repomap-bridge.js +0 -6
- package/bundle/repomap-python/importance.py +0 -58
- package/bundle/repomap-python/queries/tree-sitter-language-pack/README.md +0 -9
- package/bundle/repomap-python/queries/tree-sitter-language-pack/arduino-tags.scm +0 -5
- package/bundle/repomap-python/queries/tree-sitter-language-pack/c-tags.scm +0 -9
- package/bundle/repomap-python/queries/tree-sitter-language-pack/chatito-tags.scm +0 -16
- package/bundle/repomap-python/queries/tree-sitter-language-pack/commonlisp-tags.scm +0 -122
- package/bundle/repomap-python/queries/tree-sitter-language-pack/cpp-tags.scm +0 -15
- package/bundle/repomap-python/queries/tree-sitter-language-pack/csharp-tags.scm +0 -26
- package/bundle/repomap-python/queries/tree-sitter-language-pack/d-tags.scm +0 -26
- package/bundle/repomap-python/queries/tree-sitter-language-pack/dart-tags.scm +0 -92
- package/bundle/repomap-python/queries/tree-sitter-language-pack/elisp-tags.scm +0 -5
- package/bundle/repomap-python/queries/tree-sitter-language-pack/elixir-tags.scm +0 -54
- package/bundle/repomap-python/queries/tree-sitter-language-pack/elm-tags.scm +0 -19
- package/bundle/repomap-python/queries/tree-sitter-language-pack/gleam-tags.scm +0 -41
- package/bundle/repomap-python/queries/tree-sitter-language-pack/go-tags.scm +0 -42
- package/bundle/repomap-python/queries/tree-sitter-language-pack/java-tags.scm +0 -20
- package/bundle/repomap-python/queries/tree-sitter-language-pack/javascript-tags.scm +0 -88
- package/bundle/repomap-python/queries/tree-sitter-language-pack/lua-tags.scm +0 -34
- package/bundle/repomap-python/queries/tree-sitter-language-pack/ocaml-tags.scm +0 -115
- package/bundle/repomap-python/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +0 -98
- package/bundle/repomap-python/queries/tree-sitter-language-pack/pony-tags.scm +0 -39
- package/bundle/repomap-python/queries/tree-sitter-language-pack/properties-tags.scm +0 -5
- package/bundle/repomap-python/queries/tree-sitter-language-pack/python-tags.scm +0 -14
- package/bundle/repomap-python/queries/tree-sitter-language-pack/r-tags.scm +0 -21
- package/bundle/repomap-python/queries/tree-sitter-language-pack/racket-tags.scm +0 -12
- package/bundle/repomap-python/queries/tree-sitter-language-pack/ruby-tags.scm +0 -64
- package/bundle/repomap-python/queries/tree-sitter-language-pack/rust-tags.scm +0 -60
- package/bundle/repomap-python/queries/tree-sitter-language-pack/solidity-tags.scm +0 -43
- package/bundle/repomap-python/queries/tree-sitter-language-pack/swift-tags.scm +0 -51
- package/bundle/repomap-python/queries/tree-sitter-language-pack/udev-tags.scm +0 -20
- package/bundle/repomap-python/queries/tree-sitter-languages/README.md +0 -24
- package/bundle/repomap-python/queries/tree-sitter-languages/c-tags.scm +0 -9
- package/bundle/repomap-python/queries/tree-sitter-languages/c_sharp-tags.scm +0 -46
- package/bundle/repomap-python/queries/tree-sitter-languages/cpp-tags.scm +0 -15
- package/bundle/repomap-python/queries/tree-sitter-languages/dart-tags.scm +0 -91
- package/bundle/repomap-python/queries/tree-sitter-languages/elisp-tags.scm +0 -8
- package/bundle/repomap-python/queries/tree-sitter-languages/elixir-tags.scm +0 -54
- package/bundle/repomap-python/queries/tree-sitter-languages/elm-tags.scm +0 -19
- package/bundle/repomap-python/queries/tree-sitter-languages/go-tags.scm +0 -30
- package/bundle/repomap-python/queries/tree-sitter-languages/hcl-tags.scm +0 -77
- package/bundle/repomap-python/queries/tree-sitter-languages/java-tags.scm +0 -20
- package/bundle/repomap-python/queries/tree-sitter-languages/javascript-tags.scm +0 -88
- package/bundle/repomap-python/queries/tree-sitter-languages/kotlin-tags.scm +0 -27
- package/bundle/repomap-python/queries/tree-sitter-languages/ocaml-tags.scm +0 -115
- package/bundle/repomap-python/queries/tree-sitter-languages/ocaml_interface-tags.scm +0 -98
- package/bundle/repomap-python/queries/tree-sitter-languages/php-tags.scm +0 -26
- package/bundle/repomap-python/queries/tree-sitter-languages/python-tags.scm +0 -12
- package/bundle/repomap-python/queries/tree-sitter-languages/ql-tags.scm +0 -26
- package/bundle/repomap-python/queries/tree-sitter-languages/ruby-tags.scm +0 -64
- package/bundle/repomap-python/queries/tree-sitter-languages/rust-tags.scm +0 -60
- package/bundle/repomap-python/queries/tree-sitter-languages/scala-tags.scm +0 -65
- package/bundle/repomap-python/queries/tree-sitter-languages/typescript-tags.scm +0 -41
- package/bundle/repomap-python/repomap.py +0 -229
- package/bundle/repomap-python/repomap_bridge.py +0 -234
- package/bundle/repomap-python/repomap_class.py +0 -637
- package/bundle/repomap-python/repomap_server.py +0 -561
- package/bundle/repomap-python/requirements.txt +0 -7
- package/bundle/repomap-python/scm.py +0 -59
- package/bundle/repomap-python/utils.py +0 -58
- package/bundle/sandbox-macos-permissive-closed.sb +0 -26
- package/bundle/sandbox-macos-permissive-open.sb +0 -19
- package/bundle/sandbox-macos-permissive-proxied.sb +0 -31
- package/bundle/sandbox-macos-restrictive-closed.sb +0 -87
- package/bundle/sandbox-macos-restrictive-open.sb +0 -90
- package/bundle/sandbox-macos-restrictive-proxied.sb +0 -92
- package/postinstall.js +0 -42
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"events";import t from"https";import s from"http";import r from"net";import i from"tls";import o from"crypto";import n from"stream";import a from"url";import h from"zlib";import{a as c,g as l}from"./_commonjsHelpers-C1uRMj_j.js";import d from"buffer";var f,u,_={exports:{}};function p(){if(u)return f;u=1;const e=["nodebuffer","arraybuffer","fragments"],t="undefined"!=typeof Blob;return t&&e.push("blob"),f={BINARY_TYPES:e,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:t,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}}const m=c(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var y,b,v,g,S;function E(){if(y)return _.exports;y=1;const{EMPTY_BUFFER:e}=p(),t=Buffer[Symbol.species];function s(e,t,s,r,i){for(let o=0;o<i;o++)s[r+o]=e[o]^t[3&o]}function r(e,t){for(let s=0;s<e.length;s++)e[s]^=t[3&s]}if(_.exports={concat:function(s,r){if(0===s.length)return e;if(1===s.length)return s[0];const i=Buffer.allocUnsafe(r);let o=0;for(let e=0;e<s.length;e++){const t=s[e];i.set(t,o),o+=t.length}return o<r?new t(i.buffer,i.byteOffset,o):i},mask:s,toArrayBuffer:function(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)},toBuffer:function e(s){if(e.readOnly=!0,Buffer.isBuffer(s))return s;let r;return s instanceof ArrayBuffer?r=new t(s):ArrayBuffer.isView(s)?r=new t(s.buffer,s.byteOffset,s.byteLength):(r=Buffer.from(s),e.readOnly=!1),r},unmask:r},!process.env.WS_NO_BUFFER_UTIL)try{const e=m;_.exports.mask=function(t,r,i,o,n){n<48?s(t,r,i,o,n):e.mask(t,r,i,o,n)},_.exports.unmask=function(t,s){t.length<32?r(t,s):e.unmask(t,s)}}catch(i){}return _.exports}function w(){if(S)return g;S=1;const e=h,t=E(),s=function(){if(v)return b;v=1;const e=Symbol("kDone"),t=Symbol("kRun");return b=class{constructor(s){this[e]=()=>{this.pending--,this[t]()},this.concurrency=s||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[t]()}[t](){if(this.pending!==this.concurrency&&this.jobs.length){const t=this.jobs.shift();this.pending++,t(this[e])}}}}(),{kStatusCode:r}=p(),i=Buffer[Symbol.species],o=Buffer.from([0,0,255,255]),n=Symbol("permessage-deflate"),a=Symbol("total-length"),c=Symbol("callback"),l=Symbol("buffers"),d=Symbol("error");let f;function u(e){this[l].push(e),this[a]+=e.length}function _(e){this[a]+=e.length,this[n]._maxPayload<1||this[a]<=this[n]._maxPayload?this[l].push(e):(this[d]=new RangeError("Max payload size exceeded"),this[d].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[d][r]=1009,this.removeListener("data",_),this.reset())}function m(e){this[n]._inflate=null,this[d]?this[c](this[d]):(e[r]=1007,this[c](e))}return g=class{constructor(e,t,r){if(this._maxPayload=0|r,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!f){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;f=new s(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[c];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,s=e.find(e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(s.server_no_context_takeover=!0),t.clientNoContextTakeover&&(s.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(s.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?s.client_max_window_bits=t.clientMaxWindowBits:!0!==s.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete s.client_max_window_bits,s}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let s=e[t];if(s.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(s=s[0],"client_max_window_bits"===t){if(!0!==s){const e=+s;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${s}`);s=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${s}`)}else if("server_max_window_bits"===t){const e=+s;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${s}`);s=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==s)throw new TypeError(`Invalid value for parameter "${t}": ${s}`)}e[t]=s})}),e}decompress(e,t,s){f.add(r=>{this._decompress(e,t,(e,t)=>{r(),s(e,t)})})}compress(e,t,s){f.add(r=>{this._compress(e,t,(e,t)=>{r(),s(e,t)})})}_decompress(s,r,i){const h=this._isServer?"client":"server";if(!this._inflate){const t=`${h}_max_window_bits`,s="number"!=typeof this.params[t]?e.Z_DEFAULT_WINDOWBITS:this.params[t];this._inflate=e.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[n]=this,this._inflate[a]=0,this._inflate[l]=[],this._inflate.on("error",m),this._inflate.on("data",_)}this._inflate[c]=i,this._inflate.write(s),r&&this._inflate.write(o),this._inflate.flush(()=>{const e=this._inflate[d];if(e)return this._inflate.close(),this._inflate=null,void i(e);const s=t.concat(this._inflate[l],this._inflate[a]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[a]=0,this._inflate[l]=[],r&&this.params[`${h}_no_context_takeover`]&&this._inflate.reset()),i(null,s)})}_compress(s,r,o){const n=this._isServer?"server":"client";if(!this._deflate){const t=`${n}_max_window_bits`,s="number"!=typeof this.params[t]?e.Z_DEFAULT_WINDOWBITS:this.params[t];this._deflate=e.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[a]=0,this._deflate[l]=[],this._deflate.on("data",u)}this._deflate[c]=o,this._deflate.write(s),this._deflate.flush(e.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=t.concat(this._deflate[l],this._deflate[a]);r&&(e=new i(e.buffer,e.byteOffset,e.length-4)),this._deflate[c]=null,this._deflate[a]=0,this._deflate[l]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,e)})}}}var k={exports:{}};const x=c(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var O,T,C,N,L,P,B,R,I,U,D,M,W;function A(){if(O)return k.exports;O=1;const{isUtf8:e}=d,{hasBlob:t}=p();function s(e){const t=e.length;let s=0;for(;s<t;)if(128&e[s])if(192==(224&e[s])){if(s+1===t||128!=(192&e[s+1])||192==(254&e[s]))return!1;s+=2}else if(224==(240&e[s])){if(s+2>=t||128!=(192&e[s+1])||128!=(192&e[s+2])||224===e[s]&&128==(224&e[s+1])||237===e[s]&&160==(224&e[s+1]))return!1;s+=3}else{if(240!=(248&e[s]))return!1;if(s+3>=t||128!=(192&e[s+1])||128!=(192&e[s+2])||128!=(192&e[s+3])||240===e[s]&&128==(240&e[s+1])||244===e[s]&&e[s+1]>143||e[s]>244)return!1;s+=4}else s++;return!0}if(k.exports={isBlob:function(e){return t&&"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&("Blob"===e[Symbol.toStringTag]||"File"===e[Symbol.toStringTag])},isValidStatusCode:function(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},isValidUTF8:s,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},e)k.exports.isValidUTF8=function(t){return t.length<24?s(t):e(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{const e=x;k.exports.isValidUTF8=function(t){return t.length<32?s(t):e(t)}}catch(r){}return k.exports}function F(){if(C)return T;C=1;const{Writable:e}=n,t=w(),{BINARY_TYPES:s,EMPTY_BUFFER:r,kStatusCode:i,kWebSocket:o}=p(),{concat:a,toArrayBuffer:h,unmask:c}=E(),{isValidStatusCode:l,isValidUTF8:d}=A(),f=Buffer[Symbol.species];return T=class extends e{constructor(e={}){super(),this._allowSynchronousEvents=void 0===e.allowSynchronousEvents||e.allowSynchronousEvents,this._binaryType=e.binaryType||s[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=0|e.maxPayload,this._skipUTF8Validation=!!e.skipUTF8Validation,this[o]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,s){if(8===this._opcode&&0==this._state)return s();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(s)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=new f(t.buffer,t.byteOffset+e,t.length-e),new f(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const s=this._buffers[0],r=t.length-e;e>=s.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(s.buffer,s.byteOffset,e),r),this._buffers[0]=new f(s.buffer,s.byteOffset+e,s.length-e)),e-=s.length}while(e>0);return t}startLoop(e){this._loop=!0;do{switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:return void(this._loop=!1)}}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2)return void(this._loop=!1);const s=this.consume(2);if(48&s[0]){return void e(this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3"))}const r=!(64&~s[0]);if(r&&!this._extensions[t.extensionName]){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(this._fin=!(128&~s[0]),this._opcode=15&s[0],this._payloadLength=127&s[1],0===this._opcode){if(r){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(!this._fragmented){return void e(this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE"))}this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented){return void e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"))}this._compressed=r}else{if(!(this._opcode>7&&this._opcode<11)){return void e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"))}if(!this._fin){return void e(this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN"))}if(r){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength){return void e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"))}}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=!(128&~s[1]),this._isServer){if(!this._masked){return void e(this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK"))}}else if(this._masked){return void e(this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK"))}126===this._payloadLength?this._state=1:127===this._payloadLength?this._state=2:this.haveLength(e)}getPayloadLength16(e){this._bufferedBytes<2?this._loop=!1:(this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e))}getPayloadLength64(e){if(this._bufferedBytes<8)return void(this._loop=!1);const t=this.consume(8),s=t.readUInt32BE(0);if(s>Math.pow(2,21)-1){return void e(this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"))}this._payloadLength=s*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){return void e(this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"))}this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=r;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&0!==(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])&&c(t,this._mask)}if(this._opcode>7)this.controlMessage(t,e);else{if(this._compressed)return this._state=5,void this.decompress(t,e);t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}}decompress(e,s){this._extensions[t.extensionName].decompress(e,this._fin,(e,t)=>{if(e)return s(e);if(t.length){if(this._messageLength+=t.length,this._messageLength>this._maxPayload&&this._maxPayload>0){const e=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");return void s(e)}this._fragments.push(t)}this.dataMessage(s),0===this._state&&this.startLoop(s)})}dataMessage(e){if(!this._fin)return void(this._state=0);const t=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let r;r="nodebuffer"===this._binaryType?a(s,t):"arraybuffer"===this._binaryType?h(a(s,t)):"blob"===this._binaryType?new Blob(s):s,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=0):(this._state=6,setImmediate(()=>{this.emit("message",r,!0),this._state=0,this.startLoop(e)}))}else{const r=a(s,t);if(!this._skipUTF8Validation&&!d(r)){const t=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void e(t)}5===this._state||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=0):(this._state=6,setImmediate(()=>{this.emit("message",r,!1),this._state=0,this.startLoop(e)}))}}controlMessage(e,t){if(8!==this._opcode)this._allowSynchronousEvents?(this.emit(9===this._opcode?"ping":"pong",e),this._state=0):(this._state=6,setImmediate(()=>{this.emit(9===this._opcode?"ping":"pong",e),this._state=0,this.startLoop(t)}));else{if(0===e.length)this._loop=!1,this.emit("conclude",1005,r),this.end();else{const s=e.readUInt16BE(0);if(!l(s)){const e=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");return void t(e)}const r=new f(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!d(r)){const e=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void t(e)}this._loop=!1,this.emit("conclude",s,r),this.end()}this._state=0}}createError(e,t,s,r,o){this._loop=!1,this._errored=!0;const n=new e(s?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(n,this.createError),n.code=o,n[i]=r,n}}}function j(){if(L)return N;L=1;const{Duplex:e}=n,{randomFillSync:t}=o,s=w(),{EMPTY_BUFFER:r,kWebSocket:i,NOOP:a}=p(),{isBlob:h,isValidStatusCode:c}=A(),{mask:l,toBuffer:d}=E(),f=Symbol("kByteLength"),u=Buffer.alloc(4),_=8192;let m,y=_;class b{constructor(e,t,s){this._extensions=t||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=0,this.onerror=a,this[i]=void 0}static frame(e,s){let r,i,o=!1,n=2,a=!1;s.mask&&(r=s.maskBuffer||u,s.generateMask?s.generateMask(r):(y===_&&(void 0===m&&(m=Buffer.alloc(_)),t(m,0,_),y=0),r[0]=m[y++],r[1]=m[y++],r[2]=m[y++],r[3]=m[y++]),a=0===(r[0]|r[1]|r[2]|r[3]),n=6),"string"==typeof e?i=s.mask&&!a||void 0===s[f]?(e=Buffer.from(e)).length:s[f]:(i=e.length,o=s.mask&&s.readOnly&&!a);let h=i;i>=65536?(n+=8,h=127):i>125&&(n+=2,h=126);const c=Buffer.allocUnsafe(o?i+n:n);return c[0]=s.fin?128|s.opcode:s.opcode,s.rsv1&&(c[0]|=64),c[1]=h,126===h?c.writeUInt16BE(i,2):127===h&&(c[2]=c[3]=0,c.writeUIntBE(i,4,6)),s.mask?(c[1]|=128,c[n-4]=r[0],c[n-3]=r[1],c[n-2]=r[2],c[n-1]=r[3],a?[c,e]:o?(l(e,r,c,n,i),[c]):(l(e,r,e,0,i),[c,e])):[c,e]}close(e,t,s,i){let o;if(void 0===e)o=r;else{if("number"!=typeof e||!c(e))throw new TypeError("First argument must be a valid error code number");if(void 0!==t&&t.length){const s=Buffer.byteLength(t);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(e,0),"string"==typeof t?o.write(t,2):o.set(t,2)}else o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0)}const n={[f]:o.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};0!==this._state?this.enqueue([this.dispatch,o,!1,n,i]):this.sendFrame(b.frame(o,n),i)}ping(e,t,s){let r,i;if("string"==typeof e?(r=Buffer.byteLength(e),i=!1):h(e)?(r=e.size,i=!1):(r=(e=d(e)).length,i=d.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const o={[f]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};h(e)?0!==this._state?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):0!==this._state?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(b.frame(e,o),s)}pong(e,t,s){let r,i;if("string"==typeof e?(r=Buffer.byteLength(e),i=!1):h(e)?(r=e.size,i=!1):(r=(e=d(e)).length,i=d.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const o={[f]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};h(e)?0!==this._state?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):0!==this._state?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(b.frame(e,o),s)}send(e,t,r){const i=this._extensions[s.extensionName];let o,n,a=t.binary?2:1,c=t.compress;"string"==typeof e?(o=Buffer.byteLength(e),n=!1):h(e)?(o=e.size,n=!1):(o=(e=d(e)).length,n=d.readOnly),this._firstFragment?(this._firstFragment=!1,c&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(c=o>=i._threshold),this._compress=c):(c=!1,a=0),t.fin&&(this._firstFragment=!0);const l={[f]:o,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:n,rsv1:c};h(e)?0!==this._state?this.enqueue([this.getBlobData,e,this._compress,l,r]):this.getBlobData(e,this._compress,l,r):0!==this._state?this.enqueue([this.dispatch,e,this._compress,l,r]):this.dispatch(e,this._compress,l,r)}getBlobData(e,t,s,r){this._bufferedBytes+=s[f],this._state=2,e.arrayBuffer().then(e=>{if(this._socket.destroyed){const e=new Error("The socket was closed while the blob was being read");return void process.nextTick(v,this,e,r)}this._bufferedBytes-=s[f];const i=d(e);t?this.dispatch(i,t,s,r):(this._state=0,this.sendFrame(b.frame(i,s),r),this.dequeue())}).catch(e=>{process.nextTick(g,this,e,r)})}dispatch(e,t,r,i){if(!t)return void this.sendFrame(b.frame(e,r),i);const o=this._extensions[s.extensionName];this._bufferedBytes+=r[f],this._state=1,o.compress(e,r.fin,(e,t)=>{if(this._socket.destroyed){return void v(this,new Error("The socket was closed while data was being compressed"),i)}this._bufferedBytes-=r[f],this._state=0,r.readOnly=!1,this.sendFrame(b.frame(t,r),i),this.dequeue()})}dequeue(){for(;0===this._state&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[3][f],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][f],this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}}function v(e,t,s){"function"==typeof s&&s(t);for(let r=0;r<e._queue.length;r++){const s=e._queue[r],i=s[s.length-1];"function"==typeof i&&i(t)}}function g(e,t,s){v(e,t,s),e.onerror(t)}return N=b}function $(){if(I)return R;I=1;const{tokenChars:e}=A();function t(e,t,s){void 0===e[t]?e[t]=[s]:e[t].push(s)}return R={format:function(e){return Object.keys(e).map(t=>{let s=e[t];return Array.isArray(s)||(s=[s]),s.map(e=>[t].concat(Object.keys(e).map(t=>{let s=e[t];return Array.isArray(s)||(s=[s]),s.map(e=>!0===e?t:`${t}=${e}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(s){const r=Object.create(null);let i,o,n=Object.create(null),a=!1,h=!1,c=!1,l=-1,d=-1,f=-1,u=0;for(;u<s.length;u++)if(d=s.charCodeAt(u),void 0===i)if(-1===f&&1===e[d])-1===l&&(l=u);else if(0===u||32!==d&&9!==d){if(59!==d&&44!==d)throw new SyntaxError(`Unexpected character at index ${u}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${u}`);-1===f&&(f=u);const e=s.slice(l,f);44===d?(t(r,e,n),n=Object.create(null)):i=e,l=f=-1}}else-1===f&&-1!==l&&(f=u);else if(void 0===o)if(-1===f&&1===e[d])-1===l&&(l=u);else if(32===d||9===d)-1===f&&-1!==l&&(f=u);else if(59===d||44===d){if(-1===l)throw new SyntaxError(`Unexpected character at index ${u}`);-1===f&&(f=u),t(n,s.slice(l,f),!0),44===d&&(t(r,i,n),n=Object.create(null),i=void 0),l=f=-1}else{if(61!==d||-1===l||-1!==f)throw new SyntaxError(`Unexpected character at index ${u}`);o=s.slice(l,u),l=f=-1}else if(h){if(1!==e[d])throw new SyntaxError(`Unexpected character at index ${u}`);-1===l?l=u:a||(a=!0),h=!1}else if(c)if(1===e[d])-1===l&&(l=u);else if(34===d&&-1!==l)c=!1,f=u;else{if(92!==d)throw new SyntaxError(`Unexpected character at index ${u}`);h=!0}else if(34===d&&61===s.charCodeAt(u-1))c=!0;else if(-1===f&&1===e[d])-1===l&&(l=u);else if(-1===l||32!==d&&9!==d){if(59!==d&&44!==d)throw new SyntaxError(`Unexpected character at index ${u}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${u}`);-1===f&&(f=u);let e=s.slice(l,f);a&&(e=e.replace(/\\/g,""),a=!1),t(n,o,e),44===d&&(t(r,i,n),n=Object.create(null),i=void 0),o=void 0,l=f=-1}}else-1===f&&(f=u);if(-1===l||c||32===d||9===d)throw new SyntaxError("Unexpected end of input");-1===f&&(f=u);const _=s.slice(l,f);return void 0===i?t(r,_,n):(void 0===o?t(n,_,!0):t(n,o,a?_.replace(/\\/g,""):_),t(r,i,n)),r}}}function V(){if(D)return U;D=1;const h=e,c=t,l=s,d=r,f=i,{randomBytes:u,createHash:_}=o,{Duplex:m,Readable:y}=n,{URL:b}=a,v=w(),g=F(),S=j(),{isBlob:k}=A(),{BINARY_TYPES:x,EMPTY_BUFFER:O,GUID:T,kForOnEventAttribute:C,kListener:N,kStatusCode:L,kWebSocket:R,NOOP:I}=p(),{EventTarget:{addEventListener:M,removeEventListener:W}}=function(){if(B)return P;B=1;const{kForOnEventAttribute:e,kListener:t}=p(),s=Symbol("kCode"),r=Symbol("kData"),i=Symbol("kError"),o=Symbol("kMessage"),n=Symbol("kReason"),a=Symbol("kTarget"),h=Symbol("kType"),c=Symbol("kWasClean");class l{constructor(e){this[a]=null,this[h]=e}get target(){return this[a]}get type(){return this[h]}}Object.defineProperty(l.prototype,"target",{enumerable:!0}),Object.defineProperty(l.prototype,"type",{enumerable:!0});class d extends l{constructor(e,t={}){super(e),this[s]=void 0===t.code?0:t.code,this[n]=void 0===t.reason?"":t.reason,this[c]=void 0!==t.wasClean&&t.wasClean}get code(){return this[s]}get reason(){return this[n]}get wasClean(){return this[c]}}Object.defineProperty(d.prototype,"code",{enumerable:!0}),Object.defineProperty(d.prototype,"reason",{enumerable:!0}),Object.defineProperty(d.prototype,"wasClean",{enumerable:!0});class f extends l{constructor(e,t={}){super(e),this[i]=void 0===t.error?null:t.error,this[o]=void 0===t.message?"":t.message}get error(){return this[i]}get message(){return this[o]}}Object.defineProperty(f.prototype,"error",{enumerable:!0}),Object.defineProperty(f.prototype,"message",{enumerable:!0});class u extends l{constructor(e,t={}){super(e),this[r]=void 0===t.data?null:t.data}get data(){return this[r]}}Object.defineProperty(u.prototype,"data",{enumerable:!0});const _={addEventListener(s,r,i={}){for(const n of this.listeners(s))if(!i[e]&&n[t]===r&&!n[e])return;let o;if("message"===s)o=function(e,t){const s=new u("message",{data:t?e:e.toString()});s[a]=this,m(r,this,s)};else if("close"===s)o=function(e,t){const s=new d("close",{code:e,reason:t.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[a]=this,m(r,this,s)};else if("error"===s)o=function(e){const t=new f("error",{error:e,message:e.message});t[a]=this,m(r,this,t)};else{if("open"!==s)return;o=function(){const e=new l("open");e[a]=this,m(r,this,e)}}o[e]=!!i[e],o[t]=r,i.once?this.once(s,o):this.on(s,o)},removeEventListener(s,r){for(const i of this.listeners(s))if(i[t]===r&&!i[e]){this.removeListener(s,i);break}}};function m(e,t,s){"object"==typeof e&&e.handleEvent?e.handleEvent.call(e,s):e.call(t,s)}return P={CloseEvent:d,ErrorEvent:f,Event:l,EventTarget:_,MessageEvent:u}}(),{format:V,parse:G}=$(),{toBuffer:q}=E(),z=Symbol("kAborted"),H=[8,13],Y=["CONNECTING","OPEN","CLOSING","CLOSED"],X=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class K extends h{constructor(e,t,s){super(),this._binaryType=x[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=O,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=K.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===t?t=[]:Array.isArray(t)||("object"==typeof t&&null!==t?(s=t,t=[]):t=[t]),Z(this,e,t,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){x.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,s){const r=new g({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),i=new S(e,this._extensions,s.generateMask);this._receiver=r,this._sender=i,this._socket=e,r[R]=this,i[R]=this,e[R]=this,r.on("conclude",re),r.on("drain",ie),r.on("error",oe),r.on("message",ae),r.on("ping",he),r.on("pong",ce),i.onerror=de,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",ue),e.on("data",_e),e.on("end",pe),e.on("error",me),this._readyState=K.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=K.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[v.extensionName]&&this._extensions[v.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=K.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==K.CLOSED){if(this.readyState===K.CONNECTING){const e="WebSocket was closed before the connection was established";return void te(this,this._req,e)}this.readyState!==K.CLOSING?(this._readyState=K.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),fe(this)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end()}}pause(){this.readyState!==K.CONNECTING&&this.readyState!==K.CLOSED&&(this._paused=!0,this._socket.pause())}ping(e,t,s){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(s=e,e=t=void 0):"function"==typeof t&&(s=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===K.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||O,t,s)):se(this,e,s)}pong(e,t,s){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(s=e,e=t=void 0):"function"==typeof t&&(s=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===K.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||O,t,s)):se(this,e,s)}resume(){this.readyState!==K.CONNECTING&&this.readyState!==K.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,s){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(s=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==K.OPEN)return void se(this,e,s);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[v.extensionName]||(r.compress=!1),this._sender.send(e||O,r,s)}terminate(){if(this.readyState!==K.CLOSED){if(this.readyState===K.CONNECTING){const e="WebSocket was closed before the connection was established";return void te(this,this._req,e)}this._socket&&(this._readyState=K.CLOSING,this._socket.destroy())}}}function Z(e,t,s,r){const i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:H[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,!H.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${H.join(", ")})`);let o;if(t instanceof b)o=t;else try{o=new b(t)}catch(S){throw new SyntaxError(`Invalid URL: ${t}`)}"http:"===o.protocol?o.protocol="ws:":"https:"===o.protocol&&(o.protocol="wss:"),e._url=o.href;const n="wss:"===o.protocol,a="ws+unix:"===o.protocol;let h;if("ws:"===o.protocol||n||a?a&&!o.pathname?h="The URL's pathname is empty":o.hash&&(h="The URL contains a fragment identifier"):h='The URL\'s protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"',h){const t=new SyntaxError(h);if(0===e._redirects)throw t;return void J(e,t)}const d=n?443:80,f=u(16).toString("base64"),p=n?c.request:l.request,m=new Set;let y,g;if(i.createConnection=i.createConnection||(n?ee:Q),i.defaultPort=i.defaultPort||d,i.port=o.port||d,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new v(!0!==i.perMessageDeflate?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=V({[v.extensionName]:y.offer()})),s.length){for(const e of s){if("string"!=typeof e||!X.test(e)||m.has(e))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(e)}i.headers["Sec-WebSocket-Protocol"]=s.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){const e=i.path.split(":");i.socketPath=e[0],i.path=e[1]}if(i.followRedirects){if(0===e._redirects){e._originalIpc=a,e._originalSecure=n,e._originalHostOrSocketPath=a?i.socketPath:o.host;const t=r&&r.headers;if(r={...r,headers:{}},t)for(const[e,s]of Object.entries(t))r.headers[e.toLowerCase()]=s}else if(0===e.listenerCount("redirect")){const t=a?!!e._originalIpc&&i.socketPath===e._originalHostOrSocketPath:!e._originalIpc&&o.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!n)&&(delete i.headers.authorization,delete i.headers.cookie,t||delete i.headers.host,i.auth=void 0)}i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),g=e._req=p(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(i);i.timeout&&g.on("timeout",()=>{te(e,g,"Opening handshake has timed out")}),g.on("error",t=>{null===g||g[z]||(g=e._req=null,J(e,t))}),g.on("response",o=>{const n=o.headers.location,a=o.statusCode;if(n&&i.followRedirects&&a>=300&&a<400){if(++e._redirects>i.maxRedirects)return void te(e,g,"Maximum redirects exceeded");let o;g.abort();try{o=new b(n,t)}catch(S){const s=new SyntaxError(`Invalid URL: ${n}`);return void J(e,s)}Z(e,o,s,r)}else e.emit("unexpected-response",g,o)||te(e,g,`Unexpected server response: ${o.statusCode}`)}),g.on("upgrade",(t,s,r)=>{if(e.emit("upgrade",t),e.readyState!==K.CONNECTING)return;g=e._req=null;const o=t.headers.upgrade;if(void 0===o||"websocket"!==o.toLowerCase())return void te(e,s,"Invalid Upgrade header");const n=_("sha1").update(f+T).digest("base64");if(t.headers["sec-websocket-accept"]!==n)return void te(e,s,"Invalid Sec-WebSocket-Accept header");const a=t.headers["sec-websocket-protocol"];let h;if(void 0!==a?m.size?m.has(a)||(h="Server sent an invalid subprotocol"):h="Server sent a subprotocol but none was requested":m.size&&(h="Server sent no subprotocol"),h)return void te(e,s,h);a&&(e._protocol=a);const c=t.headers["sec-websocket-extensions"];if(void 0!==c){if(!y){return void te(e,s,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let t;try{t=G(c)}catch(l){return void te(e,s,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(1!==r.length||r[0]!==v.extensionName){return void te(e,s,"Server indicated an extension that was not requested")}try{y.accept(t[v.extensionName])}catch(l){return void te(e,s,"Invalid Sec-WebSocket-Extensions header")}e._extensions[v.extensionName]=y}e.setSocket(s,r,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(g,e):g.end()}function J(e,t){e._readyState=K.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Q(e){return e.path=e.socketPath,d.connect(e)}function ee(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=d.isIP(e.host)?"":e.host),f.connect(e)}function te(e,t,s){e._readyState=K.CLOSING;const r=new Error(s);Error.captureStackTrace(r,te),t.setHeader?(t[z]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(J,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function se(e,t,s){if(t){const s=k(t)?t.size:q(t).length;e._socket?e._sender._bufferedBytes+=s:e._bufferedAmount+=s}if(s){const t=new Error(`WebSocket is not open: readyState ${e.readyState} (${Y[e.readyState]})`);process.nextTick(s,t)}}function re(e,t){const s=this[R];s._closeFrameReceived=!0,s._closeMessage=t,s._closeCode=e,void 0!==s._socket[R]&&(s._socket.removeListener("data",_e),process.nextTick(le,s._socket),1005===e?s.close():s.close(e,t))}function ie(){const e=this[R];e.isPaused||e._socket.resume()}function oe(e){const t=this[R];void 0!==t._socket[R]&&(t._socket.removeListener("data",_e),process.nextTick(le,t._socket),t.close(e[L])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function ne(){this[R].emitClose()}function ae(e,t){this[R].emit("message",e,t)}function he(e){const t=this[R];t._autoPong&&t.pong(e,!this._isServer,I),t.emit("ping",e)}function ce(e){this[R].emit("pong",e)}function le(e){e.resume()}function de(e){const t=this[R];t.readyState!==K.CLOSED&&(t.readyState===K.OPEN&&(t._readyState=K.CLOSING,fe(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function fe(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),3e4)}function ue(){const e=this[R];let t;this.removeListener("close",ue),this.removeListener("data",_e),this.removeListener("end",pe),e._readyState=K.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[R]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",ne),e._receiver.on("finish",ne))}function _e(e){this[R]._receiver.write(e)||this.pause()}function pe(){const e=this[R];e._readyState=K.CLOSING,e._receiver.end(),this.end()}function me(){const e=this[R];this.removeListener("error",me),this.on("error",I),e&&(e._readyState=K.CLOSING,this.destroy())}return Object.defineProperty(K,"CONNECTING",{enumerable:!0,value:Y.indexOf("CONNECTING")}),Object.defineProperty(K.prototype,"CONNECTING",{enumerable:!0,value:Y.indexOf("CONNECTING")}),Object.defineProperty(K,"OPEN",{enumerable:!0,value:Y.indexOf("OPEN")}),Object.defineProperty(K.prototype,"OPEN",{enumerable:!0,value:Y.indexOf("OPEN")}),Object.defineProperty(K,"CLOSING",{enumerable:!0,value:Y.indexOf("CLOSING")}),Object.defineProperty(K.prototype,"CLOSING",{enumerable:!0,value:Y.indexOf("CLOSING")}),Object.defineProperty(K,"CLOSED",{enumerable:!0,value:Y.indexOf("CLOSED")}),Object.defineProperty(K.prototype,"CLOSED",{enumerable:!0,value:Y.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(K.prototype,e,{enumerable:!0})}),["open","error","close","message"].forEach(e=>{Object.defineProperty(K.prototype,`on${e}`,{enumerable:!0,get(){for(const t of this.listeners(e))if(t[C])return t[N];return null},set(t){for(const s of this.listeners(e))if(s[C]){this.removeListener(e,s);break}"function"==typeof t&&this.addEventListener(e,t,{[C]:!0})}})}),K.prototype.addEventListener=M,K.prototype.removeEventListener=W,U=K}!function(){if(W)return M;W=1,V();const{Duplex:e}=n;function t(e){e.emit("close")}function s(){!this.destroyed&&this._writableState.finished&&this.destroy()}function r(e){this.removeListener("error",r),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}M=function(i,o){let n=!0;const a=new e({...o,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(e,t){const s=!t&&a._readableState.objectMode?e.toString():e;a.push(s)||i.pause()}),i.once("error",function(e){a.destroyed||(n=!1,a.destroy(e))}),i.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(e,s){if(i.readyState===i.CLOSED)return s(e),void process.nextTick(t,a);let r=!1;i.once("error",function(e){r=!0,s(e)}),i.once("close",function(){r||s(e),process.nextTick(t,a)}),n&&i.terminate()},a._final=function(e){i.readyState!==i.CONNECTING?null!==i._socket&&(i._socket._writableState.finished?(e(),a._readableState.endEmitted&&a.destroy()):(i._socket.once("finish",function(){e()}),i.close())):i.once("open",function(){a._final(e)})},a._read=function(){i.isPaused&&i.resume()},a._write=function(e,t,s){i.readyState!==i.CONNECTING?i.send(e,s):i.once("open",function(){a._write(e,t,s)})},a.on("end",s),a.on("error",r),a}}(),F(),j();const G=l(V());var q,z,H,Y;!function(){if(Y)return H;Y=1;const t=e,r=s,{Duplex:i}=n,{createHash:a}=o,h=$(),c=w(),l=function(){if(z)return q;z=1;const{tokenChars:e}=A();return q={parse:function(t){const s=new Set;let r=-1,i=-1,o=0;for(;o<t.length;o++){const n=t.charCodeAt(o);if(-1===i&&1===e[n])-1===r&&(r=o);else if(0===o||32!==n&&9!==n){if(44!==n)throw new SyntaxError(`Unexpected character at index ${o}`);{if(-1===r)throw new SyntaxError(`Unexpected character at index ${o}`);-1===i&&(i=o);const e=t.slice(r,i);if(s.has(e))throw new SyntaxError(`The "${e}" subprotocol is duplicated`);s.add(e),r=i=-1}}else-1===i&&-1!==r&&(i=o)}if(-1===r||-1!==i)throw new SyntaxError("Unexpected end of input");const n=t.slice(r,o);if(s.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return s.add(n),s}}}(),d=V(),{GUID:f,kWebSocket:u}=p(),_=/^[+/0-9A-Za-z]{22}==$/;function m(e){e._state=2,e.emit("close")}function y(){this.destroy()}function b(e,t,s,i){s=s||r.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(s),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${r.STATUS_CODES[t]}\r\n`+Object.keys(i).map(e=>`${e}: ${i[e]}`).join("\r\n")+"\r\n\r\n"+s)}function v(e,t,s,r,i,o){if(e.listenerCount("wsClientError")){const r=new Error(i);Error.captureStackTrace(r,v),e.emit("wsClientError",r,s,t)}else b(s,r,i,o)}H=class extends t{constructor(e,t){if(super(),null==(e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:d,...e}).port&&!e.server&&!e.noServer||null!=e.port&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=e.port?(this._server=r.createServer((e,t)=>{const s=r.STATUS_CODES[426];t.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),t.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){const e=this.emit.bind(this,"connection");this._removeListeners=function(e,t){for(const s of Object.keys(t))e.on(s,t[s]);return function(){for(const s of Object.keys(t))e.removeListener(s,t[s])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,s,r)=>{this.handleUpgrade(t,s,r,e)}})}!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(2===this._state)return e&&this.once("close",()=>{e(new Error("The server is not running"))}),void process.nextTick(m,this);if(e&&this.once("close",e),1!==this._state)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(m,this);else{const e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close(()=>{m(this)})}}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,s,r){t.on("error",y);const i=e.headers["sec-websocket-key"],o=e.headers.upgrade,n=+e.headers["sec-websocket-version"];if("GET"!==e.method){return void v(this,e,t,405,"Invalid HTTP method")}if(void 0===o||"websocket"!==o.toLowerCase()){return void v(this,e,t,400,"Invalid Upgrade header")}if(void 0===i||!_.test(i)){return void v(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header")}if(13!==n&&8!==n){return void v(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"})}if(!this.shouldHandle(e))return void b(t,400);const a=e.headers["sec-websocket-protocol"];let d=new Set;if(void 0!==a)try{d=l.parse(a)}catch(p){return void v(this,e,t,400,"Invalid Sec-WebSocket-Protocol header")}const f=e.headers["sec-websocket-extensions"],u={};if(this.options.perMessageDeflate&&void 0!==f){const s=new c(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const e=h.parse(f);e[c.extensionName]&&(s.accept(e[c.extensionName]),u[c.extensionName]=s)}catch(p){return void v(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header")}}if(this.options.verifyClient){const o={origin:e.headers[""+(8===n?"sec-websocket-origin":"origin")],secure:!(!e.socket.authorized&&!e.socket.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(o,(o,n,a,h)=>{if(!o)return b(t,n||401,a,h);this.completeUpgrade(u,i,d,e,t,s,r)});if(!this.options.verifyClient(o))return b(t,401)}this.completeUpgrade(u,i,d,e,t,s,r)}completeUpgrade(e,t,s,r,i,o,n){if(!i.readable||!i.writable)return i.destroy();if(i[u])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return b(i,503);const l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${a("sha1").update(t+f).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(s.size){const e=this.options.handleProtocols?this.options.handleProtocols(s,r):s.values().next().value;e&&(l.push(`Sec-WebSocket-Protocol: ${e}`),d._protocol=e)}if(e[c.extensionName]){const t=e[c.extensionName].params,s=h.format({[c.extensionName]:[t]});l.push(`Sec-WebSocket-Extensions: ${s}`),d._extensions=e}this.emit("headers",l,r),i.write(l.concat("\r\n").join("\r\n")),i.removeListener("error",y),d.setSocket(i,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(m,this)})),n(d,r)}}}();const X=global;X.WebSocket||=G,X.window||=global,X.self||=global,X.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__=[{type:1,value:7,isEnabled:!0},{type:2,value:"InternalApp",isEnabled:!0,isValid:!0},{type:2,value:"InternalAppContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdoutContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStderrContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdinContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalFocusContext",isEnabled:!0,isValid:!0}];throw new Error('Could not resolve "react-devtools-core" imported by "ink".');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./_commonjsHelpers-C1uRMj_j.js";import t from"events";import o from"fs";import n from"path";import r from"net";import i from"child_process";import s from"worker_threads";import c from"tty";function a(e,t){for(var o=0;o<t.length;o++){const n=t[o];if("string"!=typeof n&&!Array.isArray(n))for(const t in n)if("default"!==t&&!(t in e)){const o=Object.getOwnPropertyDescriptor(n,t);o&&Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var u,l,p={},f={},d={},_={};function h(){if(u)return _;u=1,Object.defineProperty(_,"__esModule",{value:!0});var e=function(){function e(){this._listeners=[]}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){for(var o=0;o<e._listeners.length;o++)if(e._listeners[o]===t)return void e._listeners.splice(o,1)}}}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){for(var t=[],o=0;o<this._listeners.length;o++)t.push(this._listeners[o]);for(o=0;o<t.length;o++)t[o].call(void 0,e)},e}();return _.EventEmitter2=e,_}function y(){if(l)return d;l=1,Object.defineProperty(d,"__esModule",{value:!0});var e=t,o=h();d.DEFAULT_COLS=80,d.DEFAULT_ROWS=24;var n=function(){function t(t){this._pid=0,this._fd=0,this._cols=0,this._rows=0,this._readable=!1,this._writable=!1,this._onData=new o.EventEmitter2,this._onExit=new o.EventEmitter2,this._internalee=new e.EventEmitter,this.handleFlowControl=!!(null==t?void 0:t.handleFlowControl),this._flowControlPause=(null==t?void 0:t.flowControlPause)||"",this._flowControlResume=(null==t?void 0:t.flowControlResume)||"",t&&(this._checkType("name",t.name?t.name:void 0,"string"),this._checkType("cols",t.cols?t.cols:void 0,"number"),this._checkType("rows",t.rows?t.rows:void 0,"number"),this._checkType("cwd",t.cwd?t.cwd:void 0,"string"),this._checkType("env",t.env?t.env:void 0,"object"),this._checkType("uid",t.uid?t.uid:void 0,"number"),this._checkType("gid",t.gid?t.gid:void 0,"number"),this._checkType("encoding",t.encoding?t.encoding:void 0,"string"))}return Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onExit",{get:function(){return this._onExit.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pid",{get:function(){return this._pid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._cols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._rows},enumerable:!0,configurable:!0}),t.prototype.write=function(e){if(this.handleFlowControl){if(e===this._flowControlPause)return void this.pause();if(e===this._flowControlResume)return void this.resume()}this._write(e)},t.prototype._forwardEvents=function(){var e=this;this.on("data",function(t){return e._onData.fire(t)}),this.on("exit",function(t,o){return e._onExit.fire({exitCode:t,signal:o})})},t.prototype._checkType=function(e,t,o,n){if(void 0===n&&(n=!1),void 0!==t)if(n&&Array.isArray(t))t.forEach(function(t,n){if(typeof t!==o)throw new Error(e+"["+n+"] must be a "+o+" (not a "+typeof t[n]+")")});else if(typeof t!==o)throw new Error(e+" must be a "+o+" (not a "+typeof t+")")},t.prototype.end=function(e){this._socket.end(e)},t.prototype.pipe=function(e,t){return this._socket.pipe(e,t)},t.prototype.pause=function(){return this._socket.pause()},t.prototype.resume=function(){return this._socket.resume()},t.prototype.setEncoding=function(e){this._socket._decoder&&delete this._socket._decoder,e&&this._socket.setEncoding(e)},t.prototype.addListener=function(e,t){this.on(e,t)},t.prototype.on=function(e,t){"close"!==e?this._socket.on(e,t):this._internalee.on("close",t)},t.prototype.emit=function(e){return"close"===e?this._internalee.emit.apply(this._internalee,arguments):this._socket.emit.apply(this._socket,arguments)},t.prototype.listeners=function(e){return this._socket.listeners(e)},t.prototype.removeListener=function(e,t){this._socket.removeListener(e,t)},t.prototype.removeAllListeners=function(e){this._socket.removeAllListeners(e)},t.prototype.once=function(e,t){this._socket.once(e,t)},t.prototype._close=function(){this._socket.readable=!1,this.write=function(){},this.end=function(){},this._writable=!1,this._readable=!1},t.prototype._parseEnv=function(e){for(var t=Object.keys(e||{}),o=[],n=0;n<t.length;n++)void 0!==t[n]&&o.push(t[n]+"="+e[t[n]]);return o},t}();return d.Terminal=n,d}var m,v,g={},w={},b={};function k(){if(v)return w;v=1;var e=w&&w.__awaiter||function(e,t,o,n){return new(o||(o=Promise))(function(r,i){function s(e){try{a(n.next(e))}catch(t){i(t)}}function c(e){try{a(n.throw(e))}catch(t){i(t)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(s,c)}a((n=n.apply(e,t||[])).next())})},t=w&&w.__generator||function(e,t){var o,n,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(c){i=[6,c],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(w,"__esModule",{value:!0});var o=s,r=(m||(m=1,Object.defineProperty(b,"__esModule",{value:!0}),b.getWorkerPipeName=function(e){return e+"-worker"}),b),i=n,c=h(),a=function(){function n(e){var t=this;this._conoutPipeName=e,this._isDisposed=!1,this._onReady=new c.EventEmitter2;var n={conoutPipeName:e},r=__dirname.replace("node_modules.asar","node_modules.asar.unpacked");this._worker=new o.Worker(i.join(r,"worker/conoutSocketWorker.js"),{workerData:n}),this._worker.on("message",function(e){1!==e?console.warn("Unexpected ConoutWorkerMessage",e):t._onReady.fire()})}return Object.defineProperty(n.prototype,"onReady",{get:function(){return this._onReady.event},enumerable:!0,configurable:!0}),n.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._drainDataAndClose())},n.prototype.connectSocket=function(e){e.connect(r.getWorkerPipeName(this._conoutPipeName))},n.prototype._drainDataAndClose=function(){var e=this;this._drainTimeout&&clearTimeout(this._drainTimeout),this._drainTimeout=setTimeout(function(){return e._destroySocket()},1e3)},n.prototype._destroySocket=function(){return e(this,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,this._worker.terminate()];case 1:return e.sent(),[2]}})})},n}();return w.ConoutConnection=a,w}var P={};const O={"@lydell/node-pty-darwin-x64":"1.1.0","@lydell/node-pty-darwin-arm64":"1.1.0","@lydell/node-pty-linux-x64":"1.1.0","@lydell/node-pty-linux-arm64":"1.1.0","@lydell/node-pty-win32-x64":"1.1.0","@lydell/node-pty-win32-arm64":"1.1.0"};var E,T;function S(){if(E)return P;E=1,Object.defineProperty(P,"__esModule",{value:!0});var e="@lydell/node-pty-"+process.platform+"-"+process.arch,t='\nThis can happen if you use the "--omit=optional" (or "--no-optional") npm flag.\nThe "optionalDependencies" package.json feature is used to install the correct\nbinary executable for your current platform. Remove that flag to use @lydell/node-pty.\n\nThis can also happen if the "node_modules" folder was copied between two operating systems\nthat need different binaries - including "virtual" operating systems like Docker and WSL.\nIf so, try installing with npm rather than copying "node_modules".\n'.trim();return P.requireBinary=function(o){try{return function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(e+"/"+o)}catch(r){if(r&&"MODULE_NOT_FOUND"===r.code){var n=function(){try{return O}catch(e){return}}();throw new Error(void 0===n?"The @lydell/node-pty package could not find the binary package: "+e+"/"+o+"\n\n"+t+"\n\nYour platform ("+process.platform+"-"+process.arch+") might not be supported.":e in n?"The @lydell/node-pty package supports your platform ("+process.platform+"-"+process.arch+"), but it could not find the binary package for it: "+e+"/"+o+"\n\n"+t:"The @lydell/node-pty package currently does not support your platform: "+process.platform+"-"+process.arch,{cause:r})}throw r}},P}var j,C,x={};function N(){if(j)return x;return j=1,Object.defineProperty(x,"__esModule",{value:!0}),x.assign=function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return t.forEach(function(t){return Object.keys(t).forEach(function(o){return e[o]=t[o]})}),e},x}function A(){if(C)return f;C=1;var e=f&&f.__extends||function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(f,"__esModule",{value:!0});var t=y(),s=function(){if(T)return g;T=1,Object.defineProperty(g,"__esModule",{value:!0});var e,t=o,s=n,c=r,a=i,u=k(),l=S(),p=function(){function o(o,n,r,i,a,p,d,_){var h=this;void 0===_&&(_=!1),this._pid=0,this._innerPid=0,e||(e=l.requireBinary("conpty.node")),this._ptyNative=e,i=s.resolve(i);var y=f(o,n),m=this._ptyNative.startProcess(o,a,p,d,this._generatePipeName(),_);this._fd=m.fd,this._pty=m.pty,this._outSocket=new c.Socket,this._outSocket.setEncoding("utf8"),this._conoutSocketWorker=new u.ConoutConnection(m.conout),this._conoutSocketWorker.onReady(function(){h._conoutSocketWorker.connectSocket(h._outSocket)}),this._outSocket.on("connect",function(){h._outSocket.emit("ready_datapipe")});var v=t.openSync(m.conin,"w");this._inSocket=new c.Socket({fd:v,readable:!1,writable:!0}),this._inSocket.setEncoding("utf8");var g=this._ptyNative.connect(this._pty,y,i,r,function(e){return h._$onProcessExit(e)});this._innerPid=g.pid}return Object.defineProperty(o.prototype,"inSocket",{get:function(){return this._inSocket},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"outSocket",{get:function(){return this._outSocket},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"fd",{get:function(){return this._fd},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"innerPid",{get:function(){return this._innerPid},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"pty",{get:function(){return this._pty},enumerable:!0,configurable:!0}),o.prototype.resize=function(e,t){if(void 0!==this._exitCode)throw new Error("Cannot resize a pty that has already exited");this._ptyNative.resize(this._pty,e,t)},o.prototype.clear=function(){this._ptyNative.clear(this._pty)},o.prototype.kill=function(){var e=this;this._inSocket.readable=!1,this._outSocket.readable=!1,this._getConsoleProcessList().then(function(t){t.forEach(function(e){try{process.kill(e)}catch(t){}}),e._ptyNative.kill(e._pty)}),this._conoutSocketWorker.dispose()},o.prototype._getConsoleProcessList=function(){var e=this;return new Promise(function(t){var o=a.fork(s.join(__dirname,"conpty_console_list_agent"),[e._innerPid.toString()]);o.on("message",function(e){clearTimeout(n),t(e.consoleProcessList)});var n=setTimeout(function(){o.kill(),t([e._innerPid])},5e3)})},Object.defineProperty(o.prototype,"exitCode",{get:function(){return this._exitCode},enumerable:!0,configurable:!0}),o.prototype._generatePipeName=function(){return"conpty-"+1e7*Math.random()},o.prototype._$onProcessExit=function(e){var t=this;this._exitCode=e,this._flushDataAndCleanUp(),this._outSocket.on("data",function(){return t._flushDataAndCleanUp()})},o.prototype._flushDataAndCleanUp=function(){var e=this;this._closeTimeout&&clearTimeout(this._closeTimeout),this._closeTimeout=setTimeout(function(){return e._cleanUpProcess()},1e3)},o.prototype._cleanUpProcess=function(){this._inSocket.readable=!1,this._outSocket.readable=!1,this._outSocket.destroy()},o}();function f(e,t){if(function(e){return"string"==typeof e}(t))return 0===t.length?e:f(e,[])+" "+t;var o=[e];Array.prototype.push.apply(o,t);for(var n="",r=0;r<o.length;r++){r>0&&(n+=" ");var i=o[r],s=_('"'!==i[0],'"'!==i[i.length-1]),c='"'!==i[0]&&'"'!==i[i.length-1],a=""===i||(-1!==i.indexOf(" ")||-1!==i.indexOf("\t"))&&i.length>1&&(s||c);a&&(n+='"');for(var u=0,l=0;l<i.length;l++){var p=i[l];"\\"===p?u++:'"'===p?(n+=d("\\",2*u+1),n+='"',u=0):(n+=d("\\",u),u=0,n+=p)}a?(n+=d("\\",2*u),n+='"'):n+=d("\\",u)}return n}function d(e,t){for(var o="",n=0;n<t;n++)o+=e;return o}function _(e,t){return e&&!t||!e&&t}return g.WindowsPtyAgent=p,g.argsToCommandLine=f,g}(),c=N(),a=function(o){function n(e,n,r){var i=o.call(this,r)||this;i._checkType("args",n,"string",!0),n=n||[],e=e||"cmd.exe",(r=r||{}).env=r.env||process.env,r.encoding&&console.warn("Setting encoding on Windows is not supported");var a=c.assign({},r.env);i._cols=r.cols||t.DEFAULT_COLS,i._rows=r.rows||t.DEFAULT_ROWS;var u=r.cwd||process.cwd(),l=r.name||a.TERM||"Windows Shell",p=i._parseEnv(a);return i._isReady=!1,i._deferreds=[],i._agent=new s.WindowsPtyAgent(e,n,p,u,i._cols,i._rows,!1,r.conptyInheritCursor),i._socket=i._agent.outSocket,i._pid=i._agent.innerPid,i._fd=i._agent.fd,i._pty=i._agent.pty,i._socket.on("ready_datapipe",function(){["connect","data","end","timeout","drain"].forEach(function(e){i._socket.on(e,function(){i._isReady||"data"!==e||(i._isReady=!0,i._deferreds.forEach(function(e){e.run()}),i._deferreds=[])})}),i._socket.on("error",function(e){if(i._close(),(!e.code||!~e.code.indexOf("errno 5")&&!~e.code.indexOf("EIO"))&&i.listeners("error").length<2)throw e}),i._socket.on("close",function(){i.emit("exit",i._agent.exitCode),i._close()})}),i._file=e,i._name=l,i._readable=!0,i._writable=!0,i._forwardEvents(),i}return e(n,o),n.prototype._write=function(e){this._defer(this._doWrite,e)},n.prototype._doWrite=function(e){this._agent.inSocket.write(e)},n.open=function(e){throw new Error("open() not supported on windows, use Fork() instead.")},n.prototype.resize=function(e,t){var o=this;if(e<=0||t<=0||isNaN(e)||isNaN(t)||e===1/0||t===1/0)throw new Error("resizing must be done using positive cols and rows");this._deferNoArgs(function(){o._agent.resize(e,t),o._cols=e,o._rows=t})},n.prototype.clear=function(){var e=this;this._deferNoArgs(function(){e._agent.clear()})},n.prototype.destroy=function(){var e=this;this._deferNoArgs(function(){e.kill()})},n.prototype.kill=function(e){var t=this;this._deferNoArgs(function(){if(e)throw new Error("Signals not supported on windows.");t._close(),t._agent.kill()})},n.prototype._deferNoArgs=function(e){var t=this;this._isReady?e.call(this):this._deferreds.push({run:function(){return e.call(t)}})},n.prototype._defer=function(e,t){var o=this;this._isReady?e.call(this,t):this._deferreds.push({run:function(){return e.call(o,t)}})},Object.defineProperty(n.prototype,"process",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"master",{get:function(){throw new Error("master is not supported on Windows")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"slave",{get:function(){throw new Error("slave is not supported on Windows")},enumerable:!0,configurable:!0}),n}(t.Terminal);return f.WindowsTerminal=a,f}var D,W,R={};var L,U=(W||(W=1,Object.defineProperty(p,"__esModule",{value:!0}),L="win32"===process.platform?A().WindowsTerminal:function(){if(D)return R;D=1;var e=R&&R.__extends||function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(R,"__esModule",{value:!0});var t=c,o=y(),n=N(),r=S().requireBinary("pty.node"),i="@lydell/node-pty-"+process.platform+"-"+process.arch+"/spawn-helper";i=(i=(i="darwin"===process.platform?require.resolve(i):"spawn-helper-unused").replace("app.asar","app.asar.unpacked")).replace("node_modules.asar","node_modules.asar.unpacked");var s=function(s){function c(e,c,a){var u,l,p=s.call(this,a)||this;if(p._boundClose=!1,p._emittedClose=!1,"string"==typeof c)throw new Error("args as a string is not supported on unix.");c=c||[],e=e||"sh",(a=a||{}).env=a.env||process.env,p._cols=a.cols||o.DEFAULT_COLS,p._rows=a.rows||o.DEFAULT_ROWS;var f=null!==(u=a.uid)&&void 0!==u?u:-1,d=null!==(l=a.gid)&&void 0!==l?l:-1,_=n.assign({},a.env);a.env===process.env&&p._sanitizeEnv(_);var h=a.cwd||process.cwd();_.PWD=h;var y=a.name||_.TERM||"xterm";_.TERM=y;var m=p._parseEnv(_),v=void 0===a.encoding?"utf8":a.encoding,g=r.fork(e,c,m,h,p._cols,p._rows,f,d,"utf8"===v,i,function(e,t){if(p._emittedClose)p.emit("exit",e,t);else{if(p._boundClose)return;p._boundClose=!0;var o=setTimeout(function(){o=null,p._socket.destroy()},200);p.once("close",function(){null!==o&&clearTimeout(o),p.emit("exit",e,t)})}});return p._socket=new t.ReadStream(g.fd),null!==v&&p._socket.setEncoding(v),p._socket.on("error",function(e){if(!(e.code&&~e.code.indexOf("EAGAIN")||(p._close(),p._emittedClose||(p._emittedClose=!0,p.emit("close")),e.code&&(~e.code.indexOf("errno 5")||~e.code.indexOf("EIO"))||!(p.listeners("error").length<2))))throw e}),p._pid=g.pid,p._fd=g.fd,p._pty=g.pty,p._file=e,p._name=y,p._readable=!0,p._writable=!0,p._socket.on("close",function(){p._emittedClose||(p._emittedClose=!0,p._close(),p.emit("close"))}),p._forwardEvents(),p}return e(c,s),Object.defineProperty(c.prototype,"master",{get:function(){return this._master},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"slave",{get:function(){return this._slave},enumerable:!0,configurable:!0}),c.prototype._write=function(e){this._socket.write(e)},Object.defineProperty(c.prototype,"fd",{get:function(){return this._fd},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"ptsName",{get:function(){return this._pty},enumerable:!0,configurable:!0}),c.open=function(e){var n=Object.create(c.prototype);e=e||{},arguments.length>1&&(e={cols:arguments[1],rows:arguments[2]});var i=e.cols||o.DEFAULT_COLS,s=e.rows||o.DEFAULT_ROWS,a=void 0===e.encoding?"utf8":e.encoding,u=r.open(i,s);return n._master=new t.ReadStream(u.master),null!==a&&n._master.setEncoding(a),n._master.resume(),n._slave=new t.ReadStream(u.slave),null!==a&&n._slave.setEncoding(a),n._slave.resume(),n._socket=n._master,n._pid=-1,n._fd=u.master,n._pty=u.pty,n._file=process.argv[0]||"node",n._name=process.env.TERM||"",n._readable=!0,n._writable=!0,n._socket.on("error",function(e){if(n._close(),n.listeners("error").length<2)throw e}),n._socket.on("close",function(){n._close()}),n},c.prototype.destroy=function(){var e=this;this._close(),this._socket.once("close",function(){e.kill("SIGHUP")}),this._socket.destroy()},c.prototype.kill=function(e){try{process.kill(this.pid,e||"SIGHUP")}catch(t){}},Object.defineProperty(c.prototype,"process",{get:function(){if("darwin"===process.platform){var e=r.process(this._fd);return"kernel_task"!==e?e:this._file}return r.process(this._fd,this._pty)||this._file},enumerable:!0,configurable:!0}),c.prototype.resize=function(e,t){if(e<=0||t<=0||isNaN(e)||isNaN(t)||e===1/0||t===1/0)throw new Error("resizing must be done using positive cols and rows");r.resize(this._fd,e,t),this._cols=e,this._rows=t},c.prototype.clear=function(){},c.prototype._sanitizeEnv=function(e){delete e.TMUX,delete e.TMUX_PANE,delete e.STY,delete e.WINDOW,delete e.WINDOWID,delete e.TERMCAP,delete e.COLUMNS,delete e.LINES},c}(o.Terminal);return R.UnixTerminal=s,R}().UnixTerminal,p.spawn=function(e,t,o){return new L(e,t,o)},p.fork=function(e,t,o){return new L(e,t,o)},p.createTerminal=function(e,t,o){return new L(e,t,o)},p.open=function(e){return L.open(e)}),p);const M=a({__proto__:null,default:e(U)},[U]);export{M as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,t}from"./cli-DIXdkQBM.js";import{b as n,c as r,d as s,a as i,f as o,l,s as u}from"./cli-DIXdkQBM.js";import"./_commonjsHelpers-C1uRMj_j.js";import"assert";import"events";import"node:process";import"node:events";import"node:fs";import"module";import"node:os";import"node:tty";import"node:buffer";import"node:util";import"node:path";import"os";import"crypto";import"node:crypto";import"fs";import"path";import"http";import"node:url";import"node:child_process";import"node:fs/promises";import"url";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";import"util";import"perf_hooks";import"tty";import"worker_threads";import"node:diagnostics_channel";import"diagnostics_channel";import"node:net";import"async_hooks";import"node:readline";import"node:worker_threads";import"node:http";import"node:https";import"node:zlib";import"node:tls";const a=new class extends e{};function c(e,t,n){return a.diff(e,t,n)}function f(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function h(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function p(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function d(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function g(e,t){return p(e,t,"")}function m(e,t){return d(e,t,"")}function v(e,t){return t.slice(0,function(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);const s=Array(r);let i=0;s[0]=0;for(let o=1;o<r;o++){for(t[o]==t[i]?s[o]=s[i]:s[o]=i;i>0&&t[o]!=t[i];)i=s[i];t[o]==t[i]&&i++}i=0;for(let o=n;o<e.length;o++){for(;i>0&&e[o]!=t[i];)i=s[i];e[o]==t[i]&&i++}return i}(e,t))}function w(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function y(e){const t=e.match(/^\s*/);return t?t[0]:""}const k="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",L=new RegExp(`[${k}]+|\\s+|[^${k}]`,"ug");const b=new class extends e{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){const r=t.intlSegmenter;if("word"!=r.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(r.segment(e),e=>e.segment)}else n=e.match(L)||[];const r=[];let s=null;return n.forEach(e=>{/\s/.test(e)?null==s?r.push(e):r.push(r.pop()+e):null!=s&&/\s/.test(s)?r[r.length-1]==s?r.push(r.pop()+e):r.push(s+e):r.push(e),s=e}),r}join(e){return e.map((e,t)=>0==t?e:e.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,s=null;return e.forEach(e=>{e.added?r=e:e.removed?s=e:((r||s)&&S(n,s,r,e),n=e,r=null,s=null)}),(r||s)&&S(n,s,r,null),e}};function j(e,t,n){return null==(null==n?void 0:n.ignoreWhitespace)||n.ignoreWhitespace?b.diff(e,t,n):E(e,t,n)}function S(e,t,n,r){if(t&&n){const s=y(t.value),i=w(t.value),o=y(n.value),l=w(n.value);if(e){const r=f(s,o);e.value=d(e.value,o,r),t.value=g(t.value,r),n.value=g(n.value,r)}if(r){const e=h(i,l);r.value=p(r.value,l,e),t.value=m(t.value,e),n.value=m(n.value,e)}}else if(n){if(e){const e=y(n.value);n.value=n.value.substring(e.length)}if(r){const e=y(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){const n=y(r.value),s=y(t.value),i=w(t.value),o=f(n,s);t.value=g(t.value,o);const l=h(g(n,o),i);t.value=m(t.value,l),r.value=p(r.value,n,l),e.value=d(e.value,n,n.slice(0,n.length-l.length))}else if(r){const e=y(r.value),n=v(w(t.value),e);t.value=m(t.value,n)}else if(e){const n=v(w(e.value),y(t.value));t.value=g(t.value,n)}}const O=new class extends e{tokenize(e){const t=new RegExp(`(\\r?\\n)|[${k}]+|[^\\S\\n\\r]+|[^${k}]`,"ug");return e.match(t)||[]}};function E(e,t,n){return O.diff(e,t,n)}function A(e){return"."==e||"!"==e||"?"==e}const F=new class extends e{tokenize(e){var t;const n=[];let r=0;for(let s=0;s<e.length;s++){if(s==e.length-1){n.push(e.slice(r));break}if(A(e[s])&&e[s+1].match(/\s/)){for(n.push(e.slice(r,s+1)),s=r=s+1;null===(t=e[s+1])||void 0===t?void 0:t.match(/\s/);)s++;n.push(e.slice(r,s+1)),r=s+1}}return n}};function x(e,t,n){return F.diff(e,t,n)}const $=new class extends e{tokenize(e){return e.split(/([{}:;,]|\s+)/)}};function W(e,t,n){return $.diff(e,t,n)}const N=new class extends e{constructor(){super(...arguments),this.tokenize=t}get useLongestToken(){return!0}castInput(e,t){const{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>void 0===t?n:t}=t;return"string"==typeof e?e:JSON.stringify(_(e,null,null,r),null," ")}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),n)}};function z(e,t,n){return N.diff(e,t,n)}function _(e,t,n,r,s){let i,o;for(t=t||[],n=n||[],r&&(e=r(void 0===s?"":s,e)),i=0;i<t.length;i+=1)if(t[i]===e)return n[i];if("[object Array]"===Object.prototype.toString.call(e)){for(t.push(e),o=new Array(e.length),n.push(o),i=0;i<e.length;i+=1)o[i]=_(e[i],t,n,r,String(i));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"==typeof e&&null!==e){t.push(e),o={},n.push(o);const s=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&s.push(l);for(s.sort(),i=0;i<s.length;i+=1)l=s[i],o[l]=_(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}const C=new class extends e{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function H(e,t,n){return C.diff(e,t,n)}function J(e){return Array.isArray(e)?e.map(e=>J(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function P(e){return Array.isArray(e)?e.map(e=>P(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function I(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else{if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,l=0;for(;r<t.length&&(l<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?l++:" "===e&&(o++,l++)}if(o||1!==i.newLines||(i.newLines=0),l||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(l!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function D(e,t,n){let r=!0,s=!1,i=!1,o=1;return function l(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,l())}}function R(e,t,n={}){let r;if(r="string"==typeof t?I(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&((r=e).includes("\r\n")&&!r.startsWith("\n")&&!r.match(/[^\r]\n/)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=J(t):function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=P(t)));var r;const s=e.split("\n"),i=t.hunks,o=n.compareLine||((e,t,n,r)=>t===r),l=n.fuzzFactor||0;let u=0;if(l<0||!Number.isInteger(l))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return e;let a="",c=!1,f=!1;for(let g=0;g<i[i.length-1].lines.length;g++){const e=i[i.length-1].lines[g];"\\"==e[0]&&("+"==a[0]?c=!0:"-"==a[0]&&(f=!0)),a=e}if(c){if(f){if(!l&&""==s[s.length-1])return!1}else if(""==s[s.length-1])s.pop();else if(!l)return!1}else if(f)if(""!=s[s.length-1])s.push("");else if(!l)return!1;function h(e,t,n,r=0,i=!0,l=[],u=0){let a=0,c=!1;for(;r<e.length;r++){const f=e[r],p=f.length>0?f[0]:" ",d=f.length>0?f.substr(1):f;if("-"===p){if(!o(t+1,s[t],p,d))return n&&null!=s[t]?(l[u]=s[t],h(e,t+1,n-1,r,!1,l,u+1)):null;t++,a=0}if("+"===p){if(!i)return null;l[u]=d,u++,a=0,c=!0}if(" "===p){if(a++,l[u]=s[t],!o(t+1,s[t],p,d))return c||!n?null:s[t]&&(h(e,t+1,n-1,r+1,!1,l,u+1)||h(e,t+1,n-1,r,!1,l,u+1))||h(e,t,n-1,r+1,!1,l,u);u++,i=!0,c=!1,t++}}return u-=a,t-=a,l.length=u,{patchedLines:l,oldLineLastI:t-1}}const p=[];let d=0;for(let g=0;g<i.length;g++){const e=i[g];let t;const n=s.length-e.oldLines+l;let r;for(let s=0;s<=l;s++){r=e.oldStart+d-1;const i=D(r,u,n);for(;void 0!==r&&(t=h(e.lines,r,s),!t);r=i());if(t)break}if(!t)return!1;for(let i=u;i<r;i++)p.push(s[i]);for(let s=0;s<t.patchedLines.length;s++){const e=t.patchedLines[s];p.push(e)}u=t.oldLineLastI+1,d=r+1-e.oldStart}for(let g=u;g<s.length;g++)p.push(s[g]);return p.join("\n")}(e,r[0],n)}function T(e,t){const n="string"==typeof e?I(e):e;let r=0;!function e(){const s=n[r++];if(!s)return t.complete();t.loadFile(s,function(n,r){if(n)return t.complete(n);const i=R(r,s,t);t.patched(s,i,function(n){if(n)return t.complete(n);e()})})}()}function q(e){return Array.isArray(e)?e.map(e=>q(e)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(e=>e.startsWith("-")?`+${e.slice(1)}`:e.startsWith("+")?`-${e.slice(1)}`:e)}))})}function U(e){const t=[];let n,r;for(let s=0;s<e.length;s++)n=e[s],r=n.added?1:n.removed?-1:0,t.push([r,n.value]);return t}function Z(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(B(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function B(e){let t=e;return t=t.replace(/&/g,"&"),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t=t.replace(/"/g,"""),t}export{e as Diff,R as applyPatch,T as applyPatches,C as arrayDiff,_ as canonicalize,a as characterDiff,U as convertChangesToDMP,Z as convertChangesToXML,n as createPatch,r as createTwoFilesPatch,$ as cssDiff,H as diffArrays,c as diffChars,W as diffCss,z as diffJson,s as diffLines,x as diffSentences,i as diffTrimmedLines,j as diffWords,E as diffWordsWithSpace,o as formatPatch,N as jsonDiff,l as lineDiff,I as parsePatch,q as reversePatch,F as sentenceDiff,u as structuredPatch,b as wordDiff,O as wordsWithSpaceDiff};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"stream";import{r as t,e as n}from"./cli-DIXdkQBM.js";import r from"tty";import s from"util";function o(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var i,a,c,p={},d={exports:{}},l={exports:{}};function u(){if(a)return i;return a=1,i=function(e){function n(e){let t,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(t||s);r.diff=o,r.prev=t,r.curr=s,t=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,s)=>{if("%%"===t)return"%";i++;const o=n.formatters[s];if("function"==typeof o){const n=e[i];t=o.call(r,n),e.splice(i,1),i--}return t}),n.formatArgs.call(r,e);(r.log||n.log).apply(r,e)}return a.namespace=e,a.useColors=n.useColors(),a.color=n.selectColor(e),a.extend=r,a.destroy=n.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==n.namespaces&&(s=n.namespaces,o=n.enabled(e)),o),set:e=>{i=e}}),"function"==typeof n.init&&n.init(a),a}function r(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(s=r,o=n,r++):(n++,r++);else{if(-1===s)return!1;r=s+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names,...n.skips.map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const r of t)"-"===r[0]?n.skips.push(r.slice(1)):n.names.push(r)},n.enabled=function(e){for(const t of n.skips)if(s(e,t))return!1;for(const t of n.names)if(s(e,t))return!0;return!1},n.humanize=t(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n}}var h,f,g,C={exports:{}};function b(){return h||(h=1,function(e,t){const o=r,i=s;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(i.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:s}=this;if(s){const t=this.color,s="[3"+(t<8?t:"8;5;"+t),o=` ${s};1m${r} [0m`;n[0]=o+n[0].split("\n").join("\n"+o),n.push(s+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):o.isatty(process.stderr.fd)},t.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(c){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=u()(t);const{formatters:a}=e.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(C,C.exports)),C.exports}function m(){return f||(f=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?d.exports=(c||(c=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(n){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=u()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(l,l.exports)),l.exports):d.exports=b()),d.exports}const F=o({__proto__:null},[function(){if(g)return p;g=1;var t=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.SerialPortStream=p.DisconnectedError=void 0;const n=e,r=(0,t(m()).default)("serialport/stream");class s extends Error{disconnected;constructor(e){super(e),this.disconnected=!0}}p.DisconnectedError=s;const o={brk:!1,cts:!1,dtr:!0,rts:!0};function i(e){const t=Buffer.allocUnsafe(e);return t.used=0,t}class a extends n.Duplex{port;_pool;_kMinPoolSpace;opening;closing;settings;constructor(e,t){const n={autoOpen:!0,endOnClose:!1,highWaterMark:65536,...e};if(super({highWaterMark:n.highWaterMark}),!n.binding)throw new TypeError('"Bindings" is invalid pass it as `options.binding`');if(!n.path)throw new TypeError(`"path" is not defined: ${n.path}`);if("number"!=typeof n.baudRate)throw new TypeError(`"baudRate" must be a number: ${n.baudRate}`);this.settings=n,this.opening=!1,this.closing=!1,this._pool=i(this.settings.highWaterMark),this._kMinPoolSpace=128,this.settings.autoOpen&&this.open(t)}get path(){return this.settings.path}get baudRate(){return this.settings.baudRate}get isOpen(){return(this.port?.isOpen??!1)&&!this.closing}_error(e,t){t?t.call(this,e):this.emit("error",e)}_asyncError(e,t){process.nextTick(()=>this._error(e,t))}open(e){if(this.isOpen)return this._asyncError(new Error("Port is already open"),e);if(this.opening)return this._asyncError(new Error("Port is opening"),e);const{highWaterMark:t,binding:n,autoOpen:s,endOnClose:o,...i}=this.settings;this.opening=!0,r("opening",`path: ${this.path}`),this.settings.binding.open(i).then(t=>{r("opened",`path: ${this.path}`),this.port=t,this.opening=!1,this.emit("open"),e&&e.call(this,null)},t=>{this.opening=!1,r("Binding #open had an error",t),this._error(t,e)})}update(e,t){if(!this.isOpen||!this.port)return r("update attempted, but port is not open"),this._asyncError(new Error("Port is not open"),t);r("update",`baudRate: ${e.baudRate}`),this.port.update(e).then(()=>{r("binding.update","finished"),this.settings.baudRate=e.baudRate,t&&t.call(this,null)},e=>(r("binding.update","error",e),this._error(e,t)))}write(e,t,n){return Array.isArray(e)&&(e=Buffer.from(e)),"function"==typeof t?super.write(e,t):super.write(e,t,n)}_write(e,t,n){this.isOpen&&this.port?(r("_write",`${e.length} bytes of data`),this.port.write(e).then(()=>{r("binding.write","write finished"),n(null)},e=>{r("binding.write","error",e),e.canceled||this._disconnected(e),n(e)})):this.once("open",()=>{this._write(e,t,n)})}_writev(e,t){r("_writev",`${e.length} chunks of data`);const n=e.map(e=>e.chunk);this._write(Buffer.concat(n),"binary",t)}_read(e){if(!this.isOpen||!this.port)return r("_read","queueing _read for after open"),void this.once("open",()=>{this._read(e)});(!this._pool||this._pool.length-this._pool.used<this._kMinPoolSpace)&&(r("_read","discarding the read buffer pool because it is below kMinPoolSpace"),this._pool=i(this.settings.highWaterMark));const t=this._pool,n=Math.min(t.length-t.used,e),s=t.used;r("_read","reading",{start:s,toRead:n}),this.port.read(t,s,n).then(({bytesRead:e})=>{if(r("binding.read","finished",{bytesRead:e}),0===e)return r("binding.read","Zero bytes read closing readable stream"),void this.push(null);t.used+=e,this.push(t.slice(s,s+e))},t=>{r("binding.read","error",t),t.canceled||this._disconnected(t),this._read(e)})}_disconnected(e){this.isOpen?(r("disconnected",e),this.close(void 0,new s(e.message))):r("disconnected aborted because already closed",e)}close(e,t=null){if(!this.isOpen||!this.port)return r("close attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);this.closing=!0,r("#close"),this.port.close().then(()=>{this.closing=!1,r("binding.close","finished"),this.emit("close",t),this.settings.endOnClose&&this.emit("end"),e&&e.call(this,t)},t=>(this.closing=!1,r("binding.close","had an error",t),this._error(t,e)))}set(e,t){if(!this.isOpen||!this.port)return r("set attempted, but port is not open"),this._asyncError(new Error("Port is not open"),t);const n={...o,...e};r("#set",n),this.port.set(n).then(()=>{r("binding.set","finished"),t&&t.call(this,null)},e=>(r("binding.set","had an error",e),this._error(e,t)))}get(e){if(!this.isOpen||!this.port)return r("get attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);r("#get"),this.port.get().then(t=>{r("binding.get","finished"),e.call(this,null,t)},t=>(r("binding.get","had an error",t),this._error(t,e)))}flush(e){if(!this.isOpen||!this.port)return r("flush attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);r("#flush"),this.port.flush().then(()=>{r("binding.flush","finished"),e&&e.call(this,null)},t=>(r("binding.flush","had an error",t),this._error(t,e)))}drain(e){if(r("drain"),!this.isOpen||!this.port)return r("drain queuing on port open"),void this.once("open",()=>{this.drain(e)});this.port.drain().then(()=>{r("binding.drain","finished"),e&&e.call(this,null)},t=>(r("binding.drain","had an error",t),this._error(t,e)))}}return p.SerialPortStream=a,p}()]);export{F as i};
|
package/cli.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./assets/cli-DIXdkQBM.js";import"./assets/_commonjsHelpers-C1uRMj_j.js";import"assert";import"events";import"node:process";import"node:events";import"node:fs";import"module";import"node:os";import"node:tty";import"node:buffer";import"node:util";import"node:path";import"os";import"crypto";import"node:crypto";import"fs";import"path";import"http";import"node:url";import"node:child_process";import"node:fs/promises";import"url";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";import"util";import"perf_hooks";import"tty";import"worker_threads";import"node:diagnostics_channel";import"diagnostics_channel";import"node:net";import"async_hooks";import"node:readline";import"node:worker_threads";import"node:http";import"node:https";import"node:zlib";import"node:tls";
|
package/package.json
CHANGED
|
@@ -1,97 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"start": "node scripts/start.js",
|
|
20
|
-
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
|
|
21
|
-
"auth": "npm run auth:npm && npm run auth:docker",
|
|
22
|
-
"generate": "node scripts/generate-git-commit-info.js",
|
|
23
|
-
"build": "node scripts/build.js",
|
|
24
|
-
"build:all": "npm run build && npm run build:sandbox",
|
|
25
|
-
"build:packages": "npm run build --workspaces",
|
|
26
|
-
"build:sandbox": "node scripts/build_sandbox.js --skip-npm-install-build",
|
|
27
|
-
"bundle": "npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
28
|
-
"bundle:obfuscated": "npm run generate && cross-env OBFUSCATE=true NODE_ENV=production node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
29
|
-
"bundle:production": "npm run generate && cross-env NODE_ENV=production node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
30
|
-
"bundle:light": "npm run generate && cross-env OBFUSCATE=true OBFUSCATION_PRESET=light node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
31
|
-
"bundle:balanced": "npm run generate && cross-env OBFUSCATE=true OBFUSCATION_PRESET=balanced node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
32
|
-
"bundle:secure": "npm run generate && cross-env OBFUSCATE=true OBFUSCATION_PRESET=high node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
33
|
-
"bundle:dev": "npm run generate && cross-env OBFUSCATE=true OBFUSCATION_PRESET=development node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
34
|
-
"bundle:quiet": "npm run generate && cross-env SUPPRESS_STARTUP_LOGS=true node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
35
|
-
"bundle:verbose": "npm run generate && cross-env SUPPRESS_STARTUP_LOGS=false node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
36
|
-
"test": "npm run test --workspaces",
|
|
37
|
-
"test:ci": "npm run test:ci --workspaces --if-present && npm run test:scripts",
|
|
38
|
-
"test:scripts": "vitest run --config ./scripts/tests/vitest.config.ts",
|
|
39
|
-
"lint": "eslint . --ext .ts,.tsx && eslint integration-tests",
|
|
40
|
-
"lint:fix": "eslint . --fix && eslint integration-tests --fix",
|
|
41
|
-
"lint:ci": "eslint . --ext .ts,.tsx --max-warnings 0 && eslint integration-tests --max-warnings 0",
|
|
42
|
-
"format": "prettier --write .",
|
|
43
|
-
"typecheck": "npm run typecheck --workspaces --if-present",
|
|
44
|
-
"preflight": "npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci",
|
|
45
|
-
"prepare": "npm run bundle:obfuscated",
|
|
46
|
-
"prepare:package": "node scripts/prepare-package.js",
|
|
47
|
-
"release:version": "node scripts/version.js",
|
|
48
|
-
"telemetry": "node scripts/telemetry.js",
|
|
49
|
-
"clean": "node scripts/clean.js",
|
|
50
|
-
"postinstall": "node postinstall.js"
|
|
51
|
-
},
|
|
52
|
-
"bin": {
|
|
53
|
-
"embedder": "bundle/embedder.js",
|
|
54
|
-
"repomap-bridge": "bundle/repomap-bridge.js"
|
|
55
|
-
},
|
|
56
|
-
"files": [
|
|
57
|
-
"bundle/",
|
|
58
|
-
"postinstall.js",
|
|
59
|
-
"README.md",
|
|
60
|
-
"LICENSE"
|
|
61
|
-
],
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@types/micromatch": "^4.0.9",
|
|
64
|
-
"@types/mime-types": "^3.0.1",
|
|
65
|
-
"@types/mock-fs": "^4.13.4",
|
|
66
|
-
"@types/shell-quote": "^1.7.5",
|
|
67
|
-
"@types/uuid": "^10.0.0",
|
|
68
|
-
"@vitest/coverage-v8": "^3.1.1",
|
|
69
|
-
"concurrently": "^9.2.0",
|
|
70
|
-
"cross-env": "^7.0.3",
|
|
71
|
-
"esbuild": "^0.25.0",
|
|
72
|
-
"eslint": "^9.24.0",
|
|
73
|
-
"eslint-config-prettier": "^10.1.2",
|
|
74
|
-
"eslint-plugin-import": "^2.31.0",
|
|
75
|
-
"eslint-plugin-license-header": "^0.8.0",
|
|
76
|
-
"eslint-plugin-react": "^7.37.5",
|
|
77
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
78
|
-
"glob": "^10.4.5",
|
|
79
|
-
"globals": "^16.0.0",
|
|
80
|
-
"javascript-obfuscator": "^4.1.1",
|
|
81
|
-
"json": "^11.0.0",
|
|
82
|
-
"lodash": "^4.17.21",
|
|
83
|
-
"memfs": "^4.17.2",
|
|
84
|
-
"mock-fs": "^5.5.0",
|
|
85
|
-
"pkg": "^5.8.1",
|
|
86
|
-
"prettier": "^3.5.3",
|
|
87
|
-
"react-devtools-core": "^4.28.5",
|
|
88
|
-
"typescript-eslint": "^8.30.1",
|
|
89
|
-
"vitest": "^3.2.4",
|
|
90
|
-
"yargs": "^17.7.2"
|
|
91
|
-
},
|
|
92
|
-
"dependencies": {
|
|
93
|
-
"@lydell/node-pty": "^1.1.0",
|
|
94
|
-
"@serialport/stream": "^12.0.0",
|
|
95
|
-
"@serialport/bindings-cpp": "^12.0.1"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
2
|
+
"name": "@embedder/embedder",
|
|
3
|
+
"version": "2.0.5",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@serialport/bindings-cpp": "^13.0.1"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {},
|
|
13
|
+
"bin": {
|
|
14
|
+
"embedder": "cli.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
PROPRIETARY SOFTWARE LICENSE
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Embedder Technologies Inc. All rights reserved.
|
|
4
|
-
|
|
5
|
-
This software and associated documentation files (the "Software") are the proprietary and confidential information of Embedder Technologies Inc. ("Company"). The Software is licensed, not sold, to you.
|
|
6
|
-
|
|
7
|
-
GRANT OF LICENSE:
|
|
8
|
-
Subject to the terms and conditions of this license, Company grants you a limited, non-exclusive, non-transferable, revocable license to use the Software solely for your internal business purposes in accordance with the documentation provided by Company.
|
|
9
|
-
|
|
10
|
-
RESTRICTIONS:
|
|
11
|
-
You may not:
|
|
12
|
-
1. Copy, modify, adapt, translate, or create derivative works based on the Software
|
|
13
|
-
2. Reverse engineer, disassemble, decompile, or otherwise attempt to derive the source code of the Software
|
|
14
|
-
3. Distribute, sell, lease, sublicense, or otherwise transfer the Software to any third party
|
|
15
|
-
4. Remove or alter any proprietary notices, labels, or marks on the Software
|
|
16
|
-
5. Use the Software for any purpose other than as expressly permitted by this license
|
|
17
|
-
|
|
18
|
-
OWNERSHIP:
|
|
19
|
-
Company retains all right, title, and interest in and to the Software, including all intellectual property rights therein. This license does not grant you any ownership rights in the Software.
|
|
20
|
-
|
|
21
|
-
CONFIDENTIALITY:
|
|
22
|
-
The Software contains trade secrets and proprietary information of Company. You agree to maintain the confidentiality of the Software and not to disclose it to any third parties without Company's prior written consent.
|
|
23
|
-
|
|
24
|
-
WARRANTY DISCLAIMER:
|
|
25
|
-
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. COMPANY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
26
|
-
|
|
27
|
-
LIMITATION OF LIABILITY:
|
|
28
|
-
IN NO EVENT SHALL COMPANY BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, DATA, OR USE, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OF THE SOFTWARE.
|
|
29
|
-
|
|
30
|
-
TERMINATION:
|
|
31
|
-
This license is effective until terminated. Company may terminate this license immediately without notice if you breach any term of this license. Upon termination, you must cease all use of the Software and destroy all copies in your possession.
|
|
32
|
-
|
|
33
|
-
GOVERNING LAW:
|
|
34
|
-
This license shall be governed by and construed in accordance with the laws of [Jurisdiction], without regard to its conflict of laws principles.
|
|
35
|
-
|
|
36
|
-
If you have any questions about this license, please contact: legal@embedder.dev
|