@codehourra/llm-iwiki 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +5 -11
  2. package/dist/index.js +325 -214
  3. package/package.json +8 -4
package/dist/index.js CHANGED
@@ -1,148 +1,147 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
- var X=(s,_)=>()=>(_||s((_={exports:{}}).exports,_),_.exports);var __=import.meta.require;var Y=X((fw)=>{var o_=Symbol.for("yaml.alias"),GT=Symbol.for("yaml.document"),u_=Symbol.for("yaml.map"),WT=Symbol.for("yaml.pair"),su=Symbol.for("yaml.scalar"),T_=Symbol.for("yaml.seq"),p=Symbol.for("yaml.node.type"),of=(s)=>!!s&&typeof s==="object"&&s[p]===o_,sw=(s)=>!!s&&typeof s==="object"&&s[p]===GT,_w=(s)=>!!s&&typeof s==="object"&&s[p]===u_,uw=(s)=>!!s&&typeof s==="object"&&s[p]===WT,jT=(s)=>!!s&&typeof s==="object"&&s[p]===su,Tw=(s)=>!!s&&typeof s==="object"&&s[p]===T_;function JT(s){if(s&&typeof s==="object")switch(s[p]){case u_:case T_:return!0}return!1}function iw(s){if(s&&typeof s==="object")switch(s[p]){case o_:case u_:case su:case T_:return!0}return!1}var $w=(s)=>(jT(s)||JT(s))&&!!s.anchor;fw.ALIAS=o_;fw.DOC=GT;fw.MAP=u_;fw.NODE_TYPE=p;fw.PAIR=WT;fw.SCALAR=su;fw.SEQ=T_;fw.hasAnchor=$w;fw.isAlias=of;fw.isCollection=JT;fw.isDocument=sw;fw.isMap=_w;fw.isNode=iw;fw.isPair=uw;fw.isScalar=jT;fw.isSeq=Tw});var Gs=X((Fw)=>{var j=Y(),V=Symbol("break visit"),ZT=Symbol("skip children"),K=Symbol("remove node");function i_(s,_){let u=MT(_);if(j.isDocument(s)){if(Ns(null,s.contents,u,Object.freeze([s]))===K)s.contents=null}else Ns(null,s,u,Object.freeze([]))}i_.BREAK=V;i_.SKIP=ZT;i_.REMOVE=K;function Ns(s,_,u,T){let i=QT(s,_,u,T);if(j.isNode(i)||j.isPair(i))return VT(s,T,i),Ns(s,i,u,T);if(typeof i!=="symbol"){if(j.isCollection(_)){T=Object.freeze(T.concat(_));for(let $=0;$<_.items.length;++$){let f=Ns($,_.items[$],u,T);if(typeof f==="number")$=f-1;else if(f===V)return V;else if(f===K)_.items.splice($,1),$-=1}}else if(j.isPair(_)){T=Object.freeze(T.concat(_));let $=Ns("key",_.key,u,T);if($===V)return V;else if($===K)_.key=null;let f=Ns("value",_.value,u,T);if(f===V)return V;else if(f===K)_.value=null}}return i}async function $_(s,_){let u=MT(_);if(j.isDocument(s)){if(await rs(null,s.contents,u,Object.freeze([s]))===K)s.contents=null}else await rs(null,s,u,Object.freeze([]))}$_.BREAK=V;$_.SKIP=ZT;$_.REMOVE=K;async function rs(s,_,u,T){let i=await QT(s,_,u,T);if(j.isNode(i)||j.isPair(i))return VT(s,T,i),rs(s,i,u,T);if(typeof i!=="symbol"){if(j.isCollection(_)){T=Object.freeze(T.concat(_));for(let $=0;$<_.items.length;++$){let f=await rs($,_.items[$],u,T);if(typeof f==="number")$=f-1;else if(f===V)return V;else if(f===K)_.items.splice($,1),$-=1}}else if(j.isPair(_)){T=Object.freeze(T.concat(_));let $=await rs("key",_.key,u,T);if($===V)return V;else if($===K)_.key=null;let f=await rs("value",_.value,u,T);if(f===V)return V;else if(f===K)_.value=null}}return i}function MT(s){if(typeof s==="object"&&(s.Collection||s.Node||s.Value))return Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s);return s}function QT(s,_,u,T){if(typeof u==="function")return u(s,_,T);if(j.isMap(_))return u.Map?.(s,_,T);if(j.isSeq(_))return u.Seq?.(s,_,T);if(j.isPair(_))return u.Pair?.(s,_,T);if(j.isScalar(_))return u.Scalar?.(s,_,T);if(j.isAlias(_))return u.Alias?.(s,_,T);return}function VT(s,_,u){let T=_[_.length-1];if(j.isCollection(T))T.items[s]=u;else if(j.isPair(T))if(s==="key")T.key=u;else T.value=u;else if(j.isDocument(T))T.contents=u;else{let i=j.isAlias(T)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Fw.visit=i_;Fw.visitAsync=$_});var _u=X((Ww)=>{var bT=Y(),Bw=Gs(),zw={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Gw=(s)=>s.replace(/[!,[\]{}]/g,(_)=>zw[_]);class b{constructor(s,_){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},b.defaultYaml,s),this.tags=Object.assign({},b.defaultTags,_)}clone(){let s=new b(this.yaml,this.tags);return s.docStart=this.docStart,s}atDocument(){let s=new b(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:b.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},b.defaultTags);break}return s}add(s,_){if(this.atNextDocument)this.yaml={explicit:b.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},b.defaultTags),this.atNextDocument=!1;let u=s.trim().split(/[ \t]+/),T=u.shift();switch(T){case"%TAG":{if(u.length!==2){if(_(0,"%TAG directive should contain exactly two parts"),u.length<2)return!1}let[i,$]=u;return this.tags[i]=$,!0}case"%YAML":{if(this.yaml.explicit=!0,u.length!==1)return _(0,"%YAML directive should contain exactly one part"),!1;let[i]=u;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let $=/^\d+\.\d+$/.test(i);return _(6,`Unsupported YAML version ${i}`,$),!1}}default:return _(0,`Unknown directive ${T}`,!0),!1}}tagName(s,_){if(s==="!")return"!";if(s[0]!=="!")return _(`Not a valid tag: ${s}`),null;if(s[1]==="<"){let $=s.slice(2,-1);if($==="!"||$==="!!")return _(`Verbatim tags aren't resolved, so ${s} is invalid.`),null;if(s[s.length-1]!==">")_("Verbatim tags must end with a >");return $}let[,u,T]=s.match(/^(.*!)([^!]*)$/s);if(!T)_(`The ${s} tag has no suffix`);let i=this.tags[u];if(i)try{return i+decodeURIComponent(T)}catch($){return _(String($)),null}if(u==="!")return s;return _(`Could not resolve tag: ${s}`),null}tagString(s){for(let[_,u]of Object.entries(this.tags))if(s.startsWith(u))return _+Gw(s.substring(u.length));return s[0]==="!"?s:`!<${s}>`}toString(s){let _=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],u=Object.entries(this.tags),T;if(s&&u.length>0&&bT.isNode(s.contents)){let i={};Bw.visit(s.contents,($,f)=>{if(bT.isNode(f)&&f.tag)i[f.tag]=!0}),T=Object.keys(i)}else T=[];for(let[i,$]of u){if(i==="!!"&&$==="tag:yaml.org,2002:")continue;if(!s||T.some((f)=>f.startsWith($)))_.push(`%TAG ${i} ${$}`)}return _.join(`
4
- `)}}b.defaultYaml={explicit:!1,version:"1.2"};b.defaultTags={"!!":"tag:yaml.org,2002:"};Ww.Directives=b});var f_=X((Qw)=>{var lT=Y(),Jw=Gs();function Zw(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let u=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw Error(u)}return!0}function nT(s){let _=new Set;return Jw.visit(s,{Value(u,T){if(T.anchor)_.add(T.anchor)}}),_}function CT(s,_){for(let u=1;;++u){let T=`${s}${u}`;if(!_.has(T))return T}}function Mw(s,_){let u=[],T=new Map,i=null;return{onAnchor:($)=>{u.push($),i??(i=nT(s));let f=CT(_,i);return i.add(f),f},setAnchors:()=>{for(let $ of u){let f=T.get($);if(typeof f==="object"&&f.anchor&&(lT.isScalar(f.node)||lT.isCollection(f.node)))f.node.anchor=f.anchor;else{let w=Error("Failed to resolve repeated object (this should not happen)");throw w.source=$,w}}},sourceObjects:T}}Qw.anchorIsValid=Zw;Qw.anchorNames=nT;Qw.createNodeAnchors=Mw;Qw.findNewAnchor=CT});var uu=X((Cw)=>{function Ws(s,_,u,T){if(T&&typeof T==="object")if(Array.isArray(T))for(let i=0,$=T.length;i<$;++i){let f=T[i],w=Ws(s,T,String(i),f);if(w===void 0)delete T[i];else if(w!==f)T[i]=w}else if(T instanceof Map)for(let i of Array.from(T.keys())){let $=T.get(i),f=Ws(s,T,i,$);if(f===void 0)T.delete(i);else if(f!==$)T.set(i,f)}else if(T instanceof Set)for(let i of Array.from(T)){let $=Ws(s,T,i,i);if($===void 0)T.delete(i);else if($!==i)T.delete(i),T.add($)}else for(let[i,$]of Object.entries(T)){let f=Ws(s,T,i,$);if(f===void 0)delete T[i];else if(f!==$)T[i]=f}return s.call(_,u,T)}Cw.applyReviver=Ws});var x=X((yw)=>{var Kw=Y();function dT(s,_,u){if(Array.isArray(s))return s.map((T,i)=>dT(T,String(i),u));if(s&&typeof s.toJSON==="function"){if(!u||!Kw.hasAnchor(s))return s.toJSON(_,u);let T={aliasCount:0,count:1,res:void 0};u.anchors.set(s,T),u.onCreate=($)=>{T.res=$,delete u.onCreate};let i=s.toJSON(_,u);if(u.onCreate)u.onCreate(i);return i}if(typeof s==="bigint"&&!u?.keep)return Number(s);return s}yw.toJS=dT});var w_=X((cw)=>{var hw=uu(),KT=Y(),pw=x();class yT{constructor(s){Object.defineProperty(this,KT.NODE_TYPE,{value:s})}clone(){let s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)s.range=this.range.slice();return s}toJS(s,{mapAsMap:_,maxAliasCount:u,onAnchor:T,reviver:i}={}){if(!KT.isDocument(s))throw TypeError("A document argument is required");let $={anchors:new Map,doc:s,keep:!0,mapAsMap:_===!0,mapKeyWarned:!1,maxAliasCount:typeof u==="number"?u:100},f=pw.toJS(this,"",$);if(typeof T==="function")for(let{count:w,res:g}of $.anchors.values())T(g,w);return typeof i==="function"?hw.applyReviver(i,{"":f},"",f):f}}cw.NodeBase=yT});var js=X((ew)=>{var kw=f_(),xw=Gs(),Xs=Y(),tw=w_(),vw=x();class aT extends tw.NodeBase{constructor(s){super(Xs.ALIAS);this.source=s,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(s,_){if(_?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let u;if(_?.aliasResolveCache)u=_.aliasResolveCache;else if(u=[],xw.visit(s,{Node:(i,$)=>{if(Xs.isAlias($)||Xs.hasAnchor($))u.push($)}}),_)_.aliasResolveCache=u;let T=void 0;for(let i of u){if(i===this)break;if(i.anchor===this.source)T=i}return T}toJSON(s,_){if(!_)return{source:this.source};let{anchors:u,doc:T,maxAliasCount:i}=_,$=this.resolve(T,_);if(!$){let w=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(w)}let f=u.get($);if(!f)vw.toJS($,null,_),f=u.get($);if(f?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0){if(f.count+=1,f.aliasCount===0)f.aliasCount=g_(T,$,u);if(f.count*f.aliasCount>i)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return f.res}toString(s,_,u){let T=`*${this.source}`;if(s){if(kw.anchorIsValid(this.source),s.options.verifyAliasOrder&&!s.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(s.implicitKey)return`${T} `}return T}}function g_(s,_,u){if(Xs.isAlias(_)){let T=_.resolve(s),i=u&&T&&u.get(T);return i?i.count*i.aliasCount:0}else if(Xs.isCollection(_)){let T=0;for(let i of _.items){let $=g_(s,i,u);if($>T)T=$}return T}else if(Xs.isPair(_)){let T=g_(s,_.key,u),i=g_(s,_.value,u);return Math.max(T,i)}return 1}ew.Alias=aT});var z=X((ig)=>{var sg=Y(),_g=w_(),ug=x(),Tg=(s)=>!s||typeof s!=="function"&&typeof s!=="object";class fs extends _g.NodeBase{constructor(s){super(sg.SCALAR);this.value=s}toJSON(s,_){return _?.keep?this.value:ug.toJS(this.value,s,_)}toString(){return String(this.value)}}fs.BLOCK_FOLDED="BLOCK_FOLDED";fs.BLOCK_LITERAL="BLOCK_LITERAL";fs.PLAIN="PLAIN";fs.QUOTE_DOUBLE="QUOTE_DOUBLE";fs.QUOTE_SINGLE="QUOTE_SINGLE";ig.Scalar=fs;ig.isScalarValue=Tg});var Js=X((Ig)=>{var wg=js(),ws=Y(),hT=z(),gg="tag:yaml.org,2002:";function Rg(s,_,u){if(_){let T=u.filter(($)=>$.tag===_),i=T.find(($)=>!$.format)??T[0];if(!i)throw Error(`Tag ${_} not found`);return i}return u.find((T)=>T.identify?.(s)&&!T.format)}function Lg(s,_,u){if(ws.isDocument(s))s=s.contents;if(ws.isNode(s))return s;if(ws.isPair(s)){let L=u.schema[ws.MAP].createNode?.(u.schema,null,u);return L.items.push(s),L}if(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)s=s.valueOf();let{aliasDuplicateObjects:T,onAnchor:i,onTagObj:$,schema:f,sourceObjects:w}=u,g=void 0;if(T&&s&&typeof s==="object")if(g=w.get(s),g)return g.anchor??(g.anchor=i(s)),new wg.Alias(g.anchor);else g={anchor:null,node:null},w.set(s,g);if(_?.startsWith("!!"))_=gg+_.slice(2);let R=Rg(s,_,f.tags);if(!R){if(s&&typeof s.toJSON==="function")s=s.toJSON();if(!s||typeof s!=="object"){let L=new hT.Scalar(s);if(g)g.node=L;return L}R=s instanceof Map?f[ws.MAP]:(Symbol.iterator in Object(s))?f[ws.SEQ]:f[ws.MAP]}if($)$(R),delete u.onTagObj;let O=R?.createNode?R.createNode(u.schema,s,u):typeof R?.nodeClass?.from==="function"?R.nodeClass.from(u.schema,s,u):new hT.Scalar(s);if(_)O.tag=_;else if(!R.default)O.tag=R.tag;if(g)g.node=O;return O}Ig.createNode=Lg});var R_=X((Ng)=>{var Og=Js(),y=Y(),Ug=w_();function Tu(s,_,u){let T=u;for(let i=_.length-1;i>=0;--i){let $=_[i];if(typeof $==="number"&&Number.isInteger($)&&$>=0){let f=[];f[$]=T,T=f}else T=new Map([[$,T]])}return Og.createNode(T,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var pT=(s)=>s==null||typeof s==="object"&&!!s[Symbol.iterator]().next().done;class cT extends Ug.NodeBase{constructor(s,_){super(s);Object.defineProperty(this,"schema",{value:_,configurable:!0,enumerable:!1,writable:!0})}clone(s){let _=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(s)_.schema=s;if(_.items=_.items.map((u)=>y.isNode(u)||y.isPair(u)?u.clone(s):u),this.range)_.range=this.range.slice();return _}addIn(s,_){if(pT(s))this.add(_);else{let[u,...T]=s,i=this.get(u,!0);if(y.isCollection(i))i.addIn(T,_);else if(i===void 0&&this.schema)this.set(u,Tu(this.schema,T,_));else throw Error(`Expected YAML collection at ${u}. Remaining path: ${T}`)}}deleteIn(s){let[_,...u]=s;if(u.length===0)return this.delete(_);let T=this.get(_,!0);if(y.isCollection(T))return T.deleteIn(u);else throw Error(`Expected YAML collection at ${_}. Remaining path: ${u}`)}getIn(s,_){let[u,...T]=s,i=this.get(u,!0);if(T.length===0)return!_&&y.isScalar(i)?i.value:i;else return y.isCollection(i)?i.getIn(T,_):void 0}hasAllNullValues(s){return this.items.every((_)=>{if(!y.isPair(_))return!1;let u=_.value;return u==null||s&&y.isScalar(u)&&u.value==null&&!u.commentBefore&&!u.comment&&!u.tag})}hasIn(s){let[_,...u]=s;if(u.length===0)return this.has(_);let T=this.get(_,!0);return y.isCollection(T)?T.hasIn(u):!1}setIn(s,_){let[u,...T]=s;if(T.length===0)this.set(u,_);else{let i=this.get(u,!0);if(y.isCollection(i))i.setIn(T,_);else if(i===void 0&&this.schema)this.set(u,Tu(this.schema,T,_));else throw Error(`Expected YAML collection at ${u}. Remaining path: ${T}`)}}}Ng.Collection=cT;Ng.collectionFromPath=Tu;Ng.isEmptyPath=pT});var Zs=X((Pg)=>{var qg=(s)=>s.replace(/^(?!$)(?: $)?/gm,"#");function iu(s,_){if(/^\n+$/.test(s))return s.substring(1);return _?s.replace(/^(?! *$)/gm,_):s}var Ag=(s,_,u)=>s.endsWith(`
5
- `)?iu(u,_):u.includes(`
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(`
6
5
  `)?`
7
- `+iu(u,_):(s.endsWith(" ")?"":" ")+u;Pg.indentComment=iu;Pg.lineComment=Ag;Pg.stringifyComment=qg});var kT=X((Bg)=>{function Yg(s,_,u="flow",{indentAtStart:T,lineWidth:i=80,minContentWidth:$=20,onFold:f,onOverflow:w}={}){if(!i||i<0)return s;if(i<$)$=0;let g=Math.max(1+$,1+i-_.length);if(s.length<=g)return s;let R=[],O={},L=i-_.length;if(typeof T==="number")if(T>i-Math.max(2,$))R.push(0);else L=i-T;let I=void 0,U=void 0,r=!1,S=-1,N=-1,E=-1;if(u==="block"){if(S=mT(s,S,_.length),S!==-1)L=S+g}for(let P;P=s[S+=1];){if(u==="quoted"&&P==="\\"){switch(N=S,s[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}E=S}if(P===`
8
- `){if(u==="block")S=mT(s,S,_.length);L=S+_.length+g,I=void 0}else{if(P===" "&&U&&U!==" "&&U!==`
9
- `&&U!=="\t"){let D=s[S+1];if(D&&D!==" "&&D!==`
10
- `&&D!=="\t")I=S}if(S>=L)if(I)R.push(I),L=I+g,I=void 0;else if(u==="quoted"){while(U===" "||U==="\t")U=P,P=s[S+=1],r=!0;let D=S>E+1?S-2:N-1;if(O[D])return s;R.push(D),O[D]=!0,L=D+g,I=void 0}else r=!0}U=P}if(r&&w)w();if(R.length===0)return s;if(f)f();let A=s.slice(0,R[0]);for(let P=0;P<R.length;++P){let D=R[P],F=R[P+1]||s.length;if(D===0)A=`
11
- ${_}${s.slice(0,F)}`;else{if(u==="quoted"&&O[D])A+=`${s[D]}\\`;A+=`
12
- ${_}${s.slice(D+1,F)}`}}return A}function mT(s,_,u){let T=_,i=_+1,$=s[i];while($===" "||$==="\t")if(_<i+u)$=s[++_];else{do $=s[++_];while($&&$!==`
13
- `);T=_,i=_+1,$=s[i]}return T}Bg.FOLD_BLOCK="block";Bg.FOLD_FLOW="flow";Bg.FOLD_QUOTED="quoted";Bg.foldFlowLines=Yg});var Qs=X((Qg)=>{var C=z(),t=kT(),I_=(s,_)=>({indentAtStart:_?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),S_=(s)=>/^(%|---|\.\.\.)/m.test(s);function Jg(s,_,u){if(!_||_<0)return!1;let T=_-u,i=s.length;if(i<=T)return!1;for(let $=0,f=0;$<i;++$)if(s[$]===`
14
- `){if($-f>T)return!0;if(f=$+1,i-f<=T)return!1}return!0}function Ms(s,_){let u=JSON.stringify(s);if(_.options.doubleQuotedAsJSON)return u;let{implicitKey:T}=_,i=_.options.doubleQuotedMinMultiLineLength,$=_.indent||(S_(s)?" ":""),f="",w=0;for(let g=0,R=u[g];R;R=u[++g]){if(R===" "&&u[g+1]==="\\"&&u[g+2]==="n")f+=u.slice(w,g)+"\\ ",g+=1,w=g,R="\\";if(R==="\\")switch(u[g+1]){case"u":{f+=u.slice(w,g);let O=u.substr(g+2,4);switch(O){case"0000":f+="\\0";break;case"0007":f+="\\a";break;case"000b":f+="\\v";break;case"001b":f+="\\e";break;case"0085":f+="\\N";break;case"00a0":f+="\\_";break;case"2028":f+="\\L";break;case"2029":f+="\\P";break;default:if(O.substr(0,2)==="00")f+="\\x"+O.substr(2);else f+=u.substr(g,6)}g+=5,w=g+1}break;case"n":if(T||u[g+2]==='"'||u.length<i)g+=1;else{f+=u.slice(w,g)+`
15
-
16
- `;while(u[g+2]==="\\"&&u[g+3]==="n"&&u[g+4]!=='"')f+=`
17
- `,g+=2;if(f+=$,u[g+2]===" ")f+="\\";g+=1,w=g+1}break;default:g+=1}}return f=w?f+u.slice(w):u,T?f:t.foldFlowLines(f,$,t.FOLD_QUOTED,I_(_,!1))}function $u(s,_){if(_.options.singleQuote===!1||_.implicitKey&&s.includes(`
18
- `)||/[ \t]\n|\n[ \t]/.test(s))return Ms(s,_);let u=_.indent||(S_(s)?" ":""),T="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
19
- ${u}`)+"'";return _.implicitKey?T:t.foldFlowLines(T,u,t.FOLD_FLOW,I_(_,!1))}function Es(s,_){let{singleQuote:u}=_.options,T;if(u===!1)T=Ms;else{let i=s.includes('"'),$=s.includes("'");if(i&&!$)T=$u;else if($&&!i)T=Ms;else T=u?$u:Ms}return T(s,_)}var fu;try{fu=new RegExp(`(^|(?<!
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(`(^|(?<!
20
19
  ))
21
20
  +(?!
22
- |$)`,"g")}catch{fu=/\n+(?!\n|$)/g}function L_({comment:s,type:_,value:u},T,i,$){let{blockQuote:f,commentString:w,lineWidth:g}=T.options;if(!f||/\n[\t ]+$/.test(u))return Es(u,T);let R=T.indent||(T.forceBlockIndent||S_(u)?" ":""),O=f==="literal"?!0:f==="folded"||_===C.Scalar.BLOCK_FOLDED?!1:_===C.Scalar.BLOCK_LITERAL?!0:!Jg(u,g,R.length);if(!u)return O?`|
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?`|
23
22
  `:`>
24
- `;let L,I;for(I=u.length;I>0;--I){let F=u[I-1];if(F!==`
25
- `&&F!=="\t"&&F!==" ")break}let U=u.substring(I),r=U.indexOf(`
26
- `);if(r===-1)L="-";else if(u===U||r!==U.length-1){if(L="+",$)$()}else L="";if(U){if(u=u.slice(0,-U.length),U[U.length-1]===`
27
- `)U=U.slice(0,-1);U=U.replace(fu,`$&${R}`)}let S=!1,N,E=-1;for(N=0;N<u.length;++N){let F=u[N];if(F===" ")S=!0;else if(F===`
28
- `)E=N;else break}let A=u.substring(0,E<N?E+1:N);if(A)u=u.substring(A.length),A=A.replace(/\n+/g,`$&${R}`);let D=(S?R?"2":"1":"")+L;if(s){if(D+=" "+w(s.replace(/ ?[\r\n]+/g," ")),i)i()}if(!O){let F=u.replace(/\n+/g,`
29
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${R}`),H=!1,B=I_(T,!0);if(f!=="folded"&&_!==C.Scalar.BLOCK_FOLDED)B.onOverflow=()=>{H=!0};let q=t.foldFlowLines(`${A}${F}${U}`,R,t.FOLD_BLOCK,B);if(!H)return`>${D}
30
- ${R}${q}`}return u=u.replace(/\n+/g,`$&${R}`),`|${D}
31
- ${R}${A}${u}${U}`}function Zg(s,_,u,T){let{type:i,value:$}=s,{actualString:f,implicitKey:w,indent:g,indentStep:R,inFlow:O}=_;if(w&&$.includes(`
32
- `)||O&&/[[\]{},]/.test($))return Es($,_);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test($))return w||O||!$.includes(`
33
- `)?Es($,_):L_(s,_,u,T);if(!w&&!O&&i!==C.Scalar.PLAIN&&$.includes(`
34
- `))return L_(s,_,u,T);if(S_($)){if(g==="")return _.forceBlockIndent=!0,L_(s,_,u,T);else if(w&&g===R)return Es($,_)}let L=$.replace(/\n+/g,`$&
35
- ${g}`);if(f){let I=(S)=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(L),{compat:U,tags:r}=_.doc.schema;if(r.some(I)||U?.some(I))return Es($,_)}return w?L:t.foldFlowLines(L,g,t.FOLD_FLOW,I_(_,!1))}function Mg(s,_,u,T){let{implicitKey:i,inFlow:$}=_,f=typeof s.value==="string"?s:Object.assign({},s,{value:String(s.value)}),{type:w}=s;if(w!==C.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value))w=C.Scalar.QUOTE_DOUBLE}let g=(O)=>{switch(O){case C.Scalar.BLOCK_FOLDED:case C.Scalar.BLOCK_LITERAL:return i||$?Es(f.value,_):L_(f,_,u,T);case C.Scalar.QUOTE_DOUBLE:return Ms(f.value,_);case C.Scalar.QUOTE_SINGLE:return $u(f.value,_);case C.Scalar.PLAIN:return Zg(f,_,u,T);default:return null}},R=g(w);if(R===null){let{defaultKeyType:O,defaultStringType:L}=_.options,I=i&&O||L;if(R=g(I),R===null)throw Error(`Unsupported default string type ${I}`)}return R}Qg.stringifyString=Mg});var Vs=X((ag)=>{var bg=f_(),v=Y(),lg=Zs(),ng=Qs();function Cg(s,_){let u=Object.assign({blockQuote:!0,commentString:lg.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},s.schema.toStringOptions,_),T;switch(u.collectionStyle){case"block":T=!1;break;case"flow":T=!0;break;default:T=null}return{anchors:new Set,doc:s,flowCollectionPadding:u.flowCollectionPadding?" ":"",indent:"",indentStep:typeof u.indent==="number"?" ".repeat(u.indent):" ",inFlow:T,options:u}}function dg(s,_){if(_.tag){let i=s.filter(($)=>$.tag===_.tag);if(i.length>0)return i.find(($)=>$.format===_.format)??i[0]}let u=void 0,T;if(v.isScalar(_)){T=_.value;let i=s.filter(($)=>$.identify?.(T));if(i.length>1){let $=i.filter((f)=>f.test);if($.length>0)i=$}u=i.find(($)=>$.format===_.format)??i.find(($)=>!$.format)}else T=_,u=s.find((i)=>i.nodeClass&&T instanceof i.nodeClass);if(!u){let i=T?.constructor?.name??(T===null?"null":typeof T);throw Error(`Tag not resolved for ${i} value`)}return u}function Kg(s,_,{anchors:u,doc:T}){if(!T.directives)return"";let i=[],$=(v.isScalar(s)||v.isCollection(s))&&s.anchor;if($&&bg.anchorIsValid($))u.add($),i.push(`&${$}`);let f=s.tag??(_.default?null:_.tag);if(f)i.push(T.directives.tagString(f));return i.join(" ")}function yg(s,_,u,T){if(v.isPair(s))return s.toString(_,u,T);if(v.isAlias(s)){if(_.doc.directives)return s.toString(_);if(_.resolvedAliases?.has(s))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(_.resolvedAliases)_.resolvedAliases.add(s);else _.resolvedAliases=new Set([s]);s=s.resolve(_.doc)}}let i=void 0,$=v.isNode(s)?s:_.doc.createNode(s,{onTagObj:(g)=>i=g});i??(i=dg(_.doc.schema.tags,$));let f=Kg($,i,_);if(f.length>0)_.indentAtStart=(_.indentAtStart??0)+f.length+1;let w=typeof i.stringify==="function"?i.stringify($,_,u,T):v.isScalar($)?ng.stringifyString($,_,u,T):$.toString(_,u,T);if(!f)return w;return v.isScalar($)||w[0]==="{"||w[0]==="["?`${f} ${w}`:`${f}
36
- ${_.indent}${w}`}ag.createStringifyContext=Cg;ag.stringify=yg});var vT=X((mg)=>{var c=Y(),xT=z(),tT=Vs(),bs=Zs();function cg({key:s,value:_},u,T,i){let{allNullValues:$,doc:f,indent:w,indentStep:g,options:{commentString:R,indentSeq:O,simpleKeys:L}}=u,I=c.isNode(s)&&s.comment||null;if(L){if(I)throw Error("With simple keys, key nodes cannot have comments");if(c.isCollection(s)||!c.isNode(s)&&typeof s==="object")throw Error("With simple keys, collection cannot be used as a key value")}let U=!L&&(!s||I&&_==null&&!u.inFlow||c.isCollection(s)||(c.isScalar(s)?s.type===xT.Scalar.BLOCK_FOLDED||s.type===xT.Scalar.BLOCK_LITERAL:typeof s==="object"));u=Object.assign({},u,{allNullValues:!1,implicitKey:!U&&(L||!$),indent:w+g});let r=!1,S=!1,N=tT.stringify(s,u,()=>r=!0,()=>S=!0);if(!U&&!u.inFlow&&N.length>1024){if(L)throw Error("With simple keys, single line scalar must not span more than 1024 characters");U=!0}if(u.inFlow){if($||_==null){if(r&&T)T();return N===""?"?":U?`? ${N}`:N}}else if($&&!L||_==null&&U){if(N=`? ${N}`,I&&!r)N+=bs.lineComment(N,u.indent,R(I));else if(S&&i)i();return N}if(r)I=null;if(U){if(I)N+=bs.lineComment(N,u.indent,R(I));N=`? ${N}
37
- ${w}:`}else if(N=`${N}:`,I)N+=bs.lineComment(N,u.indent,R(I));let E,A,P;if(c.isNode(_))E=!!_.spaceBefore,A=_.commentBefore,P=_.comment;else if(E=!1,A=null,P=null,_&&typeof _==="object")_=f.createNode(_);if(u.implicitKey=!1,!U&&!I&&c.isScalar(_))u.indentAtStart=N.length+1;if(S=!1,!O&&g.length>=2&&!u.inFlow&&!U&&c.isSeq(_)&&!_.flow&&!_.tag&&!_.anchor)u.indent=u.indent.substring(2);let D=!1,F=tT.stringify(_,u,()=>D=!0,()=>S=!0),H=" ";if(I||E||A){if(H=E?`
38
- `:"",A){let B=R(A);H+=`
39
- ${bs.indentComment(B,u.indent)}`}if(F===""&&!u.inFlow){if(H===`
40
- `&&P)H=`
41
-
42
- `}else H+=`
43
- ${u.indent}`}else if(!U&&c.isCollection(_)){let B=F[0],q=F.indexOf(`
44
- `),G=q!==-1,k=u.inFlow??_.flow??_.items.length===0;if(G||!k){let Us=!1;if(G&&(B==="&"||B==="!")){let W=F.indexOf(" ");if(B==="&"&&W!==-1&&W<q&&F[W+1]==="!")W=F.indexOf(" ",W+1);if(W===-1||q<W)Us=!0}if(!Us)H=`
45
- ${u.indent}`}}else if(F===""||F[0]===`
46
- `)H="";if(N+=H+F,u.inFlow){if(D&&T)T()}else if(P&&!D)N+=bs.lineComment(N,u.indent,R(P));else if(S&&i)i();return N}mg.stringifyPair=cg});var wu=X((vg)=>{var eT=__("process");function xg(s,..._){if(s==="debug")console.log(..._)}function tg(s,_){if(s==="debug"||s==="warn")if(typeof eT.emitWarning==="function")eT.emitWarning(_);else console.warn(_)}vg.debug=xg;vg.warn=tg});var r_=X((_R)=>{var N_=Y(),oT=z(),O_="<<",U_={identify:(s)=>s===O_||typeof s==="symbol"&&s.description===O_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new oT.Scalar(Symbol(O_)),{addToJSMap:si}),stringify:()=>O_},sR=(s,_)=>(U_.identify(_)||N_.isScalar(_)&&(!_.type||_.type===oT.Scalar.PLAIN)&&U_.identify(_.value))&&s?.doc.schema.tags.some((u)=>u.tag===U_.tag&&u.default);function si(s,_,u){let T=_i(s,u);if(N_.isSeq(T))for(let i of T.items)gu(s,_,i);else if(Array.isArray(T))for(let i of T)gu(s,_,i);else gu(s,_,T)}function gu(s,_,u){let T=_i(s,u);if(!N_.isMap(T))throw Error("Merge sources must be maps or map aliases");let i=T.toJSON(null,s,Map);for(let[$,f]of i)if(_ instanceof Map){if(!_.has($))_.set($,f)}else if(_ instanceof Set)_.add($);else if(!Object.prototype.hasOwnProperty.call(_,$))Object.defineProperty(_,$,{value:f,writable:!0,enumerable:!0,configurable:!0});return _}function _i(s,_){return s&&N_.isAlias(_)?_.resolve(s.doc,s):_}_R.addMergeToJSMap=si;_R.isMergeKey=sR;_R.merge=U_});var Lu=X((RR)=>{var $R=wu(),ui=r_(),fR=Vs(),Ti=Y(),Ru=x();function wR(s,_,{key:u,value:T}){if(Ti.isNode(u)&&u.addToJSMap)u.addToJSMap(s,_,T);else if(ui.isMergeKey(s,u))ui.addMergeToJSMap(s,_,T);else{let i=Ru.toJS(u,"",s);if(_ instanceof Map)_.set(i,Ru.toJS(T,i,s));else if(_ instanceof Set)_.add(i);else{let $=gR(u,i,s),f=Ru.toJS(T,$,s);if($ in _)Object.defineProperty(_,$,{value:f,writable:!0,enumerable:!0,configurable:!0});else _[$]=f}}return _}function gR(s,_,u){if(_===null)return"";if(typeof _!=="object")return String(_);if(Ti.isNode(s)&&u?.doc){let T=fR.createStringifyContext(u.doc,{});T.anchors=new Set;for(let $ of u.anchors.keys())T.anchors.add($.anchor);T.inFlow=!0,T.inStringifyKey=!0;let i=s.toString(T);if(!u.mapKeyWarned){let $=JSON.stringify(i);if($.length>40)$=$.substring(0,36)+'..."';$R.warn(u.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${$}. Set mapAsMap: true to use object keys.`),u.mapKeyWarned=!0}return i}return JSON.stringify(_)}RR.addPairToJSMap=wR});var e=X((UR)=>{var ii=Js(),IR=vT(),SR=Lu(),X_=Y();function OR(s,_,u){let T=ii.createNode(s,void 0,u),i=ii.createNode(_,void 0,u);return new E_(T,i)}class E_{constructor(s,_=null){Object.defineProperty(this,X_.NODE_TYPE,{value:X_.PAIR}),this.key=s,this.value=_}clone(s){let{key:_,value:u}=this;if(X_.isNode(_))_=_.clone(s);if(X_.isNode(u))u=u.clone(s);return new E_(_,u)}toJSON(s,_){let u=_?.mapAsMap?new Map:{};return SR.addPairToJSMap(_,u,this)}toString(s,_,u){return s?.doc?IR.stringifyPair(this,s,_,u):JSON.stringify(this)}}UR.Pair=E_;UR.createPair=OR});var Iu=X((AR)=>{var gs=Y(),$i=Vs(),q_=Zs();function XR(s,_,u){return(_.inFlow??s.flow?qR:ER)(s,_,u)}function ER({comment:s,items:_},u,{blockItemPrefix:T,flowChars:i,itemIndent:$,onChompKeep:f,onComment:w}){let{indent:g,options:{commentString:R}}=u,O=Object.assign({},u,{indent:$,type:null}),L=!1,I=[];for(let r=0;r<_.length;++r){let S=_[r],N=null;if(gs.isNode(S)){if(!L&&S.spaceBefore)I.push("");if(A_(u,I,S.commentBefore,L),S.comment)N=S.comment}else if(gs.isPair(S)){let A=gs.isNode(S.key)?S.key:null;if(A){if(!L&&A.spaceBefore)I.push("");A_(u,I,A.commentBefore,L)}}L=!1;let E=$i.stringify(S,O,()=>N=null,()=>L=!0);if(N)E+=q_.lineComment(E,$,R(N));if(L&&N)L=!1;I.push(T+E)}let U;if(I.length===0)U=i.start+i.end;else{U=I[0];for(let r=1;r<I.length;++r){let S=I[r];U+=S?`
47
- ${g}${S}`:`
48
- `}}if(s){if(U+=`
49
- `+q_.indentComment(R(s),g),w)w()}else if(L&&f)f();return U}function qR({items:s},_,{flowChars:u,itemIndent:T}){let{indent:i,indentStep:$,flowCollectionPadding:f,options:{commentString:w}}=_;T+=$;let g=Object.assign({},_,{indent:T,inFlow:!0,type:null}),R=!1,O=0,L=[];for(let r=0;r<s.length;++r){let S=s[r],N=null;if(gs.isNode(S)){if(S.spaceBefore)L.push("");if(A_(_,L,S.commentBefore,!1),S.comment)N=S.comment}else if(gs.isPair(S)){let A=gs.isNode(S.key)?S.key:null;if(A){if(A.spaceBefore)L.push("");if(A_(_,L,A.commentBefore,!1),A.comment)R=!0}let P=gs.isNode(S.value)?S.value:null;if(P){if(P.comment)N=P.comment;if(P.commentBefore)R=!0}else if(S.value==null&&A?.comment)N=A.comment}if(N)R=!0;let E=$i.stringify(S,g,()=>N=null);if(R||(R=L.length>O||E.includes(`
50
- `)),r<s.length-1)E+=",";else if(_.options.trailingComma){if(_.options.lineWidth>0)R||(R=L.reduce((A,P)=>A+P.length+2,2)+(E.length+2)>_.options.lineWidth);if(R)E+=","}if(N)E+=q_.lineComment(E,T,w(N));L.push(E),O=L.length}let{start:I,end:U}=u;if(L.length===0)return I+U;else{if(!R){let r=L.reduce((S,N)=>S+N.length+2,2);R=_.options.lineWidth>0&&r>_.options.lineWidth}if(R){let r=I;for(let S of L)r+=S?`
51
- ${$}${i}${S}`:`
52
- `;return`${r}
53
- ${i}${U}`}else return`${I}${f}${L.join(" ")}${f}${U}`}}function A_({indent:s,options:{commentString:_}},u,T,i){if(T&&i)T=T.replace(/^\n+/,"");if(T){let $=q_.indentComment(_(T),s);u.push($.trimStart())}}AR.stringifyCollection=XR});var ss=X((BR)=>{var DR=Iu(),FR=Lu(),HR=R_(),o=Y(),P_=e(),YR=z();function ls(s,_){let u=o.isScalar(_)?_.value:_;for(let T of s)if(o.isPair(T)){if(T.key===_||T.key===u)return T;if(o.isScalar(T.key)&&T.key.value===u)return T}return}class fi extends HR.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(s){super(o.MAP,s);this.items=[]}static from(s,_,u){let{keepUndefined:T,replacer:i}=u,$=new this(s),f=(w,g)=>{if(typeof i==="function")g=i.call(_,w,g);else if(Array.isArray(i)&&!i.includes(w))return;if(g!==void 0||T)$.items.push(P_.createPair(w,g,u))};if(_ instanceof Map)for(let[w,g]of _)f(w,g);else if(_&&typeof _==="object")for(let w of Object.keys(_))f(w,_[w]);if(typeof s.sortMapEntries==="function")$.items.sort(s.sortMapEntries);return $}add(s,_){let u;if(o.isPair(s))u=s;else if(!s||typeof s!=="object"||!("key"in s))u=new P_.Pair(s,s?.value);else u=new P_.Pair(s.key,s.value);let T=ls(this.items,u.key),i=this.schema?.sortMapEntries;if(T){if(!_)throw Error(`Key ${u.key} already set`);if(o.isScalar(T.value)&&YR.isScalarValue(u.value))T.value.value=u.value;else T.value=u.value}else if(i){let $=this.items.findIndex((f)=>i(u,f)<0);if($===-1)this.items.push(u);else this.items.splice($,0,u)}else this.items.push(u)}delete(s){let _=ls(this.items,s);if(!_)return!1;return this.items.splice(this.items.indexOf(_),1).length>0}get(s,_){let T=ls(this.items,s)?.value;return(!_&&o.isScalar(T)?T.value:T)??void 0}has(s){return!!ls(this.items,s)}set(s,_){this.add(new P_.Pair(s,_),!0)}toJSON(s,_,u){let T=u?new u:_?.mapAsMap?new Map:{};if(_?.onCreate)_.onCreate(T);for(let i of this.items)FR.addPairToJSMap(_,T,i);return T}toString(s,_,u){if(!s)return JSON.stringify(this);for(let T of this.items)if(!o.isPair(T))throw Error(`Map items must all be pairs; found ${JSON.stringify(T)} instead`);if(!s.allNullValues&&this.hasAllNullValues(!1))s=Object.assign({},s,{allNullValues:!0});return DR.stringifyCollection(this,s,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:s.indent||"",onChompKeep:u,onComment:_})}}BR.YAMLMap=fi;BR.findPair=ls});var qs=X((JR)=>{var WR=Y(),wi=ss(),jR={collection:"map",default:!0,nodeClass:wi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,_){if(!WR.isMap(s))_("Expected a mapping for this tag");return s},createNode:(s,_,u)=>wi.YAMLMap.from(s,_,u)};JR.map=jR});var _s=X((nR)=>{var MR=Js(),QR=Iu(),VR=R_(),F_=Y(),bR=z(),lR=x();class gi extends VR.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(s){super(F_.SEQ,s);this.items=[]}add(s){this.items.push(s)}delete(s){let _=D_(s);if(typeof _!=="number")return!1;return this.items.splice(_,1).length>0}get(s,_){let u=D_(s);if(typeof u!=="number")return;let T=this.items[u];return!_&&F_.isScalar(T)?T.value:T}has(s){let _=D_(s);return typeof _==="number"&&_<this.items.length}set(s,_){let u=D_(s);if(typeof u!=="number")throw Error(`Expected a valid index, not ${s}.`);let T=this.items[u];if(F_.isScalar(T)&&bR.isScalarValue(_))T.value=_;else this.items[u]=_}toJSON(s,_){let u=[];if(_?.onCreate)_.onCreate(u);let T=0;for(let i of this.items)u.push(lR.toJS(i,String(T++),_));return u}toString(s,_,u){if(!s)return JSON.stringify(this);return QR.stringifyCollection(this,s,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(s.indent||"")+" ",onChompKeep:u,onComment:_})}static from(s,_,u){let{replacer:T}=u,i=new this(s);if(_&&Symbol.iterator in Object(_)){let $=0;for(let f of _){if(typeof T==="function"){let w=_ instanceof Set?f:String($++);f=T.call(_,w,f)}i.items.push(MR.createNode(f,void 0,u))}}return i}}function D_(s){let _=F_.isScalar(s)?s.value:s;if(_&&typeof _==="string")_=Number(_);return typeof _==="number"&&Number.isInteger(_)&&_>=0?_:null}nR.YAMLSeq=gi});var As=X((yR)=>{var dR=Y(),Ri=_s(),KR={collection:"seq",default:!0,nodeClass:Ri.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,_){if(!dR.isSeq(s))_("Expected a sequence for this tag");return s},createNode:(s,_,u)=>Ri.YAMLSeq.from(s,_,u)};yR.seq=KR});var ns=X((cR)=>{var hR=Qs(),pR={identify:(s)=>typeof s==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(s)=>s,stringify(s,_,u,T){return _=Object.assign({actualString:!0},_),hR.stringifyString(s,_,u,T)}};cR.string=pR});var H_=X((kR)=>{var Li=z(),Ii={identify:(s)=>s==null,createNode:()=>new Li.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Li.Scalar(null),stringify:({source:s},_)=>typeof s==="string"&&Ii.test.test(s)?s:_.options.nullStr};kR.nullTag=Ii});var Su=X((vR)=>{var tR=z(),Si={identify:(s)=>typeof s==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(s)=>new tR.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:_},u){if(s&&Si.test.test(s)){let T=s[0]==="t"||s[0]==="T";if(_===T)return s}return _?u.options.trueStr:u.options.falseStr}};vR.boolTag=Si});var Ps=X((sL)=>{function oR({format:s,minFractionDigits:_,tag:u,value:T}){if(typeof T==="bigint")return String(T);let i=typeof T==="number"?T:Number(T);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let $=Object.is(T,-0)?"-0":JSON.stringify(T);if(!s&&_&&(!u||u==="tag:yaml.org,2002:float")&&/^-?\d/.test($)&&!$.includes("e")){let f=$.indexOf(".");if(f<0)f=$.length,$+=".";let w=_-($.length-f-1);while(w-- >0)$+="0"}return $}sL.stringifyNumber=oR});var Uu=X((fL)=>{var uL=z(),Ou=Ps(),TL={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(s)=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ou.stringifyNumber},iL={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(s)=>parseFloat(s),stringify(s){let _=Number(s.value);return isFinite(_)?_.toExponential():Ou.stringifyNumber(s)}},$L={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let _=new uL.Scalar(parseFloat(s)),u=s.indexOf(".");if(u!==-1&&s[s.length-1]==="0")_.minFractionDigits=s.length-u-1;return _},stringify:Ou.stringifyNumber};fL.float=$L;fL.floatExp=iL;fL.floatNaN=TL});var ru=X((OL)=>{var Oi=Ps(),Y_=(s)=>typeof s==="bigint"||Number.isInteger(s),Nu=(s,_,u,{intAsBigInt:T})=>T?BigInt(s):parseInt(s.substring(_),u);function Ui(s,_,u){let{value:T}=s;if(Y_(T)&&T>=0)return u+T.toString(_);return Oi.stringifyNumber(s)}var LL={identify:(s)=>Y_(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,_,u)=>Nu(s,2,8,u),stringify:(s)=>Ui(s,8,"0o")},IL={identify:Y_,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,_,u)=>Nu(s,0,10,u),stringify:Oi.stringifyNumber},SL={identify:(s)=>Y_(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,_,u)=>Nu(s,2,16,u),stringify:(s)=>Ui(s,16,"0x")};OL.int=IL;OL.intHex=SL;OL.intOct=LL});var Ni=X((FL)=>{var XL=qs(),EL=H_(),qL=As(),AL=ns(),PL=Su(),Xu=Uu(),Eu=ru(),DL=[XL.map,qL.seq,AL.string,EL.nullTag,PL.boolTag,Eu.intOct,Eu.int,Eu.intHex,Xu.floatNaN,Xu.floatExp,Xu.float];FL.schema=DL});var Xi=X((JL)=>{var YL=z(),BL=qs(),zL=As();function ri(s){return typeof s==="bigint"||Number.isInteger(s)}var B_=({value:s})=>JSON.stringify(s),GL=[{identify:(s)=>typeof s==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(s)=>s,stringify:B_},{identify:(s)=>s==null,createNode:()=>new YL.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:B_},{identify:(s)=>typeof s==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(s)=>s==="true",stringify:B_},{identify:ri,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,_,{intAsBigInt:u})=>u?BigInt(s):parseInt(s,10),stringify:({value:s})=>ri(s)?s.toString():JSON.stringify(s)},{identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(s)=>parseFloat(s),stringify:B_}],WL={default:!0,tag:"",test:/^/,resolve(s,_){return _(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},jL=[BL.map,zL.seq].concat(GL,WL);JL.schema=jL});var Au=X((VL)=>{var Cs=__("buffer"),qu=z(),ML=Qs(),QL={identify:(s)=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,_){if(typeof Cs.Buffer==="function")return Cs.Buffer.from(s,"base64");else if(typeof atob==="function"){let u=atob(s.replace(/[\n\r]/g,"")),T=new Uint8Array(u.length);for(let i=0;i<u.length;++i)T[i]=u.charCodeAt(i);return T}else return _("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:_,value:u},T,i,$){if(!u)return"";let f=u,w;if(typeof Cs.Buffer==="function")w=f instanceof Cs.Buffer?f.toString("base64"):Cs.Buffer.from(f.buffer).toString("base64");else if(typeof btoa==="function"){let g="";for(let R=0;R<f.length;++R)g+=String.fromCharCode(f[R]);w=btoa(g)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(_??(_=qu.Scalar.BLOCK_LITERAL),_!==qu.Scalar.QUOTE_DOUBLE){let g=Math.max(T.options.lineWidth-T.indent.length,T.options.minContentWidth),R=Math.ceil(w.length/g),O=Array(R);for(let L=0,I=0;L<R;++L,I+=g)O[L]=w.substr(I,g);w=O.join(_===qu.Scalar.BLOCK_LITERAL?`
54
- `:" ")}return ML.stringifyString({comment:s,type:_,value:w},T,i,$)}};VL.binary=QL});var G_=X((dL)=>{var z_=Y(),Pu=e(),lL=z(),nL=_s();function Ei(s,_){if(z_.isSeq(s))for(let u=0;u<s.items.length;++u){let T=s.items[u];if(z_.isPair(T))continue;else if(z_.isMap(T)){if(T.items.length>1)_("Each pair must have its own sequence indicator");let i=T.items[0]||new Pu.Pair(new lL.Scalar(null));if(T.commentBefore)i.key.commentBefore=i.key.commentBefore?`${T.commentBefore}
55
- ${i.key.commentBefore}`:T.commentBefore;if(T.comment){let $=i.value??i.key;$.comment=$.comment?`${T.comment}
56
- ${$.comment}`:T.comment}T=i}s.items[u]=z_.isPair(T)?T:new Pu.Pair(T)}else _("Expected a sequence for this tag");return s}function qi(s,_,u){let{replacer:T}=u,i=new nL.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let $=0;if(_&&Symbol.iterator in Object(_))for(let f of _){if(typeof T==="function")f=T.call(_,String($++),f);let w,g;if(Array.isArray(f))if(f.length===2)w=f[0],g=f[1];else throw TypeError(`Expected [key, value] tuple: ${f}`);else if(f&&f instanceof Object){let R=Object.keys(f);if(R.length===1)w=R[0],g=f[w];else throw TypeError(`Expected tuple with one key, not ${R.length} keys`)}else w=f;i.items.push(Pu.createPair(w,g,u))}return i}var CL={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ei,createNode:qi};dL.createPairs=qi;dL.pairs=CL;dL.resolvePairs=Ei});var Fu=X((cL)=>{var Ai=Y(),Du=x(),ds=ss(),hL=_s(),Pi=G_();class Rs extends hL.YAMLSeq{constructor(){super();this.add=ds.YAMLMap.prototype.add.bind(this),this.delete=ds.YAMLMap.prototype.delete.bind(this),this.get=ds.YAMLMap.prototype.get.bind(this),this.has=ds.YAMLMap.prototype.has.bind(this),this.set=ds.YAMLMap.prototype.set.bind(this),this.tag=Rs.tag}toJSON(s,_){if(!_)return super.toJSON(s);let u=new Map;if(_?.onCreate)_.onCreate(u);for(let T of this.items){let i,$;if(Ai.isPair(T))i=Du.toJS(T.key,"",_),$=Du.toJS(T.value,i,_);else i=Du.toJS(T,"",_);if(u.has(i))throw Error("Ordered maps must not include duplicate keys");u.set(i,$)}return u}static from(s,_,u){let T=Pi.createPairs(s,_,u),i=new this;return i.items=T.items,i}}Rs.tag="tag:yaml.org,2002:omap";var pL={collection:"seq",identify:(s)=>s instanceof Map,nodeClass:Rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,_){let u=Pi.resolvePairs(s,_),T=[];for(let{key:i}of u.items)if(Ai.isScalar(i))if(T.includes(i.value))_(`Ordered maps must not include duplicate keys: ${i.value}`);else T.push(i.value);return Object.assign(new Rs,u)},createNode:(s,_,u)=>Rs.from(s,_,u)};cL.YAMLOMap=Rs;cL.omap=pL});var Bi=X((xL)=>{var Di=z();function Fi({value:s,source:_},u){if(_&&(s?Hi:Yi).test.test(_))return _;return s?u.options.trueStr:u.options.falseStr}var Hi={identify:(s)=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Di.Scalar(!0),stringify:Fi},Yi={identify:(s)=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Di.Scalar(!1),stringify:Fi};xL.falseTag=Yi;xL.trueTag=Hi});var zi=X((u0)=>{var eL=z(),Hu=Ps(),oL={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(s)=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hu.stringifyNumber},s0={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(s)=>parseFloat(s.replace(/_/g,"")),stringify(s){let _=Number(s.value);return isFinite(_)?_.toExponential():Hu.stringifyNumber(s)}},_0={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let _=new eL.Scalar(parseFloat(s.replace(/_/g,""))),u=s.indexOf(".");if(u!==-1){let T=s.substring(u+1).replace(/_/g,"");if(T[T.length-1]==="0")_.minFractionDigits=T.length}return _},stringify:Hu.stringifyNumber};u0.float=_0;u0.floatExp=s0;u0.floatNaN=oL});var Wi=X((L0)=>{var Gi=Ps(),Ks=(s)=>typeof s==="bigint"||Number.isInteger(s);function W_(s,_,u,{intAsBigInt:T}){let i=s[0];if(i==="-"||i==="+")_+=1;if(s=s.substring(_).replace(/_/g,""),T){switch(u){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let f=BigInt(s);return i==="-"?BigInt(-1)*f:f}let $=parseInt(s,u);return i==="-"?-1*$:$}function Yu(s,_,u){let{value:T}=s;if(Ks(T)){let i=T.toString(_);return T<0?"-"+u+i.substr(1):u+i}return Gi.stringifyNumber(s)}var f0={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,_,u)=>W_(s,2,2,u),stringify:(s)=>Yu(s,2,"0b")},w0={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,_,u)=>W_(s,1,8,u),stringify:(s)=>Yu(s,8,"0")},g0={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,_,u)=>W_(s,0,10,u),stringify:Gi.stringifyNumber},R0={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,_,u)=>W_(s,2,16,u),stringify:(s)=>Yu(s,16,"0x")};L0.int=g0;L0.intBin=f0;L0.intHex=R0;L0.intOct=w0});var Bu=X((r0)=>{var Z_=Y(),j_=e(),J_=ss();class Ls extends J_.YAMLMap{constructor(s){super(s);this.tag=Ls.tag}add(s){let _;if(Z_.isPair(s))_=s;else if(s&&typeof s==="object"&&"key"in s&&"value"in s&&s.value===null)_=new j_.Pair(s.key,null);else _=new j_.Pair(s,null);if(!J_.findPair(this.items,_.key))this.items.push(_)}get(s,_){let u=J_.findPair(this.items,s);return!_&&Z_.isPair(u)?Z_.isScalar(u.key)?u.key.value:u.key:u}set(s,_){if(typeof _!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof _}`);let u=J_.findPair(this.items,s);if(u&&!_)this.items.splice(this.items.indexOf(u),1);else if(!u&&_)this.items.push(new j_.Pair(s))}toJSON(s,_){return super.toJSON(s,_,Set)}toString(s,_,u){if(!s)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},s,{allNullValues:!0}),_,u);else throw Error("Set items must all have null values")}static from(s,_,u){let{replacer:T}=u,i=new this(s);if(_&&Symbol.iterator in Object(_))for(let $ of _){if(typeof T==="function")$=T.call(_,$,$);i.items.push(j_.createPair($,null,u))}return i}}Ls.tag="tag:yaml.org,2002:set";var N0={collection:"map",identify:(s)=>s instanceof Set,nodeClass:Ls,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,_,u)=>Ls.from(s,_,u),resolve(s,_){if(Z_.isMap(s))if(s.hasAllNullValues(!0))return Object.assign(new Ls,s);else _("Set items must all have null values");else _("Expected a mapping for this tag");return s}};r0.YAMLSet=Ls;r0.set=N0});var Gu=X((D0)=>{var q0=Ps();function zu(s,_){let u=s[0],T=u==="-"||u==="+"?s.substring(1):s,i=(f)=>_?BigInt(f):Number(f),$=T.replace(/_/g,"").split(":").reduce((f,w)=>f*i(60)+i(w),i(0));return u==="-"?i(-1)*$:$}function ji(s){let{value:_}=s,u=(f)=>f;if(typeof _==="bigint")u=(f)=>BigInt(f);else if(isNaN(_)||!isFinite(_))return q0.stringifyNumber(s);let T="";if(_<0)T="-",_*=u(-1);let i=u(60),$=[_%i];if(_<60)$.unshift(0);else if(_=(_-$[0])/i,$.unshift(_%i),_>=60)_=(_-$[0])/i,$.unshift(_);return T+$.map((f)=>String(f).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var A0={identify:(s)=>typeof s==="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,_,{intAsBigInt:u})=>zu(s,u),stringify:ji},P0={identify:(s)=>typeof s==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(s)=>zu(s,!1),stringify:ji},Ji={identify:(s)=>s 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(s){let _=s.match(Ji.test);if(!_)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,u,T,i,$,f,w]=_.map(Number),g=_[7]?Number((_[7]+"00").substr(1,3)):0,R=Date.UTC(u,T-1,i,$||0,f||0,w||0,g),O=_[8];if(O&&O!=="Z"){let L=zu(O,!1);if(Math.abs(L)<30)L*=60;R-=60000*L}return new Date(R)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};D0.floatTime=P0;D0.intTime=A0;D0.timestamp=Ji});var Mi=X((b0)=>{var B0=qs(),z0=H_(),G0=As(),W0=ns(),j0=Au(),Zi=Bi(),Wu=zi(),M_=Wi(),J0=r_(),Z0=Fu(),M0=G_(),Q0=Bu(),ju=Gu(),V0=[B0.map,G0.seq,W0.string,z0.nullTag,Zi.trueTag,Zi.falseTag,M_.intBin,M_.intOct,M_.int,M_.intHex,Wu.floatNaN,Wu.floatExp,Wu.float,j0.binary,J0.merge,Z0.omap,M0.pairs,Q0.set,ju.intTime,ju.floatTime,ju.timestamp];b0.schema=V0});var ai=X((p0)=>{var li=qs(),n0=H_(),ni=As(),C0=ns(),d0=Su(),Ju=Uu(),Zu=ru(),K0=Ni(),y0=Xi(),Ci=Au(),ys=r_(),di=Fu(),Ki=G_(),Qi=Mi(),yi=Bu(),Q_=Gu(),Vi=new Map([["core",K0.schema],["failsafe",[li.map,ni.seq,C0.string]],["json",y0.schema],["yaml11",Qi.schema],["yaml-1.1",Qi.schema]]),bi={binary:Ci.binary,bool:d0.boolTag,float:Ju.float,floatExp:Ju.floatExp,floatNaN:Ju.floatNaN,floatTime:Q_.floatTime,int:Zu.int,intHex:Zu.intHex,intOct:Zu.intOct,intTime:Q_.intTime,map:li.map,merge:ys.merge,null:n0.nullTag,omap:di.omap,pairs:Ki.pairs,seq:ni.seq,set:yi.set,timestamp:Q_.timestamp},a0={"tag:yaml.org,2002:binary":Ci.binary,"tag:yaml.org,2002:merge":ys.merge,"tag:yaml.org,2002:omap":di.omap,"tag:yaml.org,2002:pairs":Ki.pairs,"tag:yaml.org,2002:set":yi.set,"tag:yaml.org,2002:timestamp":Q_.timestamp};function h0(s,_,u){let T=Vi.get(_);if(T&&!s)return u&&!T.includes(ys.merge)?T.concat(ys.merge):T.slice();let i=T;if(!i)if(Array.isArray(s))i=[];else{let $=Array.from(Vi.keys()).filter((f)=>f!=="yaml11").map((f)=>JSON.stringify(f)).join(", ");throw Error(`Unknown schema "${_}"; use one of ${$} or define customTags array`)}if(Array.isArray(s))for(let $ of s)i=i.concat($);else if(typeof s==="function")i=s(i.slice());if(u)i=i.concat(ys.merge);return i.reduce(($,f)=>{let w=typeof f==="string"?bi[f]:f;if(!w){let g=JSON.stringify(f),R=Object.keys(bi).map((O)=>JSON.stringify(O)).join(", ");throw Error(`Unknown custom tag ${g}; use one of ${R}`)}if(!$.includes(w))$.push(w);return $},[])}p0.coreKnownTags=a0;p0.getTags=h0});var Vu=X((e0)=>{var Mu=Y(),k0=qs(),x0=As(),t0=ns(),V_=ai(),v0=(s,_)=>s.key<_.key?-1:s.key>_.key?1:0;class Qu{constructor({compat:s,customTags:_,merge:u,resolveKnownTags:T,schema:i,sortMapEntries:$,toStringDefaults:f}){this.compat=Array.isArray(s)?V_.getTags(s,"compat"):s?V_.getTags(null,s):null,this.name=typeof i==="string"&&i||"core",this.knownTags=T?V_.coreKnownTags:{},this.tags=V_.getTags(_,this.name,u),this.toStringOptions=f??null,Object.defineProperty(this,Mu.MAP,{value:k0.map}),Object.defineProperty(this,Mu.SCALAR,{value:t0.string}),Object.defineProperty(this,Mu.SEQ,{value:x0.seq}),this.sortMapEntries=typeof $==="function"?$:$===!0?v0:null}clone(){let s=Object.create(Qu.prototype,Object.getOwnPropertyDescriptors(this));return s.tags=this.tags.slice(),s}}e0.Schema=Qu});var hi=X((uI)=>{var sI=Y(),bu=Vs(),as=Zs();function _I(s,_){let u=[],T=_.directives===!0;if(_.directives!==!1&&s.directives){let g=s.directives.toString(s);if(g)u.push(g),T=!0;else if(s.directives.docStart)T=!0}if(T)u.push("---");let i=bu.createStringifyContext(s,_),{commentString:$}=i.options;if(s.commentBefore){if(u.length!==1)u.unshift("");let g=$(s.commentBefore);u.unshift(as.indentComment(g,""))}let f=!1,w=null;if(s.contents){if(sI.isNode(s.contents)){if(s.contents.spaceBefore&&T)u.push("");if(s.contents.commentBefore){let O=$(s.contents.commentBefore);u.push(as.indentComment(O,""))}i.forceBlockIndent=!!s.comment,w=s.contents.comment}let g=w?void 0:()=>f=!0,R=bu.stringify(s.contents,i,()=>w=null,g);if(w)R+=as.lineComment(R,"",$(w));if((R[0]==="|"||R[0]===">")&&u[u.length-1]==="---")u[u.length-1]=`--- ${R}`;else u.push(R)}else u.push(bu.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let g=$(s.comment);if(g.includes(`
57
- `))u.push("..."),u.push(as.indentComment(g,""));else u.push(`... ${g}`)}else u.push("...");else{let g=s.comment;if(g&&f)g=g.replace(/^\n+/,"");if(g){if((!f||w)&&u[u.length-1]!=="")u.push("");u.push(as.indentComment($(g),""))}}return u.join(`
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(`
58
57
  `)+`
59
- `}uI.stringifyDocument=_I});var hs=X((II)=>{var iI=js(),Ds=R_(),l=Y(),$I=e(),fI=x(),wI=Vu(),gI=hi(),lu=f_(),RI=uu(),LI=Js(),nu=_u();class Cu{constructor(s,_,u){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,l.NODE_TYPE,{value:l.DOC});let T=null;if(typeof _==="function"||Array.isArray(_))T=_;else if(u===void 0&&_)u=_,_=void 0;let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},u);this.options=i;let{version:$}=i;if(u?._directives){if(this.directives=u._directives.atDocument(),this.directives.yaml.explicit)$=this.directives.yaml.version}else this.directives=new nu.Directives({version:$});this.setSchema($,u),this.contents=s===void 0?null:this.createNode(s,T,u)}clone(){let s=Object.create(Cu.prototype,{[l.NODE_TYPE]:{value:l.DOC}});if(s.commentBefore=this.commentBefore,s.comment=this.comment,s.errors=this.errors.slice(),s.warnings=this.warnings.slice(),s.options=Object.assign({},this.options),this.directives)s.directives=this.directives.clone();if(s.schema=this.schema.clone(),s.contents=l.isNode(this.contents)?this.contents.clone(s.schema):this.contents,this.range)s.range=this.range.slice();return s}add(s){if(Fs(this.contents))this.contents.add(s)}addIn(s,_){if(Fs(this.contents))this.contents.addIn(s,_)}createAlias(s,_){if(!s.anchor){let u=lu.anchorNames(this);s.anchor=!_||u.has(_)?lu.findNewAnchor(_||"a",u):_}return new iI.Alias(s.anchor)}createNode(s,_,u){let T=void 0;if(typeof _==="function")s=_.call({"":s},"",s),T=_;else if(Array.isArray(_)){let S=(E)=>typeof E==="number"||E instanceof String||E instanceof Number,N=_.filter(S).map(String);if(N.length>0)_=_.concat(N);T=_}else if(u===void 0&&_)u=_,_=void 0;let{aliasDuplicateObjects:i,anchorPrefix:$,flow:f,keepUndefined:w,onTagObj:g,tag:R}=u??{},{onAnchor:O,setAnchors:L,sourceObjects:I}=lu.createNodeAnchors(this,$||"a"),U={aliasDuplicateObjects:i??!0,keepUndefined:w??!1,onAnchor:O,onTagObj:g,replacer:T,schema:this.schema,sourceObjects:I},r=LI.createNode(s,R,U);if(f&&l.isCollection(r))r.flow=!0;return L(),r}createPair(s,_,u={}){let T=this.createNode(s,null,u),i=this.createNode(_,null,u);return new $I.Pair(T,i)}delete(s){return Fs(this.contents)?this.contents.delete(s):!1}deleteIn(s){if(Ds.isEmptyPath(s)){if(this.contents==null)return!1;return this.contents=null,!0}return Fs(this.contents)?this.contents.deleteIn(s):!1}get(s,_){return l.isCollection(this.contents)?this.contents.get(s,_):void 0}getIn(s,_){if(Ds.isEmptyPath(s))return!_&&l.isScalar(this.contents)?this.contents.value:this.contents;return l.isCollection(this.contents)?this.contents.getIn(s,_):void 0}has(s){return l.isCollection(this.contents)?this.contents.has(s):!1}hasIn(s){if(Ds.isEmptyPath(s))return this.contents!==void 0;return l.isCollection(this.contents)?this.contents.hasIn(s):!1}set(s,_){if(this.contents==null)this.contents=Ds.collectionFromPath(this.schema,[s],_);else if(Fs(this.contents))this.contents.set(s,_)}setIn(s,_){if(Ds.isEmptyPath(s))this.contents=_;else if(this.contents==null)this.contents=Ds.collectionFromPath(this.schema,Array.from(s),_);else if(Fs(this.contents))this.contents.setIn(s,_)}setSchema(s,_={}){if(typeof s==="number")s=String(s);let u;switch(s){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new nu.Directives({version:"1.1"});u={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=s;else this.directives=new nu.Directives({version:s});u={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;u=null;break;default:{let T=JSON.stringify(s);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${T}`)}}if(_.schema instanceof Object)this.schema=_.schema;else if(u)this.schema=new wI.Schema(Object.assign(u,_));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:s,jsonArg:_,mapAsMap:u,maxAliasCount:T,onAnchor:i,reviver:$}={}){let f={anchors:new Map,doc:this,keep:!s,mapAsMap:u===!0,mapKeyWarned:!1,maxAliasCount:typeof T==="number"?T:100},w=fI.toJS(this.contents,_??"",f);if(typeof i==="function")for(let{count:g,res:R}of f.anchors.values())i(R,g);return typeof $==="function"?RI.applyReviver($,{"":w},"",w):w}toJSON(s,_){return this.toJS({json:!0,jsonArg:s,mapAsMap:!1,onAnchor:_})}toString(s={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in s&&(!Number.isInteger(s.indent)||Number(s.indent)<=0)){let _=JSON.stringify(s.indent);throw Error(`"indent" option must be a positive integer, not ${_}`)}return gI.stringifyDocument(this,s)}}function Fs(s){if(l.isCollection(s))return!0;throw Error("Expected a YAML collection as document contents")}II.Document=Cu});var ps=X((UI)=>{class b_ extends Error{constructor(s,_,u,T){super();this.name=s,this.code=u,this.message=T,this.pos=_}}class pi extends b_{constructor(s,_,u){super("YAMLParseError",s,_,u)}}class ci extends b_{constructor(s,_,u){super("YAMLWarning",s,_,u)}}var OI=(s,_)=>(u)=>{if(u.pos[0]===-1)return;u.linePos=u.pos.map((w)=>_.linePos(w));let{line:T,col:i}=u.linePos[0];u.message+=` at line ${T}, column ${i}`;let $=i-1,f=s.substring(_.lineStarts[T-1],_.lineStarts[T]).replace(/[\n\r]+$/,"");if($>=60&&f.length>80){let w=Math.min($-39,f.length-79);f="\u2026"+f.substring(w),$-=w-1}if(f.length>80)f=f.substring(0,79)+"\u2026";if(T>1&&/^ *$/.test(f.substring(0,$))){let w=s.substring(_.lineStarts[T-2],_.lineStarts[T-1]);if(w.length>80)w=w.substring(0,79)+`\u2026
60
- `;f=w+f}if(/[^ ]/.test(f)){let w=1,g=u.linePos[1];if(g?.line===T&&g.col>i)w=Math.max(1,Math.min(g.col-i,80-$));let R=" ".repeat($)+"^".repeat(w);u.message+=`:
61
-
62
- ${f}
63
- ${R}
64
- `}};UI.YAMLError=b_;UI.YAMLParseError=pi;UI.YAMLWarning=ci;UI.prettifyError=OI});var cs=X((AI)=>{function qI(s,{flow:_,indicator:u,next:T,offset:i,onError:$,parentIndent:f,startOnNewline:w}){let g=!1,R=w,O=w,L="",I="",U=!1,r=!1,S=null,N=null,E=null,A=null,P=null,D=null,F=null;for(let q of s){if(r){if(q.type!=="space"&&q.type!=="newline"&&q.type!=="comma")$(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");r=!1}if(S){if(R&&q.type!=="comment"&&q.type!=="newline")$(S,"TAB_AS_INDENT","Tabs are not allowed as indentation");S=null}switch(q.type){case"space":if(!_&&(u!=="doc-start"||T?.type!=="flow-collection")&&q.source.includes("\t"))S=q;O=!0;break;case"comment":{if(!O)$(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=q.source.substring(1)||" ";if(!L)L=G;else L+=I+G;I="",R=!1;break}case"newline":if(R){if(L)L+=q.source;else if(!D||u!=="seq-item-ind")g=!0}else I+=q.source;if(R=!0,U=!0,N||E)A=q;O=!0;break;case"anchor":if(N)$(q,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(q.source.endsWith(":"))$(q.offset+q.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=q,F??(F=q.offset),R=!1,O=!1,r=!0;break;case"tag":{if(E)$(q,"MULTIPLE_TAGS","A node can have at most one tag");E=q,F??(F=q.offset),R=!1,O=!1,r=!0;break}case u:if(N||E)$(q,"BAD_PROP_ORDER",`Anchors and tags must be after the ${q.source} indicator`);if(D)$(q,"UNEXPECTED_TOKEN",`Unexpected ${q.source} in ${_??"collection"}`);D=q,R=u==="seq-item-ind"||u==="explicit-key-ind",O=!1;break;case"comma":if(_){if(P)$(q,"UNEXPECTED_TOKEN",`Unexpected , in ${_}`);P=q,R=!1,O=!1;break}default:$(q,"UNEXPECTED_TOKEN",`Unexpected ${q.type} token`),R=!1,O=!1}}let H=s[s.length-1],B=H?H.offset+H.source.length:i;if(r&&T&&T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&(T.type!=="scalar"||T.source!==""))$(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(S&&(R&&S.indent<=f||T?.type==="block-map"||T?.type==="block-seq"))$(S,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:P,found:D,spaceBefore:g,comment:L,hasNewline:U,anchor:N,tag:E,newlineAfterProp:A,end:B,start:F??B}}AI.resolveProps=qI});var l_=X((DI)=>{function du(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
65
- `))return!0;if(s.end){for(let _ of s.end)if(_.type==="newline")return!0}return!1;case"flow-collection":for(let _ of s.items){for(let u of _.start)if(u.type==="newline")return!0;if(_.sep){for(let u of _.sep)if(u.type==="newline")return!0}if(du(_.key)||du(_.value))return!0}return!1;default:return!0}}DI.containsNewline=du});var Ku=X((BI)=>{var HI=l_();function YI(s,_,u){if(_?.type==="flow-collection"){let T=_.end[0];if(T.indent===s&&(T.source==="]"||T.source==="}")&&HI.containsNewline(_))u(T,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}BI.flowIndentCheck=YI});var yu=X((WI)=>{var mi=Y();function GI(s,_,u){let{uniqueKeys:T}=s.options;if(T===!1)return!1;let i=typeof T==="function"?T:($,f)=>$===f||mi.isScalar($)&&mi.isScalar(f)&&$.value===f.value;return _.some(($)=>i($.key,u))}WI.mapIncludes=GI});var ei=X((VI)=>{var ki=e(),JI=ss(),xi=cs(),ZI=l_(),ti=Ku(),MI=yu(),vi="All mapping items must start at the same column";function QI({composeNode:s,composeEmptyNode:_},u,T,i,$){let w=new($?.nodeClass??JI.YAMLMap)(u.schema);if(u.atRoot)u.atRoot=!1;let g=T.offset,R=null;for(let O of T.items){let{start:L,key:I,sep:U,value:r}=O,S=xi.resolveProps(L,{indicator:"explicit-key-ind",next:I??U?.[0],offset:g,onError:i,parentIndent:T.indent,startOnNewline:!0}),N=!S.found;if(N){if(I){if(I.type==="block-seq")i(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in I&&I.indent!==T.indent)i(g,"BAD_INDENT",vi)}if(!S.anchor&&!S.tag&&!U){if(R=S.end,S.comment)if(w.comment)w.comment+=`
66
- `+S.comment;else w.comment=S.comment;continue}if(S.newlineAfterProp||ZI.containsNewline(I))i(I??L[L.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(S.found?.indent!==T.indent)i(g,"BAD_INDENT",vi);u.atKey=!0;let E=S.end,A=I?s(u,I,S,i):_(u,E,L,null,S,i);if(u.schema.compat)ti.flowIndentCheck(T.indent,I,i);if(u.atKey=!1,MI.mapIncludes(u,w.items,A))i(E,"DUPLICATE_KEY","Map keys must be unique");let P=xi.resolveProps(U??[],{indicator:"map-value-ind",next:r,offset:A.range[2],onError:i,parentIndent:T.indent,startOnNewline:!I||I.type==="block-scalar"});if(g=P.end,P.found){if(N){if(r?.type==="block-map"&&!P.hasNewline)i(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(u.options.strict&&S.start<P.found.offset-1024)i(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let D=r?s(u,r,P,i):_(u,g,U,null,P,i);if(u.schema.compat)ti.flowIndentCheck(T.indent,r,i);g=D.range[2];let F=new ki.Pair(A,D);if(u.options.keepSourceTokens)F.srcToken=O;w.items.push(F)}else{if(N)i(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(P.comment)if(A.comment)A.comment+=`
67
- `+P.comment;else A.comment=P.comment;let D=new ki.Pair(A);if(u.options.keepSourceTokens)D.srcToken=O;w.items.push(D)}}if(R&&R<g)i(R,"IMPOSSIBLE","Map comment with trailing content");return w.range=[T.offset,g,R??g],w}VI.resolveBlockMap=QI});var oi=X((KI)=>{var lI=_s(),nI=cs(),CI=Ku();function dI({composeNode:s,composeEmptyNode:_},u,T,i,$){let w=new($?.nodeClass??lI.YAMLSeq)(u.schema);if(u.atRoot)u.atRoot=!1;if(u.atKey)u.atKey=!1;let g=T.offset,R=null;for(let{start:O,value:L}of T.items){let I=nI.resolveProps(O,{indicator:"seq-item-ind",next:L,offset:g,onError:i,parentIndent:T.indent,startOnNewline:!0});if(!I.found)if(I.anchor||I.tag||L)if(L?.type==="block-seq")i(I.end,"BAD_INDENT","All sequence items must start at the same column");else i(g,"MISSING_CHAR","Sequence item without - indicator");else{if(R=I.end,I.comment)w.comment=I.comment;continue}let U=L?s(u,L,I,i):_(u,I.end,O,null,I,i);if(u.schema.compat)CI.flowIndentCheck(T.indent,L,i);g=U.range[2],w.items.push(U)}return w.range=[T.offset,g,R??g],w}KI.resolveBlockSeq=dI});var Hs=X((hI)=>{function aI(s,_,u,T){let i="";if(s){let $=!1,f="";for(let w of s){let{source:g,type:R}=w;switch(R){case"space":$=!0;break;case"comment":{if(u&&!$)T(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=g.substring(1)||" ";if(!i)i=O;else i+=f+O;f="";break}case"newline":if(i)f+=g;$=!0;break;default:T(w,"UNEXPECTED_TOKEN",`Unexpected ${R} at node end`)}_+=g.length}}return{comment:i,offset:_}}hI.resolveEnd=aI});var u$=X((oI)=>{var cI=Y(),mI=e(),s$=ss(),kI=_s(),xI=Hs(),_$=cs(),tI=l_(),vI=yu(),au="Block collections are not allowed within flow collections",hu=(s)=>s&&(s.type==="block-map"||s.type==="block-seq");function eI({composeNode:s,composeEmptyNode:_},u,T,i,$){let f=T.start.source==="{",w=f?"flow map":"flow sequence",R=new($?.nodeClass??(f?s$.YAMLMap:kI.YAMLSeq))(u.schema);R.flow=!0;let O=u.atRoot;if(O)u.atRoot=!1;if(u.atKey)u.atKey=!1;let L=T.offset+T.start.source.length;for(let N=0;N<T.items.length;++N){let E=T.items[N],{start:A,key:P,sep:D,value:F}=E,H=_$.resolveProps(A,{flow:w,indicator:"explicit-key-ind",next:P??D?.[0],offset:L,onError:i,parentIndent:T.indent,startOnNewline:!1});if(!H.found){if(!H.anchor&&!H.tag&&!D&&!F){if(N===0&&H.comma)i(H.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${w}`);else if(N<T.items.length-1)i(H.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${w}`);if(H.comment)if(R.comment)R.comment+=`
68
- `+H.comment;else R.comment=H.comment;L=H.end;continue}if(!f&&u.options.strict&&tI.containsNewline(P))i(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(H.comma)i(H.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${w}`)}else{if(!H.comma)i(H.start,"MISSING_CHAR",`Missing , between ${w} items`);if(H.comment){let B="";s:for(let q of A)switch(q.type){case"comma":case"space":break;case"comment":B=q.source.substring(1);break s;default:break s}if(B){let q=R.items[R.items.length-1];if(cI.isPair(q))q=q.value??q.key;if(q.comment)q.comment+=`
69
- `+B;else q.comment=B;H.comment=H.comment.substring(B.length+1)}}}if(!f&&!D&&!H.found){let B=F?s(u,F,H,i):_(u,H.end,D,null,H,i);if(R.items.push(B),L=B.range[2],hu(F))i(B.range,"BLOCK_IN_FLOW",au)}else{u.atKey=!0;let B=H.end,q=P?s(u,P,H,i):_(u,B,A,null,H,i);if(hu(P))i(q.range,"BLOCK_IN_FLOW",au);u.atKey=!1;let G=_$.resolveProps(D??[],{flow:w,indicator:"map-value-ind",next:F,offset:q.range[2],onError:i,parentIndent:T.indent,startOnNewline:!1});if(G.found){if(!f&&!H.found&&u.options.strict){if(D)for(let W of D){if(W===G.found)break;if(W.type==="newline"){i(W,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(H.start<G.found.offset-1024)i(G.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(F)if("source"in F&&F.source?.[0]===":")i(F,"MISSING_CHAR",`Missing space after : in ${w}`);else i(G.start,"MISSING_CHAR",`Missing , or : between ${w} items`);let k=F?s(u,F,G,i):G.found?_(u,G.end,D,null,G,i):null;if(k){if(hu(F))i(k.range,"BLOCK_IN_FLOW",au)}else if(G.comment)if(q.comment)q.comment+=`
70
- `+G.comment;else q.comment=G.comment;let Us=new mI.Pair(q,k);if(u.options.keepSourceTokens)Us.srcToken=E;if(f){let W=R;if(vI.mapIncludes(u,W.items,q))i(B,"DUPLICATE_KEY","Map keys must be unique");W.items.push(Us)}else{let W=new s$.YAMLMap(u.schema);W.flow=!0,W.items.push(Us);let zT=(k??q).range;W.range=[q.range[0],zT[1],zT[2]],R.items.push(W)}L=k?k.range[2]:G.end}}let I=f?"}":"]",[U,...r]=T.end,S=L;if(U?.source===I)S=U.offset+U.source.length;else{let N=w[0].toUpperCase()+w.substring(1),E=O?`${N} must end with a ${I}`:`${N} in block collection must be sufficiently indented and end with a ${I}`;if(i(L,O?"MISSING_CHAR":"BAD_INDENT",E),U&&U.source.length!==1)r.unshift(U)}if(r.length>0){let N=xI.resolveEnd(r,S,u.options.strict,i);if(N.comment)if(R.comment)R.comment+=`
71
- `+N.comment;else R.comment=N.comment;R.range=[T.offset,S,N.offset]}else R.range=[T.offset,S,S];return R}oI.resolveFlowCollection=eI});var T$=X((RS)=>{var _S=Y(),uS=z(),TS=ss(),iS=_s(),$S=ei(),fS=oi(),wS=u$();function pu(s,_,u,T,i,$){let f=u.type==="block-map"?$S.resolveBlockMap(s,_,u,T,$):u.type==="block-seq"?fS.resolveBlockSeq(s,_,u,T,$):wS.resolveFlowCollection(s,_,u,T,$),w=f.constructor;if(i==="!"||i===w.tagName)return f.tag=w.tagName,f;if(i)f.tag=i;return f}function gS(s,_,u,T,i){let $=T.tag,f=!$?null:_.directives.tagName($.source,(I)=>i($,"TAG_RESOLVE_FAILED",I));if(u.type==="block-seq"){let{anchor:I,newlineAfterProp:U}=T,r=I&&$?I.offset>$.offset?I:$:I??$;if(r&&(!U||U.offset<r.offset))i(r,"MISSING_CHAR","Missing newline after block sequence props")}let w=u.type==="block-map"?"map":u.type==="block-seq"?"seq":u.start.source==="{"?"map":"seq";if(!$||!f||f==="!"||f===TS.YAMLMap.tagName&&w==="map"||f===iS.YAMLSeq.tagName&&w==="seq")return pu(s,_,u,i,f);let g=_.schema.tags.find((I)=>I.tag===f&&I.collection===w);if(!g){let I=_.schema.knownTags[f];if(I?.collection===w)_.schema.tags.push(Object.assign({},I,{default:!1})),g=I;else{if(I)i($,"BAD_COLLECTION_TYPE",`${I.tag} used for ${w} collection, but expects ${I.collection??"scalar"}`,!0);else i($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0);return pu(s,_,u,i,f)}}let R=pu(s,_,u,i,f,g),O=g.resolve?.(R,(I)=>i($,"TAG_RESOLVE_FAILED",I),_.options)??R,L=_S.isNode(O)?O:new uS.Scalar(O);if(L.range=R.range,L.tag=f,g?.format)L.format=g.format;return L}RS.composeCollection=gS});var mu=X((US)=>{var cu=z();function IS(s,_,u){let T=_.offset,i=SS(_,s.options.strict,u);if(!i)return{value:"",type:null,comment:"",range:[T,T,T]};let $=i.mode===">"?cu.Scalar.BLOCK_FOLDED:cu.Scalar.BLOCK_LITERAL,f=_.source?OS(_.source):[],w=f.length;for(let S=f.length-1;S>=0;--S){let N=f[S][1];if(N===""||N==="\r")w=S;else break}if(w===0){let S=i.chomp==="+"&&f.length>0?`
72
- `.repeat(Math.max(1,f.length-1)):"",N=T+i.length;if(_.source)N+=_.source.length;return{value:S,type:$,comment:i.comment,range:[T,N,N]}}let g=_.indent+i.indent,R=_.offset+i.length,O=0;for(let S=0;S<w;++S){let[N,E]=f[S];if(E===""||E==="\r"){if(i.indent===0&&N.length>g)g=N.length}else{if(N.length<g)u(R+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)g=N.length;if(O=S,g===0&&!s.atRoot)u(R,"BAD_INDENT","Block scalar values in collections must be indented");break}R+=N.length+E.length+1}for(let S=f.length-1;S>=w;--S)if(f[S][0].length>g)w=S+1;let L="",I="",U=!1;for(let S=0;S<O;++S)L+=f[S][0].slice(g)+`
73
- `;for(let S=O;S<w;++S){let[N,E]=f[S];R+=N.length+E.length+1;let A=E[E.length-1]==="\r";if(A)E=E.slice(0,-1);if(E&&N.length<g){let D=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;u(R-E.length-(A?2:1),"BAD_INDENT",D),N=""}if($===cu.Scalar.BLOCK_LITERAL)L+=I+N.slice(g)+E,I=`
74
- `;else if(N.length>g||E[0]==="\t"){if(I===" ")I=`
75
- `;else if(!U&&I===`
76
- `)I=`
77
-
78
- `;L+=I+N.slice(g)+E,I=`
79
- `,U=!0}else if(E==="")if(I===`
80
- `)L+=`
81
- `;else I=`
82
- `;else L+=I+E,I=" ",U=!1}switch(i.chomp){case"-":break;case"+":for(let S=w;S<f.length;++S)L+=`
83
- `+f[S][0].slice(g);if(L[L.length-1]!==`
84
- `)L+=`
85
- `;break;default:L+=`
86
- `}let r=T+i.length+_.source.length;return{value:L,type:$,comment:i.comment,range:[T,r,r]}}function SS({offset:s,props:_},u,T){if(_[0].type!=="block-scalar-header")return T(_[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=_[0],$=i[0],f=0,w="",g=-1;for(let I=1;I<i.length;++I){let U=i[I];if(!w&&(U==="-"||U==="+"))w=U;else{let r=Number(U);if(!f&&r)f=r;else if(g===-1)g=s+I}}if(g!==-1)T(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let R=!1,O="",L=i.length;for(let I=1;I<_.length;++I){let U=_[I];switch(U.type){case"space":R=!0;case"newline":L+=U.source.length;break;case"comment":if(u&&!R)T(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");L+=U.source.length,O=U.source.substring(1);break;case"error":T(U,"UNEXPECTED_TOKEN",U.message),L+=U.source.length;break;default:{let r=`Unexpected token in block scalar header: ${U.type}`;T(U,"UNEXPECTED_TOKEN",r);let S=U.source;if(S&&typeof S==="string")L+=S.length}}}return{mode:$,indent:f,chomp:w,comment:O,length:L}}function OS(s){let _=s.split(/\n( *)/),u=_[0],T=u.match(/^( *)/),$=[T?.[1]?[T[1],u.slice(T[1].length)]:["",u]];for(let f=1;f<_.length;f+=2)$.push([_[f],_[f+1]]);return $}US.resolveBlockScalar=IS});var xu=X((HS)=>{var ku=z(),rS=Hs();function XS(s,_,u){let{offset:T,type:i,source:$,end:f}=s,w,g,R=(I,U,r)=>u(T+I,U,r);switch(i){case"scalar":w=ku.Scalar.PLAIN,g=ES($,R);break;case"single-quoted-scalar":w=ku.Scalar.QUOTE_SINGLE,g=qS($,R);break;case"double-quoted-scalar":w=ku.Scalar.QUOTE_DOUBLE,g=AS($,R);break;default:return u(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[T,T+$.length,T+$.length]}}let O=T+$.length,L=rS.resolveEnd(f,O,_,u);return{value:g,type:w,comment:L.comment,range:[T,O,L.offset]}}function ES(s,_){let u="";switch(s[0]){case"\t":u="a tab character";break;case",":u="flow indicator character ,";break;case"%":u="directive indicator character %";break;case"|":case">":{u=`block scalar indicator ${s[0]}`;break}case"@":case"`":{u=`reserved character ${s[0]}`;break}}if(u)_(0,"BAD_SCALAR_START",`Plain value cannot start with ${u}`);return i$(s)}function qS(s,_){if(s[s.length-1]!=="'"||s.length===1)_(s.length,"MISSING_CHAR","Missing closing 'quote");return i$(s.slice(1,-1)).replace(/''/g,"'")}function i$(s){let _,u;try{_=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
- `,"sy"),u=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
88
- `,"sy")}catch{_=/(.*?)[ \t]*\r?\n/sy,u=/[ \t]*(.*?)[ \t]*\r?\n/sy}let T=_.exec(s);if(!T)return s;let i=T[1],$=" ",f=_.lastIndex;u.lastIndex=f;while(T=u.exec(s)){if(T[1]==="")if($===`
89
- `)i+=$;else $=`
90
- `;else i+=$+T[1],$=" ";f=u.lastIndex}let w=/[ \t]*(.*)/sy;return w.lastIndex=f,T=w.exec(s),i+$+(T?.[1]??"")}function AS(s,_){let u="";for(let T=1;T<s.length-1;++T){let i=s[T];if(i==="\r"&&s[T+1]===`
91
- `)continue;if(i===`
92
- `){let{fold:$,offset:f}=PS(s,T);u+=$,T=f}else if(i==="\\"){let $=s[++T],f=DS[$];if(f)u+=f;else if($===`
93
- `){$=s[T+1];while($===" "||$==="\t")$=s[++T+1]}else if($==="\r"&&s[T+1]===`
94
- `){$=s[++T+1];while($===" "||$==="\t")$=s[++T+1]}else if($==="x"||$==="u"||$==="U"){let w=$==="x"?2:$==="u"?4:8;u+=FS(s,T+1,w,_),T+=w}else{let w=s.substr(T-1,2);_(T-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${w}`),u+=w}}else if(i===" "||i==="\t"){let $=T,f=s[T+1];while(f===" "||f==="\t")f=s[++T+1];if(f!==`
95
- `&&!(f==="\r"&&s[T+2]===`
96
- `))u+=T>$?s.slice($,T+1):i}else u+=i}if(s[s.length-1]!=='"'||s.length===1)_(s.length,"MISSING_CHAR",'Missing closing "quote');return u}function PS(s,_){let u="",T=s[_+1];while(T===" "||T==="\t"||T===`
97
- `||T==="\r"){if(T==="\r"&&s[_+2]!==`
98
- `)break;if(T===`
99
- `)u+=`
100
- `;_+=1,T=s[_+1]}if(!u)u=" ";return{fold:u,offset:_}}var DS={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
101
- `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function FS(s,_,u,T){let i=s.substr(_,u),f=i.length===u&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(f)}catch{let w=s.substr(_-2,u+2);return T(_-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${w}`),w}}HS.resolveFlowScalar=XS});var f$=X((JS)=>{var Is=Y(),$$=z(),BS=mu(),zS=xu();function GS(s,_,u,T){let{value:i,type:$,comment:f,range:w}=_.type==="block-scalar"?BS.resolveBlockScalar(s,_,T):zS.resolveFlowScalar(_,s.options.strict,T),g=u?s.directives.tagName(u.source,(L)=>T(u,"TAG_RESOLVE_FAILED",L)):null,R;if(s.options.stringKeys&&s.atKey)R=s.schema[Is.SCALAR];else if(g)R=WS(s.schema,i,g,u,T);else if(_.type==="scalar")R=jS(s,i,_,T);else R=s.schema[Is.SCALAR];let O;try{let L=R.resolve(i,(I)=>T(u??_,"TAG_RESOLVE_FAILED",I),s.options);O=Is.isScalar(L)?L:new $$.Scalar(L)}catch(L){let I=L instanceof Error?L.message:String(L);T(u??_,"TAG_RESOLVE_FAILED",I),O=new $$.Scalar(i)}if(O.range=w,O.source=i,$)O.type=$;if(g)O.tag=g;if(R.format)O.format=R.format;if(f)O.comment=f;return O}function WS(s,_,u,T,i){if(u==="!")return s[Is.SCALAR];let $=[];for(let w of s.tags)if(!w.collection&&w.tag===u)if(w.default&&w.test)$.push(w);else return w;for(let w of $)if(w.test?.test(_))return w;let f=s.knownTags[u];if(f&&!f.collection)return s.tags.push(Object.assign({},f,{default:!1,test:void 0})),f;return i(T,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,u!=="tag:yaml.org,2002:str"),s[Is.SCALAR]}function jS({atKey:s,directives:_,schema:u},T,i,$){let f=u.tags.find((w)=>(w.default===!0||s&&w.default==="key")&&w.test?.test(T))||u[Is.SCALAR];if(u.compat){let w=u.compat.find((g)=>g.default&&g.test?.test(T))??u[Is.SCALAR];if(f.tag!==w.tag){let g=_.tagString(f.tag),R=_.tagString(w.tag),O=`Value may be parsed as either ${g} or ${R}`;$(i,"TAG_RESOLVE_FAILED",O,!0)}}return f}JS.composeScalar=GS});var w$=X((QS)=>{function MS(s,_,u){if(_){u??(u=_.length);for(let T=u-1;T>=0;--T){let i=_[T];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}i=_[++T];while(i?.type==="space")s+=i.source.length,i=_[++T];break}}return s}QS.emptyScalarPosition=MS});var L$=X((aS)=>{var bS=js(),lS=Y(),nS=T$(),g$=f$(),CS=Hs(),dS=w$(),KS={composeNode:R$,composeEmptyNode:tu};function R$(s,_,u,T){let i=s.atKey,{spaceBefore:$,comment:f,anchor:w,tag:g}=u,R,O=!0;switch(_.type){case"alias":if(R=yS(s,_,T),w||g)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(R=g$.composeScalar(s,_,g,T),w)R.anchor=w.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(R=nS.composeCollection(KS,s,_,u,T),w)R.anchor=w.source.substring(1)}catch(L){let I=L instanceof Error?L.message:String(L);T(_,"RESOURCE_EXHAUSTION",I)}break;default:{let L=_.type==="error"?_.message:`Unsupported token (type: ${_.type})`;T(_,"UNEXPECTED_TOKEN",L),O=!1}}if(R??(R=tu(s,_.offset,void 0,null,u,T)),w&&R.anchor==="")T(w,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&s.options.stringKeys&&(!lS.isScalar(R)||typeof R.value!=="string"||R.tag&&R.tag!=="tag:yaml.org,2002:str"))T(g??_,"NON_STRING_KEY","With stringKeys, all keys must be strings");if($)R.spaceBefore=!0;if(f)if(_.type==="scalar"&&_.source==="")R.comment=f;else R.commentBefore=f;if(s.options.keepSourceTokens&&O)R.srcToken=_;return R}function tu(s,_,u,T,{spaceBefore:i,comment:$,anchor:f,tag:w,end:g},R){let O={type:"scalar",offset:dS.emptyScalarPosition(_,u,T),indent:-1,source:""},L=g$.composeScalar(s,O,w,R);if(f){if(L.anchor=f.source.substring(1),L.anchor==="")R(f,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)L.spaceBefore=!0;if($)L.comment=$,L.range[2]=g;return L}function yS({options:s},{offset:_,source:u,end:T},i){let $=new bS.Alias(u.substring(1));if($.source==="")i(_,"BAD_ALIAS","Alias cannot be an empty string");if($.source.endsWith(":"))i(_+u.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let f=_+u.length,w=CS.resolveEnd(T,f,s.strict,i);if($.range=[_,f,w.offset],w.comment)$.comment=w.comment;return $}aS.composeEmptyNode=tu;aS.composeNode=R$});var S$=X((tS)=>{var cS=hs(),I$=L$(),mS=Hs(),kS=cs();function xS(s,_,{offset:u,start:T,value:i,end:$},f){let w=Object.assign({_directives:_},s),g=new cS.Document(void 0,w),R={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},O=kS.resolveProps(T,{indicator:"doc-start",next:i??$?.[0],offset:u,onError:f,parentIndent:0,startOnNewline:!0});if(O.found){if(g.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!O.hasNewline)f(O.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}g.contents=i?I$.composeNode(R,i,O,f):I$.composeEmptyNode(R,O.end,T,null,O,f);let L=g.contents.range[2],I=mS.resolveEnd($,L,!1,f);if(I.comment)g.comment=I.comment;return g.range=[u,L,I.offset],g}tS.composeDoc=xS});var vu=X((TO)=>{var eS=__("process"),oS=_u(),sO=hs(),ms=ps(),O$=Y(),_O=S$(),uO=Hs();function ks(s){if(typeof s==="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:_,source:u}=s;return[_,_+(typeof u==="string"?u.length:1)]}function U$(s){let _="",u=!1,T=!1;for(let i=0;i<s.length;++i){let $=s[i];switch($[0]){case"#":_+=(_===""?"":T?`
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"#":_+=(_===""?"":$?`
102
101
 
103
102
  `:`
104
- `)+($.substring(1)||" "),u=!0,T=!1;break;case"%":if(s[i+1]?.[0]!=="#")i+=1;u=!1;break;default:if(!u)T=!0;u=!1}}return{comment:_,afterEmptyLine:T}}class N${constructor(s={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(_,u,T,i)=>{let $=ks(_);if(i)this.warnings.push(new ms.YAMLWarning($,u,T));else this.errors.push(new ms.YAMLParseError($,u,T))},this.directives=new oS.Directives({version:s.version||"1.2"}),this.options=s}decorate(s,_){let{comment:u,afterEmptyLine:T}=U$(this.prelude);if(u){let i=s.contents;if(_)s.comment=s.comment?`${s.comment}
105
- ${u}`:u;else if(T||s.directives.docStart||!i)s.commentBefore=u;else if(O$.isCollection(i)&&!i.flow&&i.items.length>0){let $=i.items[0];if(O$.isPair($))$=$.key;let f=$.commentBefore;$.commentBefore=f?`${u}
106
- ${f}`:u}else{let $=i.commentBefore;i.commentBefore=$?`${u}
107
- ${$}`:u}}if(_){for(let i=0;i<this.errors.length;++i)s.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)s.warnings.push(this.warnings[i])}else s.errors=this.errors,s.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:U$(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(s,_=!1,u=-1){for(let T of s)yield*this.next(T);yield*this.end(_,u)}*next(s){if(eS.env.LOG_STREAM)console.dir(s,{depth:null});switch(s.type){case"directive":this.directives.add(s.source,(_,u,T)=>{let i=ks(s);i[0]+=_,this.onError(i,"BAD_DIRECTIVE",u,T)}),this.prelude.push(s.source),this.atDirectives=!0;break;case"document":{let _=_O.composeDoc(this.options,this.directives,s,this.onError);if(this.atDirectives&&!_.directives.docStart)this.onError(s,"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(s.source);break;case"error":{let _=s.source?`${s.message}: ${JSON.stringify(s.source)}`:s.message,u=new ms.YAMLParseError(ks(s),"UNEXPECTED_TOKEN",_);if(this.atDirectives||!this.doc)this.errors.push(u);else this.doc.errors.push(u);break}case"doc-end":{if(!this.doc){this.errors.push(new ms.YAMLParseError(ks(s),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let _=uO.resolveEnd(s.end,s.offset+s.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),_.comment){let u=this.doc.comment;this.doc.comment=u?`${u}
108
- ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.push(new ms.YAMLParseError(ks(s),"UNEXPECTED_TOKEN",`Unsupported token ${s.type}`))}}*end(s=!1,_=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(s){let u=Object.assign({_directives:this.directives},this.options),T=new sO.Document(void 0,u);if(this.atDirectives)this.onError(_,"MISSING_CHAR","Missing directives-end indicator line");T.range=[0,_,_],this.decorate(T,!1),yield T}}}TO.Composer=N$});var E$=X((SO)=>{var $O=mu(),fO=xu(),wO=ps(),r$=Qs();function gO(s,_=!0,u){if(s){let T=(i,$,f)=>{let w=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(u)u(w,$,f);else throw new wO.YAMLParseError([w,w+1],$,f)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fO.resolveFlowScalar(s,_,T);case"block-scalar":return $O.resolveBlockScalar({options:{strict:_}},s,T)}}return null}function RO(s,_){let{implicitKey:u=!1,indent:T,inFlow:i=!1,offset:$=-1,type:f="PLAIN"}=_,w=r$.stringifyString({type:f,value:s},{implicitKey:u,indent:T>0?" ".repeat(T):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),g=_.end??[{type:"newline",offset:-1,indent:T,source:`
109
- `}];switch(w[0]){case"|":case">":{let R=w.indexOf(`
110
- `),O=w.substring(0,R),L=w.substring(R+1)+`
111
- `,I=[{type:"block-scalar-header",offset:$,indent:T,source:O}];if(!X$(I,g))I.push({type:"newline",offset:-1,indent:T,source:`
112
- `});return{type:"block-scalar",offset:$,indent:T,props:I,source:L}}case'"':return{type:"double-quoted-scalar",offset:$,indent:T,source:w,end:g};case"'":return{type:"single-quoted-scalar",offset:$,indent:T,source:w,end:g};default:return{type:"scalar",offset:$,indent:T,source:w,end:g}}}function LO(s,_,u={}){let{afterKey:T=!1,implicitKey:i=!1,inFlow:$=!1,type:f}=u,w="indent"in s?s.indent:null;if(T&&typeof w==="number")w+=2;if(!f)switch(s.type){case"single-quoted-scalar":f="QUOTE_SINGLE";break;case"double-quoted-scalar":f="QUOTE_DOUBLE";break;case"block-scalar":{let R=s.props[0];if(R.type!=="block-scalar-header")throw Error("Invalid block scalar header");f=R.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:f="PLAIN"}let g=r$.stringifyString({type:f,value:_},{implicitKey:i||w===null,indent:w!==null&&w>0?" ".repeat(w):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}});switch(g[0]){case"|":case">":IO(s,g);break;case'"':eu(s,g,"double-quoted-scalar");break;case"'":eu(s,g,"single-quoted-scalar");break;default:eu(s,g,"scalar")}}function IO(s,_){let u=_.indexOf(`
113
- `),T=_.substring(0,u),i=_.substring(u+1)+`
114
- `;if(s.type==="block-scalar"){let $=s.props[0];if($.type!=="block-scalar-header")throw Error("Invalid block scalar header");$.source=T,s.source=i}else{let{offset:$}=s,f="indent"in s?s.indent:-1,w=[{type:"block-scalar-header",offset:$,indent:f,source:T}];if(!X$(w,"end"in s?s.end:void 0))w.push({type:"newline",offset:-1,indent:f,source:`
115
- `});for(let g of Object.keys(s))if(g!=="type"&&g!=="offset")delete s[g];Object.assign(s,{type:"block-scalar",indent:f,props:w,source:i})}}function X$(s,_){if(_)for(let u of _)switch(u.type){case"space":case"comment":s.push(u);break;case"newline":return s.push(u),!0}return!1}function eu(s,_,u){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=u,s.source=_;break;case"block-scalar":{let T=s.props.slice(1),i=_.length;if(s.props[0].type==="block-scalar-header")i-=s.props[0].source.length;for(let $ of T)$.offset+=i;delete s.props,Object.assign(s,{type:u,source:_,end:T});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+_.length,indent:s.indent,source:`
116
- `};delete s.items,Object.assign(s,{type:u,source:_,end:[i]});break}default:{let T="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(($)=>$.type==="space"||$.type==="comment"||$.type==="newline"):[];for(let $ of Object.keys(s))if($!=="type"&&$!=="offset")delete s[$];Object.assign(s,{type:u,indent:T,source:_,end:i})}}}SO.createScalarToken=RO;SO.resolveAsScalar=gO;SO.setScalarValue=LO});var q$=X((XO)=>{var rO=(s)=>("type"in s)?C_(s):n_(s);function C_(s){switch(s.type){case"block-scalar":{let _="";for(let u of s.props)_+=C_(u);return _+s.source}case"block-map":case"block-seq":{let _="";for(let u of s.items)_+=n_(u);return _}case"flow-collection":{let _=s.start.source;for(let u of s.items)_+=n_(u);for(let u of s.end)_+=u.source;return _}case"document":{let _=n_(s);if(s.end)for(let u of s.end)_+=u.source;return _}default:{let _=s.source;if("end"in s&&s.end)for(let u of s.end)_+=u.source;return _}}}function n_({start:s,key:_,sep:u,value:T}){let i="";for(let $ of s)i+=$.source;if(_)i+=C_(_);if(u)for(let $ of u)i+=$.source;if(T)i+=C_(T);return i}XO.stringify=rO});var D$=X((AO)=>{var ou=Symbol("break visit"),qO=Symbol("skip children"),A$=Symbol("remove item");function Ss(s,_){if("type"in s&&s.type==="document")s={start:s.start,value:s.value};P$(Object.freeze([]),s,_)}Ss.BREAK=ou;Ss.SKIP=qO;Ss.REMOVE=A$;Ss.itemAtPath=(s,_)=>{let u=s;for(let[T,i]of _){let $=u?.[T];if($&&"items"in $)u=$.items[i];else return}return u};Ss.parentCollection=(s,_)=>{let u=Ss.itemAtPath(s,_.slice(0,-1)),T=_[_.length-1][0],i=u?.[T];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function P$(s,_,u){let T=u(_,s);if(typeof T==="symbol")return T;for(let i of["key","value"]){let $=_[i];if($&&"items"in $){for(let f=0;f<$.items.length;++f){let w=P$(Object.freeze(s.concat([[i,f]])),$.items[f],u);if(typeof w==="number")f=w-1;else if(w===ou)return ou;else if(w===A$)$.items.splice(f,1),f-=1}if(typeof T==="function"&&i==="key")T=T(_,s)}}return typeof T==="function"?T(_,s):T}AO.visit=Ss});var d_=X((GO)=>{var sT=E$(),DO=q$(),FO=D$(),_T="\uFEFF",uT="\x02",TT="\x18",iT="\x1F",HO=(s)=>!!s&&("items"in s),YO=(s)=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function BO(s){switch(s){case _T:return"<BOM>";case uT:return"<DOC>";case TT:return"<FLOW_END>";case iT:return"<SCALAR>";default:return JSON.stringify(s)}}function zO(s){switch(s){case _T:return"byte-order-mark";case uT:return"doc-mode";case TT:return"flow-error-end";case iT:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
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`
117
116
  `:case`\r
118
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[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}GO.createScalarToken=sT.createScalarToken;GO.resolveAsScalar=sT.resolveAsScalar;GO.setScalarValue=sT.setScalarValue;GO.stringify=DO.stringify;GO.visit=FO.visit;GO.BOM=_T;GO.DOCUMENT=uT;GO.FLOW_END=TT;GO.SCALAR=iT;GO.isCollection=HO;GO.isScalar=YO;GO.prettyToken=BO;GO.tokenType=zO});var fT=X((hO)=>{var xs=d_();function d(s){switch(s){case void 0:case" ":case`
119
- `:case"\r":case"\t":return!0;default:return!1}}var F$=new Set("0123456789ABCDEFabcdef"),yO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),K_=new Set(",[]{}"),aO=new Set(` ,[]{}
120
- \r `),$T=(s)=>!s||aO.has(s);class H${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(s,_=!1){if(s){if(typeof s!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+s:s,this.lineEndPos=null}this.atEnd=!_;let u=this.next??"stream";while(u&&(_||this.hasChars(1)))u=yield*this.parseNext(u)}atLineEnd(){let s=this.pos,_=this.buffer[s];while(_===" "||_==="\t")_=this.buffer[++s];if(!_||_==="#"||_===`
121
- `)return!0;if(_==="\r")return this.buffer[s+1]===`
122
- `;return!1}charAt(s){return this.buffer[this.pos+s]}continueScalar(s){let _=this.buffer[s];if(this.indentNext>0){let u=0;while(_===" ")_=this.buffer[++u+s];if(_==="\r"){let T=this.buffer[u+s+1];if(T===`
123
- `||!T&&!this.atEnd)return s+u+1}return _===`
124
- `||u>=this.indentNext||!_&&!this.atEnd?s+u:-1}if(_==="-"||_==="."){let u=this.buffer.substr(s,3);if((u==="---"||u==="...")&&d(this.buffer[s+3]))return-1}return s}getLine(){let s=this.lineEndPos;if(typeof s!=="number"||s!==-1&&s<this.pos)s=this.buffer.indexOf(`
125
- `,this.pos),this.lineEndPos=s;if(s===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[s-1]==="\r")s-=1;return this.buffer.substring(this.pos,s)}hasChars(s){return this.pos+s<=this.buffer.length}setNext(s){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=s,null}peek(s){return this.buffer.substr(this.pos,s)}*parseNext(s){switch(s){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 s=this.getLine();if(s===null)return this.setNext("stream");if(s[0]===xs.BOM)yield*this.pushCount(1),s=s.substring(1);if(s[0]==="%"){let _=s.length,u=s.indexOf("#");while(u!==-1){let i=s[u-1];if(i===" "||i==="\t"){_=u-1;break}else u=s.indexOf("#",u+1)}while(!0){let i=s[_-1];if(i===" "||i==="\t")_-=1;else break}let T=(yield*this.pushCount(_))+(yield*this.pushSpaces(!0));return yield*this.pushCount(s.length-T),this.pushNewline(),"stream"}if(this.atLineEnd()){let _=yield*this.pushSpaces(!0);return yield*this.pushCount(s.length-_),yield*this.pushNewline(),"stream"}return yield xs.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let s=this.charAt(0);if(!s&&!this.atEnd)return this.setNext("line-start");if(s==="-"||s==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let _=this.peek(3);if((_==="---"||_==="...")&&d(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&&!d(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[s,_]=this.peek(2);if(!_&&!this.atEnd)return this.setNext("block-start");if((s==="-"||s==="?"||s===":")&&d(_)){let u=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=u,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let s=this.getLine();if(s===null)return this.setNext("doc");let _=yield*this.pushIndicators();switch(s[_]){case"#":yield*this.pushCount(s.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($T),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return _+=yield*this.parseBlockScalarHeader(),_+=yield*this.pushSpaces(!0),yield*this.pushCount(s.length-_),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let s,_,u=-1;do{if(s=yield*this.pushNewline(),s>0)_=yield*this.pushSpaces(!1),this.indentValue=u=_;else _=0;_+=yield*this.pushSpaces(!0)}while(s+_>0);let T=this.getLine();if(T===null)return this.setNext("flow");if(u!==-1&&u<this.indentNext&&T[0]!=="#"||u===0&&(T.startsWith("---")||T.startsWith("..."))&&d(T[3])){if(!(u===this.indentNext-1&&this.flowLevel===1&&(T[0]==="]"||T[0]==="}")))return this.flowLevel=0,yield xs.FLOW_END,yield*this.parseLineStart()}let i=0;while(T[i]===",")i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),T[i]){case void 0:return"flow";case"#":return yield*this.pushCount(T.length-i),"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($T),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let $=this.charAt(1);if(this.flowKey||d($)||$===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let s=this.charAt(0),_=this.buffer.indexOf(s,this.pos+1);if(s==="'")while(_!==-1&&this.buffer[_+1]==="'")_=this.buffer.indexOf("'",_+2);else while(_!==-1){let i=0;while(this.buffer[_-1-i]==="\\")i+=1;if(i%2===0)break;_=this.buffer.indexOf('"',_+1)}let u=this.buffer.substring(0,_),T=u.indexOf(`
126
- `,this.pos);if(T!==-1){while(T!==-1){let i=this.continueScalar(T+1);if(i===-1)break;T=u.indexOf(`
127
- `,i)}if(T!==-1)_=T-(u[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 s=this.pos;while(!0){let _=this.buffer[++s];if(_==="+")this.blockScalarKeep=!0;else if(_>"0"&&_<="9")this.blockScalarIndent=Number(_)-1;else if(_!=="-")break}return yield*this.pushUntil((_)=>d(_)||_==="#")}*parseBlockScalar(){let s=this.pos-1,_=0,u;s:for(let i=this.pos;u=this.buffer[i];++i)switch(u){case" ":_+=1;break;case`
128
- `:s=i,_=0;break;case"\r":{let $=this.buffer[i+1];if(!$&&!this.atEnd)return this.setNext("block-scalar");if($===`
129
- `)break}default:break s}if(!u&&!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 i=this.continueScalar(s+1);if(i===-1)break;s=this.buffer.indexOf(`
130
- `,i)}while(s!==-1);if(s===-1){if(!this.atEnd)return this.setNext("block-scalar");s=this.buffer.length}}let T=s+1;u=this.buffer[T];while(u===" ")u=this.buffer[++T];if(u==="\t"){while(u==="\t"||u===" "||u==="\r"||u===`
131
- `)u=this.buffer[++T];s=T-1}else if(!this.blockScalarKeep)do{let i=s-1,$=this.buffer[i];if($==="\r")$=this.buffer[--i];let f=i;while($===" ")$=this.buffer[--i];if($===`
132
- `&&i>=this.pos&&i+1+_>f)s=i;else break}while(!0);return yield xs.SCALAR,yield*this.pushToIndex(s+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let s=this.flowLevel>0,_=this.pos-1,u=this.pos-1,T;while(T=this.buffer[++u])if(T===":"){let i=this.buffer[u+1];if(d(i)||s&&K_.has(i))break;_=u}else if(d(T)){let i=this.buffer[u+1];if(T==="\r")if(i===`
133
- `)u+=1,T=`
134
- `,i=this.buffer[u+1];else _=u;if(i==="#"||s&&K_.has(i))break;if(T===`
135
- `){let $=this.continueScalar(u+1);if($===-1)break;u=Math.max(u,$-2)}}else{if(s&&K_.has(T))break;_=u}if(!T&&!this.atEnd)return this.setNext("plain-scalar");return yield xs.SCALAR,yield*this.pushToIndex(_+1,!0),s?"flow":"doc"}*pushCount(s){if(s>0)return yield this.buffer.substr(this.pos,s),this.pos+=s,s;return 0}*pushToIndex(s,_){let u=this.buffer.slice(this.pos,s);if(u)return yield u,this.pos+=u.length,u.length;else if(_)yield"";return 0}*pushIndicators(){let s=0;s:while(!0){switch(this.charAt(0)){case"!":s+=yield*this.pushTag(),s+=yield*this.pushSpaces(!0);continue s;case"&":s+=yield*this.pushUntil($T),s+=yield*this.pushSpaces(!0);continue s;case"-":case"?":case":":{let _=this.flowLevel>0,u=this.charAt(1);if(d(u)||_&&K_.has(u)){if(!_)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0);continue s}}}break s}return s}*pushTag(){if(this.charAt(1)==="<"){let s=this.pos+2,_=this.buffer[s];while(!d(_)&&_!==">")_=this.buffer[++s];return yield*this.pushToIndex(_===">"?s+1:s,!1)}else{let s=this.pos+1,_=this.buffer[s];while(_)if(yO.has(_))_=this.buffer[++s];else if(_==="%"&&F$.has(this.buffer[s+1])&&F$.has(this.buffer[s+2]))_=this.buffer[s+=3];else break;return yield*this.pushToIndex(s,!1)}}*pushNewline(){let s=this.buffer[this.pos];if(s===`
136
- `)return yield*this.pushCount(1);else if(s==="\r"&&this.charAt(1)===`
137
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(s){let _=this.pos-1,u;do u=this.buffer[++_];while(u===" "||s&&u==="\t");let T=_-this.pos;if(T>0)yield this.buffer.substr(this.pos,T),this.pos=_;return T}*pushUntil(s){let _=this.pos,u=this.buffer[_];while(!s(u))u=this.buffer[++_];return yield*this.pushToIndex(_,!1)}}hO.Lexer=H$});var wT=X((cO)=>{class Y${constructor(){this.lineStarts=[],this.addNewLine=(s)=>this.lineStarts.push(s),this.linePos=(s)=>{let _=0,u=this.lineStarts.length;while(_<u){let i=_+u>>1;if(this.lineStarts[i]<s)_=i+1;else u=i}if(this.lineStarts[_]===s)return{line:_+1,col:1};if(_===0)return{line:0,col:s};let T=this.lineStarts[_-1];return{line:_,col:s-T+1}}}}cO.LineCounter=Y$});var gT=X((tO)=>{var kO=__("process"),B$=d_(),xO=fT();function us(s,_){for(let u=0;u<s.length;++u)if(s[u].type===_)return!0;return!1}function z$(s){for(let _=0;_<s.length;++_)switch(s[_].type){case"space":case"comment":case"newline":break;default:return _}return-1}function W$(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function y_(s){switch(s.type){case"document":return s.start;case"block-map":{let _=s.items[s.items.length-1];return _.sep??_.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function Ys(s){if(s.length===0)return[];let _=s.length;s:while(--_>=0)switch(s[_].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break s}while(s[++_]?.type==="space");return s.splice(_,s.length)}function a_(s,_){if(_.length<1e5)Array.prototype.push.apply(s,_);else for(let u=0;u<_.length;++u)s.push(_[u])}function G$(s){if(s.start.type==="flow-seq-start"){for(let _ of s.items)if(_.sep&&!_.value&&!us(_.start,"explicit-key-ind")&&!us(_.sep,"map-value-ind")){if(_.key)_.value=_.key;if(delete _.key,W$(_.value))if(_.value.end)a_(_.value.end,_.sep);else _.value.end=_.sep;else a_(_.start,_.sep);delete _.sep}}}class j${constructor(s){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new xO.Lexer,this.onNewLine=s}*parse(s,_=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let u of this.lexer.lex(s,_))yield*this.next(u);if(!_)yield*this.end()}*next(s){if(this.source=s,kO.env.LOG_TOKENS)console.log("|",B$.prettyToken(s));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=s.length;return}let _=B$.tokenType(s);if(!_){let u=`Not a YAML token: ${s}`;yield*this.pop({type:"error",offset:this.offset,message:u,source:s}),this.offset+=s.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+s.length);break;case"space":if(this.atNewLine&&s[0]===" ")this.indent+=s.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=s.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=s.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 s=this.peek(1);if(this.type==="doc-end"&&s?.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(!s)return yield*this.stream();switch(s.type){case"document":return yield*this.document(s);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(s);case"block-scalar":return yield*this.blockScalar(s);case"block-map":return yield*this.blockMap(s);case"block-seq":return yield*this.blockSequence(s);case"flow-collection":return yield*this.flowCollection(s);case"doc-end":return yield*this.documentEnd(s)}yield*this.pop()}peek(s){return this.stack[this.stack.length-s]}*pop(s){let _=s??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 u=this.peek(1);if(_.type==="block-scalar")_.indent="indent"in u?u.indent:0;else if(_.type==="flow-collection"&&u.type==="document")_.indent=0;if(_.type==="flow-collection")G$(_);switch(u.type){case"document":u.value=_;break;case"block-scalar":u.props.push(_);break;case"block-map":{let T=u.items[u.items.length-1];if(T.value){u.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=u.items[u.items.length-1];if(T.value)u.items.push({start:[],value:_});else T.value=_;break}case"flow-collection":{let T=u.items[u.items.length-1];if(!T||T.value)u.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((u.type==="document"||u.type==="block-map"||u.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&&z$(T.start)===-1&&(_.indent===0||T.start.every((i)=>i.type!=="comment"||i.indent<_.indent))){if(u.type==="document")u.end=T.start;else u.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 s={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")s.start.push(this.sourceToken);this.stack.push(s);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(s){if(s.value)return yield*this.lineEnd(s);switch(this.type){case"doc-start":{if(z$(s.start)!==-1)yield*this.pop(),yield*this.step();else s.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":s.start.push(this.sourceToken);return}let _=this.startBlockValue(s);if(_)this.stack.push(_);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(s){if(this.type==="map-value-ind"){let _=y_(this.peek(2)),u=Ys(_),T;if(s.end)T=s.end,T.push(this.sourceToken),delete s.end;else T=[this.sourceToken];let i={type:"block-map",offset:s.offset,indent:s.indent,items:[{start:u,key:s,sep:T}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(s)}*blockScalar(s){switch(this.type){case"space":case"comment":case"newline":s.props.push(this.sourceToken);return;case"scalar":if(s.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let _=this.source.indexOf(`
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(`
138
137
  `)+1;while(_!==0)this.onNewLine(this.offset+_),_=this.source.indexOf(`
139
- `,_)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(s){let _=s.items[s.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,_.value){let u="end"in _.value?_.value.end:void 0;if((Array.isArray(u)?u[u.length-1]:void 0)?.type==="comment")u?.push(this.sourceToken);else s.items.push({start:[this.sourceToken]})}else if(_.sep)_.sep.push(this.sourceToken);else _.start.push(this.sourceToken);return;case"space":case"comment":if(_.value)s.items.push({start:[this.sourceToken]});else if(_.sep)_.sep.push(this.sourceToken);else{if(this.atIndentedComment(_.start,s.indent)){let T=s.items[s.items.length-2]?.value?.end;if(Array.isArray(T)){a_(T,_.start),T.push(this.sourceToken),s.items.pop();return}}_.start.push(this.sourceToken)}return}if(this.indent>=s.indent){let u=!this.onKeyLine&&this.indent===s.indent,T=u&&(_.sep||_.explicitKey)&&this.type!=="seq-item-ind",i=[];if(T&&_.sep&&!_.value){let $=[];for(let f=0;f<_.sep.length;++f){let w=_.sep[f];switch(w.type){case"newline":$.push(f);break;case"space":break;case"comment":if(w.indent>s.indent)$.length=0;break;default:$.length=0}}if($.length>=2)i=_.sep.splice($[1])}switch(this.type){case"anchor":case"tag":if(T||_.value)i.push(this.sourceToken),s.items.push({start:i}),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)i.push(this.sourceToken),s.items.push({start:i,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(us(_.start,"newline"))Object.assign(_,{key:null,sep:[this.sourceToken]});else{let $=Ys(_.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]})}else if(_.value)s.items.push({start:[],key:null,sep:[this.sourceToken]});else if(us(_.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(W$(_.key)&&!us(_.sep,"newline")){let $=Ys(_.start),f=_.key,w=_.sep;w.push(this.sourceToken),delete _.key,delete _.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:f,sep:w}]})}else if(i.length>0)_.sep=_.sep.concat(i,this.sourceToken);else _.sep.push(this.sourceToken);else if(!_.sep)Object.assign(_,{key:null,sep:[this.sourceToken]});else if(_.value||T)s.items.push({start:i,key:null,sep:[this.sourceToken]});else if(us(_.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 $=this.flowScalar(this.type);if(T||_.value)s.items.push({start:i,key:$,sep:[]}),this.onKeyLine=!0;else if(_.sep)this.stack.push($);else Object.assign(_,{key:$,sep:[]}),this.onKeyLine=!0;return}default:{let $=this.startBlockValue(s);if($){if($.type==="block-seq"){if(!_.explicitKey&&_.sep&&!us(_.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(u)s.items.push({start:i});this.stack.push($);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(s){let _=s.items[s.items.length-1];switch(this.type){case"newline":if(_.value){let u="end"in _.value?_.value.end:void 0;if((Array.isArray(u)?u[u.length-1]:void 0)?.type==="comment")u?.push(this.sourceToken);else s.items.push({start:[this.sourceToken]})}else _.start.push(this.sourceToken);return;case"space":case"comment":if(_.value)s.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(_.start,s.indent)){let T=s.items[s.items.length-2]?.value?.end;if(Array.isArray(T)){a_(T,_.start),T.push(this.sourceToken),s.items.pop();return}}_.start.push(this.sourceToken)}return;case"anchor":case"tag":if(_.value||this.indent<=s.indent)break;_.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==s.indent)break;if(_.value||us(_.start,"seq-item-ind"))s.items.push({start:[this.sourceToken]});else _.start.push(this.sourceToken);return}if(this.indent>s.indent){let u=this.startBlockValue(s);if(u){this.stack.push(u);return}}yield*this.pop(),yield*this.step()}*flowCollection(s){let _=s.items[s.items.length-1];if(this.type==="flow-error-end"){let u;do yield*this.pop(),u=this.peek(1);while(u?.type==="flow-collection")}else if(s.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!_||_.sep)s.items.push({start:[this.sourceToken]});else _.start.push(this.sourceToken);return;case"map-value-ind":if(!_||_.value)s.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)s.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)s.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":s.end.push(this.sourceToken);return}let u=this.startBlockValue(s);if(u)this.stack.push(u);else yield*this.pop(),yield*this.step()}else{let u=this.peek(2);if(u.type==="block-map"&&(this.type==="map-value-ind"&&u.indent===s.indent||this.type==="newline"&&!u.items[u.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&u.type!=="flow-collection"){let T=y_(u),i=Ys(T);G$(s);let $=s.end.splice(1,s.end.length);$.push(this.sourceToken);let f={type:"block-map",offset:s.offset,indent:s.indent,items:[{start:i,key:s,sep:$}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(s)}}flowScalar(s){if(this.onNewLine){let _=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(`
140
139
  `)+1;while(_!==0)this.onNewLine(this.offset+_),_=this.source.indexOf(`
141
- `,_)+1}return{type:s,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(s){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 _=y_(s),u=Ys(_);return u.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let _=y_(s),u=Ys(_);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(s,_){if(this.type!=="comment")return!1;if(this.indent<=_)return!1;return s.every((u)=>u.type==="newline"||u.type==="space")}*documentEnd(s){if(this.type!=="doc-mode"){if(s.end)s.end.push(this.sourceToken);else s.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(s){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(s.end)s.end.push(this.sourceToken);else s.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}tO.Parser=j$});var V$=X(($U)=>{var J$=vu(),eO=hs(),ts=ps(),oO=wu(),sU=Y(),_U=wT(),Z$=gT();function M$(s){let _=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||_&&new _U.LineCounter||null,prettyErrors:_}}function uU(s,_={}){let{lineCounter:u,prettyErrors:T}=M$(_),i=new Z$.Parser(u?.addNewLine),$=new J$.Composer(_),f=Array.from($.compose(i.parse(s)));if(T&&u)for(let w of f)w.errors.forEach(ts.prettifyError(s,u)),w.warnings.forEach(ts.prettifyError(s,u));if(f.length>0)return f;return Object.assign([],{empty:!0},$.streamInfo())}function Q$(s,_={}){let{lineCounter:u,prettyErrors:T}=M$(_),i=new Z$.Parser(u?.addNewLine),$=new J$.Composer(_),f=null;for(let w of $.compose(i.parse(s),!0,s.length))if(!f)f=w;else if(f.options.logLevel!=="silent"){f.errors.push(new ts.YAMLParseError(w.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(T&&u)f.errors.forEach(ts.prettifyError(s,u)),f.warnings.forEach(ts.prettifyError(s,u));return f}function TU(s,_,u){let T=void 0;if(typeof _==="function")T=_;else if(u===void 0&&_&&typeof _==="object")u=_;let i=Q$(s,u);if(!i)return null;if(i.warnings.forEach(($)=>oO.warn(i.options.logLevel,$)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:T},u))}function iU(s,_,u){let T=null;if(typeof _==="function"||Array.isArray(_))T=_;else if(u===void 0&&_)u=_;if(typeof u==="string")u=u.length;if(typeof u==="number"){let i=Math.round(u);u=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=u??_??{};if(!i)return}if(sU.isDocument(s)&&!T)return s.toString(u);return new eO.Document(s,T,u).toString(u)}$U.parse=TU;$U.parseAllDocuments=uU;$U.parseDocument=Q$;$U.stringify=iU});import{existsSync as YT,mkdirSync as e_,readFileSync as mf,writeFileSync as BT}from"fs";import{dirname as kf,isAbsolute as Xr,join as xf,resolve as Er}from"path";var LU=vu(),IU=hs(),SU=Vu(),RT=ps(),OU=js(),Ts=Y(),UU=e(),NU=z(),rU=ss(),XU=_s(),nX=d_(),EU=fT(),qU=wT(),AU=gT(),h_=V$(),b$=Gs();var PU=LU.Composer,DU=IU.Document,FU=SU.Schema,HU=RT.YAMLError,YU=RT.YAMLParseError,BU=RT.YAMLWarning,zU=OU.Alias,GU=Ts.isAlias,WU=Ts.isCollection,jU=Ts.isDocument,JU=Ts.isMap,ZU=Ts.isNode,MU=Ts.isPair,QU=Ts.isScalar,VU=Ts.isSeq,bU=UU.Pair,lU=NU.Scalar,nU=rU.YAMLMap,CU=XU.YAMLSeq;var dU=EU.Lexer,KU=qU.LineCounter,yU=AU.Parser,p_=h_.parse,aU=h_.parseAllDocuments,hU=h_.parseDocument,LT=h_.stringify,pU=b$.visit,cU=b$.visitAsync;var mU=new Set(["none","low","medium","high"]),kU=new Set(["low","medium","high"]);function c_(s,_){if(!s||typeof s!=="object"||Array.isArray(s))throw Error(`${_} must be an object`);return s}function m(s,_,u=_){let T=s[_];if(typeof T!=="string"||T.trim()==="")throw Error(`Missing required string: ${u}`);return T}function l$(s){if(!("confidence"in s))return null;let _=s.confidence;if(typeof _!=="string"||!kU.has(_))throw Error(`Invalid confidence: ${String(_)}`);return _}function n$(s){let _=c_(p_(s),"summaries.yaml"),u=m(_,"project_id");if(!Array.isArray(_.summaries))throw Error("summaries must be an array");return{projectId:u,summaries:_.summaries.map((T,i)=>{let $=`summaries[${i}]`,f=c_(T,`summaries[${i}]`),w=m(f,"value",`${$}.value`);if(!mU.has(w))throw Error(`Invalid summary value: ${w}`);return l$(f),{sessionId:m(f,"session_id",`${$}.session_id`),title:m(f,"title",`${$}.title`),value:w,summaryMarkdown:m(f,"summary_markdown",`${$}.summary_markdown`),metadata:f}})}}function C$(s){let _=c_(p_(s),"experiences.yaml"),u=m(_,"project_id");if(!Array.isArray(_.experiences))throw Error("experiences must be an array");return{projectId:u,experiences:_.experiences.map((T,i)=>{let $=`experiences[${i}]`,f=c_(T,$),w=f.source_sessions;if(!Array.isArray(w)||w.some((R)=>typeof R!=="string"))throw Error(`experiences[${i}].source_sessions must be a string array`);let g=l$(f);return{title:m(f,"title",`${$}.title`),slug:typeof f.slug==="string"?f.slug:null,summary:m(f,"summary",`${$}.summary`),bodyMarkdown:m(f,"body_markdown",`${$}.body_markdown`),sourceSessions:w,confidence:g,metadata:f}})}}import{existsSync as d$,readFileSync as K$,writeFileSync as xU}from"fs";var tU={"obsidian.vault":"obsidian_vault",obsidian_vault:"obsidian_vault"};function vU(s){let _={};for(let u of s.split(`
142
- `)){let T=u.trim();if(T===""||T.startsWith("#")||T.startsWith("["))continue;let i=T.match(/^([\w.]+)\s*=\s*(.*)$/);if(!i)continue;let $=i[1],f=i[2].trim();if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))f=f.slice(1,-1);_[$]=f}return _}function IT(s){if(!d$(s))return{obsidianVault:null};let u=vU(K$(s,"utf8")).obsidian_vault;return{obsidianVault:u&&u.trim()!==""?u:null}}function y$(s,_,u){let T=tU[_];if(!T)throw Error(`Unknown config key: ${_}. Supported: obsidian.vault`);let $=(d$(s)?K$(s,"utf8"):"").split(`
143
- `),f=`${T} = "${u}"`,w=!1,g=$.map((R)=>{if(R.trim().startsWith(`${T} `)||R.trim().startsWith(`${T}=`))return w=!0,f;return R});if(!w)g.push(f);return xU(s,`${g.filter((R,O)=>!(R===""&&O===g.length-1)).join(`
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(`
144
143
  `)}
145
- `),T}import{Database as eU}from"bun:sqlite";import{mkdirSync as oU}from"fs";import{dirname as sN}from"path";function Z(s){return oU(sN(s),{recursive:!0}),new eU(s)}function M(s){s.exec(`
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(`
146
145
  PRAGMA journal_mode = WAL;
147
146
 
148
147
  CREATE TABLE IF NOT EXISTS projects (
@@ -280,7 +279,7 @@ ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.pus
280
279
  conflict_status TEXT NOT NULL,
281
280
  UNIQUE(note_type, entity_id)
282
281
  );
283
- `)}import{spawnSync as _N}from"child_process";import{existsSync as uN}from"fs";import{basename as TN,resolve as h$}from"path";function iN(s){return s.trim().replace(/\/+$/,"").replace(/^ssh:\/\/git@([^/]+)\//,"$1/").replace(/^git@([^:]+):/,"$1/").replace(/^https?:\/\//,"").replace(/\.git$/,"")}function ST(s){return s.normalize("NFKD").replace(/[^\w\s./-]/g,"").trim().toLowerCase().replace(/[\s._/]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"project"}function a$(s,_){let u=_N("git",_,{cwd:s,encoding:"utf8"});if(u.status!==0)return null;return u.stdout.trim()||null}function p$(s){let _=a$(s,["rev-parse","--show-toplevel"]),u=a$(s,["config","--get","remote.origin.url"]),T=u?iN(u):null,i=T??TN(_??s),$=ST(i);return{id:`proj_${Bun.hash(T??_??s).toString(16)}`,canonicalName:i,slug:$,canonicalRepoUrl:T,identitySource:T?"git_remote":"path"}}function c$(s,_){let u=new Date().toISOString();return s.query(`
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(`
284
283
  INSERT INTO projects (id, canonical_name, display_name, slug, canonical_repo_url, provider, identity_source, created_at, updated_at)
285
284
  VALUES ($id, $canonicalName, NULL, $slug, $canonicalRepoUrl, NULL, $identitySource, $now, $now)
286
285
  ON CONFLICT(id) DO UPDATE SET
@@ -289,7 +288,7 @@ ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.pus
289
288
  canonical_repo_url = excluded.canonical_repo_url,
290
289
  identity_source = excluded.identity_source,
291
290
  updated_at = excluded.updated_at
292
- `).run({$id:_.id,$canonicalName:_.canonicalName,$slug:_.slug,$canonicalRepoUrl:_.canonicalRepoUrl,$identitySource:_.identitySource,$now:u}),m_(s,_.id)}function is(s,_){let u=h$(_);if(!uN(u))throw Error(`Path does not exist: ${u}`);return c$(s,p$(u))}function m$(s,_){let u=h$(_);return c$(s,p$(u))}function OT(s,_,u){let T=new Date().toISOString();if(s.query("UPDATE projects SET display_name = $displayName, updated_at = $now WHERE id = $projectId").run({$displayName:u,$projectId:_,$now:T}).changes===0)throw Error(`Project not found: ${_}`);return m_(s,_)}function k$(s){return s.query(`
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(`
293
292
  SELECT
294
293
  p.id,
295
294
  p.canonical_name,
@@ -303,41 +302,47 @@ ${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.pus
303
302
  LEFT JOIN sessions s ON s.project_id = p.id
304
303
  GROUP BY p.id
305
304
  ORDER BY session_count DESC, p.canonical_name ASC
306
- `).all().map((u)=>({id:u.id,canonicalName:u.canonical_name,displayName:u.display_name,slug:u.slug,canonicalRepoUrl:u.canonical_repo_url,identitySource:u.identity_source,sessionCount:u.session_count,lastSeenAt:u.last_seen_at}))}function m_(s,_){let u=s.query("SELECT * FROM projects WHERE id = ?").get(_);if(!u)throw Error(`Project not found: ${_}`);return{id:u.id,canonicalName:u.canonical_name,displayName:u.display_name,slug:u.slug,canonicalRepoUrl:u.canonical_repo_url,identitySource:u.identity_source}}var $N=`## \u8F93\u51FA\u683C\u5F0F
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=`## 输出格式(务必遵守)
307
306
 
308
- \u57FA\u4E8E\u4E0B\u9762\u8FD9\u4E9B\u4F1A\u8BDD\u6458\u8981\uFF0C\u63D0\u70BC\u51FA\u53EF\u590D\u7528\u7684\u9879\u76EE\u7ECF\u9A8C\uFF0C\u751F\u6210 \`experiences.yaml\` \u5199\u5165
309
- \`.llm-iwiki/tasks/experiences.yaml\`\uFF0C\u518D\u8FD0\u884C \`llm-iwiki experiences propose\`\u3002
307
+ 本文件(\`experiences-task.md\`)是任务说明,请勿修改它。
308
+ 请**另外新建**一个纯 YAML 文件 \`.llm-iwiki/tasks/experiences.yaml\`,然后运行:
309
+ \`llm-iwiki experiences propose --project . --file .llm-iwiki/tasks/experiences.yaml\`
310
+
311
+ 输出文件规则:
312
+ - 只能是 YAML 内容,不要写 Markdown 标题或说明文字,也不要用 \`\`\` 代码围栏把它包起来。
313
+ - 不要保留 \`<...>\` 占位符,全部替换成真实内容。
314
+ - 一条经验可以聚合多个会话,按主题归纳,不要逐会话复述。
315
+ - \`source_sessions\` 必须是字符串数组,填该经验来自哪些 session_id(与下方摘要块标题里的 id 一致)。
316
+ - \`confidence\` 可选,只能取 low / medium / high 其中之一。
317
+
318
+ 按下面结构填真实内容(# 后是说明,可删):
310
319
 
311
320
  \`\`\`yaml
312
- project_id: <\u89C1\u4E0B\u65B9 project_id>
321
+ project_id: proj_xxxxxxxx # 用本文件顶部的 project_id
313
322
  experiences:
314
- - title: <\u7ECF\u9A8C\u6807\u9898>
315
- slug: <\u53EF\u9009\uFF0C\u7A33\u5B9A\u77ED\u6807\u8BC6>
323
+ - title: 经验标题
324
+ slug: stable-short-id # 可选,省略即可
316
325
  summary: |
317
- \u4E00\u53E5\u8BDD\u8BF4\u660E\u8FD9\u6761\u7ECF\u9A8C\u3002
326
+ 一句话说明这条经验。
318
327
  body_markdown: |
319
- ## \u80CC\u666F
320
- ## \u65B9\u6848
321
- ## \u7ED3\u8BBA
328
+ ## 背景
329
+ ## 方案
330
+ ## 结论
322
331
  source_sessions:
323
- - <\u76F8\u5173 session_id>
324
- confidence: low | medium | high
325
- \`\`\`
326
-
327
- \u8981\u6C42\uFF1A
328
- - \u4E00\u6761\u7ECF\u9A8C\u53EF\u4EE5\u805A\u5408\u591A\u4E2A\u4F1A\u8BDD\uFF0C\u6309\u4E3B\u9898\u5F52\u7EB3\uFF0C\u4E0D\u8981\u9010\u4F1A\u8BDD\u590D\u8FF0\u3002
329
- - \`source_sessions\` \u586B\u5199\u8BE5\u7ECF\u9A8C\u6765\u81EA\u54EA\u4E9B session_id\u3002`;function fN(s,_,u){let T=u==="changed-summaries"?"AND value IN ('medium', 'high')":"";return s.query(`
332
+ - cc_xxxxxxxx
333
+ confidence: medium
334
+ \`\`\``;function DO(u,_,s){let $=s==="changed-summaries"?"AND value IN ('medium', 'high')":"";return u.query(`
330
335
  SELECT session_id, title, value, summary_markdown
331
336
  FROM session_summaries
332
- WHERE project_id = ? ${T}
337
+ WHERE project_id = ? ${$}
333
338
  ORDER BY updated_at DESC
334
- `).all(_)}function x$(s,_,u){let i=fN(s,_,u).map((f)=>[`### ${f.session_id} \u2014 ${f.title}`,`- value: ${f.value}`,"",f.summary_markdown].join(`
335
- `));return{markdown:["# Experiences Task","",`project_id: ${_}`,`scope: ${u}`,`summaries: ${i.length}`,"",$N,"","---","",i.join(`
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(`
336
341
 
337
342
  ---
338
343
 
339
344
  `),""].join(`
340
- `),summaryCount:i.length}}function t$(s){return Bun.hash(s).toString(16)}function v$(s,_){let u=new Date().toISOString(),T=0;return s.transaction(()=>{for(let $ of _.experiences){let f=$.slug&&$.slug.trim()!==""?$.slug:ST($.title),w=`cand_${t$(`${_.projectId}\x00${f}`)}`;s.query(`
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(`
341
346
  INSERT INTO experience_candidates (
342
347
  id, project_id, proposed_title, proposed_slug, proposed_body_markdown, source_sessions_json, confidence, status, created_at
343
348
  ) VALUES ($id, $projectId, $title, $slug, $body, $sources, $confidence, 'proposed', $now)
@@ -346,7 +351,7 @@ experiences:
346
351
  proposed_body_markdown = excluded.proposed_body_markdown,
347
352
  source_sessions_json = excluded.source_sessions_json,
348
353
  confidence = excluded.confidence
349
- `).run({$id:w,$projectId:_.projectId,$title:$.title,$slug:f,$body:$.bodyMarkdown,$sources:JSON.stringify($.sourceSessions),$confidence:$.confidence,$now:u}),T+=1}})(),{written:T}}function e$(s,_){if(_)return s.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 s.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 o$(s,_){let u=s.query("SELECT project_id, proposed_title, proposed_slug, proposed_body_markdown, confidence, source_sessions_json FROM experience_candidates WHERE id = ?").get(_);if(!u)throw Error(`Experience candidate not found: ${_}`);let T=[];try{let w=JSON.parse(u.source_sessions_json);if(Array.isArray(w))T=w.filter((g)=>typeof g==="string")}catch{T=[]}let i=new Date().toISOString(),$=`exp_${t$(`${u.project_id}\x00${u.proposed_slug}`)}`;return s.transaction(()=>{s.query(`
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(`
350
355
  INSERT INTO experiences (
351
356
  id, project_id, title, slug, body_markdown, confidence, status, created_at, updated_at
352
357
  ) VALUES ($id, $projectId, $title, $slug, $body, $confidence, 'accepted', $now, $now)
@@ -356,14 +361,14 @@ experiences:
356
361
  confidence = excluded.confidence,
357
362
  status = 'accepted',
358
363
  updated_at = excluded.updated_at
359
- `).run({$id:$,$projectId:u.project_id,$title:u.proposed_title,$slug:u.proposed_slug,$body:u.proposed_body_markdown,$confidence:u.confidence,$now:i});let g=s.query("SELECT id FROM experiences WHERE project_id = ? AND slug = ?").get(u.project_id,u.proposed_slug)?.id??$;for(let R of T)s.query(`
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(`
360
365
  INSERT INTO session_experience_links (session_id, experience_id, relation)
361
366
  VALUES (?, ?, 'source')
362
367
  ON CONFLICT(session_id, experience_id) DO NOTHING
363
- `).run(R,g);s.query("UPDATE experience_candidates SET status = 'accepted' WHERE id = ?").run(_)})(),{experienceId:$,slug:u.proposed_slug,linkedSessions:T.length}}function sf(s,_){if(s.query("UPDATE experience_candidates SET status = 'rejected' WHERE id = ?").run(_).changes===0)throw Error(`Experience candidate not found: ${_}`)}import{existsSync as uf,mkdirSync as wN,readFileSync as Tf,writeFileSync as _f}from"fs";import{dirname as gN,join as vs}from"path";var x_="<!-- aiwiki:managed:start -->",$f="<!-- aiwiki:managed:end -->";function t_(s){return Bun.hash(s).toString(16)}function NT(s){let _=s.replace(/[\\/:*?"<>|]/g," ").replace(/\s+/g," ").trim().slice(0,80);return _===""?"untitled":_}function RN(s){let _=LT(s.frontmatter).trimEnd(),u=s.userSectionHeading??"## \u6211\u7684\u8865\u5145";return["---",_,"---","",`# ${s.title}`,"",x_,s.managedBody.trim(),$f,"",u,"",""].join(`
364
- `)}function ff(s){let _=s.indexOf(x_),u=s.indexOf($f);if(_===-1||u===-1||u<_)return null;return{before:s.slice(0,_+x_.length),managed:s.slice(_+x_.length,u).trim(),after:s.slice(u)}}function LN(s,_){return`${s.before}
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}
365
370
  ${_.trim()}
366
- ${s.after}`}function IN(s,_,u){return s.query("SELECT managed_hash, file_path FROM obsidian_notes WHERE note_type = ? AND entity_id = ?").get(_,u)}function k_(s,_,u,T,i,$){s.query(`
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(`
367
372
  INSERT INTO obsidian_notes (id, note_type, entity_id, file_path, managed_hash, frontmatter_hash, last_exported_at, conflict_status)
368
373
  VALUES ($id, $noteType, $entityId, $filePath, $managedHash, NULL, $now, $conflictStatus)
369
374
  ON CONFLICT(note_type, entity_id) DO UPDATE SET
@@ -371,83 +376,189 @@ ${s.after}`}function IN(s,_,u){return s.query("SELECT managed_hash, file_path FR
371
376
  managed_hash = excluded.managed_hash,
372
377
  last_exported_at = excluded.last_exported_at,
373
378
  conflict_status = excluded.conflict_status
374
- `).run({$id:`note_${t_(`${_.noteType}\x00${_.entityId}`)}`,$noteType:_.noteType,$entityId:_.entityId,$filePath:u,$managedHash:T,$conflictStatus:i,$now:$})}function UT(s,_,u,T,i){let $=vs(_,u.relPath),f=t_(u.managedBody.trim());if(!uf($))return wN(gN($),{recursive:!0}),_f($,RN(u)),k_(s,u,$,f,"clean",i),"created";let w=Tf($,"utf8"),g=ff(w);if(!g)return k_(s,u,$,f,"no_managed_block",i),"conflict";let R=t_(g.managed),O=IN(s,u.noteType,u.entityId),L=!O||O.managed_hash!==R;if(L&&!T.force)return k_(s,u,$,O?.managed_hash??R,"managed_conflict",i),"conflict";return _f($,LN(g,u.managedBody)),k_(s,u,$,f,"clean",i),L?"forced":"updated"}function SN(s){return NT(s.displayName??s.canonicalName??s.slug)}function wf(s,_,u,T){let i=new Date().toISOString(),$={created:0,updated:0,forced:0,conflicts:[]},f=SN(u),w=vs("LLM-iWiki","Projects",f),g=u.displayName??u.canonicalName,R=(S,N)=>{if(S==="created")$.created+=1;else if(S==="updated")$.updated+=1;else if(S==="forced")$.forced+=1;else $.conflicts.push(N)},O=s.query(`
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(`
375
380
  SELECT id, session_id, title, value, summary_markdown, updated_at
376
381
  FROM session_summaries WHERE project_id = ? ORDER BY updated_at DESC
377
- `).all(u.id);for(let S of O){let N=vs(w,"Sessions",`${NT(S.title)}.md`),E={noteType:"session-summary",entityId:S.id,relPath:N,title:S.title,managedBody:S.summary_markdown,frontmatter:{type:"session-summary",aiwiki_id:S.id,aiwiki_project_id:u.id,project:g,session_id:S.session_id,value:S.value,updated_at:S.updated_at??i}};R(UT(s,_,E,T,i),N)}let L=s.query(`
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(`
378
383
  SELECT id, title, slug, body_markdown, confidence, status, updated_at
379
384
  FROM experiences WHERE project_id = ? AND status = 'accepted' ORDER BY updated_at DESC
380
- `).all(u.id);for(let S of L){let N=vs(w,"Experiences",`${NT(S.slug||S.title)}.md`),E=s.query("SELECT session_id FROM session_experience_links WHERE experience_id = ?").all(S.id).map((P)=>P.session_id),A={noteType:"experience",entityId:S.id,relPath:N,title:S.title,managedBody:S.body_markdown,frontmatter:{type:"experience",aiwiki_id:S.id,aiwiki_project_id:u.id,project:g,slug:S.slug,confidence:S.confidence,status:S.status,source_sessions:E,updated_at:S.updated_at}};R(UT(s,_,A,T,i),N)}let I=vs(w,"Project Summary.md"),U=[`- canonical: \`${u.canonicalName}\``,u.canonicalRepoUrl?`- repo: ${u.canonicalRepoUrl}`:null,`- session summaries: ${O.length}`,`- experiences: ${L.length}`].filter((S)=>S!=null).join(`
381
- `),r={noteType:"project-summary",entityId:u.id,relPath:I,title:g,managedBody:U,frontmatter:{type:"project-summary",aiwiki_project_id:u.id,project:g,canonical_repo_url:u.canonicalRepoUrl,updated_at:i}};return R(UT(s,_,r,T,i),I),$}function gf(s){let _=s.query("SELECT note_type, entity_id, file_path, managed_hash FROM obsidian_notes ORDER BY file_path ASC").all(),u=[],T=0;for(let i of _){let $;if(!uf(i.file_path))$="missing";else{let f=ff(Tf(i.file_path,"utf8"));if(!f)$="no_managed_block";else if(i.managed_hash&&t_(f.managed)===i.managed_hash)$="clean";else $="drift"}if($==="clean")T+=1;else u.push({noteType:i.note_type,entityId:i.entity_id,filePath:i.file_path,status:$})}return{total:_.length,clean:T,entries:u}}import{homedir as ON}from"os";import{join as rT,resolve as UN}from"path";function J(s=ON()){let _=rT(s,".llm-iwiki");return{homeDir:s,configDir:_,configFile:rT(_,"config.toml"),databaseFile:rT(_,"llm-iwiki.db")}}function XT(s){return UN(s,".llm-iwiki","tasks")}function Rf(s){return{id:s.id,sourceId:s.source_id,sourceSessionId:s.source_session_id,title:s.title,messageCount:s.message_count,status:s.status,rawProjectPath:s.raw_project_path,updatedAt:s.updated_at,lastSeenAt:s.last_seen_at}}function NN(s,_,u=100){return s.query(`
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(`
382
387
  SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
383
388
  FROM sessions
384
389
  WHERE project_id = ?
385
390
  ORDER BY COALESCE(updated_at, last_seen_at) DESC
386
391
  LIMIT ?
387
- `).all(_,u).map(Rf)}function Lf(s,_){return s.query("SELECT role, content FROM messages WHERE session_id = ? ORDER BY seq_order ASC").all(_)}function If(s,_,u){let T=u==="changed"?"AND status IN ('new', 'changed')":"";return s.query(`
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(`
388
393
  SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
389
394
  FROM sessions
390
- WHERE project_id = ? ${T}
395
+ WHERE project_id = ? ${$}
391
396
  ORDER BY COALESCE(updated_at, last_seen_at) DESC
392
- `).all(_).map(Rf)}function Sf(s,_){return{sources:s.query(`
397
+ `).all(_).map(Di)}function Fi(u,_){return{sources:u.query(`
393
398
  SELECT source_id, COUNT(*) AS session_count
394
399
  FROM sessions
395
400
  WHERE project_id = ?
396
401
  GROUP BY source_id
397
402
  ORDER BY session_count DESC
398
- `).all(_).map((T)=>({source:T.source_id,sessionCount:T.session_count})),sessions:NN(s,_)}}import{existsSync as rN,mkdirSync as XN,writeFileSync as Of}from"fs";import{dirname as EN,join as ET}from"path";var qT=["codex","claude-code","cursor"],AT=ET(".agents","skills"),Uf={codex:"Codex","claude-code":"Claude Code",cursor:"Cursor"},Nf=[{directory:"aiwiki-after-session",content:"---\nname: aiwiki-after-session\ndescription: Capture session knowledge into llm-iwiki summaries, experiences, and Obsidian export after project work.\n---\n\n# AIWiki After Session\n\nUse this skill after a meaningful coding or design session in the current project.\n\n## Steps\n\n1. Sync the current project:\n ```bash\n llm-iwiki sync --project .\n ```\n2. Prepare changed summaries:\n ```bash\n llm-iwiki summarize prepare changed --project . --out .llm-iwiki/tasks/summaries-task.md\n ```\n3. Generate `.llm-iwiki/tasks/summaries.yaml` from the prepared task.\n4. Apply the summaries:\n ```bash\n llm-iwiki summarize apply --project . --file .llm-iwiki/tasks/summaries.yaml\n ```\n5. Prepare experience proposals from changed summaries:\n ```bash\n llm-iwiki experiences prepare --project . --from changed-summaries --out .llm-iwiki/tasks/experiences-task.md\n ```\n6. Generate `.llm-iwiki/tasks/experiences.yaml` from the prepared task.\n7. Propose the experiences:\n ```bash\n llm-iwiki experiences propose --project . --file .llm-iwiki/tasks/experiences.yaml\n ```\n8. Export project knowledge to Obsidian:\n ```bash\n llm-iwiki obsidian export --project .\n ```\n"},{directory:"aiwiki-before-debug",content:`---
399
- name: aiwiki-before-debug
400
- description: Search project memory before debugging so related history is visible before changing code.
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:`---
404
+ name: aiwiki-knowledge
405
+ description: llm-iwiki 把当前项目跨 AI 工具的会话沉淀成知识库——采集会话、生成总结与经验、导出到 Obsidian。当用户提到"沉淀/总结这次工作""存进知识库""项目复盘""跑一下 llm-iwiki"或想把会话经验归档时使用。
401
406
  ---
402
407
 
403
- # AIWiki Before Debug
408
+ # AIWiki 知识沉淀
409
+
410
+ 用 \`llm-iwiki\` 把当前项目里跨 AI 工具(Claude Code / Cursor / Codex / CodeBuddy / Gemini)的会话,沉淀为「会话总结 → 可复用经验 → Obsidian 笔记」。
411
+
412
+ ## 何时使用
404
413
 
405
- Use this skill before investigating a bug, failure, error message, or confusing behavior.
414
+ - 完成一段有价值的编码 / 设计工作后,想把过程沉淀进知识库。
415
+ - 用户说「沉淀这次工作」「总结到知识库」「项目复盘」「跑一下 llm-iwiki」。
406
416
 
407
- ## Steps
417
+ ## 整体流程
408
418
 
409
- 1. Search the full project knowledge index:
419
+ \`采集(命令) → 生成总结任务(命令) → 你产出 summaries.yaml 落库(命令) 生成经验任务(命令) 你产出 experiences.yaml → 落库为候选(命令) → 人工审核 → 导出 Obsidian(命令)\`
420
+
421
+ 其中**只有「产出两个 YAML」需要你来做**,其余都是直接跑命令。务必先读下方「YAML 输出规则」再动手,这是最容易出错的地方。
422
+
423
+ ## 步骤(在项目根目录执行)
424
+
425
+ 1. 采集并确认项目已识别,记下顶部的 project_id(形如 \`proj_xxxx\`):
410
426
  \`\`\`bash
411
- llm-iwiki search "<error or topic>" --project . --index all
427
+ llm-iwiki sync
428
+ llm-iwiki projects inspect .
429
+ \`\`\`
430
+ 若显示 \`sessions: 0\`,说明本机暂无该项目会话,停止并告知用户。
431
+
432
+ 2. 生成总结任务文件(想覆盖全部历史把 \`changed\` 换成 \`all\`):
433
+ \`\`\`bash
434
+ llm-iwiki summarize prepare changed --project . --out .llm-iwiki/tasks/summaries-task.md
412
435
  \`\`\`
413
- 2. Read any related summaries, experiences, or prior decisions before editing code.
414
- 3. Report whether related history was found, and name the most relevant item when it was found.
415
- `},{directory:"aiwiki-project-retrospective",content:`---
416
- name: aiwiki-project-retrospective
417
- description: Review recent project knowledge and extract retrospective themes from llm-iwiki.
418
- ---
419
436
 
420
- # AIWiki Project Retrospective
437
+ 3. 阅读 \`.llm-iwiki/tasks/summaries-task.md\`,据此**新建** \`.llm-iwiki/tasks/summaries.yaml\`(纯 YAML,见下方规则)。
421
438
 
422
- Use this skill when preparing a project retrospective or looking for recent repeated lessons.
439
+ 4. 落库;若报解析 / 校验错,按报错修正 YAML 后重跑:
440
+ \`\`\`bash
441
+ llm-iwiki summarize apply --project . --file .llm-iwiki/tasks/summaries.yaml
442
+ \`\`\`
423
443
 
424
- ## Steps
444
+ 5. 生成经验任务文件(只吃 value=medium/high 的总结):
445
+ \`\`\`bash
446
+ llm-iwiki experiences prepare --project . --from changed-summaries --out .llm-iwiki/tasks/experiences-task.md
447
+ \`\`\`
425
448
 
426
- 1. Prepare a retrospective from recent project history:
449
+ 6. 阅读 \`.llm-iwiki/tasks/experiences-task.md\`,据此**新建** \`.llm-iwiki/tasks/experiences.yaml\`(纯 YAML)。
450
+
451
+ 7. 落库为候选:
427
452
  \`\`\`bash
428
- llm-iwiki experiences prepare --project . --from all-recent --since 30d --out .llm-iwiki/tasks/retrospective-task.md
453
+ llm-iwiki experiences propose --project . --file .llm-iwiki/tasks/experiences.yaml
429
454
  \`\`\`
430
- 2. Review the prepared task for repeated themes, unresolved questions, and process improvements.
431
- 3. Capture any accepted learnings through the normal llm-iwiki experience proposal flow.
432
- `}];function qN(s,_){if(!_)return s;return`${s}
433
- ## Tool Target
434
455
 
435
- This skill is initialized for ${Uf[_]}.
436
- `}function AN(s){return s instanceof Error&&"code"in s&&s.code==="EEXIST"}function rf(){return qT.map((s)=>({id:s,name:Uf[s]}))}function Xf(){return Nf.map((s)=>({directory:s.directory,relPath:ET(AT,s.directory,"SKILL.md")}))}function Ef(s){let _=[],u=[];for(let T of Nf){let i=ET(s.cwd,".agents","skills",T.directory,"SKILL.md");if(rN(i)&&!s.force){u.push(i);continue}if(_.push(i),s.dryRun)continue;XN(EN(i),{recursive:!0});let $=qN(T.content,s.target);if(s.force){Of(i,$);continue}try{Of(i,$,{flag:"wx"})}catch(f){if(!AN(f))throw f;_.pop(),u.push(i)}}return{written:_,skipped:u}}var PN={maxPerMessage:1200,maxMessages:60};function DN(s){return s.replace(/[ \t]+\n/g,`
456
+ 8. 列出候选交用户决定,**不要自行 accept**:
457
+ \`\`\`bash
458
+ llm-iwiki experiences candidates --project .
459
+ # 用户确认后再:llm-iwiki experiences accept <candidate-id>
460
+ \`\`\`
461
+
462
+ 9. 导出到 Obsidian(只导出已 accept 的经验;库路径仅首次需配置):
463
+ \`\`\`bash
464
+ llm-iwiki config set obsidian.vault <库目录>
465
+ llm-iwiki obsidian export --project .
466
+ \`\`\`
467
+
468
+ ## YAML 输出规则(最重要,避免格式错误)
469
+
470
+ - \`*-task.md\` 是**输入说明**,绝不要修改它,更不要把它改名当成输出。
471
+ - 输出文件(\`summaries.yaml\` / \`experiences.yaml\`)**只能包含 YAML**:
472
+ - 不要写 Markdown 标题或说明文字;
473
+ - 不要用 \`\`\` 代码围栏把整段内容包起来;
474
+ - 不要保留 \`<...>\` 占位符,全部换成真实内容。
475
+ - \`project_id\` 用对应任务文件顶部给出的值。
476
+ - 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)可选。
478
+
479
+ ### summaries.yaml 正确示例
480
+
481
+ \`\`\`yaml
482
+ project_id: proj_071be0c7a2e9ccc6
483
+ summaries:
484
+ - session_id: cc_ab12cd34
485
+ title: 修复切换租户后登录态丢失
486
+ value: high
487
+ summary_markdown: |
488
+ ## 问题
489
+ 切换租户后登录态丢失。
490
+ ## 关键决策
491
+ 统一在中间件按租户刷新 token。
492
+ ## 结论
493
+ 已修复并补了回归测试。
494
+ \`\`\`
495
+
496
+ ### experiences.yaml 正确示例
497
+
498
+ \`\`\`yaml
499
+ project_id: proj_071be0c7a2e9ccc6
500
+ experiences:
501
+ - title: 多租户下的登录态刷新策略
502
+ summary: |
503
+ 切换租户必须按租户维度刷新会话凭证。
504
+ body_markdown: |
505
+ ## 背景
506
+ 多租户切换会丢登录态。
507
+ ## 方案
508
+ 中间件按租户统一刷新 token。
509
+ ## 结论
510
+ 回归通过,沉淀为团队规范。
511
+ source_sessions:
512
+ - cc_ab12cd34
513
+ confidence: medium
514
+ \`\`\`
515
+ `}];function jO(u,_){if(!_)return u;return`${u}
516
+ ## 适配工具
517
+
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,`
437
520
  `).replace(/\n{3,}/g,`
438
521
 
439
- `).trim()}function FN(s,_){let u=DN(s);if(u.length<=_)return u;return`${u.slice(0,_)}
440
- \u2026[truncated ${u.length-_} chars]`}function qf(s,_={}){let u={...PN,..._},T=s.filter((w)=>w.content.trim()!==""),i=T,$="";if(T.length>u.maxMessages){let w=Math.ceil(u.maxMessages*0.6),g=u.maxMessages-w;i=[...T.slice(0,w),...T.slice(T.length-g)],$=`
441
- \u2026[omitted ${T.length-u.maxMessages} middle messages]
442
- `}let f=[];return i.forEach((w,g)=>{if($&&g===Math.ceil(u.maxMessages*0.6))f.push($);let R=w.role==="user"?"User":w.role==="assistant"?"Assistant":w.role;f.push(`**${R}:** ${FN(w.content,u.maxPerMessage)}`)}),f.join(`
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(`
443
526
 
444
- `)}var HN="## \u8F93\u51FA\u683C\u5F0F\n\n\u8BF7\u9605\u8BFB\u4E0B\u9762\u6BCF\u4E2A\u4F1A\u8BDD\u7684\u538B\u7F29\u8BB0\u5F55\uFF0C\u4E3A\u6709\u4EF7\u503C\u7684\u4F1A\u8BDD\u751F\u6210\u4E00\u4EFD `summaries.yaml`\uFF0C\u5199\u5165\n`.llm-iwiki/tasks/summaries.yaml`\uFF0C\u518D\u8FD0\u884C `llm-iwiki summarize apply`\u3002\n\n```yaml\nproject_id: <\u89C1\u4E0B\u65B9 project_id>\nsummaries:\n - session_id: <\u4F1A\u8BDD\u7684 session_id\uFF0C\u539F\u6837\u7167\u6284>\n title: <\u4E00\u53E5\u8BDD\u6807\u9898>\n value: none | low | medium | high\n summary_markdown: |\n \u7528 Markdown \u6982\u62EC\u8FD9\u6B21\u4F1A\u8BDD\u89E3\u51B3\u4E86\u4EC0\u4E48\u95EE\u9898\u3001\u5173\u952E\u51B3\u7B56\u3001\u7ED3\u8BBA\u3002\n```\n\n\u8981\u6C42\uFF1A\n- `value` \u8868\u793A\u8FD9\u6B21\u4F1A\u8BDD\u7684\u6C89\u6DC0\u4EF7\u503C\uFF0C`medium` / `high` \u4F1A\u8FDB\u5165\u7ECF\u9A8C\u63D0\u53D6\u3002\n- `session_id` \u5FC5\u987B\u4E0E\u4E0B\u9762\u7ED9\u51FA\u7684\u5B8C\u5168\u4E00\u81F4\u3002\n- \u6CA1\u6709\u4EF7\u503C\u7684\u4F1A\u8BDD\u53EF\u4EE5\u7701\u7565\uFF0C\u4E0D\u5FC5\u6BCF\u4E2A\u90FD\u5199\u3002";function Af(s,_,u){let T=If(s,_,u),i=[];for(let f of T){let w=Lf(s,f.id);if(w.length===0)continue;let g=qf(w);i.push([`### ${f.id}`,`- source: ${f.sourceId}`,`- title: ${f.title??"(\u65E0\u6807\u9898)"}`,`- messages: ${f.messageCount}`,"",g].join(`
445
- `))}return{markdown:["# Summaries Task","",`project_id: ${_}`,`scope: ${u}`,`sessions: ${i.length}`,"",HN,"","---","",i.join(`
527
+ `)}var EO=`## 输出格式(务必遵守)
528
+
529
+ 本文件(\`summaries-task.md\`)是任务说明,请勿修改它。
530
+ 请**另外新建**一个纯 YAML 文件 \`.llm-iwiki/tasks/summaries.yaml\`,然后运行:
531
+ \`llm-iwiki summarize apply --project . --file .llm-iwiki/tasks/summaries.yaml\`
532
+
533
+ 输出文件规则:
534
+ - 只能是 YAML 内容,不要写 Markdown 标题或说明文字,也不要用 \`\`\` 代码围栏把它包起来。
535
+ - 不要保留 \`<...>\` 占位符,全部替换成真实内容。
536
+ - \`value\` 只能取 none / low / medium / high 其中之一(不要照抄“none | low | medium | high”整行);medium / high 才会进入经验提取。
537
+ - \`session_id\` 必须与下方各会话块标题里的 id 完全一致。
538
+ - 没价值的会话直接省略,不必每个都写。
539
+
540
+ 按下面结构填真实内容(# 后是说明,可删):
541
+
542
+ \`\`\`yaml
543
+ project_id: proj_xxxxxxxx # 用本文件顶部的 project_id
544
+ summaries:
545
+ - session_id: cc_xxxxxxxx # 与下方会话块标题里的 id 完全一致
546
+ title: 一句话标题
547
+ value: high
548
+ summary_markdown: |
549
+ ## 问题
550
+ 这次会话要解决什么。
551
+ ## 关键决策
552
+ 做了哪些选择、为什么。
553
+ ## 结论
554
+ 最终结果与后续动作。
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(`
446
557
 
447
558
  ---
448
559
 
449
560
  `),""].join(`
450
- `),sessionCount:i.length}}function YN(s){return Bun.hash(s).toString(16)}function Pf(s,_){let u=new Date().toISOString(),T=0,i=[];return s.transaction(()=>{for(let f of _.summaries){let w=s.query("SELECT project_id FROM sessions WHERE id = ?").get(f.sessionId);if(!w){i.push(f.sessionId);continue}s.query(`
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(`
451
562
  INSERT INTO session_summaries (id, session_id, project_id, title, value, summary_markdown, metadata_json, created_at, updated_at)
452
563
  VALUES ($id, $sessionId, $projectId, $title, $value, $summaryMarkdown, $metadata, $now, $now)
453
564
  ON CONFLICT(id) DO UPDATE SET
@@ -456,18 +567,18 @@ This skill is initialized for ${Uf[_]}.
456
567
  summary_markdown = excluded.summary_markdown,
457
568
  metadata_json = excluded.metadata_json,
458
569
  updated_at = excluded.updated_at
459
- `).run({$id:`sum_${YN(f.sessionId)}`,$sessionId:f.sessionId,$projectId:w.project_id??_.projectId,$title:f.title,$value:f.value,$summaryMarkdown:f.summaryMarkdown,$metadata:JSON.stringify(f.metadata),$now:u}),T+=1}})(),{written:T,skipped:i}}import{existsSync as Hf,readdirSync as Ff,readFileSync as WN,realpathSync as jN,statSync as JN}from"fs";import{basename as ZN,join as v_}from"path";import{tmpdir as BN}from"os";var Df=120,zN=["/tmp/","/private/tmp/","/var/folders/","/private/var/folders/"];function a(s){if(!s)return!1;let _=BN();if(s===_)return!0;let u=s.endsWith("/")?s:`${s}/`;return[...zN,`${_}/`].some((i)=>u.startsWith(i))}function es(s){return s.length>Df?`${s.slice(0,Df)}\u2026`:s}function GN(s){for(let _ of s.split(`
460
- `)){let u=_.trim();if(u===""||/^[-=*#>`~]+$/.test(u))continue;return u}return null}function h(s){for(let _ of s){if(_.role!=="user")continue;let u=GN(_.content);if(u)return es(u)}return null}function Bs(s){if(typeof s==="string")return s;if(Array.isArray(s))return s.map((_)=>{if(typeof _==="string")return _;if(_&&typeof _==="object"){let u=_;if(typeof u.text==="string")return u.text;return JSON.stringify(u)}return String(_)}).join(`
461
- `).trim();if(s==null)return"";return JSON.stringify(s)}var Yf=[".claude/projects",".claude-internal/projects"];function MN(s){let u=WN(s,"utf8").split(`
462
- `),T=[],i=null,$=null;for(let w of u){let g=w.trim();if(g==="")continue;let R;try{R=JSON.parse(g)}catch{continue}if(typeof R.sessionId==="string"&&!$)$=R.sessionId;if(typeof R.cwd==="string"&&!i)i=R.cwd;let O=R.type;if(O!=="user"&&O!=="assistant")continue;if(R.isSidechain===!0)continue;let L=R.message;if(!L||typeof L!=="object")continue;let I=L,U=typeof I.role==="string"?I.role:O,r=Bs(I.content);if(r.trim()==="")continue;T.push({role:U,content:r,timestamp:typeof R.timestamp==="string"?R.timestamp:null})}if(T.length===0)return null;if(a(i))return null;$??=ZN(s).replace(/\.jsonl$/,"");let f=T.map((w)=>w.timestamp).filter((w)=>w!=null);return{sourceSessionId:$,rawPath:s,rawProjectPath:i,title:h(T),createdAt:f[0]??null,updatedAt:f[f.length-1]??null,messages:T}}function QN(s){let _=[],u=new Set;for(let T of Yf){let i=v_(s,T);if(!Hf(i))continue;let $;try{$=jN(i)}catch{$=i}if(u.has($))continue;u.add($);for(let f of Ff(i,{withFileTypes:!0})){if(!f.isDirectory())continue;let w=v_(i,f.name);for(let g of Ff(w,{withFileTypes:!0}))if(g.isFile()&&g.name.endsWith(".jsonl"))_.push(v_(w,g.name))}}return _}var Bf={id:"claude-code",name:"Claude Code",detect(s){return Yf.some((_)=>Hf(v_(s,_)))},collect(s){let _=[];for(let u of QN(s))try{if(!JN(u).isFile())continue;let T=MN(u);if(T)_.push(T)}catch{continue}return _}};import{existsSync as Gf,readdirSync as Wf,readFileSync as VN,statSync as bN}from"fs";import{join as $s}from"path";var lN="Library/Application Support",nN=["CodeBuddyExtension","CodeBuddy CN"];function jf(s,_,u=0){if(u>6)return;let T;try{T=Wf(s,{withFileTypes:!0})}catch{return}for(let i of T){if(!i.isDirectory())continue;let $=$s(s,i.name);if(i.name==="history")_.push($);else if(i.name!=="messages")jf($,_,u+1)}}function PT(s){try{return JSON.parse(VN(s,"utf8"))}catch{return null}}function CN(s){if(typeof s!=="string")return Bs(s);let _=s.trim();if(_.startsWith("{")||_.startsWith("["))try{let u=JSON.parse(_);if(u&&typeof u==="object"&&"content"in u)return Bs(u.content);return Bs(u)}catch{return s}return s}function dN(s){let _=s.match(/Workspace Folder:\s*(.+)/);if(!_)return null;let u=_[1].trim();return u===""?null:u}function KN(s,_,u){let T=PT($s(s,"index.json"));if(!T?.messages)return null;let i=[],$=null;for(let w of T.messages){let g=PT($s(s,"messages",`${w.id}.json`));if(!g)continue;let R=w.role??g.role??"user";if(R!=="user"&&R!=="assistant")continue;let O=CN(g.message);if(O.trim()==="")continue;if(!$&&R==="user")$=dN(O);i.push({role:R,content:O,timestamp:null})}if(i.length===0)return null;if(a($))return null;let f=u.name&&u.name.trim()!==""?es(u.name.trim()):h(i);return{sourceSessionId:_,rawPath:s,rawProjectPath:$,title:f,createdAt:u.createdAt??null,updatedAt:u.lastMessageAt??null,messages:i}}function yN(s,_){for(let u of Wf(s,{withFileTypes:!0})){if(!u.isDirectory())continue;let T=$s(s,u.name),i=PT($s(T,"index.json"));if(!i?.conversations?.length)continue;for(let $ of i.conversations){if(!$.id)continue;let f=$s(T,$.id);if(!Gf(f))continue;try{let w=KN(f,$.id,$);if(w)_.push(w)}catch{continue}}}}function zf(s){return nN.map((_)=>$s(s,lN,_)).filter((_)=>Gf(_))}var Jf={id:"codebuddy",name:"CodeBuddy",detect(s){return zf(s).length>0},collect(s){let _=[],u=new Set;for(let T of zf(s)){let i=[];jf($s(T,"Data"),i);for(let $ of i){try{if(!bN($).isDirectory())continue}catch{continue}yN($,_)}}return _.filter((T)=>{if(u.has(T.sourceSessionId))return!1;return u.add(T.sourceSessionId),!0})}};import{existsSync as Zf,readdirSync as aN,readFileSync as hN,realpathSync as pN,statSync as cN}from"fs";import{basename as mN,join as DT}from"path";var Mf=[".codex/sessions",".codex-internal/sessions"];function kN(s){return s.replace(/\[REQ:[0-9a-f-]+\]/gi,"").replace(/\[AMP_DONE:[0-9a-f-]+\]/gi,"").trim()}function Qf(s,_){for(let u of aN(s,{withFileTypes:!0})){let T=DT(s,u.name);if(u.isDirectory())Qf(T,_);else if(u.isFile()&&u.name.startsWith("rollout-")&&u.name.endsWith(".jsonl"))_.push(T)}}function xN(s){let _=hN(s,"utf8"),u=[],T=null,i=null,$=null;for(let w of _.split(`
463
- `)){let g=w.trim();if(g==="")continue;let R;try{R=JSON.parse(g)}catch{continue}let O=R.payload;if(!O||typeof O!=="object")continue;let L=O,I=typeof R.timestamp==="string"?R.timestamp:null;if(R.type==="session_meta"){if(typeof L.id==="string")i=L.id;if(typeof L.cwd==="string")T=L.cwd;if(typeof L.timestamp==="string")$=L.timestamp;continue}if(R.type!=="event_msg")continue;let U=L.type;if(U!=="user_message"&&U!=="agent_message")continue;if(typeof L.message!=="string")continue;let r=kN(L.message);if(r==="")continue;u.push({role:U==="user_message"?"user":"assistant",content:r,timestamp:I})}if(u.length===0)return null;if(a(T))return null;i??=mN(s).replace(/\.jsonl$/,"");let f=u.map((w)=>w.timestamp).filter((w)=>w!=null);return{sourceSessionId:i,rawPath:s,rawProjectPath:T,title:h(u),createdAt:$??f[0]??null,updatedAt:f[f.length-1]??null,messages:u}}function tN(s){let _=[],u=new Set;for(let T of Mf){let i=DT(s,T);if(!Zf(i))continue;let $;try{$=pN(i)}catch{$=i}if(u.has($))continue;u.add($),Qf(i,_)}return _}var Vf={id:"codex",name:"Codex",detect(s){return Mf.some((_)=>Zf(DT(s,_)))},collect(s){let _=[];for(let u of tN(s))try{if(!cN(u).isFile())continue;let T=xN(u);if(T)_.push(T)}catch{continue}return _}};import{Database as vN}from"bun:sqlite";import{existsSync as os,readdirSync as eN,readFileSync as oN}from"fs";import{join as Os}from"path";var bf="Library/Application Support/Cursor/User";function FT(s){if(typeof s!=="number"||!Number.isFinite(s))return null;let _=new Date(s);return Number.isNaN(_.getTime())?null:_.toISOString()}function sr(s){if(!s.startsWith("file://"))return null;try{return decodeURIComponent(s.replace(/^file:\/\//,"")).replace(/\/+$/,"")}catch{return null}}function lf(s){try{return new vN(s,{readonly:!0})}catch{return null}}function _r(s){let _=new Map,u=Os(s,"workspaceStorage");if(!os(u))return _;for(let T of eN(u,{withFileTypes:!0})){if(!T.isDirectory())continue;let i=Os(u,T.name),$=null,f=Os(i,"workspace.json");if(os(f))try{let R=JSON.parse(oN(f,"utf8"));if(typeof R.folder==="string")$=sr(R.folder)}catch{}let w=Os(i,"state.vscdb");if(!os(w))continue;let g=lf(w);if(!g)continue;try{let R=g.query("SELECT value FROM ItemTable WHERE key = ?").get("composer.composerData");if(!R)continue;let O=JSON.parse(R.value);for(let L of O.allComposers??[]){let I=L.composerId;if(typeof I!=="string")continue;if(_.has(I))continue;_.set(I,{cwd:$,name:typeof L.name==="string"?L.name:null,createdAt:FT(L.createdAt),updatedAt:FT(L.lastUpdatedAt)})}}catch{}finally{g.close()}}return _}function ur(s,_,u,T){let i=s.query("SELECT value FROM cursorDiskKV WHERE key = ?").get(`composerData:${u}`);if(!i)return null;let $;try{$=JSON.parse(i.value)}catch{return null}let f=$.fullConversationHeadersOnly??[];if(f.length===0)return null;let w=s.query("SELECT value FROM cursorDiskKV WHERE key = ?"),g=[];for(let L of f){if(L.type!==1&&L.type!==2)continue;let I=w.get(`bubbleId:${u}:${L.bubbleId}`);if(!I)continue;let U;try{U=JSON.parse(I.value)}catch{continue}let r=typeof U.text==="string"?U.text.trim():"";if(r==="")continue;g.push({role:L.type===1?"user":"assistant",content:r,timestamp:null})}if(g.length===0)return null;if(a(T.cwd))return null;let R=T.name??$.name??null,O=R&&R.trim()!==""?es(R.trim()):h(g);return{sourceSessionId:u,rawPath:`${_}#${u}`,rawProjectPath:T.cwd,title:O,createdAt:T.createdAt??FT($.createdAt),updatedAt:T.updatedAt,messages:g}}var nf={id:"cursor",name:"Cursor",detect(s){return os(Os(s,bf,"globalStorage","state.vscdb"))},collect(s){let _=Os(s,bf),u=Os(_,"globalStorage","state.vscdb");if(!os(u))return[];let T=_r(_);if(T.size===0)return[];let i=lf(u);if(!i)return[];let $=[];try{for(let[f,w]of T)try{let g=ur(i,u,f,w);if(g)$.push(g)}catch{continue}}finally{i.close()}return $}};import{existsSync as s_,readdirSync as Cf,readFileSync as yf,realpathSync as Tr,statSync as ir}from"fs";import{basename as af,dirname as df,join as zs}from"path";var $r=[".gemini-internal",".gemini"];function fr(s){let _=new Map,u=zs(s,"projects.json");if(!s_(u))return _;try{let T=JSON.parse(yf(u,"utf8"));for(let[i,$]of Object.entries(T.projects??{}))if(typeof $==="string"&&!_.has($))_.set($,i)}catch{}return _}function wr(s){let _=s.trim();return _.startsWith("/")&&!_.includes(`
464
- `)&&_.length<256}function gr(s,_,u){let T;try{T=JSON.parse(yf(s,"utf8"))}catch{return null}let i=[];for(let w of T.messages??[]){if(w.type!=="user"&&w.type!=="gemini")continue;let g=typeof w.content==="string"?w.content:"";if(g.trim()==="")continue;i.push({role:w.type==="user"?"user":"assistant",content:g,timestamp:typeof w.timestamp==="string"?w.timestamp:null})}if(i.length===0)return null;let $=u.get(_)??null;if(!$){let w=i.find((g)=>g.role==="user");if(w&&wr(w.content))$=w.content.trim().replace(/\/+$/,"")}if(a($))return null;let f=i.map((w)=>w.timestamp).filter((w)=>w!=null);return{sourceSessionId:T.sessionId??af(s).replace(/\.json$/,""),rawPath:s,rawProjectPath:$,title:h(i),createdAt:T.startTime??f[0]??null,updatedAt:T.lastUpdated??f[f.length-1]??null,messages:i}}function Kf(s){let _=new Set;for(let u of $r){let T=zs(s,u);if(!s_(T))continue;let i;try{i=Tr(T)}catch{i=T}if(_.has(i))continue;return _.add(i),T}return null}function Rr(s){let _=zs(s,"tmp");if(!s_(_))return[];let u=[];for(let T of Cf(_,{withFileTypes:!0})){if(!T.isDirectory())continue;let i=zs(_,T.name,"chats");if(!s_(i))continue;for(let $ of Cf(i,{withFileTypes:!0}))if($.isFile()&&$.name.startsWith("session-")&&$.name.endsWith(".json"))u.push(zs(i,$.name))}return u}var hf={id:"gemini",name:"Gemini",detect(s){let _=Kf(s);return _!=null&&s_(zs(_,"tmp"))},collect(s){let _=Kf(s);if(!_)return[];let u=fr(_),T=[];for(let i of Rr(_))try{if(!ir(i).isFile())continue;let $=af(df(df(i))),f=gr(i,$,u);if(f)T.push(f)}catch{continue}return T}};var pf=[Bf,Vf,nf,hf,Jf];function HT(s){return Bun.hash(s).toString(16)}function Lr(s,_){return`ses_${HT(`${s}\x00${_.sourceSessionId}\x00${_.rawPath}`)}`}function Ir(s,_){return HT(`${s}\x00${_}`)}function Sr(s){return HT(`${s.length}\x00${s.join("\x00")}`)}function Or(s,_,u){s.query(`
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(`
465
576
  INSERT INTO sources (id, name, enabled, scan_paths, config_json, last_sync_at)
466
577
  VALUES ($id, $name, 1, NULL, NULL, $now)
467
578
  ON CONFLICT(id) DO UPDATE SET
468
579
  name = excluded.name,
469
580
  last_sync_at = excluded.last_sync_at
470
- `).run({$id:_.id,$name:_.name,$now:u})}function Ur(s,_){if(!_)return null;try{return m$(s,_).id}catch{return null}}function Nr(s,_,u,T,i){let $=Lr(_.id,u),f=u.messages.map((I)=>Ir(I.role,I.content)),w=Sr(f),g=Ur(s,u.rawProjectPath),R=s.query("SELECT content_hash, first_seen_at FROM sessions WHERE id = ?").get($);if(R&&R.content_hash===w)return s.query("UPDATE sessions SET project_id = $projectId, status = $status, last_seen_at = $now WHERE id = $id").run({$projectId:g,$status:"unchanged",$now:T,$id:$}),i.unchanged+=1,$;let O=R?"changed":"new",L=R?.first_seen_at??T;if(s.query(`
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(`
471
582
  INSERT INTO sessions (
472
583
  id, source_id, source_session_id, project_id, checkout_id, raw_project_path, raw_path,
473
584
  title, message_count, content_hash, status, created_at, updated_at, first_seen_at, last_seen_at
@@ -485,10 +596,10 @@ This skill is initialized for ${Uf[_]}.
485
596
  created_at = excluded.created_at,
486
597
  updated_at = excluded.updated_at,
487
598
  last_seen_at = excluded.last_seen_at
488
- `).run({$id:$,$sourceId:_.id,$sourceSessionId:u.sourceSessionId,$projectId:g,$rawProjectPath:u.rawProjectPath,$rawPath:u.rawPath,$title:u.title,$messageCount:u.messages.length,$contentHash:w,$status:O,$createdAt:u.createdAt,$updatedAt:u.updatedAt,$firstSeenAt:L,$now:T}),s.query("DELETE FROM messages WHERE session_id = ?").run($),u.messages.forEach((I,U)=>{s.query(`
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(`
489
600
  INSERT INTO messages (id, session_id, role, content, timestamp, seq_order, content_hash)
490
601
  VALUES ($id, $sessionId, $role, $content, $timestamp, $seqOrder, $contentHash)
491
- `).run({$id:`msg_${$}_${U}`,$sessionId:$,$role:I.role,$content:I.content,$timestamp:I.timestamp,$seqOrder:U,$contentHash:f[U]})}),O==="new")i.new+=1;else i.changed+=1;return $}function rr(s,_,u,T,i){let $=s.query("SELECT id FROM sessions WHERE source_id = ? AND status != 'source_missing'").all(_);for(let f of $){if(u.has(f.id))continue;s.query("UPDATE sessions SET status = $status, last_seen_at = $now WHERE id = $id").run({$status:"source_missing",$now:T,$id:f.id}),i.sourceMissing+=1}}function cf(s,_){let u=new Date().toISOString(),T=[];for(let i of pf){if(!i.detect(_.homeDir))continue;Or(s,i,u);let $={source:i.id,new:0,changed:0,unchanged:0,sourceMissing:0,total:0},f=i.collect(_.homeDir),w=new Set;s.transaction(()=>{for(let R of f){if(_.projectFilter&&R.rawProjectPath!==_.projectFilter)continue;let O=Nr(s,i,R,u,$);w.add(O),$.total+=1}if(!_.projectFilter)rr(s,i.id,w,u,$)})(),T.push($)}return{bySource:T}}var tf=`llm-iwiki
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
492
603
 
493
604
  Usage:
494
605
  llm-iwiki init
@@ -511,7 +622,7 @@ Usage:
511
622
  llm-iwiki config set <key> <value>
512
623
  llm-iwiki skills [list]
513
624
  llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]
514
- `,vf=`\u7528\u6CD5:
515
- llm-iwiki skills list # \u5217\u51FA\u53EF\u7528 target \u4E0E\u5C06\u5199\u5165\u7684 skill
516
- llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]`;function Q(s,_){return Xr(_)?_:Er(s,_)}function n(s,_){let u=s.indexOf(_);if(u===-1)return null;let T=s[u+1];if(!T||T.startsWith("--"))return null;return T}async function ef(s,_){if(s.length===0||s[0]==="--help"||s[0]==="-h")return _.stdout(tf),0;if(s[0]==="init"){let u=J(_.homeDir);if(e_(u.configDir,{recursive:!0}),!YT(u.configFile))BT(u.configFile,`obsidian_vault = ""
517
- `);let T=Z(u.databaseFile);try{M(T)}finally{T.close()}return _.stdout(`Initialized llm-iwiki at ${u.configDir}`),0}if(s[0]==="doctor"){let u=J(_.homeDir);if(!YT(u.configFile))return _.stderr("llm-iwiki is not initialized. Run: llm-iwiki init"),1;if(!YT(u.databaseFile))return _.stderr("llm-iwiki database is missing. Run: llm-iwiki init"),1;let T=Z(u.databaseFile);try{M(T)}finally{T.close()}return _.stdout(`config: ${u.configFile}`),_.stdout(`database: ${u.databaseFile}`),_.stdout("status: ok"),0}if(s[0]==="sync"){let u=n(s,"--project"),T=J(_.homeDir),i=Z(T.databaseFile);try{M(i);let $=cf(i,{homeDir:_.homeDir??T.homeDir,projectFilter:u?Q(_.cwd,u):null});if($.bySource.length===0)return _.stdout("No collectors detected on this machine."),0;for(let f of $.bySource)_.stdout(`${f.source}: ${f.total} sessions (new ${f.new}, changed ${f.changed}, unchanged ${f.unchanged}, missing ${f.sourceMissing})`);return 0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="projects"&&s[1]==="list"){let u=J(_.homeDir),T=Z(u.databaseFile);try{M(T);let i=k$(T);if(i.length===0)return _.stdout("No projects yet. Run: llm-iwiki sync"),0;for(let $ of i){let f=$.displayName??$.canonicalName;_.stdout(`${$.id} ${$.sessionCount} sessions ${f}`)}return 0}finally{T.close()}}if(s[0]==="projects"&&s[1]==="inspect"){let u=s[2];if(!u)return _.stderr("Usage: llm-iwiki projects inspect <path-or-project-id>"),1;let T=J(_.homeDir),i=Z(T.databaseFile);try{M(i);let $=u.startsWith("proj_")?m_(i,u):is(i,Q(_.cwd,u)),f=Sf(i,$.id);if(_.stdout(`project: ${$.displayName??$.canonicalName}`),_.stdout(`id: ${$.id}`),$.canonicalRepoUrl)_.stdout(`repo: ${$.canonicalRepoUrl}`);_.stdout(`sources: ${f.sources.map((w)=>`${w.source}(${w.sessionCount})`).join(", ")||"none"}`),_.stdout(`sessions: ${f.sessions.length}`);for(let w of f.sessions)_.stdout(` [${w.sourceId}] ${w.title??w.sourceSessionId} (${w.messageCount} msgs, ${w.status})`);return 0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="projects"&&s[1]==="resolve"){let u=s[2]??_.cwd,T=J(_.homeDir),i=Z(T.databaseFile);try{M(i);let $=is(i,Q(_.cwd,u));return _.stdout(JSON.stringify($,null,2)),0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="projects"&&s[1]==="rename"){let u=s[2],T=s[3];if(!u||!T)return _.stderr("Usage: llm-iwiki projects rename <path-or-project-id> <display-name>"),1;let i=J(_.homeDir),$=Z(i.databaseFile);try{M($);let f=u.startsWith("proj_")?OT($,u,T):OT($,is($,Q(_.cwd,u)).id,T);return _.stdout(JSON.stringify(f,null,2)),0}catch(f){return _.stderr(f instanceof Error?f.message:String(f)),1}finally{$.close()}}if(s[0]==="summarize"&&s[1]==="prepare"){let u=s[2]&&!s[2].startsWith("--")?s[2]:"changed";if(u!=="changed"&&u!=="all")return _.stderr("Usage: llm-iwiki summarize prepare [changed|all] --project <path> [--out <file>]"),1;let T=Q(_.cwd,n(s,"--project")??_.cwd),i=n(s,"--out")??xf(XT(T),"summaries-task.md"),$=J(_.homeDir),f=Z($.databaseFile);try{M(f);let w=is(f,T),g=Af(f,w.id,u);return e_(kf(Q(_.cwd,i)),{recursive:!0}),BT(Q(_.cwd,i),g.markdown),_.stdout(`prepared summaries task: ${g.sessionCount} sessions -> ${i}`),0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.close()}}if(s[0]==="summarize"&&s[1]==="apply"){let u=n(s,"--file");if(!u)return _.stderr("Usage: llm-iwiki summarize apply --project <path> --file <summaries.yaml>"),1;let T=J(_.homeDir),i=Z(T.databaseFile);try{M(i);let $=n$(mf(Q(_.cwd,u),"utf8")),f=Pf(i,$);if(_.stdout(`applied summaries: ${f.written}`),f.skipped.length>0)_.stdout(`skipped (unknown session): ${f.skipped.length}`);return 0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="experiences"&&s[1]==="prepare"){let u=n(s,"--from")??"changed-summaries";if(u!=="changed-summaries"&&u!=="all-recent")return _.stderr("Invalid --from. Use changed-summaries or all-recent."),1;let T=Q(_.cwd,n(s,"--project")??_.cwd),i=n(s,"--out")??xf(XT(T),"experiences-task.md"),$=J(_.homeDir),f=Z($.databaseFile);try{M(f);let w=is(f,T),g=x$(f,w.id,u);return e_(kf(Q(_.cwd,i)),{recursive:!0}),BT(Q(_.cwd,i),g.markdown),_.stdout(`prepared experiences task: ${g.summaryCount} summaries -> ${i}`),0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.close()}}if(s[0]==="experiences"&&s[1]==="propose"){let u=n(s,"--file");if(!u)return _.stderr("Usage: llm-iwiki experiences propose --project <path> --file <experiences.yaml>"),1;let T=J(_.homeDir),i=Z(T.databaseFile);try{M(i);let $=C$(mf(Q(_.cwd,u),"utf8")),f=v$(i,$);return _.stdout(`proposed experiences: ${f.written}`),0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="experiences"&&s[1]==="candidates"){let u=n(s,"--project"),T=J(_.homeDir),i=Z(T.databaseFile);try{M(i);let $=u?is(i,Q(_.cwd,u)).id:null,f=e$(i,$);if(f.length===0)return _.stdout("No experience candidates. Run: llm-iwiki experiences propose"),0;for(let w of f)_.stdout(`${w.id} [${w.status}] ${w.confidence??"-"} ${w.proposed_title}`);return 0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="experiences"&&(s[1]==="accept"||s[1]==="reject")){let u=s[2];if(!u)return _.stderr(`Usage: llm-iwiki experiences ${s[1]} <candidate-id>`),1;let T=J(_.homeDir),i=Z(T.databaseFile);try{if(M(i),s[1]==="accept"){let $=o$(i,u);_.stdout(`accepted: ${$.experienceId} (${$.slug}), linked sessions: ${$.linkedSessions}`)}else sf(i,u),_.stdout(`rejected: ${u}`);return 0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}finally{i.close()}}if(s[0]==="config"&&s[1]==="show"){let u=J(_.homeDir),T=IT(u.configFile);return _.stdout(`config: ${u.configFile}`),_.stdout(`obsidian.vault: ${T.obsidianVault??"(unset)"}`),0}if(s[0]==="config"&&s[1]==="set"){let u=s[2],T=s[3];if(!u||T===void 0)return _.stderr("Usage: llm-iwiki config set <key> <value>"),1;let i=J(_.homeDir);e_(i.configDir,{recursive:!0});try{let $=y$(i.configFile,u,T);return _.stdout(`set ${$} = ${T}`),0}catch($){return _.stderr($ instanceof Error?$.message:String($)),1}}if(s[0]==="obsidian"&&s[1]==="export"){let u=J(_.homeDir),T=n(s,"--vault"),i=T?Q(_.cwd,T):IT(u.configFile).obsidianVault;if(!i)return _.stderr("No Obsidian vault configured. Run: llm-iwiki config set obsidian.vault <dir>"),1;let $=Q(_.cwd,n(s,"--project")??_.cwd),f=s.includes("--force"),w=Z(u.databaseFile);try{M(w);let g=is(w,$),R=wf(w,i,g,{force:f});_.stdout(`vault: ${i}`),_.stdout(`exported: created ${R.created}, updated ${R.updated}, forced ${R.forced}, conflicts ${R.conflicts.length}`);for(let O of R.conflicts)_.stdout(` conflict (skipped): ${O}`);if(R.conflicts.length>0&&!f)_.stdout("Re-run with --force to overwrite managed blocks of conflicting notes.");return 0}catch(g){return _.stderr(g instanceof Error?g.message:String(g)),1}finally{w.close()}}if(s[0]==="obsidian"&&s[1]==="check"){let u=J(_.homeDir),T=Z(u.databaseFile);try{M(T);let i=gf(T);_.stdout(`notes: ${i.total}, clean: ${i.clean}, needs attention: ${i.entries.length}`);for(let $ of i.entries)_.stdout(` ${$.status}: ${$.filePath}`);return 0}finally{T.close()}}if(s[0]==="skills"&&s[1]==="init"){let u=n(s,"--target");if(s.includes("--target")&&!u)return _.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;if(u&&!qT.includes(u))return _.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;let T=u,i=Ef({cwd:_.cwd,target:T,force:s.includes("--force"),dryRun:s.includes("--dry-run")});return _.stdout(`skills written: ${i.written.length}`),_.stdout(`skills skipped: ${i.skipped.length}`),0}if(s[0]==="skills"&&(s[1]===void 0||s[1]==="list")){_.stdout(vf),_.stdout(""),_.stdout("\u53EF\u7528 target:");for(let u of rf())_.stdout(` ${u.id} (${u.name})`);_.stdout(""),_.stdout(`\u5C06\u5199\u5165\u7684 skill (\u4F4D\u4E8E ${AT}/):`);for(let u of Xf())_.stdout(` ${u.directory} -> ${u.relPath}`);return 0}if(s[0]==="skills")return _.stderr(`Unknown skills subcommand: ${s[1]}`),_.stderr(vf),1;return _.stderr(`Unknown command: ${s.join(" ")}`),_.stderr(tf),1}var qr=await ef(process.argv.slice(2),{cwd:process.cwd(),stdout:console.log,stderr:console.error});process.exit(qr);
625
+ `,fg=`用法:
626
+ 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);