@codehourra/llm-iwiki 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -8
- package/dist/index.js +189 -190
- package/package.json +8 -4
package/dist/index.js
CHANGED
|
@@ -1,148 +1,147 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`)
|
|
5
|
-
`)?iu(u,_):u.includes(`
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as gg}from"node:module";var P=(u,_)=>()=>(_||u((_={exports:{}}).exports,_),_.exports);var s_=gg(import.meta.url);var r=P((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"),f_=Symbol.for("yaml.seq"),m=Symbol.for("yaml.node.type"),Rg=(u)=>!!u&&typeof u==="object"&&u[m]===us,Sg=(u)=>!!u&&typeof u==="object"&&u[m]===Q$,Ig=(u)=>!!u&&typeof u==="object"&&u[m]===$_,Tg=(u)=>!!u&&typeof u==="object"&&u[m]===N$,V$=(u)=>!!u&&typeof u==="object"&&u[m]===_s,qg=(u)=>!!u&&typeof u==="object"&&u[m]===f_;function M$(u){if(u&&typeof u==="object")switch(u[m]){case $_:case f_:return!0}return!1}function Og(u){if(u&&typeof u==="object")switch(u[m]){case us:case $_:case _s:case f_:return!0}return!1}var Lg=(u)=>(V$(u)||M$(u))&&!!u.anchor;Ug.ALIAS=us;Ug.DOC=Q$;Ug.MAP=$_;Ug.NODE_TYPE=m;Ug.PAIR=N$;Ug.SCALAR=_s;Ug.SEQ=f_;Ug.hasAnchor=Lg;Ug.isAlias=Rg;Ug.isCollection=M$;Ug.isDocument=Sg;Ug.isMap=Ig;Ug.isNode=Og;Ug.isPair=Tg;Ug.isScalar=V$;Ug.isSeq=qg});var Yu=P((Ng)=>{var j=r(),b=Symbol("break visit"),b$=Symbol("skip children"),d=Symbol("remove node");function w_(u,_){let s=E$(_);if(j.isDocument(u)){if(Hu(null,u.contents,s,Object.freeze([u]))===d)u.contents=null}else Hu(null,u,s,Object.freeze([]))}w_.BREAK=b;w_.SKIP=b$;w_.REMOVE=d;function Hu(u,_,s,$){let f=C$(u,_,s,$);if(j.isNode(f)||j.isPair(f))return l$(u,$,f),Hu(u,f,s,$);if(typeof f!=="symbol"){if(j.isCollection(_)){$=Object.freeze($.concat(_));for(let w=0;w<_.items.length;++w){let i=Hu(w,_.items[w],s,$);if(typeof i==="number")w=i-1;else if(i===b)return b;else if(i===d)_.items.splice(w,1),w-=1}}else if(j.isPair(_)){$=Object.freeze($.concat(_));let w=Hu("key",_.key,s,$);if(w===b)return b;else if(w===d)_.key=null;let i=Hu("value",_.value,s,$);if(i===b)return b;else if(i===d)_.value=null}}return f}async function i_(u,_){let s=E$(_);if(j.isDocument(u)){if(await Pu(null,u.contents,s,Object.freeze([u]))===d)u.contents=null}else await Pu(null,u,s,Object.freeze([]))}i_.BREAK=b;i_.SKIP=b$;i_.REMOVE=d;async function Pu(u,_,s,$){let f=await C$(u,_,s,$);if(j.isNode(f)||j.isPair(f))return l$(u,$,f),Pu(u,f,s,$);if(typeof f!=="symbol"){if(j.isCollection(_)){$=Object.freeze($.concat(_));for(let w=0;w<_.items.length;++w){let i=await Pu(w,_.items[w],s,$);if(typeof i==="number")w=i-1;else if(i===b)return b;else if(i===d)_.items.splice(w,1),w-=1}}else if(j.isPair(_)){$=Object.freeze($.concat(_));let w=await Pu("key",_.key,s,$);if(w===b)return b;else if(w===d)_.key=null;let i=await Pu("value",_.value,s,$);if(i===b)return b;else if(i===d)_.value=null}}return f}function E$(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 C$(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 f=j.isAlias($)?"alias":"scalar";throw Error(`Cannot replace node with ${f} parent`)}}Ng.visit=w_;Ng.visitAsync=i_});var ss=P((lg)=>{var K$=r(),bg=Yu(),Eg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Cg=(u)=>u.replace(/[!,[\]{}]/g,(_)=>Eg[_]);class E{constructor(u,_){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E.defaultYaml,u),this.tags=Object.assign({},E.defaultTags,_)}clone(){let u=new E(this.yaml,this.tags);return u.docStart=this.docStart,u}atDocument(){let u=new E(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E.defaultTags);break}return u}add(u,_){if(this.atNextDocument)this.yaml={explicit:E.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E.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[f,w]=s;return this.tags[f]=w,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return _(0,"%YAML directive should contain exactly one part"),!1;let[f]=s;if(f==="1.1"||f==="1.2")return this.yaml.version=f,!0;else{let w=/^\d+\.\d+$/.test(f);return _(6,`Unsupported YAML version ${f}`,w),!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 w=u.slice(2,-1);if(w==="!"||w==="!!")return _(`Verbatim tags aren't resolved, so ${u} is invalid.`),null;if(u[u.length-1]!==">")_("Verbatim tags must end with a >");return w}let[,s,$]=u.match(/^(.*!)([^!]*)$/s);if(!$)_(`The ${u} tag has no suffix`);let f=this.tags[s];if(f)try{return f+decodeURIComponent($)}catch(w){return _(String(w)),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 _+Cg(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 f={};bg.visit(u.contents,(w,i)=>{if(K$.isNode(i)&&i.tag)f[i.tag]=!0}),$=Object.keys(f)}else $=[];for(let[f,w]of s){if(f==="!!"&&w==="tag:yaml.org,2002:")continue;if(!u||$.some((i)=>i.startsWith(w)))_.push(`%TAG ${f} ${w}`)}return _.join(`
|
|
3
|
+
`)}}E.defaultYaml={explicit:!1,version:"1.2"};E.defaultTags={"!!":"tag:yaml.org,2002:"};lg.Directives=E});var g_=P((hg)=>{var y$=r(),yg=Yu();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,f=null;return{onAnchor:(w)=>{s.push(w),f??(f=d$(u));let i=n$(_,f);return f.add(i),i},setAnchors:()=>{for(let w of s){let i=$.get(w);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=w,g}}},sourceObjects:$}}hg.anchorIsValid=dg;hg.anchorNames=d$;hg.createNodeAnchors=ng;hg.findNewAnchor=n$});var $s=P((kg)=>{function ju(u,_,s,$){if($&&typeof $==="object")if(Array.isArray($))for(let f=0,w=$.length;f<w;++f){let i=$[f],g=ju(u,$,String(f),i);if(g===void 0)delete $[f];else if(g!==i)$[f]=g}else if($ instanceof Map)for(let f of Array.from($.keys())){let w=$.get(f),i=ju(u,$,f,w);if(i===void 0)$.delete(f);else if(i!==w)$.set(f,i)}else if($ instanceof Set)for(let f of Array.from($)){let w=ju(u,$,f,f);if(w===void 0)$.delete(f);else if(w!==f)$.delete(f),$.add(w)}else for(let[f,w]of Object.entries($)){let i=ju(u,$,f,w);if(i===void 0)delete $[f];else if(i!==w)$[f]=i}return u.call(_,s,$)}kg.applyReviver=ju});var t=P((vg)=>{var tg=r();function h$(u,_,s){if(Array.isArray(u))return u.map(($,f)=>h$($,String(f),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=(w)=>{$.res=w,delete s.onCreate};let f=u.toJSON(_,s);if(s.onCreate)s.onCreate(f);return f}if(typeof u==="bigint"&&!s?.keep)return Number(u);return u}vg.toJS=h$});var R_=P((_0)=>{var eg=$s(),p$=r(),u0=t();class c${constructor(u){Object.defineProperty(this,p$.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:f}={}){if(!p$.isDocument(u))throw TypeError("A document argument is required");let w={anchors:new Map,doc:u,keep:!0,mapAsMap:_===!0,mapKeyWarned:!1,maxAliasCount:typeof s==="number"?s:100},i=u0.toJS(this,"",w);if(typeof $==="function")for(let{count:g,res:R}of w.anchors.values())$(R,g);return typeof f==="function"?eg.applyReviver(f,{"":i},"",i):i}}_0.NodeBase=c$});var Qu=P((g0)=>{var $0=g_(),f0=Yu(),Du=r(),w0=R_(),i0=t();class m$ extends w0.NodeBase{constructor(u){super(Du.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=[],f0.visit(u,{Node:(f,w)=>{if(Du.isAlias(w)||Du.hasAnchor(w))s.push(w)}}),_)_.aliasResolveCache=s;let $=void 0;for(let f of s){if(f===this)break;if(f.anchor===this.source)$=f}return $}toJSON(u,_){if(!_)return{source:this.source};let{anchors:s,doc:$,maxAliasCount:f}=_,w=this.resolve($,_);if(!w){let g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(g)}let i=s.get(w);if(!i)i0.toJS(w,null,_),i=s.get(w);if(i?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(f>=0){if(i.count+=1,i.aliasCount===0)i.aliasCount=S_($,w,s);if(i.count*i.aliasCount>f)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 f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(f)}if(u.implicitKey)return`${$} `}return $}}function S_(u,_,s){if(Du.isAlias(_)){let $=_.resolve(u),f=s&&$&&s.get($);return f?f.count*f.aliasCount:0}else if(Du.isCollection(_)){let $=0;for(let f of _.items){let w=S_(u,f,s);if(w>$)$=w}return $}else if(Du.isPair(_)){let $=S_(u,_.key,s),f=S_(u,_.value,s);return Math.max($,f)}return 1}g0.Alias=m$});var B=P((O0)=>{var S0=r(),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";O0.Scalar=gu;O0.isScalarValue=q0});var Nu=P((F0)=>{var H0=Qu(),Ru=r(),a$=B(),P0="tag:yaml.org,2002:";function D0(u,_,s){if(_){let $=s.filter((w)=>w.tag===_),f=$.find((w)=>!w.format)??$[0];if(!f)throw Error(`Tag ${_} not found`);return f}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:f,onTagObj:w,schema:i,sourceObjects:g}=s,R=void 0;if($&&u&&typeof u==="object")if(R=g.get(u),R)return R.anchor??(R.anchor=f(u)),new H0.Alias(R.anchor);else R={anchor:null,node:null},g.set(u,R);if(_?.startsWith("!!"))_=P0+_.slice(2);let S=D0(u,_,i.tags);if(!S){if(u&&typeof u.toJSON==="function")u=u.toJSON();if(!u||typeof u!=="object"){let I=new a$.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(w)w(S),delete s.onTagObj;let O=S?.createNode?S.createNode(s.schema,u,s):typeof S?.nodeClass?.from==="function"?S.nodeClass.from(s.schema,u,s):new a$.Scalar(u);if(_)O.tag=_;else if(!S.default)O.tag=S.tag;if(R)R.node=O;return O}F0.createNode=A0});var I_=P((X0)=>{var W0=Nu(),n=r(),G0=R_();function fs(u,_,s){let $=s;for(let f=_.length-1;f>=0;--f){let w=_[f];if(typeof w==="number"&&Number.isInteger(w)&&w>=0){let i=[];i[w]=$,$=i}else $=new Map([[w,$]])}return W0.createNode($,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:u,sourceObjects:new Map})}var k$=(u)=>u==null||typeof u==="object"&&!!u[Symbol.iterator]().next().done;class x$ 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(k$(u))this.add(_);else{let[s,...$]=u,f=this.get(s,!0);if(n.isCollection(f))f.addIn($,_);else if(f===void 0&&this.schema)this.set(s,fs(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,f=this.get(s,!0);if($.length===0)return!_&&n.isScalar(f)?f.value:f;else return n.isCollection(f)?f.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 f=this.get(s,!0);if(n.isCollection(f))f.setIn($,_);else if(f===void 0&&this.schema)this.set(s,fs(this.schema,$,_));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${$}`)}}}X0.Collection=x$;X0.collectionFromPath=fs;X0.isEmptyPath=k$});var Vu=P((j0)=>{var Z0=(u)=>u.replace(/^(?!$)(?: $)?/gm,"#");function ws(u,_){if(/^\n+$/.test(u))return u.substring(1);return _?u.replace(/^(?! *$)/gm,_):u}var Y0=(u,_,s)=>u.endsWith(`
|
|
4
|
+
`)?ws(s,_):s.includes(`
|
|
6
5
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`){if(
|
|
9
|
-
`&&
|
|
10
|
-
`&&
|
|
11
|
-
${_}${
|
|
12
|
-
${_}${
|
|
13
|
-
`)
|
|
14
|
-
`){if(
|
|
15
|
-
|
|
16
|
-
`;while(
|
|
17
|
-
`,
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
19
|
-
${
|
|
6
|
+
`+ws(s,_):(u.endsWith(" ")?"":" ")+s;j0.indentComment=ws;j0.lineComment=Y0;j0.stringifyComment=Z0});var v$=P((b0)=>{function M0(u,_,s="flow",{indentAtStart:$,lineWidth:f=80,minContentWidth:w=20,onFold:i,onOverflow:g}={}){if(!f||f<0)return u;if(f<w)w=0;let R=Math.max(1+w,1+f-_.length);if(u.length<=R)return u;let S=[],O={},I=f-_.length;if(typeof $==="number")if($>f-Math.max(2,w))S.push(0);else I=f-$;let T=void 0,L=void 0,H=!1,q=-1,U=-1,D=-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}D=q}if(z===`
|
|
7
|
+
`){if(s==="block")q=t$(u,q,_.length);I=q+_.length+R,T=void 0}else{if(z===" "&&L&&L!==" "&&L!==`
|
|
8
|
+
`&&L!=="\t"){let W=u[q+1];if(W&&W!==" "&&W!==`
|
|
9
|
+
`&&W!=="\t")T=q}if(q>=I)if(T)S.push(T),I=T+R,T=void 0;else if(s==="quoted"){while(L===" "||L==="\t")L=z,z=u[q+=1],H=!0;let W=q>D+1?q-2:U-1;if(O[W])return u;S.push(W),O[W]=!0,I=W+R,T=void 0}else H=!0}L=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 W=S[z],G=S[z+1]||u.length;if(W===0)F=`
|
|
10
|
+
${_}${u.slice(0,G)}`;else{if(s==="quoted"&&O[W])F+=`${u[W]}\\`;F+=`
|
|
11
|
+
${_}${u.slice(W+1,G)}`}}return F}function t$(u,_,s){let $=_,f=_+1,w=u[f];while(w===" "||w==="\t")if(_<f+s)w=u[++_];else{do w=u[++_];while(w&&w!==`
|
|
12
|
+
`);$=_,f=_+1,w=u[f]}return $}b0.FOLD_BLOCK="block";b0.FOLD_FLOW="flow";b0.FOLD_QUOTED="quoted";b0.foldFlowLines=M0});var bu=P((h0)=>{var K=B(),v=v$(),q_=(u,_)=>({indentAtStart:_?u.indent.length:u.indentAtStart,lineWidth:u.options.lineWidth,minContentWidth:u.options.minContentWidth}),O_=(u)=>/^(%|---|\.\.\.)/m.test(u);function y0(u,_,s){if(!_||_<0)return!1;let $=_-s,f=u.length;if(f<=$)return!1;for(let w=0,i=0;w<f;++w)if(u[w]===`
|
|
13
|
+
`){if(w-i>$)return!0;if(i=w+1,f-i<=$)return!1}return!0}function Mu(u,_){let s=JSON.stringify(u);if(_.options.doubleQuotedAsJSON)return s;let{implicitKey:$}=_,f=_.options.doubleQuotedMinMultiLineLength,w=_.indent||(O_(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 O=s.substr(R+2,4);switch(O){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(O.substr(0,2)==="00")i+="\\x"+O.substr(2);else i+=s.substr(R,6)}R+=5,g=R+1}break;case"n":if($||s[R+2]==='"'||s.length<f)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+=w,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,w,v.FOLD_QUOTED,q_(_,!1))}function is(u,_){if(_.options.singleQuote===!1||_.implicitKey&&u.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(u))return Mu(u,_);let s=_.indent||(O_(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)$=Mu;else{let f=u.includes('"'),w=u.includes("'");if(f&&!w)$=is;else if(w&&!f)$=Mu;else $=s?is:Mu}return $(u,_)}var gs;try{gs=new RegExp(`(^|(?<!
|
|
20
19
|
))
|
|
21
20
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{gs=/\n+(?!\n|$)/g}function T_({comment:u,type:_,value:s},$,f,w){let{blockQuote:i,commentString:g,lineWidth:R}=$.options;if(!i||/\n[\t ]+$/.test(s))return Au(s,$);let S=$.indent||($.forceBlockIndent||O_(s)?" ":""),O=i==="literal"?!0:i==="folded"||_===K.Scalar.BLOCK_FOLDED?!1:_===K.Scalar.BLOCK_LITERAL?!0:!y0(s,R,S.length);if(!s)return O?`|
|
|
23
22
|
`:`>
|
|
24
|
-
`;let
|
|
25
|
-
`&&
|
|
26
|
-
`);if(
|
|
27
|
-
`)
|
|
28
|
-
`)
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
`)||O&&/[[\]{},]/.test(
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${
|
|
36
|
-
${_.indent}${
|
|
37
|
-
${
|
|
38
|
-
`:"",
|
|
39
|
-
${
|
|
40
|
-
`&&
|
|
41
|
-
|
|
42
|
-
`}else
|
|
43
|
-
${
|
|
44
|
-
`),
|
|
45
|
-
${
|
|
46
|
-
`)
|
|
47
|
-
${
|
|
48
|
-
`}}if(
|
|
49
|
-
`+
|
|
50
|
-
`)),
|
|
51
|
-
${
|
|
52
|
-
`;return`${
|
|
53
|
-
${
|
|
54
|
-
`:" ")}return
|
|
55
|
-
${
|
|
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
|
-
`))
|
|
23
|
+
`;let I,T;for(T=s.length;T>0;--T){let G=s[T-1];if(G!==`
|
|
24
|
+
`&&G!=="\t"&&G!==" ")break}let L=s.substring(T),H=L.indexOf(`
|
|
25
|
+
`);if(H===-1)I="-";else if(s===L||H!==L.length-1){if(I="+",w)w()}else I="";if(L){if(s=s.slice(0,-L.length),L[L.length-1]===`
|
|
26
|
+
`)L=L.slice(0,-1);L=L.replace(gs,`$&${S}`)}let q=!1,U,D=-1;for(U=0;U<s.length;++U){let G=s[U];if(G===" ")q=!0;else if(G===`
|
|
27
|
+
`)D=U;else break}let F=s.substring(0,D<U?D+1:U);if(F)s=s.substring(F.length),F=F.replace(/\n+/g,`$&${S}`);let W=(q?S?"2":"1":"")+I;if(u){if(W+=" "+g(u.replace(/ ?[\r\n]+/g," ")),f)f()}if(!O){let G=s.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${S}`),X=!1,J=q_($,!0);if(i!=="folded"&&_!==K.Scalar.BLOCK_FOLDED)J.onOverflow=()=>{X=!0};let A=v.foldFlowLines(`${F}${G}${L}`,S,v.FOLD_BLOCK,J);if(!X)return`>${W}
|
|
29
|
+
${S}${A}`}return s=s.replace(/\n+/g,`$&${S}`),`|${W}
|
|
30
|
+
${S}${F}${s}${L}`}function d0(u,_,s,$){let{type:f,value:w}=u,{actualString:i,implicitKey:g,indent:R,indentStep:S,inFlow:O}=_;if(g&&w.includes(`
|
|
31
|
+
`)||O&&/[[\]{},]/.test(w))return Au(w,_);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(w))return g||O||!w.includes(`
|
|
32
|
+
`)?Au(w,_):T_(u,_,s,$);if(!g&&!O&&f!==K.Scalar.PLAIN&&w.includes(`
|
|
33
|
+
`))return T_(u,_,s,$);if(O_(w)){if(R==="")return _.forceBlockIndent=!0,T_(u,_,s,$);else if(g&&R===S)return Au(w,_)}let I=w.replace(/\n+/g,`$&
|
|
34
|
+
${R}`);if(i){let T=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(I),{compat:L,tags:H}=_.doc.schema;if(H.some(T)||L?.some(T))return Au(w,_)}return g?I:v.foldFlowLines(I,R,v.FOLD_FLOW,q_(_,!1))}function n0(u,_,s,$){let{implicitKey:f,inFlow:w}=_,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=(O)=>{switch(O){case K.Scalar.BLOCK_FOLDED:case K.Scalar.BLOCK_LITERAL:return f||w?Au(i.value,_):T_(i,_,s,$);case K.Scalar.QUOTE_DOUBLE:return Mu(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:O,defaultStringType:I}=_.options,T=f&&O||I;if(S=R(T),S===null)throw Error(`Unsupported default string type ${T}`)}return S}h0.stringifyString=n0});var Eu=P((o0)=>{var c0=g_(),o=r(),m0=Vu(),a0=bu();function k0(u,_){let s=Object.assign({blockQuote:!0,commentString:m0.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 x0(u,_){if(_.tag){let f=u.filter((w)=>w.tag===_.tag);if(f.length>0)return f.find((w)=>w.format===_.format)??f[0]}let s=void 0,$;if(o.isScalar(_)){$=_.value;let f=u.filter((w)=>w.identify?.($));if(f.length>1){let w=f.filter((i)=>i.test);if(w.length>0)f=w}s=f.find((w)=>w.format===_.format)??f.find((w)=>!w.format)}else $=_,s=u.find((f)=>f.nodeClass&&$ instanceof f.nodeClass);if(!s){let f=$?.constructor?.name??($===null?"null":typeof $);throw Error(`Tag not resolved for ${f} value`)}return s}function t0(u,_,{anchors:s,doc:$}){if(!$.directives)return"";let f=[],w=(o.isScalar(u)||o.isCollection(u))&&u.anchor;if(w&&c0.anchorIsValid(w))s.add(w),f.push(`&${w}`);let i=u.tag??(_.default?null:_.tag);if(i)f.push($.directives.tagString(i));return f.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 f=void 0,w=o.isNode(u)?u:_.doc.createNode(u,{onTagObj:(R)=>f=R});f??(f=x0(_.doc.schema.tags,w));let i=t0(w,f,_);if(i.length>0)_.indentAtStart=(_.indentAtStart??0)+i.length+1;let g=typeof f.stringify==="function"?f.stringify(w,_,s,$):o.isScalar(w)?a0.stringifyString(w,_,s,$):w.toString(_,s,$);if(!i)return g;return o.isScalar(w)||g[0]==="{"||g[0]==="["?`${i} ${g}`:`${i}
|
|
35
|
+
${_.indent}${g}`}o0.createStringifyContext=k0;o0.stringify=v0});var uf=P((sR)=>{var a=r(),o$=B(),e$=Eu(),Cu=Vu();function _R({key:u,value:_},s,$,f){let{allNullValues:w,doc:i,indent:g,indentStep:R,options:{commentString:S,indentSeq:O,simpleKeys:I}}=s,T=a.isNode(u)&&u.comment||null;if(I){if(T)throw Error("With simple keys, key nodes cannot have comments");if(a.isCollection(u)||!a.isNode(u)&&typeof u==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!I&&(!u||T&&_==null&&!s.inFlow||a.isCollection(u)||(a.isScalar(u)?u.type===o$.Scalar.BLOCK_FOLDED||u.type===o$.Scalar.BLOCK_LITERAL:typeof u==="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!L&&(I||!w),indent:g+R});let H=!1,q=!1,U=e$.stringify(u,s,()=>H=!0,()=>q=!0);if(!L&&!s.inFlow&&U.length>1024){if(I)throw Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(s.inFlow){if(w||_==null){if(H&&$)$();return U===""?"?":L?`? ${U}`:U}}else if(w&&!I||_==null&&L){if(U=`? ${U}`,T&&!H)U+=Cu.lineComment(U,s.indent,S(T));else if(q&&f)f();return U}if(H)T=null;if(L){if(T)U+=Cu.lineComment(U,s.indent,S(T));U=`? ${U}
|
|
36
|
+
${g}:`}else if(U=`${U}:`,T)U+=Cu.lineComment(U,s.indent,S(T));let D,F,z;if(a.isNode(_))D=!!_.spaceBefore,F=_.commentBefore,z=_.comment;else if(D=!1,F=null,z=null,_&&typeof _==="object")_=i.createNode(_);if(s.implicitKey=!1,!L&&!T&&a.isScalar(_))s.indentAtStart=U.length+1;if(q=!1,!O&&R.length>=2&&!s.inFlow&&!L&&a.isSeq(_)&&!_.flow&&!_.tag&&!_.anchor)s.indent=s.indent.substring(2);let W=!1,G=e$.stringify(_,s,()=>W=!0,()=>q=!0),X=" ";if(T||D||F){if(X=D?`
|
|
37
|
+
`:"",F){let J=S(F);X+=`
|
|
38
|
+
${Cu.indentComment(J,s.indent)}`}if(G===""&&!s.inFlow){if(X===`
|
|
39
|
+
`&&z)X=`
|
|
40
|
+
|
|
41
|
+
`}else X+=`
|
|
42
|
+
${s.indent}`}else if(!L&&a.isCollection(_)){let J=G[0],A=G.indexOf(`
|
|
43
|
+
`),Z=A!==-1,x=s.inFlow??_.flow??_.items.length===0;if(Z||!x){let Uu=!1;if(Z&&(J==="&"||J==="!")){let Y=G.indexOf(" ");if(J==="&"&&Y!==-1&&Y<A&&G[Y+1]==="!")Y=G.indexOf(" ",Y+1);if(Y===-1||A<Y)Uu=!0}if(!Uu)X=`
|
|
44
|
+
${s.indent}`}}else if(G===""||G[0]===`
|
|
45
|
+
`)X="";if(U+=X+G,s.inFlow){if(W&&$)$()}else if(z&&!W)U+=Cu.lineComment(U,s.indent,S(z));else if(q&&f)f();return U}sR.stringifyPair=_R});var Rs=P((iR)=>{var _f=s_("process");function fR(u,..._){if(u==="debug")console.log(..._)}function wR(u,_){if(u==="debug"||u==="warn")if(typeof _f.emitWarning==="function")_f.emitWarning(_);else console.warn(_)}iR.debug=fR;iR.warn=wR});var P_=P((IR)=>{var H_=r(),sf=B(),L_="<<",U_={identify:(u)=>u===L_||typeof u==="symbol"&&u.description===L_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new sf.Scalar(Symbol(L_)),{addToJSMap:$f}),stringify:()=>L_},SR=(u,_)=>(U_.identify(_)||H_.isScalar(_)&&(!_.type||_.type===sf.Scalar.PLAIN)&&U_.identify(_.value))&&u?.doc.schema.tags.some((s)=>s.tag===U_.tag&&s.default);function $f(u,_,s){let $=ff(u,s);if(H_.isSeq($))for(let f of $.items)Ss(u,_,f);else if(Array.isArray($))for(let f of $)Ss(u,_,f);else Ss(u,_,$)}function Ss(u,_,s){let $=ff(u,s);if(!H_.isMap($))throw Error("Merge sources must be maps or map aliases");let f=$.toJSON(null,u,Map);for(let[w,i]of f)if(_ instanceof Map){if(!_.has(w))_.set(w,i)}else if(_ instanceof Set)_.add(w);else if(!Object.prototype.hasOwnProperty.call(_,w))Object.defineProperty(_,w,{value:i,writable:!0,enumerable:!0,configurable:!0});return _}function ff(u,_){return u&&H_.isAlias(_)?_.resolve(u.doc,u):_}IR.addMergeToJSMap=$f;IR.isMergeKey=SR;IR.merge=U_});var Ts=P((DR)=>{var LR=Rs(),wf=P_(),UR=Eu(),gf=r(),Is=t();function HR(u,_,{key:s,value:$}){if(gf.isNode(s)&&s.addToJSMap)s.addToJSMap(u,_,$);else if(wf.isMergeKey(u,s))wf.addMergeToJSMap(u,_,$);else{let f=Is.toJS(s,"",u);if(_ instanceof Map)_.set(f,Is.toJS($,f,u));else if(_ instanceof Set)_.add(f);else{let w=PR(s,f,u),i=Is.toJS($,w,u);if(w in _)Object.defineProperty(_,w,{value:i,writable:!0,enumerable:!0,configurable:!0});else _[w]=i}}return _}function PR(u,_,s){if(_===null)return"";if(typeof _!=="object")return String(_);if(gf.isNode(u)&&s?.doc){let $=UR.createStringifyContext(s.doc,{});$.anchors=new Set;for(let w of s.anchors.keys())$.anchors.add(w.anchor);$.inFlow=!0,$.inStringifyKey=!0;let f=u.toString($);if(!s.mapKeyWarned){let w=JSON.stringify(f);if(w.length>40)w=w.substring(0,36)+'..."';LR.warn(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${w}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return f}return JSON.stringify(_)}DR.addPairToJSMap=HR});var e=P((GR)=>{var Rf=Nu(),FR=uf(),zR=Ts(),D_=r();function WR(u,_,s){let $=Rf.createNode(u,void 0,s),f=Rf.createNode(_,void 0,s);return new A_($,f)}class A_{constructor(u,_=null){Object.defineProperty(this,D_.NODE_TYPE,{value:D_.PAIR}),this.key=u,this.value=_}clone(u){let{key:_,value:s}=this;if(D_.isNode(_))_=_.clone(u);if(D_.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=WR});var qs=P((YR)=>{var Su=r(),Sf=Eu(),F_=Vu();function JR(u,_,s){return(_.inFlow??u.flow?ZR:BR)(u,_,s)}function BR({comment:u,items:_},s,{blockItemPrefix:$,flowChars:f,itemIndent:w,onChompKeep:i,onComment:g}){let{indent:R,options:{commentString:S}}=s,O=Object.assign({},s,{indent:w,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 D=Sf.stringify(q,O,()=>U=null,()=>I=!0);if(U)D+=F_.lineComment(D,w,S(U));if(I&&U)I=!1;T.push($+D)}let L;if(T.length===0)L=f.start+f.end;else{L=T[0];for(let H=1;H<T.length;++H){let q=T[H];L+=q?`
|
|
46
|
+
${R}${q}`:`
|
|
47
|
+
`}}if(u){if(L+=`
|
|
48
|
+
`+F_.indentComment(S(u),R),g)g()}else if(I&&i)i();return L}function ZR({items:u},_,{flowChars:s,itemIndent:$}){let{indent:f,indentStep:w,flowCollectionPadding:i,options:{commentString:g}}=_;$+=w;let R=Object.assign({},_,{indent:$,inFlow:!0,type:null}),S=!1,O=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 D=Sf.stringify(q,R,()=>U=null);if(S||(S=I.length>O||D.includes(`
|
|
49
|
+
`)),H<u.length-1)D+=",";else if(_.options.trailingComma){if(_.options.lineWidth>0)S||(S=I.reduce((F,z)=>F+z.length+2,2)+(D.length+2)>_.options.lineWidth);if(S)D+=","}if(U)D+=F_.lineComment(D,$,g(U));I.push(D),O=I.length}let{start:T,end:L}=s;if(I.length===0)return T+L;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
|
+
${w}${f}${q}`:`
|
|
51
|
+
`;return`${H}
|
|
52
|
+
${f}${L}`}else return`${T}${i}${I.join(" ")}${i}${L}`}}function z_({indent:u,options:{commentString:_}},s,$,f){if($&&f)$=$.replace(/^\n+/,"");if($){let w=F_.indentComment(_($),u);s.push(w.trimStart())}}YR.stringifyCollection=JR});var _u=P((bR)=>{var QR=qs(),NR=Ts(),VR=I_(),uu=r(),W_=e(),MR=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 If 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:f}=s,w=new this(u),i=(g,R)=>{if(typeof f==="function")R=f.call(_,g,R);else if(Array.isArray(f)&&!f.includes(g))return;if(R!==void 0||$)w.items.push(W_.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")w.items.sort(u.sortMapEntries);return w}add(u,_){let s;if(uu.isPair(u))s=u;else if(!u||typeof u!=="object"||!("key"in u))s=new W_.Pair(u,u?.value);else s=new W_.Pair(u.key,u.value);let $=lu(this.items,s.key),f=this.schema?.sortMapEntries;if($){if(!_)throw Error(`Key ${s.key} already set`);if(uu.isScalar($.value)&&MR.isScalarValue(s.value))$.value.value=s.value;else $.value=s.value}else if(f){let w=this.items.findIndex((i)=>f(s,i)<0);if(w===-1)this.items.push(s);else this.items.splice(w,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 W_.Pair(u,_),!0)}toJSON(u,_,s){let $=s?new s:_?.mapAsMap?new Map:{};if(_?.onCreate)_.onCreate($);for(let f of this.items)NR.addPairToJSMap(_,$,f);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:_})}}bR.YAMLMap=If;bR.findPair=lu});var Fu=P((yR)=>{var lR=r(),Tf=_u(),KR={collection:"map",default:!0,nodeClass:Tf.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(u,_){if(!lR.isMap(u))_("Expected a mapping for this tag");return u},createNode:(u,_,s)=>Tf.YAMLMap.from(u,_,s)};yR.map=KR});var su=P((aR)=>{var nR=Nu(),hR=qs(),pR=I_(),X_=r(),cR=B(),mR=t();class qf extends pR.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(u){super(X_.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!_&&X_.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(X_.isScalar($)&&cR.isScalarValue(_))$.value=_;else this.items[s]=_}toJSON(u,_){let s=[];if(_?.onCreate)_.onCreate(s);let $=0;for(let f of this.items)s.push(mR.toJS(f,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,f=new this(u);if(_&&Symbol.iterator in Object(_)){let w=0;for(let i of _){if(typeof $==="function"){let g=_ instanceof Set?i:String(w++);i=$.call(_,g,i)}f.items.push(nR.createNode(i,void 0,s))}}return f}}function G_(u){let _=X_.isScalar(u)?u.value:u;if(_&&typeof _==="string")_=Number(_);return typeof _==="number"&&Number.isInteger(_)&&_>=0?_:null}aR.YAMLSeq=qf});var zu=P((vR)=>{var xR=r(),Of=su(),tR={collection:"seq",default:!0,nodeClass:Of.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(u,_){if(!xR.isSeq(u))_("Expected a sequence for this tag");return u},createNode:(u,_,s)=>Of.YAMLSeq.from(u,_,s)};vR.seq=tR});var Ku=P((_S)=>{var eR=bu(),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 r_=P(($S)=>{var Lf=B(),Uf={identify:(u)=>u==null,createNode:()=>new Lf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Lf.Scalar(null),stringify:({source:u},_)=>typeof u==="string"&&Uf.test.test(u)?u:_.options.nullStr};$S.nullTag=Uf});var Os=P((iS)=>{var wS=B(),Hf={identify:(u)=>typeof u==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(u)=>new wS.Scalar(u[0]==="t"||u[0]==="T"),stringify({source:u,value:_},s){if(u&&Hf.test.test(u)){let $=u[0]==="t"||u[0]==="T";if(_===$)return u}return _?s.options.trueStr:s.options.falseStr}};iS.boolTag=Hf});var Wu=P((SS)=>{function RS({format:u,minFractionDigits:_,tag:s,value:$}){if(typeof $==="bigint")return String($);let f=typeof $==="number"?$:Number($);if(!isFinite(f))return isNaN(f)?".nan":f<0?"-.inf":".inf";let w=Object.is($,-0)?"-0":JSON.stringify($);if(!u&&_&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(w)&&!w.includes("e")){let i=w.indexOf(".");if(i<0)i=w.length,w+=".";let g=_-(w.length-i-1);while(g-- >0)w+="0"}return w}SS.stringifyNumber=RS});var Us=P((US)=>{var TS=B(),Ls=Wu(),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:Ls.stringifyNumber},OS={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():Ls.stringifyNumber(u)}},LS={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:Ls.stringifyNumber};US.float=LS;US.floatExp=OS;US.floatNaN=qS});var Ps=P((WS)=>{var Pf=Wu(),J_=(u)=>typeof u==="bigint"||Number.isInteger(u),Hs=(u,_,s,{intAsBigInt:$})=>$?BigInt(u):parseInt(u.substring(_),s);function Df(u,_,s){let{value:$}=u;if(J_($)&&$>=0)return s+$.toString(_);return Pf.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)=>Df(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:Pf.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)=>Df(u,16,"0x")};WS.int=FS;WS.intHex=zS;WS.intOct=AS});var Af=P((NS)=>{var JS=Fu(),BS=r_(),ZS=zu(),YS=Ku(),jS=Os(),Ds=Us(),As=Ps(),QS=[JS.map,ZS.seq,YS.string,BS.nullTag,jS.boolTag,As.intOct,As.int,As.intHex,Ds.floatNaN,Ds.floatExp,Ds.float];NS.schema=QS});var zf=P((yS)=>{var MS=B(),bS=Fu(),ES=zu();function Ff(u){return typeof u==="bigint"||Number.isInteger(u)}var B_=({value:u})=>JSON.stringify(u),CS=[{identify:(u)=>typeof u==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(u)=>u,stringify:B_},{identify:(u)=>u==null,createNode:()=>new MS.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:Ff,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})=>Ff(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=[bS.map,ES.seq].concat(CS,lS);yS.schema=KS});var zs=P((pS)=>{var yu=s_("buffer"),Fs=B(),nS=bu(),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 f=0;f<s.length;++f)$[f]=s.charCodeAt(f);return $}else return _("This environment does not support reading binary tags; either Buffer or atob is required"),u},stringify({comment:u,type:_,value:s},$,f,w){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),O=Array(S);for(let I=0,T=0;I<S;++I,T+=R)O[I]=g.substr(T,R);g=O.join(_===Fs.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return nS.stringifyString({comment:u,type:_,value:g},$,f,w)}};pS.binary=hS});var Y_=P((xS)=>{var Z_=r(),Ws=e(),mS=B(),aS=su();function Wf(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 f=$.items[0]||new Ws.Pair(new mS.Scalar(null));if($.commentBefore)f.key.commentBefore=f.key.commentBefore?`${$.commentBefore}
|
|
54
|
+
${f.key.commentBefore}`:$.commentBefore;if($.comment){let w=f.value??f.key;w.comment=w.comment?`${$.comment}
|
|
55
|
+
${w.comment}`:$.comment}$=f}u.items[s]=Z_.isPair($)?$:new Ws.Pair($)}else _("Expected a sequence for this tag");return u}function Gf(u,_,s){let{replacer:$}=s,f=new aS.YAMLSeq(u);f.tag="tag:yaml.org,2002:pairs";let w=0;if(_&&Symbol.iterator in Object(_))for(let i of _){if(typeof $==="function")i=$.call(_,String(w++),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;f.items.push(Ws.createPair(g,R,s))}return f}var kS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Wf,createNode:Gf};xS.createPairs=Gf;xS.pairs=kS;xS.resolvePairs=Wf});var Xs=P((_I)=>{var Xf=r(),Gs=t(),du=_u(),eS=su(),rf=Y_();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 f,w;if(Xf.isPair($))f=Gs.toJS($.key,"",_),w=Gs.toJS($.value,f,_);else f=Gs.toJS($,"",_);if(s.has(f))throw Error("Ordered maps must not include duplicate keys");s.set(f,w)}return s}static from(u,_,s){let $=rf.createPairs(u,_,s),f=new this;return f.items=$.items,f}}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=rf.resolvePairs(u,_),$=[];for(let{key:f}of s.items)if(Xf.isScalar(f))if($.includes(f.value))_(`Ordered maps must not include duplicate keys: ${f.value}`);else $.push(f.value);return Object.assign(new Iu,s)},createNode:(u,_,s)=>Iu.from(u,_,s)};_I.YAMLOMap=Iu;_I.omap=uI});var jf=P((fI)=>{var Jf=B();function Bf({value:u,source:_},s){if(_&&(u?Zf:Yf).test.test(_))return _;return u?s.options.trueStr:s.options.falseStr}var Zf={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 Jf.Scalar(!0),stringify:Bf},Yf={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 Jf.Scalar(!1),stringify:Bf};fI.falseTag=Yf;fI.trueTag=Zf});var Qf=P((TI)=>{var gI=B(),rs=Wu(),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:rs.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():rs.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:rs.stringifyNumber};TI.float=II;TI.floatExp=SI;TI.floatNaN=RI});var Vf=P((AI)=>{var Nf=Wu(),nu=(u)=>typeof u==="bigint"||Number.isInteger(u);function j_(u,_,s,{intAsBigInt:$}){let f=u[0];if(f==="-"||f==="+")_+=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 f==="-"?BigInt(-1)*i:i}let w=parseInt(u,s);return f==="-"?-1*w:w}function Js(u,_,s){let{value:$}=u;if(nu($)){let f=$.toString(_);return $<0?"-"+s+f.substr(1):s+f}return Nf.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")},PI={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(u,_,s)=>j_(u,0,10,s),stringify:Nf.stringifyNumber},DI={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=PI;AI.intBin=UI;AI.intHex=DI;AI.intOct=HI});var Bs=P((rI)=>{var V_=r(),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,f=new this(u);if(_&&Symbol.iterator in Object(_))for(let w of _){if(typeof $==="function")w=$.call(_,w,w);f.items.push(Q_.createPair(w,null,s))}return f}}Tu.tag="tag:yaml.org,2002:set";var XI={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}};rI.YAMLSet=Tu;rI.set=XI});var Ys=P((QI)=>{var ZI=Wu();function Zs(u,_){let s=u[0],$=s==="-"||s==="+"?u.substring(1):u,f=(i)=>_?BigInt(i):Number(i),w=$.replace(/_/g,"").split(":").reduce((i,g)=>i*f(60)+f(g),f(0));return s==="-"?f(-1)*w:w}function Mf(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 f=s(60),w=[_%f];if(_<60)w.unshift(0);else if(_=(_-w[0])/f,w.unshift(_%f),_>=60)_=(_-w[0])/f,w.unshift(_);return $+w.map((i)=>String(i).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var YI={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:Mf},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:Mf},bf={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(bf.test);if(!_)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,$,f,w,i,g]=_.map(Number),R=_[7]?Number((_[7]+"00").substr(1,3)):0,S=Date.UTC(s,$-1,f,w||0,i||0,g||0,R),O=_[8];if(O&&O!=="Z"){let I=Zs(O,!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=YI;QI.timestamp=bf});var Cf=P((cI)=>{var bI=Fu(),EI=r_(),CI=zu(),lI=Ku(),KI=zs(),Ef=jf(),js=Qf(),M_=Vf(),yI=P_(),dI=Xs(),nI=Y_(),hI=Bs(),Qs=Ys(),pI=[bI.map,CI.seq,lI.string,EI.nullTag,Ef.trueTag,Ef.falseTag,M_.intBin,M_.intOct,M_.int,M_.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=pI});var af=P((uT)=>{var df=Fu(),aI=r_(),nf=zu(),kI=Ku(),xI=Os(),Ns=Us(),Vs=Ps(),tI=Af(),vI=zf(),hf=zs(),hu=P_(),pf=Xs(),cf=Y_(),lf=Cf(),mf=Bs(),b_=Ys(),Kf=new Map([["core",tI.schema],["failsafe",[df.map,nf.seq,kI.string]],["json",vI.schema],["yaml11",lf.schema],["yaml-1.1",lf.schema]]),yf={binary:hf.binary,bool:xI.boolTag,float:Ns.float,floatExp:Ns.floatExp,floatNaN:Ns.floatNaN,floatTime:b_.floatTime,int:Vs.int,intHex:Vs.intHex,intOct:Vs.intOct,intTime:b_.intTime,map:df.map,merge:hu.merge,null:aI.nullTag,omap:pf.omap,pairs:cf.pairs,seq:nf.seq,set:mf.set,timestamp:b_.timestamp},oI={"tag:yaml.org,2002:binary":hf.binary,"tag:yaml.org,2002:merge":hu.merge,"tag:yaml.org,2002:omap":pf.omap,"tag:yaml.org,2002:pairs":cf.pairs,"tag:yaml.org,2002:set":mf.set,"tag:yaml.org,2002:timestamp":b_.timestamp};function eI(u,_,s){let $=Kf.get(_);if($&&!u)return s&&!$.includes(hu.merge)?$.concat(hu.merge):$.slice();let f=$;if(!f)if(Array.isArray(u))f=[];else{let w=Array.from(Kf.keys()).filter((i)=>i!=="yaml11").map((i)=>JSON.stringify(i)).join(", ");throw Error(`Unknown schema "${_}"; use one of ${w} or define customTags array`)}if(Array.isArray(u))for(let w of u)f=f.concat(w);else if(typeof u==="function")f=u(f.slice());if(s)f=f.concat(hu.merge);return f.reduce((w,i)=>{let g=typeof i==="string"?yf[i]:i;if(!g){let R=JSON.stringify(i),S=Object.keys(yf).map((O)=>JSON.stringify(O)).join(", ");throw Error(`Unknown custom tag ${R}; use one of ${S}`)}if(!w.includes(g))w.push(g);return w},[])}uT.coreKnownTags=oI;uT.getTags=eI});var Es=P((gT)=>{var Ms=r(),$T=Fu(),fT=zu(),wT=Ku(),E_=af(),iT=(u,_)=>u.key<_.key?-1:u.key>_.key?1:0;class bs{constructor({compat:u,customTags:_,merge:s,resolveKnownTags:$,schema:f,sortMapEntries:w,toStringDefaults:i}){this.compat=Array.isArray(u)?E_.getTags(u,"compat"):u?E_.getTags(null,u):null,this.name=typeof f==="string"&&f||"core",this.knownTags=$?E_.coreKnownTags:{},this.tags=E_.getTags(_,this.name,s),this.toStringOptions=i??null,Object.defineProperty(this,Ms.MAP,{value:$T.map}),Object.defineProperty(this,Ms.SCALAR,{value:wT.string}),Object.defineProperty(this,Ms.SEQ,{value:fT.seq}),this.sortMapEntries=typeof w==="function"?w:w===!0?iT:null}clone(){let u=Object.create(bs.prototype,Object.getOwnPropertyDescriptors(this));return u.tags=this.tags.slice(),u}}gT.Schema=bs});var kf=P((TT)=>{var ST=r(),Cs=Eu(),pu=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 f=Cs.createStringifyContext(u,_),{commentString:w}=f.options;if(u.commentBefore){if(s.length!==1)s.unshift("");let R=w(u.commentBefore);s.unshift(pu.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 O=w(u.contents.commentBefore);s.push(pu.indentComment(O,""))}f.forceBlockIndent=!!u.comment,g=u.contents.comment}let R=g?void 0:()=>i=!0,S=Cs.stringify(u.contents,f,()=>g=null,R);if(g)S+=pu.lineComment(S,"",w(g));if((S[0]==="|"||S[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${S}`;else s.push(S)}else s.push(Cs.stringify(u.contents,f));if(u.directives?.docEnd)if(u.comment){let R=w(u.comment);if(R.includes(`
|
|
56
|
+
`))s.push("..."),s.push(pu.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(pu.indentComment(w(R),""))}}return s.join(`
|
|
58
57
|
`)+`
|
|
59
|
-
`}
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
${
|
|
63
|
-
${
|
|
64
|
-
`}};
|
|
65
|
-
`))return!0;if(
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`+
|
|
72
|
-
`.repeat(Math.max(1,
|
|
73
|
-
`;for(let
|
|
74
|
-
`;else if(
|
|
75
|
-
`;else if(!
|
|
76
|
-
`)
|
|
77
|
-
|
|
78
|
-
`;
|
|
79
|
-
`,
|
|
80
|
-
`)
|
|
81
|
-
`;else
|
|
82
|
-
`;else
|
|
83
|
-
`+
|
|
84
|
-
`)
|
|
85
|
-
`;break;default:
|
|
86
|
-
`}let
|
|
87
|
-
`,"sy"),
|
|
88
|
-
`,"sy")}catch{_=/(.*?)[ \t]*\r?\n/sy,
|
|
89
|
-
`)
|
|
90
|
-
`;else
|
|
91
|
-
`)continue;if(
|
|
92
|
-
`){let{fold
|
|
93
|
-
`){
|
|
94
|
-
`){
|
|
95
|
-
`&&!(
|
|
96
|
-
`))u
|
|
97
|
-
|
|
98
|
-
`)break;if(
|
|
99
|
-
`)
|
|
100
|
-
`;_+=1
|
|
101
|
-
`,r:"\r",t:"\t",v:"\v",N:"
|
|
58
|
+
`}TT.stringifyDocument=IT});var cu=P((FT)=>{var OT=Qu(),Gu=I_(),C=r(),LT=e(),UT=t(),HT=Es(),PT=kf(),ls=g_(),DT=$s(),AT=Nu(),Ks=ss();class ys{constructor(u,_,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,C.NODE_TYPE,{value:C.DOC});let $=null;if(typeof _==="function"||Array.isArray(_))$=_;else if(s===void 0&&_)s=_,_=void 0;let f=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=f;let{version:w}=f;if(s?._directives){if(this.directives=s._directives.atDocument(),this.directives.yaml.explicit)w=this.directives.yaml.version}else this.directives=new Ks.Directives({version:w});this.setSchema(w,s),this.contents=u===void 0?null:this.createNode(u,$,s)}clone(){let u=Object.create(ys.prototype,{[C.NODE_TYPE]:{value:C.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=C.isNode(this.contents)?this.contents.clone(u.schema):this.contents,this.range)u.range=this.range.slice();return u}add(u){if(Xu(this.contents))this.contents.add(u)}addIn(u,_){if(Xu(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 OT.Alias(u.anchor)}createNode(u,_,s){let $=void 0;if(typeof _==="function")u=_.call({"":u},"",u),$=_;else if(Array.isArray(_)){let q=(D)=>typeof D==="number"||D instanceof String||D instanceof Number,U=_.filter(q).map(String);if(U.length>0)_=_.concat(U);$=_}else if(s===void 0&&_)s=_,_=void 0;let{aliasDuplicateObjects:f,anchorPrefix:w,flow:i,keepUndefined:g,onTagObj:R,tag:S}=s??{},{onAnchor:O,setAnchors:I,sourceObjects:T}=ls.createNodeAnchors(this,w||"a"),L={aliasDuplicateObjects:f??!0,keepUndefined:g??!1,onAnchor:O,onTagObj:R,replacer:$,schema:this.schema,sourceObjects:T},H=AT.createNode(u,S,L);if(i&&C.isCollection(H))H.flow=!0;return I(),H}createPair(u,_,s={}){let $=this.createNode(u,null,s),f=this.createNode(_,null,s);return new LT.Pair($,f)}delete(u){return Xu(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 Xu(this.contents)?this.contents.deleteIn(u):!1}get(u,_){return C.isCollection(this.contents)?this.contents.get(u,_):void 0}getIn(u,_){if(Gu.isEmptyPath(u))return!_&&C.isScalar(this.contents)?this.contents.value:this.contents;return C.isCollection(this.contents)?this.contents.getIn(u,_):void 0}has(u){return C.isCollection(this.contents)?this.contents.has(u):!1}hasIn(u){if(Gu.isEmptyPath(u))return this.contents!==void 0;return C.isCollection(this.contents)?this.contents.hasIn(u):!1}set(u,_){if(this.contents==null)this.contents=Gu.collectionFromPath(this.schema,[u],_);else if(Xu(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(Xu(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:f,reviver:w}={}){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 f==="function")for(let{count:R,res:S}of i.anchors.values())f(S,R);return typeof w==="function"?DT.applyReviver(w,{"":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 PT.stringifyDocument(this,u)}}function Xu(u){if(C.isCollection(u))return!0;throw Error("Expected a YAML collection as document contents")}FT.Document=ys});var mu=P((GT)=>{class C_ extends Error{constructor(u,_,s,$){super();this.name=u,this.code=s,this.message=$,this.pos=_}}class xf extends C_{constructor(u,_,s){super("YAMLParseError",u,_,s)}}class tf extends C_{constructor(u,_,s){super("YAMLWarning",u,_,s)}}var WT=(u,_)=>(s)=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map((g)=>_.linePos(g));let{line:$,col:f}=s.linePos[0];s.message+=` at line ${$}, column ${f}`;let w=f-1,i=u.substring(_.lineStarts[$-1],_.lineStarts[$]).replace(/[\n\r]+$/,"");if(w>=60&&i.length>80){let g=Math.min(w-39,i.length-79);i="…"+i.substring(g),w-=g-1}if(i.length>80)i=i.substring(0,79)+"…";if($>1&&/^ *$/.test(i.substring(0,w))){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>f)g=Math.max(1,Math.min(R.col-f,80-w));let S=" ".repeat(w)+"^".repeat(g);s.message+=`:
|
|
60
|
+
|
|
61
|
+
${i}
|
|
62
|
+
${S}
|
|
63
|
+
`}};GT.YAMLError=C_;GT.YAMLParseError=xf;GT.YAMLWarning=tf;GT.prettifyError=WT});var au=P((YT)=>{function ZT(u,{flow:_,indicator:s,next:$,offset:f,onError:w,parentIndent:i,startOnNewline:g}){let R=!1,S=g,O=g,I="",T="",L=!1,H=!1,q=null,U=null,D=null,F=null,z=null,W=null,G=null;for(let A of u){if(H){if(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma")w(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")w(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;O=!0;break;case"comment":{if(!O)w(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(!W||s!=="seq-item-ind")R=!0}else T+=A.source;if(S=!0,L=!0,U||D)F=A;O=!0;break;case"anchor":if(U)w(A,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(A.source.endsWith(":"))w(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);U=A,G??(G=A.offset),S=!1,O=!1,H=!0;break;case"tag":{if(D)w(A,"MULTIPLE_TAGS","A node can have at most one tag");D=A,G??(G=A.offset),S=!1,O=!1,H=!0;break}case s:if(U||D)w(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(W)w(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${_??"collection"}`);W=A,S=s==="seq-item-ind"||s==="explicit-key-ind",O=!1;break;case"comma":if(_){if(z)w(A,"UNEXPECTED_TOKEN",`Unexpected , in ${_}`);z=A,S=!1,O=!1;break}default:w(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),S=!1,O=!1}}let X=u[u.length-1],J=X?X.offset+X.source.length:f;if(H&&$&&$.type!=="space"&&$.type!=="newline"&&$.type!=="comma"&&($.type!=="scalar"||$.source!==""))w($.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"))w(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:z,found:W,spaceBefore:R,comment:I,hasNewline:L,anchor:U,tag:D,newlineAfterProp:F,end:J,start:G??J}}YT.resolveProps=ZT});var l_=P((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=P((bT)=>{var VT=l_();function MT(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)}}bT.flowIndentCheck=MT});var hs=P((lT)=>{var vf=r();function CT(u,_,s){let{uniqueKeys:$}=u.options;if($===!1)return!1;let f=typeof $==="function"?$:(w,i)=>w===i||vf.isScalar(w)&&vf.isScalar(i)&&w.value===i.value;return _.some((w)=>f(w.key,s))}lT.mapIncludes=CT});var sw=P((pT)=>{var of=e(),yT=_u(),ef=au(),dT=l_(),uw=ns(),nT=hs(),_w="All mapping items must start at the same column";function hT({composeNode:u,composeEmptyNode:_},s,$,f,w){let g=new(w?.nodeClass??yT.YAMLMap)(s.schema);if(s.atRoot)s.atRoot=!1;let R=$.offset,S=null;for(let O of $.items){let{start:I,key:T,sep:L,value:H}=O,q=ef.resolveProps(I,{indicator:"explicit-key-ind",next:T??L?.[0],offset:R,onError:f,parentIndent:$.indent,startOnNewline:!0}),U=!q.found;if(U){if(T){if(T.type==="block-seq")f(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)f(R,"BAD_INDENT",_w)}if(!q.anchor&&!q.tag&&!L){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))f(T??I[I.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==$.indent)f(R,"BAD_INDENT",_w);s.atKey=!0;let D=q.end,F=T?u(s,T,q,f):_(s,D,I,null,q,f);if(s.schema.compat)uw.flowIndentCheck($.indent,T,f);if(s.atKey=!1,nT.mapIncludes(s,g.items,F))f(D,"DUPLICATE_KEY","Map keys must be unique");let z=ef.resolveProps(L??[],{indicator:"map-value-ind",next:H,offset:F.range[2],onError:f,parentIndent:$.indent,startOnNewline:!T||T.type==="block-scalar"});if(R=z.end,z.found){if(U){if(H?.type==="block-map"&&!z.hasNewline)f(R,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(s.options.strict&&q.start<z.found.offset-1024)f(F.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let W=H?u(s,H,z,f):_(s,R,L,null,z,f);if(s.schema.compat)uw.flowIndentCheck($.indent,H,f);R=W.range[2];let G=new of.Pair(F,W);if(s.options.keepSourceTokens)G.srcToken=O;g.items.push(G)}else{if(U)f(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 W=new of.Pair(F);if(s.options.keepSourceTokens)W.srcToken=O;g.items.push(W)}}if(S&&S<R)f(S,"IMPOSSIBLE","Map comment with trailing content");return g.range=[$.offset,R,S??R],g}pT.resolveBlockMap=hT});var $w=P((tT)=>{var mT=su(),aT=au(),kT=ns();function xT({composeNode:u,composeEmptyNode:_},s,$,f,w){let g=new(w?.nodeClass??mT.YAMLSeq)(s.schema);if(s.atRoot)s.atRoot=!1;if(s.atKey)s.atKey=!1;let R=$.offset,S=null;for(let{start:O,value:I}of $.items){let T=aT.resolveProps(O,{indicator:"seq-item-ind",next:I,offset:R,onError:f,parentIndent:$.indent,startOnNewline:!0});if(!T.found)if(T.anchor||T.tag||I)if(I?.type==="block-seq")f(T.end,"BAD_INDENT","All sequence items must start at the same column");else f(R,"MISSING_CHAR","Sequence item without - indicator");else{if(S=T.end,T.comment)g.comment=T.comment;continue}let L=I?u(s,I,T,f):_(s,T.end,O,null,T,f);if(s.schema.compat)kT.flowIndentCheck($.indent,I,f);R=L.range[2],g.items.push(L)}return g.range=[$.offset,R,S??R],g}tT.resolveBlockSeq=xT});var ru=P((eT)=>{function oT(u,_,s,$){let f="";if(u){let w=!1,i="";for(let g of u){let{source:R,type:S}=g;switch(S){case"space":w=!0;break;case"comment":{if(s&&!w)$(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=R.substring(1)||" ";if(!f)f=O;else f+=i+O;i="";break}case"newline":if(f)i+=R;w=!0;break;default:$(g,"UNEXPECTED_TOKEN",`Unexpected ${S} at node end`)}_+=R.length}}return{comment:f,offset:_}}eT.resolveEnd=oT});var iw=P((Rq)=>{var _q=r(),sq=e(),fw=_u(),$q=su(),fq=ru(),ww=au(),wq=l_(),iq=hs(),ps="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,$,f,w){let i=$.start.source==="{",g=i?"flow map":"flow sequence",S=new(w?.nodeClass??(i?fw.YAMLMap:$q.YAMLSeq))(s.schema);S.flow=!0;let O=s.atRoot;if(O)s.atRoot=!1;if(s.atKey)s.atKey=!1;let I=$.offset+$.start.source.length;for(let U=0;U<$.items.length;++U){let D=$.items[U],{start:F,key:z,sep:W,value:G}=D,X=ww.resolveProps(F,{flow:g,indicator:"explicit-key-ind",next:z??W?.[0],offset:I,onError:f,parentIndent:$.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!W&&!G){if(U===0&&X.comma)f(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${g}`);else if(U<$.items.length-1)f(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${g}`);if(X.comment)if(S.comment)S.comment+=`
|
|
67
|
+
`+X.comment;else S.comment=X.comment;I=X.end;continue}if(!i&&s.options.strict&&wq.containsNewline(z))f(z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(U===0){if(X.comma)f(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${g}`)}else{if(!X.comma)f(X.start,"MISSING_CHAR",`Missing , between ${g} items`);if(X.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;X.comment=X.comment.substring(J.length+1)}}}if(!i&&!W&&!X.found){let J=G?u(s,G,X,f):_(s,X.end,W,null,X,f);if(S.items.push(J),I=J.range[2],cs(G))f(J.range,"BLOCK_IN_FLOW",ps)}else{s.atKey=!0;let J=X.end,A=z?u(s,z,X,f):_(s,J,F,null,X,f);if(cs(z))f(A.range,"BLOCK_IN_FLOW",ps);s.atKey=!1;let Z=ww.resolveProps(W??[],{flow:g,indicator:"map-value-ind",next:G,offset:A.range[2],onError:f,parentIndent:$.indent,startOnNewline:!1});if(Z.found){if(!i&&!X.found&&s.options.strict){if(W)for(let Y of W){if(Y===Z.found)break;if(Y.type==="newline"){f(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(X.start<Z.found.offset-1024)f(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]===":")f(G,"MISSING_CHAR",`Missing space after : in ${g}`);else f(Z.start,"MISSING_CHAR",`Missing , or : between ${g} items`);let x=G?u(s,G,Z,f):Z.found?_(s,Z.end,W,null,Z,f):null;if(x){if(cs(G))f(x.range,"BLOCK_IN_FLOW",ps)}else if(Z.comment)if(A.comment)A.comment+=`
|
|
69
|
+
`+Z.comment;else A.comment=Z.comment;let Uu=new sq.Pair(A,x);if(s.options.keepSourceTokens)Uu.srcToken=D;if(i){let Y=S;if(iq.mapIncludes(s,Y.items,A))f(J,"DUPLICATE_KEY","Map keys must be unique");Y.items.push(Uu)}else{let Y=new fw.YAMLMap(s.schema);Y.flow=!0,Y.items.push(Uu);let j$=(x??A).range;Y.range=[A.range[0],j$[1],j$[2]],S.items.push(Y)}I=x?x.range[2]:Z.end}}let T=i?"}":"]",[L,...H]=$.end,q=I;if(L?.source===T)q=L.offset+L.source.length;else{let U=g[0].toUpperCase()+g.substring(1),D=O?`${U} must end with a ${T}`:`${U} in block collection must be sufficiently indented and end with a ${T}`;if(f(I,O?"MISSING_CHAR":"BAD_INDENT",D),L&&L.source.length!==1)H.unshift(L)}if(H.length>0){let U=fq.resolveEnd(H,q,s.options.strict,f);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 gw=P((Dq)=>{var Iq=r(),Tq=B(),qq=_u(),Oq=su(),Lq=sw(),Uq=$w(),Hq=iw();function ms(u,_,s,$,f,w){let i=s.type==="block-map"?Lq.resolveBlockMap(u,_,s,$,w):s.type==="block-seq"?Uq.resolveBlockSeq(u,_,s,$,w):Hq.resolveFlowCollection(u,_,s,$,w),g=i.constructor;if(f==="!"||f===g.tagName)return i.tag=g.tagName,i;if(f)i.tag=f;return i}function Pq(u,_,s,$,f){let w=$.tag,i=!w?null:_.directives.tagName(w.source,(T)=>f(w,"TAG_RESOLVE_FAILED",T));if(s.type==="block-seq"){let{anchor:T,newlineAfterProp:L}=$,H=T&&w?T.offset>w.offset?T:w:T??w;if(H&&(!L||L.offset<H.offset))f(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(!w||!i||i==="!"||i===qq.YAMLMap.tagName&&g==="map"||i===Oq.YAMLSeq.tagName&&g==="seq")return ms(u,_,s,f,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)f(w,"BAD_COLLECTION_TYPE",`${T.tag} used for ${g} collection, but expects ${T.collection??"scalar"}`,!0);else f(w,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,!0);return ms(u,_,s,f,i)}}let S=ms(u,_,s,f,i,R),O=R.resolve?.(S,(T)=>f(w,"TAG_RESOLVE_FAILED",T),_.options)??S,I=Iq.isNode(O)?O:new Tq.Scalar(O);if(I.range=S.range,I.tag=i,R?.format)I.format=R.format;return I}Dq.composeCollection=Pq});var ks=P((Gq)=>{var as=B();function Fq(u,_,s){let $=_.offset,f=zq(_,u.options.strict,s);if(!f)return{value:"",type:null,comment:"",range:[$,$,$]};let w=f.mode===">"?as.Scalar.BLOCK_FOLDED:as.Scalar.BLOCK_LITERAL,i=_.source?Wq(_.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=f.chomp==="+"&&i.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,i.length-1)):"",U=$+f.length;if(_.source)U+=_.source.length;return{value:q,type:w,comment:f.comment,range:[$,U,U]}}let R=_.indent+f.indent,S=_.offset+f.length,O=0;for(let q=0;q<g;++q){let[U,D]=i[q];if(D===""||D==="\r"){if(f.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(f.indent===0)R=U.length;if(O=q,R===0&&!u.atRoot)s(S,"BAD_INDENT","Block scalar values in collections must be indented");break}S+=U.length+D.length+1}for(let q=i.length-1;q>=g;--q)if(i[q][0].length>R)g=q+1;let I="",T="",L=!1;for(let q=0;q<O;++q)I+=i[q][0].slice(R)+`
|
|
72
|
+
`;for(let q=O;q<g;++q){let[U,D]=i[q];S+=U.length+D.length+1;let F=D[D.length-1]==="\r";if(F)D=D.slice(0,-1);if(D&&U.length<R){let W=`Block scalar lines must not be less indented than their ${f.indent?"explicit indentation indicator":"first line"}`;s(S-D.length-(F?2:1),"BAD_INDENT",W),U=""}if(w===as.Scalar.BLOCK_LITERAL)I+=T+U.slice(R)+D,T=`
|
|
73
|
+
`;else if(U.length>R||D[0]==="\t"){if(T===" ")T=`
|
|
74
|
+
`;else if(!L&&T===`
|
|
75
|
+
`)T=`
|
|
76
|
+
|
|
77
|
+
`;I+=T+U.slice(R)+D,T=`
|
|
78
|
+
`,L=!0}else if(D==="")if(T===`
|
|
79
|
+
`)I+=`
|
|
80
|
+
`;else T=`
|
|
81
|
+
`;else I+=T+D,T=" ",L=!1}switch(f.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=$+f.length+_.source.length;return{value:I,type:w,comment:f.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:f}=_[0],w=f[0],i=0,g="",R=-1;for(let T=1;T<f.length;++T){let L=f[T];if(!g&&(L==="-"||L==="+"))g=L;else{let H=Number(L);if(!i&&H)i=H;else if(R===-1)R=u+T}}if(R!==-1)$(R,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${f}`);let S=!1,O="",I=f.length;for(let T=1;T<_.length;++T){let L=_[T];switch(L.type){case"space":S=!0;case"newline":I+=L.source.length;break;case"comment":if(s&&!S)$(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");I+=L.source.length,O=L.source.substring(1);break;case"error":$(L,"UNEXPECTED_TOKEN",L.message),I+=L.source.length;break;default:{let H=`Unexpected token in block scalar header: ${L.type}`;$(L,"UNEXPECTED_TOKEN",H);let q=L.source;if(q&&typeof q==="string")I+=q.length}}}return{mode:w,indent:i,chomp:g,comment:O,length:I}}function Wq(u){let _=u.split(/\n( *)/),s=_[0],$=s.match(/^( *)/),w=[$?.[1]?[$[1],s.slice($[1].length)]:["",s]];for(let i=1;i<_.length;i+=2)w.push([_[i],_[i+1]]);return w}Gq.resolveBlockScalar=Fq});var ts=P((Vq)=>{var xs=B(),rq=ru();function Jq(u,_,s){let{offset:$,type:f,source:w,end:i}=u,g,R,S=(T,L,H)=>s($+T,L,H);switch(f){case"scalar":g=xs.Scalar.PLAIN,R=Bq(w,S);break;case"single-quoted-scalar":g=xs.Scalar.QUOTE_SINGLE,R=Zq(w,S);break;case"double-quoted-scalar":g=xs.Scalar.QUOTE_DOUBLE,R=Yq(w,S);break;default:return s(u,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${f}`),{value:"",type:null,comment:"",range:[$,$+w.length,$+w.length]}}let O=$+w.length,I=rq.resolveEnd(i,O,_,s);return{value:R,type:g,comment:I.comment,range:[$,O,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 Rw(u)}function Zq(u,_){if(u[u.length-1]!=="'"||u.length===1)_(u.length,"MISSING_CHAR","Missing closing 'quote");return Rw(u.slice(1,-1)).replace(/''/g,"'")}function Rw(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 f=$[1],w=" ",i=_.lastIndex;s.lastIndex=i;while($=s.exec(u)){if($[1]==="")if(w===`
|
|
88
|
+
`)f+=w;else w=`
|
|
89
|
+
`;else f+=w+$[1],w=" ";i=s.lastIndex}let g=/[ \t]*(.*)/sy;return g.lastIndex=i,$=g.exec(u),f+w+($?.[1]??"")}function Yq(u,_){let s="";for(let $=1;$<u.length-1;++$){let f=u[$];if(f==="\r"&&u[$+1]===`
|
|
90
|
+
`)continue;if(f===`
|
|
91
|
+
`){let{fold:w,offset:i}=jq(u,$);s+=w,$=i}else if(f==="\\"){let w=u[++$],i=Qq[w];if(i)s+=i;else if(w===`
|
|
92
|
+
`){w=u[$+1];while(w===" "||w==="\t")w=u[++$+1]}else if(w==="\r"&&u[$+1]===`
|
|
93
|
+
`){w=u[++$+1];while(w===" "||w==="\t")w=u[++$+1]}else if(w==="x"||w==="u"||w==="U"){let g=w==="x"?2:w==="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(f===" "||f==="\t"){let w=$,i=u[$+1];while(i===" "||i==="\t")i=u[++$+1];if(i!==`
|
|
94
|
+
`&&!(i==="\r"&&u[$+2]===`
|
|
95
|
+
`))s+=$>w?u.slice(w,$+1):f}else s+=f}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 f=u.substr(_,s),i=f.length===s&&/^[0-9a-fA-F]+$/.test(f)?parseInt(f,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 Iw=P((yq)=>{var qu=r(),Sw=B(),bq=ks(),Eq=ts();function Cq(u,_,s,$){let{value:f,type:w,comment:i,range:g}=_.type==="block-scalar"?bq.resolveBlockScalar(u,_,$):Eq.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,f,R,s,$);else if(_.type==="scalar")S=Kq(u,f,_,$);else S=u.schema[qu.SCALAR];let O;try{let I=S.resolve(f,(T)=>$(s??_,"TAG_RESOLVE_FAILED",T),u.options);O=qu.isScalar(I)?I:new Sw.Scalar(I)}catch(I){let T=I instanceof Error?I.message:String(I);$(s??_,"TAG_RESOLVE_FAILED",T),O=new Sw.Scalar(f)}if(O.range=g,O.source=f,w)O.type=w;if(R)O.tag=R;if(S.format)O.format=S.format;if(i)O.comment=i;return O}function lq(u,_,s,$,f){if(s==="!")return u[qu.SCALAR];let w=[];for(let g of u.tags)if(!g.collection&&g.tag===s)if(g.default&&g.test)w.push(g);else return g;for(let g of w)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 f($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),u[qu.SCALAR]}function Kq({atKey:u,directives:_,schema:s},$,f,w){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),O=`Value may be parsed as either ${R} or ${S}`;w(f,"TAG_RESOLVE_FAILED",O,!0)}}return i}yq.composeScalar=Cq});var Tw=P((hq)=>{function nq(u,_,s){if(_){s??(s=_.length);for(let $=s-1;$>=0;--$){let f=_[$];switch(f.type){case"space":case"comment":case"newline":u-=f.source.length;continue}f=_[++$];while(f?.type==="space")u+=f.source.length,f=_[++$];break}}return u}hq.emptyScalarPosition=nq});var Lw=P((oq)=>{var cq=Qu(),mq=r(),aq=gw(),qw=Iw(),kq=ru(),xq=Tw(),tq={composeNode:Ow,composeEmptyNode:vs};function Ow(u,_,s,$){let f=u.atKey,{spaceBefore:w,comment:i,anchor:g,tag:R}=s,S,O=!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=qw.composeScalar(u,_,R,$),g)S.anchor=g.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(S=aq.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),O=!1}}if(S??(S=vs(u,_.offset,void 0,null,s,$)),g&&S.anchor==="")$(g,"BAD_ALIAS","Anchor cannot be an empty string");if(f&&u.options.stringKeys&&(!mq.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(w)S.spaceBefore=!0;if(i)if(_.type==="scalar"&&_.source==="")S.comment=i;else S.commentBefore=i;if(u.options.keepSourceTokens&&O)S.srcToken=_;return S}function vs(u,_,s,$,{spaceBefore:f,comment:w,anchor:i,tag:g,end:R},S){let O={type:"scalar",offset:xq.emptyScalarPosition(_,s,$),indent:-1,source:""},I=qw.composeScalar(u,O,g,S);if(i){if(I.anchor=i.source.substring(1),I.anchor==="")S(i,"BAD_ALIAS","Anchor cannot be an empty string")}if(f)I.spaceBefore=!0;if(w)I.comment=w,I.range[2]=R;return I}function vq({options:u},{offset:_,source:s,end:$},f){let w=new cq.Alias(s.substring(1));if(w.source==="")f(_,"BAD_ALIAS","Alias cannot be an empty string");if(w.source.endsWith(":"))f(_+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let i=_+s.length,g=kq.resolveEnd($,i,u.strict,f);if(w.range=[_,i,g.offset],g.comment)w.comment=g.comment;return w}oq.composeEmptyNode=vs;oq.composeNode=Ow});var Hw=P((w1)=>{var _1=cu(),Uw=Lw(),s1=ru(),$1=au();function f1(u,_,{offset:s,start:$,value:f,end:w},i){let g=Object.assign({_directives:_},u),R=new _1.Document(void 0,g),S={atKey:!1,atRoot:!0,directives:R.directives,options:R.options,schema:R.schema},O=$1.resolveProps($,{indicator:"doc-start",next:f??w?.[0],offset:s,onError:i,parentIndent:0,startOnNewline:!0});if(O.found){if(R.directives.docStart=!0,f&&(f.type==="block-map"||f.type==="block-seq")&&!O.hasNewline)i(O.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}R.contents=f?Uw.composeNode(S,f,O,i):Uw.composeEmptyNode(S,O.end,$,null,O,i);let I=R.contents.range[2],T=s1.resolveEnd(w,I,!1,i);if(T.comment)R.comment=T.comment;return R.range=[s,I,T.offset],R}w1.composeDoc=f1});var os=P((q1)=>{var g1=s_("process"),R1=ss(),S1=cu(),ku=mu(),Pw=r(),I1=Hw(),T1=ru();function xu(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 Dw(u){let _="",s=!1,$=!1;for(let f=0;f<u.length;++f){let w=u[f];switch(w[0]){case"#":_+=(_===""?"":$?`
|
|
102
101
|
|
|
103
102
|
`:`
|
|
104
|
-
`)+(
|
|
105
|
-
${
|
|
106
|
-
${
|
|
107
|
-
${
|
|
108
|
-
${_.comment}`:_.comment}this.doc.range[2]=_.offset;break}default:this.errors.push(new
|
|
109
|
-
`}];switch(
|
|
110
|
-
`),O=
|
|
111
|
-
`,
|
|
112
|
-
`});return{type:"block-scalar",offset
|
|
113
|
-
`)
|
|
114
|
-
`;if(
|
|
115
|
-
`});for(let
|
|
116
|
-
`};delete
|
|
103
|
+
`)+(w.substring(1)||" "),s=!0,$=!1;break;case"%":if(u[f+1]?.[0]!=="#")f+=1;s=!1;break;default:if(!s)$=!0;s=!1}}return{comment:_,afterEmptyLine:$}}class Aw{constructor(u={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(_,s,$,f)=>{let w=xu(_);if(f)this.warnings.push(new ku.YAMLWarning(w,s,$));else this.errors.push(new ku.YAMLParseError(w,s,$))},this.directives=new R1.Directives({version:u.version||"1.2"}),this.options=u}decorate(u,_){let{comment:s,afterEmptyLine:$}=Dw(this.prelude);if(s){let f=u.contents;if(_)u.comment=u.comment?`${u.comment}
|
|
104
|
+
${s}`:s;else if($||u.directives.docStart||!f)u.commentBefore=s;else if(Pw.isCollection(f)&&!f.flow&&f.items.length>0){let w=f.items[0];if(Pw.isPair(w))w=w.key;let i=w.commentBefore;w.commentBefore=i?`${s}
|
|
105
|
+
${i}`:s}else{let w=f.commentBefore;f.commentBefore=w?`${s}
|
|
106
|
+
${w}`:s}}if(_){for(let f=0;f<this.errors.length;++f)u.errors.push(this.errors[f]);for(let f=0;f<this.warnings.length;++f)u.warnings.push(this.warnings[f])}else u.errors=this.errors,u.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Dw(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(g1.env.LOG_STREAM)console.dir(u,{depth:null});switch(u.type){case"directive":this.directives.add(u.source,(_,s,$)=>{let f=xu(u);f[0]+=_,this.onError(f,"BAD_DIRECTIVE",s,$)}),this.prelude.push(u.source),this.atDirectives=!0;break;case"document":{let _=I1.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 ku.YAMLParseError(xu(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 ku.YAMLParseError(xu(u),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let _=T1.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 ku.YAMLParseError(xu(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 S1.Document(void 0,s);if(this.atDirectives)this.onError(_,"MISSING_CHAR","Missing directives-end indicator line");$.range=[0,_,_],this.decorate($,!1),yield $}}}q1.Composer=Aw});var Ww=P((z1)=>{var L1=ks(),U1=ts(),H1=mu(),Fw=bu();function P1(u,_=!0,s){if(u){let $=(f,w,i)=>{let g=typeof f==="number"?f:Array.isArray(f)?f[0]:f.offset;if(s)s(g,w,i);else throw new H1.YAMLParseError([g,g+1],w,i)};switch(u.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return U1.resolveFlowScalar(u,_,$);case"block-scalar":return L1.resolveBlockScalar({options:{strict:_}},u,$)}}return null}function D1(u,_){let{implicitKey:s=!1,indent:$,inFlow:f=!1,offset:w=-1,type:i="PLAIN"}=_,g=Fw.stringifyString({type:i,value:u},{implicitKey:s,indent:$>0?" ".repeat($):"",inFlow:f,options:{blockQuote:!0,lineWidth:-1}}),R=_.end??[{type:"newline",offset:-1,indent:$,source:`
|
|
108
|
+
`}];switch(g[0]){case"|":case">":{let S=g.indexOf(`
|
|
109
|
+
`),O=g.substring(0,S),I=g.substring(S+1)+`
|
|
110
|
+
`,T=[{type:"block-scalar-header",offset:w,indent:$,source:O}];if(!zw(T,R))T.push({type:"newline",offset:-1,indent:$,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:w,indent:$,props:T,source:I}}case'"':return{type:"double-quoted-scalar",offset:w,indent:$,source:g,end:R};case"'":return{type:"single-quoted-scalar",offset:w,indent:$,source:g,end:R};default:return{type:"scalar",offset:w,indent:$,source:g,end:R}}}function A1(u,_,s={}){let{afterKey:$=!1,implicitKey:f=!1,inFlow:w=!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=Fw.stringifyString({type:i,value:_},{implicitKey:f||g===null,indent:g!==null&&g>0?" ".repeat(g):"",inFlow:w,options:{blockQuote:!0,lineWidth:-1}});switch(R[0]){case"|":case">":F1(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 F1(u,_){let s=_.indexOf(`
|
|
112
|
+
`),$=_.substring(0,s),f=_.substring(s+1)+`
|
|
113
|
+
`;if(u.type==="block-scalar"){let w=u.props[0];if(w.type!=="block-scalar-header")throw Error("Invalid block scalar header");w.source=$,u.source=f}else{let{offset:w}=u,i="indent"in u?u.indent:-1,g=[{type:"block-scalar-header",offset:w,indent:i,source:$}];if(!zw(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:f})}}function zw(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),f=_.length;if(u.props[0].type==="block-scalar-header")f-=u.props[0].source.length;for(let w of $)w.offset+=f;delete u.props,Object.assign(u,{type:s,source:_,end:$});break}case"block-map":case"block-seq":{let f={type:"newline",offset:u.offset+_.length,indent:u.indent,source:`
|
|
115
|
+
`};delete u.items,Object.assign(u,{type:s,source:_,end:[f]});break}default:{let $="indent"in u?u.indent:-1,f="end"in u&&Array.isArray(u.end)?u.end.filter((w)=>w.type==="space"||w.type==="comment"||w.type==="newline"):[];for(let w of Object.keys(u))if(w!=="type"&&w!=="offset")delete u[w];Object.assign(u,{type:s,indent:$,source:_,end:f})}}}z1.createScalarToken=D1;z1.resolveAsScalar=P1;z1.setScalarValue=A1});var Gw=P((J1)=>{var r1=(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 f="";for(let w of u)f+=w.source;if(_)f+=y_(_);if(s)for(let w of s)f+=w.source;if($)f+=y_($);return f}J1.stringify=r1});var Jw=P((Y1)=>{var u$=Symbol("break visit"),Z1=Symbol("skip children"),Xw=Symbol("remove item");function Ou(u,_){if("type"in u&&u.type==="document")u={start:u.start,value:u.value};rw(Object.freeze([]),u,_)}Ou.BREAK=u$;Ou.SKIP=Z1;Ou.REMOVE=Xw;Ou.itemAtPath=(u,_)=>{let s=u;for(let[$,f]of _){let w=s?.[$];if(w&&"items"in w)s=w.items[f];else return}return s};Ou.parentCollection=(u,_)=>{let s=Ou.itemAtPath(u,_.slice(0,-1)),$=_[_.length-1][0],f=s?.[$];if(f&&"items"in f)return f;throw Error("Parent collection not found")};function rw(u,_,s){let $=s(_,u);if(typeof $==="symbol")return $;for(let f of["key","value"]){let w=_[f];if(w&&"items"in w){for(let i=0;i<w.items.length;++i){let g=rw(Object.freeze(u.concat([[f,i]])),w.items[i],s);if(typeof g==="number")i=g-1;else if(g===u$)return u$;else if(g===Xw)w.items.splice(i,1),i-=1}if(typeof $==="function"&&f==="key")$=$(_,u)}}return typeof $==="function"?$(_,u):$}Y1.visit=Ou});var d_=P((C1)=>{var _$=Ww(),Q1=Gw(),N1=Jw(),s$="\uFEFF",$$="\x02",f$="\x18",w$="\x1F",V1=(u)=>!!u&&("items"in u),M1=(u)=>!!u&&(u.type==="scalar"||u.type==="single-quoted-scalar"||u.type==="double-quoted-scalar"||u.type==="block-scalar");function b1(u){switch(u){case s$:return"<BOM>";case $$:return"<DOC>";case f$:return"<FLOW_END>";case w$:return"<SCALAR>";default:return JSON.stringify(u)}}function E1(u){switch(u){case s$:return"byte-order-mark";case $$:return"doc-mode";case f$:return"flow-error-end";case w$: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(
|
|
119
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
120
|
-
\r `)
|
|
121
|
-
`)return!0;if(_==="\r")return this.buffer[
|
|
122
|
-
`;return!1}charAt(
|
|
123
|
-
|
|
124
|
-
`||
|
|
125
|
-
`,this.pos),this.lineEndPos=
|
|
126
|
-
`,this.pos);if(
|
|
127
|
-
`,
|
|
128
|
-
`:
|
|
129
|
-
`)break}default:break
|
|
130
|
-
`,
|
|
131
|
-
`)
|
|
132
|
-
`&&
|
|
133
|
-
`)
|
|
134
|
-
`,
|
|
135
|
-
`){let
|
|
136
|
-
`)return yield*this.pushCount(1);else if(
|
|
137
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(
|
|
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}C1.createScalarToken=_$.createScalarToken;C1.resolveAsScalar=_$.resolveAsScalar;C1.setScalarValue=_$.setScalarValue;C1.stringify=Q1.stringify;C1.visit=N1.visit;C1.BOM=s$;C1.DOCUMENT=$$;C1.FLOW_END=f$;C1.SCALAR=w$;C1.isCollection=V1;C1.isScalar=M1;C1.prettyToken=b1;C1.tokenType=E1});var g$=P((e1)=>{var tu=d_();function y(u){switch(u){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var Bw=new Set("0123456789ABCDEFabcdef"),v1=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),n_=new Set(",[]{}"),o1=new Set(` ,[]{}
|
|
119
|
+
\r `),i$=(u)=>!u||o1.has(u);class Zw{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 f=u[s-1];if(f===" "||f==="\t"){_=s-1;break}else s=u.indexOf("#",s+1)}while(!0){let f=u[_-1];if(f===" "||f==="\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 f=0;while($[f]===",")f+=yield*this.pushCount(1),f+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(f+=yield*this.pushIndicators(),$[f]){case void 0:return"flow";case"#":return yield*this.pushCount($.length-f),"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 w=this.charAt(1);if(this.flowKey||y(w)||w===",")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 f=0;while(this.buffer[_-1-f]==="\\")f+=1;if(f%2===0)break;_=this.buffer.indexOf('"',_+1)}let s=this.buffer.substring(0,_),$=s.indexOf(`
|
|
125
|
+
`,this.pos);if($!==-1){while($!==-1){let f=this.continueScalar($+1);if(f===-1)break;$=s.indexOf(`
|
|
126
|
+
`,f)}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 f=this.pos;s=this.buffer[f];++f)switch(s){case" ":_+=1;break;case`
|
|
127
|
+
`:u=f,_=0;break;case"\r":{let w=this.buffer[f+1];if(!w&&!this.atEnd)return this.setNext("block-scalar");if(w===`
|
|
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 f=this.continueScalar(u+1);if(f===-1)break;u=this.buffer.indexOf(`
|
|
129
|
+
`,f)}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 f=u-1,w=this.buffer[f];if(w==="\r")w=this.buffer[--f];let i=f;while(w===" ")w=this.buffer[--f];if(w===`
|
|
131
|
+
`&&f>=this.pos&&f+1+_>i)u=f;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 f=this.buffer[s+1];if(y(f)||u&&n_.has(f))break;_=s}else if(y($)){let f=this.buffer[s+1];if($==="\r")if(f===`
|
|
132
|
+
`)s+=1,$=`
|
|
133
|
+
`,f=this.buffer[s+1];else _=s;if(f==="#"||u&&n_.has(f))break;if($===`
|
|
134
|
+
`){let w=this.continueScalar(s+1);if(w===-1)break;s=Math.max(s,w-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(v1.has(_))_=this.buffer[++u];else if(_==="%"&&Bw.has(this.buffer[u+1])&&Bw.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)}}e1.Lexer=Zw});var R$=P((_O)=>{class Yw{constructor(){this.lineStarts=[],this.addNewLine=(u)=>this.lineStarts.push(u),this.linePos=(u)=>{let _=0,s=this.lineStarts.length;while(_<s){let f=_+s>>1;if(this.lineStarts[f]<u)_=f+1;else s=f}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}}}}_O.LineCounter=Yw});var S$=P((wO)=>{var $O=s_("process"),jw=d_(),fO=g$();function $u(u,_){for(let s=0;s<u.length;++s)if(u[s].type===_)return!0;return!1}function Qw(u){for(let _=0;_<u.length;++_)switch(u[_].type){case"space":case"comment":case"newline":break;default:return _}return-1}function Vw(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 p_(u,_){if(_.length<1e5)Array.prototype.push.apply(u,_);else for(let s=0;s<_.length;++s)u.push(_[s])}function Nw(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,Vw(_.value))if(_.value.end)p_(_.value.end,_.sep);else _.value.end=_.sep;else p_(_.start,_.sep);delete _.sep}}}class Mw{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 fO.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,$O.env.LOG_TOKENS)console.log("|",jw.prettyToken(u));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=u.length;return}let _=jw.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")Nw(_);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&&Qw($.start)===-1&&(_.indent===0||$.start.every((f)=>f.type!=="comment"||f.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(Qw(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 f={type:"block-map",offset:u.offset,indent:u.indent,items:[{start:s,key:u,sep:$}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}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(
|
|
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($)){p_($,_.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",f=[];if($&&_.sep&&!_.value){let w=[];for(let i=0;i<_.sep.length;++i){let g=_.sep[i];switch(g.type){case"newline":w.push(i);break;case"space":break;case"comment":if(g.indent>u.indent)w.length=0;break;default:w.length=0}}if(w.length>=2)f=_.sep.splice(w[1])}switch(this.type){case"anchor":case"tag":if($||_.value)f.push(this.sourceToken),u.items.push({start:f}),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)f.push(this.sourceToken),u.items.push({start:f,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 w=Ju(_.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,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:f,key:null,sep:[this.sourceToken]}]});else if(Vw(_.key)&&!$u(_.sep,"newline")){let w=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:w,key:i,sep:g}]})}else if(f.length>0)_.sep=_.sep.concat(f,this.sourceToken);else _.sep.push(this.sourceToken);else if(!_.sep)Object.assign(_,{key:null,sep:[this.sourceToken]});else if(_.value||$)u.items.push({start:f,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 w=this.flowScalar(this.type);if($||_.value)u.items.push({start:f,key:w,sep:[]}),this.onKeyLine=!0;else if(_.sep)this.stack.push(w);else Object.assign(_,{key:w,sep:[]}),this.onKeyLine=!0;return}default:{let w=this.startBlockValue(u);if(w){if(w.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:f});this.stack.push(w);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($)){p_($,_.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),f=Ju($);Nw(u);let w=u.end.splice(1,u.end.length);w.push(this.sourceToken);let i={type:"block-map",offset:u.offset,indent:u.indent,items:[{start:f,key:u,sep:w}]};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:
|
|
142
|
-
`)){let
|
|
143
|
-
`),
|
|
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()}}}wO.Parser=Mw});var Kw=P((LO)=>{var bw=os(),gO=cu(),vu=mu(),RO=Rs(),SO=r(),IO=R$(),Ew=S$();function Cw(u){let _=u.prettyErrors!==!1;return{lineCounter:u.lineCounter||_&&new IO.LineCounter||null,prettyErrors:_}}function TO(u,_={}){let{lineCounter:s,prettyErrors:$}=Cw(_),f=new Ew.Parser(s?.addNewLine),w=new bw.Composer(_),i=Array.from(w.compose(f.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},w.streamInfo())}function lw(u,_={}){let{lineCounter:s,prettyErrors:$}=Cw(_),f=new Ew.Parser(s?.addNewLine),w=new bw.Composer(_),i=null;for(let g of w.compose(f.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 qO(u,_,s){let $=void 0;if(typeof _==="function")$=_;else if(s===void 0&&_&&typeof _==="object")s=_;let f=lw(u,s);if(!f)return null;if(f.warnings.forEach((w)=>RO.warn(f.options.logLevel,w)),f.errors.length>0)if(f.options.logLevel!=="silent")throw f.errors[0];else f.errors=[];return f.toJS(Object.assign({reviver:$},s))}function OO(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 f=Math.round(s);s=f<1?void 0:f>8?{indent:8}:{indent:f}}if(u===void 0){let{keepUndefined:f}=s??_??{};if(!f)return}if(SO.isDocument(u)&&!$)return u.toString(s);return new gO.Document(u,$,s).toString(s)}LO.parse=qO;LO.parseAllDocuments=TO;LO.parseDocument=lw;LO.stringify=OO});import{existsSync as Z$,mkdirSync as e_,readFileSync as _g,writeFileSync as Y$}from"node:fs";import{dirname as sg,isAbsolute as BU,join as $g,resolve as ZU}from"node:path";var AO=os(),FO=cu(),zO=Es(),I$=mu(),WO=Qu(),fu=r(),GO=e(),XO=B(),rO=_u(),JO=su(),xH=d_(),BO=g$(),ZO=R$(),YO=S$(),c_=Kw(),yw=Yu();var jO=AO.Composer,QO=FO.Document,NO=zO.Schema,VO=I$.YAMLError,MO=I$.YAMLParseError,bO=I$.YAMLWarning,EO=WO.Alias,CO=fu.isAlias,lO=fu.isCollection,KO=fu.isDocument,yO=fu.isMap,dO=fu.isNode,nO=fu.isPair,hO=fu.isScalar,pO=fu.isSeq,cO=GO.Pair,mO=XO.Scalar,aO=rO.YAMLMap,kO=JO.YAMLSeq;var xO=BO.Lexer,tO=ZO.LineCounter,vO=YO.Parser,m_=c_.parse,oO=c_.parseAllDocuments,eO=c_.parseDocument,T$=c_.stringify,uL=yw.visit,_L=yw.visitAsync;var sL=new Set(["none","low","medium","high"]),$L=new Set(["low","medium","high"]);function a_(u,_){if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`${_} must be an object`);return u}function k(u,_,s=_){let $=u[_];if(typeof $!=="string"||$.trim()==="")throw Error(`Missing required string: ${s}`);return $}function dw(u){if(!("confidence"in u))return null;let _=u.confidence;if(typeof _!=="string"||!$L.has(_))throw Error(`Invalid confidence: ${String(_)}`);return _}function nw(u){let _=a_(m_(u),"summaries.yaml"),s=k(_,"project_id");if(!Array.isArray(_.summaries))throw Error("summaries must be an array");return{projectId:s,summaries:_.summaries.map(($,f)=>{let w=`summaries[${f}]`,i=a_($,`summaries[${f}]`),g=k(i,"value",`${w}.value`);if(!sL.has(g))throw Error(`Invalid summary value: ${g}`);return dw(i),{sessionId:k(i,"session_id",`${w}.session_id`),title:k(i,"title",`${w}.title`),value:g,summaryMarkdown:k(i,"summary_markdown",`${w}.summary_markdown`),metadata:i}})}}function hw(u){let _=a_(m_(u),"experiences.yaml"),s=k(_,"project_id");if(!Array.isArray(_.experiences))throw Error("experiences must be an array");return{projectId:s,experiences:_.experiences.map(($,f)=>{let w=`experiences[${f}]`,i=a_($,w),g=i.source_sessions;if(!Array.isArray(g)||g.some((S)=>typeof S!=="string"))throw Error(`experiences[${f}].source_sessions must be a string array`);let R=dw(i);return{title:k(i,"title",`${w}.title`),slug:typeof i.slug==="string"?i.slug:null,summary:k(i,"summary",`${w}.summary`),bodyMarkdown:k(i,"body_markdown",`${w}.body_markdown`),sourceSessions:g,confidence:R,metadata:i}})}}import{existsSync as pw,readFileSync as cw,writeFileSync as fL}from"node:fs";var wL={"obsidian.vault":"obsidian_vault",obsidian_vault:"obsidian_vault"};function iL(u){let _={};for(let s of u.split(`
|
|
141
|
+
`)){let $=s.trim();if($===""||$.startsWith("#")||$.startsWith("["))continue;let f=$.match(/^([\w.]+)\s*=\s*(.*)$/);if(!f)continue;let w=f[1],i=f[2].trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))i=i.slice(1,-1);_[w]=i}return _}function q$(u){if(!pw(u))return{obsidianVault:null};let s=iL(cw(u,"utf8")).obsidian_vault;return{obsidianVault:s&&s.trim()!==""?s:null}}function mw(u,_,s){let $=wL[_];if(!$)throw Error(`Unknown config key: ${_}. Supported: obsidian.vault`);let w=(pw(u)?cw(u,"utf8"):"").split(`
|
|
142
|
+
`),i=`${$} = "${s}"`,g=!1,R=w.map((S)=>{if(S.trim().startsWith(`${$} `)||S.trim().startsWith(`${$}=`))return g=!0,i;return S});if(!g)R.push(i);return fL(u,`${R.filter((S,O)=>!(S===""&&O===R.length-1)).join(`
|
|
144
143
|
`)}
|
|
145
|
-
`)
|
|
144
|
+
`),$}import{mkdirSync as gL}from"node:fs";import{createRequire as RL}from"node:module";import{dirname as SL}from"node:path";var aw=RL(import.meta.url),kw=typeof globalThis.Bun<"u";function xw(u,_){let s=_?{readonly:!0}:void 0;if(kw){let{Database:w}=aw("bun:sqlite");return new w(u,s)}return new(aw("better-sqlite3"))(u,s)}function IL(u){return typeof u==="object"&&u!==null&&!Array.isArray(u)&&!Buffer.isBuffer(u)}function O$(u){if(u.length!==1||!IL(u[0]))return u;if(kw)return u;let _={};for(let[s,$]of Object.entries(u[0]))_[s.replace(/^[$@:]/,"")]=$;return[_]}class tw{statement;constructor(u){this.statement=u}get(...u){return this.statement.get(...O$(u))??null}all(...u){return this.statement.all(...O$(u))}run(...u){return this.statement.run(...O$(u))}}class L${raw;constructor(u){this.raw=u}query(u){return new tw(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 gL(SL(u),{recursive:!0}),new L$(xw(u,!1))}function vw(u){try{return new L$(xw(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
|
|
282
|
+
`)}import{createHash as TL}from"node:crypto";function h(u){return TL("sha1").update(u).digest("hex").slice(0,16)}import{spawnSync as qL}from"node:child_process";import{existsSync as OL}from"node:fs";import{basename as LL,resolve as ew}from"node:path";function UL(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 ow(u,_){let s=qL("git",_,{cwd:u,encoding:"utf8"});if(s.status!==0)return null;return s.stdout.trim()||null}function ui(u){let _=ow(u,["rev-parse","--show-toplevel"]),s=ow(u,["config","--get","remote.origin.url"]),$=s?UL(s):null,f=$??LL(_??u),w=U$(f);return{id:`proj_${h($??_??u)}`,canonicalName:f,slug:w,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:
|
|
291
|
+
`).run({$id:_.id,$canonicalName:_.canonicalName,$slug:_.slug,$canonicalRepoUrl:_.canonicalRepoUrl,$identitySource:_.identitySource,$now:s}),k_(u,_.id)}function wu(u,_){let s=ew(_);if(!OL(s))throw Error(`Path does not exist: ${s}`);return _i(u,ui(s))}function si(u,_){let s=ew(_);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 k_(u,_)}function $i(u){return u.query(`
|
|
293
292
|
SELECT
|
|
294
293
|
p.id,
|
|
295
294
|
p.canonical_name,
|
|
@@ -303,41 +302,41 @@ ${_.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((
|
|
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 k_(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 HL=`## 输出格式
|
|
307
306
|
|
|
308
|
-
|
|
309
|
-
\`.llm-iwiki/tasks/experiences.yaml
|
|
307
|
+
基于下面这些会话摘要,提炼出可复用的项目经验,生成 \`experiences.yaml\` 写入
|
|
308
|
+
\`.llm-iwiki/tasks/experiences.yaml\`,再运行 \`llm-iwiki experiences propose\`。
|
|
310
309
|
|
|
311
310
|
\`\`\`yaml
|
|
312
|
-
project_id:
|
|
311
|
+
project_id: <见下方 project_id>
|
|
313
312
|
experiences:
|
|
314
|
-
- title:
|
|
315
|
-
slug:
|
|
313
|
+
- title: <经验标题>
|
|
314
|
+
slug: <可选,稳定短标识>
|
|
316
315
|
summary: |
|
|
317
|
-
|
|
316
|
+
一句话说明这条经验。
|
|
318
317
|
body_markdown: |
|
|
319
|
-
##
|
|
320
|
-
##
|
|
321
|
-
##
|
|
318
|
+
## 背景
|
|
319
|
+
## 方案
|
|
320
|
+
## 结论
|
|
322
321
|
source_sessions:
|
|
323
|
-
-
|
|
322
|
+
- <相关 session_id>
|
|
324
323
|
confidence: low | medium | high
|
|
325
324
|
\`\`\`
|
|
326
325
|
|
|
327
|
-
|
|
328
|
-
-
|
|
329
|
-
- \`source_sessions\`
|
|
326
|
+
要求:
|
|
327
|
+
- 一条经验可以聚合多个会话,按主题归纳,不要逐会话复述。
|
|
328
|
+
- \`source_sessions\` 填写该经验来自哪些 session_id。`;function PL(u,_,s){let $=s==="changed-summaries"?"AND value IN ('medium', 'high')":"";return u.query(`
|
|
330
329
|
SELECT session_id, title, value, summary_markdown
|
|
331
330
|
FROM session_summaries
|
|
332
|
-
WHERE project_id = ? ${
|
|
331
|
+
WHERE project_id = ? ${$}
|
|
333
332
|
ORDER BY updated_at DESC
|
|
334
|
-
`).all(_)}function
|
|
335
|
-
`));return{markdown:["# Experiences Task","",`project_id: ${_}`,`scope: ${
|
|
333
|
+
`).all(_)}function fi(u,_,s){let f=PL(u,_,s).map((i)=>[`### ${i.session_id} — ${i.title}`,`- value: ${i.value}`,"",i.summary_markdown].join(`
|
|
334
|
+
`));return{markdown:["# Experiences Task","",`project_id: ${_}`,`scope: ${s}`,`summaries: ${f.length}`,"",HL,"","---","",f.join(`
|
|
336
335
|
|
|
337
336
|
---
|
|
338
337
|
|
|
339
338
|
`),""].join(`
|
|
340
|
-
`),summaryCount:
|
|
339
|
+
`),summaryCount:f.length}}function wi(u){return h(u)}function ii(u,_){let s=new Date().toISOString(),$=0;return u.transaction(()=>{for(let w of _.experiences){let i=w.slug&&w.slug.trim()!==""?w.slug:U$(w.title),g=`cand_${wi(`${_.projectId}\x00${i}`)}`;u.query(`
|
|
341
340
|
INSERT INTO experience_candidates (
|
|
342
341
|
id, project_id, proposed_title, proposed_slug, proposed_body_markdown, source_sessions_json, confidence, status, created_at
|
|
343
342
|
) VALUES ($id, $projectId, $title, $slug, $body, $sources, $confidence, 'proposed', $now)
|
|
@@ -346,7 +345,7 @@ experiences:
|
|
|
346
345
|
proposed_body_markdown = excluded.proposed_body_markdown,
|
|
347
346
|
source_sessions_json = excluded.source_sessions_json,
|
|
348
347
|
confidence = excluded.confidence
|
|
349
|
-
`).run({$id:
|
|
348
|
+
`).run({$id:g,$projectId:_.projectId,$title:w.title,$slug:i,$body:w.bodyMarkdown,$sources:JSON.stringify(w.sourceSessions),$confidence:w.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 f=new Date().toISOString(),w=`exp_${wi(`${s.project_id}\x00${s.proposed_slug}`)}`;return u.transaction(()=>{u.query(`
|
|
350
349
|
INSERT INTO experiences (
|
|
351
350
|
id, project_id, title, slug, body_markdown, confidence, status, created_at, updated_at
|
|
352
351
|
) VALUES ($id, $projectId, $title, $slug, $body, $confidence, 'accepted', $now, $now)
|
|
@@ -356,14 +355,14 @@ experiences:
|
|
|
356
355
|
confidence = excluded.confidence,
|
|
357
356
|
status = 'accepted',
|
|
358
357
|
updated_at = excluded.updated_at
|
|
359
|
-
`).run({$id
|
|
358
|
+
`).run({$id:w,$projectId:s.project_id,$title:s.proposed_title,$slug:s.proposed_slug,$body:s.proposed_body_markdown,$confidence:s.confidence,$now:f});let R=u.query("SELECT id FROM experiences WHERE project_id = ? AND slug = ?").get(s.project_id,s.proposed_slug)?.id??w;for(let S of $)u.query(`
|
|
360
359
|
INSERT INTO session_experience_links (session_id, experience_id, relation)
|
|
361
360
|
VALUES (?, ?, 'source')
|
|
362
361
|
ON CONFLICT(session_id, experience_id) DO NOTHING
|
|
363
|
-
`).run(R
|
|
364
|
-
`)}function
|
|
362
|
+
`).run(S,R);u.query("UPDATE experience_candidates SET status = 'accepted' WHERE id = ?").run(_)})(),{experienceId:w,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 DL,readFileSync as qi,writeFileSync as Ii}from"node:fs";import{dirname as AL,join as ou}from"node:path";var t_="<!-- aiwiki:managed:start -->",Oi="<!-- aiwiki:managed:end -->";function v_(u){return h(u)}function D$(u){let _=u.replace(/[\\/:*?"<>|]/g," ").replace(/\s+/g," ").trim().slice(0,80);return _===""?"untitled":_}function FL(u){let _=T$(u.frontmatter).trimEnd(),s=u.userSectionHeading??"## 我的补充";return["---",_,"---","",`# ${u.title}`,"",t_,u.managedBody.trim(),Oi,"",s,"",""].join(`
|
|
363
|
+
`)}function Li(u){let _=u.indexOf(t_),s=u.indexOf(Oi);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 zL(u,_){return`${u.before}
|
|
365
364
|
${_.trim()}
|
|
366
|
-
${
|
|
365
|
+
${u.after}`}function WL(u,_,s){return u.query("SELECT managed_hash, file_path FROM obsidian_notes WHERE note_type = ? AND entity_id = ?").get(_,s)}function x_(u,_,s,$,f,w){u.query(`
|
|
367
366
|
INSERT INTO obsidian_notes (id, note_type, entity_id, file_path, managed_hash, frontmatter_hash, last_exported_at, conflict_status)
|
|
368
367
|
VALUES ($id, $noteType, $entityId, $filePath, $managedHash, NULL, $now, $conflictStatus)
|
|
369
368
|
ON CONFLICT(note_type, entity_id) DO UPDATE SET
|
|
@@ -371,31 +370,31 @@ ${s.after}`}function IN(s,_,u){return s.query("SELECT managed_hash, file_path FR
|
|
|
371
370
|
managed_hash = excluded.managed_hash,
|
|
372
371
|
last_exported_at = excluded.last_exported_at,
|
|
373
372
|
conflict_status = excluded.conflict_status
|
|
374
|
-
`).run({$id:`note_${
|
|
373
|
+
`).run({$id:`note_${v_(`${_.noteType}\x00${_.entityId}`)}`,$noteType:_.noteType,$entityId:_.entityId,$filePath:s,$managedHash:$,$conflictStatus:f,$now:w})}function P$(u,_,s,$,f){let w=ou(_,s.relPath),i=v_(s.managedBody.trim());if(!Ti(w))return DL(AL(w),{recursive:!0}),Ii(w,FL(s)),x_(u,s,w,i,"clean",f),"created";let g=qi(w,"utf8"),R=Li(g);if(!R)return x_(u,s,w,i,"no_managed_block",f),"conflict";let S=v_(R.managed),O=WL(u,s.noteType,s.entityId),I=!O||O.managed_hash!==S;if(I&&!$.force)return x_(u,s,w,O?.managed_hash??S,"managed_conflict",f),"conflict";return Ii(w,zL(R,s.managedBody)),x_(u,s,w,i,"clean",f),I?"forced":"updated"}function GL(u){return D$(u.displayName??u.canonicalName??u.slug)}function Ui(u,_,s,$){let f=new Date().toISOString(),w={created:0,updated:0,forced:0,conflicts:[]},i=GL(s),g=ou("LLM-iWiki","Projects",i),R=s.displayName??s.canonicalName,S=(q,U)=>{if(q==="created")w.created+=1;else if(q==="updated")w.updated+=1;else if(q==="forced")w.forced+=1;else w.conflicts.push(U)},O=u.query(`
|
|
375
374
|
SELECT id, session_id, title, value, summary_markdown, updated_at
|
|
376
375
|
FROM session_summaries WHERE project_id = ? ORDER BY updated_at DESC
|
|
377
|
-
`).all(
|
|
376
|
+
`).all(s.id);for(let q of O){let U=ou(g,"Sessions",`${D$(q.title)}.md`),D={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??f}};S(P$(u,_,D,$,f),U)}let I=u.query(`
|
|
378
377
|
SELECT id, title, slug, body_markdown, confidence, status, updated_at
|
|
379
378
|
FROM experiences WHERE project_id = ? AND status = 'accepted' ORDER BY updated_at DESC
|
|
380
|
-
`).all(
|
|
381
|
-
`),
|
|
379
|
+
`).all(s.id);for(let q of I){let U=ou(g,"Experiences",`${D$(q.slug||q.title)}.md`),D=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:D,updated_at:q.updated_at}};S(P$(u,_,F,$,f),U)}let T=ou(g,"Project Summary.md"),L=[`- canonical: \`${s.canonicalName}\``,s.canonicalRepoUrl?`- repo: ${s.canonicalRepoUrl}`:null,`- session summaries: ${O.length}`,`- experiences: ${I.length}`].filter((q)=>q!=null).join(`
|
|
380
|
+
`),H={noteType:"project-summary",entityId:s.id,relPath:T,title:R,managedBody:L,frontmatter:{type:"project-summary",aiwiki_project_id:s.id,project:R,canonical_repo_url:s.canonicalRepoUrl,updated_at:f}};return S(P$(u,_,H,$,f),T),w}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 f of _){let w;if(!Ti(f.file_path))w="missing";else{let i=Li(qi(f.file_path,"utf8"));if(!i)w="no_managed_block";else if(f.managed_hash&&v_(i.managed)===f.managed_hash)w="clean";else w="drift"}if(w==="clean")$+=1;else s.push({noteType:f.note_type,entityId:f.entity_id,filePath:f.file_path,status:w})}return{total:_.length,clean:$,entries:s}}import{homedir as XL}from"node:os";import{join as A$,resolve as rL}from"node:path";function Q(u=XL()){let _=A$(u,".llm-iwiki");return{homeDir:u,configDir:_,configFile:A$(_,"config.toml"),databaseFile:A$(_,"llm-iwiki.db")}}function F$(u){return rL(u,".llm-iwiki","tasks")}function Pi(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 JL(u,_,s=100){return u.query(`
|
|
382
381
|
SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
|
|
383
382
|
FROM sessions
|
|
384
383
|
WHERE project_id = ?
|
|
385
384
|
ORDER BY COALESCE(updated_at, last_seen_at) DESC
|
|
386
385
|
LIMIT ?
|
|
387
|
-
`).all(_,
|
|
386
|
+
`).all(_,s).map(Pi)}function Di(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
387
|
SELECT id, source_id, source_session_id, title, message_count, status, raw_project_path, updated_at, last_seen_at
|
|
389
388
|
FROM sessions
|
|
390
|
-
WHERE project_id = ? ${
|
|
389
|
+
WHERE project_id = ? ${$}
|
|
391
390
|
ORDER BY COALESCE(updated_at, last_seen_at) DESC
|
|
392
|
-
`).all(_).map(
|
|
391
|
+
`).all(_).map(Pi)}function Fi(u,_){return{sources:u.query(`
|
|
393
392
|
SELECT source_id, COUNT(*) AS session_count
|
|
394
393
|
FROM sessions
|
|
395
394
|
WHERE project_id = ?
|
|
396
395
|
GROUP BY source_id
|
|
397
396
|
ORDER BY session_count DESC
|
|
398
|
-
`).all(_).map((
|
|
397
|
+
`).all(_).map(($)=>({source:$.source_id,sessionCount:$.session_count})),sessions:JL(u,_)}}import{existsSync as BL,mkdirSync as ZL,writeFileSync as zi}from"node:fs";import{dirname as YL,join as z$}from"node:path";var W$=["codex","claude-code","cursor"],G$=z$(".agents","skills"),Wi={codex:"Codex","claude-code":"Claude Code",cursor:"Cursor"},Gi=[{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
398
|
name: aiwiki-before-debug
|
|
400
399
|
description: Search project memory before debugging so related history is visible before changing code.
|
|
401
400
|
---
|
|
@@ -429,25 +428,25 @@ Use this skill when preparing a project retrospective or looking for recent repe
|
|
|
429
428
|
\`\`\`
|
|
430
429
|
2. Review the prepared task for repeated themes, unresolved questions, and process improvements.
|
|
431
430
|
3. Capture any accepted learnings through the normal llm-iwiki experience proposal flow.
|
|
432
|
-
`}];function
|
|
431
|
+
`}];function jL(u,_){if(!_)return u;return`${u}
|
|
433
432
|
## Tool Target
|
|
434
433
|
|
|
435
|
-
This skill is initialized for ${
|
|
436
|
-
`}function
|
|
434
|
+
This skill is initialized for ${Wi[_]}.
|
|
435
|
+
`}function QL(u){return u instanceof Error&&"code"in u&&u.code==="EEXIST"}function Xi(){return W$.map((u)=>({id:u,name:Wi[u]}))}function ri(){return Gi.map((u)=>({directory:u.directory,relPath:z$(G$,u.directory,"SKILL.md")}))}function Ji(u){let _=[],s=[];for(let $ of Gi){let f=z$(u.cwd,".agents","skills",$.directory,"SKILL.md");if(BL(f)&&!u.force){s.push(f);continue}if(_.push(f),u.dryRun)continue;ZL(YL(f),{recursive:!0});let w=jL($.content,u.target);if(u.force){zi(f,w);continue}try{zi(f,w,{flag:"wx"})}catch(i){if(!QL(i))throw i;_.pop(),s.push(f)}}return{written:_,skipped:s}}var NL={maxPerMessage:1200,maxMessages:60};function VL(u){return u.replace(/[ \t]+\n/g,`
|
|
437
436
|
`).replace(/\n{3,}/g,`
|
|
438
437
|
|
|
439
|
-
`).trim()}function
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
`}let
|
|
438
|
+
`).trim()}function ML(u,_){let s=VL(u);if(s.length<=_)return s;return`${s.slice(0,_)}
|
|
439
|
+
…[truncated ${s.length-_} chars]`}function Bi(u,_={}){let s={...NL,..._},$=u.filter((g)=>g.content.trim()!==""),f=$,w="";if($.length>s.maxMessages){let g=Math.ceil(s.maxMessages*0.6),R=s.maxMessages-g;f=[...$.slice(0,g),...$.slice($.length-R)],w=`
|
|
440
|
+
…[omitted ${$.length-s.maxMessages} middle messages]
|
|
441
|
+
`}let i=[];return f.forEach((g,R)=>{if(w&&R===Math.ceil(s.maxMessages*0.6))i.push(w);let S=g.role==="user"?"User":g.role==="assistant"?"Assistant":g.role;i.push(`**${S}:** ${ML(g.content,s.maxPerMessage)}`)}),i.join(`
|
|
443
442
|
|
|
444
|
-
`)}var
|
|
445
|
-
`))}return{markdown:["# Summaries Task","",`project_id: ${_}`,`scope: ${
|
|
443
|
+
`)}var bL="## 输出格式\n\n请阅读下面每个会话的压缩记录,为有价值的会话生成一份 `summaries.yaml`,写入\n`.llm-iwiki/tasks/summaries.yaml`,再运行 `llm-iwiki summarize apply`。\n\n```yaml\nproject_id: <见下方 project_id>\nsummaries:\n - session_id: <会话的 session_id,原样照抄>\n title: <一句话标题>\n value: none | low | medium | high\n summary_markdown: |\n 用 Markdown 概括这次会话解决了什么问题、关键决策、结论。\n```\n\n要求:\n- `value` 表示这次会话的沉淀价值,`medium` / `high` 会进入经验提取。\n- `session_id` 必须与下面给出的完全一致。\n- 没有价值的会话可以省略,不必每个都写。";function Zi(u,_,s){let $=Ai(u,_,s),f=[];for(let i of $){let g=Di(u,i.id);if(g.length===0)continue;let R=Bi(g);f.push([`### ${i.id}`,`- source: ${i.sourceId}`,`- title: ${i.title??"(无标题)"}`,`- messages: ${i.messageCount}`,"",R].join(`
|
|
444
|
+
`))}return{markdown:["# Summaries Task","",`project_id: ${_}`,`scope: ${s}`,`sessions: ${f.length}`,"",bL,"","---","",f.join(`
|
|
446
445
|
|
|
447
446
|
---
|
|
448
447
|
|
|
449
448
|
`),""].join(`
|
|
450
|
-
`),sessionCount:
|
|
449
|
+
`),sessionCount:f.length}}function EL(u){return h(u)}function Yi(u,_){let s=new Date().toISOString(),$=0,f=[];return u.transaction(()=>{for(let i of _.summaries){let g=u.query("SELECT project_id FROM sessions WHERE id = ?").get(i.sessionId);if(!g){f.push(i.sessionId);continue}u.query(`
|
|
451
450
|
INSERT INTO session_summaries (id, session_id, project_id, title, value, summary_markdown, metadata_json, created_at, updated_at)
|
|
452
451
|
VALUES ($id, $sessionId, $projectId, $title, $value, $summaryMarkdown, $metadata, $now, $now)
|
|
453
452
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -456,18 +455,18 @@ This skill is initialized for ${Uf[_]}.
|
|
|
456
455
|
summary_markdown = excluded.summary_markdown,
|
|
457
456
|
metadata_json = excluded.metadata_json,
|
|
458
457
|
updated_at = excluded.updated_at
|
|
459
|
-
`).run({$id:`sum_${
|
|
460
|
-
`)){let
|
|
461
|
-
`).trim();if(
|
|
462
|
-
`)
|
|
463
|
-
`)){let g
|
|
464
|
-
`)&&_.length<256}function
|
|
458
|
+
`).run({$id:`sum_${EL(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:f}}import{existsSync as Ni,readdirSync as Qi,readFileSync as yL,realpathSync as dL,statSync as nL}from"node:fs";import{basename as hL,join as o_}from"node:path";import{tmpdir as CL}from"node:os";var ji=120,lL=["/tmp/","/private/tmp/","/var/folders/","/private/var/folders/"];function p(u){if(!u)return!1;let _=CL();if(u===_)return!0;let s=u.endsWith("/")?u:`${u}/`;return[...lL,`${_}/`].some((f)=>s.startsWith(f))}function eu(u){return u.length>ji?`${u.slice(0,ji)}…`:u}function KL(u){for(let _ of u.split(`
|
|
459
|
+
`)){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=KL(_.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(`
|
|
460
|
+
`).trim();if(u==null)return"";return JSON.stringify(u)}var Vi=[".claude/projects",".claude-internal/projects"];function pL(u){let s=yL(u,"utf8").split(`
|
|
461
|
+
`),$=[],f=null,w=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"&&!w)w=S.sessionId;if(typeof S.cwd==="string"&&!f)f=S.cwd;let O=S.type;if(O!=="user"&&O!=="assistant")continue;if(S.isSidechain===!0)continue;let I=S.message;if(!I||typeof I!=="object")continue;let T=I,L=typeof T.role==="string"?T.role:O,H=Bu(T.content);if(H.trim()==="")continue;$.push({role:L,content:H,timestamp:typeof S.timestamp==="string"?S.timestamp:null})}if($.length===0)return null;if(p(f))return null;w??=hL(u).replace(/\.jsonl$/,"");let i=$.map((g)=>g.timestamp).filter((g)=>g!=null);return{sourceSessionId:w,rawPath:u,rawProjectPath:f,title:c($),createdAt:i[0]??null,updatedAt:i[i.length-1]??null,messages:$}}function cL(u){let _=[],s=new Set;for(let $ of Vi){let f=o_(u,$);if(!Ni(f))continue;let w;try{w=dL(f)}catch{w=f}if(s.has(w))continue;s.add(w);for(let i of Qi(f,{withFileTypes:!0})){if(!i.isDirectory())continue;let g=o_(f,i.name);for(let R of Qi(g,{withFileTypes:!0}))if(R.isFile()&&R.name.endsWith(".jsonl"))_.push(o_(g,R.name))}}return _}var Mi={id:"claude-code",name:"Claude Code",detect(u){return Vi.some((_)=>Ni(o_(u,_)))},collect(u){let _=[];for(let s of cL(u))try{if(!nL(s).isFile())continue;let $=pL(s);if($)_.push($)}catch{continue}return _}};import{existsSync as Ei,readdirSync as Ci,readFileSync as mL,statSync as aL}from"node:fs";import{join as iu}from"node:path";var kL="Library/Application Support",xL=["CodeBuddyExtension","CodeBuddy CN"];function li(u,_,s=0){if(s>6)return;let $;try{$=Ci(u,{withFileTypes:!0})}catch{return}for(let f of $){if(!f.isDirectory())continue;let w=iu(u,f.name);if(f.name==="history")_.push(w);else if(f.name!=="messages")li(w,_,s+1)}}function X$(u){try{return JSON.parse(mL(u,"utf8"))}catch{return null}}function tL(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 vL(u){let _=u.match(/Workspace Folder:\s*(.+)/);if(!_)return null;let s=_[1].trim();return s===""?null:s}function oL(u,_,s){let $=X$(iu(u,"index.json"));if(!$?.messages)return null;let f=[],w=null;for(let g of $.messages){let R=X$(iu(u,"messages",`${g.id}.json`));if(!R)continue;let S=g.role??R.role??"user";if(S!=="user"&&S!=="assistant")continue;let O=tL(R.message);if(O.trim()==="")continue;if(!w&&S==="user")w=vL(O);f.push({role:S,content:O,timestamp:null})}if(f.length===0)return null;if(p(w))return null;let i=s.name&&s.name.trim()!==""?eu(s.name.trim()):c(f);return{sourceSessionId:_,rawPath:u,rawProjectPath:w,title:i,createdAt:s.createdAt??null,updatedAt:s.lastMessageAt??null,messages:f}}function eL(u,_){for(let s of Ci(u,{withFileTypes:!0})){if(!s.isDirectory())continue;let $=iu(u,s.name),f=X$(iu($,"index.json"));if(!f?.conversations?.length)continue;for(let w of f.conversations){if(!w.id)continue;let i=iu($,w.id);if(!Ei(i))continue;try{let g=oL(i,w.id,w);if(g)_.push(g)}catch{continue}}}}function bi(u){return xL.map((_)=>iu(u,kL,_)).filter((_)=>Ei(_))}var Ki={id:"codebuddy",name:"CodeBuddy",detect(u){return bi(u).length>0},collect(u){let _=[],s=new Set;for(let $ of bi(u)){let f=[];li(iu($,"Data"),f);for(let w of f){try{if(!aL(w).isDirectory())continue}catch{continue}eL(w,_)}}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 fU,join as r$}from"node:path";var di=[".codex/sessions",".codex-internal/sessions"];function wU(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 $=r$(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,f=null,w=null;for(let g of _.split(`
|
|
462
|
+
`)){let R=g.trim();if(R==="")continue;let S;try{S=JSON.parse(R)}catch{continue}let O=S.payload;if(!O||typeof O!=="object")continue;let I=O,T=typeof S.timestamp==="string"?S.timestamp:null;if(S.type==="session_meta"){if(typeof I.id==="string")f=I.id;if(typeof I.cwd==="string")$=I.cwd;if(typeof I.timestamp==="string")w=I.timestamp;continue}if(S.type!=="event_msg")continue;let L=I.type;if(L!=="user_message"&&L!=="agent_message")continue;if(typeof I.message!=="string")continue;let H=wU(I.message);if(H==="")continue;s.push({role:L==="user_message"?"user":"assistant",content:H,timestamp:T})}if(s.length===0)return null;if(p($))return null;f??=fU(u).replace(/\.jsonl$/,"");let i=s.map((g)=>g.timestamp).filter((g)=>g!=null);return{sourceSessionId:f,rawPath:u,rawProjectPath:$,title:c(s),createdAt:w??i[0]??null,updatedAt:i[i.length-1]??null,messages:s}}function gU(u){let _=[],s=new Set;for(let $ of di){let f=r$(u,$);if(!yi(f))continue;let w;try{w=sU(f)}catch{w=f}if(s.has(w))continue;s.add(w),ni(f,_)}return _}var hi={id:"codex",name:"Codex",detect(u){return di.some((_)=>yi(r$(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 Lu}from"node:path";var pi="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 vw(u)}function TU(u){let _=new Map,s=Lu(u,"workspaceStorage");if(!u_(s))return _;for(let $ of RU(s,{withFileTypes:!0})){if(!$.isDirectory())continue;let f=Lu(s,$.name),w=null,i=Lu(f,"workspace.json");if(u_(i))try{let S=JSON.parse(SU(i,"utf8"));if(typeof S.folder==="string")w=IU(S.folder)}catch{}let g=Lu(f,"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 O=JSON.parse(S.value);for(let I of O.allComposers??[]){let T=I.composerId;if(typeof T!=="string")continue;if(_.has(T))continue;_.set(T,{cwd:w,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 f=u.query("SELECT value FROM cursorDiskKV WHERE key = ?").get(`composerData:${s}`);if(!f)return null;let w;try{w=JSON.parse(f.value)}catch{return null}let i=w.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 L;try{L=JSON.parse(T.value)}catch{continue}let H=typeof L.text==="string"?L.text.trim():"";if(H==="")continue;R.push({role:I.type===1?"user":"assistant",content:H,timestamp:null})}if(R.length===0)return null;if(p($.cwd))return null;let S=$.name??w.name??null,O=S&&S.trim()!==""?eu(S.trim()):c(R);return{sourceSessionId:s,rawPath:`${_}#${s}`,rawProjectPath:$.cwd,title:O,createdAt:$.createdAt??J$(w.createdAt),updatedAt:$.updatedAt,messages:R}}var mi={id:"cursor",name:"Cursor",detect(u){return u_(Lu(u,pi,"globalStorage","state.vscdb"))},collect(u){let _=Lu(u,pi),s=Lu(_,"globalStorage","state.vscdb");if(!u_(s))return[];let $=TU(_);if($.size===0)return[];let f=ci(s);if(!f)return[];let w=[];try{for(let[i,g]of $)try{let R=qU(f,s,i,g);if(R)w.push(R)}catch{continue}}finally{f.close()}return w}};import{existsSync as __,readdirSync as ai,readFileSync as ti,realpathSync as OU,statSync as LU}from"node:fs";import{basename as vi,dirname as ki,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[f,w]of Object.entries($.projects??{}))if(typeof w==="string"&&!_.has(w))_.set(w,f)}catch{}return _}function PU(u){let _=u.trim();return _.startsWith("/")&&!_.includes(`
|
|
463
|
+
`)&&_.length<256}function DU(u,_,s){let $;try{$=JSON.parse(ti(u,"utf8"))}catch{return null}let f=[];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;f.push({role:g.type==="user"?"user":"assistant",content:R,timestamp:typeof g.timestamp==="string"?g.timestamp:null})}if(f.length===0)return null;let w=s.get(_)??null;if(!w){let g=f.find((R)=>R.role==="user");if(g&&PU(g.content))w=g.content.trim().replace(/\/+$/,"")}if(p(w))return null;let i=f.map((g)=>g.timestamp).filter((g)=>g!=null);return{sourceSessionId:$.sessionId??vi(u).replace(/\.json$/,""),rawPath:u,rawProjectPath:w,title:c(f),createdAt:$.startTime??i[0]??null,updatedAt:$.lastUpdated??i[i.length-1]??null,messages:f}}function xi(u){let _=new Set;for(let s of UU){let $=Zu(u,s);if(!__($))continue;let f;try{f=OU($)}catch{f=$}if(_.has(f))continue;return _.add(f),$}return null}function AU(u){let _=Zu(u,"tmp");if(!__(_))return[];let s=[];for(let $ of ai(_,{withFileTypes:!0})){if(!$.isDirectory())continue;let f=Zu(_,$.name,"chats");if(!__(f))continue;for(let w of ai(f,{withFileTypes:!0}))if(w.isFile()&&w.name.startsWith("session-")&&w.name.endsWith(".json"))s.push(Zu(f,w.name))}return s}var oi={id:"gemini",name:"Gemini",detect(u){let _=xi(u);return _!=null&&__(Zu(_,"tmp"))},collect(u){let _=xi(u);if(!_)return[];let s=HU(_),$=[];for(let f of AU(_))try{if(!LU(f).isFile())continue;let w=vi(ki(ki(f))),i=DU(f,w,s);if(i)$.push(i)}catch{continue}return $}};var ei=[Mi,hi,mi,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 WU(u){return B$(`${u.length}\x00${u.join("\x00")}`)}function GU(u,_,s){u.query(`
|
|
465
464
|
INSERT INTO sources (id, name, enabled, scan_paths, config_json, last_sync_at)
|
|
466
465
|
VALUES ($id, $name, 1, NULL, NULL, $now)
|
|
467
466
|
ON CONFLICT(id) DO UPDATE SET
|
|
468
467
|
name = excluded.name,
|
|
469
468
|
last_sync_at = excluded.last_sync_at
|
|
470
|
-
`).run({$id:_.id,$name:_.name,$now:
|
|
469
|
+
`).run({$id:_.id,$name:_.name,$now:s})}function XU(u,_){if(!_)return null;try{return si(u,_).id}catch{return null}}function rU(u,_,s,$,f){let w=FU(_.id,s),i=s.messages.map((T)=>zU(T.role,T.content)),g=WU(i),R=XU(u,s.rawProjectPath),S=u.query("SELECT content_hash, first_seen_at FROM sessions WHERE id = ?").get(w);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:w}),f.unchanged+=1,w;let O=S?"changed":"new",I=S?.first_seen_at??$;if(u.query(`
|
|
471
470
|
INSERT INTO sessions (
|
|
472
471
|
id, source_id, source_session_id, project_id, checkout_id, raw_project_path, raw_path,
|
|
473
472
|
title, message_count, content_hash, status, created_at, updated_at, first_seen_at, last_seen_at
|
|
@@ -485,10 +484,10 @@ This skill is initialized for ${Uf[_]}.
|
|
|
485
484
|
created_at = excluded.created_at,
|
|
486
485
|
updated_at = excluded.updated_at,
|
|
487
486
|
last_seen_at = excluded.last_seen_at
|
|
488
|
-
`).run({$id
|
|
487
|
+
`).run({$id:w,$sourceId:_.id,$sourceSessionId:s.sourceSessionId,$projectId:R,$rawProjectPath:s.rawProjectPath,$rawPath:s.rawPath,$title:s.title,$messageCount:s.messages.length,$contentHash:g,$status:O,$createdAt:s.createdAt,$updatedAt:s.updatedAt,$firstSeenAt:I,$now:$}),u.query("DELETE FROM messages WHERE session_id = ?").run(w),s.messages.forEach((T,L)=>{u.query(`
|
|
489
488
|
INSERT INTO messages (id, session_id, role, content, timestamp, seq_order, content_hash)
|
|
490
489
|
VALUES ($id, $sessionId, $role, $content, $timestamp, $seqOrder, $contentHash)
|
|
491
|
-
`).run({$id:`msg_${
|
|
490
|
+
`).run({$id:`msg_${w}_${L}`,$sessionId:w,$role:T.role,$content:T.content,$timestamp:T.timestamp,$seqOrder:L,$contentHash:i[L]})}),O==="new")f.new+=1;else f.changed+=1;return w}function JU(u,_,s,$,f){let w=u.query("SELECT id FROM sessions WHERE source_id = ? AND status != 'source_missing'").all(_);for(let i of w){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}),f.sourceMissing+=1}}function ug(u,_){let s=new Date().toISOString(),$=[];for(let f of ei){if(!f.detect(_.homeDir))continue;GU(u,f,s);let w={source:f.id,new:0,changed:0,unchanged:0,sourceMissing:0,total:0},i=f.collect(_.homeDir),g=new Set;u.transaction(()=>{for(let S of i){if(_.projectFilter&&S.rawProjectPath!==_.projectFilter)continue;let O=rU(u,f,S,s,w);g.add(O),w.total+=1}if(!_.projectFilter)JU(u,f.id,g,s,w)})(),$.push(w)}return{bySource:$}}var fg=`llm-iwiki
|
|
492
491
|
|
|
493
492
|
Usage:
|
|
494
493
|
llm-iwiki init
|
|
@@ -511,7 +510,7 @@ Usage:
|
|
|
511
510
|
llm-iwiki config set <key> <value>
|
|
512
511
|
llm-iwiki skills [list]
|
|
513
512
|
llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]
|
|
514
|
-
`,
|
|
515
|
-
llm-iwiki skills list #
|
|
516
|
-
llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]`;function
|
|
517
|
-
`);let
|
|
513
|
+
`,wg=`用法:
|
|
514
|
+
llm-iwiki skills list # 列出可用 target 与将写入的 skill
|
|
515
|
+
llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]`;function M(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(fg),0;if(u[0]==="init"){let s=Q(_.homeDir);if(e_(s.configDir,{recursive:!0}),!Z$(s.configFile))Y$(s.configFile,`obsidian_vault = ""
|
|
516
|
+
`);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),f=N($.databaseFile);try{V(f);let w=ug(f,{homeDir:_.homeDir??$.homeDir,projectFilter:s?M(_.cwd,s):null});if(w.bySource.length===0)return _.stdout("No collectors detected on this machine."),0;for(let i of w.bySource)_.stdout(`${i.source}: ${i.total} sessions (new ${i.new}, changed ${i.changed}, unchanged ${i.unchanged}, missing ${i.sourceMissing})`);return 0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.close()}}if(u[0]==="projects"&&u[1]==="list"){let s=Q(_.homeDir),$=N(s.databaseFile);try{V($);let f=$i($);if(f.length===0)return _.stdout("No projects yet. Run: llm-iwiki sync"),0;for(let w of f){let i=w.displayName??w.canonicalName;_.stdout(`${w.id} ${w.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),f=N($.databaseFile);try{V(f);let w=s.startsWith("proj_")?k_(f,s):wu(f,M(_.cwd,s)),i=Fi(f,w.id);if(_.stdout(`project: ${w.displayName??w.canonicalName}`),_.stdout(`id: ${w.id}`),w.canonicalRepoUrl)_.stdout(`repo: ${w.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(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.close()}}if(u[0]==="projects"&&u[1]==="resolve"){let s=u[2]??_.cwd,$=Q(_.homeDir),f=N($.databaseFile);try{V(f);let w=wu(f,M(_.cwd,s));return _.stdout(JSON.stringify(w,null,2)),0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.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 f=Q(_.homeDir),w=N(f.databaseFile);try{V(w);let i=s.startsWith("proj_")?H$(w,s,$):H$(w,wu(w,M(_.cwd,s)).id,$);return _.stdout(JSON.stringify(i,null,2)),0}catch(i){return _.stderr(i instanceof Error?i.message:String(i)),1}finally{w.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 $=M(_.cwd,l(u,"--project")??_.cwd),f=l(u,"--out")??$g(F$($),"summaries-task.md"),w=Q(_.homeDir),i=N(w.databaseFile);try{V(i);let g=wu(i,$),R=Zi(i,g.id,s);return e_(sg(M(_.cwd,f)),{recursive:!0}),Y$(M(_.cwd,f),R.markdown),_.stdout(`prepared summaries task: ${R.sessionCount} sessions -> ${f}`),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),f=N($.databaseFile);try{V(f);let w=nw(_g(M(_.cwd,s),"utf8")),i=Yi(f,w);if(_.stdout(`applied summaries: ${i.written}`),i.skipped.length>0)_.stdout(`skipped (unknown session): ${i.skipped.length}`);return 0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.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 $=M(_.cwd,l(u,"--project")??_.cwd),f=l(u,"--out")??$g(F$($),"experiences-task.md"),w=Q(_.homeDir),i=N(w.databaseFile);try{V(i);let g=wu(i,$),R=fi(i,g.id,s);return e_(sg(M(_.cwd,f)),{recursive:!0}),Y$(M(_.cwd,f),R.markdown),_.stdout(`prepared experiences task: ${R.summaryCount} summaries -> ${f}`),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),f=N($.databaseFile);try{V(f);let w=hw(_g(M(_.cwd,s),"utf8")),i=ii(f,w);return _.stdout(`proposed experiences: ${i.written}`),0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.close()}}if(u[0]==="experiences"&&u[1]==="candidates"){let s=l(u,"--project"),$=Q(_.homeDir),f=N($.databaseFile);try{V(f);let w=s?wu(f,M(_.cwd,s)).id:null,i=gi(f,w);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(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.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),f=N($.databaseFile);try{if(V(f),u[1]==="accept"){let w=Ri(f,s);_.stdout(`accepted: ${w.experienceId} (${w.slug}), linked sessions: ${w.linkedSessions}`)}else Si(f,s),_.stdout(`rejected: ${s}`);return 0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}finally{f.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 f=Q(_.homeDir);e_(f.configDir,{recursive:!0});try{let w=mw(f.configFile,s,$);return _.stdout(`set ${w} = ${$}`),0}catch(w){return _.stderr(w instanceof Error?w.message:String(w)),1}}if(u[0]==="obsidian"&&u[1]==="export"){let s=Q(_.homeDir),$=l(u,"--vault"),f=$?M(_.cwd,$):q$(s.configFile).obsidianVault;if(!f)return _.stderr("No Obsidian vault configured. Run: llm-iwiki config set obsidian.vault <dir>"),1;let w=M(_.cwd,l(u,"--project")??_.cwd),i=u.includes("--force"),g=N(s.databaseFile);try{V(g);let R=wu(g,w),S=Ui(g,f,R,{force:i});_.stdout(`vault: ${f}`),_.stdout(`exported: created ${S.created}, updated ${S.updated}, forced ${S.forced}, conflicts ${S.conflicts.length}`);for(let O of S.conflicts)_.stdout(` conflict (skipped): ${O}`);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 f=Hi($);_.stdout(`notes: ${f.total}, clean: ${f.clean}, needs attention: ${f.entries.length}`);for(let w of f.entries)_.stdout(` ${w.status}: ${w.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&&!W$.includes(s))return _.stderr("Invalid --target. Use codex, claude-code, or cursor."),1;let $=s,f=Ji({cwd:_.cwd,target:$,force:u.includes("--force"),dryRun:u.includes("--dry-run")});return _.stdout(`skills written: ${f.written.length}`),_.stdout(`skills skipped: ${f.skipped.length}`),0}if(u[0]==="skills"&&(u[1]===void 0||u[1]==="list")){_.stdout(wg),_.stdout(""),_.stdout("可用 target:");for(let s of Xi())_.stdout(` ${s.id} (${s.name})`);_.stdout(""),_.stdout(`将写入的 skill (位于 ${G$}/):`);for(let s of ri())_.stdout(` ${s.directory} -> ${s.relPath}`);return 0}if(u[0]==="skills")return _.stderr(`Unknown skills subcommand: ${u[1]}`),_.stderr(wg),1;return _.stderr(`Unknown command: ${u.join(" ")}`),_.stderr(fg),1}var YU=await ig(process.argv.slice(2),{cwd:process.cwd(),stdout:console.log,stderr:console.error});process.exit(YU);
|