agent-skill-manager 2.19.0 → 2.20.1
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 +42 -10
- package/data/repo-stars.json +37 -37
- package/data/skill-index/Affitor_affiliate-skills.json +171 -171
- package/data/skill-index/AvdLee_Core-Data-Agent-Skill.json +4 -4
- package/data/skill-index/AvdLee_Swift-Concurrency-Agent-Skill.json +4 -4
- package/data/skill-index/AvdLee_Swift-Testing-Agent-Skill.json +4 -4
- package/data/skill-index/AvdLee_SwiftUI-Agent-Skill.json +12 -12
- package/data/skill-index/AvdLee_Xcode-Build-Optimization-Agent-Skill.json +25 -25
- package/data/skill-index/ComposioHQ_awesome-claude-skills.json +2602 -2602
- package/data/skill-index/DietrichGebert_ponytail.json +24 -24
- package/data/skill-index/Dimillian_Skills.json +57 -57
- package/data/skill-index/Egonex-AI_Understand-Anything.json +32 -32
- package/data/skill-index/Eronred_aso-skills.json +130 -130
- package/data/skill-index/GPTomics_bioSkills.json +1859 -1859
- package/data/skill-index/Galaxy-Dawn_claude-scholar.json +159 -159
- package/data/skill-index/Imbad0202_academic-research-skills.json +27 -27
- package/data/skill-index/JuliusBrussee_caveman.json +66 -66
- package/data/skill-index/K-Dense-AI_claude-scientific-skills.json +1017 -663
- package/data/skill-index/Leonxlnx_taste-skill.json +47 -47
- package/data/skill-index/Master-cai_Research-Paper-Writing-Skills.json +4 -4
- package/data/skill-index/MiniMax-AI_skills.json +82 -82
- package/data/skill-index/Nutlope_hallmark.json +4 -4
- package/data/skill-index/Paramchoudhary_ResumeSkills.json +74 -74
- package/data/skill-index/ParthJadhav_app-store-screenshots.json +4 -4
- package/data/skill-index/addyosmani_agent-skills.json +86 -86
- package/data/skill-index/affaan-m_ECC.json +4207 -3127
- package/data/skill-index/affaan-m_everything-claude-code.json +4207 -3127
- package/data/skill-index/alirezarezvani_claude-skills.json +1336 -1336
- package/data/skill-index/anthropics_skills.json +69 -69
- package/data/skill-index/antithesishq_antithesis-skills.json +44 -44
- package/data/skill-index/antonbabenko_terraform-skill.json +4 -4
- package/data/skill-index/ayghri_i-have-adhd.json +5 -5
- package/data/skill-index/badlogic_pi-skills.json +29 -29
- package/data/skill-index/blader_humanizer.json +4 -4
- package/data/skill-index/briiirussell_cybersecurity-skills.json +96 -96
- package/data/skill-index/bytedance_deer-flow.json +92 -92
- package/data/skill-index/cathrynlavery_diagram-design.json +6 -6
- package/data/skill-index/charlie947_answer-first.json +4 -4
- package/data/skill-index/charlie947_voiceprint.json +4 -4
- package/data/skill-index/cloudai-x_threejs-skills.json +36 -36
- package/data/skill-index/coreyhaines31_marketingskills.json +160 -160
- package/data/skill-index/davidondrej_skills.json +1443 -3684
- package/data/skill-index/emilkowalski_skills.json +45 -45
- package/data/skill-index/entireio_skills.json +44 -44
- package/data/skill-index/garrytan_gstack.json +234 -234
- package/data/skill-index/github_awesome-copilot.json +1273 -1273
- package/data/skill-index/google-labs-code_design.md.json +17 -17
- package/data/skill-index/google_skills.json +884 -512
- package/data/skill-index/hardikpandya_stop-slop.json +4 -4
- package/data/skill-index/heygen-com_hyperframes.json +133 -121
- package/data/skill-index/himself65_finance-skills.json +87 -87
- package/data/skill-index/ivan-magda_uikit-expert-skill.json +4 -4
- package/data/skill-index/kemiljk_fluid-design.json +4 -4
- package/data/skill-index/kepano_obsidian-skills.json +239 -20
- package/data/skill-index/luongnv89_asm.json +38 -38
- package/data/skill-index/luongnv89_idd.json +26 -26
- package/data/skill-index/luongnv89_skills.json +133 -133
- package/data/skill-index/majidmanzarpour_threejs-game-skills.json +38 -38
- package/data/skill-index/mattpocock_skills.json +119 -119
- package/data/skill-index/multica-ai_andrej-karpathy-skills.json +4 -4
- package/data/skill-index/mvanhorn_last30days-skill.json +5 -5
- package/data/skill-index/nextlevelbuilder_ui-ux-pro-max-skill.json +29 -29
- package/data/skill-index/obra_superpowers.json +49 -49
- package/data/skill-index/oliver-zehentleitner_keep-the-why.json +16 -16
- package/data/skill-index/openai_skills.json +139 -139
- package/data/skill-index/pbakaus_impeccable.json +4 -4
- package/data/skill-index/romainsimon_paperasse.json +26 -26
- package/data/skill-index/rudrankriyam_app-store-connect-cli-skills.json +85 -85
- package/data/skill-index/santifer_career-ops.json +21 -21
- package/data/skill-index/sickn33_antigravity-awesome-skills.json +9766 -8662
- package/data/skill-index/slavingia_skills.json +38 -38
- package/data/skill-index/tt-a1i_archify.json +4 -4
- package/data/skill-index/twostraws_Swift-Concurrency-Agent-Skill.json +4 -4
- package/data/skill-index/twostraws_Swift-Testing-Agent-Skill.json +4 -4
- package/data/skill-index/twostraws_SwiftData-Agent-Skill.json +4 -4
- package/data/skill-index/twostraws_SwiftUI-Agent-Skill.json +4 -4
- package/data/skill-index/warpdotdev_oz-skills.json +52 -52
- package/data/skill-index/zarazhangrui_follow-builders.json +4 -4
- package/data/skill-index/zarazhangrui_frontend-slides.json +4 -4
- package/dist/agent-skill-manager.js +179 -172
- package/dist/chunk-3PSIW3HK.js +176 -0
- package/dist/{chunk-3KGAHUVB.js → chunk-ATTTEI26.js} +1 -1
- package/dist/chunk-HODWB56T.js +3 -0
- package/dist/config-5X2UQBDB.js +2 -0
- package/dist/{lock-UEL3CMOV.js → lock-6JXXQRLX.js} +1 -1
- package/dist/src-4LZV7HQG.js +119 -0
- package/package.json +17 -17
- package/dist/chunk-CBDNF2SR.js +0 -166
- package/dist/chunk-KWWFXT5F.js +0 -3
- package/dist/config-JPFUVYBM.js +0 -2
- package/dist/src-ORQ3FXUL.js +0 -119
package/dist/chunk-CBDNF2SR.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { createRequire as __asmCreateRequire } from 'node:module'; const require = __asmCreateRequire(import.meta.url);
|
|
2
|
-
import{b as q,q as ce}from"./chunk-KWWFXT5F.js";import{a as mt,b as S,d as Ja}from"./chunk-RSVWCEZR.js";var I=S(D=>{"use strict";var Cn=Symbol.for("yaml.alias"),Ai=Symbol.for("yaml.document"),gt=Symbol.for("yaml.map"),Ci=Symbol.for("yaml.pair"),En=Symbol.for("yaml.scalar"),yt=Symbol.for("yaml.seq"),W=Symbol.for("yaml.node.type"),Wa=n=>!!n&&typeof n=="object"&&n[W]===Cn,Ga=n=>!!n&&typeof n=="object"&&n[W]===Ai,Ha=n=>!!n&&typeof n=="object"&&n[W]===gt,Qa=n=>!!n&&typeof n=="object"&&n[W]===Ci,Ei=n=>!!n&&typeof n=="object"&&n[W]===En,za=n=>!!n&&typeof n=="object"&&n[W]===yt;function Ii(n){if(n&&typeof n=="object")switch(n[W]){case gt:case yt:return!0}return!1}function Xa(n){if(n&&typeof n=="object")switch(n[W]){case Cn:case gt:case En:case yt:return!0}return!1}var Za=n=>(Ei(n)||Ii(n))&&!!n.anchor;D.ALIAS=Cn;D.DOC=Ai;D.MAP=gt;D.NODE_TYPE=W;D.PAIR=Ci;D.SCALAR=En;D.SEQ=yt;D.hasAnchor=Za;D.isAlias=Wa;D.isCollection=Ii;D.isDocument=Ga;D.isMap=Ha;D.isNode=Xa;D.isPair=Qa;D.isScalar=Ei;D.isSeq=za});var _e=S(In=>{"use strict";var _=I(),R=Symbol("break visit"),Li=Symbol("skip children"),Y=Symbol("remove node");function bt(n,e){let t=Ti(e);_.isDocument(n)?Se(null,n.contents,t,Object.freeze([n]))===Y&&(n.contents=null):Se(null,n,t,Object.freeze([]))}bt.BREAK=R;bt.SKIP=Li;bt.REMOVE=Y;function Se(n,e,t,s){let i=Oi(n,e,t,s);if(_.isNode(i)||_.isPair(i))return Pi(n,s,i),Se(n,i,t,s);if(typeof i!="symbol"){if(_.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=Se(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===R)return R;o===Y&&(e.items.splice(r,1),r-=1)}}}else if(_.isPair(e)){s=Object.freeze(s.concat(e));let r=Se("key",e.key,t,s);if(r===R)return R;r===Y&&(e.key=null);let o=Se("value",e.value,t,s);if(o===R)return R;o===Y&&(e.value=null)}}return i}async function vt(n,e){let t=Ti(e);_.isDocument(n)?await we(null,n.contents,t,Object.freeze([n]))===Y&&(n.contents=null):await we(null,n,t,Object.freeze([]))}vt.BREAK=R;vt.SKIP=Li;vt.REMOVE=Y;async function we(n,e,t,s){let i=await Oi(n,e,t,s);if(_.isNode(i)||_.isPair(i))return Pi(n,s,i),we(n,i,t,s);if(typeof i!="symbol"){if(_.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=await we(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===R)return R;o===Y&&(e.items.splice(r,1),r-=1)}}}else if(_.isPair(e)){s=Object.freeze(s.concat(e));let r=await we("key",e.key,t,s);if(r===R)return R;r===Y&&(e.key=null);let o=await we("value",e.value,t,s);if(o===R)return R;o===Y&&(e.value=null)}}return i}function Ti(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Oi(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(_.isMap(e))return t.Map?.(n,e,s);if(_.isSeq(e))return t.Seq?.(n,e,s);if(_.isPair(e))return t.Pair?.(n,e,s);if(_.isScalar(e))return t.Scalar?.(n,e,s);if(_.isAlias(e))return t.Alias?.(n,e,s)}function Pi(n,e,t){let s=e[e.length-1];if(_.isCollection(s))s.items[n]=t;else if(_.isPair(s))n==="key"?s.key=t:s.value=t;else if(_.isDocument(s))s.contents=t;else{let i=_.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}In.visit=bt;In.visitAsync=vt});var Ln=S(Mi=>{"use strict";var qi=I(),el=_e(),tl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},nl=n=>n.replace(/[!,[\]{}]/g,e=>tl[e]),De=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+nl(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(e&&s.length>0&&qi.isNode(e.contents)){let r={};el.visit(e.contents,(o,a)=>{qi.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
3
|
-
`)}};De.defaultYaml={explicit:!1,version:"1.2"};De.defaultTags={"!!":"tag:yaml.org,2002:"};Mi.Directives=De});var St=S(xe=>{"use strict";var _i=I(),sl=_e();function il(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Di(n){let e=new Set;return sl.visit(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function xi(n,e){for(let t=1;;++t){let s=`${n}${t}`;if(!e.has(s))return s}}function rl(n,e){let t=[],s=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Di(n));let o=xi(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=s.get(r);if(typeof o=="object"&&o.anchor&&(_i.isScalar(o.node)||_i.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}xe.anchorIsValid=il;xe.anchorNames=Di;xe.createNodeAnchors=rl;xe.findNewAnchor=xi});var Tn=S(Ri=>{"use strict";function Re(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){let o=s[i],a=Re(n,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let r=s.get(i),o=Re(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(let i of Array.from(s)){let r=Re(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(let[i,r]of Object.entries(s)){let o=Re(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}Ri.applyReviver=Re});var H=S(ji=>{"use strict";var ol=I();function Bi(n,e,t){if(Array.isArray(n))return n.map((s,i)=>Bi(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!ol.hasAnchor(n))return n.toJSON(e,t);let s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};let i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}ji.toJS=Bi});var wt=S(Ki=>{"use strict";var al=Tn(),Fi=I(),ll=H(),On=class{constructor(e){Object.defineProperty(this,Fi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Fi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=ll.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?al.applyReviver(r,{"":a},"",a):a}};Ki.NodeBase=On});var Be=S(Ui=>{"use strict";var cl=St(),ul=_e(),ke=I(),fl=wt(),dl=H(),Pn=class extends fl.NodeBase{constructor(e){super(ke.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],ul.visit(e,{Node:(r,o)=>{(ke.isAlias(o)||ke.hasAnchor(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(let r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=s.get(o);if(a||(dl.toJS(o,null,t),a=s.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=kt(i,o,s)),a.count*a.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,s){let i=`*${this.source}`;if(e){if(cl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function kt(n,e,t){if(ke.isAlias(e)){let s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(ke.isCollection(e)){let s=0;for(let i of e.items){let r=kt(n,i,t);r>s&&(s=r)}return s}else if(ke.isPair(e)){let s=kt(n,e.key,t),i=kt(n,e.value,t);return Math.max(s,i)}return 1}Ui.Alias=Pn});var M=S(qn=>{"use strict";var pl=I(),hl=wt(),ml=H(),gl=n=>!n||typeof n!="function"&&typeof n!="object",Q=class extends hl.NodeBase{constructor(e){super(pl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:ml.toJS(this.value,e,t)}toString(){return String(this.value)}};Q.BLOCK_FOLDED="BLOCK_FOLDED";Q.BLOCK_LITERAL="BLOCK_LITERAL";Q.PLAIN="PLAIN";Q.QUOTE_DOUBLE="QUOTE_DOUBLE";Q.QUOTE_SINGLE="QUOTE_SINGLE";qn.Scalar=Q;qn.isScalarValue=gl});var je=S(Yi=>{"use strict";var yl=Be(),ue=I(),Vi=M(),bl="tag:yaml.org,2002:";function vl(n,e,t){if(e){let s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function Sl(n,e,t){if(ue.isDocument(n)&&(n=n.contents),ue.isNode(n))return n;if(ue.isPair(n)){let u=t.schema[ue.MAP].createNode?.(t.schema,null,t);return u.items.push(n),u}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(s&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=i(n)),new yl.Alias(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=bl+e.slice(2));let c=vl(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let u=new Vi.Scalar(n);return l&&(l.node=u),u}c=n instanceof Map?o[ue.MAP]:Symbol.iterator in Object(n)?o[ue.SEQ]:o[ue.MAP]}r&&(r(c),delete t.onTagObj);let d=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new Vi.Scalar(n);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}Yi.createNode=Sl});var Nt=S($t=>{"use strict";var wl=je(),J=I(),kl=wt();function Mn(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return wl.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var Ji=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,_n=class extends kl.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>J.isNode(s)||J.isPair(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ji(e))this.add(t);else{let[s,...i]=e,r=this.get(s,!0);if(J.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,Mn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let i=this.get(t,!0);if(J.isCollection(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&J.isScalar(r)?r.value:r:J.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!J.isPair(t))return!1;let s=t.value;return s==null||e&&J.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let i=this.get(t,!0);return J.isCollection(i)?i.hasIn(s):!1}setIn(e,t){let[s,...i]=e;if(i.length===0)this.set(s,t);else{let r=this.get(s,!0);if(J.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,Mn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};$t.Collection=_n;$t.collectionFromPath=Mn;$t.isEmptyPath=Ji});var Fe=S(At=>{"use strict";var $l=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Dn(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var Nl=(n,e,t)=>n.endsWith(`
|
|
4
|
-
`)?Dn(t,e):t.includes(`
|
|
5
|
-
`)?`
|
|
6
|
-
`+Dn(t,e):(n.endsWith(" ")?"":" ")+t;At.indentComment=Dn;At.lineComment=Nl;At.stringifyComment=$l});var Gi=S(Ke=>{"use strict";var Al="flow",xn="block",Ct="quoted";function Cl(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return n;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(n.length<=l)return n;let c=[],d={},u=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):u=i-s);let f,h,m=!1,p=-1,g=-1,b=-1;t===xn&&(p=Wi(n,p,e.length),p!==-1&&(u=p+l));for(let $;$=n[p+=1];){if(t===Ct&&$==="\\"){switch(g=p,n[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}b=p}if($===`
|
|
7
|
-
`)t===xn&&(p=Wi(n,p,e.length)),u=p+e.length+l,f=void 0;else{if($===" "&&h&&h!==" "&&h!==`
|
|
8
|
-
`&&h!==" "){let N=n[p+1];N&&N!==" "&&N!==`
|
|
9
|
-
`&&N!==" "&&(f=p)}if(p>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===Ct){for(;h===" "||h===" ";)h=$,$=n[p+=1],m=!0;let N=p>b+1?p-2:g-1;if(d[N])return n;c.push(N),d[N]=!0,u=N+l,f=void 0}else m=!0}h=$}if(m&&a&&a(),c.length===0)return n;o&&o();let v=n.slice(0,c[0]);for(let $=0;$<c.length;++$){let N=c[$],A=c[$+1]||n.length;N===0?v=`
|
|
10
|
-
${e}${n.slice(0,A)}`:(t===Ct&&d[N]&&(v+=`${n[N]}\\`),v+=`
|
|
11
|
-
${e}${n.slice(N+1,A)}`)}return v}function Wi(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
|
|
12
|
-
`);s=e,i=e+1,r=n[i]}return s}Ke.FOLD_BLOCK=xn;Ke.FOLD_FLOW=Al;Ke.FOLD_QUOTED=Ct;Ke.foldFlowLines=Cl});var Ve=S(Hi=>{"use strict";var F=M(),z=Gi(),It=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Lt=n=>/^(%|---|\.\.\.)/m.test(n);function El(n,e,t){if(!e||e<0)return!1;let s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
|
|
13
|
-
`){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function Ue(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Lt(n)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let d=t.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
|
|
14
|
-
|
|
15
|
-
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
16
|
-
`,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,s?o:z.foldFlowLines(o,r,z.FOLD_QUOTED,It(e,!1))}function Rn(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return Ue(n,e);let t=e.indent||(Lt(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
-
${t}`)+"'";return e.implicitKey?s:z.foldFlowLines(s,t,z.FOLD_FLOW,It(e,!1))}function $e(n,e){let{singleQuote:t}=e.options,s;if(t===!1)s=Ue;else{let i=n.includes('"'),r=n.includes("'");i&&!r?s=Rn:r&&!i?s=Ue:s=t?Rn:Ue}return s(n,e)}var Bn;try{Bn=new RegExp(`(^|(?<!
|
|
19
|
-
))
|
|
20
|
-
+(?!
|
|
21
|
-
|$)`,"g")}catch{Bn=/\n+(?!\n|$)/g}function Et({comment:n,type:e,value:t},s,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(t))return $e(t,s);let c=s.indent||(s.forceBlockIndent||Lt(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===F.Scalar.BLOCK_FOLDED?!1:e===F.Scalar.BLOCK_LITERAL?!0:!El(t,l,c.length);if(!t)return d?`|
|
|
22
|
-
`:`>
|
|
23
|
-
`;let u,f;for(f=t.length;f>0;--f){let A=t[f-1];if(A!==`
|
|
24
|
-
`&&A!==" "&&A!==" ")break}let h=t.substring(f),m=h.indexOf(`
|
|
25
|
-
`);m===-1?u="-":t===h||m!==h.length-1?(u="+",r&&r()):u="",h&&(t=t.slice(0,-h.length),h[h.length-1]===`
|
|
26
|
-
`&&(h=h.slice(0,-1)),h=h.replace(Bn,`$&${c}`));let p=!1,g,b=-1;for(g=0;g<t.length;++g){let A=t[g];if(A===" ")p=!0;else if(A===`
|
|
27
|
-
`)b=g;else break}let v=t.substring(0,b<g?b+1:g);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let N=(p?c?"2":"1":"")+u;if(n&&(N+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){let A=t.replace(/\n+/g,`
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),E=!1,T=It(s,!0);o!=="folded"&&e!==F.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{E=!0});let w=z.foldFlowLines(`${v}${A}${h}`,c,z.FOLD_BLOCK,T);if(!E)return`>${N}
|
|
29
|
-
${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${N}
|
|
30
|
-
${c}${v}${t}${h}`}function Il(n,e,t,s){let{type:i,value:r}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&r.includes(`
|
|
31
|
-
`)||d&&/[[\]{},]/.test(r))return $e(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
|
|
32
|
-
`)?$e(r,e):Et(n,e,t,s);if(!a&&!d&&i!==F.Scalar.PLAIN&&r.includes(`
|
|
33
|
-
`))return Et(n,e,t,s);if(Lt(r)){if(l==="")return e.forceBlockIndent=!0,Et(n,e,t,s);if(a&&l===c)return $e(r,e)}let u=r.replace(/\n+/g,`$&
|
|
34
|
-
${l}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:h,tags:m}=e.doc.schema;if(m.some(f)||h?.some(f))return $e(r,e)}return a?u:z.foldFlowLines(u,l,z.FOLD_FLOW,It(e,!1))}function Ll(n,e,t,s){let{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==F.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=F.Scalar.QUOTE_DOUBLE);let l=d=>{switch(d){case F.Scalar.BLOCK_FOLDED:case F.Scalar.BLOCK_LITERAL:return i||r?$e(o.value,e):Et(o,e,t,s);case F.Scalar.QUOTE_DOUBLE:return Ue(o.value,e);case F.Scalar.QUOTE_SINGLE:return Rn(o.value,e);case F.Scalar.PLAIN:return Il(o,e,t,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=i&&d||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}Hi.stringifyString=Ll});var Ye=S(jn=>{"use strict";var Tl=St(),X=I(),Ol=Fe(),Pl=Ve();function ql(n,e){let t=Object.assign({blockQuote:!0,commentString:Ol.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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function Ml(n,e){if(e.tag){let i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(X.isScalar(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){let i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function _l(n,e,{anchors:t,doc:s}){if(!s.directives)return"";let i=[],r=(X.isScalar(n)||X.isCollection(n))&&n.anchor;r&&Tl.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function Dl(n,e,t,s){if(X.isPair(n))return n.toString(e,t,s);if(X.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i,r=X.isNode(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=Ml(e.doc.schema.tags,r));let o=_l(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,s):X.isScalar(r)?Pl.stringifyString(r,e,t,s):r.toString(e,t,s);return o?X.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
-
${e.indent}${a}`:a}jn.createStringifyContext=ql;jn.stringify=Dl});var Zi=S(Xi=>{"use strict";var G=I(),Qi=M(),zi=Ye(),Je=Fe();function xl({key:n,value:e},t,s,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=t,f=G.isNode(n)&&n.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(G.isCollection(n)||!G.isNode(n)&&typeof n=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let h=!u&&(!n||f&&e==null&&!t.inFlow||G.isCollection(n)||(G.isScalar(n)?n.type===Qi.Scalar.BLOCK_FOLDED||n.type===Qi.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!h&&(u||!r),indent:a+l});let m=!1,p=!1,g=zi.stringify(n,t,()=>m=!0,()=>p=!0);if(!h&&!t.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(t.inFlow){if(r||e==null)return m&&s&&s(),g===""?"?":h?`? ${g}`:g}else if(r&&!u||e==null&&h)return g=`? ${g}`,f&&!m?g+=Je.lineComment(g,t.indent,c(f)):p&&i&&i(),g;m&&(f=null),h?(f&&(g+=Je.lineComment(g,t.indent,c(f))),g=`? ${g}
|
|
36
|
-
${a}:`):(g=`${g}:`,f&&(g+=Je.lineComment(g,t.indent,c(f))));let b,v,$;G.isNode(e)?(b=!!e.spaceBefore,v=e.commentBefore,$=e.comment):(b=!1,v=null,$=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!h&&!f&&G.isScalar(e)&&(t.indentAtStart=g.length+1),p=!1,!d&&l.length>=2&&!t.inFlow&&!h&&G.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1,A=zi.stringify(e,t,()=>N=!0,()=>p=!0),E=" ";if(f||b||v){if(E=b?`
|
|
37
|
-
`:"",v){let T=c(v);E+=`
|
|
38
|
-
${Je.indentComment(T,t.indent)}`}A===""&&!t.inFlow?E===`
|
|
39
|
-
`&&$&&(E=`
|
|
40
|
-
|
|
41
|
-
`):E+=`
|
|
42
|
-
${t.indent}`}else if(!h&&G.isCollection(e)){let T=A[0],w=A.indexOf(`
|
|
43
|
-
`),k=w!==-1,L=t.inFlow??e.flow??e.items.length===0;if(k||!L){let V=!1;if(k&&(T==="&"||T==="!")){let P=A.indexOf(" ");T==="&"&&P!==-1&&P<w&&A[P+1]==="!"&&(P=A.indexOf(" ",P+1)),(P===-1||w<P)&&(V=!0)}V||(E=`
|
|
44
|
-
${t.indent}`)}}else(A===""||A[0]===`
|
|
45
|
-
`)&&(E="");return g+=E+A,t.inFlow?N&&s&&s():$&&!N?g+=Je.lineComment(g,t.indent,c($)):p&&i&&i(),g}Xi.stringifyPair=xl});var Kn=S(Fn=>{"use strict";var er=mt("process");function Rl(n,...e){n==="debug"&&console.log(...e)}function Bl(n,e){(n==="debug"||n==="warn")&&(typeof er.emitWarning=="function"?er.emitWarning(e):console.warn(e))}Fn.debug=Rl;Fn.warn=Bl});var Mt=S(qt=>{"use strict";var Pt=I(),tr=M(),Tt="<<",Ot={identify:n=>n===Tt||typeof n=="symbol"&&n.description===Tt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new tr.Scalar(Symbol(Tt)),{addToJSMap:nr}),stringify:()=>Tt},jl=(n,e)=>(Ot.identify(e)||Pt.isScalar(e)&&(!e.type||e.type===tr.Scalar.PLAIN)&&Ot.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Ot.tag&&t.default);function nr(n,e,t){let s=sr(n,t);if(Pt.isSeq(s))for(let i of s.items)Un(n,e,i);else if(Array.isArray(s))for(let i of s)Un(n,e,i);else Un(n,e,s)}function Un(n,e,t){let s=sr(n,t);if(!Pt.isMap(s))throw new Error("Merge sources must be maps or map aliases");let i=s.toJSON(null,n,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function sr(n,e){return n&&Pt.isAlias(e)?e.resolve(n.doc,n):e}qt.addMergeToJSMap=nr;qt.isMergeKey=jl;qt.merge=Ot});var Yn=S(or=>{"use strict";var Fl=Kn(),ir=Mt(),Kl=Ye(),rr=I(),Vn=H();function Ul(n,e,{key:t,value:s}){if(rr.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(ir.isMergeKey(n,t))ir.addMergeToJSMap(n,e,s);else{let i=Vn.toJS(t,"",n);if(e instanceof Map)e.set(i,Vn.toJS(s,i,n));else if(e instanceof Set)e.add(i);else{let r=Vl(t,i,n),o=Vn.toJS(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Vl(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(rr.isNode(n)&&t?.doc){let s=Kl.createStringifyContext(t.doc,{});s.anchors=new Set;for(let r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;let i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Fl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}or.addPairToJSMap=Ul});var Z=S(Jn=>{"use strict";var ar=je(),Yl=Zi(),Jl=Yn(),_t=I();function Wl(n,e,t){let s=ar.createNode(n,void 0,t),i=ar.createNode(e,void 0,t);return new Dt(s,i)}var Dt=class n{constructor(e,t=null){Object.defineProperty(this,_t.NODE_TYPE,{value:_t.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return _t.isNode(t)&&(t=t.clone(e)),_t.isNode(s)&&(s=s.clone(e)),new n(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Jl.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Yl.stringifyPair(this,e,t,s):JSON.stringify(this)}};Jn.Pair=Dt;Jn.createPair=Wl});var Wn=S(cr=>{"use strict";var fe=I(),lr=Ye(),xt=Fe();function Gl(n,e,t){return(e.inFlow??n.flow?Ql:Hl)(n,e,t)}function Hl({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null}),u=!1,f=[];for(let m=0;m<e.length;++m){let p=e[m],g=null;if(fe.isNode(p))!u&&p.spaceBefore&&f.push(""),Rt(t,f,p.commentBefore,u),p.comment&&(g=p.comment);else if(fe.isPair(p)){let v=fe.isNode(p.key)?p.key:null;v&&(!u&&v.spaceBefore&&f.push(""),Rt(t,f,v.commentBefore,u))}u=!1;let b=lr.stringify(p,d,()=>g=null,()=>u=!0);g&&(b+=xt.lineComment(b,r,c(g))),u&&g&&(u=!1),f.push(s+b)}let h;if(f.length===0)h=i.start+i.end;else{h=f[0];for(let m=1;m<f.length;++m){let p=f[m];h+=p?`
|
|
46
|
-
${l}${p}`:`
|
|
47
|
-
`}}return n?(h+=`
|
|
48
|
-
`+xt.indentComment(c(n),l),a&&a()):u&&o&&o(),h}function Ql({items:n},e,{flowChars:t,itemIndent:s}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;s+=r;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,d=0,u=[];for(let m=0;m<n.length;++m){let p=n[m],g=null;if(fe.isNode(p))p.spaceBefore&&u.push(""),Rt(e,u,p.commentBefore,!1),p.comment&&(g=p.comment);else if(fe.isPair(p)){let v=fe.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&u.push(""),Rt(e,u,v.commentBefore,!1),v.comment&&(c=!0));let $=fe.isNode(p.value)?p.value:null;$?($.comment&&(g=$.comment),$.commentBefore&&(c=!0)):p.value==null&&v?.comment&&(g=v.comment)}g&&(c=!0);let b=lr.stringify(p,l,()=>g=null);c||(c=u.length>d||b.includes(`
|
|
49
|
-
`)),m<n.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce((v,$)=>v+$.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),g&&(b+=xt.lineComment(b,s,a(g))),u.push(b),d=u.length}let{start:f,end:h}=t;if(u.length===0)return f+h;if(!c){let m=u.reduce((p,g)=>p+g.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=f;for(let p of u)m+=p?`
|
|
50
|
-
${r}${i}${p}`:`
|
|
51
|
-
`;return`${m}
|
|
52
|
-
${i}${h}`}else return`${f}${o}${u.join(" ")}${o}${h}`}function Rt({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=xt.indentComment(e(s),n);t.push(r.trimStart())}}cr.stringifyCollection=Gl});var te=S(Hn=>{"use strict";var zl=Wn(),Xl=Yn(),Zl=Nt(),ee=I(),Bt=Z(),ec=M();function We(n,e){let t=ee.isScalar(e)?e.value:e;for(let s of n)if(ee.isPair(s)&&(s.key===e||s.key===t||ee.isScalar(s.key)&&s.key.value===t))return s}var Gn=class extends Zl.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ee.MAP,e),this.items=[]}static from(e,t,s){let{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Bt.createPair(l,c,s))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;ee.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Bt.Pair(e,e?.value):s=new Bt.Pair(e.key,e.value);let i=We(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);ee.isScalar(i.value)&&ec.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(r){let o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let t=We(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=We(this.items,e)?.value;return(!t&&ee.isScalar(i)?i.value:i)??void 0}has(e){return!!We(this.items,e)}set(e,t){this.add(new Bt.Pair(e,t),!0)}toJSON(e,t,s){let i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)Xl.addPairToJSMap(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ee.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),zl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};Hn.YAMLMap=Gn;Hn.findPair=We});var Ne=S(fr=>{"use strict";var tc=I(),ur=te(),nc={collection:"map",default:!0,nodeClass:ur.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return tc.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>ur.YAMLMap.from(n,e,t)};fr.map=nc});var ne=S(dr=>{"use strict";var sc=je(),ic=Wn(),rc=Nt(),Ft=I(),oc=M(),ac=H(),Qn=class extends rc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=jt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=jt(e);if(typeof s!="number")return;let i=this.items[s];return!t&&Ft.isScalar(i)?i.value:i}has(e){let t=jt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=jt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[s];Ft.isScalar(i)&&oc.isScalarValue(t)?i.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let i=0;for(let r of this.items)s.push(ac.toJS(r,String(i++),t));return s}toString(e,t,s){return e?ic.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(sc.createNode(a,void 0,s))}}return r}};function jt(n){let e=Ft.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}dr.YAMLSeq=Qn});var Ae=S(hr=>{"use strict";var lc=I(),pr=ne(),cc={collection:"seq",default:!0,nodeClass:pr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return lc.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>pr.YAMLSeq.from(n,e,t)};hr.seq=cc});var Ge=S(mr=>{"use strict";var uc=Ve(),fc={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),uc.stringifyString(n,e,t,s)}};mr.string=fc});var Kt=S(br=>{"use strict";var gr=M(),yr={identify:n=>n==null,createNode:()=>new gr.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new gr.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&yr.test.test(n)?n:e.options.nullStr};br.nullTag=yr});var zn=S(Sr=>{"use strict";var dc=M(),vr={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new dc.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&vr.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};Sr.boolTag=vr});var Ce=S(wr=>{"use strict";function pc({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}wr.stringifyNumber=pc});var Zn=S(Ut=>{"use strict";var hc=M(),Xn=Ce(),mc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Xn.stringifyNumber},gc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Xn.stringifyNumber(n)}},yc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new hc.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Xn.stringifyNumber};Ut.float=yc;Ut.floatExp=gc;Ut.floatNaN=mc});var ts=S(Yt=>{"use strict";var kr=Ce(),Vt=n=>typeof n=="bigint"||Number.isInteger(n),es=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function $r(n,e,t){let{value:s}=n;return Vt(s)&&s>=0?t+s.toString(e):kr.stringifyNumber(n)}var bc={identify:n=>Vt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>es(n,2,8,t),stringify:n=>$r(n,8,"0o")},vc={identify:Vt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>es(n,0,10,t),stringify:kr.stringifyNumber},Sc={identify:n=>Vt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>es(n,2,16,t),stringify:n=>$r(n,16,"0x")};Yt.int=vc;Yt.intHex=Sc;Yt.intOct=bc});var Ar=S(Nr=>{"use strict";var wc=Ne(),kc=Kt(),$c=Ae(),Nc=Ge(),Ac=zn(),ns=Zn(),ss=ts(),Cc=[wc.map,$c.seq,Nc.string,kc.nullTag,Ac.boolTag,ss.intOct,ss.int,ss.intHex,ns.floatNaN,ns.floatExp,ns.float];Nr.schema=Cc});var Ir=S(Er=>{"use strict";var Ec=M(),Ic=Ne(),Lc=Ae();function Cr(n){return typeof n=="bigint"||Number.isInteger(n)}var Jt=({value:n})=>JSON.stringify(n),Tc=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Jt},{identify:n=>n==null,createNode:()=>new Ec.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Jt},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Jt},{identify:Cr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Cr(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Jt}],Oc={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Pc=[Ic.map,Lc.seq].concat(Tc,Oc);Er.schema=Pc});var rs=S(Lr=>{"use strict";var He=mt("buffer"),is=M(),qc=Ve(),Mc={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof He.Buffer=="function")return He.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";let o=t,a;if(typeof He.Buffer=="function")a=o instanceof He.Buffer?o.toString("base64"):He.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=is.Scalar.BLOCK_LITERAL),e!==is.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)d[u]=a.substr(f,l);a=d.join(e===is.Scalar.BLOCK_LITERAL?`
|
|
53
|
-
`:" ")}return qc.stringifyString({comment:n,type:e,value:a},s,i,r)}};Lr.binary=Mc});var Ht=S(Gt=>{"use strict";var Wt=I(),os=Z(),_c=M(),Dc=ne();function Tr(n,e){if(Wt.isSeq(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!Wt.isPair(s)){if(Wt.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let i=s.items[0]||new os.Pair(new _c.Scalar(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
|
|
54
|
-
${i.key.commentBefore}`:s.commentBefore),s.comment){let r=i.value??i.key;r.comment=r.comment?`${s.comment}
|
|
55
|
-
${r.comment}`:s.comment}s=i}n.items[t]=Wt.isPair(s)?s:new os.Pair(s)}}else e("Expected a sequence for this tag");return n}function Or(n,e,t){let{replacer:s}=t,i=new Dc.YAMLSeq(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(os.createPair(a,l,t))}return i}var xc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Tr,createNode:Or};Gt.createPairs=Or;Gt.pairs=xc;Gt.resolvePairs=Tr});var cs=S(ls=>{"use strict";var Pr=I(),as=H(),Qe=te(),Rc=ne(),qr=Ht(),de=class n extends Rc.YAMLSeq{constructor(){super(),this.add=Qe.YAMLMap.prototype.add.bind(this),this.delete=Qe.YAMLMap.prototype.delete.bind(this),this.get=Qe.YAMLMap.prototype.get.bind(this),this.has=Qe.YAMLMap.prototype.has.bind(this),this.set=Qe.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;t?.onCreate&&t.onCreate(s);for(let i of this.items){let r,o;if(Pr.isPair(i)?(r=as.toJS(i.key,"",t),o=as.toJS(i.value,r,t)):r=as.toJS(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){let i=qr.createPairs(e,t,s),r=new this;return r.items=i.items,r}};de.tag="tag:yaml.org,2002:omap";var Bc={collection:"seq",identify:n=>n instanceof Map,nodeClass:de,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=qr.resolvePairs(n,e),s=[];for(let{key:i}of t.items)Pr.isScalar(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new de,t)},createNode:(n,e,t)=>de.from(n,e,t)};ls.YAMLOMap=de;ls.omap=Bc});var Rr=S(us=>{"use strict";var Mr=M();function _r({value:n,source:e},t){return e&&(n?Dr:xr).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var Dr={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Mr.Scalar(!0),stringify:_r},xr={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Mr.Scalar(!1),stringify:_r};us.falseTag=xr;us.trueTag=Dr});var Br=S(Qt=>{"use strict";var jc=M(),fs=Ce(),Fc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:fs.stringifyNumber},Kc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():fs.stringifyNumber(n)}},Uc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new jc.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:fs.stringifyNumber};Qt.float=Uc;Qt.floatExp=Kc;Qt.floatNaN=Fc});var Fr=S(Xe=>{"use strict";var jr=Ce(),ze=n=>typeof n=="bigint"||Number.isInteger(n);function zt(n,e,t,{intAsBigInt:s}){let i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return i==="-"?BigInt(-1)*o:o}let r=parseInt(n,t);return i==="-"?-1*r:r}function ds(n,e,t){let{value:s}=n;if(ze(s)){let i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return jr.stringifyNumber(n)}var Vc={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>zt(n,2,2,t),stringify:n=>ds(n,2,"0b")},Yc={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>zt(n,1,8,t),stringify:n=>ds(n,8,"0")},Jc={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>zt(n,0,10,t),stringify:jr.stringifyNumber},Wc={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>zt(n,2,16,t),stringify:n=>ds(n,16,"0x")};Xe.int=Jc;Xe.intBin=Vc;Xe.intHex=Wc;Xe.intOct=Yc});var hs=S(ps=>{"use strict";var en=I(),Xt=Z(),Zt=te(),pe=class n extends Zt.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;en.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Xt.Pair(e.key,null):t=new Xt.Pair(e,null),Zt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=Zt.findPair(this.items,e);return!t&&en.isPair(s)?en.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=Zt.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new Xt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Xt.createPair(o,null,s));return r}};pe.tag="tag:yaml.org,2002:set";var Gc={collection:"map",identify:n=>n instanceof Set,nodeClass:pe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>pe.from(n,e,t),resolve(n,e){if(en.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new pe,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ps.YAMLSet=pe;ps.set=Gc});var gs=S(tn=>{"use strict";var Hc=Ce();function ms(n,e){let t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Kr(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Hc.stringifyNumber(n);let s="";e<0&&(s="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Qc={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>ms(n,t),stringify:Kr},zc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>ms(n,!1),stringify:Kr},Ur={identify:n=>n 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(n){let e=n.match(Ur.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,s-1,i,r||0,o||0,a||0,l),d=e[8];if(d&&d!=="Z"){let u=ms(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};tn.floatTime=zc;tn.intTime=Qc;tn.timestamp=Ur});var Jr=S(Yr=>{"use strict";var Xc=Ne(),Zc=Kt(),eu=Ae(),tu=Ge(),nu=rs(),Vr=Rr(),ys=Br(),nn=Fr(),su=Mt(),iu=cs(),ru=Ht(),ou=hs(),bs=gs(),au=[Xc.map,eu.seq,tu.string,Zc.nullTag,Vr.trueTag,Vr.falseTag,nn.intBin,nn.intOct,nn.int,nn.intHex,ys.floatNaN,ys.floatExp,ys.float,nu.binary,su.merge,iu.omap,ru.pairs,ou.set,bs.intTime,bs.floatTime,bs.timestamp];Yr.schema=au});var no=S(ws=>{"use strict";var Qr=Ne(),lu=Kt(),zr=Ae(),cu=Ge(),uu=zn(),vs=Zn(),Ss=ts(),fu=Ar(),du=Ir(),Xr=rs(),Ze=Mt(),Zr=cs(),eo=Ht(),Wr=Jr(),to=hs(),sn=gs(),Gr=new Map([["core",fu.schema],["failsafe",[Qr.map,zr.seq,cu.string]],["json",du.schema],["yaml11",Wr.schema],["yaml-1.1",Wr.schema]]),Hr={binary:Xr.binary,bool:uu.boolTag,float:vs.float,floatExp:vs.floatExp,floatNaN:vs.floatNaN,floatTime:sn.floatTime,int:Ss.int,intHex:Ss.intHex,intOct:Ss.intOct,intTime:sn.intTime,map:Qr.map,merge:Ze.merge,null:lu.nullTag,omap:Zr.omap,pairs:eo.pairs,seq:zr.seq,set:to.set,timestamp:sn.timestamp},pu={"tag:yaml.org,2002:binary":Xr.binary,"tag:yaml.org,2002:merge":Ze.merge,"tag:yaml.org,2002:omap":Zr.omap,"tag:yaml.org,2002:pairs":eo.pairs,"tag:yaml.org,2002:set":to.set,"tag:yaml.org,2002:timestamp":sn.timestamp};function hu(n,e,t){let s=Gr.get(e);if(s&&!n)return t&&!s.includes(Ze.merge)?s.concat(Ze.merge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{let r=Array.from(Gr.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(let r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(Ze.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Hr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Hr).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}ws.coreKnownTags=pu;ws.getTags=hu});var Ns=S(so=>{"use strict";var ks=I(),mu=Ne(),gu=Ae(),yu=Ge(),rn=no(),bu=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,$s=class n{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?rn.getTags(e,"compat"):e?rn.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?rn.coreKnownTags:{},this.tags=rn.getTags(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,ks.MAP,{value:mu.map}),Object.defineProperty(this,ks.SCALAR,{value:yu.string}),Object.defineProperty(this,ks.SEQ,{value:gu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?bu:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};so.Schema=$s});var ro=S(io=>{"use strict";var vu=I(),As=Ye(),et=Fe();function Su(n,e){let t=[],s=e.directives===!0;if(e.directives!==!1&&n.directives){let l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");let i=As.createStringifyContext(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=r(n.commentBefore);t.unshift(et.indentComment(l,""))}let o=!1,a=null;if(n.contents){if(vu.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let d=r(n.contents.commentBefore);t.push(et.indentComment(d,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>o=!0,c=As.stringify(n.contents,i,()=>a=null,l);a&&(c+=et.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(As.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let l=r(n.comment);l.includes(`
|
|
56
|
-
`)?(t.push("..."),t.push(et.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(et.indentComment(r(l),"")))}return t.join(`
|
|
57
|
-
`)+`
|
|
58
|
-
`}io.stringifyDocument=Su});var tt=S(oo=>{"use strict";var wu=Be(),Ee=Nt(),j=I(),ku=Z(),$u=H(),Nu=Ns(),Au=ro(),Cs=St(),Cu=Tn(),Eu=je(),Es=Ln(),Is=class n{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,j.NODE_TYPE,{value:j.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Es.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){let e=Object.create(n.prototype,{[j.NODE_TYPE]:{value:j.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=j.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ie(this.contents)&&this.contents.add(e)}addIn(e,t){Ie(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=Cs.anchorNames(this);e.anchor=!t||s.has(t)?Cs.findNewAnchor(t||"a",s):t}return new wu.Alias(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let g=v=>typeof v=="number"||v instanceof String||v instanceof Number,b=t.filter(g).map(String);b.length>0&&(t=t.concat(b)),i=t}else s===void 0&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=Cs.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},p=Eu.createNode(e,d,m);return a&&j.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,t,s={}){let i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new ku.Pair(i,r)}delete(e){return Ie(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ee.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ie(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return j.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ee.isEmptyPath(e)?!t&&j.isScalar(this.contents)?this.contents.value:this.contents:j.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return j.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ee.isEmptyPath(e)?this.contents!==void 0:j.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ee.collectionFromPath(this.schema,[e],t):Ie(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ee.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ee.collectionFromPath(this.schema,Array.from(e),t):Ie(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Es.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Es.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Nu.Schema(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=$u.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?Cu.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Au.stringifyDocument(this,e)}};function Ie(n){if(j.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}oo.Document=Is});var it=S(st=>{"use strict";var nt=class extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}},Ls=class extends nt{constructor(e,t,s){super("YAMLParseError",e,t,s)}},Ts=class extends nt{constructor(e,t,s){super("YAMLWarning",e,t,s)}},Iu=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,r))){let a=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
59
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
|
|
60
|
-
|
|
61
|
-
${o}
|
|
62
|
-
${c}
|
|
63
|
-
`}};st.YAMLError=nt;st.YAMLParseError=Ls;st.YAMLWarning=Ts;st.prettifyError=Iu});var rt=S(ao=>{"use strict";function Lu(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,u="",f="",h=!1,m=!1,p=null,g=null,b=null,v=null,$=null,N=null,A=null;for(let w of n)switch(m&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),p&&(c&&w.type!=="comment"&&w.type!=="newline"&&r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),w.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&w.source.includes(" ")&&(p=w),d=!0;break;case"comment":{d||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=w.source.substring(1)||" ";u?u+=f+k:u=k,f="",c=!1;break}case"newline":c?u?u+=w.source:(!N||t!=="seq-item-ind")&&(l=!0):f+=w.source,c=!0,h=!0,(g||b)&&(v=w),d=!0;break;case"anchor":g&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,A??(A=w.offset),c=!1,d=!1,m=!0;break;case"tag":{b&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),b=w,A??(A=w.offset),c=!1,d=!1,m=!0;break}case t:(g||b)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),N&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),N=w,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){$&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),$=w,c=!1,d=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,d=!1}let E=n[n.length-1],T=E?E.offset+E.source.length:i;return m&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(c&&p.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:$,found:N,spaceBefore:l,comment:u,hasNewline:h,anchor:g,tag:b,newlineAfterProp:v,end:T,start:A??T}}ao.resolveProps=Lu});var on=S(lo=>{"use strict";function Os(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
64
|
-
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Os(e.key)||Os(e.value))return!0}return!1;default:return!0}}lo.containsNewline=Os});var Ps=S(co=>{"use strict";var Tu=on();function Ou(n,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&Tu.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}co.flowIndentCheck=Ou});var qs=S(fo=>{"use strict";var uo=I();function Pu(n,e,t){let{uniqueKeys:s}=n.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||uo.isScalar(r)&&uo.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}fo.mapIncludes=Pu});var bo=S(yo=>{"use strict";var po=Z(),qu=te(),ho=rt(),Mu=on(),mo=Ps(),_u=qs(),go="All mapping items must start at the same column";function Du({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??qu.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(let d of s.items){let{start:u,key:f,sep:h,value:m}=d,p=ho.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),g=!p.found;if(g){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&i(l,"BAD_INDENT",go)),!p.anchor&&!p.tag&&!h){c=p.end,p.comment&&(a.comment?a.comment+=`
|
|
65
|
-
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Mu.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==s.indent&&i(l,"BAD_INDENT",go);t.atKey=!0;let b=p.end,v=f?n(t,f,p,i):e(t,b,u,null,p,i);t.schema.compat&&mo.flowIndentCheck(s.indent,f,i),t.atKey=!1,_u.mapIncludes(t,a.items,v)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let $=ho.resolveProps(h??[],{indicator:"map-value-ind",next:m,offset:v.range[2],onError:i,parentIndent:s.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=$.end,$.found){g&&(m?.type==="block-map"&&!$.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&p.start<$.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let N=m?n(t,m,$,i):e(t,l,h,null,$,i);t.schema.compat&&mo.flowIndentCheck(s.indent,m,i),l=N.range[2];let A=new po.Pair(v,N);t.options.keepSourceTokens&&(A.srcToken=d),a.items.push(A)}else{g&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),$.comment&&(v.comment?v.comment+=`
|
|
66
|
-
`+$.comment:v.comment=$.comment);let N=new po.Pair(v);t.options.keepSourceTokens&&(N.srcToken=d),a.items.push(N)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}yo.resolveBlockMap=Du});var So=S(vo=>{"use strict";var xu=ne(),Ru=rt(),Bu=Ps();function ju({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??xu.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=s.offset,c=null;for(let{start:d,value:u}of s.items){let f=Ru.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let h=u?n(t,u,f,i):e(t,f.end,d,null,f,i);t.schema.compat&&Bu.flowIndentCheck(s.indent,u,i),l=h.range[2],a.items.push(h)}return a.range=[s.offset,l,c??l],a}vo.resolveBlockSeq=ju});var Le=S(wo=>{"use strict";function Fu(n,e,t,s){let i="";if(n){let r=!1,o="";for(let a of n){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}wo.resolveEnd=Fu});var Ao=S(No=>{"use strict";var Ku=I(),Uu=Z(),ko=te(),Vu=ne(),Yu=Le(),$o=rt(),Ju=on(),Wu=qs(),Ms="Block collections are not allowed within flow collections",_s=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Gu({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?ko.YAMLMap:Vu.YAMLSeq),c=new l(t.schema);c.flow=!0;let d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){let b=s.items[g],{start:v,key:$,sep:N,value:A}=b,E=$o.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:$??N?.[0],offset:u,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!N&&!A){g===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<s.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(c.comment?c.comment+=`
|
|
67
|
-
`+E.comment:c.comment=E.comment),u=E.end;continue}!o&&t.options.strict&&Ju.containsNewline($)&&i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let T="";e:for(let w of v)switch(w.type){case"comma":case"space":break;case"comment":T=w.source.substring(1);break e;default:break e}if(T){let w=c.items[c.items.length-1];Ku.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
|
|
68
|
-
`+T:w.comment=T,E.comment=E.comment.substring(T.length+1)}}if(!o&&!N&&!E.found){let T=A?n(t,A,E,i):e(t,E.end,N,null,E,i);c.items.push(T),u=T.range[2],_s(A)&&i(T.range,"BLOCK_IN_FLOW",Ms)}else{t.atKey=!0;let T=E.end,w=$?n(t,$,E,i):e(t,T,v,null,E,i);_s($)&&i(w.range,"BLOCK_IN_FLOW",Ms),t.atKey=!1;let k=$o.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:A,offset:w.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(k.found){if(!o&&!E.found&&t.options.strict){if(N)for(let P of N){if(P===k.found)break;if(P.type==="newline"){i(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<k.found.offset-1024&&i(k.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${a}`):i(k.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let L=A?n(t,A,k,i):k.found?e(t,k.end,N,null,k,i):null;L?_s(A)&&i(L.range,"BLOCK_IN_FLOW",Ms):k.comment&&(w.comment?w.comment+=`
|
|
69
|
-
`+k.comment:w.comment=k.comment);let V=new Uu.Pair(w,L);if(t.options.keepSourceTokens&&(V.srcToken=b),o){let P=c;Wu.mapIncludes(t,P.items,w)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),P.items.push(V)}else{let P=new ko.YAMLMap(t.schema);P.flow=!0,P.items.push(V);let ve=(L??w).range;P.range=[w.range[0],ve[1],ve[2]],c.items.push(P)}u=L?L.range[2]:k.end}}let f=o?"}":"]",[h,...m]=s.end,p=u;if(h?.source===f)p=h.offset+h.source.length;else{let g=a[0].toUpperCase()+a.substring(1),b=d?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;i(u,d?"MISSING_CHAR":"BAD_INDENT",b),h&&h.source.length!==1&&m.unshift(h)}if(m.length>0){let g=Yu.resolveEnd(m,p,t.options.strict,i);g.comment&&(c.comment?c.comment+=`
|
|
70
|
-
`+g.comment:c.comment=g.comment),c.range=[s.offset,p,g.offset]}else c.range=[s.offset,p,p];return c}No.resolveFlowCollection=Gu});var Eo=S(Co=>{"use strict";var Hu=I(),Qu=M(),zu=te(),Xu=ne(),Zu=bo(),ef=So(),tf=Ao();function Ds(n,e,t,s,i,r){let o=t.type==="block-map"?Zu.resolveBlockMap(n,e,t,s,r):t.type==="block-seq"?ef.resolveBlockSeq(n,e,t,s,r):tf.resolveFlowCollection(n,e,t,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function nf(n,e,t,s,i){let r=s.tag,o=r?e.directives.tagName(r.source,f=>i(r,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=s,m=f&&r?f.offset>r.offset?f:r:f??r;m&&(!h||h.offset<m.offset)&&i(m,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===zu.YAMLMap.tagName&&a==="map"||o===Xu.YAMLSeq.tagName&&a==="seq")return Ds(n,e,t,i,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ds(n,e,t,i,o)}let c=Ds(n,e,t,i,o,l),d=l.resolve?.(c,f=>i(r,"TAG_RESOLVE_FAILED",f),e.options)??c,u=Hu.isNode(d)?d:new Qu.Scalar(d);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}Co.composeCollection=nf});var Rs=S(Io=>{"use strict";var xs=M();function sf(n,e,t){let s=e.offset,i=rf(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?xs.Scalar.BLOCK_FOLDED:xs.Scalar.BLOCK_LITERAL,o=e.source?of(e.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let g=o[p][1];if(g===""||g==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&o.length>0?`
|
|
71
|
-
`.repeat(Math.max(1,o.length-1)):"",g=s+i.length;return e.source&&(g+=e.source.length),{value:p,type:r,comment:i.comment,range:[s,g,g]}}let l=e.indent+i.indent,c=e.offset+i.length,d=0;for(let p=0;p<a;++p){let[g,b]=o[p];if(b===""||b==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&t(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),d=p,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>l&&(a=p+1);let u="",f="",h=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(l)+`
|
|
72
|
-
`;for(let p=d;p<a;++p){let[g,b]=o[p];c+=g.length+b.length+1;let v=b[b.length-1]==="\r";if(v&&(b=b.slice(0,-1)),b&&g.length<l){let N=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(v?2:1),"BAD_INDENT",N),g=""}r===xs.Scalar.BLOCK_LITERAL?(u+=f+g.slice(l)+b,f=`
|
|
73
|
-
`):g.length>l||b[0]===" "?(f===" "?f=`
|
|
74
|
-
`:!h&&f===`
|
|
75
|
-
`&&(f=`
|
|
76
|
-
|
|
77
|
-
`),u+=f+g.slice(l)+b,f=`
|
|
78
|
-
`,h=!0):b===""?f===`
|
|
79
|
-
`?u+=`
|
|
80
|
-
`:f=`
|
|
81
|
-
`:(u+=f+b,f=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)u+=`
|
|
82
|
-
`+o[p][0].slice(l);u[u.length-1]!==`
|
|
83
|
-
`&&(u+=`
|
|
84
|
-
`);break;default:u+=`
|
|
85
|
-
`}let m=s+i.length+e.source.length;return{value:u,type:r,comment:i.comment,range:[s,m,m]}}function rf({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let f=1;f<i.length;++f){let h=i[f];if(!a&&(h==="-"||h==="+"))a=h;else{let m=Number(h);!o&&m?o=m:l===-1&&(l=n+f)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",u=i.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":c=!0;case"newline":u+=h.source.length;break;case"comment":t&&!c&&s(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=h.source.length,d=h.source.substring(1);break;case"error":s(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let m=`Unexpected token in block scalar header: ${h.type}`;s(h,"UNEXPECTED_TOKEN",m);let p=h.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:u}}function of(n){let e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}Io.resolveBlockScalar=sf});var js=S(To=>{"use strict";var Bs=M(),af=Le();function lf(n,e,t){let{offset:s,type:i,source:r,end:o}=n,a,l,c=(f,h,m)=>t(s+f,h,m);switch(i){case"scalar":a=Bs.Scalar.PLAIN,l=cf(r,c);break;case"single-quoted-scalar":a=Bs.Scalar.QUOTE_SINGLE,l=uf(r,c);break;case"double-quoted-scalar":a=Bs.Scalar.QUOTE_DOUBLE,l=ff(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}let d=s+r.length,u=af.resolveEnd(o,d,e,t);return{value:l,type:a,comment:u.comment,range:[s,d,u.offset]}}function cf(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Lo(n)}function uf(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Lo(n.slice(1,-1)).replace(/''/g,"'")}function Lo(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
|
-
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let i=s[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;s=t.exec(n);)s[1]===""?r===`
|
|
88
|
-
`?i+=r:r=`
|
|
89
|
-
`:(i+=r+s[1],r=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(n),i+r+(s?.[1]??"")}function ff(n,e){let t="";for(let s=1;s<n.length-1;++s){let i=n[s];if(!(i==="\r"&&n[s+1]===`
|
|
90
|
-
`))if(i===`
|
|
91
|
-
`){let{fold:r,offset:o}=df(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s],o=pf[r];if(o)t+=o;else if(r===`
|
|
92
|
-
`)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
|
|
93
|
-
`)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=hf(n,s+1,a,e),s+=a}else{let a=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=s,o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
|
|
94
|
-
`&&!(o==="\r"&&n[s+2]===`
|
|
95
|
-
`)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function df(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
|
|
96
|
-
`||s==="\r")&&!(s==="\r"&&n[e+2]!==`
|
|
97
|
-
`);)s===`
|
|
98
|
-
`&&(t+=`
|
|
99
|
-
`),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}var pf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hf(n,e,t,s){let i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}To.resolveFlowScalar=lf});var qo=S(Po=>{"use strict";var he=I(),Oo=M(),mf=Rs(),gf=js();function yf(n,e,t,s){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?mf.resolveBlockScalar(n,e,s):gf.resolveFlowScalar(e,n.options.strict,s),l=t?n.directives.tagName(t.source,u=>s(t,"TAG_RESOLVE_FAILED",u)):null,c;n.options.stringKeys&&n.atKey?c=n.schema[he.SCALAR]:l?c=bf(n.schema,i,l,t,s):e.type==="scalar"?c=vf(n,i,e,s):c=n.schema[he.SCALAR];let d;try{let u=c.resolve(i,f=>s(t??e,"TAG_RESOLVE_FAILED",f),n.options);d=he.isScalar(u)?u:new Oo.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);s(t??e,"TAG_RESOLVE_FAILED",f),d=new Oo.Scalar(i)}return d.range=a,d.source=i,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function bf(n,e,t,s,i){if(t==="!")return n[he.SCALAR];let r=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[he.SCALAR])}function vf({atKey:n,directives:e,schema:t},s,i,r){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(s))||t[he.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(s))??t[he.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}Po.composeScalar=yf});var _o=S(Mo=>{"use strict";function Sf(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}Mo.emptyScalarPosition=Sf});var Ro=S(Ks=>{"use strict";var wf=Be(),kf=I(),$f=Eo(),Do=qo(),Nf=Le(),Af=_o(),Cf={composeNode:xo,composeEmptyNode:Fs};function xo(n,e,t,s){let i=n.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,d=!0;switch(e.type){case"alias":c=Ef(n,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Do.composeScalar(n,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=$f.composeCollection(Cf,n,e,t,s),a&&(c.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);s(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",u),d=!1}}return c??(c=Fs(n,e.offset,void 0,null,t,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!kf.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&d&&(c.srcToken=e),c}function Fs(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let d={type:"scalar",offset:Af.emptyScalarPosition(e,t,s),indent:-1,source:""},u=Do.composeScalar(n,d,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function Ef({options:n},{offset:e,source:t,end:s},i){let r=new wf.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Nf.resolveEnd(s,o,n.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Ks.composeEmptyNode=Fs;Ks.composeNode=xo});var Fo=S(jo=>{"use strict";var If=tt(),Bo=Ro(),Lf=Le(),Tf=rt();function Of(n,e,{offset:t,start:s,value:i,end:r},o){let a=Object.assign({_directives:e},n),l=new If.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Tf.resolveProps(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Bo.composeNode(c,i,d,o):Bo.composeEmptyNode(c,d.end,s,null,d,o);let u=l.contents.range[2],f=Lf.resolveEnd(r,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}jo.composeDoc=Of});var Vs=S(Vo=>{"use strict";var Pf=mt("process"),qf=Ln(),Mf=tt(),ot=it(),Ko=I(),_f=Fo(),Df=Le();function at(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Uo(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){let r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
|
|
101
|
-
|
|
102
|
-
`:`
|
|
103
|
-
`)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}var Us=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{let o=at(t);r?this.warnings.push(new ot.YAMLWarning(o,s,i)):this.errors.push(new ot.YAMLParseError(o,s,i))},this.directives=new qf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:i}=Uo(this.prelude);if(s){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
|
-
${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(Ko.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Ko.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
|
|
105
|
-
${a}`:s}else{let o=r.commentBefore;r.commentBefore=o?`${s}
|
|
106
|
-
${o}`:s}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Uo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(Pf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{let r=at(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=_f.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new ot.YAMLParseError(at(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new ot.YAMLParseError(at(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let t=Df.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
107
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ot.YAMLParseError(at(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),i=new Mf.Document(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};Vo.Composer=Us});var Wo=S(an=>{"use strict";var xf=Rs(),Rf=js(),Bf=it(),Yo=Ve();function jf(n,e=!0,t){if(n){let s=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new Bf.YAMLParseError([a,a+1],r,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Rf.resolveFlowScalar(n,e,s);case"block-scalar":return xf.resolveBlockScalar({options:{strict:e}},n,s)}}return null}function Ff(n,e){let{implicitKey:t=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Yo.stringifyString({type:o,value:n},{implicitKey:t,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:`
|
|
108
|
-
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
|
-
`),d=a.substring(0,c),u=a.substring(c+1)+`
|
|
110
|
-
`,f=[{type:"block-scalar-header",offset:r,indent:s,source:d}];return Jo(f,l)||f.push({type:"newline",offset:-1,indent:s,source:`
|
|
111
|
-
`}),{type:"block-scalar",offset:r,indent:s,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:l};default:return{type:"scalar",offset:r,indent:s,source:a,end:l}}}function Kf(n,e,t={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in n?n.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=n.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=Yo.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Uf(n,l);break;case'"':Ys(n,l,"double-quoted-scalar");break;case"'":Ys(n,l,"single-quoted-scalar");break;default:Ys(n,l,"scalar")}}function Uf(n,e){let t=e.indexOf(`
|
|
112
|
-
`),s=e.substring(0,t),i=e.substring(t+1)+`
|
|
113
|
-
`;if(n.type==="block-scalar"){let r=n.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,n.source=i}else{let{offset:r}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];Jo(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
114
|
-
`});for(let l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:i})}}function Jo(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Ys(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let s=n.props.slice(1),i=e.length;n.props[0].type==="block-scalar-header"&&(i-=n.props[0].source.length);for(let r of s)r.offset+=i;delete n.props,Object.assign(n,{type:t,source:e,end:s});break}case"block-map":case"block-seq":{let i={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
115
|
-
`};delete n.items,Object.assign(n,{type:t,source:e,end:[i]});break}default:{let s="indent"in n?n.indent:-1,i="end"in n&&Array.isArray(n.end)?n.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(n))r!=="type"&&r!=="offset"&&delete n[r];Object.assign(n,{type:t,indent:s,source:e,end:i})}}}an.createScalarToken=Ff;an.resolveAsScalar=jf;an.setScalarValue=Kf});var Ho=S(Go=>{"use strict";var Vf=n=>"type"in n?cn(n):ln(n);function cn(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=cn(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=ln(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=ln(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=ln(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function ln({start:n,key:e,sep:t,value:s}){let i="";for(let r of n)i+=r.source;if(e&&(i+=cn(e)),t)for(let r of t)i+=r.source;return s&&(i+=cn(s)),i}Go.stringify=Vf});var Zo=S(Xo=>{"use strict";var Js=Symbol("break visit"),Yf=Symbol("skip children"),Qo=Symbol("remove item");function me(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),zo(Object.freeze([]),n,e)}me.BREAK=Js;me.SKIP=Yf;me.REMOVE=Qo;me.itemAtPath=(n,e)=>{let t=n;for(let[s,i]of e){let r=t?.[s];if(r&&"items"in r)t=r.items[i];else return}return t};me.parentCollection=(n,e)=>{let t=me.itemAtPath(n,e.slice(0,-1)),s=e[e.length-1][0],i=t?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function zo(n,e,t){let s=t(e,n);if(typeof s=="symbol")return s;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=zo(Object.freeze(n.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Js)return Js;a===Qo&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}Xo.visit=me});var un=S(B=>{"use strict";var Ws=Wo(),Jf=Ho(),Wf=Zo(),Gs="\uFEFF",Hs="",Qs="",zs="",Gf=n=>!!n&&"items"in n,Hf=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function Qf(n){switch(n){case Gs:return"<BOM>";case Hs:return"<DOC>";case Qs:return"<FLOW_END>";case zs:return"<SCALAR>";default:return JSON.stringify(n)}}function zf(n){switch(n){case Gs:return"byte-order-mark";case Hs:return"doc-mode";case Qs:return"flow-error-end";case zs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
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(n[0]){case" ":case" ":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}B.createScalarToken=Ws.createScalarToken;B.resolveAsScalar=Ws.resolveAsScalar;B.setScalarValue=Ws.setScalarValue;B.stringify=Jf.stringify;B.visit=Wf.visit;B.BOM=Gs;B.DOCUMENT=Hs;B.FLOW_END=Qs;B.SCALAR=zs;B.isCollection=Gf;B.isScalar=Hf;B.prettyToken=Qf;B.tokenType=zf});var ei=S(ta=>{"use strict";var lt=un();function K(n){switch(n){case void 0:case" ":case`
|
|
118
|
-
`:case"\r":case" ":return!0;default:return!1}}var ea=new Set("0123456789ABCDEFabcdef"),Xf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),fn=new Set(",[]{}"),Zf=new Set(` ,[]{}
|
|
119
|
-
\r `),Xs=n=>!n||Zf.has(n),Zs=class{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(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
120
|
-
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
121
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){let i=this.buffer[s+e+1];if(i===`
|
|
122
|
-
`||!i&&!this.atEnd)return e+s+1}return t===`
|
|
123
|
-
`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&K(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
124
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){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 e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===lt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){let r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield lt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&K(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&K(t)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);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(Xs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&K(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield lt.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"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(Xs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||K(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),i=s.indexOf(`
|
|
125
|
-
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
|
|
126
|
-
`,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>K(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
|
|
127
|
-
`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
128
|
-
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
129
|
-
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
130
|
-
`;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
131
|
-
`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield lt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){let r=this.buffer[s+1];if(K(r)||e&&fn.has(r))break;t=s}else if(K(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
|
|
132
|
-
`?(s+=1,i=`
|
|
133
|
-
`,r=this.buffer[s+1]):t=s),r==="#"||e&&fn.has(r))break;if(i===`
|
|
134
|
-
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&fn.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield lt.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Xs),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(K(s)||t&&fn.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!K(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Xf.has(t))t=this.buffer[++e];else if(t==="%"&&ea.has(this.buffer[e+1])&&ea.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
135
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
136
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};ta.Lexer=Zs});var ni=S(na=>{"use strict";var ti=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};na.LineCounter=ti});var ii=S(aa=>{"use strict";var ed=mt("process"),sa=un(),td=ei();function se(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function ia(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function oa(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function dn(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Te(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function pn(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function ra(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!se(e.start,"explicit-key-ind")&&!se(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,oa(e.value)?e.value.end?pn(e.value.end,e.sep):e.value.end=e.sep:pn(e.start,e.sep),delete e.sep)}var si=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new td.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,ed.env.LOG_TOKENS&&console.log("|",sa.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=sa.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ra(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ia(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.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 e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{ia(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=dn(this.peek(2)),s=Te(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){pn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):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(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(se(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(oa(t.key)&&!se(t.sep,"newline")){let o=Te(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(se(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Te(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):se(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!se(t.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 s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){pn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||se(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let i=dn(s),r=Te(i);ra(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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 t=dn(e),s=Te(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=dn(e),s=Te(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};aa.Parser=si});var da=S(ut=>{"use strict";var la=Vs(),nd=tt(),ct=it(),sd=Kn(),id=I(),rd=ni(),ca=ii();function ua(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new rd.LineCounter||null,prettyErrors:e}}function od(n,e={}){let{lineCounter:t,prettyErrors:s}=ua(e),i=new ca.Parser(t?.addNewLine),r=new la.Composer(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(let a of o)a.errors.forEach(ct.prettifyError(n,t)),a.warnings.forEach(ct.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function fa(n,e={}){let{lineCounter:t,prettyErrors:s}=ua(e),i=new ca.Parser(t?.addNewLine),r=new la.Composer(e),o=null;for(let a of r.compose(i.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ct.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(ct.prettifyError(n,t)),o.warnings.forEach(ct.prettifyError(n,t))),o}function ad(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=fa(n,t);if(!i)return null;if(i.warnings.forEach(r=>sd.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}function ld(n,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return id.isDocument(n)&&!s?n.toString(t):new nd.Document(n,s,t).toString(t)}ut.parse=ad;ut.parseAllDocuments=od;ut.parseDocument=fa;ut.stringify=ld});var ha=S(O=>{"use strict";var cd=Vs(),ud=tt(),fd=Ns(),ri=it(),dd=Be(),ie=I(),pd=Z(),hd=M(),md=te(),gd=ne(),yd=un(),bd=ei(),vd=ni(),Sd=ii(),hn=da(),pa=_e();O.Composer=cd.Composer;O.Document=ud.Document;O.Schema=fd.Schema;O.YAMLError=ri.YAMLError;O.YAMLParseError=ri.YAMLParseError;O.YAMLWarning=ri.YAMLWarning;O.Alias=dd.Alias;O.isAlias=ie.isAlias;O.isCollection=ie.isCollection;O.isDocument=ie.isDocument;O.isMap=ie.isMap;O.isNode=ie.isNode;O.isPair=ie.isPair;O.isScalar=ie.isScalar;O.isSeq=ie.isSeq;O.Pair=pd.Pair;O.Scalar=hd.Scalar;O.YAMLMap=md.YAMLMap;O.YAMLSeq=gd.YAMLSeq;O.CST=yd;O.Lexer=bd.Lexer;O.LineCounter=vd.LineCounter;O.Parser=Sd.Parser;O.parse=hn.parse;O.parseAllDocuments=hn.parseAllDocuments;O.parseDocument=hn.parseDocument;O.stringify=hn.stringify;O.visit=pa.visit;O.visitAsync=pa.visitAsync});import{readdir as ye,stat as Pe,lstat as ba,readlink as Cd,readFile as gn,realpath as mi}from"fs/promises";import{join as x,resolve as gi,basename as Ed}from"path";import{homedir as yn}from"os";var oi=Ja(ha(),1);function ma(n){let e;try{e=(0,oi.parse)(n)}catch(t){throw new Error("Invalid dependencies metadata: malformed YAML scalar.",{cause:t})}if(typeof e!="string"||!e.trim())throw new Error("Invalid dependencies metadata: entries must be non-empty scalar strings.");return e.trim()}function ai(n){let e={},t=n.split(`
|
|
141
|
-
`),s=!1,i=!1,r=null,o=[],a="none",l=-1,c=null;function d(){if(r){let u=o.join(" ").trim();u&&(e[r]=u),r=null,o=[],a="none",l=-1}}for(let u of t){if(u.trim()==="---")if(i){d();break}else{i=!0,s=!0;continue}if(!s)continue;if(a!=="none"&&r){let h=u.replace(/^\s*/,""),m=u.length-h.length;if(m>0&&h.length>0){l===-1&&(l=m),o.push(h);continue}else{if(h.length===0)continue;d()}}if(c!==null){if(c==="dependencies"&&u.trim().startsWith("#"))continue;let h=u.match(/^\s+-\s*(.*?)\s*$/);if(h){if(c==="dependencies"){let g=e[c]?JSON.parse(e[c]):[];g.push(ma(h[1])),e[c]=JSON.stringify(g);continue}let p=h[1].replace(/^["']|["']$/g,"");p&&(e[c]=e[c]?`${e[c]}
|
|
142
|
-
${p}`:p);continue}if(c==="dependencies"&&/^\s+\S/.test(u))throw new Error("Invalid dependencies metadata: use a sequence of scalar strings, not a nested mapping.");let m=u.match(/^\s+(\w[\w-]*):\s*(.*?)\s*$/);if(m){let p=m[1],b=m[2].replace(/^["']|["']$/g,"");b&&(e[`${c}.${p}`]=b);continue}if(u.trim().length>0)c=null;else continue}let f=u.match(/^(\w[\w-]*):\s*(.*?)\s*$/);if(f){d();let h=f[1],m=f[2];if(h==="dependencies"&&["|",">","|+",">+","|-",">-"].includes(m))throw new Error("Invalid dependencies metadata: block scalars are unsupported; use a YAML sequence or a delimited scalar.");if(m==="|"||m===">")r=h,o=[],a=m==="|"?"literal":"folded";else if(m==="|+"||m===">+"||m==="|-"||m===">-")r=h,o=[],a=m.startsWith("|")?"literal":"folded";else{let p=m.replace(/^["']|["']$/g,"");p?e[h]=p:c=h}}}return d(),e}function li(n){return n["metadata.version"]||n.version||"0.0.0"}function ci(n){let e=n["allowed-tools"]||"";return e.trim()?e.split(/[\s,]+/).map(t=>t.trim()).filter(Boolean):[]}function ui(n){let e=(n.dependencies||"").trim();if(!e)return[];let t;if(e.startsWith("[")){let r;try{r=(0,oi.parse)(e)}catch(o){throw new Error("Invalid dependencies metadata: malformed YAML flow sequence.",{cause:o})}if(!Array.isArray(r)||r.some(o=>typeof o!="string"||!o.trim()))throw new Error("Invalid dependencies metadata: flow sequences must contain only non-empty strings.");t=r}else{let r=[],o="",a=null,l=!1,c=()=>{o.trim()&&r.push(o.trim()),o=""};for(let d=0;d<e.length;d++){let u=e[d];if(a){o+=u,l?l=!1:a==='"'&&u==="\\"?l=!0:u===a&&(a=null);continue}if(u==="'"||u==='"')a=u,o+=u;else if(u==="#"&&(d===0||/\s/.test(e[d-1]))){for(;d+1<e.length&&e[d+1]!==`
|
|
143
|
-
`;)d++;c()}else u===","||/\s/.test(u)?c():o+=u}if(a)throw new Error("Invalid dependencies metadata: unterminated quoted string.");c(),t=r.map(ma)}let s=new Set,i=[];for(let r of t){let o=r.trim();o&&!s.has(o)&&(s.add(o),i.push(o))}return i}function fi(n){let e=(n.tags||"").trim();if(!e)return[];let t=e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e;return $d(t.split(/[\s,]+/).map(s=>s.replace(/^['"]|['"]$/g,"")))}var wd=/^[a-z0-9][a-z0-9_-]*$/;function kd(n){let e=n.trim().toLowerCase();return!e||e.length>32||!wd.test(e)?null:e}function $d(n){let e=new Set,t=[];for(let s of n){let i=kd(s);i&&!e.has(i)&&(e.add(i),t.push(i))}return t}function ga(n){return(n||"").trim().toLowerCase()}function Nd(n){let e=ga(n);return e==="true"||e==="yes"||e==="1"}function Ad(n){let e=ga(n);return e==="false"||e==="no"||e==="0"}function di(n){return!Nd(n["disable-model-invocation"])}function pi(n){return"user-invocable"in n?!Ad(n["user-invocable"]):!0}function Oe(n,e){let t=n!==!1,s=e!==!1;return t&&s?"both":t?"model":s?"user":"none"}function em(n,e){let t=n.modelInvocable!==!1,s=n.userInvocable!==!1;return!(e.modelInvocable&&!t||e.userInvocable&&!s)}function mn(n){if(!n)return 0;let e=n.split(/\s+/).map(s=>s.trim()).filter(Boolean).length,t=0;for(let s=0;s<n.length;s++)n.charCodeAt(s)===32&&t++;return e+t}function ft(n){return!Number.isFinite(n)||n<0?"~0 tokens":n<1e3?`~${n} tokens`:n<1e4?`~${(n/1e3).toFixed(1).replace(/\.0$/,"")}k tokens`:n<1e6?`~${Math.round(n/1e3)}k tokens`:`~${(n/1e6).toFixed(1).replace(/\.0$/,"")}M tokens`}function nm(n){return mn(n.description??"")}function sm(n){let e=n.tokenCount;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:0}var Id=x(yn(),".claude","plugins","marketplaces"),Ld=x(yn(),".codex","plugins","cache"),Td=x(yn(),".codex","config.toml"),dm=x(yn(),".agents","plugins","marketplace.json"),va=16,Od=va-1,ge=[],re=0,hi=0;function ya(){for(;hi<va&&re<ge.length;){let n=ge[re++];hi++,n()}re===ge.length?(ge.length=0,re=0):re>=1024&&re*2>=ge.length&&(ge.splice(0,re),re=0)}function Pd(n){return new Promise((e,t)=>{ge.push(()=>{Promise.resolve().then(n).finally(()=>{hi--,ya()}).then(e,t)}),ya()})}function qd(){let n=[],e=0,t=0,s=()=>{for(;e<Od;){let i;for(let a=0;a<n.length;a++){let l=n[t];if(t=(t+1)%n.length,l.nextIndex<l.entries.length){i=l;break}}if(!i)return;let r=i.nextIndex++,o=i.entries[r];i.inFlight++,e++,Pd(()=>i.task(o,r)).then(a=>{a&&i.results.push([r,a])},()=>{}).finally(()=>{if(e--,i.inFlight--,i.nextIndex===i.entries.length&&i.inFlight===0){let a=n.indexOf(i);n.splice(a,1),n.length===0?t=0:(a<t&&t--,t%=n.length),i.results.sort(([l],[c])=>l-c),i.resolve(i.results.map(([,l])=>l))}s()})}};return{run(i,r){return i.length===0?Promise.resolve([]):new Promise(o=>{n.push({entries:i,nextIndex:0,inFlight:0,results:[],task:r,resolve:o}),s()})}}}function Md(n,e){let t=[];for(let s of n.providers){if(!s.enabled){q(`scan: skipping disabled provider "${s.name}"`);continue}if(e==="global"||e==="both"){let i=ce(s.global);q(`scan: adding location ${i} (${s.label}, global)`),t.push({dir:i,location:`global-${s.name}`,scope:"global",providerName:s.name,providerLabel:s.label})}if(e==="project"||e==="both"){let i=ce(s.project);q(`scan: adding location ${i} (${s.label}, project)`),t.push({dir:i,location:`project-${s.name}`,scope:"project",providerName:s.name,providerLabel:s.label})}}for(let s of n.customPaths)if(e===s.scope||e==="both"){let i=ce(s.path);q(`scan: adding custom location ${i} (${s.label}, ${s.scope})`),t.push({dir:i,location:`${s.scope}-custom`,scope:s.scope,providerName:"custom",providerLabel:s.label})}return t}async function yi(n){try{return(await ye(n,{recursive:!0})).length}catch{return 0}}function bn(n,e){Object.defineProperty(n,"_skillMdContent",{value:e,writable:!0,configurable:!0})}async function _d(n,e){q(`scanning: ${n.dir} (${n.location})`);let t;try{t=await ye(n.dir)}catch{return q(`scanning: ${n.dir} \u2014 not found, skipping`),[]}let s=await e.run(t,async i=>{try{let r=x(n.dir,i);try{if(!(await Pe(r)).isDirectory()){q(` skip: "${i}" \u2014 not a directory`);return}}catch{q(` skip: "${i}" \u2014 stat failed`);return}let o=x(r,"SKILL.md"),a;try{a=await gn(o,"utf-8")}catch{q(` skip: "${i}" \u2014 no SKILL.md`);return}let l=ai(a),c=!1,d=null;try{(await ba(r)).isSymbolicLink()&&(c=!0,d=await Cd(r))}catch{}let u=gi(r),f;try{f=await mi(r)}catch{f=u}let h={name:l.name||i,version:li(l),description:(l.description||"").replace(/\s*\n\s*/g," ").trim(),creator:l["metadata.creator"]||"",license:(l.license||"").trim(),compatibility:(l.compatibility||"").trim(),allowedTools:ci(l),tags:fi(l),dependencies:ui(l),modelInvocable:di(l),userInvocable:pi(l),effort:l.effort||l["metadata.effort"]||void 0,dirName:i,path:u,originalPath:r,location:n.location,scope:n.scope,provider:n.providerName,providerLabel:n.providerLabel,isSymlink:c,symlinkTarget:d,realPath:f,tokenCount:mn(a)};return bn(h,a),h}catch{q(` skip: "${i}" \u2014 scan failed`);return}});return q(`found ${s.length} skill(s) in ${n.dir}`),s}async function Sa(n){let e=[],t;try{t=await ye(n)}catch{return e}for(let s of t){let i=x(n,s),r;try{r=await ba(i)}catch{continue}if(!r.isSymbolicLink()&&r.isDirectory()){let o=x(i,"SKILL.md");try{await Pe(o),e.push(i)}catch{let a=await Sa(i);e.push(...a)}}}return e}async function Dd(n){let e=n??Id,t=[];q(`scan: checking plugin marketplaces at ${e}`);let s;try{s=await ye(e)}catch{return q("scan: plugin marketplaces dir not found, skipping"),t}for(let i of s){let r=x(e,i),o;try{o=await Pe(r)}catch{continue}if(!o.isDirectory())continue;q(`scan: scanning marketplace "${i}"`);let a=await Sa(r);for(let l of a){let c=x(l,"SKILL.md"),d;try{d=await gn(c,"utf-8")}catch{continue}let u=ai(d),f=Ed(l),h=gi(l),m;try{m=await mi(l)}catch{m=h}let p={name:u.name||f,version:li(u),description:(u.description||"").replace(/\s*\n\s*/g," ").trim(),creator:u["metadata.creator"]||"",license:(u.license||"").trim(),compatibility:(u.compatibility||"").trim(),allowedTools:ci(u),tags:fi(u),dependencies:ui(u),modelInvocable:di(u),userInvocable:pi(u),effort:u.effort||u["metadata.effort"]||void 0,dirName:f,path:h,originalPath:l,location:`global-plugin-${i}`,scope:"global",provider:"plugin",providerLabel:`Plugin (${i})`,isSymlink:!1,symlinkTarget:null,realPath:m,marketplace:i,tokenCount:mn(d)};bn(p,d),t.push(p)}}return q(`scan: found ${t.length} plugin marketplace skill(s)`),t}function xd(n){let e=new Map,t=null;for(let s of n.split(`
|
|
144
|
-
`)){let i=s.trim(),r=i.match(/^\[plugins\.([^\]]+)\]$/);if(r){t=r[1].trim().replace(/^["']|["']$/g,"");continue}if(i.startsWith("[")){t=null;continue}if(t&&i.startsWith("enabled")){let o=i.match(/^enabled\s*=\s*(true|false)/i);o&&e.set(t,o[1].toLowerCase()==="true")}}return e}async function Rd(n){let e=n??Td;try{let t=await gn(e,"utf-8");return xd(t)}catch{return q(`codex: config.toml not found at ${e}, skipping enabled check`),new Map}}async function Bd(n,e){let t=n??Ld,s=[];q(`codex: checking plugin cache at ${t}`);let i;try{i=await ye(t)}catch{return q("codex: plugin cache dir not found, skipping"),s}let r=await Rd(e);for(let o of i){let a=x(t,o),l;try{l=await Pe(a)}catch{continue}if(!l.isDirectory())continue;let c;try{c=await ye(a)}catch{continue}for(let d of c){let u=x(a,d),f;try{f=await Pe(u)}catch{continue}if(!f.isDirectory())continue;let h;try{h=await ye(u)}catch{continue}let m=(await Promise.all(h.map(async k=>{try{return(await Pe(x(u,k))).isDirectory()?k:null}catch{return null}}))).filter(k=>k!==null);if(m.length===0)continue;let p=m.sort(wa).at(-1),g=x(u,p),b=x(g,".codex-plugin","plugin.json"),v;try{let k=await gn(b,"utf-8");v=JSON.parse(k)}catch{q(`codex: no valid plugin.json at ${b}, skipping`);continue}let $=gi(g),N;try{N=await mi(g)}catch{N=$}let A=v.interface?.displayName||v.name||d,E=v.version||p,T=(v.description||"").replace(/\s*\n\s*/g," ").trim(),w=r.has(d)?r.get(d):!0;s.push({name:A,version:E,description:T,creator:"",license:"",compatibility:"",allowedTools:[],dirName:d,path:$,originalPath:g,location:`global-codex-plugin-${o}`,scope:"global",provider:"codex-plugin",providerLabel:`Codex Plugin (${o})`,isSymlink:!1,symlinkTarget:null,realPath:N,marketplace:o,codexPlugin:{category:v.interface?.category,hasMcpConfig:v.mcp!=null&&Object.keys(v.mcp).length>0,pluginName:d,pluginVersion:p,enabled:w}})}}return q(`codex: found ${s.length} plugin(s) in cache`),s}async function pm(n,e,t,s){let i=Md(n,e),r=e==="global"||e==="both",o=qd(),[a,l,c]=await Promise.all([Promise.all(i.map(h=>_d(h,o))),r?Dd(t):Promise.resolve([]),r?Bd(s):Promise.resolve([])]),d=a.flat(),u=new Set(d.map(h=>h.realPath)),f=new Set(d.map(h=>h.name.toLowerCase()));for(let h of l)!u.has(h.realPath)&&!f.has(h.name.toLowerCase())&&(d.push(h),u.add(h.realPath),f.add(h.name.toLowerCase()));for(let h of c)!u.has(h.realPath)&&!f.has(h.name.toLowerCase())&&(d.push(h),u.add(h.realPath),f.add(h.name.toLowerCase()));return d}function hm(n,e){if(!e.trim())return n;let t=e.toLowerCase();return n.filter(s=>s.name.toLowerCase().includes(t)||s.description.toLowerCase().includes(t)||s.creator.toLowerCase().includes(t)||s.effort&&s.effort.toLowerCase().includes(t)||s.location.toLowerCase().includes(t)||s.providerLabel.toLowerCase().includes(t))}function wa(n,e){let t=n.split("."),s=e.split("."),i=Math.max(t.length,s.length);for(let r=0;r<i;r++){let o=parseInt(t[r]??"0",10),a=parseInt(s[r]??"0",10);if(isNaN(o)||isNaN(a))return n.localeCompare(e);if(o!==a)return o-a}return 0}function mm(n,e){let t=[...n];switch(e){case"name":t.sort((s,i)=>s.name.localeCompare(i.name));break;case"version":t.sort((s,i)=>wa(s.version,i.version));break;case"location":t.sort((s,i)=>s.location.localeCompare(i.location));break}return t}import{rm as oe,readFile as Ca,writeFile as Gd,access as Hd,lstat as Qd,rename as zd,readdir as Xd,mkdir as $a,unlink as Na}from"fs/promises";import{join as vn,resolve as U,dirname as qe,relative as Aa}from"path";import{homedir as Zd}from"os";import{readdir as jd,readFile as Fd,stat as Kd,symlink as ka}from"fs/promises";import{dirname as Ud,join as Vd,resolve as Yd}from"path";async function bi(n,e){process.platform==="win32"?await ka(Yd(Ud(e),n),e,"junction"):await ka(n,e,"dir")}function vm(n){return n.split("\\").join("/")}var Jd=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"]),Wd=512*1024;async function Sm(n){let e=[];async function t(s,i){let r;try{r=await jd(s)}catch{return}for(let o of r){if(o===".git"||o==="node_modules")continue;let a=Vd(s,o),l=i?`${i}/${o}`:o;try{let c=await Kd(a);if(c.isDirectory())await t(a,l);else if(c.isFile()){let d=o.includes(".")?`.${o.split(".").pop().toLowerCase()}`:"";if(Jd.has(d)||c.size>Wd)continue;try{let u=await Fd(a,"utf-8");e.push({relPath:l,content:u,lineCount:u.split(`
|
|
145
|
-
`).length})}catch{}}}catch{continue}}}return await t(n,""),e}var Ea=Zd();function ep(n,e){let t={directories:[],ruleFiles:[],agentsBlocks:[]};t.directories.push({path:n.originalPath,isSymlink:n.isSymlink});let s=n.dirName;if(n.scope==="project"&&(t.ruleFiles.push(U(".cursor","rules",`${s}.mdc`),U(".windsurf","rules",`${s}.md`),U(".github","instructions",`${s}.instructions.md`)),t.agentsBlocks.push({file:U("AGENTS.md"),skillName:s})),n.scope==="global"){for(let o of e.providers){if(!o.enabled)continue;let a=ce(o.global),l=vn(qe(a),"AGENTS.md");t.agentsBlocks.push({file:l,skillName:s})}let i=vn(Ea,".codex","AGENTS.md");t.agentsBlocks.some(o=>o.file===i)||t.agentsBlocks.push({file:i,skillName:s})}return t}function Em(n,e,t,s){let i=e.filter(f=>f.dirName===n),r=i;if(s?.providerFilter&&(r=r.filter(f=>f.provider===s.providerFilter)),s?.scopeFilter&&(r=r.filter(f=>f.scope===s.scopeFilter)),r.length===0)return{directories:[],ruleFiles:[],agentsBlocks:[]};let o=new Set(i.filter(f=>!r.includes(f)).map(f=>`${f.provider}::${f.scope}`));function a(f){if(f===U("AGENTS.md")){let h=Array.from(o).find(m=>m.endsWith("::project"));return h?{provider:h.split("::")[0],scope:"project"}:null}for(let h of t.providers){let m=ce(h.global),p=vn(qe(m),"AGENTS.md");if(f===p)return{provider:h.name,scope:"global"}}return f===vn(Ea,".codex","AGENTS.md")?{provider:"codex",scope:"global"}:null}let l={directories:[],ruleFiles:[],agentsBlocks:[]},c=new Set,d=new Set,u=new Set;for(let f of r){let h=ep(f,t);for(let m of h.directories)c.has(m.path)||(c.add(m.path),l.directories.push(m));for(let m of h.ruleFiles)d.has(m)||(d.add(m),l.ruleFiles.push(m));for(let m of h.agentsBlocks){let p=`${m.file}::${m.skillName}`;if(u.has(p))continue;let g=a(m.file);if(g){let b=`${g.provider}::${g.scope}`;if(o.has(b))continue}u.add(p),l.agentsBlocks.push(m)}}return l}async function dt(n){try{return await Hd(n),!0}catch{return!1}}async function tp(n,e){if(!await dt(n))return;let t=await Ca(n,"utf-8"),s=!1;for(let i of["agent-skill-manager","skill-manager","pskills"]){let r=`<!-- ${i}: ${e} -->`,o=`<!-- /${i}: ${e} -->`,a=t.indexOf(r),l=t.indexOf(o);if(a===-1||l===-1)continue;let c=a;c>0&&t[c-1]===`
|
|
146
|
-
`&&c--;let u=l+o.length;u<t.length&&t[u]===`
|
|
147
|
-
`&&u++,t=t.slice(0,c)+t.slice(u),s=!0}s&&await Gd(n,t,"utf-8")}function np(n,e){let t=n.filter(i=>i.provider!==e);if(t.length===0)return null;let s=t.find(i=>!i.isSymlink);return s?{path:s.originalPath,provider:s.provider}:{path:t[0].originalPath,provider:t[0].provider}}function Im(n,e,t){if(!n.directories.some(c=>!c.isSymlink))return null;let i=e.filter(c=>c.provider!==t);if(i.length===0)return null;let r=np(e,t);if(!r)return null;let o=n.directories.find(c=>!c.isSymlink),a=i.map(c=>c.originalPath).filter(c=>c!==r.path),l=i.find(c=>c.originalPath===r.path);return l&&!l.isSymlink?a.length===0?null:{needed:!0,fromProvider:t,fromPath:o?.path||"",toProvider:r.provider,toPath:r.path,repointPaths:a,repointOnly:!0}:{needed:!0,fromProvider:t,fromPath:o?.path||"",toProvider:r.provider,toPath:r.path,repointPaths:a}}async function sp(n){let e=[],t=new Set;for(let s of n){let i=qe(s);if(!t.has(i)){t.add(i);try{(await Xd(i)).filter(a=>a!==".DS_Store").length===0&&(await oe(i,{recursive:!0,force:!0}),e.push(i))}catch{}}}return e}async function Lm(n,e,t){let s=[];if(t?.needed){if(!t.repointOnly)try{let o=qe(t.toPath);await $a(o,{recursive:!0});try{await Na(t.toPath)}catch(a){(!(a instanceof Error)||!("code"in a)||a.code!=="ENOENT")&&await oe(t.toPath,{recursive:!0,force:!0})}try{await zd(t.fromPath,t.toPath)}catch(a){if(a instanceof Error&&"code"in a&&a.code==="EXDEV"){let{cp:l}=await import("fs/promises");try{await l(t.fromPath,t.toPath,{recursive:!0,preserveTimestamps:!0})}catch(c){try{await oe(t.toPath,{recursive:!0,force:!0})}catch(d){let u=d instanceof Error?d.message:String(d);s.push(`Failed to clean up partial copy at ${t.toPath}: ${u}`)}throw c}await oe(t.fromPath,{recursive:!0,force:!0})}else throw a}s.push(`Relocated real folder: ${t.fromPath} -> ${t.toPath}`)}catch(o){let a=o instanceof Error?o.message:String(o);s.push(`Failed to relocate real folder: ${a}`);let l=new Error(`Failed to relocate real folder: ${a}`);throw l.log=s,l}for(let o of t.repointPaths||[]){let a=qe(o),l=Aa(a,t.toPath);try{try{await Na(o)}catch(c){(!(c instanceof Error)||!("code"in c)||c.code!=="ENOENT")&&await oe(o,{recursive:!0,force:!0})}await $a(a,{recursive:!0}),await bi(l,o),s.push(`Repointed symlink: ${o} -> ${l}`)}catch(c){let d=c instanceof Error?c.message:String(c);s.push(`Failed to repoint symlink ${o} -> ${l}: ${d}. To fix manually: ln -sfn ${t.toPath} ${o}`)}}}for(let o of n.directories)try{if(t?.needed&&!t.repointOnly&&U(o.path)===U(t.fromPath))continue;if(e&&U(o.path)===U(e)){s.push(`Skipped same-path removal: ${o.path}`);continue}if(o.isSymlink?(await oe(o.path),s.push(`Removed symlink: ${o.path}`)):(await oe(o.path,{recursive:!0,force:!0}),s.push(`Removed directory: ${o.path}`)),!t?.needed&&e&&U(o.path)!==U(e)){let a=qe(o.path),l=Aa(a,e);await bi(l,o.path),s.push(`Created symlink: ${o.path} -> ${l}`)}}catch(a){let l=a instanceof Error?a.message:String(a);s.push(`Failed to remove ${o.path}: ${l}`)}let i=n.directories.map(o=>o.path),r=await sp(i);for(let o of r)s.push(`Removed empty parent directory: ${o}`);for(let o of n.ruleFiles)if(await dt(o))try{await oe(o),s.push(`Removed rule file: ${o}`)}catch(a){let l=a instanceof Error?a.message:String(a);s.push(`Failed to remove ${o}: ${l}`)}for(let o of n.agentsBlocks)try{await tp(o.file,o.skillName),s.push(`Cleaned AGENTS.md block in: ${o.file}`)}catch(a){let l=a instanceof Error?a.message:String(a);s.push(`Failed to clean AGENTS.md block: ${l}`)}return s}async function Tm(n){let e=[];for(let t of n.directories)if(await dt(t.path)){let i=(await Qd(t.path)).isSymbolicLink()?"symlink":"directory";e.push(`${t.path} (${i})`)}for(let t of n.ruleFiles)await dt(t)&&e.push(t);for(let t of n.agentsBlocks)if(await dt(t.file)){let s=await Ca(t.file,"utf-8");(s.includes(`<!-- agent-skill-manager: ${t.skillName} -->`)||s.includes(`<!-- skill-manager: ${t.skillName} -->`)||s.includes(`<!-- pskills: ${t.skillName} -->`))&&e.push(`${t.file} (AGENTS.md block)`)}return e}import{createHash as Sp}from"crypto";import{readFile as wp}from"fs/promises";import{join as kp}from"path";var C=()=>!(process.env.NO_COLOR!==void 0||globalThis.__CLI_NO_COLOR||!process.stdout.isTTY),y={bold:n=>C()?`\x1B[1m${n}\x1B[0m`:n,cyan:n=>C()?`\x1B[36m${n}\x1B[0m`:n,green:n=>C()?`\x1B[32m${n}\x1B[0m`:n,yellow:n=>C()?`\x1B[33m${n}\x1B[0m`:n,dim:n=>C()?`\x1B[2m${n}\x1B[0m`:n,white:n=>C()?`\x1B[37m${n}\x1B[0m`:n,red:n=>C()?`\x1B[31m${n}\x1B[0m`:n,blue:n=>C()?`\x1B[34m${n}\x1B[0m`:n,blueBold:n=>C()?`\x1B[34;1m${n}\x1B[0m`:n,magenta:n=>C()?`\x1B[35m${n}\x1B[0m`:n,bgDim:n=>C()?`\x1B[48;5;236m${n}\x1B[0m`:n,bgRed:n=>C()?`\x1B[41m\x1B[37m\x1B[1m${n}\x1B[0m`:n,bgYellow:n=>C()?`\x1B[43m\x1B[30m\x1B[1m${n}\x1B[0m`:n,bgGreen:n=>C()?`\x1B[42m\x1B[30m\x1B[1m${n}\x1B[0m`:n,bgCyan:n=>C()?`\x1B[46m\x1B[30m\x1B[1m${n}\x1B[0m`:n};function be(n){if(!n)return"";switch(n.toLowerCase()){case"low":return y.green(n);case"medium":return y.yellow(n);case"high":return y.red(n);case"max":return y.magenta(n);default:return n}}var Ia={claude:y.blueBold,codex:y.cyan,"codex-plugin":y.cyan,openclaw:y.yellow,agents:y.green,custom:y.magenta,cursor:y.blue,windsurf:y.cyan,cline:y.green,roocode:y.magenta,continue:y.yellow,copilot:y.white,aider:y.red,opencode:y.cyan,zed:y.blue,augment:y.green,amp:y.yellow};function Me(n,e){return(Ia[n]||y.dim)(e)}function pt(n,e){return C()?(Ia[n]||y.dim)(`[${e}]`):`[${e}]`}function ae(n){let e=process.env.HOME||process.env.USERPROFILE||"";return e&&n.startsWith(e)?"~"+n.slice(e.length):n}function ip(n){if(n.length===0)return"No skills found.";let e=["Name","Version","Creator","Effort","Invoke","Tool","Scope","Type","Path"],t=n.map(l=>[l.disabled?`${l.name} [disabled]`:l.name,l.version,l.creator||"\u2014",l.effort||"\u2014",Oe(l.modelInvocable,l.userInvocable),l.providerLabel,l.scope,l.isSymlink?"symlink":"directory",ae(l.path)]),s=e.map((l,c)=>Math.max(l.length,...t.map(d=>d[c].length))),i=(l,c)=>l.padEnd(c),r=e.map((l,c)=>i(l,s[c])).join(" "),o=s.map(l=>"-".repeat(l)).join("--"),a=t.map((l,c)=>{let d=l.map((u,f)=>i(u,s[f])).join(" ");return n[c].disabled?y.dim(d):d});return[C()?y.bold(r):r,o,...a].join(`
|
|
148
|
-
`)}function ht(n){let e=new Map;for(let s of n){let i=`${s.dirName}||${s.scope}||${s.disabled?"off":"on"}`,r=e.get(i)??[];r.push(s),e.set(i,r)}let t=[];for(let[,s]of e){let i=s[0],r=new Set(s.map(a=>a.scope)),o=new Set(s.map(a=>a.isSymlink?"symlink":"directory"));t.push({name:i.name,version:i.version,creator:i.creator||"",effort:i.effort||"",invoke:Oe(i.modelInvocable,i.userInvocable),tokens:typeof i.tokenCount=="number"?ft(i.tokenCount):"",providers:s.map(a=>({provider:a.provider,label:a.providerLabel})),scope:r.size>1?"mixed":i.scope,type:o.size>1?"mixed":i.isSymlink?"symlink":"directory",path:ae(i.path),warningCount:s.reduce((a,l)=>a+(l.warnings?.length??0),0),disabled:s.every(a=>a.disabled===!0)})}return t}function vi(n){return n.disabled?`${n.name} [disabled]`:n.name}var rp=50;function op(n,e={}){let t=e.topN??5,s=e.showHint??!0;if(n.length===0)return"No skills found.";let i=[],o=ht(n).length,a=n.length,l=new Set(n.map(p=>p.provider)),c=n.filter(p=>p.scope==="global").length,d=n.filter(p=>p.scope==="project").length,u=`${a} skills (${o} unique) across ${l.size} tools | ${c} global, ${d} project`;i.push(C()?y.bold(u):u),i.push("");let f=new Map;for(let p of n){let g=f.get(p.provider)??{label:p.providerLabel,count:0};g.count+=1,f.set(p.provider,g)}let h=[...f.entries()].sort((p,g)=>g[1].count-p[1].count).slice(0,t);i.push(C()?y.bold("Top tools:"):"Top tools:");for(let[p,{label:g,count:b}]of h){let v=C()?Me(p,`[${g}]`):`[${g}]`;i.push(` ${v} ${b} skill${b===1?"":"s"}`)}i.push(""),i.push(C()?y.bold("Scopes:"):"Scopes:"),i.push(` global ${c} skill${c===1?"":"s"}`),i.push(` project ${d} skill${d===1?"":"s"}`);let m=new Map;for(let p of n)p.effort&&m.set(p.effort,(m.get(p.effort)??0)+1);if(m.size>0){let p=[...m.entries()].sort((g,b)=>b[1]-g[1]).slice(0,t);i.push(""),i.push(C()?y.bold("Top efforts:"):"Top efforts:");for(let[g,b]of p){let v=be(g),$=Math.max(0,6-g.length);i.push(` ${v}${" ".repeat($)} ${b} skill${b===1?"":"s"}`)}}if(s){i.push("");let p="Tip: refine with `asm list -p <tool>`, `asm search <query>`, or `asm list --compact`";i.push(C()?y.dim(p):p)}return i.join(`
|
|
149
|
-
`)}function La(n){if(n.length===0)return"No skills found.";let e=ht(n),t=[],s=Math.max(4,...e.map(h=>vi(h).length)),i=Math.max(7,...e.map(h=>h.version.length)),r=e.map(h=>h.providers.map(m=>pt(m.provider,m.label)).join(" ")),o=e.map(h=>h.providers.map(m=>`[${m.label}]`).join(" ")),a=Math.max(5,...o.map(h=>h.length)),l=7,c=(h,m)=>h.padEnd(m);for(let h=0;h<e.length;h++){let m=e[h],p=c(vi(m),s),g=y.dim(c(m.version,i)),b=a-o[h].length,v=r[h]+" ".repeat(Math.max(0,b)),$=y.dim(c(m.scope,l)),N=c(m.invoke,5),A=`${p} ${g} ${N} ${v} ${$}`;t.push(m.disabled?y.dim(A):A)}t.push("");let d=n.length,u=e.length,f=`${d} skills (${u} unique)`;return t.push(y.dim(f)),t.join(`
|
|
150
|
-
`)}function ap(n,e){if(n.length===0)return"No skills found.";let t=new Map,s=c=>{switch(e){case"tool":return[c.providerLabel];case"scope":return[c.scope];case"effort":return[c.effort&&c.effort.length>0?c.effort:"(unset)"]}};for(let c of n)for(let d of s(c)){let u=t.get(d)??[];u.push(c),t.set(d,u)}let i=[...t.entries()].sort((c,d)=>d[1].length!==c[1].length?d[1].length-c[1].length:c[0].localeCompare(d[0])),r=[];for(let[c,d]of i){let u=`${c} (${d.length})`;r.push(C()?y.bold(u):u);let m=La(d).split(`
|
|
151
|
-
`).slice(0,-2).filter(p=>p.length>0).map(p=>` ${p}`);r.push(...m),r.push("")}let o=n.length,a=ht(n).length,l=`${o} skills (${a} unique), grouped by ${e}`;return r.push(y.dim(l)),r.join(`
|
|
152
|
-
`)}function lp(n,e){if(!Number.isFinite(e)||e<=0||n.length<=e)return{skills:n,hint:""};let t=n.slice(0,e),s=n.length-e,i=y.dim(`... ${s} more not shown. Re-run with --limit ${n.length} (or 0) to see all, or refine with -p <tool>.`);return{skills:t,hint:i}}function cp(n){if(n.length===0)return"No skills found.";let e=ht(n),t=[],s=Math.max(4,...e.map(k=>k.name.length)),i=Math.max(7,...e.map(k=>k.version.length)),r=Math.max(7,...e.map(k=>Math.min((k.creator||"\u2014").length,15))),o=Math.max(6,...e.map(k=>(k.effort||"\u2014").length)),a=Math.max(6,...e.map(k=>k.invoke.length)),l=e.some(k=>k.tokens.length>0),c=l?Math.max(6,...e.map(k=>(k.tokens||"\u2014").length)):0,d=7,u=9,f=e.map(k=>k.providers.map(L=>pt(L.provider,L.label)).join(" ")),h=e.map(k=>k.providers.map(L=>`[${L.label}]`).join(" ")),m=Math.max(9,...h.map(k=>k.length)),p=(k,L)=>k.padEnd(L),g=l?` ${p("Tokens",c)}`:"",b=`${p("Name",s)} ${p("Version",i)} ${p("Creator",r)} ${p("Effort",o)} ${p("Invoke",a)}${g} ${p("Tools",m)} ${p("Scope",d)} ${p("Type",u)}`;t.push(C()?y.bold(b):b);let v=l?` ${"-".repeat(c)}`:"";t.push(`${"-".repeat(s)} ${"-".repeat(i)} ${"-".repeat(r)} ${"-".repeat(o)} ${"-".repeat(a)}${v} ${"-".repeat(m)} ${"-".repeat(d)} ${"-".repeat(u)}`);for(let k=0;k<e.length;k++){let L=e[k],V=p(vi(L),s),P=p(L.version,i),ve=(L.creator||"\u2014").slice(0,15),$n=p(ve,r),Nn=L.effort||"\u2014",An=L.effort?be(L.effort):"\u2014",xa=o-Nn.length,Ra=An+" ".repeat(Math.max(0,xa)),Ba=l?` ${p(L.tokens||"\u2014",c)}`:"",ja=m-h[k].length,Fa=f[k]+" ".repeat(Math.max(0,ja)),Ka=p(L.scope,d),Ua=p(L.type,u),Va=L.warningCount>0?` ${y.yellow(`(${L.warningCount} warning${L.warningCount>1?"s":""})`)}`:"",Ya=p(L.invoke,a),Ni=`${V} ${P} ${$n} ${Ra} ${Ya}${Ba} ${Fa} ${Ka} ${Ua}${Va}`;t.push(L.disabled?y.dim(Ni):Ni)}let $=e.length,N=n.length,A=new Set(n.map(k=>k.provider)),E=n.filter(k=>k.scope==="global").length,T=n.filter(k=>k.scope==="project").length;t.push("");let w=`${N} skills (${$} unique) across ${A.size} tools | ${E} global, ${T} project`;return t.push(y.dim(w)),t.join(`
|
|
153
|
-
`)}function up(n,e){if(!C()||!e)return n;let t=n.toLowerCase().indexOf(e.toLowerCase());if(t===-1)return n;let s=n.slice(0,t),i=n.slice(t,t+e.length),r=n.slice(t+e.length);return`${s}${y.bold(y.yellow(i))}${r}`}function fp(n,e){if(n.length===0)return`No skills matching "${e}". Try ${y.bold("asm list")} to see all skills.`;let t=ht(n),s=[];s.push(y.dim(`Found ${n.length} result${n.length===1?"":"s"} (${t.length} unique) matching "${e}"`)+`
|
|
154
|
-
`);let i=Math.max(4,...t.map(g=>g.name.length)),r=Math.max(7,...t.map(g=>g.version.length)),o=Math.max(7,...t.map(g=>Math.min((g.creator||"\u2014").length,15))),a=Math.max(6,...t.map(g=>(g.effort||"\u2014").length)),l=t.map(g=>g.providers.map(b=>pt(b.provider,b.label)).join(" ")),c=t.map(g=>g.providers.map(b=>`[${b.label}]`).join(" ")),d=Math.max(9,...c.map(g=>g.length)),u=7,f=9,h=(g,b)=>g.padEnd(b),m=6,p=`${h("Name",i)} ${h("Version",r)} ${h("Creator",o)} ${h("Effort",a)} ${h("Invoke",m)} ${h("Tools",d)} ${h("Scope",u)} ${h("Type",f)}`;s.push(C()?y.bold(p):p),s.push(`${"-".repeat(i)} ${"-".repeat(r)} ${"-".repeat(o)} ${"-".repeat(a)} ${"-".repeat(m)} ${"-".repeat(d)} ${"-".repeat(u)} ${"-".repeat(f)}`);for(let g=0;g<t.length;g++){let b=t[g],v=up(b.name,e),$=i-b.name.length,N=v+" ".repeat(Math.max(0,$)),A=h(b.version,r),E=(b.creator||"\u2014").slice(0,15),T=h(E,o),w=b.effort||"\u2014",k=b.effort?be(b.effort):"\u2014",L=a-w.length,V=k+" ".repeat(Math.max(0,L)),P=d-c[g].length,ve=l[g]+" ".repeat(Math.max(0,P)),$n=h(b.scope,u),Nn=h(b.type,f),An=h(b.invoke,m);s.push(`${N} ${A} ${T} ${V} ${An} ${ve} ${$n} ${Nn}`)}return s.join(`
|
|
155
|
-
`)}function dp(n,e){if(n.length===0)return"";let t=[];t.push(y.dim(`Found ${n.length} available skill${n.length===1?"":"s"} matching "${e}"`)+`
|
|
156
|
-
`);for(let s of n){t.push(` ${y.dim("To install:")} ${y.green(`asm install ${s.installUrl}`)}`);let i=s.verified?y.blue(" [verified]"):"",r=s.invocability?y.dim(` [${s.invocability}]`):"";t.push(` ${y.cyan(s.name)} ${y.dim(`v${s.version}`)}${i}${r} ${y.dim(`[${s.repoLabel}]`)}`);for(let o of wn(s.description,76))t.push(` ${o}`);t.push("")}return t.join(`
|
|
157
|
-
`)}var Si=new Set(["Bash","Write","Edit","NotebookEdit"]),Ta=new Set(["WebFetch","WebSearch"]);function Oa(n){return Si.has(n)?y.red(n):Ta.has(n)?y.yellow(n):y.green(n)}function Sn(n){return n.length===0?"":n.map(Oa).join(" ")}function wi(n){let e=n.filter(s=>Si.has(s));if(e.length===0)return null;let t=[];return e.includes("Bash")&&t.push("execute shell commands"),(e.includes("Write")||e.includes("Edit")||e.includes("NotebookEdit"))&&t.push("modify files"),`This skill can ${t.join(" and ")}`}function wn(n,e){let t=n.split(/\s+/),s=[],i="";for(let r of t)i.length+r.length+1>e&&i.length>0?(s.push(i),i=r):i=i?i+" "+r:r;return i&&s.push(i),s}function pp(n,e){let t=n==="add"?"Added tags to":"Removed tags from";return e.map(s=>{let i=s.tags.length>0?s.tags.join(", "):"(none)",r=s.changed?"":" (unchanged)";return`${t} ${y.bold(s.name)}: ${i}${r}`}).join(`
|
|
158
|
-
`)}function hp(n){return n.dependencies.length===0?`${n.name} declares no optional skill dependencies.`:[`${y.bold(n.name)} optional dependencies (${n.source}):`,...n.dependencies.map(e=>` - ${e}`)].join(`
|
|
159
|
-
`)}function mp(n){let e=n.owned?"lease-owned copy":"pre-existing target";return`${y.green("\u2713")} ${n.name} ready at ${n.path} (${e}${n.reused?", reused":""})`}function gp(n){return n.alreadyReleased?`Session ${n.sessionId} was already released.`:[`${y.green("\u2713")} released session ${n.sessionId}`,` removed: ${n.removed.length}`,` preserved: ${n.preserved.length}`,` already missing: ${n.missing.length}`,` errors: ${n.errors.length}`].join(`
|
|
160
|
-
`)}function yp(n){return[`${n.dryRun?"Classified":"Cleaned"} dependency leases older than ${n.staleBefore}`,` stale: ${n.stale.length}`,` active: ${n.active.length}`,` cleaned: ${n.cleaned.length}`,` errors: ${n.errors.length}`].join(`
|
|
161
|
-
`)}function bp(n){return JSON.stringify(n,null,2)}async function Pa(n){let e=[],t=(r,o)=>`${C()?y.bold(r+":"):r+":"} ${o}`;e.push(t("Name",n.name)),e.push(t("Version",n.version)),e.push(t("Creator",n.creator||"\u2014")),e.push(t("License",n.license||"\u2014")),n.compatibility&&e.push(t("Compatibility",n.compatibility)),n.effort&&e.push(t("Effort",be(n.effort))),e.push(t("Invocable",Oe(n.modelInvocable,n.userInvocable))),e.push(t("Tool",n.providerLabel)),e.push(t("Scope",n.scope)),e.push(t("Location",n.location)),e.push(t("Path",ae(n.path))),e.push(t("Type",n.isSymlink?"symlink":"directory")),n.isSymlink&&n.symlinkTarget&&e.push(t("Symlink Target",n.symlinkTarget));let s=n.fileCount??await yi(n.path);if(e.push(t("File Count",String(s))),typeof n.tokenCount=="number"&&e.push(t("Est. Tokens",ft(n.tokenCount))),n.description&&(e.push(""),e.push(t("Description",n.description))),n.allowedTools&&n.allowedTools.length>0){e.push(""),e.push(C()?y.bold("Allowed Tools:"):"Allowed Tools:"),e.push(` ${Sn(n.allowedTools)}`);let r=wi(n.allowedTools);r&&e.push(` ${C()?y.yellow("\u26A0"):"!"} ${r}`)}e.push(""),e.push(C()?y.bold("Eval Score:"):"Eval Score:");let i=qa(n);if(i.length>0){let r=i.length>1;for(let o of i){let a=ki(o.overallScore),l=o.providerId?`${o.providerId}@${o.providerVersion??"?"}`:"quality";r?e.push(` ${l}: ${a} / 100 (${o.grade})`):e.push(` Overall: ${a} / 100 (${o.grade})`);let c=o.evaluatedVersion?` \u2014 version ${o.evaluatedVersion}`:"";if(e.push(` ${C()?y.dim("Evaluated:"):"Evaluated:"} ${o.evaluatedAt}${c}`),o.categories.length>0){r?e.push(C()?y.dim(` Categories (${l}):`):` Categories (${l}):`):e.push(C()?y.dim(" Categories:"):" Categories:");for(let d of o.categories)e.push(` ${d.name.padEnd(28)} ${d.score}/${d.max}`)}}}else e.push(C()?y.dim(" Not available \u2014 run `asm eval "+n.path+"` to generate one."):" Not available \u2014 run `asm eval "+n.path+"` to generate one.");if(n.warnings&&n.warnings.length>0){e.push(""),e.push(C()?y.bold("Warnings:"):"Warnings:");for(let r of n.warnings)e.push(` ${C()?y.yellow("!"):"!"} [${r.category}] ${r.message}`)}return e.join(`
|
|
162
|
-
`)}function ki(n){let e=String(n);return C()?n>=90?y.green(e):n>=80?y.cyan(e):n>=65?y.yellow(e):y.red(e):e}function qa(n){return n.evalSummaries&&Object.keys(n.evalSummaries).length>0?Object.values(n.evalSummaries).sort((t,s)=>{let i=t.providerId??"quality",r=s.providerId??"quality";return i==="quality"&&r!=="quality"?-1:r==="quality"&&i!=="quality"?1:i.localeCompare(r)}):n.evalSummary?[n.evalSummary]:[]}async function vp(n){if(n.length===0)return"No skills found.";if(n.length===1)return Pa(n[0]);let e=[],t=(d,u)=>`${C()?y.bold(d+":"):d+":"} ${u}`,s=n[0],i=s.name;e.push(""),e.push(C()?y.blueBold(` ${i}`):` ${i}`),e.push(C()?y.dim(" "+"-".repeat(i.length+2)):" "+"-".repeat(i.length+2)),e.push(""),e.push(t(" Version",s.version)),e.push(t(" Creator",s.creator||"\u2014")),e.push(t(" License",s.license||"\u2014")),s.compatibility&&e.push(t(" Compatibility",s.compatibility)),s.effort&&e.push(t(" Effort",be(s.effort))),e.push(t(" Invocable",Oe(s.modelInvocable,s.userInvocable)));let r=s.fileCount??await yi(s.path);e.push(t(" File Count",String(r))),typeof s.tokenCount=="number"&&e.push(t(" Est. Tokens",ft(s.tokenCount)));let o=n.map(d=>pt(d.provider,d.providerLabel)).join(" ");e.push(t(" Installed in",o)),e.push(""),e.push(C()?y.bold(" Eval Score:"):" Eval Score:");let a=qa(s);if(a.length>0){let d=a.length>1;for(let u of a){let f=ki(u.overallScore),h=u.providerId?`${u.providerId}@${u.providerVersion??"?"}`:"quality";d?e.push(` ${h}: ${f} / 100 (${u.grade})`):e.push(` Overall: ${f} / 100 (${u.grade})`);let m=u.evaluatedVersion?` \u2014 version ${u.evaluatedVersion}`:"";if(e.push(` ${C()?y.dim("Evaluated:"):"Evaluated:"} ${u.evaluatedAt}${m}`),u.categories.length>0)for(let p of u.categories)e.push(` ${p.name.padEnd(28)} ${p.score}/${p.max}`)}}else e.push(C()?y.dim(` Not available \u2014 run \`asm eval ${s.path}\` to generate one.`):` Not available \u2014 run \`asm eval ${s.path}\` to generate one.`);if(s.description){e.push(""),e.push(C()?y.bold(" Description:"):" Description:");let d=wn(s.description,72);for(let u of d)e.push(" "+u)}if(s.allowedTools&&s.allowedTools.length>0){e.push(""),e.push(C()?y.bold(" Allowed Tools:"):" Allowed Tools:"),e.push(` ${Sn(s.allowedTools)}`);let d=wi(s.allowedTools);d&&e.push(` ${C()?y.yellow("\u26A0"):"!"} ${d}`)}e.push("");let l=` Installations (${n.length})`;e.push(C()?y.bold(l):l);for(let d=0;d<n.length;d++){let u=n[d],f=Me(u.provider,u.providerLabel),h=u.isSymlink?"symlink":"directory",m=y.dim(u.scope);e.push(` ${f} (${m}, ${h})`),e.push(` ${y.dim("Path:")} ${ae(u.path)}`),u.isSymlink&&u.symlinkTarget&&e.push(` ${y.dim("Target:")} ${u.symlinkTarget}`)}let c=n.flatMap(d=>!d.warnings||d.warnings.length===0?[]:d.warnings.map(u=>({...u,provider:d.providerLabel})));if(c.length>0){e.push("");let d=` Warnings (${c.length})`;e.push(C()?y.bold(d):d);for(let u of c){let f=C()?y.yellow("!"):"!";e.push(` ${f} [${u.category}] ${u.message}`)}}return e.push(""),e.join(`
|
|
163
|
-
`)}function kn(n){return n.toLowerCase().replace(/[_\s]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function $p(n,e){let t=n.split("."),s=e.split("."),i=Math.max(t.length,s.length);for(let r=0;r<i;r++){let o=t[r]??"",a=s[r]??"";if(o===a)continue;if(o==="")return-1;if(a==="")return 1;let l=/^\d+$/.test(o)?Number.parseInt(o,10):null,c=/^\d+$/.test(a)?Number.parseInt(a,10):null;if(l!==null&&c!==null&&l!==c)return l-c;if(l===null||c===null){let d=o.localeCompare(a);if(d!==0)return d}}return 0}function _a(n){let e=new Set;for(let t of n){let s=(t.version??"").trim();s&&e.add(s)}return[...e].sort($p)}function $i(n){return _a(n).length>=2}function Np(n){let e=n.split(`
|
|
164
|
-
`);if(e.length===0||e[0].trim()!=="---")return n;for(let t=1;t<e.length;t++)if(e[t].trim()==="---")return e.slice(t+1).join(`
|
|
165
|
-
`);return n}function Ap(n){let e=n._skillMdContent;return e===void 0?null:Sp("sha256").update(Np(e)).digest("hex")}async function Gm(n){if(n._skillMdContent===void 0)try{let e=await wp(kp(n.path,"SKILL.md"),"utf-8");bn(n,e)}catch{}}function Ma(n){if(!(n.length<2||n.some(e=>e===null)))return new Set(n).size===1?"identical":"diverged"}function Hm(n){let e=[],t=new Set,s=new Map,i=[];for(let u of n){let f=s.get(u.realPath);if(f){if(u.isSymlink)continue;(f.isSymlink||u.scope==="global"&&f.scope!=="global")&&(i[i.indexOf(f)]=u,s.set(u.realPath,u))}else s.set(u.realPath,u),i.push(u)}let r=new Map(i.map(u=>[u,Ap(u)])),o=new Map;for(let u of i){let f=kn(u.dirName),h=o.get(f)??{key:u.dirName,variants:new Set,members:[]};h.variants.add(u.dirName),h.members.push(u),o.set(f,h)}for(let u of o.values())if(new Set(u.members.map(h=>h.location)).size>=2){let h=Ma(u.members.map(m=>r.get(m)??null));e.push({key:u.key,reason:"same-dirName",instances:u.members,versionDivergence:$i(u.members),...h?{contentClass:h}:{},...u.variants.size>1?{variants:[...u.variants]}:{}});for(let m of u.members)t.add(m.path)}let a=new Map;for(let u of i){if(!u.name)continue;let f=kn(u.name),h=a.get(f)??{key:u.name,variants:new Set,members:[]};h.variants.add(u.name),h.members.push(u),a.set(f,h)}for(let u of a.values()){let f=u.members;if(new Set(f.map(v=>v.dirName)).size<2)continue;let m=f.filter(v=>!t.has(v.path));if(m.length<2||new Set(m.map(v=>v.dirName)).size<2)continue;let g=new Set(m.map(v=>v.name)),b=Ma(m.map(v=>r.get(v)??null));e.push({key:u.key,reason:"same-frontmatterName",instances:m,versionDivergence:$i(m),...b?{contentClass:b}:{},...g.size>1?{variants:[...g]}:{}});for(let v of m)t.add(v.path)}let l=new Map;for(let u of i){if(t.has(u.path))continue;let f=r.get(u);if(!f)continue;let h=l.get(f)??[];h.push(u),l.set(f,h)}for(let u of l.values())u.length<2||new Set(u.map(f=>f.dirName)).size<2||e.push({key:u[0].dirName,reason:"same-content",instances:u,versionDivergence:$i(u),contentClass:"identical"});let c={"same-dirName":0,"same-frontmatterName":1,"same-content":2};e.sort((u,f)=>u.reason!==f.reason?c[u.reason]-c[f.reason]:kn(u.key).localeCompare(kn(f.key))||u.key.localeCompare(f.key));let d=e.reduce((u,f)=>u+f.instances.length,0);return{scannedAt:new Date().toISOString(),totalSkills:n.length,duplicateGroups:e,totalDuplicateInstances:d}}function Cp(n){return[...n].sort((e,t)=>{if(e.scope!==t.scope)return e.scope==="global"?-1:1;let s=e.providerLabel.localeCompare(t.providerLabel);return s!==0?s:e.path.localeCompare(t.path)})}function Ep(n){return n==="same-dirName"?"same dirName":n==="same-content"?"identical content":"same name"}function Qm(n){if(n.duplicateGroups.length===0)return y.green("No duplicate skills found.");let e=[];e.push(""),e.push(y.bold(` Found ${n.duplicateGroups.length} duplicate group(s) (${n.totalDuplicateInstances} total instances):`)),e.push("");for(let t of n.duplicateGroups){if(e.push(` ${y.yellow(`"${t.key}"`)} ${y.dim(`(${Ep(t.reason)})`)}`),t.variants&&t.variants.length>1){let i=t.variants.map(r=>`"${r}"`).join(", ");e.push(y.dim(` variants: ${i}`))}if(t.contentClass==="identical"?e.push(y.green(" \u2713 identical copies")):t.contentClass==="diverged"&&(e.push(y.yellow(" \u26A0 diverged copies")),e.push(y.dim(" auto-remove skips copies that differ unless you pass --force"))),t.versionDivergence){let i=_a(t.instances).slice().reverse();e.push(y.red(` \u26A0 versions differ: ${i.map(r=>`v${r}`).join(", ")} \u2014 possible upgrade/shadow, not identical copies`))}let s=Cp(t.instances);for(let i=0;i<s.length;i++){let r=s[i],o=Me(r.provider,r.providerLabel),a=i===0?y.green(" [keep]"):y.dim(" "),l=y.dim(`(${r.scope})`),c=(r.version??"").trim(),d=c?y.dim(` (v${c})`):"";e.push(` ${a} ${o} ${l}${d} ${y.dim(ae(r.path))}`)}e.push("")}return e.push(y.dim(` Run ${y.bold("asm audit -y")} to auto-remove duplicates`)),e.push(""),e.join(`
|
|
166
|
-
`)}function zm(n){return JSON.stringify(n,null,2)}function Zm(n){let e=n.trim();if(!e)return["vi",[]];let t=[],s="",i=!1,r=0;for(;r<e.length;){let o=e[r];if(o==='"'){for(i=!0,r++;r<e.length&&e[r]!=='"';){if(e[r]==="\\"&&r+1<e.length){let a=e[r+1];if(a==='"'||a==="\\"){s+=a,r+=2;continue}}s+=e[r],r++}r++}else if(o==="'"){for(i=!0,r++;r<e.length&&e[r]!=="'";)s+=e[r],r++;r++}else o===" "||o===" "?((s.length>0||i)&&(t.push(s),s="",i=!1),r++):(s+=o,r++)}return(s.length>0||i)&&t.push(s),t.length===0?["vi",[]]:[t[0],t.slice(1)]}import{readFileSync as Ip}from"fs";import{resolve as Lp,dirname as Tp}from"path";import{fileURLToPath as Op}from"url";import{spawnSync as Pp}from"child_process";var qp=Tp(Op(import.meta.url)),Da="2.19.0";try{let n=Ip(Lp(qp,"../../package.json"),"utf-8");Da=JSON.parse(n).version}catch{}var le,Mp=Da;function _p(){if(le!==void 0)return le;let n="0c5a0eb";if(n!==void 0)return le=n,le;le="unknown";try{le=Pp("git",["rev-parse","--short","HEAD"],{encoding:"utf-8",stdio:["pipe","pipe","ignore"],timeout:5e3}).stdout?.trim()||le}catch{}return le}function rg(){return`v${Mp} (${_p()})`}export{mn as a,ft as b,nm as c,sm as d,ha as e,ai as f,li as g,ci as h,ui as i,fi as j,kd as k,$d as l,di as m,pi as n,Oe as o,em as p,y as q,be as r,Me as s,ae as t,ip as u,rp as v,op as w,La as x,ap as y,lp as z,cp as A,fp as B,dp as C,Si as D,Ta as E,wn as F,pp as G,hp as H,mp as I,gp as J,yp as K,bp as L,yi as M,pm as N,hm as O,mm as P,vp as Q,Mp as R,rg as S,bi as T,vm as U,Jd as V,Wd as W,Sm as X,ep as Y,Em as Z,Im as _,Lm as $,Tm as aa,kn as ba,Ap as ca,Gm as da,Hm as ea,Cp as fa,Ep as ga,Qm as ha,zm as ia,Zm as ja};
|
package/dist/chunk-KWWFXT5F.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __asmCreateRequire } from 'node:module'; const require = __asmCreateRequire(import.meta.url);
|
|
2
|
-
import{readFile as v,writeFile as I,mkdir as A,copyFile as R}from"fs/promises";import{join as l,resolve as g,dirname as _}from"path";import{fileURLToPath as D}from"url";import{homedir as h}from"os";var k=!1,x=0;function F(e){k=e,e&&(x=performance.now())}function a(e){if(!k)return;let r=Math.round(performance.now()-x),s=globalThis.__CLI_NO_COLOR?`[verbose] +${r}ms`:`\x1B[2m[verbose] +${r}ms\x1B[0m`;console.error(`${s} ${e}`)}var L=D(import.meta.url),C=_(L);function i(){let e=process.env.ASM_CONFIG_DIR;return e||l(h(),".config","agent-skill-manager")}var O=[{name:"agents",label:"Agents",global:"~/.agents/skills",project:".agents/skills",enabled:!0},{name:"claude",label:"Claude Code",global:"~/.claude/skills",project:".claude/skills",enabled:!0},{name:"pi",label:"Pi",global:"~/.pi/skills",project:".pi/skills",enabled:!0},{name:"opencode",label:"OpenCode",global:"~/.config/opencode/skills",project:".opencode/skills",enabled:!0},{name:"codex",label:"Codex",global:"~/.codex/skills",project:".codex/skills",enabled:!0},{name:"omp",label:"Oh My Pi",global:"~/.omp/agent/skills",project:".omp/skills",enabled:!0},{name:"grok",label:"Grok CLI",global:"~/.grok/skills",project:".grok/skills",enabled:!0},{name:"hermes",label:"Hermes",global:"~/.hermes/skills",project:".hermes/skills",enabled:!0},{name:"openclaw",label:"OpenClaw",global:"~/.openclaw/skills",project:".openclaw/skills",enabled:!0},{name:"cursor",label:"Cursor",global:"~/.cursor/rules",project:".cursor/rules",enabled:!0},{name:"copilot",label:"GitHub Copilot",global:"~/.github/instructions",project:".github/instructions",enabled:!0},{name:"windsurf",label:"Windsurf",global:"~/.windsurf/rules",project:".windsurf/rules",enabled:!0},{name:"antigravity",label:"Google Antigravity",global:"~/.antigravity/skills",project:".antigravity/skills",enabled:!0},{name:"gemini",label:"Gemini CLI",global:"~/.gemini/skills",project:".gemini/skills",enabled:!0},{name:"cline",label:"Cline",global:"~/Documents/Cline/Rules",project:".clinerules",enabled:!0},{name:"roocode",label:"Roo Code",global:"~/.roo/rules",project:".roo/rules",enabled:!0},{name:"continue",label:"Continue",global:"~/.continue/rules",project:".continue/rules",enabled:!0},{name:"aider",label:"Aider",global:"~/.aider/skills",project:".aider/skills",enabled:!0},{name:"zed",label:"Zed",global:"~/.config/zed/prompt_overrides",project:".zed/rules",enabled:!0},{name:"augment",label:"Augment",global:"~/.augment/rules",project:".augment/rules",enabled:!0},{name:"amp",label:"Amp",global:"~/.amp/skills",project:".amp/skills",enabled:!0}];function d(){return{version:1,providers:O.map(e=>({...e})),customPaths:[],preferences:{defaultScope:"both",defaultSort:"name"}}}function j(){return l(i(),"config.json")}function U(){return l(i(),".skill-lock.json")}function V(){return l(i(),"skill-state.json")}function B(){return l(i(),"skill-tags.json")}function H(){return l(i(),"skill-index")}function P(){return l(i(),"library")}function K(){return l(P(),"skills")}function Z(){return l(P(),"library-lock.json")}function q(){return l(i(),"dependency-leases")}function Q(){return g(C,"..","data","skill-index")}function N(){return g(C,"..","data","skill-index-resources.json")}async function X(){let e=N(),r=await v(e,"utf-8");return JSON.parse(r)}function Y(e){return e.startsWith("~/")?l(h(),e.slice(2)):e.startsWith("/")?e:g(e)}function $(e){let r=d(),n=e.providers||[],s=new Set(n.map(o=>o.name));for(let o=0;o<r.providers.length;o++){let t=r.providers[o];if(s.has(t.name))continue;let b=n.length;for(let u=o-1;u>=0;u--){let y=r.providers[u].name,m=n.findIndex(S=>S.name===y);if(m!==-1){b=m+1;break}}n.splice(b,0,{...t}),s.add(t.name)}let w=new Map(r.providers.map((o,t)=>[o.name,t])),c=new Map,f=-1;for(let o of n){let t=w.get(o.name);t===void 0?c.set(o,f+.5):(f=t,c.set(o,t))}return n.sort((o,t)=>c.get(o)-c.get(t)),{version:e.version??r.version,providers:n,customPaths:e.customPaths??[],preferences:{defaultScope:e.preferences?.defaultScope??r.preferences.defaultScope,defaultSort:e.preferences?.defaultSort??r.preferences.defaultSort,selectedTools:e.preferences?.selectedTools}}}async function T(){let e=j();a(`config: checking ${e}`);let r;try{r=await v(e,"utf-8")}catch(n){if(n?.code==="ENOENT"){a("config: using defaults (file not found)");let s=d();return await p(s),s}throw n}try{let n=JSON.parse(r);return a(`config: loaded from ${e}`),$(n)}catch{let n=e+".bak";a(`config: parse error, backing up to ${n}`),await R(e,n),console.error(`Warning: Config file was corrupted. Backup saved to ${n}. Using defaults.`);let s=d();return await p(s),s}}async function p(e){let r=j();await A(i(),{recursive:!0}),await I(r,JSON.stringify(e,null,2)+`
|
|
3
|
-
`,"utf-8")}async function ee(e){let r=await T();r.preferences.selectedTools=e,await p(r)}export{F as a,a as b,i as c,d,j as e,U as f,V as g,B as h,H as i,P as j,K as k,Z as l,q as m,Q as n,N as o,X as p,Y as q,T as r,p as s,ee as t};
|
package/dist/config-JPFUVYBM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __asmCreateRequire } from 'node:module'; const require = __asmCreateRequire(import.meta.url);
|
|
2
|
-
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r}from"./chunk-KWWFXT5F.js";import"./chunk-RSVWCEZR.js";export{l as getBundledIndexDir,a as getConfigDir,c as getConfigPath,b as getDefaultConfig,k as getDependencyLeasesDir,g as getIndexDir,h as getLibraryDir,j as getLibraryLockPath,i as getLibrarySkillsDir,d as getLockPath,m as getSkillIndexResourcesPath,e as getSkillStatePath,f as getSkillTagsPath,p as loadConfig,n as loadSkillIndexResources,o as resolveProviderPath,q as saveConfig,r as saveSelectedTools};
|