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