@yukino.js/yukino 0.0.20 → 0.0.21-dev

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.
Files changed (35) hide show
  1. package/README.md +12 -38
  2. package/dist/anthropic-LB4T3BEN.js +4 -0
  3. package/dist/browser/dist/index.html +2 -2
  4. package/dist/browser/dist/static/chunk-3HWUJ4KR.js +1 -0
  5. package/dist/browser/dist/static/{highlight-ZDY7K2CR.js → highlight-KNDEBJWF.js} +10 -10
  6. package/dist/browser/dist/static/index.css +1 -1
  7. package/dist/browser/dist/static/index.js +40 -40
  8. package/dist/{chunk-3V2Q65BE.js → chunk-2N7OIUQW.js} +197 -198
  9. package/dist/{chunk-LUBMW3QT.js → chunk-57IGGFHK.js} +5 -5
  10. package/dist/{chunk-Q6322VDG.js → chunk-5AOJ5ZSQ.js} +20 -20
  11. package/dist/chunk-5D3QKHYQ.js +36 -0
  12. package/dist/{chunk-FK5B4XFN.js → chunk-7WP7SERS.js} +1 -1
  13. package/dist/{chunk-SLZKGKP5.js → chunk-EQABLL4S.js} +1 -1
  14. package/dist/{chunk-T3MBBXTU.js → chunk-P6K7EQHF.js} +29 -29
  15. package/dist/{chunk-D64ZLLSN.js → chunk-WKTO7XPO.js} +1 -1
  16. package/dist/lib/{anthropic-UZXEGJN5.js → anthropic-TYBMDJP3.js} +3 -3
  17. package/dist/lib/{chunk-6RBU5LDC.js → chunk-3QGT2MSI.js} +0 -42
  18. package/dist/lib/{chunk-V3WAJBLN.js → chunk-IPKULHXR.js} +2 -2
  19. package/dist/lib/{chunk-FHJHT233.js → chunk-NIUCGP4C.js} +80 -238
  20. package/dist/lib/{chunk-2QPNVR5H.js → chunk-OPEO6D4O.js} +2 -5
  21. package/dist/lib/{chunk-Y3EO3KLE.js → chunk-XVXFUSSS.js} +2 -2
  22. package/dist/lib/index.d.ts +616 -819
  23. package/dist/lib/index.js +666 -1441
  24. package/dist/lib/{openai-DNNUHOKV.js → openai-Z2JCYL6F.js} +3 -3
  25. package/dist/lib/{providers-NBWCB4EA.js → providers-2NPR2VR4.js} +2 -2
  26. package/dist/{main-IEQSD5OX.js → main-OMIZDIYB.js} +221 -221
  27. package/dist/main.js +2 -2
  28. package/dist/{openai-SRAHPUVF.js → openai-UOCUBMFA.js} +1 -1
  29. package/dist/{providers-ETXXDQGM.js → providers-G5SKN22T.js} +1 -1
  30. package/dist/server-ESDMJACZ.js +14 -0
  31. package/dist/{server-N2WSM46R.js → server-Z742CQSK.js} +1 -1
  32. package/package.json +4 -4
  33. package/dist/anthropic-XJSWCDJD.js +0 -4
  34. package/dist/chunk-ZZF3DILS.js +0 -38
  35. package/dist/server-HXOWUX6N.js +0 -14
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __yukinoCreateRequire } from "node:module";
3
+ const require = __yukinoCreateRequire(import.meta.url);
4
+ import{Pa as Pn,a as kn,e as Nn,h as Rn,j as Fe,m as Mn,zc as Ze}from"./chunk-5AOJ5ZSQ.js";import{B as A,b as Qe}from"./chunk-QSKJBSCI.js";var ie=["off","minimal","low","medium","high","xhigh","max"],Fn="high";var Dn={minimal:1024,low:2048,medium:8192,high:16384,xhigh:32768,max:65536},Yn=1024,jn=1024,en={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","openai-compat":"OPENAI_API_KEY"},Un=new Set(Object.keys(en)),Hn=["auto","eager","native","dispatch"],qn=["auto","dark","light"],De="config.yaml",Bn=".mcp.json",Kn="At least one provider MUST be configured.",nn="YAML parse error";function se(){return Mn(De)}var ue=A.enum(["none","minimal","low","medium","high","xhigh","max"]),ei=A.enum(["low","medium","high","xhigh","max"]),ni=A.strictObject({off:A.literal("none").nullable().optional(),minimal:ue.nullable().optional(),low:ue.nullable().optional(),medium:ue.nullable().optional(),high:ue.nullable().optional(),xhigh:ue.nullable().optional(),max:ue.nullable().optional()}),Se=A.looseObject({name:A.string(),protocol:A.enum(["anthropic","openai","openai-compat"]),base_url:A.string(),model:A.string(),api_key:A.string().optional(),thinking:A.enum(ie).optional(),reasoning:A.boolean().optional(),thinking_level_map:ni.optional(),thinking_mode:A.enum(["budget","adaptive"]).optional(),context_window:A.coerce.number().optional(),max_output_tokens:A.coerce.number().optional()});function ji(r,i){return r[i]??r[0]}function Ui(r){return ie.some(i=>i===r)}function rn(r){return ti(r,r.thinking??Fn)}function ri(r){return r==="off"?0:Dn[r]}function Hi(r,i){let c=on(i,r);return c===null||c==="none"?0:ri(c)}function on(r,i){if(i?.reasoning===!1)return null;if(r==="off")return"none";let c=i?.thinking_level_map?.[r];if(c!==void 0)return c;if(i?.protocol==="anthropic"&&i.thinking_mode==="adaptive"){if(r==="minimal")return"low";if(r==="xhigh")return"high"}return r}function ii(r,i){let c=ei.safeParse(on(r,i));return c.success?c.data:null}function oi(r){return r.reasoning===!1||r.protocol==="anthropic"&&r.thinking_mode!=="adaptive"&&Vn(r)<Yn+jn?["off"]:ie.filter(i=>{if(i==="off")return!0;if(r.protocol==="anthropic"&&r.thinking_mode==="adaptive")return ii(i,r)!==null;let c=on(i,r);return c!==null&&c!=="none"})}function ti(r,i){let c=oi(r),g="off";for(let l of ie)if(c.includes(l)&&(g=l),l===i)break;return g}function Gn(r){return{...r,thinking:rn(r),context_window:$n(r),max_output_tokens:Vn(r)}}function $n(r){return Number.isSafeInteger(r.context_window)&&(r.context_window??0)>0?r.context_window??1e6:1e6}function Vn(r){let i=r.max_output_tokens,c=Number.isSafeInteger(i)&&(i??0)>0?i??128e3:128e3;return Math.min(c,$n(r))}import{randomUUID as di}from"crypto";import{existsSync as Dr,renameSync as hi,unlinkSync as mi}from"fs";import{dirname as gi,join as yi}from"path";function ci(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Y={},Ue={},ee={},zn;function xe(){if(zn)return ee;zn=1;function r(h){return typeof h>"u"||h===null}function i(h){return typeof h=="object"&&h!==null}function c(h){return Array.isArray(h)?h:r(h)?[]:[h]}function g(h,u){if(u){let x=Object.keys(u);for(let s=0,p=x.length;s<p;s+=1){let b=x[s];h[b]=u[b]}}return h}function l(h,u){let x="";for(let s=0;s<u;s+=1)x+=h;return x}function d(h){return h===0&&Number.NEGATIVE_INFINITY===1/h}return ee.isNothing=r,ee.isObject=i,ee.toArray=c,ee.repeat=l,ee.isNegativeZero=d,ee.extend=g,ee}var tn,Wn;function Te(){if(Wn)return tn;Wn=1;function r(c,g){let l="",d=c.reason||"(unknown reason)";return c.mark?(c.mark.name&&(l+='in "'+c.mark.name+'" '),l+="("+(c.mark.line+1)+":"+(c.mark.column+1)+")",!g&&c.mark.snippet&&(l+=`
5
+
6
+ `+c.mark.snippet),d+" "+l):d}function i(c,g){Error.call(this),this.name="YAMLException",this.reason=c,this.mark=g,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(g){return this.name+": "+r(this,g)},tn=i,tn}var ln,Xn;function ui(){if(Xn)return ln;Xn=1;let r=xe();function i(l,d,h,u,x){let s="",p="",b=Math.floor(x/2)-1;return u-d>b&&(s=" ... ",d=u-b+s.length),h-u>b&&(p=" ...",h=u+b-p.length),{str:s+l.slice(d,h).replace(/\t/g,"\u2192")+p,pos:u-d+s.length}}function c(l,d){return r.repeat(" ",d-l.length)+l}function g(l,d){if(d=Object.create(d||null),!l.buffer)return null;d.maxLength||(d.maxLength=79),typeof d.indent!="number"&&(d.indent=1),typeof d.linesBefore!="number"&&(d.linesBefore=3),typeof d.linesAfter!="number"&&(d.linesAfter=2);let h=/\r?\n|\r|\0/g,u=[0],x=[],s,p=-1;for(;s=h.exec(l.buffer);)x.push(s.index),u.push(s.index+s[0].length),l.position<=s.index&&p<0&&(p=u.length-2);p<0&&(p=u.length-1);let b="",O=Math.min(l.line+d.linesAfter,x.length).toString().length,R=d.maxLength-(d.indent+O+3);for(let M=1;M<=d.linesBefore&&!(p-M<0);M++){let K=i(l.buffer,u[p-M],x[p-M],l.position-(u[p]-u[p-M]),R);b=r.repeat(" ",d.indent)+c((l.line-M+1).toString(),O)+" | "+K.str+`
7
+ `+b}let z=i(l.buffer,u[p],x[p],l.position,R);b+=r.repeat(" ",d.indent)+c((l.line+1).toString(),O)+" | "+z.str+`
8
+ `,b+=r.repeat("-",d.indent+O+3+z.pos)+`^
9
+ `;for(let M=1;M<=d.linesAfter&&!(p+M>=x.length);M++){let K=i(l.buffer,u[p+M],x[p+M],l.position-(u[p]-u[p+M]),R);b+=r.repeat(" ",d.indent)+c((l.line+M+1).toString(),O)+" | "+K.str+`
10
+ `}return b.replace(/\n$/,"")}return ln=g,ln}var cn,Jn;function j(){if(Jn)return cn;Jn=1;let r=Te(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],c=["scalar","sequence","mapping"];function g(d){let h={};return d!==null&&Object.keys(d).forEach(function(u){d[u].forEach(function(x){h[String(x)]=u})}),h}function l(d,h){if(h=h||{},Object.keys(h).forEach(function(u){if(i.indexOf(u)===-1)throw new r('Unknown option "'+u+'" is met in definition of "'+d+'" YAML type.')}),this.options=h,this.tag=d,this.kind=h.kind||null,this.resolve=h.resolve||function(){return!0},this.construct=h.construct||function(u){return u},this.instanceOf=h.instanceOf||null,this.predicate=h.predicate||null,this.represent=h.represent||null,this.representName=h.representName||null,this.defaultStyle=h.defaultStyle||null,this.multi=h.multi||!1,this.styleAliases=g(h.styleAliases||null),c.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+d+'" YAML type.')}return cn=l,cn}var un,Qn;function Ar(){if(Qn)return un;Qn=1;let r=Te(),i=j();function c(d,h){let u=[];return d[h].forEach(function(x){let s=u.length;u.forEach(function(p,b){p.tag===x.tag&&p.kind===x.kind&&p.multi===x.multi&&(s=b)}),u[s]=x}),u}function g(){let d={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function h(u){u.multi?(d.multi[u.kind].push(u),d.multi.fallback.push(u)):d[u.kind][u.tag]=d.fallback[u.tag]=u}for(let u=0,x=arguments.length;u<x;u+=1)arguments[u].forEach(h);return d}function l(d){return this.extend(d)}return l.prototype.extend=function(h){let u=[],x=[];if(h instanceof i)x.push(h);else if(Array.isArray(h))x=x.concat(h);else if(h&&(Array.isArray(h.implicit)||Array.isArray(h.explicit)))h.implicit&&(u=u.concat(h.implicit)),h.explicit&&(x=x.concat(h.explicit));else throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");u.forEach(function(p){if(!(p instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(p.loadKind&&p.loadKind!=="scalar")throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(p.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),x.forEach(function(p){if(!(p instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let s=Object.create(l.prototype);return s.implicit=(this.implicit||[]).concat(u),s.explicit=(this.explicit||[]).concat(x),s.compiledImplicit=c(s,"implicit"),s.compiledExplicit=c(s,"explicit"),s.compiledTypeMap=g(s.compiledImplicit,s.compiledExplicit),s},un=l,un}var sn,Zn;function Er(){if(Zn)return sn;Zn=1;let r=j();return sn=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),sn}var fn,er;function Sr(){if(er)return fn;er=1;let r=j();return fn=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),fn}var an,nr;function xr(){if(nr)return an;nr=1;let r=j();return an=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),an}var pn,rr;function Tr(){if(rr)return pn;rr=1;let r=Ar();return pn=new r({explicit:[Er(),Sr(),xr()]}),pn}var dn,ir;function vr(){if(ir)return dn;ir=1;let r=j();function i(l){if(l===null)return!0;let d=l.length;return d===1&&l==="~"||d===4&&(l==="null"||l==="Null"||l==="NULL")}function c(){return null}function g(l){return l===null}return dn=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:c,predicate:g,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),dn}var hn,or;function br(){if(or)return hn;or=1;let r=j();function i(l){if(l===null)return!1;let d=l.length;return d===4&&(l==="true"||l==="True"||l==="TRUE")||d===5&&(l==="false"||l==="False"||l==="FALSE")}function c(l){return l==="true"||l==="True"||l==="TRUE"}function g(l){return Object.prototype.toString.call(l)==="[object Boolean]"}return hn=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:c,predicate:g,represent:{lowercase:function(l){return l?"true":"false"},uppercase:function(l){return l?"TRUE":"FALSE"},camelcase:function(l){return l?"True":"False"}},defaultStyle:"lowercase"}),hn}var mn,tr;function Cr(){if(tr)return mn;tr=1;let r=xe(),i=j();function c(s){return s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102}function g(s){return s>=48&&s<=55}function l(s){return s>=48&&s<=57}function d(s){if(s===null)return!1;let p=s.length,b=0,O=!1;if(!p)return!1;let R=s[b];if((R==="-"||R==="+")&&(R=s[++b]),R==="0"){if(b+1===p)return!0;if(R=s[++b],R==="b"){for(b++;b<p;b++){if(R=s[b],R!=="0"&&R!=="1")return!1;O=!0}return O&&isFinite(h(s))}if(R==="x"){for(b++;b<p;b++){if(!c(s.charCodeAt(b)))return!1;O=!0}return O&&isFinite(h(s))}if(R==="o"){for(b++;b<p;b++){if(!g(s.charCodeAt(b)))return!1;O=!0}return O&&isFinite(h(s))}}for(;b<p;b++){if(!l(s.charCodeAt(b)))return!1;O=!0}return O?isFinite(h(s)):!1}function h(s){let p=s,b=1,O=p[0];if((O==="-"||O==="+")&&(O==="-"&&(b=-1),p=p.slice(1),O=p[0]),p==="0")return 0;if(O==="0"){if(p[1]==="b")return b*parseInt(p.slice(2),2);if(p[1]==="x")return b*parseInt(p.slice(2),16);if(p[1]==="o")return b*parseInt(p.slice(2),8)}return b*parseInt(p,10)}function u(s){return h(s)}function x(s){return Object.prototype.toString.call(s)==="[object Number]"&&s%1===0&&!r.isNegativeZero(s)}return mn=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:d,construct:u,predicate:x,represent:{binary:function(s){return s>=0?"0b"+s.toString(2):"-0b"+s.toString(2).slice(1)},octal:function(s){return s>=0?"0o"+s.toString(8):"-0o"+s.toString(8).slice(1)},decimal:function(s){return s.toString(10)},hexadecimal:function(s){return s>=0?"0x"+s.toString(16).toUpperCase():"-0x"+s.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),mn}var gn,lr;function wr(){if(lr)return gn;lr=1;let r=xe(),i=j(),c=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),g=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function l(s){return s===null||!c.test(s)?!1:isFinite(parseFloat(s,10))?!0:g.test(s)}function d(s){let p=s.toLowerCase(),b=p[0]==="-"?-1:1;return"+-".indexOf(p[0])>=0&&(p=p.slice(1)),p===".inf"?b===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:p===".nan"?NaN:b*parseFloat(p,10)}let h=/^[-+]?[0-9]+e/;function u(s,p){if(isNaN(s))switch(p){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===s)switch(p){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===s)switch(p){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(s))return"-0.0";let b=s.toString(10);return h.test(b)?b.replace("e",".e"):b}function x(s){return Object.prototype.toString.call(s)==="[object Number]"&&(s%1!==0||r.isNegativeZero(s))}return gn=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:l,construct:d,predicate:x,represent:u,defaultStyle:"lowercase"}),gn}var yn,cr;function Ir(){return cr||(cr=1,yn=Tr().extend({implicit:[vr(),br(),Cr(),wr()]})),yn}var _n,ur;function Lr(){return ur||(ur=1,_n=Ir()),_n}var An,sr;function Or(){if(sr)return An;sr=1;let r=j(),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),c=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 g(h){return h===null?!1:i.exec(h)!==null||c.exec(h)!==null}function l(h){let u=0,x=null,s=i.exec(h);if(s===null&&(s=c.exec(h)),s===null)throw new Error("Date resolve error");let p=+s[1],b=+s[2]-1,O=+s[3];if(!s[4])return new Date(Date.UTC(p,b,O));let R=+s[4],z=+s[5],M=+s[6];if(s[7]){for(u=s[7].slice(0,3);u.length<3;)u+="0";u=+u}if(s[9]){let ne=+s[10],U=+(s[11]||0);x=(ne*60+U)*6e4,s[9]==="-"&&(x=-x)}let K=new Date(Date.UTC(p,b,O,R,z,M,u));return x&&K.setTime(K.getTime()-x),K}function d(h){return h.toISOString()}return An=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:g,construct:l,instanceOf:Date,represent:d}),An}var En,fr;function kr(){if(fr)return En;fr=1;let r=j();function i(c){return c==="<<"||c===null}return En=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i}),En}var Sn,ar;function Nr(){if(ar)return Sn;ar=1;let r=j(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
11
+ \r`;function c(h){if(h===null)return!1;let u=0,x=h.length,s=i;for(let p=0;p<x;p++){let b=s.indexOf(h.charAt(p));if(!(b>64)){if(b<0)return!1;u+=6}}return u%8===0}function g(h){let u=h.replace(/[\r\n=]/g,""),x=u.length,s=i,p=0,b=[];for(let R=0;R<x;R++)R%4===0&&R&&(b.push(p>>16&255),b.push(p>>8&255),b.push(p&255)),p=p<<6|s.indexOf(u.charAt(R));let O=x%4*6;return O===0?(b.push(p>>16&255),b.push(p>>8&255),b.push(p&255)):O===18?(b.push(p>>10&255),b.push(p>>2&255)):O===12&&b.push(p>>4&255),new Uint8Array(b)}function l(h){let u="",x=0,s=h.length,p=i;for(let O=0;O<s;O++)O%3===0&&O&&(u+=p[x>>18&63],u+=p[x>>12&63],u+=p[x>>6&63],u+=p[x&63]),x=(x<<8)+h[O];let b=s%3;return b===0?(u+=p[x>>18&63],u+=p[x>>12&63],u+=p[x>>6&63],u+=p[x&63]):b===2?(u+=p[x>>10&63],u+=p[x>>4&63],u+=p[x<<2&63],u+=p[64]):b===1&&(u+=p[x>>2&63],u+=p[x<<4&63],u+=p[64],u+=p[64]),u}function d(h){return Object.prototype.toString.call(h)==="[object Uint8Array]"}return Sn=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:c,construct:g,predicate:d,represent:l}),Sn}var xn,pr;function Rr(){if(pr)return xn;pr=1;let r=j(),i=Object.prototype.hasOwnProperty,c=Object.prototype.toString;function g(d){if(d===null)return!0;let h={},u=d;for(let x=0,s=u.length;x<s;x+=1){let p=u[x],b=!1;if(c.call(p)!=="[object Object]")return!1;let O;for(O in p)if(i.call(p,O))if(!b)b=!0;else return!1;if(!b||i.call(h,O))return!1;Object.defineProperty(h,O,{value:!0})}return!0}function l(d){return d!==null?d:[]}return xn=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:g,construct:l}),xn}var Tn,dr;function Mr(){if(dr)return Tn;dr=1;let r=j(),i=Object.prototype.toString;function c(l){if(l===null)return!0;let d=l,h=new Array(d.length);for(let u=0,x=d.length;u<x;u+=1){let s=d[u];if(i.call(s)!=="[object Object]")return!1;let p=Object.keys(s);if(p.length!==1)return!1;h[u]=[p[0],s[p[0]]]}return!0}function g(l){if(l===null)return[];let d=l,h=new Array(d.length);for(let u=0,x=d.length;u<x;u+=1){let s=d[u],p=Object.keys(s);h[u]=[p[0],s[p[0]]]}return h}return Tn=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:c,construct:g}),Tn}var vn,hr;function Pr(){if(hr)return vn;hr=1;let r=j(),i=Object.prototype.hasOwnProperty;function c(l){if(l===null)return!0;let d=l;for(let h in d)if(i.call(d,h)&&d[h]!==null)return!1;return!0}function g(l){return l!==null?l:{}}return vn=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:c,construct:g}),vn}var bn,mr;function wn(){return mr||(mr=1,bn=Lr().extend({implicit:[Or(),kr()],explicit:[Nr(),Rr(),Mr(),Pr()]})),bn}var gr;function si(){if(gr)return Ue;gr=1;let r=xe(),i=Te(),c=ui(),g=wn(),l=Object.prototype.hasOwnProperty,d=1,h=2,u=3,x=4,s=1,p=2,b=3,O=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,R=/[\x85\u2028\u2029]/,z=/[,\[\]{}]/,M=/^(?:!|!!|![0-9A-Za-z-]+!)$/,K=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ne(e){return Object.prototype.toString.call(e)}function U(e){return e===10||e===13}function H(e){return e===9||e===32}function D(e){return e===9||e===32||e===10||e===13}function W(e){return e===44||e===91||e===93||e===123||e===125}function Be(e){if(e>=48&&e<=57)return e-48;let o=e|32;return o>=97&&o<=102?o-97+10:-1}function Ke(e){return e===120?2:e===117?4:e===85?8:0}function ve(e){return e>=48&&e<=57?e-48:-1}function ae(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
12
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Ge(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function pe(e,o,y){o==="__proto__"?Object.defineProperty(e,o,{configurable:!0,enumerable:!0,writable:!0,value:y}):e[o]=y}let be=new Array(256),de=new Array(256);for(let e=0;e<256;e++)be[e]=ae(e)?1:0,de[e]=ae(e);function F(e,o){this.input=e,this.filename=o.filename||null,this.schema=o.schema||g,this.onWarning=o.onWarning||null,this.legacy=o.legacy||!1,this.json=o.json||!1,this.listener=o.listener||null,this.maxDepth=typeof o.maxDepth=="number"?o.maxDepth:100,this.maxTotalMergeKeys=typeof o.maxTotalMergeKeys=="number"?o.maxTotalMergeKeys:1e4,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.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Ce(e,o){let y={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return y.snippet=c(y),new i(o,y)}function w(e,o){throw Ce(e,o)}function te(e,o){e.onWarning&&e.onWarning.call(null,Ce(e,o))}function $(e,o,y){let _=e.anchorMapTransactions;if(_.length!==0){let a=_[_.length-1];l.call(a,o)||(a[o]={existed:l.call(e.anchorMap,o),value:e.anchorMap[o]})}e.anchorMap[o]=y}function $e(e){e.anchorMapTransactions.push(Object.create(null))}function re(e){let o=e.anchorMapTransactions.pop(),y=e.anchorMapTransactions;if(y.length===0)return;let _=y[y.length-1],a=Object.keys(o);for(let n=0,t=a.length;n<t;n+=1){let f=a[n];l.call(_,f)||(_[f]=o[f])}}function Ve(e){let o=e.anchorMapTransactions.pop(),y=Object.keys(o);for(let _=y.length-1;_>=0;_-=1){let a=o[y[_]];a.existed?e.anchorMap[y[_]]=a.value:delete e.anchorMap[y[_]]}}function he(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function le(e,o){e.position=o.position,e.line=o.line,e.lineStart=o.lineStart,e.lineIndent=o.lineIndent,e.firstTabInLine=o.firstTabInLine,e.tag=o.tag,e.anchor=o.anchor,e.kind=o.kind,e.result=o.result}let we={YAML:function(o,y,_){o.version!==null&&w(o,"duplication of %YAML directive"),_.length!==1&&w(o,"YAML directive accepts exactly one argument");let a=/^([0-9]+)\.([0-9]+)$/.exec(_[0]);a===null&&w(o,"ill-formed argument of the YAML directive");let n=parseInt(a[1],10),t=parseInt(a[2],10);n!==1&&w(o,"unacceptable YAML version of the document"),o.version=_[0],o.checkLineBreaks=t<2,t!==1&&t!==2&&te(o,"unsupported YAML version of the document")},TAG:function(o,y,_){let a;_.length!==2&&w(o,"TAG directive accepts exactly two arguments");let n=_[0];a=_[1],M.test(n)||w(o,"ill-formed tag handle (first argument) of the TAG directive"),l.call(o.tagMap,n)&&w(o,'there is a previously declared suffix for "'+n+'" tag handle'),K.test(a)||w(o,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{w(o,"tag prefix is malformed: "+a)}o.tagMap[n]=a}};function q(e,o,y,_){if(o<y){let a=e.input.slice(o,y);if(_)for(let n=0,t=a.length;n<t;n+=1){let f=a.charCodeAt(n);f===9||f>=32&&f<=1114111||w(e,"expected valid JSON character")}else O.test(a)&&w(e,"the stream contains non-printable characters");e.result+=a}}function X(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&w(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")")}function me(e,o,y,_){r.isObject(y)||w(e,"cannot merge mappings; the provided source object is unacceptable"),X(e);let a=Object.keys(y);for(let n=0,t=a.length;n<t;n+=1){let f=a[n];X(e),l.call(o,f)||(pe(o,f,y[f]),_[f]=!0)}}function V(e,o,y,_,a,n,t,f,E){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let S=0,T=a.length;S<T;S+=1)Array.isArray(a[S])&&w(e,"nested arrays are not supported inside keys"),typeof a=="object"&&ne(a[S])==="[object Object]"&&(a[S]="[object Object]")}if(typeof a=="object"&&ne(a)==="[object Object]"&&(a="[object Object]"),a=String(a),o===null&&(o={}),_==="tag:yaml.org,2002:merge")if(Array.isArray(n)){n.length>100&&w(e,"abnormal merge sequence size");for(let S=0,T=n.length;S<T;S+=1)me(e,o,n[S],y)}else me(e,o,n,y);else!e.json&&!l.call(y,a)&&l.call(o,a)&&(e.line=t||e.line,e.lineStart=f||e.lineStart,e.position=E||e.position,w(e,"duplicated mapping key")),pe(o,a,n),delete y[a];return o}function ge(e){let o=e.input.charCodeAt(e.position);o===10?e.position++:o===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 P(e,o,y){let _=0,a=e.input.charCodeAt(e.position);for(;a!==0;){for(;H(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(o&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(U(a))for(ge(e),a=e.input.charCodeAt(e.position),_++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return y!==-1&&_!==0&&e.lineIndent<y&&te(e,"deficient indentation"),_}function G(e){let o=e.position,y=e.input.charCodeAt(o);return!!((y===45||y===46)&&y===e.input.charCodeAt(o+1)&&y===e.input.charCodeAt(o+2)&&(o+=3,y=e.input.charCodeAt(o),y===0||D(y)))}function ce(e,o){o===1?e.result+=" ":o>1&&(e.result+=r.repeat(`
13
+ `,o-1))}function Ie(e,o,y){let _,a,n,t,f,E,S=e.kind,T=e.result,m=e.input.charCodeAt(e.position);if(D(m)||W(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let v=e.input.charCodeAt(e.position+1);if(D(v)||y&&W(v))return!1}for(e.kind="scalar",e.result="",_=a=e.position,n=!1;m!==0;){if(m===58){let v=e.input.charCodeAt(e.position+1);if(D(v)||y&&W(v))break}else if(m===35){let v=e.input.charCodeAt(e.position-1);if(D(v))break}else{if(e.position===e.lineStart&&G(e)||y&&W(m))break;if(U(m))if(t=e.line,f=e.lineStart,E=e.lineIndent,P(e,!1,-1),e.lineIndent>=o){n=!0,m=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=t,e.lineStart=f,e.lineIndent=E;break}}n&&(q(e,_,a,!1),ce(e,e.line-t),_=a=e.position,n=!1),H(m)||(a=e.position+1),m=e.input.charCodeAt(++e.position)}return q(e,_,a,!1),e.result?!0:(e.kind=S,e.result=T,!1)}function ye(e,o){let y,_,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,y=_=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(q(e,y,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)y=e.position,e.position++,_=e.position;else return!0;else U(a)?(q(e,y,_,!0),ce(e,P(e,!1,o)),y=_=e.position):e.position===e.lineStart&&G(e)?w(e,"unexpected end of the document within a single quoted scalar"):(e.position++,H(a)||(_=e.position));w(e,"unexpected end of the stream within a single quoted scalar")}function Le(e,o){let y,_,a,n=e.input.charCodeAt(e.position);if(n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,y=_=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return q(e,y,e.position,!0),e.position++,!0;if(n===92){if(q(e,y,e.position,!0),n=e.input.charCodeAt(++e.position),U(n))P(e,!1,o);else if(n<256&&be[n])e.result+=de[n],e.position++;else if((a=Ke(n))>0){let t=a,f=0;for(;t>0;t--)n=e.input.charCodeAt(++e.position),(a=Be(n))>=0?f=(f<<4)+a:w(e,"expected hexadecimal character");e.result+=Ge(f),e.position++}else w(e,"unknown escape sequence");y=_=e.position}else U(n)?(q(e,y,_,!0),ce(e,P(e,!1,o)),y=_=e.position):e.position===e.lineStart&&G(e)?w(e,"unexpected end of the document within a double quoted scalar"):(e.position++,H(n)||(_=e.position))}w(e,"unexpected end of the stream within a double quoted scalar")}function Oe(e,o){let y=!0,_,a,n,t=e.tag,f,E=e.anchor,S,T,m,v,C=Object.create(null),I,L,k,N=e.input.charCodeAt(e.position);if(N===91)S=93,v=!1,f=[];else if(N===123)S=125,v=!0,f={};else return!1;for(e.anchor!==null&&$(e,e.anchor,f),N=e.input.charCodeAt(++e.position);N!==0;){if(P(e,!0,o),N=e.input.charCodeAt(e.position),N===S)return e.position++,e.tag=t,e.anchor=E,e.kind=v?"mapping":"sequence",e.result=f,!0;if(y?N===44&&w(e,"expected the node content, but found ','"):w(e,"missed comma between flow collection entries"),L=I=k=null,T=m=!1,N===63){let Z=e.input.charCodeAt(e.position+1);D(Z)&&(T=m=!0,e.position++,P(e,!0,o))}_=e.line,a=e.lineStart,n=e.position,Q(e,o,d,!1,!0),L=e.tag,I=e.result,P(e,!0,o),N=e.input.charCodeAt(e.position),(m||e.line===_)&&N===58&&(T=!0,N=e.input.charCodeAt(++e.position),P(e,!0,o),Q(e,o,d,!1,!0),k=e.result),v?V(e,f,C,L,I,k,_,a,n):T?f.push(V(e,null,C,L,I,k,_,a,n)):f.push(I),P(e,!0,o),N=e.input.charCodeAt(e.position),N===44?(y=!0,N=e.input.charCodeAt(++e.position)):y=!1}w(e,"unexpected end of the stream within a flow collection")}function J(e,o){let y,_=s,a=!1,n=!1,t=o,f=0,E=!1,S,T=e.input.charCodeAt(e.position);if(T===124)y=!1;else if(T===62)y=!0;else return!1;for(e.kind="scalar",e.result="";T!==0;)if(T=e.input.charCodeAt(++e.position),T===43||T===45)s===_?_=T===43?b:p:w(e,"repeat of a chomping mode identifier");else if((S=ve(T))>=0)S===0?w(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?w(e,"repeat of an indentation width identifier"):(t=o+S-1,n=!0);else break;if(H(T)){do T=e.input.charCodeAt(++e.position);while(H(T));if(T===35)do T=e.input.charCodeAt(++e.position);while(!U(T)&&T!==0)}for(;T!==0;){for(ge(e),e.lineIndent=0,T=e.input.charCodeAt(e.position);(!n||e.lineIndent<t)&&T===32;)e.lineIndent++,T=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>t&&(t=e.lineIndent),U(T)){f++;continue}if(!n&&t===0&&w(e,"missing indentation for block scalar"),e.lineIndent<t){_===b?e.result+=r.repeat(`
14
+ `,a?1+f:f):_===s&&a&&(e.result+=`
15
+ `);break}y?H(T)?(E=!0,e.result+=r.repeat(`
16
+ `,a?1+f:f)):E?(E=!1,e.result+=r.repeat(`
17
+ `,f+1)):f===0?a&&(e.result+=" "):e.result+=r.repeat(`
18
+ `,f):e.result+=r.repeat(`
19
+ `,a?1+f:f),a=!0,n=!0,f=0;let m=e.position;for(;!U(T)&&T!==0;)T=e.input.charCodeAt(++e.position);q(e,m,e.position,!1)}return!0}function ke(e,o){let y=e.tag,_=e.anchor,a=[],n=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&$(e,e.anchor,a);let t=e.input.charCodeAt(e.position);for(;t!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,w(e,"tab characters must not be used in indentation")),t===45);){let f=e.input.charCodeAt(e.position+1);if(!D(f))break;if(n=!0,e.position++,P(e,!0,-1)&&e.lineIndent<=o){a.push(null),t=e.input.charCodeAt(e.position);continue}let E=e.line;if(Q(e,o,u,!1,!0),a.push(e.result),P(e,!0,-1),t=e.input.charCodeAt(e.position),(e.line===E||e.lineIndent>o)&&t!==0)w(e,"bad indentation of a sequence entry");else if(e.lineIndent<o)break}return n?(e.tag=y,e.anchor=_,e.kind="sequence",e.result=a,!0):!1}function Ne(e,o,y){let _,a,n,t,f=e.tag,E=e.anchor,S={},T=Object.create(null),m=null,v=null,C=null,I=!1,L=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&$(e,e.anchor,S);let k=e.input.charCodeAt(e.position);for(;k!==0;){!I&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,w(e,"tab characters must not be used in indentation"));let N=e.input.charCodeAt(e.position+1),Z=e.line;if((k===63||k===58)&&D(N))k===63?(I&&(V(e,S,T,m,v,null,a,n,t),m=v=C=null),L=!0,I=!0,_=!0):I?(I=!1,_=!0):w(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,k=N;else{if(a=e.line,n=e.lineStart,t=e.position,!Q(e,y,h,!1,!0))break;if(e.line===Z){for(k=e.input.charCodeAt(e.position);H(k);)k=e.input.charCodeAt(++e.position);if(k===58)k=e.input.charCodeAt(++e.position),D(k)||w(e,"a whitespace character is expected after the key-value separator within a block mapping"),I&&(V(e,S,T,m,v,null,a,n,t),m=v=C=null),L=!0,I=!1,_=!1,m=e.tag,v=e.result;else if(L)w(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=E,!0}else if(L)w(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=E,!0}if((e.line===Z||e.lineIndent>o)&&(I&&(a=e.line,n=e.lineStart,t=e.position),Q(e,o,x,!0,_)&&(I?v=e.result:C=e.result),I||(V(e,S,T,m,v,C,a,n,t),m=v=C=null),P(e,!0,-1),k=e.input.charCodeAt(e.position)),(e.line===Z||e.lineIndent>o)&&k!==0)w(e,"bad indentation of a mapping entry");else if(e.lineIndent<o)break}return I&&V(e,S,T,m,v,null,a,n,t),L&&(e.tag=f,e.anchor=E,e.kind="mapping",e.result=S),L}function Re(e){let o=!1,y=!1,_,a,n=e.input.charCodeAt(e.position);if(n!==33)return!1;e.tag!==null&&w(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(o=!0,n=e.input.charCodeAt(++e.position)):n===33?(y=!0,_="!!",n=e.input.charCodeAt(++e.position)):_="!";let t=e.position;if(o){do n=e.input.charCodeAt(++e.position);while(n!==0&&n!==62);e.position<e.length?(a=e.input.slice(t,e.position),n=e.input.charCodeAt(++e.position)):w(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!D(n);)n===33&&(y?w(e,"tag suffix cannot contain exclamation marks"):(_=e.input.slice(t-1,e.position+1),M.test(_)||w(e,"named tag handle cannot contain such characters"),y=!0,t=e.position+1)),n=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),z.test(a)&&w(e,"tag suffix cannot contain flow indicator characters")}a&&!K.test(a)&&w(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{w(e,"tag name is malformed: "+a)}return o?e.tag=a:l.call(e.tagMap,_)?e.tag=e.tagMap[_]+a:_==="!"?e.tag="!"+a:_==="!!"?e.tag="tag:yaml.org,2002:"+a:w(e,'undeclared tag handle "'+_+'"'),!0}function Me(e){let o=e.input.charCodeAt(e.position);if(o!==38)return!1;e.anchor!==null&&w(e,"duplication of an anchor property"),o=e.input.charCodeAt(++e.position);let y=e.position;for(;o!==0&&!D(o)&&!W(o);)o=e.input.charCodeAt(++e.position);return e.position===y&&w(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(y,e.position),!0}function ze(e){let o=e.input.charCodeAt(e.position);if(o!==42)return!1;o=e.input.charCodeAt(++e.position);let y=e.position;for(;o!==0&&!D(o)&&!W(o);)o=e.input.charCodeAt(++e.position);e.position===y&&w(e,"name of an alias node must contain at least one character");let _=e.input.slice(y,e.position);return l.call(e.anchorMap,_)||w(e,'unidentified alias "'+_+'"'),e.result=e.anchorMap[_],P(e,!0,-1),!0}function Pe(e,o,y,_){let a=he(e);return $e(e),le(e,o),e.tag=null,e.anchor=null,e.kind=null,e.result=null,Ne(e,y,_)&&e.kind==="mapping"?(re(e),!0):(Ve(e),le(e,a),!1)}function Q(e,o,y,_,a){let n,t,f=1,E=!1,S=!1,T=null,m,v,C;e.depth>=e.maxDepth&&w(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;let I=n=t=x===y||u===y;if(_&&P(e,!0,-1)&&(E=!0,e.lineIndent>o?f=1:e.lineIndent===o?f=0:e.lineIndent<o&&(f=-1)),f===1)for(;;){let L=e.input.charCodeAt(e.position),k=he(e);if(E&&(L===33&&e.tag!==null||L===38&&e.anchor!==null)||!Re(e)&&!Me(e))break;T===null&&(T=k),P(e,!0,-1)?(E=!0,t=I,e.lineIndent>o?f=1:e.lineIndent===o?f=0:e.lineIndent<o&&(f=-1)):t=!1}if(t&&(t=E||a),f===1||x===y)if(d===y||h===y?v=o:v=o+1,C=e.position-e.lineStart,f===1)if(t&&(ke(e,C)||Ne(e,C,v))||Oe(e,v))S=!0;else{let L=e.input.charCodeAt(e.position);T!==null&&I&&!t&&L!==124&&L!==62&&Pe(e,T,T.position-T.lineStart,v)||n&&J(e,v)||ye(e,v)||Le(e,v)?S=!0:ze(e)?(S=!0,(e.tag!==null||e.anchor!==null)&&w(e,"alias node should not have any properties")):Ie(e,v,d===y)&&(S=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&$(e,e.anchor,e.result)}else f===0&&(S=t&&ke(e,C));if(e.tag===null)e.anchor!==null&&$(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&w(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let L=0,k=e.implicitTypes.length;L<k;L+=1)if(m=e.implicitTypes[L],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&$(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(l.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else{m=null;let L=e.typeMap.multi[e.kind||"fallback"];for(let k=0,N=L.length;k<N;k+=1)if(e.tag.slice(0,L[k].tag.length)===L[k].tag){m=L[k];break}}m||w(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&w(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&$(e,e.anchor,e.result)):w(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.depth-=1,e.tag!==null||e.anchor!==null||S}function We(e){let o=e.position,y=!1,_;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(_=e.input.charCodeAt(e.position))!==0&&(P(e,!0,-1),_=e.input.charCodeAt(e.position),!(e.lineIndent>0||_!==37));){y=!0,_=e.input.charCodeAt(++e.position);let a=e.position;for(;_!==0&&!D(_);)_=e.input.charCodeAt(++e.position);let n=e.input.slice(a,e.position),t=[];for(n.length<1&&w(e,"directive name must not be less than one character in length");_!==0;){for(;H(_);)_=e.input.charCodeAt(++e.position);if(_===35){do _=e.input.charCodeAt(++e.position);while(_!==0&&!U(_));break}if(U(_))break;for(a=e.position;_!==0&&!D(_);)_=e.input.charCodeAt(++e.position);t.push(e.input.slice(a,e.position))}_!==0&&ge(e),l.call(we,n)?we[n](e,n,t):te(e,'unknown document directive "'+n+'"')}if(P(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,P(e,!0,-1)):y&&w(e,"directives end mark is expected"),Q(e,e.lineIndent-1,x,!1,!0),P(e,!0,-1),e.checkLineBreaks&&R.test(e.input.slice(o,e.position))&&te(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&G(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,P(e,!0,-1));return}e.position<e.length-1&&w(e,"end of the stream or a document separator is expected")}function _e(e,o){e=String(e),o=o||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
20
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));let y=new F(e,o),_=e.indexOf("\0");for(_!==-1&&(y.position=_,w(y,"null byte is not allowed in input")),y.input+="\0";y.input.charCodeAt(y.position)===32;)y.lineIndent+=1,y.position+=1;for(;y.position<y.length-1;)We(y);return y.documents}function Xe(e,o,y){o!==null&&typeof o=="object"&&typeof y>"u"&&(y=o,o=null);let _=_e(e,y);if(typeof o!="function")return _;for(let a=0,n=_.length;a<n;a+=1)o(_[a])}function Je(e,o){let y=_e(e,o);if(y.length!==0){if(y.length===1)return y[0];throw new i("expected a single document in the stream, but found more")}}return Ue.loadAll=Xe,Ue.load=Je,Ue}var Cn={},yr;function fi(){if(yr)return Cn;yr=1;let r=xe(),i=Te(),c=wn(),g=Object.prototype.toString,l=Object.prototype.hasOwnProperty,d=65279,h=9,u=10,x=13,s=32,p=33,b=34,O=35,R=37,z=38,M=39,K=42,ne=44,U=45,H=58,D=61,W=62,Be=63,Ke=64,ve=91,ae=93,Ge=96,pe=123,be=124,de=125,F={};F[0]="\\0",F[7]="\\a",F[8]="\\b",F[9]="\\t",F[10]="\\n",F[11]="\\v",F[12]="\\f",F[13]="\\r",F[27]="\\e",F[34]='\\"',F[92]="\\\\",F[133]="\\N",F[160]="\\_",F[8232]="\\L",F[8233]="\\P";let Ce=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],w=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function te(n,t){if(t===null)return{};let f={},E=Object.keys(t);for(let S=0,T=E.length;S<T;S+=1){let m=E[S],v=String(t[m]);m.slice(0,2)==="!!"&&(m="tag:yaml.org,2002:"+m.slice(2));let C=n.compiledTypeMap.fallback[m];C&&l.call(C.styleAliases,v)&&(v=C.styleAliases[v]),f[m]=v}return f}function $(n){let t,f,E=n.toString(16).toUpperCase();if(n<=255)t="x",f=2;else if(n<=65535)t="u",f=4;else if(n<=4294967295)t="U",f=8;else throw new i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+r.repeat("0",f-E.length)+E}let $e=1,re=2;function Ve(n){this.schema=n.schema||c,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=r.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=te(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?re:$e,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function he(n,t){let f=r.repeat(" ",t),E=0,S="",T=n.length;for(;E<T;){let m,v=n.indexOf(`
21
+ `,E);v===-1?(m=n.slice(E),E=T):(m=n.slice(E,v+1),E=v+1),m.length&&m!==`
22
+ `&&(S+=f),S+=m}return S}function le(n,t){return`
23
+ `+r.repeat(" ",n.indent*t)}function we(n,t){for(let f=0,E=n.implicitTypes.length;f<E;f+=1)if(n.implicitTypes[f].resolve(t))return!0;return!1}function q(n){return n===s||n===h}function X(n){return n>=32&&n<=126||n>=161&&n<=55295&&n!==8232&&n!==8233||n>=57344&&n<=65533&&n!==d||n>=65536&&n<=1114111}function me(n){return X(n)&&n!==d&&n!==x&&n!==u}function V(n,t,f){let E=me(n),S=E&&!q(n);return(f?E:E&&n!==ne&&n!==ve&&n!==ae&&n!==pe&&n!==de)&&n!==O&&!(t===H&&!S)||me(t)&&!q(t)&&n===O||t===H&&S}function ge(n){return X(n)&&n!==d&&!q(n)&&n!==U&&n!==Be&&n!==H&&n!==ne&&n!==ve&&n!==ae&&n!==pe&&n!==de&&n!==O&&n!==z&&n!==K&&n!==p&&n!==be&&n!==D&&n!==W&&n!==M&&n!==b&&n!==R&&n!==Ke&&n!==Ge}function P(n){return!q(n)&&n!==H}function G(n,t){let f=n.charCodeAt(t),E;return f>=55296&&f<=56319&&t+1<n.length&&(E=n.charCodeAt(t+1),E>=56320&&E<=57343)?(f-55296)*1024+E-56320+65536:f}function ce(n){return/^\n* /.test(n)}let Ie=1,ye=2,Le=3,Oe=4,J=5;function ke(n,t,f,E,S,T,m,v){let C,I=0,L=null,k=!1,N=!1,Z=E!==-1,Ae=-1,Ee=ge(G(n,0))&&P(G(n,n.length-1));if(t||m)for(C=0;C<n.length;I>=65536?C+=2:C++){if(I=G(n,C),!X(I))return J;Ee=Ee&&V(I,L,v),L=I}else{for(C=0;C<n.length;I>=65536?C+=2:C++){if(I=G(n,C),I===u)k=!0,Z&&(N=N||C-Ae-1>E&&n[Ae+1]!==" ",Ae=C);else if(!X(I))return J;Ee=Ee&&V(I,L,v),L=I}N=N||Z&&C-Ae-1>E&&n[Ae+1]!==" "}return!k&&!N?Ee&&!m&&!S(n)?Ie:T===re?J:ye:f>9&&ce(n)?J:m?T===re?J:ye:N?Oe:Le}function Ne(n,t,f,E,S){n.dump=(function(){if(t.length===0)return n.quotingType===re?'""':"''";if(!n.noCompatMode&&(Ce.indexOf(t)!==-1||w.test(t)))return n.quotingType===re?'"'+t+'"':"'"+t+"'";let T=n.indent*Math.max(1,f),m=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-T),v=E||n.flowLevel>-1&&f>=n.flowLevel;function C(I){return we(n,I)}switch(ke(t,v,n.indent,m,C,n.quotingType,n.forceQuotes&&!E,S)){case Ie:return t;case ye:return"'"+t.replace(/'/g,"''")+"'";case Le:return"|"+Re(t,n.indent)+Me(he(t,T));case Oe:return">"+Re(t,n.indent)+Me(he(ze(t,m),T));case J:return'"'+Q(t)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function Re(n,t){let f=ce(n)?String(t):"",E=n[n.length-1]===`
24
+ `,T=E&&(n[n.length-2]===`
25
+ `||n===`
26
+ `)?"+":E?"":"-";return f+T+`
27
+ `}function Me(n){return n[n.length-1]===`
28
+ `?n.slice(0,-1):n}function ze(n,t){let f=/(\n+)([^\n]*)/g,E=(function(){let v=n.indexOf(`
29
+ `);return v=v!==-1?v:n.length,f.lastIndex=v,Pe(n.slice(0,v),t)})(),S=n[0]===`
30
+ `||n[0]===" ",T,m;for(;m=f.exec(n);){let v=m[1],C=m[2];T=C[0]===" ",E+=v+(!S&&!T&&C!==""?`
31
+ `:"")+Pe(C,t),S=T}return E}function Pe(n,t){if(n===""||n[0]===" ")return n;let f=/ [^ ]/g,E,S=0,T,m=0,v=0,C="";for(;E=f.exec(n);)v=E.index,v-S>t&&(T=m>S?m:v,C+=`
32
+ `+n.slice(S,T),S=T+1),m=v;return C+=`
33
+ `,n.length-S>t&&m>S?C+=n.slice(S,m)+`
34
+ `+n.slice(m+1):C+=n.slice(S),C.slice(1)}function Q(n){let t="",f=0;for(let E=0;E<n.length;f>=65536?E+=2:E++){f=G(n,E);let S=F[f];!S&&X(f)?(t+=n[E],f>=65536&&(t+=n[E+1])):t+=S||$(f)}return t}function We(n,t,f){let E="",S=n.tag;for(let T=0,m=f.length;T<m;T+=1){let v=f[T];n.replacer&&(v=n.replacer.call(f,String(T),v)),(o(n,t,v,!1,!1)||typeof v>"u"&&o(n,t,null,!1,!1))&&(E!==""&&(E+=","+(n.condenseFlow?"":" ")),E+=n.dump)}n.tag=S,n.dump="["+E+"]"}function _e(n,t,f,E){let S="",T=n.tag;for(let m=0,v=f.length;m<v;m+=1){let C=f[m];n.replacer&&(C=n.replacer.call(f,String(m),C)),(o(n,t+1,C,!0,!0,!1,!0)||typeof C>"u"&&o(n,t+1,null,!0,!0,!1,!0))&&((!E||S!=="")&&(S+=le(n,t)),n.dump&&u===n.dump.charCodeAt(0)?S+="-":S+="- ",S+=n.dump)}n.tag=T,n.dump=S||"[]"}function Xe(n,t,f){let E="",S=n.tag,T=Object.keys(f);for(let m=0,v=T.length;m<v;m+=1){let C="";E!==""&&(C+=", "),n.condenseFlow&&(C+='"');let I=T[m],L=f[I];n.replacer&&(L=n.replacer.call(f,I,L)),o(n,t,I,!1,!1)&&(n.dump.length>1024&&(C+="? "),C+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),o(n,t,L,!1,!1)&&(C+=n.dump,E+=C))}n.tag=S,n.dump="{"+E+"}"}function Je(n,t,f,E){let S="",T=n.tag,m=Object.keys(f);if(n.sortKeys===!0)m.sort();else if(typeof n.sortKeys=="function")m.sort(n.sortKeys);else if(n.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let v=0,C=m.length;v<C;v+=1){let I="";(!E||S!=="")&&(I+=le(n,t));let L=m[v],k=f[L];if(n.replacer&&(k=n.replacer.call(f,L,k)),!o(n,t+1,L,!0,!0,!0))continue;let N=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024;N&&(n.dump&&u===n.dump.charCodeAt(0)?I+="?":I+="? "),I+=n.dump,N&&(I+=le(n,t)),o(n,t+1,k,!0,N)&&(n.dump&&u===n.dump.charCodeAt(0)?I+=":":I+=": ",I+=n.dump,S+=I)}n.tag=T,n.dump=S||"{}"}function e(n,t,f){let E=f?n.explicitTypes:n.implicitTypes;for(let S=0,T=E.length;S<T;S+=1){let m=E[S];if((m.instanceOf||m.predicate)&&(!m.instanceOf||typeof t=="object"&&t instanceof m.instanceOf)&&(!m.predicate||m.predicate(t))){if(f?m.multi&&m.representName?n.tag=m.representName(t):n.tag=m.tag:n.tag="?",m.represent){let v=n.styleMap[m.tag]||m.defaultStyle,C;if(g.call(m.represent)==="[object Function]")C=m.represent(t,v);else if(l.call(m.represent,v))C=m.represent[v](t,v);else throw new i("!<"+m.tag+'> tag resolver accepts not "'+v+'" style');n.dump=C}return!0}}return!1}function o(n,t,f,E,S,T,m){n.tag=null,n.dump=f,e(n,f,!1)||e(n,f,!0);let v=g.call(n.dump),C=E;E&&(E=n.flowLevel<0||n.flowLevel>t);let I=v==="[object Object]"||v==="[object Array]",L,k;if(I&&(L=n.duplicates.indexOf(f),k=L!==-1),(n.tag!==null&&n.tag!=="?"||k||n.indent!==2&&t>0)&&(S=!1),k&&n.usedDuplicates[L])n.dump="*ref_"+L;else{if(I&&k&&!n.usedDuplicates[L]&&(n.usedDuplicates[L]=!0),v==="[object Object]")E&&Object.keys(n.dump).length!==0?(Je(n,t,n.dump,S),k&&(n.dump="&ref_"+L+n.dump)):(Xe(n,t,n.dump),k&&(n.dump="&ref_"+L+" "+n.dump));else if(v==="[object Array]")E&&n.dump.length!==0?(n.noArrayIndent&&!m&&t>0?_e(n,t-1,n.dump,S):_e(n,t,n.dump,S),k&&(n.dump="&ref_"+L+n.dump)):(We(n,t,n.dump),k&&(n.dump="&ref_"+L+" "+n.dump));else if(v==="[object String]")n.tag!=="?"&&Ne(n,n.dump,t,T,C);else{if(v==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+v)}if(n.tag!==null&&n.tag!=="?"){let N=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21");n.tag[0]==="!"?N="!"+N:N.slice(0,18)==="tag:yaml.org,2002:"?N="!!"+N.slice(18):N="!<"+N+">",n.dump=N+" "+n.dump}}return!0}function y(n,t){let f=[],E=[];_(n,f,E);let S=E.length;for(let T=0;T<S;T+=1)t.duplicates.push(f[E[T]]);t.usedDuplicates=new Array(S)}function _(n,t,f){if(n!==null&&typeof n=="object"){let E=t.indexOf(n);if(E!==-1)f.indexOf(E)===-1&&f.push(E);else if(t.push(n),Array.isArray(n))for(let S=0,T=n.length;S<T;S+=1)_(n[S],t,f);else{let S=Object.keys(n);for(let T=0,m=S.length;T<m;T+=1)_(n[S[T]],t,f)}}}function a(n,t){t=t||{};let f=new Ve(t);f.noRefs||y(n,f);let E=n;return f.replacer&&(E=f.replacer.call({"":E},"",E)),o(f,0,E,!0,!0)?f.dump+`
35
+ `:""}return Cn.dump=a,Cn}var _r;function ai(){if(_r)return Y;_r=1;let r=si(),i=fi();function c(g,l){return function(){throw new Error("Function yaml."+g+" is removed in js-yaml 4. Use yaml."+l+" instead, which is now safe by default.")}}return Y.Type=j(),Y.Schema=Ar(),Y.FAILSAFE_SCHEMA=Tr(),Y.JSON_SCHEMA=Ir(),Y.CORE_SCHEMA=Lr(),Y.DEFAULT_SCHEMA=wn(),Y.load=r.load,Y.loadAll=r.loadAll,Y.dump=i.dump,Y.YAMLException=Te(),Y.types={binary:Nr(),float:wr(),map:xr(),null:vr(),pairs:Mr(),set:Pr(),timestamp:Or(),bool:br(),int:Cr(),merge:kr(),omap:Rr(),seq:Sr(),str:Er()},Y.safeLoad=c("safeLoad","load"),Y.safeLoadAll=c("safeLoadAll","loadAll"),Y.safeDump=c("safeDump","dump"),Y}var pi=ai(),fe=ci(pi),{Type:qi,Schema:Bi,FAILSAFE_SCHEMA:Ki,JSON_SCHEMA:Gi,CORE_SCHEMA:$i,DEFAULT_SCHEMA:Vi,load:zi,loadAll:Wi,dump:Xi,YAMLException:Ji,types:Qi,safeLoad:Zi,safeLoadAll:eo,safeDump:no}=fe;var Fr=(r,i,c)=>A.preprocess(g=>g===void 0||typeof g=="string"&&!g.trim()?r:g,A.union([A.number(),A.string().trim().regex(/^\d+$/,"Enter a whole number").transform(Number)]).pipe(A.number().int().min(i).max(c))),_i=Se.extend({name:A.string().trim().min(1,"Name is required"),base_url:A.url("Enter a valid HTTP(S) URL").refine(r=>/^https?:\/\//i.test(r),"Use an HTTP(S) URL"),api_key:A.string().trim().min(1,"API key is required"),model:A.string().trim().min(1,"Model is required"),thinking:A.enum(ie).optional(),context_window:Fr(1e6,1e3,1e7),max_output_tokens:Fr(128e3,1,1e6)}).refine(r=>r.max_output_tokens<=r.context_window,{path:["max_output_tokens"],message:"Max output tokens must not exceed the context window"}).transform(r=>({...r,thinking:rn(r)}));function In(r){if(!Dr(r))return{};let i;try{i=fe.load(Fe(r,"utf-8"))}catch{throw new Error(`Unable to read existing ${r}; it has not been changed.`)}return A.record(A.string(),A.unknown()).parse(i??{})}function Ln(r,i){let c=gi(r);Nn(c,{recursive:!0});let g=yi(c,`.config-${di()}.tmp`);try{Rn(g,fe.dump(i,{lineWidth:-1,noRefs:!0}),{encoding:"utf-8",mode:384,flag:"wx"}),hi(g,r)}finally{Dr(g)&&mi(g)}}function ao(r,i){let c=_i.parse(r),g=se(),l=In(g),h=[...A.array(A.record(A.string(),A.unknown())).parse(l.providers??[])];for(let p of i)h.some(b=>b.base_url===p.base_url)||h.push({...p});let u=[],x=!1;for(let p of h){if(p.base_url!==c.base_url){u.push(p);continue}x||(x=!0,u.push(c))}x||u.push(c);let s=u.map(p=>Se.parse(p));return Ln(g,{...l,providers:u}),{provider:c,providers:s,replaced:x,path:g}}function Yr(r,i,c){let g=se(),l=In(g),d=A.array(A.record(A.string(),A.unknown())).parse(l.providers??[]),h=d.filter(x=>x.base_url===r);if(h.length===0)throw new Error(`Provider with base URL "${r}" not found in ${g}.`);let u=h.filter(x=>x[i]!==c);if(u.length!==0){for(let x of u)x[i]=c;Ln(g,{...l,providers:d})}}function po(r,i){Yr(r,"thinking",i)}function ho(r,i){Yr(r,"model",i)}function mo(r){let i=se(),c=In(i);c.default_provider!==r&&Ln(i,{...c,default_provider:r})}import{existsSync as Kr,readFileSync as xi}from"fs";import{join as Ti}from"path";function On(r){return!!r._zod}function He(r,i){return On(r)?Qe(r,i):r.safeParse(i)}function No(r){if(!r)return;let i;if(On(r)?i=r._zod?.def?.shape:i=r.shape,!!i){if(typeof i=="function")try{return i()}catch{return}return i}}function Si(r){return r.length===0?"object root":r.reduce((i,c,g)=>g===0?String(c):typeof c=="number"?`${i}[${c}]`:`${i}.${c}`,"")}function jr(r){if(r&&typeof r=="object"){if("issues"in r&&Array.isArray(r.issues)&&r.issues.length>0)return r.issues.map(i=>i.path?.length?`${i.message} at ${Si(i.path)}`:i.message).join(`
36
+ `);if("message"in r&&typeof r.message=="string")return r.message;try{return JSON.stringify(r)}catch{return String(r)}}return String(r)}function Ro(r){if(On(r)){let d=r._zod?.def;if(d){if(d.value!==void 0)return d.value;if(Array.isArray(d.values)&&d.values.length>0)return d.values[0]}}let c=r._def;if(c){if(c.value!==void 0)return c.value;if(Array.isArray(c.values)&&c.values.length>0)return c.values[0]}let g=r.value;if(g!==void 0)return g}var qe=Pn({module:"config"});function vi(r){return Un.has(r)}var B=class extends Error{constructor(i,c){super(i,c),this.name="ConfigError"}};function Go(r){if(r.api_key)return r.api_key;let i=vi(r.protocol)?en[r.protocol]:"";return i?process.env[i]??"":""}var bi=A.object({name:A.string(),enabled:A.boolean().optional(),command:A.string().optional(),args:A.array(A.string()).optional(),url:A.string().optional(),transport:A.string().optional(),headers:A.record(A.string(),A.string()).optional(),env:A.record(A.string(),A.string()).optional()}),Ci=A.object({id:A.string().optional(),event:A.string(),condition:A.string().optional(),action:A.object({type:A.string(),command:A.string().optional(),url:A.string().optional(),method:A.string().optional(),prompt:A.string().optional()}),reject:A.boolean().optional(),once:A.boolean().optional(),async:A.boolean().optional(),on_error:A.string().optional()}),wi=A.object({enabled:A.boolean().optional(),auto_allow:A.boolean().optional(),network_enabled:A.boolean().optional()}),Ur=A.union([A.string(),A.number(),A.boolean()]).nullish().transform(r=>r==null?"":String(r)),Ii=A.union([A.record(A.string(),Ur),A.array(A.record(A.string(),Ur)),A.null()]).transform(r=>{if(r===null)return{};if(!Array.isArray(r))return r;let i={};for(let c of r)for(let[g,l]of Object.entries(c))i[g]=l;return i}),Gr=A.looseObject({default_provider:A.number().default(0),providers:A.array(Se),permission_mode:A.enum(["default","acceptEdits","plan","bypassPermissions"]).optional(),mcp_loading:A.enum(Hn).default("auto"),theme:A.enum(qn).default("auto"),mcp_servers:A.array(bi).default([]),hooks:A.array(Ci).default([]),sandbox:wi.optional(),enable_coordinator_mode:A.boolean().optional(),enable_memory:A.boolean().optional(),env:Ii.optional()});function $o(r){return r.enable_memory!==!1}function Li(r){if(r)for(let[i,c]of Object.entries(r))process.env[i]===void 0&&(process.env[i]=c)}function Vo(){try{Pi(void 0,{allowEmptyProviders:!0})}catch{}}function Oi(r){if(!r||typeof r!="object")return nn;let i=Ze(r),c=typeof i.reason=="string"&&i.reason.length>0?i.reason:nn,g=Ze(i.mark);if(typeof g.line=="number"){let l=String(g.line+1),d=typeof g.column=="number"?`, column ${String(g.column+1)}`:"";return`${c} (line ${l}${d})`}return c}function Hr(r){let i=Fe(r,"utf-8"),c;try{c=fe.load(i)}catch(d){throw new B(`Invalid YAML in ${r}: ${Oi(d)}`,{cause:d})}let g=He(Gr,c);if(!g.success)throw new B(`Invalid configuration in ${r}: ${jr(g.error)}`);let l=g.data;return Li(l.env),{...l,providers:l.providers.map(Gn)}}function qr(r){if(r.providers.length===0)throw new B(Kn);let i=["name","protocol","base_url","model"],c=new Map;for(let g=0;g<r.providers.length;g++){let l=r.providers[g],d={name:l.name,protocol:l.protocol,base_url:l.base_url,model:l.model},h=i.filter(x=>!d[x].trim());if(h.length>0)throw new B(`Provider #${String(g+1)}: missing fields: ${h.join(", ")}`);let u=c.get(l.base_url);if(u!==void 0)throw new B(`Provider #${String(g+1)}: duplicate base_url '${l.base_url}' (already used by provider #${String(u+1)}).`);c.set(l.base_url,g)}}function Br(r){let i=new Map;for(let c=0;c<r.mcp_servers.length;c++){let g=r.mcp_servers[c],l=`MCP server #${String(c+1)}`;if(!g.name.trim())throw new B(`${l}: name must not be empty.`);let d=i.get(g.name);if(d!==void 0)throw new B(`${l}: duplicate name '${g.name}' (already used by MCP server #${String(d+1)}).`);i.set(g.name,c);let h=!!g.command?.trim(),u=!!g.url?.trim();if(h===u)throw new B(`${l} '${g.name}': configure exactly one of command or url.`);if(h&&g.transport&&g.transport!=="stdio")throw new B(`${l} '${g.name}': command servers must use stdio.`);if(u&&g.transport&&!["http","sse"].includes(g.transport))throw new B(`${l} '${g.name}': URL transport must be http or sse.`)}}var ki=A.looseObject({enabled:A.boolean().default(!0),command:A.string().optional(),args:A.array(A.string()).optional(),env:A.record(A.string(),A.string()).optional(),type:A.enum(["stdio","sse","http"]).optional(),url:A.string().optional(),headers:A.record(A.string(),A.string()).optional()}),Ni=A.looseObject({mcpServers:A.record(A.string(),A.unknown()).default({})});function Ri(r,i){let c=i.type??(i.command!==void 0?"stdio":"http");return c==="stdio"?!i.command||i.url!==void 0?null:{name:r,command:i.command,args:i.args,env:i.env}:!i.url||i.command!==void 0?null:{name:r,url:i.url,transport:c,headers:i.headers}}function Mi(r){let i=Ti(r,Bn);if(!Kr(i))return[];let c;try{c=JSON.parse(xi(i,"utf-8"))}catch(d){return qe.error({err:d,path:i},"invalid .mcp.json"),[]}let g=He(Ni,c);if(!g.success)return qe.error({error:g.error,path:i},"invalid .mcp.json"),[];let l=[];for(let[d,h]of Object.entries(g.data.mcpServers)){let u=He(ki,h);if(!d.trim()||!u.success){qe.warn({name:d,path:i,error:u.success?void 0:u.error},"skipping invalid .mcp.json server entry");continue}if(!u.data.enabled)continue;let x=Ri(d,u.data);x?l.push(x):qe.warn({name:d,path:i},"skipping invalid .mcp.json server entry")}return l}function zo(r,i){let c=Mi(i);if(c.length===0)return r;let g=new Set(r.mcp_servers.map(l=>l.name));return{...r,mcp_servers:[...r.mcp_servers,...c.filter(l=>!g.has(l.name))]}}function Pi(r,i={}){if(r){let l=Hr(r);return Br(l),(!i.allowEmptyProviders||l.providers.length>0)&&qr(l),l}let c=se();if(!Kr(c)){if(i.allowEmptyProviders)return Gr.parse({providers:[]});throw new B(`No config file found, expected ${c}.`)}let g=Hr(c);return Br(g),(!i.allowEmptyProviders||g.providers.length>0)&&qr(g),g}var $r="Tool execution was interrupted. The tool may or may not have completed; verify before relying on its effects.",Xo="The user rejected this tool use. Nothing was changed (for file edits, the new content was NOT written).",Jo="<system-reminder>",Qo="</system-reminder>",Zo=/<(?=\s*\/?\s*system-reminder\b)/giu,et=/^(.+)#L(\d+)(?:-L?(\d+))?$/,nt=/(?:^|[\s((])(?:'@([^']+)'|"@([^"]+)"|@"([^"]+)"|@'([^']+)'|@([^\s#,;,;。!?、()()<>"'`]+(?:#L\d+(?:-L?\d+)?)?))/gu;function ot(r){let i=[];for(let c=0;c<r.length;c++){let g=r[c];if(g.role==="assistant"&&g.toolUses?.length){i.push(g);let l=new Set(g.toolUses.map(u=>u.toolUseId)),d=[],h=[];for(;c+1<r.length;){let u=r[c+1];if(u.role!=="user"||!u.toolResults?.length||u.toolUses?.length)break;c++,h.push(u);for(let x of u.toolResults)l.delete(x.toolUseId)&&d.push(x)}for(let u of l)d.push({toolUseId:u,content:$r,isError:!0});i.push({...h[0]??{role:"user",content:""},toolResults:d});for(let u of h.slice(1))(u.content.length>0||u.thinkingBlocks?.length)&&i.push({...u,toolResults:[]});continue}if((g.toolResults?.length??0)>0){if(g.content.length===0&&!g.toolUses?.length&&!g.thinkingBlocks?.length)continue;i.push({...g,toolResults:[]})}else i.push(g)}return i}var oe=class extends Error{constructor(i){super(i),this.name="LLMError"}},Vr=class extends oe{constructor(i){super(i),this.name="AuthenticationError"}},zr=class extends oe{retryAfter;constructor(i,c){super(i),this.name="RateLimitError",this.retryAfter=c}},Wr=class extends oe{constructor(i){super(i),this.name="NetworkError"}},Xr=class extends oe{constructor(c,g){super(c);this.retryAfter=g;this.name="ServerError"}retryAfter},Jr=class extends oe{constructor(i){super(i),this.name="ContextTooLongError"}};function lt(r){return/context_length_exceeded/i.test(r)||/maximum\s+context\s+length/i.test(r)||/prompts?\s+(?:is\s+)?too\s+long/i.test(r)}var ft=5e3,at=10,pt="2023-06-01",dt="Model discovery failed",ht=3,mt=6e4,gt=1e3,yt=5e3,Qr=`~/${kn}/${De}`,_t=`Anthropic API key not found, set ANTHROPIC_API_KEY in ${Qr}, or via ANTHROPIC_API_KEY env variable.`,At=`OpenAI API key not found, set OPENAI_API_KEY in ${Qr}, or via OPENAI_API_KEY env variable.`;export{He as a,No as b,Ro as c,fe as d,ie as e,Fn as f,Yn as g,jn as h,ji as i,Ui as j,rn as k,Hi as l,on as m,ii as n,oi as o,ti as p,$n as q,Vn as r,_i as s,ao as t,po as u,ho as v,mo as w,Go as x,$o as y,Vo as z,zo as A,Pi as B,Xo as C,Jo as D,Qo as E,Zo as F,et as G,nt as H,ot as I,oe as J,Vr as K,zr as L,Wr as M,Xr as N,Jr as O,lt as P,ft as Q,at as R,pt as S,dt as T,ht as U,mt as V,gt as W,yt as X,_t as Y,At as Z};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __yukinoCreateRequire } from "node:module";
3
3
  const require = __yukinoCreateRequire(import.meta.url);
4
- import{a as p}from"./chunk-SLZKGKP5.js";import{B as c}from"./chunk-QSKJBSCI.js";var _="@yukino.js/yukino",d="https://registry.npmjs.org/@yukino.js%2Fyukino",h="https://registry.npmjs.org/",g="latest";var m="Could not locate the Yukino installation.",I="This Yukino installation is not managed by global npm, yarn, or pnpm. Update the source checkout or reinstall using yukino-code/install.sh or yukino-code/install.ps1.",A=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?(?:\+[\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*)?$/u;function l(e){let t=A.exec(e),n=t?.[4]?.split(".")??[];if(!t||n.some(r=>/^0\d+$/u.test(r)))throw new Error(`Invalid package version: ${e}`);return{core:[BigInt(t[1]),BigInt(t[2]),BigInt(t[3])],prerelease:n}}function T(e,t){let n=l(e),r=l(t);for(let o=0;o<n.core.length;o++)if(n.core[o]!==r.core[o])return n.core[o]>r.core[o];if(n.prerelease.length===0||r.prerelease.length===0)return n.prerelease.length===0&&r.prerelease.length>0;for(let o=0;o<Math.max(n.prerelease.length,r.prerelease.length);o++){let s=n.prerelease[o],i=r.prerelease[o];if(s===i)continue;if(s===void 0||i===void 0)return i===void 0;let u=/^\d+$/u.test(s),a=/^\d+$/u.test(i);return u&&a?BigInt(s)>BigInt(i):u===a?s>i:a}return!1}async function E({tag:e=g,signal:t}={}){if(!e||encodeURIComponent(e)!==e||[".",".."].includes(e))throw new Error(`Invalid npm dist-tag: ${e}`);let n=AbortSignal.timeout(1e4),r=await fetch(`${d}/${encodeURIComponent(e)}`,{headers:{accept:"application/json","User-Agent":`yukino/${p} (${process.platform}; ${process.arch})`},signal:t?AbortSignal.any([t,n]):n});if(r.status===404)throw new Error(`No Yukino release found for npm dist-tag "${e}".`);if(!r.ok)throw new Error(`Could not check for Yukino updates (npm dist-tag "${e}"): HTTP ${r.status}`);let o=await r.json(),s=c.object({version:c.string()}).parse(o).version;return l(s),s}async function S(e){try{let t=await E({signal:e});return T(t,p)?t:void 0}catch{return}}export{_ as a,h as b,m as c,I as d,T as e,E as f,S as g};
4
+ import{a as p}from"./chunk-EQABLL4S.js";import{B as c}from"./chunk-QSKJBSCI.js";var _="@yukino.js/yukino",d="https://registry.npmjs.org/@yukino.js%2Fyukino",h="https://registry.npmjs.org/",g="latest";var m="Could not locate the Yukino installation.",I="This Yukino installation is not managed by global npm, yarn, or pnpm. Update the source checkout or reinstall using yukino-code/install.sh or yukino-code/install.ps1.",A=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?(?:\+[\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*)?$/u;function l(e){let t=A.exec(e),n=t?.[4]?.split(".")??[];if(!t||n.some(r=>/^0\d+$/u.test(r)))throw new Error(`Invalid package version: ${e}`);return{core:[BigInt(t[1]),BigInt(t[2]),BigInt(t[3])],prerelease:n}}function T(e,t){let n=l(e),r=l(t);for(let o=0;o<n.core.length;o++)if(n.core[o]!==r.core[o])return n.core[o]>r.core[o];if(n.prerelease.length===0||r.prerelease.length===0)return n.prerelease.length===0&&r.prerelease.length>0;for(let o=0;o<Math.max(n.prerelease.length,r.prerelease.length);o++){let s=n.prerelease[o],i=r.prerelease[o];if(s===i)continue;if(s===void 0||i===void 0)return i===void 0;let u=/^\d+$/u.test(s),a=/^\d+$/u.test(i);return u&&a?BigInt(s)>BigInt(i):u===a?s>i:a}return!1}async function E({tag:e=g,signal:t}={}){if(!e||encodeURIComponent(e)!==e||[".",".."].includes(e))throw new Error(`Invalid npm dist-tag: ${e}`);let n=AbortSignal.timeout(1e4),r=await fetch(`${d}/${encodeURIComponent(e)}`,{headers:{accept:"application/json","User-Agent":`yukino/${p} (${process.platform}; ${process.arch})`},signal:t?AbortSignal.any([t,n]):n});if(r.status===404)throw new Error(`No Yukino release found for npm dist-tag "${e}".`);if(!r.ok)throw new Error(`Could not check for Yukino updates (npm dist-tag "${e}"): HTTP ${r.status}`);let o=await r.json(),s=c.object({version:c.string()}).parse(o).version;return l(s),s}async function S(e){try{let t=await E({signal:e});return T(t,p)?t:void 0}catch{return}}export{_ as a,h as b,m as c,I as d,T as e,E as f,S as g};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __yukinoCreateRequire } from "node:module";
3
3
  const require = __yukinoCreateRequire(import.meta.url);
4
- import{B as e}from"./chunk-QSKJBSCI.js";import{readFileSync as i}from"fs";import o from"path";import{fileURLToPath as c}from"url";var f=e.object({version:e.string()});function _(){return"0.0.20"}var u=_();export{u as a};
4
+ import{B as e}from"./chunk-QSKJBSCI.js";import{readFileSync as i}from"fs";import o from"path";import{fileURLToPath as c}from"url";var f=e.object({version:e.string()});function _(){return"0.0.21-dev"}var u=_();export{u as a};