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