@mcp-com-ai/hapi 1.0.1-beta.260912
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin-standalone.d.ts +2 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +221 -0
- package/dist/builtins/doctor.d.ts +3 -0
- package/dist/builtins/help.d.ts +3 -0
- package/dist/builtins/index.d.ts +7 -0
- package/dist/builtins/plugins.d.ts +3 -0
- package/dist/builtins/serve.d.ts +4 -0
- package/dist/builtins/version.d.ts +2 -0
- package/dist/core/command-registry.d.ts +20 -0
- package/dist/core/document-source.d.ts +10 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +152 -0
- package/dist/core/known-plugins.d.ts +11 -0
- package/dist/core/plugin-loader.d.ts +15 -0
- package/dist/core/run-command.d.ts +3 -0
- package/dist/core/types.d.ts +31 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +220 -0
- package/dist/version.d.ts +1 -0
- package/dist/workspace-plugins.d.ts +10 -0
- package/package.json +57 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var O=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var O0=import.meta.require;var A=O((L9)=>{var jq=Symbol.for("yaml.alias"),a$=Symbol.for("yaml.document"),v0=Symbol.for("yaml.map"),s$=Symbol.for("yaml.pair"),Cq=Symbol.for("yaml.scalar"),m0=Symbol.for("yaml.seq"),x=Symbol.for("yaml.node.type"),J9=(q)=>!!q&&typeof q==="object"&&q[x]===jq,Q9=(q)=>!!q&&typeof q==="object"&&q[x]===a$,T9=(q)=>!!q&&typeof q==="object"&&q[x]===v0,R9=(q)=>!!q&&typeof q==="object"&&q[x]===s$,i$=(q)=>!!q&&typeof q==="object"&&q[x]===Cq,B9=(q)=>!!q&&typeof q==="object"&&q[x]===m0;function r$(q){if(q&&typeof q==="object")switch(q[x]){case v0:case m0:return!0}return!1}function D9(q){if(q&&typeof q==="object")switch(q[x]){case jq:case v0:case Cq:case m0:return!0}return!1}var Y9=(q)=>(i$(q)||r$(q))&&!!q.anchor;L9.ALIAS=jq;L9.DOC=a$;L9.MAP=v0;L9.NODE_TYPE=x;L9.PAIR=s$;L9.SCALAR=Cq;L9.SEQ=m0;L9.hasAnchor=Y9;L9.isAlias=J9;L9.isCollection=r$;L9.isDocument=Q9;L9.isMap=T9;L9.isNode=D9;L9.isPair=R9;L9.isScalar=i$;L9.isSeq=B9});var V0=O((E9)=>{var j=A(),C=Symbol("break visit"),n$=Symbol("skip children"),h=Symbol("remove node");function p0(q,$){let U=o$($);if(j.isDocument(q)){if(X0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else X0(null,q,U,Object.freeze([]))}p0.BREAK=C;p0.SKIP=n$;p0.REMOVE=h;function X0(q,$,U,H){let z=t$(q,$,U,H);if(j.isNode(z)||j.isPair(z))return e$(q,H,z),X0(q,z,U,H);if(typeof z!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let X=0;X<$.items.length;++X){let Z=X0(X,$.items[X],U,H);if(typeof Z==="number")X=Z-1;else if(Z===C)return C;else if(Z===h)$.items.splice(X,1),X-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let X=X0("key",$.key,U,H);if(X===C)return C;else if(X===h)$.key=null;let Z=X0("value",$.value,U,H);if(Z===C)return C;else if(Z===h)$.value=null}}return z}async function d0(q,$){let U=o$($);if(j.isDocument(q)){if(await Z0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else await Z0(null,q,U,Object.freeze([]))}d0.BREAK=C;d0.SKIP=n$;d0.REMOVE=h;async function Z0(q,$,U,H){let z=await t$(q,$,U,H);if(j.isNode(z)||j.isPair(z))return e$(q,H,z),Z0(q,z,U,H);if(typeof z!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let X=0;X<$.items.length;++X){let Z=await Z0(X,$.items[X],U,H);if(typeof Z==="number")X=Z-1;else if(Z===C)return C;else if(Z===h)$.items.splice(X,1),X-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let X=await Z0("key",$.key,U,H);if(X===C)return C;else if(X===h)$.key=null;let Z=await Z0("value",$.value,U,H);if(Z===C)return C;else if(Z===h)$.value=null}}return z}function o$(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function t$(q,$,U,H){if(typeof U==="function")return U(q,$,H);if(j.isMap($))return U.Map?.(q,$,H);if(j.isSeq($))return U.Seq?.(q,$,H);if(j.isPair($))return U.Pair?.(q,$,H);if(j.isScalar($))return U.Scalar?.(q,$,H);if(j.isAlias($))return U.Alias?.(q,$,H);return}function e$(q,$,U){let H=$[$.length-1];if(j.isCollection(H))H.items[q]=U;else if(j.isPair(H))if(q==="key")H.key=U;else H.value=U;else if(j.isDocument(H))H.contents=U;else{let z=j.isAlias(H)?"alias":"scalar";throw Error(`Cannot replace node with ${z} parent`)}}E9.visit=p0;E9.visitAsync=d0});var Eq=O((x9)=>{var qU=A(),y9=V0(),h9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},u9=(q)=>q.replace(/[!,[\]{}]/g,($)=>h9[$]);class E{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E.defaultYaml,q),this.tags=Object.assign({},E.defaultTags,$)}clone(){let q=new E(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new E(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:E.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E.defaultTags),this.atNextDocument=!1;let U=q.trim().split(/[ \t]+/),H=U.shift();switch(H){case"%TAG":{if(U.length!==2){if($(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[z,X]=U;return this.tags[z]=X,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[z]=U;if(z==="1.1"||z==="1.2")return this.yaml.version=z,!0;else{let X=/^\d+\.\d+$/.test(z);return $(6,`Unsupported YAML version ${z}`,X),!1}}default:return $(0,`Unknown directive ${H}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let X=q.slice(2,-1);if(X==="!"||X==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return X}let[,U,H]=q.match(/^(.*!)([^!]*)$/s);if(!H)$(`The ${q} tag has no suffix`);let z=this.tags[U];if(z)try{return z+decodeURIComponent(H)}catch(X){return $(String(X)),null}if(U==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,U]of Object.entries(this.tags))if(q.startsWith(U))return $+u9(q.substring(U.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),H;if(q&&U.length>0&&qU.isNode(q.contents)){let z={};y9.visit(q.contents,(X,Z)=>{if(qU.isNode(Z)&&Z.tag)z[Z.tag]=!0}),H=Object.keys(z)}else H=[];for(let[z,X]of U){if(z==="!!"&&X==="tag:yaml.org,2002:")continue;if(!q||H.some((Z)=>Z.startsWith(X)))$.push(`%TAG ${z} ${X}`)}return $.join(`
|
|
3
|
+
`)}}E.defaultYaml={explicit:!1,version:"1.2"};E.defaultTags={"!!":"tag:yaml.org,2002:"};x9.Directives=E});var l0=O((d9)=>{var $U=A(),v9=V0();function m9(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let U=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(U)}return!0}function UU(q){let $=new Set;return v9.visit(q,{Value(U,H){if(H.anchor)$.add(H.anchor)}}),$}function HU(q,$){for(let U=1;;++U){let H=`${q}${U}`;if(!$.has(H))return H}}function p9(q,$){let U=[],H=new Map,z=null;return{onAnchor:(X)=>{U.push(X),z??(z=UU(q));let Z=HU($,z);return z.add(Z),Z},setAnchors:()=>{for(let X of U){let Z=H.get(X);if(typeof Z==="object"&&Z.anchor&&($U.isScalar(Z.node)||$U.isCollection(Z.node)))Z.node.anchor=Z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=X,G}}},sourceObjects:H}}d9.anchorIsValid=m9;d9.anchorNames=UU;d9.createNodeAnchors=p9;d9.findNewAnchor=HU});var fq=O((i9)=>{function W0(q,$,U,H){if(H&&typeof H==="object")if(Array.isArray(H))for(let z=0,X=H.length;z<X;++z){let Z=H[z],G=W0(q,H,String(z),Z);if(G===void 0)delete H[z];else if(G!==Z)H[z]=G}else if(H instanceof Map)for(let z of Array.from(H.keys())){let X=H.get(z),Z=W0(q,H,z,X);if(Z===void 0)H.delete(z);else if(Z!==X)H.set(z,Z)}else if(H instanceof Set)for(let z of Array.from(H)){let X=W0(q,H,z,z);if(X===void 0)H.delete(z);else if(X!==z)H.delete(z),H.add(X)}else for(let[z,X]of Object.entries(H)){let Z=W0(q,H,z,X);if(Z===void 0)delete H[z];else if(Z!==X)H[z]=Z}return q.call($,U,H)}i9.applyReviver=W0});var m=O((o9)=>{var n9=A();function zU(q,$,U){if(Array.isArray(q))return q.map((H,z)=>zU(H,String(z),U));if(q&&typeof q.toJSON==="function"){if(!U||!n9.hasAnchor(q))return q.toJSON($,U);let H={aliasCount:0,count:1,res:void 0};U.anchors.set(q,H),U.onCreate=(X)=>{H.res=X,delete U.onCreate};let z=q.toJSON($,U);if(U.onCreate)U.onCreate(z);return z}if(typeof q==="bigint"&&!U?.keep)return Number(q);return q}o9.toJS=zU});var c0=O(($1)=>{var e9=fq(),XU=A(),q1=m();class ZU{constructor(q){Object.defineProperty(this,XU.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:U,onAnchor:H,reviver:z}={}){if(!XU.isDocument(q))throw TypeError("A document argument is required");let X={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},Z=q1.toJS(this,"",X);if(typeof H==="function")for(let{count:G,res:J}of X.anchors.values())H(J,G);return typeof z==="function"?e9.applyReviver(z,{"":Z},"",Z):Z}}$1.NodeBase=ZU});var I0=O((G1)=>{var H1=l0(),z1=V0(),G0=A(),X1=c0(),Z1=m();class GU extends X1.NodeBase{constructor(q){super(G0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){if($?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let U;if($?.aliasResolveCache)U=$.aliasResolveCache;else if(U=[],z1.visit(q,{Node:(z,X)=>{if(G0.isAlias(X)||G0.hasAnchor(X))U.push(X)}}),$)$.aliasResolveCache=U;let H=void 0;for(let z of U){if(z===this)break;if(z.anchor===this.source)H=z}return H}toJSON(q,$){if(!$)return{source:this.source};let{anchors:U,doc:H,maxAliasCount:z}=$,X=this.resolve(H,$);if(!X){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let Z=U.get(X);if(!Z)Z1.toJS(X,null,$),Z=U.get(X);if(Z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(z>=0){if(Z.count+=1,Z.aliasCount===0)Z.aliasCount=a0(H,X,U);if(Z.count*Z.aliasCount>z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Z.res}toString(q,$,U){let H=`*${this.source}`;if(q){if(H1.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(z)}if(q.implicitKey)return`${H} `}return H}}function a0(q,$,U){if(G0.isAlias($)){let H=$.resolve(q),z=U&&H&&U.get(H);return z?z.count*z.aliasCount:0}else if(G0.isCollection($)){let H=0;for(let z of $.items){let X=a0(q,z,U);if(X>H)H=X}return H}else if(G0.isPair($)){let H=a0(q,$.key,U),z=a0(q,$.value,U);return Math.max(H,z)}return 1}G1.Alias=GU});var N=O((D1)=>{var Q1=A(),T1=c0(),R1=m(),B1=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class n extends T1.NodeBase{constructor(q){super(Q1.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:R1.toJS(this.value,q,$)}toString(){return String(this.value)}}n.BLOCK_FOLDED="BLOCK_FOLDED";n.BLOCK_LITERAL="BLOCK_LITERAL";n.PLAIN="PLAIN";n.QUOTE_DOUBLE="QUOTE_DOUBLE";n.QUOTE_SINGLE="QUOTE_SINGLE";D1.Scalar=n;D1.isScalarValue=B1});var _0=O((_1)=>{var O1=I0(),o=A(),JU=N(),V1="tag:yaml.org,2002:";function W1(q,$,U){if($){let H=U.filter((X)=>X.tag===$),z=H.find((X)=>!X.format)??H[0];if(!z)throw Error(`Tag ${$} not found`);return z}return U.find((H)=>H.identify?.(q)&&!H.format)}function I1(q,$,U){if(o.isDocument(q))q=q.contents;if(o.isNode(q))return q;if(o.isPair(q)){let T=U.schema[o.MAP].createNode?.(U.schema,null,U);return T.items.push(q),T}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:H,onAnchor:z,onTagObj:X,schema:Z,sourceObjects:G}=U,J=void 0;if(H&&q&&typeof q==="object")if(J=G.get(q),J)return J.anchor??(J.anchor=z(q)),new O1.Alias(J.anchor);else J={anchor:null,node:null},G.set(q,J);if($?.startsWith("!!"))$=V1+$.slice(2);let Q=W1(q,$,Z.tags);if(!Q){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let T=new JU.Scalar(q);if(J)J.node=T;return T}Q=q instanceof Map?Z[o.MAP]:(Symbol.iterator in Object(q))?Z[o.SEQ]:Z[o.MAP]}if(X)X(Q),delete U.onTagObj;let D=Q?.createNode?Q.createNode(U.schema,q,U):typeof Q?.nodeClass?.from==="function"?Q.nodeClass.from(U.schema,q,U):new JU.Scalar(q);if($)D.tag=$;else if(!Q.default)D.tag=Q.tag;if(J)J.node=D;return D}_1.createNode=I1});var s0=O((M1)=>{var P1=_0(),u=A(),w1=c0();function gq(q,$,U){let H=U;for(let z=$.length-1;z>=0;--z){let X=$[z];if(typeof X==="number"&&Number.isInteger(X)&&X>=0){let Z=[];Z[X]=H,H=Z}else H=new Map([[X,H]])}return P1.createNode(H,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var QU=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class TU extends w1.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((U)=>u.isNode(U)||u.isPair(U)?U.clone(q):U),this.range)$.range=this.range.slice();return $}addIn(q,$){if(QU(q))this.add($);else{let[U,...H]=q,z=this.get(U,!0);if(u.isCollection(z))z.addIn(H,$);else if(z===void 0&&this.schema)this.set(U,gq(this.schema,H,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}deleteIn(q){let[$,...U]=q;if(U.length===0)return this.delete($);let H=this.get($,!0);if(u.isCollection(H))return H.deleteIn(U);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${U}`)}getIn(q,$){let[U,...H]=q,z=this.get(U,!0);if(H.length===0)return!$&&u.isScalar(z)?z.value:z;else return u.isCollection(z)?z.getIn(H,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!u.isPair($))return!1;let U=$.value;return U==null||q&&u.isScalar(U)&&U.value==null&&!U.commentBefore&&!U.comment&&!U.tag})}hasIn(q){let[$,...U]=q;if(U.length===0)return this.has($);let H=this.get($,!0);return u.isCollection(H)?H.hasIn(U):!1}setIn(q,$){let[U,...H]=q;if(H.length===0)this.set(U,$);else{let z=this.get(U,!0);if(u.isCollection(z))z.setIn(H,$);else if(z===void 0&&this.schema)this.set(U,gq(this.schema,H,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}}M1.Collection=TU;M1.collectionFromPath=gq;M1.isEmptyPath=QU});var F0=O((j1)=>{var b1=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function yq(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var S1=(q,$,U)=>q.endsWith(`
|
|
4
|
+
`)?yq(U,$):U.includes(`
|
|
5
|
+
`)?`
|
|
6
|
+
`+yq(U,$):(q.endsWith(" ")?"":" ")+U;j1.indentComment=yq;j1.lineComment=S1;j1.stringifyComment=b1});var BU=O((y1)=>{function g1(q,$,U="flow",{indentAtStart:H,lineWidth:z=80,minContentWidth:X=20,onFold:Z,onOverflow:G}={}){if(!z||z<0)return q;if(z<X)X=0;let J=Math.max(1+X,1+z-$.length);if(q.length<=J)return q;let Q=[],D={},T=z-$.length;if(typeof H==="number")if(H>z-Math.max(2,X))Q.push(0);else T=z-H;let R=void 0,L=void 0,V=!1,B=-1,Y=-1,I=-1;if(U==="block"){if(B=RU(q,B,$.length),B!==-1)T=B+J}for(let F;F=q[B+=1];){if(U==="quoted"&&F==="\\"){switch(Y=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}I=B}if(F===`
|
|
7
|
+
`){if(U==="block")B=RU(q,B,$.length);T=B+$.length+J,R=void 0}else{if(F===" "&&L&&L!==" "&&L!==`
|
|
8
|
+
`&&L!=="\t"){let P=q[B+1];if(P&&P!==" "&&P!==`
|
|
9
|
+
`&&P!=="\t")R=B}if(B>=T)if(R)Q.push(R),T=R+J,R=void 0;else if(U==="quoted"){while(L===" "||L==="\t")L=F,F=q[B+=1],V=!0;let P=B>I+1?B-2:Y-1;if(D[P])return q;Q.push(P),D[P]=!0,T=P+J,R=void 0}else V=!0}L=F}if(V&&G)G();if(Q.length===0)return q;if(Z)Z();let _=q.slice(0,Q[0]);for(let F=0;F<Q.length;++F){let P=Q[F],w=Q[F+1]||q.length;if(P===0)_=`
|
|
10
|
+
${$}${q.slice(0,w)}`;else{if(U==="quoted"&&D[P])_+=`${q[P]}\\`;_+=`
|
|
11
|
+
${$}${q.slice(P+1,w)}`}}return _}function RU(q,$,U){let H=$,z=$+1,X=q[z];while(X===" "||X==="\t")if($<z+U)X=q[++$];else{do X=q[++$];while(X&&X!==`
|
|
12
|
+
`);H=$,z=$+1,X=q[z]}return H}y1.FOLD_BLOCK="block";y1.FOLD_FLOW="flow";y1.FOLD_QUOTED="quoted";y1.foldFlowLines=g1});var w0=O((d1)=>{var g=N(),p=BU(),r0=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),n0=(q)=>/^(%|---|\.\.\.)/m.test(q);function v1(q,$,U){if(!$||$<0)return!1;let H=$-U,z=q.length;if(z<=H)return!1;for(let X=0,Z=0;X<z;++X)if(q[X]===`
|
|
13
|
+
`){if(X-Z>H)return!0;if(Z=X+1,z-Z<=H)return!1}return!0}function P0(q,$){let U=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return U;let{implicitKey:H}=$,z=$.options.doubleQuotedMinMultiLineLength,X=$.indent||(n0(q)?" ":""),Z="",G=0;for(let J=0,Q=U[J];Q;Q=U[++J]){if(Q===" "&&U[J+1]==="\\"&&U[J+2]==="n")Z+=U.slice(G,J)+"\\ ",J+=1,G=J,Q="\\";if(Q==="\\")switch(U[J+1]){case"u":{Z+=U.slice(G,J);let D=U.substr(J+2,4);switch(D){case"0000":Z+="\\0";break;case"0007":Z+="\\a";break;case"000b":Z+="\\v";break;case"001b":Z+="\\e";break;case"0085":Z+="\\N";break;case"00a0":Z+="\\_";break;case"2028":Z+="\\L";break;case"2029":Z+="\\P";break;default:if(D.substr(0,2)==="00")Z+="\\x"+D.substr(2);else Z+=U.substr(J,6)}J+=5,G=J+1}break;case"n":if(H||U[J+2]==='"'||U.length<z)J+=1;else{Z+=U.slice(G,J)+`
|
|
14
|
+
|
|
15
|
+
`;while(U[J+2]==="\\"&&U[J+3]==="n"&&U[J+4]!=='"')Z+=`
|
|
16
|
+
`,J+=2;if(Z+=X,U[J+2]===" ")Z+="\\";J+=1,G=J+1}break;default:J+=1}}return Z=G?Z+U.slice(G):U,H?Z:p.foldFlowLines(Z,X,p.FOLD_QUOTED,r0($,!1))}function hq(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return P0(q,$);let U=$.indent||(n0(q)?" ":""),H="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${U}`)+"'";return $.implicitKey?H:p.foldFlowLines(H,U,p.FOLD_FLOW,r0($,!1))}function J0(q,$){let{singleQuote:U}=$.options,H;if(U===!1)H=P0;else{let z=q.includes('"'),X=q.includes("'");if(z&&!X)H=hq;else if(X&&!z)H=P0;else H=U?hq:P0}return H(q,$)}var uq;try{uq=new RegExp(`(^|(?<!
|
|
19
|
+
))
|
|
20
|
+
+(?!
|
|
21
|
+
|$)`,"g")}catch{uq=/\n+(?!\n|$)/g}function i0({comment:q,type:$,value:U},H,z,X){let{blockQuote:Z,commentString:G,lineWidth:J}=H.options;if(!Z||/\n[\t ]+$/.test(U))return J0(U,H);let Q=H.indent||(H.forceBlockIndent||n0(U)?" ":""),D=Z==="literal"?!0:Z==="folded"||$===g.Scalar.BLOCK_FOLDED?!1:$===g.Scalar.BLOCK_LITERAL?!0:!v1(U,J,Q.length);if(!U)return D?`|
|
|
22
|
+
`:`>
|
|
23
|
+
`;let T,R;for(R=U.length;R>0;--R){let w=U[R-1];if(w!==`
|
|
24
|
+
`&&w!=="\t"&&w!==" ")break}let L=U.substring(R),V=L.indexOf(`
|
|
25
|
+
`);if(V===-1)T="-";else if(U===L||V!==L.length-1){if(T="+",X)X()}else T="";if(L){if(U=U.slice(0,-L.length),L[L.length-1]===`
|
|
26
|
+
`)L=L.slice(0,-1);L=L.replace(uq,`$&${Q}`)}let B=!1,Y,I=-1;for(Y=0;Y<U.length;++Y){let w=U[Y];if(w===" ")B=!0;else if(w===`
|
|
27
|
+
`)I=Y;else break}let _=U.substring(0,I<Y?I+1:Y);if(_)U=U.substring(_.length),_=_.replace(/\n+/g,`$&${Q}`);let P=(B?Q?"2":"1":"")+T;if(q){if(P+=" "+G(q.replace(/ ?[\r\n]+/g," ")),z)z()}if(!D){let w=U.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Q}`),M=!1,K=r0(H,!0);if(Z!=="folded"&&$!==g.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{M=!0};let W=p.foldFlowLines(`${_}${w}${L}`,Q,p.FOLD_BLOCK,K);if(!M)return`>${P}
|
|
29
|
+
${Q}${W}`}return U=U.replace(/\n+/g,`$&${Q}`),`|${P}
|
|
30
|
+
${Q}${_}${U}${L}`}function m1(q,$,U,H){let{type:z,value:X}=q,{actualString:Z,implicitKey:G,indent:J,indentStep:Q,inFlow:D}=$;if(G&&X.includes(`
|
|
31
|
+
`)||D&&/[[\]{},]/.test(X))return J0(X,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(X))return G||D||!X.includes(`
|
|
32
|
+
`)?J0(X,$):i0(q,$,U,H);if(!G&&!D&&z!==g.Scalar.PLAIN&&X.includes(`
|
|
33
|
+
`))return i0(q,$,U,H);if(n0(X)){if(J==="")return $.forceBlockIndent=!0,i0(q,$,U,H);else if(G&&J===Q)return J0(X,$)}let T=X.replace(/\n+/g,`$&
|
|
34
|
+
${J}`);if(Z){let R=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(T),{compat:L,tags:V}=$.doc.schema;if(V.some(R)||L?.some(R))return J0(X,$)}return G?T:p.foldFlowLines(T,J,p.FOLD_FLOW,r0($,!1))}function p1(q,$,U,H){let{implicitKey:z,inFlow:X}=$,Z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:G}=q;if(G!==g.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Z.value))G=g.Scalar.QUOTE_DOUBLE}let J=(D)=>{switch(D){case g.Scalar.BLOCK_FOLDED:case g.Scalar.BLOCK_LITERAL:return z||X?J0(Z.value,$):i0(Z,$,U,H);case g.Scalar.QUOTE_DOUBLE:return P0(Z.value,$);case g.Scalar.QUOTE_SINGLE:return hq(Z.value,$);case g.Scalar.PLAIN:return m1(Z,$,U,H);default:return null}},Q=J(G);if(Q===null){let{defaultKeyType:D,defaultStringType:T}=$.options,R=z&&D||T;if(Q=J(R),Q===null)throw Error(`Unsupported default string type ${R}`)}return Q}d1.stringifyString=p1});var M0=O((t1)=>{var c1=l0(),d=A(),a1=F0(),s1=w0();function i1(q,$){let U=Object.assign({blockQuote:!0,commentString:a1.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},q.schema.toStringOptions,$),H;switch(U.collectionStyle){case"block":H=!1;break;case"flow":H=!0;break;default:H=null}return{anchors:new Set,doc:q,flowCollectionPadding:U.flowCollectionPadding?" ":"",indent:"",indentStep:typeof U.indent==="number"?" ".repeat(U.indent):" ",inFlow:H,options:U}}function r1(q,$){if($.tag){let z=q.filter((X)=>X.tag===$.tag);if(z.length>0)return z.find((X)=>X.format===$.format)??z[0]}let U=void 0,H;if(d.isScalar($)){H=$.value;let z=q.filter((X)=>X.identify?.(H));if(z.length>1){let X=z.filter((Z)=>Z.test);if(X.length>0)z=X}U=z.find((X)=>X.format===$.format)??z.find((X)=>!X.format)}else H=$,U=q.find((z)=>z.nodeClass&&H instanceof z.nodeClass);if(!U){let z=H?.constructor?.name??(H===null?"null":typeof H);throw Error(`Tag not resolved for ${z} value`)}return U}function n1(q,$,{anchors:U,doc:H}){if(!H.directives)return"";let z=[],X=(d.isScalar(q)||d.isCollection(q))&&q.anchor;if(X&&c1.anchorIsValid(X))U.add(X),z.push(`&${X}`);let Z=q.tag??($.default?null:$.tag);if(Z)z.push(H.directives.tagString(Z));return z.join(" ")}function o1(q,$,U,H){if(d.isPair(q))return q.toString($,U,H);if(d.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let z=void 0,X=d.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>z=J});z??(z=r1($.doc.schema.tags,X));let Z=n1(X,z,$);if(Z.length>0)$.indentAtStart=($.indentAtStart??0)+Z.length+1;let G=typeof z.stringify==="function"?z.stringify(X,$,U,H):d.isScalar(X)?s1.stringifyString(X,$,U,H):X.toString($,U,H);if(!Z)return G;return d.isScalar(X)||G[0]==="{"||G[0]==="["?`${Z} ${G}`:`${Z}
|
|
35
|
+
${$.indent}${G}`}t1.createStringifyContext=i1;t1.stringify=o1});var LU=O((U3)=>{var k=A(),DU=N(),YU=M0(),A0=F0();function $3({key:q,value:$},U,H,z){let{allNullValues:X,doc:Z,indent:G,indentStep:J,options:{commentString:Q,indentSeq:D,simpleKeys:T}}=U,R=k.isNode(q)&&q.comment||null;if(T){if(R)throw Error("With simple keys, key nodes cannot have comments");if(k.isCollection(q)||!k.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!T&&(!q||R&&$==null&&!U.inFlow||k.isCollection(q)||(k.isScalar(q)?q.type===DU.Scalar.BLOCK_FOLDED||q.type===DU.Scalar.BLOCK_LITERAL:typeof q==="object"));U=Object.assign({},U,{allNullValues:!1,implicitKey:!L&&(T||!X),indent:G+J});let V=!1,B=!1,Y=YU.stringify(q,U,()=>V=!0,()=>B=!0);if(!L&&!U.inFlow&&Y.length>1024){if(T)throw Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(U.inFlow){if(X||$==null){if(V&&H)H();return Y===""?"?":L?`? ${Y}`:Y}}else if(X&&!T||$==null&&L){if(Y=`? ${Y}`,R&&!V)Y+=A0.lineComment(Y,U.indent,Q(R));else if(B&&z)z();return Y}if(V)R=null;if(L){if(R)Y+=A0.lineComment(Y,U.indent,Q(R));Y=`? ${Y}
|
|
36
|
+
${G}:`}else if(Y=`${Y}:`,R)Y+=A0.lineComment(Y,U.indent,Q(R));let I,_,F;if(k.isNode($))I=!!$.spaceBefore,_=$.commentBefore,F=$.comment;else if(I=!1,_=null,F=null,$&&typeof $==="object")$=Z.createNode($);if(U.implicitKey=!1,!L&&!R&&k.isScalar($))U.indentAtStart=Y.length+1;if(B=!1,!D&&J.length>=2&&!U.inFlow&&!L&&k.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)U.indent=U.indent.substring(2);let P=!1,w=YU.stringify($,U,()=>P=!0,()=>B=!0),M=" ";if(R||I||_){if(M=I?`
|
|
37
|
+
`:"",_){let K=Q(_);M+=`
|
|
38
|
+
${A0.indentComment(K,U.indent)}`}if(w===""&&!U.inFlow){if(M===`
|
|
39
|
+
`&&F)M=`
|
|
40
|
+
|
|
41
|
+
`}else M+=`
|
|
42
|
+
${U.indent}`}else if(!L&&k.isCollection($)){let K=w[0],W=w.indexOf(`
|
|
43
|
+
`),b=W!==-1,v=U.inFlow??$.flow??$.items.length===0;if(b||!v){let z0=!1;if(b&&(K==="&"||K==="!")){let S=w.indexOf(" ");if(K==="&"&&S!==-1&&S<W&&w[S+1]==="!")S=w.indexOf(" ",S+1);if(S===-1||W<S)z0=!0}if(!z0)M=`
|
|
44
|
+
${U.indent}`}}else if(w===""||w[0]===`
|
|
45
|
+
`)M="";if(Y+=M+w,U.inFlow){if(P&&H)H()}else if(F&&!P)Y+=A0.lineComment(Y,U.indent,Q(F));else if(B&&z)z();return Y}U3.stringifyPair=$3});var xq=O((Z3)=>{var OU=O0("process");function z3(q,...$){if(q==="debug")console.log(...$)}function X3(q,$){if(q==="debug"||q==="warn")if(typeof OU.emitWarning==="function")OU.emitWarning($);else console.warn($)}Z3.debug=z3;Z3.warn=X3});var qq=O((T3)=>{var e0=A(),VU=N(),o0="<<",t0={identify:(q)=>q===o0||typeof q==="symbol"&&q.description===o0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new VU.Scalar(Symbol(o0)),{addToJSMap:WU}),stringify:()=>o0},Q3=(q,$)=>(t0.identify($)||e0.isScalar($)&&(!$.type||$.type===VU.Scalar.PLAIN)&&t0.identify($.value))&&q?.doc.schema.tags.some((U)=>U.tag===t0.tag&&U.default);function WU(q,$,U){let H=IU(q,U);if(e0.isSeq(H))for(let z of H.items)kq(q,$,z);else if(Array.isArray(H))for(let z of H)kq(q,$,z);else kq(q,$,H)}function kq(q,$,U){let H=IU(q,U);if(!e0.isMap(H))throw Error("Merge sources must be maps or map aliases");let z=H.toJSON(null,q,Map);for(let[X,Z]of z)if($ instanceof Map){if(!$.has(X))$.set(X,Z)}else if($ instanceof Set)$.add(X);else if(!Object.prototype.hasOwnProperty.call($,X))Object.defineProperty($,X,{value:Z,writable:!0,enumerable:!0,configurable:!0});return $}function IU(q,$){return q&&e0.isAlias($)?$.resolve(q.doc,q):$}T3.addMergeToJSMap=WU;T3.isMergeKey=Q3;T3.merge=t0});var mq=O((W3)=>{var Y3=xq(),_U=qq(),L3=M0(),FU=A(),vq=m();function O3(q,$,{key:U,value:H}){if(FU.isNode(U)&&U.addToJSMap)U.addToJSMap(q,$,H);else if(_U.isMergeKey(q,U))_U.addMergeToJSMap(q,$,H);else{let z=vq.toJS(U,"",q);if($ instanceof Map)$.set(z,vq.toJS(H,z,q));else if($ instanceof Set)$.add(z);else{let X=V3(U,z,q),Z=vq.toJS(H,X,q);if(X in $)Object.defineProperty($,X,{value:Z,writable:!0,enumerable:!0,configurable:!0});else $[X]=Z}}return $}function V3(q,$,U){if($===null)return"";if(typeof $!=="object")return String($);if(FU.isNode(q)&&U?.doc){let H=L3.createStringifyContext(U.doc,{});H.anchors=new Set;for(let X of U.anchors.keys())H.anchors.add(X.anchor);H.inFlow=!0,H.inStringifyKey=!0;let z=q.toString(H);if(!U.mapKeyWarned){let X=JSON.stringify(z);if(X.length>40)X=X.substring(0,36)+'..."';Y3.warn(U.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${X}. Set mapAsMap: true to use object keys.`),U.mapKeyWarned=!0}return z}return JSON.stringify($)}W3.addPairToJSMap=O3});var l=O((w3)=>{var PU=_0(),_3=LU(),F3=mq(),$q=A();function P3(q,$,U){let H=PU.createNode(q,void 0,U),z=PU.createNode($,void 0,U);return new Uq(H,z)}class Uq{constructor(q,$=null){Object.defineProperty(this,$q.NODE_TYPE,{value:$q.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:U}=this;if($q.isNode($))$=$.clone(q);if($q.isNode(U))U=U.clone(q);return new Uq($,U)}toJSON(q,$){let U=$?.mapAsMap?new Map:{};return F3.addPairToJSMap($,U,this)}toString(q,$,U){return q?.doc?_3.stringifyPair(this,q,$,U):JSON.stringify(this)}}w3.Pair=Uq;w3.createPair=P3});var pq=O((S3)=>{var t=A(),wU=M0(),Hq=F0();function K3(q,$,U){return($.inFlow??q.flow?b3:N3)(q,$,U)}function N3({comment:q,items:$},U,{blockItemPrefix:H,flowChars:z,itemIndent:X,onChompKeep:Z,onComment:G}){let{indent:J,options:{commentString:Q}}=U,D=Object.assign({},U,{indent:X,type:null}),T=!1,R=[];for(let V=0;V<$.length;++V){let B=$[V],Y=null;if(t.isNode(B)){if(!T&&B.spaceBefore)R.push("");if(zq(U,R,B.commentBefore,T),B.comment)Y=B.comment}else if(t.isPair(B)){let _=t.isNode(B.key)?B.key:null;if(_){if(!T&&_.spaceBefore)R.push("");zq(U,R,_.commentBefore,T)}}T=!1;let I=wU.stringify(B,D,()=>Y=null,()=>T=!0);if(Y)I+=Hq.lineComment(I,X,Q(Y));if(T&&Y)T=!1;R.push(H+I)}let L;if(R.length===0)L=z.start+z.end;else{L=R[0];for(let V=1;V<R.length;++V){let B=R[V];L+=B?`
|
|
46
|
+
${J}${B}`:`
|
|
47
|
+
`}}if(q){if(L+=`
|
|
48
|
+
`+Hq.indentComment(Q(q),J),G)G()}else if(T&&Z)Z();return L}function b3({items:q},$,{flowChars:U,itemIndent:H}){let{indent:z,indentStep:X,flowCollectionPadding:Z,options:{commentString:G}}=$;H+=X;let J=Object.assign({},$,{indent:H,inFlow:!0,type:null}),Q=!1,D=0,T=[];for(let V=0;V<q.length;++V){let B=q[V],Y=null;if(t.isNode(B)){if(B.spaceBefore)T.push("");if(zq($,T,B.commentBefore,!1),B.comment)Y=B.comment}else if(t.isPair(B)){let _=t.isNode(B.key)?B.key:null;if(_){if(_.spaceBefore)T.push("");if(zq($,T,_.commentBefore,!1),_.comment)Q=!0}let F=t.isNode(B.value)?B.value:null;if(F){if(F.comment)Y=F.comment;if(F.commentBefore)Q=!0}else if(B.value==null&&_?.comment)Y=_.comment}if(Y)Q=!0;let I=wU.stringify(B,J,()=>Y=null);if(Q||(Q=T.length>D||I.includes(`
|
|
49
|
+
`)),V<q.length-1)I+=",";else if($.options.trailingComma){if($.options.lineWidth>0)Q||(Q=T.reduce((_,F)=>_+F.length+2,2)+(I.length+2)>$.options.lineWidth);if(Q)I+=","}if(Y)I+=Hq.lineComment(I,H,G(Y));T.push(I),D=T.length}let{start:R,end:L}=U;if(T.length===0)return R+L;else{if(!Q){let V=T.reduce((B,Y)=>B+Y.length+2,2);Q=$.options.lineWidth>0&&V>$.options.lineWidth}if(Q){let V=R;for(let B of T)V+=B?`
|
|
50
|
+
${X}${z}${B}`:`
|
|
51
|
+
`;return`${V}
|
|
52
|
+
${z}${L}`}else return`${R}${Z}${T.join(" ")}${Z}${L}`}}function zq({indent:q,options:{commentString:$}},U,H,z){if(H&&z)H=H.replace(/^\n+/,"");if(H){let X=Hq.indentComment($(H),q);U.push(X.trimStart())}}S3.stringifyCollection=K3});var a=O((y3)=>{var C3=pq(),E3=mq(),f3=s0(),c=A(),Xq=l(),g3=N();function K0(q,$){let U=c.isScalar($)?$.value:$;for(let H of q)if(c.isPair(H)){if(H.key===$||H.key===U)return H;if(c.isScalar(H.key)&&H.key.value===U)return H}return}class MU extends f3.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(c.MAP,q);this.items=[]}static from(q,$,U){let{keepUndefined:H,replacer:z}=U,X=new this(q),Z=(G,J)=>{if(typeof z==="function")J=z.call($,G,J);else if(Array.isArray(z)&&!z.includes(G))return;if(J!==void 0||H)X.items.push(Xq.createPair(G,J,U))};if($ instanceof Map)for(let[G,J]of $)Z(G,J);else if($&&typeof $==="object")for(let G of Object.keys($))Z(G,$[G]);if(typeof q.sortMapEntries==="function")X.items.sort(q.sortMapEntries);return X}add(q,$){let U;if(c.isPair(q))U=q;else if(!q||typeof q!=="object"||!("key"in q))U=new Xq.Pair(q,q?.value);else U=new Xq.Pair(q.key,q.value);let H=K0(this.items,U.key),z=this.schema?.sortMapEntries;if(H){if(!$)throw Error(`Key ${U.key} already set`);if(c.isScalar(H.value)&&g3.isScalarValue(U.value))H.value.value=U.value;else H.value=U.value}else if(z){let X=this.items.findIndex((Z)=>z(U,Z)<0);if(X===-1)this.items.push(U);else this.items.splice(X,0,U)}else this.items.push(U)}delete(q){let $=K0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let H=K0(this.items,q)?.value;return(!$&&c.isScalar(H)?H.value:H)??void 0}has(q){return!!K0(this.items,q)}set(q,$){this.add(new Xq.Pair(q,$),!0)}toJSON(q,$,U){let H=U?new U:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(H);for(let z of this.items)E3.addPairToJSMap($,H,z);return H}toString(q,$,U){if(!q)return JSON.stringify(this);for(let H of this.items)if(!c.isPair(H))throw Error(`Map items must all be pairs; found ${JSON.stringify(H)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return C3.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:U,onComment:$})}}y3.YAMLMap=MU;y3.findPair=K0});var Q0=O((v3)=>{var x3=A(),AU=a(),k3={collection:"map",default:!0,nodeClass:AU.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!x3.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,U)=>AU.YAMLMap.from(q,$,U)};v3.map=k3});var s=O((s3)=>{var p3=_0(),d3=pq(),l3=s0(),Gq=A(),c3=N(),a3=m();class KU extends l3.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(Gq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=Zq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let U=Zq(q);if(typeof U!=="number")return;let H=this.items[U];return!$&&Gq.isScalar(H)?H.value:H}has(q){let $=Zq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let U=Zq(q);if(typeof U!=="number")throw Error(`Expected a valid index, not ${q}.`);let H=this.items[U];if(Gq.isScalar(H)&&c3.isScalarValue($))H.value=$;else this.items[U]=$}toJSON(q,$){let U=[];if($?.onCreate)$.onCreate(U);let H=0;for(let z of this.items)U.push(a3.toJS(z,String(H++),$));return U}toString(q,$,U){if(!q)return JSON.stringify(this);return d3.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:U,onComment:$})}static from(q,$,U){let{replacer:H}=U,z=new this(q);if($&&Symbol.iterator in Object($)){let X=0;for(let Z of $){if(typeof H==="function"){let G=$ instanceof Set?Z:String(X++);Z=H.call($,G,Z)}z.items.push(p3.createNode(Z,void 0,U))}}return z}}function Zq(q){let $=Gq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}s3.YAMLSeq=KU});var T0=O((o3)=>{var r3=A(),NU=s(),n3={collection:"seq",default:!0,nodeClass:NU.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!r3.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,U)=>NU.YAMLSeq.from(q,$,U)};o3.seq=n3});var N0=O(($4)=>{var e3=w0(),q4={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,U,H){return $=Object.assign({actualString:!0},$),e3.stringifyString(q,$,U,H)}};$4.string=q4});var Jq=O((H4)=>{var bU=N(),SU={identify:(q)=>q==null,createNode:()=>new bU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new bU.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&SU.test.test(q)?q:$.options.nullStr};H4.nullTag=SU});var dq=O((Z4)=>{var X4=N(),jU={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new X4.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},U){if(q&&jU.test.test(q)){let H=q[0]==="t"||q[0]==="T";if($===H)return q}return $?U.options.trueStr:U.options.falseStr}};Z4.boolTag=jU});var R0=O((Q4)=>{function J4({format:q,minFractionDigits:$,tag:U,value:H}){if(typeof H==="bigint")return String(H);let z=typeof H==="number"?H:Number(H);if(!isFinite(z))return isNaN(z)?".nan":z<0?"-.inf":".inf";let X=Object.is(H,-0)?"-0":JSON.stringify(H);if(!q&&$&&(!U||U==="tag:yaml.org,2002:float")&&/^-?\d/.test(X)&&!X.includes("e")){let Z=X.indexOf(".");if(Z<0)Z=X.length,X+=".";let G=$-(X.length-Z-1);while(G-- >0)X+="0"}return X}Q4.stringifyNumber=J4});var cq=O((L4)=>{var R4=N(),lq=R0(),B4={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:lq.stringifyNumber},D4={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():lq.stringifyNumber(q)}},Y4={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new R4.Scalar(parseFloat(q)),U=q.indexOf(".");if(U!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-U-1;return $},stringify:lq.stringifyNumber};L4.float=Y4;L4.floatExp=D4;L4.floatNaN=B4});var sq=O((P4)=>{var CU=R0(),Qq=(q)=>typeof q==="bigint"||Number.isInteger(q),aq=(q,$,U,{intAsBigInt:H})=>H?BigInt(q):parseInt(q.substring($),U);function EU(q,$,U){let{value:H}=q;if(Qq(H)&&H>=0)return U+H.toString($);return CU.stringifyNumber(q)}var I4={identify:(q)=>Qq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,U)=>aq(q,2,8,U),stringify:(q)=>EU(q,8,"0o")},_4={identify:Qq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,U)=>aq(q,0,10,U),stringify:CU.stringifyNumber},F4={identify:(q)=>Qq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,U)=>aq(q,2,16,U),stringify:(q)=>EU(q,16,"0x")};P4.int=_4;P4.intHex=F4;P4.intOct=I4});var fU=O((E4)=>{var K4=Q0(),N4=Jq(),b4=T0(),S4=N0(),j4=dq(),iq=cq(),rq=sq(),C4=[K4.map,b4.seq,S4.string,N4.nullTag,j4.boolTag,rq.intOct,rq.int,rq.intHex,iq.floatNaN,iq.floatExp,iq.float];E4.schema=C4});var yU=O((v4)=>{var g4=N(),y4=Q0(),h4=T0();function gU(q){return typeof q==="bigint"||Number.isInteger(q)}var Tq=({value:q})=>JSON.stringify(q),u4=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:Tq},{identify:(q)=>q==null,createNode:()=>new g4.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Tq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:Tq},{identify:gU,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:U})=>U?BigInt(q):parseInt(q,10),stringify:({value:q})=>gU(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:Tq}],x4={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},k4=[y4.map,h4.seq].concat(u4,x4);v4.schema=k4});var oq=O((l4)=>{var b0=O0("buffer"),nq=N(),p4=w0(),d4={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof b0.Buffer==="function")return b0.Buffer.from(q,"base64");else if(typeof atob==="function"){let U=atob(q.replace(/[\n\r]/g,"")),H=new Uint8Array(U.length);for(let z=0;z<U.length;++z)H[z]=U.charCodeAt(z);return H}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:U},H,z,X){if(!U)return"";let Z=U,G;if(typeof b0.Buffer==="function")G=Z instanceof b0.Buffer?Z.toString("base64"):b0.Buffer.from(Z.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let Q=0;Q<Z.length;++Q)J+=String.fromCharCode(Z[Q]);G=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=nq.Scalar.BLOCK_LITERAL),$!==nq.Scalar.QUOTE_DOUBLE){let J=Math.max(H.options.lineWidth-H.indent.length,H.options.minContentWidth),Q=Math.ceil(G.length/J),D=Array(Q);for(let T=0,R=0;T<Q;++T,R+=J)D[T]=G.substr(R,J);G=D.join($===nq.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return p4.stringifyString({comment:q,type:$,value:G},H,z,X)}};l4.binary=d4});var Bq=O((r4)=>{var Rq=A(),tq=l(),a4=N(),s4=s();function hU(q,$){if(Rq.isSeq(q))for(let U=0;U<q.items.length;++U){let H=q.items[U];if(Rq.isPair(H))continue;else if(Rq.isMap(H)){if(H.items.length>1)$("Each pair must have its own sequence indicator");let z=H.items[0]||new tq.Pair(new a4.Scalar(null));if(H.commentBefore)z.key.commentBefore=z.key.commentBefore?`${H.commentBefore}
|
|
54
|
+
${z.key.commentBefore}`:H.commentBefore;if(H.comment){let X=z.value??z.key;X.comment=X.comment?`${H.comment}
|
|
55
|
+
${X.comment}`:H.comment}H=z}q.items[U]=Rq.isPair(H)?H:new tq.Pair(H)}else $("Expected a sequence for this tag");return q}function uU(q,$,U){let{replacer:H}=U,z=new s4.YAMLSeq(q);z.tag="tag:yaml.org,2002:pairs";let X=0;if($&&Symbol.iterator in Object($))for(let Z of $){if(typeof H==="function")Z=H.call($,String(X++),Z);let G,J;if(Array.isArray(Z))if(Z.length===2)G=Z[0],J=Z[1];else throw TypeError(`Expected [key, value] tuple: ${Z}`);else if(Z&&Z instanceof Object){let Q=Object.keys(Z);if(Q.length===1)G=Q[0],J=Z[G];else throw TypeError(`Expected tuple with one key, not ${Q.length} keys`)}else G=Z;z.items.push(tq.createPair(G,J,U))}return z}var i4={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hU,createNode:uU};r4.createPairs=uU;r4.pairs=i4;r4.resolvePairs=hU});var q$=O(($H)=>{var xU=A(),eq=m(),S0=a(),e4=s(),kU=Bq();class e extends e4.YAMLSeq{constructor(){super();this.add=S0.YAMLMap.prototype.add.bind(this),this.delete=S0.YAMLMap.prototype.delete.bind(this),this.get=S0.YAMLMap.prototype.get.bind(this),this.has=S0.YAMLMap.prototype.has.bind(this),this.set=S0.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(q,$){if(!$)return super.toJSON(q);let U=new Map;if($?.onCreate)$.onCreate(U);for(let H of this.items){let z,X;if(xU.isPair(H))z=eq.toJS(H.key,"",$),X=eq.toJS(H.value,z,$);else z=eq.toJS(H,"",$);if(U.has(z))throw Error("Ordered maps must not include duplicate keys");U.set(z,X)}return U}static from(q,$,U){let H=kU.createPairs(q,$,U),z=new this;return z.items=H.items,z}}e.tag="tag:yaml.org,2002:omap";var qH={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let U=kU.resolvePairs(q,$),H=[];for(let{key:z}of U.items)if(xU.isScalar(z))if(H.includes(z.value))$(`Ordered maps must not include duplicate keys: ${z.value}`);else H.push(z.value);return Object.assign(new e,U)},createNode:(q,$,U)=>e.from(q,$,U)};$H.YAMLOMap=e;$H.omap=qH});var lU=O((zH)=>{var vU=N();function mU({value:q,source:$},U){if($&&(q?pU:dU).test.test($))return $;return q?U.options.trueStr:U.options.falseStr}var pU={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new vU.Scalar(!0),stringify:mU},dU={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new vU.Scalar(!1),stringify:mU};zH.falseTag=dU;zH.trueTag=pU});var cU=O((RH)=>{var GH=N(),$$=R0(),JH={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$$.stringifyNumber},QH={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():$$.stringifyNumber(q)}},TH={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new GH.Scalar(parseFloat(q.replace(/_/g,""))),U=q.indexOf(".");if(U!==-1){let H=q.substring(U+1).replace(/_/g,"");if(H[H.length-1]==="0")$.minFractionDigits=H.length}return $},stringify:$$.stringifyNumber};RH.float=TH;RH.floatExp=QH;RH.floatNaN=JH});var sU=O((IH)=>{var aU=R0(),j0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Dq(q,$,U,{intAsBigInt:H}){let z=q[0];if(z==="-"||z==="+")$+=1;if(q=q.substring($).replace(/_/g,""),H){switch(U){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let Z=BigInt(q);return z==="-"?BigInt(-1)*Z:Z}let X=parseInt(q,U);return z==="-"?-1*X:X}function U$(q,$,U){let{value:H}=q;if(j0(H)){let z=H.toString($);return H<0?"-"+U+z.substr(1):U+z}return aU.stringifyNumber(q)}var LH={identify:j0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,U)=>Dq(q,2,2,U),stringify:(q)=>U$(q,2,"0b")},OH={identify:j0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,U)=>Dq(q,1,8,U),stringify:(q)=>U$(q,8,"0")},VH={identify:j0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,U)=>Dq(q,0,10,U),stringify:aU.stringifyNumber},WH={identify:j0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,U)=>Dq(q,2,16,U),stringify:(q)=>U$(q,16,"0x")};IH.int=VH;IH.intBin=LH;IH.intHex=WH;IH.intOct=OH});var H$=O((AH)=>{var Oq=A(),Yq=l(),Lq=a();class q0 extends Lq.YAMLMap{constructor(q){super(q);this.tag=q0.tag}add(q){let $;if(Oq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new Yq.Pair(q.key,null);else $=new Yq.Pair(q,null);if(!Lq.findPair(this.items,$.key))this.items.push($)}get(q,$){let U=Lq.findPair(this.items,q);return!$&&Oq.isPair(U)?Oq.isScalar(U.key)?U.key.value:U.key:U}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let U=Lq.findPair(this.items,q);if(U&&!$)this.items.splice(this.items.indexOf(U),1);else if(!U&&$)this.items.push(new Yq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,U){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,U);else throw Error("Set items must all have null values")}static from(q,$,U){let{replacer:H}=U,z=new this(q);if($&&Symbol.iterator in Object($))for(let X of $){if(typeof H==="function")X=H.call($,X,X);z.items.push(Yq.createPair(X,null,U))}return z}}q0.tag="tag:yaml.org,2002:set";var MH={collection:"map",identify:(q)=>q instanceof Set,nodeClass:q0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,U)=>q0.from(q,$,U),resolve(q,$){if(Oq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new q0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};AH.YAMLSet=q0;AH.set=MH});var X$=O((CH)=>{var bH=R0();function z$(q,$){let U=q[0],H=U==="-"||U==="+"?q.substring(1):q,z=(Z)=>$?BigInt(Z):Number(Z),X=H.replace(/_/g,"").split(":").reduce((Z,G)=>Z*z(60)+z(G),z(0));return U==="-"?z(-1)*X:X}function iU(q){let{value:$}=q,U=(Z)=>Z;if(typeof $==="bigint")U=(Z)=>BigInt(Z);else if(isNaN($)||!isFinite($))return bH.stringifyNumber(q);let H="";if($<0)H="-",$*=U(-1);let z=U(60),X=[$%z];if($<60)X.unshift(0);else if($=($-X[0])/z,X.unshift($%z),$>=60)$=($-X[0])/z,X.unshift($);return H+X.map((Z)=>String(Z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var SH={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:U})=>z$(q,U),stringify:iU},jH={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>z$(q,!1),stringify:iU},rU={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let $=q.match(rU.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,U,H,z,X,Z,G]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,Q=Date.UTC(U,H-1,z,X||0,Z||0,G||0,J),D=$[8];if(D&&D!=="Z"){let T=z$(D,!1);if(Math.abs(T)<30)T*=60;Q-=60000*T}return new Date(Q)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};CH.floatTime=jH;CH.intTime=SH;CH.timestamp=rU});var oU=O((cH)=>{var yH=Q0(),hH=Jq(),uH=T0(),xH=N0(),kH=oq(),nU=lU(),Z$=cU(),Vq=sU(),vH=qq(),mH=q$(),pH=Bq(),dH=H$(),G$=X$(),lH=[yH.map,uH.seq,xH.string,hH.nullTag,nU.trueTag,nU.falseTag,Vq.intBin,Vq.intOct,Vq.int,Vq.intHex,Z$.floatNaN,Z$.floatExp,Z$.float,kH.binary,vH.merge,mH.omap,pH.pairs,dH.set,G$.intTime,G$.floatTime,G$.timestamp];cH.schema=lH});var G2=O((q8)=>{var $2=Q0(),sH=Jq(),U2=T0(),iH=N0(),rH=dq(),J$=cq(),Q$=sq(),nH=fU(),oH=yU(),H2=oq(),C0=qq(),z2=q$(),X2=Bq(),tU=oU(),Z2=H$(),Wq=X$(),eU=new Map([["core",nH.schema],["failsafe",[$2.map,U2.seq,iH.string]],["json",oH.schema],["yaml11",tU.schema],["yaml-1.1",tU.schema]]),q2={binary:H2.binary,bool:rH.boolTag,float:J$.float,floatExp:J$.floatExp,floatNaN:J$.floatNaN,floatTime:Wq.floatTime,int:Q$.int,intHex:Q$.intHex,intOct:Q$.intOct,intTime:Wq.intTime,map:$2.map,merge:C0.merge,null:sH.nullTag,omap:z2.omap,pairs:X2.pairs,seq:U2.seq,set:Z2.set,timestamp:Wq.timestamp},tH={"tag:yaml.org,2002:binary":H2.binary,"tag:yaml.org,2002:merge":C0.merge,"tag:yaml.org,2002:omap":z2.omap,"tag:yaml.org,2002:pairs":X2.pairs,"tag:yaml.org,2002:set":Z2.set,"tag:yaml.org,2002:timestamp":Wq.timestamp};function eH(q,$,U){let H=eU.get($);if(H&&!q)return U&&!H.includes(C0.merge)?H.concat(C0.merge):H.slice();let z=H;if(!z)if(Array.isArray(q))z=[];else{let X=Array.from(eU.keys()).filter((Z)=>Z!=="yaml11").map((Z)=>JSON.stringify(Z)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${X} or define customTags array`)}if(Array.isArray(q))for(let X of q)z=z.concat(X);else if(typeof q==="function")z=q(z.slice());if(U)z=z.concat(C0.merge);return z.reduce((X,Z)=>{let G=typeof Z==="string"?q2[Z]:Z;if(!G){let J=JSON.stringify(Z),Q=Object.keys(q2).map((D)=>JSON.stringify(D)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${Q}`)}if(!X.includes(G))X.push(G);return X},[])}q8.coreKnownTags=tH;q8.getTags=eH});var B$=O((G8)=>{var T$=A(),H8=Q0(),z8=T0(),X8=N0(),Iq=G2(),Z8=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class R${constructor({compat:q,customTags:$,merge:U,resolveKnownTags:H,schema:z,sortMapEntries:X,toStringDefaults:Z}){this.compat=Array.isArray(q)?Iq.getTags(q,"compat"):q?Iq.getTags(null,q):null,this.name=typeof z==="string"&&z||"core",this.knownTags=H?Iq.coreKnownTags:{},this.tags=Iq.getTags($,this.name,U),this.toStringOptions=Z??null,Object.defineProperty(this,T$.MAP,{value:H8.map}),Object.defineProperty(this,T$.SCALAR,{value:X8.string}),Object.defineProperty(this,T$.SEQ,{value:z8.seq}),this.sortMapEntries=typeof X==="function"?X:X===!0?Z8:null}clone(){let q=Object.create(R$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}G8.Schema=R$});var J2=O((R8)=>{var Q8=A(),D$=M0(),E0=F0();function T8(q,$){let U=[],H=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)U.push(J),H=!0;else if(q.directives.docStart)H=!0}if(H)U.push("---");let z=D$.createStringifyContext(q,$),{commentString:X}=z.options;if(q.commentBefore){if(U.length!==1)U.unshift("");let J=X(q.commentBefore);U.unshift(E0.indentComment(J,""))}let Z=!1,G=null;if(q.contents){if(Q8.isNode(q.contents)){if(q.contents.spaceBefore&&H)U.push("");if(q.contents.commentBefore){let D=X(q.contents.commentBefore);U.push(E0.indentComment(D,""))}z.forceBlockIndent=!!q.comment,G=q.contents.comment}let J=G?void 0:()=>Z=!0,Q=D$.stringify(q.contents,z,()=>G=null,J);if(G)Q+=E0.lineComment(Q,"",X(G));if((Q[0]==="|"||Q[0]===">")&&U[U.length-1]==="---")U[U.length-1]=`--- ${Q}`;else U.push(Q)}else U.push(D$.stringify(q.contents,z));if(q.directives?.docEnd)if(q.comment){let J=X(q.comment);if(J.includes(`
|
|
56
|
+
`))U.push("..."),U.push(E0.indentComment(J,""));else U.push(`... ${J}`)}else U.push("...");else{let J=q.comment;if(J&&Z)J=J.replace(/^\n+/,"");if(J){if((!Z||G)&&U[U.length-1]!=="")U.push("");U.push(E0.indentComment(X(J),""))}}return U.join(`
|
|
57
|
+
`)+`
|
|
58
|
+
`}R8.stringifyDocument=T8});var f0=O((_8)=>{var D8=I0(),B0=s0(),f=A(),Y8=l(),L8=m(),O8=B$(),V8=J2(),Y$=l0(),W8=fq(),I8=_0(),L$=Eq();class O${constructor(q,$,U){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,f.NODE_TYPE,{value:f.DOC});let H=null;if(typeof $==="function"||Array.isArray($))H=$;else if(U===void 0&&$)U=$,$=void 0;let z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},U);this.options=z;let{version:X}=z;if(U?._directives){if(this.directives=U._directives.atDocument(),this.directives.yaml.explicit)X=this.directives.yaml.version}else this.directives=new L$.Directives({version:X});this.setSchema(X,U),this.contents=q===void 0?null:this.createNode(q,H,U)}clone(){let q=Object.create(O$.prototype,{[f.NODE_TYPE]:{value:f.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=f.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(D0(this.contents))this.contents.add(q)}addIn(q,$){if(D0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let U=Y$.anchorNames(this);q.anchor=!$||U.has($)?Y$.findNewAnchor($||"a",U):$}return new D8.Alias(q.anchor)}createNode(q,$,U){let H=void 0;if(typeof $==="function")q=$.call({"":q},"",q),H=$;else if(Array.isArray($)){let B=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,Y=$.filter(B).map(String);if(Y.length>0)$=$.concat(Y);H=$}else if(U===void 0&&$)U=$,$=void 0;let{aliasDuplicateObjects:z,anchorPrefix:X,flow:Z,keepUndefined:G,onTagObj:J,tag:Q}=U??{},{onAnchor:D,setAnchors:T,sourceObjects:R}=Y$.createNodeAnchors(this,X||"a"),L={aliasDuplicateObjects:z??!0,keepUndefined:G??!1,onAnchor:D,onTagObj:J,replacer:H,schema:this.schema,sourceObjects:R},V=I8.createNode(q,Q,L);if(Z&&f.isCollection(V))V.flow=!0;return T(),V}createPair(q,$,U={}){let H=this.createNode(q,null,U),z=this.createNode($,null,U);return new Y8.Pair(H,z)}delete(q){return D0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(B0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return D0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return f.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(B0.isEmptyPath(q))return!$&&f.isScalar(this.contents)?this.contents.value:this.contents;return f.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return f.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(B0.isEmptyPath(q))return this.contents!==void 0;return f.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=B0.collectionFromPath(this.schema,[q],$);else if(D0(this.contents))this.contents.set(q,$)}setIn(q,$){if(B0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=B0.collectionFromPath(this.schema,Array.from(q),$);else if(D0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let U;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new L$.Directives({version:"1.1"});U={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new L$.Directives({version:q});U={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;U=null;break;default:{let H=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${H}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(U)this.schema=new O8.Schema(Object.assign(U,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:U,maxAliasCount:H,onAnchor:z,reviver:X}={}){let Z={anchors:new Map,doc:this,keep:!q,mapAsMap:U===!0,mapKeyWarned:!1,maxAliasCount:typeof H==="number"?H:100},G=L8.toJS(this.contents,$??"",Z);if(typeof z==="function")for(let{count:J,res:Q}of Z.anchors.values())z(Q,J);return typeof X==="function"?W8.applyReviver(X,{"":G},"",G):G}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return V8.stringifyDocument(this,q)}}function D0(q){if(f.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}_8.Document=O$});var g0=O((w8)=>{class _q extends Error{constructor(q,$,U,H){super();this.name=q,this.code=U,this.message=H,this.pos=$}}class Q2 extends _q{constructor(q,$,U){super("YAMLParseError",q,$,U)}}class T2 extends _q{constructor(q,$,U){super("YAMLWarning",q,$,U)}}var P8=(q,$)=>(U)=>{if(U.pos[0]===-1)return;U.linePos=U.pos.map((G)=>$.linePos(G));let{line:H,col:z}=U.linePos[0];U.message+=` at line ${H}, column ${z}`;let X=z-1,Z=q.substring($.lineStarts[H-1],$.lineStarts[H]).replace(/[\n\r]+$/,"");if(X>=60&&Z.length>80){let G=Math.min(X-39,Z.length-79);Z="\u2026"+Z.substring(G),X-=G-1}if(Z.length>80)Z=Z.substring(0,79)+"\u2026";if(H>1&&/^ *$/.test(Z.substring(0,X))){let G=q.substring($.lineStarts[H-2],$.lineStarts[H-1]);if(G.length>80)G=G.substring(0,79)+`\u2026
|
|
59
|
+
`;Z=G+Z}if(/[^ ]/.test(Z)){let G=1,J=U.linePos[1];if(J?.line===H&&J.col>z)G=Math.max(1,Math.min(J.col-z,80-X));let Q=" ".repeat(X)+"^".repeat(G);U.message+=`:
|
|
60
|
+
|
|
61
|
+
${Z}
|
|
62
|
+
${Q}
|
|
63
|
+
`}};w8.YAMLError=_q;w8.YAMLParseError=Q2;w8.YAMLWarning=T2;w8.prettifyError=P8});var y0=O((S8)=>{function b8(q,{flow:$,indicator:U,next:H,offset:z,onError:X,parentIndent:Z,startOnNewline:G}){let J=!1,Q=G,D=G,T="",R="",L=!1,V=!1,B=null,Y=null,I=null,_=null,F=null,P=null,w=null;for(let W of q){if(V){if(W.type!=="space"&&W.type!=="newline"&&W.type!=="comma")X(W.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(B){if(Q&&W.type!=="comment"&&W.type!=="newline")X(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(W.type){case"space":if(!$&&(U!=="doc-start"||H?.type!=="flow-collection")&&W.source.includes("\t"))B=W;D=!0;break;case"comment":{if(!D)X(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let b=W.source.substring(1)||" ";if(!T)T=b;else T+=R+b;R="",Q=!1;break}case"newline":if(Q){if(T)T+=W.source;else if(!P||U!=="seq-item-ind")J=!0}else R+=W.source;if(Q=!0,L=!0,Y||I)_=W;D=!0;break;case"anchor":if(Y)X(W,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(W.source.endsWith(":"))X(W.offset+W.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);Y=W,w??(w=W.offset),Q=!1,D=!1,V=!0;break;case"tag":{if(I)X(W,"MULTIPLE_TAGS","A node can have at most one tag");I=W,w??(w=W.offset),Q=!1,D=!1,V=!0;break}case U:if(Y||I)X(W,"BAD_PROP_ORDER",`Anchors and tags must be after the ${W.source} indicator`);if(P)X(W,"UNEXPECTED_TOKEN",`Unexpected ${W.source} in ${$??"collection"}`);P=W,Q=U==="seq-item-ind"||U==="explicit-key-ind",D=!1;break;case"comma":if($){if(F)X(W,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);F=W,Q=!1,D=!1;break}default:X(W,"UNEXPECTED_TOKEN",`Unexpected ${W.type} token`),Q=!1,D=!1}}let M=q[q.length-1],K=M?M.offset+M.source.length:z;if(V&&H&&H.type!=="space"&&H.type!=="newline"&&H.type!=="comma"&&(H.type!=="scalar"||H.source!==""))X(H.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(Q&&B.indent<=Z||H?.type==="block-map"||H?.type==="block-seq"))X(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:F,found:P,spaceBefore:J,comment:T,hasNewline:L,anchor:Y,tag:I,newlineAfterProp:_,end:K,start:w??K}}S8.resolveProps=b8});var Fq=O((C8)=>{function V$(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
64
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let U of $.start)if(U.type==="newline")return!0;if($.sep){for(let U of $.sep)if(U.type==="newline")return!0}if(V$($.key)||V$($.value))return!0}return!1;default:return!0}}C8.containsNewline=V$});var W$=O((y8)=>{var f8=Fq();function g8(q,$,U){if($?.type==="flow-collection"){let H=$.end[0];if(H.indent===q&&(H.source==="]"||H.source==="}")&&f8.containsNewline($))U(H,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}y8.flowIndentCheck=g8});var I$=O((x8)=>{var R2=A();function u8(q,$,U){let{uniqueKeys:H}=q.options;if(H===!1)return!1;let z=typeof H==="function"?H:(X,Z)=>X===Z||R2.isScalar(X)&&R2.isScalar(Z)&&X.value===Z.value;return $.some((X)=>z(X.key,U))}x8.mapIncludes=u8});var O2=O((l8)=>{var B2=l(),v8=a(),D2=y0(),m8=Fq(),Y2=W$(),p8=I$(),L2="All mapping items must start at the same column";function d8({composeNode:q,composeEmptyNode:$},U,H,z,X){let G=new(X?.nodeClass??v8.YAMLMap)(U.schema);if(U.atRoot)U.atRoot=!1;let J=H.offset,Q=null;for(let D of H.items){let{start:T,key:R,sep:L,value:V}=D,B=D2.resolveProps(T,{indicator:"explicit-key-ind",next:R??L?.[0],offset:J,onError:z,parentIndent:H.indent,startOnNewline:!0}),Y=!B.found;if(Y){if(R){if(R.type==="block-seq")z(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in R&&R.indent!==H.indent)z(J,"BAD_INDENT",L2)}if(!B.anchor&&!B.tag&&!L){if(Q=B.end,B.comment)if(G.comment)G.comment+=`
|
|
65
|
+
`+B.comment;else G.comment=B.comment;continue}if(B.newlineAfterProp||m8.containsNewline(R))z(R??T[T.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==H.indent)z(J,"BAD_INDENT",L2);U.atKey=!0;let I=B.end,_=R?q(U,R,B,z):$(U,I,T,null,B,z);if(U.schema.compat)Y2.flowIndentCheck(H.indent,R,z);if(U.atKey=!1,p8.mapIncludes(U,G.items,_))z(I,"DUPLICATE_KEY","Map keys must be unique");let F=D2.resolveProps(L??[],{indicator:"map-value-ind",next:V,offset:_.range[2],onError:z,parentIndent:H.indent,startOnNewline:!R||R.type==="block-scalar"});if(J=F.end,F.found){if(Y){if(V?.type==="block-map"&&!F.hasNewline)z(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(U.options.strict&&B.start<F.found.offset-1024)z(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let P=V?q(U,V,F,z):$(U,J,L,null,F,z);if(U.schema.compat)Y2.flowIndentCheck(H.indent,V,z);J=P.range[2];let w=new B2.Pair(_,P);if(U.options.keepSourceTokens)w.srcToken=D;G.items.push(w)}else{if(Y)z(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(F.comment)if(_.comment)_.comment+=`
|
|
66
|
+
`+F.comment;else _.comment=F.comment;let P=new B2.Pair(_);if(U.options.keepSourceTokens)P.srcToken=D;G.items.push(P)}}if(Q&&Q<J)z(Q,"IMPOSSIBLE","Map comment with trailing content");return G.range=[H.offset,J,Q??J],G}l8.resolveBlockMap=d8});var V2=O((n8)=>{var a8=s(),s8=y0(),i8=W$();function r8({composeNode:q,composeEmptyNode:$},U,H,z,X){let G=new(X?.nodeClass??a8.YAMLSeq)(U.schema);if(U.atRoot)U.atRoot=!1;if(U.atKey)U.atKey=!1;let J=H.offset,Q=null;for(let{start:D,value:T}of H.items){let R=s8.resolveProps(D,{indicator:"seq-item-ind",next:T,offset:J,onError:z,parentIndent:H.indent,startOnNewline:!0});if(!R.found)if(R.anchor||R.tag||T)if(T?.type==="block-seq")z(R.end,"BAD_INDENT","All sequence items must start at the same column");else z(J,"MISSING_CHAR","Sequence item without - indicator");else{if(Q=R.end,R.comment)G.comment=R.comment;continue}let L=T?q(U,T,R,z):$(U,R.end,D,null,R,z);if(U.schema.compat)i8.flowIndentCheck(H.indent,T,z);J=L.range[2],G.items.push(L)}return G.range=[H.offset,J,Q??J],G}n8.resolveBlockSeq=r8});var Y0=O((e8)=>{function t8(q,$,U,H){let z="";if(q){let X=!1,Z="";for(let G of q){let{source:J,type:Q}=G;switch(Q){case"space":X=!0;break;case"comment":{if(U&&!X)H(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=J.substring(1)||" ";if(!z)z=D;else z+=Z+D;Z="";break}case"newline":if(z)Z+=J;X=!0;break;default:H(G,"UNEXPECTED_TOKEN",`Unexpected ${Q} at node end`)}$+=J.length}}return{comment:z,offset:$}}e8.resolveEnd=t8});var _2=O((Jz)=>{var $z=A(),Uz=l(),W2=a(),Hz=s(),zz=Y0(),I2=y0(),Xz=Fq(),Zz=I$(),_$="Block collections are not allowed within flow collections",F$=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function Gz({composeNode:q,composeEmptyNode:$},U,H,z,X){let Z=H.start.source==="{",G=Z?"flow map":"flow sequence",Q=new(X?.nodeClass??(Z?W2.YAMLMap:Hz.YAMLSeq))(U.schema);Q.flow=!0;let D=U.atRoot;if(D)U.atRoot=!1;if(U.atKey)U.atKey=!1;let T=H.offset+H.start.source.length;for(let Y=0;Y<H.items.length;++Y){let I=H.items[Y],{start:_,key:F,sep:P,value:w}=I,M=I2.resolveProps(_,{flow:G,indicator:"explicit-key-ind",next:F??P?.[0],offset:T,onError:z,parentIndent:H.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!P&&!w){if(Y===0&&M.comma)z(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(Y<H.items.length-1)z(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(M.comment)if(Q.comment)Q.comment+=`
|
|
67
|
+
`+M.comment;else Q.comment=M.comment;T=M.end;continue}if(!Z&&U.options.strict&&Xz.containsNewline(F))z(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(Y===0){if(M.comma)z(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!M.comma)z(M.start,"MISSING_CHAR",`Missing , between ${G} items`);if(M.comment){let K="";q:for(let W of _)switch(W.type){case"comma":case"space":break;case"comment":K=W.source.substring(1);break q;default:break q}if(K){let W=Q.items[Q.items.length-1];if($z.isPair(W))W=W.value??W.key;if(W.comment)W.comment+=`
|
|
68
|
+
`+K;else W.comment=K;M.comment=M.comment.substring(K.length+1)}}}if(!Z&&!P&&!M.found){let K=w?q(U,w,M,z):$(U,M.end,P,null,M,z);if(Q.items.push(K),T=K.range[2],F$(w))z(K.range,"BLOCK_IN_FLOW",_$)}else{U.atKey=!0;let K=M.end,W=F?q(U,F,M,z):$(U,K,_,null,M,z);if(F$(F))z(W.range,"BLOCK_IN_FLOW",_$);U.atKey=!1;let b=I2.resolveProps(P??[],{flow:G,indicator:"map-value-ind",next:w,offset:W.range[2],onError:z,parentIndent:H.indent,startOnNewline:!1});if(b.found){if(!Z&&!M.found&&U.options.strict){if(P)for(let S of P){if(S===b.found)break;if(S.type==="newline"){z(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(M.start<b.found.offset-1024)z(b.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(w)if("source"in w&&w.source?.[0]===":")z(w,"MISSING_CHAR",`Missing space after : in ${G}`);else z(b.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let v=w?q(U,w,b,z):b.found?$(U,b.end,P,null,b,z):null;if(v){if(F$(w))z(v.range,"BLOCK_IN_FLOW",_$)}else if(b.comment)if(W.comment)W.comment+=`
|
|
69
|
+
`+b.comment;else W.comment=b.comment;let z0=new Uz.Pair(W,v);if(U.options.keepSourceTokens)z0.srcToken=I;if(Z){let S=Q;if(Zz.mapIncludes(U,S.items,W))z(K,"DUPLICATE_KEY","Map keys must be unique");S.items.push(z0)}else{let S=new W2.YAMLMap(U.schema);S.flow=!0,S.items.push(z0);let c$=(v??W).range;S.range=[W.range[0],c$[1],c$[2]],Q.items.push(S)}T=v?v.range[2]:b.end}}let R=Z?"}":"]",[L,...V]=H.end,B=T;if(L?.source===R)B=L.offset+L.source.length;else{let Y=G[0].toUpperCase()+G.substring(1),I=D?`${Y} must end with a ${R}`:`${Y} in block collection must be sufficiently indented and end with a ${R}`;if(z(T,D?"MISSING_CHAR":"BAD_INDENT",I),L&&L.source.length!==1)V.unshift(L)}if(V.length>0){let Y=zz.resolveEnd(V,B,U.options.strict,z);if(Y.comment)if(Q.comment)Q.comment+=`
|
|
70
|
+
`+Y.comment;else Q.comment=Y.comment;Q.range=[H.offset,B,Y.offset]}else Q.range=[H.offset,B,B];return Q}Jz.resolveFlowCollection=Gz});var F2=O((Wz)=>{var Tz=A(),Rz=N(),Bz=a(),Dz=s(),Yz=O2(),Lz=V2(),Oz=_2();function P$(q,$,U,H,z,X){let Z=U.type==="block-map"?Yz.resolveBlockMap(q,$,U,H,X):U.type==="block-seq"?Lz.resolveBlockSeq(q,$,U,H,X):Oz.resolveFlowCollection(q,$,U,H,X),G=Z.constructor;if(z==="!"||z===G.tagName)return Z.tag=G.tagName,Z;if(z)Z.tag=z;return Z}function Vz(q,$,U,H,z){let X=H.tag,Z=!X?null:$.directives.tagName(X.source,(R)=>z(X,"TAG_RESOLVE_FAILED",R));if(U.type==="block-seq"){let{anchor:R,newlineAfterProp:L}=H,V=R&&X?R.offset>X.offset?R:X:R??X;if(V&&(!L||L.offset<V.offset))z(V,"MISSING_CHAR","Missing newline after block sequence props")}let G=U.type==="block-map"?"map":U.type==="block-seq"?"seq":U.start.source==="{"?"map":"seq";if(!X||!Z||Z==="!"||Z===Bz.YAMLMap.tagName&&G==="map"||Z===Dz.YAMLSeq.tagName&&G==="seq")return P$(q,$,U,z,Z);let J=$.schema.tags.find((R)=>R.tag===Z&&R.collection===G);if(!J){let R=$.schema.knownTags[Z];if(R?.collection===G)$.schema.tags.push(Object.assign({},R,{default:!1})),J=R;else{if(R)z(X,"BAD_COLLECTION_TYPE",`${R.tag} used for ${G} collection, but expects ${R.collection??"scalar"}`,!0);else z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,!0);return P$(q,$,U,z,Z)}}let Q=P$(q,$,U,z,Z,J),D=J.resolve?.(Q,(R)=>z(X,"TAG_RESOLVE_FAILED",R),$.options)??Q,T=Tz.isNode(D)?D:new Rz.Scalar(D);if(T.range=Q.range,T.tag=Z,J?.format)T.format=J.format;return T}Wz.composeCollection=Vz});var M$=O((wz)=>{var w$=N();function _z(q,$,U){let H=$.offset,z=Fz($,q.options.strict,U);if(!z)return{value:"",type:null,comment:"",range:[H,H,H]};let X=z.mode===">"?w$.Scalar.BLOCK_FOLDED:w$.Scalar.BLOCK_LITERAL,Z=$.source?Pz($.source):[],G=Z.length;for(let B=Z.length-1;B>=0;--B){let Y=Z[B][1];if(Y===""||Y==="\r")G=B;else break}if(G===0){let B=z.chomp==="+"&&Z.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,Z.length-1)):"",Y=H+z.length;if($.source)Y+=$.source.length;return{value:B,type:X,comment:z.comment,range:[H,Y,Y]}}let J=$.indent+z.indent,Q=$.offset+z.length,D=0;for(let B=0;B<G;++B){let[Y,I]=Z[B];if(I===""||I==="\r"){if(z.indent===0&&Y.length>J)J=Y.length}else{if(Y.length<J)U(Q+Y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(z.indent===0)J=Y.length;if(D=B,J===0&&!q.atRoot)U(Q,"BAD_INDENT","Block scalar values in collections must be indented");break}Q+=Y.length+I.length+1}for(let B=Z.length-1;B>=G;--B)if(Z[B][0].length>J)G=B+1;let T="",R="",L=!1;for(let B=0;B<D;++B)T+=Z[B][0].slice(J)+`
|
|
72
|
+
`;for(let B=D;B<G;++B){let[Y,I]=Z[B];Q+=Y.length+I.length+1;let _=I[I.length-1]==="\r";if(_)I=I.slice(0,-1);if(I&&Y.length<J){let P=`Block scalar lines must not be less indented than their ${z.indent?"explicit indentation indicator":"first line"}`;U(Q-I.length-(_?2:1),"BAD_INDENT",P),Y=""}if(X===w$.Scalar.BLOCK_LITERAL)T+=R+Y.slice(J)+I,R=`
|
|
73
|
+
`;else if(Y.length>J||I[0]==="\t"){if(R===" ")R=`
|
|
74
|
+
`;else if(!L&&R===`
|
|
75
|
+
`)R=`
|
|
76
|
+
|
|
77
|
+
`;T+=R+Y.slice(J)+I,R=`
|
|
78
|
+
`,L=!0}else if(I==="")if(R===`
|
|
79
|
+
`)T+=`
|
|
80
|
+
`;else R=`
|
|
81
|
+
`;else T+=R+I,R=" ",L=!1}switch(z.chomp){case"-":break;case"+":for(let B=G;B<Z.length;++B)T+=`
|
|
82
|
+
`+Z[B][0].slice(J);if(T[T.length-1]!==`
|
|
83
|
+
`)T+=`
|
|
84
|
+
`;break;default:T+=`
|
|
85
|
+
`}let V=H+z.length+$.source.length;return{value:T,type:X,comment:z.comment,range:[H,V,V]}}function Fz({offset:q,props:$},U,H){if($[0].type!=="block-scalar-header")return H($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:z}=$[0],X=z[0],Z=0,G="",J=-1;for(let R=1;R<z.length;++R){let L=z[R];if(!G&&(L==="-"||L==="+"))G=L;else{let V=Number(L);if(!Z&&V)Z=V;else if(J===-1)J=q+R}}if(J!==-1)H(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${z}`);let Q=!1,D="",T=z.length;for(let R=1;R<$.length;++R){let L=$[R];switch(L.type){case"space":Q=!0;case"newline":T+=L.source.length;break;case"comment":if(U&&!Q)H(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");T+=L.source.length,D=L.source.substring(1);break;case"error":H(L,"UNEXPECTED_TOKEN",L.message),T+=L.source.length;break;default:{let V=`Unexpected token in block scalar header: ${L.type}`;H(L,"UNEXPECTED_TOKEN",V);let B=L.source;if(B&&typeof B==="string")T+=B.length}}}return{mode:X,indent:Z,chomp:G,comment:D,length:T}}function Pz(q){let $=q.split(/\n( *)/),U=$[0],H=U.match(/^( *)/),X=[H?.[1]?[H[1],U.slice(H[1].length)]:["",U]];for(let Z=1;Z<$.length;Z+=2)X.push([$[Z],$[Z+1]]);return X}wz.resolveBlockScalar=_z});var K$=O((fz)=>{var A$=N(),Az=Y0();function Kz(q,$,U){let{offset:H,type:z,source:X,end:Z}=q,G,J,Q=(R,L,V)=>U(H+R,L,V);switch(z){case"scalar":G=A$.Scalar.PLAIN,J=Nz(X,Q);break;case"single-quoted-scalar":G=A$.Scalar.QUOTE_SINGLE,J=bz(X,Q);break;case"double-quoted-scalar":G=A$.Scalar.QUOTE_DOUBLE,J=Sz(X,Q);break;default:return U(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${z}`),{value:"",type:null,comment:"",range:[H,H+X.length,H+X.length]}}let D=H+X.length,T=Az.resolveEnd(Z,D,$,U);return{value:J,type:G,comment:T.comment,range:[H,D,T.offset]}}function Nz(q,$){let U="";switch(q[0]){case"\t":U="a tab character";break;case",":U="flow indicator character ,";break;case"%":U="directive indicator character %";break;case"|":case">":{U=`block scalar indicator ${q[0]}`;break}case"@":case"`":{U=`reserved character ${q[0]}`;break}}if(U)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${U}`);return P2(q)}function bz(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return P2(q.slice(1,-1)).replace(/''/g,"'")}function P2(q){let $,U;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
|
+
`,"sy"),U=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,U=/[ \t]*(.*?)[ \t]*\r?\n/sy}let H=$.exec(q);if(!H)return q;let z=H[1],X=" ",Z=$.lastIndex;U.lastIndex=Z;while(H=U.exec(q)){if(H[1]==="")if(X===`
|
|
88
|
+
`)z+=X;else X=`
|
|
89
|
+
`;else z+=X+H[1],X=" ";Z=U.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=Z,H=G.exec(q),z+X+(H?.[1]??"")}function Sz(q,$){let U="";for(let H=1;H<q.length-1;++H){let z=q[H];if(z==="\r"&&q[H+1]===`
|
|
90
|
+
`)continue;if(z===`
|
|
91
|
+
`){let{fold:X,offset:Z}=jz(q,H);U+=X,H=Z}else if(z==="\\"){let X=q[++H],Z=Cz[X];if(Z)U+=Z;else if(X===`
|
|
92
|
+
`){X=q[H+1];while(X===" "||X==="\t")X=q[++H+1]}else if(X==="\r"&&q[H+1]===`
|
|
93
|
+
`){X=q[++H+1];while(X===" "||X==="\t")X=q[++H+1]}else if(X==="x"||X==="u"||X==="U"){let G=X==="x"?2:X==="u"?4:8;U+=Ez(q,H+1,G,$),H+=G}else{let G=q.substr(H-1,2);$(H-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),U+=G}}else if(z===" "||z==="\t"){let X=H,Z=q[H+1];while(Z===" "||Z==="\t")Z=q[++H+1];if(Z!==`
|
|
94
|
+
`&&!(Z==="\r"&&q[H+2]===`
|
|
95
|
+
`))U+=H>X?q.slice(X,H+1):z}else U+=z}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return U}function jz(q,$){let U="",H=q[$+1];while(H===" "||H==="\t"||H===`
|
|
96
|
+
`||H==="\r"){if(H==="\r"&&q[$+2]!==`
|
|
97
|
+
`)break;if(H===`
|
|
98
|
+
`)U+=`
|
|
99
|
+
`;$+=1,H=q[$+1]}if(!U)U=" ";return{fold:U,offset:$}}var Cz={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Ez(q,$,U,H){let z=q.substr($,U),Z=z.length===U&&/^[0-9a-fA-F]+$/.test(z)?parseInt(z,16):NaN;try{return String.fromCodePoint(Z)}catch{let G=q.substr($-2,U+2);return H($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}}fz.resolveFlowScalar=Kz});var M2=O((vz)=>{var $0=A(),w2=N(),yz=M$(),hz=K$();function uz(q,$,U,H){let{value:z,type:X,comment:Z,range:G}=$.type==="block-scalar"?yz.resolveBlockScalar(q,$,H):hz.resolveFlowScalar($,q.options.strict,H),J=U?q.directives.tagName(U.source,(T)=>H(U,"TAG_RESOLVE_FAILED",T)):null,Q;if(q.options.stringKeys&&q.atKey)Q=q.schema[$0.SCALAR];else if(J)Q=xz(q.schema,z,J,U,H);else if($.type==="scalar")Q=kz(q,z,$,H);else Q=q.schema[$0.SCALAR];let D;try{let T=Q.resolve(z,(R)=>H(U??$,"TAG_RESOLVE_FAILED",R),q.options);D=$0.isScalar(T)?T:new w2.Scalar(T)}catch(T){let R=T instanceof Error?T.message:String(T);H(U??$,"TAG_RESOLVE_FAILED",R),D=new w2.Scalar(z)}if(D.range=G,D.source=z,X)D.type=X;if(J)D.tag=J;if(Q.format)D.format=Q.format;if(Z)D.comment=Z;return D}function xz(q,$,U,H,z){if(U==="!")return q[$0.SCALAR];let X=[];for(let G of q.tags)if(!G.collection&&G.tag===U)if(G.default&&G.test)X.push(G);else return G;for(let G of X)if(G.test?.test($))return G;let Z=q.knownTags[U];if(Z&&!Z.collection)return q.tags.push(Object.assign({},Z,{default:!1,test:void 0})),Z;return z(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,U!=="tag:yaml.org,2002:str"),q[$0.SCALAR]}function kz({atKey:q,directives:$,schema:U},H,z,X){let Z=U.tags.find((G)=>(G.default===!0||q&&G.default==="key")&&G.test?.test(H))||U[$0.SCALAR];if(U.compat){let G=U.compat.find((J)=>J.default&&J.test?.test(H))??U[$0.SCALAR];if(Z.tag!==G.tag){let J=$.tagString(Z.tag),Q=$.tagString(G.tag),D=`Value may be parsed as either ${J} or ${Q}`;X(z,"TAG_RESOLVE_FAILED",D,!0)}}return Z}vz.composeScalar=uz});var A2=O((dz)=>{function pz(q,$,U){if($){U??(U=$.length);for(let H=U-1;H>=0;--H){let z=$[H];switch(z.type){case"space":case"comment":case"newline":q-=z.source.length;continue}z=$[++H];while(z?.type==="space")q+=z.source.length,z=$[++H];break}}return q}dz.emptyScalarPosition=pz});var b2=O((tz)=>{var cz=I0(),az=A(),sz=F2(),K2=M2(),iz=Y0(),rz=A2(),nz={composeNode:N2,composeEmptyNode:N$};function N2(q,$,U,H){let z=q.atKey,{spaceBefore:X,comment:Z,anchor:G,tag:J}=U,Q,D=!0;switch($.type){case"alias":if(Q=oz(q,$,H),G||J)H($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(Q=K2.composeScalar(q,$,J,H),G)Q.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(Q=sz.composeCollection(nz,q,$,U,H),G)Q.anchor=G.source.substring(1)}catch(T){let R=T instanceof Error?T.message:String(T);H($,"RESOURCE_EXHAUSTION",R)}break;default:{let T=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;H($,"UNEXPECTED_TOKEN",T),D=!1}}if(Q??(Q=N$(q,$.offset,void 0,null,U,H)),G&&Q.anchor==="")H(G,"BAD_ALIAS","Anchor cannot be an empty string");if(z&&q.options.stringKeys&&(!az.isScalar(Q)||typeof Q.value!=="string"||Q.tag&&Q.tag!=="tag:yaml.org,2002:str"))H(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(X)Q.spaceBefore=!0;if(Z)if($.type==="scalar"&&$.source==="")Q.comment=Z;else Q.commentBefore=Z;if(q.options.keepSourceTokens&&D)Q.srcToken=$;return Q}function N$(q,$,U,H,{spaceBefore:z,comment:X,anchor:Z,tag:G,end:J},Q){let D={type:"scalar",offset:rz.emptyScalarPosition($,U,H),indent:-1,source:""},T=K2.composeScalar(q,D,G,Q);if(Z){if(T.anchor=Z.source.substring(1),T.anchor==="")Q(Z,"BAD_ALIAS","Anchor cannot be an empty string")}if(z)T.spaceBefore=!0;if(X)T.comment=X,T.range[2]=J;return T}function oz({options:q},{offset:$,source:U,end:H},z){let X=new cz.Alias(U.substring(1));if(X.source==="")z($,"BAD_ALIAS","Alias cannot be an empty string");if(X.source.endsWith(":"))z($+U.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Z=$+U.length,G=iz.resolveEnd(H,Z,q.strict,z);if(X.range=[$,Z,G.offset],G.comment)X.comment=G.comment;return X}tz.composeEmptyNode=N$;tz.composeNode=N2});var j2=O((XX)=>{var $X=f0(),S2=b2(),UX=Y0(),HX=y0();function zX(q,$,{offset:U,start:H,value:z,end:X},Z){let G=Object.assign({_directives:$},q),J=new $X.Document(void 0,G),Q={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},D=HX.resolveProps(H,{indicator:"doc-start",next:z??X?.[0],offset:U,onError:Z,parentIndent:0,startOnNewline:!0});if(D.found){if(J.directives.docStart=!0,z&&(z.type==="block-map"||z.type==="block-seq")&&!D.hasNewline)Z(D.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=z?S2.composeNode(Q,z,D,Z):S2.composeEmptyNode(Q,D.end,H,null,D,Z);let T=J.contents.range[2],R=UX.resolveEnd(X,T,!1,Z);if(R.comment)J.comment=R.comment;return J.range=[U,T,R.offset],J}XX.composeDoc=zX});var b$=O((BX)=>{var GX=O0("process"),JX=Eq(),QX=f0(),h0=g0(),C2=A(),TX=j2(),RX=Y0();function u0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:U}=q;return[$,$+(typeof U==="string"?U.length:1)]}function E2(q){let $="",U=!1,H=!1;for(let z=0;z<q.length;++z){let X=q[z];switch(X[0]){case"#":$+=($===""?"":H?`
|
|
101
|
+
|
|
102
|
+
`:`
|
|
103
|
+
`)+(X.substring(1)||" "),U=!0,H=!1;break;case"%":if(q[z+1]?.[0]!=="#")z+=1;U=!1;break;default:if(!U)H=!0;U=!1}}return{comment:$,afterEmptyLine:H}}class f2{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,U,H,z)=>{let X=u0($);if(z)this.warnings.push(new h0.YAMLWarning(X,U,H));else this.errors.push(new h0.YAMLParseError(X,U,H))},this.directives=new JX.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:U,afterEmptyLine:H}=E2(this.prelude);if(U){let z=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
104
|
+
${U}`:U;else if(H||q.directives.docStart||!z)q.commentBefore=U;else if(C2.isCollection(z)&&!z.flow&&z.items.length>0){let X=z.items[0];if(C2.isPair(X))X=X.key;let Z=X.commentBefore;X.commentBefore=Z?`${U}
|
|
105
|
+
${Z}`:U}else{let X=z.commentBefore;z.commentBefore=X?`${U}
|
|
106
|
+
${X}`:U}}if($){for(let z=0;z<this.errors.length;++z)q.errors.push(this.errors[z]);for(let z=0;z<this.warnings.length;++z)q.warnings.push(this.warnings[z])}else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:E2(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,U=-1){for(let H of q)yield*this.next(H);yield*this.end($,U)}*next(q){if(GX.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,U,H)=>{let z=u0(q);z[0]+=$,this.onError(z,"BAD_DIRECTIVE",U,H)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=TX.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,U=new h0.YAMLParseError(u0(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(U);else this.doc.errors.push(U);break}case"doc-end":{if(!this.doc){this.errors.push(new h0.YAMLParseError(u0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=RX.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let U=this.doc.comment;this.doc.comment=U?`${U}
|
|
107
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new h0.YAMLParseError(u0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let U=Object.assign({_directives:this.directives},this.options),H=new QX.Document(void 0,U);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");H.range=[0,$,$],this.decorate(H,!1),yield H}}}BX.Composer=f2});var h2=O((FX)=>{var YX=M$(),LX=K$(),OX=g0(),g2=w0();function VX(q,$=!0,U){if(q){let H=(z,X,Z)=>{let G=typeof z==="number"?z:Array.isArray(z)?z[0]:z.offset;if(U)U(G,X,Z);else throw new OX.YAMLParseError([G,G+1],X,Z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return LX.resolveFlowScalar(q,$,H);case"block-scalar":return YX.resolveBlockScalar({options:{strict:$}},q,H)}}return null}function WX(q,$){let{implicitKey:U=!1,indent:H,inFlow:z=!1,offset:X=-1,type:Z="PLAIN"}=$,G=g2.stringifyString({type:Z,value:q},{implicitKey:U,indent:H>0?" ".repeat(H):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:H,source:`
|
|
108
|
+
`}];switch(G[0]){case"|":case">":{let Q=G.indexOf(`
|
|
109
|
+
`),D=G.substring(0,Q),T=G.substring(Q+1)+`
|
|
110
|
+
`,R=[{type:"block-scalar-header",offset:X,indent:H,source:D}];if(!y2(R,J))R.push({type:"newline",offset:-1,indent:H,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:X,indent:H,props:R,source:T}}case'"':return{type:"double-quoted-scalar",offset:X,indent:H,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:X,indent:H,source:G,end:J};default:return{type:"scalar",offset:X,indent:H,source:G,end:J}}}function IX(q,$,U={}){let{afterKey:H=!1,implicitKey:z=!1,inFlow:X=!1,type:Z}=U,G="indent"in q?q.indent:null;if(H&&typeof G==="number")G+=2;if(!Z)switch(q.type){case"single-quoted-scalar":Z="QUOTE_SINGLE";break;case"double-quoted-scalar":Z="QUOTE_DOUBLE";break;case"block-scalar":{let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Z=Q.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Z="PLAIN"}let J=g2.stringifyString({type:Z,value:$},{implicitKey:z||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":_X(q,J);break;case'"':S$(q,J,"double-quoted-scalar");break;case"'":S$(q,J,"single-quoted-scalar");break;default:S$(q,J,"scalar")}}function _X(q,$){let U=$.indexOf(`
|
|
112
|
+
`),H=$.substring(0,U),z=$.substring(U+1)+`
|
|
113
|
+
`;if(q.type==="block-scalar"){let X=q.props[0];if(X.type!=="block-scalar-header")throw Error("Invalid block scalar header");X.source=H,q.source=z}else{let{offset:X}=q,Z="indent"in q?q.indent:-1,G=[{type:"block-scalar-header",offset:X,indent:Z,source:H}];if(!y2(G,"end"in q?q.end:void 0))G.push({type:"newline",offset:-1,indent:Z,source:`
|
|
114
|
+
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:Z,props:G,source:z})}}function y2(q,$){if($)for(let U of $)switch(U.type){case"space":case"comment":q.push(U);break;case"newline":return q.push(U),!0}return!1}function S$(q,$,U){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=U,q.source=$;break;case"block-scalar":{let H=q.props.slice(1),z=$.length;if(q.props[0].type==="block-scalar-header")z-=q.props[0].source.length;for(let X of H)X.offset+=z;delete q.props,Object.assign(q,{type:U,source:$,end:H});break}case"block-map":case"block-seq":{let z={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
115
|
+
`};delete q.items,Object.assign(q,{type:U,source:$,end:[z]});break}default:{let H="indent"in q?q.indent:-1,z="end"in q&&Array.isArray(q.end)?q.end.filter((X)=>X.type==="space"||X.type==="comment"||X.type==="newline"):[];for(let X of Object.keys(q))if(X!=="type"&&X!=="offset")delete q[X];Object.assign(q,{type:U,indent:H,source:$,end:z})}}}FX.createScalarToken=WX;FX.resolveAsScalar=VX;FX.setScalarValue=IX});var u2=O((KX)=>{var AX=(q)=>("type"in q)?wq(q):Pq(q);function wq(q){switch(q.type){case"block-scalar":{let $="";for(let U of q.props)$+=wq(U);return $+q.source}case"block-map":case"block-seq":{let $="";for(let U of q.items)$+=Pq(U);return $}case"flow-collection":{let $=q.start.source;for(let U of q.items)$+=Pq(U);for(let U of q.end)$+=U.source;return $}case"document":{let $=Pq(q);if(q.end)for(let U of q.end)$+=U.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let U of q.end)$+=U.source;return $}}}function Pq({start:q,key:$,sep:U,value:H}){let z="";for(let X of q)z+=X.source;if($)z+=wq($);if(U)for(let X of U)z+=X.source;if(H)z+=wq(H);return z}KX.stringify=AX});var v2=O((SX)=>{var j$=Symbol("break visit"),bX=Symbol("skip children"),x2=Symbol("remove item");function U0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};k2(Object.freeze([]),q,$)}U0.BREAK=j$;U0.SKIP=bX;U0.REMOVE=x2;U0.itemAtPath=(q,$)=>{let U=q;for(let[H,z]of $){let X=U?.[H];if(X&&"items"in X)U=X.items[z];else return}return U};U0.parentCollection=(q,$)=>{let U=U0.itemAtPath(q,$.slice(0,-1)),H=$[$.length-1][0],z=U?.[H];if(z&&"items"in z)return z;throw Error("Parent collection not found")};function k2(q,$,U){let H=U($,q);if(typeof H==="symbol")return H;for(let z of["key","value"]){let X=$[z];if(X&&"items"in X){for(let Z=0;Z<X.items.length;++Z){let G=k2(Object.freeze(q.concat([[z,Z]])),X.items[Z],U);if(typeof G==="number")Z=G-1;else if(G===j$)return j$;else if(G===x2)X.items.splice(Z,1),Z-=1}if(typeof H==="function"&&z==="key")H=H($,q)}}return typeof H==="function"?H($,q):H}SX.visit=U0});var Mq=O((uX)=>{var C$=h2(),CX=u2(),EX=v2(),E$="\uFEFF",f$="\x02",g$="\x18",y$="\x1F",fX=(q)=>!!q&&("items"in q),gX=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function yX(q){switch(q){case E$:return"<BOM>";case f$:return"<DOC>";case g$:return"<FLOW_END>";case y$:return"<SCALAR>";default:return JSON.stringify(q)}}function hX(q){switch(q){case E$:return"byte-order-mark";case f$:return"doc-mode";case g$:return"flow-error-end";case y$: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(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}uX.createScalarToken=C$.createScalarToken;uX.resolveAsScalar=C$.resolveAsScalar;uX.setScalarValue=C$.setScalarValue;uX.stringify=CX.stringify;uX.visit=EX.visit;uX.BOM=E$;uX.DOCUMENT=f$;uX.FLOW_END=g$;uX.SCALAR=y$;uX.isCollection=fX;uX.isScalar=gX;uX.prettyToken=yX;uX.tokenType=hX});var u$=O((eX)=>{var x0=Mq();function y(q){switch(q){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var m2=new Set("0123456789ABCDEFabcdef"),oX=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Aq=new Set(",[]{}"),tX=new Set(` ,[]{}
|
|
119
|
+
\r `),h$=(q)=>!q||tX.has(q);class p2{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let U=this.next??"stream";while(U&&($||this.hasChars(1)))U=yield*this.parseNext(U)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
120
|
+
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
121
|
+
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let U=0;while($===" ")$=this.buffer[++U+q];if($==="\r"){let H=this.buffer[U+q+1];if(H===`
|
|
122
|
+
`||!H&&!this.atEnd)return q+U+1}return $===`
|
|
123
|
+
`||U>=this.indentNext||!$&&!this.atEnd?q+U:-1}if($==="-"||$==="."){let U=this.buffer.substr(q,3);if((U==="---"||U==="...")&&y(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
124
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===x0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,U=q.indexOf("#");while(U!==-1){let z=q[U-1];if(z===" "||z==="\t"){$=U-1;break}else U=q.indexOf("#",U+1)}while(!0){let z=q[$-1];if(z===" "||z==="\t")$-=1;else break}let H=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-H),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield x0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&y(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!y(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&y($)){let U=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=U,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(h$),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,U=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=U=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let H=this.getLine();if(H===null)return this.setNext("flow");if(U!==-1&&U<this.indentNext&&H[0]!=="#"||U===0&&(H.startsWith("---")||H.startsWith("..."))&&y(H[3])){if(!(U===this.indentNext-1&&this.flowLevel===1&&(H[0]==="]"||H[0]==="}")))return this.flowLevel=0,yield x0.FLOW_END,yield*this.parseLineStart()}let z=0;while(H[z]===",")z+=yield*this.pushCount(1),z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(z+=yield*this.pushIndicators(),H[z]){case void 0:return"flow";case"#":return yield*this.pushCount(H.length-z),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(h$),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let X=this.charAt(1);if(this.flowKey||y(X)||X===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let z=0;while(this.buffer[$-1-z]==="\\")z+=1;if(z%2===0)break;$=this.buffer.indexOf('"',$+1)}let U=this.buffer.substring(0,$),H=U.indexOf(`
|
|
125
|
+
`,this.pos);if(H!==-1){while(H!==-1){let z=this.continueScalar(H+1);if(z===-1)break;H=U.indexOf(`
|
|
126
|
+
`,z)}if(H!==-1)$=H-(U[H-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>y($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,U;q:for(let z=this.pos;U=this.buffer[z];++z)switch(U){case" ":$+=1;break;case`
|
|
127
|
+
`:q=z,$=0;break;case"\r":{let X=this.buffer[z+1];if(!X&&!this.atEnd)return this.setNext("block-scalar");if(X===`
|
|
128
|
+
`)break}default:break q}if(!U&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let z=this.continueScalar(q+1);if(z===-1)break;q=this.buffer.indexOf(`
|
|
129
|
+
`,z)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let H=q+1;U=this.buffer[H];while(U===" ")U=this.buffer[++H];if(U==="\t"){while(U==="\t"||U===" "||U==="\r"||U===`
|
|
130
|
+
`)U=this.buffer[++H];q=H-1}else if(!this.blockScalarKeep)do{let z=q-1,X=this.buffer[z];if(X==="\r")X=this.buffer[--z];let Z=z;while(X===" ")X=this.buffer[--z];if(X===`
|
|
131
|
+
`&&z>=this.pos&&z+1+$>Z)q=z;else break}while(!0);return yield x0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,U=this.pos-1,H;while(H=this.buffer[++U])if(H===":"){let z=this.buffer[U+1];if(y(z)||q&&Aq.has(z))break;$=U}else if(y(H)){let z=this.buffer[U+1];if(H==="\r")if(z===`
|
|
132
|
+
`)U+=1,H=`
|
|
133
|
+
`,z=this.buffer[U+1];else $=U;if(z==="#"||q&&Aq.has(z))break;if(H===`
|
|
134
|
+
`){let X=this.continueScalar(U+1);if(X===-1)break;U=Math.max(U,X-2)}}else{if(q&&Aq.has(H))break;$=U}if(!H&&!this.atEnd)return this.setNext("plain-scalar");return yield x0.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let U=this.buffer.slice(this.pos,q);if(U)return yield U,this.pos+=U.length,U.length;else if($)yield"";return 0}*pushIndicators(){let q=0;q:while(!0){switch(this.charAt(0)){case"!":q+=yield*this.pushTag(),q+=yield*this.pushSpaces(!0);continue q;case"&":q+=yield*this.pushUntil(h$),q+=yield*this.pushSpaces(!0);continue q;case"-":case"?":case":":{let $=this.flowLevel>0,U=this.charAt(1);if(y(U)||$&&Aq.has(U)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;q+=yield*this.pushCount(1),q+=yield*this.pushSpaces(!0);continue q}}}break q}return q}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!y($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(oX.has($))$=this.buffer[++q];else if($==="%"&&m2.has(this.buffer[q+1])&&m2.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
135
|
+
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,U;do U=this.buffer[++$];while(U===" "||q&&U==="\t");let H=$-this.pos;if(H>0)yield this.buffer.substr(this.pos,H),this.pos=$;return H}*pushUntil(q){let $=this.pos,U=this.buffer[$];while(!q(U))U=this.buffer[++$];return yield*this.pushToIndex($,!1)}}eX.Lexer=p2});var x$=O(($Z)=>{class d2{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,U=this.lineStarts.length;while($<U){let z=$+U>>1;if(this.lineStarts[z]<q)$=z+1;else U=z}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let H=this.lineStarts[$-1];return{line:$,col:q-H+1}}}}$Z.LineCounter=d2});var k$=O((XZ)=>{var HZ=O0("process"),l2=Mq(),zZ=u$();function i(q,$){for(let U=0;U<q.length;++U)if(q[U].type===$)return!0;return!1}function c2(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function s2(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Kq(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function L0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function Nq(q,$){if($.length<1e5)Array.prototype.push.apply(q,$);else for(let U=0;U<$.length;++U)q.push($[U])}function a2(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!i($.start,"explicit-key-ind")&&!i($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,s2($.value))if($.value.end)Nq($.value.end,$.sep);else $.value.end=$.sep;else Nq($.start,$.sep);delete $.sep}}}class i2{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new zZ.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let U of this.lexer.lex(q,$))yield*this.next(U);if(!$)yield*this.end()}*next(q){if(this.source=q,HZ.env.LOG_TOKENS)console.log("|",l2.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=l2.tokenType(q);if(!$){let U=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:U,source:q}),this.offset+=q.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let U=this.peek(1);if($.type==="block-scalar")$.indent="indent"in U?U.indent:0;else if($.type==="flow-collection"&&U.type==="document")$.indent=0;if($.type==="flow-collection")a2($);switch(U.type){case"document":U.value=$;break;case"block-scalar":U.props.push($);break;case"block-map":{let H=U.items[U.items.length-1];if(H.value){U.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(H.sep)H.value=$;else{Object.assign(H,{key:$,sep:[]}),this.onKeyLine=!H.explicitKey;return}break}case"block-seq":{let H=U.items[U.items.length-1];if(H.value)U.items.push({start:[],value:$});else H.value=$;break}case"flow-collection":{let H=U.items[U.items.length-1];if(!H||H.value)U.items.push({start:[],key:$,sep:[]});else if(H.sep)H.value=$;else Object.assign(H,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((U.type==="document"||U.type==="block-map"||U.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let H=$.items[$.items.length-1];if(H&&!H.sep&&!H.value&&H.start.length>0&&c2(H.start)===-1&&($.indent===0||H.start.every((z)=>z.type!=="comment"||z.indent<$.indent))){if(U.type==="document")U.end=H.start;else U.items.push({start:H.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(c2(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=Kq(this.peek(2)),U=L0($),H;if(q.end)H=q.end,H.push(this.sourceToken),delete q.end;else H=[this.sourceToken];let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:U,key:q,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
137
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
138
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let U="end"in $.value?$.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let H=q.items[q.items.length-2]?.value?.end;if(Array.isArray(H)){Nq(H,$.start),H.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let U=!this.onKeyLine&&this.indent===q.indent,H=U&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",z=[];if(H&&$.sep&&!$.value){let X=[];for(let Z=0;Z<$.sep.length;++Z){let G=$.sep[Z];switch(G.type){case"newline":X.push(Z);break;case"space":break;case"comment":if(G.indent>q.indent)X.length=0;break;default:X.length=0}}if(X.length>=2)z=$.sep.splice(X[1])}switch(this.type){case"anchor":case"tag":if(H||$.value)z.push(this.sourceToken),q.items.push({start:z}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(H||$.value)z.push(this.sourceToken),q.items.push({start:z,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(i($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let X=L0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(i($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(s2($.key)&&!i($.sep,"newline")){let X=L0($.start),Z=$.key,G=$.sep;G.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:Z,sep:G}]})}else if(z.length>0)$.sep=$.sep.concat(z,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||H)q.items.push({start:z,key:null,sep:[this.sourceToken]});else if(i($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(H||$.value)q.items.push({start:z,key:X,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(X);else Object.assign($,{key:X,sep:[]}),this.onKeyLine=!0;return}default:{let X=this.startBlockValue(q);if(X){if(X.type==="block-seq"){if(!$.explicitKey&&$.sep&&!i($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(U)q.items.push({start:z});this.stack.push(X);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let U="end"in $.value?$.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let H=q.items[q.items.length-2]?.value?.end;if(Array.isArray(H)){Nq(H,$.start),H.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||i($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let U=this.startBlockValue(q);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:H,sep:[]});else if($.sep)this.stack.push(H);else Object.assign($,{key:H,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let U=this.startBlockValue(q);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===q.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let H=Kq(U),z=L0(H);a2(q);let X=q.end.splice(1,q.end.length);X.push(this.sourceToken);let Z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:z,key:q,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
139
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
140
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=Kq(q),U=L0($);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=Kq(q),U=L0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((U)=>U.type==="newline"||U.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}XZ.Parser=i2});var e2=O((YZ)=>{var r2=b$(),GZ=f0(),k0=g0(),JZ=xq(),QZ=A(),TZ=x$(),n2=k$();function o2(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new TZ.LineCounter||null,prettyErrors:$}}function RZ(q,$={}){let{lineCounter:U,prettyErrors:H}=o2($),z=new n2.Parser(U?.addNewLine),X=new r2.Composer($),Z=Array.from(X.compose(z.parse(q)));if(H&&U)for(let G of Z)G.errors.forEach(k0.prettifyError(q,U)),G.warnings.forEach(k0.prettifyError(q,U));if(Z.length>0)return Z;return Object.assign([],{empty:!0},X.streamInfo())}function t2(q,$={}){let{lineCounter:U,prettyErrors:H}=o2($),z=new n2.Parser(U?.addNewLine),X=new r2.Composer($),Z=null;for(let G of X.compose(z.parse(q),!0,q.length))if(!Z)Z=G;else if(Z.options.logLevel!=="silent"){Z.errors.push(new k0.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(H&&U)Z.errors.forEach(k0.prettifyError(q,U)),Z.warnings.forEach(k0.prettifyError(q,U));return Z}function BZ(q,$,U){let H=void 0;if(typeof $==="function")H=$;else if(U===void 0&&$&&typeof $==="object")U=$;let z=t2(q,U);if(!z)return null;if(z.warnings.forEach((X)=>JZ.warn(z.options.logLevel,X)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:H},U))}function DZ(q,$,U){let H=null;if(typeof $==="function"||Array.isArray($))H=$;else if(U===void 0&&$)U=$;if(typeof U==="string")U=U.length;if(typeof U==="number"){let z=Math.round(U);U=z<1?void 0:z>8?{indent:8}:{indent:z}}if(q===void 0){let{keepUndefined:z}=U??$??{};if(!z)return}if(QZ.isDocument(q)&&!H)return q.toString(U);return new GZ.Document(q,H,U).toString(U)}YZ.parse=BZ;YZ.parseAllDocuments=RZ;YZ.parseDocument=t2;YZ.stringify=DZ});import{existsSync as $9}from"fs";import{resolve as p$}from"path";import{pathToFileURL as H5}from"url";var IZ=b$(),_Z=f0(),FZ=B$(),v$=g0(),PZ=I0(),r=A(),wZ=l(),MZ=N(),AZ=a(),KZ=s(),h6=Mq(),NZ=u$(),bZ=x$(),SZ=k$(),bq=e2(),q9=V0();var jZ=IZ.Composer,CZ=_Z.Document,EZ=FZ.Schema,fZ=v$.YAMLError,gZ=v$.YAMLParseError,yZ=v$.YAMLWarning,hZ=PZ.Alias,uZ=r.isAlias,xZ=r.isCollection,kZ=r.isDocument,vZ=r.isMap,mZ=r.isNode,pZ=r.isPair,dZ=r.isScalar,lZ=r.isSeq,cZ=wZ.Pair,aZ=MZ.Scalar,sZ=AZ.YAMLMap,iZ=KZ.YAMLSeq;var rZ=NZ.Lexer,nZ=bZ.LineCounter,oZ=SZ.Parser,m$=bq.parse,tZ=bq.parseAllDocuments,eZ=bq.parseDocument,q5=bq.stringify,$5=q9.visit,U5=q9.visitAsync;import{DEFAULT_DOCUMENT_SOURCE_POLICY as Sq,assertRemoteDocumentUrl as z5,redactDocumentUrl as X5}from"@mcp-com-ai/plugin-sdk";async function d6(q,$){let U=q.trim();if(!U)return;let H=T5(U);if(H?.protocol==="http:"||H?.protocol==="https:")return J5(U,H,$);if(H&&H.protocol!=="file:"&&H.protocol!=="path:")throw Error(`Unsupported document source scheme: ${H.protocol}`);let z=H?.protocol==="file:"?Bun.fileURLToPath(H):Z5(H?.protocol==="path:"?R5(H):U,$);if(!z)return;return G5(U,z,$.maxBytes??Sq.maxBytes)}function Z5(q,$){let U=p$($.cwd,q);if($9(U))return U;let H=p$($.hapiHome,"specs");for(let z of["",".json",".yaml",".yml"]){let X=p$(H,`${q}${z}`);if($9(X))return X}return}async function G5(q,$,U){let H=Bun.file($);if(H.size>U)throw Error(`Document source exceeds ${U} bytes: ${$}`);let z=await H.text();H9(z,U,$);let X=H5($).href;return z9({identifier:q,canonicalUri:X,baseUri:new URL(".",X).href,raw:z,document:U9(z,$),remote:!1})}async function J5(q,$,U){let H=U.fetchImpl??fetch,z=U.maxBytes??Sq.maxBytes,X=new AbortController,Z=setTimeout(()=>X.abort(),U.timeoutMs??Sq.timeoutMs),G=$;try{for(let J=0;J<=Sq.maxRedirects;J++){z5(G);let Q=await H(G,{redirect:"manual",signal:X.signal});if(Q5(Q.status)){let R=Q.headers.get("location");if(!R)throw Error(`Redirect from ${H0(G)} has no Location header`);G=new URL(R,G);continue}if(!Q.ok)throw Error(`Unable to load ${H0(G)}: HTTP ${Q.status}`);let D=Number(Q.headers.get("content-length"));if(Number.isFinite(D)&&D>z)throw Error(`Document source exceeds ${z} bytes: ${H0(G)}`);let T=await Q.text();return H9(T,z,H0(G)),z9({identifier:q,canonicalUri:G.href,baseUri:new URL(".",G).href,raw:T,document:U9(T,H0(G)),remote:!0})}throw Error(`Too many redirects while loading ${H0($)}`)}catch(J){if(X.signal.aborted)throw Error(`Timed out loading ${H0(G)}`);throw J}finally{clearTimeout(Z)}}function U9(q,$){try{let U=m$(q);if(!U||typeof U!=="object"||Array.isArray(U))throw Error("document root must be an object");return U}catch(U){throw Error(`Unable to parse ${$}: ${U instanceof Error?U.message:String(U)}`)}}function H9(q,$,U){if(new TextEncoder().encode(q).byteLength>$)throw Error(`Document source exceeds ${$} bytes: ${U}`)}function z9(q){return Object.freeze(q)}function Q5(q){return[301,302,303,307,308].includes(q)}function T5(q){try{return new URL(q)}catch{return}}function R5(q){let $=decodeURIComponent(q.pathname);return q.hostname?`${q.hostname}${$}`:$}function H0(q){return X5(q)}function c6(q,$,U={}){let H=U.warn??(()=>{}),z=new Map,X=(Z,G,J,Q)=>{for(let D of[Z.name,...Z.aliases??[]]){if(z.has(D)){let T=z.get(D);H(`Command '${D}' already provided by ${T.source==="core"?"core":T.pluginName}; ignoring declaration from ${J??"core"}`);continue}z.set(D,{...Z,source:G,pluginName:J,packageName:Q})}};for(let Z of q)X(Z,"core");for(let{plugin:Z,packageName:G}of $)for(let J of Z.commands)X(J,"plugin",Z.name,G);return z}function a6(q){let $=new Set;for(let[U,H]of q.entries())if(U===H.name)$.add(H);return Array.from($).filter((U)=>!U.hidden).sort((U,H)=>U.name.localeCompare(H.name))}import{HAPI_CLI_API_VERSION as X9,satisfiesVersionRange as B5}from"@mcp-com-ai/plugin-sdk";var D5=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/enterprise-plugin-auth","@mcp-com-ai/plugin-otel"];async function r6(q={}){let $=q.warn??(()=>{}),U=new Set(q.blocklist??[]),H=[],z=new Set,X=[];for(let Z of q.bundledPlugins??[])X.push({packageName:Z.name,source:"bundled",plugin:Z});for(let Z of q.workspacePackages??[])X.push({packageName:Z,source:"workspace"});for(let Z of D5)X.push({packageName:Z,source:"installed"});for(let Z of q.configuredPackages??[])X.push({packageName:Z,source:"installed"});for(let{packageName:Z,source:G,plugin:J}of X){if(z.has(Z))continue;if(z.add(Z),U.has(Z))continue;try{let Q=J?void 0:await import(Z),D=J??(Q?.plugin??Q?.default);if(!D){$(`Plugin '${Z}' loaded but did not export a plugin definition`);continue}if(D.compatibility?.cliApiVersion!==X9){$(`Plugin '${Z}' declares cliApiVersion=${D.compatibility?.cliApiVersion}; CLI expects ${X9}. Skipping.`);continue}let T=D.compatibility.core;if(T&&!B5(T.version,T.range)){$(`Plugin '${Z}' resolved core ${T.version}, which does not satisfy its declared range ${T.range}. Skipping.`);continue}H.push({plugin:D,packageName:Z,source:G})}catch(Q){let D=Q instanceof Error?Q.message:String(Q);if(!Y5(Q))$(`Plugin '${Z}' failed to load: ${D}`)}}return H}function Y5(q){if(!q||typeof q!=="object")return!1;let $=q.code;if($==="ERR_MODULE_NOT_FOUND"||$==="MODULE_NOT_FOUND")return!0;let U=q.message??"";return/Cannot find (module|package)/i.test(U)}import{parseArgs as L5,renderCommandHelp as d$}from"@mcp-com-ai/plugin-sdk";var Z9=[{command:"cloudflare",packageName:"@mcp-com-ai/plugin-cloudflare",description:"Deploy HAPI MCP servers to Cloudflare Workers (deploy, login, status).",installHint:"bun add -g @mcp-com-ai/plugin-cloudflare"},{command:"openapi",packageName:"@mcp-com-ai/plugin-openapi",description:"OpenAPI-driven tooling (init, lint, list, serve).",installHint:"bun add -g @mcp-com-ai/plugin-openapi",documentRootField:"openapi"},{command:"arazzo",packageName:"@mcp-com-ai/plugin-arazzo",description:"Arazzo workflow validation, serving, and execution.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"workflows",packageName:"@mcp-com-ai/plugin-arazzo",description:"Alias for the Arazzo workflow command group.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"auth",packageName:"@mcp-com-ai/enterprise-plugin-auth",description:"OAuth/Security handler configuration for `hapi serve` (enterprise tier).",installHint:"Contact La Rebelion Labs for enterprise access."},{command:"otel",packageName:"@mcp-com-ai/plugin-otel",description:"OpenTelemetry / PostHog telemetry collection for HAPI commands.",installHint:"bun add -g @mcp-com-ai/plugin-otel"},{command:"license",packageName:"@mcp-com-ai/enterprise-plugin-licensing",description:"Enterprise licensing (activation, status, import). Part of the enterprise tier.",installHint:"Contact La Rebelion Labs for enterprise access."}];function G9(q){return Z9.find(($)=>$.command===q)}function o6(q){return Z9.find(($)=>$.documentRootField===q)}var O5=new Set(["--help","-h","help"]);async function $7(q,$,U){if($.length===0){let Z=q.get("help");if(Z?.run){let G=await Z.run({positionals:[],options:{},rest:[]},U);return typeof G==="number"?G:0}return U.stdout.write(`Usage: hapi <command> [subcommand] [options]
|
|
141
|
+
`),0}let[H,...z]=$;if(!H)return 0;if(H==="--help"||H==="-h"){let Z=q.get("help");if(Z?.run){let G=await Z.run({positionals:[],options:{},rest:[]},U);return typeof G==="number"?G:0}}if(H==="--version"||H==="-v"){let Z=q.get("version");if(Z?.run){let G=await Z.run({positionals:[],options:{},rest:[]},U);return typeof G==="number"?G:0}}let X=q.get(H);if(!X)return V5(H,U);return l$(q,X,z,U,[X.name])}async function l$(q,$,U,H,z){if(U.length>0&&O5.has(U[0]))return d$($,H,z.slice(0,-1)),0;let X=U[0];if($.subcommands&&$.subcommands.length>0&&X&&!X.startsWith("-")){let G=$.subcommands.find((J)=>J.name===X||J.aliases?.includes(X));if(G)return l$(q,G,U.slice(1),H,[...z,G.name]);if(!$.run)return H.stderr.write(`Unknown subcommand: ${z.join(" ")} ${X}
|
|
142
|
+
`),d$($,H,z.slice(0,-1)),1}if(!$.run)return d$($,H,z.slice(0,-1)),0;if($.name==="serve"&&z.length>1){let G=q.get("serve");if(G?.source==="core")return l$(q,G,U,H,[G.name])}let Z=L5(U,$.options??[]);try{let G=await $.run(Z,H);return typeof G==="number"?G:Number(process.exitCode??0)}catch(G){let{printCliError:J}=await import("@mcp-com-ai/shared-utils");return J(`\u274C ${z.join(" ")} failed`,G),1}}function V5(q,$){let U=G9(q);if(U)return $.stderr.write(`
|
|
143
|
+
Command "${q}" is provided by ${U.packageName}, which is not installed.
|
|
144
|
+
`),$.stderr.write(`
|
|
145
|
+
${U.description}
|
|
146
|
+
|
|
147
|
+
`),$.stderr.write(`Install it with:
|
|
148
|
+
${U.installHint??`bun add -g ${U.packageName}`}
|
|
149
|
+
|
|
150
|
+
`),127;return $.stderr.write(`Unknown command: ${q}
|
|
151
|
+
`),$.stderr.write(`Run "hapi help" to see available commands.
|
|
152
|
+
`),127}export{$7 as runCommand,d6 as resolveDocumentSource,H0 as redactUrl,r6 as loadInstalledPlugins,a6 as listCommands,o6 as findKnownPluginByRootField,G9 as findKnownPluginByCommand,c6 as buildCommandRegistry,Z9 as KNOWN_OPTIONAL_PLUGINS};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KnownOptionalPlugin } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Plugins the CLI knows about by command. Drives the "missing plugin"
|
|
4
|
+
* UX so users get guidance instead of an opaque "unknown command".
|
|
5
|
+
*
|
|
6
|
+
* First-party plugins live here. Third-party plugins rely on the
|
|
7
|
+
* pattern-based discovery in `plugin-loader.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const KNOWN_OPTIONAL_PLUGINS: readonly KnownOptionalPlugin[];
|
|
10
|
+
export declare function findKnownPluginByCommand(name: string): KnownOptionalPlugin | undefined;
|
|
11
|
+
export declare function findKnownPluginByRootField(field: string): KnownOptionalPlugin | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HapiCliPlugin } from "@mcp-com-ai/plugin-sdk";
|
|
2
|
+
import type { LoadedPlugin } from "./types";
|
|
3
|
+
export interface LoadPluginsOptions {
|
|
4
|
+
/** Plugins statically linked into a standalone distribution. */
|
|
5
|
+
bundledPlugins?: readonly HapiCliPlugin[];
|
|
6
|
+
/** Additional package names declared by the user in config. */
|
|
7
|
+
configuredPackages?: readonly string[];
|
|
8
|
+
/** Plugins that should be refused even if discovered. */
|
|
9
|
+
blocklist?: readonly string[];
|
|
10
|
+
/** Override the packages treated as workspace plugins. */
|
|
11
|
+
workspacePackages?: readonly string[];
|
|
12
|
+
/** Warn to this sink on version mismatches. */
|
|
13
|
+
warn?: (msg: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function loadInstalledPlugins(options?: LoadPluginsOptions): Promise<LoadedPlugin[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CliCommand, HapiCliPlugin } from '@mcp-com-ai/plugin-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* A command that has been merged into the CLI's registry along with its
|
|
4
|
+
* provenance (was it core? provided by which plugin?).
|
|
5
|
+
*/
|
|
6
|
+
export interface RegisteredCommand extends CliCommand {
|
|
7
|
+
source: 'core' | 'plugin';
|
|
8
|
+
pluginName?: string;
|
|
9
|
+
/** The package that owns this command (may differ from pluginName for built-ins). */
|
|
10
|
+
packageName?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Record of a known optional plugin — used to produce install guidance
|
|
14
|
+
* when a user runs a command the CLI hasn't loaded.
|
|
15
|
+
*/
|
|
16
|
+
export interface KnownOptionalPlugin {
|
|
17
|
+
command: string;
|
|
18
|
+
packageName: string;
|
|
19
|
+
description: string;
|
|
20
|
+
installHint?: string;
|
|
21
|
+
documentRootField?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The loaded plugin along with metadata about where it came from, used
|
|
25
|
+
* for `hapi plugins list` output.
|
|
26
|
+
*/
|
|
27
|
+
export interface LoadedPlugin {
|
|
28
|
+
plugin: HapiCliPlugin;
|
|
29
|
+
packageName: string;
|
|
30
|
+
source: 'built-in' | 'bundled' | 'workspace' | 'installed';
|
|
31
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CliContext, HapiCliPlugin } from '@mcp-com-ai/plugin-sdk';
|
|
2
|
+
import { buildCommandRegistry } from './core/command-registry';
|
|
3
|
+
import { loadInstalledPlugins } from './core/plugin-loader';
|
|
4
|
+
import { runCommand } from './core/run-command';
|
|
5
|
+
export interface RunCliOptions {
|
|
6
|
+
/** Command-line arguments (without `node` / `bun` / `hapi`). */
|
|
7
|
+
argv: readonly string[];
|
|
8
|
+
/** Workspace plugin packages to always load (used during monorepo dev). */
|
|
9
|
+
workspacePackages?: readonly string[];
|
|
10
|
+
/** Plugins statically linked into a standalone binary or container image. */
|
|
11
|
+
bundledPlugins?: readonly HapiCliPlugin[];
|
|
12
|
+
/** Override streams for tests. */
|
|
13
|
+
stdout?: CliContext['stdout'];
|
|
14
|
+
stderr?: CliContext['stderr'];
|
|
15
|
+
stdin?: CliContext['stdin'];
|
|
16
|
+
/** Override the environment bag passed to commands. */
|
|
17
|
+
env?: Record<string, string | undefined>;
|
|
18
|
+
/** Override the reported cwd. */
|
|
19
|
+
cwd?: string;
|
|
20
|
+
/** When true, don't print startup warnings (useful in tests). */
|
|
21
|
+
silent?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function runCli(options: RunCliOptions): Promise<number>;
|
|
24
|
+
export { buildCommandRegistry, loadInstalledPlugins, runCommand };
|
|
25
|
+
export type { LoadedPlugin, RegisteredCommand } from './core/types';
|