@yukino.js/yukino 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -38
- package/dist/anthropic-LB4T3BEN.js +4 -0
- package/dist/browser/dist/index.html +2 -2
- package/dist/browser/dist/static/chunk-3HWUJ4KR.js +1 -0
- package/dist/browser/dist/static/{highlight-ZDY7K2CR.js → highlight-KNDEBJWF.js} +10 -10
- package/dist/browser/dist/static/index.css +1 -1
- package/dist/browser/dist/static/index.js +40 -40
- package/dist/{chunk-LUBMW3QT.js → chunk-57IGGFHK.js} +5 -5
- package/dist/{chunk-Q6322VDG.js → chunk-5AOJ5ZSQ.js} +20 -20
- package/dist/chunk-5D3QKHYQ.js +36 -0
- package/dist/{chunk-SLZKGKP5.js → chunk-CEP5W4VW.js} +1 -1
- package/dist/{chunk-FK5B4XFN.js → chunk-ENUOAMFA.js} +1 -1
- package/dist/{chunk-T3MBBXTU.js → chunk-FCZRCSNM.js} +29 -29
- package/dist/{chunk-D64ZLLSN.js → chunk-WKTO7XPO.js} +1 -1
- package/dist/{chunk-3V2Q65BE.js → chunk-XXTMMEVY.js} +197 -198
- package/dist/lib/{anthropic-UZXEGJN5.js → anthropic-TYBMDJP3.js} +3 -3
- package/dist/lib/{chunk-6RBU5LDC.js → chunk-3QGT2MSI.js} +0 -42
- package/dist/lib/{chunk-V3WAJBLN.js → chunk-IPKULHXR.js} +2 -2
- package/dist/lib/{chunk-FHJHT233.js → chunk-NIUCGP4C.js} +80 -238
- package/dist/lib/{chunk-2QPNVR5H.js → chunk-OPEO6D4O.js} +2 -5
- package/dist/lib/{chunk-Y3EO3KLE.js → chunk-ZNDE6BQM.js} +2 -2
- package/dist/lib/index.d.ts +616 -819
- package/dist/lib/index.js +666 -1441
- package/dist/lib/{openai-DNNUHOKV.js → openai-Z2JCYL6F.js} +3 -3
- package/dist/lib/{providers-NBWCB4EA.js → providers-RONNZOUT.js} +2 -2
- package/dist/{main-IEQSD5OX.js → main-V4RKN5MY.js} +221 -221
- package/dist/main.js +2 -2
- package/dist/{openai-SRAHPUVF.js → openai-UOCUBMFA.js} +1 -1
- package/dist/{providers-ETXXDQGM.js → providers-NYJNJO7D.js} +1 -1
- package/dist/server-7QJH5UCM.js +14 -0
- package/dist/{server-N2WSM46R.js → server-XFB4HEJU.js} +1 -1
- package/package.json +4 -4
- package/dist/anthropic-XJSWCDJD.js +0 -4
- package/dist/chunk-ZZF3DILS.js +0 -38
- package/dist/server-HXOWUX6N.js +0 -14
package/dist/chunk-ZZF3DILS.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{Jc as en,Pa as Dn,a as Nn,e as kn,h as Mn,j as De,m as Pn}from"./chunk-Q6322VDG.js";import{B as p,b as Ze}from"./chunk-QSKJBSCI.js";var ie=["off","minimal","low","medium","high","xhigh","max"],Fn="high";var Un={minimal:1024,low:2048,medium:8192,high:16384,xhigh:32768,max:65536},Hn=1024,Yn=1024,nn={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","openai-compat":"OPENAI_API_KEY"},Fe=new Set(Object.keys(nn)),jn=["auto","eager","native","dispatch"],qn=["auto","dark","light"],Ue="config.yaml",Bn=".mcp.json",Kn="At least one provider MUST be configured.",rn="YAML parse error";function se(){return Pn(Ue)}var ue=p.enum(["none","minimal","low","medium","high","xhigh","max"]),ii=p.enum(["low","medium","high","xhigh","max"]),oi=p.strictObject({off:p.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=p.looseObject({name:p.string(),protocol:p.enum(["anthropic","openai","openai-compat"]),base_url:p.string(),model:p.string(),api_key:p.string().optional(),thinking:p.enum(ie).optional(),reasoning:p.boolean().optional(),thinking_level_map:oi.optional(),thinking_mode:p.enum(["budget","adaptive"]).optional(),context_window:p.coerce.number().optional(),max_output_tokens:p.coerce.number().optional()});function qi(r,i){return r[i]??r[0]}function Bi(r){return ie.some(i=>i===r)}function on(r){return ui(r,r.thinking??Fn)}function ti(r){return r==="off"?0:Un[r]}function Ki(r,i){let c=tn(i,r);return c===null||c==="none"?0:ti(c)}function tn(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 li(r,i){let c=ii.safeParse(tn(r,i));return c.success?c.data:null}function ci(r){return r.reasoning===!1||r.protocol==="anthropic"&&r.thinking_mode!=="adaptive"&&zn(r)<Hn+Yn?["off"]:ie.filter(i=>{if(i==="off")return!0;if(r.protocol==="anthropic"&&r.thinking_mode==="adaptive")return li(i,r)!==null;let c=tn(i,r);return c!==null&&c!=="none"})}function ui(r,i){let c=ci(r),m="off";for(let l of ie)if(c.includes(l)&&(m=l),l===i)break;return m}function Gn(r){return{...r,thinking:on(r),context_window:$n(r),max_output_tokens:zn(r)}}function $n(r){return Number.isSafeInteger(r.context_window)&&(r.context_window??0)>0?r.context_window??1e6:1e6}function zn(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 gi}from"crypto";import{existsSync as Fr,renameSync as _i,unlinkSync as Ei}from"fs";import{dirname as Ai,join as yi}from"path";function fi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var U={},je={},ee={},Vn;function Te(){if(Vn)return ee;Vn=1;function r(g){return typeof g>"u"||g===null}function i(g){return typeof g=="object"&&g!==null}function c(g){return Array.isArray(g)?g:r(g)?[]:[g]}function m(g,u){if(u){let T=Object.keys(u);for(let s=0,d=T.length;s<d;s+=1){let O=T[s];g[O]=u[O]}}return g}function l(g,u){let T="";for(let s=0;s<u;s+=1)T+=g;return T}function h(g){return g===0&&Number.NEGATIVE_INFINITY===1/g}return ee.isNothing=r,ee.isObject=i,ee.toArray=c,ee.repeat=l,ee.isNegativeZero=h,ee.extend=m,ee}var ln,Wn;function xe(){if(Wn)return ln;Wn=1;function r(c,m){let l="",h=c.reason||"(unknown reason)";return c.mark?(c.mark.name&&(l+='in "'+c.mark.name+'" '),l+="("+(c.mark.line+1)+":"+(c.mark.column+1)+")",!m&&c.mark.snippet&&(l+=`
|
|
5
|
-
|
|
6
|
-
`+c.mark.snippet),h+" "+l):h}function i(c,m){Error.call(this),this.name="YAMLException",this.reason=c,this.mark=m,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(m){return this.name+": "+r(this,m)},ln=i,ln}var cn,Xn;function ai(){if(Xn)return cn;Xn=1;let r=Te();function i(l,h,g,u,T){let s="",d="",O=Math.floor(T/2)-1;return u-h>O&&(s=" ... ",h=u-O+s.length),g-u>O&&(d=" ...",g=u+O-d.length),{str:s+l.slice(h,g).replace(/\t/g,"\u2192")+d,pos:u-h+s.length}}function c(l,h){return r.repeat(" ",h-l.length)+l}function m(l,h){if(h=Object.create(h||null),!l.buffer)return null;h.maxLength||(h.maxLength=79),typeof h.indent!="number"&&(h.indent=1),typeof h.linesBefore!="number"&&(h.linesBefore=3),typeof h.linesAfter!="number"&&(h.linesAfter=2);let g=/\r?\n|\r|\0/g,u=[0],T=[],s,d=-1;for(;s=g.exec(l.buffer);)T.push(s.index),u.push(s.index+s[0].length),l.position<=s.index&&d<0&&(d=u.length-2);d<0&&(d=u.length-1);let O="",R=Math.min(l.line+h.linesAfter,T.length).toString().length,k=h.maxLength-(h.indent+R+3);for(let M=1;M<=h.linesBefore&&!(d-M<0);M++){let K=i(l.buffer,u[d-M],T[d-M],l.position-(u[d]-u[d-M]),k);O=r.repeat(" ",h.indent)+c((l.line-M+1).toString(),R)+" | "+K.str+`
|
|
7
|
-
`+O}let V=i(l.buffer,u[d],T[d],l.position,k);O+=r.repeat(" ",h.indent)+c((l.line+1).toString(),R)+" | "+V.str+`
|
|
8
|
-
`,O+=r.repeat("-",h.indent+R+3+V.pos)+`^
|
|
9
|
-
`;for(let M=1;M<=h.linesAfter&&!(d+M>=T.length);M++){let K=i(l.buffer,u[d+M],T[d+M],l.position-(u[d]-u[d+M]),k);O+=r.repeat(" ",h.indent)+c((l.line+M+1).toString(),R)+" | "+K.str+`
|
|
10
|
-
`}return O.replace(/\n$/,"")}return cn=m,cn}var un,Jn;function H(){if(Jn)return un;Jn=1;let r=xe(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],c=["scalar","sequence","mapping"];function m(h){let g={};return h!==null&&Object.keys(h).forEach(function(u){h[u].forEach(function(T){g[String(T)]=u})}),g}function l(h,g){if(g=g||{},Object.keys(g).forEach(function(u){if(i.indexOf(u)===-1)throw new r('Unknown option "'+u+'" is met in definition of "'+h+'" YAML type.')}),this.options=g,this.tag=h,this.kind=g.kind||null,this.resolve=g.resolve||function(){return!0},this.construct=g.construct||function(u){return u},this.instanceOf=g.instanceOf||null,this.predicate=g.predicate||null,this.represent=g.represent||null,this.representName=g.representName||null,this.defaultStyle=g.defaultStyle||null,this.multi=g.multi||!1,this.styleAliases=m(g.styleAliases||null),c.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+h+'" YAML type.')}return un=l,un}var sn,Qn;function Ar(){if(Qn)return sn;Qn=1;let r=xe(),i=H();function c(h,g){let u=[];return h[g].forEach(function(T){let s=u.length;u.forEach(function(d,O){d.tag===T.tag&&d.kind===T.kind&&d.multi===T.multi&&(s=O)}),u[s]=T}),u}function m(){let h={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function g(u){u.multi?(h.multi[u.kind].push(u),h.multi.fallback.push(u)):h[u.kind][u.tag]=h.fallback[u.tag]=u}for(let u=0,T=arguments.length;u<T;u+=1)arguments[u].forEach(g);return h}function l(h){return this.extend(h)}return l.prototype.extend=function(g){let u=[],T=[];if(g instanceof i)T.push(g);else if(Array.isArray(g))T=T.concat(g);else if(g&&(Array.isArray(g.implicit)||Array.isArray(g.explicit)))g.implicit&&(u=u.concat(g.implicit)),g.explicit&&(T=T.concat(g.explicit));else throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");u.forEach(function(d){if(!(d instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(d.loadKind&&d.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(d.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),T.forEach(function(d){if(!(d 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(T),s.compiledImplicit=c(s,"implicit"),s.compiledExplicit=c(s,"explicit"),s.compiledTypeMap=m(s.compiledImplicit,s.compiledExplicit),s},sn=l,sn}var fn,Zn;function yr(){if(Zn)return fn;Zn=1;let r=H();return fn=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),fn}var an,er;function Sr(){if(er)return an;er=1;let r=H();return an=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),an}var pn,nr;function Tr(){if(nr)return pn;nr=1;let r=H();return pn=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),pn}var dn,rr;function xr(){if(rr)return dn;rr=1;let r=Ar();return dn=new r({explicit:[yr(),Sr(),Tr()]}),dn}var hn,ir;function Cr(){if(ir)return hn;ir=1;let r=H();function i(l){if(l===null)return!0;let h=l.length;return h===1&&l==="~"||h===4&&(l==="null"||l==="Null"||l==="NULL")}function c(){return null}function m(l){return l===null}return hn=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:c,predicate:m,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),hn}var mn,or;function Or(){if(or)return mn;or=1;let r=H();function i(l){if(l===null)return!1;let h=l.length;return h===4&&(l==="true"||l==="True"||l==="TRUE")||h===5&&(l==="false"||l==="False"||l==="FALSE")}function c(l){return l==="true"||l==="True"||l==="TRUE"}function m(l){return Object.prototype.toString.call(l)==="[object Boolean]"}return mn=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:c,predicate:m,represent:{lowercase:function(l){return l?"true":"false"},uppercase:function(l){return l?"TRUE":"FALSE"},camelcase:function(l){return l?"True":"False"}},defaultStyle:"lowercase"}),mn}var gn,tr;function Ir(){if(tr)return gn;tr=1;let r=Te(),i=H();function c(s){return s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102}function m(s){return s>=48&&s<=55}function l(s){return s>=48&&s<=57}function h(s){if(s===null)return!1;let d=s.length,O=0,R=!1;if(!d)return!1;let k=s[O];if((k==="-"||k==="+")&&(k=s[++O]),k==="0"){if(O+1===d)return!0;if(k=s[++O],k==="b"){for(O++;O<d;O++){if(k=s[O],k!=="0"&&k!=="1")return!1;R=!0}return R&&isFinite(g(s))}if(k==="x"){for(O++;O<d;O++){if(!c(s.charCodeAt(O)))return!1;R=!0}return R&&isFinite(g(s))}if(k==="o"){for(O++;O<d;O++){if(!m(s.charCodeAt(O)))return!1;R=!0}return R&&isFinite(g(s))}}for(;O<d;O++){if(!l(s.charCodeAt(O)))return!1;R=!0}return R?isFinite(g(s)):!1}function g(s){let d=s,O=1,R=d[0];if((R==="-"||R==="+")&&(R==="-"&&(O=-1),d=d.slice(1),R=d[0]),d==="0")return 0;if(R==="0"){if(d[1]==="b")return O*parseInt(d.slice(2),2);if(d[1]==="x")return O*parseInt(d.slice(2),16);if(d[1]==="o")return O*parseInt(d.slice(2),8)}return O*parseInt(d,10)}function u(s){return g(s)}function T(s){return Object.prototype.toString.call(s)==="[object Number]"&&s%1===0&&!r.isNegativeZero(s)}return gn=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:h,construct:u,predicate:T,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"]}}),gn}var _n,lr;function vr(){if(lr)return _n;lr=1;let r=Te(),i=H(),c=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),m=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function l(s){return s===null||!c.test(s)?!1:isFinite(parseFloat(s,10))?!0:m.test(s)}function h(s){let d=s.toLowerCase(),O=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?O===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:O*parseFloat(d,10)}let g=/^[-+]?[0-9]+e/;function u(s,d){if(isNaN(s))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===s)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===s)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(s))return"-0.0";let O=s.toString(10);return g.test(O)?O.replace("e",".e"):O}function T(s){return Object.prototype.toString.call(s)==="[object Number]"&&(s%1!==0||r.isNegativeZero(s))}return _n=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:l,construct:h,predicate:T,represent:u,defaultStyle:"lowercase"}),_n}var En,cr;function br(){return cr||(cr=1,En=xr().extend({implicit:[Cr(),Or(),Ir(),vr()]})),En}var An,ur;function wr(){return ur||(ur=1,An=br()),An}var yn,sr;function Rr(){if(sr)return yn;sr=1;let r=H(),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 m(g){return g===null?!1:i.exec(g)!==null||c.exec(g)!==null}function l(g){let u=0,T=null,s=i.exec(g);if(s===null&&(s=c.exec(g)),s===null)throw new Error("Date resolve error");let d=+s[1],O=+s[2]-1,R=+s[3];if(!s[4])return new Date(Date.UTC(d,O,R));let k=+s[4],V=+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],Y=+(s[11]||0);T=(ne*60+Y)*6e4,s[9]==="-"&&(T=-T)}let K=new Date(Date.UTC(d,O,R,k,V,M,u));return T&&K.setTime(K.getTime()-T),K}function h(g){return g.toISOString()}return yn=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:m,construct:l,instanceOf:Date,represent:h}),yn}var Sn,fr;function Lr(){if(fr)return Sn;fr=1;let r=H();function i(c){return c==="<<"||c===null}return Sn=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i}),Sn}var Tn,ar;function Nr(){if(ar)return Tn;ar=1;let r=H(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
11
|
-
\r`;function c(g){if(g===null)return!1;let u=0,T=g.length,s=i;for(let d=0;d<T;d++){let O=s.indexOf(g.charAt(d));if(!(O>64)){if(O<0)return!1;u+=6}}return u%8===0}function m(g){let u=g.replace(/[\r\n=]/g,""),T=u.length,s=i,d=0,O=[];for(let k=0;k<T;k++)k%4===0&&k&&(O.push(d>>16&255),O.push(d>>8&255),O.push(d&255)),d=d<<6|s.indexOf(u.charAt(k));let R=T%4*6;return R===0?(O.push(d>>16&255),O.push(d>>8&255),O.push(d&255)):R===18?(O.push(d>>10&255),O.push(d>>2&255)):R===12&&O.push(d>>4&255),new Uint8Array(O)}function l(g){let u="",T=0,s=g.length,d=i;for(let R=0;R<s;R++)R%3===0&&R&&(u+=d[T>>18&63],u+=d[T>>12&63],u+=d[T>>6&63],u+=d[T&63]),T=(T<<8)+g[R];let O=s%3;return O===0?(u+=d[T>>18&63],u+=d[T>>12&63],u+=d[T>>6&63],u+=d[T&63]):O===2?(u+=d[T>>10&63],u+=d[T>>4&63],u+=d[T<<2&63],u+=d[64]):O===1&&(u+=d[T>>2&63],u+=d[T<<4&63],u+=d[64],u+=d[64]),u}function h(g){return Object.prototype.toString.call(g)==="[object Uint8Array]"}return Tn=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:c,construct:m,predicate:h,represent:l}),Tn}var xn,pr;function kr(){if(pr)return xn;pr=1;let r=H(),i=Object.prototype.hasOwnProperty,c=Object.prototype.toString;function m(h){if(h===null)return!0;let g={},u=h;for(let T=0,s=u.length;T<s;T+=1){let d=u[T],O=!1;if(c.call(d)!=="[object Object]")return!1;let R;for(R in d)if(i.call(d,R))if(!O)O=!0;else return!1;if(!O||i.call(g,R))return!1;Object.defineProperty(g,R,{value:!0})}return!0}function l(h){return h!==null?h:[]}return xn=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:m,construct:l}),xn}var Cn,dr;function Mr(){if(dr)return Cn;dr=1;let r=H(),i=Object.prototype.toString;function c(l){if(l===null)return!0;let h=l,g=new Array(h.length);for(let u=0,T=h.length;u<T;u+=1){let s=h[u];if(i.call(s)!=="[object Object]")return!1;let d=Object.keys(s);if(d.length!==1)return!1;g[u]=[d[0],s[d[0]]]}return!0}function m(l){if(l===null)return[];let h=l,g=new Array(h.length);for(let u=0,T=h.length;u<T;u+=1){let s=h[u],d=Object.keys(s);g[u]=[d[0],s[d[0]]]}return g}return Cn=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:c,construct:m}),Cn}var On,hr;function Pr(){if(hr)return On;hr=1;let r=H(),i=Object.prototype.hasOwnProperty;function c(l){if(l===null)return!0;let h=l;for(let g in h)if(i.call(h,g)&&h[g]!==null)return!1;return!0}function m(l){return l!==null?l:{}}return On=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:c,construct:m}),On}var In,mr;function bn(){return mr||(mr=1,In=wr().extend({implicit:[Rr(),Lr()],explicit:[Nr(),kr(),Mr(),Pr()]})),In}var gr;function pi(){if(gr)return je;gr=1;let r=Te(),i=xe(),c=ai(),m=bn(),l=Object.prototype.hasOwnProperty,h=1,g=2,u=3,T=4,s=1,d=2,O=3,R=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,k=/[\x85\u2028\u2029]/,V=/[,\[\]{}]/,M=/^(?:!|!!|![0-9A-Za-z-]+!)$/,K=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ne(e){return Object.prototype.toString.call(e)}function Y(e){return e===10||e===13}function j(e){return e===9||e===32}function F(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 Ke(e){if(e>=48&&e<=57)return e-48;let o=e|32;return o>=97&&o<=102?o-97+10:-1}function Ge(e){return e===120?2:e===117?4:e===85?8:0}function Ce(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 $e(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function pe(e,o,E){o==="__proto__"?Object.defineProperty(e,o,{configurable:!0,enumerable:!0,writable:!0,value:E}):e[o]=E}let Oe=new Array(256),de=new Array(256);for(let e=0;e<256;e++)Oe[e]=ae(e)?1:0,de[e]=ae(e);function D(e,o){this.input=e,this.filename=o.filename||null,this.schema=o.schema||m,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 Ie(e,o){let E={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return E.snippet=c(E),new i(o,E)}function v(e,o){throw Ie(e,o)}function te(e,o){e.onWarning&&e.onWarning.call(null,Ie(e,o))}function $(e,o,E){let A=e.anchorMapTransactions;if(A.length!==0){let a=A[A.length-1];l.call(a,o)||(a[o]={existed:l.call(e.anchorMap,o),value:e.anchorMap[o]})}e.anchorMap[o]=E}function ze(e){e.anchorMapTransactions.push(Object.create(null))}function re(e){let o=e.anchorMapTransactions.pop(),E=e.anchorMapTransactions;if(E.length===0)return;let A=E[E.length-1],a=Object.keys(o);for(let n=0,t=a.length;n<t;n+=1){let f=a[n];l.call(A,f)||(A[f]=o[f])}}function Ve(e){let o=e.anchorMapTransactions.pop(),E=Object.keys(o);for(let A=E.length-1;A>=0;A-=1){let a=o[E[A]];a.existed?e.anchorMap[E[A]]=a.value:delete e.anchorMap[E[A]]}}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 ve={YAML:function(o,E,A){o.version!==null&&v(o,"duplication of %YAML directive"),A.length!==1&&v(o,"YAML directive accepts exactly one argument");let a=/^([0-9]+)\.([0-9]+)$/.exec(A[0]);a===null&&v(o,"ill-formed argument of the YAML directive");let n=parseInt(a[1],10),t=parseInt(a[2],10);n!==1&&v(o,"unacceptable YAML version of the document"),o.version=A[0],o.checkLineBreaks=t<2,t!==1&&t!==2&&te(o,"unsupported YAML version of the document")},TAG:function(o,E,A){let a;A.length!==2&&v(o,"TAG directive accepts exactly two arguments");let n=A[0];a=A[1],M.test(n)||v(o,"ill-formed tag handle (first argument) of the TAG directive"),l.call(o.tagMap,n)&&v(o,'there is a previously declared suffix for "'+n+'" tag handle'),K.test(a)||v(o,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{v(o,"tag prefix is malformed: "+a)}o.tagMap[n]=a}};function B(e,o,E,A){if(o<E){let a=e.input.slice(o,E);if(A)for(let n=0,t=a.length;n<t;n+=1){let f=a.charCodeAt(n);f===9||f>=32&&f<=1114111||v(e,"expected valid JSON character")}else R.test(a)&&v(e,"the stream contains non-printable characters");e.result+=a}}function X(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&v(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")")}function me(e,o,E,A){r.isObject(E)||v(e,"cannot merge mappings; the provided source object is unacceptable"),X(e);let a=Object.keys(E);for(let n=0,t=a.length;n<t;n+=1){let f=a[n];X(e),l.call(o,f)||(pe(o,f,E[f]),A[f]=!0)}}function z(e,o,E,A,a,n,t,f,y){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let S=0,x=a.length;S<x;S+=1)Array.isArray(a[S])&&v(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={}),A==="tag:yaml.org,2002:merge")if(Array.isArray(n)){n.length>100&&v(e,"abnormal merge sequence size");for(let S=0,x=n.length;S<x;S+=1)me(e,o,n[S],E)}else me(e,o,n,E);else!e.json&&!l.call(E,a)&&l.call(o,a)&&(e.line=t||e.line,e.lineStart=f||e.lineStart,e.position=y||e.position,v(e,"duplicated mapping key")),pe(o,a,n),delete E[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++):v(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function P(e,o,E){let A=0,a=e.input.charCodeAt(e.position);for(;a!==0;){for(;j(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(Y(a))for(ge(e),a=e.input.charCodeAt(e.position),A++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return E!==-1&&A!==0&&e.lineIndent<E&&te(e,"deficient indentation"),A}function G(e){let o=e.position,E=e.input.charCodeAt(o);return!!((E===45||E===46)&&E===e.input.charCodeAt(o+1)&&E===e.input.charCodeAt(o+2)&&(o+=3,E=e.input.charCodeAt(o),E===0||F(E)))}function ce(e,o){o===1?e.result+=" ":o>1&&(e.result+=r.repeat(`
|
|
13
|
-
`,o-1))}function be(e,o,E){let A,a,n,t,f,y,S=e.kind,x=e.result,_=e.input.charCodeAt(e.position);if(F(_)||W(_)||_===35||_===38||_===42||_===33||_===124||_===62||_===39||_===34||_===37||_===64||_===96)return!1;if(_===63||_===45){let C=e.input.charCodeAt(e.position+1);if(F(C)||E&&W(C))return!1}for(e.kind="scalar",e.result="",A=a=e.position,n=!1;_!==0;){if(_===58){let C=e.input.charCodeAt(e.position+1);if(F(C)||E&&W(C))break}else if(_===35){let C=e.input.charCodeAt(e.position-1);if(F(C))break}else{if(e.position===e.lineStart&&G(e)||E&&W(_))break;if(Y(_))if(t=e.line,f=e.lineStart,y=e.lineIndent,P(e,!1,-1),e.lineIndent>=o){n=!0,_=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=t,e.lineStart=f,e.lineIndent=y;break}}n&&(B(e,A,a,!1),ce(e,e.line-t),A=a=e.position,n=!1),j(_)||(a=e.position+1),_=e.input.charCodeAt(++e.position)}return B(e,A,a,!1),e.result?!0:(e.kind=S,e.result=x,!1)}function _e(e,o){let E,A,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,E=A=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(B(e,E,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)E=e.position,e.position++,A=e.position;else return!0;else Y(a)?(B(e,E,A,!0),ce(e,P(e,!1,o)),E=A=e.position):e.position===e.lineStart&&G(e)?v(e,"unexpected end of the document within a single quoted scalar"):(e.position++,j(a)||(A=e.position));v(e,"unexpected end of the stream within a single quoted scalar")}function we(e,o){let E,A,a,n=e.input.charCodeAt(e.position);if(n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,E=A=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return B(e,E,e.position,!0),e.position++,!0;if(n===92){if(B(e,E,e.position,!0),n=e.input.charCodeAt(++e.position),Y(n))P(e,!1,o);else if(n<256&&Oe[n])e.result+=de[n],e.position++;else if((a=Ge(n))>0){let t=a,f=0;for(;t>0;t--)n=e.input.charCodeAt(++e.position),(a=Ke(n))>=0?f=(f<<4)+a:v(e,"expected hexadecimal character");e.result+=$e(f),e.position++}else v(e,"unknown escape sequence");E=A=e.position}else Y(n)?(B(e,E,A,!0),ce(e,P(e,!1,o)),E=A=e.position):e.position===e.lineStart&&G(e)?v(e,"unexpected end of the document within a double quoted scalar"):(e.position++,j(n)||(A=e.position))}v(e,"unexpected end of the stream within a double quoted scalar")}function Re(e,o){let E=!0,A,a,n,t=e.tag,f,y=e.anchor,S,x,_,C,I=Object.create(null),b,w,L,N=e.input.charCodeAt(e.position);if(N===91)S=93,C=!1,f=[];else if(N===123)S=125,C=!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=y,e.kind=C?"mapping":"sequence",e.result=f,!0;if(E?N===44&&v(e,"expected the node content, but found ','"):v(e,"missed comma between flow collection entries"),w=b=L=null,x=_=!1,N===63){let Z=e.input.charCodeAt(e.position+1);F(Z)&&(x=_=!0,e.position++,P(e,!0,o))}A=e.line,a=e.lineStart,n=e.position,Q(e,o,h,!1,!0),w=e.tag,b=e.result,P(e,!0,o),N=e.input.charCodeAt(e.position),(_||e.line===A)&&N===58&&(x=!0,N=e.input.charCodeAt(++e.position),P(e,!0,o),Q(e,o,h,!1,!0),L=e.result),C?z(e,f,I,w,b,L,A,a,n):x?f.push(z(e,null,I,w,b,L,A,a,n)):f.push(b),P(e,!0,o),N=e.input.charCodeAt(e.position),N===44?(E=!0,N=e.input.charCodeAt(++e.position)):E=!1}v(e,"unexpected end of the stream within a flow collection")}function J(e,o){let E,A=s,a=!1,n=!1,t=o,f=0,y=!1,S,x=e.input.charCodeAt(e.position);if(x===124)E=!1;else if(x===62)E=!0;else return!1;for(e.kind="scalar",e.result="";x!==0;)if(x=e.input.charCodeAt(++e.position),x===43||x===45)s===A?A=x===43?O:d:v(e,"repeat of a chomping mode identifier");else if((S=Ce(x))>=0)S===0?v(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?v(e,"repeat of an indentation width identifier"):(t=o+S-1,n=!0);else break;if(j(x)){do x=e.input.charCodeAt(++e.position);while(j(x));if(x===35)do x=e.input.charCodeAt(++e.position);while(!Y(x)&&x!==0)}for(;x!==0;){for(ge(e),e.lineIndent=0,x=e.input.charCodeAt(e.position);(!n||e.lineIndent<t)&&x===32;)e.lineIndent++,x=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>t&&(t=e.lineIndent),Y(x)){f++;continue}if(!n&&t===0&&v(e,"missing indentation for block scalar"),e.lineIndent<t){A===O?e.result+=r.repeat(`
|
|
14
|
-
`,a?1+f:f):A===s&&a&&(e.result+=`
|
|
15
|
-
`);break}E?j(x)?(y=!0,e.result+=r.repeat(`
|
|
16
|
-
`,a?1+f:f)):y?(y=!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 _=e.position;for(;!Y(x)&&x!==0;)x=e.input.charCodeAt(++e.position);B(e,_,e.position,!1)}return!0}function Le(e,o){let E=e.tag,A=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,v(e,"tab characters must not be used in indentation")),t===45);){let f=e.input.charCodeAt(e.position+1);if(!F(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 y=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===y||e.lineIndent>o)&&t!==0)v(e,"bad indentation of a sequence entry");else if(e.lineIndent<o)break}return n?(e.tag=E,e.anchor=A,e.kind="sequence",e.result=a,!0):!1}function Ne(e,o,E){let A,a,n,t,f=e.tag,y=e.anchor,S={},x=Object.create(null),_=null,C=null,I=null,b=!1,w=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&$(e,e.anchor,S);let L=e.input.charCodeAt(e.position);for(;L!==0;){!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation"));let N=e.input.charCodeAt(e.position+1),Z=e.line;if((L===63||L===58)&&F(N))L===63?(b&&(z(e,S,x,_,C,null,a,n,t),_=C=I=null),w=!0,b=!0,A=!0):b?(b=!1,A=!0):v(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,L=N;else{if(a=e.line,n=e.lineStart,t=e.position,!Q(e,E,g,!1,!0))break;if(e.line===Z){for(L=e.input.charCodeAt(e.position);j(L);)L=e.input.charCodeAt(++e.position);if(L===58)L=e.input.charCodeAt(++e.position),F(L)||v(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(z(e,S,x,_,C,null,a,n,t),_=C=I=null),w=!0,b=!1,A=!1,_=e.tag,C=e.result;else if(w)v(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=y,!0}else if(w)v(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=y,!0}if((e.line===Z||e.lineIndent>o)&&(b&&(a=e.line,n=e.lineStart,t=e.position),Q(e,o,T,!0,A)&&(b?C=e.result:I=e.result),b||(z(e,S,x,_,C,I,a,n,t),_=C=I=null),P(e,!0,-1),L=e.input.charCodeAt(e.position)),(e.line===Z||e.lineIndent>o)&&L!==0)v(e,"bad indentation of a mapping entry");else if(e.lineIndent<o)break}return b&&z(e,S,x,_,C,null,a,n,t),w&&(e.tag=f,e.anchor=y,e.kind="mapping",e.result=S),w}function ke(e){let o=!1,E=!1,A,a,n=e.input.charCodeAt(e.position);if(n!==33)return!1;e.tag!==null&&v(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(o=!0,n=e.input.charCodeAt(++e.position)):n===33?(E=!0,A="!!",n=e.input.charCodeAt(++e.position)):A="!";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)):v(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!F(n);)n===33&&(E?v(e,"tag suffix cannot contain exclamation marks"):(A=e.input.slice(t-1,e.position+1),M.test(A)||v(e,"named tag handle cannot contain such characters"),E=!0,t=e.position+1)),n=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),V.test(a)&&v(e,"tag suffix cannot contain flow indicator characters")}a&&!K.test(a)&&v(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{v(e,"tag name is malformed: "+a)}return o?e.tag=a:l.call(e.tagMap,A)?e.tag=e.tagMap[A]+a:A==="!"?e.tag="!"+a:A==="!!"?e.tag="tag:yaml.org,2002:"+a:v(e,'undeclared tag handle "'+A+'"'),!0}function Me(e){let o=e.input.charCodeAt(e.position);if(o!==38)return!1;e.anchor!==null&&v(e,"duplication of an anchor property"),o=e.input.charCodeAt(++e.position);let E=e.position;for(;o!==0&&!F(o)&&!W(o);)o=e.input.charCodeAt(++e.position);return e.position===E&&v(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(E,e.position),!0}function We(e){let o=e.input.charCodeAt(e.position);if(o!==42)return!1;o=e.input.charCodeAt(++e.position);let E=e.position;for(;o!==0&&!F(o)&&!W(o);)o=e.input.charCodeAt(++e.position);e.position===E&&v(e,"name of an alias node must contain at least one character");let A=e.input.slice(E,e.position);return l.call(e.anchorMap,A)||v(e,'unidentified alias "'+A+'"'),e.result=e.anchorMap[A],P(e,!0,-1),!0}function Pe(e,o,E,A){let a=he(e);return ze(e),le(e,o),e.tag=null,e.anchor=null,e.kind=null,e.result=null,Ne(e,E,A)&&e.kind==="mapping"?(re(e),!0):(Ve(e),le(e,a),!1)}function Q(e,o,E,A,a){let n,t,f=1,y=!1,S=!1,x=null,_,C,I;e.depth>=e.maxDepth&&v(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 b=n=t=T===E||u===E;if(A&&P(e,!0,-1)&&(y=!0,e.lineIndent>o?f=1:e.lineIndent===o?f=0:e.lineIndent<o&&(f=-1)),f===1)for(;;){let w=e.input.charCodeAt(e.position),L=he(e);if(y&&(w===33&&e.tag!==null||w===38&&e.anchor!==null)||!ke(e)&&!Me(e))break;x===null&&(x=L),P(e,!0,-1)?(y=!0,t=b,e.lineIndent>o?f=1:e.lineIndent===o?f=0:e.lineIndent<o&&(f=-1)):t=!1}if(t&&(t=y||a),f===1||T===E)if(h===E||g===E?C=o:C=o+1,I=e.position-e.lineStart,f===1)if(t&&(Le(e,I)||Ne(e,I,C))||Re(e,C))S=!0;else{let w=e.input.charCodeAt(e.position);x!==null&&b&&!t&&w!==124&&w!==62&&Pe(e,x,x.position-x.lineStart,C)||n&&J(e,C)||_e(e,C)||we(e,C)?S=!0:We(e)?(S=!0,(e.tag!==null||e.anchor!==null)&&v(e,"alias node should not have any properties")):be(e,C,h===E)&&(S=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&$(e,e.anchor,e.result)}else f===0&&(S=t&&Le(e,I));if(e.tag===null)e.anchor!==null&&$(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&v(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let w=0,L=e.implicitTypes.length;w<L;w+=1)if(_=e.implicitTypes[w],_.resolve(e.result)){e.result=_.construct(e.result),e.tag=_.tag,e.anchor!==null&&$(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(l.call(e.typeMap[e.kind||"fallback"],e.tag))_=e.typeMap[e.kind||"fallback"][e.tag];else{_=null;let w=e.typeMap.multi[e.kind||"fallback"];for(let L=0,N=w.length;L<N;L+=1)if(e.tag.slice(0,w[L].tag.length)===w[L].tag){_=w[L];break}}_||v(e,"unknown tag !<"+e.tag+">"),e.result!==null&&_.kind!==e.kind&&v(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+_.kind+'", not "'+e.kind+'"'),_.resolve(e.result,e.tag)?(e.result=_.construct(e.result,e.tag),e.anchor!==null&&$(e,e.anchor,e.result)):v(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 Xe(e){let o=e.position,E=!1,A;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(A=e.input.charCodeAt(e.position))!==0&&(P(e,!0,-1),A=e.input.charCodeAt(e.position),!(e.lineIndent>0||A!==37));){E=!0,A=e.input.charCodeAt(++e.position);let a=e.position;for(;A!==0&&!F(A);)A=e.input.charCodeAt(++e.position);let n=e.input.slice(a,e.position),t=[];for(n.length<1&&v(e,"directive name must not be less than one character in length");A!==0;){for(;j(A);)A=e.input.charCodeAt(++e.position);if(A===35){do A=e.input.charCodeAt(++e.position);while(A!==0&&!Y(A));break}if(Y(A))break;for(a=e.position;A!==0&&!F(A);)A=e.input.charCodeAt(++e.position);t.push(e.input.slice(a,e.position))}A!==0&&ge(e),l.call(ve,n)?ve[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)):E&&v(e,"directives end mark is expected"),Q(e,e.lineIndent-1,T,!1,!0),P(e,!0,-1),e.checkLineBreaks&&k.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&&v(e,"end of the stream or a document separator is expected")}function Ee(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 E=new D(e,o),A=e.indexOf("\0");for(A!==-1&&(E.position=A,v(E,"null byte is not allowed in input")),E.input+="\0";E.input.charCodeAt(E.position)===32;)E.lineIndent+=1,E.position+=1;for(;E.position<E.length-1;)Xe(E);return E.documents}function Je(e,o,E){o!==null&&typeof o=="object"&&typeof E>"u"&&(E=o,o=null);let A=Ee(e,E);if(typeof o!="function")return A;for(let a=0,n=A.length;a<n;a+=1)o(A[a])}function Qe(e,o){let E=Ee(e,o);if(E.length!==0){if(E.length===1)return E[0];throw new i("expected a single document in the stream, but found more")}}return je.loadAll=Je,je.load=Qe,je}var vn={},_r;function di(){if(_r)return vn;_r=1;let r=Te(),i=xe(),c=bn(),m=Object.prototype.toString,l=Object.prototype.hasOwnProperty,h=65279,g=9,u=10,T=13,s=32,d=33,O=34,R=35,k=37,V=38,M=39,K=42,ne=44,Y=45,j=58,F=61,W=62,Ke=63,Ge=64,Ce=91,ae=93,$e=96,pe=123,Oe=124,de=125,D={};D[0]="\\0",D[7]="\\a",D[8]="\\b",D[9]="\\t",D[10]="\\n",D[11]="\\v",D[12]="\\f",D[13]="\\r",D[27]="\\e",D[34]='\\"',D[92]="\\\\",D[133]="\\N",D[160]="\\_",D[8232]="\\L",D[8233]="\\P";let Ie=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],v=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function te(n,t){if(t===null)return{};let f={},y=Object.keys(t);for(let S=0,x=y.length;S<x;S+=1){let _=y[S],C=String(t[_]);_.slice(0,2)==="!!"&&(_="tag:yaml.org,2002:"+_.slice(2));let I=n.compiledTypeMap.fallback[_];I&&l.call(I.styleAliases,C)&&(C=I.styleAliases[C]),f[_]=C}return f}function $(n){let t,f,y=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-y.length)+y}let ze=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:ze,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),y=0,S="",x=n.length;for(;y<x;){let _,C=n.indexOf(`
|
|
21
|
-
`,y);C===-1?(_=n.slice(y),y=x):(_=n.slice(y,C+1),y=C+1),_.length&&_!==`
|
|
22
|
-
`&&(S+=f),S+=_}return S}function le(n,t){return`
|
|
23
|
-
`+r.repeat(" ",n.indent*t)}function ve(n,t){for(let f=0,y=n.implicitTypes.length;f<y;f+=1)if(n.implicitTypes[f].resolve(t))return!0;return!1}function B(n){return n===s||n===g}function X(n){return n>=32&&n<=126||n>=161&&n<=55295&&n!==8232&&n!==8233||n>=57344&&n<=65533&&n!==h||n>=65536&&n<=1114111}function me(n){return X(n)&&n!==h&&n!==T&&n!==u}function z(n,t,f){let y=me(n),S=y&&!B(n);return(f?y:y&&n!==ne&&n!==Ce&&n!==ae&&n!==pe&&n!==de)&&n!==R&&!(t===j&&!S)||me(t)&&!B(t)&&n===R||t===j&&S}function ge(n){return X(n)&&n!==h&&!B(n)&&n!==Y&&n!==Ke&&n!==j&&n!==ne&&n!==Ce&&n!==ae&&n!==pe&&n!==de&&n!==R&&n!==V&&n!==K&&n!==d&&n!==Oe&&n!==F&&n!==W&&n!==M&&n!==O&&n!==k&&n!==Ge&&n!==$e}function P(n){return!B(n)&&n!==j}function G(n,t){let f=n.charCodeAt(t),y;return f>=55296&&f<=56319&&t+1<n.length&&(y=n.charCodeAt(t+1),y>=56320&&y<=57343)?(f-55296)*1024+y-56320+65536:f}function ce(n){return/^\n* /.test(n)}let be=1,_e=2,we=3,Re=4,J=5;function Le(n,t,f,y,S,x,_,C){let I,b=0,w=null,L=!1,N=!1,Z=y!==-1,Ae=-1,ye=ge(G(n,0))&&P(G(n,n.length-1));if(t||_)for(I=0;I<n.length;b>=65536?I+=2:I++){if(b=G(n,I),!X(b))return J;ye=ye&&z(b,w,C),w=b}else{for(I=0;I<n.length;b>=65536?I+=2:I++){if(b=G(n,I),b===u)L=!0,Z&&(N=N||I-Ae-1>y&&n[Ae+1]!==" ",Ae=I);else if(!X(b))return J;ye=ye&&z(b,w,C),w=b}N=N||Z&&I-Ae-1>y&&n[Ae+1]!==" "}return!L&&!N?ye&&!_&&!S(n)?be:x===re?J:_e:f>9&&ce(n)?J:_?x===re?J:_e:N?Re:we}function Ne(n,t,f,y,S){n.dump=(function(){if(t.length===0)return n.quotingType===re?'""':"''";if(!n.noCompatMode&&(Ie.indexOf(t)!==-1||v.test(t)))return n.quotingType===re?'"'+t+'"':"'"+t+"'";let x=n.indent*Math.max(1,f),_=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-x),C=y||n.flowLevel>-1&&f>=n.flowLevel;function I(b){return ve(n,b)}switch(Le(t,C,n.indent,_,I,n.quotingType,n.forceQuotes&&!y,S)){case be:return t;case _e:return"'"+t.replace(/'/g,"''")+"'";case we:return"|"+ke(t,n.indent)+Me(he(t,x));case Re:return">"+ke(t,n.indent)+Me(he(We(t,_),x));case J:return'"'+Q(t)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function ke(n,t){let f=ce(n)?String(t):"",y=n[n.length-1]===`
|
|
24
|
-
`,x=y&&(n[n.length-2]===`
|
|
25
|
-
`||n===`
|
|
26
|
-
`)?"+":y?"":"-";return f+x+`
|
|
27
|
-
`}function Me(n){return n[n.length-1]===`
|
|
28
|
-
`?n.slice(0,-1):n}function We(n,t){let f=/(\n+)([^\n]*)/g,y=(function(){let C=n.indexOf(`
|
|
29
|
-
`);return C=C!==-1?C:n.length,f.lastIndex=C,Pe(n.slice(0,C),t)})(),S=n[0]===`
|
|
30
|
-
`||n[0]===" ",x,_;for(;_=f.exec(n);){let C=_[1],I=_[2];x=I[0]===" ",y+=C+(!S&&!x&&I!==""?`
|
|
31
|
-
`:"")+Pe(I,t),S=x}return y}function Pe(n,t){if(n===""||n[0]===" ")return n;let f=/ [^ ]/g,y,S=0,x,_=0,C=0,I="";for(;y=f.exec(n);)C=y.index,C-S>t&&(x=_>S?_:C,I+=`
|
|
32
|
-
`+n.slice(S,x),S=x+1),_=C;return I+=`
|
|
33
|
-
`,n.length-S>t&&_>S?I+=n.slice(S,_)+`
|
|
34
|
-
`+n.slice(_+1):I+=n.slice(S),I.slice(1)}function Q(n){let t="",f=0;for(let y=0;y<n.length;f>=65536?y+=2:y++){f=G(n,y);let S=D[f];!S&&X(f)?(t+=n[y],f>=65536&&(t+=n[y+1])):t+=S||$(f)}return t}function Xe(n,t,f){let y="",S=n.tag;for(let x=0,_=f.length;x<_;x+=1){let C=f[x];n.replacer&&(C=n.replacer.call(f,String(x),C)),(o(n,t,C,!1,!1)||typeof C>"u"&&o(n,t,null,!1,!1))&&(y!==""&&(y+=","+(n.condenseFlow?"":" ")),y+=n.dump)}n.tag=S,n.dump="["+y+"]"}function Ee(n,t,f,y){let S="",x=n.tag;for(let _=0,C=f.length;_<C;_+=1){let I=f[_];n.replacer&&(I=n.replacer.call(f,String(_),I)),(o(n,t+1,I,!0,!0,!1,!0)||typeof I>"u"&&o(n,t+1,null,!0,!0,!1,!0))&&((!y||S!=="")&&(S+=le(n,t)),n.dump&&u===n.dump.charCodeAt(0)?S+="-":S+="- ",S+=n.dump)}n.tag=x,n.dump=S||"[]"}function Je(n,t,f){let y="",S=n.tag,x=Object.keys(f);for(let _=0,C=x.length;_<C;_+=1){let I="";y!==""&&(I+=", "),n.condenseFlow&&(I+='"');let b=x[_],w=f[b];n.replacer&&(w=n.replacer.call(f,b,w)),o(n,t,b,!1,!1)&&(n.dump.length>1024&&(I+="? "),I+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),o(n,t,w,!1,!1)&&(I+=n.dump,y+=I))}n.tag=S,n.dump="{"+y+"}"}function Qe(n,t,f,y){let S="",x=n.tag,_=Object.keys(f);if(n.sortKeys===!0)_.sort();else if(typeof n.sortKeys=="function")_.sort(n.sortKeys);else if(n.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let C=0,I=_.length;C<I;C+=1){let b="";(!y||S!=="")&&(b+=le(n,t));let w=_[C],L=f[w];if(n.replacer&&(L=n.replacer.call(f,w,L)),!o(n,t+1,w,!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)?b+="?":b+="? "),b+=n.dump,N&&(b+=le(n,t)),o(n,t+1,L,!0,N)&&(n.dump&&u===n.dump.charCodeAt(0)?b+=":":b+=": ",b+=n.dump,S+=b)}n.tag=x,n.dump=S||"{}"}function e(n,t,f){let y=f?n.explicitTypes:n.implicitTypes;for(let S=0,x=y.length;S<x;S+=1){let _=y[S];if((_.instanceOf||_.predicate)&&(!_.instanceOf||typeof t=="object"&&t instanceof _.instanceOf)&&(!_.predicate||_.predicate(t))){if(f?_.multi&&_.representName?n.tag=_.representName(t):n.tag=_.tag:n.tag="?",_.represent){let C=n.styleMap[_.tag]||_.defaultStyle,I;if(m.call(_.represent)==="[object Function]")I=_.represent(t,C);else if(l.call(_.represent,C))I=_.represent[C](t,C);else throw new i("!<"+_.tag+'> tag resolver accepts not "'+C+'" style');n.dump=I}return!0}}return!1}function o(n,t,f,y,S,x,_){n.tag=null,n.dump=f,e(n,f,!1)||e(n,f,!0);let C=m.call(n.dump),I=y;y&&(y=n.flowLevel<0||n.flowLevel>t);let b=C==="[object Object]"||C==="[object Array]",w,L;if(b&&(w=n.duplicates.indexOf(f),L=w!==-1),(n.tag!==null&&n.tag!=="?"||L||n.indent!==2&&t>0)&&(S=!1),L&&n.usedDuplicates[w])n.dump="*ref_"+w;else{if(b&&L&&!n.usedDuplicates[w]&&(n.usedDuplicates[w]=!0),C==="[object Object]")y&&Object.keys(n.dump).length!==0?(Qe(n,t,n.dump,S),L&&(n.dump="&ref_"+w+n.dump)):(Je(n,t,n.dump),L&&(n.dump="&ref_"+w+" "+n.dump));else if(C==="[object Array]")y&&n.dump.length!==0?(n.noArrayIndent&&!_&&t>0?Ee(n,t-1,n.dump,S):Ee(n,t,n.dump,S),L&&(n.dump="&ref_"+w+n.dump)):(Xe(n,t,n.dump),L&&(n.dump="&ref_"+w+" "+n.dump));else if(C==="[object String]")n.tag!=="?"&&Ne(n,n.dump,t,x,I);else{if(C==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+C)}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 E(n,t){let f=[],y=[];A(n,f,y);let S=y.length;for(let x=0;x<S;x+=1)t.duplicates.push(f[y[x]]);t.usedDuplicates=new Array(S)}function A(n,t,f){if(n!==null&&typeof n=="object"){let y=t.indexOf(n);if(y!==-1)f.indexOf(y)===-1&&f.push(y);else if(t.push(n),Array.isArray(n))for(let S=0,x=n.length;S<x;S+=1)A(n[S],t,f);else{let S=Object.keys(n);for(let x=0,_=S.length;x<_;x+=1)A(n[S[x]],t,f)}}}function a(n,t){t=t||{};let f=new Ve(t);f.noRefs||E(n,f);let y=n;return f.replacer&&(y=f.replacer.call({"":y},"",y)),o(f,0,y,!0,!0)?f.dump+`
|
|
35
|
-
`:""}return vn.dump=a,vn}var Er;function hi(){if(Er)return U;Er=1;let r=pi(),i=di();function c(m,l){return function(){throw new Error("Function yaml."+m+" is removed in js-yaml 4. Use yaml."+l+" instead, which is now safe by default.")}}return U.Type=H(),U.Schema=Ar(),U.FAILSAFE_SCHEMA=xr(),U.JSON_SCHEMA=br(),U.CORE_SCHEMA=wr(),U.DEFAULT_SCHEMA=bn(),U.load=r.load,U.loadAll=r.loadAll,U.dump=i.dump,U.YAMLException=xe(),U.types={binary:Nr(),float:vr(),map:Tr(),null:Cr(),pairs:Mr(),set:Pr(),timestamp:Rr(),bool:Or(),int:Ir(),merge:Lr(),omap:kr(),seq:Sr(),str:yr()},U.safeLoad=c("safeLoad","load"),U.safeLoadAll=c("safeLoadAll","loadAll"),U.safeDump=c("safeDump","dump"),U}var mi=hi(),fe=fi(mi),{Type:Gi,Schema:$i,FAILSAFE_SCHEMA:zi,JSON_SCHEMA:Vi,CORE_SCHEMA:Wi,DEFAULT_SCHEMA:Xi,load:Ji,loadAll:Qi,dump:Zi,YAMLException:eo,types:no,safeLoad:ro,safeLoadAll:io,safeDump:oo}=fe;var Dr=(r,i,c)=>p.preprocess(m=>m===void 0||typeof m=="string"&&!m.trim()?r:m,p.union([p.number(),p.string().trim().regex(/^\d+$/,"Enter a whole number").transform(Number)]).pipe(p.number().int().min(i).max(c))),Si=Se.extend({name:p.string().trim().min(1,"Name is required"),base_url:p.url("Enter a valid HTTP(S) URL").refine(r=>/^https?:\/\//i.test(r),"Use an HTTP(S) URL"),api_key:p.string().trim().min(1,"API key is required"),model:p.string().trim().min(1,"Model is required"),thinking:p.enum(ie).optional(),context_window:Dr(1e6,1e3,1e7),max_output_tokens:Dr(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:on(r)}));function wn(r){if(!Fr(r))return{};let i;try{i=fe.load(De(r,"utf-8"))}catch{throw new Error(`Unable to read existing ${r}; it has not been changed.`)}return p.record(p.string(),p.unknown()).parse(i??{})}function Rn(r,i){let c=Ai(r);kn(c,{recursive:!0});let m=yi(c,`.config-${gi()}.tmp`);try{Mn(m,fe.dump(i,{lineWidth:-1,noRefs:!0}),{encoding:"utf-8",mode:384,flag:"wx"}),_i(m,r)}finally{Fr(m)&&Ei(m)}}function mo(r,i){let c=Si.parse(r),m=se(),l=wn(m),g=[...p.array(p.record(p.string(),p.unknown())).parse(l.providers??[])];for(let d of i)g.some(O=>O.base_url===d.base_url)||g.push({...d});let u=[],T=!1;for(let d of g){if(d.base_url!==c.base_url){u.push(d);continue}T||(T=!0,u.push(c))}T||u.push(c);let s=u.map(d=>Se.parse(d));return Rn(m,{...l,providers:u}),{provider:c,providers:s,replaced:T,path:m}}function Ur(r,i,c){let m=se(),l=wn(m),h=p.array(p.record(p.string(),p.unknown())).parse(l.providers??[]),g=h.filter(T=>T.base_url===r);if(g.length===0)throw new Error(`Provider with base URL "${r}" not found in ${m}.`);let u=g.filter(T=>T[i]!==c);if(u.length!==0){for(let T of u)T[i]=c;Rn(m,{...l,providers:h})}}function go(r,i){Ur(r,"thinking",i)}function _o(r,i){Ur(r,"model",i)}function Eo(r){let i=se(),c=wn(i);c.default_provider!==r&&Rn(i,{...c,default_provider:r})}import{existsSync as zr,readFileSync as Oi}from"fs";import{join as Ii}from"path";function Ln(r){return!!r._zod}function qe(r,i){return Ln(r)?Ze(r,i):r.safeParse(i)}function Po(r){if(!r)return;let i;if(Ln(r)?i=r._zod?.def?.shape:i=r.shape,!!i){if(typeof i=="function")try{return i()}catch{return}return i}}function Ci(r){return r.length===0?"object root":r.reduce((i,c,m)=>m===0?String(c):typeof c=="number"?`${i}[${c}]`:`${i}.${c}`,"")}function Hr(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 ${Ci(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 Do(r){if(Ln(r)){let h=r._zod?.def;if(h){if(h.value!==void 0)return h.value;if(Array.isArray(h.values)&&h.values.length>0)return h.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 m=r.value;if(m!==void 0)return m}var Uo="Content-Length",Ho=/^Content-Length:\s*(\d+)\s*$/gimu,Yo=`\r
|
|
37
|
-
\r
|
|
38
|
-
`;var jo="initialize",qo="initialized",Bo="shutdown",Ko="exit",Go="$/cancelRequest",$o="workspace/didChangeConfiguration",zo="workspace/applyEdit",Vo="workspace/configuration",Wo="workspace/workspaceFolders",Xo="window/showMessageRequest",Jo="window/workDoneProgress/create";var Qo="yukino",Zo="utf-16",et="LSP request interrupted",nt="LSP header exceeds 8KB",rt="Expected one Content-Length header",it="LSP message exceeds 16MB",ot="Invalid JSON-RPC message",tt="LSP request failed",lt="Unsupported read-only client method",ct="Yukino LSP is read-only; use authorized file tools for edits.",ut="Invalid LSP initialize response",st="Only UTF-16 LSP positions are supported",ft="LSP client disposed",Yr=/^\.[\w-]+$/u,jr="At least one file extension is required";var qr=p.object({name:p.string().trim().min(1),command:p.string().min(1),args:p.array(p.string()).optional(),languages:p.record(p.string().regex(Yr),p.string().min(1)).refine(r=>Object.keys(r).length>0,jr),env:p.record(p.string(),p.string()).optional(),initialization_options:p.record(p.string(),p.unknown()).optional(),settings:p.record(p.string(),p.unknown()).optional(),timeout_ms:p.number().int().min(100).max(6e4).optional()});var Be=Dn({module:"config"});function vi(r){return Fe.has(r)}var q=class extends Error{constructor(i,c){super(i,c),this.name="ConfigError"}};function It(r){if(r.api_key)return r.api_key;let i=vi(r.protocol)?nn[r.protocol]:"";return i?process.env[i]??"":""}var bi=p.object({name:p.string(),enabled:p.boolean().optional(),command:p.string().optional(),args:p.array(p.string()).optional(),url:p.string().optional(),transport:p.string().optional(),headers:p.record(p.string(),p.string()).optional(),env:p.record(p.string(),p.string()).optional()}),wi=p.object({id:p.string().optional(),event:p.string(),condition:p.string().optional(),action:p.object({type:p.string(),command:p.string().optional(),url:p.string().optional(),method:p.string().optional(),prompt:p.string().optional()}),reject:p.boolean().optional(),once:p.boolean().optional(),async:p.boolean().optional(),on_error:p.string().optional()}),Ri=p.object({enabled:p.boolean().optional(),auto_allow:p.boolean().optional(),network_enabled:p.boolean().optional()}),Br=p.union([p.string(),p.number(),p.boolean()]).nullish().transform(r=>r==null?"":String(r)),Li=p.union([p.record(p.string(),Br),p.array(p.record(p.string(),Br)),p.null()]).transform(r=>{if(r===null)return{};if(!Array.isArray(r))return r;let i={};for(let c of r)for(let[m,l]of Object.entries(c))i[m]=l;return i}),Vr=p.looseObject({default_provider:p.number().default(0),providers:p.array(Se),permission_mode:p.enum(["default","acceptEdits","plan","bypassPermissions"]).optional(),mcp_loading:p.enum(jn).default("auto"),theme:p.enum(qn).default("auto"),mcp_servers:p.array(bi).default([]),lsp_servers:p.array(qr).refine(r=>new Set(r.map(i=>i.name)).size===r.length,"LSP server names must be unique").optional(),hooks:p.array(wi).default([]),sandbox:Ri.optional(),enable_coordinator_mode:p.boolean().optional(),enable_fork:p.boolean().optional(),enable_memory:p.boolean().optional(),env:Li.optional()});function vt(r){return r.enable_fork!==!1}function bt(r){return r.enable_memory!==!1}function Ni(r){if(r)for(let[i,c]of Object.entries(r))process.env[i]===void 0&&(process.env[i]=c)}function wt(){try{Ui(void 0,{allowEmptyProviders:!0})}catch{}}function ki(r){if(!r||typeof r!="object")return rn;let i=en(r),c=typeof i.reason=="string"&&i.reason.length>0?i.reason:rn,m=en(i.mark);if(typeof m.line=="number"){let l=String(m.line+1),h=typeof m.column=="number"?`, column ${String(m.column+1)}`:"";return`${c} (line ${l}${h})`}return c}function Kr(r){let i=De(r,"utf-8"),c;try{c=fe.load(i)}catch(h){throw new q(`Invalid YAML in ${r}: ${ki(h)}`,{cause:h})}let m=qe(Vr,c);if(!m.success)throw new q(`Invalid configuration in ${r}: ${Hr(m.error)}`);let l=m.data;return Ni(l.env),{...l,providers:l.providers.map(Gn)}}function Gr(r){if(r.providers.length===0)throw new q(Kn);let i=["name","protocol","base_url","model"],c=new Map;for(let m=0;m<r.providers.length;m++){let l=r.providers[m],h={name:l.name,protocol:l.protocol,base_url:l.base_url,model:l.model},g=i.filter(T=>!h[T].trim());if(g.length>0)throw new q(`Provider #${String(m+1)}: missing fields: ${g.join(", ")}`);if(!Fe.has(l.protocol))throw new q(`Provider #${String(m+1)}: invalid protocol '${l.protocol}', MUST be one of: ${Array.from(Fe).join(", ")}`);let u=c.get(l.base_url);if(u!==void 0)throw new q(`Provider #${String(m+1)}: duplicate base_url '${l.base_url}' (already used by provider #${String(u+1)}).`);c.set(l.base_url,m)}}function $r(r){let i=new Map;for(let c=0;c<r.mcp_servers.length;c++){let m=r.mcp_servers[c],l=`MCP server #${String(c+1)}`;if(!m.name.trim())throw new q(`${l}: name must not be empty.`);let h=i.get(m.name);if(h!==void 0)throw new q(`${l}: duplicate name '${m.name}' (already used by MCP server #${String(h+1)}).`);i.set(m.name,c);let g=!!m.command?.trim(),u=!!m.url?.trim();if(g===u)throw new q(`${l} '${m.name}': configure exactly one of command or url.`);if(g&&m.transport&&m.transport!=="stdio")throw new q(`${l} '${m.name}': command servers must use stdio.`);if(u&&m.transport&&!["http","sse"].includes(m.transport))throw new q(`${l} '${m.name}': URL transport must be http or sse.`)}}var Mi=p.looseObject({enabled:p.boolean().default(!0),command:p.string().optional(),args:p.array(p.string()).optional(),env:p.record(p.string(),p.string()).optional(),type:p.enum(["stdio","sse","http"]).optional(),url:p.string().optional(),headers:p.record(p.string(),p.string()).optional()}),Pi=p.looseObject({mcpServers:p.record(p.string(),p.unknown()).default({})});function Di(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 Fi(r){let i=Ii(r,Bn);if(!zr(i))return[];let c;try{c=JSON.parse(Oi(i,"utf-8"))}catch(h){return Be.error({err:h,path:i},"invalid .mcp.json"),[]}let m=qe(Pi,c);if(!m.success)return Be.error({error:m.error,path:i},"invalid .mcp.json"),[];let l=[];for(let[h,g]of Object.entries(m.data.mcpServers)){let u=qe(Mi,g);if(!h.trim()||!u.success){Be.warn({name:h,path:i,error:u.success?void 0:u.error},"skipping invalid .mcp.json server entry");continue}if(!u.data.enabled)continue;let T=Di(h,u.data);T?l.push(T):Be.warn({name:h,path:i},"skipping invalid .mcp.json server entry")}return l}function Rt(r,i){let c=Fi(i);if(c.length===0)return r;let m=new Set(r.mcp_servers.map(l=>l.name));return{...r,mcp_servers:[...r.mcp_servers,...c.filter(l=>!m.has(l.name))]}}function Ui(r,i={}){if(r){let l=Kr(r);return $r(l),(!i.allowEmptyProviders||l.providers.length>0)&&Gr(l),l}let c=se();if(!zr(c)){if(i.allowEmptyProviders)return Vr.parse({providers:[]});throw new q(`No config file found, expected ${c}.`)}let m=Kr(c);return $r(m),(!i.allowEmptyProviders||m.providers.length>0)&&Gr(m),m}var Wr="Tool execution was interrupted. The tool may or may not have completed; verify before relying on its effects.",Nt="The user rejected this tool use. Nothing was changed (for file edits, the new content was NOT written).",kt="<system-reminder>",Mt="</system-reminder>",Pt=/<(?=\s*\/?\s*system-reminder\b)/giu,Dt=/^(.+)#L(\d+)(?:-L?(\d+))?$/,Ft=/(?:^|[\s((])(?:'@([^']+)'|"@([^"]+)"|@"([^"]+)"|@'([^']+)'|@([^\s#,;,;。!?、()()<>"'`]+(?:#L\d+(?:-L?\d+)?)?))/gu;function Yt(r){let i=[];for(let c=0;c<r.length;c++){let m=r[c];if(m.role==="assistant"&&m.toolUses?.length){i.push(m);let l=new Set(m.toolUses.map(u=>u.toolUseId)),h=[],g=[];for(;c+1<r.length;){let u=r[c+1];if(u.role!=="user"||!u.toolResults?.length||u.toolUses?.length)break;c++,g.push(u);for(let T of u.toolResults)l.delete(T.toolUseId)&&h.push(T)}for(let u of l)h.push({toolUseId:u,content:Wr,isError:!0});i.push({...g[0]??{role:"user",content:""},toolResults:h});for(let u of g.slice(1))(u.content.length>0||u.thinkingBlocks?.length)&&i.push({...u,toolResults:[]});continue}if((m.toolResults?.length??0)>0){if(m.content.length===0&&!m.toolUses?.length&&!m.thinkingBlocks?.length)continue;i.push({...m,toolResults:[]})}else i.push(m)}return i}var oe=class extends Error{constructor(i){super(i),this.name="LLMError"}},Xr=class extends oe{constructor(i){super(i),this.name="AuthenticationError"}},Jr=class extends oe{retryAfter;constructor(i,c){super(i),this.name="RateLimitError",this.retryAfter=c}},Qr=class extends oe{constructor(i){super(i),this.name="NetworkError"}},Zr=class extends oe{constructor(c,m){super(c);this.retryAfter=m;this.name="ServerError"}retryAfter},ei=class extends oe{constructor(i){super(i),this.name="ContextTooLongError"}};function qt(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 $t=5e3,zt=10,Vt="2023-06-01",Wt="Model discovery failed",Xt=3,Jt=6e4,Qt=1e3,Zt=5e3,ni=`~/${Nn}/${Ue}`,el=`Anthropic API key not found, set ANTHROPIC_API_KEY in ${ni}, or via ANTHROPIC_API_KEY env variable.`,nl=`OpenAI API key not found, set OPENAI_API_KEY in ${ni}, or via OPENAI_API_KEY env variable.`;export{qe as a,Po as b,Do as c,fe as d,ie as e,Fn as f,Hn as g,Yn as h,qi as i,Bi as j,on as k,Ki as l,tn as m,li as n,ci as o,ui as p,$n as q,zn as r,Uo as s,Ho as t,Yo as u,jo as v,qo as w,Bo as x,Ko as y,Go as z,$o as A,zo as B,Vo as C,Wo as D,Xo as E,Jo as F,Qo as G,Zo as H,et as I,nt as J,rt as K,it as L,ot as M,tt as N,lt as O,ct as P,ut as Q,st as R,ft as S,Si as T,mo as U,go as V,_o as W,Eo as X,It as Y,vt as Z,bt as _,wt as $,Rt as aa,Ui as ba,Nt as ca,kt as da,Mt as ea,Pt as fa,Dt as ga,Ft as ha,Yt as ia,oe as ja,Xr as ka,Jr as la,Qr as ma,Zr as na,ei as oa,qt as pa,$t as qa,zt as ra,Vt as sa,Wt as ta,Xt as ua,Jt as va,Qt as wa,Zt as xa,el as ya,nl as za};
|