@github/copilot 0.0.412-0 → 0.0.412-1
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/changelog.json +32 -0
- package/index.js +4 -4
- package/package.json +8 -8
- package/sdk/index.js +2 -2
package/changelog.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./changelog-schema.json",
|
|
3
3
|
"unpublished": [],
|
|
4
|
+
"0.0.412-0": [
|
|
5
|
+
{
|
|
6
|
+
"type": "added",
|
|
7
|
+
"description": "Add cross-session memory: ask about past work, files, and PRs across sessions (experimental)",
|
|
8
|
+
"related_pull_requests": ["https://github.com/github/copilot-agent-runtime/pull/3109"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "added",
|
|
12
|
+
"description": "Add `--bash-env` flag to source BASH_ENV in shell sessions",
|
|
13
|
+
"related_pull_requests": ["https://github.com/github/copilot-agent-runtime/pull/2929"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "added",
|
|
17
|
+
"description": "Restore `ctrl+x /` as alternate shortcut to run commands while preserving input",
|
|
18
|
+
"related_pull_requests": ["https://github.com/github/copilot-agent-runtime/pull/3324"]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "fixed",
|
|
22
|
+
"description": "/clear preserves agent mode (autopilot, plan, or interactive)",
|
|
23
|
+
"related_pull_requests": ["https://github.com/github/copilot-agent-runtime/pull/3386"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "fixed",
|
|
27
|
+
"description": "MCP error messages include the server name",
|
|
28
|
+
"related_pull_requests": ["https://github.com/github/copilot-agent-runtime/pull/3295"]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "fixed",
|
|
32
|
+
"description": "Text selection in timeline no longer spills into prompt area when dragging",
|
|
33
|
+
"related_pull_requests": ["https://github.com/github/copilot-agent-runtime/pull/3354"]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
4
36
|
"0.0.411": [
|
|
5
37
|
{
|
|
6
38
|
"type": "added",
|
package/index.js
CHANGED
|
@@ -1866,7 +1866,7 @@ ${he.join(`
|
|
|
1866
1866
|
`),{leaks:re,details:de}}}function g(S){return h?.trackDisposable(S),S}function y(S){h?.markAsDisposed(S)}function Z(S,U){h?.setParent(S,U)}function E(S){return typeof S=="object"&&S!==null&&typeof S.dispose=="function"&&S.dispose.length===0}function w(S){if(p.Iterable.is(S)){let U=[];for(let q of S)if(q)try{q.dispose()}catch(re){U.push(re)}if(U.length===1)throw U[0];if(U.length>1)throw new AggregateError(U,"Encountered errors while disposing of store");return Array.isArray(S)?[]:S}if(S)return S.dispose(),S}function v(S){let U=g({dispose:(0,m.createSingleCallFunction)((()=>{y(U),S()}))});return U}a.DisposableTracker=G;class C{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,g(this)}dispose(){this._isDisposed||(y(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{w(this._toDispose)}finally{this._toDispose.clear()}}add(U){if(!U)return U;if(U===this)throw new Error("Cannot register a disposable on itself!");return Z(U,this),this._isDisposed?C.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(U),U}delete(U){if(U){if(U===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(U),U.dispose()}}deleteAndLeak(U){U&&this._toDispose.has(U)&&(this._toDispose.delete(U),Z(U,null))}}a.DisposableStore=C;class Q{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new C,g(this),Z(this._store,this)}dispose(){y(this),this._store.dispose()}_register(U){if(U===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(U)}}a.Disposable=Q;class X{constructor(){this._isDisposed=!1,g(this)}get value(){return this._isDisposed?void 0:this._value}set value(U){this._isDisposed||U===this._value||(this._value?.dispose(),U&&Z(U,this),this._value=U)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,y(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let U=this._value;return this._value=void 0,U&&Z(U,null),U}}a.MutableDisposable=X,a.MandatoryMutableDisposable=class{constructor(S){this._disposable=new X,this._isDisposed=!1,this._disposable.value=S}get value(){return this._disposable.value}set value(S){this._isDisposed||S===this._disposable.value||(this._disposable.value=S)}dispose(){this._isDisposed=!0,this._disposable.dispose()}},a.RefCountedDisposable=class{constructor(S){this._disposable=S,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter==0&&this._disposable.dispose(),this}},a.SafeDisposable=class{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,g(this)}set(S){let U=S;return this.unset=()=>U=void 0,this.isset=()=>U!==void 0,this.dispose=()=>{U&&(U(),U=void 0,y(this))},this}},a.ReferenceCollection=class{constructor(){this.references=new Map}acquire(S,...U){let q=this.references.get(S);q||(q={counter:0,object:this.createReferencedObject(S,...U)},this.references.set(S,q));let{object:re}=q,_=(0,m.createSingleCallFunction)((()=>{--q.counter==0&&(this.destroyReferencedObject(S,q.object),this.references.delete(S))}));return q.counter++,{object:re,dispose:_}}},a.AsyncReferenceCollection=class{constructor(S){this.referenceCollection=S}async acquire(S,...U){let q=this.referenceCollection.acquire(S,...U);try{return{object:await q.object,dispose:()=>q.dispose()}}catch(re){throw q.dispose(),re}}},a.ImmortalReference=class{constructor(S){this.object=S}dispose(){}};class k{constructor(){this._store=new Map,this._isDisposed=!1,g(this)}dispose(){y(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{w(this._store.values())}finally{this._store.clear()}}has(U){return this._store.has(U)}get size(){return this._store.size}get(U){return this._store.get(U)}set(U,q,re=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),re||this._store.get(U)?.dispose(),this._store.set(U,q)}deleteAndDispose(U){this._store.get(U)?.dispose(),this._store.delete(U)}deleteAndLeak(U){let q=this._store.get(U);return this._store.delete(U),q}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}a.DisposableMap=k},6317:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkedList=void 0;class c{static{this.Undefined=new c(void 0)}constructor(u){this.element=u,this.next=c.Undefined,this.prev=c.Undefined}}class I{constructor(){this._first=c.Undefined,this._last=c.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===c.Undefined}clear(){let u=this._first;for(;u!==c.Undefined;){let m=u.next;u.prev=c.Undefined,u.next=c.Undefined,u=m}this._first=c.Undefined,this._last=c.Undefined,this._size=0}unshift(u){return this._insert(u,!1)}push(u){return this._insert(u,!0)}_insert(u,m){let p=new c(u);if(this._first===c.Undefined)this._first=p,this._last=p;else if(m){let G=this._last;this._last=p,p.prev=G,G.next=p}else{let G=this._first;this._first=p,p.next=G,G.prev=p}this._size+=1;let h=!1;return()=>{h||(h=!0,this._remove(p))}}shift(){if(this._first!==c.Undefined){let u=this._first.element;return this._remove(this._first),u}}pop(){if(this._last!==c.Undefined){let u=this._last.element;return this._remove(this._last),u}}_remove(u){if(u.prev!==c.Undefined&&u.next!==c.Undefined){let m=u.prev;m.next=u.next,u.next.prev=m}else u.prev===c.Undefined&&u.next===c.Undefined?(this._first=c.Undefined,this._last=c.Undefined):u.next===c.Undefined?(this._last=this._last.prev,this._last.next=c.Undefined):u.prev===c.Undefined&&(this._first=this._first.next,this._first.prev=c.Undefined);this._size-=1}*[Symbol.iterator](){let u=this._first;for(;u!==c.Undefined;)yield u.element,u=u.next}}a.LinkedList=I},2608:(l,a)=>{var c;Object.defineProperty(a,"__esModule",{value:!0}),a.SetMap=a.BidirectionalMap=a.CounterSet=a.Touch=void 0,a.getOrSet=function(I,d,u){let m=I.get(d);return m===void 0&&(m=u,I.set(d,m)),m},a.mapToString=function(I){let d=[];return I.forEach(((u,m)=>{d.push(`${m} => ${u}`)})),`Map(${I.size}) {${d.join(", ")}}`},a.setToString=function(I){let d=[];return I.forEach((u=>{d.push(u)})),`Set(${I.size}) {${d.join(", ")}}`},a.mapsStrictEqualIgnoreOrder=function(I,d){if(I===d)return!0;if(I.size!==d.size)return!1;for(let[u,m]of I)if(!d.has(u)||d.get(u)!==m)return!1;for(let[u]of d)if(!I.has(u))return!1;return!0},(function(I){I[I.None=0]="None",I[I.AsOld=1]="AsOld",I[I.AsNew=2]="AsNew"})(c||(a.Touch=c={})),a.CounterSet=class{constructor(){this.map=new Map}add(I){return this.map.set(I,(this.map.get(I)||0)+1),this}delete(I){let d=this.map.get(I)||0;return d!==0&&(d--,d===0?this.map.delete(I):this.map.set(I,d),!0)}has(I){return this.map.has(I)}},a.BidirectionalMap=class{constructor(I){if(this._m1=new Map,this._m2=new Map,I)for(let[d,u]of I)this.set(d,u)}clear(){this._m1.clear(),this._m2.clear()}set(I,d){this._m1.set(I,d),this._m2.set(d,I)}get(I){return this._m1.get(I)}getKey(I){return this._m2.get(I)}delete(I){let d=this._m1.get(I);return d!==void 0&&(this._m1.delete(I),this._m2.delete(d),!0)}forEach(I,d){this._m1.forEach(((u,m)=>{I.call(d,u,m,this)}))}keys(){return this._m1.keys()}values(){return this._m1.values()}},a.SetMap=class{constructor(){this.map=new Map}add(I,d){let u=this.map.get(I);u||(u=new Set,this.map.set(I,u)),u.add(d)}delete(I,d){let u=this.map.get(I);u&&(u.delete(d),u.size===0&&this.map.delete(I))}forEach(I,d){let u=this.map.get(I);u&&u.forEach(d)}get(I){return this.map.get(I)||new Set}}},9725:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StopWatch=void 0;let c=globalThis.performance&&typeof globalThis.performance.now=="function";class I{static create(u){return new I(u)}constructor(u){this._now=c&&u===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}a.StopWatch=I}},e={};function n(l){var a=e[l];if(a!==void 0)return a.exports;var c=e[l]={exports:{}};return t[l].call(c.exports,c,c.exports,n),c.exports}var r={};(()=>{var l=r;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;let a=n(5101),c=n(6097),I=n(4335),d=n(5856),u=n(3027),m=n(7150),p=["cols","rows"];class h extends m.Disposable{constructor(g){super(),this._core=this._register(new d.Terminal(g)),this._addonManager=this._register(new u.AddonManager),this._publicOptions={...this._core.options};let y=E=>this._core.options[E],Z=(E,w)=>{this._checkReadonlyOptions(E),this._core.options[E]=w};for(let E in this._core.options){Object.defineProperty(this._publicOptions,E,{get:()=>this._core.options[E],set:v=>{this._checkReadonlyOptions(E),this._core.options[E]=v}});let w={get:y.bind(this,E),set:Z.bind(this,E)};Object.defineProperty(this._publicOptions,E,w)}}_checkReadonlyOptions(g){if(p.includes(g))throw new Error(`Option "${g}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onLineFeed(){return this._core.onLineFeed}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new I.UnicodeApi(this._core)}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=this._register(new a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let g=this._core.coreService.decPrivateModes,y="none";switch(this._core.coreMouseService.activeProtocol){case"X10":y="x10";break;case"VT200":y="vt200";break;case"DRAG":y="drag";break;case"ANY":y="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:y,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,synchronizedOutputMode:g.synchronizedOutput,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(let y in g)this._publicOptions[y]=g[y]}input(g,y=!0){this._core.input(g,y)}resize(g,y){this._verifyIntegers(g,y),this._core.resize(g,y)}registerMarker(g=0){return this._checkProposedApi(),this._verifyIntegers(g),this._core.addMarker(g)}addMarker(g){return this.registerMarker(g)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,y){this._core.write(g,y)}writeln(g,y){this._core.write(g),this._core.write(`\r
|
|
1867
1867
|
`,y)}reset(){this._core.reset()}loadAddon(g){this._addonManager.loadAddon(this,g)}_verifyIntegers(...g){for(let y of g)if(y===1/0||isNaN(y)||y%1!=0)throw new Error("This API only accepts integers")}}l.Terminal=h})();var o=ysr;for(var s in r)o[s]=r[s];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()});var YVe=H(jpe=>{"use strict";Object.defineProperty(jpe,"__esModule",{value:!0});jpe.loadNativeModule=jpe.assign=void 0;function xGs(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach(function(r){return Object.keys(r).forEach(function(o){return t[o]=r[o]})}),t}jpe.assign=xGs;function SGs(t){for(var e=["build/Release","build/Debug","prebuilds/"+process.platform+"-"+process.arch],n=["..","."],r,o=0,s=e;o<s.length;o++)for(var l=s[o],a=0,c=n;a<c.length;a++){var I=c[a],d=I+"/"+l;try{return{dir:d,module:Ye(d+"/"+t+".node")}}catch(u){r=u}}throw new Error("Failed to load native module: "+t+".node, checked: "+e.join(", ")+": "+r)}jpe.loadNativeModule=SGs});var gBt=H(J7e=>{"use strict";Object.defineProperty(J7e,"__esModule",{value:!0});J7e.EventEmitter2=void 0;var LGs=(function(){function t(){this._listeners=[]}return Object.defineProperty(t.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(n){e._listeners.push(n);var r={dispose:function(){for(var o=0;o<e._listeners.length;o++)if(e._listeners[o]===n){e._listeners.splice(o,1);return}}};return r}),this._event},enumerable:!1,configurable:!0}),t.prototype.fire=function(e){for(var n=[],r=0;r<this._listeners.length;r++)n.push(this._listeners[r]);for(var r=0;r<n.length;r++)n[r].call(void 0,e)},t})();J7e.EventEmitter2=LGs});var ABt=H(eP=>{"use strict";Object.defineProperty(eP,"__esModule",{value:!0});eP.Terminal=eP.DEFAULT_ROWS=eP.DEFAULT_COLS=void 0;var JGs=Ye("events"),Zsr=gBt();eP.DEFAULT_COLS=80;eP.DEFAULT_ROWS=24;var BGs="",TGs="",_Gs=(function(){function t(e){this._pid=0,this._fd=0,this._cols=0,this._rows=0,this._readable=!1,this._writable=!1,this._onData=new Zsr.EventEmitter2,this._onExit=new Zsr.EventEmitter2,this._internalee=new JGs.EventEmitter,this.handleFlowControl=!!e?.handleFlowControl,this._flowControlPause=e?.flowControlPause||BGs,this._flowControlResume=e?.flowControlResume||TGs,e&&(this._checkType("name",e.name?e.name:void 0,"string"),this._checkType("cols",e.cols?e.cols:void 0,"number"),this._checkType("rows",e.rows?e.rows:void 0,"number"),this._checkType("cwd",e.cwd?e.cwd:void 0,"string"),this._checkType("env",e.env?e.env:void 0,"object"),this._checkType("uid",e.uid?e.uid:void 0,"number"),this._checkType("gid",e.gid?e.gid:void 0,"number"),this._checkType("encoding",e.encoding?e.encoding:void 0,"string"))}return Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onExit",{get:function(){return this._onExit.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pid",{get:function(){return this._pid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._rows},enumerable:!1,configurable:!0}),t.prototype.write=function(e){if(this.handleFlowControl){if(e===this._flowControlPause){this.pause();return}if(e===this._flowControlResume){this.resume();return}}this._write(e)},t.prototype._forwardEvents=function(){var e=this;this.on("data",function(n){return e._onData.fire(n)}),this.on("exit",function(n,r){return e._onExit.fire({exitCode:n,signal:r})})},t.prototype._checkType=function(e,n,r,o){if(o===void 0&&(o=!1),n!==void 0){if(o&&Array.isArray(n)){n.forEach(function(s,l){if(typeof s!==r)throw new Error(e+"["+l+"] must be a "+r+" (not a "+typeof s[l]+")")});return}if(typeof n!==r)throw new Error(e+" must be a "+r+" (not a "+typeof n+")")}},t.prototype.end=function(e){this._socket.end(e)},t.prototype.pipe=function(e,n){return this._socket.pipe(e,n)},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,n){this.on(e,n)},t.prototype.on=function(e,n){if(e==="close"){this._internalee.on("close",n);return}this._socket.on(e,n)},t.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e==="close"?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,n){this._socket.removeListener(e,n)},t.prototype.removeAllListeners=function(e){this._socket.removeAllListeners(e)},t.prototype.once=function(e,n){this._socket.once(e,n)},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 n=Object.keys(e||{}),r=[],o=0;o<n.length;o++)n[o]!==void 0&&r.push(n[o]+"="+e[n[o]]);return r},t})();eP.Terminal=_Gs});var Esr=H(B7e=>{"use strict";Object.defineProperty(B7e,"__esModule",{value:!0});B7e.getWorkerPipeName=void 0;function OGs(t){return t+"-worker"}B7e.getWorkerPipeName=OGs});var Wsr=H(tP=>{"use strict";var MGs=tP&&tP.__awaiter||function(t,e,n,r){function o(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function a(d){try{I(r.next(d))}catch(u){l(u)}}function c(d){try{I(r.throw(d))}catch(u){l(u)}}function I(d){d.done?s(d.value):o(d.value).then(a,c)}I((r=r.apply(t,e||[])).next())})},UGs=tP&&tP.__generator||function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(I){return function(d){return c([I,d])}}function c(I){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(s=I[0]&2?o.return:I[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,I[1])).done)return s;switch(o=0,s&&(I=[I[0]&2,s.value]),I[0]){case 0:case 1:s=I;break;case 4:return n.label++,{value:I[1],done:!1};case 5:n.label++,o=I[1],I=[0];continue;case 7:I=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(I[0]===6||I[0]===2)){n=0;continue}if(I[0]===3&&(!s||I[1]>s[0]&&I[1]<s[3])){n.label=I[1];break}if(I[0]===6&&n.label<s[1]){n.label=s[1],s=I;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(I);break}s[2]&&n.ops.pop(),n.trys.pop();continue}I=e.call(t,n)}catch(d){I=[6,d],o=0}finally{r=s=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}};Object.defineProperty(tP,"__esModule",{value:!0});tP.ConoutConnection=void 0;var DGs=Ye("worker_threads"),zGs=Esr(),PGs=Ye("path"),jGs=gBt(),KGs=1e3,qGs=(function(){function t(e,n){var r=this;this._conoutPipeName=e,this._useConptyDll=n,this._isDisposed=!1,this._onReady=new jGs.EventEmitter2;var o={conoutPipeName:e},s=__dirname.replace("node_modules.asar","node_modules.asar.unpacked");this._worker=new DGs.Worker(PGs.join(s,"worker/conoutSocketWorker.js"),{workerData:o}),this._worker.on("message",function(l){switch(l){case 1:r._onReady.fire();return;default:console.warn("Unexpected ConoutWorkerMessage",l)}})}return Object.defineProperty(t.prototype,"onReady",{get:function(){return this._onReady.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){!this._useConptyDll&&this._isDisposed||(this._isDisposed=!0,this._drainDataAndClose())},t.prototype.connectSocket=function(e){e.connect(zGs.getWorkerPipeName(this._conoutPipeName))},t.prototype._drainDataAndClose=function(){var e=this;this._drainTimeout&&clearTimeout(this._drainTimeout),this._drainTimeout=setTimeout(function(){return e._destroySocket()},KGs)},t.prototype._destroySocket=function(){return MGs(this,void 0,void 0,function(){return UGs(this,function(e){switch(e.label){case 0:return[4,this._worker.terminate()];case 1:return e.sent(),[2]}})})},t})();tP.ConoutConnection=qGs});var vsr=H(Kpe=>{"use strict";Object.defineProperty(Kpe,"__esModule",{value:!0});Kpe.argsToCommandLine=Kpe.WindowsPtyAgent=void 0;var $Gs=Ye("fs"),Rsr=Ye("path"),egs=Ye("child_process"),wsr=Ye("net"),tgs=Wsr(),ngs=YVe(),CVe,rgs=1e3,ogs=(function(){function t(e,n,r,o,s,l,a,c,I){var d=this;c===void 0&&(c=!1),I===void 0&&(I=!1),this._useConptyDll=c,this._innerPid=0,CVe||(CVe=ngs.loadNativeModule("conpty").module),this._ptyNative=CVe,o=Rsr.resolve(o);var u=NBt(e,n),m=CVe.startProcess(e,s,l,a,this._generatePipeName(),I,this._useConptyDll);this._fd=m.fd,this._pty=m.pty,this._outSocket=new wsr.Socket,this._outSocket.setEncoding("utf8"),this._conoutSocketWorker=new tgs.ConoutConnection(m.conout,this._useConptyDll),this._pendingPtyInfo={pty:this._pty,commandLine:u,cwd:o,env:r};var p=setTimeout(function(){d._pendingPtyInfo&&d._completePtyConnection()},5e3);this._conoutSocketWorker.onReady(function(){clearTimeout(p),d._conoutSocketWorker.connectSocket(d._outSocket),d._completePtyConnection()}),this._outSocket.on("connect",function(){d._outSocket.emit("ready_datapipe")});var h=$Gs.openSync(m.conin,"w");this._inSocket=new wsr.Socket({fd:h,readable:!1,writable:!0}),this._inSocket.setEncoding("utf8")}return Object.defineProperty(t.prototype,"inSocket",{get:function(){return this._inSocket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outSocket",{get:function(){return this._outSocket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fd",{get:function(){return this._fd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerPid",{get:function(){return this._innerPid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pty",{get:function(){return this._pty},enumerable:!1,configurable:!0}),t.prototype._completePtyConnection=function(){var e=this;if(this._pendingPtyInfo){var n=this._pendingPtyInfo,r=n.pty,o=n.commandLine,s=n.cwd,l=n.env;this._pendingPtyInfo=void 0;var a=CVe.connect(r,o,s,l,this._useConptyDll,function(c){return e._$onProcessExit(c)});this._innerPid=a.pid}},t.prototype.resize=function(e,n){if(this._exitCode!==void 0)throw new Error("Cannot resize a pty that has already exited");this._ptyNative.resize(this._pty,e,n,this._useConptyDll)},t.prototype.clear=function(){this._ptyNative.clear(this._pty,this._useConptyDll)},t.prototype.kill=function(){var e=this;this._pendingPtyInfo=void 0,this._useConptyDll?(this._inSocket.destroy(),this._ptyNative.kill(this._pty,this._useConptyDll),this._outSocket.on("data",function(){e._conoutSocketWorker.dispose()})):(this._inSocket.readable=!1,this._outSocket.readable=!1,this._getConsoleProcessList().then(function(n){n.forEach(function(r){try{process.kill(r)}catch{}})}),this._ptyNative.kill(this._pty,this._useConptyDll),this._conoutSocketWorker.dispose())},t.prototype._getConsoleProcessList=function(){var e=this;return this._innerPid<=0?Promise.resolve([]):new Promise(function(n){var r=egs.fork(Rsr.join(__dirname,"conpty_console_list_agent"),[e._innerPid.toString()]);r.on("message",function(s){clearTimeout(o),n(s.consoleProcessList)});var o=setTimeout(function(){r.kill(),n([e._innerPid])},5e3)})},Object.defineProperty(t.prototype,"exitCode",{get:function(){return this._exitCode},enumerable:!1,configurable:!0}),t.prototype._generatePipeName=function(){return"conpty-"+Math.random()*1e7},t.prototype._$onProcessExit=function(e){var n=this;this._exitCode=e,this._useConptyDll||(this._flushDataAndCleanUp(),this._outSocket.on("data",function(){return n._flushDataAndCleanUp()}))},t.prototype._flushDataAndCleanUp=function(){var e=this;this._useConptyDll||(this._closeTimeout&&clearTimeout(this._closeTimeout),this._closeTimeout=setTimeout(function(){return e._cleanUpProcess()},rgs))},t.prototype._cleanUpProcess=function(){this._useConptyDll||(this._inSocket.readable=!1,this._outSocket.readable=!1,this._outSocket.destroy())},t})();Kpe.WindowsPtyAgent=ogs;function NBt(t,e){if(sgs(e))return e.length===0?t:NBt(t,[])+" "+e;var n=[t];Array.prototype.push.apply(n,e);for(var r="",o=0;o<n.length;o++){o>0&&(r+=" ");var s=n[o],l=lgs(s[0]!=='"',s[s.length-1]!=='"'),a=s[0]!=='"'&&s[s.length-1]!=='"',c=s===""||(s.indexOf(" ")!==-1||s.indexOf(" ")!==-1)&&s.length>1&&(l||a);c&&(r+='"');for(var I=0,d=0;d<s.length;d++){var u=s[d];u==="\\"?I++:u==='"'?(r+=T7e("\\",I*2+1),r+='"',I=0):(r+=T7e("\\",I),I=0,r+=u)}c?(r+=T7e("\\",I*2),r+='"'):r+=T7e("\\",I)}return r}Kpe.argsToCommandLine=NBt;function sgs(t){return typeof t=="string"}function T7e(t,e){for(var n="",r=0;r<e;r++)n+=t;return n}function lgs(t,e){return t&&!e||!t&&e}});var Ysr=H(qpe=>{"use strict";var igs=qpe&&qpe.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(qpe,"__esModule",{value:!0});qpe.WindowsTerminal=void 0;var yBt=ABt(),ags=vsr(),cgs=YVe(),Igs="cmd.exe",dgs="Windows Shell",ugs=(function(t){igs(e,t);function e(n,r,o){var s=t.call(this,o)||this;s._checkType("args",r,"string",!0),r=r||[],n=n||Igs,o=o||{},o.env=o.env||process.env,o.encoding&&console.warn("Setting encoding on Windows is not supported");var l=cgs.assign({},o.env);s._cols=o.cols||yBt.DEFAULT_COLS,s._rows=o.rows||yBt.DEFAULT_ROWS;var a=o.cwd||process.cwd(),c=o.name||l.TERM||dgs,I=s._parseEnv(l);return s._isReady=!1,s._deferreds=[],s._agent=new ags.WindowsPtyAgent(n,r,I,a,s._cols,s._rows,!1,o.useConptyDll,o.conptyInheritCursor),s._socket=s._agent.outSocket,s._pid=s._agent.innerPid,s._fd=s._agent.fd,s._pty=s._agent.pty,s._socket.on("ready_datapipe",function(){s._pid=s._agent.innerPid,s._socket.once("data",function(){s._isReady||(s._isReady=!0,s._deferreds.forEach(function(d){d.run()}),s._deferreds=[])}),s._socket.on("error",function(d){if(s._close(),!(d.code&&(~d.code.indexOf("errno 5")||~d.code.indexOf("EIO")))&&s.listeners("error").length<2)throw d}),s._socket.on("close",function(){s.emit("exit",s._agent.exitCode),s._close()})}),s._file=n,s._name=c,s._readable=!0,s._writable=!0,s._forwardEvents(),s}return e.prototype._write=function(n){this._defer(this._doWrite,n)},e.prototype._doWrite=function(n){this._agent.inSocket.write(n)},e.open=function(n){throw new Error("open() not supported on windows, use Fork() instead.")},e.prototype.resize=function(n,r,o){var s=this;if(n<=0||r<=0||isNaN(n)||isNaN(r)||n===1/0||r===1/0)throw new Error("resizing must be done using positive cols and rows");this._deferNoArgs(function(){s._agent.resize(n,r),s._cols=n,s._rows=r})},e.prototype.clear=function(){var n=this;this._deferNoArgs(function(){n._agent.clear()})},e.prototype.destroy=function(){var n=this;this._deferNoArgs(function(){n.kill()})},e.prototype.kill=function(n){var r=this;this._deferNoArgs(function(){if(n)throw new Error("Signals not supported on windows.");r._close(),r._agent.kill()})},e.prototype._deferNoArgs=function(n){var r=this;if(this._isReady){n.call(this);return}this._deferreds.push({run:function(){return n.call(r)}})},e.prototype._defer=function(n,r){var o=this;if(this._isReady){n.call(this,r);return}this._deferreds.push({run:function(){return n.call(o,r)}})},Object.defineProperty(e.prototype,"process",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"master",{get:function(){throw new Error("master is not supported on Windows")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slave",{get:function(){throw new Error("slave is not supported on Windows")},enumerable:!1,configurable:!0}),e})(yBt.Terminal);qpe.WindowsTerminal=ugs});var Fsr=H($pe=>{"use strict";var mgs=$pe&&$pe.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty($pe,"__esModule",{value:!0});$pe.UnixTerminal=void 0;var pgs=Ye("fs"),hgs=Ye("path"),fBt=Ye("tty"),VVe=ABt(),Csr=YVe(),Vsr=Csr.loadNativeModule("pty"),FVe=Vsr.module,cte=Vsr.dir+"/spawn-helper";cte=hgs.resolve(__dirname,cte);cte=cte.replace("app.asar","app.asar.unpacked");cte=cte.replace("node_modules.asar","node_modules.asar.unpacked");var bgs="sh",Ggs="xterm",ggs=200,Ags=(function(t){mgs(e,t);function e(n,r,o){var s,l,a=t.call(this,o)||this;if(a._boundClose=!1,a._emittedClose=!1,typeof r=="string")throw new Error("args as a string is not supported on unix.");r=r||[],n=n||bgs,o=o||{},o.env=o.env||process.env,a._cols=o.cols||VVe.DEFAULT_COLS,a._rows=o.rows||VVe.DEFAULT_ROWS;var c=(s=o.uid)!==null&&s!==void 0?s:-1,I=(l=o.gid)!==null&&l!==void 0?l:-1,d=Csr.assign({},o.env);o.env===process.env&&a._sanitizeEnv(d);var u=o.cwd||process.cwd();d.PWD=u;var m=o.name||d.TERM||Ggs;d.TERM=m;var p=a._parseEnv(d),h=o.encoding===void 0?"utf8":o.encoding,G=function(y,Z){if(!a._emittedClose){if(a._boundClose)return;a._boundClose=!0;var E=setTimeout(function(){E=null,a._socket.destroy()},ggs);a.once("close",function(){E!==null&&clearTimeout(E),a.emit("exit",y,Z)});return}a.emit("exit",y,Z)},g=FVe.fork(n,r,p,u,a._cols,a._rows,c,I,h==="utf8",cte,G);return a._socket=new fBt.ReadStream(g.fd),h!==null&&a._socket.setEncoding(h),a._writeStream=new Ngs(g.fd,h||void 0),a._socket.on("error",function(y){if(!(y.code&&~y.code.indexOf("EAGAIN"))&&(a._close(),a._emittedClose||(a._emittedClose=!0,a.emit("close")),!(y.code&&(~y.code.indexOf("errno 5")||~y.code.indexOf("EIO")))&&a.listeners("error").length<2))throw y}),a._pid=g.pid,a._fd=g.fd,a._pty=g.pty,a._file=n,a._name=m,a._readable=!0,a._writable=!0,a._socket.on("close",function(){a._emittedClose||(a._emittedClose=!0,a._close(),a.emit("close"))}),a._forwardEvents(),a}return Object.defineProperty(e.prototype,"master",{get:function(){return this._master},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slave",{get:function(){return this._slave},enumerable:!1,configurable:!0}),e.prototype._write=function(n){this._writeStream.write(n)},Object.defineProperty(e.prototype,"fd",{get:function(){return this._fd},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ptsName",{get:function(){return this._pty},enumerable:!1,configurable:!0}),e.open=function(n){var r=Object.create(e.prototype);n=n||{},arguments.length>1&&(n={cols:arguments[1],rows:arguments[2]});var o=n.cols||VVe.DEFAULT_COLS,s=n.rows||VVe.DEFAULT_ROWS,l=n.encoding===void 0?"utf8":n.encoding,a=FVe.open(o,s);return r._master=new fBt.ReadStream(a.master),l!==null&&r._master.setEncoding(l),r._master.resume(),r._slave=new fBt.ReadStream(a.slave),l!==null&&r._slave.setEncoding(l),r._slave.resume(),r._socket=r._master,r._pid=-1,r._fd=a.master,r._pty=a.pty,r._file=process.argv[0]||"node",r._name=process.env.TERM||"",r._readable=!0,r._writable=!0,r._socket.on("error",function(c){if(r._close(),r.listeners("error").length<2)throw c}),r._socket.on("close",function(){r._close()}),r},e.prototype.destroy=function(){var n=this;this._close(),this._socket.once("close",function(){n.kill("SIGHUP")}),this._socket.destroy(),this._writeStream.dispose()},e.prototype.kill=function(n){try{process.kill(this.pid,n||"SIGHUP")}catch{}},Object.defineProperty(e.prototype,"process",{get:function(){if(process.platform==="darwin"){var n=FVe.process(this._fd);return n!=="kernel_task"&&n!=="spawn_helper"?n:this._file}return FVe.process(this._fd,this._pty)||this._file},enumerable:!1,configurable:!0}),e.prototype.resize=function(n,r,o){var s,l;if(n<=0||r<=0||isNaN(n)||isNaN(r)||n===1/0||r===1/0)throw new Error("resizing must be done using positive cols and rows");var a=(s=o?.width)!==null&&s!==void 0?s:0,c=(l=o?.height)!==null&&l!==void 0?l:0;FVe.resize(this._fd,n,r,a,c),this._cols=n,this._rows=r},e.prototype.clear=function(){},e.prototype._sanitizeEnv=function(n){delete n.TMUX,delete n.TMUX_PANE,delete n.STY,delete n.WINDOW,delete n.WINDOWID,delete n.TERMCAP,delete n.COLUMNS,delete n.LINES},e})(VVe.Terminal);$pe.UnixTerminal=Ags;var Ngs=(function(){function t(e,n){this._fd=e,this._encoding=n,this._writeQueue=[]}return t.prototype.dispose=function(){clearImmediate(this._writeImmediate),this._writeImmediate=void 0},t.prototype.write=function(e){var n=typeof e=="string"?Buffer.from(e,this._encoding):Buffer.from(e);n.byteLength!==0&&(this._writeQueue.push({buffer:n,offset:0}),this._writeQueue.length===1&&this._processWriteQueue())},t.prototype._processWriteQueue=function(){var e=this;if(this._writeImmediate=void 0,this._writeQueue.length!==0){var n=this._writeQueue[0];pgs.write(this._fd,n.buffer,n.offset,function(r,o){if(r){"code"in r&&r.code==="EAGAIN"?e._writeImmediate=setImmediate(function(){return e._processWriteQueue()}):(e._writeQueue.length=0,console.error("Unhandled pty write error",r));return}n.offset+=o,n.offset>=n.buffer.byteLength&&e._writeQueue.shift(),e._processWriteQueue()})}},t})()});var Qsr=H(dF=>{"use strict";Object.defineProperty(dF,"__esModule",{value:!0});dF.native=dF.open=dF.createTerminal=dF.fork=dF.spawn=void 0;var ygs=YVe(),ehe;process.platform==="win32"?ehe=Ysr().WindowsTerminal:ehe=Fsr().UnixTerminal;function fgs(t,e,n){return new ehe(t,e,n)}dF.spawn=fgs;function Zgs(t,e,n){return new ehe(t,e,n)}dF.fork=Zgs;function Egs(t,e,n){return new ehe(t,e,n)}dF.createTerminal=Egs;function Wgs(t){return ehe.open(t)}dF.open=Wgs;dF.native=process.platform!=="win32"?ygs.loadNativeModule("pty").module:null});var g4,QVe=R(()=>{"use strict";g4=async t=>new Promise(e=>setTimeout(e,t))});import{exec as Rgs,spawn as wgs}from"child_process";import{promisify as vgs}from"util";async function Cgs(t,e,n){await t;let r=128,o=100;for(let s=0;s<n.length;s+=r){let l=n.substring(s,s+r);try{e.write(l)}catch{break}await new Promise(a=>setTimeout(a,o))}}var ksr,xsr,O7e,_7e,Ite,Hsr,Ygs,Xsr,M7e,Ssr=R(()=>{"use strict";ksr=nt(fsr(),1),xsr=nt(Qsr(),1);Bz();cr();QVe();x7e();au();LV();O7e="___BEGIN___COMMAND_OUTPUT_MARKER___",_7e=`
|
|
1868
1868
|
${O7e}
|
|
1869
|
-
`,Ite="___BEGIN___COMMAND_DONE_MARKER___",Hsr=new RegExp(`${Ite}(\\d+)`),Ygs=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,Xsr=5e3,M7e=class t{constructor(e,n,r={},o){this.config=e;this.largeOutputOptions=o??CD(),this.outputBuffer=this.createOutputBuffer(),this.createdAtMs=Date.now(),this.lastUsedAtMs=Date.now();let s=this.config.shellType==="powershell";s&&(r={...r,POWERSHELL_UPDATECHECK:"Off"});let l=s?"pwsh.exe":"bash",a=s?["-nop","-nol","-noe","-c","Set-PSReadLineOption -HistorySaveStyle SaveNothing"]:["--norc","--noprofile"],c=120,I=80;this.process=(0,xsr.spawn)(l,a,{name:"xterm-color",cols:c,rows:I,cwd:n,env:r}),this.terminal=new ksr.Terminal({cols:c,rows:I}),this.terminal.onData(d=>{try{this.process?.write(d)}catch{}}),this.process.onData(d=>{try{this.terminal?.write(d);let m=ty(d.replace(Ygs,"")).replaceAll("\r","");this.outputBuffer.append(m)}catch{}}),this.process.onExit(d=>this.shutdown())}process;terminal;outputBuffer;largeOutputOptions;get outputBufferLength(){return this.outputBuffer.length}isCommandInProgress=!1;createdAtMs;lastUsedAtMs;onPartialOutputChanged;static shellIsSupportedCache=new Map;writeDelay=Promise.resolve();static async create(e,n,r={},o){await t.ensureShellIsSupported(e.shellType);let s=new t(e,n,r,o);try{await s.initializeShellEnvironment()}catch(l){throw s.shutdown(),l}return s}setPartialOutputChangedCallback(e){this.onPartialOutputChanged=e}async executeCommand(e,n,r){if(this.updateLastUsedTime(),!this.process)throw new Error(`Failed to start ${this.config.shellType} process`);if(this.tryStartCommand(e))return await(n?this.waitForCommandCompletionOrTimeout(n,r):this.waitForCommandCompletion(r))}async cwd(){try{let e=this.config.shellType==="powershell"?"(pwd).Path":"pwd",n=await this.executeCommand(e,Xsr);return n?.exitCode===0?n.output:void 0}catch{return}}async tryExecuteAsyncCommand(e){return this.updateLastUsedTime(),this.tryStartCommand(e)?(this.waitForCommandCompletion().catch(n=>{}),this.config.shellType==="powershell"&&await new Promise(n=>setTimeout(n,250)),!0):!1}async tryExecuteDetachedCommand(e,n){return this.updateLastUsedTime(),this.isCommandInProgress?!1:process.platform==="win32"?this.tryExecuteDetachedCommandWindows(e,n):this.tryExecuteDetachedCommandUnix(e,n)}async tryExecuteDetachedCommandWindows(e,n){if(!(this.config.shellType==="powershell"))throw new Error("Only PowerShell is supported for detached commands on Windows");try{let o=e.replace(/"/g,'""'),s=n.replace(/\\/g,"\\\\"),I=`Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile","-Command","${"`$PID | Out-File -FilePath '"+n.replace(/\.log$/,".pid").replace(/\\/g,"\\\\")+"' -Encoding ascii; "+o} *>> '${s}' 2>&1" -WindowStyle Hidden`;return wgs("pwsh.exe",["-NoProfile","-Command",I],{stdio:"ignore",cwd:await this.cwd(),windowsHide:!0,env:{...process.env,POWERSHELL_UPDATECHECK:"Off"}}).unref(),this.isCommandInProgress=!0,this.outputBuffer.set(`${_7e}<command detached, output redirected to ${n}>
|
|
1869
|
+
`,Ite="___BEGIN___COMMAND_DONE_MARKER___",Hsr=new RegExp(`${Ite}(\\d+)`),Ygs=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,Xsr=5e3,M7e=class t{constructor(e,n,r={},o){this.config=e;this.largeOutputOptions=o??CD(),this.outputBuffer=this.createOutputBuffer(),this.createdAtMs=Date.now(),this.lastUsedAtMs=Date.now();let s=this.config.shellType==="powershell";s&&(r={...r,POWERSHELL_UPDATECHECK:"Off"});let l=s?"pwsh.exe":"bash",a=s?["-nop","-nol","-noe","-c","Set-PSReadLineOption -HistorySaveStyle SaveNothing"]:["--norc","--noprofile"],c=120,I=80;this.process=(0,xsr.spawn)(l,a,{name:"xterm-color",cols:c,rows:I,cwd:n,env:r}),this.terminal=new ksr.Terminal({cols:c,rows:I,scrollback:0}),this.terminal.onData(d=>{try{this.process?.write(d)}catch{}}),this.process.onData(d=>{try{this.terminal?.write(d);let m=ty(d.replace(Ygs,"")).replaceAll("\r","");this.outputBuffer.append(m)}catch{}}),this.process.onExit(d=>this.shutdown())}process;terminal;outputBuffer;largeOutputOptions;get outputBufferLength(){return this.outputBuffer.length}isCommandInProgress=!1;createdAtMs;lastUsedAtMs;onPartialOutputChanged;static shellIsSupportedCache=new Map;writeDelay=Promise.resolve();static async create(e,n,r={},o){await t.ensureShellIsSupported(e.shellType);let s=new t(e,n,r,o);try{await s.initializeShellEnvironment()}catch(l){throw s.shutdown(),l}return s}setPartialOutputChangedCallback(e){this.onPartialOutputChanged=e}async executeCommand(e,n,r){if(this.updateLastUsedTime(),!this.process)throw new Error(`Failed to start ${this.config.shellType} process`);if(this.tryStartCommand(e))return await(n?this.waitForCommandCompletionOrTimeout(n,r):this.waitForCommandCompletion(r))}async cwd(){try{let e=this.config.shellType==="powershell"?"(pwd).Path":"pwd",n=await this.executeCommand(e,Xsr);return n?.exitCode===0?n.output:void 0}catch{return}}async tryExecuteAsyncCommand(e){return this.updateLastUsedTime(),this.tryStartCommand(e)?(this.waitForCommandCompletion().catch(n=>{}),this.config.shellType==="powershell"&&await new Promise(n=>setTimeout(n,250)),!0):!1}async tryExecuteDetachedCommand(e,n){return this.updateLastUsedTime(),this.isCommandInProgress?!1:process.platform==="win32"?this.tryExecuteDetachedCommandWindows(e,n):this.tryExecuteDetachedCommandUnix(e,n)}async tryExecuteDetachedCommandWindows(e,n){if(!(this.config.shellType==="powershell"))throw new Error("Only PowerShell is supported for detached commands on Windows");try{let o=e.replace(/"/g,'""'),s=n.replace(/\\/g,"\\\\"),I=`Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile","-Command","${"`$PID | Out-File -FilePath '"+n.replace(/\.log$/,".pid").replace(/\\/g,"\\\\")+"' -Encoding ascii; "+o} *>> '${s}' 2>&1" -WindowStyle Hidden`;return wgs("pwsh.exe",["-NoProfile","-Command",I],{stdio:"ignore",cwd:await this.cwd(),windowsHide:!0,env:{...process.env,POWERSHELL_UPDATECHECK:"Off"}}).unref(),this.isCommandInProgress=!0,this.outputBuffer.set(`${_7e}<command detached, output redirected to ${n}>
|
|
1870
1870
|
${Ite}0`),this.isCommandInProgress=!1,!0}catch{return!1}}tryExecuteDetachedCommandUnix(e,n){if(!this.process)throw new Error(`Failed to start ${this.config.shellType} process`);if(this.isCommandInProgress)return!1;this.isCommandInProgress=!0;let r=e.replace(/'/g,"'\\''"),o=n.replace(/\.log$/,".pid"),s=m=>`'${m.replace(/'/g,"'\\''")}'`,l=m=>m.replace(/["\\$`]/g,p=>`\\${p}`),a=s(o),c=s(n),I=l(n),d=`echo $$ > ${a}; ${r}`,u=`
|
|
1871
1871
|
{
|
|
1872
1872
|
echo ${O7e}
|
|
@@ -3073,7 +3073,7 @@ ${a}`}}}let r=await t.workspace.listCheckpoints();if(r.length===0)return{kind:"a
|
|
|
3073
3073
|
`)}}}if(n==="plan"){if(!t.workspace)return{kind:"add-timeline-entry",entry:{type:"info",text:"Workspace features are not enabled for this session."}};let r=await t.workspace.readPlan();return r?{kind:"add-timeline-entry",entry:{type:"info",text:`Session Plan
|
|
3074
3074
|
${"\u2500".repeat(40)}
|
|
3075
3075
|
${r}`}}:{kind:"add-timeline-entry",entry:{type:"info",text:"No plan exists for this session."}}}if(n==="rename"){if(!t.workspace)return{kind:"add-timeline-entry",entry:{type:"info",text:"Workspace features are not enabled for this session."}};let r=e.slice(1).join(" ").trim();return r?r.length>100?{kind:"add-timeline-entry",entry:{type:"error",text:"Session name must be 100 characters or less."}}:(await t.workspace.renameSession(r),{kind:"add-timeline-entry",entry:{type:"info",text:`Session renamed to: ${r}`}}):{kind:"add-timeline-entry",entry:{type:"error",text:`Usage: /session rename <name>
|
|
3076
|
-
Example: /session rename Building e-commerce platform`}}}return n==="prune"?t.featureFlags.SESSION_CLEANUP?rJs(t,e.slice(1)):B$t(e[0],t.featureFlags.SESSION_CLEANUP):n==="cleanup"&&t.featureFlags.SESSION_CLEANUP?oJs(t,e.slice(1)):B$t(e[0],t.featureFlags.SESSION_CLEANUP)};nFr={name:qlt,args:"[checkpoints [n]|files|plan|rename <name>]",help:"Show session info and workspace summary. Use subcommands for details.",allowDuringAgentExecution:!0,execute:async(t,e)=>tFr(t,e)},rFr={name:zlt,args:"<name>",help:"Rename the current session (alias for /session rename)",allowDuringAgentExecution:!0,execute:async(t,e)=>tFr(t,["rename",...e])}});var lFr={};Zc(lFr,{fetchLatestRelease:()=>dke,fetchReleaseByTag:()=>lJs,getUpdateChannel:()=>qge,getVersion:()=>Ike,getVersionWithoutUpdateCheck:()=>T$t,isPrerelease:()=>sFr,showVersionWithUpdateCheck:()=>_$t});function Ike(){return"0.0.412-
|
|
3076
|
+
Example: /session rename Building e-commerce platform`}}}return n==="prune"?t.featureFlags.SESSION_CLEANUP?rJs(t,e.slice(1)):B$t(e[0],t.featureFlags.SESSION_CLEANUP):n==="cleanup"&&t.featureFlags.SESSION_CLEANUP?oJs(t,e.slice(1)):B$t(e[0],t.featureFlags.SESSION_CLEANUP)};nFr={name:qlt,args:"[checkpoints [n]|files|plan|rename <name>]",help:"Show session info and workspace summary. Use subcommands for details.",allowDuringAgentExecution:!0,execute:async(t,e)=>tFr(t,e)},rFr={name:zlt,args:"<name>",help:"Rename the current session (alias for /session rename)",allowDuringAgentExecution:!0,execute:async(t,e)=>tFr(t,["rename",...e])}});var lFr={};Zc(lFr,{fetchLatestRelease:()=>dke,fetchReleaseByTag:()=>lJs,getUpdateChannel:()=>qge,getVersion:()=>Ike,getVersionWithoutUpdateCheck:()=>T$t,isPrerelease:()=>sFr,showVersionWithUpdateCheck:()=>_$t});function Ike(){return"0.0.412-1"}function sFr(){try{let t=(0,tat.parse)("0.0.412-1");return t!==null&&t.prerelease.length>0}catch{return!1}}function qge(t,e){return t||(e||sFr()?"prerelease":"stable")}function T$t(){return`GitHub Copilot CLI ${zp().version}.
|
|
3077
3077
|
Run 'copilot update' to check for updates.`}async function _$t(t){let e=zp();process.stdout.write(`GitHub Copilot CLI ${e.version}
|
|
3078
3078
|
`);let n=qge(t.update_channel,t.staff),r=await dke(n);if("error"in r){process.stderr.write(`
|
|
3079
3079
|
Unable to check for updates: ${String(r.error)}
|
|
@@ -3731,8 +3731,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
3731
3731
|
`).replace(/\r/g,`
|
|
3732
3732
|
`);return!t.text.trimStart().startsWith("/")&&(ae.paste||ce.length>=zsn)?(C(ce),!0):d.current||u.current?ae.return?(w(),!1):ce?(C(ce),!0):(w(),!1):!1},[w]),X=(0,Im.useCallback)(de=>{(d.current||u.current)&&w();let ae=de??t.text,ce=G(ae);if(ce===ae){let he=l.current,K=a.current,$=he.slice(0,K),ne=he.slice(K);s.current!==null&&ae===he&&(ce=`${$}${s.current}${ne}`)}return g(),ce},[t,G,g,w]),k=(0,Im.useCallback)(()=>{(d.current||u.current)&&w(),g()},[g,w]),S=(0,Im.useMemo)(()=>[{pattern:new RegExp(l6r.source,"g"),isTracked:de=>{let ae=de.match(/\[Paste #(\d+)/);return ae?r.current.has(Number(ae[1])):!1}},{pattern:new RegExp(i6r.source,"g"),isTracked:de=>{let ae=de.match(/id=(\d+)\]$/);return ae?o.current.has(Number(ae[1])):!1}}],[]),U=(0,Im.useCallback)(de=>{let ae=de.match(/\[Paste #(\d+)/);if(ae){r.current.delete(Number(ae[1]));return}let ce=de.match(/id=(\d+)\]$/);ce&&o.current.delete(Number(ce[1]))},[]),q=(0,Im.useCallback)((de,ae,ce)=>Jdt(de,ae,S,ce,U),[S,U]),re=(0,Im.useCallback)((de,ae,ce)=>Bdt(de,ae,S,ce,U),[S,U]),_=(0,Im.useCallback)((de,ae)=>Tdt(de,ae,S),[S]),D=(0,Im.useCallback)((de,ae)=>_dt(de,ae,S),[S]);return(0,Im.useMemo)(()=>({processInput:Q,expandTokens:X,cleanup:k,handleBackspaceIntoPasteToken:q,handleDeleteIntoPasteToken:re,handleLeftArrowIntoPasteToken:_,handleRightArrowIntoPasteToken:D}),[Q,X,k,q,re,_,D])};var gll=(t,e={})=>{let{stdin:n,setRawMode:r,internal_exitOnCtrlC:o,internal_eventEmitter:s}=WL(),{stdout:l}=qa(),a=e.isKittyProtocolEnabled??JF();(0,Psn.useEffect)(()=>{if(e.isActive===!1)return;r(!0);let c=l.isTTY===!0;return c&&l?.write("\x1B[?2004h"),()=>{c&&l?.write("\x1B[?2004l"),r(!1)}},[e.isActive,r,l]),(0,Psn.useEffect)(()=>{if(e.isActive===!1)return;let c=(G,g)=>{let y=a?KPr(G):_sn(G),Z=xdt.includes(y.name),E={upArrow:y.name==="up"||y.ctrl&&y.name==="p",downArrow:y.name==="down"||y.ctrl&&y.name==="n",leftArrow:y.name==="left",rightArrow:y.name==="right",pageDown:y.name==="pagedown",pageUp:y.name==="pageup",return:y.name==="return",escape:y.name==="escape",ctrl:y.ctrl,shift:y.shift,tab:y.name==="tab",backspace:y.name==="backspace",delete:y.name==="delete",meta:y.meta||y.name==="escape"||y.option,home:y.name==="home",end:y.name==="end",paste:g},w=y.ctrl?y.name:y.sequence;Z&&(w=""),g&&(w=w.replace(/\u001B\[200~/g,"").replace(/\u001B\[201~/g,"")),w=w.replace(/\u001B\[[IO]/g,""),w.startsWith("\x1B[")&&!Z?w="":w.startsWith("\x1B")&&(w=w.slice(1)),G===`
|
|
3733
3733
|
`&&(w=`
|
|
3734
|
-
`,E.return=!1,E.paste=!1),w.length===1&&typeof w[0]=="string"&&/[A-Z]/.test(w[0])&&(E.shift=!0),(!(w==="c"&&E.ctrl)||!o)&&(t(w,E),t6r())},I=!1,d,u="",m,p=!1,h=G=>{
|
|
3735
|
-
`)&&G.length>1){c(G,!0),y&&(I=!1,clearTimeout(d));return}let E=G.match(/\x1b\[[^a-zA-Z~]*[a-zA-Z~]|\x1b.|\\[\r\n]|[\x00-\x1f\x7f]|[^\x00-\x1f\x7f\x1b]+/gs)??[G];for(let w of E)c(w,!1)};return s?.on("input",h),()=>{s?.removeListener("input",h),clearTimeout(d),clearTimeout(m)}},[e.isActive,n,o,t,s,a])},qo=gll;var w0e=nt(Lt(),1);var Mdt={compact:80,narrow:100,wide:120};function Udt(t){return t<Mdt.compact?"compact":t>=Mdt.compact&&t<Mdt.wide?"narrow":"wide"}function yoe(){let{columns:t}=f0e();return{terminalWidth:t,breakpoint:Udt(t),isCompact:Udt(t)=="compact",isNarrow:Udt(t)=="narrow",isWide:Udt(t)=="wide"}}Uge();function dm(){let{themePreference:t,hasDarkTerminalBackground:e}=Nn(),n=nke(t,e);return G$t(n)}var jsn=nt(Lt(),1);var All="\u2192",Nll="\u2190",yll="\u2191",fll="\u2193";var Zll="\u2219",Ell="\u25C9",Wll="\u25CE";var Rll="\u258B",wll="[ ]",vll="[\u2713]";var Yll="\xB7",Cll="\u2022";var Vll="\u2514",Fll="\u251C",Qll="\u2502";var Au={CIRCLE_FILLED:"\u25CF",CIRCLE_HALF:"\u25D0",CIRCLE_EMPTY:"\u25CB",CROSS:"\u2717",CHECK:"\u2713",WARNING:"!",DISABLED:"\u2298",CHEVRON_RIGHT:"\u276F",ARROW_RIGHT:All,ARROW_LEFT:Nll,ARROW_UP:yll,ARROW_DOWN:fll,SPINNER_DOT:Zll,SPINNER_FILLED:Ell,SPINNER_RING:Wll,SCROLLBAR:Rll,CHECKBOX_UNCHECKED:wll,CHECKBOX_CHECKED:vll,DOT_SEPARATOR:Yll,BULLET:Cll,CHILD_LAST:Vll,CHILD_MIDDLE:Fll,CHILD_SKIP:Qll};function X2(t,e){let n=({label:r,decorative:o,color:s})=>{let l=r??e,a=o??l==="";return jsn.default.createElement(J,{color:s,"aria-label":a?void 0:l,"aria-hidden":a},t)};return n.displayName=`Icon(${e||"decorative"})`,n}function oSe(t,e,n){let r=({label:o,decorative:s,...l})=>{let a=dm(),c=o??e,I=s??c==="",d=l.colored?a[n]:l.color;return jsn.default.createElement(J,{color:d,"aria-label":I?void 0:c,"aria-hidden":I},t)};return r.displayName=`Icon(${e||"decorative"})`,r}var gy=oSe(Au.CHECK,"Success","statusSuccess"),fg=oSe(Au.CROSS,"Error","statusError"),Ddt=oSe(Au.WARNING,"Warning","statusWarning"),sSe=oSe(Au.CIRCLE_FILLED,"Completed","statusInfo"),QL=X2(Au.CHEVRON_RIGHT,"Prompt"),c6r=X2(Au.CIRCLE_HALF,"In progress"),I6r=X2(Au.CIRCLE_EMPTY,"Empty"),zdt=oSe(Au.DISABLED,"Disabled","textSecondary"),d6r=X2(Au.ARROW_RIGHT,"Keyboard Right"),u6r=X2(Au.ARROW_LEFT,"Keyboard Left"),m6r=X2(Au.ARROW_UP,"Keyboard Up"),p6r=X2(Au.ARROW_DOWN,"Keyboard Down"),h6r=X2(Au.SCROLLBAR,""),b6r=X2(Au.CHECKBOX_CHECKED,"Checked"),G6r=X2(Au.CHECKBOX_UNCHECKED,"Unchecked"),g6r=X2(Au.DOT_SEPARATOR,""),A6r=X2(Au.BULLET,""),N6r=X2(Au.CHILD_LAST,""),y6r=X2(Au.CHILD_MIDDLE,""),f6r=X2(Au.CHILD_SKIP,"");var hp=nt(Lt(),1);var mw=nt(Lt(),1);import{isDeepStrictEqual as Bll}from"node:util";function foe(t,e){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);if(!Number.isSafeInteger(e))throw new TypeError(`The \`steps\` parameter must be an integer, got ${e}.`);let{length:n}=t;if(n===0)return[...t];let r=(e%n+n)%n;return r===0?[...t]:[...t.slice(-r),...t.slice(0,-r)]}import Z6r from"node:process";function Ksn(){let{env:t}=Z6r,{TERM:e,TERM_PROGRAM:n}=t;return Z6r.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var E6r={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},W6r={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Hll={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Xll={...E6r,...W6r},kll={...E6r,...Hll},xll=Ksn(),Sll=xll?Xll:kll,Zg=Sll,A8a=Object.entries(W6r);var Pdt=nt(Lt(),1);function Lll({isSelected:t=!1}){return Pdt.default.createElement(se,{marginRight:1},t?Pdt.default.createElement(J,{color:"blue"},Zg.pointer):Pdt.default.createElement(J,null," "))}var R6r=Lll;var w6r=nt(Lt(),1);function Jll({isSelected:t=!1,label:e}){return w6r.createElement(J,{color:t?"blue":void 0},e)}var v6r=Jll;function Tll({items:t=[],isFocused:e=!0,initialIndex:n=0,indicatorComponent:r=R6r,itemComponent:o=v6r,limit:s,onSelect:l,onHighlight:a}){let c=typeof s=="number"&&t.length>s,I=c?Math.min(s,t.length):t.length,d=I-1,[u,m]=(0,mw.useState)(n>d?d-n:0),[p,h]=(0,mw.useState)(n?n>d?d:n:0),G=(0,mw.useRef)(t);(0,mw.useEffect)(()=>{Bll(G.current.map(y=>y.value),t.map(y=>y.value))||(m(0),h(0)),G.current=t},[t]),qo((0,mw.useCallback)((y,Z)=>{if(y==="k"||Z.upArrow){let E=(c?I:t.length)-1,w=p===0,v=c?p:E,C=w?u+1:u,Q=w?v:p-1;m(C),h(Q);let X=c?foe(t,C).slice(0,I):t;typeof a=="function"&&a(X[Q])}if(y==="j"||Z.downArrow){let E=p===(c?I:t.length)-1,w=c?p:0,v=E?u-1:u,C=E?w:p+1;m(v),h(C);let Q=c?foe(t,v).slice(0,I):t;typeof a=="function"&&a(Q[C])}if(/^[1-9]$/.test(y)){let E=Number.parseInt(y,10)-1,w=c?foe(t,u).slice(0,I):t;if(E>=0&&E<w.length){let v=w[E];v&&l?.(v)}}if(Z.return){let E=c?foe(t,u).slice(0,I):t;typeof l=="function"&&l(E[p])}},[c,I,u,p,t,l,a]),{isActive:e});let g=c?foe(t,u).slice(0,I):t;return mw.default.createElement(se,{flexDirection:"column"},g.map((y,Z)=>{let E=Z===p;return mw.default.createElement(se,{key:y.key??y.value},mw.default.createElement(r,{isSelected:E}),mw.default.createElement(o,{...y,isSelected:E}))}))}var jdt=Tll;uL();var P0=nt(Lt(),1);var Kdt=nt(Lt(),1),_ll="\x1B[?1004h",Oll="\x1B[?1004l",Mll="\x1B[I",Ull="\x1B[O";function qdt(){let[t,e]=(0,Kdt.useState)(!0),{stdout:n}=qa(),{internal_eventEmitter:r}=WL();return(0,Kdt.useEffect)(()=>{let o=n?.isTTY===!0;o&&n.write(_ll);let s=l=>{l.includes(Mll)?e(!0):l.includes(Ull)&&e(!1)};return r?.on("input",s),()=>{r?.removeListener("input",s),o&&n.write(Oll)}},[n,r]),t}var F_=nt(Lt(),1);var vj=t=>/\s/.test(t);function Dll(t,e){if(e>=t.length)return t.length;let n=e;for(;n<t.length&&vj(t[n]);)n+=t[n].length;for(;n<t.length&&!vj(t[n]);)n+=t[n].length;return n}function Y6r(t,e){if(e===0)return 0;let n=e-1;for(;n>=0&&vj(t[n]);)n-=t[n].length;if(n<0)return 0;for(;n>=0&&!vj(t[n]);)n-=t[n].length;return n+1}function zll(t,e){if(e>=t.length)return t.length;let n=e;for(;n<t.length&&!vj(t[n]);)n+=t[n].length;for(;n<t.length&&vj(t[n]);)n+=t[n].length;return n}function Zoe(t,e){if(e<=0)return[t];let n=t.split(`
|
|
3734
|
+
`,E.return=!1,E.paste=!1),w.length===1&&typeof w[0]=="string"&&/[A-Z]/.test(w[0])&&(E.shift=!0),(!(w==="c"&&E.ctrl)||!o)&&(t(w,E),t6r())},I=!1,d,u="",m,p=!1,h=G=>{let g=u.length>0;g&&(G=u+G,u="",clearTimeout(m)),G=G.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)?/g,"");let y=G;if(G=G.replace(/(?:\x1b\[)?<\d[\d;]*[Mm]/g,""),(g||G!==y)&&(G=G.replace(/;?\d+(?:;\d+)+[Mm]/g,""),G=G.replace(/;\d+[Mm]/g,"")),!p){let C=G.match(/(?:\x1b\[)?<[\d;]*$/)??G.match(/\x1b\[$/);C&&(u=C[0],G=G.slice(0,-u.length),m=setTimeout(()=>{if(u.length>0){let Q=u;u="",p=!0,h(Q),p=!1}},50))}if(G.length===0)return;let Z=G.includes("\x1B[200~"),E=G.includes("\x1B[201~");if(Z&&(I=!0,clearTimeout(d),d=setTimeout(()=>I=!1,5e3)),I||G.length>=zsn||G.includes(`
|
|
3735
|
+
`)&&G.length>1){c(G,!0),E&&(I=!1,clearTimeout(d));return}let v=G.match(/\x1b\[[^a-zA-Z~]*[a-zA-Z~]|\x1b.|\\[\r\n]|[\x00-\x1f\x7f]|[^\x00-\x1f\x7f\x1b]+/gs)??[G];for(let C of v)c(C,!1)};return s?.on("input",h),()=>{s?.removeListener("input",h),clearTimeout(d),clearTimeout(m)}},[e.isActive,n,o,t,s,a])},qo=gll;var w0e=nt(Lt(),1);var Mdt={compact:80,narrow:100,wide:120};function Udt(t){return t<Mdt.compact?"compact":t>=Mdt.compact&&t<Mdt.wide?"narrow":"wide"}function yoe(){let{columns:t}=f0e();return{terminalWidth:t,breakpoint:Udt(t),isCompact:Udt(t)=="compact",isNarrow:Udt(t)=="narrow",isWide:Udt(t)=="wide"}}Uge();function dm(){let{themePreference:t,hasDarkTerminalBackground:e}=Nn(),n=nke(t,e);return G$t(n)}var jsn=nt(Lt(),1);var All="\u2192",Nll="\u2190",yll="\u2191",fll="\u2193";var Zll="\u2219",Ell="\u25C9",Wll="\u25CE";var Rll="\u258B",wll="[ ]",vll="[\u2713]";var Yll="\xB7",Cll="\u2022";var Vll="\u2514",Fll="\u251C",Qll="\u2502";var Au={CIRCLE_FILLED:"\u25CF",CIRCLE_HALF:"\u25D0",CIRCLE_EMPTY:"\u25CB",CROSS:"\u2717",CHECK:"\u2713",WARNING:"!",DISABLED:"\u2298",CHEVRON_RIGHT:"\u276F",ARROW_RIGHT:All,ARROW_LEFT:Nll,ARROW_UP:yll,ARROW_DOWN:fll,SPINNER_DOT:Zll,SPINNER_FILLED:Ell,SPINNER_RING:Wll,SCROLLBAR:Rll,CHECKBOX_UNCHECKED:wll,CHECKBOX_CHECKED:vll,DOT_SEPARATOR:Yll,BULLET:Cll,CHILD_LAST:Vll,CHILD_MIDDLE:Fll,CHILD_SKIP:Qll};function X2(t,e){let n=({label:r,decorative:o,color:s})=>{let l=r??e,a=o??l==="";return jsn.default.createElement(J,{color:s,"aria-label":a?void 0:l,"aria-hidden":a},t)};return n.displayName=`Icon(${e||"decorative"})`,n}function oSe(t,e,n){let r=({label:o,decorative:s,...l})=>{let a=dm(),c=o??e,I=s??c==="",d=l.colored?a[n]:l.color;return jsn.default.createElement(J,{color:d,"aria-label":I?void 0:c,"aria-hidden":I},t)};return r.displayName=`Icon(${e||"decorative"})`,r}var gy=oSe(Au.CHECK,"Success","statusSuccess"),fg=oSe(Au.CROSS,"Error","statusError"),Ddt=oSe(Au.WARNING,"Warning","statusWarning"),sSe=oSe(Au.CIRCLE_FILLED,"Completed","statusInfo"),QL=X2(Au.CHEVRON_RIGHT,"Prompt"),c6r=X2(Au.CIRCLE_HALF,"In progress"),I6r=X2(Au.CIRCLE_EMPTY,"Empty"),zdt=oSe(Au.DISABLED,"Disabled","textSecondary"),d6r=X2(Au.ARROW_RIGHT,"Keyboard Right"),u6r=X2(Au.ARROW_LEFT,"Keyboard Left"),m6r=X2(Au.ARROW_UP,"Keyboard Up"),p6r=X2(Au.ARROW_DOWN,"Keyboard Down"),h6r=X2(Au.SCROLLBAR,""),b6r=X2(Au.CHECKBOX_CHECKED,"Checked"),G6r=X2(Au.CHECKBOX_UNCHECKED,"Unchecked"),g6r=X2(Au.DOT_SEPARATOR,""),A6r=X2(Au.BULLET,""),N6r=X2(Au.CHILD_LAST,""),y6r=X2(Au.CHILD_MIDDLE,""),f6r=X2(Au.CHILD_SKIP,"");var hp=nt(Lt(),1);var mw=nt(Lt(),1);import{isDeepStrictEqual as Bll}from"node:util";function foe(t,e){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);if(!Number.isSafeInteger(e))throw new TypeError(`The \`steps\` parameter must be an integer, got ${e}.`);let{length:n}=t;if(n===0)return[...t];let r=(e%n+n)%n;return r===0?[...t]:[...t.slice(-r),...t.slice(0,-r)]}import Z6r from"node:process";function Ksn(){let{env:t}=Z6r,{TERM:e,TERM_PROGRAM:n}=t;return Z6r.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var E6r={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},W6r={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Hll={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Xll={...E6r,...W6r},kll={...E6r,...Hll},xll=Ksn(),Sll=xll?Xll:kll,Zg=Sll,A8a=Object.entries(W6r);var Pdt=nt(Lt(),1);function Lll({isSelected:t=!1}){return Pdt.default.createElement(se,{marginRight:1},t?Pdt.default.createElement(J,{color:"blue"},Zg.pointer):Pdt.default.createElement(J,null," "))}var R6r=Lll;var w6r=nt(Lt(),1);function Jll({isSelected:t=!1,label:e}){return w6r.createElement(J,{color:t?"blue":void 0},e)}var v6r=Jll;function Tll({items:t=[],isFocused:e=!0,initialIndex:n=0,indicatorComponent:r=R6r,itemComponent:o=v6r,limit:s,onSelect:l,onHighlight:a}){let c=typeof s=="number"&&t.length>s,I=c?Math.min(s,t.length):t.length,d=I-1,[u,m]=(0,mw.useState)(n>d?d-n:0),[p,h]=(0,mw.useState)(n?n>d?d:n:0),G=(0,mw.useRef)(t);(0,mw.useEffect)(()=>{Bll(G.current.map(y=>y.value),t.map(y=>y.value))||(m(0),h(0)),G.current=t},[t]),qo((0,mw.useCallback)((y,Z)=>{if(y==="k"||Z.upArrow){let E=(c?I:t.length)-1,w=p===0,v=c?p:E,C=w?u+1:u,Q=w?v:p-1;m(C),h(Q);let X=c?foe(t,C).slice(0,I):t;typeof a=="function"&&a(X[Q])}if(y==="j"||Z.downArrow){let E=p===(c?I:t.length)-1,w=c?p:0,v=E?u-1:u,C=E?w:p+1;m(v),h(C);let Q=c?foe(t,v).slice(0,I):t;typeof a=="function"&&a(Q[C])}if(/^[1-9]$/.test(y)){let E=Number.parseInt(y,10)-1,w=c?foe(t,u).slice(0,I):t;if(E>=0&&E<w.length){let v=w[E];v&&l?.(v)}}if(Z.return){let E=c?foe(t,u).slice(0,I):t;typeof l=="function"&&l(E[p])}},[c,I,u,p,t,l,a]),{isActive:e});let g=c?foe(t,u).slice(0,I):t;return mw.default.createElement(se,{flexDirection:"column"},g.map((y,Z)=>{let E=Z===p;return mw.default.createElement(se,{key:y.key??y.value},mw.default.createElement(r,{isSelected:E}),mw.default.createElement(o,{...y,isSelected:E}))}))}var jdt=Tll;uL();var P0=nt(Lt(),1);var Kdt=nt(Lt(),1),_ll="\x1B[?1004h",Oll="\x1B[?1004l",Mll="\x1B[I",Ull="\x1B[O";function qdt(){let[t,e]=(0,Kdt.useState)(!0),{stdout:n}=qa(),{internal_eventEmitter:r}=WL();return(0,Kdt.useEffect)(()=>{let o=n?.isTTY===!0;o&&n.write(_ll);let s=l=>{l.includes(Mll)?e(!0):l.includes(Ull)&&e(!1)};return r?.on("input",s),()=>{r?.removeListener("input",s),o&&n.write(Oll)}},[n,r]),t}var F_=nt(Lt(),1);var vj=t=>/\s/.test(t);function Dll(t,e){if(e>=t.length)return t.length;let n=e;for(;n<t.length&&vj(t[n]);)n+=t[n].length;for(;n<t.length&&!vj(t[n]);)n+=t[n].length;return n}function Y6r(t,e){if(e===0)return 0;let n=e-1;for(;n>=0&&vj(t[n]);)n-=t[n].length;if(n<0)return 0;for(;n>=0&&!vj(t[n]);)n-=t[n].length;return n+1}function zll(t,e){if(e>=t.length)return t.length;let n=e;for(;n<t.length&&!vj(t[n]);)n+=t[n].length;for(;n<t.length&&vj(t[n]);)n+=t[n].length;return n}function Zoe(t,e){if(e<=0)return[t];let n=t.split(`
|
|
3736
3736
|
`).map(o=>o+" "),r=[];for(let o of n){if(o.length<=e){r.push(o);continue}let s=o;for(;s.length>e;){let l=e;if(vj(s.slice(0,e)))for(let c=e-1;c>=Math.max(0,e-20)&&!vj(s[c]);c--)l=c;let a=s.slice(0,l);r.push(a),s=s.slice(l)}s.length>0&&r.push(s)}return r}function W0e(t,e){if(e.length===0)return{line:0,column:0};let n=0;for(let o=0;o<e.length;o++){let s=e[o],l=n+s.length;if(t<l)return{line:o,column:t-n};n=l}let r=e.length-1;return{line:r,column:e[r].length}}function E0e(t,e,n,r){if(t.length===0)return 0;let o=0;for(let s=0;s<Math.min(e,t.length);s++)o+=t[s].length;return e<t.length?o+=Math.min(n,t[e].length):o=r.length,Math.min(o,r.length)}function Pll(t,e){switch(e.type){case"set_text":return{text:e.payload,cursorPosition:e.payload.length,width:t.width};case"set_cursor_position":return{...t,cursorPosition:Math.max(0,Math.min(e.payload,t.text.length))};case"set_cursor_line_position":{let{line:n,column:r}=e.payload,o=Zoe(t.text,t.width),s=E0e(o,n,r,t.text);return{...t,cursorPosition:s}}case"set_width":return t.width===e.payload?t:{...t,width:e.payload};case"insert_input":{let{text:n,cursorPosition:r}=t,{input:o,callback:s}=e.payload,l=o.replace(/\r\n/g,`
|
|
3737
3737
|
`).replace(/\r/g,`
|
|
3738
3738
|
`),a=n.slice(0,r),c=n.slice(r),I=a+l+c,d=r+l.length;return s?.(I),{text:I,cursorPosition:d,width:t.width}}case"backspace":return t.cursorPosition===0?t:{text:t.text.slice(0,t.cursorPosition-1)+t.text.slice(t.cursorPosition),cursorPosition:t.cursorPosition-1,width:t.width};case"forward_delete":{if(t.cursorPosition>=t.text.length)return t;let n=t.text.slice(0,t.cursorPosition)+t.text.slice(t.cursorPosition+1);return{...t,text:n}}case"backspace_word":{let{text:n,cursorPosition:r}=t;if(r===0)return t;let o=Y6r(n,r);return{text:n.slice(0,o)+n.slice(r),cursorPosition:o,width:t.width}}case"forward_delete_word":{let{text:n,cursorPosition:r}=t;if(r>=n.length)return t;let o=Dll(n,r),s=n.slice(0,r)+n.slice(o);return{...t,text:s}}case"move_word_left":{let{text:n,cursorPosition:r}=t;if(r===0)return t;let o=Y6r(n,r);return{...t,cursorPosition:o}}case"move_word_right":{let{text:n,cursorPosition:r}=t;if(r>=n.length)return t;let o=zll(n,r);return{...t,cursorPosition:o}}case"move_right":return t.cursorPosition===t.text.length?t:{...t,cursorPosition:t.cursorPosition+1};case"move_left":return t.cursorPosition===0?t:{...t,cursorPosition:t.cursorPosition-1};case"move_up":{let{text:n,cursorPosition:r,width:o}=t,s=Zoe(n,o),l=W0e(r,s);if(l.line>0){let a=l.line-1,c=Math.min(l.column,s[a].length-1),I=E0e(s,a,c,n);return{...t,cursorPosition:I}}return t}case"move_down":{let{text:n,cursorPosition:r,width:o}=t,s=Zoe(n,o),l=W0e(r,s);if(l.line<s.length-1){let a=l.line+1,c=Math.min(l.column,s[a].length-1),I=E0e(s,a,c,n);return{...t,cursorPosition:I}}return t}case"clear":return{text:"",cursorPosition:0,width:t.width};case"clear_before_cursor":{let{text:n,cursorPosition:r,width:o}=t,s=Zoe(n,o),l=W0e(r,s),a=E0e(s,l.line,0,n);return{text:n.slice(0,a)+n.slice(r),cursorPosition:a,width:o}}case"clear_after_cursor":{let{text:n,cursorPosition:r}=t,o=n.indexOf(`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github/copilot",
|
|
3
3
|
"description": "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.",
|
|
4
|
-
"version": "0.0.412-
|
|
4
|
+
"version": "0.0.412-1",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"conpty_console_list_agent.js"
|
|
42
42
|
],
|
|
43
43
|
"buildMetadata": {
|
|
44
|
-
"gitCommit": "
|
|
44
|
+
"gitCommit": "c46ea73"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
47
|
-
"@github/copilot-linux-x64": "0.0.412-
|
|
48
|
-
"@github/copilot-linux-arm64": "0.0.412-
|
|
49
|
-
"@github/copilot-darwin-x64": "0.0.412-
|
|
50
|
-
"@github/copilot-darwin-arm64": "0.0.412-
|
|
51
|
-
"@github/copilot-win32-x64": "0.0.412-
|
|
52
|
-
"@github/copilot-win32-arm64": "0.0.412-
|
|
47
|
+
"@github/copilot-linux-x64": "0.0.412-1",
|
|
48
|
+
"@github/copilot-linux-arm64": "0.0.412-1",
|
|
49
|
+
"@github/copilot-darwin-x64": "0.0.412-1",
|
|
50
|
+
"@github/copilot-darwin-arm64": "0.0.412-1",
|
|
51
|
+
"@github/copilot-win32-x64": "0.0.412-1",
|
|
52
|
+
"@github/copilot-win32-arm64": "0.0.412-1"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/sdk/index.js
CHANGED
|
@@ -2717,7 +2717,7 @@ ${o}`}}}let r=await t.workspace.listCheckpoints();if(r.length===0)return{kind:"a
|
|
|
2717
2717
|
`)}}}if(n==="plan"){if(!t.workspace)return{kind:"add-timeline-entry",entry:{type:"info",text:"Workspace features are not enabled for this session."}};let r=await t.workspace.readPlan();return r?{kind:"add-timeline-entry",entry:{type:"info",text:`Session Plan
|
|
2718
2718
|
${"\u2500".repeat(40)}
|
|
2719
2719
|
${r}`}}:{kind:"add-timeline-entry",entry:{type:"info",text:"No plan exists for this session."}}}if(n==="rename"){if(!t.workspace)return{kind:"add-timeline-entry",entry:{type:"info",text:"Workspace features are not enabled for this session."}};let r=e.slice(1).join(" ").trim();return r?r.length>100?{kind:"add-timeline-entry",entry:{type:"error",text:"Session name must be 100 characters or less."}}:(await t.workspace.renameSession(r),{kind:"add-timeline-entry",entry:{type:"info",text:`Session renamed to: ${r}`}}):{kind:"add-timeline-entry",entry:{type:"error",text:`Usage: /session rename <name>
|
|
2720
|
-
Example: /session rename Building e-commerce platform`}}}return n==="prune"?t.featureFlags.SESSION_CLEANUP?WYl(t,e.slice(1)):aht(e[0],t.featureFlags.SESSION_CLEANUP):n==="cleanup"&&t.featureFlags.SESSION_CLEANUP?gYl(t,e.slice(1)):aht(e[0],t.featureFlags.SESSION_CLEANUP)};d5n={name:a1e,args:"[checkpoints [n]|files|plan|rename <name>]",help:"Show session info and workspace summary. Use subcommands for details.",allowDuringAgentExecution:!0,execute:async(t,e)=>c5n(t,e)},u5n={name:s1e,args:"<name>",help:"Rename the current session (alias for /session rename)",allowDuringAgentExecution:!0,execute:async(t,e)=>c5n(t,["rename",...e])}});var p5n={};WI(p5n,{fetchLatestRelease:()=>h5n,fetchReleaseByTag:()=>RYl,getUpdateChannel:()=>b5n,getVersion:()=>NYl,getVersionWithoutUpdateCheck:()=>AYl,isPrerelease:()=>G5n,showVersionWithUpdateCheck:()=>yYl});function NYl(){return"0.0.412-
|
|
2720
|
+
Example: /session rename Building e-commerce platform`}}}return n==="prune"?t.featureFlags.SESSION_CLEANUP?WYl(t,e.slice(1)):aht(e[0],t.featureFlags.SESSION_CLEANUP):n==="cleanup"&&t.featureFlags.SESSION_CLEANUP?gYl(t,e.slice(1)):aht(e[0],t.featureFlags.SESSION_CLEANUP)};d5n={name:a1e,args:"[checkpoints [n]|files|plan|rename <name>]",help:"Show session info and workspace summary. Use subcommands for details.",allowDuringAgentExecution:!0,execute:async(t,e)=>c5n(t,e)},u5n={name:s1e,args:"<name>",help:"Rename the current session (alias for /session rename)",allowDuringAgentExecution:!0,execute:async(t,e)=>c5n(t,["rename",...e])}});var p5n={};WI(p5n,{fetchLatestRelease:()=>h5n,fetchReleaseByTag:()=>RYl,getUpdateChannel:()=>b5n,getVersion:()=>NYl,getVersionWithoutUpdateCheck:()=>AYl,isPrerelease:()=>G5n,showVersionWithUpdateCheck:()=>yYl});function NYl(){return"0.0.412-1"}function G5n(){try{let t=(0,Vfe.parse)("0.0.412-1");return t!==null&&t.prerelease.length>0}catch{return!1}}function b5n(t,e){return t||(e||G5n()?"prerelease":"stable")}function AYl(){return`GitHub Copilot CLI ${HD().version}.
|
|
2721
2721
|
Run 'copilot update' to check for updates.`}async function yYl(t){let e=HD();process.stdout.write(`GitHub Copilot CLI ${e.version}
|
|
2722
2722
|
`);let n=b5n(t.update_channel,t.staff),r=await h5n(n);if("error"in r){process.stderr.write(`
|
|
2723
2723
|
Unable to check for updates: ${String(r.error)}
|
|
@@ -3103,7 +3103,7 @@ ${j.join(`
|
|
|
3103
3103
|
`),{leaks:O,details:Ve}}}function b(f){return G?.trackDisposable(f),f}function Z(f){G?.markAsDisposed(f)}function W(f,Q){G?.setParent(f,Q)}function g(f){return typeof f=="object"&&f!==null&&typeof f.dispose=="function"&&f.dispose.length===0}function N(f){if(u.Iterable.is(f)){let Q=[];for(let B of f)if(B)try{B.dispose()}catch(O){Q.push(O)}if(Q.length===1)throw Q[0];if(Q.length>1)throw new AggregateError(Q,"Encountered errors while disposing of store");return Array.isArray(f)?[]:f}if(f)return f.dispose(),f}function A(f){let Q=b({dispose:(0,m.createSingleCallFunction)((()=>{Z(Q),f()}))});return Q}o.DisposableTracker=h;class Y{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,b(this)}dispose(){this._isDisposed||(Z(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{N(this._toDispose)}finally{this._toDispose.clear()}}add(Q){if(!Q)return Q;if(Q===this)throw new Error("Cannot register a disposable on itself!");return W(Q,this),this._isDisposed?Y.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(Q),Q}delete(Q){if(Q){if(Q===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(Q),Q.dispose()}}deleteAndLeak(Q){Q&&this._toDispose.has(Q)&&(this._toDispose.delete(Q),W(Q,null))}}o.DisposableStore=Y;class V{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Y,b(this),W(this._store,this)}dispose(){Z(this),this._store.dispose()}_register(Q){if(Q===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(Q)}}o.Disposable=V;class E{constructor(){this._isDisposed=!1,b(this)}get value(){return this._isDisposed?void 0:this._value}set value(Q){this._isDisposed||Q===this._value||(this._value?.dispose(),Q&&W(Q,this),this._value=Q)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Z(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let Q=this._value;return this._value=void 0,Q&&W(Q,null),Q}}o.MutableDisposable=E,o.MandatoryMutableDisposable=class{constructor(f){this._disposable=new E,this._isDisposed=!1,this._disposable.value=f}get value(){return this._disposable.value}set value(f){this._isDisposed||f===this._disposable.value||(this._disposable.value=f)}dispose(){this._isDisposed=!0,this._disposable.dispose()}},o.RefCountedDisposable=class{constructor(f){this._disposable=f,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter==0&&this._disposable.dispose(),this}},o.SafeDisposable=class{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,b(this)}set(f){let Q=f;return this.unset=()=>Q=void 0,this.isset=()=>Q!==void 0,this.dispose=()=>{Q&&(Q(),Q=void 0,Z(this))},this}},o.ReferenceCollection=class{constructor(){this.references=new Map}acquire(f,...Q){let B=this.references.get(f);B||(B={counter:0,object:this.createReferencedObject(f,...Q)},this.references.set(f,B));let{object:O}=B,J=(0,m.createSingleCallFunction)((()=>{--B.counter==0&&(this.destroyReferencedObject(f,B.object),this.references.delete(f))}));return B.counter++,{object:O,dispose:J}}},o.AsyncReferenceCollection=class{constructor(f){this.referenceCollection=f}async acquire(f,...Q){let B=this.referenceCollection.acquire(f,...Q);try{return{object:await B.object,dispose:()=>B.dispose()}}catch(O){throw B.dispose(),O}}},o.ImmortalReference=class{constructor(f){this.object=f}dispose(){}};class w{constructor(){this._store=new Map,this._isDisposed=!1,b(this)}dispose(){Z(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{N(this._store.values())}finally{this._store.clear()}}has(Q){return this._store.has(Q)}get size(){return this._store.size}get(Q){return this._store.get(Q)}set(Q,B,O=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),O||this._store.get(Q)?.dispose(),this._store.set(Q,B)}deleteAndDispose(Q){this._store.get(Q)?.dispose(),this._store.delete(Q)}deleteAndLeak(Q){let B=this._store.get(Q);return this._store.delete(Q),B}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}o.DisposableMap=w},6317:(I,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkedList=void 0;class i{static{this.Undefined=new i(void 0)}constructor(d){this.element=d,this.next=i.Undefined,this.prev=i.Undefined}}class a{constructor(){this._first=i.Undefined,this._last=i.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===i.Undefined}clear(){let d=this._first;for(;d!==i.Undefined;){let m=d.next;d.prev=i.Undefined,d.next=i.Undefined,d=m}this._first=i.Undefined,this._last=i.Undefined,this._size=0}unshift(d){return this._insert(d,!1)}push(d){return this._insert(d,!0)}_insert(d,m){let u=new i(d);if(this._first===i.Undefined)this._first=u,this._last=u;else if(m){let h=this._last;this._last=u,u.prev=h,h.next=u}else{let h=this._first;this._first=u,u.next=h,h.prev=u}this._size+=1;let G=!1;return()=>{G||(G=!0,this._remove(u))}}shift(){if(this._first!==i.Undefined){let d=this._first.element;return this._remove(this._first),d}}pop(){if(this._last!==i.Undefined){let d=this._last.element;return this._remove(this._last),d}}_remove(d){if(d.prev!==i.Undefined&&d.next!==i.Undefined){let m=d.prev;m.next=d.next,d.next.prev=m}else d.prev===i.Undefined&&d.next===i.Undefined?(this._first=i.Undefined,this._last=i.Undefined):d.next===i.Undefined?(this._last=this._last.prev,this._last.next=i.Undefined):d.prev===i.Undefined&&(this._first=this._first.next,this._first.prev=i.Undefined);this._size-=1}*[Symbol.iterator](){let d=this._first;for(;d!==i.Undefined;)yield d.element,d=d.next}}o.LinkedList=a},2608:(I,o)=>{var i;Object.defineProperty(o,"__esModule",{value:!0}),o.SetMap=o.BidirectionalMap=o.CounterSet=o.Touch=void 0,o.getOrSet=function(a,c,d){let m=a.get(c);return m===void 0&&(m=d,a.set(c,m)),m},o.mapToString=function(a){let c=[];return a.forEach(((d,m)=>{c.push(`${m} => ${d}`)})),`Map(${a.size}) {${c.join(", ")}}`},o.setToString=function(a){let c=[];return a.forEach((d=>{c.push(d)})),`Set(${a.size}) {${c.join(", ")}}`},o.mapsStrictEqualIgnoreOrder=function(a,c){if(a===c)return!0;if(a.size!==c.size)return!1;for(let[d,m]of a)if(!c.has(d)||c.get(d)!==m)return!1;for(let[d]of c)if(!a.has(d))return!1;return!0},(function(a){a[a.None=0]="None",a[a.AsOld=1]="AsOld",a[a.AsNew=2]="AsNew"})(i||(o.Touch=i={})),o.CounterSet=class{constructor(){this.map=new Map}add(a){return this.map.set(a,(this.map.get(a)||0)+1),this}delete(a){let c=this.map.get(a)||0;return c!==0&&(c--,c===0?this.map.delete(a):this.map.set(a,c),!0)}has(a){return this.map.has(a)}},o.BidirectionalMap=class{constructor(a){if(this._m1=new Map,this._m2=new Map,a)for(let[c,d]of a)this.set(c,d)}clear(){this._m1.clear(),this._m2.clear()}set(a,c){this._m1.set(a,c),this._m2.set(c,a)}get(a){return this._m1.get(a)}getKey(a){return this._m2.get(a)}delete(a){let c=this._m1.get(a);return c!==void 0&&(this._m1.delete(a),this._m2.delete(c),!0)}forEach(a,c){this._m1.forEach(((d,m)=>{a.call(c,d,m,this)}))}keys(){return this._m1.keys()}values(){return this._m1.values()}},o.SetMap=class{constructor(){this.map=new Map}add(a,c){let d=this.map.get(a);d||(d=new Set,this.map.set(a,d)),d.add(c)}delete(a,c){let d=this.map.get(a);d&&(d.delete(c),d.size===0&&this.map.delete(a))}forEach(a,c){let d=this.map.get(a);d&&d.forEach(c)}get(a){return this.map.get(a)||new Set}}},9725:(I,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StopWatch=void 0;let i=globalThis.performance&&typeof globalThis.performance.now=="function";class a{static create(d){return new a(d)}constructor(d){this._now=i&&d===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}o.StopWatch=a}},e={};function n(I){var o=e[I];if(o!==void 0)return o.exports;var i=e[I]={exports:{}};return t[I].call(i.exports,i,i.exports,n),i.exports}var r={};(()=>{var I=r;Object.defineProperty(I,"__esModule",{value:!0}),I.Terminal=void 0;let o=n(5101),i=n(6097),a=n(4335),c=n(5856),d=n(3027),m=n(7150),u=["cols","rows"];class G extends m.Disposable{constructor(b){super(),this._core=this._register(new c.Terminal(b)),this._addonManager=this._register(new d.AddonManager),this._publicOptions={...this._core.options};let Z=g=>this._core.options[g],W=(g,N)=>{this._checkReadonlyOptions(g),this._core.options[g]=N};for(let g in this._core.options){Object.defineProperty(this._publicOptions,g,{get:()=>this._core.options[g],set:A=>{this._checkReadonlyOptions(g),this._core.options[g]=A}});let N={get:Z.bind(this,g),set:W.bind(this,g)};Object.defineProperty(this._publicOptions,g,N)}}_checkReadonlyOptions(b){if(u.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onLineFeed(){return this._core.onLineFeed}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new i.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new a.UnicodeApi(this._core)}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=this._register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let b=this._core.coreService.decPrivateModes,Z="none";switch(this._core.coreMouseService.activeProtocol){case"X10":Z="x10";break;case"VT200":Z="vt200";break;case"DRAG":Z="drag";break;case"ANY":Z="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:Z,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,synchronizedOutputMode:b.synchronizedOutput,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(let Z in b)this._publicOptions[Z]=b[Z]}input(b,Z=!0){this._core.input(b,Z)}resize(b,Z){this._verifyIntegers(b,Z),this._core.resize(b,Z)}registerMarker(b=0){return this._checkProposedApi(),this._verifyIntegers(b),this._core.addMarker(b)}addMarker(b){return this.registerMarker(b)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,Z){this._core.write(b,Z)}writeln(b,Z){this._core.write(b),this._core.write(`\r
|
|
3104
3104
|
`,Z)}reset(){this._core.reset()}loadAddon(b){this._addonManager.loadAddon(this,b)}_verifyIntegers(...b){for(let Z of b)if(Z===1/0||isNaN(Z)||Z%1!=0)throw new Error("This API only accepts integers")}}I.Terminal=G})();var l=C9n;for(var s in r)l[s]=r[s];r.__esModule&&Object.defineProperty(l,"__esModule",{value:!0})})()});var Pae=R(AP=>{"use strict";Object.defineProperty(AP,"__esModule",{value:!0});AP.loadNativeModule=AP.assign=void 0;function MEl(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach(function(r){return Object.keys(r).forEach(function(l){return t[l]=r[l]})}),t}AP.assign=MEl;function OEl(t){for(var e=["build/Release","build/Debug","prebuilds/"+process.platform+"-"+process.arch],n=["..","."],r,l=0,s=e;l<s.length;l++)for(var I=s[l],o=0,i=n;o<i.length;o++){var a=i[o],c=a+"/"+I;try{return{dir:c,module:z(c+"/"+t+".node")}}catch(d){r=d}}throw new Error("Failed to load native module: "+t+".node, checked: "+e.join(", ")+": "+r)}AP.loadNativeModule=OEl});var EWt=R(qCe=>{"use strict";Object.defineProperty(qCe,"__esModule",{value:!0});qCe.EventEmitter2=void 0;var TEl=(function(){function t(){this._listeners=[]}return Object.defineProperty(t.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(n){e._listeners.push(n);var r={dispose:function(){for(var l=0;l<e._listeners.length;l++)if(e._listeners[l]===n){e._listeners.splice(l,1);return}}};return r}),this._event},enumerable:!1,configurable:!0}),t.prototype.fire=function(e){for(var n=[],r=0;r<this._listeners.length;r++)n.push(this._listeners[r]);for(var r=0;r<n.length;r++)n[r].call(void 0,e)},t})();qCe.EventEmitter2=TEl});var wWt=R(EC=>{"use strict";Object.defineProperty(EC,"__esModule",{value:!0});EC.Terminal=EC.DEFAULT_ROWS=EC.DEFAULT_COLS=void 0;var DEl=z("events"),X9n=EWt();EC.DEFAULT_COLS=80;EC.DEFAULT_ROWS=24;var jEl="",PEl="",KEl=(function(){function t(e){this._pid=0,this._fd=0,this._cols=0,this._rows=0,this._readable=!1,this._writable=!1,this._onData=new X9n.EventEmitter2,this._onExit=new X9n.EventEmitter2,this._internalee=new DEl.EventEmitter,this.handleFlowControl=!!e?.handleFlowControl,this._flowControlPause=e?.flowControlPause||jEl,this._flowControlResume=e?.flowControlResume||PEl,e&&(this._checkType("name",e.name?e.name:void 0,"string"),this._checkType("cols",e.cols?e.cols:void 0,"number"),this._checkType("rows",e.rows?e.rows:void 0,"number"),this._checkType("cwd",e.cwd?e.cwd:void 0,"string"),this._checkType("env",e.env?e.env:void 0,"object"),this._checkType("uid",e.uid?e.uid:void 0,"number"),this._checkType("gid",e.gid?e.gid:void 0,"number"),this._checkType("encoding",e.encoding?e.encoding:void 0,"string"))}return Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onExit",{get:function(){return this._onExit.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pid",{get:function(){return this._pid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._rows},enumerable:!1,configurable:!0}),t.prototype.write=function(e){if(this.handleFlowControl){if(e===this._flowControlPause){this.pause();return}if(e===this._flowControlResume){this.resume();return}}this._write(e)},t.prototype._forwardEvents=function(){var e=this;this.on("data",function(n){return e._onData.fire(n)}),this.on("exit",function(n,r){return e._onExit.fire({exitCode:n,signal:r})})},t.prototype._checkType=function(e,n,r,l){if(l===void 0&&(l=!1),n!==void 0){if(l&&Array.isArray(n)){n.forEach(function(s,I){if(typeof s!==r)throw new Error(e+"["+I+"] must be a "+r+" (not a "+typeof s[I]+")")});return}if(typeof n!==r)throw new Error(e+" must be a "+r+" (not a "+typeof n+")")}},t.prototype.end=function(e){this._socket.end(e)},t.prototype.pipe=function(e,n){return this._socket.pipe(e,n)},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,n){this.on(e,n)},t.prototype.on=function(e,n){if(e==="close"){this._internalee.on("close",n);return}this._socket.on(e,n)},t.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e==="close"?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,n){this._socket.removeListener(e,n)},t.prototype.removeAllListeners=function(e){this._socket.removeAllListeners(e)},t.prototype.once=function(e,n){this._socket.once(e,n)},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 n=Object.keys(e||{}),r=[],l=0;l<n.length;l++)n[l]!==void 0&&r.push(n[l]+"="+e[n[l]]);return r},t})();EC.Terminal=KEl});var J9n=R($Ce=>{"use strict";Object.defineProperty($Ce,"__esModule",{value:!0});$Ce.getWorkerPipeName=void 0;function _El(t){return t+"-worker"}$Ce.getWorkerPipeName=_El});var k9n=R(wC=>{"use strict";var qEl=wC&&wC.__awaiter||function(t,e,n,r){function l(s){return s instanceof n?s:new n(function(I){I(s)})}return new(n||(n=Promise))(function(s,I){function o(c){try{a(r.next(c))}catch(d){I(d)}}function i(c){try{a(r.throw(c))}catch(d){I(d)}}function a(c){c.done?s(c.value):l(c.value).then(o,i)}a((r=r.apply(t,e||[])).next())})},$El=wC&&wC.__generator||function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,l,s,I;return I={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function o(a){return function(c){return i([a,c])}}function i(a){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,l&&(s=a[0]&2?l.return:a[0]?l.throw||((s=l.return)&&s.call(l),0):l.next)&&!(s=s.call(l,a[1])).done)return s;switch(l=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return n.label++,{value:a[1],done:!1};case 5:n.label++,l=a[1],a=[0];continue;case 7:a=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){n.label=a[1];break}if(a[0]===6&&n.label<s[1]){n.label=s[1],s=a;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(a);break}s[2]&&n.ops.pop(),n.trys.pop();continue}a=e.call(t,n)}catch(c){a=[6,c],l=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(wC,"__esModule",{value:!0});wC.ConoutConnection=void 0;var ewl=z("worker_threads"),twl=J9n(),nwl=z("path"),rwl=EWt(),lwl=1e3,swl=(function(){function t(e,n){var r=this;this._conoutPipeName=e,this._useConptyDll=n,this._isDisposed=!1,this._onReady=new rwl.EventEmitter2;var l={conoutPipeName:e},s=__dirname.replace("node_modules.asar","node_modules.asar.unpacked");this._worker=new ewl.Worker(nwl.join(s,"worker/conoutSocketWorker.js"),{workerData:l}),this._worker.on("message",function(I){switch(I){case 1:r._onReady.fire();return;default:console.warn("Unexpected ConoutWorkerMessage",I)}})}return Object.defineProperty(t.prototype,"onReady",{get:function(){return this._onReady.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){!this._useConptyDll&&this._isDisposed||(this._isDisposed=!0,this._drainDataAndClose())},t.prototype.connectSocket=function(e){e.connect(twl.getWorkerPipeName(this._conoutPipeName))},t.prototype._drainDataAndClose=function(){var e=this;this._drainTimeout&&clearTimeout(this._drainTimeout),this._drainTimeout=setTimeout(function(){return e._destroySocket()},lwl)},t.prototype._destroySocket=function(){return qEl(this,void 0,void 0,function(){return $El(this,function(e){switch(e.label){case 0:return[4,this._worker.terminate()];case 1:return e.sent(),[2]}})})},t})();wC.ConoutConnection=swl});var B9n=R(yP=>{"use strict";Object.defineProperty(yP,"__esModule",{value:!0});yP.argsToCommandLine=yP.WindowsPtyAgent=void 0;var Iwl=z("fs"),L9n=z("path"),owl=z("child_process"),x9n=z("net"),iwl=k9n(),awl=Pae(),Kae,cwl=1e3,dwl=(function(){function t(e,n,r,l,s,I,o,i,a){var c=this;i===void 0&&(i=!1),a===void 0&&(a=!1),this._useConptyDll=i,this._innerPid=0,Kae||(Kae=awl.loadNativeModule("conpty").module),this._ptyNative=Kae,l=L9n.resolve(l);var d=QWt(e,n),m=Kae.startProcess(e,s,I,o,this._generatePipeName(),a,this._useConptyDll);this._fd=m.fd,this._pty=m.pty,this._outSocket=new x9n.Socket,this._outSocket.setEncoding("utf8"),this._conoutSocketWorker=new iwl.ConoutConnection(m.conout,this._useConptyDll),this._pendingPtyInfo={pty:this._pty,commandLine:d,cwd:l,env:r};var u=setTimeout(function(){c._pendingPtyInfo&&c._completePtyConnection()},5e3);this._conoutSocketWorker.onReady(function(){clearTimeout(u),c._conoutSocketWorker.connectSocket(c._outSocket),c._completePtyConnection()}),this._outSocket.on("connect",function(){c._outSocket.emit("ready_datapipe")});var G=Iwl.openSync(m.conin,"w");this._inSocket=new x9n.Socket({fd:G,readable:!1,writable:!0}),this._inSocket.setEncoding("utf8")}return Object.defineProperty(t.prototype,"inSocket",{get:function(){return this._inSocket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outSocket",{get:function(){return this._outSocket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fd",{get:function(){return this._fd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerPid",{get:function(){return this._innerPid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pty",{get:function(){return this._pty},enumerable:!1,configurable:!0}),t.prototype._completePtyConnection=function(){var e=this;if(this._pendingPtyInfo){var n=this._pendingPtyInfo,r=n.pty,l=n.commandLine,s=n.cwd,I=n.env;this._pendingPtyInfo=void 0;var o=Kae.connect(r,l,s,I,this._useConptyDll,function(i){return e._$onProcessExit(i)});this._innerPid=o.pid}},t.prototype.resize=function(e,n){if(this._exitCode!==void 0)throw new Error("Cannot resize a pty that has already exited");this._ptyNative.resize(this._pty,e,n,this._useConptyDll)},t.prototype.clear=function(){this._ptyNative.clear(this._pty,this._useConptyDll)},t.prototype.kill=function(){var e=this;this._pendingPtyInfo=void 0,this._useConptyDll?(this._inSocket.destroy(),this._ptyNative.kill(this._pty,this._useConptyDll),this._outSocket.on("data",function(){e._conoutSocketWorker.dispose()})):(this._inSocket.readable=!1,this._outSocket.readable=!1,this._getConsoleProcessList().then(function(n){n.forEach(function(r){try{process.kill(r)}catch{}})}),this._ptyNative.kill(this._pty,this._useConptyDll),this._conoutSocketWorker.dispose())},t.prototype._getConsoleProcessList=function(){var e=this;return this._innerPid<=0?Promise.resolve([]):new Promise(function(n){var r=owl.fork(L9n.join(__dirname,"conpty_console_list_agent"),[e._innerPid.toString()]);r.on("message",function(s){clearTimeout(l),n(s.consoleProcessList)});var l=setTimeout(function(){r.kill(),n([e._innerPid])},5e3)})},Object.defineProperty(t.prototype,"exitCode",{get:function(){return this._exitCode},enumerable:!1,configurable:!0}),t.prototype._generatePipeName=function(){return"conpty-"+Math.random()*1e7},t.prototype._$onProcessExit=function(e){var n=this;this._exitCode=e,this._useConptyDll||(this._flushDataAndCleanUp(),this._outSocket.on("data",function(){return n._flushDataAndCleanUp()}))},t.prototype._flushDataAndCleanUp=function(){var e=this;this._useConptyDll||(this._closeTimeout&&clearTimeout(this._closeTimeout),this._closeTimeout=setTimeout(function(){return e._cleanUpProcess()},cwl))},t.prototype._cleanUpProcess=function(){this._useConptyDll||(this._inSocket.readable=!1,this._outSocket.readable=!1,this._outSocket.destroy())},t})();yP.WindowsPtyAgent=dwl;function QWt(t,e){if(uwl(e))return e.length===0?t:QWt(t,[])+" "+e;var n=[t];Array.prototype.push.apply(n,e);for(var r="",l=0;l<n.length;l++){l>0&&(r+=" ");var s=n[l],I=mwl(s[0]!=='"',s[s.length-1]!=='"'),o=s[0]!=='"'&&s[s.length-1]!=='"',i=s===""||(s.indexOf(" ")!==-1||s.indexOf(" ")!==-1)&&s.length>1&&(I||o);i&&(r+='"');for(var a=0,c=0;c<s.length;c++){var d=s[c];d==="\\"?a++:d==='"'?(r+=eHe("\\",a*2+1),r+='"',a=0):(r+=eHe("\\",a),a=0,r+=d)}i?(r+=eHe("\\",a*2),r+='"'):r+=eHe("\\",a)}return r}yP.argsToCommandLine=QWt;function uwl(t){return typeof t=="string"}function eHe(t,e){for(var n="",r=0;r<e;r++)n+=t;return n}function mwl(t,e){return t&&!e||!t&&e}});var S9n=R(YP=>{"use strict";var Gwl=YP&&YP.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,l){r.__proto__=l}||function(r,l){for(var s in l)l.hasOwnProperty(s)&&(r[s]=l[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(YP,"__esModule",{value:!0});YP.WindowsTerminal=void 0;var FWt=wWt(),bwl=B9n(),hwl=Pae(),pwl="cmd.exe",Zwl="Windows Shell",Wwl=(function(t){Gwl(e,t);function e(n,r,l){var s=t.call(this,l)||this;s._checkType("args",r,"string",!0),r=r||[],n=n||pwl,l=l||{},l.env=l.env||process.env,l.encoding&&console.warn("Setting encoding on Windows is not supported");var I=hwl.assign({},l.env);s._cols=l.cols||FWt.DEFAULT_COLS,s._rows=l.rows||FWt.DEFAULT_ROWS;var o=l.cwd||process.cwd(),i=l.name||I.TERM||Zwl,a=s._parseEnv(I);return s._isReady=!1,s._deferreds=[],s._agent=new bwl.WindowsPtyAgent(n,r,a,o,s._cols,s._rows,!1,l.useConptyDll,l.conptyInheritCursor),s._socket=s._agent.outSocket,s._pid=s._agent.innerPid,s._fd=s._agent.fd,s._pty=s._agent.pty,s._socket.on("ready_datapipe",function(){s._pid=s._agent.innerPid,s._socket.once("data",function(){s._isReady||(s._isReady=!0,s._deferreds.forEach(function(c){c.run()}),s._deferreds=[])}),s._socket.on("error",function(c){if(s._close(),!(c.code&&(~c.code.indexOf("errno 5")||~c.code.indexOf("EIO")))&&s.listeners("error").length<2)throw c}),s._socket.on("close",function(){s.emit("exit",s._agent.exitCode),s._close()})}),s._file=n,s._name=i,s._readable=!0,s._writable=!0,s._forwardEvents(),s}return e.prototype._write=function(n){this._defer(this._doWrite,n)},e.prototype._doWrite=function(n){this._agent.inSocket.write(n)},e.open=function(n){throw new Error("open() not supported on windows, use Fork() instead.")},e.prototype.resize=function(n,r,l){var s=this;if(n<=0||r<=0||isNaN(n)||isNaN(r)||n===1/0||r===1/0)throw new Error("resizing must be done using positive cols and rows");this._deferNoArgs(function(){s._agent.resize(n,r),s._cols=n,s._rows=r})},e.prototype.clear=function(){var n=this;this._deferNoArgs(function(){n._agent.clear()})},e.prototype.destroy=function(){var n=this;this._deferNoArgs(function(){n.kill()})},e.prototype.kill=function(n){var r=this;this._deferNoArgs(function(){if(n)throw new Error("Signals not supported on windows.");r._close(),r._agent.kill()})},e.prototype._deferNoArgs=function(n){var r=this;if(this._isReady){n.call(this);return}this._deferreds.push({run:function(){return n.call(r)}})},e.prototype._defer=function(n,r){var l=this;if(this._isReady){n.call(this,r);return}this._deferreds.push({run:function(){return n.call(l,r)}})},Object.defineProperty(e.prototype,"process",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"master",{get:function(){throw new Error("master is not supported on Windows")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slave",{get:function(){throw new Error("slave is not supported on Windows")},enumerable:!1,configurable:!0}),e})(FWt.Terminal);YP.WindowsTerminal=Wwl});var M9n=R(RP=>{"use strict";var gwl=RP&&RP.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,l){r.__proto__=l}||function(r,l){for(var s in l)l.hasOwnProperty(s)&&(r[s]=l[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(RP,"__esModule",{value:!0});RP.UnixTerminal=void 0;var Nwl=z("fs"),Awl=z("path"),vWt=z("tty"),_ae=wWt(),U9n=Pae(),z9n=U9n.loadNativeModule("pty"),qae=z9n.module,rx=z9n.dir+"/spawn-helper";rx=Awl.resolve(__dirname,rx);rx=rx.replace("app.asar","app.asar.unpacked");rx=rx.replace("node_modules.asar","node_modules.asar.unpacked");var ywl="sh",Ywl="xterm",Rwl=200,Vwl=(function(t){gwl(e,t);function e(n,r,l){var s,I,o=t.call(this,l)||this;if(o._boundClose=!1,o._emittedClose=!1,typeof r=="string")throw new Error("args as a string is not supported on unix.");r=r||[],n=n||ywl,l=l||{},l.env=l.env||process.env,o._cols=l.cols||_ae.DEFAULT_COLS,o._rows=l.rows||_ae.DEFAULT_ROWS;var i=(s=l.uid)!==null&&s!==void 0?s:-1,a=(I=l.gid)!==null&&I!==void 0?I:-1,c=U9n.assign({},l.env);l.env===process.env&&o._sanitizeEnv(c);var d=l.cwd||process.cwd();c.PWD=d;var m=l.name||c.TERM||Ywl;c.TERM=m;var u=o._parseEnv(c),G=l.encoding===void 0?"utf8":l.encoding,h=function(Z,W){if(!o._emittedClose){if(o._boundClose)return;o._boundClose=!0;var g=setTimeout(function(){g=null,o._socket.destroy()},Rwl);o.once("close",function(){g!==null&&clearTimeout(g),o.emit("exit",Z,W)});return}o.emit("exit",Z,W)},b=qae.fork(n,r,u,d,o._cols,o._rows,i,a,G==="utf8",rx,h);return o._socket=new vWt.ReadStream(b.fd),G!==null&&o._socket.setEncoding(G),o._writeStream=new Ewl(b.fd,G||void 0),o._socket.on("error",function(Z){if(!(Z.code&&~Z.code.indexOf("EAGAIN"))&&(o._close(),o._emittedClose||(o._emittedClose=!0,o.emit("close")),!(Z.code&&(~Z.code.indexOf("errno 5")||~Z.code.indexOf("EIO")))&&o.listeners("error").length<2))throw Z}),o._pid=b.pid,o._fd=b.fd,o._pty=b.pty,o._file=n,o._name=m,o._readable=!0,o._writable=!0,o._socket.on("close",function(){o._emittedClose||(o._emittedClose=!0,o._close(),o.emit("close"))}),o._forwardEvents(),o}return Object.defineProperty(e.prototype,"master",{get:function(){return this._master},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slave",{get:function(){return this._slave},enumerable:!1,configurable:!0}),e.prototype._write=function(n){this._writeStream.write(n)},Object.defineProperty(e.prototype,"fd",{get:function(){return this._fd},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ptsName",{get:function(){return this._pty},enumerable:!1,configurable:!0}),e.open=function(n){var r=Object.create(e.prototype);n=n||{},arguments.length>1&&(n={cols:arguments[1],rows:arguments[2]});var l=n.cols||_ae.DEFAULT_COLS,s=n.rows||_ae.DEFAULT_ROWS,I=n.encoding===void 0?"utf8":n.encoding,o=qae.open(l,s);return r._master=new vWt.ReadStream(o.master),I!==null&&r._master.setEncoding(I),r._master.resume(),r._slave=new vWt.ReadStream(o.slave),I!==null&&r._slave.setEncoding(I),r._slave.resume(),r._socket=r._master,r._pid=-1,r._fd=o.master,r._pty=o.pty,r._file=process.argv[0]||"node",r._name=process.env.TERM||"",r._readable=!0,r._writable=!0,r._socket.on("error",function(i){if(r._close(),r.listeners("error").length<2)throw i}),r._socket.on("close",function(){r._close()}),r},e.prototype.destroy=function(){var n=this;this._close(),this._socket.once("close",function(){n.kill("SIGHUP")}),this._socket.destroy(),this._writeStream.dispose()},e.prototype.kill=function(n){try{process.kill(this.pid,n||"SIGHUP")}catch{}},Object.defineProperty(e.prototype,"process",{get:function(){if(process.platform==="darwin"){var n=qae.process(this._fd);return n!=="kernel_task"&&n!=="spawn_helper"?n:this._file}return qae.process(this._fd,this._pty)||this._file},enumerable:!1,configurable:!0}),e.prototype.resize=function(n,r,l){var s,I;if(n<=0||r<=0||isNaN(n)||isNaN(r)||n===1/0||r===1/0)throw new Error("resizing must be done using positive cols and rows");var o=(s=l?.width)!==null&&s!==void 0?s:0,i=(I=l?.height)!==null&&I!==void 0?I:0;qae.resize(this._fd,n,r,o,i),this._cols=n,this._rows=r},e.prototype.clear=function(){},e.prototype._sanitizeEnv=function(n){delete n.TMUX,delete n.TMUX_PANE,delete n.STY,delete n.WINDOW,delete n.WINDOWID,delete n.TERMCAP,delete n.COLUMNS,delete n.LINES},e})(_ae.Terminal);RP.UnixTerminal=Vwl;var Ewl=(function(){function t(e,n){this._fd=e,this._encoding=n,this._writeQueue=[]}return t.prototype.dispose=function(){clearImmediate(this._writeImmediate),this._writeImmediate=void 0},t.prototype.write=function(e){var n=typeof e=="string"?Buffer.from(e,this._encoding):Buffer.from(e);n.byteLength!==0&&(this._writeQueue.push({buffer:n,offset:0}),this._writeQueue.length===1&&this._processWriteQueue())},t.prototype._processWriteQueue=function(){var e=this;if(this._writeImmediate=void 0,this._writeQueue.length!==0){var n=this._writeQueue[0];Nwl.write(this._fd,n.buffer,n.offset,function(r,l){if(r){"code"in r&&r.code==="EAGAIN"?e._writeImmediate=setImmediate(function(){return e._processWriteQueue()}):(e._writeQueue.length=0,console.error("Unhandled pty write error",r));return}n.offset+=l,n.offset>=n.buffer.byteLength&&e._writeQueue.shift(),e._processWriteQueue()})}},t})()});var O9n=R(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.native=Bg.open=Bg.createTerminal=Bg.fork=Bg.spawn=void 0;var wwl=Pae(),VP;process.platform==="win32"?VP=S9n().WindowsTerminal:VP=M9n().UnixTerminal;function Qwl(t,e,n){return new VP(t,e,n)}Bg.spawn=Qwl;function Fwl(t,e,n){return new VP(t,e,n)}Bg.fork=Fwl;function vwl(t,e,n){return new VP(t,e,n)}Bg.createTerminal=vwl;function fwl(t){return VP.open(t)}Bg.open=fwl;Bg.native=process.platform!=="win32"?wwl.loadNativeModule("pty").module:null});import{exec as Cwl,spawn as Hwl}from"child_process";import{promisify as Xwl}from"util";async function kwl(t,e,n){await t;let r=128,l=100;for(let s=0;s<n.length;s+=r){let I=n.substring(s,s+r);try{e.write(I)}catch{break}await new Promise(o=>setTimeout(o,l))}}var j9n,P9n,nHe,tHe,lx,T9n,Jwl,D9n,rHe,K9n=p(()=>{"use strict";j9n=Fn(H9n(),1),P9n=Fn(O9n(),1);L8e();St();Ubt();PCe();Fo();NQ();nHe="___BEGIN___COMMAND_OUTPUT_MARKER___",tHe=`
|
|
3105
3105
|
${nHe}
|
|
3106
|
-
`,lx="___BEGIN___COMMAND_DONE_MARKER___",T9n=new RegExp(`${lx}(\\d+)`),Jwl=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,D9n=5e3,rHe=class t{constructor(e,n,r={},l){this.config=e;this.largeOutputOptions=l??gQ(),this.outputBuffer=this.createOutputBuffer(),this.createdAtMs=Date.now(),this.lastUsedAtMs=Date.now();let s=this.config.shellType==="powershell";s&&(r={...r,POWERSHELL_UPDATECHECK:"Off"});let I=s?"pwsh.exe":"bash",o=s?["-nop","-nol","-noe","-c","Set-PSReadLineOption -HistorySaveStyle SaveNothing"]:["--norc","--noprofile"],i=120,a=80;this.process=(0,P9n.spawn)(I,o,{name:"xterm-color",cols:i,rows:a,cwd:n,env:r}),this.terminal=new j9n.Terminal({cols:i,rows:a}),this.terminal.onData(c=>{try{this.process?.write(c)}catch{}}),this.process.onData(c=>{try{this.terminal?.write(c);let m=iv(c.replace(Jwl,"")).replaceAll("\r","");this.outputBuffer.append(m)}catch{}}),this.process.onExit(c=>this.shutdown())}process;terminal;outputBuffer;largeOutputOptions;get outputBufferLength(){return this.outputBuffer.length}isCommandInProgress=!1;createdAtMs;lastUsedAtMs;onPartialOutputChanged;static shellIsSupportedCache=new Map;writeDelay=Promise.resolve();static async create(e,n,r={},l){await t.ensureShellIsSupported(e.shellType);let s=new t(e,n,r,l);try{await s.initializeShellEnvironment()}catch(I){throw s.shutdown(),I}return s}setPartialOutputChangedCallback(e){this.onPartialOutputChanged=e}async executeCommand(e,n,r){if(this.updateLastUsedTime(),!this.process)throw new Error(`Failed to start ${this.config.shellType} process`);if(this.tryStartCommand(e))return await(n?this.waitForCommandCompletionOrTimeout(n,r):this.waitForCommandCompletion(r))}async cwd(){try{let e=this.config.shellType==="powershell"?"(pwd).Path":"pwd",n=await this.executeCommand(e,D9n);return n?.exitCode===0?n.output:void 0}catch{return}}async tryExecuteAsyncCommand(e){return this.updateLastUsedTime(),this.tryStartCommand(e)?(this.waitForCommandCompletion().catch(n=>{}),this.config.shellType==="powershell"&&await new Promise(n=>setTimeout(n,250)),!0):!1}async tryExecuteDetachedCommand(e,n){return this.updateLastUsedTime(),this.isCommandInProgress?!1:process.platform==="win32"?this.tryExecuteDetachedCommandWindows(e,n):this.tryExecuteDetachedCommandUnix(e,n)}async tryExecuteDetachedCommandWindows(e,n){if(!(this.config.shellType==="powershell"))throw new Error("Only PowerShell is supported for detached commands on Windows");try{let l=e.replace(/"/g,'""'),s=n.replace(/\\/g,"\\\\"),a=`Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile","-Command","${"`$PID | Out-File -FilePath '"+n.replace(/\.log$/,".pid").replace(/\\/g,"\\\\")+"' -Encoding ascii; "+l} *>> '${s}' 2>&1" -WindowStyle Hidden`;return Hwl("pwsh.exe",["-NoProfile","-Command",a],{stdio:"ignore",cwd:await this.cwd(),windowsHide:!0,env:{...process.env,POWERSHELL_UPDATECHECK:"Off"}}).unref(),this.isCommandInProgress=!0,this.outputBuffer.set(`${tHe}<command detached, output redirected to ${n}>
|
|
3106
|
+
`,lx="___BEGIN___COMMAND_DONE_MARKER___",T9n=new RegExp(`${lx}(\\d+)`),Jwl=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,D9n=5e3,rHe=class t{constructor(e,n,r={},l){this.config=e;this.largeOutputOptions=l??gQ(),this.outputBuffer=this.createOutputBuffer(),this.createdAtMs=Date.now(),this.lastUsedAtMs=Date.now();let s=this.config.shellType==="powershell";s&&(r={...r,POWERSHELL_UPDATECHECK:"Off"});let I=s?"pwsh.exe":"bash",o=s?["-nop","-nol","-noe","-c","Set-PSReadLineOption -HistorySaveStyle SaveNothing"]:["--norc","--noprofile"],i=120,a=80;this.process=(0,P9n.spawn)(I,o,{name:"xterm-color",cols:i,rows:a,cwd:n,env:r}),this.terminal=new j9n.Terminal({cols:i,rows:a,scrollback:0}),this.terminal.onData(c=>{try{this.process?.write(c)}catch{}}),this.process.onData(c=>{try{this.terminal?.write(c);let m=iv(c.replace(Jwl,"")).replaceAll("\r","");this.outputBuffer.append(m)}catch{}}),this.process.onExit(c=>this.shutdown())}process;terminal;outputBuffer;largeOutputOptions;get outputBufferLength(){return this.outputBuffer.length}isCommandInProgress=!1;createdAtMs;lastUsedAtMs;onPartialOutputChanged;static shellIsSupportedCache=new Map;writeDelay=Promise.resolve();static async create(e,n,r={},l){await t.ensureShellIsSupported(e.shellType);let s=new t(e,n,r,l);try{await s.initializeShellEnvironment()}catch(I){throw s.shutdown(),I}return s}setPartialOutputChangedCallback(e){this.onPartialOutputChanged=e}async executeCommand(e,n,r){if(this.updateLastUsedTime(),!this.process)throw new Error(`Failed to start ${this.config.shellType} process`);if(this.tryStartCommand(e))return await(n?this.waitForCommandCompletionOrTimeout(n,r):this.waitForCommandCompletion(r))}async cwd(){try{let e=this.config.shellType==="powershell"?"(pwd).Path":"pwd",n=await this.executeCommand(e,D9n);return n?.exitCode===0?n.output:void 0}catch{return}}async tryExecuteAsyncCommand(e){return this.updateLastUsedTime(),this.tryStartCommand(e)?(this.waitForCommandCompletion().catch(n=>{}),this.config.shellType==="powershell"&&await new Promise(n=>setTimeout(n,250)),!0):!1}async tryExecuteDetachedCommand(e,n){return this.updateLastUsedTime(),this.isCommandInProgress?!1:process.platform==="win32"?this.tryExecuteDetachedCommandWindows(e,n):this.tryExecuteDetachedCommandUnix(e,n)}async tryExecuteDetachedCommandWindows(e,n){if(!(this.config.shellType==="powershell"))throw new Error("Only PowerShell is supported for detached commands on Windows");try{let l=e.replace(/"/g,'""'),s=n.replace(/\\/g,"\\\\"),a=`Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile","-Command","${"`$PID | Out-File -FilePath '"+n.replace(/\.log$/,".pid").replace(/\\/g,"\\\\")+"' -Encoding ascii; "+l} *>> '${s}' 2>&1" -WindowStyle Hidden`;return Hwl("pwsh.exe",["-NoProfile","-Command",a],{stdio:"ignore",cwd:await this.cwd(),windowsHide:!0,env:{...process.env,POWERSHELL_UPDATECHECK:"Off"}}).unref(),this.isCommandInProgress=!0,this.outputBuffer.set(`${tHe}<command detached, output redirected to ${n}>
|
|
3107
3107
|
${lx}0`),this.isCommandInProgress=!1,!0}catch{return!1}}tryExecuteDetachedCommandUnix(e,n){if(!this.process)throw new Error(`Failed to start ${this.config.shellType} process`);if(this.isCommandInProgress)return!1;this.isCommandInProgress=!0;let r=e.replace(/'/g,"'\\''"),l=n.replace(/\.log$/,".pid"),s=m=>`'${m.replace(/'/g,"'\\''")}'`,I=m=>m.replace(/["\\$`]/g,u=>`\\${u}`),o=s(l),i=s(n),a=I(n),c=`echo $$ > ${o}; ${r}`,d=`
|
|
3108
3108
|
{
|
|
3109
3109
|
echo ${nHe}
|