agent-skill-manager 1.17.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -19
- package/data/skill-index/Affitor_affiliate-skills.json +1 -1
- package/data/skill-index/Eronred_aso-skills.json +1 -1
- package/data/skill-index/GPTomics_bioSkills.json +26 -2
- package/data/skill-index/Galaxy-Dawn_claude-scholar.json +1 -1
- package/data/skill-index/Imbad0202_academic-research-skills.json +57 -0
- package/data/skill-index/K-Dense-AI_claude-scientific-skills.json +165 -9
- package/data/skill-index/Leonxlnx_taste-skill.json +1 -1
- package/data/skill-index/Master-cai_Research-Paper-Writing-Skills.json +1 -1
- package/data/skill-index/MiniMax-AI_skills.json +50 -2
- package/data/skill-index/affaan-m_everything-claude-code.json +1 -1
- package/data/skill-index/alirezarezvani_claude-skills.json +5421 -0
- package/data/skill-index/anthropics_skills.json +1 -1
- package/data/skill-index/bytedance_deer-flow.json +2 -2
- package/data/skill-index/coreyhaines31_marketingskills.json +1 -1
- package/data/skill-index/github_awesome-copilot.json +99 -3
- package/data/skill-index/himself65_finance-skills.json +3 -3
- package/data/skill-index/kemiljk_fluid-design.json +1 -1
- package/data/skill-index/kepano_obsidian-skills.json +1 -1
- package/data/skill-index/luongnv89_skills.json +37 -37
- package/data/skill-index/mattpocock_skills.json +14 -2
- package/data/skill-index/nextlevelbuilder_ui-ux-pro-max-skill.json +1 -1
- package/data/skill-index/obra_superpowers.json +1 -1
- package/data/skill-index/sickn33_antigravity-awesome-skills.json +223 -7
- package/data/skill-index/slavingia_skills.json +14 -2
- package/data/skill-index-resources.json +19 -1
- package/dist/agent-skill-manager.js +298 -254
- package/dist/{chunk-n7f2ekqj.js → chunk-33wmae4f.js} +1 -1
- package/dist/{chunk-75kgtp8z.js → chunk-d3ed4n6q.js} +3 -3
- package/dist/chunk-q3gm2x0a.js +3 -0
- package/dist/chunk-v3wdjh4r.js +3 -0
- package/package.json +1 -1
- package/dist/chunk-t6myftbf.js +0 -3
|
@@ -1,163 +1,164 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{B as
|
|
3
|
-
`)}}c.defaultYaml={explicit:!1,version:"1.2"};c.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
4
|
-
`)?
|
|
2
|
+
import{a as f4,b as B5,c as O5,d as F5}from"./chunk-q3gm2x0a.js";import{A as _5,B as m,C as l2,D as T5,F as K5,G as L5,H as n2,I as M5,e as V0,f as W0,g as e2,i as d,j as X5,k as p2,l as Q5,m as G5,n as d2,o as z5,p as Y,q as J5,r as j4,s as U5,t as c2,u as Y5,v as H5,w as V5,z as W5}from"./chunk-d3ed4n6q.js";import{J as u,K as I,L as x,M as q5,N as b,O as $5,P as m2,R as Bq,S as n4,T as u0,U as v,V as Z5}from"./chunk-v3wdjh4r.js";var y=I((Q8)=>{var M$=Symbol.for("yaml.alias"),J1=Symbol.for("yaml.document"),Mq=Symbol.for("yaml.map"),U1=Symbol.for("yaml.pair"),R$=Symbol.for("yaml.scalar"),Rq=Symbol.for("yaml.seq"),e=Symbol.for("yaml.node.type"),r5=(q)=>!!q&&typeof q==="object"&&q[e]===M$,t5=(q)=>!!q&&typeof q==="object"&&q[e]===J1,e5=(q)=>!!q&&typeof q==="object"&&q[e]===Mq,q8=(q)=>!!q&&typeof q==="object"&&q[e]===U1,Y1=(q)=>!!q&&typeof q==="object"&&q[e]===R$,$8=(q)=>!!q&&typeof q==="object"&&q[e]===Rq;function H1(q){if(q&&typeof q==="object")switch(q[e]){case Mq:case Rq:return!0}return!1}function Z8(q){if(q&&typeof q==="object")switch(q[e]){case M$:case Mq:case R$:case Rq:return!0}return!1}var X8=(q)=>(Y1(q)||H1(q))&&!!q.anchor;Q8.ALIAS=M$;Q8.DOC=J1;Q8.MAP=Mq;Q8.NODE_TYPE=e;Q8.PAIR=U1;Q8.SCALAR=R$;Q8.SEQ=Rq;Q8.hasAnchor=X8;Q8.isAlias=r5;Q8.isCollection=H1;Q8.isDocument=t5;Q8.isMap=e5;Q8.isNode=Z8;Q8.isPair=q8;Q8.isScalar=Y1;Q8.isSeq=$8});var d0=I((R8)=>{var k=y(),p=Symbol("break visit"),V1=Symbol("skip children"),s=Symbol("remove node");function Aq(q,$){let Z=W1($);if(k.isDocument(q)){if(P0(null,q.contents,Z,Object.freeze([q]))===s)q.contents=null}else P0(null,q,Z,Object.freeze([]))}Aq.BREAK=p;Aq.SKIP=V1;Aq.REMOVE=s;function P0(q,$,Z,X){let Q=_1(q,$,Z,X);if(k.isNode(Q)||k.isPair(Q))return B1(q,X,Q),P0(q,Q,Z,X);if(typeof Q!=="symbol"){if(k.isCollection($)){X=Object.freeze(X.concat($));for(let G=0;G<$.items.length;++G){let z=P0(G,$.items[G],Z,X);if(typeof z==="number")G=z-1;else if(z===p)return p;else if(z===s)$.items.splice(G,1),G-=1}}else if(k.isPair($)){X=Object.freeze(X.concat($));let G=P0("key",$.key,Z,X);if(G===p)return p;else if(G===s)$.key=null;let z=P0("value",$.value,Z,X);if(z===p)return p;else if(z===s)$.value=null}}return Q}async function Iq(q,$){let Z=W1($);if(k.isDocument(q)){if(await C0(null,q.contents,Z,Object.freeze([q]))===s)q.contents=null}else await C0(null,q,Z,Object.freeze([]))}Iq.BREAK=p;Iq.SKIP=V1;Iq.REMOVE=s;async function C0(q,$,Z,X){let Q=await _1(q,$,Z,X);if(k.isNode(Q)||k.isPair(Q))return B1(q,X,Q),C0(q,Q,Z,X);if(typeof Q!=="symbol"){if(k.isCollection($)){X=Object.freeze(X.concat($));for(let G=0;G<$.items.length;++G){let z=await C0(G,$.items[G],Z,X);if(typeof z==="number")G=z-1;else if(z===p)return p;else if(z===s)$.items.splice(G,1),G-=1}}else if(k.isPair($)){X=Object.freeze(X.concat($));let G=await C0("key",$.key,Z,X);if(G===p)return p;else if(G===s)$.key=null;let z=await C0("value",$.value,Z,X);if(z===p)return p;else if(z===s)$.value=null}}return Q}function W1(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 _1(q,$,Z,X){if(typeof Z==="function")return Z(q,$,X);if(k.isMap($))return Z.Map?.(q,$,X);if(k.isSeq($))return Z.Seq?.(q,$,X);if(k.isPair($))return Z.Pair?.(q,$,X);if(k.isScalar($))return Z.Scalar?.(q,$,X);if(k.isAlias($))return Z.Alias?.(q,$,X);return}function B1(q,$,Z){let X=$[$.length-1];if(k.isCollection(X))X.items[q]=Z;else if(k.isPair(X))if(q==="key")X.key=Z;else X.value=Z;else if(k.isDocument(X))X.contents=Z;else{let Q=k.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}R8.visit=Aq;R8.visitAsync=Iq});var A$=I((N8)=>{var O1=y(),w8=d0(),D8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},j8=(q)=>q.replace(/[!,[\]{}]/g,($)=>D8[$]);class c{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},c.defaultYaml,q),this.tags=Object.assign({},c.defaultTags,$)}clone(){let q=new c(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new c(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:c.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},c.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:c.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},c.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),X=Z.shift();switch(X){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[Q,G]=Z;return this.tags[Q]=G,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[Q]=Z;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let G=/^\d+\.\d+$/.test(Q);return $(6,`Unsupported YAML version ${Q}`,G),!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 G=q.slice(2,-1);if(G==="!"||G==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return G}let[,Z,X]=q.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${q} tag has no suffix`);let Q=this.tags[Z];if(Q)try{return Q+decodeURIComponent(X)}catch(G){return $(String(G)),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 $+j8(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&&O1.isNode(q.contents)){let Q={};w8.visit(q.contents,(G,z)=>{if(O1.isNode(z)&&z.tag)Q[z.tag]=!0}),X=Object.keys(Q)}else X=[];for(let[Q,G]of Z){if(Q==="!!"&&G==="tag:yaml.org,2002:")continue;if(!q||X.some((z)=>z.startsWith(G)))$.push(`%TAG ${Q} ${G}`)}return $.join(`
|
|
3
|
+
`)}}c.defaultYaml={explicit:!1,version:"1.2"};c.defaultTags={"!!":"tag:yaml.org,2002:"};N8.Directives=c});var wq=I((b8)=>{var F1=y(),C8=d0();function E8(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 T1(q){let $=new Set;return C8.visit(q,{Value(Z,X){if(X.anchor)$.add(X.anchor)}}),$}function K1(q,$){for(let Z=1;;++Z){let X=`${q}${Z}`;if(!$.has(X))return X}}function S8(q,$){let Z=[],X=new Map,Q=null;return{onAnchor:(G)=>{Z.push(G),Q??(Q=T1(q));let z=K1($,Q);return Q.add(z),z},setAnchors:()=>{for(let G of Z){let z=X.get(G);if(typeof z==="object"&&z.anchor&&(F1.isScalar(z.node)||F1.isCollection(z.node)))z.node.anchor=z.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=G,J}}},sourceObjects:X}}b8.anchorIsValid=E8;b8.anchorNames=T1;b8.createNodeAnchors=S8;b8.findNewAnchor=K1});var I$=I((g8)=>{function c0(q,$,Z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Q=0,G=X.length;Q<G;++Q){let z=X[Q],J=c0(q,X,String(Q),z);if(J===void 0)delete X[Q];else if(J!==z)X[Q]=J}else if(X instanceof Map)for(let Q of Array.from(X.keys())){let G=X.get(Q),z=c0(q,X,Q,G);if(z===void 0)X.delete(Q);else if(z!==G)X.set(Q,z)}else if(X instanceof Set)for(let Q of Array.from(X)){let G=c0(q,X,Q,Q);if(G===void 0)X.delete(Q);else if(G!==Q)X.delete(Q),X.add(G)}else for(let[Q,G]of Object.entries(X)){let z=c0(q,X,Q,G);if(z===void 0)delete X[Q];else if(z!==G)X[Q]=z}return q.call($,Z,X)}g8.applyReviver=c0});var Z0=I((u8)=>{var v8=y();function L1(q,$,Z){if(Array.isArray(q))return q.map((X,Q)=>L1(X,String(Q),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!v8.hasAnchor(q))return q.toJSON($,Z);let X={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,X),Z.onCreate=(G)=>{X.res=G,delete Z.onCreate};let Q=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(Q);return Q}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}u8.toJS=L1});var Dq=I((c8)=>{var p8=I$(),M1=y(),d8=Z0();class R1{constructor(q){Object.defineProperty(this,M1.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:Z,onAnchor:X,reviver:Q}={}){if(!M1.isDocument(q))throw TypeError("A document argument is required");let G={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},z=d8.toJS(this,"",G);if(typeof X==="function")for(let{count:J,res:U}of G.anchors.values())X(U,J);return typeof Q==="function"?p8.applyReviver(Q,{"":z},"",z):z}}c8.NodeBase=R1});var l0=I((s8)=>{var n8=wq(),a8=d0(),E0=y(),i8=Dq(),o8=Z0();class A1 extends i8.NodeBase{constructor(q){super(E0.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=[],a8.visit(q,{Node:(Q,G)=>{if(E0.isAlias(G)||E0.hasAnchor(G))Z.push(G)}}),$)$.aliasResolveCache=Z;let X=void 0;for(let Q of Z){if(Q===this)break;if(Q.anchor===this.source)X=Q}return X}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:X,maxAliasCount:Q}=$,G=this.resolve(X,$);if(!G){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let z=Z.get(G);if(!z)o8.toJS(G,null,$),z=Z.get(G);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=jq(X,G,Z);if(z.count*z.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,$,Z){let X=`*${this.source}`;if(q){if(n8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(q.implicitKey)return`${X} `}return X}}function jq(q,$,Z){if(E0.isAlias($)){let X=$.resolve(q),Q=Z&&X&&Z.get(X);return Q?Q.count*Q.aliasCount:0}else if(E0.isCollection($)){let X=0;for(let Q of $.items){let G=jq(q,Q,Z);if(G>X)X=G}return X}else if(E0.isPair($)){let X=jq(q,$.key,Z),Q=jq(q,$.value,Z);return Math.max(X,Q)}return 1}s8.Alias=A1});var h=I((ZZ)=>{var t8=y(),e8=Dq(),qZ=Z0(),$Z=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class O0 extends e8.NodeBase{constructor(q){super(t8.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:qZ.toJS(this.value,q,$)}toString(){return String(this.value)}}O0.BLOCK_FOLDED="BLOCK_FOLDED";O0.BLOCK_LITERAL="BLOCK_LITERAL";O0.PLAIN="PLAIN";O0.QUOTE_DOUBLE="QUOTE_DOUBLE";O0.QUOTE_SINGLE="QUOTE_SINGLE";ZZ.Scalar=O0;ZZ.isScalarValue=$Z});var n0=I((YZ)=>{var GZ=l0(),F0=y(),I1=h(),zZ="tag:yaml.org,2002:";function JZ(q,$,Z){if($){let X=Z.filter((G)=>G.tag===$),Q=X.find((G)=>!G.format)??X[0];if(!Q)throw Error(`Tag ${$} not found`);return Q}return Z.find((X)=>X.identify?.(q)&&!X.format)}function UZ(q,$,Z){if(F0.isDocument(q))q=q.contents;if(F0.isNode(q))return q;if(F0.isPair(q)){let V=Z.schema[F0.MAP].createNode?.(Z.schema,null,Z);return V.items.push(q),V}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:X,onAnchor:Q,onTagObj:G,schema:z,sourceObjects:J}=Z,U=void 0;if(X&&q&&typeof q==="object")if(U=J.get(q),U)return U.anchor??(U.anchor=Q(q)),new GZ.Alias(U.anchor);else U={anchor:null,node:null},J.set(q,U);if($?.startsWith("!!"))$=zZ+$.slice(2);let H=JZ(q,$,z.tags);if(!H){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let V=new I1.Scalar(q);if(U)U.node=V;return V}H=q instanceof Map?z[F0.MAP]:(Symbol.iterator in Object(q))?z[F0.SEQ]:z[F0.MAP]}if(G)G(H),delete Z.onTagObj;let _=H?.createNode?H.createNode(Z.schema,q,Z):typeof H?.nodeClass?.from==="function"?H.nodeClass.from(Z.schema,q,Z):new I1.Scalar(q);if($)_.tag=$;else if(!H.default)_.tag=H.tag;if(U)U.node=_;return _}YZ.createNode=UZ});var Nq=I((_Z)=>{var VZ=n0(),r=y(),WZ=Dq();function w$(q,$,Z){let X=Z;for(let Q=$.length-1;Q>=0;--Q){let G=$[Q];if(typeof G==="number"&&Number.isInteger(G)&&G>=0){let z=[];z[G]=X,X=z}else X=new Map([[G,X]])}return VZ.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 w1=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class D1 extends WZ.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)=>r.isNode(Z)||r.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(w1(q))this.add($);else{let[Z,...X]=q,Q=this.get(Z,!0);if(r.isCollection(Q))Q.addIn(X,$);else if(Q===void 0&&this.schema)this.set(Z,w$(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(r.isCollection(X))return X.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...X]=q,Q=this.get(Z,!0);if(X.length===0)return!$&&r.isScalar(Q)?Q.value:Q;else return r.isCollection(Q)?Q.getIn(X,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!r.isPair($))return!1;let Z=$.value;return Z==null||q&&r.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 r.isCollection(X)?X.hasIn(Z):!1}setIn(q,$){let[Z,...X]=q;if(X.length===0)this.set(Z,$);else{let Q=this.get(Z,!0);if(r.isCollection(Q))Q.setIn(X,$);else if(Q===void 0&&this.schema)this.set(Z,w$(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}}_Z.Collection=D1;_Z.collectionFromPath=w$;_Z.isEmptyPath=w1});var a0=I((LZ)=>{var TZ=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function D$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var KZ=(q,$,Z)=>q.endsWith(`
|
|
4
|
+
`)?D$(Z,$):Z.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+
|
|
7
|
-
`){if(Z==="block")
|
|
8
|
-
`&&O!=="\t"){let
|
|
9
|
-
`&&
|
|
10
|
-
${$}${q.slice(0,
|
|
11
|
-
${$}${q.slice(
|
|
12
|
-
`);X=$,Q=$+1,
|
|
13
|
-
`){if(
|
|
14
|
-
|
|
15
|
-
`;while(Z[
|
|
16
|
-
`,
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(q))return
|
|
18
|
-
${Z}`)+"'";return $.implicitKey?X:
|
|
6
|
+
`+D$(Z,$):(q.endsWith(" ")?"":" ")+Z;LZ.indentComment=D$;LZ.lineComment=KZ;LZ.stringifyComment=TZ});var N1=I((wZ)=>{function IZ(q,$,Z="flow",{indentAtStart:X,lineWidth:Q=80,minContentWidth:G=20,onFold:z,onOverflow:J}={}){if(!Q||Q<0)return q;if(Q<G)G=0;let U=Math.max(1+G,1+Q-$.length);if(q.length<=U)return q;let H=[],_={},V=Q-$.length;if(typeof X==="number")if(X>Q-Math.max(2,G))H.push(0);else V=Q-X;let W=void 0,O=void 0,T=!1,B=-1,F=-1,L=-1;if(Z==="block"){if(B=j1(q,B,$.length),B!==-1)V=B+U}for(let M;M=q[B+=1];){if(Z==="quoted"&&M==="\\"){switch(F=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}L=B}if(M===`
|
|
7
|
+
`){if(Z==="block")B=j1(q,B,$.length);V=B+$.length+U,W=void 0}else{if(M===" "&&O&&O!==" "&&O!==`
|
|
8
|
+
`&&O!=="\t"){let A=q[B+1];if(A&&A!==" "&&A!==`
|
|
9
|
+
`&&A!=="\t")W=B}if(B>=V)if(W)H.push(W),V=W+U,W=void 0;else if(Z==="quoted"){while(O===" "||O==="\t")O=M,M=q[B+=1],T=!0;let A=B>L+1?B-2:F-1;if(_[A])return q;H.push(A),_[A]=!0,V=A+U,W=void 0}else T=!0}O=M}if(T&&J)J();if(H.length===0)return q;if(z)z();let R=q.slice(0,H[0]);for(let M=0;M<H.length;++M){let A=H[M],D=H[M+1]||q.length;if(A===0)R=`
|
|
10
|
+
${$}${q.slice(0,D)}`;else{if(Z==="quoted"&&_[A])R+=`${q[A]}\\`;R+=`
|
|
11
|
+
${$}${q.slice(A+1,D)}`}}return R}function j1(q,$,Z){let X=$,Q=$+1,G=q[Q];while(G===" "||G==="\t")if($<Q+Z)G=q[++$];else{do G=q[++$];while(G&&G!==`
|
|
12
|
+
`);X=$,Q=$+1,G=q[Q]}return X}wZ.FOLD_BLOCK="block";wZ.FOLD_FLOW="flow";wZ.FOLD_QUOTED="quoted";wZ.foldFlowLines=IZ});var o0=I((bZ)=>{var i=h(),X0=N1(),Cq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Eq=(q)=>/^(%|---|\.\.\.)/m.test(q);function CZ(q,$,Z){if(!$||$<0)return!1;let X=$-Z,Q=q.length;if(Q<=X)return!1;for(let G=0,z=0;G<Q;++G)if(q[G]===`
|
|
13
|
+
`){if(G-z>X)return!0;if(z=G+1,Q-z<=X)return!1}return!0}function i0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:X}=$,Q=$.options.doubleQuotedMinMultiLineLength,G=$.indent||(Eq(q)?" ":""),z="",J=0;for(let U=0,H=Z[U];H;H=Z[++U]){if(H===" "&&Z[U+1]==="\\"&&Z[U+2]==="n")z+=Z.slice(J,U)+"\\ ",U+=1,J=U,H="\\";if(H==="\\")switch(Z[U+1]){case"u":{z+=Z.slice(J,U);let _=Z.substr(U+2,4);switch(_){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(_.substr(0,2)==="00")z+="\\x"+_.substr(2);else z+=Z.substr(U,6)}U+=5,J=U+1}break;case"n":if(X||Z[U+2]==='"'||Z.length<Q)U+=1;else{z+=Z.slice(J,U)+`
|
|
14
|
+
|
|
15
|
+
`;while(Z[U+2]==="\\"&&Z[U+3]==="n"&&Z[U+4]!=='"')z+=`
|
|
16
|
+
`,U+=2;if(z+=G,Z[U+2]===" ")z+="\\";U+=1,J=U+1}break;default:U+=1}}return z=J?z+Z.slice(J):Z,X?z:X0.foldFlowLines(z,G,X0.FOLD_QUOTED,Cq($,!1))}function j$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return i0(q,$);let Z=$.indent||(Eq(q)?" ":""),X="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${Z}`)+"'";return $.implicitKey?X:X0.foldFlowLines(X,Z,X0.FOLD_FLOW,Cq($,!1))}function S0(q,$){let{singleQuote:Z}=$.options,X;if(Z===!1)X=i0;else{let Q=q.includes('"'),G=q.includes("'");if(Q&&!G)X=j$;else if(G&&!Q)X=i0;else X=Z?j$:i0}return X(q,$)}var N$;try{N$=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{N$=/\n+(?!\n|$)/g}function Pq({comment:q,type:$,value:Z},X,Q,G){let{blockQuote:z,commentString:J,lineWidth:U}=X.options;if(!z||/\n[\t ]+$/.test(Z))return S0(Z,X);let H=X.indent||(X.forceBlockIndent||Eq(Z)?" ":""),_=z==="literal"?!0:z==="folded"||$===i.Scalar.BLOCK_FOLDED?!1:$===i.Scalar.BLOCK_LITERAL?!0:!CZ(Z,U,H.length);if(!Z)return _?`|
|
|
22
22
|
`:`>
|
|
23
|
-
`;let V,W;for(W=Z.length;W>0;--W){let
|
|
24
|
-
`&&
|
|
25
|
-
`);if(
|
|
26
|
-
`)O=O.slice(0,-1);O=O.replace(
|
|
27
|
-
`)L=
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
`)||
|
|
32
|
-
`)?
|
|
33
|
-
`))return
|
|
34
|
-
${
|
|
35
|
-
${$.indent}${
|
|
36
|
-
${
|
|
37
|
-
`:"",
|
|
38
|
-
${
|
|
39
|
-
`&&
|
|
40
|
-
|
|
41
|
-
`}else
|
|
42
|
-
${Z.indent}`}else if(!O&&
|
|
43
|
-
`),
|
|
44
|
-
${Z.indent}`}}else if(
|
|
45
|
-
`)
|
|
46
|
-
${
|
|
23
|
+
`;let V,W;for(W=Z.length;W>0;--W){let D=Z[W-1];if(D!==`
|
|
24
|
+
`&&D!=="\t"&&D!==" ")break}let O=Z.substring(W),T=O.indexOf(`
|
|
25
|
+
`);if(T===-1)V="-";else if(Z===O||T!==O.length-1){if(V="+",G)G()}else V="";if(O){if(Z=Z.slice(0,-O.length),O[O.length-1]===`
|
|
26
|
+
`)O=O.slice(0,-1);O=O.replace(N$,`$&${H}`)}let B=!1,F,L=-1;for(F=0;F<Z.length;++F){let D=Z[F];if(D===" ")B=!0;else if(D===`
|
|
27
|
+
`)L=F;else break}let R=Z.substring(0,L<F?L+1:F);if(R)Z=Z.substring(R.length),R=R.replace(/\n+/g,`$&${H}`);let A=(B?H?"2":"1":"")+V;if(q){if(A+=" "+J(q.replace(/ ?[\r\n]+/g," ")),Q)Q()}if(!_){let D=Z.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${H}`),j=!1,w=Cq(X,!0);if(z!=="folded"&&$!==i.Scalar.BLOCK_FOLDED)w.onOverflow=()=>{j=!0};let K=X0.foldFlowLines(`${R}${D}${O}`,H,X0.FOLD_BLOCK,w);if(!j)return`>${A}
|
|
29
|
+
${H}${K}`}return Z=Z.replace(/\n+/g,`$&${H}`),`|${A}
|
|
30
|
+
${H}${R}${Z}${O}`}function EZ(q,$,Z,X){let{type:Q,value:G}=q,{actualString:z,implicitKey:J,indent:U,indentStep:H,inFlow:_}=$;if(J&&G.includes(`
|
|
31
|
+
`)||_&&/[[\]{},]/.test(G))return S0(G,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(G))return J||_||!G.includes(`
|
|
32
|
+
`)?S0(G,$):Pq(q,$,Z,X);if(!J&&!_&&Q!==i.Scalar.PLAIN&&G.includes(`
|
|
33
|
+
`))return Pq(q,$,Z,X);if(Eq(G)){if(U==="")return $.forceBlockIndent=!0,Pq(q,$,Z,X);else if(J&&U===H)return S0(G,$)}let V=G.replace(/\n+/g,`$&
|
|
34
|
+
${U}`);if(z){let W=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(V),{compat:O,tags:T}=$.doc.schema;if(T.some(W)||O?.some(W))return S0(G,$)}return J?V:X0.foldFlowLines(V,U,X0.FOLD_FLOW,Cq($,!1))}function SZ(q,$,Z,X){let{implicitKey:Q,inFlow:G}=$,z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:J}=q;if(J!==i.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))J=i.Scalar.QUOTE_DOUBLE}let U=(_)=>{switch(_){case i.Scalar.BLOCK_FOLDED:case i.Scalar.BLOCK_LITERAL:return Q||G?S0(z.value,$):Pq(z,$,Z,X);case i.Scalar.QUOTE_DOUBLE:return i0(z.value,$);case i.Scalar.QUOTE_SINGLE:return j$(z.value,$);case i.Scalar.PLAIN:return EZ(z,$,Z,X);default:return null}},H=U(J);if(H===null){let{defaultKeyType:_,defaultStringType:V}=$.options,W=Q&&_||V;if(H=U(W),H===null)throw Error(`Unsupported default string type ${W}`)}return H}bZ.stringifyString=SZ});var s0=I((mZ)=>{var yZ=wq(),Q0=y(),xZ=a0(),hZ=o0();function gZ(q,$){let Z=Object.assign({blockQuote:!0,commentString:xZ.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 kZ(q,$){if($.tag){let Q=q.filter((G)=>G.tag===$.tag);if(Q.length>0)return Q.find((G)=>G.format===$.format)??Q[0]}let Z=void 0,X;if(Q0.isScalar($)){X=$.value;let Q=q.filter((G)=>G.identify?.(X));if(Q.length>1){let G=Q.filter((z)=>z.test);if(G.length>0)Q=G}Z=Q.find((G)=>G.format===$.format)??Q.find((G)=>!G.format)}else X=$,Z=q.find((Q)=>Q.nodeClass&&X instanceof Q.nodeClass);if(!Z){let Q=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${Q} value`)}return Z}function vZ(q,$,{anchors:Z,doc:X}){if(!X.directives)return"";let Q=[],G=(Q0.isScalar(q)||Q0.isCollection(q))&&q.anchor;if(G&&yZ.anchorIsValid(G))Z.add(G),Q.push(`&${G}`);let z=q.tag??($.default?null:$.tag);if(z)Q.push(X.directives.tagString(z));return Q.join(" ")}function uZ(q,$,Z,X){if(Q0.isPair(q))return q.toString($,Z,X);if(Q0.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let Q=void 0,G=Q0.isNode(q)?q:$.doc.createNode(q,{onTagObj:(U)=>Q=U});Q??(Q=kZ($.doc.schema.tags,G));let z=vZ(G,Q,$);if(z.length>0)$.indentAtStart=($.indentAtStart??0)+z.length+1;let J=typeof Q.stringify==="function"?Q.stringify(G,$,Z,X):Q0.isScalar(G)?hZ.stringifyString(G,$,Z,X):G.toString($,Z,X);if(!z)return J;return Q0.isScalar(G)||J[0]==="{"||J[0]==="["?`${z} ${J}`:`${z}
|
|
35
|
+
${$.indent}${J}`}mZ.createStringifyContext=gZ;mZ.stringify=uZ});var E1=I((lZ)=>{var q0=y(),P1=h(),C1=s0(),r0=a0();function cZ({key:q,value:$},Z,X,Q){let{allNullValues:G,doc:z,indent:J,indentStep:U,options:{commentString:H,indentSeq:_,simpleKeys:V}}=Z,W=q0.isNode(q)&&q.comment||null;if(V){if(W)throw Error("With simple keys, key nodes cannot have comments");if(q0.isCollection(q)||!q0.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let O=!V&&(!q||W&&$==null&&!Z.inFlow||q0.isCollection(q)||(q0.isScalar(q)?q.type===P1.Scalar.BLOCK_FOLDED||q.type===P1.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!O&&(V||!G),indent:J+U});let T=!1,B=!1,F=C1.stringify(q,Z,()=>T=!0,()=>B=!0);if(!O&&!Z.inFlow&&F.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");O=!0}if(Z.inFlow){if(G||$==null){if(T&&X)X();return F===""?"?":O?`? ${F}`:F}}else if(G&&!V||$==null&&O){if(F=`? ${F}`,W&&!T)F+=r0.lineComment(F,Z.indent,H(W));else if(B&&Q)Q();return F}if(T)W=null;if(O){if(W)F+=r0.lineComment(F,Z.indent,H(W));F=`? ${F}
|
|
36
|
+
${J}:`}else if(F=`${F}:`,W)F+=r0.lineComment(F,Z.indent,H(W));let L,R,M;if(q0.isNode($))L=!!$.spaceBefore,R=$.commentBefore,M=$.comment;else if(L=!1,R=null,M=null,$&&typeof $==="object")$=z.createNode($);if(Z.implicitKey=!1,!O&&!W&&q0.isScalar($))Z.indentAtStart=F.length+1;if(B=!1,!_&&U.length>=2&&!Z.inFlow&&!O&&q0.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let A=!1,D=C1.stringify($,Z,()=>A=!0,()=>B=!0),j=" ";if(W||L||R){if(j=L?`
|
|
37
|
+
`:"",R){let w=H(R);j+=`
|
|
38
|
+
${r0.indentComment(w,Z.indent)}`}if(D===""&&!Z.inFlow){if(j===`
|
|
39
|
+
`&&M)j=`
|
|
40
|
+
|
|
41
|
+
`}else j+=`
|
|
42
|
+
${Z.indent}`}else if(!O&&q0.isCollection($)){let w=D[0],K=D.indexOf(`
|
|
43
|
+
`),E=K!==-1,N=Z.inFlow??$.flow??$.items.length===0;if(E||!N){let S=!1;if(E&&(w==="&"||w==="!")){let f=D.indexOf(" ");if(w==="&"&&f!==-1&&f<K&&D[f+1]==="!")f=D.indexOf(" ",f+1);if(f===-1||K<f)S=!0}if(!S)j=`
|
|
44
|
+
${Z.indent}`}}else if(D===""||D[0]===`
|
|
45
|
+
`)j="";if(F+=j+D,Z.inFlow){if(A&&X)X()}else if(M&&!A)F+=r0.lineComment(F,Z.indent,H(M));else if(B&&Q)Q();return F}lZ.stringifyPair=cZ});var P$=I((oZ)=>{var S1=x("process");function aZ(q,...$){if(q==="debug")console.log(...$)}function iZ(q,$){if(q==="debug"||q==="warn")if(typeof S1.emitWarning==="function")S1.emitWarning($);else console.warn($)}oZ.debug=aZ;oZ.warn=iZ});var fq=I((eZ)=>{var t0=y(),b1=h(),Sq="<<",bq={identify:(q)=>q===Sq||typeof q==="symbol"&&q.description===Sq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new b1.Scalar(Symbol(Sq)),{addToJSMap:f1}),stringify:()=>Sq},tZ=(q,$)=>(bq.identify($)||t0.isScalar($)&&(!$.type||$.type===b1.Scalar.PLAIN)&&bq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===bq.tag&&Z.default);function f1(q,$,Z){if(Z=q&&t0.isAlias(Z)?Z.resolve(q.doc):Z,t0.isSeq(Z))for(let X of Z.items)C$(q,$,X);else if(Array.isArray(Z))for(let X of Z)C$(q,$,X);else C$(q,$,Z)}function C$(q,$,Z){let X=q&&t0.isAlias(Z)?Z.resolve(q.doc):Z;if(!t0.isMap(X))throw Error("Merge sources must be maps or map aliases");let Q=X.toJSON(null,q,Map);for(let[G,z]of Q)if($ instanceof Map){if(!$.has(G))$.set(G,z)}else if($ instanceof Set)$.add(G);else if(!Object.prototype.hasOwnProperty.call($,G))Object.defineProperty($,G,{value:z,writable:!0,enumerable:!0,configurable:!0});return $}eZ.addMergeToJSMap=f1;eZ.isMergeKey=tZ;eZ.merge=bq});var S$=I((J6)=>{var X6=P$(),y1=fq(),Q6=s0(),x1=y(),E$=Z0();function G6(q,$,{key:Z,value:X}){if(x1.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,X);else if(y1.isMergeKey(q,Z))y1.addMergeToJSMap(q,$,X);else{let Q=E$.toJS(Z,"",q);if($ instanceof Map)$.set(Q,E$.toJS(X,Q,q));else if($ instanceof Set)$.add(Q);else{let G=z6(Z,Q,q),z=E$.toJS(X,G,q);if(G in $)Object.defineProperty($,G,{value:z,writable:!0,enumerable:!0,configurable:!0});else $[G]=z}}return $}function z6(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(x1.isNode(q)&&Z?.doc){let X=Q6.createStringifyContext(Z.doc,{});X.anchors=new Set;for(let G of Z.anchors.keys())X.anchors.add(G.anchor);X.inFlow=!0,X.inStringifyKey=!0;let Q=q.toString(X);if(!Z.mapKeyWarned){let G=JSON.stringify(Q);if(G.length>40)G=G.substring(0,36)+'..."';X6.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${G}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return Q}return JSON.stringify($)}J6.addPairToJSMap=G6});var G0=I((W6)=>{var h1=n0(),Y6=E1(),H6=S$(),yq=y();function V6(q,$,Z){let X=h1.createNode(q,void 0,Z),Q=h1.createNode($,void 0,Z);return new xq(X,Q)}class xq{constructor(q,$=null){Object.defineProperty(this,yq.NODE_TYPE,{value:yq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:Z}=this;if(yq.isNode($))$=$.clone(q);if(yq.isNode(Z))Z=Z.clone(q);return new xq($,Z)}toJSON(q,$){let Z=$?.mapAsMap?new Map:{};return H6.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?Y6.stringifyPair(this,q,$,Z):JSON.stringify(this)}}W6.Pair=xq;W6.createPair=V6});var b$=I((K6)=>{var T0=y(),g1=s0(),hq=a0();function O6(q,$,Z){return($.inFlow??q.flow?T6:F6)(q,$,Z)}function F6({comment:q,items:$},Z,{blockItemPrefix:X,flowChars:Q,itemIndent:G,onChompKeep:z,onComment:J}){let{indent:U,options:{commentString:H}}=Z,_=Object.assign({},Z,{indent:G,type:null}),V=!1,W=[];for(let T=0;T<$.length;++T){let B=$[T],F=null;if(T0.isNode(B)){if(!V&&B.spaceBefore)W.push("");if(gq(Z,W,B.commentBefore,V),B.comment)F=B.comment}else if(T0.isPair(B)){let R=T0.isNode(B.key)?B.key:null;if(R){if(!V&&R.spaceBefore)W.push("");gq(Z,W,R.commentBefore,V)}}V=!1;let L=g1.stringify(B,_,()=>F=null,()=>V=!0);if(F)L+=hq.lineComment(L,G,H(F));if(V&&F)V=!1;W.push(X+L)}let O;if(W.length===0)O=Q.start+Q.end;else{O=W[0];for(let T=1;T<W.length;++T){let B=W[T];O+=B?`
|
|
46
|
+
${U}${B}`:`
|
|
47
47
|
`}}if(q){if(O+=`
|
|
48
|
-
`+
|
|
49
|
-
`)))
|
|
50
|
-
${
|
|
51
|
-
`;return`${
|
|
52
|
-
${Q}${O}`}else return`${W}${z}${V.join(" ")}${z}${O}`}}function
|
|
53
|
-
`:" ")}return
|
|
54
|
-
${Q.key.commentBefore}`:X.commentBefore;if(X.comment){let
|
|
55
|
-
${U.comment}`:X.comment}X=Q}q.items[Z]=mq.isPair(X)?X:new k$.Pair(X)}else $("Expected a sequence for this tag");return q}function l1(q,$,Z){let{replacer:X}=Z,Q=new D3.YAMLSeq(q);Q.tag="tag:yaml.org,2002:pairs";let U=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof X==="function")z=X.call($,String(U++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let Y=Object.keys(z);if(Y.length===1)G=Y[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else G=z;Q.items.push(k$.createPair(G,J,Z))}return Q}var w3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:c1,createNode:l1};N3.createPairs=l1;N3.pairs=w3;N3.resolvePairs=c1});var u$=A((E3)=>{var a1=y(),v$=$0(),qq=z0(),b3=G0(),n1=pq();class B0 extends b3.YAMLSeq{constructor(){super();this.add=qq.YAMLMap.prototype.add.bind(this),this.delete=qq.YAMLMap.prototype.delete.bind(this),this.get=qq.YAMLMap.prototype.get.bind(this),this.has=qq.YAMLMap.prototype.has.bind(this),this.set=qq.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 Q,U;if(a1.isPair(X))Q=v$.toJS(X.key,"",$),U=v$.toJS(X.value,Q,$);else Q=v$.toJS(X,"",$);if(Z.has(Q))throw Error("Ordered maps must not include duplicate keys");Z.set(Q,U)}return Z}static from(q,$,Z){let X=n1.createPairs(q,$,Z),Q=new this;return Q.items=X.items,Q}}B0.tag="tag:yaml.org,2002:omap";var S3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:B0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=n1.resolvePairs(q,$),X=[];for(let{key:Q}of Z.items)if(a1.isScalar(Q))if(X.includes(Q.value))$(`Ordered maps must not include duplicate keys: ${Q.value}`);else X.push(Q.value);return Object.assign(new B0,Z)},createNode:(q,$,Z)=>B0.from(q,$,Z)};E3.YAMLOMap=B0;E3.omap=S3});var t1=A((x3)=>{var i1=x();function s1({value:q,source:$},Z){if($&&(q?o1:r1).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var o1={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new i1.Scalar(!0),stringify:s1},r1={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new i1.Scalar(!1),stringify:s1};x3.falseTag=r1;x3.trueTag=o1});var e1=A((p3)=>{var k3=x(),m$=P0(),v3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:m$.stringifyNumber},u3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():m$.stringifyNumber(q)}},m3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new k3.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let X=q.substring(Z+1).replace(/_/g,"");if(X[X.length-1]==="0")$.minFractionDigits=X.length}return $},stringify:m$.stringifyNumber};p3.float=m3;p3.floatExp=u3;p3.floatNaN=v3});var $9=A((o3)=>{var q9=P0(),$q=(q)=>typeof q==="bigint"||Number.isInteger(q);function dq(q,$,Z,{intAsBigInt:X}){let Q=q[0];if(Q==="-"||Q==="+")$+=1;if(q=q.substring($).replace(/_/g,""),X){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return Q==="-"?BigInt(-1)*z:z}let U=parseInt(q,Z);return Q==="-"?-1*U:U}function p$(q,$,Z){let{value:X}=q;if($q(X)){let Q=X.toString($);return X<0?"-"+Z+Q.substr(1):Z+Q}return q9.stringifyNumber(q)}var a3={identify:$q,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>dq(q,2,2,Z),stringify:(q)=>p$(q,2,"0b")},n3={identify:$q,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>dq(q,1,8,Z),stringify:(q)=>p$(q,8,"0")},i3={identify:$q,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>dq(q,0,10,Z),stringify:q9.stringifyNumber},s3={identify:$q,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>dq(q,2,16,Z),stringify:(q)=>p$(q,16,"0x")};o3.int=i3;o3.intBin=a3;o3.intHex=s3;o3.intOct=n3});var d$=A((Z7)=>{var aq=y(),cq=Q0(),lq=z0();class _0 extends lq.YAMLMap{constructor(q){super(q);this.tag=_0.tag}add(q){let $;if(aq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new cq.Pair(q.key,null);else $=new cq.Pair(q,null);if(!lq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=lq.findPair(this.items,q);return!$&&aq.isPair(Z)?aq.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=lq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new cq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($))for(let U of $){if(typeof X==="function")U=X.call($,U,U);Q.items.push(cq.createPair(U,null,Z))}return Q}}_0.tag="tag:yaml.org,2002:set";var $7={collection:"map",identify:(q)=>q instanceof Set,nodeClass:_0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>_0.from(q,$,Z),resolve(q,$){if(aq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new _0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};Z7.YAMLSet=_0;Z7.set=$7});var l$=A((J7)=>{var U7=P0();function c$(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,Q=(z)=>$?BigInt(z):Number(z),U=X.replace(/_/g,"").split(":").reduce((z,G)=>z*Q(60)+Q(G),Q(0));return Z==="-"?Q(-1)*U:U}function Z9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return U7.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let Q=Z(60),U=[$%Q];if($<60)U.unshift(0);else if($=($-U[0])/Q,U.unshift($%Q),$>=60)$=($-U[0])/Q,U.unshift($);return X+U.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var z7={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>c$(q,Z),stringify:Z9},G7={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>c$(q,!1),stringify:Z9},X9={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(X9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,Q,U,z,G]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Y=Date.UTC(Z,X-1,Q,U||0,z||0,G||0,J),B=$[8];if(B&&B!=="Z"){let V=c$(B,!1);if(Math.abs(V)<30)V*=60;Y-=60000*V}return new Date(Y)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};J7.floatTime=G7;J7.intTime=z7;J7.timestamp=X9});var U9=A((A7)=>{var W7=N0(),B7=kq(),_7=j0(),O7=t0(),T7=g$(),Q9=t1(),a$=e1(),nq=$9(),F7=bq(),K7=u$(),L7=pq(),R7=d$(),n$=l$(),M7=[W7.map,_7.seq,O7.string,B7.nullTag,Q9.trueTag,Q9.falseTag,nq.intBin,nq.intOct,nq.int,nq.intHex,a$.floatNaN,a$.floatExp,a$.float,T7.binary,F7.merge,K7.omap,L7.pairs,R7.set,n$.intTime,n$.floatTime,n$.timestamp];A7.schema=M7});var O9=A((S7)=>{var Y9=N0(),D7=kq(),H9=j0(),w7=t0(),N7=C$(),i$=S$(),s$=f$(),j7=m1(),P7=d1(),V9=g$(),Zq=bq(),W9=u$(),B9=pq(),z9=U9(),_9=d$(),iq=l$(),G9=new Map([["core",j7.schema],["failsafe",[Y9.map,H9.seq,w7.string]],["json",P7.schema],["yaml11",z9.schema],["yaml-1.1",z9.schema]]),J9={binary:V9.binary,bool:N7.boolTag,float:i$.float,floatExp:i$.floatExp,floatNaN:i$.floatNaN,floatTime:iq.floatTime,int:s$.int,intHex:s$.intHex,intOct:s$.intOct,intTime:iq.intTime,map:Y9.map,merge:Zq.merge,null:D7.nullTag,omap:W9.omap,pairs:B9.pairs,seq:H9.seq,set:_9.set,timestamp:iq.timestamp},C7={"tag:yaml.org,2002:binary":V9.binary,"tag:yaml.org,2002:merge":Zq.merge,"tag:yaml.org,2002:omap":W9.omap,"tag:yaml.org,2002:pairs":B9.pairs,"tag:yaml.org,2002:set":_9.set,"tag:yaml.org,2002:timestamp":iq.timestamp};function b7(q,$,Z){let X=G9.get($);if(X&&!q)return Z&&!X.includes(Zq.merge)?X.concat(Zq.merge):X.slice();let Q=X;if(!Q)if(Array.isArray(q))Q=[];else{let U=Array.from(G9.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${U} or define customTags array`)}if(Array.isArray(q))for(let U of q)Q=Q.concat(U);else if(typeof q==="function")Q=q(Q.slice());if(Z)Q=Q.concat(Zq.merge);return Q.reduce((U,z)=>{let G=typeof z==="string"?J9[z]:z;if(!G){let J=JSON.stringify(z),Y=Object.keys(J9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Y}`)}if(!U.includes(G))U.push(G);return U},[])}S7.coreKnownTags=C7;S7.getTags=b7});var t$=A((k7)=>{var o$=y(),y7=N0(),x7=j0(),h7=t0(),sq=O9(),g7=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class r${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:Q,sortMapEntries:U,toStringDefaults:z}){this.compat=Array.isArray(q)?sq.getTags(q,"compat"):q?sq.getTags(null,q):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=X?sq.coreKnownTags:{},this.tags=sq.getTags($,this.name,Z),this.toStringOptions=z??null,Object.defineProperty(this,o$.MAP,{value:y7.map}),Object.defineProperty(this,o$.SCALAR,{value:h7.string}),Object.defineProperty(this,o$.SEQ,{value:x7.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?g7:null}clone(){let q=Object.create(r$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}k7.Schema=r$});var T9=A((p7)=>{var u7=y(),e$=i0(),Xq=l0();function m7(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)Z.push(J),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let Q=e$.createStringifyContext(q,$),{commentString:U}=Q.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let J=U(q.commentBefore);Z.unshift(Xq.indentComment(J,""))}let z=!1,G=null;if(q.contents){if(u7.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let B=U(q.contents.commentBefore);Z.push(Xq.indentComment(B,""))}Q.forceBlockIndent=!!q.comment,G=q.contents.comment}let J=G?void 0:()=>z=!0,Y=e$.stringify(q.contents,Q,()=>G=null,J);if(G)Y+=Xq.lineComment(Y,"",U(G));if((Y[0]==="|"||Y[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${Y}`;else Z.push(Y)}else Z.push(e$.stringify(q.contents,Q));if(q.directives?.docEnd)if(q.comment){let J=U(q.comment);if(J.includes(`
|
|
56
|
-
`))Z.push("..."),Z.push(
|
|
48
|
+
`+hq.indentComment(H(q),U),J)J()}else if(V&&z)z();return O}function T6({items:q},$,{flowChars:Z,itemIndent:X}){let{indent:Q,indentStep:G,flowCollectionPadding:z,options:{commentString:J}}=$;X+=G;let U=Object.assign({},$,{indent:X,inFlow:!0,type:null}),H=!1,_=0,V=[];for(let T=0;T<q.length;++T){let B=q[T],F=null;if(T0.isNode(B)){if(B.spaceBefore)V.push("");if(gq($,V,B.commentBefore,!1),B.comment)F=B.comment}else if(T0.isPair(B)){let R=T0.isNode(B.key)?B.key:null;if(R){if(R.spaceBefore)V.push("");if(gq($,V,R.commentBefore,!1),R.comment)H=!0}let M=T0.isNode(B.value)?B.value:null;if(M){if(M.comment)F=M.comment;if(M.commentBefore)H=!0}else if(B.value==null&&R?.comment)F=R.comment}if(F)H=!0;let L=g1.stringify(B,U,()=>F=null);if(T<q.length-1)L+=",";if(F)L+=hq.lineComment(L,X,J(F));if(!H&&(V.length>_||L.includes(`
|
|
49
|
+
`)))H=!0;V.push(L),_=V.length}let{start:W,end:O}=Z;if(V.length===0)return W+O;else{if(!H){let T=V.reduce((B,F)=>B+F.length+2,2);H=$.options.lineWidth>0&&T>$.options.lineWidth}if(H){let T=W;for(let B of V)T+=B?`
|
|
50
|
+
${G}${Q}${B}`:`
|
|
51
|
+
`;return`${T}
|
|
52
|
+
${Q}${O}`}else return`${W}${z}${V.join(" ")}${z}${O}`}}function gq({indent:q,options:{commentString:$}},Z,X,Q){if(X&&Q)X=X.replace(/^\n+/,"");if(X){let G=hq.indentComment($(X),q);Z.push(G.trimStart())}}K6.stringifyCollection=O6});var J0=I((w6)=>{var M6=b$(),R6=S$(),A6=Nq(),z0=y(),kq=G0(),I6=h();function e0(q,$){let Z=z0.isScalar($)?$.value:$;for(let X of q)if(z0.isPair(X)){if(X.key===$||X.key===Z)return X;if(z0.isScalar(X.key)&&X.key.value===Z)return X}return}class k1 extends A6.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(z0.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:X,replacer:Q}=Z,G=new this(q),z=(J,U)=>{if(typeof Q==="function")U=Q.call($,J,U);else if(Array.isArray(Q)&&!Q.includes(J))return;if(U!==void 0||X)G.items.push(kq.createPair(J,U,Z))};if($ instanceof Map)for(let[J,U]of $)z(J,U);else if($&&typeof $==="object")for(let J of Object.keys($))z(J,$[J]);if(typeof q.sortMapEntries==="function")G.items.sort(q.sortMapEntries);return G}add(q,$){let Z;if(z0.isPair(q))Z=q;else if(!q||typeof q!=="object"||!("key"in q))Z=new kq.Pair(q,q?.value);else Z=new kq.Pair(q.key,q.value);let X=e0(this.items,Z.key),Q=this.schema?.sortMapEntries;if(X){if(!$)throw Error(`Key ${Z.key} already set`);if(z0.isScalar(X.value)&&I6.isScalarValue(Z.value))X.value.value=Z.value;else X.value=Z.value}else if(Q){let G=this.items.findIndex((z)=>Q(Z,z)<0);if(G===-1)this.items.push(Z);else this.items.splice(G,0,Z)}else this.items.push(Z)}delete(q){let $=e0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let X=e0(this.items,q)?.value;return(!$&&z0.isScalar(X)?X.value:X)??void 0}has(q){return!!e0(this.items,q)}set(q,$){this.add(new kq.Pair(q,$),!0)}toJSON(q,$,Z){let X=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(X);for(let Q of this.items)R6.addPairToJSMap($,X,Q);return X}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let X of this.items)if(!z0.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 M6.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}w6.YAMLMap=k1;w6.findPair=e0});var b0=I((C6)=>{var N6=y(),v1=J0(),P6={collection:"map",default:!0,nodeClass:v1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!N6.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>v1.YAMLMap.from(q,$,Z)};C6.map=P6});var U0=I((h6)=>{var S6=n0(),b6=b$(),f6=Nq(),uq=y(),y6=h(),x6=Z0();class u1 extends f6.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(uq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=vq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=vq(q);if(typeof Z!=="number")return;let X=this.items[Z];return!$&&uq.isScalar(X)?X.value:X}has(q){let $=vq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let Z=vq(q);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${q}.`);let X=this.items[Z];if(uq.isScalar(X)&&y6.isScalarValue($))X.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let X=0;for(let Q of this.items)Z.push(x6.toJS(Q,String(X++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return b6.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($)){let G=0;for(let z of $){if(typeof X==="function"){let J=$ instanceof Set?z:String(G++);z=X.call($,J,z)}Q.items.push(S6.createNode(z,void 0,Z))}}return Q}}function vq(q){let $=uq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}h6.YAMLSeq=u1});var f0=I((u6)=>{var k6=y(),m1=U0(),v6={collection:"seq",default:!0,nodeClass:m1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!k6.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>m1.YAMLSeq.from(q,$,Z)};u6.seq=v6});var qq=I((c6)=>{var p6=o0(),d6={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},$),p6.stringifyString(q,$,Z,X)}};c6.string=d6});var mq=I((n6)=>{var p1=h(),d1={identify:(q)=>q==null,createNode:()=>new p1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new p1.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&d1.test.test(q)?q:$.options.nullStr};n6.nullTag=d1});var f$=I((o6)=>{var i6=h(),c1={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new i6.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&c1.test.test(q)){let X=q[0]==="t"||q[0]==="T";if($===X)return q}return $?Z.options.trueStr:Z.options.falseStr}};o6.boolTag=c1});var y0=I((t6)=>{function r6({format:q,minFractionDigits:$,tag:Z,value:X}){if(typeof X==="bigint")return String(X);let Q=typeof X==="number"?X:Number(X);if(!isFinite(Q))return isNaN(Q)?".nan":Q<0?"-.inf":".inf";let G=Object.is(X,-0)?"-0":JSON.stringify(X);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(G)){let z=G.indexOf(".");if(z<0)z=G.length,G+=".";let J=$-(G.length-z-1);while(J-- >0)G+="0"}return G}t6.stringifyNumber=r6});var x$=I((Q3)=>{var q3=h(),y$=y0(),$3={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:y$.stringifyNumber},Z3={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():y$.stringifyNumber(q)}},X3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new q3.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:y$.stringifyNumber};Q3.float=X3;Q3.floatExp=Z3;Q3.floatNaN=$3});var g$=I((V3)=>{var l1=y0(),pq=(q)=>typeof q==="bigint"||Number.isInteger(q),h$=(q,$,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q.substring($),Z);function n1(q,$,Z){let{value:X}=q;if(pq(X)&&X>=0)return Z+X.toString($);return l1.stringifyNumber(q)}var U3={identify:(q)=>pq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>h$(q,2,8,Z),stringify:(q)=>n1(q,8,"0o")},Y3={identify:pq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>h$(q,0,10,Z),stringify:l1.stringifyNumber},H3={identify:(q)=>pq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>h$(q,2,16,Z),stringify:(q)=>n1(q,16,"0x")};V3.int=Y3;V3.intHex=H3;V3.intOct=U3});var a1=I((R3)=>{var O3=b0(),F3=mq(),T3=f0(),K3=qq(),L3=f$(),k$=x$(),v$=g$(),M3=[O3.map,T3.seq,K3.string,F3.nullTag,L3.boolTag,v$.intOct,v$.int,v$.intHex,k$.floatNaN,k$.floatExp,k$.float];R3.schema=M3});var o1=I((C3)=>{var I3=h(),w3=b0(),D3=f0();function i1(q){return typeof q==="bigint"||Number.isInteger(q)}var dq=({value:q})=>JSON.stringify(q),j3=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:dq},{identify:(q)=>q==null,createNode:()=>new I3.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:dq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:dq},{identify:i1,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})=>i1(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:dq}],N3={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},P3=[w3.map,D3.seq].concat(j3,N3);C3.schema=P3});var m$=I((f3)=>{var $q=x("buffer"),u$=h(),S3=o0(),b3={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof $q.Buffer==="function")return $q.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),X=new Uint8Array(Z.length);for(let Q=0;Q<Z.length;++Q)X[Q]=Z.charCodeAt(Q);return X}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},X,Q,G){if(!Z)return"";let z=Z,J;if(typeof $q.Buffer==="function")J=z instanceof $q.Buffer?z.toString("base64"):$q.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let H=0;H<z.length;++H)U+=String.fromCharCode(z[H]);J=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=u$.Scalar.BLOCK_LITERAL),$!==u$.Scalar.QUOTE_DOUBLE){let U=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),H=Math.ceil(J.length/U),_=Array(H);for(let V=0,W=0;V<H;++V,W+=U)_[V]=J.substr(W,U);J=_.join($===u$.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return S3.stringifyString({comment:q,type:$,value:J},X,Q,G)}};f3.binary=b3});var lq=I((k3)=>{var cq=y(),p$=G0(),x3=h(),h3=U0();function s1(q,$){if(cq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let X=q.items[Z];if(cq.isPair(X))continue;else if(cq.isMap(X)){if(X.items.length>1)$("Each pair must have its own sequence indicator");let Q=X.items[0]||new p$.Pair(new x3.Scalar(null));if(X.commentBefore)Q.key.commentBefore=Q.key.commentBefore?`${X.commentBefore}
|
|
54
|
+
${Q.key.commentBefore}`:X.commentBefore;if(X.comment){let G=Q.value??Q.key;G.comment=G.comment?`${X.comment}
|
|
55
|
+
${G.comment}`:X.comment}X=Q}q.items[Z]=cq.isPair(X)?X:new p$.Pair(X)}else $("Expected a sequence for this tag");return q}function r1(q,$,Z){let{replacer:X}=Z,Q=new h3.YAMLSeq(q);Q.tag="tag:yaml.org,2002:pairs";let G=0;if($&&Symbol.iterator in Object($))for(let z of $){if(typeof X==="function")z=X.call($,String(G++),z);let J,U;if(Array.isArray(z))if(z.length===2)J=z[0],U=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let H=Object.keys(z);if(H.length===1)J=H[0],U=z[J];else throw TypeError(`Expected tuple with one key, not ${H.length} keys`)}else J=z;Q.items.push(p$.createPair(J,U,Z))}return Q}var g3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:s1,createNode:r1};k3.createPairs=r1;k3.pairs=g3;k3.resolvePairs=s1});var c$=I((c3)=>{var t1=y(),d$=Z0(),Zq=J0(),p3=U0(),e1=lq();class K0 extends p3.YAMLSeq{constructor(){super();this.add=Zq.YAMLMap.prototype.add.bind(this),this.delete=Zq.YAMLMap.prototype.delete.bind(this),this.get=Zq.YAMLMap.prototype.get.bind(this),this.has=Zq.YAMLMap.prototype.has.bind(this),this.set=Zq.YAMLMap.prototype.set.bind(this),this.tag=K0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let X of this.items){let Q,G;if(t1.isPair(X))Q=d$.toJS(X.key,"",$),G=d$.toJS(X.value,Q,$);else Q=d$.toJS(X,"",$);if(Z.has(Q))throw Error("Ordered maps must not include duplicate keys");Z.set(Q,G)}return Z}static from(q,$,Z){let X=e1.createPairs(q,$,Z),Q=new this;return Q.items=X.items,Q}}K0.tag="tag:yaml.org,2002:omap";var d3={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:K0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=e1.resolvePairs(q,$),X=[];for(let{key:Q}of Z.items)if(t1.isScalar(Q))if(X.includes(Q.value))$(`Ordered maps must not include duplicate keys: ${Q.value}`);else X.push(Q.value);return Object.assign(new K0,Z)},createNode:(q,$,Z)=>K0.from(q,$,Z)};c3.YAMLOMap=K0;c3.omap=d3});var Q9=I((a3)=>{var q9=h();function $9({value:q,source:$},Z){if($&&(q?Z9:X9).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var Z9={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 q9.Scalar(!0),stringify:$9},X9={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 q9.Scalar(!1),stringify:$9};a3.falseTag=X9;a3.trueTag=Z9});var G9=I((q7)=>{var s3=h(),l$=y0(),r3={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:l$.stringifyNumber},t3={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():l$.stringifyNumber(q)}},e3={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new s3.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let X=q.substring(Z+1).replace(/_/g,"");if(X[X.length-1]==="0")$.minFractionDigits=X.length}return $},stringify:l$.stringifyNumber};q7.float=e3;q7.floatExp=t3;q7.floatNaN=r3});var J9=I((U7)=>{var z9=y0(),Xq=(q)=>typeof q==="bigint"||Number.isInteger(q);function nq(q,$,Z,{intAsBigInt:X}){let Q=q[0];if(Q==="-"||Q==="+")$+=1;if(q=q.substring($).replace(/_/g,""),X){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return Q==="-"?BigInt(-1)*z:z}let G=parseInt(q,Z);return Q==="-"?-1*G:G}function n$(q,$,Z){let{value:X}=q;if(Xq(X)){let Q=X.toString($);return X<0?"-"+Z+Q.substr(1):Z+Q}return z9.stringifyNumber(q)}var Q7={identify:Xq,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>nq(q,2,2,Z),stringify:(q)=>n$(q,2,"0b")},G7={identify:Xq,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>nq(q,1,8,Z),stringify:(q)=>n$(q,8,"0")},z7={identify:Xq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>nq(q,0,10,Z),stringify:z9.stringifyNumber},J7={identify:Xq,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>nq(q,2,16,Z),stringify:(q)=>n$(q,16,"0x")};U7.int=z7;U7.intBin=Q7;U7.intHex=J7;U7.intOct=G7});var a$=I((B7)=>{var oq=y(),aq=G0(),iq=J0();class L0 extends iq.YAMLMap{constructor(q){super(q);this.tag=L0.tag}add(q){let $;if(oq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new aq.Pair(q.key,null);else $=new aq.Pair(q,null);if(!iq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=iq.findPair(this.items,q);return!$&&oq.isPair(Z)?oq.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=iq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new aq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:X}=Z,Q=new this(q);if($&&Symbol.iterator in Object($))for(let G of $){if(typeof X==="function")G=X.call($,G,G);Q.items.push(aq.createPair(G,null,Z))}return Q}}L0.tag="tag:yaml.org,2002:set";var _7={collection:"map",identify:(q)=>q instanceof Set,nodeClass:L0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>L0.from(q,$,Z),resolve(q,$){if(oq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new L0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};B7.YAMLSet=L0;B7.set=_7});var o$=I((M7)=>{var T7=y0();function i$(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,Q=(z)=>$?BigInt(z):Number(z),G=X.replace(/_/g,"").split(":").reduce((z,J)=>z*Q(60)+Q(J),Q(0));return Z==="-"?Q(-1)*G:G}function U9(q){let{value:$}=q,Z=(z)=>z;if(typeof $==="bigint")Z=(z)=>BigInt(z);else if(isNaN($)||!isFinite($))return T7.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let Q=Z(60),G=[$%Q];if($<60)G.unshift(0);else if($=($-G[0])/Q,G.unshift($%Q),$>=60)$=($-G[0])/Q,G.unshift($);return X+G.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var K7={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})=>i$(q,Z),stringify:U9},L7={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)=>i$(q,!1),stringify:U9},Y9={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(Y9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,Q,G,z,J]=$.map(Number),U=$[7]?Number(($[7]+"00").substr(1,3)):0,H=Date.UTC(Z,X-1,Q,G||0,z||0,J||0,U),_=$[8];if(_&&_!=="Z"){let V=i$(_,!1);if(Math.abs(V)<30)V*=60;H-=60000*V}return new Date(H)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};M7.floatTime=L7;M7.intTime=K7;M7.timestamp=Y9});var V9=I((y7)=>{var w7=b0(),D7=mq(),j7=f0(),N7=qq(),P7=m$(),H9=Q9(),s$=G9(),sq=J9(),C7=fq(),E7=c$(),S7=lq(),b7=a$(),r$=o$(),f7=[w7.map,j7.seq,N7.string,D7.nullTag,H9.trueTag,H9.falseTag,sq.intBin,sq.intOct,sq.int,sq.intHex,s$.floatNaN,s$.floatExp,s$.float,P7.binary,C7.merge,E7.omap,S7.pairs,b7.set,r$.intTime,r$.floatTime,r$.timestamp];y7.schema=f7});var R9=I((d7)=>{var O9=b0(),h7=mq(),F9=f0(),g7=qq(),k7=f$(),t$=x$(),e$=g$(),v7=a1(),u7=o1(),T9=m$(),Qq=fq(),K9=c$(),L9=lq(),W9=V9(),M9=a$(),rq=o$(),_9=new Map([["core",v7.schema],["failsafe",[O9.map,F9.seq,g7.string]],["json",u7.schema],["yaml11",W9.schema],["yaml-1.1",W9.schema]]),B9={binary:T9.binary,bool:k7.boolTag,float:t$.float,floatExp:t$.floatExp,floatNaN:t$.floatNaN,floatTime:rq.floatTime,int:e$.int,intHex:e$.intHex,intOct:e$.intOct,intTime:rq.intTime,map:O9.map,merge:Qq.merge,null:h7.nullTag,omap:K9.omap,pairs:L9.pairs,seq:F9.seq,set:M9.set,timestamp:rq.timestamp},m7={"tag:yaml.org,2002:binary":T9.binary,"tag:yaml.org,2002:merge":Qq.merge,"tag:yaml.org,2002:omap":K9.omap,"tag:yaml.org,2002:pairs":L9.pairs,"tag:yaml.org,2002:set":M9.set,"tag:yaml.org,2002:timestamp":rq.timestamp};function p7(q,$,Z){let X=_9.get($);if(X&&!q)return Z&&!X.includes(Qq.merge)?X.concat(Qq.merge):X.slice();let Q=X;if(!Q)if(Array.isArray(q))Q=[];else{let G=Array.from(_9.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${G} or define customTags array`)}if(Array.isArray(q))for(let G of q)Q=Q.concat(G);else if(typeof q==="function")Q=q(Q.slice());if(Z)Q=Q.concat(Qq.merge);return Q.reduce((G,z)=>{let J=typeof z==="string"?B9[z]:z;if(!J){let U=JSON.stringify(z),H=Object.keys(B9).map((_)=>JSON.stringify(_)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${H}`)}if(!G.includes(J))G.push(J);return G},[])}d7.coreKnownTags=m7;d7.getTags=p7});var Z2=I((s7)=>{var q2=y(),n7=b0(),a7=f0(),i7=qq(),tq=R9(),o7=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class $2{constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:Q,sortMapEntries:G,toStringDefaults:z}){this.compat=Array.isArray(q)?tq.getTags(q,"compat"):q?tq.getTags(null,q):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=X?tq.coreKnownTags:{},this.tags=tq.getTags($,this.name,Z),this.toStringOptions=z??null,Object.defineProperty(this,q2.MAP,{value:n7.map}),Object.defineProperty(this,q2.SCALAR,{value:i7.string}),Object.defineProperty(this,q2.SEQ,{value:a7.seq}),this.sortMapEntries=typeof G==="function"?G:G===!0?o7:null}clone(){let q=Object.create($2.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}s7.Schema=$2});var A9=I((qX)=>{var t7=y(),X2=s0(),Gq=a0();function e7(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let U=q.directives.toString(q);if(U)Z.push(U),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let Q=X2.createStringifyContext(q,$),{commentString:G}=Q.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let U=G(q.commentBefore);Z.unshift(Gq.indentComment(U,""))}let z=!1,J=null;if(q.contents){if(t7.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let _=G(q.contents.commentBefore);Z.push(Gq.indentComment(_,""))}Q.forceBlockIndent=!!q.comment,J=q.contents.comment}let U=J?void 0:()=>z=!0,H=X2.stringify(q.contents,Q,()=>J=null,U);if(J)H+=Gq.lineComment(H,"",G(J));if((H[0]==="|"||H[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${H}`;else Z.push(H)}else Z.push(X2.stringify(q.contents,Q));if(q.directives?.docEnd)if(q.comment){let U=G(q.comment);if(U.includes(`
|
|
56
|
+
`))Z.push("..."),Z.push(Gq.indentComment(U,""));else Z.push(`... ${U}`)}else Z.push("...");else{let U=q.comment;if(U&&z)U=U.replace(/^\n+/,"");if(U){if((!z||J)&&Z[Z.length-1]!=="")Z.push("");Z.push(Gq.indentComment(G(U),""))}}return Z.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
59
|
-
`;z=
|
|
58
|
+
`}qX.stringifyDocument=e7});var zq=I((YX)=>{var ZX=l0(),x0=Nq(),l=y(),XX=G0(),QX=Z0(),GX=Z2(),zX=A9(),Q2=wq(),JX=I$(),UX=n0(),G2=A$();class z2{constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,l.NODE_TYPE,{value:l.DOC});let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$,$=void 0;let Q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=Q;let{version:G}=Q;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)G=this.directives.yaml.version}else this.directives=new G2.Directives({version:G});this.setSchema(G,Z),this.contents=q===void 0?null:this.createNode(q,X,Z)}clone(){let q=Object.create(z2.prototype,{[l.NODE_TYPE]:{value:l.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=l.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(h0(this.contents))this.contents.add(q)}addIn(q,$){if(h0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=Q2.anchorNames(this);q.anchor=!$||Z.has($)?Q2.findNewAnchor($||"a",Z):$}return new ZX.Alias(q.anchor)}createNode(q,$,Z){let X=void 0;if(typeof $==="function")q=$.call({"":q},"",q),X=$;else if(Array.isArray($)){let B=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,F=$.filter(B).map(String);if(F.length>0)$=$.concat(F);X=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:Q,anchorPrefix:G,flow:z,keepUndefined:J,onTagObj:U,tag:H}=Z??{},{onAnchor:_,setAnchors:V,sourceObjects:W}=Q2.createNodeAnchors(this,G||"a"),O={aliasDuplicateObjects:Q??!0,keepUndefined:J??!1,onAnchor:_,onTagObj:U,replacer:X,schema:this.schema,sourceObjects:W},T=UX.createNode(q,H,O);if(z&&l.isCollection(T))T.flow=!0;return V(),T}createPair(q,$,Z={}){let X=this.createNode(q,null,Z),Q=this.createNode($,null,Z);return new XX.Pair(X,Q)}delete(q){return h0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(x0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return h0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return l.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(x0.isEmptyPath(q))return!$&&l.isScalar(this.contents)?this.contents.value:this.contents;return l.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return l.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(x0.isEmptyPath(q))return this.contents!==void 0;return l.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=x0.collectionFromPath(this.schema,[q],$);else if(h0(this.contents))this.contents.set(q,$)}setIn(q,$){if(x0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=x0.collectionFromPath(this.schema,Array.from(q),$);else if(h0(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 G2.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 G2.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 GX.Schema(Object.assign(Z,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:Z,maxAliasCount:X,onAnchor:Q,reviver:G}={}){let z={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},J=QX.toJS(this.contents,$??"",z);if(typeof Q==="function")for(let{count:U,res:H}of z.anchors.values())Q(H,U);return typeof G==="function"?JX.applyReviver(G,{"":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 zX.stringifyDocument(this,q)}}function h0(q){if(l.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}YX.Document=z2});var Jq=I((WX)=>{class eq extends Error{constructor(q,$,Z,X){super();this.name=q,this.code=Z,this.message=X,this.pos=$}}class I9 extends eq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class w9 extends eq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var VX=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((J)=>$.linePos(J));let{line:X,col:Q}=Z.linePos[0];Z.message+=` at line ${X}, column ${Q}`;let G=Q-1,z=q.substring($.lineStarts[X-1],$.lineStarts[X]).replace(/[\n\r]+$/,"");if(G>=60&&z.length>80){let J=Math.min(G-39,z.length-79);z="…"+z.substring(J),G-=J-1}if(z.length>80)z=z.substring(0,79)+"…";if(X>1&&/^ *$/.test(z.substring(0,G))){let J=q.substring($.lineStarts[X-2],$.lineStarts[X-1]);if(J.length>80)J=J.substring(0,79)+`…
|
|
59
|
+
`;z=J+z}if(/[^ ]/.test(z)){let J=1,U=Z.linePos[1];if(U?.line===X&&U.col>Q)J=Math.max(1,Math.min(U.col-Q,80-G));let H=" ".repeat(G)+"^".repeat(J);Z.message+=`:
|
|
60
60
|
|
|
61
61
|
${z}
|
|
62
|
-
${
|
|
63
|
-
`}};
|
|
64
|
-
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(
|
|
65
|
-
`+
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`.repeat(Math.max(1,z.length-1)):"",
|
|
72
|
-
`;for(let _
|
|
73
|
-
`;else if(
|
|
62
|
+
${H}
|
|
63
|
+
`}};WX.YAMLError=eq;WX.YAMLParseError=I9;WX.YAMLWarning=w9;WX.prettifyError=VX});var Uq=I((KX)=>{function TX(q,{flow:$,indicator:Z,next:X,offset:Q,onError:G,parentIndent:z,startOnNewline:J}){let U=!1,H=J,_=J,V="",W="",O=!1,T=!1,B=null,F=null,L=null,R=null,M=null,A=null,D=null;for(let K of q){if(T){if(K.type!=="space"&&K.type!=="newline"&&K.type!=="comma")G(K.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");T=!1}if(B){if(H&&K.type!=="comment"&&K.type!=="newline")G(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(K.type){case"space":if(!$&&(Z!=="doc-start"||X?.type!=="flow-collection")&&K.source.includes("\t"))B=K;_=!0;break;case"comment":{if(!_)G(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=K.source.substring(1)||" ";if(!V)V=E;else V+=W+E;W="",H=!1;break}case"newline":if(H){if(V)V+=K.source;else if(!A||Z!=="seq-item-ind")U=!0}else W+=K.source;if(H=!0,O=!0,F||L)R=K;_=!0;break;case"anchor":if(F)G(K,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(K.source.endsWith(":"))G(K.offset+K.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);F=K,D??(D=K.offset),H=!1,_=!1,T=!0;break;case"tag":{if(L)G(K,"MULTIPLE_TAGS","A node can have at most one tag");L=K,D??(D=K.offset),H=!1,_=!1,T=!0;break}case Z:if(F||L)G(K,"BAD_PROP_ORDER",`Anchors and tags must be after the ${K.source} indicator`);if(A)G(K,"UNEXPECTED_TOKEN",`Unexpected ${K.source} in ${$??"collection"}`);A=K,H=Z==="seq-item-ind"||Z==="explicit-key-ind",_=!1;break;case"comma":if($){if(M)G(K,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);M=K,H=!1,_=!1;break}default:G(K,"UNEXPECTED_TOKEN",`Unexpected ${K.type} token`),H=!1,_=!1}}let j=q[q.length-1],w=j?j.offset+j.source.length:Q;if(T&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))G(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(H&&B.indent<=z||X?.type==="block-map"||X?.type==="block-seq"))G(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:M,found:A,spaceBefore:U,comment:V,hasNewline:O,anchor:F,tag:L,newlineAfterProp:R,end:w,start:D??w}}KX.resolveProps=TX});var q$=I((MX)=>{function J2(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
64
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(J2($.key)||J2($.value))return!0}return!1;default:return!0}}MX.containsNewline=J2});var U2=I((wX)=>{var AX=q$();function IX(q,$,Z){if($?.type==="flow-collection"){let X=$.end[0];if(X.indent===q&&(X.source==="]"||X.source==="}")&&AX.containsNewline($))Z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}wX.flowIndentCheck=IX});var Y2=I((NX)=>{var D9=y();function jX(q,$,Z){let{uniqueKeys:X}=q.options;if(X===!1)return!1;let Q=typeof X==="function"?X:(G,z)=>G===z||D9.isScalar(G)&&D9.isScalar(z)&&G.value===z.value;return $.some((G)=>Q(G.key,Z))}NX.mapIncludes=jX});var E9=I((fX)=>{var j9=G0(),CX=J0(),N9=Uq(),EX=q$(),P9=U2(),SX=Y2(),C9="All mapping items must start at the same column";function bX({composeNode:q,composeEmptyNode:$},Z,X,Q,G){let J=new(G?.nodeClass??CX.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let U=X.offset,H=null;for(let _ of X.items){let{start:V,key:W,sep:O,value:T}=_,B=N9.resolveProps(V,{indicator:"explicit-key-ind",next:W??O?.[0],offset:U,onError:Q,parentIndent:X.indent,startOnNewline:!0}),F=!B.found;if(F){if(W){if(W.type==="block-seq")Q(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==X.indent)Q(U,"BAD_INDENT",C9)}if(!B.anchor&&!B.tag&&!O){if(H=B.end,B.comment)if(J.comment)J.comment+=`
|
|
65
|
+
`+B.comment;else J.comment=B.comment;continue}if(B.newlineAfterProp||EX.containsNewline(W))Q(W??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==X.indent)Q(U,"BAD_INDENT",C9);Z.atKey=!0;let L=B.end,R=W?q(Z,W,B,Q):$(Z,L,V,null,B,Q);if(Z.schema.compat)P9.flowIndentCheck(X.indent,W,Q);if(Z.atKey=!1,SX.mapIncludes(Z,J.items,R))Q(L,"DUPLICATE_KEY","Map keys must be unique");let M=N9.resolveProps(O??[],{indicator:"map-value-ind",next:T,offset:R.range[2],onError:Q,parentIndent:X.indent,startOnNewline:!W||W.type==="block-scalar"});if(U=M.end,M.found){if(F){if(T?.type==="block-map"&&!M.hasNewline)Q(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&B.start<M.found.offset-1024)Q(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let A=T?q(Z,T,M,Q):$(Z,U,O,null,M,Q);if(Z.schema.compat)P9.flowIndentCheck(X.indent,T,Q);U=A.range[2];let D=new j9.Pair(R,A);if(Z.options.keepSourceTokens)D.srcToken=_;J.items.push(D)}else{if(F)Q(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(M.comment)if(R.comment)R.comment+=`
|
|
66
|
+
`+M.comment;else R.comment=M.comment;let A=new j9.Pair(R);if(Z.options.keepSourceTokens)A.srcToken=_;J.items.push(A)}}if(H&&H<U)Q(H,"IMPOSSIBLE","Map comment with trailing content");return J.range=[X.offset,U,H??U],J}fX.resolveBlockMap=bX});var S9=I((vX)=>{var xX=U0(),hX=Uq(),gX=U2();function kX({composeNode:q,composeEmptyNode:$},Z,X,Q,G){let J=new(G?.nodeClass??xX.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let U=X.offset,H=null;for(let{start:_,value:V}of X.items){let W=hX.resolveProps(_,{indicator:"seq-item-ind",next:V,offset:U,onError:Q,parentIndent:X.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||V)if(V?.type==="block-seq")Q(W.end,"BAD_INDENT","All sequence items must start at the same column");else Q(U,"MISSING_CHAR","Sequence item without - indicator");else{if(H=W.end,W.comment)J.comment=W.comment;continue}let O=V?q(Z,V,W,Q):$(Z,W.end,_,null,W,Q);if(Z.schema.compat)gX.flowIndentCheck(X.indent,V,Q);U=O.range[2],J.items.push(O)}return J.range=[X.offset,U,H??U],J}vX.resolveBlockSeq=kX});var g0=I((pX)=>{function mX(q,$,Z,X){let Q="";if(q){let G=!1,z="";for(let J of q){let{source:U,type:H}=J;switch(H){case"space":G=!0;break;case"comment":{if(Z&&!G)X(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let _=U.substring(1)||" ";if(!Q)Q=_;else Q+=z+_;z="";break}case"newline":if(Q)z+=U;G=!0;break;default:X(J,"UNEXPECTED_TOKEN",`Unexpected ${H} at node end`)}$+=U.length}}return{comment:Q,offset:$}}pX.resolveEnd=mX});var y9=I((rX)=>{var cX=y(),lX=G0(),b9=J0(),nX=U0(),aX=g0(),f9=Uq(),iX=q$(),oX=Y2(),H2="Block collections are not allowed within flow collections",V2=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function sX({composeNode:q,composeEmptyNode:$},Z,X,Q,G){let z=X.start.source==="{",J=z?"flow map":"flow sequence",H=new(G?.nodeClass??(z?b9.YAMLMap:nX.YAMLSeq))(Z.schema);H.flow=!0;let _=Z.atRoot;if(_)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let V=X.offset+X.start.source.length;for(let F=0;F<X.items.length;++F){let L=X.items[F],{start:R,key:M,sep:A,value:D}=L,j=f9.resolveProps(R,{flow:J,indicator:"explicit-key-ind",next:M??A?.[0],offset:V,onError:Q,parentIndent:X.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!A&&!D){if(F===0&&j.comma)Q(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(F<X.items.length-1)Q(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(j.comment)if(H.comment)H.comment+=`
|
|
67
|
+
`+j.comment;else H.comment=j.comment;V=j.end;continue}if(!z&&Z.options.strict&&iX.containsNewline(M))Q(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(F===0){if(j.comma)Q(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!j.comma)Q(j.start,"MISSING_CHAR",`Missing , between ${J} items`);if(j.comment){let w="";q:for(let K of R)switch(K.type){case"comma":case"space":break;case"comment":w=K.source.substring(1);break q;default:break q}if(w){let K=H.items[H.items.length-1];if(cX.isPair(K))K=K.value??K.key;if(K.comment)K.comment+=`
|
|
68
|
+
`+w;else K.comment=w;j.comment=j.comment.substring(w.length+1)}}}if(!z&&!A&&!j.found){let w=D?q(Z,D,j,Q):$(Z,j.end,A,null,j,Q);if(H.items.push(w),V=w.range[2],V2(D))Q(w.range,"BLOCK_IN_FLOW",H2)}else{Z.atKey=!0;let w=j.end,K=M?q(Z,M,j,Q):$(Z,w,R,null,j,Q);if(V2(M))Q(K.range,"BLOCK_IN_FLOW",H2);Z.atKey=!1;let E=f9.resolveProps(A??[],{flow:J,indicator:"map-value-ind",next:D,offset:K.range[2],onError:Q,parentIndent:X.indent,startOnNewline:!1});if(E.found){if(!z&&!j.found&&Z.options.strict){if(A)for(let f of A){if(f===E.found)break;if(f.type==="newline"){Q(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(j.start<E.found.offset-1024)Q(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(D)if("source"in D&&D.source?.[0]===":")Q(D,"MISSING_CHAR",`Missing space after : in ${J}`);else Q(E.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let N=D?q(Z,D,E,Q):E.found?$(Z,E.end,A,null,E,Q):null;if(N){if(V2(D))Q(N.range,"BLOCK_IN_FLOW",H2)}else if(E.comment)if(K.comment)K.comment+=`
|
|
69
|
+
`+E.comment;else K.comment=E.comment;let S=new lX.Pair(K,N);if(Z.options.keepSourceTokens)S.srcToken=L;if(z){let f=H;if(oX.mapIncludes(Z,f.items,K))Q(w,"DUPLICATE_KEY","Map keys must be unique");f.items.push(S)}else{let f=new b9.YAMLMap(Z.schema);f.flow=!0,f.items.push(S);let g=(N??K).range;f.range=[K.range[0],g[1],g[2]],H.items.push(f)}V=N?N.range[2]:E.end}}let W=z?"}":"]",[O,...T]=X.end,B=V;if(O?.source===W)B=O.offset+O.source.length;else{let F=J[0].toUpperCase()+J.substring(1),L=_?`${F} must end with a ${W}`:`${F} in block collection must be sufficiently indented and end with a ${W}`;if(Q(V,_?"MISSING_CHAR":"BAD_INDENT",L),O&&O.source.length!==1)T.unshift(O)}if(T.length>0){let F=aX.resolveEnd(T,B,Z.options.strict,Q);if(F.comment)if(H.comment)H.comment+=`
|
|
70
|
+
`+F.comment;else H.comment=F.comment;H.range=[X.offset,B,F.offset]}else H.range=[X.offset,B,B];return H}rX.resolveFlowCollection=sX});var x9=I((JQ)=>{var eX=y(),qQ=h(),$Q=J0(),ZQ=U0(),XQ=E9(),QQ=S9(),GQ=y9();function W2(q,$,Z,X,Q,G){let z=Z.type==="block-map"?XQ.resolveBlockMap(q,$,Z,X,G):Z.type==="block-seq"?QQ.resolveBlockSeq(q,$,Z,X,G):GQ.resolveFlowCollection(q,$,Z,X,G),J=z.constructor;if(Q==="!"||Q===J.tagName)return z.tag=J.tagName,z;if(Q)z.tag=Q;return z}function zQ(q,$,Z,X,Q){let G=X.tag,z=!G?null:$.directives.tagName(G.source,(W)=>Q(G,"TAG_RESOLVE_FAILED",W));if(Z.type==="block-seq"){let{anchor:W,newlineAfterProp:O}=X,T=W&&G?W.offset>G.offset?W:G:W??G;if(T&&(!O||O.offset<T.offset))Q(T,"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(!G||!z||z==="!"||z===$Q.YAMLMap.tagName&&J==="map"||z===ZQ.YAMLSeq.tagName&&J==="seq")return W2(q,$,Z,Q,z);let U=$.schema.tags.find((W)=>W.tag===z&&W.collection===J);if(!U){let W=$.schema.knownTags[z];if(W?.collection===J)$.schema.tags.push(Object.assign({},W,{default:!1})),U=W;else{if(W)Q(G,"BAD_COLLECTION_TYPE",`${W.tag} used for ${J} collection, but expects ${W.collection??"scalar"}`,!0);else Q(G,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return W2(q,$,Z,Q,z)}}let H=W2(q,$,Z,Q,z,U),_=U.resolve?.(H,(W)=>Q(G,"TAG_RESOLVE_FAILED",W),$.options)??H,V=eX.isNode(_)?_:new qQ.Scalar(_);if(V.range=H.range,V.tag=z,U?.format)V.format=U.format;return V}JQ.composeCollection=zQ});var B2=I((WQ)=>{var _2=h();function YQ(q,$,Z){let X=$.offset,Q=HQ($,q.options.strict,Z);if(!Q)return{value:"",type:null,comment:"",range:[X,X,X]};let G=Q.mode===">"?_2.Scalar.BLOCK_FOLDED:_2.Scalar.BLOCK_LITERAL,z=$.source?VQ($.source):[],J=z.length;for(let B=z.length-1;B>=0;--B){let F=z[B][1];if(F===""||F==="\r")J=B;else break}if(J===0){let B=Q.chomp==="+"&&z.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,z.length-1)):"",F=X+Q.length;if($.source)F+=$.source.length;return{value:B,type:G,comment:Q.comment,range:[X,F,F]}}let U=$.indent+Q.indent,H=$.offset+Q.length,_=0;for(let B=0;B<J;++B){let[F,L]=z[B];if(L===""||L==="\r"){if(Q.indent===0&&F.length>U)U=F.length}else{if(F.length<U)Z(H+F.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Q.indent===0)U=F.length;if(_=B,U===0&&!q.atRoot)Z(H,"BAD_INDENT","Block scalar values in collections must be indented");break}H+=F.length+L.length+1}for(let B=z.length-1;B>=J;--B)if(z[B][0].length>U)J=B+1;let V="",W="",O=!1;for(let B=0;B<_;++B)V+=z[B][0].slice(U)+`
|
|
72
|
+
`;for(let B=_;B<J;++B){let[F,L]=z[B];H+=F.length+L.length+1;let R=L[L.length-1]==="\r";if(R)L=L.slice(0,-1);if(L&&F.length<U){let A=`Block scalar lines must not be less indented than their ${Q.indent?"explicit indentation indicator":"first line"}`;Z(H-L.length-(R?2:1),"BAD_INDENT",A),F=""}if(G===_2.Scalar.BLOCK_LITERAL)V+=W+F.slice(U)+L,W=`
|
|
73
|
+
`;else if(F.length>U||L[0]==="\t"){if(W===" ")W=`
|
|
74
74
|
`;else if(!O&&W===`
|
|
75
75
|
`)W=`
|
|
76
76
|
|
|
77
|
-
`;V+=W+
|
|
77
|
+
`;V+=W+F.slice(U)+L,W=`
|
|
78
78
|
`,O=!0}else if(L==="")if(W===`
|
|
79
79
|
`)V+=`
|
|
80
80
|
`;else W=`
|
|
81
|
-
`;else V+=W+L,W=" ",O=!1}switch(Q.chomp){case"-":break;case"+":for(let
|
|
82
|
-
`+z[
|
|
81
|
+
`;else V+=W+L,W=" ",O=!1}switch(Q.chomp){case"-":break;case"+":for(let B=J;B<z.length;++B)V+=`
|
|
82
|
+
`+z[B][0].slice(U);if(V[V.length-1]!==`
|
|
83
83
|
`)V+=`
|
|
84
84
|
`;break;default:V+=`
|
|
85
|
-
`}let
|
|
85
|
+
`}let T=X+Q.length+$.source.length;return{value:V,type:G,comment:Q.comment,range:[X,T,T]}}function HQ({offset:q,props:$},Z,X){if($[0].type!=="block-scalar-header")return X($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Q}=$[0],G=Q[0],z=0,J="",U=-1;for(let W=1;W<Q.length;++W){let O=Q[W];if(!J&&(O==="-"||O==="+"))J=O;else{let T=Number(O);if(!z&&T)z=T;else if(U===-1)U=q+W}}if(U!==-1)X(U,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Q}`);let H=!1,_="",V=Q.length;for(let W=1;W<$.length;++W){let O=$[W];switch(O.type){case"space":H=!0;case"newline":V+=O.source.length;break;case"comment":if(Z&&!H)X(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=O.source.length,_=O.source.substring(1);break;case"error":X(O,"UNEXPECTED_TOKEN",O.message),V+=O.source.length;break;default:{let T=`Unexpected token in block scalar header: ${O.type}`;X(O,"UNEXPECTED_TOKEN",T);let B=O.source;if(B&&typeof B==="string")V+=B.length}}}return{mode:G,indent:z,chomp:J,comment:_,length:V}}function VQ(q){let $=q.split(/\n( *)/),Z=$[0],X=Z.match(/^( *)/),G=[X?.[1]?[X[1],Z.slice(X[1].length)]:["",Z]];for(let z=1;z<$.length;z+=2)G.push([$[z],$[z+1]]);return G}WQ.resolveBlockScalar=YQ});var F2=I((AQ)=>{var O2=h(),BQ=g0();function OQ(q,$,Z){let{offset:X,type:Q,source:G,end:z}=q,J,U,H=(W,O,T)=>Z(X+W,O,T);switch(Q){case"scalar":J=O2.Scalar.PLAIN,U=FQ(G,H);break;case"single-quoted-scalar":J=O2.Scalar.QUOTE_SINGLE,U=TQ(G,H);break;case"double-quoted-scalar":J=O2.Scalar.QUOTE_DOUBLE,U=KQ(G,H);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Q}`),{value:"",type:null,comment:"",range:[X,X+G.length,X+G.length]}}let _=X+G.length,V=BQ.resolveEnd(z,_,$,Z);return{value:U,type:J,comment:V.comment,range:[X,_,V.offset]}}function FQ(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 h9(q)}function TQ(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return h9(q.slice(1,-1)).replace(/''/g,"'")}function h9(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
-
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=$.exec(q);if(!X)return q;let Q=X[1],
|
|
88
|
-
`)Q+=
|
|
89
|
-
`;else Q+=
|
|
87
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=$.exec(q);if(!X)return q;let Q=X[1],G=" ",z=$.lastIndex;Z.lastIndex=z;while(X=Z.exec(q)){if(X[1]==="")if(G===`
|
|
88
|
+
`)Q+=G;else G=`
|
|
89
|
+
`;else Q+=G+X[1],G=" ";z=Z.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=z,X=J.exec(q),Q+G+(X?.[1]??"")}function KQ(q,$){let Z="";for(let X=1;X<q.length-1;++X){let Q=q[X];if(Q==="\r"&&q[X+1]===`
|
|
90
90
|
`)continue;if(Q===`
|
|
91
|
-
`){let{fold:
|
|
92
|
-
`){
|
|
93
|
-
`){
|
|
91
|
+
`){let{fold:G,offset:z}=LQ(q,X);Z+=G,X=z}else if(Q==="\\"){let G=q[++X],z=MQ[G];if(z)Z+=z;else if(G===`
|
|
92
|
+
`){G=q[X+1];while(G===" "||G==="\t")G=q[++X+1]}else if(G==="\r"&&q[X+1]===`
|
|
93
|
+
`){G=q[++X+1];while(G===" "||G==="\t")G=q[++X+1]}else if(G==="x"||G==="u"||G==="U"){let J={x:2,u:4,U:8}[G];Z+=RQ(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(Q===" "||Q==="\t"){let G=X,z=q[X+1];while(z===" "||z==="\t")z=q[++X+1];if(z!==`
|
|
94
94
|
`&&!(z==="\r"&&q[X+2]===`
|
|
95
|
-
`))Z+=X>
|
|
95
|
+
`))Z+=X>G?q.slice(G,X+1):Q}else Z+=Q}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function LQ(q,$){let Z="",X=q[$+1];while(X===" "||X==="\t"||X===`
|
|
96
96
|
`||X==="\r"){if(X==="\r"&&q[$+2]!==`
|
|
97
97
|
`)break;if(X===`
|
|
98
98
|
`)Z+=`
|
|
99
|
-
`;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var
|
|
100
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
99
|
+
`;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var MQ={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function RQ(q,$,Z,X){let Q=q.substr($,Z),z=Q.length===Z&&/^[0-9a-fA-F]+$/.test(Q)?parseInt(Q,16):NaN;if(isNaN(z)){let J=q.substr($-2,Z+2);return X($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}return String.fromCodePoint(z)}AQ.resolveFlowScalar=OQ});var k9=I((CQ)=>{var M0=y(),g9=h(),wQ=B2(),DQ=F2();function jQ(q,$,Z,X){let{value:Q,type:G,comment:z,range:J}=$.type==="block-scalar"?wQ.resolveBlockScalar(q,$,X):DQ.resolveFlowScalar($,q.options.strict,X),U=Z?q.directives.tagName(Z.source,(V)=>X(Z,"TAG_RESOLVE_FAILED",V)):null,H;if(q.options.stringKeys&&q.atKey)H=q.schema[M0.SCALAR];else if(U)H=NQ(q.schema,Q,U,Z,X);else if($.type==="scalar")H=PQ(q,Q,$,X);else H=q.schema[M0.SCALAR];let _;try{let V=H.resolve(Q,(W)=>X(Z??$,"TAG_RESOLVE_FAILED",W),q.options);_=M0.isScalar(V)?V:new g9.Scalar(V)}catch(V){let W=V instanceof Error?V.message:String(V);X(Z??$,"TAG_RESOLVE_FAILED",W),_=new g9.Scalar(Q)}if(_.range=J,_.source=Q,G)_.type=G;if(U)_.tag=U;if(H.format)_.format=H.format;if(z)_.comment=z;return _}function NQ(q,$,Z,X,Q){if(Z==="!")return q[M0.SCALAR];let G=[];for(let J of q.tags)if(!J.collection&&J.tag===Z)if(J.default&&J.test)G.push(J);else return J;for(let J of G)if(J.test?.test($))return J;let z=q.knownTags[Z];if(z&&!z.collection)return q.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return Q(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[M0.SCALAR]}function PQ({atKey:q,directives:$,schema:Z},X,Q,G){let z=Z.tags.find((J)=>(J.default===!0||q&&J.default==="key")&&J.test?.test(X))||Z[M0.SCALAR];if(Z.compat){let J=Z.compat.find((U)=>U.default&&U.test?.test(X))??Z[M0.SCALAR];if(z.tag!==J.tag){let U=$.tagString(z.tag),H=$.tagString(J.tag),_=`Value may be parsed as either ${U} or ${H}`;G(Q,"TAG_RESOLVE_FAILED",_,!0)}}return z}CQ.composeScalar=jQ});var v9=I((bQ)=>{function SQ(q,$,Z){if($){Z??(Z=$.length);for(let X=Z-1;X>=0;--X){let Q=$[X];switch(Q.type){case"space":case"comment":case"newline":q-=Q.source.length;continue}Q=$[++X];while(Q?.type==="space")q+=Q.source.length,Q=$[++X];break}}return q}bQ.emptyScalarPosition=SQ});var p9=I((mQ)=>{var yQ=l0(),xQ=y(),hQ=x9(),u9=k9(),gQ=g0(),kQ=v9(),vQ={composeNode:m9,composeEmptyNode:T2};function m9(q,$,Z,X){let Q=q.atKey,{spaceBefore:G,comment:z,anchor:J,tag:U}=Z,H,_=!0;switch($.type){case"alias":if(H=uQ(q,$,X),J||U)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=u9.composeScalar(q,$,U,X),J)H.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(H=hQ.composeCollection(vQ,q,$,Z,X),J)H.anchor=J.source.substring(1);break;default:{let V=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;X($,"UNEXPECTED_TOKEN",V),H=T2(q,$.offset,void 0,null,Z,X),_=!1}}if(J&&H.anchor==="")X(J,"BAD_ALIAS","Anchor cannot be an empty string");if(Q&&q.options.stringKeys&&(!xQ.isScalar(H)||typeof H.value!=="string"||H.tag&&H.tag!=="tag:yaml.org,2002:str"))X(U??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(G)H.spaceBefore=!0;if(z)if($.type==="scalar"&&$.source==="")H.comment=z;else H.commentBefore=z;if(q.options.keepSourceTokens&&_)H.srcToken=$;return H}function T2(q,$,Z,X,{spaceBefore:Q,comment:G,anchor:z,tag:J,end:U},H){let _={type:"scalar",offset:kQ.emptyScalarPosition($,Z,X),indent:-1,source:""},V=u9.composeScalar(q,_,J,H);if(z){if(V.anchor=z.source.substring(1),V.anchor==="")H(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(Q)V.spaceBefore=!0;if(G)V.comment=G,V.range[2]=U;return V}function uQ({options:q},{offset:$,source:Z,end:X},Q){let G=new yQ.Alias(Z.substring(1));if(G.source==="")Q($,"BAD_ALIAS","Alias cannot be an empty string");if(G.source.endsWith(":"))Q($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=$+Z.length,J=gQ.resolveEnd(X,z,q.strict,Q);if(G.range=[$,z,J.offset],J.comment)G.comment=J.comment;return G}mQ.composeEmptyNode=T2;mQ.composeNode=m9});var c9=I((iQ)=>{var cQ=zq(),d9=p9(),lQ=g0(),nQ=Uq();function aQ(q,$,{offset:Z,start:X,value:Q,end:G},z){let J=Object.assign({_directives:$},q),U=new cQ.Document(void 0,J),H={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},_=nQ.resolveProps(X,{indicator:"doc-start",next:Q??G?.[0],offset:Z,onError:z,parentIndent:0,startOnNewline:!0});if(_.found){if(U.directives.docStart=!0,Q&&(Q.type==="block-map"||Q.type==="block-seq")&&!_.hasNewline)z(_.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}U.contents=Q?d9.composeNode(H,Q,_,z):d9.composeEmptyNode(H,_.end,X,null,_,z);let V=U.contents.range[2],W=lQ.resolveEnd(G,V,!1,z);if(W.comment)U.comment=W.comment;return U.range=[Z,V,W.offset],U}iQ.composeDoc=aQ});var K2=I(($G)=>{var sQ=x("process"),rQ=A$(),tQ=zq(),Yq=Jq(),l9=y(),eQ=c9(),qG=g0();function Hq(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 n9(q){let $="",Z=!1,X=!1;for(let Q=0;Q<q.length;++Q){let G=q[Q];switch(G[0]){case"#":$+=($===""?"":X?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(
|
|
104
|
-
${Z}`:Z;else if(X||q.directives.docStart||!Q)q.commentBefore=Z;else if(
|
|
105
|
-
${z}`:Z}else{let
|
|
106
|
-
${
|
|
107
|
-
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new
|
|
108
|
-
`}];switch(
|
|
109
|
-
`),
|
|
110
|
-
`,W=[{type:"block-scalar-header",offset:
|
|
111
|
-
`});return{type:"block-scalar",offset:
|
|
103
|
+
`)+(G.substring(1)||" "),Z=!0,X=!1;break;case"%":if(q[Q+1]?.[0]!=="#")Q+=1;Z=!1;break;default:if(!Z)X=!0;Z=!1}}return{comment:$,afterEmptyLine:X}}class a9{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,X,Q)=>{let G=Hq($);if(Q)this.warnings.push(new Yq.YAMLWarning(G,Z,X));else this.errors.push(new Yq.YAMLParseError(G,Z,X))},this.directives=new rQ.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:X}=n9(this.prelude);if(Z){let Q=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
104
|
+
${Z}`:Z;else if(X||q.directives.docStart||!Q)q.commentBefore=Z;else if(l9.isCollection(Q)&&!Q.flow&&Q.items.length>0){let G=Q.items[0];if(l9.isPair(G))G=G.key;let z=G.commentBefore;G.commentBefore=z?`${Z}
|
|
105
|
+
${z}`:Z}else{let G=Q.commentBefore;Q.commentBefore=G?`${Z}
|
|
106
|
+
${G}`: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:n9(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(sQ.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,X)=>{let Q=Hq(q);Q[0]+=$,this.onError(Q,"BAD_DIRECTIVE",Z,X)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=eQ.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 Yq.YAMLParseError(Hq(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 Yq.YAMLParseError(Hq(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=qG.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
|
|
107
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new Yq.YAMLParseError(Hq(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 tQ.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}}}$G.Composer=a9});var s9=I((HG)=>{var XG=B2(),QG=F2(),GG=Jq(),i9=o0();function zG(q,$=!0,Z){if(q){let X=(Q,G,z)=>{let J=typeof Q==="number"?Q:Array.isArray(Q)?Q[0]:Q.offset;if(Z)Z(J,G,z);else throw new GG.YAMLParseError([J,J+1],G,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return QG.resolveFlowScalar(q,$,X);case"block-scalar":return XG.resolveBlockScalar({options:{strict:$}},q,X)}}return null}function JG(q,$){let{implicitKey:Z=!1,indent:X,inFlow:Q=!1,offset:G=-1,type:z="PLAIN"}=$,J=i9.stringifyString({type:z,value:q},{implicitKey:Z,indent:X>0?" ".repeat(X):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}}),U=$.end??[{type:"newline",offset:-1,indent:X,source:`
|
|
108
|
+
`}];switch(J[0]){case"|":case">":{let H=J.indexOf(`
|
|
109
|
+
`),_=J.substring(0,H),V=J.substring(H+1)+`
|
|
110
|
+
`,W=[{type:"block-scalar-header",offset:G,indent:X,source:_}];if(!o9(W,U))W.push({type:"newline",offset:-1,indent:X,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:G,indent:X,props:W,source:V}}case'"':return{type:"double-quoted-scalar",offset:G,indent:X,source:J,end:U};case"'":return{type:"single-quoted-scalar",offset:G,indent:X,source:J,end:U};default:return{type:"scalar",offset:G,indent:X,source:J,end:U}}}function UG(q,$,Z={}){let{afterKey:X=!1,implicitKey:Q=!1,inFlow:G=!1,type:z}=Z,J="indent"in q?q.indent:null;if(X&&typeof J==="number")J+=2;if(!z)switch(q.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let H=q.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=H.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let U=i9.stringifyString({type:z,value:$},{implicitKey:Q||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:G,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":YG(q,U);break;case'"':L2(q,U,"double-quoted-scalar");break;case"'":L2(q,U,"single-quoted-scalar");break;default:L2(q,U,"scalar")}}function YG(q,$){let Z=$.indexOf(`
|
|
112
112
|
`),X=$.substring(0,Z),Q=$.substring(Z+1)+`
|
|
113
|
-
`;if(q.type==="block-scalar"){let
|
|
114
|
-
`});for(let
|
|
115
|
-
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[Q]});break}default:{let X="indent"in q?q.indent:-1,Q="end"in q&&Array.isArray(q.end)?q.end.filter((
|
|
113
|
+
`;if(q.type==="block-scalar"){let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");G.source=X,q.source=Q}else{let{offset:G}=q,z="indent"in q?q.indent:-1,J=[{type:"block-scalar-header",offset:G,indent:z,source:X}];if(!o9(J,"end"in q?q.end:void 0))J.push({type:"newline",offset:-1,indent:z,source:`
|
|
114
|
+
`});for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:"block-scalar",indent:z,props:J,source:Q})}}function o9(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 L2(q,$,Z){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=Z,q.source=$;break;case"block-scalar":{let X=q.props.slice(1),Q=$.length;if(q.props[0].type==="block-scalar-header")Q-=q.props[0].source.length;for(let G of X)G.offset+=Q;delete q.props,Object.assign(q,{type:Z,source:$,end:X});break}case"block-map":case"block-seq":{let Q={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
115
|
+
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[Q]});break}default:{let X="indent"in q?q.indent:-1,Q="end"in q&&Array.isArray(q.end)?q.end.filter((G)=>G.type==="space"||G.type==="comment"||G.type==="newline"):[];for(let G of Object.keys(q))if(G!=="type"&&G!=="offset")delete q[G];Object.assign(q,{type:Z,indent:X,source:$,end:Q})}}}HG.createScalarToken=JG;HG.resolveAsScalar=zG;HG.setScalarValue=UG});var r9=I((OG)=>{var BG=(q)=>("type"in q)?Z$(q):$$(q);function Z$(q){switch(q.type){case"block-scalar":{let $="";for(let Z of q.props)$+=Z$(Z);return $+q.source}case"block-map":case"block-seq":{let $="";for(let Z of q.items)$+=$$(Z);return $}case"flow-collection":{let $=q.start.source;for(let Z of q.items)$+=$$(Z);for(let Z of q.end)$+=Z.source;return $}case"document":{let $=$$(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 $$({start:q,key:$,sep:Z,value:X}){let Q="";for(let G of q)Q+=G.source;if($)Q+=Z$($);if(Z)for(let G of Z)Q+=G.source;if(X)Q+=Z$(X);return Q}OG.stringify=BG});var q4=I((KG)=>{var M2=Symbol("break visit"),TG=Symbol("skip children"),t9=Symbol("remove item");function R0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};e9(Object.freeze([]),q,$)}R0.BREAK=M2;R0.SKIP=TG;R0.REMOVE=t9;R0.itemAtPath=(q,$)=>{let Z=q;for(let[X,Q]of $){let G=Z?.[X];if(G&&"items"in G)Z=G.items[Q];else return}return Z};R0.parentCollection=(q,$)=>{let Z=R0.itemAtPath(q,$.slice(0,-1)),X=$[$.length-1][0],Q=Z?.[X];if(Q&&"items"in Q)return Q;throw Error("Parent collection not found")};function e9(q,$,Z){let X=Z($,q);if(typeof X==="symbol")return X;for(let Q of["key","value"]){let G=$[Q];if(G&&"items"in G){for(let z=0;z<G.items.length;++z){let J=e9(Object.freeze(q.concat([[Q,z]])),G.items[z],Z);if(typeof J==="number")z=J-1;else if(J===M2)return M2;else if(J===t9)G.items.splice(z,1),z-=1}if(typeof X==="function"&&Q==="key")X=X($,q)}}return typeof X==="function"?X($,q):X}KG.visit=R0});var X$=I((jG)=>{var R2=s9(),MG=r9(),RG=q4(),A2="\uFEFF",I2="\x02",w2="\x18",D2="\x1F",AG=(q)=>!!q&&("items"in q),IG=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function wG(q){switch(q){case A2:return"<BOM>";case I2:return"<DOC>";case w2:return"<FLOW_END>";case D2:return"<SCALAR>";default:return JSON.stringify(q)}}function DG(q){switch(q){case A2:return"byte-order-mark";case I2:return"doc-mode";case w2:return"flow-error-end";case D2:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
118
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
119
|
-
\r `),
|
|
117
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}jG.createScalarToken=R2.createScalarToken;jG.resolveAsScalar=R2.resolveAsScalar;jG.setScalarValue=R2.setScalarValue;jG.stringify=MG.stringify;jG.visit=RG.visit;jG.BOM=A2;jG.DOCUMENT=I2;jG.FLOW_END=w2;jG.SCALAR=D2;jG.isCollection=AG;jG.isScalar=IG;jG.prettyToken=wG;jG.tokenType=DG});var N2=I((pG)=>{var Vq=X$();function o(q){switch(q){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var $4=new Set("0123456789ABCDEFabcdef"),uG=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Q$=new Set(",[]{}"),mG=new Set(` ,[]{}
|
|
119
|
+
\r `),j2=(q)=>!q||mG.has(q);class Z4{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let Z=this.next??"stream";while(Z&&($||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
120
120
|
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
121
121
|
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let X=this.buffer[Z+q+1];if(X===`
|
|
122
122
|
`||!X&&!this.atEnd)return q+Z+1}return $===`
|
|
123
|
-
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&
|
|
124
|
-
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===
|
|
123
|
+
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&o(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
124
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Vq.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let Q=q[Z-1];if(Q===" "||Q==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let Q=q[$-1];if(Q===" "||Q==="\t")$-=1;else break}let X=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield Vq.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(($==="---"||$==="...")&&o(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&&!o(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===":")&&o($)){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(j2),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,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("..."))&&o(X[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield Vq.FLOW_END,yield*this.parseLineStart()}let Q=0;while(X[Q]===",")Q+=yield*this.pushCount(1),Q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Q+=yield*this.pushIndicators(),X[Q]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-Q),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(j2),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let G=this.charAt(1);if(this.flowKey||o(G)||G===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let Q=0;while(this.buffer[$-1-Q]==="\\")Q+=1;if(Q%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),X=Z.indexOf(`
|
|
125
125
|
`,this.pos);if(X!==-1){while(X!==-1){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Z.indexOf(`
|
|
126
|
-
`,Q)}if(X!==-1)$=X-(Z[X-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>
|
|
127
|
-
`:q=Q,$=0;break;case"\r":{let
|
|
126
|
+
`,Q)}if(X!==-1)$=X-(Z[X-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>o($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let Q=this.pos;Z=this.buffer[Q];++Q)switch(Z){case" ":$+=1;break;case`
|
|
127
|
+
`:q=Q,$=0;break;case"\r":{let G=this.buffer[Q+1];if(!G&&!this.atEnd)return this.setNext("block-scalar");if(G===`
|
|
128
128
|
`)break}default:break q}if(!Z&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let Q=this.continueScalar(q+1);if(Q===-1)break;q=this.buffer.indexOf(`
|
|
129
129
|
`,Q)}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===`
|
|
130
|
-
`)Z=this.buffer[++X];q=X-1}else if(!this.blockScalarKeep)do{let Q=q-1,
|
|
131
|
-
`&&Q>=this.pos&&Q+1+$>z)q=Q;else break}while(!0);return yield
|
|
130
|
+
`)Z=this.buffer[++X];q=X-1}else if(!this.blockScalarKeep)do{let Q=q-1,G=this.buffer[Q];if(G==="\r")G=this.buffer[--Q];let z=Q;while(G===" ")G=this.buffer[--Q];if(G===`
|
|
131
|
+
`&&Q>=this.pos&&Q+1+$>z)q=Q;else break}while(!0);return yield Vq.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,Z=this.pos-1,X;while(X=this.buffer[++Z])if(X===":"){let Q=this.buffer[Z+1];if(o(Q)||q&&Q$.has(Q))break;$=Z}else if(o(X)){let Q=this.buffer[Z+1];if(X==="\r")if(Q===`
|
|
132
132
|
`)Z+=1,X=`
|
|
133
|
-
`,Q=this.buffer[Z+1];else $=Z;if(Q==="#"||q
|
|
134
|
-
`){let
|
|
133
|
+
`,Q=this.buffer[Z+1];else $=Z;if(Q==="#"||q&&Q$.has(Q))break;if(X===`
|
|
134
|
+
`){let G=this.continueScalar(Z+1);if(G===-1)break;Z=Math.max(Z,G-2)}}else{if(q&&Q$.has(X))break;$=Z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield Vq.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(j2))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(o($)||q&&Q$.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!o($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(uG.has($))$=this.buffer[++q];else if($==="%"&&$4.has(this.buffer[q+1])&&$4.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
135
135
|
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
136
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}pG.Lexer=Z4});var P2=I((cG)=>{class X4{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let Q=$+Z>>1;if(this.lineStarts[Q]<q)$=Q+1;else Z=Q}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let X=this.lineStarts[$-1];return{line:$,col:q-X+1}}}}cG.LineCounter=X4});var C2=I((iG)=>{var nG=x("process"),Q4=X$(),aG=N2();function Y0(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function G4(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function J4(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 G$(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 k0(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 z4(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!Y0($.start,"explicit-key-ind")&&!Y0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,J4($.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 U4{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 aG.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,nG.env.LOG_TOKENS)console.log("|",Q4.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=Q4.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")z4($);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&&G4(X.start)===-1&&($.indent===0||X.start.every((Q)=>Q.type!=="comment"||Q.indent<$.indent))){if(Z.type==="document")Z.end=X.start;else Z.items.push({start:X.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(G4(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 $=G$(this.peek(2)),Z=k0($),X;if(q.end)X=q.end,X.push(this.sourceToken),delete q.end;else X=[this.sourceToken];let Q={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
137
137
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
138
|
-
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",Q=[];if(X&&$.sep&&!$.value){let
|
|
138
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",Q=[];if(X&&$.sep&&!$.value){let G=[];for(let z=0;z<$.sep.length;++z){let J=$.sep[z];switch(J.type){case"newline":G.push(z);break;case"space":break;case"comment":if(J.indent>q.indent)G.length=0;break;default:G.length=0}}if(G.length>=2)Q=$.sep.splice(G[1])}switch(this.type){case"anchor":case"tag":if(X||$.value)Q.push(this.sourceToken),q.items.push({start:Q}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(X||$.value)Q.push(this.sourceToken),q.items.push({start:Q,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(Y0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let G=k0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:G,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Y0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]});else if(J4($.key)&&!Y0($.sep,"newline")){let G=k0($.start),z=$.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:G,key:z,sep:J}]})}else if(Q.length>0)$.sep=$.sep.concat(Q,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||X)q.items.push({start:Q,key:null,sep:[this.sourceToken]});else if(Y0($.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 G=this.flowScalar(this.type);if(X||$.value)q.items.push({start:Q,key:G,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(G);else Object.assign($,{key:G,sep:[]}),this.onKeyLine=!0;return}default:{let G=this.startBlockValue(q);if(G){if(G.type==="block-seq"){if(!$.explicitKey&&$.sep&&!Y0($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Z)q.items.push({start:Q});this.stack.push(G);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||Y0($.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=G$(Z),Q=k0(X);z4(q);let G=q.end.splice(1,q.end.length);G.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Q,key:q,sep:G}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
139
139
|
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
140
|
-
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=
|
|
141
|
-
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class
|
|
142
|
-
`;Q.write(V),
|
|
143
|
-
`){X.searchActive=!1,
|
|
144
|
-
`:O(X.getSelectedIndices());break;case"\x1B":if(X.filter!=="")X.filter="",X.applyFilter($),
|
|
140
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=G$(q),Z=k0($);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 $=G$(q),Z=k0($);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()}}}iG.Parser=U4});var _4=I((Xz)=>{var Y4=K2(),sG=zq(),Wq=Jq(),rG=P$(),tG=y(),eG=P2(),H4=C2();function V4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new eG.LineCounter||null,prettyErrors:$}}function qz(q,$={}){let{lineCounter:Z,prettyErrors:X}=V4($),Q=new H4.Parser(Z?.addNewLine),G=new Y4.Composer($),z=Array.from(G.compose(Q.parse(q)));if(X&&Z)for(let J of z)J.errors.forEach(Wq.prettifyError(q,Z)),J.warnings.forEach(Wq.prettifyError(q,Z));if(z.length>0)return z;return Object.assign([],{empty:!0},G.streamInfo())}function W4(q,$={}){let{lineCounter:Z,prettyErrors:X}=V4($),Q=new H4.Parser(Z?.addNewLine),G=new Y4.Composer($),z=null;for(let J of G.compose(Q.parse(q),!0,q.length))if(!z)z=J;else if(z.options.logLevel!=="silent"){z.errors.push(new Wq.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&Z)z.errors.forEach(Wq.prettifyError(q,Z)),z.warnings.forEach(Wq.prettifyError(q,Z));return z}function $z(q,$,Z){let X=void 0;if(typeof $==="function")X=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let Q=W4(q,Z);if(!Q)return null;if(Q.warnings.forEach((G)=>rG.warn(Q.options.logLevel,G)),Q.errors.length>0)if(Q.options.logLevel!=="silent")throw Q.errors[0];else Q.errors=[];return Q.toJS(Object.assign({reviver:X},Z))}function Zz(q,$,Z){let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let Q=Math.round(Z);Z=Q<1?void 0:Q>8?{indent:8}:{indent:Q}}if(q===void 0){let{keepUndefined:Q}=Z??$??{};if(!Q)return}if(tG.isDocument(q)&&!X)return q.toString(Z);return new sG.Document(q,X,Z).toString(Z)}Xz.parse=$z;Xz.parseAllDocuments=qz;Xz.parseDocument=W4;Xz.stringify=Zz});import{execFile as b5}from"child_process";import{promisify as f5}from"util";import{mkdtemp as i2,readdir as y5,readFile as T$,rm as Tq,cp as x5,access as F$,stat as h5,lstat as g5,symlink as k5,mkdir as v5}from"fs/promises";import{join as t,resolve as o2,relative as u5,basename as m5}from"path";import{homedir as s2}from"os";import{tmpdir as r2}from"os";import{readdir as D5,readFile as j5,stat as N5}from"fs/promises";import{join as P5}from"path";var C5=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"]),E5=524288;async function Oq(q){let $=[];async function Z(X,Q){let G;try{G=await D5(X)}catch{return}for(let z of G){if(z===".git"||z==="node_modules")continue;let J=P5(X,z),U=Q?`${Q}/${z}`:z;try{let H=await N5(J);if(H.isDirectory())await Z(J,U);else if(H.isFile()){let _=z.includes(".")?`.${z.split(".").pop().toLowerCase()}`:"";if(C5.has(_))continue;if(H.size>E5)continue;try{let V=await j5(J,"utf-8");$.push({relPath:U,content:V,lineCount:V.split(`
|
|
141
|
+
`).length})}catch{}}}catch{continue}}}return await Z(q,""),$}class a2{selected;cursor;scrollOffset;pageSize;itemCount;filter;searchActive;filteredMap;constructor(q,$){this.selected=q.map((Z)=>Z.checked),this.cursor=1,this.scrollOffset=0,this.pageSize=$,this.itemCount=q.length,this.filter="",this.searchActive=!1,this.filteredMap=q.map((Z,X)=>X)}get totalRows(){return this.filteredMap.length+1}applyFilter(q){if(this.filter==="")this.filteredMap=q.map(($,Z)=>Z);else{let $=this.filter.toLowerCase();this.filteredMap=[];for(let Z=0;Z<q.length;Z++)if((q[Z].label.toLowerCase()+" "+(q[Z].hint?.toLowerCase()??"")).includes($))this.filteredMap.push(Z)}if(this.cursor>=this.totalRows)this.cursor=Math.max(0,this.totalRows-1);if(this.scrollOffset>0&&this.scrollOffset>=this.totalRows)this.scrollOffset=Math.max(0,this.totalRows-this.pageSize)}cursorToOriginalIndex(){if(this.cursor===0)return-1;return this.filteredMap[this.cursor-1]??-1}toggleCurrent(){if(this.cursor===0)this.toggleAll();else{let q=this.cursorToOriginalIndex();if(q>=0)this.selected[q]=!this.selected[q]}}toggleAll(){let q=this.filteredMap,Z=!q.every((X)=>this.selected[X]);for(let X of q)this.selected[X]=Z}moveUp(){if(this.cursor>0)this.cursor--;else this.cursor=this.totalRows-1;this.adjustScroll()}moveDown(){if(this.cursor<this.totalRows-1)this.cursor++;else this.cursor=0;this.adjustScroll()}getSelectedIndices(){let q=[];for(let $=0;$<this.selected.length;$++)if(this.selected[$])q.push($);return q}getVisibleRange(){let q=this.scrollOffset,$=Math.min(this.scrollOffset+this.pageSize,this.totalRows);return{start:q,end:$}}adjustScroll(){if(this.cursor<this.scrollOffset)this.scrollOffset=this.cursor;else if(this.cursor>=this.scrollOffset+this.pageSize)this.scrollOffset=this.cursor-this.pageSize+1}}function S5(q,$,Z){let X=[];if(q.searchActive||q.filter!==""){let H=Y.cyan("/"),_=q.filter,V=q.searchActive?Y.cyan("█"):"";if(X.push(` ${H}${_}${V}`),q.filteredMap.length===0)X.push(Y.dim(" No matches found"));X.push("")}let{start:Q,end:G}=q.getVisibleRange();if(Q>0)X.push(Y.dim(` ... ${Q} more above`));for(let H=Q;H<G;H++){let V=H===q.cursor?Y.cyan(">"):" ";if(H===0){let W=q.filteredMap,T=W.length>0&&W.every((F)=>q.selected[F])?Y.green("[*]"):"[ ]",B=q.filter!==""?`Select All Matching (${q.filteredMap.length})`:"Select All / Deselect All";X.push(`${V} ${T} ${Y.bold(B)}`)}else{let W=q.filteredMap[H-1],O=$[W],B=q.selected[W]?Y.green("[*]"):"[ ]",F=`${V} ${B} `,L=7,R=Y.bold(O.label),M=O.label.length;if(O.hint){let A=Z-7-M-2;if(A>10){let D=B$(O.hint,A);X.push(`${F}${R} ${Y.dim(D)}`)}else{let D=B$(O.label,Z-7);X.push(`${F}${Y.bold(D)}`)}}else{let A=B$(O.label,Z-7);X.push(`${F}${Y.bold(A)}`)}}}let z=q.totalRows-G;if(z>0)X.push(Y.dim(` ... ${z} more below`));let J=q.getSelectedIndices().length,U=q.filter!==""?` matching: ${q.filteredMap.length}/${q.itemCount}`:"";if(X.push(""),q.searchActive)X.push(Y.dim(` ${J} of ${q.itemCount} selected${U} | Type to filter Esc Clear Enter Done searching`));else X.push(Y.dim(` ${J} of ${q.itemCount} selected${U} | `+"↑/↓ Navigate Space Toggle a All / Search Enter Confirm Esc Cancel"));return X}function B$(q,$){if($<=0)return"";if(q.length<=$)return q;if($<=3)return q.slice(0,$);return q.slice(0,$-3)+"..."}async function w0(q){let{items:$}=q,Z=q.pageSize??Math.min($.length+1,15),X=new a2($,Z),Q=process.stderr,G=process.stdin,z=Q.columns||80;if(typeof G.setRawMode==="function")G.setRawMode(!0);G.resume(),G.setEncoding("utf-8"),Q.write("\x1B[?25l");let J=0;function U(){let H=S5(X,$,z);if(J>0)Q.write(`\x1B[${J}F`);let _=Math.max(H.length,J),V="";for(let W=0;W<_;W++)V+=`\x1B[2K${W<H.length?H[W]:""}
|
|
142
|
+
`;Q.write(V),J=_}return U(),new Promise((H)=>{let _="",V=null;function W(){if(G.removeListener("data",B),typeof G.setRawMode==="function")G.setRawMode(!1);if(G.pause(),Q.write("\x1B[?25h"),V)clearTimeout(V)}function O(F){W(),H(F)}function T(F){if(X.searchActive){if(F==="\x1B"){X.searchActive=!1,X.filter="",X.applyFilter($),U();return}if(F==="\r"||F===`
|
|
143
|
+
`){X.searchActive=!1,U();return}if(F===""||F==="\b"){if(X.filter.length>0)X.filter=X.filter.slice(0,-1),X.applyFilter($);else X.searchActive=!1;U();return}if(F==="\x03"){W(),process.kill(process.pid,"SIGINT");return}if(F==="\x1B[A"){X.moveUp(),U();return}if(F==="\x1B[B"){X.moveDown(),U();return}if(F===" "){X.toggleCurrent(),U();return}if(F.length===1&&F>=" "&&F<="~"){X.filter+=F,X.applyFilter($),U();return}return}switch(F){case"\x1B[A":case"k":X.moveUp(),U();break;case"\x1B[B":case"j":X.moveDown(),U();break;case" ":X.toggleCurrent(),U();break;case"a":X.toggleAll(),U();break;case"/":X.searchActive=!0,U();break;case"\r":case`
|
|
144
|
+
`:O(X.getSelectedIndices());break;case"\x1B":if(X.filter!=="")X.filter="",X.applyFilter($),U();else O([]);break;case"":case"\b":if(X.filter.length>0)X.filter=X.filter.slice(0,-1),X.applyFilter($),U();break;case"\x03":W(),process.kill(process.pid,"SIGINT");break}}function B(F){if(_.length>0){if(_+=F,V)clearTimeout(V);if(_.length>=3&&_[1]==="["){let R=_.slice(0,3),M=_.slice(3);if(_="",T(R),M)B(M);return}let L=_;_="",T("\x1B");for(let R=1;R<L.length;R++)T(L[R]);return}for(let L=0;L<F.length;L++){let R=F[L];if(R==="\x1B"){let M=F.slice(L);if(M.length>=3&&M[1]==="[")T(M.slice(0,3)),L+=2;else if(M.length>=2){_=M,V=setTimeout(()=>{let A=_;_="",T("\x1B");for(let D=1;D<A.length;D++)T(A[D])},50);return}else{_="\x1B",V=setTimeout(()=>{_="",T("\x1B")},50);return}}else T(R)}}G.on("data",B)})}var m0=f5(b5),p5=/^[a-zA-Z0-9_-]+$/,d5=/^[a-zA-Z0-9._-]+$/,c5=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,t2=128,l5=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\/tree\/(.+))?\/?$/;function n5(q){return q.startsWith("/")||q.startsWith("./")||q.startsWith("../")||q.startsWith("~/")||q==="~"||q==="."||q===".."}function a5(q){let $;if(q==="~")$=s2();else if(q.startsWith("~/"))$=o2(s2(),q.slice(2));else $=o2(q);let Z=m5($);return b(`install: parsed local source -> path=${$}`),{owner:"local",repo:Z,ref:null,subpath:null,cloneUrl:"",sshCloneUrl:"",isLocal:!0,localPath:$}}function D0(q){if(n5(q))return a5(q);let $=l5.exec(q);if($){let[,V,W,O]=$,T=W.endsWith(".git")?W.slice(0,-4):W;q=`github:${V}/${T}${O?`#${O}`:""}`}if(!q.startsWith("github:"))throw Error(`Invalid source format. Got: "${q}"
|
|
145
145
|
Supported formats:
|
|
146
146
|
github:owner/repo[#ref]
|
|
147
147
|
github:owner/repo#ref:path
|
|
148
148
|
https://github.com/owner/repo
|
|
149
149
|
https://github.com/owner/repo/tree/branch/path/to/skill
|
|
150
150
|
/path/to/local/skill
|
|
151
|
-
./relative/path/to/skill`);let Z=q.slice(7),X=Z.indexOf("#"),Q,
|
|
152
|
-
`)){let
|
|
153
|
-
HTTPS: ${
|
|
154
|
-
SSH: ${
|
|
155
|
-
`);for(let z=0;z<
|
|
156
|
-
|
|
151
|
+
./relative/path/to/skill`);let Z=q.slice(7),X=Z.indexOf("#"),Q,G=null,z=null;if(X!==-1){Q=Z.slice(0,X);let V=Z.slice(X+1);if(!V)throw Error("Invalid source: ref cannot be empty after #");let W=V.indexOf(":");if(W!==-1){if(G=V.slice(0,W),!G)throw Error("Invalid source: ref cannot be empty before :");z=V.slice(W+1)||null}else G=V}else{let V=Z.indexOf(":");if(V!==-1)Q=Z.slice(0,V),z=Z.slice(V+1)||null;else Q=Z}let J=Q.indexOf("/");if(J===-1)throw Error(`Invalid source: format must be github:owner/repo. Got: "${q}"`);let U=Q.slice(0,J),H=Q.slice(J+1);if(!U)throw Error("Invalid source: owner cannot be empty");if(!H)throw Error("Invalid source: repo cannot be empty");if(!p5.test(U))throw Error(`Invalid source: owner contains invalid characters: "${U}". Allowed: [a-zA-Z0-9_-]`);if(!d5.test(H))throw Error(`Invalid source: repo contains invalid characters: "${H}". Allowed: [a-zA-Z0-9._-]`);let _={owner:U,repo:H,ref:G,subpath:z,cloneUrl:`https://github.com/${U}/${H}.git`,sshCloneUrl:`git@github.com:${U}/${H}.git`};return b(`install: parsed source -> owner=${U} repo=${H} ref=${G} subpath=${z}`),_}async function K$(q){if(q.subpath!==null||!q.ref||!q.ref.includes("/"))return q;try{let{stdout:$}=await m0("git",["ls-remote","--heads","--tags",q.cloneUrl],{timeout:15000}),Z=new Set;for(let Q of $.split(`
|
|
152
|
+
`)){let G=Q.match(/\trefs\/(?:heads|tags)\/(.+)$/);if(G)Z.add(G[1])}let X=q.ref.split("/");for(let Q=1;Q<X.length;Q++){let G=X.slice(0,Q).join("/");if(Z.has(G)){let z=X.slice(Q).join("/");return b(`install: resolved ref="${G}" subpath="${z}"`),{...q,ref:G,subpath:z||null}}}}catch($){b(`install: ls-remote failed, treating entire ref as branch: ${$}`)}return q}function _0(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>t2)throw Error(`Invalid skill name: exceeds maximum length of ${t2} characters`);if(!c5.test(q))throw Error(`Invalid skill name: "${q}" does not match allowed pattern [a-zA-Z0-9][a-zA-Z0-9._-]*`);return q}function i5(q){let $=q.split(/[/\\]/).filter(Boolean),Z=$.length>0?$[$.length-1]:q;return _0(Z)}function q1(q){let $=new Map;for(let Z of q){let X=i5(Z),Q=$.get(X);if(Q)Q.push(Z);else $.set(X,[Z])}return[...$.entries()].filter(([,Z])=>Z.length>1).map(([Z,X])=>({name:Z,paths:X}))}async function j0(){try{await m0("git",["--version"]),b("install: git available")}catch{throw Error("git is required for installing skills. Install git from https://git-scm.com")}}function o5(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 Fq(q){return q.killed?"Clone timed out after 60 seconds":`Clone failed: ${q.stderr||q.message}`}async function O$(q,$,Z){let X=["clone","--depth","1"];if($)X.push("--branch",$);return X.push(q,Z),await m0("git",X,{timeout:60000}),Z}async function N0(q,$="auto"){b(`install: cloning ${q.owner}/${q.repo}${q.ref?` (ref: ${q.ref})`:""} (transport: ${$})`);let Z=await i2(t(r2(),"asm-install-"));if($==="ssh"||$==="https"){let X=$==="ssh"?q.sshCloneUrl:q.cloneUrl;try{return await O$(X,q.ref,Z)}catch(Q){throw await a(Z),Error(Fq(Q))}}try{return await O$(q.cloneUrl,q.ref,Z)}catch(X){if(!o5(X))throw await a(Z),Error(Fq(X));b("install: HTTPS clone failed with auth error, retrying with SSH..."),await a(Z);let Q=await i2(t(r2(),"asm-install-"));try{return await O$(q.sshCloneUrl,q.ref,Q)}catch(G){throw await a(Q),Error(`Clone failed with both transports:
|
|
153
|
+
HTTPS: ${Fq(X)}
|
|
154
|
+
SSH: ${Fq(G)}`)}}}async function B0(q){let $=t(q,"SKILL.md"),Z;try{Z=await T$($,"utf-8")}catch{throw Error("Not a valid skill: SKILL.md not found in repository root")}let X=V0(Z),Q=q.split(/[/\\]/).pop()||"unknown",G=X.name||Q,z=W0(X);return b(`install: validated skill "${G}" v${z}`),{name:G,version:z,description:(X.description||"").replace(/\s*\n\s*/g," ").trim(),effort:X.effort||X["metadata.effort"]||void 0}}async function Kq(q,$=3){let Z=[];async function X(Q,G,z){let J;try{J=await y5(Q)}catch{return}for(let U of J){if(U===".git"||U==="node_modules")continue;let H=t(Q,U);try{if(!(await h5(H)).isDirectory())continue}catch{continue}let _=G?`${G}/${U}`:U,V=z+1,W=t(H,"SKILL.md");try{let O=await T$(W,"utf-8"),T=V0(O);Z.push({relPath:_,name:T.name||U,version:W0(T),description:(T.description||"").replace(/\s*\n\s*/g," ").trim(),effort:T.effort||T["metadata.effort"]||void 0,license:(T.license||"").trim(),creator:(T["metadata.creator"]||"").trim(),compatibility:(T.compatibility||"").trim(),allowedTools:e2(T)})}catch{if(V<$)await X(H,_,V)}}}return await X(q,"",0),Z.sort((Q,G)=>Q.name.localeCompare(G.name)),Z}var s5=[{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 $1(q){let $=[],Z=await Oq(q);for(let{relPath:X,content:Q}of Z){let G=Q.split(`
|
|
155
|
+
`);for(let z=0;z<G.length;z++)for(let{category:J,pattern:U}of s5)if(U.test(G[z])){let H=G[z].trim();$.push({category:J,file:X,line:z+1,match:H.length>100?H.slice(0,100)+"…":H})}}return $}async function Lq(q){let $=q.source.isLocal?`local:${q.source.localPath}`:`github:${q.source.owner}/${q.source.repo}${q.source.ref?`#${q.source.ref}`:""}${q.source.subpath?`:${q.source.subpath}`:""}`;if(q.force)try{await F$(q.targetDir),await Tq(q.targetDir,{recursive:!0,force:!0})}catch{}let Z=q.sourceDir;try{await x5(Z,q.targetDir,{recursive:!0})}catch(J){throw Error(`Failed to install: ${J.message}`)}let X=t(q.targetDir,".git");try{await Tq(X,{recursive:!0,force:!0})}catch{}b(`install: copied files to ${q.targetDir}`);let Q=t(q.targetDir,"SKILL.md");try{await F$(Q)}catch{throw Error("Installation verification failed: SKILL.md not found at target")}let G=await T$(Q,"utf-8"),z=V0(G);return{success:!0,path:q.targetDir,name:z.name||q.skillName,version:W0(z),provider:q.providerLabel,source:$}}async function Z1(q,$){let Z=await Lq(q);for(let X of $){if(X.name===q.providerName)continue;let Q=q.scope==="project"?X.project:X.global,G=u0(Q),z=t(G,q.skillName);await v5(G,{recursive:!0});try{if((await g5(z)).isSymbolicLink())await Tq(z);else{b(`install: skipping ${z} — existing non-symlink directory`);continue}}catch{}let J=u5(G,q.targetDir);await k5(J,z,"dir"),b(`install: symlinked ${z} -> ${J}`)}return Z.provider=`All (${$.map((X)=>X.label).join(", ")})`,Z}async function a(q){try{await Tq(q,{recursive:!0,force:!0})}catch{}}async function X1(){try{await m0("npx",["--version"]),b("install: npx available")}catch{throw Error("npx is required for Vercel method installation. Install Node.js from https://nodejs.org")}}async function Q1(q,$){let Z=["--yes","skills","add",q];if($)Z.push("--skill",$);b(`install: running npx ${Z.join(" ")}`);try{let X=await m0("npx",Z,{timeout:120000});return{stdout:X.stdout,stderr:X.stderr}}catch(X){let Q=X.stderr||X.message||"";throw Error(`npx skills add failed: ${Q}`)}}function G1(q){if(q.isLocal)return q.localPath;let $=`https://github.com/${q.owner}/${q.repo}`;if(q.ref)return`${$}/tree/${q.ref}${q.subpath?`/${q.subpath}`:""}`;return $}async function p0(q,$,Z){let X=q.providers.filter((O)=>O.enabled);if($==="all"){if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");return{provider:X.find((T)=>T.name==="agents")||X[0],allProviders:X}}if($){let O=q.providers.find((T)=>T.name===$);if(!O){let T=q.providers.map((B)=>B.name).join(", ");throw Error(`Unknown provider: "${$}". Valid providers: ${T}, all`)}if(!O.enabled)throw Error(`Provider "${$}" is disabled. Enable it in your config or choose another provider.`);return{provider:O,allProviders:null}}if(X.length===1)return{provider:X[0],allProviders:null};if(!Z){if(X.length===0)throw Error("No providers are enabled. Enable a provider in your config.");let O=X.map((T)=>T.name).join(", ");throw Error(`--tool (or --provider) is required in non-interactive mode. Available: ${O}, all`)}let Q=q.preferences.selectedTools,z=Q&&Q.length>0?new Set(Q):null,J=q.providers.map((O)=>({label:`${O.label} (${O.name})`,hint:O.global,checked:z?z.has(O.name):O.name==="agents"})),U=await w0({items:J});if(U.length===0)throw Error("No tools selected. Aborting.");let H=U.map((O)=>q.providers[O]),_=H.map((O)=>O.name),{saveSelectedTools:V}=await import("./chunk-v3wdjh4r.js");if(await V(_),H.length===1)return{provider:H[0],allProviders:null};return{provider:H.find((O)=>O.name==="agents")||H[0],allProviders:H}}function L$(q,$,Z,X,Q,G,z="global"){let J=z==="project"?Q.project:Q.global,U=u0(J),H=t(U,X);return{source:q,tempDir:$,sourceDir:Z,targetDir:H,skillName:X,force:G,providerName:Q.name,providerLabel:Q.label,scope:z}}async function z1(q,$){try{if(await F$(q),b(`install: target ${q} — conflict (exists)${$?", force overwrite":""}`),!$)throw Error(`Skill already exists at: ${q}
|
|
156
|
+
Use --force to overwrite.`)}catch(Z){if(Z.message?.includes("--force"))throw Z;b(`install: target ${q} — no conflict`)}}import{readFile as nz}from"fs/promises";import{join as az}from"path";var Uz=K2(),Yz=zq(),Hz=Z2(),E2=Jq(),Vz=l0(),H0=y(),Wz=G0(),_z=h(),Bz=J0(),Oz=U0(),IH=X$(),Fz=N2(),Tz=P2(),Kz=C2(),z$=_4(),B4=d0();var Lz=Uz.Composer,Mz=Yz.Document,Rz=Hz.Schema,Az=E2.YAMLError,Iz=E2.YAMLParseError,wz=E2.YAMLWarning,Dz=Vz.Alias,jz=H0.isAlias,Nz=H0.isCollection,Pz=H0.isDocument,Cz=H0.isMap,Ez=H0.isNode,Sz=H0.isPair,bz=H0.isScalar,fz=H0.isSeq,yz=Wz.Pair,xz=_z.Scalar,hz=Bz.YAMLMap,gz=Oz.YAMLSeq;var kz=Fz.Lexer,vz=Tz.LineCounter,uz=Kz.Parser,S2=z$.parse,mz=z$.parseAllDocuments,pz=z$.parseDocument,dz=z$.stringify,cz=B4.visit,lz=B4.visitAsync;var O4=500;function iz(q){let $=q.split(`
|
|
157
|
+
`),Z=!1,X=!1;for(let Q of $){if(Q.trim()==="---")if(!Z){Z=!0;continue}else{X=!0;continue}if(X&&Q.trim().length>0)return!0}return!1}function oz(q){let $=q.split(`
|
|
157
158
|
`),Z=-1;for(let X=0;X<$.length;X++)if($[X].trim()==="---")if(Z===-1)Z=X+1;else return $.slice(Z,X).join(`
|
|
158
|
-
`);return null}function
|
|
159
|
+
`);return null}function sz(q){let $=oz(q);if($===null)return null;try{return S2($),null}catch(Z){return Z.message||"invalid YAML"}}async function F4(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=az(q.path,"SKILL.md"),Q=await nz(X,"utf-8");if(!iz(Q))$.push({category:"empty-body",message:"SKILL.md contains only frontmatter with no body content"});let G=sz(Q);if(G)$.push({category:"invalid-yaml",message:`SKILL.md has invalid YAML frontmatter: ${G}`})}catch{}let Z=q.fileCount;if(Z!==void 0&&Z>O4)$.push({category:"high-file-count",message:`Skill has ${Z} files (threshold: ${O4})`});return $}function T4(q){let $=q.map((Z)=>({name:Z.name,version:Z.version,dirName:Z.dirName,provider:Z.provider,scope:Z.scope,path:Z.path,isSymlink:Z.isSymlink,symlinkTarget:Z.symlinkTarget,effort:Z.effort}));return{version:1,exportedAt:new Date().toISOString(),skills:$}}import{readFile as rz,access as L4,mkdir as tz,cp as K4,rm as ez,symlink as qJ}from"fs/promises";import{join as M4,basename as $J}from"path";function ZJ(q){let $=[];if(typeof q!=="object"||q===null||Array.isArray(q))return{valid:!1,errors:["Manifest must be a JSON object."]};let Z=q;if(Z.version!==1)$.push(`Unsupported manifest version: ${JSON.stringify(Z.version)}. Expected 1.`);if(typeof Z.exportedAt!=="string")$.push("Missing or invalid 'exportedAt' field.");if(!Array.isArray(Z.skills))return $.push("Missing or invalid 'skills' array."),{valid:!1,errors:$};for(let X=0;X<Z.skills.length;X++){let Q=Z.skills[X];if(typeof Q!=="object"||Q===null){$.push(`skills[${X}]: must be an object.`);continue}let G=Q;if(typeof G.name!=="string"||!G.name)$.push(`skills[${X}]: missing or empty 'name'.`);if(typeof G.dirName!=="string"||!G.dirName)$.push(`skills[${X}]: missing or empty 'dirName'.`);if(typeof G.provider!=="string"||!G.provider)$.push(`skills[${X}]: missing or empty 'provider'.`);if(G.scope!=="global"&&G.scope!=="project")$.push(`skills[${X}]: invalid 'scope' "${String(G.scope)}". Must be "global" or "project".`)}return{valid:$.length===0,errors:$}}async function R4(q){let $;try{$=await rz(q,"utf-8")}catch(Q){if(Q?.code==="ENOENT")throw Error(`Manifest file not found: ${q}`);throw Error(`Failed to read manifest file: ${Q.message}`)}let Z;try{Z=JSON.parse($)}catch{throw Error("Manifest file is not valid JSON.")}let X=ZJ(Z);if(!X.valid)throw Error(`Invalid manifest:
|
|
159
160
|
${X.errors.join(`
|
|
160
|
-
`)}`);return Z}async function
|
|
161
|
+
`)}`);return Z}async function XJ(q){try{return await L4(q),!0}catch{return!1}}function QJ(q,$){return q.providers.find((Z)=>Z.name===$&&Z.enabled)}function GJ(q,$,Z,X){let Q=QJ(q,$);if(!Q)return null;let G=Z==="global"?Q.global:Q.project,z=u0(G),J=$J(X);if(!J||J==="."||J==="..")return null;return M4(z,J)}function zJ(q,$){let Z=q.find((X)=>X.dirName===$.dirName&&X.provider===$.provider);if(Z)return Z;return q.find((X)=>X.dirName===$.dirName)||null}async function A4(q,$,Z){let X=Z?.config??await v(),Q=Z?.installedSkills??await d(X,"both"),G=[];for(let H of q.skills){if($.scopeFilter!=="both"&&H.scope!==$.scopeFilter){b(`import: skipping "${H.name}" — scope "${H.scope}" filtered out`);continue}let _=GJ(X,H.provider,H.scope,H.dirName);if(!_){G.push({skillName:H.name,provider:H.provider,scope:H.scope,status:"failed",reason:`Provider "${H.provider}" not found or not enabled.`});continue}let V=await XJ(_);if(V&&!$.force){G.push({skillName:H.name,provider:H.provider,scope:H.scope,status:"skipped",reason:"Already installed.",path:_});continue}if($.dryRun){G.push({skillName:H.name,provider:H.provider,scope:H.scope,status:"dry-run",reason:V?"Would overwrite (--force).":"Would install.",path:_});continue}let W=zJ(Q,H);if(!W){G.push({skillName:H.name,provider:H.provider,scope:H.scope,status:"failed",reason:"No installed source found. Install the skill first with: asm install <source>"});continue}try{if(await tz(M4(_,".."),{recursive:!0}),V)await ez(_,{recursive:!0,force:!0});if(H.isSymlink&&H.symlinkTarget)try{await L4(H.symlinkTarget),await qJ(H.symlinkTarget,_),b(`import: symlinked "${H.name}" -> ${H.symlinkTarget} at ${_}`)}catch{await K4(W.realPath,_,{recursive:!0}),b(`import: symlink target unreachable, copied "${H.name}" from ${W.realPath} to ${_}`)}else await K4(W.realPath,_,{recursive:!0}),b(`import: copied "${H.name}" from ${W.realPath} to ${_}`);G.push({skillName:H.name,provider:H.provider,scope:H.scope,status:"installed",path:_})}catch(O){G.push({skillName:H.name,provider:H.provider,scope:H.scope,status:"failed",reason:`Copy failed: ${O.message}`})}}let z=G.filter((H)=>H.status==="installed").length,J=G.filter((H)=>H.status==="skipped").length,U=G.filter((H)=>H.status==="failed").length;return{total:G.length,installed:z,skipped:J,failed:U,results:G}}import{mkdir as JJ,writeFile as UJ,access as YJ}from"fs/promises";import{join as HJ}from"path";function VJ(q){return`---
|
|
161
162
|
name: ${q}
|
|
162
163
|
description: ""
|
|
163
164
|
license: ""
|
|
@@ -178,21 +179,23 @@ as instructions for when and how to use this skill.
|
|
|
178
179
|
## Instructions
|
|
179
180
|
|
|
180
181
|
- Step-by-step instructions for the agent
|
|
181
|
-
`}async function
|
|
182
|
-
`)}import{access as
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
`}async function I4(q,$){await JJ($,{recursive:!0});let Z=HJ($,"SKILL.md"),X=VJ(q);await UJ(Z,X,"utf-8")}async function w4(q){try{return await YJ(q),!0}catch{return!1}}import{readdir as WJ,stat as _J}from"fs/promises";import{join as BJ}from"path";async function OJ(q){let $=0;try{let X=(await WJ(q,{recursive:!0})).map(async(G)=>{try{let z=await _J(BJ(q,G));if(z.isFile())return z.size}catch{}return 0});$=(await Promise.all(X)).reduce((G,z)=>G+z,0)}catch{}return $}async function N4(q,$){let Z={},X={global:0,project:0},Q={},G=q.map(async(U)=>{Z[U.provider]=(Z[U.provider]||0)+1,X[U.scope]++;let H=await OJ(U.path);return Q[U.path]=H,H}),J=(await Promise.all(G)).reduce((U,H)=>U+H,0);return{totalSkills:q.length,byProvider:Z,byScope:X,totalDiskBytes:J,perSkillDiskBytes:Q,duplicateGroups:$.duplicateGroups.length,duplicateInstances:$.totalDuplicateInstances}}function FJ(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 b2(q,$,Z=20){let X=Math.round(q/$*Z),Q=Z-X;return Y.green("#".repeat(X))+Y.dim("-".repeat(Q))}var D4={claude:"Claude Code",codex:"Codex",openclaw:"OpenClaw",agents:"Agents"};function P4(q){let $=[];$.push(""),$.push(Y.blueBold(" Skill Statistics")),$.push(Y.dim(" "+"-".repeat(20))),$.push(""),$.push(` ${Y.bold("Total:")} ${Y.cyan(String(q.totalSkills))} skills`),$.push(` ${Y.bold("Disk:")} ${Y.cyan(FJ(q.totalDiskBytes))}`),$.push(""),$.push(Y.bold(" By Tool"));let Z=Object.entries(q.byProvider).sort((U,H)=>H[1]-U[1]),X=Math.max(...Z.map(([,U])=>U)),Q=Math.max(...Z.map(([U])=>(D4[U]||U).length));for(let[U,H]of Z){let _=D4[U]||U,V=j4(U,_.padEnd(Q)),W=String(H).padStart(4);$.push(` ${V} ${W} ${b2(H,X)}`)}$.push(""),$.push(Y.bold(" By Scope"));let G=Math.max(q.byScope.global,q.byScope.project),z=String(q.byScope.global).padStart(4),J=String(q.byScope.project).padStart(4);if($.push(` ${"global ".padEnd(Q)} ${z} ${b2(q.byScope.global,G)}`),$.push(` ${"project".padEnd(Q)} ${J} ${b2(q.byScope.project,G)}`),$.push(""),$.push(Y.bold(" Duplicates")),q.duplicateGroups>0)$.push(` ${Y.yellow(`${q.duplicateGroups} group(s), ${q.duplicateInstances} total instance(s)`)}`),$.push(Y.dim(` Run ${Y.bold("asm audit")} to review`));else $.push(` ${Y.green("None")}`);return $.push(""),$.join(`
|
|
183
|
+
`)}import{access as TJ,lstat as f2,readdir as KJ,readFile as C4,rm as LJ,symlink as MJ}from"fs/promises";import{join as J$}from"path";async function E4(q){let $;try{$=await f2(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=J$(q,"SKILL.md"),X;try{X=await C4(Z,"utf-8")}catch{throw Error(`No SKILL.md found in ${q}`)}let Q=V0(X);if(!Q.name)throw Error(`Invalid SKILL.md in ${q}: missing "name" in frontmatter`);return{name:Q.name,version:W0(Q)}}async function S4(q,$,Z,X){let Q=J$($,Z),G=!1;try{await TJ(Q),G=!0}catch{}if(G){if(!X)throw Error(`Target already exists: ${Q}. Use --force to overwrite.`);await LJ(Q,{recursive:!0,force:!0})}await MJ(q,Q,"dir")}async function b4(q){let $;try{$=await f2(q)}catch{throw Error(`Path does not exist: ${q}`)}if(!$.isDirectory())throw Error(`Path is not a directory: ${q}`);let Z=await KJ(q),X=[];for(let Q of Z){if(Q.startsWith(".")||Q==="node_modules")continue;let G=J$(q,Q);try{if(!(await f2(G)).isDirectory())continue}catch{continue}let z=J$(G,"SKILL.md");try{let J=await C4(z,"utf-8"),U=V0(J);if(U.name)X.push({absPath:G,dirName:Q,name:U.name,version:W0(U)})}catch{}}return X.sort((Q,G)=>Q.name.localeCompare(G.name)),X}import{readFile as RJ,writeFile as AJ,readdir as IJ,access as wJ,mkdir as DJ,rm as jJ}from"fs/promises";import{join as _q,resolve as NJ}from"path";import{homedir as PJ}from"os";var A0=_q(PJ(),".config","agent-skill-manager","bundles");function CJ(q){let $=[];if(typeof q!=="object"||q===null||Array.isArray(q))return{valid:!1,errors:["Bundle must be a JSON object."]};let Z=q;if(Z.version!==1)$.push(`Unsupported bundle version: ${JSON.stringify(Z.version)}. Expected 1.`);if(typeof Z.name!=="string"||!Z.name)$.push("Missing or empty 'name' field.");if(typeof Z.description!=="string"||!Z.description)$.push("Missing or empty 'description' field.");if(typeof Z.author!=="string"||!Z.author)$.push("Missing or empty 'author' field.");if(typeof Z.createdAt!=="string")$.push("Missing or invalid 'createdAt' field.");if(!Array.isArray(Z.skills))return $.push("Missing or invalid 'skills' array."),{valid:!1,errors:$};if(Z.skills.length===0)$.push("Bundle must contain at least one skill.");for(let X=0;X<Z.skills.length;X++){let Q=Z.skills[X];if(typeof Q!=="object"||Q===null){$.push(`skills[${X}]: must be an object.`);continue}let G=Q;if(typeof G.name!=="string"||!G.name)$.push(`skills[${X}]: missing or empty 'name'.`);if(typeof G.installUrl!=="string"||!G.installUrl)$.push(`skills[${X}]: missing or empty 'installUrl'.`)}if(Z.tags!==void 0){if(!Array.isArray(Z.tags))$.push("'tags' must be an array of strings if provided.");else if(Z.tags.some((X)=>typeof X!=="string"))$.push("'tags' must contain only strings.")}return{valid:$.length===0,errors:$}}function y4(q,$,Z,X,Q){return{version:1,name:q,description:$,author:Z,createdAt:new Date().toISOString(),skills:X,tags:Q}}async function x4(q,$){let Z=$??await f4(),X=Z.skills[q.name]||Z.skills[q.dirName],Q;if(q.isSymlink&&q.symlinkTarget)Q=q.symlinkTarget;else if(X?.source)Q=X.source;else Q=q.path;return{name:q.name,installUrl:Q,description:q.description||void 0,version:q.version||void 0}}async function EJ(){await DJ(A0,{recursive:!0})}function x2(q){let $=q.toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if($=$.replace(/^\.+|\.+$/g,""),!$||$==="."||$==="..")throw Error("Invalid bundle name: results in an empty filename after sanitization.");return $}async function h4(q){await EJ();let $=`${x2(q.name)}.json`,Z=_q(A0,$);return await AJ(Z,JSON.stringify(q,null,2)+`
|
|
184
|
+
`,"utf-8"),b(`bundle: saved to ${Z}`),Z}async function y2(q){let $;try{$=await RJ(q,"utf-8")}catch(Q){if(Q?.code==="ENOENT")throw Error(`Bundle file not found: ${q}`);throw Error(`Failed to read bundle file: ${Q.message}`)}let Z;try{Z=JSON.parse($)}catch{throw Error("Bundle file is not valid JSON.")}let X=CJ(Z);if(!X.valid)throw Error(`Invalid bundle:
|
|
185
|
+
${X.errors.join(`
|
|
186
|
+
`)}`);return Z}async function h2(q){if(q.includes("/")||q.includes("\\")||q.endsWith(".json")){let X=NJ(q);return y2(X)}let $=`${x2(q)}.json`,Z=_q(A0,$);return y2(Z)}async function g4(){let q=[];try{await wJ(A0)}catch{return q}let $;try{$=await IJ(A0)}catch{return q}for(let Z of $){if(!Z.endsWith(".json"))continue;let X=_q(A0,Z);try{let Q=await y2(X);q.push(Q)}catch{b(`bundle: skipping invalid file ${X}`)}}return q.sort((Z,X)=>Z.name.localeCompare(X.name)),q}async function k4(q){let $=`${x2(q)}.json`,Z=_q(A0,$);try{return await jJ(Z),b(`bundle: removed ${Z}`),!0}catch(X){if(X?.code==="ENOENT")return!1;throw X}}var m4=[{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bcurl\b/,severity:"critical",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bwget\b/,severity:"critical",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bfetch\s*\(/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\baxios\b/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bhttp\.request\b/,severity:"warning",permissionType:"network"},{category:"Network requests",description:"Commands or APIs that download or upload data over the network",pattern:/\bXMLHttpRequest\b/,severity:"warning",permissionType:"network"},{category:"External URLs",description:"Hardcoded URLs that may indicate data exfiltration or remote payload loading",pattern:/https?:\/\/(?!github\.com|localhost|127\.0\.0\.1|example\.com)/,severity:"warning",permissionType:"network"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bexec\s*\(/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bexecSync\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bchild_process\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bspawn\s*\(/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bBun\.spawn\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\bshelljs\b/,severity:"critical",permissionType:"shell"},{category:"Shell execution",description:"Commands that execute shell processes or arbitrary system commands",pattern:/\b(?:bash|sh|zsh)\s+-c\b/,severity:"critical",permissionType:"shell"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\beval\s*\(/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bnew\s+Function\b/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bFunction\s*\(/,severity:"critical",permissionType:"code-execution"},{category:"Dynamic code execution",description:"Patterns that execute dynamically constructed code at runtime",pattern:/\bimport\s*\(\s*[^'"]/,severity:"warning",permissionType:"code-execution"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bfs\.(?:write|append|unlink|rm|mkdir|rename)\b/,severity:"warning",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bwriteFile(?:Sync)?\b/,severity:"warning",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\brm\s+-rf?\b/,severity:"critical",permissionType:"filesystem"},{category:"File system access",description:"Operations that read, write, or modify files on disk",pattern:/\bchmod\b/,severity:"warning",permissionType:"filesystem"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/\b(?:API_KEY|SECRET_KEY|ACCESS_TOKEN|PRIVATE_KEY)\s*[=:]/,severity:"critical"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/\bPASSWORD\s*[=:]/,severity:"critical"},{category:"Embedded credentials",description:"Hardcoded secrets, API keys, tokens, or passwords",pattern:/(?:sk|pk)[-_](?:live|test)[-_][a-zA-Z0-9]{20,}/,severity:"critical"},{category:"Environment variable access",description:"Reading environment variables which may contain secrets or configuration",pattern:/\bprocess\.env\b/,severity:"info",permissionType:"environment"},{category:"Environment variable access",description:"Reading environment variables which may contain secrets or configuration",pattern:/\bBun\.env\b/,severity:"info",permissionType:"environment"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\batob\s*\(/,severity:"warning"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\bBuffer\.from\s*\([^,]+,\s*['"]base64['"]\)/,severity:"warning"},{category:"Obfuscation patterns",description:"Base64 encoding, hex strings, or other obfuscation techniques",pattern:/\\x[0-9a-fA-F]{2}(?:\\x[0-9a-fA-F]{2}){5,}/,severity:"warning"}];async function SJ(q,$){let Z={owner:q,repo:$,profileUrl:`https://github.com/${q}`,reposUrl:`https://github.com/${q}?tab=repositories`,isOrganization:null,publicRepos:null,accountAge:null,fetchError:null};try{let X=await fetch(`https://api.github.com/users/${q}`,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"agent-skill-manager"},signal:AbortSignal.timeout(1e4)});if(!X.ok)return Z.fetchError=`GitHub API returned ${X.status}`,Z;let Q=await X.json();if(Z.isOrganization=Q.type==="Organization",Z.publicRepos=typeof Q.public_repos==="number"?Q.public_repos:null,typeof Q.created_at==="string"){let G=new Date(Q.created_at),z=new Date,J=Math.floor((z.getTime()-G.getTime())/31557600000),U=Math.floor((z.getTime()-G.getTime())%31557600000/2630016000.0000005);Z.accountAge=J>0?`${J}y ${U}m`:`${U}m`}b(`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",b(`security-audit: source analysis failed -> ${Z.fetchError}`)}return Z}function bJ(q){let $=new Map;for(let{relPath:Q,content:G}of q){let z=G.split(`
|
|
187
|
+
`);for(let J=0;J<z.length;J++){let U=z[J],H=U.trim();for(let _ of m4)if(_.pattern.test(U)){let V=_.category;if(!$.has(V))$.set(V,{description:_.description,matches:[]});let W=H.length>120?H.slice(0,120)+"...":H;$.get(V).matches.push({file:Q,line:J+1,match:W,severity:_.severity})}}}let Z=[];for(let[Q,G]of $)Z.push({category:Q,description:G.description,matches:G.matches});let X={critical:0,warning:1,info:2};return Z.sort((Q,G)=>{let z=Math.min(...Q.matches.map((U)=>X[U.severity])),J=Math.min(...G.matches.map((U)=>X[U.severity]));return z-J}),Z}function fJ(q){let $=new Map;for(let G of q)for(let z of G.matches)for(let J of m4)if(J.permissionType&&J.category===G.category&&J.pattern.test(z.match)){let U=J.permissionType;if(!$.has(U))$.set(U,{evidence:[],categories:new Set});let H=$.get(U);H.evidence.push({file:z.file,line:z.line,match:z.match}),H.categories.add(G.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[G,z]of $)X.push({type:G,evidence:z.evidence,reason:Z[G]});let Q={shell:0,"code-execution":1,network:2,filesystem:3,environment:4};return X.sort((G,z)=>(Q[G.type]??99)-(Q[z.type]??99)),X}function yJ(q,$,Z){let X=0,Q=0;for(let U of q)for(let H of U.matches){if(H.severity==="critical")X++;if(H.severity==="warning")Q++}let G=$.some((U)=>U.type==="shell"),z=$.some((U)=>U.type==="code-execution"),J=$.some((U)=>U.type==="network");if(G&&J)return{verdict:"dangerous",reason:"Skill has both shell execution and network access -- potential data exfiltration risk."};if(z&&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(G||z)return{verdict:"warning",reason:G?"Skill executes shell commands. Review commands carefully before installing.":"Skill uses dynamic code execution. Review usage carefully."};if(X>0)return{verdict:"warning",reason:`${X} critical finding${X>1?"s":""} detected. Manual review recommended.`};if(Q>0)return{verdict:"caution",reason:`${Q} warning${Q>1?"s":""} found. Generally acceptable but worth reviewing.`};if(Z&&Z.publicRepos!==null&&Z.publicRepos<3)return{verdict:"caution",reason:"No code issues found, but the author has very few public repositories."};return{verdict:"safe",reason:"No suspicious patterns detected."}}async function Y$(q,$,Z,X){b(`security-audit: scanning ${q}`);let Q=await Oq(q),G=Q.reduce((V,W)=>V+W.lineCount,0),z=null;if(Z&&X)z=await SJ(Z,X);let J=bJ(Q),U=fJ(J),{verdict:H,reason:_}=yJ(J,U,z);return{scannedAt:new Date().toISOString(),skillName:$,skillPath:q,source:z,codeScans:J,permissions:U,totalFiles:Q.length,totalLines:G,verdict:H,verdictReason:_}}var P=Y,I0=56,xJ={"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"},v4={critical:0,warning:1,info:2};function hJ(q){switch(q){case"safe":return P.bgGreen(" SAFE ");case"caution":return P.bgCyan(" CAUTION ");case"warning":return P.bgYellow(" WARNING ");case"dangerous":return P.bgRed(" DANGEROUS ")}}function gJ(q){switch(q){case"safe":return P.green;case"caution":return P.cyan;case"warning":return P.yellow;case"dangerous":return P.red}}function v0(q){switch(q){case"critical":return P.red("!!");case"warning":return P.yellow(" !");case"info":return P.dim(" i")}}function g2(q,$){return q.length>$?q.slice(0,$-3)+"...":q}function U$(q){return q.toLocaleString("en-US")}function p4(q){return q.replace(/\x1b\[[0-9;]*m/g,"")}function u4(q){return p4(q).length}function kJ(q){let $=new Map;for(let Z of q){let X=`${Z.file}:${Z.line}`,Q=$.get(X);if(!Q||v4[Z.severity]<v4[Q.severity])$.set(X,Z)}return Array.from($.values())}function vJ(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 H$(q){let $=[],Z=hJ(q.verdict),X=p4(Z),Q=` ${P.bold(q.skillName)}`,G=` ${q.skillName}`,z=I0-4,J=Math.max(1,z-G.length-X.length);if($.push(""),$.push(P.dim(" +-- ")+P.bold("Security Audit")+P.dim(" "+"-".repeat(I0-19)+"+")),$.push(P.dim(" |")+Q+" ".repeat(J)+Z+P.dim("|")),$.push(P.dim(" |")+P.dim(` ${U$(q.totalFiles)} files | ${U$(q.totalLines)} lines`)+" ".repeat(Math.max(1,z-` ${U$(q.totalFiles)} files | ${U$(q.totalLines)} lines`.length))+P.dim("|")),$.push(P.dim(" +"+"-".repeat(I0-2)+"+")),q.source){let V=q.source;if(V.fetchError)$.push(` ${P.yellow("!")} Could not fetch profile: ${V.fetchError}`);else{let W=[];if(W.push(`${V.owner} ${V.isOrganization?P.cyan("(org)"):P.dim("(user)")}`),V.publicRepos!==null){let O=V.publicRepos,T=O<3?P.yellow(`${O} repos`):O<10?P.cyan(`${O} repos`):P.green(`${O} repos`);W.push(T)}if(V.accountAge)W.push(V.accountAge);$.push(` ${P.dim("Author:")} ${W.join(P.dim(" | "))}`)}}if($.push(""),q.codeScans.length===0)$.push(` ${P.green("*")} ${P.green("No suspicious patterns detected.")}`);else{let V=gJ(q.verdict),W=q.verdict==="dangerous"||q.verdict==="warning"?v0("critical"):q.verdict==="caution"?v0("warning"):v0("info");$.push(` ${W} ${V(q.verdictReason)}`);let O=0,T=0,B=0;for(let M of q.codeScans)for(let A of M.matches)if(A.severity==="critical")O++;else if(A.severity==="warning")T++;else B++;let F=[];if(O>0)F.push(P.red(`${O} critical`));if(T>0)F.push(P.yellow(`${T} warning`));if(B>0)F.push(P.dim(`${B} info`));let L=q.permissions.map((M)=>M.type),R=L.length>0?P.dim(`Perms: ${L.join(", ")}`):"";$.push(` ${F.join(P.dim(" | "))} ${R}`)}if($.push(""),q.codeScans.length>0){$.push(` ${P.bold("Findings")}`),$.push(P.dim(" "+"=".repeat(I0-2)));for(let V of q.codeScans){let W=kJ(V.matches),O=W.filter((N)=>N.severity==="critical").length,T=W.filter((N)=>N.severity==="warning").length,B=W.filter((N)=>N.severity==="info").length,F=O>0?v0("critical"):T>0?v0("warning"):v0("info"),L=[];if(O>0)L.push(P.red(`${O} critical`));if(T>0)L.push(P.yellow(`${T} warning`));if(B>0)L.push(P.dim(`${B} info`));let R=xJ[V.category],M=R?P.dim(`PERM: ${R}`):"",A=` ${F} ${P.bold(V.category)} (${L.join(", ")})`;if(M){let N=u4(A),S=u4(M),f=Math.max(2,I0-N-S);$.push(A+" ".repeat(f)+M)}else $.push(A);let D=vJ(W),j=Math.min(24,Math.max(...D.map((N)=>N.file.length))),w=0,K=3;for(let N of D){if(w>=K)break;let S=g2(N.file,24),f=P.dim(S.padEnd(j));if(N.entries.length===1){let g=N.entries[0],$0=g2(g.match,50);$.push(` ${f} :${g.line} ${P.dim("--")} ${g.severity==="critical"?$0:P.dim($0)}`),w++}else if(N.entries.length<=3){let g=N.entries.map((_$)=>`:${_$.line}`).join(", "),$0=g2(N.entries[0].match,40);$.push(` ${f} ${g} ${P.dim("--")} ${P.dim($0)}`),w++}else{let $0=N.entries.slice(0,3).map((w5)=>`:${w5.line}`).join(", "),_$=N.entries.length-3;$.push(` ${f} ${$0} ${P.dim(`(+${_$} more)`)}`),w++}}let E=D.length-Math.min(D.length,K);if(E>0){let N=W.length-D.slice(0,K).reduce((S,f)=>S+f.entries.length,0);if(N>0)$.push(` ${P.dim(`... ${N} more in ${E} file${E>1?"s":""}`)}`)}$.push("")}}$.push(P.dim(" "+"=".repeat(I0-2)));let U=new Date(q.scannedAt),H=`${U.getFullYear()}-${String(U.getMonth()+1).padStart(2,"0")}-${String(U.getDate()).padStart(2,"0")} ${String(U.getHours()).padStart(2,"0")}:${String(U.getMinutes()).padStart(2,"0")}`,_=q.source&&!q.source.fetchError?`github.com/${q.source.owner}`:"";if(_){let V=Math.max(2,I0-2-H.length-_.length);$.push(P.dim(` ${H}${" ".repeat(V)}${_}`))}else $.push(P.dim(` ${H}`));return $.push(""),$.join(`
|
|
188
|
+
`)}function k2(q){return JSON.stringify(q,null,2)}import{writeFile as tJ,mkdir as eJ,unlink as qU,readFile as $U}from"fs/promises";import{join as u2}from"path";import{readdir as uJ,readFile as mJ}from"fs/promises";import{join as pJ}from"path";function v2(q){let $=new Set,Z=q.toLowerCase().split(/[\s\-_.,;:()[\]{}"']+/);for(let X of Z)if(X.length>=2)$.add(X);return $}var dJ=10,cJ=5,lJ=3,nJ=1;function aJ(q,$){let Z=v2(q),X=v2($.name),Q=v2($.description),G=0;for(let z of Z){if(X.has(z))G+=dJ;if(Q.has(z))G+=lJ;if($.name.toLowerCase().includes(z))G+=cJ;if($.description.toLowerCase().includes(z))G+=nJ}return G}async function d4(q){let $=new Map,Z;try{Z=await uJ(q)}catch{return $}for(let X of Z){if(!X.endsWith(".json"))continue;let Q=pJ(q,X);try{let G=await mJ(Q,"utf-8"),z=JSON.parse(G);for(let J of z.skills){if(!("license"in J))J.license="";if(!("creator"in J))J.creator="";if(!("compatibility"in J))J.compatibility="";if(!("allowedTools"in J))J.allowedTools=[];if(!("verified"in J))J.verified=!1}$.set(`${z.owner}/${z.repo}`,z)}catch{}}return $}async function V$(){let q=await d4(n4()),$=await d4(Bq()),Z=new Map(q);for(let[X,Q]of $)Z.set(X,Q);return Array.from(Z.values())}var iJ=["license","creator","version"];function c4(q){return iJ.includes(q)}function l4(q,$){return q[$]||""}function oJ(q,$){if($.has)for(let Z of $.has){if(!c4(Z))continue;if(!l4(q,Z))return!1}if($.missing)for(let Z of $.missing){if(!c4(Z))continue;if(l4(q,Z))return!1}return!0}function a4(q){let $=[];if(!q.license)$.push("license");if(!q.creator)$.push("creator");if(!q.version||q.version==="0.0.0")$.push("version");return $}async function W$(q,$=20,Z){let X=await V$(),Q=[],G=!q&&Z;for(let z of X)for(let J of z.skills){if(Z&&!oJ(J,Z))continue;let U=G?1:aJ(q,J);if(U>0)Q.push({skill:J,repo:{owner:z.owner,repo:z.repo},score:U})}return Q.sort((z,J)=>J.score-z.score),Q.slice(0,$)}async function i4(){return(await V$()).reduce(($,Z)=>$+Z.skillCount,0)}var sJ=[{label:"obfuscation:atob",pattern:/\batob\s*\(/},{label:"obfuscation:base64",pattern:/(?:^|[=:\s])[A-Za-z0-9+/]{40,}={1,2}(?:\s|$)/m},{label:"obfuscation:hex-escape",pattern:/\\x[0-9a-fA-F]{2}(?:\\x[0-9a-fA-F]{2}){3,}/},{label:"credential-leak:api-key",pattern:/\bAPI_KEY\s*=\s*['"][^'"]+['"]/},{label:"credential-leak:secret",pattern:/\bSECRET_KEY\s*=\s*['"][^'"]+['"]/},{label:"credential-leak:password",pattern:/\bPASSWORD\s*=\s*['"][^'"]+['"]/}];function o4(q,$){let Z=[];if(!q.name||!q.name.trim())Z.push("missing frontmatter field: name");if(!q.description||!q.description.trim())Z.push("missing frontmatter field: description");if(rJ($).trim().length<20)Z.push("SKILL.md body too short (less than 20 chars of instructions)");for(let{label:Q,pattern:G}of sJ)if(G.test($))Z.push(`malicious pattern detected: ${Q}`);return{verified:Z.length===0,reasons:Z}}function rJ(q){let $=q.trimStart();if(!$.startsWith("---"))return $;let Z=$.indexOf(`
|
|
189
|
+
---`,3);if(Z===-1)return"";return $.slice(Z+4)}async function ZU(){let q=Bq();return await eJ(q,{recursive:!0}),q}async function s4(q){await j0();let $;try{$=D0(q)}catch(X){return{success:!1,repoIndex:null,error:X.message}}if($.isLocal)return{success:!1,repoIndex:null,error:"Local paths are not supported for indexing. Use a GitHub source instead."};b(`ingester: cloning ${$.owner}/${$.repo}`);let Z=null;try{Z=await N0($),b(`ingester: discovering skills in ${Z}`);let X=await Kq(Z);b(`ingester: found ${X.length} skills`);let Q=[];for(let U of X){let H=u2(Z,U.relPath,"SKILL.md"),_="";try{_=await $U(H,"utf-8")}catch{b(`ingester: could not read SKILL.md at ${H}`)}let V=o4(U,_);if(!V.verified)b(`ingester: ${U.name} not verified: ${V.reasons.join(", ")}`);Q.push({name:U.name,description:U.description,version:U.version,license:U.license,creator:U.creator,compatibility:U.compatibility,allowedTools:U.allowedTools,installUrl:`github:${$.owner}/${$.repo}${$.ref?`#${$.ref}`:""}${U.relPath?`:${U.relPath}`:""}`,relPath:U.relPath,verified:V.verified})}let G={repoUrl:$.cloneUrl,owner:$.owner,repo:$.repo,updatedAt:new Date().toISOString(),skillCount:Q.length,skills:Q},z=await ZU(),J=u2(z,`${$.owner}_${$.repo}.json`);return await tJ(J,JSON.stringify(G,null,2)+`
|
|
190
|
+
`,"utf-8"),b(`ingester: wrote index to ${J}`),{success:!0,repoIndex:G}}catch(X){return{success:!1,repoIndex:null,error:X.message}}finally{if(Z)await a(Z)}}async function r4(){return(await V$()).map(($)=>({owner:$.owner,repo:$.repo,skillCount:$.skillCount,updatedAt:$.updatedAt})).sort(($,Z)=>Z.skillCount-$.skillCount)}async function t4(q,$){let Z=Bq(),X=u2(Z,`${q}_${$}.json`);try{return await qU(X),!0}catch{return!1}}import{join as XU}from"path";function QU(q){let $=q.slice(2),Z={command:null,subcommand:null,positional:[],flags:{help:!1,version:!1,json:!1,yes:!1,noColor:!1,scope:"both",sort:"name",provider:null,name:null,force:!1,path:null,all:!1,verbose:!1,flat:!1,transport:"auto",method:"default",installed:!1,available:!1,has:[],missing:[]}},X=0;while(X<$.length){let Q=$[X];if(Q==="--help"||Q==="-h")Z.flags.help=!0;else if(Q==="--version"||Q==="-v")Z.flags.version=!0;else if(Q==="--json")Z.flags.json=!0;else if(Q==="--yes"||Q==="-y")Z.flags.yes=!0;else if(Q==="--no-color")Z.flags.noColor=!0;else if(Q==="--scope"||Q==="-s"){X++;let G=$[X];if(G==="global"||G==="project"||G==="both")Z.flags.scope=G;else C(`Invalid scope: "${G}". Must be global, project, or both.`),process.exit(2)}else if(Q==="--sort"){X++;let G=$[X];if(G==="name"||G==="version"||G==="location")Z.flags.sort=G;else C(`Invalid sort: "${G}". Must be name, version, or location.`),process.exit(2)}else if(Q==="--provider"||Q==="-p"||Q==="--tool")X++,Z.flags.provider=$[X]||null;else if(Q==="--name")X++,Z.flags.name=$[X]||null;else if(Q==="--force"||Q==="-f")Z.flags.force=!0;else if(Q==="--path")X++,Z.flags.path=$[X]||null;else if(Q==="--all")Z.flags.all=!0;else if(Q==="--verbose"||Q==="-V")Z.flags.verbose=!0;else if(Q==="--flat")Z.flags.flat=!0;else if(Q==="--installed")Z.flags.installed=!0;else if(Q==="--available")Z.flags.available=!0;else if(Q==="--transport"||Q==="-t"){X++;let G=$[X];if(G==="https"||G==="ssh"||G==="auto")Z.flags.transport=G;else C(`Invalid transport: "${G}". Must be https, ssh, or auto.`),process.exit(2)}else if(Q==="--method"||Q==="-m"){X++;let G=$[X];if(G==="default"||G==="vercel")Z.flags.method=G;else C(`Invalid method: "${G}". Must be default or vercel.`),process.exit(2)}else if(Q==="--skill")X++,Z.flags.path=$[X]||null;else if(Q==="--has"){if(X++,$[X])Z.flags.has.push($[X])}else if(Q==="--missing"){if(X++,$[X])Z.flags.missing.push($[X])}else if(Q.startsWith("-"))C(`Unknown option: ${Q}`),console.error('Run "asm --help" for usage.'),process.exit(2);else if(!Z.command)Z.command=Q;else if(!Z.subcommand)Z.subcommand=Q;else Z.positional.push(Q);X++}return Z}function C(q){console.error(Y.red(`Error: ${q}`))}function GU(){console.log(`${Y.blueBold("agent-skill-manager")} (${Y.bold("asm")}) ${n2}
|
|
188
191
|
|
|
189
192
|
Interactive TUI and CLI for managing installed skills for AI coding agents.
|
|
190
193
|
|
|
191
|
-
${
|
|
194
|
+
${Y.bold("Usage:")}
|
|
192
195
|
asm Launch interactive TUI
|
|
193
196
|
asm <command> [options] Run a CLI command
|
|
194
197
|
|
|
195
|
-
${
|
|
198
|
+
${Y.bold("Commands:")}
|
|
196
199
|
list List all discovered skills
|
|
197
200
|
search <query> Search skills by name/description/tool
|
|
198
201
|
inspect <skill-name> Show detailed info for a skill
|
|
@@ -205,13 +208,14 @@ ${H.bold("Commands:")}
|
|
|
205
208
|
init <name> Scaffold a new skill with SKILL.md template
|
|
206
209
|
stats Show aggregate skill metrics dashboard
|
|
207
210
|
link <path> Symlink a local skill directory into an agent
|
|
211
|
+
bundle Manage skill bundles (create, install, list, show, remove)
|
|
208
212
|
index Manage skill index (ingest, search, list)
|
|
209
213
|
config show Print current config
|
|
210
214
|
config path Print config file path
|
|
211
215
|
config reset Reset config to defaults
|
|
212
216
|
config edit Open config in $EDITOR
|
|
213
217
|
|
|
214
|
-
${
|
|
218
|
+
${Y.bold("Global Options:")}
|
|
215
219
|
-h, --help Show help for any command
|
|
216
220
|
-v, --version Print version and exit
|
|
217
221
|
--json Output as JSON (list, search, inspect)
|
|
@@ -221,12 +225,12 @@ ${H.bold("Global Options:")}
|
|
|
221
225
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
222
226
|
--flat Show one row per tool instance (list, search)
|
|
223
227
|
-y, --yes Skip confirmation prompts
|
|
224
|
-
-V, --verbose Show debug output`)}function
|
|
228
|
+
-V, --verbose Show debug output`)}function zU(){console.log(`${Y.bold("Usage:")} asm list [options]
|
|
225
229
|
|
|
226
230
|
List all discovered skills. By default, skills installed across multiple
|
|
227
231
|
tools are grouped into a single row with tool badges.
|
|
228
232
|
|
|
229
|
-
${
|
|
233
|
+
${Y.bold("Options:")}
|
|
230
234
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
231
235
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
232
236
|
-p, --tool <p> Filter by tool (claude, codex, openclaw, agents)
|
|
@@ -235,18 +239,18 @@ ${H.bold("Options:")}
|
|
|
235
239
|
--no-color Disable ANSI colors
|
|
236
240
|
-V, --verbose Show debug output
|
|
237
241
|
|
|
238
|
-
${
|
|
239
|
-
asm list ${
|
|
240
|
-
asm list --flat ${
|
|
241
|
-
asm list -p claude ${
|
|
242
|
-
asm list -s project ${
|
|
243
|
-
asm list --sort version ${
|
|
244
|
-
asm list --json ${
|
|
242
|
+
${Y.bold("Examples:")}
|
|
243
|
+
asm list ${Y.dim("List all skills (grouped)")}
|
|
244
|
+
asm list --flat ${Y.dim("One row per tool instance")}
|
|
245
|
+
asm list -p claude ${Y.dim("Only Claude Code skills")}
|
|
246
|
+
asm list -s project ${Y.dim("Only project-scoped skills")}
|
|
247
|
+
asm list --sort version ${Y.dim("Sort by version")}
|
|
248
|
+
asm list --json ${Y.dim("Output as JSON")}`)}function JU(){console.log(`${Y.bold("Usage:")} asm search <query> [options]
|
|
245
249
|
|
|
246
250
|
Search both installed skills and the skill index. Results show installation
|
|
247
251
|
status and include copy-paste install commands for available skills.
|
|
248
252
|
|
|
249
|
-
${
|
|
253
|
+
${Y.bold("Options:")}
|
|
250
254
|
--sort <field> Sort by: name, version, or location (default: name)
|
|
251
255
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
252
256
|
-p, --tool <p> Filter by tool (claude, codex, openclaw, agents)
|
|
@@ -257,95 +261,95 @@ ${H.bold("Options:")}
|
|
|
257
261
|
--no-color Disable ANSI colors
|
|
258
262
|
-V, --verbose Show debug output
|
|
259
263
|
|
|
260
|
-
${
|
|
261
|
-
asm search code ${
|
|
262
|
-
asm search review -p claude ${
|
|
263
|
-
asm search "test" --installed ${
|
|
264
|
-
asm search "test" --available ${
|
|
265
|
-
asm search openspec --json ${
|
|
264
|
+
${Y.bold("Examples:")}
|
|
265
|
+
asm search code ${Y.dim("Search installed and available skills")}
|
|
266
|
+
asm search review -p claude ${Y.dim("Search within Claude Code only")}
|
|
267
|
+
asm search "test" --installed ${Y.dim("Search installed skills only")}
|
|
268
|
+
asm search "test" --available ${Y.dim("Search available skills only")}
|
|
269
|
+
asm search openspec --json ${Y.dim("Output matches as JSON")}`)}function UU(){console.log(`${Y.bold("Usage:")} asm inspect <skill-name> [options]
|
|
266
270
|
|
|
267
271
|
Show detailed information for a skill. The <skill-name> is the directory name.
|
|
268
272
|
Shows version, description, file count, and all provider installations.
|
|
269
273
|
|
|
270
|
-
${
|
|
274
|
+
${Y.bold("Options:")}
|
|
271
275
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
272
276
|
--json Output as JSON object
|
|
273
277
|
--no-color Disable ANSI colors
|
|
274
278
|
-V, --verbose Show debug output
|
|
275
279
|
|
|
276
|
-
${
|
|
277
|
-
asm inspect code-review ${
|
|
278
|
-
asm inspect code-review --json ${
|
|
279
|
-
asm inspect code-review -s global ${
|
|
280
|
+
${Y.bold("Examples:")}
|
|
281
|
+
asm inspect code-review ${Y.dim("Show details for code-review")}
|
|
282
|
+
asm inspect code-review --json ${Y.dim("Output as JSON")}
|
|
283
|
+
asm inspect code-review -s global ${Y.dim("Global installations only")}`)}function YU(){console.log(`${Y.bold("Usage:")} asm uninstall <skill-name> [options]
|
|
280
284
|
|
|
281
285
|
Remove a skill and its associated rule files. Shows a removal plan
|
|
282
286
|
before proceeding and asks for confirmation.
|
|
283
287
|
|
|
284
|
-
${
|
|
288
|
+
${Y.bold("Options:")}
|
|
285
289
|
-y, --yes Skip confirmation prompt
|
|
286
290
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
287
291
|
--no-color Disable ANSI colors
|
|
288
292
|
-V, --verbose Show debug output
|
|
289
293
|
|
|
290
|
-
${
|
|
291
|
-
asm uninstall code-review ${
|
|
292
|
-
asm uninstall code-review -y ${
|
|
293
|
-
asm uninstall code-review -s project ${
|
|
294
|
+
${Y.bold("Examples:")}
|
|
295
|
+
asm uninstall code-review ${Y.dim("Remove with confirmation")}
|
|
296
|
+
asm uninstall code-review -y ${Y.dim("Remove without confirmation")}
|
|
297
|
+
asm uninstall code-review -s project ${Y.dim("Remove project copy only")}`)}function HU(){console.log(`${Y.bold("Usage:")} asm audit [subcommand] [options]
|
|
294
298
|
|
|
295
299
|
Detect duplicate skills or run security audits on installed/remote skills.
|
|
296
300
|
|
|
297
|
-
${
|
|
301
|
+
${Y.bold("Subcommands:")}
|
|
298
302
|
duplicates Find duplicate skills (default)
|
|
299
303
|
security <name|source> Run security audit on an installed skill or GitHub source
|
|
300
304
|
|
|
301
|
-
${
|
|
305
|
+
${Y.bold("Options:")}
|
|
302
306
|
--json Output as JSON
|
|
303
307
|
-y, --yes Auto-remove duplicates, keeping one instance per group
|
|
304
308
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
305
309
|
--no-color Disable ANSI colors
|
|
306
310
|
-V, --verbose Show debug output
|
|
307
311
|
|
|
308
|
-
${
|
|
309
|
-
asm audit ${
|
|
310
|
-
asm audit -y ${
|
|
311
|
-
asm audit --json ${
|
|
312
|
-
asm audit security code-review ${
|
|
313
|
-
asm audit security github:user/repo ${
|
|
314
|
-
asm audit security --all ${
|
|
315
|
-
asm audit security code-review --json ${
|
|
312
|
+
${Y.bold("Examples:")}
|
|
313
|
+
asm audit ${Y.dim("Find duplicates")}
|
|
314
|
+
asm audit -y ${Y.dim("Auto-remove duplicates")}
|
|
315
|
+
asm audit --json ${Y.dim("Output as JSON")}
|
|
316
|
+
asm audit security code-review ${Y.dim("Audit an installed skill")}
|
|
317
|
+
asm audit security github:user/repo ${Y.dim("Audit a remote skill before installing")}
|
|
318
|
+
asm audit security --all ${Y.dim("Audit all installed skills")}
|
|
319
|
+
asm audit security code-review --json ${Y.dim("Output audit as JSON")}
|
|
316
320
|
asm audit security https://github.com/user/skills/tree/main/skills/agent-config
|
|
317
|
-
${
|
|
321
|
+
${Y.dim("Audit a skill from a subfolder URL")}`)}function VU(){console.log(`${Y.bold("Usage:")} asm config <subcommand>
|
|
318
322
|
|
|
319
323
|
Manage configuration. Config is stored at ~/.config/agent-skill-manager/.
|
|
320
324
|
|
|
321
|
-
${
|
|
325
|
+
${Y.bold("Subcommands:")}
|
|
322
326
|
show Print current config as JSON
|
|
323
327
|
path Print config file path
|
|
324
328
|
reset Reset config to defaults (with confirmation)
|
|
325
329
|
edit Open config in $EDITOR
|
|
326
330
|
|
|
327
|
-
${
|
|
331
|
+
${Y.bold("Options:")}
|
|
328
332
|
-V, --verbose Show debug output
|
|
329
333
|
|
|
330
|
-
${
|
|
331
|
-
asm config show ${
|
|
332
|
-
asm config edit ${
|
|
333
|
-
asm config reset -y ${
|
|
334
|
-
${
|
|
335
|
-
`)),q.flags.flat)console.log(
|
|
336
|
-
${
|
|
337
|
-
Done.`))}function
|
|
338
|
-
`))Q($.trim())}function z(){Q($.trim())}let
|
|
339
|
-
Auto-removing duplicates...`));for(let
|
|
340
|
-
Done.`))}}async function
|
|
341
|
-
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await
|
|
342
|
-
`);let
|
|
343
|
-
Summary:`)),z.dangerous>0)console.log(` ${
|
|
344
|
-
`);let z=await
|
|
334
|
+
${Y.bold("Examples:")}
|
|
335
|
+
asm config show ${Y.dim("View current config")}
|
|
336
|
+
asm config edit ${Y.dim("Edit in $EDITOR")}
|
|
337
|
+
asm config reset -y ${Y.dim("Reset without confirmation")}`)}async function R5(q){for(let $ of q)$.warnings=await F4($)}async function WU(q){if(q.flags.help){zU();return}let $=await v(),Z=await d($,q.flags.scope);if(q.flags.provider&&q.command==="list")Z=Z.filter((Q)=>Q.provider===q.flags.provider);await R5(Z);let X=p2(Z,q.flags.sort);if(q.flags.json)console.log(m(X));else if(q.flags.flat){let Q=c2(X),G=X.filter((z)=>z.warnings&&z.warnings.length>0);if(G.length>0)Q+=`
|
|
338
|
+
${Y.yellow(`${G.length} skill${G.length===1?"":"s"} with warnings -- use --json for details`)}`;console.log(Q)}else console.log(Y5(X))}async function _U(q){if(q.flags.help){JU();return}let $=q.subcommand;if(!$)C("Missing required argument: <query>"),console.error('Run "asm search --help" for usage.'),process.exit(2);let Z=!q.flags.available,X=!q.flags.installed,Q=[];if(Z){let U=await v(),H=await d(U,q.flags.scope);if(q.flags.provider)H=H.filter((V)=>V.provider===q.flags.provider);let _=X5(H,$);Q=p2(_,q.flags.sort)}let G=[];if(X){if(G=await W$($),Q.length>0){let U=new Set(Q.map((H)=>H.name.toLowerCase()));G=G.filter((H)=>!U.has(H.skill.name.toLowerCase()))}}if(q.flags.json){let U=Q.map((_)=>({name:_.name,description:_.description,version:_.version,scope:_.scope,provider:_.provider,status:"installed"})),H=G.map((_)=>({name:_.skill.name,description:_.skill.description,version:_.skill.version,repo:`${_.repo.owner}/${_.repo.repo}`,installCommand:`asm install ${_.skill.installUrl}`,status:"available"}));console.log(m([...U,...H]));return}let z=Q.length>0,J=G.length>0;if(!z&&!J){console.error(`No skills matching "${$}".`),console.error(Y.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(z)if(console.error(Y.bold(`Installed skills matching "${$}":
|
|
339
|
+
`)),q.flags.flat)console.log(c2(Q));else console.log(H5(Q,$));if(J){if(z)console.error("");let U=V5(G.map((H)=>({name:H.skill.name,version:H.skill.version,description:H.skill.description,verified:H.skill.verified,repoLabel:`${H.repo.owner}/${H.repo.repo}`,installUrl:H.skill.installUrl})),$);console.error(U)}}async function BU(q){if(q.flags.help){UU();return}let $=q.subcommand;if(!$)C("Missing required argument: <skill-name>"),console.error('Run "asm inspect --help" for usage.'),process.exit(2);let Z=await v(),Q=(await d(Z,q.flags.scope)).filter((G)=>G.dirName===$);if(Q.length===0)C(`Skill "${$}" not found.`),console.error(Y.dim(`Try ${Y.bold("asm list")} to see all skills or ${Y.bold(`asm search "${$}"`)} to search.`)),process.exit(1);if(await R5(Q),q.flags.json)console.log(m(Q.length===1?Q[0]:Q));else console.log(await W5(Q))}async function OU(q){if(q.flags.help){YU();return}let $=q.subcommand;if(!$)C("Missing required argument: <skill-name>"),console.error('Run "asm uninstall --help" for usage.'),process.exit(2);let Z=await v(),X=await d(Z,q.flags.scope),Q=G5($,X,Z),G=await z5(Q);if(G.length===0)C(`Skill "${$}" not found or nothing to remove.`),process.exit(1);console.error(Y.bold("Removal plan:"));for(let J of G)console.error(` ${Y.red("•")} ${U5(J)}`);if(!q.flags.yes){if(!process.stdin.isTTY)C("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`
|
|
340
|
+
${Y.bold("Proceed with removal?")} [y/N] `);let J=await n();if(J.toLowerCase()!=="y"&&J.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let z=await d2(Q);for(let J of z)console.error(J);try{await O5($)}catch{}console.error(Y.green(`
|
|
341
|
+
Done.`))}function n(){return new Promise((q)=>{let $="",Z=!1;function X(){process.stdin.removeListener("data",G),process.stdin.removeListener("end",z),process.stdin.pause(),clearTimeout(J)}function Q(U){if(Z)return;Z=!0,X(),q(U)}function G(U){if($+=U,$.includes(`
|
|
342
|
+
`))Q($.trim())}function z(){Q($.trim())}let J=setTimeout(()=>{Q($.trim())},30000);process.stdin.setEncoding("utf-8"),process.stdin.on("data",G),process.stdin.on("end",z),process.stdin.resume()})}async function FU(q){if(q.flags.help){HU();return}let $=q.subcommand??"duplicates";if($==="security"){await TU(q);return}if($!=="duplicates")C(`Unknown audit subcommand: "${$}". Use: duplicates, security`),process.exit(2);let Z=await v(),X=await d(Z,"both"),Q=l2(X);if(q.flags.json){console.log(L5(Q));return}if(console.log(K5(Q)),q.flags.yes&&Q.duplicateGroups.length>0){console.error(Y.bold(`
|
|
343
|
+
Auto-removing duplicates...`));for(let G of Q.duplicateGroups){let z=T5(G.instances),J=z[0].path;for(let U=1;U<z.length;U++){let H=z[U],_=Q5(H,Z),V=await d2(_,J);for(let W of V)console.error(W)}}console.error(Y.green(`
|
|
344
|
+
Done.`))}}async function TU(q){let $=q.positional[0];if(q.flags.all)await KU(q);else if(!$)C(`Missing target. Provide a skill name, GitHub source, or use --all.
|
|
345
|
+
Usage: asm audit security <name|github:owner/repo> [--all]`),process.exit(2);else if($.startsWith("github:")||$.startsWith("https://github.com/"))await LU(q,$);else await MU(q,$)}async function KU(q){let $=await v(),Z=await d($,q.flags.scope);if(Z.length===0){if(q.flags.json)console.log("[]");else console.log("No skills found to audit.");return}let X=new Set,Q=Z.filter((z)=>{if(X.has(z.realPath))return!1;return X.add(z.realPath),!0});console.error(`Auditing ${Q.length} skill${Q.length>1?"s":""}...
|
|
346
|
+
`);let G=[];for(let z of Q){console.error(` Scanning ${Y.bold(z.name)}...`);let J=await Y$(z.realPath,z.name);G.push(J)}if(q.flags.json)console.log(JSON.stringify(G,null,2));else{for(let J of G)console.log(H$(J));let z={safe:0,caution:0,warning:0,dangerous:0};for(let J of G)z[J.verdict]++;if(console.log(Y.bold(`
|
|
347
|
+
Summary:`)),z.dangerous>0)console.log(` ${Y.red(`${z.dangerous} dangerous`)}`);if(z.warning>0)console.log(` ${Y.yellow(`${z.warning} warning`)}`);if(z.caution>0)console.log(` ${z.caution} caution`);if(z.safe>0)console.log(` ${Y.green(`${z.safe} safe`)}`);console.log("")}}async function LU(q,$){let Z=null;try{let X=D0($);if(X.isLocal)throw Error("Local paths are not supported for remote security audits. Use: asm audit security <installed-skill-name>");await j0(),X=await K$(X),console.error(`Cloning ${$} for audit...`),Z=await N0(X,q.flags.transport);let{join:Q}=await import("path"),G=X.subpath?Q(Z,X.subpath):Z,{name:z}=await B0(G),J=await Y$(G,z,X.owner,X.repo);if(q.flags.json)console.log(k2(J));else console.log(H$(J))}catch(X){C(X.message),process.exit(1)}finally{if(Z)await a(Z)}}async function MU(q,$){let Z=await v(),Q=(await d(Z,q.flags.scope)).filter((J)=>J.dirName===$);if(Q.length===0)C(`Skill "${$}" not found. Use "asm list" to see installed skills.`),process.exit(1);let G=Q[0];console.error(`Auditing installed skill: ${Y.bold(G.name)}...
|
|
348
|
+
`);let z=await Y$(G.realPath,G.name);if(q.flags.json)console.log(k2(z));else console.log(H$(z))}async function RU(q){if(q.flags.help){VU();return}let $=q.subcommand;if(!$)C("Missing subcommand. Use: show, path, reset, or edit."),console.error('Run "asm config --help" for usage.'),process.exit(2);switch($){case"show":{let Z=await v();console.log(m(Z));break}case"path":{console.log(m2());break}case"reset":{if(!q.flags.yes){if(!process.stdin.isTTY)C("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);process.stderr.write(`${Y.bold("Reset config to defaults?")} [y/N] `);let X=await n();if(X.toLowerCase()!=="y"&&X.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Z=$5();await Z5(Z),console.error(Y.green("Config reset to defaults."));break}case"edit":{let Z=process.env.VISUAL||process.env.EDITOR||"vi",[X,Q]=M5(Z),G=m2();await v();let{spawn:z}=await import("child_process");await new Promise((J,U)=>{let H=z(X,[...Q,G],{stdio:"inherit"});H.on("close",()=>J()),H.on("error",U)});break}default:C(`Unknown config subcommand: "${$}". Use: show, path, reset, or edit.`),process.exit(2)}}function AU(){console.log(`${Y.bold("Usage:")} asm install <source> [options]
|
|
345
349
|
|
|
346
350
|
Install a skill from a GitHub repository or a local folder path.
|
|
347
351
|
|
|
348
|
-
${
|
|
352
|
+
${Y.bold("Source Format:")}
|
|
349
353
|
github:owner/repo Install from default branch
|
|
350
354
|
github:owner/repo#ref Install from specific branch or tag
|
|
351
355
|
github:owner/repo#ref:path Install from a subfolder on a specific branch
|
|
@@ -356,7 +360,7 @@ ${H.bold("Source Format:")}
|
|
|
356
360
|
./relative/path/to/skill Install from a local folder (relative path)
|
|
357
361
|
~/path/to/skill Install from a local folder (home-relative path)
|
|
358
362
|
|
|
359
|
-
${
|
|
363
|
+
${Y.bold("Options:")}
|
|
360
364
|
-p, --tool <name> Target tool (claude, codex, openclaw, agents, all)
|
|
361
365
|
Use "all" to install to all tools (shared + symlinks)
|
|
362
366
|
-s, --scope <scope> Installation scope: global or project (default: prompt)
|
|
@@ -376,64 +380,64 @@ ${H.bold("Options:")}
|
|
|
376
380
|
--no-color Disable ANSI colors
|
|
377
381
|
-V, --verbose Show debug output
|
|
378
382
|
|
|
379
|
-
${
|
|
380
|
-
asm install ./my-skill ${
|
|
381
|
-
asm install /home/user/skills/my-skill ${
|
|
382
|
-
asm install ~/skills/my-skill ${
|
|
383
|
-
asm install ../other-project/skill ${
|
|
384
|
-
asm install ./skills-dir --all ${
|
|
383
|
+
${Y.bold("Local folder:")}
|
|
384
|
+
asm install ./my-skill ${Y.dim("(relative path)")}
|
|
385
|
+
asm install /home/user/skills/my-skill ${Y.dim("(absolute path)")}
|
|
386
|
+
asm install ~/skills/my-skill ${Y.dim("(home-relative path)")}
|
|
387
|
+
asm install ../other-project/skill ${Y.dim("(parent-relative path)")}
|
|
388
|
+
asm install ./skills-dir --all ${Y.dim("(all skills in directory)")}
|
|
385
389
|
|
|
386
|
-
${
|
|
390
|
+
${Y.bold("Single-skill repo:")}
|
|
387
391
|
asm install github:user/my-skill
|
|
388
392
|
asm install github:user/my-skill#v1.0.0 -p claude
|
|
389
393
|
asm install https://github.com/user/my-skill
|
|
390
|
-
asm install github:user/my-skill -p all ${
|
|
391
|
-
asm install github:user/private-skill -t ssh ${
|
|
394
|
+
asm install github:user/my-skill -p all ${Y.dim("(install to all tools)")}
|
|
395
|
+
asm install github:user/private-skill -t ssh ${Y.dim("(clone via SSH)")}
|
|
392
396
|
|
|
393
|
-
${
|
|
397
|
+
${Y.bold("Multi-skill repo:")}
|
|
394
398
|
asm install github:user/skills --path skills/code-review
|
|
395
399
|
asm install github:user/skills --all -p claude -y
|
|
396
|
-
asm install github:user/skills --all -p all -y ${
|
|
400
|
+
asm install github:user/skills --all -p all -y ${Y.dim("(all skills, all tools)")}
|
|
397
401
|
asm install https://github.com/user/skills --all
|
|
398
|
-
asm install github:user/skills ${
|
|
402
|
+
asm install github:user/skills ${Y.dim("(interactive picker)")}
|
|
399
403
|
|
|
400
|
-
${
|
|
404
|
+
${Y.bold("Subfolder URL:")}
|
|
401
405
|
asm install https://github.com/user/skills/tree/main/skills/agent-config
|
|
402
406
|
asm install github:user/skills#main:skills/agent-config
|
|
403
407
|
|
|
404
|
-
${
|
|
408
|
+
${Y.bold("Vercel skills CLI:")}
|
|
405
409
|
asm install github:user/skills --method vercel --skill my-skill
|
|
406
410
|
asm install https://github.com/user/skills -m vercel --skill my-skill -y
|
|
407
|
-
${
|
|
408
|
-
${
|
|
409
|
-
${
|
|
410
|
-
${
|
|
411
|
-
${
|
|
412
|
-
`);for(let
|
|
411
|
+
${Y.dim("Delegates to npx skills add for Vercel tracking, then registers in asm")}`)}async function IU(q,$,Z,X,Q,G,z,J,U="global"){let H=await B0(X),_=await $1(X),V=X===Z?null:X.split(/[/\\]/).pop(),W=Q||V||$.repo,O=_0(W),T=J.find((j)=>j.name.toLowerCase()===H.name.toLowerCase()&&j.provider===z.name),B,F=!!T;if(T)if(T.version===H.version)B=q.flags.force?"REINSTALL":`UPDATE: ${T.version} (same version)`;else B=`UPDATE: ${T.version} → ${H.version}`;else B="NEW";let L=L$($,Z,X,O,z,q.flags.force||F,U),R=_.some((j)=>["Shell commands","Code execution","Credentials"].includes(j.category)),M=_.some((j)=>["External URLs"].includes(j.category)),A=R?"high":M?"medium":"safe",D=R?Y.red("[!] High Risk"):M?Y.yellow("[~] Medium Risk"):Y.green("[ok] Safe");return{metadata:H,skillName:O,warnings:_,installStatus:B,riskLevel:A,riskLabel:D,plan:L}}function wU(q,$,Z,X,Q,G){let{metadata:z,warnings:J,installStatus:U,riskLabel:H,plan:_}=q;if(Q&&G){let V=Y.dim(`[${G.index}/${G.total}]`),W=U==="NEW"?Y.green(`[${U}]`):Y.yellow(`[${U}]`);console.info(`${V} ${Y.bold(z.name)} v${z.version} ${W} ${H}`)}else{let V=U==="NEW"?Y.green(`[${U}]`):Y.yellow(`[${U}]`);if(console.info(` ${Y.bold(z.name)} v${z.version} ${V}`),console.info(`
|
|
412
|
+
${Y.bold("Install preview:")}`),console.info(` ${Y.bold("Name:")} ${z.name}`),console.info(` ${Y.bold("Version:")} ${z.version}`),z.description)console.info(` ${Y.bold("Description:")} ${Y.dim(z.description)}`);if(z.effort)console.info(` ${Y.bold("Effort:")} ${J5(z.effort)}`);if(console.info(` ${Y.bold("Source:")} ${$}`),X)console.info(` ${Y.bold("Tool:")} All (${X.map((W)=>W.label).join(", ")})`),console.info(` ${Y.bold("Primary:")} ${Z.label} (${Z.name})`),console.info(` ${Y.bold("Symlinks:")} ${X.filter((W)=>W.name!==Z.name).map((W)=>W.label).join(", ")}`);else console.info(` ${Y.bold("Tool:")} ${Z.label} (${Z.name})`);if(console.info(` ${Y.bold("Scope:")} ${_.scope==="project"?"Project":"Global"}`),console.info(` ${Y.bold("Target:")} ${_.targetDir}`),console.info(` ${Y.bold("Status:")} ${V}`),console.info(` ${Y.bold("Risk:")} ${H}`),J.length>0){console.info(`
|
|
413
|
+
${Y.bold("Security warnings:")}`);let W=new Map;for(let O of J){let T=W.get(O.category)||[];T.push(O),W.set(O.category,T)}for(let[O,T]of W){let F=["Shell commands","Code execution","Credentials"].includes(O)?Y.red(`[${O}]`):Y.yellow(`[${O}]`);console.info(`
|
|
414
|
+
${F} ${Y.dim(`(${T.length} match${T.length>1?"es":""})`)}`);for(let L of T.slice(0,5))console.info(` ${Y.dim(`${L.file}:${L.line}`)} -- ${L.match}`);if(T.length>5)console.info(Y.dim(` ... and ${T.length-5} more`))}}}}async function DU(q,$){if($)return await Z1(q,$);return await Lq(q)}async function jU(q){if(q.flags.help){AU();return}let $=q.subcommand;if(!$)C("Missing required argument: <source>"),console.error('Run "asm install --help" for usage.'),process.exit(2);let Z=null,X=8,Q=0,G=(J)=>{return Q++,`
|
|
415
|
+
${Y.cyan(`[Step ${Q}/${X}]`)} ${Y.bold(J)}`},z=()=>{if(Z)a(Z).finally(()=>process.exit(1));else process.exit(1)};process.on("SIGINT",z),process.on("SIGTERM",z);try{console.info(G("Parsing source"));let J=D0($),U=!!J.isLocal;if(U){let w=J.localPath;console.info(` ${Y.dim(`local: ${w}`)}`);let{stat:K}=await import("fs/promises");try{if(!(await K(w)).isDirectory())throw Error(`Path is not a directory: ${w}`)}catch(E){if(E.code==="ENOENT")throw Error(`Path does not exist: ${w}`);throw E}}else await j0(),J=await K$(J),console.info(` ${Y.dim($)}`);if(q.flags.method==="vercel"){console.info(G("Installing via Vercel skills CLI")),await X1();let w=G1(J),K=q.flags.path||null;console.info(` ${Y.dim(`npx skills add ${w}${K?` --skill ${K}`:""}`)}`);let{stdout:E,stderr:N}=await Q1(w,K);if(E.trim())console.info(` ${Y.dim(E.trim())}`);if(N.trim())console.error(` ${Y.dim(N.trim())}`);console.info(` ${Y.green("✓")} Vercel skills CLI install completed`),q.flags.force=!0,console.info(` ${Y.dim("Continuing with asm install to register in local inventory...")}`)}console.info(G("Selecting provider"));let H=await v(),{provider:_,allProviders:V}=await p0(H,q.flags.provider,!!process.stdin.isTTY);console.info(G("Selecting scope"));let W;if(q.flags.scope==="global"||q.flags.scope==="project")W=q.flags.scope,console.info(` ${Y.dim(`scope: ${W}`)}${W==="global"?` (${_.global})`:` (${_.project})`}`);else if(!process.stdin.isTTY||q.flags.yes)W="global",console.info(` ${Y.dim("scope: global (default)")} (${_.global})`);else{let w=[{label:`Global (${_.global})`,hint:"Available in all projects",checked:!0},{label:`Project (${_.project})`,hint:"Available only in this project",checked:!1}];console.info("");let K=await w0({items:w});if(K.length===0)throw Error("No scope selected. Aborting.");W=K[0]===0?"global":"project",console.info(` Selected: ${Y.bold(W)} ${Y.dim(`(${W==="global"?_.global:_.project})`)}`)}if(U)console.info(G("Reading local source")),console.info(` ${Y.dim(J.localPath)}`),Z=null;else{console.info(G("Cloning repository"));let w=q.flags.transport,K=w==="ssh"?J.sshCloneUrl:w==="https"?J.cloneUrl:`${J.cloneUrl} ${Y.dim("(auto)")}`;console.info(` ${K}${J.ref?` ${Y.dim(`(ref: ${J.ref})`)}`:""}${J.subpath?` ${Y.dim(`(path: ${J.subpath})`)}`:""}`),Z=await N0(J,w)}let O=U?J.localPath:Z;console.info(G("Scanning for skills"));let{join:T}=await import("path"),B=[],F=q.flags.path||J.subpath,L=[];if(F){let w=T(O,F);try{await B0(w)}catch{throw Error(`No SKILL.md found at path "${F}" in the repository.`)}console.info(` Found skill at ${Y.bold(F)}`),L=[{skillDir:w,nameOverride:q.flags.name}]}else{let w=!1;try{await B0(O),w=!0}catch{}if(w){let K=await B0(O);console.info(` Found: ${Y.bold(K.name)} v${K.version}`),L=[{skillDir:O,nameOverride:q.flags.name}]}else{console.info(" No SKILL.md at root. Scanning subdirectories...");let K=await Kq(O);if(K.length===0)throw Error("No skills found in this repository. Skills must have a SKILL.md file.");console.info(` Found ${Y.bold(String(K.length))} skill(s):
|
|
416
|
+
`);for(let S=0;S<K.length;S++){let f=Y.cyan(` ${String(S+1).padStart(String(K.length).length)})`);if(console.info(`${f} ${Y.bold(K[S].name)} ${Y.dim(`v${K[S].version}`)} ${Y.dim(`(${K[S].relPath})`)}`),K[S].description)console.info(` ${Y.dim(K[S].description)}`)}console.info(G("Selecting skills")),Q--;let E;if(q.flags.all&&(q.flags.yes||!process.stdin.isTTY))E=K.map((S)=>S.relPath),console.info(` Selected all ${Y.bold(String(E.length))} skills`);else if(process.stdin.isTTY)if(K.length===1)E=[K[0].relPath],console.info(` Auto-selected: ${Y.bold(K[0].name)} ${Y.dim(`v${K[0].version}`)}`);else{let S=K.map((g)=>({label:g.name,hint:`v${g.version}${g.description?" "+g.description:""}`,checked:!!q.flags.all}));console.info("");let f=await w0({items:S});if(f.length===0)throw Error("No skills selected. Aborting.");E=f.map((g)=>K[g].relPath),console.info(` Selected ${Y.bold(String(E.length))} skill(s)`)}else{C(`Repository contains ${K.length} skills. Use --path <subdir> to pick one or --all to install all.
|
|
413
417
|
Available skills:
|
|
414
|
-
${K.map((
|
|
415
|
-
`)}`),process.exit(2);return}let
|
|
418
|
+
${K.map((S)=>` --path ${S.relPath}`).join(`
|
|
419
|
+
`)}`),process.exit(2);return}let N=q1(E);if(N.length>0){let S=N.map((g)=>` - ${g.name}: ${g.paths.map(($0)=>`"${$0}"`).join(", ")}`).join(`
|
|
416
420
|
`),f=Error(`Duplicate skill names detected in selection:
|
|
417
|
-
${
|
|
418
|
-
Choose one path per skill name or install with --path.`);throw f.duplicates=
|
|
419
|
-
${
|
|
420
|
-
${
|
|
421
|
-
${
|
|
422
|
-
Done! Installed "${
|
|
423
|
-
${
|
|
421
|
+
${S}
|
|
422
|
+
Choose one path per skill name or install with --path.`);throw f.duplicates=N,f}L=E.map((S)=>({skillDir:T(O,S),nameOverride:E.length===1?q.flags.name:null})),Q++}}console.info(G("Inspecting skills"));let R=await d(H,"both"),M=[],A=L.length>1;for(let w=0;w<L.length;w++){let{skillDir:K,nameOverride:E}=L[w],N=await IU(q,J,O,K,E,H,_,R,W);M.push(N),wU(N,$,_,V,A,A?{index:w+1,total:L.length}:void 0)}if(A){if(console.info(""),console.info(` ${Y.bold("Install settings:")}`),console.info(` ${Y.bold("Source:")} ${$}`),V)console.info(` ${Y.bold("Tool:")} All (${V.map((S)=>S.label).join(", ")})`);else console.info(` ${Y.bold("Tool:")} ${_.label} (${_.name})`);console.info(` ${Y.bold("Scope:")} ${W==="project"?"Project":"Global"}`);let w=M.filter((S)=>S.riskLevel==="high").length,K=M.filter((S)=>S.riskLevel==="medium").length,E=M.filter((S)=>S.riskLevel==="safe").length,N=[];if(E>0)N.push(Y.green(`${E} Safe`));if(K>0)N.push(Y.yellow(`${K} Medium Risk`));if(w>0)N.push(Y.red(`${w} High Risk`));console.info(` ${Y.bold("Risk:")} ${N.join(", ")}`)}if(console.info(G("Installing")),!q.flags.yes){let w=M.some((S)=>S.riskLevel==="high");if(!process.stdin.isTTY)C("Cannot prompt for confirmation in non-interactive mode. Use --yes to skip."),process.exit(2);let K=A?`${M.length} skills`:`"${M[0].metadata.name}"`,E=w?`
|
|
423
|
+
${Y.red("[!]")} ${Y.bold(`Install ${K}? Some have high-risk patterns.`)} [y/N] `:`
|
|
424
|
+
${Y.bold(`Install ${K}?`)} [Y/n] `;process.stderr.write(E);let N=await n();if(w){if(N.toLowerCase()!=="y"&&N.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}else if(N.toLowerCase()==="n"||N.toLowerCase()==="no")console.error("Aborted."),process.exit(0)}let D=Z?await F5(Z):null,j=[];for(let w=0;w<M.length;w++){let K=M[w],E=A?Y.dim(`[${w+1}/${M.length}]`)+" ":" ";try{console.info(`${E}Installing ${Y.bold(K.metadata.name)}...`);let N=await DU(K.plan,V);B.push(N),console.info(`${E}${Y.green("✓")} ${K.metadata.name} installed to ${Y.dim(K.plan.targetDir)}`);try{let S=U?`local:${J.localPath}`:`github:${J.owner}/${J.repo}`;await B5(N.name,{source:S,commitHash:D||"unknown",ref:J.ref||"main",installedAt:new Date().toISOString(),provider:K.plan.providerName})}catch{}}catch(N){j.push({name:K.metadata.name,error:N.message}),console.error(`${E}${Y.red("✗")} ${Y.bold(K.metadata.name)} — ${Y.red(N.message)}`)}}if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),j.length>0){console.error(`
|
|
425
|
+
${Y.yellow(`${j.length} skill(s) failed to install:`)}`);for(let w of j)console.error(` ${Y.red("✗")} ${w.name}: ${w.error}`)}if(q.flags.json)console.log(JSON.stringify(B.length===1?B[0]:B,null,2));else if(B.length===1)console.error(Y.green(`
|
|
426
|
+
Done! Installed "${B[0].name}" to ${B[0].path}`));else if(B.length>0)console.error(`
|
|
427
|
+
${Y.green(`Done! Installed ${B.length} skill(s) successfully.`)}`)}catch(J){if(process.removeListener("SIGINT",z),process.removeListener("SIGTERM",z),q.flags.json){let U={success:!1,error:J.message};if(J?.duplicates)U.duplicates=J.duplicates;console.log(JSON.stringify(U,null,2))}else C(J.message);process.exit(1)}finally{if(Z)await a(Z)}}function NU(){console.log(`${Y.bold("Usage:")} asm export [options]
|
|
424
428
|
|
|
425
429
|
Export skill inventory as a portable JSON manifest. Useful for backup,
|
|
426
430
|
sharing, or scripting.
|
|
427
431
|
|
|
428
|
-
${
|
|
432
|
+
${Y.bold("Options:")}
|
|
429
433
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
430
434
|
--no-color Disable ANSI colors
|
|
431
435
|
-V, --verbose Show debug output
|
|
432
436
|
|
|
433
|
-
${
|
|
434
|
-
asm export ${
|
|
435
|
-
asm export -s global ${
|
|
436
|
-
asm export > skills.json ${
|
|
437
|
+
${Y.bold("Examples:")}
|
|
438
|
+
asm export ${Y.dim("Export all skills")}
|
|
439
|
+
asm export -s global ${Y.dim("Export global skills only")}
|
|
440
|
+
asm export > skills.json ${Y.dim("Save to file")}`)}async function PU(q){if(q.flags.help){NU();return}let $=await v(),Z=await d($,q.flags.scope),X=T4(Z);console.log(JSON.stringify(X,null,2))}function CU(){console.log(`${Y.bold("Usage:")} asm import <file> [options]
|
|
437
441
|
|
|
438
442
|
Import skills from a previously exported JSON manifest. Recreates skill
|
|
439
443
|
installations based on the manifest metadata.
|
|
@@ -442,7 +446,7 @@ Skills that already exist at the target location are skipped unless --force
|
|
|
442
446
|
is used. Skills whose source files cannot be found locally are reported as
|
|
443
447
|
failed — install them first with "asm install".
|
|
444
448
|
|
|
445
|
-
${
|
|
449
|
+
${Y.bold("Options:")}
|
|
446
450
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
447
451
|
-f, --force Overwrite existing skills
|
|
448
452
|
-y, --yes Skip confirmation prompt
|
|
@@ -450,49 +454,53 @@ ${H.bold("Options:")}
|
|
|
450
454
|
--no-color Disable ANSI colors
|
|
451
455
|
-V, --verbose Show debug output
|
|
452
456
|
|
|
453
|
-
${
|
|
454
|
-
asm import skills.json ${
|
|
455
|
-
asm import skills.json --force ${
|
|
456
|
-
asm import skills.json -s global ${
|
|
457
|
-
asm export > backup.json ${
|
|
458
|
-
asm import backup.json ${
|
|
459
|
-
${
|
|
460
|
-
Nothing to import after scope filtering (--scope ${q.flags.scope}). All skills in the manifest were excluded.`);return}console.error("");for(let
|
|
457
|
+
${Y.bold("Examples:")}
|
|
458
|
+
asm import skills.json ${Y.dim("Import from manifest")}
|
|
459
|
+
asm import skills.json --force ${Y.dim("Overwrite existing skills")}
|
|
460
|
+
asm import skills.json -s global ${Y.dim("Import only global skills")}
|
|
461
|
+
asm export > backup.json ${Y.dim("Export first, then import later")}
|
|
462
|
+
asm import backup.json ${Y.dim("Restore from backup")}`)}async function EU(q){if(q.flags.help){CU();return}let $=q.subcommand;if(!$)C("Missing required argument: <file>"),console.error('Run "asm import --help" for usage.'),process.exit(2);let{resolve:Z}=await import("path"),X=Z($),Q;try{Q=await R4(X)}catch(U){C(U.message),process.exit(1)}let G=Q.skills.length;if(G===0){if(q.flags.json)console.log(JSON.stringify({total:0,installed:0,skipped:0,failed:0,results:[]},null,2));else console.log("Manifest contains no skills. Nothing to import.");return}let z=q.flags.scope==="both"?"all scopes":q.flags.scope;if(console.error(`${Y.bold("Importing")} ${G} skill${G>1?"s":""} from ${Y.dim(X)}`),console.error(` Scope filter: ${z}`),q.flags.force)console.error(` ${Y.yellow("Force mode: existing skills will be overwritten")}`);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`
|
|
463
|
+
${Y.bold("Proceed?")} [y/N] `);let U=await n();if(U.toLowerCase()!=="y"&&U.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let J=await A4(Q,{force:q.flags.force,dryRun:!1,scopeFilter:q.flags.scope});if(q.flags.json){console.log(JSON.stringify(J,null,2));return}if(J.total===0){console.error(`
|
|
464
|
+
Nothing to import after scope filtering (--scope ${q.flags.scope}). All skills in the manifest were excluded.`);return}console.error("");for(let U of J.results){let H=U.status==="installed"?Y.green("+++"):U.status==="skipped"?Y.yellow("---"):U.status==="dry-run"?Y.cyan("~~~"):Y.red("!!!"),_=U.reason?` ${Y.dim(U.reason)}`:"",V=U.path?` ${Y.dim(U.path)}`:"";console.error(` ${H} ${U.skillName} (${U.provider}/${U.scope})${_}${V}`)}if(console.error(""),console.error(`${Y.bold("Summary:")} ${J.total} total, ${Y.green(String(J.installed))} installed, ${Y.yellow(String(J.skipped))} skipped, ${Y.red(String(J.failed))} failed`),J.failed>0)process.exitCode=1}function SU(){console.log(`${Y.bold("Usage:")} asm init <name> [options]
|
|
461
465
|
|
|
462
466
|
Scaffold a new skill directory with a SKILL.md template. Creates a
|
|
463
467
|
ready-to-edit skill in the target tool's skill folder.
|
|
464
468
|
|
|
465
|
-
${
|
|
469
|
+
${Y.bold("Options:")}
|
|
466
470
|
-p, --tool <name> Target tool (claude, codex, openclaw, agents)
|
|
467
471
|
--path <dir> Scaffold in specified directory instead of provider path
|
|
468
472
|
-f, --force Overwrite if skill already exists
|
|
469
473
|
--no-color Disable ANSI colors
|
|
470
474
|
-V, --verbose Show debug output
|
|
471
475
|
|
|
472
|
-
${
|
|
473
|
-
asm init my-skill ${
|
|
474
|
-
asm init my-skill -p claude ${
|
|
475
|
-
asm init my-skill --path ./skills ${
|
|
476
|
-
${
|
|
476
|
+
${Y.bold("Examples:")}
|
|
477
|
+
asm init my-skill ${Y.dim("Scaffold (interactive tool)")}
|
|
478
|
+
asm init my-skill -p claude ${Y.dim("Scaffold in Claude Code")}
|
|
479
|
+
asm init my-skill --path ./skills ${Y.dim("Scaffold in custom directory")}`)}async function bU(q){if(q.flags.help){SU();return}let $=q.subcommand;if(!$)C("Missing required argument: <name>"),console.error('Run "asm init --help" for usage.'),process.exit(2);let Z=_0($),X;if(q.flags.path){let{resolve:Q}=await import("path");X=Q(q.flags.path)}else{let Q=await v(),{provider:G}=await p0(Q,q.flags.provider,!!process.stdin.isTTY),{join:z}=await import("path"),{resolveProviderPath:J}=await import("./chunk-v3wdjh4r.js"),U=J(Q.providers.find((H)=>H.name===G.name).global);X=z(U,Z)}if(await w4(X)){if(!q.flags.force){if(!process.stdin.isTTY)C(`Directory already exists: ${X}. Use --force to overwrite.`),process.exit(2);process.stderr.write(`${Y.yellow(`Directory already exists: ${X}`)}
|
|
480
|
+
${Y.bold("Overwrite?")} [y/N] `);let Q=await n();if(Q.toLowerCase()!=="y"&&Q.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}}await I4(Z,X),console.error(Y.green(`Done! Created skill "${Z}" at ${X}`))}function fU(){console.log(`${Y.bold("Usage:")} asm stats [options]
|
|
477
481
|
|
|
478
482
|
Show aggregate skill metrics with provider distribution charts,
|
|
479
483
|
scope breakdown, disk usage, and duplicate summary.
|
|
480
484
|
|
|
481
|
-
${
|
|
485
|
+
${Y.bold("Options:")}
|
|
482
486
|
--json Output as JSON
|
|
483
487
|
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
484
488
|
--no-color Disable ANSI colors
|
|
485
489
|
-V, --verbose Show debug output
|
|
486
490
|
|
|
487
|
-
${
|
|
488
|
-
asm stats ${
|
|
489
|
-
asm stats -s global ${
|
|
490
|
-
asm stats --json ${
|
|
491
|
+
${Y.bold("Examples:")}
|
|
492
|
+
asm stats ${Y.dim("Show full dashboard")}
|
|
493
|
+
asm stats -s global ${Y.dim("Global skills only")}
|
|
494
|
+
asm stats --json ${Y.dim("Output raw data as JSON")}`)}async function yU(q){if(q.flags.help){fU();return}let $=await v(),Z=await d($,q.flags.scope);if(Z.length===0){console.log("No skills found.");return}let X=l2(Z),Q=await N4(Z,X);if(q.flags.json)if(!q.flags.verbose){let{perSkillDiskBytes:G,...z}=Q;console.log(m(z))}else console.log(m(Q));else console.log(P4(Q))}function xU(){console.log(`${Y.bold("Usage:")} asm link <path> [options]
|
|
491
495
|
|
|
492
496
|
Symlink a local skill directory into an agent's skill folder. Useful
|
|
493
497
|
for local development — changes to the source are reflected immediately.
|
|
494
498
|
|
|
495
|
-
|
|
499
|
+
If <path> contains a SKILL.md at its root, it is linked as a single skill.
|
|
500
|
+
If <path> has no root SKILL.md but contains subdirectories with SKILL.md
|
|
501
|
+
files, all discovered skills are linked in a single invocation.
|
|
502
|
+
|
|
503
|
+
${Y.bold("Options:")}
|
|
496
504
|
-p, --tool <name> Target tool (claude, codex, openclaw, agents)
|
|
497
505
|
--name <name> Override symlink name (default: directory basename)
|
|
498
506
|
-f, --force Overwrite if target already exists
|
|
@@ -500,21 +508,25 @@ ${H.bold("Options:")}
|
|
|
500
508
|
--no-color Disable ANSI colors
|
|
501
509
|
-V, --verbose Show debug output
|
|
502
510
|
|
|
503
|
-
${
|
|
504
|
-
asm link ./my-skill ${
|
|
505
|
-
asm link ./my-skill -p claude ${
|
|
506
|
-
asm link ./my-skill --name alias ${
|
|
507
|
-
${
|
|
511
|
+
${Y.bold("Examples:")}
|
|
512
|
+
asm link ./my-skill ${Y.dim("Link (interactive tool)")}
|
|
513
|
+
asm link ./my-skill -p claude ${Y.dim("Link to Claude Code")}
|
|
514
|
+
asm link ./my-skill --name alias ${Y.dim("Link with custom name")}
|
|
515
|
+
asm link ./my-skills-folder ${Y.dim("Link all skills in folder")}`)}async function hU(q,$){if($)return!0;let{access:Z}=await import("fs/promises"),X=!1;try{await Z(q),X=!0}catch{}if(!X)return!1;if(!process.stdin.isTTY)throw Error(`Target already exists: ${q}. Use --force to overwrite.`);process.stderr.write(`${Y.yellow(`Target already exists: ${q}`)}
|
|
516
|
+
${Y.bold("Overwrite?")} [y/N] `);let Q=await n();if(Q.toLowerCase()!=="y"&&Q.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0);return!0}async function e4(q,$,Z,X){let{join:Q}=await import("path"),G=Q($,Z),z=await hU(G,X);return await S4(q,$,Z,z),{name:Z,symlinkPath:G,targetPath:q}}async function gU(q){if(q.flags.help){xU();return}let $=q.subcommand;if(!$)C("Missing required argument: <path>"),console.error('Run "asm link --help" for usage.'),process.exit(2);let{resolve:Z,basename:X}=await import("path"),Q=Z($),G=!1;try{await E4(Q),G=!0}catch{}let z=[];if(!G){if(z=await b4(Q),z.length===0)C(`No SKILL.md found in ${Q} or its immediate subdirectories.`),process.exit(1);if(q.flags.name&&z.length>1)C(`--name cannot be used when linking multiple skills (found ${z.length} skills). Link each skill individually to use --name.`),process.exit(2)}let J=await v(),{provider:U}=await p0(J,q.flags.provider,!!process.stdin.isTTY),{resolveProviderPath:H}=await import("./chunk-v3wdjh4r.js"),_=H(J.providers.find((O)=>O.name===U.name).global);if(G){let O=q.flags.name?_0(q.flags.name):X(Q),T;try{T=await e4(Q,_,O,!!q.flags.force)}catch(B){let F=B instanceof Error?B.message:String(B);if(q.flags.json)console.log(m({success:!1,error:F}));else C(F);process.exit(2)}if(q.flags.json)console.log(m({success:!0,...T}));else console.error(Y.green(`Done! Linked "${T.name}" -> ${T.targetPath}`)),console.error(` Symlink: ${T.symlinkPath}`),console.error(Y.dim(` If you move or delete the source, run "asm uninstall ${T.name}" to clean up.`));return}console.error(`Found ${Y.bold(String(z.length))} skill(s) in ${Q}:`);for(let O of z)console.error(` ${Y.bold(O.name)} ${Y.dim(`v${O.version}`)} ${Y.dim(`(${O.dirName}/)`)}`);if(process.stdin.isTTY&&!q.flags.force){process.stderr.write(`
|
|
517
|
+
${Y.bold(`Link ${z.length} skill(s)?`)} [Y/n] `);let O=await n();if(O.toLowerCase()==="n"||O.toLowerCase()==="no")console.error("Aborted."),process.exit(0)}let V=[],W=[];for(let O of z){let T=q.flags.name&&z.length===1?_0(q.flags.name):O.dirName;try{let B=await e4(O.absPath,_,T,!!q.flags.force);if(V.push(B),!q.flags.json)console.error(Y.green(` Linked "${B.name}" -> ${B.targetPath}`))}catch(B){let F=B instanceof Error?B.message:String(B);if(W.push({name:O.name,error:F}),!q.flags.json)console.error(Y.red(` Failed to link "${O.name}": ${F}`))}}if(q.flags.json)console.log(m({success:W.length===0,linked:V,failures:W}));else if(W.length>0)console.error(Y.yellow(`
|
|
518
|
+
${V.length} linked, ${W.length} failed.`));else console.error(Y.green(`
|
|
519
|
+
Done! Linked ${V.length} skill(s) successfully.`));if(W.length>0)process.exit(1)}function kU(){console.log(`${Y.bold("Usage:")} asm index <subcommand> [options]
|
|
508
520
|
|
|
509
521
|
Manage the skill index for searching available skills from indexed repos.
|
|
510
522
|
|
|
511
|
-
${
|
|
523
|
+
${Y.bold("Subcommands:")}
|
|
512
524
|
ingest <repo> Ingest a skill repository into the index
|
|
513
525
|
search <query> Search indexed skills by name or description
|
|
514
526
|
list List all indexed repositories
|
|
515
527
|
remove <owner/repo> Remove a repo from the index
|
|
516
528
|
|
|
517
|
-
${
|
|
529
|
+
${Y.bold("Options:")}
|
|
518
530
|
--json Output as JSON
|
|
519
531
|
--has <field> Only show skills that have <field> (license, creator, version)
|
|
520
532
|
--missing <field> Only show skills missing <field> (license, creator, version)
|
|
@@ -522,16 +534,48 @@ ${H.bold("Options:")}
|
|
|
522
534
|
--no-color Disable ANSI colors
|
|
523
535
|
-V, --verbose Show debug output
|
|
524
536
|
|
|
525
|
-
${
|
|
526
|
-
asm index ingest github:obra/superpowers ${
|
|
527
|
-
asm index search code review ${
|
|
528
|
-
asm index search marketing --has license ${
|
|
529
|
-
asm index search "" --missing creator ${
|
|
530
|
-
asm index list ${
|
|
531
|
-
asm index remove obra/superpowers ${
|
|
532
|
-
`));for(let z of
|
|
533
|
-
`)}}break}case"list":{let Z=await
|
|
534
|
-
`));for(let Q of Z)console.error(`${
|
|
537
|
+
${Y.bold("Examples:")}
|
|
538
|
+
asm index ingest github:obra/superpowers ${Y.dim("Index superpowers repo")}
|
|
539
|
+
asm index search code review ${Y.dim("Search for skills")}
|
|
540
|
+
asm index search marketing --has license ${Y.dim("Only with license")}
|
|
541
|
+
asm index search "" --missing creator ${Y.dim("Skills missing creator")}
|
|
542
|
+
asm index list ${Y.dim("List indexed repos")}
|
|
543
|
+
asm index remove obra/superpowers ${Y.dim("Remove from index")}`)}async function vU(q){if(q.flags.help){kU();return}let $=q.subcommand;if(!$)C("Missing subcommand. Use: ingest, search, list, or remove"),console.error('Run "asm index --help" for usage.'),process.exit(2);switch($){case"ingest":{let Z=q.positional[0];if(!Z)C("Missing required argument: <repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);console.error(Y.blueBold(`Ingesting ${Z}...`));let X=await s4(Z);if(!X.success)C(`Failed to ingest: ${X.error}`),process.exit(1);if(X.repoIndex)if(q.flags.json)console.log(m({success:!0,owner:X.repoIndex.owner,repo:X.repoIndex.repo,skillCount:X.repoIndex.skillCount,updatedAt:X.repoIndex.updatedAt}));else console.error(Y.green(`Successfully indexed ${X.repoIndex.owner}/${X.repoIndex.repo}`)),console.error(` Skills found: ${X.repoIndex.skillCount}`);break}case"search":{let Z=q.positional.join(" ");if(!Z&&q.flags.has.length===0&&q.flags.missing.length===0)C("Missing required argument: <query>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let X={};if(q.flags.has.length>0)X.has=q.flags.has;if(q.flags.missing.length>0)X.missing=q.flags.missing;let G=X.has||X.missing?await W$(Z||"",20,X):await W$(Z);if(G.length===0){if(q.flags.json)console.log(m([]));else console.info("No skills found matching your query."),console.error(Y.dim("Try ingesting more repos with: asm index ingest <repo>"));return}if(q.flags.json)console.log(m(G.map((z)=>({name:z.skill.name,description:z.skill.description,version:z.skill.version,license:z.skill.license||"",creator:z.skill.creator||"",compatibility:z.skill.compatibility||"",allowedTools:z.skill.allowedTools||[],verified:z.skill.verified===!0,installUrl:z.skill.installUrl,installCommand:`asm install ${z.skill.installUrl}`,repo:`${z.repo.owner}/${z.repo.repo}`}))));else{console.error(Y.bold(`Found ${G.length} skills:
|
|
544
|
+
`));for(let z of G){let J=z.skill.verified?Y.blue(" [verified]"):"";console.error(`${Y.cyan(z.skill.name)} ${Y.dim(`v${z.skill.version}`)}${J} ${Y.dim(`[${z.repo.owner}/${z.repo.repo}]`)}`);for(let H of _5(z.skill.description,80))console.error(` ${H}`);let U=a4(z.skill);if(U.length>0)console.error(` ${Y.yellow(`⚠ Missing: ${U.join(", ")}`)}`);console.error(` ${Y.green(`asm install ${z.skill.installUrl}`)}
|
|
545
|
+
`)}}break}case"list":{let Z=await r4();if(Z.length===0){if(q.flags.json)console.log(m([]));else console.info("No repositories indexed."),console.error(Y.dim("Add repos with: asm index ingest <repo>"));return}let X=await i4();if(q.flags.json)console.log(m(Z));else{console.error(Y.bold(`Indexed Repositories (${X} total skills):
|
|
546
|
+
`));for(let Q of Z)console.error(`${Y.cyan(`${Q.owner}/${Q.repo}`)} - ${Q.skillCount} skills ${Y.dim(`(${new Date(Q.updatedAt).toLocaleDateString()})`)}`)}break}case"remove":{let Z=q.positional[0];if(!Z)C("Missing required argument: <owner/repo>"),console.error('Run "asm index --help" for usage.'),process.exit(2);let[X,Q]=Z.split("/");if(!X||!Q)C("Invalid format. Use: <owner/repo>"),process.exit(2);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`${Y.bold("Remove")} ${Y.cyan(`${X}/${Q}`)} ${Y.bold("from index?")} [y/N] `);let z=await n();if(z.toLowerCase()!=="y"&&z.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}if(await t4(X,Q))console.error(Y.green(`Removed ${X}/${Q} from index`));else C(`Repository not found in index: ${X}/${Q}`),process.exit(1);break}default:C(`Unknown subcommand: "${$}"`),console.error('Run "asm index --help" for usage.'),process.exit(2)}}function uU(){console.log(`${Y.bold("Usage:")} asm bundle <subcommand> [options]
|
|
547
|
+
|
|
548
|
+
Create, install, and manage curated skill bundles. A bundle is a reusable
|
|
549
|
+
recipe of skills for a particular workflow, domain, or project setup.
|
|
550
|
+
|
|
551
|
+
${Y.bold("Subcommands:")}
|
|
552
|
+
create <name> Create a new bundle from installed skills
|
|
553
|
+
install <name|file> Install all skills from a bundle
|
|
554
|
+
list List all saved bundles
|
|
555
|
+
show <name|file> Show bundle details
|
|
556
|
+
remove <name> Remove a saved bundle
|
|
557
|
+
|
|
558
|
+
${Y.bold("Options:")}
|
|
559
|
+
-s, --scope <s> Filter: global, project, or both (default: both)
|
|
560
|
+
-y, --yes Skip confirmation prompts
|
|
561
|
+
--json Output as JSON
|
|
562
|
+
--no-color Disable ANSI colors
|
|
563
|
+
-V, --verbose Show debug output
|
|
564
|
+
|
|
565
|
+
${Y.bold("Examples:")}
|
|
566
|
+
asm bundle create my-workflow ${Y.dim("Create from installed skills")}
|
|
567
|
+
asm bundle install my-workflow ${Y.dim("Install a saved bundle")}
|
|
568
|
+
asm bundle install ./bundle.json ${Y.dim("Install from file")}
|
|
569
|
+
asm bundle list ${Y.dim("Show all saved bundles")}
|
|
570
|
+
asm bundle list --json ${Y.dim("List bundles as JSON")}
|
|
571
|
+
asm bundle show my-workflow ${Y.dim("Show bundle details")}
|
|
572
|
+
asm bundle remove my-workflow ${Y.dim("Remove a saved bundle")}`)}async function mU(q){if(q.flags.help){uU();return}let $=q.subcommand;if(!$)C("Missing subcommand. Use: create, install, list, show, or remove"),console.error('Run "asm bundle --help" for usage.'),process.exit(2);switch($){case"create":{let Z=q.positional[0];if(!Z)C("Missing required argument: <name>"),console.error("Usage: asm bundle create <name>"),process.exit(2);let X=await v(),Q=await d(X,q.flags.scope);if(Q.length===0)C("No skills found to include in the bundle."),process.exit(1);let G=new Set,z=Q.filter((B)=>{let F=B.name.toLowerCase();if(G.has(F))return!1;return G.add(F),!0}),J=z;if(process.stdin.isTTY&&!q.flags.yes){let B=z.map((L)=>({label:`${L.name} v${L.version}`,hint:L.description?L.description.slice(0,60)+(L.description.length>60?"...":""):`(${L.provider}/${L.scope})`,checked:!0}));console.error(Y.bold(`Select skills for bundle "${Z}":
|
|
573
|
+
`));let F=await w0({items:B});if(F.length===0)C("No skills selected. Bundle not created."),process.exit(1);J=F.map((L)=>z[L])}let{readLock:U}=await import("./chunk-q3gm2x0a.js"),H=await U(),_=await Promise.all(J.map((B)=>x4(B,H))),V=`Bundle of ${_.length} skills`,W="unknown";try{let{execSync:B}=await import("child_process"),F=B("git config user.name",{encoding:"utf-8"}).trim();if(F)W=F}catch{}if(process.stdin.isTTY&&!q.flags.yes){process.stderr.write(`
|
|
574
|
+
${Y.bold("Description")} (optional, press Enter to skip): `);let B=await n();if(B.trim())V=B.trim();process.stderr.write(`${Y.bold("Author")} (optional, press Enter to skip): `);let F=await n();if(F.trim())W=F.trim()}let O=y4(Z,V,W,_),T=await h4(O);if(q.flags.json)console.log(JSON.stringify(O,null,2));else console.error(Y.green(`Bundle "${Z}" created with ${_.length} skill(s).`)),console.error(` Saved to: ${Y.dim(T)}`);break}case"install":{let Z=q.positional[0];if(!Z)C("Missing required argument: <name|file>"),console.error("Usage: asm bundle install <name|file>"),process.exit(2);let X;try{X=await h2(Z)}catch(V){C(V.message),process.exit(1)}if(console.error(`${Y.bold("Bundle:")} ${X.name} (${X.skills.length} skills)`),X.description)console.error(` ${Y.dim(X.description)}`);console.error("");for(let V of X.skills){let W=V.version?` v${V.version}`:"";console.error(` ${Y.cyan(V.name)}${Y.dim(W)} ${Y.dim(`-> ${V.installUrl}`)}`)}if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`
|
|
575
|
+
${Y.bold("Install all skills from this bundle?")} [y/N] `);let V=await n();if(V.toLowerCase()!=="y"&&V.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let Q=[],G=await v(),{provider:z}=await p0(G,q.flags.provider,!1),J=q.flags.scope==="global"||q.flags.scope==="project"?q.flags.scope:"global";for(let V of X.skills){console.error(`
|
|
576
|
+
Installing ${Y.bold(V.name)}...`);try{if(V.installUrl.startsWith("github:")||V.installUrl.startsWith("https://github.com/"))await j0();let O=D0(V.installUrl),T=!!O.isLocal,B=null;try{let F,L;if(!T)B=await N0(O,q.flags.transport),F=B,L=O.subpath?XU(B,O.subpath):B;else F=O.localPath,L=O.localPath;let R=await B0(L),M=_0(V.name||R.name||O.repo),A=L$(O,F,L,M,z,q.flags.force,J);try{await z1(A.targetDir,A.force)}catch(D){if(D.message?.includes("--force")){Q.push({name:V.name,status:"skipped",reason:"Already installed. Use --force to overwrite."}),console.error(` ${Y.dim("---")} ${V.name} skipped (already installed)`);continue}throw D}await Lq(A),Q.push({name:V.name,status:"installed"}),console.error(` ${Y.green("+++")} ${V.name} installed`)}finally{if(B)await a(B)}}catch(W){Q.push({name:V.name,status:"failed",reason:W.message}),console.error(` ${Y.red("!!!")} ${V.name}: ${W.message}`)}}let U=Q.filter((V)=>V.status==="installed").length,H=Q.filter((V)=>V.status==="skipped").length,_=Q.filter((V)=>V.status==="failed").length;if(q.flags.json)console.log(JSON.stringify({bundleName:X.name,total:Q.length,installed:U,skipped:H,failed:_,results:Q},null,2));else console.error(""),console.error(`${Y.bold("Summary:")} ${Q.length} total, ${Y.green(String(U))} installed, `+(H>0?`${Y.dim(String(H))} skipped, `:"")+`${Y.red(String(_))} failed`);if(_>0)process.exitCode=1;break}case"list":{let Z=await g4();if(Z.length===0){if(q.flags.json)console.log("[]");else console.log("No bundles found."),console.error(Y.dim("Create one with: asm bundle create <name>"));return}if(q.flags.json)console.log(JSON.stringify(Z,null,2));else{console.error(Y.bold(`Saved Bundles (${Z.length}):
|
|
577
|
+
`));for(let X of Z){let Q=X.tags&&X.tags.length>0?` ${Y.dim(`[${X.tags.join(", ")}]`)}`:"";if(console.error(` ${Y.cyan(X.name)} ${Y.dim(`(${X.skills.length} skills)`)}${Q}`),X.description)console.error(` ${Y.dim(X.description)}`);if(X.author)console.error(` ${Y.dim(`by ${X.author}`)}`)}}break}case"show":{let Z=q.positional[0];if(!Z)C("Missing required argument: <name|file>"),console.error("Usage: asm bundle show <name|file>"),process.exit(2);let X;try{X=await h2(Z)}catch(Q){C(Q.message),process.exit(1)}if(q.flags.json)console.log(JSON.stringify(X,null,2));else{if(console.error(Y.bold(`Bundle: ${X.name}`)),X.description)console.error(` ${X.description}`);if(X.author)console.error(` ${Y.dim(`Author: ${X.author}`)}`);if(console.error(` ${Y.dim(`Created: ${new Date(X.createdAt).toLocaleString()}`)}`),X.tags&&X.tags.length>0)console.error(` ${Y.dim(`Tags: ${X.tags.join(", ")}`)}`);console.error(`
|
|
578
|
+
${Y.bold(`Skills (${X.skills.length})`)}:`);for(let Q of X.skills){let G=Q.version?` v${Q.version}`:"";if(console.error(` ${Y.cyan(Q.name)}${Y.dim(G)}`),Q.description)console.error(` ${Y.dim(Q.description)}`);console.error(` ${Y.dim(`install: ${Q.installUrl}`)}`)}}break}case"remove":{let Z=q.positional[0];if(!Z)C("Missing required argument: <name>"),console.error("Usage: asm bundle remove <name>"),process.exit(2);if(!q.flags.yes&&process.stdin.isTTY){process.stderr.write(`${Y.bold("Remove bundle")} ${Y.cyan(Z)}${Y.bold("?")} [y/N] `);let Q=await n();if(Q.toLowerCase()!=="y"&&Q.toLowerCase()!=="yes")console.error("Aborted."),process.exit(0)}let X;try{X=await k4(Z)}catch(Q){C(Q.message),process.exit(1)}if(X)console.error(Y.green(`Bundle "${Z}" removed.`));else C(`Bundle "${Z}" not found.`),process.exit(1);break}default:C(`Unknown subcommand: "${$}". Use: create, install, list, show, or remove`),console.error('Run "asm bundle --help" for usage.'),process.exit(2)}}async function A5(q){let $=QU(q);if($.flags.noColor)globalThis.__CLI_NO_COLOR=!0;if($.flags.verbose)q5(!0);if($.flags.version){console.log(`asm ${n2}`);return}if(!$.command&&$.flags.help){GU();return}if(!$.command)return;switch($.command){case"list":await WU($);break;case"search":await _U($);break;case"inspect":await BU($);break;case"uninstall":await OU($);break;case"audit":await FU($);break;case"install":await jU($);break;case"config":await RU($);break;case"export":await PU($);break;case"import":await EU($);break;case"init":await bU($);break;case"stats":await yU($);break;case"link":await gU($);break;case"index":await vU($);break;case"bundle":await mU($);break;default:C(`Unknown command: "${$.command}"`),console.error('Run "asm --help" for usage.'),process.exit(2)}}function I5(q){let $=q.slice(2);if($.length===0)return!1;let Z=["list","search","inspect","uninstall","audit","config","install","export","import","init","stats","link","index","bundle"],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(I5(process.argv))await A5(process.argv);else if(!(typeof globalThis.Bun<"u")){let{spawn:$}=await import("child_process"),Z=$("bun",[process.argv[1],...process.argv.slice(2)],{stdio:"inherit"});Z.on("error",()=>{console.error(`The interactive TUI requires Bun (https://bun.sh).
|
|
535
579
|
Install it with: curl -fsSL https://bun.sh/install | bash
|
|
536
580
|
|
|
537
|
-
`+"CLI commands (list, search, inspect, etc.) work with Node.js — run: asm --help"),process.exit(1)}),Z.on("exit",(X)=>process.exit(X??0))}else await import("./chunk-
|
|
581
|
+
`+"CLI commands (list, search, inspect, etc.) work with Node.js — run: asm --help"),process.exit(1)}),Z.on("exit",(X)=>process.exit(X??0))}else await import("./chunk-33wmae4f.js");
|