@minimax-ai/code 0.6.11 → 0.6.12
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 +23 -0
- package/CHANGELOG.zh-CN.md +23 -0
- package/README.md +1 -1
- package/README.zh-CN.md +11 -1
- package/assets/agents/_default/prompt-base-windows.md +1 -1
- package/assets/agents/_default/prompt-base-windows.md.hbs +1 -1
- package/assets/agents/desktop-task/checkpoint/system.md +6 -2
- package/assets/agents/managed-prompts.json +1 -0
- package/assets/agents/memory-v2-consolidation.md +2 -2
- package/assets/agents/workflow/goal/budget-limit.md +4 -1
- package/assets/agents/workflow/goal/completion-summary.md +2 -0
- package/assets/agents/workflow/goal/recovery-terminal-audit.md +3 -2
- package/assets/agents/workflow/goal/recovery.md +2 -2
- package/chunks/{clipboard-image-Q5NH3BUQ.js → application-FYXBCFKS.js} +1 -1
- package/chunks/{auth-command-YIBIYLYL.js → auth-command-UUTBKVM2.js} +3 -3
- package/chunks/chunk-25R53L7J.js +23 -0
- package/chunks/chunk-334CV6RF.js +2 -0
- package/chunks/{chunk-7FUBWI5L.js → chunk-47KWM23C.js} +906 -856
- package/chunks/{chunk-FNHS672G.js → chunk-5ADYFF2U.js} +3367 -2383
- package/chunks/{chunk-NXXFMBAV.js → chunk-AMLNR7IO.js} +1 -1
- package/chunks/{chunk-3MHUE4DM.js → chunk-DCFP5ZHZ.js} +6 -6
- package/chunks/{chunk-X4N2MWNJ.js → chunk-G3BYCHZS.js} +1 -1
- package/chunks/{chunk-3FETZOUF.js → chunk-I2T4QMR7.js} +3 -3
- package/chunks/{chunk-FPCUX6KP.js → chunk-I5CQQ3J6.js} +1 -1
- package/chunks/{chunk-VUXFNHQE.js → chunk-I7MLO7YD.js} +1 -1
- package/chunks/{chunk-CRTW4JM6.js → chunk-IO46JRII.js} +1 -1
- package/chunks/chunk-KGAIRLNO.js +3 -0
- package/chunks/chunk-L43V3NKW.js +2 -0
- package/chunks/chunk-NJVLEZ3I.js +2 -0
- package/chunks/{chunk-YPMJNO4T.js → chunk-OHWTK4KK.js} +1 -1
- package/chunks/{chunk-2LP3AAE5.js → chunk-QJ2FEPC2.js} +4 -4
- package/chunks/{chunk-UQ2YIDWV.js → chunk-QXUSWEWV.js} +1 -1
- package/chunks/{application-ZJ5NM3DF.js → chunk-SLFKHVQC.js} +1 -1
- package/chunks/chunk-VAVHH4XP.js +16 -0
- package/chunks/chunk-X3PES5WL.js +193 -0
- package/chunks/chunk-X7FQ5SBJ.js +40 -0
- package/chunks/{chunk-S6GSNWAM.js → chunk-ZPSMBMGA.js} +119 -119
- package/chunks/clipboard-image-SRYRNKLQ.js +2 -0
- package/chunks/{data-dir-AVW455BT.js → data-dir-C6MQE6W2.js} +1 -1
- package/chunks/dist-K652HFOW.js +2 -0
- package/chunks/{google-W4KKPJIU.js → google-ZWZWHJZZ.js} +1 -1
- package/chunks/{google-vertex-K2VBU5YX.js → google-vertex-C3BYAM6A.js} +1 -1
- package/chunks/{install-source-REWTEDE3.js → install-source-FIUDUO7G.js} +1 -1
- package/chunks/launcher-AVQRYDKB.js +275 -0
- package/chunks/{lifecycle-7W6GXLEL.js → lifecycle-VXPE5MII.js} +1 -1
- package/chunks/main-JXKRTY5N.js +11 -0
- package/chunks/{plugin-command-QSDS4V7E.js → plugin-command-ZZLA7IRM.js} +1 -1
- package/chunks/{provider-command-ZE4ODVR3.js → provider-command-PVOKX3IV.js} +1 -1
- package/chunks/{run-acp-command-LM4IFM5B.js → run-acp-command-MV4O4NBX.js} +32 -32
- package/chunks/run-app-server-command-DEX4FRZJ.js +24 -0
- package/chunks/{run-exec-command-B7H55F5B.js → run-exec-command-EJMP5IF3.js} +1 -1
- package/chunks/{tools-L7RFN554.js → tools-VTXR5JSH.js} +1 -1
- package/chunks/{update-HOQ5YQFF.js → update-4XVOPCYB.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
- package/chunks/chunk-5JU6ZMXS.js +0 -23
- package/chunks/chunk-G7FSWJID.js +0 -193
- package/chunks/chunk-LQIEYG3O.js +0 -39
- package/chunks/chunk-MESLFKP6.js +0 -3
- package/chunks/chunk-NICEDCLM.js +0 -2
- package/chunks/chunk-NP5G53PV.js +0 -16
- package/chunks/chunk-RDUENEEQ.js +0 -2
- package/chunks/dist-B52TV5OC.js +0 -2
- package/chunks/launcher-BADSPVA5.js +0 -274
- package/chunks/main-LWOWUP76.js +0 -9
|
@@ -0,0 +1,193 @@
|
|
|
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
|
+
import{n as Pr}from"./chunk-I2T4QMR7.js";import{a as ue,c as S,e as Rr}from"./chunk-D76SO2ME.js";var tc=S((qw,ec)=>{var Ne=ue("constants"),Ly=process.cwd,Qn=null,Ny=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Qn||(Qn=Ly.call(process)),Qn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Xr=process.chdir,process.chdir=function(e){Qn=null,Xr.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Xr));var Xr;ec.exports=Ry;function Ry(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(){}),Ny==="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 rc=S(($w,ic)=>{var nc=ue("stream").Stream;ic.exports=Py;function Py(e){return{ReadStream:t,WriteStream:n};function t(i,r){if(!(this instanceof t))return new t(i,r);nc.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);nc.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 sc=S((jw,oc)=>{"use strict";oc.exports=Fy;var Dy=Object.getPrototypeOf||function(e){return e.__proto__};function Fy(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Dy(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}});var eo=S((Uw,Zr)=>{var F=ue("fs"),By=tc(),qy=rc(),$y=sc(),zn=ue("util"),Z,ei;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Z=Symbol.for("graceful-fs.queue"),ei=Symbol.for("graceful-fs.previous")):(Z="___graceful-fs.queue",ei="___graceful-fs.previous");function jy(){}function cc(e,t){Object.defineProperty(e,Z,{get:function(){return t}})}var et=jy;zn.debuglog?et=zn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(et=function(){var e=zn.format.apply(zn,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
3
|
+
GFS4: `),console.error(e)});F[Z]||(ac=global[Z]||[],cc(F,ac),F.close=(function(e){function t(n,i){return e.call(F,n,function(r){r||lc(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,ei,{value:e}),t})(F.close),F.closeSync=(function(e){function t(n){e.apply(F,arguments),lc()}return Object.defineProperty(t,ei,{value:e}),t})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){et(F[Z]),ue("assert").equal(F[Z].length,0)}));var ac;global[Z]||cc(global,F[Z]);Zr.exports=Qr($y(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Zr.exports=Qr(F),F.__patched=!0);function Qr(e){By(e),e.gracefulify=Qr,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($,J,D,q){return t($,J,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?At([T,[$,J,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 $(J,D,q,N,Q){return i(J,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?At([$,[J,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 $(J,D,q,N,Q){return o(J,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?At([$,[J,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 $(J,D,q,N,Q){return a(J,D,q,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?At([$,[J,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 $(J,D,q,N){return function(Q,R){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?At([T,[J,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=qy(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 $(J,D,q,N,Q){return M(J,D,q,function(R,Lw){R&&(R.code==="EMFILE"||R.code==="ENFILE")?At([$,[J,D,q,N],R,Q||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}return e}function At(e){et("ENQUEUE",e[0].name,e[1]),F[Z].push(e),zr()}var Zn;function lc(){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);zr()}function zr(){if(clearTimeout(Zn),Zn=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)et("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){et("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?(et("RETRY",t.name,n),t.apply(null,n.concat([r]))):F[Z].push(e)}Zn===void 0&&(Zn=setTimeout(zr,0))}}});var fc=S((Kw,uc)=>{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))}uc.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 dc=S(tt=>{var Uy=fc();tt.operation=function(e){var t=tt.timeouts(e);return new Uy(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};tt.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};tt.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};tt.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=tt.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 mc=S((Yw,pc)=>{pc.exports=dc()});var hc=S((Gw,ti)=>{ti.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ti.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ti.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var vc=S((Ww,Et)=>{var P=global.process,nt=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"};nt(P)?(yc=ue("assert"),_t=hc(),gc=/^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),Et.exports=function(e,t){if(!nt(global.process))return function(){};yc.equal(typeof e,"function","a callback must be provided for exit handler"),wt===!1&&to();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&&ni()};return X.on(n,e),i},ni=function(){!wt||!nt(global.process)||(wt=!1,_t.forEach(function(t){try{P.removeListener(t,ii[t])}catch{}}),P.emit=ri,P.reallyExit=no,X.count-=1)},Et.exports.unload=ni,it=function(t,n,i){X.emitted[t]||(X.emitted[t]=!0,X.emit(t,n,i))},ii={},_t.forEach(function(e){ii[e]=function(){if(nt(global.process)){var n=P.listeners(e);n.length===X.count&&(ni(),it("exit",null,e),it("afterexit",null,e),gc&&e==="SIGHUP"&&(e="SIGINT"),P.kill(P.pid,e))}}}),Et.exports.signals=function(){return _t},wt=!1,to=function(){wt||!nt(global.process)||(wt=!0,X.count+=1,_t=_t.filter(function(t){try{return P.on(t,ii[t]),!0}catch{return!1}}),P.emit=Sc,P.reallyExit=bc)},Et.exports.load=to,no=P.reallyExit,bc=function(t){nt(global.process)&&(P.exitCode=t||0,it("exit",P.exitCode,null),it("afterexit",P.exitCode,null),no.call(P,P.exitCode))},ri=P.emit,Sc=function(t,n){if(t==="exit"&&nt(global.process)){n!==void 0&&(P.exitCode=n);var i=ri.apply(this,arguments);return it("exit",P.exitCode,null),it("afterexit",P.exitCode,null),i}else return ri.apply(this,arguments)}):Et.exports=function(){return function(){}};var yc,_t,gc,Zt,X,ni,it,ii,wt,to,no,bc,ri,Sc});var _c=S((Hw,io)=>{"use strict";var Ac=Symbol();function Ky(e,t,n){let i=t[Ac];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,Ac,{value:l}),n(null,a.mtime,l)})})}function Vy(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}io.exports.probe=Ky;io.exports.getMtime=Vy});var Cc=S((Jw,tn)=>{"use strict";var Yy=ue("path"),so=eo(),Gy=mc(),Wy=vc(),wc=_c(),xe={};function en(e,t){return t.lockfilePath||`${e}.lock`}function ao(e,t,n){if(!t.realpath)return n(null,Yy.resolve(e));t.fs.realpath(e,n)}function oo(e,t,n){let i=en(e,t);t.fs.mkdir(i,r=>{if(!r)return wc.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"?oo(e,{...t,stale:0},n):n(o);if(!Ec(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));xc(e,t,a=>{if(a)return n(a);oo(e,{...t,stale:0},n)})})})}function Ec(e,t){return e.mtime.getTime()<Date.now()-t.stale}function xc(e,t,n){t.fs.rmdir(en(e,t),i=>{if(i&&i.code!=="ENOENT")return n(i);n()})}function oi(e,t){let n=xe[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?ro(e,n,Object.assign(i,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,oi(e,t));if(!(n.mtime.getTime()===r.mtime.getTime()))return ro(e,n,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=wc.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?ro(e,n,Object.assign(l,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,oi(e,t));n.mtime=a,n.lastUpdate=Date.now(),n.updateDelay=null,oi(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function ro(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),xe[e]===t&&delete xe[e],t.options.onCompromised(n)}function Hy(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:so,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),ao(e,t,(i,r)=>{if(i)return n(i);let o=Gy.operation(t.retries);o.attempt(()=>{oo(r,t,(s,a,l)=>{if(o.retry(s))return;if(s)return n(o.mainError());let c=xe[r]={lockfilePath:en(r,t),mtime:a,mtimePrecision:l,options:t,lastUpdate:Date.now()};oi(r,t),n(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));kc(r,{...t,realpath:!1},u)})})})})}function kc(e,t,n){t={fs:so,realpath:!0,...t},ao(e,t,(i,r)=>{if(i)return n(i);let o=xe[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 xe[r],xc(r,t,n)})}function Jy(e,t,n){t={stale:1e4,realpath:!0,fs:so,...t},t.stale=Math.max(t.stale||0,2e3),ao(e,t,(i,r)=>{if(i)return n(i);t.fs.stat(en(r,t),(o,s)=>o?o.code==="ENOENT"?n(null,!1):n(o):n(null,!Ec(s,t)))})}function Xy(){return xe}Wy(()=>{for(let e in xe){let t=xe[e].options;try{t.fs.rmdirSync(en(e,t))}catch{}}});tn.exports.lock=Hy;tn.exports.unlock=kc;tn.exports.check=Jy;tn.exports.getLocks=Xy});var Tc=S((Xw,Oc)=>{"use strict";var Qy=eo();function zy(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 Zy(e){return(...t)=>new Promise((n,i)=>{t.push((r,o)=>{r?i(r):n(o)}),e(...t)})}function eg(e){return(...t)=>{let n,i;if(t.push((r,o)=>{n=r,i=o}),e(...t),n)throw n;return i}}function tg(e){if(e={...e},e.fs=zy(e.fs||Qy),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}Oc.exports={toPromise:Zy,toSync:eg,toSyncOptions:tg}});var co=S((Qw,Re)=>{"use strict";var xt=Cc(),{toPromise:si,toSync:ai,toSyncOptions:lo}=Tc();async function Ic(e,t){let n=await si(xt.lock)(e,t);return si(n)}function ng(e,t){let n=ai(xt.lock)(e,lo(t));return ai(n)}function ig(e,t){return si(xt.unlock)(e,t)}function rg(e,t){return ai(xt.unlock)(e,lo(t))}function og(e,t){return si(xt.check)(e,t)}function sg(e,t){return ai(xt.check)(e,lo(t))}Re.exports=Ic;Re.exports.lock=Ic;Re.exports.unlock=ig;Re.exports.lockSync=ng;Re.exports.unlockSync=rg;Re.exports.check=og;Re.exports.checkSync=sg});var I=S(ee=>{"use strict";var po=Symbol.for("yaml.alias"),Dc=Symbol.for("yaml.document"),li=Symbol.for("yaml.map"),Fc=Symbol.for("yaml.pair"),mo=Symbol.for("yaml.scalar"),ci=Symbol.for("yaml.seq"),ke=Symbol.for("yaml.node.type"),ug=e=>!!e&&typeof e=="object"&&e[ke]===po,fg=e=>!!e&&typeof e=="object"&&e[ke]===Dc,dg=e=>!!e&&typeof e=="object"&&e[ke]===li,pg=e=>!!e&&typeof e=="object"&&e[ke]===Fc,Bc=e=>!!e&&typeof e=="object"&&e[ke]===mo,mg=e=>!!e&&typeof e=="object"&&e[ke]===ci;function qc(e){if(e&&typeof e=="object")switch(e[ke]){case li:case ci:return!0}return!1}function hg(e){if(e&&typeof e=="object")switch(e[ke]){case po:case li:case mo:case ci:return!0}return!1}var yg=e=>(Bc(e)||qc(e))&&!!e.anchor;ee.ALIAS=po;ee.DOC=Dc;ee.MAP=li;ee.NODE_TYPE=ke;ee.PAIR=Fc;ee.SCALAR=mo;ee.SEQ=ci;ee.hasAnchor=yg;ee.isAlias=ug;ee.isCollection=qc;ee.isDocument=fg;ee.isMap=dg;ee.isNode=hg;ee.isPair=pg;ee.isScalar=Bc;ee.isSeq=mg});var rn=S(ho=>{"use strict";var G=I(),ae=Symbol("break visit"),$c=Symbol("skip children"),ve=Symbol("remove node");function ui(e,t){let n=jc(t);G.isDocument(e)?Ct(null,e.contents,n,Object.freeze([e]))===ve&&(e.contents=null):Ct(null,e,n,Object.freeze([]))}ui.BREAK=ae;ui.SKIP=$c;ui.REMOVE=ve;function Ct(e,t,n,i){let r=Uc(e,t,n,i);if(G.isNode(r)||G.isPair(r))return Kc(e,i,r),Ct(e,r,n,i);if(typeof r!="symbol"){if(G.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=Ct(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===ve&&(t.items.splice(o,1),o-=1)}}}else if(G.isPair(t)){i=Object.freeze(i.concat(t));let o=Ct("key",t.key,n,i);if(o===ae)return ae;o===ve&&(t.key=null);let s=Ct("value",t.value,n,i);if(s===ae)return ae;s===ve&&(t.value=null)}}return r}async function fi(e,t){let n=jc(t);G.isDocument(e)?await Ot(null,e.contents,n,Object.freeze([e]))===ve&&(e.contents=null):await Ot(null,e,n,Object.freeze([]))}fi.BREAK=ae;fi.SKIP=$c;fi.REMOVE=ve;async function Ot(e,t,n,i){let r=await Uc(e,t,n,i);if(G.isNode(r)||G.isPair(r))return Kc(e,i,r),Ot(e,r,n,i);if(typeof r!="symbol"){if(G.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=await Ot(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===ve&&(t.items.splice(o,1),o-=1)}}}else if(G.isPair(t)){i=Object.freeze(i.concat(t));let o=await Ot("key",t.key,n,i);if(o===ae)return ae;o===ve&&(t.key=null);let s=await Ot("value",t.value,n,i);if(s===ae)return ae;s===ve&&(t.value=null)}}return r}function jc(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 Uc(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(G.isMap(t))return n.Map?.(e,t,i);if(G.isSeq(t))return n.Seq?.(e,t,i);if(G.isPair(t))return n.Pair?.(e,t,i);if(G.isScalar(t))return n.Scalar?.(e,t,i);if(G.isAlias(t))return n.Alias?.(e,t,i)}function Kc(e,t,n){let i=t[t.length-1];if(G.isCollection(i))i.items[e]=n;else if(G.isPair(i))e==="key"?i.key=n:i.value=n;else if(G.isDocument(i))i.contents=n;else{let r=G.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}ho.visit=ui;ho.visitAsync=fi});var yo=S(Yc=>{"use strict";var Vc=I(),gg=rn(),bg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Sg=e=>e.replace(/[!,[\]{}]/g,t=>bg[t]),on=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+Sg(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&&Vc.isNode(t.contents)){let o={};gg.visit(t.contents,(s,a)=>{Vc.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
|
+
`)}};on.defaultYaml={explicit:!1,version:"1.2"};on.defaultTags={"!!":"tag:yaml.org,2002:"};Yc.Directives=on});var di=S(sn=>{"use strict";var Gc=I(),vg=rn();function Ag(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 Wc(e){let t=new Set;return vg.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function Hc(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function _g(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=Wc(e));let s=Hc(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(Gc.isScalar(s.node)||Gc.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}}sn.anchorIsValid=Ag;sn.anchorNames=Wc;sn.createNodeAnchors=_g;sn.findNewAnchor=Hc});var go=S(Jc=>{"use strict";function an(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=an(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=an(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=an(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=an(e,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return e.call(t,n,i)}Jc.applyReviver=an});var De=S(Qc=>{"use strict";var wg=I();function Xc(e,t,n){if(Array.isArray(e))return e.map((i,r)=>Xc(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!wg.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}Qc.toJS=Xc});var pi=S(Zc=>{"use strict";var Eg=go(),zc=I(),xg=De(),bo=class{constructor(t){Object.defineProperty(this,zc.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(!zc.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=xg.toJS(this,"",s);if(typeof r=="function")for(let{count:l,res:c}of s.anchors.values())r(c,l);return typeof o=="function"?Eg.applyReviver(o,{"":a},"",a):a}};Zc.NodeBase=bo});var ln=S(eu=>{"use strict";var kg=di(),Cg=rn(),Tt=I(),Og=pi(),Tg=De(),So=class extends Og.NodeBase{constructor(t){super(Tt.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=[],Cg.visit(t,{Node:(o,s)=>{(Tt.isAlias(s)||Tt.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||(Tg.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=mi(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(kg.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 mi(e,t,n){if(Tt.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Tt.isCollection(t)){let i=0;for(let r of t.items){let o=mi(e,r,n);o>i&&(i=o)}return i}else if(Tt.isPair(t)){let i=mi(e,t.key,n),r=mi(e,t.value,n);return Math.max(i,r)}return 1}eu.Alias=So});var K=S(vo=>{"use strict";var Ig=I(),Mg=pi(),Lg=De(),Ng=e=>!e||typeof e!="function"&&typeof e!="object",Fe=class extends Mg.NodeBase{constructor(t){super(Ig.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Lg.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";vo.Scalar=Fe;vo.isScalarValue=Ng});var cn=S(nu=>{"use strict";var Rg=ln(),st=I(),tu=K(),Pg="tag:yaml.org,2002:";function Dg(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 Fg(e,t,n){if(st.isDocument(e)&&(e=e.contents),st.isNode(e))return e;if(st.isPair(e)){let f=n.schema[st.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 Rg.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Pg+t.slice(2));let c=Dg(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let f=new tu.Scalar(e);return l&&(l.node=f),f}c=e instanceof Map?s[st.MAP]:Symbol.iterator in Object(e)?s[st.SEQ]:s[st.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 tu.Scalar(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}nu.createNode=Fg});var yi=S(hi=>{"use strict";var Bg=cn(),Ae=I(),qg=pi();function Ao(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 Bg.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 iu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,_o=class extends qg.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=>Ae.isNode(i)||Ae.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(iu(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(Ae.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,Ao(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(Ae.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&&Ae.isScalar(o)?o.value:o:Ae.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ae.isPair(n))return!1;let i=n.value;return i==null||t&&Ae.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 Ae.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(Ae.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,Ao(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};hi.Collection=_o;hi.collectionFromPath=Ao;hi.isEmptyPath=iu});var un=S(gi=>{"use strict";var $g=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function wo(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var jg=(e,t,n)=>e.endsWith(`
|
|
5
|
+
`)?wo(n,t):n.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+wo(n,t):(e.endsWith(" ")?"":" ")+n;gi.indentComment=wo;gi.lineComment=jg;gi.stringifyComment=$g});var ou=S(fn=>{"use strict";var Ug="flow",Eo="block",bi="quoted";function Kg(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;r<o&&(o=0);let l=Math.max(1+o,1+r-t.length);if(e.length<=l)return e;let c=[],u={},f=r-t.length;typeof i=="number"&&(i>r-Math.max(2,o)?c.push(0):f=r-i);let d,p,h=!1,m=-1,y=-1,g=-1;n===Eo&&(m=ru(e,m,t.length),m!==-1&&(f=m+l));for(let v;v=e[m+=1];){if(n===bi&&v==="\\"){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if(v===`
|
|
8
|
+
`)n===Eo&&(m=ru(e,m,t.length)),f=m+t.length+l,d=void 0;else{if(v===" "&&p&&p!==" "&&p!==`
|
|
9
|
+
`&&p!==" "){let x=e[m+1];x&&x!==" "&&x!==`
|
|
10
|
+
`&&x!==" "&&(d=m)}if(m>=f)if(d)c.push(d),f=d+l,d=void 0;else if(n===bi){for(;p===" "||p===" ";)p=v,v=e[m+=1],h=!0;let x=m>g+1?m-2:y-1;if(u[x])return e;c.push(x),u[x]=!0,f=x+l,d=void 0}else h=!0}p=v}if(h&&a&&a(),c.length===0)return e;s&&s();let b=e.slice(0,c[0]);for(let v=0;v<c.length;++v){let x=c[v],k=c[v+1]||e.length;x===0?b=`
|
|
11
|
+
${t}${e.slice(0,k)}`:(n===bi&&u[x]&&(b+=`${e[x]}\\`),b+=`
|
|
12
|
+
${t}${e.slice(x+1,k)}`)}return b}function ru(e,t,n){let i=t,r=t+1,o=e[r];for(;o===" "||o===" ";)if(t<r+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
13
|
+
`);i=t,r=t+1,o=e[r]}return i}fn.FOLD_BLOCK=Eo;fn.FOLD_FLOW=Ug;fn.FOLD_QUOTED=bi;fn.foldFlowLines=Kg});var pn=S(su=>{"use strict";var he=K(),Be=ou(),vi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ai=e=>/^(%|---|\.\.\.)/m.test(e);function Vg(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;o<r;++o)if(e[o]===`
|
|
14
|
+
`){if(o-s>i)return!0;if(s=o+1,r-s<=i)return!1}return!0}function dn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Ai(e)?" ":""),s="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(s+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{s+=n.slice(a,l);let u=n.substr(l+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||n[l+2]==='"'||n.length<r)l+=1;else{for(s+=n.slice(a,l)+`
|
|
15
|
+
|
|
16
|
+
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)s+=`
|
|
17
|
+
`,l+=2;s+=o,n[l+2]===" "&&(s+="\\"),l+=1,a=l+1}break;default:l+=1}return s=a?s+n.slice(a):n,i?s:Be.foldFlowLines(s,o,Be.FOLD_QUOTED,vi(t,!1))}function xo(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return dn(e,t);let n=t.indent||(Ai(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${n}`)+"'";return t.implicitKey?i:Be.foldFlowLines(i,n,Be.FOLD_FLOW,vi(t,!1))}function It(e,t){let{singleQuote:n}=t.options,i;if(n===!1)i=dn;else{let r=e.includes('"'),o=e.includes("'");r&&!o?i=xo:o&&!r?i=dn:i=n?xo:dn}return i(e,t)}var ko;try{ko=new RegExp(`(^|(?<!
|
|
20
|
+
))
|
|
21
|
+
+(?!
|
|
22
|
+
|$)`,"g")}catch{ko=/\n+(?!\n|$)/g}function Si({comment:e,type:t,value:n},i,r,o){let{blockQuote:s,commentString:a,lineWidth:l}=i.options;if(!s||/\n[\t ]+$/.test(n))return It(n,i);let c=i.indent||(i.forceBlockIndent||Ai(n)?" ":""),u=s==="literal"?!0:s==="folded"||t===he.Scalar.BLOCK_FOLDED?!1:t===he.Scalar.BLOCK_LITERAL?!0:!Vg(n,l,c.length);if(!n)return u?`|
|
|
23
|
+
`:`>
|
|
24
|
+
`;let f,d;for(d=n.length;d>0;--d){let k=n[d-1];if(k!==`
|
|
25
|
+
`&&k!==" "&&k!==" ")break}let p=n.substring(d),h=p.indexOf(`
|
|
26
|
+
`);h===-1?f="-":n===p||h!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
27
|
+
`&&(p=p.slice(0,-1)),p=p.replace(ko,`$&${c}`));let m=!1,y,g=-1;for(y=0;y<n.length;++y){let k=n[y];if(k===" ")m=!0;else if(k===`
|
|
28
|
+
`)g=y;else break}let b=n.substring(0,g<y?g+1:y);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${c}`));let x=(m?c?"2":"1":"")+f;if(e&&(x+=" "+a(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let k=n.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),C=!1,M=vi(i,!0);s!=="folded"&&t!==he.Scalar.BLOCK_FOLDED&&(M.onOverflow=()=>{C=!0});let _=Be.foldFlowLines(`${b}${k}${p}`,c,Be.FOLD_BLOCK,M);if(!C)return`>${x}
|
|
30
|
+
${c}${_}`}return n=n.replace(/\n+/g,`$&${c}`),`|${x}
|
|
31
|
+
${c}${b}${n}${p}`}function Yg(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&o.includes(`
|
|
32
|
+
`)||u&&/[[\]{},]/.test(o))return It(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
|
|
33
|
+
`)?It(o,t):Si(e,t,n,i);if(!a&&!u&&r!==he.Scalar.PLAIN&&o.includes(`
|
|
34
|
+
`))return Si(e,t,n,i);if(Ai(o)){if(l==="")return t.forceBlockIndent=!0,Si(e,t,n,i);if(a&&l===c)return It(o,t)}let f=o.replace(/\n+/g,`$&
|
|
35
|
+
${l}`);if(s){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:h}=t.doc.schema;if(h.some(d)||p?.some(d))return It(o,t)}return a?f:Be.foldFlowLines(f,l,Be.FOLD_FLOW,vi(t,!1))}function Gg(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==he.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=he.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case he.Scalar.BLOCK_FOLDED:case he.Scalar.BLOCK_LITERAL:return r||o?It(s.value,t):Si(s,t,n,i);case he.Scalar.QUOTE_DOUBLE:return dn(s.value,t);case he.Scalar.QUOTE_SINGLE:return xo(s.value,t);case he.Scalar.PLAIN:return Yg(s,t,n,i);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=t.options,d=r&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}su.stringifyString=Gg});var mn=S(Co=>{"use strict";var Wg=di(),qe=I(),Hg=un(),Jg=pn();function Xg(e,t){let n=Object.assign({blockQuote:!0,commentString:Hg.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Qg(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(qe.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function zg(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(qe.isScalar(e)||qe.isCollection(e))&&e.anchor;o&&Wg.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Zg(e,t,n,i){if(qe.isPair(e))return e.toString(t,n,i);if(qe.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=qe.isNode(e)?e:t.doc.createNode(e,{onTagObj:l=>r=l});r??(r=Qg(t.doc.schema.tags,o));let s=zg(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):qe.isScalar(o)?Jg.stringifyString(o,t,n,i):o.toString(t,n,i);return s?qe.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
36
|
+
${t.indent}${a}`:a}Co.createStringifyContext=Xg;Co.stringify=Zg});var uu=S(cu=>{"use strict";var Ce=I(),au=K(),lu=mn(),hn=un();function eb({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,d=Ce.isNode(e)&&e.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(Ce.isCollection(e)||!Ce.isNode(e)&&typeof e=="object"){let M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let p=!f&&(!e||d&&t==null&&!n.inFlow||Ce.isCollection(e)||(Ce.isScalar(e)?e.type===au.Scalar.BLOCK_FOLDED||e.type===au.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+l});let h=!1,m=!1,y=lu.stringify(e,n,()=>h=!0,()=>m=!0);if(!p&&!n.inFlow&&y.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||t==null)return h&&i&&i(),y===""?"?":p?`? ${y}`:y}else if(o&&!f||t==null&&p)return y=`? ${y}`,d&&!h?y+=hn.lineComment(y,n.indent,c(d)):m&&r&&r(),y;h&&(d=null),p?(d&&(y+=hn.lineComment(y,n.indent,c(d))),y=`? ${y}
|
|
37
|
+
${a}:`):(y=`${y}:`,d&&(y+=hn.lineComment(y,n.indent,c(d))));let g,b,v;Ce.isNode(t)?(g=!!t.spaceBefore,b=t.commentBefore,v=t.comment):(g=!1,b=null,v=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!p&&!d&&Ce.isScalar(t)&&(n.indentAtStart=y.length+1),m=!1,!u&&l.length>=2&&!n.inFlow&&!p&&Ce.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let x=!1,k=lu.stringify(t,n,()=>x=!0,()=>m=!0),C=" ";if(d||g||b){if(C=g?`
|
|
38
|
+
`:"",b){let M=c(b);C+=`
|
|
39
|
+
${hn.indentComment(M,n.indent)}`}k===""&&!n.inFlow?C===`
|
|
40
|
+
`&&v&&(C=`
|
|
41
|
+
|
|
42
|
+
`):C+=`
|
|
43
|
+
${n.indent}`}else if(!p&&Ce.isCollection(t)){let M=k[0],_=k.indexOf(`
|
|
44
|
+
`),A=_!==-1,O=n.inFlow??t.flow??t.items.length===0;if(A||!O){let E=!1;if(A&&(M==="&"||M==="!")){let T=k.indexOf(" ");M==="&"&&T!==-1&&T<_&&k[T+1]==="!"&&(T=k.indexOf(" ",T+1)),(T===-1||_<T)&&(E=!0)}E||(C=`
|
|
45
|
+
${n.indent}`)}}else(k===""||k[0]===`
|
|
46
|
+
`)&&(C="");return y+=C+k,n.inFlow?x&&i&&i():v&&!x?y+=hn.lineComment(y,n.indent,c(v)):m&&r&&r(),y}cu.stringifyPair=eb});var To=S(Oo=>{"use strict";var fu=ue("process");function tb(e,...t){e==="debug"&&console.log(...t)}function nb(e,t){(e==="debug"||e==="warn")&&(typeof fu.emitWarning=="function"?fu.emitWarning(t):console.warn(t))}Oo.debug=tb;Oo.warn=nb});var ki=S(xi=>{"use strict";var Ei=I(),du=K(),_i="<<",wi={identify:e=>e===_i||typeof e=="symbol"&&e.description===_i,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new du.Scalar(Symbol(_i)),{addToJSMap:pu}),stringify:()=>_i},ib=(e,t)=>(wi.identify(t)||Ei.isScalar(t)&&(!t.type||t.type===du.Scalar.PLAIN)&&wi.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===wi.tag&&n.default);function pu(e,t,n){let i=mu(e,n);if(Ei.isSeq(i))for(let r of i.items)Io(e,t,r);else if(Array.isArray(i))for(let r of i)Io(e,t,r);else Io(e,t,i)}function Io(e,t,n){let i=mu(e,n);if(!Ei.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function mu(e,t){return e&&Ei.isAlias(t)?t.resolve(e.doc,e):t}xi.addMergeToJSMap=pu;xi.isMergeKey=ib;xi.merge=wi});var Lo=S(gu=>{"use strict";var rb=To(),hu=ki(),ob=mn(),yu=I(),Mo=De();function sb(e,t,{key:n,value:i}){if(yu.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(hu.isMergeKey(e,n))hu.addMergeToJSMap(e,t,i);else{let r=Mo.toJS(n,"",e);if(t instanceof Map)t.set(r,Mo.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=ab(n,r,e),s=Mo.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function ab(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(yu.isNode(e)&&n?.doc){let i=ob.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),rb.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}gu.addPairToJSMap=sb});var $e=S(No=>{"use strict";var bu=cn(),lb=uu(),cb=Lo(),Ci=I();function ub(e,t,n){let i=bu.createNode(e,void 0,n),r=bu.createNode(t,void 0,n);return new Oi(i,r)}var Oi=class e{constructor(t,n=null){Object.defineProperty(this,Ci.NODE_TYPE,{value:Ci.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ci.isNode(n)&&(n=n.clone(t)),Ci.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return cb.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?lb.stringifyPair(this,t,n,i):JSON.stringify(this)}};No.Pair=Oi;No.createPair=ub});var Ro=S(vu=>{"use strict";var at=I(),Su=mn(),Ti=un();function fb(e,t,n){return(t.inFlow??e.flow?pb:db)(e,t,n)}function db({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:o,type:null}),f=!1,d=[];for(let h=0;h<t.length;++h){let m=t[h],y=null;if(at.isNode(m))!f&&m.spaceBefore&&d.push(""),Ii(n,d,m.commentBefore,f),m.comment&&(y=m.comment);else if(at.isPair(m)){let b=at.isNode(m.key)?m.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Ii(n,d,b.commentBefore,f))}f=!1;let g=Su.stringify(m,u,()=>y=null,()=>f=!0);y&&(g+=Ti.lineComment(g,o,c(y))),f&&y&&(f=!1),d.push(i+g)}let p;if(d.length===0)p=r.start+r.end;else{p=d[0];for(let h=1;h<d.length;++h){let m=d[h];p+=m?`
|
|
47
|
+
${l}${m}`:`
|
|
48
|
+
`}}return e?(p+=`
|
|
49
|
+
`+Ti.indentComment(c(e),l),a&&a()):f&&s&&s(),p}function pb({items:e},t,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;i+=o;let l=Object.assign({},t,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let h=0;h<e.length;++h){let m=e[h],y=null;if(at.isNode(m))m.spaceBefore&&f.push(""),Ii(t,f,m.commentBefore,!1),m.comment&&(y=m.comment);else if(at.isPair(m)){let b=at.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&f.push(""),Ii(t,f,b.commentBefore,!1),b.comment&&(c=!0));let v=at.isNode(m.value)?m.value:null;v?(v.comment&&(y=v.comment),v.commentBefore&&(c=!0)):m.value==null&&b?.comment&&(y=b.comment)}y&&(c=!0);let g=Su.stringify(m,l,()=>y=null);c||(c=f.length>u||g.includes(`
|
|
50
|
+
`)),h<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=f.reduce((b,v)=>b+v.length+2,2)+(g.length+2)>t.options.lineWidth)),c&&(g+=",")),y&&(g+=Ti.lineComment(g,i,a(y))),f.push(g),u=f.length}let{start:d,end:p}=n;if(f.length===0)return d+p;if(!c){let h=f.reduce((m,y)=>m+y.length+2,2);c=t.options.lineWidth>0&&h>t.options.lineWidth}if(c){let h=d;for(let m of f)h+=m?`
|
|
51
|
+
${o}${r}${m}`:`
|
|
52
|
+
`;return`${h}
|
|
53
|
+
${r}${p}`}else return`${d}${s}${f.join(" ")}${s}${p}`}function Ii({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=Ti.indentComment(t(i),e);n.push(o.trimStart())}}vu.stringifyCollection=fb});var Ue=S(Do=>{"use strict";var mb=Ro(),hb=Lo(),yb=yi(),je=I(),Mi=$e(),gb=K();function yn(e,t){let n=je.isScalar(t)?t.value:t;for(let i of e)if(je.isPair(i)&&(i.key===t||i.key===n||je.isScalar(i.key)&&i.key.value===n))return i}var Po=class extends yb.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(je.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(l,c)=>{if(typeof o=="function")c=o.call(n,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||r)&&s.items.push(Mi.createPair(l,c,i))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;je.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Mi.Pair(t,t?.value):i=new Mi.Pair(t.key,t.value);let r=yn(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);je.isScalar(r.value)&&gb.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=yn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=yn(this.items,t)?.value;return(!n&&je.isScalar(r)?r.value:r)??void 0}has(t){return!!yn(this.items,t)}set(t,n){this.add(new Mi.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)hb.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!je.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),mb.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};Do.YAMLMap=Po;Do.findPair=yn});var Mt=S(_u=>{"use strict";var bb=I(),Au=Ue(),Sb={collection:"map",default:!0,nodeClass:Au.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return bb.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Au.YAMLMap.from(e,t,n)};_u.map=Sb});var Ke=S(wu=>{"use strict";var vb=cn(),Ab=Ro(),_b=yi(),Ni=I(),wb=K(),Eb=De(),Fo=class extends _b.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ni.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Li(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=Li(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Ni.isScalar(r)?r.value:r}has(t){let n=Li(t);return typeof n=="number"&&n<this.items.length}set(t,n){let i=Li(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);let r=this.items[i];Ni.isScalar(r)&&wb.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(t,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(Eb.toJS(o,String(r++),n));return i}toString(t,n,i){return t?Ab.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(s++);a=r.call(n,l,a)}o.items.push(vb.createNode(a,void 0,i))}}return o}};function Li(e){let t=Ni.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}wu.YAMLSeq=Fo});var Lt=S(xu=>{"use strict";var xb=I(),Eu=Ke(),kb={collection:"seq",default:!0,nodeClass:Eu.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xb.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Eu.YAMLSeq.from(e,t,n)};xu.seq=kb});var gn=S(ku=>{"use strict";var Cb=pn(),Ob={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),Cb.stringifyString(e,t,n,i)}};ku.string=Ob});var Ri=S(Tu=>{"use strict";var Cu=K(),Ou={identify:e=>e==null,createNode:()=>new Cu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Cu.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Ou.test.test(e)?e:t.options.nullStr};Tu.nullTag=Ou});var Bo=S(Mu=>{"use strict";var Tb=K(),Iu={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Tb.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Iu.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};Mu.boolTag=Iu});var Nt=S(Lu=>{"use strict";function Ib({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Lu.stringifyNumber=Ib});var $o=S(Pi=>{"use strict";var Mb=K(),qo=Nt(),Lb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:qo.stringifyNumber},Nb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():qo.stringifyNumber(e)}},Rb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Mb.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:qo.stringifyNumber};Pi.float=Rb;Pi.floatExp=Nb;Pi.floatNaN=Lb});var Uo=S(Fi=>{"use strict";var Nu=Nt(),Di=e=>typeof e=="bigint"||Number.isInteger(e),jo=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Ru(e,t,n){let{value:i}=e;return Di(i)&&i>=0?n+i.toString(t):Nu.stringifyNumber(e)}var Pb={identify:e=>Di(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>jo(e,2,8,n),stringify:e=>Ru(e,8,"0o")},Db={identify:Di,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>jo(e,0,10,n),stringify:Nu.stringifyNumber},Fb={identify:e=>Di(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>jo(e,2,16,n),stringify:e=>Ru(e,16,"0x")};Fi.int=Db;Fi.intHex=Fb;Fi.intOct=Pb});var Du=S(Pu=>{"use strict";var Bb=Mt(),qb=Ri(),$b=Lt(),jb=gn(),Ub=Bo(),Ko=$o(),Vo=Uo(),Kb=[Bb.map,$b.seq,jb.string,qb.nullTag,Ub.boolTag,Vo.intOct,Vo.int,Vo.intHex,Ko.floatNaN,Ko.floatExp,Ko.float];Pu.schema=Kb});var qu=S(Bu=>{"use strict";var Vb=K(),Yb=Mt(),Gb=Lt();function Fu(e){return typeof e=="bigint"||Number.isInteger(e)}var Bi=({value:e})=>JSON.stringify(e),Wb=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Bi},{identify:e=>e==null,createNode:()=>new Vb.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Bi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Bi},{identify:Fu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Fu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Bi}],Hb={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Jb=[Yb.map,Gb.seq].concat(Wb,Hb);Bu.schema=Jb});var Go=S($u=>{"use strict";var bn=ue("buffer"),Yo=K(),Xb=pn(),Qb={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof bn.Buffer=="function")return bn.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,r,o){if(!n)return"";let s=n,a;if(typeof bn.Buffer=="function")a=s instanceof bn.Buffer?s.toString("base64"):bn.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Yo.Scalar.BLOCK_LITERAL),t!==Yo.Scalar.QUOTE_DOUBLE){let l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(t===Yo.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return Xb.stringifyString({comment:e,type:t,value:a},i,r,o)}};$u.binary=Qb});var ji=S($i=>{"use strict";var qi=I(),Wo=$e(),zb=K(),Zb=Ke();function ju(e,t){if(qi.isSeq(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!qi.isPair(i)){if(qi.isMap(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new Wo.Pair(new zb.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
55
|
+
${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment}
|
|
56
|
+
${o.comment}`:i.comment}i=r}e.items[n]=qi.isPair(i)?i:new Wo.Pair(i)}}else t("Expected a sequence for this tag");return e}function Uu(e,t,n){let{replacer:i}=n,r=new Zb.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;r.items.push(Wo.createPair(a,l,n))}return r}var e0={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ju,createNode:Uu};$i.createPairs=Uu;$i.pairs=e0;$i.resolvePairs=ju});var Xo=S(Jo=>{"use strict";var Ku=I(),Ho=De(),Sn=Ue(),t0=Ke(),Vu=ji(),lt=class e extends t0.YAMLSeq{constructor(){super(),this.add=Sn.YAMLMap.prototype.add.bind(this),this.delete=Sn.YAMLMap.prototype.delete.bind(this),this.get=Sn.YAMLMap.prototype.get.bind(this),this.has=Sn.YAMLMap.prototype.has.bind(this),this.set=Sn.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Ku.isPair(r)?(o=Ho.toJS(r.key,"",n),s=Ho.toJS(r.value,o,n)):o=Ho.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=Vu.createPairs(t,n,i),o=new this;return o.items=r.items,o}};lt.tag="tag:yaml.org,2002:omap";var n0={collection:"seq",identify:e=>e instanceof Map,nodeClass:lt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Vu.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Ku.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new lt,n)},createNode:(e,t,n)=>lt.from(e,t,n)};Jo.YAMLOMap=lt;Jo.omap=n0});var Ju=S(Qo=>{"use strict";var Yu=K();function Gu({value:e,source:t},n){return t&&(e?Wu:Hu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Wu={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Yu.Scalar(!0),stringify:Gu},Hu={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Yu.Scalar(!1),stringify:Gu};Qo.falseTag=Hu;Qo.trueTag=Wu});var Xu=S(Ui=>{"use strict";var i0=K(),zo=Nt(),r0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:zo.stringifyNumber},o0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():zo.stringifyNumber(e)}},s0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new i0.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:zo.stringifyNumber};Ui.float=s0;Ui.floatExp=o0;Ui.floatNaN=r0});var zu=S(An=>{"use strict";var Qu=Nt(),vn=e=>typeof e=="bigint"||Number.isInteger(e);function Ki(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function Zo(e,t,n){let{value:i}=e;if(vn(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Qu.stringifyNumber(e)}var a0={identify:vn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ki(e,2,2,n),stringify:e=>Zo(e,2,"0b")},l0={identify:vn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ki(e,1,8,n),stringify:e=>Zo(e,8,"0")},c0={identify:vn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ki(e,0,10,n),stringify:Qu.stringifyNumber},u0={identify:vn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ki(e,2,16,n),stringify:e=>Zo(e,16,"0x")};An.int=c0;An.intBin=a0;An.intHex=u0;An.intOct=l0});var ts=S(es=>{"use strict";var Gi=I(),Vi=$e(),Yi=Ue(),ct=class e extends Yi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Gi.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Vi.Pair(t.key,null):n=new Vi.Pair(t,null),Yi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=Yi.findPair(this.items,t);return!n&&Gi.isPair(i)?Gi.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=Yi.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Vi.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(Vi.createPair(s,null,i));return o}};ct.tag="tag:yaml.org,2002:set";var f0={collection:"map",identify:e=>e instanceof Set,nodeClass:ct,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ct.from(e,t,n),resolve(e,t){if(Gi.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new ct,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};es.YAMLSet=ct;es.set=f0});var is=S(Wi=>{"use strict";var d0=Nt();function ns(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function Zu(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return d0.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var p0={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ns(e,n),stringify:Zu},m0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ns(e,!1),stringify:Zu},ef={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(ef.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,o||0,s||0,a||0,l),u=t[8];if(u&&u!=="Z"){let f=ns(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Wi.floatTime=m0;Wi.intTime=p0;Wi.timestamp=ef});var rf=S(nf=>{"use strict";var h0=Mt(),y0=Ri(),g0=Lt(),b0=gn(),S0=Go(),tf=Ju(),rs=Xu(),Hi=zu(),v0=ki(),A0=Xo(),_0=ji(),w0=ts(),os=is(),E0=[h0.map,g0.seq,b0.string,y0.nullTag,tf.trueTag,tf.falseTag,Hi.intBin,Hi.intOct,Hi.int,Hi.intHex,rs.floatNaN,rs.floatExp,rs.float,S0.binary,v0.merge,A0.omap,_0.pairs,w0.set,os.intTime,os.floatTime,os.timestamp];nf.schema=E0});var mf=S(ls=>{"use strict";var lf=Mt(),x0=Ri(),cf=Lt(),k0=gn(),C0=Bo(),ss=$o(),as=Uo(),O0=Du(),T0=qu(),uf=Go(),_n=ki(),ff=Xo(),df=ji(),of=rf(),pf=ts(),Ji=is(),sf=new Map([["core",O0.schema],["failsafe",[lf.map,cf.seq,k0.string]],["json",T0.schema],["yaml11",of.schema],["yaml-1.1",of.schema]]),af={binary:uf.binary,bool:C0.boolTag,float:ss.float,floatExp:ss.floatExp,floatNaN:ss.floatNaN,floatTime:Ji.floatTime,int:as.int,intHex:as.intHex,intOct:as.intOct,intTime:Ji.intTime,map:lf.map,merge:_n.merge,null:x0.nullTag,omap:ff.omap,pairs:df.pairs,seq:cf.seq,set:pf.set,timestamp:Ji.timestamp},I0={"tag:yaml.org,2002:binary":uf.binary,"tag:yaml.org,2002:merge":_n.merge,"tag:yaml.org,2002:omap":ff.omap,"tag:yaml.org,2002:pairs":df.pairs,"tag:yaml.org,2002:set":pf.set,"tag:yaml.org,2002:timestamp":Ji.timestamp};function M0(e,t,n){let i=sf.get(t);if(i&&!e)return n&&!i.includes(_n.merge)?i.concat(_n.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(sf.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(_n.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?af[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(af).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}ls.coreKnownTags=I0;ls.getTags=M0});var fs=S(hf=>{"use strict";var cs=I(),L0=Mt(),N0=Lt(),R0=gn(),Xi=mf(),P0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,us=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Xi.getTags(t,"compat"):t?Xi.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Xi.coreKnownTags:{},this.tags=Xi.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,cs.MAP,{value:L0.map}),Object.defineProperty(this,cs.SCALAR,{value:R0.string}),Object.defineProperty(this,cs.SEQ,{value:N0.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?P0:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};hf.Schema=us});var gf=S(yf=>{"use strict";var D0=I(),ds=mn(),wn=un();function F0(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);l?(n.push(l),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=ds.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let l=o(e.commentBefore);n.unshift(wn.indentComment(l,""))}let s=!1,a=null;if(e.contents){if(D0.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(wn.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>s=!0,c=ds.stringify(e.contents,r,()=>a=null,l);a&&(c+=wn.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(ds.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let l=o(e.comment);l.includes(`
|
|
57
|
+
`)?(n.push("..."),n.push(wn.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=e.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(wn.indentComment(o(l),"")))}return n.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
`}yf.stringifyDocument=F0});var En=S(bf=>{"use strict";var B0=ln(),Rt=yi(),de=I(),q0=$e(),$0=De(),j0=fs(),U0=gf(),ps=di(),K0=go(),V0=cn(),ms=yo(),hs=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,de.NODE_TYPE,{value:de.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new ms.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[de.NODE_TYPE]:{value:de.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=de.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Pt(this.contents)&&this.contents.add(t)}addIn(t,n){Pt(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=ps.anchorNames(this);t.anchor=!n||i.has(n)?ps.findNewAnchor(n||"a",i):n}return new B0.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let y=b=>typeof b=="number"||b instanceof String||b instanceof Number,g=n.filter(y).map(String);g.length>0&&(n=n.concat(g)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=ps.createNodeAnchors(this,s||"a"),h={aliasDuplicateObjects:o??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p},m=V0.createNode(t,u,h);return a&&de.isCollection(m)&&(m.flow=!0),d(),m}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new q0.Pair(r,o)}delete(t){return Pt(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Rt.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Pt(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return de.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Rt.isEmptyPath(t)?!n&&de.isScalar(this.contents)?this.contents.value:this.contents:de.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return de.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Rt.isEmptyPath(t)?this.contents!==void 0:de.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Rt.collectionFromPath(this.schema,[t],n):Pt(this.contents)&&this.contents.set(t,n)}setIn(t,n){Rt.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Rt.collectionFromPath(this.schema,Array.from(t),n):Pt(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ms.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ms.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new j0.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=$0.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:c,res:u}of a.anchors.values())o(u,c);return typeof s=="function"?K0.applyReviver(s,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return U0.stringifyDocument(this,t)}};function Pt(e){if(de.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}bf.Document=hs});var Cn=S(kn=>{"use strict";var xn=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},ys=class extends xn{constructor(t,n,i){super("YAMLParseError",t,n,i)}},gs=class extends xn{constructor(t,n,i){super("YAMLWarning",t,n,i)}},Y0=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
60
|
+
`),s=a+s}if(/[^ ]/.test(s)){let a=1,l=n.linePos[1];l?.line===i&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-o)));let c=" ".repeat(o)+"^".repeat(a);n.message+=`:
|
|
61
|
+
|
|
62
|
+
${s}
|
|
63
|
+
${c}
|
|
64
|
+
`}};kn.YAMLError=xn;kn.YAMLParseError=ys;kn.YAMLWarning=gs;kn.prettifyError=Y0});var On=S(Sf=>{"use strict";function G0(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",p=!1,h=!1,m=null,y=null,g=null,b=null,v=null,x=null,k=null;for(let _ of e)switch(h&&(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&o(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),m&&(c&&_.type!=="comment"&&_.type!=="newline"&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),_.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&_.source.includes(" ")&&(m=_),u=!0;break;case"comment":{u||o(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=_.source.substring(1)||" ";f?f+=d+A:f=A,d="",c=!1;break}case"newline":c?f?f+=_.source:(!x||n!=="seq-item-ind")&&(l=!0):d+=_.source,c=!0,p=!0,(y||g)&&(b=_),u=!0;break;case"anchor":y&&o(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&o(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=_,k??(k=_.offset),c=!1,u=!1,h=!0;break;case"tag":{g&&o(_,"MULTIPLE_TAGS","A node can have at most one tag"),g=_,k??(k=_.offset),c=!1,u=!1,h=!0;break}case n:(y||g)&&o(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),x&&o(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${t??"collection"}`),x=_,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){v&&o(_,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=_,c=!1,u=!1;break}default:o(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),c=!1,u=!1}let C=e[e.length-1],M=C?C.offset+C.source.length:r;return h&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:x,spaceBefore:l,comment:f,hasNewline:p,anchor:y,tag:g,newlineAfterProp:b,end:M,start:k??M}}Sf.resolveProps=G0});var Qi=S(vf=>{"use strict";function bs(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
65
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(bs(t.key)||bs(t.value))return!0}return!1;default:return!0}}vf.containsNewline=bs});var Ss=S(Af=>{"use strict";var W0=Qi();function H0(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&W0.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Af.flowIndentCheck=H0});var vs=S(wf=>{"use strict";var _f=I();function J0(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||_f.isScalar(o)&&_f.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}wf.mapIncludes=J0});var Tf=S(Of=>{"use strict";var Ef=$e(),X0=Ue(),xf=On(),Q0=Qi(),kf=Ss(),z0=vs(),Cf="All mapping items must start at the same column";function Z0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??X0.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let l=i.offset,c=null;for(let u of i.items){let{start:f,key:d,sep:p,value:h}=u,m=xf.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!m.found;if(y){if(d&&(d.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(l,"BAD_INDENT",Cf)),!m.anchor&&!m.tag&&!p){c=m.end,m.comment&&(a.comment?a.comment+=`
|
|
66
|
+
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Q0.containsNewline(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==i.indent&&r(l,"BAD_INDENT",Cf);n.atKey=!0;let g=m.end,b=d?e(n,d,m,r):t(n,g,f,null,m,r);n.schema.compat&&kf.flowIndentCheck(i.indent,d,r),n.atKey=!1,z0.mapIncludes(n,a.items,b)&&r(g,"DUPLICATE_KEY","Map keys must be unique");let v=xf.resolveProps(p??[],{indicator:"map-value-ind",next:h,offset:b.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(l=v.end,v.found){y&&(h?.type==="block-map"&&!v.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<v.found.offset-1024&&r(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=h?e(n,h,v,r):t(n,l,p,null,v,r);n.schema.compat&&kf.flowIndentCheck(i.indent,h,r),l=x.range[2];let k=new Ef.Pair(b,x);n.options.keepSourceTokens&&(k.srcToken=u),a.items.push(k)}else{y&&r(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(b.comment?b.comment+=`
|
|
67
|
+
`+v.comment:b.comment=v.comment);let x=new Ef.Pair(b);n.options.keepSourceTokens&&(x.srcToken=u),a.items.push(x)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}Of.resolveBlockMap=Z0});var Mf=S(If=>{"use strict";var eS=Ke(),tS=On(),nS=Ss();function iS({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??eS.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=i.offset,c=null;for(let{start:u,value:f}of i.items){let d=tS.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(a.comment=d.comment);continue}let p=f?e(n,f,d,r):t(n,d.end,u,null,d,r);n.schema.compat&&nS.flowIndentCheck(i.indent,f,r),l=p.range[2],a.items.push(p)}return a.range=[i.offset,l,c??l],a}If.resolveBlockSeq=iS});var Dt=S(Lf=>{"use strict";function rS(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=l),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:r,offset:t}}Lf.resolveEnd=rS});var Df=S(Pf=>{"use strict";var oS=I(),sS=$e(),Nf=Ue(),aS=Ke(),lS=Dt(),Rf=On(),cS=Qi(),uS=vs(),As="Block collections are not allowed within flow collections",_s=e=>e&&(e.type==="block-map"||e.type==="block-seq");function fS({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?Nf.YAMLMap:aS.YAMLSeq),c=new l(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y<i.items.length;++y){let g=i.items[y],{start:b,key:v,sep:x,value:k}=g,C=Rf.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:v??x?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!k){y===0&&C.comma?r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<i.items.length-1&&r(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),C.comment&&(c.comment?c.comment+=`
|
|
68
|
+
`+C.comment:c.comment=C.comment),f=C.end;continue}!s&&n.options.strict&&cS.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)C.comma&&r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(C.comma||r(C.start,"MISSING_CHAR",`Missing , between ${a} items`),C.comment){let M="";e:for(let _ of b)switch(_.type){case"comma":case"space":break;case"comment":M=_.source.substring(1);break e;default:break e}if(M){let _=c.items[c.items.length-1];oS.isPair(_)&&(_=_.value??_.key),_.comment?_.comment+=`
|
|
69
|
+
`+M:_.comment=M,C.comment=C.comment.substring(M.length+1)}}if(!s&&!x&&!C.found){let M=k?e(n,k,C,r):t(n,C.end,x,null,C,r);c.items.push(M),f=M.range[2],_s(k)&&r(M.range,"BLOCK_IN_FLOW",As)}else{n.atKey=!0;let M=C.end,_=v?e(n,v,C,r):t(n,M,b,null,C,r);_s(v)&&r(_.range,"BLOCK_IN_FLOW",As),n.atKey=!1;let A=Rf.resolveProps(x??[],{flow:a,indicator:"map-value-ind",next:k,offset:_.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(A.found){if(!s&&!C.found&&n.options.strict){if(x)for(let T of x){if(T===A.found)break;if(T.type==="newline"){r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${a}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let O=k?e(n,k,A,r):A.found?t(n,A.end,x,null,A,r):null;O?_s(k)&&r(O.range,"BLOCK_IN_FLOW",As):A.comment&&(_.comment?_.comment+=`
|
|
70
|
+
`+A.comment:_.comment=A.comment);let E=new sS.Pair(_,O);if(n.options.keepSourceTokens&&(E.srcToken=g),s){let T=c;uS.mapIncludes(n,T.items,_)&&r(M,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(E)}else{let T=new Nf.YAMLMap(n.schema);T.flow=!0,T.items.push(E);let $=(O??_).range;T.range=[_.range[0],$[1],$[2]],c.items.push(T)}f=O?O.range[2]:A.end}}let d=s?"}":"]",[p,...h]=i.end,m=f;if(p?.source===d)m=p.offset+p.source.length;else{let y=a[0].toUpperCase()+a.substring(1),g=u?`${y} must end with a ${d}`:`${y} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",g),p&&p.source.length!==1&&h.unshift(p)}if(h.length>0){let y=lS.resolveEnd(h,m,n.options.strict,r);y.comment&&(c.comment?c.comment+=`
|
|
71
|
+
`+y.comment:c.comment=y.comment),c.range=[i.offset,m,y.offset]}else c.range=[i.offset,m,m];return c}Pf.resolveFlowCollection=fS});var Bf=S(Ff=>{"use strict";var dS=I(),pS=K(),mS=Ue(),hS=Ke(),yS=Tf(),gS=Mf(),bS=Df();function ws(e,t,n,i,r,o){let s=n.type==="block-map"?yS.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?gS.resolveBlockSeq(e,t,n,i,o):bS.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function SS(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,d=>r(o,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=i,h=d&&o?d.offset>o.offset?d:o:d??o;h&&(!p||p.offset<h.offset)&&r(h,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===mS.YAMLMap.tagName&&a==="map"||s===hS.YAMLSeq.tagName&&a==="seq")return ws(e,t,n,r,s);let l=t.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!l){let d=t.schema.knownTags[s];if(d?.collection===a)t.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?r(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),ws(e,t,n,r,s)}let c=ws(e,t,n,r,s,l),u=l.resolve?.(c,d=>r(o,"TAG_RESOLVE_FAILED",d),t.options)??c,f=dS.isNode(u)?u:new pS.Scalar(u);return f.range=c.range,f.tag=s,l?.format&&(f.format=l.format),f}Ff.composeCollection=SS});var xs=S(qf=>{"use strict";var Es=K();function vS(e,t,n){let i=t.offset,r=AS(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?Es.Scalar.BLOCK_FOLDED:Es.Scalar.BLOCK_LITERAL,s=t.source?_S(t.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let y=s[m][1];if(y===""||y==="\r")a=m;else break}if(a===0){let m=r.chomp==="+"&&s.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,s.length-1)):"",y=i+r.length;return t.source&&(y+=t.source.length),{value:m,type:o,comment:r.comment,range:[i,y,y]}}let l=t.indent+r.indent,c=t.offset+r.length,u=0;for(let m=0;m<a;++m){let[y,g]=s[m];if(g===""||g==="\r")r.indent===0&&y.length>l&&(l=y.length);else{y.length<l&&n(c+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=y.length),u=m,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=y.length+g.length+1}for(let m=s.length-1;m>=a;--m)s[m][0].length>l&&(a=m+1);let f="",d="",p=!1;for(let m=0;m<u;++m)f+=s[m][0].slice(l)+`
|
|
73
|
+
`;for(let m=u;m<a;++m){let[y,g]=s[m];c+=y.length+g.length+1;let b=g[g.length-1]==="\r";if(b&&(g=g.slice(0,-1)),g&&y.length<l){let x=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-g.length-(b?2:1),"BAD_INDENT",x),y=""}o===Es.Scalar.BLOCK_LITERAL?(f+=d+y.slice(l)+g,d=`
|
|
74
|
+
`):y.length>l||g[0]===" "?(d===" "?d=`
|
|
75
|
+
`:!p&&d===`
|
|
76
|
+
`&&(d=`
|
|
77
|
+
|
|
78
|
+
`),f+=d+y.slice(l)+g,d=`
|
|
79
|
+
`,p=!0):g===""?d===`
|
|
80
|
+
`?f+=`
|
|
81
|
+
`:d=`
|
|
82
|
+
`:(f+=d+g,d=" ",p=!1)}switch(r.chomp){case"-":break;case"+":for(let m=a;m<s.length;++m)f+=`
|
|
83
|
+
`+s[m][0].slice(l);f[f.length-1]!==`
|
|
84
|
+
`&&(f+=`
|
|
85
|
+
`);break;default:f+=`
|
|
86
|
+
`}let h=i+r.length+t.source.length;return{value:f,type:o,comment:r.comment,range:[i,h,h]}}function AS({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=t[0],o=r[0],s=0,a="",l=-1;for(let d=1;d<r.length;++d){let p=r[d];if(!a&&(p==="-"||p==="+"))a=p;else{let h=Number(p);!s&&h?s=h:l===-1&&(l=e+d)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let d=1;d<t.length;++d){let p=t[d];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":n&&!c&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":i(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let h=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",h);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function _S(e){let t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}qf.resolveBlockScalar=vS});var Cs=S(jf=>{"use strict";var ks=K(),wS=Dt();function ES(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,l,c=(d,p,h)=>n(i+d,p,h);switch(r){case"scalar":a=ks.Scalar.PLAIN,l=xS(o,c);break;case"single-quoted-scalar":a=ks.Scalar.QUOTE_SINGLE,l=kS(o,c);break;case"double-quoted-scalar":a=ks.Scalar.QUOTE_DOUBLE,l=CS(o,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,f=wS.resolveEnd(s,u,t,n);return{value:l,type:a,comment:f.comment,range:[i,u,f.offset]}}function xS(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),$f(e)}function kS(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),$f(e.slice(1,-1)).replace(/''/g,"'")}function $f(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
87
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
88
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let r=i[1],o=" ",s=t.lastIndex;for(n.lastIndex=s;i=n.exec(e);)i[1]===""?o===`
|
|
89
|
+
`?r+=o:o=`
|
|
90
|
+
`:(r+=o+i[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(e),r+o+(i?.[1]??"")}function CS(e,t){let n="";for(let i=1;i<e.length-1;++i){let r=e[i];if(!(r==="\r"&&e[i+1]===`
|
|
91
|
+
`))if(r===`
|
|
92
|
+
`){let{fold:o,offset:s}=OS(e,i);n+=o,i=s}else if(r==="\\"){let o=e[++i],s=TS[o];if(s)n+=s;else if(o===`
|
|
93
|
+
`)for(o=e[i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="\r"&&e[i+1]===`
|
|
94
|
+
`)for(o=e[++i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=IS(e,i+1,a,t),i+=a}else{let a=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let o=i,s=e[i+1];for(;s===" "||s===" ";)s=e[++i+1];s!==`
|
|
95
|
+
`&&!(s==="\r"&&e[i+2]===`
|
|
96
|
+
`)&&(n+=i>o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function OS(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
|
|
97
|
+
`||i==="\r")&&!(i==="\r"&&e[t+2]!==`
|
|
98
|
+
`);)i===`
|
|
99
|
+
`&&(n+=`
|
|
100
|
+
`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var TS={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
101
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function IS(e,t,n,i){let r=e.substr(t,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}jf.resolveFlowScalar=ES});var Vf=S(Kf=>{"use strict";var ut=I(),Uf=K(),MS=xs(),LS=Cs();function NS(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?MS.resolveBlockScalar(e,t,i):LS.resolveFlowScalar(t,e.options.strict,i),l=n?e.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;e.options.stringKeys&&e.atKey?c=e.schema[ut.SCALAR]:l?c=RS(e.schema,r,l,n,i):t.type==="scalar"?c=PS(e,r,t,i):c=e.schema[ut.SCALAR];let u;try{let f=c.resolve(r,d=>i(n??t,"TAG_RESOLVE_FAILED",d),e.options);u=ut.isScalar(f)?f:new Uf.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",d),u=new Uf.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),l&&(u.tag=l),c.format&&(u.format=c.format),s&&(u.comment=s),u}function RS(e,t,n,i,r){if(n==="!")return e[ut.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ut.SCALAR])}function PS({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[ut.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(i))??n[ut.SCALAR];if(s.tag!==a.tag){let l=t.tagString(s.tag),c=t.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}Kf.composeScalar=NS});var Gf=S(Yf=>{"use strict";function DS(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Yf.emptyScalarPosition=DS});var Jf=S(Ts=>{"use strict";var FS=ln(),BS=I(),qS=Bf(),Wf=Vf(),$S=Dt(),jS=Gf(),US={composeNode:Hf,composeEmptyNode:Os};function Hf(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=n,c,u=!0;switch(t.type){case"alias":c=KS(e,t,i),(a||l)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Wf.composeScalar(e,t,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=qS.composeCollection(US,e,t,n,i),a&&(c.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",d)}break;default:{let f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Os(e,t.offset,void 0,null,n,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!BS.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?c.comment=s:c.commentBefore=s),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}function Os(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:l},c){let u={type:"scalar",offset:jS.emptyScalarPosition(t,n,i),indent:-1,source:""},f=Wf.composeScalar(e,u,a,c);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=l),f}function KS({options:e},{offset:t,source:n,end:i},r){let o=new FS.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=$S.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}Ts.composeEmptyNode=Os;Ts.composeNode=Hf});var zf=S(Qf=>{"use strict";var VS=En(),Xf=Jf(),YS=Dt(),GS=On();function WS(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),l=new VS.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=GS.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Xf.composeNode(c,r,u,s):Xf.composeEmptyNode(c,u.end,i,null,u,s);let f=l.contents.range[2],d=YS.resolveEnd(o,f,!1,s);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}Qf.composeDoc=WS});var Ms=S(td=>{"use strict";var HS=ue("process"),JS=yo(),XS=En(),Tn=Cn(),Zf=I(),QS=zf(),zS=Dt();function In(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function ed(e){let t="",n=!1,i=!1;for(let r=0;r<e.length;++r){let o=e[r];switch(o[0]){case"#":t+=(t===""?"":i?`
|
|
102
|
+
|
|
103
|
+
`:`
|
|
104
|
+
`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}var Is=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=In(n);o?this.warnings.push(new Tn.YAMLWarning(s,i,r)):this.errors.push(new Tn.YAMLParseError(s,i,r))},this.directives=new JS.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=ed(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
105
|
+
${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if(Zf.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];Zf.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i}
|
|
106
|
+
${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i}
|
|
107
|
+
${s}`:i}}if(n){for(let o=0;o<this.errors.length;++o)t.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)t.warnings.push(this.warnings[o])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ed(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(let r of t)yield*this.next(r);yield*this.end(n,i)}*next(t){switch(HS.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,i,r)=>{let o=In(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=QS.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Tn.YAMLParseError(In(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Tn.YAMLParseError(In(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=zS.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
108
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Tn.YAMLParseError(In(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new XS.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};td.Composer=Is});var rd=S(zi=>{"use strict";var ZS=xs(),ev=Cs(),tv=Cn(),nd=pn();function nv(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new tv.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ev.resolveFlowScalar(e,t,i);case"block-scalar":return ZS.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function iv(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=nd.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
109
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
110
|
+
`),u=a.substring(0,c),f=a.substring(c+1)+`
|
|
111
|
+
`,d=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return id(d,l)||d.push({type:"newline",offset:-1,indent:i,source:`
|
|
112
|
+
`}),{type:"block-scalar",offset:o,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:l};default:return{type:"scalar",offset:o,indent:i,source:a,end:l}}}function rv(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=nd.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":ov(e,l);break;case'"':Ls(e,l,"double-quoted-scalar");break;case"'":Ls(e,l,"single-quoted-scalar");break;default:Ls(e,l,"scalar")}}function ov(e,t){let n=t.indexOf(`
|
|
113
|
+
`),i=t.substring(0,n),r=t.substring(n+1)+`
|
|
114
|
+
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];id(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
|
|
115
|
+
`});for(let l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:r})}}function id(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Ls(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
116
|
+
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}zi.createScalarToken=iv;zi.resolveAsScalar=nv;zi.setScalarValue=rv});var sd=S(od=>{"use strict";var sv=e=>"type"in e?er(e):Zi(e);function er(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=er(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Zi(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Zi(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Zi(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Zi({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=er(t)),n)for(let o of n)r+=o.source;return i&&(r+=er(i)),r}od.stringify=sv});var ud=S(cd=>{"use strict";var Ns=Symbol("break visit"),av=Symbol("skip children"),ad=Symbol("remove item");function ft(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),ld(Object.freeze([]),e,t)}ft.BREAK=Ns;ft.SKIP=av;ft.REMOVE=ad;ft.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};ft.parentCollection=(e,t)=>{let n=ft.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function ld(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=ld(Object.freeze(e.concat([[r,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===Ns)return Ns;a===ad&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&r==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}cd.visit=ft});var tr=S(le=>{"use strict";var Rs=rd(),lv=sd(),cv=ud(),Ps="\uFEFF",Ds="",Fs="",Bs="",uv=e=>!!e&&"items"in e,fv=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function dv(e){switch(e){case Ps:return"<BOM>";case Ds:return"<DOC>";case Fs:return"<FLOW_END>";case Bs:return"<SCALAR>";default:return JSON.stringify(e)}}function pv(e){switch(e){case Ps:return"byte-order-mark";case Ds:return"doc-mode";case Fs:return"flow-error-end";case Bs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
117
|
+
`:case`\r
|
|
118
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}le.createScalarToken=Rs.createScalarToken;le.resolveAsScalar=Rs.resolveAsScalar;le.setScalarValue=Rs.setScalarValue;le.stringify=lv.stringify;le.visit=cv.visit;le.BOM=Ps;le.DOCUMENT=Ds;le.FLOW_END=Fs;le.SCALAR=Bs;le.isCollection=uv;le.isScalar=fv;le.prettyToken=dv;le.tokenType=pv});var js=S(dd=>{"use strict";var Mn=tr();function ye(e){switch(e){case void 0:case" ":case`
|
|
119
|
+
`:case"\r":case" ":return!0;default:return!1}}var fd=new Set("0123456789ABCDEFabcdef"),mv=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),nr=new Set(",[]{}"),hv=new Set(` ,[]{}
|
|
120
|
+
\r `),qs=e=>!e||hv.has(e),$s=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
121
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
122
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){let r=this.buffer[i+t+1];if(r===`
|
|
123
|
+
`||!r&&!this.atEnd)return t+i+1}return n===`
|
|
124
|
+
`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&ye(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
125
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Mn.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){let o=t[i-1];if(o===" "||o===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){let o=t[n-1];if(o===" "||o===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield Mn.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ye(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ye(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ye(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(qs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ye(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Mn.FLOW_END,yield*this.parseLineStart();let o=0;for(;r[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(qs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||ye(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
|
|
126
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let o=this.continueScalar(r+1);if(o===-1)break;r=i.indexOf(`
|
|
127
|
+
`,o)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ye(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case`
|
|
128
|
+
`:t=o,n=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
129
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
|
|
130
|
+
`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
131
|
+
`;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let o=t-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
|
|
132
|
+
`&&o>=this.pos&&o+1+n>a)t=o;else break}while(!0);return yield Mn.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(ye(o)||t&&nr.has(o))break;n=i}else if(ye(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===`
|
|
133
|
+
`?(i+=1,r=`
|
|
134
|
+
`,o=this.buffer[i+1]):n=i),o==="#"||t&&nr.has(o))break;if(r===`
|
|
135
|
+
`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&nr.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Mn.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(qs),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(ye(i)||n&&nr.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ye(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(mv.has(n))n=this.buffer[++t];else if(n==="%"&&fd.has(this.buffer[t+1])&&fd.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
|
|
136
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
137
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};dd.Lexer=$s});var Ks=S(pd=>{"use strict";var Us=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<t?n=o+1:i=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}};pd.LineCounter=Us});var Ys=S(bd=>{"use strict";var yv=ue("process"),md=tr(),gv=js();function Ve(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function hd(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function gd(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ir(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ft(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function rr(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function yd(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Ve(t.start,"explicit-key-ind")&&!Ve(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,gd(t.value)?t.value.end?rr(t.value.end,t.sep):t.value.end=t.sep:rr(t.start,t.sep),delete t.sep)}var Vs=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new gv.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,yv.env.LOG_TOKENS&&console.log("|",md.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=md.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&yd(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&hd(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{hd(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=ir(this.peek(2)),i=Ft(n),r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
138
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
139
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){rr(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;a<n.sep.length;++a){let l=n.sep[a];switch(l.type){case"newline":s.push(a);break;case"space":break;case"comment":l.indent>t.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ve(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(gd(n.key)&&!Ve(n.sep,"newline")){let s=Ft(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ve(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=Ft(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ve(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ve(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){rr(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ve(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=ir(i),o=Ft(r);yd(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
140
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
141
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=ir(t),i=Ft(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=ir(t),i=Ft(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};bd.Parser=Vs});var wd=S(Nn=>{"use strict";var Sd=Ms(),bv=En(),Ln=Cn(),Sv=To(),vv=I(),Av=Ks(),vd=Ys();function Ad(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Av.LineCounter||null,prettyErrors:t}}function _v(e,t={}){let{lineCounter:n,prettyErrors:i}=Ad(t),r=new vd.Parser(n?.addNewLine),o=new Sd.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach(Ln.prettifyError(e,n)),a.warnings.forEach(Ln.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function _d(e,t={}){let{lineCounter:n,prettyErrors:i}=Ad(t),r=new vd.Parser(n?.addNewLine),o=new Sd.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Ln.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach(Ln.prettifyError(e,n)),s.warnings.forEach(Ln.prettifyError(e,n))),s}function wv(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=_d(e,n);if(!r)return null;if(r.warnings.forEach(o=>Sv.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function Ev(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return vv.isDocument(e)&&!i?e.toString(n):new bv.Document(e,i,n).toString(n)}Nn.parse=wv;Nn.parseAllDocuments=_v;Nn.parseDocument=_d;Nn.stringify=Ev});var xd=S(L=>{"use strict";var xv=Ms(),kv=En(),Cv=fs(),Gs=Cn(),Ov=ln(),Ye=I(),Tv=$e(),Iv=K(),Mv=Ue(),Lv=Ke(),Nv=tr(),Rv=js(),Pv=Ks(),Dv=Ys(),or=wd(),Ed=rn();L.Composer=xv.Composer;L.Document=kv.Document;L.Schema=Cv.Schema;L.YAMLError=Gs.YAMLError;L.YAMLParseError=Gs.YAMLParseError;L.YAMLWarning=Gs.YAMLWarning;L.Alias=Ov.Alias;L.isAlias=Ye.isAlias;L.isCollection=Ye.isCollection;L.isDocument=Ye.isDocument;L.isMap=Ye.isMap;L.isNode=Ye.isNode;L.isPair=Ye.isPair;L.isScalar=Ye.isScalar;L.isSeq=Ye.isSeq;L.Pair=Tv.Pair;L.Scalar=Iv.Scalar;L.YAMLMap=Mv.YAMLMap;L.YAMLSeq=Lv.YAMLSeq;L.CST=Nv;L.Lexer=Rv.Lexer;L.LineCounter=Pv.LineCounter;L.Parser=Dv.Parser;L.parse=or.parse;L.parseAllDocuments=or.parseAllDocuments;L.parseDocument=or.parseDocument;L.stringify=or.stringify;L.visit=Ed.visit;L.visitAsync=Ed.visitAsync});function Xa(e){return!1}function Nw(e){return e.replace(/^#{2,4} MCP\/App citation examples\r?\n\r?\n```\r?\n[\s\S]*?^```\r?\n\s*/gm,t=>t.includes("#mavis-source=")?"":t).replace(/^#{2,4} Citations\r?\n(?:[ \t]*\r?\n)*Cite every used result where it supports the answer\.[\s\S]*?^Do not cite unused calls or unsupported claims, invent metadata, output bare parenthesized links, or add trailing source\/reference lists\.\r?\n*/gm,t=>t.includes("Citation candidate")?"":t)}function Rw(e){let n=["- Independent tool calls can run in parallel in one response.","- Issue independent tool calls together when safe. Run dependent calls or conflicting writes sequentially, and follow each tool's concurrency restrictions."].find(u=>e.includes(u));if(!n)return e;let i="- Reference code as `file_path:line_number` \u2014 it's clickable.",r="- Reference code as `file_path:line_number` so it is clickable. Place references near the relevant claim; group them only when there are many files.",o=["- Cite sources where they support the answer, using exact source URLs or supplied links.","- Place references near the relevant claim; group them only when there are many files.","- Cite only sources you used; do not invent sources or links."].join(`
|
|
142
|
+
`),a=["- When referencing code, use `file_path:line_number` format.","- When citing one or two files, place one or two `file_path:line_number` references in the relevant conclusion sentence. Use a separate evidence list only when there are many references.",i,"- Reference code as `file_path:line_number` \u2014 it's clickable in the TUI."].reduce((u,f)=>u.replaceAll(`${f}\r
|
|
143
|
+
`,"").replaceAll(`${f}
|
|
144
|
+
`,""),e.replace(r,"- Place references near the relevant claim; group them only when there are many files.")).replace(n,`${n}
|
|
145
|
+
${i}`);if(a.includes(o))return a;let l=/^(#{1,2}) Communication & Delivery\r?$/m.exec(a);if(l){let u=l[1],f=l.index+l[0].length,d=new RegExp(`^(?:#{1,${u.length}} |\\{\\{[#/])`,"m").exec(a.slice(f)),p=d?f+d.index:a.length;return`${a.slice(0,p).trimEnd()}
|
|
146
|
+
|
|
147
|
+
${u}# References
|
|
148
|
+
${o}
|
|
149
|
+
|
|
150
|
+
${a.slice(p)}`}let c=/^(#{2,4}) (?:Media Output|Deliverable Files)\r?$/m;return c.test(a)?a.replace(c,(u,f)=>`${f} References
|
|
151
|
+
${o}
|
|
152
|
+
|
|
153
|
+
${u}`):`${a.trimEnd()}
|
|
154
|
+
|
|
155
|
+
## References
|
|
156
|
+
${o}`}function dm(e,t=process.env){return Xa({platform:e,internalBuild:t.__MAVIS_BUILD_INTERNAL==="true",insideBuild:t.__MAVIS_BUILD_INSIDE==="true"})}import{randomBytes as ag}from"node:crypto";import{promises as Pe}from"node:fs";import{dirname as lg,join as Mc}from"node:path";function dl(e){return typeof e>"u"||e===null}function pm(e){return typeof e=="object"&&e!==null}function mm(e){return Array.isArray(e)?e:dl(e)?[]:[e]}function hm(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function ym(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function gm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var bm=dl,Sm=pm,vm=mm,Am=ym,_m=gm,wm=hm,Y={isNothing:bm,isObject:Sm,toArray:vm,repeat:Am,isNegativeZero:_m,extend:wm};function pl(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
|
157
|
+
|
|
158
|
+
`+e.mark.snippet),i+" "+n):i}function Jt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=pl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Jt.prototype=Object.create(Error.prototype);Jt.prototype.constructor=Jt;Jt.prototype.toString=function(t){return this.name+": "+pl(this,t)};var ie=Jt;function Dr(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Fr(e,t){return Y.repeat(" ",t-e.length)+e}function Em(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,c,u=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)c=Dr(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),f),a=Y.repeat(" ",t.indent)+Fr((e.line-l+1).toString(),u)+" | "+c.str+`
|
|
159
|
+
`+a;for(c=Dr(e.buffer,i[s],r[s],e.position,f),a+=Y.repeat(" ",t.indent)+Fr((e.line+1).toString(),u)+" | "+c.str+`
|
|
160
|
+
`,a+=Y.repeat("-",t.indent+u+3+c.pos)+`^
|
|
161
|
+
`,l=1;l<=t.linesAfter&&!(s+l>=r.length);l++)c=Dr(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),f),a+=Y.repeat(" ",t.indent)+Fr((e.line+l+1).toString(),u)+" | "+c.str+`
|
|
162
|
+
`;return a.replace(/\n$/,"")}var xm=Em,km=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Cm=["scalar","sequence","mapping"];function Om(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Tm(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(km.indexOf(n)===-1)throw new ie('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Om(t.styleAliases||null),Cm.indexOf(this.kind)===-1)throw new ie('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var z=Tm;function Qa(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function Im(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function qr(e){return this.extend(e)}qr.prototype.extend=function(t){var n=[],i=[];if(t instanceof z)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ie("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof z))throw new ie("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new ie("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new ie("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof z))throw new ie("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(qr.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=Qa(r,"implicit"),r.compiledExplicit=Qa(r,"explicit"),r.compiledTypeMap=Im(r.compiledImplicit,r.compiledExplicit),r};var ml=qr,hl=new z("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),yl=new z("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),gl=new z("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),bl=new ml({explicit:[hl,yl,gl]});function Mm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Lm(){return null}function Nm(e){return e===null}var Sl=new z("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mm,construct:Lm,predicate:Nm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Rm(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Pm(e){return e==="true"||e==="True"||e==="TRUE"}function Dm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var vl=new z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Rm,construct:Pm,predicate:Dm,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Fm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Bm(e){return 48<=e&&e<=55}function qm(e){return 48<=e&&e<=57}function $m(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Fm(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Bm(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!qm(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function jm(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function Um(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Y.isNegativeZero(e)}var Al=new z("tag:yaml.org,2002:int",{kind:"scalar",resolve:$m,construct:jm,predicate:Um,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Km=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Vm(e){return!(e===null||!Km.test(e)||e[e.length-1]==="_")}function Ym(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Gm=/^[-+]?[0-9]+e/;function Wm(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Y.isNegativeZero(e))return"-0.0";return n=e.toString(10),Gm.test(n)?n.replace("e",".e"):n}function Hm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Y.isNegativeZero(e))}var _l=new z("tag:yaml.org,2002:float",{kind:"scalar",resolve:Vm,construct:Ym,predicate:Hm,represent:Wm,defaultStyle:"lowercase"}),wl=bl.extend({implicit:[Sl,vl,Al,_l]}),El=wl,xl=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),kl=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Jm(e){return e===null?!1:xl.exec(e)!==null||kl.exec(e)!==null}function Xm(e){var t,n,i,r,o,s,a,l=0,c=null,u,f,d;if(t=xl.exec(e),t===null&&(t=kl.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],f=+(t[11]||0),c=(u*60+f)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,i,r,o,s,a,l)),c&&d.setTime(d.getTime()-c),d}function Qm(e){return e.toISOString()}var Cl=new z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Jm,construct:Xm,instanceOf:Date,represent:Qm});function zm(e){return e==="<<"||e===null}var Ol=new z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:zm}),Vr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
163
|
+
\r`;function Zm(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=Vr;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function eh(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=Vr,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function th(e){var t="",n=0,i,r,o=e.length,s=Vr;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function nh(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Tl=new z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Zm,construct:eh,predicate:nh,represent:th}),ih=Object.prototype.hasOwnProperty,rh=Object.prototype.toString;function oh(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,rh.call(r)!=="[object Object]")return!1;for(o in r)if(ih.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function sh(e){return e!==null?e:[]}var Il=new z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:oh,construct:sh}),ah=Object.prototype.toString;function lh(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],ah.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function ch(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var Ml=new z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:lh,construct:ch}),uh=Object.prototype.hasOwnProperty;function fh(e){if(e===null)return!0;var t,n=e;for(t in n)if(uh.call(n,t)&&n[t]!==null)return!1;return!0}function dh(e){return e!==null?e:{}}var Ll=new z("tag:yaml.org,2002:set",{kind:"mapping",resolve:fh,construct:dh}),Yr=El.extend({implicit:[Cl,Ol],explicit:[Tl,Il,Ml,Ll]}),Le=Object.prototype.hasOwnProperty,Yn=1,Nl=2,Rl=3,Gn=4,Br=1,ph=2,za=3,mh=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hh=/[\x85\u2028\u2029]/,yh=/[,\[\]\{\}]/,Pl=/^(?:!|!!|![a-z\-]+!)$/i,Dl=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Za(e){return Object.prototype.toString.call(e)}function be(e){return e===10||e===13}function Ze(e){return e===9||e===32}function se(e){return e===9||e===32||e===10||e===13}function bt(e){return e===44||e===91||e===93||e===123||e===125}function gh(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function bh(e){return e===120?2:e===117?4:e===85?8:0}function Sh(e){return 48<=e&&e<=57?e-48:-1}function el(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
164
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function vh(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Fl(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var Bl=new Array(256),ql=new Array(256);for(ze=0;ze<256;ze++)Bl[ze]=el(ze)?1:0,ql[ze]=el(ze);var ze;function Ah(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Yr,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function $l(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=xm(n),new ie(t,n)}function w(e,t){throw $l(e,t)}function Wn(e,t){e.onWarning&&e.onWarning.call(null,$l(e,t))}var tl={YAML:function(t,n,i){var r,o,s;t.version!==null&&w(t,"duplication of %YAML directive"),i.length!==1&&w(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&w(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&w(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Wn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&w(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],Pl.test(r)||w(t,"ill-formed tag handle (first argument) of the TAG directive"),Le.call(t.tagMap,r)&&w(t,'there is a previously declared suffix for "'+r+'" tag handle'),Dl.test(o)||w(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{w(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function Me(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||w(e,"expected valid JSON character");else mh.test(a)&&w(e,"the stream contains non-printable characters");e.result+=a}}function nl(e,t,n,i){var r,o,s,a;for(Y.isObject(n)||w(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],Le.call(t,o)||(Fl(t,o,n[o]),i[o]=!0)}function St(e,t,n,i,r,o,s,a,l){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&w(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Za(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&Za(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)nl(e,t,o[c],n);else nl(e,t,o,n);else!e.json&&!Le.call(n,r)&&Le.call(t,r)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,w(e,"duplicated mapping key")),Fl(t,r,o),delete n[r];return t}function Gr(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):w(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function j(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Ze(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(be(r))for(Gr(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&Wn(e,"deficient indentation"),i}function Xn(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||se(n)))}function Wr(e,t){t===1?e.result+=" ":t>1&&(e.result+=Y.repeat(`
|
|
165
|
+
`,t-1))}function _h(e,t,n){var i,r,o,s,a,l,c,u,f=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),se(p)||bt(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(r=e.input.charCodeAt(e.position+1),se(r)||n&&bt(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;p!==0;){if(p===58){if(r=e.input.charCodeAt(e.position+1),se(r)||n&&bt(r))break}else if(p===35){if(i=e.input.charCodeAt(e.position-1),se(i))break}else{if(e.position===e.lineStart&&Xn(e)||n&&bt(p))break;if(be(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,j(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=c,e.lineIndent=u;break}}a&&(Me(e,o,s,!1),Wr(e,e.line-l),o=s=e.position,a=!1),Ze(p)||(s=e.position+1),p=e.input.charCodeAt(++e.position)}return Me(e,o,s,!1),e.result?!0:(e.kind=f,e.result=d,!1)}function wh(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Me(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else be(n)?(Me(e,i,r,!0),Wr(e,j(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Xn(e)?w(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);w(e,"unexpected end of the stream within a single quoted scalar")}function Eh(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Me(e,n,e.position,!0),e.position++,!0;if(a===92){if(Me(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),be(a))j(e,!1,t);else if(a<256&&Bl[a])e.result+=ql[a],e.position++;else if((s=bh(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=gh(a))>=0?o=(o<<4)+s:w(e,"expected hexadecimal character");e.result+=vh(o),e.position++}else w(e,"unknown escape sequence");n=i=e.position}else be(a)?(Me(e,n,i,!0),Wr(e,j(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Xn(e)?w(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}w(e,"unexpected end of the stream within a double quoted scalar")}function xh(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,c,u,f,d,p,h=Object.create(null),m,y,g,b;if(b=e.input.charCodeAt(e.position),b===91)u=93,p=!1,a=[];else if(b===123)u=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),b=e.input.charCodeAt(++e.position);b!==0;){if(j(e,!0,t),b=e.input.charCodeAt(e.position),b===u)return e.position++,e.tag=s,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?b===44&&w(e,"expected the node content, but found ','"):w(e,"missed comma between flow collection entries"),y=m=g=null,f=d=!1,b===63&&(c=e.input.charCodeAt(e.position+1),se(c)&&(f=d=!0,e.position++,j(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,vt(e,t,Yn,!1,!0),y=e.tag,m=e.result,j(e,!0,t),b=e.input.charCodeAt(e.position),(d||e.line===i)&&b===58&&(f=!0,b=e.input.charCodeAt(++e.position),j(e,!0,t),vt(e,t,Yn,!1,!0),g=e.result),p?St(e,a,h,y,m,g,i,r,o):f?a.push(St(e,null,h,y,m,g,i,r,o)):a.push(m),j(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(n=!0,b=e.input.charCodeAt(++e.position)):n=!1}w(e,"unexpected end of the stream within a flow collection")}function kh(e,t){var n,i,r=Br,o=!1,s=!1,a=t,l=0,c=!1,u,f;if(f=e.input.charCodeAt(e.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Br===r?r=f===43?za:ph:w(e,"repeat of a chomping mode identifier");else if((u=Sh(f))>=0)u===0?w(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?w(e,"repeat of an indentation width identifier"):(a=t+u-1,s=!0);else break;if(Ze(f)){do f=e.input.charCodeAt(++e.position);while(Ze(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!be(f)&&f!==0)}for(;f!==0;){for(Gr(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),be(f)){l++;continue}if(e.lineIndent<a){r===za?e.result+=Y.repeat(`
|
|
166
|
+
`,o?1+l:l):r===Br&&o&&(e.result+=`
|
|
167
|
+
`);break}for(i?Ze(f)?(c=!0,e.result+=Y.repeat(`
|
|
168
|
+
`,o?1+l:l)):c?(c=!1,e.result+=Y.repeat(`
|
|
169
|
+
`,l+1)):l===0?o&&(e.result+=" "):e.result+=Y.repeat(`
|
|
170
|
+
`,l):e.result+=Y.repeat(`
|
|
171
|
+
`,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!be(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Me(e,n,e.position,!1)}return!0}function il(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,w(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!se(s))));){if(a=!0,e.position++,j(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,vt(e,t,Rl,!1,!0),o.push(e.result),j(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)w(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=o,!0):!1}function Ch(e,t,n){var i,r,o,s,a,l,c=e.tag,u=e.anchor,f={},d=Object.create(null),p=null,h=null,m=null,y=!1,g=!1,b;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),b=e.input.charCodeAt(e.position);b!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,w(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(b===63||b===58)&&se(i))b===63?(y&&(St(e,f,d,p,h,null,s,a,l),p=h=m=null),g=!0,y=!0,r=!0):y?(y=!1,r=!0):w(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,b=i;else{if(s=e.line,a=e.lineStart,l=e.position,!vt(e,n,Nl,!1,!0))break;if(e.line===o){for(b=e.input.charCodeAt(e.position);Ze(b);)b=e.input.charCodeAt(++e.position);if(b===58)b=e.input.charCodeAt(++e.position),se(b)||w(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(St(e,f,d,p,h,null,s,a,l),p=h=m=null),g=!0,y=!1,r=!1,p=e.tag,h=e.result;else if(g)w(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(g)w(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===o||e.lineIndent>t)&&(y&&(s=e.line,a=e.lineStart,l=e.position),vt(e,t,Gn,!0,r)&&(y?h=e.result:m=e.result),y||(St(e,f,d,p,h,m,s,a,l),p=h=m=null),j(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&b!==0)w(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&St(e,f,d,p,h,null,s,a,l),g&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=f),g}function Oh(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&w(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):w(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!se(s);)s===33&&(i?w(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Pl.test(r)||w(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),yh.test(o)&&w(e,"tag suffix cannot contain flow indicator characters")}o&&!Dl.test(o)&&w(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{w(e,"tag name is malformed: "+o)}return n?e.tag=o:Le.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:w(e,'undeclared tag handle "'+r+'"'),!0}function Th(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&w(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!se(n)&&!bt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&w(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ih(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!se(i)&&!bt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&w(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Le.call(e.anchorMap,n)||w(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],j(e,!0,-1),!0}function vt(e,t,n,i,r){var o,s,a,l=1,c=!1,u=!1,f,d,p,h,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=Gn===n||Rl===n,i&&j(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Oh(e)||Th(e);)j(e,!0,-1)?(c=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||r),(l===1||Gn===n)&&(Yn===n||Nl===n?m=t:m=t+1,y=e.position-e.lineStart,l===1?a&&(il(e,y)||Ch(e,y,m))||xh(e,m)?u=!0:(s&&kh(e,m)||wh(e,m)||Eh(e,m)?u=!0:Ih(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&w(e,"alias node should not have any properties")):_h(e,m,Yn===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&il(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&w(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,d=e.implicitTypes.length;f<d;f+=1)if(h=e.implicitTypes[f],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Le.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,p=e.typeMap.multi[e.kind||"fallback"],f=0,d=p.length;f<d;f+=1)if(e.tag.slice(0,p[f].tag.length)===p[f].tag){h=p[f];break}h||w(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&w(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):w(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Mh(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(j(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!se(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&w(e,"directive name must not be less than one character in length");s!==0;){for(;Ze(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!be(s));break}if(be(s))break;for(n=e.position;s!==0&&!se(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&Gr(e),Le.call(tl,i)?tl[i](e,i,r):Wn(e,'unknown document directive "'+i+'"')}if(j(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,j(e,!0,-1)):o&&w(e,"directives end mark is expected"),vt(e,e.lineIndent-1,Gn,!1,!0),j(e,!0,-1),e.checkLineBreaks&&hh.test(e.input.slice(t,e.position))&&Wn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,j(e,!0,-1));return}if(e.position<e.length-1)w(e,"end of the stream or a document separator is expected");else return}function jl(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
172
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ah(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,w(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Mh(n);return n.documents}function Lh(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var i=jl(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function Nh(e,t){var n=jl(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new ie("expected a single document in the stream, but found more")}}var Rh=Lh,Ph=Nh,Ul={loadAll:Rh,load:Ph},Kl=Object.prototype.toString,Vl=Object.prototype.hasOwnProperty,Hr=65279,Dh=9,Xt=10,Fh=13,Bh=32,qh=33,$h=34,$r=35,jh=37,Uh=38,Kh=39,Vh=42,Yl=44,Yh=45,Hn=58,Gh=61,Wh=62,Hh=63,Jh=64,Gl=91,Wl=93,Xh=96,Hl=123,Qh=124,Jl=125,te={};te[0]="\\0";te[7]="\\a";te[8]="\\b";te[9]="\\t";te[10]="\\n";te[11]="\\v";te[12]="\\f";te[13]="\\r";te[27]="\\e";te[34]='\\"';te[92]="\\\\";te[133]="\\N";te[160]="\\_";te[8232]="\\L";te[8233]="\\P";var zh=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Zh=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ey(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&Vl.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function ty(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new ie("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Y.repeat("0",i-t.length)+t}var ny=1,Qt=2;function iy(e){this.schema=e.schema||Yr,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Y.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ey(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Qt:ny,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function rl(e,t){for(var n=Y.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
|
|
173
|
+
`,i),r===-1?(s=e.slice(i),i=a):(s=e.slice(i,r+1),i=r+1),s.length&&s!==`
|
|
174
|
+
`&&(o+=n),o+=s;return o}function jr(e,t){return`
|
|
175
|
+
`+Y.repeat(" ",e.indent*t)}function ry(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Jn(e){return e===Bh||e===Dh}function zt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Hr||65536<=e&&e<=1114111}function ol(e){return zt(e)&&e!==Hr&&e!==Fh&&e!==Xt}function sl(e,t,n){var i=ol(e),r=i&&!Jn(e);return(n?i:i&&e!==Yl&&e!==Gl&&e!==Wl&&e!==Hl&&e!==Jl)&&e!==$r&&!(t===Hn&&!r)||ol(t)&&!Jn(t)&&e===$r||t===Hn&&r}function oy(e){return zt(e)&&e!==Hr&&!Jn(e)&&e!==Yh&&e!==Hh&&e!==Hn&&e!==Yl&&e!==Gl&&e!==Wl&&e!==Hl&&e!==Jl&&e!==$r&&e!==Uh&&e!==Vh&&e!==qh&&e!==Qh&&e!==Gh&&e!==Wh&&e!==Kh&&e!==$h&&e!==jh&&e!==Jh&&e!==Xh}function sy(e){return!Jn(e)&&e!==Hn}function Ht(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function Xl(e){var t=/^\n* /;return t.test(e)}var Ql=1,Ur=2,zl=3,Zl=4,gt=5;function ay(e,t,n,i,r,o,s,a){var l,c=0,u=null,f=!1,d=!1,p=i!==-1,h=-1,m=oy(Ht(e,0))&&sy(Ht(e,e.length-1));if(t||s)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Ht(e,l),!zt(c))return gt;m=m&&sl(c,u,a),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Ht(e,l),c===Xt)f=!0,p&&(d=d||l-h-1>i&&e[h+1]!==" ",h=l);else if(!zt(c))return gt;m=m&&sl(c,u,a),u=c}d=d||p&&l-h-1>i&&e[h+1]!==" "}return!f&&!d?m&&!s&&!r(e)?Ql:o===Qt?gt:Ur:n>9&&Xl(e)?gt:s?o===Qt?gt:Ur:d?Zl:zl}function ly(e,t,n,i,r){e.dump=(function(){if(t.length===0)return e.quotingType===Qt?'""':"''";if(!e.noCompatMode&&(zh.indexOf(t)!==-1||Zh.test(t)))return e.quotingType===Qt?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return ry(e,c)}switch(ay(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case Ql:return t;case Ur:return"'"+t.replace(/'/g,"''")+"'";case zl:return"|"+al(t,e.indent)+ll(rl(t,o));case Zl:return">"+al(t,e.indent)+ll(rl(cy(t,s),o));case gt:return'"'+uy(t)+'"';default:throw new ie("impossible error: invalid scalar style")}})()}function al(e,t){var n=Xl(e)?String(t):"",i=e[e.length-1]===`
|
|
176
|
+
`,r=i&&(e[e.length-2]===`
|
|
177
|
+
`||e===`
|
|
178
|
+
`),o=r?"+":i?"":"-";return n+o+`
|
|
179
|
+
`}function ll(e){return e[e.length-1]===`
|
|
180
|
+
`?e.slice(0,-1):e}function cy(e,t){for(var n=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
|
|
181
|
+
`);return c=c!==-1?c:e.length,n.lastIndex=c,cl(e.slice(0,c),t)})(),r=e[0]===`
|
|
182
|
+
`||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",i+=a+(!r&&!o&&l!==""?`
|
|
183
|
+
`:"")+cl(l,t),r=o}return i}function cl(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=`
|
|
184
|
+
`+e.slice(r,o),r=o+1),s=a;return l+=`
|
|
185
|
+
`,e.length-r>t&&s>r?l+=e.slice(r,s)+`
|
|
186
|
+
`+e.slice(s+1):l+=e.slice(r),l.slice(1)}function uy(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=Ht(e,r),i=te[n],!i&&zt(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||ty(n);return t}function fy(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)),(Ee(e,t,a,!1,!1)||typeof a>"u"&&Ee(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function ul(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)),(Ee(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ee(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=jr(e,t)),e.dump&&Xt===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function dy(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)),Ee(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ee(e,t,c,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function py(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+=jr(e,t)),c=s[a],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),Ee(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Xt===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,f&&(d+=jr(e,t)),Ee(e,t+1,u,!0,f)&&(e.dump&&Xt===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,r+=d));e.tag=o,e.dump=r||"{}"}function fl(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,Kl.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Vl.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 Ee(e,t,n,i,r,o,s){e.tag=null,e.dump=n,fl(e,n,!1)||fl(e,n,!0);var a=Kl.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?(py(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(dy(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?ul(e,t-1,e.dump,r):ul(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(fy(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&ly(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 my(e,t){var n=[],i=[],r,o;for(Kr(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function Kr(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)Kr(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)Kr(e[i[r]],t,n)}function hy(e,t){t=t||{};var n=new iy(t);n.noRefs||my(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ee(n,0,i,!0,!0)?n.dump+`
|
|
187
|
+
`:""}var yy=hy,gy={dump:yy};function Jr(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 by=z,Sy=ml,vy=bl,Ay=wl,_y=El,wy=Yr,Ey=Ul.load,xy=Ul.loadAll,ky=gy.dump,Cy=ie,Oy={binary:Tl,float:_l,map:gl,null:Sl,pairs:Ml,set:Ll,timestamp:Cl,bool:vl,int:Al,merge:Ol,omap:Il,seq:yl,str:hl},Ty=Jr("safeLoad","load"),Iy=Jr("safeLoadAll","loadAll"),My=Jr("safeDump","dump"),U={Type:by,Schema:Sy,FAILSAFE_SCHEMA:vy,JSON_SCHEMA:Ay,CORE_SCHEMA:_y,DEFAULT_SCHEMA:wy,load:Ey,loadAll:xy,dump:ky,YAMLException:Cy,types:Oy,safeLoad:Ty,safeLoadAll:Iy,safeDump:My};var Nc=Rr(co(),1);async function cg(e,t){let n=Mc(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=Mc(lg(s),`.config-tmp-${ag(6).toString("hex")}`),o=await Nc.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:U.load(a))??{};if(!Lc(c))throw new Error("Invalid config document");let u=c.tui??{};if(!Lc(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(U.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 Lc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function uo(e){if(typeof e!="object"||e===null||Array.isArray(e))return{};let t=e.enabled;return typeof t=="boolean"?{enabled:t}:{}}function fo(e,t){return{enabled:uo(t).enabled??uo(e).enabled??!0}}var nn="MiniMax-M3.1-Flash-Preview",Rc={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},rt={"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:Rc},"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:Rc}};import Te from"node:fs";import Se from"node:fs";var Pc=384;function kt(e){if(process.platform==="win32")return;let t=Se.statSync(e).mode;(t&63)!==0&&Se.chmodSync(e,t&448)}function ot(e,t,n=!1){let i=Se.constants.O_WRONLY|Se.constants.O_CREAT|(n?Se.constants.O_EXCL:0),r=Se.openSync(e,i,Pc);try{Se.fchmodSync(r,Pc),Se.ftruncateSync(r,0),Se.writeFileSync(r,t)}finally{Se.closeSync(r)}}import{isDeepStrictEqual as Hs}from"node:util";var W=Rr(xd(),1);function Rn(e){try{let t=U.load(e);return Bt(t)?t:{}}catch{return{}}}function Pn(e,t,n){let i=(0,W.parseDocument)(e,{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!0});if(i.errors.length>0||!(0,W.isMap)(i.contents)&&e.trim()!=="")return Cd(n);try{let r=Ws(t,n);if(r.length===0)return e;Fv(i),Bv(i),qv(i,Rn(e));for(let l of r){let c=Td(i,l.path);l.kind==="delete"?i.deleteIn(c):l.kind==="reorder"?Id(i,c,l.keys):i.setIn(c,l.value)}let o=i.toString({indent:2,lineWidth:-1}),s=U.load(o),a=U.load(Cd(n));if(!Hs(s,a)||Ws(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 Fv(e){(0,W.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=U.load(`value: ${r}${i}`).value;Hs(n.value,o)||(n.value=o,delete n.format)}})}function Od(e,t){return e.items.find(n=>(0,W.isScalar)(n.key)&&String(n.key.value)===t)?.key??t}function Td(e,t){let n=[],i=e.contents;for(let r of t)n.push((0,W.isMap)(i)?Od(i,r):r),i=e.getIn(n,!0);return n}function Bv(e){let t=new Map;(0,W.visit)(e,{Alias(n,i){let r=i.toJS(e),o=kd(e,r);o.comment=i.comment,o.commentBefore=i.commentBefore,o.spaceBefore=i.spaceBefore,t.set(i,o)}}),(0,W.visit)(e,{Alias:(n,i)=>t.get(i)}),(0,W.visit)(e,{Map(n,i){let r=i.items.filter(a=>(0,W.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,W.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(Od(i,a))||i.set(a,kd(e,l))}}),e.setSchema(e.directives?.yaml.version??"1.2",{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!1})}function kd(e,t){let n=e.createNode(t,{aliasDuplicateObjects:!1});return(0,W.visit)(n,{Pair(i,r){(0,W.isScalar)(r.key)&&r.key.value==="<<"&&(r.key.type="QUOTE_DOUBLE")}}),n}function qv(e,t){if(Bt(t.custom_provider))for(let[n,i]of Object.entries(t.custom_provider)){if(!Bt(i)||!Bt(i.models))continue;let r=Td(e,["custom_provider",n,"models"]);Id(e,r,Object.keys(i.models))}}function Id(e,t,n){let i=e.getIn(t,!0);if(!(0,W.isMap)(i))throw new Error("Expected a model mapping when applying config order");let r=new Map(i.items.map(o=>[(0,W.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 Ws(e,t,n=[]){if(!Bt(e)||!Bt(t))return $v(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(...Ws(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);Hs(Object.keys(e),r)||i.push({kind:"reorder",path:n,keys:r})}return i}function $v(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 Cd(e){return U.dump(e,{indent:2,lineWidth:-1,noRefs:!0})}function Bt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function qt(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 sr={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,consolidationCron:void 0,maxConsolidationAgentTurns:64,minModelQuotaRemainingPercent:20,captureModel:void 0,captureReasoningEffort:"low",consolidationModel:void 0,consolidationReasoningEffort:"medium",retentionDays:90};function Nd(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")?qt(i):qt(t),v2:{...typeof a.enabled=="boolean"?{enabled:a.enabled}:{},detailedLoggingEnabled:Js(a.detailedLoggingEnabled,l.detailedLoggingEnabled),writeEnabled:Js(a.writeEnabled,l.writeEnabled),recallEnabled:Js(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),consolidationCron:typeof a.consolidationCron=="string"?a.consolidationCron.trim()||void 0:l.consolidationCron,maxConsolidationAgentTurns:re(a.maxConsolidationAgentTurns,l.maxConsolidationAgentTurns),minModelQuotaRemainingPercent:jv(a.minModelQuotaRemainingPercent,l.minModelQuotaRemainingPercent),captureModel:Md(a.captureModel,l.captureModel),captureReasoningEffort:Ld(a.captureReasoningEffort,l.captureReasoningEffort),consolidationModel:Md(a.consolidationModel,l.consolidationModel),consolidationReasoningEffort:Ld(a.consolidationReasoningEffort,l.consolidationReasoningEffort),retentionDays:re(a.retentionDays,l.retentionDays)}}}function Js(e,t){return typeof e=="boolean"?e:t}function re(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function jv(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&e<=100?e:t}function Md(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}function Ld(e,t){return e==="low"||e==="medium"||e==="high"?e:t}function Uv(e,t){return!qt(e)&&e?.enabled!==!1&&e?.legacyRecallDisabledAgents?.[t]!==!0}import oe from"node:path";import XA from"node:os";import{spawnSync as QA}from"node:child_process";import{fileURLToPath as zA}from"node:url";function Rd(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,events:u}=i;r={...l==="unfocused"||l==="always"||l==="never"?{when:l}:{},...c==="auto"||c==="osc9"||c==="osc777"||c==="bel"?{method:c}:{},...Array.isArray(u)?{events:u.filter(f=>typeof f=="string")}:{}}}let o=n.statusLine,s=Array.isArray(o)?o.filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean):void 0,a=Kv(n.customStatusLine);return{...n.terminalTitle===null?{terminalTitle:null}:Array.isArray(n.terminalTitle)?{terminalTitle:n.terminalTitle.filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean)}:{},...typeof n.showTips=="boolean"?{showTips:n.showTips}:{},...typeof n.programStatus=="boolean"?{programStatus:n.programStatus}:{},...r?{notifications:r}:{},...s?{statusLine:s}:{},...a?{customStatusLine:a}:{}}}function Kv(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}:{}}}var Vv=["agent.minimaxi.com","agent.minimaxi.com","agent.minimax.io","agent.minimax.io","agent.minimax.io","agent.minimax.cn","agent.minimaxi.com"],Yv=new Set(Vv.map(e=>`https://${e}`));function Gv(e,t){return/^custom_provider:minimax-legacy(?:-\d+)?$/u.test(e)&&(!t||Xs(t))}function Xs(e){try{let t=new URL(e);return t.username||t.password?!1:Yv.has(t.origin.toLowerCase())}catch{return!1}}function Wv(e){if(!(e!=="managed-login"&&e!=="api-key"&&e!=="oauth"))return e}function Qs(e){let t=typeof e?.baseURL=="string"?e.baseURL.trim():"",n=t.length>0&&Xs(t),i=Wv(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 pe="minimax",dt="minimax_api",zs="custom_provider:";function Hv(e,t){return e==="anthropic-messages"&&(t===pe||t===dt)}function Fn(e,t){if(t===dt)return"minimax_api_key";if(t.startsWith(zs))return"custom_provider";if(t!==pe)return"configured_provider";if(e.minimaxModelSource==="minimax_api_key")return"minimax_api_key";let n=e.provider?.[t]?.options;return Qs({authMode:n?.authMode,baseURL:n?.baseURL}).authMode==="managed-login"?"managed_token_plan":"configured_provider"}function ar(e,t,n){switch(Fn(e,t)){case"managed_token_plan":return Dn(e.provider?.[t],!0);case"minimax_api_key":{let r=e.provider?.[pe];return Dn({...r,models:r?.models??rt},!0)}case"custom_provider":{let r=e.custom_provider?.[t.slice(zs.length)];return!r||r.enabled===!1?[]:Dn(r)}case"configured_provider":return Dn(e.provider?.[t])}}function Jv(e){let t=Fn(e.config,e.providerId),n=e.modelId.trim();return n.length>0&&ar(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 Pd(e){return e==="managed_token_plan"||e==="minimax_api_key"}function $t(e){let t=Dn(e,!0),i=(Array.isArray(e?.model_order)?e.model_order:[]).find(r=>typeof r=="string"&&t.includes(r));return i||(t.includes(nn)?nn:t[0])}function Xv(e){let t=Fn(e.config,e.providerId),n=e.modelId.trim();if(ar(e.config,e.providerId,e.preset).includes(n))return{kind:"available",route:t};if(!Pd(t))return{kind:"passthrough",route:t,reason:"unmanaged_route"};let i=e.fallbacks?.find(o=>o!==void 0&&!(o.providerId===e.providerId&&o.modelId.trim()===n)&&ar(e.config,o.providerId,e.preset).includes(o.modelId.trim()));if(i)return{kind:"replaced",route:t,tier:"fallback",model:{providerId:i.providerId,modelId:i.modelId.trim()}};let r=$t(Qv(e.config,e.providerId));return r?{kind:"replaced",route:t,tier:"delivered_default",model:{providerId:e.providerId,modelId:r}}:{kind:"passthrough",route:t,reason:"no_official_model"}}function Qv(e,t){let n=e.provider?.[pe];return t===pe&&Fn(e,t)==="managed_token_plan"?n:{...n,models:n?.models??rt}}function Dn(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))]}import{createHash as zv,randomUUID as Zv}from"node:crypto";import cr from"node:fs";import lr from"node:path";function Bd(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=ea(t.modelContextLimits);return i&&(n.modelContextLimits=i),Object.keys(n).length>0?n:void 0}function ea(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 qd(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 ta(e){let t=e.provider?.minimax,n=t?.catalogModels??t?.models??rt;return qd(Object.fromEntries(Object.entries(n).filter(([,i])=>i.enabled!==!1)),e.minimax_api?.modelContextLimits)}function $d(e,t){let n=e.minimax;return n?.models?{...e,minimax:{...n,catalogModels:n.models,models:qd(n.models,t)}}:e}function jd(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,Kd(i)]))}function Ud(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,B(n)?Kd(n):n]))}function Kd(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 Vd="byok_legacy_provider_to_custom_provider_v1",Yd="config.yaml.bak.byok-legacy-provider.",Zs=new Set(["minimax","minimax_api","provider","custom_provider"]),eA=/^[A-Za-z0-9 _-]+$/;function Gd(e,t){let n={migrated:!1,migratedProviders:{}};if(!t.isManagedRuntime()||!cr.existsSync(e))return n;let i=rA(e);if(!B(i.provider))return n;let r=i.provider,o=B(i.custom_provider)?i.custom_provider:{},s=pA(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(!oA(d,p,f))continue;let h=s.providers[d];if(h&&!Zs.has(h)&&!B(l[h])){delete r[d],u=!0;continue}let m=h&&!Zs.has(h)?h:lA(d,p,c);a[d]=m,B(l[m])||(l[m]=aA(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=Fd(i,"defaultModel",a)||u,u=Fd(i,"defaultLightModel",a)||u,u=fA(i,a)||u,!u)return{migrated:!1,migratedProviders:a};Object.keys(l).length>0?i.custom_provider=l:delete i.custom_provider,mA(i,s);try{let d=dA(e);return ot(e,U.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: ${yA(d)}`),{migrated:!1,migratedProviders:a}}}function Wd(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||nA(s,t)))return{provider:n,defaultModel:i};let c=s?.options,u=a&&t.shouldEnforceManagedProviderProtection(),f=iA(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??tA(n,a)}}function tA(e,t){if(!t)return;let n=$t(e.minimax);return n?`minimax/${n}`:void 0}function nA(e,t){let n=e?.options;return n?.authMode==="managed-login"?!0:typeof n?.baseURL=="string"&&t.isManagedPresetBaseUrl(n.baseURL)}function iA(e,t){return t&&Object.keys(t).length>0?t:e??{}}function rA(e){try{let t=U.load(cr.readFileSync(e,"utf-8"));return B(t)?t:{}}catch{return{}}}function oA(e,t,n){return e==="minimax"||e==="minimax_api"||!hA(t)||!sA(t)?!1:!Object.prototype.hasOwnProperty.call(n,e)}function sA(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 aA(e){let t=B(e.options)?e.options:{};return{...e,kind:"custom",enabled:e.enabled!==!1,options:{...t,authMode:"api-key"}}}function lA(e,t,n){let i=B(t)?t:{},r=typeof i.name=="string"?i.name:void 0,o=`provider-${cA(e)}`,s=Dd(e)??Dd(r)??o;for(let a=0;;a+=1){let l=a===0?s:`${s}-${a+1}`;if(!n.has(l)&&!Zs.has(l))return l}}function Dd(e){let t=e?.trim();return!t||!eA.test(t)?void 0:t.toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function cA(e){return zv("sha256").update(e).digest("hex").slice(0,8)}function Fd(e,t,n){let i=e[t];if(typeof i!="string")return!1;let r=uA(i,n);return r===i?!1:(e[t]=r,!0)}function uA(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 fA(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 Hd(e){if(process.platform==="win32")return;let t=lr.dirname(e),n;try{n=cr.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(Yd)){let r=lr.join(t,i.name);try{kt(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 dA(e){let t=lr.join(lr.dirname(e),`${Yd}${Date.now()}.${Zv()}`);return kt(e),ot(t,cr.readFileSync(e),!0),t}function pA(e){let n=(B(e.migrations)?e.migrations:void 0)?.[Vd];return{providers:B(n)&&B(n.providers)?Object.fromEntries(Object.entries(n.providers).filter(r=>typeof r[1]=="string")):{}}}function mA(e,t){let n=B(e.migrations)?e.migrations:{};n[Vd]={version:1,providers:t.providers},e.migrations=n}function hA(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 yA(e){return e instanceof Error?e.message:String(e)}function Jd(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 Xd(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=gA(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 gA(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 ur(e){let t=JSON.stringify({level:40,time:Date.now(),name:"config.asr",msg:e});process.stderr.write(`${t}
|
|
190
|
+
`)}var dr={enabled:!0};function Qd(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 fr(e){return typeof e=="string"&&e.trim().length>0}function zd(e){let t=e.asr;if(t==null||typeof t!="object"||Array.isArray(t))return{...dr};let n=t;return Qd(n.seed)&&ur("Ignoring legacy `asr.seed.*` in config \u2014 Seed ASR was retired from the daemon; only Amadeus remains. Remove `asr.seed` from config.yaml."),Qd(n.qwen)&&ur("Ignoring legacy `asr.qwen.apiKey` in config \u2014 Qwen ASR was retired from the daemon; only Amadeus remains. Remove `asr.qwen` from config.yaml."),(fr(n.mode)||fr(n.proxyBaseUrl))&&ur("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."),(fr(n.primaryProvider)||fr(n.fallbackProvider))&&ur("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:dr.enabled}}var bA={policyOwner:"core",storageWriteVersion:2,classifierTimeoutMs:6e4,userConfirmationEnabled:!0,nativeDelete:!1};function Zd(e,t=bA){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,c=i.nativeDelete===!0;return{policyOwner:r,storageWriteVersion:o,classifierTimeoutMs:a,userConfirmationEnabled:l,nativeDelete:c}}var ep=["user-cc","user-codex","user-agents","workspace-minimax","workspace-cc","workspace-agents"],SA={"user-cc":"user-claude","workspace-cc":"workspace-claude"},mr={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 pr(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function vA(e,t){return pr(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 na(e){let t=mr,n=pr(e.skills)?e.skills:{},i=pr(n.external)?n.external:{},r=pr(i.sources)?i.sources:{},o={...t.external.sources};for(let s of ep){let a=SA[s],l=Object.hasOwn(r,s)?r[s]:a?r[a]:void 0;o[s]=vA(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 AA=ep;var tp=["pi-agent"],jt="pi-agent";function np(e){return typeof e!="string"?jt:tp.includes(e)?e:jt}function ia(e){return e==null||typeof e!="object"||Array.isArray(e)?{defaultFramework:jt}:{defaultFramework:np(e.defaultFramework)}}import H from"node:fs";import _A from"node:os";import Ut from"node:path";var lp=".minimax",cp=".mavis",wA={error:()=>{},info:()=>{},warn:()=>{}};function la(e){return e??_A.homedir()}function up(e,t){return t?`${e}-${t}`:e}function fp(e,t){return Ut.join(la(e),up(lp,t))}function dp(e,t){return Ut.join(la(e),up(cp,t))}function oa(e){try{let t=H.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 ra(e){let t=Ut.resolve(e);return process.platform==="win32"?(t=t.replace(/^\\\\\?\\/,""),t.toLowerCase()):t}function ca(e,t){try{let n=H.readlinkSync(e),i=ra(t);return ra(Ut.resolve(Ut.dirname(e),n))===i||ra(n)===i}catch{return!1}}function hr(e,t,n){if(!ca(e,t))try{H.symlinkSync(t,e,process.platform==="win32"?"junction":"dir")}catch(i){n.warn(`Failed to create compat link ${e} -> ${t}: ${String(i)}`)}}function ip(e,t,n){if(t.kind==="missing")return!0;if(t.kind==="link"||t.kind==="other")try{return H.unlinkSync(e),!0}catch(i){return n.warn(`Failed to remove ${e} before creating compat link: ${String(i)}`),!1}return!1}function sa(e){try{let t=H.readdirSync(e);if(t.length===0)return"empty";if(t.length===1&&t[0]==="workspace")try{return H.readdirSync(Ut.join(e,"workspace")).length>0?"hasData":"empty"}catch{return"unknown"}return"hasData"}catch{return"unknown"}}function aa(e){try{return H.statSync(e).isDirectory()?sa(e):void 0}catch{return"unknown"}}function EA(e,t){return`${e}.backup-${t()}`}function xA(e,t,n){let i=EA(e,n);try{return H.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 kA(e,t,n,i){if(ca(e,t))return!0;let r=oa(e);if(r.kind==="missing")return!0;if(r.kind==="link"){let o=aa(e);return o==="hasData"||o==="unknown"?(n.warn(`Cannot replace legacy data dir symlink ${e}; it may point to real data outside ${t}`),!1):ip(e,r,n)}return r.kind==="other"?ip(e,r,n):r.kind==="directory"?xA(e,n,i):(n.warn(`Cannot replace inaccessible legacy data dir ${e}; leaving it untouched`),!1)}function rp(e,t,n,i){kA(e,t,n,i)&&hr(e,t,n)}function CA(e,t){try{return H.rmSync(e,{recursive:!0,force:!1}),!0}catch(n){return t.warn(`Failed to remove empty primary data dir ${e}: ${String(n)}`),!1}}function op(e,t,n){try{return H.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 OA(e,t,n,i){try{H.cpSync(e,n,{recursive:!0,errorOnExist:!0,force:!1}),H.unlinkSync(t);try{H.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{H.existsSync(n)&&H.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 sp(e,t,n){try{let i=H.realpathSync(e);try{H.renameSync(i,t)}catch(r){if(r.code==="EXDEV")return OA(i,e,t,n);throw r}return H.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 ap(e,t){try{return H.mkdirSync(e,{recursive:!0}),!0}catch(n){return t.warn(`Failed to create primary data dir ${e}: ${String(n)}`),!1}}function TA(e,t,n,i){let r=oa(e),o=oa(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=sa(e),a=o.kind==="directory"?sa(t):o.kind==="link"?aa(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(!CA(e,n))return t;if(o.kind==="link"){if(!sp(t,e,n))return t}else if(!op(t,e,n))return t;return hr(t,e,n),e}}return rp(t,e,n,i),e}if(ca(t,e))return ap(e,n),e;if(o.kind==="directory")return op(t,e,n)?(hr(t,e,n),e):t;if(o.kind==="link"){let s=aa(t);if(s==="hasData")return sp(t,e,n)?(hr(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):(ap(e,n),rp(t,e,n,i),e)}function Ge(e={}){let t=la(e.homeDir),n=e.profile??null;return TA(fp(t,n),dp(t,n),e.logger??wA,e.nowMs??Date.now)}function IA(e,t){return Ge({homeDir:e,logger:t})}function MA(e,t,n){return Ge({homeDir:t,profile:e,logger:n})}var ha=["read","write","edit","bash","task_query","task_output","task_stop","grep","glob","todowrite","web_fetch","website_deploy","workspace_semantic_search"],ya=["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"],ga=["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"],hp=["control-in-app-browser","resume-codex","mavis","create-agent","minimax-code-product","miniapp-creator"],LA=new Set(["modelConfigId","persona","tools","builtinTools","skills","features"]),NA=new Set(["enabled"]),pa=new Set(["mavis","delegation","webSearch"]),yp=new Set(ha),pp=["task_query","task_output","task_stop"],gp=new Set(ya),ma=new Set(ga),bp=new Set(hp),RA=new Set(["plan-mode"]);function ba(e){let t=yr(e),n=yr(t?.default);return{default:n?DA(n):{}}}function PA(e,t="agent"){if(e===void 0)return{};let n=fa(e,t);da(n,LA,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=fa(n.persona,`${t}.persona`);da(r,NA,`${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"||!yp.has(r))&&ce(`${t}.tools[${o}]`,`must be one of ${ha.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"||!gp.has(r))&&ce(`${t}.builtinTools[${o}]`,`must be one of ${ya.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"&&bp.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"||!ma.has(r.trim()))&&ce(`${t}.skills[${o}]`,`must be one of ${ga.join(", ")}`),r.trim()})),n.features!==void 0){let r=fa(n.features,`${t}.features`);da(r,pa,`${t}.features`);for(let o of pa)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 DA(e){let t={};typeof e.modelConfigId=="string"&&e.modelConfigId.trim()&&(t.modelConfigId=e.modelConfigId.trim());let n=yr(e.persona);if(typeof n?.enabled=="boolean"&&(t.persona={enabled:n.enabled}),mp(e.tools,yp)){let r=[...e.tools];pp.some(o=>r.includes(o))||r.push(...pp),t.tools=r}if(mp(e.builtinTools,gp)&&(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"&&(ma.has(o)||RA.has(o))&&!bp.has(o))&&(t.skills=r.filter(o=>typeof o=="string"&&ma.has(o)))}let i=yr(e.features);if(i){let r={};for(let o of pa)typeof i[o]=="boolean"&&(r[o]=i[o]);Object.keys(r).length>0&&(t.features=r)}return t}function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function mp(e,t){return Array.isArray(e)&&e.every(n=>typeof n=="string"&&t.has(n))}function FA(e={},t={}){return{persona:{enabled:t.persona?.enabled??e.persona?.enabled??!0},tools:ua(t.tools??e.tools),builtinTools:ua(t.builtinTools??e.builtinTools),skills:ua(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 BA(e,t){return e.tools===void 0||e.tools.includes(t)}function qA(e,t){return e.builtinTools===void 0||e.builtinTools.includes(t)}function $A(e,t){return e.skills===void 0||e.skills.includes(t)}function ua(e){return e===void 0?void 0:[...e]}function fa(e,t){return(e==null||typeof e!="object"||Array.isArray(e))&&ce(t,"must be an object"),e}function da(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 Sa={enabled:!0};function Sp(e,t=Sa){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 va(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 vp(e){try{let t=e()?.dataContribution?.enabled;return typeof t=="boolean"?t:We.enabled}catch{return We.enabled}}var wp=["none","evaluator","subagent"],Ep=["brief","transcript"],xp=["same-route-small-fast"],kp="goal-verifier-readonly",Cp=[kp],ge={budget:{graceSteps:1},breaker:{repeatedReplyLimit:3},verifier:{repeatedNotMetLimit:5,evidence:"brief"},evaluator:{modelPolicy:"same-route-small-fast",maxTokens:32e3,timeoutSeconds:60,maxRetries:1}},Aa={budget:{graceSteps:3},evaluator:{maxRetries:1}};function _a(e){let t=[],n=Kt(e,"goal",t);Vt(n,"goal",t,["objectiveMaxChars","verification","budget","breaker","verifier","evaluator","subagent"]);let i=Kt(n.budget,"goal.budget",t);Vt(i,"goal.budget",t,["defaultTokens","defaultMainTurns","defaultActiveSeconds","graceSteps"]);let r=Kt(n.breaker,"goal.breaker",t);Vt(r,"goal.breaker",t,["repeatedReplyLimit"]);let o=Kt(n.verifier,"goal.verifier",t);Vt(o,"goal.verifier",t,["repeatedNotMetLimit","evidence"]);let s=Kt(n.evaluator,"goal.evaluator",t);Vt(s,"goal.evaluator",t,["modelPolicy","maxTokens","timeoutSeconds","maxRetries"]);let a=Kt(n.subagent,"goal.subagent",t);Vt(a,"goal.subagent",t,["profile","maxTurns","maxTokens","timeoutSeconds"]);let l=_p(n.verification,"goal.verification",wp,t),c=pt(n.objectiveMaxChars,"goal.objectiveMaxChars",t,{min:1}),u=pt(i.defaultTokens,"goal.budget.defaultTokens",t,{min:1}),f=pt(i.defaultMainTurns,"goal.budget.defaultMainTurns",t,{min:1}),d=pt(i.defaultActiveSeconds,"goal.budget.defaultActiveSeconds",t,{min:1}),p=_p(a.profile,"goal.subagent.profile",Cp,t),h=pt(a.maxTurns,"goal.subagent.maxTurns",t,{min:1}),m=pt(a.maxTokens,"goal.subagent.maxTokens",t,{min:1}),y=pt(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:Yt(i.graceSteps,"goal.budget.graceSteps",ge.budget.graceSteps,t,{min:0,max:Aa.budget.graceSteps})},breaker:{repeatedReplyLimit:Yt(r.repeatedReplyLimit,"goal.breaker.repeatedReplyLimit",ge.breaker.repeatedReplyLimit,t,{min:1})},verifier:{repeatedNotMetLimit:Yt(o.repeatedNotMetLimit,"goal.verifier.repeatedNotMetLimit",ge.verifier.repeatedNotMetLimit,t,{min:1}),evidence:Ap(o.evidence,"goal.verifier.evidence",Ep,ge.verifier.evidence,t)},evaluator:{modelPolicy:Ap(s.modelPolicy,"goal.evaluator.modelPolicy",xp,ge.evaluator.modelPolicy,t),maxTokens:Yt(s.maxTokens,"goal.evaluator.maxTokens",ge.evaluator.maxTokens,t,{min:1}),timeoutSeconds:Yt(s.timeoutSeconds,"goal.evaluator.timeoutSeconds",ge.evaluator.timeoutSeconds,t,{min:1}),maxRetries:Yt(s.maxRetries,"goal.evaluator.maxRetries",ge.evaluator.maxRetries,t,{min:0,max:Aa.evaluator.maxRetries})},...Object.keys(g).length>0?{subagent:g}:{}},warnings:t}}function Kt(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 Vt(e,t,n,i){for(let r of Object.keys(e))i.includes(r)||n.push(He(`${t}.${r}`,"unknown key ignored"))}function Yt(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 pt(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 Ap(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 _p(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 _e={enabled:!0,maxInlineKiB:64,mcpDetailsMaxInlineKiB:32,watermarkKiB:256,minSavingsKiB:256,minCandidateKiB:2,keepRecentRounds:5},jA=Math.floor(Number.MAX_SAFE_INTEGER/1024);function wa(e){let t=KA(e)?e:{};return{enabled:typeof t.enabled=="boolean"?t.enabled:_e.enabled,maxInlineKiB:Bn(t.maxInlineKiB,_e.maxInlineKiB),mcpDetailsMaxInlineKiB:Bn(t.mcpDetailsMaxInlineKiB,_e.mcpDetailsMaxInlineKiB),watermarkKiB:Bn(t.watermarkKiB,_e.watermarkKiB),minSavingsKiB:Bn(t.minSavingsKiB,_e.minSavingsKiB),minCandidateKiB:Bn(t.minCandidateKiB,_e.minCandidateKiB),keepRecentRounds:UA(t.keepRecentRounds,_e.keepRecentRounds)}}function Bn(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0&&e<=jA?e:t}function UA(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function KA(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var gr={image:{max_width:2e3,max_height:2e3,max_base64_bytes:3670016}};function xa(e){let t=Op(e)?e:{},n=Op(t.image)?t.image:{},i=gr.image;return{image:{max_width:Ea(n.max_width)??i.max_width,max_height:Ea(n.max_height)??i.max_height,max_base64_bytes:Math.min(Ea(n.max_base64_bytes)??i.max_base64_bytes,5242880)}}}function Ea(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function Op(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var qn={};function ka(e){if(e==null||typeof e!="object"||Array.isArray(e))return{...qn};let t=Reflect.get(e,"chromePath");return typeof t!="string"||!t.trim()?{...qn}:{chromePath:t.trim()}}import{isIP as VA}from"node:net";function Tp(e){return{enabled:!1,filesystemMode:"full_access"}}function Ip(e){return!e.enabled||e.filesystemMode==="full_access"?{enabled:!1,filesystemMode:"full_access"}:{...e}}function Oa(e){let t=Tp(e);return{enabled:t.enabled,filesystem:{policy:{mode:t.filesystemMode},denyRead:[],denyWrite:[]},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:"open"}}var Ta=Oa(process.platform),YA=new Set(["read_only","workspace_write","delete_guard","full_access"]),GA=new Set(["deny","allow_all"]);function Ia(e,t=process.platform){let n=Oa(t);if(e===void 0)return n;let i=$n(e,"sandbox",["enabled","filesystem","network","localAccess"]),r=i.filesystem===void 0?{}:$n(i.filesystem,"sandbox.filesystem",["policy","denyRead","denyWrite","allowGitConfig"]),o=r.policy===void 0?{}:$n(r.policy,"sandbox.filesystem.policy",["mode"]),s=i.network===void 0?{}:$n(i.network,"sandbox.network",["policy","deniedDomains"]),a=s.policy===void 0?{}:$n(s.policy,"sandbox.network.policy",["mode"]),l=i.enabled===void 0?n.enabled:WA(i.enabled,"sandbox.enabled"),c=o.mode??(l?"delete_guard":"full_access");if(typeof c!="string"||!YA.has(c))throw new Error(`Invalid sandbox.filesystem.policy.mode "${String(c)}"`);let u=a.mode??n.network.policy.mode;if(typeof u!="string"||!GA.has(u))throw new Error(`Invalid sandbox.network.policy.mode "${String(u)}"`);let f=s.deniedDomains===void 0?[...n.network.deniedDomains]:Ca(s.deniedDomains,"sandbox.network.deniedDomains");for(let p of f)HA(p);let d=Ip({enabled:l,filesystemMode:c});return{enabled:d.enabled,filesystem:{policy:{mode:d.filesystemMode},denyRead:r.denyRead===void 0?[...n.filesystem.denyRead]:Ca(r.denyRead,"sandbox.filesystem.denyRead"),denyWrite:r.denyWrite===void 0?[...n.filesystem.denyWrite]:Ca(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 $n(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 WA(e,t){if(typeof e!="boolean")throw new Error(`Invalid ${t}: expected boolean`);return e}function Ca(e,t){if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`Invalid ${t}: expected string array`);return[...e]}function HA(e){let t=()=>{throw new Error(`Invalid sandbox.network.deniedDomains entry "${e}"`)},n=e.match(/^\[([^\]]+)\](?::(.+))?$/);if(n){VA(n[1]??"")!==6&&t(),Mp(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;Mp(o,e),r!=="*"&&(JA(r)||t())}function JA(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 Mp(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 br={maxConcurrentPerSession:4};function Ma(e){let n=(e!=null&&typeof e=="object"&&!Array.isArray(e)?e:{}).maxConcurrentPerSession;return{maxConcurrentPerSession:typeof n=="number"&&Number.isSafeInteger(n)&&n>0?n:br.maxConcurrentPerSession}}function Lp(e,t){return t.length===0?!1:t.includes("*")?!0:t.includes(e)}function ZA(){return process.env.__MAVIS_ALLOW_LEGACY_RUNTIME_ENV==="1"}var Np={dev:"test",test:"test",staging:"staging",prod:"prod"};function e_(e){return e==="cn"||e==="en"}function qp(e){return e==="test"||e==="prod"||e==="dev"||e==="staging"}function $p(){let e=process.env.MAVIS_REGION;if(e_(e))return e;if(vr()){let t=process.env.NEXT_PUBLIC_LOCALE;if(t==="zh")return"cn";if(t==="en")return"en"}return"en"}function Ie(){let e=process.env.MAVIS_BUILD_ENV;if(qp(e))return e;if(vr()){let t=process.env.NEXT_PUBLIC_BUILD_ENV,n=t&&Object.prototype.hasOwnProperty.call(Np,t)?Np[t]:void 0;if(n)return n}return"dev"}function Sr(){if(Up("managed"))return!0;let e=process.env.__MAVIS_RUNTIME_MANAGED;return e==="1"?!0:e==="0"?!1:!!(vr()||Ie()==="prod"||Ie()==="staging")}function vr(){let e=process.versions;return process.env.ELECTRON_RUN_AS_NODE==="1"||typeof e.electron=="string"}function Ar(){return`${$p()}-${Ie()}`}var Oe={none:0,test:1,internal:2,online:3},t_={internal:"internal",inside:"online"};function n_(e){for(let[t,n]of Object.entries(e)){if(Oe[n.defaultVisibility]>Oe[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=t_[i];if(Oe[r]>Oe[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(Oe[i==="prod"?"online":"test"]>Oe[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildEnvironment (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}}var Un={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"}};n_(Un);function i_(e){return(e.buildEnv??Ie())!=="prod"?"test":e.internalBuild===!0?"internal":"online"}function r_(e,t){let n=e.defaultBuildVariants;return n?t.internalBuild===!0&&n.includes("internal")||t.insideBuild===!0&&n.includes("inside"):!1}function o_(e,t){let n=t.defaultBuildEnvironment??t.buildEnv??Pa();return e.defaultBuildEnvironments?.includes(n)===!0}function Pa(){let e=vr()?process.env.NEXT_PUBLIC_BUILD_ENV:void 0;return qp(e)?e:Ie()}function Rp(e,t){return e.defaultPlatforms?.includes(t.platform??process.platform)!==!1}function Da(e,t,n={}){let i=Un[e],r=Oe[i_(n)],o=n.defaultBuildEnvironment??n.buildEnv??Pa();return e==="mcodeTools"&&o==="dev"&&n.mcodeToolsDevMode==="published"&&Rp(i,n)?!0:t===!1?!1:t===!0?r<=Oe[i.configurableVisibility]:Rp(i,n)?o_(i,n)||r_(i,n)?!0:r<=Oe[i.defaultVisibility]:!1}function s_(e){return Un[e].configurableVisibility==="online"}function Fa(e=process.env){return e.__MAVIS_BUILD_INTERNAL==="true"}function a_(e=process.env){return e.__MAVIS_BUILD_INSIDE==="true"}var l_={APP_DIR:".minimax",ENV_PREFIX:"minimax",CLI_NAME:"minimax"},jp="__MAVIS_RUNTIME";function _r(e){return ZA()?process.env[`${jp}_${e}`]:void 0}function wr(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 Up(e){let t=`--${e}`;return process.argv.slice(2).some(n=>n===t||n.startsWith(`${t}=`))}var Gt=5321,Na=5001,La=65535,Kp=500,Ba=2,c_=Kp*Ba,Vp=c_+Ba,Pp=1,u_=new Set(["agent-archon","mavis"]),Dp=(()=>{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 f_(e){let t=Buffer.from(`${e}
|
|
191
|
+
`,"utf-8"),n=0;for(let r of t)n=(Dp[(n>>>24^r)&255]^n<<8)>>>0;let i=t.length;for(;i!==0;)n=(Dp[(n>>>24^i&255)&255]^n<<8)>>>0,i>>>=8;return(n^4294967295)>>>0}function d_(e){return f_(e)%Kp*Ba+2}function Fp(e,t){try{let n=QA("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 p_(e){return e.match(/[/:]([^/:]+?)(?:\.git)?$/)?.[1]??null}function Yp(){return process.env.MINIMAX_DATA_DIR?.trim()||process.env.MAVIS_DATA_DIR?.trim()}function Er(){return!(Up("disable-git-auto-config")||_r("DISABLE_GIT_AUTO_CONFIG")||wr("data-dir")||Yp())}function xr(){let e=wr("profile")??_r("PROFILE");return e&&e.length>0?e:null}function Gp(){let e=wr("port")??_r("PORT"),t=e?parseInt(e,10):NaN;return Number.isNaN(t)?null:t}function Ra(){let e=wr("data-dir")??Yp()??_r("DATA_DIR");return e&&e.length>0?e:null}function m_(){return!!(xr()&&Ra())}function Wp(){return!!(xr()&&Gp()!==null)}var mt=null;function h_(){mt=null}function ht(){if(mt!==null)return mt;let e={runtimePort:Gt,uiPort:Na,profile:null,autoDetected:!1};return mt=e,e}function y_(){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(zA(n))}catch{}let i=/\(?((?:\/|[A-Za-z]:\\)[^()]+?\.(?:cjs|mjs|js|ts)):\d+:\d+\)?/u.exec(t)?.[1];if(i)return oe.dirname(i)}}function g_(){let e=xr();return e||(Er()?ht().profile:null)}function qa(){let e=xr();if(m_())return Ra();if(Er()){let n=ht();if(n.autoDetected&&n.profile)return Ge({profile:n.profile})}let t=Ra();return t||(e?Ge({profile:e}):Ge())}function Xe(){return oe.join(qa(),"config.yaml")}var kr={"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"},Hp=["https://agent.minimaxi.com/mavis/api/v1/llm/v1"],b_=new Set([...Object.values(kr),...Hp]),S_=new Set([...Object.values(kr),...Hp].map(e=>new URL(e).origin));function Jp(e){if(b_.has(e))return!0;try{let t=new URL(e);return!t.username&&!t.password&&S_.has(t.origin)}catch{return!1}}function Xp(){return Ie()==="test"}function v_(){return!Xp()}function A_(e){if(!Sr()||!Te.existsSync(e))return;let t=Qp(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=kr[Ar()];if(o===s||!Jp(o))return;let a=Te.readFileSync(e);r.baseURL=s;try{let l=a.toString("utf-8");ot(e,Pn(l,Rn(l),t))}catch(l){let c=!1;try{c=Te.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:kr[e]},models:rt}},defaultModel:`minimax/${nn}`}}var $a={"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")},V={logLevel:"info",devPort:Na,permissionMode:"auto",skipWindowsHardSafetyChecks:!1,skipParentDeathGuard:!1,sseErrorPush:{history:!0,stream:!0},beta:Object.fromEntries(Object.keys(Un).map(e=>[e,Da(e,void 0,{buildEnv:"dev"})])),agents:{default:{}},memory:{enabled:!0,proactive:!1,dailyDigest:{enabled:!1},v2:{...sr}},subagent:{...br},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:{...dr},skills:mr,askUser:{...Sa},dataContribution:{...We},sessionTitle:{enabled:!0},cli:{spawn:{enabled:!1}},browser:{...qn},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:{..._e},requestMedia:{...gr},agentRuntime:{defaultFramework:jt},logRetentionDays:3,worktreeRefreshBeforeCreate:!0,review:{mode:"subagent",turnDiffCard:"concise",modeSource:"default"},goal:structuredClone(ge),sandbox:structuredClone(Ta),goalWarnings:[]};function __(){let e=Xe(),t=oe.dirname(e);if(Te.existsSync(t)||Te.mkdirSync(t,{recursive:!0}),Te.existsSync(e)){Ua(e);return}if(!Sr()){let r=Ge({homeDir:XA.homedir()}),o=oe.join(r,"config.yaml");e!==o&&Te.existsSync(o)&&(kt(o),ot(e,Te.readFileSync(o),!0));return}let n=$a[Ar()],i=U.dump({logLevel:V.logLevel,provider:ja?n.provider:void 0,defaultModel:n.defaultModel,dataContribution:{enabled:We.enabled},memory:{enabled:!1},skipWindowsHardSafetyChecks:V.skipWindowsHardSafetyChecks,skipParentDeathGuard:V.skipParentDeathGuard});ot(e,i,!0)}function Qp(e=Xe()){return Rn(w_(e))}function w_(e=Xe()){try{return Te.readFileSync(e,"utf-8")}catch{return""}}var jn=null;function E_(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e;return{branchFinish:typeof t.branchFinish=="boolean"?t.branchFinish:!1}}var zp={isManagedRuntime:Sr,shouldEnforceManagedProviderProtection:v_,getManagedPreset:()=>$a[Ar()],isManagedPresetBaseUrl:Jp},Zp=!0,ja=!0;function x_(e){Zp=e}function k_(e){ja=e}function Ua(e){kt(e),Hd(e),Zp&&Gd(e,zp),ja&&A_(e)}function Cr(){jn=null}function Or(){if(jn)return jn;__();let e=Qp();return jn=Ka(e,qa()),jn}function Ka(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:V.devPort;if(Er()&&!Wp()){let c=ht();c.autoDetected&&(r=c.uiPort)}let o=_a(e.goal),s=Wd({provider:e.provider!=null&&typeof e.provider=="object"&&!Array.isArray(e.provider)?Ud(e.provider):{},defaultModel:typeof e.defaultModel=="string"?e.defaultModel:void 0},zp),a=ea(e.minimaxModelContextLimits),l=C_(e);return{logLevel:typeof e.logLevel=="string"?e.logLevel:V.logLevel,devPort:r,...s,provider:$d(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:Bd(e.minimax_api),minimaxModelContextLimits:a,custom_provider:jd(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,skipParentDeathGuard:e.skipParentDeathGuard===!0,permissionMode:typeof e.permissionMode=="string"&&["default","bypassPermissions","auto","off"].includes(e.permissionMode)?e.permissionMode:V.permissionMode,permission:Zd(e),sseErrorPush:{history:typeof i?.history=="boolean"?i.history:V.sseErrorPush.history,stream:typeof i?.stream=="boolean"?i.stream:V.sseErrorPush.stream},notifications:E_(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:ba(e.agents),memory:Nd(e,V.memory),subagent:Ma(e.subagent),skillEvolve:I_(e,l),sessionRotate:M_(e),agentStop:L_(e),asr:zd(e),skills:na(e),askUser:Sp(e,V.askUser),dataContribution:va(e,V.dataContribution),sessionTitle:N_(e),cli:R_(e),browser:ka(e.browser),tui:Rd(e),opencode:Xd(e,V.opencode),contextManagement:P_(e),runawayGuard:fo(e.runawayGuard),toolResultCompaction:wa(e.toolResultCompaction),requestMedia:xa(e.requestMedia),agentRuntime:ia(e.agentRuntime),logRetentionDays:D_(e),contentReview:F_(e),mcpToolSearch:B_(e),review:Jd(e.review,V.review),worktreeRefreshBeforeCreate:e.worktreeRefreshBeforeCreate!==!1,promptConfig:em(e.promptConfig),goal:o.config,goalWarnings:o.warnings,sandbox:Ia(e.sandbox)}}function C_(e){let t=e.beta!=null&&typeof e.beta=="object"&&!Array.isArray(e.beta)?e.beta:{},n={buildEnv:Ie(),defaultBuildEnvironment:Pa(),internalBuild:Fa(),insideBuild:a_(),mcodeToolsDevMode:process.env.MAVIS_DEV_MCODE_TOOLS_MODE==="published"?"published":void 0},i={};for(let r of Object.keys(Un))i[r]=Da(r,t[r],n);return i}function O_(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 T_(e,t){if(t.length===0)return!0;let n=O_(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 Bp(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function I_(e,t){let n=V.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:T_(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=Bp(_.staleThresholdDays,n.lifecycle.staleThresholdDays),O=Bp(_.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 M_(e){let t=V.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 L_(e){let t=V.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 em(e){let t=Ie()==="prod"&&!Fa();if(e==null||typeof e!="object"||Array.isArray(e))return{autoUpdate:t};let n=e.autoUpdate;return{autoUpdate:typeof n=="boolean"?n:t}}function N_(e){let t=V.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 R_(e){let t=V.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 P_(e){let t=V.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 D_(e){let t=e.logRetentionDays;return typeof t=="number"&&t>=1&&Number.isFinite(t)?Math.floor(t):V.logRetentionDays}function F_(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 B_(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 tm(){let e=Gp();if(Er()&&!Wp()){let t=ht();if(t.autoDetected)return t.runtimePort}return e??Gt}function q_(e=tm()){let t=e+Vp;if(t<=La)return t;let n=e+Pp;if(n<=La)return n;throw new Error(`Cannot allocate an OpenCode sidecar port for runtime port ${String(e)}; choose a runtime port <= ${String(La-Pp)}.`)}import $_ from"node:fs";var Va=Object.freeze({stopSubAgent:!0,stopAsyncBash:!0}),j_=["stopSubAgent","stopAsyncBash"];function Ir(e){let t=nm(e.conversation)?e.conversation:{},n={...Va},i={stopSubAgent:"default",stopAsyncBash:"default"},r=[];for(let o of j_){let s=t[o];typeof s=="boolean"?(n[o]=s,i[o]="explicit"):s!==void 0&&r.push(o)}return{...n,policySource:i,...r.length>0?{ignoredKeys:r}:{}}}function U_(e){let t;try{t=e??Xe()}catch{return Tr({reason:"path_error"})}let n;try{n=$_.readFileSync(t,"utf8")}catch(r){let o=K_(r);return o==="ENOENT"?{...Ir({}),configPath:t}:Tr({reason:"read_error",...o?{errorCode:o}:{}},t)}let i;try{i=U.load(n)}catch(r){let o=V_(r);return Tr({reason:"yaml_error",...o?{line:o}:{}},t)}return i==null?{...Ir({}),configPath:t}:nm(i)?{...Ir(i),configPath:t}:Tr({reason:"not_a_mapping"},t)}function Tr(e,t){return{...Va,policySource:{stopSubAgent:"read_failed",stopAsyncBash:"read_failed"},failure:e,...t?{configPath:t}:{}}}function nm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function K_(e){let t=e?.code;return typeof t=="string"?t:void 0}function V_(e){let t=e?.mark?.line;return typeof t=="number"&&Number.isInteger(t)&&t>=0?t+1:void 0}var Y_=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Ya(e){if(typeof e=="string")return Y_.exec(e.trim())?.[1]}function im(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 ${H_(i)}.`);let r=i.trim();if(!r)return;let o=Ya(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 G_(e){if(!(typeof e.value=="string"&&e.value.trim().length>0))return{configured:!1};let n=W_(e.value)?"env":"plaintext";try{let i=im(e);return{configured:!0,source:n,...i?{secret:i}:{}}}catch{return{configured:!0,source:n}}}function W_(e){return Ya(e)!==void 0}function H_(e){return Array.isArray(e)?"a list":`a ${typeof e}`}import{randomBytes as J_}from"node:crypto";import yt,{readFileSync as X_}from"node:fs";import{dirname as rm,join as Q_}from"node:path";var om=Rr(co(),1);var Wa=384,Mr=new Set(["__proto__","prototype","constructor"]),z_=["minimax_api","custom_provider"];async function Z_(e){let t=e.trim();if(!t||t.includes(".")||Mr.has(t))throw new ne("Invalid provider id");return Vn(async n=>(me(n.provider)&&delete n.provider[t],{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function ew(e){if(!me(e)||!me(e.models))throw new ne("Invalid managed MiniMax provider snapshot");return Lr(e),Vn(async t=>(t.provider={...me(t.provider)?t.provider:{},[pe]:structuredClone(e)},{write:!0,value:tw(t,e)})).then(({config:t,value:n})=>({config:t,replacedDefaults:n}))}function tw(e,t){let i=$t(t);if(!i)return[];let r=new Set(Object.entries(t.models).filter(([,s])=>!(me(s)&&s.enabled===!1)).map(([s])=>s)),o=[];for(let s of["defaultModel","defaultLightModel"]){let a=e[s];if(typeof a!="string")continue;let l=a.indexOf("/"),c=l>0?a.slice(0,l):"",u=a.slice(l+1).trim();if(c!==pe&&c!==dt||!u||r.has(u))continue;let f=`${c}/${i}`;e[s]=f,s==="defaultModel"&&(delete e.defaultModelVariant,delete e.defaultModelThinking,delete e.defaultModelContextWindow),o.push({field:s,from:a,to:f})}return o}var ne=class extends Error{name="LocalModelProviderConfigValidationError"},Kn=class extends Error{name="LocalModelProviderConfigWriteError";constructor(){super("Local runtime failed to update config file")}};async function nw(e){return Vn(async(t,n)=>{let i={minimax_api:me(t.minimax_api)?t.minimax_api:void 0,custom_provider:aw(me(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 z_){let o=i[r];if(o===void 0){delete t[r];continue}if(!me(o))throw new ne(`Invalid BYOK config subtree "${r}"`);Lr(o),t[r]=o}return Ga(t,"minimaxModelSource",i.minimaxModelSource),t.defaultModel!==i.defaultModel&&(delete t.defaultModelThinking,delete t.defaultModelContextWindow),Ga(t,"defaultModel",i.defaultModel),Ga(t,"defaultModelVariant",i.defaultModelVariant),{write:!0,value:void 0}}).then(({config:t})=>({config:t}))}async function iw(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 Vn(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 rw(e,t){let n=e.modelId.trim();if(e.providerId!==pe&&e.providerId!==dt||!n||Mr.has(n))throw new ne("Invalid MiniMax model context target");let i=await Vn(async(r,o)=>{let s=e.providerId===pe?o.provider?.[e.providerId]?.models?.[n]:ta(o)[n];if(e.providerId===dt&&!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===pe?["minimaxModelContextLimits",n]:["minimax_api","modelContextLimits",n];return lw(r,a,e.contextLimit),{write:!0,value:!0}});return{config:i.config,updated:i.value}}async function Vn(e){let t=Xe(),n;try{await yt.promises.mkdir(rm(t),{recursive:!0}),await yt.promises.writeFile(t,"",{flag:"a",mode:Wa}),await yt.promises.chmod(t,Wa),n=await om.default.lock(t,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let i=sw(t),r=structuredClone(i);Cr();let o=await e(r,Or());return o.write&&(Lr(r),await ow(t,Pn(X_(t,"utf-8"),i,r)),Cr()),{config:Or(),value:o.value}}catch(i){throw i instanceof ne||i instanceof Kn?i:new Kn}finally{await n?.().catch(()=>{})}}async function ow(e,t){let n=Q_(rm(e),`.config-tmp-${J_(6).toString("hex")}`),i=!1;try{let r=Wa,o=await yt.promises.open(n,"wx",r);i=!0;try{await o.writeFile(t,"utf-8"),await o.chmod(r)}finally{await o.close()}await yt.promises.rename(n,e)}catch{throw i&&await yt.promises.unlink(n).catch(()=>{}),new Kn}}function sw(e){let t=yt.readFileSync(e,"utf-8"),n;try{n=U.load(t)}catch{throw new ne("Invalid config.yaml: unable to parse YAML")}if(n==null)return{};if(!me(n)||Object.getPrototypeOf(n)!==Object.prototype)throw new ne("Invalid config.yaml: expected a YAML mapping");return n}function aw(e){if(e)return Object.fromEntries(Object.entries(e).filter(([,t])=>me(t)))}function Ga(e,t,n){n===void 0?delete e[t]:e[t]=n}function lw(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||Mr.has(o))throw new ne("Invalid config path");let s=r[o];if(me(s))r=s;else{let a={};r[o]=a,r=a}}r[i]=n}function Lr(e){for(let[t,n]of Object.entries(e)){if(!t||Mr.has(t))throw new ne(`Local runtime cannot update config field segment "${t}"`);me(n)&&Lr(n)}}function me(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function bw(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=Sw(i.owner)?i.owner:"unknown",s=vw(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 Sw(e){return e==="electron"||e==="cli"||e==="unknown"}function vw(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 Aw(e,t){let n={pid:e,owner:t,startedAt:Date.now()};return JSON.stringify(n)}function _w(){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 Qe from"node:fs";import ww from"node:path";var sm="local-runtime.auth.json";function we(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function Ha(e){return e?{...we(e.accessToken)?{accessToken:we(e.accessToken)}:{},...we(e.realUserID)?{realUserID:we(e.realUserID)}:{},...we(e.userEmail)?{userEmail:we(e.userEmail)}:{},...we(e.userName)?{userName:we(e.userName)}:{},...we(e.subUserName)?{subUserName:we(e.subUserName)}:{}}:{}}function Nr(e){return ww.join(e,sm)}function Ew(e){try{let t=Qe.readFileSync(Nr(e),"utf-8"),n=JSON.parse(t);if(n.version!==1||!n.auth||typeof n.auth!="object")return;let i=Ha(n.auth);return i.accessToken?i:void 0}catch{return}}function xw(e,t,n={}){let i=Nr(e),r=Ha(t);if(!r.accessToken)return am(e),{path:i,written:!1};Qe.mkdirSync(e,{recursive:!0,mode:448});let o={version:1,updatedAtMs:Date.now(),auth:r},s=`${i}.${process.pid}.${Date.now()}.tmp`;return Qe.writeFileSync(s,`${JSON.stringify(o,null,2)}
|
|
193
|
+
`,{encoding:"utf-8",mode:384}),n.retryWindowsFileSystem?(Pr(()=>Qe.renameSync(s,i)),Pr(()=>Qe.chmodSync(i,384))):(Qe.renameSync(s,i),Qe.chmodSync(i,384)),{path:i,written:!0}}function am(e){try{Qe.rmSync(Nr(e),{force:!0})}catch{}}import lm from"node:net";var cm={"e2e-runtime":5e3,"e2e-ui":5500,"smoke-runtime":7e3},Ja=100;async function kw(e,t={}){let n=t.isPortFree??Ow,i=t.getFreePort??Tw,r=t.getWorktreeBasePort??Cw,o=r()+cm[e],s=o-r();if(s<Ja)throw new Error(`pickTestPort(${e}): role offset ${s} collides with app runtime (0); must be >= ${Ja}.`);return o>65535?i():await n(o)?o:i()}function Cw(){let e=ht();return e.autoDetected?e.runtimePort:Gt}async function Ow(e){return new Promise(t=>{let n=lm.createServer();n.once("error",()=>t(!1)),n.listen(e,"127.0.0.1",()=>{n.close(()=>t(!0))})})}async function Tw(){return new Promise((e,t)=>{let n=lm.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 um from"node:fs";var Wt=class extends Error{code;configPath;constructor(t,n,i,r){super(i,r),this.name="ConfigFileError",this.code=t,this.configPath=n}};function fm(e){let t;try{t=um.readFileSync(e,"utf-8")}catch(i){throw new Wt("CONFIG_READ_FAILED",e,`Cannot read config ${e}.`,{cause:i})}let n;try{n=U.load(t)}catch(i){throw new Wt("CONFIG_PARSE_FAILED",e,`Config is not valid YAML: ${e}`,{cause:i})}if(n==null||typeof n!="object"||Array.isArray(n))throw new Wt("CONFIG_ROOT_INVALID",e,`Config root must be an object: ${e}`);return n}function Iw(e,t){return um.existsSync(e)&&Ua(e),Ka(fm(e),t.dataDir)}function Mw(e,t){let n=fm(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{co as a,Nw as b,Rw as c,dm as d,U as e,cg as f,uo as g,fo as h,xd as i,Rn as j,Pn as k,qt as l,sr as m,Uv as n,Gv as o,Xs as p,Qs as q,pe as r,dt as s,zs as t,Hv as u,Fn as v,ar as w,Jv as x,Pd as y,$t as z,Xv as A,ta as B,mr as C,na as D,AA as E,tp as F,jt as G,np as H,ia as I,lp as J,cp as K,fp as L,dp as M,Ge as N,IA as O,MA as P,ha as Q,ya as R,ga as S,hp as T,ba as U,PA as V,FA as W,BA as X,qA as Y,$A as Z,We as _,va as $,vp as aa,wp as ba,Ep as ca,xp as da,kp as ea,Cp as fa,ge as ga,Aa as ha,_a as ia,_e as ja,wa as ka,gr as la,xa as ma,qn as na,ka as oa,Ip as pa,Oa as qa,Ta as ra,Ia as sa,br as ta,Ma as ua,Lp as va,$p as wa,Ie as xa,Sr as ya,Ar as za,Da as Aa,s_ as Ba,Fa as Ca,l_ as Da,jp as Ea,Gt as Fa,Vp as Ga,h_ as Ha,ht as Ia,g_ as Ja,qa as Ka,Xe as La,Xp as Ma,$a as Na,x_ as Oa,k_ as Pa,Cr as Qa,Or as Ra,em as Sa,tm as Ta,q_ as Ua,Va,Ir as Wa,U_ as Xa,Ya,im as Za,G_ as _a,Z_ as $a,ew as ab,nw as bb,iw as cb,rw as db,bw as eb,Aw as fb,_w as gb,sm as hb,Ha as ib,Nr as jb,Ew as kb,xw as lb,am as mb,cm as nb,Ja as ob,kw as pb,Wt as qb,Iw as rb,Mw as sb};
|