@codehourra/llm-iwiki 0.2.1 → 0.3.0

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/dist/index.js CHANGED
@@ -1,147 +1,147 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as gg}from"node:module";var D=(u,_)=>()=>(_||u((_={exports:{}}).exports,_),_.exports);var s_=gg(import.meta.url);var X=D((Ug)=>{var us=Symbol.for("yaml.alias"),Q$=Symbol.for("yaml.document"),$_=Symbol.for("yaml.map"),N$=Symbol.for("yaml.pair"),_s=Symbol.for("yaml.scalar"),w_=Symbol.for("yaml.seq"),x=Symbol.for("yaml.node.type"),Rg=(u)=>!!u&&typeof u==="object"&&u[x]===us,Sg=(u)=>!!u&&typeof u==="object"&&u[x]===Q$,Ig=(u)=>!!u&&typeof u==="object"&&u[x]===$_,Tg=(u)=>!!u&&typeof u==="object"&&u[x]===N$,V$=(u)=>!!u&&typeof u==="object"&&u[x]===_s,qg=(u)=>!!u&&typeof u==="object"&&u[x]===w_;function b$(u){if(u&&typeof u==="object")switch(u[x]){case $_:case w_:return!0}return!1}function Lg(u){if(u&&typeof u==="object")switch(u[x]){case us:case $_:case _s:case w_:return!0}return!1}var Og=(u)=>(V$(u)||b$(u))&&!!u.anchor;Ug.ALIAS=us;Ug.DOC=Q$;Ug.MAP=$_;Ug.NODE_TYPE=x;Ug.PAIR=N$;Ug.SCALAR=_s;Ug.SEQ=w_;Ug.hasAnchor=Og;Ug.isAlias=Rg;Ug.isCollection=b$;Ug.isDocument=Sg;Ug.isMap=Ig;Ug.isNode=Lg;Ug.isPair=Tg;Ug.isScalar=V$;Ug.isSeq=qg});var Mu=D((Ng)=>{var j=X(),E=Symbol("break visit"),E$=Symbol("skip children"),d=Symbol("remove node");function f_(u,_){let s=C$(_);if(j.isDocument(u)){if(Hu(null,u.contents,s,Object.freeze([u]))===d)u.contents=null}else Hu(null,u,s,Object.freeze([]))}f_.BREAK=E;f_.SKIP=E$;f_.REMOVE=d;function Hu(u,_,s,$){let w=r$(u,_,s,$);if(j.isNode(w)||j.isPair(w))return l$(u,$,w),Hu(u,w,s,$);if(typeof w!=="symbol"){if(j.isCollection(_)){$=Object.freeze($.concat(_));for(let f=0;f<_.items.length;++f){let i=Hu(f,_.items[f],s,$);if(typeof i==="number")f=i-1;else if(i===E)return E;else if(i===d)_.items.splice(f,1),f-=1}}else if(j.isPair(_)){$=Object.freeze($.concat(_));let f=Hu("key",_.key,s,$);if(f===E)return E;else if(f===d)_.key=null;let i=Hu("value",_.value,s,$);if(i===E)return E;else if(i===d)_.value=null}}return w}async function i_(u,_){let s=C$(_);if(j.isDocument(u)){if(await Du(null,u.contents,s,Object.freeze([u]))===d)u.contents=null}else await Du(null,u,s,Object.freeze([]))}i_.BREAK=E;i_.SKIP=E$;i_.REMOVE=d;async function Du(u,_,s,$){let w=await r$(u,_,s,$);if(j.isNode(w)||j.isPair(w))return l$(u,$,w),Du(u,w,s,$);if(typeof w!=="symbol"){if(j.isCollection(_)){$=Object.freeze($.concat(_));for(let f=0;f<_.items.length;++f){let i=await Du(f,_.items[f],s,$);if(typeof i==="number")f=i-1;else if(i===E)return E;else if(i===d)_.items.splice(f,1),f-=1}}else if(j.isPair(_)){$=Object.freeze($.concat(_));let f=await Du("key",_.key,s,$);if(f===E)return E;else if(f===d)_.key=null;let i=await Du("value",_.value,s,$);if(i===E)return E;else if(i===d)_.value=null}}return w}function C$(u){if(typeof u==="object"&&(u.Collection||u.Node||u.Value))return Object.assign({Alias:u.Node,Map:u.Node,Scalar:u.Node,Seq:u.Node},u.Value&&{Map:u.Value,Scalar:u.Value,Seq:u.Value},u.Collection&&{Map:u.Collection,Seq:u.Collection},u);return u}function r$(u,_,s,$){if(typeof s==="function")return s(u,_,$);if(j.isMap(_))return s.Map?.(u,_,$);if(j.isSeq(_))return s.Seq?.(u,_,$);if(j.isPair(_))return s.Pair?.(u,_,$);if(j.isScalar(_))return s.Scalar?.(u,_,$);if(j.isAlias(_))return s.Alias?.(u,_,$);return}function l$(u,_,s){let $=_[_.length-1];if(j.isCollection($))$.items[u]=s;else if(j.isPair($))if(u==="key")$.key=s;else $.value=s;else if(j.isDocument($))$.contents=s;else{let w=j.isAlias($)?"alias":"scalar";throw Error(`Cannot replace node with ${w} parent`)}}Ng.visit=f_;Ng.visitAsync=i_});var ss=D((lg)=>{var K$=X(),Eg=Mu(),Cg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},rg=(u)=>u.replace(/[!,[\]{}]/g,(_)=>Cg[_]);class C{constructor(u,_){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},C.defaultYaml,u),this.tags=Object.assign({},C.defaultTags,_)}clone(){let u=new C(this.yaml,this.tags);return u.docStart=this.docStart,u}atDocument(){let u=new C(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:C.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},C.defaultTags);break}return u}add(u,_){if(this.atNextDocument)this.yaml={explicit:C.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},C.defaultTags),this.atNextDocument=!1;let s=u.trim().split(/[ \t]+/),$=s.shift();switch($){case"%TAG":{if(s.length!==2){if(_(0,"%TAG directive should contain exactly two parts"),s.length<2)return!1}let[w,f]=s;return this.tags[w]=f,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return _(0,"%YAML directive should contain exactly one part"),!1;let[w]=s;if(w==="1.1"||w==="1.2")return this.yaml.version=w,!0;else{let f=/^\d+\.\d+$/.test(w);return _(6,`Unsupported YAML version ${w}`,f),!1}}default:return _(0,`Unknown directive ${$}`,!0),!1}}tagName(u,_){if(u==="!")return"!";if(u[0]!=="!")return _(`Not a valid tag: ${u}`),null;if(u[1]==="<"){let f=u.slice(2,-1);if(f==="!"||f==="!!")return _(`Verbatim tags aren't resolved, so ${u} is invalid.`),null;if(u[u.length-1]!==">")_("Verbatim tags must end with a >");return f}let[,s,$]=u.match(/^(.*!)([^!]*)$/s);if(!$)_(`The ${u} tag has no suffix`);let w=this.tags[s];if(w)try{return w+decodeURIComponent($)}catch(f){return _(String(f)),null}if(s==="!")return u;return _(`Could not resolve tag: ${u}`),null}tagString(u){for(let[_,s]of Object.entries(this.tags))if(u.startsWith(s))return _+rg(u.substring(s.length));return u[0]==="!"?u:`!<${u}>`}toString(u){let _=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),$;if(u&&s.length>0&&K$.isNode(u.contents)){let w={};Eg.visit(u.contents,(f,i)=>{if(K$.isNode(i)&&i.tag)w[i.tag]=!0}),$=Object.keys(w)}else $=[];for(let[w,f]of s){if(w==="!!"&&f==="tag:yaml.org,2002:")continue;if(!u||$.some((i)=>i.startsWith(f)))_.push(`%TAG ${w} ${f}`)}return _.join(`
3
- `)}}C.defaultYaml={explicit:!1,version:"1.2"};C.defaultTags={"!!":"tag:yaml.org,2002:"};lg.Directives=C});var g_=D((hg)=>{var y$=X(),yg=Mu();function dg(u){if(/[\x00-\x19\s,[\]{}]/.test(u)){let s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(u)}`;throw Error(s)}return!0}function d$(u){let _=new Set;return yg.visit(u,{Value(s,$){if($.anchor)_.add($.anchor)}}),_}function n$(u,_){for(let s=1;;++s){let $=`${u}${s}`;if(!_.has($))return $}}function ng(u,_){let s=[],$=new Map,w=null;return{onAnchor:(f)=>{s.push(f),w??(w=d$(u));let i=n$(_,w);return w.add(i),i},setAnchors:()=>{for(let f of s){let i=$.get(f);if(typeof i==="object"&&i.anchor&&(y$.isScalar(i.node)||y$.isCollection(i.node)))i.node.anchor=i.anchor;else{let g=Error("Failed to resolve repeated object (this should not happen)");throw g.source=f,g}}},sourceObjects:$}}hg.anchorIsValid=dg;hg.anchorNames=d$;hg.createNodeAnchors=ng;hg.findNewAnchor=n$});var $s=D((pg)=>{function ju(u,_,s,$){if($&&typeof $==="object")if(Array.isArray($))for(let w=0,f=$.length;w<f;++w){let i=$[w],g=ju(u,$,String(w),i);if(g===void 0)delete $[w];else if(g!==i)$[w]=g}else if($ instanceof Map)for(let w of Array.from($.keys())){let f=$.get(w),i=ju(u,$,w,f);if(i===void 0)$.delete(w);else if(i!==f)$.set(w,i)}else if($ instanceof Set)for(let w of Array.from($)){let f=ju(u,$,w,w);if(f===void 0)$.delete(w);else if(f!==w)$.delete(w),$.add(f)}else for(let[w,f]of Object.entries($)){let i=ju(u,$,w,f);if(i===void 0)delete $[w];else if(i!==f)$[w]=i}return u.call(_,s,$)}pg.applyReviver=ju});var t=D((vg)=>{var tg=X();function h$(u,_,s){if(Array.isArray(u))return u.map(($,w)=>h$($,String(w),s));if(u&&typeof u.toJSON==="function"){if(!s||!tg.hasAnchor(u))return u.toJSON(_,s);let $={aliasCount:0,count:1,res:void 0};s.anchors.set(u,$),s.onCreate=(f)=>{$.res=f,delete s.onCreate};let w=u.toJSON(_,s);if(s.onCreate)s.onCreate(w);return w}if(typeof u==="bigint"&&!s?.keep)return Number(u);return u}vg.toJS=h$});var R_=D((_0)=>{var eg=$s(),m$=X(),u0=t();class c${constructor(u){Object.defineProperty(this,m$.NODE_TYPE,{value:u})}clone(){let u=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)u.range=this.range.slice();return u}toJS(u,{mapAsMap:_,maxAliasCount:s,onAnchor:$,reviver:w}={}){if(!m$.isDocument(u))throw TypeError("A document argument is required");let f={anchors:new Map,doc:u,keep:!0,mapAsMap:_===!0,mapKeyWarned:!1,maxAliasCount:typeof s==="number"?s:100},i=u0.toJS(this,"",f);if(typeof $==="function")for(let{count:g,res:R}of f.anchors.values())$(R,g);return typeof w==="function"?eg.applyReviver(w,{"":i},"",i):i}}_0.NodeBase=c$});var Qu=D((g0)=>{var $0=g_(),w0=Mu(),Pu=X(),f0=R_(),i0=t();class x$ extends f0.NodeBase{constructor(u){super(Pu.ALIAS);this.source=u,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(u,_){if(_?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let s;if(_?.aliasResolveCache)s=_.aliasResolveCache;else if(s=[],w0.visit(u,{Node:(w,f)=>{if(Pu.isAlias(f)||Pu.hasAnchor(f))s.push(f)}}),_)_.aliasResolveCache=s;let $=void 0;for(let w of s){if(w===this)break;if(w.anchor===this.source)$=w}return $}toJSON(u,_){if(!_)return{source:this.source};let{anchors:s,doc:$,maxAliasCount:w}=_,f=this.resolve($,_);if(!f){let g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(g)}let i=s.get(f);if(!i)i0.toJS(f,null,_),i=s.get(f);if(i?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(w>=0){if(i.count+=1,i.aliasCount===0)i.aliasCount=S_($,f,s);if(i.count*i.aliasCount>w)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return i.res}toString(u,_,s){let $=`*${this.source}`;if(u){if($0.anchorIsValid(this.source),u.options.verifyAliasOrder&&!u.anchors.has(this.source)){let w=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(w)}if(u.implicitKey)return`${$} `}return $}}function S_(u,_,s){if(Pu.isAlias(_)){let $=_.resolve(u),w=s&&$&&s.get($);return w?w.count*w.aliasCount:0}else if(Pu.isCollection(_)){let $=0;for(let w of _.items){let f=S_(u,w,s);if(f>$)$=f}return $}else if(Pu.isPair(_)){let $=S_(u,_.key,s),w=S_(u,_.value,s);return Math.max($,w)}return 1}g0.Alias=x$});var B=D((L0)=>{var S0=X(),I0=R_(),T0=t(),q0=(u)=>!u||typeof u!=="function"&&typeof u!=="object";class gu extends I0.NodeBase{constructor(u){super(S0.SCALAR);this.value=u}toJSON(u,_){return _?.keep?this.value:T0.toJS(this.value,u,_)}toString(){return String(this.value)}}gu.BLOCK_FOLDED="BLOCK_FOLDED";gu.BLOCK_LITERAL="BLOCK_LITERAL";gu.PLAIN="PLAIN";gu.QUOTE_DOUBLE="QUOTE_DOUBLE";gu.QUOTE_SINGLE="QUOTE_SINGLE";L0.Scalar=gu;L0.isScalarValue=q0});var Nu=D((F0)=>{var H0=Qu(),Ru=X(),k$=B(),D0="tag:yaml.org,2002:";function P0(u,_,s){if(_){let $=s.filter((f)=>f.tag===_),w=$.find((f)=>!f.format)??$[0];if(!w)throw Error(`Tag ${_} not found`);return w}return s.find(($)=>$.identify?.(u)&&!$.format)}function A0(u,_,s){if(Ru.isDocument(u))u=u.contents;if(Ru.isNode(u))return u;if(Ru.isPair(u)){let I=s.schema[Ru.MAP].createNode?.(s.schema,null,s);return I.items.push(u),I}if(u instanceof String||u instanceof Number||u instanceof Boolean||typeof BigInt<"u"&&u instanceof BigInt)u=u.valueOf();let{aliasDuplicateObjects:$,onAnchor:w,onTagObj:f,schema:i,sourceObjects:g}=s,R=void 0;if($&&u&&typeof u==="object")if(R=g.get(u),R)return R.anchor??(R.anchor=w(u)),new H0.Alias(R.anchor);else R={anchor:null,node:null},g.set(u,R);if(_?.startsWith("!!"))_=D0+_.slice(2);let S=P0(u,_,i.tags);if(!S){if(u&&typeof u.toJSON==="function")u=u.toJSON();if(!u||typeof u!=="object"){let I=new k$.Scalar(u);if(R)R.node=I;return I}S=u instanceof Map?i[Ru.MAP]:(Symbol.iterator in Object(u))?i[Ru.SEQ]:i[Ru.MAP]}if(f)f(S),delete s.onTagObj;let L=S?.createNode?S.createNode(s.schema,u,s):typeof S?.nodeClass?.from==="function"?S.nodeClass.from(s.schema,u,s):new k$.Scalar(u);if(_)L.tag=_;else if(!S.default)L.tag=S.tag;if(R)R.node=L;return L}F0.createNode=A0});var I_=D((W0)=>{var Y0=Nu(),n=X(),G0=R_();function ws(u,_,s){let $=s;for(let w=_.length-1;w>=0;--w){let f=_[w];if(typeof f==="number"&&Number.isInteger(f)&&f>=0){let i=[];i[f]=$,$=i}else $=new Map([[f,$]])}return Y0.createNode($,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:u,sourceObjects:new Map})}var p$=(u)=>u==null||typeof u==="object"&&!!u[Symbol.iterator]().next().done;class a$ extends G0.NodeBase{constructor(u,_){super(u);Object.defineProperty(this,"schema",{value:_,configurable:!0,enumerable:!1,writable:!0})}clone(u){let _=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(u)_.schema=u;if(_.items=_.items.map((s)=>n.isNode(s)||n.isPair(s)?s.clone(u):s),this.range)_.range=this.range.slice();return _}addIn(u,_){if(p$(u))this.add(_);else{let[s,...$]=u,w=this.get(s,!0);if(n.isCollection(w))w.addIn($,_);else if(w===void 0&&this.schema)this.set(s,ws(this.schema,$,_));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${$}`)}}deleteIn(u){let[_,...s]=u;if(s.length===0)return this.delete(_);let $=this.get(_,!0);if(n.isCollection($))return $.deleteIn(s);else throw Error(`Expected YAML collection at ${_}. Remaining path: ${s}`)}getIn(u,_){let[s,...$]=u,w=this.get(s,!0);if($.length===0)return!_&&n.isScalar(w)?w.value:w;else return n.isCollection(w)?w.getIn($,_):void 0}hasAllNullValues(u){return this.items.every((_)=>{if(!n.isPair(_))return!1;let s=_.value;return s==null||u&&n.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(u){let[_,...s]=u;if(s.length===0)return this.has(_);let $=this.get(_,!0);return n.isCollection($)?$.hasIn(s):!1}setIn(u,_){let[s,...$]=u;if($.length===0)this.set(s,_);else{let w=this.get(s,!0);if(n.isCollection(w))w.setIn($,_);else if(w===void 0&&this.schema)this.set(s,ws(this.schema,$,_));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${$}`)}}}W0.Collection=a$;W0.collectionFromPath=ws;W0.isEmptyPath=p$});var Vu=D((j0)=>{var Z0=(u)=>u.replace(/^(?!$)(?: $)?/gm,"#");function fs(u,_){if(/^\n+$/.test(u))return u.substring(1);return _?u.replace(/^(?! *$)/gm,_):u}var M0=(u,_,s)=>u.endsWith(`
4
- `)?fs(s,_):s.includes(`
2
+ import{createRequire as EH}from"node:module";var V=(_,$)=>()=>($||_(($={exports:{}}).exports,$),$.exports);var Q$=EH(import.meta.url);var S=V((hH)=>{var W0=Symbol.for("yaml.alias"),oq=Symbol.for("yaml.document"),W$=Symbol.for("yaml.map"),tq=Symbol.for("yaml.pair"),R0=Symbol.for("yaml.scalar"),R$=Symbol.for("yaml.seq"),n=Symbol.for("yaml.node.type"),jH=(_)=>!!_&&typeof _==="object"&&_[n]===W0,bH=(_)=>!!_&&typeof _==="object"&&_[n]===oq,gH=(_)=>!!_&&typeof _==="object"&&_[n]===W$,yH=(_)=>!!_&&typeof _==="object"&&_[n]===tq,eq=(_)=>!!_&&typeof _==="object"&&_[n]===R0,xH=(_)=>!!_&&typeof _==="object"&&_[n]===R$;function _T(_){if(_&&typeof _==="object")switch(_[n]){case W$:case R$:return!0}return!1}function kH(_){if(_&&typeof _==="object")switch(_[n]){case W0:case W$:case R0:case R$:return!0}return!1}var uH=(_)=>(eq(_)||_T(_))&&!!_.anchor;hH.ALIAS=W0;hH.DOC=oq;hH.MAP=W$;hH.NODE_TYPE=n;hH.PAIR=tq;hH.SCALAR=R0;hH.SEQ=R$;hH.hasAnchor=uH;hH.isAlias=jH;hH.isCollection=_T;hH.isDocument=bH;hH.isMap=gH;hH.isNode=kH;hH.isPair=yH;hH.isScalar=eq;hH.isSeq=xH});var g_=V((q2)=>{var b=S(),y=Symbol("break visit"),$T=Symbol("skip children"),p=Symbol("remove node");function Y$(_,$){let q=qT($);if(b.isDocument(_)){if(D_(null,_.contents,q,Object.freeze([_]))===p)_.contents=null}else D_(null,_,q,Object.freeze([]))}Y$.BREAK=y;Y$.SKIP=$T;Y$.REMOVE=p;function D_(_,$,q,T){let O=TT(_,$,q,T);if(b.isNode(O)||b.isPair(O))return OT(_,T,O),D_(_,O,q,T);if(typeof O!=="symbol"){if(b.isCollection($)){T=Object.freeze(T.concat($));for(let H=0;H<$.items.length;++H){let X=D_(H,$.items[H],q,T);if(typeof X==="number")H=X-1;else if(X===y)return y;else if(X===p)$.items.splice(H,1),H-=1}}else if(b.isPair($)){T=Object.freeze(T.concat($));let H=D_("key",$.key,q,T);if(H===y)return y;else if(H===p)$.key=null;let X=D_("value",$.value,q,T);if(X===y)return y;else if(X===p)$.value=null}}return O}async function L$(_,$){let q=qT($);if(b.isDocument(_)){if(await M_(null,_.contents,q,Object.freeze([_]))===p)_.contents=null}else await M_(null,_,q,Object.freeze([]))}L$.BREAK=y;L$.SKIP=$T;L$.REMOVE=p;async function M_(_,$,q,T){let O=await TT(_,$,q,T);if(b.isNode(O)||b.isPair(O))return OT(_,T,O),M_(_,O,q,T);if(typeof O!=="symbol"){if(b.isCollection($)){T=Object.freeze(T.concat($));for(let H=0;H<$.items.length;++H){let X=await M_(H,$.items[H],q,T);if(typeof X==="number")H=X-1;else if(X===y)return y;else if(X===p)$.items.splice(H,1),H-=1}}else if(b.isPair($)){T=Object.freeze(T.concat($));let H=await M_("key",$.key,q,T);if(H===y)return y;else if(H===p)$.key=null;let X=await M_("value",$.value,q,T);if(X===y)return y;else if(X===p)$.value=null}}return O}function qT(_){if(typeof _==="object"&&(_.Collection||_.Node||_.Value))return Object.assign({Alias:_.Node,Map:_.Node,Scalar:_.Node,Seq:_.Node},_.Value&&{Map:_.Value,Scalar:_.Value,Seq:_.Value},_.Collection&&{Map:_.Collection,Seq:_.Collection},_);return _}function TT(_,$,q,T){if(typeof q==="function")return q(_,$,T);if(b.isMap($))return q.Map?.(_,$,T);if(b.isSeq($))return q.Seq?.(_,$,T);if(b.isPair($))return q.Pair?.(_,$,T);if(b.isScalar($))return q.Scalar?.(_,$,T);if(b.isAlias($))return q.Alias?.(_,$,T);return}function OT(_,$,q){let T=$[$.length-1];if(b.isCollection(T))T.items[_]=q;else if(b.isPair(T))if(_==="key")T.key=q;else T.value=q;else if(b.isDocument(T))T.contents=q;else{let O=b.isAlias(T)?"alias":"scalar";throw Error(`Cannot replace node with ${O} parent`)}}q2.visit=Y$;q2.visitAsync=L$});var Y0=V((J2)=>{var HT=S(),H2=g_(),X2={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},U2=(_)=>_.replace(/[!,[\]{}]/g,($)=>X2[$]);class k{constructor(_,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},k.defaultYaml,_),this.tags=Object.assign({},k.defaultTags,$)}clone(){let _=new k(this.yaml,this.tags);return _.docStart=this.docStart,_}atDocument(){let _=new k(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:k.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},k.defaultTags);break}return _}add(_,$){if(this.atNextDocument)this.yaml={explicit:k.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},k.defaultTags),this.atNextDocument=!1;let q=_.trim().split(/[ \t]+/),T=q.shift();switch(T){case"%TAG":{if(q.length!==2){if($(0,"%TAG directive should contain exactly two parts"),q.length<2)return!1}let[O,H]=q;return this.tags[O]=H,!0}case"%YAML":{if(this.yaml.explicit=!0,q.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[O]=q;if(O==="1.1"||O==="1.2")return this.yaml.version=O,!0;else{let H=/^\d+\.\d+$/.test(O);return $(6,`Unsupported YAML version ${O}`,H),!1}}default:return $(0,`Unknown directive ${T}`,!0),!1}}tagName(_,$){if(_==="!")return"!";if(_[0]!=="!")return $(`Not a valid tag: ${_}`),null;if(_[1]==="<"){let H=_.slice(2,-1);if(H==="!"||H==="!!")return $(`Verbatim tags aren't resolved, so ${_} is invalid.`),null;if(_[_.length-1]!==">")$("Verbatim tags must end with a >");return H}let[,q,T]=_.match(/^(.*!)([^!]*)$/s);if(!T)$(`The ${_} tag has no suffix`);let O=this.tags[q];if(O)try{return O+decodeURIComponent(T)}catch(H){return $(String(H)),null}if(q==="!")return _;return $(`Could not resolve tag: ${_}`),null}tagString(_){for(let[$,q]of Object.entries(this.tags))if(_.startsWith(q))return $+U2(_.substring(q.length));return _[0]==="!"?_:`!<${_}>`}toString(_){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],q=Object.entries(this.tags),T;if(_&&q.length>0&&HT.isNode(_.contents)){let O={};H2.visit(_.contents,(H,X)=>{if(HT.isNode(X)&&X.tag)O[X.tag]=!0}),T=Object.keys(O)}else T=[];for(let[O,H]of q){if(O==="!!"&&H==="tag:yaml.org,2002:")continue;if(!_||T.some((X)=>X.startsWith(H)))$.push(`%TAG ${O} ${H}`)}return $.join(`
3
+ `)}}k.defaultYaml={explicit:!1,version:"1.2"};k.defaultTags={"!!":"tag:yaml.org,2002:"};J2.Directives=k});var V$=V((W2)=>{var XT=S(),z2=g_();function G2(_){if(/[\x00-\x19\s,[\]{}]/.test(_)){let q=`Anchor must not contain whitespace or control characters: ${JSON.stringify(_)}`;throw Error(q)}return!0}function UT(_){let $=new Set;return z2.visit(_,{Value(q,T){if(T.anchor)$.add(T.anchor)}}),$}function JT(_,$){for(let q=1;;++q){let T=`${_}${q}`;if(!$.has(T))return T}}function Q2(_,$){let q=[],T=new Map,O=null;return{onAnchor:(H)=>{q.push(H),O??(O=UT(_));let X=JT($,O);return O.add(X),X},setAnchors:()=>{for(let H of q){let X=T.get(H);if(typeof X==="object"&&X.anchor&&(XT.isScalar(X.node)||XT.isCollection(X.node)))X.node.anchor=X.anchor;else{let U=Error("Failed to resolve repeated object (this should not happen)");throw U.source=H,U}}},sourceObjects:T}}W2.anchorIsValid=G2;W2.anchorNames=UT;W2.createNodeAnchors=Q2;W2.findNewAnchor=JT});var L0=V((B2)=>{function y_(_,$,q,T){if(T&&typeof T==="object")if(Array.isArray(T))for(let O=0,H=T.length;O<H;++O){let X=T[O],U=y_(_,T,String(O),X);if(U===void 0)delete T[O];else if(U!==X)T[O]=U}else if(T instanceof Map)for(let O of Array.from(T.keys())){let H=T.get(O),X=y_(_,T,O,H);if(X===void 0)T.delete(O);else if(X!==H)T.set(O,X)}else if(T instanceof Set)for(let O of Array.from(T)){let H=y_(_,T,O,O);if(H===void 0)T.delete(O);else if(H!==O)T.delete(O),T.add(H)}else for(let[O,H]of Object.entries(T)){let X=y_(_,T,O,H);if(X===void 0)delete T[O];else if(X!==H)T[O]=X}return _.call($,q,T)}B2.applyReviver=y_});var e=V((D2)=>{var A2=S();function ZT(_,$,q){if(Array.isArray(_))return _.map((T,O)=>ZT(T,String(O),q));if(_&&typeof _.toJSON==="function"){if(!q||!A2.hasAnchor(_))return _.toJSON($,q);let T={aliasCount:0,count:1,res:void 0};q.anchors.set(_,T),q.onCreate=(H)=>{T.res=H,delete q.onCreate};let O=_.toJSON($,q);if(q.onCreate)q.onCreate(O);return O}if(typeof _==="bigint"&&!q?.keep)return Number(_);return _}D2.toJS=ZT});var B$=V((S2)=>{var I2=L0(),zT=S(),F2=e();class GT{constructor(_){Object.defineProperty(this,zT.NODE_TYPE,{value:_})}clone(){let _=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)_.range=this.range.slice();return _}toJS(_,{mapAsMap:$,maxAliasCount:q,onAnchor:T,reviver:O}={}){if(!zT.isDocument(_))throw TypeError("A document argument is required");let H={anchors:new Map,doc:_,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof q==="number"?q:100},X=F2.toJS(this,"",H);if(typeof T==="function")for(let{count:U,res:J}of H.anchors.values())T(J,U);return typeof O==="function"?I2.applyReviver(O,{"":X},"",X):X}}S2.NodeBase=GT});var x_=V((E2)=>{var N2=V$(),C2=g_(),I_=S(),P2=B$(),f2=e();class QT extends P2.NodeBase{constructor(_){super(I_.ALIAS);this.source=_,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(_,$){if($?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let q;if($?.aliasResolveCache)q=$.aliasResolveCache;else if(q=[],C2.visit(_,{Node:(O,H)=>{if(I_.isAlias(H)||I_.hasAnchor(H))q.push(H)}}),$)$.aliasResolveCache=q;let T=void 0;for(let O of q){if(O===this)break;if(O.anchor===this.source)T=O}return T}toJSON(_,$){if(!$)return{source:this.source};let{anchors:q,doc:T,maxAliasCount:O}=$,H=this.resolve(T,$);if(!H){let U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(U)}let X=q.get(H);if(!X)f2.toJS(H,null,$),X=q.get(H);if(X?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(O>=0){if(X.count+=1,X.aliasCount===0)X.aliasCount=w$(T,H,q);if(X.count*X.aliasCount>O)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return X.res}toString(_,$,q){let T=`*${this.source}`;if(_){if(N2.anchorIsValid(this.source),_.options.verifyAliasOrder&&!_.anchors.has(this.source)){let O=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(O)}if(_.implicitKey)return`${T} `}return T}}function w$(_,$,q){if(I_.isAlias($)){let T=$.resolve(_),O=q&&T&&q.get(T);return O?O.count*O.aliasCount:0}else if(I_.isCollection($)){let T=0;for(let O of $.items){let H=w$(_,O,q);if(H>T)T=H}return T}else if(I_.isPair($)){let T=w$(_,$.key,q),O=w$(_,$.value,q);return Math.max(T,O)}return 1}E2.Alias=QT});var f=V((k2)=>{var b2=S(),g2=B$(),y2=e(),x2=(_)=>!_||typeof _!=="function"&&typeof _!=="object";class G_ extends g2.NodeBase{constructor(_){super(b2.SCALAR);this.value=_}toJSON(_,$){return $?.keep?this.value:y2.toJS(this.value,_,$)}toString(){return String(this.value)}}G_.BLOCK_FOLDED="BLOCK_FOLDED";G_.BLOCK_LITERAL="BLOCK_LITERAL";G_.PLAIN="PLAIN";G_.QUOTE_DOUBLE="QUOTE_DOUBLE";G_.QUOTE_SINGLE="QUOTE_SINGLE";k2.Scalar=G_;k2.isScalarValue=x2});var k_=V((d2)=>{var v2=x_(),Q_=S(),WT=f(),m2="tag:yaml.org,2002:";function l2(_,$,q){if($){let T=q.filter((H)=>H.tag===$),O=T.find((H)=>!H.format)??T[0];if(!O)throw Error(`Tag ${$} not found`);return O}return q.find((T)=>T.identify?.(_)&&!T.format)}function p2(_,$,q){if(Q_.isDocument(_))_=_.contents;if(Q_.isNode(_))return _;if(Q_.isPair(_)){let G=q.schema[Q_.MAP].createNode?.(q.schema,null,q);return G.items.push(_),G}if(_ instanceof String||_ instanceof Number||_ instanceof Boolean||typeof BigInt<"u"&&_ instanceof BigInt)_=_.valueOf();let{aliasDuplicateObjects:T,onAnchor:O,onTagObj:H,schema:X,sourceObjects:U}=q,J=void 0;if(T&&_&&typeof _==="object")if(J=U.get(_),J)return J.anchor??(J.anchor=O(_)),new v2.Alias(J.anchor);else J={anchor:null,node:null},U.set(_,J);if($?.startsWith("!!"))$=m2+$.slice(2);let Z=l2(_,$,X.tags);if(!Z){if(_&&typeof _.toJSON==="function")_=_.toJSON();if(!_||typeof _!=="object"){let G=new WT.Scalar(_);if(J)J.node=G;return G}Z=_ instanceof Map?X[Q_.MAP]:(Symbol.iterator in Object(_))?X[Q_.SEQ]:X[Q_.MAP]}if(H)H(Z),delete q.onTagObj;let z=Z?.createNode?Z.createNode(q.schema,_,q):typeof Z?.nodeClass?.from==="function"?Z.nodeClass.from(q.schema,_,q):new WT.Scalar(_);if($)z.tag=$;else if(!Z.default)z.tag=Z.tag;if(J)J.node=z;return z}d2.createNode=p2});var A$=V((n2)=>{var s2=k_(),d=S(),i2=B$();function V0(_,$,q){let T=q;for(let O=$.length-1;O>=0;--O){let H=$[O];if(typeof H==="number"&&Number.isInteger(H)&&H>=0){let X=[];X[H]=T,T=X}else T=new Map([[H,T]])}return s2.createNode(T,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:_,sourceObjects:new Map})}var RT=(_)=>_==null||typeof _==="object"&&!!_[Symbol.iterator]().next().done;class YT extends i2.NodeBase{constructor(_,$){super(_);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(_){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(_)$.schema=_;if($.items=$.items.map((q)=>d.isNode(q)||d.isPair(q)?q.clone(_):q),this.range)$.range=this.range.slice();return $}addIn(_,$){if(RT(_))this.add($);else{let[q,...T]=_,O=this.get(q,!0);if(d.isCollection(O))O.addIn(T,$);else if(O===void 0&&this.schema)this.set(q,V0(this.schema,T,$));else throw Error(`Expected YAML collection at ${q}. Remaining path: ${T}`)}}deleteIn(_){let[$,...q]=_;if(q.length===0)return this.delete($);let T=this.get($,!0);if(d.isCollection(T))return T.deleteIn(q);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${q}`)}getIn(_,$){let[q,...T]=_,O=this.get(q,!0);if(T.length===0)return!$&&d.isScalar(O)?O.value:O;else return d.isCollection(O)?O.getIn(T,$):void 0}hasAllNullValues(_){return this.items.every(($)=>{if(!d.isPair($))return!1;let q=$.value;return q==null||_&&d.isScalar(q)&&q.value==null&&!q.commentBefore&&!q.comment&&!q.tag})}hasIn(_){let[$,...q]=_;if(q.length===0)return this.has($);let T=this.get($,!0);return d.isCollection(T)?T.hasIn(q):!1}setIn(_,$){let[q,...T]=_;if(T.length===0)this.set(q,$);else{let O=this.get(q,!0);if(d.isCollection(O))O.setIn(T,$);else if(O===void 0&&this.schema)this.set(q,V0(this.schema,T,$));else throw Error(`Expected YAML collection at ${q}. Remaining path: ${T}`)}}}n2.Collection=YT;n2.collectionFromPath=V0;n2.isEmptyPath=RT});var u_=V((_9)=>{var t2=(_)=>_.replace(/^(?!$)(?: $)?/gm,"#");function B0(_,$){if(/^\n+$/.test(_))return _.substring(1);return $?_.replace(/^(?! *$)/gm,$):_}var e2=(_,$,q)=>_.endsWith(`
4
+ `)?B0(q,$):q.includes(`
5
5
  `)?`
6
- `+fs(s,_):(u.endsWith(" ")?"":" ")+s;j0.indentComment=fs;j0.lineComment=M0;j0.stringifyComment=Z0});var v$=D((E0)=>{function b0(u,_,s="flow",{indentAtStart:$,lineWidth:w=80,minContentWidth:f=20,onFold:i,onOverflow:g}={}){if(!w||w<0)return u;if(w<f)f=0;let R=Math.max(1+f,1+w-_.length);if(u.length<=R)return u;let S=[],L={},I=w-_.length;if(typeof $==="number")if($>w-Math.max(2,f))S.push(0);else I=w-$;let T=void 0,O=void 0,H=!1,q=-1,U=-1,P=-1;if(s==="block"){if(q=t$(u,q,_.length),q!==-1)I=q+R}for(let z;z=u[q+=1];){if(s==="quoted"&&z==="\\"){switch(U=q,u[q+1]){case"x":q+=3;break;case"u":q+=5;break;case"U":q+=9;break;default:q+=1}P=q}if(z===`
7
- `){if(s==="block")q=t$(u,q,_.length);I=q+_.length+R,T=void 0}else{if(z===" "&&O&&O!==" "&&O!==`
8
- `&&O!=="\t"){let Y=u[q+1];if(Y&&Y!==" "&&Y!==`
9
- `&&Y!=="\t")T=q}if(q>=I)if(T)S.push(T),I=T+R,T=void 0;else if(s==="quoted"){while(O===" "||O==="\t")O=z,z=u[q+=1],H=!0;let Y=q>P+1?q-2:U-1;if(L[Y])return u;S.push(Y),L[Y]=!0,I=Y+R,T=void 0}else H=!0}O=z}if(H&&g)g();if(S.length===0)return u;if(i)i();let F=u.slice(0,S[0]);for(let z=0;z<S.length;++z){let Y=S[z],G=S[z+1]||u.length;if(Y===0)F=`
10
- ${_}${u.slice(0,G)}`;else{if(s==="quoted"&&L[Y])F+=`${u[Y]}\\`;F+=`
11
- ${_}${u.slice(Y+1,G)}`}}return F}function t$(u,_,s){let $=_,w=_+1,f=u[w];while(f===" "||f==="\t")if(_<w+s)f=u[++_];else{do f=u[++_];while(f&&f!==`
12
- `);$=_,w=_+1,f=u[w]}return $}E0.FOLD_BLOCK="block";E0.FOLD_FLOW="flow";E0.FOLD_QUOTED="quoted";E0.foldFlowLines=b0});var Eu=D((h0)=>{var K=B(),v=v$(),q_=(u,_)=>({indentAtStart:_?u.indent.length:u.indentAtStart,lineWidth:u.options.lineWidth,minContentWidth:u.options.minContentWidth}),L_=(u)=>/^(%|---|\.\.\.)/m.test(u);function y0(u,_,s){if(!_||_<0)return!1;let $=_-s,w=u.length;if(w<=$)return!1;for(let f=0,i=0;f<w;++f)if(u[f]===`
13
- `){if(f-i>$)return!0;if(i=f+1,w-i<=$)return!1}return!0}function bu(u,_){let s=JSON.stringify(u);if(_.options.doubleQuotedAsJSON)return s;let{implicitKey:$}=_,w=_.options.doubleQuotedMinMultiLineLength,f=_.indent||(L_(u)?" ":""),i="",g=0;for(let R=0,S=s[R];S;S=s[++R]){if(S===" "&&s[R+1]==="\\"&&s[R+2]==="n")i+=s.slice(g,R)+"\\ ",R+=1,g=R,S="\\";if(S==="\\")switch(s[R+1]){case"u":{i+=s.slice(g,R);let L=s.substr(R+2,4);switch(L){case"0000":i+="\\0";break;case"0007":i+="\\a";break;case"000b":i+="\\v";break;case"001b":i+="\\e";break;case"0085":i+="\\N";break;case"00a0":i+="\\_";break;case"2028":i+="\\L";break;case"2029":i+="\\P";break;default:if(L.substr(0,2)==="00")i+="\\x"+L.substr(2);else i+=s.substr(R,6)}R+=5,g=R+1}break;case"n":if($||s[R+2]==='"'||s.length<w)R+=1;else{i+=s.slice(g,R)+`
14
-
15
- `;while(s[R+2]==="\\"&&s[R+3]==="n"&&s[R+4]!=='"')i+=`
16
- `,R+=2;if(i+=f,s[R+2]===" ")i+="\\";R+=1,g=R+1}break;default:R+=1}}return i=g?i+s.slice(g):s,$?i:v.foldFlowLines(i,f,v.FOLD_QUOTED,q_(_,!1))}function is(u,_){if(_.options.singleQuote===!1||_.implicitKey&&u.includes(`
17
- `)||/[ \t]\n|\n[ \t]/.test(u))return bu(u,_);let s=_.indent||(L_(u)?" ":""),$="'"+u.replace(/'/g,"''").replace(/\n+/g,`$&
18
- ${s}`)+"'";return _.implicitKey?$:v.foldFlowLines($,s,v.FOLD_FLOW,q_(_,!1))}function Au(u,_){let{singleQuote:s}=_.options,$;if(s===!1)$=bu;else{let w=u.includes('"'),f=u.includes("'");if(w&&!f)$=is;else if(f&&!w)$=bu;else $=s?is:bu}return $(u,_)}var gs;try{gs=new RegExp(`(^|(?<!
6
+ `+B0(q,$):(_.endsWith(" ")?"":" ")+q;_9.indentComment=B0;_9.lineComment=e2;_9.stringifyComment=t2});var VT=V((H9)=>{function O9(_,$,q="flow",{indentAtStart:T,lineWidth:O=80,minContentWidth:H=20,onFold:X,onOverflow:U}={}){if(!O||O<0)return _;if(O<H)H=0;let J=Math.max(1+H,1+O-$.length);if(_.length<=J)return _;let Z=[],z={},G=O-$.length;if(typeof T==="number")if(T>O-Math.max(2,H))Z.push(0);else G=O-T;let Q=void 0,Y=void 0,R=!1,W=-1,L=-1,B=-1;if(q==="block"){if(W=LT(_,W,$.length),W!==-1)G=W+J}for(let D;D=_[W+=1];){if(q==="quoted"&&D==="\\"){switch(L=W,_[W+1]){case"x":W+=3;break;case"u":W+=5;break;case"U":W+=9;break;default:W+=1}B=W}if(D===`
7
+ `){if(q==="block")W=LT(_,W,$.length);G=W+$.length+J,Q=void 0}else{if(D===" "&&Y&&Y!==" "&&Y!==`
8
+ `&&Y!=="\t"){let M=_[W+1];if(M&&M!==" "&&M!==`
9
+ `&&M!=="\t")Q=W}if(W>=G)if(Q)Z.push(Q),G=Q+J,Q=void 0;else if(q==="quoted"){while(Y===" "||Y==="\t")Y=D,D=_[W+=1],R=!0;let M=W>B+1?W-2:L-1;if(z[M])return _;Z.push(M),z[M]=!0,G=M+J,Q=void 0}else R=!0}Y=D}if(R&&U)U();if(Z.length===0)return _;if(X)X();let A=_.slice(0,Z[0]);for(let D=0;D<Z.length;++D){let M=Z[D],I=Z[D+1]||_.length;if(M===0)A=`
10
+ ${$}${_.slice(0,I)}`;else{if(q==="quoted"&&z[M])A+=`${_[M]}\\`;A+=`
11
+ ${$}${_.slice(M+1,I)}`}}return A}function LT(_,$,q){let T=$,O=$+1,H=_[O];while(H===" "||H==="\t")if($<O+q)H=_[++$];else{do H=_[++$];while(H&&H!==`
12
+ `);T=$,O=$+1,H=_[O]}return T}H9.FOLD_BLOCK="block";H9.FOLD_FLOW="flow";H9.FOLD_QUOTED="quoted";H9.foldFlowLines=O9});var v_=V((W9)=>{var v=f(),__=VT(),M$=(_,$)=>({indentAtStart:$?_.indent.length:_.indentAtStart,lineWidth:_.options.lineWidth,minContentWidth:_.options.minContentWidth}),I$=(_)=>/^(%|---|\.\.\.)/m.test(_);function z9(_,$,q){if(!$||$<0)return!1;let T=$-q,O=_.length;if(O<=T)return!1;for(let H=0,X=0;H<O;++H)if(_[H]===`
13
+ `){if(H-X>T)return!0;if(X=H+1,O-X<=T)return!1}return!0}function h_(_,$){let q=JSON.stringify(_);if($.options.doubleQuotedAsJSON)return q;let{implicitKey:T}=$,O=$.options.doubleQuotedMinMultiLineLength,H=$.indent||(I$(_)?" ":""),X="",U=0;for(let J=0,Z=q[J];Z;Z=q[++J]){if(Z===" "&&q[J+1]==="\\"&&q[J+2]==="n")X+=q.slice(U,J)+"\\ ",J+=1,U=J,Z="\\";if(Z==="\\")switch(q[J+1]){case"u":{X+=q.slice(U,J);let z=q.substr(J+2,4);switch(z){case"0000":X+="\\0";break;case"0007":X+="\\a";break;case"000b":X+="\\v";break;case"001b":X+="\\e";break;case"0085":X+="\\N";break;case"00a0":X+="\\_";break;case"2028":X+="\\L";break;case"2029":X+="\\P";break;default:if(z.substr(0,2)==="00")X+="\\x"+z.substr(2);else X+=q.substr(J,6)}J+=5,U=J+1}break;case"n":if(T||q[J+2]==='"'||q.length<O)J+=1;else{X+=q.slice(U,J)+`
14
+
15
+ `;while(q[J+2]==="\\"&&q[J+3]==="n"&&q[J+4]!=='"')X+=`
16
+ `,J+=2;if(X+=H,q[J+2]===" ")X+="\\";J+=1,U=J+1}break;default:J+=1}}return X=U?X+q.slice(U):q,T?X:__.foldFlowLines(X,H,__.FOLD_QUOTED,M$($,!1))}function w0(_,$){if($.options.singleQuote===!1||$.implicitKey&&_.includes(`
17
+ `)||/[ \t]\n|\n[ \t]/.test(_))return h_(_,$);let q=$.indent||(I$(_)?" ":""),T="'"+_.replace(/'/g,"''").replace(/\n+/g,`$&
18
+ ${q}`)+"'";return $.implicitKey?T:__.foldFlowLines(T,q,__.FOLD_FLOW,M$($,!1))}function F_(_,$){let{singleQuote:q}=$.options,T;if(q===!1)T=h_;else{let O=_.includes('"'),H=_.includes("'");if(O&&!H)T=w0;else if(H&&!O)T=h_;else T=q?w0:h_}return T(_,$)}var A0;try{A0=new RegExp(`(^|(?<!
19
19
  ))
20
20
  +(?!
21
- |$)`,"g")}catch{gs=/\n+(?!\n|$)/g}function T_({comment:u,type:_,value:s},$,w,f){let{blockQuote:i,commentString:g,lineWidth:R}=$.options;if(!i||/\n[\t ]+$/.test(s))return Au(s,$);let S=$.indent||($.forceBlockIndent||L_(s)?" ":""),L=i==="literal"?!0:i==="folded"||_===K.Scalar.BLOCK_FOLDED?!1:_===K.Scalar.BLOCK_LITERAL?!0:!y0(s,R,S.length);if(!s)return L?`|
21
+ |$)`,"g")}catch{A0=/\n+(?!\n|$)/g}function D$({comment:_,type:$,value:q},T,O,H){let{blockQuote:X,commentString:U,lineWidth:J}=T.options;if(!X||/\n[\t ]+$/.test(q))return F_(q,T);let Z=T.indent||(T.forceBlockIndent||I$(q)?" ":""),z=X==="literal"?!0:X==="folded"||$===v.Scalar.BLOCK_FOLDED?!1:$===v.Scalar.BLOCK_LITERAL?!0:!z9(q,J,Z.length);if(!q)return z?`|
22
22
  `:`>
23
- `;let I,T;for(T=s.length;T>0;--T){let G=s[T-1];if(G!==`
24
- `&&G!=="\t"&&G!==" ")break}let O=s.substring(T),H=O.indexOf(`
25
- `);if(H===-1)I="-";else if(s===O||H!==O.length-1){if(I="+",f)f()}else I="";if(O){if(s=s.slice(0,-O.length),O[O.length-1]===`
26
- `)O=O.slice(0,-1);O=O.replace(gs,`$&${S}`)}let q=!1,U,P=-1;for(U=0;U<s.length;++U){let G=s[U];if(G===" ")q=!0;else if(G===`
27
- `)P=U;else break}let F=s.substring(0,P<U?P+1:U);if(F)s=s.substring(F.length),F=F.replace(/\n+/g,`$&${S}`);let Y=(q?S?"2":"1":"")+I;if(u){if(Y+=" "+g(u.replace(/ ?[\r\n]+/g," ")),w)w()}if(!L){let G=s.replace(/\n+/g,`
28
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${S}`),W=!1,J=q_($,!0);if(i!=="folded"&&_!==K.Scalar.BLOCK_FOLDED)J.onOverflow=()=>{W=!0};let A=v.foldFlowLines(`${F}${G}${O}`,S,v.FOLD_BLOCK,J);if(!W)return`>${Y}
29
- ${S}${A}`}return s=s.replace(/\n+/g,`$&${S}`),`|${Y}
30
- ${S}${F}${s}${O}`}function d0(u,_,s,$){let{type:w,value:f}=u,{actualString:i,implicitKey:g,indent:R,indentStep:S,inFlow:L}=_;if(g&&f.includes(`
31
- `)||L&&/[[\]{},]/.test(f))return Au(f,_);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return g||L||!f.includes(`
32
- `)?Au(f,_):T_(u,_,s,$);if(!g&&!L&&w!==K.Scalar.PLAIN&&f.includes(`
33
- `))return T_(u,_,s,$);if(L_(f)){if(R==="")return _.forceBlockIndent=!0,T_(u,_,s,$);else if(g&&R===S)return Au(f,_)}let I=f.replace(/\n+/g,`$&
34
- ${R}`);if(i){let T=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(I),{compat:O,tags:H}=_.doc.schema;if(H.some(T)||O?.some(T))return Au(f,_)}return g?I:v.foldFlowLines(I,R,v.FOLD_FLOW,q_(_,!1))}function n0(u,_,s,$){let{implicitKey:w,inFlow:f}=_,i=typeof u.value==="string"?u:Object.assign({},u,{value:String(u.value)}),{type:g}=u;if(g!==K.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(i.value))g=K.Scalar.QUOTE_DOUBLE}let R=(L)=>{switch(L){case K.Scalar.BLOCK_FOLDED:case K.Scalar.BLOCK_LITERAL:return w||f?Au(i.value,_):T_(i,_,s,$);case K.Scalar.QUOTE_DOUBLE:return bu(i.value,_);case K.Scalar.QUOTE_SINGLE:return is(i.value,_);case K.Scalar.PLAIN:return d0(i,_,s,$);default:return null}},S=R(g);if(S===null){let{defaultKeyType:L,defaultStringType:I}=_.options,T=w&&L||I;if(S=R(T),S===null)throw Error(`Unsupported default string type ${T}`)}return S}h0.stringifyString=n0});var Cu=D((o0)=>{var c0=g_(),o=X(),x0=Vu(),k0=Eu();function p0(u,_){let s=Object.assign({blockQuote:!0,commentString:x0.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},u.schema.toStringOptions,_),$;switch(s.collectionStyle){case"block":$=!1;break;case"flow":$=!0;break;default:$=null}return{anchors:new Set,doc:u,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent==="number"?" ".repeat(s.indent):" ",inFlow:$,options:s}}function a0(u,_){if(_.tag){let w=u.filter((f)=>f.tag===_.tag);if(w.length>0)return w.find((f)=>f.format===_.format)??w[0]}let s=void 0,$;if(o.isScalar(_)){$=_.value;let w=u.filter((f)=>f.identify?.($));if(w.length>1){let f=w.filter((i)=>i.test);if(f.length>0)w=f}s=w.find((f)=>f.format===_.format)??w.find((f)=>!f.format)}else $=_,s=u.find((w)=>w.nodeClass&&$ instanceof w.nodeClass);if(!s){let w=$?.constructor?.name??($===null?"null":typeof $);throw Error(`Tag not resolved for ${w} value`)}return s}function t0(u,_,{anchors:s,doc:$}){if(!$.directives)return"";let w=[],f=(o.isScalar(u)||o.isCollection(u))&&u.anchor;if(f&&c0.anchorIsValid(f))s.add(f),w.push(`&${f}`);let i=u.tag??(_.default?null:_.tag);if(i)w.push($.directives.tagString(i));return w.join(" ")}function v0(u,_,s,$){if(o.isPair(u))return u.toString(_,s,$);if(o.isAlias(u)){if(_.doc.directives)return u.toString(_);if(_.resolvedAliases?.has(u))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(_.resolvedAliases)_.resolvedAliases.add(u);else _.resolvedAliases=new Set([u]);u=u.resolve(_.doc)}}let w=void 0,f=o.isNode(u)?u:_.doc.createNode(u,{onTagObj:(R)=>w=R});w??(w=a0(_.doc.schema.tags,f));let i=t0(f,w,_);if(i.length>0)_.indentAtStart=(_.indentAtStart??0)+i.length+1;let g=typeof w.stringify==="function"?w.stringify(f,_,s,$):o.isScalar(f)?k0.stringifyString(f,_,s,$):f.toString(_,s,$);if(!i)return g;return o.isScalar(f)||g[0]==="{"||g[0]==="["?`${i} ${g}`:`${i}
35
- ${_.indent}${g}`}o0.createStringifyContext=p0;o0.stringify=v0});var uw=D((sR)=>{var k=X(),o$=B(),e$=Cu(),ru=Vu();function _R({key:u,value:_},s,$,w){let{allNullValues:f,doc:i,indent:g,indentStep:R,options:{commentString:S,indentSeq:L,simpleKeys:I}}=s,T=k.isNode(u)&&u.comment||null;if(I){if(T)throw Error("With simple keys, key nodes cannot have comments");if(k.isCollection(u)||!k.isNode(u)&&typeof u==="object")throw Error("With simple keys, collection cannot be used as a key value")}let O=!I&&(!u||T&&_==null&&!s.inFlow||k.isCollection(u)||(k.isScalar(u)?u.type===o$.Scalar.BLOCK_FOLDED||u.type===o$.Scalar.BLOCK_LITERAL:typeof u==="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!O&&(I||!f),indent:g+R});let H=!1,q=!1,U=e$.stringify(u,s,()=>H=!0,()=>q=!0);if(!O&&!s.inFlow&&U.length>1024){if(I)throw Error("With simple keys, single line scalar must not span more than 1024 characters");O=!0}if(s.inFlow){if(f||_==null){if(H&&$)$();return U===""?"?":O?`? ${U}`:U}}else if(f&&!I||_==null&&O){if(U=`? ${U}`,T&&!H)U+=ru.lineComment(U,s.indent,S(T));else if(q&&w)w();return U}if(H)T=null;if(O){if(T)U+=ru.lineComment(U,s.indent,S(T));U=`? ${U}
36
- ${g}:`}else if(U=`${U}:`,T)U+=ru.lineComment(U,s.indent,S(T));let P,F,z;if(k.isNode(_))P=!!_.spaceBefore,F=_.commentBefore,z=_.comment;else if(P=!1,F=null,z=null,_&&typeof _==="object")_=i.createNode(_);if(s.implicitKey=!1,!O&&!T&&k.isScalar(_))s.indentAtStart=U.length+1;if(q=!1,!L&&R.length>=2&&!s.inFlow&&!O&&k.isSeq(_)&&!_.flow&&!_.tag&&!_.anchor)s.indent=s.indent.substring(2);let Y=!1,G=e$.stringify(_,s,()=>Y=!0,()=>q=!0),W=" ";if(T||P||F){if(W=P?`
37
- `:"",F){let J=S(F);W+=`
38
- ${ru.indentComment(J,s.indent)}`}if(G===""&&!s.inFlow){if(W===`
39
- `&&z)W=`
40
-
41
- `}else W+=`
42
- ${s.indent}`}else if(!O&&k.isCollection(_)){let J=G[0],A=G.indexOf(`
43
- `),Z=A!==-1,a=s.inFlow??_.flow??_.items.length===0;if(Z||!a){let Uu=!1;if(Z&&(J==="&"||J==="!")){let M=G.indexOf(" ");if(J==="&"&&M!==-1&&M<A&&G[M+1]==="!")M=G.indexOf(" ",M+1);if(M===-1||A<M)Uu=!0}if(!Uu)W=`
44
- ${s.indent}`}}else if(G===""||G[0]===`
45
- `)W="";if(U+=W+G,s.inFlow){if(Y&&$)$()}else if(z&&!Y)U+=ru.lineComment(U,s.indent,S(z));else if(q&&w)w();return U}sR.stringifyPair=_R});var Rs=D((iR)=>{var _w=s_("process");function wR(u,..._){if(u==="debug")console.log(..._)}function fR(u,_){if(u==="debug"||u==="warn")if(typeof _w.emitWarning==="function")_w.emitWarning(_);else console.warn(_)}iR.debug=wR;iR.warn=fR});var D_=D((IR)=>{var H_=X(),sw=B(),O_="<<",U_={identify:(u)=>u===O_||typeof u==="symbol"&&u.description===O_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new sw.Scalar(Symbol(O_)),{addToJSMap:$w}),stringify:()=>O_},SR=(u,_)=>(U_.identify(_)||H_.isScalar(_)&&(!_.type||_.type===sw.Scalar.PLAIN)&&U_.identify(_.value))&&u?.doc.schema.tags.some((s)=>s.tag===U_.tag&&s.default);function $w(u,_,s){let $=ww(u,s);if(H_.isSeq($))for(let w of $.items)Ss(u,_,w);else if(Array.isArray($))for(let w of $)Ss(u,_,w);else Ss(u,_,$)}function Ss(u,_,s){let $=ww(u,s);if(!H_.isMap($))throw Error("Merge sources must be maps or map aliases");let w=$.toJSON(null,u,Map);for(let[f,i]of w)if(_ instanceof Map){if(!_.has(f))_.set(f,i)}else if(_ instanceof Set)_.add(f);else if(!Object.prototype.hasOwnProperty.call(_,f))Object.defineProperty(_,f,{value:i,writable:!0,enumerable:!0,configurable:!0});return _}function ww(u,_){return u&&H_.isAlias(_)?_.resolve(u.doc,u):_}IR.addMergeToJSMap=$w;IR.isMergeKey=SR;IR.merge=U_});var Ts=D((PR)=>{var OR=Rs(),fw=D_(),UR=Cu(),iw=X(),Is=t();function HR(u,_,{key:s,value:$}){if(iw.isNode(s)&&s.addToJSMap)s.addToJSMap(u,_,$);else if(fw.isMergeKey(u,s))fw.addMergeToJSMap(u,_,$);else{let w=Is.toJS(s,"",u);if(_ instanceof Map)_.set(w,Is.toJS($,w,u));else if(_ instanceof Set)_.add(w);else{let f=DR(s,w,u),i=Is.toJS($,f,u);if(f in _)Object.defineProperty(_,f,{value:i,writable:!0,enumerable:!0,configurable:!0});else _[f]=i}}return _}function DR(u,_,s){if(_===null)return"";if(typeof _!=="object")return String(_);if(iw.isNode(u)&&s?.doc){let $=UR.createStringifyContext(s.doc,{});$.anchors=new Set;for(let f of s.anchors.keys())$.anchors.add(f.anchor);$.inFlow=!0,$.inStringifyKey=!0;let w=u.toString($);if(!s.mapKeyWarned){let f=JSON.stringify(w);if(f.length>40)f=f.substring(0,36)+'..."';OR.warn(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${f}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return w}return JSON.stringify(_)}PR.addPairToJSMap=HR});var e=D((GR)=>{var gw=Nu(),FR=uw(),zR=Ts(),P_=X();function YR(u,_,s){let $=gw.createNode(u,void 0,s),w=gw.createNode(_,void 0,s);return new A_($,w)}class A_{constructor(u,_=null){Object.defineProperty(this,P_.NODE_TYPE,{value:P_.PAIR}),this.key=u,this.value=_}clone(u){let{key:_,value:s}=this;if(P_.isNode(_))_=_.clone(u);if(P_.isNode(s))s=s.clone(u);return new A_(_,s)}toJSON(u,_){let s=_?.mapAsMap?new Map:{};return zR.addPairToJSMap(_,s,this)}toString(u,_,s){return u?.doc?FR.stringifyPair(this,u,_,s):JSON.stringify(this)}}GR.Pair=A_;GR.createPair=YR});var qs=D((MR)=>{var Su=X(),Rw=Cu(),F_=Vu();function JR(u,_,s){return(_.inFlow??u.flow?ZR:BR)(u,_,s)}function BR({comment:u,items:_},s,{blockItemPrefix:$,flowChars:w,itemIndent:f,onChompKeep:i,onComment:g}){let{indent:R,options:{commentString:S}}=s,L=Object.assign({},s,{indent:f,type:null}),I=!1,T=[];for(let H=0;H<_.length;++H){let q=_[H],U=null;if(Su.isNode(q)){if(!I&&q.spaceBefore)T.push("");if(z_(s,T,q.commentBefore,I),q.comment)U=q.comment}else if(Su.isPair(q)){let F=Su.isNode(q.key)?q.key:null;if(F){if(!I&&F.spaceBefore)T.push("");z_(s,T,F.commentBefore,I)}}I=!1;let P=Rw.stringify(q,L,()=>U=null,()=>I=!0);if(U)P+=F_.lineComment(P,f,S(U));if(I&&U)I=!1;T.push($+P)}let O;if(T.length===0)O=w.start+w.end;else{O=T[0];for(let H=1;H<T.length;++H){let q=T[H];O+=q?`
46
- ${R}${q}`:`
47
- `}}if(u){if(O+=`
48
- `+F_.indentComment(S(u),R),g)g()}else if(I&&i)i();return O}function ZR({items:u},_,{flowChars:s,itemIndent:$}){let{indent:w,indentStep:f,flowCollectionPadding:i,options:{commentString:g}}=_;$+=f;let R=Object.assign({},_,{indent:$,inFlow:!0,type:null}),S=!1,L=0,I=[];for(let H=0;H<u.length;++H){let q=u[H],U=null;if(Su.isNode(q)){if(q.spaceBefore)I.push("");if(z_(_,I,q.commentBefore,!1),q.comment)U=q.comment}else if(Su.isPair(q)){let F=Su.isNode(q.key)?q.key:null;if(F){if(F.spaceBefore)I.push("");if(z_(_,I,F.commentBefore,!1),F.comment)S=!0}let z=Su.isNode(q.value)?q.value:null;if(z){if(z.comment)U=z.comment;if(z.commentBefore)S=!0}else if(q.value==null&&F?.comment)U=F.comment}if(U)S=!0;let P=Rw.stringify(q,R,()=>U=null);if(S||(S=I.length>L||P.includes(`
49
- `)),H<u.length-1)P+=",";else if(_.options.trailingComma){if(_.options.lineWidth>0)S||(S=I.reduce((F,z)=>F+z.length+2,2)+(P.length+2)>_.options.lineWidth);if(S)P+=","}if(U)P+=F_.lineComment(P,$,g(U));I.push(P),L=I.length}let{start:T,end:O}=s;if(I.length===0)return T+O;else{if(!S){let H=I.reduce((q,U)=>q+U.length+2,2);S=_.options.lineWidth>0&&H>_.options.lineWidth}if(S){let H=T;for(let q of I)H+=q?`
50
- ${f}${w}${q}`:`
51
- `;return`${H}
52
- ${w}${O}`}else return`${T}${i}${I.join(" ")}${i}${O}`}}function z_({indent:u,options:{commentString:_}},s,$,w){if($&&w)$=$.replace(/^\n+/,"");if($){let f=F_.indentComment(_($),u);s.push(f.trimStart())}}MR.stringifyCollection=JR});var _u=D((ER)=>{var QR=qs(),NR=Ts(),VR=I_(),uu=X(),Y_=e(),bR=B();function lu(u,_){let s=uu.isScalar(_)?_.value:_;for(let $ of u)if(uu.isPair($)){if($.key===_||$.key===s)return $;if(uu.isScalar($.key)&&$.key.value===s)return $}return}class Sw extends VR.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(u){super(uu.MAP,u);this.items=[]}static from(u,_,s){let{keepUndefined:$,replacer:w}=s,f=new this(u),i=(g,R)=>{if(typeof w==="function")R=w.call(_,g,R);else if(Array.isArray(w)&&!w.includes(g))return;if(R!==void 0||$)f.items.push(Y_.createPair(g,R,s))};if(_ instanceof Map)for(let[g,R]of _)i(g,R);else if(_&&typeof _==="object")for(let g of Object.keys(_))i(g,_[g]);if(typeof u.sortMapEntries==="function")f.items.sort(u.sortMapEntries);return f}add(u,_){let s;if(uu.isPair(u))s=u;else if(!u||typeof u!=="object"||!("key"in u))s=new Y_.Pair(u,u?.value);else s=new Y_.Pair(u.key,u.value);let $=lu(this.items,s.key),w=this.schema?.sortMapEntries;if($){if(!_)throw Error(`Key ${s.key} already set`);if(uu.isScalar($.value)&&bR.isScalarValue(s.value))$.value.value=s.value;else $.value=s.value}else if(w){let f=this.items.findIndex((i)=>w(s,i)<0);if(f===-1)this.items.push(s);else this.items.splice(f,0,s)}else this.items.push(s)}delete(u){let _=lu(this.items,u);if(!_)return!1;return this.items.splice(this.items.indexOf(_),1).length>0}get(u,_){let $=lu(this.items,u)?.value;return(!_&&uu.isScalar($)?$.value:$)??void 0}has(u){return!!lu(this.items,u)}set(u,_){this.add(new Y_.Pair(u,_),!0)}toJSON(u,_,s){let $=s?new s:_?.mapAsMap?new Map:{};if(_?.onCreate)_.onCreate($);for(let w of this.items)NR.addPairToJSMap(_,$,w);return $}toString(u,_,s){if(!u)return JSON.stringify(this);for(let $ of this.items)if(!uu.isPair($))throw Error(`Map items must all be pairs; found ${JSON.stringify($)} instead`);if(!u.allNullValues&&this.hasAllNullValues(!1))u=Object.assign({},u,{allNullValues:!0});return QR.stringifyCollection(this,u,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:u.indent||"",onChompKeep:s,onComment:_})}}ER.YAMLMap=Sw;ER.findPair=lu});var Fu=D((yR)=>{var lR=X(),Iw=_u(),KR={collection:"map",default:!0,nodeClass:Iw.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(u,_){if(!lR.isMap(u))_("Expected a mapping for this tag");return u},createNode:(u,_,s)=>Iw.YAMLMap.from(u,_,s)};yR.map=KR});var su=D((kR)=>{var nR=Nu(),hR=qs(),mR=I_(),W_=X(),cR=B(),xR=t();class Tw extends mR.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(u){super(W_.SEQ,u);this.items=[]}add(u){this.items.push(u)}delete(u){let _=G_(u);if(typeof _!=="number")return!1;return this.items.splice(_,1).length>0}get(u,_){let s=G_(u);if(typeof s!=="number")return;let $=this.items[s];return!_&&W_.isScalar($)?$.value:$}has(u){let _=G_(u);return typeof _==="number"&&_<this.items.length}set(u,_){let s=G_(u);if(typeof s!=="number")throw Error(`Expected a valid index, not ${u}.`);let $=this.items[s];if(W_.isScalar($)&&cR.isScalarValue(_))$.value=_;else this.items[s]=_}toJSON(u,_){let s=[];if(_?.onCreate)_.onCreate(s);let $=0;for(let w of this.items)s.push(xR.toJS(w,String($++),_));return s}toString(u,_,s){if(!u)return JSON.stringify(this);return hR.stringifyCollection(this,u,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(u.indent||"")+" ",onChompKeep:s,onComment:_})}static from(u,_,s){let{replacer:$}=s,w=new this(u);if(_&&Symbol.iterator in Object(_)){let f=0;for(let i of _){if(typeof $==="function"){let g=_ instanceof Set?i:String(f++);i=$.call(_,g,i)}w.items.push(nR.createNode(i,void 0,s))}}return w}}function G_(u){let _=W_.isScalar(u)?u.value:u;if(_&&typeof _==="string")_=Number(_);return typeof _==="number"&&Number.isInteger(_)&&_>=0?_:null}kR.YAMLSeq=Tw});var zu=D((vR)=>{var aR=X(),qw=su(),tR={collection:"seq",default:!0,nodeClass:qw.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(u,_){if(!aR.isSeq(u))_("Expected a sequence for this tag");return u},createNode:(u,_,s)=>qw.YAMLSeq.from(u,_,s)};vR.seq=tR});var Ku=D((_S)=>{var eR=Eu(),uS={identify:(u)=>typeof u==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(u)=>u,stringify(u,_,s,$){return _=Object.assign({actualString:!0},_),eR.stringifyString(u,_,s,$)}};_S.string=uS});var X_=D(($S)=>{var Lw=B(),Ow={identify:(u)=>u==null,createNode:()=>new Lw.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Lw.Scalar(null),stringify:({source:u},_)=>typeof u==="string"&&Ow.test.test(u)?u:_.options.nullStr};$S.nullTag=Ow});var Ls=D((iS)=>{var fS=B(),Uw={identify:(u)=>typeof u==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(u)=>new fS.Scalar(u[0]==="t"||u[0]==="T"),stringify({source:u,value:_},s){if(u&&Uw.test.test(u)){let $=u[0]==="t"||u[0]==="T";if(_===$)return u}return _?s.options.trueStr:s.options.falseStr}};iS.boolTag=Uw});var Yu=D((SS)=>{function RS({format:u,minFractionDigits:_,tag:s,value:$}){if(typeof $==="bigint")return String($);let w=typeof $==="number"?$:Number($);if(!isFinite(w))return isNaN(w)?".nan":w<0?"-.inf":".inf";let f=Object.is($,-0)?"-0":JSON.stringify($);if(!u&&_&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(f)&&!f.includes("e")){let i=f.indexOf(".");if(i<0)i=f.length,f+=".";let g=_-(f.length-i-1);while(g-- >0)f+="0"}return f}SS.stringifyNumber=RS});var Us=D((US)=>{var TS=B(),Os=Yu(),qS={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(u)=>u.slice(-3).toLowerCase()==="nan"?NaN:u[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Os.stringifyNumber},LS={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(u)=>parseFloat(u),stringify(u){let _=Number(u.value);return isFinite(_)?_.toExponential():Os.stringifyNumber(u)}},OS={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(u){let _=new TS.Scalar(parseFloat(u)),s=u.indexOf(".");if(s!==-1&&u[u.length-1]==="0")_.minFractionDigits=u.length-s-1;return _},stringify:Os.stringifyNumber};US.float=OS;US.floatExp=LS;US.floatNaN=qS});var Ds=D((YS)=>{var Hw=Yu(),J_=(u)=>typeof u==="bigint"||Number.isInteger(u),Hs=(u,_,s,{intAsBigInt:$})=>$?BigInt(u):parseInt(u.substring(_),s);function Dw(u,_,s){let{value:$}=u;if(J_($)&&$>=0)return s+$.toString(_);return Hw.stringifyNumber(u)}var AS={identify:(u)=>J_(u)&&u>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(u,_,s)=>Hs(u,2,8,s),stringify:(u)=>Dw(u,8,"0o")},FS={identify:J_,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(u,_,s)=>Hs(u,0,10,s),stringify:Hw.stringifyNumber},zS={identify:(u)=>J_(u)&&u>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(u,_,s)=>Hs(u,2,16,s),stringify:(u)=>Dw(u,16,"0x")};YS.int=FS;YS.intHex=zS;YS.intOct=AS});var Pw=D((NS)=>{var JS=Fu(),BS=X_(),ZS=zu(),MS=Ku(),jS=Ls(),Ps=Us(),As=Ds(),QS=[JS.map,ZS.seq,MS.string,BS.nullTag,jS.boolTag,As.intOct,As.int,As.intHex,Ps.floatNaN,Ps.floatExp,Ps.float];NS.schema=QS});var Fw=D((yS)=>{var bS=B(),ES=Fu(),CS=zu();function Aw(u){return typeof u==="bigint"||Number.isInteger(u)}var B_=({value:u})=>JSON.stringify(u),rS=[{identify:(u)=>typeof u==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(u)=>u,stringify:B_},{identify:(u)=>u==null,createNode:()=>new bS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:B_},{identify:(u)=>typeof u==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(u)=>u==="true",stringify:B_},{identify:Aw,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(u,_,{intAsBigInt:s})=>s?BigInt(u):parseInt(u,10),stringify:({value:u})=>Aw(u)?u.toString():JSON.stringify(u)},{identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(u)=>parseFloat(u),stringify:B_}],lS={default:!0,tag:"",test:/^/,resolve(u,_){return _(`Unresolved plain scalar ${JSON.stringify(u)}`),u}},KS=[ES.map,CS.seq].concat(rS,lS);yS.schema=KS});var zs=D((mS)=>{var yu=s_("buffer"),Fs=B(),nS=Eu(),hS={identify:(u)=>u instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(u,_){if(typeof yu.Buffer==="function")return yu.Buffer.from(u,"base64");else if(typeof atob==="function"){let s=atob(u.replace(/[\n\r]/g,"")),$=new Uint8Array(s.length);for(let w=0;w<s.length;++w)$[w]=s.charCodeAt(w);return $}else return _("This environment does not support reading binary tags; either Buffer or atob is required"),u},stringify({comment:u,type:_,value:s},$,w,f){if(!s)return"";let i=s,g;if(typeof yu.Buffer==="function")g=i instanceof yu.Buffer?i.toString("base64"):yu.Buffer.from(i.buffer).toString("base64");else if(typeof btoa==="function"){let R="";for(let S=0;S<i.length;++S)R+=String.fromCharCode(i[S]);g=btoa(R)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(_??(_=Fs.Scalar.BLOCK_LITERAL),_!==Fs.Scalar.QUOTE_DOUBLE){let R=Math.max($.options.lineWidth-$.indent.length,$.options.minContentWidth),S=Math.ceil(g.length/R),L=Array(S);for(let I=0,T=0;I<S;++I,T+=R)L[I]=g.substr(T,R);g=L.join(_===Fs.Scalar.BLOCK_LITERAL?`
53
- `:" ")}return nS.stringifyString({comment:u,type:_,value:g},$,w,f)}};mS.binary=hS});var M_=D((aS)=>{var Z_=X(),Ys=e(),xS=B(),kS=su();function zw(u,_){if(Z_.isSeq(u))for(let s=0;s<u.items.length;++s){let $=u.items[s];if(Z_.isPair($))continue;else if(Z_.isMap($)){if($.items.length>1)_("Each pair must have its own sequence indicator");let w=$.items[0]||new Ys.Pair(new xS.Scalar(null));if($.commentBefore)w.key.commentBefore=w.key.commentBefore?`${$.commentBefore}
54
- ${w.key.commentBefore}`:$.commentBefore;if($.comment){let f=w.value??w.key;f.comment=f.comment?`${$.comment}
55
- ${f.comment}`:$.comment}$=w}u.items[s]=Z_.isPair($)?$:new Ys.Pair($)}else _("Expected a sequence for this tag");return u}function Yw(u,_,s){let{replacer:$}=s,w=new kS.YAMLSeq(u);w.tag="tag:yaml.org,2002:pairs";let f=0;if(_&&Symbol.iterator in Object(_))for(let i of _){if(typeof $==="function")i=$.call(_,String(f++),i);let g,R;if(Array.isArray(i))if(i.length===2)g=i[0],R=i[1];else throw TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){let S=Object.keys(i);if(S.length===1)g=S[0],R=i[g];else throw TypeError(`Expected tuple with one key, not ${S.length} keys`)}else g=i;w.items.push(Ys.createPair(g,R,s))}return w}var pS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zw,createNode:Yw};aS.createPairs=Yw;aS.pairs=pS;aS.resolvePairs=zw});var Ws=D((_I)=>{var Gw=X(),Gs=t(),du=_u(),eS=su(),Ww=M_();class Iu extends eS.YAMLSeq{constructor(){super();this.add=du.YAMLMap.prototype.add.bind(this),this.delete=du.YAMLMap.prototype.delete.bind(this),this.get=du.YAMLMap.prototype.get.bind(this),this.has=du.YAMLMap.prototype.has.bind(this),this.set=du.YAMLMap.prototype.set.bind(this),this.tag=Iu.tag}toJSON(u,_){if(!_)return super.toJSON(u);let s=new Map;if(_?.onCreate)_.onCreate(s);for(let $ of this.items){let w,f;if(Gw.isPair($))w=Gs.toJS($.key,"",_),f=Gs.toJS($.value,w,_);else w=Gs.toJS($,"",_);if(s.has(w))throw Error("Ordered maps must not include duplicate keys");s.set(w,f)}return s}static from(u,_,s){let $=Ww.createPairs(u,_,s),w=new this;return w.items=$.items,w}}Iu.tag="tag:yaml.org,2002:omap";var uI={collection:"seq",identify:(u)=>u instanceof Map,nodeClass:Iu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(u,_){let s=Ww.resolvePairs(u,_),$=[];for(let{key:w}of s.items)if(Gw.isScalar(w))if($.includes(w.value))_(`Ordered maps must not include duplicate keys: ${w.value}`);else $.push(w.value);return Object.assign(new Iu,s)},createNode:(u,_,s)=>Iu.from(u,_,s)};_I.YAMLOMap=Iu;_I.omap=uI});var Mw=D((wI)=>{var Xw=B();function Jw({value:u,source:_},s){if(_&&(u?Bw:Zw).test.test(_))return _;return u?s.options.trueStr:s.options.falseStr}var Bw={identify:(u)=>u===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Xw.Scalar(!0),stringify:Jw},Zw={identify:(u)=>u===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Xw.Scalar(!1),stringify:Jw};wI.falseTag=Zw;wI.trueTag=Bw});var jw=D((TI)=>{var gI=B(),Xs=Yu(),RI={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(u)=>u.slice(-3).toLowerCase()==="nan"?NaN:u[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Xs.stringifyNumber},SI={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(u)=>parseFloat(u.replace(/_/g,"")),stringify(u){let _=Number(u.value);return isFinite(_)?_.toExponential():Xs.stringifyNumber(u)}},II={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(u){let _=new gI.Scalar(parseFloat(u.replace(/_/g,""))),s=u.indexOf(".");if(s!==-1){let $=u.substring(s+1).replace(/_/g,"");if($[$.length-1]==="0")_.minFractionDigits=$.length}return _},stringify:Xs.stringifyNumber};TI.float=II;TI.floatExp=SI;TI.floatNaN=RI});var Nw=D((AI)=>{var Qw=Yu(),nu=(u)=>typeof u==="bigint"||Number.isInteger(u);function j_(u,_,s,{intAsBigInt:$}){let w=u[0];if(w==="-"||w==="+")_+=1;if(u=u.substring(_).replace(/_/g,""),$){switch(s){case 2:u=`0b${u}`;break;case 8:u=`0o${u}`;break;case 16:u=`0x${u}`;break}let i=BigInt(u);return w==="-"?BigInt(-1)*i:i}let f=parseInt(u,s);return w==="-"?-1*f:f}function Js(u,_,s){let{value:$}=u;if(nu($)){let w=$.toString(_);return $<0?"-"+s+w.substr(1):s+w}return Qw.stringifyNumber(u)}var UI={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(u,_,s)=>j_(u,2,2,s),stringify:(u)=>Js(u,2,"0b")},HI={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(u,_,s)=>j_(u,1,8,s),stringify:(u)=>Js(u,8,"0")},DI={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(u,_,s)=>j_(u,0,10,s),stringify:Qw.stringifyNumber},PI={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(u,_,s)=>j_(u,2,16,s),stringify:(u)=>Js(u,16,"0x")};AI.int=DI;AI.intBin=UI;AI.intHex=PI;AI.intOct=HI});var Bs=D((XI)=>{var V_=X(),Q_=e(),N_=_u();class Tu extends N_.YAMLMap{constructor(u){super(u);this.tag=Tu.tag}add(u){let _;if(V_.isPair(u))_=u;else if(u&&typeof u==="object"&&"key"in u&&"value"in u&&u.value===null)_=new Q_.Pair(u.key,null);else _=new Q_.Pair(u,null);if(!N_.findPair(this.items,_.key))this.items.push(_)}get(u,_){let s=N_.findPair(this.items,u);return!_&&V_.isPair(s)?V_.isScalar(s.key)?s.key.value:s.key:s}set(u,_){if(typeof _!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof _}`);let s=N_.findPair(this.items,u);if(s&&!_)this.items.splice(this.items.indexOf(s),1);else if(!s&&_)this.items.push(new Q_.Pair(u))}toJSON(u,_){return super.toJSON(u,_,Set)}toString(u,_,s){if(!u)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},u,{allNullValues:!0}),_,s);else throw Error("Set items must all have null values")}static from(u,_,s){let{replacer:$}=s,w=new this(u);if(_&&Symbol.iterator in Object(_))for(let f of _){if(typeof $==="function")f=$.call(_,f,f);w.items.push(Q_.createPair(f,null,s))}return w}}Tu.tag="tag:yaml.org,2002:set";var WI={collection:"map",identify:(u)=>u instanceof Set,nodeClass:Tu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(u,_,s)=>Tu.from(u,_,s),resolve(u,_){if(V_.isMap(u))if(u.hasAllNullValues(!0))return Object.assign(new Tu,u);else _("Set items must all have null values");else _("Expected a mapping for this tag");return u}};XI.YAMLSet=Tu;XI.set=WI});var Ms=D((QI)=>{var ZI=Yu();function Zs(u,_){let s=u[0],$=s==="-"||s==="+"?u.substring(1):u,w=(i)=>_?BigInt(i):Number(i),f=$.replace(/_/g,"").split(":").reduce((i,g)=>i*w(60)+w(g),w(0));return s==="-"?w(-1)*f:f}function Vw(u){let{value:_}=u,s=(i)=>i;if(typeof _==="bigint")s=(i)=>BigInt(i);else if(isNaN(_)||!isFinite(_))return ZI.stringifyNumber(u);let $="";if(_<0)$="-",_*=s(-1);let w=s(60),f=[_%w];if(_<60)f.unshift(0);else if(_=(_-f[0])/w,f.unshift(_%w),_>=60)_=(_-f[0])/w,f.unshift(_);return $+f.map((i)=>String(i).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var MI={identify:(u)=>typeof u==="bigint"||Number.isInteger(u),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(u,_,{intAsBigInt:s})=>Zs(u,s),stringify:Vw},jI={identify:(u)=>typeof u==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(u)=>Zs(u,!1),stringify:Vw},bw={identify:(u)=>u instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(u){let _=u.match(bw.test);if(!_)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,$,w,f,i,g]=_.map(Number),R=_[7]?Number((_[7]+"00").substr(1,3)):0,S=Date.UTC(s,$-1,w,f||0,i||0,g||0,R),L=_[8];if(L&&L!=="Z"){let I=Zs(L,!1);if(Math.abs(I)<30)I*=60;S-=60000*I}return new Date(S)},stringify:({value:u})=>u?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};QI.floatTime=jI;QI.intTime=MI;QI.timestamp=bw});var Cw=D((cI)=>{var EI=Fu(),CI=X_(),rI=zu(),lI=Ku(),KI=zs(),Ew=Mw(),js=jw(),b_=Nw(),yI=D_(),dI=Ws(),nI=M_(),hI=Bs(),Qs=Ms(),mI=[EI.map,rI.seq,lI.string,CI.nullTag,Ew.trueTag,Ew.falseTag,b_.intBin,b_.intOct,b_.int,b_.intHex,js.floatNaN,js.floatExp,js.float,KI.binary,yI.merge,dI.omap,nI.pairs,hI.set,Qs.intTime,Qs.floatTime,Qs.timestamp];cI.schema=mI});var xw=D((uT)=>{var yw=Fu(),kI=X_(),dw=zu(),pI=Ku(),aI=Ls(),Ns=Us(),Vs=Ds(),tI=Pw(),vI=Fw(),nw=zs(),hu=D_(),hw=Ws(),mw=M_(),rw=Cw(),cw=Bs(),E_=Ms(),lw=new Map([["core",tI.schema],["failsafe",[yw.map,dw.seq,pI.string]],["json",vI.schema],["yaml11",rw.schema],["yaml-1.1",rw.schema]]),Kw={binary:nw.binary,bool:aI.boolTag,float:Ns.float,floatExp:Ns.floatExp,floatNaN:Ns.floatNaN,floatTime:E_.floatTime,int:Vs.int,intHex:Vs.intHex,intOct:Vs.intOct,intTime:E_.intTime,map:yw.map,merge:hu.merge,null:kI.nullTag,omap:hw.omap,pairs:mw.pairs,seq:dw.seq,set:cw.set,timestamp:E_.timestamp},oI={"tag:yaml.org,2002:binary":nw.binary,"tag:yaml.org,2002:merge":hu.merge,"tag:yaml.org,2002:omap":hw.omap,"tag:yaml.org,2002:pairs":mw.pairs,"tag:yaml.org,2002:set":cw.set,"tag:yaml.org,2002:timestamp":E_.timestamp};function eI(u,_,s){let $=lw.get(_);if($&&!u)return s&&!$.includes(hu.merge)?$.concat(hu.merge):$.slice();let w=$;if(!w)if(Array.isArray(u))w=[];else{let f=Array.from(lw.keys()).filter((i)=>i!=="yaml11").map((i)=>JSON.stringify(i)).join(", ");throw Error(`Unknown schema "${_}"; use one of ${f} or define customTags array`)}if(Array.isArray(u))for(let f of u)w=w.concat(f);else if(typeof u==="function")w=u(w.slice());if(s)w=w.concat(hu.merge);return w.reduce((f,i)=>{let g=typeof i==="string"?Kw[i]:i;if(!g){let R=JSON.stringify(i),S=Object.keys(Kw).map((L)=>JSON.stringify(L)).join(", ");throw Error(`Unknown custom tag ${R}; use one of ${S}`)}if(!f.includes(g))f.push(g);return f},[])}uT.coreKnownTags=oI;uT.getTags=eI});var Cs=D((gT)=>{var bs=X(),$T=Fu(),wT=zu(),fT=Ku(),C_=xw(),iT=(u,_)=>u.key<_.key?-1:u.key>_.key?1:0;class Es{constructor({compat:u,customTags:_,merge:s,resolveKnownTags:$,schema:w,sortMapEntries:f,toStringDefaults:i}){this.compat=Array.isArray(u)?C_.getTags(u,"compat"):u?C_.getTags(null,u):null,this.name=typeof w==="string"&&w||"core",this.knownTags=$?C_.coreKnownTags:{},this.tags=C_.getTags(_,this.name,s),this.toStringOptions=i??null,Object.defineProperty(this,bs.MAP,{value:$T.map}),Object.defineProperty(this,bs.SCALAR,{value:fT.string}),Object.defineProperty(this,bs.SEQ,{value:wT.seq}),this.sortMapEntries=typeof f==="function"?f:f===!0?iT:null}clone(){let u=Object.create(Es.prototype,Object.getOwnPropertyDescriptors(this));return u.tags=this.tags.slice(),u}}gT.Schema=Es});var kw=D((TT)=>{var ST=X(),rs=Cu(),mu=Vu();function IT(u,_){let s=[],$=_.directives===!0;if(_.directives!==!1&&u.directives){let R=u.directives.toString(u);if(R)s.push(R),$=!0;else if(u.directives.docStart)$=!0}if($)s.push("---");let w=rs.createStringifyContext(u,_),{commentString:f}=w.options;if(u.commentBefore){if(s.length!==1)s.unshift("");let R=f(u.commentBefore);s.unshift(mu.indentComment(R,""))}let i=!1,g=null;if(u.contents){if(ST.isNode(u.contents)){if(u.contents.spaceBefore&&$)s.push("");if(u.contents.commentBefore){let L=f(u.contents.commentBefore);s.push(mu.indentComment(L,""))}w.forceBlockIndent=!!u.comment,g=u.contents.comment}let R=g?void 0:()=>i=!0,S=rs.stringify(u.contents,w,()=>g=null,R);if(g)S+=mu.lineComment(S,"",f(g));if((S[0]==="|"||S[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${S}`;else s.push(S)}else s.push(rs.stringify(u.contents,w));if(u.directives?.docEnd)if(u.comment){let R=f(u.comment);if(R.includes(`
56
- `))s.push("..."),s.push(mu.indentComment(R,""));else s.push(`... ${R}`)}else s.push("...");else{let R=u.comment;if(R&&i)R=R.replace(/^\n+/,"");if(R){if((!i||g)&&s[s.length-1]!=="")s.push("");s.push(mu.indentComment(f(R),""))}}return s.join(`
23
+ `;let G,Q;for(Q=q.length;Q>0;--Q){let I=q[Q-1];if(I!==`
24
+ `&&I!=="\t"&&I!==" ")break}let Y=q.substring(Q),R=Y.indexOf(`
25
+ `);if(R===-1)G="-";else if(q===Y||R!==Y.length-1){if(G="+",H)H()}else G="";if(Y){if(q=q.slice(0,-Y.length),Y[Y.length-1]===`
26
+ `)Y=Y.slice(0,-1);Y=Y.replace(A0,`$&${Z}`)}let W=!1,L,B=-1;for(L=0;L<q.length;++L){let I=q[L];if(I===" ")W=!0;else if(I===`
27
+ `)B=L;else break}let A=q.substring(0,B<L?B+1:L);if(A)q=q.substring(A.length),A=A.replace(/\n+/g,`$&${Z}`);let M=(W?Z?"2":"1":"")+G;if(_){if(M+=" "+U(_.replace(/ ?[\r\n]+/g," ")),O)O()}if(!z){let I=q.replace(/\n+/g,`
28
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Z}`),F=!1,K=M$(T,!0);if(X!=="folded"&&$!==v.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{F=!0};let w=__.foldFlowLines(`${A}${I}${Y}`,Z,__.FOLD_BLOCK,K);if(!F)return`>${M}
29
+ ${Z}${w}`}return q=q.replace(/\n+/g,`$&${Z}`),`|${M}
30
+ ${Z}${A}${q}${Y}`}function G9(_,$,q,T){let{type:O,value:H}=_,{actualString:X,implicitKey:U,indent:J,indentStep:Z,inFlow:z}=$;if(U&&H.includes(`
31
+ `)||z&&/[[\]{},]/.test(H))return F_(H,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return U||z||!H.includes(`
32
+ `)?F_(H,$):D$(_,$,q,T);if(!U&&!z&&O!==v.Scalar.PLAIN&&H.includes(`
33
+ `))return D$(_,$,q,T);if(I$(H)){if(J==="")return $.forceBlockIndent=!0,D$(_,$,q,T);else if(U&&J===Z)return F_(H,$)}let G=H.replace(/\n+/g,`$&
34
+ ${J}`);if(X){let Q=(W)=>W.default&&W.tag!=="tag:yaml.org,2002:str"&&W.test?.test(G),{compat:Y,tags:R}=$.doc.schema;if(R.some(Q)||Y?.some(Q))return F_(H,$)}return U?G:__.foldFlowLines(G,J,__.FOLD_FLOW,M$($,!1))}function Q9(_,$,q,T){let{implicitKey:O,inFlow:H}=$,X=typeof _.value==="string"?_:Object.assign({},_,{value:String(_.value)}),{type:U}=_;if(U!==v.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(X.value))U=v.Scalar.QUOTE_DOUBLE}let J=(z)=>{switch(z){case v.Scalar.BLOCK_FOLDED:case v.Scalar.BLOCK_LITERAL:return O||H?F_(X.value,$):D$(X,$,q,T);case v.Scalar.QUOTE_DOUBLE:return h_(X.value,$);case v.Scalar.QUOTE_SINGLE:return w0(X.value,$);case v.Scalar.PLAIN:return G9(X,$,q,T);default:return null}},Z=J(U);if(Z===null){let{defaultKeyType:z,defaultStringType:G}=$.options,Q=O&&z||G;if(Z=J(Q),Z===null)throw Error(`Unsupported default string type ${Q}`)}return Z}W9.stringifyString=Q9});var m_=V((M9)=>{var Y9=V$(),$_=S(),L9=u_(),V9=v_();function B9(_,$){let q=Object.assign({blockQuote:!0,commentString:L9.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},_.schema.toStringOptions,$),T;switch(q.collectionStyle){case"block":T=!1;break;case"flow":T=!0;break;default:T=null}return{anchors:new Set,doc:_,flowCollectionPadding:q.flowCollectionPadding?" ":"",indent:"",indentStep:typeof q.indent==="number"?" ".repeat(q.indent):" ",inFlow:T,options:q}}function w9(_,$){if($.tag){let O=_.filter((H)=>H.tag===$.tag);if(O.length>0)return O.find((H)=>H.format===$.format)??O[0]}let q=void 0,T;if($_.isScalar($)){T=$.value;let O=_.filter((H)=>H.identify?.(T));if(O.length>1){let H=O.filter((X)=>X.test);if(H.length>0)O=H}q=O.find((H)=>H.format===$.format)??O.find((H)=>!H.format)}else T=$,q=_.find((O)=>O.nodeClass&&T instanceof O.nodeClass);if(!q){let O=T?.constructor?.name??(T===null?"null":typeof T);throw Error(`Tag not resolved for ${O} value`)}return q}function A9(_,$,{anchors:q,doc:T}){if(!T.directives)return"";let O=[],H=($_.isScalar(_)||$_.isCollection(_))&&_.anchor;if(H&&Y9.anchorIsValid(H))q.add(H),O.push(`&${H}`);let X=_.tag??($.default?null:$.tag);if(X)O.push(T.directives.tagString(X));return O.join(" ")}function D9(_,$,q,T){if($_.isPair(_))return _.toString($,q,T);if($_.isAlias(_)){if($.doc.directives)return _.toString($);if($.resolvedAliases?.has(_))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(_);else $.resolvedAliases=new Set([_]);_=_.resolve($.doc)}}let O=void 0,H=$_.isNode(_)?_:$.doc.createNode(_,{onTagObj:(J)=>O=J});O??(O=w9($.doc.schema.tags,H));let X=A9(H,O,$);if(X.length>0)$.indentAtStart=($.indentAtStart??0)+X.length+1;let U=typeof O.stringify==="function"?O.stringify(H,$,q,T):$_.isScalar(H)?V9.stringifyString(H,$,q,T):H.toString($,q,T);if(!X)return U;return $_.isScalar(H)||U[0]==="{"||U[0]==="["?`${X} ${U}`:`${X}
35
+ ${$.indent}${U}`}M9.createStringifyContext=B9;M9.stringify=D9});var AT=V((K9)=>{var a=S(),BT=f(),wT=m_(),l_=u_();function S9({key:_,value:$},q,T,O){let{allNullValues:H,doc:X,indent:U,indentStep:J,options:{commentString:Z,indentSeq:z,simpleKeys:G}}=q,Q=a.isNode(_)&&_.comment||null;if(G){if(Q)throw Error("With simple keys, key nodes cannot have comments");if(a.isCollection(_)||!a.isNode(_)&&typeof _==="object")throw Error("With simple keys, collection cannot be used as a key value")}let Y=!G&&(!_||Q&&$==null&&!q.inFlow||a.isCollection(_)||(a.isScalar(_)?_.type===BT.Scalar.BLOCK_FOLDED||_.type===BT.Scalar.BLOCK_LITERAL:typeof _==="object"));q=Object.assign({},q,{allNullValues:!1,implicitKey:!Y&&(G||!H),indent:U+J});let R=!1,W=!1,L=wT.stringify(_,q,()=>R=!0,()=>W=!0);if(!Y&&!q.inFlow&&L.length>1024){if(G)throw Error("With simple keys, single line scalar must not span more than 1024 characters");Y=!0}if(q.inFlow){if(H||$==null){if(R&&T)T();return L===""?"?":Y?`? ${L}`:L}}else if(H&&!G||$==null&&Y){if(L=`? ${L}`,Q&&!R)L+=l_.lineComment(L,q.indent,Z(Q));else if(W&&O)O();return L}if(R)Q=null;if(Y){if(Q)L+=l_.lineComment(L,q.indent,Z(Q));L=`? ${L}
36
+ ${U}:`}else if(L=`${L}:`,Q)L+=l_.lineComment(L,q.indent,Z(Q));let B,A,D;if(a.isNode($))B=!!$.spaceBefore,A=$.commentBefore,D=$.comment;else if(B=!1,A=null,D=null,$&&typeof $==="object")$=X.createNode($);if(q.implicitKey=!1,!Y&&!Q&&a.isScalar($))q.indentAtStart=L.length+1;if(W=!1,!z&&J.length>=2&&!q.inFlow&&!Y&&a.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)q.indent=q.indent.substring(2);let M=!1,I=wT.stringify($,q,()=>M=!0,()=>W=!0),F=" ";if(Q||B||A){if(F=B?`
37
+ `:"",A){let K=Z(A);F+=`
38
+ ${l_.indentComment(K,q.indent)}`}if(I===""&&!q.inFlow){if(F===`
39
+ `&&D)F=`
40
+
41
+ `}else F+=`
42
+ ${q.indent}`}else if(!Y&&a.isCollection($)){let K=I[0],w=I.indexOf(`
43
+ `),E=w!==-1,t=q.inFlow??$.flow??$.items.length===0;if(E||!t){let A_=!1;if(E&&(K==="&"||K==="!")){let j=I.indexOf(" ");if(K==="&"&&j!==-1&&j<w&&I[j+1]==="!")j=I.indexOf(" ",j+1);if(j===-1||w<j)A_=!0}if(!A_)F=`
44
+ ${q.indent}`}}else if(I===""||I[0]===`
45
+ `)F="";if(L+=F+I,q.inFlow){if(M&&T)T()}else if(D&&!M)L+=l_.lineComment(L,q.indent,Z(D));else if(W&&O)O();return L}K9.stringifyPair=S9});var D0=V((f9)=>{var DT=Q$("process");function C9(_,...$){if(_==="debug")console.log(...$)}function P9(_,$){if(_==="debug"||_==="warn")if(typeof DT.emitWarning==="function")DT.emitWarning($);else console.warn($)}f9.debug=C9;f9.warn=P9});var N$=V((g9)=>{var K$=S(),MT=f(),F$="<<",S$={identify:(_)=>_===F$||typeof _==="symbol"&&_.description===F$,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new MT.Scalar(Symbol(F$)),{addToJSMap:IT}),stringify:()=>F$},b9=(_,$)=>(S$.identify($)||K$.isScalar($)&&(!$.type||$.type===MT.Scalar.PLAIN)&&S$.identify($.value))&&_?.doc.schema.tags.some((q)=>q.tag===S$.tag&&q.default);function IT(_,$,q){let T=FT(_,q);if(K$.isSeq(T))for(let O of T.items)M0(_,$,O);else if(Array.isArray(T))for(let O of T)M0(_,$,O);else M0(_,$,T)}function M0(_,$,q){let T=FT(_,q);if(!K$.isMap(T))throw Error("Merge sources must be maps or map aliases");let O=T.toJSON(null,_,Map);for(let[H,X]of O)if($ instanceof Map){if(!$.has(H))$.set(H,X)}else if($ instanceof Set)$.add(H);else if(!Object.prototype.hasOwnProperty.call($,H))Object.defineProperty($,H,{value:X,writable:!0,enumerable:!0,configurable:!0});return $}function FT(_,$){return _&&K$.isAlias($)?$.resolve(_.doc,_):$}g9.addMergeToJSMap=IT;g9.isMergeKey=b9;g9.merge=S$});var F0=V((l9)=>{var u9=D0(),ST=N$(),h9=m_(),KT=S(),I0=e();function v9(_,$,{key:q,value:T}){if(KT.isNode(q)&&q.addToJSMap)q.addToJSMap(_,$,T);else if(ST.isMergeKey(_,q))ST.addMergeToJSMap(_,$,T);else{let O=I0.toJS(q,"",_);if($ instanceof Map)$.set(O,I0.toJS(T,O,_));else if($ instanceof Set)$.add(O);else{let H=m9(q,O,_),X=I0.toJS(T,H,_);if(H in $)Object.defineProperty($,H,{value:X,writable:!0,enumerable:!0,configurable:!0});else $[H]=X}}return $}function m9(_,$,q){if($===null)return"";if(typeof $!=="object")return String($);if(KT.isNode(_)&&q?.doc){let T=h9.createStringifyContext(q.doc,{});T.anchors=new Set;for(let H of q.anchors.keys())T.anchors.add(H.anchor);T.inFlow=!0,T.inStringifyKey=!0;let O=_.toString(T);if(!q.mapKeyWarned){let H=JSON.stringify(O);if(H.length>40)H=H.substring(0,36)+'..."';u9.warn(q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${H}. Set mapAsMap: true to use object keys.`),q.mapKeyWarned=!0}return O}return JSON.stringify($)}l9.addPairToJSMap=v9});var q_=V((i9)=>{var NT=k_(),d9=AT(),c9=F0(),C$=S();function s9(_,$,q){let T=NT.createNode(_,void 0,q),O=NT.createNode($,void 0,q);return new P$(T,O)}class P${constructor(_,$=null){Object.defineProperty(this,C$.NODE_TYPE,{value:C$.PAIR}),this.key=_,this.value=$}clone(_){let{key:$,value:q}=this;if(C$.isNode($))$=$.clone(_);if(C$.isNode(q))q=q.clone(_);return new P$($,q)}toJSON(_,$){let q=$?.mapAsMap?new Map:{};return c9.addPairToJSMap($,q,this)}toString(_,$,q){return _?.doc?d9.stringifyPair(this,_,$,q):JSON.stringify(this)}}i9.Pair=P$;i9.createPair=s9});var S0=V((e9)=>{var W_=S(),CT=m_(),f$=u_();function r9(_,$,q){return($.inFlow??_.flow?t9:o9)(_,$,q)}function o9({comment:_,items:$},q,{blockItemPrefix:T,flowChars:O,itemIndent:H,onChompKeep:X,onComment:U}){let{indent:J,options:{commentString:Z}}=q,z=Object.assign({},q,{indent:H,type:null}),G=!1,Q=[];for(let R=0;R<$.length;++R){let W=$[R],L=null;if(W_.isNode(W)){if(!G&&W.spaceBefore)Q.push("");if(E$(q,Q,W.commentBefore,G),W.comment)L=W.comment}else if(W_.isPair(W)){let A=W_.isNode(W.key)?W.key:null;if(A){if(!G&&A.spaceBefore)Q.push("");E$(q,Q,A.commentBefore,G)}}G=!1;let B=CT.stringify(W,z,()=>L=null,()=>G=!0);if(L)B+=f$.lineComment(B,H,Z(L));if(G&&L)G=!1;Q.push(T+B)}let Y;if(Q.length===0)Y=O.start+O.end;else{Y=Q[0];for(let R=1;R<Q.length;++R){let W=Q[R];Y+=W?`
46
+ ${J}${W}`:`
47
+ `}}if(_){if(Y+=`
48
+ `+f$.indentComment(Z(_),J),U)U()}else if(G&&X)X();return Y}function t9({items:_},$,{flowChars:q,itemIndent:T}){let{indent:O,indentStep:H,flowCollectionPadding:X,options:{commentString:U}}=$;T+=H;let J=Object.assign({},$,{indent:T,inFlow:!0,type:null}),Z=!1,z=0,G=[];for(let R=0;R<_.length;++R){let W=_[R],L=null;if(W_.isNode(W)){if(W.spaceBefore)G.push("");if(E$($,G,W.commentBefore,!1),W.comment)L=W.comment}else if(W_.isPair(W)){let A=W_.isNode(W.key)?W.key:null;if(A){if(A.spaceBefore)G.push("");if(E$($,G,A.commentBefore,!1),A.comment)Z=!0}let D=W_.isNode(W.value)?W.value:null;if(D){if(D.comment)L=D.comment;if(D.commentBefore)Z=!0}else if(W.value==null&&A?.comment)L=A.comment}if(L)Z=!0;let B=CT.stringify(W,J,()=>L=null);if(Z||(Z=G.length>z||B.includes(`
49
+ `)),R<_.length-1)B+=",";else if($.options.trailingComma){if($.options.lineWidth>0)Z||(Z=G.reduce((A,D)=>A+D.length+2,2)+(B.length+2)>$.options.lineWidth);if(Z)B+=","}if(L)B+=f$.lineComment(B,T,U(L));G.push(B),z=G.length}let{start:Q,end:Y}=q;if(G.length===0)return Q+Y;else{if(!Z){let R=G.reduce((W,L)=>W+L.length+2,2);Z=$.options.lineWidth>0&&R>$.options.lineWidth}if(Z){let R=Q;for(let W of G)R+=W?`
50
+ ${H}${O}${W}`:`
51
+ `;return`${R}
52
+ ${O}${Y}`}else return`${Q}${X}${G.join(" ")}${X}${Y}`}}function E$({indent:_,options:{commentString:$}},q,T,O){if(T&&O)T=T.replace(/^\n+/,"");if(T){let H=f$.indentComment($(T),_);q.push(H.trimStart())}}e9.stringifyCollection=r9});var O_=V((HX)=>{var $X=S0(),qX=F0(),TX=A$(),T_=S(),j$=q_(),OX=f();function p_(_,$){let q=T_.isScalar($)?$.value:$;for(let T of _)if(T_.isPair(T)){if(T.key===$||T.key===q)return T;if(T_.isScalar(T.key)&&T.key.value===q)return T}return}class PT extends TX.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(_){super(T_.MAP,_);this.items=[]}static from(_,$,q){let{keepUndefined:T,replacer:O}=q,H=new this(_),X=(U,J)=>{if(typeof O==="function")J=O.call($,U,J);else if(Array.isArray(O)&&!O.includes(U))return;if(J!==void 0||T)H.items.push(j$.createPair(U,J,q))};if($ instanceof Map)for(let[U,J]of $)X(U,J);else if($&&typeof $==="object")for(let U of Object.keys($))X(U,$[U]);if(typeof _.sortMapEntries==="function")H.items.sort(_.sortMapEntries);return H}add(_,$){let q;if(T_.isPair(_))q=_;else if(!_||typeof _!=="object"||!("key"in _))q=new j$.Pair(_,_?.value);else q=new j$.Pair(_.key,_.value);let T=p_(this.items,q.key),O=this.schema?.sortMapEntries;if(T){if(!$)throw Error(`Key ${q.key} already set`);if(T_.isScalar(T.value)&&OX.isScalarValue(q.value))T.value.value=q.value;else T.value=q.value}else if(O){let H=this.items.findIndex((X)=>O(q,X)<0);if(H===-1)this.items.push(q);else this.items.splice(H,0,q)}else this.items.push(q)}delete(_){let $=p_(this.items,_);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(_,$){let T=p_(this.items,_)?.value;return(!$&&T_.isScalar(T)?T.value:T)??void 0}has(_){return!!p_(this.items,_)}set(_,$){this.add(new j$.Pair(_,$),!0)}toJSON(_,$,q){let T=q?new q:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(T);for(let O of this.items)qX.addPairToJSMap($,T,O);return T}toString(_,$,q){if(!_)return JSON.stringify(this);for(let T of this.items)if(!T_.isPair(T))throw Error(`Map items must all be pairs; found ${JSON.stringify(T)} instead`);if(!_.allNullValues&&this.hasAllNullValues(!1))_=Object.assign({},_,{allNullValues:!0});return $X.stringifyCollection(this,_,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:_.indent||"",onChompKeep:q,onComment:$})}}HX.YAMLMap=PT;HX.findPair=p_});var S_=V((zX)=>{var JX=S(),fT=O_(),ZX={collection:"map",default:!0,nodeClass:fT.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(_,$){if(!JX.isMap(_))$("Expected a mapping for this tag");return _},createNode:(_,$,q)=>fT.YAMLMap.from(_,$,q)};zX.map=ZX});var H_=V((VX)=>{var QX=k_(),WX=S0(),RX=A$(),g$=S(),YX=f(),LX=e();class ET extends RX.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(_){super(g$.SEQ,_);this.items=[]}add(_){this.items.push(_)}delete(_){let $=b$(_);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(_,$){let q=b$(_);if(typeof q!=="number")return;let T=this.items[q];return!$&&g$.isScalar(T)?T.value:T}has(_){let $=b$(_);return typeof $==="number"&&$<this.items.length}set(_,$){let q=b$(_);if(typeof q!=="number")throw Error(`Expected a valid index, not ${_}.`);let T=this.items[q];if(g$.isScalar(T)&&YX.isScalarValue($))T.value=$;else this.items[q]=$}toJSON(_,$){let q=[];if($?.onCreate)$.onCreate(q);let T=0;for(let O of this.items)q.push(LX.toJS(O,String(T++),$));return q}toString(_,$,q){if(!_)return JSON.stringify(this);return WX.stringifyCollection(this,_,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(_.indent||"")+" ",onChompKeep:q,onComment:$})}static from(_,$,q){let{replacer:T}=q,O=new this(_);if($&&Symbol.iterator in Object($)){let H=0;for(let X of $){if(typeof T==="function"){let U=$ instanceof Set?X:String(H++);X=T.call($,U,X)}O.items.push(QX.createNode(X,void 0,q))}}return O}}function b$(_){let $=g$.isScalar(_)?_.value:_;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}VX.YAMLSeq=ET});var K_=V((DX)=>{var wX=S(),jT=H_(),AX={collection:"seq",default:!0,nodeClass:jT.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(_,$){if(!wX.isSeq(_))$("Expected a sequence for this tag");return _},createNode:(_,$,q)=>jT.YAMLSeq.from(_,$,q)};DX.seq=AX});var d_=V((SX)=>{var IX=v_(),FX={identify:(_)=>typeof _==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(_)=>_,stringify(_,$,q,T){return $=Object.assign({actualString:!0},$),IX.stringifyString(_,$,q,T)}};SX.string=FX});var y$=V((NX)=>{var bT=f(),gT={identify:(_)=>_==null,createNode:()=>new bT.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new bT.Scalar(null),stringify:({source:_},$)=>typeof _==="string"&&gT.test.test(_)?_:$.options.nullStr};NX.nullTag=gT});var K0=V((fX)=>{var PX=f(),yT={identify:(_)=>typeof _==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(_)=>new PX.Scalar(_[0]==="t"||_[0]==="T"),stringify({source:_,value:$},q){if(_&&yT.test.test(_)){let T=_[0]==="t"||_[0]==="T";if($===T)return _}return $?q.options.trueStr:q.options.falseStr}};fX.boolTag=yT});var N_=V((bX)=>{function jX({format:_,minFractionDigits:$,tag:q,value:T}){if(typeof T==="bigint")return String(T);let O=typeof T==="number"?T:Number(T);if(!isFinite(O))return isNaN(O)?".nan":O<0?"-.inf":".inf";let H=Object.is(T,-0)?"-0":JSON.stringify(T);if(!_&&$&&(!q||q==="tag:yaml.org,2002:float")&&/^-?\d/.test(H)&&!H.includes("e")){let X=H.indexOf(".");if(X<0)X=H.length,H+=".";let U=$-(H.length-X-1);while(U-- >0)H+="0"}return H}bX.stringifyNumber=jX});var C0=V((hX)=>{var yX=f(),N0=N_(),xX={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(_)=>_.slice(-3).toLowerCase()==="nan"?NaN:_[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:N0.stringifyNumber},kX={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(_)=>parseFloat(_),stringify(_){let $=Number(_.value);return isFinite($)?$.toExponential():N0.stringifyNumber(_)}},uX={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(_){let $=new yX.Scalar(parseFloat(_)),q=_.indexOf(".");if(q!==-1&&_[_.length-1]==="0")$.minFractionDigits=_.length-q-1;return $},stringify:N0.stringifyNumber};hX.float=uX;hX.floatExp=kX;hX.floatNaN=xX});var f0=V((sX)=>{var xT=N_(),x$=(_)=>typeof _==="bigint"||Number.isInteger(_),P0=(_,$,q,{intAsBigInt:T})=>T?BigInt(_):parseInt(_.substring($),q);function kT(_,$,q){let{value:T}=_;if(x$(T)&&T>=0)return q+T.toString($);return xT.stringifyNumber(_)}var pX={identify:(_)=>x$(_)&&_>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(_,$,q)=>P0(_,2,8,q),stringify:(_)=>kT(_,8,"0o")},dX={identify:x$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(_,$,q)=>P0(_,0,10,q),stringify:xT.stringifyNumber},cX={identify:(_)=>x$(_)&&_>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(_,$,q)=>P0(_,2,16,q),stringify:(_)=>kT(_,16,"0x")};sX.int=dX;sX.intHex=cX;sX.intOct=pX});var uT=V((q4)=>{var rX=S_(),oX=y$(),tX=K_(),eX=d_(),_4=K0(),E0=C0(),j0=f0(),$4=[rX.map,tX.seq,eX.string,oX.nullTag,_4.boolTag,j0.intOct,j0.int,j0.intHex,E0.floatNaN,E0.floatExp,E0.float];q4.schema=$4});var vT=V((z4)=>{var O4=f(),H4=S_(),X4=K_();function hT(_){return typeof _==="bigint"||Number.isInteger(_)}var k$=({value:_})=>JSON.stringify(_),U4=[{identify:(_)=>typeof _==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(_)=>_,stringify:k$},{identify:(_)=>_==null,createNode:()=>new O4.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:k$},{identify:(_)=>typeof _==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(_)=>_==="true",stringify:k$},{identify:hT,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(_,$,{intAsBigInt:q})=>q?BigInt(_):parseInt(_,10),stringify:({value:_})=>hT(_)?_.toString():JSON.stringify(_)},{identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(_)=>parseFloat(_),stringify:k$}],J4={default:!0,tag:"",test:/^/,resolve(_,$){return $(`Unresolved plain scalar ${JSON.stringify(_)}`),_}},Z4=[H4.map,X4.seq].concat(U4,J4);z4.schema=Z4});var g0=V((R4)=>{var c_=Q$("buffer"),b0=f(),Q4=v_(),W4={identify:(_)=>_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(_,$){if(typeof c_.Buffer==="function")return c_.Buffer.from(_,"base64");else if(typeof atob==="function"){let q=atob(_.replace(/[\n\r]/g,"")),T=new Uint8Array(q.length);for(let O=0;O<q.length;++O)T[O]=q.charCodeAt(O);return T}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),_},stringify({comment:_,type:$,value:q},T,O,H){if(!q)return"";let X=q,U;if(typeof c_.Buffer==="function")U=X instanceof c_.Buffer?X.toString("base64"):c_.Buffer.from(X.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Z=0;Z<X.length;++Z)J+=String.fromCharCode(X[Z]);U=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=b0.Scalar.BLOCK_LITERAL),$!==b0.Scalar.QUOTE_DOUBLE){let J=Math.max(T.options.lineWidth-T.indent.length,T.options.minContentWidth),Z=Math.ceil(U.length/J),z=Array(Z);for(let G=0,Q=0;G<Z;++G,Q+=J)z[G]=U.substr(Q,J);U=z.join($===b0.Scalar.BLOCK_LITERAL?`
53
+ `:" ")}return Q4.stringifyString({comment:_,type:$,value:U},T,O,H)}};R4.binary=W4});var h$=V((w4)=>{var u$=S(),y0=q_(),L4=f(),V4=H_();function mT(_,$){if(u$.isSeq(_))for(let q=0;q<_.items.length;++q){let T=_.items[q];if(u$.isPair(T))continue;else if(u$.isMap(T)){if(T.items.length>1)$("Each pair must have its own sequence indicator");let O=T.items[0]||new y0.Pair(new L4.Scalar(null));if(T.commentBefore)O.key.commentBefore=O.key.commentBefore?`${T.commentBefore}
54
+ ${O.key.commentBefore}`:T.commentBefore;if(T.comment){let H=O.value??O.key;H.comment=H.comment?`${T.comment}
55
+ ${H.comment}`:T.comment}T=O}_.items[q]=u$.isPair(T)?T:new y0.Pair(T)}else $("Expected a sequence for this tag");return _}function lT(_,$,q){let{replacer:T}=q,O=new V4.YAMLSeq(_);O.tag="tag:yaml.org,2002:pairs";let H=0;if($&&Symbol.iterator in Object($))for(let X of $){if(typeof T==="function")X=T.call($,String(H++),X);let U,J;if(Array.isArray(X))if(X.length===2)U=X[0],J=X[1];else throw TypeError(`Expected [key, value] tuple: ${X}`);else if(X&&X instanceof Object){let Z=Object.keys(X);if(Z.length===1)U=Z[0],J=X[U];else throw TypeError(`Expected tuple with one key, not ${Z.length} keys`)}else U=X;O.items.push(y0.createPair(U,J,q))}return O}var B4={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:mT,createNode:lT};w4.createPairs=lT;w4.pairs=B4;w4.resolvePairs=mT});var k0=V((S4)=>{var pT=S(),x0=e(),s_=O_(),I4=H_(),dT=h$();class R_ extends I4.YAMLSeq{constructor(){super();this.add=s_.YAMLMap.prototype.add.bind(this),this.delete=s_.YAMLMap.prototype.delete.bind(this),this.get=s_.YAMLMap.prototype.get.bind(this),this.has=s_.YAMLMap.prototype.has.bind(this),this.set=s_.YAMLMap.prototype.set.bind(this),this.tag=R_.tag}toJSON(_,$){if(!$)return super.toJSON(_);let q=new Map;if($?.onCreate)$.onCreate(q);for(let T of this.items){let O,H;if(pT.isPair(T))O=x0.toJS(T.key,"",$),H=x0.toJS(T.value,O,$);else O=x0.toJS(T,"",$);if(q.has(O))throw Error("Ordered maps must not include duplicate keys");q.set(O,H)}return q}static from(_,$,q){let T=dT.createPairs(_,$,q),O=new this;return O.items=T.items,O}}R_.tag="tag:yaml.org,2002:omap";var F4={collection:"seq",identify:(_)=>_ instanceof Map,nodeClass:R_,default:!1,tag:"tag:yaml.org,2002:omap",resolve(_,$){let q=dT.resolvePairs(_,$),T=[];for(let{key:O}of q.items)if(pT.isScalar(O))if(T.includes(O.value))$(`Ordered maps must not include duplicate keys: ${O.value}`);else T.push(O.value);return Object.assign(new R_,q)},createNode:(_,$,q)=>R_.from(_,$,q)};S4.YAMLOMap=R_;S4.omap=F4});var aT=V((C4)=>{var cT=f();function sT({value:_,source:$},q){if($&&(_?iT:nT).test.test($))return $;return _?q.options.trueStr:q.options.falseStr}var iT={identify:(_)=>_===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new cT.Scalar(!0),stringify:sT},nT={identify:(_)=>_===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new cT.Scalar(!1),stringify:sT};C4.falseTag=nT;C4.trueTag=iT});var rT=V((y4)=>{var E4=f(),u0=N_(),j4={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(_)=>_.slice(-3).toLowerCase()==="nan"?NaN:_[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:u0.stringifyNumber},b4={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(_)=>parseFloat(_.replace(/_/g,"")),stringify(_){let $=Number(_.value);return isFinite($)?$.toExponential():u0.stringifyNumber(_)}},g4={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(_){let $=new E4.Scalar(parseFloat(_.replace(/_/g,""))),q=_.indexOf(".");if(q!==-1){let T=_.substring(q+1).replace(/_/g,"");if(T[T.length-1]==="0")$.minFractionDigits=T.length}return $},stringify:u0.stringifyNumber};y4.float=g4;y4.floatExp=b4;y4.floatNaN=j4});var tT=V((p4)=>{var oT=N_(),i_=(_)=>typeof _==="bigint"||Number.isInteger(_);function v$(_,$,q,{intAsBigInt:T}){let O=_[0];if(O==="-"||O==="+")$+=1;if(_=_.substring($).replace(/_/g,""),T){switch(q){case 2:_=`0b${_}`;break;case 8:_=`0o${_}`;break;case 16:_=`0x${_}`;break}let X=BigInt(_);return O==="-"?BigInt(-1)*X:X}let H=parseInt(_,q);return O==="-"?-1*H:H}function h0(_,$,q){let{value:T}=_;if(i_(T)){let O=T.toString($);return T<0?"-"+q+O.substr(1):q+O}return oT.stringifyNumber(_)}var h4={identify:i_,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(_,$,q)=>v$(_,2,2,q),stringify:(_)=>h0(_,2,"0b")},v4={identify:i_,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(_,$,q)=>v$(_,1,8,q),stringify:(_)=>h0(_,8,"0")},m4={identify:i_,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(_,$,q)=>v$(_,0,10,q),stringify:oT.stringifyNumber},l4={identify:i_,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(_,$,q)=>v$(_,2,16,q),stringify:(_)=>h0(_,16,"0x")};p4.int=m4;p4.intBin=h4;p4.intHex=l4;p4.intOct=v4});var v0=V((a4)=>{var p$=S(),m$=q_(),l$=O_();class Y_ extends l$.YAMLMap{constructor(_){super(_);this.tag=Y_.tag}add(_){let $;if(p$.isPair(_))$=_;else if(_&&typeof _==="object"&&"key"in _&&"value"in _&&_.value===null)$=new m$.Pair(_.key,null);else $=new m$.Pair(_,null);if(!l$.findPair(this.items,$.key))this.items.push($)}get(_,$){let q=l$.findPair(this.items,_);return!$&&p$.isPair(q)?p$.isScalar(q.key)?q.key.value:q.key:q}set(_,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let q=l$.findPair(this.items,_);if(q&&!$)this.items.splice(this.items.indexOf(q),1);else if(!q&&$)this.items.push(new m$.Pair(_))}toJSON(_,$){return super.toJSON(_,$,Set)}toString(_,$,q){if(!_)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},_,{allNullValues:!0}),$,q);else throw Error("Set items must all have null values")}static from(_,$,q){let{replacer:T}=q,O=new this(_);if($&&Symbol.iterator in Object($))for(let H of $){if(typeof T==="function")H=T.call($,H,H);O.items.push(m$.createPair(H,null,q))}return O}}Y_.tag="tag:yaml.org,2002:set";var n4={collection:"map",identify:(_)=>_ instanceof Set,nodeClass:Y_,default:!1,tag:"tag:yaml.org,2002:set",createNode:(_,$,q)=>Y_.from(_,$,q),resolve(_,$){if(p$.isMap(_))if(_.hasAllNullValues(!0))return Object.assign(new Y_,_);else $("Set items must all have null values");else $("Expected a mapping for this tag");return _}};a4.YAMLSet=Y_;a4.set=n4});var l0=V(($8)=>{var t4=N_();function m0(_,$){let q=_[0],T=q==="-"||q==="+"?_.substring(1):_,O=(X)=>$?BigInt(X):Number(X),H=T.replace(/_/g,"").split(":").reduce((X,U)=>X*O(60)+O(U),O(0));return q==="-"?O(-1)*H:H}function eT(_){let{value:$}=_,q=(X)=>X;if(typeof $==="bigint")q=(X)=>BigInt(X);else if(isNaN($)||!isFinite($))return t4.stringifyNumber(_);let T="";if($<0)T="-",$*=q(-1);let O=q(60),H=[$%O];if($<60)H.unshift(0);else if($=($-H[0])/O,H.unshift($%O),$>=60)$=($-H[0])/O,H.unshift($);return T+H.map((X)=>String(X).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var e4={identify:(_)=>typeof _==="bigint"||Number.isInteger(_),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(_,$,{intAsBigInt:q})=>m0(_,q),stringify:eT},_8={identify:(_)=>typeof _==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(_)=>m0(_,!1),stringify:eT},_1={identify:(_)=>_ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(_){let $=_.match(_1.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,q,T,O,H,X,U]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Z=Date.UTC(q,T-1,O,H||0,X||0,U||0,J),z=$[8];if(z&&z!=="Z"){let G=m0(z,!1);if(Math.abs(G)<30)G*=60;Z-=60000*G}return new Date(Z)},stringify:({value:_})=>_?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$8.floatTime=_8;$8.intTime=e4;$8.timestamp=_1});var q1=V((Y8)=>{var H8=S_(),X8=y$(),U8=K_(),J8=d_(),Z8=g0(),$1=aT(),p0=rT(),d$=tT(),z8=N$(),G8=k0(),Q8=h$(),W8=v0(),d0=l0(),R8=[H8.map,U8.seq,J8.string,X8.nullTag,$1.trueTag,$1.falseTag,d$.intBin,d$.intOct,d$.int,d$.intHex,p0.floatNaN,p0.floatExp,p0.float,Z8.binary,z8.merge,G8.omap,Q8.pairs,W8.set,d0.intTime,d0.floatTime,d0.timestamp];Y8.schema=R8});var Q1=V((F8)=>{var X1=S_(),V8=y$(),U1=K_(),B8=d_(),w8=K0(),c0=C0(),s0=f0(),A8=uT(),D8=vT(),J1=g0(),n_=N$(),Z1=k0(),z1=h$(),T1=q1(),G1=v0(),c$=l0(),O1=new Map([["core",A8.schema],["failsafe",[X1.map,U1.seq,B8.string]],["json",D8.schema],["yaml11",T1.schema],["yaml-1.1",T1.schema]]),H1={binary:J1.binary,bool:w8.boolTag,float:c0.float,floatExp:c0.floatExp,floatNaN:c0.floatNaN,floatTime:c$.floatTime,int:s0.int,intHex:s0.intHex,intOct:s0.intOct,intTime:c$.intTime,map:X1.map,merge:n_.merge,null:V8.nullTag,omap:Z1.omap,pairs:z1.pairs,seq:U1.seq,set:G1.set,timestamp:c$.timestamp},M8={"tag:yaml.org,2002:binary":J1.binary,"tag:yaml.org,2002:merge":n_.merge,"tag:yaml.org,2002:omap":Z1.omap,"tag:yaml.org,2002:pairs":z1.pairs,"tag:yaml.org,2002:set":G1.set,"tag:yaml.org,2002:timestamp":c$.timestamp};function I8(_,$,q){let T=O1.get($);if(T&&!_)return q&&!T.includes(n_.merge)?T.concat(n_.merge):T.slice();let O=T;if(!O)if(Array.isArray(_))O=[];else{let H=Array.from(O1.keys()).filter((X)=>X!=="yaml11").map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${H} or define customTags array`)}if(Array.isArray(_))for(let H of _)O=O.concat(H);else if(typeof _==="function")O=_(O.slice());if(q)O=O.concat(n_.merge);return O.reduce((H,X)=>{let U=typeof X==="string"?H1[X]:X;if(!U){let J=JSON.stringify(X),Z=Object.keys(H1).map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Z}`)}if(!H.includes(U))H.push(U);return H},[])}F8.coreKnownTags=M8;F8.getTags=I8});var a0=V((E8)=>{var i0=S(),N8=S_(),C8=K_(),P8=d_(),s$=Q1(),f8=(_,$)=>_.key<$.key?-1:_.key>$.key?1:0;class n0{constructor({compat:_,customTags:$,merge:q,resolveKnownTags:T,schema:O,sortMapEntries:H,toStringDefaults:X}){this.compat=Array.isArray(_)?s$.getTags(_,"compat"):_?s$.getTags(null,_):null,this.name=typeof O==="string"&&O||"core",this.knownTags=T?s$.coreKnownTags:{},this.tags=s$.getTags($,this.name,q),this.toStringOptions=X??null,Object.defineProperty(this,i0.MAP,{value:N8.map}),Object.defineProperty(this,i0.SCALAR,{value:P8.string}),Object.defineProperty(this,i0.SEQ,{value:C8.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?f8:null}clone(){let _=Object.create(n0.prototype,Object.getOwnPropertyDescriptors(this));return _.tags=this.tags.slice(),_}}E8.Schema=n0});var W1=V((y8)=>{var b8=S(),r0=m_(),a_=u_();function g8(_,$){let q=[],T=$.directives===!0;if($.directives!==!1&&_.directives){let J=_.directives.toString(_);if(J)q.push(J),T=!0;else if(_.directives.docStart)T=!0}if(T)q.push("---");let O=r0.createStringifyContext(_,$),{commentString:H}=O.options;if(_.commentBefore){if(q.length!==1)q.unshift("");let J=H(_.commentBefore);q.unshift(a_.indentComment(J,""))}let X=!1,U=null;if(_.contents){if(b8.isNode(_.contents)){if(_.contents.spaceBefore&&T)q.push("");if(_.contents.commentBefore){let z=H(_.contents.commentBefore);q.push(a_.indentComment(z,""))}O.forceBlockIndent=!!_.comment,U=_.contents.comment}let J=U?void 0:()=>X=!0,Z=r0.stringify(_.contents,O,()=>U=null,J);if(U)Z+=a_.lineComment(Z,"",H(U));if((Z[0]==="|"||Z[0]===">")&&q[q.length-1]==="---")q[q.length-1]=`--- ${Z}`;else q.push(Z)}else q.push(r0.stringify(_.contents,O));if(_.directives?.docEnd)if(_.comment){let J=H(_.comment);if(J.includes(`
56
+ `))q.push("..."),q.push(a_.indentComment(J,""));else q.push(`... ${J}`)}else q.push("...");else{let J=_.comment;if(J&&X)J=J.replace(/^\n+/,"");if(J){if((!X||U)&&q[q.length-1]!=="")q.push("");q.push(a_.indentComment(H(J),""))}}return q.join(`
57
57
  `)+`
58
- `}TT.stringifyDocument=IT});var cu=D((FT)=>{var LT=Qu(),Gu=I_(),r=X(),OT=e(),UT=t(),HT=Cs(),DT=kw(),ls=g_(),PT=$s(),AT=Nu(),Ks=ss();class ys{constructor(u,_,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let $=null;if(typeof _==="function"||Array.isArray(_))$=_;else if(s===void 0&&_)s=_,_=void 0;let w=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=w;let{version:f}=w;if(s?._directives){if(this.directives=s._directives.atDocument(),this.directives.yaml.explicit)f=this.directives.yaml.version}else this.directives=new Ks.Directives({version:f});this.setSchema(f,s),this.contents=u===void 0?null:this.createNode(u,$,s)}clone(){let u=Object.create(ys.prototype,{[r.NODE_TYPE]:{value:r.DOC}});if(u.commentBefore=this.commentBefore,u.comment=this.comment,u.errors=this.errors.slice(),u.warnings=this.warnings.slice(),u.options=Object.assign({},this.options),this.directives)u.directives=this.directives.clone();if(u.schema=this.schema.clone(),u.contents=r.isNode(this.contents)?this.contents.clone(u.schema):this.contents,this.range)u.range=this.range.slice();return u}add(u){if(Wu(this.contents))this.contents.add(u)}addIn(u,_){if(Wu(this.contents))this.contents.addIn(u,_)}createAlias(u,_){if(!u.anchor){let s=ls.anchorNames(this);u.anchor=!_||s.has(_)?ls.findNewAnchor(_||"a",s):_}return new LT.Alias(u.anchor)}createNode(u,_,s){let $=void 0;if(typeof _==="function")u=_.call({"":u},"",u),$=_;else if(Array.isArray(_)){let q=(P)=>typeof P==="number"||P instanceof String||P instanceof Number,U=_.filter(q).map(String);if(U.length>0)_=_.concat(U);$=_}else if(s===void 0&&_)s=_,_=void 0;let{aliasDuplicateObjects:w,anchorPrefix:f,flow:i,keepUndefined:g,onTagObj:R,tag:S}=s??{},{onAnchor:L,setAnchors:I,sourceObjects:T}=ls.createNodeAnchors(this,f||"a"),O={aliasDuplicateObjects:w??!0,keepUndefined:g??!1,onAnchor:L,onTagObj:R,replacer:$,schema:this.schema,sourceObjects:T},H=AT.createNode(u,S,O);if(i&&r.isCollection(H))H.flow=!0;return I(),H}createPair(u,_,s={}){let $=this.createNode(u,null,s),w=this.createNode(_,null,s);return new OT.Pair($,w)}delete(u){return Wu(this.contents)?this.contents.delete(u):!1}deleteIn(u){if(Gu.isEmptyPath(u)){if(this.contents==null)return!1;return this.contents=null,!0}return Wu(this.contents)?this.contents.deleteIn(u):!1}get(u,_){return r.isCollection(this.contents)?this.contents.get(u,_):void 0}getIn(u,_){if(Gu.isEmptyPath(u))return!_&&r.isScalar(this.contents)?this.contents.value:this.contents;return r.isCollection(this.contents)?this.contents.getIn(u,_):void 0}has(u){return r.isCollection(this.contents)?this.contents.has(u):!1}hasIn(u){if(Gu.isEmptyPath(u))return this.contents!==void 0;return r.isCollection(this.contents)?this.contents.hasIn(u):!1}set(u,_){if(this.contents==null)this.contents=Gu.collectionFromPath(this.schema,[u],_);else if(Wu(this.contents))this.contents.set(u,_)}setIn(u,_){if(Gu.isEmptyPath(u))this.contents=_;else if(this.contents==null)this.contents=Gu.collectionFromPath(this.schema,Array.from(u),_);else if(Wu(this.contents))this.contents.setIn(u,_)}setSchema(u,_={}){if(typeof u==="number")u=String(u);let s;switch(u){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Ks.Directives({version:"1.1"});s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=u;else this.directives=new Ks.Directives({version:u});s={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;s=null;break;default:{let $=JSON.stringify(u);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${$}`)}}if(_.schema instanceof Object)this.schema=_.schema;else if(s)this.schema=new HT.Schema(Object.assign(s,_));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:u,jsonArg:_,mapAsMap:s,maxAliasCount:$,onAnchor:w,reviver:f}={}){let i={anchors:new Map,doc:this,keep:!u,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof $==="number"?$:100},g=UT.toJS(this.contents,_??"",i);if(typeof w==="function")for(let{count:R,res:S}of i.anchors.values())w(S,R);return typeof f==="function"?PT.applyReviver(f,{"":g},"",g):g}toJSON(u,_){return this.toJS({json:!0,jsonArg:u,mapAsMap:!1,onAnchor:_})}toString(u={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in u&&(!Number.isInteger(u.indent)||Number(u.indent)<=0)){let _=JSON.stringify(u.indent);throw Error(`"indent" option must be a positive integer, not ${_}`)}return DT.stringifyDocument(this,u)}}function Wu(u){if(r.isCollection(u))return!0;throw Error("Expected a YAML collection as document contents")}FT.Document=ys});var xu=D((GT)=>{class r_ extends Error{constructor(u,_,s,$){super();this.name=u,this.code=s,this.message=$,this.pos=_}}class pw extends r_{constructor(u,_,s){super("YAMLParseError",u,_,s)}}class aw extends r_{constructor(u,_,s){super("YAMLWarning",u,_,s)}}var YT=(u,_)=>(s)=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map((g)=>_.linePos(g));let{line:$,col:w}=s.linePos[0];s.message+=` at line ${$}, column ${w}`;let f=w-1,i=u.substring(_.lineStarts[$-1],_.lineStarts[$]).replace(/[\n\r]+$/,"");if(f>=60&&i.length>80){let g=Math.min(f-39,i.length-79);i="…"+i.substring(g),f-=g-1}if(i.length>80)i=i.substring(0,79)+"…";if($>1&&/^ *$/.test(i.substring(0,f))){let g=u.substring(_.lineStarts[$-2],_.lineStarts[$-1]);if(g.length>80)g=g.substring(0,79)+`…
59
- `;i=g+i}if(/[^ ]/.test(i)){let g=1,R=s.linePos[1];if(R?.line===$&&R.col>w)g=Math.max(1,Math.min(R.col-w,80-f));let S=" ".repeat(f)+"^".repeat(g);s.message+=`:
60
-
61
- ${i}
62
- ${S}
63
- `}};GT.YAMLError=r_;GT.YAMLParseError=pw;GT.YAMLWarning=aw;GT.prettifyError=YT});var ku=D((MT)=>{function ZT(u,{flow:_,indicator:s,next:$,offset:w,onError:f,parentIndent:i,startOnNewline:g}){let R=!1,S=g,L=g,I="",T="",O=!1,H=!1,q=null,U=null,P=null,F=null,z=null,Y=null,G=null;for(let A of u){if(H){if(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma")f(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");H=!1}if(q){if(S&&A.type!=="comment"&&A.type!=="newline")f(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");q=null}switch(A.type){case"space":if(!_&&(s!=="doc-start"||$?.type!=="flow-collection")&&A.source.includes("\t"))q=A;L=!0;break;case"comment":{if(!L)f(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Z=A.source.substring(1)||" ";if(!I)I=Z;else I+=T+Z;T="",S=!1;break}case"newline":if(S){if(I)I+=A.source;else if(!Y||s!=="seq-item-ind")R=!0}else T+=A.source;if(S=!0,O=!0,U||P)F=A;L=!0;break;case"anchor":if(U)f(A,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(A.source.endsWith(":"))f(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);U=A,G??(G=A.offset),S=!1,L=!1,H=!0;break;case"tag":{if(P)f(A,"MULTIPLE_TAGS","A node can have at most one tag");P=A,G??(G=A.offset),S=!1,L=!1,H=!0;break}case s:if(U||P)f(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(Y)f(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${_??"collection"}`);Y=A,S=s==="seq-item-ind"||s==="explicit-key-ind",L=!1;break;case"comma":if(_){if(z)f(A,"UNEXPECTED_TOKEN",`Unexpected , in ${_}`);z=A,S=!1,L=!1;break}default:f(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),S=!1,L=!1}}let W=u[u.length-1],J=W?W.offset+W.source.length:w;if(H&&$&&$.type!=="space"&&$.type!=="newline"&&$.type!=="comma"&&($.type!=="scalar"||$.source!==""))f($.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(q&&(S&&q.indent<=i||$?.type==="block-map"||$?.type==="block-seq"))f(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:z,found:Y,spaceBefore:R,comment:I,hasNewline:O,anchor:U,tag:P,newlineAfterProp:F,end:J,start:G??J}}MT.resolveProps=ZT});var l_=D((QT)=>{function ds(u){if(!u)return null;switch(u.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(u.source.includes(`
64
- `))return!0;if(u.end){for(let _ of u.end)if(_.type==="newline")return!0}return!1;case"flow-collection":for(let _ of u.items){for(let s of _.start)if(s.type==="newline")return!0;if(_.sep){for(let s of _.sep)if(s.type==="newline")return!0}if(ds(_.key)||ds(_.value))return!0}return!1;default:return!0}}QT.containsNewline=ds});var ns=D((ET)=>{var VT=l_();function bT(u,_,s){if(_?.type==="flow-collection"){let $=_.end[0];if($.indent===u&&($.source==="]"||$.source==="}")&&VT.containsNewline(_))s($,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ET.flowIndentCheck=bT});var hs=D((lT)=>{var tw=X();function rT(u,_,s){let{uniqueKeys:$}=u.options;if($===!1)return!1;let w=typeof $==="function"?$:(f,i)=>f===i||tw.isScalar(f)&&tw.isScalar(i)&&f.value===i.value;return _.some((f)=>w(f.key,s))}lT.mapIncludes=rT});var _f=D((mT)=>{var vw=e(),yT=_u(),ow=ku(),dT=l_(),ew=ns(),nT=hs(),uf="All mapping items must start at the same column";function hT({composeNode:u,composeEmptyNode:_},s,$,w,f){let g=new(f?.nodeClass??yT.YAMLMap)(s.schema);if(s.atRoot)s.atRoot=!1;let R=$.offset,S=null;for(let L of $.items){let{start:I,key:T,sep:O,value:H}=L,q=ow.resolveProps(I,{indicator:"explicit-key-ind",next:T??O?.[0],offset:R,onError:w,parentIndent:$.indent,startOnNewline:!0}),U=!q.found;if(U){if(T){if(T.type==="block-seq")w(R,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in T&&T.indent!==$.indent)w(R,"BAD_INDENT",uf)}if(!q.anchor&&!q.tag&&!O){if(S=q.end,q.comment)if(g.comment)g.comment+=`
65
- `+q.comment;else g.comment=q.comment;continue}if(q.newlineAfterProp||dT.containsNewline(T))w(T??I[I.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==$.indent)w(R,"BAD_INDENT",uf);s.atKey=!0;let P=q.end,F=T?u(s,T,q,w):_(s,P,I,null,q,w);if(s.schema.compat)ew.flowIndentCheck($.indent,T,w);if(s.atKey=!1,nT.mapIncludes(s,g.items,F))w(P,"DUPLICATE_KEY","Map keys must be unique");let z=ow.resolveProps(O??[],{indicator:"map-value-ind",next:H,offset:F.range[2],onError:w,parentIndent:$.indent,startOnNewline:!T||T.type==="block-scalar"});if(R=z.end,z.found){if(U){if(H?.type==="block-map"&&!z.hasNewline)w(R,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(s.options.strict&&q.start<z.found.offset-1024)w(F.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let Y=H?u(s,H,z,w):_(s,R,O,null,z,w);if(s.schema.compat)ew.flowIndentCheck($.indent,H,w);R=Y.range[2];let G=new vw.Pair(F,Y);if(s.options.keepSourceTokens)G.srcToken=L;g.items.push(G)}else{if(U)w(F.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(z.comment)if(F.comment)F.comment+=`
66
- `+z.comment;else F.comment=z.comment;let Y=new vw.Pair(F);if(s.options.keepSourceTokens)Y.srcToken=L;g.items.push(Y)}}if(S&&S<R)w(S,"IMPOSSIBLE","Map comment with trailing content");return g.range=[$.offset,R,S??R],g}mT.resolveBlockMap=hT});var sf=D((tT)=>{var xT=su(),kT=ku(),pT=ns();function aT({composeNode:u,composeEmptyNode:_},s,$,w,f){let g=new(f?.nodeClass??xT.YAMLSeq)(s.schema);if(s.atRoot)s.atRoot=!1;if(s.atKey)s.atKey=!1;let R=$.offset,S=null;for(let{start:L,value:I}of $.items){let T=kT.resolveProps(L,{indicator:"seq-item-ind",next:I,offset:R,onError:w,parentIndent:$.indent,startOnNewline:!0});if(!T.found)if(T.anchor||T.tag||I)if(I?.type==="block-seq")w(T.end,"BAD_INDENT","All sequence items must start at the same column");else w(R,"MISSING_CHAR","Sequence item without - indicator");else{if(S=T.end,T.comment)g.comment=T.comment;continue}let O=I?u(s,I,T,w):_(s,T.end,L,null,T,w);if(s.schema.compat)pT.flowIndentCheck($.indent,I,w);R=O.range[2],g.items.push(O)}return g.range=[$.offset,R,S??R],g}tT.resolveBlockSeq=aT});var Xu=D((eT)=>{function oT(u,_,s,$){let w="";if(u){let f=!1,i="";for(let g of u){let{source:R,type:S}=g;switch(S){case"space":f=!0;break;case"comment":{if(s&&!f)$(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=R.substring(1)||" ";if(!w)w=L;else w+=i+L;i="";break}case"newline":if(w)i+=R;f=!0;break;default:$(g,"UNEXPECTED_TOKEN",`Unexpected ${S} at node end`)}_+=R.length}}return{comment:w,offset:_}}eT.resolveEnd=oT});var ff=D((Rq)=>{var _q=X(),sq=e(),$f=_u(),$q=su(),wq=Xu(),wf=ku(),fq=l_(),iq=hs(),ms="Block collections are not allowed within flow collections",cs=(u)=>u&&(u.type==="block-map"||u.type==="block-seq");function gq({composeNode:u,composeEmptyNode:_},s,$,w,f){let i=$.start.source==="{",g=i?"flow map":"flow sequence",S=new(f?.nodeClass??(i?$f.YAMLMap:$q.YAMLSeq))(s.schema);S.flow=!0;let L=s.atRoot;if(L)s.atRoot=!1;if(s.atKey)s.atKey=!1;let I=$.offset+$.start.source.length;for(let U=0;U<$.items.length;++U){let P=$.items[U],{start:F,key:z,sep:Y,value:G}=P,W=wf.resolveProps(F,{flow:g,indicator:"explicit-key-ind",next:z??Y?.[0],offset:I,onError:w,parentIndent:$.indent,startOnNewline:!1});if(!W.found){if(!W.anchor&&!W.tag&&!Y&&!G){if(U===0&&W.comma)w(W.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${g}`);else if(U<$.items.length-1)w(W.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${g}`);if(W.comment)if(S.comment)S.comment+=`
67
- `+W.comment;else S.comment=W.comment;I=W.end;continue}if(!i&&s.options.strict&&fq.containsNewline(z))w(z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(U===0){if(W.comma)w(W.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${g}`)}else{if(!W.comma)w(W.start,"MISSING_CHAR",`Missing , between ${g} items`);if(W.comment){let J="";u:for(let A of F)switch(A.type){case"comma":case"space":break;case"comment":J=A.source.substring(1);break u;default:break u}if(J){let A=S.items[S.items.length-1];if(_q.isPair(A))A=A.value??A.key;if(A.comment)A.comment+=`
68
- `+J;else A.comment=J;W.comment=W.comment.substring(J.length+1)}}}if(!i&&!Y&&!W.found){let J=G?u(s,G,W,w):_(s,W.end,Y,null,W,w);if(S.items.push(J),I=J.range[2],cs(G))w(J.range,"BLOCK_IN_FLOW",ms)}else{s.atKey=!0;let J=W.end,A=z?u(s,z,W,w):_(s,J,F,null,W,w);if(cs(z))w(A.range,"BLOCK_IN_FLOW",ms);s.atKey=!1;let Z=wf.resolveProps(Y??[],{flow:g,indicator:"map-value-ind",next:G,offset:A.range[2],onError:w,parentIndent:$.indent,startOnNewline:!1});if(Z.found){if(!i&&!W.found&&s.options.strict){if(Y)for(let M of Y){if(M===Z.found)break;if(M.type==="newline"){w(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(W.start<Z.found.offset-1024)w(Z.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(G)if("source"in G&&G.source?.[0]===":")w(G,"MISSING_CHAR",`Missing space after : in ${g}`);else w(Z.start,"MISSING_CHAR",`Missing , or : between ${g} items`);let a=G?u(s,G,Z,w):Z.found?_(s,Z.end,Y,null,Z,w):null;if(a){if(cs(G))w(a.range,"BLOCK_IN_FLOW",ms)}else if(Z.comment)if(A.comment)A.comment+=`
69
- `+Z.comment;else A.comment=Z.comment;let Uu=new sq.Pair(A,a);if(s.options.keepSourceTokens)Uu.srcToken=P;if(i){let M=S;if(iq.mapIncludes(s,M.items,A))w(J,"DUPLICATE_KEY","Map keys must be unique");M.items.push(Uu)}else{let M=new $f.YAMLMap(s.schema);M.flow=!0,M.items.push(Uu);let j$=(a??A).range;M.range=[A.range[0],j$[1],j$[2]],S.items.push(M)}I=a?a.range[2]:Z.end}}let T=i?"}":"]",[O,...H]=$.end,q=I;if(O?.source===T)q=O.offset+O.source.length;else{let U=g[0].toUpperCase()+g.substring(1),P=L?`${U} must end with a ${T}`:`${U} in block collection must be sufficiently indented and end with a ${T}`;if(w(I,L?"MISSING_CHAR":"BAD_INDENT",P),O&&O.source.length!==1)H.unshift(O)}if(H.length>0){let U=wq.resolveEnd(H,q,s.options.strict,w);if(U.comment)if(S.comment)S.comment+=`
70
- `+U.comment;else S.comment=U.comment;S.range=[$.offset,q,U.offset]}else S.range=[$.offset,q,q];return S}Rq.resolveFlowCollection=gq});var gf=D((Pq)=>{var Iq=X(),Tq=B(),qq=_u(),Lq=su(),Oq=_f(),Uq=sf(),Hq=ff();function xs(u,_,s,$,w,f){let i=s.type==="block-map"?Oq.resolveBlockMap(u,_,s,$,f):s.type==="block-seq"?Uq.resolveBlockSeq(u,_,s,$,f):Hq.resolveFlowCollection(u,_,s,$,f),g=i.constructor;if(w==="!"||w===g.tagName)return i.tag=g.tagName,i;if(w)i.tag=w;return i}function Dq(u,_,s,$,w){let f=$.tag,i=!f?null:_.directives.tagName(f.source,(T)=>w(f,"TAG_RESOLVE_FAILED",T));if(s.type==="block-seq"){let{anchor:T,newlineAfterProp:O}=$,H=T&&f?T.offset>f.offset?T:f:T??f;if(H&&(!O||O.offset<H.offset))w(H,"MISSING_CHAR","Missing newline after block sequence props")}let g=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!f||!i||i==="!"||i===qq.YAMLMap.tagName&&g==="map"||i===Lq.YAMLSeq.tagName&&g==="seq")return xs(u,_,s,w,i);let R=_.schema.tags.find((T)=>T.tag===i&&T.collection===g);if(!R){let T=_.schema.knownTags[i];if(T?.collection===g)_.schema.tags.push(Object.assign({},T,{default:!1})),R=T;else{if(T)w(f,"BAD_COLLECTION_TYPE",`${T.tag} used for ${g} collection, but expects ${T.collection??"scalar"}`,!0);else w(f,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,!0);return xs(u,_,s,w,i)}}let S=xs(u,_,s,w,i,R),L=R.resolve?.(S,(T)=>w(f,"TAG_RESOLVE_FAILED",T),_.options)??S,I=Iq.isNode(L)?L:new Tq.Scalar(L);if(I.range=S.range,I.tag=i,R?.format)I.format=R.format;return I}Pq.composeCollection=Dq});var ps=D((Gq)=>{var ks=B();function Fq(u,_,s){let $=_.offset,w=zq(_,u.options.strict,s);if(!w)return{value:"",type:null,comment:"",range:[$,$,$]};let f=w.mode===">"?ks.Scalar.BLOCK_FOLDED:ks.Scalar.BLOCK_LITERAL,i=_.source?Yq(_.source):[],g=i.length;for(let q=i.length-1;q>=0;--q){let U=i[q][1];if(U===""||U==="\r")g=q;else break}if(g===0){let q=w.chomp==="+"&&i.length>0?`
71
- `.repeat(Math.max(1,i.length-1)):"",U=$+w.length;if(_.source)U+=_.source.length;return{value:q,type:f,comment:w.comment,range:[$,U,U]}}let R=_.indent+w.indent,S=_.offset+w.length,L=0;for(let q=0;q<g;++q){let[U,P]=i[q];if(P===""||P==="\r"){if(w.indent===0&&U.length>R)R=U.length}else{if(U.length<R)s(S+U.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(w.indent===0)R=U.length;if(L=q,R===0&&!u.atRoot)s(S,"BAD_INDENT","Block scalar values in collections must be indented");break}S+=U.length+P.length+1}for(let q=i.length-1;q>=g;--q)if(i[q][0].length>R)g=q+1;let I="",T="",O=!1;for(let q=0;q<L;++q)I+=i[q][0].slice(R)+`
72
- `;for(let q=L;q<g;++q){let[U,P]=i[q];S+=U.length+P.length+1;let F=P[P.length-1]==="\r";if(F)P=P.slice(0,-1);if(P&&U.length<R){let Y=`Block scalar lines must not be less indented than their ${w.indent?"explicit indentation indicator":"first line"}`;s(S-P.length-(F?2:1),"BAD_INDENT",Y),U=""}if(f===ks.Scalar.BLOCK_LITERAL)I+=T+U.slice(R)+P,T=`
73
- `;else if(U.length>R||P[0]==="\t"){if(T===" ")T=`
74
- `;else if(!O&&T===`
75
- `)T=`
76
-
77
- `;I+=T+U.slice(R)+P,T=`
78
- `,O=!0}else if(P==="")if(T===`
79
- `)I+=`
80
- `;else T=`
81
- `;else I+=T+P,T=" ",O=!1}switch(w.chomp){case"-":break;case"+":for(let q=g;q<i.length;++q)I+=`
82
- `+i[q][0].slice(R);if(I[I.length-1]!==`
83
- `)I+=`
84
- `;break;default:I+=`
85
- `}let H=$+w.length+_.source.length;return{value:I,type:f,comment:w.comment,range:[$,H,H]}}function zq({offset:u,props:_},s,$){if(_[0].type!=="block-scalar-header")return $(_[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:w}=_[0],f=w[0],i=0,g="",R=-1;for(let T=1;T<w.length;++T){let O=w[T];if(!g&&(O==="-"||O==="+"))g=O;else{let H=Number(O);if(!i&&H)i=H;else if(R===-1)R=u+T}}if(R!==-1)$(R,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${w}`);let S=!1,L="",I=w.length;for(let T=1;T<_.length;++T){let O=_[T];switch(O.type){case"space":S=!0;case"newline":I+=O.source.length;break;case"comment":if(s&&!S)$(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");I+=O.source.length,L=O.source.substring(1);break;case"error":$(O,"UNEXPECTED_TOKEN",O.message),I+=O.source.length;break;default:{let H=`Unexpected token in block scalar header: ${O.type}`;$(O,"UNEXPECTED_TOKEN",H);let q=O.source;if(q&&typeof q==="string")I+=q.length}}}return{mode:f,indent:i,chomp:g,comment:L,length:I}}function Yq(u){let _=u.split(/\n( *)/),s=_[0],$=s.match(/^( *)/),f=[$?.[1]?[$[1],s.slice($[1].length)]:["",s]];for(let i=1;i<_.length;i+=2)f.push([_[i],_[i+1]]);return f}Gq.resolveBlockScalar=Fq});var ts=D((Vq)=>{var as=B(),Xq=Xu();function Jq(u,_,s){let{offset:$,type:w,source:f,end:i}=u,g,R,S=(T,O,H)=>s($+T,O,H);switch(w){case"scalar":g=as.Scalar.PLAIN,R=Bq(f,S);break;case"single-quoted-scalar":g=as.Scalar.QUOTE_SINGLE,R=Zq(f,S);break;case"double-quoted-scalar":g=as.Scalar.QUOTE_DOUBLE,R=Mq(f,S);break;default:return s(u,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${w}`),{value:"",type:null,comment:"",range:[$,$+f.length,$+f.length]}}let L=$+f.length,I=Xq.resolveEnd(i,L,_,s);return{value:R,type:g,comment:I.comment,range:[$,L,I.offset]}}function Bq(u,_){let s="";switch(u[0]){case"\t":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${u[0]}`;break}case"@":case"`":{s=`reserved character ${u[0]}`;break}}if(s)_(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`);return Rf(u)}function Zq(u,_){if(u[u.length-1]!=="'"||u.length===1)_(u.length,"MISSING_CHAR","Missing closing 'quote");return Rf(u.slice(1,-1)).replace(/''/g,"'")}function Rf(u){let _,s;try{_=new RegExp(`(.*?)(?<![ ])[ ]*\r?
86
- `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
87
- `,"sy")}catch{_=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let $=_.exec(u);if(!$)return u;let w=$[1],f=" ",i=_.lastIndex;s.lastIndex=i;while($=s.exec(u)){if($[1]==="")if(f===`
88
- `)w+=f;else f=`
89
- `;else w+=f+$[1],f=" ";i=s.lastIndex}let g=/[ \t]*(.*)/sy;return g.lastIndex=i,$=g.exec(u),w+f+($?.[1]??"")}function Mq(u,_){let s="";for(let $=1;$<u.length-1;++$){let w=u[$];if(w==="\r"&&u[$+1]===`
90
- `)continue;if(w===`
91
- `){let{fold:f,offset:i}=jq(u,$);s+=f,$=i}else if(w==="\\"){let f=u[++$],i=Qq[f];if(i)s+=i;else if(f===`
92
- `){f=u[$+1];while(f===" "||f==="\t")f=u[++$+1]}else if(f==="\r"&&u[$+1]===`
93
- `){f=u[++$+1];while(f===" "||f==="\t")f=u[++$+1]}else if(f==="x"||f==="u"||f==="U"){let g=f==="x"?2:f==="u"?4:8;s+=Nq(u,$+1,g,_),$+=g}else{let g=u.substr($-1,2);_($-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${g}`),s+=g}}else if(w===" "||w==="\t"){let f=$,i=u[$+1];while(i===" "||i==="\t")i=u[++$+1];if(i!==`
94
- `&&!(i==="\r"&&u[$+2]===`
95
- `))s+=$>f?u.slice(f,$+1):w}else s+=w}if(u[u.length-1]!=='"'||u.length===1)_(u.length,"MISSING_CHAR",'Missing closing "quote');return s}function jq(u,_){let s="",$=u[_+1];while($===" "||$==="\t"||$===`
96
- `||$==="\r"){if($==="\r"&&u[_+2]!==`
97
- `)break;if($===`
98
- `)s+=`
99
- `;_+=1,$=u[_+1]}if(!s)s=" ";return{fold:s,offset:_}}var Qq={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
100
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Nq(u,_,s,$){let w=u.substr(_,s),i=w.length===s&&/^[0-9a-fA-F]+$/.test(w)?parseInt(w,16):NaN;try{return String.fromCodePoint(i)}catch{let g=u.substr(_-2,s+2);return $(_-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${g}`),g}}Vq.resolveFlowScalar=Jq});var If=D((yq)=>{var qu=X(),Sf=B(),Eq=ps(),Cq=ts();function rq(u,_,s,$){let{value:w,type:f,comment:i,range:g}=_.type==="block-scalar"?Eq.resolveBlockScalar(u,_,$):Cq.resolveFlowScalar(_,u.options.strict,$),R=s?u.directives.tagName(s.source,(I)=>$(s,"TAG_RESOLVE_FAILED",I)):null,S;if(u.options.stringKeys&&u.atKey)S=u.schema[qu.SCALAR];else if(R)S=lq(u.schema,w,R,s,$);else if(_.type==="scalar")S=Kq(u,w,_,$);else S=u.schema[qu.SCALAR];let L;try{let I=S.resolve(w,(T)=>$(s??_,"TAG_RESOLVE_FAILED",T),u.options);L=qu.isScalar(I)?I:new Sf.Scalar(I)}catch(I){let T=I instanceof Error?I.message:String(I);$(s??_,"TAG_RESOLVE_FAILED",T),L=new Sf.Scalar(w)}if(L.range=g,L.source=w,f)L.type=f;if(R)L.tag=R;if(S.format)L.format=S.format;if(i)L.comment=i;return L}function lq(u,_,s,$,w){if(s==="!")return u[qu.SCALAR];let f=[];for(let g of u.tags)if(!g.collection&&g.tag===s)if(g.default&&g.test)f.push(g);else return g;for(let g of f)if(g.test?.test(_))return g;let i=u.knownTags[s];if(i&&!i.collection)return u.tags.push(Object.assign({},i,{default:!1,test:void 0})),i;return w($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),u[qu.SCALAR]}function Kq({atKey:u,directives:_,schema:s},$,w,f){let i=s.tags.find((g)=>(g.default===!0||u&&g.default==="key")&&g.test?.test($))||s[qu.SCALAR];if(s.compat){let g=s.compat.find((R)=>R.default&&R.test?.test($))??s[qu.SCALAR];if(i.tag!==g.tag){let R=_.tagString(i.tag),S=_.tagString(g.tag),L=`Value may be parsed as either ${R} or ${S}`;f(w,"TAG_RESOLVE_FAILED",L,!0)}}return i}yq.composeScalar=rq});var Tf=D((hq)=>{function nq(u,_,s){if(_){s??(s=_.length);for(let $=s-1;$>=0;--$){let w=_[$];switch(w.type){case"space":case"comment":case"newline":u-=w.source.length;continue}w=_[++$];while(w?.type==="space")u+=w.source.length,w=_[++$];break}}return u}hq.emptyScalarPosition=nq});var Of=D((oq)=>{var cq=Qu(),xq=X(),kq=gf(),qf=If(),pq=Xu(),aq=Tf(),tq={composeNode:Lf,composeEmptyNode:vs};function Lf(u,_,s,$){let w=u.atKey,{spaceBefore:f,comment:i,anchor:g,tag:R}=s,S,L=!0;switch(_.type){case"alias":if(S=vq(u,_,$),g||R)$(_,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(S=qf.composeScalar(u,_,R,$),g)S.anchor=g.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(S=kq.composeCollection(tq,u,_,s,$),g)S.anchor=g.source.substring(1)}catch(I){let T=I instanceof Error?I.message:String(I);$(_,"RESOURCE_EXHAUSTION",T)}break;default:{let I=_.type==="error"?_.message:`Unsupported token (type: ${_.type})`;$(_,"UNEXPECTED_TOKEN",I),L=!1}}if(S??(S=vs(u,_.offset,void 0,null,s,$)),g&&S.anchor==="")$(g,"BAD_ALIAS","Anchor cannot be an empty string");if(w&&u.options.stringKeys&&(!xq.isScalar(S)||typeof S.value!=="string"||S.tag&&S.tag!=="tag:yaml.org,2002:str"))$(R??_,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(f)S.spaceBefore=!0;if(i)if(_.type==="scalar"&&_.source==="")S.comment=i;else S.commentBefore=i;if(u.options.keepSourceTokens&&L)S.srcToken=_;return S}function vs(u,_,s,$,{spaceBefore:w,comment:f,anchor:i,tag:g,end:R},S){let L={type:"scalar",offset:aq.emptyScalarPosition(_,s,$),indent:-1,source:""},I=qf.composeScalar(u,L,g,S);if(i){if(I.anchor=i.source.substring(1),I.anchor==="")S(i,"BAD_ALIAS","Anchor cannot be an empty string")}if(w)I.spaceBefore=!0;if(f)I.comment=f,I.range[2]=R;return I}function vq({options:u},{offset:_,source:s,end:$},w){let f=new cq.Alias(s.substring(1));if(f.source==="")w(_,"BAD_ALIAS","Alias cannot be an empty string");if(f.source.endsWith(":"))w(_+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let i=_+s.length,g=pq.resolveEnd($,i,u.strict,w);if(f.range=[_,i,g.offset],g.comment)f.comment=g.comment;return f}oq.composeEmptyNode=vs;oq.composeNode=Lf});var Hf=D((fL)=>{var _L=cu(),Uf=Of(),sL=Xu(),$L=ku();function wL(u,_,{offset:s,start:$,value:w,end:f},i){let g=Object.assign({_directives:_},u),R=new _L.Document(void 0,g),S={atKey:!1,atRoot:!0,directives:R.directives,options:R.options,schema:R.schema},L=$L.resolveProps($,{indicator:"doc-start",next:w??f?.[0],offset:s,onError:i,parentIndent:0,startOnNewline:!0});if(L.found){if(R.directives.docStart=!0,w&&(w.type==="block-map"||w.type==="block-seq")&&!L.hasNewline)i(L.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}R.contents=w?Uf.composeNode(S,w,L,i):Uf.composeEmptyNode(S,L.end,$,null,L,i);let I=R.contents.range[2],T=sL.resolveEnd(f,I,!1,i);if(T.comment)R.comment=T.comment;return R.range=[s,I,T.offset],R}fL.composeDoc=wL});var os=D((qL)=>{var gL=s_("process"),RL=ss(),SL=cu(),pu=xu(),Df=X(),IL=Hf(),TL=Xu();function au(u){if(typeof u==="number")return[u,u+1];if(Array.isArray(u))return u.length===2?u:[u[0],u[1]];let{offset:_,source:s}=u;return[_,_+(typeof s==="string"?s.length:1)]}function Pf(u){let _="",s=!1,$=!1;for(let w=0;w<u.length;++w){let f=u[w];switch(f[0]){case"#":_+=(_===""?"":$?`
58
+ `}y8.stringifyDocument=g8});var r_=V((d8)=>{var k8=x_(),C_=A$(),u=S(),u8=q_(),h8=e(),v8=a0(),m8=W1(),o0=V$(),l8=L0(),p8=k_(),t0=Y0();class e0{constructor(_,$,q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u.NODE_TYPE,{value:u.DOC});let T=null;if(typeof $==="function"||Array.isArray($))T=$;else if(q===void 0&&$)q=$,$=void 0;let O=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},q);this.options=O;let{version:H}=O;if(q?._directives){if(this.directives=q._directives.atDocument(),this.directives.yaml.explicit)H=this.directives.yaml.version}else this.directives=new t0.Directives({version:H});this.setSchema(H,q),this.contents=_===void 0?null:this.createNode(_,T,q)}clone(){let _=Object.create(e0.prototype,{[u.NODE_TYPE]:{value:u.DOC}});if(_.commentBefore=this.commentBefore,_.comment=this.comment,_.errors=this.errors.slice(),_.warnings=this.warnings.slice(),_.options=Object.assign({},this.options),this.directives)_.directives=this.directives.clone();if(_.schema=this.schema.clone(),_.contents=u.isNode(this.contents)?this.contents.clone(_.schema):this.contents,this.range)_.range=this.range.slice();return _}add(_){if(P_(this.contents))this.contents.add(_)}addIn(_,$){if(P_(this.contents))this.contents.addIn(_,$)}createAlias(_,$){if(!_.anchor){let q=o0.anchorNames(this);_.anchor=!$||q.has($)?o0.findNewAnchor($||"a",q):$}return new k8.Alias(_.anchor)}createNode(_,$,q){let T=void 0;if(typeof $==="function")_=$.call({"":_},"",_),T=$;else if(Array.isArray($)){let W=(B)=>typeof B==="number"||B instanceof String||B instanceof Number,L=$.filter(W).map(String);if(L.length>0)$=$.concat(L);T=$}else if(q===void 0&&$)q=$,$=void 0;let{aliasDuplicateObjects:O,anchorPrefix:H,flow:X,keepUndefined:U,onTagObj:J,tag:Z}=q??{},{onAnchor:z,setAnchors:G,sourceObjects:Q}=o0.createNodeAnchors(this,H||"a"),Y={aliasDuplicateObjects:O??!0,keepUndefined:U??!1,onAnchor:z,onTagObj:J,replacer:T,schema:this.schema,sourceObjects:Q},R=p8.createNode(_,Z,Y);if(X&&u.isCollection(R))R.flow=!0;return G(),R}createPair(_,$,q={}){let T=this.createNode(_,null,q),O=this.createNode($,null,q);return new u8.Pair(T,O)}delete(_){return P_(this.contents)?this.contents.delete(_):!1}deleteIn(_){if(C_.isEmptyPath(_)){if(this.contents==null)return!1;return this.contents=null,!0}return P_(this.contents)?this.contents.deleteIn(_):!1}get(_,$){return u.isCollection(this.contents)?this.contents.get(_,$):void 0}getIn(_,$){if(C_.isEmptyPath(_))return!$&&u.isScalar(this.contents)?this.contents.value:this.contents;return u.isCollection(this.contents)?this.contents.getIn(_,$):void 0}has(_){return u.isCollection(this.contents)?this.contents.has(_):!1}hasIn(_){if(C_.isEmptyPath(_))return this.contents!==void 0;return u.isCollection(this.contents)?this.contents.hasIn(_):!1}set(_,$){if(this.contents==null)this.contents=C_.collectionFromPath(this.schema,[_],$);else if(P_(this.contents))this.contents.set(_,$)}setIn(_,$){if(C_.isEmptyPath(_))this.contents=$;else if(this.contents==null)this.contents=C_.collectionFromPath(this.schema,Array.from(_),$);else if(P_(this.contents))this.contents.setIn(_,$)}setSchema(_,$={}){if(typeof _==="number")_=String(_);let q;switch(_){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new t0.Directives({version:"1.1"});q={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=_;else this.directives=new t0.Directives({version:_});q={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;q=null;break;default:{let T=JSON.stringify(_);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${T}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(q)this.schema=new v8.Schema(Object.assign(q,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:_,jsonArg:$,mapAsMap:q,maxAliasCount:T,onAnchor:O,reviver:H}={}){let X={anchors:new Map,doc:this,keep:!_,mapAsMap:q===!0,mapKeyWarned:!1,maxAliasCount:typeof T==="number"?T:100},U=h8.toJS(this.contents,$??"",X);if(typeof O==="function")for(let{count:J,res:Z}of X.anchors.values())O(Z,J);return typeof H==="function"?l8.applyReviver(H,{"":U},"",U):U}toJSON(_,$){return this.toJS({json:!0,jsonArg:_,mapAsMap:!1,onAnchor:$})}toString(_={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in _&&(!Number.isInteger(_.indent)||Number(_.indent)<=0)){let $=JSON.stringify(_.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return m8.stringifyDocument(this,_)}}function P_(_){if(u.isCollection(_))return!0;throw Error("Expected a YAML collection as document contents")}d8.Document=e0});var o_=V((i8)=>{class i$ extends Error{constructor(_,$,q,T){super();this.name=_,this.code=q,this.message=T,this.pos=$}}class R1 extends i${constructor(_,$,q){super("YAMLParseError",_,$,q)}}class Y1 extends i${constructor(_,$,q){super("YAMLWarning",_,$,q)}}var s8=(_,$)=>(q)=>{if(q.pos[0]===-1)return;q.linePos=q.pos.map((U)=>$.linePos(U));let{line:T,col:O}=q.linePos[0];q.message+=` at line ${T}, column ${O}`;let H=O-1,X=_.substring($.lineStarts[T-1],$.lineStarts[T]).replace(/[\n\r]+$/,"");if(H>=60&&X.length>80){let U=Math.min(H-39,X.length-79);X="…"+X.substring(U),H-=U-1}if(X.length>80)X=X.substring(0,79)+"…";if(T>1&&/^ *$/.test(X.substring(0,H))){let U=_.substring($.lineStarts[T-2],$.lineStarts[T-1]);if(U.length>80)U=U.substring(0,79)+`…
59
+ `;X=U+X}if(/[^ ]/.test(X)){let U=1,J=q.linePos[1];if(J?.line===T&&J.col>O)U=Math.max(1,Math.min(J.col-O,80-H));let Z=" ".repeat(H)+"^".repeat(U);q.message+=`:
60
+
61
+ ${X}
62
+ ${Z}
63
+ `}};i8.YAMLError=i$;i8.YAMLParseError=R1;i8.YAMLWarning=Y1;i8.prettifyError=s8});var t_=V((e8)=>{function t8(_,{flow:$,indicator:q,next:T,offset:O,onError:H,parentIndent:X,startOnNewline:U}){let J=!1,Z=U,z=U,G="",Q="",Y=!1,R=!1,W=null,L=null,B=null,A=null,D=null,M=null,I=null;for(let w of _){if(R){if(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma")H(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");R=!1}if(W){if(Z&&w.type!=="comment"&&w.type!=="newline")H(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");W=null}switch(w.type){case"space":if(!$&&(q!=="doc-start"||T?.type!=="flow-collection")&&w.source.includes("\t"))W=w;z=!0;break;case"comment":{if(!z)H(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=w.source.substring(1)||" ";if(!G)G=E;else G+=Q+E;Q="",Z=!1;break}case"newline":if(Z){if(G)G+=w.source;else if(!M||q!=="seq-item-ind")J=!0}else Q+=w.source;if(Z=!0,Y=!0,L||B)A=w;z=!0;break;case"anchor":if(L)H(w,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(w.source.endsWith(":"))H(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=w,I??(I=w.offset),Z=!1,z=!1,R=!0;break;case"tag":{if(B)H(w,"MULTIPLE_TAGS","A node can have at most one tag");B=w,I??(I=w.offset),Z=!1,z=!1,R=!0;break}case q:if(L||B)H(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`);if(M)H(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${$??"collection"}`);M=w,Z=q==="seq-item-ind"||q==="explicit-key-ind",z=!1;break;case"comma":if($){if(D)H(w,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);D=w,Z=!1,z=!1;break}default:H(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),Z=!1,z=!1}}let F=_[_.length-1],K=F?F.offset+F.source.length:O;if(R&&T&&T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&(T.type!=="scalar"||T.source!==""))H(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(W&&(Z&&W.indent<=X||T?.type==="block-map"||T?.type==="block-seq"))H(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:M,spaceBefore:J,comment:G,hasNewline:Y,anchor:L,tag:B,newlineAfterProp:A,end:K,start:I??K}}e8.resolveProps=t8});var n$=V(($6)=>{function _q(_){if(!_)return null;switch(_.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(_.source.includes(`
64
+ `))return!0;if(_.end){for(let $ of _.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of _.items){for(let q of $.start)if(q.type==="newline")return!0;if($.sep){for(let q of $.sep)if(q.type==="newline")return!0}if(_q($.key)||_q($.value))return!0}return!1;default:return!0}}$6.containsNewline=_q});var $q=V((H6)=>{var T6=n$();function O6(_,$,q){if($?.type==="flow-collection"){let T=$.end[0];if(T.indent===_&&(T.source==="]"||T.source==="}")&&T6.containsNewline($))q(T,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}H6.flowIndentCheck=O6});var qq=V((J6)=>{var L1=S();function U6(_,$,q){let{uniqueKeys:T}=_.options;if(T===!1)return!1;let O=typeof T==="function"?T:(H,X)=>H===X||L1.isScalar(H)&&L1.isScalar(X)&&H.value===X.value;return $.some((H)=>O(H.key,q))}J6.mapIncludes=U6});var D1=V((R6)=>{var V1=q_(),z6=O_(),B1=t_(),G6=n$(),w1=$q(),Q6=qq(),A1="All mapping items must start at the same column";function W6({composeNode:_,composeEmptyNode:$},q,T,O,H){let U=new(H?.nodeClass??z6.YAMLMap)(q.schema);if(q.atRoot)q.atRoot=!1;let J=T.offset,Z=null;for(let z of T.items){let{start:G,key:Q,sep:Y,value:R}=z,W=B1.resolveProps(G,{indicator:"explicit-key-ind",next:Q??Y?.[0],offset:J,onError:O,parentIndent:T.indent,startOnNewline:!0}),L=!W.found;if(L){if(Q){if(Q.type==="block-seq")O(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in Q&&Q.indent!==T.indent)O(J,"BAD_INDENT",A1)}if(!W.anchor&&!W.tag&&!Y){if(Z=W.end,W.comment)if(U.comment)U.comment+=`
65
+ `+W.comment;else U.comment=W.comment;continue}if(W.newlineAfterProp||G6.containsNewline(Q))O(Q??G[G.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(W.found?.indent!==T.indent)O(J,"BAD_INDENT",A1);q.atKey=!0;let B=W.end,A=Q?_(q,Q,W,O):$(q,B,G,null,W,O);if(q.schema.compat)w1.flowIndentCheck(T.indent,Q,O);if(q.atKey=!1,Q6.mapIncludes(q,U.items,A))O(B,"DUPLICATE_KEY","Map keys must be unique");let D=B1.resolveProps(Y??[],{indicator:"map-value-ind",next:R,offset:A.range[2],onError:O,parentIndent:T.indent,startOnNewline:!Q||Q.type==="block-scalar"});if(J=D.end,D.found){if(L){if(R?.type==="block-map"&&!D.hasNewline)O(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(q.options.strict&&W.start<D.found.offset-1024)O(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let M=R?_(q,R,D,O):$(q,J,Y,null,D,O);if(q.schema.compat)w1.flowIndentCheck(T.indent,R,O);J=M.range[2];let I=new V1.Pair(A,M);if(q.options.keepSourceTokens)I.srcToken=z;U.items.push(I)}else{if(L)O(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(D.comment)if(A.comment)A.comment+=`
66
+ `+D.comment;else A.comment=D.comment;let M=new V1.Pair(A);if(q.options.keepSourceTokens)M.srcToken=z;U.items.push(M)}}if(Z&&Z<J)O(Z,"IMPOSSIBLE","Map comment with trailing content");return U.range=[T.offset,J,Z??J],U}R6.resolveBlockMap=W6});var M1=V((A6)=>{var L6=H_(),V6=t_(),B6=$q();function w6({composeNode:_,composeEmptyNode:$},q,T,O,H){let U=new(H?.nodeClass??L6.YAMLSeq)(q.schema);if(q.atRoot)q.atRoot=!1;if(q.atKey)q.atKey=!1;let J=T.offset,Z=null;for(let{start:z,value:G}of T.items){let Q=V6.resolveProps(z,{indicator:"seq-item-ind",next:G,offset:J,onError:O,parentIndent:T.indent,startOnNewline:!0});if(!Q.found)if(Q.anchor||Q.tag||G)if(G?.type==="block-seq")O(Q.end,"BAD_INDENT","All sequence items must start at the same column");else O(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Z=Q.end,Q.comment)U.comment=Q.comment;continue}let Y=G?_(q,G,Q,O):$(q,Q.end,z,null,Q,O);if(q.schema.compat)B6.flowIndentCheck(T.indent,G,O);J=Y.range[2],U.items.push(Y)}return U.range=[T.offset,J,Z??J],U}A6.resolveBlockSeq=w6});var f_=V((I6)=>{function M6(_,$,q,T){let O="";if(_){let H=!1,X="";for(let U of _){let{source:J,type:Z}=U;switch(Z){case"space":H=!0;break;case"comment":{if(q&&!H)T(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let z=J.substring(1)||" ";if(!O)O=z;else O+=X+z;X="";break}case"newline":if(O)X+=J;H=!0;break;default:T(U,"UNEXPECTED_TOKEN",`Unexpected ${Z} at node end`)}$+=J.length}}return{comment:O,offset:$}}I6.resolveEnd=M6});var S1=V((j6)=>{var S6=S(),K6=q_(),I1=O_(),N6=H_(),C6=f_(),F1=t_(),P6=n$(),f6=qq(),Tq="Block collections are not allowed within flow collections",Oq=(_)=>_&&(_.type==="block-map"||_.type==="block-seq");function E6({composeNode:_,composeEmptyNode:$},q,T,O,H){let X=T.start.source==="{",U=X?"flow map":"flow sequence",Z=new(H?.nodeClass??(X?I1.YAMLMap:N6.YAMLSeq))(q.schema);Z.flow=!0;let z=q.atRoot;if(z)q.atRoot=!1;if(q.atKey)q.atKey=!1;let G=T.offset+T.start.source.length;for(let L=0;L<T.items.length;++L){let B=T.items[L],{start:A,key:D,sep:M,value:I}=B,F=F1.resolveProps(A,{flow:U,indicator:"explicit-key-ind",next:D??M?.[0],offset:G,onError:O,parentIndent:T.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!M&&!I){if(L===0&&F.comma)O(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(L<T.items.length-1)O(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(F.comment)if(Z.comment)Z.comment+=`
67
+ `+F.comment;else Z.comment=F.comment;G=F.end;continue}if(!X&&q.options.strict&&P6.containsNewline(D))O(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(F.comma)O(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`)}else{if(!F.comma)O(F.start,"MISSING_CHAR",`Missing , between ${U} items`);if(F.comment){let K="";_:for(let w of A)switch(w.type){case"comma":case"space":break;case"comment":K=w.source.substring(1);break _;default:break _}if(K){let w=Z.items[Z.items.length-1];if(S6.isPair(w))w=w.value??w.key;if(w.comment)w.comment+=`
68
+ `+K;else w.comment=K;F.comment=F.comment.substring(K.length+1)}}}if(!X&&!M&&!F.found){let K=I?_(q,I,F,O):$(q,F.end,M,null,F,O);if(Z.items.push(K),G=K.range[2],Oq(I))O(K.range,"BLOCK_IN_FLOW",Tq)}else{q.atKey=!0;let K=F.end,w=D?_(q,D,F,O):$(q,K,A,null,F,O);if(Oq(D))O(w.range,"BLOCK_IN_FLOW",Tq);q.atKey=!1;let E=F1.resolveProps(M??[],{flow:U,indicator:"map-value-ind",next:I,offset:w.range[2],onError:O,parentIndent:T.indent,startOnNewline:!1});if(E.found){if(!X&&!F.found&&q.options.strict){if(M)for(let j of M){if(j===E.found)break;if(j.type==="newline"){O(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(F.start<E.found.offset-1024)O(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(I)if("source"in I&&I.source?.[0]===":")O(I,"MISSING_CHAR",`Missing space after : in ${U}`);else O(E.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let t=I?_(q,I,E,O):E.found?$(q,E.end,M,null,E,O):null;if(t){if(Oq(I))O(t.range,"BLOCK_IN_FLOW",Tq)}else if(E.comment)if(w.comment)w.comment+=`
69
+ `+E.comment;else w.comment=E.comment;let A_=new K6.Pair(w,t);if(q.options.keepSourceTokens)A_.srcToken=B;if(X){let j=Z;if(f6.mapIncludes(q,j.items,w))O(K,"DUPLICATE_KEY","Map keys must be unique");j.items.push(A_)}else{let j=new I1.YAMLMap(q.schema);j.flow=!0,j.items.push(A_);let rq=(t??w).range;j.range=[w.range[0],rq[1],rq[2]],Z.items.push(j)}G=t?t.range[2]:E.end}}let Q=X?"}":"]",[Y,...R]=T.end,W=G;if(Y?.source===Q)W=Y.offset+Y.source.length;else{let L=U[0].toUpperCase()+U.substring(1),B=z?`${L} must end with a ${Q}`:`${L} in block collection must be sufficiently indented and end with a ${Q}`;if(O(G,z?"MISSING_CHAR":"BAD_INDENT",B),Y&&Y.source.length!==1)R.unshift(Y)}if(R.length>0){let L=C6.resolveEnd(R,W,q.options.strict,O);if(L.comment)if(Z.comment)Z.comment+=`
70
+ `+L.comment;else Z.comment=L.comment;Z.range=[T.offset,W,L.offset]}else Z.range=[T.offset,W,W];return Z}j6.resolveFlowCollection=E6});var K1=V((l6)=>{var g6=S(),y6=f(),x6=O_(),k6=H_(),u6=D1(),h6=M1(),v6=S1();function Hq(_,$,q,T,O,H){let X=q.type==="block-map"?u6.resolveBlockMap(_,$,q,T,H):q.type==="block-seq"?h6.resolveBlockSeq(_,$,q,T,H):v6.resolveFlowCollection(_,$,q,T,H),U=X.constructor;if(O==="!"||O===U.tagName)return X.tag=U.tagName,X;if(O)X.tag=O;return X}function m6(_,$,q,T,O){let H=T.tag,X=!H?null:$.directives.tagName(H.source,(Q)=>O(H,"TAG_RESOLVE_FAILED",Q));if(q.type==="block-seq"){let{anchor:Q,newlineAfterProp:Y}=T,R=Q&&H?Q.offset>H.offset?Q:H:Q??H;if(R&&(!Y||Y.offset<R.offset))O(R,"MISSING_CHAR","Missing newline after block sequence props")}let U=q.type==="block-map"?"map":q.type==="block-seq"?"seq":q.start.source==="{"?"map":"seq";if(!H||!X||X==="!"||X===x6.YAMLMap.tagName&&U==="map"||X===k6.YAMLSeq.tagName&&U==="seq")return Hq(_,$,q,O,X);let J=$.schema.tags.find((Q)=>Q.tag===X&&Q.collection===U);if(!J){let Q=$.schema.knownTags[X];if(Q?.collection===U)$.schema.tags.push(Object.assign({},Q,{default:!1})),J=Q;else{if(Q)O(H,"BAD_COLLECTION_TYPE",`${Q.tag} used for ${U} collection, but expects ${Q.collection??"scalar"}`,!0);else O(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,!0);return Hq(_,$,q,O,X)}}let Z=Hq(_,$,q,O,X,J),z=J.resolve?.(Z,(Q)=>O(H,"TAG_RESOLVE_FAILED",Q),$.options)??Z,G=g6.isNode(z)?z:new y6.Scalar(z);if(G.range=Z.range,G.tag=X,J?.format)G.format=J.format;return G}l6.composeCollection=m6});var Uq=V((i6)=>{var Xq=f();function d6(_,$,q){let T=$.offset,O=c6($,_.options.strict,q);if(!O)return{value:"",type:null,comment:"",range:[T,T,T]};let H=O.mode===">"?Xq.Scalar.BLOCK_FOLDED:Xq.Scalar.BLOCK_LITERAL,X=$.source?s6($.source):[],U=X.length;for(let W=X.length-1;W>=0;--W){let L=X[W][1];if(L===""||L==="\r")U=W;else break}if(U===0){let W=O.chomp==="+"&&X.length>0?`
71
+ `.repeat(Math.max(1,X.length-1)):"",L=T+O.length;if($.source)L+=$.source.length;return{value:W,type:H,comment:O.comment,range:[T,L,L]}}let J=$.indent+O.indent,Z=$.offset+O.length,z=0;for(let W=0;W<U;++W){let[L,B]=X[W];if(B===""||B==="\r"){if(O.indent===0&&L.length>J)J=L.length}else{if(L.length<J)q(Z+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(O.indent===0)J=L.length;if(z=W,J===0&&!_.atRoot)q(Z,"BAD_INDENT","Block scalar values in collections must be indented");break}Z+=L.length+B.length+1}for(let W=X.length-1;W>=U;--W)if(X[W][0].length>J)U=W+1;let G="",Q="",Y=!1;for(let W=0;W<z;++W)G+=X[W][0].slice(J)+`
72
+ `;for(let W=z;W<U;++W){let[L,B]=X[W];Z+=L.length+B.length+1;let A=B[B.length-1]==="\r";if(A)B=B.slice(0,-1);if(B&&L.length<J){let M=`Block scalar lines must not be less indented than their ${O.indent?"explicit indentation indicator":"first line"}`;q(Z-B.length-(A?2:1),"BAD_INDENT",M),L=""}if(H===Xq.Scalar.BLOCK_LITERAL)G+=Q+L.slice(J)+B,Q=`
73
+ `;else if(L.length>J||B[0]==="\t"){if(Q===" ")Q=`
74
+ `;else if(!Y&&Q===`
75
+ `)Q=`
76
+
77
+ `;G+=Q+L.slice(J)+B,Q=`
78
+ `,Y=!0}else if(B==="")if(Q===`
79
+ `)G+=`
80
+ `;else Q=`
81
+ `;else G+=Q+B,Q=" ",Y=!1}switch(O.chomp){case"-":break;case"+":for(let W=U;W<X.length;++W)G+=`
82
+ `+X[W][0].slice(J);if(G[G.length-1]!==`
83
+ `)G+=`
84
+ `;break;default:G+=`
85
+ `}let R=T+O.length+$.source.length;return{value:G,type:H,comment:O.comment,range:[T,R,R]}}function c6({offset:_,props:$},q,T){if($[0].type!=="block-scalar-header")return T($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:O}=$[0],H=O[0],X=0,U="",J=-1;for(let Q=1;Q<O.length;++Q){let Y=O[Q];if(!U&&(Y==="-"||Y==="+"))U=Y;else{let R=Number(Y);if(!X&&R)X=R;else if(J===-1)J=_+Q}}if(J!==-1)T(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${O}`);let Z=!1,z="",G=O.length;for(let Q=1;Q<$.length;++Q){let Y=$[Q];switch(Y.type){case"space":Z=!0;case"newline":G+=Y.source.length;break;case"comment":if(q&&!Z)T(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");G+=Y.source.length,z=Y.source.substring(1);break;case"error":T(Y,"UNEXPECTED_TOKEN",Y.message),G+=Y.source.length;break;default:{let R=`Unexpected token in block scalar header: ${Y.type}`;T(Y,"UNEXPECTED_TOKEN",R);let W=Y.source;if(W&&typeof W==="string")G+=W.length}}}return{mode:H,indent:X,chomp:U,comment:z,length:G}}function s6(_){let $=_.split(/\n( *)/),q=$[0],T=q.match(/^( *)/),H=[T?.[1]?[T[1],q.slice(T[1].length)]:["",q]];for(let X=1;X<$.length;X+=2)H.push([$[X],$[X+1]]);return H}i6.resolveBlockScalar=d6});var Zq=V((TU)=>{var Jq=f(),a6=f_();function r6(_,$,q){let{offset:T,type:O,source:H,end:X}=_,U,J,Z=(Q,Y,R)=>q(T+Q,Y,R);switch(O){case"scalar":U=Jq.Scalar.PLAIN,J=o6(H,Z);break;case"single-quoted-scalar":U=Jq.Scalar.QUOTE_SINGLE,J=t6(H,Z);break;case"double-quoted-scalar":U=Jq.Scalar.QUOTE_DOUBLE,J=e6(H,Z);break;default:return q(_,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${O}`),{value:"",type:null,comment:"",range:[T,T+H.length,T+H.length]}}let z=T+H.length,G=a6.resolveEnd(X,z,$,q);return{value:J,type:U,comment:G.comment,range:[T,z,G.offset]}}function o6(_,$){let q="";switch(_[0]){case"\t":q="a tab character";break;case",":q="flow indicator character ,";break;case"%":q="directive indicator character %";break;case"|":case">":{q=`block scalar indicator ${_[0]}`;break}case"@":case"`":{q=`reserved character ${_[0]}`;break}}if(q)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${q}`);return N1(_)}function t6(_,$){if(_[_.length-1]!=="'"||_.length===1)$(_.length,"MISSING_CHAR","Missing closing 'quote");return N1(_.slice(1,-1)).replace(/''/g,"'")}function N1(_){let $,q;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
86
+ `,"sy"),q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
87
+ `,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let T=$.exec(_);if(!T)return _;let O=T[1],H=" ",X=$.lastIndex;q.lastIndex=X;while(T=q.exec(_)){if(T[1]==="")if(H===`
88
+ `)O+=H;else H=`
89
+ `;else O+=H+T[1],H=" ";X=q.lastIndex}let U=/[ \t]*(.*)/sy;return U.lastIndex=X,T=U.exec(_),O+H+(T?.[1]??"")}function e6(_,$){let q="";for(let T=1;T<_.length-1;++T){let O=_[T];if(O==="\r"&&_[T+1]===`
90
+ `)continue;if(O===`
91
+ `){let{fold:H,offset:X}=_U(_,T);q+=H,T=X}else if(O==="\\"){let H=_[++T],X=$U[H];if(X)q+=X;else if(H===`
92
+ `){H=_[T+1];while(H===" "||H==="\t")H=_[++T+1]}else if(H==="\r"&&_[T+1]===`
93
+ `){H=_[++T+1];while(H===" "||H==="\t")H=_[++T+1]}else if(H==="x"||H==="u"||H==="U"){let U=H==="x"?2:H==="u"?4:8;q+=qU(_,T+1,U,$),T+=U}else{let U=_.substr(T-1,2);$(T-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),q+=U}}else if(O===" "||O==="\t"){let H=T,X=_[T+1];while(X===" "||X==="\t")X=_[++T+1];if(X!==`
94
+ `&&!(X==="\r"&&_[T+2]===`
95
+ `))q+=T>H?_.slice(H,T+1):O}else q+=O}if(_[_.length-1]!=='"'||_.length===1)$(_.length,"MISSING_CHAR",'Missing closing "quote');return q}function _U(_,$){let q="",T=_[$+1];while(T===" "||T==="\t"||T===`
96
+ `||T==="\r"){if(T==="\r"&&_[$+2]!==`
97
+ `)break;if(T===`
98
+ `)q+=`
99
+ `;$+=1,T=_[$+1]}if(!q)q=" ";return{fold:q,offset:$}}var $U={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
100
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function qU(_,$,q,T){let O=_.substr($,q),X=O.length===q&&/^[0-9a-fA-F]+$/.test(O)?parseInt(O,16):NaN;try{return String.fromCodePoint(X)}catch{let U=_.substr($-2,q+2);return T($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),U}}TU.resolveFlowScalar=r6});var P1=V((zU)=>{var L_=S(),C1=f(),HU=Uq(),XU=Zq();function UU(_,$,q,T){let{value:O,type:H,comment:X,range:U}=$.type==="block-scalar"?HU.resolveBlockScalar(_,$,T):XU.resolveFlowScalar($,_.options.strict,T),J=q?_.directives.tagName(q.source,(G)=>T(q,"TAG_RESOLVE_FAILED",G)):null,Z;if(_.options.stringKeys&&_.atKey)Z=_.schema[L_.SCALAR];else if(J)Z=JU(_.schema,O,J,q,T);else if($.type==="scalar")Z=ZU(_,O,$,T);else Z=_.schema[L_.SCALAR];let z;try{let G=Z.resolve(O,(Q)=>T(q??$,"TAG_RESOLVE_FAILED",Q),_.options);z=L_.isScalar(G)?G:new C1.Scalar(G)}catch(G){let Q=G instanceof Error?G.message:String(G);T(q??$,"TAG_RESOLVE_FAILED",Q),z=new C1.Scalar(O)}if(z.range=U,z.source=O,H)z.type=H;if(J)z.tag=J;if(Z.format)z.format=Z.format;if(X)z.comment=X;return z}function JU(_,$,q,T,O){if(q==="!")return _[L_.SCALAR];let H=[];for(let U of _.tags)if(!U.collection&&U.tag===q)if(U.default&&U.test)H.push(U);else return U;for(let U of H)if(U.test?.test($))return U;let X=_.knownTags[q];if(X&&!X.collection)return _.tags.push(Object.assign({},X,{default:!1,test:void 0})),X;return O(T,"TAG_RESOLVE_FAILED",`Unresolved tag: ${q}`,q!=="tag:yaml.org,2002:str"),_[L_.SCALAR]}function ZU({atKey:_,directives:$,schema:q},T,O,H){let X=q.tags.find((U)=>(U.default===!0||_&&U.default==="key")&&U.test?.test(T))||q[L_.SCALAR];if(q.compat){let U=q.compat.find((J)=>J.default&&J.test?.test(T))??q[L_.SCALAR];if(X.tag!==U.tag){let J=$.tagString(X.tag),Z=$.tagString(U.tag),z=`Value may be parsed as either ${J} or ${Z}`;H(O,"TAG_RESOLVE_FAILED",z,!0)}}return X}zU.composeScalar=UU});var f1=V((WU)=>{function QU(_,$,q){if($){q??(q=$.length);for(let T=q-1;T>=0;--T){let O=$[T];switch(O.type){case"space":case"comment":case"newline":_-=O.source.length;continue}O=$[++T];while(O?.type==="space")_+=O.source.length,O=$[++T];break}}return _}WU.emptyScalarPosition=QU});var b1=V((MU)=>{var YU=x_(),LU=S(),VU=K1(),E1=P1(),BU=f_(),wU=f1(),AU={composeNode:j1,composeEmptyNode:zq};function j1(_,$,q,T){let O=_.atKey,{spaceBefore:H,comment:X,anchor:U,tag:J}=q,Z,z=!0;switch($.type){case"alias":if(Z=DU(_,$,T),U||J)T($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(Z=E1.composeScalar(_,$,J,T),U)Z.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(Z=VU.composeCollection(AU,_,$,q,T),U)Z.anchor=U.source.substring(1)}catch(G){let Q=G instanceof Error?G.message:String(G);T($,"RESOURCE_EXHAUSTION",Q)}break;default:{let G=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;T($,"UNEXPECTED_TOKEN",G),z=!1}}if(Z??(Z=zq(_,$.offset,void 0,null,q,T)),U&&Z.anchor==="")T(U,"BAD_ALIAS","Anchor cannot be an empty string");if(O&&_.options.stringKeys&&(!LU.isScalar(Z)||typeof Z.value!=="string"||Z.tag&&Z.tag!=="tag:yaml.org,2002:str"))T(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(H)Z.spaceBefore=!0;if(X)if($.type==="scalar"&&$.source==="")Z.comment=X;else Z.commentBefore=X;if(_.options.keepSourceTokens&&z)Z.srcToken=$;return Z}function zq(_,$,q,T,{spaceBefore:O,comment:H,anchor:X,tag:U,end:J},Z){let z={type:"scalar",offset:wU.emptyScalarPosition($,q,T),indent:-1,source:""},G=E1.composeScalar(_,z,U,Z);if(X){if(G.anchor=X.source.substring(1),G.anchor==="")Z(X,"BAD_ALIAS","Anchor cannot be an empty string")}if(O)G.spaceBefore=!0;if(H)G.comment=H,G.range[2]=J;return G}function DU({options:_},{offset:$,source:q,end:T},O){let H=new YU.Alias(q.substring(1));if(H.source==="")O($,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))O($+q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let X=$+q.length,U=BU.resolveEnd(T,X,_.strict,O);if(H.range=[$,X,U.offset],U.comment)H.comment=U.comment;return H}MU.composeEmptyNode=zq;MU.composeNode=j1});var y1=V((PU)=>{var SU=r_(),g1=b1(),KU=f_(),NU=t_();function CU(_,$,{offset:q,start:T,value:O,end:H},X){let U=Object.assign({_directives:$},_),J=new SU.Document(void 0,U),Z={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},z=NU.resolveProps(T,{indicator:"doc-start",next:O??H?.[0],offset:q,onError:X,parentIndent:0,startOnNewline:!0});if(z.found){if(J.directives.docStart=!0,O&&(O.type==="block-map"||O.type==="block-seq")&&!z.hasNewline)X(z.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=O?g1.composeNode(Z,O,z,X):g1.composeEmptyNode(Z,z.end,T,null,z,X);let G=J.contents.range[2],Q=KU.resolveEnd(H,G,!1,X);if(Q.comment)J.comment=Q.comment;return J.range=[q,G,Q.offset],J}PU.composeDoc=CU});var Gq=V((xU)=>{var EU=Q$("process"),jU=Y0(),bU=r_(),e_=o_(),x1=S(),gU=y1(),yU=f_();function _$(_){if(typeof _==="number")return[_,_+1];if(Array.isArray(_))return _.length===2?_:[_[0],_[1]];let{offset:$,source:q}=_;return[$,$+(typeof q==="string"?q.length:1)]}function k1(_){let $="",q=!1,T=!1;for(let O=0;O<_.length;++O){let H=_[O];switch(H[0]){case"#":$+=($===""?"":T?`
101
101
 
102
102
  `:`
103
- `)+(f.substring(1)||" "),s=!0,$=!1;break;case"%":if(u[w+1]?.[0]!=="#")w+=1;s=!1;break;default:if(!s)$=!0;s=!1}}return{comment:_,afterEmptyLine:$}}class Af{constructor(u={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(_,s,$,w)=>{let f=au(_);if(w)this.warnings.push(new pu.YAMLWarning(f,s,$));else this.errors.push(new pu.YAMLParseError(f,s,$))},this.directives=new RL.Directives({version:u.version||"1.2"}),this.options=u}decorate(u,_){let{comment:s,afterEmptyLine:$}=Pf(this.prelude);if(s){let w=u.contents;if(_)u.comment=u.comment?`${u.comment}
104
- ${s}`:s;else if($||u.directives.docStart||!w)u.commentBefore=s;else if(Df.isCollection(w)&&!w.flow&&w.items.length>0){let f=w.items[0];if(Df.isPair(f))f=f.key;let i=f.commentBefore;f.commentBefore=i?`${s}
105
- ${i}`:s}else{let f=w.commentBefore;w.commentBefore=f?`${s}
106
- ${f}`:s}}if(_){for(let w=0;w<this.errors.length;++w)u.errors.push(this.errors[w]);for(let w=0;w<this.warnings.length;++w)u.warnings.push(this.warnings[w])}else u.errors=this.errors,u.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Pf(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(u,_=!1,s=-1){for(let $ of u)yield*this.next($);yield*this.end(_,s)}*next(u){if(gL.env.LOG_STREAM)console.dir(u,{depth:null});switch(u.type){case"directive":this.directives.add(u.source,(_,s,$)=>{let w=au(u);w[0]+=_,this.onError(w,"BAD_DIRECTIVE",s,$)}),this.prelude.push(u.source),this.atDirectives=!0;break;case"document":{let _=IL.composeDoc(this.options,this.directives,u,this.onError);if(this.atDirectives&&!_.directives.docStart)this.onError(u,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(_,!1),this.doc)yield this.doc;this.doc=_,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(u.source);break;case"error":{let _=u.source?`${u.message}: ${JSON.stringify(u.source)}`:u.message,s=new pu.YAMLParseError(au(u),"UNEXPECTED_TOKEN",_);if(this.atDirectives||!this.doc)this.errors.push(s);else this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new pu.YAMLParseError(au(u),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let _=TL.resolveEnd(u.end,u.offset+u.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),_.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
107
- ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.push(new pu.YAMLParseError(au(u),"UNEXPECTED_TOKEN",`Unsupported token ${u.type}`))}}*end(u=!1,_=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(u){let s=Object.assign({_directives:this.directives},this.options),$=new SL.Document(void 0,s);if(this.atDirectives)this.onError(_,"MISSING_CHAR","Missing directives-end indicator line");$.range=[0,_,_],this.decorate($,!1),yield $}}}qL.Composer=Af});var Yf=D((zL)=>{var OL=ps(),UL=ts(),HL=xu(),Ff=Eu();function DL(u,_=!0,s){if(u){let $=(w,f,i)=>{let g=typeof w==="number"?w:Array.isArray(w)?w[0]:w.offset;if(s)s(g,f,i);else throw new HL.YAMLParseError([g,g+1],f,i)};switch(u.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return UL.resolveFlowScalar(u,_,$);case"block-scalar":return OL.resolveBlockScalar({options:{strict:_}},u,$)}}return null}function PL(u,_){let{implicitKey:s=!1,indent:$,inFlow:w=!1,offset:f=-1,type:i="PLAIN"}=_,g=Ff.stringifyString({type:i,value:u},{implicitKey:s,indent:$>0?" ".repeat($):"",inFlow:w,options:{blockQuote:!0,lineWidth:-1}}),R=_.end??[{type:"newline",offset:-1,indent:$,source:`
108
- `}];switch(g[0]){case"|":case">":{let S=g.indexOf(`
109
- `),L=g.substring(0,S),I=g.substring(S+1)+`
110
- `,T=[{type:"block-scalar-header",offset:f,indent:$,source:L}];if(!zf(T,R))T.push({type:"newline",offset:-1,indent:$,source:`
111
- `});return{type:"block-scalar",offset:f,indent:$,props:T,source:I}}case'"':return{type:"double-quoted-scalar",offset:f,indent:$,source:g,end:R};case"'":return{type:"single-quoted-scalar",offset:f,indent:$,source:g,end:R};default:return{type:"scalar",offset:f,indent:$,source:g,end:R}}}function AL(u,_,s={}){let{afterKey:$=!1,implicitKey:w=!1,inFlow:f=!1,type:i}=s,g="indent"in u?u.indent:null;if($&&typeof g==="number")g+=2;if(!i)switch(u.type){case"single-quoted-scalar":i="QUOTE_SINGLE";break;case"double-quoted-scalar":i="QUOTE_DOUBLE";break;case"block-scalar":{let S=u.props[0];if(S.type!=="block-scalar-header")throw Error("Invalid block scalar header");i=S.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:i="PLAIN"}let R=Ff.stringifyString({type:i,value:_},{implicitKey:w||g===null,indent:g!==null&&g>0?" ".repeat(g):"",inFlow:f,options:{blockQuote:!0,lineWidth:-1}});switch(R[0]){case"|":case">":FL(u,R);break;case'"':es(u,R,"double-quoted-scalar");break;case"'":es(u,R,"single-quoted-scalar");break;default:es(u,R,"scalar")}}function FL(u,_){let s=_.indexOf(`
112
- `),$=_.substring(0,s),w=_.substring(s+1)+`
113
- `;if(u.type==="block-scalar"){let f=u.props[0];if(f.type!=="block-scalar-header")throw Error("Invalid block scalar header");f.source=$,u.source=w}else{let{offset:f}=u,i="indent"in u?u.indent:-1,g=[{type:"block-scalar-header",offset:f,indent:i,source:$}];if(!zf(g,"end"in u?u.end:void 0))g.push({type:"newline",offset:-1,indent:i,source:`
114
- `});for(let R of Object.keys(u))if(R!=="type"&&R!=="offset")delete u[R];Object.assign(u,{type:"block-scalar",indent:i,props:g,source:w})}}function zf(u,_){if(_)for(let s of _)switch(s.type){case"space":case"comment":u.push(s);break;case"newline":return u.push(s),!0}return!1}function es(u,_,s){switch(u.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":u.type=s,u.source=_;break;case"block-scalar":{let $=u.props.slice(1),w=_.length;if(u.props[0].type==="block-scalar-header")w-=u.props[0].source.length;for(let f of $)f.offset+=w;delete u.props,Object.assign(u,{type:s,source:_,end:$});break}case"block-map":case"block-seq":{let w={type:"newline",offset:u.offset+_.length,indent:u.indent,source:`
115
- `};delete u.items,Object.assign(u,{type:s,source:_,end:[w]});break}default:{let $="indent"in u?u.indent:-1,w="end"in u&&Array.isArray(u.end)?u.end.filter((f)=>f.type==="space"||f.type==="comment"||f.type==="newline"):[];for(let f of Object.keys(u))if(f!=="type"&&f!=="offset")delete u[f];Object.assign(u,{type:s,indent:$,source:_,end:w})}}}zL.createScalarToken=PL;zL.resolveAsScalar=DL;zL.setScalarValue=AL});var Gf=D((JL)=>{var XL=(u)=>("type"in u)?y_(u):K_(u);function y_(u){switch(u.type){case"block-scalar":{let _="";for(let s of u.props)_+=y_(s);return _+u.source}case"block-map":case"block-seq":{let _="";for(let s of u.items)_+=K_(s);return _}case"flow-collection":{let _=u.start.source;for(let s of u.items)_+=K_(s);for(let s of u.end)_+=s.source;return _}case"document":{let _=K_(u);if(u.end)for(let s of u.end)_+=s.source;return _}default:{let _=u.source;if("end"in u&&u.end)for(let s of u.end)_+=s.source;return _}}}function K_({start:u,key:_,sep:s,value:$}){let w="";for(let f of u)w+=f.source;if(_)w+=y_(_);if(s)for(let f of s)w+=f.source;if($)w+=y_($);return w}JL.stringify=XL});var Jf=D((ML)=>{var u$=Symbol("break visit"),ZL=Symbol("skip children"),Wf=Symbol("remove item");function Lu(u,_){if("type"in u&&u.type==="document")u={start:u.start,value:u.value};Xf(Object.freeze([]),u,_)}Lu.BREAK=u$;Lu.SKIP=ZL;Lu.REMOVE=Wf;Lu.itemAtPath=(u,_)=>{let s=u;for(let[$,w]of _){let f=s?.[$];if(f&&"items"in f)s=f.items[w];else return}return s};Lu.parentCollection=(u,_)=>{let s=Lu.itemAtPath(u,_.slice(0,-1)),$=_[_.length-1][0],w=s?.[$];if(w&&"items"in w)return w;throw Error("Parent collection not found")};function Xf(u,_,s){let $=s(_,u);if(typeof $==="symbol")return $;for(let w of["key","value"]){let f=_[w];if(f&&"items"in f){for(let i=0;i<f.items.length;++i){let g=Xf(Object.freeze(u.concat([[w,i]])),f.items[i],s);if(typeof g==="number")i=g-1;else if(g===u$)return u$;else if(g===Wf)f.items.splice(i,1),i-=1}if(typeof $==="function"&&w==="key")$=$(_,u)}}return typeof $==="function"?$(_,u):$}ML.visit=Lu});var d_=D((rL)=>{var _$=Yf(),QL=Gf(),NL=Jf(),s$="\uFEFF",$$="\x02",w$="\x18",f$="\x1F",VL=(u)=>!!u&&("items"in u),bL=(u)=>!!u&&(u.type==="scalar"||u.type==="single-quoted-scalar"||u.type==="double-quoted-scalar"||u.type==="block-scalar");function EL(u){switch(u){case s$:return"<BOM>";case $$:return"<DOC>";case w$:return"<FLOW_END>";case f$:return"<SCALAR>";default:return JSON.stringify(u)}}function CL(u){switch(u){case s$:return"byte-order-mark";case $$:return"doc-mode";case w$:return"flow-error-end";case f$:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
103
+ `)+(H.substring(1)||" "),q=!0,T=!1;break;case"%":if(_[O+1]?.[0]!=="#")O+=1;q=!1;break;default:if(!q)T=!0;q=!1}}return{comment:$,afterEmptyLine:T}}class u1{constructor(_={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,q,T,O)=>{let H=_$($);if(O)this.warnings.push(new e_.YAMLWarning(H,q,T));else this.errors.push(new e_.YAMLParseError(H,q,T))},this.directives=new jU.Directives({version:_.version||"1.2"}),this.options=_}decorate(_,$){let{comment:q,afterEmptyLine:T}=k1(this.prelude);if(q){let O=_.contents;if($)_.comment=_.comment?`${_.comment}
104
+ ${q}`:q;else if(T||_.directives.docStart||!O)_.commentBefore=q;else if(x1.isCollection(O)&&!O.flow&&O.items.length>0){let H=O.items[0];if(x1.isPair(H))H=H.key;let X=H.commentBefore;H.commentBefore=X?`${q}
105
+ ${X}`:q}else{let H=O.commentBefore;O.commentBefore=H?`${q}
106
+ ${H}`:q}}if($){for(let O=0;O<this.errors.length;++O)_.errors.push(this.errors[O]);for(let O=0;O<this.warnings.length;++O)_.warnings.push(this.warnings[O])}else _.errors=this.errors,_.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:k1(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(_,$=!1,q=-1){for(let T of _)yield*this.next(T);yield*this.end($,q)}*next(_){if(EU.env.LOG_STREAM)console.dir(_,{depth:null});switch(_.type){case"directive":this.directives.add(_.source,($,q,T)=>{let O=_$(_);O[0]+=$,this.onError(O,"BAD_DIRECTIVE",q,T)}),this.prelude.push(_.source),this.atDirectives=!0;break;case"document":{let $=gU.composeDoc(this.options,this.directives,_,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(_,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(_.source);break;case"error":{let $=_.source?`${_.message}: ${JSON.stringify(_.source)}`:_.message,q=new e_.YAMLParseError(_$(_),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(q);else this.doc.errors.push(q);break}case"doc-end":{if(!this.doc){this.errors.push(new e_.YAMLParseError(_$(_),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=yU.resolveEnd(_.end,_.offset+_.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let q=this.doc.comment;this.doc.comment=q?`${q}
107
+ ${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new e_.YAMLParseError(_$(_),"UNEXPECTED_TOKEN",`Unsupported token ${_.type}`))}}*end(_=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(_){let q=Object.assign({_directives:this.directives},this.options),T=new bU.Document(void 0,q);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");T.range=[0,$,$],this.decorate(T,!1),yield T}}}xU.Composer=u1});var m1=V((cU)=>{var uU=Uq(),hU=Zq(),vU=o_(),h1=v_();function mU(_,$=!0,q){if(_){let T=(O,H,X)=>{let U=typeof O==="number"?O:Array.isArray(O)?O[0]:O.offset;if(q)q(U,H,X);else throw new vU.YAMLParseError([U,U+1],H,X)};switch(_.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hU.resolveFlowScalar(_,$,T);case"block-scalar":return uU.resolveBlockScalar({options:{strict:$}},_,T)}}return null}function lU(_,$){let{implicitKey:q=!1,indent:T,inFlow:O=!1,offset:H=-1,type:X="PLAIN"}=$,U=h1.stringifyString({type:X,value:_},{implicitKey:q,indent:T>0?" ".repeat(T):"",inFlow:O,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:T,source:`
108
+ `}];switch(U[0]){case"|":case">":{let Z=U.indexOf(`
109
+ `),z=U.substring(0,Z),G=U.substring(Z+1)+`
110
+ `,Q=[{type:"block-scalar-header",offset:H,indent:T,source:z}];if(!v1(Q,J))Q.push({type:"newline",offset:-1,indent:T,source:`
111
+ `});return{type:"block-scalar",offset:H,indent:T,props:Q,source:G}}case'"':return{type:"double-quoted-scalar",offset:H,indent:T,source:U,end:J};case"'":return{type:"single-quoted-scalar",offset:H,indent:T,source:U,end:J};default:return{type:"scalar",offset:H,indent:T,source:U,end:J}}}function pU(_,$,q={}){let{afterKey:T=!1,implicitKey:O=!1,inFlow:H=!1,type:X}=q,U="indent"in _?_.indent:null;if(T&&typeof U==="number")U+=2;if(!X)switch(_.type){case"single-quoted-scalar":X="QUOTE_SINGLE";break;case"double-quoted-scalar":X="QUOTE_DOUBLE";break;case"block-scalar":{let Z=_.props[0];if(Z.type!=="block-scalar-header")throw Error("Invalid block scalar header");X=Z.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:X="PLAIN"}let J=h1.stringifyString({type:X,value:$},{implicitKey:O||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":dU(_,J);break;case'"':Qq(_,J,"double-quoted-scalar");break;case"'":Qq(_,J,"single-quoted-scalar");break;default:Qq(_,J,"scalar")}}function dU(_,$){let q=$.indexOf(`
112
+ `),T=$.substring(0,q),O=$.substring(q+1)+`
113
+ `;if(_.type==="block-scalar"){let H=_.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=T,_.source=O}else{let{offset:H}=_,X="indent"in _?_.indent:-1,U=[{type:"block-scalar-header",offset:H,indent:X,source:T}];if(!v1(U,"end"in _?_.end:void 0))U.push({type:"newline",offset:-1,indent:X,source:`
114
+ `});for(let J of Object.keys(_))if(J!=="type"&&J!=="offset")delete _[J];Object.assign(_,{type:"block-scalar",indent:X,props:U,source:O})}}function v1(_,$){if($)for(let q of $)switch(q.type){case"space":case"comment":_.push(q);break;case"newline":return _.push(q),!0}return!1}function Qq(_,$,q){switch(_.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":_.type=q,_.source=$;break;case"block-scalar":{let T=_.props.slice(1),O=$.length;if(_.props[0].type==="block-scalar-header")O-=_.props[0].source.length;for(let H of T)H.offset+=O;delete _.props,Object.assign(_,{type:q,source:$,end:T});break}case"block-map":case"block-seq":{let O={type:"newline",offset:_.offset+$.length,indent:_.indent,source:`
115
+ `};delete _.items,Object.assign(_,{type:q,source:$,end:[O]});break}default:{let T="indent"in _?_.indent:-1,O="end"in _&&Array.isArray(_.end)?_.end.filter((H)=>H.type==="space"||H.type==="comment"||H.type==="newline"):[];for(let H of Object.keys(_))if(H!=="type"&&H!=="offset")delete _[H];Object.assign(_,{type:q,indent:T,source:$,end:O})}}}cU.createScalarToken=lU;cU.resolveAsScalar=mU;cU.setScalarValue=pU});var l1=V((rU)=>{var aU=(_)=>("type"in _)?r$(_):a$(_);function r$(_){switch(_.type){case"block-scalar":{let $="";for(let q of _.props)$+=r$(q);return $+_.source}case"block-map":case"block-seq":{let $="";for(let q of _.items)$+=a$(q);return $}case"flow-collection":{let $=_.start.source;for(let q of _.items)$+=a$(q);for(let q of _.end)$+=q.source;return $}case"document":{let $=a$(_);if(_.end)for(let q of _.end)$+=q.source;return $}default:{let $=_.source;if("end"in _&&_.end)for(let q of _.end)$+=q.source;return $}}}function a$({start:_,key:$,sep:q,value:T}){let O="";for(let H of _)O+=H.source;if($)O+=r$($);if(q)for(let H of q)O+=H.source;if(T)O+=r$(T);return O}rU.stringify=aU});var c1=V((eU)=>{var Wq=Symbol("break visit"),tU=Symbol("skip children"),p1=Symbol("remove item");function V_(_,$){if("type"in _&&_.type==="document")_={start:_.start,value:_.value};d1(Object.freeze([]),_,$)}V_.BREAK=Wq;V_.SKIP=tU;V_.REMOVE=p1;V_.itemAtPath=(_,$)=>{let q=_;for(let[T,O]of $){let H=q?.[T];if(H&&"items"in H)q=H.items[O];else return}return q};V_.parentCollection=(_,$)=>{let q=V_.itemAtPath(_,$.slice(0,-1)),T=$[$.length-1][0],O=q?.[T];if(O&&"items"in O)return O;throw Error("Parent collection not found")};function d1(_,$,q){let T=q($,_);if(typeof T==="symbol")return T;for(let O of["key","value"]){let H=$[O];if(H&&"items"in H){for(let X=0;X<H.items.length;++X){let U=d1(Object.freeze(_.concat([[O,X]])),H.items[X],q);if(typeof U==="number")X=U-1;else if(U===Wq)return Wq;else if(U===p1)H.items.splice(X,1),X-=1}if(typeof T==="function"&&O==="key")T=T($,_)}}return typeof T==="function"?T($,_):T}eU.visit=V_});var o$=V((UJ)=>{var Rq=m1(),$J=l1(),qJ=c1(),Yq="\uFEFF",Lq="\x02",Vq="\x18",Bq="\x1F",TJ=(_)=>!!_&&("items"in _),OJ=(_)=>!!_&&(_.type==="scalar"||_.type==="single-quoted-scalar"||_.type==="double-quoted-scalar"||_.type==="block-scalar");function HJ(_){switch(_){case Yq:return"<BOM>";case Lq:return"<DOC>";case Vq:return"<FLOW_END>";case Bq:return"<SCALAR>";default:return JSON.stringify(_)}}function XJ(_){switch(_){case Yq:return"byte-order-mark";case Lq:return"doc-mode";case Vq:return"flow-error-end";case Bq:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
116
116
  `:case`\r
117
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(u[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}rL.createScalarToken=_$.createScalarToken;rL.resolveAsScalar=_$.resolveAsScalar;rL.setScalarValue=_$.setScalarValue;rL.stringify=QL.stringify;rL.visit=NL.visit;rL.BOM=s$;rL.DOCUMENT=$$;rL.FLOW_END=w$;rL.SCALAR=f$;rL.isCollection=VL;rL.isScalar=bL;rL.prettyToken=EL;rL.tokenType=CL});var g$=D((eL)=>{var tu=d_();function y(u){switch(u){case void 0:case" ":case`
118
- `:case"\r":case"\t":return!0;default:return!1}}var Bf=new Set("0123456789ABCDEFabcdef"),vL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),n_=new Set(",[]{}"),oL=new Set(` ,[]{}
119
- \r `),i$=(u)=>!u||oL.has(u);class Zf{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(u,_=!1){if(u){if(typeof u!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+u:u,this.lineEndPos=null}this.atEnd=!_;let s=this.next??"stream";while(s&&(_||this.hasChars(1)))s=yield*this.parseNext(s)}atLineEnd(){let u=this.pos,_=this.buffer[u];while(_===" "||_==="\t")_=this.buffer[++u];if(!_||_==="#"||_===`
120
- `)return!0;if(_==="\r")return this.buffer[u+1]===`
121
- `;return!1}charAt(u){return this.buffer[this.pos+u]}continueScalar(u){let _=this.buffer[u];if(this.indentNext>0){let s=0;while(_===" ")_=this.buffer[++s+u];if(_==="\r"){let $=this.buffer[s+u+1];if($===`
122
- `||!$&&!this.atEnd)return u+s+1}return _===`
123
- `||s>=this.indentNext||!_&&!this.atEnd?u+s:-1}if(_==="-"||_==="."){let s=this.buffer.substr(u,3);if((s==="---"||s==="...")&&y(this.buffer[u+3]))return-1}return u}getLine(){let u=this.lineEndPos;if(typeof u!=="number"||u!==-1&&u<this.pos)u=this.buffer.indexOf(`
124
- `,this.pos),this.lineEndPos=u;if(u===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[u-1]==="\r")u-=1;return this.buffer.substring(this.pos,u)}hasChars(u){return this.pos+u<=this.buffer.length}setNext(u){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=u,null}peek(u){return this.buffer.substr(this.pos,u)}*parseNext(u){switch(u){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let u=this.getLine();if(u===null)return this.setNext("stream");if(u[0]===tu.BOM)yield*this.pushCount(1),u=u.substring(1);if(u[0]==="%"){let _=u.length,s=u.indexOf("#");while(s!==-1){let w=u[s-1];if(w===" "||w==="\t"){_=s-1;break}else s=u.indexOf("#",s+1)}while(!0){let w=u[_-1];if(w===" "||w==="\t")_-=1;else break}let $=(yield*this.pushCount(_))+(yield*this.pushSpaces(!0));return yield*this.pushCount(u.length-$),this.pushNewline(),"stream"}if(this.atLineEnd()){let _=yield*this.pushSpaces(!0);return yield*this.pushCount(u.length-_),yield*this.pushNewline(),"stream"}return yield tu.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let u=this.charAt(0);if(!u&&!this.atEnd)return this.setNext("line-start");if(u==="-"||u==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let _=this.peek(3);if((_==="---"||_==="...")&&y(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,_==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!y(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[u,_]=this.peek(2);if(!_&&!this.atEnd)return this.setNext("block-start");if((u==="-"||u==="?"||u===":")&&y(_)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let u=this.getLine();if(u===null)return this.setNext("doc");let _=yield*this.pushIndicators();switch(u[_]){case"#":yield*this.pushCount(u.length-_);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(i$),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return _+=yield*this.parseBlockScalarHeader(),_+=yield*this.pushSpaces(!0),yield*this.pushCount(u.length-_),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let u,_,s=-1;do{if(u=yield*this.pushNewline(),u>0)_=yield*this.pushSpaces(!1),this.indentValue=s=_;else _=0;_+=yield*this.pushSpaces(!0)}while(u+_>0);let $=this.getLine();if($===null)return this.setNext("flow");if(s!==-1&&s<this.indentNext&&$[0]!=="#"||s===0&&($.startsWith("---")||$.startsWith("..."))&&y($[3])){if(!(s===this.indentNext-1&&this.flowLevel===1&&($[0]==="]"||$[0]==="}")))return this.flowLevel=0,yield tu.FLOW_END,yield*this.parseLineStart()}let w=0;while($[w]===",")w+=yield*this.pushCount(1),w+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(w+=yield*this.pushIndicators(),$[w]){case void 0:return"flow";case"#":return yield*this.pushCount($.length-w),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(i$),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let f=this.charAt(1);if(this.flowKey||y(f)||f===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let u=this.charAt(0),_=this.buffer.indexOf(u,this.pos+1);if(u==="'")while(_!==-1&&this.buffer[_+1]==="'")_=this.buffer.indexOf("'",_+2);else while(_!==-1){let w=0;while(this.buffer[_-1-w]==="\\")w+=1;if(w%2===0)break;_=this.buffer.indexOf('"',_+1)}let s=this.buffer.substring(0,_),$=s.indexOf(`
125
- `,this.pos);if($!==-1){while($!==-1){let w=this.continueScalar($+1);if(w===-1)break;$=s.indexOf(`
126
- `,w)}if($!==-1)_=$-(s[$-1]==="\r"?2:1)}if(_===-1){if(!this.atEnd)return this.setNext("quoted-scalar");_=this.buffer.length}return yield*this.pushToIndex(_+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let u=this.pos;while(!0){let _=this.buffer[++u];if(_==="+")this.blockScalarKeep=!0;else if(_>"0"&&_<="9")this.blockScalarIndent=Number(_)-1;else if(_!=="-")break}return yield*this.pushUntil((_)=>y(_)||_==="#")}*parseBlockScalar(){let u=this.pos-1,_=0,s;u:for(let w=this.pos;s=this.buffer[w];++w)switch(s){case" ":_+=1;break;case`
127
- `:u=w,_=0;break;case"\r":{let f=this.buffer[w+1];if(!f&&!this.atEnd)return this.setNext("block-scalar");if(f===`
128
- `)break}default:break u}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(_>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=_;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let w=this.continueScalar(u+1);if(w===-1)break;u=this.buffer.indexOf(`
129
- `,w)}while(u!==-1);if(u===-1){if(!this.atEnd)return this.setNext("block-scalar");u=this.buffer.length}}let $=u+1;s=this.buffer[$];while(s===" ")s=this.buffer[++$];if(s==="\t"){while(s==="\t"||s===" "||s==="\r"||s===`
130
- `)s=this.buffer[++$];u=$-1}else if(!this.blockScalarKeep)do{let w=u-1,f=this.buffer[w];if(f==="\r")f=this.buffer[--w];let i=w;while(f===" ")f=this.buffer[--w];if(f===`
131
- `&&w>=this.pos&&w+1+_>i)u=w;else break}while(!0);return yield tu.SCALAR,yield*this.pushToIndex(u+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let u=this.flowLevel>0,_=this.pos-1,s=this.pos-1,$;while($=this.buffer[++s])if($===":"){let w=this.buffer[s+1];if(y(w)||u&&n_.has(w))break;_=s}else if(y($)){let w=this.buffer[s+1];if($==="\r")if(w===`
132
- `)s+=1,$=`
133
- `,w=this.buffer[s+1];else _=s;if(w==="#"||u&&n_.has(w))break;if($===`
134
- `){let f=this.continueScalar(s+1);if(f===-1)break;s=Math.max(s,f-2)}}else{if(u&&n_.has($))break;_=s}if(!$&&!this.atEnd)return this.setNext("plain-scalar");return yield tu.SCALAR,yield*this.pushToIndex(_+1,!0),u?"flow":"doc"}*pushCount(u){if(u>0)return yield this.buffer.substr(this.pos,u),this.pos+=u,u;return 0}*pushToIndex(u,_){let s=this.buffer.slice(this.pos,u);if(s)return yield s,this.pos+=s.length,s.length;else if(_)yield"";return 0}*pushIndicators(){let u=0;u:while(!0){switch(this.charAt(0)){case"!":u+=yield*this.pushTag(),u+=yield*this.pushSpaces(!0);continue u;case"&":u+=yield*this.pushUntil(i$),u+=yield*this.pushSpaces(!0);continue u;case"-":case"?":case":":{let _=this.flowLevel>0,s=this.charAt(1);if(y(s)||_&&n_.has(s)){if(!_)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;u+=yield*this.pushCount(1),u+=yield*this.pushSpaces(!0);continue u}}}break u}return u}*pushTag(){if(this.charAt(1)==="<"){let u=this.pos+2,_=this.buffer[u];while(!y(_)&&_!==">")_=this.buffer[++u];return yield*this.pushToIndex(_===">"?u+1:u,!1)}else{let u=this.pos+1,_=this.buffer[u];while(_)if(vL.has(_))_=this.buffer[++u];else if(_==="%"&&Bf.has(this.buffer[u+1])&&Bf.has(this.buffer[u+2]))_=this.buffer[u+=3];else break;return yield*this.pushToIndex(u,!1)}}*pushNewline(){let u=this.buffer[this.pos];if(u===`
135
- `)return yield*this.pushCount(1);else if(u==="\r"&&this.charAt(1)===`
136
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(u){let _=this.pos-1,s;do s=this.buffer[++_];while(s===" "||u&&s==="\t");let $=_-this.pos;if($>0)yield this.buffer.substr(this.pos,$),this.pos=_;return $}*pushUntil(u){let _=this.pos,s=this.buffer[_];while(!u(s))s=this.buffer[++_];return yield*this.pushToIndex(_,!1)}}eL.Lexer=Zf});var R$=D((_1)=>{class Mf{constructor(){this.lineStarts=[],this.addNewLine=(u)=>this.lineStarts.push(u),this.linePos=(u)=>{let _=0,s=this.lineStarts.length;while(_<s){let w=_+s>>1;if(this.lineStarts[w]<u)_=w+1;else s=w}if(this.lineStarts[_]===u)return{line:_+1,col:1};if(_===0)return{line:0,col:u};let $=this.lineStarts[_-1];return{line:_,col:u-$+1}}}}_1.LineCounter=Mf});var S$=D((f1)=>{var $1=s_("process"),jf=d_(),w1=g$();function $u(u,_){for(let s=0;s<u.length;++s)if(u[s].type===_)return!0;return!1}function Qf(u){for(let _=0;_<u.length;++_)switch(u[_].type){case"space":case"comment":case"newline":break;default:return _}return-1}function Vf(u){switch(u?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function h_(u){switch(u.type){case"document":return u.start;case"block-map":{let _=u.items[u.items.length-1];return _.sep??_.start}case"block-seq":return u.items[u.items.length-1].start;default:return[]}}function Ju(u){if(u.length===0)return[];let _=u.length;u:while(--_>=0)switch(u[_].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break u}while(u[++_]?.type==="space");return u.splice(_,u.length)}function m_(u,_){if(_.length<1e5)Array.prototype.push.apply(u,_);else for(let s=0;s<_.length;++s)u.push(_[s])}function Nf(u){if(u.start.type==="flow-seq-start"){for(let _ of u.items)if(_.sep&&!_.value&&!$u(_.start,"explicit-key-ind")&&!$u(_.sep,"map-value-ind")){if(_.key)_.value=_.key;if(delete _.key,Vf(_.value))if(_.value.end)m_(_.value.end,_.sep);else _.value.end=_.sep;else m_(_.start,_.sep);delete _.sep}}}class bf{constructor(u){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new w1.Lexer,this.onNewLine=u}*parse(u,_=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let s of this.lexer.lex(u,_))yield*this.next(s);if(!_)yield*this.end()}*next(u){if(this.source=u,$1.env.LOG_TOKENS)console.log("|",jf.prettyToken(u));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=u.length;return}let _=jf.tokenType(u);if(!_){let s=`Not a YAML token: ${u}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:u}),this.offset+=u.length}else if(_==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=_,yield*this.step(),_){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+u.length);break;case"space":if(this.atNewLine&&u[0]===" ")this.indent+=u.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=u.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=u.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let u=this.peek(1);if(this.type==="doc-end"&&u?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!u)return yield*this.stream();switch(u.type){case"document":return yield*this.document(u);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(u);case"block-scalar":return yield*this.blockScalar(u);case"block-map":return yield*this.blockMap(u);case"block-seq":return yield*this.blockSequence(u);case"flow-collection":return yield*this.flowCollection(u);case"doc-end":return yield*this.documentEnd(u)}yield*this.pop()}peek(u){return this.stack[this.stack.length-u]}*pop(u){let _=u??this.stack.pop();if(!_)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield _;else{let s=this.peek(1);if(_.type==="block-scalar")_.indent="indent"in s?s.indent:0;else if(_.type==="flow-collection"&&s.type==="document")_.indent=0;if(_.type==="flow-collection")Nf(_);switch(s.type){case"document":s.value=_;break;case"block-scalar":s.props.push(_);break;case"block-map":{let $=s.items[s.items.length-1];if($.value){s.items.push({start:[],key:_,sep:[]}),this.onKeyLine=!0;return}else if($.sep)$.value=_;else{Object.assign($,{key:_,sep:[]}),this.onKeyLine=!$.explicitKey;return}break}case"block-seq":{let $=s.items[s.items.length-1];if($.value)s.items.push({start:[],value:_});else $.value=_;break}case"flow-collection":{let $=s.items[s.items.length-1];if(!$||$.value)s.items.push({start:[],key:_,sep:[]});else if($.sep)$.value=_;else Object.assign($,{key:_,sep:[]});return}default:yield*this.pop(),yield*this.pop(_)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(_.type==="block-map"||_.type==="block-seq")){let $=_.items[_.items.length-1];if($&&!$.sep&&!$.value&&$.start.length>0&&Qf($.start)===-1&&(_.indent===0||$.start.every((w)=>w.type!=="comment"||w.indent<_.indent))){if(s.type==="document")s.end=$.start;else s.items.push({start:$.start});_.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let u={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")u.start.push(this.sourceToken);this.stack.push(u);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(u){if(u.value)return yield*this.lineEnd(u);switch(this.type){case"doc-start":{if(Qf(u.start)!==-1)yield*this.pop(),yield*this.step();else u.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":u.start.push(this.sourceToken);return}let _=this.startBlockValue(u);if(_)this.stack.push(_);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(u){if(this.type==="map-value-ind"){let _=h_(this.peek(2)),s=Ju(_),$;if(u.end)$=u.end,$.push(this.sourceToken),delete u.end;else $=[this.sourceToken];let w={type:"block-map",offset:u.offset,indent:u.indent,items:[{start:s,key:u,sep:$}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=w}else yield*this.lineEnd(u)}*blockScalar(u){switch(this.type){case"space":case"comment":case"newline":u.props.push(this.sourceToken);return;case"scalar":if(u.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let _=this.source.indexOf(`
137
- `)+1;while(_!==0)this.onNewLine(this.offset+_),_=this.source.indexOf(`
138
- `,_)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(u){let _=u.items[u.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,_.value){let s="end"in _.value?_.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else u.items.push({start:[this.sourceToken]})}else if(_.sep)_.sep.push(this.sourceToken);else _.start.push(this.sourceToken);return;case"space":case"comment":if(_.value)u.items.push({start:[this.sourceToken]});else if(_.sep)_.sep.push(this.sourceToken);else{if(this.atIndentedComment(_.start,u.indent)){let $=u.items[u.items.length-2]?.value?.end;if(Array.isArray($)){m_($,_.start),$.push(this.sourceToken),u.items.pop();return}}_.start.push(this.sourceToken)}return}if(this.indent>=u.indent){let s=!this.onKeyLine&&this.indent===u.indent,$=s&&(_.sep||_.explicitKey)&&this.type!=="seq-item-ind",w=[];if($&&_.sep&&!_.value){let f=[];for(let i=0;i<_.sep.length;++i){let g=_.sep[i];switch(g.type){case"newline":f.push(i);break;case"space":break;case"comment":if(g.indent>u.indent)f.length=0;break;default:f.length=0}}if(f.length>=2)w=_.sep.splice(f[1])}switch(this.type){case"anchor":case"tag":if($||_.value)w.push(this.sourceToken),u.items.push({start:w}),this.onKeyLine=!0;else if(_.sep)_.sep.push(this.sourceToken);else _.start.push(this.sourceToken);return;case"explicit-key-ind":if(!_.sep&&!_.explicitKey)_.start.push(this.sourceToken),_.explicitKey=!0;else if($||_.value)w.push(this.sourceToken),u.items.push({start:w,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(_.explicitKey)if(!_.sep)if($u(_.start,"newline"))Object.assign(_,{key:null,sep:[this.sourceToken]});else{let f=Ju(_.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]})}else if(_.value)u.items.push({start:[],key:null,sep:[this.sourceToken]});else if($u(_.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,key:null,sep:[this.sourceToken]}]});else if(Vf(_.key)&&!$u(_.sep,"newline")){let f=Ju(_.start),i=_.key,g=_.sep;g.push(this.sourceToken),delete _.key,delete _.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:i,sep:g}]})}else if(w.length>0)_.sep=_.sep.concat(w,this.sourceToken);else _.sep.push(this.sourceToken);else if(!_.sep)Object.assign(_,{key:null,sep:[this.sourceToken]});else if(_.value||$)u.items.push({start:w,key:null,sep:[this.sourceToken]});else if($u(_.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else _.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let f=this.flowScalar(this.type);if($||_.value)u.items.push({start:w,key:f,sep:[]}),this.onKeyLine=!0;else if(_.sep)this.stack.push(f);else Object.assign(_,{key:f,sep:[]}),this.onKeyLine=!0;return}default:{let f=this.startBlockValue(u);if(f){if(f.type==="block-seq"){if(!_.explicitKey&&_.sep&&!$u(_.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(s)u.items.push({start:w});this.stack.push(f);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(u){let _=u.items[u.items.length-1];switch(this.type){case"newline":if(_.value){let s="end"in _.value?_.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else u.items.push({start:[this.sourceToken]})}else _.start.push(this.sourceToken);return;case"space":case"comment":if(_.value)u.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(_.start,u.indent)){let $=u.items[u.items.length-2]?.value?.end;if(Array.isArray($)){m_($,_.start),$.push(this.sourceToken),u.items.pop();return}}_.start.push(this.sourceToken)}return;case"anchor":case"tag":if(_.value||this.indent<=u.indent)break;_.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==u.indent)break;if(_.value||$u(_.start,"seq-item-ind"))u.items.push({start:[this.sourceToken]});else _.start.push(this.sourceToken);return}if(this.indent>u.indent){let s=this.startBlockValue(u);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(u){let _=u.items[u.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(u.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!_||_.sep)u.items.push({start:[this.sourceToken]});else _.start.push(this.sourceToken);return;case"map-value-ind":if(!_||_.value)u.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_.sep)_.sep.push(this.sourceToken);else Object.assign(_,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!_||_.value)u.items.push({start:[this.sourceToken]});else if(_.sep)_.sep.push(this.sourceToken);else _.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let $=this.flowScalar(this.type);if(!_||_.value)u.items.push({start:[],key:$,sep:[]});else if(_.sep)this.stack.push($);else Object.assign(_,{key:$,sep:[]});return}case"flow-map-end":case"flow-seq-end":u.end.push(this.sourceToken);return}let s=this.startBlockValue(u);if(s)this.stack.push(s);else yield*this.pop(),yield*this.step()}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===u.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let $=h_(s),w=Ju($);Nf(u);let f=u.end.splice(1,u.end.length);f.push(this.sourceToken);let i={type:"block-map",offset:u.offset,indent:u.indent,items:[{start:w,key:u,sep:f}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(u)}}flowScalar(u){if(this.onNewLine){let _=this.source.indexOf(`
139
- `)+1;while(_!==0)this.onNewLine(this.offset+_),_=this.source.indexOf(`
140
- `,_)+1}return{type:u,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(u){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let _=h_(u),s=Ju(_);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let _=h_(u),s=Ju(_);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(u,_){if(this.type!=="comment")return!1;if(this.indent<=_)return!1;return u.every((s)=>s.type==="newline"||s.type==="space")}*documentEnd(u){if(this.type!=="doc-mode"){if(u.end)u.end.push(this.sourceToken);else u.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(u){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(u.end)u.end.push(this.sourceToken);else u.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}f1.Parser=bf});var Kf=D((O1)=>{var Ef=os(),g1=cu(),vu=xu(),R1=Rs(),S1=X(),I1=R$(),Cf=S$();function rf(u){let _=u.prettyErrors!==!1;return{lineCounter:u.lineCounter||_&&new I1.LineCounter||null,prettyErrors:_}}function T1(u,_={}){let{lineCounter:s,prettyErrors:$}=rf(_),w=new Cf.Parser(s?.addNewLine),f=new Ef.Composer(_),i=Array.from(f.compose(w.parse(u)));if($&&s)for(let g of i)g.errors.forEach(vu.prettifyError(u,s)),g.warnings.forEach(vu.prettifyError(u,s));if(i.length>0)return i;return Object.assign([],{empty:!0},f.streamInfo())}function lf(u,_={}){let{lineCounter:s,prettyErrors:$}=rf(_),w=new Cf.Parser(s?.addNewLine),f=new Ef.Composer(_),i=null;for(let g of f.compose(w.parse(u),!0,u.length))if(!i)i=g;else if(i.options.logLevel!=="silent"){i.errors.push(new vu.YAMLParseError(g.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if($&&s)i.errors.forEach(vu.prettifyError(u,s)),i.warnings.forEach(vu.prettifyError(u,s));return i}function q1(u,_,s){let $=void 0;if(typeof _==="function")$=_;else if(s===void 0&&_&&typeof _==="object")s=_;let w=lf(u,s);if(!w)return null;if(w.warnings.forEach((f)=>R1.warn(w.options.logLevel,f)),w.errors.length>0)if(w.options.logLevel!=="silent")throw w.errors[0];else w.errors=[];return w.toJS(Object.assign({reviver:$},s))}function L1(u,_,s){let $=null;if(typeof _==="function"||Array.isArray(_))$=_;else if(s===void 0&&_)s=_;if(typeof s==="string")s=s.length;if(typeof s==="number"){let w=Math.round(s);s=w<1?void 0:w>8?{indent:8}:{indent:w}}if(u===void 0){let{keepUndefined:w}=s??_??{};if(!w)return}if(S1.isDocument(u)&&!$)return u.toString(s);return new g1.Document(u,$,s).toString(s)}O1.parse=q1;O1.parseAllDocuments=T1;O1.parseDocument=lf;O1.stringify=L1});import{existsSync as Z$,mkdirSync as e_,readFileSync as _g,writeFileSync as M$}from"node:fs";import{dirname as sg,isAbsolute as BU,join as $g,resolve as ZU}from"node:path";var A1=os(),F1=cu(),z1=Cs(),I$=xu(),Y1=Qu(),wu=X(),G1=e(),W1=B(),X1=_u(),J1=su(),aH=d_(),B1=g$(),Z1=R$(),M1=S$(),c_=Kf(),yf=Mu();var j1=A1.Composer,Q1=F1.Document,N1=z1.Schema,V1=I$.YAMLError,b1=I$.YAMLParseError,E1=I$.YAMLWarning,C1=Y1.Alias,r1=wu.isAlias,l1=wu.isCollection,K1=wu.isDocument,y1=wu.isMap,d1=wu.isNode,n1=wu.isPair,h1=wu.isScalar,m1=wu.isSeq,c1=G1.Pair,x1=W1.Scalar,k1=X1.YAMLMap,p1=J1.YAMLSeq;var a1=B1.Lexer,t1=Z1.LineCounter,v1=M1.Parser,x_=c_.parse,o1=c_.parseAllDocuments,e1=c_.parseDocument,T$=c_.stringify,uO=yf.visit,_O=yf.visitAsync;var sO=new Set(["none","low","medium","high"]),$O=new Set(["low","medium","high"]);function k_(u,_){if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`${_} must be an object`);return u}function p(u,_,s=_){let $=u[_];if(typeof $!=="string"||$.trim()==="")throw Error(`Missing required string: ${s}`);return $}function df(u){if(!("confidence"in u))return null;let _=u.confidence;if(typeof _!=="string"||!$O.has(_))throw Error(`Invalid confidence: ${String(_)}`);return _}function nf(u){let _=k_(x_(u),"summaries.yaml"),s=p(_,"project_id");if(!Array.isArray(_.summaries))throw Error("summaries must be an array");return{projectId:s,summaries:_.summaries.map(($,w)=>{let f=`summaries[${w}]`,i=k_($,`summaries[${w}]`),g=p(i,"value",`${f}.value`);if(!sO.has(g))throw Error(`Invalid summary value: ${g}`);return df(i),{sessionId:p(i,"session_id",`${f}.session_id`),title:p(i,"title",`${f}.title`),value:g,summaryMarkdown:p(i,"summary_markdown",`${f}.summary_markdown`),metadata:i}})}}function hf(u){let _=k_(x_(u),"experiences.yaml"),s=p(_,"project_id");if(!Array.isArray(_.experiences))throw Error("experiences must be an array");return{projectId:s,experiences:_.experiences.map(($,w)=>{let f=`experiences[${w}]`,i=k_($,f),g=i.source_sessions;if(!Array.isArray(g)||g.some((S)=>typeof S!=="string"))throw Error(`experiences[${w}].source_sessions must be a string array`);let R=df(i);return{title:p(i,"title",`${f}.title`),slug:typeof i.slug==="string"?i.slug:null,summary:p(i,"summary",`${f}.summary`),bodyMarkdown:p(i,"body_markdown",`${f}.body_markdown`),sourceSessions:g,confidence:R,metadata:i}})}}import{existsSync as mf,readFileSync as cf,writeFileSync as wO}from"node:fs";var fO={"obsidian.vault":"obsidian_vault",obsidian_vault:"obsidian_vault"};function iO(u){let _={};for(let s of u.split(`
141
- `)){let $=s.trim();if($===""||$.startsWith("#")||$.startsWith("["))continue;let w=$.match(/^([\w.]+)\s*=\s*(.*)$/);if(!w)continue;let f=w[1],i=w[2].trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))i=i.slice(1,-1);_[f]=i}return _}function q$(u){if(!mf(u))return{obsidianVault:null};let s=iO(cf(u,"utf8")).obsidian_vault;return{obsidianVault:s&&s.trim()!==""?s:null}}function xf(u,_,s){let $=fO[_];if(!$)throw Error(`Unknown config key: ${_}. Supported: obsidian.vault`);let f=(mf(u)?cf(u,"utf8"):"").split(`
142
- `),i=`${$} = "${s}"`,g=!1,R=f.map((S)=>{if(S.trim().startsWith(`${$} `)||S.trim().startsWith(`${$}=`))return g=!0,i;return S});if(!g)R.push(i);return wO(u,`${R.filter((S,L)=>!(S===""&&L===R.length-1)).join(`
117
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(_[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}UJ.createScalarToken=Rq.createScalarToken;UJ.resolveAsScalar=Rq.resolveAsScalar;UJ.setScalarValue=Rq.setScalarValue;UJ.stringify=$J.stringify;UJ.visit=qJ.visit;UJ.BOM=Yq;UJ.DOCUMENT=Lq;UJ.FLOW_END=Vq;UJ.SCALAR=Bq;UJ.isCollection=TJ;UJ.isScalar=OJ;UJ.prettyToken=HJ;UJ.tokenType=XJ});var Aq=V((IJ)=>{var $$=o$();function m(_){switch(_){case void 0:case" ":case`
118
+ `:case"\r":case"\t":return!0;default:return!1}}var s1=new Set("0123456789ABCDEFabcdef"),DJ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),t$=new Set(",[]{}"),MJ=new Set(` ,[]{}
119
+ \r `),wq=(_)=>!_||MJ.has(_);class i1{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(_,$=!1){if(_){if(typeof _!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+_:_,this.lineEndPos=null}this.atEnd=!$;let q=this.next??"stream";while(q&&($||this.hasChars(1)))q=yield*this.parseNext(q)}atLineEnd(){let _=this.pos,$=this.buffer[_];while($===" "||$==="\t")$=this.buffer[++_];if(!$||$==="#"||$===`
120
+ `)return!0;if($==="\r")return this.buffer[_+1]===`
121
+ `;return!1}charAt(_){return this.buffer[this.pos+_]}continueScalar(_){let $=this.buffer[_];if(this.indentNext>0){let q=0;while($===" ")$=this.buffer[++q+_];if($==="\r"){let T=this.buffer[q+_+1];if(T===`
122
+ `||!T&&!this.atEnd)return _+q+1}return $===`
123
+ `||q>=this.indentNext||!$&&!this.atEnd?_+q:-1}if($==="-"||$==="."){let q=this.buffer.substr(_,3);if((q==="---"||q==="...")&&m(this.buffer[_+3]))return-1}return _}getLine(){let _=this.lineEndPos;if(typeof _!=="number"||_!==-1&&_<this.pos)_=this.buffer.indexOf(`
124
+ `,this.pos),this.lineEndPos=_;if(_===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[_-1]==="\r")_-=1;return this.buffer.substring(this.pos,_)}hasChars(_){return this.pos+_<=this.buffer.length}setNext(_){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=_,null}peek(_){return this.buffer.substr(this.pos,_)}*parseNext(_){switch(_){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let _=this.getLine();if(_===null)return this.setNext("stream");if(_[0]===$$.BOM)yield*this.pushCount(1),_=_.substring(1);if(_[0]==="%"){let $=_.length,q=_.indexOf("#");while(q!==-1){let O=_[q-1];if(O===" "||O==="\t"){$=q-1;break}else q=_.indexOf("#",q+1)}while(!0){let O=_[$-1];if(O===" "||O==="\t")$-=1;else break}let T=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(_.length-T),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(_.length-$),yield*this.pushNewline(),"stream"}return yield $$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let _=this.charAt(0);if(!_&&!this.atEnd)return this.setNext("line-start");if(_==="-"||_==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&m(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!m(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[_,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((_==="-"||_==="?"||_===":")&&m($)){let q=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=q,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let _=this.getLine();if(_===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(_[$]){case"#":yield*this.pushCount(_.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(wq),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(_.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let _,$,q=-1;do{if(_=yield*this.pushNewline(),_>0)$=yield*this.pushSpaces(!1),this.indentValue=q=$;else $=0;$+=yield*this.pushSpaces(!0)}while(_+$>0);let T=this.getLine();if(T===null)return this.setNext("flow");if(q!==-1&&q<this.indentNext&&T[0]!=="#"||q===0&&(T.startsWith("---")||T.startsWith("..."))&&m(T[3])){if(!(q===this.indentNext-1&&this.flowLevel===1&&(T[0]==="]"||T[0]==="}")))return this.flowLevel=0,yield $$.FLOW_END,yield*this.parseLineStart()}let O=0;while(T[O]===",")O+=yield*this.pushCount(1),O+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(O+=yield*this.pushIndicators(),T[O]){case void 0:return"flow";case"#":return yield*this.pushCount(T.length-O),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(wq),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||m(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let _=this.charAt(0),$=this.buffer.indexOf(_,this.pos+1);if(_==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let O=0;while(this.buffer[$-1-O]==="\\")O+=1;if(O%2===0)break;$=this.buffer.indexOf('"',$+1)}let q=this.buffer.substring(0,$),T=q.indexOf(`
125
+ `,this.pos);if(T!==-1){while(T!==-1){let O=this.continueScalar(T+1);if(O===-1)break;T=q.indexOf(`
126
+ `,O)}if(T!==-1)$=T-(q[T-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let _=this.pos;while(!0){let $=this.buffer[++_];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>m($)||$==="#")}*parseBlockScalar(){let _=this.pos-1,$=0,q;_:for(let O=this.pos;q=this.buffer[O];++O)switch(q){case" ":$+=1;break;case`
127
+ `:_=O,$=0;break;case"\r":{let H=this.buffer[O+1];if(!H&&!this.atEnd)return this.setNext("block-scalar");if(H===`
128
+ `)break}default:break _}if(!q&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let O=this.continueScalar(_+1);if(O===-1)break;_=this.buffer.indexOf(`
129
+ `,O)}while(_!==-1);if(_===-1){if(!this.atEnd)return this.setNext("block-scalar");_=this.buffer.length}}let T=_+1;q=this.buffer[T];while(q===" ")q=this.buffer[++T];if(q==="\t"){while(q==="\t"||q===" "||q==="\r"||q===`
130
+ `)q=this.buffer[++T];_=T-1}else if(!this.blockScalarKeep)do{let O=_-1,H=this.buffer[O];if(H==="\r")H=this.buffer[--O];let X=O;while(H===" ")H=this.buffer[--O];if(H===`
131
+ `&&O>=this.pos&&O+1+$>X)_=O;else break}while(!0);return yield $$.SCALAR,yield*this.pushToIndex(_+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let _=this.flowLevel>0,$=this.pos-1,q=this.pos-1,T;while(T=this.buffer[++q])if(T===":"){let O=this.buffer[q+1];if(m(O)||_&&t$.has(O))break;$=q}else if(m(T)){let O=this.buffer[q+1];if(T==="\r")if(O===`
132
+ `)q+=1,T=`
133
+ `,O=this.buffer[q+1];else $=q;if(O==="#"||_&&t$.has(O))break;if(T===`
134
+ `){let H=this.continueScalar(q+1);if(H===-1)break;q=Math.max(q,H-2)}}else{if(_&&t$.has(T))break;$=q}if(!T&&!this.atEnd)return this.setNext("plain-scalar");return yield $$.SCALAR,yield*this.pushToIndex($+1,!0),_?"flow":"doc"}*pushCount(_){if(_>0)return yield this.buffer.substr(this.pos,_),this.pos+=_,_;return 0}*pushToIndex(_,$){let q=this.buffer.slice(this.pos,_);if(q)return yield q,this.pos+=q.length,q.length;else if($)yield"";return 0}*pushIndicators(){let _=0;_:while(!0){switch(this.charAt(0)){case"!":_+=yield*this.pushTag(),_+=yield*this.pushSpaces(!0);continue _;case"&":_+=yield*this.pushUntil(wq),_+=yield*this.pushSpaces(!0);continue _;case"-":case"?":case":":{let $=this.flowLevel>0,q=this.charAt(1);if(m(q)||$&&t$.has(q)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;_+=yield*this.pushCount(1),_+=yield*this.pushSpaces(!0);continue _}}}break _}return _}*pushTag(){if(this.charAt(1)==="<"){let _=this.pos+2,$=this.buffer[_];while(!m($)&&$!==">")$=this.buffer[++_];return yield*this.pushToIndex($===">"?_+1:_,!1)}else{let _=this.pos+1,$=this.buffer[_];while($)if(DJ.has($))$=this.buffer[++_];else if($==="%"&&s1.has(this.buffer[_+1])&&s1.has(this.buffer[_+2]))$=this.buffer[_+=3];else break;return yield*this.pushToIndex(_,!1)}}*pushNewline(){let _=this.buffer[this.pos];if(_===`
135
+ `)return yield*this.pushCount(1);else if(_==="\r"&&this.charAt(1)===`
136
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(_){let $=this.pos-1,q;do q=this.buffer[++$];while(q===" "||_&&q==="\t");let T=$-this.pos;if(T>0)yield this.buffer.substr(this.pos,T),this.pos=$;return T}*pushUntil(_){let $=this.pos,q=this.buffer[$];while(!_(q))q=this.buffer[++$];return yield*this.pushToIndex($,!1)}}IJ.Lexer=i1});var Dq=V((SJ)=>{class n1{constructor(){this.lineStarts=[],this.addNewLine=(_)=>this.lineStarts.push(_),this.linePos=(_)=>{let $=0,q=this.lineStarts.length;while($<q){let O=$+q>>1;if(this.lineStarts[O]<_)$=O+1;else q=O}if(this.lineStarts[$]===_)return{line:$+1,col:1};if($===0)return{line:0,col:_};let T=this.lineStarts[$-1];return{line:$,col:_-T+1}}}}SJ.LineCounter=n1});var Mq=V((PJ)=>{var NJ=Q$("process"),a1=o$(),CJ=Aq();function X_(_,$){for(let q=0;q<_.length;++q)if(_[q].type===$)return!0;return!1}function r1(_){for(let $=0;$<_.length;++$)switch(_[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function t1(_){switch(_?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function e$(_){switch(_.type){case"document":return _.start;case"block-map":{let $=_.items[_.items.length-1];return $.sep??$.start}case"block-seq":return _.items[_.items.length-1].start;default:return[]}}function E_(_){if(_.length===0)return[];let $=_.length;_:while(--$>=0)switch(_[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break _}while(_[++$]?.type==="space");return _.splice($,_.length)}function _0(_,$){if($.length<1e5)Array.prototype.push.apply(_,$);else for(let q=0;q<$.length;++q)_.push($[q])}function o1(_){if(_.start.type==="flow-seq-start"){for(let $ of _.items)if($.sep&&!$.value&&!X_($.start,"explicit-key-ind")&&!X_($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,t1($.value))if($.value.end)_0($.value.end,$.sep);else $.value.end=$.sep;else _0($.start,$.sep);delete $.sep}}}class e1{constructor(_){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new CJ.Lexer,this.onNewLine=_}*parse(_,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let q of this.lexer.lex(_,$))yield*this.next(q);if(!$)yield*this.end()}*next(_){if(this.source=_,NJ.env.LOG_TOKENS)console.log("|",a1.prettyToken(_));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=_.length;return}let $=a1.tokenType(_);if(!$){let q=`Not a YAML token: ${_}`;yield*this.pop({type:"error",offset:this.offset,message:q,source:_}),this.offset+=_.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+_.length);break;case"space":if(this.atNewLine&&_[0]===" ")this.indent+=_.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=_.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=_.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let _=this.peek(1);if(this.type==="doc-end"&&_?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!_)return yield*this.stream();switch(_.type){case"document":return yield*this.document(_);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(_);case"block-scalar":return yield*this.blockScalar(_);case"block-map":return yield*this.blockMap(_);case"block-seq":return yield*this.blockSequence(_);case"flow-collection":return yield*this.flowCollection(_);case"doc-end":return yield*this.documentEnd(_)}yield*this.pop()}peek(_){return this.stack[this.stack.length-_]}*pop(_){let $=_??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let q=this.peek(1);if($.type==="block-scalar")$.indent="indent"in q?q.indent:0;else if($.type==="flow-collection"&&q.type==="document")$.indent=0;if($.type==="flow-collection")o1($);switch(q.type){case"document":q.value=$;break;case"block-scalar":q.props.push($);break;case"block-map":{let T=q.items[q.items.length-1];if(T.value){q.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(T.sep)T.value=$;else{Object.assign(T,{key:$,sep:[]}),this.onKeyLine=!T.explicitKey;return}break}case"block-seq":{let T=q.items[q.items.length-1];if(T.value)q.items.push({start:[],value:$});else T.value=$;break}case"flow-collection":{let T=q.items[q.items.length-1];if(!T||T.value)q.items.push({start:[],key:$,sep:[]});else if(T.sep)T.value=$;else Object.assign(T,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((q.type==="document"||q.type==="block-map"||q.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let T=$.items[$.items.length-1];if(T&&!T.sep&&!T.value&&T.start.length>0&&r1(T.start)===-1&&($.indent===0||T.start.every((O)=>O.type!=="comment"||O.indent<$.indent))){if(q.type==="document")q.end=T.start;else q.items.push({start:T.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let _={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")_.start.push(this.sourceToken);this.stack.push(_);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(_){if(_.value)return yield*this.lineEnd(_);switch(this.type){case"doc-start":{if(r1(_.start)!==-1)yield*this.pop(),yield*this.step();else _.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":_.start.push(this.sourceToken);return}let $=this.startBlockValue(_);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(_){if(this.type==="map-value-ind"){let $=e$(this.peek(2)),q=E_($),T;if(_.end)T=_.end,T.push(this.sourceToken),delete _.end;else T=[this.sourceToken];let O={type:"block-map",offset:_.offset,indent:_.indent,items:[{start:q,key:_,sep:T}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=O}else yield*this.lineEnd(_)}*blockScalar(_){switch(this.type){case"space":case"comment":case"newline":_.props.push(this.sourceToken);return;case"scalar":if(_.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
137
+ `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
138
+ `,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(_){let $=_.items[_.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let q="end"in $.value?$.value.end:void 0;if((Array.isArray(q)?q[q.length-1]:void 0)?.type==="comment")q?.push(this.sourceToken);else _.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)_.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,_.indent)){let T=_.items[_.items.length-2]?.value?.end;if(Array.isArray(T)){_0(T,$.start),T.push(this.sourceToken),_.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=_.indent){let q=!this.onKeyLine&&this.indent===_.indent,T=q&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",O=[];if(T&&$.sep&&!$.value){let H=[];for(let X=0;X<$.sep.length;++X){let U=$.sep[X];switch(U.type){case"newline":H.push(X);break;case"space":break;case"comment":if(U.indent>_.indent)H.length=0;break;default:H.length=0}}if(H.length>=2)O=$.sep.splice(H[1])}switch(this.type){case"anchor":case"tag":if(T||$.value)O.push(this.sourceToken),_.items.push({start:O}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(T||$.value)O.push(this.sourceToken),_.items.push({start:O,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(X_($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let H=E_($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]})}else if($.value)_.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X_($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:O,key:null,sep:[this.sourceToken]}]});else if(t1($.key)&&!X_($.sep,"newline")){let H=E_($.start),X=$.key,U=$.sep;U.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:X,sep:U}]})}else if(O.length>0)$.sep=$.sep.concat(O,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||T)_.items.push({start:O,key:null,sep:[this.sourceToken]});else if(X_($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(T||$.value)_.items.push({start:O,key:H,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(H);else Object.assign($,{key:H,sep:[]}),this.onKeyLine=!0;return}default:{let H=this.startBlockValue(_);if(H){if(H.type==="block-seq"){if(!$.explicitKey&&$.sep&&!X_($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(q)_.items.push({start:O});this.stack.push(H);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(_){let $=_.items[_.items.length-1];switch(this.type){case"newline":if($.value){let q="end"in $.value?$.value.end:void 0;if((Array.isArray(q)?q[q.length-1]:void 0)?.type==="comment")q?.push(this.sourceToken);else _.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)_.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,_.indent)){let T=_.items[_.items.length-2]?.value?.end;if(Array.isArray(T)){_0(T,$.start),T.push(this.sourceToken),_.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=_.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==_.indent)break;if($.value||X_($.start,"seq-item-ind"))_.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>_.indent){let q=this.startBlockValue(_);if(q){this.stack.push(q);return}}yield*this.pop(),yield*this.step()}*flowCollection(_){let $=_.items[_.items.length-1];if(this.type==="flow-error-end"){let q;do yield*this.pop(),q=this.peek(1);while(q?.type==="flow-collection")}else if(_.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)_.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)_.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)_.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let T=this.flowScalar(this.type);if(!$||$.value)_.items.push({start:[],key:T,sep:[]});else if($.sep)this.stack.push(T);else Object.assign($,{key:T,sep:[]});return}case"flow-map-end":case"flow-seq-end":_.end.push(this.sourceToken);return}let q=this.startBlockValue(_);if(q)this.stack.push(q);else yield*this.pop(),yield*this.step()}else{let q=this.peek(2);if(q.type==="block-map"&&(this.type==="map-value-ind"&&q.indent===_.indent||this.type==="newline"&&!q.items[q.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&q.type!=="flow-collection"){let T=e$(q),O=E_(T);o1(_);let H=_.end.splice(1,_.end.length);H.push(this.sourceToken);let X={type:"block-map",offset:_.offset,indent:_.indent,items:[{start:O,key:_,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd(_)}}flowScalar(_){if(this.onNewLine){let $=this.source.indexOf(`
139
+ `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
140
+ `,$)+1}return{type:_,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(_){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=e$(_),q=E_($);return q.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=e$(_),q=E_($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(_,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return _.every((q)=>q.type==="newline"||q.type==="space")}*documentEnd(_){if(this.type!=="doc-mode"){if(_.end)_.end.push(this.sourceToken);else _.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(_){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(_.end)_.end.push(this.sourceToken);else _.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}PJ.Parser=e1});var OO=V((uJ)=>{var _O=Gq(),EJ=r_(),q$=o_(),jJ=D0(),bJ=S(),gJ=Dq(),$O=Mq();function qO(_){let $=_.prettyErrors!==!1;return{lineCounter:_.lineCounter||$&&new gJ.LineCounter||null,prettyErrors:$}}function yJ(_,$={}){let{lineCounter:q,prettyErrors:T}=qO($),O=new $O.Parser(q?.addNewLine),H=new _O.Composer($),X=Array.from(H.compose(O.parse(_)));if(T&&q)for(let U of X)U.errors.forEach(q$.prettifyError(_,q)),U.warnings.forEach(q$.prettifyError(_,q));if(X.length>0)return X;return Object.assign([],{empty:!0},H.streamInfo())}function TO(_,$={}){let{lineCounter:q,prettyErrors:T}=qO($),O=new $O.Parser(q?.addNewLine),H=new _O.Composer($),X=null;for(let U of H.compose(O.parse(_),!0,_.length))if(!X)X=U;else if(X.options.logLevel!=="silent"){X.errors.push(new q$.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(T&&q)X.errors.forEach(q$.prettifyError(_,q)),X.warnings.forEach(q$.prettifyError(_,q));return X}function xJ(_,$,q){let T=void 0;if(typeof $==="function")T=$;else if(q===void 0&&$&&typeof $==="object")q=$;let O=TO(_,q);if(!O)return null;if(O.warnings.forEach((H)=>jJ.warn(O.options.logLevel,H)),O.errors.length>0)if(O.options.logLevel!=="silent")throw O.errors[0];else O.errors=[];return O.toJS(Object.assign({reviver:T},q))}function kJ(_,$,q){let T=null;if(typeof $==="function"||Array.isArray($))T=$;else if(q===void 0&&$)q=$;if(typeof q==="string")q=q.length;if(typeof q==="number"){let O=Math.round(q);q=O<1?void 0:O>8?{indent:8}:{indent:O}}if(_===void 0){let{keepUndefined:O}=q??$??{};if(!O)return}if(bJ.isDocument(_)&&!T)return _.toString(q);return new EJ.Document(_,T,q).toString(q)}uJ.parse=xJ;uJ.parseAllDocuments=yJ;uJ.parseDocument=TO;uJ.stringify=kJ});import{existsSync as nq,mkdirSync as Q0,readFileSync as SH,writeFileSync as aq}from"node:fs";import{dirname as KH,isAbsolute as _5,join as NH,resolve as $5}from"node:path";var pJ=Gq(),dJ=r_(),cJ=a0(),Iq=o_(),sJ=x_(),U_=S(),iJ=q_(),nJ=f(),aJ=O_(),rJ=H_(),F3=o$(),oJ=Aq(),tJ=Dq(),eJ=Mq(),$0=OO(),HO=g_();var _7=pJ.Composer,$7=dJ.Document,q7=cJ.Schema,T7=Iq.YAMLError,O7=Iq.YAMLParseError,H7=Iq.YAMLWarning,X7=sJ.Alias,U7=U_.isAlias,J7=U_.isCollection,Z7=U_.isDocument,z7=U_.isMap,G7=U_.isNode,Q7=U_.isPair,W7=U_.isScalar,R7=U_.isSeq,Y7=iJ.Pair,L7=nJ.Scalar,V7=aJ.YAMLMap,B7=rJ.YAMLSeq;var w7=oJ.Lexer,A7=tJ.LineCounter,D7=eJ.Parser,q0=$0.parse,M7=$0.parseAllDocuments,I7=$0.parseDocument,Fq=$0.stringify,F7=HO.visit,S7=HO.visitAsync;var K7=new Set(["none","low","medium","high"]),N7=new Set(["low","medium","high"]);function T0(_,$){if(!_||typeof _!=="object"||Array.isArray(_))throw Error(`${$} must be an object`);return _}var C7=/<[^>\n]*[\s\u4e00-\u9fff…][^>\n]*>|(空)|\(空\)|占位符|proj_xxxx|cc_xxxxxxxx/;function P7(_,$){if(C7.test(_))throw Error(`${$} still contains a placeholder; replace it with real content`)}function r(_,$,q=$){let T=_[$];if(typeof T!=="string"||T.trim()==="")throw Error(`Missing required string: ${q}`);return P7(T,q),T}function XO(_,$){let q=_[$];if(typeof q!=="string"||q.trim()==="")return null;return q}function f7(_,$,q){let T=_[$];if(T==null)return[];if(!Array.isArray(T)||T.some((O)=>typeof O!=="string"))throw Error(`${q} must be a string array`);return T}function UO(_){if(!("confidence"in _))return null;let $=_.confidence;if(typeof $!=="string"||!N7.has($))throw Error(`Invalid confidence: ${String($)}`);return $}function JO(_){let $=T0(q0(_),"summaries.yaml"),q=r($,"project_id");if(!Array.isArray($.summaries))throw Error("summaries must be an array");return{projectId:q,summaries:$.summaries.map((T,O)=>{let H=`summaries[${O}]`,X=T0(T,`summaries[${O}]`),U=r(X,"value",`${H}.value`);if(!K7.has(U))throw Error(`Invalid summary value: ${U}`);return UO(X),{sessionId:r(X,"session_id",`${H}.session_id`),title:r(X,"title",`${H}.title`),value:U,summaryMarkdown:r(X,"summary_markdown",`${H}.summary_markdown`),metadata:X}})}}function ZO(_){let $=T0(q0(_),"experiences.yaml"),q=r($,"project_id");if(!Array.isArray($.experiences))throw Error("experiences must be an array");return{projectId:q,experiences:$.experiences.map((T,O)=>{let H=`experiences[${O}]`,X=T0(T,H),U=X.source_sessions;if(!Array.isArray(U)||U.some((Z)=>typeof Z!=="string"))throw Error(`experiences[${O}].source_sessions must be a string array`);let J=UO(X);return{title:r(X,"title",`${H}.title`),slug:typeof X.slug==="string"?X.slug:null,summary:r(X,"summary",`${H}.summary`),bodyMarkdown:r(X,"body_markdown",`${H}.body_markdown`),sourceSessions:U,confidence:J,topic:XO(X,"topic"),techStack:f7(X,"tech_stack",`${H}.tech_stack`),problemType:XO(X,"problem_type"),metadata:X}})}}import{existsSync as zO,readFileSync as GO,writeFileSync as E7}from"node:fs";var j7={"obsidian.vault":"obsidian_vault",obsidian_vault:"obsidian_vault"};function b7(_){let $={};for(let q of _.split(`
141
+ `)){let T=q.trim();if(T===""||T.startsWith("#")||T.startsWith("["))continue;let O=T.match(/^([\w.]+)\s*=\s*(.*)$/);if(!O)continue;let H=O[1],X=O[2].trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))X=X.slice(1,-1);$[H]=X}return $}function O0(_){if(!zO(_))return{obsidianVault:null};let q=b7(GO(_,"utf8")).obsidian_vault;return{obsidianVault:q&&q.trim()!==""?q:null}}function QO(_,$,q){let T=j7[$];if(!T)throw Error(`Unknown config key: ${$}. Supported: obsidian.vault`);let H=(zO(_)?GO(_,"utf8"):"").split(`
142
+ `),X=`${T} = "${q}"`,U=!1,J=H.map((Z)=>{if(Z.trim().startsWith(`${T} `)||Z.trim().startsWith(`${T}=`))return U=!0,X;return Z});if(!U)J.push(X);return E7(_,`${J.filter((Z,z)=>!(Z===""&&z===J.length-1)).join(`
143
143
  `)}
144
- `),$}import{mkdirSync as gO}from"node:fs";import{createRequire as RO}from"node:module";import{dirname as SO}from"node:path";var kf=RO(import.meta.url),pf=typeof globalThis.Bun<"u";function af(u,_){let s=_?{readonly:!0}:void 0;if(pf){let{Database:f}=kf("bun:sqlite");return new f(u,s)}return new(kf("better-sqlite3"))(u,s)}function IO(u){return typeof u==="object"&&u!==null&&!Array.isArray(u)&&!Buffer.isBuffer(u)}function L$(u){if(u.length!==1||!IO(u[0]))return u;if(pf)return u;let _={};for(let[s,$]of Object.entries(u[0]))_[s.replace(/^[$@:]/,"")]=$;return[_]}class tf{statement;constructor(u){this.statement=u}get(...u){return this.statement.get(...L$(u))??null}all(...u){return this.statement.all(...L$(u))}run(...u){return this.statement.run(...L$(u))}}class O${raw;constructor(u){this.raw=u}query(u){return new tf(this.raw.prepare(u))}exec(u){this.raw.exec(u)}transaction(u){return this.raw.transaction(u)}close(){this.raw.close()}}function N(u){return gO(SO(u),{recursive:!0}),new O$(af(u,!1))}function vf(u){try{return new O$(af(u,!0))}catch{return null}}function V(u){u.exec(`
144
+ `),T}import{mkdirSync as g7}from"node:fs";import{createRequire as y7}from"node:module";import{dirname as x7}from"node:path";var WO=y7(import.meta.url),RO=typeof globalThis.Bun<"u";function YO(_,$){let q=$?{readonly:!0}:void 0;if(RO){let{Database:H}=WO("bun:sqlite");return new H(_,q)}return new(WO("better-sqlite3"))(_,q)}function k7(_){return typeof _==="object"&&_!==null&&!Array.isArray(_)&&!Buffer.isBuffer(_)}function Sq(_){if(_.length!==1||!k7(_[0]))return _;if(RO)return _;let $={};for(let[q,T]of Object.entries(_[0]))$[q.replace(/^[$@:]/,"")]=T;return[$]}class LO{statement;constructor(_){this.statement=_}get(..._){return this.statement.get(...Sq(_))??null}all(..._){return this.statement.all(...Sq(_))}run(..._){return this.statement.run(...Sq(_))}}class Kq{raw;constructor(_){this.raw=_}query(_){return new LO(this.raw.prepare(_))}exec(_){this.raw.exec(_)}transaction(_){return this.raw.transaction(_)}close(){this.raw.close()}}function C(_){return g7(x7(_),{recursive:!0}),new Kq(YO(_,!1))}function VO(_){try{return new Kq(YO(_,!0))}catch{return null}}function T$(_,$,q,T){if(_.query(`PRAGMA table_info(${$})`).all().some((H)=>H.name===q))return;_.exec(`ALTER TABLE ${$} ADD COLUMN ${q} ${T}`)}function P(_){_.exec(`
145
145
  PRAGMA journal_mode = WAL;
146
146
 
147
147
  CREATE TABLE IF NOT EXISTS projects (
@@ -279,7 +279,18 @@ ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.pus
279
279
  conflict_status TEXT NOT NULL,
280
280
  UNIQUE(note_type, entity_id)
281
281
  );
282
- `)}import{createHash as TO}from"node:crypto";function h(u){return TO("sha1").update(u).digest("hex").slice(0,16)}import{spawnSync as qO}from"node:child_process";import{existsSync as LO}from"node:fs";import{basename as OO,resolve as ef}from"node:path";function UO(u){return u.trim().replace(/\/+$/,"").replace(/^ssh:\/\/git@([^/]+)\//,"$1/").replace(/^git@([^:]+):/,"$1/").replace(/^https?:\/\//,"").replace(/\.git$/,"")}function U$(u){return u.normalize("NFKD").replace(/[^\w\s./-]/g,"").trim().toLowerCase().replace(/[\s._/]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"project"}function of(u,_){let s=qO("git",_,{cwd:u,encoding:"utf8"});if(s.status!==0)return null;return s.stdout.trim()||null}function ui(u){let _=of(u,["rev-parse","--show-toplevel"]),s=of(u,["config","--get","remote.origin.url"]),$=s?UO(s):null,w=$??OO(_??u),f=U$(w);return{id:`proj_${h($??_??u)}`,canonicalName:w,slug:f,canonicalRepoUrl:$,identitySource:$?"git_remote":"path"}}function _i(u,_){let s=new Date().toISOString();return u.query(`
282
+ `),T$(_,"experience_candidates","proposed_summary","TEXT"),T$(_,"experience_candidates","tech_stack_json","TEXT"),T$(_,"experience_candidates","problem_type","TEXT"),T$(_,"experience_candidates","topic","TEXT"),T$(_,"experiences","topic","TEXT")}import{createHash as u7}from"node:crypto";function h(_){return u7("sha1").update(_).digest("hex").slice(0,16)}import{spawnSync as h7}from"node:child_process";import{existsSync as wO}from"node:fs";import{basename as v7,resolve as Cq}from"node:path";function m7(_){return _.trim().replace(/\/+$/,"").replace(/^ssh:\/\/git@([^/]+)\//,"$1/").replace(/^git@([^:]+):/,"$1/").replace(/^https?:\/\//,"").replace(/\.git$/,"")}function X0(_){return _.normalize("NFKD").replace(/[^\w\s./-]/g,"").trim().toLowerCase().replace(/[\s._/]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"project"}function BO(_,$){let q=h7("git",$,{cwd:_,encoding:"utf8"});if(q.status!==0)return null;return q.stdout.trim()||null}function Pq(_){let $=BO(_,["rev-parse","--show-toplevel"]),q=BO(_,["config","--get","remote.origin.url"]),T=q?m7(q):null,O=T??v7($??_),H=X0(O);return{id:`proj_${h(T??$??_)}`,canonicalName:O,slug:H,canonicalRepoUrl:T,identitySource:T?"git_remote":"path"}}function Nq(_,$,q,T){let O=`alias_${h(`${q}\x00${T}`)}`;_.query(`
283
+ INSERT INTO project_aliases (id, project_id, alias_type, alias_value)
284
+ VALUES ($id, $projectId, $aliasType, $aliasValue)
285
+ ON CONFLICT(id) DO UPDATE SET project_id = excluded.project_id
286
+ `).run({$id:O,$projectId:$,$aliasType:q,$aliasValue:T})}function l7(_,$,q){if(Nq(_,$.id,"path",q),Nq(_,$.id,"slug",$.slug),$.canonicalRepoUrl)Nq(_,$.id,"repo",$.canonicalRepoUrl);let T=new Date().toISOString(),O=`chk_${h(q)}`;_.query(`
287
+ INSERT INTO project_checkouts (id, project_id, local_path, git_root, remote_url, canonical_remote_url, current_branch, first_seen_at, last_seen_at)
288
+ VALUES ($id, $projectId, $localPath, NULL, NULL, $canonicalRepoUrl, NULL, $now, $now)
289
+ ON CONFLICT(id) DO UPDATE SET
290
+ project_id = excluded.project_id,
291
+ canonical_remote_url = excluded.canonical_remote_url,
292
+ last_seen_at = excluded.last_seen_at
293
+ `).run({$id:O,$projectId:$.id,$localPath:q,$canonicalRepoUrl:$.canonicalRepoUrl,$now:T})}function AO(_,$,q){let T=new Date().toISOString();if(_.query(`
283
294
  INSERT INTO projects (id, canonical_name, display_name, slug, canonical_repo_url, provider, identity_source, created_at, updated_at)
284
295
  VALUES ($id, $canonicalName, NULL, $slug, $canonicalRepoUrl, NULL, $identitySource, $now, $now)
285
296
  ON CONFLICT(id) DO UPDATE SET
@@ -288,7 +299,7 @@ ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.pus
288
299
  canonical_repo_url = excluded.canonical_repo_url,
289
300
  identity_source = excluded.identity_source,
290
301
  updated_at = excluded.updated_at
291
- `).run({$id:_.id,$canonicalName:_.canonicalName,$slug:_.slug,$canonicalRepoUrl:_.canonicalRepoUrl,$identitySource:_.identitySource,$now:s}),p_(u,_.id)}function fu(u,_){let s=ef(_);if(!LO(s))throw Error(`Path does not exist: ${s}`);return _i(u,ui(s))}function si(u,_){let s=ef(_);return _i(u,ui(s))}function H$(u,_,s){let $=new Date().toISOString();if(u.query("UPDATE projects SET display_name = $displayName, updated_at = $now WHERE id = $projectId").run({$displayName:s,$projectId:_,$now:$}).changes===0)throw Error(`Project not found: ${_}`);return p_(u,_)}function $i(u){return u.query(`
302
+ `).run({$id:$.id,$canonicalName:$.canonicalName,$slug:$.slug,$canonicalRepoUrl:$.canonicalRepoUrl,$identitySource:$.identitySource,$now:T}),q)l7(_,$,q);return J_(_,$.id)}function fq(_,$){let q=Cq($);if(!wO(q))throw Error(`Path does not exist: ${q}`);return AO(_,Pq(q),q)}function DO(_,$){let q=Cq($);return AO(_,Pq(q),q)}class O$ extends Error{ref;candidates;constructor(_,$){super($.length===0?`No project matched: ${_}`:`Ambiguous project reference: ${_} (${$.length} candidates)`);this.ref=_;this.candidates=$;this.name="ProjectResolutionError"}}function p7(_,$,q){let T=Z_(_),O=new Map(T.map((z)=>[z.id,z])),H=new Map,X=(z)=>{if(z)H.set(z.id,z)};if($.startsWith("proj_"))return X(O.get($)),[...H.values()];let U=Cq(q,$);if(wO(U)){let z=Pq(U);if(X(O.get(z.id)),z.canonicalRepoUrl){for(let Q of T)if(Q.canonicalRepoUrl===z.canonicalRepoUrl)X(Q)}let G=_.query("SELECT project_id FROM project_aliases WHERE alias_type = ? AND alias_value = ?").all("path",U);for(let Q of G)X(O.get(Q.project_id));if(H.size>0)return H0([...H.values()])}let J=$.trim().toLowerCase(),Z=X0($);for(let z of T){let G=[z.slug,z.canonicalName,z.displayName??""];if(z.slug===Z)X(z);else if(G.some((Q)=>Q.toLowerCase().includes(J)))X(z)}return H0([...H.values()])}function H0(_){return[..._].sort(($,q)=>q.sessionCount-$.sessionCount||$.canonicalName.localeCompare(q.canonicalName))}function c(_,$,q){let T=p7(_,$,q);if(T.length===0)throw new O$($,T);if(T.length===1)return J_(_,T[0].id);let[O,H]=T;if(O&&H&&O.sessionCount===H.sessionCount)throw new O$($,T);return J_(_,O.id)}function Eq(_,$,q){if($===q)throw Error("Cannot merge a project into itself");J_(_,$),J_(_,q);let T=0;return _.transaction(()=>{T=_.query("UPDATE sessions SET project_id = ? WHERE project_id = ?").run(q,$).changes,_.query("UPDATE session_summaries SET project_id = ? WHERE project_id = ?").run(q,$),_.query("UPDATE experience_candidates SET project_id = ? WHERE project_id = ?").run(q,$),_.query("UPDATE experiences SET project_id = ? WHERE project_id = ?").run(q,$),_.query("UPDATE project_aliases SET project_id = ? WHERE project_id = ?").run(q,$),_.query("UPDATE project_checkouts SET project_id = ? WHERE project_id = ?").run(q,$),_.query("UPDATE obsidian_notes SET entity_id = ? WHERE note_type = 'project-summary' AND entity_id = ?").run(q,$),_.query("DELETE FROM projects WHERE id = ?").run($)})(),{fromId:$,intoId:q,movedSessions:T}}function MO(_){let $=H0(Z_(_)),q=new Map;for(let O of $){let H=O.canonicalRepoUrl?`repo:${O.canonicalRepoUrl}`:`slug:${O.slug}`,X=q.get(H)??[];X.push(O),q.set(H,X)}let T=[];for(let O of q.values()){if(O.length<2)continue;let H=H0(O),X=H[0];for(let U of H.slice(1))T.push(Eq(_,U.id,X.id))}return{merges:T}}function jq(_,$,q){let T=new Date().toISOString();if(_.query("UPDATE projects SET display_name = $displayName, updated_at = $now WHERE id = $projectId").run({$displayName:q,$projectId:$,$now:T}).changes===0)throw Error(`Project not found: ${$}`);return J_(_,$)}function Z_(_){return _.query(`
292
303
  SELECT
293
304
  p.id,
294
305
  p.canonical_name,
@@ -302,18 +313,22 @@ ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.pus
302
313
  LEFT JOIN sessions s ON s.project_id = p.id
303
314
  GROUP BY p.id
304
315
  ORDER BY session_count DESC, p.canonical_name ASC
305
- `).all().map((s)=>({id:s.id,canonicalName:s.canonical_name,displayName:s.display_name,slug:s.slug,canonicalRepoUrl:s.canonical_repo_url,identitySource:s.identity_source,sessionCount:s.session_count,lastSeenAt:s.last_seen_at}))}function p_(u,_){let s=u.query("SELECT * FROM projects WHERE id = ?").get(_);if(!s)throw Error(`Project not found: ${_}`);return{id:s.id,canonicalName:s.canonical_name,displayName:s.display_name,slug:s.slug,canonicalRepoUrl:s.canonical_repo_url,identitySource:s.identity_source}}var HO=`## 输出格式(务必遵守)
316
+ `).all().map((q)=>({id:q.id,canonicalName:q.canonical_name,displayName:q.display_name,slug:q.slug,canonicalRepoUrl:q.canonical_repo_url,identitySource:q.identity_source,sessionCount:q.session_count,lastSeenAt:q.last_seen_at}))}function J_(_,$){let q=_.query("SELECT * FROM projects WHERE id = ?").get($);if(!q)throw Error(`Project not found: ${$}`);return{id:q.id,canonicalName:q.canonical_name,displayName:q.display_name,slug:q.slug,canonicalRepoUrl:q.canonical_repo_url,identitySource:q.identity_source}}var d7=`## 输出格式(务必遵守)
306
317
 
307
318
  本文件(\`experiences-task.md\`)是任务说明,请勿修改它。
308
- 请**另外新建**一个纯 YAML 文件 \`.llm-iwiki/tasks/experiences.yaml\`,然后运行:
309
- \`llm-iwiki experiences propose --project . --file .llm-iwiki/tasks/experiences.yaml\`
319
+ 请**另外新建**一个纯 YAML 文件 \`.llm-iwiki/exchange/experiences.yaml\`,然后运行:
320
+ \`llm-iwiki experiences propose --project . --file .llm-iwiki/exchange/experiences.yaml\`
310
321
 
311
322
  输出文件规则:
312
323
  - 只能是 YAML 内容,不要写 Markdown 标题或说明文字,也不要用 \`\`\` 代码围栏把它包起来。
324
+ - 必须基于下方摘要的真实内容归纳,禁止编造;信息不足时宁可少写。
313
325
  - 不要保留 \`<...>\` 占位符,全部替换成真实内容。
314
326
  - 一条经验可以聚合多个会话,按主题归纳,不要逐会话复述。
315
327
  - \`source_sessions\` 必须是字符串数组,填该经验来自哪些 session_id(与下方摘要块标题里的 id 一致)。
316
328
  - \`confidence\` 可选,只能取 low / medium / high 其中之一。
329
+ - \`topic\` 可选,用于跨项目主题归类(如 ai-coding / backend / frontend / devops)。
330
+ - \`tech_stack\` 可选,字符串数组,列出涉及的技术栈(如 [go, kratos, sqlite])。
331
+ - \`problem_type\` 可选,一句话问题类型(如 性能优化 / 登录态 / 构建)。
317
332
 
318
333
  按下面结构填真实内容(# 后是说明,可删):
319
334
 
@@ -331,44 +346,59 @@ experiences:
331
346
  source_sessions:
332
347
  - cc_xxxxxxxx
333
348
  confidence: medium
334
- \`\`\``;function DO(u,_,s){let $=s==="changed-summaries"?"AND value IN ('medium', 'high')":"";return u.query(`
349
+ topic: backend # 可选,跨项目主题
350
+ tech_stack: [go, kratos] # 可选
351
+ problem_type: 登录态 # 可选
352
+ \`\`\``;function c7(_,$,q,T){let O=q==="changed-summaries"?"AND value IN ('medium', 'high')":"",H=T?"AND updated_at >= ?":"",X=T?[$,T]:[$];return _.query(`
335
353
  SELECT session_id, title, value, summary_markdown
336
354
  FROM session_summaries
337
- WHERE project_id = ? ${$}
355
+ WHERE project_id = ? ${O} ${H}
338
356
  ORDER BY updated_at DESC
339
- `).all(_)}function wi(u,_,s){let w=DO(u,_,s).map((i)=>[`### ${i.session_id} — ${i.title}`,`- value: ${i.value}`,"",i.summary_markdown].join(`
340
- `));return{markdown:["# Experiences Task","",`project_id: ${_}`,`scope: ${s}`,`summaries: ${w.length}`,"",HO,"","---","",w.join(`
357
+ `).all(...X)}function IO(_,$,q,T=null){let H=c7(_,$,q,T).map((U)=>[`### ${U.session_id} — ${U.title}`,`- value: ${U.value}`,"",U.summary_markdown].join(`
358
+ `));return{markdown:["# Experiences Task","",`project_id: ${$}`,`scope: ${q}`,`summaries: ${H.length}`,"",d7,"","---","",H.join(`
341
359
 
342
360
  ---
343
361
 
344
362
  `),""].join(`
345
- `),summaryCount:w.length}}function fi(u){return h(u)}function ii(u,_){let s=new Date().toISOString(),$=0;return u.transaction(()=>{for(let f of _.experiences){let i=f.slug&&f.slug.trim()!==""?f.slug:U$(f.title),g=`cand_${fi(`${_.projectId}\x00${i}`)}`;u.query(`
363
+ `),summaryCount:H.length}}function FO(_){return h(_)}function SO(_,$){let q=new Date().toISOString(),T=0;return _.transaction(()=>{for(let H of $.experiences){let X=H.slug&&H.slug.trim()!==""?H.slug:X0(H.title),U=`cand_${FO(`${$.projectId}\x00${X}`)}`;_.query(`
346
364
  INSERT INTO experience_candidates (
347
- id, project_id, proposed_title, proposed_slug, proposed_body_markdown, source_sessions_json, confidence, status, created_at
348
- ) VALUES ($id, $projectId, $title, $slug, $body, $sources, $confidence, 'proposed', $now)
365
+ id, project_id, proposed_title, proposed_slug, proposed_summary, proposed_body_markdown,
366
+ source_sessions_json, confidence, tech_stack_json, problem_type, topic, status, created_at
367
+ ) VALUES (
368
+ $id, $projectId, $title, $slug, $summary, $body,
369
+ $sources, $confidence, $techStack, $problemType, $topic, 'proposed', $now
370
+ )
349
371
  ON CONFLICT(id) DO UPDATE SET
350
372
  proposed_title = excluded.proposed_title,
373
+ proposed_summary = excluded.proposed_summary,
351
374
  proposed_body_markdown = excluded.proposed_body_markdown,
352
375
  source_sessions_json = excluded.source_sessions_json,
353
- confidence = excluded.confidence
354
- `).run({$id:g,$projectId:_.projectId,$title:f.title,$slug:i,$body:f.bodyMarkdown,$sources:JSON.stringify(f.sourceSessions),$confidence:f.confidence,$now:s}),$+=1}})(),{written:$}}function gi(u,_){if(_)return u.query("SELECT id, project_id, proposed_title, proposed_slug, confidence, status, source_sessions_json, created_at FROM experience_candidates WHERE project_id = ? ORDER BY created_at DESC").all(_);return u.query("SELECT id, project_id, proposed_title, proposed_slug, confidence, status, source_sessions_json, created_at FROM experience_candidates ORDER BY created_at DESC").all()}function Ri(u,_){let s=u.query("SELECT project_id, proposed_title, proposed_slug, proposed_body_markdown, confidence, source_sessions_json FROM experience_candidates WHERE id = ?").get(_);if(!s)throw Error(`Experience candidate not found: ${_}`);let $=[];try{let g=JSON.parse(s.source_sessions_json);if(Array.isArray(g))$=g.filter((R)=>typeof R==="string")}catch{$=[]}let w=new Date().toISOString(),f=`exp_${fi(`${s.project_id}\x00${s.proposed_slug}`)}`;return u.transaction(()=>{u.query(`
376
+ confidence = excluded.confidence,
377
+ tech_stack_json = excluded.tech_stack_json,
378
+ problem_type = excluded.problem_type,
379
+ topic = excluded.topic
380
+ `).run({$id:U,$projectId:$.projectId,$title:H.title,$slug:X,$summary:H.summary,$body:H.bodyMarkdown,$sources:JSON.stringify(H.sourceSessions),$confidence:H.confidence,$techStack:H.techStack.length>0?JSON.stringify(H.techStack):null,$problemType:H.problemType,$topic:H.topic,$now:q}),T+=1}})(),{written:T}}function KO(_,$){if($)return _.query("SELECT id, project_id, proposed_title, proposed_slug, confidence, status, source_sessions_json, created_at FROM experience_candidates WHERE project_id = ? ORDER BY created_at DESC").all($);return _.query("SELECT id, project_id, proposed_title, proposed_slug, confidence, status, source_sessions_json, created_at FROM experience_candidates ORDER BY created_at DESC").all()}function NO(_,$){let q=_.query("SELECT project_id, proposed_title, proposed_slug, proposed_summary, proposed_body_markdown, confidence, tech_stack_json, problem_type, topic, source_sessions_json FROM experience_candidates WHERE id = ?").get($);if(!q)throw Error(`Experience candidate not found: ${$}`);let T=[];try{let U=JSON.parse(q.source_sessions_json);if(Array.isArray(U))T=U.filter((J)=>typeof J==="string")}catch{T=[]}let O=new Date().toISOString(),H=`exp_${FO(`${q.project_id}\x00${q.proposed_slug}`)}`;return _.transaction(()=>{_.query(`
355
381
  INSERT INTO experiences (
356
- id, project_id, title, slug, body_markdown, confidence, status, created_at, updated_at
357
- ) VALUES ($id, $projectId, $title, $slug, $body, $confidence, 'accepted', $now, $now)
382
+ id, project_id, title, slug, summary, body_markdown, confidence, tech_stack_json, problem_type, topic, status, created_at, updated_at
383
+ ) VALUES ($id, $projectId, $title, $slug, $summary, $body, $confidence, $techStack, $problemType, $topic, 'accepted', $now, $now)
358
384
  ON CONFLICT(project_id, slug) DO UPDATE SET
359
385
  title = excluded.title,
386
+ summary = excluded.summary,
360
387
  body_markdown = excluded.body_markdown,
361
388
  confidence = excluded.confidence,
389
+ tech_stack_json = excluded.tech_stack_json,
390
+ problem_type = excluded.problem_type,
391
+ topic = excluded.topic,
362
392
  status = 'accepted',
363
393
  updated_at = excluded.updated_at
364
- `).run({$id:f,$projectId:s.project_id,$title:s.proposed_title,$slug:s.proposed_slug,$body:s.proposed_body_markdown,$confidence:s.confidence,$now:w});let R=u.query("SELECT id FROM experiences WHERE project_id = ? AND slug = ?").get(s.project_id,s.proposed_slug)?.id??f;for(let S of $)u.query(`
394
+ `).run({$id:H,$projectId:q.project_id,$title:q.proposed_title,$slug:q.proposed_slug,$summary:q.proposed_summary,$body:q.proposed_body_markdown,$confidence:q.confidence,$techStack:q.tech_stack_json,$problemType:q.problem_type,$topic:q.topic,$now:O});let J=_.query("SELECT id FROM experiences WHERE project_id = ? AND slug = ?").get(q.project_id,q.proposed_slug)?.id??H;for(let Z of T)_.query(`
365
395
  INSERT INTO session_experience_links (session_id, experience_id, relation)
366
396
  VALUES (?, ?, 'source')
367
397
  ON CONFLICT(session_id, experience_id) DO NOTHING
368
- `).run(S,R);u.query("UPDATE experience_candidates SET status = 'accepted' WHERE id = ?").run(_)})(),{experienceId:f,slug:s.proposed_slug,linkedSessions:$.length}}function Si(u,_){if(u.query("UPDATE experience_candidates SET status = 'rejected' WHERE id = ?").run(_).changes===0)throw Error(`Experience candidate not found: ${_}`)}import{existsSync as Ti,mkdirSync as PO,readFileSync as qi,writeFileSync as Ii}from"node:fs";import{dirname as AO,join as ou}from"node:path";var t_="<!-- aiwiki:managed:start -->",Li="<!-- aiwiki:managed:end -->";function v_(u){return h(u)}function P$(u){let _=u.replace(/[\\/:*?"<>|]/g," ").replace(/\s+/g," ").trim().slice(0,80);return _===""?"untitled":_}function FO(u){let _=T$(u.frontmatter).trimEnd(),s=u.userSectionHeading??"## 我的补充";return["---",_,"---","",`# ${u.title}`,"",t_,u.managedBody.trim(),Li,"",s,"",""].join(`
369
- `)}function Oi(u){let _=u.indexOf(t_),s=u.indexOf(Li);if(_===-1||s===-1||s<_)return null;return{before:u.slice(0,_+t_.length),managed:u.slice(_+t_.length,s).trim(),after:u.slice(s)}}function zO(u,_){return`${u.before}
370
- ${_.trim()}
371
- ${u.after}`}function YO(u,_,s){return u.query("SELECT managed_hash, file_path FROM obsidian_notes WHERE note_type = ? AND entity_id = ?").get(_,s)}function a_(u,_,s,$,w,f){u.query(`
398
+ `).run(Z,J);_.query("UPDATE experience_candidates SET status = 'accepted' WHERE id = ?").run($)})(),{experienceId:H,slug:q.proposed_slug,linkedSessions:T.length}}function CO(_,$){if(_.query("UPDATE experience_candidates SET status = 'rejected' WHERE id = ?").run($).changes===0)throw Error(`Experience candidate not found: ${$}`)}import{existsSync as Z0,mkdirSync as EO,readFileSync as jO,renameSync as s7,writeFileSync as PO}from"node:fs";import{dirname as bq,join as o}from"node:path";var J0="<!-- aiwiki:managed:start -->",bO="<!-- aiwiki:managed:end -->";function z0(_){return h(_)}function U$(_){let $=_.replace(/[\\/:*?"<>|]/g," ").replace(/\s+/g," ").trim().slice(0,80);return $===""?"untitled":$}function i7(_){let $=Fq(_.frontmatter).trimEnd(),q=_.userSectionHeading??"## 我的补充";return["---",$,"---","",`# ${_.title}`,"",J0,_.managedBody.trim(),bO,"",q,"",""].join(`
399
+ `)}function gO(_){let $=_.indexOf(J0),q=_.indexOf(bO);if($===-1||q===-1||q<$)return null;return{before:_.slice(0,$+J0.length),managed:_.slice($+J0.length,q).trim(),after:_.slice(q)}}function n7(_,$){return`${_.before}
400
+ ${$.trim()}
401
+ ${_.after}`}function a7(_,$,q){return _.query("SELECT managed_hash, file_path FROM obsidian_notes WHERE note_type = ? AND entity_id = ?").get($,q)}function U0(_,$,q,T,O,H){_.query(`
372
402
  INSERT INTO obsidian_notes (id, note_type, entity_id, file_path, managed_hash, frontmatter_hash, last_exported_at, conflict_status)
373
403
  VALUES ($id, $noteType, $entityId, $filePath, $managedHash, NULL, $now, $conflictStatus)
374
404
  ON CONFLICT(note_type, entity_id) DO UPDATE SET
@@ -376,31 +406,66 @@ ${u.after}`}function YO(u,_,s){return u.query("SELECT managed_hash, file_path FR
376
406
  managed_hash = excluded.managed_hash,
377
407
  last_exported_at = excluded.last_exported_at,
378
408
  conflict_status = excluded.conflict_status
379
- `).run({$id:`note_${v_(`${_.noteType}\x00${_.entityId}`)}`,$noteType:_.noteType,$entityId:_.entityId,$filePath:s,$managedHash:$,$conflictStatus:w,$now:f})}function D$(u,_,s,$,w){let f=ou(_,s.relPath),i=v_(s.managedBody.trim());if(!Ti(f))return PO(AO(f),{recursive:!0}),Ii(f,FO(s)),a_(u,s,f,i,"clean",w),"created";let g=qi(f,"utf8"),R=Oi(g);if(!R)return a_(u,s,f,i,"no_managed_block",w),"conflict";let S=v_(R.managed),L=YO(u,s.noteType,s.entityId),I=!L||L.managed_hash!==S;if(I&&!$.force)return a_(u,s,f,L?.managed_hash??S,"managed_conflict",w),"conflict";return Ii(f,zO(R,s.managedBody)),a_(u,s,f,i,"clean",w),I?"forced":"updated"}function GO(u){return P$(u.displayName??u.canonicalName??u.slug)}function Ui(u,_,s,$){let w=new Date().toISOString(),f={created:0,updated:0,forced:0,conflicts:[]},i=GO(s),g=ou("LLM-iWiki","Projects",i),R=s.displayName??s.canonicalName,S=(q,U)=>{if(q==="created")f.created+=1;else if(q==="updated")f.updated+=1;else if(q==="forced")f.forced+=1;else f.conflicts.push(U)},L=u.query(`
409
+ `).run({$id:`note_${z0(`${$.noteType}\x00${$.entityId}`)}`,$noteType:$.noteType,$entityId:$.entityId,$filePath:q,$managedHash:T,$conflictStatus:O,$now:H})}function H$(_,$,q,T,O){let H=o($,q.relPath),X=z0(q.managedBody.trim());if(!Z0(H))return EO(bq(H),{recursive:!0}),PO(H,i7(q)),U0(_,q,H,X,"clean",O),"created";let U=jO(H,"utf8"),J=gO(U);if(!J)return U0(_,q,H,X,"no_managed_block",O),"conflict";let Z=z0(J.managed),z=a7(_,q.noteType,q.entityId),G=!z||z.managed_hash!==Z;if(G&&!T.force)return U0(_,q,H,z?.managed_hash??Z,"managed_conflict",O),"conflict";return PO(H,n7(J,q.managedBody)),U0(_,q,H,X,"clean",O),G?"forced":"updated"}var X$="LLM-iWiki";function yO(_){return U$(_.slug||_.displayName||_.canonicalName)}function B_(_){return`[[${_.replace(/[[\]|]/g," ").trim()}]]`}function xO(_){if(!_)return[];try{let $=JSON.parse(_);return Array.isArray($)?$.filter((q)=>typeof q==="string"):[]}catch{return[]}}function r7(_,$,q){let T=[...new Set(q.flatMap((U)=>xO(U.tech_stack_json)))],O=[...new Set(q.map((U)=>U.topic).filter((U)=>!!U))],H=[...$].filter((U)=>U.updated_at).sort((U,J)=>(U.updated_at??"").localeCompare(J.updated_at??"")).map((U)=>`| ${(U.updated_at??"").slice(0,10)} | ${U.title} |`),X=[];if(X.push("## 概览"),X.push(""),X.push(`- 标识:\`${_.canonicalName}\``),_.canonicalRepoUrl)X.push(`- 仓库:${_.canonicalRepoUrl}`);if(X.push(`- 会话总结:${$.length} 条`),X.push(`- 沉淀经验:${q.length} 条`),T.length>0)X.push(`- 技术栈:${T.join(" / ")}`);if(O.length>0)X.push(`- 主题:${O.map((U)=>B_(`Topic - ${U}`)).join(" ")}`);if(X.push(""),X.push("## 相关经验"),X.push(""),q.length===0)X.push("_暂无已采纳经验。_");else for(let U of q){let J=U.summary?` — ${U.summary.trim().split(`
410
+ `)[0]}`:"";X.push(`- ${B_(U.slug||U.title)}${J}`)}if(X.push(""),X.push("## 演进时间线"),X.push(""),H.length===0)X.push("_暂无会话总结。_");else X.push("| 日期 | 里程碑 |"),X.push("| --- | --- |"),X.push(...H);return X.join(`
411
+ `)}function gq(_,$,q,T){let O=new Date().toISOString(),H={created:0,updated:0,forced:0,conflicts:[]},X=yO(q),U=o(X$,"Projects",X),J=q.displayName??q.canonicalName,Z=(R,W)=>{if(R==="created")H.created+=1;else if(R==="updated")H.updated+=1;else if(R==="forced")H.forced+=1;else H.conflicts.push(W)},z=_.query(`
380
412
  SELECT id, session_id, title, value, summary_markdown, updated_at
381
413
  FROM session_summaries WHERE project_id = ? ORDER BY updated_at DESC
382
- `).all(s.id);for(let q of L){let U=ou(g,"Sessions",`${P$(q.title)}.md`),P={noteType:"session-summary",entityId:q.id,relPath:U,title:q.title,managedBody:q.summary_markdown,frontmatter:{type:"session-summary",aiwiki_id:q.id,aiwiki_project_id:s.id,project:R,session_id:q.session_id,value:q.value,updated_at:q.updated_at??w}};S(D$(u,_,P,$,w),U)}let I=u.query(`
383
- SELECT id, title, slug, body_markdown, confidence, status, updated_at
414
+ `).all(q.id);for(let R of z){let W=o(U,"sessions",`${U$(R.title)}.md`),L={noteType:"session-summary",entityId:R.id,relPath:W,title:R.title,managedBody:R.summary_markdown,frontmatter:{type:"session-summary",aiwiki_id:R.id,aiwiki_project_id:q.id,project:J,session_id:R.session_id,value:R.value,updated_at:R.updated_at??O}};Z(H$(_,$,L,T,O),W)}let G=_.query(`
415
+ SELECT id, title, slug, summary, body_markdown, confidence, topic, tech_stack_json, status, updated_at
384
416
  FROM experiences WHERE project_id = ? AND status = 'accepted' ORDER BY updated_at DESC
385
- `).all(s.id);for(let q of I){let U=ou(g,"Experiences",`${P$(q.slug||q.title)}.md`),P=u.query("SELECT session_id FROM session_experience_links WHERE experience_id = ?").all(q.id).map((z)=>z.session_id),F={noteType:"experience",entityId:q.id,relPath:U,title:q.title,managedBody:q.body_markdown,frontmatter:{type:"experience",aiwiki_id:q.id,aiwiki_project_id:s.id,project:R,slug:q.slug,confidence:q.confidence,status:q.status,source_sessions:P,updated_at:q.updated_at}};S(D$(u,_,F,$,w),U)}let T=ou(g,"Project Summary.md"),O=[`- canonical: \`${s.canonicalName}\``,s.canonicalRepoUrl?`- repo: ${s.canonicalRepoUrl}`:null,`- session summaries: ${L.length}`,`- experiences: ${I.length}`].filter((q)=>q!=null).join(`
386
- `),H={noteType:"project-summary",entityId:s.id,relPath:T,title:R,managedBody:O,frontmatter:{type:"project-summary",aiwiki_project_id:s.id,project:R,canonical_repo_url:s.canonicalRepoUrl,updated_at:w}};return S(D$(u,_,H,$,w),T),f}function Hi(u){let _=u.query("SELECT note_type, entity_id, file_path, managed_hash FROM obsidian_notes ORDER BY file_path ASC").all(),s=[],$=0;for(let w of _){let f;if(!Ti(w.file_path))f="missing";else{let i=Oi(qi(w.file_path,"utf8"));if(!i)f="no_managed_block";else if(w.managed_hash&&v_(i.managed)===w.managed_hash)f="clean";else f="drift"}if(f==="clean")$+=1;else s.push({noteType:w.note_type,entityId:w.entity_id,filePath:w.file_path,status:f})}return{total:_.length,clean:$,entries:s}}import{homedir as WO}from"node:os";import{join as A$,resolve as XO}from"node:path";function Q(u=WO()){let _=A$(u,".llm-iwiki");return{homeDir:u,configDir:_,configFile:A$(_,"config.toml"),databaseFile:A$(_,"llm-iwiki.db")}}function F$(u){return XO(u,".llm-iwiki","tasks")}function Di(u){return{id:u.id,sourceId:u.source_id,sourceSessionId:u.source_session_id,title:u.title,messageCount:u.message_count,status:u.status,rawProjectPath:u.raw_project_path,updatedAt:u.updated_at,lastSeenAt:u.last_seen_at}}function JO(u,_,s=100){return u.query(`
417
+ `).all(q.id);for(let R of G){let W=o(U,"experiences",`${U$(R.slug||R.title)}.md`),L=_.query("SELECT session_id FROM session_experience_links WHERE experience_id = ?").all(R.id).map((M)=>M.session_id),B=xO(R.tech_stack_json),A=[R.summary?`> ${R.summary.trim().replace(/\n+/g," ")}`:null,R.summary?"":null,`- 所属项目:${B_(q.slug||J)}`,R.topic?`- 主题:${B_(`Topic - ${R.topic}`)}`:null,B.length>0?`- 技术栈:${B.join(" / ")}`:null,"",R.body_markdown.trim()].filter((M)=>M!=null).join(`
418
+ `),D={noteType:"experience",entityId:R.id,relPath:W,title:R.title,managedBody:A,frontmatter:{type:"experience",aiwiki_id:R.id,aiwiki_project_id:q.id,project:J,slug:R.slug,topic:R.topic,tech_stack:B,confidence:R.confidence,status:R.status,source_sessions:L,updated_at:R.updated_at}};Z(H$(_,$,D,T,O),W)}let Q=o(U,"Project Summary.md"),Y={noteType:"project-summary",entityId:q.id,relPath:Q,title:J,managedBody:r7(q,z,G),frontmatter:{type:"project-summary",aiwiki_project_id:q.id,project:J,slug:q.slug,canonical_repo_url:q.canonicalRepoUrl,updated_at:O}};return Z(H$(_,$,Y,T,O),Q),H}function fO(_,$){_.created+=$.created,_.updated+=$.updated,_.forced+=$.forced,_.conflicts.push(...$.conflicts)}function yq(_,$,q){let T=new Date().toISOString(),O={created:0,updated:0,forced:0,conflicts:[]},H=(z,G)=>{if(z==="created")O.created+=1;else if(z==="updated")O.updated+=1;else if(z==="forced")O.forced+=1;else O.conflicts.push(G)},X=Z_(_).filter((z)=>z.sessionCount>0||kO(_,z.id)),U=_.query(`
419
+ SELECT e.title, e.slug, e.summary, e.topic, p.slug AS project_slug,
420
+ COALESCE(p.display_name, p.canonical_name) AS project_name
421
+ FROM experiences e
422
+ JOIN projects p ON p.id = e.project_id
423
+ WHERE e.status = 'accepted' AND e.topic IS NOT NULL AND e.topic != ''
424
+ ORDER BY e.topic ASC, e.updated_at DESC
425
+ `).all(),J=new Map;for(let z of U){let G=J.get(z.topic)??[];G.push(z),J.set(z.topic,G)}let Z=[];if(Z.push("## 项目"),Z.push(""),X.length===0)Z.push("_暂无项目。运行 `llm-iwiki obsidian export` 导出。_");else for(let z of X){let G=z.displayName??z.canonicalName,Q=U$(z.slug||G);Z.push(`- [${G}](Projects/${encodeURIComponent(Q)}/Project%20Summary.md) — 总结 ${z.sessionCount} 会话`)}if(Z.push(""),Z.push("## 主题"),Z.push(""),J.size===0)Z.push("_暂无主题分类。在经验 YAML 中填写 `topic` 即可聚合。_");else for(let z of[...J.keys()].sort())Z.push(`- ${B_(`Topic - ${z}`)}(${J.get(z).length} 条经验)`);H(H$(_,$,{noteType:"index",entityId:"root",relPath:o(X$,"README.md"),title:"LLM-iWiki 知识库",managedBody:Z.join(`
426
+ `),frontmatter:{type:"index",updated_at:T},userSectionHeading:"## 备注"},q,T),o(X$,"README.md"));for(let[z,G]of J){let Q=G.map((R)=>{let W=R.summary?` — ${R.summary.trim().split(`
427
+ `)[0]}`:"";return`- ${B_(R.slug||R.title)}${W}(${B_(R.project_slug||R.project_name)})`}).join(`
428
+ `),Y=o(X$,"Topics",`Topic - ${U$(z)}.md`);H(H$(_,$,{noteType:"topic",entityId:z,relPath:Y,title:`Topic - ${z}`,managedBody:Q,frontmatter:{type:"topic",topic:z,updated_at:T}},q,T),Y)}return O}function kO(_,$){return(_.query("SELECT COUNT(*) AS n FROM obsidian_notes WHERE note_type = 'project-summary' AND entity_id = ?").get($)?.n??0)>0}function uO(_,$,q){let T={created:0,updated:0,forced:0,conflicts:[]};for(let O of Z_(_)){if(O.sessionCount===0&&!kO(_,O.id))continue;fO(T,gq(_,$,J_(_,O.id),q))}return fO(T,yq(_,$,q)),T}function hO(_,$,q){let T=o($,X$,"Projects",yO(q)),O=_.query("SELECT file_path FROM obsidian_notes WHERE note_type = 'project-summary' AND entity_id = ?").get(q.id),H=[],X=0;if(O){let U=bq(O.file_path);if(Z0(U)&&U!==T){if(EO(bq(T),{recursive:!0}),Z0(T))throw Error(`Target already exists: ${T}`);s7(U,T),H.push(U),X+=1;let J=_.query("SELECT id, file_path FROM obsidian_notes").all();for(let Z of J)if(Z.file_path.startsWith(U)){let z=Z.file_path.replace(U,T);_.query("UPDATE obsidian_notes SET file_path = ? WHERE id = ?").run(z,Z.id)}}}return{moved:X,fromDirs:H}}function vO(_){let $=_.query("SELECT note_type, entity_id, file_path, managed_hash FROM obsidian_notes ORDER BY file_path ASC").all(),q=[],T=0;for(let O of $){let H;if(!Z0(O.file_path))H="missing";else{let X=gO(jO(O.file_path,"utf8"));if(!X)H="no_managed_block";else if(O.managed_hash&&z0(X.managed)===O.managed_hash)H="clean";else H="drift"}if(H==="clean")T+=1;else q.push({noteType:O.note_type,entityId:O.entity_id,filePath:O.file_path,status:H})}return{total:$.length,clean:T,entries:q}}import{homedir as o7}from"node:os";import{join as xq,resolve as t7}from"node:path";function N(_=o7()){let $=xq(_,".llm-iwiki");return{homeDir:_,configDir:$,configFile:xq($,"config.toml"),databaseFile:xq($,"llm-iwiki.db")}}function kq(_){return t7(_,".llm-iwiki","exchange")}function mO(_,$,q=80){let T=_.replace(/\s+/g," ").trim(),O=T.toLowerCase().indexOf($.toLowerCase());if(O===-1)return T.slice(0,q);let H=Math.max(0,O-q/4),X=T.slice(H,H+q);return`${H>0?"…":""}${X}${H+q<T.length?"…":""}`}function lO(_,$,q,T,O=20){let H=`%${q.replace(/[%_]/g,(U)=>`\\${U}`)}%`;if($==="experiences")return _.query(`
429
+ SELECT id, title, summary, body_markdown, project_id
430
+ FROM experiences
431
+ WHERE status = 'accepted'
432
+ AND (title LIKE ? ESCAPE '\\' OR COALESCE(summary, '') LIKE ? ESCAPE '\\' OR body_markdown LIKE ? ESCAPE '\\')
433
+ ORDER BY updated_at DESC
434
+ `).all(H,H,H).filter((J)=>!T||J.project_id===T).slice(0,O).map((J)=>({id:J.id,title:J.title,snippet:mO(J.summary??J.body_markdown,q),projectId:J.project_id}));return _.query(`
435
+ SELECT id, title, summary_markdown, project_id
436
+ FROM session_summaries
437
+ WHERE title LIKE ? ESCAPE '\\' OR summary_markdown LIKE ? ESCAPE '\\'
438
+ ORDER BY updated_at DESC
439
+ `).all(H,H).filter((U)=>!T||U.project_id===T).slice(0,O).map((U)=>({id:U.id,title:U.title,snippet:mO(U.summary_markdown,q),projectId:U.project_id}))}var e7={maxPerMessage:1200,maxMessages:60};function _Z(_){return _.replace(/[ \t]+\n/g,`
440
+ `).replace(/\n{3,}/g,`
441
+
442
+ `).trim()}function $Z(_,$){let q=_Z(_);if(q.length<=$)return q;return`${q.slice(0,$)}
443
+ …[truncated ${q.length-$} chars]`}function J$(_,$={}){let q={...e7,...$},T=_.filter((U)=>U.content.trim()!==""),O=T,H="";if(T.length>q.maxMessages){let U=Math.ceil(q.maxMessages*0.6),J=q.maxMessages-U;O=[...T.slice(0,U),...T.slice(T.length-J)],H=`
444
+ …[omitted ${T.length-q.maxMessages} middle messages]
445
+ `}let X=[];return O.forEach((U,J)=>{if(H&&J===Math.ceil(q.maxMessages*0.6))X.push(H);let Z=U.role==="user"?"User":U.role==="assistant"?"Assistant":U.role;X.push(`**${Z}:** ${$Z(U.content,q.maxPerMessage)}`)}),X.join(`
446
+
447
+ `)}function uq(_){return{id:_.id,sourceId:_.source_id,sourceSessionId:_.source_session_id,title:_.title,messageCount:_.message_count,status:_.status,rawProjectPath:_.raw_project_path,updatedAt:_.updated_at,lastSeenAt:_.last_seen_at}}function hq(_,$,q=100){return _.query(`
387
448
  SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
388
449
  FROM sessions
389
450
  WHERE project_id = ?
390
451
  ORDER BY COALESCE(updated_at, last_seen_at) DESC
391
452
  LIMIT ?
392
- `).all(_,s).map(Di)}function Pi(u,_){return u.query("SELECT role, content FROM messages WHERE session_id = ? ORDER BY seq_order ASC").all(_)}function Ai(u,_,s){let $=s==="changed"?"AND status IN ('new', 'changed')":"";return u.query(`
453
+ `).all($,q).map(uq)}function vq(_,$){return _.query("SELECT role, content FROM messages WHERE session_id = ? ORDER BY seq_order ASC").all($)}function pO(_,$,q={}){let T=qZ(_,$);if(!T)throw Error(`Session not found: ${$}`);let O=vq(_,$),H=q.full?J$(O,{maxPerMessage:1e6,maxMessages:1e6}):J$(O);return{session:T,transcript:H,messageCount:O.length}}function qZ(_,$){let q=_.query(`
454
+ SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
455
+ FROM sessions
456
+ WHERE id = ?
457
+ `).get($);return q?uq(q):null}function dO(_,$,q){let T=q==="changed"?"AND status IN ('new', 'changed')":"";return _.query(`
393
458
  SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
394
459
  FROM sessions
395
- WHERE project_id = ? ${$}
460
+ WHERE project_id = ? ${T}
396
461
  ORDER BY COALESCE(updated_at, last_seen_at) DESC
397
- `).all(_).map(Di)}function Fi(u,_){return{sources:u.query(`
462
+ `).all($).map(uq)}function cO(_,$){return{sources:_.query(`
398
463
  SELECT source_id, COUNT(*) AS session_count
399
464
  FROM sessions
400
465
  WHERE project_id = ?
401
466
  GROUP BY source_id
402
467
  ORDER BY session_count DESC
403
- `).all(_).map(($)=>({source:$.source_id,sessionCount:$.session_count})),sessions:JO(u,_)}}import{existsSync as BO,mkdirSync as ZO,writeFileSync as zi}from"node:fs";import{dirname as MO,join as z$}from"node:path";var Y$=["codex","claude-code","cursor"],G$=z$(".agents","skills"),Yi={codex:"Codex","claude-code":"Claude Code",cursor:"Cursor"},Gi=[{directory:"aiwiki-knowledge",content:`---
468
+ `).all($).map((T)=>({source:T.source_id,sessionCount:T.session_count})),sessions:hq(_,$)}}import{existsSync as TZ,mkdirSync as OZ,writeFileSync as sO}from"node:fs";import{dirname as HZ,join as mq}from"node:path";var lq=["codex","claude-code","cursor"],pq=mq(".agents","skills"),iO={codex:"Codex","claude-code":"Claude Code",cursor:"Cursor"},nO=[{directory:"aiwiki-knowledge",content:`---
404
469
  name: aiwiki-knowledge
405
470
  description: 用 llm-iwiki 把当前项目跨 AI 工具的会话沉淀成知识库——采集会话、生成总结与经验、导出到 Obsidian。当用户提到"沉淀/总结这次工作""存进知识库""项目复盘""跑一下 llm-iwiki"或想把会话经验归档时使用。
406
471
  ---
@@ -428,29 +493,36 @@ description: 用 llm-iwiki 把当前项目跨 AI 工具的会话沉淀成知识
428
493
  llm-iwiki projects inspect .
429
494
  \`\`\`
430
495
  若显示 \`sessions: 0\`,说明本机暂无该项目会话,停止并告知用户。
496
+ 若报「找不到唯一项目 / 多个候选」,先运行 \`llm-iwiki projects dedupe\` 合并重复项目,或用 \`--project <proj_xxx>\` 精确指定(\`--project\` 接受 路径 / proj_id / 名称)。
497
+
498
+ 写摘要前,如需核对某条会话的真实内容(强烈建议,避免编造):
499
+ \`\`\`bash
500
+ llm-iwiki sessions list --project . # 列出会话与其 id
501
+ llm-iwiki sessions read <session-id> # 查看压缩后的真实对话正文
502
+ \`\`\`
431
503
 
432
504
  2. 生成总结任务文件(想覆盖全部历史把 \`changed\` 换成 \`all\`):
433
505
  \`\`\`bash
434
- llm-iwiki summarize prepare changed --project . --out .llm-iwiki/tasks/summaries-task.md
506
+ llm-iwiki summarize prepare changed --project . --out .llm-iwiki/exchange/summaries-task.md
435
507
  \`\`\`
436
508
 
437
- 3. 阅读 \`.llm-iwiki/tasks/summaries-task.md\`,据此**新建** \`.llm-iwiki/tasks/summaries.yaml\`(纯 YAML,见下方规则)。
509
+ 3. 阅读 \`.llm-iwiki/exchange/summaries-task.md\`,据此**新建** \`.llm-iwiki/exchange/summaries.yaml\`(纯 YAML,见下方规则)。
438
510
 
439
511
  4. 落库;若报解析 / 校验错,按报错修正 YAML 后重跑:
440
512
  \`\`\`bash
441
- llm-iwiki summarize apply --project . --file .llm-iwiki/tasks/summaries.yaml
513
+ llm-iwiki summarize apply --project . --file .llm-iwiki/exchange/summaries.yaml
442
514
  \`\`\`
443
515
 
444
516
  5. 生成经验任务文件(只吃 value=medium/high 的总结):
445
517
  \`\`\`bash
446
- llm-iwiki experiences prepare --project . --from changed-summaries --out .llm-iwiki/tasks/experiences-task.md
518
+ llm-iwiki experiences prepare --project . --from changed-summaries --out .llm-iwiki/exchange/experiences-task.md
447
519
  \`\`\`
448
520
 
449
- 6. 阅读 \`.llm-iwiki/tasks/experiences-task.md\`,据此**新建** \`.llm-iwiki/tasks/experiences.yaml\`(纯 YAML)。
521
+ 6. 阅读 \`.llm-iwiki/exchange/experiences-task.md\`,据此**新建** \`.llm-iwiki/exchange/experiences.yaml\`(纯 YAML)。
450
522
 
451
523
  7. 落库为候选:
452
524
  \`\`\`bash
453
- llm-iwiki experiences propose --project . --file .llm-iwiki/tasks/experiences.yaml
525
+ llm-iwiki experiences propose --project . --file .llm-iwiki/exchange/experiences.yaml
454
526
  \`\`\`
455
527
 
456
528
  8. 列出候选交用户决定,**不要自行 accept**:
@@ -473,8 +545,9 @@ description: 用 llm-iwiki 把当前项目跨 AI 工具的会话沉淀成知识
473
545
  - 不要用 \`\`\` 代码围栏把整段内容包起来;
474
546
  - 不要保留 \`<...>\` 占位符,全部换成真实内容。
475
547
  - \`project_id\` 用对应任务文件顶部给出的值。
548
+ - 内容必须来自真实会话(必要时先 \`sessions read\`),禁止编造;落库时会校验占位符,残留 \`<...>\` 会被拒绝。
476
549
  - summaries 每条:\`session_id\`(与任务文件里会话块标题的 id 完全一致)、\`title\`、\`value\`(只能是 none / low / medium / high 之一)、\`summary_markdown\`(用 \`|\` 块标量,正文缩进保持一致)。
477
- - experiences 每条:\`title\`、\`summary\`、\`body_markdown\`、\`source_sessions\`(字符串数组)必填;\`slug\`、\`confidence\`(low / medium / high)可选。
550
+ - experiences 每条:\`title\`、\`summary\`、\`body_markdown\`、\`source_sessions\`(字符串数组)必填;\`slug\`、\`confidence\`(low / medium / high)可选;\`topic\`(跨项目主题,如 backend)、\`tech_stack\`(字符串数组)、\`problem_type\` 可选,填了能让知识库自动分类与建立主题索引。
478
551
 
479
552
  ### summaries.yaml 正确示例
480
553
 
@@ -511,24 +584,19 @@ experiences:
511
584
  source_sessions:
512
585
  - cc_ab12cd34
513
586
  confidence: medium
587
+ topic: backend
588
+ tech_stack: [go, kratos]
589
+ problem_type: 登录态
514
590
  \`\`\`
515
- `}];function jO(u,_){if(!_)return u;return`${u}
591
+ `}];function XZ(_,$){if(!$)return _;return`${_}
516
592
  ## 适配工具
517
593
 
518
- 本 skill 为 ${Yi[_]} 初始化。
519
- `}function QO(u){return u instanceof Error&&"code"in u&&u.code==="EEXIST"}function Wi(){return Y$.map((u)=>({id:u,name:Yi[u]}))}function Xi(){return Gi.map((u)=>({directory:u.directory,relPath:z$(G$,u.directory,"SKILL.md")}))}function Ji(u){let _=[],s=[];for(let $ of Gi){let w=z$(u.cwd,".agents","skills",$.directory,"SKILL.md");if(BO(w)&&!u.force){s.push(w);continue}if(_.push(w),u.dryRun)continue;ZO(MO(w),{recursive:!0});let f=jO($.content,u.target);if(u.force){zi(w,f);continue}try{zi(w,f,{flag:"wx"})}catch(i){if(!QO(i))throw i;_.pop(),s.push(w)}}return{written:_,skipped:s}}var NO={maxPerMessage:1200,maxMessages:60};function VO(u){return u.replace(/[ \t]+\n/g,`
520
- `).replace(/\n{3,}/g,`
521
-
522
- `).trim()}function bO(u,_){let s=VO(u);if(s.length<=_)return s;return`${s.slice(0,_)}
523
- …[truncated ${s.length-_} chars]`}function Bi(u,_={}){let s={...NO,..._},$=u.filter((g)=>g.content.trim()!==""),w=$,f="";if($.length>s.maxMessages){let g=Math.ceil(s.maxMessages*0.6),R=s.maxMessages-g;w=[...$.slice(0,g),...$.slice($.length-R)],f=`
524
- …[omitted ${$.length-s.maxMessages} middle messages]
525
- `}let i=[];return w.forEach((g,R)=>{if(f&&R===Math.ceil(s.maxMessages*0.6))i.push(f);let S=g.role==="user"?"User":g.role==="assistant"?"Assistant":g.role;i.push(`**${S}:** ${bO(g.content,s.maxPerMessage)}`)}),i.join(`
526
-
527
- `)}var EO=`## 输出格式(务必遵守)
594
+ 本 skill 为 ${iO[$]} 初始化。
595
+ `}function UZ(_){return _ instanceof Error&&"code"in _&&_.code==="EEXIST"}function aO(){return lq.map((_)=>({id:_,name:iO[_]}))}function rO(){return nO.map((_)=>({directory:_.directory,relPath:mq(pq,_.directory,"SKILL.md")}))}function oO(_){let $=[],q=[];for(let T of nO){let O=mq(_.cwd,".agents","skills",T.directory,"SKILL.md");if(TZ(O)&&!_.force){q.push(O);continue}if($.push(O),_.dryRun)continue;OZ(HZ(O),{recursive:!0});let H=XZ(T.content,_.target);if(_.force){sO(O,H);continue}try{sO(O,H,{flag:"wx"})}catch(X){if(!UZ(X))throw X;$.pop(),q.push(O)}}return{written:$,skipped:q}}var JZ=`## 输出格式(务必遵守)
528
596
 
529
597
  本文件(\`summaries-task.md\`)是任务说明,请勿修改它。
530
- 请**另外新建**一个纯 YAML 文件 \`.llm-iwiki/tasks/summaries.yaml\`,然后运行:
531
- \`llm-iwiki summarize apply --project . --file .llm-iwiki/tasks/summaries.yaml\`
598
+ 请**另外新建**一个纯 YAML 文件 \`.llm-iwiki/exchange/summaries.yaml\`,然后运行:
599
+ \`llm-iwiki summarize apply --project . --file .llm-iwiki/exchange/summaries.yaml\`
532
600
 
533
601
  输出文件规则:
534
602
  - 只能是 YAML 内容,不要写 Markdown 标题或说明文字,也不要用 \`\`\` 代码围栏把它包起来。
@@ -552,13 +620,13 @@ summaries:
552
620
  做了哪些选择、为什么。
553
621
  ## 结论
554
622
  最终结果与后续动作。
555
- \`\`\``;function Zi(u,_,s){let $=Ai(u,_,s),w=[];for(let i of $){let g=Pi(u,i.id);if(g.length===0)continue;let R=Bi(g);w.push([`### ${i.id}`,`- source: ${i.sourceId}`,`- title: ${i.title??"(无标题)"}`,`- messages: ${i.messageCount}`,"",R].join(`
556
- `))}return{markdown:["# Summaries Task","",`project_id: ${_}`,`scope: ${s}`,`sessions: ${w.length}`,"",EO,"","---","",w.join(`
623
+ \`\`\``;function tO(_,$,q){let T=dO(_,$,q),O=[];for(let X of T){let U=vq(_,X.id);if(U.length===0)continue;let J=J$(U);O.push([`### ${X.id}`,`- source: ${X.sourceId}`,`- title: ${X.title??"(无标题)"}`,`- messages: ${X.messageCount}`,"",J].join(`
624
+ `))}return{markdown:["# Summaries Task","",`project_id: ${$}`,`scope: ${q}`,`sessions: ${O.length}`,"",JZ,"","---","",O.join(`
557
625
 
558
626
  ---
559
627
 
560
628
  `),""].join(`
561
- `),sessionCount:w.length}}function CO(u){return h(u)}function Mi(u,_){let s=new Date().toISOString(),$=0,w=[];return u.transaction(()=>{for(let i of _.summaries){let g=u.query("SELECT project_id FROM sessions WHERE id = ?").get(i.sessionId);if(!g){w.push(i.sessionId);continue}u.query(`
629
+ `),sessionCount:O.length}}function ZZ(_){return h(_)}function eO(_,$){let q=new Date().toISOString(),T=0,O=[];return _.transaction(()=>{for(let X of $.summaries){let U=_.query("SELECT project_id FROM sessions WHERE id = ?").get(X.sessionId);if(!U){O.push(X.sessionId);continue}_.query(`
562
630
  INSERT INTO session_summaries (id, session_id, project_id, title, value, summary_markdown, metadata_json, created_at, updated_at)
563
631
  VALUES ($id, $sessionId, $projectId, $title, $value, $summaryMarkdown, $metadata, $now, $now)
564
632
  ON CONFLICT(id) DO UPDATE SET
@@ -567,18 +635,18 @@ summaries:
567
635
  summary_markdown = excluded.summary_markdown,
568
636
  metadata_json = excluded.metadata_json,
569
637
  updated_at = excluded.updated_at
570
- `).run({$id:`sum_${CO(i.sessionId)}`,$sessionId:i.sessionId,$projectId:g.project_id??_.projectId,$title:i.title,$value:i.value,$summaryMarkdown:i.summaryMarkdown,$metadata:JSON.stringify(i.metadata),$now:s}),$+=1}})(),{written:$,skipped:w}}import{existsSync as Ni,readdirSync as Qi,readFileSync as yO,realpathSync as dO,statSync as nO}from"node:fs";import{basename as hO,join as o_}from"node:path";import{tmpdir as rO}from"node:os";var ji=120,lO=["/tmp/","/private/tmp/","/var/folders/","/private/var/folders/"];function m(u){if(!u)return!1;let _=rO();if(u===_)return!0;let s=u.endsWith("/")?u:`${u}/`;return[...lO,`${_}/`].some((w)=>s.startsWith(w))}function eu(u){return u.length>ji?`${u.slice(0,ji)}…`:u}function KO(u){for(let _ of u.split(`
571
- `)){let s=_.trim();if(s===""||/^[-=*#>`~]+$/.test(s))continue;return s}return null}function c(u){for(let _ of u){if(_.role!=="user")continue;let s=KO(_.content);if(s)return eu(s)}return null}function Bu(u){if(typeof u==="string")return u;if(Array.isArray(u))return u.map((_)=>{if(typeof _==="string")return _;if(_&&typeof _==="object"){let s=_;if(typeof s.text==="string")return s.text;return JSON.stringify(s)}return String(_)}).join(`
572
- `).trim();if(u==null)return"";return JSON.stringify(u)}var Vi=[".claude/projects",".claude-internal/projects"];function mO(u){let s=yO(u,"utf8").split(`
573
- `),$=[],w=null,f=null;for(let g of s){let R=g.trim();if(R==="")continue;let S;try{S=JSON.parse(R)}catch{continue}if(typeof S.sessionId==="string"&&!f)f=S.sessionId;if(typeof S.cwd==="string"&&!w)w=S.cwd;let L=S.type;if(L!=="user"&&L!=="assistant")continue;if(S.isSidechain===!0)continue;let I=S.message;if(!I||typeof I!=="object")continue;let T=I,O=typeof T.role==="string"?T.role:L,H=Bu(T.content);if(H.trim()==="")continue;$.push({role:O,content:H,timestamp:typeof S.timestamp==="string"?S.timestamp:null})}if($.length===0)return null;if(m(w))return null;f??=hO(u).replace(/\.jsonl$/,"");let i=$.map((g)=>g.timestamp).filter((g)=>g!=null);return{sourceSessionId:f,rawPath:u,rawProjectPath:w,title:c($),createdAt:i[0]??null,updatedAt:i[i.length-1]??null,messages:$}}function cO(u){let _=[],s=new Set;for(let $ of Vi){let w=o_(u,$);if(!Ni(w))continue;let f;try{f=dO(w)}catch{f=w}if(s.has(f))continue;s.add(f);for(let i of Qi(w,{withFileTypes:!0})){if(!i.isDirectory())continue;let g=o_(w,i.name);for(let R of Qi(g,{withFileTypes:!0}))if(R.isFile()&&R.name.endsWith(".jsonl"))_.push(o_(g,R.name))}}return _}var bi={id:"claude-code",name:"Claude Code",detect(u){return Vi.some((_)=>Ni(o_(u,_)))},collect(u){let _=[];for(let s of cO(u))try{if(!nO(s).isFile())continue;let $=mO(s);if($)_.push($)}catch{continue}return _}};import{existsSync as Ci,readdirSync as ri,readFileSync as xO,statSync as kO}from"node:fs";import{join as iu}from"node:path";var pO="Library/Application Support",aO=["CodeBuddyExtension","CodeBuddy CN"];function li(u,_,s=0){if(s>6)return;let $;try{$=ri(u,{withFileTypes:!0})}catch{return}for(let w of $){if(!w.isDirectory())continue;let f=iu(u,w.name);if(w.name==="history")_.push(f);else if(w.name!=="messages")li(f,_,s+1)}}function W$(u){try{return JSON.parse(xO(u,"utf8"))}catch{return null}}function tO(u){if(typeof u!=="string")return Bu(u);let _=u.trim();if(_.startsWith("{")||_.startsWith("["))try{let s=JSON.parse(_);if(s&&typeof s==="object"&&"content"in s)return Bu(s.content);return Bu(s)}catch{return u}return u}function vO(u){let _=u.match(/Workspace Folder:\s*(.+)/);if(!_)return null;let s=_[1].trim();return s===""?null:s}function oO(u,_,s){let $=W$(iu(u,"index.json"));if(!$?.messages)return null;let w=[],f=null;for(let g of $.messages){let R=W$(iu(u,"messages",`${g.id}.json`));if(!R)continue;let S=g.role??R.role??"user";if(S!=="user"&&S!=="assistant")continue;let L=tO(R.message);if(L.trim()==="")continue;if(!f&&S==="user")f=vO(L);w.push({role:S,content:L,timestamp:null})}if(w.length===0)return null;if(m(f))return null;let i=s.name&&s.name.trim()!==""?eu(s.name.trim()):c(w);return{sourceSessionId:_,rawPath:u,rawProjectPath:f,title:i,createdAt:s.createdAt??null,updatedAt:s.lastMessageAt??null,messages:w}}function eO(u,_){for(let s of ri(u,{withFileTypes:!0})){if(!s.isDirectory())continue;let $=iu(u,s.name),w=W$(iu($,"index.json"));if(!w?.conversations?.length)continue;for(let f of w.conversations){if(!f.id)continue;let i=iu($,f.id);if(!Ci(i))continue;try{let g=oO(i,f.id,f);if(g)_.push(g)}catch{continue}}}}function Ei(u){return aO.map((_)=>iu(u,pO,_)).filter((_)=>Ci(_))}var Ki={id:"codebuddy",name:"CodeBuddy",detect(u){return Ei(u).length>0},collect(u){let _=[],s=new Set;for(let $ of Ei(u)){let w=[];li(iu($,"Data"),w);for(let f of w){try{if(!kO(f).isDirectory())continue}catch{continue}eO(f,_)}}return _.filter(($)=>{if(s.has($.sourceSessionId))return!1;return s.add($.sourceSessionId),!0})}};import{existsSync as yi,readdirSync as uU,readFileSync as _U,realpathSync as sU,statSync as $U}from"node:fs";import{basename as wU,join as X$}from"node:path";var di=[".codex/sessions",".codex-internal/sessions"];function fU(u){return u.replace(/\[REQ:[0-9a-f-]+\]/gi,"").replace(/\[AMP_DONE:[0-9a-f-]+\]/gi,"").trim()}function ni(u,_){for(let s of uU(u,{withFileTypes:!0})){let $=X$(u,s.name);if(s.isDirectory())ni($,_);else if(s.isFile()&&s.name.startsWith("rollout-")&&s.name.endsWith(".jsonl"))_.push($)}}function iU(u){let _=_U(u,"utf8"),s=[],$=null,w=null,f=null;for(let g of _.split(`
574
- `)){let R=g.trim();if(R==="")continue;let S;try{S=JSON.parse(R)}catch{continue}let L=S.payload;if(!L||typeof L!=="object")continue;let I=L,T=typeof S.timestamp==="string"?S.timestamp:null;if(S.type==="session_meta"){if(typeof I.id==="string")w=I.id;if(typeof I.cwd==="string")$=I.cwd;if(typeof I.timestamp==="string")f=I.timestamp;continue}if(S.type!=="event_msg")continue;let O=I.type;if(O!=="user_message"&&O!=="agent_message")continue;if(typeof I.message!=="string")continue;let H=fU(I.message);if(H==="")continue;s.push({role:O==="user_message"?"user":"assistant",content:H,timestamp:T})}if(s.length===0)return null;if(m($))return null;w??=wU(u).replace(/\.jsonl$/,"");let i=s.map((g)=>g.timestamp).filter((g)=>g!=null);return{sourceSessionId:w,rawPath:u,rawProjectPath:$,title:c(s),createdAt:f??i[0]??null,updatedAt:i[i.length-1]??null,messages:s}}function gU(u){let _=[],s=new Set;for(let $ of di){let w=X$(u,$);if(!yi(w))continue;let f;try{f=sU(w)}catch{f=w}if(s.has(f))continue;s.add(f),ni(w,_)}return _}var hi={id:"codex",name:"Codex",detect(u){return di.some((_)=>yi(X$(u,_)))},collect(u){let _=[];for(let s of gU(u))try{if(!$U(s).isFile())continue;let $=iU(s);if($)_.push($)}catch{continue}return _}};import{existsSync as u_,readdirSync as RU,readFileSync as SU}from"node:fs";import{join as Ou}from"node:path";var mi="Library/Application Support/Cursor/User";function J$(u){if(typeof u!=="number"||!Number.isFinite(u))return null;let _=new Date(u);return Number.isNaN(_.getTime())?null:_.toISOString()}function IU(u){if(!u.startsWith("file://"))return null;try{return decodeURIComponent(u.replace(/^file:\/\//,"")).replace(/\/+$/,"")}catch{return null}}function ci(u){return vf(u)}function TU(u){let _=new Map,s=Ou(u,"workspaceStorage");if(!u_(s))return _;for(let $ of RU(s,{withFileTypes:!0})){if(!$.isDirectory())continue;let w=Ou(s,$.name),f=null,i=Ou(w,"workspace.json");if(u_(i))try{let S=JSON.parse(SU(i,"utf8"));if(typeof S.folder==="string")f=IU(S.folder)}catch{}let g=Ou(w,"state.vscdb");if(!u_(g))continue;let R=ci(g);if(!R)continue;try{let S=R.query("SELECT value FROM ItemTable WHERE key = ?").get("composer.composerData");if(!S)continue;let L=JSON.parse(S.value);for(let I of L.allComposers??[]){let T=I.composerId;if(typeof T!=="string")continue;if(_.has(T))continue;_.set(T,{cwd:f,name:typeof I.name==="string"?I.name:null,createdAt:J$(I.createdAt),updatedAt:J$(I.lastUpdatedAt)})}}catch{}finally{R.close()}}return _}function qU(u,_,s,$){let w=u.query("SELECT value FROM cursorDiskKV WHERE key = ?").get(`composerData:${s}`);if(!w)return null;let f;try{f=JSON.parse(w.value)}catch{return null}let i=f.fullConversationHeadersOnly??[];if(i.length===0)return null;let g=u.query("SELECT value FROM cursorDiskKV WHERE key = ?"),R=[];for(let I of i){if(I.type!==1&&I.type!==2)continue;let T=g.get(`bubbleId:${s}:${I.bubbleId}`);if(!T)continue;let O;try{O=JSON.parse(T.value)}catch{continue}let H=typeof O.text==="string"?O.text.trim():"";if(H==="")continue;R.push({role:I.type===1?"user":"assistant",content:H,timestamp:null})}if(R.length===0)return null;if(m($.cwd))return null;let S=$.name??f.name??null,L=S&&S.trim()!==""?eu(S.trim()):c(R);return{sourceSessionId:s,rawPath:`${_}#${s}`,rawProjectPath:$.cwd,title:L,createdAt:$.createdAt??J$(f.createdAt),updatedAt:$.updatedAt,messages:R}}var xi={id:"cursor",name:"Cursor",detect(u){return u_(Ou(u,mi,"globalStorage","state.vscdb"))},collect(u){let _=Ou(u,mi),s=Ou(_,"globalStorage","state.vscdb");if(!u_(s))return[];let $=TU(_);if($.size===0)return[];let w=ci(s);if(!w)return[];let f=[];try{for(let[i,g]of $)try{let R=qU(w,s,i,g);if(R)f.push(R)}catch{continue}}finally{w.close()}return f}};import{existsSync as __,readdirSync as ki,readFileSync as ti,realpathSync as LU,statSync as OU}from"node:fs";import{basename as vi,dirname as pi,join as Zu}from"node:path";var UU=[".gemini-internal",".gemini"];function HU(u){let _=new Map,s=Zu(u,"projects.json");if(!__(s))return _;try{let $=JSON.parse(ti(s,"utf8"));for(let[w,f]of Object.entries($.projects??{}))if(typeof f==="string"&&!_.has(f))_.set(f,w)}catch{}return _}function DU(u){let _=u.trim();return _.startsWith("/")&&!_.includes(`
575
- `)&&_.length<256}function PU(u,_,s){let $;try{$=JSON.parse(ti(u,"utf8"))}catch{return null}let w=[];for(let g of $.messages??[]){if(g.type!=="user"&&g.type!=="gemini")continue;let R=typeof g.content==="string"?g.content:"";if(R.trim()==="")continue;w.push({role:g.type==="user"?"user":"assistant",content:R,timestamp:typeof g.timestamp==="string"?g.timestamp:null})}if(w.length===0)return null;let f=s.get(_)??null;if(!f){let g=w.find((R)=>R.role==="user");if(g&&DU(g.content))f=g.content.trim().replace(/\/+$/,"")}if(m(f))return null;let i=w.map((g)=>g.timestamp).filter((g)=>g!=null);return{sourceSessionId:$.sessionId??vi(u).replace(/\.json$/,""),rawPath:u,rawProjectPath:f,title:c(w),createdAt:$.startTime??i[0]??null,updatedAt:$.lastUpdated??i[i.length-1]??null,messages:w}}function ai(u){let _=new Set;for(let s of UU){let $=Zu(u,s);if(!__($))continue;let w;try{w=LU($)}catch{w=$}if(_.has(w))continue;return _.add(w),$}return null}function AU(u){let _=Zu(u,"tmp");if(!__(_))return[];let s=[];for(let $ of ki(_,{withFileTypes:!0})){if(!$.isDirectory())continue;let w=Zu(_,$.name,"chats");if(!__(w))continue;for(let f of ki(w,{withFileTypes:!0}))if(f.isFile()&&f.name.startsWith("session-")&&f.name.endsWith(".json"))s.push(Zu(w,f.name))}return s}var oi={id:"gemini",name:"Gemini",detect(u){let _=ai(u);return _!=null&&__(Zu(_,"tmp"))},collect(u){let _=ai(u);if(!_)return[];let s=HU(_),$=[];for(let w of AU(_))try{if(!OU(w).isFile())continue;let f=vi(pi(pi(w))),i=PU(w,f,s);if(i)$.push(i)}catch{continue}return $}};var ei=[bi,hi,xi,oi,Ki];function B$(u){return h(u)}function FU(u,_){return`ses_${B$(`${u}\x00${_.sourceSessionId}\x00${_.rawPath}`)}`}function zU(u,_){return B$(`${u}\x00${_}`)}function YU(u){return B$(`${u.length}\x00${u.join("\x00")}`)}function GU(u,_,s){u.query(`
638
+ `).run({$id:`sum_${ZZ(X.sessionId)}`,$sessionId:X.sessionId,$projectId:U.project_id??$.projectId,$title:X.title,$value:X.value,$summaryMarkdown:X.summaryMarkdown,$metadata:JSON.stringify(X.metadata),$now:q}),T+=1}})(),{written:T,skipped:O}}import{existsSync as qH,readdirSync as $H,readFileSync as WZ,realpathSync as RZ,statSync as YZ}from"node:fs";import{basename as LZ,join as G0}from"node:path";import{tmpdir as zZ}from"node:os";var _H=120,GZ=["/tmp/","/private/tmp/","/var/folders/","/private/var/folders/"];function s(_){if(!_)return!1;let $=zZ();if(_===$)return!0;let q=_.endsWith("/")?_:`${_}/`;return[...GZ,`${$}/`].some((O)=>q.startsWith(O))}function Z$(_){return _.length>_H?`${_.slice(0,_H)}…`:_}function QZ(_){for(let $ of _.split(`
639
+ `)){let q=$.trim();if(q===""||/^[-=*#>`~]+$/.test(q))continue;return q}return null}function i(_){for(let $ of _){if($.role!=="user")continue;let q=QZ($.content);if(q)return Z$(q)}return null}function j_(_){if(typeof _==="string")return _;if(Array.isArray(_))return _.map(($)=>{if(typeof $==="string")return $;if($&&typeof $==="object"){let q=$;if(typeof q.text==="string")return q.text;return JSON.stringify(q)}return String($)}).join(`
640
+ `).trim();if(_==null)return"";return JSON.stringify(_)}var TH=[".claude/projects",".claude-internal/projects"];function VZ(_){let q=WZ(_,"utf8").split(`
641
+ `),T=[],O=null,H=null;for(let U of q){let J=U.trim();if(J==="")continue;let Z;try{Z=JSON.parse(J)}catch{continue}if(typeof Z.sessionId==="string"&&!H)H=Z.sessionId;if(typeof Z.cwd==="string"&&!O)O=Z.cwd;let z=Z.type;if(z!=="user"&&z!=="assistant")continue;if(Z.isSidechain===!0)continue;let G=Z.message;if(!G||typeof G!=="object")continue;let Q=G,Y=typeof Q.role==="string"?Q.role:z,R=j_(Q.content);if(R.trim()==="")continue;T.push({role:Y,content:R,timestamp:typeof Z.timestamp==="string"?Z.timestamp:null})}if(T.length===0)return null;if(s(O))return null;H??=LZ(_).replace(/\.jsonl$/,"");let X=T.map((U)=>U.timestamp).filter((U)=>U!=null);return{sourceSessionId:H,rawPath:_,rawProjectPath:O,title:i(T),createdAt:X[0]??null,updatedAt:X[X.length-1]??null,messages:T}}function BZ(_){let $=[],q=new Set;for(let T of TH){let O=G0(_,T);if(!qH(O))continue;let H;try{H=RZ(O)}catch{H=O}if(q.has(H))continue;q.add(H);for(let X of $H(O,{withFileTypes:!0})){if(!X.isDirectory())continue;let U=G0(O,X.name);for(let J of $H(U,{withFileTypes:!0}))if(J.isFile()&&J.name.endsWith(".jsonl"))$.push(G0(U,J.name))}}return $}var OH={id:"claude-code",name:"Claude Code",detect(_){return TH.some(($)=>qH(G0(_,$)))},collect(_){let $=[];for(let q of BZ(_))try{if(!YZ(q).isFile())continue;let T=VZ(q);if(T)$.push(T)}catch{continue}return $}};import{existsSync as XH,readdirSync as UH,readFileSync as wZ,statSync as AZ}from"node:fs";import{join as z_}from"node:path";var DZ="Library/Application Support",MZ=["CodeBuddyExtension","CodeBuddy CN"];function JH(_,$,q=0){if(q>6)return;let T;try{T=UH(_,{withFileTypes:!0})}catch{return}for(let O of T){if(!O.isDirectory())continue;let H=z_(_,O.name);if(O.name==="history")$.push(H);else if(O.name!=="messages")JH(H,$,q+1)}}function dq(_){try{return JSON.parse(wZ(_,"utf8"))}catch{return null}}function IZ(_){if(typeof _!=="string")return j_(_);let $=_.trim();if($.startsWith("{")||$.startsWith("["))try{let q=JSON.parse($);if(q&&typeof q==="object"&&"content"in q)return j_(q.content);return j_(q)}catch{return _}return _}function FZ(_){let $=_.match(/Workspace Folder:\s*(.+)/);if(!$)return null;let q=$[1].trim();return q===""?null:q}function SZ(_,$,q){let T=dq(z_(_,"index.json"));if(!T?.messages)return null;let O=[],H=null;for(let U of T.messages){let J=dq(z_(_,"messages",`${U.id}.json`));if(!J)continue;let Z=U.role??J.role??"user";if(Z!=="user"&&Z!=="assistant")continue;let z=IZ(J.message);if(z.trim()==="")continue;if(!H&&Z==="user")H=FZ(z);O.push({role:Z,content:z,timestamp:null})}if(O.length===0)return null;if(s(H))return null;let X=q.name&&q.name.trim()!==""?Z$(q.name.trim()):i(O);return{sourceSessionId:$,rawPath:_,rawProjectPath:H,title:X,createdAt:q.createdAt??null,updatedAt:q.lastMessageAt??null,messages:O}}function KZ(_,$){for(let q of UH(_,{withFileTypes:!0})){if(!q.isDirectory())continue;let T=z_(_,q.name),O=dq(z_(T,"index.json"));if(!O?.conversations?.length)continue;for(let H of O.conversations){if(!H.id)continue;let X=z_(T,H.id);if(!XH(X))continue;try{let U=SZ(X,H.id,H);if(U)$.push(U)}catch{continue}}}}function HH(_){return MZ.map(($)=>z_(_,DZ,$)).filter(($)=>XH($))}var ZH={id:"codebuddy",name:"CodeBuddy",detect(_){return HH(_).length>0},collect(_){let $=[],q=new Set;for(let T of HH(_)){let O=[];JH(z_(T,"Data"),O);for(let H of O){try{if(!AZ(H).isDirectory())continue}catch{continue}KZ(H,$)}}return $.filter((T)=>{if(q.has(T.sourceSessionId))return!1;return q.add(T.sourceSessionId),!0})}};import{existsSync as zH,readdirSync as NZ,readFileSync as CZ,realpathSync as PZ,statSync as fZ}from"node:fs";import{basename as EZ,join as cq}from"node:path";var GH=[".codex/sessions",".codex-internal/sessions"];function jZ(_){return _.replace(/\[REQ:[0-9a-f-]+\]/gi,"").replace(/\[AMP_DONE:[0-9a-f-]+\]/gi,"").trim()}function QH(_,$){for(let q of NZ(_,{withFileTypes:!0})){let T=cq(_,q.name);if(q.isDirectory())QH(T,$);else if(q.isFile()&&q.name.startsWith("rollout-")&&q.name.endsWith(".jsonl"))$.push(T)}}function bZ(_){let $=CZ(_,"utf8"),q=[],T=null,O=null,H=null;for(let U of $.split(`
642
+ `)){let J=U.trim();if(J==="")continue;let Z;try{Z=JSON.parse(J)}catch{continue}let z=Z.payload;if(!z||typeof z!=="object")continue;let G=z,Q=typeof Z.timestamp==="string"?Z.timestamp:null;if(Z.type==="session_meta"){if(typeof G.id==="string")O=G.id;if(typeof G.cwd==="string")T=G.cwd;if(typeof G.timestamp==="string")H=G.timestamp;continue}if(Z.type!=="event_msg")continue;let Y=G.type;if(Y!=="user_message"&&Y!=="agent_message")continue;if(typeof G.message!=="string")continue;let R=jZ(G.message);if(R==="")continue;q.push({role:Y==="user_message"?"user":"assistant",content:R,timestamp:Q})}if(q.length===0)return null;if(s(T))return null;O??=EZ(_).replace(/\.jsonl$/,"");let X=q.map((U)=>U.timestamp).filter((U)=>U!=null);return{sourceSessionId:O,rawPath:_,rawProjectPath:T,title:i(q),createdAt:H??X[0]??null,updatedAt:X[X.length-1]??null,messages:q}}function gZ(_){let $=[],q=new Set;for(let T of GH){let O=cq(_,T);if(!zH(O))continue;let H;try{H=PZ(O)}catch{H=O}if(q.has(H))continue;q.add(H),QH(O,$)}return $}var WH={id:"codex",name:"Codex",detect(_){return GH.some(($)=>zH(cq(_,$)))},collect(_){let $=[];for(let q of gZ(_))try{if(!fZ(q).isFile())continue;let T=bZ(q);if(T)$.push(T)}catch{continue}return $}};import{existsSync as z$,readdirSync as yZ,readFileSync as xZ}from"node:fs";import{join as w_}from"node:path";var RH="Library/Application Support/Cursor/User";function sq(_){if(typeof _!=="number"||!Number.isFinite(_))return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$.toISOString()}function kZ(_){if(!_.startsWith("file://"))return null;try{return decodeURIComponent(_.replace(/^file:\/\//,"")).replace(/\/+$/,"")}catch{return null}}function YH(_){return VO(_)}function uZ(_){let $=new Map,q=w_(_,"workspaceStorage");if(!z$(q))return $;for(let T of yZ(q,{withFileTypes:!0})){if(!T.isDirectory())continue;let O=w_(q,T.name),H=null,X=w_(O,"workspace.json");if(z$(X))try{let Z=JSON.parse(xZ(X,"utf8"));if(typeof Z.folder==="string")H=kZ(Z.folder)}catch{}let U=w_(O,"state.vscdb");if(!z$(U))continue;let J=YH(U);if(!J)continue;try{let Z=J.query("SELECT value FROM ItemTable WHERE key = ?").get("composer.composerData");if(!Z)continue;let z=JSON.parse(Z.value);for(let G of z.allComposers??[]){let Q=G.composerId;if(typeof Q!=="string")continue;if($.has(Q))continue;$.set(Q,{cwd:H,name:typeof G.name==="string"?G.name:null,createdAt:sq(G.createdAt),updatedAt:sq(G.lastUpdatedAt)})}}catch{}finally{J.close()}}return $}function hZ(_,$,q,T){let O=_.query("SELECT value FROM cursorDiskKV WHERE key = ?").get(`composerData:${q}`);if(!O)return null;let H;try{H=JSON.parse(O.value)}catch{return null}let X=H.fullConversationHeadersOnly??[];if(X.length===0)return null;let U=_.query("SELECT value FROM cursorDiskKV WHERE key = ?"),J=[];for(let G of X){if(G.type!==1&&G.type!==2)continue;let Q=U.get(`bubbleId:${q}:${G.bubbleId}`);if(!Q)continue;let Y;try{Y=JSON.parse(Q.value)}catch{continue}let R=typeof Y.text==="string"?Y.text.trim():"";if(R==="")continue;J.push({role:G.type===1?"user":"assistant",content:R,timestamp:null})}if(J.length===0)return null;if(s(T.cwd))return null;let Z=T.name??H.name??null,z=Z&&Z.trim()!==""?Z$(Z.trim()):i(J);return{sourceSessionId:q,rawPath:`${$}#${q}`,rawProjectPath:T.cwd,title:z,createdAt:T.createdAt??sq(H.createdAt),updatedAt:T.updatedAt,messages:J}}var LH={id:"cursor",name:"Cursor",detect(_){return z$(w_(_,RH,"globalStorage","state.vscdb"))},collect(_){let $=w_(_,RH),q=w_($,"globalStorage","state.vscdb");if(!z$(q))return[];let T=uZ($);if(T.size===0)return[];let O=YH(q);if(!O)return[];let H=[];try{for(let[X,U]of T)try{let J=hZ(O,q,X,U);if(J)H.push(J)}catch{continue}}finally{O.close()}return H}};import{existsSync as G$,readdirSync as VH,readFileSync as AH,realpathSync as vZ,statSync as mZ}from"node:fs";import{basename as DH,dirname as BH,join as b_}from"node:path";var lZ=[".gemini-internal",".gemini"];function pZ(_){let $=new Map,q=b_(_,"projects.json");if(!G$(q))return $;try{let T=JSON.parse(AH(q,"utf8"));for(let[O,H]of Object.entries(T.projects??{}))if(typeof H==="string"&&!$.has(H))$.set(H,O)}catch{}return $}function dZ(_){let $=_.trim();return $.startsWith("/")&&!$.includes(`
643
+ `)&&$.length<256}function cZ(_,$,q){let T;try{T=JSON.parse(AH(_,"utf8"))}catch{return null}let O=[];for(let U of T.messages??[]){if(U.type!=="user"&&U.type!=="gemini")continue;let J=typeof U.content==="string"?U.content:"";if(J.trim()==="")continue;O.push({role:U.type==="user"?"user":"assistant",content:J,timestamp:typeof U.timestamp==="string"?U.timestamp:null})}if(O.length===0)return null;let H=q.get($)??null;if(!H){let U=O.find((J)=>J.role==="user");if(U&&dZ(U.content))H=U.content.trim().replace(/\/+$/,"")}if(s(H))return null;let X=O.map((U)=>U.timestamp).filter((U)=>U!=null);return{sourceSessionId:T.sessionId??DH(_).replace(/\.json$/,""),rawPath:_,rawProjectPath:H,title:i(O),createdAt:T.startTime??X[0]??null,updatedAt:T.lastUpdated??X[X.length-1]??null,messages:O}}function wH(_){let $=new Set;for(let q of lZ){let T=b_(_,q);if(!G$(T))continue;let O;try{O=vZ(T)}catch{O=T}if($.has(O))continue;return $.add(O),T}return null}function sZ(_){let $=b_(_,"tmp");if(!G$($))return[];let q=[];for(let T of VH($,{withFileTypes:!0})){if(!T.isDirectory())continue;let O=b_($,T.name,"chats");if(!G$(O))continue;for(let H of VH(O,{withFileTypes:!0}))if(H.isFile()&&H.name.startsWith("session-")&&H.name.endsWith(".json"))q.push(b_(O,H.name))}return q}var MH={id:"gemini",name:"Gemini",detect(_){let $=wH(_);return $!=null&&G$(b_($,"tmp"))},collect(_){let $=wH(_);if(!$)return[];let q=pZ($),T=[];for(let O of sZ($))try{if(!mZ(O).isFile())continue;let H=DH(BH(BH(O))),X=cZ(O,H,q);if(X)T.push(X)}catch{continue}return T}};var IH=[OH,WH,LH,MH,ZH];function iq(_){return h(_)}function iZ(_,$){return`ses_${iq(`${_}\x00${$.sourceSessionId}\x00${$.rawPath}`)}`}function nZ(_,$){return iq(`${_}\x00${$}`)}function aZ(_){return iq(`${_.length}\x00${_.join("\x00")}`)}function rZ(_,$,q){_.query(`
576
644
  INSERT INTO sources (id, name, enabled, scan_paths, config_json, last_sync_at)
577
645
  VALUES ($id, $name, 1, NULL, NULL, $now)
578
646
  ON CONFLICT(id) DO UPDATE SET
579
647
  name = excluded.name,
580
648
  last_sync_at = excluded.last_sync_at
581
- `).run({$id:_.id,$name:_.name,$now:s})}function WU(u,_){if(!_)return null;try{return si(u,_).id}catch{return null}}function XU(u,_,s,$,w){let f=FU(_.id,s),i=s.messages.map((T)=>zU(T.role,T.content)),g=YU(i),R=WU(u,s.rawProjectPath),S=u.query("SELECT content_hash, first_seen_at FROM sessions WHERE id = ?").get(f);if(S&&S.content_hash===g)return u.query("UPDATE sessions SET project_id = $projectId, status = $status, last_seen_at = $now WHERE id = $id").run({$projectId:R,$status:"unchanged",$now:$,$id:f}),w.unchanged+=1,f;let L=S?"changed":"new",I=S?.first_seen_at??$;if(u.query(`
649
+ `).run({$id:$.id,$name:$.name,$now:q})}function oZ(_,$){if(!$)return null;try{return DO(_,$).id}catch{return null}}function tZ(_,$,q,T,O){let H=iZ($.id,q),X=q.messages.map((Q)=>nZ(Q.role,Q.content)),U=aZ(X),J=oZ(_,q.rawProjectPath),Z=_.query("SELECT content_hash, first_seen_at FROM sessions WHERE id = ?").get(H);if(Z&&Z.content_hash===U)return _.query("UPDATE sessions SET project_id = $projectId, status = $status, last_seen_at = $now WHERE id = $id").run({$projectId:J,$status:"unchanged",$now:T,$id:H}),O.unchanged+=1,H;let z=Z?"changed":"new",G=Z?.first_seen_at??T;if(_.query(`
582
650
  INSERT INTO sessions (
583
651
  id, source_id, source_session_id, project_id, checkout_id, raw_project_path, raw_path,
584
652
  title, message_count, content_hash, status, created_at, updated_at, first_seen_at, last_seen_at
@@ -596,10 +664,12 @@ summaries:
596
664
  created_at = excluded.created_at,
597
665
  updated_at = excluded.updated_at,
598
666
  last_seen_at = excluded.last_seen_at
599
- `).run({$id:f,$sourceId:_.id,$sourceSessionId:s.sourceSessionId,$projectId:R,$rawProjectPath:s.rawProjectPath,$rawPath:s.rawPath,$title:s.title,$messageCount:s.messages.length,$contentHash:g,$status:L,$createdAt:s.createdAt,$updatedAt:s.updatedAt,$firstSeenAt:I,$now:$}),u.query("DELETE FROM messages WHERE session_id = ?").run(f),s.messages.forEach((T,O)=>{u.query(`
667
+ `).run({$id:H,$sourceId:$.id,$sourceSessionId:q.sourceSessionId,$projectId:J,$rawProjectPath:q.rawProjectPath,$rawPath:q.rawPath,$title:q.title,$messageCount:q.messages.length,$contentHash:U,$status:z,$createdAt:q.createdAt,$updatedAt:q.updatedAt,$firstSeenAt:G,$now:T}),_.query("DELETE FROM messages WHERE session_id = ?").run(H),q.messages.forEach((Q,Y)=>{_.query(`
600
668
  INSERT INTO messages (id, session_id, role, content, timestamp, seq_order, content_hash)
601
669
  VALUES ($id, $sessionId, $role, $content, $timestamp, $seqOrder, $contentHash)
602
- `).run({$id:`msg_${f}_${O}`,$sessionId:f,$role:T.role,$content:T.content,$timestamp:T.timestamp,$seqOrder:O,$contentHash:i[O]})}),L==="new")w.new+=1;else w.changed+=1;return f}function JU(u,_,s,$,w){let f=u.query("SELECT id FROM sessions WHERE source_id = ? AND status != 'source_missing'").all(_);for(let i of f){if(s.has(i.id))continue;u.query("UPDATE sessions SET status = $status, last_seen_at = $now WHERE id = $id").run({$status:"source_missing",$now:$,$id:i.id}),w.sourceMissing+=1}}function ug(u,_){let s=new Date().toISOString(),$=[];for(let w of ei){if(!w.detect(_.homeDir))continue;GU(u,w,s);let f={source:w.id,new:0,changed:0,unchanged:0,sourceMissing:0,total:0},i=w.collect(_.homeDir),g=new Set;u.transaction(()=>{for(let S of i){if(_.projectFilter&&S.rawProjectPath!==_.projectFilter)continue;let L=XU(u,w,S,s,f);g.add(L),f.total+=1}if(!_.projectFilter)JU(u,w.id,g,s,f)})(),$.push(f)}return{bySource:$}}var wg=`llm-iwiki
670
+ `).run({$id:`msg_${H}_${Y}`,$sessionId:H,$role:Q.role,$content:Q.content,$timestamp:Q.timestamp,$seqOrder:Y,$contentHash:X[Y]})}),z==="new")O.new+=1;else O.changed+=1;return H}function eZ(_,$,q,T,O){let H=_.query("SELECT id FROM sessions WHERE source_id = ? AND status != 'source_missing'").all($);for(let X of H){if(q.has(X.id))continue;_.query("UPDATE sessions SET status = $status, last_seen_at = $now WHERE id = $id").run({$status:"source_missing",$now:T,$id:X.id}),O.sourceMissing+=1}}function FH(_,$){let q=new Date().toISOString(),T=[];for(let O of IH){if(!O.detect($.homeDir))continue;rZ(_,O,q);let H={source:O.id,new:0,changed:0,unchanged:0,sourceMissing:0,total:0},X=O.collect($.homeDir),U=new Set;_.transaction(()=>{for(let Z of X){if($.projectFilter&&Z.rawProjectPath!==$.projectFilter)continue;let z=tZ(_,O,Z,q,H);U.add(z),H.total+=1}if(!$.projectFilter)eZ(_,O.id,U,q,H)})(),T.push(H)}return{bySource:T}}var CH=`llm-iwiki
671
+
672
+ 提示:所有 --project 都接受「路径 / proj_xxx / 项目名或 slug」三种形式。
603
673
 
604
674
  Usage:
605
675
  llm-iwiki init
@@ -607,22 +677,31 @@ Usage:
607
677
  llm-iwiki sync [--project <path>]
608
678
  llm-iwiki projects list
609
679
  llm-iwiki projects resolve <path>
610
- llm-iwiki projects inspect <path-or-project-id>
611
- llm-iwiki projects rename <path-or-project-id> <display-name>
612
- llm-iwiki summarize prepare [changed|all] --project <path> [--out <file>]
613
- llm-iwiki summarize apply --project <path> --file <summaries.yaml>
614
- llm-iwiki experiences prepare --project <path> [--from changed-summaries|all-recent] [--out <file>]
615
- llm-iwiki experiences propose --project <path> --file <experiences.yaml>
616
- llm-iwiki experiences candidates [--project <path>]
680
+ llm-iwiki projects inspect <project>
681
+ llm-iwiki projects rename <project> <display-name>
682
+ llm-iwiki projects merge <from-project-id> <into-project-id>
683
+ llm-iwiki projects dedupe [--dry-run]
684
+ llm-iwiki sessions list [--project <project>]
685
+ llm-iwiki sessions read <session-id> [--full]
686
+ llm-iwiki summarize prepare [changed|all] --project <project> [--out <file>]
687
+ llm-iwiki summarize apply [--project <project>] --file <summaries.yaml>
688
+ llm-iwiki experiences prepare --project <project> [--from changed-summaries|all-recent] [--since 30d] [--out <file>]
689
+ llm-iwiki experiences propose [--project <project>] --file <experiences.yaml>
690
+ llm-iwiki experiences candidates [--project <project>]
617
691
  llm-iwiki experiences accept <candidate-id>
618
692
  llm-iwiki experiences reject <candidate-id>
619
- llm-iwiki obsidian export [--project <path>] [--vault <dir>] [--force]
693
+ llm-iwiki search <sessions|experiences> <query> [--project <project>]
694
+ llm-iwiki obsidian export [--project <project>] [--all] [--vault <dir>] [--force]
695
+ llm-iwiki obsidian move-project <project> [--vault <dir>]
620
696
  llm-iwiki obsidian check
621
697
  llm-iwiki config show
622
698
  llm-iwiki config set <key> <value>
623
699
  llm-iwiki skills [list]
624
700
  llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]
625
- `,fg=`用法:
701
+
702
+ Global flags:
703
+ --debug 出错时打印详细堆栈
704
+ `,PH=`用法:
626
705
  llm-iwiki skills list # 列出可用 target 与将写入的 skill
627
- llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]`;function b(u,_){return BU(_)?_:ZU(u,_)}function l(u,_){let s=u.indexOf(_);if(s===-1)return null;let $=u[s+1];if(!$||$.startsWith("--"))return null;return $}async function ig(u,_){if(u.length===0||u[0]==="--help"||u[0]==="-h")return _.stdout(wg),0;if(u[0]==="init"){let s=Q(_.homeDir);if(e_(s.configDir,{recursive:!0}),!Z$(s.configFile))M$(s.configFile,`obsidian_vault = ""
628
- `);let $=N(s.databaseFile);try{V($)}finally{$.close()}return _.stdout(`Initialized llm-iwiki at ${s.configDir}`),0}if(u[0]==="doctor"){let s=Q(_.homeDir);if(!Z$(s.configFile))return _.stderr("llm-iwiki is not initialized. Run: llm-iwiki init"),1;if(!Z$(s.databaseFile))return _.stderr("llm-iwiki database is missing. Run: llm-iwiki init"),1;let $=N(s.databaseFile);try{V($)}finally{$.close()}return _.stdout(`config: ${s.configFile}`),_.stdout(`database: ${s.databaseFile}`),_.stdout("status: ok"),0}if(u[0]==="sync"){let s=l(u,"--project"),$=Q(_.homeDir),w=N($.databaseFile);try{V(w);let f=ug(w,{homeDir:_.homeDir??$.homeDir,projectFilter:s?b(_.cwd,s):null});if(f.bySource.length===0)return _.stdout("No collectors detected on this machine."),0;for(let i of f.bySource)_.stdout(`${i.source}: ${i.total} sessions (new ${i.new}, changed ${i.changed}, unchanged ${i.unchanged}, missing ${i.sourceMissing})`);return 0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="projects"&&u[1]==="list"){let s=Q(_.homeDir),$=N(s.databaseFile);try{V($);let w=$i($);if(w.length===0)return _.stdout("No projects yet. Run: llm-iwiki sync"),0;for(let f of w){let i=f.displayName??f.canonicalName;_.stdout(`${f.id} ${f.sessionCount} sessions ${i}`)}return 0}finally{$.close()}}if(u[0]==="projects"&&u[1]==="inspect"){let s=u[2];if(!s)return _.stderr("Usage: llm-iwiki projects inspect <path-or-project-id>"),1;let $=Q(_.homeDir),w=N($.databaseFile);try{V(w);let f=s.startsWith("proj_")?p_(w,s):fu(w,b(_.cwd,s)),i=Fi(w,f.id);if(_.stdout(`project: ${f.displayName??f.canonicalName}`),_.stdout(`id: ${f.id}`),f.canonicalRepoUrl)_.stdout(`repo: ${f.canonicalRepoUrl}`);_.stdout(`sources: ${i.sources.map((g)=>`${g.source}(${g.sessionCount})`).join(", ")||"none"}`),_.stdout(`sessions: ${i.sessions.length}`);for(let g of i.sessions)_.stdout(` [${g.sourceId}] ${g.title??g.sourceSessionId} (${g.messageCount} msgs, ${g.status})`);return 0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="projects"&&u[1]==="resolve"){let s=u[2]??_.cwd,$=Q(_.homeDir),w=N($.databaseFile);try{V(w);let f=fu(w,b(_.cwd,s));return _.stdout(JSON.stringify(f,null,2)),0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="projects"&&u[1]==="rename"){let s=u[2],$=u[3];if(!s||!$)return _.stderr("Usage: llm-iwiki projects rename <path-or-project-id> <display-name>"),1;let w=Q(_.homeDir),f=N(w.databaseFile);try{V(f);let i=s.startsWith("proj_")?H$(f,s,$):H$(f,fu(f,b(_.cwd,s)).id,$);return _.stdout(JSON.stringify(i,null,2)),0}catch(i){return _.stderr(i instanceof Error?i.message:String(i)),1}finally{f.close()}}if(u[0]==="summarize"&&u[1]==="prepare"){let s=u[2]&&!u[2].startsWith("--")?u[2]:"changed";if(s!=="changed"&&s!=="all")return _.stderr("Usage: llm-iwiki summarize prepare [changed|all] --project <path> [--out <file>]"),1;let $=b(_.cwd,l(u,"--project")??_.cwd),w=l(u,"--out")??$g(F$($),"summaries-task.md"),f=Q(_.homeDir),i=N(f.databaseFile);try{V(i);let g=fu(i,$),R=Zi(i,g.id,s);return e_(sg(b(_.cwd,w)),{recursive:!0}),M$(b(_.cwd,w),R.markdown),_.stdout(`prepared summaries task: ${R.sessionCount} sessions -> ${w}`),0}catch(g){return _.stderr(g instanceof Error?g.message:String(g)),1}finally{i.close()}}if(u[0]==="summarize"&&u[1]==="apply"){let s=l(u,"--file");if(!s)return _.stderr("Usage: llm-iwiki summarize apply --project <path> --file <summaries.yaml>"),1;let $=Q(_.homeDir),w=N($.databaseFile);try{V(w);let f=nf(_g(b(_.cwd,s),"utf8")),i=Mi(w,f);if(_.stdout(`applied summaries: ${i.written}`),i.skipped.length>0)_.stdout(`skipped (unknown session): ${i.skipped.length}`);return 0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="experiences"&&u[1]==="prepare"){let s=l(u,"--from")??"changed-summaries";if(s!=="changed-summaries"&&s!=="all-recent")return _.stderr("Invalid --from. Use changed-summaries or all-recent."),1;let $=b(_.cwd,l(u,"--project")??_.cwd),w=l(u,"--out")??$g(F$($),"experiences-task.md"),f=Q(_.homeDir),i=N(f.databaseFile);try{V(i);let g=fu(i,$),R=wi(i,g.id,s);return e_(sg(b(_.cwd,w)),{recursive:!0}),M$(b(_.cwd,w),R.markdown),_.stdout(`prepared experiences task: ${R.summaryCount} summaries -> ${w}`),0}catch(g){return _.stderr(g instanceof Error?g.message:String(g)),1}finally{i.close()}}if(u[0]==="experiences"&&u[1]==="propose"){let s=l(u,"--file");if(!s)return _.stderr("Usage: llm-iwiki experiences propose --project <path> --file <experiences.yaml>"),1;let $=Q(_.homeDir),w=N($.databaseFile);try{V(w);let f=hf(_g(b(_.cwd,s),"utf8")),i=ii(w,f);return _.stdout(`proposed experiences: ${i.written}`),0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="experiences"&&u[1]==="candidates"){let s=l(u,"--project"),$=Q(_.homeDir),w=N($.databaseFile);try{V(w);let f=s?fu(w,b(_.cwd,s)).id:null,i=gi(w,f);if(i.length===0)return _.stdout("No experience candidates. Run: llm-iwiki experiences propose"),0;for(let g of i)_.stdout(`${g.id} [${g.status}] ${g.confidence??"-"} ${g.proposed_title}`);return 0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="experiences"&&(u[1]==="accept"||u[1]==="reject")){let s=u[2];if(!s)return _.stderr(`Usage: llm-iwiki experiences ${u[1]} <candidate-id>`),1;let $=Q(_.homeDir),w=N($.databaseFile);try{if(V(w),u[1]==="accept"){let f=Ri(w,s);_.stdout(`accepted: ${f.experienceId} (${f.slug}), linked sessions: ${f.linkedSessions}`)}else Si(w,s),_.stdout(`rejected: ${s}`);return 0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{w.close()}}if(u[0]==="config"&&u[1]==="show"){let s=Q(_.homeDir),$=q$(s.configFile);return _.stdout(`config: ${s.configFile}`),_.stdout(`obsidian.vault: ${$.obsidianVault??"(unset)"}`),0}if(u[0]==="config"&&u[1]==="set"){let s=u[2],$=u[3];if(!s||$===void 0)return _.stderr("Usage: llm-iwiki config set <key> <value>"),1;let w=Q(_.homeDir);e_(w.configDir,{recursive:!0});try{let f=xf(w.configFile,s,$);return _.stdout(`set ${f} = ${$}`),0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}}if(u[0]==="obsidian"&&u[1]==="export"){let s=Q(_.homeDir),$=l(u,"--vault"),w=$?b(_.cwd,$):q$(s.configFile).obsidianVault;if(!w)return _.stderr("No Obsidian vault configured. Run: llm-iwiki config set obsidian.vault <dir>"),1;let f=b(_.cwd,l(u,"--project")??_.cwd),i=u.includes("--force"),g=N(s.databaseFile);try{V(g);let R=fu(g,f),S=Ui(g,w,R,{force:i});_.stdout(`vault: ${w}`),_.stdout(`exported: created ${S.created}, updated ${S.updated}, forced ${S.forced}, conflicts ${S.conflicts.length}`);for(let L of S.conflicts)_.stdout(` conflict (skipped): ${L}`);if(S.conflicts.length>0&&!i)_.stdout("Re-run with --force to overwrite managed blocks of conflicting notes.");return 0}catch(R){return _.stderr(R instanceof Error?R.message:String(R)),1}finally{g.close()}}if(u[0]==="obsidian"&&u[1]==="check"){let s=Q(_.homeDir),$=N(s.databaseFile);try{V($);let w=Hi($);_.stdout(`notes: ${w.total}, clean: ${w.clean}, needs attention: ${w.entries.length}`);for(let f of w.entries)_.stdout(` ${f.status}: ${f.filePath}`);return 0}finally{$.close()}}if(u[0]==="skills"&&u[1]==="init"){let s=l(u,"--target");if(u.includes("--target")&&!s)return _.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;if(s&&!Y$.includes(s))return _.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;let $=s,w=Ji({cwd:_.cwd,target:$,force:u.includes("--force"),dryRun:u.includes("--dry-run")});return _.stdout(`skills written: ${w.written.length}`),_.stdout(`skills skipped: ${w.skipped.length}`),0}if(u[0]==="skills"&&(u[1]===void 0||u[1]==="list")){_.stdout(fg),_.stdout(""),_.stdout("可用 target:");for(let s of Wi())_.stdout(` ${s.id} (${s.name})`);_.stdout(""),_.stdout(`将写入的 skill (位于 ${G$}/):`);for(let s of Xi())_.stdout(` ${s.directory} -> ${s.relPath}`);return 0}if(u[0]==="skills")return _.stderr(`Unknown skills subcommand: ${u[1]}`),_.stderr(fg),1;return _.stderr(`Unknown command: ${u.join(" ")}`),_.stderr(wg),1}var MU=await ig(process.argv.slice(2),{cwd:process.cwd(),stdout:console.log,stderr:console.error});process.exit(MU);
706
+ llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]`;function x(_,$){return _5($)?$:$5(_,$)}function g(_,$){let q=_.indexOf($);if(q===-1)return null;let T=_[q+1];if(!T||T.startsWith("--"))return null;return T}function l(_,$,q){if(_ instanceof O$){if($.stderr(`找不到唯一项目:${_.ref}`),_.candidates.length===0)$.stderr("可能原因:路径下尚无会话、或项目名写错。建议:"),$.stderr(" - 先运行 llm-iwiki sync 采集会话"),$.stderr(" - 用 llm-iwiki projects list 查看已有项目,再用 proj_xxx 精确指定");else{$.stderr("存在多个候选(按会话数排序):");for(let T of _.candidates){let O=T.displayName??T.canonicalName;$.stderr(` ${T.id} ${T.sessionCount} sessions ${O}`)}$.stderr("建议:用 --project <proj_xxx> 精确指定,或先 llm-iwiki projects dedupe 合并重复项目。")}if(q&&_.stack)$.stderr(_.stack);return}if($.stderr(_ instanceof Error?_.message:String(_)),q&&_ instanceof Error&&_.stack)$.stderr(_.stack)}function q5(_,$,q){let T=g($,"--project")??q.cwd;return c(_,T,q.cwd)}function T5(_){let $=_.match(/^(\d+)([dhw])$/);if(!$)throw Error(`Invalid --since: ${_}. Use forms like 30d, 12h, 2w.`);let q=Number($[1]),T=$[2]==="h"?3600000:$[2]==="w"?604800000:86400000;return new Date(Date.now()-q*T).toISOString()}async function fH(_,$){let q=_.includes("--debug");if(_.length===0||_[0]==="--help"||_[0]==="-h")return $.stdout(CH),0;if(_[0]==="init"){let T=N($.homeDir);if(Q0(T.configDir,{recursive:!0}),!nq(T.configFile))aq(T.configFile,`obsidian_vault = ""
707
+ `);let O=C(T.databaseFile);try{P(O)}finally{O.close()}return $.stdout(`Initialized llm-iwiki at ${T.configDir}`),0}if(_[0]==="doctor"){let T=N($.homeDir);if(!nq(T.configFile))return $.stderr("llm-iwiki is not initialized. Run: llm-iwiki init"),1;if(!nq(T.databaseFile))return $.stderr("llm-iwiki database is missing. Run: llm-iwiki init"),1;let O=C(T.databaseFile);try{P(O)}finally{O.close()}return $.stdout(`config: ${T.configFile}`),$.stdout(`database: ${T.databaseFile}`),$.stdout("status: ok"),0}if(_[0]==="sync"){let T=g(_,"--project"),O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=FH(H,{homeDir:$.homeDir??O.homeDir,projectFilter:T?x($.cwd,T):null});if(X.bySource.length===0)return $.stdout("No collectors detected on this machine."),0;for(let U of X.bySource)$.stdout(`${U.source}: ${U.total} sessions (new ${U.new}, changed ${U.changed}, unchanged ${U.unchanged}, missing ${U.sourceMissing})`);return 0}catch(X){return $.stderr(X instanceof Error?X.message:String(X)),1}finally{H.close()}}if(_[0]==="projects"&&_[1]==="list"){let T=N($.homeDir),O=C(T.databaseFile);try{P(O);let H=Z_(O);if(H.length===0)return $.stdout("No projects yet. Run: llm-iwiki sync"),0;for(let X of H){let U=X.displayName??X.canonicalName;$.stdout(`${X.id} ${X.sessionCount} sessions ${U}`)}return 0}finally{O.close()}}if(_[0]==="projects"&&_[1]==="inspect"){let T=_[2];if(!T)return $.stderr("Usage: llm-iwiki projects inspect <project>"),1;let O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=c(H,T,$.cwd),U=cO(H,X.id);if($.stdout(`project: ${X.displayName??X.canonicalName}`),$.stdout(`id: ${X.id}`),X.canonicalRepoUrl)$.stdout(`repo: ${X.canonicalRepoUrl}`);$.stdout(`sources: ${U.sources.map((J)=>`${J.source}(${J.sessionCount})`).join(", ")||"none"}`),$.stdout(`sessions: ${U.sessions.length}`);for(let J of U.sessions)$.stdout(` ${J.id} [${J.sourceId}] ${J.title??J.sourceSessionId} (${J.messageCount} msgs, ${J.status})`);return 0}catch(X){return l(X,$,q),1}finally{H.close()}}if(_[0]==="projects"&&_[1]==="merge"){let T=_[2],O=_[3];if(!T||!O)return $.stderr("Usage: llm-iwiki projects merge <from-project-id> <into-project-id>"),1;let H=N($.homeDir),X=C(H.databaseFile);try{P(X);let U=Eq(X,T,O);return $.stdout(`merged ${U.fromId} -> ${U.intoId} (moved ${U.movedSessions} sessions)`),0}catch(U){return l(U,$,q),1}finally{X.close()}}if(_[0]==="projects"&&_[1]==="dedupe"){let T=_.includes("--dry-run"),O=N($.homeDir),H=C(O.databaseFile);try{if(P(H),T){let U=Z_(H),J=new Map;for(let z of U){let G=z.canonicalRepoUrl?`repo:${z.canonicalRepoUrl}`:`slug:${z.slug}`;J.set(G,[...J.get(G)??[],z])}let Z=0;for(let[,z]of J){if(z.length<2)continue;Z+=1,$.stdout(`would merge ${z.length} duplicates of ${z[0].canonicalName}`)}return $.stdout(`dry-run: ${Z} duplicate group(s)`),0}let X=MO(H);$.stdout(`deduped: merged ${X.merges.length} duplicate project(s)`);for(let U of X.merges)$.stdout(` ${U.fromId} -> ${U.intoId} (moved ${U.movedSessions} sessions)`);return 0}catch(X){return l(X,$,q),1}finally{H.close()}}if(_[0]==="sessions"&&_[1]==="list"){let T=g(_,"--project"),O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=T?c(H,T,$.cwd):q5(H,_,$),U=hq(H,X.id);$.stdout(`project: ${X.displayName??X.canonicalName} (${X.id})`),$.stdout(`sessions: ${U.length}`);for(let J of U)$.stdout(` ${J.id} [${J.sourceId}] ${J.title??J.sourceSessionId} (${J.messageCount} msgs, ${J.status})`);return 0}catch(X){return l(X,$,q),1}finally{H.close()}}if(_[0]==="sessions"&&_[1]==="read"){let T=_[2];if(!T||T.startsWith("--"))return $.stderr("Usage: llm-iwiki sessions read <session-id> [--full]"),1;let O=N($.homeDir),H=C(O.databaseFile);try{P(H);let{session:X,transcript:U,messageCount:J}=pO(H,T,{full:_.includes("--full")});return $.stdout(`# ${X.title??X.sourceSessionId}`),$.stdout(`session: ${X.id} source: ${X.sourceId} messages: ${J}`),$.stdout(""),$.stdout(U),0}catch(X){return l(X,$,q),1}finally{H.close()}}if(_[0]==="projects"&&_[1]==="resolve"){let T=_[2]??$.cwd,O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=fq(H,x($.cwd,T));return $.stdout(JSON.stringify(X,null,2)),0}catch(X){return $.stderr(X instanceof Error?X.message:String(X)),1}finally{H.close()}}if(_[0]==="projects"&&_[1]==="rename"){let T=_[2],O=_[3];if(!T||!O)return $.stderr("Usage: llm-iwiki projects rename <path-or-project-id> <display-name>"),1;let H=N($.homeDir),X=C(H.databaseFile);try{P(X);let U=T.startsWith("proj_")?jq(X,T,O):jq(X,fq(X,x($.cwd,T)).id,O);return $.stdout(JSON.stringify(U,null,2)),0}catch(U){return $.stderr(U instanceof Error?U.message:String(U)),1}finally{X.close()}}if(_[0]==="summarize"&&_[1]==="prepare"){let T=_[2]&&!_[2].startsWith("--")?_[2]:"changed";if(T!=="changed"&&T!=="all")return $.stderr("Usage: llm-iwiki summarize prepare [changed|all] --project <path> [--out <file>]"),1;let O=g(_,"--project")??$.cwd,H=O.startsWith("proj_")?$.cwd:x($.cwd,O),X=g(_,"--out")??NH(kq(H),"summaries-task.md"),U=N($.homeDir),J=C(U.databaseFile);try{P(J);let Z=c(J,O,$.cwd),z=tO(J,Z.id,T);return Q0(KH(x($.cwd,X)),{recursive:!0}),aq(x($.cwd,X),z.markdown),$.stdout(`prepared summaries task: ${z.sessionCount} sessions -> ${X}`),0}catch(Z){return l(Z,$,q),1}finally{J.close()}}if(_[0]==="summarize"&&_[1]==="apply"){let T=g(_,"--file");if(!T)return $.stderr("Usage: llm-iwiki summarize apply --project <path> --file <summaries.yaml>"),1;let O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=JO(SH(x($.cwd,T),"utf8")),U=eO(H,X);if($.stdout(`applied summaries: ${U.written}`),U.skipped.length>0)$.stdout(`skipped (unknown session): ${U.skipped.length}`);return 0}catch(X){return $.stderr(X instanceof Error?X.message:String(X)),1}finally{H.close()}}if(_[0]==="experiences"&&_[1]==="prepare"){let T=g(_,"--from")??"changed-summaries";if(T!=="changed-summaries"&&T!=="all-recent")return $.stderr("Invalid --from. Use changed-summaries or all-recent."),1;let O=g(_,"--project")??$.cwd,H=O.startsWith("proj_")?$.cwd:x($.cwd,O),X=g(_,"--out")??NH(kq(H),"experiences-task.md"),U=g(_,"--since"),J=N($.homeDir),Z=C(J.databaseFile);try{P(Z);let z=U?T5(U):null,G=c(Z,O,$.cwd),Q=IO(Z,G.id,T,z);return Q0(KH(x($.cwd,X)),{recursive:!0}),aq(x($.cwd,X),Q.markdown),$.stdout(`prepared experiences task: ${Q.summaryCount} summaries -> ${X}`),0}catch(z){return l(z,$,q),1}finally{Z.close()}}if(_[0]==="experiences"&&_[1]==="propose"){let T=g(_,"--file");if(!T)return $.stderr("Usage: llm-iwiki experiences propose --project <path> --file <experiences.yaml>"),1;let O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=ZO(SH(x($.cwd,T),"utf8")),U=SO(H,X);return $.stdout(`proposed experiences: ${U.written}`),0}catch(X){return $.stderr(X instanceof Error?X.message:String(X)),1}finally{H.close()}}if(_[0]==="experiences"&&_[1]==="candidates"){let T=g(_,"--project"),O=N($.homeDir),H=C(O.databaseFile);try{P(H);let X=T?c(H,T,$.cwd).id:null,U=KO(H,X);if(U.length===0)return $.stdout("No experience candidates. Run: llm-iwiki experiences propose"),0;for(let J of U)$.stdout(`${J.id} [${J.status}] ${J.confidence??"-"} ${J.proposed_title}`);return 0}catch(X){return l(X,$,q),1}finally{H.close()}}if(_[0]==="experiences"&&(_[1]==="accept"||_[1]==="reject")){let T=_[2];if(!T)return $.stderr(`Usage: llm-iwiki experiences ${_[1]} <candidate-id>`),1;let O=N($.homeDir),H=C(O.databaseFile);try{if(P(H),_[1]==="accept"){let X=NO(H,T);$.stdout(`accepted: ${X.experienceId} (${X.slug}), linked sessions: ${X.linkedSessions}`)}else CO(H,T),$.stdout(`rejected: ${T}`);return 0}catch(X){return $.stderr(X instanceof Error?X.message:String(X)),1}finally{H.close()}}if(_[0]==="config"&&_[1]==="show"){let T=N($.homeDir),O=O0(T.configFile);return $.stdout(`config: ${T.configFile}`),$.stdout(`obsidian.vault: ${O.obsidianVault??"(unset)"}`),0}if(_[0]==="config"&&_[1]==="set"){let T=_[2],O=_[3];if(!T||O===void 0)return $.stderr("Usage: llm-iwiki config set <key> <value>"),1;let H=N($.homeDir);Q0(H.configDir,{recursive:!0});try{let X=QO(H.configFile,T,O);return $.stdout(`set ${X} = ${O}`),0}catch(X){return $.stderr(X instanceof Error?X.message:String(X)),1}}if(_[0]==="obsidian"&&_[1]==="export"){let T=N($.homeDir),O=g(_,"--vault"),H=O?x($.cwd,O):O0(T.configFile).obsidianVault;if(!H)return $.stderr("No Obsidian vault configured. Run: llm-iwiki config set obsidian.vault <dir>"),1;let X=_.includes("--all"),U=g(_,"--project")??$.cwd,J=_.includes("--force"),Z=C(T.databaseFile);try{P(Z);let z;if(X)z=uO(Z,H,{force:J});else{let G=c(Z,U,$.cwd);z=gq(Z,H,G,{force:J});let Q=yq(Z,H,{force:J});z.created+=Q.created,z.updated+=Q.updated,z.forced+=Q.forced,z.conflicts.push(...Q.conflicts)}$.stdout(`vault: ${H}`),$.stdout(`exported: created ${z.created}, updated ${z.updated}, forced ${z.forced}, conflicts ${z.conflicts.length}`);for(let G of z.conflicts)$.stdout(` conflict (skipped): ${G}`);if(z.conflicts.length>0&&!J)$.stdout("Re-run with --force to overwrite managed blocks of conflicting notes.");return 0}catch(z){return l(z,$,q),1}finally{Z.close()}}if(_[0]==="obsidian"&&_[1]==="move-project"){let T=_[2];if(!T||T.startsWith("--"))return $.stderr("Usage: llm-iwiki obsidian move-project <project> [--vault <dir>]"),1;let O=N($.homeDir),H=g(_,"--vault"),X=H?x($.cwd,H):O0(O.configFile).obsidianVault;if(!X)return $.stderr("No Obsidian vault configured. Run: llm-iwiki config set obsidian.vault <dir>"),1;let U=C(O.databaseFile);try{P(U);let J=c(U,T,$.cwd),Z=hO(U,X,J);if(Z.moved===0)$.stdout("nothing to move (already at target or no exported notes).");else{$.stdout(`moved project notes to slug directory: ${J.slug}`);for(let z of Z.fromDirs)$.stdout(` from: ${z}`)}return 0}catch(J){return l(J,$,q),1}finally{U.close()}}if(_[0]==="search"){let T=_[1],O=_[2];if(T!=="sessions"&&T!=="experiences"||!O||O.startsWith("--"))return $.stderr("Usage: llm-iwiki search <sessions|experiences> <query> [--project <project>]"),1;let H=g(_,"--project"),X=N($.homeDir),U=C(X.databaseFile);try{P(U);let J=H?c(U,H,$.cwd).id:null,Z=lO(U,T,O,J);$.stdout(`matches: ${Z.length}`);for(let z of Z)$.stdout(` ${z.id} ${z.title}`),$.stdout(` ${z.snippet}`);return 0}catch(J){return l(J,$,q),1}finally{U.close()}}if(_[0]==="obsidian"&&_[1]==="check"){let T=N($.homeDir),O=C(T.databaseFile);try{P(O);let H=vO(O);$.stdout(`notes: ${H.total}, clean: ${H.clean}, needs attention: ${H.entries.length}`);for(let X of H.entries)$.stdout(` ${X.status}: ${X.filePath}`);return 0}finally{O.close()}}if(_[0]==="skills"&&_[1]==="init"){let T=g(_,"--target");if(_.includes("--target")&&!T)return $.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;if(T&&!lq.includes(T))return $.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;let O=T,H=oO({cwd:$.cwd,target:O,force:_.includes("--force"),dryRun:_.includes("--dry-run")});return $.stdout(`skills written: ${H.written.length}`),$.stdout(`skills skipped: ${H.skipped.length}`),0}if(_[0]==="skills"&&(_[1]===void 0||_[1]==="list")){$.stdout(PH),$.stdout(""),$.stdout("可用 target:");for(let T of aO())$.stdout(` ${T.id} (${T.name})`);$.stdout(""),$.stdout(`将写入的 skill (位于 ${pq}/):`);for(let T of rO())$.stdout(` ${T.directory} -> ${T.relPath}`);return 0}if(_[0]==="skills")return $.stderr(`Unknown skills subcommand: ${_[1]}`),$.stderr(PH),1;return $.stderr(`Unknown command: ${_.join(" ")}`),$.stderr(CH),1}var O5=await fH(process.argv.slice(2),{cwd:process.cwd(),stdout:console.log,stderr:console.error});process.exit(O5);