@minimax-ai/code 0.6.6 → 0.6.8
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.md +20 -0
- package/CHANGELOG.zh-CN.md +19 -0
- package/README.md +26 -0
- package/README.zh-CN.md +51 -0
- package/chunks/{auth-command-VA6MMKOP.js → auth-command-VRPOVPAG.js} +1 -1
- package/chunks/{chunk-VCAGMAY5.js → chunk-3LM4G7WV.js} +1 -1
- package/chunks/{chunk-WQPQHX2N.js → chunk-F5BJTVSP.js} +1 -1
- package/chunks/{chunk-WUBVVATA.js → chunk-HTUJPI64.js} +734 -673
- package/chunks/{chunk-EGP34E73.js → chunk-RCKQIK7B.js} +1 -1
- package/chunks/{chunk-AKM6CI7T.js → chunk-TBUCWZJV.js} +1 -1
- package/chunks/{chunk-52X742AN.js → chunk-TJWBPT2F.js} +1 -1
- package/chunks/{chunk-EZ7Q2NM4.js → chunk-VRCVX3OX.js} +6 -6
- package/chunks/{chunk-G5QL7ZHU.js → chunk-W2YPWDHA.js} +1 -1
- package/chunks/{data-dir-IMRONFFA.js → data-dir-5RSS75A3.js} +1 -1
- package/chunks/{dist-63237B2W.js → dist-VUHPFVW3.js} +1 -1
- package/chunks/{launcher-AW4MDLKG.js → launcher-UXZG5P2R.js} +3 -3
- package/chunks/{lifecycle-INAA4RL2.js → lifecycle-LWEBNCGO.js} +1 -1
- package/chunks/{main-AFQG6DBW.js → main-ZF4GAXGG.js} +2 -2
- package/chunks/{plugin-command-LOWP3CEB.js → plugin-command-DE7EI72Q.js} +1 -1
- package/chunks/{provider-command-CS5TVIBU.js → provider-command-WEUFNCBJ.js} +1 -1
- package/chunks/{run-acp-command-2QYNAZF5.js → run-acp-command-RJGV3PNR.js} +2 -2
- package/chunks/{run-exec-command-XCRQ6UR5.js → run-exec-command-LDQWWWXK.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
2
|
import{n as Tr}from"./chunk-3FETZOUF.js";import{a as ue,c as S,e as Or}from"./chunk-D76SO2ME.js";var Jl=S((ww,Hl)=>{var Ne=ue("constants"),xy=process.cwd,Hn=null,ky=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Hn||(Hn=xy.call(process)),Hn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Vr=process.chdir,process.chdir=function(e){Hn=null,Vr.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Vr));var Vr;Hl.exports=Cy;function Cy(e){Ne.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(u,f,d){d&&process.nextTick(d)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(u,f,d,p){p&&process.nextTick(p)},e.lchownSync=function(){}),ky==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(u){function f(d,p,h){var m=Date.now(),y=0;u(d,p,function g(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(p,function(v,x){v&&v.code==="ENOENT"?u(d,p,g):h(b)})},y),y<100&&(y+=10);return}h&&h(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(u){function f(d,p,h,m,y,g){var b;if(g&&typeof g=="function"){var v=0;b=function(x,k,C){if(x&&x.code==="EAGAIN"&&v<10)return v++,u.call(e,d,p,h,m,y,b);g.apply(this,arguments)}}return u.call(e,d,p,h,m,y,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(u){return function(f,d,p,h,m){for(var y=0;;)try{return u.call(e,f,d,p,h,m)}catch(g){if(g.code==="EAGAIN"&&y<10){y++;continue}throw g}}})(e.readSync);function t(u){u.lchmod=function(f,d,p){u.open(f,Ne.O_WRONLY|Ne.O_SYMLINK,d,function(h,m){if(h){p&&p(h);return}u.fchmod(m,d,function(y){u.close(m,function(g){p&&p(y||g)})})})},u.lchmodSync=function(f,d){var p=u.openSync(f,Ne.O_WRONLY|Ne.O_SYMLINK,d),h=!0,m;try{m=u.fchmodSync(p,d),h=!1}finally{if(h)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function n(u){Ne.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,d,p,h){u.open(f,Ne.O_SYMLINK,function(m,y){if(m){h&&h(m);return}u.futimes(y,d,p,function(g){u.close(y,function(b){h&&h(g||b)})})})},u.lutimesSync=function(f,d,p){var h=u.openSync(f,Ne.O_SYMLINK),m,y=!0;try{m=u.futimesSync(h,d,p),y=!1}finally{if(y)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}):u.futimes&&(u.lutimes=function(f,d,p,h){h&&process.nextTick(h)},u.lutimesSync=function(){})}function i(u){return u&&function(f,d,p){return u.call(e,f,d,function(h){c(h)&&(h=null),p&&p.apply(this,arguments)})}}function r(u){return u&&function(f,d){try{return u.call(e,f,d)}catch(p){if(!c(p))throw p}}}function o(u){return u&&function(f,d,p,h){return u.call(e,f,d,p,function(m){c(m)&&(m=null),h&&h.apply(this,arguments)})}}function s(u){return u&&function(f,d,p){try{return u.call(e,f,d,p)}catch(h){if(!c(h))throw h}}}function a(u){return u&&function(f,d,p){typeof d=="function"&&(p=d,d=null);function h(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),p&&p.apply(this,arguments)}return d?u.call(e,f,d,h):u.call(e,f,h)}}function l(u){return u&&function(f,d){var p=d?u.call(e,f,d):u.call(e,f);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var zl=S((Ew,Ql)=>{var Xl=ue("stream").Stream;Ql.exports=Oy;function Oy(e){return{ReadStream:t,WriteStream:n};function t(i,r){if(!(this instanceof t))return new t(i,r);Xl.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var s=Object.keys(r),a=0,l=s.length;a<l;a++){var c=s[a];this[c]=r[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(u,f){if(u){o.emit("error",u),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function n(i,r){if(!(this instanceof n))return new n(i,r);Xl.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var l=o[s];this[l]=r[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var ec=S((xw,Zl)=>{"use strict";Zl.exports=Iy;var Ty=Object.getPrototypeOf||function(e){return e.__proto__};function Iy(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Ty(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}});var Hr=S((kw,Wr)=>{var F=ue("fs"),My=Jl(),Ly=zl(),Ny=ec(),Jn=ue("util"),Z,Qn;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Z=Symbol.for("graceful-fs.queue"),Qn=Symbol.for("graceful-fs.previous")):(Z="___graceful-fs.queue",Qn="___graceful-fs.previous");function Ry(){}function ic(e,t){Object.defineProperty(e,Z,{get:function(){return t}})}var Ze=Ry;Jn.debuglog?Ze=Jn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ze=function(){var e=Jn.format.apply(Jn,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
3
|
-
GFS4: `),console.error(e)});F[Z]||(tc=global[Z]||[],ic(F,tc),F.close=(function(e){function t(n,i){return e.call(F,n,function(r){r||nc(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Qn,{value:e}),t})(F.close),F.closeSync=(function(e){function t(n){e.apply(F,arguments),nc()}return Object.defineProperty(t,Qn,{value:e}),t})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ze(F[Z]),ue("assert").equal(F[Z].length,0)}));var tc;global[Z]||ic(global,F[Z]);Wr.exports=Yr(Ny(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Wr.exports=Yr(F),F.__patched=!0);function Yr(e){My(e),e.gracefulify=Yr,e.createReadStream=k,e.createWriteStream=C;var t=e.readFile;e.readFile=n;function n(A,O,E){return typeof O=="function"&&(E=O,O=null),T(A,O,E);function T($,W,D,q){return t($,W,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?bt([T,[$,W,D],N,q||Date.now(),Date.now()]):typeof D=="function"&&D.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=r;function r(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(W,D,q,N,Q){return i(W,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[W,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(W,D,q,N,Q){return o(W,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[W,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=l);function l(A,O,E,T){return typeof E=="function"&&(T=E,E=0),$(A,O,E,T);function $(W,D,q,N,Q){return a(W,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[W,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var c=e.readdir;e.readdir=f;var u=/^v[0-5]\./;function f(A,O,E){typeof O=="function"&&(E=O,O=null);var T=u.test(process.version)?function(D,q,N,Q){return c(D,$(D,q,N,Q))}:function(D,q,N,Q){return c(D,q,$(D,q,N,Q))};return T(A,O,E);function $(W,D,q,N){return function(Q,R){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?bt([T,[W,D,q],Q,N||Date.now(),Date.now()]):(R&&R.sort&&R.sort(),typeof q=="function"&&q.call(this,Q,R))}}}if(process.version.substr(0,4)==="v0.8"){var d=Ly(e);g=d.ReadStream,v=d.WriteStream}var p=e.ReadStream;p&&(g.prototype=Object.create(p.prototype),g.prototype.open=b);var h=e.WriteStream;h&&(v.prototype=Object.create(h.prototype),v.prototype.open=x),Object.defineProperty(e,"ReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var y=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0});function g(A,O){return this instanceof g?(p.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function b(){var A=this;_(A.path,A.flags,A.mode,function(O,E){O?(A.autoClose&&A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E),A.read())})}function v(A,O){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var A=this;_(A.path,A.flags,A.mode,function(O,E){O?(A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E))})}function k(A,O){return new e.ReadStream(A,O)}function C(A,O){return new e.WriteStream(A,O)}var M=e.open;e.open=_;function _(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(W,D,q,N,Q){return M(W,D,q,function(R,yw){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[W,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}return e}function bt(e){Ze("ENQUEUE",e[0].name,e[1]),F[Z].push(e),Gr()}var Xn;function nc(){for(var e=Date.now(),t=0;t<F[Z].length;++t)F[Z][t].length>2&&(F[Z][t][3]=e,F[Z][t][4]=e);Gr()}function Gr(){if(clearTimeout(Xn),Xn=void 0,F[Z].length!==0){var e=F[Z].shift(),t=e[0],n=e[1],i=e[2],r=e[3],o=e[4];if(r===void 0)Ze("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){Ze("TIMEOUT",t.name,n);var s=n.pop();typeof s=="function"&&s.call(null,i)}else{var a=Date.now()-o,l=Math.max(o-r,1),c=Math.min(l*1.2,100);a>=c?(Ze("RETRY",t.name,n),t.apply(null,n.concat([r]))):F[Z].push(e)}Xn===void 0&&(Xn=setTimeout(Gr,0))}}});var oc=S((Cw,rc)=>{function fe(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rc.exports=fe;fe.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};fe.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};fe.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var i=this,r=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},n);return this._options.unref&&r.unref(),!0};fe.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};fe.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};fe.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};fe.prototype.start=fe.prototype.try;fe.prototype.errors=function(){return this._errors};fe.prototype.attempts=function(){return this._attempts};fe.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,i=0;i<this._errors.length;i++){var r=this._errors[i],o=r.message,s=(e[o]||0)+1;e[o]=s,s>=n&&(t=r,n=s)}return t}});var sc=S(et=>{var Py=oc();et.operation=function(e){var t=et.timeouts(e);return new Py(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};et.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],r=0;r<t.retries;r++)i.push(this.createTimeout(r,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(r,t)),i.sort(function(o,s){return o-s}),i};et.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,i=Math.round(n*t.minTimeout*Math.pow(t.factor,e));return i=Math.min(i,t.maxTimeout),i};et.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var i in e)typeof e[i]=="function"&&n.push(i)}for(var r=0;r<n.length;r++){var o=n[r],s=e[o];e[o]=function(l){var c=et.operation(t),u=Array.prototype.slice.call(arguments,1),f=u.pop();u.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){l.apply(e,u)})}.bind(e,s),e[o].options=t}}});var lc=S((Tw,ac)=>{ac.exports=sc()});var cc=S((Iw,zn)=>{zn.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&zn.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&zn.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var mc=S((Mw,At)=>{var P=global.process,tt=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};tt(P)?(uc=ue("assert"),St=cc(),fc=/^win/i.test(P.platform),zt=ue("events"),typeof zt!="function"&&(zt=zt.EventEmitter),P.__signal_exit_emitter__?J=P.__signal_exit_emitter__:(J=P.__signal_exit_emitter__=new zt,J.count=0,J.emitted={}),J.infinite||(J.setMaxListeners(1/0),J.infinite=!0),At.exports=function(e,t){if(!tt(global.process))return function(){};uc.equal(typeof e,"function","a callback must be provided for exit handler"),vt===!1&&Jr();var n="exit";t&&t.alwaysLast&&(n="afterexit");var i=function(){J.removeListener(n,e),J.listeners("exit").length===0&&J.listeners("afterexit").length===0&&Zn()};return J.on(n,e),i},Zn=function(){!vt||!tt(global.process)||(vt=!1,St.forEach(function(t){try{P.removeListener(t,ei[t])}catch{}}),P.emit=ti,P.reallyExit=Xr,J.count-=1)},At.exports.unload=Zn,nt=function(t,n,i){J.emitted[t]||(J.emitted[t]=!0,J.emit(t,n,i))},ei={},St.forEach(function(e){ei[e]=function(){if(tt(global.process)){var n=P.listeners(e);n.length===J.count&&(Zn(),nt("exit",null,e),nt("afterexit",null,e),fc&&e==="SIGHUP"&&(e="SIGINT"),P.kill(P.pid,e))}}}),At.exports.signals=function(){return St},vt=!1,Jr=function(){vt||!tt(global.process)||(vt=!0,J.count+=1,St=St.filter(function(t){try{return P.on(t,ei[t]),!0}catch{return!1}}),P.emit=pc,P.reallyExit=dc)},At.exports.load=Jr,Xr=P.reallyExit,dc=function(t){tt(global.process)&&(P.exitCode=t||0,nt("exit",P.exitCode,null),nt("afterexit",P.exitCode,null),Xr.call(P,P.exitCode))},ti=P.emit,pc=function(t,n){if(t==="exit"&&tt(global.process)){n!==void 0&&(P.exitCode=n);var i=ti.apply(this,arguments);return nt("exit",P.exitCode,null),nt("afterexit",P.exitCode,null),i}else return ti.apply(this,arguments)}):At.exports=function(){return function(){}};var uc,St,fc,zt,J,Zn,nt,ei,vt,Jr,Xr,dc,ti,pc});var yc=S((Lw,Qr)=>{"use strict";var hc=Symbol();function Dy(e,t,n){let i=t[hc];if(i)return t.stat(e,(o,s)=>{if(o)return n(o);n(null,s.mtime,i)});let r=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,r,r,o=>{if(o)return n(o);t.stat(e,(s,a)=>{if(s)return n(s);let l=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,hc,{value:l}),n(null,a.mtime,l)})})}function Fy(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}Qr.exports.probe=Dy;Qr.exports.getMtime=Fy});var Ac=S((Nw,en)=>{"use strict";var By=ue("path"),eo=Hr(),qy=lc(),$y=mc(),gc=yc(),Ee={};function Zt(e,t){return t.lockfilePath||`${e}.lock`}function to(e,t,n){if(!t.realpath)return n(null,By.resolve(e));t.fs.realpath(e,n)}function Zr(e,t,n){let i=Zt(e,t);t.fs.mkdir(i,r=>{if(!r)return gc.probe(i,t.fs,(o,s,a)=>{if(o)return t.fs.rmdir(i,()=>{}),n(o);n(null,s,a)});if(r.code!=="EEXIST")return n(r);if(t.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(i,(o,s)=>{if(o)return o.code==="ENOENT"?Zr(e,{...t,stale:0},n):n(o);if(!bc(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));Sc(e,t,a=>{if(a)return n(a);Zr(e,{...t,stale:0},n)})})})}function bc(e,t){return e.mtime.getTime()<Date.now()-t.stale}function Sc(e,t,n){t.fs.rmdir(Zt(e,t),i=>{if(i&&i.code!=="ENOENT")return n(i);n()})}function ni(e,t){let n=Ee[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(i,r)=>{let o=n.lastUpdate+t.stale<Date.now();if(i)return i.code==="ENOENT"||o?zr(e,n,Object.assign(i,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,ni(e,t));if(!(n.mtime.getTime()===r.mtime.getTime()))return zr(e,n,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=gc.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,a,a,l=>{let c=n.lastUpdate+t.stale<Date.now();if(!n.released){if(l)return l.code==="ENOENT"||c?zr(e,n,Object.assign(l,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,ni(e,t));n.mtime=a,n.lastUpdate=Date.now(),n.updateDelay=null,ni(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function zr(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),Ee[e]===t&&delete Ee[e],t.options.onCompromised(n)}function jy(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:eo,onCompromised:i=>{throw i},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),to(e,t,(i,r)=>{if(i)return n(i);let o=qy.operation(t.retries);o.attempt(()=>{Zr(r,t,(s,a,l)=>{if(o.retry(s))return;if(s)return n(o.mainError());let c=Ee[r]={lockfilePath:Zt(r,t),mtime:a,mtimePrecision:l,options:t,lastUpdate:Date.now()};ni(r,t),n(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));vc(r,{...t,realpath:!1},u)})})})})}function vc(e,t,n){t={fs:eo,realpath:!0,...t},to(e,t,(i,r)=>{if(i)return n(i);let o=Ee[r];if(!o)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete Ee[r],Sc(r,t,n)})}function Uy(e,t,n){t={stale:1e4,realpath:!0,fs:eo,...t},t.stale=Math.max(t.stale||0,2e3),to(e,t,(i,r)=>{if(i)return n(i);t.fs.stat(Zt(r,t),(o,s)=>o?o.code==="ENOENT"?n(null,!1):n(o):n(null,!bc(s,t)))})}function Ky(){return Ee}$y(()=>{for(let e in Ee){let t=Ee[e].options;try{t.fs.rmdirSync(Zt(e,t))}catch{}}});en.exports.lock=jy;en.exports.unlock=vc;en.exports.check=Uy;en.exports.getLocks=Ky});var wc=S((Rw,_c)=>{"use strict";var Vy=Hr();function Yy(e){let t=["mkdir","realpath","stat","rmdir","utimes"],n={...e};return t.forEach(i=>{n[i]=(...r)=>{let o=r.pop(),s;try{s=e[`${i}Sync`](...r)}catch(a){return o(a)}o(null,s)}}),n}function Gy(e){return(...t)=>new Promise((n,i)=>{t.push((r,o)=>{r?i(r):n(o)}),e(...t)})}function Wy(e){return(...t)=>{let n,i;if(t.push((r,o)=>{n=r,i=o}),e(...t),n)throw n;return i}}function Hy(e){if(e={...e},e.fs=Yy(e.fs||Vy),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}_c.exports={toPromise:Gy,toSync:Wy,toSyncOptions:Hy}});var io=S((Pw,Re)=>{"use strict";var _t=Ac(),{toPromise:ii,toSync:ri,toSyncOptions:no}=wc();async function Ec(e,t){let n=await ii(_t.lock)(e,t);return ii(n)}function Jy(e,t){let n=ri(_t.lock)(e,no(t));return ri(n)}function Xy(e,t){return ii(_t.unlock)(e,t)}function Qy(e,t){return ri(_t.unlock)(e,no(t))}function zy(e,t){return ii(_t.check)(e,t)}function Zy(e,t){return ri(_t.check)(e,no(t))}Re.exports=Ec;Re.exports.lock=Ec;Re.exports.unlock=Xy;Re.exports.lockSync=Jy;Re.exports.unlockSync=Qy;Re.exports.check=zy;Re.exports.checkSync=Zy});var I=S(ee=>{"use strict";var so=Symbol.for("yaml.alias"),Ic=Symbol.for("yaml.document"),oi=Symbol.for("yaml.map"),Mc=Symbol.for("yaml.pair"),ao=Symbol.for("yaml.scalar"),si=Symbol.for("yaml.seq"),xe=Symbol.for("yaml.node.type"),ig=e=>!!e&&typeof e=="object"&&e[xe]===so,rg=e=>!!e&&typeof e=="object"&&e[xe]===Ic,og=e=>!!e&&typeof e=="object"&&e[xe]===oi,sg=e=>!!e&&typeof e=="object"&&e[xe]===Mc,Lc=e=>!!e&&typeof e=="object"&&e[xe]===ao,ag=e=>!!e&&typeof e=="object"&&e[xe]===si;function Nc(e){if(e&&typeof e=="object")switch(e[xe]){case oi:case si:return!0}return!1}function lg(e){if(e&&typeof e=="object")switch(e[xe]){case so:case oi:case ao:case si:return!0}return!1}var cg=e=>(Lc(e)||Nc(e))&&!!e.anchor;ee.ALIAS=so;ee.DOC=Ic;ee.MAP=oi;ee.NODE_TYPE=xe;ee.PAIR=Mc;ee.SCALAR=ao;ee.SEQ=si;ee.hasAnchor=cg;ee.isAlias=ig;ee.isCollection=Nc;ee.isDocument=rg;ee.isMap=og;ee.isNode=lg;ee.isPair=sg;ee.isScalar=Lc;ee.isSeq=ag});var tn=S(lo=>{"use strict";var V=I(),ae=Symbol("break visit"),Rc=Symbol("skip children"),Se=Symbol("remove node");function ai(e,t){let n=Pc(t);V.isDocument(e)?xt(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):xt(null,e,n,Object.freeze([]))}ai.BREAK=ae;ai.SKIP=Rc;ai.REMOVE=Se;function xt(e,t,n,i){let r=Dc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Fc(e,i,r),xt(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=xt(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=xt("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=xt("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}async function li(e,t){let n=Pc(t);V.isDocument(e)?await kt(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):await kt(null,e,n,Object.freeze([]))}li.BREAK=ae;li.SKIP=Rc;li.REMOVE=Se;async function kt(e,t,n,i){let r=await Dc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Fc(e,i,r),kt(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=await kt(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=await kt("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=await kt("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}function Pc(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Dc(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(V.isMap(t))return n.Map?.(e,t,i);if(V.isSeq(t))return n.Seq?.(e,t,i);if(V.isPair(t))return n.Pair?.(e,t,i);if(V.isScalar(t))return n.Scalar?.(e,t,i);if(V.isAlias(t))return n.Alias?.(e,t,i)}function Fc(e,t,n){let i=t[t.length-1];if(V.isCollection(i))i.items[e]=n;else if(V.isPair(i))e==="key"?i.key=n:i.value=n;else if(V.isDocument(i))i.contents=n;else{let r=V.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}lo.visit=ai;lo.visitAsync=li});var co=S(qc=>{"use strict";var Bc=I(),ug=tn(),fg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dg=e=>e.replace(/[!,[\]{}]/g,t=>fg[t]),nn=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+dg(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&Bc.isNode(t.contents)){let o={};ug.visit(t.contents,(s,a)=>{Bc.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
|
|
3
|
+
GFS4: `),console.error(e)});F[Z]||(tc=global[Z]||[],ic(F,tc),F.close=(function(e){function t(n,i){return e.call(F,n,function(r){r||nc(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Qn,{value:e}),t})(F.close),F.closeSync=(function(e){function t(n){e.apply(F,arguments),nc()}return Object.defineProperty(t,Qn,{value:e}),t})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ze(F[Z]),ue("assert").equal(F[Z].length,0)}));var tc;global[Z]||ic(global,F[Z]);Wr.exports=Yr(Ny(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Wr.exports=Yr(F),F.__patched=!0);function Yr(e){My(e),e.gracefulify=Yr,e.createReadStream=k,e.createWriteStream=C;var t=e.readFile;e.readFile=n;function n(A,O,E){return typeof O=="function"&&(E=O,O=null),T(A,O,E);function T($,H,D,q){return t($,H,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?bt([T,[$,H,D],N,q||Date.now(),Date.now()]):typeof D=="function"&&D.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=r;function r(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(H,D,q,N,Q){return i(H,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[H,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(H,D,q,N,Q){return o(H,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[H,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=l);function l(A,O,E,T){return typeof E=="function"&&(T=E,E=0),$(A,O,E,T);function $(H,D,q,N,Q){return a(H,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[H,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var c=e.readdir;e.readdir=f;var u=/^v[0-5]\./;function f(A,O,E){typeof O=="function"&&(E=O,O=null);var T=u.test(process.version)?function(D,q,N,Q){return c(D,$(D,q,N,Q))}:function(D,q,N,Q){return c(D,q,$(D,q,N,Q))};return T(A,O,E);function $(H,D,q,N){return function(Q,R){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?bt([T,[H,D,q],Q,N||Date.now(),Date.now()]):(R&&R.sort&&R.sort(),typeof q=="function"&&q.call(this,Q,R))}}}if(process.version.substr(0,4)==="v0.8"){var d=Ly(e);g=d.ReadStream,v=d.WriteStream}var p=e.ReadStream;p&&(g.prototype=Object.create(p.prototype),g.prototype.open=b);var h=e.WriteStream;h&&(v.prototype=Object.create(h.prototype),v.prototype.open=x),Object.defineProperty(e,"ReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var y=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0});function g(A,O){return this instanceof g?(p.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function b(){var A=this;_(A.path,A.flags,A.mode,function(O,E){O?(A.autoClose&&A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E),A.read())})}function v(A,O){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var A=this;_(A.path,A.flags,A.mode,function(O,E){O?(A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E))})}function k(A,O){return new e.ReadStream(A,O)}function C(A,O){return new e.WriteStream(A,O)}var M=e.open;e.open=_;function _(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(H,D,q,N,Q){return M(H,D,q,function(R,yw){R&&(R.code==="EMFILE"||R.code==="ENFILE")?bt([$,[H,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}return e}function bt(e){Ze("ENQUEUE",e[0].name,e[1]),F[Z].push(e),Gr()}var Xn;function nc(){for(var e=Date.now(),t=0;t<F[Z].length;++t)F[Z][t].length>2&&(F[Z][t][3]=e,F[Z][t][4]=e);Gr()}function Gr(){if(clearTimeout(Xn),Xn=void 0,F[Z].length!==0){var e=F[Z].shift(),t=e[0],n=e[1],i=e[2],r=e[3],o=e[4];if(r===void 0)Ze("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){Ze("TIMEOUT",t.name,n);var s=n.pop();typeof s=="function"&&s.call(null,i)}else{var a=Date.now()-o,l=Math.max(o-r,1),c=Math.min(l*1.2,100);a>=c?(Ze("RETRY",t.name,n),t.apply(null,n.concat([r]))):F[Z].push(e)}Xn===void 0&&(Xn=setTimeout(Gr,0))}}});var oc=S((Cw,rc)=>{function fe(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rc.exports=fe;fe.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};fe.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};fe.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var i=this,r=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},n);return this._options.unref&&r.unref(),!0};fe.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};fe.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};fe.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};fe.prototype.start=fe.prototype.try;fe.prototype.errors=function(){return this._errors};fe.prototype.attempts=function(){return this._attempts};fe.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,i=0;i<this._errors.length;i++){var r=this._errors[i],o=r.message,s=(e[o]||0)+1;e[o]=s,s>=n&&(t=r,n=s)}return t}});var sc=S(et=>{var Py=oc();et.operation=function(e){var t=et.timeouts(e);return new Py(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};et.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],r=0;r<t.retries;r++)i.push(this.createTimeout(r,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(r,t)),i.sort(function(o,s){return o-s}),i};et.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,i=Math.round(n*t.minTimeout*Math.pow(t.factor,e));return i=Math.min(i,t.maxTimeout),i};et.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var i in e)typeof e[i]=="function"&&n.push(i)}for(var r=0;r<n.length;r++){var o=n[r],s=e[o];e[o]=function(l){var c=et.operation(t),u=Array.prototype.slice.call(arguments,1),f=u.pop();u.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){l.apply(e,u)})}.bind(e,s),e[o].options=t}}});var lc=S((Tw,ac)=>{ac.exports=sc()});var cc=S((Iw,zn)=>{zn.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&zn.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&zn.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var mc=S((Mw,At)=>{var P=global.process,tt=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};tt(P)?(uc=ue("assert"),St=cc(),fc=/^win/i.test(P.platform),zt=ue("events"),typeof zt!="function"&&(zt=zt.EventEmitter),P.__signal_exit_emitter__?X=P.__signal_exit_emitter__:(X=P.__signal_exit_emitter__=new zt,X.count=0,X.emitted={}),X.infinite||(X.setMaxListeners(1/0),X.infinite=!0),At.exports=function(e,t){if(!tt(global.process))return function(){};uc.equal(typeof e,"function","a callback must be provided for exit handler"),vt===!1&&Jr();var n="exit";t&&t.alwaysLast&&(n="afterexit");var i=function(){X.removeListener(n,e),X.listeners("exit").length===0&&X.listeners("afterexit").length===0&&Zn()};return X.on(n,e),i},Zn=function(){!vt||!tt(global.process)||(vt=!1,St.forEach(function(t){try{P.removeListener(t,ei[t])}catch{}}),P.emit=ti,P.reallyExit=Xr,X.count-=1)},At.exports.unload=Zn,nt=function(t,n,i){X.emitted[t]||(X.emitted[t]=!0,X.emit(t,n,i))},ei={},St.forEach(function(e){ei[e]=function(){if(tt(global.process)){var n=P.listeners(e);n.length===X.count&&(Zn(),nt("exit",null,e),nt("afterexit",null,e),fc&&e==="SIGHUP"&&(e="SIGINT"),P.kill(P.pid,e))}}}),At.exports.signals=function(){return St},vt=!1,Jr=function(){vt||!tt(global.process)||(vt=!0,X.count+=1,St=St.filter(function(t){try{return P.on(t,ei[t]),!0}catch{return!1}}),P.emit=pc,P.reallyExit=dc)},At.exports.load=Jr,Xr=P.reallyExit,dc=function(t){tt(global.process)&&(P.exitCode=t||0,nt("exit",P.exitCode,null),nt("afterexit",P.exitCode,null),Xr.call(P,P.exitCode))},ti=P.emit,pc=function(t,n){if(t==="exit"&&tt(global.process)){n!==void 0&&(P.exitCode=n);var i=ti.apply(this,arguments);return nt("exit",P.exitCode,null),nt("afterexit",P.exitCode,null),i}else return ti.apply(this,arguments)}):At.exports=function(){return function(){}};var uc,St,fc,zt,X,Zn,nt,ei,vt,Jr,Xr,dc,ti,pc});var yc=S((Lw,Qr)=>{"use strict";var hc=Symbol();function Dy(e,t,n){let i=t[hc];if(i)return t.stat(e,(o,s)=>{if(o)return n(o);n(null,s.mtime,i)});let r=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,r,r,o=>{if(o)return n(o);t.stat(e,(s,a)=>{if(s)return n(s);let l=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,hc,{value:l}),n(null,a.mtime,l)})})}function Fy(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}Qr.exports.probe=Dy;Qr.exports.getMtime=Fy});var Ac=S((Nw,en)=>{"use strict";var By=ue("path"),eo=Hr(),qy=lc(),$y=mc(),gc=yc(),Ee={};function Zt(e,t){return t.lockfilePath||`${e}.lock`}function to(e,t,n){if(!t.realpath)return n(null,By.resolve(e));t.fs.realpath(e,n)}function Zr(e,t,n){let i=Zt(e,t);t.fs.mkdir(i,r=>{if(!r)return gc.probe(i,t.fs,(o,s,a)=>{if(o)return t.fs.rmdir(i,()=>{}),n(o);n(null,s,a)});if(r.code!=="EEXIST")return n(r);if(t.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(i,(o,s)=>{if(o)return o.code==="ENOENT"?Zr(e,{...t,stale:0},n):n(o);if(!bc(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));Sc(e,t,a=>{if(a)return n(a);Zr(e,{...t,stale:0},n)})})})}function bc(e,t){return e.mtime.getTime()<Date.now()-t.stale}function Sc(e,t,n){t.fs.rmdir(Zt(e,t),i=>{if(i&&i.code!=="ENOENT")return n(i);n()})}function ni(e,t){let n=Ee[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(i,r)=>{let o=n.lastUpdate+t.stale<Date.now();if(i)return i.code==="ENOENT"||o?zr(e,n,Object.assign(i,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,ni(e,t));if(!(n.mtime.getTime()===r.mtime.getTime()))return zr(e,n,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=gc.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,a,a,l=>{let c=n.lastUpdate+t.stale<Date.now();if(!n.released){if(l)return l.code==="ENOENT"||c?zr(e,n,Object.assign(l,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,ni(e,t));n.mtime=a,n.lastUpdate=Date.now(),n.updateDelay=null,ni(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function zr(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),Ee[e]===t&&delete Ee[e],t.options.onCompromised(n)}function jy(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:eo,onCompromised:i=>{throw i},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),to(e,t,(i,r)=>{if(i)return n(i);let o=qy.operation(t.retries);o.attempt(()=>{Zr(r,t,(s,a,l)=>{if(o.retry(s))return;if(s)return n(o.mainError());let c=Ee[r]={lockfilePath:Zt(r,t),mtime:a,mtimePrecision:l,options:t,lastUpdate:Date.now()};ni(r,t),n(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));vc(r,{...t,realpath:!1},u)})})})})}function vc(e,t,n){t={fs:eo,realpath:!0,...t},to(e,t,(i,r)=>{if(i)return n(i);let o=Ee[r];if(!o)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete Ee[r],Sc(r,t,n)})}function Uy(e,t,n){t={stale:1e4,realpath:!0,fs:eo,...t},t.stale=Math.max(t.stale||0,2e3),to(e,t,(i,r)=>{if(i)return n(i);t.fs.stat(Zt(r,t),(o,s)=>o?o.code==="ENOENT"?n(null,!1):n(o):n(null,!bc(s,t)))})}function Ky(){return Ee}$y(()=>{for(let e in Ee){let t=Ee[e].options;try{t.fs.rmdirSync(Zt(e,t))}catch{}}});en.exports.lock=jy;en.exports.unlock=vc;en.exports.check=Uy;en.exports.getLocks=Ky});var wc=S((Rw,_c)=>{"use strict";var Vy=Hr();function Yy(e){let t=["mkdir","realpath","stat","rmdir","utimes"],n={...e};return t.forEach(i=>{n[i]=(...r)=>{let o=r.pop(),s;try{s=e[`${i}Sync`](...r)}catch(a){return o(a)}o(null,s)}}),n}function Gy(e){return(...t)=>new Promise((n,i)=>{t.push((r,o)=>{r?i(r):n(o)}),e(...t)})}function Wy(e){return(...t)=>{let n,i;if(t.push((r,o)=>{n=r,i=o}),e(...t),n)throw n;return i}}function Hy(e){if(e={...e},e.fs=Yy(e.fs||Vy),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}_c.exports={toPromise:Gy,toSync:Wy,toSyncOptions:Hy}});var io=S((Pw,Re)=>{"use strict";var _t=Ac(),{toPromise:ii,toSync:ri,toSyncOptions:no}=wc();async function Ec(e,t){let n=await ii(_t.lock)(e,t);return ii(n)}function Jy(e,t){let n=ri(_t.lock)(e,no(t));return ri(n)}function Xy(e,t){return ii(_t.unlock)(e,t)}function Qy(e,t){return ri(_t.unlock)(e,no(t))}function zy(e,t){return ii(_t.check)(e,t)}function Zy(e,t){return ri(_t.check)(e,no(t))}Re.exports=Ec;Re.exports.lock=Ec;Re.exports.unlock=Xy;Re.exports.lockSync=Jy;Re.exports.unlockSync=Qy;Re.exports.check=zy;Re.exports.checkSync=Zy});var I=S(ee=>{"use strict";var so=Symbol.for("yaml.alias"),Ic=Symbol.for("yaml.document"),oi=Symbol.for("yaml.map"),Mc=Symbol.for("yaml.pair"),ao=Symbol.for("yaml.scalar"),si=Symbol.for("yaml.seq"),xe=Symbol.for("yaml.node.type"),ig=e=>!!e&&typeof e=="object"&&e[xe]===so,rg=e=>!!e&&typeof e=="object"&&e[xe]===Ic,og=e=>!!e&&typeof e=="object"&&e[xe]===oi,sg=e=>!!e&&typeof e=="object"&&e[xe]===Mc,Lc=e=>!!e&&typeof e=="object"&&e[xe]===ao,ag=e=>!!e&&typeof e=="object"&&e[xe]===si;function Nc(e){if(e&&typeof e=="object")switch(e[xe]){case oi:case si:return!0}return!1}function lg(e){if(e&&typeof e=="object")switch(e[xe]){case so:case oi:case ao:case si:return!0}return!1}var cg=e=>(Lc(e)||Nc(e))&&!!e.anchor;ee.ALIAS=so;ee.DOC=Ic;ee.MAP=oi;ee.NODE_TYPE=xe;ee.PAIR=Mc;ee.SCALAR=ao;ee.SEQ=si;ee.hasAnchor=cg;ee.isAlias=ig;ee.isCollection=Nc;ee.isDocument=rg;ee.isMap=og;ee.isNode=lg;ee.isPair=sg;ee.isScalar=Lc;ee.isSeq=ag});var tn=S(lo=>{"use strict";var V=I(),ae=Symbol("break visit"),Rc=Symbol("skip children"),Se=Symbol("remove node");function ai(e,t){let n=Pc(t);V.isDocument(e)?xt(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):xt(null,e,n,Object.freeze([]))}ai.BREAK=ae;ai.SKIP=Rc;ai.REMOVE=Se;function xt(e,t,n,i){let r=Dc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Fc(e,i,r),xt(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=xt(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=xt("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=xt("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}async function li(e,t){let n=Pc(t);V.isDocument(e)?await kt(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):await kt(null,e,n,Object.freeze([]))}li.BREAK=ae;li.SKIP=Rc;li.REMOVE=Se;async function kt(e,t,n,i){let r=await Dc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Fc(e,i,r),kt(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=await kt(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=await kt("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=await kt("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}function Pc(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Dc(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(V.isMap(t))return n.Map?.(e,t,i);if(V.isSeq(t))return n.Seq?.(e,t,i);if(V.isPair(t))return n.Pair?.(e,t,i);if(V.isScalar(t))return n.Scalar?.(e,t,i);if(V.isAlias(t))return n.Alias?.(e,t,i)}function Fc(e,t,n){let i=t[t.length-1];if(V.isCollection(i))i.items[e]=n;else if(V.isPair(i))e==="key"?i.key=n:i.value=n;else if(V.isDocument(i))i.contents=n;else{let r=V.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}lo.visit=ai;lo.visitAsync=li});var co=S(qc=>{"use strict";var Bc=I(),ug=tn(),fg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dg=e=>e.replace(/[!,[\]{}]/g,t=>fg[t]),nn=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+dg(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&Bc.isNode(t.contents)){let o={};ug.visit(t.contents,(s,a)=>{Bc.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
|
|
4
4
|
`)}};nn.defaultYaml={explicit:!1,version:"1.2"};nn.defaultTags={"!!":"tag:yaml.org,2002:"};qc.Directives=nn});var ci=S(rn=>{"use strict";var $c=I(),pg=tn();function mg(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function jc(e){let t=new Set;return pg.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function Uc(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function hg(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=jc(e));let s=Uc(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&($c.isScalar(s.node)||$c.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}rn.anchorIsValid=mg;rn.anchorNames=jc;rn.createNodeAnchors=hg;rn.findNewAnchor=Uc});var uo=S(Kc=>{"use strict";function on(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let s=i[r],a=on(e,i,String(r),s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),s=on(e,i,r,o);s===void 0?i.delete(r):s!==o&&i.set(r,s)}else if(i instanceof Set)for(let r of Array.from(i)){let o=on(e,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let s=on(e,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return e.call(t,n,i)}Kc.applyReviver=on});var De=S(Yc=>{"use strict";var yg=I();function Vc(e,t,n){if(Array.isArray(e))return e.map((i,r)=>Vc(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!yg.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}Yc.toJS=Vc});var ui=S(Wc=>{"use strict";var gg=uo(),Gc=I(),bg=De(),fo=class{constructor(t){Object.defineProperty(this,Gc.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!Gc.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=bg.toJS(this,"",s);if(typeof r=="function")for(let{count:l,res:c}of s.anchors.values())r(c,l);return typeof o=="function"?gg.applyReviver(o,{"":a},"",a):a}};Wc.NodeBase=fo});var sn=S(Hc=>{"use strict";var Sg=ci(),vg=tn(),Ct=I(),Ag=ui(),_g=De(),po=class extends Ag.NodeBase{constructor(t){super(Ct.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],vg.visit(t,{Node:(o,s)=>{(Ct.isAlias(s)||Ct.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(t,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,s=this.resolve(r,n);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(s);if(a||(_g.toJS(s,null,n),a=i.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=fi(r,s,i)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,i){let r=`*${this.source}`;if(t){if(Sg.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function fi(e,t,n){if(Ct.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ct.isCollection(t)){let i=0;for(let r of t.items){let o=fi(e,r,n);o>i&&(i=o)}return i}else if(Ct.isPair(t)){let i=fi(e,t.key,n),r=fi(e,t.value,n);return Math.max(i,r)}return 1}Hc.Alias=po});var U=S(mo=>{"use strict";var wg=I(),Eg=ui(),xg=De(),kg=e=>!e||typeof e!="function"&&typeof e!="object",Fe=class extends Eg.NodeBase{constructor(t){super(wg.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:xg.toJS(this.value,t,n)}toString(){return String(this.value)}};Fe.BLOCK_FOLDED="BLOCK_FOLDED";Fe.BLOCK_LITERAL="BLOCK_LITERAL";Fe.PLAIN="PLAIN";Fe.QUOTE_DOUBLE="QUOTE_DOUBLE";Fe.QUOTE_SINGLE="QUOTE_SINGLE";mo.Scalar=Fe;mo.isScalarValue=kg});var an=S(Xc=>{"use strict";var Cg=sn(),rt=I(),Jc=U(),Og="tag:yaml.org,2002:";function Tg(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function Ig(e,t,n){if(rt.isDocument(e)&&(e=e.contents),rt.isNode(e))return e;if(rt.isPair(e)){let f=n.schema[rt.MAP].createNode?.(n.schema,null,n);return f.items.push(e),f}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,l;if(i&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=r(e)),new Cg.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Og+t.slice(2));let c=Tg(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let f=new Jc.Scalar(e);return l&&(l.node=f),f}c=e instanceof Map?s[rt.MAP]:Symbol.iterator in Object(e)?s[rt.SEQ]:s[rt.MAP]}o&&(o(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new Jc.Scalar(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}Xc.createNode=Ig});var pi=S(di=>{"use strict";var Mg=an(),ve=I(),Lg=ui();function ho(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return Mg.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Qc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,yo=class extends Lg.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>ve.isNode(i)||ve.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Qc(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(ve.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,ho(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(ve.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&ve.isScalar(o)?o.value:o:ve.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ve.isPair(n))return!1;let i=n.value;return i==null||t&&ve.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return ve.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(ve.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,ho(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};di.Collection=yo;di.collectionFromPath=ho;di.isEmptyPath=Qc});var ln=S(mi=>{"use strict";var Ng=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function go(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Rg=(e,t,n)=>e.endsWith(`
|
|
5
5
|
`)?go(n,t):n.includes(`
|
|
6
6
|
`)?`
|
|
@@ -184,10 +184,10 @@ ${o}`}function om(e,t=process.env){return Va({platform:e,internalBuild:t.__MAVIS
|
|
|
184
184
|
`+e.slice(r,o),r=o+1),s=a;return l+=`
|
|
185
185
|
`,e.length-r>t&&s>r?l+=e.slice(r,s)+`
|
|
186
186
|
`+e.slice(s+1):l+=e.slice(r),l.slice(1)}function iy(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=Wt(e,r),i=te[n],!i&&Qt(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Hh(n);return t}function ry(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(we(e,t,a,!1,!1)||typeof a>"u"&&we(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function rl(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(we(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&we(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Pr(e,t)),e.dump&&Jt===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function oy(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,c,u;for(s=0,a=o.length;s<a;s+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=o[s],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),we(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),we(e,t,c,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function sy(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,c,u,f,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ie("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)d="",(!i||r!=="")&&(d+=Pr(e,t)),c=s[a],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),we(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Jt===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,f&&(d+=Pr(e,t)),we(e,t+1,u,!0,f)&&(e.dump&&Jt===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,r+=d));e.tag=o,e.dump=r||"{}"}function ol(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Fl.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Bl.call(a.represent,l))i=a.represent[l](t,l);else throw new ie("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function we(e,t,n,i,r,o,s){e.tag=null,e.dump=n,ol(e,n,!1)||ol(e,n,!0);var a=Fl.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",f,d;if(u&&(f=e.duplicates.indexOf(n),d=f!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(r=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(u&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(sy(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(oy(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?rl(e,t-1,e.dump,r):rl(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(ry(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&ty(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ie("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function ay(e,t){var n=[],i=[],r,o;for(Fr(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function Fr(e,t,n){var i,r,o;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)Fr(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)Fr(e[i[r]],t,n)}function ly(e,t){t=t||{};var n=new Xh(t);n.noRefs||ay(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),we(n,0,i,!0,!0)?n.dump+`
|
|
187
|
-
`:""}var cy=ly,uy={dump:cy};function Kr(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var fy=z,dy=ll,py=dl,my=gl,hy=bl,yy=qr,gy=Dl.load,by=Dl.loadAll,Sy=uy.dump,vy=ie,Ay={binary:wl,float:yl,map:fl,null:pl,pairs:xl,set:kl,timestamp:Al,bool:ml,int:hl,merge:_l,omap:El,seq:ul,str:cl},_y=Kr("safeLoad","load"),wy=Kr("safeLoadAll","loadAll"),Ey=Kr("safeDump","dump"),
|
|
188
|
-
`)?n.source:JSON.stringify(n.source),r=n.tag?`!<${n.tag}> `:"",o=
|
|
189
|
-
`)||void 0,i.items=i.items.filter(a=>!r.includes(a));for(let[a,l]of Object.entries(o))i.has(_d(i,a))||i.set(a,vd(e,l))}}),e.setSchema(e.directives?.yaml.version??"1.2",{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!1})}function vd(e,t){let n=e.createNode(t,{aliasDuplicateObjects:!1});return(0,Y.visit)(n,{Pair(i,r){(0,Y.isScalar)(r.key)&&r.key.value==="<<"&&(r.key.type="QUOTE_DOUBLE")}}),n}function Lv(e,t){if(Dt(t.custom_provider))for(let[n,i]of Object.entries(t.custom_provider)){if(!Dt(i)||!Dt(i.models))continue;let r=wd(e,["custom_provider",n,"models"]);Ed(e,r,Object.keys(i.models))}}function Ed(e,t,n){let i=e.getIn(t,!0);if(!(0,Y.isMap)(i))throw new Error("Expected a model mapping when applying config order");let r=new Map(i.items.map(o=>[(0,Y.isScalar)(o.key)?String(o.key.value):o.key,o]));i.items=n.map(o=>{let s=r.get(o);if(!s)throw new Error("Expected an existing model when applying config order");return s})}function js(e,t,n=[]){if(!Dt(e)||!Dt(t))return Nv(e,t)?[]:[{kind:"set",path:n,value:t}];let i=[];for(let r of new Set([...Object.keys(e),...Object.keys(t)])){let o=[...n,r];!(r in t)||t[r]===void 0?i.push({kind:"delete",path:o}):r in e?i.push(...js(e[r],t[r],o)):i.push({kind:"set",path:o,value:t[r]})}if(n.length===3&&n[0]==="custom_provider"&&n[2]==="models"){let r=Object.keys(t).filter(o=>t[o]!==void 0);Us(Object.keys(e),r)||i.push({kind:"reorder",path:n,keys:r})}return i}function Nv(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Ad(e){return H.dump(e,{indent:2,lineWidth:-1,noRefs:!0})}function Dt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ft(e){if(typeof e!="object"||e===null)return!1;if("v2_enabled"in e&&typeof e.v2_enabled=="boolean")return e.v2_enabled;if(!("v2"in e))return!1;let t=e.v2;return typeof t!="object"||t===null?!1:"enabled"in t&&typeof t.enabled=="boolean"?t.enabled:"writeEnabled"in t&&t.writeEnabled===!0||"recallEnabled"in t&&t.recallEnabled===!0}var ir={enabled:!1,detailedLoggingEnabled:!1,writeEnabled:!1,recallEnabled:!1,eligibleSessionIdleMs:600*1e3,maxCaptureInputTokens:64e3,maxSessionDocBytes:64*1024,maxSelectedSessions:256,maxConsolidationInputTokens:256e3,maxMemoryMarkdownBytes:2*1024*1024,maxSummaryInjectionTokens:2500,maxCaptureSessionsPerWake:6,maxCaptureConcurrency:2,eligibleSessionMaxAgeDays:30,maxCaptureAttemptsPerRevision:3,captureFailureBackoffMs:3600*1e3,publicationCooldownMs:360*60*1e3,maxConsolidationAgentTurns:64,minModelQuotaRemainingPercent:25,captureModel:void 0,captureReasoningEffort:"low",consolidationModel:void 0,consolidationReasoningEffort:"medium",retentionDays:90};function Cd(e,t){let n=e.memory,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:{},r=i.dailyDigest,o=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},s=i.v2,a=s!=null&&typeof s=="object"&&!Array.isArray(s)?s:{},l=t.v2,c=i.legacyRecallDisabledAgents;return{legacyRecallDisabledAgents:c&&typeof c=="object"&&!Array.isArray(c)?Object.fromEntries(Object.entries(c).filter(([,u])=>typeof u=="boolean")):{},enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,proactive:typeof i.proactive=="boolean"?i.proactive:t.proactive,dailyDigest:{enabled:typeof o.enabled=="boolean"?o.enabled:t.dailyDigest.enabled},v2_enabled:typeof i.v2_enabled=="boolean"||["enabled","writeEnabled","recallEnabled"].some(u=>typeof a[u]=="boolean")?Ft(i):Ft(t),v2:{...typeof a.enabled=="boolean"?{enabled:a.enabled}:{},detailedLoggingEnabled:Ks(a.detailedLoggingEnabled,l.detailedLoggingEnabled),writeEnabled:Ks(a.writeEnabled,l.writeEnabled),recallEnabled:Ks(a.recallEnabled,l.recallEnabled),eligibleSessionIdleMs:re(a.eligibleSessionIdleMs,l.eligibleSessionIdleMs),maxCaptureInputTokens:re(a.maxCaptureInputTokens,l.maxCaptureInputTokens),maxSessionDocBytes:re(a.maxSessionDocBytes,l.maxSessionDocBytes),maxSelectedSessions:re(a.maxSelectedSessions,l.maxSelectedSessions),maxConsolidationInputTokens:re(a.maxConsolidationInputTokens,l.maxConsolidationInputTokens),maxMemoryMarkdownBytes:re(a.maxMemoryMarkdownBytes,l.maxMemoryMarkdownBytes),maxSummaryInjectionTokens:re(a.maxSummaryInjectionTokens,l.maxSummaryInjectionTokens),maxCaptureSessionsPerWake:re(a.maxCaptureSessionsPerWake,l.maxCaptureSessionsPerWake),maxCaptureConcurrency:re(a.maxCaptureConcurrency,l.maxCaptureConcurrency),eligibleSessionMaxAgeDays:re(a.eligibleSessionMaxAgeDays,l.eligibleSessionMaxAgeDays),maxCaptureAttemptsPerRevision:re(a.maxCaptureAttemptsPerRevision,l.maxCaptureAttemptsPerRevision),captureFailureBackoffMs:re(a.captureFailureBackoffMs,l.captureFailureBackoffMs),publicationCooldownMs:re(a.publicationCooldownMs,l.publicationCooldownMs),maxConsolidationAgentTurns:re(a.maxConsolidationAgentTurns,l.maxConsolidationAgentTurns),minModelQuotaRemainingPercent:Rv(a.minModelQuotaRemainingPercent,l.minModelQuotaRemainingPercent),captureModel:xd(a.captureModel,l.captureModel),captureReasoningEffort:kd(a.captureReasoningEffort,l.captureReasoningEffort),consolidationModel:xd(a.consolidationModel,l.consolidationModel),consolidationReasoningEffort:kd(a.consolidationReasoningEffort,l.consolidationReasoningEffort),retentionDays:re(a.retentionDays,l.retentionDays)}}}function Ks(e,t){return typeof e=="boolean"?e:t}function re(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function Rv(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&e<=100?e:t}function xd(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}function kd(e,t){return e==="low"||e==="medium"||e==="high"?e:t}function Pv(e,t){return!Ft(e)&&e?.enabled!==!1&&e?.legacyRecallDisabledAgents?.[t]!==!0}import oe from"node:path";import RA from"node:os";import{spawnSync as PA}from"node:child_process";import{fileURLToPath as DA}from"node:url";function Od(e){let t=e.tui;if(t==null||typeof t!="object"||Array.isArray(t))return{};let n=t,i=n.notifications,r;if(i&&typeof i=="object"&&!Array.isArray(i)){let{when:l,method:c}=i;r={...l==="unfocused"||l==="always"||l==="never"?{when:l}:{},...c==="auto"||c==="osc9"||c==="osc777"||c==="bel"?{method:c}:{}}}let o=n.statusLine,s=Array.isArray(o)?o.filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean):void 0,a=Dv(n.customStatusLine);return{...typeof n.showTips=="boolean"?{showTips:n.showTips}:{},...r?{notifications:r}:{},...s?{statusLine:s}:{},...a?{customStatusLine:a}:{}}}function Dv(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n=typeof t.command=="string"?t.command.trim():"";if(n)return{command:n,...t.display==="inline"||t.display==="block"?{display:t.display}:{},...t.position==="above"||t.position==="below"?{position:t.position}:{},...t.colorMode==="plain"||t.colorMode==="ansi"?{colorMode:t.colorMode}:{},...typeof t.maxLines=="number"&&Number.isFinite(t.maxLines)?{maxLines:t.maxLines}:{},...typeof t.timeoutMs=="number"&&Number.isFinite(t.timeoutMs)?{timeoutMs:t.timeoutMs}:{},...typeof t.intervalSeconds=="number"&&Number.isFinite(t.intervalSeconds)?{intervalSeconds:t.intervalSeconds}:{}}}import{createHash as Fv,randomUUID as Bv}from"node:crypto";import or from"node:fs";import rr from"node:path";function Md(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n={};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseURL=="string"&&(n.baseURL=t.baseURL);let i=Ys(t.modelContextLimits);return i&&(n.modelContextLimits=i),Object.keys(n).length>0?n:void 0}function Ys(e){if(!B(e))return;let t=Object.entries(e).filter(n=>n[0].length>0&&Number.isSafeInteger(n[1])&&n[1]>0);return t.length>0?Object.fromEntries(t):void 0}function Ld(e,t){return t?Object.fromEntries(Object.entries(e).map(([n,i])=>{let r=t[n];return[n,r!==void 0&&i.contextWindowOptions?.includes(r)?{...i,limit:{...i.limit,context:r}}:i]})):e}function Gs(e){let t=e.provider?.minimax,n=t?.catalogModels??t?.models??wt;return Ld(Object.fromEntries(Object.entries(n).filter(([,i])=>i.enabled!==!1)),e.minimax_api?.modelContextLimits)}function Nd(e,t){let n=e.minimax;return n?.models?{...e,minimax:{...n,catalogModels:n.models,models:Ld(n.models,t)}}:e}function Rd(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=Object.entries(e).filter(([,n])=>n!=null&&typeof n=="object"&&!Array.isArray(n));if(t.length!==0)return Object.fromEntries(t.map(([n,i])=>[n,Dd(i)]))}function Pd(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,B(n)?Dd(n):n]))}function Dd(e){if(!B(e.models))return e;let t=!1,n=Object.fromEntries(Object.entries(e.models).map(([i,r])=>{if(!B(r)||!B(r.thinking))return[i,r];let o=typeof r.thinking.effort=="string"?r.thinking.effort.trim():"",s=typeof r.thinking.defaultEffort=="string"?r.thinking.defaultEffort.trim():"";if(!Object.hasOwn(r.thinking,"effort")&&!Object.hasOwn(r.thinking,"defaultEffort"))return[i,r];let a=[],l=new Set;if(Array.isArray(r.thinking.effortOptions))for(let d of r.thinking.effortOptions){if(typeof d!="string")continue;let p=d.trim();!p||l.has(p)||(l.add(p),a.push(p))}o&&!l.has(o)&&(l.add(o),a.push(o)),s&&!l.has(s)&&(l.add(s),a.push(s));let c={...r.thinking};delete c.effort,delete c.effortOptions,delete c.defaultEffort;let u={...c,...a.length>0?{effortOptions:a}:{},...s?{defaultEffort:s}:{}},f={...r};return Object.keys(u).length>0?f.thinking=u:delete f.thinking,t=!0,[i,f]}));return t?{...e,models:n}:e}var Fd="byok_legacy_provider_to_custom_provider_v1",Bd="config.yaml.bak.byok-legacy-provider.",Vs=new Set(["minimax","minimax_api","provider","custom_provider"]),qv=/^[A-Za-z0-9 _-]+$/;function qd(e,t){let n={migrated:!1,migratedProviders:{}};if(!t.isManagedRuntime()||!or.existsSync(e))return n;let i=Uv(e);if(!B(i.provider))return n;let r=i.provider,o=B(i.custom_provider)?i.custom_provider:{},s=Qv(i),a={},l={...o},c=new Set(Object.keys(l)),u=!1,f=t.getManagedPreset().provider;for(let[d,p]of Object.entries(r)){if(!Kv(d,p,f))continue;let h=s.providers[d];if(h&&!Vs.has(h)&&!B(l[h])){delete r[d],u=!0;continue}let m=h&&!Vs.has(h)?h:Gv(d,p,c);a[d]=m,B(l[m])||(l[m]=Yv(p),c.add(m),u=!0),s.providers[d]!==m&&(s.providers[d]=m,u=!0),delete r[d],u=!0}if(!u&&Object.keys(a).length===0)return n;if(u=Id(i,"defaultModel",a)||u,u=Id(i,"defaultLightModel",a)||u,u=Jv(i,a)||u,!u)return{migrated:!1,migratedProviders:a};Object.keys(l).length>0?i.custom_provider=l:delete i.custom_provider,zv(i,s);try{let d=Xv(e);return it(e,H.dump(i,{indent:2,lineWidth:-1,noRefs:!0})),{migrated:!0,migratedProviders:a,backupPath:d}}catch(d){return console.warn(`[config] legacy BYOK provider migration skipped: ${eA(d)}`),{migrated:!1,migratedProviders:a}}}function $d(e,t){let n=e.provider,i=e.defaultModel;if(Object.prototype.hasOwnProperty.call(n,"minimax_api")){let{minimax_api:h,...m}=n;n=m,console.warn('[config] "minimax_api" is a reserved provider id; ignoring provider.minimax_api from config.yaml')}let o=t.getManagedPreset().provider.minimax,s=n.minimax,a=t.isManagedRuntime();if(!(a||$v(s,t)))return{provider:n,defaultModel:i};let c=s?.options,u=a&&t.shouldEnforceManagedProviderProtection(),f=jv(o.models,s?.models),d=typeof c?.baseURL=="string"&&c.baseURL.length>0?c.baseURL:void 0,p=u&&d!=null&&!t.isManagedPresetBaseUrl(d);return n={...n,minimax:{...o,...s??{},npm:s?.npm??o.npm,models:f,options:{...o.options??{},...c??{},...p?{apiKey:o.options?.apiKey}:{},...u?{authMode:"managed-login",baseURL:o.options?.baseURL}:{}}}},{provider:n,defaultModel:i}}function $v(e,t){let n=e?.options;return n?.authMode==="managed-login"?!0:typeof n?.baseURL=="string"&&t.isManagedPresetBaseUrl(n.baseURL)}function jv(e,t){return t&&Object.keys(t).length>0?t:e??{}}function Uv(e){try{let t=H.load(or.readFileSync(e,"utf-8"));return B(t)?t:{}}catch{return{}}}function Kv(e,t,n){return e==="minimax"||e==="minimax_api"||!Zv(t)||!Vv(t)?!1:!Object.prototype.hasOwnProperty.call(n,e)}function Vv(e){let t=B(e.options)?e.options:void 0;return typeof t?.apiKey=="string"&&t.apiKey.trim().length>0&&typeof t.baseURL=="string"&&t.baseURL.trim().length>0&&B(e.models)}function Yv(e){let t=B(e.options)?e.options:{};return{...e,kind:"custom",enabled:e.enabled!==!1,options:{...t,authMode:"api-key"}}}function Gv(e,t,n){let i=B(t)?t:{},r=typeof i.name=="string"?i.name:void 0,o=`provider-${Wv(e)}`,s=Td(e)??Td(r)??o;for(let a=0;;a+=1){let l=a===0?s:`${s}-${a+1}`;if(!n.has(l)&&!Vs.has(l))return l}}function Td(e){let t=e?.trim();return!t||!qv.test(t)?void 0:t.toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function Wv(e){return Fv("sha256").update(e).digest("hex").slice(0,8)}function Id(e,t,n){let i=e[t];if(typeof i!="string")return!1;let r=Hv(i,n);return r===i?!1:(e[t]=r,!0)}function Hv(e,t){let n=e.indexOf("/");if(n<=0||n===e.length-1)return e;let i=e.slice(0,n),r=t[i];return r?`custom_provider:${r}/${e.slice(n+1)}`:e}function Jv(e,t){if(!B(e.nexus)||!B(e.nexus.model))return!1;let n=e.nexus.model.providerID;if(typeof n!="string")return!1;let i=t[n];return i?(e.nexus.model.providerID=`custom_provider:${i}`,!0):!1}function jd(e){if(process.platform==="win32")return;let t=rr.dirname(e),n;try{n=or.readdirSync(t,{withFileTypes:!0})}catch{console.warn(`[config] Could not inspect legacy BYOK backups in ${JSON.stringify(t)}. Backup permissions were not verified; check directory access and restrict backup permissions manually.`);return}for(let i of n)if(i.isFile()&&i.name.startsWith(Bd)){let r=rr.join(t,i.name);try{Et(r)}catch{console.warn(`[config] Could not restrict legacy BYOK backup ${JSON.stringify(r)}. It may still be readable by other users; restrict its permissions manually.`)}}}function Xv(e){let t=rr.join(rr.dirname(e),`${Bd}${Date.now()}.${Bv()}`);return Et(e),it(t,or.readFileSync(e),!0),t}function Qv(e){let n=(B(e.migrations)?e.migrations:void 0)?.[Fd];return{providers:B(n)&&B(n.providers)?Object.fromEntries(Object.entries(n.providers).filter(r=>typeof r[1]=="string")):{}}}function zv(e,t){let n=B(e.migrations)?e.migrations:{};n[Fd]={version:1,providers:t.providers},e.migrations=n}function Zv(e){return B(e)?typeof e.name=="string"||typeof e.npm=="string"||typeof e.api=="string"||B(e.options)||B(e.models):!1}function B(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function eA(e){return e instanceof Error?e.message:String(e)}function Ud(e,t){if(e==null||typeof e!="object"||Array.isArray(e))return t;let n=Reflect.get(e,"mode"),i=Reflect.get(e,"turnDiffCard");return{mode:n==="inline"||n==="subagent"?n:t.mode,turnDiffCard:i==="concise"||i==="standard"?i:t.turnDiffCard,modeSource:n==="inline"||n==="subagent"?"explicit":"default"}}function Kd(e,t){let n=t.keepAlive,i=t.xdg,r=t.spawnConcurrency,o=()=>({enabled:n.enabled,maxProcesses:n.maxProcesses,maxLifetimeMs:n.maxLifetimeMs,agents:[...n.agents]}),s=e.opencode;if(s==null||typeof s!="object"||Array.isArray(s))return{keepAlive:o(),xdg:{...i},spawnConcurrency:r};let a=s,l=a.spawnConcurrency,c=typeof l=="number"&&Number.isFinite(l)&&l>0&&Number.isInteger(l)?l:r,u=tA(a.xdg,i),f=a.keepAlive;if(f==null||typeof f!="object"||Array.isArray(f))return{keepAlive:o(),xdg:u,spawnConcurrency:c};let d=f,p=d.maxProcesses,h=typeof p=="number"&&Number.isFinite(p)&&p>0&&Number.isInteger(p)?p:n.maxProcesses,m=d.maxLifetimeMs,y=typeof m=="number"&&Number.isFinite(m)&&m>0&&Number.isInteger(m)?m:n.maxLifetimeMs,g=d.agents,b;return Array.isArray(g)?(b=g.filter(v=>typeof v=="string"&&v.length>0),b.length===0&&(b=[...n.agents])):b=[...n.agents],{keepAlive:{enabled:typeof d.enabled=="boolean"?d.enabled:n.enabled,maxProcesses:h,maxLifetimeMs:y,agents:b},xdg:u,spawnConcurrency:c}}function tA(e,t){let n=e!=null&&typeof e=="object"&&!Array.isArray(e)?e:void 0,i=n?.startupImport,r=i==="background"||i==="blocking"||i==="off"?i:t.startupImport;return{dataIsolation:typeof n?.dataIsolation=="boolean"?n.dataIsolation:t.dataIsolation,startupImport:r}}function sr(e){let t=JSON.stringify({level:40,time:Date.now(),name:"config.asr",msg:e});process.stderr.write(`${t}
|
|
187
|
+
`:""}var cy=ly,uy={dump:cy};function Kr(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var fy=z,dy=ll,py=dl,my=gl,hy=bl,yy=qr,gy=Dl.load,by=Dl.loadAll,Sy=uy.dump,vy=ie,Ay={binary:wl,float:yl,map:fl,null:pl,pairs:xl,set:kl,timestamp:Al,bool:ml,int:hl,merge:_l,omap:El,seq:ul,str:cl},_y=Kr("safeLoad","load"),wy=Kr("safeLoadAll","loadAll"),Ey=Kr("safeDump","dump"),J={Type:fy,Schema:dy,FAILSAFE_SCHEMA:py,JSON_SCHEMA:my,CORE_SCHEMA:hy,DEFAULT_SCHEMA:yy,load:gy,loadAll:by,dump:Sy,YAMLException:vy,types:Ay,safeLoad:_y,safeLoadAll:wy,safeDump:Ey};var Cc=Or(io(),1);async function ng(e,t){let n=xc(e,"config.yaml"),i,r=!1,o;try{await Pe.mkdir(e,{recursive:!0}),await Pe.writeFile(n,"",{flag:"a",mode:384});let s=await Pe.realpath(n);i=xc(tg(s),`.config-tmp-${eg(6).toString("hex")}`),o=await Cc.default.lock(s,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}}),await Pe.chmod(s,384);let a=await Pe.readFile(s,"utf8"),c=(a.trim()===""?void 0:J.load(a))??{};if(!kc(c))throw new Error("Invalid config document");let u=c.tui??{};if(!kc(u))throw new Error("Invalid TUI settings");let f={...u};t===void 0?delete f.statusLine:f.statusLine=[...t];let d={...c,tui:f},p=384,h=await Pe.open(i,"wx",p);r=!0;try{await h.writeFile(J.dump(d,{lineWidth:-1,noRefs:!0}),"utf8"),await h.chmod(p)}finally{await h.close()}await Pe.rename(i,s)}catch{throw new Error("Unable to save status line settings. Check config.yaml syntax and permissions.")}finally{r&&i&&await Pe.unlink(i).catch(()=>{}),await o?.().catch(()=>{})}}function kc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function ro(e){if(typeof e!="object"||e===null||Array.isArray(e))return{};let t=e.enabled;return typeof t=="boolean"?{enabled:t}:{}}function oo(e,t){return{enabled:ro(t).enabled??ro(e).enabled??!0}}var Oc={support_files_api:!0,files_api_upload_endpoint:"/v1/files/upload",max_image_bytes_inline:10485760,max_video_bytes_inline:52428800,max_request_body_bytes:67108864,max_attachments_count:4,max_images_per_request:20},wt={"MiniMax-M3":{name:"MiniMax-M3",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text","image","video"],output:["text"]},limit:{context:512e3,output:128e3},contextWindowOptions:[512e3,1e6],contextWindowOptionHints:{1e6:"higher_usage"},options:{reasoningSummary:"auto"},thinking_config:{mode:"switchable",default_value:"true"},variants:{"none-thinking":{thinking:{type:"disabled"}},thinking:{thinking:{type:"adaptive"}}},capabilities:Oc},"MiniMax-M3.1-Flash-Preview":{name:"M3.1-Flash-Preview",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text","image","video"],output:["text"]},limit:{context:512e3,output:128e3},contextWindowOptions:[512e3,1e6],contextWindowOptionHints:{1e6:"higher_usage"},options:{reasoningSummary:"auto"},thinking:{effortOptions:["default","low","medium","high","xhigh","max"],defaultEffort:"default"},thinking_config:{mode:"forced_on"},variants:{"none-thinking":{thinking:{type:"disabled"}},thinking:{thinking:{type:"adaptive"}}},capabilities:Oc},"MiniMax-M2.7-highspeed":{name:"MiniMax-M2.7-highspeed",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text"],output:["text"]},limit:{context:2e5,output:128e3}},"MiniMax-M2.7":{name:"MiniMax-M2.7",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text"],output:["text"]},limit:{context:2e5,output:128e3}}};import Oe from"node:fs";import be from"node:fs";var Tc=384;function Et(e){if(process.platform==="win32")return;let t=be.statSync(e).mode;(t&63)!==0&&be.chmodSync(e,t&448)}function it(e,t,n=!1){let i=be.constants.O_WRONLY|be.constants.O_CREAT|(n?be.constants.O_EXCL:0),r=be.openSync(e,i,Tc);try{be.fchmodSync(r,Tc),be.ftruncateSync(r,0),be.writeFileSync(r,t)}finally{be.closeSync(r)}}import{isDeepStrictEqual as Us}from"node:util";var Y=Or(Sd(),1);function Ln(e){try{let t=J.load(e);return Dt(t)?t:{}}catch{return{}}}function Nn(e,t,n){let i=(0,Y.parseDocument)(e,{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!0});if(i.errors.length>0||!(0,Y.isMap)(i.contents)&&e.trim()!=="")return Ad(n);try{let r=js(t,n);if(r.length===0)return e;Iv(i),Mv(i),Lv(i,Ln(e));for(let l of r){let c=wd(i,l.path);l.kind==="delete"?i.deleteIn(c):l.kind==="reorder"?Ed(i,c,l.keys):i.setIn(c,l.value)}let o=i.toString({indent:2,lineWidth:-1}),s=J.load(o),a=J.load(Ad(n));if(!Us(s,a)||js(s,a).some(l=>l.kind==="reorder"))throw new Error("The serialized configuration does not match the intended values");return o}catch(r){throw new Error(`config.yaml could not be rewritten: ${r instanceof Error?r.message:String(r)}${r instanceof RangeError?". Remove the self-referential YAML anchor and retry.":""}`)}}function Iv(e){(0,Y.visit)(e,{Scalar(t,n){if(n.addToJSMap||typeof n.source!="string"||n.type!=="PLAIN"&&!n.tag)return;let i=n.type==="PLAIN"&&!n.source.includes(`
|
|
188
|
+
`)?n.source:JSON.stringify(n.source),r=n.tag?`!<${n.tag}> `:"",o=J.load(`value: ${r}${i}`).value;Us(n.value,o)||(n.value=o,delete n.format)}})}function _d(e,t){return e.items.find(n=>(0,Y.isScalar)(n.key)&&String(n.key.value)===t)?.key??t}function wd(e,t){let n=[],i=e.contents;for(let r of t)n.push((0,Y.isMap)(i)?_d(i,r):r),i=e.getIn(n,!0);return n}function Mv(e){let t=new Map;(0,Y.visit)(e,{Alias(n,i){let r=i.toJS(e),o=vd(e,r);o.comment=i.comment,o.commentBefore=i.commentBefore,o.spaceBefore=i.spaceBefore,t.set(i,o)}}),(0,Y.visit)(e,{Alias:(n,i)=>t.get(i)}),(0,Y.visit)(e,{Map(n,i){let r=i.items.filter(a=>(0,Y.isScalar)(a.key)&&a.key.addToJSMap);if(r.length===0)return;let o=i.toJS(e),s=r.flatMap(a=>[a.key,a.value].flatMap(l=>(0,Y.isNode)(l)?[l.commentBefore,l.comment]:[]));i.commentBefore=[i.commentBefore,...s].filter(Boolean).join(`
|
|
189
|
+
`)||void 0,i.items=i.items.filter(a=>!r.includes(a));for(let[a,l]of Object.entries(o))i.has(_d(i,a))||i.set(a,vd(e,l))}}),e.setSchema(e.directives?.yaml.version??"1.2",{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!1})}function vd(e,t){let n=e.createNode(t,{aliasDuplicateObjects:!1});return(0,Y.visit)(n,{Pair(i,r){(0,Y.isScalar)(r.key)&&r.key.value==="<<"&&(r.key.type="QUOTE_DOUBLE")}}),n}function Lv(e,t){if(Dt(t.custom_provider))for(let[n,i]of Object.entries(t.custom_provider)){if(!Dt(i)||!Dt(i.models))continue;let r=wd(e,["custom_provider",n,"models"]);Ed(e,r,Object.keys(i.models))}}function Ed(e,t,n){let i=e.getIn(t,!0);if(!(0,Y.isMap)(i))throw new Error("Expected a model mapping when applying config order");let r=new Map(i.items.map(o=>[(0,Y.isScalar)(o.key)?String(o.key.value):o.key,o]));i.items=n.map(o=>{let s=r.get(o);if(!s)throw new Error("Expected an existing model when applying config order");return s})}function js(e,t,n=[]){if(!Dt(e)||!Dt(t))return Nv(e,t)?[]:[{kind:"set",path:n,value:t}];let i=[];for(let r of new Set([...Object.keys(e),...Object.keys(t)])){let o=[...n,r];!(r in t)||t[r]===void 0?i.push({kind:"delete",path:o}):r in e?i.push(...js(e[r],t[r],o)):i.push({kind:"set",path:o,value:t[r]})}if(n.length===3&&n[0]==="custom_provider"&&n[2]==="models"){let r=Object.keys(t).filter(o=>t[o]!==void 0);Us(Object.keys(e),r)||i.push({kind:"reorder",path:n,keys:r})}return i}function Nv(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Ad(e){return J.dump(e,{indent:2,lineWidth:-1,noRefs:!0})}function Dt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ft(e){if(typeof e!="object"||e===null)return!1;if("v2_enabled"in e&&typeof e.v2_enabled=="boolean")return e.v2_enabled;if(!("v2"in e))return!1;let t=e.v2;return typeof t!="object"||t===null?!1:"enabled"in t&&typeof t.enabled=="boolean"?t.enabled:"writeEnabled"in t&&t.writeEnabled===!0||"recallEnabled"in t&&t.recallEnabled===!0}var ir={enabled:!1,detailedLoggingEnabled:!1,writeEnabled:!1,recallEnabled:!1,eligibleSessionIdleMs:600*1e3,maxCaptureInputTokens:64e3,maxSessionDocBytes:64*1024,maxSelectedSessions:256,maxConsolidationInputTokens:256e3,maxMemoryMarkdownBytes:2*1024*1024,maxSummaryInjectionTokens:2500,maxCaptureSessionsPerWake:6,maxCaptureConcurrency:2,eligibleSessionMaxAgeDays:30,maxCaptureAttemptsPerRevision:3,captureFailureBackoffMs:3600*1e3,publicationCooldownMs:360*60*1e3,maxConsolidationAgentTurns:64,minModelQuotaRemainingPercent:25,captureModel:void 0,captureReasoningEffort:"low",consolidationModel:void 0,consolidationReasoningEffort:"medium",retentionDays:90};function Cd(e,t){let n=e.memory,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:{},r=i.dailyDigest,o=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},s=i.v2,a=s!=null&&typeof s=="object"&&!Array.isArray(s)?s:{},l=t.v2,c=i.legacyRecallDisabledAgents;return{legacyRecallDisabledAgents:c&&typeof c=="object"&&!Array.isArray(c)?Object.fromEntries(Object.entries(c).filter(([,u])=>typeof u=="boolean")):{},enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,proactive:typeof i.proactive=="boolean"?i.proactive:t.proactive,dailyDigest:{enabled:typeof o.enabled=="boolean"?o.enabled:t.dailyDigest.enabled},v2_enabled:typeof i.v2_enabled=="boolean"||["enabled","writeEnabled","recallEnabled"].some(u=>typeof a[u]=="boolean")?Ft(i):Ft(t),v2:{...typeof a.enabled=="boolean"?{enabled:a.enabled}:{},detailedLoggingEnabled:Ks(a.detailedLoggingEnabled,l.detailedLoggingEnabled),writeEnabled:Ks(a.writeEnabled,l.writeEnabled),recallEnabled:Ks(a.recallEnabled,l.recallEnabled),eligibleSessionIdleMs:re(a.eligibleSessionIdleMs,l.eligibleSessionIdleMs),maxCaptureInputTokens:re(a.maxCaptureInputTokens,l.maxCaptureInputTokens),maxSessionDocBytes:re(a.maxSessionDocBytes,l.maxSessionDocBytes),maxSelectedSessions:re(a.maxSelectedSessions,l.maxSelectedSessions),maxConsolidationInputTokens:re(a.maxConsolidationInputTokens,l.maxConsolidationInputTokens),maxMemoryMarkdownBytes:re(a.maxMemoryMarkdownBytes,l.maxMemoryMarkdownBytes),maxSummaryInjectionTokens:re(a.maxSummaryInjectionTokens,l.maxSummaryInjectionTokens),maxCaptureSessionsPerWake:re(a.maxCaptureSessionsPerWake,l.maxCaptureSessionsPerWake),maxCaptureConcurrency:re(a.maxCaptureConcurrency,l.maxCaptureConcurrency),eligibleSessionMaxAgeDays:re(a.eligibleSessionMaxAgeDays,l.eligibleSessionMaxAgeDays),maxCaptureAttemptsPerRevision:re(a.maxCaptureAttemptsPerRevision,l.maxCaptureAttemptsPerRevision),captureFailureBackoffMs:re(a.captureFailureBackoffMs,l.captureFailureBackoffMs),publicationCooldownMs:re(a.publicationCooldownMs,l.publicationCooldownMs),maxConsolidationAgentTurns:re(a.maxConsolidationAgentTurns,l.maxConsolidationAgentTurns),minModelQuotaRemainingPercent:Rv(a.minModelQuotaRemainingPercent,l.minModelQuotaRemainingPercent),captureModel:xd(a.captureModel,l.captureModel),captureReasoningEffort:kd(a.captureReasoningEffort,l.captureReasoningEffort),consolidationModel:xd(a.consolidationModel,l.consolidationModel),consolidationReasoningEffort:kd(a.consolidationReasoningEffort,l.consolidationReasoningEffort),retentionDays:re(a.retentionDays,l.retentionDays)}}}function Ks(e,t){return typeof e=="boolean"?e:t}function re(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function Rv(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&e<=100?e:t}function xd(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}function kd(e,t){return e==="low"||e==="medium"||e==="high"?e:t}function Pv(e,t){return!Ft(e)&&e?.enabled!==!1&&e?.legacyRecallDisabledAgents?.[t]!==!0}import oe from"node:path";import RA from"node:os";import{spawnSync as PA}from"node:child_process";import{fileURLToPath as DA}from"node:url";function Od(e){let t=e.tui;if(t==null||typeof t!="object"||Array.isArray(t))return{};let n=t,i=n.notifications,r;if(i&&typeof i=="object"&&!Array.isArray(i)){let{when:l,method:c}=i;r={...l==="unfocused"||l==="always"||l==="never"?{when:l}:{},...c==="auto"||c==="osc9"||c==="osc777"||c==="bel"?{method:c}:{}}}let o=n.statusLine,s=Array.isArray(o)?o.filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean):void 0,a=Dv(n.customStatusLine);return{...typeof n.showTips=="boolean"?{showTips:n.showTips}:{},...r?{notifications:r}:{},...s?{statusLine:s}:{},...a?{customStatusLine:a}:{}}}function Dv(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n=typeof t.command=="string"?t.command.trim():"";if(n)return{command:n,...t.display==="inline"||t.display==="block"?{display:t.display}:{},...t.position==="above"||t.position==="below"?{position:t.position}:{},...t.colorMode==="plain"||t.colorMode==="ansi"?{colorMode:t.colorMode}:{},...typeof t.maxLines=="number"&&Number.isFinite(t.maxLines)?{maxLines:t.maxLines}:{},...typeof t.timeoutMs=="number"&&Number.isFinite(t.timeoutMs)?{timeoutMs:t.timeoutMs}:{},...typeof t.intervalSeconds=="number"&&Number.isFinite(t.intervalSeconds)?{intervalSeconds:t.intervalSeconds}:{}}}import{createHash as Fv,randomUUID as Bv}from"node:crypto";import or from"node:fs";import rr from"node:path";function Md(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n={};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseURL=="string"&&(n.baseURL=t.baseURL);let i=Ys(t.modelContextLimits);return i&&(n.modelContextLimits=i),Object.keys(n).length>0?n:void 0}function Ys(e){if(!B(e))return;let t=Object.entries(e).filter(n=>n[0].length>0&&Number.isSafeInteger(n[1])&&n[1]>0);return t.length>0?Object.fromEntries(t):void 0}function Ld(e,t){return t?Object.fromEntries(Object.entries(e).map(([n,i])=>{let r=t[n];return[n,r!==void 0&&i.contextWindowOptions?.includes(r)?{...i,limit:{...i.limit,context:r}}:i]})):e}function Gs(e){let t=e.provider?.minimax,n=t?.catalogModels??t?.models??wt;return Ld(Object.fromEntries(Object.entries(n).filter(([,i])=>i.enabled!==!1)),e.minimax_api?.modelContextLimits)}function Nd(e,t){let n=e.minimax;return n?.models?{...e,minimax:{...n,catalogModels:n.models,models:Ld(n.models,t)}}:e}function Rd(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=Object.entries(e).filter(([,n])=>n!=null&&typeof n=="object"&&!Array.isArray(n));if(t.length!==0)return Object.fromEntries(t.map(([n,i])=>[n,Dd(i)]))}function Pd(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,B(n)?Dd(n):n]))}function Dd(e){if(!B(e.models))return e;let t=!1,n=Object.fromEntries(Object.entries(e.models).map(([i,r])=>{if(!B(r)||!B(r.thinking))return[i,r];let o=typeof r.thinking.effort=="string"?r.thinking.effort.trim():"",s=typeof r.thinking.defaultEffort=="string"?r.thinking.defaultEffort.trim():"";if(!Object.hasOwn(r.thinking,"effort")&&!Object.hasOwn(r.thinking,"defaultEffort"))return[i,r];let a=[],l=new Set;if(Array.isArray(r.thinking.effortOptions))for(let d of r.thinking.effortOptions){if(typeof d!="string")continue;let p=d.trim();!p||l.has(p)||(l.add(p),a.push(p))}o&&!l.has(o)&&(l.add(o),a.push(o)),s&&!l.has(s)&&(l.add(s),a.push(s));let c={...r.thinking};delete c.effort,delete c.effortOptions,delete c.defaultEffort;let u={...c,...a.length>0?{effortOptions:a}:{},...s?{defaultEffort:s}:{}},f={...r};return Object.keys(u).length>0?f.thinking=u:delete f.thinking,t=!0,[i,f]}));return t?{...e,models:n}:e}var Fd="byok_legacy_provider_to_custom_provider_v1",Bd="config.yaml.bak.byok-legacy-provider.",Vs=new Set(["minimax","minimax_api","provider","custom_provider"]),qv=/^[A-Za-z0-9 _-]+$/;function qd(e,t){let n={migrated:!1,migratedProviders:{}};if(!t.isManagedRuntime()||!or.existsSync(e))return n;let i=Uv(e);if(!B(i.provider))return n;let r=i.provider,o=B(i.custom_provider)?i.custom_provider:{},s=Qv(i),a={},l={...o},c=new Set(Object.keys(l)),u=!1,f=t.getManagedPreset().provider;for(let[d,p]of Object.entries(r)){if(!Kv(d,p,f))continue;let h=s.providers[d];if(h&&!Vs.has(h)&&!B(l[h])){delete r[d],u=!0;continue}let m=h&&!Vs.has(h)?h:Gv(d,p,c);a[d]=m,B(l[m])||(l[m]=Yv(p),c.add(m),u=!0),s.providers[d]!==m&&(s.providers[d]=m,u=!0),delete r[d],u=!0}if(!u&&Object.keys(a).length===0)return n;if(u=Id(i,"defaultModel",a)||u,u=Id(i,"defaultLightModel",a)||u,u=Jv(i,a)||u,!u)return{migrated:!1,migratedProviders:a};Object.keys(l).length>0?i.custom_provider=l:delete i.custom_provider,zv(i,s);try{let d=Xv(e);return it(e,J.dump(i,{indent:2,lineWidth:-1,noRefs:!0})),{migrated:!0,migratedProviders:a,backupPath:d}}catch(d){return console.warn(`[config] legacy BYOK provider migration skipped: ${eA(d)}`),{migrated:!1,migratedProviders:a}}}function $d(e,t){let n=e.provider,i=e.defaultModel;if(Object.prototype.hasOwnProperty.call(n,"minimax_api")){let{minimax_api:h,...m}=n;n=m,console.warn('[config] "minimax_api" is a reserved provider id; ignoring provider.minimax_api from config.yaml')}let o=t.getManagedPreset().provider.minimax,s=n.minimax,a=t.isManagedRuntime();if(!(a||$v(s,t)))return{provider:n,defaultModel:i};let c=s?.options,u=a&&t.shouldEnforceManagedProviderProtection(),f=jv(o.models,s?.models),d=typeof c?.baseURL=="string"&&c.baseURL.length>0?c.baseURL:void 0,p=u&&d!=null&&!t.isManagedPresetBaseUrl(d);return n={...n,minimax:{...o,...s??{},npm:s?.npm??o.npm,models:f,options:{...o.options??{},...c??{},...p?{apiKey:o.options?.apiKey}:{},...u?{authMode:"managed-login",baseURL:o.options?.baseURL}:{}}}},{provider:n,defaultModel:i}}function $v(e,t){let n=e?.options;return n?.authMode==="managed-login"?!0:typeof n?.baseURL=="string"&&t.isManagedPresetBaseUrl(n.baseURL)}function jv(e,t){return t&&Object.keys(t).length>0?t:e??{}}function Uv(e){try{let t=J.load(or.readFileSync(e,"utf-8"));return B(t)?t:{}}catch{return{}}}function Kv(e,t,n){return e==="minimax"||e==="minimax_api"||!Zv(t)||!Vv(t)?!1:!Object.prototype.hasOwnProperty.call(n,e)}function Vv(e){let t=B(e.options)?e.options:void 0;return typeof t?.apiKey=="string"&&t.apiKey.trim().length>0&&typeof t.baseURL=="string"&&t.baseURL.trim().length>0&&B(e.models)}function Yv(e){let t=B(e.options)?e.options:{};return{...e,kind:"custom",enabled:e.enabled!==!1,options:{...t,authMode:"api-key"}}}function Gv(e,t,n){let i=B(t)?t:{},r=typeof i.name=="string"?i.name:void 0,o=`provider-${Wv(e)}`,s=Td(e)??Td(r)??o;for(let a=0;;a+=1){let l=a===0?s:`${s}-${a+1}`;if(!n.has(l)&&!Vs.has(l))return l}}function Td(e){let t=e?.trim();return!t||!qv.test(t)?void 0:t.toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function Wv(e){return Fv("sha256").update(e).digest("hex").slice(0,8)}function Id(e,t,n){let i=e[t];if(typeof i!="string")return!1;let r=Hv(i,n);return r===i?!1:(e[t]=r,!0)}function Hv(e,t){let n=e.indexOf("/");if(n<=0||n===e.length-1)return e;let i=e.slice(0,n),r=t[i];return r?`custom_provider:${r}/${e.slice(n+1)}`:e}function Jv(e,t){if(!B(e.nexus)||!B(e.nexus.model))return!1;let n=e.nexus.model.providerID;if(typeof n!="string")return!1;let i=t[n];return i?(e.nexus.model.providerID=`custom_provider:${i}`,!0):!1}function jd(e){if(process.platform==="win32")return;let t=rr.dirname(e),n;try{n=or.readdirSync(t,{withFileTypes:!0})}catch{console.warn(`[config] Could not inspect legacy BYOK backups in ${JSON.stringify(t)}. Backup permissions were not verified; check directory access and restrict backup permissions manually.`);return}for(let i of n)if(i.isFile()&&i.name.startsWith(Bd)){let r=rr.join(t,i.name);try{Et(r)}catch{console.warn(`[config] Could not restrict legacy BYOK backup ${JSON.stringify(r)}. It may still be readable by other users; restrict its permissions manually.`)}}}function Xv(e){let t=rr.join(rr.dirname(e),`${Bd}${Date.now()}.${Bv()}`);return Et(e),it(t,or.readFileSync(e),!0),t}function Qv(e){let n=(B(e.migrations)?e.migrations:void 0)?.[Fd];return{providers:B(n)&&B(n.providers)?Object.fromEntries(Object.entries(n.providers).filter(r=>typeof r[1]=="string")):{}}}function zv(e,t){let n=B(e.migrations)?e.migrations:{};n[Fd]={version:1,providers:t.providers},e.migrations=n}function Zv(e){return B(e)?typeof e.name=="string"||typeof e.npm=="string"||typeof e.api=="string"||B(e.options)||B(e.models):!1}function B(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function eA(e){return e instanceof Error?e.message:String(e)}function Ud(e,t){if(e==null||typeof e!="object"||Array.isArray(e))return t;let n=Reflect.get(e,"mode"),i=Reflect.get(e,"turnDiffCard");return{mode:n==="inline"||n==="subagent"?n:t.mode,turnDiffCard:i==="concise"||i==="standard"?i:t.turnDiffCard,modeSource:n==="inline"||n==="subagent"?"explicit":"default"}}function Kd(e,t){let n=t.keepAlive,i=t.xdg,r=t.spawnConcurrency,o=()=>({enabled:n.enabled,maxProcesses:n.maxProcesses,maxLifetimeMs:n.maxLifetimeMs,agents:[...n.agents]}),s=e.opencode;if(s==null||typeof s!="object"||Array.isArray(s))return{keepAlive:o(),xdg:{...i},spawnConcurrency:r};let a=s,l=a.spawnConcurrency,c=typeof l=="number"&&Number.isFinite(l)&&l>0&&Number.isInteger(l)?l:r,u=tA(a.xdg,i),f=a.keepAlive;if(f==null||typeof f!="object"||Array.isArray(f))return{keepAlive:o(),xdg:u,spawnConcurrency:c};let d=f,p=d.maxProcesses,h=typeof p=="number"&&Number.isFinite(p)&&p>0&&Number.isInteger(p)?p:n.maxProcesses,m=d.maxLifetimeMs,y=typeof m=="number"&&Number.isFinite(m)&&m>0&&Number.isInteger(m)?m:n.maxLifetimeMs,g=d.agents,b;return Array.isArray(g)?(b=g.filter(v=>typeof v=="string"&&v.length>0),b.length===0&&(b=[...n.agents])):b=[...n.agents],{keepAlive:{enabled:typeof d.enabled=="boolean"?d.enabled:n.enabled,maxProcesses:h,maxLifetimeMs:y,agents:b},xdg:u,spawnConcurrency:c}}function tA(e,t){let n=e!=null&&typeof e=="object"&&!Array.isArray(e)?e:void 0,i=n?.startupImport,r=i==="background"||i==="blocking"||i==="off"?i:t.startupImport;return{dataIsolation:typeof n?.dataIsolation=="boolean"?n.dataIsolation:t.dataIsolation,startupImport:r}}function sr(e){let t=JSON.stringify({level:40,time:Date.now(),name:"config.asr",msg:e});process.stderr.write(`${t}
|
|
190
190
|
`)}var lr={enabled:!0};function Vd(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e,n=typeof t.apiKey=="string"&&t.apiKey.trim().length>0,i=typeof t.resourceId=="string"&&t.resourceId.trim().length>0;return n||i}function ar(e){return typeof e=="string"&&e.trim().length>0}function Yd(e){let t=e.asr;if(t==null||typeof t!="object"||Array.isArray(t))return{...lr};let n=t;return Vd(n.seed)&&sr("Ignoring legacy `asr.seed.*` in config \u2014 Seed ASR was retired from the daemon; only Amadeus remains. Remove `asr.seed` from config.yaml."),Vd(n.qwen)&&sr("Ignoring legacy `asr.qwen.apiKey` in config \u2014 Qwen ASR was retired from the daemon; only Amadeus remains. Remove `asr.qwen` from config.yaml."),(ar(n.mode)||ar(n.proxyBaseUrl))&&sr("Ignoring legacy `asr.mode` / `asr.proxyBaseUrl` in config \u2014 the daemon no longer runs the shared asr-proxy WebSocket path. The Amadeus HTTP proxy is managed by the application environment. Remove these keys from config.yaml."),(ar(n.primaryProvider)||ar(n.fallbackProvider))&&sr("Ignoring legacy `asr.primaryProvider` / `asr.fallbackProvider` in config \u2014 only Amadeus remains and provider selection is no longer configurable. Remove these keys from config.yaml."),{enabled:typeof n.enabled=="boolean"?n.enabled:lr.enabled}}var nA={policyOwner:"core",storageWriteVersion:2,classifierTimeoutMs:6e4,userConfirmationEnabled:!0};function Gd(e,t=nA){let n=e.permission;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.policyOwner===void 0?t.policyOwner:i.policyOwner==="engine"||i.policyOwner==="core"?i.policyOwner:"engine",o=i.storageWriteVersion===1||i.storageWriteVersion===2?i.storageWriteVersion:t.storageWriteVersion,s=i.classifierTimeoutMs,a=typeof s=="number"&&Number.isFinite(s)&&s>=5e3?Math.floor(s):t.classifierTimeoutMs,l=typeof i.userConfirmationEnabled=="boolean"?i.userConfirmationEnabled:t.userConfirmationEnabled;return{policyOwner:r,storageWriteVersion:o,classifierTimeoutMs:a,userConfirmationEnabled:l}}var Wd=["user-cc","user-codex","user-agents","workspace-minimax","workspace-cc","workspace-agents"],iA={"user-cc":"user-claude","workspace-cc":"workspace-claude"},ur={external:{enabled:!0,walkUp:!0,duplicateWarn:!0,sources:{"workspace-minimax":{enabled:!0,priority:65},"workspace-cc":{enabled:!0,priority:60},"workspace-agents":{enabled:!0,priority:55},"user-cc":{enabled:!0,priority:40},"user-codex":{enabled:!0,priority:35},"user-agents":{enabled:!0,priority:30}}}};function cr(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function rA(e,t){return cr(e)?{enabled:typeof e.enabled=="boolean"?e.enabled:t.enabled,priority:typeof e.priority=="number"&&Number.isFinite(e.priority)?e.priority:t.priority}:t}function Ws(e){let t=ur,n=cr(e.skills)?e.skills:{},i=cr(n.external)?n.external:{},r=cr(i.sources)?i.sources:{},o={...t.external.sources};for(let s of Wd){let a=iA[s],l=Object.hasOwn(r,s)?r[s]:a?r[a]:void 0;o[s]=rA(l,t.external.sources[s])}return{external:{enabled:typeof i.enabled=="boolean"?i.enabled:t.external.enabled,walkUp:typeof i.walkUp=="boolean"?i.walkUp:t.external.walkUp,duplicateWarn:typeof i.duplicateWarn=="boolean"?i.duplicateWarn:t.external.duplicateWarn,sources:o}}}var oA=Wd;var Hd=["pi-agent"],Bt="pi-agent";function Jd(e){return typeof e!="string"?Bt:Hd.includes(e)?e:Bt}function Hs(e){return e==null||typeof e!="object"||Array.isArray(e)?{defaultFramework:Bt}:{defaultFramework:Jd(e.defaultFramework)}}import G from"node:fs";import sA from"node:os";import qt from"node:path";var tp=".minimax",np=".mavis",aA={error:()=>{},info:()=>{},warn:()=>{}};function Zs(e){return e??sA.homedir()}function ip(e,t){return t?`${e}-${t}`:e}function rp(e,t){return qt.join(Zs(e),ip(tp,t))}function op(e,t){return qt.join(Zs(e),ip(np,t))}function Xs(e){try{let t=G.lstatSync(e);return t.isSymbolicLink()?{kind:"link"}:t.isDirectory()?{kind:"directory"}:{kind:"other"}}catch(t){let n=t.code;return n==="ENOENT"||n==="ENOTDIR"?{kind:"missing"}:{kind:"inaccessible",error:t}}}function Js(e){let t=qt.resolve(e);return process.platform==="win32"?(t=t.replace(/^\\\\\?\\/,""),t.toLowerCase()):t}function ea(e,t){try{let n=G.readlinkSync(e),i=Js(t);return Js(qt.resolve(qt.dirname(e),n))===i||Js(n)===i}catch{return!1}}function fr(e,t,n){if(!ea(e,t))try{G.symlinkSync(t,e,process.platform==="win32"?"junction":"dir")}catch(i){n.warn(`Failed to create compat link ${e} -> ${t}: ${String(i)}`)}}function Xd(e,t,n){if(t.kind==="missing")return!0;if(t.kind==="link"||t.kind==="other")try{return G.unlinkSync(e),!0}catch(i){return n.warn(`Failed to remove ${e} before creating compat link: ${String(i)}`),!1}return!1}function Qs(e){try{let t=G.readdirSync(e);if(t.length===0)return"empty";if(t.length===1&&t[0]==="workspace")try{return G.readdirSync(qt.join(e,"workspace")).length>0?"hasData":"empty"}catch{return"unknown"}return"hasData"}catch{return"unknown"}}function zs(e){try{return G.statSync(e).isDirectory()?Qs(e):void 0}catch{return"unknown"}}function lA(e,t){return`${e}.backup-${t()}`}function cA(e,t,n){let i=lA(e,n);try{return G.renameSync(e,i),t.warn(`Backed up legacy data dir ${e} -> ${i}`),!0}catch(r){return t.warn(`Failed to back up legacy data dir ${e}: ${String(r)}`),!1}}function uA(e,t,n,i){if(ea(e,t))return!0;let r=Xs(e);if(r.kind==="missing")return!0;if(r.kind==="link"){let o=zs(e);return o==="hasData"||o==="unknown"?(n.warn(`Cannot replace legacy data dir symlink ${e}; it may point to real data outside ${t}`),!1):Xd(e,r,n)}return r.kind==="other"?Xd(e,r,n):r.kind==="directory"?cA(e,n,i):(n.warn(`Cannot replace inaccessible legacy data dir ${e}; leaving it untouched`),!1)}function Qd(e,t,n,i){uA(e,t,n,i)&&fr(e,t,n)}function fA(e,t){try{return G.rmSync(e,{recursive:!0,force:!1}),!0}catch(n){return t.warn(`Failed to remove empty primary data dir ${e}: ${String(n)}`),!1}}function zd(e,t,n){try{return G.renameSync(e,t),n.info(`Migrated legacy data dir ${e} -> ${t}`),!0}catch(i){return n.warn(`Failed to migrate legacy data dir ${e} -> ${t}: ${String(i)}`),!1}}function dA(e,t,n,i){try{G.cpSync(e,n,{recursive:!0,errorOnExist:!0,force:!1}),G.unlinkSync(t);try{G.rmSync(e,{recursive:!0,force:!1})}catch(r){i.warn(`Copied legacy symlink data dir ${e} -> ${n}, but failed to remove old target: ${String(r)}`)}return i.info(`Copied legacy data dir symlink target ${e} -> ${n}`),!0}catch(r){try{G.existsSync(n)&&G.rmSync(n,{recursive:!0,force:!0})}catch(o){i.warn(`Failed to clean up partial primary data dir ${n}: ${String(o)}`)}return i.warn(`Failed to copy legacy symlink data dir ${t} -> ${n}: ${String(r)}`),!1}}function Zd(e,t,n){try{let i=G.realpathSync(e);try{G.renameSync(i,t)}catch(r){if(r.code==="EXDEV")return dA(i,e,t,n);throw r}return G.unlinkSync(e),n.info(`Migrated legacy data dir symlink target ${i} -> ${t}`),!0}catch(i){return n.warn(`Failed to migrate legacy symlink data dir ${e} -> ${t}: ${String(i)}`),!1}}function ep(e,t){try{return G.mkdirSync(e,{recursive:!0}),!0}catch(n){return t.warn(`Failed to create primary data dir ${e}: ${String(n)}`),!1}}function pA(e,t,n,i){let r=Xs(e),o=Xs(t);if(r.kind==="inaccessible")return n.warn(`Primary data dir ${e} is inaccessible; not treating it as missing`),e;if(r.kind==="directory"){let s=Qs(e),a=o.kind==="directory"?Qs(t):o.kind==="link"?zs(t)??"empty":"empty";if(s==="empty"){if(o.kind==="inaccessible"||a==="unknown")return n.warn(`Legacy data dir ${t} may contain data but is inaccessible; not using empty primary ${e}`),t;if((o.kind==="directory"||o.kind==="link")&&a==="hasData"){if(!fA(e,n))return t;if(o.kind==="link"){if(!Zd(t,e,n))return t}else if(!zd(t,e,n))return t;return fr(t,e,n),e}}return Qd(t,e,n,i),e}if(ea(t,e))return ep(e,n),e;if(o.kind==="directory")return zd(t,e,n)?(fr(t,e,n),e):t;if(o.kind==="link"){let s=zs(t);if(s==="hasData")return Zd(t,e,n)?(fr(t,e,n),e):t;if(s==="unknown")return n.warn(`Legacy data dir symlink ${t} target is inaccessible; not treating it as missing`),t}return o.kind==="inaccessible"?(n.warn(`Legacy data dir ${t} is inaccessible; not treating it as missing`),t):r.kind==="link"||r.kind==="other"?(n.warn(`Primary data dir path ${e} exists but is not a directory; using it without migration`),e):(ep(e,n),Qd(t,e,n,i),e)}function Ge(e={}){let t=Zs(e.homeDir),n=e.profile??null;return pA(rp(t,n),op(t,n),e.logger??aA,e.nowMs??Date.now)}function mA(e,t){return Ge({homeDir:e,logger:t})}function hA(e,t,n){return Ge({homeDir:t,profile:e,logger:n})}var sa=["read","write","edit","bash","task_query","task_output","task_stop","grep","glob","todowrite","web_fetch","website_deploy","workspace_semantic_search"],aa=["images_understand","image_synthesize","images_search_and_download","image_reverse_search","submit_video_generation","query_video_generation","gen_videos","batch_text_to_video","batch_image_to_video","get_voice_list","batch_text_to_audio","batch_text_to_music","synthesize_speech","batch_synthesize_speech","audios_understand","videos_understand","transcribe_audio"],la=["code-review","deep-research","deploy-website","docx","edit-deployed-website","init","lark-tools","llm-call","mcode-tools-master","mavis-doctor","pdf","plugin-creator","pptx","skill-creator","skill-refiner","visual-page","x-link-reader","xlsx"],lp=["control-in-app-browser","resume-codex","mavis","create-agent","minimax-code-product","miniapp-creator"],yA=new Set(["modelConfigId","persona","tools","builtinTools","skills","features"]),gA=new Set(["enabled"]),ra=new Set(["mavis","delegation","webSearch"]),cp=new Set(sa),sp=["task_query","task_output","task_stop"],up=new Set(aa),oa=new Set(la),fp=new Set(lp),bA=new Set(["plan-mode"]);function ca(e){let t=dr(e),n=dr(t?.default);return{default:n?vA(n):{}}}function SA(e,t="agent"){if(e===void 0)return{};let n=na(e,t);ia(n,yA,t);let i={};if(n.modelConfigId!==void 0&&((typeof n.modelConfigId!="string"||!n.modelConfigId.trim())&&ce(`${t}.modelConfigId`,"must be a non-empty string"),i.modelConfigId=n.modelConfigId.trim()),n.persona!==void 0){let r=na(n.persona,`${t}.persona`);ia(r,gA,`${t}.persona`),r.enabled!==void 0&&typeof r.enabled!="boolean"&&ce(`${t}.persona.enabled`,"must be a boolean"),i.persona={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{}}}if(n.tools!==void 0&&(Array.isArray(n.tools)||ce(`${t}.tools`,"must be an array"),i.tools=n.tools.map((r,o)=>((typeof r!="string"||!cp.has(r))&&ce(`${t}.tools[${o}]`,`must be one of ${sa.join(", ")}`),r))),n.builtinTools!==void 0&&(Array.isArray(n.builtinTools)||ce(`${t}.builtinTools`,"must be an array"),i.builtinTools=n.builtinTools.map((r,o)=>(r==="web_search"&&ce(`${t}.builtinTools[${o}]`,"web_search is feature-owned; use features.webSearch"),(typeof r!="string"||!up.has(r))&&ce(`${t}.builtinTools[${o}]`,`must be one of ${aa.join(", ")}`),r))),n.skills!==void 0&&(Array.isArray(n.skills)||ce(`${t}.skills`,"must be an array"),i.skills=n.skills.map((r,o)=>{if(typeof r=="string"&&fp.has(r.trim())){let s=r.trim();ce(`${t}.skills[${o}]`,`${s} is capability-owned; use its owning Tool or feature switch`)}return(typeof r!="string"||!oa.has(r.trim()))&&ce(`${t}.skills[${o}]`,`must be one of ${la.join(", ")}`),r.trim()})),n.features!==void 0){let r=na(n.features,`${t}.features`);ia(r,ra,`${t}.features`);for(let o of ra)r[o]!==void 0&&typeof r[o]!="boolean"&&ce(`${t}.features.${o}`,"must be a boolean");i.features={...typeof r.mavis=="boolean"?{mavis:r.mavis}:{},...typeof r.delegation=="boolean"?{delegation:r.delegation}:{},...typeof r.webSearch=="boolean"?{webSearch:r.webSearch}:{}}}return i}function vA(e){let t={};typeof e.modelConfigId=="string"&&e.modelConfigId.trim()&&(t.modelConfigId=e.modelConfigId.trim());let n=dr(e.persona);if(typeof n?.enabled=="boolean"&&(t.persona={enabled:n.enabled}),ap(e.tools,cp)){let r=[...e.tools];sp.some(o=>r.includes(o))||r.push(...sp),t.tools=r}if(ap(e.builtinTools,up)&&(t.builtinTools=[...e.builtinTools]),Array.isArray(e.skills)){let r=e.skills.map(o=>typeof o=="string"?o.trim():o);r.every(o=>typeof o=="string"&&(oa.has(o)||bA.has(o))&&!fp.has(o))&&(t.skills=r.filter(o=>typeof o=="string"&&oa.has(o)))}let i=dr(e.features);if(i){let r={};for(let o of ra)typeof i[o]=="boolean"&&(r[o]=i[o]);Object.keys(r).length>0&&(t.features=r)}return t}function dr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function ap(e,t){return Array.isArray(e)&&e.every(n=>typeof n=="string"&&t.has(n))}function AA(e={},t={}){return{persona:{enabled:t.persona?.enabled??e.persona?.enabled??!0},tools:ta(t.tools??e.tools),builtinTools:ta(t.builtinTools??e.builtinTools),skills:ta(t.skills??e.skills),features:{mavis:t.features?.mavis??e.features?.mavis??!0,delegation:t.features?.delegation??e.features?.delegation??!0,webSearch:t.features?.webSearch??e.features?.webSearch??!0}}}function _A(e,t){return e.tools===void 0||e.tools.includes(t)}function wA(e,t){return e.builtinTools===void 0||e.builtinTools.includes(t)}function EA(e,t){return e.skills===void 0||e.skills.includes(t)}function ta(e){return e===void 0?void 0:[...e]}function na(e,t){return(e==null||typeof e!="object"||Array.isArray(e))&&ce(t,"must be an object"),e}function ia(e,t,n){for(let i of Object.keys(e))t.has(i)||ce(`${n}.${i}`,"is not supported")}function ce(e,t){throw new Error(`Invalid configuration at ${e}: ${t}`)}var ua={enabled:!0};function dp(e,t=ua){let n=e.askUser;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}var We={enabled:!0,enabledSource:"default"};function fa(e,t=We){let n=e.dataContribution;if(n==null||typeof n!="object"||Array.isArray(n))return{...t,enabledSource:"default"};let i=n,r=typeof i.enabled=="boolean";return{enabled:r?i.enabled:t.enabled,enabledSource:r?"explicit":"default"}}function pp(e){try{let t=e()?.dataContribution?.enabled;return typeof t=="boolean"?t:We.enabled}catch{return We.enabled}}var yp=["none","evaluator","subagent"],gp=["brief","transcript"],bp=["same-route-small-fast"],Sp="goal-verifier-readonly",vp=[Sp],he={budget:{graceSteps:1},breaker:{repeatedReplyLimit:3},verifier:{repeatedNotMetLimit:5,evidence:"brief"},evaluator:{modelPolicy:"same-route-small-fast",maxTokens:32e3,timeoutSeconds:60,maxRetries:1}},da={budget:{graceSteps:3},evaluator:{maxRetries:1}};function pa(e){let t=[],n=$t(e,"goal",t);jt(n,"goal",t,["objectiveMaxChars","verification","budget","breaker","verifier","evaluator","subagent"]);let i=$t(n.budget,"goal.budget",t);jt(i,"goal.budget",t,["defaultTokens","defaultMainTurns","defaultActiveSeconds","graceSteps"]);let r=$t(n.breaker,"goal.breaker",t);jt(r,"goal.breaker",t,["repeatedReplyLimit"]);let o=$t(n.verifier,"goal.verifier",t);jt(o,"goal.verifier",t,["repeatedNotMetLimit","evidence"]);let s=$t(n.evaluator,"goal.evaluator",t);jt(s,"goal.evaluator",t,["modelPolicy","maxTokens","timeoutSeconds","maxRetries"]);let a=$t(n.subagent,"goal.subagent",t);jt(a,"goal.subagent",t,["profile","maxTurns","maxTokens","timeoutSeconds"]);let l=hp(n.verification,"goal.verification",yp,t),c=ut(n.objectiveMaxChars,"goal.objectiveMaxChars",t,{min:1}),u=ut(i.defaultTokens,"goal.budget.defaultTokens",t,{min:1}),f=ut(i.defaultMainTurns,"goal.budget.defaultMainTurns",t,{min:1}),d=ut(i.defaultActiveSeconds,"goal.budget.defaultActiveSeconds",t,{min:1}),p=hp(a.profile,"goal.subagent.profile",vp,t),h=ut(a.maxTurns,"goal.subagent.maxTurns",t,{min:1}),m=ut(a.maxTokens,"goal.subagent.maxTokens",t,{min:1}),y=ut(a.timeoutSeconds,"goal.subagent.timeoutSeconds",t,{min:1}),g={...p!==void 0?{profile:p}:{},...h!==void 0?{maxTurns:h}:{},...m!==void 0?{maxTokens:m}:{},...y!==void 0?{timeoutSeconds:y}:{}};return{config:{...c!==void 0?{objectiveMaxChars:c}:{},...l!==void 0?{verification:l}:{},budget:{...u!==void 0?{defaultTokens:u}:{},...f!==void 0?{defaultMainTurns:f}:{},...d!==void 0?{defaultActiveSeconds:d}:{},graceSteps:Ut(i.graceSteps,"goal.budget.graceSteps",he.budget.graceSteps,t,{min:0,max:da.budget.graceSteps})},breaker:{repeatedReplyLimit:Ut(r.repeatedReplyLimit,"goal.breaker.repeatedReplyLimit",he.breaker.repeatedReplyLimit,t,{min:1})},verifier:{repeatedNotMetLimit:Ut(o.repeatedNotMetLimit,"goal.verifier.repeatedNotMetLimit",he.verifier.repeatedNotMetLimit,t,{min:1}),evidence:mp(o.evidence,"goal.verifier.evidence",gp,he.verifier.evidence,t)},evaluator:{modelPolicy:mp(s.modelPolicy,"goal.evaluator.modelPolicy",bp,he.evaluator.modelPolicy,t),maxTokens:Ut(s.maxTokens,"goal.evaluator.maxTokens",he.evaluator.maxTokens,t,{min:1}),timeoutSeconds:Ut(s.timeoutSeconds,"goal.evaluator.timeoutSeconds",he.evaluator.timeoutSeconds,t,{min:1}),maxRetries:Ut(s.maxRetries,"goal.evaluator.maxRetries",he.evaluator.maxRetries,t,{min:0,max:da.evaluator.maxRetries})},...Object.keys(g).length>0?{subagent:g}:{}},warnings:t}}function $t(e,t,n){return e===void 0?{}:e===null||typeof e!="object"||Array.isArray(e)?(n.push(He(t,"expected an object; using defaults")),{}):e}function jt(e,t,n,i){for(let r of Object.keys(e))i.includes(r)||n.push(He(`${t}.${r}`,"unknown key ignored"))}function Ut(e,t,n,i,r){return e==null?n:!Number.isInteger(e)||e<r.min?(i.push(He(t,`expected an integer >= ${r.min}; using default`)),n):r.max!=null&&e>r.max?(i.push(He(t,`exceeds maximum ${r.max}; clamped`)),r.max):e}function ut(e,t,n,i){if(e!=null){if(!Number.isInteger(e)||e<i.min){n.push(He(t,`expected an integer >= ${i.min}; ignored`));return}return i.max!=null&&e>i.max?(n.push(He(t,`exceeds maximum ${i.max}; clamped`)),i.max):e}}function mp(e,t,n,i,r){return e==null?i:typeof e!="string"||!n.includes(e)?(r.push(He(t,`expected one of: ${n.join(", ")}; using default`)),i):e}function hp(e,t,n,i){if(e!=null){if(typeof e!="string"||!n.includes(e)){i.push(He(t,`expected one of: ${n.join(", ")}; ignored`));return}return e}}function He(e,t){return`Invalid goal config at ${e}: ${t}`}var Ae={enabled:!0,maxInlineKiB:64,mcpDetailsMaxInlineKiB:32,watermarkKiB:256,minSavingsKiB:256,minCandidateKiB:2,keepRecentRounds:5},xA=Math.floor(Number.MAX_SAFE_INTEGER/1024);function ma(e){let t=CA(e)?e:{};return{enabled:typeof t.enabled=="boolean"?t.enabled:Ae.enabled,maxInlineKiB:Rn(t.maxInlineKiB,Ae.maxInlineKiB),mcpDetailsMaxInlineKiB:Rn(t.mcpDetailsMaxInlineKiB,Ae.mcpDetailsMaxInlineKiB),watermarkKiB:Rn(t.watermarkKiB,Ae.watermarkKiB),minSavingsKiB:Rn(t.minSavingsKiB,Ae.minSavingsKiB),minCandidateKiB:Rn(t.minCandidateKiB,Ae.minCandidateKiB),keepRecentRounds:kA(t.keepRecentRounds,Ae.keepRecentRounds)}}function Rn(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0&&e<=xA?e:t}function kA(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function CA(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Pn={recoveryDivisor:2,image:{max_width:2e3,max_height:2e3,max_base64_bytes:4718592}};function ya(e){let t=Ap(e)?e:{},n=t.recoveryDivisor,i=Ap(t.image)?t.image:{},r=Pn.image;return{recoveryDivisor:typeof n=="number"&&Number.isFinite(n)&&n>1?n:Pn.recoveryDivisor,image:{max_width:ha(i.max_width)??r.max_width,max_height:ha(i.max_height)??r.max_height,max_base64_bytes:Math.min(ha(i.max_base64_bytes)??r.max_base64_bytes,5242880)}}}function ha(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function Ap(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Dn={};function ga(e){if(e==null||typeof e!="object"||Array.isArray(e))return{...Dn};let t=Reflect.get(e,"chromePath");return typeof t!="string"||!t.trim()?{...Dn}:{chromePath:t.trim()}}import{isIP as OA}from"node:net";function _p(e){return{enabled:!1,filesystemMode:"full_access"}}function wp(e){return!e.enabled||e.filesystemMode==="full_access"?{enabled:!1,filesystemMode:"full_access"}:{...e}}function Sa(e){let t=_p(e);return{enabled:t.enabled,filesystem:{policy:{mode:t.filesystemMode},denyRead:[],denyWrite:[]},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:"open"}}var va=Sa(process.platform),TA=new Set(["read_only","workspace_write","delete_guard","full_access"]),IA=new Set(["deny","allow_all"]);function Aa(e,t=process.platform){let n=Sa(t);if(e===void 0)return n;let i=Fn(e,"sandbox",["enabled","filesystem","network","localAccess"]),r=i.filesystem===void 0?{}:Fn(i.filesystem,"sandbox.filesystem",["policy","denyRead","denyWrite","allowGitConfig"]),o=r.policy===void 0?{}:Fn(r.policy,"sandbox.filesystem.policy",["mode"]),s=i.network===void 0?{}:Fn(i.network,"sandbox.network",["policy","deniedDomains"]),a=s.policy===void 0?{}:Fn(s.policy,"sandbox.network.policy",["mode"]),l=i.enabled===void 0?n.enabled:MA(i.enabled,"sandbox.enabled"),c=o.mode??(l?"delete_guard":"full_access");if(typeof c!="string"||!TA.has(c))throw new Error(`Invalid sandbox.filesystem.policy.mode "${String(c)}"`);let u=a.mode??n.network.policy.mode;if(typeof u!="string"||!IA.has(u))throw new Error(`Invalid sandbox.network.policy.mode "${String(u)}"`);let f=s.deniedDomains===void 0?[...n.network.deniedDomains]:ba(s.deniedDomains,"sandbox.network.deniedDomains");for(let p of f)LA(p);let d=wp({enabled:l,filesystemMode:c});return{enabled:d.enabled,filesystem:{policy:{mode:d.filesystemMode},denyRead:r.denyRead===void 0?[...n.filesystem.denyRead]:ba(r.denyRead,"sandbox.filesystem.denyRead"),denyWrite:r.denyWrite===void 0?[...n.filesystem.denyWrite]:ba(r.denyWrite,"sandbox.filesystem.denyWrite")},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:i.localAccess===void 0?n.localAccess:i.localAccess==="open"||i.localAccess==="restricted"?i.localAccess:(()=>{throw new Error(`Invalid sandbox.localAccess "${String(i.localAccess)}"`)})()}}function Fn(e,t,n){if(e==null||typeof e!="object"||Array.isArray(e))throw new Error(`Invalid ${t}: expected object`);let i=e,r=Object.keys(i).find(o=>!n.includes(o));if(r)throw new Error(`Unknown ${t}.${r}`);return i}function MA(e,t){if(typeof e!="boolean")throw new Error(`Invalid ${t}: expected boolean`);return e}function ba(e,t){if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`Invalid ${t}: expected string array`);return[...e]}function LA(e){let t=()=>{throw new Error(`Invalid sandbox.network.deniedDomains entry "${e}"`)},n=e.match(/^\[([^\]]+)\](?::(.+))?$/);if(n){OA(n[1]??"")!==6&&t(),Ep(n[2],e);return}(e.match(/:/g)??[]).length>1&&t();let i=e.lastIndexOf(":"),r=i>-1?e.slice(0,i):e,o=i>-1?e.slice(i+1):void 0;Ep(o,e),r!=="*"&&(NA(r)||t())}function NA(e){if(e.includes("://")||e.includes("/")||e.includes(":"))return!1;if(e==="localhost")return!0;if(e.startsWith("*.")){let n=e.slice(2).split(".");return n.length>=2&&n.every(i=>i.length>0)}return e.includes("*")?!1:e.includes(".")&&!e.startsWith(".")&&!e.endsWith(".")}function Ep(e,t){if(e===void 0)return;let n=Number(e);if(!/^[1-9][0-9]{0,4}$/.test(e)||!Number.isInteger(n)||n>65535)throw new Error(`Invalid sandbox.network.deniedDomains entry "${t}"`)}var pr={maxConcurrentPerSession:4};function _a(e){let n=(e!=null&&typeof e=="object"&&!Array.isArray(e)?e:{}).maxConcurrentPerSession;return{maxConcurrentPerSession:typeof n=="number"&&Number.isSafeInteger(n)&&n>0?n:pr.maxConcurrentPerSession}}function xp(e,t){return t.length===0?!1:t.includes("*")?!0:t.includes(e)}function FA(){return process.env.__MAVIS_ALLOW_LEGACY_RUNTIME_ENV==="1"}var kp={dev:"test",test:"test",staging:"staging",prod:"prod"};function BA(e){return e==="cn"||e==="en"}function Lp(e){return e==="test"||e==="prod"||e==="dev"||e==="staging"}function Np(){let e=process.env.MAVIS_REGION;if(BA(e))return e;if(hr()){let t=process.env.NEXT_PUBLIC_LOCALE;if(t==="zh")return"cn";if(t==="en")return"en"}return"en"}function Te(){let e=process.env.MAVIS_BUILD_ENV;if(Lp(e))return e;if(hr()){let t=process.env.NEXT_PUBLIC_BUILD_ENV,n=t&&Object.prototype.hasOwnProperty.call(kp,t)?kp[t]:void 0;if(n)return n}return"dev"}function mr(){if(Pp("managed"))return!0;let e=process.env.__MAVIS_RUNTIME_MANAGED;return e==="1"?!0:e==="0"?!1:!!(hr()||Te()==="prod"||Te()==="staging")}function hr(){let e=process.versions;return process.env.ELECTRON_RUN_AS_NODE==="1"||typeof e.electron=="string"}function yr(){return`${Np()}-${Te()}`}var Ce={none:0,test:1,internal:2,online:3},qA={internal:"internal",inside:"online"};function $A(e){for(let[t,n]of Object.entries(e)){if(Ce[n.defaultVisibility]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultVisibility (${n.defaultVisibility}) must not exceed configurableVisibility (${n.configurableVisibility})`);for(let i of n.defaultBuildVariants??[]){let r=qA[i];if(Ce[r]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildVariant (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}for(let i of n.defaultBuildEnvironments??[])if(Ce[i==="prod"?"online":"test"]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildEnvironment (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}}var qn={autoMemory:{defaultVisibility:"online",configurableVisibility:"online"},skillEvolve:{defaultVisibility:"test",configurableVisibility:"online"},skillEvolveBuiltinMr:{defaultVisibility:"none",configurableVisibility:"test"},skillProposal:{defaultVisibility:"test",configurableVisibility:"online"},browserBridge:{defaultVisibility:"test",configurableVisibility:"online"},filePanelBrowser:{defaultVisibility:"online",configurableVisibility:"online"},filePanelBrowserMultiTab:{defaultVisibility:"online",configurableVisibility:"online"},browserUseTooling:{defaultVisibility:"online",configurableVisibility:"online"},browserUseAutoOpenPanel:{defaultVisibility:"online",configurableVisibility:"online"},browserAgentCursor:{defaultVisibility:"online",configurableVisibility:"online"},desktopPlanMode:{defaultVisibility:"online",configurableVisibility:"online"},desktopPlanModeAgentEntry:{defaultVisibility:"none",configurableVisibility:"online"},peek:{defaultVisibility:"test",configurableVisibility:"test"},keepAlive:{defaultVisibility:"test",configurableVisibility:"test"},promptOverride:{defaultVisibility:"test",configurableVisibility:"test"},asr:{defaultVisibility:"online",configurableVisibility:"online"},taskHistoryProjectGrouping:{defaultVisibility:"online",configurableVisibility:"online"},threadGoal:{defaultVisibility:"online",configurableVisibility:"online"},mcodeTools:{defaultVisibility:"none",defaultBuildEnvironments:["dev","test","staging","prod"],defaultPlatforms:["darwin","linux","win32"],configurableVisibility:"online"},codexOAuth:{defaultVisibility:"online",configurableVisibility:"online"}};$A(qn);function jA(e){return(e.buildEnv??Te())!=="prod"?"test":e.internalBuild===!0?"internal":"online"}function UA(e,t){let n=e.defaultBuildVariants;return n?t.internalBuild===!0&&n.includes("internal")||t.insideBuild===!0&&n.includes("inside"):!1}function KA(e,t){let n=t.defaultBuildEnvironment??t.buildEnv??ka();return e.defaultBuildEnvironments?.includes(n)===!0}function ka(){let e=hr()?process.env.NEXT_PUBLIC_BUILD_ENV:void 0;return Lp(e)?e:Te()}function Cp(e,t){return e.defaultPlatforms?.includes(t.platform??process.platform)!==!1}function Ca(e,t,n={}){let i=qn[e],r=Ce[jA(n)],o=n.defaultBuildEnvironment??n.buildEnv??ka();return e==="mcodeTools"&&o==="dev"&&n.mcodeToolsDevMode==="published"&&Cp(i,n)?!0:t===!1?!1:t===!0?r<=Ce[i.configurableVisibility]:Cp(i,n)?KA(i,n)||UA(i,n)?!0:r<=Ce[i.defaultVisibility]:!1}function VA(e){return qn[e].configurableVisibility==="online"}function Oa(e=process.env){return e.__MAVIS_BUILD_INTERNAL==="true"}function YA(e=process.env){return e.__MAVIS_BUILD_INSIDE==="true"}var GA={APP_DIR:".minimax",ENV_PREFIX:"minimax",CLI_NAME:"minimax"},Rp="__MAVIS_RUNTIME";function gr(e){return FA()?process.env[`${Rp}_${e}`]:void 0}function br(e){let t=`--${e}`;for(let n=2;n<process.argv.length;n++){let i=process.argv[n];if(i===t)return process.argv[n+1];if(i?.startsWith(`${t}=`))return i.slice(t.length+1)}}function Pp(e){let t=`--${e}`;return process.argv.slice(2).some(n=>n===t||n.startsWith(`${t}=`))}var Kt=5321,Ea=5001,wa=65535,Dp=500,Ta=2,WA=Dp*Ta,Fp=WA+Ta,Op=1,HA=new Set(["agent-archon","mavis"]),Tp=(()=>{let t=new Uint32Array(256);for(let n=0;n<256;n++){let i=n<<24;for(let r=0;r<8;r++)i=(i&2147483648)!==0?79764919^i<<1:i<<1,i>>>=0;t[n]=i>>>0}return t})();function JA(e){let t=Buffer.from(`${e}
|
|
191
191
|
`,"utf-8"),n=0;for(let r of t)n=(Tp[(n>>>24^r)&255]^n<<8)>>>0;let i=t.length;for(;i!==0;)n=(Tp[(n>>>24^i&255)&255]^n<<8)>>>0,i>>>=8;return(n^4294967295)>>>0}function XA(e){return JA(e)%Dp*Ta+2}function Ip(e,t){try{let n=PA("git",e,{encoding:"utf-8",timeout:3e3,stdio:["ignore","pipe","pipe"],...t?{cwd:t}:{}});return n.status===0&&n.stdout?n.stdout.trim():null}catch{return null}}function QA(e){return e.match(/[/:]([^/:]+?)(?:\.git)?$/)?.[1]??null}function Bp(){return process.env.MINIMAX_DATA_DIR?.trim()||process.env.MAVIS_DATA_DIR?.trim()}function Sr(){return!(Pp("disable-git-auto-config")||gr("DISABLE_GIT_AUTO_CONFIG")||br("data-dir")||Bp())}function vr(){let e=br("profile")??gr("PROFILE");return e&&e.length>0?e:null}function qp(){let e=br("port")??gr("PORT"),t=e?parseInt(e,10):NaN;return Number.isNaN(t)?null:t}function xa(){let e=br("data-dir")??Bp()??gr("DATA_DIR");return e&&e.length>0?e:null}function zA(){return!!(vr()&&xa())}function $p(){return!!(vr()&&qp()!==null)}var ft=null;function ZA(){ft=null}function dt(){if(ft!==null)return ft;let e={runtimePort:Kt,uiPort:Ea,profile:null,autoDetected:!1};return ft=e,e}function e_(){try{if(typeof __dirname=="string")return __dirname}catch{}let e=new Error().stack??"";for(let t of e.split(`
|
|
192
|
-
`)){let n=/file:\/\/[^)\s]+/u.exec(t)?.[0]?.replace(/:\d+:\d+$/u,"");if(n)try{return oe.dirname(DA(n))}catch{}let i=/\(?((?:\/|[A-Za-z]:\\)[^()]+?\.(?:cjs|mjs|js|ts)):\d+:\d+\)?/u.exec(t)?.[1];if(i)return oe.dirname(i)}}function t_(){let e=vr();return e||(Sr()?dt().profile:null)}function Ia(){let e=vr();if(zA())return xa();if(Sr()){let n=dt();if(n.autoDetected&&n.profile)return Ge({profile:n.profile})}let t=xa();return t||(e?Ge({profile:e}):Ge())}function Vt(){return oe.join(Ia(),"config.yaml")}var Ar={"cn-test":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-dev":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-staging":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","en-test":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-dev":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-staging":"https://agent.minimax.io/mavis/api/v1/llm/v1","cn-prod":"https://agent.minimax.cn/mavis/api/v1/llm/v1","en-prod":"https://agent.minimax.io/mavis/api/v1/llm/v1"},jp=["https://agent.minimaxi.com/mavis/api/v1/llm/v1"],n_=new Set([...Object.values(Ar),...jp]),i_=new Set([...Object.values(Ar),...jp].map(e=>new URL(e).origin));function Up(e){if(n_.has(e))return!0;try{let t=new URL(e);return!t.username&&!t.password&&i_.has(t.origin)}catch{return!1}}function Kp(){return Te()==="test"}function r_(){return!Kp()}function o_(e){if(!mr()||!Oe.existsSync(e))return;let t=Vp(e),{provider:n}=t;if(n==null||typeof n!="object"||Array.isArray(n))return;let{minimax:i}=n;if(i==null||typeof i!="object"||Array.isArray(i))return;let{options:r}=i;if(r==null||typeof r!="object"||Array.isArray(r))return;let o=r.baseURL;if(typeof o!="string")return;let s=Ar[yr()];if(o===s||!Up(o))return;let a=Oe.readFileSync(e);r.baseURL=s;try{let l=a.toString("utf-8");it(e,Nn(l,Ln(l),t))}catch(l){let c=!1;try{c=Oe.readFileSync(e).equals(a)}catch{}if(!c)throw l;console.warn("[config] managed preset baseURL sync skipped; config file unchanged, using runtime provider settings")}}function Je(e){return{provider:{minimax:{name:"MiniMax",npm:"@ai-sdk/anthropic",options:{authMode:"managed-login",apiKey:"sk-xxx",baseURL:Ar[e]},models:wt}},defaultModel:"minimax/MiniMax-M3.1-Flash-Preview"}}var Ma={"cn-test":Je("cn-test"),"cn-dev":Je("cn-dev"),"cn-staging":Je("cn-staging"),"cn-prod":Je("cn-prod"),"en-test":Je("en-test"),"en-dev":Je("en-dev"),"en-staging":Je("en-staging"),"en-prod":Je("en-prod")},X={logLevel:"info",devPort:Ea,permissionMode:"auto",sseErrorPush:{history:!0,stream:!0},beta:Object.fromEntries(Object.keys(qn).map(e=>[e,Ca(e,void 0,{buildEnv:"dev"})])),agents:{default:{}},memory:{enabled:!0,proactive:!1,dailyDigest:{enabled:!1},v2:{...ir}},subagent:{...pr},skillEvolve:{enabled:!0,inSession:{N:20,minIntervalSeconds:30,maxPendingPerSession:1},signalCooldownHours:24,minConfidence:.7,excludeAgents:["skill-editor"],disableModelPrefixes:["MiniMax-M2"],builtinMrEnabled:!1,sourceRepo:void 0,proposal:{enabled:!1,eligibleAgents:["mavis"],minMessageCount:40,skipPassiveSessionEnd:!0},lifecycle:{staleThresholdDays:15,archiveThresholdDays:30}},sessionRotate:{enabled:!0,activeSessionLookbackHours:12},agentStop:{debounceMs:500,maxActiveSpanMs:1800*1e3},asr:{...lr},skills:ur,askUser:{...ua},dataContribution:{...We},sessionTitle:{enabled:!0},cli:{spawn:{enabled:!1}},browser:{...Dn},tui:{},opencode:{xdg:{dataIsolation:!1,startupImport:"off"},keepAlive:{enabled:!1,maxProcesses:5,maxLifetimeMs:288e5,agents:["mavis","main","verifier","code-reviewer"]},spawnConcurrency:3},contextManagement:{disableSystemReminderModels:[],cuMaxScreenshotsInContext:2},runawayGuard:{enabled:!0},toolResultCompaction:{...Ae},requestMedia:{...Pn},agentRuntime:{defaultFramework:Bt},logRetentionDays:3,worktreeRefreshBeforeCreate:!0,review:{mode:"subagent",turnDiffCard:"concise",modeSource:"default"},goal:structuredClone(he),sandbox:structuredClone(va),goalWarnings:[]};function s_(){let e=Vt(),t=oe.dirname(e);if(Oe.existsSync(t)||Oe.mkdirSync(t,{recursive:!0}),Oe.existsSync(e)){Na(e);return}if(!mr()){let r=Ge({homeDir:RA.homedir()}),o=oe.join(r,"config.yaml");e!==o&&Oe.existsSync(o)&&(Et(o),it(e,Oe.readFileSync(o),!0));return}let n=Ma[yr()],i=H.dump({logLevel:X.logLevel,provider:La?n.provider:void 0,defaultModel:n.defaultModel,dataContribution:{enabled:We.enabled},memory:{enabled:!1}});it(e,i,!0)}function Vp(e=Vt()){return Ln(a_(e))}function a_(e=Vt()){try{return Oe.readFileSync(e,"utf-8")}catch{return""}}var Bn=null;function l_(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e;return{branchFinish:typeof t.branchFinish=="boolean"?t.branchFinish:!1}}var Yp={isManagedRuntime:mr,shouldEnforceManagedProviderProtection:r_,getManagedPreset:()=>Ma[yr()],isManagedPresetBaseUrl:Up},Gp=!0,La=!0;function c_(e){Gp=e}function u_(e){La=e}function Na(e){Et(e),jd(e),Gp&&qd(e,Yp),La&&o_(e)}function _r(){Bn=null}function wr(){if(Bn)return Bn;s_();let e=Vp();return Bn=Ra(e,Ia()),Bn}function Ra(e,t){let n=e.sseErrorPush,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:void 0,r=typeof e.devPort=="number"?e.devPort:X.devPort;if(Sr()&&!$p()){let c=dt();c.autoDetected&&(r=c.uiPort)}let o=pa(e.goal),s=$d({provider:e.provider!=null&&typeof e.provider=="object"&&!Array.isArray(e.provider)?Pd(e.provider):{},defaultModel:typeof e.defaultModel=="string"?e.defaultModel:void 0},Yp),a=Ys(e.minimaxModelContextLimits),l=f_(e);return{logLevel:typeof e.logLevel=="string"?e.logLevel:X.logLevel,devPort:r,...s,provider:Nd(s.provider,a),defaultModelVariant:typeof e.defaultModelVariant=="string"?e.defaultModelVariant:void 0,defaultModelThinking:e.defaultModelThinking&&typeof e.defaultModelThinking=="object"&&typeof e.defaultModelThinking.effort=="string"?{effort:e.defaultModelThinking.effort}:void 0,defaultModelContextWindow:Number.isSafeInteger(e.defaultModelContextWindow)&&Number(e.defaultModelContextWindow)>0&&Number(e.defaultModelContextWindow)<=2147483647?Number(e.defaultModelContextWindow):void 0,minimax_api:Md(e.minimax_api),minimaxModelContextLimits:a,custom_provider:Rd(e.custom_provider),minimaxModelSource:typeof e.minimaxModelSource=="string"&&(e.minimaxModelSource==="token_plan"||e.minimaxModelSource==="minimax_api_key")?e.minimaxModelSource:void 0,nexus:e.nexus!=null&&typeof e.nexus=="object"&&!Array.isArray(e.nexus)?(()=>{let c={};typeof Reflect.get(e.nexus,"enabled")=="boolean"&&(c.enabled=Reflect.get(e.nexus,"enabled"));let u=Reflect.get(e.nexus,"model");return u!=null&&typeof u=="object"&&!Array.isArray(u)&&typeof Reflect.get(u,"providerID")=="string"&&typeof Reflect.get(u,"modelID")=="string"&&(c.model={providerID:Reflect.get(u,"providerID"),modelID:Reflect.get(u,"modelID"),...typeof Reflect.get(u,"variant")=="string"?{variant:Reflect.get(u,"variant")}:{}}),Object.keys(c).length>0?c:void 0})():void 0,defaultLightModel:typeof e.defaultLightModel=="string"?e.defaultLightModel:void 0,permissionMode:typeof e.permissionMode=="string"&&["default","bypassPermissions","auto","off"].includes(e.permissionMode)?e.permissionMode:X.permissionMode,permission:Gd(e),sseErrorPush:{history:typeof i?.history=="boolean"?i.history:X.sseErrorPush.history,stream:typeof i?.stream=="boolean"?i.stream:X.sseErrorPush.stream},notifications:l_(e.notifications),dataDir:t,agentsDir:oe.join(t,"agents"),sessionsDir:oe.join(t,"sessions"),memoryDir:oe.join(t,"memory"),skillsDir:oe.join(t,"skills"),builtinSkillsDir:oe.join(t,".builtin-skills"),logsDir:oe.join(t,"logs"),pluginsDir:oe.join(t,"plugins"),plansDir:oe.join(t,"plans"),harnessesDir:oe.join(t,"harnesses"),subAgentsDir:oe.join(t,"subagents"),beta:l,agents:ca(e.agents),memory:Cd(e,X.memory),subagent:_a(e.subagent),skillEvolve:m_(e,l),sessionRotate:h_(e),agentStop:y_(e),asr:Yd(e),skills:Ws(e),askUser:dp(e,X.askUser),dataContribution:fa(e,X.dataContribution),sessionTitle:g_(e),cli:b_(e),browser:ga(e.browser),tui:Od(e),opencode:Kd(e,X.opencode),contextManagement:S_(e),runawayGuard:oo(e.runawayGuard),toolResultCompaction:ma(e.toolResultCompaction),requestMedia:ya(e.requestMedia),agentRuntime:Hs(e.agentRuntime),logRetentionDays:v_(e),contentReview:A_(e),mcpToolSearch:__(e),review:Ud(e.review,X.review),worktreeRefreshBeforeCreate:e.worktreeRefreshBeforeCreate!==!1,promptConfig:Wp(e.promptConfig),goal:o.config,goalWarnings:o.warnings,sandbox:Aa(e.sandbox)}}function f_(e){let t=e.beta!=null&&typeof e.beta=="object"&&!Array.isArray(e.beta)?e.beta:{},n={buildEnv:Te(),defaultBuildEnvironment:ka(),internalBuild:Oa(),insideBuild:YA(),mcodeToolsDevMode:process.env.MAVIS_DEV_MCODE_TOOLS_MODE==="published"?"published":void 0},i={};for(let r of Object.keys(qn))i[r]=Ca(r,t[r],n);return i}function d_(e){let t=e.provider;if(t==null||typeof t!="object"||Array.isArray(t))return[];let n=[];for(let i of Object.values(t)){if(i==null||typeof i!="object"||Array.isArray(i))continue;let{models:r}=i;r==null||typeof r!="object"||Array.isArray(r)||n.push(...Object.keys(r))}return n}function p_(e,t){if(t.length===0)return!0;let n=d_(e);if(n.length===0)return!1;let i=t.map(r=>r.toLowerCase());return!n.every(r=>i.some(o=>r.toLowerCase().startsWith(o)))}function Mp(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function m_(e,t){let n=X.skillEvolve,i=e.skillEvolve,o=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},s=o.inSession,{inSession:a}=n;if(s!=null&&typeof s=="object"&&!Array.isArray(s)){let E=s;a={N:typeof E.N=="number"&&E.N>0?E.N:n.inSession.N,minIntervalSeconds:typeof E.minIntervalSeconds=="number"&&E.minIntervalSeconds>=0?E.minIntervalSeconds:n.inSession.minIntervalSeconds,maxPendingPerSession:typeof E.maxPendingPerSession=="number"&&E.maxPendingPerSession>=1?E.maxPendingPerSession:n.inSession.maxPendingPerSession}}let l=o.excludeAgents,c=Array.isArray(l)&&l.every(E=>typeof E=="string")?l:n.excludeAgents,u=Array.isArray(o.disableModelPrefixes)&&o.disableModelPrefixes.every(E=>typeof E=="string")?o.disableModelPrefixes:n.disableModelPrefixes,f=t.skillEvolve?typeof o.enabled=="boolean"?o.enabled:p_(e,u):!1,d=f&&t.skillEvolveBuiltinMr?typeof o.builtinMrEnabled=="boolean"?o.builtinMrEnabled:n.builtinMrEnabled:!1,p=o.sourceRepo,h=typeof p=="string"&&p.trim().length>0?p.trim():n.sourceRepo,m=o.proposal,y=n.proposal,g=m!=null&&typeof m=="object"&&!Array.isArray(m)?m:{},b=Array.isArray(g.eligibleAgents)&&g.eligibleAgents.every(E=>typeof E=="string")?g.eligibleAgents:y.eligibleAgents,v=typeof g.minMessageCount=="number"&&g.minMessageCount>=1?Math.floor(g.minMessageCount):y.minMessageCount,x=typeof g.skipPassiveSessionEnd=="boolean"?g.skipPassiveSessionEnd:y.skipPassiveSessionEnd,k=typeof g.enabled=="boolean"?g.enabled:null,C=f&&t.skillProposal?k??!0:!1,M=o.lifecycle,_=M&&typeof M=="object"&&!Array.isArray(M)?M:{},A=Mp(_.staleThresholdDays,n.lifecycle.staleThresholdDays),O=Mp(_.archiveThresholdDays,n.lifecycle.archiveThresholdDays);if(!(A<O))throw new Error(`Invalid skillEvolve.lifecycle config: staleThresholdDays (${A}) must be strictly less than archiveThresholdDays (${O}).`);return{enabled:f,inSession:a,signalCooldownHours:typeof o.signalCooldownHours=="number"&&o.signalCooldownHours>0?o.signalCooldownHours:n.signalCooldownHours,minConfidence:typeof o.minConfidence=="number"&&o.minConfidence>=0&&o.minConfidence<=1?o.minConfidence:n.minConfidence,scannerModel:typeof o.scannerModel=="string"?o.scannerModel:void 0,excludeAgents:c,disableModelPrefixes:u,builtinMrEnabled:d,sourceRepo:h,proposal:{enabled:C,eligibleAgents:b,minMessageCount:v,skipPassiveSessionEnd:x},lifecycle:{staleThresholdDays:A,archiveThresholdDays:O}}}function h_(e){let t=X.sessionRotate,n=e.sessionRotate;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.activeSessionLookbackHours;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,activeSessionLookbackHours:typeof r=="number"&&Number.isFinite(r)&&r>0?r:t.activeSessionLookbackHours}}function y_(e){let t=X.agentStop,n=e.agentStop;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.debounceMs,o=i.maxActiveSpanMs;return{debounceMs:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:t.debounceMs,maxActiveSpanMs:typeof o=="number"&&Number.isFinite(o)&&o>=0?o:t.maxActiveSpanMs}}function Wp(e){let t=Te()==="prod"&&!Oa();if(e==null||typeof e!="object"||Array.isArray(e))return{autoUpdate:t};let n=e.autoUpdate;return{autoUpdate:typeof n=="boolean"?n:t}}function g_(e){let t=X.sessionTitle,n=e.sessionTitle;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}function b_(e){let t=X.cli,n=e.cli;if(n==null||typeof n!="object"||Array.isArray(n))return{spawn:{...t.spawn}};let i=n.spawn;if(i==null||typeof i!="object"||Array.isArray(i))return{spawn:{...t.spawn}};let r=i;return{spawn:{enabled:typeof r.enabled=="boolean"?r.enabled:t.spawn.enabled}}}function S_(e){let t=X.contextManagement,n=e.contextManagement;if(n==null||typeof n!="object"||Array.isArray(n))return{disableSystemReminderModels:[...t.disableSystemReminderModels],cuMaxScreenshotsInContext:t.cuMaxScreenshotsInContext};let i=n,r=i.disableSystemReminderModels,o=Array.isArray(r)&&r.every(l=>typeof l=="string"&&l.length>0)?r:[...t.disableSystemReminderModels],s=i.cuMaxScreenshotsInContext,a=typeof s=="number"&&Number.isFinite(s)&&s>=0?Math.floor(s):t.cuMaxScreenshotsInContext;return{disableSystemReminderModels:o,cuMaxScreenshotsInContext:a}}function v_(e){let t=e.logRetentionDays;return typeof t=="number"&&t>=1&&Number.isFinite(t)?Math.floor(t):X.logRetentionDays}function A_(e){let t=e.contentReview;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"testBaseURL");return typeof r=="string"&&r.trim()&&(n.testBaseURL=r.trim()),Object.keys(n).length>0?n:void 0}function __(e){let t=e.mcpToolSearch;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"systemHint");typeof r=="boolean"&&(n.systemHint=r);let o=Reflect.get(t,"thresholdPct");typeof o=="number"&&(n.thresholdPct=o);let s=Reflect.get(t,"minDeferCount");typeof s=="number"&&(n.minDeferCount=s);let a=Reflect.get(t,"topKDefault");typeof a=="number"&&(n.topKDefault=a);let l=Reflect.get(t,"topKMax");typeof l=="number"&&(n.topKMax=l);let c=Reflect.get(t,"maxSchemaTextLen");typeof c=="number"&&(n.maxSchemaTextLen=c);let u=Reflect.get(t,"modelWhitelist");return Array.isArray(u)&&(n.modelWhitelist=u.filter(f=>typeof f=="string")),Object.keys(n).length>0?n:void 0}function Hp(){let e=qp();if(Sr()&&!$p()){let t=dt();if(t.autoDetected)return t.runtimePort}return e??Kt}function w_(e=Hp()){let t=e+Fp;if(t<=wa)return t;let n=e+Op;if(n<=wa)return n;throw new Error(`Cannot allocate an OpenCode sidecar port for runtime port ${String(e)}; choose a runtime port <= ${String(wa-Op)}.`)}var E_=["agent.minimaxi.com","agent.minimaxi.com","agent.minimax.io","agent.minimax.io","agent.minimax.io","agent.minimax.cn","agent.minimaxi.com"],x_=new Set(E_.map(e=>`https://${e}`));function k_(e,t){return/^custom_provider:minimax-legacy(?:-\d+)?$/u.test(e)&&(!t||Pa(t))}function Pa(e){try{let t=new URL(e);return t.username||t.password?!1:x_.has(t.origin.toLowerCase())}catch{return!1}}function C_(e){if(!(e!=="managed-login"&&e!=="api-key"&&e!=="oauth"))return e}function Da(e){let t=typeof e?.baseURL=="string"?e.baseURL.trim():"",n=t.length>0&&Pa(t),i=C_(e?.authMode),r=[];return typeof e?.authMode=="string"&&!i&&r.push(`Unknown provider authMode "${e.authMode}"; falling back to compatibility resolution.`),i?(i==="managed-login"&&t.length>0&&!n&&!e?.allowManagedBaseURLOverride&&r.push("Provider authMode is managed-login but baseURL is not a known managed MiniMax host."),{authMode:i,source:"explicit",managedBaseURL:n,warnings:r}):n?(r.push("Provider authMode is inferred from a managed MiniMax baseURL; set options.authMode: managed-login to make this explicit."),{authMode:"managed-login",source:"inferred-managed-base-url",managedBaseURL:n,warnings:r}):{authMode:"api-key",source:"default-api-key",managedBaseURL:n,warnings:r}}var Ie="minimax",Yt="minimax_api",Fa="custom_provider:";function O_(e,t){return e==="anthropic-messages"&&(t===Ie||t===Yt)}function Ba(e,t){if(t===Yt)return"minimax_api_key";if(t.startsWith(Fa))return"custom_provider";if(t!==Ie)return"configured_provider";if(e.minimaxModelSource==="minimax_api_key")return"minimax_api_key";let n=e.provider?.[t]?.options;return Da({authMode:n?.authMode,baseURL:n?.baseURL}).authMode==="managed-login"?"managed_token_plan":"configured_provider"}function Jp(e,t,n){switch(Ba(e,t)){case"managed_token_plan":return Er(e.provider?.[t],!0);case"minimax_api_key":{let r=e.provider?.[Ie];return Er({...r,models:r?.models??wt},!0)}case"custom_provider":{let r=e.custom_provider?.[t.slice(Fa.length)];return!r||r.enabled===!1?[]:Er(r)}case"configured_provider":return Er(e.provider?.[t])}}function T_(e){let t=Ba(e.config,e.providerId),n=e.modelId.trim();return n.length>0&&Jp(e.config,e.providerId,e.preset).includes(n)?{available:!0,route:t}:{available:!1,route:t,code:e.source==="config_default"?"DEFAULT_MODEL_NOT_AVAILABLE_FOR_ROUTE":"MODEL_NOT_AVAILABLE_FOR_ROUTE",message:`Model "${e.providerId}/${e.modelId}" is not available for the "${t}" route (preset ${e.preset}).`}}function Er(e,t=!1){let n=Object.entries(e?.models??{}).filter(([,s])=>s?.enabled!==!1).map(([s])=>s),i=e?.model_order;if(!t||!Array.isArray(i)||!i.every(s=>typeof s=="string"))return n;let r=new Set(n);return[...i.filter(s=>r.delete(s)),...n.filter(s=>r.has(s))]}var I_=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function qa(e){if(typeof e=="string")return I_.exec(e.trim())?.[1]}function Xp(e){let{field:t,provider:n,value:i}=e;if(i==null)return;if(typeof i!="string")throw new Error(`Provider "${n}": ${t} must be a string or a \`\${NAME}\` environment variable reference, received ${N_(i)}.`);let r=i.trim();if(!r)return;let o=qa(r);if(!o)return r;let s=(e.env??process.env)[o]?.trim();if(!s)throw new Error(`Provider "${n}": ${t} references environment variable "${o}", which is not set.`);return s}function M_(e){if(!(typeof e.value=="string"&&e.value.trim().length>0))return{configured:!1};let n=L_(e.value)?"env":"plaintext";try{let i=Xp(e);return{configured:!0,source:n,...i?{secret:i}:{}}}catch{return{configured:!0,source:n}}}function L_(e){return qa(e)!==void 0}function N_(e){return Array.isArray(e)?"a list":`a ${typeof e}`}import{randomBytes as R_}from"node:crypto";import pt,{readFileSync as P_}from"node:fs";import{dirname as Qp,join as D_}from"node:path";var zp=Or(io(),1);var ja=384,xr=new Set(["__proto__","prototype","constructor"]),F_=["minimax_api","custom_provider"];async function B_(e){let t=e.trim();if(!t||t.includes(".")||xr.has(t))throw new ne("Invalid provider id");return jn(async n=>(ye(n.provider)&&delete n.provider[t],{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function q_(e){if(!ye(e)||!ye(e.models))throw new ne("Invalid managed MiniMax provider snapshot");return kr(e),jn(async t=>(t.provider={...ye(t.provider)?t.provider:{},[Ie]:structuredClone(e)},{write:!0,value:void 0})).then(({config:t})=>({config:t}))}var ne=class extends Error{name="LocalModelProviderConfigValidationError"},$n=class extends Error{name="LocalModelProviderConfigWriteError";constructor(){super("Local runtime failed to update config file")}};async function $_(e){return jn(async(t,n)=>{let i={minimax_api:ye(t.minimax_api)?t.minimax_api:void 0,custom_provider:Y_(ye(t.custom_provider)?t.custom_provider:void 0),minimaxModelSource:typeof t.minimaxModelSource=="string"?t.minimaxModelSource:void 0,defaultModel:typeof t.defaultModel=="string"?t.defaultModel:void 0,defaultModelVariant:typeof t.defaultModelVariant=="string"?t.defaultModelVariant:void 0};await e(i,n);for(let r of F_){let o=i[r];if(o===void 0){delete t[r];continue}if(!ye(o))throw new ne(`Invalid BYOK config subtree "${r}"`);kr(o),t[r]=o}return $a(t,"minimaxModelSource",i.minimaxModelSource),t.defaultModel!==i.defaultModel&&(delete t.defaultModelThinking,delete t.defaultModelContextWindow),$a(t,"defaultModel",i.defaultModel),$a(t,"defaultModelVariant",i.defaultModelVariant),{write:!0,value:void 0}}).then(({config:t})=>({config:t}))}async function j_(e){let t=e.modelKey.trim();if(!t)throw new ne("Default model must not be empty");if(e.contextLimit!==void 0&&(!Number.isSafeInteger(e.contextLimit)||e.contextLimit<=0||e.contextLimit>2147483647))throw new ne("Invalid default context");if(e.thinking?.effort!==void 0&&(typeof e.thinking.effort!="string"||!e.thinking.effort.trim()))throw new ne("Invalid default effort");return jn(async n=>(n.defaultModel=t,e.contextLimit===void 0?delete n.defaultModelContextWindow:n.defaultModelContextWindow=e.contextLimit,e.thinking?.effort===void 0?delete n.defaultModelThinking:n.defaultModelThinking={effort:e.thinking.effort},e.variant===void 0?delete n.defaultModelVariant:n.defaultModelVariant=e.variant,{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function U_(e,t){let n=e.modelId.trim();if(e.providerId!==Ie&&e.providerId!==Yt||!n||xr.has(n))throw new ne("Invalid MiniMax model context target");let i=await jn(async(r,o)=>{let s=e.providerId===Ie?o.provider?.[e.providerId]?.models?.[n]:Gs(o)[n];if(e.providerId===Yt&&!s?.contextWindowOptions?.includes(e.contextLimit))throw new ne("Invalid MiniMax API context limit");if(s?.limit?.context!==e.expectedContextLimit)return{write:!1,value:!1};if(!await t(o))return{write:!1,value:!1};let a=e.providerId===Ie?["minimaxModelContextLimits",n]:["minimax_api","modelContextLimits",n];return G_(r,a,e.contextLimit),{write:!0,value:!0}});return{config:i.config,updated:i.value}}async function jn(e){let t=Vt(),n;try{await pt.promises.mkdir(Qp(t),{recursive:!0}),await pt.promises.writeFile(t,"",{flag:"a",mode:ja}),await pt.promises.chmod(t,ja),n=await zp.default.lock(t,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let i=V_(t),r=structuredClone(i);_r();let o=await e(r,wr());return o.write&&(kr(r),await K_(t,Nn(P_(t,"utf-8"),i,r)),_r()),{config:wr(),value:o.value}}catch(i){throw i instanceof ne||i instanceof $n?i:new $n}finally{await n?.().catch(()=>{})}}async function K_(e,t){let n=D_(Qp(e),`.config-tmp-${R_(6).toString("hex")}`),i=!1;try{let r=ja,o=await pt.promises.open(n,"wx",r);i=!0;try{await o.writeFile(t,"utf-8"),await o.chmod(r)}finally{await o.close()}await pt.promises.rename(n,e)}catch{throw i&&await pt.promises.unlink(n).catch(()=>{}),new $n}}function V_(e){let t=pt.readFileSync(e,"utf-8"),n;try{n=H.load(t)}catch{throw new ne("Invalid config.yaml: unable to parse YAML")}if(n==null)return{};if(!ye(n)||Object.getPrototypeOf(n)!==Object.prototype)throw new ne("Invalid config.yaml: expected a YAML mapping");return n}function Y_(e){if(e)return Object.fromEntries(Object.entries(e).filter(([,t])=>ye(t)))}function $a(e,t,n){n===void 0?delete e[t]:e[t]=n}function G_(e,t,n){let i=t.at(-1);if(!i)throw new ne("Invalid config path");let r=e;for(let o of t.slice(0,-1)){if(!o||xr.has(o))throw new ne("Invalid config path");let s=r[o];if(ye(s))r=s;else{let a={};r[o]=a,r=a}}r[i]=n}function kr(e){for(let[t,n]of Object.entries(e)){if(!t||xr.has(t))throw new ne(`Local runtime cannot update config field segment "${t}"`);ye(n)&&kr(n)}}function ye(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function nw(e){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let i=JSON.parse(t),r=typeof i.pid=="number"?i.pid:parseInt(String(i.pid),10);if(isNaN(r)||r<=0)return null;let o=iw(i.owner)?i.owner:"unknown",s=rw(i.startedAt);return{pid:r,owner:o,...s!==void 0?{startedAt:s}:{},...typeof i.mode=="string"?{mode:i.mode}:{},...typeof i.startupToken=="string"?{startupToken:i.startupToken}:{}}}catch{return null}let n=parseInt(t,10);return isNaN(n)||n<=0?null:{pid:n,owner:"unknown"}}function iw(e){return e==="electron"||e==="cli"||e==="unknown"}function rw(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e!="string")return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}function ow(e,t){let n={pid:e,owner:t,startedAt:Date.now()};return JSON.stringify(n)}function sw(){let e=process.argv.slice(2);for(let t=0;t<e.length;t++){let n=e[t],i=n==="--owner"?e[t+1]:n?.startsWith("--owner=")?n.slice(8):void 0;if(i==="electron")return"electron";if(i==="service"||i==="cli")return"cli"}return"cli"}import Xe from"node:fs";import aw from"node:path";var Zp="local-runtime.auth.json";function _e(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function Ua(e){return e?{..._e(e.accessToken)?{accessToken:_e(e.accessToken)}:{},..._e(e.realUserID)?{realUserID:_e(e.realUserID)}:{},..._e(e.userEmail)?{userEmail:_e(e.userEmail)}:{},..._e(e.userName)?{userName:_e(e.userName)}:{},..._e(e.subUserName)?{subUserName:_e(e.subUserName)}:{}}:{}}function Cr(e){return aw.join(e,Zp)}function lw(e){try{let t=Xe.readFileSync(Cr(e),"utf-8"),n=JSON.parse(t);if(n.version!==1||!n.auth||typeof n.auth!="object")return;let i=Ua(n.auth);return i.accessToken?i:void 0}catch{return}}function cw(e,t,n={}){let i=Cr(e),r=Ua(t);if(!r.accessToken)return em(e),{path:i,written:!1};Xe.mkdirSync(e,{recursive:!0,mode:448});let o={version:1,updatedAtMs:Date.now(),auth:r},s=`${i}.${process.pid}.${Date.now()}.tmp`;return Xe.writeFileSync(s,`${JSON.stringify(o,null,2)}
|
|
193
|
-
`,{encoding:"utf-8",mode:384}),n.retryWindowsFileSystem?(Tr(()=>Xe.renameSync(s,i)),Tr(()=>Xe.chmodSync(i,384))):(Xe.renameSync(s,i),Xe.chmodSync(i,384)),{path:i,written:!0}}function em(e){try{Xe.rmSync(Cr(e),{force:!0})}catch{}}import tm from"node:net";var nm={"e2e-runtime":5e3,"e2e-ui":5500,"smoke-runtime":7e3},Ka=100;async function uw(e,t={}){let n=t.isPortFree??dw,i=t.getFreePort??pw,r=t.getWorktreeBasePort??fw,o=r()+nm[e],s=o-r();if(s<Ka)throw new Error(`pickTestPort(${e}): role offset ${s} collides with app runtime (0); must be >= ${Ka}.`);return o>65535?i():await n(o)?o:i()}function fw(){let e=dt();return e.autoDetected?e.runtimePort:Kt}async function dw(e){return new Promise(t=>{let n=tm.createServer();n.once("error",()=>t(!1)),n.listen(e,"127.0.0.1",()=>{n.close(()=>t(!0))})})}async function pw(){return new Promise((e,t)=>{let n=tm.createServer();n.listen(0,"127.0.0.1",()=>{let i=n.address();if(i&&typeof i!="string"){let{port:r}=i;n.close(()=>e(r))}else n.close(()=>t(new Error("Failed to get free port")))}),n.on("error",t)})}import im from"node:fs";var Gt=class extends Error{code;configPath;constructor(t,n,i,r){super(i,r),this.name="ConfigFileError",this.code=t,this.configPath=n}};function rm(e){let t;try{t=im.readFileSync(e,"utf-8")}catch(i){throw new Gt("CONFIG_READ_FAILED",e,`Cannot read config ${e}.`,{cause:i})}let n;try{n=
|
|
192
|
+
`)){let n=/file:\/\/[^)\s]+/u.exec(t)?.[0]?.replace(/:\d+:\d+$/u,"");if(n)try{return oe.dirname(DA(n))}catch{}let i=/\(?((?:\/|[A-Za-z]:\\)[^()]+?\.(?:cjs|mjs|js|ts)):\d+:\d+\)?/u.exec(t)?.[1];if(i)return oe.dirname(i)}}function t_(){let e=vr();return e||(Sr()?dt().profile:null)}function Ia(){let e=vr();if(zA())return xa();if(Sr()){let n=dt();if(n.autoDetected&&n.profile)return Ge({profile:n.profile})}let t=xa();return t||(e?Ge({profile:e}):Ge())}function Vt(){return oe.join(Ia(),"config.yaml")}var Ar={"cn-test":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-dev":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-staging":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","en-test":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-dev":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-staging":"https://agent.minimax.io/mavis/api/v1/llm/v1","cn-prod":"https://agent.minimax.cn/mavis/api/v1/llm/v1","en-prod":"https://agent.minimax.io/mavis/api/v1/llm/v1"},jp=["https://agent.minimaxi.com/mavis/api/v1/llm/v1"],n_=new Set([...Object.values(Ar),...jp]),i_=new Set([...Object.values(Ar),...jp].map(e=>new URL(e).origin));function Up(e){if(n_.has(e))return!0;try{let t=new URL(e);return!t.username&&!t.password&&i_.has(t.origin)}catch{return!1}}function Kp(){return Te()==="test"}function r_(){return!Kp()}function o_(e){if(!mr()||!Oe.existsSync(e))return;let t=Vp(e),{provider:n}=t;if(n==null||typeof n!="object"||Array.isArray(n))return;let{minimax:i}=n;if(i==null||typeof i!="object"||Array.isArray(i))return;let{options:r}=i;if(r==null||typeof r!="object"||Array.isArray(r))return;let o=r.baseURL;if(typeof o!="string")return;let s=Ar[yr()];if(o===s||!Up(o))return;let a=Oe.readFileSync(e);r.baseURL=s;try{let l=a.toString("utf-8");it(e,Nn(l,Ln(l),t))}catch(l){let c=!1;try{c=Oe.readFileSync(e).equals(a)}catch{}if(!c)throw l;console.warn("[config] managed preset baseURL sync skipped; config file unchanged, using runtime provider settings")}}function Je(e){return{provider:{minimax:{name:"MiniMax",npm:"@ai-sdk/anthropic",options:{authMode:"managed-login",apiKey:"sk-xxx",baseURL:Ar[e]},models:wt}},defaultModel:"minimax/MiniMax-M3.1-Flash-Preview"}}var Ma={"cn-test":Je("cn-test"),"cn-dev":Je("cn-dev"),"cn-staging":Je("cn-staging"),"cn-prod":Je("cn-prod"),"en-test":Je("en-test"),"en-dev":Je("en-dev"),"en-staging":Je("en-staging"),"en-prod":Je("en-prod")},W={logLevel:"info",devPort:Ea,permissionMode:"auto",skipWindowsHardSafetyChecks:!1,sseErrorPush:{history:!0,stream:!0},beta:Object.fromEntries(Object.keys(qn).map(e=>[e,Ca(e,void 0,{buildEnv:"dev"})])),agents:{default:{}},memory:{enabled:!0,proactive:!1,dailyDigest:{enabled:!1},v2:{...ir}},subagent:{...pr},skillEvolve:{enabled:!0,inSession:{N:20,minIntervalSeconds:30,maxPendingPerSession:1},signalCooldownHours:24,minConfidence:.7,excludeAgents:["skill-editor"],disableModelPrefixes:["MiniMax-M2"],builtinMrEnabled:!1,sourceRepo:void 0,proposal:{enabled:!1,eligibleAgents:["mavis"],minMessageCount:40,skipPassiveSessionEnd:!0},lifecycle:{staleThresholdDays:15,archiveThresholdDays:30}},sessionRotate:{enabled:!0,activeSessionLookbackHours:12},agentStop:{debounceMs:500,maxActiveSpanMs:1800*1e3},asr:{...lr},skills:ur,askUser:{...ua},dataContribution:{...We},sessionTitle:{enabled:!0},cli:{spawn:{enabled:!1}},browser:{...Dn},tui:{},opencode:{xdg:{dataIsolation:!1,startupImport:"off"},keepAlive:{enabled:!1,maxProcesses:5,maxLifetimeMs:288e5,agents:["mavis","main","verifier","code-reviewer"]},spawnConcurrency:3},contextManagement:{disableSystemReminderModels:[],cuMaxScreenshotsInContext:2},runawayGuard:{enabled:!0},toolResultCompaction:{...Ae},requestMedia:{...Pn},agentRuntime:{defaultFramework:Bt},logRetentionDays:3,worktreeRefreshBeforeCreate:!0,review:{mode:"subagent",turnDiffCard:"concise",modeSource:"default"},goal:structuredClone(he),sandbox:structuredClone(va),goalWarnings:[]};function s_(){let e=Vt(),t=oe.dirname(e);if(Oe.existsSync(t)||Oe.mkdirSync(t,{recursive:!0}),Oe.existsSync(e)){Na(e);return}if(!mr()){let r=Ge({homeDir:RA.homedir()}),o=oe.join(r,"config.yaml");e!==o&&Oe.existsSync(o)&&(Et(o),it(e,Oe.readFileSync(o),!0));return}let n=Ma[yr()],i=J.dump({logLevel:W.logLevel,provider:La?n.provider:void 0,defaultModel:n.defaultModel,dataContribution:{enabled:We.enabled},memory:{enabled:!1},skipWindowsHardSafetyChecks:W.skipWindowsHardSafetyChecks});it(e,i,!0)}function Vp(e=Vt()){return Ln(a_(e))}function a_(e=Vt()){try{return Oe.readFileSync(e,"utf-8")}catch{return""}}var Bn=null;function l_(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e;return{branchFinish:typeof t.branchFinish=="boolean"?t.branchFinish:!1}}var Yp={isManagedRuntime:mr,shouldEnforceManagedProviderProtection:r_,getManagedPreset:()=>Ma[yr()],isManagedPresetBaseUrl:Up},Gp=!0,La=!0;function c_(e){Gp=e}function u_(e){La=e}function Na(e){Et(e),jd(e),Gp&&qd(e,Yp),La&&o_(e)}function _r(){Bn=null}function wr(){if(Bn)return Bn;s_();let e=Vp();return Bn=Ra(e,Ia()),Bn}function Ra(e,t){let n=e.sseErrorPush,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:void 0,r=typeof e.devPort=="number"?e.devPort:W.devPort;if(Sr()&&!$p()){let c=dt();c.autoDetected&&(r=c.uiPort)}let o=pa(e.goal),s=$d({provider:e.provider!=null&&typeof e.provider=="object"&&!Array.isArray(e.provider)?Pd(e.provider):{},defaultModel:typeof e.defaultModel=="string"?e.defaultModel:void 0},Yp),a=Ys(e.minimaxModelContextLimits),l=f_(e);return{logLevel:typeof e.logLevel=="string"?e.logLevel:W.logLevel,devPort:r,...s,provider:Nd(s.provider,a),defaultModelVariant:typeof e.defaultModelVariant=="string"?e.defaultModelVariant:void 0,defaultModelThinking:e.defaultModelThinking&&typeof e.defaultModelThinking=="object"&&typeof e.defaultModelThinking.effort=="string"?{effort:e.defaultModelThinking.effort}:void 0,defaultModelContextWindow:Number.isSafeInteger(e.defaultModelContextWindow)&&Number(e.defaultModelContextWindow)>0&&Number(e.defaultModelContextWindow)<=2147483647?Number(e.defaultModelContextWindow):void 0,minimax_api:Md(e.minimax_api),minimaxModelContextLimits:a,custom_provider:Rd(e.custom_provider),minimaxModelSource:typeof e.minimaxModelSource=="string"&&(e.minimaxModelSource==="token_plan"||e.minimaxModelSource==="minimax_api_key")?e.minimaxModelSource:void 0,nexus:e.nexus!=null&&typeof e.nexus=="object"&&!Array.isArray(e.nexus)?(()=>{let c={};typeof Reflect.get(e.nexus,"enabled")=="boolean"&&(c.enabled=Reflect.get(e.nexus,"enabled"));let u=Reflect.get(e.nexus,"model");return u!=null&&typeof u=="object"&&!Array.isArray(u)&&typeof Reflect.get(u,"providerID")=="string"&&typeof Reflect.get(u,"modelID")=="string"&&(c.model={providerID:Reflect.get(u,"providerID"),modelID:Reflect.get(u,"modelID"),...typeof Reflect.get(u,"variant")=="string"?{variant:Reflect.get(u,"variant")}:{}}),Object.keys(c).length>0?c:void 0})():void 0,defaultLightModel:typeof e.defaultLightModel=="string"?e.defaultLightModel:void 0,skipWindowsHardSafetyChecks:e.skipWindowsHardSafetyChecks===!0,permissionMode:typeof e.permissionMode=="string"&&["default","bypassPermissions","auto","off"].includes(e.permissionMode)?e.permissionMode:W.permissionMode,permission:Gd(e),sseErrorPush:{history:typeof i?.history=="boolean"?i.history:W.sseErrorPush.history,stream:typeof i?.stream=="boolean"?i.stream:W.sseErrorPush.stream},notifications:l_(e.notifications),dataDir:t,agentsDir:oe.join(t,"agents"),sessionsDir:oe.join(t,"sessions"),memoryDir:oe.join(t,"memory"),skillsDir:oe.join(t,"skills"),builtinSkillsDir:oe.join(t,".builtin-skills"),logsDir:oe.join(t,"logs"),pluginsDir:oe.join(t,"plugins"),plansDir:oe.join(t,"plans"),harnessesDir:oe.join(t,"harnesses"),subAgentsDir:oe.join(t,"subagents"),beta:l,agents:ca(e.agents),memory:Cd(e,W.memory),subagent:_a(e.subagent),skillEvolve:m_(e,l),sessionRotate:h_(e),agentStop:y_(e),asr:Yd(e),skills:Ws(e),askUser:dp(e,W.askUser),dataContribution:fa(e,W.dataContribution),sessionTitle:g_(e),cli:b_(e),browser:ga(e.browser),tui:Od(e),opencode:Kd(e,W.opencode),contextManagement:S_(e),runawayGuard:oo(e.runawayGuard),toolResultCompaction:ma(e.toolResultCompaction),requestMedia:ya(e.requestMedia),agentRuntime:Hs(e.agentRuntime),logRetentionDays:v_(e),contentReview:A_(e),mcpToolSearch:__(e),review:Ud(e.review,W.review),worktreeRefreshBeforeCreate:e.worktreeRefreshBeforeCreate!==!1,promptConfig:Wp(e.promptConfig),goal:o.config,goalWarnings:o.warnings,sandbox:Aa(e.sandbox)}}function f_(e){let t=e.beta!=null&&typeof e.beta=="object"&&!Array.isArray(e.beta)?e.beta:{},n={buildEnv:Te(),defaultBuildEnvironment:ka(),internalBuild:Oa(),insideBuild:YA(),mcodeToolsDevMode:process.env.MAVIS_DEV_MCODE_TOOLS_MODE==="published"?"published":void 0},i={};for(let r of Object.keys(qn))i[r]=Ca(r,t[r],n);return i}function d_(e){let t=e.provider;if(t==null||typeof t!="object"||Array.isArray(t))return[];let n=[];for(let i of Object.values(t)){if(i==null||typeof i!="object"||Array.isArray(i))continue;let{models:r}=i;r==null||typeof r!="object"||Array.isArray(r)||n.push(...Object.keys(r))}return n}function p_(e,t){if(t.length===0)return!0;let n=d_(e);if(n.length===0)return!1;let i=t.map(r=>r.toLowerCase());return!n.every(r=>i.some(o=>r.toLowerCase().startsWith(o)))}function Mp(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function m_(e,t){let n=W.skillEvolve,i=e.skillEvolve,o=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},s=o.inSession,{inSession:a}=n;if(s!=null&&typeof s=="object"&&!Array.isArray(s)){let E=s;a={N:typeof E.N=="number"&&E.N>0?E.N:n.inSession.N,minIntervalSeconds:typeof E.minIntervalSeconds=="number"&&E.minIntervalSeconds>=0?E.minIntervalSeconds:n.inSession.minIntervalSeconds,maxPendingPerSession:typeof E.maxPendingPerSession=="number"&&E.maxPendingPerSession>=1?E.maxPendingPerSession:n.inSession.maxPendingPerSession}}let l=o.excludeAgents,c=Array.isArray(l)&&l.every(E=>typeof E=="string")?l:n.excludeAgents,u=Array.isArray(o.disableModelPrefixes)&&o.disableModelPrefixes.every(E=>typeof E=="string")?o.disableModelPrefixes:n.disableModelPrefixes,f=t.skillEvolve?typeof o.enabled=="boolean"?o.enabled:p_(e,u):!1,d=f&&t.skillEvolveBuiltinMr?typeof o.builtinMrEnabled=="boolean"?o.builtinMrEnabled:n.builtinMrEnabled:!1,p=o.sourceRepo,h=typeof p=="string"&&p.trim().length>0?p.trim():n.sourceRepo,m=o.proposal,y=n.proposal,g=m!=null&&typeof m=="object"&&!Array.isArray(m)?m:{},b=Array.isArray(g.eligibleAgents)&&g.eligibleAgents.every(E=>typeof E=="string")?g.eligibleAgents:y.eligibleAgents,v=typeof g.minMessageCount=="number"&&g.minMessageCount>=1?Math.floor(g.minMessageCount):y.minMessageCount,x=typeof g.skipPassiveSessionEnd=="boolean"?g.skipPassiveSessionEnd:y.skipPassiveSessionEnd,k=typeof g.enabled=="boolean"?g.enabled:null,C=f&&t.skillProposal?k??!0:!1,M=o.lifecycle,_=M&&typeof M=="object"&&!Array.isArray(M)?M:{},A=Mp(_.staleThresholdDays,n.lifecycle.staleThresholdDays),O=Mp(_.archiveThresholdDays,n.lifecycle.archiveThresholdDays);if(!(A<O))throw new Error(`Invalid skillEvolve.lifecycle config: staleThresholdDays (${A}) must be strictly less than archiveThresholdDays (${O}).`);return{enabled:f,inSession:a,signalCooldownHours:typeof o.signalCooldownHours=="number"&&o.signalCooldownHours>0?o.signalCooldownHours:n.signalCooldownHours,minConfidence:typeof o.minConfidence=="number"&&o.minConfidence>=0&&o.minConfidence<=1?o.minConfidence:n.minConfidence,scannerModel:typeof o.scannerModel=="string"?o.scannerModel:void 0,excludeAgents:c,disableModelPrefixes:u,builtinMrEnabled:d,sourceRepo:h,proposal:{enabled:C,eligibleAgents:b,minMessageCount:v,skipPassiveSessionEnd:x},lifecycle:{staleThresholdDays:A,archiveThresholdDays:O}}}function h_(e){let t=W.sessionRotate,n=e.sessionRotate;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.activeSessionLookbackHours;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,activeSessionLookbackHours:typeof r=="number"&&Number.isFinite(r)&&r>0?r:t.activeSessionLookbackHours}}function y_(e){let t=W.agentStop,n=e.agentStop;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.debounceMs,o=i.maxActiveSpanMs;return{debounceMs:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:t.debounceMs,maxActiveSpanMs:typeof o=="number"&&Number.isFinite(o)&&o>=0?o:t.maxActiveSpanMs}}function Wp(e){let t=Te()==="prod"&&!Oa();if(e==null||typeof e!="object"||Array.isArray(e))return{autoUpdate:t};let n=e.autoUpdate;return{autoUpdate:typeof n=="boolean"?n:t}}function g_(e){let t=W.sessionTitle,n=e.sessionTitle;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}function b_(e){let t=W.cli,n=e.cli;if(n==null||typeof n!="object"||Array.isArray(n))return{spawn:{...t.spawn}};let i=n.spawn;if(i==null||typeof i!="object"||Array.isArray(i))return{spawn:{...t.spawn}};let r=i;return{spawn:{enabled:typeof r.enabled=="boolean"?r.enabled:t.spawn.enabled}}}function S_(e){let t=W.contextManagement,n=e.contextManagement;if(n==null||typeof n!="object"||Array.isArray(n))return{disableSystemReminderModels:[...t.disableSystemReminderModels],cuMaxScreenshotsInContext:t.cuMaxScreenshotsInContext};let i=n,r=i.disableSystemReminderModels,o=Array.isArray(r)&&r.every(l=>typeof l=="string"&&l.length>0)?r:[...t.disableSystemReminderModels],s=i.cuMaxScreenshotsInContext,a=typeof s=="number"&&Number.isFinite(s)&&s>=0?Math.floor(s):t.cuMaxScreenshotsInContext;return{disableSystemReminderModels:o,cuMaxScreenshotsInContext:a}}function v_(e){let t=e.logRetentionDays;return typeof t=="number"&&t>=1&&Number.isFinite(t)?Math.floor(t):W.logRetentionDays}function A_(e){let t=e.contentReview;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"testBaseURL");return typeof r=="string"&&r.trim()&&(n.testBaseURL=r.trim()),Object.keys(n).length>0?n:void 0}function __(e){let t=e.mcpToolSearch;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"systemHint");typeof r=="boolean"&&(n.systemHint=r);let o=Reflect.get(t,"thresholdPct");typeof o=="number"&&(n.thresholdPct=o);let s=Reflect.get(t,"minDeferCount");typeof s=="number"&&(n.minDeferCount=s);let a=Reflect.get(t,"topKDefault");typeof a=="number"&&(n.topKDefault=a);let l=Reflect.get(t,"topKMax");typeof l=="number"&&(n.topKMax=l);let c=Reflect.get(t,"maxSchemaTextLen");typeof c=="number"&&(n.maxSchemaTextLen=c);let u=Reflect.get(t,"modelWhitelist");return Array.isArray(u)&&(n.modelWhitelist=u.filter(f=>typeof f=="string")),Object.keys(n).length>0?n:void 0}function Hp(){let e=qp();if(Sr()&&!$p()){let t=dt();if(t.autoDetected)return t.runtimePort}return e??Kt}function w_(e=Hp()){let t=e+Fp;if(t<=wa)return t;let n=e+Op;if(n<=wa)return n;throw new Error(`Cannot allocate an OpenCode sidecar port for runtime port ${String(e)}; choose a runtime port <= ${String(wa-Op)}.`)}var E_=["agent.minimaxi.com","agent.minimaxi.com","agent.minimax.io","agent.minimax.io","agent.minimax.io","agent.minimax.cn","agent.minimaxi.com"],x_=new Set(E_.map(e=>`https://${e}`));function k_(e,t){return/^custom_provider:minimax-legacy(?:-\d+)?$/u.test(e)&&(!t||Pa(t))}function Pa(e){try{let t=new URL(e);return t.username||t.password?!1:x_.has(t.origin.toLowerCase())}catch{return!1}}function C_(e){if(!(e!=="managed-login"&&e!=="api-key"&&e!=="oauth"))return e}function Da(e){let t=typeof e?.baseURL=="string"?e.baseURL.trim():"",n=t.length>0&&Pa(t),i=C_(e?.authMode),r=[];return typeof e?.authMode=="string"&&!i&&r.push(`Unknown provider authMode "${e.authMode}"; falling back to compatibility resolution.`),i?(i==="managed-login"&&t.length>0&&!n&&!e?.allowManagedBaseURLOverride&&r.push("Provider authMode is managed-login but baseURL is not a known managed MiniMax host."),{authMode:i,source:"explicit",managedBaseURL:n,warnings:r}):n?(r.push("Provider authMode is inferred from a managed MiniMax baseURL; set options.authMode: managed-login to make this explicit."),{authMode:"managed-login",source:"inferred-managed-base-url",managedBaseURL:n,warnings:r}):{authMode:"api-key",source:"default-api-key",managedBaseURL:n,warnings:r}}var Ie="minimax",Yt="minimax_api",Fa="custom_provider:";function O_(e,t){return e==="anthropic-messages"&&(t===Ie||t===Yt)}function Ba(e,t){if(t===Yt)return"minimax_api_key";if(t.startsWith(Fa))return"custom_provider";if(t!==Ie)return"configured_provider";if(e.minimaxModelSource==="minimax_api_key")return"minimax_api_key";let n=e.provider?.[t]?.options;return Da({authMode:n?.authMode,baseURL:n?.baseURL}).authMode==="managed-login"?"managed_token_plan":"configured_provider"}function Jp(e,t,n){switch(Ba(e,t)){case"managed_token_plan":return Er(e.provider?.[t],!0);case"minimax_api_key":{let r=e.provider?.[Ie];return Er({...r,models:r?.models??wt},!0)}case"custom_provider":{let r=e.custom_provider?.[t.slice(Fa.length)];return!r||r.enabled===!1?[]:Er(r)}case"configured_provider":return Er(e.provider?.[t])}}function T_(e){let t=Ba(e.config,e.providerId),n=e.modelId.trim();return n.length>0&&Jp(e.config,e.providerId,e.preset).includes(n)?{available:!0,route:t}:{available:!1,route:t,code:e.source==="config_default"?"DEFAULT_MODEL_NOT_AVAILABLE_FOR_ROUTE":"MODEL_NOT_AVAILABLE_FOR_ROUTE",message:`Model "${e.providerId}/${e.modelId}" is not available for the "${t}" route (preset ${e.preset}).`}}function Er(e,t=!1){let n=Object.entries(e?.models??{}).filter(([,s])=>s?.enabled!==!1).map(([s])=>s),i=e?.model_order;if(!t||!Array.isArray(i)||!i.every(s=>typeof s=="string"))return n;let r=new Set(n);return[...i.filter(s=>r.delete(s)),...n.filter(s=>r.has(s))]}var I_=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function qa(e){if(typeof e=="string")return I_.exec(e.trim())?.[1]}function Xp(e){let{field:t,provider:n,value:i}=e;if(i==null)return;if(typeof i!="string")throw new Error(`Provider "${n}": ${t} must be a string or a \`\${NAME}\` environment variable reference, received ${N_(i)}.`);let r=i.trim();if(!r)return;let o=qa(r);if(!o)return r;let s=(e.env??process.env)[o]?.trim();if(!s)throw new Error(`Provider "${n}": ${t} references environment variable "${o}", which is not set.`);return s}function M_(e){if(!(typeof e.value=="string"&&e.value.trim().length>0))return{configured:!1};let n=L_(e.value)?"env":"plaintext";try{let i=Xp(e);return{configured:!0,source:n,...i?{secret:i}:{}}}catch{return{configured:!0,source:n}}}function L_(e){return qa(e)!==void 0}function N_(e){return Array.isArray(e)?"a list":`a ${typeof e}`}import{randomBytes as R_}from"node:crypto";import pt,{readFileSync as P_}from"node:fs";import{dirname as Qp,join as D_}from"node:path";var zp=Or(io(),1);var ja=384,xr=new Set(["__proto__","prototype","constructor"]),F_=["minimax_api","custom_provider"];async function B_(e){let t=e.trim();if(!t||t.includes(".")||xr.has(t))throw new ne("Invalid provider id");return jn(async n=>(ye(n.provider)&&delete n.provider[t],{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function q_(e){if(!ye(e)||!ye(e.models))throw new ne("Invalid managed MiniMax provider snapshot");return kr(e),jn(async t=>(t.provider={...ye(t.provider)?t.provider:{},[Ie]:structuredClone(e)},{write:!0,value:void 0})).then(({config:t})=>({config:t}))}var ne=class extends Error{name="LocalModelProviderConfigValidationError"},$n=class extends Error{name="LocalModelProviderConfigWriteError";constructor(){super("Local runtime failed to update config file")}};async function $_(e){return jn(async(t,n)=>{let i={minimax_api:ye(t.minimax_api)?t.minimax_api:void 0,custom_provider:Y_(ye(t.custom_provider)?t.custom_provider:void 0),minimaxModelSource:typeof t.minimaxModelSource=="string"?t.minimaxModelSource:void 0,defaultModel:typeof t.defaultModel=="string"?t.defaultModel:void 0,defaultModelVariant:typeof t.defaultModelVariant=="string"?t.defaultModelVariant:void 0};await e(i,n);for(let r of F_){let o=i[r];if(o===void 0){delete t[r];continue}if(!ye(o))throw new ne(`Invalid BYOK config subtree "${r}"`);kr(o),t[r]=o}return $a(t,"minimaxModelSource",i.minimaxModelSource),t.defaultModel!==i.defaultModel&&(delete t.defaultModelThinking,delete t.defaultModelContextWindow),$a(t,"defaultModel",i.defaultModel),$a(t,"defaultModelVariant",i.defaultModelVariant),{write:!0,value:void 0}}).then(({config:t})=>({config:t}))}async function j_(e){let t=e.modelKey.trim();if(!t)throw new ne("Default model must not be empty");if(e.contextLimit!==void 0&&(!Number.isSafeInteger(e.contextLimit)||e.contextLimit<=0||e.contextLimit>2147483647))throw new ne("Invalid default context");if(e.thinking?.effort!==void 0&&(typeof e.thinking.effort!="string"||!e.thinking.effort.trim()))throw new ne("Invalid default effort");return jn(async n=>(n.defaultModel=t,e.contextLimit===void 0?delete n.defaultModelContextWindow:n.defaultModelContextWindow=e.contextLimit,e.thinking?.effort===void 0?delete n.defaultModelThinking:n.defaultModelThinking={effort:e.thinking.effort},e.variant===void 0?delete n.defaultModelVariant:n.defaultModelVariant=e.variant,{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function U_(e,t){let n=e.modelId.trim();if(e.providerId!==Ie&&e.providerId!==Yt||!n||xr.has(n))throw new ne("Invalid MiniMax model context target");let i=await jn(async(r,o)=>{let s=e.providerId===Ie?o.provider?.[e.providerId]?.models?.[n]:Gs(o)[n];if(e.providerId===Yt&&!s?.contextWindowOptions?.includes(e.contextLimit))throw new ne("Invalid MiniMax API context limit");if(s?.limit?.context!==e.expectedContextLimit)return{write:!1,value:!1};if(!await t(o))return{write:!1,value:!1};let a=e.providerId===Ie?["minimaxModelContextLimits",n]:["minimax_api","modelContextLimits",n];return G_(r,a,e.contextLimit),{write:!0,value:!0}});return{config:i.config,updated:i.value}}async function jn(e){let t=Vt(),n;try{await pt.promises.mkdir(Qp(t),{recursive:!0}),await pt.promises.writeFile(t,"",{flag:"a",mode:ja}),await pt.promises.chmod(t,ja),n=await zp.default.lock(t,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let i=V_(t),r=structuredClone(i);_r();let o=await e(r,wr());return o.write&&(kr(r),await K_(t,Nn(P_(t,"utf-8"),i,r)),_r()),{config:wr(),value:o.value}}catch(i){throw i instanceof ne||i instanceof $n?i:new $n}finally{await n?.().catch(()=>{})}}async function K_(e,t){let n=D_(Qp(e),`.config-tmp-${R_(6).toString("hex")}`),i=!1;try{let r=ja,o=await pt.promises.open(n,"wx",r);i=!0;try{await o.writeFile(t,"utf-8"),await o.chmod(r)}finally{await o.close()}await pt.promises.rename(n,e)}catch{throw i&&await pt.promises.unlink(n).catch(()=>{}),new $n}}function V_(e){let t=pt.readFileSync(e,"utf-8"),n;try{n=J.load(t)}catch{throw new ne("Invalid config.yaml: unable to parse YAML")}if(n==null)return{};if(!ye(n)||Object.getPrototypeOf(n)!==Object.prototype)throw new ne("Invalid config.yaml: expected a YAML mapping");return n}function Y_(e){if(e)return Object.fromEntries(Object.entries(e).filter(([,t])=>ye(t)))}function $a(e,t,n){n===void 0?delete e[t]:e[t]=n}function G_(e,t,n){let i=t.at(-1);if(!i)throw new ne("Invalid config path");let r=e;for(let o of t.slice(0,-1)){if(!o||xr.has(o))throw new ne("Invalid config path");let s=r[o];if(ye(s))r=s;else{let a={};r[o]=a,r=a}}r[i]=n}function kr(e){for(let[t,n]of Object.entries(e)){if(!t||xr.has(t))throw new ne(`Local runtime cannot update config field segment "${t}"`);ye(n)&&kr(n)}}function ye(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function nw(e){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let i=JSON.parse(t),r=typeof i.pid=="number"?i.pid:parseInt(String(i.pid),10);if(isNaN(r)||r<=0)return null;let o=iw(i.owner)?i.owner:"unknown",s=rw(i.startedAt);return{pid:r,owner:o,...s!==void 0?{startedAt:s}:{},...typeof i.mode=="string"?{mode:i.mode}:{},...typeof i.startupToken=="string"?{startupToken:i.startupToken}:{}}}catch{return null}let n=parseInt(t,10);return isNaN(n)||n<=0?null:{pid:n,owner:"unknown"}}function iw(e){return e==="electron"||e==="cli"||e==="unknown"}function rw(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e!="string")return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}function ow(e,t){let n={pid:e,owner:t,startedAt:Date.now()};return JSON.stringify(n)}function sw(){let e=process.argv.slice(2);for(let t=0;t<e.length;t++){let n=e[t],i=n==="--owner"?e[t+1]:n?.startsWith("--owner=")?n.slice(8):void 0;if(i==="electron")return"electron";if(i==="service"||i==="cli")return"cli"}return"cli"}import Xe from"node:fs";import aw from"node:path";var Zp="local-runtime.auth.json";function _e(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function Ua(e){return e?{..._e(e.accessToken)?{accessToken:_e(e.accessToken)}:{},..._e(e.realUserID)?{realUserID:_e(e.realUserID)}:{},..._e(e.userEmail)?{userEmail:_e(e.userEmail)}:{},..._e(e.userName)?{userName:_e(e.userName)}:{},..._e(e.subUserName)?{subUserName:_e(e.subUserName)}:{}}:{}}function Cr(e){return aw.join(e,Zp)}function lw(e){try{let t=Xe.readFileSync(Cr(e),"utf-8"),n=JSON.parse(t);if(n.version!==1||!n.auth||typeof n.auth!="object")return;let i=Ua(n.auth);return i.accessToken?i:void 0}catch{return}}function cw(e,t,n={}){let i=Cr(e),r=Ua(t);if(!r.accessToken)return em(e),{path:i,written:!1};Xe.mkdirSync(e,{recursive:!0,mode:448});let o={version:1,updatedAtMs:Date.now(),auth:r},s=`${i}.${process.pid}.${Date.now()}.tmp`;return Xe.writeFileSync(s,`${JSON.stringify(o,null,2)}
|
|
193
|
+
`,{encoding:"utf-8",mode:384}),n.retryWindowsFileSystem?(Tr(()=>Xe.renameSync(s,i)),Tr(()=>Xe.chmodSync(i,384))):(Xe.renameSync(s,i),Xe.chmodSync(i,384)),{path:i,written:!0}}function em(e){try{Xe.rmSync(Cr(e),{force:!0})}catch{}}import tm from"node:net";var nm={"e2e-runtime":5e3,"e2e-ui":5500,"smoke-runtime":7e3},Ka=100;async function uw(e,t={}){let n=t.isPortFree??dw,i=t.getFreePort??pw,r=t.getWorktreeBasePort??fw,o=r()+nm[e],s=o-r();if(s<Ka)throw new Error(`pickTestPort(${e}): role offset ${s} collides with app runtime (0); must be >= ${Ka}.`);return o>65535?i():await n(o)?o:i()}function fw(){let e=dt();return e.autoDetected?e.runtimePort:Kt}async function dw(e){return new Promise(t=>{let n=tm.createServer();n.once("error",()=>t(!1)),n.listen(e,"127.0.0.1",()=>{n.close(()=>t(!0))})})}async function pw(){return new Promise((e,t)=>{let n=tm.createServer();n.listen(0,"127.0.0.1",()=>{let i=n.address();if(i&&typeof i!="string"){let{port:r}=i;n.close(()=>e(r))}else n.close(()=>t(new Error("Failed to get free port")))}),n.on("error",t)})}import im from"node:fs";var Gt=class extends Error{code;configPath;constructor(t,n,i,r){super(i,r),this.name="ConfigFileError",this.code=t,this.configPath=n}};function rm(e){let t;try{t=im.readFileSync(e,"utf-8")}catch(i){throw new Gt("CONFIG_READ_FAILED",e,`Cannot read config ${e}.`,{cause:i})}let n;try{n=J.load(t)}catch(i){throw new Gt("CONFIG_PARSE_FAILED",e,`Config is not valid YAML: ${e}`,{cause:i})}if(n==null||typeof n!="object"||Array.isArray(n))throw new Gt("CONFIG_ROOT_INVALID",e,`Config root must be an object: ${e}`);return n}function mw(e,t){return im.existsSync(e)&&Na(e),Ra(rm(e),t.dataDir)}function hw(e,t){let n=rm(e);if(n.beta==null||typeof n.beta!="object"||Array.isArray(n.beta))return;let i=n.beta[t];return typeof i=="boolean"?i:void 0}export{io as a,gw as b,bw as c,om as d,J as e,ng as f,ro as g,oo as h,Sd as i,Ln as j,Nn as k,Ft as l,ir as m,Pv as n,Gs as o,ur as p,Ws as q,oA as r,Hd as s,Bt as t,Jd as u,Hs as v,tp as w,np as x,rp as y,op as z,Ge as A,mA as B,hA as C,sa as D,aa as E,la as F,lp as G,ca as H,SA as I,AA as J,_A as K,wA as L,EA as M,We as N,fa as O,pp as P,yp as Q,gp as R,bp as S,Sp as T,vp as U,he as V,da as W,pa as X,Ae as Y,ma as Z,Pn as _,ya as $,Dn as aa,ga as ba,wp as ca,Sa as da,va as ea,Aa as fa,pr as ga,_a as ha,xp as ia,Np as ja,Te as ka,mr as la,yr as ma,Ca as na,VA as oa,Oa as pa,GA as qa,Rp as ra,Kt as sa,Fp as ta,ZA as ua,dt as va,t_ as wa,Ia as xa,Vt as ya,Kp as za,Ma as Aa,c_ as Ba,u_ as Ca,_r as Da,wr as Ea,Wp as Fa,Hp as Ga,w_ as Ha,k_ as Ia,Pa as Ja,Da as Ka,Ie as La,Yt as Ma,Fa as Na,O_ as Oa,Ba as Pa,Jp as Qa,T_ as Ra,qa as Sa,Xp as Ta,M_ as Ua,B_ as Va,q_ as Wa,$_ as Xa,j_ as Ya,U_ as Za,nw as _a,ow as $a,sw as ab,Zp as bb,Ua as cb,Cr as db,lw as eb,cw as fb,em as gb,nm as hb,Ka as ib,uw as jb,Gt as kb,mw as lb,hw as mb};
|