agent-skill-manager 1.12.0 → 1.13.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.
@@ -1,75 +1,75 @@
1
1
  #!/usr/bin/env node
2
- import{A as a4,a as L0,b as I0,d as i,e as x4,f as f2,g as g4,h as k4,i as y2,j as h4,k as H,l as v4,m as B4,n as u4,o as x2,p as m4,q as p4,r as d4,s as g2,t as u,u as k2,v as c4,x as l4,y as i4,z as h2}from"./chunk-zdwywb64.js";import{B as d,C as D,D as k,E as E4,F as f,G as f4,H as E2,I as Yq,J as w4,K as W$,L as h,M as y4}from"./chunk-dykgxxyr.js";var S=D((S8)=>{var T$=Symbol.for("yaml.alias"),e2=Symbol.for("yaml.document"),Tq=Symbol.for("yaml.map"),q1=Symbol.for("yaml.pair"),F$=Symbol.for("yaml.scalar"),Fq=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),D8=(q)=>!!q&&typeof q==="object"&&q[t]===T$,w8=(q)=>!!q&&typeof q==="object"&&q[t]===e2,P8=(q)=>!!q&&typeof q==="object"&&q[t]===Tq,N8=(q)=>!!q&&typeof q==="object"&&q[t]===q1,$1=(q)=>!!q&&typeof q==="object"&&q[t]===F$,j8=(q)=>!!q&&typeof q==="object"&&q[t]===Fq;function Z1(q){if(q&&typeof q==="object")switch(q[t]){case Tq:case Fq:return!0}return!1}function C8(q){if(q&&typeof q==="object")switch(q[t]){case T$:case Tq:case F$:case Fq:return!0}return!1}var b8=(q)=>($1(q)||Z1(q))&&!!q.anchor;S8.ALIAS=T$;S8.DOC=e2;S8.MAP=Tq;S8.NODE_TYPE=t;S8.PAIR=q1;S8.SCALAR=F$;S8.SEQ=Fq;S8.hasAnchor=b8;S8.isAlias=D8;S8.isCollection=Z1;S8.isDocument=w8;S8.isMap=P8;S8.isNode=C8;S8.isPair=N8;S8.isScalar=$1;S8.isSeq=j8});var v0=D((n8)=>{var g=S(),v=Symbol("break visit"),X1=Symbol("skip children"),n=Symbol("remove node");function Lq(q,$){let Z=Q1($);if(g.isDocument(q)){if(R0(null,q.contents,Z,Object.freeze([q]))===n)q.contents=null}else R0(null,q,Z,Object.freeze([]))}Lq.BREAK=v;Lq.SKIP=X1;Lq.REMOVE=n;function R0(q,$,Z,X){let Q=U1(q,$,Z,X);if(g.isNode(Q)||g.isPair(Q))return z1(q,X,Q),R0(q,Q,Z,X);if(typeof Q!=="symbol"){if(g.isCollection($)){X=Object.freeze(X.concat($));for(let U=0;U<$.items.length;++U){let z=R0(U,$.items[U],Z,X);if(typeof z==="number")U=z-1;else if(z===v)return v;else if(z===n)$.items.splice(U,1),U-=1}}else if(g.isPair($)){X=Object.freeze(X.concat($));let U=R0("key",$.key,Z,X);if(U===v)return v;else if(U===n)$.key=null;let z=R0("value",$.value,Z,X);if(z===v)return v;else if(z===n)$.value=null}}return Q}async function Iq(q,$){let Z=Q1($);if(g.isDocument(q)){if(await A0(null,q.contents,Z,Object.freeze([q]))===n)q.contents=null}else await A0(null,q,Z,Object.freeze([]))}Iq.BREAK=v;Iq.SKIP=X1;Iq.REMOVE=n;async function A0(q,$,Z,X){let Q=await U1(q,$,Z,X);if(g.isNode(Q)||g.isPair(Q))return z1(q,X,Q),A0(q,Q,Z,X);if(typeof Q!=="symbol"){if(g.isCollection($)){X=Object.freeze(X.concat($));for(let U=0;U<$.items.length;++U){let z=await A0(U,$.items[U],Z,X);if(typeof z==="number")U=z-1;else if(z===v)return v;else if(z===n)$.items.splice(U,1),U-=1}}else if(g.isPair($)){X=Object.freeze(X.concat($));let U=await A0("key",$.key,Z,X);if(U===v)return v;else if(U===n)$.key=null;let z=await A0("value",$.value,Z,X);if(z===v)return v;else if(z===n)$.value=null}}return Q}function Q1(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function U1(q,$,Z,X){if(typeof Z==="function")return Z(q,$,X);if(g.isMap($))return Z.Map?.(q,$,X);if(g.isSeq($))return Z.Seq?.(q,$,X);if(g.isPair($))return Z.Pair?.(q,$,X);if(g.isScalar($))return Z.Scalar?.(q,$,X);if(g.isAlias($))return Z.Alias?.(q,$,X);return}function z1(q,$,Z){let X=$[$.length-1];if(g.isCollection(X))X.items[q]=Z;else if(g.isPair(X))if(q==="key")X.key=Z;else X.value=Z;else if(g.isDocument(X))X.contents=Z;else{let Q=g.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}n8.visit=Lq;n8.visitAsync=Iq});var L$=D((q5)=>{var G1=S(),r8=v0(),t8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},e8=(q)=>q.replace(/[!,[\]{}]/g,($)=>t8[$]);class m{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},m.defaultYaml,q),this.tags=Object.assign({},m.defaultTags,$)}clone(){let q=new m(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new m(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:m.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},m.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:m.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},m.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),X=Z.shift();switch(X){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[Q,U]=Z;return this.tags[Q]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[Q]=Z;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let U=/^\d+\.\d+$/.test(Q);return $(6,`Unsupported YAML version ${Q}`,U),!1}}default:return $(0,`Unknown directive ${X}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let U=q.slice(2,-1);if(U==="!"||U==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return U}let[,Z,X]=q.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${q} tag has no suffix`);let Q=this.tags[Z];if(Q)try{return Q+decodeURIComponent(X)}catch(U){return $(String(U)),null}if(Z==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,Z]of Object.entries(this.tags))if(q.startsWith(Z))return $+e8(q.substring(Z.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),X;if(q&&Z.length>0&&G1.isNode(q.contents)){let Q={};r8.visit(q.contents,(U,z)=>{if(G1.isNode(z)&&z.tag)Q[z.tag]=!0}),X=Object.keys(Q)}else X=[];for(let[Q,U]of Z){if(Q==="!!"&&U==="tag:yaml.org,2002:")continue;if(!q||X.some((z)=>z.startsWith(U)))$.push(`%TAG ${Q} ${U}`)}return $.join(`
3
- `)}}m.defaultYaml={explicit:!1,version:"1.2"};m.defaultTags={"!!":"tag:yaml.org,2002:"};q5.Directives=m});var Kq=D((U5)=>{var J1=S(),Z5=v0();function X5(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(Z)}return!0}function Y1(q){let $=new Set;return Z5.visit(q,{Value(Z,X){if(X.anchor)$.add(X.anchor)}}),$}function H1(q,$){for(let Z=1;;++Z){let X=`${q}${Z}`;if(!$.has(X))return X}}function Q5(q,$){let Z=[],X=new Map,Q=null;return{onAnchor:(U)=>{Z.push(U),Q??(Q=Y1(q));let z=H1($,Q);return Q.add(z),z},setAnchors:()=>{for(let U of Z){let z=X.get(U);if(typeof z==="object"&&z.anchor&&(J1.isScalar(z.node)||J1.isCollection(z.node)))z.node.anchor=z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=U,G}}},sourceObjects:X}}U5.anchorIsValid=X5;U5.anchorNames=Y1;U5.createNodeAnchors=Q5;U5.findNewAnchor=H1});var I$=D((H5)=>{function u0(q,$,Z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Q=0,U=X.length;Q<U;++Q){let z=X[Q],G=u0(q,X,String(Q),z);if(G===void 0)delete X[Q];else if(G!==z)X[Q]=G}else if(X instanceof Map)for(let Q of Array.from(X.keys())){let U=X.get(Q),z=u0(q,X,Q,U);if(z===void 0)X.delete(Q);else if(z!==U)X.set(Q,z)}else if(X instanceof Set)for(let Q of Array.from(X)){let U=u0(q,X,Q,Q);if(U===void 0)X.delete(Q);else if(U!==Q)X.delete(Q),X.add(U)}else for(let[Q,U]of Object.entries(X)){let z=u0(q,X,Q,U);if(z===void 0)delete X[Q];else if(z!==U)X[Q]=z}return q.call($,Z,X)}H5.applyReviver=u0});var q0=D((B5)=>{var W5=S();function V1(q,$,Z){if(Array.isArray(q))return q.map((X,Q)=>V1(X,String(Q),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!W5.hasAnchor(q))return q.toJSON($,Z);let X={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,X),Z.onCreate=(U)=>{X.res=U,delete Z.onCreate};let Q=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(Q);return Q}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}B5.toJS=V1});var Rq=D((F5)=>{var O5=I$(),W1=S(),T5=q0();class B1{constructor(q){Object.defineProperty(this,W1.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:Z,onAnchor:X,reviver:Q}={}){if(!W1.isDocument(q))throw TypeError("A document argument is required");let U={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},z=T5.toJS(this,"",U);if(typeof X==="function")for(let{count:G,res:J}of U.anchors.values())X(J,G);return typeof Q==="function"?O5.applyReviver(Q,{"":z},"",z):z}}F5.NodeBase=B1});var m0=D((M5)=>{var I5=Kq(),K5=v0(),M0=S(),R5=Rq(),A5=q0();class _1 extends R5.NodeBase{constructor(q){super(M0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let Z;if($?.aliasResolveCache)Z=$.aliasResolveCache;else if(Z=[],K5.visit(q,{Node:(Q,U)=>{if(M0.isAlias(U)||M0.hasAnchor(U))Z.push(U)}}),$)$.aliasResolveCache=Z;let X=void 0;for(let Q of Z){if(Q===this)break;if(Q.anchor===this.source)X=Q}return X}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:X,maxAliasCount:Q}=$,U=this.resolve(X,$);if(!U){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=Z.get(U);if(!z)A5.toJS(U,null,$),z=Z.get(U);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=Aq(X,U,Z);if(z.count*z.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,$,Z){let X=`*${this.source}`;if(q){if(I5.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(q.implicitKey)return`${X} `}return X}}function Aq(q,$,Z){if(M0.isAlias($)){let X=$.resolve(q),Q=Z&&X&&Z.get(X);return Q?Q.count*Q.aliasCount:0}else if(M0.isCollection($)){let X=0;for(let Q of $.items){let U=Aq(q,Q,Z);if(U>X)X=U}return X}else if(M0.isPair($)){let X=Aq(q,$.key,Z),Q=Aq(q,$.value,Z);return Math.max(X,Q)}return 1}M5.Alias=_1});var x=D((C5)=>{var w5=S(),P5=Rq(),N5=q0(),j5=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class Y0 extends P5.NodeBase{constructor(q){super(w5.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:N5.toJS(this.value,q,$)}toString(){return String(this.value)}}Y0.BLOCK_FOLDED="BLOCK_FOLDED";Y0.BLOCK_LITERAL="BLOCK_LITERAL";Y0.PLAIN="PLAIN";Y0.QUOTE_DOUBLE="QUOTE_DOUBLE";Y0.QUOTE_SINGLE="QUOTE_SINGLE";C5.Scalar=Y0;C5.isScalarValue=j5});var p0=D((g5)=>{var E5=m0(),H0=S(),O1=x(),f5="tag:yaml.org,2002:";function y5(q,$,Z){if($){let X=Z.filter((U)=>U.tag===$),Q=X.find((U)=>!U.format)??X[0];if(!Q)throw Error(`Tag ${$} not found`);return Q}return Z.find((X)=>X.identify?.(q)&&!X.format)}function x5(q,$,Z){if(H0.isDocument(q))q=q.contents;if(H0.isNode(q))return q;if(H0.isPair(q)){let V=Z.schema[H0.MAP].createNode?.(Z.schema,null,Z);return V.items.push(q),V}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:X,onAnchor:Q,onTagObj:U,schema:z,sourceObjects:G}=Z,J=void 0;if(X&&q&&typeof q==="object")if(J=G.get(q),J)return J.anchor??(J.anchor=Q(q)),new E5.Alias(J.anchor);else J={anchor:null,node:null},G.set(q,J);if($?.startsWith("!!"))$=f5+$.slice(2);let Y=y5(q,$,z.tags);if(!Y){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let V=new O1.Scalar(q);if(J)J.node=V;return V}Y=q instanceof Map?z[H0.MAP]:(Symbol.iterator in Object(q))?z[H0.SEQ]:z[H0.MAP]}if(U)U(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 O1.Scalar(q);if($)B.tag=$;else if(!Y.default)B.tag=Y.tag;if(J)J.node=B;return B}g5.createNode=x5});var Mq=D((u5)=>{var h5=p0(),s=S(),v5=Rq();function K$(q,$,Z){let X=Z;for(let Q=$.length-1;Q>=0;--Q){let U=$[Q];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let z=[];z[U]=X,X=z}else X=new Map([[U,X]])}return h5.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var T1=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class F1 extends v5.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((Z)=>s.isNode(Z)||s.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(T1(q))this.add($);else{let[Z,...X]=q,Q=this.get(Z,!0);if(s.isCollection(Q))Q.addIn(X,$);else if(Q===void 0&&this.schema)this.set(Z,K$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let X=this.get($,!0);if(s.isCollection(X))return X.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...X]=q,Q=this.get(Z,!0);if(X.length===0)return!$&&s.isScalar(Q)?Q.value:Q;else return s.isCollection(Q)?Q.getIn(X,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!s.isPair($))return!1;let Z=$.value;return Z==null||q&&s.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn(q){let[$,...Z]=q;if(Z.length===0)return this.has($);let X=this.get($,!0);return s.isCollection(X)?X.hasIn(Z):!1}setIn(q,$){let[Z,...X]=q;if(X.length===0)this.set(Z,$);else{let Q=this.get(Z,!0);if(s.isCollection(Q))Q.setIn(X,$);else if(Q===void 0&&this.schema)this.set(Z,K$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}}u5.Collection=F1;u5.collectionFromPath=K$;u5.isEmptyPath=T1});var d0=D((i5)=>{var c5=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function R$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var l5=(q,$,Z)=>q.endsWith(`
2
+ import{A as i4,B as a4,C as k2,D as n4,a as L0,b as I0,c as i2,e as i,f as g4,g as f2,h as h4,i as k4,j as y2,k as v4,l as H,m as u4,n as _4,o as m4,p as x2,q as p4,r as d4,u as c4,v as g2,w as u,x as h2,y as l4}from"./chunk-hw8kyyg5.js";import{E as d,F as D,G as h,H as f4,I as f,J as y4,K as E2,L as Yq,M as P4,N as W$,O as k,P as x4}from"./chunk-b7betbzn.js";var S=D((E8)=>{var T$=Symbol.for("yaml.alias"),q1=Symbol.for("yaml.document"),Tq=Symbol.for("yaml.map"),$1=Symbol.for("yaml.pair"),F$=Symbol.for("yaml.scalar"),Fq=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),w8=(q)=>!!q&&typeof q==="object"&&q[t]===T$,P8=(q)=>!!q&&typeof q==="object"&&q[t]===q1,N8=(q)=>!!q&&typeof q==="object"&&q[t]===Tq,j8=(q)=>!!q&&typeof q==="object"&&q[t]===$1,Z1=(q)=>!!q&&typeof q==="object"&&q[t]===F$,C8=(q)=>!!q&&typeof q==="object"&&q[t]===Fq;function X1(q){if(q&&typeof q==="object")switch(q[t]){case Tq:case Fq:return!0}return!1}function b8(q){if(q&&typeof q==="object")switch(q[t]){case T$:case Tq:case F$:case Fq:return!0}return!1}var S8=(q)=>(Z1(q)||X1(q))&&!!q.anchor;E8.ALIAS=T$;E8.DOC=q1;E8.MAP=Tq;E8.NODE_TYPE=t;E8.PAIR=$1;E8.SCALAR=F$;E8.SEQ=Fq;E8.hasAnchor=S8;E8.isAlias=w8;E8.isCollection=X1;E8.isDocument=P8;E8.isMap=N8;E8.isNode=b8;E8.isPair=j8;E8.isScalar=Z1;E8.isSeq=C8});var v0=D((s8)=>{var g=S(),v=Symbol("break visit"),Q1=Symbol("skip children"),n=Symbol("remove node");function Lq(q,$){let Z=U1($);if(g.isDocument(q)){if(R0(null,q.contents,Z,Object.freeze([q]))===n)q.contents=null}else R0(null,q,Z,Object.freeze([]))}Lq.BREAK=v;Lq.SKIP=Q1;Lq.REMOVE=n;function R0(q,$,Z,X){let Q=z1(q,$,Z,X);if(g.isNode(Q)||g.isPair(Q))return G1(q,X,Q),R0(q,Q,Z,X);if(typeof Q!=="symbol"){if(g.isCollection($)){X=Object.freeze(X.concat($));for(let U=0;U<$.items.length;++U){let z=R0(U,$.items[U],Z,X);if(typeof z==="number")U=z-1;else if(z===v)return v;else if(z===n)$.items.splice(U,1),U-=1}}else if(g.isPair($)){X=Object.freeze(X.concat($));let U=R0("key",$.key,Z,X);if(U===v)return v;else if(U===n)$.key=null;let z=R0("value",$.value,Z,X);if(z===v)return v;else if(z===n)$.value=null}}return Q}async function Iq(q,$){let Z=U1($);if(g.isDocument(q)){if(await M0(null,q.contents,Z,Object.freeze([q]))===n)q.contents=null}else await M0(null,q,Z,Object.freeze([]))}Iq.BREAK=v;Iq.SKIP=Q1;Iq.REMOVE=n;async function M0(q,$,Z,X){let Q=await z1(q,$,Z,X);if(g.isNode(Q)||g.isPair(Q))return G1(q,X,Q),M0(q,Q,Z,X);if(typeof Q!=="symbol"){if(g.isCollection($)){X=Object.freeze(X.concat($));for(let U=0;U<$.items.length;++U){let z=await M0(U,$.items[U],Z,X);if(typeof z==="number")U=z-1;else if(z===v)return v;else if(z===n)$.items.splice(U,1),U-=1}}else if(g.isPair($)){X=Object.freeze(X.concat($));let U=await M0("key",$.key,Z,X);if(U===v)return v;else if(U===n)$.key=null;let z=await M0("value",$.value,Z,X);if(z===v)return v;else if(z===n)$.value=null}}return Q}function U1(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function z1(q,$,Z,X){if(typeof Z==="function")return Z(q,$,X);if(g.isMap($))return Z.Map?.(q,$,X);if(g.isSeq($))return Z.Seq?.(q,$,X);if(g.isPair($))return Z.Pair?.(q,$,X);if(g.isScalar($))return Z.Scalar?.(q,$,X);if(g.isAlias($))return Z.Alias?.(q,$,X);return}function G1(q,$,Z){let X=$[$.length-1];if(g.isCollection(X))X.items[q]=Z;else if(g.isPair(X))if(q==="key")X.key=Z;else X.value=Z;else if(g.isDocument(X))X.contents=Z;else{let Q=g.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}s8.visit=Lq;s8.visitAsync=Iq});var L$=D(($5)=>{var J1=S(),t8=v0(),e8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},q5=(q)=>q.replace(/[!,[\]{}]/g,($)=>e8[$]);class m{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},m.defaultYaml,q),this.tags=Object.assign({},m.defaultTags,$)}clone(){let q=new m(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new m(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:m.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},m.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:m.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},m.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),X=Z.shift();switch(X){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[Q,U]=Z;return this.tags[Q]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[Q]=Z;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let U=/^\d+\.\d+$/.test(Q);return $(6,`Unsupported YAML version ${Q}`,U),!1}}default:return $(0,`Unknown directive ${X}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let U=q.slice(2,-1);if(U==="!"||U==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return U}let[,Z,X]=q.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${q} tag has no suffix`);let Q=this.tags[Z];if(Q)try{return Q+decodeURIComponent(X)}catch(U){return $(String(U)),null}if(Z==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,Z]of Object.entries(this.tags))if(q.startsWith(Z))return $+q5(q.substring(Z.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),X;if(q&&Z.length>0&&J1.isNode(q.contents)){let Q={};t8.visit(q.contents,(U,z)=>{if(J1.isNode(z)&&z.tag)Q[z.tag]=!0}),X=Object.keys(Q)}else X=[];for(let[Q,U]of Z){if(Q==="!!"&&U==="tag:yaml.org,2002:")continue;if(!q||X.some((z)=>z.startsWith(U)))$.push(`%TAG ${Q} ${U}`)}return $.join(`
3
+ `)}}m.defaultYaml={explicit:!1,version:"1.2"};m.defaultTags={"!!":"tag:yaml.org,2002:"};$5.Directives=m});var Kq=D((z5)=>{var Y1=S(),X5=v0();function Q5(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(Z)}return!0}function H1(q){let $=new Set;return X5.visit(q,{Value(Z,X){if(X.anchor)$.add(X.anchor)}}),$}function V1(q,$){for(let Z=1;;++Z){let X=`${q}${Z}`;if(!$.has(X))return X}}function U5(q,$){let Z=[],X=new Map,Q=null;return{onAnchor:(U)=>{Z.push(U),Q??(Q=H1(q));let z=V1($,Q);return Q.add(z),z},setAnchors:()=>{for(let U of Z){let z=X.get(U);if(typeof z==="object"&&z.anchor&&(Y1.isScalar(z.node)||Y1.isCollection(z.node)))z.node.anchor=z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=U,G}}},sourceObjects:X}}z5.anchorIsValid=Q5;z5.anchorNames=H1;z5.createNodeAnchors=U5;z5.findNewAnchor=V1});var I$=D((V5)=>{function u0(q,$,Z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Q=0,U=X.length;Q<U;++Q){let z=X[Q],G=u0(q,X,String(Q),z);if(G===void 0)delete X[Q];else if(G!==z)X[Q]=G}else if(X instanceof Map)for(let Q of Array.from(X.keys())){let U=X.get(Q),z=u0(q,X,Q,U);if(z===void 0)X.delete(Q);else if(z!==U)X.set(Q,z)}else if(X instanceof Set)for(let Q of Array.from(X)){let U=u0(q,X,Q,Q);if(U===void 0)X.delete(Q);else if(U!==Q)X.delete(Q),X.add(U)}else for(let[Q,U]of Object.entries(X)){let z=u0(q,X,Q,U);if(z===void 0)delete X[Q];else if(z!==U)X[Q]=z}return q.call($,Z,X)}V5.applyReviver=u0});var q0=D((_5)=>{var B5=S();function W1(q,$,Z){if(Array.isArray(q))return q.map((X,Q)=>W1(X,String(Q),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!B5.hasAnchor(q))return q.toJSON($,Z);let X={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,X),Z.onCreate=(U)=>{X.res=U,delete Z.onCreate};let Q=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(Q);return Q}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}_5.toJS=W1});var Rq=D((L5)=>{var T5=I$(),B1=S(),F5=q0();class _1{constructor(q){Object.defineProperty(this,B1.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:Z,onAnchor:X,reviver:Q}={}){if(!B1.isDocument(q))throw TypeError("A document argument is required");let U={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},z=F5.toJS(this,"",U);if(typeof X==="function")for(let{count:G,res:J}of U.anchors.values())X(J,G);return typeof Q==="function"?T5.applyReviver(Q,{"":z},"",z):z}}L5.NodeBase=_1});var m0=D((D5)=>{var K5=Kq(),R5=v0(),A0=S(),M5=Rq(),A5=q0();class O1 extends M5.NodeBase{constructor(q){super(A0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let Z;if($?.aliasResolveCache)Z=$.aliasResolveCache;else if(Z=[],R5.visit(q,{Node:(Q,U)=>{if(A0.isAlias(U)||A0.hasAnchor(U))Z.push(U)}}),$)$.aliasResolveCache=Z;let X=void 0;for(let Q of Z){if(Q===this)break;if(Q.anchor===this.source)X=Q}return X}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:X,maxAliasCount:Q}=$,U=this.resolve(X,$);if(!U){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=Z.get(U);if(!z)A5.toJS(U,null,$),z=Z.get(U);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=Mq(X,U,Z);if(z.count*z.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,$,Z){let X=`*${this.source}`;if(q){if(K5.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(q.implicitKey)return`${X} `}return X}}function Mq(q,$,Z){if(A0.isAlias($)){let X=$.resolve(q),Q=Z&&X&&Z.get(X);return Q?Q.count*Q.aliasCount:0}else if(A0.isCollection($)){let X=0;for(let Q of $.items){let U=Mq(q,Q,Z);if(U>X)X=U}return X}else if(A0.isPair($)){let X=Mq(q,$.key,Z),Q=Mq(q,$.value,Z);return Math.max(X,Q)}return 1}D5.Alias=O1});var x=D((b5)=>{var P5=S(),N5=Rq(),j5=q0(),C5=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class Y0 extends N5.NodeBase{constructor(q){super(P5.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:j5.toJS(this.value,q,$)}toString(){return String(this.value)}}Y0.BLOCK_FOLDED="BLOCK_FOLDED";Y0.BLOCK_LITERAL="BLOCK_LITERAL";Y0.PLAIN="PLAIN";Y0.QUOTE_DOUBLE="QUOTE_DOUBLE";Y0.QUOTE_SINGLE="QUOTE_SINGLE";b5.Scalar=Y0;b5.isScalarValue=C5});var p0=D((h5)=>{var f5=m0(),H0=S(),T1=x(),y5="tag:yaml.org,2002:";function x5(q,$,Z){if($){let X=Z.filter((U)=>U.tag===$),Q=X.find((U)=>!U.format)??X[0];if(!Q)throw Error(`Tag ${$} not found`);return Q}return Z.find((X)=>X.identify?.(q)&&!X.format)}function g5(q,$,Z){if(H0.isDocument(q))q=q.contents;if(H0.isNode(q))return q;if(H0.isPair(q)){let V=Z.schema[H0.MAP].createNode?.(Z.schema,null,Z);return V.items.push(q),V}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:X,onAnchor:Q,onTagObj:U,schema:z,sourceObjects:G}=Z,J=void 0;if(X&&q&&typeof q==="object")if(J=G.get(q),J)return J.anchor??(J.anchor=Q(q)),new f5.Alias(J.anchor);else J={anchor:null,node:null},G.set(q,J);if($?.startsWith("!!"))$=y5+$.slice(2);let Y=x5(q,$,z.tags);if(!Y){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let V=new T1.Scalar(q);if(J)J.node=V;return V}Y=q instanceof Map?z[H0.MAP]:(Symbol.iterator in Object(q))?z[H0.SEQ]:z[H0.MAP]}if(U)U(Y),delete Z.onTagObj;let B=Y?.createNode?Y.createNode(Z.schema,q,Z):typeof Y?.nodeClass?.from==="function"?Y.nodeClass.from(Z.schema,q,Z):new T1.Scalar(q);if($)B.tag=$;else if(!Y.default)B.tag=Y.tag;if(J)J.node=B;return B}h5.createNode=g5});var Aq=D((m5)=>{var v5=p0(),s=S(),u5=Rq();function K$(q,$,Z){let X=Z;for(let Q=$.length-1;Q>=0;--Q){let U=$[Q];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let z=[];z[U]=X,X=z}else X=new Map([[U,X]])}return v5.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var F1=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class L1 extends u5.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((Z)=>s.isNode(Z)||s.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(F1(q))this.add($);else{let[Z,...X]=q,Q=this.get(Z,!0);if(s.isCollection(Q))Q.addIn(X,$);else if(Q===void 0&&this.schema)this.set(Z,K$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let X=this.get($,!0);if(s.isCollection(X))return X.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...X]=q,Q=this.get(Z,!0);if(X.length===0)return!$&&s.isScalar(Q)?Q.value:Q;else return s.isCollection(Q)?Q.getIn(X,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!s.isPair($))return!1;let Z=$.value;return Z==null||q&&s.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn(q){let[$,...Z]=q;if(Z.length===0)return this.has($);let X=this.get($,!0);return s.isCollection(X)?X.hasIn(Z):!1}setIn(q,$){let[Z,...X]=q;if(X.length===0)this.set(Z,$);else{let Q=this.get(Z,!0);if(s.isCollection(Q))Q.setIn(X,$);else if(Q===void 0&&this.schema)this.set(Z,K$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}}m5.Collection=L1;m5.collectionFromPath=K$;m5.isEmptyPath=F1});var d0=D((a5)=>{var l5=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function R$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var i5=(q,$,Z)=>q.endsWith(`
4
4
  `)?R$(Z,$):Z.includes(`
5
5
  `)?`
6
- `+R$(Z,$):(q.endsWith(" ")?"":" ")+Z;i5.indentComment=R$;i5.lineComment=l5;i5.stringifyComment=c5});var I1=D((r5)=>{function o5(q,$,Z="flow",{indentAtStart:X,lineWidth:Q=80,minContentWidth:U=20,onFold:z,onOverflow:G}={}){if(!Q||Q<0)return q;if(Q<U)U=0;let J=Math.max(1+U,1+Q-$.length);if(q.length<=J)return q;let Y=[],B={},V=Q-$.length;if(typeof X==="number")if(X>Q-Math.max(2,U))Y.push(0);else V=Q-X;let W=void 0,T=void 0,F=!1,_=-1,O=-1,R=-1;if(Z==="block"){if(_=L1(q,_,$.length),_!==-1)V=_+J}for(let M;M=q[_+=1];){if(Z==="quoted"&&M==="\\"){switch(O=_,q[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}R=_}if(M===`
7
- `){if(Z==="block")_=L1(q,_,$.length);V=_+$.length+J,W=void 0}else{if(M===" "&&T&&T!==" "&&T!==`
6
+ `+R$(Z,$):(q.endsWith(" ")?"":" ")+Z;a5.indentComment=R$;a5.lineComment=i5;a5.stringifyComment=l5});var K1=D((t5)=>{function r5(q,$,Z="flow",{indentAtStart:X,lineWidth:Q=80,minContentWidth:U=20,onFold:z,onOverflow:G}={}){if(!Q||Q<0)return q;if(Q<U)U=0;let J=Math.max(1+U,1+Q-$.length);if(q.length<=J)return q;let Y=[],B={},V=Q-$.length;if(typeof X==="number")if(X>Q-Math.max(2,U))Y.push(0);else V=Q-X;let W=void 0,T=void 0,F=!1,_=-1,O=-1,R=-1;if(Z==="block"){if(_=I1(q,_,$.length),_!==-1)V=_+J}for(let A;A=q[_+=1];){if(Z==="quoted"&&A==="\\"){switch(O=_,q[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}R=_}if(A===`
7
+ `){if(Z==="block")_=I1(q,_,$.length);V=_+$.length+J,W=void 0}else{if(A===" "&&T&&T!==" "&&T!==`
8
8
  `&&T!=="\t"){let w=q[_+1];if(w&&w!==" "&&w!==`
9
- `&&w!=="\t")W=_}if(_>=V)if(W)Y.push(W),V=W+J,W=void 0;else if(Z==="quoted"){while(T===" "||T==="\t")T=M,M=q[_+=1],F=!0;let w=_>R+1?_-2:O-1;if(B[w])return q;Y.push(w),B[w]=!0,V=w+J,W=void 0}else F=!0}T=M}if(F&&G)G();if(Y.length===0)return q;if(z)z();let A=q.slice(0,Y[0]);for(let M=0;M<Y.length;++M){let w=Y[M],L=Y[M+1]||q.length;if(w===0)A=`
10
- ${$}${q.slice(0,L)}`;else{if(Z==="quoted"&&B[w])A+=`${q[w]}\\`;A+=`
11
- ${$}${q.slice(w+1,L)}`}}return A}function L1(q,$,Z){let X=$,Q=$+1,U=q[Q];while(U===" "||U==="\t")if($<Q+Z)U=q[++$];else{do U=q[++$];while(U&&U!==`
12
- `);X=$,Q=$+1,U=q[Q]}return X}r5.FOLD_BLOCK="block";r5.FOLD_FLOW="flow";r5.FOLD_QUOTED="quoted";r5.foldFlowLines=o5});var l0=D((UZ)=>{var c=x(),$0=I1(),wq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Pq=(q)=>/^(%|---|\.\.\.)/m.test(q);function ZZ(q,$,Z){if(!$||$<0)return!1;let X=$-Z,Q=q.length;if(Q<=X)return!1;for(let U=0,z=0;U<Q;++U)if(q[U]===`
9
+ `&&w!=="\t")W=_}if(_>=V)if(W)Y.push(W),V=W+J,W=void 0;else if(Z==="quoted"){while(T===" "||T==="\t")T=A,A=q[_+=1],F=!0;let w=_>R+1?_-2:O-1;if(B[w])return q;Y.push(w),B[w]=!0,V=w+J,W=void 0}else F=!0}T=A}if(F&&G)G();if(Y.length===0)return q;if(z)z();let M=q.slice(0,Y[0]);for(let A=0;A<Y.length;++A){let w=Y[A],L=Y[A+1]||q.length;if(w===0)M=`
10
+ ${$}${q.slice(0,L)}`;else{if(Z==="quoted"&&B[w])M+=`${q[w]}\\`;M+=`
11
+ ${$}${q.slice(w+1,L)}`}}return M}function I1(q,$,Z){let X=$,Q=$+1,U=q[Q];while(U===" "||U==="\t")if($<Q+Z)U=q[++$];else{do U=q[++$];while(U&&U!==`
12
+ `);X=$,Q=$+1,U=q[Q]}return X}t5.FOLD_BLOCK="block";t5.FOLD_FLOW="flow";t5.FOLD_QUOTED="quoted";t5.foldFlowLines=r5});var l0=D((zZ)=>{var c=x(),$0=K1(),wq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Pq=(q)=>/^(%|---|\.\.\.)/m.test(q);function XZ(q,$,Z){if(!$||$<0)return!1;let X=$-Z,Q=q.length;if(Q<=X)return!1;for(let U=0,z=0;U<Q;++U)if(q[U]===`
13
13
  `){if(U-z>X)return!0;if(z=U+1,Q-z<=X)return!1}return!0}function c0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:X}=$,Q=$.options.doubleQuotedMinMultiLineLength,U=$.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(X||Z[J+2]==='"'||Z.length<Q)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+=U,Z[J+2]===" ")z+="\\";J+=1,G=J+1}break;default:J+=1}}return z=G?z+Z.slice(G):Z,X?z:$0.foldFlowLines(z,U,$0.FOLD_QUOTED,wq($,!1))}function A$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
16
+ `,J+=2;if(z+=U,Z[J+2]===" ")z+="\\";J+=1,G=J+1}break;default:J+=1}}return z=G?z+Z.slice(G):Z,X?z:$0.foldFlowLines(z,U,$0.FOLD_QUOTED,wq($,!1))}function M$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
17
17
  `)||/[ \t]\n|\n[ \t]/.test(q))return c0(q,$);let Z=$.indent||(Pq(q)?" ":""),X="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
18
- ${Z}`)+"'";return $.implicitKey?X:$0.foldFlowLines(X,Z,$0.FOLD_FLOW,wq($,!1))}function D0(q,$){let{singleQuote:Z}=$.options,X;if(Z===!1)X=c0;else{let Q=q.includes('"'),U=q.includes("'");if(Q&&!U)X=A$;else if(U&&!Q)X=c0;else X=Z?A$:c0}return X(q,$)}var M$;try{M$=new RegExp(`(^|(?<!
18
+ ${Z}`)+"'";return $.implicitKey?X:$0.foldFlowLines(X,Z,$0.FOLD_FLOW,wq($,!1))}function D0(q,$){let{singleQuote:Z}=$.options,X;if(Z===!1)X=c0;else{let Q=q.includes('"'),U=q.includes("'");if(Q&&!U)X=M$;else if(U&&!Q)X=c0;else X=Z?M$:c0}return X(q,$)}var A$;try{A$=new RegExp(`(^|(?<!
19
19
  ))
20
20
  +(?!
21
- |$)`,"g")}catch{M$=/\n+(?!\n|$)/g}function Dq({comment:q,type:$,value:Z},X,Q,U){let{blockQuote:z,commentString:G,lineWidth:J}=X.options;if(!z||/\n[\t ]+$/.test(Z))return D0(Z,X);let Y=X.indent||(X.forceBlockIndent||Pq(Z)?" ":""),B=z==="literal"?!0:z==="folded"||$===c.Scalar.BLOCK_FOLDED?!1:$===c.Scalar.BLOCK_LITERAL?!0:!ZZ(Z,J,Y.length);if(!Z)return B?`|
21
+ |$)`,"g")}catch{A$=/\n+(?!\n|$)/g}function Dq({comment:q,type:$,value:Z},X,Q,U){let{blockQuote:z,commentString:G,lineWidth:J}=X.options;if(!z||/\n[\t ]+$/.test(Z))return D0(Z,X);let Y=X.indent||(X.forceBlockIndent||Pq(Z)?" ":""),B=z==="literal"?!0:z==="folded"||$===c.Scalar.BLOCK_FOLDED?!1:$===c.Scalar.BLOCK_LITERAL?!0:!XZ(Z,J,Y.length);if(!Z)return B?`|
22
22
  `:`>
23
23
  `;let V,W;for(W=Z.length;W>0;--W){let L=Z[W-1];if(L!==`
24
24
  `&&L!=="\t"&&L!==" ")break}let T=Z.substring(W),F=T.indexOf(`
25
25
  `);if(F===-1)V="-";else if(Z===T||F!==T.length-1){if(V="+",U)U()}else V="";if(T){if(Z=Z.slice(0,-T.length),T[T.length-1]===`
26
- `)T=T.slice(0,-1);T=T.replace(M$,`$&${Y}`)}let _=!1,O,R=-1;for(O=0;O<Z.length;++O){let L=Z[O];if(L===" ")_=!0;else if(L===`
27
- `)R=O;else break}let A=Z.substring(0,R<O?R+1:O);if(A)Z=Z.substring(A.length),A=A.replace(/\n+/g,`$&${Y}`);let w=(_?Y?"2":"1":"")+V;if(q){if(w+=" "+G(q.replace(/ ?[\r\n]+/g," ")),Q)Q()}if(!B){let L=Z.replace(/\n+/g,`
28
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),I=!1,P=wq(X,!0);if(z!=="folded"&&$!==c.Scalar.BLOCK_FOLDED)P.onOverflow=()=>{I=!0};let K=$0.foldFlowLines(`${A}${L}${T}`,Y,$0.FOLD_BLOCK,P);if(!I)return`>${w}
26
+ `)T=T.slice(0,-1);T=T.replace(A$,`$&${Y}`)}let _=!1,O,R=-1;for(O=0;O<Z.length;++O){let L=Z[O];if(L===" ")_=!0;else if(L===`
27
+ `)R=O;else break}let M=Z.substring(0,R<O?R+1:O);if(M)Z=Z.substring(M.length),M=M.replace(/\n+/g,`$&${Y}`);let w=(_?Y?"2":"1":"")+V;if(q){if(w+=" "+G(q.replace(/ ?[\r\n]+/g," ")),Q)Q()}if(!B){let L=Z.replace(/\n+/g,`
28
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),I=!1,P=wq(X,!0);if(z!=="folded"&&$!==c.Scalar.BLOCK_FOLDED)P.onOverflow=()=>{I=!0};let K=$0.foldFlowLines(`${M}${L}${T}`,Y,$0.FOLD_BLOCK,P);if(!I)return`>${w}
29
29
  ${Y}${K}`}return Z=Z.replace(/\n+/g,`$&${Y}`),`|${w}
30
- ${Y}${A}${Z}${T}`}function XZ(q,$,Z,X){let{type:Q,value:U}=q,{actualString:z,implicitKey:G,indent:J,indentStep:Y,inFlow:B}=$;if(G&&U.includes(`
30
+ ${Y}${M}${Z}${T}`}function QZ(q,$,Z,X){let{type:Q,value:U}=q,{actualString:z,implicitKey:G,indent:J,indentStep:Y,inFlow:B}=$;if(G&&U.includes(`
31
31
  `)||B&&/[[\]{},]/.test(U))return D0(U,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return G||B||!U.includes(`
32
32
  `)?D0(U,$):Dq(q,$,Z,X);if(!G&&!B&&Q!==c.Scalar.PLAIN&&U.includes(`
33
33
  `))return Dq(q,$,Z,X);if(Pq(U)){if(J==="")return $.forceBlockIndent=!0,Dq(q,$,Z,X);else if(G&&J===Y)return D0(U,$)}let V=U.replace(/\n+/g,`$&
34
- ${J}`);if(z){let W=(_)=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(V),{compat:T,tags:F}=$.doc.schema;if(F.some(W)||T?.some(W))return D0(U,$)}return G?V:$0.foldFlowLines(V,J,$0.FOLD_FLOW,wq($,!1))}function QZ(q,$,Z,X){let{implicitKey:Q,inFlow:U}=$,z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:G}=q;if(G!==c.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=c.Scalar.QUOTE_DOUBLE}let J=(B)=>{switch(B){case c.Scalar.BLOCK_FOLDED:case c.Scalar.BLOCK_LITERAL:return Q||U?D0(z.value,$):Dq(z,$,Z,X);case c.Scalar.QUOTE_DOUBLE:return c0(z.value,$);case c.Scalar.QUOTE_SINGLE:return A$(z.value,$);case c.Scalar.PLAIN:return XZ(z,$,Z,X);default:return null}},Y=J(G);if(Y===null){let{defaultKeyType:B,defaultStringType:V}=$.options,W=Q&&B||V;if(Y=J(W),Y===null)throw Error(`Unsupported default string type ${W}`)}return Y}UZ.stringifyString=QZ});var i0=D((_Z)=>{var GZ=Kq(),Z0=S(),JZ=d0(),YZ=l0();function HZ(q,$){let Z=Object.assign({blockQuote:!0,commentString:JZ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,$),X;switch(Z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:q,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:X,options:Z}}function VZ(q,$){if($.tag){let Q=q.filter((U)=>U.tag===$.tag);if(Q.length>0)return Q.find((U)=>U.format===$.format)??Q[0]}let Z=void 0,X;if(Z0.isScalar($)){X=$.value;let Q=q.filter((U)=>U.identify?.(X));if(Q.length>1){let U=Q.filter((z)=>z.test);if(U.length>0)Q=U}Z=Q.find((U)=>U.format===$.format)??Q.find((U)=>!U.format)}else X=$,Z=q.find((Q)=>Q.nodeClass&&X instanceof Q.nodeClass);if(!Z){let Q=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${Q} value`)}return Z}function WZ(q,$,{anchors:Z,doc:X}){if(!X.directives)return"";let Q=[],U=(Z0.isScalar(q)||Z0.isCollection(q))&&q.anchor;if(U&&GZ.anchorIsValid(U))Z.add(U),Q.push(`&${U}`);let z=q.tag??($.default?null:$.tag);if(z)Q.push(X.directives.tagString(z));return Q.join(" ")}function BZ(q,$,Z,X){if(Z0.isPair(q))return q.toString($,Z,X);if(Z0.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let Q=void 0,U=Z0.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>Q=J});Q??(Q=VZ($.doc.schema.tags,U));let z=WZ(U,Q,$);if(z.length>0)$.indentAtStart=($.indentAtStart??0)+z.length+1;let G=typeof Q.stringify==="function"?Q.stringify(U,$,Z,X):Z0.isScalar(U)?YZ.stringifyString(U,$,Z,X):U.toString($,Z,X);if(!z)return G;return Z0.isScalar(U)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
35
- ${$.indent}${G}`}_Z.createStringifyContext=HZ;_Z.stringify=BZ});var A1=D((LZ)=>{var e=S(),K1=x(),R1=i0(),a0=d0();function FZ({key:q,value:$},Z,X,Q){let{allNullValues:U,doc:z,indent:G,indentStep:J,options:{commentString:Y,indentSeq:B,simpleKeys:V}}=Z,W=e.isNode(q)&&q.comment||null;if(V){if(W)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let T=!V&&(!q||W&&$==null&&!Z.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===K1.Scalar.BLOCK_FOLDED||q.type===K1.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!T&&(V||!U),indent:G+J});let F=!1,_=!1,O=R1.stringify(q,Z,()=>F=!0,()=>_=!0);if(!T&&!Z.inFlow&&O.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");T=!0}if(Z.inFlow){if(U||$==null){if(F&&X)X();return O===""?"?":T?`? ${O}`:O}}else if(U&&!V||$==null&&T){if(O=`? ${O}`,W&&!F)O+=a0.lineComment(O,Z.indent,Y(W));else if(_&&Q)Q();return O}if(F)W=null;if(T){if(W)O+=a0.lineComment(O,Z.indent,Y(W));O=`? ${O}
36
- ${G}:`}else if(O=`${O}:`,W)O+=a0.lineComment(O,Z.indent,Y(W));let R,A,M;if(e.isNode($))R=!!$.spaceBefore,A=$.commentBefore,M=$.comment;else if(R=!1,A=null,M=null,$&&typeof $==="object")$=z.createNode($);if(Z.implicitKey=!1,!T&&!W&&e.isScalar($))Z.indentAtStart=O.length+1;if(_=!1,!B&&J.length>=2&&!Z.inFlow&&!T&&e.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let w=!1,L=R1.stringify($,Z,()=>w=!0,()=>_=!0),I=" ";if(W||R||A){if(I=R?`
37
- `:"",A){let P=Y(A);I+=`
34
+ ${J}`);if(z){let W=(_)=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(V),{compat:T,tags:F}=$.doc.schema;if(F.some(W)||T?.some(W))return D0(U,$)}return G?V:$0.foldFlowLines(V,J,$0.FOLD_FLOW,wq($,!1))}function UZ(q,$,Z,X){let{implicitKey:Q,inFlow:U}=$,z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:G}=q;if(G!==c.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=c.Scalar.QUOTE_DOUBLE}let J=(B)=>{switch(B){case c.Scalar.BLOCK_FOLDED:case c.Scalar.BLOCK_LITERAL:return Q||U?D0(z.value,$):Dq(z,$,Z,X);case c.Scalar.QUOTE_DOUBLE:return c0(z.value,$);case c.Scalar.QUOTE_SINGLE:return M$(z.value,$);case c.Scalar.PLAIN:return QZ(z,$,Z,X);default:return null}},Y=J(G);if(Y===null){let{defaultKeyType:B,defaultStringType:V}=$.options,W=Q&&B||V;if(Y=J(W),Y===null)throw Error(`Unsupported default string type ${W}`)}return Y}zZ.stringifyString=UZ});var i0=D((OZ)=>{var JZ=Kq(),Z0=S(),YZ=d0(),HZ=l0();function VZ(q,$){let Z=Object.assign({blockQuote:!0,commentString:YZ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,$),X;switch(Z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:q,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:X,options:Z}}function WZ(q,$){if($.tag){let Q=q.filter((U)=>U.tag===$.tag);if(Q.length>0)return Q.find((U)=>U.format===$.format)??Q[0]}let Z=void 0,X;if(Z0.isScalar($)){X=$.value;let Q=q.filter((U)=>U.identify?.(X));if(Q.length>1){let U=Q.filter((z)=>z.test);if(U.length>0)Q=U}Z=Q.find((U)=>U.format===$.format)??Q.find((U)=>!U.format)}else X=$,Z=q.find((Q)=>Q.nodeClass&&X instanceof Q.nodeClass);if(!Z){let Q=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${Q} value`)}return Z}function BZ(q,$,{anchors:Z,doc:X}){if(!X.directives)return"";let Q=[],U=(Z0.isScalar(q)||Z0.isCollection(q))&&q.anchor;if(U&&JZ.anchorIsValid(U))Z.add(U),Q.push(`&${U}`);let z=q.tag??($.default?null:$.tag);if(z)Q.push(X.directives.tagString(z));return Q.join(" ")}function _Z(q,$,Z,X){if(Z0.isPair(q))return q.toString($,Z,X);if(Z0.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let Q=void 0,U=Z0.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>Q=J});Q??(Q=WZ($.doc.schema.tags,U));let z=BZ(U,Q,$);if(z.length>0)$.indentAtStart=($.indentAtStart??0)+z.length+1;let G=typeof Q.stringify==="function"?Q.stringify(U,$,Z,X):Z0.isScalar(U)?HZ.stringifyString(U,$,Z,X):U.toString($,Z,X);if(!z)return G;return Z0.isScalar(U)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
35
+ ${$.indent}${G}`}OZ.createStringifyContext=VZ;OZ.stringify=_Z});var A1=D((IZ)=>{var e=S(),R1=x(),M1=i0(),a0=d0();function LZ({key:q,value:$},Z,X,Q){let{allNullValues:U,doc:z,indent:G,indentStep:J,options:{commentString:Y,indentSeq:B,simpleKeys:V}}=Z,W=e.isNode(q)&&q.comment||null;if(V){if(W)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let T=!V&&(!q||W&&$==null&&!Z.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===R1.Scalar.BLOCK_FOLDED||q.type===R1.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!T&&(V||!U),indent:G+J});let F=!1,_=!1,O=M1.stringify(q,Z,()=>F=!0,()=>_=!0);if(!T&&!Z.inFlow&&O.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");T=!0}if(Z.inFlow){if(U||$==null){if(F&&X)X();return O===""?"?":T?`? ${O}`:O}}else if(U&&!V||$==null&&T){if(O=`? ${O}`,W&&!F)O+=a0.lineComment(O,Z.indent,Y(W));else if(_&&Q)Q();return O}if(F)W=null;if(T){if(W)O+=a0.lineComment(O,Z.indent,Y(W));O=`? ${O}
36
+ ${G}:`}else if(O=`${O}:`,W)O+=a0.lineComment(O,Z.indent,Y(W));let R,M,A;if(e.isNode($))R=!!$.spaceBefore,M=$.commentBefore,A=$.comment;else if(R=!1,M=null,A=null,$&&typeof $==="object")$=z.createNode($);if(Z.implicitKey=!1,!T&&!W&&e.isScalar($))Z.indentAtStart=O.length+1;if(_=!1,!B&&J.length>=2&&!Z.inFlow&&!T&&e.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let w=!1,L=M1.stringify($,Z,()=>w=!0,()=>_=!0),I=" ";if(W||R||M){if(I=R?`
37
+ `:"",M){let P=Y(M);I+=`
38
38
  ${a0.indentComment(P,Z.indent)}`}if(L===""&&!Z.inFlow){if(I===`
39
- `&&M)I=`
39
+ `&&A)I=`
40
40
 
41
41
  `}else I+=`
42
42
  ${Z.indent}`}else if(!T&&e.isCollection($)){let P=L[0],K=L.indexOf(`
43
43
  `),j=K!==-1,C=Z.inFlow??$.flow??$.items.length===0;if(j||!C){let y=!1;if(j&&(P==="&"||P==="!")){let E=L.indexOf(" ");if(P==="&"&&E!==-1&&E<K&&L[E+1]==="!")E=L.indexOf(" ",E+1);if(E===-1||K<E)y=!0}if(!y)I=`
44
44
  ${Z.indent}`}}else if(L===""||L[0]===`
45
- `)I="";if(O+=I+L,Z.inFlow){if(w&&X)X()}else if(M&&!w)O+=a0.lineComment(O,Z.indent,Y(M));else if(_&&Q)Q();return O}LZ.stringifyPair=FZ});var D$=D((AZ)=>{var M1=k("process");function KZ(q,...$){if(q==="debug")console.log(...$)}function RZ(q,$){if(q==="debug"||q==="warn")if(typeof M1.emitWarning==="function")M1.emitWarning($);else console.warn($)}AZ.debug=KZ;AZ.warn=RZ});var Cq=D((PZ)=>{var n0=S(),D1=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 D1.Scalar(Symbol(Nq)),{addToJSMap:w1}),stringify:()=>Nq},wZ=(q,$)=>(jq.identify($)||n0.isScalar($)&&(!$.type||$.type===D1.Scalar.PLAIN)&&jq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===jq.tag&&Z.default);function w1(q,$,Z){if(Z=q&&n0.isAlias(Z)?Z.resolve(q.doc):Z,n0.isSeq(Z))for(let X of Z.items)w$(q,$,X);else if(Array.isArray(Z))for(let X of Z)w$(q,$,X);else w$(q,$,Z)}function w$(q,$,Z){let X=q&&n0.isAlias(Z)?Z.resolve(q.doc):Z;if(!n0.isMap(X))throw Error("Merge sources must be maps or map aliases");let Q=X.toJSON(null,q,Map);for(let[U,z]of Q)if($ instanceof Map){if(!$.has(U))$.set(U,z)}else if($ instanceof Set)$.add(U);else if(!Object.prototype.hasOwnProperty.call($,U))Object.defineProperty($,U,{value:z,writable:!0,enumerable:!0,configurable:!0});return $}PZ.addMergeToJSMap=w1;PZ.isMergeKey=wZ;PZ.merge=jq});var N$=D((yZ)=>{var bZ=D$(),P1=Cq(),SZ=i0(),N1=S(),P$=q0();function EZ(q,$,{key:Z,value:X}){if(N1.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,X);else if(P1.isMergeKey(q,Z))P1.addMergeToJSMap(q,$,X);else{let Q=P$.toJS(Z,"",q);if($ instanceof Map)$.set(Q,P$.toJS(X,Q,q));else if($ instanceof Set)$.add(Q);else{let U=fZ(Z,Q,q),z=P$.toJS(X,U,q);if(U in $)Object.defineProperty($,U,{value:z,writable:!0,enumerable:!0,configurable:!0});else $[U]=z}}return $}function fZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(N1.isNode(q)&&Z?.doc){let X=SZ.createStringifyContext(Z.doc,{});X.anchors=new Set;for(let U of Z.anchors.keys())X.anchors.add(U.anchor);X.inFlow=!0,X.inStringifyKey=!0;let Q=q.toString(X);if(!Z.mapKeyWarned){let U=JSON.stringify(Q);if(U.length>40)U=U.substring(0,36)+'..."';bZ.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return Q}return JSON.stringify($)}yZ.addPairToJSMap=EZ});var X0=D((vZ)=>{var j1=p0(),gZ=A1(),kZ=N$(),bq=S();function hZ(q,$,Z){let X=j1.createNode(q,void 0,Z),Q=j1.createNode($,void 0,Z);return new Sq(X,Q)}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 kZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?gZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}vZ.Pair=Sq;vZ.createPair=hZ});var j$=D((lZ)=>{var V0=S(),C1=i0(),Eq=d0();function pZ(q,$,Z){return($.inFlow??q.flow?cZ:dZ)(q,$,Z)}function dZ({comment:q,items:$},Z,{blockItemPrefix:X,flowChars:Q,itemIndent:U,onChompKeep:z,onComment:G}){let{indent:J,options:{commentString:Y}}=Z,B=Object.assign({},Z,{indent:U,type:null}),V=!1,W=[];for(let F=0;F<$.length;++F){let _=$[F],O=null;if(V0.isNode(_)){if(!V&&_.spaceBefore)W.push("");if(fq(Z,W,_.commentBefore,V),_.comment)O=_.comment}else if(V0.isPair(_)){let A=V0.isNode(_.key)?_.key:null;if(A){if(!V&&A.spaceBefore)W.push("");fq(Z,W,A.commentBefore,V)}}V=!1;let R=C1.stringify(_,B,()=>O=null,()=>V=!0);if(O)R+=Eq.lineComment(R,U,Y(O));if(V&&O)V=!1;W.push(X+R)}let T;if(W.length===0)T=Q.start+Q.end;else{T=W[0];for(let F=1;F<W.length;++F){let _=W[F];T+=_?`
45
+ `)I="";if(O+=I+L,Z.inFlow){if(w&&X)X()}else if(A&&!w)O+=a0.lineComment(O,Z.indent,Y(A));else if(_&&Q)Q();return O}IZ.stringifyPair=LZ});var D$=D((AZ)=>{var D1=h("process");function RZ(q,...$){if(q==="debug")console.log(...$)}function MZ(q,$){if(q==="debug"||q==="warn")if(typeof D1.emitWarning==="function")D1.emitWarning($);else console.warn($)}AZ.debug=RZ;AZ.warn=MZ});var Cq=D((NZ)=>{var n0=S(),w1=x(),Nq="<<",jq={identify:(q)=>q===Nq||typeof q==="symbol"&&q.description===Nq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new w1.Scalar(Symbol(Nq)),{addToJSMap:P1}),stringify:()=>Nq},PZ=(q,$)=>(jq.identify($)||n0.isScalar($)&&(!$.type||$.type===w1.Scalar.PLAIN)&&jq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===jq.tag&&Z.default);function P1(q,$,Z){if(Z=q&&n0.isAlias(Z)?Z.resolve(q.doc):Z,n0.isSeq(Z))for(let X of Z.items)w$(q,$,X);else if(Array.isArray(Z))for(let X of Z)w$(q,$,X);else w$(q,$,Z)}function w$(q,$,Z){let X=q&&n0.isAlias(Z)?Z.resolve(q.doc):Z;if(!n0.isMap(X))throw Error("Merge sources must be maps or map aliases");let Q=X.toJSON(null,q,Map);for(let[U,z]of Q)if($ instanceof Map){if(!$.has(U))$.set(U,z)}else if($ instanceof Set)$.add(U);else if(!Object.prototype.hasOwnProperty.call($,U))Object.defineProperty($,U,{value:z,writable:!0,enumerable:!0,configurable:!0});return $}NZ.addMergeToJSMap=P1;NZ.isMergeKey=PZ;NZ.merge=jq});var N$=D((xZ)=>{var SZ=D$(),N1=Cq(),EZ=i0(),j1=S(),P$=q0();function fZ(q,$,{key:Z,value:X}){if(j1.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,X);else if(N1.isMergeKey(q,Z))N1.addMergeToJSMap(q,$,X);else{let Q=P$.toJS(Z,"",q);if($ instanceof Map)$.set(Q,P$.toJS(X,Q,q));else if($ instanceof Set)$.add(Q);else{let U=yZ(Z,Q,q),z=P$.toJS(X,U,q);if(U in $)Object.defineProperty($,U,{value:z,writable:!0,enumerable:!0,configurable:!0});else $[U]=z}}return $}function yZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(j1.isNode(q)&&Z?.doc){let X=EZ.createStringifyContext(Z.doc,{});X.anchors=new Set;for(let U of Z.anchors.keys())X.anchors.add(U.anchor);X.inFlow=!0,X.inStringifyKey=!0;let Q=q.toString(X);if(!Z.mapKeyWarned){let U=JSON.stringify(Q);if(U.length>40)U=U.substring(0,36)+'..."';SZ.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return Q}return JSON.stringify($)}xZ.addPairToJSMap=fZ});var X0=D((uZ)=>{var C1=p0(),hZ=A1(),kZ=N$(),bq=S();function vZ(q,$,Z){let X=C1.createNode(q,void 0,Z),Q=C1.createNode($,void 0,Z);return new Sq(X,Q)}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 kZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?hZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}uZ.Pair=Sq;uZ.createPair=vZ});var j$=D((iZ)=>{var V0=S(),b1=i0(),Eq=d0();function dZ(q,$,Z){return($.inFlow??q.flow?lZ:cZ)(q,$,Z)}function cZ({comment:q,items:$},Z,{blockItemPrefix:X,flowChars:Q,itemIndent:U,onChompKeep:z,onComment:G}){let{indent:J,options:{commentString:Y}}=Z,B=Object.assign({},Z,{indent:U,type:null}),V=!1,W=[];for(let F=0;F<$.length;++F){let _=$[F],O=null;if(V0.isNode(_)){if(!V&&_.spaceBefore)W.push("");if(fq(Z,W,_.commentBefore,V),_.comment)O=_.comment}else if(V0.isPair(_)){let M=V0.isNode(_.key)?_.key:null;if(M){if(!V&&M.spaceBefore)W.push("");fq(Z,W,M.commentBefore,V)}}V=!1;let R=b1.stringify(_,B,()=>O=null,()=>V=!0);if(O)R+=Eq.lineComment(R,U,Y(O));if(V&&O)V=!1;W.push(X+R)}let T;if(W.length===0)T=Q.start+Q.end;else{T=W[0];for(let F=1;F<W.length;++F){let _=W[F];T+=_?`
46
46
  ${J}${_}`:`
47
47
  `}}if(q){if(T+=`
48
- `+Eq.indentComment(Y(q),J),G)G()}else if(V&&z)z();return T}function cZ({items:q},$,{flowChars:Z,itemIndent:X}){let{indent:Q,indentStep:U,flowCollectionPadding:z,options:{commentString:G}}=$;X+=U;let J=Object.assign({},$,{indent:X,inFlow:!0,type:null}),Y=!1,B=0,V=[];for(let F=0;F<q.length;++F){let _=q[F],O=null;if(V0.isNode(_)){if(_.spaceBefore)V.push("");if(fq($,V,_.commentBefore,!1),_.comment)O=_.comment}else if(V0.isPair(_)){let A=V0.isNode(_.key)?_.key:null;if(A){if(A.spaceBefore)V.push("");if(fq($,V,A.commentBefore,!1),A.comment)Y=!0}let M=V0.isNode(_.value)?_.value:null;if(M){if(M.comment)O=M.comment;if(M.commentBefore)Y=!0}else if(_.value==null&&A?.comment)O=A.comment}if(O)Y=!0;let R=C1.stringify(_,J,()=>O=null);if(F<q.length-1)R+=",";if(O)R+=Eq.lineComment(R,X,G(O));if(!Y&&(V.length>B||R.includes(`
48
+ `+Eq.indentComment(Y(q),J),G)G()}else if(V&&z)z();return T}function lZ({items:q},$,{flowChars:Z,itemIndent:X}){let{indent:Q,indentStep:U,flowCollectionPadding:z,options:{commentString:G}}=$;X+=U;let J=Object.assign({},$,{indent:X,inFlow:!0,type:null}),Y=!1,B=0,V=[];for(let F=0;F<q.length;++F){let _=q[F],O=null;if(V0.isNode(_)){if(_.spaceBefore)V.push("");if(fq($,V,_.commentBefore,!1),_.comment)O=_.comment}else if(V0.isPair(_)){let M=V0.isNode(_.key)?_.key:null;if(M){if(M.spaceBefore)V.push("");if(fq($,V,M.commentBefore,!1),M.comment)Y=!0}let A=V0.isNode(_.value)?_.value:null;if(A){if(A.comment)O=A.comment;if(A.commentBefore)Y=!0}else if(_.value==null&&M?.comment)O=M.comment}if(O)Y=!0;let R=b1.stringify(_,J,()=>O=null);if(F<q.length-1)R+=",";if(O)R+=Eq.lineComment(R,X,G(O));if(!Y&&(V.length>B||R.includes(`
49
49
  `)))Y=!0;V.push(R),B=V.length}let{start:W,end:T}=Z;if(V.length===0)return W+T;else{if(!Y){let F=V.reduce((_,O)=>_+O.length+2,2);Y=$.options.lineWidth>0&&F>$.options.lineWidth}if(Y){let F=W;for(let _ of V)F+=_?`
50
50
  ${U}${Q}${_}`:`
51
51
  `;return`${F}
52
- ${Q}${T}`}else return`${W}${z}${V.join(" ")}${z}${T}`}}function fq({indent:q,options:{commentString:$}},Z,X,Q){if(X&&Q)X=X.replace(/^\n+/,"");if(X){let U=Eq.indentComment($(X),q);Z.push(U.trimStart())}}lZ.stringifyCollection=pZ});var U0=D((rZ)=>{var aZ=j$(),nZ=N$(),sZ=Mq(),Q0=S(),yq=X0(),oZ=x();function s0(q,$){let Z=Q0.isScalar($)?$.value:$;for(let X of q)if(Q0.isPair(X)){if(X.key===$||X.key===Z)return X;if(Q0.isScalar(X.key)&&X.key.value===Z)return X}return}class b1 extends sZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(Q0.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:X,replacer:Q}=Z,U=new this(q),z=(G,J)=>{if(typeof Q==="function")J=Q.call($,G,J);else if(Array.isArray(Q)&&!Q.includes(G))return;if(J!==void 0||X)U.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")U.items.sort(q.sortMapEntries);return U}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 X=s0(this.items,Z.key),Q=this.schema?.sortMapEntries;if(X){if(!$)throw Error(`Key ${Z.key} already set`);if(Q0.isScalar(X.value)&&oZ.isScalarValue(Z.value))X.value.value=Z.value;else X.value=Z.value}else if(Q){let U=this.items.findIndex((z)=>Q(Z,z)<0);if(U===-1)this.items.push(Z);else this.items.splice(U,0,Z)}else this.items.push(Z)}delete(q){let $=s0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let X=s0(this.items,q)?.value;return(!$&&Q0.isScalar(X)?X.value:X)??void 0}has(q){return!!s0(this.items,q)}set(q,$){this.add(new yq.Pair(q,$),!0)}toJSON(q,$,Z){let X=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(X);for(let Q of this.items)nZ.addPairToJSMap($,X,Q);return X}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let X of this.items)if(!Q0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return aZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}rZ.YAMLMap=b1;rZ.findPair=s0});var w0=D((Z6)=>{var q6=S(),S1=U0(),$6={collection:"map",default:!0,nodeClass:S1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!q6.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>S1.YAMLMap.from(q,$,Z)};Z6.map=$6});var z0=D((Y6)=>{var Q6=p0(),U6=j$(),z6=Mq(),gq=S(),G6=x(),J6=q0();class E1 extends z6.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 X=this.items[Z];return!$&&gq.isScalar(X)?X.value:X}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 X=this.items[Z];if(gq.isScalar(X)&&G6.isScalarValue($))X.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let X=0;for(let Q of this.items)Z.push(J6.toJS(Q,String(X++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return U6.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($)){let U=0;for(let z of $){if(typeof X==="function"){let G=$ instanceof Set?z:String(U++);z=X.call($,G,z)}Q.items.push(Q6.createNode(z,void 0,Z))}}return Q}}function xq(q){let $=gq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}Y6.YAMLSeq=E1});var P0=D((B6)=>{var V6=S(),f1=z0(),W6={collection:"seq",default:!0,nodeClass:f1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!V6.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>f1.YAMLSeq.from(q,$,Z)};B6.seq=W6});var o0=D((F6)=>{var O6=l0(),T6={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,Z,X){return $=Object.assign({actualString:!0},$),O6.stringifyString(q,$,Z,X)}};F6.string=T6});var kq=D((I6)=>{var y1=x(),x1={identify:(q)=>q==null,createNode:()=>new y1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new y1.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&x1.test.test(q)?q:$.options.nullStr};I6.nullTag=x1});var C$=D((A6)=>{var R6=x(),g1={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new R6.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&g1.test.test(q)){let X=q[0]==="t"||q[0]==="T";if($===X)return q}return $?Z.options.trueStr:Z.options.falseStr}};A6.boolTag=g1});var N0=D((w6)=>{function D6({format:q,minFractionDigits:$,tag:Z,value:X}){if(typeof X==="bigint")return String(X);let Q=typeof X==="number"?X:Number(X);if(!isFinite(Q))return isNaN(Q)?".nan":Q<0?"-.inf":".inf";let U=Object.is(X,-0)?"-0":JSON.stringify(X);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(U)){let z=U.indexOf(".");if(z<0)z=U.length,U+=".";let G=$-(U.length-z-1);while(G-- >0)U+="0"}return U}w6.stringifyNumber=D6});var S$=D((S6)=>{var N6=x(),b$=N0(),j6={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},C6={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)}},b6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new N6.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:b$.stringifyNumber};S6.float=b6;S6.floatExp=C6;S6.floatNaN=j6});var f$=D((h6)=>{var k1=N0(),hq=(q)=>typeof q==="bigint"||Number.isInteger(q),E$=(q,$,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q.substring($),Z);function h1(q,$,Z){let{value:X}=q;if(hq(X)&&X>=0)return Z+X.toString($);return k1.stringifyNumber(q)}var x6={identify:(q)=>hq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>E$(q,2,8,Z),stringify:(q)=>h1(q,8,"0o")},g6={identify:hq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>E$(q,0,10,Z),stringify:k1.stringifyNumber},k6={identify:(q)=>hq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>E$(q,2,16,Z),stringify:(q)=>h1(q,16,"0x")};h6.int=g6;h6.intHex=k6;h6.intOct=x6});var v1=D((n6)=>{var p6=w0(),d6=kq(),c6=P0(),l6=o0(),i6=C$(),y$=S$(),x$=f$(),a6=[p6.map,c6.seq,l6.string,d6.nullTag,i6.boolTag,x$.intOct,x$.int,x$.intHex,y$.floatNaN,y$.floatExp,y$.float];n6.schema=a6});var m1=D((Z3)=>{var o6=x(),r6=w0(),t6=P0();function u1(q){return typeof q==="bigint"||Number.isInteger(q)}var vq=({value:q})=>JSON.stringify(q),e6=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:vq},{identify:(q)=>q==null,createNode:()=>new o6.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:u1,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})=>u1(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}],q3={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},$3=[r6.map,t6.seq].concat(e6,q3);Z3.schema=$3});var k$=D((z3)=>{var r0=k("buffer"),g$=x(),Q3=l0(),U3={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof r0.Buffer==="function")return r0.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),X=new Uint8Array(Z.length);for(let Q=0;Q<Z.length;++Q)X[Q]=Z.charCodeAt(Q);return X}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},X,Q,U){if(!Z)return"";let z=Z,G;if(typeof r0.Buffer==="function")G=z instanceof r0.Buffer?z.toString("base64"):r0.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Y=0;Y<z.length;++Y)J+=String.fromCharCode(z[Y]);G=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=g$.Scalar.BLOCK_LITERAL),$!==g$.Scalar.QUOTE_DOUBLE){let J=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),Y=Math.ceil(G.length/J),B=Array(Y);for(let V=0,W=0;V<Y;++V,W+=J)B[V]=G.substr(W,J);G=B.join($===g$.Scalar.BLOCK_LITERAL?`
53
- `:" ")}return Q3.stringifyString({comment:q,type:$,value:G},X,Q,U)}};z3.binary=U3});var mq=D((V3)=>{var uq=S(),h$=X0(),J3=x(),Y3=z0();function p1(q,$){if(uq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let X=q.items[Z];if(uq.isPair(X))continue;else if(uq.isMap(X)){if(X.items.length>1)$("Each pair must have its own sequence indicator");let Q=X.items[0]||new h$.Pair(new J3.Scalar(null));if(X.commentBefore)Q.key.commentBefore=Q.key.commentBefore?`${X.commentBefore}
52
+ ${Q}${T}`}else return`${W}${z}${V.join(" ")}${z}${T}`}}function fq({indent:q,options:{commentString:$}},Z,X,Q){if(X&&Q)X=X.replace(/^\n+/,"");if(X){let U=Eq.indentComment($(X),q);Z.push(U.trimStart())}}iZ.stringifyCollection=dZ});var U0=D((tZ)=>{var nZ=j$(),sZ=N$(),oZ=Aq(),Q0=S(),yq=X0(),rZ=x();function s0(q,$){let Z=Q0.isScalar($)?$.value:$;for(let X of q)if(Q0.isPair(X)){if(X.key===$||X.key===Z)return X;if(Q0.isScalar(X.key)&&X.key.value===Z)return X}return}class S1 extends oZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(Q0.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:X,replacer:Q}=Z,U=new this(q),z=(G,J)=>{if(typeof Q==="function")J=Q.call($,G,J);else if(Array.isArray(Q)&&!Q.includes(G))return;if(J!==void 0||X)U.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")U.items.sort(q.sortMapEntries);return U}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 X=s0(this.items,Z.key),Q=this.schema?.sortMapEntries;if(X){if(!$)throw Error(`Key ${Z.key} already set`);if(Q0.isScalar(X.value)&&rZ.isScalarValue(Z.value))X.value.value=Z.value;else X.value=Z.value}else if(Q){let U=this.items.findIndex((z)=>Q(Z,z)<0);if(U===-1)this.items.push(Z);else this.items.splice(U,0,Z)}else this.items.push(Z)}delete(q){let $=s0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let X=s0(this.items,q)?.value;return(!$&&Q0.isScalar(X)?X.value:X)??void 0}has(q){return!!s0(this.items,q)}set(q,$){this.add(new yq.Pair(q,$),!0)}toJSON(q,$,Z){let X=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(X);for(let Q of this.items)sZ.addPairToJSMap($,X,Q);return X}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let X of this.items)if(!Q0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return nZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}tZ.YAMLMap=S1;tZ.findPair=s0});var w0=D((X6)=>{var $6=S(),E1=U0(),Z6={collection:"map",default:!0,nodeClass:E1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!$6.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>E1.YAMLMap.from(q,$,Z)};X6.map=Z6});var z0=D((H6)=>{var U6=p0(),z6=j$(),G6=Aq(),gq=S(),J6=x(),Y6=q0();class f1 extends G6.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(gq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=xq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=xq(q);if(typeof Z!=="number")return;let X=this.items[Z];return!$&&gq.isScalar(X)?X.value:X}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 X=this.items[Z];if(gq.isScalar(X)&&J6.isScalarValue($))X.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let X=0;for(let Q of this.items)Z.push(Y6.toJS(Q,String(X++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return z6.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($)){let U=0;for(let z of $){if(typeof X==="function"){let G=$ instanceof Set?z:String(U++);z=X.call($,G,z)}Q.items.push(U6.createNode(z,void 0,Z))}}return Q}}function xq(q){let $=gq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}H6.YAMLSeq=f1});var P0=D((_6)=>{var W6=S(),y1=z0(),B6={collection:"seq",default:!0,nodeClass:y1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!W6.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>y1.YAMLSeq.from(q,$,Z)};_6.seq=B6});var o0=D((L6)=>{var T6=l0(),F6={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,Z,X){return $=Object.assign({actualString:!0},$),T6.stringifyString(q,$,Z,X)}};L6.string=F6});var hq=D((K6)=>{var x1=x(),g1={identify:(q)=>q==null,createNode:()=>new x1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new x1.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&g1.test.test(q)?q:$.options.nullStr};K6.nullTag=g1});var C$=D((A6)=>{var M6=x(),h1={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new M6.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&h1.test.test(q)){let X=q[0]==="t"||q[0]==="T";if($===X)return q}return $?Z.options.trueStr:Z.options.falseStr}};A6.boolTag=h1});var N0=D((P6)=>{function w6({format:q,minFractionDigits:$,tag:Z,value:X}){if(typeof X==="bigint")return String(X);let Q=typeof X==="number"?X:Number(X);if(!isFinite(Q))return isNaN(Q)?".nan":Q<0?"-.inf":".inf";let U=Object.is(X,-0)?"-0":JSON.stringify(X);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(U)){let z=U.indexOf(".");if(z<0)z=U.length,U+=".";let G=$-(U.length-z-1);while(G-- >0)U+="0"}return U}P6.stringifyNumber=w6});var S$=D((E6)=>{var j6=x(),b$=N0(),C6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:b$.stringifyNumber},b6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():b$.stringifyNumber(q)}},S6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new j6.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:b$.stringifyNumber};E6.float=S6;E6.floatExp=b6;E6.floatNaN=C6});var f$=D((v6)=>{var k1=N0(),kq=(q)=>typeof q==="bigint"||Number.isInteger(q),E$=(q,$,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q.substring($),Z);function v1(q,$,Z){let{value:X}=q;if(kq(X)&&X>=0)return Z+X.toString($);return k1.stringifyNumber(q)}var g6={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)=>v1(q,8,"0o")},h6={identify:kq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>E$(q,0,10,Z),stringify:k1.stringifyNumber},k6={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)=>v1(q,16,"0x")};v6.int=h6;v6.intHex=k6;v6.intOct=g6});var u1=D((s6)=>{var d6=w0(),c6=hq(),l6=P0(),i6=o0(),a6=C$(),y$=S$(),x$=f$(),n6=[d6.map,l6.seq,i6.string,c6.nullTag,a6.boolTag,x$.intOct,x$.int,x$.intHex,y$.floatNaN,y$.floatExp,y$.float];s6.schema=n6});var p1=D((X3)=>{var r6=x(),t6=w0(),e6=P0();function m1(q){return typeof q==="bigint"||Number.isInteger(q)}var vq=({value:q})=>JSON.stringify(q),q3=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:vq},{identify:(q)=>q==null,createNode:()=>new r6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:vq},{identify:m1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:Z})=>Z?BigInt(q):parseInt(q,10),stringify:({value:q})=>m1(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:vq}],$3={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},Z3=[t6.map,e6.seq].concat(q3,$3);X3.schema=Z3});var h$=D((G3)=>{var r0=h("buffer"),g$=x(),U3=l0(),z3={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof r0.Buffer==="function")return r0.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),X=new Uint8Array(Z.length);for(let Q=0;Q<Z.length;++Q)X[Q]=Z.charCodeAt(Q);return X}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},X,Q,U){if(!Z)return"";let z=Z,G;if(typeof r0.Buffer==="function")G=z instanceof r0.Buffer?z.toString("base64"):r0.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Y=0;Y<z.length;++Y)J+=String.fromCharCode(z[Y]);G=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=g$.Scalar.BLOCK_LITERAL),$!==g$.Scalar.QUOTE_DOUBLE){let J=Math.max(X.options.lineWidth-X.indent.length,X.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 U3.stringifyString({comment:q,type:$,value:G},X,Q,U)}};G3.binary=z3});var mq=D((W3)=>{var uq=S(),k$=X0(),Y3=x(),H3=z0();function d1(q,$){if(uq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let X=q.items[Z];if(uq.isPair(X))continue;else if(uq.isMap(X)){if(X.items.length>1)$("Each pair must have its own sequence indicator");let Q=X.items[0]||new k$.Pair(new Y3.Scalar(null));if(X.commentBefore)Q.key.commentBefore=Q.key.commentBefore?`${X.commentBefore}
54
54
  ${Q.key.commentBefore}`:X.commentBefore;if(X.comment){let U=Q.value??Q.key;U.comment=U.comment?`${X.comment}
55
- ${U.comment}`:X.comment}X=Q}q.items[Z]=uq.isPair(X)?X:new h$.Pair(X)}else $("Expected a sequence for this tag");return q}function d1(q,$,Z){let{replacer:X}=Z,Q=new Y3.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(h$.createPair(G,J,Z))}return Q}var H3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:p1,createNode:d1};V3.createPairs=d1;V3.pairs=H3;V3.resolvePairs=p1});var u$=D((F3)=>{var c1=S(),v$=q0(),t0=U0(),O3=z0(),l1=mq();class W0 extends O3.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(c1.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=l1.createPairs(q,$,Z),Q=new this;return Q.items=X.items,Q}}W0.tag="tag:yaml.org,2002:omap";var T3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:W0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=l1.resolvePairs(q,$),X=[];for(let{key:Q}of Z.items)if(c1.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)};F3.YAMLOMap=W0;F3.omap=T3});var o1=D((K3)=>{var i1=x();function a1({value:q,source:$},Z){if($&&(q?n1:s1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var n1={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 i1.Scalar(!0),stringify:a1},s1={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 i1.Scalar(!1),stringify:a1};K3.falseTag=s1;K3.trueTag=n1});var r1=D((N3)=>{var M3=x(),m$=N0(),D3={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},w3={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)}},P3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new M3.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};N3.float=P3;N3.floatExp=w3;N3.floatNaN=D3});var e1=D((x3)=>{var t1=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 t1.stringifyNumber(q)}var S3={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")},E3={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")},f3={identify:e0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>pq(q,0,10,Z),stringify:t1.stringifyNumber},y3={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")};x3.int=f3;x3.intBin=S3;x3.intHex=y3;x3.intOct=E3});var d$=D((m3)=>{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 u3={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}};m3.YAMLSet=B0;m3.set=u3});var l$=D((a3)=>{var c3=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 q9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return c3.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 l3={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:q9},i3={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:q9},$9={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($9.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$/,"")??""};a3.floatTime=i3;a3.intTime=l3;a3.timestamp=$9});var X9=D((G7)=>{var r3=w0(),t3=kq(),e3=P0(),q7=o0(),$7=k$(),Z9=o1(),i$=r1(),iq=e1(),Z7=Cq(),X7=u$(),Q7=mq(),U7=d$(),a$=l$(),z7=[r3.map,e3.seq,q7.string,t3.nullTag,Z9.trueTag,Z9.falseTag,iq.intBin,iq.intOct,iq.int,iq.intHex,i$.floatNaN,i$.floatExp,i$.float,$7.binary,Z7.merge,X7.omap,Q7.pairs,U7.set,a$.intTime,a$.floatTime,a$.timestamp];G7.schema=z7});var B9=D((T7)=>{var G9=w0(),Y7=kq(),J9=P0(),H7=o0(),V7=C$(),n$=S$(),s$=f$(),W7=v1(),B7=m1(),Y9=k$(),qq=Cq(),H9=u$(),V9=mq(),Q9=X9(),W9=d$(),aq=l$(),U9=new Map([["core",W7.schema],["failsafe",[G9.map,J9.seq,H7.string]],["json",B7.schema],["yaml11",Q9.schema],["yaml-1.1",Q9.schema]]),z9={binary:Y9.binary,bool:V7.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:G9.map,merge:qq.merge,null:Y7.nullTag,omap:H9.omap,pairs:V9.pairs,seq:J9.seq,set:W9.set,timestamp:aq.timestamp},_7={"tag:yaml.org,2002:binary":Y9.binary,"tag:yaml.org,2002:merge":qq.merge,"tag:yaml.org,2002:omap":H9.omap,"tag:yaml.org,2002:pairs":V9.pairs,"tag:yaml.org,2002:set":W9.set,"tag:yaml.org,2002:timestamp":aq.timestamp};function O7(q,$,Z){let X=U9.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(U9.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"?z9[z]:z;if(!G){let J=JSON.stringify(z),Y=Object.keys(z9).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},[])}T7.coreKnownTags=_7;T7.getTags=O7});var t$=D((M7)=>{var o$=S(),I7=w0(),K7=P0(),R7=o0(),nq=B9(),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:I7.map}),Object.defineProperty(this,o$.SCALAR,{value:R7.string}),Object.defineProperty(this,o$.SEQ,{value:K7.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}}M7.Schema=r$});var _9=D((N7)=>{var w7=S(),e$=i0(),$q=d0();function P7(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(w7.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(`
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
56
  `))Z.push("..."),Z.push($q.indentComment(J,""));else Z.push(`... ${J}`)}else Z.push("...");else{let J=q.comment;if(J&&z)J=J.replace(/^\n+/,"");if(J){if((!z||G)&&Z[Z.length-1]!=="")Z.push("");Z.push($q.indentComment(U(J),""))}}return Z.join(`
57
57
  `)+`
58
- `}N7.stringifyDocument=P7});var Zq=D((g7)=>{var C7=m0(),j0=Mq(),p=S(),b7=X0(),S7=q0(),E7=t$(),f7=_9(),q2=Kq(),y7=I$(),x7=p0(),$2=L$();class Z2{constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,p.NODE_TYPE,{value:p.DOC});let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$,$=void 0;let Q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=Q;let{version:U}=Q;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new $2.Directives({version:U});this.setSchema(U,Z),this.contents=q===void 0?null:this.createNode(q,X,Z)}clone(){let q=Object.create(Z2.prototype,{[p.NODE_TYPE]:{value:p.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=p.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(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 C7.Alias(q.anchor)}createNode(q,$,Z){let X=void 0;if(typeof $==="function")q=$.call({"":q},"",q),X=$;else if(Array.isArray($)){let _=(R)=>typeof R==="number"||R instanceof String||R instanceof Number,O=$.filter(_).map(String);if(O.length>0)$=$.concat(O);X=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:Q,anchorPrefix:U,flow:z,keepUndefined:G,onTagObj:J,tag:Y}=Z??{},{onAnchor:B,setAnchors:V,sourceObjects:W}=q2.createNodeAnchors(this,U||"a"),T={aliasDuplicateObjects:Q??!0,keepUndefined:G??!1,onAnchor:B,onTagObj:J,replacer:X,schema:this.schema,sourceObjects:W},F=x7.createNode(q,Y,T);if(z&&p.isCollection(F))F.flow=!0;return V(),F}createPair(q,$,Z={}){let X=this.createNode(q,null,Z),Q=this.createNode($,null,Z);return new b7.Pair(X,Q)}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 p.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(j0.isEmptyPath(q))return!$&&p.isScalar(this.contents)?this.contents.value:this.contents;return p.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return p.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(j0.isEmptyPath(q))return this.contents!==void 0;return p.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=j0.collectionFromPath(this.schema,[q],$);else if(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 X=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new E7.Schema(Object.assign(Z,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:Z,maxAliasCount:X,onAnchor:Q,reviver:U}={}){let z={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},G=S7.toJS(this.contents,$??"",z);if(typeof Q==="function")for(let{count:J,res:Y}of z.anchors.values())Q(Y,J);return typeof U==="function"?y7.applyReviver(U,{"":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 f7.stringifyDocument(this,q)}}function C0(q){if(p.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}g7.Document=Z2});var Xq=D((v7)=>{class sq extends Error{constructor(q,$,Z,X){super();this.name=q,this.code=Z,this.message=X,this.pos=$}}class O9 extends sq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class T9 extends sq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var h7=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((G)=>$.linePos(G));let{line:X,col:Q}=Z.linePos[0];Z.message+=` at line ${X}, column ${Q}`;let U=Q-1,z=q.substring($.lineStarts[X-1],$.lineStarts[X]).replace(/[\n\r]+$/,"");if(U>=60&&z.length>80){let G=Math.min(U-39,z.length-79);z="…"+z.substring(G),U-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(X>1&&/^ *$/.test(z.substring(0,U))){let G=q.substring($.lineStarts[X-2],$.lineStarts[X-1]);if(G.length>80)G=G.substring(0,79)+`…
58
+ `}j7.stringifyDocument=N7});var Zq=D((h7)=>{var b7=m0(),j0=Aq(),p=S(),S7=X0(),E7=q0(),f7=t$(),y7=O9(),q2=Kq(),x7=I$(),g7=p0(),$2=L$();class Z2{constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,p.NODE_TYPE,{value:p.DOC});let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$,$=void 0;let Q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=Q;let{version:U}=Q;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new $2.Directives({version:U});this.setSchema(U,Z),this.contents=q===void 0?null:this.createNode(q,X,Z)}clone(){let q=Object.create(Z2.prototype,{[p.NODE_TYPE]:{value:p.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=p.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(C0(this.contents))this.contents.add(q)}addIn(q,$){if(C0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=q2.anchorNames(this);q.anchor=!$||Z.has($)?q2.findNewAnchor($||"a",Z):$}return new b7.Alias(q.anchor)}createNode(q,$,Z){let X=void 0;if(typeof $==="function")q=$.call({"":q},"",q),X=$;else if(Array.isArray($)){let _=(R)=>typeof R==="number"||R instanceof String||R instanceof Number,O=$.filter(_).map(String);if(O.length>0)$=$.concat(O);X=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:Q,anchorPrefix:U,flow:z,keepUndefined:G,onTagObj:J,tag:Y}=Z??{},{onAnchor:B,setAnchors:V,sourceObjects:W}=q2.createNodeAnchors(this,U||"a"),T={aliasDuplicateObjects:Q??!0,keepUndefined:G??!1,onAnchor:B,onTagObj:J,replacer:X,schema:this.schema,sourceObjects:W},F=g7.createNode(q,Y,T);if(z&&p.isCollection(F))F.flow=!0;return V(),F}createPair(q,$,Z={}){let X=this.createNode(q,null,Z),Q=this.createNode($,null,Z);return new S7.Pair(X,Q)}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 p.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(j0.isEmptyPath(q))return!$&&p.isScalar(this.contents)?this.contents.value:this.contents;return p.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return p.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(j0.isEmptyPath(q))return this.contents!==void 0;return p.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=j0.collectionFromPath(this.schema,[q],$);else if(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 X=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new f7.Schema(Object.assign(Z,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:Z,maxAliasCount:X,onAnchor:Q,reviver:U}={}){let z={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},G=E7.toJS(this.contents,$??"",z);if(typeof Q==="function")for(let{count:J,res:Y}of z.anchors.values())Q(Y,J);return typeof U==="function"?x7.applyReviver(U,{"":G},"",G):G}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return y7.stringifyDocument(this,q)}}function C0(q){if(p.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}h7.Document=Z2});var Xq=D((u7)=>{class sq extends Error{constructor(q,$,Z,X){super();this.name=q,this.code=Z,this.message=X,this.pos=$}}class T9 extends sq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class F9 extends sq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var v7=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((G)=>$.linePos(G));let{line:X,col:Q}=Z.linePos[0];Z.message+=` at line ${X}, column ${Q}`;let U=Q-1,z=q.substring($.lineStarts[X-1],$.lineStarts[X]).replace(/[\n\r]+$/,"");if(U>=60&&z.length>80){let G=Math.min(U-39,z.length-79);z="…"+z.substring(G),U-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(X>1&&/^ *$/.test(z.substring(0,U))){let G=q.substring($.lineStarts[X-2],$.lineStarts[X-1]);if(G.length>80)G=G.substring(0,79)+`…
59
59
  `;z=G+z}if(/[^ ]/.test(z)){let G=1,J=Z.linePos[1];if(J?.line===X&&J.col>Q)G=Math.max(1,Math.min(J.col-Q,80-U));let Y=" ".repeat(U)+"^".repeat(G);Z.message+=`:
60
60
 
61
61
  ${z}
62
62
  ${Y}
63
- `}};v7.YAMLError=sq;v7.YAMLParseError=O9;v7.YAMLWarning=T9;v7.prettifyError=h7});var Qq=D((l7)=>{function c7(q,{flow:$,indicator:Z,next:X,offset:Q,onError:U,parentIndent:z,startOnNewline:G}){let J=!1,Y=G,B=G,V="",W="",T=!1,F=!1,_=null,O=null,R=null,A=null,M=null,w=null,L=null;for(let K of q){if(F){if(K.type!=="space"&&K.type!=="newline"&&K.type!=="comma")U(K.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");F=!1}if(_){if(Y&&K.type!=="comment"&&K.type!=="newline")U(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");_=null}switch(K.type){case"space":if(!$&&(Z!=="doc-start"||X?.type!=="flow-collection")&&K.source.includes("\t"))_=K;B=!0;break;case"comment":{if(!B)U(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let j=K.source.substring(1)||" ";if(!V)V=j;else V+=W+j;W="",Y=!1;break}case"newline":if(Y){if(V)V+=K.source;else if(!w||Z!=="seq-item-ind")J=!0}else W+=K.source;if(Y=!0,T=!0,O||R)A=K;B=!0;break;case"anchor":if(O)U(K,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(K.source.endsWith(":"))U(K.offset+K.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);O=K,L??(L=K.offset),Y=!1,B=!1,F=!0;break;case"tag":{if(R)U(K,"MULTIPLE_TAGS","A node can have at most one tag");R=K,L??(L=K.offset),Y=!1,B=!1,F=!0;break}case Z:if(O||R)U(K,"BAD_PROP_ORDER",`Anchors and tags must be after the ${K.source} indicator`);if(w)U(K,"UNEXPECTED_TOKEN",`Unexpected ${K.source} in ${$??"collection"}`);w=K,Y=Z==="seq-item-ind"||Z==="explicit-key-ind",B=!1;break;case"comma":if($){if(M)U(K,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);M=K,Y=!1,B=!1;break}default:U(K,"UNEXPECTED_TOKEN",`Unexpected ${K.type} token`),Y=!1,B=!1}}let I=q[q.length-1],P=I?I.offset+I.source.length:Q;if(F&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))U(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(_&&(Y&&_.indent<=z||X?.type==="block-map"||X?.type==="block-seq"))U(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:M,found:w,spaceBefore:J,comment:V,hasNewline:T,anchor:O,tag:R,newlineAfterProp:A,end:P,start:L??P}}l7.resolveProps=c7});var oq=D((a7)=>{function X2(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(X2($.key)||X2($.value))return!0}return!1;default:return!0}}a7.containsNewline=X2});var Q2=D((r7)=>{var s7=oq();function o7(q,$,Z){if($?.type==="flow-collection"){let X=$.end[0];if(X.indent===q&&(X.source==="]"||X.source==="}")&&s7.containsNewline($))Z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}r7.flowIndentCheck=o7});var U2=D((qX)=>{var F9=S();function e7(q,$,Z){let{uniqueKeys:X}=q.options;if(X===!1)return!1;let Q=typeof X==="function"?X:(U,z)=>U===z||F9.isScalar(U)&&F9.isScalar(z)&&U.value===z.value;return $.some((U)=>Q(U.key,Z))}qX.mapIncludes=e7});var A9=D((zX)=>{var L9=X0(),ZX=U0(),I9=Qq(),XX=oq(),K9=Q2(),QX=U2(),R9="All mapping items must start at the same column";function UX({composeNode:q,composeEmptyNode:$},Z,X,Q,U){let G=new(U?.nodeClass??ZX.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let J=X.offset,Y=null;for(let B of X.items){let{start:V,key:W,sep:T,value:F}=B,_=I9.resolveProps(V,{indicator:"explicit-key-ind",next:W??T?.[0],offset:J,onError:Q,parentIndent:X.indent,startOnNewline:!0}),O=!_.found;if(O){if(W){if(W.type==="block-seq")Q(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==X.indent)Q(J,"BAD_INDENT",R9)}if(!_.anchor&&!_.tag&&!T){if(Y=_.end,_.comment)if(G.comment)G.comment+=`
65
- `+_.comment;else G.comment=_.comment;continue}if(_.newlineAfterProp||XX.containsNewline(W))Q(W??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(_.found?.indent!==X.indent)Q(J,"BAD_INDENT",R9);Z.atKey=!0;let R=_.end,A=W?q(Z,W,_,Q):$(Z,R,V,null,_,Q);if(Z.schema.compat)K9.flowIndentCheck(X.indent,W,Q);if(Z.atKey=!1,QX.mapIncludes(Z,G.items,A))Q(R,"DUPLICATE_KEY","Map keys must be unique");let M=I9.resolveProps(T??[],{indicator:"map-value-ind",next:F,offset:A.range[2],onError:Q,parentIndent:X.indent,startOnNewline:!W||W.type==="block-scalar"});if(J=M.end,M.found){if(O){if(F?.type==="block-map"&&!M.hasNewline)Q(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&_.start<M.found.offset-1024)Q(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=F?q(Z,F,M,Q):$(Z,J,T,null,M,Q);if(Z.schema.compat)K9.flowIndentCheck(X.indent,F,Q);J=w.range[2];let L=new L9.Pair(A,w);if(Z.options.keepSourceTokens)L.srcToken=B;G.items.push(L)}else{if(O)Q(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(M.comment)if(A.comment)A.comment+=`
66
- `+M.comment;else A.comment=M.comment;let w=new L9.Pair(A);if(Z.options.keepSourceTokens)w.srcToken=B;G.items.push(w)}}if(Y&&Y<J)Q(Y,"IMPOSSIBLE","Map comment with trailing content");return G.range=[X.offset,J,Y??J],G}zX.resolveBlockMap=UX});var M9=D((WX)=>{var JX=z0(),YX=Qq(),HX=Q2();function VX({composeNode:q,composeEmptyNode:$},Z,X,Q,U){let G=new(U?.nodeClass??JX.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let J=X.offset,Y=null;for(let{start:B,value:V}of X.items){let W=YX.resolveProps(B,{indicator:"seq-item-ind",next:V,offset:J,onError:Q,parentIndent:X.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||V)if(V?.type==="block-seq")Q(W.end,"BAD_INDENT","All sequence items must start at the same column");else Q(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=W.end,W.comment)G.comment=W.comment;continue}let T=V?q(Z,V,W,Q):$(Z,W.end,B,null,W,Q);if(Z.schema.compat)HX.flowIndentCheck(X.indent,V,Q);J=T.range[2],G.items.push(T)}return G.range=[X.offset,J,Y??J],G}WX.resolveBlockSeq=VX});var b0=D((OX)=>{function _X(q,$,Z,X){let Q="";if(q){let U=!1,z="";for(let G of q){let{source:J,type:Y}=G;switch(Y){case"space":U=!0;break;case"comment":{if(Z&&!U)X(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=J.substring(1)||" ";if(!Q)Q=B;else Q+=z+B;z="";break}case"newline":if(Q)z+=J;U=!0;break;default:X(G,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}$+=J.length}}return{comment:Q,offset:$}}OX.resolveEnd=_X});var P9=D((DX)=>{var FX=S(),LX=X0(),D9=U0(),IX=z0(),KX=b0(),w9=Qq(),RX=oq(),AX=U2(),z2="Block collections are not allowed within flow collections",G2=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function MX({composeNode:q,composeEmptyNode:$},Z,X,Q,U){let z=X.start.source==="{",G=z?"flow map":"flow sequence",Y=new(U?.nodeClass??(z?D9.YAMLMap:IX.YAMLSeq))(Z.schema);Y.flow=!0;let B=Z.atRoot;if(B)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let V=X.offset+X.start.source.length;for(let O=0;O<X.items.length;++O){let R=X.items[O],{start:A,key:M,sep:w,value:L}=R,I=w9.resolveProps(A,{flow:G,indicator:"explicit-key-ind",next:M??w?.[0],offset:V,onError:Q,parentIndent:X.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!w&&!L){if(O===0&&I.comma)Q(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(O<X.items.length-1)Q(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(I.comment)if(Y.comment)Y.comment+=`
67
- `+I.comment;else Y.comment=I.comment;V=I.end;continue}if(!z&&Z.options.strict&&RX.containsNewline(M))Q(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(O===0){if(I.comma)Q(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!I.comma)Q(I.start,"MISSING_CHAR",`Missing , between ${G} items`);if(I.comment){let P="";q:for(let K of A)switch(K.type){case"comma":case"space":break;case"comment":P=K.source.substring(1);break q;default:break q}if(P){let K=Y.items[Y.items.length-1];if(FX.isPair(K))K=K.value??K.key;if(K.comment)K.comment+=`
68
- `+P;else K.comment=P;I.comment=I.comment.substring(P.length+1)}}}if(!z&&!w&&!I.found){let P=L?q(Z,L,I,Q):$(Z,I.end,w,null,I,Q);if(Y.items.push(P),V=P.range[2],G2(L))Q(P.range,"BLOCK_IN_FLOW",z2)}else{Z.atKey=!0;let P=I.end,K=M?q(Z,M,I,Q):$(Z,P,A,null,I,Q);if(G2(M))Q(K.range,"BLOCK_IN_FLOW",z2);Z.atKey=!1;let j=w9.resolveProps(w??[],{flow:G,indicator:"map-value-ind",next:L,offset:K.range[2],onError:Q,parentIndent:X.indent,startOnNewline:!1});if(j.found){if(!z&&!I.found&&Z.options.strict){if(w)for(let E of w){if(E===j.found)break;if(E.type==="newline"){Q(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(I.start<j.found.offset-1024)Q(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(L)if("source"in L&&L.source?.[0]===":")Q(L,"MISSING_CHAR",`Missing space after : in ${G}`);else Q(j.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let C=L?q(Z,L,j,Q):j.found?$(Z,j.end,w,null,j,Q):null;if(C){if(G2(L))Q(C.range,"BLOCK_IN_FLOW",z2)}else if(j.comment)if(K.comment)K.comment+=`
69
- `+j.comment;else K.comment=j.comment;let y=new LX.Pair(K,C);if(Z.options.keepSourceTokens)y.srcToken=R;if(z){let E=Y;if(AX.mapIncludes(Z,E.items,K))Q(P,"DUPLICATE_KEY","Map keys must be unique");E.items.push(y)}else{let E=new D9.YAMLMap(Z.schema);E.flow=!0,E.items.push(y);let o=(C??K).range;E.range=[K.range[0],o[1],o[2]],Y.items.push(E)}V=C?C.range[2]:j.end}}let W=z?"}":"]",[T,...F]=X.end,_=V;if(T?.source===W)_=T.offset+T.source.length;else{let O=G[0].toUpperCase()+G.substring(1),R=B?`${O} must end with a ${W}`:`${O} in block collection must be sufficiently indented and end with a ${W}`;if(Q(V,B?"MISSING_CHAR":"BAD_INDENT",R),T&&T.source.length!==1)F.unshift(T)}if(F.length>0){let O=KX.resolveEnd(F,_,Z.options.strict,Q);if(O.comment)if(Y.comment)Y.comment+=`
70
- `+O.comment;else Y.comment=O.comment;Y.range=[X.offset,_,O.offset]}else Y.range=[X.offset,_,_];return Y}DX.resolveFlowCollection=MX});var N9=D((yX)=>{var PX=S(),NX=x(),jX=U0(),CX=z0(),bX=A9(),SX=M9(),EX=P9();function J2(q,$,Z,X,Q,U){let z=Z.type==="block-map"?bX.resolveBlockMap(q,$,Z,X,U):Z.type==="block-seq"?SX.resolveBlockSeq(q,$,Z,X,U):EX.resolveFlowCollection(q,$,Z,X,U),G=z.constructor;if(Q==="!"||Q===G.tagName)return z.tag=G.tagName,z;if(Q)z.tag=Q;return z}function fX(q,$,Z,X,Q){let U=X.tag,z=!U?null:$.directives.tagName(U.source,(W)=>Q(U,"TAG_RESOLVE_FAILED",W));if(Z.type==="block-seq"){let{anchor:W,newlineAfterProp:T}=X,F=W&&U?W.offset>U.offset?W:U:W??U;if(F&&(!T||T.offset<F.offset))Q(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(!U||!z||z==="!"||z===jX.YAMLMap.tagName&&G==="map"||z===CX.YAMLSeq.tagName&&G==="seq")return J2(q,$,Z,Q,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)Q(U,"BAD_COLLECTION_TYPE",`${W.tag} used for ${G} collection, but expects ${W.collection??"scalar"}`,!0);else Q(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return J2(q,$,Z,Q,z)}}let Y=J2(q,$,Z,Q,z,J),B=J.resolve?.(Y,(W)=>Q(U,"TAG_RESOLVE_FAILED",W),$.options)??Y,V=PX.isNode(B)?B:new NX.Scalar(B);if(V.range=Y.range,V.tag=z,J?.format)V.format=J.format;return V}yX.composeCollection=fX});var H2=D((vX)=>{var Y2=x();function gX(q,$,Z){let X=$.offset,Q=kX($,q.options.strict,Z);if(!Q)return{value:"",type:null,comment:"",range:[X,X,X]};let U=Q.mode===">"?Y2.Scalar.BLOCK_FOLDED:Y2.Scalar.BLOCK_LITERAL,z=$.source?hX($.source):[],G=z.length;for(let _=z.length-1;_>=0;--_){let O=z[_][1];if(O===""||O==="\r")G=_;else break}if(G===0){let _=Q.chomp==="+"&&z.length>0?`
63
+ `}};u7.YAMLError=sq;u7.YAMLParseError=T9;u7.YAMLWarning=F9;u7.prettifyError=v7});var Qq=D((i7)=>{function l7(q,{flow:$,indicator:Z,next:X,offset:Q,onError:U,parentIndent:z,startOnNewline:G}){let J=!1,Y=G,B=G,V="",W="",T=!1,F=!1,_=null,O=null,R=null,M=null,A=null,w=null,L=null;for(let K of q){if(F){if(K.type!=="space"&&K.type!=="newline"&&K.type!=="comma")U(K.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");F=!1}if(_){if(Y&&K.type!=="comment"&&K.type!=="newline")U(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");_=null}switch(K.type){case"space":if(!$&&(Z!=="doc-start"||X?.type!=="flow-collection")&&K.source.includes("\t"))_=K;B=!0;break;case"comment":{if(!B)U(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let j=K.source.substring(1)||" ";if(!V)V=j;else V+=W+j;W="",Y=!1;break}case"newline":if(Y){if(V)V+=K.source;else if(!w||Z!=="seq-item-ind")J=!0}else W+=K.source;if(Y=!0,T=!0,O||R)M=K;B=!0;break;case"anchor":if(O)U(K,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(K.source.endsWith(":"))U(K.offset+K.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);O=K,L??(L=K.offset),Y=!1,B=!1,F=!0;break;case"tag":{if(R)U(K,"MULTIPLE_TAGS","A node can have at most one tag");R=K,L??(L=K.offset),Y=!1,B=!1,F=!0;break}case Z:if(O||R)U(K,"BAD_PROP_ORDER",`Anchors and tags must be after the ${K.source} indicator`);if(w)U(K,"UNEXPECTED_TOKEN",`Unexpected ${K.source} in ${$??"collection"}`);w=K,Y=Z==="seq-item-ind"||Z==="explicit-key-ind",B=!1;break;case"comma":if($){if(A)U(K,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);A=K,Y=!1,B=!1;break}default:U(K,"UNEXPECTED_TOKEN",`Unexpected ${K.type} token`),Y=!1,B=!1}}let I=q[q.length-1],P=I?I.offset+I.source.length:Q;if(F&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))U(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(_&&(Y&&_.indent<=z||X?.type==="block-map"||X?.type==="block-seq"))U(_,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:A,found:w,spaceBefore:J,comment:V,hasNewline:T,anchor:O,tag:R,newlineAfterProp:M,end:P,start:L??P}}i7.resolveProps=l7});var oq=D((n7)=>{function X2(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(X2($.key)||X2($.value))return!0}return!1;default:return!0}}n7.containsNewline=X2});var Q2=D((t7)=>{var o7=oq();function r7(q,$,Z){if($?.type==="flow-collection"){let X=$.end[0];if(X.indent===q&&(X.source==="]"||X.source==="}")&&o7.containsNewline($))Z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}t7.flowIndentCheck=r7});var U2=D(($X)=>{var L9=S();function qX(q,$,Z){let{uniqueKeys:X}=q.options;if(X===!1)return!1;let Q=typeof X==="function"?X:(U,z)=>U===z||L9.isScalar(U)&&L9.isScalar(z)&&U.value===z.value;return $.some((U)=>Q(U.key,Z))}$X.mapIncludes=qX});var A9=D((GX)=>{var I9=X0(),XX=U0(),K9=Qq(),QX=oq(),R9=Q2(),UX=U2(),M9="All mapping items must start at the same column";function zX({composeNode:q,composeEmptyNode:$},Z,X,Q,U){let G=new(U?.nodeClass??XX.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let J=X.offset,Y=null;for(let B of X.items){let{start:V,key:W,sep:T,value:F}=B,_=K9.resolveProps(V,{indicator:"explicit-key-ind",next:W??T?.[0],offset:J,onError:Q,parentIndent:X.indent,startOnNewline:!0}),O=!_.found;if(O){if(W){if(W.type==="block-seq")Q(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==X.indent)Q(J,"BAD_INDENT",M9)}if(!_.anchor&&!_.tag&&!T){if(Y=_.end,_.comment)if(G.comment)G.comment+=`
65
+ `+_.comment;else G.comment=_.comment;continue}if(_.newlineAfterProp||QX.containsNewline(W))Q(W??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(_.found?.indent!==X.indent)Q(J,"BAD_INDENT",M9);Z.atKey=!0;let R=_.end,M=W?q(Z,W,_,Q):$(Z,R,V,null,_,Q);if(Z.schema.compat)R9.flowIndentCheck(X.indent,W,Q);if(Z.atKey=!1,UX.mapIncludes(Z,G.items,M))Q(R,"DUPLICATE_KEY","Map keys must be unique");let A=K9.resolveProps(T??[],{indicator:"map-value-ind",next:F,offset:M.range[2],onError:Q,parentIndent:X.indent,startOnNewline:!W||W.type==="block-scalar"});if(J=A.end,A.found){if(O){if(F?.type==="block-map"&&!A.hasNewline)Q(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&_.start<A.found.offset-1024)Q(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=F?q(Z,F,A,Q):$(Z,J,T,null,A,Q);if(Z.schema.compat)R9.flowIndentCheck(X.indent,F,Q);J=w.range[2];let L=new I9.Pair(M,w);if(Z.options.keepSourceTokens)L.srcToken=B;G.items.push(L)}else{if(O)Q(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(A.comment)if(M.comment)M.comment+=`
66
+ `+A.comment;else M.comment=A.comment;let w=new I9.Pair(M);if(Z.options.keepSourceTokens)w.srcToken=B;G.items.push(w)}}if(Y&&Y<J)Q(Y,"IMPOSSIBLE","Map comment with trailing content");return G.range=[X.offset,J,Y??J],G}GX.resolveBlockMap=zX});var D9=D((BX)=>{var YX=z0(),HX=Qq(),VX=Q2();function WX({composeNode:q,composeEmptyNode:$},Z,X,Q,U){let G=new(U?.nodeClass??YX.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let J=X.offset,Y=null;for(let{start:B,value:V}of X.items){let W=HX.resolveProps(B,{indicator:"seq-item-ind",next:V,offset:J,onError:Q,parentIndent:X.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||V)if(V?.type==="block-seq")Q(W.end,"BAD_INDENT","All sequence items must start at the same column");else Q(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=W.end,W.comment)G.comment=W.comment;continue}let T=V?q(Z,V,W,Q):$(Z,W.end,B,null,W,Q);if(Z.schema.compat)VX.flowIndentCheck(X.indent,V,Q);J=T.range[2],G.items.push(T)}return G.range=[X.offset,J,Y??J],G}BX.resolveBlockSeq=WX});var b0=D((TX)=>{function OX(q,$,Z,X){let Q="";if(q){let U=!1,z="";for(let G of q){let{source:J,type:Y}=G;switch(Y){case"space":U=!0;break;case"comment":{if(Z&&!U)X(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=J.substring(1)||" ";if(!Q)Q=B;else Q+=z+B;z="";break}case"newline":if(Q)z+=J;U=!0;break;default:X(G,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}$+=J.length}}return{comment:Q,offset:$}}TX.resolveEnd=OX});var N9=D((wX)=>{var LX=S(),IX=X0(),w9=U0(),KX=z0(),RX=b0(),P9=Qq(),MX=oq(),AX=U2(),z2="Block collections are not allowed within flow collections",G2=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function DX({composeNode:q,composeEmptyNode:$},Z,X,Q,U){let z=X.start.source==="{",G=z?"flow map":"flow sequence",Y=new(U?.nodeClass??(z?w9.YAMLMap:KX.YAMLSeq))(Z.schema);Y.flow=!0;let B=Z.atRoot;if(B)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let V=X.offset+X.start.source.length;for(let O=0;O<X.items.length;++O){let R=X.items[O],{start:M,key:A,sep:w,value:L}=R,I=P9.resolveProps(M,{flow:G,indicator:"explicit-key-ind",next:A??w?.[0],offset:V,onError:Q,parentIndent:X.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!w&&!L){if(O===0&&I.comma)Q(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(O<X.items.length-1)Q(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(I.comment)if(Y.comment)Y.comment+=`
67
+ `+I.comment;else Y.comment=I.comment;V=I.end;continue}if(!z&&Z.options.strict&&MX.containsNewline(A))Q(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(O===0){if(I.comma)Q(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!I.comma)Q(I.start,"MISSING_CHAR",`Missing , between ${G} items`);if(I.comment){let P="";q:for(let K of M)switch(K.type){case"comma":case"space":break;case"comment":P=K.source.substring(1);break q;default:break q}if(P){let K=Y.items[Y.items.length-1];if(LX.isPair(K))K=K.value??K.key;if(K.comment)K.comment+=`
68
+ `+P;else K.comment=P;I.comment=I.comment.substring(P.length+1)}}}if(!z&&!w&&!I.found){let P=L?q(Z,L,I,Q):$(Z,I.end,w,null,I,Q);if(Y.items.push(P),V=P.range[2],G2(L))Q(P.range,"BLOCK_IN_FLOW",z2)}else{Z.atKey=!0;let P=I.end,K=A?q(Z,A,I,Q):$(Z,P,M,null,I,Q);if(G2(A))Q(K.range,"BLOCK_IN_FLOW",z2);Z.atKey=!1;let j=P9.resolveProps(w??[],{flow:G,indicator:"map-value-ind",next:L,offset:K.range[2],onError:Q,parentIndent:X.indent,startOnNewline:!1});if(j.found){if(!z&&!I.found&&Z.options.strict){if(w)for(let E of w){if(E===j.found)break;if(E.type==="newline"){Q(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(I.start<j.found.offset-1024)Q(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(L)if("source"in L&&L.source?.[0]===":")Q(L,"MISSING_CHAR",`Missing space after : in ${G}`);else Q(j.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let C=L?q(Z,L,j,Q):j.found?$(Z,j.end,w,null,j,Q):null;if(C){if(G2(L))Q(C.range,"BLOCK_IN_FLOW",z2)}else if(j.comment)if(K.comment)K.comment+=`
69
+ `+j.comment;else K.comment=j.comment;let y=new IX.Pair(K,C);if(Z.options.keepSourceTokens)y.srcToken=R;if(z){let E=Y;if(AX.mapIncludes(Z,E.items,K))Q(P,"DUPLICATE_KEY","Map keys must be unique");E.items.push(y)}else{let E=new w9.YAMLMap(Z.schema);E.flow=!0,E.items.push(y);let o=(C??K).range;E.range=[K.range[0],o[1],o[2]],Y.items.push(E)}V=C?C.range[2]:j.end}}let W=z?"}":"]",[T,...F]=X.end,_=V;if(T?.source===W)_=T.offset+T.source.length;else{let O=G[0].toUpperCase()+G.substring(1),R=B?`${O} must end with a ${W}`:`${O} in block collection must be sufficiently indented and end with a ${W}`;if(Q(V,B?"MISSING_CHAR":"BAD_INDENT",R),T&&T.source.length!==1)F.unshift(T)}if(F.length>0){let O=RX.resolveEnd(F,_,Z.options.strict,Q);if(O.comment)if(Y.comment)Y.comment+=`
70
+ `+O.comment;else Y.comment=O.comment;Y.range=[X.offset,_,O.offset]}else Y.range=[X.offset,_,_];return Y}wX.resolveFlowCollection=DX});var j9=D((xX)=>{var NX=S(),jX=x(),CX=U0(),bX=z0(),SX=A9(),EX=D9(),fX=N9();function J2(q,$,Z,X,Q,U){let z=Z.type==="block-map"?SX.resolveBlockMap(q,$,Z,X,U):Z.type==="block-seq"?EX.resolveBlockSeq(q,$,Z,X,U):fX.resolveFlowCollection(q,$,Z,X,U),G=z.constructor;if(Q==="!"||Q===G.tagName)return z.tag=G.tagName,z;if(Q)z.tag=Q;return z}function yX(q,$,Z,X,Q){let U=X.tag,z=!U?null:$.directives.tagName(U.source,(W)=>Q(U,"TAG_RESOLVE_FAILED",W));if(Z.type==="block-seq"){let{anchor:W,newlineAfterProp:T}=X,F=W&&U?W.offset>U.offset?W:U:W??U;if(F&&(!T||T.offset<F.offset))Q(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(!U||!z||z==="!"||z===CX.YAMLMap.tagName&&G==="map"||z===bX.YAMLSeq.tagName&&G==="seq")return J2(q,$,Z,Q,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)Q(U,"BAD_COLLECTION_TYPE",`${W.tag} used for ${G} collection, but expects ${W.collection??"scalar"}`,!0);else Q(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return J2(q,$,Z,Q,z)}}let Y=J2(q,$,Z,Q,z,J),B=J.resolve?.(Y,(W)=>Q(U,"TAG_RESOLVE_FAILED",W),$.options)??Y,V=NX.isNode(B)?B:new jX.Scalar(B);if(V.range=Y.range,V.tag=z,J?.format)V.format=J.format;return V}xX.composeCollection=yX});var H2=D((uX)=>{var Y2=x();function hX(q,$,Z){let X=$.offset,Q=kX($,q.options.strict,Z);if(!Q)return{value:"",type:null,comment:"",range:[X,X,X]};let U=Q.mode===">"?Y2.Scalar.BLOCK_FOLDED:Y2.Scalar.BLOCK_LITERAL,z=$.source?vX($.source):[],G=z.length;for(let _=z.length-1;_>=0;--_){let O=z[_][1];if(O===""||O==="\r")G=_;else break}if(G===0){let _=Q.chomp==="+"&&z.length>0?`
71
71
  `.repeat(Math.max(1,z.length-1)):"",O=X+Q.length;if($.source)O+=$.source.length;return{value:_,type:U,comment:Q.comment,range:[X,O,O]}}let J=$.indent+Q.indent,Y=$.offset+Q.length,B=0;for(let _=0;_<G;++_){let[O,R]=z[_];if(R===""||R==="\r"){if(Q.indent===0&&O.length>J)J=O.length}else{if(O.length<J)Z(Y+O.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Q.indent===0)J=O.length;if(B=_,J===0&&!q.atRoot)Z(Y,"BAD_INDENT","Block scalar values in collections must be indented");break}Y+=O.length+R.length+1}for(let _=z.length-1;_>=G;--_)if(z[_][0].length>J)G=_+1;let V="",W="",T=!1;for(let _=0;_<B;++_)V+=z[_][0].slice(J)+`
72
- `;for(let _=B;_<G;++_){let[O,R]=z[_];Y+=O.length+R.length+1;let A=R[R.length-1]==="\r";if(A)R=R.slice(0,-1);if(R&&O.length<J){let w=`Block scalar lines must not be less indented than their ${Q.indent?"explicit indentation indicator":"first line"}`;Z(Y-R.length-(A?2:1),"BAD_INDENT",w),O=""}if(U===Y2.Scalar.BLOCK_LITERAL)V+=W+O.slice(J)+R,W=`
72
+ `;for(let _=B;_<G;++_){let[O,R]=z[_];Y+=O.length+R.length+1;let M=R[R.length-1]==="\r";if(M)R=R.slice(0,-1);if(R&&O.length<J){let w=`Block scalar lines must not be less indented than their ${Q.indent?"explicit indentation indicator":"first line"}`;Z(Y-R.length-(M?2:1),"BAD_INDENT",w),O=""}if(U===Y2.Scalar.BLOCK_LITERAL)V+=W+O.slice(J)+R,W=`
73
73
  `;else if(O.length>J||R[0]==="\t"){if(W===" ")W=`
74
74
  `;else if(!T&&W===`
75
75
  `)W=`
@@ -82,46 +82,46 @@ ${Y}
82
82
  `+z[_][0].slice(J);if(V[V.length-1]!==`
83
83
  `)V+=`
84
84
  `;break;default:V+=`
85
- `}let F=X+Q.length+$.source.length;return{value:V,type:U,comment:Q.comment,range:[X,F,F]}}function kX({offset:q,props:$},Z,X){if($[0].type!=="block-scalar-header")return X($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Q}=$[0],U=Q[0],z=0,G="",J=-1;for(let W=1;W<Q.length;++W){let T=Q[W];if(!G&&(T==="-"||T==="+"))G=T;else{let F=Number(T);if(!z&&F)z=F;else if(J===-1)J=q+W}}if(J!==-1)X(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Q}`);let Y=!1,B="",V=Q.length;for(let W=1;W<$.length;++W){let T=$[W];switch(T.type){case"space":Y=!0;case"newline":V+=T.source.length;break;case"comment":if(Z&&!Y)X(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=T.source.length,B=T.source.substring(1);break;case"error":X(T,"UNEXPECTED_TOKEN",T.message),V+=T.source.length;break;default:{let F=`Unexpected token in block scalar header: ${T.type}`;X(T,"UNEXPECTED_TOKEN",F);let _=T.source;if(_&&typeof _==="string")V+=_.length}}}return{mode:U,indent:z,chomp:G,comment:B,length:V}}function hX(q){let $=q.split(/\n( *)/),Z=$[0],X=Z.match(/^( *)/),U=[X?.[1]?[X[1],Z.slice(X[1].length)]:["",Z]];for(let z=1;z<$.length;z+=2)U.push([$[z],$[z+1]]);return U}vX.resolveBlockScalar=gX});var W2=D((sX)=>{var V2=x(),mX=b0();function pX(q,$,Z){let{offset:X,type:Q,source:U,end:z}=q,G,J,Y=(W,T,F)=>Z(X+W,T,F);switch(Q){case"scalar":G=V2.Scalar.PLAIN,J=dX(U,Y);break;case"single-quoted-scalar":G=V2.Scalar.QUOTE_SINGLE,J=cX(U,Y);break;case"double-quoted-scalar":G=V2.Scalar.QUOTE_DOUBLE,J=lX(U,Y);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Q}`),{value:"",type:null,comment:"",range:[X,X+U.length,X+U.length]}}let B=X+U.length,V=mX.resolveEnd(z,B,$,Z);return{value:J,type:G,comment:V.comment,range:[X,B,V.offset]}}function dX(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 j9(q)}function cX(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return j9(q.slice(1,-1)).replace(/''/g,"'")}function j9(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
+ `}let F=X+Q.length+$.source.length;return{value:V,type:U,comment:Q.comment,range:[X,F,F]}}function kX({offset:q,props:$},Z,X){if($[0].type!=="block-scalar-header")return X($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Q}=$[0],U=Q[0],z=0,G="",J=-1;for(let W=1;W<Q.length;++W){let T=Q[W];if(!G&&(T==="-"||T==="+"))G=T;else{let F=Number(T);if(!z&&F)z=F;else if(J===-1)J=q+W}}if(J!==-1)X(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Q}`);let Y=!1,B="",V=Q.length;for(let W=1;W<$.length;++W){let T=$[W];switch(T.type){case"space":Y=!0;case"newline":V+=T.source.length;break;case"comment":if(Z&&!Y)X(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=T.source.length,B=T.source.substring(1);break;case"error":X(T,"UNEXPECTED_TOKEN",T.message),V+=T.source.length;break;default:{let F=`Unexpected token in block scalar header: ${T.type}`;X(T,"UNEXPECTED_TOKEN",F);let _=T.source;if(_&&typeof _==="string")V+=_.length}}}return{mode:U,indent:z,chomp:G,comment:B,length:V}}function vX(q){let $=q.split(/\n( *)/),Z=$[0],X=Z.match(/^( *)/),U=[X?.[1]?[X[1],Z.slice(X[1].length)]:["",Z]];for(let z=1;z<$.length;z+=2)U.push([$[z],$[z+1]]);return U}uX.resolveBlockScalar=hX});var W2=D((oX)=>{var V2=x(),pX=b0();function dX(q,$,Z){let{offset:X,type:Q,source:U,end:z}=q,G,J,Y=(W,T,F)=>Z(X+W,T,F);switch(Q){case"scalar":G=V2.Scalar.PLAIN,J=cX(U,Y);break;case"single-quoted-scalar":G=V2.Scalar.QUOTE_SINGLE,J=lX(U,Y);break;case"double-quoted-scalar":G=V2.Scalar.QUOTE_DOUBLE,J=iX(U,Y);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Q}`),{value:"",type:null,comment:"",range:[X,X+U.length,X+U.length]}}let B=X+U.length,V=pX.resolveEnd(z,B,$,Z);return{value:J,type:G,comment:V.comment,range:[X,B,V.offset]}}function cX(q,$){let Z="";switch(q[0]){case"\t":Z="a tab character";break;case",":Z="flow indicator character ,";break;case"%":Z="directive indicator character %";break;case"|":case">":{Z=`block scalar indicator ${q[0]}`;break}case"@":case"`":{Z=`reserved character ${q[0]}`;break}}if(Z)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${Z}`);return C9(q)}function lX(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return C9(q.slice(1,-1)).replace(/''/g,"'")}function C9(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
86
86
  `,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
87
87
  `,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=$.exec(q);if(!X)return q;let Q=X[1],U=" ",z=$.lastIndex;Z.lastIndex=z;while(X=Z.exec(q)){if(X[1]==="")if(U===`
88
88
  `)Q+=U;else U=`
89
- `;else Q+=U+X[1],U=" ";z=Z.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,X=G.exec(q),Q+U+(X?.[1]??"")}function lX(q,$){let Z="";for(let X=1;X<q.length-1;++X){let Q=q[X];if(Q==="\r"&&q[X+1]===`
89
+ `;else Q+=U+X[1],U=" ";z=Z.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,X=G.exec(q),Q+U+(X?.[1]??"")}function iX(q,$){let Z="";for(let X=1;X<q.length-1;++X){let Q=q[X];if(Q==="\r"&&q[X+1]===`
90
90
  `)continue;if(Q===`
91
- `){let{fold:U,offset:z}=iX(q,X);Z+=U,X=z}else if(Q==="\\"){let U=q[++X],z=aX[U];if(z)Z+=z;else if(U===`
91
+ `){let{fold:U,offset:z}=aX(q,X);Z+=U,X=z}else if(Q==="\\"){let U=q[++X],z=nX[U];if(z)Z+=z;else if(U===`
92
92
  `){U=q[X+1];while(U===" "||U==="\t")U=q[++X+1]}else if(U==="\r"&&q[X+1]===`
93
- `){U=q[++X+1];while(U===" "||U==="\t")U=q[++X+1]}else if(U==="x"||U==="u"||U==="U"){let G={x:2,u:4,U:8}[U];Z+=nX(q,X+1,G,$),X+=G}else{let G=q.substr(X-1,2);$(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),Z+=G}}else if(Q===" "||Q==="\t"){let U=X,z=q[X+1];while(z===" "||z==="\t")z=q[++X+1];if(z!==`
93
+ `){U=q[++X+1];while(U===" "||U==="\t")U=q[++X+1]}else if(U==="x"||U==="u"||U==="U"){let G={x:2,u:4,U:8}[U];Z+=sX(q,X+1,G,$),X+=G}else{let G=q.substr(X-1,2);$(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),Z+=G}}else if(Q===" "||Q==="\t"){let U=X,z=q[X+1];while(z===" "||z==="\t")z=q[++X+1];if(z!==`
94
94
  `&&!(z==="\r"&&q[X+2]===`
95
- `))Z+=X>U?q.slice(U,X+1):Q}else Z+=Q}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function iX(q,$){let Z="",X=q[$+1];while(X===" "||X==="\t"||X===`
95
+ `))Z+=X>U?q.slice(U,X+1):Q}else Z+=Q}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function aX(q,$){let Z="",X=q[$+1];while(X===" "||X==="\t"||X===`
96
96
  `||X==="\r"){if(X==="\r"&&q[$+2]!==`
97
97
  `)break;if(X===`
98
98
  `)Z+=`
99
- `;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var aX={"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 nX(q,$,Z,X){let Q=q.substr($,Z),z=Q.length===Z&&/^[0-9a-fA-F]+$/.test(Q)?parseInt(Q,16):NaN;if(isNaN(z)){let G=q.substr($-2,Z+2);return X($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}return String.fromCodePoint(z)}sX.resolveFlowScalar=pX});var b9=D((ZQ)=>{var _0=S(),C9=x(),rX=H2(),tX=W2();function eX(q,$,Z,X){let{value:Q,type:U,comment:z,range:G}=$.type==="block-scalar"?rX.resolveBlockScalar(q,$,X):tX.resolveFlowScalar($,q.options.strict,X),J=Z?q.directives.tagName(Z.source,(V)=>X(Z,"TAG_RESOLVE_FAILED",V)):null,Y;if(q.options.stringKeys&&q.atKey)Y=q.schema[_0.SCALAR];else if(J)Y=qQ(q.schema,Q,J,Z,X);else if($.type==="scalar")Y=$Q(q,Q,$,X);else Y=q.schema[_0.SCALAR];let B;try{let V=Y.resolve(Q,(W)=>X(Z??$,"TAG_RESOLVE_FAILED",W),q.options);B=_0.isScalar(V)?V:new C9.Scalar(V)}catch(V){let W=V instanceof Error?V.message:String(V);X(Z??$,"TAG_RESOLVE_FAILED",W),B=new C9.Scalar(Q)}if(B.range=G,B.source=Q,U)B.type=U;if(J)B.tag=J;if(Y.format)B.format=Y.format;if(z)B.comment=z;return B}function qQ(q,$,Z,X,Q){if(Z==="!")return q[_0.SCALAR];let U=[];for(let G of q.tags)if(!G.collection&&G.tag===Z)if(G.default&&G.test)U.push(G);else return G;for(let G of U)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 Q(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[_0.SCALAR]}function $Q({atKey:q,directives:$,schema:Z},X,Q,U){let z=Z.tags.find((G)=>(G.default===!0||q&&G.default==="key")&&G.test?.test(X))||Z[_0.SCALAR];if(Z.compat){let G=Z.compat.find((J)=>J.default&&J.test?.test(X))??Z[_0.SCALAR];if(z.tag!==G.tag){let J=$.tagString(z.tag),Y=$.tagString(G.tag),B=`Value may be parsed as either ${J} or ${Y}`;U(Q,"TAG_RESOLVE_FAILED",B,!0)}}return z}ZQ.composeScalar=eX});var S9=D((UQ)=>{function QQ(q,$,Z){if($){Z??(Z=$.length);for(let X=Z-1;X>=0;--X){let Q=$[X];switch(Q.type){case"space":case"comment":case"newline":q-=Q.source.length;continue}Q=$[++X];while(Q?.type==="space")q+=Q.source.length,Q=$[++X];break}}return q}UQ.emptyScalarPosition=QQ});var y9=D((_Q)=>{var GQ=m0(),JQ=S(),YQ=N9(),E9=b9(),HQ=b0(),VQ=S9(),WQ={composeNode:f9,composeEmptyNode:B2};function f9(q,$,Z,X){let Q=q.atKey,{spaceBefore:U,comment:z,anchor:G,tag:J}=Z,Y,B=!0;switch($.type){case"alias":if(Y=BQ(q,$,X),G||J)X($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(Y=E9.composeScalar(q,$,J,X),G)Y.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(Y=YQ.composeCollection(WQ,q,$,Z,X),G)Y.anchor=G.source.substring(1);break;default:{let V=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;X($,"UNEXPECTED_TOKEN",V),Y=B2(q,$.offset,void 0,null,Z,X),B=!1}}if(G&&Y.anchor==="")X(G,"BAD_ALIAS","Anchor cannot be an empty string");if(Q&&q.options.stringKeys&&(!JQ.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))X(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)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,X,{spaceBefore:Q,comment:U,anchor:z,tag:G,end:J},Y){let B={type:"scalar",offset:VQ.emptyScalarPosition($,Z,X),indent:-1,source:""},V=E9.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(Q)V.spaceBefore=!0;if(U)V.comment=U,V.range[2]=J;return V}function BQ({options:q},{offset:$,source:Z,end:X},Q){let U=new GQ.Alias(Z.substring(1));if(U.source==="")Q($,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))Q($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=$+Z.length,G=HQ.resolveEnd(X,z,q.strict,Q);if(U.range=[$,z,G.offset],G.comment)U.comment=G.comment;return U}_Q.composeEmptyNode=B2;_Q.composeNode=f9});var g9=D((RQ)=>{var FQ=Zq(),x9=y9(),LQ=b0(),IQ=Qq();function KQ(q,$,{offset:Z,start:X,value:Q,end:U},z){let G=Object.assign({_directives:$},q),J=new FQ.Document(void 0,G),Y={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},B=IQ.resolveProps(X,{indicator:"doc-start",next:Q??U?.[0],offset:Z,onError:z,parentIndent:0,startOnNewline:!0});if(B.found){if(J.directives.docStart=!0,Q&&(Q.type==="block-map"||Q.type==="block-seq")&&!B.hasNewline)z(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=Q?x9.composeNode(Y,Q,B,z):x9.composeEmptyNode(Y,B.end,X,null,B,z);let V=J.contents.range[2],W=LQ.resolveEnd(U,V,!1,z);if(W.comment)J.comment=W.comment;return J.range=[Z,V,W.offset],J}RQ.composeDoc=KQ});var _2=D((jQ)=>{var MQ=k("process"),DQ=L$(),wQ=Zq(),Uq=Xq(),k9=S(),PQ=g9(),NQ=b0();function zq(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:Z}=q;return[$,$+(typeof Z==="string"?Z.length:1)]}function h9(q){let $="",Z=!1,X=!1;for(let Q=0;Q<q.length;++Q){let U=q[Q];switch(U[0]){case"#":$+=($===""?"":X?`
99
+ `;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var nX={"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 sX(q,$,Z,X){let Q=q.substr($,Z),z=Q.length===Z&&/^[0-9a-fA-F]+$/.test(Q)?parseInt(Q,16):NaN;if(isNaN(z)){let G=q.substr($-2,Z+2);return X($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}return String.fromCodePoint(z)}oX.resolveFlowScalar=dX});var S9=D((XQ)=>{var _0=S(),b9=x(),tX=H2(),eX=W2();function qQ(q,$,Z,X){let{value:Q,type:U,comment:z,range:G}=$.type==="block-scalar"?tX.resolveBlockScalar(q,$,X):eX.resolveFlowScalar($,q.options.strict,X),J=Z?q.directives.tagName(Z.source,(V)=>X(Z,"TAG_RESOLVE_FAILED",V)):null,Y;if(q.options.stringKeys&&q.atKey)Y=q.schema[_0.SCALAR];else if(J)Y=$Q(q.schema,Q,J,Z,X);else if($.type==="scalar")Y=ZQ(q,Q,$,X);else Y=q.schema[_0.SCALAR];let B;try{let V=Y.resolve(Q,(W)=>X(Z??$,"TAG_RESOLVE_FAILED",W),q.options);B=_0.isScalar(V)?V:new b9.Scalar(V)}catch(V){let W=V instanceof Error?V.message:String(V);X(Z??$,"TAG_RESOLVE_FAILED",W),B=new b9.Scalar(Q)}if(B.range=G,B.source=Q,U)B.type=U;if(J)B.tag=J;if(Y.format)B.format=Y.format;if(z)B.comment=z;return B}function $Q(q,$,Z,X,Q){if(Z==="!")return q[_0.SCALAR];let U=[];for(let G of q.tags)if(!G.collection&&G.tag===Z)if(G.default&&G.test)U.push(G);else return G;for(let G of U)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 Q(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[_0.SCALAR]}function ZQ({atKey:q,directives:$,schema:Z},X,Q,U){let z=Z.tags.find((G)=>(G.default===!0||q&&G.default==="key")&&G.test?.test(X))||Z[_0.SCALAR];if(Z.compat){let G=Z.compat.find((J)=>J.default&&J.test?.test(X))??Z[_0.SCALAR];if(z.tag!==G.tag){let J=$.tagString(z.tag),Y=$.tagString(G.tag),B=`Value may be parsed as either ${J} or ${Y}`;U(Q,"TAG_RESOLVE_FAILED",B,!0)}}return z}XQ.composeScalar=qQ});var E9=D((zQ)=>{function UQ(q,$,Z){if($){Z??(Z=$.length);for(let X=Z-1;X>=0;--X){let Q=$[X];switch(Q.type){case"space":case"comment":case"newline":q-=Q.source.length;continue}Q=$[++X];while(Q?.type==="space")q+=Q.source.length,Q=$[++X];break}}return q}zQ.emptyScalarPosition=UQ});var x9=D((OQ)=>{var JQ=m0(),YQ=S(),HQ=j9(),f9=S9(),VQ=b0(),WQ=E9(),BQ={composeNode:y9,composeEmptyNode:B2};function y9(q,$,Z,X){let Q=q.atKey,{spaceBefore:U,comment:z,anchor:G,tag:J}=Z,Y,B=!0;switch($.type){case"alias":if(Y=_Q(q,$,X),G||J)X($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(Y=f9.composeScalar(q,$,J,X),G)Y.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(Y=HQ.composeCollection(BQ,q,$,Z,X),G)Y.anchor=G.source.substring(1);break;default:{let V=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;X($,"UNEXPECTED_TOKEN",V),Y=B2(q,$.offset,void 0,null,Z,X),B=!1}}if(G&&Y.anchor==="")X(G,"BAD_ALIAS","Anchor cannot be an empty string");if(Q&&q.options.stringKeys&&(!YQ.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))X(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)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,X,{spaceBefore:Q,comment:U,anchor:z,tag:G,end:J},Y){let B={type:"scalar",offset:WQ.emptyScalarPosition($,Z,X),indent:-1,source:""},V=f9.composeScalar(q,B,G,Y);if(z){if(V.anchor=z.source.substring(1),V.anchor==="")Y(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(Q)V.spaceBefore=!0;if(U)V.comment=U,V.range[2]=J;return V}function _Q({options:q},{offset:$,source:Z,end:X},Q){let U=new JQ.Alias(Z.substring(1));if(U.source==="")Q($,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))Q($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=$+Z.length,G=VQ.resolveEnd(X,z,q.strict,Q);if(U.range=[$,z,G.offset],G.comment)U.comment=G.comment;return U}OQ.composeEmptyNode=B2;OQ.composeNode=y9});var h9=D((MQ)=>{var LQ=Zq(),g9=x9(),IQ=b0(),KQ=Qq();function RQ(q,$,{offset:Z,start:X,value:Q,end:U},z){let G=Object.assign({_directives:$},q),J=new LQ.Document(void 0,G),Y={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},B=KQ.resolveProps(X,{indicator:"doc-start",next:Q??U?.[0],offset:Z,onError:z,parentIndent:0,startOnNewline:!0});if(B.found){if(J.directives.docStart=!0,Q&&(Q.type==="block-map"||Q.type==="block-seq")&&!B.hasNewline)z(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=Q?g9.composeNode(Y,Q,B,z):g9.composeEmptyNode(Y,B.end,X,null,B,z);let V=J.contents.range[2],W=IQ.resolveEnd(U,V,!1,z);if(W.comment)J.comment=W.comment;return J.range=[Z,V,W.offset],J}MQ.composeDoc=RQ});var _2=D((CQ)=>{var DQ=h("process"),wQ=L$(),PQ=Zq(),Uq=Xq(),k9=S(),NQ=h9(),jQ=b0();function zq(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:Z}=q;return[$,$+(typeof Z==="string"?Z.length:1)]}function v9(q){let $="",Z=!1,X=!1;for(let Q=0;Q<q.length;++Q){let U=q[Q];switch(U[0]){case"#":$+=($===""?"":X?`
101
101
 
102
102
  `:`
103
- `)+(U.substring(1)||" "),Z=!0,X=!1;break;case"%":if(q[Q+1]?.[0]!=="#")Q+=1;Z=!1;break;default:if(!Z)X=!0;Z=!1}}return{comment:$,afterEmptyLine:X}}class v9{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,X,Q)=>{let U=zq($);if(Q)this.warnings.push(new Uq.YAMLWarning(U,Z,X));else this.errors.push(new Uq.YAMLParseError(U,Z,X))},this.directives=new DQ.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:X}=h9(this.prelude);if(Z){let Q=q.contents;if($)q.comment=q.comment?`${q.comment}
103
+ `)+(U.substring(1)||" "),Z=!0,X=!1;break;case"%":if(q[Q+1]?.[0]!=="#")Q+=1;Z=!1;break;default:if(!Z)X=!0;Z=!1}}return{comment:$,afterEmptyLine:X}}class u9{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,X,Q)=>{let U=zq($);if(Q)this.warnings.push(new Uq.YAMLWarning(U,Z,X));else this.errors.push(new Uq.YAMLParseError(U,Z,X))},this.directives=new wQ.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:X}=v9(this.prelude);if(Z){let Q=q.contents;if($)q.comment=q.comment?`${q.comment}
104
104
  ${Z}`:Z;else if(X||q.directives.docStart||!Q)q.commentBefore=Z;else if(k9.isCollection(Q)&&!Q.flow&&Q.items.length>0){let U=Q.items[0];if(k9.isPair(U))U=U.key;let z=U.commentBefore;U.commentBefore=z?`${Z}
105
105
  ${z}`:Z}else{let U=Q.commentBefore;Q.commentBefore=U?`${Z}
106
- ${U}`:Z}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:h9(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,Z=-1){for(let X of q)yield*this.next(X);yield*this.end($,Z)}*next(q){if(MQ.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,X)=>{let Q=zq(q);Q[0]+=$,this.onError(Q,"BAD_DIRECTIVE",Z,X)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=PQ.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 Uq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(Z);else this.doc.errors.push(Z);break}case"doc-end":{if(!this.doc){this.errors.push(new Uq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=NQ.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 Uq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let Z=Object.assign({_directives:this.directives},this.options),X=new wQ.Document(void 0,Z);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,$,$],this.decorate(X,!1),yield X}}}jQ.Composer=v9});var p9=D((kQ)=>{var bQ=H2(),SQ=W2(),EQ=Xq(),u9=l0();function fQ(q,$=!0,Z){if(q){let X=(Q,U,z)=>{let G=typeof Q==="number"?Q:Array.isArray(Q)?Q[0]:Q.offset;if(Z)Z(G,U,z);else throw new EQ.YAMLParseError([G,G+1],U,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return SQ.resolveFlowScalar(q,$,X);case"block-scalar":return bQ.resolveBlockScalar({options:{strict:$}},q,X)}}return null}function yQ(q,$){let{implicitKey:Z=!1,indent:X,inFlow:Q=!1,offset:U=-1,type:z="PLAIN"}=$,G=u9.stringifyString({type:z,value:q},{implicitKey:Z,indent:X>0?" ".repeat(X):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:X,source:`
106
+ ${U}`:Z}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:v9(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,Z=-1){for(let X of q)yield*this.next(X);yield*this.end($,Z)}*next(q){if(DQ.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,X)=>{let Q=zq(q);Q[0]+=$,this.onError(Q,"BAD_DIRECTIVE",Z,X)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=NQ.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 Uq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(Z);else this.doc.errors.push(Z);break}case"doc-end":{if(!this.doc){this.errors.push(new Uq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=jQ.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 Uq.YAMLParseError(zq(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let Z=Object.assign({_directives:this.directives},this.options),X=new PQ.Document(void 0,Z);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,$,$],this.decorate(X,!1),yield X}}}CQ.Composer=u9});var d9=D((kQ)=>{var SQ=H2(),EQ=W2(),fQ=Xq(),m9=l0();function yQ(q,$=!0,Z){if(q){let X=(Q,U,z)=>{let G=typeof Q==="number"?Q:Array.isArray(Q)?Q[0]:Q.offset;if(Z)Z(G,U,z);else throw new fQ.YAMLParseError([G,G+1],U,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return EQ.resolveFlowScalar(q,$,X);case"block-scalar":return SQ.resolveBlockScalar({options:{strict:$}},q,X)}}return null}function xQ(q,$){let{implicitKey:Z=!1,indent:X,inFlow:Q=!1,offset:U=-1,type:z="PLAIN"}=$,G=m9.stringifyString({type:z,value:q},{implicitKey:Z,indent:X>0?" ".repeat(X):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:X,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:U,indent:X,source:B}];if(!m9(W,J))W.push({type:"newline",offset:-1,indent:X,source:`
111
- `});return{type:"block-scalar",offset:U,indent:X,props:W,source:V}}case'"':return{type:"double-quoted-scalar",offset:U,indent:X,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:U,indent:X,source:G,end:J};default:return{type:"scalar",offset:U,indent:X,source:G,end:J}}}function xQ(q,$,Z={}){let{afterKey:X=!1,implicitKey:Q=!1,inFlow:U=!1,type:z}=Z,G="indent"in q?q.indent:null;if(X&&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=u9.stringifyString({type:z,value:$},{implicitKey:Q||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":gQ(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 gQ(q,$){let Z=$.indexOf(`
110
+ `,W=[{type:"block-scalar-header",offset:U,indent:X,source:B}];if(!p9(W,J))W.push({type:"newline",offset:-1,indent:X,source:`
111
+ `});return{type:"block-scalar",offset:U,indent:X,props:W,source:V}}case'"':return{type:"double-quoted-scalar",offset:U,indent:X,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:U,indent:X,source:G,end:J};default:return{type:"scalar",offset:U,indent:X,source:G,end:J}}}function gQ(q,$,Z={}){let{afterKey:X=!1,implicitKey:Q=!1,inFlow:U=!1,type:z}=Z,G="indent"in q?q.indent:null;if(X&&typeof G==="number")G+=2;if(!z)switch(q.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let Y=q.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let J=m9.stringifyString({type:z,value:$},{implicitKey:Q||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":hQ(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 hQ(q,$){let Z=$.indexOf(`
112
112
  `),X=$.substring(0,Z),Q=$.substring(Z+1)+`
113
- `;if(q.type==="block-scalar"){let U=q.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=X,q.source=Q}else{let{offset:U}=q,z="indent"in q?q.indent:-1,G=[{type:"block-scalar-header",offset:U,indent:z,source:X}];if(!m9(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:Q})}}function m9(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 X=q.props.slice(1),Q=$.length;if(q.props[0].type==="block-scalar-header")Q-=q.props[0].source.length;for(let U of X)U.offset+=Q;delete q.props,Object.assign(q,{type:Z,source:$,end:X});break}case"block-map":case"block-seq":{let Q={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
115
- `};delete q.items,Object.assign(q,{type:Z,source:$,end:[Q]});break}default:{let X="indent"in q?q.indent:-1,Q="end"in q&&Array.isArray(q.end)?q.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:Z,indent:X,source:$,end:Q})}}}kQ.createScalarToken=yQ;kQ.resolveAsScalar=fQ;kQ.setScalarValue=xQ});var d9=D((pQ)=>{var mQ=(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:X}){let Q="";for(let U of q)Q+=U.source;if($)Q+=tq($);if(Z)for(let U of Z)Q+=U.source;if(X)Q+=tq(X);return Q}pQ.stringify=mQ});var i9=D((lQ)=>{var T2=Symbol("break visit"),cQ=Symbol("skip children"),c9=Symbol("remove item");function O0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};l9(Object.freeze([]),q,$)}O0.BREAK=T2;O0.SKIP=cQ;O0.REMOVE=c9;O0.itemAtPath=(q,$)=>{let Z=q;for(let[X,Q]of $){let U=Z?.[X];if(U&&"items"in U)Z=U.items[Q];else return}return Z};O0.parentCollection=(q,$)=>{let Z=O0.itemAtPath(q,$.slice(0,-1)),X=$[$.length-1][0],Q=Z?.[X];if(Q&&"items"in Q)return Q;throw Error("Parent collection not found")};function l9(q,$,Z){let X=Z($,q);if(typeof X==="symbol")return X;for(let Q of["key","value"]){let U=$[Q];if(U&&"items"in U){for(let z=0;z<U.items.length;++z){let G=l9(Object.freeze(q.concat([[Q,z]])),U.items[z],Z);if(typeof G==="number")z=G-1;else if(G===T2)return T2;else if(G===c9)U.items.splice(z,1),z-=1}if(typeof X==="function"&&Q==="key")X=X($,q)}}return typeof X==="function"?X($,q):X}lQ.visit=O0});var eq=D((eQ)=>{var F2=p9(),aQ=d9(),nQ=i9(),L2="\uFEFF",I2="\x02",K2="\x18",R2="\x1F",sQ=(q)=>!!q&&("items"in q),oQ=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function rQ(q){switch(q){case L2:return"<BOM>";case I2:return"<DOC>";case K2:return"<FLOW_END>";case R2:return"<SCALAR>";default:return JSON.stringify(q)}}function tQ(q){switch(q){case L2:return"byte-order-mark";case I2:return"doc-mode";case K2:return"flow-error-end";case R2:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
113
+ `;if(q.type==="block-scalar"){let U=q.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=X,q.source=Q}else{let{offset:U}=q,z="indent"in q?q.indent:-1,G=[{type:"block-scalar-header",offset:U,indent:z,source:X}];if(!p9(G,"end"in q?q.end:void 0))G.push({type:"newline",offset:-1,indent:z,source:`
114
+ `});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:z,props:G,source:Q})}}function p9(q,$){if($)for(let Z of $)switch(Z.type){case"space":case"comment":q.push(Z);break;case"newline":return q.push(Z),!0}return!1}function O2(q,$,Z){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=Z,q.source=$;break;case"block-scalar":{let X=q.props.slice(1),Q=$.length;if(q.props[0].type==="block-scalar-header")Q-=q.props[0].source.length;for(let U of X)U.offset+=Q;delete q.props,Object.assign(q,{type:Z,source:$,end:X});break}case"block-map":case"block-seq":{let Q={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
115
+ `};delete q.items,Object.assign(q,{type:Z,source:$,end:[Q]});break}default:{let X="indent"in q?q.indent:-1,Q="end"in q&&Array.isArray(q.end)?q.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:Z,indent:X,source:$,end:Q})}}}kQ.createScalarToken=xQ;kQ.resolveAsScalar=yQ;kQ.setScalarValue=gQ});var c9=D((dQ)=>{var pQ=(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:X}){let Q="";for(let U of q)Q+=U.source;if($)Q+=tq($);if(Z)for(let U of Z)Q+=U.source;if(X)Q+=tq(X);return Q}dQ.stringify=pQ});var a9=D((iQ)=>{var T2=Symbol("break visit"),lQ=Symbol("skip children"),l9=Symbol("remove item");function O0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};i9(Object.freeze([]),q,$)}O0.BREAK=T2;O0.SKIP=lQ;O0.REMOVE=l9;O0.itemAtPath=(q,$)=>{let Z=q;for(let[X,Q]of $){let U=Z?.[X];if(U&&"items"in U)Z=U.items[Q];else return}return Z};O0.parentCollection=(q,$)=>{let Z=O0.itemAtPath(q,$.slice(0,-1)),X=$[$.length-1][0],Q=Z?.[X];if(Q&&"items"in Q)return Q;throw Error("Parent collection not found")};function i9(q,$,Z){let X=Z($,q);if(typeof X==="symbol")return X;for(let Q of["key","value"]){let U=$[Q];if(U&&"items"in U){for(let z=0;z<U.items.length;++z){let G=i9(Object.freeze(q.concat([[Q,z]])),U.items[z],Z);if(typeof G==="number")z=G-1;else if(G===T2)return T2;else if(G===l9)U.items.splice(z,1),z-=1}if(typeof X==="function"&&Q==="key")X=X($,q)}}return typeof X==="function"?X($,q):X}iQ.visit=O0});var eq=D((qU)=>{var F2=d9(),nQ=c9(),sQ=a9(),L2="\uFEFF",I2="\x02",K2="\x18",R2="\x1F",oQ=(q)=>!!q&&("items"in q),rQ=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function tQ(q){switch(q){case L2:return"<BOM>";case I2:return"<DOC>";case K2:return"<FLOW_END>";case R2:return"<SCALAR>";default:return JSON.stringify(q)}}function eQ(q){switch(q){case L2:return"byte-order-mark";case I2:return"doc-mode";case K2:return"flow-error-end";case R2:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
116
116
  `:case`\r
117
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}eQ.createScalarToken=F2.createScalarToken;eQ.resolveAsScalar=F2.resolveAsScalar;eQ.setScalarValue=F2.setScalarValue;eQ.stringify=aQ.stringify;eQ.visit=nQ.visit;eQ.BOM=L2;eQ.DOCUMENT=I2;eQ.FLOW_END=K2;eQ.SCALAR=R2;eQ.isCollection=sQ;eQ.isScalar=oQ;eQ.prettyToken=rQ;eQ.tokenType=tQ});var M2=D((OU)=>{var Gq=eq();function l(q){switch(q){case void 0:case" ":case`
118
- `:case"\r":case"\t":return!0;default:return!1}}var a9=new Set("0123456789ABCDEFabcdef"),BU=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),q$=new Set(",[]{}"),_U=new Set(` ,[]{}
119
- \r `),A2=(q)=>!q||_U.has(q);class n9{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(!$||$==="#"||$===`
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}qU.createScalarToken=F2.createScalarToken;qU.resolveAsScalar=F2.resolveAsScalar;qU.setScalarValue=F2.setScalarValue;qU.stringify=nQ.stringify;qU.visit=sQ.visit;qU.BOM=L2;qU.DOCUMENT=I2;qU.FLOW_END=K2;qU.SCALAR=R2;qU.isCollection=oQ;qU.isScalar=rQ;qU.prettyToken=tQ;qU.tokenType=eQ});var A2=D((TU)=>{var Gq=eq();function l(q){switch(q){case void 0:case" ":case`
118
+ `:case"\r":case"\t":return!0;default:return!1}}var n9=new Set("0123456789ABCDEFabcdef"),_U=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),q$=new Set(",[]{}"),OU=new Set(` ,[]{}
119
+ \r `),M2=(q)=>!q||OU.has(q);class s9{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let Z=this.next??"stream";while(Z&&($||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
120
120
  `)return!0;if($==="\r")return this.buffer[q+1]===`
121
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 X=this.buffer[Z+q+1];if(X===`
122
122
  `||!X&&!this.atEnd)return q+Z+1}return $===`
123
123
  `||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&l(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
124
- `,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Gq.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let Q=q[Z-1];if(Q===" "||Q==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let Q=q[$-1];if(Q===" "||Q==="\t")$-=1;else break}let X=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield Gq.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&l(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!l(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&l($)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(A2),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,Z=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=Z=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&X[0]!=="#"||Z===0&&(X.startsWith("---")||X.startsWith("..."))&&l(X[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield Gq.FLOW_END,yield*this.parseLineStart()}let Q=0;while(X[Q]===",")Q+=yield*this.pushCount(1),Q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Q+=yield*this.pushIndicators(),X[Q]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-Q),"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(A2),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||l(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let Q=0;while(this.buffer[$-1-Q]==="\\")Q+=1;if(Q%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),X=Z.indexOf(`
124
+ `,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Gq.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let Q=q[Z-1];if(Q===" "||Q==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let Q=q[$-1];if(Q===" "||Q==="\t")$-=1;else break}let X=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield Gq.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&l(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!l(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&l($)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(M2),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,Z=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=Z=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&X[0]!=="#"||Z===0&&(X.startsWith("---")||X.startsWith("..."))&&l(X[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield Gq.FLOW_END,yield*this.parseLineStart()}let Q=0;while(X[Q]===",")Q+=yield*this.pushCount(1),Q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Q+=yield*this.pushIndicators(),X[Q]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-Q),"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 U=this.charAt(1);if(this.flowKey||l(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let Q=0;while(this.buffer[$-1-Q]==="\\")Q+=1;if(Q%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),X=Z.indexOf(`
125
125
  `,this.pos);if(X!==-1){while(X!==-1){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Z.indexOf(`
126
126
  `,Q)}if(X!==-1)$=X-(Z[X-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>l($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let Q=this.pos;Z=this.buffer[Q];++Q)switch(Z){case" ":$+=1;break;case`
127
127
  `:q=Q,$=0;break;case"\r":{let U=this.buffer[Q+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
@@ -131,31 +131,31 @@ ${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.pus
131
131
  `&&Q>=this.pos&&Q+1+$>z)q=Q;else break}while(!0);return yield Gq.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,Z=this.pos-1,X;while(X=this.buffer[++Z])if(X===":"){let Q=this.buffer[Z+1];if(l(Q)||q&&q$.has(Q))break;$=Z}else if(l(X)){let Q=this.buffer[Z+1];if(X==="\r")if(Q===`
132
132
  `)Z+=1,X=`
133
133
  `,Q=this.buffer[Z+1];else $=Z;if(Q==="#"||q&&q$.has(Q))break;if(X===`
134
- `){let U=this.continueScalar(Z+1);if(U===-1)break;Z=Math.max(Z,U-2)}}else{if(q&&q$.has(X))break;$=Z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield Gq.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let Z=this.buffer.slice(this.pos,q);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(A2))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(l($)||q&&q$.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!l($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(BU.has($))$=this.buffer[++q];else if($==="%"&&a9.has(this.buffer[q+1])&&a9.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===`
134
+ `){let U=this.continueScalar(Z+1);if(U===-1)break;Z=Math.max(Z,U-2)}}else{if(q&&q$.has(X))break;$=Z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield Gq.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let Z=this.buffer.slice(this.pos,q);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(M2))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(l($)||q&&q$.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!l($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(_U.has($))$=this.buffer[++q];else if($==="%"&&n9.has(this.buffer[q+1])&&n9.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
135
135
  `)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
136
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}OU.Lexer=n9});var D2=D((FU)=>{class s9{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let Q=$+Z>>1;if(this.lineStarts[Q]<q)$=Q+1;else Z=Q}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let X=this.lineStarts[$-1];return{line:$,col:q-X+1}}}}FU.LineCounter=s9});var w2=D((RU)=>{var IU=k("process"),o9=eq(),KU=M2();function G0(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function r9(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function e9(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 t9(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!G0($.start,"explicit-key-ind")&&!G0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,e9($.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 q4{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 KU.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,IU.env.LOG_TOKENS)console.log("|",o9.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=o9.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")t9($);switch(Z.type){case"document":Z.value=$;break;case"block-scalar":Z.props.push($);break;case"block-map":{let X=Z.items[Z.items.length-1];if(X.value){Z.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=$;else{Object.assign(X,{key:$,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=Z.items[Z.items.length-1];if(X.value)Z.items.push({start:[],value:$});else X.value=$;break}case"flow-collection":{let X=Z.items[Z.items.length-1];if(!X||X.value)Z.items.push({start:[],key:$,sep:[]});else if(X.sep)X.value=$;else Object.assign(X,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let X=$.items[$.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&r9(X.start)===-1&&($.indent===0||X.start.every((Q)=>Q.type!=="comment"||Q.indent<$.indent))){if(Z.type==="document")Z.end=X.start;else Z.items.push({start:X.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(r9(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($),X;if(q.end)X=q.end,X.push(this.sourceToken),delete q.end;else X=[this.sourceToken];let Q={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}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(`
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 X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}TU.Lexer=s9});var D2=D((LU)=>{class o9{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let Q=$+Z>>1;if(this.lineStarts[Q]<q)$=Q+1;else Z=Q}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let X=this.lineStarts[$-1];return{line:$,col:q-X+1}}}}LU.LineCounter=o9});var w2=D((MU)=>{var KU=h("process"),r9=eq(),RU=A2();function G0(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function t9(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function q4(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $$(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function S0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function e9(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!G0($.start,"explicit-key-ind")&&!G0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,q4($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class $4{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new RU.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,KU.env.LOG_TOKENS)console.log("|",r9.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=r9.tokenType(q);if(!$){let Z=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:Z,source:q}),this.offset+=q.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let Z=this.peek(1);if($.type==="block-scalar")$.indent="indent"in Z?Z.indent:0;else if($.type==="flow-collection"&&Z.type==="document")$.indent=0;if($.type==="flow-collection")e9($);switch(Z.type){case"document":Z.value=$;break;case"block-scalar":Z.props.push($);break;case"block-map":{let X=Z.items[Z.items.length-1];if(X.value){Z.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=$;else{Object.assign(X,{key:$,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=Z.items[Z.items.length-1];if(X.value)Z.items.push({start:[],value:$});else X.value=$;break}case"flow-collection":{let X=Z.items[Z.items.length-1];if(!X||X.value)Z.items.push({start:[],key:$,sep:[]});else if(X.sep)X.value=$;else Object.assign(X,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let X=$.items[$.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&t9(X.start)===-1&&($.indent===0||X.start.every((Q)=>Q.type!=="comment"||Q.indent<$.indent))){if(Z.type==="document")Z.end=X.start;else Z.items.push({start:X.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(t9(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=$$(this.peek(2)),Z=S0($),X;if(q.end)X=q.end,X.push(this.sourceToken),delete q.end;else X=[this.sourceToken];let Q={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}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 X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",Q=[];if(X&&$.sep&&!$.value){let U=[];for(let z=0;z<$.sep.length;++z){let G=$.sep[z];switch(G.type){case"newline":U.push(z);break;case"space":break;case"comment":if(G.indent>q.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)Q=$.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(X||$.value)Q.push(this.sourceToken),q.items.push({start:Q}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(X||$.value)Q.push(this.sourceToken),q.items.push({start:Q,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(G0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let U=S0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(G0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]});else if(e9($.key)&&!G0($.sep,"newline")){let U=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:U,key:z,sep:G}]})}else if(Q.length>0)$.sep=$.sep.concat(Q,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||X)q.items.push({start:Q,key:null,sep:[this.sourceToken]});else if(G0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(X||$.value)q.items.push({start:Q,key:U,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(U);else Object.assign($,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue(q);if(U){if(U.type==="block-seq"){if(!$.explicitKey&&$.sep&&!G0($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Z)q.items.push({start:Q});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||G0($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let Z=this.startBlockValue(q);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:X,sep:[]});else if($.sep)this.stack.push(X);else Object.assign($,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===q.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let X=$$(Z),Q=S0(X);t9(q);let U=q.end.splice(1,q.end.length);U.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Q,key:q,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=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 X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",Q=[];if(X&&$.sep&&!$.value){let U=[];for(let z=0;z<$.sep.length;++z){let G=$.sep[z];switch(G.type){case"newline":U.push(z);break;case"space":break;case"comment":if(G.indent>q.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)Q=$.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(X||$.value)Q.push(this.sourceToken),q.items.push({start:Q}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(X||$.value)Q.push(this.sourceToken),q.items.push({start:Q,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(G0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let U=S0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(G0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]});else if(q4($.key)&&!G0($.sep,"newline")){let U=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:U,key:z,sep:G}]})}else if(Q.length>0)$.sep=$.sep.concat(Q,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||X)q.items.push({start:Q,key:null,sep:[this.sourceToken]});else if(G0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(X||$.value)q.items.push({start:Q,key:U,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(U);else Object.assign($,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue(q);if(U){if(U.type==="block-seq"){if(!$.explicitKey&&$.sep&&!G0($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Z)q.items.push({start:Q});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||G0($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let Z=this.startBlockValue(q);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:X,sep:[]});else if($.sep)this.stack.push(X);else Object.assign($,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===q.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let X=$$(Z),Q=S0(X);e9(q);let U=q.end.splice(1,q.end.length);U.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Q,key:q,sep:U}]};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()}}}RU.Parser=q4});var U4=D((bU)=>{var $4=_2(),MU=Zq(),Jq=Xq(),DU=D$(),wU=S(),PU=D2(),Z4=w2();function X4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new PU.LineCounter||null,prettyErrors:$}}function NU(q,$={}){let{lineCounter:Z,prettyErrors:X}=X4($),Q=new Z4.Parser(Z?.addNewLine),U=new $4.Composer($),z=Array.from(U.compose(Q.parse(q)));if(X&&Z)for(let G of z)G.errors.forEach(Jq.prettifyError(q,Z)),G.warnings.forEach(Jq.prettifyError(q,Z));if(z.length>0)return z;return Object.assign([],{empty:!0},U.streamInfo())}function Q4(q,$={}){let{lineCounter:Z,prettyErrors:X}=X4($),Q=new Z4.Parser(Z?.addNewLine),U=new $4.Composer($),z=null;for(let G of U.compose(Q.parse(q),!0,q.length))if(!z)z=G;else if(z.options.logLevel!=="silent"){z.errors.push(new Jq.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&Z)z.errors.forEach(Jq.prettifyError(q,Z)),z.warnings.forEach(Jq.prettifyError(q,Z));return z}function jU(q,$,Z){let X=void 0;if(typeof $==="function")X=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let Q=Q4(q,Z);if(!Q)return null;if(Q.warnings.forEach((U)=>DU.warn(Q.options.logLevel,U)),Q.errors.length>0)if(Q.options.logLevel!=="silent")throw Q.errors[0];else Q.errors=[];return Q.toJS(Object.assign({reviver:X},Z))}function CU(q,$,Z){let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let Q=Math.round(Z);Z=Q<1?void 0:Q>8?{indent:8}:{indent:Q}}if(q===void 0){let{keepUndefined:Q}=Z??$??{};if(!Q)return}if(wU.isDocument(q)&&!X)return q.toString(Z);return new MU.Document(q,X,Z).toString(Z)}bU.parse=jU;bU.parseAllDocuments=NU;bU.parseDocument=Q4;bU.stringify=CU});import{execFile as U8}from"child_process";import{promisify as z8}from"util";import{mkdtemp as u2,readdir as G8,readFile as B$,rm as Bq,cp as J8,access as m2,stat as Y8,lstat as H8,symlink as V8,mkdir as W8}from"fs/promises";import{join as r,resolve as p2,relative as B8,basename as _8}from"path";import{homedir as d2}from"os";import{tmpdir as c2}from"os";import{readdir as t4,readFile as e4,stat as q8}from"fs/promises";import{join as $8}from"path";var Z8=new Set([".png",".jpg",".jpeg",".gif",".ico",".bmp",".webp",".mp3",".mp4",".wav",".avi",".mov",".zip",".tar",".gz",".bz2",".7z",".exe",".dll",".so",".dylib",".woff",".woff2",".ttf",".eot",".pdf",".doc",".docx"]),X8=524288;async function Hq(q){let $=[];async function Z(X,Q){let U;try{U=await t4(X)}catch{return}for(let z of U){if(z===".git"||z==="node_modules")continue;let G=$8(X,z),J=Q?`${Q}/${z}`:z;try{let Y=await q8(G);if(Y.isDirectory())await Z(G,J);else if(Y.isFile()){let B=z.includes(".")?`.${z.split(".").pop().toLowerCase()}`:"";if(Z8.has(B))continue;if(Y.size>X8)continue;try{let V=await e4(G,"utf-8");$.push({relPath:J,content:V,lineCount:V.split(`
141
- `).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class v2{selected;cursor;scrollOffset;pageSize;itemCount;filter;searchActive;filteredMap;constructor(q,$){this.selected=q.map((Z)=>Z.checked),this.cursor=1,this.scrollOffset=0,this.pageSize=$,this.itemCount=q.length,this.filter="",this.searchActive=!1,this.filteredMap=q.map((Z,X)=>X)}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((X)=>this.selected[X]);for(let X of q)this.selected[X]=Z}moveUp(){if(this.cursor>0)this.cursor--;else this.cursor=this.totalRows-1;this.adjustScroll()}moveDown(){if(this.cursor<this.totalRows-1)this.cursor++;else this.cursor=0;this.adjustScroll()}getSelectedIndices(){let q=[];for(let $=0;$<this.selected.length;$++)if(this.selected[$])q.push($);return q}getVisibleRange(){let q=this.scrollOffset,$=Math.min(this.scrollOffset+this.pageSize,this.totalRows);return{start:q,end:$}}adjustScroll(){if(this.cursor<this.scrollOffset)this.scrollOffset=this.cursor;else if(this.cursor>=this.scrollOffset+this.pageSize)this.scrollOffset=this.cursor-this.pageSize+1}}function Q8(q,$,Z){let X=[];if(q.searchActive||q.filter!==""){let Y=H.cyan("/"),B=q.filter,V=q.searchActive?H.cyan("█"):"";if(X.push(` ${Y}${B}${V}`),q.filteredMap.length===0)X.push(H.dim(" No matches found"));X.push("")}let{start:Q,end:U}=q.getVisibleRange();if(Q>0)X.push(H.dim(` ... ${Q} more above`));for(let Y=Q;Y<U;Y++){let V=Y===q.cursor?H.cyan(">"):" ";if(Y===0){let W=q.filteredMap,F=W.length>0&&W.every((O)=>q.selected[O])?H.green("[*]"):"[ ]",_=q.filter!==""?`Select All Matching (${q.filteredMap.length})`:"Select All / Deselect All";X.push(`${V} ${F} ${H.bold(_)}`)}else{let W=q.filteredMap[Y-1],T=$[W],_=q.selected[W]?H.green("[*]"):"[ ]",O=`${V} ${_} `,R=7,A=H.bold(T.label),M=T.label.length;if(T.hint){let w=Z-7-M-2;if(w>10){let L=H$(T.hint,w);X.push(`${O}${A} ${H.dim(L)}`)}else{let L=H$(T.label,Z-7);X.push(`${O}${H.bold(L)}`)}}else{let w=H$(T.label,Z-7);X.push(`${O}${H.bold(w)}`)}}}let z=q.totalRows-U;if(z>0)X.push(H.dim(` ... ${z} more below`));let G=q.getSelectedIndices().length,J=q.filter!==""?` matching: ${q.filteredMap.length}/${q.itemCount}`:"";if(X.push(""),q.searchActive)X.push(H.dim(` ${G} of ${q.itemCount} selected${J} | Type to filter Esc Clear Enter Done searching`));else X.push(H.dim(` ${G} of ${q.itemCount} selected${J} | `+"↑/↓ Navigate Space Toggle a All / Search Enter Confirm Esc Cancel"));return X}function H$(q,$){if($<=0)return"";if(q.length<=$)return q;if($<=3)return q.slice(0,$);return q.slice(0,$-3)+"..."}async function Vq(q){let{items:$}=q,Z=q.pageSize??Math.min($.length+1,15),X=new v2($,Z),Q=process.stderr,U=process.stdin,z=Q.columns||80;if(typeof U.setRawMode==="function")U.setRawMode(!0);U.resume(),U.setEncoding("utf-8"),Q.write("\x1B[?25l");let G=0;function J(){let Y=Q8(X,$,z);if(G>0)Q.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]:""}
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()}}}MU.Parser=$4});var z4=D((SU)=>{var Z4=_2(),DU=Zq(),Jq=Xq(),wU=D$(),PU=S(),NU=D2(),X4=w2();function Q4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new NU.LineCounter||null,prettyErrors:$}}function jU(q,$={}){let{lineCounter:Z,prettyErrors:X}=Q4($),Q=new X4.Parser(Z?.addNewLine),U=new Z4.Composer($),z=Array.from(U.compose(Q.parse(q)));if(X&&Z)for(let G of z)G.errors.forEach(Jq.prettifyError(q,Z)),G.warnings.forEach(Jq.prettifyError(q,Z));if(z.length>0)return z;return Object.assign([],{empty:!0},U.streamInfo())}function U4(q,$={}){let{lineCounter:Z,prettyErrors:X}=Q4($),Q=new X4.Parser(Z?.addNewLine),U=new Z4.Composer($),z=null;for(let G of U.compose(Q.parse(q),!0,q.length))if(!z)z=G;else if(z.options.logLevel!=="silent"){z.errors.push(new Jq.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&Z)z.errors.forEach(Jq.prettifyError(q,Z)),z.warnings.forEach(Jq.prettifyError(q,Z));return z}function CU(q,$,Z){let X=void 0;if(typeof $==="function")X=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let Q=U4(q,Z);if(!Q)return null;if(Q.warnings.forEach((U)=>wU.warn(Q.options.logLevel,U)),Q.errors.length>0)if(Q.options.logLevel!=="silent")throw Q.errors[0];else Q.errors=[];return Q.toJS(Object.assign({reviver:X},Z))}function bU(q,$,Z){let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let Q=Math.round(Z);Z=Q<1?void 0:Q>8?{indent:8}:{indent:Q}}if(q===void 0){let{keepUndefined:Q}=Z??$??{};if(!Q)return}if(PU.isDocument(q)&&!X)return q.toString(Z);return new DU.Document(q,X,Z).toString(Z)}SU.parse=CU;SU.parseAllDocuments=jU;SU.parseDocument=U4;SU.stringify=bU});import{execFile as z8}from"child_process";import{promisify as G8}from"util";import{mkdtemp as u2,readdir as J8,readFile as B$,rm as Bq,cp as Y8,access as m2,stat as H8,lstat as V8,symlink as W8,mkdir as B8}from"fs/promises";import{join as r,resolve as p2,relative as _8,basename as O8}from"path";import{homedir as d2}from"os";import{tmpdir as c2}from"os";import{readdir as e4,readFile as q8,stat as $8}from"fs/promises";import{join as Z8}from"path";var X8=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"]),Q8=524288;async function Hq(q){let $=[];async function Z(X,Q){let U;try{U=await e4(X)}catch{return}for(let z of U){if(z===".git"||z==="node_modules")continue;let G=Z8(X,z),J=Q?`${Q}/${z}`:z;try{let Y=await $8(G);if(Y.isDirectory())await Z(G,J);else if(Y.isFile()){let B=z.includes(".")?`.${z.split(".").pop().toLowerCase()}`:"";if(X8.has(B))continue;if(Y.size>Q8)continue;try{let V=await q8(G,"utf-8");$.push({relPath:J,content:V,lineCount:V.split(`
141
+ `).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class v2{selected;cursor;scrollOffset;pageSize;itemCount;filter;searchActive;filteredMap;constructor(q,$){this.selected=q.map((Z)=>Z.checked),this.cursor=1,this.scrollOffset=0,this.pageSize=$,this.itemCount=q.length,this.filter="",this.searchActive=!1,this.filteredMap=q.map((Z,X)=>X)}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((X)=>this.selected[X]);for(let X of q)this.selected[X]=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 U8(q,$,Z){let X=[];if(q.searchActive||q.filter!==""){let Y=H.cyan("/"),B=q.filter,V=q.searchActive?H.cyan("█"):"";if(X.push(` ${Y}${B}${V}`),q.filteredMap.length===0)X.push(H.dim(" No matches found"));X.push("")}let{start:Q,end:U}=q.getVisibleRange();if(Q>0)X.push(H.dim(` ... ${Q} more above`));for(let Y=Q;Y<U;Y++){let V=Y===q.cursor?H.cyan(">"):" ";if(Y===0){let W=q.filteredMap,F=W.length>0&&W.every((O)=>q.selected[O])?H.green("[*]"):"[ ]",_=q.filter!==""?`Select All Matching (${q.filteredMap.length})`:"Select All / Deselect All";X.push(`${V} ${F} ${H.bold(_)}`)}else{let W=q.filteredMap[Y-1],T=$[W],_=q.selected[W]?H.green("[*]"):"[ ]",O=`${V} ${_} `,R=7,M=H.bold(T.label),A=T.label.length;if(T.hint){let w=Z-7-A-2;if(w>10){let L=H$(T.hint,w);X.push(`${O}${M} ${H.dim(L)}`)}else{let L=H$(T.label,Z-7);X.push(`${O}${H.bold(L)}`)}}else{let w=H$(T.label,Z-7);X.push(`${O}${H.bold(w)}`)}}}let z=q.totalRows-U;if(z>0)X.push(H.dim(` ... ${z} more below`));let G=q.getSelectedIndices().length,J=q.filter!==""?` matching: ${q.filteredMap.length}/${q.itemCount}`:"";if(X.push(""),q.searchActive)X.push(H.dim(` ${G} of ${q.itemCount} selected${J} | Type to filter Esc Clear Enter Done searching`));else X.push(H.dim(` ${G} of ${q.itemCount} selected${J} | `+"↑/↓ Navigate Space Toggle a All / Search Enter Confirm Esc Cancel"));return X}function H$(q,$){if($<=0)return"";if(q.length<=$)return q;if($<=3)return q.slice(0,$);return q.slice(0,$-3)+"..."}async function Vq(q){let{items:$}=q,Z=q.pageSize??Math.min($.length+1,15),X=new v2($,Z),Q=process.stderr,U=process.stdin,z=Q.columns||80;if(typeof U.setRawMode==="function")U.setRawMode(!0);U.resume(),U.setEncoding("utf-8"),Q.write("\x1B[?25l");let G=0;function J(){let Y=U8(X,$,z);if(G>0)Q.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
142
  `;Q.write(V),G=B}return J(),new Promise((Y)=>{let B="",V=null;function W(){if(U.removeListener("data",_),typeof U.setRawMode==="function")U.setRawMode(!1);if(U.pause(),Q.write("\x1B[?25h"),V)clearTimeout(V)}function T(O){W(),Y(O)}function F(O){if(X.searchActive){if(O==="\x1B"){X.searchActive=!1,X.filter="",X.applyFilter($),J();return}if(O==="\r"||O===`
143
143
  `){X.searchActive=!1,J();return}if(O===""||O==="\b"){if(X.filter.length>0)X.filter=X.filter.slice(0,-1),X.applyFilter($);else X.searchActive=!1;J();return}if(O==="\x03"){W(),process.kill(process.pid,"SIGINT");return}if(O==="\x1B[A"){X.moveUp(),J();return}if(O==="\x1B[B"){X.moveDown(),J();return}if(O===" "){X.toggleCurrent(),J();return}if(O.length===1&&O>=" "&&O<="~"){X.filter+=O,X.applyFilter($),J();return}return}switch(O){case"\x1B[A":case"k":X.moveUp(),J();break;case"\x1B[B":case"j":X.moveDown(),J();break;case" ":X.toggleCurrent(),J();break;case"a":X.toggleAll(),J();break;case"/":X.searchActive=!0,J();break;case"\r":case`
144
- `:T(X.getSelectedIndices());break;case"\x1B":if(X.filter!=="")X.filter="",X.applyFilter($),J();else T([]);break;case"":case"\b":if(X.filter.length>0)X.filter=X.filter.slice(0,-1),X.applyFilter($),J();break;case"\x03":W(),process.kill(process.pid,"SIGINT");break}}function _(O){if(B.length>0){if(B+=O,V)clearTimeout(V);if(B.length>=3&&B[1]==="["){let A=B.slice(0,3),M=B.slice(3);if(B="",F(A),M)_(M);return}let R=B;B="",F("\x1B");for(let A=1;A<R.length;A++)F(R[A]);return}for(let R=0;R<O.length;R++){let A=O[R];if(A==="\x1B"){let M=O.slice(R);if(M.length>=3&&M[1]==="[")F(M.slice(0,3)),R+=2;else if(M.length>=2){B=M,V=setTimeout(()=>{let w=B;B="",F("\x1B");for(let L=1;L<w.length;L++)F(w[L])},50);return}else{B="\x1B",V=setTimeout(()=>{B="",F("\x1B")},50);return}}else F(A)}}U.on("data",_)})}var y0=z8(U8),O8=/^[a-zA-Z0-9_-]+$/,T8=/^[a-zA-Z0-9._-]+$/,F8=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,l2=128,L8=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\/tree\/(.+))?\/?$/;function I8(q){return q.startsWith("/")||q.startsWith("./")||q.startsWith("../")||q.startsWith("~/")||q==="~"||q==="."||q===".."}function K8(q){let $;if(q==="~")$=d2();else if(q.startsWith("~/"))$=p2(d2(),q.slice(2));else $=p2(q);let Z=_8($);return f(`install: parsed local source -> path=${$}`),{owner:"local",repo:Z,ref:null,subpath:null,cloneUrl:"",sshCloneUrl:"",isLocal:!0,localPath:$}}function x0(q){if(I8(q))return K8(q);let $=L8.exec(q);if($){let[,V,W,T]=$,F=W.endsWith(".git")?W.slice(0,-4):W;q=`github:${V}/${F}${T?`#${T}`:""}`}if(!q.startsWith("github:"))throw Error(`Invalid source format. Got: "${q}"
144
+ `:T(X.getSelectedIndices());break;case"\x1B":if(X.filter!=="")X.filter="",X.applyFilter($),J();else T([]);break;case"":case"\b":if(X.filter.length>0)X.filter=X.filter.slice(0,-1),X.applyFilter($),J();break;case"\x03":W(),process.kill(process.pid,"SIGINT");break}}function _(O){if(B.length>0){if(B+=O,V)clearTimeout(V);if(B.length>=3&&B[1]==="["){let M=B.slice(0,3),A=B.slice(3);if(B="",F(M),A)_(A);return}let R=B;B="",F("\x1B");for(let M=1;M<R.length;M++)F(R[M]);return}for(let R=0;R<O.length;R++){let M=O[R];if(M==="\x1B"){let A=O.slice(R);if(A.length>=3&&A[1]==="[")F(A.slice(0,3)),R+=2;else if(A.length>=2){B=A,V=setTimeout(()=>{let w=B;B="",F("\x1B");for(let L=1;L<w.length;L++)F(w[L])},50);return}else{B="\x1B",V=setTimeout(()=>{B="",F("\x1B")},50);return}}else F(M)}}U.on("data",_)})}var y0=G8(z8),T8=/^[a-zA-Z0-9_-]+$/,F8=/^[a-zA-Z0-9._-]+$/,L8=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,l2=128,I8=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\/tree\/(.+))?\/?$/;function K8(q){return q.startsWith("/")||q.startsWith("./")||q.startsWith("../")||q.startsWith("~/")||q==="~"||q==="."||q===".."}function R8(q){let $;if(q==="~")$=d2();else if(q.startsWith("~/"))$=p2(d2(),q.slice(2));else $=p2(q);let Z=O8($);return f(`install: parsed local source -> path=${$}`),{owner:"local",repo:Z,ref:null,subpath:null,cloneUrl:"",sshCloneUrl:"",isLocal:!0,localPath:$}}function x0(q){if(K8(q))return R8(q);let $=I8.exec(q);if($){let[,V,W,T]=$,F=W.endsWith(".git")?W.slice(0,-4):W;q=`github:${V}/${F}${T?`#${T}`:""}`}if(!q.startsWith("github:"))throw Error(`Invalid source format. Got: "${q}"
145
145
  Supported formats:
146
146
  github:owner/repo[#ref]
147
147
  github:owner/repo#ref:path
148
148
  https://github.com/owner/repo
149
149
  https://github.com/owner/repo/tree/branch/path/to/skill
150
150
  /path/to/local/skill
151
- ./relative/path/to/skill`);let Z=q.slice(7),X=Z.indexOf("#"),Q,U=null,z=null;if(X!==-1){Q=Z.slice(0,X);let V=Z.slice(X+1);if(!V)throw Error("Invalid source: ref cannot be empty after #");let W=V.indexOf(":");if(W!==-1){if(U=V.slice(0,W),!U)throw Error("Invalid source: ref cannot be empty before :");z=V.slice(W+1)||null}else U=V}else{let V=Z.indexOf(":");if(V!==-1)Q=Z.slice(0,V),z=Z.slice(V+1)||null;else Q=Z}let G=Q.indexOf("/");if(G===-1)throw Error(`Invalid source: format must be github:owner/repo. Got: "${q}"`);let J=Q.slice(0,G),Y=Q.slice(G+1);if(!J)throw Error("Invalid source: owner cannot be empty");if(!Y)throw Error("Invalid source: repo cannot be empty");if(!O8.test(J))throw Error(`Invalid source: owner contains invalid characters: "${J}". Allowed: [a-zA-Z0-9_-]`);if(!T8.test(Y))throw Error(`Invalid source: repo contains invalid characters: "${Y}". Allowed: [a-zA-Z0-9._-]`);let B={owner:J,repo:Y,ref:U,subpath:z,cloneUrl:`https://github.com/${J}/${Y}.git`,sshCloneUrl:`git@github.com:${J}/${Y}.git`};return f(`install: parsed source -> owner=${J} repo=${Y} ref=${U} subpath=${z}`),B}async function _$(q){if(q.subpath!==null||!q.ref||!q.ref.includes("/"))return q;try{let{stdout:$}=await y0("git",["ls-remote","--heads","--tags",q.cloneUrl],{timeout:15000}),Z=new Set;for(let Q of $.split(`
152
- `)){let U=Q.match(/\trefs\/(?:heads|tags)\/(.+)$/);if(U)Z.add(U[1])}let X=q.ref.split("/");for(let Q=1;Q<X.length;Q++){let U=X.slice(0,Q).join("/");if(Z.has(U)){let z=X.slice(Q).join("/");return f(`install: resolved ref="${U}" subpath="${z}"`),{...q,ref:U,subpath:z||null}}}}catch($){f(`install: ls-remote failed, treating entire ref as branch: ${$}`)}return q}function g0(q){if(!q)throw Error("Invalid skill name: name cannot be empty");if(q.includes("\x00"))throw Error("Invalid skill name: contains unsafe characters (null byte)");if(q.includes(".."))throw Error("Invalid skill name: contains unsafe characters (..)");if(q.includes("/")||q.includes("\\"))throw Error("Invalid skill name: contains unsafe characters (path separator)");if(q.startsWith("."))throw Error("Invalid skill name: must not start with a dot");if(q.length>l2)throw Error(`Invalid skill name: exceeds maximum length of ${l2} characters`);if(!F8.test(q))throw Error(`Invalid skill name: "${q}" does not match allowed pattern [a-zA-Z0-9][a-zA-Z0-9._-]*`);return q}function R8(q){let $=q.split("/").filter(Boolean),Z=$.length>0?$[$.length-1]:q;return g0(Z)}function i2(q){let $=new Map;for(let Z of q){let X=R8(Z),Q=$.get(X);if(Q)Q.push(Z);else $.set(X,[Z])}return[...$.entries()].filter(([,Z])=>Z.length>1).map(([Z,X])=>({name:Z,paths:X}))}async function k0(){try{await y0("git",["--version"]),f("install: git available")}catch{throw Error("git is required for installing skills. Install git from https://git-scm.com")}}function A8(q){if(q.killed)return!1;let $=(q.stderr||q.message||"").toLowerCase();return $.includes("authentication failed")||$.includes("could not read username")||$.includes("repository not found")||$.includes("returned error: 403")||$.includes("returned error: 401")||$.includes("terminal prompts disabled")||$.includes("permission denied")}function Wq(q){return q.killed?"Clone timed out after 60 seconds":`Clone failed: ${q.stderr||q.message}`}async function V$(q,$,Z){let X=["clone","--depth","1"];if($)X.push("--branch",$);return X.push(q,Z),await y0("git",X,{timeout:60000}),Z}async function h0(q,$="auto"){f(`install: cloning ${q.owner}/${q.repo}${q.ref?` (ref: ${q.ref})`:""} (transport: ${$})`);let Z=await u2(r(c2(),"asm-install-"));if($==="ssh"||$==="https"){let X=$==="ssh"?q.sshCloneUrl:q.cloneUrl;try{return await V$(X,q.ref,Z)}catch(Q){throw await a(Z),Error(Wq(Q))}}try{return await V$(q.cloneUrl,q.ref,Z)}catch(X){if(!A8(X))throw await a(Z),Error(Wq(X));f("install: HTTPS clone failed with auth error, retrying with SSH..."),await a(Z);let Q=await u2(r(c2(),"asm-install-"));try{return await V$(q.sshCloneUrl,q.ref,Q)}catch(U){throw await a(Q),Error(`Clone failed with both transports:
151
+ ./relative/path/to/skill`);let Z=q.slice(7),X=Z.indexOf("#"),Q,U=null,z=null;if(X!==-1){Q=Z.slice(0,X);let V=Z.slice(X+1);if(!V)throw Error("Invalid source: ref cannot be empty after #");let W=V.indexOf(":");if(W!==-1){if(U=V.slice(0,W),!U)throw Error("Invalid source: ref cannot be empty before :");z=V.slice(W+1)||null}else U=V}else{let V=Z.indexOf(":");if(V!==-1)Q=Z.slice(0,V),z=Z.slice(V+1)||null;else Q=Z}let G=Q.indexOf("/");if(G===-1)throw Error(`Invalid source: format must be github:owner/repo. Got: "${q}"`);let J=Q.slice(0,G),Y=Q.slice(G+1);if(!J)throw Error("Invalid source: owner cannot be empty");if(!Y)throw Error("Invalid source: repo cannot be empty");if(!T8.test(J))throw Error(`Invalid source: owner contains invalid characters: "${J}". Allowed: [a-zA-Z0-9_-]`);if(!F8.test(Y))throw Error(`Invalid source: repo contains invalid characters: "${Y}". Allowed: [a-zA-Z0-9._-]`);let B={owner:J,repo:Y,ref:U,subpath:z,cloneUrl:`https://github.com/${J}/${Y}.git`,sshCloneUrl:`git@github.com:${J}/${Y}.git`};return f(`install: parsed source -> owner=${J} repo=${Y} ref=${U} subpath=${z}`),B}async function _$(q){if(q.subpath!==null||!q.ref||!q.ref.includes("/"))return q;try{let{stdout:$}=await y0("git",["ls-remote","--heads","--tags",q.cloneUrl],{timeout:15000}),Z=new Set;for(let Q of $.split(`
152
+ `)){let U=Q.match(/\trefs\/(?:heads|tags)\/(.+)$/);if(U)Z.add(U[1])}let X=q.ref.split("/");for(let Q=1;Q<X.length;Q++){let U=X.slice(0,Q).join("/");if(Z.has(U)){let z=X.slice(Q).join("/");return f(`install: resolved ref="${U}" subpath="${z}"`),{...q,ref:U,subpath:z||null}}}}catch($){f(`install: ls-remote failed, treating entire ref as branch: ${$}`)}return q}function g0(q){if(!q)throw Error("Invalid skill name: name cannot be empty");if(q.includes("\x00"))throw Error("Invalid skill name: contains unsafe characters (null byte)");if(q.includes(".."))throw Error("Invalid skill name: contains unsafe characters (..)");if(q.includes("/")||q.includes("\\"))throw Error("Invalid skill name: contains unsafe characters (path separator)");if(q.startsWith("."))throw Error("Invalid skill name: must not start with a dot");if(q.length>l2)throw Error(`Invalid skill name: exceeds maximum length of ${l2} characters`);if(!L8.test(q))throw Error(`Invalid skill name: "${q}" does not match allowed pattern [a-zA-Z0-9][a-zA-Z0-9._-]*`);return q}function M8(q){let $=q.split("/").filter(Boolean),Z=$.length>0?$[$.length-1]:q;return g0(Z)}function a2(q){let $=new Map;for(let Z of q){let X=M8(Z),Q=$.get(X);if(Q)Q.push(Z);else $.set(X,[Z])}return[...$.entries()].filter(([,Z])=>Z.length>1).map(([Z,X])=>({name:Z,paths:X}))}async function h0(){try{await y0("git",["--version"]),f("install: git available")}catch{throw Error("git is required for installing skills. Install git from https://git-scm.com")}}function A8(q){if(q.killed)return!1;let $=(q.stderr||q.message||"").toLowerCase();return $.includes("authentication failed")||$.includes("could not read username")||$.includes("repository not found")||$.includes("returned error: 403")||$.includes("returned error: 401")||$.includes("terminal prompts disabled")||$.includes("permission denied")}function Wq(q){return q.killed?"Clone timed out after 60 seconds":`Clone failed: ${q.stderr||q.message}`}async function V$(q,$,Z){let X=["clone","--depth","1"];if($)X.push("--branch",$);return X.push(q,Z),await y0("git",X,{timeout:60000}),Z}async function k0(q,$="auto"){f(`install: cloning ${q.owner}/${q.repo}${q.ref?` (ref: ${q.ref})`:""} (transport: ${$})`);let Z=await u2(r(c2(),"asm-install-"));if($==="ssh"||$==="https"){let X=$==="ssh"?q.sshCloneUrl:q.cloneUrl;try{return await V$(X,q.ref,Z)}catch(Q){throw await a(Z),Error(Wq(Q))}}try{return await V$(q.cloneUrl,q.ref,Z)}catch(X){if(!A8(X))throw await a(Z),Error(Wq(X));f("install: HTTPS clone failed with auth error, retrying with SSH..."),await a(Z);let Q=await u2(r(c2(),"asm-install-"));try{return await V$(q.sshCloneUrl,q.ref,Q)}catch(U){throw await a(Q),Error(`Clone failed with both transports:
153
153
  HTTPS: ${Wq(X)}
154
- SSH: ${Wq(U)}`)}}}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 X=L0(Z),Q=q.split("/").pop()||"unknown",U=X.name||Q,z=I0(X);return f(`install: validated skill "${U}" v${z}`),{name:U,version:z,description:(X.description||"").replace(/\s*\n\s*/g," ").trim(),effort:X.effort||X["metadata.effort"]||void 0}}async function _q(q,$=3){let Z=[];async function X(Q,U,z){let G;try{G=await G8(Q)}catch{return}for(let J of G){if(J===".git"||J==="node_modules")continue;let Y=r(Q,J);try{if(!(await Y8(Y)).isDirectory())continue}catch{continue}let B=U?`${U}/${J}`:J,V=z+1,W=r(Y,"SKILL.md");try{let T=await B$(W,"utf-8"),F=L0(T);Z.push({relPath:B,name:F.name||J,version:I0(F),description:(F.description||"").replace(/\s*\n\s*/g," ").trim(),effort:F.effort||F["metadata.effort"]||void 0,license:(F.license||"").trim(),creator:(F["metadata.creator"]||"").trim()})}catch{if(V<$)await X(Y,B,V)}}}return await X(q,"",0),Z.sort((Q,U)=>Q.name.localeCompare(U.name)),Z}var M8=[{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 a2(q){let $=[],Z=await Hq(q);for(let{relPath:X,content:Q}of Z){let U=Q.split(`
155
- `);for(let z=0;z<U.length;z++)for(let{category:G,pattern:J}of M8)if(J.test(U[z])){let Y=U[z].trim();$.push({category:G,file:X,line:z+1,match:Y.length>100?Y.slice(0,100)+"…":Y})}}return $}async function O$(q){let $=q.source.isLocal?`local:${q.source.localPath}`:`github:${q.source.owner}/${q.source.repo}${q.source.ref?`#${q.source.ref}`:""}${q.source.subpath?`:${q.source.subpath}`:""}`;if(q.force)try{await m2(q.targetDir),await Bq(q.targetDir,{recursive:!0,force:!0})}catch{}let Z=q.sourceDir;try{await J8(Z,q.targetDir,{recursive:!0})}catch(G){throw Error(`Failed to install: ${G.message}`)}let X=r(q.targetDir,".git");try{await Bq(X,{recursive:!0,force:!0})}catch{}f(`install: copied files to ${q.targetDir}`);let Q=r(q.targetDir,"SKILL.md");try{await m2(Q)}catch{throw Error("Installation verification failed: SKILL.md not found at target")}let U=await B$(Q,"utf-8"),z=L0(U);return{success:!0,path:q.targetDir,name:z.name||q.skillName,version:I0(z),provider:q.providerLabel,source:$}}async function n2(q,$){let Z=await O$(q);for(let X of $){if(X.name===q.providerName)continue;let Q=W$(X.global),U=r(Q,q.skillName);await W8(Q,{recursive:!0});try{if((await H8(U)).isSymbolicLink())await Bq(U);else{f(`install: skipping ${U} — existing non-symlink directory`);continue}}catch{}let z=B8(Q,q.targetDir);await V8(z,U,"dir"),f(`install: symlinked ${U} -> ${z}`)}return Z.provider=`All (${$.map((X)=>X.label).join(", ")})`,Z}async function a(q){try{await Bq(q,{recursive:!0,force:!0})}catch{}}async function s2(){try{await y0("npx",["--version"]),f("install: npx available")}catch{throw Error("npx is required for Vercel method installation. Install Node.js from https://nodejs.org")}}async function o2(q,$){let Z=["--yes","skills","add",q];if($)Z.push("--skill",$);f(`install: running npx ${Z.join(" ")}`);try{let X=await y0("npx",Z,{timeout:120000});return{stdout:X.stdout,stderr:X.stderr}}catch(X){let Q=X.stderr||X.message||"";throw Error(`npx skills add failed: ${Q}`)}}function r2(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 X=q.providers.filter((J)=>J.enabled);if($==="all"){if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");return{provider:X.find((Y)=>Y.name==="agents")||X[0],allProviders:X}}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(X.length===1)return{provider:X[0],allProviders:null};if(!Z){if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");let J=X.map((Y)=>Y.name).join(", ");throw Error(`--tool (or --provider) is required in non-interactive mode. Available: ${J}, all`)}let Q=q.providers.map((J)=>({label:`${J.label} (${J.name})`,hint:J.global,checked:J.enabled})),U=await Vq({items:Q});if(U.length===0)throw Error("No tools selected. Aborting.");let z=U.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 t2(q,$,Z,X,Q,U){let z=W$(Q.global),G=r(z,X);return{source:q,tempDir:$,sourceDir:Z,targetDir:G,skillName:X,force:U,providerName:Q.name,providerLabel:Q.label}}import{readFile as Iz}from"fs/promises";import{join as Kz}from"path";var xU=_2(),gU=Zq(),kU=t$(),P2=Xq(),hU=m0(),J0=S(),vU=X0(),uU=x(),mU=U0(),pU=z0(),AY=eq(),dU=M2(),cU=D2(),lU=w2(),Z$=U4(),z4=v0();var iU=xU.Composer,aU=gU.Document,nU=kU.Schema,sU=P2.YAMLError,oU=P2.YAMLParseError,rU=P2.YAMLWarning,tU=hU.Alias,eU=J0.isAlias,qz=J0.isCollection,$z=J0.isDocument,Zz=J0.isMap,Xz=J0.isNode,Qz=J0.isPair,Uz=J0.isScalar,zz=J0.isSeq,Gz=vU.Pair,Jz=uU.Scalar,Yz=mU.YAMLMap,Hz=pU.YAMLSeq;var Vz=dU.Lexer,Wz=cU.LineCounter,Bz=lU.Parser,N2=Z$.parse,_z=Z$.parseAllDocuments,Oz=Z$.parseDocument,Tz=Z$.stringify,Fz=z4.visit,Lz=z4.visitAsync;var G4=500;function Rz(q){let $=q.split(`
154
+ SSH: ${Wq(U)}`)}}}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 X=L0(Z),Q=q.split("/").pop()||"unknown",U=X.name||Q,z=I0(X);return f(`install: validated skill "${U}" v${z}`),{name:U,version:z,description:(X.description||"").replace(/\s*\n\s*/g," ").trim(),effort:X.effort||X["metadata.effort"]||void 0}}async function _q(q,$=3){let Z=[];async function X(Q,U,z){let G;try{G=await J8(Q)}catch{return}for(let J of G){if(J===".git"||J==="node_modules")continue;let Y=r(Q,J);try{if(!(await H8(Y)).isDirectory())continue}catch{continue}let B=U?`${U}/${J}`:J,V=z+1,W=r(Y,"SKILL.md");try{let T=await B$(W,"utf-8"),F=L0(T);Z.push({relPath:B,name:F.name||J,version:I0(F),description:(F.description||"").replace(/\s*\n\s*/g," ").trim(),effort:F.effort||F["metadata.effort"]||void 0,license:(F.license||"").trim(),creator:(F["metadata.creator"]||"").trim(),compatibility:(F.compatibility||"").trim(),allowedTools:i2(F)})}catch{if(V<$)await X(Y,B,V)}}}return await X(q,"",0),Z.sort((Q,U)=>Q.name.localeCompare(U.name)),Z}var D8=[{category:"Shell commands",pattern:/\b(bash|sh\s+-c)\b/},{category:"Shell commands",pattern:/\bexec\(/},{category:"Shell commands",pattern:/\bchild_process\b/},{category:"Shell commands",pattern:/\bBun\.spawn\b/},{category:"Code execution",pattern:/\beval\(/},{category:"Code execution",pattern:/\bFunction\(/},{category:"Code execution",pattern:/\bnew\s+Function\b/},{category:"Credentials",pattern:/\b(API_KEY|SECRET|TOKEN|PASSWORD)\s*[=:]/},{category:"External URLs",pattern:/https?:\/\//}];async function n2(q){let $=[],Z=await Hq(q);for(let{relPath:X,content:Q}of Z){let U=Q.split(`
155
+ `);for(let z=0;z<U.length;z++)for(let{category:G,pattern:J}of D8)if(J.test(U[z])){let Y=U[z].trim();$.push({category:G,file:X,line:z+1,match:Y.length>100?Y.slice(0,100)+"…":Y})}}return $}async function O$(q){let $=q.source.isLocal?`local:${q.source.localPath}`:`github:${q.source.owner}/${q.source.repo}${q.source.ref?`#${q.source.ref}`:""}${q.source.subpath?`:${q.source.subpath}`:""}`;if(q.force)try{await m2(q.targetDir),await Bq(q.targetDir,{recursive:!0,force:!0})}catch{}let Z=q.sourceDir;try{await Y8(Z,q.targetDir,{recursive:!0})}catch(G){throw Error(`Failed to install: ${G.message}`)}let X=r(q.targetDir,".git");try{await Bq(X,{recursive:!0,force:!0})}catch{}f(`install: copied files to ${q.targetDir}`);let Q=r(q.targetDir,"SKILL.md");try{await m2(Q)}catch{throw Error("Installation verification failed: SKILL.md not found at target")}let U=await B$(Q,"utf-8"),z=L0(U);return{success:!0,path:q.targetDir,name:z.name||q.skillName,version:I0(z),provider:q.providerLabel,source:$}}async function s2(q,$){let Z=await O$(q);for(let X of $){if(X.name===q.providerName)continue;let Q=W$(X.global),U=r(Q,q.skillName);await B8(Q,{recursive:!0});try{if((await V8(U)).isSymbolicLink())await Bq(U);else{f(`install: skipping ${U} — existing non-symlink directory`);continue}}catch{}let z=_8(Q,q.targetDir);await W8(z,U,"dir"),f(`install: symlinked ${U} -> ${z}`)}return Z.provider=`All (${$.map((X)=>X.label).join(", ")})`,Z}async function a(q){try{await Bq(q,{recursive:!0,force:!0})}catch{}}async function o2(){try{await y0("npx",["--version"]),f("install: npx available")}catch{throw Error("npx is required for Vercel method installation. Install Node.js from https://nodejs.org")}}async function r2(q,$){let Z=["--yes","skills","add",q];if($)Z.push("--skill",$);f(`install: running npx ${Z.join(" ")}`);try{let X=await y0("npx",Z,{timeout:120000});return{stdout:X.stdout,stderr:X.stderr}}catch(X){let Q=X.stderr||X.message||"";throw Error(`npx skills add failed: ${Q}`)}}function t2(q){if(q.isLocal)return q.localPath;let $=`https://github.com/${q.owner}/${q.repo}`;if(q.ref)return`${$}/tree/${q.ref}${q.subpath?`/${q.subpath}`:""}`;return $}async function Oq(q,$,Z){let X=q.providers.filter((J)=>J.enabled);if($==="all"){if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");return{provider:X.find((Y)=>Y.name==="agents")||X[0],allProviders:X}}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(X.length===1)return{provider:X[0],allProviders:null};if(!Z){if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");let J=X.map((Y)=>Y.name).join(", ");throw Error(`--tool (or --provider) is required in non-interactive mode. Available: ${J}, all`)}let Q=q.providers.map((J)=>({label:`${J.label} (${J.name})`,hint:J.global,checked:J.enabled})),U=await Vq({items:Q});if(U.length===0)throw Error("No tools selected. Aborting.");let z=U.map((J)=>q.providers[J]);if(z.length===1)return{provider:z[0],allProviders:null};return{provider:z.find((J)=>J.name==="agents")||z[0],allProviders:z}}function e2(q,$,Z,X,Q,U){let z=W$(Q.global),G=r(z,X);return{source:q,tempDir:$,sourceDir:Z,targetDir:G,skillName:X,force:U,providerName:Q.name,providerLabel:Q.label}}import{readFile as Kz}from"fs/promises";import{join as Rz}from"path";var gU=_2(),hU=Zq(),kU=t$(),P2=Xq(),vU=m0(),J0=S(),uU=X0(),mU=x(),pU=U0(),dU=z0(),AY=eq(),cU=A2(),lU=D2(),iU=w2(),Z$=z4(),G4=v0();var aU=gU.Composer,nU=hU.Document,sU=kU.Schema,oU=P2.YAMLError,rU=P2.YAMLParseError,tU=P2.YAMLWarning,eU=vU.Alias,qz=J0.isAlias,$z=J0.isCollection,Zz=J0.isDocument,Xz=J0.isMap,Qz=J0.isNode,Uz=J0.isPair,zz=J0.isScalar,Gz=J0.isSeq,Jz=uU.Pair,Yz=mU.Scalar,Hz=pU.YAMLMap,Vz=dU.YAMLSeq;var Wz=cU.Lexer,Bz=lU.LineCounter,_z=iU.Parser,N2=Z$.parse,Oz=Z$.parseAllDocuments,Tz=Z$.parseDocument,Fz=Z$.stringify,Lz=G4.visit,Iz=G4.visitAsync;var J4=500;function Mz(q){let $=q.split(`
156
156
  `),Z=!1,X=!1;for(let Q of $){if(Q.trim()==="---")if(!Z){Z=!0;continue}else{X=!0;continue}if(X&&Q.trim().length>0)return!0}return!1}function Az(q){let $=q.split(`
157
157
  `),Z=-1;for(let X=0;X<$.length;X++)if($[X].trim()==="---")if(Z===-1)Z=X+1;else return $.slice(Z,X).join(`
158
- `);return null}function Mz(q){let $=Az(q);if($===null)return null;try{return N2($),null}catch(Z){return Z.message||"invalid YAML"}}async function J4(q){let $=[];if(!q.description||q.description.trim()==="")$.push({category:"missing-description",message:"Skill has no description in SKILL.md frontmatter"});if(!q.version||q.version==="0.0.0")$.push({category:"missing-version",message:"Skill has no version (or default 0.0.0) in SKILL.md frontmatter"});try{let X=Kz(q.path,"SKILL.md"),Q=await Iz(X,"utf-8");if(!Rz(Q))$.push({category:"empty-body",message:"SKILL.md contains only frontmatter with no body content"});let U=Mz(Q);if(U)$.push({category:"invalid-yaml",message:`SKILL.md has invalid YAML frontmatter: ${U}`})}catch{}let Z=q.fileCount;if(Z!==void 0&&Z>G4)$.push({category:"high-file-count",message:`Skill has ${Z} files (threshold: ${G4})`});return $}function Y4(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 Dz,writeFile as wz,access as Pz}from"fs/promises";import{join as Nz}from"path";function jz(q){return`---
158
+ `);return null}function Dz(q){let $=Az(q);if($===null)return null;try{return N2($),null}catch(Z){return Z.message||"invalid YAML"}}async function Y4(q){let $=[];if(!q.description||q.description.trim()==="")$.push({category:"missing-description",message:"Skill has no description in SKILL.md frontmatter"});if(!q.version||q.version==="0.0.0")$.push({category:"missing-version",message:"Skill has no version (or default 0.0.0) in SKILL.md frontmatter"});try{let X=Rz(q.path,"SKILL.md"),Q=await Kz(X,"utf-8");if(!Mz(Q))$.push({category:"empty-body",message:"SKILL.md contains only frontmatter with no body content"});let U=Dz(Q);if(U)$.push({category:"invalid-yaml",message:`SKILL.md has invalid YAML frontmatter: ${U}`})}catch{}let Z=q.fileCount;if(Z!==void 0&&Z>J4)$.push({category:"high-file-count",message:`Skill has ${Z} files (threshold: ${J4})`});return $}function H4(q){let $=q.map((Z)=>({name:Z.name,version:Z.version,dirName:Z.dirName,provider:Z.provider,scope:Z.scope,path:Z.path,isSymlink:Z.isSymlink,symlinkTarget:Z.symlinkTarget,effort:Z.effort}));return{version:1,exportedAt:new Date().toISOString(),skills:$}}import{mkdir as wz,writeFile as Pz,access as Nz}from"fs/promises";import{join as jz}from"path";function Cz(q){return`---
159
159
  name: ${q}
160
160
  description: ""
161
161
  license: ""
@@ -176,11 +176,11 @@ as instructions for when and how to use this skill.
176
176
  ## Instructions
177
177
 
178
178
  - Step-by-step instructions for the agent
179
- `}async function H4(q,$){await Dz($,{recursive:!0});let Z=Nz($,"SKILL.md"),X=jz(q);await wz(Z,X,"utf-8")}async function V4(q){try{return await Pz(q),!0}catch{return!1}}import{readdir as Cz,stat as bz}from"fs/promises";import{join as Sz}from"path";async function Ez(q){let $=0;try{let X=(await Cz(q,{recursive:!0})).map(async(U)=>{try{let z=await bz(Sz(q,U));if(z.isFile())return z.size}catch{}return 0});$=(await Promise.all(X)).reduce((U,z)=>U+z,0)}catch{}return $}async function _4(q,$){let Z={},X={global:0,project:0},Q={},U=q.map(async(J)=>{Z[J.provider]=(Z[J.provider]||0)+1,X[J.scope]++;let Y=await Ez(J.path);return Q[J.path]=Y,Y}),G=(await Promise.all(U)).reduce((J,Y)=>J+Y,0);return{totalSkills:q.length,byProvider:Z,byScope:X,totalDiskBytes:G,perSkillDiskBytes:Q,duplicateGroups:$.duplicateGroups.length,duplicateInstances:$.totalDuplicateInstances}}function fz(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 X=Math.round(q/$*Z),Q=Z-X;return H.green("#".repeat(X))+H.dim("-".repeat(Q))}var W4={claude:"Claude Code",codex:"Codex",openclaw:"OpenClaw",agents:"Agents"};function O4(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(fz(q.totalDiskBytes))}`),$.push(""),$.push(H.bold(" By Tool"));let Z=Object.entries(q.byProvider).sort((J,Y)=>Y[1]-J[1]),X=Math.max(...Z.map(([,J])=>J)),Q=Math.max(...Z.map(([J])=>(W4[J]||J).length));for(let[J,Y]of Z){let B=W4[J]||J,V=B4(J,B.padEnd(Q)),W=String(Y).padStart(4);$.push(` ${V} ${W} ${j2(Y,X)}`)}$.push(""),$.push(H.bold(" By Scope"));let U=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(Q)} ${z} ${j2(q.byScope.global,U)}`),$.push(` ${"project".padEnd(Q)} ${G} ${j2(q.byScope.project,U)}`),$.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 yz,lstat as xz,readFile as gz,rm as kz,symlink as hz}from"fs/promises";import{join as T4}from"path";async function F4(q){let $;try{$=await xz(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=T4(q,"SKILL.md"),X;try{X=await gz(Z,"utf-8")}catch{throw Error(`No SKILL.md found in ${q}`)}let Q=L0(X);if(!Q.name)throw Error(`Invalid SKILL.md in ${q}: missing "name" in frontmatter`);return{name:Q.name,version:I0(Q)}}async function X$(q,$,Z,X){let Q=T4($,Z),U=!1;try{await yz(Q),U=!0}catch{}if(U){if(!X)throw Error(`Target already exists: ${Q}. Use --force to overwrite.`);await kz(Q,{recursive:!0,force:!0})}await hz(q,Q,"dir")}var K4=[{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 vz(q,$){let Z={owner:q,repo:$,profileUrl:`https://github.com/${q}`,reposUrl:`https://github.com/${q}?tab=repositories`,isOrganization:null,publicRepos:null,accountAge:null,fetchError:null};try{let X=await fetch(`https://api.github.com/users/${q}`,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"agent-skill-manager"},signal:AbortSignal.timeout(1e4)});if(!X.ok)return Z.fetchError=`GitHub API returned ${X.status}`,Z;let Q=await X.json();if(Z.isOrganization=Q.type==="Organization",Z.publicRepos=typeof Q.public_repos==="number"?Q.public_repos:null,typeof Q.created_at==="string"){let U=new Date(Q.created_at),z=new Date,G=Math.floor((z.getTime()-U.getTime())/31557600000),J=Math.floor((z.getTime()-U.getTime())%31557600000/2630016000.0000005);Z.accountAge=G>0?`${G}y ${J}m`:`${J}m`}f(`security-audit: source analysis for ${q} -> repos=${Z.publicRepos}, org=${Z.isOrganization}, age=${Z.accountAge}`)}catch(X){Z.fetchError=X.message||"Failed to fetch GitHub profile",f(`security-audit: source analysis failed -> ${Z.fetchError}`)}return Z}function uz(q){let $=new Map;for(let{relPath:Q,content:U}of q){let z=U.split(`
181
- `);for(let G=0;G<z.length;G++){let J=z[G],Y=J.trim();for(let B of K4)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:Q,line:G+1,match:W,severity:B.severity})}}}let Z=[];for(let[Q,U]of $)Z.push({category:Q,description:U.description,matches:U.matches});let X={critical:0,warning:1,info:2};return Z.sort((Q,U)=>{let z=Math.min(...Q.matches.map((J)=>X[J.severity])),G=Math.min(...U.matches.map((J)=>X[J.severity]));return z-G}),Z}function mz(q){let $=new Map;for(let U of q)for(let z of U.matches)for(let G of K4)if(G.permissionType&&G.category===U.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(U.category);break}let Z={filesystem:"Skill reads, writes, or modifies files on disk. Verify it only accesses intended paths.",shell:"Skill executes shell commands or spawns processes. This allows arbitrary system access.",network:"Skill makes network requests or downloads external content. Data may be sent to remote servers.","code-execution":"Skill dynamically constructs and executes code. This can bypass static analysis.",environment:"Skill reads environment variables, which may contain secrets or API keys."},X=[];for(let[U,z]of $)X.push({type:U,evidence:z.evidence,reason:Z[U]});let Q={shell:0,"code-execution":1,network:2,filesystem:3,environment:4};return X.sort((U,z)=>(Q[U.type]??99)-(Q[z.type]??99)),X}function pz(q,$,Z){let X=0,Q=0;for(let J of q)for(let Y of J.matches){if(Y.severity==="critical")X++;if(Y.severity==="warning")Q++}let U=$.some((J)=>J.type==="shell"),z=$.some((J)=>J.type==="code-execution"),G=$.some((J)=>J.type==="network");if(U&&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(X>=10)return{verdict:"dangerous",reason:`${X} critical findings detected. High concentration of risky patterns.`};if(U||z)return{verdict:"warning",reason:U?"Skill executes shell commands. Review commands carefully before installing.":"Skill uses dynamic code execution. Review usage carefully."};if(X>0)return{verdict:"warning",reason:`${X} critical finding${X>1?"s":""} detected. Manual review recommended.`};if(Q>0)return{verdict:"caution",reason:`${Q} warning${Q>1?"s":""} found. Generally acceptable but worth reviewing.`};if(Z&&Z.publicRepos!==null&&Z.publicRepos<3)return{verdict:"caution",reason:"No code issues found, but the author has very few public repositories."};return{verdict:"safe",reason:"No suspicious patterns detected."}}async function U$(q,$,Z,X){f(`security-audit: scanning ${q}`);let Q=await Hq(q),U=Q.reduce((V,W)=>V+W.lineCount,0),z=null;if(Z&&X)z=await vz(Z,X);let G=uz(Q),J=mz(G),{verdict:Y,reason:B}=pz(G,J,z);return{scannedAt:new Date().toISOString(),skillName:$,skillPath:q,source:z,codeScans:G,permissions:J,totalFiles:Q.length,totalLines:U,verdict:Y,verdictReason:B}}var N=H,T0=56,dz={"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"},L4={critical:0,warning:1,info:2};function cz(q){switch(q){case"safe":return N.bgGreen(" SAFE ");case"caution":return N.bgCyan(" CAUTION ");case"warning":return N.bgYellow(" WARNING ");case"dangerous":return N.bgRed(" DANGEROUS ")}}function lz(q){switch(q){case"safe":return N.green;case"caution":return N.cyan;case"warning":return N.yellow;case"dangerous":return N.red}}function E0(q){switch(q){case"critical":return N.red("!!");case"warning":return N.yellow(" !");case"info":return N.dim(" i")}}function C2(q,$){return q.length>$?q.slice(0,$-3)+"...":q}function Q$(q){return q.toLocaleString("en-US")}function R4(q){return q.replace(/\x1b\[[0-9;]*m/g,"")}function I4(q){return R4(q).length}function iz(q){let $=new Map;for(let Z of q){let X=`${Z.file}:${Z.line}`,Q=$.get(X);if(!Q||L4[Z.severity]<L4[Q.severity])$.set(X,Z)}return Array.from($.values())}function az(q){let $=new Map;for(let Z of q){let X=$.get(Z.file);if(!X)X={file:Z.file,entries:[]},$.set(Z.file,X);X.entries.push({line:Z.line,match:Z.match,severity:Z.severity})}return Array.from($.values())}function z$(q){let $=[],Z=cz(q.verdict),X=R4(Z),Q=` ${N.bold(q.skillName)}`,U=` ${q.skillName}`,z=T0-4,G=Math.max(1,z-U.length-X.length);if($.push(""),$.push(N.dim(" +-- ")+N.bold("Security Audit")+N.dim(" "+"-".repeat(T0-19)+"+")),$.push(N.dim(" |")+Q+" ".repeat(G)+Z+N.dim("|")),$.push(N.dim(" |")+N.dim(` ${Q$(q.totalFiles)} files | ${Q$(q.totalLines)} lines`)+" ".repeat(Math.max(1,z-` ${Q$(q.totalFiles)} files | ${Q$(q.totalLines)} lines`.length))+N.dim("|")),$.push(N.dim(" +"+"-".repeat(T0-2)+"+")),q.source){let V=q.source;if(V.fetchError)$.push(` ${N.yellow("!")} Could not fetch profile: ${V.fetchError}`);else{let W=[];if(W.push(`${V.owner} ${V.isOrganization?N.cyan("(org)"):N.dim("(user)")}`),V.publicRepos!==null){let T=V.publicRepos,F=T<3?N.yellow(`${T} repos`):T<10?N.cyan(`${T} repos`):N.green(`${T} repos`);W.push(F)}if(V.accountAge)W.push(V.accountAge);$.push(` ${N.dim("Author:")} ${W.join(N.dim(" | "))}`)}}if($.push(""),q.codeScans.length===0)$.push(` ${N.green("*")} ${N.green("No suspicious patterns detected.")}`);else{let V=lz(q.verdict),W=q.verdict==="dangerous"||q.verdict==="warning"?E0("critical"):q.verdict==="caution"?E0("warning"):E0("info");$.push(` ${W} ${V(q.verdictReason)}`);let T=0,F=0,_=0;for(let M of q.codeScans)for(let w of M.matches)if(w.severity==="critical")T++;else if(w.severity==="warning")F++;else _++;let O=[];if(T>0)O.push(N.red(`${T} critical`));if(F>0)O.push(N.yellow(`${F} warning`));if(_>0)O.push(N.dim(`${_} info`));let R=q.permissions.map((M)=>M.type),A=R.length>0?N.dim(`Perms: ${R.join(", ")}`):"";$.push(` ${O.join(N.dim(" | "))} ${A}`)}if($.push(""),q.codeScans.length>0){$.push(` ${N.bold("Findings")}`),$.push(N.dim(" "+"=".repeat(T0-2)));for(let V of q.codeScans){let W=iz(V.matches),T=W.filter((C)=>C.severity==="critical").length,F=W.filter((C)=>C.severity==="warning").length,_=W.filter((C)=>C.severity==="info").length,O=T>0?E0("critical"):F>0?E0("warning"):E0("info"),R=[];if(T>0)R.push(N.red(`${T} critical`));if(F>0)R.push(N.yellow(`${F} warning`));if(_>0)R.push(N.dim(`${_} info`));let A=dz[V.category],M=A?N.dim(`PERM: ${A}`):"",w=` ${O} ${N.bold(V.category)} (${R.join(", ")})`;if(M){let C=I4(w),y=I4(M),E=Math.max(2,T0-C-y);$.push(w+" ".repeat(E)+M)}else $.push(w);let L=az(W),I=Math.min(24,Math.max(...L.map((C)=>C.file.length))),P=0,K=3;for(let C of L){if(P>=K)break;let y=C2(C.file,24),E=N.dim(y.padEnd(I));if(C.entries.length===1){let o=C.entries[0],F0=C2(o.match,50);$.push(` ${E} :${o.line} ${N.dim("--")} ${o.severity==="critical"?F0:N.dim(F0)}`),P++}else if(C.entries.length<=3){let o=C.entries.map((Y$)=>`:${Y$.line}`).join(", "),F0=C2(C.entries[0].match,40);$.push(` ${E} ${o} ${N.dim("--")} ${N.dim(F0)}`),P++}else{let F0=C.entries.slice(0,3).map((r4)=>`:${r4.line}`).join(", "),Y$=C.entries.length-3;$.push(` ${E} ${F0} ${N.dim(`(+${Y$} more)`)}`),P++}}let j=L.length-Math.min(L.length,K);if(j>0){let C=W.length-L.slice(0,K).reduce((y,E)=>y+E.entries.length,0);if(C>0)$.push(` ${N.dim(`... ${C} more in ${j} file${j>1?"s":""}`)}`)}$.push("")}}$.push(N.dim(" "+"=".repeat(T0-2)));let J=new Date(q.scannedAt),Y=`${J.getFullYear()}-${String(J.getMonth()+1).padStart(2,"0")}-${String(J.getDate()).padStart(2,"0")} ${String(J.getHours()).padStart(2,"0")}:${String(J.getMinutes()).padStart(2,"0")}`,B=q.source&&!q.source.fetchError?`github.com/${q.source.owner}`:"";if(B){let V=Math.max(2,T0-2-Y.length-B.length);$.push(N.dim(` ${Y}${" ".repeat(V)}${B}`))}else $.push(N.dim(` ${Y}`));return $.push(""),$.join(`
182
- `)}function b2(q){return JSON.stringify(q,null,2)}import{writeFile as QG,mkdir as UG,unlink as zG}from"fs/promises";import{join as j4}from"path";import{readdir as nz,readFile as sz}from"fs/promises";import{join as oz}from"path";function S2(q){let $=new Set,Z=q.toLowerCase().split(/[\s\-_.,;:()[\]{}"']+/);for(let X of Z)if(X.length>=2)$.add(X);return $}var rz=10,tz=5,ez=3,qG=1;function $G(q,$){let Z=S2(q),X=S2($.name),Q=S2($.description),U=0;for(let z of Z){if(X.has(z))U+=rz;if(Q.has(z))U+=ez;if($.name.toLowerCase().includes(z))U+=tz;if($.description.toLowerCase().includes(z))U+=qG}return U}async function A4(q){let $=new Map,Z;try{Z=await nz(q)}catch{return $}for(let X of Z){if(!X.endsWith(".json"))continue;let Q=oz(q,X);try{let U=await sz(Q,"utf-8"),z=JSON.parse(U);for(let G of z.skills){if(!("license"in G))G.license="";if(!("creator"in G))G.creator=""}$.set(`${z.owner}/${z.repo}`,z)}catch{}}return $}async function G$(){let q=await A4(w4()),$=await A4(Yq()),Z=new Map(q);for(let[X,Q]of $)Z.set(X,Q);return Array.from(Z.values())}var ZG=["license","creator","version"];function M4(q){return ZG.includes(q)}function D4(q,$){return q[$]||""}function XG(q,$){if($.has)for(let Z of $.has){if(!M4(Z))continue;if(!D4(q,Z))return!1}if($.missing)for(let Z of $.missing){if(!M4(Z))continue;if(D4(q,Z))return!1}return!0}function P4(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 X=await G$(),Q=[],U=!q&&Z;for(let z of X)for(let G of z.skills){if(Z&&!XG(G,Z))continue;let J=U?1:$G(q,G);if(J>0)Q.push({skill:G,repo:{owner:z.owner,repo:z.repo},score:J})}return Q.sort((z,G)=>G.score-z.score),Q.slice(0,$)}async function N4(){return(await G$()).reduce(($,Z)=>$+Z.skillCount,0)}async function GG(){let q=Yq();return await UG(q,{recursive:!0}),q}async function C4(q){await k0();let $;try{$=x0(q)}catch(X){return{success:!1,repoIndex:null,error:X.message}}if($.isLocal)return{success:!1,repoIndex:null,error:"Local paths are not supported for indexing. Use a GitHub source instead."};f(`ingester: cloning ${$.owner}/${$.repo}`);let Z=null;try{Z=await h0($),f(`ingester: discovering skills in ${Z}`);let X=await _q(Z);f(`ingester: found ${X.length} skills`);let Q=X.map((J)=>({name:J.name,description:J.description,version:J.version,license:J.license,creator:J.creator,installUrl:`github:${$.owner}/${$.repo}${$.ref?`#${$.ref}`:""}${J.relPath?`:${J.relPath}`:""}`,relPath:J.relPath})),U={repoUrl:$.cloneUrl,owner:$.owner,repo:$.repo,updatedAt:new Date().toISOString(),skillCount:Q.length,skills:Q},z=await GG(),G=j4(z,`${$.owner}_${$.repo}.json`);return await QG(G,JSON.stringify(U,null,2)+`
183
- `,"utf-8"),f(`ingester: wrote index to ${G}`),{success:!0,repoIndex:U}}catch(X){return{success:!1,repoIndex:null,error:X.message}}finally{if(Z)await a(Z)}}async function b4(){return(await G$()).map(($)=>({owner:$.owner,repo:$.repo,skillCount:$.skillCount,updatedAt:$.updatedAt})).sort(($,Z)=>Z.skillCount-$.skillCount)}async function S4(q,$){let Z=Yq(),X=j4(Z,`${q}_${$}.json`);try{return await zG(X),!0}catch{return!1}}function JG(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:[]}},X=0;while(X<$.length){let Q=$[X];if(Q==="--help"||Q==="-h")Z.flags.help=!0;else if(Q==="--version"||Q==="-v")Z.flags.version=!0;else if(Q==="--json")Z.flags.json=!0;else if(Q==="--yes"||Q==="-y")Z.flags.yes=!0;else if(Q==="--no-color")Z.flags.noColor=!0;else if(Q==="--scope"||Q==="-s"){X++;let U=$[X];if(U==="global"||U==="project"||U==="both")Z.flags.scope=U;else b(`Invalid scope: "${U}". Must be global, project, or both.`),process.exit(2)}else if(Q==="--sort"){X++;let U=$[X];if(U==="name"||U==="version"||U==="location")Z.flags.sort=U;else b(`Invalid sort: "${U}". Must be name, version, or location.`),process.exit(2)}else if(Q==="--provider"||Q==="-p"||Q==="--tool")X++,Z.flags.provider=$[X]||null;else if(Q==="--name")X++,Z.flags.name=$[X]||null;else if(Q==="--force"||Q==="-f")Z.flags.force=!0;else if(Q==="--path")X++,Z.flags.path=$[X]||null;else if(Q==="--all")Z.flags.all=!0;else if(Q==="--verbose"||Q==="-V")Z.flags.verbose=!0;else if(Q==="--flat")Z.flags.flat=!0;else if(Q==="--installed")Z.flags.installed=!0;else if(Q==="--available")Z.flags.available=!0;else if(Q==="--transport"||Q==="-t"){X++;let U=$[X];if(U==="https"||U==="ssh"||U==="auto")Z.flags.transport=U;else b(`Invalid transport: "${U}". Must be https, ssh, or auto.`),process.exit(2)}else if(Q==="--method"||Q==="-m"){X++;let U=$[X];if(U==="default"||U==="vercel")Z.flags.method=U;else b(`Invalid method: "${U}". Must be default or vercel.`),process.exit(2)}else if(Q==="--skill")X++,Z.flags.path=$[X]||null;else if(Q==="--has"){if(X++,$[X])Z.flags.has.push($[X])}else if(Q==="--missing"){if(X++,$[X])Z.flags.missing.push($[X])}else if(Q.startsWith("-"))b(`Unknown option: ${Q}`),console.error('Run "asm --help" for usage.'),process.exit(2);else if(!Z.command)Z.command=Q;else if(!Z.subcommand)Z.subcommand=Q;else Z.positional.push(Q);X++}return Z}function b(q){console.error(H.red(`Error: ${q}`))}function YG(){console.log(`${H.blueBold("agent-skill-manager")} (${H.bold("asm")}) ${h2}
179
+ `}async function V4(q,$){await wz($,{recursive:!0});let Z=jz($,"SKILL.md"),X=Cz(q);await Pz(Z,X,"utf-8")}async function W4(q){try{return await Nz(q),!0}catch{return!1}}import{readdir as bz,stat as Sz}from"fs/promises";import{join as Ez}from"path";async function fz(q){let $=0;try{let X=(await bz(q,{recursive:!0})).map(async(U)=>{try{let z=await Sz(Ez(q,U));if(z.isFile())return z.size}catch{}return 0});$=(await Promise.all(X)).reduce((U,z)=>U+z,0)}catch{}return $}async function O4(q,$){let Z={},X={global:0,project:0},Q={},U=q.map(async(J)=>{Z[J.provider]=(Z[J.provider]||0)+1,X[J.scope]++;let Y=await fz(J.path);return Q[J.path]=Y,Y}),G=(await Promise.all(U)).reduce((J,Y)=>J+Y,0);return{totalSkills:q.length,byProvider:Z,byScope:X,totalDiskBytes:G,perSkillDiskBytes:Q,duplicateGroups:$.duplicateGroups.length,duplicateInstances:$.totalDuplicateInstances}}function yz(q){if(q<1024)return`${q} B`;if(q<1048576)return`${(q/1024).toFixed(1)} KB`;if(q<1073741824)return`${(q/1048576).toFixed(1)} MB`;return`${(q/1073741824).toFixed(1)} GB`}function j2(q,$,Z=20){let X=Math.round(q/$*Z),Q=Z-X;return H.green("#".repeat(X))+H.dim("-".repeat(Q))}var B4={claude:"Claude Code",codex:"Codex",openclaw:"OpenClaw",agents:"Agents"};function T4(q){let $=[];$.push(""),$.push(H.blueBold(" Skill Statistics")),$.push(H.dim(" "+"-".repeat(20))),$.push(""),$.push(` ${H.bold("Total:")} ${H.cyan(String(q.totalSkills))} skills`),$.push(` ${H.bold("Disk:")} ${H.cyan(yz(q.totalDiskBytes))}`),$.push(""),$.push(H.bold(" By Tool"));let Z=Object.entries(q.byProvider).sort((J,Y)=>Y[1]-J[1]),X=Math.max(...Z.map(([,J])=>J)),Q=Math.max(...Z.map(([J])=>(B4[J]||J).length));for(let[J,Y]of Z){let B=B4[J]||J,V=_4(J,B.padEnd(Q)),W=String(Y).padStart(4);$.push(` ${V} ${W} ${j2(Y,X)}`)}$.push(""),$.push(H.bold(" By Scope"));let U=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(Q)} ${z} ${j2(q.byScope.global,U)}`),$.push(` ${"project".padEnd(Q)} ${G} ${j2(q.byScope.project,U)}`),$.push(""),$.push(H.bold(" Duplicates")),q.duplicateGroups>0)$.push(` ${H.yellow(`${q.duplicateGroups} group(s), ${q.duplicateInstances} total instance(s)`)}`),$.push(H.dim(` Run ${H.bold("asm audit")} to review`));else $.push(` ${H.green("None")}`);return $.push(""),$.join(`
180
+ `)}import{access as xz,lstat as gz,readFile as hz,rm as kz,symlink as vz}from"fs/promises";import{join as F4}from"path";async function L4(q){let $;try{$=await gz(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=F4(q,"SKILL.md"),X;try{X=await hz(Z,"utf-8")}catch{throw Error(`No SKILL.md found in ${q}`)}let Q=L0(X);if(!Q.name)throw Error(`Invalid SKILL.md in ${q}: missing "name" in frontmatter`);return{name:Q.name,version:I0(Q)}}async function X$(q,$,Z,X){let Q=F4($,Z),U=!1;try{await xz(Q),U=!0}catch{}if(U){if(!X)throw Error(`Target already exists: ${Q}. Use --force to overwrite.`);await kz(Q,{recursive:!0,force:!0})}await vz(q,Q,"dir")}var R4=[{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bcurl\b/,severity:"critical",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bwget\b/,severity:"critical",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bfetch\s*\(/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\baxios\b/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bhttp\.request\b/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bXMLHttpRequest\b/,severity:"warning",permissionType:"network"},{category:"External URLs",description:"Hardcoded URLs that may indicate data exfiltration or remote payload loading",pattern:/https?:\/\/(?!github\.com|localhost|127\.0\.0\.1|example\.com)/,severity:"warning",permissionType:"network"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bexec\s*\(/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bexecSync\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bchild_process\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bspawn\s*\(/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bBun\.spawn\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bshelljs\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\b(?:bash|sh|zsh)\s+-c\b/,severity:"critical",permissionType:"shell"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\beval\s*\(/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bnew\s+Function\b/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bFunction\s*\(/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bimport\s*\(\s*[^'"]/,severity:"warning",permissionType:"code-execution"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bfs\.(?:write|append|unlink|rm|mkdir|rename)\b/,severity:"warning",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bwriteFile(?:Sync)?\b/,severity:"warning",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\brm\s+-rf?\b/,severity:"critical",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bchmod\b/,severity:"warning",permissionType:"filesystem"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/\b(?:API_KEY|SECRET_KEY|ACCESS_TOKEN|PRIVATE_KEY)\s*[=:]/,severity:"critical"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/\bPASSWORD\s*[=:]/,severity:"critical"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/(?:sk|pk)[-_](?:live|test)[-_][a-zA-Z0-9]{20,}/,severity:"critical"},{category:"Environment variable access",description:"Reading environment variables which may contain secrets or configuration",pattern:/\bprocess\.env\b/,severity:"info",permissionType:"environment"},{category:"Environment variable access",description:"Reading environment variables which may contain secrets or configuration",pattern:/\bBun\.env\b/,severity:"info",permissionType:"environment"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\batob\s*\(/,severity:"warning"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\bBuffer\.from\s*\([^,]+,\s*['"]base64['"]\)/,severity:"warning"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\\x[0-9a-fA-F]{2}(?:\\x[0-9a-fA-F]{2}){5,}/,severity:"warning"}];async function uz(q,$){let Z={owner:q,repo:$,profileUrl:`https://github.com/${q}`,reposUrl:`https://github.com/${q}?tab=repositories`,isOrganization:null,publicRepos:null,accountAge:null,fetchError:null};try{let X=await fetch(`https://api.github.com/users/${q}`,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"agent-skill-manager"},signal:AbortSignal.timeout(1e4)});if(!X.ok)return Z.fetchError=`GitHub API returned ${X.status}`,Z;let Q=await X.json();if(Z.isOrganization=Q.type==="Organization",Z.publicRepos=typeof Q.public_repos==="number"?Q.public_repos:null,typeof Q.created_at==="string"){let U=new Date(Q.created_at),z=new Date,G=Math.floor((z.getTime()-U.getTime())/31557600000),J=Math.floor((z.getTime()-U.getTime())%31557600000/2630016000.0000005);Z.accountAge=G>0?`${G}y ${J}m`:`${J}m`}f(`security-audit: source analysis for ${q} -> repos=${Z.publicRepos}, org=${Z.isOrganization}, age=${Z.accountAge}`)}catch(X){Z.fetchError=X.message||"Failed to fetch GitHub profile",f(`security-audit: source analysis failed -> ${Z.fetchError}`)}return Z}function mz(q){let $=new Map;for(let{relPath:Q,content:U}of q){let z=U.split(`
181
+ `);for(let G=0;G<z.length;G++){let J=z[G],Y=J.trim();for(let B of R4)if(B.pattern.test(J)){let V=B.category;if(!$.has(V))$.set(V,{description:B.description,matches:[]});let W=Y.length>120?Y.slice(0,120)+"...":Y;$.get(V).matches.push({file:Q,line:G+1,match:W,severity:B.severity})}}}let Z=[];for(let[Q,U]of $)Z.push({category:Q,description:U.description,matches:U.matches});let X={critical:0,warning:1,info:2};return Z.sort((Q,U)=>{let z=Math.min(...Q.matches.map((J)=>X[J.severity])),G=Math.min(...U.matches.map((J)=>X[J.severity]));return z-G}),Z}function pz(q){let $=new Map;for(let U of q)for(let z of U.matches)for(let G of R4)if(G.permissionType&&G.category===U.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(U.category);break}let Z={filesystem:"Skill reads, writes, or modifies files on disk. Verify it only accesses intended paths.",shell:"Skill executes shell commands or spawns processes. This allows arbitrary system access.",network:"Skill makes network requests or downloads external content. Data may be sent to remote servers.","code-execution":"Skill dynamically constructs and executes code. This can bypass static analysis.",environment:"Skill reads environment variables, which may contain secrets or API keys."},X=[];for(let[U,z]of $)X.push({type:U,evidence:z.evidence,reason:Z[U]});let Q={shell:0,"code-execution":1,network:2,filesystem:3,environment:4};return X.sort((U,z)=>(Q[U.type]??99)-(Q[z.type]??99)),X}function dz(q,$,Z){let X=0,Q=0;for(let J of q)for(let Y of J.matches){if(Y.severity==="critical")X++;if(Y.severity==="warning")Q++}let U=$.some((J)=>J.type==="shell"),z=$.some((J)=>J.type==="code-execution"),G=$.some((J)=>J.type==="network");if(U&&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(X>=10)return{verdict:"dangerous",reason:`${X} critical findings detected. High concentration of risky patterns.`};if(U||z)return{verdict:"warning",reason:U?"Skill executes shell commands. Review commands carefully before installing.":"Skill uses dynamic code execution. Review usage carefully."};if(X>0)return{verdict:"warning",reason:`${X} critical finding${X>1?"s":""} detected. Manual review recommended.`};if(Q>0)return{verdict:"caution",reason:`${Q} warning${Q>1?"s":""} found. Generally acceptable but worth reviewing.`};if(Z&&Z.publicRepos!==null&&Z.publicRepos<3)return{verdict:"caution",reason:"No code issues found, but the author has very few public repositories."};return{verdict:"safe",reason:"No suspicious patterns detected."}}async function U$(q,$,Z,X){f(`security-audit: scanning ${q}`);let Q=await Hq(q),U=Q.reduce((V,W)=>V+W.lineCount,0),z=null;if(Z&&X)z=await uz(Z,X);let G=mz(Q),J=pz(G),{verdict:Y,reason:B}=dz(G,J,z);return{scannedAt:new Date().toISOString(),skillName:$,skillPath:q,source:z,codeScans:G,permissions:J,totalFiles:Q.length,totalLines:U,verdict:Y,verdictReason:B}}var N=H,T0=56,cz={"Shell execution":"shell","Dynamic code execution":"code-execution","Network requests":"network","External URLs":"network","File system access":"filesystem","Environment variable access":"environment","Embedded credentials":"credentials","Obfuscation patterns":"obfuscation"},I4={critical:0,warning:1,info:2};function lz(q){switch(q){case"safe":return N.bgGreen(" SAFE ");case"caution":return N.bgCyan(" CAUTION ");case"warning":return N.bgYellow(" WARNING ");case"dangerous":return N.bgRed(" DANGEROUS ")}}function iz(q){switch(q){case"safe":return N.green;case"caution":return N.cyan;case"warning":return N.yellow;case"dangerous":return N.red}}function E0(q){switch(q){case"critical":return N.red("!!");case"warning":return N.yellow(" !");case"info":return N.dim(" i")}}function C2(q,$){return q.length>$?q.slice(0,$-3)+"...":q}function Q$(q){return q.toLocaleString("en-US")}function M4(q){return q.replace(/\x1b\[[0-9;]*m/g,"")}function K4(q){return M4(q).length}function az(q){let $=new Map;for(let Z of q){let X=`${Z.file}:${Z.line}`,Q=$.get(X);if(!Q||I4[Z.severity]<I4[Q.severity])$.set(X,Z)}return Array.from($.values())}function nz(q){let $=new Map;for(let Z of q){let X=$.get(Z.file);if(!X)X={file:Z.file,entries:[]},$.set(Z.file,X);X.entries.push({line:Z.line,match:Z.match,severity:Z.severity})}return Array.from($.values())}function z$(q){let $=[],Z=lz(q.verdict),X=M4(Z),Q=` ${N.bold(q.skillName)}`,U=` ${q.skillName}`,z=T0-4,G=Math.max(1,z-U.length-X.length);if($.push(""),$.push(N.dim(" +-- ")+N.bold("Security Audit")+N.dim(" "+"-".repeat(T0-19)+"+")),$.push(N.dim(" |")+Q+" ".repeat(G)+Z+N.dim("|")),$.push(N.dim(" |")+N.dim(` ${Q$(q.totalFiles)} files | ${Q$(q.totalLines)} lines`)+" ".repeat(Math.max(1,z-` ${Q$(q.totalFiles)} files | ${Q$(q.totalLines)} lines`.length))+N.dim("|")),$.push(N.dim(" +"+"-".repeat(T0-2)+"+")),q.source){let V=q.source;if(V.fetchError)$.push(` ${N.yellow("!")} Could not fetch profile: ${V.fetchError}`);else{let W=[];if(W.push(`${V.owner} ${V.isOrganization?N.cyan("(org)"):N.dim("(user)")}`),V.publicRepos!==null){let T=V.publicRepos,F=T<3?N.yellow(`${T} repos`):T<10?N.cyan(`${T} repos`):N.green(`${T} repos`);W.push(F)}if(V.accountAge)W.push(V.accountAge);$.push(` ${N.dim("Author:")} ${W.join(N.dim(" | "))}`)}}if($.push(""),q.codeScans.length===0)$.push(` ${N.green("*")} ${N.green("No suspicious patterns detected.")}`);else{let V=iz(q.verdict),W=q.verdict==="dangerous"||q.verdict==="warning"?E0("critical"):q.verdict==="caution"?E0("warning"):E0("info");$.push(` ${W} ${V(q.verdictReason)}`);let T=0,F=0,_=0;for(let A of q.codeScans)for(let w of A.matches)if(w.severity==="critical")T++;else if(w.severity==="warning")F++;else _++;let O=[];if(T>0)O.push(N.red(`${T} critical`));if(F>0)O.push(N.yellow(`${F} warning`));if(_>0)O.push(N.dim(`${_} info`));let R=q.permissions.map((A)=>A.type),M=R.length>0?N.dim(`Perms: ${R.join(", ")}`):"";$.push(` ${O.join(N.dim(" | "))} ${M}`)}if($.push(""),q.codeScans.length>0){$.push(` ${N.bold("Findings")}`),$.push(N.dim(" "+"=".repeat(T0-2)));for(let V of q.codeScans){let W=az(V.matches),T=W.filter((C)=>C.severity==="critical").length,F=W.filter((C)=>C.severity==="warning").length,_=W.filter((C)=>C.severity==="info").length,O=T>0?E0("critical"):F>0?E0("warning"):E0("info"),R=[];if(T>0)R.push(N.red(`${T} critical`));if(F>0)R.push(N.yellow(`${F} warning`));if(_>0)R.push(N.dim(`${_} info`));let M=cz[V.category],A=M?N.dim(`PERM: ${M}`):"",w=` ${O} ${N.bold(V.category)} (${R.join(", ")})`;if(A){let C=K4(w),y=K4(A),E=Math.max(2,T0-C-y);$.push(w+" ".repeat(E)+A)}else $.push(w);let L=nz(W),I=Math.min(24,Math.max(...L.map((C)=>C.file.length))),P=0,K=3;for(let C of L){if(P>=K)break;let y=C2(C.file,24),E=N.dim(y.padEnd(I));if(C.entries.length===1){let o=C.entries[0],F0=C2(o.match,50);$.push(` ${E} :${o.line} ${N.dim("--")} ${o.severity==="critical"?F0:N.dim(F0)}`),P++}else if(C.entries.length<=3){let o=C.entries.map((Y$)=>`:${Y$.line}`).join(", "),F0=C2(C.entries[0].match,40);$.push(` ${E} ${o} ${N.dim("--")} ${N.dim(F0)}`),P++}else{let F0=C.entries.slice(0,3).map((t4)=>`:${t4.line}`).join(", "),Y$=C.entries.length-3;$.push(` ${E} ${F0} ${N.dim(`(+${Y$} more)`)}`),P++}}let j=L.length-Math.min(L.length,K);if(j>0){let C=W.length-L.slice(0,K).reduce((y,E)=>y+E.entries.length,0);if(C>0)$.push(` ${N.dim(`... ${C} more in ${j} file${j>1?"s":""}`)}`)}$.push("")}}$.push(N.dim(" "+"=".repeat(T0-2)));let J=new Date(q.scannedAt),Y=`${J.getFullYear()}-${String(J.getMonth()+1).padStart(2,"0")}-${String(J.getDate()).padStart(2,"0")} ${String(J.getHours()).padStart(2,"0")}:${String(J.getMinutes()).padStart(2,"0")}`,B=q.source&&!q.source.fetchError?`github.com/${q.source.owner}`:"";if(B){let V=Math.max(2,T0-2-Y.length-B.length);$.push(N.dim(` ${Y}${" ".repeat(V)}${B}`))}else $.push(N.dim(` ${Y}`));return $.push(""),$.join(`
182
+ `)}function b2(q){return JSON.stringify(q,null,2)}import{writeFile as UG,mkdir as zG,unlink as GG}from"fs/promises";import{join as C4}from"path";import{readdir as sz,readFile as oz}from"fs/promises";import{join as rz}from"path";function S2(q){let $=new Set,Z=q.toLowerCase().split(/[\s\-_.,;:()[\]{}"']+/);for(let X of Z)if(X.length>=2)$.add(X);return $}var tz=10,ez=5,qG=3,$G=1;function ZG(q,$){let Z=S2(q),X=S2($.name),Q=S2($.description),U=0;for(let z of Z){if(X.has(z))U+=tz;if(Q.has(z))U+=qG;if($.name.toLowerCase().includes(z))U+=ez;if($.description.toLowerCase().includes(z))U+=$G}return U}async function A4(q){let $=new Map,Z;try{Z=await sz(q)}catch{return $}for(let X of Z){if(!X.endsWith(".json"))continue;let Q=rz(q,X);try{let U=await oz(Q,"utf-8"),z=JSON.parse(U);for(let G of z.skills){if(!("license"in G))G.license="";if(!("creator"in G))G.creator="";if(!("compatibility"in G))G.compatibility="";if(!("allowedTools"in G))G.allowedTools=[]}$.set(`${z.owner}/${z.repo}`,z)}catch{}}return $}async function G$(){let q=await A4(P4()),$=await A4(Yq()),Z=new Map(q);for(let[X,Q]of $)Z.set(X,Q);return Array.from(Z.values())}var XG=["license","creator","version"];function D4(q){return XG.includes(q)}function w4(q,$){return q[$]||""}function QG(q,$){if($.has)for(let Z of $.has){if(!D4(Z))continue;if(!w4(q,Z))return!1}if($.missing)for(let Z of $.missing){if(!D4(Z))continue;if(w4(q,Z))return!1}return!0}function N4(q){let $=[];if(!q.license)$.push("license");if(!q.creator)$.push("creator");if(!q.version||q.version==="0.0.0")$.push("version");return $}async function J$(q,$=20,Z){let X=await G$(),Q=[],U=!q&&Z;for(let z of X)for(let G of z.skills){if(Z&&!QG(G,Z))continue;let J=U?1:ZG(q,G);if(J>0)Q.push({skill:G,repo:{owner:z.owner,repo:z.repo},score:J})}return Q.sort((z,G)=>G.score-z.score),Q.slice(0,$)}async function j4(){return(await G$()).reduce(($,Z)=>$+Z.skillCount,0)}async function JG(){let q=Yq();return await zG(q,{recursive:!0}),q}async function b4(q){await h0();let $;try{$=x0(q)}catch(X){return{success:!1,repoIndex:null,error:X.message}}if($.isLocal)return{success:!1,repoIndex:null,error:"Local paths are not supported for indexing. Use a GitHub source instead."};f(`ingester: cloning ${$.owner}/${$.repo}`);let Z=null;try{Z=await k0($),f(`ingester: discovering skills in ${Z}`);let X=await _q(Z);f(`ingester: found ${X.length} skills`);let Q=X.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})),U={repoUrl:$.cloneUrl,owner:$.owner,repo:$.repo,updatedAt:new Date().toISOString(),skillCount:Q.length,skills:Q},z=await JG(),G=C4(z,`${$.owner}_${$.repo}.json`);return await UG(G,JSON.stringify(U,null,2)+`
183
+ `,"utf-8"),f(`ingester: wrote index to ${G}`),{success:!0,repoIndex:U}}catch(X){return{success:!1,repoIndex:null,error:X.message}}finally{if(Z)await a(Z)}}async function S4(){return(await G$()).map(($)=>({owner:$.owner,repo:$.repo,skillCount:$.skillCount,updatedAt:$.updatedAt})).sort(($,Z)=>Z.skillCount-$.skillCount)}async function E4(q,$){let Z=Yq(),X=C4(Z,`${q}_${$}.json`);try{return await GG(X),!0}catch{return!1}}function YG(q){let $=q.slice(2),Z={command:null,subcommand:null,positional:[],flags:{help:!1,version:!1,json:!1,yes:!1,noColor:!1,scope:"both",sort:"name",provider:null,name:null,force:!1,path:null,all:!1,verbose:!1,flat:!1,transport:"auto",method:"default",installed:!1,available:!1,has:[],missing:[]}},X=0;while(X<$.length){let Q=$[X];if(Q==="--help"||Q==="-h")Z.flags.help=!0;else if(Q==="--version"||Q==="-v")Z.flags.version=!0;else if(Q==="--json")Z.flags.json=!0;else if(Q==="--yes"||Q==="-y")Z.flags.yes=!0;else if(Q==="--no-color")Z.flags.noColor=!0;else if(Q==="--scope"||Q==="-s"){X++;let U=$[X];if(U==="global"||U==="project"||U==="both")Z.flags.scope=U;else b(`Invalid scope: "${U}". Must be global, project, or both.`),process.exit(2)}else if(Q==="--sort"){X++;let U=$[X];if(U==="name"||U==="version"||U==="location")Z.flags.sort=U;else b(`Invalid sort: "${U}". Must be name, version, or location.`),process.exit(2)}else if(Q==="--provider"||Q==="-p"||Q==="--tool")X++,Z.flags.provider=$[X]||null;else if(Q==="--name")X++,Z.flags.name=$[X]||null;else if(Q==="--force"||Q==="-f")Z.flags.force=!0;else if(Q==="--path")X++,Z.flags.path=$[X]||null;else if(Q==="--all")Z.flags.all=!0;else if(Q==="--verbose"||Q==="-V")Z.flags.verbose=!0;else if(Q==="--flat")Z.flags.flat=!0;else if(Q==="--installed")Z.flags.installed=!0;else if(Q==="--available")Z.flags.available=!0;else if(Q==="--transport"||Q==="-t"){X++;let U=$[X];if(U==="https"||U==="ssh"||U==="auto")Z.flags.transport=U;else b(`Invalid transport: "${U}". Must be https, ssh, or auto.`),process.exit(2)}else if(Q==="--method"||Q==="-m"){X++;let U=$[X];if(U==="default"||U==="vercel")Z.flags.method=U;else b(`Invalid method: "${U}". Must be default or vercel.`),process.exit(2)}else if(Q==="--skill")X++,Z.flags.path=$[X]||null;else if(Q==="--has"){if(X++,$[X])Z.flags.has.push($[X])}else if(Q==="--missing"){if(X++,$[X])Z.flags.missing.push($[X])}else if(Q.startsWith("-"))b(`Unknown option: ${Q}`),console.error('Run "asm --help" for usage.'),process.exit(2);else if(!Z.command)Z.command=Q;else if(!Z.subcommand)Z.subcommand=Q;else Z.positional.push(Q);X++}return Z}function b(q){console.error(H.red(`Error: ${q}`))}function HG(){console.log(`${H.blueBold("agent-skill-manager")} (${H.bold("asm")}) ${k2}
184
184
 
185
185
  Interactive TUI and CLI for managing installed skills for AI coding agents.
186
186
 
@@ -216,7 +216,7 @@ ${H.bold("Global Options:")}
216
216
  --sort <field> Sort by: name, version, or location (default: name)
217
217
  --flat Show one row per tool instance (list, search)
218
218
  -y, --yes Skip confirmation prompts
219
- -V, --verbose Show debug output`)}function HG(){console.log(`${H.bold("Usage:")} asm list [options]
219
+ -V, --verbose Show debug output`)}function VG(){console.log(`${H.bold("Usage:")} asm list [options]
220
220
 
221
221
  List all discovered skills. By default, skills installed across multiple
222
222
  tools are grouped into a single row with tool badges.
@@ -236,7 +236,7 @@ ${H.bold("Examples:")}
236
236
  asm list -p claude ${H.dim("Only Claude Code skills")}
237
237
  asm list -s project ${H.dim("Only project-scoped skills")}
238
238
  asm list --sort version ${H.dim("Sort by version")}
239
- asm list --json ${H.dim("Output as JSON")}`)}function VG(){console.log(`${H.bold("Usage:")} asm search <query> [options]
239
+ asm list --json ${H.dim("Output as JSON")}`)}function WG(){console.log(`${H.bold("Usage:")} asm search <query> [options]
240
240
 
241
241
  Search both installed skills and the skill index. Results show installation
242
242
  status and include copy-paste install commands for available skills.
@@ -257,7 +257,7 @@ ${H.bold("Examples:")}
257
257
  asm search review -p claude ${H.dim("Search within Claude Code only")}
258
258
  asm search "test" --installed ${H.dim("Search installed skills only")}
259
259
  asm search "test" --available ${H.dim("Search available skills only")}
260
- asm search openspec --json ${H.dim("Output matches as JSON")}`)}function WG(){console.log(`${H.bold("Usage:")} asm inspect <skill-name> [options]
260
+ asm search openspec --json ${H.dim("Output matches as JSON")}`)}function BG(){console.log(`${H.bold("Usage:")} asm inspect <skill-name> [options]
261
261
 
262
262
  Show detailed information for a skill. The <skill-name> is the directory name.
263
263
  Shows version, description, file count, and all provider installations.
@@ -271,7 +271,7 @@ ${H.bold("Options:")}
271
271
  ${H.bold("Examples:")}
272
272
  asm inspect code-review ${H.dim("Show details for code-review")}
273
273
  asm inspect code-review --json ${H.dim("Output as JSON")}
274
- asm inspect code-review -s global ${H.dim("Global installations only")}`)}function BG(){console.log(`${H.bold("Usage:")} asm uninstall <skill-name> [options]
274
+ asm inspect code-review -s global ${H.dim("Global installations only")}`)}function _G(){console.log(`${H.bold("Usage:")} asm uninstall <skill-name> [options]
275
275
 
276
276
  Remove a skill and its associated rule files. Shows a removal plan
277
277
  before proceeding and asks for confirmation.
@@ -285,7 +285,7 @@ ${H.bold("Options:")}
285
285
  ${H.bold("Examples:")}
286
286
  asm uninstall code-review ${H.dim("Remove with confirmation")}
287
287
  asm uninstall code-review -y ${H.dim("Remove without confirmation")}
288
- asm uninstall code-review -s project ${H.dim("Remove project copy only")}`)}function _G(){console.log(`${H.bold("Usage:")} asm audit [subcommand] [options]
288
+ asm uninstall code-review -s project ${H.dim("Remove project copy only")}`)}function OG(){console.log(`${H.bold("Usage:")} asm audit [subcommand] [options]
289
289
 
290
290
  Detect duplicate skills or run security audits on installed/remote skills.
291
291
 
@@ -309,7 +309,7 @@ ${H.bold("Examples:")}
309
309
  asm audit security --all ${H.dim("Audit all installed skills")}
310
310
  asm audit security code-review --json ${H.dim("Output audit as JSON")}
311
311
  asm audit security https://github.com/user/skills/tree/main/skills/agent-config
312
- ${H.dim("Audit a skill from a subfolder URL")}`)}function OG(){console.log(`${H.bold("Usage:")} asm config <subcommand>
312
+ ${H.dim("Audit a skill from a subfolder URL")}`)}function TG(){console.log(`${H.bold("Usage:")} asm config <subcommand>
313
313
 
314
314
  Manage configuration. Config is stored at ~/.config/agent-skill-manager/.
315
315
 
@@ -325,20 +325,20 @@ ${H.bold("Options:")}
325
325
  ${H.bold("Examples:")}
326
326
  asm config show ${H.dim("View current config")}
327
327
  asm config edit ${H.dim("Edit in $EDITOR")}
328
- asm config reset -y ${H.dim("Reset without confirmation")}`)}async function n4(q){for(let $ of q)$.warnings=await J4($)}async function TG(q){if(q.flags.help){HG();return}let $=await h(),Z=await i($,q.flags.scope);if(q.flags.provider&&q.command==="list")Z=Z.filter((Q)=>Q.provider===q.flags.provider);await n4(Z);let X=f2(Z,q.flags.sort);if(q.flags.json)console.log(u(X));else if(q.flags.flat){let Q=x2(X),U=X.filter((z)=>z.warnings&&z.warnings.length>0);if(U.length>0)Q+=`
329
- ${H.yellow(`${U.length} skill${U.length===1?"":"s"} with warnings -- use --json for details`)}`;console.log(Q)}else console.log(m4(X))}async function FG(q){if(q.flags.help){VG();return}let $=q.subcommand;if(!$)b("Missing required argument: <query>"),console.error('Run "asm search --help" for usage.'),process.exit(2);let Z=!q.flags.available,X=!q.flags.installed,Q=[];if(Z){let J=await h(),Y=await i(J,q.flags.scope);if(q.flags.provider)Y=Y.filter((V)=>V.provider===q.flags.provider);let B=x4(Y,$);Q=f2(B,q.flags.sort)}let U=[];if(X){if(U=await J$($),Q.length>0){let J=new Set(Q.map((Y)=>Y.name.toLowerCase()));U=U.filter((Y)=>!J.has(Y.skill.name.toLowerCase()))}}if(q.flags.json){let J=Q.map((B)=>({name:B.name,description:B.description,version:B.version,scope:B.scope,provider:B.provider,status:"installed"})),Y=U.map((B)=>({name:B.skill.name,description:B.skill.description,version:B.skill.version,repo:`${B.repo.owner}/${B.repo.repo}`,installCommand:`asm install ${B.skill.installUrl}`,status:"available"}));console.log(u([...J,...Y]));return}let z=Q.length>0,G=U.length>0;if(!z&&!G){console.error(`No skills matching "${$}".`),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(z)if(console.error(H.bold(`Installed skills matching "${$}":
330
- `)),q.flags.flat)console.log(x2(Q));else console.log(p4(Q,$));if(G){if(z)console.error("");console.error(H.bold(`Available skills matching "${$}":
328
+ asm config reset -y ${H.dim("Reset without confirmation")}`)}async function s4(q){for(let $ of q)$.warnings=await Y4($)}async function FG(q){if(q.flags.help){VG();return}let $=await k(),Z=await i($,q.flags.scope);if(q.flags.provider&&q.command==="list")Z=Z.filter((Q)=>Q.provider===q.flags.provider);await s4(Z);let X=f2(Z,q.flags.sort);if(q.flags.json)console.log(u(X));else if(q.flags.flat){let Q=x2(X),U=X.filter((z)=>z.warnings&&z.warnings.length>0);if(U.length>0)Q+=`
329
+ ${H.yellow(`${U.length} skill${U.length===1?"":"s"} with warnings -- use --json for details`)}`;console.log(Q)}else console.log(p4(X))}async function LG(q){if(q.flags.help){WG();return}let $=q.subcommand;if(!$)b("Missing required argument: <query>"),console.error('Run "asm search --help" for usage.'),process.exit(2);let Z=!q.flags.available,X=!q.flags.installed,Q=[];if(Z){let J=await k(),Y=await i(J,q.flags.scope);if(q.flags.provider)Y=Y.filter((V)=>V.provider===q.flags.provider);let B=g4(Y,$);Q=f2(B,q.flags.sort)}let U=[];if(X){if(U=await J$($),Q.length>0){let J=new Set(Q.map((Y)=>Y.name.toLowerCase()));U=U.filter((Y)=>!J.has(Y.skill.name.toLowerCase()))}}if(q.flags.json){let J=Q.map((B)=>({name:B.name,description:B.description,version:B.version,scope:B.scope,provider:B.provider,status:"installed"})),Y=U.map((B)=>({name:B.skill.name,description:B.skill.description,version:B.skill.version,repo:`${B.repo.owner}/${B.repo.repo}`,installCommand:`asm install ${B.skill.installUrl}`,status:"available"}));console.log(u([...J,...Y]));return}let z=Q.length>0,G=U.length>0;if(!z&&!G){console.error(`No skills matching "${$}".`),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(z)if(console.error(H.bold(`Installed skills matching "${$}":
330
+ `)),q.flags.flat)console.log(x2(Q));else console.log(d4(Q,$));if(G){if(z)console.error("");console.error(H.bold(`Available skills matching "${$}":
331
331
  `));for(let J of U){console.error(`${H.cyan(J.skill.name)} ${H.dim(`v${J.skill.version}`)} ${H.dim(`[${J.repo.owner}/${J.repo.repo}]`)}`);for(let Y of g2(J.skill.description,80))console.error(` ${Y}`);console.error(` ${H.green(`asm install ${J.skill.installUrl}`)}
332
- `)}}}async function LG(q){if(q.flags.help){WG();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await h(),Q=(await i(Z,q.flags.scope)).filter((U)=>U.dirName===$);if(Q.length===0)b(`Skill "${$}" not found.`),console.error(H.dim(`Try ${H.bold("asm list")} to see all skills or ${H.bold(`asm search "${$}"`)} to search.`)),process.exit(1);if(await n4(Q),q.flags.json)console.log(u(Q.length===1?Q[0]:Q));else console.log(await d4(Q))}async function IG(q){if(q.flags.help){BG();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm uninstall --help" for usage.'),process.exit(2);let Z=await h(),X=await i(Z,q.flags.scope),Q=k4($,X,Z),U=await h4(Q);if(U.length===0)b(`Skill "${$}" not found or nothing to remove.`),process.exit(1);console.error(H.bold("Removal plan:"));for(let G of U)console.error(` ${H.red("•")} ${u4(G)}`);if(!q.flags.yes){if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
332
+ `)}}}async function IG(q){if(q.flags.help){BG();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await k(),Q=(await i(Z,q.flags.scope)).filter((U)=>U.dirName===$);if(Q.length===0)b(`Skill "${$}" not found.`),console.error(H.dim(`Try ${H.bold("asm list")} to see all skills or ${H.bold(`asm search "${$}"`)} to search.`)),process.exit(1);if(await s4(Q),q.flags.json)console.log(u(Q.length===1?Q[0]:Q));else console.log(await c4(Q))}async function KG(q){if(q.flags.help){_G();return}let $=q.subcommand;if(!$)b("Missing required argument: <skill-name>"),console.error('Run "asm uninstall --help" for usage.'),process.exit(2);let Z=await k(),X=await i(Z,q.flags.scope),Q=k4($,X,Z),U=await v4(Q);if(U.length===0)b(`Skill "${$}" not found or nothing to remove.`),process.exit(1);console.error(H.bold("Removal plan:"));for(let G of U)console.error(` ${H.red("•")} ${m4(G)}`);if(!q.flags.yes){if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
333
333
  ${H.bold("Proceed with removal?")} [y/N] `);let G=await f0();if(G.toLowerCase()!=="y"&&G.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let z=await y2(Q);for(let G of z)console.error(G);console.error(H.green(`
334
334
  Done.`))}function f0(){return new Promise((q)=>{let $="",Z=!1;function X(){process.stdin.removeListener("data",U),process.stdin.removeListener("end",z),process.stdin.pause(),clearTimeout(G)}function Q(J){if(Z)return;Z=!0,X(),q(J)}function U(J){if($+=J,$.includes(`
335
- `))Q($.trim())}function z(){Q($.trim())}let G=setTimeout(()=>{Q($.trim())},30000);process.stdin.setEncoding("utf-8"),process.stdin.on("data",U),process.stdin.on("end",z),process.stdin.resume()})}async function KG(q){if(q.flags.help){_G();return}let $=q.subcommand??"duplicates";if($==="security"){await RG(q);return}if($!=="duplicates")b(`Unknown audit subcommand: "${$}". Use: duplicates, security`),process.exit(2);let Z=await h(),X=await i(Z,"both"),Q=k2(X);if(q.flags.json){console.log(i4(Q));return}if(console.log(l4(Q)),q.flags.yes&&Q.duplicateGroups.length>0){console.error(H.bold(`
336
- Auto-removing duplicates...`));for(let U of Q.duplicateGroups){let z=c4(U.instances),G=z[0].path;for(let J=1;J<z.length;J++){let Y=z[J],B=g4(Y,Z),V=await y2(B,G);for(let W of V)console.error(W)}}console.error(H.green(`
337
- Done.`))}}async function RG(q){let $=q.positional[0];if(q.flags.all)await AG(q);else if(!$)b(`Missing target. Provide a skill name, GitHub source, or use --all.
338
- Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await MG(q,$);else await DG(q,$)}async function AG(q){let $=await h(),Z=await i($,q.flags.scope);if(Z.length===0){if(q.flags.json)console.log("[]");else console.log("No skills found to audit.");return}let X=new Set,Q=Z.filter((z)=>{if(X.has(z.realPath))return!1;return X.add(z.realPath),!0});console.error(`Auditing ${Q.length} skill${Q.length>1?"s":""}...
335
+ `))Q($.trim())}function z(){Q($.trim())}let G=setTimeout(()=>{Q($.trim())},30000);process.stdin.setEncoding("utf-8"),process.stdin.on("data",U),process.stdin.on("end",z),process.stdin.resume()})}async function RG(q){if(q.flags.help){OG();return}let $=q.subcommand??"duplicates";if($==="security"){await MG(q);return}if($!=="duplicates")b(`Unknown audit subcommand: "${$}". Use: duplicates, security`),process.exit(2);let Z=await k(),X=await i(Z,"both"),Q=h2(X);if(q.flags.json){console.log(a4(Q));return}if(console.log(i4(Q)),q.flags.yes&&Q.duplicateGroups.length>0){console.error(H.bold(`
336
+ Auto-removing duplicates...`));for(let U of Q.duplicateGroups){let z=l4(U.instances),G=z[0].path;for(let J=1;J<z.length;J++){let Y=z[J],B=h4(Y,Z),V=await y2(B,G);for(let W of V)console.error(W)}}console.error(H.green(`
337
+ Done.`))}}async function MG(q){let $=q.positional[0];if(q.flags.all)await AG(q);else if(!$)b(`Missing target. Provide a skill name, GitHub source, or use --all.
338
+ Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await DG(q,$);else await wG(q,$)}async function AG(q){let $=await k(),Z=await i($,q.flags.scope);if(Z.length===0){if(q.flags.json)console.log("[]");else console.log("No skills found to audit.");return}let X=new Set,Q=Z.filter((z)=>{if(X.has(z.realPath))return!1;return X.add(z.realPath),!0});console.error(`Auditing ${Q.length} skill${Q.length>1?"s":""}...
339
339
  `);let U=[];for(let z of Q){console.error(` Scanning ${H.bold(z.name)}...`);let G=await U$(z.realPath,z.name);U.push(G)}if(q.flags.json)console.log(JSON.stringify(U,null,2));else{for(let G of U)console.log(z$(G));let z={safe:0,caution:0,warning:0,dangerous:0};for(let G of U)z[G.verdict]++;if(console.log(H.bold(`
340
- Summary:`)),z.dangerous>0)console.log(` ${H.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${H.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${H.green(`${z.safe} safe`)}`);console.log("")}}async function MG(q,$){let Z=null;try{let X=x0($);if(X.isLocal)throw Error("Local paths are not supported for remote security audits. Use: asm audit security <installed-skill-name>");await k0(),X=await _$(X),console.error(`Cloning ${$} for audit...`),Z=await h0(X,q.flags.transport);let{join:Q}=await import("path"),U=X.subpath?Q(Z,X.subpath):Z,{name:z}=await K0(U),G=await U$(U,z,X.owner,X.repo);if(q.flags.json)console.log(b2(G));else console.log(z$(G))}catch(X){b(X.message),process.exit(1)}finally{if(Z)await a(Z)}}async function DG(q,$){let Z=await h(),Q=(await i(Z,q.flags.scope)).filter((G)=>G.dirName===$);if(Q.length===0)b(`Skill "${$}" not found. Use "asm list" to see installed skills.`),process.exit(1);let U=Q[0];console.error(`Auditing installed skill: ${H.bold(U.name)}...
341
- `);let z=await U$(U.realPath,U.name);if(q.flags.json)console.log(b2(z));else console.log(z$(z))}async function wG(q){if(q.flags.help){OG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: show, path, reset, or edit."),console.error('Run "asm config --help" for usage.'),process.exit(2);switch($){case"show":{let Z=await h();console.log(u(Z));break}case"path":{console.log(E2());break}case"reset":{if(!q.flags.yes){if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`${H.bold("Reset config to defaults?")} [y/N] `);let X=await f0();if(X.toLowerCase()!=="y"&&X.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Z=f4();await y4(Z),console.error(H.green("Config reset to defaults."));break}case"edit":{let Z=process.env.VISUAL||process.env.EDITOR||"vi",[X,Q]=a4(Z),U=E2();await h();let{spawn:z}=await import("child_process");await new Promise((G,J)=>{let Y=z(X,[...Q,U],{stdio:"inherit"});Y.on("close",()=>G()),Y.on("error",J)});break}default:b(`Unknown config subcommand: "${$}". Use: show, path, reset, or edit.`),process.exit(2)}}function PG(){console.log(`${H.bold("Usage:")} asm install <source> [options]
340
+ Summary:`)),z.dangerous>0)console.log(` ${H.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${H.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${H.green(`${z.safe} safe`)}`);console.log("")}}async function DG(q,$){let Z=null;try{let X=x0($);if(X.isLocal)throw Error("Local paths are not supported for remote security audits. Use: asm audit security <installed-skill-name>");await h0(),X=await _$(X),console.error(`Cloning ${$} for audit...`),Z=await k0(X,q.flags.transport);let{join:Q}=await import("path"),U=X.subpath?Q(Z,X.subpath):Z,{name:z}=await K0(U),G=await U$(U,z,X.owner,X.repo);if(q.flags.json)console.log(b2(G));else console.log(z$(G))}catch(X){b(X.message),process.exit(1)}finally{if(Z)await a(Z)}}async function wG(q,$){let Z=await k(),Q=(await i(Z,q.flags.scope)).filter((G)=>G.dirName===$);if(Q.length===0)b(`Skill "${$}" not found. Use "asm list" to see installed skills.`),process.exit(1);let U=Q[0];console.error(`Auditing installed skill: ${H.bold(U.name)}...
341
+ `);let z=await U$(U.realPath,U.name);if(q.flags.json)console.log(b2(z));else console.log(z$(z))}async function PG(q){if(q.flags.help){TG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: show, path, reset, or edit."),console.error('Run "asm config --help" for usage.'),process.exit(2);switch($){case"show":{let Z=await k();console.log(u(Z));break}case"path":{console.log(E2());break}case"reset":{if(!q.flags.yes){if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`${H.bold("Reset config to defaults?")} [y/N] `);let X=await f0();if(X.toLowerCase()!=="y"&&X.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Z=y4();await x4(Z),console.error(H.green("Config reset to defaults."));break}case"edit":{let Z=process.env.VISUAL||process.env.EDITOR||"vi",[X,Q]=n4(Z),U=E2();await k();let{spawn:z}=await import("child_process");await new Promise((G,J)=>{let Y=z(X,[...Q,U],{stdio:"inherit"});Y.on("close",()=>G()),Y.on("error",J)});break}default:b(`Unknown config subcommand: "${$}". Use: show, path, reset, or edit.`),process.exit(2)}}function NG(){console.log(`${H.bold("Usage:")} asm install <source> [options]
342
342
 
343
343
  Install a skill from a GitHub repository or a local folder path.
344
344
 
@@ -398,23 +398,23 @@ ${H.bold("Subfolder URL:")}
398
398
  ${H.bold("Vercel skills CLI:")}
399
399
  asm install github:user/skills --method vercel --skill my-skill
400
400
  asm install https://github.com/user/skills -m vercel --skill my-skill -y
401
- ${H.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function NG(q,$,Z,X,Q,U,z,G){let J=await K0(X),Y=await a2(X),B=X===Z?null:X.split("/").pop(),V=Q||B||$.repo,W=g0(V),T=G.find((L)=>L.name.toLowerCase()===J.name.toLowerCase()&&L.provider===z.name),F,_=!!T;if(T)if(T.version===J.version)F=q.flags.force?"REINSTALL":`UPDATE: ${T.version} (same version)`;else F=`UPDATE: ${T.version} → ${J.version}`;else F="NEW";let O=t2($,Z,X,W,z,q.flags.force||_),R=Y.some((L)=>["Shell commands","Code execution","Credentials"].includes(L.category)),A=Y.some((L)=>["External URLs"].includes(L.category)),M=R?"high":A?"medium":"safe",w=R?H.red("[!] High Risk"):A?H.yellow("[~] Medium Risk"):H.green("[ok] Safe");return{metadata:J,skillName:W,warnings:Y,installStatus:F,riskLevel:M,riskLabel:w,plan:O}}function jG(q,$,Z,X,Q,U){let{metadata:z,warnings:G,installStatus:J,riskLabel:Y,plan:B}=q;if(Q&&U){let V=H.dim(`[${U.index}/${U.total}]`),W=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);console.info(`${V} ${H.bold(z.name)} v${z.version} ${W} ${Y}`)}else{let V=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);if(console.info(` ${H.bold(z.name)} v${z.version} ${V}`),console.info(`
402
- ${H.bold("Install preview:")}`),console.info(` ${H.bold("Name:")} ${z.name}`),console.info(` ${H.bold("Version:")} ${z.version}`),z.description)console.info(` ${H.bold("Description:")} ${H.dim(z.description)}`);if(z.effort)console.info(` ${H.bold("Effort:")} ${v4(z.effort)}`);if(console.info(` ${H.bold("Source:")} ${$}`),X)console.info(` ${H.bold("Tool:")} All (${X.map((W)=>W.label).join(", ")})`),console.info(` ${H.bold("Primary:")} ${Z.label} (${Z.name})`),console.info(` ${H.bold("Symlinks:")} ${X.filter((W)=>W.name!==Z.name).map((W)=>W.label).join(", ")}`);else console.info(` ${H.bold("Tool:")} ${Z.label} (${Z.name})`);if(console.info(` ${H.bold("Target:")} ${B.targetDir}`),console.info(` ${H.bold("Status:")} ${V}`),console.info(` ${H.bold("Risk:")} ${Y}`),G.length>0){console.info(`
401
+ ${H.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function jG(q,$,Z,X,Q,U,z,G){let J=await K0(X),Y=await n2(X),B=X===Z?null:X.split("/").pop(),V=Q||B||$.repo,W=g0(V),T=G.find((L)=>L.name.toLowerCase()===J.name.toLowerCase()&&L.provider===z.name),F,_=!!T;if(T)if(T.version===J.version)F=q.flags.force?"REINSTALL":`UPDATE: ${T.version} (same version)`;else F=`UPDATE: ${T.version} → ${J.version}`;else F="NEW";let O=e2($,Z,X,W,z,q.flags.force||_),R=Y.some((L)=>["Shell commands","Code execution","Credentials"].includes(L.category)),M=Y.some((L)=>["External URLs"].includes(L.category)),A=R?"high":M?"medium":"safe",w=R?H.red("[!] High Risk"):M?H.yellow("[~] Medium Risk"):H.green("[ok] Safe");return{metadata:J,skillName:W,warnings:Y,installStatus:F,riskLevel:A,riskLabel:w,plan:O}}function CG(q,$,Z,X,Q,U){let{metadata:z,warnings:G,installStatus:J,riskLabel:Y,plan:B}=q;if(Q&&U){let V=H.dim(`[${U.index}/${U.total}]`),W=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);console.info(`${V} ${H.bold(z.name)} v${z.version} ${W} ${Y}`)}else{let V=J==="NEW"?H.green(`[${J}]`):H.yellow(`[${J}]`);if(console.info(` ${H.bold(z.name)} v${z.version} ${V}`),console.info(`
402
+ ${H.bold("Install preview:")}`),console.info(` ${H.bold("Name:")} ${z.name}`),console.info(` ${H.bold("Version:")} ${z.version}`),z.description)console.info(` ${H.bold("Description:")} ${H.dim(z.description)}`);if(z.effort)console.info(` ${H.bold("Effort:")} ${u4(z.effort)}`);if(console.info(` ${H.bold("Source:")} ${$}`),X)console.info(` ${H.bold("Tool:")} All (${X.map((W)=>W.label).join(", ")})`),console.info(` ${H.bold("Primary:")} ${Z.label} (${Z.name})`),console.info(` ${H.bold("Symlinks:")} ${X.filter((W)=>W.name!==Z.name).map((W)=>W.label).join(", ")}`);else console.info(` ${H.bold("Tool:")} ${Z.label} (${Z.name})`);if(console.info(` ${H.bold("Target:")} ${B.targetDir}`),console.info(` ${H.bold("Status:")} ${V}`),console.info(` ${H.bold("Risk:")} ${Y}`),G.length>0){console.info(`
403
403
  ${H.bold("Security warnings:")}`);let W=new Map;for(let T of G){let F=W.get(T.category)||[];F.push(T),W.set(T.category,F)}for(let[T,F]of W){let O=["Shell commands","Code execution","Credentials"].includes(T)?H.red(`[${T}]`):H.yellow(`[${T}]`);console.info(`
404
- ${O} ${H.dim(`(${F.length} match${F.length>1?"es":""})`)}`);for(let R of F.slice(0,5))console.info(` ${H.dim(`${R.file}:${R.line}`)} -- ${R.match}`);if(F.length>5)console.info(H.dim(` ... and ${F.length-5} more`))}}}}async function CG(q,$){if($)return await n2(q,$);return await O$(q)}async function bG(q){if(q.flags.help){PG();return}let $=q.subcommand;if(!$)b("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,X=7,Q=0,U=(G)=>{return Q++,`
405
- ${H.cyan(`[Step ${Q}/${X}]`)} ${H.bold(G)}`},z=()=>{if(Z)a(Z).finally(()=>process.exit(1));else process.exit(1)};process.on("SIGINT",z),process.on("SIGTERM",z);try{console.info(U("Parsing source"));let G=x0($),J=!!G.isLocal;if(J){let L=G.localPath;console.info(` ${H.dim(`local: ${L}`)}`);let{stat:I}=await import("fs/promises");try{if(!(await I(L)).isDirectory())throw Error(`Path is not a directory: ${L}`)}catch(P){if(P.code==="ENOENT")throw Error(`Path does not exist: ${L}`);throw P}}else await k0(),G=await _$(G),console.info(` ${H.dim($)}`);if(q.flags.method==="vercel"){console.info(U("Installing via Vercel skills CLI")),await s2();let L=r2(G),I=q.flags.path||null;console.info(` ${H.dim(`npx skills add ${L}${I?` --skill ${I}`:""}`)}`);let{stdout:P,stderr:K}=await o2(L,I);if(P.trim())console.info(` ${H.dim(P.trim())}`);if(K.trim())console.error(` ${H.dim(K.trim())}`);console.info(` ${H.green("✓")} Vercel skills CLI install completed`),q.flags.force=!0,console.info(` ${H.dim("Continuing with asm install to register in local inventory...")}`)}console.info(U("Selecting provider"));let Y=await h(),{provider:B,allProviders:V}=await Oq(Y,q.flags.provider,!!process.stdin.isTTY);if(J)console.info(U("Reading local source")),console.info(` ${H.dim(G.localPath)}`),Z=null;else{console.info(U("Cloning repository"));let L=q.flags.transport,I=L==="ssh"?G.sshCloneUrl:L==="https"?G.cloneUrl:`${G.cloneUrl} ${H.dim("(auto)")}`;console.info(` ${I}${G.ref?` ${H.dim(`(ref: ${G.ref})`)}`:""}${G.subpath?` ${H.dim(`(path: ${G.subpath})`)}`:""}`),Z=await h0(G,L)}let W=J?G.localPath:Z;console.info(U("Scanning for skills"));let{join:T}=await import("path"),F=[],_=q.flags.path||G.subpath,O=[];if(_){let L=T(W,_);try{await K0(L)}catch{throw Error(`No SKILL.md found at path "${_}" in the repository.`)}console.info(` Found skill at ${H.bold(_)}`),O=[{skillDir:L,nameOverride:q.flags.name}]}else{let L=!1;try{await K0(W),L=!0}catch{}if(L){let I=await K0(W);console.info(` Found: ${H.bold(I.name)} v${I.version}`),O=[{skillDir:W,nameOverride:q.flags.name}]}else{console.info(" No SKILL.md at root. Scanning subdirectories...");let I=await _q(W);if(I.length===0)throw Error("No skills found in this repository. Skills must have a SKILL.md file.");console.info(` Found ${H.bold(String(I.length))} skill(s):
404
+ ${O} ${H.dim(`(${F.length} match${F.length>1?"es":""})`)}`);for(let R of F.slice(0,5))console.info(` ${H.dim(`${R.file}:${R.line}`)} -- ${R.match}`);if(F.length>5)console.info(H.dim(` ... and ${F.length-5} more`))}}}}async function bG(q,$){if($)return await s2(q,$);return await O$(q)}async function SG(q){if(q.flags.help){NG();return}let $=q.subcommand;if(!$)b("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,X=7,Q=0,U=(G)=>{return Q++,`
405
+ ${H.cyan(`[Step ${Q}/${X}]`)} ${H.bold(G)}`},z=()=>{if(Z)a(Z).finally(()=>process.exit(1));else process.exit(1)};process.on("SIGINT",z),process.on("SIGTERM",z);try{console.info(U("Parsing source"));let G=x0($),J=!!G.isLocal;if(J){let L=G.localPath;console.info(` ${H.dim(`local: ${L}`)}`);let{stat:I}=await import("fs/promises");try{if(!(await I(L)).isDirectory())throw Error(`Path is not a directory: ${L}`)}catch(P){if(P.code==="ENOENT")throw Error(`Path does not exist: ${L}`);throw P}}else await h0(),G=await _$(G),console.info(` ${H.dim($)}`);if(q.flags.method==="vercel"){console.info(U("Installing via Vercel skills CLI")),await o2();let L=t2(G),I=q.flags.path||null;console.info(` ${H.dim(`npx skills add ${L}${I?` --skill ${I}`:""}`)}`);let{stdout:P,stderr:K}=await r2(L,I);if(P.trim())console.info(` ${H.dim(P.trim())}`);if(K.trim())console.error(` ${H.dim(K.trim())}`);console.info(` ${H.green("✓")} Vercel skills CLI install completed`),q.flags.force=!0,console.info(` ${H.dim("Continuing with asm install to register in local inventory...")}`)}console.info(U("Selecting provider"));let Y=await k(),{provider:B,allProviders:V}=await Oq(Y,q.flags.provider,!!process.stdin.isTTY);if(J)console.info(U("Reading local source")),console.info(` ${H.dim(G.localPath)}`),Z=null;else{console.info(U("Cloning repository"));let L=q.flags.transport,I=L==="ssh"?G.sshCloneUrl:L==="https"?G.cloneUrl:`${G.cloneUrl} ${H.dim("(auto)")}`;console.info(` ${I}${G.ref?` ${H.dim(`(ref: ${G.ref})`)}`:""}${G.subpath?` ${H.dim(`(path: ${G.subpath})`)}`:""}`),Z=await k0(G,L)}let W=J?G.localPath:Z;console.info(U("Scanning for skills"));let{join:T}=await import("path"),F=[],_=q.flags.path||G.subpath,O=[];if(_){let L=T(W,_);try{await K0(L)}catch{throw Error(`No SKILL.md found at path "${_}" in the repository.`)}console.info(` Found skill at ${H.bold(_)}`),O=[{skillDir:L,nameOverride:q.flags.name}]}else{let L=!1;try{await K0(W),L=!0}catch{}if(L){let I=await K0(W);console.info(` Found: ${H.bold(I.name)} v${I.version}`),O=[{skillDir:W,nameOverride:q.flags.name}]}else{console.info(" No SKILL.md at root. Scanning subdirectories...");let I=await _q(W);if(I.length===0)throw Error("No skills found in this repository. Skills must have a SKILL.md file.");console.info(` Found ${H.bold(String(I.length))} skill(s):
406
406
  `);for(let j=0;j<I.length;j++){let C=H.cyan(` ${String(j+1).padStart(String(I.length).length)})`);if(console.info(`${C} ${H.bold(I[j].name)} ${H.dim(`v${I[j].version}`)} ${H.dim(`(${I[j].relPath})`)}`),I[j].description)console.info(` ${H.dim(I[j].description)}`)}console.info(U("Selecting skills")),Q--;let P;if(q.flags.all&&(q.flags.yes||!process.stdin.isTTY))P=I.map((j)=>j.relPath),console.info(` Selected all ${H.bold(String(P.length))} skills`);else if(process.stdin.isTTY)if(I.length===1)P=[I[0].relPath],console.info(` Auto-selected: ${H.bold(I[0].name)} ${H.dim(`v${I[0].version}`)}`);else{let j=I.map((y)=>({label:y.name,hint:`v${y.version}${y.description?" "+y.description:""}`,checked:!!q.flags.all}));console.info("");let C=await Vq({items:j});if(C.length===0)throw Error("No skills selected. Aborting.");P=C.map((y)=>I[y].relPath),console.info(` Selected ${H.bold(String(P.length))} skill(s)`)}else{b(`Repository contains ${I.length} skills. Use --path <subdir> to pick one or --all to install all.
407
407
  Available skills:
408
408
  ${I.map((j)=>` --path ${j.relPath}`).join(`
409
- `)}`),process.exit(2);return}let K=i2(P);if(K.length>0){let j=K.map((y)=>` - ${y.name}: ${y.paths.map((E)=>`"${E}"`).join(", ")}`).join(`
409
+ `)}`),process.exit(2);return}let K=a2(P);if(K.length>0){let j=K.map((y)=>` - ${y.name}: ${y.paths.map((E)=>`"${E}"`).join(", ")}`).join(`
410
410
  `),C=Error(`Duplicate skill names detected in selection:
411
411
  ${j}
412
- Choose one path per skill name or install with --path.`);throw C.duplicates=K,C}O=P.map((j)=>({skillDir:T(W,j),nameOverride:P.length===1?q.flags.name:null})),Q++}}console.info(U("Inspecting skills"));let R=await i(Y,"both"),A=[],M=O.length>1;for(let L=0;L<O.length;L++){let{skillDir:I,nameOverride:P}=O[L],K=await NG(q,G,W,I,P,Y,B,R);A.push(K),jG(K,$,B,V,M,M?{index:L+1,total:O.length}:void 0)}if(M){if(console.info(""),console.info(` ${H.bold("Install settings:")}`),console.info(` ${H.bold("Source:")} ${$}`),V)console.info(` ${H.bold("Tool:")} All (${V.map((j)=>j.label).join(", ")})`);else console.info(` ${H.bold("Tool:")} ${B.label} (${B.name})`);let L=A.filter((j)=>j.riskLevel==="high").length,I=A.filter((j)=>j.riskLevel==="medium").length,P=A.filter((j)=>j.riskLevel==="safe").length,K=[];if(P>0)K.push(H.green(`${P} Safe`));if(I>0)K.push(H.yellow(`${I} Medium Risk`));if(L>0)K.push(H.red(`${L} High Risk`));console.info(` ${H.bold("Risk:")} ${K.join(", ")}`)}if(console.info(U("Installing")),!q.flags.yes){let L=A.some((j)=>j.riskLevel==="high");if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);let I=M?`${A.length} skills`:`"${A[0].metadata.name}"`,P=L?`
412
+ Choose one path per skill name or install with --path.`);throw C.duplicates=K,C}O=P.map((j)=>({skillDir:T(W,j),nameOverride:P.length===1?q.flags.name:null})),Q++}}console.info(U("Inspecting skills"));let R=await i(Y,"both"),M=[],A=O.length>1;for(let L=0;L<O.length;L++){let{skillDir:I,nameOverride:P}=O[L],K=await jG(q,G,W,I,P,Y,B,R);M.push(K),CG(K,$,B,V,A,A?{index:L+1,total:O.length}:void 0)}if(A){if(console.info(""),console.info(` ${H.bold("Install settings:")}`),console.info(` ${H.bold("Source:")} ${$}`),V)console.info(` ${H.bold("Tool:")} All (${V.map((j)=>j.label).join(", ")})`);else console.info(` ${H.bold("Tool:")} ${B.label} (${B.name})`);let L=M.filter((j)=>j.riskLevel==="high").length,I=M.filter((j)=>j.riskLevel==="medium").length,P=M.filter((j)=>j.riskLevel==="safe").length,K=[];if(P>0)K.push(H.green(`${P} Safe`));if(I>0)K.push(H.yellow(`${I} Medium Risk`));if(L>0)K.push(H.red(`${L} High Risk`));console.info(` ${H.bold("Risk:")} ${K.join(", ")}`)}if(console.info(U("Installing")),!q.flags.yes){let L=M.some((j)=>j.riskLevel==="high");if(!process.stdin.isTTY)b("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);let I=A?`${M.length} skills`:`"${M[0].metadata.name}"`,P=L?`
413
413
  ${H.red("[!]")} ${H.bold(`Install ${I}? Some have high-risk patterns.`)} [y/N] `:`
414
- ${H.bold(`Install ${I}?`)} [Y/n] `;process.stderr.write(P);let K=await f0();if(L){if(K.toLowerCase()!=="y"&&K.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}else if(K.toLowerCase()==="n"||K.toLowerCase()==="no")console.error("Aborted."),process.exit(0)}let w=[];for(let L=0;L<A.length;L++){let I=A[L],P=M?H.dim(`[${L+1}/${A.length}]`)+" ":" ";try{console.info(`${P}Installing ${H.bold(I.metadata.name)}...`);let K=await CG(I.plan,V);F.push(K),console.info(`${P}${H.green("✓")} ${I.metadata.name} installed to ${H.dim(I.plan.targetDir)}`)}catch(K){w.push({name:I.metadata.name,error:K.message}),console.error(`${P}${H.red("✗")} ${H.bold(I.metadata.name)} — ${H.red(K.message)}`)}}if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),w.length>0){console.error(`
414
+ ${H.bold(`Install ${I}?`)} [Y/n] `;process.stderr.write(P);let K=await f0();if(L){if(K.toLowerCase()!=="y"&&K.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}else if(K.toLowerCase()==="n"||K.toLowerCase()==="no")console.error("Aborted."),process.exit(0)}let w=[];for(let L=0;L<M.length;L++){let I=M[L],P=A?H.dim(`[${L+1}/${M.length}]`)+" ":" ";try{console.info(`${P}Installing ${H.bold(I.metadata.name)}...`);let K=await bG(I.plan,V);F.push(K),console.info(`${P}${H.green("✓")} ${I.metadata.name} installed to ${H.dim(I.plan.targetDir)}`)}catch(K){w.push({name:I.metadata.name,error:K.message}),console.error(`${P}${H.red("✗")} ${H.bold(I.metadata.name)} — ${H.red(K.message)}`)}}if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),w.length>0){console.error(`
415
415
  ${H.yellow(`${w.length} skill(s) failed to install:`)}`);for(let L of w)console.error(` ${H.red("✗")} ${L.name}: ${L.error}`)}if(q.flags.json)console.log(JSON.stringify(F.length===1?F[0]:F,null,2));else if(F.length===1)console.error(H.green(`
416
416
  Done! Installed "${F[0].name}" to ${F[0].path}`));else if(F.length>0)console.error(`
417
- ${H.green(`Done! Installed ${F.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 b(G.message);process.exit(1)}finally{if(Z)await a(Z)}}function SG(){console.log(`${H.bold("Usage:")} asm export [options]
417
+ ${H.green(`Done! Installed ${F.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 b(G.message);process.exit(1)}finally{if(Z)await a(Z)}}function EG(){console.log(`${H.bold("Usage:")} asm export [options]
418
418
 
419
419
  Export skill inventory as a portable JSON manifest. Useful for backup,
420
420
  sharing, or scripting.
@@ -427,7 +427,7 @@ ${H.bold("Options:")}
427
427
  ${H.bold("Examples:")}
428
428
  asm export ${H.dim("Export all skills")}
429
429
  asm export -s global ${H.dim("Export global skills only")}
430
- asm export > skills.json ${H.dim("Save to file")}`)}async function EG(q){if(q.flags.help){SG();return}let $=await h(),Z=await i($,q.flags.scope),X=Y4(Z);console.log(JSON.stringify(X,null,2))}function fG(){console.log(`${H.bold("Usage:")} asm init <name> [options]
430
+ asm export > skills.json ${H.dim("Save to file")}`)}async function fG(q){if(q.flags.help){EG();return}let $=await k(),Z=await i($,q.flags.scope),X=H4(Z);console.log(JSON.stringify(X,null,2))}function yG(){console.log(`${H.bold("Usage:")} asm init <name> [options]
431
431
 
432
432
  Scaffold a new skill directory with a SKILL.md template. Creates a
433
433
  ready-to-edit skill in the target tool's skill folder.
@@ -442,8 +442,8 @@ ${H.bold("Options:")}
442
442
  ${H.bold("Examples:")}
443
443
  asm init my-skill ${H.dim("Scaffold (interactive tool)")}
444
444
  asm init my-skill -p claude ${H.dim("Scaffold in Claude Code")}
445
- asm init my-skill --path ./skills ${H.dim("Scaffold in custom directory")}`)}async function yG(q){if(q.flags.help){fG();return}let $=q.subcommand;if(!$)b("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=g0($),X;if(q.flags.path){let{resolve:Q}=await import("path");X=Q(q.flags.path)}else{let Q=await h(),{provider:U}=await Oq(Q,q.flags.provider,!!process.stdin.isTTY),{join:z}=await import("path"),{resolveProviderPath:G}=await import("./chunk-dykgxxyr.js"),J=G(Q.providers.find((Y)=>Y.name===U.name).global);X=z(J,Z)}if(await V4(X)){if(!q.flags.force){if(!process.stdin.isTTY)b(`Directory already exists: ${X}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Directory already exists: ${X}`)}
446
- ${H.bold("Overwrite?")} [y/N] `);let Q=await f0();if(Q.toLowerCase()!=="y"&&Q.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}await H4(Z,X),console.error(H.green(`Done! Created skill "${Z}" at ${X}`))}function xG(){console.log(`${H.bold("Usage:")} asm stats [options]
445
+ asm init my-skill --path ./skills ${H.dim("Scaffold in custom directory")}`)}async function xG(q){if(q.flags.help){yG();return}let $=q.subcommand;if(!$)b("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=g0($),X;if(q.flags.path){let{resolve:Q}=await import("path");X=Q(q.flags.path)}else{let Q=await k(),{provider:U}=await Oq(Q,q.flags.provider,!!process.stdin.isTTY),{join:z}=await import("path"),{resolveProviderPath:G}=await import("./chunk-b7betbzn.js"),J=G(Q.providers.find((Y)=>Y.name===U.name).global);X=z(J,Z)}if(await W4(X)){if(!q.flags.force){if(!process.stdin.isTTY)b(`Directory already exists: ${X}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Directory already exists: ${X}`)}
446
+ ${H.bold("Overwrite?")} [y/N] `);let Q=await f0();if(Q.toLowerCase()!=="y"&&Q.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}await V4(Z,X),console.error(H.green(`Done! Created skill "${Z}" at ${X}`))}function gG(){console.log(`${H.bold("Usage:")} asm stats [options]
447
447
 
448
448
  Show aggregate skill metrics with provider distribution charts,
449
449
  scope breakdown, disk usage, and duplicate summary.
@@ -457,7 +457,7 @@ ${H.bold("Options:")}
457
457
  ${H.bold("Examples:")}
458
458
  asm stats ${H.dim("Show full dashboard")}
459
459
  asm stats -s global ${H.dim("Global skills only")}
460
- asm stats --json ${H.dim("Output raw data as JSON")}`)}async function gG(q){if(q.flags.help){xG();return}let $=await h(),Z=await i($,q.flags.scope);if(Z.length===0){console.log("No skills found.");return}let X=k2(Z),Q=await _4(Z,X);if(q.flags.json)if(!q.flags.verbose){let{perSkillDiskBytes:U,...z}=Q;console.log(u(z))}else console.log(u(Q));else console.log(O4(Q))}function kG(){console.log(`${H.bold("Usage:")} asm link <path> [options]
460
+ asm stats --json ${H.dim("Output raw data as JSON")}`)}async function hG(q){if(q.flags.help){gG();return}let $=await k(),Z=await i($,q.flags.scope);if(Z.length===0){console.log("No skills found.");return}let X=h2(Z),Q=await O4(Z,X);if(q.flags.json)if(!q.flags.verbose){let{perSkillDiskBytes:U,...z}=Q;console.log(u(z))}else console.log(u(Q));else console.log(T4(Q))}function kG(){console.log(`${H.bold("Usage:")} asm link <path> [options]
461
461
 
462
462
  Symlink a local skill directory into an agent's skill folder. Useful
463
463
  for local development — changes to the source are reflected immediately.
@@ -473,8 +473,8 @@ ${H.bold("Options:")}
473
473
  ${H.bold("Examples:")}
474
474
  asm link ./my-skill ${H.dim("Link (interactive tool)")}
475
475
  asm link ./my-skill -p claude ${H.dim("Link to Claude Code")}
476
- asm link ./my-skill --name alias ${H.dim("Link with custom name")}`)}async function hG(q){if(q.flags.help){kG();return}let $=q.subcommand;if(!$)b("Missing required argument: <path>"),console.error('Run "asm link --help" for usage.'),process.exit(2);let{resolve:Z,basename:X}=await import("path"),Q=Z($),U=await F4(Q),z=q.flags.name?g0(q.flags.name):X(Q),G=await h(),{provider:J}=await Oq(G,q.flags.provider,!!process.stdin.isTTY),{resolveProviderPath:Y}=await import("./chunk-dykgxxyr.js"),B=Y(G.providers.find((T)=>T.name===J.name).global),{join:V}=await import("path"),W=V(B,z);if(!q.flags.force){let T=!1;try{let{access:F}=await import("fs/promises");await F(W),T=!0}catch{}if(T){if(!process.stdin.isTTY)b(`Target already exists: ${W}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Target already exists: ${W}`)}
477
- ${H.bold("Overwrite?")} [y/N] `);let F=await f0();if(F.toLowerCase()!=="y"&&F.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await X$(Q,B,z,!0)}else await X$(Q,B,z,!1)}else await X$(Q,B,z,!0);if(q.flags.json)console.log(u({success:!0,name:z,symlinkPath:W,targetPath:Q}));else console.error(H.green(`Done! Linked "${z}" -> ${Q}`)),console.error(` Symlink: ${W}`),console.error(H.dim(` If you move or delete the source, run "asm uninstall ${z}" to clean up.`))}function vG(){console.log(`${H.bold("Usage:")} asm index <subcommand> [options]
476
+ asm link ./my-skill --name alias ${H.dim("Link with custom name")}`)}async function vG(q){if(q.flags.help){kG();return}let $=q.subcommand;if(!$)b("Missing required argument: <path>"),console.error('Run "asm link --help" for usage.'),process.exit(2);let{resolve:Z,basename:X}=await import("path"),Q=Z($),U=await L4(Q),z=q.flags.name?g0(q.flags.name):X(Q),G=await k(),{provider:J}=await Oq(G,q.flags.provider,!!process.stdin.isTTY),{resolveProviderPath:Y}=await import("./chunk-b7betbzn.js"),B=Y(G.providers.find((T)=>T.name===J.name).global),{join:V}=await import("path"),W=V(B,z);if(!q.flags.force){let T=!1;try{let{access:F}=await import("fs/promises");await F(W),T=!0}catch{}if(T){if(!process.stdin.isTTY)b(`Target already exists: ${W}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${H.yellow(`Target already exists: ${W}`)}
477
+ ${H.bold("Overwrite?")} [y/N] `);let F=await f0();if(F.toLowerCase()!=="y"&&F.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);await X$(Q,B,z,!0)}else await X$(Q,B,z,!1)}else await X$(Q,B,z,!0);if(q.flags.json)console.log(u({success:!0,name:z,symlinkPath:W,targetPath:Q}));else console.error(H.green(`Done! Linked "${z}" -> ${Q}`)),console.error(` Symlink: ${W}`),console.error(H.dim(` If you move or delete the source, run "asm uninstall ${z}" to clean up.`))}function uG(){console.log(`${H.bold("Usage:")} asm index <subcommand> [options]
478
478
 
479
479
  Manage the skill index for searching available skills from indexed repos.
480
480
 
@@ -498,7 +498,7 @@ ${H.bold("Examples:")}
498
498
  asm index search marketing --has license ${H.dim("Only with license")}
499
499
  asm index search "" --missing creator ${H.dim("Skills missing creator")}
500
500
  asm index list ${H.dim("List indexed repos")}
501
- asm index remove obra/superpowers ${H.dim("Remove from index")}`)}async function uG(q){if(q.flags.help){vG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: ingest, search, list, or remove"),console.error('Run "asm index --help" for usage.'),process.exit(2);switch($){case"ingest":{let Z=q.positional[0];if(!Z)b("Missing required argument: <repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);console.error(H.blueBold(`Ingesting ${Z}...`));let X=await C4(Z);if(!X.success)b(`Failed to ingest: ${X.error}`),process.exit(1);if(X.repoIndex)if(q.flags.json)console.log(u({success:!0,owner:X.repoIndex.owner,repo:X.repoIndex.repo,skillCount:X.repoIndex.skillCount,updatedAt:X.repoIndex.updatedAt}));else console.error(H.green(`Successfully indexed ${X.repoIndex.owner}/${X.repoIndex.repo}`)),console.error(` Skills found: ${X.repoIndex.skillCount}`);break}case"search":{let Z=q.positional.join(" ");if(!Z&&q.flags.has.length===0&&q.flags.missing.length===0)b("Missing required argument: <query>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let X={};if(q.flags.has.length>0)X.has=q.flags.has;if(q.flags.missing.length>0)X.missing=q.flags.missing;let U=X.has||X.missing?await J$(Z||"",20,X):await J$(Z);if(U.length===0){if(q.flags.json)console.log(u([]));else console.info("No skills found matching your query."),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(q.flags.json)console.log(u(U.map((z)=>({name:z.skill.name,description:z.skill.description,version:z.skill.version,license:z.skill.license||"",creator:z.skill.creator||"",installUrl:z.skill.installUrl,installCommand:`asm install ${z.skill.installUrl}`,repo:`${z.repo.owner}/${z.repo.repo}`}))));else{console.error(H.bold(`Found ${U.length} skills:
502
- `));for(let z of U){console.error(`${H.cyan(z.skill.name)} ${H.dim(`v${z.skill.version}`)} ${H.dim(`[${z.repo.owner}/${z.repo.repo}]`)}`);for(let J of g2(z.skill.description,80))console.error(` ${J}`);let G=P4(z.skill);if(G.length>0)console.error(` ${H.yellow(`⚠ Missing: ${G.join(", ")}`)}`);console.error(` ${H.green(`asm install ${z.skill.installUrl}`)}
503
- `)}}break}case"list":{let Z=await b4();if(Z.length===0){if(q.flags.json)console.log(u([]));else console.info("No repositories indexed."),console.error(H.dim("Add repos with: asm index ingest <repo>"));return}let X=await N4();if(q.flags.json)console.log(u(Z));else{console.error(H.bold(`Indexed Repositories (${X} total skills):
504
- `));for(let Q of Z)console.error(`${H.cyan(`${Q.owner}/${Q.repo}`)} - ${Q.skillCount} skills ${H.dim(`(${new Date(Q.updatedAt).toLocaleDateString()})`)}`)}break}case"remove":{let Z=q.positional[0];if(!Z)b("Missing required argument: <owner/repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let[X,Q]=Z.split("/");if(!X||!Q)b("Invalid format. Use: <owner/repo>"),process.exit(2);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`${H.bold("Remove")} ${H.cyan(`${X}/${Q}`)} ${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 S4(X,Q))console.error(H.green(`Removed ${X}/${Q} from index`));else b(`Repository not found in index: ${X}/${Q}`),process.exit(1);break}default:b(`Unknown subcommand: "${$}"`),console.error('Run "asm index --help" for usage.'),process.exit(2)}}async function s4(q){let $=JG(q);if($.flags.noColor)globalThis.__CLI_NO_COLOR=!0;if($.flags.verbose)E4(!0);if($.flags.version){console.log(`asm ${h2}`);return}if(!$.command&&$.flags.help){YG();return}if(!$.command)return;switch($.command){case"list":await TG($);break;case"search":await FG($);break;case"inspect":await LG($);break;case"uninstall":await IG($);break;case"audit":await KG($);break;case"install":await bG($);break;case"config":await wG($);break;case"export":await EG($);break;case"init":await yG($);break;case"stats":await gG($);break;case"link":await hG($);break;case"index":await uG($);break;default:b(`Unknown command: "${$.command}"`),console.error('Run "asm --help" for usage.'),process.exit(2)}}function o4(q){let $=q.slice(2);if($.length===0)return!1;let Z=["list","search","inspect","uninstall","audit","config","install","export","init","stats","link","index"],X=$[0];if(Z.includes(X))return!0;if(X==="--help"||X==="-h")return!0;if(X==="--version"||X==="-v")return!0;if(X.startsWith("-")||X.length>0)return!0;return!1}if(o4(process.argv))await s4(process.argv);else await import("./chunk-f9v15smy.js");
501
+ asm index remove obra/superpowers ${H.dim("Remove from index")}`)}async function mG(q){if(q.flags.help){uG();return}let $=q.subcommand;if(!$)b("Missing subcommand. Use: ingest, search, list, or remove"),console.error('Run "asm index --help" for usage.'),process.exit(2);switch($){case"ingest":{let Z=q.positional[0];if(!Z)b("Missing required argument: <repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);console.error(H.blueBold(`Ingesting ${Z}...`));let X=await b4(Z);if(!X.success)b(`Failed to ingest: ${X.error}`),process.exit(1);if(X.repoIndex)if(q.flags.json)console.log(u({success:!0,owner:X.repoIndex.owner,repo:X.repoIndex.repo,skillCount:X.repoIndex.skillCount,updatedAt:X.repoIndex.updatedAt}));else console.error(H.green(`Successfully indexed ${X.repoIndex.owner}/${X.repoIndex.repo}`)),console.error(` Skills found: ${X.repoIndex.skillCount}`);break}case"search":{let Z=q.positional.join(" ");if(!Z&&q.flags.has.length===0&&q.flags.missing.length===0)b("Missing required argument: <query>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let X={};if(q.flags.has.length>0)X.has=q.flags.has;if(q.flags.missing.length>0)X.missing=q.flags.missing;let U=X.has||X.missing?await J$(Z||"",20,X):await J$(Z);if(U.length===0){if(q.flags.json)console.log(u([]));else console.info("No skills found matching your query."),console.error(H.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(q.flags.json)console.log(u(U.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 ${U.length} skills:
502
+ `));for(let z of U){console.error(`${H.cyan(z.skill.name)} ${H.dim(`v${z.skill.version}`)} ${H.dim(`[${z.repo.owner}/${z.repo.repo}]`)}`);for(let J of g2(z.skill.description,80))console.error(` ${J}`);let G=N4(z.skill);if(G.length>0)console.error(` ${H.yellow(`⚠ Missing: ${G.join(", ")}`)}`);console.error(` ${H.green(`asm install ${z.skill.installUrl}`)}
503
+ `)}}break}case"list":{let Z=await S4();if(Z.length===0){if(q.flags.json)console.log(u([]));else console.info("No repositories indexed."),console.error(H.dim("Add repos with: asm index ingest <repo>"));return}let X=await j4();if(q.flags.json)console.log(u(Z));else{console.error(H.bold(`Indexed Repositories (${X} total skills):
504
+ `));for(let Q of Z)console.error(`${H.cyan(`${Q.owner}/${Q.repo}`)} - ${Q.skillCount} skills ${H.dim(`(${new Date(Q.updatedAt).toLocaleDateString()})`)}`)}break}case"remove":{let Z=q.positional[0];if(!Z)b("Missing required argument: <owner/repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let[X,Q]=Z.split("/");if(!X||!Q)b("Invalid format. Use: <owner/repo>"),process.exit(2);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`${H.bold("Remove")} ${H.cyan(`${X}/${Q}`)} ${H.bold("from index?")} [y/N] `);let z=await f0();if(z.toLowerCase()!=="y"&&z.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}if(await E4(X,Q))console.error(H.green(`Removed ${X}/${Q} from index`));else b(`Repository not found in index: ${X}/${Q}`),process.exit(1);break}default:b(`Unknown subcommand: "${$}"`),console.error('Run "asm index --help" for usage.'),process.exit(2)}}async function o4(q){let $=YG(q);if($.flags.noColor)globalThis.__CLI_NO_COLOR=!0;if($.flags.verbose)f4(!0);if($.flags.version){console.log(`asm ${k2}`);return}if(!$.command&&$.flags.help){HG();return}if(!$.command)return;switch($.command){case"list":await FG($);break;case"search":await LG($);break;case"inspect":await IG($);break;case"uninstall":await KG($);break;case"audit":await RG($);break;case"install":await SG($);break;case"config":await PG($);break;case"export":await fG($);break;case"init":await xG($);break;case"stats":await hG($);break;case"link":await vG($);break;case"index":await mG($);break;default:b(`Unknown command: "${$.command}"`),console.error('Run "asm --help" for usage.'),process.exit(2)}}function r4(q){let $=q.slice(2);if($.length===0)return!1;let Z=["list","search","inspect","uninstall","audit","config","install","export","init","stats","link","index"],X=$[0];if(Z.includes(X))return!0;if(X==="--help"||X==="-h")return!0;if(X==="--version"||X==="-v")return!0;if(X.startsWith("-")||X.length>0)return!0;return!1}if(r4(process.argv))await o4(process.argv);else await import("./chunk-6c7f07w3.js");