@embedder/embedder 2.0.29 → 2.0.31
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/README.md +1 -1
- package/assets/_commonjsHelpers-BKZq-wXp.js +2 -0
- package/assets/cli-BChDMnux.js +866 -0
- package/assets/devtools-ChutGjZO.js +21 -0
- package/assets/index-C1UxfNrr.js +2 -0
- package/assets/index-CrpiJNKS.js +2 -0
- package/cli.js +1 -35
- package/package.json +1 -1
- package/assets/_commonjsHelpers-CSHRO93D.js +0 -39
- package/assets/cli-Cvo-V2B8.js +0 -115084
- package/assets/devtools-_-GLI3Xv.js +0 -16719
- package/assets/index-BCtIIzI8.js +0 -835
- package/assets/index-V_LktxGl.js +0 -1234
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{g as e}from"./_commonjsHelpers-BKZq-wXp.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,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,t}from"./cli-BChDMnux.js";import{b as n,c as r,d as s,a as i,f as o,l,s as u}from"./cli-BChDMnux.js";import"./_commonjsHelpers-BKZq-wXp.js";import"signal-exit";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"node:url";import"node:child_process";import"node:fs/promises";import"@sentry/node";import"fs";import"crypto";import"os";import"path";import"http";import"url";import"util";import"stream";import"buffer";import"events";import"zlib";import"tty";import"string_decoder";import"https";import"node:crypto";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";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 L="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}",b=new RegExp(`[${L}]+|\\s+|[^${L}]`,"ug");const k=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(b)||[];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?k.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)|[${L}]+|[^\\S\\n\\r]+|[^${L}]`,"ug");return e.match(t)||[]}};function E(e,t,n){return O.diff(e,t,n)}function x(e){return"."==e||"!"==e||"?"==e}const A=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(x(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 F(e,t,n){return A.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(C(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 C(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]=C(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]=C(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}const H=new class extends e{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function J(e,t,n){return H.diff(e,t,n)}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((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 I(e){return Array.isArray(e)?e.map(e=>I(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 _(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?_(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=P(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=I(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?_(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,H as arrayDiff,C as canonicalize,a as characterDiff,U as convertChangesToDMP,Z as convertChangesToXML,n as createPatch,r as createTwoFilesPatch,$ as cssDiff,J as diffArrays,c as diffChars,W as diffCss,z as diffJson,s as diffLines,F as diffSentences,i as diffTrimmedLines,j as diffWords,E as diffWordsWithSpace,o as formatPatch,N as jsonDiff,l as lineDiff,_ as parsePatch,q as reversePatch,A as sentenceDiff,u as structuredPatch,k as wordDiff,O as wordsWithSpaceDiff};
|
package/cli.js
CHANGED
|
@@ -1,36 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import "signal-exit";
|
|
4
|
-
import "@sentry/node";
|
|
5
|
-
import "./assets/_commonjsHelpers-CSHRO93D.js";
|
|
6
|
-
import "node:process";
|
|
7
|
-
import "node:events";
|
|
8
|
-
import "node:fs";
|
|
9
|
-
import "module";
|
|
10
|
-
import "node:os";
|
|
11
|
-
import "node:tty";
|
|
12
|
-
import "node:buffer";
|
|
13
|
-
import "node:util";
|
|
14
|
-
import "node:path";
|
|
15
|
-
import "node:url";
|
|
16
|
-
import "node:child_process";
|
|
17
|
-
import "node:fs/promises";
|
|
18
|
-
import "fs";
|
|
19
|
-
import "crypto";
|
|
20
|
-
import "os";
|
|
21
|
-
import "path";
|
|
22
|
-
import "http";
|
|
23
|
-
import "url";
|
|
24
|
-
import "util";
|
|
25
|
-
import "stream";
|
|
26
|
-
import "buffer";
|
|
27
|
-
import "events";
|
|
28
|
-
import "zlib";
|
|
29
|
-
import "tty";
|
|
30
|
-
import "string_decoder";
|
|
31
|
-
import "https";
|
|
32
|
-
import "node:crypto";
|
|
33
|
-
import "node:stream";
|
|
34
|
-
import "node:string_decoder";
|
|
35
|
-
import "fs/promises";
|
|
36
|
-
import "child_process";
|
|
2
|
+
import"./assets/cli-BChDMnux.js";import"signal-exit";import"@sentry/node";import"./assets/_commonjsHelpers-BKZq-wXp.js";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"node:url";import"node:child_process";import"node:fs/promises";import"fs";import"crypto";import"os";import"path";import"http";import"url";import"util";import"stream";import"buffer";import"events";import"zlib";import"tty";import"string_decoder";import"https";import"node:crypto";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
-
function getDefaultExportFromCjs(x) {
|
|
4
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
5
|
-
}
|
|
6
|
-
function getAugmentedNamespace(n) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
8
|
-
var f = n.default;
|
|
9
|
-
if (typeof f == "function") {
|
|
10
|
-
var a = function a2() {
|
|
11
|
-
var isInstance = false;
|
|
12
|
-
try {
|
|
13
|
-
isInstance = this instanceof a2;
|
|
14
|
-
} catch {
|
|
15
|
-
}
|
|
16
|
-
if (isInstance) {
|
|
17
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
18
|
-
}
|
|
19
|
-
return f.apply(this, arguments);
|
|
20
|
-
};
|
|
21
|
-
a.prototype = f.prototype;
|
|
22
|
-
} else a = {};
|
|
23
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
24
|
-
Object.keys(n).forEach(function(k) {
|
|
25
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
26
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function() {
|
|
29
|
-
return n[k];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
return a;
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
getAugmentedNamespace as a,
|
|
37
|
-
commonjsGlobal as c,
|
|
38
|
-
getDefaultExportFromCjs as g
|
|
39
|
-
};
|