agent-skill-manager 1.8.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/agent-skill-manager.js +203 -191
- package/dist/chunk-2fm3qrhn.js +90 -0
- package/dist/chunk-4ftygzj1.js +90 -0
- package/dist/chunk-8ss7m6mr.js +90 -0
- package/dist/chunk-cwb916ad.js +90 -0
- package/dist/chunk-r21630cj.js +12 -0
- package/dist/chunk-r41jw8s6.js +12 -0
- package/dist/chunk-ww23j09j.js +12 -0
- package/dist/chunk-y7cdqp3j.js +12 -0
- package/package.json +1 -1
|
@@ -1,128 +1,128 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{a as I0,c as a,d as
|
|
4
|
-
`)}}v.defaultYaml={explicit:!1,version:"1.2"};v.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
5
|
-
`)?
|
|
3
|
+
import{a as I0,c as a,d as B4,e as N2,f as W4,g as _4,h as j2,i as F4,j as W,k as q4,l as T4,m as b2,n as L4,o as O4,p as I4,q as G0,r as C2,s as R4,u as K4,v as A4,w as S2}from"./chunk-r41jw8s6.js";import{A as H4,B as x,C as Y4,D as P2,E as Z$,F as k,G as V4,x as l,y as R,z as g}from"./chunk-wdjcav1v.js";var N=R(($5)=>{var Y$=Symbol.for("yaml.alias"),v2=Symbol.for("yaml.document"),Gq=Symbol.for("yaml.map"),m2=Symbol.for("yaml.pair"),V$=Symbol.for("yaml.scalar"),Hq=Symbol.for("yaml.seq"),o=Symbol.for("yaml.node.type"),s4=(q)=>!!q&&typeof q==="object"&&q[o]===Y$,n4=(q)=>!!q&&typeof q==="object"&&q[o]===v2,o4=(q)=>!!q&&typeof q==="object"&&q[o]===Gq,r4=(q)=>!!q&&typeof q==="object"&&q[o]===m2,d2=(q)=>!!q&&typeof q==="object"&&q[o]===V$,t4=(q)=>!!q&&typeof q==="object"&&q[o]===Hq;function p2(q){if(q&&typeof q==="object")switch(q[o]){case Gq:case Hq:return!0}return!1}function e4(q){if(q&&typeof q==="object")switch(q[o]){case Y$:case Gq:case V$:case Hq:return!0}return!1}var q5=(q)=>(d2(q)||p2(q))&&!!q.anchor;$5.ALIAS=Y$;$5.DOC=v2;$5.MAP=Gq;$5.NODE_TYPE=o;$5.PAIR=m2;$5.SCALAR=V$;$5.SEQ=Hq;$5.hasAnchor=q5;$5.isAlias=s4;$5.isCollection=p2;$5.isDocument=n4;$5.isMap=o4;$5.isNode=e4;$5.isPair=r4;$5.isScalar=d2;$5.isSeq=t4});var f0=R((O5)=>{var y=N(),h=Symbol("break visit"),l2=Symbol("skip children"),c=Symbol("remove node");function Yq(q,$){let Z=c2($);if(y.isDocument(q)){if(R0(null,q.contents,Z,Object.freeze([q]))===c)q.contents=null}else R0(null,q,Z,Object.freeze([]))}Yq.BREAK=h;Yq.SKIP=l2;Yq.REMOVE=c;function R0(q,$,Z,X){let z=i2(q,$,Z,X);if(y.isNode(z)||y.isPair(z))return a2(q,X,z),R0(q,z,Z,X);if(typeof z!=="symbol"){if(y.isCollection($)){X=Object.freeze(X.concat($));for(let U=0;U<$.items.length;++U){let Q=R0(U,$.items[U],Z,X);if(typeof Q==="number")U=Q-1;else if(Q===h)return h;else if(Q===c)$.items.splice(U,1),U-=1}}else if(y.isPair($)){X=Object.freeze(X.concat($));let U=R0("key",$.key,Z,X);if(U===h)return h;else if(U===c)$.key=null;let Q=R0("value",$.value,Z,X);if(Q===h)return h;else if(Q===c)$.value=null}}return z}async function Vq(q,$){let Z=c2($);if(y.isDocument(q)){if(await K0(null,q.contents,Z,Object.freeze([q]))===c)q.contents=null}else await K0(null,q,Z,Object.freeze([]))}Vq.BREAK=h;Vq.SKIP=l2;Vq.REMOVE=c;async function K0(q,$,Z,X){let z=await i2(q,$,Z,X);if(y.isNode(z)||y.isPair(z))return a2(q,X,z),K0(q,z,Z,X);if(typeof z!=="symbol"){if(y.isCollection($)){X=Object.freeze(X.concat($));for(let U=0;U<$.items.length;++U){let Q=await K0(U,$.items[U],Z,X);if(typeof Q==="number")U=Q-1;else if(Q===h)return h;else if(Q===c)$.items.splice(U,1),U-=1}}else if(y.isPair($)){X=Object.freeze(X.concat($));let U=await K0("key",$.key,Z,X);if(U===h)return h;else if(U===c)$.key=null;let Q=await K0("value",$.value,Z,X);if(Q===h)return h;else if(Q===c)$.value=null}}return z}function c2(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 i2(q,$,Z,X){if(typeof Z==="function")return Z(q,$,X);if(y.isMap($))return Z.Map?.(q,$,X);if(y.isSeq($))return Z.Seq?.(q,$,X);if(y.isPair($))return Z.Pair?.(q,$,X);if(y.isScalar($))return Z.Scalar?.(q,$,X);if(y.isAlias($))return Z.Alias?.(q,$,X);return}function a2(q,$,Z){let X=$[$.length-1];if(y.isCollection(X))X.items[q]=Z;else if(y.isPair(X))if(q==="key")X.key=Z;else X.value=Z;else if(y.isDocument(X))X.contents=Z;else{let z=y.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${z} parent`)}}O5.visit=Yq;O5.visitAsync=Vq});var B$=R((D5)=>{var s2=N(),K5=f0(),A5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},M5=(q)=>q.replace(/[!,[\]{}]/g,($)=>A5[$]);class v{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},v.defaultYaml,q),this.tags=Object.assign({},v.defaultTags,$)}clone(){let q=new v(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new v(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:v.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},v.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:v.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},v.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),X=Z.shift();switch(X){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[z,U]=Z;return this.tags[z]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[z]=Z;if(z==="1.1"||z==="1.2")return this.yaml.version=z,!0;else{let U=/^\d+\.\d+$/.test(z);return $(6,`Unsupported YAML version ${z}`,U),!1}}default:return $(0,`Unknown directive ${X}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let U=q.slice(2,-1);if(U==="!"||U==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return U}let[,Z,X]=q.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${q} tag has no suffix`);let z=this.tags[Z];if(z)try{return z+decodeURIComponent(X)}catch(U){return $(String(U)),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 $+M5(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),X;if(q&&Z.length>0&&s2.isNode(q.contents)){let z={};K5.visit(q.contents,(U,Q)=>{if(s2.isNode(Q)&&Q.tag)z[Q.tag]=!0}),X=Object.keys(z)}else X=[];for(let[z,U]of Z){if(z==="!!"&&U==="tag:yaml.org,2002:")continue;if(!q||X.some((Q)=>Q.startsWith(U)))$.push(`%TAG ${z} ${U}`)}return $.join(`
|
|
4
|
+
`)}}v.defaultYaml={explicit:!1,version:"1.2"};v.defaultTags={"!!":"tag:yaml.org,2002:"};D5.Directives=v});var Bq=R((b5)=>{var n2=N(),P5=f0();function N5(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 o2(q){let $=new Set;return P5.visit(q,{Value(Z,X){if(X.anchor)$.add(X.anchor)}}),$}function r2(q,$){for(let Z=1;;++Z){let X=`${q}${Z}`;if(!$.has(X))return X}}function j5(q,$){let Z=[],X=new Map,z=null;return{onAnchor:(U)=>{Z.push(U),z??(z=o2(q));let Q=r2($,z);return z.add(Q),Q},setAnchors:()=>{for(let U of Z){let Q=X.get(U);if(typeof Q==="object"&&Q.anchor&&(n2.isScalar(Q.node)||n2.isCollection(Q.node)))Q.node.anchor=Q.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=U,J}}},sourceObjects:X}}b5.anchorIsValid=N5;b5.anchorNames=o2;b5.createNodeAnchors=j5;b5.findNewAnchor=r2});var W$=R((y5)=>{function y0(q,$,Z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let z=0,U=X.length;z<U;++z){let Q=X[z],J=y0(q,X,String(z),Q);if(J===void 0)delete X[z];else if(J!==Q)X[z]=J}else if(X instanceof Map)for(let z of Array.from(X.keys())){let U=X.get(z),Q=y0(q,X,z,U);if(Q===void 0)X.delete(z);else if(Q!==U)X.set(z,Q)}else if(X instanceof Set)for(let z of Array.from(X)){let U=y0(q,X,z,z);if(U===void 0)X.delete(z);else if(U!==z)X.delete(z),X.add(U)}else for(let[z,U]of Object.entries(X)){let Q=y0(q,X,z,U);if(Q===void 0)delete X[z];else if(Q!==U)X[z]=Q}return q.call($,Z,X)}y5.applyReviver=y0});var e=R((k5)=>{var g5=N();function t2(q,$,Z){if(Array.isArray(q))return q.map((X,z)=>t2(X,String(z),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!g5.hasAnchor(q))return q.toJSON($,Z);let X={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,X),Z.onCreate=(U)=>{X.res=U,delete Z.onCreate};let z=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(z);return z}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}k5.toJS=t2});var Wq=R((m5)=>{var u5=W$(),e2=N(),v5=e();class q1{constructor(q){Object.defineProperty(this,e2.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:X,reviver:z}={}){if(!e2.isDocument(q))throw TypeError("A document argument is required");let U={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},Q=v5.toJS(this,"",U);if(typeof X==="function")for(let{count:J,res:G}of U.anchors.values())X(G,J);return typeof z==="function"?u5.applyReviver(z,{"":Q},"",Q):Q}}m5.NodeBase=q1});var x0=R((a5)=>{var p5=Bq(),l5=f0(),A0=N(),c5=Wq(),i5=e();class $1 extends c5.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=[],l5.visit(q,{Node:(z,U)=>{if(A0.isAlias(U)||A0.hasAnchor(U))Z.push(U)}}),$)$.aliasResolveCache=Z;let X=void 0;for(let z of Z){if(z===this)break;if(z.anchor===this.source)X=z}return X}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:X,maxAliasCount:z}=$,U=this.resolve(X,$);if(!U){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let Q=Z.get(U);if(!Q)i5.toJS(U,null,$),Q=Z.get(U);if(Q?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(z>=0){if(Q.count+=1,Q.aliasCount===0)Q.aliasCount=_q(X,U,Z);if(Q.count*Q.aliasCount>z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Q.res}toString(q,$,Z){let X=`*${this.source}`;if(q){if(p5.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(z)}if(q.implicitKey)return`${X} `}return X}}function _q(q,$,Z){if(A0.isAlias($)){let X=$.resolve(q),z=Z&&X&&Z.get(X);return z?z.count*z.aliasCount:0}else if(A0.isCollection($)){let X=0;for(let z of $.items){let U=_q(q,z,Z);if(U>X)X=U}return X}else if(A0.isPair($)){let X=_q(q,$.key,Z),z=_q(q,$.value,Z);return Math.max(X,z)}return 1}a5.Alias=$1});var f=R((e5)=>{var n5=N(),o5=Wq(),r5=e(),t5=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class H0 extends o5.NodeBase{constructor(q){super(n5.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:r5.toJS(this.value,q,$)}toString(){return String(this.value)}}H0.BLOCK_FOLDED="BLOCK_FOLDED";H0.BLOCK_LITERAL="BLOCK_LITERAL";H0.PLAIN="PLAIN";H0.QUOTE_DOUBLE="QUOTE_DOUBLE";H0.QUOTE_SINGLE="QUOTE_SINGLE";e5.Scalar=H0;e5.isScalarValue=t5});var g0=R((Q8)=>{var Z8=x0(),Y0=N(),Z1=f(),X8="tag:yaml.org,2002:";function z8(q,$,Z){if($){let X=Z.filter((U)=>U.tag===$),z=X.find((U)=>!U.format)??X[0];if(!z)throw Error(`Tag ${$} not found`);return z}return Z.find((X)=>X.identify?.(q)&&!X.format)}function U8(q,$,Z){if(Y0.isDocument(q))q=q.contents;if(Y0.isNode(q))return q;if(Y0.isPair(q)){let Y=Z.schema[Y0.MAP].createNode?.(Z.schema,null,Z);return Y.items.push(q),Y}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:X,onAnchor:z,onTagObj:U,schema:Q,sourceObjects:J}=Z,G=void 0;if(X&&q&&typeof q==="object")if(G=J.get(q),G)return G.anchor??(G.anchor=z(q)),new Z8.Alias(G.anchor);else G={anchor:null,node:null},J.set(q,G);if($?.startsWith("!!"))$=X8+$.slice(2);let H=z8(q,$,Q.tags);if(!H){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let Y=new Z1.Scalar(q);if(G)G.node=Y;return Y}H=q instanceof Map?Q[Y0.MAP]:(Symbol.iterator in Object(q))?Q[Y0.SEQ]:Q[Y0.MAP]}if(U)U(H),delete Z.onTagObj;let _=H?.createNode?H.createNode(Z.schema,q,Z):typeof H?.nodeClass?.from==="function"?H.nodeClass.from(Z.schema,q,Z):new Z1.Scalar(q);if($)_.tag=$;else if(!H.default)_.tag=H.tag;if(G)G.node=_;return _}Q8.createNode=U8});var Fq=R((Y8)=>{var G8=g0(),i=N(),H8=Wq();function _$(q,$,Z){let X=Z;for(let z=$.length-1;z>=0;--z){let U=$[z];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let Q=[];Q[U]=X,X=Q}else X=new Map([[U,X]])}return G8.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var X1=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class z1 extends H8.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)=>i.isNode(Z)||i.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(X1(q))this.add($);else{let[Z,...X]=q,z=this.get(Z,!0);if(i.isCollection(z))z.addIn(X,$);else if(z===void 0&&this.schema)this.set(Z,_$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let X=this.get($,!0);if(i.isCollection(X))return X.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...X]=q,z=this.get(Z,!0);if(X.length===0)return!$&&i.isScalar(z)?z.value:z;else return i.isCollection(z)?z.getIn(X,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!i.isPair($))return!1;let Z=$.value;return Z==null||q&&i.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn(q){let[$,...Z]=q;if(Z.length===0)return this.has($);let X=this.get($,!0);return i.isCollection(X)?X.hasIn(Z):!1}setIn(q,$){let[Z,...X]=q;if(X.length===0)this.set(Z,$);else{let z=this.get(Z,!0);if(i.isCollection(z))z.setIn(X,$);else if(z===void 0&&this.schema)this.set(Z,_$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}}Y8.Collection=z1;Y8.collectionFromPath=_$;Y8.isEmptyPath=X1});var k0=R((T8)=>{var _8=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function F$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var F8=(q,$,Z)=>q.endsWith(`
|
|
5
|
+
`)?F$(Z,$):Z.includes(`
|
|
6
6
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`){if(Z==="block")
|
|
9
|
-
`&&
|
|
10
|
-
`&&M!=="\t")V=
|
|
11
|
-
${$}${q.slice(0,w)}`;else{if(Z==="quoted"&&
|
|
12
|
-
${$}${q.slice(M+1,w)}`}}return
|
|
13
|
-
`);X=$,z=$+1,U=q[z]}return X}
|
|
14
|
-
`){if(U-Q>X)return!0;if(Q=U+1,z-Q<=X)return!1}return!0}function h0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:X}=$,z=$.options.doubleQuotedMinMultiLineLength,U=$.indent||(Oq(q)?" ":""),Q="",J=0;for(let G=0,H=Z[G];H;H=Z[++G]){if(H===" "&&Z[G+1]==="\\"&&Z[G+2]==="n")Q+=Z.slice(J,G)+"\\ ",G+=1,J=G,H="\\";if(H==="\\")switch(Z[G+1]){case"u":{Q+=Z.slice(J,G);let
|
|
7
|
+
`+F$(Z,$):(q.endsWith(" ")?"":" ")+Z;T8.indentComment=F$;T8.lineComment=F8;T8.stringifyComment=_8});var Q1=R((K8)=>{function R8(q,$,Z="flow",{indentAtStart:X,lineWidth:z=80,minContentWidth:U=20,onFold:Q,onOverflow:J}={}){if(!z||z<0)return q;if(z<U)U=0;let G=Math.max(1+U,1+z-$.length);if(q.length<=G)return q;let H=[],_={},Y=z-$.length;if(typeof X==="number")if(X>z-Math.max(2,U))H.push(0);else Y=z-X;let V=void 0,F=void 0,O=!1,B=-1,T=-1,L=-1;if(Z==="block"){if(B=U1(q,B,$.length),B!==-1)Y=B+G}for(let K;K=q[B+=1];){if(Z==="quoted"&&K==="\\"){switch(T=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}L=B}if(K===`
|
|
8
|
+
`){if(Z==="block")B=U1(q,B,$.length);Y=B+$.length+G,V=void 0}else{if(K===" "&&F&&F!==" "&&F!==`
|
|
9
|
+
`&&F!=="\t"){let M=q[B+1];if(M&&M!==" "&&M!==`
|
|
10
|
+
`&&M!=="\t")V=B}if(B>=Y)if(V)H.push(V),Y=V+G,V=void 0;else if(Z==="quoted"){while(F===" "||F==="\t")F=K,K=q[B+=1],O=!0;let M=B>L+1?B-2:T-1;if(_[M])return q;H.push(M),_[M]=!0,Y=M+G,V=void 0}else O=!0}F=K}if(O&&J)J();if(H.length===0)return q;if(Q)Q();let I=q.slice(0,H[0]);for(let K=0;K<H.length;++K){let M=H[K],w=H[K+1]||q.length;if(M===0)I=`
|
|
11
|
+
${$}${q.slice(0,w)}`;else{if(Z==="quoted"&&_[M])I+=`${q[M]}\\`;I+=`
|
|
12
|
+
${$}${q.slice(M+1,w)}`}}return I}function U1(q,$,Z){let X=$,z=$+1,U=q[z];while(U===" "||U==="\t")if($<z+Z)U=q[++$];else{do U=q[++$];while(U&&U!==`
|
|
13
|
+
`);X=$,z=$+1,U=q[z]}return X}K8.FOLD_BLOCK="block";K8.FOLD_FLOW="flow";K8.FOLD_QUOTED="quoted";K8.foldFlowLines=R8});var u0=R((b8)=>{var d=f(),q0=Q1(),Lq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Oq=(q)=>/^(%|---|\.\.\.)/m.test(q);function P8(q,$,Z){if(!$||$<0)return!1;let X=$-Z,z=q.length;if(z<=X)return!1;for(let U=0,Q=0;U<z;++U)if(q[U]===`
|
|
14
|
+
`){if(U-Q>X)return!0;if(Q=U+1,z-Q<=X)return!1}return!0}function h0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:X}=$,z=$.options.doubleQuotedMinMultiLineLength,U=$.indent||(Oq(q)?" ":""),Q="",J=0;for(let G=0,H=Z[G];H;H=Z[++G]){if(H===" "&&Z[G+1]==="\\"&&Z[G+2]==="n")Q+=Z.slice(J,G)+"\\ ",G+=1,J=G,H="\\";if(H==="\\")switch(Z[G+1]){case"u":{Q+=Z.slice(J,G);let _=Z.substr(G+2,4);switch(_){case"0000":Q+="\\0";break;case"0007":Q+="\\a";break;case"000b":Q+="\\v";break;case"001b":Q+="\\e";break;case"0085":Q+="\\N";break;case"00a0":Q+="\\_";break;case"2028":Q+="\\L";break;case"2029":Q+="\\P";break;default:if(_.substr(0,2)==="00")Q+="\\x"+_.substr(2);else Q+=Z.substr(G,6)}G+=5,J=G+1}break;case"n":if(X||Z[G+2]==='"'||Z.length<z)G+=1;else{Q+=Z.slice(J,G)+`
|
|
15
15
|
|
|
16
16
|
`;while(Z[G+2]==="\\"&&Z[G+3]==="n"&&Z[G+4]!=='"')Q+=`
|
|
17
|
-
`,G+=2;if(Q+=U,Z[G+2]===" ")Q+="\\";G+=1,J=G+1}break;default:G+=1}}return Q=J?Q+Z.slice(J):Z,X?Q:q0.foldFlowLines(Q,U,q0.FOLD_QUOTED,Lq($,!1))}function
|
|
17
|
+
`,G+=2;if(Q+=U,Z[G+2]===" ")Q+="\\";G+=1,J=G+1}break;default:G+=1}}return Q=J?Q+Z.slice(J):Z,X?Q:q0.foldFlowLines(Q,U,q0.FOLD_QUOTED,Lq($,!1))}function T$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
18
18
|
`)||/[ \t]\n|\n[ \t]/.test(q))return h0(q,$);let Z=$.indent||(Oq(q)?" ":""),X="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
-
${Z}`)+"'";return $.implicitKey?X:q0.foldFlowLines(X,Z,q0.FOLD_FLOW,Lq($,!1))}function M0(q,$){let{singleQuote:Z}=$.options,X;if(Z===!1)X=h0;else{let z=q.includes('"'),U=q.includes("'");if(z&&!U)X=
|
|
19
|
+
${Z}`)+"'";return $.implicitKey?X:q0.foldFlowLines(X,Z,q0.FOLD_FLOW,Lq($,!1))}function M0(q,$){let{singleQuote:Z}=$.options,X;if(Z===!1)X=h0;else{let z=q.includes('"'),U=q.includes("'");if(z&&!U)X=T$;else if(U&&!z)X=h0;else X=Z?T$:h0}return X(q,$)}var L$;try{L$=new RegExp(`(^|(?<!
|
|
20
20
|
))
|
|
21
21
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
22
|
+
|$)`,"g")}catch{L$=/\n+(?!\n|$)/g}function Tq({comment:q,type:$,value:Z},X,z,U){let{blockQuote:Q,commentString:J,lineWidth:G}=X.options;if(!Q||/\n[\t ]+$/.test(Z))return M0(Z,X);let H=X.indent||(X.forceBlockIndent||Oq(Z)?" ":""),_=Q==="literal"?!0:Q==="folded"||$===d.Scalar.BLOCK_FOLDED?!1:$===d.Scalar.BLOCK_LITERAL?!0:!P8(Z,G,H.length);if(!Z)return _?`|
|
|
23
23
|
`:`>
|
|
24
24
|
`;let Y,V;for(V=Z.length;V>0;--V){let w=Z[V-1];if(w!==`
|
|
25
|
-
`&&w!=="\t"&&w!==" ")break}let
|
|
26
|
-
`);if(
|
|
27
|
-
`)
|
|
28
|
-
`)
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${H}`),P=!1,j=Lq(X,!0);if(Q!=="folded"&&$!==d.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{P=!0};let
|
|
30
|
-
${H}${
|
|
31
|
-
${H}${
|
|
32
|
-
`)||
|
|
33
|
-
`)?M0(U,$):Tq(q,$,Z,X);if(!J&&!
|
|
25
|
+
`&&w!=="\t"&&w!==" ")break}let F=Z.substring(V),O=F.indexOf(`
|
|
26
|
+
`);if(O===-1)Y="-";else if(Z===F||O!==F.length-1){if(Y="+",U)U()}else Y="";if(F){if(Z=Z.slice(0,-F.length),F[F.length-1]===`
|
|
27
|
+
`)F=F.slice(0,-1);F=F.replace(L$,`$&${H}`)}let B=!1,T,L=-1;for(T=0;T<Z.length;++T){let w=Z[T];if(w===" ")B=!0;else if(w===`
|
|
28
|
+
`)L=T;else break}let I=Z.substring(0,L<T?L+1:T);if(I)Z=Z.substring(I.length),I=I.replace(/\n+/g,`$&${H}`);let M=(B?H?"2":"1":"")+Y;if(q){if(M+=" "+J(q.replace(/ ?[\r\n]+/g," ")),z)z()}if(!_){let w=Z.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${H}`),P=!1,j=Lq(X,!0);if(Q!=="folded"&&$!==d.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{P=!0};let A=q0.foldFlowLines(`${I}${w}${F}`,H,q0.FOLD_BLOCK,j);if(!P)return`>${M}
|
|
30
|
+
${H}${A}`}return Z=Z.replace(/\n+/g,`$&${H}`),`|${M}
|
|
31
|
+
${H}${I}${Z}${F}`}function N8(q,$,Z,X){let{type:z,value:U}=q,{actualString:Q,implicitKey:J,indent:G,indentStep:H,inFlow:_}=$;if(J&&U.includes(`
|
|
32
|
+
`)||_&&/[[\]{},]/.test(U))return M0(U,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return J||_||!U.includes(`
|
|
33
|
+
`)?M0(U,$):Tq(q,$,Z,X);if(!J&&!_&&z!==d.Scalar.PLAIN&&U.includes(`
|
|
34
34
|
`))return Tq(q,$,Z,X);if(Oq(U)){if(G==="")return $.forceBlockIndent=!0,Tq(q,$,Z,X);else if(J&&G===H)return M0(U,$)}let Y=U.replace(/\n+/g,`$&
|
|
35
|
-
${G}`);if(Q){let V=(
|
|
36
|
-
${$.indent}${J}`}
|
|
37
|
-
${J}:`}else if(
|
|
38
|
-
`:"",
|
|
35
|
+
${G}`);if(Q){let V=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(Y),{compat:F,tags:O}=$.doc.schema;if(O.some(V)||F?.some(V))return M0(U,$)}return J?Y:q0.foldFlowLines(Y,G,q0.FOLD_FLOW,Lq($,!1))}function j8(q,$,Z,X){let{implicitKey:z,inFlow:U}=$,Q=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:J}=q;if(J!==d.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))J=d.Scalar.QUOTE_DOUBLE}let G=(_)=>{switch(_){case d.Scalar.BLOCK_FOLDED:case d.Scalar.BLOCK_LITERAL:return z||U?M0(Q.value,$):Tq(Q,$,Z,X);case d.Scalar.QUOTE_DOUBLE:return h0(Q.value,$);case d.Scalar.QUOTE_SINGLE:return T$(Q.value,$);case d.Scalar.PLAIN:return N8(Q,$,Z,X);default:return null}},H=G(J);if(H===null){let{defaultKeyType:_,defaultStringType:Y}=$.options,V=z&&_||Y;if(H=G(V),H===null)throw Error(`Unsupported default string type ${V}`)}return H}b8.stringifyString=j8});var v0=R((h8)=>{var S8=Bq(),$0=N(),E8=k0(),f8=u0();function y8(q,$){let Z=Object.assign({blockQuote:!0,commentString:E8.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,$),X;switch(Z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:q,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:X,options:Z}}function x8(q,$){if($.tag){let z=q.filter((U)=>U.tag===$.tag);if(z.length>0)return z.find((U)=>U.format===$.format)??z[0]}let Z=void 0,X;if($0.isScalar($)){X=$.value;let z=q.filter((U)=>U.identify?.(X));if(z.length>1){let U=z.filter((Q)=>Q.test);if(U.length>0)z=U}Z=z.find((U)=>U.format===$.format)??z.find((U)=>!U.format)}else X=$,Z=q.find((z)=>z.nodeClass&&X instanceof z.nodeClass);if(!Z){let z=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${z} value`)}return Z}function g8(q,$,{anchors:Z,doc:X}){if(!X.directives)return"";let z=[],U=($0.isScalar(q)||$0.isCollection(q))&&q.anchor;if(U&&S8.anchorIsValid(U))Z.add(U),z.push(`&${U}`);let Q=q.tag??($.default?null:$.tag);if(Q)z.push(X.directives.tagString(Q));return z.join(" ")}function k8(q,$,Z,X){if($0.isPair(q))return q.toString($,Z,X);if($0.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 z=void 0,U=$0.isNode(q)?q:$.doc.createNode(q,{onTagObj:(G)=>z=G});z??(z=x8($.doc.schema.tags,U));let Q=g8(U,z,$);if(Q.length>0)$.indentAtStart=($.indentAtStart??0)+Q.length+1;let J=typeof z.stringify==="function"?z.stringify(U,$,Z,X):$0.isScalar(U)?f8.stringifyString(U,$,Z,X):U.toString($,Z,X);if(!Q)return J;return $0.isScalar(U)||J[0]==="{"||J[0]==="["?`${Q} ${J}`:`${Q}
|
|
36
|
+
${$.indent}${J}`}h8.createStringifyContext=y8;h8.stringify=k8});var H1=R((d8)=>{var r=N(),J1=f(),G1=v0(),m0=k0();function m8({key:q,value:$},Z,X,z){let{allNullValues:U,doc:Q,indent:J,indentStep:G,options:{commentString:H,indentSeq:_,simpleKeys:Y}}=Z,V=r.isNode(q)&&q.comment||null;if(Y){if(V)throw Error("With simple keys, key nodes cannot have comments");if(r.isCollection(q)||!r.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let F=!Y&&(!q||V&&$==null&&!Z.inFlow||r.isCollection(q)||(r.isScalar(q)?q.type===J1.Scalar.BLOCK_FOLDED||q.type===J1.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!F&&(Y||!U),indent:J+G});let O=!1,B=!1,T=G1.stringify(q,Z,()=>O=!0,()=>B=!0);if(!F&&!Z.inFlow&&T.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");F=!0}if(Z.inFlow){if(U||$==null){if(O&&X)X();return T===""?"?":F?`? ${T}`:T}}else if(U&&!Y||$==null&&F){if(T=`? ${T}`,V&&!O)T+=m0.lineComment(T,Z.indent,H(V));else if(B&&z)z();return T}if(O)V=null;if(F){if(V)T+=m0.lineComment(T,Z.indent,H(V));T=`? ${T}
|
|
37
|
+
${J}:`}else if(T=`${T}:`,V)T+=m0.lineComment(T,Z.indent,H(V));let L,I,K;if(r.isNode($))L=!!$.spaceBefore,I=$.commentBefore,K=$.comment;else if(L=!1,I=null,K=null,$&&typeof $==="object")$=Q.createNode($);if(Z.implicitKey=!1,!F&&!V&&r.isScalar($))Z.indentAtStart=T.length+1;if(B=!1,!_&&G.length>=2&&!Z.inFlow&&!F&&r.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let M=!1,w=G1.stringify($,Z,()=>M=!0,()=>B=!0),P=" ";if(V||L||I){if(P=L?`
|
|
38
|
+
`:"",I){let j=H(I);P+=`
|
|
39
39
|
${m0.indentComment(j,Z.indent)}`}if(w===""&&!Z.inFlow){if(P===`
|
|
40
|
-
`&&
|
|
40
|
+
`&&K)P=`
|
|
41
41
|
|
|
42
42
|
`}else P+=`
|
|
43
|
-
${Z.indent}`}else if(!
|
|
44
|
-
`),E=
|
|
43
|
+
${Z.indent}`}else if(!F&&r.isCollection($)){let j=w[0],A=w.indexOf(`
|
|
44
|
+
`),E=A!==-1,b=Z.inFlow??$.flow??$.items.length===0;if(E||!b){let u=!1;if(E&&(j==="&"||j==="!")){let C=w.indexOf(" ");if(j==="&"&&C!==-1&&C<A&&w[C+1]==="!")C=w.indexOf(" ",C+1);if(C===-1||A<C)u=!0}if(!u)P=`
|
|
45
45
|
${Z.indent}`}}else if(w===""||w[0]===`
|
|
46
|
-
`)P="";if(
|
|
47
|
-
${G}${
|
|
48
|
-
`}}if(q){if(
|
|
49
|
-
`+Dq.indentComment(H(q),G),J)J()}else if(Y&&Q)Q();return
|
|
50
|
-
`)))H=!0;Y.push(
|
|
51
|
-
${U}${z}${
|
|
52
|
-
`;return`${
|
|
53
|
-
${z}${
|
|
54
|
-
`:" ")}return
|
|
46
|
+
`)P="";if(T+=P+w,Z.inFlow){if(M&&X)X()}else if(K&&!M)T+=m0.lineComment(T,Z.indent,H(K));else if(B&&z)z();return T}d8.stringifyPair=m8});var O$=R((i8)=>{var Y1=g("process");function l8(q,...$){if(q==="debug")console.log(...$)}function c8(q,$){if(q==="debug"||q==="warn")if(typeof Y1.emitWarning==="function")Y1.emitWarning($);else console.warn($)}i8.debug=l8;i8.warn=c8});var Kq=R((o8)=>{var d0=N(),V1=f(),Iq="<<",Rq={identify:(q)=>q===Iq||typeof q==="symbol"&&q.description===Iq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new V1.Scalar(Symbol(Iq)),{addToJSMap:B1}),stringify:()=>Iq},n8=(q,$)=>(Rq.identify($)||d0.isScalar($)&&(!$.type||$.type===V1.Scalar.PLAIN)&&Rq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===Rq.tag&&Z.default);function B1(q,$,Z){if(Z=q&&d0.isAlias(Z)?Z.resolve(q.doc):Z,d0.isSeq(Z))for(let X of Z.items)I$(q,$,X);else if(Array.isArray(Z))for(let X of Z)I$(q,$,X);else I$(q,$,Z)}function I$(q,$,Z){let X=q&&d0.isAlias(Z)?Z.resolve(q.doc):Z;if(!d0.isMap(X))throw Error("Merge sources must be maps or map aliases");let z=X.toJSON(null,q,Map);for(let[U,Q]of z)if($ instanceof Map){if(!$.has(U))$.set(U,Q)}else if($ instanceof Set)$.add(U);else if(!Object.prototype.hasOwnProperty.call($,U))Object.defineProperty($,U,{value:Q,writable:!0,enumerable:!0,configurable:!0});return $}o8.addMergeToJSMap=B1;o8.isMergeKey=n8;o8.merge=Rq});var K$=R((zZ)=>{var qZ=O$(),W1=Kq(),$Z=v0(),_1=N(),R$=e();function ZZ(q,$,{key:Z,value:X}){if(_1.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,X);else if(W1.isMergeKey(q,Z))W1.addMergeToJSMap(q,$,X);else{let z=R$.toJS(Z,"",q);if($ instanceof Map)$.set(z,R$.toJS(X,z,q));else if($ instanceof Set)$.add(z);else{let U=XZ(Z,z,q),Q=R$.toJS(X,U,q);if(U in $)Object.defineProperty($,U,{value:Q,writable:!0,enumerable:!0,configurable:!0});else $[U]=Q}}return $}function XZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(_1.isNode(q)&&Z?.doc){let X=$Z.createStringifyContext(Z.doc,{});X.anchors=new Set;for(let U of Z.anchors.keys())X.anchors.add(U.anchor);X.inFlow=!0,X.inStringifyKey=!0;let z=q.toString(X);if(!Z.mapKeyWarned){let U=JSON.stringify(z);if(U.length>40)U=U.substring(0,36)+'..."';qZ.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return z}return JSON.stringify($)}zZ.addPairToJSMap=ZZ});var Z0=R((HZ)=>{var F1=g0(),QZ=H1(),JZ=K$(),Aq=N();function GZ(q,$,Z){let X=F1.createNode(q,void 0,Z),z=F1.createNode($,void 0,Z);return new Mq(X,z)}class Mq{constructor(q,$=null){Object.defineProperty(this,Aq.NODE_TYPE,{value:Aq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:Z}=this;if(Aq.isNode($))$=$.clone(q);if(Aq.isNode(Z))Z=Z.clone(q);return new Mq($,Z)}toJSON(q,$){let Z=$?.mapAsMap?new Map:{};return JZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?QZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}HZ.Pair=Mq;HZ.createPair=GZ});var A$=R((FZ)=>{var V0=N(),T1=v0(),Dq=k0();function BZ(q,$,Z){return($.inFlow??q.flow?_Z:WZ)(q,$,Z)}function WZ({comment:q,items:$},Z,{blockItemPrefix:X,flowChars:z,itemIndent:U,onChompKeep:Q,onComment:J}){let{indent:G,options:{commentString:H}}=Z,_=Object.assign({},Z,{indent:U,type:null}),Y=!1,V=[];for(let O=0;O<$.length;++O){let B=$[O],T=null;if(V0.isNode(B)){if(!Y&&B.spaceBefore)V.push("");if(wq(Z,V,B.commentBefore,Y),B.comment)T=B.comment}else if(V0.isPair(B)){let I=V0.isNode(B.key)?B.key:null;if(I){if(!Y&&I.spaceBefore)V.push("");wq(Z,V,I.commentBefore,Y)}}Y=!1;let L=T1.stringify(B,_,()=>T=null,()=>Y=!0);if(T)L+=Dq.lineComment(L,U,H(T));if(Y&&T)Y=!1;V.push(X+L)}let F;if(V.length===0)F=z.start+z.end;else{F=V[0];for(let O=1;O<V.length;++O){let B=V[O];F+=B?`
|
|
47
|
+
${G}${B}`:`
|
|
48
|
+
`}}if(q){if(F+=`
|
|
49
|
+
`+Dq.indentComment(H(q),G),J)J()}else if(Y&&Q)Q();return F}function _Z({items:q},$,{flowChars:Z,itemIndent:X}){let{indent:z,indentStep:U,flowCollectionPadding:Q,options:{commentString:J}}=$;X+=U;let G=Object.assign({},$,{indent:X,inFlow:!0,type:null}),H=!1,_=0,Y=[];for(let O=0;O<q.length;++O){let B=q[O],T=null;if(V0.isNode(B)){if(B.spaceBefore)Y.push("");if(wq($,Y,B.commentBefore,!1),B.comment)T=B.comment}else if(V0.isPair(B)){let I=V0.isNode(B.key)?B.key:null;if(I){if(I.spaceBefore)Y.push("");if(wq($,Y,I.commentBefore,!1),I.comment)H=!0}let K=V0.isNode(B.value)?B.value:null;if(K){if(K.comment)T=K.comment;if(K.commentBefore)H=!0}else if(B.value==null&&I?.comment)T=I.comment}if(T)H=!0;let L=T1.stringify(B,G,()=>T=null);if(O<q.length-1)L+=",";if(T)L+=Dq.lineComment(L,X,J(T));if(!H&&(Y.length>_||L.includes(`
|
|
50
|
+
`)))H=!0;Y.push(L),_=Y.length}let{start:V,end:F}=Z;if(Y.length===0)return V+F;else{if(!H){let O=Y.reduce((B,T)=>B+T.length+2,2);H=$.options.lineWidth>0&&O>$.options.lineWidth}if(H){let O=V;for(let B of Y)O+=B?`
|
|
51
|
+
${U}${z}${B}`:`
|
|
52
|
+
`;return`${O}
|
|
53
|
+
${z}${F}`}else return`${V}${Q}${Y.join(" ")}${Q}${F}`}}function wq({indent:q,options:{commentString:$}},Z,X,z){if(X&&z)X=X.replace(/^\n+/,"");if(X){let U=Dq.indentComment($(X),q);Z.push(U.trimStart())}}FZ.stringifyCollection=BZ});var z0=R((KZ)=>{var LZ=A$(),OZ=K$(),IZ=Fq(),X0=N(),Pq=Z0(),RZ=f();function p0(q,$){let Z=X0.isScalar($)?$.value:$;for(let X of q)if(X0.isPair(X)){if(X.key===$||X.key===Z)return X;if(X0.isScalar(X.key)&&X.key.value===Z)return X}return}class L1 extends IZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(X0.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:X,replacer:z}=Z,U=new this(q),Q=(J,G)=>{if(typeof z==="function")G=z.call($,J,G);else if(Array.isArray(z)&&!z.includes(J))return;if(G!==void 0||X)U.items.push(Pq.createPair(J,G,Z))};if($ instanceof Map)for(let[J,G]of $)Q(J,G);else if($&&typeof $==="object")for(let J of Object.keys($))Q(J,$[J]);if(typeof q.sortMapEntries==="function")U.items.sort(q.sortMapEntries);return U}add(q,$){let Z;if(X0.isPair(q))Z=q;else if(!q||typeof q!=="object"||!("key"in q))Z=new Pq.Pair(q,q?.value);else Z=new Pq.Pair(q.key,q.value);let X=p0(this.items,Z.key),z=this.schema?.sortMapEntries;if(X){if(!$)throw Error(`Key ${Z.key} already set`);if(X0.isScalar(X.value)&&RZ.isScalarValue(Z.value))X.value.value=Z.value;else X.value=Z.value}else if(z){let U=this.items.findIndex((Q)=>z(Z,Q)<0);if(U===-1)this.items.push(Z);else this.items.splice(U,0,Z)}else this.items.push(Z)}delete(q){let $=p0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let X=p0(this.items,q)?.value;return(!$&&X0.isScalar(X)?X.value:X)??void 0}has(q){return!!p0(this.items,q)}set(q,$){this.add(new Pq.Pair(q,$),!0)}toJSON(q,$,Z){let X=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(X);for(let z of this.items)OZ.addPairToJSMap($,X,z);return X}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let X of this.items)if(!X0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return LZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}KZ.YAMLMap=L1;KZ.findPair=p0});var D0=R((PZ)=>{var DZ=N(),O1=z0(),wZ={collection:"map",default:!0,nodeClass:O1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!DZ.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>O1.YAMLMap.from(q,$,Z)};PZ.map=wZ});var U0=R((fZ)=>{var jZ=g0(),bZ=A$(),CZ=Fq(),jq=N(),SZ=f(),EZ=e();class I1 extends CZ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(jq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=Nq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=Nq(q);if(typeof Z!=="number")return;let X=this.items[Z];return!$&&jq.isScalar(X)?X.value:X}has(q){let $=Nq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let Z=Nq(q);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${q}.`);let X=this.items[Z];if(jq.isScalar(X)&&SZ.isScalarValue($))X.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let X=0;for(let z of this.items)Z.push(EZ.toJS(z,String(X++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return bZ.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:X}=Z,z=new this(q);if($&&Symbol.iterator in Object($)){let U=0;for(let Q of $){if(typeof X==="function"){let J=$ instanceof Set?Q:String(U++);Q=X.call($,J,Q)}z.items.push(jZ.createNode(Q,void 0,Z))}}return z}}function Nq(q){let $=jq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}fZ.YAMLSeq=I1});var w0=R((kZ)=>{var xZ=N(),R1=U0(),gZ={collection:"seq",default:!0,nodeClass:R1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!xZ.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>R1.YAMLSeq.from(q,$,Z)};kZ.seq=gZ});var l0=R((mZ)=>{var uZ=u0(),vZ={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,Z,X){return $=Object.assign({actualString:!0},$),uZ.stringifyString(q,$,Z,X)}};mZ.string=vZ});var bq=R((pZ)=>{var K1=f(),A1={identify:(q)=>q==null,createNode:()=>new K1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new K1.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&A1.test.test(q)?q:$.options.nullStr};pZ.nullTag=A1});var M$=R((iZ)=>{var cZ=f(),M1={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new cZ.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&M1.test.test(q)){let X=q[0]==="t"||q[0]==="T";if($===X)return q}return $?Z.options.trueStr:Z.options.falseStr}};iZ.boolTag=M1});var P0=R((nZ)=>{function sZ({format:q,minFractionDigits:$,tag:Z,value:X}){if(typeof X==="bigint")return String(X);let z=typeof X==="number"?X:Number(X);if(!isFinite(z))return isNaN(z)?".nan":z<0?"-.inf":".inf";let U=Object.is(X,-0)?"-0":JSON.stringify(X);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(U)){let Q=U.indexOf(".");if(Q<0)Q=U.length,U+=".";let J=$-(U.length-Q-1);while(J-- >0)U+="0"}return U}nZ.stringifyNumber=sZ});var w$=R(($6)=>{var rZ=f(),D$=P0(),tZ={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:D$.stringifyNumber},eZ={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():D$.stringifyNumber(q)}},q6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new rZ.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:D$.stringifyNumber};$6.float=q6;$6.floatExp=eZ;$6.floatNaN=tZ});var N$=R((G6)=>{var D1=P0(),Cq=(q)=>typeof q==="bigint"||Number.isInteger(q),P$=(q,$,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q.substring($),Z);function w1(q,$,Z){let{value:X}=q;if(Cq(X)&&X>=0)return Z+X.toString($);return D1.stringifyNumber(q)}var U6={identify:(q)=>Cq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>P$(q,2,8,Z),stringify:(q)=>w1(q,8,"0o")},Q6={identify:Cq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>P$(q,0,10,Z),stringify:D1.stringifyNumber},J6={identify:(q)=>Cq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>P$(q,2,16,Z),stringify:(q)=>w1(q,16,"0x")};G6.int=Q6;G6.intHex=J6;G6.intOct=U6});var P1=R((O6)=>{var B6=D0(),W6=bq(),_6=w0(),F6=l0(),T6=M$(),j$=w$(),b$=N$(),L6=[B6.map,_6.seq,F6.string,W6.nullTag,T6.boolTag,b$.intOct,b$.int,b$.intHex,j$.floatNaN,j$.floatExp,j$.float];O6.schema=L6});var j1=R((P6)=>{var R6=f(),K6=D0(),A6=w0();function N1(q){return typeof q==="bigint"||Number.isInteger(q)}var Sq=({value:q})=>JSON.stringify(q),M6=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:Sq},{identify:(q)=>q==null,createNode:()=>new R6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:Sq},{identify:N1,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})=>N1(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:Sq}],D6={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},w6=[K6.map,A6.seq].concat(M6,D6);P6.schema=w6});var S$=R((C6)=>{var c0=g("buffer"),C$=f(),j6=u0(),b6={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof c0.Buffer==="function")return c0.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),X=new Uint8Array(Z.length);for(let z=0;z<Z.length;++z)X[z]=Z.charCodeAt(z);return X}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},X,z,U){if(!Z)return"";let Q=Z,J;if(typeof c0.Buffer==="function")J=Q instanceof c0.Buffer?Q.toString("base64"):c0.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let H=0;H<Q.length;++H)G+=String.fromCharCode(Q[H]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=C$.Scalar.BLOCK_LITERAL),$!==C$.Scalar.QUOTE_DOUBLE){let G=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),H=Math.ceil(J.length/G),_=Array(H);for(let Y=0,V=0;Y<H;++Y,V+=G)_[Y]=J.substr(V,G);J=_.join($===C$.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return j6.stringifyString({comment:q,type:$,value:J},X,z,U)}};C6.binary=b6});var fq=R((x6)=>{var Eq=N(),E$=Z0(),E6=f(),f6=U0();function b1(q,$){if(Eq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let X=q.items[Z];if(Eq.isPair(X))continue;else if(Eq.isMap(X)){if(X.items.length>1)$("Each pair must have its own sequence indicator");let z=X.items[0]||new E$.Pair(new E6.Scalar(null));if(X.commentBefore)z.key.commentBefore=z.key.commentBefore?`${X.commentBefore}
|
|
55
55
|
${z.key.commentBefore}`:X.commentBefore;if(X.comment){let U=z.value??z.key;U.comment=U.comment?`${X.comment}
|
|
56
|
-
${U.comment}`:X.comment}X=z}q.items[Z]=Eq.isPair(X)?X:new C$.Pair(X)}else $("Expected a sequence for this tag");return q}function b1(q,$,Z){let{replacer:X}=Z,z=new E6.YAMLSeq(q);z.tag="tag:yaml.org,2002:pairs";let U=0;if($&&Symbol.iterator in Object($))for(let Q of $){if(typeof X==="function")Q=X.call($,String(U++),Q);let J,G;if(Array.isArray(Q))if(Q.length===2)J=Q[0],G=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let H=Object.keys(Q);if(H.length===1)J=H[0],G=Q[J];else throw TypeError(`Expected tuple with one key, not ${H.length} keys`)}else J=Q;z.items.push(C$.createPair(J,G,Z))}return z}var f6={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:j1,createNode:b1};y6.createPairs=b1;y6.pairs=f6;y6.resolvePairs=j1});var E$=I((v6)=>{var C1=N(),S$=e(),i0=z0(),h6=U0(),S1=fq();class B0 extends h6.YAMLSeq{constructor(){super();this.add=i0.YAMLMap.prototype.add.bind(this),this.delete=i0.YAMLMap.prototype.delete.bind(this),this.get=i0.YAMLMap.prototype.get.bind(this),this.has=i0.YAMLMap.prototype.has.bind(this),this.set=i0.YAMLMap.prototype.set.bind(this),this.tag=B0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let X of this.items){let z,U;if(C1.isPair(X))z=S$.toJS(X.key,"",$),U=S$.toJS(X.value,z,$);else z=S$.toJS(X,"",$);if(Z.has(z))throw Error("Ordered maps must not include duplicate keys");Z.set(z,U)}return Z}static from(q,$,Z){let X=S1.createPairs(q,$,Z),z=new this;return z.items=X.items,z}}B0.tag="tag:yaml.org,2002:omap";var u6={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=S1.resolvePairs(q,$),X=[];for(let{key:z}of Z.items)if(C1.isScalar(z))if(X.includes(z.value))$(`Ordered maps must not include duplicate keys: ${z.value}`);else X.push(z.value);return Object.assign(new B0,Z)},createNode:(q,$,Z)=>B0.from(q,$,Z)};v6.YAMLOMap=B0;v6.omap=u6});var g1=I((p6)=>{var E1=f();function f1({value:q,source:$},Z){if($&&(q?y1:x1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var y1={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 E1.Scalar(!0),stringify:f1},x1={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 E1.Scalar(!1),stringify:f1};p6.falseTag=x1;p6.trueTag=y1});var k1=I((o6)=>{var i6=f(),f$=P0(),a6={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:f$.stringifyNumber},s6={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():f$.stringifyNumber(q)}},n6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new i6.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:f$.stringifyNumber};o6.float=n6;o6.floatExp=s6;o6.floatNaN=a6});var u1=I((z3)=>{var h1=P0(),a0=(q)=>typeof q==="bigint"||Number.isInteger(q);function yq(q,$,Z,{intAsBigInt:X}){let z=q[0];if(z==="-"||z==="+")$+=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 Q=BigInt(q);return z==="-"?BigInt(-1)*Q:Q}let U=parseInt(q,Z);return z==="-"?-1*U:U}function y$(q,$,Z){let{value:X}=q;if(a0(X)){let z=X.toString($);return X<0?"-"+Z+z.substr(1):Z+z}return h1.stringifyNumber(q)}var q3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>yq(q,2,2,Z),stringify:(q)=>y$(q,2,"0b")},$3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>yq(q,1,8,Z),stringify:(q)=>y$(q,8,"0")},Z3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>yq(q,0,10,Z),stringify:h1.stringifyNumber},X3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>yq(q,2,16,Z),stringify:(q)=>y$(q,16,"0x")};z3.int=Z3;z3.intBin=q3;z3.intHex=X3;z3.intOct=$3});var x$=I((Y3)=>{var kq=N(),xq=Z0(),gq=z0();class W0 extends gq.YAMLMap{constructor(q){super(q);this.tag=W0.tag}add(q){let $;if(kq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new xq.Pair(q.key,null);else $=new xq.Pair(q,null);if(!gq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=gq.findPair(this.items,q);return!$&&kq.isPair(Z)?kq.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=gq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new xq.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,z=new this(q);if($&&Symbol.iterator in Object($))for(let U of $){if(typeof X==="function")U=X.call($,U,U);z.items.push(xq.createPair(U,null,Z))}return z}}W0.tag="tag:yaml.org,2002:set";var H3={collection:"map",identify:(q)=>q instanceof Set,nodeClass:W0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>W0.from(q,$,Z),resolve(q,$){if(kq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new W0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};Y3.YAMLSet=W0;Y3.set=H3});var k$=I((T3)=>{var W3=P0();function g$(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,z=(Q)=>$?BigInt(Q):Number(Q),U=X.replace(/_/g,"").split(":").reduce((Q,J)=>Q*z(60)+z(J),z(0));return Z==="-"?z(-1)*U:U}function v1(q){let{value:$}=q,Z=(Q)=>Q;if(typeof $==="bigint")Z=(Q)=>BigInt(Q);else if(isNaN($)||!isFinite($))return W3.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let z=Z(60),U=[$%z];if($<60)U.unshift(0);else if($=($-U[0])/z,U.unshift($%z),$>=60)$=($-U[0])/z,U.unshift($);return X+U.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _3={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})=>g$(q,Z),stringify:v1},F3={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)=>g$(q,!1),stringify:v1},m1={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(m1.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,z,U,Q,J]=$.map(Number),G=$[7]?Number(($[7]+"00").substr(1,3)):0,H=Date.UTC(Z,X-1,z,U||0,Q||0,J||0,G),W=$[8];if(W&&W!=="Z"){let Y=g$(W,!1);if(Math.abs(Y)<30)Y*=60;H-=60000*Y}return new Date(H)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};T3.floatTime=F3;T3.intTime=_3;T3.timestamp=m1});var p1=I((C3)=>{var R3=D0(),A3=bq(),K3=w0(),M3=l0(),D3=b$(),d1=g1(),h$=k1(),hq=u1(),w3=Aq(),P3=E$(),N3=fq(),j3=x$(),u$=k$(),b3=[R3.map,K3.seq,M3.string,A3.nullTag,d1.trueTag,d1.falseTag,hq.intBin,hq.intOct,hq.int,hq.intHex,h$.floatNaN,h$.floatExp,h$.float,D3.binary,w3.merge,P3.omap,N3.pairs,j3.set,u$.intTime,u$.floatTime,u$.timestamp];C3.schema=b3});var e1=I((u3)=>{var a1=D0(),E3=bq(),s1=w0(),f3=l0(),y3=A$(),v$=M$(),m$=w$(),x3=w1(),g3=N1(),n1=b$(),s0=Aq(),o1=E$(),r1=fq(),l1=p1(),t1=x$(),uq=k$(),c1=new Map([["core",x3.schema],["failsafe",[a1.map,s1.seq,f3.string]],["json",g3.schema],["yaml11",l1.schema],["yaml-1.1",l1.schema]]),i1={binary:n1.binary,bool:y3.boolTag,float:v$.float,floatExp:v$.floatExp,floatNaN:v$.floatNaN,floatTime:uq.floatTime,int:m$.int,intHex:m$.intHex,intOct:m$.intOct,intTime:uq.intTime,map:a1.map,merge:s0.merge,null:E3.nullTag,omap:o1.omap,pairs:r1.pairs,seq:s1.seq,set:t1.set,timestamp:uq.timestamp},k3={"tag:yaml.org,2002:binary":n1.binary,"tag:yaml.org,2002:merge":s0.merge,"tag:yaml.org,2002:omap":o1.omap,"tag:yaml.org,2002:pairs":r1.pairs,"tag:yaml.org,2002:set":t1.set,"tag:yaml.org,2002:timestamp":uq.timestamp};function h3(q,$,Z){let X=c1.get($);if(X&&!q)return Z&&!X.includes(s0.merge)?X.concat(s0.merge):X.slice();let z=X;if(!z)if(Array.isArray(q))z=[];else{let U=Array.from(c1.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${U} or define customTags array`)}if(Array.isArray(q))for(let U of q)z=z.concat(U);else if(typeof q==="function")z=q(z.slice());if(Z)z=z.concat(s0.merge);return z.reduce((U,Q)=>{let J=typeof Q==="string"?i1[Q]:Q;if(!J){let G=JSON.stringify(Q),H=Object.keys(i1).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${H}`)}if(!U.includes(J))U.push(J);return U},[])}u3.coreKnownTags=k3;u3.getTags=h3});var l$=I((i3)=>{var d$=N(),d3=D0(),p3=w0(),l3=l0(),vq=e1(),c3=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class p${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:z,sortMapEntries:U,toStringDefaults:Q}){this.compat=Array.isArray(q)?vq.getTags(q,"compat"):q?vq.getTags(null,q):null,this.name=typeof z==="string"&&z||"core",this.knownTags=X?vq.coreKnownTags:{},this.tags=vq.getTags($,this.name,Z),this.toStringOptions=Q??null,Object.defineProperty(this,d$.MAP,{value:d3.map}),Object.defineProperty(this,d$.SCALAR,{value:l3.string}),Object.defineProperty(this,d$.SEQ,{value:p3.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?c3:null}clone(){let q=Object.create(p$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}i3.Schema=p$});var q9=I((o3)=>{var s3=N(),c$=v0(),n0=k0();function n3(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let G=q.directives.toString(q);if(G)Z.push(G),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let z=c$.createStringifyContext(q,$),{commentString:U}=z.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let G=U(q.commentBefore);Z.unshift(n0.indentComment(G,""))}let Q=!1,J=null;if(q.contents){if(s3.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let W=U(q.contents.commentBefore);Z.push(n0.indentComment(W,""))}z.forceBlockIndent=!!q.comment,J=q.contents.comment}let G=J?void 0:()=>Q=!0,H=c$.stringify(q.contents,z,()=>J=null,G);if(J)H+=n0.lineComment(H,"",U(J));if((H[0]==="|"||H[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${H}`;else Z.push(H)}else Z.push(c$.stringify(q.contents,z));if(q.directives?.docEnd)if(q.comment){let G=U(q.comment);if(G.includes(`
|
|
56
|
+
${U.comment}`:X.comment}X=z}q.items[Z]=Eq.isPair(X)?X:new E$.Pair(X)}else $("Expected a sequence for this tag");return q}function C1(q,$,Z){let{replacer:X}=Z,z=new f6.YAMLSeq(q);z.tag="tag:yaml.org,2002:pairs";let U=0;if($&&Symbol.iterator in Object($))for(let Q of $){if(typeof X==="function")Q=X.call($,String(U++),Q);let J,G;if(Array.isArray(Q))if(Q.length===2)J=Q[0],G=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let H=Object.keys(Q);if(H.length===1)J=H[0],G=Q[J];else throw TypeError(`Expected tuple with one key, not ${H.length} keys`)}else J=Q;z.items.push(E$.createPair(J,G,Z))}return z}var y6={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:b1,createNode:C1};x6.createPairs=C1;x6.pairs=y6;x6.resolvePairs=b1});var y$=R((m6)=>{var S1=N(),f$=e(),i0=z0(),u6=U0(),E1=fq();class B0 extends u6.YAMLSeq{constructor(){super();this.add=i0.YAMLMap.prototype.add.bind(this),this.delete=i0.YAMLMap.prototype.delete.bind(this),this.get=i0.YAMLMap.prototype.get.bind(this),this.has=i0.YAMLMap.prototype.has.bind(this),this.set=i0.YAMLMap.prototype.set.bind(this),this.tag=B0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let X of this.items){let z,U;if(S1.isPair(X))z=f$.toJS(X.key,"",$),U=f$.toJS(X.value,z,$);else z=f$.toJS(X,"",$);if(Z.has(z))throw Error("Ordered maps must not include duplicate keys");Z.set(z,U)}return Z}static from(q,$,Z){let X=E1.createPairs(q,$,Z),z=new this;return z.items=X.items,z}}B0.tag="tag:yaml.org,2002:omap";var v6={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=E1.resolvePairs(q,$),X=[];for(let{key:z}of Z.items)if(S1.isScalar(z))if(X.includes(z.value))$(`Ordered maps must not include duplicate keys: ${z.value}`);else X.push(z.value);return Object.assign(new B0,Z)},createNode:(q,$,Z)=>B0.from(q,$,Z)};m6.YAMLOMap=B0;m6.omap=v6});var k1=R((l6)=>{var f1=f();function y1({value:q,source:$},Z){if($&&(q?x1:g1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var x1={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 f1.Scalar(!0),stringify:y1},g1={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 f1.Scalar(!1),stringify:y1};l6.falseTag=g1;l6.trueTag=x1});var h1=R((r6)=>{var a6=f(),x$=P0(),s6={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:x$.stringifyNumber},n6={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():x$.stringifyNumber(q)}},o6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new a6.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:x$.stringifyNumber};r6.float=o6;r6.floatExp=n6;r6.floatNaN=s6});var v1=R((U3)=>{var u1=P0(),a0=(q)=>typeof q==="bigint"||Number.isInteger(q);function yq(q,$,Z,{intAsBigInt:X}){let z=q[0];if(z==="-"||z==="+")$+=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 Q=BigInt(q);return z==="-"?BigInt(-1)*Q:Q}let U=parseInt(q,Z);return z==="-"?-1*U:U}function g$(q,$,Z){let{value:X}=q;if(a0(X)){let z=X.toString($);return X<0?"-"+Z+z.substr(1):Z+z}return u1.stringifyNumber(q)}var $3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>yq(q,2,2,Z),stringify:(q)=>g$(q,2,"0b")},Z3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>yq(q,1,8,Z),stringify:(q)=>g$(q,8,"0")},X3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>yq(q,0,10,Z),stringify:u1.stringifyNumber},z3={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>yq(q,2,16,Z),stringify:(q)=>g$(q,16,"0x")};U3.int=X3;U3.intBin=$3;U3.intHex=z3;U3.intOct=Z3});var k$=R((V3)=>{var kq=N(),xq=Z0(),gq=z0();class W0 extends gq.YAMLMap{constructor(q){super(q);this.tag=W0.tag}add(q){let $;if(kq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new xq.Pair(q.key,null);else $=new xq.Pair(q,null);if(!gq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=gq.findPair(this.items,q);return!$&&kq.isPair(Z)?kq.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=gq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new xq.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,z=new this(q);if($&&Symbol.iterator in Object($))for(let U of $){if(typeof X==="function")U=X.call($,U,U);z.items.push(xq.createPair(U,null,Z))}return z}}W0.tag="tag:yaml.org,2002:set";var Y3={collection:"map",identify:(q)=>q instanceof Set,nodeClass:W0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>W0.from(q,$,Z),resolve(q,$){if(kq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new W0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};V3.YAMLSet=W0;V3.set=Y3});var u$=R((L3)=>{var _3=P0();function h$(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,z=(Q)=>$?BigInt(Q):Number(Q),U=X.replace(/_/g,"").split(":").reduce((Q,J)=>Q*z(60)+z(J),z(0));return Z==="-"?z(-1)*U:U}function m1(q){let{value:$}=q,Z=(Q)=>Q;if(typeof $==="bigint")Z=(Q)=>BigInt(Q);else if(isNaN($)||!isFinite($))return _3.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let z=Z(60),U=[$%z];if($<60)U.unshift(0);else if($=($-U[0])/z,U.unshift($%z),$>=60)$=($-U[0])/z,U.unshift($);return X+U.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var F3={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})=>h$(q,Z),stringify:m1},T3={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)=>h$(q,!1),stringify:m1},d1={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(d1.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,z,U,Q,J]=$.map(Number),G=$[7]?Number(($[7]+"00").substr(1,3)):0,H=Date.UTC(Z,X-1,z,U||0,Q||0,J||0,G),_=$[8];if(_&&_!=="Z"){let Y=h$(_,!1);if(Math.abs(Y)<30)Y*=60;H-=60000*Y}return new Date(H)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};L3.floatTime=T3;L3.intTime=F3;L3.timestamp=d1});var l1=R((S3)=>{var K3=D0(),A3=bq(),M3=w0(),D3=l0(),w3=S$(),p1=k1(),v$=h1(),hq=v1(),P3=Kq(),N3=y$(),j3=fq(),b3=k$(),m$=u$(),C3=[K3.map,M3.seq,D3.string,A3.nullTag,p1.trueTag,p1.falseTag,hq.intBin,hq.intOct,hq.int,hq.intHex,v$.floatNaN,v$.floatExp,v$.float,w3.binary,P3.merge,N3.omap,j3.pairs,b3.set,m$.intTime,m$.floatTime,m$.timestamp];S3.schema=C3});var q9=R((v3)=>{var s1=D0(),f3=bq(),n1=w0(),y3=l0(),x3=M$(),d$=w$(),p$=N$(),g3=P1(),k3=j1(),o1=S$(),s0=Kq(),r1=y$(),t1=fq(),c1=l1(),e1=k$(),uq=u$(),i1=new Map([["core",g3.schema],["failsafe",[s1.map,n1.seq,y3.string]],["json",k3.schema],["yaml11",c1.schema],["yaml-1.1",c1.schema]]),a1={binary:o1.binary,bool:x3.boolTag,float:d$.float,floatExp:d$.floatExp,floatNaN:d$.floatNaN,floatTime:uq.floatTime,int:p$.int,intHex:p$.intHex,intOct:p$.intOct,intTime:uq.intTime,map:s1.map,merge:s0.merge,null:f3.nullTag,omap:r1.omap,pairs:t1.pairs,seq:n1.seq,set:e1.set,timestamp:uq.timestamp},h3={"tag:yaml.org,2002:binary":o1.binary,"tag:yaml.org,2002:merge":s0.merge,"tag:yaml.org,2002:omap":r1.omap,"tag:yaml.org,2002:pairs":t1.pairs,"tag:yaml.org,2002:set":e1.set,"tag:yaml.org,2002:timestamp":uq.timestamp};function u3(q,$,Z){let X=i1.get($);if(X&&!q)return Z&&!X.includes(s0.merge)?X.concat(s0.merge):X.slice();let z=X;if(!z)if(Array.isArray(q))z=[];else{let U=Array.from(i1.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${U} or define customTags array`)}if(Array.isArray(q))for(let U of q)z=z.concat(U);else if(typeof q==="function")z=q(z.slice());if(Z)z=z.concat(s0.merge);return z.reduce((U,Q)=>{let J=typeof Q==="string"?a1[Q]:Q;if(!J){let G=JSON.stringify(Q),H=Object.keys(a1).map((_)=>JSON.stringify(_)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${H}`)}if(!U.includes(J))U.push(J);return U},[])}v3.coreKnownTags=h3;v3.getTags=u3});var i$=R((a3)=>{var l$=N(),p3=D0(),l3=w0(),c3=l0(),vq=q9(),i3=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class c${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:z,sortMapEntries:U,toStringDefaults:Q}){this.compat=Array.isArray(q)?vq.getTags(q,"compat"):q?vq.getTags(null,q):null,this.name=typeof z==="string"&&z||"core",this.knownTags=X?vq.coreKnownTags:{},this.tags=vq.getTags($,this.name,Z),this.toStringOptions=Q??null,Object.defineProperty(this,l$.MAP,{value:p3.map}),Object.defineProperty(this,l$.SCALAR,{value:c3.string}),Object.defineProperty(this,l$.SEQ,{value:l3.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?i3:null}clone(){let q=Object.create(c$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}a3.Schema=c$});var $9=R((r3)=>{var n3=N(),a$=v0(),n0=k0();function o3(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let G=q.directives.toString(q);if(G)Z.push(G),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let z=a$.createStringifyContext(q,$),{commentString:U}=z.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let G=U(q.commentBefore);Z.unshift(n0.indentComment(G,""))}let Q=!1,J=null;if(q.contents){if(n3.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let _=U(q.contents.commentBefore);Z.push(n0.indentComment(_,""))}z.forceBlockIndent=!!q.comment,J=q.contents.comment}let G=J?void 0:()=>Q=!0,H=a$.stringify(q.contents,z,()=>J=null,G);if(J)H+=n0.lineComment(H,"",U(J));if((H[0]==="|"||H[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${H}`;else Z.push(H)}else Z.push(a$.stringify(q.contents,z));if(q.directives?.docEnd)if(q.comment){let G=U(q.comment);if(G.includes(`
|
|
57
57
|
`))Z.push("..."),Z.push(n0.indentComment(G,""));else Z.push(`... ${G}`)}else Z.push("...");else{let G=q.comment;if(G&&Q)G=G.replace(/^\n+/,"");if(G){if((!Q||J)&&Z[Z.length-1]!=="")Z.push("");Z.push(n0.indentComment(U(G),""))}}return Z.join(`
|
|
58
58
|
`)+`
|
|
59
|
-
`}
|
|
59
|
+
`}r3.stringifyDocument=o3});var o0=R((Q7)=>{var e3=x0(),N0=Fq(),m=N(),q7=Z0(),$7=e(),Z7=i$(),X7=$9(),s$=Bq(),z7=W$(),U7=g0(),n$=B$();class o${constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,m.NODE_TYPE,{value:m.DOC});let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$,$=void 0;let z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=z;let{version:U}=z;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new n$.Directives({version:U});this.setSchema(U,Z),this.contents=q===void 0?null:this.createNode(q,X,Z)}clone(){let q=Object.create(o$.prototype,{[m.NODE_TYPE]:{value:m.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=m.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(j0(this.contents))this.contents.add(q)}addIn(q,$){if(j0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=s$.anchorNames(this);q.anchor=!$||Z.has($)?s$.findNewAnchor($||"a",Z):$}return new e3.Alias(q.anchor)}createNode(q,$,Z){let X=void 0;if(typeof $==="function")q=$.call({"":q},"",q),X=$;else if(Array.isArray($)){let B=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,T=$.filter(B).map(String);if(T.length>0)$=$.concat(T);X=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:z,anchorPrefix:U,flow:Q,keepUndefined:J,onTagObj:G,tag:H}=Z??{},{onAnchor:_,setAnchors:Y,sourceObjects:V}=s$.createNodeAnchors(this,U||"a"),F={aliasDuplicateObjects:z??!0,keepUndefined:J??!1,onAnchor:_,onTagObj:G,replacer:X,schema:this.schema,sourceObjects:V},O=U7.createNode(q,H,F);if(Q&&m.isCollection(O))O.flow=!0;return Y(),O}createPair(q,$,Z={}){let X=this.createNode(q,null,Z),z=this.createNode($,null,Z);return new q7.Pair(X,z)}delete(q){return j0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(N0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return j0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return m.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(N0.isEmptyPath(q))return!$&&m.isScalar(this.contents)?this.contents.value:this.contents;return m.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return m.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(N0.isEmptyPath(q))return this.contents!==void 0;return m.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=N0.collectionFromPath(this.schema,[q],$);else if(j0(this.contents))this.contents.set(q,$)}setIn(q,$){if(N0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=N0.collectionFromPath(this.schema,Array.from(q),$);else if(j0(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 n$.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 n$.Directives({version:q});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let X=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new Z7.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:X,onAnchor:z,reviver:U}={}){let Q={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},J=$7.toJS(this.contents,$??"",Q);if(typeof z==="function")for(let{count:G,res:H}of Q.anchors.values())z(H,G);return typeof U==="function"?z7.applyReviver(U,{"":J},"",J):J}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 X7.stringifyDocument(this,q)}}function j0(q){if(m.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}Q7.Document=o$});var r0=R((H7)=>{class mq extends Error{constructor(q,$,Z,X){super();this.name=q,this.code=Z,this.message=X,this.pos=$}}class Z9 extends mq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class X9 extends mq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var G7=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((J)=>$.linePos(J));let{line:X,col:z}=Z.linePos[0];Z.message+=` at line ${X}, column ${z}`;let U=z-1,Q=q.substring($.lineStarts[X-1],$.lineStarts[X]).replace(/[\n\r]+$/,"");if(U>=60&&Q.length>80){let J=Math.min(U-39,Q.length-79);Q="…"+Q.substring(J),U-=J-1}if(Q.length>80)Q=Q.substring(0,79)+"…";if(X>1&&/^ *$/.test(Q.substring(0,U))){let J=q.substring($.lineStarts[X-2],$.lineStarts[X-1]);if(J.length>80)J=J.substring(0,79)+`…
|
|
60
60
|
`;Q=J+Q}if(/[^ ]/.test(Q)){let J=1,G=Z.linePos[1];if(G?.line===X&&G.col>z)J=Math.max(1,Math.min(G.col-z,80-U));let H=" ".repeat(U)+"^".repeat(J);Z.message+=`:
|
|
61
61
|
|
|
62
62
|
${Q}
|
|
63
63
|
${H}
|
|
64
|
-
`}};
|
|
65
|
-
`))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(
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+P.comment;else H.comment=P.comment;Y=P.end;continue}if(!Q&&Z.options.strict&&
|
|
69
|
-
`+j;else
|
|
70
|
-
`+E.comment;else
|
|
71
|
-
`+
|
|
72
|
-
`.repeat(Math.max(1,Q.length-1)):"",
|
|
73
|
-
`;for(let
|
|
74
|
-
`;else if(
|
|
75
|
-
`;else if(!
|
|
64
|
+
`}};H7.YAMLError=mq;H7.YAMLParseError=Z9;H7.YAMLWarning=X9;H7.prettifyError=G7});var t0=R((F7)=>{function _7(q,{flow:$,indicator:Z,next:X,offset:z,onError:U,parentIndent:Q,startOnNewline:J}){let G=!1,H=J,_=J,Y="",V="",F=!1,O=!1,B=null,T=null,L=null,I=null,K=null,M=null,w=null;for(let A of q){if(O){if(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma")U(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");O=!1}if(B){if(H&&A.type!=="comment"&&A.type!=="newline")U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(A.type){case"space":if(!$&&(Z!=="doc-start"||X?.type!=="flow-collection")&&A.source.includes("\t"))B=A;_=!0;break;case"comment":{if(!_)U(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=A.source.substring(1)||" ";if(!Y)Y=E;else Y+=V+E;V="",H=!1;break}case"newline":if(H){if(Y)Y+=A.source;else if(!M||Z!=="seq-item-ind")G=!0}else V+=A.source;if(H=!0,F=!0,T||L)I=A;_=!0;break;case"anchor":if(T)U(A,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(A.source.endsWith(":"))U(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);T=A,w??(w=A.offset),H=!1,_=!1,O=!0;break;case"tag":{if(L)U(A,"MULTIPLE_TAGS","A node can have at most one tag");L=A,w??(w=A.offset),H=!1,_=!1,O=!0;break}case Z:if(T||L)U(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(M)U(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${$??"collection"}`);M=A,H=Z==="seq-item-ind"||Z==="explicit-key-ind",_=!1;break;case"comma":if($){if(K)U(A,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);K=A,H=!1,_=!1;break}default:U(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),H=!1,_=!1}}let P=q[q.length-1],j=P?P.offset+P.source.length:z;if(O&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))U(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(H&&B.indent<=Q||X?.type==="block-map"||X?.type==="block-seq"))U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:K,found:M,spaceBefore:G,comment:Y,hasNewline:F,anchor:T,tag:L,newlineAfterProp:I,end:j,start:w??j}}F7.resolveProps=_7});var dq=R((L7)=>{function r$(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
65
|
+
`))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(r$($.key)||r$($.value))return!0}return!1;default:return!0}}L7.containsNewline=r$});var t$=R((K7)=>{var I7=dq();function R7(q,$,Z){if($?.type==="flow-collection"){let X=$.end[0];if(X.indent===q&&(X.source==="]"||X.source==="}")&&I7.containsNewline($))Z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}K7.flowIndentCheck=R7});var e$=R((D7)=>{var z9=N();function M7(q,$,Z){let{uniqueKeys:X}=q.options;if(X===!1)return!1;let z=typeof X==="function"?X:(U,Q)=>U===Q||z9.isScalar(U)&&z9.isScalar(Q)&&U.value===Q.value;return $.some((U)=>z(U.key,Z))}D7.mapIncludes=M7});var H9=R((C7)=>{var U9=Z0(),P7=z0(),Q9=t0(),N7=dq(),J9=t$(),j7=e$(),G9="All mapping items must start at the same column";function b7({composeNode:q,composeEmptyNode:$},Z,X,z,U){let J=new(U?.nodeClass??P7.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let G=X.offset,H=null;for(let _ of X.items){let{start:Y,key:V,sep:F,value:O}=_,B=Q9.resolveProps(Y,{indicator:"explicit-key-ind",next:V??F?.[0],offset:G,onError:z,parentIndent:X.indent,startOnNewline:!0}),T=!B.found;if(T){if(V){if(V.type==="block-seq")z(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in V&&V.indent!==X.indent)z(G,"BAD_INDENT",G9)}if(!B.anchor&&!B.tag&&!F){if(H=B.end,B.comment)if(J.comment)J.comment+=`
|
|
66
|
+
`+B.comment;else J.comment=B.comment;continue}if(B.newlineAfterProp||N7.containsNewline(V))z(V??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==X.indent)z(G,"BAD_INDENT",G9);Z.atKey=!0;let L=B.end,I=V?q(Z,V,B,z):$(Z,L,Y,null,B,z);if(Z.schema.compat)J9.flowIndentCheck(X.indent,V,z);if(Z.atKey=!1,j7.mapIncludes(Z,J.items,I))z(L,"DUPLICATE_KEY","Map keys must be unique");let K=Q9.resolveProps(F??[],{indicator:"map-value-ind",next:O,offset:I.range[2],onError:z,parentIndent:X.indent,startOnNewline:!V||V.type==="block-scalar"});if(G=K.end,K.found){if(T){if(O?.type==="block-map"&&!K.hasNewline)z(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&B.start<K.found.offset-1024)z(I.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let M=O?q(Z,O,K,z):$(Z,G,F,null,K,z);if(Z.schema.compat)J9.flowIndentCheck(X.indent,O,z);G=M.range[2];let w=new U9.Pair(I,M);if(Z.options.keepSourceTokens)w.srcToken=_;J.items.push(w)}else{if(T)z(I.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(K.comment)if(I.comment)I.comment+=`
|
|
67
|
+
`+K.comment;else I.comment=K.comment;let M=new U9.Pair(I);if(Z.options.keepSourceTokens)M.srcToken=_;J.items.push(M)}}if(H&&H<G)z(H,"IMPOSSIBLE","Map comment with trailing content");return J.range=[X.offset,G,H??G],J}C7.resolveBlockMap=b7});var Y9=R((g7)=>{var E7=U0(),f7=t0(),y7=t$();function x7({composeNode:q,composeEmptyNode:$},Z,X,z,U){let J=new(U?.nodeClass??E7.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let G=X.offset,H=null;for(let{start:_,value:Y}of X.items){let V=f7.resolveProps(_,{indicator:"seq-item-ind",next:Y,offset:G,onError:z,parentIndent:X.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||Y)if(Y?.type==="block-seq")z(V.end,"BAD_INDENT","All sequence items must start at the same column");else z(G,"MISSING_CHAR","Sequence item without - indicator");else{if(H=V.end,V.comment)J.comment=V.comment;continue}let F=Y?q(Z,Y,V,z):$(Z,V.end,_,null,V,z);if(Z.schema.compat)y7.flowIndentCheck(X.indent,Y,z);G=F.range[2],J.items.push(F)}return J.range=[X.offset,G,H??G],J}g7.resolveBlockSeq=x7});var b0=R((u7)=>{function h7(q,$,Z,X){let z="";if(q){let U=!1,Q="";for(let J of q){let{source:G,type:H}=J;switch(H){case"space":U=!0;break;case"comment":{if(Z&&!U)X(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let _=G.substring(1)||" ";if(!z)z=_;else z+=Q+_;Q="";break}case"newline":if(z)Q+=G;U=!0;break;default:X(J,"UNEXPECTED_TOKEN",`Unexpected ${H} at node end`)}$+=G.length}}return{comment:z,offset:$}}u7.resolveEnd=h7});var W9=R((s7)=>{var m7=N(),d7=Z0(),V9=z0(),p7=U0(),l7=b0(),B9=t0(),c7=dq(),i7=e$(),q2="Block collections are not allowed within flow collections",$2=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function a7({composeNode:q,composeEmptyNode:$},Z,X,z,U){let Q=X.start.source==="{",J=Q?"flow map":"flow sequence",H=new(U?.nodeClass??(Q?V9.YAMLMap:p7.YAMLSeq))(Z.schema);H.flow=!0;let _=Z.atRoot;if(_)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let Y=X.offset+X.start.source.length;for(let T=0;T<X.items.length;++T){let L=X.items[T],{start:I,key:K,sep:M,value:w}=L,P=B9.resolveProps(I,{flow:J,indicator:"explicit-key-ind",next:K??M?.[0],offset:Y,onError:z,parentIndent:X.indent,startOnNewline:!1});if(!P.found){if(!P.anchor&&!P.tag&&!M&&!w){if(T===0&&P.comma)z(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(T<X.items.length-1)z(P.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(P.comment)if(H.comment)H.comment+=`
|
|
68
|
+
`+P.comment;else H.comment=P.comment;Y=P.end;continue}if(!Q&&Z.options.strict&&c7.containsNewline(K))z(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0){if(P.comma)z(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!P.comma)z(P.start,"MISSING_CHAR",`Missing , between ${J} items`);if(P.comment){let j="";q:for(let A of I)switch(A.type){case"comma":case"space":break;case"comment":j=A.source.substring(1);break q;default:break q}if(j){let A=H.items[H.items.length-1];if(m7.isPair(A))A=A.value??A.key;if(A.comment)A.comment+=`
|
|
69
|
+
`+j;else A.comment=j;P.comment=P.comment.substring(j.length+1)}}}if(!Q&&!M&&!P.found){let j=w?q(Z,w,P,z):$(Z,P.end,M,null,P,z);if(H.items.push(j),Y=j.range[2],$2(w))z(j.range,"BLOCK_IN_FLOW",q2)}else{Z.atKey=!0;let j=P.end,A=K?q(Z,K,P,z):$(Z,j,I,null,P,z);if($2(K))z(A.range,"BLOCK_IN_FLOW",q2);Z.atKey=!1;let E=B9.resolveProps(M??[],{flow:J,indicator:"map-value-ind",next:w,offset:A.range[2],onError:z,parentIndent:X.indent,startOnNewline:!1});if(E.found){if(!Q&&!P.found&&Z.options.strict){if(M)for(let C of M){if(C===E.found)break;if(C.type==="newline"){z(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(P.start<E.found.offset-1024)z(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(w)if("source"in w&&w.source?.[0]===":")z(w,"MISSING_CHAR",`Missing space after : in ${J}`);else z(E.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let b=w?q(Z,w,E,z):E.found?$(Z,E.end,M,null,E,z):null;if(b){if($2(w))z(b.range,"BLOCK_IN_FLOW",q2)}else if(E.comment)if(A.comment)A.comment+=`
|
|
70
|
+
`+E.comment;else A.comment=E.comment;let u=new d7.Pair(A,b);if(Z.options.keepSourceTokens)u.srcToken=L;if(Q){let C=H;if(i7.mapIncludes(Z,C.items,A))z(j,"DUPLICATE_KEY","Map keys must be unique");C.items.push(u)}else{let C=new V9.YAMLMap(Z.schema);C.flow=!0,C.items.push(u);let s=(b??A).range;C.range=[A.range[0],s[1],s[2]],H.items.push(C)}Y=b?b.range[2]:E.end}}let V=Q?"}":"]",[F,...O]=X.end,B=Y;if(F?.source===V)B=F.offset+F.source.length;else{let T=J[0].toUpperCase()+J.substring(1),L=_?`${T} must end with a ${V}`:`${T} in block collection must be sufficiently indented and end with a ${V}`;if(z(Y,_?"MISSING_CHAR":"BAD_INDENT",L),F&&F.source.length!==1)O.unshift(F)}if(O.length>0){let T=l7.resolveEnd(O,B,Z.options.strict,z);if(T.comment)if(H.comment)H.comment+=`
|
|
71
|
+
`+T.comment;else H.comment=T.comment;H.range=[X.offset,B,T.offset]}else H.range=[X.offset,B,B];return H}s7.resolveFlowCollection=a7});var _9=R((zX)=>{var o7=N(),r7=f(),t7=z0(),e7=U0(),qX=H9(),$X=Y9(),ZX=W9();function Z2(q,$,Z,X,z,U){let Q=Z.type==="block-map"?qX.resolveBlockMap(q,$,Z,X,U):Z.type==="block-seq"?$X.resolveBlockSeq(q,$,Z,X,U):ZX.resolveFlowCollection(q,$,Z,X,U),J=Q.constructor;if(z==="!"||z===J.tagName)return Q.tag=J.tagName,Q;if(z)Q.tag=z;return Q}function XX(q,$,Z,X,z){let U=X.tag,Q=!U?null:$.directives.tagName(U.source,(V)=>z(U,"TAG_RESOLVE_FAILED",V));if(Z.type==="block-seq"){let{anchor:V,newlineAfterProp:F}=X,O=V&&U?V.offset>U.offset?V:U:V??U;if(O&&(!F||F.offset<O.offset))z(O,"MISSING_CHAR","Missing newline after block sequence props")}let J=Z.type==="block-map"?"map":Z.type==="block-seq"?"seq":Z.start.source==="{"?"map":"seq";if(!U||!Q||Q==="!"||Q===t7.YAMLMap.tagName&&J==="map"||Q===e7.YAMLSeq.tagName&&J==="seq")return Z2(q,$,Z,z,Q);let G=$.schema.tags.find((V)=>V.tag===Q&&V.collection===J);if(!G){let V=$.schema.knownTags[Q];if(V?.collection===J)$.schema.tags.push(Object.assign({},V,{default:!1})),G=V;else{if(V)z(U,"BAD_COLLECTION_TYPE",`${V.tag} used for ${J} collection, but expects ${V.collection??"scalar"}`,!0);else z(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return Z2(q,$,Z,z,Q)}}let H=Z2(q,$,Z,z,Q,G),_=G.resolve?.(H,(V)=>z(U,"TAG_RESOLVE_FAILED",V),$.options)??H,Y=o7.isNode(_)?_:new r7.Scalar(_);if(Y.range=H.range,Y.tag=Q,G?.format)Y.format=G.format;return Y}zX.composeCollection=XX});var z2=R((HX)=>{var X2=f();function QX(q,$,Z){let X=$.offset,z=JX($,q.options.strict,Z);if(!z)return{value:"",type:null,comment:"",range:[X,X,X]};let U=z.mode===">"?X2.Scalar.BLOCK_FOLDED:X2.Scalar.BLOCK_LITERAL,Q=$.source?GX($.source):[],J=Q.length;for(let B=Q.length-1;B>=0;--B){let T=Q[B][1];if(T===""||T==="\r")J=B;else break}if(J===0){let B=z.chomp==="+"&&Q.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,Q.length-1)):"",T=X+z.length;if($.source)T+=$.source.length;return{value:B,type:U,comment:z.comment,range:[X,T,T]}}let G=$.indent+z.indent,H=$.offset+z.length,_=0;for(let B=0;B<J;++B){let[T,L]=Q[B];if(L===""||L==="\r"){if(z.indent===0&&T.length>G)G=T.length}else{if(T.length<G)Z(H+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(z.indent===0)G=T.length;if(_=B,G===0&&!q.atRoot)Z(H,"BAD_INDENT","Block scalar values in collections must be indented");break}H+=T.length+L.length+1}for(let B=Q.length-1;B>=J;--B)if(Q[B][0].length>G)J=B+1;let Y="",V="",F=!1;for(let B=0;B<_;++B)Y+=Q[B][0].slice(G)+`
|
|
73
|
+
`;for(let B=_;B<J;++B){let[T,L]=Q[B];H+=T.length+L.length+1;let I=L[L.length-1]==="\r";if(I)L=L.slice(0,-1);if(L&&T.length<G){let M=`Block scalar lines must not be less indented than their ${z.indent?"explicit indentation indicator":"first line"}`;Z(H-L.length-(I?2:1),"BAD_INDENT",M),T=""}if(U===X2.Scalar.BLOCK_LITERAL)Y+=V+T.slice(G)+L,V=`
|
|
74
|
+
`;else if(T.length>G||L[0]==="\t"){if(V===" ")V=`
|
|
75
|
+
`;else if(!F&&V===`
|
|
76
76
|
`)V=`
|
|
77
77
|
|
|
78
|
-
`;Y+=V+
|
|
79
|
-
`,
|
|
78
|
+
`;Y+=V+T.slice(G)+L,V=`
|
|
79
|
+
`,F=!0}else if(L==="")if(V===`
|
|
80
80
|
`)Y+=`
|
|
81
81
|
`;else V=`
|
|
82
|
-
`;else Y+=V+
|
|
83
|
-
`+Q[
|
|
82
|
+
`;else Y+=V+L,V=" ",F=!1}switch(z.chomp){case"-":break;case"+":for(let B=J;B<Q.length;++B)Y+=`
|
|
83
|
+
`+Q[B][0].slice(G);if(Y[Y.length-1]!==`
|
|
84
84
|
`)Y+=`
|
|
85
85
|
`;break;default:Y+=`
|
|
86
|
-
`}let
|
|
86
|
+
`}let O=X+z.length+$.source.length;return{value:Y,type:U,comment:z.comment,range:[X,O,O]}}function JX({offset:q,props:$},Z,X){if($[0].type!=="block-scalar-header")return X($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:z}=$[0],U=z[0],Q=0,J="",G=-1;for(let V=1;V<z.length;++V){let F=z[V];if(!J&&(F==="-"||F==="+"))J=F;else{let O=Number(F);if(!Q&&O)Q=O;else if(G===-1)G=q+V}}if(G!==-1)X(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${z}`);let H=!1,_="",Y=z.length;for(let V=1;V<$.length;++V){let F=$[V];switch(F.type){case"space":H=!0;case"newline":Y+=F.source.length;break;case"comment":if(Z&&!H)X(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=F.source.length,_=F.source.substring(1);break;case"error":X(F,"UNEXPECTED_TOKEN",F.message),Y+=F.source.length;break;default:{let O=`Unexpected token in block scalar header: ${F.type}`;X(F,"UNEXPECTED_TOKEN",O);let B=F.source;if(B&&typeof B==="string")Y+=B.length}}}return{mode:U,indent:Q,chomp:J,comment:_,length:Y}}function GX(q){let $=q.split(/\n( *)/),Z=$[0],X=Z.match(/^( *)/),U=[X?.[1]?[X[1],Z.slice(X[1].length)]:["",Z]];for(let Q=1;Q<$.length;Q+=2)U.push([$[Q],$[Q+1]]);return U}HX.resolveBlockScalar=QX});var Q2=R((IX)=>{var U2=f(),VX=b0();function BX(q,$,Z){let{offset:X,type:z,source:U,end:Q}=q,J,G,H=(V,F,O)=>Z(X+V,F,O);switch(z){case"scalar":J=U2.Scalar.PLAIN,G=WX(U,H);break;case"single-quoted-scalar":J=U2.Scalar.QUOTE_SINGLE,G=_X(U,H);break;case"double-quoted-scalar":J=U2.Scalar.QUOTE_DOUBLE,G=FX(U,H);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${z}`),{value:"",type:null,comment:"",range:[X,X+U.length,X+U.length]}}let _=X+U.length,Y=VX.resolveEnd(Q,_,$,Z);return{value:G,type:J,comment:Y.comment,range:[X,_,Y.offset]}}function WX(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 F9(q)}function _X(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return F9(q.slice(1,-1)).replace(/''/g,"'")}function F9(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
87
87
|
`,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
88
88
|
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=$.exec(q);if(!X)return q;let z=X[1],U=" ",Q=$.lastIndex;Z.lastIndex=Q;while(X=Z.exec(q)){if(X[1]==="")if(U===`
|
|
89
89
|
`)z+=U;else U=`
|
|
90
|
-
`;else z+=U+X[1],U=" ";Q=Z.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=Q,X=J.exec(q),z+U+(X?.[1]??"")}function
|
|
90
|
+
`;else z+=U+X[1],U=" ";Q=Z.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=Q,X=J.exec(q),z+U+(X?.[1]??"")}function FX(q,$){let Z="";for(let X=1;X<q.length-1;++X){let z=q[X];if(z==="\r"&&q[X+1]===`
|
|
91
91
|
`)continue;if(z===`
|
|
92
|
-
`){let{fold:U,offset:Q}=
|
|
92
|
+
`){let{fold:U,offset:Q}=TX(q,X);Z+=U,X=Q}else if(z==="\\"){let U=q[++X],Q=LX[U];if(Q)Z+=Q;else if(U===`
|
|
93
93
|
`){U=q[X+1];while(U===" "||U==="\t")U=q[++X+1]}else if(U==="\r"&&q[X+1]===`
|
|
94
|
-
`){U=q[++X+1];while(U===" "||U==="\t")U=q[++X+1]}else if(U==="x"||U==="u"||U==="U"){let J={x:2,u:4,U:8}[U];Z+=
|
|
94
|
+
`){U=q[++X+1];while(U===" "||U==="\t")U=q[++X+1]}else if(U==="x"||U==="u"||U==="U"){let J={x:2,u:4,U:8}[U];Z+=OX(q,X+1,J,$),X+=J}else{let J=q.substr(X-1,2);$(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),Z+=J}}else if(z===" "||z==="\t"){let U=X,Q=q[X+1];while(Q===" "||Q==="\t")Q=q[++X+1];if(Q!==`
|
|
95
95
|
`&&!(Q==="\r"&&q[X+2]===`
|
|
96
|
-
`))Z+=X>U?q.slice(U,X+1):z}else Z+=z}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function
|
|
96
|
+
`))Z+=X>U?q.slice(U,X+1):z}else Z+=z}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function TX(q,$){let Z="",X=q[$+1];while(X===" "||X==="\t"||X===`
|
|
97
97
|
`||X==="\r"){if(X==="\r"&&q[$+2]!==`
|
|
98
98
|
`)break;if(X===`
|
|
99
99
|
`)Z+=`
|
|
100
|
-
`;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var
|
|
101
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
100
|
+
`;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var LX={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
101
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function OX(q,$,Z,X){let z=q.substr($,Z),Q=z.length===Z&&/^[0-9a-fA-F]+$/.test(z)?parseInt(z,16):NaN;if(isNaN(Q)){let J=q.substr($-2,Z+2);return X($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}return String.fromCodePoint(Q)}IX.resolveFlowScalar=BX});var L9=R((PX)=>{var _0=N(),T9=f(),KX=z2(),AX=Q2();function MX(q,$,Z,X){let{value:z,type:U,comment:Q,range:J}=$.type==="block-scalar"?KX.resolveBlockScalar(q,$,X):AX.resolveFlowScalar($,q.options.strict,X),G=Z?q.directives.tagName(Z.source,(Y)=>X(Z,"TAG_RESOLVE_FAILED",Y)):null,H;if(q.options.stringKeys&&q.atKey)H=q.schema[_0.SCALAR];else if(G)H=DX(q.schema,z,G,Z,X);else if($.type==="scalar")H=wX(q,z,$,X);else H=q.schema[_0.SCALAR];let _;try{let Y=H.resolve(z,(V)=>X(Z??$,"TAG_RESOLVE_FAILED",V),q.options);_=_0.isScalar(Y)?Y:new T9.Scalar(Y)}catch(Y){let V=Y instanceof Error?Y.message:String(Y);X(Z??$,"TAG_RESOLVE_FAILED",V),_=new T9.Scalar(z)}if(_.range=J,_.source=z,U)_.type=U;if(G)_.tag=G;if(H.format)_.format=H.format;if(Q)_.comment=Q;return _}function DX(q,$,Z,X,z){if(Z==="!")return q[_0.SCALAR];let U=[];for(let J of q.tags)if(!J.collection&&J.tag===Z)if(J.default&&J.test)U.push(J);else return J;for(let J of U)if(J.test?.test($))return J;let Q=q.knownTags[Z];if(Q&&!Q.collection)return q.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[_0.SCALAR]}function wX({atKey:q,directives:$,schema:Z},X,z,U){let Q=Z.tags.find((J)=>(J.default===!0||q&&J.default==="key")&&J.test?.test(X))||Z[_0.SCALAR];if(Z.compat){let J=Z.compat.find((G)=>G.default&&G.test?.test(X))??Z[_0.SCALAR];if(Q.tag!==J.tag){let G=$.tagString(Q.tag),H=$.tagString(J.tag),_=`Value may be parsed as either ${G} or ${H}`;U(z,"TAG_RESOLVE_FAILED",_,!0)}}return Q}PX.composeScalar=MX});var O9=R((bX)=>{function jX(q,$,Z){if($){Z??(Z=$.length);for(let X=Z-1;X>=0;--X){let z=$[X];switch(z.type){case"space":case"comment":case"newline":q-=z.source.length;continue}z=$[++X];while(z?.type==="space")q+=z.source.length,z=$[++X];break}}return q}bX.emptyScalarPosition=jX});var K9=R((hX)=>{var SX=x0(),EX=N(),fX=_9(),I9=L9(),yX=b0(),xX=O9(),gX={composeNode:R9,composeEmptyNode:J2};function R9(q,$,Z,X){let z=q.atKey,{spaceBefore:U,comment:Q,anchor:J,tag:G}=Z,H,_=!0;switch($.type){case"alias":if(H=kX(q,$,X),J||G)X($,"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(H=I9.composeScalar(q,$,G,X),J)H.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(H=fX.composeCollection(gX,q,$,Z,X),J)H.anchor=J.source.substring(1);break;default:{let Y=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;X($,"UNEXPECTED_TOKEN",Y),H=J2(q,$.offset,void 0,null,Z,X),_=!1}}if(J&&H.anchor==="")X(J,"BAD_ALIAS","Anchor cannot be an empty string");if(z&&q.options.stringKeys&&(!EX.isScalar(H)||typeof H.value!=="string"||H.tag&&H.tag!=="tag:yaml.org,2002:str"))X(G??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)H.spaceBefore=!0;if(Q)if($.type==="scalar"&&$.source==="")H.comment=Q;else H.commentBefore=Q;if(q.options.keepSourceTokens&&_)H.srcToken=$;return H}function J2(q,$,Z,X,{spaceBefore:z,comment:U,anchor:Q,tag:J,end:G},H){let _={type:"scalar",offset:xX.emptyScalarPosition($,Z,X),indent:-1,source:""},Y=I9.composeScalar(q,_,J,H);if(Q){if(Y.anchor=Q.source.substring(1),Y.anchor==="")H(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(z)Y.spaceBefore=!0;if(U)Y.comment=U,Y.range[2]=G;return Y}function kX({options:q},{offset:$,source:Z,end:X},z){let U=new SX.Alias(Z.substring(1));if(U.source==="")z($,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))z($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=$+Z.length,J=yX.resolveEnd(X,Q,q.strict,z);if(U.range=[$,Q,J.offset],J.comment)U.comment=J.comment;return U}hX.composeEmptyNode=J2;hX.composeNode=R9});var M9=R((cX)=>{var mX=o0(),A9=K9(),dX=b0(),pX=t0();function lX(q,$,{offset:Z,start:X,value:z,end:U},Q){let J=Object.assign({_directives:$},q),G=new mX.Document(void 0,J),H={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},_=pX.resolveProps(X,{indicator:"doc-start",next:z??U?.[0],offset:Z,onError:Q,parentIndent:0,startOnNewline:!0});if(_.found){if(G.directives.docStart=!0,z&&(z.type==="block-map"||z.type==="block-seq")&&!_.hasNewline)Q(_.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=z?A9.composeNode(H,z,_,Q):A9.composeEmptyNode(H,_.end,X,null,_,Q);let Y=G.contents.range[2],V=dX.resolveEnd(U,Y,!1,Q);if(V.comment)G.comment=V.comment;return G.range=[Z,Y,V.offset],G}cX.composeDoc=lX});var G2=R((tX)=>{var aX=g("process"),sX=B$(),nX=o0(),e0=r0(),D9=N(),oX=M9(),rX=b0();function qq(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 w9(q){let $="",Z=!1,X=!1;for(let z=0;z<q.length;++z){let U=q[z];switch(U[0]){case"#":$+=($===""?"":X?`
|
|
102
102
|
|
|
103
103
|
`:`
|
|
104
|
-
`)+(U.substring(1)||" "),Z=!0,X=!1;break;case"%":if(q[z+1]?.[0]!=="#")z+=1;Z=!1;break;default:if(!Z)X=!0;Z=!1}}return{comment:$,afterEmptyLine:X}}class
|
|
105
|
-
${Z}`:Z;else if(X||q.directives.docStart||!z)q.commentBefore=Z;else if(
|
|
104
|
+
`)+(U.substring(1)||" "),Z=!0,X=!1;break;case"%":if(q[z+1]?.[0]!=="#")z+=1;Z=!1;break;default:if(!Z)X=!0;Z=!1}}return{comment:$,afterEmptyLine:X}}class P9{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,X,z)=>{let U=qq($);if(z)this.warnings.push(new e0.YAMLWarning(U,Z,X));else this.errors.push(new e0.YAMLParseError(U,Z,X))},this.directives=new sX.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:X}=w9(this.prelude);if(Z){let z=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
105
|
+
${Z}`:Z;else if(X||q.directives.docStart||!z)q.commentBefore=Z;else if(D9.isCollection(z)&&!z.flow&&z.items.length>0){let U=z.items[0];if(D9.isPair(U))U=U.key;let Q=U.commentBefore;U.commentBefore=Q?`${Z}
|
|
106
106
|
${Q}`:Z}else{let U=z.commentBefore;z.commentBefore=U?`${Z}
|
|
107
|
-
${U}`: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:
|
|
108
|
-
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new e0.YAMLParseError(qq(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),X=new
|
|
107
|
+
${U}`: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:w9(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,Z=-1){for(let X of q)yield*this.next(X);yield*this.end($,Z)}*next(q){if(aX.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,X)=>{let z=qq(q);z[0]+=$,this.onError(z,"BAD_DIRECTIVE",Z,X)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=oX.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 e0.YAMLParseError(qq(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 e0.YAMLParseError(qq(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=rX.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}
|
|
108
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new e0.YAMLParseError(qq(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),X=new nX.Document(void 0,Z);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,$,$],this.decorate(X,!1),yield X}}}tX.Composer=P9});var b9=R((Jz)=>{var qz=z2(),$z=Q2(),Zz=r0(),N9=u0();function Xz(q,$=!0,Z){if(q){let X=(z,U,Q)=>{let J=typeof z==="number"?z:Array.isArray(z)?z[0]:z.offset;if(Z)Z(J,U,Q);else throw new Zz.YAMLParseError([J,J+1],U,Q)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return $z.resolveFlowScalar(q,$,X);case"block-scalar":return qz.resolveBlockScalar({options:{strict:$}},q,X)}}return null}function zz(q,$){let{implicitKey:Z=!1,indent:X,inFlow:z=!1,offset:U=-1,type:Q="PLAIN"}=$,J=N9.stringifyString({type:Q,value:q},{implicitKey:Z,indent:X>0?" ".repeat(X):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}}),G=$.end??[{type:"newline",offset:-1,indent:X,source:`
|
|
109
109
|
`}];switch(J[0]){case"|":case">":{let H=J.indexOf(`
|
|
110
|
-
`),
|
|
111
|
-
`,V=[{type:"block-scalar-header",offset:U,indent:X,source:
|
|
112
|
-
`});return{type:"block-scalar",offset:U,indent:X,props:V,source:Y}}case'"':return{type:"double-quoted-scalar",offset:U,indent:X,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:U,indent:X,source:J,end:G};default:return{type:"scalar",offset:U,indent:X,source:J,end:G}}}function
|
|
110
|
+
`),_=J.substring(0,H),Y=J.substring(H+1)+`
|
|
111
|
+
`,V=[{type:"block-scalar-header",offset:U,indent:X,source:_}];if(!j9(V,G))V.push({type:"newline",offset:-1,indent:X,source:`
|
|
112
|
+
`});return{type:"block-scalar",offset:U,indent:X,props:V,source:Y}}case'"':return{type:"double-quoted-scalar",offset:U,indent:X,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:U,indent:X,source:J,end:G};default:return{type:"scalar",offset:U,indent:X,source:J,end:G}}}function Uz(q,$,Z={}){let{afterKey:X=!1,implicitKey:z=!1,inFlow:U=!1,type:Q}=Z,J="indent"in q?q.indent:null;if(X&&typeof J==="number")J+=2;if(!Q)switch(q.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let H=q.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=H.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let G=N9.stringifyString({type:Q,value:$},{implicitKey:z||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":Qz(q,G);break;case'"':H2(q,G,"double-quoted-scalar");break;case"'":H2(q,G,"single-quoted-scalar");break;default:H2(q,G,"scalar")}}function Qz(q,$){let Z=$.indexOf(`
|
|
113
113
|
`),X=$.substring(0,Z),z=$.substring(Z+1)+`
|
|
114
|
-
`;if(q.type==="block-scalar"){let U=q.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=X,q.source=z}else{let{offset:U}=q,Q="indent"in q?q.indent:-1,J=[{type:"block-scalar-header",offset:U,indent:Q,source:X}];if(!
|
|
115
|
-
`});for(let G of Object.keys(q))if(G!=="type"&&G!=="offset")delete q[G];Object.assign(q,{type:"block-scalar",indent:Q,props:J,source:z})}}function
|
|
116
|
-
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[z]});break}default:{let X="indent"in q?q.indent:-1,z="end"in q&&Array.isArray(q.end)?q.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:Z,indent:X,source:$,end:z})}}}
|
|
114
|
+
`;if(q.type==="block-scalar"){let U=q.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=X,q.source=z}else{let{offset:U}=q,Q="indent"in q?q.indent:-1,J=[{type:"block-scalar-header",offset:U,indent:Q,source:X}];if(!j9(J,"end"in q?q.end:void 0))J.push({type:"newline",offset:-1,indent:Q,source:`
|
|
115
|
+
`});for(let G of Object.keys(q))if(G!=="type"&&G!=="offset")delete q[G];Object.assign(q,{type:"block-scalar",indent:Q,props:J,source:z})}}function j9(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 H2(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 X=q.props.slice(1),z=$.length;if(q.props[0].type==="block-scalar-header")z-=q.props[0].source.length;for(let U of X)U.offset+=z;delete q.props,Object.assign(q,{type:Z,source:$,end:X});break}case"block-map":case"block-seq":{let z={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
116
|
+
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[z]});break}default:{let X="indent"in q?q.indent:-1,z="end"in q&&Array.isArray(q.end)?q.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:Z,indent:X,source:$,end:z})}}}Jz.createScalarToken=zz;Jz.resolveAsScalar=Xz;Jz.setScalarValue=Uz});var C9=R((Bz)=>{var Vz=(q)=>("type"in q)?lq(q):pq(q);function lq(q){switch(q.type){case"block-scalar":{let $="";for(let Z of q.props)$+=lq(Z);return $+q.source}case"block-map":case"block-seq":{let $="";for(let Z of q.items)$+=pq(Z);return $}case"flow-collection":{let $=q.start.source;for(let Z of q.items)$+=pq(Z);for(let Z of q.end)$+=Z.source;return $}case"document":{let $=pq(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 pq({start:q,key:$,sep:Z,value:X}){let z="";for(let U of q)z+=U.source;if($)z+=lq($);if(Z)for(let U of Z)z+=U.source;if(X)z+=lq(X);return z}Bz.stringify=Vz});var f9=R((Fz)=>{var Y2=Symbol("break visit"),_z=Symbol("skip children"),S9=Symbol("remove item");function F0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};E9(Object.freeze([]),q,$)}F0.BREAK=Y2;F0.SKIP=_z;F0.REMOVE=S9;F0.itemAtPath=(q,$)=>{let Z=q;for(let[X,z]of $){let U=Z?.[X];if(U&&"items"in U)Z=U.items[z];else return}return Z};F0.parentCollection=(q,$)=>{let Z=F0.itemAtPath(q,$.slice(0,-1)),X=$[$.length-1][0],z=Z?.[X];if(z&&"items"in z)return z;throw Error("Parent collection not found")};function E9(q,$,Z){let X=Z($,q);if(typeof X==="symbol")return X;for(let z of["key","value"]){let U=$[z];if(U&&"items"in U){for(let Q=0;Q<U.items.length;++Q){let J=E9(Object.freeze(q.concat([[z,Q]])),U.items[Q],Z);if(typeof J==="number")Q=J-1;else if(J===Y2)return Y2;else if(J===S9)U.items.splice(Q,1),Q-=1}if(typeof X==="function"&&z==="key")X=X($,q)}}return typeof X==="function"?X($,q):X}Fz.visit=F0});var cq=R((Mz)=>{var V2=b9(),Lz=C9(),Oz=f9(),B2="\uFEFF",W2="\x02",_2="\x18",F2="\x1F",Iz=(q)=>!!q&&("items"in q),Rz=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function Kz(q){switch(q){case B2:return"<BOM>";case W2:return"<DOC>";case _2:return"<FLOW_END>";case F2:return"<SCALAR>";default:return JSON.stringify(q)}}function Az(q){switch(q){case B2:return"byte-order-mark";case W2:return"doc-mode";case _2:return"flow-error-end";case F2:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
117
117
|
`:case`\r
|
|
118
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(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}
|
|
119
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
120
|
-
\r `),
|
|
118
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(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}Mz.createScalarToken=V2.createScalarToken;Mz.resolveAsScalar=V2.resolveAsScalar;Mz.setScalarValue=V2.setScalarValue;Mz.stringify=Lz.stringify;Mz.visit=Oz.visit;Mz.BOM=B2;Mz.DOCUMENT=W2;Mz.FLOW_END=_2;Mz.SCALAR=F2;Mz.isCollection=Iz;Mz.isScalar=Rz;Mz.prettyToken=Kz;Mz.tokenType=Az});var L2=R((uz)=>{var $q=cq();function p(q){switch(q){case void 0:case" ":case`
|
|
119
|
+
`:case"\r":case"\t":return!0;default:return!1}}var y9=new Set("0123456789ABCDEFabcdef"),kz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),iq=new Set(",[]{}"),hz=new Set(` ,[]{}
|
|
120
|
+
\r `),T2=(q)=>!q||hz.has(q);class x9{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(!$||$==="#"||$===`
|
|
121
121
|
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
122
122
|
`;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 X=this.buffer[Z+q+1];if(X===`
|
|
123
123
|
`||!X&&!this.atEnd)return q+Z+1}return $===`
|
|
124
124
|
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&p(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(`
|
|
125
|
-
`,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]===$q.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let z=q[Z-1];if(z===" "||z==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let z=q[$-1];if(z===" "||z==="\t")$-=1;else break}let X=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield $q.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(($==="---"||$==="...")&&p(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&&!p(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===":")&&p($)){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(
|
|
125
|
+
`,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]===$q.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let z=q[Z-1];if(z===" "||z==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let z=q[$-1];if(z===" "||z==="\t")$-=1;else break}let X=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield $q.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(($==="---"||$==="...")&&p(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&&!p(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===":")&&p($)){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(T2),"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 X=this.getLine();if(X===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&X[0]!=="#"||Z===0&&(X.startsWith("---")||X.startsWith("..."))&&p(X[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield $q.FLOW_END,yield*this.parseLineStart()}let z=0;while(X[z]===",")z+=yield*this.pushCount(1),z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(z+=yield*this.pushIndicators(),X[z]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-z),"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(T2),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||p(U)||U===",")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 z=0;while(this.buffer[$-1-z]==="\\")z+=1;if(z%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),X=Z.indexOf(`
|
|
126
126
|
`,this.pos);if(X!==-1){while(X!==-1){let z=this.continueScalar(X+1);if(z===-1)break;X=Z.indexOf(`
|
|
127
127
|
`,z)}if(X!==-1)$=X-(Z[X-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(($)=>p($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let z=this.pos;Z=this.buffer[z];++z)switch(Z){case" ":$+=1;break;case`
|
|
128
128
|
`:q=z,$=0;break;case"\r":{let U=this.buffer[z+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
|
|
@@ -132,27 +132,30 @@ ${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.pus
|
|
|
132
132
|
`&&z>=this.pos&&z+1+$>Q)q=z;else break}while(!0);return yield $q.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,Z=this.pos-1,X;while(X=this.buffer[++Z])if(X===":"){let z=this.buffer[Z+1];if(p(z)||q&&iq.has(z))break;$=Z}else if(p(X)){let z=this.buffer[Z+1];if(X==="\r")if(z===`
|
|
133
133
|
`)Z+=1,X=`
|
|
134
134
|
`,z=this.buffer[Z+1];else $=Z;if(z==="#"||q&&iq.has(z))break;if(X===`
|
|
135
|
-
`){let U=this.continueScalar(Z+1);if(U===-1)break;Z=Math.max(Z,U-2)}}else{if(q&&iq.has(X))break;$=Z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield $q.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(
|
|
135
|
+
`){let U=this.continueScalar(Z+1);if(U===-1)break;Z=Math.max(Z,U-2)}}else{if(q&&iq.has(X))break;$=Z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield $q.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(T2))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(p($)||q&&iq.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(!p($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(kz.has($))$=this.buffer[++q];else if($==="%"&&y9.has(this.buffer[q+1])&&y9.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===`
|
|
136
136
|
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
137
|
-
`)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 X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}
|
|
137
|
+
`)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 X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}uz.Lexer=x9});var O2=R((mz)=>{class g9{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let z=$+Z>>1;if(this.lineStarts[z]<q)$=z+1;else Z=z}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let X=this.lineStarts[$-1];return{line:$,col:q-X+1}}}}mz.LineCounter=g9});var I2=R((cz)=>{var pz=g("process"),k9=cq(),lz=L2();function Q0(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function h9(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function v9(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 aq(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 C0(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 u9(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!Q0($.start,"explicit-key-ind")&&!Q0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,v9($.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 m9{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 lz.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,pz.env.LOG_TOKENS)console.log("|",k9.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=k9.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")u9($);switch(Z.type){case"document":Z.value=$;break;case"block-scalar":Z.props.push($);break;case"block-map":{let X=Z.items[Z.items.length-1];if(X.value){Z.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=$;else{Object.assign(X,{key:$,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=Z.items[Z.items.length-1];if(X.value)Z.items.push({start:[],value:$});else X.value=$;break}case"flow-collection":{let X=Z.items[Z.items.length-1];if(!X||X.value)Z.items.push({start:[],key:$,sep:[]});else if(X.sep)X.value=$;else Object.assign(X,{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 X=$.items[$.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&h9(X.start)===-1&&($.indent===0||X.start.every((z)=>z.type!=="comment"||z.indent<$.indent))){if(Z.type==="document")Z.end=X.start;else Z.items.push({start:X.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(h9(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 $=aq(this.peek(2)),Z=C0($),X;if(q.end)X=q.end,X.push(this.sourceToken),delete q.end;else X=[this.sourceToken];let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}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(`
|
|
138
138
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
139
|
-
`,$)+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 X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.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,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",z=[];if(X&&$.sep&&!$.value){let U=[];for(let Q=0;Q<$.sep.length;++Q){let J=$.sep[Q];switch(J.type){case"newline":U.push(Q);break;case"space":break;case"comment":if(J.indent>q.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)z=$.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(X||$.value)z.push(this.sourceToken),q.items.push({start:z}),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(X||$.value)z.push(this.sourceToken),q.items.push({start:z,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(Q0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let U=C0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(
|
|
139
|
+
`,$)+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 X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.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,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",z=[];if(X&&$.sep&&!$.value){let U=[];for(let Q=0;Q<$.sep.length;++Q){let J=$.sep[Q];switch(J.type){case"newline":U.push(Q);break;case"space":break;case"comment":if(J.indent>q.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)z=$.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(X||$.value)z.push(this.sourceToken),q.items.push({start:z}),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(X||$.value)z.push(this.sourceToken),q.items.push({start:z,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(Q0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let U=C0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(v9($.key)&&!Q0($.sep,"newline")){let U=C0($.start),Q=$.key,J=$.sep;J.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:Q,sep:J}]})}else if(z.length>0)$.sep=$.sep.concat(z,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||X)q.items.push({start:z,key:null,sep:[this.sourceToken]});else if(Q0($.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 U=this.flowScalar(this.type);if(X||$.value)q.items.push({start:z,key:U,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(U);else Object.assign($,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue(q);if(U){if(U.type==="block-seq"){if(!$.explicitKey&&$.sep&&!Q0($.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:z});this.stack.push(U);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 X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.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||Q0($.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 X=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:X,sep:[]});else if($.sep)this.stack.push(X);else Object.assign($,{key:X,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 X=aq(Z),z=C0(X);u9(q);let U=q.end.splice(1,q.end.length);U.push(this.sourceToken);let Q={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]=Q}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
140
140
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
141
|
-
`,$)+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 $=aq(q),Z=C0($);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 $=aq(q),Z=C0($);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()}}}
|
|
142
|
-
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}var
|
|
141
|
+
`,$)+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 $=aq(q),Z=C0($);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 $=aq(q),Z=C0($);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()}}}cz.Parser=m9});var i9=R((qU)=>{var d9=G2(),az=o0(),Zq=r0(),sz=O$(),nz=N(),oz=O2(),p9=I2();function l9(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new oz.LineCounter||null,prettyErrors:$}}function rz(q,$={}){let{lineCounter:Z,prettyErrors:X}=l9($),z=new p9.Parser(Z?.addNewLine),U=new d9.Composer($),Q=Array.from(U.compose(z.parse(q)));if(X&&Z)for(let J of Q)J.errors.forEach(Zq.prettifyError(q,Z)),J.warnings.forEach(Zq.prettifyError(q,Z));if(Q.length>0)return Q;return Object.assign([],{empty:!0},U.streamInfo())}function c9(q,$={}){let{lineCounter:Z,prettyErrors:X}=l9($),z=new p9.Parser(Z?.addNewLine),U=new d9.Composer($),Q=null;for(let J of U.compose(z.parse(q),!0,q.length))if(!Q)Q=J;else if(Q.options.logLevel!=="silent"){Q.errors.push(new Zq.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&Z)Q.errors.forEach(Zq.prettifyError(q,Z)),Q.warnings.forEach(Zq.prettifyError(q,Z));return Q}function tz(q,$,Z){let X=void 0;if(typeof $==="function")X=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let z=c9(q,Z);if(!z)return null;if(z.warnings.forEach((U)=>sz.warn(z.options.logLevel,U)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:X},Z))}function ez(q,$,Z){let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let z=Math.round(Z);Z=z<1?void 0:z>8?{indent:8}:{indent:z}}if(q===void 0){let{keepUndefined:z}=Z??$??{};if(!z)return}if(nz.isDocument(q)&&!X)return q.toString(Z);return new az.Document(q,X,Z).toString(Z)}qU.parse=tz;qU.parseAllDocuments=rz;qU.parseDocument=c9;qU.stringify=ez});import{execFile as f4}from"child_process";import{promisify as y4}from"util";import{mkdtemp as E2,readdir as x4,readFile as X$,rm as Uq,cp as g4,access as $$,stat as k4,lstat as h4,symlink as u4,mkdir as v4}from"fs/promises";import{join as n,relative as m4}from"path";import{tmpdir as f2}from"os";import{readdir as N4,readFile as j4,stat as b4}from"fs/promises";import{join as C4}from"path";var S4=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"]),E4=524288;async function Xq(q){let $=[];async function Z(X,z){let U;try{U=await N4(X)}catch{return}for(let Q of U){if(Q===".git"||Q==="node_modules")continue;let J=C4(X,Q),G=z?`${z}/${Q}`:Q;try{let H=await b4(J);if(H.isDirectory())await Z(J,G);else if(H.isFile()){let _=Q.includes(".")?`.${Q.split(".").pop().toLowerCase()}`:"";if(S4.has(_))continue;if(H.size>E4)continue;try{let Y=await j4(J,"utf-8");$.push({relPath:G,content:Y,lineCount:Y.split(`
|
|
142
|
+
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}var z$=y4(f4),d4=/^[a-zA-Z0-9_-]+$/,p4=/^[a-zA-Z0-9._-]+$/,l4=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,y2=128,c4=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\/tree\/(.+))?\/?$/;function U$(q){let $=c4.exec(q);if($){let[,Y,V,F]=$,O=V.endsWith(".git")?V.slice(0,-4):V;q=`github:${Y}/${O}${F?`#${F}`:""}`}if(!q.startsWith("github:"))throw Error(`Invalid source format. Got: "${q}"
|
|
143
143
|
Supported formats:
|
|
144
144
|
github:owner/repo[#ref]
|
|
145
|
-
|
|
145
|
+
github:owner/repo#ref:path
|
|
146
|
+
https://github.com/owner/repo
|
|
147
|
+
https://github.com/owner/repo/tree/branch/path/to/skill`);let Z=q.slice(7),X=Z.indexOf("#"),z,U=null,Q=null;if(X!==-1){z=Z.slice(0,X);let Y=Z.slice(X+1);if(!Y)throw Error("Invalid source: ref cannot be empty after #");let V=Y.indexOf(":");if(V!==-1){if(U=Y.slice(0,V),!U)throw Error("Invalid source: ref cannot be empty before :");Q=Y.slice(V+1)||null}else U=Y}else z=Z;let J=z.indexOf("/");if(J===-1)throw Error(`Invalid source: format must be github:owner/repo. Got: "${q}"`);let G=z.slice(0,J),H=z.slice(J+1);if(!G)throw Error("Invalid source: owner cannot be empty");if(!H)throw Error("Invalid source: repo cannot be empty");if(!d4.test(G))throw Error(`Invalid source: owner contains invalid characters: "${G}". Allowed: [a-zA-Z0-9_-]`);if(!p4.test(H))throw Error(`Invalid source: repo contains invalid characters: "${H}". Allowed: [a-zA-Z0-9._-]`);let _={owner:G,repo:H,ref:U,subpath:Q,cloneUrl:`https://github.com/${G}/${H}.git`,sshCloneUrl:`git@github.com:${G}/${H}.git`};return x(`install: parsed source -> owner=${G} repo=${H} ref=${U} subpath=${Q}`),_}async function Q$(q){if(q.subpath!==null||!q.ref||!q.ref.includes("/"))return q;try{let{stdout:$}=await z$("git",["ls-remote","--heads","--tags",q.cloneUrl],{timeout:15000}),Z=new Set;for(let z of $.split(`
|
|
148
|
+
`)){let U=z.match(/\trefs\/(?:heads|tags)\/(.+)$/);if(U)Z.add(U[1])}let X=q.ref.split("/");for(let z=1;z<X.length;z++){let U=X.slice(0,z).join("/");if(Z.has(U)){let Q=X.slice(z).join("/");return x(`install: resolved ref="${U}" subpath="${Q}"`),{...q,ref:U,subpath:Q||null}}}}catch($){x(`install: ls-remote failed, treating entire ref as branch: ${$}`)}return q}function Qq(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>y2)throw Error(`Invalid skill name: exceeds maximum length of ${y2} characters`);if(!l4.test(q))throw Error(`Invalid skill name: "${q}" does not match allowed pattern [a-zA-Z0-9][a-zA-Z0-9._-]*`);return q}async function J$(){try{await z$("git",["--version"]),x("install: git available")}catch{throw Error("git is required for installing skills. Install git from https://git-scm.com")}}function i4(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 zq(q){return q.killed?"Clone timed out after 60 seconds":`Clone failed: ${q.stderr||q.message}`}async function q$(q,$,Z){let X=["clone","--depth","1"];if($)X.push("--branch",$);return X.push(q,Z),await z$("git",X,{timeout:60000}),Z}async function G$(q,$="auto"){x(`install: cloning ${q.owner}/${q.repo}${q.ref?` (ref: ${q.ref})`:""} (transport: ${$})`);let Z=await E2(n(f2(),"asm-install-"));if($==="ssh"||$==="https"){let X=$==="ssh"?q.sshCloneUrl:q.cloneUrl;try{return await q$(X,q.ref,Z)}catch(z){throw await t(Z),Error(zq(z))}}try{return await q$(q.cloneUrl,q.ref,Z)}catch(X){if(!i4(X))throw await t(Z),Error(zq(X));x("install: HTTPS clone failed with auth error, retrying with SSH..."),await t(Z);let z=await E2(n(f2(),"asm-install-"));try{return await q$(q.sshCloneUrl,q.ref,z)}catch(U){throw await t(z),Error(`Clone failed with both transports:
|
|
146
149
|
HTTPS: ${zq(X)}
|
|
147
|
-
SSH: ${zq(U)}`)}}}async function E0(q){let $=n(q,"SKILL.md"),Z;try{Z=await X$($,"utf-8")}catch{throw Error("Not a valid skill: SKILL.md not found in repository root")}let X=I0(Z),z=q.split("/").pop()||"unknown",U=X.name||z,Q=X.version||"0.0.0";return x(`install: validated skill "${U}" v${Q}`),{name:U,version:Q,description:(X.description||"").replace(/\s*\n\s*/g," ").trim()}}async function
|
|
148
|
-
`);for(let Q=0;Q<U.length;Q++)for(let{category:J,pattern:G}of
|
|
150
|
+
SSH: ${zq(U)}`)}}}async function E0(q){let $=n(q,"SKILL.md"),Z;try{Z=await X$($,"utf-8")}catch{throw Error("Not a valid skill: SKILL.md not found in repository root")}let X=I0(Z),z=q.split("/").pop()||"unknown",U=X.name||z,Q=X.version||"0.0.0";return x(`install: validated skill "${U}" v${Q}`),{name:U,version:Q,description:(X.description||"").replace(/\s*\n\s*/g," ").trim()}}async function x2(q,$=3){let Z=[];async function X(z,U,Q){let J;try{J=await x4(z)}catch{return}for(let G of J){if(G===".git"||G==="node_modules")continue;let H=n(z,G);try{if(!(await k4(H)).isDirectory())continue}catch{continue}let _=U?`${U}/${G}`:G,Y=Q+1,V=n(H,"SKILL.md");try{let F=await X$(V,"utf-8"),O=I0(F);Z.push({relPath:_,name:O.name||G,version:O.version||"0.0.0",description:(O.description||"").replace(/\s*\n\s*/g," ").trim()})}catch{if(Y<$)await X(H,_,Y)}}}return await X(q,"",0),Z.sort((z,U)=>z.name.localeCompare(U.name)),Z}var a4=[{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 g2(q){let $=[],Z=await Xq(q);for(let{relPath:X,content:z}of Z){let U=z.split(`
|
|
151
|
+
`);for(let Q=0;Q<U.length;Q++)for(let{category:J,pattern:G}of a4)if(G.test(U[Q])){let H=U[Q].trim();$.push({category:J,file:X,line:Q+1,match:H.length>100?H.slice(0,100)+"…":H})}}return $}async function H$(q){let $=`github:${q.source.owner}/${q.source.repo}${q.source.ref?`#${q.source.ref}`:""}${q.source.subpath?`:${q.source.subpath}`:""}`;if(q.force)try{await $$(q.targetDir),await Uq(q.targetDir,{recursive:!0,force:!0})}catch{}let Z=q.sourceDir;try{await g4(Z,q.targetDir,{recursive:!0})}catch(J){throw Error(`Failed to install: ${J.message}`)}let X=n(q.targetDir,".git");try{await Uq(X,{recursive:!0,force:!0})}catch{}x(`install: copied files to ${q.targetDir}`);let z=n(q.targetDir,"SKILL.md");try{await $$(z)}catch{throw Error("Installation verification failed: SKILL.md not found at target")}let U=await X$(z,"utf-8"),Q=I0(U);return{success:!0,path:q.targetDir,name:Q.name||q.skillName,version:Q.version||"0.0.0",provider:q.providerLabel,source:$}}async function k2(q,$){let Z=await H$(q);for(let X of $){if(X.name===q.providerName)continue;let z=Z$(X.global),U=n(z,q.skillName);await v4(z,{recursive:!0});try{if((await h4(U)).isSymbolicLink())await Uq(U);else{x(`install: skipping ${U} — existing non-symlink directory`);continue}}catch{}let Q=m4(z,q.targetDir);await u4(Q,U,"dir"),x(`install: symlinked ${U} -> ${Q}`)}return Z.provider=`All (${$.map((X)=>X.label).join(", ")})`,Z}async function t(q){try{await Uq(q,{recursive:!0,force:!0})}catch{}}async function Jq(q,$,Z){let X=q.providers.filter((Q)=>Q.enabled);if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");if($==="all")return{provider:X.find((J)=>J.name==="agents")||X[0],allProviders:X};if($){let Q=q.providers.find((J)=>J.name===$);if(!Q){let J=q.providers.map((G)=>G.name).join(", ");throw Error(`Unknown provider: "${$}". Valid providers: ${J}, all`)}if(!Q.enabled)throw Error(`Provider "${$}" is disabled. Enable it in your config or choose another provider.`);return{provider:Q,allProviders:null}}if(X.length===1)return{provider:X[0],allProviders:null};if(!Z){let Q=X.map((J)=>J.name).join(", ");throw Error(`--provider is required in non-interactive mode. Available: ${Q}, all`)}console.error(`
|
|
149
152
|
Select a provider:`);for(let Q=0;Q<X.length;Q++)console.error(` ${Q+1}) ${X[Q].label} (${X[Q].name})`);console.error(` ${X.length+1}) All providers (shared .agents/skills/ + symlinks)`),process.stderr.write(`
|
|
150
153
|
Enter number: `);let z=await new Promise((Q)=>{let J="";process.stdin.setEncoding("utf-8"),process.stdin.on("data",(G)=>{if(J+=G,J.includes(`
|
|
151
|
-
`))process.stdin.removeAllListeners("data"),process.stdin.pause(),Q(J.trim())}),process.stdin.resume()}),U=parseInt(z,10)-1;if(U===X.length)return{provider:X.find((J)=>J.name==="agents")||X[0],allProviders:X};if(isNaN(U)||U<0||U>=X.length)throw Error("Invalid selection. Aborting.");return{provider:X[U],allProviders:null}}function
|
|
152
|
-
Use --force to overwrite.`)}catch(Z){if(Z.message?.includes("--force"))throw Z;x(`install: target ${q} — no conflict`)}}import{readFile as
|
|
153
|
-
`),Z=!1,X=!1;for(let z of $){if(z.trim()==="---")if(!Z){Z=!0;continue}else{X=!0;continue}if(X&&z.trim().length>0)return!0}return!1}function
|
|
154
|
+
`))process.stdin.removeAllListeners("data"),process.stdin.pause(),Q(J.trim())}),process.stdin.resume()}),U=parseInt(z,10)-1;if(U===X.length)return{provider:X.find((J)=>J.name==="agents")||X[0],allProviders:X};if(isNaN(U)||U<0||U>=X.length)throw Error("Invalid selection. Aborting.");return{provider:X[U],allProviders:null}}function h2(q,$,Z,X,z,U){let Q=Z$(z.global),J=n(Q,X);return{source:q,tempDir:$,sourceDir:Z,targetDir:J,skillName:X,force:U,providerName:z.name,providerLabel:z.label}}async function u2(q,$){try{if(await $$(q),x(`install: target ${q} — conflict (exists)${$?", force overwrite":""}`),!$)throw Error(`Skill already exists at: ${q}
|
|
155
|
+
Use --force to overwrite.`)}catch(Z){if(Z.message?.includes("--force"))throw Z;x(`install: target ${q} — no conflict`)}}import{readFile as pU}from"fs/promises";import{join as lU}from"path";var UU=G2(),QU=o0(),JU=i$(),R2=r0(),GU=x0(),J0=N(),HU=Z0(),YU=f(),VU=z0(),BU=U0(),DG=cq(),WU=L2(),_U=O2(),FU=I2(),sq=i9(),a9=f0();var TU=UU.Composer,LU=QU.Document,OU=JU.Schema,IU=R2.YAMLError,RU=R2.YAMLParseError,KU=R2.YAMLWarning,AU=GU.Alias,MU=J0.isAlias,DU=J0.isCollection,wU=J0.isDocument,PU=J0.isMap,NU=J0.isNode,jU=J0.isPair,bU=J0.isScalar,CU=J0.isSeq,SU=HU.Pair,EU=YU.Scalar,fU=VU.YAMLMap,yU=BU.YAMLSeq;var xU=WU.Lexer,gU=_U.LineCounter,kU=FU.Parser,K2=sq.parse,hU=sq.parseAllDocuments,uU=sq.parseDocument,vU=sq.stringify,mU=a9.visit,dU=a9.visitAsync;var s9=500;function cU(q){let $=q.split(`
|
|
156
|
+
`),Z=!1,X=!1;for(let z of $){if(z.trim()==="---")if(!Z){Z=!0;continue}else{X=!0;continue}if(X&&z.trim().length>0)return!0}return!1}function iU(q){let $=q.split(`
|
|
154
157
|
`),Z=-1;for(let X=0;X<$.length;X++)if($[X].trim()==="---")if(Z===-1)Z=X+1;else return $.slice(Z,X).join(`
|
|
155
|
-
`);return null}function
|
|
158
|
+
`);return null}function aU(q){let $=iU(q);if($===null)return null;try{return K2($),null}catch(Z){return Z.message||"invalid YAML"}}async function n9(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 X=lU(q.path,"SKILL.md"),z=await pU(X,"utf-8");if(!cU(z))$.push({category:"empty-body",message:"SKILL.md contains only frontmatter with no body content"});let U=aU(z);if(U)$.push({category:"invalid-yaml",message:`SKILL.md has invalid YAML frontmatter: ${U}`})}catch{}let Z=q.fileCount;if(Z!==void 0&&Z>s9)$.push({category:"high-file-count",message:`Skill has ${Z} files (threshold: ${s9})`});return $}function o9(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}));return{version:1,exportedAt:new Date().toISOString(),skills:$}}import{mkdir as sU,writeFile as nU,access as oU}from"fs/promises";import{join as rU}from"path";function tU(q){return`---
|
|
156
159
|
name: ${q}
|
|
157
160
|
version: 0.1.0
|
|
158
161
|
description: ""
|
|
@@ -170,18 +173,18 @@ as instructions for when and how to use this skill.
|
|
|
170
173
|
## Instructions
|
|
171
174
|
|
|
172
175
|
- Step-by-step instructions for the agent
|
|
173
|
-
`}async function
|
|
174
|
-
`)}import{access as
|
|
175
|
-
`);for(let J=0;J<Q.length;J++){let G=Q[J],H=G.trim();for(let
|
|
176
|
-
`)}function
|
|
176
|
+
`}async function r9(q,$){await sU($,{recursive:!0});let Z=rU($,"SKILL.md"),X=tU(q);await nU(Z,X,"utf-8")}async function t9(q){try{return await oU(q),!0}catch{return!1}}import{readdir as eU,stat as qQ}from"fs/promises";import{join as $Q}from"path";async function ZQ(q){let $=0;try{let X=(await eU(q,{recursive:!0})).map(async(U)=>{try{let Q=await qQ($Q(q,U));if(Q.isFile())return Q.size}catch{}return 0});$=(await Promise.all(X)).reduce((U,Q)=>U+Q,0)}catch{}return $}async function $4(q,$){let Z={},X={global:0,project:0},z={},U=q.map(async(G)=>{Z[G.provider]=(Z[G.provider]||0)+1,X[G.scope]++;let H=await ZQ(G.path);return z[G.path]=H,H}),J=(await Promise.all(U)).reduce((G,H)=>G+H,0);return{totalSkills:q.length,byProvider:Z,byScope:X,totalDiskBytes:J,perSkillDiskBytes:z,duplicateGroups:$.duplicateGroups.length,duplicateInstances:$.totalDuplicateInstances}}function XQ(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 A2(q,$,Z=20){let X=Math.round(q/$*Z),z=Z-X;return W.green("#".repeat(X))+W.dim("-".repeat(z))}var e9={claude:"Claude Code",codex:"Codex",openclaw:"OpenClaw",agents:"Agents"};function Z4(q){let $=[];$.push(""),$.push(W.blueBold(" Skill Statistics")),$.push(W.dim(" "+"-".repeat(20))),$.push(""),$.push(` ${W.bold("Total:")} ${W.cyan(String(q.totalSkills))} skills`),$.push(` ${W.bold("Disk:")} ${W.cyan(XQ(q.totalDiskBytes))}`),$.push(""),$.push(W.bold(" By Provider"));let Z=Object.entries(q.byProvider).sort((G,H)=>H[1]-G[1]),X=Math.max(...Z.map(([,G])=>G)),z=Math.max(...Z.map(([G])=>(e9[G]||G).length));for(let[G,H]of Z){let _=e9[G]||G,Y=q4(G,_.padEnd(z)),V=String(H).padStart(4);$.push(` ${Y} ${V} ${A2(H,X)}`)}$.push(""),$.push(W.bold(" By Scope"));let U=Math.max(q.byScope.global,q.byScope.project),Q=String(q.byScope.global).padStart(4),J=String(q.byScope.project).padStart(4);if($.push(` ${"global ".padEnd(z)} ${Q} ${A2(q.byScope.global,U)}`),$.push(` ${"project".padEnd(z)} ${J} ${A2(q.byScope.project,U)}`),$.push(""),$.push(W.bold(" Duplicates")),q.duplicateGroups>0)$.push(` ${W.yellow(`${q.duplicateGroups} group(s), ${q.duplicateInstances} total instance(s)`)}`),$.push(W.dim(` Run ${W.bold("asm audit")} to review`));else $.push(` ${W.green("None")}`);return $.push(""),$.join(`
|
|
177
|
+
`)}import{access as zQ,lstat as UQ,readFile as QQ,rm as JQ,symlink as GQ}from"fs/promises";import{join as X4}from"path";async function z4(q){let $;try{$=await UQ(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=X4(q,"SKILL.md"),X;try{X=await QQ(Z,"utf-8")}catch{throw Error(`No SKILL.md found in ${q}`)}let z=I0(X);if(!z.name)throw Error(`Invalid SKILL.md in ${q}: missing "name" in frontmatter`);return{name:z.name,version:z.version||"0.0.0"}}async function nq(q,$,Z,X){let z=X4($,Z),U=!1;try{await zQ(z),U=!0}catch{}if(U){if(!X)throw Error(`Target already exists: ${z}. Use --force to overwrite.`);await JQ(z,{recursive:!0,force:!0})}await GQ(q,z,"dir")}var J4=[{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 HQ(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 X=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(!X.ok)return Z.fetchError=`GitHub API returned ${X.status}`,Z;let z=await X.json();if(Z.isOrganization=z.type==="Organization",Z.publicRepos=typeof z.public_repos==="number"?z.public_repos:null,typeof z.created_at==="string"){let U=new Date(z.created_at),Q=new Date,J=Math.floor((Q.getTime()-U.getTime())/31557600000),G=Math.floor((Q.getTime()-U.getTime())%31557600000/2630016000.0000005);Z.accountAge=J>0?`${J}y ${G}m`:`${G}m`}x(`security-audit: source analysis for ${q} -> repos=${Z.publicRepos}, org=${Z.isOrganization}, age=${Z.accountAge}`)}catch(X){Z.fetchError=X.message||"Failed to fetch GitHub profile",x(`security-audit: source analysis failed -> ${Z.fetchError}`)}return Z}function YQ(q){let $=new Map;for(let{relPath:z,content:U}of q){let Q=U.split(`
|
|
178
|
+
`);for(let J=0;J<Q.length;J++){let G=Q[J],H=G.trim();for(let _ of J4)if(_.pattern.test(G)){let Y=_.category;if(!$.has(Y))$.set(Y,{description:_.description,matches:[]});let V=H.length>120?H.slice(0,120)+"...":H;$.get(Y).matches.push({file:z,line:J+1,match:V,severity:_.severity})}}}let Z=[];for(let[z,U]of $)Z.push({category:z,description:U.description,matches:U.matches});let X={critical:0,warning:1,info:2};return Z.sort((z,U)=>{let Q=Math.min(...z.matches.map((G)=>X[G.severity])),J=Math.min(...U.matches.map((G)=>X[G.severity]));return Q-J}),Z}function VQ(q){let $=new Map;for(let U of q)for(let Q of U.matches)for(let J of J4)if(J.permissionType&&J.category===U.category&&J.pattern.test(Q.match)){let G=J.permissionType;if(!$.has(G))$.set(G,{evidence:[],categories:new Set});let H=$.get(G);H.evidence.push({file:Q.file,line:Q.line,match:Q.match}),H.categories.add(U.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."},X=[];for(let[U,Q]of $)X.push({type:U,evidence:Q.evidence,reason:Z[U]});let z={shell:0,"code-execution":1,network:2,filesystem:3,environment:4};return X.sort((U,Q)=>(z[U.type]??99)-(z[Q.type]??99)),X}function BQ(q,$,Z){let X=0,z=0;for(let G of q)for(let H of G.matches){if(H.severity==="critical")X++;if(H.severity==="warning")z++}let U=$.some((G)=>G.type==="shell"),Q=$.some((G)=>G.type==="code-execution"),J=$.some((G)=>G.type==="network");if(U&&J)return{verdict:"dangerous",reason:"Skill has both shell execution and network access -- potential data exfiltration risk."};if(Q&&J)return{verdict:"dangerous",reason:"Skill has dynamic code execution and network access -- potential remote code execution risk."};if(X>=10)return{verdict:"dangerous",reason:`${X} critical findings detected. High concentration of risky patterns.`};if(U||Q)return{verdict:"warning",reason:U?"Skill executes shell commands. Review commands carefully before installing.":"Skill uses dynamic code execution. Review usage carefully."};if(X>0)return{verdict:"warning",reason:`${X} critical finding${X>1?"s":""} detected. Manual review recommended.`};if(z>0)return{verdict:"caution",reason:`${z} warning${z>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 rq(q,$,Z,X){x(`security-audit: scanning ${q}`);let z=await Xq(q),U=z.reduce((Y,V)=>Y+V.lineCount,0),Q=null;if(Z&&X)Q=await HQ(Z,X);let J=YQ(z),G=VQ(J),{verdict:H,reason:_}=BQ(J,G,Q);return{scannedAt:new Date().toISOString(),skillName:$,skillPath:q,source:Q,codeScans:J,permissions:G,totalFiles:z.length,totalLines:U,verdict:H,verdictReason:_}}var D=W,T0=56,WQ={"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"},U4={critical:0,warning:1,info:2};function _Q(q){switch(q){case"safe":return D.bgGreen(" SAFE ");case"caution":return D.bgCyan(" CAUTION ");case"warning":return D.bgYellow(" WARNING ");case"dangerous":return D.bgRed(" DANGEROUS ")}}function FQ(q){switch(q){case"safe":return D.green;case"caution":return D.cyan;case"warning":return D.yellow;case"dangerous":return D.red}}function S0(q){switch(q){case"critical":return D.red("!!");case"warning":return D.yellow(" !");case"info":return D.dim(" i")}}function M2(q,$){return q.length>$?q.slice(0,$-3)+"...":q}function oq(q){return q.toLocaleString("en-US")}function G4(q){return q.replace(/\x1b\[[0-9;]*m/g,"")}function Q4(q){return G4(q).length}function TQ(q){let $=new Map;for(let Z of q){let X=`${Z.file}:${Z.line}`,z=$.get(X);if(!z||U4[Z.severity]<U4[z.severity])$.set(X,Z)}return Array.from($.values())}function LQ(q){let $=new Map;for(let Z of q){let X=$.get(Z.file);if(!X)X={file:Z.file,entries:[]},$.set(Z.file,X);X.entries.push({line:Z.line,match:Z.match,severity:Z.severity})}return Array.from($.values())}function tq(q){let $=[],Z=_Q(q.verdict),X=G4(Z),z=` ${D.bold(q.skillName)}`,U=` ${q.skillName}`,Q=T0-4,J=Math.max(1,Q-U.length-X.length);if($.push(""),$.push(D.dim(" +-- ")+D.bold("Security Audit")+D.dim(" "+"-".repeat(T0-19)+"+")),$.push(D.dim(" |")+z+" ".repeat(J)+Z+D.dim("|")),$.push(D.dim(" |")+D.dim(` ${oq(q.totalFiles)} files | ${oq(q.totalLines)} lines`)+" ".repeat(Math.max(1,Q-` ${oq(q.totalFiles)} files | ${oq(q.totalLines)} lines`.length))+D.dim("|")),$.push(D.dim(" +"+"-".repeat(T0-2)+"+")),q.source){let Y=q.source;if(Y.fetchError)$.push(` ${D.yellow("!")} Could not fetch profile: ${Y.fetchError}`);else{let V=[];if(V.push(`${Y.owner} ${Y.isOrganization?D.cyan("(org)"):D.dim("(user)")}`),Y.publicRepos!==null){let F=Y.publicRepos,O=F<3?D.yellow(`${F} repos`):F<10?D.cyan(`${F} repos`):D.green(`${F} repos`);V.push(O)}if(Y.accountAge)V.push(Y.accountAge);$.push(` ${D.dim("Author:")} ${V.join(D.dim(" | "))}`)}}if($.push(""),q.codeScans.length===0)$.push(` ${D.green("*")} ${D.green("No suspicious patterns detected.")}`);else{let Y=FQ(q.verdict),V=q.verdict==="dangerous"||q.verdict==="warning"?S0("critical"):q.verdict==="caution"?S0("warning"):S0("info");$.push(` ${V} ${Y(q.verdictReason)}`);let F=0,O=0,B=0;for(let K of q.codeScans)for(let M of K.matches)if(M.severity==="critical")F++;else if(M.severity==="warning")O++;else B++;let T=[];if(F>0)T.push(D.red(`${F} critical`));if(O>0)T.push(D.yellow(`${O} warning`));if(B>0)T.push(D.dim(`${B} info`));let L=q.permissions.map((K)=>K.type),I=L.length>0?D.dim(`Perms: ${L.join(", ")}`):"";$.push(` ${T.join(D.dim(" | "))} ${I}`)}if($.push(""),q.codeScans.length>0){$.push(` ${D.bold("Findings")}`),$.push(D.dim(" "+"=".repeat(T0-2)));for(let Y of q.codeScans){let V=TQ(Y.matches),F=V.filter((b)=>b.severity==="critical").length,O=V.filter((b)=>b.severity==="warning").length,B=V.filter((b)=>b.severity==="info").length,T=F>0?S0("critical"):O>0?S0("warning"):S0("info"),L=[];if(F>0)L.push(D.red(`${F} critical`));if(O>0)L.push(D.yellow(`${O} warning`));if(B>0)L.push(D.dim(`${B} info`));let I=WQ[Y.category],K=I?D.dim(`PERM: ${I}`):"",M=` ${T} ${D.bold(Y.category)} (${L.join(", ")})`;if(K){let b=Q4(M),u=Q4(K),C=Math.max(2,T0-b-u);$.push(M+" ".repeat(C)+K)}else $.push(M);let w=LQ(V),P=Math.min(24,Math.max(...w.map((b)=>b.file.length))),j=0,A=3;for(let b of w){if(j>=A)break;let u=M2(b.file,24),C=D.dim(u.padEnd(P));if(b.entries.length===1){let s=b.entries[0],O0=M2(s.match,50);$.push(` ${C} :${s.line} ${D.dim("--")} ${s.severity==="critical"?O0:D.dim(O0)}`),j++}else if(b.entries.length<=3){let s=b.entries.map((eq)=>`:${eq.line}`).join(", "),O0=M2(b.entries[0].match,40);$.push(` ${C} ${s} ${D.dim("--")} ${D.dim(O0)}`),j++}else{let O0=b.entries.slice(0,3).map((P4)=>`:${P4.line}`).join(", "),eq=b.entries.length-3;$.push(` ${C} ${O0} ${D.dim(`(+${eq} more)`)}`),j++}}let E=w.length-Math.min(w.length,A);if(E>0){let b=V.length-w.slice(0,A).reduce((u,C)=>u+C.entries.length,0);if(b>0)$.push(` ${D.dim(`... ${b} more in ${E} file${E>1?"s":""}`)}`)}$.push("")}}$.push(D.dim(" "+"=".repeat(T0-2)));let G=new Date(q.scannedAt),H=`${G.getFullYear()}-${String(G.getMonth()+1).padStart(2,"0")}-${String(G.getDate()).padStart(2,"0")} ${String(G.getHours()).padStart(2,"0")}:${String(G.getMinutes()).padStart(2,"0")}`,_=q.source&&!q.source.fetchError?`github.com/${q.source.owner}`:"";if(_){let Y=Math.max(2,T0-2-H.length-_.length);$.push(D.dim(` ${H}${" ".repeat(Y)}${_}`))}else $.push(D.dim(` ${H}`));return $.push(""),$.join(`
|
|
179
|
+
`)}function D2(q){return JSON.stringify(q,null,2)}function OQ(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"}},X=0;while(X<$.length){let z=$[X];if(z==="--help"||z==="-h")Z.flags.help=!0;else if(z==="--version"||z==="-v")Z.flags.version=!0;else if(z==="--json")Z.flags.json=!0;else if(z==="--yes"||z==="-y")Z.flags.yes=!0;else if(z==="--no-color")Z.flags.noColor=!0;else if(z==="--scope"||z==="-s"){X++;let U=$[X];if(U==="global"||U==="project"||U==="both")Z.flags.scope=U;else S(`Invalid scope: "${U}". Must be global, project, or both.`),process.exit(2)}else if(z==="--sort"){X++;let U=$[X];if(U==="name"||U==="version"||U==="location")Z.flags.sort=U;else S(`Invalid sort: "${U}". Must be name, version, or location.`),process.exit(2)}else if(z==="--provider"||z==="-p")X++,Z.flags.provider=$[X]||null;else if(z==="--name")X++,Z.flags.name=$[X]||null;else if(z==="--force"||z==="-f")Z.flags.force=!0;else if(z==="--path")X++,Z.flags.path=$[X]||null;else if(z==="--all")Z.flags.all=!0;else if(z==="--verbose"||z==="-V")Z.flags.verbose=!0;else if(z==="--flat")Z.flags.flat=!0;else if(z==="--transport"||z==="-t"){X++;let U=$[X];if(U==="https"||U==="ssh"||U==="auto")Z.flags.transport=U;else S(`Invalid transport: "${U}". Must be https, ssh, or auto.`),process.exit(2)}else if(z.startsWith("-"))S(`Unknown option: ${z}`),console.error('Run "asm --help" for usage.'),process.exit(2);else if(!Z.command)Z.command=z;else if(!Z.subcommand)Z.subcommand=z;else Z.positional.push(z);X++}return Z}function S(q){console.error(W.red(`Error: ${q}`))}function IQ(){console.log(`${W.blueBold("agent-skill-manager")} (${W.bold("asm")}) ${S2}
|
|
177
180
|
|
|
178
181
|
Interactive TUI and CLI for managing installed skills for AI coding agents.
|
|
179
182
|
|
|
180
|
-
${
|
|
183
|
+
${W.bold("Usage:")}
|
|
181
184
|
asm Launch interactive TUI
|
|
182
185
|
asm <command> [options] Run a CLI command
|
|
183
186
|
|
|
184
|
-
${
|
|
187
|
+
${W.bold("Commands:")}
|
|
185
188
|
list List all discovered skills
|
|
186
189
|
search <query> Search skills by name/description/provider
|
|
187
190
|
inspect <skill-name> Show detailed info for a skill
|
|
@@ -198,7 +201,7 @@ ${B.bold("Commands:")}
|
|
|
198
201
|
config reset Reset config to defaults
|
|
199
202
|
config edit Open config in $EDITOR
|
|
200
203
|
|
|
201
|
-
${
|
|
204
|
+
${W.bold("Global Options:")}
|
|
202
205
|
-h, --help Show help for any command
|
|
203
206
|
-v, --version Print version and exit
|
|
204
207
|
--json Output as JSON (list, search, inspect)
|
|
@@ -208,12 +211,12 @@ ${B.bold("Global Options:")}
|
|
|
208
211
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
209
212
|
--flat Show one row per provider instance (list, search)
|
|
210
213
|
-y, --yes Skip confirmation prompts
|
|
211
|
-
-V, --verbose Show debug output`)}function
|
|
214
|
+
-V, --verbose Show debug output`)}function RQ(){console.log(`${W.bold("Usage:")} asm list [options]
|
|
212
215
|
|
|
213
216
|
List all discovered skills. By default, skills installed across multiple
|
|
214
217
|
providers are grouped into a single row with provider badges.
|
|
215
218
|
|
|
216
|
-
${
|
|
219
|
+
${W.bold("Options:")}
|
|
217
220
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
218
221
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
219
222
|
-p, --provider <p> Filter by provider (claude, codex, openclaw, agents)
|
|
@@ -222,18 +225,18 @@ ${B.bold("Options:")}
|
|
|
222
225
|
--no-color Disable ANSI colors
|
|
223
226
|
-V, --verbose Show debug output
|
|
224
227
|
|
|
225
|
-
${
|
|
226
|
-
asm list ${
|
|
227
|
-
asm list --flat ${
|
|
228
|
-
asm list -p claude ${
|
|
229
|
-
asm list -s project ${
|
|
230
|
-
asm list --sort version ${
|
|
231
|
-
asm list --json ${
|
|
228
|
+
${W.bold("Examples:")}
|
|
229
|
+
asm list ${W.dim("List all skills (grouped)")}
|
|
230
|
+
asm list --flat ${W.dim("One row per provider instance")}
|
|
231
|
+
asm list -p claude ${W.dim("Only Claude Code skills")}
|
|
232
|
+
asm list -s project ${W.dim("Only project-scoped skills")}
|
|
233
|
+
asm list --sort version ${W.dim("Sort by version")}
|
|
234
|
+
asm list --json ${W.dim("Output as JSON")}`)}function KQ(){console.log(`${W.bold("Usage:")} asm search <query> [options]
|
|
232
235
|
|
|
233
236
|
Search skills by name, description, or provider. Matching terms are
|
|
234
237
|
highlighted in the output.
|
|
235
238
|
|
|
236
|
-
${
|
|
239
|
+
${W.bold("Options:")}
|
|
237
240
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
238
241
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
239
242
|
-p, --provider <p> Filter by provider (claude, codex, openclaw, agents)
|
|
@@ -242,96 +245,101 @@ ${B.bold("Options:")}
|
|
|
242
245
|
--no-color Disable ANSI colors
|
|
243
246
|
-V, --verbose Show debug output
|
|
244
247
|
|
|
245
|
-
${
|
|
246
|
-
asm search code ${
|
|
247
|
-
asm search review -p claude ${
|
|
248
|
-
asm search "test" -s global ${
|
|
249
|
-
asm search openspec --json ${
|
|
248
|
+
${W.bold("Examples:")}
|
|
249
|
+
asm search code ${W.dim("Search for 'code' in all fields")}
|
|
250
|
+
asm search review -p claude ${W.dim("Search within Claude Code only")}
|
|
251
|
+
asm search "test" -s global ${W.dim("Search global skills only")}
|
|
252
|
+
asm search openspec --json ${W.dim("Output matches as JSON")}`)}function AQ(){console.log(`${W.bold("Usage:")} asm inspect <skill-name> [options]
|
|
250
253
|
|
|
251
254
|
Show detailed information for a skill. The <skill-name> is the directory name.
|
|
252
255
|
Shows version, description, file count, and all provider installations.
|
|
253
256
|
|
|
254
|
-
${
|
|
257
|
+
${W.bold("Options:")}
|
|
255
258
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
256
259
|
--json Output as JSON object
|
|
257
260
|
--no-color Disable ANSI colors
|
|
258
261
|
-V, --verbose Show debug output
|
|
259
262
|
|
|
260
|
-
${
|
|
261
|
-
asm inspect code-review ${
|
|
262
|
-
asm inspect code-review --json ${
|
|
263
|
-
asm inspect code-review -s global ${
|
|
263
|
+
${W.bold("Examples:")}
|
|
264
|
+
asm inspect code-review ${W.dim("Show details for code-review")}
|
|
265
|
+
asm inspect code-review --json ${W.dim("Output as JSON")}
|
|
266
|
+
asm inspect code-review -s global ${W.dim("Global installations only")}`)}function MQ(){console.log(`${W.bold("Usage:")} asm uninstall <skill-name> [options]
|
|
264
267
|
|
|
265
268
|
Remove a skill and its associated rule files. Shows a removal plan
|
|
266
269
|
before proceeding and asks for confirmation.
|
|
267
270
|
|
|
268
|
-
${
|
|
271
|
+
${W.bold("Options:")}
|
|
269
272
|
-y, --yes Skip confirmation prompt
|
|
270
273
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
271
274
|
--no-color Disable ANSI colors
|
|
272
275
|
-V, --verbose Show debug output
|
|
273
276
|
|
|
274
|
-
${
|
|
275
|
-
asm uninstall code-review ${
|
|
276
|
-
asm uninstall code-review -y ${
|
|
277
|
-
asm uninstall code-review -s project ${
|
|
277
|
+
${W.bold("Examples:")}
|
|
278
|
+
asm uninstall code-review ${W.dim("Remove with confirmation")}
|
|
279
|
+
asm uninstall code-review -y ${W.dim("Remove without confirmation")}
|
|
280
|
+
asm uninstall code-review -s project ${W.dim("Remove project copy only")}`)}function DQ(){console.log(`${W.bold("Usage:")} asm audit [subcommand] [options]
|
|
278
281
|
|
|
279
282
|
Detect duplicate skills or run security audits on installed/remote skills.
|
|
280
283
|
|
|
281
|
-
${
|
|
284
|
+
${W.bold("Subcommands:")}
|
|
282
285
|
duplicates Find duplicate skills (default)
|
|
283
286
|
security <name|source> Run security audit on an installed skill or GitHub source
|
|
284
287
|
|
|
285
|
-
${
|
|
288
|
+
${W.bold("Options:")}
|
|
286
289
|
--json Output as JSON
|
|
287
290
|
-y, --yes Auto-remove duplicates, keeping one instance per group
|
|
288
291
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
289
292
|
--no-color Disable ANSI colors
|
|
290
293
|
-V, --verbose Show debug output
|
|
291
294
|
|
|
292
|
-
${
|
|
293
|
-
asm audit ${
|
|
294
|
-
asm audit -y ${
|
|
295
|
-
asm audit --json ${
|
|
296
|
-
asm audit security code-review ${
|
|
297
|
-
asm audit security github:user/repo ${
|
|
298
|
-
asm audit security --all ${
|
|
299
|
-
asm audit security code-review --json ${
|
|
295
|
+
${W.bold("Examples:")}
|
|
296
|
+
asm audit ${W.dim("Find duplicates")}
|
|
297
|
+
asm audit -y ${W.dim("Auto-remove duplicates")}
|
|
298
|
+
asm audit --json ${W.dim("Output as JSON")}
|
|
299
|
+
asm audit security code-review ${W.dim("Audit an installed skill")}
|
|
300
|
+
asm audit security github:user/repo ${W.dim("Audit a remote skill before installing")}
|
|
301
|
+
asm audit security --all ${W.dim("Audit all installed skills")}
|
|
302
|
+
asm audit security code-review --json ${W.dim("Output audit as JSON")}
|
|
303
|
+
asm audit security https://github.com/user/skills/tree/main/skills/agent-config
|
|
304
|
+
${W.dim("Audit a skill from a subfolder URL")}`)}function wQ(){console.log(`${W.bold("Usage:")} asm config <subcommand>
|
|
300
305
|
|
|
301
306
|
Manage configuration. Config is stored at ~/.config/agent-skill-manager/.
|
|
302
307
|
|
|
303
|
-
${
|
|
308
|
+
${W.bold("Subcommands:")}
|
|
304
309
|
show Print current config as JSON
|
|
305
310
|
path Print config file path
|
|
306
311
|
reset Reset config to defaults (with confirmation)
|
|
307
312
|
edit Open config in $EDITOR
|
|
308
313
|
|
|
309
|
-
${
|
|
314
|
+
${W.bold("Options:")}
|
|
310
315
|
-V, --verbose Show debug output
|
|
311
316
|
|
|
312
|
-
${
|
|
313
|
-
asm config show ${
|
|
314
|
-
asm config edit ${
|
|
315
|
-
asm config reset -y ${
|
|
316
|
-
${
|
|
317
|
-
${
|
|
317
|
+
${W.bold("Examples:")}
|
|
318
|
+
asm config show ${W.dim("View current config")}
|
|
319
|
+
asm config edit ${W.dim("Edit in $EDITOR")}
|
|
320
|
+
asm config reset -y ${W.dim("Reset without confirmation")}`)}async function M4(q){for(let $ of q)$.warnings=await n9($)}async function PQ(q){if(q.flags.help){RQ();return}let $=await k(),Z=await a($,q.flags.scope);if(q.flags.provider&&q.command==="list")Z=Z.filter((z)=>z.provider===q.flags.provider);await M4(Z);let X=N2(Z,q.flags.sort);if(q.flags.json)console.log(G0(X));else if(q.flags.flat){let z=b2(X),U=X.filter((Q)=>Q.warnings&&Q.warnings.length>0);if(U.length>0)z+=`
|
|
321
|
+
${W.yellow(`${U.length} skill${U.length===1?"":"s"} with warnings -- use --json for details`)}`;console.log(z)}else console.log(L4(X))}async function NQ(q){if(q.flags.help){KQ();return}let $=q.subcommand;if(!$)S("Missing required argument: <query>"),console.error('Run "asm search --help" for usage.'),process.exit(2);let Z=await k(),X=await a(Z,q.flags.scope);if(q.flags.provider)X=X.filter((Q)=>Q.provider===q.flags.provider);let z=B4(X,$),U=N2(z,q.flags.sort);if(q.flags.json)console.log(G0(U));else if(q.flags.flat)console.log(b2(U));else console.log(O4(U,$))}async function jQ(q){if(q.flags.help){AQ();return}let $=q.subcommand;if(!$)S("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await k(),z=(await a(Z,q.flags.scope)).filter((U)=>U.dirName===$);if(z.length===0)S(`Skill "${$}" not found.`),console.error(W.dim(`Try ${W.bold("asm list")} to see all skills or ${W.bold(`asm search "${$}"`)} to search.`)),process.exit(1);if(await M4(z),q.flags.json)console.log(G0(z.length===1?z[0]:z));else console.log(await I4(z))}async function bQ(q){if(q.flags.help){MQ();return}let $=q.subcommand;if(!$)S("Missing required argument: <skill-name>"),console.error('Run "asm uninstall --help" for usage.'),process.exit(2);let Z=await k(),X=await a(Z,q.flags.scope),z=_4($,X,Z),U=await F4(z);if(U.length===0)S(`Skill "${$}" not found or nothing to remove.`),process.exit(1);console.error(W.bold("Removal plan:"));for(let J of U)console.error(` ${W.red("•")} ${T4(J)}`);if(!q.flags.yes){if(!process.stdin.isTTY)S("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
|
|
322
|
+
${W.bold("Proceed with removal?")} [y/N] `);let J=await L0();if(J.toLowerCase()!=="y"&&J.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Q=await j2(z);for(let J of Q)console.error(J);console.error(W.green(`
|
|
318
323
|
Done.`))}function L0(){return new Promise((q)=>{let $="",Z=!1;function X(){process.stdin.removeListener("data",U),process.stdin.removeListener("end",Q),process.stdin.pause(),clearTimeout(J)}function z(G){if(Z)return;Z=!0,X(),q(G)}function U(G){if($+=G,$.includes(`
|
|
319
|
-
`))z($.trim())}function Q(){z($.trim())}let J=setTimeout(()=>{z($.trim())},30000);process.stdin.setEncoding("utf-8"),process.stdin.on("data",U),process.stdin.on("end",Q),process.stdin.resume()})}async function
|
|
320
|
-
Auto-removing duplicates...`));for(let U of z.duplicateGroups){let Q=
|
|
321
|
-
Done.`))}}async function
|
|
322
|
-
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await
|
|
323
|
-
`);let U=[];for(let Q of z){console.error(` Scanning ${
|
|
324
|
-
Summary:`)),Q.dangerous>0)console.log(` ${
|
|
325
|
-
`);let Q=await rq(U.realPath,U.name);if(q.flags.json)console.log(
|
|
324
|
+
`))z($.trim())}function Q(){z($.trim())}let J=setTimeout(()=>{z($.trim())},30000);process.stdin.setEncoding("utf-8"),process.stdin.on("data",U),process.stdin.on("end",Q),process.stdin.resume()})}async function CQ(q){if(q.flags.help){DQ();return}let $=q.subcommand??"duplicates";if($==="security"){await SQ(q);return}if($!=="duplicates")S(`Unknown audit subcommand: "${$}". Use: duplicates, security`),process.exit(2);let Z=await k(),X=await a(Z,"both"),z=C2(X);if(q.flags.json){console.log(A4(z));return}if(console.log(K4(z)),q.flags.yes&&z.duplicateGroups.length>0){console.error(W.bold(`
|
|
325
|
+
Auto-removing duplicates...`));for(let U of z.duplicateGroups){let Q=R4(U.instances),J=Q[0].path;for(let G=1;G<Q.length;G++){let H=Q[G],_=W4(H,Z),Y=await j2(_,J);for(let V of Y)console.error(V)}}console.error(W.green(`
|
|
326
|
+
Done.`))}}async function SQ(q){let $=q.positional[0];if(q.flags.all)await EQ(q);else if(!$)S(`Missing target. Provide a skill name, GitHub source, or use --all.
|
|
327
|
+
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await fQ(q,$);else await yQ(q,$)}async function EQ(q){let $=await k(),Z=await a($,q.flags.scope);if(Z.length===0){console.log("No skills found to audit.");return}let X=new Set,z=Z.filter((Q)=>{if(X.has(Q.realPath))return!1;return X.add(Q.realPath),!0});console.error(`Auditing ${z.length} skill${z.length>1?"s":""}...
|
|
328
|
+
`);let U=[];for(let Q of z){console.error(` Scanning ${W.bold(Q.name)}...`);let J=await rq(Q.realPath,Q.name);U.push(J)}if(q.flags.json)console.log(JSON.stringify(U,null,2));else{for(let J of U)console.log(tq(J));let Q={safe:0,caution:0,warning:0,dangerous:0};for(let J of U)Q[J.verdict]++;if(console.log(W.bold(`
|
|
329
|
+
Summary:`)),Q.dangerous>0)console.log(` ${W.red(`${Q.dangerous} dangerous`)}`);if(Q.warning>0)console.log(` ${W.yellow(`${Q.warning} warning`)}`);if(Q.caution>0)console.log(` ${Q.caution} caution`);if(Q.safe>0)console.log(` ${W.green(`${Q.safe} safe`)}`);console.log("")}}async function fQ(q,$){let Z=null;try{let X=U$($);await J$(),X=await Q$(X),console.error(`Cloning ${$} for audit...`),Z=await G$(X,q.flags.transport);let{join:z}=await import("path"),U=X.subpath?z(Z,X.subpath):Z,{name:Q}=await E0(U),J=await rq(U,Q,X.owner,X.repo);if(q.flags.json)console.log(D2(J));else console.log(tq(J))}catch(X){S(X.message),process.exit(1)}finally{if(Z)await t(Z)}}async function yQ(q,$){let Z=await k(),z=(await a(Z,q.flags.scope)).filter((J)=>J.dirName===$);if(z.length===0)S(`Skill "${$}" not found. Use "asm list" to see installed skills.`),process.exit(1);let U=z[0];console.error(`Auditing installed skill: ${W.bold(U.name)}...
|
|
330
|
+
`);let Q=await rq(U.realPath,U.name);if(q.flags.json)console.log(D2(Q));else console.log(tq(Q))}async function xQ(q){if(q.flags.help){wQ();return}let $=q.subcommand;if(!$)S("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 k();console.log(G0(Z));break}case"path":{console.log(P2());break}case"reset":{if(!q.flags.yes){if(!process.stdin.isTTY)S("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`${W.bold("Reset config to defaults?")} [y/N] `);let X=await L0();if(X.toLowerCase()!=="y"&&X.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Z=Y4();await V4(Z),console.error(W.green("Config reset to defaults."));break}case"edit":{let Z=process.env.VISUAL||process.env.EDITOR||"vi",X=P2();await k();let{spawn:z}=await import("child_process");await new Promise((U,Q)=>{let J=z(Z,[X],{stdio:"inherit"});J.on("close",()=>U()),J.on("error",Q)});break}default:S(`Unknown config subcommand: "${$}". Use: show, path, reset, or edit.`),process.exit(2)}}function gQ(){console.log(`${W.bold("Usage:")} asm install <source> [options]
|
|
326
331
|
|
|
327
332
|
Install a skill from a GitHub repository.
|
|
328
333
|
|
|
329
|
-
${
|
|
334
|
+
${W.bold("Source Format:")}
|
|
330
335
|
github:owner/repo Install from default branch
|
|
331
336
|
github:owner/repo#ref Install from specific branch or tag
|
|
337
|
+
github:owner/repo#ref:path Install from a subfolder on a specific branch
|
|
332
338
|
https://github.com/owner/repo Install via HTTPS URL
|
|
339
|
+
https://github.com/owner/repo/tree/branch/path/to/skill
|
|
340
|
+
Install from a subfolder URL (auto-detects branch)
|
|
333
341
|
|
|
334
|
-
${
|
|
342
|
+
${W.bold("Options:")}
|
|
335
343
|
-p, --provider <name> Target provider (claude, codex, openclaw, agents, all)
|
|
336
344
|
Use "all" to install to all providers (shared + symlinks)
|
|
337
345
|
--name <name> Override skill directory name
|
|
@@ -345,83 +353,87 @@ ${B.bold("Options:")}
|
|
|
345
353
|
--no-color Disable ANSI colors
|
|
346
354
|
-V, --verbose Show debug output
|
|
347
355
|
|
|
348
|
-
${
|
|
356
|
+
${W.bold("Single-skill repo:")}
|
|
349
357
|
asm install github:user/my-skill
|
|
350
358
|
asm install github:user/my-skill#v1.0.0 -p claude
|
|
351
359
|
asm install https://github.com/user/my-skill
|
|
352
|
-
asm install github:user/my-skill -p all ${
|
|
353
|
-
asm install github:user/private-skill -t ssh ${
|
|
360
|
+
asm install github:user/my-skill -p all ${W.dim("(install to all providers)")}
|
|
361
|
+
asm install github:user/private-skill -t ssh ${W.dim("(clone via SSH)")}
|
|
354
362
|
|
|
355
|
-
${
|
|
363
|
+
${W.bold("Multi-skill repo:")}
|
|
356
364
|
asm install github:user/skills --path skills/code-review
|
|
357
365
|
asm install github:user/skills --all -p claude -y
|
|
358
|
-
asm install github:user/skills --all -p all -y ${
|
|
366
|
+
asm install github:user/skills --all -p all -y ${W.dim("(all skills, all providers)")}
|
|
359
367
|
asm install https://github.com/user/skills --all
|
|
360
|
-
asm install github:user/skills ${
|
|
361
|
-
|
|
362
|
-
${
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
${
|
|
369
|
-
|
|
368
|
+
asm install github:user/skills ${W.dim("(interactive picker)")}
|
|
369
|
+
|
|
370
|
+
${W.bold("Subfolder URL:")}
|
|
371
|
+
asm install https://github.com/user/skills/tree/main/skills/agent-config
|
|
372
|
+
asm install github:user/skills#main:skills/agent-config`)}async function w2(q,$,Z,X,z,U,Q,J,G,H){let _=await E0(z),Y=H!==void 0,V=await g2(z),F=z===X?null:z.split("/").pop(),O=U||F||Z.repo,B=Qq(O),T=h2(Z,X,z,B,J,q.flags.force);if(await u2(T.targetDir,T.force),Y){let L=`[${H.index}/${H.total}]`,I=V.length>0?` ${W.yellow(`(${V.length} warning${V.length>1?"s":""})`)}`:"";console.error(`${W.dim(L)} ${W.bold(_.name)} v${_.version}${I}`)}else{if(console.error(`Found skill: ${_.name} v${_.version}`),console.error(`
|
|
373
|
+
${W.bold("Install preview:")}`),console.error(` Name: ${_.name}`),console.error(` Version: ${_.version}`),_.description)console.error(` Description: ${_.description}`);if(console.error(` Source: ${$}`),G)console.error(` Provider: All (${G.map((L)=>L.label).join(", ")})`),console.error(` Primary: ${J.label} (${J.name})`),console.error(` Symlinks: ${G.filter((L)=>L.name!==J.name).map((L)=>L.label).join(", ")}`);else console.error(` Provider: ${J.label} (${J.name})`);if(console.error(` Target: ${T.targetDir}`),V.length>0){console.error(`
|
|
374
|
+
${W.yellow(W.bold("Security warnings:"))}`);let L=new Map;for(let I of V){let K=L.get(I.category)||[];K.push(I),L.set(I.category,K)}for(let[I,K]of L){console.error(`
|
|
375
|
+
${W.yellow(`[${I}]`)} (${K.length} match${K.length>1?"es":""})`);for(let M of K.slice(0,5))console.error(` ${W.dim(M.file)}:${M.line} -- ${M.match}`);if(K.length>5)console.error(` ... and ${K.length-5} more`)}}if(!q.flags.yes&&!q.flags.all){if(!process.stdin.isTTY)S("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
|
|
376
|
+
${W.bold("Proceed with installation?")} [y/N] `);let L=await L0();if(L.toLowerCase()!=="y"&&L.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}if(!Y)console.error(`
|
|
377
|
+
Installing to ${T.targetDir}...`);if(G)return await k2(T,G);return await H$(T)}async function kQ(q){if(q.flags.help){gQ();return}let $=q.subcommand;if(!$)S("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,X=()=>{if(Z)t(Z).finally(()=>process.exit(1));else process.exit(1)};process.on("SIGINT",X),process.on("SIGTERM",X);try{let z=U$($);await J$(),z=await Q$(z),console.error(`Parsing source: ${$}`);let U=q.flags.transport,Q=U==="ssh"?z.sshCloneUrl:U==="https"?z.cloneUrl:`${z.cloneUrl} (auto)`;console.error(`Cloning ${Q}${z.ref?` (ref: ${z.ref})`:""}${z.subpath?` (path: ${z.subpath})`:""}...`),Z=await G$(z,U);let J=await k(),{provider:G,allProviders:H}=await Jq(J,q.flags.provider,!!process.stdin.isTTY),{join:_}=await import("path"),Y=[],V=q.flags.path||z.subpath;if(V){let F=_(Z,V);try{await E0(F)}catch{throw Error(`No SKILL.md found at path "${V}" in the repository.`)}let O=await w2(q,$,z,Z,F,q.flags.name,J,G,H);Y.push(O)}else{let F=!1;try{await E0(Z),F=!0}catch{}if(F){let O=await w2(q,$,z,Z,Z,q.flags.name,J,G,H);Y.push(O)}else{console.error("No SKILL.md at repository root. Scanning for skills...");let O=await x2(Z);if(O.length===0)throw Error("No skills found in this repository. Skills must have a SKILL.md file.");console.error(`Found ${O.length} skill(s):
|
|
378
|
+
`);for(let L=0;L<O.length;L++)if(console.error(` ${W.bold(`${L+1})`)} ${O[L].name} v${O[L].version} ${W.dim(`(${O[L].relPath})`)}`),O[L].description)console.error(` ${O[L].description}`);let B;if(q.flags.all){if(B=O.map((L)=>L.relPath),console.error(`
|
|
379
|
+
Installing all ${B.length} skills...`),!q.flags.yes){if(!process.stdin.isTTY)S("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
|
|
380
|
+
${W.bold(`Install all ${B.length} skills?`)} [y/N] `);let L=await L0();if(L.toLowerCase()!=="y"&&L.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}else if(process.stdin.isTTY){process.stderr.write(`
|
|
381
|
+
Enter skill number (or "all"): `);let L=await L0();if(L.toLowerCase()==="all")B=O.map((I)=>I.relPath);else{let I=parseInt(L,10)-1;if(isNaN(I)||I<0||I>=O.length)throw Error("Invalid selection. Aborting.");B=[O[I].relPath]}}else S(`Repository contains ${O.length} skills. Use --path <subdir> to pick one or --all to install all.
|
|
370
382
|
Available skills:
|
|
371
|
-
${
|
|
372
|
-
`)}`),process.exit(2);if(
|
|
373
|
-
${
|
|
374
|
-
${
|
|
383
|
+
${O.map((L)=>` --path ${L.relPath}`).join(`
|
|
384
|
+
`)}`),process.exit(2);if(B.length>1){if(console.error(`
|
|
385
|
+
${W.bold("Install settings:")}`),console.error(` Source: ${$}`),H)console.error(` Provider: All (${H.map((L)=>L.label).join(", ")})`),console.error(` Primary: ${G.label} (${G.name})`),console.error(` Symlinks: ${H.filter((L)=>L.name!==G.name).map((L)=>L.label).join(", ")}`);else console.error(` Provider: ${G.label} (${G.name})`);console.error("")}let T=[];for(let L=0;L<B.length;L++){let I=B[L],K=_(Z,I);try{let M=await w2(q,$,z,Z,K,B.length===1?q.flags.name:null,J,G,H,B.length>1?{index:L+1,total:B.length}:void 0);Y.push(M)}catch(M){if(T.push(I),console.error(W.red(` x Failed: ${I} -- ${M.message}`)),B.length===1)throw M}}if(B.length>1&&T.length>0){console.error(`
|
|
386
|
+
${W.yellow(`${T.length} skill(s) failed to install:`)}`);for(let L of T)console.error(` - ${L}`)}}}if(process.removeListener("SIGINT",X),process.removeListener("SIGTERM",X),q.flags.json)console.log(JSON.stringify(Y.length===1?Y[0]:Y,null,2));else if(Y.length===1)console.error(W.green(`
|
|
375
387
|
Done! Installed "${Y[0].name}" to ${Y[0].path}`));else console.error(`
|
|
376
|
-
${
|
|
388
|
+
${W.green(`Done! Installed ${Y.length} skill(s) successfully.`)}`)}catch(z){if(process.removeListener("SIGINT",X),process.removeListener("SIGTERM",X),q.flags.json)console.log(JSON.stringify({success:!1,error:z.message},null,2));else S(z.message);process.exit(1)}finally{if(Z)await t(Z)}}function hQ(){console.log(`${W.bold("Usage:")} asm export [options]
|
|
377
389
|
|
|
378
390
|
Export skill inventory as a portable JSON manifest. Useful for backup,
|
|
379
391
|
sharing, or scripting.
|
|
380
392
|
|
|
381
|
-
${
|
|
393
|
+
${W.bold("Options:")}
|
|
382
394
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
383
395
|
--no-color Disable ANSI colors
|
|
384
396
|
-V, --verbose Show debug output
|
|
385
397
|
|
|
386
|
-
${
|
|
387
|
-
asm export ${
|
|
388
|
-
asm export -s global ${
|
|
389
|
-
asm export > skills.json ${
|
|
398
|
+
${W.bold("Examples:")}
|
|
399
|
+
asm export ${W.dim("Export all skills")}
|
|
400
|
+
asm export -s global ${W.dim("Export global skills only")}
|
|
401
|
+
asm export > skills.json ${W.dim("Save to file")}`)}async function uQ(q){if(q.flags.help){hQ();return}let $=await k(),Z=await a($,q.flags.scope),X=o9(Z);console.log(JSON.stringify(X,null,2))}function vQ(){console.log(`${W.bold("Usage:")} asm init <name> [options]
|
|
390
402
|
|
|
391
403
|
Scaffold a new skill directory with a SKILL.md template. Creates a
|
|
392
404
|
ready-to-edit skill in the target provider's skill folder.
|
|
393
405
|
|
|
394
|
-
${
|
|
406
|
+
${W.bold("Options:")}
|
|
395
407
|
-p, --provider <name> Target provider (claude, codex, openclaw, agents)
|
|
396
408
|
--path <dir> Scaffold in specified directory instead of provider path
|
|
397
409
|
-f, --force Overwrite if skill already exists
|
|
398
410
|
--no-color Disable ANSI colors
|
|
399
411
|
-V, --verbose Show debug output
|
|
400
412
|
|
|
401
|
-
${
|
|
402
|
-
asm init my-skill ${
|
|
403
|
-
asm init my-skill -p claude ${
|
|
404
|
-
asm init my-skill --path ./skills ${
|
|
405
|
-
${
|
|
413
|
+
${W.bold("Examples:")}
|
|
414
|
+
asm init my-skill ${W.dim("Scaffold (interactive provider)")}
|
|
415
|
+
asm init my-skill -p claude ${W.dim("Scaffold in Claude Code")}
|
|
416
|
+
asm init my-skill --path ./skills ${W.dim("Scaffold in custom directory")}`)}async function mQ(q){if(q.flags.help){vQ();return}let $=q.subcommand;if(!$)S("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=Qq($),X;if(q.flags.path){let{resolve:z}=await import("path");X=z(q.flags.path)}else{let z=await k(),{provider:U}=await Jq(z,q.flags.provider,!!process.stdin.isTTY),{join:Q}=await import("path"),{resolveProviderPath:J}=await import("./chunk-wdjcav1v.js"),G=J(z.providers.find((H)=>H.name===U.name).global);X=Q(G,Z)}if(await t9(X)){if(!q.flags.force){if(!process.stdin.isTTY)S(`Directory already exists: ${X}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${W.yellow(`Directory already exists: ${X}`)}
|
|
417
|
+
${W.bold("Overwrite?")} [y/N] `);let z=await L0();if(z.toLowerCase()!=="y"&&z.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}await r9(Z,X),console.error(W.green(`Done! Created skill "${Z}" at ${X}`))}function dQ(){console.log(`${W.bold("Usage:")} asm stats [options]
|
|
406
418
|
|
|
407
419
|
Show aggregate skill metrics with provider distribution charts,
|
|
408
420
|
scope breakdown, disk usage, and duplicate summary.
|
|
409
421
|
|
|
410
|
-
${
|
|
422
|
+
${W.bold("Options:")}
|
|
411
423
|
--json Output as JSON
|
|
412
424
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
413
425
|
--no-color Disable ANSI colors
|
|
414
426
|
-V, --verbose Show debug output
|
|
415
427
|
|
|
416
|
-
${
|
|
417
|
-
asm stats ${
|
|
418
|
-
asm stats -s global ${
|
|
419
|
-
asm stats --json ${
|
|
428
|
+
${W.bold("Examples:")}
|
|
429
|
+
asm stats ${W.dim("Show full dashboard")}
|
|
430
|
+
asm stats -s global ${W.dim("Global skills only")}
|
|
431
|
+
asm stats --json ${W.dim("Output raw data as JSON")}`)}async function pQ(q){if(q.flags.help){dQ();return}let $=await k(),Z=await a($,q.flags.scope);if(Z.length===0){console.log("No skills found.");return}let X=C2(Z),z=await $4(Z,X);if(q.flags.json)if(!q.flags.verbose){let{perSkillDiskBytes:U,...Q}=z;console.log(G0(Q))}else console.log(G0(z));else console.log(Z4(z))}function lQ(){console.log(`${W.bold("Usage:")} asm link <path> [options]
|
|
420
432
|
|
|
421
433
|
Symlink a local skill directory into an agent's skill folder. Useful
|
|
422
434
|
for local development — changes to the source are reflected immediately.
|
|
423
435
|
|
|
424
|
-
${
|
|
436
|
+
${W.bold("Options:")}
|
|
425
437
|
-p, --provider <name> Target provider (claude, codex, openclaw, agents)
|
|
426
438
|
--name <name> Override symlink name (default: directory basename)
|
|
427
439
|
-f, --force Overwrite if target already exists
|
|
@@ -429,8 +441,8 @@ ${B.bold("Options:")}
|
|
|
429
441
|
--no-color Disable ANSI colors
|
|
430
442
|
-V, --verbose Show debug output
|
|
431
443
|
|
|
432
|
-
${
|
|
433
|
-
asm link ./my-skill ${
|
|
434
|
-
asm link ./my-skill -p claude ${
|
|
435
|
-
asm link ./my-skill --name alias ${
|
|
436
|
-
${
|
|
444
|
+
${W.bold("Examples:")}
|
|
445
|
+
asm link ./my-skill ${W.dim("Link (interactive provider)")}
|
|
446
|
+
asm link ./my-skill -p claude ${W.dim("Link to Claude Code")}
|
|
447
|
+
asm link ./my-skill --name alias ${W.dim("Link with custom name")}`)}async function cQ(q){if(q.flags.help){lQ();return}let $=q.subcommand;if(!$)S("Missing required argument: <path>"),console.error('Run "asm link --help" for usage.'),process.exit(2);let{resolve:Z,basename:X}=await import("path"),z=Z($),U=await z4(z),Q=q.flags.name?Qq(q.flags.name):X(z),J=await k(),{provider:G}=await Jq(J,q.flags.provider,!!process.stdin.isTTY),{resolveProviderPath:H}=await import("./chunk-wdjcav1v.js"),_=H(J.providers.find((F)=>F.name===G.name).global),{join:Y}=await import("path"),V=Y(_,Q);if(!q.flags.force){let F=!1;try{let{access:O}=await import("fs/promises");await O(V),F=!0}catch{}if(F){if(!process.stdin.isTTY)S(`Target already exists: ${V}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${W.yellow(`Target already exists: ${V}`)}
|
|
448
|
+
${W.bold("Overwrite?")} [y/N] `);let O=await L0();if(O.toLowerCase()!=="y"&&O.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await nq(z,_,Q,!0)}else await nq(z,_,Q,!1)}else await nq(z,_,Q,!0);if(q.flags.json)console.log(G0({success:!0,name:Q,symlinkPath:V,targetPath:z}));else console.error(W.green(`Done! Linked "${Q}" -> ${z}`)),console.error(` Symlink: ${V}`),console.error(W.dim(` If you move or delete the source, run "asm uninstall ${Q}" to clean up.`))}async function D4(q){let $=OQ(q);if($.flags.noColor)globalThis.__CLI_NO_COLOR=!0;if($.flags.verbose)H4(!0);if($.flags.version){console.log(`asm ${S2}`);return}if(!$.command&&$.flags.help){IQ();return}if(!$.command)return;switch($.command){case"list":await PQ($);break;case"search":await NQ($);break;case"inspect":await jQ($);break;case"uninstall":await bQ($);break;case"audit":await CQ($);break;case"install":await kQ($);break;case"config":await xQ($);break;case"export":await uQ($);break;case"init":await mQ($);break;case"stats":await pQ($);break;case"link":await cQ($);break;default:S(`Unknown command: "${$.command}"`),console.error('Run "asm --help" for usage.'),process.exit(2)}}function w4(q){let $=q.slice(2);if($.length===0)return!1;let Z=["list","search","inspect","uninstall","audit","config","install","export","init","stats","link"],X=$[0];if(Z.includes(X))return!0;if(X==="--help"||X==="-h")return!0;if(X==="--version"||X==="-v")return!0;if(X.startsWith("-")||X.length>0)return!0;return!1}if(w4(process.argv))await D4(process.argv);else await import("./chunk-cwb916ad.js");
|