agent-skill-manager 1.13.0 → 1.14.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 +11 -1
- package/data/skill-index/Affitor_affiliate-skills.json +97 -1
- package/data/skill-index/Eronred_aso-skills.json +339 -0
- package/data/skill-index/Galaxy-Dawn_claude-scholar.json +526 -0
- package/data/skill-index/Leonxlnx_taste-skill.json +15 -1
- package/data/skill-index/MiniMax-AI_skills.json +21 -1
- package/data/skill-index/affaan-m_everything-claude-code.json +612 -3
- package/data/skill-index/agentskills_agentskills.json +1 -1
- package/data/skill-index/anthropics_skills.json +37 -1
- package/data/skill-index/coreyhaines31_marketingskills.json +67 -1
- package/data/skill-index/himself65_finance-skills.json +97 -0
- package/data/skill-index/kemiljk_fluid-design.json +20 -0
- package/data/skill-index/kepano_obsidian-skills.json +64 -0
- package/data/skill-index/luongnv89_skills.json +71 -1
- package/data/skill-index/mattpocock_skills.json +196 -0
- package/data/skill-index/msitarzewski_agency-agents.json +1 -1
- package/data/skill-index/nextlevelbuilder_ui-ux-pro-max-skill.json +15 -1
- package/data/skill-index/obra_superpowers.json +29 -1
- package/data/skill-index/sickn33_antigravity-awesome-skills.json +2660 -2
- package/data/skill-index/slavingia_skills.json +108 -0
- package/data/skill-index-resources.json +64 -1
- package/dist/agent-skill-manager.js +177 -170
- package/dist/{chunk-6c7f07w3.js → chunk-d8zyhd1t.js} +29 -29
- package/dist/{chunk-hw8kyyg5.js → chunk-gvpf7w25.js} +2 -2
- package/dist/chunk-vhkxjexp.js +3 -0
- package/package.json +2 -1
- package/dist/chunk-1nnaagv9.js +0 -12
- package/dist/chunk-7fa8jt74.js +0 -91
- package/dist/chunk-b7betbzn.js +0 -3
- package/dist/chunk-dykgxxyr.js +0 -3
- package/dist/chunk-es13zqy2.js +0 -91
- package/dist/chunk-f9v15smy.js +0 -91
- package/dist/chunk-gdjc7mam.js +0 -91
- package/dist/chunk-j64gxcw7.js +0 -91
- package/dist/chunk-jfdmhdsr.js +0 -3
- package/dist/chunk-jqby9n90.js +0 -12
- package/dist/chunk-s73mfpjt.js +0 -91
- package/dist/chunk-vvzggdyd.js +0 -12
- package/dist/chunk-xkxs2gj3.js +0 -12
- package/dist/chunk-y008z8jw.js +0 -12
- package/dist/chunk-zdwywb64.js +0 -12
|
@@ -1,161 +1,161 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as
|
|
3
|
-
`)}}
|
|
2
|
+
import{A as e4,B as q8,C as v2,D as $8,a as I0,b as L0,c as a2,e as a,f as d4,g as y2,h as c4,i as l4,j as x2,k as i4,l as H,m as a4,n as O4,o as n4,p as g2,q as s4,r as o4,u as r4,v as h2,w as m,x as k2,y as t4}from"./chunk-gvpf7w25.js";import{E as p,F as M,G as k,H as u4,I as y,J as m4,K as f2,L as S2,M as Hq,N as f4,O as W$,P as v,Q as p4}from"./chunk-vhkxjexp.js";var f=M((v8)=>{var T$=Symbol.for("yaml.alias"),$1=Symbol.for("yaml.document"),Tq=Symbol.for("yaml.map"),Z1=Symbol.for("yaml.pair"),F$=Symbol.for("yaml.scalar"),Fq=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),E8=(q)=>!!q&&typeof q==="object"&&q[t]===T$,f8=(q)=>!!q&&typeof q==="object"&&q[t]===$1,y8=(q)=>!!q&&typeof q==="object"&&q[t]===Tq,x8=(q)=>!!q&&typeof q==="object"&&q[t]===Z1,U1=(q)=>!!q&&typeof q==="object"&&q[t]===F$,g8=(q)=>!!q&&typeof q==="object"&&q[t]===Fq;function X1(q){if(q&&typeof q==="object")switch(q[t]){case Tq:case Fq:return!0}return!1}function h8(q){if(q&&typeof q==="object")switch(q[t]){case T$:case Tq:case F$:case Fq:return!0}return!1}var k8=(q)=>(U1(q)||X1(q))&&!!q.anchor;v8.ALIAS=T$;v8.DOC=$1;v8.MAP=Tq;v8.NODE_TYPE=t;v8.PAIR=Z1;v8.SCALAR=F$;v8.SEQ=Fq;v8.hasAnchor=k8;v8.isAlias=E8;v8.isCollection=X1;v8.isDocument=f8;v8.isMap=y8;v8.isNode=h8;v8.isPair=x8;v8.isScalar=U1;v8.isSeq=g8});var u0=M((Z5)=>{var h=f(),u=Symbol("break visit"),Q1=Symbol("skip children"),s=Symbol("remove node");function Iq(q,$){let Z=z1($);if(h.isDocument(q)){if(R0(null,q.contents,Z,Object.freeze([q]))===s)q.contents=null}else R0(null,q,Z,Object.freeze([]))}Iq.BREAK=u;Iq.SKIP=Q1;Iq.REMOVE=s;function R0(q,$,Z,U){let X=G1(q,$,Z,U);if(h.isNode(X)||h.isPair(X))return J1(q,U,X),R0(q,X,Z,U);if(typeof X!=="symbol"){if(h.isCollection($)){U=Object.freeze(U.concat($));for(let Q=0;Q<$.items.length;++Q){let z=R0(Q,$.items[Q],Z,U);if(typeof z==="number")Q=z-1;else if(z===u)return u;else if(z===s)$.items.splice(Q,1),Q-=1}}else if(h.isPair($)){U=Object.freeze(U.concat($));let Q=R0("key",$.key,Z,U);if(Q===u)return u;else if(Q===s)$.key=null;let z=R0("value",$.value,Z,U);if(z===u)return u;else if(z===s)$.value=null}}return X}async function Lq(q,$){let Z=z1($);if(h.isDocument(q)){if(await M0(null,q.contents,Z,Object.freeze([q]))===s)q.contents=null}else await M0(null,q,Z,Object.freeze([]))}Lq.BREAK=u;Lq.SKIP=Q1;Lq.REMOVE=s;async function M0(q,$,Z,U){let X=await G1(q,$,Z,U);if(h.isNode(X)||h.isPair(X))return J1(q,U,X),M0(q,X,Z,U);if(typeof X!=="symbol"){if(h.isCollection($)){U=Object.freeze(U.concat($));for(let Q=0;Q<$.items.length;++Q){let z=await M0(Q,$.items[Q],Z,U);if(typeof z==="number")Q=z-1;else if(z===u)return u;else if(z===s)$.items.splice(Q,1),Q-=1}}else if(h.isPair($)){U=Object.freeze(U.concat($));let Q=await M0("key",$.key,Z,U);if(Q===u)return u;else if(Q===s)$.key=null;let z=await M0("value",$.value,Z,U);if(z===u)return u;else if(z===s)$.value=null}}return X}function z1(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 G1(q,$,Z,U){if(typeof Z==="function")return Z(q,$,U);if(h.isMap($))return Z.Map?.(q,$,U);if(h.isSeq($))return Z.Seq?.(q,$,U);if(h.isPair($))return Z.Pair?.(q,$,U);if(h.isScalar($))return Z.Scalar?.(q,$,U);if(h.isAlias($))return Z.Alias?.(q,$,U);return}function J1(q,$,Z){let U=$[$.length-1];if(h.isCollection(U))U.items[q]=Z;else if(h.isPair(U))if(q==="key")U.key=Z;else U.value=Z;else if(h.isDocument(U))U.contents=Z;else{let X=h.isAlias(U)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}Z5.visit=Iq;Z5.visitAsync=Lq});var I$=M((J5)=>{var Y1=f(),Q5=u0(),z5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},G5=(q)=>q.replace(/[!,[\]{}]/g,($)=>z5[$]);class d{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},d.defaultYaml,q),this.tags=Object.assign({},d.defaultTags,$)}clone(){let q=new d(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new d(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:d.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},d.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:d.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},d.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 $+G5(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&&Y1.isNode(q.contents)){let X={};Q5.visit(q.contents,(Q,z)=>{if(Y1.isNode(z)&&z.tag)X[z.tag]=!0}),U=Object.keys(X)}else U=[];for(let[X,Q]of Z){if(X==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||U.some((z)=>z.startsWith(Q)))$.push(`%TAG ${X} ${Q}`)}return $.join(`
|
|
3
|
+
`)}}d.defaultYaml={explicit:!1,version:"1.2"};d.defaultTags={"!!":"tag:yaml.org,2002:"};J5.Directives=d});var Kq=M((B5)=>{var H1=f(),H5=u0();function V5(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 V1(q){let $=new Set;return H5.visit(q,{Value(Z,U){if(U.anchor)$.add(U.anchor)}}),$}function W1(q,$){for(let Z=1;;++Z){let U=`${q}${Z}`;if(!$.has(U))return U}}function W5(q,$){let Z=[],U=new Map,X=null;return{onAnchor:(Q)=>{Z.push(Q),X??(X=V1(q));let z=W1($,X);return X.add(z),z},setAnchors:()=>{for(let Q of Z){let z=U.get(Q);if(typeof z==="object"&&z.anchor&&(H1.isScalar(z.node)||H1.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}}B5.anchorIsValid=V5;B5.anchorNames=V1;B5.createNodeAnchors=W5;B5.findNewAnchor=W1});var L$=M((I5)=>{function m0(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=m0(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=m0(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=m0(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=m0(q,U,X,Q);if(z===void 0)delete U[X];else if(z!==Q)U[X]=z}return q.call($,Z,U)}I5.applyReviver=m0});var $0=M((R5)=>{var K5=f();function B1(q,$,Z){if(Array.isArray(q))return q.map((U,X)=>B1(U,String(X),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!K5.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}R5.toJS=B1});var Rq=M((w5)=>{var A5=L$(),_1=f(),D5=$0();class O1{constructor(q){Object.defineProperty(this,_1.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(!_1.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=D5.toJS(this,"",Q);if(typeof U==="function")for(let{count:G,res:J}of Q.anchors.values())U(J,G);return typeof X==="function"?A5.applyReviver(X,{"":z},"",z):z}}w5.NodeBase=O1});var p0=M((S5)=>{var N5=Kq(),j5=u0(),A0=f(),C5=Rq(),b5=$0();class T1 extends C5.NodeBase{constructor(q){super(A0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let Z;if($?.aliasResolveCache)Z=$.aliasResolveCache;else if(Z=[],j5.visit(q,{Node:(X,Q)=>{if(A0.isAlias(Q)||A0.hasAnchor(Q))Z.push(Q)}}),$)$.aliasResolveCache=Z;let U=void 0;for(let X of Z){if(X===this)break;if(X.anchor===this.source)U=X}return U}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:U,maxAliasCount:X}=$,Q=this.resolve(U,$);if(!Q){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=Z.get(Q);if(!z)b5.toJS(Q,null,$),z=Z.get(Q);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=Mq(U,Q,Z);if(z.count*z.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,$,Z){let U=`*${this.source}`;if(q){if(N5.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if(q.implicitKey)return`${U} `}return U}}function Mq(q,$,Z){if(A0.isAlias($)){let U=$.resolve(q),X=Z&&U&&Z.get(U);return X?X.count*X.aliasCount:0}else if(A0.isCollection($)){let U=0;for(let X of $.items){let Q=Mq(q,X,Z);if(Q>U)U=Q}return U}else if(A0.isPair($)){let U=Mq(q,$.key,Z),X=Mq(q,$.value,Z);return Math.max(U,X)}return 1}S5.Alias=T1});var x=M((h5)=>{var f5=f(),y5=Rq(),x5=$0(),g5=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class H0 extends y5.NodeBase{constructor(q){super(f5.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:x5.toJS(this.value,q,$)}toString(){return String(this.value)}}H0.BLOCK_FOLDED="BLOCK_FOLDED";H0.BLOCK_LITERAL="BLOCK_LITERAL";H0.PLAIN="PLAIN";H0.QUOTE_DOUBLE="QUOTE_DOUBLE";H0.QUOTE_SINGLE="QUOTE_SINGLE";h5.Scalar=H0;h5.isScalarValue=g5});var d0=M((c5)=>{var u5=p0(),V0=f(),F1=x(),m5="tag:yaml.org,2002:";function p5(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 d5(q,$,Z){if(V0.isDocument(q))q=q.contents;if(V0.isNode(q))return q;if(V0.isPair(q)){let V=Z.schema[V0.MAP].createNode?.(Z.schema,null,Z);return V.items.push(q),V}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:U,onAnchor:X,onTagObj:Q,schema:z,sourceObjects:G}=Z,J=void 0;if(U&&q&&typeof q==="object")if(J=G.get(q),J)return J.anchor??(J.anchor=X(q)),new u5.Alias(J.anchor);else J={anchor:null,node:null},G.set(q,J);if($?.startsWith("!!"))$=m5+$.slice(2);let Y=p5(q,$,z.tags);if(!Y){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let V=new F1.Scalar(q);if(J)J.node=V;return V}Y=q instanceof Map?z[V0.MAP]:(Symbol.iterator in Object(q))?z[V0.SEQ]:z[V0.MAP]}if(Q)Q(Y),delete Z.onTagObj;let B=Y?.createNode?Y.createNode(Z.schema,q,Z):typeof Y?.nodeClass?.from==="function"?Y.nodeClass.from(Z.schema,q,Z):new F1.Scalar(q);if($)B.tag=$;else if(!Y.default)B.tag=Y.tag;if(J)J.node=B;return B}c5.createNode=d5});var Aq=M((n5)=>{var i5=d0(),o=f(),a5=Rq();function K$(q,$,Z){let U=Z;for(let X=$.length-1;X>=0;--X){let Q=$[X];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let z=[];z[Q]=U,U=z}else U=new Map([[Q,U]])}return i5.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 I1=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class L1 extends a5.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)=>o.isNode(Z)||o.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(I1(q))this.add($);else{let[Z,...U]=q,X=this.get(Z,!0);if(o.isCollection(X))X.addIn(U,$);else if(X===void 0&&this.schema)this.set(Z,K$(this.schema,U,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${U}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let U=this.get($,!0);if(o.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!$&&o.isScalar(X)?X.value:X;else return o.isCollection(X)?X.getIn(U,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!o.isPair($))return!1;let Z=$.value;return Z==null||q&&o.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 o.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(o.isCollection(X))X.setIn(U,$);else if(X===void 0&&this.schema)this.set(Z,K$(this.schema,U,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${U}`)}}}n5.Collection=L1;n5.collectionFromPath=K$;n5.isEmptyPath=I1});var c0=M((qZ)=>{var t5=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function R$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var e5=(q,$,Z)=>q.endsWith(`
|
|
4
4
|
`)?R$(Z,$):Z.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+R$(Z,$):(q.endsWith(" ")?"":" ")+Z;
|
|
7
|
-
`){if(Z==="block")_=
|
|
8
|
-
`&&
|
|
9
|
-
`&&
|
|
10
|
-
${$}${q.slice(0,
|
|
11
|
-
${$}${q.slice(
|
|
12
|
-
`);X
|
|
13
|
-
`){if(
|
|
6
|
+
`+R$(Z,$):(q.endsWith(" ")?"":" ")+Z;qZ.indentComment=R$;qZ.lineComment=e5;qZ.stringifyComment=t5});var R1=M((QZ)=>{function XZ(q,$,Z="flow",{indentAtStart:U,lineWidth:X=80,minContentWidth:Q=20,onFold:z,onOverflow:G}={}){if(!X||X<0)return q;if(X<Q)Q=0;let J=Math.max(1+Q,1+X-$.length);if(q.length<=J)return q;let Y=[],B={},V=X-$.length;if(typeof U==="number")if(U>X-Math.max(2,Q))Y.push(0);else V=X-U;let W=void 0,O=void 0,F=!1,_=-1,T=-1,L=-1;if(Z==="block"){if(_=K1(q,_,$.length),_!==-1)V=_+J}for(let K;K=q[_+=1];){if(Z==="quoted"&&K==="\\"){switch(T=_,q[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}L=_}if(K===`
|
|
7
|
+
`){if(Z==="block")_=K1(q,_,$.length);V=_+$.length+J,W=void 0}else{if(K===" "&&O&&O!==" "&&O!==`
|
|
8
|
+
`&&O!=="\t"){let D=q[_+1];if(D&&D!==" "&&D!==`
|
|
9
|
+
`&&D!=="\t")W=_}if(_>=V)if(W)Y.push(W),V=W+J,W=void 0;else if(Z==="quoted"){while(O===" "||O==="\t")O=K,K=q[_+=1],F=!0;let D=_>L+1?_-2:T-1;if(B[D])return q;Y.push(D),B[D]=!0,V=D+J,W=void 0}else F=!0}O=K}if(F&&G)G();if(Y.length===0)return q;if(z)z();let R=q.slice(0,Y[0]);for(let K=0;K<Y.length;++K){let D=Y[K],w=Y[K+1]||q.length;if(D===0)R=`
|
|
10
|
+
${$}${q.slice(0,w)}`;else{if(Z==="quoted"&&B[D])R+=`${q[D]}\\`;R+=`
|
|
11
|
+
${$}${q.slice(D+1,w)}`}}return R}function K1(q,$,Z){let U=$,X=$+1,Q=q[X];while(Q===" "||Q==="\t")if($<X+Z)Q=q[++$];else{do Q=q[++$];while(Q&&Q!==`
|
|
12
|
+
`);U=$,X=$+1,Q=q[X]}return U}QZ.FOLD_BLOCK="block";QZ.FOLD_FLOW="flow";QZ.FOLD_QUOTED="quoted";QZ.foldFlowLines=XZ});var i0=M((BZ)=>{var l=x(),Z0=R1(),wq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Pq=(q)=>/^(%|---|\.\.\.)/m.test(q);function HZ(q,$,Z){if(!$||$<0)return!1;let U=$-Z,X=q.length;if(X<=U)return!1;for(let Q=0,z=0;Q<X;++Q)if(q[Q]===`
|
|
13
|
+
`){if(Q-z>U)return!0;if(z=Q+1,X-z<=U)return!1}return!0}function l0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:U}=$,X=$.options.doubleQuotedMinMultiLineLength,Q=$.indent||(Pq(q)?" ":""),z="",G=0;for(let J=0,Y=Z[J];Y;Y=Z[++J]){if(Y===" "&&Z[J+1]==="\\"&&Z[J+2]==="n")z+=Z.slice(G,J)+"\\ ",J+=1,G=J,Y="\\";if(Y==="\\")switch(Z[J+1]){case"u":{z+=Z.slice(G,J);let B=Z.substr(J+2,4);switch(B){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(B.substr(0,2)==="00")z+="\\x"+B.substr(2);else z+=Z.substr(J,6)}J+=5,G=J+1}break;case"n":if(U||Z[J+2]==='"'||Z.length<X)J+=1;else{z+=Z.slice(G,J)+`
|
|
14
14
|
|
|
15
15
|
`;while(Z[J+2]==="\\"&&Z[J+3]==="n"&&Z[J+4]!=='"')z+=`
|
|
16
|
-
`,J+=2;if(z+=
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(q))return
|
|
18
|
-
${Z}`)+"'";return $.implicitKey?
|
|
16
|
+
`,J+=2;if(z+=Q,Z[J+2]===" ")z+="\\";J+=1,G=J+1}break;default:J+=1}}return z=G?z+Z.slice(G):Z,U?z:Z0.foldFlowLines(z,Q,Z0.FOLD_QUOTED,wq($,!1))}function M$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return l0(q,$);let Z=$.indent||(Pq(q)?" ":""),U="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${Z}`)+"'";return $.implicitKey?U:Z0.foldFlowLines(U,Z,Z0.FOLD_FLOW,wq($,!1))}function D0(q,$){let{singleQuote:Z}=$.options,U;if(Z===!1)U=l0;else{let X=q.includes('"'),Q=q.includes("'");if(X&&!Q)U=M$;else if(Q&&!X)U=l0;else U=Z?M$:l0}return U(q,$)}var A$;try{A$=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{A$=/\n+(?!\n|$)/g}function Dq({comment:q,type:$,value:Z},X,Q
|
|
21
|
+
|$)`,"g")}catch{A$=/\n+(?!\n|$)/g}function Dq({comment:q,type:$,value:Z},U,X,Q){let{blockQuote:z,commentString:G,lineWidth:J}=U.options;if(!z||/\n[\t ]+$/.test(Z))return D0(Z,U);let Y=U.indent||(U.forceBlockIndent||Pq(Z)?" ":""),B=z==="literal"?!0:z==="folded"||$===l.Scalar.BLOCK_FOLDED?!1:$===l.Scalar.BLOCK_LITERAL?!0:!HZ(Z,J,Y.length);if(!Z)return B?`|
|
|
22
22
|
`:`>
|
|
23
|
-
`;let V,W;for(W=Z.length;W>0;--W){let
|
|
24
|
-
`&&
|
|
25
|
-
`);if(F===-1)V="-";else if(Z===
|
|
26
|
-
`)
|
|
27
|
-
`)
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),
|
|
29
|
-
${Y}${
|
|
30
|
-
${Y}${
|
|
31
|
-
`)||B&&/[[\]{},]/.test(
|
|
32
|
-
`)?D0(
|
|
33
|
-
`))return Dq(q,$,Z,
|
|
34
|
-
${J}`);if(z){let W=(_)=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(V),{compat:
|
|
35
|
-
${$.indent}${G}`}
|
|
36
|
-
${G}:`}else if(
|
|
37
|
-
`:"",
|
|
38
|
-
${
|
|
39
|
-
`&&
|
|
40
|
-
|
|
41
|
-
`}else
|
|
42
|
-
${Z.indent}`}else if(!
|
|
43
|
-
`),
|
|
44
|
-
${Z.indent}`}}else if(
|
|
45
|
-
`)
|
|
23
|
+
`;let V,W;for(W=Z.length;W>0;--W){let w=Z[W-1];if(w!==`
|
|
24
|
+
`&&w!=="\t"&&w!==" ")break}let O=Z.substring(W),F=O.indexOf(`
|
|
25
|
+
`);if(F===-1)V="-";else if(Z===O||F!==O.length-1){if(V="+",Q)Q()}else V="";if(O){if(Z=Z.slice(0,-O.length),O[O.length-1]===`
|
|
26
|
+
`)O=O.slice(0,-1);O=O.replace(A$,`$&${Y}`)}let _=!1,T,L=-1;for(T=0;T<Z.length;++T){let w=Z[T];if(w===" ")_=!0;else if(w===`
|
|
27
|
+
`)L=T;else break}let R=Z.substring(0,L<T?L+1:T);if(R)Z=Z.substring(R.length),R=R.replace(/\n+/g,`$&${Y}`);let D=(_?Y?"2":"1":"")+V;if(q){if(D+=" "+G(q.replace(/ ?[\r\n]+/g," ")),X)X()}if(!B){let w=Z.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),P=!1,A=wq(U,!0);if(z!=="folded"&&$!==l.Scalar.BLOCK_FOLDED)A.onOverflow=()=>{P=!0};let I=Z0.foldFlowLines(`${R}${w}${O}`,Y,Z0.FOLD_BLOCK,A);if(!P)return`>${D}
|
|
29
|
+
${Y}${I}`}return Z=Z.replace(/\n+/g,`$&${Y}`),`|${D}
|
|
30
|
+
${Y}${R}${Z}${O}`}function VZ(q,$,Z,U){let{type:X,value:Q}=q,{actualString:z,implicitKey:G,indent:J,indentStep:Y,inFlow:B}=$;if(G&&Q.includes(`
|
|
31
|
+
`)||B&&/[[\]{},]/.test(Q))return D0(Q,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return G||B||!Q.includes(`
|
|
32
|
+
`)?D0(Q,$):Dq(q,$,Z,U);if(!G&&!B&&X!==l.Scalar.PLAIN&&Q.includes(`
|
|
33
|
+
`))return Dq(q,$,Z,U);if(Pq(Q)){if(J==="")return $.forceBlockIndent=!0,Dq(q,$,Z,U);else if(G&&J===Y)return D0(Q,$)}let V=Q.replace(/\n+/g,`$&
|
|
34
|
+
${J}`);if(z){let W=(_)=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(V),{compat:O,tags:F}=$.doc.schema;if(F.some(W)||O?.some(W))return D0(Q,$)}return G?V:Z0.foldFlowLines(V,J,Z0.FOLD_FLOW,wq($,!1))}function WZ(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!==l.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=l.Scalar.QUOTE_DOUBLE}let J=(B)=>{switch(B){case l.Scalar.BLOCK_FOLDED:case l.Scalar.BLOCK_LITERAL:return X||Q?D0(z.value,$):Dq(z,$,Z,U);case l.Scalar.QUOTE_DOUBLE:return l0(z.value,$);case l.Scalar.QUOTE_SINGLE:return M$(z.value,$);case l.Scalar.PLAIN:return VZ(z,$,Z,U);default:return null}},Y=J(G);if(Y===null){let{defaultKeyType:B,defaultStringType:V}=$.options,W=X&&B||V;if(Y=J(W),Y===null)throw Error(`Unsupported default string type ${W}`)}return Y}BZ.stringifyString=WZ});var a0=M((MZ)=>{var OZ=Kq(),U0=f(),TZ=c0(),FZ=i0();function IZ(q,$){let Z=Object.assign({blockQuote:!0,commentString:TZ.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 LZ(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(U0.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 KZ(q,$,{anchors:Z,doc:U}){if(!U.directives)return"";let X=[],Q=(U0.isScalar(q)||U0.isCollection(q))&&q.anchor;if(Q&&OZ.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 RZ(q,$,Z,U){if(U0.isPair(q))return q.toString($,Z,U);if(U0.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=U0.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>X=J});X??(X=LZ($.doc.schema.tags,Q));let z=KZ(Q,X,$);if(z.length>0)$.indentAtStart=($.indentAtStart??0)+z.length+1;let G=typeof X.stringify==="function"?X.stringify(Q,$,Z,U):U0.isScalar(Q)?FZ.stringifyString(Q,$,Z,U):Q.toString($,Z,U);if(!z)return G;return U0.isScalar(Q)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
|
|
35
|
+
${$.indent}${G}`}MZ.createStringifyContext=IZ;MZ.stringify=RZ});var D1=M((PZ)=>{var e=f(),M1=x(),A1=a0(),n0=c0();function wZ({key:q,value:$},Z,U,X){let{allNullValues:Q,doc:z,indent:G,indentStep:J,options:{commentString:Y,indentSeq:B,simpleKeys:V}}=Z,W=e.isNode(q)&&q.comment||null;if(V){if(W)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let O=!V&&(!q||W&&$==null&&!Z.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===M1.Scalar.BLOCK_FOLDED||q.type===M1.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!O&&(V||!Q),indent:G+J});let F=!1,_=!1,T=A1.stringify(q,Z,()=>F=!0,()=>_=!0);if(!O&&!Z.inFlow&&T.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");O=!0}if(Z.inFlow){if(Q||$==null){if(F&&U)U();return T===""?"?":O?`? ${T}`:T}}else if(Q&&!V||$==null&&O){if(T=`? ${T}`,W&&!F)T+=n0.lineComment(T,Z.indent,Y(W));else if(_&&X)X();return T}if(F)W=null;if(O){if(W)T+=n0.lineComment(T,Z.indent,Y(W));T=`? ${T}
|
|
36
|
+
${G}:`}else if(T=`${T}:`,W)T+=n0.lineComment(T,Z.indent,Y(W));let L,R,K;if(e.isNode($))L=!!$.spaceBefore,R=$.commentBefore,K=$.comment;else if(L=!1,R=null,K=null,$&&typeof $==="object")$=z.createNode($);if(Z.implicitKey=!1,!O&&!W&&e.isScalar($))Z.indentAtStart=T.length+1;if(_=!1,!B&&J.length>=2&&!Z.inFlow&&!O&&e.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let D=!1,w=A1.stringify($,Z,()=>D=!0,()=>_=!0),P=" ";if(W||L||R){if(P=L?`
|
|
37
|
+
`:"",R){let A=Y(R);P+=`
|
|
38
|
+
${n0.indentComment(A,Z.indent)}`}if(w===""&&!Z.inFlow){if(P===`
|
|
39
|
+
`&&K)P=`
|
|
40
|
+
|
|
41
|
+
`}else P+=`
|
|
42
|
+
${Z.indent}`}else if(!O&&e.isCollection($)){let A=w[0],I=w.indexOf(`
|
|
43
|
+
`),C=I!==-1,N=Z.inFlow??$.flow??$.items.length===0;if(C||!N){let b=!1;if(C&&(A==="&"||A==="!")){let S=w.indexOf(" ");if(A==="&"&&S!==-1&&S<I&&w[S+1]==="!")S=w.indexOf(" ",S+1);if(S===-1||I<S)b=!0}if(!b)P=`
|
|
44
|
+
${Z.indent}`}}else if(w===""||w[0]===`
|
|
45
|
+
`)P="";if(T+=P+w,Z.inFlow){if(D&&U)U()}else if(K&&!D)T+=n0.lineComment(T,Z.indent,Y(K));else if(_&&X)X();return T}PZ.stringifyPair=wZ});var D$=M((bZ)=>{var w1=k("process");function jZ(q,...$){if(q==="debug")console.log(...$)}function CZ(q,$){if(q==="debug"||q==="warn")if(typeof w1.emitWarning==="function")w1.emitWarning($);else console.warn($)}bZ.debug=jZ;bZ.warn=CZ});var Cq=M((yZ)=>{var s0=f(),P1=x(),Nq="<<",jq={identify:(q)=>q===Nq||typeof q==="symbol"&&q.description===Nq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new P1.Scalar(Symbol(Nq)),{addToJSMap:N1}),stringify:()=>Nq},fZ=(q,$)=>(jq.identify($)||s0.isScalar($)&&(!$.type||$.type===P1.Scalar.PLAIN)&&jq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===jq.tag&&Z.default);function N1(q,$,Z){if(Z=q&&s0.isAlias(Z)?Z.resolve(q.doc):Z,s0.isSeq(Z))for(let U of Z.items)w$(q,$,U);else if(Array.isArray(Z))for(let U of Z)w$(q,$,U);else w$(q,$,Z)}function w$(q,$,Z){let U=q&&s0.isAlias(Z)?Z.resolve(q.doc):Z;if(!s0.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=N1;yZ.isMergeKey=fZ;yZ.merge=jq});var N$=M((pZ)=>{var kZ=D$(),j1=Cq(),vZ=a0(),C1=f(),P$=$0();function uZ(q,$,{key:Z,value:U}){if(C1.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,U);else if(j1.isMergeKey(q,Z))j1.addMergeToJSMap(q,$,U);else{let X=P$.toJS(Z,"",q);if($ instanceof Map)$.set(X,P$.toJS(U,X,q));else if($ instanceof Set)$.add(X);else{let Q=mZ(Z,X,q),z=P$.toJS(U,Q,q);if(Q in $)Object.defineProperty($,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});else $[Q]=z}}return $}function mZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(C1.isNode(q)&&Z?.doc){let U=vZ.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)+'..."';kZ.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($)}pZ.addPairToJSMap=uZ});var X0=M((aZ)=>{var b1=d0(),cZ=D1(),lZ=N$(),bq=f();function iZ(q,$,Z){let U=b1.createNode(q,void 0,Z),X=b1.createNode($,void 0,Z);return new Sq(U,X)}class Sq{constructor(q,$=null){Object.defineProperty(this,bq.NODE_TYPE,{value:bq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:Z}=this;if(bq.isNode($))$=$.clone(q);if(bq.isNode(Z))Z=Z.clone(q);return new Sq($,Z)}toJSON(q,$){let Z=$?.mapAsMap?new Map:{};return lZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?cZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}aZ.Pair=Sq;aZ.createPair=iZ});var j$=M((eZ)=>{var W0=f(),S1=a0(),Eq=c0();function oZ(q,$,Z){return($.inFlow??q.flow?tZ:rZ)(q,$,Z)}function rZ({comment:q,items:$},Z,{blockItemPrefix:U,flowChars:X,itemIndent:Q,onChompKeep:z,onComment:G}){let{indent:J,options:{commentString:Y}}=Z,B=Object.assign({},Z,{indent:Q,type:null}),V=!1,W=[];for(let F=0;F<$.length;++F){let _=$[F],T=null;if(W0.isNode(_)){if(!V&&_.spaceBefore)W.push("");if(fq(Z,W,_.commentBefore,V),_.comment)T=_.comment}else if(W0.isPair(_)){let R=W0.isNode(_.key)?_.key:null;if(R){if(!V&&R.spaceBefore)W.push("");fq(Z,W,R.commentBefore,V)}}V=!1;let L=S1.stringify(_,B,()=>T=null,()=>V=!0);if(T)L+=Eq.lineComment(L,Q,Y(T));if(V&&T)V=!1;W.push(U+L)}let O;if(W.length===0)O=X.start+X.end;else{O=W[0];for(let F=1;F<W.length;++F){let _=W[F];O+=_?`
|
|
46
46
|
${J}${_}`:`
|
|
47
|
-
`}}if(q){if(
|
|
48
|
-
`+Eq.indentComment(Y(q),J),G)G()}else if(V&&z)z();return
|
|
49
|
-
`)))Y=!0;V.push(
|
|
50
|
-
${
|
|
47
|
+
`}}if(q){if(O+=`
|
|
48
|
+
`+Eq.indentComment(Y(q),J),G)G()}else if(V&&z)z();return O}function tZ({items:q},$,{flowChars:Z,itemIndent:U}){let{indent:X,indentStep:Q,flowCollectionPadding:z,options:{commentString:G}}=$;U+=Q;let J=Object.assign({},$,{indent:U,inFlow:!0,type:null}),Y=!1,B=0,V=[];for(let F=0;F<q.length;++F){let _=q[F],T=null;if(W0.isNode(_)){if(_.spaceBefore)V.push("");if(fq($,V,_.commentBefore,!1),_.comment)T=_.comment}else if(W0.isPair(_)){let R=W0.isNode(_.key)?_.key:null;if(R){if(R.spaceBefore)V.push("");if(fq($,V,R.commentBefore,!1),R.comment)Y=!0}let K=W0.isNode(_.value)?_.value:null;if(K){if(K.comment)T=K.comment;if(K.commentBefore)Y=!0}else if(_.value==null&&R?.comment)T=R.comment}if(T)Y=!0;let L=S1.stringify(_,J,()=>T=null);if(F<q.length-1)L+=",";if(T)L+=Eq.lineComment(L,U,G(T));if(!Y&&(V.length>B||L.includes(`
|
|
49
|
+
`)))Y=!0;V.push(L),B=V.length}let{start:W,end:O}=Z;if(V.length===0)return W+O;else{if(!Y){let F=V.reduce((_,T)=>_+T.length+2,2);Y=$.options.lineWidth>0&&F>$.options.lineWidth}if(Y){let F=W;for(let _ of V)F+=_?`
|
|
50
|
+
${Q}${X}${_}`:`
|
|
51
51
|
`;return`${F}
|
|
52
|
-
${
|
|
53
|
-
`:" ")}return
|
|
54
|
-
${
|
|
55
|
-
${U.comment}`:X.comment}X=Q}q.items[Z]=uq.isPair(X)?X:new k$.Pair(X)}else $("Expected a sequence for this tag");return q}function c1(q,$,Z){let{replacer:X}=Z,Q=new H3.YAMLSeq(q);Q.tag="tag:yaml.org,2002:pairs";let U=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof X==="function")z=X.call($,String(U++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let Y=Object.keys(z);if(Y.length===1)G=Y[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else G=z;Q.items.push(k$.createPair(G,J,Z))}return Q}var V3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d1,createNode:c1};W3.createPairs=c1;W3.pairs=V3;W3.resolvePairs=d1});var u$=D((L3)=>{var l1=S(),v$=q0(),t0=U0(),T3=z0(),i1=mq();class W0 extends T3.YAMLSeq{constructor(){super();this.add=t0.YAMLMap.prototype.add.bind(this),this.delete=t0.YAMLMap.prototype.delete.bind(this),this.get=t0.YAMLMap.prototype.get.bind(this),this.has=t0.YAMLMap.prototype.has.bind(this),this.set=t0.YAMLMap.prototype.set.bind(this),this.tag=W0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let X of this.items){let Q,U;if(l1.isPair(X))Q=v$.toJS(X.key,"",$),U=v$.toJS(X.value,Q,$);else Q=v$.toJS(X,"",$);if(Z.has(Q))throw Error("Ordered maps must not include duplicate keys");Z.set(Q,U)}return Z}static from(q,$,Z){let X=i1.createPairs(q,$,Z),Q=new this;return Q.items=X.items,Q}}W0.tag="tag:yaml.org,2002:omap";var F3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:W0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=i1.resolvePairs(q,$),X=[];for(let{key:Q}of Z.items)if(l1.isScalar(Q))if(X.includes(Q.value))$(`Ordered maps must not include duplicate keys: ${Q.value}`);else X.push(Q.value);return Object.assign(new W0,Z)},createNode:(q,$,Z)=>W0.from(q,$,Z)};L3.YAMLOMap=W0;L3.omap=F3});var r1=D((R3)=>{var a1=x();function n1({value:q,source:$},Z){if($&&(q?s1:o1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var s1={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new a1.Scalar(!0),stringify:n1},o1={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new a1.Scalar(!1),stringify:n1};R3.falseTag=o1;R3.trueTag=s1});var t1=D((j3)=>{var D3=x(),m$=N0(),w3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:m$.stringifyNumber},P3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():m$.stringifyNumber(q)}},N3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new D3.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let X=q.substring(Z+1).replace(/_/g,"");if(X[X.length-1]==="0")$.minFractionDigits=X.length}return $},stringify:m$.stringifyNumber};j3.float=N3;j3.floatExp=P3;j3.floatNaN=w3});var q9=D((g3)=>{var e1=N0(),e0=(q)=>typeof q==="bigint"||Number.isInteger(q);function pq(q,$,Z,{intAsBigInt:X}){let Q=q[0];if(Q==="-"||Q==="+")$+=1;if(q=q.substring($).replace(/_/g,""),X){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return Q==="-"?BigInt(-1)*z:z}let U=parseInt(q,Z);return Q==="-"?-1*U:U}function p$(q,$,Z){let{value:X}=q;if(e0(X)){let Q=X.toString($);return X<0?"-"+Z+Q.substr(1):Z+Q}return e1.stringifyNumber(q)}var E3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>pq(q,2,2,Z),stringify:(q)=>p$(q,2,"0b")},f3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>pq(q,1,8,Z),stringify:(q)=>p$(q,8,"0")},y3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>pq(q,0,10,Z),stringify:e1.stringifyNumber},x3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>pq(q,2,16,Z),stringify:(q)=>p$(q,16,"0x")};g3.int=y3;g3.intBin=E3;g3.intHex=x3;g3.intOct=f3});var d$=D((p3)=>{var lq=S(),dq=X0(),cq=U0();class B0 extends cq.YAMLMap{constructor(q){super(q);this.tag=B0.tag}add(q){let $;if(lq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new dq.Pair(q.key,null);else $=new dq.Pair(q,null);if(!cq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=cq.findPair(this.items,q);return!$&&lq.isPair(Z)?lq.isScalar(Z.key)?Z.key.value:Z.key:Z}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let Z=cq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new dq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($))for(let U of $){if(typeof X==="function")U=X.call($,U,U);Q.items.push(dq.createPair(U,null,Z))}return Q}}B0.tag="tag:yaml.org,2002:set";var m3={collection:"map",identify:(q)=>q instanceof Set,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>B0.from(q,$,Z),resolve(q,$){if(lq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new B0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};p3.YAMLSet=B0;p3.set=m3});var l$=D((n3)=>{var l3=N0();function c$(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,Q=(z)=>$?BigInt(z):Number(z),U=X.replace(/_/g,"").split(":").reduce((z,G)=>z*Q(60)+Q(G),Q(0));return Z==="-"?Q(-1)*U:U}function $9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return l3.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let Q=Z(60),U=[$%Q];if($<60)U.unshift(0);else if($=($-U[0])/Q,U.unshift($%Q),$>=60)$=($-U[0])/Q,U.unshift($);return X+U.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var i3={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>c$(q,Z),stringify:$9},a3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>c$(q,!1),stringify:$9},Z9={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let $=q.match(Z9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,Q,U,z,G]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Y=Date.UTC(Z,X-1,Q,U||0,z||0,G||0,J),B=$[8];if(B&&B!=="Z"){let V=c$(B,!1);if(Math.abs(V)<30)V*=60;Y-=60000*V}return new Date(Y)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};n3.floatTime=a3;n3.intTime=i3;n3.timestamp=Z9});var Q9=D((J7)=>{var t3=w0(),e3=hq(),q7=P0(),$7=o0(),Z7=h$(),X9=r1(),i$=t1(),iq=q9(),X7=Cq(),Q7=u$(),U7=mq(),z7=d$(),a$=l$(),G7=[t3.map,q7.seq,$7.string,e3.nullTag,X9.trueTag,X9.falseTag,iq.intBin,iq.intOct,iq.int,iq.intHex,i$.floatNaN,i$.floatExp,i$.float,Z7.binary,X7.merge,Q7.omap,U7.pairs,z7.set,a$.intTime,a$.floatTime,a$.timestamp];J7.schema=G7});var _9=D((F7)=>{var J9=w0(),H7=hq(),Y9=P0(),V7=o0(),W7=C$(),n$=S$(),s$=f$(),B7=u1(),_7=p1(),H9=h$(),qq=Cq(),V9=u$(),W9=mq(),U9=Q9(),B9=d$(),aq=l$(),z9=new Map([["core",B7.schema],["failsafe",[J9.map,Y9.seq,V7.string]],["json",_7.schema],["yaml11",U9.schema],["yaml-1.1",U9.schema]]),G9={binary:H9.binary,bool:W7.boolTag,float:n$.float,floatExp:n$.floatExp,floatNaN:n$.floatNaN,floatTime:aq.floatTime,int:s$.int,intHex:s$.intHex,intOct:s$.intOct,intTime:aq.intTime,map:J9.map,merge:qq.merge,null:H7.nullTag,omap:V9.omap,pairs:W9.pairs,seq:Y9.seq,set:B9.set,timestamp:aq.timestamp},O7={"tag:yaml.org,2002:binary":H9.binary,"tag:yaml.org,2002:merge":qq.merge,"tag:yaml.org,2002:omap":V9.omap,"tag:yaml.org,2002:pairs":W9.pairs,"tag:yaml.org,2002:set":B9.set,"tag:yaml.org,2002:timestamp":aq.timestamp};function T7(q,$,Z){let X=z9.get($);if(X&&!q)return Z&&!X.includes(qq.merge)?X.concat(qq.merge):X.slice();let Q=X;if(!Q)if(Array.isArray(q))Q=[];else{let U=Array.from(z9.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${U} or define customTags array`)}if(Array.isArray(q))for(let U of q)Q=Q.concat(U);else if(typeof q==="function")Q=q(Q.slice());if(Z)Q=Q.concat(qq.merge);return Q.reduce((U,z)=>{let G=typeof z==="string"?G9[z]:z;if(!G){let J=JSON.stringify(z),Y=Object.keys(G9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Y}`)}if(!U.includes(G))U.push(G);return U},[])}F7.coreKnownTags=O7;F7.getTags=T7});var t$=D((D7)=>{var o$=S(),K7=w0(),R7=P0(),M7=o0(),nq=_9(),A7=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class r${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:Q,sortMapEntries:U,toStringDefaults:z}){this.compat=Array.isArray(q)?nq.getTags(q,"compat"):q?nq.getTags(null,q):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=X?nq.coreKnownTags:{},this.tags=nq.getTags($,this.name,Z),this.toStringOptions=z??null,Object.defineProperty(this,o$.MAP,{value:K7.map}),Object.defineProperty(this,o$.SCALAR,{value:M7.string}),Object.defineProperty(this,o$.SEQ,{value:R7.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?A7:null}clone(){let q=Object.create(r$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}D7.Schema=r$});var O9=D((j7)=>{var P7=S(),e$=i0(),$q=d0();function N7(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)Z.push(J),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let Q=e$.createStringifyContext(q,$),{commentString:U}=Q.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let J=U(q.commentBefore);Z.unshift($q.indentComment(J,""))}let z=!1,G=null;if(q.contents){if(P7.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let B=U(q.contents.commentBefore);Z.push($q.indentComment(B,""))}Q.forceBlockIndent=!!q.comment,G=q.contents.comment}let J=G?void 0:()=>z=!0,Y=e$.stringify(q.contents,Q,()=>G=null,J);if(G)Y+=$q.lineComment(Y,"",U(G));if((Y[0]==="|"||Y[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${Y}`;else Z.push(Y)}else Z.push(e$.stringify(q.contents,Q));if(q.directives?.docEnd)if(q.comment){let J=U(q.comment);if(J.includes(`
|
|
56
|
-
`))Z.push("..."),Z.push(
|
|
52
|
+
${X}${O}`}else return`${W}${z}${V.join(" ")}${z}${O}`}}function fq({indent:q,options:{commentString:$}},Z,U,X){if(U&&X)U=U.replace(/^\n+/,"");if(U){let Q=Eq.indentComment($(U),q);Z.push(Q.trimStart())}}eZ.stringifyCollection=oZ});var z0=M((Q6)=>{var $6=j$(),Z6=N$(),U6=Aq(),Q0=f(),yq=X0(),X6=x();function o0(q,$){let Z=Q0.isScalar($)?$.value:$;for(let U of q)if(Q0.isPair(U)){if(U.key===$||U.key===Z)return U;if(Q0.isScalar(U.key)&&U.key.value===Z)return U}return}class E1 extends U6.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(Q0.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:U,replacer:X}=Z,Q=new this(q),z=(G,J)=>{if(typeof X==="function")J=X.call($,G,J);else if(Array.isArray(X)&&!X.includes(G))return;if(J!==void 0||U)Q.items.push(yq.createPair(G,J,Z))};if($ instanceof Map)for(let[G,J]of $)z(G,J);else if($&&typeof $==="object")for(let G of Object.keys($))z(G,$[G]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,$){let Z;if(Q0.isPair(q))Z=q;else if(!q||typeof q!=="object"||!("key"in q))Z=new yq.Pair(q,q?.value);else Z=new yq.Pair(q.key,q.value);let U=o0(this.items,Z.key),X=this.schema?.sortMapEntries;if(U){if(!$)throw Error(`Key ${Z.key} already set`);if(Q0.isScalar(U.value)&&X6.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 $=o0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let U=o0(this.items,q)?.value;return(!$&&Q0.isScalar(U)?U.value:U)??void 0}has(q){return!!o0(this.items,q)}set(q,$){this.add(new yq.Pair(q,$),!0)}toJSON(q,$,Z){let U=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(U);for(let X of this.items)Z6.addPairToJSMap($,U,X);return U}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let U of this.items)if(!Q0.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 $6.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}Q6.YAMLMap=E1;Q6.findPair=o0});var w0=M((H6)=>{var J6=f(),f1=z0(),Y6={collection:"map",default:!0,nodeClass:f1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!J6.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>f1.YAMLMap.from(q,$,Z)};H6.map=Y6});var G0=M((F6)=>{var W6=d0(),B6=j$(),_6=Aq(),gq=f(),O6=x(),T6=$0();class y1 extends _6.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(gq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=xq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=xq(q);if(typeof Z!=="number")return;let U=this.items[Z];return!$&&gq.isScalar(U)?U.value:U}has(q){let $=xq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let Z=xq(q);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${q}.`);let U=this.items[Z];if(gq.isScalar(U)&&O6.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(T6.toJS(X,String(U++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return B6.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(W6.createNode(z,void 0,Z))}}return X}}function xq(q){let $=gq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}F6.YAMLSeq=y1});var P0=M((R6)=>{var L6=f(),x1=G0(),K6={collection:"seq",default:!0,nodeClass:x1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!L6.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>x1.YAMLSeq.from(q,$,Z)};R6.seq=K6});var r0=M((w6)=>{var A6=i0(),D6={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},$),A6.stringifyString(q,$,Z,U)}};w6.string=D6});var hq=M((N6)=>{var g1=x(),h1={identify:(q)=>q==null,createNode:()=>new g1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new g1.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&h1.test.test(q)?q:$.options.nullStr};N6.nullTag=h1});var C$=M((b6)=>{var C6=x(),k1={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new C6.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&k1.test.test(q)){let U=q[0]==="t"||q[0]==="T";if($===U)return q}return $?Z.options.trueStr:Z.options.falseStr}};b6.boolTag=k1});var N0=M((f6)=>{function E6({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}f6.stringifyNumber=E6});var S$=M((v6)=>{var x6=x(),b$=N0(),g6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:b$.stringifyNumber},h6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():b$.stringifyNumber(q)}},k6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new x6.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:b$.stringifyNumber};v6.float=k6;v6.floatExp=h6;v6.floatNaN=g6});var f$=M((i6)=>{var v1=N0(),kq=(q)=>typeof q==="bigint"||Number.isInteger(q),E$=(q,$,Z,{intAsBigInt:U})=>U?BigInt(q):parseInt(q.substring($),Z);function u1(q,$,Z){let{value:U}=q;if(kq(U)&&U>=0)return Z+U.toString($);return v1.stringifyNumber(q)}var d6={identify:(q)=>kq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>E$(q,2,8,Z),stringify:(q)=>u1(q,8,"0o")},c6={identify:kq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>E$(q,0,10,Z),stringify:v1.stringifyNumber},l6={identify:(q)=>kq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>E$(q,2,16,Z),stringify:(q)=>u1(q,16,"0x")};i6.int=c6;i6.intHex=l6;i6.intOct=d6});var m1=M((Z3)=>{var o6=w0(),r6=hq(),t6=P0(),e6=r0(),q3=C$(),y$=S$(),x$=f$(),$3=[o6.map,t6.seq,e6.string,r6.nullTag,q3.boolTag,x$.intOct,x$.int,x$.intHex,y$.floatNaN,y$.floatExp,y$.float];Z3.schema=$3});var d1=M((H3)=>{var X3=x(),Q3=w0(),z3=P0();function p1(q){return typeof q==="bigint"||Number.isInteger(q)}var vq=({value:q})=>JSON.stringify(q),G3=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:vq},{identify:(q)=>q==null,createNode:()=>new X3.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:vq},{identify:p1,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})=>p1(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:vq}],J3={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},Y3=[Q3.map,z3.seq].concat(G3,J3);H3.schema=Y3});var h$=M((_3)=>{var t0=k("buffer"),g$=x(),W3=i0(),B3={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof t0.Buffer==="function")return t0.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 t0.Buffer==="function")G=z instanceof t0.Buffer?z.toString("base64"):t0.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Y=0;Y<z.length;++Y)J+=String.fromCharCode(z[Y]);G=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=g$.Scalar.BLOCK_LITERAL),$!==g$.Scalar.QUOTE_DOUBLE){let J=Math.max(U.options.lineWidth-U.indent.length,U.options.minContentWidth),Y=Math.ceil(G.length/J),B=Array(Y);for(let V=0,W=0;V<Y;++V,W+=J)B[V]=G.substr(W,J);G=B.join($===g$.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return W3.stringifyString({comment:q,type:$,value:G},U,X,Q)}};_3.binary=B3});var mq=M((L3)=>{var uq=f(),k$=X0(),T3=x(),F3=G0();function c1(q,$){if(uq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let U=q.items[Z];if(uq.isPair(U))continue;else if(uq.isMap(U)){if(U.items.length>1)$("Each pair must have its own sequence indicator");let X=U.items[0]||new k$.Pair(new T3.Scalar(null));if(U.commentBefore)X.key.commentBefore=X.key.commentBefore?`${U.commentBefore}
|
|
54
|
+
${X.key.commentBefore}`:U.commentBefore;if(U.comment){let Q=X.value??X.key;Q.comment=Q.comment?`${U.comment}
|
|
55
|
+
${Q.comment}`:U.comment}U=X}q.items[Z]=uq.isPair(U)?U:new k$.Pair(U)}else $("Expected a sequence for this tag");return q}function l1(q,$,Z){let{replacer:U}=Z,X=new F3.YAMLSeq(q);X.tag="tag:yaml.org,2002:pairs";let Q=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof U==="function")z=U.call($,String(Q++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let Y=Object.keys(z);if(Y.length===1)G=Y[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else G=z;X.items.push(k$.createPair(G,J,Z))}return X}var I3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:c1,createNode:l1};L3.createPairs=l1;L3.pairs=I3;L3.resolvePairs=c1});var u$=M((w3)=>{var i1=f(),v$=$0(),e0=z0(),A3=G0(),a1=mq();class B0 extends A3.YAMLSeq{constructor(){super();this.add=e0.YAMLMap.prototype.add.bind(this),this.delete=e0.YAMLMap.prototype.delete.bind(this),this.get=e0.YAMLMap.prototype.get.bind(this),this.has=e0.YAMLMap.prototype.has.bind(this),this.set=e0.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 U of this.items){let X,Q;if(i1.isPair(U))X=v$.toJS(U.key,"",$),Q=v$.toJS(U.value,X,$);else X=v$.toJS(U,"",$);if(Z.has(X))throw Error("Ordered maps must not include duplicate keys");Z.set(X,Q)}return Z}static from(q,$,Z){let U=a1.createPairs(q,$,Z),X=new this;return X.items=U.items,X}}B0.tag="tag:yaml.org,2002:omap";var D3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=a1.resolvePairs(q,$),U=[];for(let{key:X}of Z.items)if(i1.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 B0,Z)},createNode:(q,$,Z)=>B0.from(q,$,Z)};w3.YAMLOMap=B0;w3.omap=D3});var t1=M((j3)=>{var n1=x();function s1({value:q,source:$},Z){if($&&(q?o1:r1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var o1={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 n1.Scalar(!0),stringify:s1},r1={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 n1.Scalar(!1),stringify:s1};j3.falseTag=r1;j3.trueTag=o1});var e1=M((x3)=>{var S3=x(),m$=N0(),E3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:m$.stringifyNumber},f3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():m$.stringifyNumber(q)}},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 S3.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let U=q.substring(Z+1).replace(/_/g,"");if(U[U.length-1]==="0")$.minFractionDigits=U.length}return $},stringify:m$.stringifyNumber};x3.float=y3;x3.floatExp=f3;x3.floatNaN=E3});var $9=M((d3)=>{var q9=N0(),qq=(q)=>typeof q==="bigint"||Number.isInteger(q);function pq(q,$,Z,{intAsBigInt:U}){let X=q[0];if(X==="-"||X==="+")$+=1;if(q=q.substring($).replace(/_/g,""),U){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return X==="-"?BigInt(-1)*z:z}let Q=parseInt(q,Z);return X==="-"?-1*Q:Q}function p$(q,$,Z){let{value:U}=q;if(qq(U)){let X=U.toString($);return U<0?"-"+Z+X.substr(1):Z+X}return q9.stringifyNumber(q)}var v3={identify:qq,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>pq(q,2,2,Z),stringify:(q)=>p$(q,2,"0b")},u3={identify:qq,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>pq(q,1,8,Z),stringify:(q)=>p$(q,8,"0")},m3={identify:qq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>pq(q,0,10,Z),stringify:q9.stringifyNumber},p3={identify:qq,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>pq(q,2,16,Z),stringify:(q)=>p$(q,16,"0x")};d3.int=m3;d3.intBin=v3;d3.intHex=p3;d3.intOct=u3});var d$=M((s3)=>{var lq=f(),dq=X0(),cq=z0();class _0 extends cq.YAMLMap{constructor(q){super(q);this.tag=_0.tag}add(q){let $;if(lq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new dq.Pair(q.key,null);else $=new dq.Pair(q,null);if(!cq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=cq.findPair(this.items,q);return!$&&lq.isPair(Z)?lq.isScalar(Z.key)?Z.key.value:Z.key:Z}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let Z=cq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new dq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:U}=Z,X=new this(q);if($&&Symbol.iterator in Object($))for(let Q of $){if(typeof U==="function")Q=U.call($,Q,Q);X.items.push(dq.createPair(Q,null,Z))}return X}}_0.tag="tag:yaml.org,2002:set";var n3={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(lq.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}};s3.YAMLSet=_0;s3.set=n3});var l$=M(($7)=>{var t3=N0();function c$(q,$){let Z=q[0],U=Z==="-"||Z==="+"?q.substring(1):q,X=(z)=>$?BigInt(z):Number(z),Q=U.replace(/_/g,"").split(":").reduce((z,G)=>z*X(60)+X(G),X(0));return Z==="-"?X(-1)*Q:Q}function Z9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return t3.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 e3={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>c$(q,Z),stringify:Z9},q7={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>c$(q,!1),stringify:Z9},U9={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(U9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,U,X,Q,z,G]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Y=Date.UTC(Z,U-1,X,Q||0,z||0,G||0,J),B=$[8];if(B&&B!=="Z"){let V=c$(B,!1);if(Math.abs(V)<30)V*=60;Y-=60000*V}return new Date(Y)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$7.floatTime=q7;$7.intTime=e3;$7.timestamp=U9});var Q9=M((O7)=>{var Q7=w0(),z7=hq(),G7=P0(),J7=r0(),Y7=h$(),X9=t1(),i$=e1(),iq=$9(),H7=Cq(),V7=u$(),W7=mq(),B7=d$(),a$=l$(),_7=[Q7.map,G7.seq,J7.string,z7.nullTag,X9.trueTag,X9.falseTag,iq.intBin,iq.intOct,iq.int,iq.intHex,i$.floatNaN,i$.floatExp,i$.float,Y7.binary,H7.merge,V7.omap,W7.pairs,B7.set,a$.intTime,a$.floatTime,a$.timestamp];O7.schema=_7});var O9=M((D7)=>{var Y9=w0(),F7=hq(),H9=P0(),I7=r0(),L7=C$(),n$=S$(),s$=f$(),K7=m1(),R7=d1(),V9=h$(),$q=Cq(),W9=u$(),B9=mq(),z9=Q9(),_9=d$(),aq=l$(),G9=new Map([["core",K7.schema],["failsafe",[Y9.map,H9.seq,I7.string]],["json",R7.schema],["yaml11",z9.schema],["yaml-1.1",z9.schema]]),J9={binary:V9.binary,bool:L7.boolTag,float:n$.float,floatExp:n$.floatExp,floatNaN:n$.floatNaN,floatTime:aq.floatTime,int:s$.int,intHex:s$.intHex,intOct:s$.intOct,intTime:aq.intTime,map:Y9.map,merge:$q.merge,null:F7.nullTag,omap:W9.omap,pairs:B9.pairs,seq:H9.seq,set:_9.set,timestamp:aq.timestamp},M7={"tag:yaml.org,2002:binary":V9.binary,"tag:yaml.org,2002:merge":$q.merge,"tag:yaml.org,2002:omap":W9.omap,"tag:yaml.org,2002:pairs":B9.pairs,"tag:yaml.org,2002:set":_9.set,"tag:yaml.org,2002:timestamp":aq.timestamp};function A7(q,$,Z){let U=G9.get($);if(U&&!q)return Z&&!U.includes($q.merge)?U.concat($q.merge):U.slice();let X=U;if(!X)if(Array.isArray(q))X=[];else{let Q=Array.from(G9.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($q.merge);return X.reduce((Q,z)=>{let G=typeof z==="string"?J9[z]:z;if(!G){let J=JSON.stringify(z),Y=Object.keys(J9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Y}`)}if(!Q.includes(G))Q.push(G);return Q},[])}D7.coreKnownTags=M7;D7.getTags=A7});var t$=M((S7)=>{var o$=f(),N7=w0(),j7=P0(),C7=r0(),nq=O9(),b7=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class r${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:U,schema:X,sortMapEntries:Q,toStringDefaults:z}){this.compat=Array.isArray(q)?nq.getTags(q,"compat"):q?nq.getTags(null,q):null,this.name=typeof X==="string"&&X||"core",this.knownTags=U?nq.coreKnownTags:{},this.tags=nq.getTags($,this.name,Z),this.toStringOptions=z??null,Object.defineProperty(this,o$.MAP,{value:N7.map}),Object.defineProperty(this,o$.SCALAR,{value:C7.string}),Object.defineProperty(this,o$.SEQ,{value:j7.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?b7:null}clone(){let q=Object.create(r$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}S7.Schema=r$});var T9=M((x7)=>{var f7=f(),e$=a0(),Zq=c0();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=e$.createStringifyContext(q,$),{commentString:Q}=X.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let J=Q(q.commentBefore);Z.unshift(Zq.indentComment(J,""))}let z=!1,G=null;if(q.contents){if(f7.isNode(q.contents)){if(q.contents.spaceBefore&&U)Z.push("");if(q.contents.commentBefore){let B=Q(q.contents.commentBefore);Z.push(Zq.indentComment(B,""))}X.forceBlockIndent=!!q.comment,G=q.contents.comment}let J=G?void 0:()=>z=!0,Y=e$.stringify(q.contents,X,()=>G=null,J);if(G)Y+=Zq.lineComment(Y,"",Q(G));if((Y[0]==="|"||Y[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${Y}`;else Z.push(Y)}else Z.push(e$.stringify(q.contents,X));if(q.directives?.docEnd)if(q.comment){let J=Q(q.comment);if(J.includes(`
|
|
56
|
+
`))Z.push("..."),Z.push(Zq.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(Zq.indentComment(Q(J),""))}}return Z.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
59
|
-
`;z=G+z}if(/[^ ]/.test(z)){let G=1,J=Z.linePos[1];if(J?.line===
|
|
58
|
+
`}x7.stringifyDocument=y7});var Uq=M((c7)=>{var h7=p0(),j0=Aq(),c=f(),k7=X0(),v7=$0(),u7=t$(),m7=T9(),q2=Kq(),p7=L$(),d7=d0(),$2=I$();class Z2{constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,c.NODE_TYPE,{value:c.DOC});let U=null;if(typeof $==="function"||Array.isArray($))U=$;else if(Z===void 0&&$)Z=$,$=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=X;let{version:Q}=X;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new $2.Directives({version:Q});this.setSchema(Q,Z),this.contents=q===void 0?null:this.createNode(q,U,Z)}clone(){let q=Object.create(Z2.prototype,{[c.NODE_TYPE]:{value:c.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=c.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(C0(this.contents))this.contents.add(q)}addIn(q,$){if(C0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=q2.anchorNames(this);q.anchor=!$||Z.has($)?q2.findNewAnchor($||"a",Z):$}return new h7.Alias(q.anchor)}createNode(q,$,Z){let U=void 0;if(typeof $==="function")q=$.call({"":q},"",q),U=$;else if(Array.isArray($)){let _=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,T=$.filter(_).map(String);if(T.length>0)$=$.concat(T);U=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:X,anchorPrefix:Q,flow:z,keepUndefined:G,onTagObj:J,tag:Y}=Z??{},{onAnchor:B,setAnchors:V,sourceObjects:W}=q2.createNodeAnchors(this,Q||"a"),O={aliasDuplicateObjects:X??!0,keepUndefined:G??!1,onAnchor:B,onTagObj:J,replacer:U,schema:this.schema,sourceObjects:W},F=d7.createNode(q,Y,O);if(z&&c.isCollection(F))F.flow=!0;return V(),F}createPair(q,$,Z={}){let U=this.createNode(q,null,Z),X=this.createNode($,null,Z);return new k7.Pair(U,X)}delete(q){return C0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(j0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return C0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return c.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(j0.isEmptyPath(q))return!$&&c.isScalar(this.contents)?this.contents.value:this.contents;return c.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return c.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(j0.isEmptyPath(q))return this.contents!==void 0;return c.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=j0.collectionFromPath(this.schema,[q],$);else if(C0(this.contents))this.contents.set(q,$)}setIn(q,$){if(j0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=j0.collectionFromPath(this.schema,Array.from(q),$);else if(C0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let Z;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new $2.Directives({version:"1.1"});Z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new $2.Directives({version:q});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let U=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${U}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new u7.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=v7.toJS(this.contents,$??"",z);if(typeof X==="function")for(let{count:J,res:Y}of z.anchors.values())X(Y,J);return typeof Q==="function"?p7.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 m7.stringifyDocument(this,q)}}function C0(q){if(c.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}c7.Document=Z2});var Xq=M((a7)=>{class sq extends Error{constructor(q,$,Z,U){super();this.name=q,this.code=Z,this.message=U,this.pos=$}}class F9 extends sq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class I9 extends sq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var i7=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((G)=>$.linePos(G));let{line:U,col:X}=Z.linePos[0];Z.message+=` at line ${U}, column ${X}`;let Q=X-1,z=q.substring($.lineStarts[U-1],$.lineStarts[U]).replace(/[\n\r]+$/,"");if(Q>=60&&z.length>80){let G=Math.min(Q-39,z.length-79);z="…"+z.substring(G),Q-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(U>1&&/^ *$/.test(z.substring(0,Q))){let G=q.substring($.lineStarts[U-2],$.lineStarts[U-1]);if(G.length>80)G=G.substring(0,79)+`…
|
|
59
|
+
`;z=G+z}if(/[^ ]/.test(z)){let G=1,J=Z.linePos[1];if(J?.line===U&&J.col>X)G=Math.max(1,Math.min(J.col-X,80-Q));let Y=" ".repeat(Q)+"^".repeat(G);Z.message+=`:
|
|
60
60
|
|
|
61
61
|
${z}
|
|
62
62
|
${Y}
|
|
63
|
-
`}};
|
|
64
|
-
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(
|
|
65
|
-
`+_.comment;else G.comment=_.comment;continue}if(_.newlineAfterProp||
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`.repeat(Math.max(1,z.length-1)):"",
|
|
72
|
-
`;for(let _=B;_<G;++_){let[
|
|
73
|
-
`;else if(
|
|
74
|
-
`;else if(!
|
|
63
|
+
`}};a7.YAMLError=sq;a7.YAMLParseError=F9;a7.YAMLWarning=I9;a7.prettifyError=i7});var Qq=M((e7)=>{function t7(q,{flow:$,indicator:Z,next:U,offset:X,onError:Q,parentIndent:z,startOnNewline:G}){let J=!1,Y=G,B=G,V="",W="",O=!1,F=!1,_=null,T=null,L=null,R=null,K=null,D=null,w=null;for(let I of q){if(F){if(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma")Q(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");F=!1}if(_){if(Y&&I.type!=="comment"&&I.type!=="newline")Q(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");_=null}switch(I.type){case"space":if(!$&&(Z!=="doc-start"||U?.type!=="flow-collection")&&I.source.includes("\t"))_=I;B=!0;break;case"comment":{if(!B)Q(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=I.source.substring(1)||" ";if(!V)V=C;else V+=W+C;W="",Y=!1;break}case"newline":if(Y){if(V)V+=I.source;else if(!D||Z!=="seq-item-ind")J=!0}else W+=I.source;if(Y=!0,O=!0,T||L)R=I;B=!0;break;case"anchor":if(T)Q(I,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(I.source.endsWith(":"))Q(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);T=I,w??(w=I.offset),Y=!1,B=!1,F=!0;break;case"tag":{if(L)Q(I,"MULTIPLE_TAGS","A node can have at most one tag");L=I,w??(w=I.offset),Y=!1,B=!1,F=!0;break}case Z:if(T||L)Q(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`);if(D)Q(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${$??"collection"}`);D=I,Y=Z==="seq-item-ind"||Z==="explicit-key-ind",B=!1;break;case"comma":if($){if(K)Q(I,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);K=I,Y=!1,B=!1;break}default:Q(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),Y=!1,B=!1}}let P=q[q.length-1],A=P?P.offset+P.source.length:X;if(F&&U&&U.type!=="space"&&U.type!=="newline"&&U.type!=="comma"&&(U.type!=="scalar"||U.source!==""))Q(U.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(_&&(Y&&_.indent<=z||U?.type==="block-map"||U?.type==="block-seq"))Q(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:K,found:D,spaceBefore:J,comment:V,hasNewline:O,anchor:T,tag:L,newlineAfterProp:R,end:A,start:w??A}}e7.resolveProps=t7});var oq=M(($U)=>{function U2(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
64
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(U2($.key)||U2($.value))return!0}return!1;default:return!0}}$U.containsNewline=U2});var X2=M((QU)=>{var UU=oq();function XU(q,$,Z){if($?.type==="flow-collection"){let U=$.end[0];if(U.indent===q&&(U.source==="]"||U.source==="}")&&UU.containsNewline($))Z(U,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}QU.flowIndentCheck=XU});var Q2=M((JU)=>{var L9=f();function GU(q,$,Z){let{uniqueKeys:U}=q.options;if(U===!1)return!1;let X=typeof U==="function"?U:(Q,z)=>Q===z||L9.isScalar(Q)&&L9.isScalar(z)&&Q.value===z.value;return $.some((Q)=>X(Q.key,Z))}JU.mapIncludes=GU});var D9=M((_U)=>{var K9=X0(),HU=z0(),R9=Qq(),VU=oq(),M9=X2(),WU=Q2(),A9="All mapping items must start at the same column";function BU({composeNode:q,composeEmptyNode:$},Z,U,X,Q){let G=new(Q?.nodeClass??HU.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let J=U.offset,Y=null;for(let B of U.items){let{start:V,key:W,sep:O,value:F}=B,_=R9.resolveProps(V,{indicator:"explicit-key-ind",next:W??O?.[0],offset:J,onError:X,parentIndent:U.indent,startOnNewline:!0}),T=!_.found;if(T){if(W){if(W.type==="block-seq")X(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==U.indent)X(J,"BAD_INDENT",A9)}if(!_.anchor&&!_.tag&&!O){if(Y=_.end,_.comment)if(G.comment)G.comment+=`
|
|
65
|
+
`+_.comment;else G.comment=_.comment;continue}if(_.newlineAfterProp||VU.containsNewline(W))X(W??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(_.found?.indent!==U.indent)X(J,"BAD_INDENT",A9);Z.atKey=!0;let L=_.end,R=W?q(Z,W,_,X):$(Z,L,V,null,_,X);if(Z.schema.compat)M9.flowIndentCheck(U.indent,W,X);if(Z.atKey=!1,WU.mapIncludes(Z,G.items,R))X(L,"DUPLICATE_KEY","Map keys must be unique");let K=R9.resolveProps(O??[],{indicator:"map-value-ind",next:F,offset:R.range[2],onError:X,parentIndent:U.indent,startOnNewline:!W||W.type==="block-scalar"});if(J=K.end,K.found){if(T){if(F?.type==="block-map"&&!K.hasNewline)X(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&_.start<K.found.offset-1024)X(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let D=F?q(Z,F,K,X):$(Z,J,O,null,K,X);if(Z.schema.compat)M9.flowIndentCheck(U.indent,F,X);J=D.range[2];let w=new K9.Pair(R,D);if(Z.options.keepSourceTokens)w.srcToken=B;G.items.push(w)}else{if(T)X(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(K.comment)if(R.comment)R.comment+=`
|
|
66
|
+
`+K.comment;else R.comment=K.comment;let D=new K9.Pair(R);if(Z.options.keepSourceTokens)D.srcToken=B;G.items.push(D)}}if(Y&&Y<J)X(Y,"IMPOSSIBLE","Map comment with trailing content");return G.range=[U.offset,J,Y??J],G}_U.resolveBlockMap=BU});var w9=M((KU)=>{var TU=G0(),FU=Qq(),IU=X2();function LU({composeNode:q,composeEmptyNode:$},Z,U,X,Q){let G=new(Q?.nodeClass??TU.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let J=U.offset,Y=null;for(let{start:B,value:V}of U.items){let W=FU.resolveProps(B,{indicator:"seq-item-ind",next:V,offset:J,onError:X,parentIndent:U.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||V)if(V?.type==="block-seq")X(W.end,"BAD_INDENT","All sequence items must start at the same column");else X(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=W.end,W.comment)G.comment=W.comment;continue}let O=V?q(Z,V,W,X):$(Z,W.end,B,null,W,X);if(Z.schema.compat)IU.flowIndentCheck(U.indent,V,X);J=O.range[2],G.items.push(O)}return G.range=[U.offset,J,Y??J],G}KU.resolveBlockSeq=LU});var b0=M((AU)=>{function MU(q,$,Z,U){let X="";if(q){let Q=!1,z="";for(let G of q){let{source:J,type:Y}=G;switch(Y){case"space":Q=!0;break;case"comment":{if(Z&&!Q)U(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=J.substring(1)||" ";if(!X)X=B;else X+=z+B;z="";break}case"newline":if(X)z+=J;Q=!0;break;default:U(G,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}$+=J.length}}return{comment:X,offset:$}}AU.resolveEnd=MU});var j9=M((EU)=>{var wU=f(),PU=X0(),P9=z0(),NU=G0(),jU=b0(),N9=Qq(),CU=oq(),bU=Q2(),z2="Block collections are not allowed within flow collections",G2=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function SU({composeNode:q,composeEmptyNode:$},Z,U,X,Q){let z=U.start.source==="{",G=z?"flow map":"flow sequence",Y=new(Q?.nodeClass??(z?P9.YAMLMap:NU.YAMLSeq))(Z.schema);Y.flow=!0;let B=Z.atRoot;if(B)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let V=U.offset+U.start.source.length;for(let T=0;T<U.items.length;++T){let L=U.items[T],{start:R,key:K,sep:D,value:w}=L,P=N9.resolveProps(R,{flow:G,indicator:"explicit-key-ind",next:K??D?.[0],offset:V,onError:X,parentIndent:U.indent,startOnNewline:!1});if(!P.found){if(!P.anchor&&!P.tag&&!D&&!w){if(T===0&&P.comma)X(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(T<U.items.length-1)X(P.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(P.comment)if(Y.comment)Y.comment+=`
|
|
67
|
+
`+P.comment;else Y.comment=P.comment;V=P.end;continue}if(!z&&Z.options.strict&&CU.containsNewline(K))X(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===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 A="";q:for(let I of R)switch(I.type){case"comma":case"space":break;case"comment":A=I.source.substring(1);break q;default:break q}if(A){let I=Y.items[Y.items.length-1];if(wU.isPair(I))I=I.value??I.key;if(I.comment)I.comment+=`
|
|
68
|
+
`+A;else I.comment=A;P.comment=P.comment.substring(A.length+1)}}}if(!z&&!D&&!P.found){let A=w?q(Z,w,P,X):$(Z,P.end,D,null,P,X);if(Y.items.push(A),V=A.range[2],G2(w))X(A.range,"BLOCK_IN_FLOW",z2)}else{Z.atKey=!0;let A=P.end,I=K?q(Z,K,P,X):$(Z,A,R,null,P,X);if(G2(K))X(I.range,"BLOCK_IN_FLOW",z2);Z.atKey=!1;let C=N9.resolveProps(D??[],{flow:G,indicator:"map-value-ind",next:w,offset:I.range[2],onError:X,parentIndent:U.indent,startOnNewline:!1});if(C.found){if(!z&&!P.found&&Z.options.strict){if(D)for(let S of D){if(S===C.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<C.found.offset-1024)X(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(w)if("source"in w&&w.source?.[0]===":")X(w,"MISSING_CHAR",`Missing space after : in ${G}`);else X(C.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let N=w?q(Z,w,C,X):C.found?$(Z,C.end,D,null,C,X):null;if(N){if(G2(w))X(N.range,"BLOCK_IN_FLOW",z2)}else if(C.comment)if(I.comment)I.comment+=`
|
|
69
|
+
`+C.comment;else I.comment=C.comment;let b=new PU.Pair(I,N);if(Z.options.keepSourceTokens)b.srcToken=L;if(z){let S=Y;if(bU.mapIncludes(Z,S.items,I))X(A,"DUPLICATE_KEY","Map keys must be unique");S.items.push(b)}else{let S=new P9.YAMLMap(Z.schema);S.flow=!0,S.items.push(b);let g=(N??I).range;S.range=[I.range[0],g[1],g[2]],Y.items.push(S)}V=N?N.range[2]:C.end}}let W=z?"}":"]",[O,...F]=U.end,_=V;if(O?.source===W)_=O.offset+O.source.length;else{let T=G[0].toUpperCase()+G.substring(1),L=B?`${T} must end with a ${W}`:`${T} in block collection must be sufficiently indented and end with a ${W}`;if(X(V,B?"MISSING_CHAR":"BAD_INDENT",L),O&&O.source.length!==1)F.unshift(O)}if(F.length>0){let T=jU.resolveEnd(F,_,Z.options.strict,X);if(T.comment)if(Y.comment)Y.comment+=`
|
|
70
|
+
`+T.comment;else Y.comment=T.comment;Y.range=[U.offset,_,T.offset]}else Y.range=[U.offset,_,_];return Y}EU.resolveFlowCollection=SU});var C9=M((pU)=>{var yU=f(),xU=x(),gU=z0(),hU=G0(),kU=D9(),vU=w9(),uU=j9();function J2(q,$,Z,U,X,Q){let z=Z.type==="block-map"?kU.resolveBlockMap(q,$,Z,U,Q):Z.type==="block-seq"?vU.resolveBlockSeq(q,$,Z,U,Q):uU.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 mU(q,$,Z,U,X){let Q=U.tag,z=!Q?null:$.directives.tagName(Q.source,(W)=>X(Q,"TAG_RESOLVE_FAILED",W));if(Z.type==="block-seq"){let{anchor:W,newlineAfterProp:O}=U,F=W&&Q?W.offset>Q.offset?W:Q:W??Q;if(F&&(!O||O.offset<F.offset))X(F,"MISSING_CHAR","Missing newline after block sequence props")}let G=Z.type==="block-map"?"map":Z.type==="block-seq"?"seq":Z.start.source==="{"?"map":"seq";if(!Q||!z||z==="!"||z===gU.YAMLMap.tagName&&G==="map"||z===hU.YAMLSeq.tagName&&G==="seq")return J2(q,$,Z,X,z);let J=$.schema.tags.find((W)=>W.tag===z&&W.collection===G);if(!J){let W=$.schema.knownTags[z];if(W?.collection===G)$.schema.tags.push(Object.assign({},W,{default:!1})),J=W;else{if(W)X(Q,"BAD_COLLECTION_TYPE",`${W.tag} used for ${G} collection, but expects ${W.collection??"scalar"}`,!0);else X(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return J2(q,$,Z,X,z)}}let Y=J2(q,$,Z,X,z,J),B=J.resolve?.(Y,(W)=>X(Q,"TAG_RESOLVE_FAILED",W),$.options)??Y,V=yU.isNode(B)?B:new xU.Scalar(B);if(V.range=Y.range,V.tag=z,J?.format)V.format=J.format;return V}pU.composeCollection=mU});var H2=M((aU)=>{var Y2=x();function cU(q,$,Z){let U=$.offset,X=lU($,q.options.strict,Z);if(!X)return{value:"",type:null,comment:"",range:[U,U,U]};let Q=X.mode===">"?Y2.Scalar.BLOCK_FOLDED:Y2.Scalar.BLOCK_LITERAL,z=$.source?iU($.source):[],G=z.length;for(let _=z.length-1;_>=0;--_){let T=z[_][1];if(T===""||T==="\r")G=_;else break}if(G===0){let _=X.chomp==="+"&&z.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,z.length-1)):"",T=U+X.length;if($.source)T+=$.source.length;return{value:_,type:Q,comment:X.comment,range:[U,T,T]}}let J=$.indent+X.indent,Y=$.offset+X.length,B=0;for(let _=0;_<G;++_){let[T,L]=z[_];if(L===""||L==="\r"){if(X.indent===0&&T.length>J)J=T.length}else{if(T.length<J)Z(Y+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)J=T.length;if(B=_,J===0&&!q.atRoot)Z(Y,"BAD_INDENT","Block scalar values in collections must be indented");break}Y+=T.length+L.length+1}for(let _=z.length-1;_>=G;--_)if(z[_][0].length>J)G=_+1;let V="",W="",O=!1;for(let _=0;_<B;++_)V+=z[_][0].slice(J)+`
|
|
72
|
+
`;for(let _=B;_<G;++_){let[T,L]=z[_];Y+=T.length+L.length+1;let R=L[L.length-1]==="\r";if(R)L=L.slice(0,-1);if(L&&T.length<J){let D=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Z(Y-L.length-(R?2:1),"BAD_INDENT",D),T=""}if(Q===Y2.Scalar.BLOCK_LITERAL)V+=W+T.slice(J)+L,W=`
|
|
73
|
+
`;else if(T.length>J||L[0]==="\t"){if(W===" ")W=`
|
|
74
|
+
`;else if(!O&&W===`
|
|
75
75
|
`)W=`
|
|
76
76
|
|
|
77
|
-
`;V+=W+
|
|
78
|
-
`,
|
|
77
|
+
`;V+=W+T.slice(J)+L,W=`
|
|
78
|
+
`,O=!0}else if(L==="")if(W===`
|
|
79
79
|
`)V+=`
|
|
80
80
|
`;else W=`
|
|
81
|
-
`;else V+=W+
|
|
81
|
+
`;else V+=W+L,W=" ",O=!1}switch(X.chomp){case"-":break;case"+":for(let _=G;_<z.length;++_)V+=`
|
|
82
82
|
`+z[_][0].slice(J);if(V[V.length-1]!==`
|
|
83
83
|
`)V+=`
|
|
84
84
|
`;break;default:V+=`
|
|
85
|
-
`}let F=X
|
|
85
|
+
`}let F=U+X.length+$.source.length;return{value:V,type:Q,comment:X.comment,range:[U,F,F]}}function lU({offset:q,props:$},Z,U){if($[0].type!=="block-scalar-header")return U($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=$[0],Q=X[0],z=0,G="",J=-1;for(let W=1;W<X.length;++W){let O=X[W];if(!G&&(O==="-"||O==="+"))G=O;else{let F=Number(O);if(!z&&F)z=F;else if(J===-1)J=q+W}}if(J!==-1)U(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let Y=!1,B="",V=X.length;for(let W=1;W<$.length;++W){let O=$[W];switch(O.type){case"space":Y=!0;case"newline":V+=O.source.length;break;case"comment":if(Z&&!Y)U(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=O.source.length,B=O.source.substring(1);break;case"error":U(O,"UNEXPECTED_TOKEN",O.message),V+=O.source.length;break;default:{let F=`Unexpected token in block scalar header: ${O.type}`;U(O,"UNEXPECTED_TOKEN",F);let _=O.source;if(_&&typeof _==="string")V+=_.length}}}return{mode:Q,indent:z,chomp:G,comment:B,length:V}}function iU(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}aU.resolveBlockScalar=cU});var W2=M((UX)=>{var V2=x(),sU=b0();function oU(q,$,Z){let{offset:U,type:X,source:Q,end:z}=q,G,J,Y=(W,O,F)=>Z(U+W,O,F);switch(X){case"scalar":G=V2.Scalar.PLAIN,J=rU(Q,Y);break;case"single-quoted-scalar":G=V2.Scalar.QUOTE_SINGLE,J=tU(Q,Y);break;case"double-quoted-scalar":G=V2.Scalar.QUOTE_DOUBLE,J=eU(Q,Y);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[U,U+Q.length,U+Q.length]}}let B=U+Q.length,V=sU.resolveEnd(z,B,$,Z);return{value:J,type:G,comment:V.comment,range:[U,B,V.offset]}}function rU(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 b9(q)}function tU(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return b9(q.slice(1,-1)).replace(/''/g,"'")}function b9(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
-
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let
|
|
88
|
-
`)Q
|
|
89
|
-
`;else Q
|
|
90
|
-
`)continue;if(
|
|
91
|
-
`){let{fold:
|
|
92
|
-
`){
|
|
93
|
-
`){
|
|
94
|
-
`&&!(z==="\r"&&q[
|
|
95
|
-
`))Z+=
|
|
96
|
-
`||
|
|
97
|
-
`)break;if(
|
|
87
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let U=$.exec(q);if(!U)return q;let X=U[1],Q=" ",z=$.lastIndex;Z.lastIndex=z;while(U=Z.exec(q)){if(U[1]==="")if(Q===`
|
|
88
|
+
`)X+=Q;else Q=`
|
|
89
|
+
`;else X+=Q+U[1],Q=" ";z=Z.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,U=G.exec(q),X+Q+(U?.[1]??"")}function eU(q,$){let Z="";for(let U=1;U<q.length-1;++U){let X=q[U];if(X==="\r"&&q[U+1]===`
|
|
90
|
+
`)continue;if(X===`
|
|
91
|
+
`){let{fold:Q,offset:z}=qX(q,U);Z+=Q,U=z}else if(X==="\\"){let Q=q[++U],z=$X[Q];if(z)Z+=z;else if(Q===`
|
|
92
|
+
`){Q=q[U+1];while(Q===" "||Q==="\t")Q=q[++U+1]}else if(Q==="\r"&&q[U+1]===`
|
|
93
|
+
`){Q=q[++U+1];while(Q===" "||Q==="\t")Q=q[++U+1]}else if(Q==="x"||Q==="u"||Q==="U"){let G={x:2,u:4,U:8}[Q];Z+=ZX(q,U+1,G,$),U+=G}else{let G=q.substr(U-1,2);$(U-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),Z+=G}}else if(X===" "||X==="\t"){let Q=U,z=q[U+1];while(z===" "||z==="\t")z=q[++U+1];if(z!==`
|
|
94
|
+
`&&!(z==="\r"&&q[U+2]===`
|
|
95
|
+
`))Z+=U>Q?q.slice(Q,U+1):X}else Z+=X}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function qX(q,$){let Z="",U=q[$+1];while(U===" "||U==="\t"||U===`
|
|
96
|
+
`||U==="\r"){if(U==="\r"&&q[$+2]!==`
|
|
97
|
+
`)break;if(U===`
|
|
98
98
|
`)Z+=`
|
|
99
|
-
`;$+=1,
|
|
100
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
99
|
+
`;$+=1,U=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var $X={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function ZX(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)}UX.resolveFlowScalar=oU});var E9=M((HX)=>{var O0=f(),S9=x(),QX=H2(),zX=W2();function GX(q,$,Z,U){let{value:X,type:Q,comment:z,range:G}=$.type==="block-scalar"?QX.resolveBlockScalar(q,$,U):zX.resolveFlowScalar($,q.options.strict,U),J=Z?q.directives.tagName(Z.source,(V)=>U(Z,"TAG_RESOLVE_FAILED",V)):null,Y;if(q.options.stringKeys&&q.atKey)Y=q.schema[O0.SCALAR];else if(J)Y=JX(q.schema,X,J,Z,U);else if($.type==="scalar")Y=YX(q,X,$,U);else Y=q.schema[O0.SCALAR];let B;try{let V=Y.resolve(X,(W)=>U(Z??$,"TAG_RESOLVE_FAILED",W),q.options);B=O0.isScalar(V)?V:new S9.Scalar(V)}catch(V){let W=V instanceof Error?V.message:String(V);U(Z??$,"TAG_RESOLVE_FAILED",W),B=new S9.Scalar(X)}if(B.range=G,B.source=X,Q)B.type=Q;if(J)B.tag=J;if(Y.format)B.format=Y.format;if(z)B.comment=z;return B}function JX(q,$,Z,U,X){if(Z==="!")return q[O0.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[O0.SCALAR]}function YX({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[O0.SCALAR];if(Z.compat){let G=Z.compat.find((J)=>J.default&&J.test?.test(U))??Z[O0.SCALAR];if(z.tag!==G.tag){let J=$.tagString(z.tag),Y=$.tagString(G.tag),B=`Value may be parsed as either ${J} or ${Y}`;Q(X,"TAG_RESOLVE_FAILED",B,!0)}}return z}HX.composeScalar=GX});var f9=M((BX)=>{function WX(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}BX.emptyScalarPosition=WX});var g9=M((MX)=>{var OX=p0(),TX=f(),FX=C9(),y9=E9(),IX=b0(),LX=f9(),KX={composeNode:x9,composeEmptyNode:B2};function x9(q,$,Z,U){let X=q.atKey,{spaceBefore:Q,comment:z,anchor:G,tag:J}=Z,Y,B=!0;switch($.type){case"alias":if(Y=RX(q,$,U),G||J)U($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(Y=y9.composeScalar(q,$,J,U),G)Y.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(Y=FX.composeCollection(KX,q,$,Z,U),G)Y.anchor=G.source.substring(1);break;default:{let V=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;U($,"UNEXPECTED_TOKEN",V),Y=B2(q,$.offset,void 0,null,Z,U),B=!1}}if(G&&Y.anchor==="")U(G,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&q.options.stringKeys&&(!TX.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))U(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)Y.spaceBefore=!0;if(z)if($.type==="scalar"&&$.source==="")Y.comment=z;else Y.commentBefore=z;if(q.options.keepSourceTokens&&B)Y.srcToken=$;return Y}function B2(q,$,Z,U,{spaceBefore:X,comment:Q,anchor:z,tag:G,end:J},Y){let B={type:"scalar",offset:LX.emptyScalarPosition($,Z,U),indent:-1,source:""},V=y9.composeScalar(q,B,G,Y);if(z){if(V.anchor=z.source.substring(1),V.anchor==="")Y(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=J;return V}function RX({options:q},{offset:$,source:Z,end:U},X){let Q=new OX.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=IX.resolveEnd(U,z,q.strict,X);if(Q.range=[$,z,G.offset],G.comment)Q.comment=G.comment;return Q}MX.composeEmptyNode=B2;MX.composeNode=x9});var k9=M((CX)=>{var wX=Uq(),h9=g9(),PX=b0(),NX=Qq();function jX(q,$,{offset:Z,start:U,value:X,end:Q},z){let G=Object.assign({_directives:$},q),J=new wX.Document(void 0,G),Y={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},B=NX.resolveProps(U,{indicator:"doc-start",next:X??Q?.[0],offset:Z,onError:z,parentIndent:0,startOnNewline:!0});if(B.found){if(J.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!B.hasNewline)z(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=X?h9.composeNode(Y,X,B,z):h9.composeEmptyNode(Y,B.end,U,null,B,z);let V=J.contents.range[2],W=PX.resolveEnd(Q,V,!1,z);if(W.comment)J.comment=W.comment;return J.range=[Z,V,W.offset],J}CX.composeDoc=jX});var _2=M((gX)=>{var SX=k("process"),EX=I$(),fX=Uq(),zq=Xq(),v9=f(),yX=k9(),xX=b0();function Gq(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 u9(q){let $="",Z=!1,U=!1;for(let X=0;X<q.length;++X){let Q=q[X];switch(Q[0]){case"#":$+=($===""?"":U?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(
|
|
104
|
-
${Z}`:Z;else if(
|
|
105
|
-
${z}`:Z}else{let
|
|
106
|
-
${
|
|
107
|
-
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new
|
|
103
|
+
`)+(Q.substring(1)||" "),Z=!0,U=!1;break;case"%":if(q[X+1]?.[0]!=="#")X+=1;Z=!1;break;default:if(!Z)U=!0;Z=!1}}return{comment:$,afterEmptyLine:U}}class m9{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,U,X)=>{let Q=Gq($);if(X)this.warnings.push(new zq.YAMLWarning(Q,Z,U));else this.errors.push(new zq.YAMLParseError(Q,Z,U))},this.directives=new EX.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:U}=u9(this.prelude);if(Z){let X=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
104
|
+
${Z}`:Z;else if(U||q.directives.docStart||!X)q.commentBefore=Z;else if(v9.isCollection(X)&&!X.flow&&X.items.length>0){let Q=X.items[0];if(v9.isPair(Q))Q=Q.key;let z=Q.commentBefore;Q.commentBefore=z?`${Z}
|
|
105
|
+
${z}`:Z}else{let Q=X.commentBefore;X.commentBefore=Q?`${Z}
|
|
106
|
+
${Q}`:Z}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:u9(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(SX.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,U)=>{let X=Gq(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 zq.YAMLParseError(Gq(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 zq.YAMLParseError(Gq(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=xX.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
|
|
107
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new zq.YAMLParseError(Gq(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 fX.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}}}gX.Composer=m9});var c9=M((lX)=>{var kX=H2(),vX=W2(),uX=Xq(),p9=i0();function mX(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 uX.YAMLParseError([G,G+1],Q,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return vX.resolveFlowScalar(q,$,U);case"block-scalar":return kX.resolveBlockScalar({options:{strict:$}},q,U)}}return null}function pX(q,$){let{implicitKey:Z=!1,indent:U,inFlow:X=!1,offset:Q=-1,type:z="PLAIN"}=$,G=p9.stringifyString({type:z,value:q},{implicitKey:Z,indent:U>0?" ".repeat(U):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:U,source:`
|
|
108
108
|
`}];switch(G[0]){case"|":case">":{let Y=G.indexOf(`
|
|
109
109
|
`),B=G.substring(0,Y),V=G.substring(Y+1)+`
|
|
110
|
-
`,W=[{type:"block-scalar-header",offset:
|
|
111
|
-
`});return{type:"block-scalar",offset:
|
|
112
|
-
`),
|
|
113
|
-
`;if(q.type==="block-scalar"){let
|
|
114
|
-
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:z,props:G,source:
|
|
115
|
-
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[
|
|
110
|
+
`,W=[{type:"block-scalar-header",offset:Q,indent:U,source:B}];if(!d9(W,J))W.push({type:"newline",offset:-1,indent:U,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:Q,indent:U,props:W,source:V}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:U,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:Q,indent:U,source:G,end:J};default:return{type:"scalar",offset:Q,indent:U,source:G,end:J}}}function dX(q,$,Z={}){let{afterKey:U=!1,implicitKey:X=!1,inFlow:Q=!1,type:z}=Z,G="indent"in q?q.indent:null;if(U&&typeof G==="number")G+=2;if(!z)switch(q.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let Y=q.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let J=p9.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">":cX(q,J);break;case'"':O2(q,J,"double-quoted-scalar");break;case"'":O2(q,J,"single-quoted-scalar");break;default:O2(q,J,"scalar")}}function cX(q,$){let Z=$.indexOf(`
|
|
112
|
+
`),U=$.substring(0,Z),X=$.substring(Z+1)+`
|
|
113
|
+
`;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=U,q.source=X}else{let{offset:Q}=q,z="indent"in q?q.indent:-1,G=[{type:"block-scalar-header",offset:Q,indent:z,source:U}];if(!d9(G,"end"in q?q.end:void 0))G.push({type:"newline",offset:-1,indent:z,source:`
|
|
114
|
+
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:z,props:G,source:X})}}function d9(q,$){if($)for(let Z of $)switch(Z.type){case"space":case"comment":q.push(Z);break;case"newline":return q.push(Z),!0}return!1}function O2(q,$,Z){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=Z,q.source=$;break;case"block-scalar":{let U=q.props.slice(1),X=$.length;if(q.props[0].type==="block-scalar-header")X-=q.props[0].source.length;for(let Q of U)Q.offset+=X;delete q.props,Object.assign(q,{type:Z,source:$,end:U});break}case"block-map":case"block-seq":{let X={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
115
|
+
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[X]});break}default:{let U="indent"in q?q.indent:-1,X="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:Z,indent:U,source:$,end:X})}}}lX.createScalarToken=pX;lX.resolveAsScalar=mX;lX.setScalarValue=dX});var l9=M((oX)=>{var sX=(q)=>("type"in q)?tq(q):rq(q);function tq(q){switch(q.type){case"block-scalar":{let $="";for(let Z of q.props)$+=tq(Z);return $+q.source}case"block-map":case"block-seq":{let $="";for(let Z of q.items)$+=rq(Z);return $}case"flow-collection":{let $=q.start.source;for(let Z of q.items)$+=rq(Z);for(let Z of q.end)$+=Z.source;return $}case"document":{let $=rq(q);if(q.end)for(let Z of q.end)$+=Z.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let Z of q.end)$+=Z.source;return $}}}function rq({start:q,key:$,sep:Z,value:U}){let X="";for(let Q of q)X+=Q.source;if($)X+=tq($);if(Z)for(let Q of Z)X+=Q.source;if(U)X+=tq(U);return X}oX.stringify=sX});var n9=M((eX)=>{var T2=Symbol("break visit"),tX=Symbol("skip children"),i9=Symbol("remove item");function T0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};a9(Object.freeze([]),q,$)}T0.BREAK=T2;T0.SKIP=tX;T0.REMOVE=i9;T0.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};T0.parentCollection=(q,$)=>{let Z=T0.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 a9(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=a9(Object.freeze(q.concat([[X,z]])),Q.items[z],Z);if(typeof G==="number")z=G-1;else if(G===T2)return T2;else if(G===i9)Q.items.splice(z,1),z-=1}if(typeof U==="function"&&X==="key")U=U($,q)}}return typeof U==="function"?U($,q):U}eX.visit=T0});var eq=M((GQ)=>{var F2=c9(),$Q=l9(),ZQ=n9(),I2="\uFEFF",L2="\x02",K2="\x18",R2="\x1F",UQ=(q)=>!!q&&("items"in q),XQ=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function QQ(q){switch(q){case I2:return"<BOM>";case L2:return"<DOC>";case K2:return"<FLOW_END>";case R2:return"<SCALAR>";default:return JSON.stringify(q)}}function zQ(q){switch(q){case I2:return"byte-order-mark";case L2:return"doc-mode";case K2:return"flow-error-end";case R2:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
118
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
119
|
-
\r `),M2=(q)=>!q||
|
|
117
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}GQ.createScalarToken=F2.createScalarToken;GQ.resolveAsScalar=F2.resolveAsScalar;GQ.setScalarValue=F2.setScalarValue;GQ.stringify=$Q.stringify;GQ.visit=ZQ.visit;GQ.BOM=I2;GQ.DOCUMENT=L2;GQ.FLOW_END=K2;GQ.SCALAR=R2;GQ.isCollection=UQ;GQ.isScalar=XQ;GQ.prettyToken=QQ;GQ.tokenType=zQ});var A2=M((AQ)=>{var Jq=eq();function i(q){switch(q){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var s9=new Set("0123456789ABCDEFabcdef"),RQ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),q$=new Set(",[]{}"),MQ=new Set(` ,[]{}
|
|
119
|
+
\r `),M2=(q)=>!q||MQ.has(q);class o9{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let Z=this.next??"stream";while(Z&&($||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
120
120
|
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
121
|
-
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let
|
|
122
|
-
`||!
|
|
123
|
-
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&
|
|
124
|
-
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===
|
|
125
|
-
`,this.pos);if(
|
|
126
|
-
`,
|
|
127
|
-
`:q=
|
|
128
|
-
`)break}default:break q}if(!Z&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let
|
|
129
|
-
`,
|
|
130
|
-
`)Z=this.buffer[++
|
|
131
|
-
`&&
|
|
132
|
-
`)Z+=1,
|
|
133
|
-
`,
|
|
134
|
-
`){let
|
|
121
|
+
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let U=this.buffer[Z+q+1];if(U===`
|
|
122
|
+
`||!U&&!this.atEnd)return q+Z+1}return $===`
|
|
123
|
+
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&i(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
124
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Jq.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 Jq.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(($==="---"||$==="...")&&i(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&&!i(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===":")&&i($)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(M2),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,Z=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=Z=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let U=this.getLine();if(U===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&U[0]!=="#"||Z===0&&(U.startsWith("---")||U.startsWith("..."))&&i(U[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(U[0]==="]"||U[0]==="}")))return this.flowLevel=0,yield Jq.FLOW_END,yield*this.parseLineStart()}let X=0;while(U[X]===",")X+=yield*this.pushCount(1),X+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(X+=yield*this.pushIndicators(),U[X]){case void 0:return"flow";case"#":return yield*this.pushCount(U.length-X),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(M2),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||i(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let X=0;while(this.buffer[$-1-X]==="\\")X+=1;if(X%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),U=Z.indexOf(`
|
|
125
|
+
`,this.pos);if(U!==-1){while(U!==-1){let X=this.continueScalar(U+1);if(X===-1)break;U=Z.indexOf(`
|
|
126
|
+
`,X)}if(U!==-1)$=U-(Z[U-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>i($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let X=this.pos;Z=this.buffer[X];++X)switch(Z){case" ":$+=1;break;case`
|
|
127
|
+
`:q=X,$=0;break;case"\r":{let Q=this.buffer[X+1];if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Q===`
|
|
128
|
+
`)break}default:break q}if(!Z&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let X=this.continueScalar(q+1);if(X===-1)break;q=this.buffer.indexOf(`
|
|
129
|
+
`,X)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let U=q+1;Z=this.buffer[U];while(Z===" ")Z=this.buffer[++U];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
|
|
130
|
+
`)Z=this.buffer[++U];q=U-1}else if(!this.blockScalarKeep)do{let X=q-1,Q=this.buffer[X];if(Q==="\r")Q=this.buffer[--X];let z=X;while(Q===" ")Q=this.buffer[--X];if(Q===`
|
|
131
|
+
`&&X>=this.pos&&X+1+$>z)q=X;else break}while(!0);return yield Jq.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(i(X)||q&&q$.has(X))break;$=Z}else if(i(U)){let X=this.buffer[Z+1];if(U==="\r")if(X===`
|
|
132
|
+
`)Z+=1,U=`
|
|
133
|
+
`,X=this.buffer[Z+1];else $=Z;if(X==="#"||q&&q$.has(X))break;if(U===`
|
|
134
|
+
`){let Q=this.continueScalar(Z+1);if(Q===-1)break;Z=Math.max(Z,Q-2)}}else{if(q&&q$.has(U))break;$=Z}if(!U&&!this.atEnd)return this.setNext("plain-scalar");return yield Jq.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let Z=this.buffer.slice(this.pos,q);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(M2))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(i($)||q&&q$.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!i($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(RQ.has($))$=this.buffer[++q];else if($==="%"&&s9.has(this.buffer[q+1])&&s9.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
135
135
|
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
136
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let U=$-this.pos;if(U>0)yield this.buffer.substr(this.pos,U),this.pos=$;return U}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}AQ.Lexer=o9});var D2=M((wQ)=>{class r9{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}}}}wQ.LineCounter=r9});var w2=M((CQ)=>{var NQ=k("process"),t9=eq(),jQ=A2();function J0(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function e9(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function $4(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $$(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function S0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function q4(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!J0($.start,"explicit-key-ind")&&!J0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,$4($.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 Z4{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 jQ.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,NQ.env.LOG_TOKENS)console.log("|",t9.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=t9.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")q4($);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&&e9(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(e9(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=$$(this.peek(2)),Z=S0($),U;if(q.end)U=q.end,U.push(this.sourceToken),delete q.end;else U=[this.sourceToken];let X={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
137
137
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
138
|
-
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let
|
|
138
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let U=q.items[q.items.length-2]?.value?.end;if(Array.isArray(U)){Array.prototype.push.apply(U,$.start),U.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,U=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",X=[];if(U&&$.sep&&!$.value){let Q=[];for(let z=0;z<$.sep.length;++z){let G=$.sep[z];switch(G.type){case"newline":Q.push(z);break;case"space":break;case"comment":if(G.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)X=$.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(U||$.value)X.push(this.sourceToken),q.items.push({start:X}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(U||$.value)X.push(this.sourceToken),q.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(J0($.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(J0($.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($4($.key)&&!J0($.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(J0($.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&&!J0($.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||J0($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let Z=this.startBlockValue(q);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:U,sep:[]});else if($.sep)this.stack.push(U);else Object.assign($,{key:U,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===q.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let U=$$(Z),X=S0(U);q4(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
139
139
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
140
|
-
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=$$(q),Z=S0($);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=$$(q),Z=S0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}
|
|
141
|
-
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class
|
|
142
|
-
`;
|
|
143
|
-
`){
|
|
144
|
-
`:
|
|
140
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=$$(q),Z=S0($);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=$$(q),Z=S0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}CQ.Parser=Z4});var G4=M((kQ)=>{var U4=_2(),SQ=Uq(),Yq=Xq(),EQ=D$(),fQ=f(),yQ=D2(),X4=w2();function Q4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new yQ.LineCounter||null,prettyErrors:$}}function xQ(q,$={}){let{lineCounter:Z,prettyErrors:U}=Q4($),X=new X4.Parser(Z?.addNewLine),Q=new U4.Composer($),z=Array.from(Q.compose(X.parse(q)));if(U&&Z)for(let G of z)G.errors.forEach(Yq.prettifyError(q,Z)),G.warnings.forEach(Yq.prettifyError(q,Z));if(z.length>0)return z;return Object.assign([],{empty:!0},Q.streamInfo())}function z4(q,$={}){let{lineCounter:Z,prettyErrors:U}=Q4($),X=new X4.Parser(Z?.addNewLine),Q=new U4.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 Yq.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(U&&Z)z.errors.forEach(Yq.prettifyError(q,Z)),z.warnings.forEach(Yq.prettifyError(q,Z));return z}function gQ(q,$,Z){let U=void 0;if(typeof $==="function")U=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let X=z4(q,Z);if(!X)return null;if(X.warnings.forEach((Q)=>EQ.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 hQ(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(fQ.isDocument(q)&&!U)return q.toString(Z);return new SQ.Document(q,U,Z).toString(Z)}kQ.parse=gQ;kQ.parseAllDocuments=xQ;kQ.parseDocument=z4;kQ.stringify=hQ});import{execFile as B8}from"child_process";import{promisify as _8}from"util";import{mkdtemp as m2,readdir as O8,readFile as B$,rm as Bq,cp as T8,access as p2,stat as F8,lstat as I8,symlink as L8,mkdir as K8}from"fs/promises";import{join as r,resolve as d2,relative as R8,basename as M8}from"path";import{homedir as c2}from"os";import{tmpdir as l2}from"os";import{readdir as z8,readFile as G8,stat as J8}from"fs/promises";import{join as Y8}from"path";var H8=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"]),V8=524288;async function Vq(q){let $=[];async function Z(U,X){let Q;try{Q=await z8(U)}catch{return}for(let z of Q){if(z===".git"||z==="node_modules")continue;let G=Y8(U,z),J=X?`${X}/${z}`:z;try{let Y=await J8(G);if(Y.isDirectory())await Z(G,J);else if(Y.isFile()){let B=z.includes(".")?`.${z.split(".").pop().toLowerCase()}`:"";if(H8.has(B))continue;if(Y.size>V8)continue;try{let V=await G8(G,"utf-8");$.push({relPath:J,content:V,lineCount:V.split(`
|
|
141
|
+
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class u2{selected;cursor;scrollOffset;pageSize;itemCount;filter;searchActive;filteredMap;constructor(q,$){this.selected=q.map((Z)=>Z.checked),this.cursor=1,this.scrollOffset=0,this.pageSize=$,this.itemCount=q.length,this.filter="",this.searchActive=!1,this.filteredMap=q.map((Z,U)=>U)}get totalRows(){return this.filteredMap.length+1}applyFilter(q){if(this.filter==="")this.filteredMap=q.map(($,Z)=>Z);else{let $=this.filter.toLowerCase();this.filteredMap=[];for(let Z=0;Z<q.length;Z++)if((q[Z].label.toLowerCase()+" "+(q[Z].hint?.toLowerCase()??"")).includes($))this.filteredMap.push(Z)}if(this.cursor>=this.totalRows)this.cursor=Math.max(0,this.totalRows-1);if(this.scrollOffset>0&&this.scrollOffset>=this.totalRows)this.scrollOffset=Math.max(0,this.totalRows-this.pageSize)}cursorToOriginalIndex(){if(this.cursor===0)return-1;return this.filteredMap[this.cursor-1]??-1}toggleCurrent(){if(this.cursor===0)this.toggleAll();else{let q=this.cursorToOriginalIndex();if(q>=0)this.selected[q]=!this.selected[q]}}toggleAll(){let q=this.filteredMap,Z=!q.every((U)=>this.selected[U]);for(let U of q)this.selected[U]=Z}moveUp(){if(this.cursor>0)this.cursor--;else this.cursor=this.totalRows-1;this.adjustScroll()}moveDown(){if(this.cursor<this.totalRows-1)this.cursor++;else this.cursor=0;this.adjustScroll()}getSelectedIndices(){let q=[];for(let $=0;$<this.selected.length;$++)if(this.selected[$])q.push($);return q}getVisibleRange(){let q=this.scrollOffset,$=Math.min(this.scrollOffset+this.pageSize,this.totalRows);return{start:q,end:$}}adjustScroll(){if(this.cursor<this.scrollOffset)this.scrollOffset=this.cursor;else if(this.cursor>=this.scrollOffset+this.pageSize)this.scrollOffset=this.cursor-this.pageSize+1}}function W8(q,$,Z){let U=[];if(q.searchActive||q.filter!==""){let Y=H.cyan("/"),B=q.filter,V=q.searchActive?H.cyan("█"):"";if(U.push(` ${Y}${B}${V}`),q.filteredMap.length===0)U.push(H.dim(" No matches found"));U.push("")}let{start:X,end:Q}=q.getVisibleRange();if(X>0)U.push(H.dim(` ... ${X} more above`));for(let Y=X;Y<Q;Y++){let V=Y===q.cursor?H.cyan(">"):" ";if(Y===0){let W=q.filteredMap,F=W.length>0&&W.every((T)=>q.selected[T])?H.green("[*]"):"[ ]",_=q.filter!==""?`Select All Matching (${q.filteredMap.length})`:"Select All / Deselect All";U.push(`${V} ${F} ${H.bold(_)}`)}else{let W=q.filteredMap[Y-1],O=$[W],_=q.selected[W]?H.green("[*]"):"[ ]",T=`${V} ${_} `,L=7,R=H.bold(O.label),K=O.label.length;if(O.hint){let D=Z-7-K-2;if(D>10){let w=H$(O.hint,D);U.push(`${T}${R} ${H.dim(w)}`)}else{let w=H$(O.label,Z-7);U.push(`${T}${H.bold(w)}`)}}else{let D=H$(O.label,Z-7);U.push(`${T}${H.bold(D)}`)}}}let z=q.totalRows-Q;if(z>0)U.push(H.dim(` ... ${z} more below`));let G=q.getSelectedIndices().length,J=q.filter!==""?` matching: ${q.filteredMap.length}/${q.itemCount}`:"";if(U.push(""),q.searchActive)U.push(H.dim(` ${G} of ${q.itemCount} selected${J} | Type to filter Esc Clear Enter Done searching`));else U.push(H.dim(` ${G} of ${q.itemCount} selected${J} | `+"↑/↓ Navigate Space Toggle a All / Search Enter Confirm Esc Cancel"));return U}function H$(q,$){if($<=0)return"";if(q.length<=$)return q;if($<=3)return q.slice(0,$);return q.slice(0,$-3)+"..."}async function y0(q){let{items:$}=q,Z=q.pageSize??Math.min($.length+1,15),U=new u2($,Z),X=process.stderr,Q=process.stdin,z=X.columns||80;if(typeof Q.setRawMode==="function")Q.setRawMode(!0);Q.resume(),Q.setEncoding("utf-8"),X.write("\x1B[?25l");let G=0;function J(){let Y=W8(U,$,z);if(G>0)X.write(`\x1B[${G}F`);let B=Math.max(Y.length,G),V="";for(let W=0;W<B;W++)V+=`\x1B[2K${W<Y.length?Y[W]:""}
|
|
142
|
+
`;X.write(V),G=B}return J(),new Promise((Y)=>{let B="",V=null;function W(){if(Q.removeListener("data",_),typeof Q.setRawMode==="function")Q.setRawMode(!1);if(Q.pause(),X.write("\x1B[?25h"),V)clearTimeout(V)}function O(T){W(),Y(T)}function F(T){if(U.searchActive){if(T==="\x1B"){U.searchActive=!1,U.filter="",U.applyFilter($),J();return}if(T==="\r"||T===`
|
|
143
|
+
`){U.searchActive=!1,J();return}if(T===""||T==="\b"){if(U.filter.length>0)U.filter=U.filter.slice(0,-1),U.applyFilter($);else U.searchActive=!1;J();return}if(T==="\x03"){W(),process.kill(process.pid,"SIGINT");return}if(T==="\x1B[A"){U.moveUp(),J();return}if(T==="\x1B[B"){U.moveDown(),J();return}if(T===" "){U.toggleCurrent(),J();return}if(T.length===1&&T>=" "&&T<="~"){U.filter+=T,U.applyFilter($),J();return}return}switch(T){case"\x1B[A":case"k":U.moveUp(),J();break;case"\x1B[B":case"j":U.moveDown(),J();break;case" ":U.toggleCurrent(),J();break;case"a":U.toggleAll(),J();break;case"/":U.searchActive=!0,J();break;case"\r":case`
|
|
144
|
+
`:O(U.getSelectedIndices());break;case"\x1B":if(U.filter!=="")U.filter="",U.applyFilter($),J();else O([]);break;case"":case"\b":if(U.filter.length>0)U.filter=U.filter.slice(0,-1),U.applyFilter($),J();break;case"\x03":W(),process.kill(process.pid,"SIGINT");break}}function _(T){if(B.length>0){if(B+=T,V)clearTimeout(V);if(B.length>=3&&B[1]==="["){let R=B.slice(0,3),K=B.slice(3);if(B="",F(R),K)_(K);return}let L=B;B="",F("\x1B");for(let R=1;R<L.length;R++)F(L[R]);return}for(let L=0;L<T.length;L++){let R=T[L];if(R==="\x1B"){let K=T.slice(L);if(K.length>=3&&K[1]==="[")F(K.slice(0,3)),L+=2;else if(K.length>=2){B=K,V=setTimeout(()=>{let D=B;B="",F("\x1B");for(let w=1;w<D.length;w++)F(D[w])},50);return}else{B="\x1B",V=setTimeout(()=>{B="",F("\x1B")},50);return}}else F(R)}}Q.on("data",_)})}var x0=_8(B8),A8=/^[a-zA-Z0-9_-]+$/,D8=/^[a-zA-Z0-9._-]+$/,w8=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,i2=128,P8=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\/tree\/(.+))?\/?$/;function N8(q){return q.startsWith("/")||q.startsWith("./")||q.startsWith("../")||q.startsWith("~/")||q==="~"||q==="."||q===".."}function j8(q){let $;if(q==="~")$=c2();else if(q.startsWith("~/"))$=d2(c2(),q.slice(2));else $=d2(q);let Z=M8($);return y(`install: parsed local source -> path=${$}`),{owner:"local",repo:Z,ref:null,subpath:null,cloneUrl:"",sshCloneUrl:"",isLocal:!0,localPath:$}}function g0(q){if(N8(q))return j8(q);let $=P8.exec(q);if($){let[,V,W,O]=$,F=W.endsWith(".git")?W.slice(0,-4):W;q=`github:${V}/${F}${O?`#${O}`:""}`}if(!q.startsWith("github:"))throw Error(`Invalid source format. Got: "${q}"
|
|
145
145
|
Supported formats:
|
|
146
146
|
github:owner/repo[#ref]
|
|
147
147
|
github:owner/repo#ref:path
|
|
148
148
|
https://github.com/owner/repo
|
|
149
149
|
https://github.com/owner/repo/tree/branch/path/to/skill
|
|
150
150
|
/path/to/local/skill
|
|
151
|
-
./relative/path/to/skill`);let Z=q.slice(7),
|
|
152
|
-
`)){let
|
|
153
|
-
HTTPS: ${Wq(
|
|
154
|
-
SSH: ${Wq(
|
|
155
|
-
`);for(let z=0;z<
|
|
156
|
-
`),Z=!1,
|
|
157
|
-
`),Z=-1;for(let
|
|
158
|
-
`);return null}function
|
|
151
|
+
./relative/path/to/skill`);let Z=q.slice(7),U=Z.indexOf("#"),X,Q=null,z=null;if(U!==-1){X=Z.slice(0,U);let V=Z.slice(U+1);if(!V)throw Error("Invalid source: ref cannot be empty after #");let W=V.indexOf(":");if(W!==-1){if(Q=V.slice(0,W),!Q)throw Error("Invalid source: ref cannot be empty before :");z=V.slice(W+1)||null}else Q=V}else{let V=Z.indexOf(":");if(V!==-1)X=Z.slice(0,V),z=Z.slice(V+1)||null;else X=Z}let G=X.indexOf("/");if(G===-1)throw Error(`Invalid source: format must be github:owner/repo. Got: "${q}"`);let J=X.slice(0,G),Y=X.slice(G+1);if(!J)throw Error("Invalid source: owner cannot be empty");if(!Y)throw Error("Invalid source: repo cannot be empty");if(!A8.test(J))throw Error(`Invalid source: owner contains invalid characters: "${J}". Allowed: [a-zA-Z0-9_-]`);if(!D8.test(Y))throw Error(`Invalid source: repo contains invalid characters: "${Y}". Allowed: [a-zA-Z0-9._-]`);let B={owner:J,repo:Y,ref:Q,subpath:z,cloneUrl:`https://github.com/${J}/${Y}.git`,sshCloneUrl:`git@github.com:${J}/${Y}.git`};return y(`install: parsed source -> owner=${J} repo=${Y} ref=${Q} subpath=${z}`),B}async function _$(q){if(q.subpath!==null||!q.ref||!q.ref.includes("/"))return q;try{let{stdout:$}=await x0("git",["ls-remote","--heads","--tags",q.cloneUrl],{timeout:15000}),Z=new Set;for(let X of $.split(`
|
|
152
|
+
`)){let Q=X.match(/\trefs\/(?:heads|tags)\/(.+)$/);if(Q)Z.add(Q[1])}let U=q.ref.split("/");for(let X=1;X<U.length;X++){let Q=U.slice(0,X).join("/");if(Z.has(Q)){let z=U.slice(X).join("/");return y(`install: resolved ref="${Q}" subpath="${z}"`),{...q,ref:Q,subpath:z||null}}}}catch($){y(`install: ls-remote failed, treating entire ref as branch: ${$}`)}return q}function h0(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>i2)throw Error(`Invalid skill name: exceeds maximum length of ${i2} characters`);if(!w8.test(q))throw Error(`Invalid skill name: "${q}" does not match allowed pattern [a-zA-Z0-9][a-zA-Z0-9._-]*`);return q}function C8(q){let $=q.split("/").filter(Boolean),Z=$.length>0?$[$.length-1]:q;return h0(Z)}function n2(q){let $=new Map;for(let Z of q){let U=C8(Z),X=$.get(U);if(X)X.push(Z);else $.set(U,[Z])}return[...$.entries()].filter(([,Z])=>Z.length>1).map(([Z,U])=>({name:Z,paths:U}))}async function k0(){try{await x0("git",["--version"]),y("install: git available")}catch{throw Error("git is required for installing skills. Install git from https://git-scm.com")}}function b8(q){if(q.killed)return!1;let $=(q.stderr||q.message||"").toLowerCase();return $.includes("authentication failed")||$.includes("could not read username")||$.includes("repository not found")||$.includes("returned error: 403")||$.includes("returned error: 401")||$.includes("terminal prompts disabled")||$.includes("permission denied")}function Wq(q){return q.killed?"Clone timed out after 60 seconds":`Clone failed: ${q.stderr||q.message}`}async function V$(q,$,Z){let U=["clone","--depth","1"];if($)U.push("--branch",$);return U.push(q,Z),await x0("git",U,{timeout:60000}),Z}async function v0(q,$="auto"){y(`install: cloning ${q.owner}/${q.repo}${q.ref?` (ref: ${q.ref})`:""} (transport: ${$})`);let Z=await m2(r(l2(),"asm-install-"));if($==="ssh"||$==="https"){let U=$==="ssh"?q.sshCloneUrl:q.cloneUrl;try{return await V$(U,q.ref,Z)}catch(X){throw await n(Z),Error(Wq(X))}}try{return await V$(q.cloneUrl,q.ref,Z)}catch(U){if(!b8(U))throw await n(Z),Error(Wq(U));y("install: HTTPS clone failed with auth error, retrying with SSH..."),await n(Z);let X=await m2(r(l2(),"asm-install-"));try{return await V$(q.sshCloneUrl,q.ref,X)}catch(Q){throw await n(X),Error(`Clone failed with both transports:
|
|
153
|
+
HTTPS: ${Wq(U)}
|
|
154
|
+
SSH: ${Wq(Q)}`)}}}async function K0(q){let $=r(q,"SKILL.md"),Z;try{Z=await B$($,"utf-8")}catch{throw Error("Not a valid skill: SKILL.md not found in repository root")}let U=I0(Z),X=q.split("/").pop()||"unknown",Q=U.name||X,z=L0(U);return y(`install: validated skill "${Q}" v${z}`),{name:Q,version:z,description:(U.description||"").replace(/\s*\n\s*/g," ").trim(),effort:U.effort||U["metadata.effort"]||void 0}}async function _q(q,$=3){let Z=[];async function U(X,Q,z){let G;try{G=await O8(X)}catch{return}for(let J of G){if(J===".git"||J==="node_modules")continue;let Y=r(X,J);try{if(!(await F8(Y)).isDirectory())continue}catch{continue}let B=Q?`${Q}/${J}`:J,V=z+1,W=r(Y,"SKILL.md");try{let O=await B$(W,"utf-8"),F=I0(O);Z.push({relPath:B,name:F.name||J,version:L0(F),description:(F.description||"").replace(/\s*\n\s*/g," ").trim(),effort:F.effort||F["metadata.effort"]||void 0,license:(F.license||"").trim(),creator:(F["metadata.creator"]||"").trim(),compatibility:(F.compatibility||"").trim(),allowedTools:a2(F)})}catch{if(V<$)await U(Y,B,V)}}}return await U(q,"",0),Z.sort((X,Q)=>X.name.localeCompare(Q.name)),Z}var S8=[{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 s2(q){let $=[],Z=await Vq(q);for(let{relPath:U,content:X}of Z){let Q=X.split(`
|
|
155
|
+
`);for(let z=0;z<Q.length;z++)for(let{category:G,pattern:J}of S8)if(J.test(Q[z])){let Y=Q[z].trim();$.push({category:G,file:U,line:z+1,match:Y.length>100?Y.slice(0,100)+"…":Y})}}return $}async function O$(q){let $=q.source.isLocal?`local:${q.source.localPath}`:`github:${q.source.owner}/${q.source.repo}${q.source.ref?`#${q.source.ref}`:""}${q.source.subpath?`:${q.source.subpath}`:""}`;if(q.force)try{await p2(q.targetDir),await Bq(q.targetDir,{recursive:!0,force:!0})}catch{}let Z=q.sourceDir;try{await T8(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{}y(`install: copied files to ${q.targetDir}`);let X=r(q.targetDir,"SKILL.md");try{await p2(X)}catch{throw Error("Installation verification failed: SKILL.md not found at target")}let Q=await B$(X,"utf-8"),z=I0(Q);return{success:!0,path:q.targetDir,name:z.name||q.skillName,version:L0(z),provider:q.providerLabel,source:$}}async function o2(q,$){let Z=await O$(q);for(let U of $){if(U.name===q.providerName)continue;let X=q.scope==="project"?U.project:U.global,Q=W$(X),z=r(Q,q.skillName);await K8(Q,{recursive:!0});try{if((await I8(z)).isSymbolicLink())await Bq(z);else{y(`install: skipping ${z} — existing non-symlink directory`);continue}}catch{}let G=R8(Q,q.targetDir);await L8(G,z,"dir"),y(`install: symlinked ${z} -> ${G}`)}return Z.provider=`All (${$.map((U)=>U.label).join(", ")})`,Z}async function n(q){try{await Bq(q,{recursive:!0,force:!0})}catch{}}async function r2(){try{await x0("npx",["--version"]),y("install: npx available")}catch{throw Error("npx is required for Vercel method installation. Install Node.js from https://nodejs.org")}}async function t2(q,$){let Z=["--yes","skills","add",q];if($)Z.push("--skill",$);y(`install: running npx ${Z.join(" ")}`);try{let U=await x0("npx",Z,{timeout:120000});return{stdout:U.stdout,stderr:U.stderr}}catch(U){let X=U.stderr||U.message||"";throw Error(`npx skills add failed: ${X}`)}}function e2(q){if(q.isLocal)return q.localPath;let $=`https://github.com/${q.owner}/${q.repo}`;if(q.ref)return`${$}/tree/${q.ref}${q.subpath?`/${q.subpath}`:""}`;return $}async function Oq(q,$,Z){let U=q.providers.filter((J)=>J.enabled);if($==="all"){if(U.length===0)throw Error("No providers are enabled. Enable a provider in your config.");return{provider:U.find((Y)=>Y.name==="agents")||U[0],allProviders:U}}if($){let J=q.providers.find((Y)=>Y.name===$);if(!J){let Y=q.providers.map((B)=>B.name).join(", ");throw Error(`Unknown provider: "${$}". Valid providers: ${Y}, all`)}if(!J.enabled)throw Error(`Provider "${$}" is disabled. Enable it in your config or choose another provider.`);return{provider:J,allProviders:null}}if(U.length===1)return{provider:U[0],allProviders:null};if(!Z){if(U.length===0)throw Error("No providers are enabled. Enable a provider in your config.");let J=U.map((Y)=>Y.name).join(", ");throw Error(`--tool (or --provider) is required in non-interactive mode. Available: ${J}, all`)}let X=q.providers.map((J)=>({label:`${J.label} (${J.name})`,hint:J.global,checked:J.enabled})),Q=await y0({items:X});if(Q.length===0)throw Error("No tools selected. Aborting.");let z=Q.map((J)=>q.providers[J]);if(z.length===1)return{provider:z[0],allProviders:null};return{provider:z.find((J)=>J.name==="agents")||z[0],allProviders:z}}function q1(q,$,Z,U,X,Q,z="global"){let G=z==="project"?X.project:X.global,J=W$(G),Y=r(J,U);return{source:q,tempDir:$,sourceDir:Z,targetDir:Y,skillName:U,force:Q,providerName:X.name,providerLabel:X.label,scope:z}}import{readFile as Nz}from"fs/promises";import{join as jz}from"path";var dQ=_2(),cQ=Uq(),lQ=t$(),P2=Xq(),iQ=p0(),Y0=f(),aQ=X0(),nQ=x(),sQ=z0(),oQ=G0(),kY=eq(),rQ=A2(),tQ=D2(),eQ=w2(),Z$=G4(),J4=u0();var qz=dQ.Composer,$z=cQ.Document,Zz=lQ.Schema,Uz=P2.YAMLError,Xz=P2.YAMLParseError,Qz=P2.YAMLWarning,zz=iQ.Alias,Gz=Y0.isAlias,Jz=Y0.isCollection,Yz=Y0.isDocument,Hz=Y0.isMap,Vz=Y0.isNode,Wz=Y0.isPair,Bz=Y0.isScalar,_z=Y0.isSeq,Oz=aQ.Pair,Tz=nQ.Scalar,Fz=sQ.YAMLMap,Iz=oQ.YAMLSeq;var Lz=rQ.Lexer,Kz=tQ.LineCounter,Rz=eQ.Parser,N2=Z$.parse,Mz=Z$.parseAllDocuments,Az=Z$.parseDocument,Dz=Z$.stringify,wz=J4.visit,Pz=J4.visitAsync;var Y4=500;function Cz(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 bz(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 Sz(q){let $=bz(q);if($===null)return null;try{return N2($),null}catch(Z){return Z.message||"invalid YAML"}}async function H4(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=jz(q.path,"SKILL.md"),X=await Nz(U,"utf-8");if(!Cz(X))$.push({category:"empty-body",message:"SKILL.md contains only frontmatter with no body content"});let Q=Sz(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>Y4)$.push({category:"high-file-count",message:`Skill has ${Z} files (threshold: ${Y4})`});return $}function V4(q){let $=q.map((Z)=>({name:Z.name,version:Z.version,dirName:Z.dirName,provider:Z.provider,scope:Z.scope,path:Z.path,isSymlink:Z.isSymlink,symlinkTarget:Z.symlinkTarget,effort:Z.effort}));return{version:1,exportedAt:new Date().toISOString(),skills:$}}import{mkdir as Ez,writeFile as fz,access as yz}from"fs/promises";import{join as xz}from"path";function gz(q){return`---
|
|
159
159
|
name: ${q}
|
|
160
160
|
description: ""
|
|
161
161
|
license: ""
|
|
@@ -176,11 +176,12 @@ as instructions for when and how to use this skill.
|
|
|
176
176
|
## Instructions
|
|
177
177
|
|
|
178
178
|
- Step-by-step instructions for the agent
|
|
179
|
-
`}async function
|
|
180
|
-
`)}import{access as
|
|
181
|
-
`);for(let G=0;G<z.length;G++){let J=z[G],Y=J.trim();for(let B of
|
|
182
|
-
`)}function b2(q){return JSON.stringify(q,null,2)}import{writeFile as UG,mkdir as
|
|
183
|
-
`,"utf-8")
|
|
179
|
+
`}async function W4(q,$){await Ez($,{recursive:!0});let Z=xz($,"SKILL.md"),U=gz(q);await fz(Z,U,"utf-8")}async function B4(q){try{return await yz(q),!0}catch{return!1}}import{readdir as hz,stat as kz}from"fs/promises";import{join as vz}from"path";async function uz(q){let $=0;try{let U=(await hz(q,{recursive:!0})).map(async(Q)=>{try{let z=await kz(vz(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 T4(q,$){let Z={},U={global:0,project:0},X={},Q=q.map(async(J)=>{Z[J.provider]=(Z[J.provider]||0)+1,U[J.scope]++;let Y=await uz(J.path);return X[J.path]=Y,Y}),G=(await Promise.all(Q)).reduce((J,Y)=>J+Y,0);return{totalSkills:q.length,byProvider:Z,byScope:U,totalDiskBytes:G,perSkillDiskBytes:X,duplicateGroups:$.duplicateGroups.length,duplicateInstances:$.totalDuplicateInstances}}function mz(q){if(q<1024)return`${q} B`;if(q<1048576)return`${(q/1024).toFixed(1)} KB`;if(q<1073741824)return`${(q/1048576).toFixed(1)} MB`;return`${(q/1073741824).toFixed(1)} GB`}function j2(q,$,Z=20){let U=Math.round(q/$*Z),X=Z-U;return H.green("#".repeat(U))+H.dim("-".repeat(X))}var _4={claude:"Claude Code",codex:"Codex",openclaw:"OpenClaw",agents:"Agents"};function F4(q){let $=[];$.push(""),$.push(H.blueBold(" Skill Statistics")),$.push(H.dim(" "+"-".repeat(20))),$.push(""),$.push(` ${H.bold("Total:")} ${H.cyan(String(q.totalSkills))} skills`),$.push(` ${H.bold("Disk:")} ${H.cyan(mz(q.totalDiskBytes))}`),$.push(""),$.push(H.bold(" By Tool"));let Z=Object.entries(q.byProvider).sort((J,Y)=>Y[1]-J[1]),U=Math.max(...Z.map(([,J])=>J)),X=Math.max(...Z.map(([J])=>(_4[J]||J).length));for(let[J,Y]of Z){let B=_4[J]||J,V=O4(J,B.padEnd(X)),W=String(Y).padStart(4);$.push(` ${V} ${W} ${j2(Y,U)}`)}$.push(""),$.push(H.bold(" By Scope"));let Q=Math.max(q.byScope.global,q.byScope.project),z=String(q.byScope.global).padStart(4),G=String(q.byScope.project).padStart(4);if($.push(` ${"global ".padEnd(X)} ${z} ${j2(q.byScope.global,Q)}`),$.push(` ${"project".padEnd(X)} ${G} ${j2(q.byScope.project,Q)}`),$.push(""),$.push(H.bold(" Duplicates")),q.duplicateGroups>0)$.push(` ${H.yellow(`${q.duplicateGroups} group(s), ${q.duplicateInstances} total instance(s)`)}`),$.push(H.dim(` Run ${H.bold("asm audit")} to review`));else $.push(` ${H.green("None")}`);return $.push(""),$.join(`
|
|
180
|
+
`)}import{access as pz,lstat as dz,readFile as cz,rm as lz,symlink as iz}from"fs/promises";import{join as I4}from"path";async function L4(q){let $;try{$=await dz(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=I4(q,"SKILL.md"),U;try{U=await cz(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:L0(X)}}async function U$(q,$,Z,U){let X=I4($,Z),Q=!1;try{await pz(X),Q=!0}catch{}if(Q){if(!U)throw Error(`Target already exists: ${X}. Use --force to overwrite.`);await lz(X,{recursive:!0,force:!0})}await iz(q,X,"dir")}var M4=[{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 az(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`}y(`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",y(`security-audit: source analysis failed -> ${Z.fetchError}`)}return Z}function nz(q){let $=new Map;for(let{relPath:X,content:Q}of q){let z=Q.split(`
|
|
181
|
+
`);for(let G=0;G<z.length;G++){let J=z[G],Y=J.trim();for(let B of M4)if(B.pattern.test(J)){let V=B.category;if(!$.has(V))$.set(V,{description:B.description,matches:[]});let W=Y.length>120?Y.slice(0,120)+"...":Y;$.get(V).matches.push({file:X,line:G+1,match:W,severity:B.severity})}}}let Z=[];for(let[X,Q]of $)Z.push({category:X,description:Q.description,matches:Q.matches});let U={critical:0,warning:1,info:2};return Z.sort((X,Q)=>{let z=Math.min(...X.matches.map((J)=>U[J.severity])),G=Math.min(...Q.matches.map((J)=>U[J.severity]));return z-G}),Z}function sz(q){let $=new Map;for(let Q of q)for(let z of Q.matches)for(let G of M4)if(G.permissionType&&G.category===Q.category&&G.pattern.test(z.match)){let J=G.permissionType;if(!$.has(J))$.set(J,{evidence:[],categories:new Set});let Y=$.get(J);Y.evidence.push({file:z.file,line:z.line,match:z.match}),Y.categories.add(Q.category);break}let Z={filesystem:"Skill reads, writes, or modifies files on disk. Verify it only accesses intended paths.",shell:"Skill executes shell commands or spawns processes. This allows arbitrary system access.",network:"Skill makes network requests or downloads external content. Data may be sent to remote servers.","code-execution":"Skill dynamically constructs and executes code. This can bypass static analysis.",environment:"Skill reads environment variables, which may contain secrets or API keys."},U=[];for(let[Q,z]of $)U.push({type:Q,evidence:z.evidence,reason:Z[Q]});let X={shell:0,"code-execution":1,network:2,filesystem:3,environment:4};return U.sort((Q,z)=>(X[Q.type]??99)-(X[z.type]??99)),U}function oz(q,$,Z){let U=0,X=0;for(let J of q)for(let Y of J.matches){if(Y.severity==="critical")U++;if(Y.severity==="warning")X++}let Q=$.some((J)=>J.type==="shell"),z=$.some((J)=>J.type==="code-execution"),G=$.some((J)=>J.type==="network");if(Q&&G)return{verdict:"dangerous",reason:"Skill has both shell execution and network access -- potential data exfiltration risk."};if(z&&G)return{verdict:"dangerous",reason:"Skill has dynamic code execution and network access -- potential remote code execution risk."};if(U>=10)return{verdict:"dangerous",reason:`${U} critical findings detected. High concentration of risky patterns.`};if(Q||z)return{verdict:"warning",reason:Q?"Skill executes shell commands. Review commands carefully before installing.":"Skill uses dynamic code execution. Review usage carefully."};if(U>0)return{verdict:"warning",reason:`${U} critical finding${U>1?"s":""} detected. Manual review recommended.`};if(X>0)return{verdict:"caution",reason:`${X} warning${X>1?"s":""} found. Generally acceptable but worth reviewing.`};if(Z&&Z.publicRepos!==null&&Z.publicRepos<3)return{verdict:"caution",reason:"No code issues found, but the author has very few public repositories."};return{verdict:"safe",reason:"No suspicious patterns detected."}}async function Q$(q,$,Z,U){y(`security-audit: scanning ${q}`);let X=await Vq(q),Q=X.reduce((V,W)=>V+W.lineCount,0),z=null;if(Z&&U)z=await az(Z,U);let G=nz(X),J=sz(G),{verdict:Y,reason:B}=oz(G,J,z);return{scannedAt:new Date().toISOString(),skillName:$,skillPath:q,source:z,codeScans:G,permissions:J,totalFiles:X.length,totalLines:Q,verdict:Y,verdictReason:B}}var j=H,F0=56,rz={"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"},K4={critical:0,warning:1,info:2};function tz(q){switch(q){case"safe":return j.bgGreen(" SAFE ");case"caution":return j.bgCyan(" CAUTION ");case"warning":return j.bgYellow(" WARNING ");case"dangerous":return j.bgRed(" DANGEROUS ")}}function ez(q){switch(q){case"safe":return j.green;case"caution":return j.cyan;case"warning":return j.yellow;case"dangerous":return j.red}}function E0(q){switch(q){case"critical":return j.red("!!");case"warning":return j.yellow(" !");case"info":return j.dim(" i")}}function C2(q,$){return q.length>$?q.slice(0,$-3)+"...":q}function X$(q){return q.toLocaleString("en-US")}function A4(q){return q.replace(/\x1b\[[0-9;]*m/g,"")}function R4(q){return A4(q).length}function qG(q){let $=new Map;for(let Z of q){let U=`${Z.file}:${Z.line}`,X=$.get(U);if(!X||K4[Z.severity]<K4[X.severity])$.set(U,Z)}return Array.from($.values())}function $G(q){let $=new Map;for(let Z of q){let U=$.get(Z.file);if(!U)U={file:Z.file,entries:[]},$.set(Z.file,U);U.entries.push({line:Z.line,match:Z.match,severity:Z.severity})}return Array.from($.values())}function z$(q){let $=[],Z=tz(q.verdict),U=A4(Z),X=` ${j.bold(q.skillName)}`,Q=` ${q.skillName}`,z=F0-4,G=Math.max(1,z-Q.length-U.length);if($.push(""),$.push(j.dim(" +-- ")+j.bold("Security Audit")+j.dim(" "+"-".repeat(F0-19)+"+")),$.push(j.dim(" |")+X+" ".repeat(G)+Z+j.dim("|")),$.push(j.dim(" |")+j.dim(` ${X$(q.totalFiles)} files | ${X$(q.totalLines)} lines`)+" ".repeat(Math.max(1,z-` ${X$(q.totalFiles)} files | ${X$(q.totalLines)} lines`.length))+j.dim("|")),$.push(j.dim(" +"+"-".repeat(F0-2)+"+")),q.source){let V=q.source;if(V.fetchError)$.push(` ${j.yellow("!")} Could not fetch profile: ${V.fetchError}`);else{let W=[];if(W.push(`${V.owner} ${V.isOrganization?j.cyan("(org)"):j.dim("(user)")}`),V.publicRepos!==null){let O=V.publicRepos,F=O<3?j.yellow(`${O} repos`):O<10?j.cyan(`${O} repos`):j.green(`${O} repos`);W.push(F)}if(V.accountAge)W.push(V.accountAge);$.push(` ${j.dim("Author:")} ${W.join(j.dim(" | "))}`)}}if($.push(""),q.codeScans.length===0)$.push(` ${j.green("*")} ${j.green("No suspicious patterns detected.")}`);else{let V=ez(q.verdict),W=q.verdict==="dangerous"||q.verdict==="warning"?E0("critical"):q.verdict==="caution"?E0("warning"):E0("info");$.push(` ${W} ${V(q.verdictReason)}`);let O=0,F=0,_=0;for(let K of q.codeScans)for(let D of K.matches)if(D.severity==="critical")O++;else if(D.severity==="warning")F++;else _++;let T=[];if(O>0)T.push(j.red(`${O} critical`));if(F>0)T.push(j.yellow(`${F} warning`));if(_>0)T.push(j.dim(`${_} info`));let L=q.permissions.map((K)=>K.type),R=L.length>0?j.dim(`Perms: ${L.join(", ")}`):"";$.push(` ${T.join(j.dim(" | "))} ${R}`)}if($.push(""),q.codeScans.length>0){$.push(` ${j.bold("Findings")}`),$.push(j.dim(" "+"=".repeat(F0-2)));for(let V of q.codeScans){let W=qG(V.matches),O=W.filter((N)=>N.severity==="critical").length,F=W.filter((N)=>N.severity==="warning").length,_=W.filter((N)=>N.severity==="info").length,T=O>0?E0("critical"):F>0?E0("warning"):E0("info"),L=[];if(O>0)L.push(j.red(`${O} critical`));if(F>0)L.push(j.yellow(`${F} warning`));if(_>0)L.push(j.dim(`${_} info`));let R=rz[V.category],K=R?j.dim(`PERM: ${R}`):"",D=` ${T} ${j.bold(V.category)} (${L.join(", ")})`;if(K){let N=R4(D),b=R4(K),S=Math.max(2,F0-N-b);$.push(D+" ".repeat(S)+K)}else $.push(D);let w=$G(W),P=Math.min(24,Math.max(...w.map((N)=>N.file.length))),A=0,I=3;for(let N of w){if(A>=I)break;let b=C2(N.file,24),S=j.dim(b.padEnd(P));if(N.entries.length===1){let g=N.entries[0],q0=C2(g.match,50);$.push(` ${S} :${g.line} ${j.dim("--")} ${g.severity==="critical"?q0:j.dim(q0)}`),A++}else if(N.entries.length<=3){let g=N.entries.map((Y$)=>`:${Y$.line}`).join(", "),q0=C2(N.entries[0].match,40);$.push(` ${S} ${g} ${j.dim("--")} ${j.dim(q0)}`),A++}else{let q0=N.entries.slice(0,3).map((Q8)=>`:${Q8.line}`).join(", "),Y$=N.entries.length-3;$.push(` ${S} ${q0} ${j.dim(`(+${Y$} more)`)}`),A++}}let C=w.length-Math.min(w.length,I);if(C>0){let N=W.length-w.slice(0,I).reduce((b,S)=>b+S.entries.length,0);if(N>0)$.push(` ${j.dim(`... ${N} more in ${C} file${C>1?"s":""}`)}`)}$.push("")}}$.push(j.dim(" "+"=".repeat(F0-2)));let J=new Date(q.scannedAt),Y=`${J.getFullYear()}-${String(J.getMonth()+1).padStart(2,"0")}-${String(J.getDate()).padStart(2,"0")} ${String(J.getHours()).padStart(2,"0")}:${String(J.getMinutes()).padStart(2,"0")}`,B=q.source&&!q.source.fetchError?`github.com/${q.source.owner}`:"";if(B){let V=Math.max(2,F0-2-Y.length-B.length);$.push(j.dim(` ${Y}${" ".repeat(V)}${B}`))}else $.push(j.dim(` ${Y}`));return $.push(""),$.join(`
|
|
182
|
+
`)}function b2(q){return JSON.stringify(q,null,2)}import{readFile as ZG,writeFile as UG,mkdir as XG,copyFile as QG}from"fs/promises";import{execFile as zG}from"child_process";import{promisify as GG}from"util";import{dirname as JG}from"path";var YG=GG(zG);function D4(){return{version:1,skills:{}}}async function w4(){let q=S2(),$;try{$=await ZG(q,"utf-8")}catch(Z){if(Z?.code==="ENOENT")return y("lock: file not found, returning empty lock"),D4();throw Z}try{let Z=JSON.parse($);if(Z.version!==1||typeof Z.skills!=="object"||Z.skills===null)throw Error("invalid schema");return y(`lock: loaded ${Object.keys(Z.skills).length} entries`),Z}catch{let Z=q+".bak";y(`lock: parse error, backing up to ${Z}`);try{await QG(q,Z)}catch{}return console.error(`Warning: .skill-lock.json was corrupted. Backup saved to ${Z}. Starting fresh.`),D4()}}async function P4(q,$){let Z=await w4();Z.skills[q]=$,await j4(Z),y(`lock: wrote entry for "${q}"`)}async function N4(q){let $=await w4();if(!(q in $.skills)){y(`lock: no entry for "${q}", nothing to remove`);return}delete $.skills[q],await j4($),y(`lock: removed entry for "${q}"`)}async function j4(q){let $=S2();await XG(JG($),{recursive:!0}),await UG($,JSON.stringify(q,null,2)+`
|
|
183
|
+
`,"utf-8")}async function C4(q){try{let{stdout:$}=await YG("git",["rev-parse","HEAD"],{cwd:q,timeout:5000});return $.trim()||null}catch{return y("lock: could not read commit hash from cloned repo"),null}}import{writeFile as KG,mkdir as RG,unlink as MG}from"fs/promises";import{join as g4}from"path";import{readdir as HG,readFile as VG}from"fs/promises";import{join as WG}from"path";function E2(q){let $=new Set,Z=q.toLowerCase().split(/[\s\-_.,;:()[\]{}"']+/);for(let U of Z)if(U.length>=2)$.add(U);return $}var BG=10,_G=5,OG=3,TG=1;function FG(q,$){let Z=E2(q),U=E2($.name),X=E2($.description),Q=0;for(let z of Z){if(U.has(z))Q+=BG;if(X.has(z))Q+=OG;if($.name.toLowerCase().includes(z))Q+=_G;if($.description.toLowerCase().includes(z))Q+=TG}return Q}async function b4(q){let $=new Map,Z;try{Z=await HG(q)}catch{return $}for(let U of Z){if(!U.endsWith(".json"))continue;let X=WG(q,U);try{let Q=await VG(X,"utf-8"),z=JSON.parse(Q);for(let G of z.skills){if(!("license"in G))G.license="";if(!("creator"in G))G.creator="";if(!("compatibility"in G))G.compatibility="";if(!("allowedTools"in G))G.allowedTools=[]}$.set(`${z.owner}/${z.repo}`,z)}catch{}}return $}async function G$(){let q=await b4(f4()),$=await b4(Hq()),Z=new Map(q);for(let[U,X]of $)Z.set(U,X);return Array.from(Z.values())}var IG=["license","creator","version"];function S4(q){return IG.includes(q)}function E4(q,$){return q[$]||""}function LG(q,$){if($.has)for(let Z of $.has){if(!S4(Z))continue;if(!E4(q,Z))return!1}if($.missing)for(let Z of $.missing){if(!S4(Z))continue;if(E4(q,Z))return!1}return!0}function y4(q){let $=[];if(!q.license)$.push("license");if(!q.creator)$.push("creator");if(!q.version||q.version==="0.0.0")$.push("version");return $}async function J$(q,$=20,Z){let U=await G$(),X=[],Q=!q&&Z;for(let z of U)for(let G of z.skills){if(Z&&!LG(G,Z))continue;let J=Q?1:FG(q,G);if(J>0)X.push({skill:G,repo:{owner:z.owner,repo:z.repo},score:J})}return X.sort((z,G)=>G.score-z.score),X.slice(0,$)}async function x4(){return(await G$()).reduce(($,Z)=>$+Z.skillCount,0)}async function AG(){let q=Hq();return await RG(q,{recursive:!0}),q}async function h4(q){await k0();let $;try{$=g0(q)}catch(U){return{success:!1,repoIndex:null,error:U.message}}if($.isLocal)return{success:!1,repoIndex:null,error:"Local paths are not supported for indexing. Use a GitHub source instead."};y(`ingester: cloning ${$.owner}/${$.repo}`);let Z=null;try{Z=await v0($),y(`ingester: discovering skills in ${Z}`);let U=await _q(Z);y(`ingester: found ${U.length} skills`);let X=U.map((J)=>({name:J.name,description:J.description,version:J.version,license:J.license,creator:J.creator,compatibility:J.compatibility,allowedTools:J.allowedTools,installUrl:`github:${$.owner}/${$.repo}${$.ref?`#${$.ref}`:""}${J.relPath?`:${J.relPath}`:""}`,relPath:J.relPath})),Q={repoUrl:$.cloneUrl,owner:$.owner,repo:$.repo,updatedAt:new Date().toISOString(),skillCount:X.length,skills:X},z=await AG(),G=g4(z,`${$.owner}_${$.repo}.json`);return await KG(G,JSON.stringify(Q,null,2)+`
|
|
184
|
+
`,"utf-8"),y(`ingester: wrote index to ${G}`),{success:!0,repoIndex:Q}}catch(U){return{success:!1,repoIndex:null,error:U.message}}finally{if(Z)await n(Z)}}async function k4(){return(await G$()).map(($)=>({owner:$.owner,repo:$.repo,skillCount:$.skillCount,updatedAt:$.updatedAt})).sort(($,Z)=>Z.skillCount-$.skillCount)}async function v4(q,$){let Z=Hq(),U=g4(Z,`${q}_${$}.json`);try{return await MG(U),!0}catch{return!1}}function DG(q){let $=q.slice(2),Z={command:null,subcommand:null,positional:[],flags:{help:!1,version:!1,json:!1,yes:!1,noColor:!1,scope:"both",sort:"name",provider:null,name:null,force:!1,path:null,all:!1,verbose:!1,flat:!1,transport:"auto",method:"default",installed:!1,available:!1,has:[],missing:[]}},U=0;while(U<$.length){let X=$[U];if(X==="--help"||X==="-h")Z.flags.help=!0;else if(X==="--version"||X==="-v")Z.flags.version=!0;else if(X==="--json")Z.flags.json=!0;else if(X==="--yes"||X==="-y")Z.flags.yes=!0;else if(X==="--no-color")Z.flags.noColor=!0;else if(X==="--scope"||X==="-s"){U++;let Q=$[U];if(Q==="global"||Q==="project"||Q==="both")Z.flags.scope=Q;else E(`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 E(`Invalid sort: "${Q}". Must be name, version, or location.`),process.exit(2)}else if(X==="--provider"||X==="-p"||X==="--tool")U++,Z.flags.provider=$[U]||null;else if(X==="--name")U++,Z.flags.name=$[U]||null;else if(X==="--force"||X==="-f")Z.flags.force=!0;else if(X==="--path")U++,Z.flags.path=$[U]||null;else if(X==="--all")Z.flags.all=!0;else if(X==="--verbose"||X==="-V")Z.flags.verbose=!0;else if(X==="--flat")Z.flags.flat=!0;else if(X==="--installed")Z.flags.installed=!0;else if(X==="--available")Z.flags.available=!0;else if(X==="--transport"||X==="-t"){U++;let Q=$[U];if(Q==="https"||Q==="ssh"||Q==="auto")Z.flags.transport=Q;else E(`Invalid transport: "${Q}". Must be https, ssh, or auto.`),process.exit(2)}else if(X==="--method"||X==="-m"){U++;let Q=$[U];if(Q==="default"||Q==="vercel")Z.flags.method=Q;else E(`Invalid method: "${Q}". Must be default or vercel.`),process.exit(2)}else if(X==="--skill")U++,Z.flags.path=$[U]||null;else if(X==="--has"){if(U++,$[U])Z.flags.has.push($[U])}else if(X==="--missing"){if(U++,$[U])Z.flags.missing.push($[U])}else if(X.startsWith("-"))E(`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 E(q){console.error(H.red(`Error: ${q}`))}function wG(){console.log(`${H.blueBold("agent-skill-manager")} (${H.bold("asm")}) ${v2}
|
|
184
185
|
|
|
185
186
|
Interactive TUI and CLI for managing installed skills for AI coding agents.
|
|
186
187
|
|
|
@@ -216,7 +217,7 @@ ${H.bold("Global Options:")}
|
|
|
216
217
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
217
218
|
--flat Show one row per tool instance (list, search)
|
|
218
219
|
-y, --yes Skip confirmation prompts
|
|
219
|
-
-V, --verbose Show debug output`)}function
|
|
220
|
+
-V, --verbose Show debug output`)}function PG(){console.log(`${H.bold("Usage:")} asm list [options]
|
|
220
221
|
|
|
221
222
|
List all discovered skills. By default, skills installed across multiple
|
|
222
223
|
tools are grouped into a single row with tool badges.
|
|
@@ -236,7 +237,7 @@ ${H.bold("Examples:")}
|
|
|
236
237
|
asm list -p claude ${H.dim("Only Claude Code skills")}
|
|
237
238
|
asm list -s project ${H.dim("Only project-scoped skills")}
|
|
238
239
|
asm list --sort version ${H.dim("Sort by version")}
|
|
239
|
-
asm list --json ${H.dim("Output as JSON")}`)}function
|
|
240
|
+
asm list --json ${H.dim("Output as JSON")}`)}function NG(){console.log(`${H.bold("Usage:")} asm search <query> [options]
|
|
240
241
|
|
|
241
242
|
Search both installed skills and the skill index. Results show installation
|
|
242
243
|
status and include copy-paste install commands for available skills.
|
|
@@ -257,7 +258,7 @@ ${H.bold("Examples:")}
|
|
|
257
258
|
asm search review -p claude ${H.dim("Search within Claude Code only")}
|
|
258
259
|
asm search "test" --installed ${H.dim("Search installed skills only")}
|
|
259
260
|
asm search "test" --available ${H.dim("Search available skills only")}
|
|
260
|
-
asm search openspec --json ${H.dim("Output matches as JSON")}`)}function
|
|
261
|
+
asm search openspec --json ${H.dim("Output matches as JSON")}`)}function jG(){console.log(`${H.bold("Usage:")} asm inspect <skill-name> [options]
|
|
261
262
|
|
|
262
263
|
Show detailed information for a skill. The <skill-name> is the directory name.
|
|
263
264
|
Shows version, description, file count, and all provider installations.
|
|
@@ -271,7 +272,7 @@ ${H.bold("Options:")}
|
|
|
271
272
|
${H.bold("Examples:")}
|
|
272
273
|
asm inspect code-review ${H.dim("Show details for code-review")}
|
|
273
274
|
asm inspect code-review --json ${H.dim("Output as JSON")}
|
|
274
|
-
asm inspect code-review -s global ${H.dim("Global installations only")}`)}function
|
|
275
|
+
asm inspect code-review -s global ${H.dim("Global installations only")}`)}function CG(){console.log(`${H.bold("Usage:")} asm uninstall <skill-name> [options]
|
|
275
276
|
|
|
276
277
|
Remove a skill and its associated rule files. Shows a removal plan
|
|
277
278
|
before proceeding and asks for confirmation.
|
|
@@ -285,7 +286,7 @@ ${H.bold("Options:")}
|
|
|
285
286
|
${H.bold("Examples:")}
|
|
286
287
|
asm uninstall code-review ${H.dim("Remove with confirmation")}
|
|
287
288
|
asm uninstall code-review -y ${H.dim("Remove without confirmation")}
|
|
288
|
-
asm uninstall code-review -s project ${H.dim("Remove project copy only")}`)}function
|
|
289
|
+
asm uninstall code-review -s project ${H.dim("Remove project copy only")}`)}function bG(){console.log(`${H.bold("Usage:")} asm audit [subcommand] [options]
|
|
289
290
|
|
|
290
291
|
Detect duplicate skills or run security audits on installed/remote skills.
|
|
291
292
|
|
|
@@ -309,7 +310,7 @@ ${H.bold("Examples:")}
|
|
|
309
310
|
asm audit security --all ${H.dim("Audit all installed skills")}
|
|
310
311
|
asm audit security code-review --json ${H.dim("Output audit as JSON")}
|
|
311
312
|
asm audit security https://github.com/user/skills/tree/main/skills/agent-config
|
|
312
|
-
${H.dim("Audit a skill from a subfolder URL")}`)}function
|
|
313
|
+
${H.dim("Audit a skill from a subfolder URL")}`)}function SG(){console.log(`${H.bold("Usage:")} asm config <subcommand>
|
|
313
314
|
|
|
314
315
|
Manage configuration. Config is stored at ~/.config/agent-skill-manager/.
|
|
315
316
|
|
|
@@ -325,20 +326,20 @@ ${H.bold("Options:")}
|
|
|
325
326
|
${H.bold("Examples:")}
|
|
326
327
|
asm config show ${H.dim("View current config")}
|
|
327
328
|
asm config edit ${H.dim("Edit in $EDITOR")}
|
|
328
|
-
asm config reset -y ${H.dim("Reset without confirmation")}`)}async function
|
|
329
|
-
${H.yellow(`${
|
|
330
|
-
`)),q.flags.flat)console.log(
|
|
331
|
-
`));for(let J of
|
|
332
|
-
`)}}}async function
|
|
333
|
-
${H.bold("Proceed with removal?")} [y/N] `);let G=await f0();if(G.toLowerCase()!=="y"&&G.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let z=await
|
|
334
|
-
Done.`))}function f0(){return new Promise((q)=>{let $="",Z=!1;function
|
|
335
|
-
`))
|
|
336
|
-
Auto-removing duplicates...`));for(let
|
|
337
|
-
Done.`))}}async function
|
|
338
|
-
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await
|
|
339
|
-
`);let
|
|
340
|
-
Summary:`)),z.dangerous>0)console.log(` ${H.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${H.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${H.green(`${z.safe} safe`)}`);console.log("")}}async function
|
|
341
|
-
`);let z=await
|
|
329
|
+
asm config reset -y ${H.dim("Reset without confirmation")}`)}async function Z8(q){for(let $ of q)$.warnings=await H4($)}async function EG(q){if(q.flags.help){PG();return}let $=await v(),Z=await a($,q.flags.scope);if(q.flags.provider&&q.command==="list")Z=Z.filter((X)=>X.provider===q.flags.provider);await Z8(Z);let U=y2(Z,q.flags.sort);if(q.flags.json)console.log(m(U));else if(q.flags.flat){let X=g2(U),Q=U.filter((z)=>z.warnings&&z.warnings.length>0);if(Q.length>0)X+=`
|
|
330
|
+
${H.yellow(`${Q.length} skill${Q.length===1?"":"s"} with warnings -- use --json for details`)}`;console.log(X)}else console.log(s4(U))}async function fG(q){if(q.flags.help){NG();return}let $=q.subcommand;if(!$)E("Missing required argument: <query>"),console.error('Run "asm search --help" for usage.'),process.exit(2);let Z=!q.flags.available,U=!q.flags.installed,X=[];if(Z){let J=await v(),Y=await a(J,q.flags.scope);if(q.flags.provider)Y=Y.filter((V)=>V.provider===q.flags.provider);let B=d4(Y,$);X=y2(B,q.flags.sort)}let Q=[];if(U){if(Q=await J$($),X.length>0){let J=new Set(X.map((Y)=>Y.name.toLowerCase()));Q=Q.filter((Y)=>!J.has(Y.skill.name.toLowerCase()))}}if(q.flags.json){let J=X.map((B)=>({name:B.name,description:B.description,version:B.version,scope:B.scope,provider:B.provider,status:"installed"})),Y=Q.map((B)=>({name:B.skill.name,description:B.skill.description,version:B.skill.version,repo:`${B.repo.owner}/${B.repo.repo}`,installCommand:`asm install ${B.skill.installUrl}`,status:"available"}));console.log(m([...J,...Y]));return}let z=X.length>0,G=Q.length>0;if(!z&&!G){console.error(`No skills matching "${$}".`),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(z)if(console.error(H.bold(`Installed skills matching "${$}":
|
|
331
|
+
`)),q.flags.flat)console.log(g2(X));else console.log(o4(X,$));if(G){if(z)console.error("");console.error(H.bold(`Available skills matching "${$}":
|
|
332
|
+
`));for(let J of Q){console.error(`${H.cyan(J.skill.name)} ${H.dim(`v${J.skill.version}`)} ${H.dim(`[${J.repo.owner}/${J.repo.repo}]`)}`);for(let Y of h2(J.skill.description,80))console.error(` ${Y}`);console.error(` ${H.green(`asm install ${J.skill.installUrl}`)}
|
|
333
|
+
`)}}}async function yG(q){if(q.flags.help){jG();return}let $=q.subcommand;if(!$)E("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await v(),X=(await a(Z,q.flags.scope)).filter((Q)=>Q.dirName===$);if(X.length===0)E(`Skill "${$}" not found.`),console.error(H.dim(`Try ${H.bold("asm list")} to see all skills or ${H.bold(`asm search "${$}"`)} to search.`)),process.exit(1);if(await Z8(X),q.flags.json)console.log(m(X.length===1?X[0]:X));else console.log(await r4(X))}async function xG(q){if(q.flags.help){CG();return}let $=q.subcommand;if(!$)E("Missing required argument: <skill-name>"),console.error('Run "asm uninstall --help" for usage.'),process.exit(2);let Z=await v(),U=await a(Z,q.flags.scope),X=l4($,U,Z),Q=await i4(X);if(Q.length===0)E(`Skill "${$}" not found or nothing to remove.`),process.exit(1);console.error(H.bold("Removal plan:"));for(let G of Q)console.error(` ${H.red("•")} ${n4(G)}`);if(!q.flags.yes){if(!process.stdin.isTTY)E("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
|
|
334
|
+
${H.bold("Proceed with removal?")} [y/N] `);let G=await f0();if(G.toLowerCase()!=="y"&&G.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let z=await x2(X);for(let G of z)console.error(G);try{await N4($)}catch{}console.error(H.green(`
|
|
335
|
+
Done.`))}function f0(){return new Promise((q)=>{let $="",Z=!1;function U(){process.stdin.removeListener("data",Q),process.stdin.removeListener("end",z),process.stdin.pause(),clearTimeout(G)}function X(J){if(Z)return;Z=!0,U(),q(J)}function Q(J){if($+=J,$.includes(`
|
|
336
|
+
`))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 gG(q){if(q.flags.help){bG();return}let $=q.subcommand??"duplicates";if($==="security"){await hG(q);return}if($!=="duplicates")E(`Unknown audit subcommand: "${$}". Use: duplicates, security`),process.exit(2);let Z=await v(),U=await a(Z,"both"),X=k2(U);if(q.flags.json){console.log(q8(X));return}if(console.log(e4(X)),q.flags.yes&&X.duplicateGroups.length>0){console.error(H.bold(`
|
|
337
|
+
Auto-removing duplicates...`));for(let Q of X.duplicateGroups){let z=t4(Q.instances),G=z[0].path;for(let J=1;J<z.length;J++){let Y=z[J],B=c4(Y,Z),V=await x2(B,G);for(let W of V)console.error(W)}}console.error(H.green(`
|
|
338
|
+
Done.`))}}async function hG(q){let $=q.positional[0];if(q.flags.all)await kG(q);else if(!$)E(`Missing target. Provide a skill name, GitHub source, or use --all.
|
|
339
|
+
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await vG(q,$);else await uG(q,$)}async function kG(q){let $=await v(),Z=await a($,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":""}...
|
|
340
|
+
`);let Q=[];for(let z of X){console.error(` Scanning ${H.bold(z.name)}...`);let G=await Q$(z.realPath,z.name);Q.push(G)}if(q.flags.json)console.log(JSON.stringify(Q,null,2));else{for(let G of Q)console.log(z$(G));let z={safe:0,caution:0,warning:0,dangerous:0};for(let G of Q)z[G.verdict]++;if(console.log(H.bold(`
|
|
341
|
+
Summary:`)),z.dangerous>0)console.log(` ${H.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${H.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${H.green(`${z.safe} safe`)}`);console.log("")}}async function vG(q,$){let Z=null;try{let U=g0($);if(U.isLocal)throw Error("Local paths are not supported for remote security audits. Use: asm audit security <installed-skill-name>");await k0(),U=await _$(U),console.error(`Cloning ${$} for audit...`),Z=await v0(U,q.flags.transport);let{join:X}=await import("path"),Q=U.subpath?X(Z,U.subpath):Z,{name:z}=await K0(Q),G=await Q$(Q,z,U.owner,U.repo);if(q.flags.json)console.log(b2(G));else console.log(z$(G))}catch(U){E(U.message),process.exit(1)}finally{if(Z)await n(Z)}}async function uG(q,$){let Z=await v(),X=(await a(Z,q.flags.scope)).filter((G)=>G.dirName===$);if(X.length===0)E(`Skill "${$}" not found. Use "asm list" to see installed skills.`),process.exit(1);let Q=X[0];console.error(`Auditing installed skill: ${H.bold(Q.name)}...
|
|
342
|
+
`);let z=await Q$(Q.realPath,Q.name);if(q.flags.json)console.log(b2(z));else console.log(z$(z))}async function mG(q){if(q.flags.help){SG();return}let $=q.subcommand;if(!$)E("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 v();console.log(m(Z));break}case"path":{console.log(f2());break}case"reset":{if(!q.flags.yes){if(!process.stdin.isTTY)E("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`${H.bold("Reset config to defaults?")} [y/N] `);let U=await f0();if(U.toLowerCase()!=="y"&&U.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Z=m4();await p4(Z),console.error(H.green("Config reset to defaults."));break}case"edit":{let Z=process.env.VISUAL||process.env.EDITOR||"vi",[U,X]=$8(Z),Q=f2();await v();let{spawn:z}=await import("child_process");await new Promise((G,J)=>{let Y=z(U,[...X,Q],{stdio:"inherit"});Y.on("close",()=>G()),Y.on("error",J)});break}default:E(`Unknown config subcommand: "${$}". Use: show, path, reset, or edit.`),process.exit(2)}}function pG(){console.log(`${H.bold("Usage:")} asm install <source> [options]
|
|
342
343
|
|
|
343
344
|
Install a skill from a GitHub repository or a local folder path.
|
|
344
345
|
|
|
@@ -356,6 +357,9 @@ ${H.bold("Source Format:")}
|
|
|
356
357
|
${H.bold("Options:")}
|
|
357
358
|
-p, --tool <name> Target tool (claude, codex, openclaw, agents, all)
|
|
358
359
|
Use "all" to install to all tools (shared + symlinks)
|
|
360
|
+
-s, --scope <scope> Installation scope: global or project (default: prompt)
|
|
361
|
+
global installs to ~/.claude/skills/ (available everywhere)
|
|
362
|
+
project installs to .claude/skills/ (this project only)
|
|
359
363
|
--name <name> Override skill directory name
|
|
360
364
|
--path <subdir> Install skill from a subdirectory of the repo
|
|
361
365
|
--skill <name> Alias for --path (Vercel skills CLI compatibility)
|
|
@@ -398,23 +402,23 @@ ${H.bold("Subfolder URL:")}
|
|
|
398
402
|
${H.bold("Vercel skills CLI:")}
|
|
399
403
|
asm install github:user/skills --method vercel --skill my-skill
|
|
400
404
|
asm install https://github.com/user/skills -m vercel --skill my-skill -y
|
|
401
|
-
${H.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function
|
|
402
|
-
${H.bold("Install preview:")}`),console.info(` ${H.bold("Name:")} ${z.name}`),console.info(` ${H.bold("Version:")} ${z.version}`),z.description)console.info(` ${H.bold("Description:")} ${H.dim(z.description)}`);if(z.effort)console.info(` ${H.bold("Effort:")} ${
|
|
403
|
-
${H.bold("Security warnings:")}`);let W=new Map;for(let
|
|
404
|
-
${
|
|
405
|
-
${H.cyan(`[Step ${
|
|
406
|
-
`);for(let
|
|
405
|
+
${H.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function dG(q,$,Z,U,X,Q,z,G,J="global"){let Y=await K0(U),B=await s2(U),V=U===Z?null:U.split("/").pop(),W=X||V||$.repo,O=h0(W),F=G.find((P)=>P.name.toLowerCase()===Y.name.toLowerCase()&&P.provider===z.name),_,T=!!F;if(F)if(F.version===Y.version)_=q.flags.force?"REINSTALL":`UPDATE: ${F.version} (same version)`;else _=`UPDATE: ${F.version} → ${Y.version}`;else _="NEW";let L=q1($,Z,U,O,z,q.flags.force||T,J),R=B.some((P)=>["Shell commands","Code execution","Credentials"].includes(P.category)),K=B.some((P)=>["External URLs"].includes(P.category)),D=R?"high":K?"medium":"safe",w=R?H.red("[!] High Risk"):K?H.yellow("[~] Medium Risk"):H.green("[ok] Safe");return{metadata:Y,skillName:O,warnings:B,installStatus:_,riskLevel:D,riskLabel:w,plan:L}}function cG(q,$,Z,U,X,Q){let{metadata:z,warnings:G,installStatus:J,riskLabel:Y,plan:B}=q;if(X&&Q){let V=H.dim(`[${Q.index}/${Q.total}]`),W=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);console.info(`${V} ${H.bold(z.name)} v${z.version} ${W} ${Y}`)}else{let V=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);if(console.info(` ${H.bold(z.name)} v${z.version} ${V}`),console.info(`
|
|
406
|
+
${H.bold("Install preview:")}`),console.info(` ${H.bold("Name:")} ${z.name}`),console.info(` ${H.bold("Version:")} ${z.version}`),z.description)console.info(` ${H.bold("Description:")} ${H.dim(z.description)}`);if(z.effort)console.info(` ${H.bold("Effort:")} ${a4(z.effort)}`);if(console.info(` ${H.bold("Source:")} ${$}`),U)console.info(` ${H.bold("Tool:")} All (${U.map((W)=>W.label).join(", ")})`),console.info(` ${H.bold("Primary:")} ${Z.label} (${Z.name})`),console.info(` ${H.bold("Symlinks:")} ${U.filter((W)=>W.name!==Z.name).map((W)=>W.label).join(", ")}`);else console.info(` ${H.bold("Tool:")} ${Z.label} (${Z.name})`);if(console.info(` ${H.bold("Scope:")} ${B.scope==="project"?"Project":"Global"}`),console.info(` ${H.bold("Target:")} ${B.targetDir}`),console.info(` ${H.bold("Status:")} ${V}`),console.info(` ${H.bold("Risk:")} ${Y}`),G.length>0){console.info(`
|
|
407
|
+
${H.bold("Security warnings:")}`);let W=new Map;for(let O of G){let F=W.get(O.category)||[];F.push(O),W.set(O.category,F)}for(let[O,F]of W){let T=["Shell commands","Code execution","Credentials"].includes(O)?H.red(`[${O}]`):H.yellow(`[${O}]`);console.info(`
|
|
408
|
+
${T} ${H.dim(`(${F.length} match${F.length>1?"es":""})`)}`);for(let L of F.slice(0,5))console.info(` ${H.dim(`${L.file}:${L.line}`)} -- ${L.match}`);if(F.length>5)console.info(H.dim(` ... and ${F.length-5} more`))}}}}async function lG(q,$){if($)return await o2(q,$);return await O$(q)}async function iG(q){if(q.flags.help){pG();return}let $=q.subcommand;if(!$)E("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,U=8,X=0,Q=(G)=>{return X++,`
|
|
409
|
+
${H.cyan(`[Step ${X}/${U}]`)} ${H.bold(G)}`},z=()=>{if(Z)n(Z).finally(()=>process.exit(1));else process.exit(1)};process.on("SIGINT",z),process.on("SIGTERM",z);try{console.info(Q("Parsing source"));let G=g0($),J=!!G.isLocal;if(J){let A=G.localPath;console.info(` ${H.dim(`local: ${A}`)}`);let{stat:I}=await import("fs/promises");try{if(!(await I(A)).isDirectory())throw Error(`Path is not a directory: ${A}`)}catch(C){if(C.code==="ENOENT")throw Error(`Path does not exist: ${A}`);throw C}}else await k0(),G=await _$(G),console.info(` ${H.dim($)}`);if(q.flags.method==="vercel"){console.info(Q("Installing via Vercel skills CLI")),await r2();let A=e2(G),I=q.flags.path||null;console.info(` ${H.dim(`npx skills add ${A}${I?` --skill ${I}`:""}`)}`);let{stdout:C,stderr:N}=await t2(A,I);if(C.trim())console.info(` ${H.dim(C.trim())}`);if(N.trim())console.error(` ${H.dim(N.trim())}`);console.info(` ${H.green("✓")} Vercel skills CLI install completed`),q.flags.force=!0,console.info(` ${H.dim("Continuing with asm install to register in local inventory...")}`)}console.info(Q("Selecting provider"));let Y=await v(),{provider:B,allProviders:V}=await Oq(Y,q.flags.provider,!!process.stdin.isTTY);console.info(Q("Selecting scope"));let W;if(q.flags.scope==="global"||q.flags.scope==="project")W=q.flags.scope,console.info(` ${H.dim(`scope: ${W}`)}${W==="global"?` (${B.global})`:` (${B.project})`}`);else if(!process.stdin.isTTY||q.flags.yes)W="global",console.info(` ${H.dim("scope: global (default)")} (${B.global})`);else{let A=[{label:`Global (${B.global})`,hint:"Available in all projects",checked:!0},{label:`Project (${B.project})`,hint:"Available only in this project",checked:!1}];console.info("");let I=await y0({items:A});if(I.length===0)throw Error("No scope selected. Aborting.");W=I[0]===0?"global":"project",console.info(` Selected: ${H.bold(W)} ${H.dim(`(${W==="global"?B.global:B.project})`)}`)}if(J)console.info(Q("Reading local source")),console.info(` ${H.dim(G.localPath)}`),Z=null;else{console.info(Q("Cloning repository"));let A=q.flags.transport,I=A==="ssh"?G.sshCloneUrl:A==="https"?G.cloneUrl:`${G.cloneUrl} ${H.dim("(auto)")}`;console.info(` ${I}${G.ref?` ${H.dim(`(ref: ${G.ref})`)}`:""}${G.subpath?` ${H.dim(`(path: ${G.subpath})`)}`:""}`),Z=await v0(G,A)}let O=J?G.localPath:Z;console.info(Q("Scanning for skills"));let{join:F}=await import("path"),_=[],T=q.flags.path||G.subpath,L=[];if(T){let A=F(O,T);try{await K0(A)}catch{throw Error(`No SKILL.md found at path "${T}" in the repository.`)}console.info(` Found skill at ${H.bold(T)}`),L=[{skillDir:A,nameOverride:q.flags.name}]}else{let A=!1;try{await K0(O),A=!0}catch{}if(A){let I=await K0(O);console.info(` Found: ${H.bold(I.name)} v${I.version}`),L=[{skillDir:O,nameOverride:q.flags.name}]}else{console.info(" No SKILL.md at root. Scanning subdirectories...");let I=await _q(O);if(I.length===0)throw Error("No skills found in this repository. Skills must have a SKILL.md file.");console.info(` Found ${H.bold(String(I.length))} skill(s):
|
|
410
|
+
`);for(let b=0;b<I.length;b++){let S=H.cyan(` ${String(b+1).padStart(String(I.length).length)})`);if(console.info(`${S} ${H.bold(I[b].name)} ${H.dim(`v${I[b].version}`)} ${H.dim(`(${I[b].relPath})`)}`),I[b].description)console.info(` ${H.dim(I[b].description)}`)}console.info(Q("Selecting skills")),X--;let C;if(q.flags.all&&(q.flags.yes||!process.stdin.isTTY))C=I.map((b)=>b.relPath),console.info(` Selected all ${H.bold(String(C.length))} skills`);else if(process.stdin.isTTY)if(I.length===1)C=[I[0].relPath],console.info(` Auto-selected: ${H.bold(I[0].name)} ${H.dim(`v${I[0].version}`)}`);else{let b=I.map((g)=>({label:g.name,hint:`v${g.version}${g.description?" "+g.description:""}`,checked:!!q.flags.all}));console.info("");let S=await y0({items:b});if(S.length===0)throw Error("No skills selected. Aborting.");C=S.map((g)=>I[g].relPath),console.info(` Selected ${H.bold(String(C.length))} skill(s)`)}else{E(`Repository contains ${I.length} skills. Use --path <subdir> to pick one or --all to install all.
|
|
407
411
|
Available skills:
|
|
408
|
-
${I.map((
|
|
409
|
-
`)}`),process.exit(2);return}let
|
|
410
|
-
`),
|
|
411
|
-
${
|
|
412
|
-
Choose one path per skill name or install with --path.`);throw
|
|
412
|
+
${I.map((b)=>` --path ${b.relPath}`).join(`
|
|
413
|
+
`)}`),process.exit(2);return}let N=n2(C);if(N.length>0){let b=N.map((g)=>` - ${g.name}: ${g.paths.map((q0)=>`"${q0}"`).join(", ")}`).join(`
|
|
414
|
+
`),S=Error(`Duplicate skill names detected in selection:
|
|
415
|
+
${b}
|
|
416
|
+
Choose one path per skill name or install with --path.`);throw S.duplicates=N,S}L=C.map((b)=>({skillDir:F(O,b),nameOverride:C.length===1?q.flags.name:null})),X++}}console.info(Q("Inspecting skills"));let R=await a(Y,"both"),K=[],D=L.length>1;for(let A=0;A<L.length;A++){let{skillDir:I,nameOverride:C}=L[A],N=await dG(q,G,O,I,C,Y,B,R,W);K.push(N),cG(N,$,B,V,D,D?{index:A+1,total:L.length}:void 0)}if(D){if(console.info(""),console.info(` ${H.bold("Install settings:")}`),console.info(` ${H.bold("Source:")} ${$}`),V)console.info(` ${H.bold("Tool:")} All (${V.map((b)=>b.label).join(", ")})`);else console.info(` ${H.bold("Tool:")} ${B.label} (${B.name})`);console.info(` ${H.bold("Scope:")} ${W==="project"?"Project":"Global"}`);let A=K.filter((b)=>b.riskLevel==="high").length,I=K.filter((b)=>b.riskLevel==="medium").length,C=K.filter((b)=>b.riskLevel==="safe").length,N=[];if(C>0)N.push(H.green(`${C} Safe`));if(I>0)N.push(H.yellow(`${I} Medium Risk`));if(A>0)N.push(H.red(`${A} High Risk`));console.info(` ${H.bold("Risk:")} ${N.join(", ")}`)}if(console.info(Q("Installing")),!q.flags.yes){let A=K.some((b)=>b.riskLevel==="high");if(!process.stdin.isTTY)E("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);let I=D?`${K.length} skills`:`"${K[0].metadata.name}"`,C=A?`
|
|
413
417
|
${H.red("[!]")} ${H.bold(`Install ${I}? Some have high-risk patterns.`)} [y/N] `:`
|
|
414
|
-
${H.bold(`Install ${I}?`)} [Y/n] `;process.stderr.write(
|
|
415
|
-
${H.yellow(`${
|
|
416
|
-
Done! Installed "${
|
|
417
|
-
${H.green(`Done! Installed ${
|
|
418
|
+
${H.bold(`Install ${I}?`)} [Y/n] `;process.stderr.write(C);let N=await f0();if(A){if(N.toLowerCase()!=="y"&&N.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}else if(N.toLowerCase()==="n"||N.toLowerCase()==="no")console.error("Aborted."),process.exit(0)}let w=Z?await C4(Z):null,P=[];for(let A=0;A<K.length;A++){let I=K[A],C=D?H.dim(`[${A+1}/${K.length}]`)+" ":" ";try{console.info(`${C}Installing ${H.bold(I.metadata.name)}...`);let N=await lG(I.plan,V);_.push(N),console.info(`${C}${H.green("✓")} ${I.metadata.name} installed to ${H.dim(I.plan.targetDir)}`);try{let b=J?`local:${G.localPath}`:`github:${G.owner}/${G.repo}`;await P4(N.name,{source:b,commitHash:w||"unknown",ref:G.ref||"main",installedAt:new Date().toISOString(),provider:I.plan.providerName})}catch{}}catch(N){P.push({name:I.metadata.name,error:N.message}),console.error(`${C}${H.red("✗")} ${H.bold(I.metadata.name)} — ${H.red(N.message)}`)}}if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),P.length>0){console.error(`
|
|
419
|
+
${H.yellow(`${P.length} skill(s) failed to install:`)}`);for(let A of P)console.error(` ${H.red("✗")} ${A.name}: ${A.error}`)}if(q.flags.json)console.log(JSON.stringify(_.length===1?_[0]:_,null,2));else if(_.length===1)console.error(H.green(`
|
|
420
|
+
Done! Installed "${_[0].name}" to ${_[0].path}`));else if(_.length>0)console.error(`
|
|
421
|
+
${H.green(`Done! Installed ${_.length} skill(s) successfully.`)}`)}catch(G){if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),q.flags.json){let J={success:!1,error:G.message};if(G?.duplicates)J.duplicates=G.duplicates;console.log(JSON.stringify(J,null,2))}else E(G.message);process.exit(1)}finally{if(Z)await n(Z)}}function aG(){console.log(`${H.bold("Usage:")} asm export [options]
|
|
418
422
|
|
|
419
423
|
Export skill inventory as a portable JSON manifest. Useful for backup,
|
|
420
424
|
sharing, or scripting.
|
|
@@ -427,7 +431,7 @@ ${H.bold("Options:")}
|
|
|
427
431
|
${H.bold("Examples:")}
|
|
428
432
|
asm export ${H.dim("Export all skills")}
|
|
429
433
|
asm export -s global ${H.dim("Export global skills only")}
|
|
430
|
-
asm export > skills.json ${H.dim("Save to file")}`)}async function
|
|
434
|
+
asm export > skills.json ${H.dim("Save to file")}`)}async function nG(q){if(q.flags.help){aG();return}let $=await v(),Z=await a($,q.flags.scope),U=V4(Z);console.log(JSON.stringify(U,null,2))}function sG(){console.log(`${H.bold("Usage:")} asm init <name> [options]
|
|
431
435
|
|
|
432
436
|
Scaffold a new skill directory with a SKILL.md template. Creates a
|
|
433
437
|
ready-to-edit skill in the target tool's skill folder.
|
|
@@ -442,8 +446,8 @@ ${H.bold("Options:")}
|
|
|
442
446
|
${H.bold("Examples:")}
|
|
443
447
|
asm init my-skill ${H.dim("Scaffold (interactive tool)")}
|
|
444
448
|
asm init my-skill -p claude ${H.dim("Scaffold in Claude Code")}
|
|
445
|
-
asm init my-skill --path ./skills ${H.dim("Scaffold in custom directory")}`)}async function
|
|
446
|
-
${H.bold("Overwrite?")} [y/N] `);let
|
|
449
|
+
asm init my-skill --path ./skills ${H.dim("Scaffold in custom directory")}`)}async function oG(q){if(q.flags.help){sG();return}let $=q.subcommand;if(!$)E("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=h0($),U;if(q.flags.path){let{resolve:X}=await import("path");U=X(q.flags.path)}else{let X=await v(),{provider:Q}=await Oq(X,q.flags.provider,!!process.stdin.isTTY),{join:z}=await import("path"),{resolveProviderPath:G}=await import("./chunk-vhkxjexp.js"),J=G(X.providers.find((Y)=>Y.name===Q.name).global);U=z(J,Z)}if(await B4(U)){if(!q.flags.force){if(!process.stdin.isTTY)E(`Directory already exists: ${U}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Directory already exists: ${U}`)}
|
|
450
|
+
${H.bold("Overwrite?")} [y/N] `);let X=await f0();if(X.toLowerCase()!=="y"&&X.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}await W4(Z,U),console.error(H.green(`Done! Created skill "${Z}" at ${U}`))}function rG(){console.log(`${H.bold("Usage:")} asm stats [options]
|
|
447
451
|
|
|
448
452
|
Show aggregate skill metrics with provider distribution charts,
|
|
449
453
|
scope breakdown, disk usage, and duplicate summary.
|
|
@@ -457,7 +461,7 @@ ${H.bold("Options:")}
|
|
|
457
461
|
${H.bold("Examples:")}
|
|
458
462
|
asm stats ${H.dim("Show full dashboard")}
|
|
459
463
|
asm stats -s global ${H.dim("Global skills only")}
|
|
460
|
-
asm stats --json ${H.dim("Output raw data as JSON")}`)}async function
|
|
464
|
+
asm stats --json ${H.dim("Output raw data as JSON")}`)}async function tG(q){if(q.flags.help){rG();return}let $=await v(),Z=await a($,q.flags.scope);if(Z.length===0){console.log("No skills found.");return}let U=k2(Z),X=await T4(Z,U);if(q.flags.json)if(!q.flags.verbose){let{perSkillDiskBytes:Q,...z}=X;console.log(m(z))}else console.log(m(X));else console.log(F4(X))}function eG(){console.log(`${H.bold("Usage:")} asm link <path> [options]
|
|
461
465
|
|
|
462
466
|
Symlink a local skill directory into an agent's skill folder. Useful
|
|
463
467
|
for local development — changes to the source are reflected immediately.
|
|
@@ -473,8 +477,8 @@ ${H.bold("Options:")}
|
|
|
473
477
|
${H.bold("Examples:")}
|
|
474
478
|
asm link ./my-skill ${H.dim("Link (interactive tool)")}
|
|
475
479
|
asm link ./my-skill -p claude ${H.dim("Link to Claude Code")}
|
|
476
|
-
asm link ./my-skill --name alias ${H.dim("Link with custom name")}`)}async function
|
|
477
|
-
${H.bold("Overwrite?")} [y/N] `);let F=await f0();if(F.toLowerCase()!=="y"&&F.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await
|
|
480
|
+
asm link ./my-skill --name alias ${H.dim("Link with custom name")}`)}async function qJ(q){if(q.flags.help){eG();return}let $=q.subcommand;if(!$)E("Missing required argument: <path>"),console.error('Run "asm link --help" for usage.'),process.exit(2);let{resolve:Z,basename:U}=await import("path"),X=Z($),Q=await L4(X),z=q.flags.name?h0(q.flags.name):U(X),G=await v(),{provider:J}=await Oq(G,q.flags.provider,!!process.stdin.isTTY),{resolveProviderPath:Y}=await import("./chunk-vhkxjexp.js"),B=Y(G.providers.find((O)=>O.name===J.name).global),{join:V}=await import("path"),W=V(B,z);if(!q.flags.force){let O=!1;try{let{access:F}=await import("fs/promises");await F(W),O=!0}catch{}if(O){if(!process.stdin.isTTY)E(`Target already exists: ${W}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Target already exists: ${W}`)}
|
|
481
|
+
${H.bold("Overwrite?")} [y/N] `);let F=await f0();if(F.toLowerCase()!=="y"&&F.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await U$(X,B,z,!0)}else await U$(X,B,z,!1)}else await U$(X,B,z,!0);if(q.flags.json)console.log(m({success:!0,name:z,symlinkPath:W,targetPath:X}));else console.error(H.green(`Done! Linked "${z}" -> ${X}`)),console.error(` Symlink: ${W}`),console.error(H.dim(` If you move or delete the source, run "asm uninstall ${z}" to clean up.`))}function $J(){console.log(`${H.bold("Usage:")} asm index <subcommand> [options]
|
|
478
482
|
|
|
479
483
|
Manage the skill index for searching available skills from indexed repos.
|
|
480
484
|
|
|
@@ -498,7 +502,10 @@ ${H.bold("Examples:")}
|
|
|
498
502
|
asm index search marketing --has license ${H.dim("Only with license")}
|
|
499
503
|
asm index search "" --missing creator ${H.dim("Skills missing creator")}
|
|
500
504
|
asm index list ${H.dim("List indexed repos")}
|
|
501
|
-
asm index remove obra/superpowers ${H.dim("Remove from index")}`)}async function
|
|
502
|
-
`));for(let z of
|
|
503
|
-
`)}}break}case"list":{let Z=await
|
|
504
|
-
`));for(let
|
|
505
|
+
asm index remove obra/superpowers ${H.dim("Remove from index")}`)}async function ZJ(q){if(q.flags.help){$J();return}let $=q.subcommand;if(!$)E("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)E("Missing required argument: <repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);console.error(H.blueBold(`Ingesting ${Z}...`));let U=await h4(Z);if(!U.success)E(`Failed to ingest: ${U.error}`),process.exit(1);if(U.repoIndex)if(q.flags.json)console.log(m({success:!0,owner:U.repoIndex.owner,repo:U.repoIndex.repo,skillCount:U.repoIndex.skillCount,updatedAt:U.repoIndex.updatedAt}));else console.error(H.green(`Successfully indexed ${U.repoIndex.owner}/${U.repoIndex.repo}`)),console.error(` Skills found: ${U.repoIndex.skillCount}`);break}case"search":{let Z=q.positional.join(" ");if(!Z&&q.flags.has.length===0&&q.flags.missing.length===0)E("Missing required argument: <query>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let U={};if(q.flags.has.length>0)U.has=q.flags.has;if(q.flags.missing.length>0)U.missing=q.flags.missing;let Q=U.has||U.missing?await J$(Z||"",20,U):await J$(Z);if(Q.length===0){if(q.flags.json)console.log(m([]));else console.info("No skills found matching your query."),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(q.flags.json)console.log(m(Q.map((z)=>({name:z.skill.name,description:z.skill.description,version:z.skill.version,license:z.skill.license||"",creator:z.skill.creator||"",compatibility:z.skill.compatibility||"",allowedTools:z.skill.allowedTools||[],installUrl:z.skill.installUrl,installCommand:`asm install ${z.skill.installUrl}`,repo:`${z.repo.owner}/${z.repo.repo}`}))));else{console.error(H.bold(`Found ${Q.length} skills:
|
|
506
|
+
`));for(let z of Q){console.error(`${H.cyan(z.skill.name)} ${H.dim(`v${z.skill.version}`)} ${H.dim(`[${z.repo.owner}/${z.repo.repo}]`)}`);for(let J of h2(z.skill.description,80))console.error(` ${J}`);let G=y4(z.skill);if(G.length>0)console.error(` ${H.yellow(`⚠ Missing: ${G.join(", ")}`)}`);console.error(` ${H.green(`asm install ${z.skill.installUrl}`)}
|
|
507
|
+
`)}}break}case"list":{let Z=await k4();if(Z.length===0){if(q.flags.json)console.log(m([]));else console.info("No repositories indexed."),console.error(H.dim("Add repos with: asm index ingest <repo>"));return}let U=await x4();if(q.flags.json)console.log(m(Z));else{console.error(H.bold(`Indexed Repositories (${U} total skills):
|
|
508
|
+
`));for(let X of Z)console.error(`${H.cyan(`${X.owner}/${X.repo}`)} - ${X.skillCount} skills ${H.dim(`(${new Date(X.updatedAt).toLocaleDateString()})`)}`)}break}case"remove":{let Z=q.positional[0];if(!Z)E("Missing required argument: <owner/repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let[U,X]=Z.split("/");if(!U||!X)E("Invalid format. Use: <owner/repo>"),process.exit(2);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`${H.bold("Remove")} ${H.cyan(`${U}/${X}`)} ${H.bold("from index?")} [y/N] `);let z=await f0();if(z.toLowerCase()!=="y"&&z.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}if(await v4(U,X))console.error(H.green(`Removed ${U}/${X} from index`));else E(`Repository not found in index: ${U}/${X}`),process.exit(1);break}default:E(`Unknown subcommand: "${$}"`),console.error('Run "asm index --help" for usage.'),process.exit(2)}}async function U8(q){let $=DG(q);if($.flags.noColor)globalThis.__CLI_NO_COLOR=!0;if($.flags.verbose)u4(!0);if($.flags.version){console.log(`asm ${v2}`);return}if(!$.command&&$.flags.help){wG();return}if(!$.command)return;switch($.command){case"list":await EG($);break;case"search":await fG($);break;case"inspect":await yG($);break;case"uninstall":await xG($);break;case"audit":await gG($);break;case"install":await iG($);break;case"config":await mG($);break;case"export":await nG($);break;case"init":await oG($);break;case"stats":await tG($);break;case"link":await qJ($);break;case"index":await ZJ($);break;default:E(`Unknown command: "${$.command}"`),console.error('Run "asm --help" for usage.'),process.exit(2)}}function X8(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(X8(process.argv))await U8(process.argv);else if(!(typeof globalThis.Bun<"u")){let{spawn:$}=await import("child_process"),Z=$("bun",[process.argv[1],...process.argv.slice(2)],{stdio:"inherit"});Z.on("error",()=>{console.error(`The interactive TUI requires Bun (https://bun.sh).
|
|
509
|
+
Install it with: curl -fsSL https://bun.sh/install | bash
|
|
510
|
+
|
|
511
|
+
`+"CLI commands (list, search, inspect, etc.) work with Node.js — run: asm --help"),process.exit(1)}),Z.on("exit",(U)=>process.exit(U??0))}else await import("./chunk-d8zyhd1t.js");
|