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
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createRequire as __asmCreateRequire } from 'node:module'; const require = __asmCreateRequire(import.meta.url);
|
|
2
|
+
import{b as q,r as de}from"./chunk-HODWB56T.js";import{a as yt,b as S,d as el}from"./chunk-RSVWCEZR.js";var I=S(D=>{"use strict";var In=Symbol.for("yaml.alias"),Ii=Symbol.for("yaml.document"),bt=Symbol.for("yaml.map"),Ti=Symbol.for("yaml.pair"),Tn=Symbol.for("yaml.scalar"),vt=Symbol.for("yaml.seq"),W=Symbol.for("yaml.node.type"),tl=n=>!!n&&typeof n=="object"&&n[W]===In,nl=n=>!!n&&typeof n=="object"&&n[W]===Ii,sl=n=>!!n&&typeof n=="object"&&n[W]===bt,il=n=>!!n&&typeof n=="object"&&n[W]===Ti,Li=n=>!!n&&typeof n=="object"&&n[W]===Tn,rl=n=>!!n&&typeof n=="object"&&n[W]===vt;function Pi(n){if(n&&typeof n=="object")switch(n[W]){case bt:case vt:return!0}return!1}function ol(n){if(n&&typeof n=="object")switch(n[W]){case In:case bt:case Tn:case vt:return!0}return!1}var al=n=>(Li(n)||Pi(n))&&!!n.anchor;D.ALIAS=In;D.DOC=Ii;D.MAP=bt;D.NODE_TYPE=W;D.PAIR=Ti;D.SCALAR=Tn;D.SEQ=vt;D.hasAnchor=al;D.isAlias=tl;D.isCollection=Pi;D.isDocument=nl;D.isMap=sl;D.isNode=ol;D.isPair=il;D.isScalar=Li;D.isSeq=rl});var Re=S(Ln=>{"use strict";var _=I(),R=Symbol("break visit"),Oi=Symbol("skip children"),Y=Symbol("remove node");function St(n,e){let t=qi(e);_.isDocument(n)?$e(null,n.contents,t,Object.freeze([n]))===Y&&(n.contents=null):$e(null,n,t,Object.freeze([]))}St.BREAK=R;St.SKIP=Oi;St.REMOVE=Y;function $e(n,e,t,s){let i=Mi(n,e,t,s);if(_.isNode(i)||_.isPair(i))return _i(n,s,i),$e(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=$e(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=$e("key",e.key,t,s);if(r===R)return R;r===Y&&(e.key=null);let o=$e("value",e.value,t,s);if(o===R)return R;o===Y&&(e.value=null)}}return i}async function wt(n,e){let t=qi(e);_.isDocument(n)?await Ne(null,n.contents,t,Object.freeze([n]))===Y&&(n.contents=null):await Ne(null,n,t,Object.freeze([]))}wt.BREAK=R;wt.SKIP=Oi;wt.REMOVE=Y;async function Ne(n,e,t,s){let i=await Mi(n,e,t,s);if(_.isNode(i)||_.isPair(i))return _i(n,s,i),Ne(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 Ne(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 Ne("key",e.key,t,s);if(r===R)return R;r===Y&&(e.key=null);let o=await Ne("value",e.value,t,s);if(o===R)return R;o===Y&&(e.value=null)}}return i}function qi(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 Mi(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 _i(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`)}}Ln.visit=St;Ln.visitAsync=wt});var Pn=S(xi=>{"use strict";var Di=I(),ll=Re(),cl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ul=n=>n.replace(/[!,[\]{}]/g,e=>cl[e]),Be=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+ul(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&&Di.isNode(e.contents)){let r={};ll.visit(e.contents,(o,a)=>{Di.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
|
+
`)}};Be.defaultYaml={explicit:!1,version:"1.2"};Be.defaultTags={"!!":"tag:yaml.org,2002:"};xi.Directives=Be});var kt=S(je=>{"use strict";var Ri=I(),fl=Re();function dl(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 Bi(n){let e=new Set;return fl.visit(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function ji(n,e){for(let t=1;;++t){let s=`${n}${t}`;if(!e.has(s))return s}}function pl(n,e){let t=[],s=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Bi(n));let o=ji(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=s.get(r);if(typeof o=="object"&&o.anchor&&(Ri.isScalar(o.node)||Ri.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}}je.anchorIsValid=dl;je.anchorNames=Bi;je.createNodeAnchors=pl;je.findNewAnchor=ji});var On=S(Fi=>{"use strict";function Fe(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=Fe(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=Fe(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=Fe(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=Fe(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}Fi.applyReviver=Fe});var z=S(Ui=>{"use strict";var hl=I();function Ki(n,e,t){if(Array.isArray(n))return n.map((s,i)=>Ki(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!hl.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}Ui.toJS=Ki});var $t=S(Yi=>{"use strict";var ml=On(),Vi=I(),gl=z(),qn=class{constructor(e){Object.defineProperty(this,Vi.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(!Vi.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=gl.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?ml.applyReviver(r,{"":a},"",a):a}};Yi.NodeBase=qn});var Ke=S(Gi=>{"use strict";var yl=kt(),bl=Re(),Ae=I(),vl=$t(),Sl=z(),Mn=class extends vl.NodeBase{constructor(e){super(Ae.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=[],bl.visit(e,{Node:(r,o)=>{(Ae.isAlias(o)||Ae.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||(Sl.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=Nt(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(yl.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 Nt(n,e,t){if(Ae.isAlias(e)){let s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(Ae.isCollection(e)){let s=0;for(let i of e.items){let r=Nt(n,i,t);r>s&&(s=r)}return s}else if(Ae.isPair(e)){let s=Nt(n,e.key,t),i=Nt(n,e.value,t);return Math.max(s,i)}return 1}Gi.Alias=Mn});var M=S(_n=>{"use strict";var wl=I(),kl=$t(),$l=z(),Nl=n=>!n||typeof n!="function"&&typeof n!="object",X=class extends kl.NodeBase{constructor(e){super(wl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:$l.toJS(this.value,e,t)}toString(){return String(this.value)}};X.BLOCK_FOLDED="BLOCK_FOLDED";X.BLOCK_LITERAL="BLOCK_LITERAL";X.PLAIN="PLAIN";X.QUOTE_DOUBLE="QUOTE_DOUBLE";X.QUOTE_SINGLE="QUOTE_SINGLE";_n.Scalar=X;_n.isScalarValue=Nl});var Ue=S(Wi=>{"use strict";var Al=Ke(),pe=I(),Ji=M(),Cl="tag:yaml.org,2002:";function El(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 Il(n,e,t){if(pe.isDocument(n)&&(n=n.contents),pe.isNode(n))return n;if(pe.isPair(n)){let u=t.schema[pe.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 Al.Alias(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=Cl+e.slice(2));let c=El(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let u=new Ji.Scalar(n);return l&&(l.node=u),u}c=n instanceof Map?o[pe.MAP]:Symbol.iterator in Object(n)?o[pe.SEQ]:o[pe.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 Ji.Scalar(n);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}Wi.createNode=Il});var Ct=S(At=>{"use strict";var Tl=Ue(),G=I(),Ll=$t();function Dn(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 Tl.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 Hi=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,xn=class extends Ll.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=>G.isNode(s)||G.isPair(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Hi(e))this.add(t);else{let[s,...i]=e,r=this.get(s,!0);if(G.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,Dn(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(G.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&&G.isScalar(r)?r.value:r:G.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!G.isPair(t))return!1;let s=t.value;return s==null||e&&G.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 G.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(G.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,Dn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};At.Collection=xn;At.collectionFromPath=Dn;At.isEmptyPath=Hi});var Ve=S(Et=>{"use strict";var Pl=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Rn(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var Ol=(n,e,t)=>n.endsWith(`
|
|
4
|
+
`)?Rn(t,e):t.includes(`
|
|
5
|
+
`)?`
|
|
6
|
+
`+Rn(t,e):(n.endsWith(" ")?"":" ")+t;Et.indentComment=Rn;Et.lineComment=Ol;Et.stringifyComment=Pl});var zi=S(Ye=>{"use strict";var ql="flow",Bn="block",It="quoted";function Ml(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===Bn&&(p=Qi(n,p,e.length),p!==-1&&(u=p+l));for(let $;$=n[p+=1];){if(t===It&&$==="\\"){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===Bn&&(p=Qi(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===It){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[$],C=c[$+1]||n.length;N===0?v=`
|
|
10
|
+
${e}${n.slice(0,C)}`:(t===It&&d[N]&&(v+=`${n[N]}\\`),v+=`
|
|
11
|
+
${e}${n.slice(N+1,C)}`)}return v}function Qi(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}Ye.FOLD_BLOCK=Bn;Ye.FOLD_FLOW=ql;Ye.FOLD_QUOTED=It;Ye.foldFlowLines=Ml});var Je=S(Xi=>{"use strict";var F=M(),Z=zi(),Lt=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Pt=n=>/^(%|---|\.\.\.)/m.test(n);function _l(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 Ge(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Pt(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,Lt(e,!1))}function jn(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Ge(n,e);let t=e.indent||(Pt(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${t}`)+"'";return e.implicitKey?s:Z.foldFlowLines(s,t,Z.FOLD_FLOW,Lt(e,!1))}function Ce(n,e){let{singleQuote:t}=e.options,s;if(t===!1)s=Ge;else{let i=n.includes('"'),r=n.includes("'");i&&!r?s=jn:r&&!i?s=Ge:s=t?jn:Ge}return s(n,e)}var Fn;try{Fn=new RegExp(`(^|(?<!
|
|
19
|
+
))
|
|
20
|
+
+(?!
|
|
21
|
+
|$)`,"g")}catch{Fn=/\n+(?!\n|$)/g}function Tt({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 Ce(t,s);let c=s.indent||(s.forceBlockIndent||Pt(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===F.Scalar.BLOCK_FOLDED?!1:e===F.Scalar.BLOCK_LITERAL?!0:!_l(t,l,c.length);if(!t)return d?`|
|
|
22
|
+
`:`>
|
|
23
|
+
`;let u,f;for(f=t.length;f>0;--f){let C=t[f-1];if(C!==`
|
|
24
|
+
`&&C!==" "&&C!==" ")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(Fn,`$&${c}`));let p=!1,g,b=-1;for(g=0;g<t.length;++g){let C=t[g];if(C===" ")p=!0;else if(C===`
|
|
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 C=t.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),E=!1,L=Lt(s,!0);o!=="folded"&&e!==F.Scalar.BLOCK_FOLDED&&(L.onOverflow=()=>{E=!0});let w=Z.foldFlowLines(`${v}${C}${h}`,c,Z.FOLD_BLOCK,L);if(!E)return`>${N}
|
|
29
|
+
${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${N}
|
|
30
|
+
${c}${v}${t}${h}`}function Dl(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 Ce(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
|
|
32
|
+
`)?Ce(r,e):Tt(n,e,t,s);if(!a&&!d&&i!==F.Scalar.PLAIN&&r.includes(`
|
|
33
|
+
`))return Tt(n,e,t,s);if(Pt(r)){if(l==="")return e.forceBlockIndent=!0,Tt(n,e,t,s);if(a&&l===c)return Ce(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 Ce(r,e)}return a?u:Z.foldFlowLines(u,l,Z.FOLD_FLOW,Lt(e,!1))}function xl(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?Ce(o.value,e):Tt(o,e,t,s);case F.Scalar.QUOTE_DOUBLE:return Ge(o.value,e);case F.Scalar.QUOTE_SINGLE:return jn(o.value,e);case F.Scalar.PLAIN:return Dl(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}Xi.stringifyString=xl});var We=S(Kn=>{"use strict";var Rl=kt(),ee=I(),Bl=Ve(),jl=Je();function Fl(n,e){let t=Object.assign({blockQuote:!0,commentString:Bl.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 Kl(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(ee.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 Ul(n,e,{anchors:t,doc:s}){if(!s.directives)return"";let i=[],r=(ee.isScalar(n)||ee.isCollection(n))&&n.anchor;r&&Rl.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 Vl(n,e,t,s){if(ee.isPair(n))return n.toString(e,t,s);if(ee.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=ee.isNode(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=Kl(e.doc.schema.tags,r));let o=Ul(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):ee.isScalar(r)?jl.stringifyString(r,e,t,s):r.toString(e,t,s);return o?ee.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
+
${e.indent}${a}`:a}Kn.createStringifyContext=Fl;Kn.stringify=Vl});var nr=S(tr=>{"use strict";var H=I(),Zi=M(),er=We(),He=Ve();function Yl({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=H.isNode(n)&&n.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(H.isCollection(n)||!H.isNode(n)&&typeof n=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let h=!u&&(!n||f&&e==null&&!t.inFlow||H.isCollection(n)||(H.isScalar(n)?n.type===Zi.Scalar.BLOCK_FOLDED||n.type===Zi.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=er.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+=He.lineComment(g,t.indent,c(f)):p&&i&&i(),g;m&&(f=null),h?(f&&(g+=He.lineComment(g,t.indent,c(f))),g=`? ${g}
|
|
36
|
+
${a}:`):(g=`${g}:`,f&&(g+=He.lineComment(g,t.indent,c(f))));let b,v,$;H.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&&H.isScalar(e)&&(t.indentAtStart=g.length+1),p=!1,!d&&l.length>=2&&!t.inFlow&&!h&&H.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1,C=er.stringify(e,t,()=>N=!0,()=>p=!0),E=" ";if(f||b||v){if(E=b?`
|
|
37
|
+
`:"",v){let L=c(v);E+=`
|
|
38
|
+
${He.indentComment(L,t.indent)}`}C===""&&!t.inFlow?E===`
|
|
39
|
+
`&&$&&(E=`
|
|
40
|
+
|
|
41
|
+
`):E+=`
|
|
42
|
+
${t.indent}`}else if(!h&&H.isCollection(e)){let L=C[0],w=C.indexOf(`
|
|
43
|
+
`),k=w!==-1,T=t.inFlow??e.flow??e.items.length===0;if(k||!T){let V=!1;if(k&&(L==="&"||L==="!")){let O=C.indexOf(" ");L==="&"&&O!==-1&&O<w&&C[O+1]==="!"&&(O=C.indexOf(" ",O+1)),(O===-1||w<O)&&(V=!0)}V||(E=`
|
|
44
|
+
${t.indent}`)}}else(C===""||C[0]===`
|
|
45
|
+
`)&&(E="");return g+=E+C,t.inFlow?N&&s&&s():$&&!N?g+=He.lineComment(g,t.indent,c($)):p&&i&&i(),g}tr.stringifyPair=Yl});var Vn=S(Un=>{"use strict";var sr=yt("process");function Gl(n,...e){n==="debug"&&console.log(...e)}function Jl(n,e){(n==="debug"||n==="warn")&&(typeof sr.emitWarning=="function"?sr.emitWarning(e):console.warn(e))}Un.debug=Gl;Un.warn=Jl});var Dt=S(_t=>{"use strict";var Mt=I(),ir=M(),Ot="<<",qt={identify:n=>n===Ot||typeof n=="symbol"&&n.description===Ot,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ir.Scalar(Symbol(Ot)),{addToJSMap:rr}),stringify:()=>Ot},Wl=(n,e)=>(qt.identify(e)||Mt.isScalar(e)&&(!e.type||e.type===ir.Scalar.PLAIN)&&qt.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===qt.tag&&t.default);function rr(n,e,t){let s=or(n,t);if(Mt.isSeq(s))for(let i of s.items)Yn(n,e,i);else if(Array.isArray(s))for(let i of s)Yn(n,e,i);else Yn(n,e,s)}function Yn(n,e,t){let s=or(n,t);if(!Mt.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 or(n,e){return n&&Mt.isAlias(e)?e.resolve(n.doc,n):e}_t.addMergeToJSMap=rr;_t.isMergeKey=Wl;_t.merge=qt});var Jn=S(cr=>{"use strict";var Hl=Vn(),ar=Dt(),Ql=We(),lr=I(),Gn=z();function zl(n,e,{key:t,value:s}){if(lr.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(ar.isMergeKey(n,t))ar.addMergeToJSMap(n,e,s);else{let i=Gn.toJS(t,"",n);if(e instanceof Map)e.set(i,Gn.toJS(s,i,n));else if(e instanceof Set)e.add(i);else{let r=Xl(t,i,n),o=Gn.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 Xl(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(lr.isNode(n)&&t?.doc){let s=Ql.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)+'..."'),Hl.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)}cr.addPairToJSMap=zl});var te=S(Wn=>{"use strict";var ur=Ue(),Zl=nr(),ec=Jn(),xt=I();function tc(n,e,t){let s=ur.createNode(n,void 0,t),i=ur.createNode(e,void 0,t);return new Rt(s,i)}var Rt=class n{constructor(e,t=null){Object.defineProperty(this,xt.NODE_TYPE,{value:xt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return xt.isNode(t)&&(t=t.clone(e)),xt.isNode(s)&&(s=s.clone(e)),new n(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return ec.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Zl.stringifyPair(this,e,t,s):JSON.stringify(this)}};Wn.Pair=Rt;Wn.createPair=tc});var Hn=S(dr=>{"use strict";var he=I(),fr=We(),Bt=Ve();function nc(n,e,t){return(e.inFlow??n.flow?ic:sc)(n,e,t)}function sc({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(he.isNode(p))!u&&p.spaceBefore&&f.push(""),jt(t,f,p.commentBefore,u),p.comment&&(g=p.comment);else if(he.isPair(p)){let v=he.isNode(p.key)?p.key:null;v&&(!u&&v.spaceBefore&&f.push(""),jt(t,f,v.commentBefore,u))}u=!1;let b=fr.stringify(p,d,()=>g=null,()=>u=!0);g&&(b+=Bt.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
|
+
`+Bt.indentComment(c(n),l),a&&a()):u&&o&&o(),h}function ic({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(he.isNode(p))p.spaceBefore&&u.push(""),jt(e,u,p.commentBefore,!1),p.comment&&(g=p.comment);else if(he.isPair(p)){let v=he.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&u.push(""),jt(e,u,v.commentBefore,!1),v.comment&&(c=!0));let $=he.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=fr.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+=Bt.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 jt({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=Bt.indentComment(e(s),n);t.push(r.trimStart())}}dr.stringifyCollection=nc});var se=S(zn=>{"use strict";var rc=Hn(),oc=Jn(),ac=Ct(),ne=I(),Ft=te(),lc=M();function Qe(n,e){let t=ne.isScalar(e)?e.value:e;for(let s of n)if(ne.isPair(s)&&(s.key===e||s.key===t||ne.isScalar(s.key)&&s.key.value===t))return s}var Qn=class extends ac.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ne.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(Ft.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;ne.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Ft.Pair(e,e?.value):s=new Ft.Pair(e.key,e.value);let i=Qe(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);ne.isScalar(i.value)&&lc.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=Qe(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Qe(this.items,e)?.value;return(!t&&ne.isScalar(i)?i.value:i)??void 0}has(e){return!!Qe(this.items,e)}set(e,t){this.add(new Ft.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)oc.addPairToJSMap(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ne.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})),rc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};zn.YAMLMap=Qn;zn.findPair=Qe});var Ee=S(hr=>{"use strict";var cc=I(),pr=se(),uc={collection:"map",default:!0,nodeClass:pr.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return cc.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>pr.YAMLMap.from(n,e,t)};hr.map=uc});var ie=S(mr=>{"use strict";var fc=Ue(),dc=Hn(),pc=Ct(),Ut=I(),hc=M(),mc=z(),Xn=class extends pc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ut.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Kt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=Kt(e);if(typeof s!="number")return;let i=this.items[s];return!t&&Ut.isScalar(i)?i.value:i}has(e){let t=Kt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=Kt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[s];Ut.isScalar(i)&&hc.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(mc.toJS(r,String(i++),t));return s}toString(e,t,s){return e?dc.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(fc.createNode(a,void 0,s))}}return r}};function Kt(n){let e=Ut.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}mr.YAMLSeq=Xn});var Ie=S(yr=>{"use strict";var gc=I(),gr=ie(),yc={collection:"seq",default:!0,nodeClass:gr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return gc.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>gr.YAMLSeq.from(n,e,t)};yr.seq=yc});var ze=S(br=>{"use strict";var bc=Je(),vc={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),bc.stringifyString(n,e,t,s)}};br.string=vc});var Vt=S(wr=>{"use strict";var vr=M(),Sr={identify:n=>n==null,createNode:()=>new vr.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new vr.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&Sr.test.test(n)?n:e.options.nullStr};wr.nullTag=Sr});var Zn=S($r=>{"use strict";var Sc=M(),kr={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new Sc.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&kr.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};$r.boolTag=kr});var Te=S(Nr=>{"use strict";function wc({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}Nr.stringifyNumber=wc});var ts=S(Yt=>{"use strict";var kc=M(),es=Te(),$c={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:es.stringifyNumber},Nc={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():es.stringifyNumber(n)}},Ac={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 kc.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:es.stringifyNumber};Yt.float=Ac;Yt.floatExp=Nc;Yt.floatNaN=$c});var ss=S(Jt=>{"use strict";var Ar=Te(),Gt=n=>typeof n=="bigint"||Number.isInteger(n),ns=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function Cr(n,e,t){let{value:s}=n;return Gt(s)&&s>=0?t+s.toString(e):Ar.stringifyNumber(n)}var Cc={identify:n=>Gt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>ns(n,2,8,t),stringify:n=>Cr(n,8,"0o")},Ec={identify:Gt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>ns(n,0,10,t),stringify:Ar.stringifyNumber},Ic={identify:n=>Gt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>ns(n,2,16,t),stringify:n=>Cr(n,16,"0x")};Jt.int=Ec;Jt.intHex=Ic;Jt.intOct=Cc});var Ir=S(Er=>{"use strict";var Tc=Ee(),Lc=Vt(),Pc=Ie(),Oc=ze(),qc=Zn(),is=ts(),rs=ss(),Mc=[Tc.map,Pc.seq,Oc.string,Lc.nullTag,qc.boolTag,rs.intOct,rs.int,rs.intHex,is.floatNaN,is.floatExp,is.float];Er.schema=Mc});var Pr=S(Lr=>{"use strict";var _c=M(),Dc=Ee(),xc=Ie();function Tr(n){return typeof n=="bigint"||Number.isInteger(n)}var Wt=({value:n})=>JSON.stringify(n),Rc=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Wt},{identify:n=>n==null,createNode:()=>new _c.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Wt},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Wt},{identify:Tr,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})=>Tr(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:Wt}],Bc={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},jc=[Dc.map,xc.seq].concat(Rc,Bc);Lr.schema=jc});var as=S(Or=>{"use strict";var Xe=yt("buffer"),os=M(),Fc=Je(),Kc={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Xe.Buffer=="function")return Xe.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 Xe.Buffer=="function")a=o instanceof Xe.Buffer?o.toString("base64"):Xe.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=os.Scalar.BLOCK_LITERAL),e!==os.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===os.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Fc.stringifyString({comment:n,type:e,value:a},s,i,r)}};Or.binary=Kc});var zt=S(Qt=>{"use strict";var Ht=I(),ls=te(),Uc=M(),Vc=ie();function qr(n,e){if(Ht.isSeq(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!Ht.isPair(s)){if(Ht.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let i=s.items[0]||new ls.Pair(new Uc.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]=Ht.isPair(s)?s:new ls.Pair(s)}}else e("Expected a sequence for this tag");return n}function Mr(n,e,t){let{replacer:s}=t,i=new Vc.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(ls.createPair(a,l,t))}return i}var Yc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qr,createNode:Mr};Qt.createPairs=Mr;Qt.pairs=Yc;Qt.resolvePairs=qr});var fs=S(us=>{"use strict";var _r=I(),cs=z(),Ze=se(),Gc=ie(),Dr=zt(),me=class n extends Gc.YAMLSeq{constructor(){super(),this.add=Ze.YAMLMap.prototype.add.bind(this),this.delete=Ze.YAMLMap.prototype.delete.bind(this),this.get=Ze.YAMLMap.prototype.get.bind(this),this.has=Ze.YAMLMap.prototype.has.bind(this),this.set=Ze.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(_r.isPair(i)?(r=cs.toJS(i.key,"",t),o=cs.toJS(i.value,r,t)):r=cs.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=Dr.createPairs(e,t,s),r=new this;return r.items=i.items,r}};me.tag="tag:yaml.org,2002:omap";var Jc={collection:"seq",identify:n=>n instanceof Map,nodeClass:me,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=Dr.resolvePairs(n,e),s=[];for(let{key:i}of t.items)_r.isScalar(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new me,t)},createNode:(n,e,t)=>me.from(n,e,t)};us.YAMLOMap=me;us.omap=Jc});var Fr=S(ds=>{"use strict";var xr=M();function Rr({value:n,source:e},t){return e&&(n?Br:jr).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var Br={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 xr.Scalar(!0),stringify:Rr},jr={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 xr.Scalar(!1),stringify:Rr};ds.falseTag=jr;ds.trueTag=Br});var Kr=S(Xt=>{"use strict";var Wc=M(),ps=Te(),Hc={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:ps.stringifyNumber},Qc={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():ps.stringifyNumber(n)}},zc={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 Wc.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:ps.stringifyNumber};Xt.float=zc;Xt.floatExp=Qc;Xt.floatNaN=Hc});var Vr=S(tt=>{"use strict";var Ur=Te(),et=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 hs(n,e,t){let{value:s}=n;if(et(s)){let i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return Ur.stringifyNumber(n)}var Xc={identify:et,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=>hs(n,2,"0b")},Zc={identify:et,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=>hs(n,8,"0")},eu={identify:et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Zt(n,0,10,t),stringify:Ur.stringifyNumber},tu={identify:et,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=>hs(n,16,"0x")};tt.int=eu;tt.intBin=Xc;tt.intHex=tu;tt.intOct=Zc});var gs=S(ms=>{"use strict";var nn=I(),en=te(),tn=se(),ge=class n extends tn.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;nn.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new en.Pair(e.key,null):t=new en.Pair(e,null),tn.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=tn.findPair(this.items,e);return!t&&nn.isPair(s)?nn.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=tn.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new en.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(en.createPair(o,null,s));return r}};ge.tag="tag:yaml.org,2002:set";var nu={collection:"map",identify:n=>n instanceof Set,nodeClass:ge,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>ge.from(n,e,t),resolve(n,e){if(nn.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new ge,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ms.YAMLSet=ge;ms.set=nu});var bs=S(sn=>{"use strict";var su=Te();function ys(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 Yr(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return su.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 iu={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})=>ys(n,t),stringify:Yr},ru={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=>ys(n,!1),stringify:Yr},Gr={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(Gr.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=ys(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$/,"")??""};sn.floatTime=ru;sn.intTime=iu;sn.timestamp=Gr});var Hr=S(Wr=>{"use strict";var ou=Ee(),au=Vt(),lu=Ie(),cu=ze(),uu=as(),Jr=Fr(),vs=Kr(),rn=Vr(),fu=Dt(),du=fs(),pu=zt(),hu=gs(),Ss=bs(),mu=[ou.map,lu.seq,cu.string,au.nullTag,Jr.trueTag,Jr.falseTag,rn.intBin,rn.intOct,rn.int,rn.intHex,vs.floatNaN,vs.floatExp,vs.float,uu.binary,fu.merge,du.omap,pu.pairs,hu.set,Ss.intTime,Ss.floatTime,Ss.timestamp];Wr.schema=mu});var ro=S($s=>{"use strict";var Zr=Ee(),gu=Vt(),eo=Ie(),yu=ze(),bu=Zn(),ws=ts(),ks=ss(),vu=Ir(),Su=Pr(),to=as(),nt=Dt(),no=fs(),so=zt(),Qr=Hr(),io=gs(),on=bs(),zr=new Map([["core",vu.schema],["failsafe",[Zr.map,eo.seq,yu.string]],["json",Su.schema],["yaml11",Qr.schema],["yaml-1.1",Qr.schema]]),Xr={binary:to.binary,bool:bu.boolTag,float:ws.float,floatExp:ws.floatExp,floatNaN:ws.floatNaN,floatTime:on.floatTime,int:ks.int,intHex:ks.intHex,intOct:ks.intOct,intTime:on.intTime,map:Zr.map,merge:nt.merge,null:gu.nullTag,omap:no.omap,pairs:so.pairs,seq:eo.seq,set:io.set,timestamp:on.timestamp},wu={"tag:yaml.org,2002:binary":to.binary,"tag:yaml.org,2002:merge":nt.merge,"tag:yaml.org,2002:omap":no.omap,"tag:yaml.org,2002:pairs":so.pairs,"tag:yaml.org,2002:set":io.set,"tag:yaml.org,2002:timestamp":on.timestamp};function ku(n,e,t){let s=zr.get(e);if(s&&!n)return t&&!s.includes(nt.merge)?s.concat(nt.merge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{let r=Array.from(zr.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(nt.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Xr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Xr).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},[])}$s.coreKnownTags=wu;$s.getTags=ku});var Cs=S(oo=>{"use strict";var Ns=I(),$u=Ee(),Nu=Ie(),Au=ze(),an=ro(),Cu=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,As=class n{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?an.getTags(e,"compat"):e?an.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?an.coreKnownTags:{},this.tags=an.getTags(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Ns.MAP,{value:$u.map}),Object.defineProperty(this,Ns.SCALAR,{value:Au.string}),Object.defineProperty(this,Ns.SEQ,{value:Nu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Cu:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};oo.Schema=As});var lo=S(ao=>{"use strict";var Eu=I(),Es=We(),st=Ve();function Iu(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=Es.createStringifyContext(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=r(n.commentBefore);t.unshift(st.indentComment(l,""))}let o=!1,a=null;if(n.contents){if(Eu.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let d=r(n.contents.commentBefore);t.push(st.indentComment(d,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>o=!0,c=Es.stringify(n.contents,i,()=>a=null,l);a&&(c+=st.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Es.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let l=r(n.comment);l.includes(`
|
|
56
|
+
`)?(t.push("..."),t.push(st.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(st.indentComment(r(l),"")))}return t.join(`
|
|
57
|
+
`)+`
|
|
58
|
+
`}ao.stringifyDocument=Iu});var it=S(co=>{"use strict";var Tu=Ke(),Le=Ct(),j=I(),Lu=te(),Pu=z(),Ou=Cs(),qu=lo(),Is=kt(),Mu=On(),_u=Ue(),Ts=Pn(),Ls=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 Ts.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){Pe(this.contents)&&this.contents.add(e)}addIn(e,t){Pe(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=Is.anchorNames(this);e.anchor=!t||s.has(t)?Is.findNewAnchor(t||"a",s):t}return new Tu.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}=Is.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},p=_u.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 Lu.Pair(i,r)}delete(e){return Pe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Le.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Pe(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 Le.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 Le.isEmptyPath(e)?this.contents!==void 0:j.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Le.collectionFromPath(this.schema,[e],t):Pe(this.contents)&&this.contents.set(e,t)}setIn(e,t){Le.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Le.collectionFromPath(this.schema,Array.from(e),t):Pe(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 Ts.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 Ts.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 Ou.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=Pu.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"?Mu.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 qu.stringifyDocument(this,e)}};function Pe(n){if(j.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}co.Document=Ls});var at=S(ot=>{"use strict";var rt=class extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}},Ps=class extends rt{constructor(e,t,s){super("YAMLParseError",e,t,s)}},Os=class extends rt{constructor(e,t,s){super("YAMLWarning",e,t,s)}},Du=(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
|
+
`}};ot.YAMLError=rt;ot.YAMLParseError=Ps;ot.YAMLWarning=Os;ot.prettifyError=Du});var lt=S(uo=>{"use strict";function xu(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,C=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,C??(C=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,C??(C=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],L=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:L,start:C??L}}uo.resolveProps=xu});var ln=S(fo=>{"use strict";function qs(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(qs(e.key)||qs(e.value))return!0}return!1;default:return!0}}fo.containsNewline=qs});var Ms=S(po=>{"use strict";var Ru=ln();function Bu(n,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&Ru.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}po.flowIndentCheck=Bu});var _s=S(mo=>{"use strict";var ho=I();function ju(n,e,t){let{uniqueKeys:s}=n.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||ho.isScalar(r)&&ho.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}mo.mapIncludes=ju});var wo=S(So=>{"use strict";var go=te(),Fu=se(),yo=lt(),Ku=ln(),bo=Ms(),Uu=_s(),vo="All mapping items must start at the same column";function Vu({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??Fu.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=yo.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",vo)),!p.anchor&&!p.tag&&!h){c=p.end,p.comment&&(a.comment?a.comment+=`
|
|
65
|
+
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Ku.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",vo);t.atKey=!0;let b=p.end,v=f?n(t,f,p,i):e(t,b,u,null,p,i);t.schema.compat&&bo.flowIndentCheck(s.indent,f,i),t.atKey=!1,Uu.mapIncludes(t,a.items,v)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let $=yo.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&&bo.flowIndentCheck(s.indent,m,i),l=N.range[2];let C=new go.Pair(v,N);t.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C)}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 go.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}So.resolveBlockMap=Vu});var $o=S(ko=>{"use strict";var Yu=ie(),Gu=lt(),Ju=Ms();function Wu({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??Yu.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=Gu.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&&Ju.flowIndentCheck(s.indent,u,i),l=h.range[2],a.items.push(h)}return a.range=[s.offset,l,c??l],a}ko.resolveBlockSeq=Wu});var Oe=S(No=>{"use strict";function Hu(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}}No.resolveEnd=Hu});var Io=S(Eo=>{"use strict";var Qu=I(),zu=te(),Ao=se(),Xu=ie(),Zu=Oe(),Co=lt(),ef=ln(),tf=_s(),Ds="Block collections are not allowed within flow collections",xs=n=>n&&(n.type==="block-map"||n.type==="block-seq");function nf({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?Ao.YAMLMap:Xu.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:C}=b,E=Co.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&&!C){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&&ef.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 L="";e:for(let w of v)switch(w.type){case"comma":case"space":break;case"comment":L=w.source.substring(1);break e;default:break e}if(L){let w=c.items[c.items.length-1];Qu.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
|
|
68
|
+
`+L:w.comment=L,E.comment=E.comment.substring(L.length+1)}}if(!o&&!N&&!E.found){let L=C?n(t,C,E,i):e(t,E.end,N,null,E,i);c.items.push(L),u=L.range[2],xs(C)&&i(L.range,"BLOCK_IN_FLOW",Ds)}else{t.atKey=!0;let L=E.end,w=$?n(t,$,E,i):e(t,L,v,null,E,i);xs($)&&i(w.range,"BLOCK_IN_FLOW",Ds),t.atKey=!1;let k=Co.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:C,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 O of N){if(O===k.found)break;if(O.type==="newline"){i(O,"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 C&&("source"in C&&C.source?.[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(k.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let T=C?n(t,C,k,i):k.found?e(t,k.end,N,null,k,i):null;T?xs(C)&&i(T.range,"BLOCK_IN_FLOW",Ds):k.comment&&(w.comment?w.comment+=`
|
|
69
|
+
`+k.comment:w.comment=k.comment);let V=new zu.Pair(w,T);if(t.options.keepSourceTokens&&(V.srcToken=b),o){let O=c;tf.mapIncludes(t,O.items,w)&&i(L,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(V)}else{let O=new Ao.YAMLMap(t.schema);O.flow=!0,O.items.push(V);let ke=(T??w).range;O.range=[w.range[0],ke[1],ke[2]],c.items.push(O)}u=T?T.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=Zu.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}Eo.resolveFlowCollection=nf});var Lo=S(To=>{"use strict";var sf=I(),rf=M(),of=se(),af=ie(),lf=wo(),cf=$o(),uf=Io();function Rs(n,e,t,s,i,r){let o=t.type==="block-map"?lf.resolveBlockMap(n,e,t,s,r):t.type==="block-seq"?cf.resolveBlockSeq(n,e,t,s,r):uf.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 ff(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===of.YAMLMap.tagName&&a==="map"||o===af.YAMLSeq.tagName&&a==="seq")return Rs(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),Rs(n,e,t,i,o)}let c=Rs(n,e,t,i,o,l),d=l.resolve?.(c,f=>i(r,"TAG_RESOLVE_FAILED",f),e.options)??c,u=sf.isNode(d)?d:new rf.Scalar(d);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}To.composeCollection=ff});var js=S(Po=>{"use strict";var Bs=M();function df(n,e,t){let s=e.offset,i=pf(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?Bs.Scalar.BLOCK_FOLDED:Bs.Scalar.BLOCK_LITERAL,o=e.source?hf(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===Bs.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 pf({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 hf(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}Po.resolveBlockScalar=df});var Ks=S(qo=>{"use strict";var Fs=M(),mf=Oe();function gf(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=Fs.Scalar.PLAIN,l=yf(r,c);break;case"single-quoted-scalar":a=Fs.Scalar.QUOTE_SINGLE,l=bf(r,c);break;case"double-quoted-scalar":a=Fs.Scalar.QUOTE_DOUBLE,l=vf(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=mf.resolveEnd(o,d,e,t);return{value:l,type:a,comment:u.comment,range:[s,d,u.offset]}}function yf(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}`),Oo(n)}function bf(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Oo(n.slice(1,-1)).replace(/''/g,"'")}function Oo(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 vf(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}=Sf(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s],o=wf[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+=kf(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 Sf(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 wf={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 kf(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}}qo.resolveFlowScalar=gf});var Do=S(_o=>{"use strict";var ye=I(),Mo=M(),$f=js(),Nf=Ks();function Af(n,e,t,s){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?$f.resolveBlockScalar(n,e,s):Nf.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[ye.SCALAR]:l?c=Cf(n.schema,i,l,t,s):e.type==="scalar"?c=Ef(n,i,e,s):c=n.schema[ye.SCALAR];let d;try{let u=c.resolve(i,f=>s(t??e,"TAG_RESOLVE_FAILED",f),n.options);d=ye.isScalar(u)?u:new Mo.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);s(t??e,"TAG_RESOLVE_FAILED",f),d=new Mo.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 Cf(n,e,t,s,i){if(t==="!")return n[ye.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[ye.SCALAR])}function Ef({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[ye.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(s))??t[ye.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}_o.composeScalar=Af});var Ro=S(xo=>{"use strict";function If(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}xo.emptyScalarPosition=If});var Fo=S(Vs=>{"use strict";var Tf=Ke(),Lf=I(),Pf=Lo(),Bo=Do(),Of=Oe(),qf=Ro(),Mf={composeNode:jo,composeEmptyNode:Us};function jo(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=_f(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=Bo.composeScalar(n,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Pf.composeCollection(Mf,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=Us(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&&(!Lf.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 Us(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let d={type:"scalar",offset:qf.emptyScalarPosition(e,t,s),indent:-1,source:""},u=Bo.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 _f({options:n},{offset:e,source:t,end:s},i){let r=new Tf.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=Of.resolveEnd(s,o,n.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Vs.composeEmptyNode=Us;Vs.composeNode=jo});var Vo=S(Uo=>{"use strict";var Df=it(),Ko=Fo(),xf=Oe(),Rf=lt();function Bf(n,e,{offset:t,start:s,value:i,end:r},o){let a=Object.assign({_directives:e},n),l=new Df.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Rf.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?Ko.composeNode(c,i,d,o):Ko.composeEmptyNode(c,d.end,s,null,d,o);let u=l.contents.range[2],f=xf.resolveEnd(r,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}Uo.composeDoc=Bf});var Gs=S(Jo=>{"use strict";var jf=yt("process"),Ff=Pn(),Kf=it(),ct=at(),Yo=I(),Uf=Vo(),Vf=Oe();function ut(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 Go(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 Ys=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{let o=ut(t);r?this.warnings.push(new ct.YAMLWarning(o,s,i)):this.errors.push(new ct.YAMLParseError(o,s,i))},this.directives=new Ff.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:i}=Go(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(Yo.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Yo.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:Go(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(jf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{let r=ut(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Uf.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 ct.YAMLParseError(ut(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 ct.YAMLParseError(ut(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let t=Vf.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 ct.YAMLParseError(ut(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 Kf.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}}};Jo.Composer=Ys});var Qo=S(cn=>{"use strict";var Yf=js(),Gf=Ks(),Jf=at(),Wo=Je();function Wf(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 Jf.YAMLParseError([a,a+1],r,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Gf.resolveFlowScalar(n,e,s);case"block-scalar":return Yf.resolveBlockScalar({options:{strict:e}},n,s)}}return null}function Hf(n,e){let{implicitKey:t=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Wo.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 Ho(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 Qf(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=Wo.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">":zf(n,l);break;case'"':Js(n,l,"double-quoted-scalar");break;case"'":Js(n,l,"single-quoted-scalar");break;default:Js(n,l,"scalar")}}function zf(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}];Ho(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 Ho(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 Js(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})}}}cn.createScalarToken=Hf;cn.resolveAsScalar=Wf;cn.setScalarValue=Qf});var Xo=S(zo=>{"use strict";var Xf=n=>"type"in n?fn(n):un(n);function fn(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=fn(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=un(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=un(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=un(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 un({start:n,key:e,sep:t,value:s}){let i="";for(let r of n)i+=r.source;if(e&&(i+=fn(e)),t)for(let r of t)i+=r.source;return s&&(i+=fn(s)),i}zo.stringify=Xf});var na=S(ta=>{"use strict";var Ws=Symbol("break visit"),Zf=Symbol("skip children"),Zo=Symbol("remove item");function be(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),ea(Object.freeze([]),n,e)}be.BREAK=Ws;be.SKIP=Zf;be.REMOVE=Zo;be.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};be.parentCollection=(n,e)=>{let t=be.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 ea(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=ea(Object.freeze(n.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Ws)return Ws;a===Zo&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}ta.visit=be});var dn=S(B=>{"use strict";var Hs=Qo(),ed=Xo(),td=na(),Qs="\uFEFF",zs="",Xs="",Zs="",nd=n=>!!n&&"items"in n,sd=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function id(n){switch(n){case Qs:return"<BOM>";case zs:return"<DOC>";case Xs:return"<FLOW_END>";case Zs:return"<SCALAR>";default:return JSON.stringify(n)}}function rd(n){switch(n){case Qs:return"byte-order-mark";case zs:return"doc-mode";case Xs: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=Hs.createScalarToken;B.resolveAsScalar=Hs.resolveAsScalar;B.setScalarValue=Hs.setScalarValue;B.stringify=ed.stringify;B.visit=td.visit;B.BOM=Qs;B.DOCUMENT=zs;B.FLOW_END=Xs;B.SCALAR=Zs;B.isCollection=nd;B.isScalar=sd;B.prettyToken=id;B.tokenType=rd});var ni=S(ia=>{"use strict";var ft=dn();function K(n){switch(n){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case" ":return!0;default:return!1}}var sa=new Set("0123456789ABCDEFabcdef"),od=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pn=new Set(",[]{}"),ad=new Set(` ,[]{}
|
|
119
|
+
\r `),ei=n=>!n||ad.has(n),ti=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]===ft.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 ft.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(ei),"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 ft.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(ei),"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 ft.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&&pn.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&&pn.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&&pn.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ft.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(ei),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(K(s)||t&&pn.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(od.has(t))t=this.buffer[++e];else if(t==="%"&&sa.has(this.buffer[e+1])&&sa.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)}};ia.Lexer=ti});var ii=S(ra=>{"use strict";var si=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}}}};ra.LineCounter=si});var oi=S(ua=>{"use strict";var ld=yt("process"),oa=dn(),cd=ni();function re(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function aa(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 ca(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 hn(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 qe(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 mn(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 la(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!re(e.start,"explicit-key-ind")&&!re(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ca(e.value)?e.value.end?mn(e.value.end,e.sep):e.value.end=e.sep:mn(e.start,e.sep),delete e.sep)}var ri=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 cd.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,ld.env.LOG_TOKENS&&console.log("|",oa.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=oa.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"&&la(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&&aa(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":{aa(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=hn(this.peek(2)),s=qe(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)){mn(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(re(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(ca(t.key)&&!re(t.sep,"newline")){let o=qe(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(re(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=qe(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]}):re(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&&!re(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)){mn(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||re(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=hn(s),r=qe(i);la(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=hn(e),s=qe(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=hn(e),s=qe(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())}}};ua.Parser=ri});var ma=S(pt=>{"use strict";var fa=Gs(),ud=it(),dt=at(),fd=Vn(),dd=I(),pd=ii(),da=oi();function pa(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new pd.LineCounter||null,prettyErrors:e}}function hd(n,e={}){let{lineCounter:t,prettyErrors:s}=pa(e),i=new da.Parser(t?.addNewLine),r=new fa.Composer(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(let a of o)a.errors.forEach(dt.prettifyError(n,t)),a.warnings.forEach(dt.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ha(n,e={}){let{lineCounter:t,prettyErrors:s}=pa(e),i=new da.Parser(t?.addNewLine),r=new fa.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 dt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(dt.prettifyError(n,t)),o.warnings.forEach(dt.prettifyError(n,t))),o}function md(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ha(n,t);if(!i)return null;if(i.warnings.forEach(r=>fd.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 gd(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 dd.isDocument(n)&&!s?n.toString(t):new ud.Document(n,s,t).toString(t)}pt.parse=md;pt.parseAllDocuments=hd;pt.parseDocument=ha;pt.stringify=gd});var ya=S(P=>{"use strict";var yd=Gs(),bd=it(),vd=Cs(),ai=at(),Sd=Ke(),oe=I(),wd=te(),kd=M(),$d=se(),Nd=ie(),Ad=dn(),Cd=ni(),Ed=ii(),Id=oi(),gn=ma(),ga=Re();P.Composer=yd.Composer;P.Document=bd.Document;P.Schema=vd.Schema;P.YAMLError=ai.YAMLError;P.YAMLParseError=ai.YAMLParseError;P.YAMLWarning=ai.YAMLWarning;P.Alias=Sd.Alias;P.isAlias=oe.isAlias;P.isCollection=oe.isCollection;P.isDocument=oe.isDocument;P.isMap=oe.isMap;P.isNode=oe.isNode;P.isPair=oe.isPair;P.isScalar=oe.isScalar;P.isSeq=oe.isSeq;P.Pair=wd.Pair;P.Scalar=kd.Scalar;P.YAMLMap=$d.YAMLMap;P.YAMLSeq=Nd.YAMLSeq;P.CST=Ad;P.Lexer=Cd.Lexer;P.LineCounter=Ed.LineCounter;P.Parser=Id.Parser;P.parse=gn.parse;P.parseAllDocuments=gn.parseAllDocuments;P.parseDocument=gn.parseDocument;P.stringify=gn.stringify;P.visit=ga.visit;P.visitAsync=ga.visitAsync});import{readdir as we,stat as _e,lstat as wa,readlink as Md,readFile as bn,realpath as yi}from"fs/promises";import{join as x,resolve as bi,basename as _d}from"path";import{homedir as vn}from"os";var li=el(ya(),1);function ba(n){let e;try{e=(0,li.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 ci(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(ba(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 ui(n){return n["metadata.version"]||n.version||"0.0.0"}function fi(n){let e=n["allowed-tools"]||"";return e.trim()?e.split(/[\s,]+/).map(t=>t.trim()).filter(Boolean):[]}function di(n){let e=(n.dependencies||"").trim();if(!e)return[];let t;if(e.startsWith("[")){let r;try{r=(0,li.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(ba)}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 pi(n){let e=(n.tags||"").trim();if(!e)return[];let t=e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e;return Pd(t.split(/[\s,]+/).map(s=>s.replace(/^['"]|['"]$/g,"")))}var Td=/^[a-z0-9][a-z0-9_-]*$/;function Ld(n){let e=n.trim().toLowerCase();return!e||e.length>32||!Td.test(e)?null:e}function Pd(n){let e=new Set,t=[];for(let s of n){let i=Ld(s);i&&!e.has(i)&&(e.add(i),t.push(i))}return t}function va(n){return(n||"").trim().toLowerCase()}function Od(n){let e=va(n);return e==="true"||e==="yes"||e==="1"}function qd(n){let e=va(n);return e==="false"||e==="no"||e==="0"}function hi(n){return!Od(n["disable-model-invocation"])}function mi(n){return"user-invocable"in n?!qd(n["user-invocable"]):!0}function Me(n,e){let t=n!==!1,s=e!==!1;return t&&s?"both":t?"model":s?"user":"none"}function im(n,e){let t=n.modelInvocable!==!1,s=n.userInvocable!==!1;return!(e.modelInvocable&&!t||e.userInvocable&&!s)}function yn(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 ve(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 om(n){return yn(n.description??"")}function am(n){let e=n.tokenCount;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:0}var Dd=x(vn(),".claude","plugins","marketplaces"),xd=x(vn(),".codex","plugins","cache"),Rd=x(vn(),".codex","config.toml"),gm=x(vn(),".agents","plugins","marketplace.json"),ka=16,Bd=ka-1,Se=[],ae=0,gi=0;function Sa(){for(;gi<ka&&ae<Se.length;){let n=Se[ae++];gi++,n()}ae===Se.length?(Se.length=0,ae=0):ae>=1024&&ae*2>=Se.length&&(Se.splice(0,ae),ae=0)}function jd(n){return new Promise((e,t)=>{Se.push(()=>{Promise.resolve().then(n).finally(()=>{gi--,Sa()}).then(e,t)}),Sa()})}function Fd(){let n=[],e=0,t=0,s=()=>{for(;e<Bd;){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++,jd(()=>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 Kd(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=de(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=de(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=de(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 vi(n){try{return(await we(n,{recursive:!0})).length}catch{return 0}}function Sn(n,e){Object.defineProperty(n,"_skillMdContent",{value:e,writable:!0,configurable:!0})}async function Ud(n,e){q(`scanning: ${n.dir} (${n.location})`);let t;try{t=await we(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 _e(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 bn(o,"utf-8")}catch{q(` skip: "${i}" \u2014 no SKILL.md`);return}let l=ci(a),c=!1,d=null;try{(await wa(r)).isSymbolicLink()&&(c=!0,d=await Md(r))}catch{}let u=bi(r),f;try{f=await yi(r)}catch{f=u}let h={name:l.name||i,version:ui(l),description:(l.description||"").replace(/\s*\n\s*/g," ").trim(),creator:l["metadata.creator"]||"",license:(l.license||"").trim(),compatibility:(l.compatibility||"").trim(),allowedTools:fi(l),tags:pi(l),dependencies:di(l),modelInvocable:hi(l),userInvocable:mi(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:yn(a)};return Sn(h,a),h}catch{q(` skip: "${i}" \u2014 scan failed`);return}});return q(`found ${s.length} skill(s) in ${n.dir}`),s}async function $a(n){let e=[],t;try{t=await we(n)}catch{return e}for(let s of t){let i=x(n,s),r;try{r=await wa(i)}catch{continue}if(!r.isSymbolicLink()&&r.isDirectory()){let o=x(i,"SKILL.md");try{await _e(o),e.push(i)}catch{let a=await $a(i);e.push(...a)}}}return e}async function Vd(n){let e=n??Dd,t=[];q(`scan: checking plugin marketplaces at ${e}`);let s;try{s=await we(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 _e(r)}catch{continue}if(!o.isDirectory())continue;q(`scan: scanning marketplace "${i}"`);let a=await $a(r);for(let l of a){let c=x(l,"SKILL.md"),d;try{d=await bn(c,"utf-8")}catch{continue}let u=ci(d),f=_d(l),h=bi(l),m;try{m=await yi(l)}catch{m=h}let p={name:u.name||f,version:ui(u),description:(u.description||"").replace(/\s*\n\s*/g," ").trim(),creator:u["metadata.creator"]||"",license:(u.license||"").trim(),compatibility:(u.compatibility||"").trim(),allowedTools:fi(u),tags:pi(u),dependencies:di(u),modelInvocable:hi(u),userInvocable:mi(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:yn(d)};Sn(p,d),t.push(p)}}return q(`scan: found ${t.length} plugin marketplace skill(s)`),t}function Yd(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 Gd(n){let e=n??Rd;try{let t=await bn(e,"utf-8");return Yd(t)}catch{return q(`codex: config.toml not found at ${e}, skipping enabled check`),new Map}}async function Jd(n,e){let t=n??xd,s=[];q(`codex: checking plugin cache at ${t}`);let i;try{i=await we(t)}catch{return q("codex: plugin cache dir not found, skipping"),s}let r=await Gd(e);for(let o of i){let a=x(t,o),l;try{l=await _e(a)}catch{continue}if(!l.isDirectory())continue;let c;try{c=await we(a)}catch{continue}for(let d of c){let u=x(a,d),f;try{f=await _e(u)}catch{continue}if(!f.isDirectory())continue;let h;try{h=await we(u)}catch{continue}let m=(await Promise.all(h.map(async k=>{try{return(await _e(x(u,k))).isDirectory()?k:null}catch{return null}}))).filter(k=>k!==null);if(m.length===0)continue;let p=m.sort(Na).at(-1),g=x(u,p),b=x(g,".codex-plugin","plugin.json"),v;try{let k=await bn(b,"utf-8");v=JSON.parse(k)}catch{q(`codex: no valid plugin.json at ${b}, skipping`);continue}let $=bi(g),N;try{N=await yi(g)}catch{N=$}let C=v.interface?.displayName||v.name||d,E=v.version||p,L=(v.description||"").replace(/\s*\n\s*/g," ").trim(),w=r.has(d)?r.get(d):!0;s.push({name:C,version:E,description:L,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 ym(n,e,t,s){let i=Kd(n,e),r=e==="global"||e==="both",o=Fd(),[a,l,c]=await Promise.all([Promise.all(i.map(h=>Ud(h,o))),r?Vd(t):Promise.resolve([]),r?Jd(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 bm(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 Na(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 vm(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)=>Na(s.version,i.version));break;case"location":t.sort((s,i)=>s.location.localeCompare(i.location));break}return t}import{rm as le,readFile as Ta,writeFile as np,access as sp,lstat as ip,rename as rp,readdir as op,mkdir as Ca,unlink as Ea}from"fs/promises";import{join as wn,resolve as U,dirname as De,relative as Ia}from"path";import{homedir as ap}from"os";import{readdir as Wd,readFile as Hd,stat as Qd,symlink as Aa}from"fs/promises";import{dirname as zd,join as Xd,resolve as Zd}from"path";async function Si(n,e){process.platform==="win32"?await Aa(Zd(zd(e),n),e,"junction"):await Aa(n,e,"dir")}function $m(n){return n.split("\\").join("/")}var ep=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"]),tp=512*1024;async function Nm(n){let e=[];async function t(s,i){let r;try{r=await Wd(s)}catch{return}for(let o of r){if(o===".git"||o==="node_modules")continue;let a=Xd(s,o),l=i?`${i}/${o}`:o;try{let c=await Qd(a);if(c.isDirectory())await t(a,l);else if(c.isFile()){let d=o.includes(".")?`.${o.split(".").pop().toLowerCase()}`:"";if(ep.has(d)||c.size>tp)continue;try{let u=await Hd(a,"utf-8");e.push({relPath:l,content:u,lineCount:u.split(`
|
|
145
|
+
`).length})}catch{}}}catch{continue}}}return await t(n,""),e}var La=ap();function lp(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=de(o.global),l=wn(De(a),"AGENTS.md");t.agentsBlocks.push({file:l,skillName:s})}let i=wn(La,".codex","AGENTS.md");t.agentsBlocks.some(o=>o.file===i)||t.agentsBlocks.push({file:i,skillName:s})}return t}function Pm(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=de(h.global),p=wn(De(m),"AGENTS.md");if(f===p)return{provider:h.name,scope:"global"}}return f===wn(La,".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=lp(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 ht(n){try{return await sp(n),!0}catch{return!1}}async function cp(n,e){if(!await ht(n))return;let t=await Ta(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 np(n,t,"utf-8")}function up(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 Om(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=up(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 fp(n){let e=[],t=new Set;for(let s of n){let i=De(s);if(!t.has(i)){t.add(i);try{(await op(i)).filter(a=>a!==".DS_Store").length===0&&(await le(i,{recursive:!0,force:!0}),e.push(i))}catch{}}}return e}async function qm(n,e,t){let s=[];if(t?.needed){if(!t.repointOnly)try{let o=De(t.toPath);await Ca(o,{recursive:!0});try{await Ea(t.toPath)}catch(a){(!(a instanceof Error)||!("code"in a)||a.code!=="ENOENT")&&await le(t.toPath,{recursive:!0,force:!0})}try{await rp(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 le(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 le(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=De(o),l=Ia(a,t.toPath);try{try{await Ea(o)}catch(c){(!(c instanceof Error)||!("code"in c)||c.code!=="ENOENT")&&await le(o,{recursive:!0,force:!0})}await Ca(a,{recursive:!0}),await Si(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 le(o.path),s.push(`Removed symlink: ${o.path}`)):(await le(o.path,{recursive:!0,force:!0}),s.push(`Removed directory: ${o.path}`)),!t?.needed&&e&&U(o.path)!==U(e)){let a=De(o.path),l=Ia(a,e);await Si(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 fp(i);for(let o of r)s.push(`Removed empty parent directory: ${o}`);for(let o of n.ruleFiles)if(await ht(o))try{await le(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 cp(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 Mm(n){let e=[];for(let t of n.directories)if(await ht(t.path)){let i=(await ip(t.path)).isSymbolicLink()?"symlink":"directory";e.push(`${t.path} (${i})`)}for(let t of n.ruleFiles)await ht(t)&&e.push(t);for(let t of n.agentsBlocks)if(await ht(t.file)){let s=await Ta(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 Np}from"crypto";import{readFile as Ap}from"fs/promises";import{join as Cp}from"path";var A=()=>!(process.env.NO_COLOR!==void 0||globalThis.__CLI_NO_COLOR||!process.stdout.isTTY),y={bold:n=>A()?`\x1B[1m${n}\x1B[0m`:n,cyan:n=>A()?`\x1B[36m${n}\x1B[0m`:n,green:n=>A()?`\x1B[32m${n}\x1B[0m`:n,yellow:n=>A()?`\x1B[33m${n}\x1B[0m`:n,dim:n=>A()?`\x1B[2m${n}\x1B[0m`:n,white:n=>A()?`\x1B[37m${n}\x1B[0m`:n,red:n=>A()?`\x1B[31m${n}\x1B[0m`:n,blue:n=>A()?`\x1B[34m${n}\x1B[0m`:n,blueBold:n=>A()?`\x1B[34;1m${n}\x1B[0m`:n,magenta:n=>A()?`\x1B[35m${n}\x1B[0m`:n,bgDim:n=>A()?`\x1B[48;5;236m${n}\x1B[0m`:n,bgRed:n=>A()?`\x1B[41m\x1B[37m\x1B[1m${n}\x1B[0m`:n,bgYellow:n=>A()?`\x1B[43m\x1B[30m\x1B[1m${n}\x1B[0m`:n,bgGreen:n=>A()?`\x1B[42m\x1B[30m\x1B[1m${n}\x1B[0m`:n,bgCyan:n=>A()?`\x1B[46m\x1B[30m\x1B[1m${n}\x1B[0m`:n};function J(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 Pa={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 ce(n,e){return(Pa[n]||y.dim)(e)}function ue(n,e){return A()?(Pa[n]||y.dim)(`[${e}]`):`[${e}]`}var kn=new Set(["Bash","Write","Edit","NotebookEdit"]),wi=new Set(["WebFetch","WebSearch"]);function ki(n){return kn.has(n)?y.red(n):wi.has(n)?y.yellow(n):y.green(n)}function mt(n){return n.length===0?"":n.map(ki).join(" ")}function $n(n){let e=n.filter(s=>kn.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 Q(n){let e=process.env.HOME||process.env.USERPROFILE||"";return e&&n.startsWith(e)?"~"+n.slice(e.length):n}function Oa(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",Me(l.modelInvocable,l.userInvocable),l.providerLabel,l.scope,l.isSymlink?"symlink":"directory",Q(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[A()?y.bold(r):r,o,...a].join(`
|
|
148
|
+
`)}function xe(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:Me(i.modelInvocable,i.userInvocable),tokens:typeof i.tokenCount=="number"?ve(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:Q(i.path),warningCount:s.reduce((a,l)=>a+(l.warnings?.length??0),0),disabled:s.every(a=>a.disabled===!0)})}return t}function $i(n){return n.disabled?`${n.name} [disabled]`:n.name}var qa=50;function Ma(n,e={}){let t=e.topN??5,s=e.showHint??!0;if(n.length===0)return"No skills found.";let i=[],o=xe(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(A()?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(A()?y.bold("Top tools:"):"Top tools:");for(let[p,{label:g,count:b}]of h){let v=A()?ce(p,`[${g}]`):`[${g}]`;i.push(` ${v} ${b} skill${b===1?"":"s"}`)}i.push(""),i.push(A()?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(A()?y.bold("Top efforts:"):"Top efforts:");for(let[g,b]of p){let v=J(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(A()?y.dim(p):p)}return i.join(`
|
|
149
|
+
`)}function Ni(n){if(n.length===0)return"No skills found.";let e=xe(n),t=[],s=Math.max(4,...e.map(h=>$i(h).length)),i=Math.max(7,...e.map(h=>h.version.length)),r=e.map(h=>h.providers.map(m=>ue(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($i(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),C=`${p} ${g} ${N} ${v} ${$}`;t.push(m.disabled?y.dim(C):C)}t.push("");let d=n.length,u=e.length,f=`${d} skills (${u} unique)`;return t.push(y.dim(f)),t.join(`
|
|
150
|
+
`)}function _a(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(A()?y.bold(u):u);let m=Ni(d).split(`
|
|
151
|
+
`).slice(0,-2).filter(p=>p.length>0).map(p=>` ${p}`);r.push(...m),r.push("")}let o=n.length,a=xe(n).length,l=`${o} skills (${a} unique), grouped by ${e}`;return r.push(y.dim(l)),r.join(`
|
|
152
|
+
`)}function Da(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 xa(n){if(n.length===0)return"No skills found.";let e=xe(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(T=>ue(T.provider,T.label)).join(" ")),h=e.map(k=>k.providers.map(T=>`[${T.label}]`).join(" ")),m=Math.max(9,...h.map(k=>k.length)),p=(k,T)=>k.padEnd(T),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(A()?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 T=e[k],V=p($i(T),s),O=p(T.version,i),ke=(T.creator||"\u2014").slice(0,15),An=p(ke,r),Cn=T.effort||"\u2014",En=T.effort?J(T.effort):"\u2014",Ya=o-Cn.length,Ga=En+" ".repeat(Math.max(0,Ya)),Ja=l?` ${p(T.tokens||"\u2014",c)}`:"",Wa=m-h[k].length,Ha=f[k]+" ".repeat(Math.max(0,Wa)),Qa=p(T.scope,d),za=p(T.type,u),Xa=T.warningCount>0?` ${y.yellow(`(${T.warningCount} warning${T.warningCount>1?"s":""})`)}`:"",Za=p(T.invoke,a),Ei=`${V} ${O} ${An} ${Ga} ${Za}${Ja} ${Ha} ${Qa} ${za}${Xa}`;t.push(T.disabled?y.dim(Ei):Ei)}let $=e.length,N=n.length,C=new Set(n.map(k=>k.provider)),E=n.filter(k=>k.scope==="global").length,L=n.filter(k=>k.scope==="project").length;t.push("");let w=`${N} skills (${$} unique) across ${C.size} tools | ${E} global, ${L} project`;return t.push(y.dim(w)),t.join(`
|
|
153
|
+
`)}function dp(n,e){if(!A()||!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 Ra(n,e){if(n.length===0)return`No skills matching "${e}". Try ${y.bold("asm list")} to see all skills.`;let t=xe(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=>ue(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(A()?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=dp(b.name,e),$=i-b.name.length,N=v+" ".repeat(Math.max(0,$)),C=h(b.version,r),E=(b.creator||"\u2014").slice(0,15),L=h(E,o),w=b.effort||"\u2014",k=b.effort?J(b.effort):"\u2014",T=a-w.length,V=k+" ".repeat(Math.max(0,T)),O=d-c[g].length,ke=l[g]+" ".repeat(Math.max(0,O)),An=h(b.scope,u),Cn=h(b.type,f),En=h(b.invoke,m);s.push(`${N} ${C} ${L} ${V} ${En} ${ke} ${An} ${Cn}`)}return s.join(`
|
|
155
|
+
`)}function Ba(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 gt(s.description,76))t.push(` ${o}`);t.push("")}return t.join(`
|
|
157
|
+
`)}function gt(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.applied.length>0?s.applied.join(", "):"(none)",r=n==="remove"&&s.changed?` \u2014 now: ${s.tags.length>0?s.tags.join(", "):"(none)"}`:"",o=s.changed?"":" (unchanged)";return`${t} ${y.bold(s.name)}: ${i}${r}${o}`}).join(`
|
|
158
|
+
`)}function hp(n){let e=[` ${y.bold(n.name)} ${y.dim(ve(n.tokenCount))}`,` ${y.dim("source:")} ${n.source}${n.commit?` @ ${n.commit.slice(0,7)}`:""} ${y.dim(`(${n.tier})`)}`];if(n.security){let{risk:t,warnings:s,categories:i}=n.security,r=t==="high"?y.red("[!] High Risk"):t==="medium"?y.yellow("[~] Medium Risk"):y.green("[ok] Safe"),o=s?y.dim(` (${s} warning${s===1?"":"s"}: ${i.join(", ")})`):"";e.push(` ${y.dim("security:")} ${r}${o}`)}return e.push(` ${y.dim("residency:")} ${y.dim("path"in n?"none \u2014 borrowed copy is not installed":"none \u2014 nothing was installed")}`),"path"in n&&(e.push(` ${y.dim("borrow:")} full copy retained until explicit cleanup`),e.push(` ${y.dim("cleanup:")} run asm cleanup with the exact path printed to stdout.`)),e.join(`
|
|
159
|
+
`)+`
|
|
160
|
+
|
|
161
|
+
`}function mp(n){return n.path+`
|
|
162
|
+
`}function gp(n){switch(n.status){case"removed":return`Removed borrowed skill: ${n.path}`;case"missing":return`Borrow was already missing: ${n.path}`;case"not-found":return`No registered borrow at this exact path (nothing removed): ${n.path}`;case"refused":return`Borrow cleanup refused: ${n.errors.join("; ")}`}}function yp(){return`${y.bold("Usage:")} asm cleanup <borrowed-path> [--json | --machine]
|
|
163
|
+
|
|
164
|
+
Remove only an exact ASM-owned directory returned by asm get --path.
|
|
165
|
+
Original local, installed and library skills are never removed.
|
|
166
|
+
Unknown or already cleaned paths are safe no-ops. Ownership mismatches are
|
|
167
|
+
refused; unsafe replacements are preserved (possibly in quarantine).
|
|
168
|
+
Use the absolute path exactly as returned, not a symlink or parent/child path.`}function bp(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(`
|
|
169
|
+
`)}function vp(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 Sp(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(`
|
|
170
|
+
`)}function wp(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(`
|
|
171
|
+
`)}function kp(n){return JSON.stringify(n,null,2)}async function ja(n){let e=[],t=(r,o)=>`${A()?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",J(n.effort))),e.push(t("Invocable",Me(n.modelInvocable,n.userInvocable))),n.tags?.length&&e.push(t("Tags",n.tags.join(", "))),e.push(t("Tool",n.providerLabel)),e.push(t("Scope",n.scope)),e.push(t("Location",n.location)),e.push(t("Path",Q(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 vi(n.path);if(e.push(t("File Count",String(s))),typeof n.tokenCount=="number"&&e.push(t("Est. Tokens",ve(n.tokenCount))),n.description&&(e.push(""),e.push(t("Description",n.description))),n.allowedTools&&n.allowedTools.length>0){e.push(""),e.push(A()?y.bold("Allowed Tools:"):"Allowed Tools:"),e.push(` ${mt(n.allowedTools)}`);let r=$n(n.allowedTools);r&&e.push(` ${A()?y.yellow("\u26A0"):"!"} ${r}`)}e.push(""),e.push(A()?y.bold("Eval Score:"):"Eval Score:");let i=Fa(n);if(i.length>0){let r=i.length>1;for(let o of i){let a=Ai(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(` ${A()?y.dim("Evaluated:"):"Evaluated:"} ${o.evaluatedAt}${c}`),o.categories.length>0){r?e.push(A()?y.dim(` Categories (${l}):`):` Categories (${l}):`):e.push(A()?y.dim(" Categories:"):" Categories:");for(let d of o.categories)e.push(` ${d.name.padEnd(28)} ${d.score}/${d.max}`)}}}else e.push(A()?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(A()?y.bold("Warnings:"):"Warnings:");for(let r of n.warnings)e.push(` ${A()?y.yellow("!"):"!"} [${r.category}] ${r.message}`)}return e.join(`
|
|
172
|
+
`)}function Ai(n){let e=String(n);return A()?n>=90?y.green(e):n>=80?y.cyan(e):n>=65?y.yellow(e):y.red(e):e}function Fa(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 $p(n){if(n.length===0)return"No skills found.";if(n.length===1)return ja(n[0]);let e=[],t=(d,u)=>`${A()?y.bold(d+":"):d+":"} ${u}`,s=n[0],i=s.name;e.push(""),e.push(A()?y.blueBold(` ${i}`):` ${i}`),e.push(A()?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",J(s.effort))),e.push(t(" Invocable",Me(s.modelInvocable,s.userInvocable))),s.tags?.length&&e.push(t(" Tags",s.tags.join(", ")));let r=s.fileCount??await vi(s.path);e.push(t(" File Count",String(r))),typeof s.tokenCount=="number"&&e.push(t(" Est. Tokens",ve(s.tokenCount)));let o=n.map(d=>ue(d.provider,d.providerLabel)).join(" ");e.push(t(" Installed in",o)),e.push(""),e.push(A()?y.bold(" Eval Score:"):" Eval Score:");let a=Fa(s);if(a.length>0){let d=a.length>1;for(let u of a){let f=Ai(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(` ${A()?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(A()?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(A()?y.bold(" Description:"):" Description:");let d=gt(s.description,72);for(let u of d)e.push(" "+u)}if(s.allowedTools&&s.allowedTools.length>0){e.push(""),e.push(A()?y.bold(" Allowed Tools:"):" Allowed Tools:"),e.push(` ${mt(s.allowedTools)}`);let d=$n(s.allowedTools);d&&e.push(` ${A()?y.yellow("\u26A0"):"!"} ${d}`)}e.push("");let l=` Installations (${n.length})`;e.push(A()?y.bold(l):l);for(let d=0;d<n.length;d++){let u=n[d],f=ce(u.provider,u.providerLabel),h=u.isSymlink?"symlink":"directory",m=y.dim(u.scope);e.push(` ${f} (${m}, ${h})`),e.push(` ${y.dim("Path:")} ${Q(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(A()?y.bold(d):d);for(let u of c){let f=A()?y.yellow("!"):"!";e.push(` ${f} [${u.category}] ${u.message}`)}}return e.push(""),e.join(`
|
|
173
|
+
`)}function Nn(n){return n.toLowerCase().replace(/[_\s]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Ep(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 Ua(n){let e=new Set;for(let t of n){let s=(t.version??"").trim();s&&e.add(s)}return[...e].sort(Ep)}function Ci(n){return Ua(n).length>=2}function Ip(n){let e=n.split(`
|
|
174
|
+
`);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(`
|
|
175
|
+
`);return n}function Tp(n){let e=n._skillMdContent;return e===void 0?null:Np("sha256").update(Ip(e)).digest("hex")}async function cg(n){if(n._skillMdContent===void 0)try{let e=await Ap(Cp(n.path,"SKILL.md"),"utf-8");Sn(n,e)}catch{}}function Ka(n){if(!(n.length<2||n.some(e=>e===null)))return new Set(n).size===1?"identical":"diverged"}function ug(n){let e=[],t=new Set,s=new Map,i=[];for(let u of n){let f=s.get(u.realPath);if(f!==void 0){let h=i[f];if(u.isSymlink)continue;(h.isSymlink||u.scope==="global"&&h.scope!=="global")&&(i[f]=u)}else s.set(u.realPath,i.length),i.push(u)}let r=new Map(i.map(u=>[u,Tp(u)])),o=new Map;for(let u of i){let f=Nn(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=Ka(u.members.map(m=>r.get(m)??null));e.push({key:u.key,reason:"same-dirName",instances:u.members,versionDivergence:Ci(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=Nn(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=Ka(m.map(v=>r.get(v)??null));e.push({key:u.key,reason:"same-frontmatterName",instances:m,versionDivergence:Ci(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:Ci(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]:Nn(u.key).localeCompare(Nn(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 Lp(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 Pp(n){return n==="same-dirName"?"same dirName":n==="same-content"?"identical content":"same name"}function fg(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(`(${Pp(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=Ua(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=Lp(t.instances);for(let i=0;i<s.length;i++){let r=s[i],o=ce(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(Q(r.path))}`)}e.push("")}return e.push(y.dim(` Run ${y.bold("asm audit -y")} to auto-remove duplicates`)),e.push(""),e.join(`
|
|
176
|
+
`)}function dg(n){return JSON.stringify(n,null,2)}function hg(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 Op}from"fs";import{resolve as qp,dirname as Mp}from"path";import{fileURLToPath as _p}from"url";import{spawnSync as Dp}from"child_process";var xp=Mp(_p(import.meta.url)),Va="2.20.1";try{let n=Op(qp(xp,"../../package.json"),"utf-8");Va=JSON.parse(n).version}catch{}var fe,Rp=Va;function Bp(){if(fe!==void 0)return fe;let n="d51a77b";if(n!==void 0)return fe=n,fe;fe="unknown";try{fe=Dp("git",["rev-parse","--short","HEAD"],{encoding:"utf-8",stdio:["pipe","pipe","ignore"],timeout:5e3}).stdout?.trim()||fe}catch{}return fe}function Sg(){return`v${Rp} (${Bp()})`}export{yn as a,ve as b,om as c,am as d,y as e,J as f,ce as g,kn as h,wi as i,ya as j,ci as k,ui as l,fi as m,di as n,pi as o,Ld as p,Pd as q,hi as r,mi as s,Me as t,im as u,Q as v,Oa as w,qa as x,Ma as y,Ni as z,_a as A,Da as B,xa as C,Ra as D,Ba as E,gt as F,pp as G,hp as H,mp as I,gp as J,yp as K,bp as L,vp as M,Sp as N,wp as O,kp as P,vi as Q,ym as R,bm as S,vm as T,$p as U,Rp as V,Sg as W,Si as X,$m as Y,ep as Z,tp as _,Nm as $,lp as aa,Pm as ba,Om as ca,qm as da,Mm as ea,Nn as fa,Tp as ga,cg as ha,ug as ia,Lp as ja,Pp as ka,fg as la,dg as ma,hg as na};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __asmCreateRequire } from 'node:module'; const require = __asmCreateRequire(import.meta.url);
|
|
2
|
-
import{b as i,f as l}from"./chunk-
|
|
2
|
+
import{b as i,f as l}from"./chunk-HODWB56T.js";import{readFile as T,copyFile as b}from"fs/promises";import{execFile as N}from"child_process";import{promisify as A}from"util";import{mkdir as g,open as y,rename as E,rm as P}from"fs/promises";import{randomUUID as v}from"crypto";import{basename as L,dirname as F,join as $,resolve as m}from"path";var c=new Map,x=new Set(["EINVAL","ENOSYS","ENOTSUP","EOPNOTSUPP"]);function f(e){let r=e?.code;return typeof r=="string"&&x.has(r)||process.platform==="win32"&&(r==="EISDIR"||r==="EPERM")}var u=class extends Error{constructor(t,n){let o=n instanceof Error?n.message:String(n);super(`Atomic write to ${t} was renamed into place, but parent-directory durability could not be confirmed: ${o}`);this.path=t;this.cause=n;this.name="AtomicWritePostRenameError"}path;cause;committed=!0};async function S(e){let r;try{r=await y(e,"r")}catch(o){if(f(o))return;throw o}let t=!1,n;try{await r.sync()}catch(o){f(o)||(t=!0,n=o)}try{await r.close()}catch(o){if(!t)throw o}if(t)throw n}async function p(e,r){let t=m(e),o=(c.get(t)??Promise.resolve()).then(r,r),s=o.then(()=>{},()=>{});c.set(t,s);try{return await o}finally{c.get(t)===s&&c.delete(t)}}async function w(e,r){let t=m(e),n=F(t),o=$(n,`.${L(t)}.${process.pid}.${Date.now()}.${v()}.tmp`);await g(n,{recursive:!0});let s=null;try{s=await y(o,"wx"),await s.writeFile(r,"utf-8"),await s.sync(),await s.close(),s=null,await E(o,t)}catch(a){if(s)try{await s.close()}catch{}try{await P(o,{force:!0})}catch{}throw a}try{await S(n)}catch(a){throw new u(t,a)}}var D=A(N);function k(){return{version:1,skills:{}}}async function V(){return h(l())}async function W(e,r){await d(t=>(t.skills[e]=r,{changed:!0})),i(`lock: wrote entry for "${e}"`)}async function Y(e){if(!await d(t=>e in t.skills?(delete t.skills[e],{changed:!0,result:!0}):{changed:!1,result:!1})){i(`lock: no entry for "${e}", nothing to remove`);return}i(`lock: removed entry for "${e}"`)}async function _(e,r){let t=await d(n=>{let o=n.skills[e];return o?o.provider===r?{changed:!1,result:"unchanged"}:(n.skills[e]={...o,provider:r},{changed:!0,result:"updated"}):{changed:!1,result:"missing"}});if(t==="missing"){i(`lock: no entry for "${e}", cannot update provider`);return}if(t==="unchanged"){i(`lock: entry for "${e}" already points at "${r}"`);return}i(`lock: updated provider for "${e}" -> "${r}"`)}async function h(e){let r;try{r=await T(e,"utf-8")}catch(t){if(t?.code==="ENOENT")return i("lock: file not found, returning empty lock"),k();throw t}try{let t=JSON.parse(r);if(t.version!==1||typeof t.skills!="object"||t.skills===null)throw new Error("invalid schema");return i(`lock: loaded ${Object.keys(t.skills).length} entries`),t}catch{let t=e+".bak";i(`lock: parse error, backing up to ${t}`);try{await b(e,t)}catch{}return console.error(`Warning: .skill-lock.json was corrupted. Backup saved to ${t}. Starting fresh.`),k()}}async function d(e){let r=l();return p(r,async()=>{let t=await h(r),{changed:n,result:o}=await e(t);return n&&await O(t,r),o})}async function O(e,r){await w(r,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)}async function q(e){try{let{stdout:r}=await D("git",["rev-parse","HEAD"],{cwd:e,timeout:5e3});return r.trim()||null}catch{return i("lock: could not read commit hash from cloned repo"),null}}export{u as a,p as b,w as c,V as d,W as e,Y as f,_ as g,q as h};
|