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