agent-skill-manager 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-skill-manager.js +133 -130
- package/dist/{chunk-hw8kyyg5.js → chunk-hkqn9wnw.js} +1 -1
- package/dist/{chunk-6c7f07w3.js → chunk-t50w9h6a.js} +29 -29
- package/package.json +1 -1
- package/dist/chunk-1nnaagv9.js +0 -12
- package/dist/chunk-7fa8jt74.js +0 -91
- package/dist/chunk-dykgxxyr.js +0 -3
- package/dist/chunk-es13zqy2.js +0 -91
- package/dist/chunk-f9v15smy.js +0 -91
- package/dist/chunk-gdjc7mam.js +0 -91
- package/dist/chunk-j64gxcw7.js +0 -91
- package/dist/chunk-jfdmhdsr.js +0 -3
- package/dist/chunk-jqby9n90.js +0 -12
- package/dist/chunk-s73mfpjt.js +0 -91
- package/dist/chunk-vvzggdyd.js +0 -12
- package/dist/chunk-xkxs2gj3.js +0 -12
- package/dist/chunk-y008z8jw.js +0 -12
- package/dist/chunk-zdwywb64.js +0 -12
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as i4,B as a4,C as
|
|
3
|
-
`)}}
|
|
2
|
+
import{A as i4,B as a4,C as h2,D as n4,a as L0,b as I0,c as i2,e as i,f as g4,g as f2,h as k4,i as h4,j as y2,k as v4,l as H,m as u4,n as _4,o as m4,p as x2,q as p4,r as d4,u as c4,v as g2,w as u,x as k2,y as l4}from"./chunk-hkqn9wnw.js";import{E as m,F as D,G as k,H as f4,I as f,J as y4,K as E2,L as Yq,M as P4,N as W$,O as h,P as x4}from"./chunk-b7betbzn.js";var S=D((E8)=>{var T$=Symbol.for("yaml.alias"),q1=Symbol.for("yaml.document"),Tq=Symbol.for("yaml.map"),$1=Symbol.for("yaml.pair"),F$=Symbol.for("yaml.scalar"),Fq=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),w8=(q)=>!!q&&typeof q==="object"&&q[t]===T$,P8=(q)=>!!q&&typeof q==="object"&&q[t]===q1,N8=(q)=>!!q&&typeof q==="object"&&q[t]===Tq,j8=(q)=>!!q&&typeof q==="object"&&q[t]===$1,Z1=(q)=>!!q&&typeof q==="object"&&q[t]===F$,C8=(q)=>!!q&&typeof q==="object"&&q[t]===Fq;function U1(q){if(q&&typeof q==="object")switch(q[t]){case Tq:case Fq:return!0}return!1}function b8(q){if(q&&typeof q==="object")switch(q[t]){case T$:case Tq:case F$:case Fq:return!0}return!1}var S8=(q)=>(Z1(q)||U1(q))&&!!q.anchor;E8.ALIAS=T$;E8.DOC=q1;E8.MAP=Tq;E8.NODE_TYPE=t;E8.PAIR=$1;E8.SCALAR=F$;E8.SEQ=Fq;E8.hasAnchor=S8;E8.isAlias=w8;E8.isCollection=U1;E8.isDocument=P8;E8.isMap=N8;E8.isNode=b8;E8.isPair=j8;E8.isScalar=Z1;E8.isSeq=C8});var v0=D((s8)=>{var g=S(),v=Symbol("break visit"),X1=Symbol("skip children"),n=Symbol("remove node");function Lq(q,$){let Z=Q1($);if(g.isDocument(q)){if(R0(null,q.contents,Z,Object.freeze([q]))===n)q.contents=null}else R0(null,q,Z,Object.freeze([]))}Lq.BREAK=v;Lq.SKIP=X1;Lq.REMOVE=n;function R0(q,$,Z,U){let X=z1(q,$,Z,U);if(g.isNode(X)||g.isPair(X))return G1(q,U,X),R0(q,X,Z,U);if(typeof X!=="symbol"){if(g.isCollection($)){U=Object.freeze(U.concat($));for(let Q=0;Q<$.items.length;++Q){let z=R0(Q,$.items[Q],Z,U);if(typeof z==="number")Q=z-1;else if(z===v)return v;else if(z===n)$.items.splice(Q,1),Q-=1}}else if(g.isPair($)){U=Object.freeze(U.concat($));let Q=R0("key",$.key,Z,U);if(Q===v)return v;else if(Q===n)$.key=null;let z=R0("value",$.value,Z,U);if(z===v)return v;else if(z===n)$.value=null}}return X}async function Iq(q,$){let Z=Q1($);if(g.isDocument(q)){if(await M0(null,q.contents,Z,Object.freeze([q]))===n)q.contents=null}else await M0(null,q,Z,Object.freeze([]))}Iq.BREAK=v;Iq.SKIP=X1;Iq.REMOVE=n;async function M0(q,$,Z,U){let X=await z1(q,$,Z,U);if(g.isNode(X)||g.isPair(X))return G1(q,U,X),M0(q,X,Z,U);if(typeof X!=="symbol"){if(g.isCollection($)){U=Object.freeze(U.concat($));for(let Q=0;Q<$.items.length;++Q){let z=await M0(Q,$.items[Q],Z,U);if(typeof z==="number")Q=z-1;else if(z===v)return v;else if(z===n)$.items.splice(Q,1),Q-=1}}else if(g.isPair($)){U=Object.freeze(U.concat($));let Q=await M0("key",$.key,Z,U);if(Q===v)return v;else if(Q===n)$.key=null;let z=await M0("value",$.value,Z,U);if(z===v)return v;else if(z===n)$.value=null}}return X}function Q1(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function z1(q,$,Z,U){if(typeof Z==="function")return Z(q,$,U);if(g.isMap($))return Z.Map?.(q,$,U);if(g.isSeq($))return Z.Seq?.(q,$,U);if(g.isPair($))return Z.Pair?.(q,$,U);if(g.isScalar($))return Z.Scalar?.(q,$,U);if(g.isAlias($))return Z.Alias?.(q,$,U);return}function G1(q,$,Z){let U=$[$.length-1];if(g.isCollection(U))U.items[q]=Z;else if(g.isPair(U))if(q==="key")U.key=Z;else U.value=Z;else if(g.isDocument(U))U.contents=Z;else{let X=g.isAlias(U)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}s8.visit=Lq;s8.visitAsync=Iq});var L$=D(($5)=>{var J1=S(),t8=v0(),e8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},q5=(q)=>q.replace(/[!,[\]{}]/g,($)=>e8[$]);class p{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},p.defaultYaml,q),this.tags=Object.assign({},p.defaultTags,$)}clone(){let q=new p(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new p(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:p.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},p.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:p.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},p.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),U=Z.shift();switch(U){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[X,Q]=Z;return this.tags[X]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[X]=Z;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let Q=/^\d+\.\d+$/.test(X);return $(6,`Unsupported YAML version ${X}`,Q),!1}}default:return $(0,`Unknown directive ${U}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Q=q.slice(2,-1);if(Q==="!"||Q==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return Q}let[,Z,U]=q.match(/^(.*!)([^!]*)$/s);if(!U)$(`The ${q} tag has no suffix`);let X=this.tags[Z];if(X)try{return X+decodeURIComponent(U)}catch(Q){return $(String(Q)),null}if(Z==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,Z]of Object.entries(this.tags))if(q.startsWith(Z))return $+q5(q.substring(Z.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),U;if(q&&Z.length>0&&J1.isNode(q.contents)){let X={};t8.visit(q.contents,(Q,z)=>{if(J1.isNode(z)&&z.tag)X[z.tag]=!0}),U=Object.keys(X)}else U=[];for(let[X,Q]of Z){if(X==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||U.some((z)=>z.startsWith(Q)))$.push(`%TAG ${X} ${Q}`)}return $.join(`
|
|
3
|
+
`)}}p.defaultYaml={explicit:!1,version:"1.2"};p.defaultTags={"!!":"tag:yaml.org,2002:"};$5.Directives=p});var Kq=D((z5)=>{var Y1=S(),U5=v0();function X5(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(Z)}return!0}function H1(q){let $=new Set;return U5.visit(q,{Value(Z,U){if(U.anchor)$.add(U.anchor)}}),$}function V1(q,$){for(let Z=1;;++Z){let U=`${q}${Z}`;if(!$.has(U))return U}}function Q5(q,$){let Z=[],U=new Map,X=null;return{onAnchor:(Q)=>{Z.push(Q),X??(X=H1(q));let z=V1($,X);return X.add(z),z},setAnchors:()=>{for(let Q of Z){let z=U.get(Q);if(typeof z==="object"&&z.anchor&&(Y1.isScalar(z.node)||Y1.isCollection(z.node)))z.node.anchor=z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=Q,G}}},sourceObjects:U}}z5.anchorIsValid=X5;z5.anchorNames=H1;z5.createNodeAnchors=Q5;z5.findNewAnchor=V1});var I$=D((V5)=>{function u0(q,$,Z,U){if(U&&typeof U==="object")if(Array.isArray(U))for(let X=0,Q=U.length;X<Q;++X){let z=U[X],G=u0(q,U,String(X),z);if(G===void 0)delete U[X];else if(G!==z)U[X]=G}else if(U instanceof Map)for(let X of Array.from(U.keys())){let Q=U.get(X),z=u0(q,U,X,Q);if(z===void 0)U.delete(X);else if(z!==Q)U.set(X,z)}else if(U instanceof Set)for(let X of Array.from(U)){let Q=u0(q,U,X,X);if(Q===void 0)U.delete(X);else if(Q!==X)U.delete(X),U.add(Q)}else for(let[X,Q]of Object.entries(U)){let z=u0(q,U,X,Q);if(z===void 0)delete U[X];else if(z!==Q)U[X]=z}return q.call($,Z,U)}V5.applyReviver=u0});var q0=D((_5)=>{var B5=S();function W1(q,$,Z){if(Array.isArray(q))return q.map((U,X)=>W1(U,String(X),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!B5.hasAnchor(q))return q.toJSON($,Z);let U={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,U),Z.onCreate=(Q)=>{U.res=Q,delete Z.onCreate};let X=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(X);return X}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}_5.toJS=W1});var Rq=D((L5)=>{var T5=I$(),B1=S(),F5=q0();class _1{constructor(q){Object.defineProperty(this,B1.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:Z,onAnchor:U,reviver:X}={}){if(!B1.isDocument(q))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},z=F5.toJS(this,"",Q);if(typeof U==="function")for(let{count:G,res:J}of Q.anchors.values())U(J,G);return typeof X==="function"?T5.applyReviver(X,{"":z},"",z):z}}L5.NodeBase=_1});var m0=D((D5)=>{var K5=Kq(),R5=v0(),A0=S(),M5=Rq(),A5=q0();class O1 extends M5.NodeBase{constructor(q){super(A0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let Z;if($?.aliasResolveCache)Z=$.aliasResolveCache;else if(Z=[],R5.visit(q,{Node:(X,Q)=>{if(A0.isAlias(Q)||A0.hasAnchor(Q))Z.push(Q)}}),$)$.aliasResolveCache=Z;let U=void 0;for(let X of Z){if(X===this)break;if(X.anchor===this.source)U=X}return U}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:U,maxAliasCount:X}=$,Q=this.resolve(U,$);if(!Q){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=Z.get(Q);if(!z)A5.toJS(Q,null,$),z=Z.get(Q);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=Mq(U,Q,Z);if(z.count*z.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,$,Z){let U=`*${this.source}`;if(q){if(K5.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if(q.implicitKey)return`${U} `}return U}}function Mq(q,$,Z){if(A0.isAlias($)){let U=$.resolve(q),X=Z&&U&&Z.get(U);return X?X.count*X.aliasCount:0}else if(A0.isCollection($)){let U=0;for(let X of $.items){let Q=Mq(q,X,Z);if(Q>U)U=Q}return U}else if(A0.isPair($)){let U=Mq(q,$.key,Z),X=Mq(q,$.value,Z);return Math.max(U,X)}return 1}D5.Alias=O1});var x=D((b5)=>{var P5=S(),N5=Rq(),j5=q0(),C5=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class Y0 extends N5.NodeBase{constructor(q){super(P5.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:j5.toJS(this.value,q,$)}toString(){return String(this.value)}}Y0.BLOCK_FOLDED="BLOCK_FOLDED";Y0.BLOCK_LITERAL="BLOCK_LITERAL";Y0.PLAIN="PLAIN";Y0.QUOTE_DOUBLE="QUOTE_DOUBLE";Y0.QUOTE_SINGLE="QUOTE_SINGLE";b5.Scalar=Y0;b5.isScalarValue=C5});var p0=D((k5)=>{var f5=m0(),H0=S(),T1=x(),y5="tag:yaml.org,2002:";function x5(q,$,Z){if($){let U=Z.filter((Q)=>Q.tag===$),X=U.find((Q)=>!Q.format)??U[0];if(!X)throw Error(`Tag ${$} not found`);return X}return Z.find((U)=>U.identify?.(q)&&!U.format)}function g5(q,$,Z){if(H0.isDocument(q))q=q.contents;if(H0.isNode(q))return q;if(H0.isPair(q)){let V=Z.schema[H0.MAP].createNode?.(Z.schema,null,Z);return V.items.push(q),V}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:U,onAnchor:X,onTagObj:Q,schema:z,sourceObjects:G}=Z,J=void 0;if(U&&q&&typeof q==="object")if(J=G.get(q),J)return J.anchor??(J.anchor=X(q)),new f5.Alias(J.anchor);else J={anchor:null,node:null},G.set(q,J);if($?.startsWith("!!"))$=y5+$.slice(2);let Y=x5(q,$,z.tags);if(!Y){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let V=new T1.Scalar(q);if(J)J.node=V;return V}Y=q instanceof Map?z[H0.MAP]:(Symbol.iterator in Object(q))?z[H0.SEQ]:z[H0.MAP]}if(Q)Q(Y),delete Z.onTagObj;let B=Y?.createNode?Y.createNode(Z.schema,q,Z):typeof Y?.nodeClass?.from==="function"?Y.nodeClass.from(Z.schema,q,Z):new T1.Scalar(q);if($)B.tag=$;else if(!Y.default)B.tag=Y.tag;if(J)J.node=B;return B}k5.createNode=g5});var Aq=D((m5)=>{var v5=p0(),s=S(),u5=Rq();function K$(q,$,Z){let U=Z;for(let X=$.length-1;X>=0;--X){let Q=$[X];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let z=[];z[Q]=U,U=z}else U=new Map([[Q,U]])}return v5.createNode(U,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var F1=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class L1 extends u5.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((Z)=>s.isNode(Z)||s.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(F1(q))this.add($);else{let[Z,...U]=q,X=this.get(Z,!0);if(s.isCollection(X))X.addIn(U,$);else if(X===void 0&&this.schema)this.set(Z,K$(this.schema,U,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${U}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let U=this.get($,!0);if(s.isCollection(U))return U.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...U]=q,X=this.get(Z,!0);if(U.length===0)return!$&&s.isScalar(X)?X.value:X;else return s.isCollection(X)?X.getIn(U,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!s.isPair($))return!1;let Z=$.value;return Z==null||q&&s.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn(q){let[$,...Z]=q;if(Z.length===0)return this.has($);let U=this.get($,!0);return s.isCollection(U)?U.hasIn(Z):!1}setIn(q,$){let[Z,...U]=q;if(U.length===0)this.set(Z,$);else{let X=this.get(Z,!0);if(s.isCollection(X))X.setIn(U,$);else if(X===void 0&&this.schema)this.set(Z,K$(this.schema,U,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${U}`)}}}m5.Collection=L1;m5.collectionFromPath=K$;m5.isEmptyPath=F1});var d0=D((a5)=>{var l5=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function R$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var i5=(q,$,Z)=>q.endsWith(`
|
|
4
4
|
`)?R$(Z,$):Z.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+R$(Z,$):(q.endsWith(" ")?"":" ")+Z;a5.indentComment=R$;a5.lineComment=i5;a5.stringifyComment=l5});var K1=D((t5)=>{function r5(q,$,Z="flow",{indentAtStart:
|
|
6
|
+
`+R$(Z,$):(q.endsWith(" ")?"":" ")+Z;a5.indentComment=R$;a5.lineComment=i5;a5.stringifyComment=l5});var K1=D((t5)=>{function r5(q,$,Z="flow",{indentAtStart:U,lineWidth:X=80,minContentWidth:Q=20,onFold:z,onOverflow:G}={}){if(!X||X<0)return q;if(X<Q)Q=0;let J=Math.max(1+Q,1+X-$.length);if(q.length<=J)return q;let Y=[],B={},V=X-$.length;if(typeof U==="number")if(U>X-Math.max(2,Q))Y.push(0);else V=X-U;let W=void 0,T=void 0,F=!1,_=-1,O=-1,R=-1;if(Z==="block"){if(_=I1(q,_,$.length),_!==-1)V=_+J}for(let A;A=q[_+=1];){if(Z==="quoted"&&A==="\\"){switch(O=_,q[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}R=_}if(A===`
|
|
7
7
|
`){if(Z==="block")_=I1(q,_,$.length);V=_+$.length+J,W=void 0}else{if(A===" "&&T&&T!==" "&&T!==`
|
|
8
8
|
`&&T!=="\t"){let w=q[_+1];if(w&&w!==" "&&w!==`
|
|
9
9
|
`&&w!=="\t")W=_}if(_>=V)if(W)Y.push(W),V=W+J,W=void 0;else if(Z==="quoted"){while(T===" "||T==="\t")T=A,A=q[_+=1],F=!0;let w=_>R+1?_-2:O-1;if(B[w])return q;Y.push(w),B[w]=!0,V=w+J,W=void 0}else F=!0}T=A}if(F&&G)G();if(Y.length===0)return q;if(z)z();let M=q.slice(0,Y[0]);for(let A=0;A<Y.length;++A){let w=Y[A],L=Y[A+1]||q.length;if(w===0)M=`
|
|
10
10
|
${$}${q.slice(0,L)}`;else{if(Z==="quoted"&&B[w])M+=`${q[w]}\\`;M+=`
|
|
11
|
-
${$}${q.slice(w+1,L)}`}}return M}function I1(q,$,Z){let X
|
|
12
|
-
`);X
|
|
13
|
-
`){if(
|
|
11
|
+
${$}${q.slice(w+1,L)}`}}return M}function I1(q,$,Z){let U=$,X=$+1,Q=q[X];while(Q===" "||Q==="\t")if($<X+Z)Q=q[++$];else{do Q=q[++$];while(Q&&Q!==`
|
|
12
|
+
`);U=$,X=$+1,Q=q[X]}return U}t5.FOLD_BLOCK="block";t5.FOLD_FLOW="flow";t5.FOLD_QUOTED="quoted";t5.foldFlowLines=r5});var l0=D((zZ)=>{var c=x(),$0=K1(),wq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Pq=(q)=>/^(%|---|\.\.\.)/m.test(q);function UZ(q,$,Z){if(!$||$<0)return!1;let U=$-Z,X=q.length;if(X<=U)return!1;for(let Q=0,z=0;Q<X;++Q)if(q[Q]===`
|
|
13
|
+
`){if(Q-z>U)return!0;if(z=Q+1,X-z<=U)return!1}return!0}function c0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:U}=$,X=$.options.doubleQuotedMinMultiLineLength,Q=$.indent||(Pq(q)?" ":""),z="",G=0;for(let J=0,Y=Z[J];Y;Y=Z[++J]){if(Y===" "&&Z[J+1]==="\\"&&Z[J+2]==="n")z+=Z.slice(G,J)+"\\ ",J+=1,G=J,Y="\\";if(Y==="\\")switch(Z[J+1]){case"u":{z+=Z.slice(G,J);let B=Z.substr(J+2,4);switch(B){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(B.substr(0,2)==="00")z+="\\x"+B.substr(2);else z+=Z.substr(J,6)}J+=5,G=J+1}break;case"n":if(U||Z[J+2]==='"'||Z.length<X)J+=1;else{z+=Z.slice(G,J)+`
|
|
14
14
|
|
|
15
15
|
`;while(Z[J+2]==="\\"&&Z[J+3]==="n"&&Z[J+4]!=='"')z+=`
|
|
16
|
-
`,J+=2;if(z+=
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(q))return c0(q,$);let Z=$.indent||(Pq(q)?" ":""),
|
|
18
|
-
${Z}`)+"'";return $.implicitKey?
|
|
16
|
+
`,J+=2;if(z+=Q,Z[J+2]===" ")z+="\\";J+=1,G=J+1}break;default:J+=1}}return z=G?z+Z.slice(G):Z,U?z:$0.foldFlowLines(z,Q,$0.FOLD_QUOTED,wq($,!1))}function M$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return c0(q,$);let Z=$.indent||(Pq(q)?" ":""),U="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${Z}`)+"'";return $.implicitKey?U:$0.foldFlowLines(U,Z,$0.FOLD_FLOW,wq($,!1))}function D0(q,$){let{singleQuote:Z}=$.options,U;if(Z===!1)U=c0;else{let X=q.includes('"'),Q=q.includes("'");if(X&&!Q)U=M$;else if(Q&&!X)U=c0;else U=Z?M$:c0}return U(q,$)}var A$;try{A$=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{A$=/\n+(?!\n|$)/g}function Dq({comment:q,type:$,value:Z},X,Q
|
|
21
|
+
|$)`,"g")}catch{A$=/\n+(?!\n|$)/g}function Dq({comment:q,type:$,value:Z},U,X,Q){let{blockQuote:z,commentString:G,lineWidth:J}=U.options;if(!z||/\n[\t ]+$/.test(Z))return D0(Z,U);let Y=U.indent||(U.forceBlockIndent||Pq(Z)?" ":""),B=z==="literal"?!0:z==="folded"||$===c.Scalar.BLOCK_FOLDED?!1:$===c.Scalar.BLOCK_LITERAL?!0:!UZ(Z,J,Y.length);if(!Z)return B?`|
|
|
22
22
|
`:`>
|
|
23
23
|
`;let V,W;for(W=Z.length;W>0;--W){let L=Z[W-1];if(L!==`
|
|
24
24
|
`&&L!=="\t"&&L!==" ")break}let T=Z.substring(W),F=T.indexOf(`
|
|
25
|
-
`);if(F===-1)V="-";else if(Z===T||F!==T.length-1){if(V="+",
|
|
25
|
+
`);if(F===-1)V="-";else if(Z===T||F!==T.length-1){if(V="+",Q)Q()}else V="";if(T){if(Z=Z.slice(0,-T.length),T[T.length-1]===`
|
|
26
26
|
`)T=T.slice(0,-1);T=T.replace(A$,`$&${Y}`)}let _=!1,O,R=-1;for(O=0;O<Z.length;++O){let L=Z[O];if(L===" ")_=!0;else if(L===`
|
|
27
|
-
`)R=O;else break}let M=Z.substring(0,R<O?R+1:O);if(M)Z=Z.substring(M.length),M=M.replace(/\n+/g,`$&${Y}`);let w=(_?Y?"2":"1":"")+V;if(q){if(w+=" "+G(q.replace(/ ?[\r\n]+/g," ")),
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),I=!1,P=wq(
|
|
27
|
+
`)R=O;else break}let M=Z.substring(0,R<O?R+1:O);if(M)Z=Z.substring(M.length),M=M.replace(/\n+/g,`$&${Y}`);let w=(_?Y?"2":"1":"")+V;if(q){if(w+=" "+G(q.replace(/ ?[\r\n]+/g," ")),X)X()}if(!B){let L=Z.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),I=!1,P=wq(U,!0);if(z!=="folded"&&$!==c.Scalar.BLOCK_FOLDED)P.onOverflow=()=>{I=!0};let K=$0.foldFlowLines(`${M}${L}${T}`,Y,$0.FOLD_BLOCK,P);if(!I)return`>${w}
|
|
29
29
|
${Y}${K}`}return Z=Z.replace(/\n+/g,`$&${Y}`),`|${w}
|
|
30
|
-
${Y}${M}${Z}${T}`}function
|
|
31
|
-
`)||B&&/[[\]{},]/.test(
|
|
32
|
-
`)?D0(
|
|
33
|
-
`))return Dq(q,$,Z,
|
|
34
|
-
${J}`);if(z){let W=(_)=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(V),{compat:T,tags:F}=$.doc.schema;if(F.some(W)||T?.some(W))return D0(
|
|
35
|
-
${$.indent}${G}`}OZ.createStringifyContext=VZ;OZ.stringify=_Z});var A1=D((IZ)=>{var e=S(),R1=x(),M1=i0(),a0=d0();function LZ({key:q,value:$},Z,X
|
|
30
|
+
${Y}${M}${Z}${T}`}function XZ(q,$,Z,U){let{type:X,value:Q}=q,{actualString:z,implicitKey:G,indent:J,indentStep:Y,inFlow:B}=$;if(G&&Q.includes(`
|
|
31
|
+
`)||B&&/[[\]{},]/.test(Q))return D0(Q,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return G||B||!Q.includes(`
|
|
32
|
+
`)?D0(Q,$):Dq(q,$,Z,U);if(!G&&!B&&X!==c.Scalar.PLAIN&&Q.includes(`
|
|
33
|
+
`))return Dq(q,$,Z,U);if(Pq(Q)){if(J==="")return $.forceBlockIndent=!0,Dq(q,$,Z,U);else if(G&&J===Y)return D0(Q,$)}let V=Q.replace(/\n+/g,`$&
|
|
34
|
+
${J}`);if(z){let W=(_)=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(V),{compat:T,tags:F}=$.doc.schema;if(F.some(W)||T?.some(W))return D0(Q,$)}return G?V:$0.foldFlowLines(V,J,$0.FOLD_FLOW,wq($,!1))}function QZ(q,$,Z,U){let{implicitKey:X,inFlow:Q}=$,z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:G}=q;if(G!==c.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=c.Scalar.QUOTE_DOUBLE}let J=(B)=>{switch(B){case c.Scalar.BLOCK_FOLDED:case c.Scalar.BLOCK_LITERAL:return X||Q?D0(z.value,$):Dq(z,$,Z,U);case c.Scalar.QUOTE_DOUBLE:return c0(z.value,$);case c.Scalar.QUOTE_SINGLE:return M$(z.value,$);case c.Scalar.PLAIN:return XZ(z,$,Z,U);default:return null}},Y=J(G);if(Y===null){let{defaultKeyType:B,defaultStringType:V}=$.options,W=X&&B||V;if(Y=J(W),Y===null)throw Error(`Unsupported default string type ${W}`)}return Y}zZ.stringifyString=QZ});var i0=D((OZ)=>{var JZ=Kq(),Z0=S(),YZ=d0(),HZ=l0();function VZ(q,$){let Z=Object.assign({blockQuote:!0,commentString:YZ.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,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,$),U;switch(Z.collectionStyle){case"block":U=!1;break;case"flow":U=!0;break;default:U=null}return{anchors:new Set,doc:q,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:U,options:Z}}function WZ(q,$){if($.tag){let X=q.filter((Q)=>Q.tag===$.tag);if(X.length>0)return X.find((Q)=>Q.format===$.format)??X[0]}let Z=void 0,U;if(Z0.isScalar($)){U=$.value;let X=q.filter((Q)=>Q.identify?.(U));if(X.length>1){let Q=X.filter((z)=>z.test);if(Q.length>0)X=Q}Z=X.find((Q)=>Q.format===$.format)??X.find((Q)=>!Q.format)}else U=$,Z=q.find((X)=>X.nodeClass&&U instanceof X.nodeClass);if(!Z){let X=U?.constructor?.name??(U===null?"null":typeof U);throw Error(`Tag not resolved for ${X} value`)}return Z}function BZ(q,$,{anchors:Z,doc:U}){if(!U.directives)return"";let X=[],Q=(Z0.isScalar(q)||Z0.isCollection(q))&&q.anchor;if(Q&&JZ.anchorIsValid(Q))Z.add(Q),X.push(`&${Q}`);let z=q.tag??($.default?null:$.tag);if(z)X.push(U.directives.tagString(z));return X.join(" ")}function _Z(q,$,Z,U){if(Z0.isPair(q))return q.toString($,Z,U);if(Z0.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let X=void 0,Q=Z0.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>X=J});X??(X=WZ($.doc.schema.tags,Q));let z=BZ(Q,X,$);if(z.length>0)$.indentAtStart=($.indentAtStart??0)+z.length+1;let G=typeof X.stringify==="function"?X.stringify(Q,$,Z,U):Z0.isScalar(Q)?HZ.stringifyString(Q,$,Z,U):Q.toString($,Z,U);if(!z)return G;return Z0.isScalar(Q)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
|
|
35
|
+
${$.indent}${G}`}OZ.createStringifyContext=VZ;OZ.stringify=_Z});var A1=D((IZ)=>{var e=S(),R1=x(),M1=i0(),a0=d0();function LZ({key:q,value:$},Z,U,X){let{allNullValues:Q,doc:z,indent:G,indentStep:J,options:{commentString:Y,indentSeq:B,simpleKeys:V}}=Z,W=e.isNode(q)&&q.comment||null;if(V){if(W)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let T=!V&&(!q||W&&$==null&&!Z.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===R1.Scalar.BLOCK_FOLDED||q.type===R1.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!T&&(V||!Q),indent:G+J});let F=!1,_=!1,O=M1.stringify(q,Z,()=>F=!0,()=>_=!0);if(!T&&!Z.inFlow&&O.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");T=!0}if(Z.inFlow){if(Q||$==null){if(F&&U)U();return O===""?"?":T?`? ${O}`:O}}else if(Q&&!V||$==null&&T){if(O=`? ${O}`,W&&!F)O+=a0.lineComment(O,Z.indent,Y(W));else if(_&&X)X();return O}if(F)W=null;if(T){if(W)O+=a0.lineComment(O,Z.indent,Y(W));O=`? ${O}
|
|
36
36
|
${G}:`}else if(O=`${O}:`,W)O+=a0.lineComment(O,Z.indent,Y(W));let R,M,A;if(e.isNode($))R=!!$.spaceBefore,M=$.commentBefore,A=$.comment;else if(R=!1,M=null,A=null,$&&typeof $==="object")$=z.createNode($);if(Z.implicitKey=!1,!T&&!W&&e.isScalar($))Z.indentAtStart=O.length+1;if(_=!1,!B&&J.length>=2&&!Z.inFlow&&!T&&e.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let w=!1,L=M1.stringify($,Z,()=>w=!0,()=>_=!0),I=" ";if(W||R||M){if(I=R?`
|
|
37
37
|
`:"",M){let P=Y(M);I+=`
|
|
38
38
|
${a0.indentComment(P,Z.indent)}`}if(L===""&&!Z.inFlow){if(I===`
|
|
@@ -42,34 +42,34 @@ ${a0.indentComment(P,Z.indent)}`}if(L===""&&!Z.inFlow){if(I===`
|
|
|
42
42
|
${Z.indent}`}else if(!T&&e.isCollection($)){let P=L[0],K=L.indexOf(`
|
|
43
43
|
`),j=K!==-1,C=Z.inFlow??$.flow??$.items.length===0;if(j||!C){let y=!1;if(j&&(P==="&"||P==="!")){let E=L.indexOf(" ");if(P==="&"&&E!==-1&&E<K&&L[E+1]==="!")E=L.indexOf(" ",E+1);if(E===-1||K<E)y=!0}if(!y)I=`
|
|
44
44
|
${Z.indent}`}}else if(L===""||L[0]===`
|
|
45
|
-
`)I="";if(O+=I+L,Z.inFlow){if(w&&
|
|
45
|
+
`)I="";if(O+=I+L,Z.inFlow){if(w&&U)U()}else if(A&&!w)O+=a0.lineComment(O,Z.indent,Y(A));else if(_&&X)X();return O}IZ.stringifyPair=LZ});var D$=D((AZ)=>{var D1=k("process");function RZ(q,...$){if(q==="debug")console.log(...$)}function MZ(q,$){if(q==="debug"||q==="warn")if(typeof D1.emitWarning==="function")D1.emitWarning($);else console.warn($)}AZ.debug=RZ;AZ.warn=MZ});var Cq=D((NZ)=>{var n0=S(),w1=x(),Nq="<<",jq={identify:(q)=>q===Nq||typeof q==="symbol"&&q.description===Nq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new w1.Scalar(Symbol(Nq)),{addToJSMap:P1}),stringify:()=>Nq},PZ=(q,$)=>(jq.identify($)||n0.isScalar($)&&(!$.type||$.type===w1.Scalar.PLAIN)&&jq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===jq.tag&&Z.default);function P1(q,$,Z){if(Z=q&&n0.isAlias(Z)?Z.resolve(q.doc):Z,n0.isSeq(Z))for(let U of Z.items)w$(q,$,U);else if(Array.isArray(Z))for(let U of Z)w$(q,$,U);else w$(q,$,Z)}function w$(q,$,Z){let U=q&&n0.isAlias(Z)?Z.resolve(q.doc):Z;if(!n0.isMap(U))throw Error("Merge sources must be maps or map aliases");let X=U.toJSON(null,q,Map);for(let[Q,z]of X)if($ instanceof Map){if(!$.has(Q))$.set(Q,z)}else if($ instanceof Set)$.add(Q);else if(!Object.prototype.hasOwnProperty.call($,Q))Object.defineProperty($,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});return $}NZ.addMergeToJSMap=P1;NZ.isMergeKey=PZ;NZ.merge=jq});var N$=D((xZ)=>{var SZ=D$(),N1=Cq(),EZ=i0(),j1=S(),P$=q0();function fZ(q,$,{key:Z,value:U}){if(j1.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,U);else if(N1.isMergeKey(q,Z))N1.addMergeToJSMap(q,$,U);else{let X=P$.toJS(Z,"",q);if($ instanceof Map)$.set(X,P$.toJS(U,X,q));else if($ instanceof Set)$.add(X);else{let Q=yZ(Z,X,q),z=P$.toJS(U,Q,q);if(Q in $)Object.defineProperty($,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});else $[Q]=z}}return $}function yZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(j1.isNode(q)&&Z?.doc){let U=EZ.createStringifyContext(Z.doc,{});U.anchors=new Set;for(let Q of Z.anchors.keys())U.anchors.add(Q.anchor);U.inFlow=!0,U.inStringifyKey=!0;let X=q.toString(U);if(!Z.mapKeyWarned){let Q=JSON.stringify(X);if(Q.length>40)Q=Q.substring(0,36)+'..."';SZ.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return X}return JSON.stringify($)}xZ.addPairToJSMap=fZ});var U0=D((uZ)=>{var C1=p0(),kZ=A1(),hZ=N$(),bq=S();function vZ(q,$,Z){let U=C1.createNode(q,void 0,Z),X=C1.createNode($,void 0,Z);return new Sq(U,X)}class Sq{constructor(q,$=null){Object.defineProperty(this,bq.NODE_TYPE,{value:bq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:Z}=this;if(bq.isNode($))$=$.clone(q);if(bq.isNode(Z))Z=Z.clone(q);return new Sq($,Z)}toJSON(q,$){let Z=$?.mapAsMap?new Map:{};return hZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?kZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}uZ.Pair=Sq;uZ.createPair=vZ});var j$=D((iZ)=>{var V0=S(),b1=i0(),Eq=d0();function dZ(q,$,Z){return($.inFlow??q.flow?lZ:cZ)(q,$,Z)}function cZ({comment:q,items:$},Z,{blockItemPrefix:U,flowChars:X,itemIndent:Q,onChompKeep:z,onComment:G}){let{indent:J,options:{commentString:Y}}=Z,B=Object.assign({},Z,{indent:Q,type:null}),V=!1,W=[];for(let F=0;F<$.length;++F){let _=$[F],O=null;if(V0.isNode(_)){if(!V&&_.spaceBefore)W.push("");if(fq(Z,W,_.commentBefore,V),_.comment)O=_.comment}else if(V0.isPair(_)){let M=V0.isNode(_.key)?_.key:null;if(M){if(!V&&M.spaceBefore)W.push("");fq(Z,W,M.commentBefore,V)}}V=!1;let R=b1.stringify(_,B,()=>O=null,()=>V=!0);if(O)R+=Eq.lineComment(R,Q,Y(O));if(V&&O)V=!1;W.push(U+R)}let T;if(W.length===0)T=X.start+X.end;else{T=W[0];for(let F=1;F<W.length;++F){let _=W[F];T+=_?`
|
|
46
46
|
${J}${_}`:`
|
|
47
47
|
`}}if(q){if(T+=`
|
|
48
|
-
`+Eq.indentComment(Y(q),J),G)G()}else if(V&&z)z();return T}function lZ({items:q},$,{flowChars:Z,itemIndent:
|
|
48
|
+
`+Eq.indentComment(Y(q),J),G)G()}else if(V&&z)z();return T}function lZ({items:q},$,{flowChars:Z,itemIndent:U}){let{indent:X,indentStep:Q,flowCollectionPadding:z,options:{commentString:G}}=$;U+=Q;let J=Object.assign({},$,{indent:U,inFlow:!0,type:null}),Y=!1,B=0,V=[];for(let F=0;F<q.length;++F){let _=q[F],O=null;if(V0.isNode(_)){if(_.spaceBefore)V.push("");if(fq($,V,_.commentBefore,!1),_.comment)O=_.comment}else if(V0.isPair(_)){let M=V0.isNode(_.key)?_.key:null;if(M){if(M.spaceBefore)V.push("");if(fq($,V,M.commentBefore,!1),M.comment)Y=!0}let A=V0.isNode(_.value)?_.value:null;if(A){if(A.comment)O=A.comment;if(A.commentBefore)Y=!0}else if(_.value==null&&M?.comment)O=M.comment}if(O)Y=!0;let R=b1.stringify(_,J,()=>O=null);if(F<q.length-1)R+=",";if(O)R+=Eq.lineComment(R,U,G(O));if(!Y&&(V.length>B||R.includes(`
|
|
49
49
|
`)))Y=!0;V.push(R),B=V.length}let{start:W,end:T}=Z;if(V.length===0)return W+T;else{if(!Y){let F=V.reduce((_,O)=>_+O.length+2,2);Y=$.options.lineWidth>0&&F>$.options.lineWidth}if(Y){let F=W;for(let _ of V)F+=_?`
|
|
50
|
-
${
|
|
50
|
+
${Q}${X}${_}`:`
|
|
51
51
|
`;return`${F}
|
|
52
|
-
${
|
|
53
|
-
`:" ")}return
|
|
54
|
-
${
|
|
55
|
-
${U.comment}`:X.comment}X=Q}q.items[Z]=uq.isPair(X)?X:new k$.Pair(X)}else $("Expected a sequence for this tag");return q}function c1(q,$,Z){let{replacer:X}=Z,Q=new H3.YAMLSeq(q);Q.tag="tag:yaml.org,2002:pairs";let U=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof X==="function")z=X.call($,String(U++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let Y=Object.keys(z);if(Y.length===1)G=Y[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else G=z;Q.items.push(k$.createPair(G,J,Z))}return Q}var V3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d1,createNode:c1};W3.createPairs=c1;W3.pairs=V3;W3.resolvePairs=d1});var u$=D((L3)=>{var l1=S(),v$=q0(),t0=U0(),T3=z0(),i1=mq();class W0 extends T3.YAMLSeq{constructor(){super();this.add=t0.YAMLMap.prototype.add.bind(this),this.delete=t0.YAMLMap.prototype.delete.bind(this),this.get=t0.YAMLMap.prototype.get.bind(this),this.has=t0.YAMLMap.prototype.has.bind(this),this.set=t0.YAMLMap.prototype.set.bind(this),this.tag=W0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let X of this.items){let Q,U;if(l1.isPair(X))Q=v$.toJS(X.key,"",$),U=v$.toJS(X.value,Q,$);else Q=v$.toJS(X,"",$);if(Z.has(Q))throw Error("Ordered maps must not include duplicate keys");Z.set(Q,U)}return Z}static from(q,$,Z){let X=i1.createPairs(q,$,Z),Q=new this;return Q.items=X.items,Q}}W0.tag="tag:yaml.org,2002:omap";var F3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:W0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=i1.resolvePairs(q,$),X=[];for(let{key:Q}of Z.items)if(l1.isScalar(Q))if(X.includes(Q.value))$(`Ordered maps must not include duplicate keys: ${Q.value}`);else X.push(Q.value);return Object.assign(new W0,Z)},createNode:(q,$,Z)=>W0.from(q,$,Z)};L3.YAMLOMap=W0;L3.omap=F3});var r1=D((R3)=>{var a1=x();function n1({value:q,source:$},Z){if($&&(q?s1:o1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var s1={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new a1.Scalar(!0),stringify:n1},o1={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new a1.Scalar(!1),stringify:n1};R3.falseTag=o1;R3.trueTag=s1});var t1=D((j3)=>{var D3=x(),m$=N0(),w3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:m$.stringifyNumber},P3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():m$.stringifyNumber(q)}},N3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new D3.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let X=q.substring(Z+1).replace(/_/g,"");if(X[X.length-1]==="0")$.minFractionDigits=X.length}return $},stringify:m$.stringifyNumber};j3.float=N3;j3.floatExp=P3;j3.floatNaN=w3});var q9=D((g3)=>{var e1=N0(),e0=(q)=>typeof q==="bigint"||Number.isInteger(q);function pq(q,$,Z,{intAsBigInt:X}){let Q=q[0];if(Q==="-"||Q==="+")$+=1;if(q=q.substring($).replace(/_/g,""),X){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return Q==="-"?BigInt(-1)*z:z}let U=parseInt(q,Z);return Q==="-"?-1*U:U}function p$(q,$,Z){let{value:X}=q;if(e0(X)){let Q=X.toString($);return X<0?"-"+Z+Q.substr(1):Z+Q}return e1.stringifyNumber(q)}var E3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>pq(q,2,2,Z),stringify:(q)=>p$(q,2,"0b")},f3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>pq(q,1,8,Z),stringify:(q)=>p$(q,8,"0")},y3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>pq(q,0,10,Z),stringify:e1.stringifyNumber},x3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>pq(q,2,16,Z),stringify:(q)=>p$(q,16,"0x")};g3.int=y3;g3.intBin=E3;g3.intHex=x3;g3.intOct=f3});var d$=D((p3)=>{var lq=S(),dq=X0(),cq=U0();class B0 extends cq.YAMLMap{constructor(q){super(q);this.tag=B0.tag}add(q){let $;if(lq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new dq.Pair(q.key,null);else $=new dq.Pair(q,null);if(!cq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=cq.findPair(this.items,q);return!$&&lq.isPair(Z)?lq.isScalar(Z.key)?Z.key.value:Z.key:Z}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let Z=cq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new dq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($))for(let U of $){if(typeof X==="function")U=X.call($,U,U);Q.items.push(dq.createPair(U,null,Z))}return Q}}B0.tag="tag:yaml.org,2002:set";var m3={collection:"map",identify:(q)=>q instanceof Set,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>B0.from(q,$,Z),resolve(q,$){if(lq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new B0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};p3.YAMLSet=B0;p3.set=m3});var l$=D((n3)=>{var l3=N0();function c$(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,Q=(z)=>$?BigInt(z):Number(z),U=X.replace(/_/g,"").split(":").reduce((z,G)=>z*Q(60)+Q(G),Q(0));return Z==="-"?Q(-1)*U:U}function $9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return l3.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let Q=Z(60),U=[$%Q];if($<60)U.unshift(0);else if($=($-U[0])/Q,U.unshift($%Q),$>=60)$=($-U[0])/Q,U.unshift($);return X+U.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var i3={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>c$(q,Z),stringify:$9},a3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>c$(q,!1),stringify:$9},Z9={identify:(q)=>q 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(q){let $=q.match(Z9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,Q,U,z,G]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Y=Date.UTC(Z,X-1,Q,U||0,z||0,G||0,J),B=$[8];if(B&&B!=="Z"){let V=c$(B,!1);if(Math.abs(V)<30)V*=60;Y-=60000*V}return new Date(Y)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};n3.floatTime=a3;n3.intTime=i3;n3.timestamp=Z9});var Q9=D((J7)=>{var t3=w0(),e3=hq(),q7=P0(),$7=o0(),Z7=h$(),X9=r1(),i$=t1(),iq=q9(),X7=Cq(),Q7=u$(),U7=mq(),z7=d$(),a$=l$(),G7=[t3.map,q7.seq,$7.string,e3.nullTag,X9.trueTag,X9.falseTag,iq.intBin,iq.intOct,iq.int,iq.intHex,i$.floatNaN,i$.floatExp,i$.float,Z7.binary,X7.merge,Q7.omap,U7.pairs,z7.set,a$.intTime,a$.floatTime,a$.timestamp];J7.schema=G7});var _9=D((F7)=>{var J9=w0(),H7=hq(),Y9=P0(),V7=o0(),W7=C$(),n$=S$(),s$=f$(),B7=u1(),_7=p1(),H9=h$(),qq=Cq(),V9=u$(),W9=mq(),U9=Q9(),B9=d$(),aq=l$(),z9=new Map([["core",B7.schema],["failsafe",[J9.map,Y9.seq,V7.string]],["json",_7.schema],["yaml11",U9.schema],["yaml-1.1",U9.schema]]),G9={binary:H9.binary,bool:W7.boolTag,float:n$.float,floatExp:n$.floatExp,floatNaN:n$.floatNaN,floatTime:aq.floatTime,int:s$.int,intHex:s$.intHex,intOct:s$.intOct,intTime:aq.intTime,map:J9.map,merge:qq.merge,null:H7.nullTag,omap:V9.omap,pairs:W9.pairs,seq:Y9.seq,set:B9.set,timestamp:aq.timestamp},O7={"tag:yaml.org,2002:binary":H9.binary,"tag:yaml.org,2002:merge":qq.merge,"tag:yaml.org,2002:omap":V9.omap,"tag:yaml.org,2002:pairs":W9.pairs,"tag:yaml.org,2002:set":B9.set,"tag:yaml.org,2002:timestamp":aq.timestamp};function T7(q,$,Z){let X=z9.get($);if(X&&!q)return Z&&!X.includes(qq.merge)?X.concat(qq.merge):X.slice();let Q=X;if(!Q)if(Array.isArray(q))Q=[];else{let U=Array.from(z9.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${U} or define customTags array`)}if(Array.isArray(q))for(let U of q)Q=Q.concat(U);else if(typeof q==="function")Q=q(Q.slice());if(Z)Q=Q.concat(qq.merge);return Q.reduce((U,z)=>{let G=typeof z==="string"?G9[z]:z;if(!G){let J=JSON.stringify(z),Y=Object.keys(G9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Y}`)}if(!U.includes(G))U.push(G);return U},[])}F7.coreKnownTags=O7;F7.getTags=T7});var t$=D((D7)=>{var o$=S(),K7=w0(),R7=P0(),M7=o0(),nq=_9(),A7=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class r${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:Q,sortMapEntries:U,toStringDefaults:z}){this.compat=Array.isArray(q)?nq.getTags(q,"compat"):q?nq.getTags(null,q):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=X?nq.coreKnownTags:{},this.tags=nq.getTags($,this.name,Z),this.toStringOptions=z??null,Object.defineProperty(this,o$.MAP,{value:K7.map}),Object.defineProperty(this,o$.SCALAR,{value:M7.string}),Object.defineProperty(this,o$.SEQ,{value:R7.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?A7:null}clone(){let q=Object.create(r$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}D7.Schema=r$});var O9=D((j7)=>{var P7=S(),e$=i0(),$q=d0();function N7(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)Z.push(J),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let Q=e$.createStringifyContext(q,$),{commentString:U}=Q.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let J=U(q.commentBefore);Z.unshift($q.indentComment(J,""))}let z=!1,G=null;if(q.contents){if(P7.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let B=U(q.contents.commentBefore);Z.push($q.indentComment(B,""))}Q.forceBlockIndent=!!q.comment,G=q.contents.comment}let J=G?void 0:()=>z=!0,Y=e$.stringify(q.contents,Q,()=>G=null,J);if(G)Y+=$q.lineComment(Y,"",U(G));if((Y[0]==="|"||Y[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${Y}`;else Z.push(Y)}else Z.push(e$.stringify(q.contents,Q));if(q.directives?.docEnd)if(q.comment){let J=U(q.comment);if(J.includes(`
|
|
56
|
-
`))Z.push("..."),Z.push($q.indentComment(J,""));else Z.push(`... ${J}`)}else Z.push("...");else{let J=q.comment;if(J&&z)J=J.replace(/^\n+/,"");if(J){if((!z||G)&&Z[Z.length-1]!=="")Z.push("");Z.push($q.indentComment(
|
|
52
|
+
${X}${T}`}else return`${W}${z}${V.join(" ")}${z}${T}`}}function fq({indent:q,options:{commentString:$}},Z,U,X){if(U&&X)U=U.replace(/^\n+/,"");if(U){let Q=Eq.indentComment($(U),q);Z.push(Q.trimStart())}}iZ.stringifyCollection=dZ});var Q0=D((tZ)=>{var nZ=j$(),sZ=N$(),oZ=Aq(),X0=S(),yq=U0(),rZ=x();function s0(q,$){let Z=X0.isScalar($)?$.value:$;for(let U of q)if(X0.isPair(U)){if(U.key===$||U.key===Z)return U;if(X0.isScalar(U.key)&&U.key.value===Z)return U}return}class S1 extends oZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(X0.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:U,replacer:X}=Z,Q=new this(q),z=(G,J)=>{if(typeof X==="function")J=X.call($,G,J);else if(Array.isArray(X)&&!X.includes(G))return;if(J!==void 0||U)Q.items.push(yq.createPair(G,J,Z))};if($ instanceof Map)for(let[G,J]of $)z(G,J);else if($&&typeof $==="object")for(let G of Object.keys($))z(G,$[G]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,$){let Z;if(X0.isPair(q))Z=q;else if(!q||typeof q!=="object"||!("key"in q))Z=new yq.Pair(q,q?.value);else Z=new yq.Pair(q.key,q.value);let U=s0(this.items,Z.key),X=this.schema?.sortMapEntries;if(U){if(!$)throw Error(`Key ${Z.key} already set`);if(X0.isScalar(U.value)&&rZ.isScalarValue(Z.value))U.value.value=Z.value;else U.value=Z.value}else if(X){let Q=this.items.findIndex((z)=>X(Z,z)<0);if(Q===-1)this.items.push(Z);else this.items.splice(Q,0,Z)}else this.items.push(Z)}delete(q){let $=s0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let U=s0(this.items,q)?.value;return(!$&&X0.isScalar(U)?U.value:U)??void 0}has(q){return!!s0(this.items,q)}set(q,$){this.add(new yq.Pair(q,$),!0)}toJSON(q,$,Z){let U=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(U);for(let X of this.items)sZ.addPairToJSMap($,U,X);return U}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let U of this.items)if(!X0.isPair(U))throw Error(`Map items must all be pairs; found ${JSON.stringify(U)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return nZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}tZ.YAMLMap=S1;tZ.findPair=s0});var w0=D((U6)=>{var $6=S(),E1=Q0(),Z6={collection:"map",default:!0,nodeClass:E1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!$6.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>E1.YAMLMap.from(q,$,Z)};U6.map=Z6});var z0=D((H6)=>{var Q6=p0(),z6=j$(),G6=Aq(),gq=S(),J6=x(),Y6=q0();class f1 extends G6.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(gq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=xq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=xq(q);if(typeof Z!=="number")return;let U=this.items[Z];return!$&&gq.isScalar(U)?U.value:U}has(q){let $=xq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let Z=xq(q);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${q}.`);let U=this.items[Z];if(gq.isScalar(U)&&J6.isScalarValue($))U.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let U=0;for(let X of this.items)Z.push(Y6.toJS(X,String(U++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return z6.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:U}=Z,X=new this(q);if($&&Symbol.iterator in Object($)){let Q=0;for(let z of $){if(typeof U==="function"){let G=$ instanceof Set?z:String(Q++);z=U.call($,G,z)}X.items.push(Q6.createNode(z,void 0,Z))}}return X}}function xq(q){let $=gq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}H6.YAMLSeq=f1});var P0=D((_6)=>{var W6=S(),y1=z0(),B6={collection:"seq",default:!0,nodeClass:y1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!W6.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>y1.YAMLSeq.from(q,$,Z)};_6.seq=B6});var o0=D((L6)=>{var T6=l0(),F6={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,Z,U){return $=Object.assign({actualString:!0},$),T6.stringifyString(q,$,Z,U)}};L6.string=F6});var kq=D((K6)=>{var x1=x(),g1={identify:(q)=>q==null,createNode:()=>new x1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new x1.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&g1.test.test(q)?q:$.options.nullStr};K6.nullTag=g1});var C$=D((A6)=>{var M6=x(),k1={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new M6.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&k1.test.test(q)){let U=q[0]==="t"||q[0]==="T";if($===U)return q}return $?Z.options.trueStr:Z.options.falseStr}};A6.boolTag=k1});var N0=D((P6)=>{function w6({format:q,minFractionDigits:$,tag:Z,value:U}){if(typeof U==="bigint")return String(U);let X=typeof U==="number"?U:Number(U);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let Q=Object.is(U,-0)?"-0":JSON.stringify(U);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let z=Q.indexOf(".");if(z<0)z=Q.length,Q+=".";let G=$-(Q.length-z-1);while(G-- >0)Q+="0"}return Q}P6.stringifyNumber=w6});var S$=D((E6)=>{var j6=x(),b$=N0(),C6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:b$.stringifyNumber},b6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():b$.stringifyNumber(q)}},S6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new j6.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:b$.stringifyNumber};E6.float=S6;E6.floatExp=b6;E6.floatNaN=C6});var f$=D((v6)=>{var h1=N0(),hq=(q)=>typeof q==="bigint"||Number.isInteger(q),E$=(q,$,Z,{intAsBigInt:U})=>U?BigInt(q):parseInt(q.substring($),Z);function v1(q,$,Z){let{value:U}=q;if(hq(U)&&U>=0)return Z+U.toString($);return h1.stringifyNumber(q)}var g6={identify:(q)=>hq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>E$(q,2,8,Z),stringify:(q)=>v1(q,8,"0o")},k6={identify:hq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>E$(q,0,10,Z),stringify:h1.stringifyNumber},h6={identify:(q)=>hq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>E$(q,2,16,Z),stringify:(q)=>v1(q,16,"0x")};v6.int=k6;v6.intHex=h6;v6.intOct=g6});var u1=D((s6)=>{var d6=w0(),c6=kq(),l6=P0(),i6=o0(),a6=C$(),y$=S$(),x$=f$(),n6=[d6.map,l6.seq,i6.string,c6.nullTag,a6.boolTag,x$.intOct,x$.int,x$.intHex,y$.floatNaN,y$.floatExp,y$.float];s6.schema=n6});var p1=D((U3)=>{var r6=x(),t6=w0(),e6=P0();function m1(q){return typeof q==="bigint"||Number.isInteger(q)}var vq=({value:q})=>JSON.stringify(q),q3=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:vq},{identify:(q)=>q==null,createNode:()=>new r6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:vq},{identify:m1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:Z})=>Z?BigInt(q):parseInt(q,10),stringify:({value:q})=>m1(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:vq}],$3={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},Z3=[t6.map,e6.seq].concat(q3,$3);U3.schema=Z3});var k$=D((G3)=>{var r0=k("buffer"),g$=x(),Q3=l0(),z3={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof r0.Buffer==="function")return r0.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),U=new Uint8Array(Z.length);for(let X=0;X<Z.length;++X)U[X]=Z.charCodeAt(X);return U}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},U,X,Q){if(!Z)return"";let z=Z,G;if(typeof r0.Buffer==="function")G=z instanceof r0.Buffer?z.toString("base64"):r0.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Y=0;Y<z.length;++Y)J+=String.fromCharCode(z[Y]);G=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=g$.Scalar.BLOCK_LITERAL),$!==g$.Scalar.QUOTE_DOUBLE){let J=Math.max(U.options.lineWidth-U.indent.length,U.options.minContentWidth),Y=Math.ceil(G.length/J),B=Array(Y);for(let V=0,W=0;V<Y;++V,W+=J)B[V]=G.substr(W,J);G=B.join($===g$.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Q3.stringifyString({comment:q,type:$,value:G},U,X,Q)}};G3.binary=z3});var mq=D((W3)=>{var uq=S(),h$=U0(),Y3=x(),H3=z0();function d1(q,$){if(uq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let U=q.items[Z];if(uq.isPair(U))continue;else if(uq.isMap(U)){if(U.items.length>1)$("Each pair must have its own sequence indicator");let X=U.items[0]||new h$.Pair(new Y3.Scalar(null));if(U.commentBefore)X.key.commentBefore=X.key.commentBefore?`${U.commentBefore}
|
|
54
|
+
${X.key.commentBefore}`:U.commentBefore;if(U.comment){let Q=X.value??X.key;Q.comment=Q.comment?`${U.comment}
|
|
55
|
+
${Q.comment}`:U.comment}U=X}q.items[Z]=uq.isPair(U)?U:new h$.Pair(U)}else $("Expected a sequence for this tag");return q}function c1(q,$,Z){let{replacer:U}=Z,X=new H3.YAMLSeq(q);X.tag="tag:yaml.org,2002:pairs";let Q=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof U==="function")z=U.call($,String(Q++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let Y=Object.keys(z);if(Y.length===1)G=Y[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else G=z;X.items.push(h$.createPair(G,J,Z))}return X}var V3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d1,createNode:c1};W3.createPairs=c1;W3.pairs=V3;W3.resolvePairs=d1});var u$=D((L3)=>{var l1=S(),v$=q0(),t0=Q0(),T3=z0(),i1=mq();class W0 extends T3.YAMLSeq{constructor(){super();this.add=t0.YAMLMap.prototype.add.bind(this),this.delete=t0.YAMLMap.prototype.delete.bind(this),this.get=t0.YAMLMap.prototype.get.bind(this),this.has=t0.YAMLMap.prototype.has.bind(this),this.set=t0.YAMLMap.prototype.set.bind(this),this.tag=W0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let U of this.items){let X,Q;if(l1.isPair(U))X=v$.toJS(U.key,"",$),Q=v$.toJS(U.value,X,$);else X=v$.toJS(U,"",$);if(Z.has(X))throw Error("Ordered maps must not include duplicate keys");Z.set(X,Q)}return Z}static from(q,$,Z){let U=i1.createPairs(q,$,Z),X=new this;return X.items=U.items,X}}W0.tag="tag:yaml.org,2002:omap";var F3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:W0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=i1.resolvePairs(q,$),U=[];for(let{key:X}of Z.items)if(l1.isScalar(X))if(U.includes(X.value))$(`Ordered maps must not include duplicate keys: ${X.value}`);else U.push(X.value);return Object.assign(new W0,Z)},createNode:(q,$,Z)=>W0.from(q,$,Z)};L3.YAMLOMap=W0;L3.omap=F3});var r1=D((R3)=>{var a1=x();function n1({value:q,source:$},Z){if($&&(q?s1:o1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var s1={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new a1.Scalar(!0),stringify:n1},o1={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new a1.Scalar(!1),stringify:n1};R3.falseTag=o1;R3.trueTag=s1});var t1=D((j3)=>{var D3=x(),m$=N0(),w3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:m$.stringifyNumber},P3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():m$.stringifyNumber(q)}},N3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new D3.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let U=q.substring(Z+1).replace(/_/g,"");if(U[U.length-1]==="0")$.minFractionDigits=U.length}return $},stringify:m$.stringifyNumber};j3.float=N3;j3.floatExp=P3;j3.floatNaN=w3});var q9=D((g3)=>{var e1=N0(),e0=(q)=>typeof q==="bigint"||Number.isInteger(q);function pq(q,$,Z,{intAsBigInt:U}){let X=q[0];if(X==="-"||X==="+")$+=1;if(q=q.substring($).replace(/_/g,""),U){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return X==="-"?BigInt(-1)*z:z}let Q=parseInt(q,Z);return X==="-"?-1*Q:Q}function p$(q,$,Z){let{value:U}=q;if(e0(U)){let X=U.toString($);return U<0?"-"+Z+X.substr(1):Z+X}return e1.stringifyNumber(q)}var E3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>pq(q,2,2,Z),stringify:(q)=>p$(q,2,"0b")},f3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>pq(q,1,8,Z),stringify:(q)=>p$(q,8,"0")},y3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>pq(q,0,10,Z),stringify:e1.stringifyNumber},x3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>pq(q,2,16,Z),stringify:(q)=>p$(q,16,"0x")};g3.int=y3;g3.intBin=E3;g3.intHex=x3;g3.intOct=f3});var d$=D((p3)=>{var lq=S(),dq=U0(),cq=Q0();class B0 extends cq.YAMLMap{constructor(q){super(q);this.tag=B0.tag}add(q){let $;if(lq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new dq.Pair(q.key,null);else $=new dq.Pair(q,null);if(!cq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=cq.findPair(this.items,q);return!$&&lq.isPair(Z)?lq.isScalar(Z.key)?Z.key.value:Z.key:Z}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let Z=cq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new dq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:U}=Z,X=new this(q);if($&&Symbol.iterator in Object($))for(let Q of $){if(typeof U==="function")Q=U.call($,Q,Q);X.items.push(dq.createPair(Q,null,Z))}return X}}B0.tag="tag:yaml.org,2002:set";var m3={collection:"map",identify:(q)=>q instanceof Set,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>B0.from(q,$,Z),resolve(q,$){if(lq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new B0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};p3.YAMLSet=B0;p3.set=m3});var l$=D((n3)=>{var l3=N0();function c$(q,$){let Z=q[0],U=Z==="-"||Z==="+"?q.substring(1):q,X=(z)=>$?BigInt(z):Number(z),Q=U.replace(/_/g,"").split(":").reduce((z,G)=>z*X(60)+X(G),X(0));return Z==="-"?X(-1)*Q:Q}function $9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return l3.stringifyNumber(q);let U="";if($<0)U="-",$*=Z(-1);let X=Z(60),Q=[$%X];if($<60)Q.unshift(0);else if($=($-Q[0])/X,Q.unshift($%X),$>=60)$=($-Q[0])/X,Q.unshift($);return U+Q.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var i3={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>c$(q,Z),stringify:$9},a3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>c$(q,!1),stringify:$9},Z9={identify:(q)=>q 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(q){let $=q.match(Z9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,U,X,Q,z,G]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Y=Date.UTC(Z,U-1,X,Q||0,z||0,G||0,J),B=$[8];if(B&&B!=="Z"){let V=c$(B,!1);if(Math.abs(V)<30)V*=60;Y-=60000*V}return new Date(Y)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};n3.floatTime=a3;n3.intTime=i3;n3.timestamp=Z9});var X9=D((J7)=>{var t3=w0(),e3=kq(),q7=P0(),$7=o0(),Z7=k$(),U9=r1(),i$=t1(),iq=q9(),U7=Cq(),X7=u$(),Q7=mq(),z7=d$(),a$=l$(),G7=[t3.map,q7.seq,$7.string,e3.nullTag,U9.trueTag,U9.falseTag,iq.intBin,iq.intOct,iq.int,iq.intHex,i$.floatNaN,i$.floatExp,i$.float,Z7.binary,U7.merge,X7.omap,Q7.pairs,z7.set,a$.intTime,a$.floatTime,a$.timestamp];J7.schema=G7});var _9=D((F7)=>{var J9=w0(),H7=kq(),Y9=P0(),V7=o0(),W7=C$(),n$=S$(),s$=f$(),B7=u1(),_7=p1(),H9=k$(),qq=Cq(),V9=u$(),W9=mq(),Q9=X9(),B9=d$(),aq=l$(),z9=new Map([["core",B7.schema],["failsafe",[J9.map,Y9.seq,V7.string]],["json",_7.schema],["yaml11",Q9.schema],["yaml-1.1",Q9.schema]]),G9={binary:H9.binary,bool:W7.boolTag,float:n$.float,floatExp:n$.floatExp,floatNaN:n$.floatNaN,floatTime:aq.floatTime,int:s$.int,intHex:s$.intHex,intOct:s$.intOct,intTime:aq.intTime,map:J9.map,merge:qq.merge,null:H7.nullTag,omap:V9.omap,pairs:W9.pairs,seq:Y9.seq,set:B9.set,timestamp:aq.timestamp},O7={"tag:yaml.org,2002:binary":H9.binary,"tag:yaml.org,2002:merge":qq.merge,"tag:yaml.org,2002:omap":V9.omap,"tag:yaml.org,2002:pairs":W9.pairs,"tag:yaml.org,2002:set":B9.set,"tag:yaml.org,2002:timestamp":aq.timestamp};function T7(q,$,Z){let U=z9.get($);if(U&&!q)return Z&&!U.includes(qq.merge)?U.concat(qq.merge):U.slice();let X=U;if(!X)if(Array.isArray(q))X=[];else{let Q=Array.from(z9.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)X=X.concat(Q);else if(typeof q==="function")X=q(X.slice());if(Z)X=X.concat(qq.merge);return X.reduce((Q,z)=>{let G=typeof z==="string"?G9[z]:z;if(!G){let J=JSON.stringify(z),Y=Object.keys(G9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Y}`)}if(!Q.includes(G))Q.push(G);return Q},[])}F7.coreKnownTags=O7;F7.getTags=T7});var t$=D((D7)=>{var o$=S(),K7=w0(),R7=P0(),M7=o0(),nq=_9(),A7=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class r${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:U,schema:X,sortMapEntries:Q,toStringDefaults:z}){this.compat=Array.isArray(q)?nq.getTags(q,"compat"):q?nq.getTags(null,q):null,this.name=typeof X==="string"&&X||"core",this.knownTags=U?nq.coreKnownTags:{},this.tags=nq.getTags($,this.name,Z),this.toStringOptions=z??null,Object.defineProperty(this,o$.MAP,{value:K7.map}),Object.defineProperty(this,o$.SCALAR,{value:M7.string}),Object.defineProperty(this,o$.SEQ,{value:R7.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?A7:null}clone(){let q=Object.create(r$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}D7.Schema=r$});var O9=D((j7)=>{var P7=S(),e$=i0(),$q=d0();function N7(q,$){let Z=[],U=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)Z.push(J),U=!0;else if(q.directives.docStart)U=!0}if(U)Z.push("---");let X=e$.createStringifyContext(q,$),{commentString:Q}=X.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let J=Q(q.commentBefore);Z.unshift($q.indentComment(J,""))}let z=!1,G=null;if(q.contents){if(P7.isNode(q.contents)){if(q.contents.spaceBefore&&U)Z.push("");if(q.contents.commentBefore){let B=Q(q.contents.commentBefore);Z.push($q.indentComment(B,""))}X.forceBlockIndent=!!q.comment,G=q.contents.comment}let J=G?void 0:()=>z=!0,Y=e$.stringify(q.contents,X,()=>G=null,J);if(G)Y+=$q.lineComment(Y,"",Q(G));if((Y[0]==="|"||Y[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${Y}`;else Z.push(Y)}else Z.push(e$.stringify(q.contents,X));if(q.directives?.docEnd)if(q.comment){let J=Q(q.comment);if(J.includes(`
|
|
56
|
+
`))Z.push("..."),Z.push($q.indentComment(J,""));else Z.push(`... ${J}`)}else Z.push("...");else{let J=q.comment;if(J&&z)J=J.replace(/^\n+/,"");if(J){if((!z||G)&&Z[Z.length-1]!=="")Z.push("");Z.push($q.indentComment(Q(J),""))}}return Z.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}j7.stringifyDocument=N7});var Zq=D((
|
|
59
|
-
`;z=G+z}if(/[^ ]/.test(z)){let G=1,J=Z.linePos[1];if(J?.line===
|
|
58
|
+
`}j7.stringifyDocument=N7});var Zq=D((k7)=>{var b7=m0(),j0=Aq(),d=S(),S7=U0(),E7=q0(),f7=t$(),y7=O9(),q2=Kq(),x7=I$(),g7=p0(),$2=L$();class Z2{constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,d.NODE_TYPE,{value:d.DOC});let U=null;if(typeof $==="function"||Array.isArray($))U=$;else if(Z===void 0&&$)Z=$,$=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=X;let{version:Q}=X;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new $2.Directives({version:Q});this.setSchema(Q,Z),this.contents=q===void 0?null:this.createNode(q,U,Z)}clone(){let q=Object.create(Z2.prototype,{[d.NODE_TYPE]:{value:d.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=d.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(C0(this.contents))this.contents.add(q)}addIn(q,$){if(C0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=q2.anchorNames(this);q.anchor=!$||Z.has($)?q2.findNewAnchor($||"a",Z):$}return new b7.Alias(q.anchor)}createNode(q,$,Z){let U=void 0;if(typeof $==="function")q=$.call({"":q},"",q),U=$;else if(Array.isArray($)){let _=(R)=>typeof R==="number"||R instanceof String||R instanceof Number,O=$.filter(_).map(String);if(O.length>0)$=$.concat(O);U=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:X,anchorPrefix:Q,flow:z,keepUndefined:G,onTagObj:J,tag:Y}=Z??{},{onAnchor:B,setAnchors:V,sourceObjects:W}=q2.createNodeAnchors(this,Q||"a"),T={aliasDuplicateObjects:X??!0,keepUndefined:G??!1,onAnchor:B,onTagObj:J,replacer:U,schema:this.schema,sourceObjects:W},F=g7.createNode(q,Y,T);if(z&&d.isCollection(F))F.flow=!0;return V(),F}createPair(q,$,Z={}){let U=this.createNode(q,null,Z),X=this.createNode($,null,Z);return new S7.Pair(U,X)}delete(q){return C0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(j0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return C0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return d.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(j0.isEmptyPath(q))return!$&&d.isScalar(this.contents)?this.contents.value:this.contents;return d.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return d.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(j0.isEmptyPath(q))return this.contents!==void 0;return d.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=j0.collectionFromPath(this.schema,[q],$);else if(C0(this.contents))this.contents.set(q,$)}setIn(q,$){if(j0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=j0.collectionFromPath(this.schema,Array.from(q),$);else if(C0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let Z;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new $2.Directives({version:"1.1"});Z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new $2.Directives({version:q});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let U=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${U}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new f7.Schema(Object.assign(Z,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:Z,maxAliasCount:U,onAnchor:X,reviver:Q}={}){let z={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},G=E7.toJS(this.contents,$??"",z);if(typeof X==="function")for(let{count:J,res:Y}of z.anchors.values())X(Y,J);return typeof Q==="function"?x7.applyReviver(Q,{"":G},"",G):G}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return y7.stringifyDocument(this,q)}}function C0(q){if(d.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}k7.Document=Z2});var Uq=D((u7)=>{class sq extends Error{constructor(q,$,Z,U){super();this.name=q,this.code=Z,this.message=U,this.pos=$}}class T9 extends sq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class F9 extends sq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var v7=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((G)=>$.linePos(G));let{line:U,col:X}=Z.linePos[0];Z.message+=` at line ${U}, column ${X}`;let Q=X-1,z=q.substring($.lineStarts[U-1],$.lineStarts[U]).replace(/[\n\r]+$/,"");if(Q>=60&&z.length>80){let G=Math.min(Q-39,z.length-79);z="…"+z.substring(G),Q-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(U>1&&/^ *$/.test(z.substring(0,Q))){let G=q.substring($.lineStarts[U-2],$.lineStarts[U-1]);if(G.length>80)G=G.substring(0,79)+`…
|
|
59
|
+
`;z=G+z}if(/[^ ]/.test(z)){let G=1,J=Z.linePos[1];if(J?.line===U&&J.col>X)G=Math.max(1,Math.min(J.col-X,80-Q));let Y=" ".repeat(Q)+"^".repeat(G);Z.message+=`:
|
|
60
60
|
|
|
61
61
|
${z}
|
|
62
62
|
${Y}
|
|
63
|
-
`}};u7.YAMLError=sq;u7.YAMLParseError=T9;u7.YAMLWarning=F9;u7.prettifyError=v7});var
|
|
64
|
-
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(
|
|
65
|
-
`+_.comment;else G.comment=_.comment;continue}if(_.newlineAfterProp||
|
|
66
|
-
`+A.comment;else M.comment=A.comment;let w=new I9.Pair(M);if(Z.options.keepSourceTokens)w.srcToken=B;G.items.push(w)}}if(Y&&Y<J)
|
|
67
|
-
`+I.comment;else Y.comment=I.comment;V=I.end;continue}if(!z&&Z.options.strict&&
|
|
68
|
-
`+P;else K.comment=P;I.comment=I.comment.substring(P.length+1)}}}if(!z&&!w&&!I.found){let P=L?q(Z,L,I,
|
|
69
|
-
`+j.comment;else K.comment=j.comment;let y=new
|
|
70
|
-
`+O.comment;else Y.comment=O.comment;Y.range=[
|
|
71
|
-
`.repeat(Math.max(1,z.length-1)):"",O=X
|
|
72
|
-
`;for(let _=B;_<G;++_){let[O,R]=z[_];Y+=O.length+R.length+1;let M=R[R.length-1]==="\r";if(M)R=R.slice(0,-1);if(R&&O.length<J){let w=`Block scalar lines must not be less indented than their ${
|
|
63
|
+
`}};u7.YAMLError=sq;u7.YAMLParseError=T9;u7.YAMLWarning=F9;u7.prettifyError=v7});var Xq=D((i7)=>{function l7(q,{flow:$,indicator:Z,next:U,offset:X,onError:Q,parentIndent:z,startOnNewline:G}){let J=!1,Y=G,B=G,V="",W="",T=!1,F=!1,_=null,O=null,R=null,M=null,A=null,w=null,L=null;for(let K of q){if(F){if(K.type!=="space"&&K.type!=="newline"&&K.type!=="comma")Q(K.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");F=!1}if(_){if(Y&&K.type!=="comment"&&K.type!=="newline")Q(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");_=null}switch(K.type){case"space":if(!$&&(Z!=="doc-start"||U?.type!=="flow-collection")&&K.source.includes("\t"))_=K;B=!0;break;case"comment":{if(!B)Q(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let j=K.source.substring(1)||" ";if(!V)V=j;else V+=W+j;W="",Y=!1;break}case"newline":if(Y){if(V)V+=K.source;else if(!w||Z!=="seq-item-ind")J=!0}else W+=K.source;if(Y=!0,T=!0,O||R)M=K;B=!0;break;case"anchor":if(O)Q(K,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(K.source.endsWith(":"))Q(K.offset+K.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);O=K,L??(L=K.offset),Y=!1,B=!1,F=!0;break;case"tag":{if(R)Q(K,"MULTIPLE_TAGS","A node can have at most one tag");R=K,L??(L=K.offset),Y=!1,B=!1,F=!0;break}case Z:if(O||R)Q(K,"BAD_PROP_ORDER",`Anchors and tags must be after the ${K.source} indicator`);if(w)Q(K,"UNEXPECTED_TOKEN",`Unexpected ${K.source} in ${$??"collection"}`);w=K,Y=Z==="seq-item-ind"||Z==="explicit-key-ind",B=!1;break;case"comma":if($){if(A)Q(K,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);A=K,Y=!1,B=!1;break}default:Q(K,"UNEXPECTED_TOKEN",`Unexpected ${K.type} token`),Y=!1,B=!1}}let I=q[q.length-1],P=I?I.offset+I.source.length:X;if(F&&U&&U.type!=="space"&&U.type!=="newline"&&U.type!=="comma"&&(U.type!=="scalar"||U.source!==""))Q(U.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(_&&(Y&&_.indent<=z||U?.type==="block-map"||U?.type==="block-seq"))Q(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:A,found:w,spaceBefore:J,comment:V,hasNewline:T,anchor:O,tag:R,newlineAfterProp:M,end:P,start:L??P}}i7.resolveProps=l7});var oq=D((n7)=>{function U2(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
64
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(U2($.key)||U2($.value))return!0}return!1;default:return!0}}n7.containsNewline=U2});var X2=D((t7)=>{var o7=oq();function r7(q,$,Z){if($?.type==="flow-collection"){let U=$.end[0];if(U.indent===q&&(U.source==="]"||U.source==="}")&&o7.containsNewline($))Z(U,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}t7.flowIndentCheck=r7});var Q2=D(($U)=>{var L9=S();function qU(q,$,Z){let{uniqueKeys:U}=q.options;if(U===!1)return!1;let X=typeof U==="function"?U:(Q,z)=>Q===z||L9.isScalar(Q)&&L9.isScalar(z)&&Q.value===z.value;return $.some((Q)=>X(Q.key,Z))}$U.mapIncludes=qU});var A9=D((GU)=>{var I9=U0(),UU=Q0(),K9=Xq(),XU=oq(),R9=X2(),QU=Q2(),M9="All mapping items must start at the same column";function zU({composeNode:q,composeEmptyNode:$},Z,U,X,Q){let G=new(Q?.nodeClass??UU.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let J=U.offset,Y=null;for(let B of U.items){let{start:V,key:W,sep:T,value:F}=B,_=K9.resolveProps(V,{indicator:"explicit-key-ind",next:W??T?.[0],offset:J,onError:X,parentIndent:U.indent,startOnNewline:!0}),O=!_.found;if(O){if(W){if(W.type==="block-seq")X(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==U.indent)X(J,"BAD_INDENT",M9)}if(!_.anchor&&!_.tag&&!T){if(Y=_.end,_.comment)if(G.comment)G.comment+=`
|
|
65
|
+
`+_.comment;else G.comment=_.comment;continue}if(_.newlineAfterProp||XU.containsNewline(W))X(W??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(_.found?.indent!==U.indent)X(J,"BAD_INDENT",M9);Z.atKey=!0;let R=_.end,M=W?q(Z,W,_,X):$(Z,R,V,null,_,X);if(Z.schema.compat)R9.flowIndentCheck(U.indent,W,X);if(Z.atKey=!1,QU.mapIncludes(Z,G.items,M))X(R,"DUPLICATE_KEY","Map keys must be unique");let A=K9.resolveProps(T??[],{indicator:"map-value-ind",next:F,offset:M.range[2],onError:X,parentIndent:U.indent,startOnNewline:!W||W.type==="block-scalar"});if(J=A.end,A.found){if(O){if(F?.type==="block-map"&&!A.hasNewline)X(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&_.start<A.found.offset-1024)X(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=F?q(Z,F,A,X):$(Z,J,T,null,A,X);if(Z.schema.compat)R9.flowIndentCheck(U.indent,F,X);J=w.range[2];let L=new I9.Pair(M,w);if(Z.options.keepSourceTokens)L.srcToken=B;G.items.push(L)}else{if(O)X(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(A.comment)if(M.comment)M.comment+=`
|
|
66
|
+
`+A.comment;else M.comment=A.comment;let w=new I9.Pair(M);if(Z.options.keepSourceTokens)w.srcToken=B;G.items.push(w)}}if(Y&&Y<J)X(Y,"IMPOSSIBLE","Map comment with trailing content");return G.range=[U.offset,J,Y??J],G}GU.resolveBlockMap=zU});var D9=D((BU)=>{var YU=z0(),HU=Xq(),VU=X2();function WU({composeNode:q,composeEmptyNode:$},Z,U,X,Q){let G=new(Q?.nodeClass??YU.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let J=U.offset,Y=null;for(let{start:B,value:V}of U.items){let W=HU.resolveProps(B,{indicator:"seq-item-ind",next:V,offset:J,onError:X,parentIndent:U.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||V)if(V?.type==="block-seq")X(W.end,"BAD_INDENT","All sequence items must start at the same column");else X(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=W.end,W.comment)G.comment=W.comment;continue}let T=V?q(Z,V,W,X):$(Z,W.end,B,null,W,X);if(Z.schema.compat)VU.flowIndentCheck(U.indent,V,X);J=T.range[2],G.items.push(T)}return G.range=[U.offset,J,Y??J],G}BU.resolveBlockSeq=WU});var b0=D((TU)=>{function OU(q,$,Z,U){let X="";if(q){let Q=!1,z="";for(let G of q){let{source:J,type:Y}=G;switch(Y){case"space":Q=!0;break;case"comment":{if(Z&&!Q)U(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=J.substring(1)||" ";if(!X)X=B;else X+=z+B;z="";break}case"newline":if(X)z+=J;Q=!0;break;default:U(G,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}$+=J.length}}return{comment:X,offset:$}}TU.resolveEnd=OU});var N9=D((wU)=>{var LU=S(),IU=U0(),w9=Q0(),KU=z0(),RU=b0(),P9=Xq(),MU=oq(),AU=Q2(),z2="Block collections are not allowed within flow collections",G2=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function DU({composeNode:q,composeEmptyNode:$},Z,U,X,Q){let z=U.start.source==="{",G=z?"flow map":"flow sequence",Y=new(Q?.nodeClass??(z?w9.YAMLMap:KU.YAMLSeq))(Z.schema);Y.flow=!0;let B=Z.atRoot;if(B)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let V=U.offset+U.start.source.length;for(let O=0;O<U.items.length;++O){let R=U.items[O],{start:M,key:A,sep:w,value:L}=R,I=P9.resolveProps(M,{flow:G,indicator:"explicit-key-ind",next:A??w?.[0],offset:V,onError:X,parentIndent:U.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!w&&!L){if(O===0&&I.comma)X(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(O<U.items.length-1)X(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(I.comment)if(Y.comment)Y.comment+=`
|
|
67
|
+
`+I.comment;else Y.comment=I.comment;V=I.end;continue}if(!z&&Z.options.strict&&MU.containsNewline(A))X(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(O===0){if(I.comma)X(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!I.comma)X(I.start,"MISSING_CHAR",`Missing , between ${G} items`);if(I.comment){let P="";q:for(let K of M)switch(K.type){case"comma":case"space":break;case"comment":P=K.source.substring(1);break q;default:break q}if(P){let K=Y.items[Y.items.length-1];if(LU.isPair(K))K=K.value??K.key;if(K.comment)K.comment+=`
|
|
68
|
+
`+P;else K.comment=P;I.comment=I.comment.substring(P.length+1)}}}if(!z&&!w&&!I.found){let P=L?q(Z,L,I,X):$(Z,I.end,w,null,I,X);if(Y.items.push(P),V=P.range[2],G2(L))X(P.range,"BLOCK_IN_FLOW",z2)}else{Z.atKey=!0;let P=I.end,K=A?q(Z,A,I,X):$(Z,P,M,null,I,X);if(G2(A))X(K.range,"BLOCK_IN_FLOW",z2);Z.atKey=!1;let j=P9.resolveProps(w??[],{flow:G,indicator:"map-value-ind",next:L,offset:K.range[2],onError:X,parentIndent:U.indent,startOnNewline:!1});if(j.found){if(!z&&!I.found&&Z.options.strict){if(w)for(let E of w){if(E===j.found)break;if(E.type==="newline"){X(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(I.start<j.found.offset-1024)X(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(L)if("source"in L&&L.source?.[0]===":")X(L,"MISSING_CHAR",`Missing space after : in ${G}`);else X(j.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let C=L?q(Z,L,j,X):j.found?$(Z,j.end,w,null,j,X):null;if(C){if(G2(L))X(C.range,"BLOCK_IN_FLOW",z2)}else if(j.comment)if(K.comment)K.comment+=`
|
|
69
|
+
`+j.comment;else K.comment=j.comment;let y=new IU.Pair(K,C);if(Z.options.keepSourceTokens)y.srcToken=R;if(z){let E=Y;if(AU.mapIncludes(Z,E.items,K))X(P,"DUPLICATE_KEY","Map keys must be unique");E.items.push(y)}else{let E=new w9.YAMLMap(Z.schema);E.flow=!0,E.items.push(y);let o=(C??K).range;E.range=[K.range[0],o[1],o[2]],Y.items.push(E)}V=C?C.range[2]:j.end}}let W=z?"}":"]",[T,...F]=U.end,_=V;if(T?.source===W)_=T.offset+T.source.length;else{let O=G[0].toUpperCase()+G.substring(1),R=B?`${O} must end with a ${W}`:`${O} in block collection must be sufficiently indented and end with a ${W}`;if(X(V,B?"MISSING_CHAR":"BAD_INDENT",R),T&&T.source.length!==1)F.unshift(T)}if(F.length>0){let O=RU.resolveEnd(F,_,Z.options.strict,X);if(O.comment)if(Y.comment)Y.comment+=`
|
|
70
|
+
`+O.comment;else Y.comment=O.comment;Y.range=[U.offset,_,O.offset]}else Y.range=[U.offset,_,_];return Y}wU.resolveFlowCollection=DU});var j9=D((xU)=>{var NU=S(),jU=x(),CU=Q0(),bU=z0(),SU=A9(),EU=D9(),fU=N9();function J2(q,$,Z,U,X,Q){let z=Z.type==="block-map"?SU.resolveBlockMap(q,$,Z,U,Q):Z.type==="block-seq"?EU.resolveBlockSeq(q,$,Z,U,Q):fU.resolveFlowCollection(q,$,Z,U,Q),G=z.constructor;if(X==="!"||X===G.tagName)return z.tag=G.tagName,z;if(X)z.tag=X;return z}function yU(q,$,Z,U,X){let Q=U.tag,z=!Q?null:$.directives.tagName(Q.source,(W)=>X(Q,"TAG_RESOLVE_FAILED",W));if(Z.type==="block-seq"){let{anchor:W,newlineAfterProp:T}=U,F=W&&Q?W.offset>Q.offset?W:Q:W??Q;if(F&&(!T||T.offset<F.offset))X(F,"MISSING_CHAR","Missing newline after block sequence props")}let G=Z.type==="block-map"?"map":Z.type==="block-seq"?"seq":Z.start.source==="{"?"map":"seq";if(!Q||!z||z==="!"||z===CU.YAMLMap.tagName&&G==="map"||z===bU.YAMLSeq.tagName&&G==="seq")return J2(q,$,Z,X,z);let J=$.schema.tags.find((W)=>W.tag===z&&W.collection===G);if(!J){let W=$.schema.knownTags[z];if(W?.collection===G)$.schema.tags.push(Object.assign({},W,{default:!1})),J=W;else{if(W)X(Q,"BAD_COLLECTION_TYPE",`${W.tag} used for ${G} collection, but expects ${W.collection??"scalar"}`,!0);else X(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return J2(q,$,Z,X,z)}}let Y=J2(q,$,Z,X,z,J),B=J.resolve?.(Y,(W)=>X(Q,"TAG_RESOLVE_FAILED",W),$.options)??Y,V=NU.isNode(B)?B:new jU.Scalar(B);if(V.range=Y.range,V.tag=z,J?.format)V.format=J.format;return V}xU.composeCollection=yU});var H2=D((uU)=>{var Y2=x();function kU(q,$,Z){let U=$.offset,X=hU($,q.options.strict,Z);if(!X)return{value:"",type:null,comment:"",range:[U,U,U]};let Q=X.mode===">"?Y2.Scalar.BLOCK_FOLDED:Y2.Scalar.BLOCK_LITERAL,z=$.source?vU($.source):[],G=z.length;for(let _=z.length-1;_>=0;--_){let O=z[_][1];if(O===""||O==="\r")G=_;else break}if(G===0){let _=X.chomp==="+"&&z.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,z.length-1)):"",O=U+X.length;if($.source)O+=$.source.length;return{value:_,type:Q,comment:X.comment,range:[U,O,O]}}let J=$.indent+X.indent,Y=$.offset+X.length,B=0;for(let _=0;_<G;++_){let[O,R]=z[_];if(R===""||R==="\r"){if(X.indent===0&&O.length>J)J=O.length}else{if(O.length<J)Z(Y+O.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)J=O.length;if(B=_,J===0&&!q.atRoot)Z(Y,"BAD_INDENT","Block scalar values in collections must be indented");break}Y+=O.length+R.length+1}for(let _=z.length-1;_>=G;--_)if(z[_][0].length>J)G=_+1;let V="",W="",T=!1;for(let _=0;_<B;++_)V+=z[_][0].slice(J)+`
|
|
72
|
+
`;for(let _=B;_<G;++_){let[O,R]=z[_];Y+=O.length+R.length+1;let M=R[R.length-1]==="\r";if(M)R=R.slice(0,-1);if(R&&O.length<J){let w=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Z(Y-R.length-(M?2:1),"BAD_INDENT",w),O=""}if(Q===Y2.Scalar.BLOCK_LITERAL)V+=W+O.slice(J)+R,W=`
|
|
73
73
|
`;else if(O.length>J||R[0]==="\t"){if(W===" ")W=`
|
|
74
74
|
`;else if(!T&&W===`
|
|
75
75
|
`)W=`
|
|
@@ -78,84 +78,84 @@ ${Y}
|
|
|
78
78
|
`,T=!0}else if(R==="")if(W===`
|
|
79
79
|
`)V+=`
|
|
80
80
|
`;else W=`
|
|
81
|
-
`;else V+=W+R,W=" ",T=!1}switch(
|
|
81
|
+
`;else V+=W+R,W=" ",T=!1}switch(X.chomp){case"-":break;case"+":for(let _=G;_<z.length;++_)V+=`
|
|
82
82
|
`+z[_][0].slice(J);if(V[V.length-1]!==`
|
|
83
83
|
`)V+=`
|
|
84
84
|
`;break;default:V+=`
|
|
85
|
-
`}let F=X
|
|
85
|
+
`}let F=U+X.length+$.source.length;return{value:V,type:Q,comment:X.comment,range:[U,F,F]}}function hU({offset:q,props:$},Z,U){if($[0].type!=="block-scalar-header")return U($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=$[0],Q=X[0],z=0,G="",J=-1;for(let W=1;W<X.length;++W){let T=X[W];if(!G&&(T==="-"||T==="+"))G=T;else{let F=Number(T);if(!z&&F)z=F;else if(J===-1)J=q+W}}if(J!==-1)U(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let Y=!1,B="",V=X.length;for(let W=1;W<$.length;++W){let T=$[W];switch(T.type){case"space":Y=!0;case"newline":V+=T.source.length;break;case"comment":if(Z&&!Y)U(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=T.source.length,B=T.source.substring(1);break;case"error":U(T,"UNEXPECTED_TOKEN",T.message),V+=T.source.length;break;default:{let F=`Unexpected token in block scalar header: ${T.type}`;U(T,"UNEXPECTED_TOKEN",F);let _=T.source;if(_&&typeof _==="string")V+=_.length}}}return{mode:Q,indent:z,chomp:G,comment:B,length:V}}function vU(q){let $=q.split(/\n( *)/),Z=$[0],U=Z.match(/^( *)/),Q=[U?.[1]?[U[1],Z.slice(U[1].length)]:["",Z]];for(let z=1;z<$.length;z+=2)Q.push([$[z],$[z+1]]);return Q}uU.resolveBlockScalar=kU});var W2=D((oU)=>{var V2=x(),pU=b0();function dU(q,$,Z){let{offset:U,type:X,source:Q,end:z}=q,G,J,Y=(W,T,F)=>Z(U+W,T,F);switch(X){case"scalar":G=V2.Scalar.PLAIN,J=cU(Q,Y);break;case"single-quoted-scalar":G=V2.Scalar.QUOTE_SINGLE,J=lU(Q,Y);break;case"double-quoted-scalar":G=V2.Scalar.QUOTE_DOUBLE,J=iU(Q,Y);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[U,U+Q.length,U+Q.length]}}let B=U+Q.length,V=pU.resolveEnd(z,B,$,Z);return{value:J,type:G,comment:V.comment,range:[U,B,V.offset]}}function cU(q,$){let Z="";switch(q[0]){case"\t":Z="a tab character";break;case",":Z="flow indicator character ,";break;case"%":Z="directive indicator character %";break;case"|":case">":{Z=`block scalar indicator ${q[0]}`;break}case"@":case"`":{Z=`reserved character ${q[0]}`;break}}if(Z)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${Z}`);return C9(q)}function lU(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return C9(q.slice(1,-1)).replace(/''/g,"'")}function C9(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
-
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let
|
|
88
|
-
`)Q
|
|
89
|
-
`;else Q
|
|
90
|
-
`)continue;if(
|
|
91
|
-
`){let{fold:
|
|
92
|
-
`){
|
|
93
|
-
`){
|
|
94
|
-
`&&!(z==="\r"&&q[
|
|
95
|
-
`))Z+=
|
|
96
|
-
`||
|
|
97
|
-
`)break;if(
|
|
87
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let U=$.exec(q);if(!U)return q;let X=U[1],Q=" ",z=$.lastIndex;Z.lastIndex=z;while(U=Z.exec(q)){if(U[1]==="")if(Q===`
|
|
88
|
+
`)X+=Q;else Q=`
|
|
89
|
+
`;else X+=Q+U[1],Q=" ";z=Z.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,U=G.exec(q),X+Q+(U?.[1]??"")}function iU(q,$){let Z="";for(let U=1;U<q.length-1;++U){let X=q[U];if(X==="\r"&&q[U+1]===`
|
|
90
|
+
`)continue;if(X===`
|
|
91
|
+
`){let{fold:Q,offset:z}=aU(q,U);Z+=Q,U=z}else if(X==="\\"){let Q=q[++U],z=nU[Q];if(z)Z+=z;else if(Q===`
|
|
92
|
+
`){Q=q[U+1];while(Q===" "||Q==="\t")Q=q[++U+1]}else if(Q==="\r"&&q[U+1]===`
|
|
93
|
+
`){Q=q[++U+1];while(Q===" "||Q==="\t")Q=q[++U+1]}else if(Q==="x"||Q==="u"||Q==="U"){let G={x:2,u:4,U:8}[Q];Z+=sU(q,U+1,G,$),U+=G}else{let G=q.substr(U-1,2);$(U-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),Z+=G}}else if(X===" "||X==="\t"){let Q=U,z=q[U+1];while(z===" "||z==="\t")z=q[++U+1];if(z!==`
|
|
94
|
+
`&&!(z==="\r"&&q[U+2]===`
|
|
95
|
+
`))Z+=U>Q?q.slice(Q,U+1):X}else Z+=X}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function aU(q,$){let Z="",U=q[$+1];while(U===" "||U==="\t"||U===`
|
|
96
|
+
`||U==="\r"){if(U==="\r"&&q[$+2]!==`
|
|
97
|
+
`)break;if(U===`
|
|
98
98
|
`)Z+=`
|
|
99
|
-
`;$+=1,
|
|
100
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
99
|
+
`;$+=1,U=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var nU={"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 sU(q,$,Z,U){let X=q.substr($,Z),z=X.length===Z&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;if(isNaN(z)){let G=q.substr($-2,Z+2);return U($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}return String.fromCodePoint(z)}oU.resolveFlowScalar=dU});var S9=D((UX)=>{var _0=S(),b9=x(),tU=H2(),eU=W2();function qX(q,$,Z,U){let{value:X,type:Q,comment:z,range:G}=$.type==="block-scalar"?tU.resolveBlockScalar(q,$,U):eU.resolveFlowScalar($,q.options.strict,U),J=Z?q.directives.tagName(Z.source,(V)=>U(Z,"TAG_RESOLVE_FAILED",V)):null,Y;if(q.options.stringKeys&&q.atKey)Y=q.schema[_0.SCALAR];else if(J)Y=$X(q.schema,X,J,Z,U);else if($.type==="scalar")Y=ZX(q,X,$,U);else Y=q.schema[_0.SCALAR];let B;try{let V=Y.resolve(X,(W)=>U(Z??$,"TAG_RESOLVE_FAILED",W),q.options);B=_0.isScalar(V)?V:new b9.Scalar(V)}catch(V){let W=V instanceof Error?V.message:String(V);U(Z??$,"TAG_RESOLVE_FAILED",W),B=new b9.Scalar(X)}if(B.range=G,B.source=X,Q)B.type=Q;if(J)B.tag=J;if(Y.format)B.format=Y.format;if(z)B.comment=z;return B}function $X(q,$,Z,U,X){if(Z==="!")return q[_0.SCALAR];let Q=[];for(let G of q.tags)if(!G.collection&&G.tag===Z)if(G.default&&G.test)Q.push(G);else return G;for(let G of Q)if(G.test?.test($))return G;let z=q.knownTags[Z];if(z&&!z.collection)return q.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return X(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[_0.SCALAR]}function ZX({atKey:q,directives:$,schema:Z},U,X,Q){let z=Z.tags.find((G)=>(G.default===!0||q&&G.default==="key")&&G.test?.test(U))||Z[_0.SCALAR];if(Z.compat){let G=Z.compat.find((J)=>J.default&&J.test?.test(U))??Z[_0.SCALAR];if(z.tag!==G.tag){let J=$.tagString(z.tag),Y=$.tagString(G.tag),B=`Value may be parsed as either ${J} or ${Y}`;Q(X,"TAG_RESOLVE_FAILED",B,!0)}}return z}UX.composeScalar=qX});var E9=D((zX)=>{function QX(q,$,Z){if($){Z??(Z=$.length);for(let U=Z-1;U>=0;--U){let X=$[U];switch(X.type){case"space":case"comment":case"newline":q-=X.source.length;continue}X=$[++U];while(X?.type==="space")q+=X.source.length,X=$[++U];break}}return q}zX.emptyScalarPosition=QX});var x9=D((OX)=>{var JX=m0(),YX=S(),HX=j9(),f9=S9(),VX=b0(),WX=E9(),BX={composeNode:y9,composeEmptyNode:B2};function y9(q,$,Z,U){let X=q.atKey,{spaceBefore:Q,comment:z,anchor:G,tag:J}=Z,Y,B=!0;switch($.type){case"alias":if(Y=_X(q,$,U),G||J)U($,"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(Y=f9.composeScalar(q,$,J,U),G)Y.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(Y=HX.composeCollection(BX,q,$,Z,U),G)Y.anchor=G.source.substring(1);break;default:{let V=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;U($,"UNEXPECTED_TOKEN",V),Y=B2(q,$.offset,void 0,null,Z,U),B=!1}}if(G&&Y.anchor==="")U(G,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&q.options.stringKeys&&(!YX.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))U(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)Y.spaceBefore=!0;if(z)if($.type==="scalar"&&$.source==="")Y.comment=z;else Y.commentBefore=z;if(q.options.keepSourceTokens&&B)Y.srcToken=$;return Y}function B2(q,$,Z,U,{spaceBefore:X,comment:Q,anchor:z,tag:G,end:J},Y){let B={type:"scalar",offset:WX.emptyScalarPosition($,Z,U),indent:-1,source:""},V=f9.composeScalar(q,B,G,Y);if(z){if(V.anchor=z.source.substring(1),V.anchor==="")Y(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=J;return V}function _X({options:q},{offset:$,source:Z,end:U},X){let Q=new JX.Alias(Z.substring(1));if(Q.source==="")X($,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))X($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=$+Z.length,G=VX.resolveEnd(U,z,q.strict,X);if(Q.range=[$,z,G.offset],G.comment)Q.comment=G.comment;return Q}OX.composeEmptyNode=B2;OX.composeNode=y9});var k9=D((MX)=>{var LX=Zq(),g9=x9(),IX=b0(),KX=Xq();function RX(q,$,{offset:Z,start:U,value:X,end:Q},z){let G=Object.assign({_directives:$},q),J=new LX.Document(void 0,G),Y={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},B=KX.resolveProps(U,{indicator:"doc-start",next:X??Q?.[0],offset:Z,onError:z,parentIndent:0,startOnNewline:!0});if(B.found){if(J.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!B.hasNewline)z(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=X?g9.composeNode(Y,X,B,z):g9.composeEmptyNode(Y,B.end,U,null,B,z);let V=J.contents.range[2],W=IX.resolveEnd(Q,V,!1,z);if(W.comment)J.comment=W.comment;return J.range=[Z,V,W.offset],J}MX.composeDoc=RX});var _2=D((CX)=>{var DX=k("process"),wX=L$(),PX=Zq(),Qq=Uq(),h9=S(),NX=k9(),jX=b0();function zq(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:Z}=q;return[$,$+(typeof Z==="string"?Z.length:1)]}function v9(q){let $="",Z=!1,U=!1;for(let X=0;X<q.length;++X){let Q=q[X];switch(Q[0]){case"#":$+=($===""?"":U?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(
|
|
104
|
-
${Z}`:Z;else if(
|
|
105
|
-
${z}`:Z}else{let
|
|
106
|
-
${
|
|
107
|
-
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new
|
|
103
|
+
`)+(Q.substring(1)||" "),Z=!0,U=!1;break;case"%":if(q[X+1]?.[0]!=="#")X+=1;Z=!1;break;default:if(!Z)U=!0;Z=!1}}return{comment:$,afterEmptyLine:U}}class u9{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,U,X)=>{let Q=zq($);if(X)this.warnings.push(new Qq.YAMLWarning(Q,Z,U));else this.errors.push(new Qq.YAMLParseError(Q,Z,U))},this.directives=new wX.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:U}=v9(this.prelude);if(Z){let X=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
104
|
+
${Z}`:Z;else if(U||q.directives.docStart||!X)q.commentBefore=Z;else if(h9.isCollection(X)&&!X.flow&&X.items.length>0){let Q=X.items[0];if(h9.isPair(Q))Q=Q.key;let z=Q.commentBefore;Q.commentBefore=z?`${Z}
|
|
105
|
+
${z}`:Z}else{let Q=X.commentBefore;X.commentBefore=Q?`${Z}
|
|
106
|
+
${Q}`:Z}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:v9(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,Z=-1){for(let U of q)yield*this.next(U);yield*this.end($,Z)}*next(q){if(DX.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,U)=>{let X=zq(q);X[0]+=$,this.onError(X,"BAD_DIRECTIVE",Z,U)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=NX.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"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(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,Z=new Qq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(Z);else this.doc.errors.push(Z);break}case"doc-end":{if(!this.doc){this.errors.push(new Qq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=jX.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
|
|
107
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new Qq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let Z=Object.assign({_directives:this.directives},this.options),U=new PX.Document(void 0,Z);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");U.range=[0,$,$],this.decorate(U,!1),yield U}}}CX.Composer=u9});var d9=D((hX)=>{var SX=H2(),EX=W2(),fX=Uq(),m9=l0();function yX(q,$=!0,Z){if(q){let U=(X,Q,z)=>{let G=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Z)Z(G,Q,z);else throw new fX.YAMLParseError([G,G+1],Q,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return EX.resolveFlowScalar(q,$,U);case"block-scalar":return SX.resolveBlockScalar({options:{strict:$}},q,U)}}return null}function xX(q,$){let{implicitKey:Z=!1,indent:U,inFlow:X=!1,offset:Q=-1,type:z="PLAIN"}=$,G=m9.stringifyString({type:z,value:q},{implicitKey:Z,indent:U>0?" ".repeat(U):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:U,source:`
|
|
108
108
|
`}];switch(G[0]){case"|":case">":{let Y=G.indexOf(`
|
|
109
109
|
`),B=G.substring(0,Y),V=G.substring(Y+1)+`
|
|
110
|
-
`,W=[{type:"block-scalar-header",offset:
|
|
111
|
-
`});return{type:"block-scalar",offset:
|
|
112
|
-
`),
|
|
113
|
-
`;if(q.type==="block-scalar"){let
|
|
114
|
-
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:z,props:G,source:
|
|
115
|
-
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[
|
|
110
|
+
`,W=[{type:"block-scalar-header",offset:Q,indent:U,source:B}];if(!p9(W,J))W.push({type:"newline",offset:-1,indent:U,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:Q,indent:U,props:W,source:V}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:U,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:Q,indent:U,source:G,end:J};default:return{type:"scalar",offset:Q,indent:U,source:G,end:J}}}function gX(q,$,Z={}){let{afterKey:U=!1,implicitKey:X=!1,inFlow:Q=!1,type:z}=Z,G="indent"in q?q.indent:null;if(U&&typeof G==="number")G+=2;if(!z)switch(q.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let Y=q.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let J=m9.stringifyString({type:z,value:$},{implicitKey:X||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":kX(q,J);break;case'"':O2(q,J,"double-quoted-scalar");break;case"'":O2(q,J,"single-quoted-scalar");break;default:O2(q,J,"scalar")}}function kX(q,$){let Z=$.indexOf(`
|
|
112
|
+
`),U=$.substring(0,Z),X=$.substring(Z+1)+`
|
|
113
|
+
`;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=U,q.source=X}else{let{offset:Q}=q,z="indent"in q?q.indent:-1,G=[{type:"block-scalar-header",offset:Q,indent:z,source:U}];if(!p9(G,"end"in q?q.end:void 0))G.push({type:"newline",offset:-1,indent:z,source:`
|
|
114
|
+
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:z,props:G,source:X})}}function p9(q,$){if($)for(let Z of $)switch(Z.type){case"space":case"comment":q.push(Z);break;case"newline":return q.push(Z),!0}return!1}function O2(q,$,Z){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=Z,q.source=$;break;case"block-scalar":{let U=q.props.slice(1),X=$.length;if(q.props[0].type==="block-scalar-header")X-=q.props[0].source.length;for(let Q of U)Q.offset+=X;delete q.props,Object.assign(q,{type:Z,source:$,end:U});break}case"block-map":case"block-seq":{let X={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
115
|
+
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[X]});break}default:{let U="indent"in q?q.indent:-1,X="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:Z,indent:U,source:$,end:X})}}}hX.createScalarToken=xX;hX.resolveAsScalar=yX;hX.setScalarValue=gX});var c9=D((dX)=>{var pX=(q)=>("type"in q)?tq(q):rq(q);function tq(q){switch(q.type){case"block-scalar":{let $="";for(let Z of q.props)$+=tq(Z);return $+q.source}case"block-map":case"block-seq":{let $="";for(let Z of q.items)$+=rq(Z);return $}case"flow-collection":{let $=q.start.source;for(let Z of q.items)$+=rq(Z);for(let Z of q.end)$+=Z.source;return $}case"document":{let $=rq(q);if(q.end)for(let Z of q.end)$+=Z.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let Z of q.end)$+=Z.source;return $}}}function rq({start:q,key:$,sep:Z,value:U}){let X="";for(let Q of q)X+=Q.source;if($)X+=tq($);if(Z)for(let Q of Z)X+=Q.source;if(U)X+=tq(U);return X}dX.stringify=pX});var a9=D((iX)=>{var T2=Symbol("break visit"),lX=Symbol("skip children"),l9=Symbol("remove item");function O0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};i9(Object.freeze([]),q,$)}O0.BREAK=T2;O0.SKIP=lX;O0.REMOVE=l9;O0.itemAtPath=(q,$)=>{let Z=q;for(let[U,X]of $){let Q=Z?.[U];if(Q&&"items"in Q)Z=Q.items[X];else return}return Z};O0.parentCollection=(q,$)=>{let Z=O0.itemAtPath(q,$.slice(0,-1)),U=$[$.length-1][0],X=Z?.[U];if(X&&"items"in X)return X;throw Error("Parent collection not found")};function i9(q,$,Z){let U=Z($,q);if(typeof U==="symbol")return U;for(let X of["key","value"]){let Q=$[X];if(Q&&"items"in Q){for(let z=0;z<Q.items.length;++z){let G=i9(Object.freeze(q.concat([[X,z]])),Q.items[z],Z);if(typeof G==="number")z=G-1;else if(G===T2)return T2;else if(G===l9)Q.items.splice(z,1),z-=1}if(typeof U==="function"&&X==="key")U=U($,q)}}return typeof U==="function"?U($,q):U}iX.visit=O0});var eq=D((qQ)=>{var F2=d9(),nX=c9(),sX=a9(),L2="\uFEFF",I2="\x02",K2="\x18",R2="\x1F",oX=(q)=>!!q&&("items"in q),rX=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function tX(q){switch(q){case L2:return"<BOM>";case I2:return"<DOC>";case K2:return"<FLOW_END>";case R2:return"<SCALAR>";default:return JSON.stringify(q)}}function eX(q){switch(q){case L2:return"byte-order-mark";case I2:return"doc-mode";case K2:return"flow-error-end";case R2:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[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}
|
|
118
|
-
`:case"\r":case"\t":return!0;default:return!1}}var n9=new Set("0123456789ABCDEFabcdef"),
|
|
119
|
-
\r `),M2=(q)=>!q||
|
|
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(q[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}qQ.createScalarToken=F2.createScalarToken;qQ.resolveAsScalar=F2.resolveAsScalar;qQ.setScalarValue=F2.setScalarValue;qQ.stringify=nX.stringify;qQ.visit=sX.visit;qQ.BOM=L2;qQ.DOCUMENT=I2;qQ.FLOW_END=K2;qQ.SCALAR=R2;qQ.isCollection=oX;qQ.isScalar=rX;qQ.prettyToken=tX;qQ.tokenType=eX});var A2=D((TQ)=>{var Gq=eq();function l(q){switch(q){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var n9=new Set("0123456789ABCDEFabcdef"),_Q=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),q$=new Set(",[]{}"),OQ=new Set(` ,[]{}
|
|
119
|
+
\r `),M2=(q)=>!q||OQ.has(q);class s9{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(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let Z=this.next??"stream";while(Z&&($||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
120
120
|
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
121
|
-
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let
|
|
122
|
-
`||!
|
|
121
|
+
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let U=this.buffer[Z+q+1];if(U===`
|
|
122
|
+
`||!U&&!this.atEnd)return q+Z+1}return $===`
|
|
123
123
|
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&l(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
124
|
-
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){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 q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Gq.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let
|
|
125
|
-
`,this.pos);if(
|
|
126
|
-
`,
|
|
127
|
-
`:q=
|
|
128
|
-
`)break}default:break q}if(!Z&&!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
|
|
129
|
-
`,
|
|
130
|
-
`)Z=this.buffer[++
|
|
131
|
-
`&&
|
|
132
|
-
`)Z+=1,
|
|
133
|
-
`,
|
|
134
|
-
`){let
|
|
124
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){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 q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Gq.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let X=q[Z-1];if(X===" "||X==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let X=q[$-1];if(X===" "||X==="\t")$-=1;else break}let U=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-U),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield Gq.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&l(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&&!l(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&l($)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.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(M2),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,Z=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=Z=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let U=this.getLine();if(U===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&U[0]!=="#"||Z===0&&(U.startsWith("---")||U.startsWith("..."))&&l(U[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(U[0]==="]"||U[0]==="}")))return this.flowLevel=0,yield Gq.FLOW_END,yield*this.parseLineStart()}let X=0;while(U[X]===",")X+=yield*this.pushCount(1),X+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(X+=yield*this.pushIndicators(),U[X]){case void 0:return"flow";case"#":return yield*this.pushCount(U.length-X),"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(M2),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||l(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let X=0;while(this.buffer[$-1-X]==="\\")X+=1;if(X%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),U=Z.indexOf(`
|
|
125
|
+
`,this.pos);if(U!==-1){while(U!==-1){let X=this.continueScalar(U+1);if(X===-1)break;U=Z.indexOf(`
|
|
126
|
+
`,X)}if(U!==-1)$=U-(Z[U-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 q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>l($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let X=this.pos;Z=this.buffer[X];++X)switch(Z){case" ":$+=1;break;case`
|
|
127
|
+
`:q=X,$=0;break;case"\r":{let Q=this.buffer[X+1];if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Q===`
|
|
128
|
+
`)break}default:break q}if(!Z&&!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 X=this.continueScalar(q+1);if(X===-1)break;q=this.buffer.indexOf(`
|
|
129
|
+
`,X)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let U=q+1;Z=this.buffer[U];while(Z===" ")Z=this.buffer[++U];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
|
|
130
|
+
`)Z=this.buffer[++U];q=U-1}else if(!this.blockScalarKeep)do{let X=q-1,Q=this.buffer[X];if(Q==="\r")Q=this.buffer[--X];let z=X;while(Q===" ")Q=this.buffer[--X];if(Q===`
|
|
131
|
+
`&&X>=this.pos&&X+1+$>z)q=X;else break}while(!0);return yield Gq.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,Z=this.pos-1,U;while(U=this.buffer[++Z])if(U===":"){let X=this.buffer[Z+1];if(l(X)||q&&q$.has(X))break;$=Z}else if(l(U)){let X=this.buffer[Z+1];if(U==="\r")if(X===`
|
|
132
|
+
`)Z+=1,U=`
|
|
133
|
+
`,X=this.buffer[Z+1];else $=Z;if(X==="#"||q&&q$.has(X))break;if(U===`
|
|
134
|
+
`){let Q=this.continueScalar(Z+1);if(Q===-1)break;Z=Math.max(Z,Q-2)}}else{if(q&&q$.has(U))break;$=Z}if(!U&&!this.atEnd)return this.setNext("plain-scalar");return yield Gq.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let Z=this.buffer.slice(this.pos,q);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(M2))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(l($)||q&&q$.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!l($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(_Q.has($))$=this.buffer[++q];else if($==="%"&&n9.has(this.buffer[q+1])&&n9.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
135
135
|
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
136
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let U=$-this.pos;if(U>0)yield this.buffer.substr(this.pos,U),this.pos=$;return U}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}TQ.Lexer=s9});var D2=D((LQ)=>{class o9{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let X=$+Z>>1;if(this.lineStarts[X]<q)$=X+1;else Z=X}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let U=this.lineStarts[$-1];return{line:$,col:q-U+1}}}}LQ.LineCounter=o9});var w2=D((MQ)=>{var KQ=k("process"),r9=eq(),RQ=A2();function G0(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function t9(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function q4(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $$(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function S0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function e9(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!G0($.start,"explicit-key-ind")&&!G0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,q4($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class $4{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new RQ.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Z of this.lexer.lex(q,$))yield*this.next(Z);if(!$)yield*this.end()}*next(q){if(this.source=q,KQ.env.LOG_TOKENS)console.log("|",r9.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=r9.tokenType(q);if(!$){let Z=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:Z,source:q}),this.offset+=q.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+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.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 q=this.peek(1);if(this.type==="doc-end"&&q?.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(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??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 Z=this.peek(1);if($.type==="block-scalar")$.indent="indent"in Z?Z.indent:0;else if($.type==="flow-collection"&&Z.type==="document")$.indent=0;if($.type==="flow-collection")e9($);switch(Z.type){case"document":Z.value=$;break;case"block-scalar":Z.props.push($);break;case"block-map":{let U=Z.items[Z.items.length-1];if(U.value){Z.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(U.sep)U.value=$;else{Object.assign(U,{key:$,sep:[]}),this.onKeyLine=!U.explicitKey;return}break}case"block-seq":{let U=Z.items[Z.items.length-1];if(U.value)Z.items.push({start:[],value:$});else U.value=$;break}case"flow-collection":{let U=Z.items[Z.items.length-1];if(!U||U.value)Z.items.push({start:[],key:$,sep:[]});else if(U.sep)U.value=$;else Object.assign(U,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let U=$.items[$.items.length-1];if(U&&!U.sep&&!U.value&&U.start.length>0&&t9(U.start)===-1&&($.indent===0||U.start.every((X)=>X.type!=="comment"||X.indent<$.indent))){if(Z.type==="document")Z.end=U.start;else Z.items.push({start:U.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 q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(t9(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=$$(this.peek(2)),Z=S0($),U;if(q.end)U=q.end,U.push(this.sourceToken),delete q.end;else U=[this.sourceToken];let X={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
137
137
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
138
|
-
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let
|
|
138
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let U=q.items[q.items.length-2]?.value?.end;if(Array.isArray(U)){Array.prototype.push.apply(U,$.start),U.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,U=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",X=[];if(U&&$.sep&&!$.value){let Q=[];for(let z=0;z<$.sep.length;++z){let G=$.sep[z];switch(G.type){case"newline":Q.push(z);break;case"space":break;case"comment":if(G.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)X=$.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(U||$.value)X.push(this.sourceToken),q.items.push({start:X}),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(U||$.value)X.push(this.sourceToken),q.items.push({start:X,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(G0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let Q=S0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(G0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]});else if(q4($.key)&&!G0($.sep,"newline")){let Q=S0($.start),z=$.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:Q,key:z,sep:G}]})}else if(X.length>0)$.sep=$.sep.concat(X,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||U)q.items.push({start:X,key:null,sep:[this.sourceToken]});else if(G0($.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 Q=this.flowScalar(this.type);if(U||$.value)q.items.push({start:X,key:Q,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(Q);else Object.assign($,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue(q);if(Q){if(Q.type==="block-seq"){if(!$.explicitKey&&$.sep&&!G0($.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(Z)q.items.push({start:X});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let U=q.items[q.items.length-2]?.value?.end;if(Array.isArray(U)){Array.prototype.push.apply(U,$.start),U.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||G0($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let Z=this.startBlockValue(q);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.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)q.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 U=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:U,sep:[]});else if($.sep)this.stack.push(U);else Object.assign($,{key:U,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===q.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let U=$$(Z),X=S0(U);e9(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
139
139
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
140
|
-
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){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 $=$$(q),Z=S0($);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=$$(q),Z=S0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){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(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}
|
|
141
|
-
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class v2{selected;cursor;scrollOffset;pageSize;itemCount;filter;searchActive;filteredMap;constructor(q,$){this.selected=q.map((Z)=>Z.checked),this.cursor=1,this.scrollOffset=0,this.pageSize=$,this.itemCount=q.length,this.filter="",this.searchActive=!1,this.filteredMap=q.map((Z,
|
|
142
|
-
`;
|
|
143
|
-
`){
|
|
144
|
-
`:T(
|
|
140
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){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 $=$$(q),Z=S0($);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=$$(q),Z=S0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){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(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}MQ.Parser=$4});var z4=D((SQ)=>{var Z4=_2(),DQ=Zq(),Jq=Uq(),wQ=D$(),PQ=S(),NQ=D2(),U4=w2();function X4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new NQ.LineCounter||null,prettyErrors:$}}function jQ(q,$={}){let{lineCounter:Z,prettyErrors:U}=X4($),X=new U4.Parser(Z?.addNewLine),Q=new Z4.Composer($),z=Array.from(Q.compose(X.parse(q)));if(U&&Z)for(let G of z)G.errors.forEach(Jq.prettifyError(q,Z)),G.warnings.forEach(Jq.prettifyError(q,Z));if(z.length>0)return z;return Object.assign([],{empty:!0},Q.streamInfo())}function Q4(q,$={}){let{lineCounter:Z,prettyErrors:U}=X4($),X=new U4.Parser(Z?.addNewLine),Q=new Z4.Composer($),z=null;for(let G of Q.compose(X.parse(q),!0,q.length))if(!z)z=G;else if(z.options.logLevel!=="silent"){z.errors.push(new Jq.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(U&&Z)z.errors.forEach(Jq.prettifyError(q,Z)),z.warnings.forEach(Jq.prettifyError(q,Z));return z}function CQ(q,$,Z){let U=void 0;if(typeof $==="function")U=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let X=Q4(q,Z);if(!X)return null;if(X.warnings.forEach((Q)=>wQ.warn(X.options.logLevel,Q)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:U},Z))}function bQ(q,$,Z){let U=null;if(typeof $==="function"||Array.isArray($))U=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let X=Math.round(Z);Z=X<1?void 0:X>8?{indent:8}:{indent:X}}if(q===void 0){let{keepUndefined:X}=Z??$??{};if(!X)return}if(PQ.isDocument(q)&&!U)return q.toString(Z);return new DQ.Document(q,U,Z).toString(Z)}SQ.parse=CQ;SQ.parseAllDocuments=jQ;SQ.parseDocument=Q4;SQ.stringify=bQ});import{execFile as z8}from"child_process";import{promisify as G8}from"util";import{mkdtemp as u2,readdir as J8,readFile as B$,rm as Bq,cp as Y8,access as m2,stat as H8,lstat as V8,symlink as W8,mkdir as B8}from"fs/promises";import{join as r,resolve as p2,relative as _8,basename as O8}from"path";import{homedir as d2}from"os";import{tmpdir as c2}from"os";import{readdir as e4,readFile as q8,stat as $8}from"fs/promises";import{join as Z8}from"path";var U8=new Set([".png",".jpg",".jpeg",".gif",".ico",".bmp",".webp",".mp3",".mp4",".wav",".avi",".mov",".zip",".tar",".gz",".bz2",".7z",".exe",".dll",".so",".dylib",".woff",".woff2",".ttf",".eot",".pdf",".doc",".docx"]),X8=524288;async function Hq(q){let $=[];async function Z(U,X){let Q;try{Q=await e4(U)}catch{return}for(let z of Q){if(z===".git"||z==="node_modules")continue;let G=Z8(U,z),J=X?`${X}/${z}`:z;try{let Y=await $8(G);if(Y.isDirectory())await Z(G,J);else if(Y.isFile()){let B=z.includes(".")?`.${z.split(".").pop().toLowerCase()}`:"";if(U8.has(B))continue;if(Y.size>X8)continue;try{let V=await q8(G,"utf-8");$.push({relPath:J,content:V,lineCount:V.split(`
|
|
141
|
+
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class v2{selected;cursor;scrollOffset;pageSize;itemCount;filter;searchActive;filteredMap;constructor(q,$){this.selected=q.map((Z)=>Z.checked),this.cursor=1,this.scrollOffset=0,this.pageSize=$,this.itemCount=q.length,this.filter="",this.searchActive=!1,this.filteredMap=q.map((Z,U)=>U)}get totalRows(){return this.filteredMap.length+1}applyFilter(q){if(this.filter==="")this.filteredMap=q.map(($,Z)=>Z);else{let $=this.filter.toLowerCase();this.filteredMap=[];for(let Z=0;Z<q.length;Z++)if((q[Z].label.toLowerCase()+" "+(q[Z].hint?.toLowerCase()??"")).includes($))this.filteredMap.push(Z)}if(this.cursor>=this.totalRows)this.cursor=Math.max(0,this.totalRows-1);if(this.scrollOffset>0&&this.scrollOffset>=this.totalRows)this.scrollOffset=Math.max(0,this.totalRows-this.pageSize)}cursorToOriginalIndex(){if(this.cursor===0)return-1;return this.filteredMap[this.cursor-1]??-1}toggleCurrent(){if(this.cursor===0)this.toggleAll();else{let q=this.cursorToOriginalIndex();if(q>=0)this.selected[q]=!this.selected[q]}}toggleAll(){let q=this.filteredMap,Z=!q.every((U)=>this.selected[U]);for(let U of q)this.selected[U]=Z}moveUp(){if(this.cursor>0)this.cursor--;else this.cursor=this.totalRows-1;this.adjustScroll()}moveDown(){if(this.cursor<this.totalRows-1)this.cursor++;else this.cursor=0;this.adjustScroll()}getSelectedIndices(){let q=[];for(let $=0;$<this.selected.length;$++)if(this.selected[$])q.push($);return q}getVisibleRange(){let q=this.scrollOffset,$=Math.min(this.scrollOffset+this.pageSize,this.totalRows);return{start:q,end:$}}adjustScroll(){if(this.cursor<this.scrollOffset)this.scrollOffset=this.cursor;else if(this.cursor>=this.scrollOffset+this.pageSize)this.scrollOffset=this.cursor-this.pageSize+1}}function Q8(q,$,Z){let U=[];if(q.searchActive||q.filter!==""){let Y=H.cyan("/"),B=q.filter,V=q.searchActive?H.cyan("█"):"";if(U.push(` ${Y}${B}${V}`),q.filteredMap.length===0)U.push(H.dim(" No matches found"));U.push("")}let{start:X,end:Q}=q.getVisibleRange();if(X>0)U.push(H.dim(` ... ${X} more above`));for(let Y=X;Y<Q;Y++){let V=Y===q.cursor?H.cyan(">"):" ";if(Y===0){let W=q.filteredMap,F=W.length>0&&W.every((O)=>q.selected[O])?H.green("[*]"):"[ ]",_=q.filter!==""?`Select All Matching (${q.filteredMap.length})`:"Select All / Deselect All";U.push(`${V} ${F} ${H.bold(_)}`)}else{let W=q.filteredMap[Y-1],T=$[W],_=q.selected[W]?H.green("[*]"):"[ ]",O=`${V} ${_} `,R=7,M=H.bold(T.label),A=T.label.length;if(T.hint){let w=Z-7-A-2;if(w>10){let L=H$(T.hint,w);U.push(`${O}${M} ${H.dim(L)}`)}else{let L=H$(T.label,Z-7);U.push(`${O}${H.bold(L)}`)}}else{let w=H$(T.label,Z-7);U.push(`${O}${H.bold(w)}`)}}}let z=q.totalRows-Q;if(z>0)U.push(H.dim(` ... ${z} more below`));let G=q.getSelectedIndices().length,J=q.filter!==""?` matching: ${q.filteredMap.length}/${q.itemCount}`:"";if(U.push(""),q.searchActive)U.push(H.dim(` ${G} of ${q.itemCount} selected${J} | Type to filter Esc Clear Enter Done searching`));else U.push(H.dim(` ${G} of ${q.itemCount} selected${J} | `+"↑/↓ Navigate Space Toggle a All / Search Enter Confirm Esc Cancel"));return U}function H$(q,$){if($<=0)return"";if(q.length<=$)return q;if($<=3)return q.slice(0,$);return q.slice(0,$-3)+"..."}async function Vq(q){let{items:$}=q,Z=q.pageSize??Math.min($.length+1,15),U=new v2($,Z),X=process.stderr,Q=process.stdin,z=X.columns||80;if(typeof Q.setRawMode==="function")Q.setRawMode(!0);Q.resume(),Q.setEncoding("utf-8"),X.write("\x1B[?25l");let G=0;function J(){let Y=Q8(U,$,z);if(G>0)X.write(`\x1B[${G}F`);let B=Math.max(Y.length,G),V="";for(let W=0;W<B;W++)V+=`\x1B[2K${W<Y.length?Y[W]:""}
|
|
142
|
+
`;X.write(V),G=B}return J(),new Promise((Y)=>{let B="",V=null;function W(){if(Q.removeListener("data",_),typeof Q.setRawMode==="function")Q.setRawMode(!1);if(Q.pause(),X.write("\x1B[?25h"),V)clearTimeout(V)}function T(O){W(),Y(O)}function F(O){if(U.searchActive){if(O==="\x1B"){U.searchActive=!1,U.filter="",U.applyFilter($),J();return}if(O==="\r"||O===`
|
|
143
|
+
`){U.searchActive=!1,J();return}if(O===""||O==="\b"){if(U.filter.length>0)U.filter=U.filter.slice(0,-1),U.applyFilter($);else U.searchActive=!1;J();return}if(O==="\x03"){W(),process.kill(process.pid,"SIGINT");return}if(O==="\x1B[A"){U.moveUp(),J();return}if(O==="\x1B[B"){U.moveDown(),J();return}if(O===" "){U.toggleCurrent(),J();return}if(O.length===1&&O>=" "&&O<="~"){U.filter+=O,U.applyFilter($),J();return}return}switch(O){case"\x1B[A":case"k":U.moveUp(),J();break;case"\x1B[B":case"j":U.moveDown(),J();break;case" ":U.toggleCurrent(),J();break;case"a":U.toggleAll(),J();break;case"/":U.searchActive=!0,J();break;case"\r":case`
|
|
144
|
+
`:T(U.getSelectedIndices());break;case"\x1B":if(U.filter!=="")U.filter="",U.applyFilter($),J();else T([]);break;case"":case"\b":if(U.filter.length>0)U.filter=U.filter.slice(0,-1),U.applyFilter($),J();break;case"\x03":W(),process.kill(process.pid,"SIGINT");break}}function _(O){if(B.length>0){if(B+=O,V)clearTimeout(V);if(B.length>=3&&B[1]==="["){let M=B.slice(0,3),A=B.slice(3);if(B="",F(M),A)_(A);return}let R=B;B="",F("\x1B");for(let M=1;M<R.length;M++)F(R[M]);return}for(let R=0;R<O.length;R++){let M=O[R];if(M==="\x1B"){let A=O.slice(R);if(A.length>=3&&A[1]==="[")F(A.slice(0,3)),R+=2;else if(A.length>=2){B=A,V=setTimeout(()=>{let w=B;B="",F("\x1B");for(let L=1;L<w.length;L++)F(w[L])},50);return}else{B="\x1B",V=setTimeout(()=>{B="",F("\x1B")},50);return}}else F(M)}}Q.on("data",_)})}var y0=G8(z8),T8=/^[a-zA-Z0-9_-]+$/,F8=/^[a-zA-Z0-9._-]+$/,L8=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,l2=128,I8=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\/tree\/(.+))?\/?$/;function K8(q){return q.startsWith("/")||q.startsWith("./")||q.startsWith("../")||q.startsWith("~/")||q==="~"||q==="."||q===".."}function R8(q){let $;if(q==="~")$=d2();else if(q.startsWith("~/"))$=p2(d2(),q.slice(2));else $=p2(q);let Z=O8($);return f(`install: parsed local source -> path=${$}`),{owner:"local",repo:Z,ref:null,subpath:null,cloneUrl:"",sshCloneUrl:"",isLocal:!0,localPath:$}}function x0(q){if(K8(q))return R8(q);let $=I8.exec(q);if($){let[,V,W,T]=$,F=W.endsWith(".git")?W.slice(0,-4):W;q=`github:${V}/${F}${T?`#${T}`:""}`}if(!q.startsWith("github:"))throw Error(`Invalid source format. Got: "${q}"
|
|
145
145
|
Supported formats:
|
|
146
146
|
github:owner/repo[#ref]
|
|
147
147
|
github:owner/repo#ref:path
|
|
148
148
|
https://github.com/owner/repo
|
|
149
149
|
https://github.com/owner/repo/tree/branch/path/to/skill
|
|
150
150
|
/path/to/local/skill
|
|
151
|
-
./relative/path/to/skill`);let Z=q.slice(7),
|
|
152
|
-
`)){let
|
|
153
|
-
HTTPS: ${Wq(
|
|
154
|
-
SSH: ${Wq(
|
|
155
|
-
`);for(let z=0;z<
|
|
156
|
-
`),Z=!1,
|
|
157
|
-
`),Z=-1;for(let
|
|
158
|
-
`);return null}function Dz(q){let $=Az(q);if($===null)return null;try{return N2($),null}catch(Z){return Z.message||"invalid YAML"}}async function Y4(q){let $=[];if(!q.description||q.description.trim()==="")$.push({category:"missing-description",message:"Skill has no description in SKILL.md frontmatter"});if(!q.version||q.version==="0.0.0")$.push({category:"missing-version",message:"Skill has no version (or default 0.0.0) in SKILL.md frontmatter"});try{let
|
|
151
|
+
./relative/path/to/skill`);let Z=q.slice(7),U=Z.indexOf("#"),X,Q=null,z=null;if(U!==-1){X=Z.slice(0,U);let V=Z.slice(U+1);if(!V)throw Error("Invalid source: ref cannot be empty after #");let W=V.indexOf(":");if(W!==-1){if(Q=V.slice(0,W),!Q)throw Error("Invalid source: ref cannot be empty before :");z=V.slice(W+1)||null}else Q=V}else{let V=Z.indexOf(":");if(V!==-1)X=Z.slice(0,V),z=Z.slice(V+1)||null;else X=Z}let G=X.indexOf("/");if(G===-1)throw Error(`Invalid source: format must be github:owner/repo. Got: "${q}"`);let J=X.slice(0,G),Y=X.slice(G+1);if(!J)throw Error("Invalid source: owner cannot be empty");if(!Y)throw Error("Invalid source: repo cannot be empty");if(!T8.test(J))throw Error(`Invalid source: owner contains invalid characters: "${J}". Allowed: [a-zA-Z0-9_-]`);if(!F8.test(Y))throw Error(`Invalid source: repo contains invalid characters: "${Y}". Allowed: [a-zA-Z0-9._-]`);let B={owner:J,repo:Y,ref:Q,subpath:z,cloneUrl:`https://github.com/${J}/${Y}.git`,sshCloneUrl:`git@github.com:${J}/${Y}.git`};return f(`install: parsed source -> owner=${J} repo=${Y} ref=${Q} subpath=${z}`),B}async function _$(q){if(q.subpath!==null||!q.ref||!q.ref.includes("/"))return q;try{let{stdout:$}=await y0("git",["ls-remote","--heads","--tags",q.cloneUrl],{timeout:15000}),Z=new Set;for(let X of $.split(`
|
|
152
|
+
`)){let Q=X.match(/\trefs\/(?:heads|tags)\/(.+)$/);if(Q)Z.add(Q[1])}let U=q.ref.split("/");for(let X=1;X<U.length;X++){let Q=U.slice(0,X).join("/");if(Z.has(Q)){let z=U.slice(X).join("/");return f(`install: resolved ref="${Q}" subpath="${z}"`),{...q,ref:Q,subpath:z||null}}}}catch($){f(`install: ls-remote failed, treating entire ref as branch: ${$}`)}return q}function g0(q){if(!q)throw Error("Invalid skill name: name cannot be empty");if(q.includes("\x00"))throw Error("Invalid skill name: contains unsafe characters (null byte)");if(q.includes(".."))throw Error("Invalid skill name: contains unsafe characters (..)");if(q.includes("/")||q.includes("\\"))throw Error("Invalid skill name: contains unsafe characters (path separator)");if(q.startsWith("."))throw Error("Invalid skill name: must not start with a dot");if(q.length>l2)throw Error(`Invalid skill name: exceeds maximum length of ${l2} characters`);if(!L8.test(q))throw Error(`Invalid skill name: "${q}" does not match allowed pattern [a-zA-Z0-9][a-zA-Z0-9._-]*`);return q}function M8(q){let $=q.split("/").filter(Boolean),Z=$.length>0?$[$.length-1]:q;return g0(Z)}function a2(q){let $=new Map;for(let Z of q){let U=M8(Z),X=$.get(U);if(X)X.push(Z);else $.set(U,[Z])}return[...$.entries()].filter(([,Z])=>Z.length>1).map(([Z,U])=>({name:Z,paths:U}))}async function k0(){try{await y0("git",["--version"]),f("install: git available")}catch{throw Error("git is required for installing skills. Install git from https://git-scm.com")}}function A8(q){if(q.killed)return!1;let $=(q.stderr||q.message||"").toLowerCase();return $.includes("authentication failed")||$.includes("could not read username")||$.includes("repository not found")||$.includes("returned error: 403")||$.includes("returned error: 401")||$.includes("terminal prompts disabled")||$.includes("permission denied")}function Wq(q){return q.killed?"Clone timed out after 60 seconds":`Clone failed: ${q.stderr||q.message}`}async function V$(q,$,Z){let U=["clone","--depth","1"];if($)U.push("--branch",$);return U.push(q,Z),await y0("git",U,{timeout:60000}),Z}async function h0(q,$="auto"){f(`install: cloning ${q.owner}/${q.repo}${q.ref?` (ref: ${q.ref})`:""} (transport: ${$})`);let Z=await u2(r(c2(),"asm-install-"));if($==="ssh"||$==="https"){let U=$==="ssh"?q.sshCloneUrl:q.cloneUrl;try{return await V$(U,q.ref,Z)}catch(X){throw await a(Z),Error(Wq(X))}}try{return await V$(q.cloneUrl,q.ref,Z)}catch(U){if(!A8(U))throw await a(Z),Error(Wq(U));f("install: HTTPS clone failed with auth error, retrying with SSH..."),await a(Z);let X=await u2(r(c2(),"asm-install-"));try{return await V$(q.sshCloneUrl,q.ref,X)}catch(Q){throw await a(X),Error(`Clone failed with both transports:
|
|
153
|
+
HTTPS: ${Wq(U)}
|
|
154
|
+
SSH: ${Wq(Q)}`)}}}async function K0(q){let $=r(q,"SKILL.md"),Z;try{Z=await B$($,"utf-8")}catch{throw Error("Not a valid skill: SKILL.md not found in repository root")}let U=L0(Z),X=q.split("/").pop()||"unknown",Q=U.name||X,z=I0(U);return f(`install: validated skill "${Q}" v${z}`),{name:Q,version:z,description:(U.description||"").replace(/\s*\n\s*/g," ").trim(),effort:U.effort||U["metadata.effort"]||void 0}}async function _q(q,$=3){let Z=[];async function U(X,Q,z){let G;try{G=await J8(X)}catch{return}for(let J of G){if(J===".git"||J==="node_modules")continue;let Y=r(X,J);try{if(!(await H8(Y)).isDirectory())continue}catch{continue}let B=Q?`${Q}/${J}`:J,V=z+1,W=r(Y,"SKILL.md");try{let T=await B$(W,"utf-8"),F=L0(T);Z.push({relPath:B,name:F.name||J,version:I0(F),description:(F.description||"").replace(/\s*\n\s*/g," ").trim(),effort:F.effort||F["metadata.effort"]||void 0,license:(F.license||"").trim(),creator:(F["metadata.creator"]||"").trim(),compatibility:(F.compatibility||"").trim(),allowedTools:i2(F)})}catch{if(V<$)await U(Y,B,V)}}}return await U(q,"",0),Z.sort((X,Q)=>X.name.localeCompare(Q.name)),Z}var D8=[{category:"Shell commands",pattern:/\b(bash|sh\s+-c)\b/},{category:"Shell commands",pattern:/\bexec\(/},{category:"Shell commands",pattern:/\bchild_process\b/},{category:"Shell commands",pattern:/\bBun\.spawn\b/},{category:"Code execution",pattern:/\beval\(/},{category:"Code execution",pattern:/\bFunction\(/},{category:"Code execution",pattern:/\bnew\s+Function\b/},{category:"Credentials",pattern:/\b(API_KEY|SECRET|TOKEN|PASSWORD)\s*[=:]/},{category:"External URLs",pattern:/https?:\/\//}];async function n2(q){let $=[],Z=await Hq(q);for(let{relPath:U,content:X}of Z){let Q=X.split(`
|
|
155
|
+
`);for(let z=0;z<Q.length;z++)for(let{category:G,pattern:J}of D8)if(J.test(Q[z])){let Y=Q[z].trim();$.push({category:G,file:U,line:z+1,match:Y.length>100?Y.slice(0,100)+"…":Y})}}return $}async function O$(q){let $=q.source.isLocal?`local:${q.source.localPath}`:`github:${q.source.owner}/${q.source.repo}${q.source.ref?`#${q.source.ref}`:""}${q.source.subpath?`:${q.source.subpath}`:""}`;if(q.force)try{await m2(q.targetDir),await Bq(q.targetDir,{recursive:!0,force:!0})}catch{}let Z=q.sourceDir;try{await Y8(Z,q.targetDir,{recursive:!0})}catch(G){throw Error(`Failed to install: ${G.message}`)}let U=r(q.targetDir,".git");try{await Bq(U,{recursive:!0,force:!0})}catch{}f(`install: copied files to ${q.targetDir}`);let X=r(q.targetDir,"SKILL.md");try{await m2(X)}catch{throw Error("Installation verification failed: SKILL.md not found at target")}let Q=await B$(X,"utf-8"),z=L0(Q);return{success:!0,path:q.targetDir,name:z.name||q.skillName,version:I0(z),provider:q.providerLabel,source:$}}async function s2(q,$){let Z=await O$(q);for(let U of $){if(U.name===q.providerName)continue;let X=W$(U.global),Q=r(X,q.skillName);await B8(X,{recursive:!0});try{if((await V8(Q)).isSymbolicLink())await Bq(Q);else{f(`install: skipping ${Q} — existing non-symlink directory`);continue}}catch{}let z=_8(X,q.targetDir);await W8(z,Q,"dir"),f(`install: symlinked ${Q} -> ${z}`)}return Z.provider=`All (${$.map((U)=>U.label).join(", ")})`,Z}async function a(q){try{await Bq(q,{recursive:!0,force:!0})}catch{}}async function o2(){try{await y0("npx",["--version"]),f("install: npx available")}catch{throw Error("npx is required for Vercel method installation. Install Node.js from https://nodejs.org")}}async function r2(q,$){let Z=["--yes","skills","add",q];if($)Z.push("--skill",$);f(`install: running npx ${Z.join(" ")}`);try{let U=await y0("npx",Z,{timeout:120000});return{stdout:U.stdout,stderr:U.stderr}}catch(U){let X=U.stderr||U.message||"";throw Error(`npx skills add failed: ${X}`)}}function t2(q){if(q.isLocal)return q.localPath;let $=`https://github.com/${q.owner}/${q.repo}`;if(q.ref)return`${$}/tree/${q.ref}${q.subpath?`/${q.subpath}`:""}`;return $}async function Oq(q,$,Z){let U=q.providers.filter((J)=>J.enabled);if($==="all"){if(U.length===0)throw Error("No providers are enabled. Enable a provider in your config.");return{provider:U.find((Y)=>Y.name==="agents")||U[0],allProviders:U}}if($){let J=q.providers.find((Y)=>Y.name===$);if(!J){let Y=q.providers.map((B)=>B.name).join(", ");throw Error(`Unknown provider: "${$}". Valid providers: ${Y}, all`)}if(!J.enabled)throw Error(`Provider "${$}" is disabled. Enable it in your config or choose another provider.`);return{provider:J,allProviders:null}}if(U.length===1)return{provider:U[0],allProviders:null};if(!Z){if(U.length===0)throw Error("No providers are enabled. Enable a provider in your config.");let J=U.map((Y)=>Y.name).join(", ");throw Error(`--tool (or --provider) is required in non-interactive mode. Available: ${J}, all`)}let X=q.providers.map((J)=>({label:`${J.label} (${J.name})`,hint:J.global,checked:J.enabled})),Q=await Vq({items:X});if(Q.length===0)throw Error("No tools selected. Aborting.");let z=Q.map((J)=>q.providers[J]);if(z.length===1)return{provider:z[0],allProviders:null};return{provider:z.find((J)=>J.name==="agents")||z[0],allProviders:z}}function e2(q,$,Z,U,X,Q){let z=W$(X.global),G=r(z,U);return{source:q,tempDir:$,sourceDir:Z,targetDir:G,skillName:U,force:Q,providerName:X.name,providerLabel:X.label}}import{readFile as Kz}from"fs/promises";import{join as Rz}from"path";var gQ=_2(),kQ=Zq(),hQ=t$(),P2=Uq(),vQ=m0(),J0=S(),uQ=U0(),mQ=x(),pQ=Q0(),dQ=z0(),AY=eq(),cQ=A2(),lQ=D2(),iQ=w2(),Z$=z4(),G4=v0();var aQ=gQ.Composer,nQ=kQ.Document,sQ=hQ.Schema,oQ=P2.YAMLError,rQ=P2.YAMLParseError,tQ=P2.YAMLWarning,eQ=vQ.Alias,qz=J0.isAlias,$z=J0.isCollection,Zz=J0.isDocument,Uz=J0.isMap,Xz=J0.isNode,Qz=J0.isPair,zz=J0.isScalar,Gz=J0.isSeq,Jz=uQ.Pair,Yz=mQ.Scalar,Hz=pQ.YAMLMap,Vz=dQ.YAMLSeq;var Wz=cQ.Lexer,Bz=lQ.LineCounter,_z=iQ.Parser,N2=Z$.parse,Oz=Z$.parseAllDocuments,Tz=Z$.parseDocument,Fz=Z$.stringify,Lz=G4.visit,Iz=G4.visitAsync;var J4=500;function Mz(q){let $=q.split(`
|
|
156
|
+
`),Z=!1,U=!1;for(let X of $){if(X.trim()==="---")if(!Z){Z=!0;continue}else{U=!0;continue}if(U&&X.trim().length>0)return!0}return!1}function Az(q){let $=q.split(`
|
|
157
|
+
`),Z=-1;for(let U=0;U<$.length;U++)if($[U].trim()==="---")if(Z===-1)Z=U+1;else return $.slice(Z,U).join(`
|
|
158
|
+
`);return null}function Dz(q){let $=Az(q);if($===null)return null;try{return N2($),null}catch(Z){return Z.message||"invalid YAML"}}async function Y4(q){let $=[];if(!q.description||q.description.trim()==="")$.push({category:"missing-description",message:"Skill has no description in SKILL.md frontmatter"});if(!q.version||q.version==="0.0.0")$.push({category:"missing-version",message:"Skill has no version (or default 0.0.0) in SKILL.md frontmatter"});try{let U=Rz(q.path,"SKILL.md"),X=await Kz(U,"utf-8");if(!Mz(X))$.push({category:"empty-body",message:"SKILL.md contains only frontmatter with no body content"});let Q=Dz(X);if(Q)$.push({category:"invalid-yaml",message:`SKILL.md has invalid YAML frontmatter: ${Q}`})}catch{}let Z=q.fileCount;if(Z!==void 0&&Z>J4)$.push({category:"high-file-count",message:`Skill has ${Z} files (threshold: ${J4})`});return $}function H4(q){let $=q.map((Z)=>({name:Z.name,version:Z.version,dirName:Z.dirName,provider:Z.provider,scope:Z.scope,path:Z.path,isSymlink:Z.isSymlink,symlinkTarget:Z.symlinkTarget,effort:Z.effort}));return{version:1,exportedAt:new Date().toISOString(),skills:$}}import{mkdir as wz,writeFile as Pz,access as Nz}from"fs/promises";import{join as jz}from"path";function Cz(q){return`---
|
|
159
159
|
name: ${q}
|
|
160
160
|
description: ""
|
|
161
161
|
license: ""
|
|
@@ -176,11 +176,11 @@ as instructions for when and how to use this skill.
|
|
|
176
176
|
## Instructions
|
|
177
177
|
|
|
178
178
|
- Step-by-step instructions for the agent
|
|
179
|
-
`}async function V4(q,$){await wz($,{recursive:!0});let Z=jz($,"SKILL.md"),
|
|
180
|
-
`)}import{access as xz,lstat as gz,readFile as
|
|
181
|
-
`);for(let G=0;G<z.length;G++){let J=z[G],Y=J.trim();for(let B of R4)if(B.pattern.test(J)){let V=B.category;if(!$.has(V))$.set(V,{description:B.description,matches:[]});let W=Y.length>120?Y.slice(0,120)+"...":Y;$.get(V).matches.push({file:
|
|
182
|
-
`)}function b2(q){return JSON.stringify(q,null,2)}import{writeFile as
|
|
183
|
-
`,"utf-8"),f(`ingester: wrote index to ${G}`),{success:!0,repoIndex:
|
|
179
|
+
`}async function V4(q,$){await wz($,{recursive:!0});let Z=jz($,"SKILL.md"),U=Cz(q);await Pz(Z,U,"utf-8")}async function W4(q){try{return await Nz(q),!0}catch{return!1}}import{readdir as bz,stat as Sz}from"fs/promises";import{join as Ez}from"path";async function fz(q){let $=0;try{let U=(await bz(q,{recursive:!0})).map(async(Q)=>{try{let z=await Sz(Ez(q,Q));if(z.isFile())return z.size}catch{}return 0});$=(await Promise.all(U)).reduce((Q,z)=>Q+z,0)}catch{}return $}async function O4(q,$){let Z={},U={global:0,project:0},X={},Q=q.map(async(J)=>{Z[J.provider]=(Z[J.provider]||0)+1,U[J.scope]++;let Y=await fz(J.path);return X[J.path]=Y,Y}),G=(await Promise.all(Q)).reduce((J,Y)=>J+Y,0);return{totalSkills:q.length,byProvider:Z,byScope:U,totalDiskBytes:G,perSkillDiskBytes:X,duplicateGroups:$.duplicateGroups.length,duplicateInstances:$.totalDuplicateInstances}}function yz(q){if(q<1024)return`${q} B`;if(q<1048576)return`${(q/1024).toFixed(1)} KB`;if(q<1073741824)return`${(q/1048576).toFixed(1)} MB`;return`${(q/1073741824).toFixed(1)} GB`}function j2(q,$,Z=20){let U=Math.round(q/$*Z),X=Z-U;return H.green("#".repeat(U))+H.dim("-".repeat(X))}var B4={claude:"Claude Code",codex:"Codex",openclaw:"OpenClaw",agents:"Agents"};function T4(q){let $=[];$.push(""),$.push(H.blueBold(" Skill Statistics")),$.push(H.dim(" "+"-".repeat(20))),$.push(""),$.push(` ${H.bold("Total:")} ${H.cyan(String(q.totalSkills))} skills`),$.push(` ${H.bold("Disk:")} ${H.cyan(yz(q.totalDiskBytes))}`),$.push(""),$.push(H.bold(" By Tool"));let Z=Object.entries(q.byProvider).sort((J,Y)=>Y[1]-J[1]),U=Math.max(...Z.map(([,J])=>J)),X=Math.max(...Z.map(([J])=>(B4[J]||J).length));for(let[J,Y]of Z){let B=B4[J]||J,V=_4(J,B.padEnd(X)),W=String(Y).padStart(4);$.push(` ${V} ${W} ${j2(Y,U)}`)}$.push(""),$.push(H.bold(" By Scope"));let Q=Math.max(q.byScope.global,q.byScope.project),z=String(q.byScope.global).padStart(4),G=String(q.byScope.project).padStart(4);if($.push(` ${"global ".padEnd(X)} ${z} ${j2(q.byScope.global,Q)}`),$.push(` ${"project".padEnd(X)} ${G} ${j2(q.byScope.project,Q)}`),$.push(""),$.push(H.bold(" Duplicates")),q.duplicateGroups>0)$.push(` ${H.yellow(`${q.duplicateGroups} group(s), ${q.duplicateInstances} total instance(s)`)}`),$.push(H.dim(` Run ${H.bold("asm audit")} to review`));else $.push(` ${H.green("None")}`);return $.push(""),$.join(`
|
|
180
|
+
`)}import{access as xz,lstat as gz,readFile as kz,rm as hz,symlink as vz}from"fs/promises";import{join as F4}from"path";async function L4(q){let $;try{$=await gz(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=F4(q,"SKILL.md"),U;try{U=await kz(Z,"utf-8")}catch{throw Error(`No SKILL.md found in ${q}`)}let X=L0(U);if(!X.name)throw Error(`Invalid SKILL.md in ${q}: missing "name" in frontmatter`);return{name:X.name,version:I0(X)}}async function U$(q,$,Z,U){let X=F4($,Z),Q=!1;try{await xz(X),Q=!0}catch{}if(Q){if(!U)throw Error(`Target already exists: ${X}. Use --force to overwrite.`);await hz(X,{recursive:!0,force:!0})}await vz(q,X,"dir")}var R4=[{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bcurl\b/,severity:"critical",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bwget\b/,severity:"critical",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bfetch\s*\(/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\baxios\b/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bhttp\.request\b/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bXMLHttpRequest\b/,severity:"warning",permissionType:"network"},{category:"External URLs",description:"Hardcoded URLs that may indicate data exfiltration or remote payload loading",pattern:/https?:\/\/(?!github\.com|localhost|127\.0\.0\.1|example\.com)/,severity:"warning",permissionType:"network"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bexec\s*\(/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bexecSync\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bchild_process\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bspawn\s*\(/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bBun\.spawn\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bshelljs\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\b(?:bash|sh|zsh)\s+-c\b/,severity:"critical",permissionType:"shell"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\beval\s*\(/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bnew\s+Function\b/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bFunction\s*\(/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bimport\s*\(\s*[^'"]/,severity:"warning",permissionType:"code-execution"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bfs\.(?:write|append|unlink|rm|mkdir|rename)\b/,severity:"warning",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bwriteFile(?:Sync)?\b/,severity:"warning",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\brm\s+-rf?\b/,severity:"critical",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bchmod\b/,severity:"warning",permissionType:"filesystem"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/\b(?:API_KEY|SECRET_KEY|ACCESS_TOKEN|PRIVATE_KEY)\s*[=:]/,severity:"critical"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/\bPASSWORD\s*[=:]/,severity:"critical"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/(?:sk|pk)[-_](?:live|test)[-_][a-zA-Z0-9]{20,}/,severity:"critical"},{category:"Environment variable access",description:"Reading environment variables which may contain secrets or configuration",pattern:/\bprocess\.env\b/,severity:"info",permissionType:"environment"},{category:"Environment variable access",description:"Reading environment variables which may contain secrets or configuration",pattern:/\bBun\.env\b/,severity:"info",permissionType:"environment"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\batob\s*\(/,severity:"warning"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\bBuffer\.from\s*\([^,]+,\s*['"]base64['"]\)/,severity:"warning"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\\x[0-9a-fA-F]{2}(?:\\x[0-9a-fA-F]{2}){5,}/,severity:"warning"}];async function uz(q,$){let Z={owner:q,repo:$,profileUrl:`https://github.com/${q}`,reposUrl:`https://github.com/${q}?tab=repositories`,isOrganization:null,publicRepos:null,accountAge:null,fetchError:null};try{let U=await fetch(`https://api.github.com/users/${q}`,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"agent-skill-manager"},signal:AbortSignal.timeout(1e4)});if(!U.ok)return Z.fetchError=`GitHub API returned ${U.status}`,Z;let X=await U.json();if(Z.isOrganization=X.type==="Organization",Z.publicRepos=typeof X.public_repos==="number"?X.public_repos:null,typeof X.created_at==="string"){let Q=new Date(X.created_at),z=new Date,G=Math.floor((z.getTime()-Q.getTime())/31557600000),J=Math.floor((z.getTime()-Q.getTime())%31557600000/2630016000.0000005);Z.accountAge=G>0?`${G}y ${J}m`:`${J}m`}f(`security-audit: source analysis for ${q} -> repos=${Z.publicRepos}, org=${Z.isOrganization}, age=${Z.accountAge}`)}catch(U){Z.fetchError=U.message||"Failed to fetch GitHub profile",f(`security-audit: source analysis failed -> ${Z.fetchError}`)}return Z}function mz(q){let $=new Map;for(let{relPath:X,content:Q}of q){let z=Q.split(`
|
|
181
|
+
`);for(let G=0;G<z.length;G++){let J=z[G],Y=J.trim();for(let B of R4)if(B.pattern.test(J)){let V=B.category;if(!$.has(V))$.set(V,{description:B.description,matches:[]});let W=Y.length>120?Y.slice(0,120)+"...":Y;$.get(V).matches.push({file:X,line:G+1,match:W,severity:B.severity})}}}let Z=[];for(let[X,Q]of $)Z.push({category:X,description:Q.description,matches:Q.matches});let U={critical:0,warning:1,info:2};return Z.sort((X,Q)=>{let z=Math.min(...X.matches.map((J)=>U[J.severity])),G=Math.min(...Q.matches.map((J)=>U[J.severity]));return z-G}),Z}function pz(q){let $=new Map;for(let Q of q)for(let z of Q.matches)for(let G of R4)if(G.permissionType&&G.category===Q.category&&G.pattern.test(z.match)){let J=G.permissionType;if(!$.has(J))$.set(J,{evidence:[],categories:new Set});let Y=$.get(J);Y.evidence.push({file:z.file,line:z.line,match:z.match}),Y.categories.add(Q.category);break}let Z={filesystem:"Skill reads, writes, or modifies files on disk. Verify it only accesses intended paths.",shell:"Skill executes shell commands or spawns processes. This allows arbitrary system access.",network:"Skill makes network requests or downloads external content. Data may be sent to remote servers.","code-execution":"Skill dynamically constructs and executes code. This can bypass static analysis.",environment:"Skill reads environment variables, which may contain secrets or API keys."},U=[];for(let[Q,z]of $)U.push({type:Q,evidence:z.evidence,reason:Z[Q]});let X={shell:0,"code-execution":1,network:2,filesystem:3,environment:4};return U.sort((Q,z)=>(X[Q.type]??99)-(X[z.type]??99)),U}function dz(q,$,Z){let U=0,X=0;for(let J of q)for(let Y of J.matches){if(Y.severity==="critical")U++;if(Y.severity==="warning")X++}let Q=$.some((J)=>J.type==="shell"),z=$.some((J)=>J.type==="code-execution"),G=$.some((J)=>J.type==="network");if(Q&&G)return{verdict:"dangerous",reason:"Skill has both shell execution and network access -- potential data exfiltration risk."};if(z&&G)return{verdict:"dangerous",reason:"Skill has dynamic code execution and network access -- potential remote code execution risk."};if(U>=10)return{verdict:"dangerous",reason:`${U} critical findings detected. High concentration of risky patterns.`};if(Q||z)return{verdict:"warning",reason:Q?"Skill executes shell commands. Review commands carefully before installing.":"Skill uses dynamic code execution. Review usage carefully."};if(U>0)return{verdict:"warning",reason:`${U} critical finding${U>1?"s":""} detected. Manual review recommended.`};if(X>0)return{verdict:"caution",reason:`${X} warning${X>1?"s":""} found. Generally acceptable but worth reviewing.`};if(Z&&Z.publicRepos!==null&&Z.publicRepos<3)return{verdict:"caution",reason:"No code issues found, but the author has very few public repositories."};return{verdict:"safe",reason:"No suspicious patterns detected."}}async function Q$(q,$,Z,U){f(`security-audit: scanning ${q}`);let X=await Hq(q),Q=X.reduce((V,W)=>V+W.lineCount,0),z=null;if(Z&&U)z=await uz(Z,U);let G=mz(X),J=pz(G),{verdict:Y,reason:B}=dz(G,J,z);return{scannedAt:new Date().toISOString(),skillName:$,skillPath:q,source:z,codeScans:G,permissions:J,totalFiles:X.length,totalLines:Q,verdict:Y,verdictReason:B}}var N=H,T0=56,cz={"Shell execution":"shell","Dynamic code execution":"code-execution","Network requests":"network","External URLs":"network","File system access":"filesystem","Environment variable access":"environment","Embedded credentials":"credentials","Obfuscation patterns":"obfuscation"},I4={critical:0,warning:1,info:2};function lz(q){switch(q){case"safe":return N.bgGreen(" SAFE ");case"caution":return N.bgCyan(" CAUTION ");case"warning":return N.bgYellow(" WARNING ");case"dangerous":return N.bgRed(" DANGEROUS ")}}function iz(q){switch(q){case"safe":return N.green;case"caution":return N.cyan;case"warning":return N.yellow;case"dangerous":return N.red}}function E0(q){switch(q){case"critical":return N.red("!!");case"warning":return N.yellow(" !");case"info":return N.dim(" i")}}function C2(q,$){return q.length>$?q.slice(0,$-3)+"...":q}function X$(q){return q.toLocaleString("en-US")}function M4(q){return q.replace(/\x1b\[[0-9;]*m/g,"")}function K4(q){return M4(q).length}function az(q){let $=new Map;for(let Z of q){let U=`${Z.file}:${Z.line}`,X=$.get(U);if(!X||I4[Z.severity]<I4[X.severity])$.set(U,Z)}return Array.from($.values())}function nz(q){let $=new Map;for(let Z of q){let U=$.get(Z.file);if(!U)U={file:Z.file,entries:[]},$.set(Z.file,U);U.entries.push({line:Z.line,match:Z.match,severity:Z.severity})}return Array.from($.values())}function z$(q){let $=[],Z=lz(q.verdict),U=M4(Z),X=` ${N.bold(q.skillName)}`,Q=` ${q.skillName}`,z=T0-4,G=Math.max(1,z-Q.length-U.length);if($.push(""),$.push(N.dim(" +-- ")+N.bold("Security Audit")+N.dim(" "+"-".repeat(T0-19)+"+")),$.push(N.dim(" |")+X+" ".repeat(G)+Z+N.dim("|")),$.push(N.dim(" |")+N.dim(` ${X$(q.totalFiles)} files | ${X$(q.totalLines)} lines`)+" ".repeat(Math.max(1,z-` ${X$(q.totalFiles)} files | ${X$(q.totalLines)} lines`.length))+N.dim("|")),$.push(N.dim(" +"+"-".repeat(T0-2)+"+")),q.source){let V=q.source;if(V.fetchError)$.push(` ${N.yellow("!")} Could not fetch profile: ${V.fetchError}`);else{let W=[];if(W.push(`${V.owner} ${V.isOrganization?N.cyan("(org)"):N.dim("(user)")}`),V.publicRepos!==null){let T=V.publicRepos,F=T<3?N.yellow(`${T} repos`):T<10?N.cyan(`${T} repos`):N.green(`${T} repos`);W.push(F)}if(V.accountAge)W.push(V.accountAge);$.push(` ${N.dim("Author:")} ${W.join(N.dim(" | "))}`)}}if($.push(""),q.codeScans.length===0)$.push(` ${N.green("*")} ${N.green("No suspicious patterns detected.")}`);else{let V=iz(q.verdict),W=q.verdict==="dangerous"||q.verdict==="warning"?E0("critical"):q.verdict==="caution"?E0("warning"):E0("info");$.push(` ${W} ${V(q.verdictReason)}`);let T=0,F=0,_=0;for(let A of q.codeScans)for(let w of A.matches)if(w.severity==="critical")T++;else if(w.severity==="warning")F++;else _++;let O=[];if(T>0)O.push(N.red(`${T} critical`));if(F>0)O.push(N.yellow(`${F} warning`));if(_>0)O.push(N.dim(`${_} info`));let R=q.permissions.map((A)=>A.type),M=R.length>0?N.dim(`Perms: ${R.join(", ")}`):"";$.push(` ${O.join(N.dim(" | "))} ${M}`)}if($.push(""),q.codeScans.length>0){$.push(` ${N.bold("Findings")}`),$.push(N.dim(" "+"=".repeat(T0-2)));for(let V of q.codeScans){let W=az(V.matches),T=W.filter((C)=>C.severity==="critical").length,F=W.filter((C)=>C.severity==="warning").length,_=W.filter((C)=>C.severity==="info").length,O=T>0?E0("critical"):F>0?E0("warning"):E0("info"),R=[];if(T>0)R.push(N.red(`${T} critical`));if(F>0)R.push(N.yellow(`${F} warning`));if(_>0)R.push(N.dim(`${_} info`));let M=cz[V.category],A=M?N.dim(`PERM: ${M}`):"",w=` ${O} ${N.bold(V.category)} (${R.join(", ")})`;if(A){let C=K4(w),y=K4(A),E=Math.max(2,T0-C-y);$.push(w+" ".repeat(E)+A)}else $.push(w);let L=nz(W),I=Math.min(24,Math.max(...L.map((C)=>C.file.length))),P=0,K=3;for(let C of L){if(P>=K)break;let y=C2(C.file,24),E=N.dim(y.padEnd(I));if(C.entries.length===1){let o=C.entries[0],F0=C2(o.match,50);$.push(` ${E} :${o.line} ${N.dim("--")} ${o.severity==="critical"?F0:N.dim(F0)}`),P++}else if(C.entries.length<=3){let o=C.entries.map((Y$)=>`:${Y$.line}`).join(", "),F0=C2(C.entries[0].match,40);$.push(` ${E} ${o} ${N.dim("--")} ${N.dim(F0)}`),P++}else{let F0=C.entries.slice(0,3).map((t4)=>`:${t4.line}`).join(", "),Y$=C.entries.length-3;$.push(` ${E} ${F0} ${N.dim(`(+${Y$} more)`)}`),P++}}let j=L.length-Math.min(L.length,K);if(j>0){let C=W.length-L.slice(0,K).reduce((y,E)=>y+E.entries.length,0);if(C>0)$.push(` ${N.dim(`... ${C} more in ${j} file${j>1?"s":""}`)}`)}$.push("")}}$.push(N.dim(" "+"=".repeat(T0-2)));let J=new Date(q.scannedAt),Y=`${J.getFullYear()}-${String(J.getMonth()+1).padStart(2,"0")}-${String(J.getDate()).padStart(2,"0")} ${String(J.getHours()).padStart(2,"0")}:${String(J.getMinutes()).padStart(2,"0")}`,B=q.source&&!q.source.fetchError?`github.com/${q.source.owner}`:"";if(B){let V=Math.max(2,T0-2-Y.length-B.length);$.push(N.dim(` ${Y}${" ".repeat(V)}${B}`))}else $.push(N.dim(` ${Y}`));return $.push(""),$.join(`
|
|
182
|
+
`)}function b2(q){return JSON.stringify(q,null,2)}import{writeFile as QG,mkdir as zG,unlink as GG}from"fs/promises";import{join as C4}from"path";import{readdir as sz,readFile as oz}from"fs/promises";import{join as rz}from"path";function S2(q){let $=new Set,Z=q.toLowerCase().split(/[\s\-_.,;:()[\]{}"']+/);for(let U of Z)if(U.length>=2)$.add(U);return $}var tz=10,ez=5,qG=3,$G=1;function ZG(q,$){let Z=S2(q),U=S2($.name),X=S2($.description),Q=0;for(let z of Z){if(U.has(z))Q+=tz;if(X.has(z))Q+=qG;if($.name.toLowerCase().includes(z))Q+=ez;if($.description.toLowerCase().includes(z))Q+=$G}return Q}async function A4(q){let $=new Map,Z;try{Z=await sz(q)}catch{return $}for(let U of Z){if(!U.endsWith(".json"))continue;let X=rz(q,U);try{let Q=await oz(X,"utf-8"),z=JSON.parse(Q);for(let G of z.skills){if(!("license"in G))G.license="";if(!("creator"in G))G.creator="";if(!("compatibility"in G))G.compatibility="";if(!("allowedTools"in G))G.allowedTools=[]}$.set(`${z.owner}/${z.repo}`,z)}catch{}}return $}async function G$(){let q=await A4(P4()),$=await A4(Yq()),Z=new Map(q);for(let[U,X]of $)Z.set(U,X);return Array.from(Z.values())}var UG=["license","creator","version"];function D4(q){return UG.includes(q)}function w4(q,$){return q[$]||""}function XG(q,$){if($.has)for(let Z of $.has){if(!D4(Z))continue;if(!w4(q,Z))return!1}if($.missing)for(let Z of $.missing){if(!D4(Z))continue;if(w4(q,Z))return!1}return!0}function N4(q){let $=[];if(!q.license)$.push("license");if(!q.creator)$.push("creator");if(!q.version||q.version==="0.0.0")$.push("version");return $}async function J$(q,$=20,Z){let U=await G$(),X=[],Q=!q&&Z;for(let z of U)for(let G of z.skills){if(Z&&!XG(G,Z))continue;let J=Q?1:ZG(q,G);if(J>0)X.push({skill:G,repo:{owner:z.owner,repo:z.repo},score:J})}return X.sort((z,G)=>G.score-z.score),X.slice(0,$)}async function j4(){return(await G$()).reduce(($,Z)=>$+Z.skillCount,0)}async function JG(){let q=Yq();return await zG(q,{recursive:!0}),q}async function b4(q){await k0();let $;try{$=x0(q)}catch(U){return{success:!1,repoIndex:null,error:U.message}}if($.isLocal)return{success:!1,repoIndex:null,error:"Local paths are not supported for indexing. Use a GitHub source instead."};f(`ingester: cloning ${$.owner}/${$.repo}`);let Z=null;try{Z=await h0($),f(`ingester: discovering skills in ${Z}`);let U=await _q(Z);f(`ingester: found ${U.length} skills`);let X=U.map((J)=>({name:J.name,description:J.description,version:J.version,license:J.license,creator:J.creator,compatibility:J.compatibility,allowedTools:J.allowedTools,installUrl:`github:${$.owner}/${$.repo}${$.ref?`#${$.ref}`:""}${J.relPath?`:${J.relPath}`:""}`,relPath:J.relPath})),Q={repoUrl:$.cloneUrl,owner:$.owner,repo:$.repo,updatedAt:new Date().toISOString(),skillCount:X.length,skills:X},z=await JG(),G=C4(z,`${$.owner}_${$.repo}.json`);return await QG(G,JSON.stringify(Q,null,2)+`
|
|
183
|
+
`,"utf-8"),f(`ingester: wrote index to ${G}`),{success:!0,repoIndex:Q}}catch(U){return{success:!1,repoIndex:null,error:U.message}}finally{if(Z)await a(Z)}}async function S4(){return(await G$()).map(($)=>({owner:$.owner,repo:$.repo,skillCount:$.skillCount,updatedAt:$.updatedAt})).sort(($,Z)=>Z.skillCount-$.skillCount)}async function E4(q,$){let Z=Yq(),U=C4(Z,`${q}_${$}.json`);try{return await GG(U),!0}catch{return!1}}function YG(q){let $=q.slice(2),Z={command:null,subcommand:null,positional:[],flags:{help:!1,version:!1,json:!1,yes:!1,noColor:!1,scope:"both",sort:"name",provider:null,name:null,force:!1,path:null,all:!1,verbose:!1,flat:!1,transport:"auto",method:"default",installed:!1,available:!1,has:[],missing:[]}},U=0;while(U<$.length){let X=$[U];if(X==="--help"||X==="-h")Z.flags.help=!0;else if(X==="--version"||X==="-v")Z.flags.version=!0;else if(X==="--json")Z.flags.json=!0;else if(X==="--yes"||X==="-y")Z.flags.yes=!0;else if(X==="--no-color")Z.flags.noColor=!0;else if(X==="--scope"||X==="-s"){U++;let Q=$[U];if(Q==="global"||Q==="project"||Q==="both")Z.flags.scope=Q;else b(`Invalid scope: "${Q}". Must be global, project, or both.`),process.exit(2)}else if(X==="--sort"){U++;let Q=$[U];if(Q==="name"||Q==="version"||Q==="location")Z.flags.sort=Q;else b(`Invalid sort: "${Q}". Must be name, version, or location.`),process.exit(2)}else if(X==="--provider"||X==="-p"||X==="--tool")U++,Z.flags.provider=$[U]||null;else if(X==="--name")U++,Z.flags.name=$[U]||null;else if(X==="--force"||X==="-f")Z.flags.force=!0;else if(X==="--path")U++,Z.flags.path=$[U]||null;else if(X==="--all")Z.flags.all=!0;else if(X==="--verbose"||X==="-V")Z.flags.verbose=!0;else if(X==="--flat")Z.flags.flat=!0;else if(X==="--installed")Z.flags.installed=!0;else if(X==="--available")Z.flags.available=!0;else if(X==="--transport"||X==="-t"){U++;let Q=$[U];if(Q==="https"||Q==="ssh"||Q==="auto")Z.flags.transport=Q;else b(`Invalid transport: "${Q}". Must be https, ssh, or auto.`),process.exit(2)}else if(X==="--method"||X==="-m"){U++;let Q=$[U];if(Q==="default"||Q==="vercel")Z.flags.method=Q;else b(`Invalid method: "${Q}". Must be default or vercel.`),process.exit(2)}else if(X==="--skill")U++,Z.flags.path=$[U]||null;else if(X==="--has"){if(U++,$[U])Z.flags.has.push($[U])}else if(X==="--missing"){if(U++,$[U])Z.flags.missing.push($[U])}else if(X.startsWith("-"))b(`Unknown option: ${X}`),console.error('Run "asm --help" for usage.'),process.exit(2);else if(!Z.command)Z.command=X;else if(!Z.subcommand)Z.subcommand=X;else Z.positional.push(X);U++}return Z}function b(q){console.error(H.red(`Error: ${q}`))}function HG(){console.log(`${H.blueBold("agent-skill-manager")} (${H.bold("asm")}) ${h2}
|
|
184
184
|
|
|
185
185
|
Interactive TUI and CLI for managing installed skills for AI coding agents.
|
|
186
186
|
|
|
@@ -325,20 +325,20 @@ ${H.bold("Options:")}
|
|
|
325
325
|
${H.bold("Examples:")}
|
|
326
326
|
asm config show ${H.dim("View current config")}
|
|
327
327
|
asm config edit ${H.dim("Edit in $EDITOR")}
|
|
328
|
-
asm config reset -y ${H.dim("Reset without confirmation")}`)}async function s4(q){for(let $ of q)$.warnings=await Y4($)}async function FG(q){if(q.flags.help){VG();return}let $=await
|
|
329
|
-
${H.yellow(`${
|
|
330
|
-
`)),q.flags.flat)console.log(x2(
|
|
331
|
-
`));for(let J of
|
|
332
|
-
`)}}}async function IG(q){if(q.flags.help){BG();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await
|
|
333
|
-
${H.bold("Proceed with removal?")} [y/N] `);let G=await f0();if(G.toLowerCase()!=="y"&&G.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let z=await y2(
|
|
334
|
-
Done.`))}function f0(){return new Promise((q)=>{let $="",Z=!1;function
|
|
335
|
-
`))
|
|
336
|
-
Auto-removing duplicates...`));for(let
|
|
328
|
+
asm config reset -y ${H.dim("Reset without confirmation")}`)}async function s4(q){for(let $ of q)$.warnings=await Y4($)}async function FG(q){if(q.flags.help){VG();return}let $=await h(),Z=await i($,q.flags.scope);if(q.flags.provider&&q.command==="list")Z=Z.filter((X)=>X.provider===q.flags.provider);await s4(Z);let U=f2(Z,q.flags.sort);if(q.flags.json)console.log(u(U));else if(q.flags.flat){let X=x2(U),Q=U.filter((z)=>z.warnings&&z.warnings.length>0);if(Q.length>0)X+=`
|
|
329
|
+
${H.yellow(`${Q.length} skill${Q.length===1?"":"s"} with warnings -- use --json for details`)}`;console.log(X)}else console.log(p4(U))}async function LG(q){if(q.flags.help){WG();return}let $=q.subcommand;if(!$)b("Missing required argument: <query>"),console.error('Run "asm search --help" for usage.'),process.exit(2);let Z=!q.flags.available,U=!q.flags.installed,X=[];if(Z){let J=await h(),Y=await i(J,q.flags.scope);if(q.flags.provider)Y=Y.filter((V)=>V.provider===q.flags.provider);let B=g4(Y,$);X=f2(B,q.flags.sort)}let Q=[];if(U){if(Q=await J$($),X.length>0){let J=new Set(X.map((Y)=>Y.name.toLowerCase()));Q=Q.filter((Y)=>!J.has(Y.skill.name.toLowerCase()))}}if(q.flags.json){let J=X.map((B)=>({name:B.name,description:B.description,version:B.version,scope:B.scope,provider:B.provider,status:"installed"})),Y=Q.map((B)=>({name:B.skill.name,description:B.skill.description,version:B.skill.version,repo:`${B.repo.owner}/${B.repo.repo}`,installCommand:`asm install ${B.skill.installUrl}`,status:"available"}));console.log(u([...J,...Y]));return}let z=X.length>0,G=Q.length>0;if(!z&&!G){console.error(`No skills matching "${$}".`),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(z)if(console.error(H.bold(`Installed skills matching "${$}":
|
|
330
|
+
`)),q.flags.flat)console.log(x2(X));else console.log(d4(X,$));if(G){if(z)console.error("");console.error(H.bold(`Available skills matching "${$}":
|
|
331
|
+
`));for(let J of Q){console.error(`${H.cyan(J.skill.name)} ${H.dim(`v${J.skill.version}`)} ${H.dim(`[${J.repo.owner}/${J.repo.repo}]`)}`);for(let Y of g2(J.skill.description,80))console.error(` ${Y}`);console.error(` ${H.green(`asm install ${J.skill.installUrl}`)}
|
|
332
|
+
`)}}}async function IG(q){if(q.flags.help){BG();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await h(),X=(await i(Z,q.flags.scope)).filter((Q)=>Q.dirName===$);if(X.length===0)b(`Skill "${$}" not found.`),console.error(H.dim(`Try ${H.bold("asm list")} to see all skills or ${H.bold(`asm search "${$}"`)} to search.`)),process.exit(1);if(await s4(X),q.flags.json)console.log(u(X.length===1?X[0]:X));else console.log(await c4(X))}async function KG(q){if(q.flags.help){_G();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm uninstall --help" for usage.'),process.exit(2);let Z=await h(),U=await i(Z,q.flags.scope),X=h4($,U,Z),Q=await v4(X);if(Q.length===0)b(`Skill "${$}" not found or nothing to remove.`),process.exit(1);console.error(H.bold("Removal plan:"));for(let G of Q)console.error(` ${H.red("•")} ${m4(G)}`);if(!q.flags.yes){if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
|
|
333
|
+
${H.bold("Proceed with removal?")} [y/N] `);let G=await f0();if(G.toLowerCase()!=="y"&&G.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let z=await y2(X);for(let G of z)console.error(G);console.error(H.green(`
|
|
334
|
+
Done.`))}function f0(){return new Promise((q)=>{let $="",Z=!1;function U(){process.stdin.removeListener("data",Q),process.stdin.removeListener("end",z),process.stdin.pause(),clearTimeout(G)}function X(J){if(Z)return;Z=!0,U(),q(J)}function Q(J){if($+=J,$.includes(`
|
|
335
|
+
`))X($.trim())}function z(){X($.trim())}let G=setTimeout(()=>{X($.trim())},30000);process.stdin.setEncoding("utf-8"),process.stdin.on("data",Q),process.stdin.on("end",z),process.stdin.resume()})}async function RG(q){if(q.flags.help){OG();return}let $=q.subcommand??"duplicates";if($==="security"){await MG(q);return}if($!=="duplicates")b(`Unknown audit subcommand: "${$}". Use: duplicates, security`),process.exit(2);let Z=await h(),U=await i(Z,"both"),X=k2(U);if(q.flags.json){console.log(a4(X));return}if(console.log(i4(X)),q.flags.yes&&X.duplicateGroups.length>0){console.error(H.bold(`
|
|
336
|
+
Auto-removing duplicates...`));for(let Q of X.duplicateGroups){let z=l4(Q.instances),G=z[0].path;for(let J=1;J<z.length;J++){let Y=z[J],B=k4(Y,Z),V=await y2(B,G);for(let W of V)console.error(W)}}console.error(H.green(`
|
|
337
337
|
Done.`))}}async function MG(q){let $=q.positional[0];if(q.flags.all)await AG(q);else if(!$)b(`Missing target. Provide a skill name, GitHub source, or use --all.
|
|
338
|
-
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await DG(q,$);else await wG(q,$)}async function AG(q){let $=await
|
|
339
|
-
`);let
|
|
340
|
-
Summary:`)),z.dangerous>0)console.log(` ${H.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${H.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${H.green(`${z.safe} safe`)}`);console.log("")}}async function DG(q,$){let Z=null;try{let
|
|
341
|
-
`);let z=await
|
|
338
|
+
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await DG(q,$);else await wG(q,$)}async function AG(q){let $=await h(),Z=await i($,q.flags.scope);if(Z.length===0){if(q.flags.json)console.log("[]");else console.log("No skills found to audit.");return}let U=new Set,X=Z.filter((z)=>{if(U.has(z.realPath))return!1;return U.add(z.realPath),!0});console.error(`Auditing ${X.length} skill${X.length>1?"s":""}...
|
|
339
|
+
`);let Q=[];for(let z of X){console.error(` Scanning ${H.bold(z.name)}...`);let G=await Q$(z.realPath,z.name);Q.push(G)}if(q.flags.json)console.log(JSON.stringify(Q,null,2));else{for(let G of Q)console.log(z$(G));let z={safe:0,caution:0,warning:0,dangerous:0};for(let G of Q)z[G.verdict]++;if(console.log(H.bold(`
|
|
340
|
+
Summary:`)),z.dangerous>0)console.log(` ${H.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${H.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${H.green(`${z.safe} safe`)}`);console.log("")}}async function DG(q,$){let Z=null;try{let U=x0($);if(U.isLocal)throw Error("Local paths are not supported for remote security audits. Use: asm audit security <installed-skill-name>");await k0(),U=await _$(U),console.error(`Cloning ${$} for audit...`),Z=await h0(U,q.flags.transport);let{join:X}=await import("path"),Q=U.subpath?X(Z,U.subpath):Z,{name:z}=await K0(Q),G=await Q$(Q,z,U.owner,U.repo);if(q.flags.json)console.log(b2(G));else console.log(z$(G))}catch(U){b(U.message),process.exit(1)}finally{if(Z)await a(Z)}}async function wG(q,$){let Z=await h(),X=(await i(Z,q.flags.scope)).filter((G)=>G.dirName===$);if(X.length===0)b(`Skill "${$}" not found. Use "asm list" to see installed skills.`),process.exit(1);let Q=X[0];console.error(`Auditing installed skill: ${H.bold(Q.name)}...
|
|
341
|
+
`);let z=await Q$(Q.realPath,Q.name);if(q.flags.json)console.log(b2(z));else console.log(z$(z))}async function PG(q){if(q.flags.help){TG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: show, path, reset, or edit."),console.error('Run "asm config --help" for usage.'),process.exit(2);switch($){case"show":{let Z=await h();console.log(u(Z));break}case"path":{console.log(E2());break}case"reset":{if(!q.flags.yes){if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`${H.bold("Reset config to defaults?")} [y/N] `);let U=await f0();if(U.toLowerCase()!=="y"&&U.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Z=y4();await x4(Z),console.error(H.green("Config reset to defaults."));break}case"edit":{let Z=process.env.VISUAL||process.env.EDITOR||"vi",[U,X]=n4(Z),Q=E2();await h();let{spawn:z}=await import("child_process");await new Promise((G,J)=>{let Y=z(U,[...X,Q],{stdio:"inherit"});Y.on("close",()=>G()),Y.on("error",J)});break}default:b(`Unknown config subcommand: "${$}". Use: show, path, reset, or edit.`),process.exit(2)}}function NG(){console.log(`${H.bold("Usage:")} asm install <source> [options]
|
|
342
342
|
|
|
343
343
|
Install a skill from a GitHub repository or a local folder path.
|
|
344
344
|
|
|
@@ -398,18 +398,18 @@ ${H.bold("Subfolder URL:")}
|
|
|
398
398
|
${H.bold("Vercel skills CLI:")}
|
|
399
399
|
asm install github:user/skills --method vercel --skill my-skill
|
|
400
400
|
asm install https://github.com/user/skills -m vercel --skill my-skill -y
|
|
401
|
-
${H.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function jG(q,$,Z,X,Q,
|
|
402
|
-
${H.bold("Install preview:")}`),console.info(` ${H.bold("Name:")} ${z.name}`),console.info(` ${H.bold("Version:")} ${z.version}`),z.description)console.info(` ${H.bold("Description:")} ${H.dim(z.description)}`);if(z.effort)console.info(` ${H.bold("Effort:")} ${u4(z.effort)}`);if(console.info(` ${H.bold("Source:")} ${$}`),
|
|
401
|
+
${H.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function jG(q,$,Z,U,X,Q,z,G){let J=await K0(U),Y=await n2(U),B=U===Z?null:U.split("/").pop(),V=X||B||$.repo,W=g0(V),T=G.find((L)=>L.name.toLowerCase()===J.name.toLowerCase()&&L.provider===z.name),F,_=!!T;if(T)if(T.version===J.version)F=q.flags.force?"REINSTALL":`UPDATE: ${T.version} (same version)`;else F=`UPDATE: ${T.version} → ${J.version}`;else F="NEW";let O=e2($,Z,U,W,z,q.flags.force||_),R=Y.some((L)=>["Shell commands","Code execution","Credentials"].includes(L.category)),M=Y.some((L)=>["External URLs"].includes(L.category)),A=R?"high":M?"medium":"safe",w=R?H.red("[!] High Risk"):M?H.yellow("[~] Medium Risk"):H.green("[ok] Safe");return{metadata:J,skillName:W,warnings:Y,installStatus:F,riskLevel:A,riskLabel:w,plan:O}}function CG(q,$,Z,U,X,Q){let{metadata:z,warnings:G,installStatus:J,riskLabel:Y,plan:B}=q;if(X&&Q){let V=H.dim(`[${Q.index}/${Q.total}]`),W=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);console.info(`${V} ${H.bold(z.name)} v${z.version} ${W} ${Y}`)}else{let V=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);if(console.info(` ${H.bold(z.name)} v${z.version} ${V}`),console.info(`
|
|
402
|
+
${H.bold("Install preview:")}`),console.info(` ${H.bold("Name:")} ${z.name}`),console.info(` ${H.bold("Version:")} ${z.version}`),z.description)console.info(` ${H.bold("Description:")} ${H.dim(z.description)}`);if(z.effort)console.info(` ${H.bold("Effort:")} ${u4(z.effort)}`);if(console.info(` ${H.bold("Source:")} ${$}`),U)console.info(` ${H.bold("Tool:")} All (${U.map((W)=>W.label).join(", ")})`),console.info(` ${H.bold("Primary:")} ${Z.label} (${Z.name})`),console.info(` ${H.bold("Symlinks:")} ${U.filter((W)=>W.name!==Z.name).map((W)=>W.label).join(", ")}`);else console.info(` ${H.bold("Tool:")} ${Z.label} (${Z.name})`);if(console.info(` ${H.bold("Target:")} ${B.targetDir}`),console.info(` ${H.bold("Status:")} ${V}`),console.info(` ${H.bold("Risk:")} ${Y}`),G.length>0){console.info(`
|
|
403
403
|
${H.bold("Security warnings:")}`);let W=new Map;for(let T of G){let F=W.get(T.category)||[];F.push(T),W.set(T.category,F)}for(let[T,F]of W){let O=["Shell commands","Code execution","Credentials"].includes(T)?H.red(`[${T}]`):H.yellow(`[${T}]`);console.info(`
|
|
404
|
-
${O} ${H.dim(`(${F.length} match${F.length>1?"es":""})`)}`);for(let R of F.slice(0,5))console.info(` ${H.dim(`${R.file}:${R.line}`)} -- ${R.match}`);if(F.length>5)console.info(H.dim(` ... and ${F.length-5} more`))}}}}async function bG(q,$){if($)return await s2(q,$);return await O$(q)}async function SG(q){if(q.flags.help){NG();return}let $=q.subcommand;if(!$)b("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,
|
|
405
|
-
${H.cyan(`[Step ${
|
|
406
|
-
`);for(let j=0;j<I.length;j++){let C=H.cyan(` ${String(j+1).padStart(String(I.length).length)})`);if(console.info(`${C} ${H.bold(I[j].name)} ${H.dim(`v${I[j].version}`)} ${H.dim(`(${I[j].relPath})`)}`),I[j].description)console.info(` ${H.dim(I[j].description)}`)}console.info(
|
|
404
|
+
${O} ${H.dim(`(${F.length} match${F.length>1?"es":""})`)}`);for(let R of F.slice(0,5))console.info(` ${H.dim(`${R.file}:${R.line}`)} -- ${R.match}`);if(F.length>5)console.info(H.dim(` ... and ${F.length-5} more`))}}}}async function bG(q,$){if($)return await s2(q,$);return await O$(q)}async function SG(q){if(q.flags.help){NG();return}let $=q.subcommand;if(!$)b("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,U=7,X=0,Q=(G)=>{return X++,`
|
|
405
|
+
${H.cyan(`[Step ${X}/${U}]`)} ${H.bold(G)}`},z=()=>{if(Z)a(Z).finally(()=>process.exit(1));else process.exit(1)};process.on("SIGINT",z),process.on("SIGTERM",z);try{console.info(Q("Parsing source"));let G=x0($),J=!!G.isLocal;if(J){let L=G.localPath;console.info(` ${H.dim(`local: ${L}`)}`);let{stat:I}=await import("fs/promises");try{if(!(await I(L)).isDirectory())throw Error(`Path is not a directory: ${L}`)}catch(P){if(P.code==="ENOENT")throw Error(`Path does not exist: ${L}`);throw P}}else await k0(),G=await _$(G),console.info(` ${H.dim($)}`);if(q.flags.method==="vercel"){console.info(Q("Installing via Vercel skills CLI")),await o2();let L=t2(G),I=q.flags.path||null;console.info(` ${H.dim(`npx skills add ${L}${I?` --skill ${I}`:""}`)}`);let{stdout:P,stderr:K}=await r2(L,I);if(P.trim())console.info(` ${H.dim(P.trim())}`);if(K.trim())console.error(` ${H.dim(K.trim())}`);console.info(` ${H.green("✓")} Vercel skills CLI install completed`),q.flags.force=!0,console.info(` ${H.dim("Continuing with asm install to register in local inventory...")}`)}console.info(Q("Selecting provider"));let Y=await h(),{provider:B,allProviders:V}=await Oq(Y,q.flags.provider,!!process.stdin.isTTY);if(J)console.info(Q("Reading local source")),console.info(` ${H.dim(G.localPath)}`),Z=null;else{console.info(Q("Cloning repository"));let L=q.flags.transport,I=L==="ssh"?G.sshCloneUrl:L==="https"?G.cloneUrl:`${G.cloneUrl} ${H.dim("(auto)")}`;console.info(` ${I}${G.ref?` ${H.dim(`(ref: ${G.ref})`)}`:""}${G.subpath?` ${H.dim(`(path: ${G.subpath})`)}`:""}`),Z=await h0(G,L)}let W=J?G.localPath:Z;console.info(Q("Scanning for skills"));let{join:T}=await import("path"),F=[],_=q.flags.path||G.subpath,O=[];if(_){let L=T(W,_);try{await K0(L)}catch{throw Error(`No SKILL.md found at path "${_}" in the repository.`)}console.info(` Found skill at ${H.bold(_)}`),O=[{skillDir:L,nameOverride:q.flags.name}]}else{let L=!1;try{await K0(W),L=!0}catch{}if(L){let I=await K0(W);console.info(` Found: ${H.bold(I.name)} v${I.version}`),O=[{skillDir:W,nameOverride:q.flags.name}]}else{console.info(" No SKILL.md at root. Scanning subdirectories...");let I=await _q(W);if(I.length===0)throw Error("No skills found in this repository. Skills must have a SKILL.md file.");console.info(` Found ${H.bold(String(I.length))} skill(s):
|
|
406
|
+
`);for(let j=0;j<I.length;j++){let C=H.cyan(` ${String(j+1).padStart(String(I.length).length)})`);if(console.info(`${C} ${H.bold(I[j].name)} ${H.dim(`v${I[j].version}`)} ${H.dim(`(${I[j].relPath})`)}`),I[j].description)console.info(` ${H.dim(I[j].description)}`)}console.info(Q("Selecting skills")),X--;let P;if(q.flags.all&&(q.flags.yes||!process.stdin.isTTY))P=I.map((j)=>j.relPath),console.info(` Selected all ${H.bold(String(P.length))} skills`);else if(process.stdin.isTTY)if(I.length===1)P=[I[0].relPath],console.info(` Auto-selected: ${H.bold(I[0].name)} ${H.dim(`v${I[0].version}`)}`);else{let j=I.map((y)=>({label:y.name,hint:`v${y.version}${y.description?" "+y.description:""}`,checked:!!q.flags.all}));console.info("");let C=await Vq({items:j});if(C.length===0)throw Error("No skills selected. Aborting.");P=C.map((y)=>I[y].relPath),console.info(` Selected ${H.bold(String(P.length))} skill(s)`)}else{b(`Repository contains ${I.length} skills. Use --path <subdir> to pick one or --all to install all.
|
|
407
407
|
Available skills:
|
|
408
408
|
${I.map((j)=>` --path ${j.relPath}`).join(`
|
|
409
409
|
`)}`),process.exit(2);return}let K=a2(P);if(K.length>0){let j=K.map((y)=>` - ${y.name}: ${y.paths.map((E)=>`"${E}"`).join(", ")}`).join(`
|
|
410
410
|
`),C=Error(`Duplicate skill names detected in selection:
|
|
411
411
|
${j}
|
|
412
|
-
Choose one path per skill name or install with --path.`);throw C.duplicates=K,C}O=P.map((j)=>({skillDir:T(W,j),nameOverride:P.length===1?q.flags.name:null})),
|
|
412
|
+
Choose one path per skill name or install with --path.`);throw C.duplicates=K,C}O=P.map((j)=>({skillDir:T(W,j),nameOverride:P.length===1?q.flags.name:null})),X++}}console.info(Q("Inspecting skills"));let R=await i(Y,"both"),M=[],A=O.length>1;for(let L=0;L<O.length;L++){let{skillDir:I,nameOverride:P}=O[L],K=await jG(q,G,W,I,P,Y,B,R);M.push(K),CG(K,$,B,V,A,A?{index:L+1,total:O.length}:void 0)}if(A){if(console.info(""),console.info(` ${H.bold("Install settings:")}`),console.info(` ${H.bold("Source:")} ${$}`),V)console.info(` ${H.bold("Tool:")} All (${V.map((j)=>j.label).join(", ")})`);else console.info(` ${H.bold("Tool:")} ${B.label} (${B.name})`);let L=M.filter((j)=>j.riskLevel==="high").length,I=M.filter((j)=>j.riskLevel==="medium").length,P=M.filter((j)=>j.riskLevel==="safe").length,K=[];if(P>0)K.push(H.green(`${P} Safe`));if(I>0)K.push(H.yellow(`${I} Medium Risk`));if(L>0)K.push(H.red(`${L} High Risk`));console.info(` ${H.bold("Risk:")} ${K.join(", ")}`)}if(console.info(Q("Installing")),!q.flags.yes){let L=M.some((j)=>j.riskLevel==="high");if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);let I=A?`${M.length} skills`:`"${M[0].metadata.name}"`,P=L?`
|
|
413
413
|
${H.red("[!]")} ${H.bold(`Install ${I}? Some have high-risk patterns.`)} [y/N] `:`
|
|
414
414
|
${H.bold(`Install ${I}?`)} [Y/n] `;process.stderr.write(P);let K=await f0();if(L){if(K.toLowerCase()!=="y"&&K.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}else if(K.toLowerCase()==="n"||K.toLowerCase()==="no")console.error("Aborted."),process.exit(0)}let w=[];for(let L=0;L<M.length;L++){let I=M[L],P=A?H.dim(`[${L+1}/${M.length}]`)+" ":" ";try{console.info(`${P}Installing ${H.bold(I.metadata.name)}...`);let K=await bG(I.plan,V);F.push(K),console.info(`${P}${H.green("✓")} ${I.metadata.name} installed to ${H.dim(I.plan.targetDir)}`)}catch(K){w.push({name:I.metadata.name,error:K.message}),console.error(`${P}${H.red("✗")} ${H.bold(I.metadata.name)} — ${H.red(K.message)}`)}}if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),w.length>0){console.error(`
|
|
415
415
|
${H.yellow(`${w.length} skill(s) failed to install:`)}`);for(let L of w)console.error(` ${H.red("✗")} ${L.name}: ${L.error}`)}if(q.flags.json)console.log(JSON.stringify(F.length===1?F[0]:F,null,2));else if(F.length===1)console.error(H.green(`
|
|
@@ -427,7 +427,7 @@ ${H.bold("Options:")}
|
|
|
427
427
|
${H.bold("Examples:")}
|
|
428
428
|
asm export ${H.dim("Export all skills")}
|
|
429
429
|
asm export -s global ${H.dim("Export global skills only")}
|
|
430
|
-
asm export > skills.json ${H.dim("Save to file")}`)}async function fG(q){if(q.flags.help){EG();return}let $=await
|
|
430
|
+
asm export > skills.json ${H.dim("Save to file")}`)}async function fG(q){if(q.flags.help){EG();return}let $=await h(),Z=await i($,q.flags.scope),U=H4(Z);console.log(JSON.stringify(U,null,2))}function yG(){console.log(`${H.bold("Usage:")} asm init <name> [options]
|
|
431
431
|
|
|
432
432
|
Scaffold a new skill directory with a SKILL.md template. Creates a
|
|
433
433
|
ready-to-edit skill in the target tool's skill folder.
|
|
@@ -442,8 +442,8 @@ ${H.bold("Options:")}
|
|
|
442
442
|
${H.bold("Examples:")}
|
|
443
443
|
asm init my-skill ${H.dim("Scaffold (interactive tool)")}
|
|
444
444
|
asm init my-skill -p claude ${H.dim("Scaffold in Claude Code")}
|
|
445
|
-
asm init my-skill --path ./skills ${H.dim("Scaffold in custom directory")}`)}async function xG(q){if(q.flags.help){yG();return}let $=q.subcommand;if(!$)b("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=g0($),
|
|
446
|
-
${H.bold("Overwrite?")} [y/N] `);let
|
|
445
|
+
asm init my-skill --path ./skills ${H.dim("Scaffold in custom directory")}`)}async function xG(q){if(q.flags.help){yG();return}let $=q.subcommand;if(!$)b("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=g0($),U;if(q.flags.path){let{resolve:X}=await import("path");U=X(q.flags.path)}else{let X=await h(),{provider:Q}=await Oq(X,q.flags.provider,!!process.stdin.isTTY),{join:z}=await import("path"),{resolveProviderPath:G}=await import("./chunk-b7betbzn.js"),J=G(X.providers.find((Y)=>Y.name===Q.name).global);U=z(J,Z)}if(await W4(U)){if(!q.flags.force){if(!process.stdin.isTTY)b(`Directory already exists: ${U}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Directory already exists: ${U}`)}
|
|
446
|
+
${H.bold("Overwrite?")} [y/N] `);let X=await f0();if(X.toLowerCase()!=="y"&&X.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}await V4(Z,U),console.error(H.green(`Done! Created skill "${Z}" at ${U}`))}function gG(){console.log(`${H.bold("Usage:")} asm stats [options]
|
|
447
447
|
|
|
448
448
|
Show aggregate skill metrics with provider distribution charts,
|
|
449
449
|
scope breakdown, disk usage, and duplicate summary.
|
|
@@ -457,7 +457,7 @@ ${H.bold("Options:")}
|
|
|
457
457
|
${H.bold("Examples:")}
|
|
458
458
|
asm stats ${H.dim("Show full dashboard")}
|
|
459
459
|
asm stats -s global ${H.dim("Global skills only")}
|
|
460
|
-
asm stats --json ${H.dim("Output raw data as JSON")}`)}async function
|
|
460
|
+
asm stats --json ${H.dim("Output raw data as JSON")}`)}async function kG(q){if(q.flags.help){gG();return}let $=await h(),Z=await i($,q.flags.scope);if(Z.length===0){console.log("No skills found.");return}let U=k2(Z),X=await O4(Z,U);if(q.flags.json)if(!q.flags.verbose){let{perSkillDiskBytes:Q,...z}=X;console.log(u(z))}else console.log(u(X));else console.log(T4(X))}function hG(){console.log(`${H.bold("Usage:")} asm link <path> [options]
|
|
461
461
|
|
|
462
462
|
Symlink a local skill directory into an agent's skill folder. Useful
|
|
463
463
|
for local development — changes to the source are reflected immediately.
|
|
@@ -473,8 +473,8 @@ ${H.bold("Options:")}
|
|
|
473
473
|
${H.bold("Examples:")}
|
|
474
474
|
asm link ./my-skill ${H.dim("Link (interactive tool)")}
|
|
475
475
|
asm link ./my-skill -p claude ${H.dim("Link to Claude Code")}
|
|
476
|
-
asm link ./my-skill --name alias ${H.dim("Link with custom name")}`)}async function vG(q){if(q.flags.help){
|
|
477
|
-
${H.bold("Overwrite?")} [y/N] `);let F=await f0();if(F.toLowerCase()!=="y"&&F.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await
|
|
476
|
+
asm link ./my-skill --name alias ${H.dim("Link with custom name")}`)}async function vG(q){if(q.flags.help){hG();return}let $=q.subcommand;if(!$)b("Missing required argument: <path>"),console.error('Run "asm link --help" for usage.'),process.exit(2);let{resolve:Z,basename:U}=await import("path"),X=Z($),Q=await L4(X),z=q.flags.name?g0(q.flags.name):U(X),G=await h(),{provider:J}=await Oq(G,q.flags.provider,!!process.stdin.isTTY),{resolveProviderPath:Y}=await import("./chunk-b7betbzn.js"),B=Y(G.providers.find((T)=>T.name===J.name).global),{join:V}=await import("path"),W=V(B,z);if(!q.flags.force){let T=!1;try{let{access:F}=await import("fs/promises");await F(W),T=!0}catch{}if(T){if(!process.stdin.isTTY)b(`Target already exists: ${W}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Target already exists: ${W}`)}
|
|
477
|
+
${H.bold("Overwrite?")} [y/N] `);let F=await f0();if(F.toLowerCase()!=="y"&&F.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await U$(X,B,z,!0)}else await U$(X,B,z,!1)}else await U$(X,B,z,!0);if(q.flags.json)console.log(u({success:!0,name:z,symlinkPath:W,targetPath:X}));else console.error(H.green(`Done! Linked "${z}" -> ${X}`)),console.error(` Symlink: ${W}`),console.error(H.dim(` If you move or delete the source, run "asm uninstall ${z}" to clean up.`))}function uG(){console.log(`${H.bold("Usage:")} asm index <subcommand> [options]
|
|
478
478
|
|
|
479
479
|
Manage the skill index for searching available skills from indexed repos.
|
|
480
480
|
|
|
@@ -498,7 +498,10 @@ ${H.bold("Examples:")}
|
|
|
498
498
|
asm index search marketing --has license ${H.dim("Only with license")}
|
|
499
499
|
asm index search "" --missing creator ${H.dim("Skills missing creator")}
|
|
500
500
|
asm index list ${H.dim("List indexed repos")}
|
|
501
|
-
asm index remove obra/superpowers ${H.dim("Remove from index")}`)}async function mG(q){if(q.flags.help){uG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: ingest, search, list, or remove"),console.error('Run "asm index --help" for usage.'),process.exit(2);switch($){case"ingest":{let Z=q.positional[0];if(!Z)b("Missing required argument: <repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);console.error(H.blueBold(`Ingesting ${Z}...`));let
|
|
502
|
-
`));for(let z of
|
|
503
|
-
`)}}break}case"list":{let Z=await S4();if(Z.length===0){if(q.flags.json)console.log(u([]));else console.info("No repositories indexed."),console.error(H.dim("Add repos with: asm index ingest <repo>"));return}let
|
|
504
|
-
`));for(let
|
|
501
|
+
asm index remove obra/superpowers ${H.dim("Remove from index")}`)}async function mG(q){if(q.flags.help){uG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: ingest, search, list, or remove"),console.error('Run "asm index --help" for usage.'),process.exit(2);switch($){case"ingest":{let Z=q.positional[0];if(!Z)b("Missing required argument: <repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);console.error(H.blueBold(`Ingesting ${Z}...`));let U=await b4(Z);if(!U.success)b(`Failed to ingest: ${U.error}`),process.exit(1);if(U.repoIndex)if(q.flags.json)console.log(u({success:!0,owner:U.repoIndex.owner,repo:U.repoIndex.repo,skillCount:U.repoIndex.skillCount,updatedAt:U.repoIndex.updatedAt}));else console.error(H.green(`Successfully indexed ${U.repoIndex.owner}/${U.repoIndex.repo}`)),console.error(` Skills found: ${U.repoIndex.skillCount}`);break}case"search":{let Z=q.positional.join(" ");if(!Z&&q.flags.has.length===0&&q.flags.missing.length===0)b("Missing required argument: <query>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let U={};if(q.flags.has.length>0)U.has=q.flags.has;if(q.flags.missing.length>0)U.missing=q.flags.missing;let Q=U.has||U.missing?await J$(Z||"",20,U):await J$(Z);if(Q.length===0){if(q.flags.json)console.log(u([]));else console.info("No skills found matching your query."),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(q.flags.json)console.log(u(Q.map((z)=>({name:z.skill.name,description:z.skill.description,version:z.skill.version,license:z.skill.license||"",creator:z.skill.creator||"",compatibility:z.skill.compatibility||"",allowedTools:z.skill.allowedTools||[],installUrl:z.skill.installUrl,installCommand:`asm install ${z.skill.installUrl}`,repo:`${z.repo.owner}/${z.repo.repo}`}))));else{console.error(H.bold(`Found ${Q.length} skills:
|
|
502
|
+
`));for(let z of Q){console.error(`${H.cyan(z.skill.name)} ${H.dim(`v${z.skill.version}`)} ${H.dim(`[${z.repo.owner}/${z.repo.repo}]`)}`);for(let J of g2(z.skill.description,80))console.error(` ${J}`);let G=N4(z.skill);if(G.length>0)console.error(` ${H.yellow(`⚠ Missing: ${G.join(", ")}`)}`);console.error(` ${H.green(`asm install ${z.skill.installUrl}`)}
|
|
503
|
+
`)}}break}case"list":{let Z=await S4();if(Z.length===0){if(q.flags.json)console.log(u([]));else console.info("No repositories indexed."),console.error(H.dim("Add repos with: asm index ingest <repo>"));return}let U=await j4();if(q.flags.json)console.log(u(Z));else{console.error(H.bold(`Indexed Repositories (${U} total skills):
|
|
504
|
+
`));for(let X of Z)console.error(`${H.cyan(`${X.owner}/${X.repo}`)} - ${X.skillCount} skills ${H.dim(`(${new Date(X.updatedAt).toLocaleDateString()})`)}`)}break}case"remove":{let Z=q.positional[0];if(!Z)b("Missing required argument: <owner/repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let[U,X]=Z.split("/");if(!U||!X)b("Invalid format. Use: <owner/repo>"),process.exit(2);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`${H.bold("Remove")} ${H.cyan(`${U}/${X}`)} ${H.bold("from index?")} [y/N] `);let z=await f0();if(z.toLowerCase()!=="y"&&z.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}if(await E4(U,X))console.error(H.green(`Removed ${U}/${X} from index`));else b(`Repository not found in index: ${U}/${X}`),process.exit(1);break}default:b(`Unknown subcommand: "${$}"`),console.error('Run "asm index --help" for usage.'),process.exit(2)}}async function o4(q){let $=YG(q);if($.flags.noColor)globalThis.__CLI_NO_COLOR=!0;if($.flags.verbose)f4(!0);if($.flags.version){console.log(`asm ${h2}`);return}if(!$.command&&$.flags.help){HG();return}if(!$.command)return;switch($.command){case"list":await FG($);break;case"search":await LG($);break;case"inspect":await IG($);break;case"uninstall":await KG($);break;case"audit":await RG($);break;case"install":await SG($);break;case"config":await PG($);break;case"export":await fG($);break;case"init":await xG($);break;case"stats":await kG($);break;case"link":await vG($);break;case"index":await mG($);break;default:b(`Unknown command: "${$.command}"`),console.error('Run "asm --help" for usage.'),process.exit(2)}}function r4(q){let $=q.slice(2);if($.length===0)return!1;let Z=["list","search","inspect","uninstall","audit","config","install","export","init","stats","link","index"],U=$[0];if(Z.includes(U))return!0;if(U==="--help"||U==="-h")return!0;if(U==="--version"||U==="-v")return!0;if(U.startsWith("-")||U.length>0)return!0;return!1}if(r4(process.argv))await o4(process.argv);else if(!(typeof globalThis.Bun<"u")){let{spawn:$}=await import("child_process"),Z=$("bun",[process.argv[1],...process.argv.slice(2)],{stdio:"inherit"});Z.on("error",()=>{console.error(`The interactive TUI requires Bun (https://bun.sh).
|
|
505
|
+
Install it with: curl -fsSL https://bun.sh/install | bash
|
|
506
|
+
|
|
507
|
+
`+"CLI commands (list, search, inspect, etc.) work with Node.js — run: asm --help"),process.exit(1)}),Z.on("exit",(U)=>process.exit(U??0))}else await import("./chunk-t50w9h6a.js");
|