@keepur/hive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/pkg/cli.min.js ADDED
@@ -0,0 +1,245 @@
1
+ #!/usr/bin/env node
2
+ var Ha=Object.create;var ks=Object.defineProperty;var Va=Object.getOwnPropertyDescriptor;var Ga=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Qa=Object.prototype.hasOwnProperty;var yt=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var Q=(s,e)=>()=>(s&&(e=s(s=0)),e);var y=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),fe=(s,e)=>{for(var t in e)ks(s,t,{get:e[t],enumerable:!0})},Wa=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ga(e))!Qa.call(s,i)&&i!==t&&ks(s,i,{get:()=>e[i],enumerable:!(n=Va(e,i))||n.enumerable});return s};var As=(s,e,t)=>(t=s!=null?Ha(Ja(s)):{},Wa(e||!s||!s.__esModule?ks(t,"default",{value:s,enumerable:!0}):t,s));import{existsSync as za}from"node:fs";import{resolve as Ns}from"node:path";function Za(){return process.env.HIVE_HOME?Ns(process.env.HIVE_HOME):za(Ns(process.cwd(),"hive.yaml"))?process.cwd():Ns(Xa,".hive")}var Xa,M,Te=Q(()=>{"use strict";Xa=process.env.HOME??"/tmp";M=Za()});import{execFileSync as _}from"node:child_process";import{writeFileSync as el,unlinkSync as tl}from"node:fs";import{resolve as sl}from"node:path";import{tmpdir as nl}from"node:os";function bt(s){try{return _("which",[s],Pe),!0}catch{return!1}}function Si(s){try{return _("brew",["list",s],Pe),!0}catch{return!1}}function vi(s){try{return _("brew",["services","list"],Pe).split(`
3
+ `).some(t=>t.startsWith(s)&&t.includes("started"))}catch{return!1}}async function ki(){console.log(`Checking prerequisites...
4
+ `);let s=0;for(let e of il){let t=e.required?"":" (optional)";if(e.check()){console.log(` \u2713 ${e.name}${t}`);continue}console.log(` \u2717 ${e.name}${t} \u2014 installing...`);try{e.install(),e.check()?console.log(` \u2713 ${e.name} \u2014 installed`):e.required&&(console.error(` \u2717 ${e.name} \u2014 install failed`),s++)}catch(n){e.required?(console.error(` \u2717 ${e.name} \u2014 install failed: ${n}`),s++):console.log(` \u25CB ${e.name} \u2014 skipped (install failed)`)}}s>0&&(console.error(`
5
+ ${s} required prerequisite(s) failed. Fix and re-run 'hive init'.`),process.exit(1)),console.log(`
6
+ All prerequisites ready.`)}var Pe,il,Ai=Q(()=>{"use strict";Pe={encoding:"utf-8",stdio:"pipe"};il=[{name:"Xcode CLI Tools",required:!0,check:()=>{try{return _("xcode-select",["-p"],Pe),!0}catch{return!1}},install:()=>{console.log(" Installing Xcode CLI Tools (this opens a system dialog)..."),_("xcode-select",["--install"],{stdio:"inherit"}),console.log(" Complete the installation dialog, then re-run 'hive init'."),process.exit(0)}},{name:"Homebrew",required:!0,check:()=>bt("brew"),install:()=>{console.log(" Installing Homebrew...");let s=sl(nl(),"brew-install.sh"),e=_("curl",["-fsSL","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{encoding:"utf-8"});el(s,e,{mode:493}),_("/bin/bash",[s],{stdio:"inherit"}),tl(s)}},{name:"Node.js >= 22",required:!0,check:()=>parseInt(process.versions.node.split(".")[0])>=22,install:()=>{console.log(" Installing Node.js via Homebrew..."),_("brew",["install","node"],{stdio:"inherit"})}},{name:"MongoDB",required:!0,check:()=>vi("mongodb-community"),install:()=>{Si("mongodb-community")||(console.log(" Tapping mongodb/brew..."),_("brew",["tap","mongodb/brew"],{stdio:"inherit"}),console.log(" Installing mongodb-community..."),_("brew",["install","mongodb-community"],{stdio:"inherit"})),console.log(" Starting MongoDB..."),_("brew",["services","start","mongodb-community"],{stdio:"inherit"})}},{name:"Ollama",required:!1,check:()=>bt("ollama"),install:()=>{console.log(" Installing Ollama..."),_("brew",["install","ollama"],{stdio:"inherit"}),_("brew",["services","start","ollama"],{stdio:"inherit"})}},{name:"Ollama models (bge-large, qwen2.5:3b)",required:!1,check:()=>{if(!bt("ollama"))return!1;try{let s=_("ollama",["list"],Pe);return s.includes("bge-large")&&s.includes("qwen2.5:3b")}catch{return!1}},install:()=>{console.log(" Pulling bge-large..."),_("ollama",["pull","bge-large"],{stdio:"inherit"}),console.log(" Pulling qwen2.5:3b..."),_("ollama",["pull","qwen2.5:3b"],{stdio:"inherit"})}},{name:"Qdrant",required:!1,check:()=>vi("qdrant"),install:()=>{Si("qdrant")||(console.log(" Installing Qdrant..."),_("brew",["install","qdrant/tap/qdrant"],{stdio:"inherit"})),console.log(" Starting Qdrant..."),_("brew",["services","start","qdrant"],{stdio:"inherit"})}},{name:"gh CLI",required:!1,check:()=>bt("gh"),install:()=>{console.log(" Installing gh CLI..."),_("brew",["install","gh"],{stdio:"inherit"})}}]});var O=y(B=>{"use strict";var Os=Symbol.for("yaml.alias"),Ni=Symbol.for("yaml.document"),wt=Symbol.for("yaml.map"),Oi=Symbol.for("yaml.pair"),Es=Symbol.for("yaml.scalar"),St=Symbol.for("yaml.seq"),W=Symbol.for("yaml.node.type"),rl=s=>!!s&&typeof s=="object"&&s[W]===Os,ol=s=>!!s&&typeof s=="object"&&s[W]===Ni,al=s=>!!s&&typeof s=="object"&&s[W]===wt,ll=s=>!!s&&typeof s=="object"&&s[W]===Oi,Ei=s=>!!s&&typeof s=="object"&&s[W]===Es,cl=s=>!!s&&typeof s=="object"&&s[W]===St;function qi(s){if(s&&typeof s=="object")switch(s[W]){case wt:case St:return!0}return!1}function ul(s){if(s&&typeof s=="object")switch(s[W]){case Os:case wt:case Es:case St:return!0}return!1}var fl=s=>(Ei(s)||qi(s))&&!!s.anchor;B.ALIAS=Os;B.DOC=Ni;B.MAP=wt;B.NODE_TYPE=W;B.PAIR=Oi;B.SCALAR=Es;B.SEQ=St;B.hasAnchor=fl;B.isAlias=rl;B.isCollection=qi;B.isDocument=ol;B.isMap=al;B.isNode=ul;B.isPair=ll;B.isScalar=Ei;B.isSeq=cl});var _e=y(qs=>{"use strict";var $=O(),j=Symbol("break visit"),Ci=Symbol("skip children"),G=Symbol("remove node");function vt(s,e){let t=Li(e);$.isDocument(s)?Se(null,s.contents,t,Object.freeze([s]))===G&&(s.contents=null):Se(null,s,t,Object.freeze([]))}vt.BREAK=j;vt.SKIP=Ci;vt.REMOVE=G;function Se(s,e,t,n){let i=Ii(s,e,t,n);if($.isNode(i)||$.isPair(i))return Ti(s,n,i),Se(s,i,t,n);if(typeof i!="symbol"){if($.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=Se(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===G&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=Se("key",e.key,t,n);if(r===j)return j;r===G&&(e.key=null);let o=Se("value",e.value,t,n);if(o===j)return j;o===G&&(e.value=null)}}return i}async function kt(s,e){let t=Li(e);$.isDocument(s)?await ve(null,s.contents,t,Object.freeze([s]))===G&&(s.contents=null):await ve(null,s,t,Object.freeze([]))}kt.BREAK=j;kt.SKIP=Ci;kt.REMOVE=G;async function ve(s,e,t,n){let i=await Ii(s,e,t,n);if($.isNode(i)||$.isPair(i))return Ti(s,n,i),ve(s,i,t,n);if(typeof i!="symbol"){if($.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await ve(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===G&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=await ve("key",e.key,t,n);if(r===j)return j;r===G&&(e.key=null);let o=await ve("value",e.value,t,n);if(o===j)return j;o===G&&(e.value=null)}}return i}function Li(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Ii(s,e,t,n){if(typeof t=="function")return t(s,e,n);if($.isMap(e))return t.Map?.(s,e,n);if($.isSeq(e))return t.Seq?.(s,e,n);if($.isPair(e))return t.Pair?.(s,e,n);if($.isScalar(e))return t.Scalar?.(s,e,n);if($.isAlias(e))return t.Alias?.(s,e,n)}function Ti(s,e,t){let n=e[e.length-1];if($.isCollection(n))n.items[s]=t;else if($.isPair(n))s==="key"?n.key=t:n.value=t;else if($.isDocument(n))n.contents=t;else{let i=$.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}qs.visit=vt;qs.visitAsync=kt});var Cs=y(_i=>{"use strict";var Pi=O(),hl=_e(),dl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pl=s=>s.replace(/[!,[\]{}]/g,e=>dl[e]),$e=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+pl(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Pi.isNode(e.contents)){let r={};hl.visit(e.contents,(o,a)=>{Pi.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
7
+ `)}};$e.defaultYaml={explicit:!1,version:"1.2"};$e.defaultTags={"!!":"tag:yaml.org,2002:"};_i.Directives=$e});var At=y(Me=>{"use strict";var $i=O(),ml=_e();function gl(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Mi(s){let e=new Set;return ml.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Di(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function yl(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Mi(s));let o=Di(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&($i.isScalar(o.node)||$i.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}Me.anchorIsValid=gl;Me.anchorNames=Mi;Me.createNodeAnchors=yl;Me.findNewAnchor=Di});var Ls=y(Bi=>{"use strict";function De(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=De(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=De(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=De(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=De(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}Bi.applyReviver=De});var Z=y(ji=>{"use strict";var bl=O();function Ki(s,e,t){if(Array.isArray(s))return s.map((n,i)=>Ki(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!bl.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}ji.toJS=Ki});var Nt=y(Ri=>{"use strict";var wl=Ls(),Fi=O(),Sl=Z(),Is=class{constructor(e){Object.defineProperty(this,Fi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!Fi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Sl.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?wl.applyReviver(r,{"":a},"",a):a}};Ri.NodeBase=Is});var Be=y(Ui=>{"use strict";var vl=At(),kl=_e(),ke=O(),Al=Nt(),Nl=Z(),Ts=class extends Al.NodeBase{constructor(e){super(ke.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],kl.visit(e,{Node:(r,o)=>{(ke.isAlias(o)||ke.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(Nl.toJS(o,null,t),a=n.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ot(i,o,n)),a.count*a.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(vl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function Ot(s,e,t){if(ke.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(ke.isCollection(e)){let n=0;for(let i of e.items){let r=Ot(s,i,t);r>n&&(n=r)}return n}else if(ke.isPair(e)){let n=Ot(s,e.key,t),i=Ot(s,e.value,t);return Math.max(n,i)}return 1}Ui.Alias=Ts});var L=y(Ps=>{"use strict";var Ol=O(),El=Nt(),ql=Z(),Cl=s=>!s||typeof s!="function"&&typeof s!="object",ee=class extends El.NodeBase{constructor(e){super(Ol.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:ql.toJS(this.value,e,t)}toString(){return String(this.value)}};ee.BLOCK_FOLDED="BLOCK_FOLDED";ee.BLOCK_LITERAL="BLOCK_LITERAL";ee.PLAIN="PLAIN";ee.QUOTE_DOUBLE="QUOTE_DOUBLE";ee.QUOTE_SINGLE="QUOTE_SINGLE";Ps.Scalar=ee;Ps.isScalarValue=Cl});var Ke=y(Yi=>{"use strict";var Ll=Be(),he=O(),xi=L(),Il="tag:yaml.org,2002:";function Tl(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function Pl(s,e,t){if(he.isDocument(s)&&(s=s.contents),he.isNode(s))return s;if(he.isPair(s)){let h=t.schema[he.MAP].createNode?.(t.schema,null,t);return h.items.push(s),h}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=i(s)),new Ll.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Il+e.slice(2));let c=Tl(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let h=new xi.Scalar(s);return l&&(l.node=h),h}c=s instanceof Map?o[he.MAP]:Symbol.iterator in Object(s)?o[he.SEQ]:o[he.MAP]}r&&(r(c),delete t.onTagObj);let d=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new xi.Scalar(s);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}Yi.createNode=Pl});var qt=y(Et=>{"use strict";var _l=Ke(),J=O(),$l=Nt();function _s(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return _l.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Hi=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,$s=class extends $l.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>J.isNode(n)||J.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Hi(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(J.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,_s(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(J.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&J.isScalar(r)?r.value:r:J.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!J.isPair(t))return!1;let n=t.value;return n==null||e&&J.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return J.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(J.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,_s(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Et.Collection=$s;Et.collectionFromPath=_s;Et.isEmptyPath=Hi});var je=y(Ct=>{"use strict";var Ml=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Ms(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Dl=(s,e,t)=>s.endsWith(`
8
+ `)?Ms(t,e):t.includes(`
9
+ `)?`
10
+ `+Ms(t,e):(s.endsWith(" ")?"":" ")+t;Ct.indentComment=Ms;Ct.lineComment=Dl;Ct.stringifyComment=Ml});var Gi=y(Fe=>{"use strict";var Bl="flow",Ds="block",Lt="quoted";function Kl(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],d={},h=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):h=i-n);let u,m,g=!1,f=-1,p=-1,b=-1;t===Ds&&(f=Vi(s,f,e.length),f!==-1&&(h=f+l));for(let v;v=s[f+=1];){if(t===Lt&&v==="\\"){switch(p=f,s[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}b=f}if(v===`
11
+ `)t===Ds&&(f=Vi(s,f,e.length)),h=f+e.length+l,u=void 0;else{if(v===" "&&m&&m!==" "&&m!==`
12
+ `&&m!==" "){let k=s[f+1];k&&k!==" "&&k!==`
13
+ `&&k!==" "&&(u=f)}if(f>=h)if(u)c.push(u),h=u+l,u=void 0;else if(t===Lt){for(;m===" "||m===" ";)m=v,v=s[f+=1],g=!0;let k=f>b+1?f-2:p-1;if(d[k])return s;c.push(k),d[k]=!0,h=k+l,u=void 0}else g=!0}m=v}if(g&&a&&a(),c.length===0)return s;o&&o();let S=s.slice(0,c[0]);for(let v=0;v<c.length;++v){let k=c[v],A=c[v+1]||s.length;k===0?S=`
14
+ ${e}${s.slice(0,A)}`:(t===Lt&&d[k]&&(S+=`${s[k]}\\`),S+=`
15
+ ${e}${s.slice(k+1,A)}`)}return S}function Vi(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
16
+ `);n=e,i=e+1,r=s[i]}return n}Fe.FOLD_BLOCK=Ds;Fe.FOLD_FLOW=Bl;Fe.FOLD_QUOTED=Lt;Fe.foldFlowLines=Kl});var Ue=y(Ji=>{"use strict";var Y=L(),te=Gi(),Tt=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),Pt=s=>/^(%|---|\.\.\.)/m.test(s);function jl(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
17
+ `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Re(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Pt(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let d=t.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
18
+
19
+ `;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
20
+ `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:te.foldFlowLines(o,r,te.FOLD_QUOTED,Tt(e,!1))}function Bs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
21
+ `)||/[ \t]\n|\n[ \t]/.test(s))return Re(s,e);let t=e.indent||(Pt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
22
+ ${t}`)+"'";return e.implicitKey?n:te.foldFlowLines(n,t,te.FOLD_FLOW,Tt(e,!1))}function Ae(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Re;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=Bs:r&&!i?n=Re:n=t?Bs:Re}return n(s,e)}var Ks;try{Ks=new RegExp(`(^|(?<!
23
+ ))
24
+ +(?!
25
+ |$)`,"g")}catch{Ks=/\n+(?!\n|$)/g}function It({comment:s,type:e,value:t},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return Ae(t,n);let c=n.indent||(n.forceBlockIndent||Pt(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!jl(t,l,c.length);if(!t)return d?`|
26
+ `:`>
27
+ `;let h,u;for(u=t.length;u>0;--u){let A=t[u-1];if(A!==`
28
+ `&&A!==" "&&A!==" ")break}let m=t.substring(u),g=m.indexOf(`
29
+ `);g===-1?h="-":t===m||g!==m.length-1?(h="+",r&&r()):h="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
30
+ `&&(m=m.slice(0,-1)),m=m.replace(Ks,`$&${c}`));let f=!1,p,b=-1;for(p=0;p<t.length;++p){let A=t[p];if(A===" ")f=!0;else if(A===`
31
+ `)b=p;else break}let S=t.substring(0,b<p?b+1:p);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let k=(f?c?"2":"1":"")+h;if(s&&(k+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){let A=t.replace(/\n+/g,`
32
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,C=Tt(n,!0);o!=="folded"&&e!==Y.Scalar.BLOCK_FOLDED&&(C.onOverflow=()=>{N=!0});let w=te.foldFlowLines(`${S}${A}${m}`,c,te.FOLD_BLOCK,C);if(!N)return`>${k}
33
+ ${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${k}
34
+ ${c}${S}${t}${m}`}function Fl(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&r.includes(`
35
+ `)||d&&/[[\]{},]/.test(r))return Ae(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
36
+ `)?Ae(r,e):It(s,e,t,n);if(!a&&!d&&i!==Y.Scalar.PLAIN&&r.includes(`
37
+ `))return It(s,e,t,n);if(Pt(r)){if(l==="")return e.forceBlockIndent=!0,It(s,e,t,n);if(a&&l===c)return Ae(r,e)}let h=r.replace(/\n+/g,`$&
38
+ ${l}`);if(o){let u=f=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(h),{compat:m,tags:g}=e.doc.schema;if(g.some(u)||m?.some(u))return Ae(r,e)}return a?h:te.foldFlowLines(h,l,te.FOLD_FLOW,Tt(e,!1))}function Rl(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==Y.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let l=d=>{switch(d){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return i||r?Ae(o.value,e):It(o,e,t,n);case Y.Scalar.QUOTE_DOUBLE:return Re(o.value,e);case Y.Scalar.QUOTE_SINGLE:return Bs(o.value,e);case Y.Scalar.PLAIN:return Fl(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:h}=e.options,u=i&&d||h;if(c=l(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}Ji.stringifyString=Rl});var xe=y(js=>{"use strict";var Ul=At(),se=O(),xl=je(),Yl=Ue();function Hl(s,e){let t=Object.assign({blockQuote:!0,commentString:xl.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Vl(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(se.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function Gl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(se.isScalar(s)||se.isCollection(s))&&s.anchor;r&&Ul.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Jl(s,e,t,n){if(se.isPair(s))return s.toString(e,t,n);if(se.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=se.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i??(i=Vl(e.doc.schema.tags,r));let o=Gl(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,n):se.isScalar(r)?Yl.stringifyString(r,e,t,n):r.toString(e,t,n);return o?se.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
39
+ ${e.indent}${a}`:a}js.createStringifyContext=Hl;js.stringify=Jl});var Xi=y(zi=>{"use strict";var z=O(),Qi=L(),Wi=xe(),Ye=je();function Ql({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:h}}=t,u=z.isNode(s)&&s.comment||null;if(h){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(z.isCollection(s)||!z.isNode(s)&&typeof s=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!h&&(!s||u&&e==null&&!t.inFlow||z.isCollection(s)||(z.isScalar(s)?s.type===Qi.Scalar.BLOCK_FOLDED||s.type===Qi.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(h||!r),indent:a+l});let g=!1,f=!1,p=Wi.stringify(s,t,()=>g=!0,()=>f=!0);if(!m&&!t.inFlow&&p.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return g&&n&&n(),p===""?"?":m?`? ${p}`:p}else if(r&&!h||e==null&&m)return p=`? ${p}`,u&&!g?p+=Ye.lineComment(p,t.indent,c(u)):f&&i&&i(),p;g&&(u=null),m?(u&&(p+=Ye.lineComment(p,t.indent,c(u))),p=`? ${p}
40
+ ${a}:`):(p=`${p}:`,u&&(p+=Ye.lineComment(p,t.indent,c(u))));let b,S,v;z.isNode(e)?(b=!!e.spaceBefore,S=e.commentBefore,v=e.comment):(b=!1,S=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!u&&z.isScalar(e)&&(t.indentAtStart=p.length+1),f=!1,!d&&l.length>=2&&!t.inFlow&&!m&&z.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let k=!1,A=Wi.stringify(e,t,()=>k=!0,()=>f=!0),N=" ";if(u||b||S){if(N=b?`
41
+ `:"",S){let C=c(S);N+=`
42
+ ${Ye.indentComment(C,t.indent)}`}A===""&&!t.inFlow?N===`
43
+ `&&v&&(N=`
44
+
45
+ `):N+=`
46
+ ${t.indent}`}else if(!m&&z.isCollection(e)){let C=A[0],w=A.indexOf(`
47
+ `),T=w!==-1,X=t.inFlow??e.flow??e.items.length===0;if(T||!X){let we=!1;if(T&&(C==="&"||C==="!")){let P=A.indexOf(" ");C==="&"&&P!==-1&&P<w&&A[P+1]==="!"&&(P=A.indexOf(" ",P+1)),(P===-1||w<P)&&(we=!0)}we||(N=`
48
+ ${t.indent}`)}}else(A===""||A[0]===`
49
+ `)&&(N="");return p+=N+A,t.inFlow?k&&n&&n():v&&!k?p+=Ye.lineComment(p,t.indent,c(v)):f&&i&&i(),p}zi.stringifyPair=Ql});var Rs=y(Fs=>{"use strict";var Zi=yt("process");function Wl(s,...e){s==="debug"&&console.log(...e)}function zl(s,e){(s==="debug"||s==="warn")&&(typeof Zi.emitWarning=="function"?Zi.emitWarning(e):console.warn(e))}Fs.debug=Wl;Fs.warn=zl});var Dt=y(Mt=>{"use strict";var He=O(),er=L(),_t="<<",$t={identify:s=>s===_t||typeof s=="symbol"&&s.description===_t,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new er.Scalar(Symbol(_t)),{addToJSMap:tr}),stringify:()=>_t},Xl=(s,e)=>($t.identify(e)||He.isScalar(e)&&(!e.type||e.type===er.Scalar.PLAIN)&&$t.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===$t.tag&&t.default);function tr(s,e,t){if(t=s&&He.isAlias(t)?t.resolve(s.doc):t,He.isSeq(t))for(let n of t.items)Us(s,e,n);else if(Array.isArray(t))for(let n of t)Us(s,e,n);else Us(s,e,t)}function Us(s,e,t){let n=s&&He.isAlias(t)?t.resolve(s.doc):t;if(!He.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Mt.addMergeToJSMap=tr;Mt.isMergeKey=Xl;Mt.merge=$t});var Ys=y(ir=>{"use strict";var Zl=Rs(),sr=Dt(),ec=xe(),nr=O(),xs=Z();function tc(s,e,{key:t,value:n}){if(nr.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(sr.isMergeKey(s,t))sr.addMergeToJSMap(s,e,n);else{let i=xs.toJS(t,"",s);if(e instanceof Map)e.set(i,xs.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=sc(t,i,s),o=xs.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function sc(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(nr.isNode(s)&&t?.doc){let n=ec.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Zl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}ir.addPairToJSMap=tc});var ne=y(Hs=>{"use strict";var rr=Ke(),nc=Xi(),ic=Ys(),Bt=O();function rc(s,e,t){let n=rr.createNode(s,void 0,t),i=rr.createNode(e,void 0,t);return new Kt(n,i)}var Kt=class s{constructor(e,t=null){Object.defineProperty(this,Bt.NODE_TYPE,{value:Bt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Bt.isNode(t)&&(t=t.clone(e)),Bt.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return ic.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?nc.stringifyPair(this,e,t,n):JSON.stringify(this)}};Hs.Pair=Kt;Hs.createPair=rc});var Vs=y(ar=>{"use strict";var de=O(),or=xe(),jt=je();function oc(s,e,t){return(e.inFlow??s.flow?lc:ac)(s,e,t)}function ac({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null}),h=!1,u=[];for(let g=0;g<e.length;++g){let f=e[g],p=null;if(de.isNode(f))!h&&f.spaceBefore&&u.push(""),Ft(t,u,f.commentBefore,h),f.comment&&(p=f.comment);else if(de.isPair(f)){let S=de.isNode(f.key)?f.key:null;S&&(!h&&S.spaceBefore&&u.push(""),Ft(t,u,S.commentBefore,h))}h=!1;let b=or.stringify(f,d,()=>p=null,()=>h=!0);p&&(b+=jt.lineComment(b,r,c(p))),h&&p&&(h=!1),u.push(n+b)}let m;if(u.length===0)m=i.start+i.end;else{m=u[0];for(let g=1;g<u.length;++g){let f=u[g];m+=f?`
50
+ ${l}${f}`:`
51
+ `}}return s?(m+=`
52
+ `+jt.indentComment(c(s),l),a&&a()):h&&o&&o(),m}function lc({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,d=0,h=[];for(let g=0;g<s.length;++g){let f=s[g],p=null;if(de.isNode(f))f.spaceBefore&&h.push(""),Ft(e,h,f.commentBefore,!1),f.comment&&(p=f.comment);else if(de.isPair(f)){let S=de.isNode(f.key)?f.key:null;S&&(S.spaceBefore&&h.push(""),Ft(e,h,S.commentBefore,!1),S.comment&&(c=!0));let v=de.isNode(f.value)?f.value:null;v?(v.comment&&(p=v.comment),v.commentBefore&&(c=!0)):f.value==null&&S?.comment&&(p=S.comment)}p&&(c=!0);let b=or.stringify(f,l,()=>p=null);g<s.length-1&&(b+=","),p&&(b+=jt.lineComment(b,n,a(p))),!c&&(h.length>d||b.includes(`
53
+ `))&&(c=!0),h.push(b),d=h.length}let{start:u,end:m}=t;if(h.length===0)return u+m;if(!c){let g=h.reduce((f,p)=>f+p.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=u;for(let f of h)g+=f?`
54
+ ${r}${i}${f}`:`
55
+ `;return`${g}
56
+ ${i}${m}`}else return`${u}${o}${h.join(" ")}${o}${m}`}function Ft({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=jt.indentComment(e(n),s);t.push(r.trimStart())}}ar.stringifyCollection=oc});var re=y(Js=>{"use strict";var cc=Vs(),uc=Ys(),fc=qt(),ie=O(),Rt=ne(),hc=L();function Ve(s,e){let t=ie.isScalar(e)?e.value:e;for(let n of s)if(ie.isPair(n)&&(n.key===e||n.key===t||ie.isScalar(n.key)&&n.key.value===t))return n}var Gs=class extends fc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ie.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Rt.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;ie.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Rt.Pair(e,e?.value):n=new Rt.Pair(e.key,e.value);let i=Ve(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);ie.isScalar(i.value)&&hc.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(a=>r(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Ve(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Ve(this.items,e)?.value;return(!t&&ie.isScalar(i)?i.value:i)??void 0}has(e){return!!Ve(this.items,e)}set(e,t){this.add(new Rt.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)uc.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ie.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),cc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Js.YAMLMap=Gs;Js.findPair=Ve});var Ne=y(cr=>{"use strict";var dc=O(),lr=re(),pc={collection:"map",default:!0,nodeClass:lr.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return dc.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>lr.YAMLMap.from(s,e,t)};cr.map=pc});var oe=y(ur=>{"use strict";var mc=Ke(),gc=Vs(),yc=qt(),xt=O(),bc=L(),wc=Z(),Qs=class extends yc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(xt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ut(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Ut(e);if(typeof n!="number")return;let i=this.items[n];return!t&&xt.isScalar(i)?i.value:i}has(e){let t=Ut(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Ut(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];xt.isScalar(i)&&bc.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(wc.toJS(r,String(i++),t));return n}toString(e,t,n){return e?gc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(mc.createNode(a,void 0,n))}}return r}};function Ut(s){let e=xt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ur.YAMLSeq=Qs});var Oe=y(hr=>{"use strict";var Sc=O(),fr=oe(),vc={collection:"seq",default:!0,nodeClass:fr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Sc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>fr.YAMLSeq.from(s,e,t)};hr.seq=vc});var Ge=y(dr=>{"use strict";var kc=Ue(),Ac={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),kc.stringifyString(s,e,t,n)}};dr.string=Ac});var Yt=y(gr=>{"use strict";var pr=L(),mr={identify:s=>s==null,createNode:()=>new pr.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new pr.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&mr.test.test(s)?s:e.options.nullStr};gr.nullTag=mr});var Ws=y(br=>{"use strict";var Nc=L(),yr={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new Nc.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&yr.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};br.boolTag=yr});var Ee=y(wr=>{"use strict";function Oc({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}wr.stringifyNumber=Oc});var Xs=y(Ht=>{"use strict";var Ec=L(),zs=Ee(),qc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:zs.stringifyNumber},Cc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():zs.stringifyNumber(s)}},Lc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new Ec.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:zs.stringifyNumber};Ht.float=Lc;Ht.floatExp=Cc;Ht.floatNaN=qc});var en=y(Gt=>{"use strict";var Sr=Ee(),Vt=s=>typeof s=="bigint"||Number.isInteger(s),Zs=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function vr(s,e,t){let{value:n}=s;return Vt(n)&&n>=0?t+n.toString(e):Sr.stringifyNumber(s)}var Ic={identify:s=>Vt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Zs(s,2,8,t),stringify:s=>vr(s,8,"0o")},Tc={identify:Vt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Zs(s,0,10,t),stringify:Sr.stringifyNumber},Pc={identify:s=>Vt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Zs(s,2,16,t),stringify:s=>vr(s,16,"0x")};Gt.int=Tc;Gt.intHex=Pc;Gt.intOct=Ic});var Ar=y(kr=>{"use strict";var _c=Ne(),$c=Yt(),Mc=Oe(),Dc=Ge(),Bc=Ws(),tn=Xs(),sn=en(),Kc=[_c.map,Mc.seq,Dc.string,$c.nullTag,Bc.boolTag,sn.intOct,sn.int,sn.intHex,tn.floatNaN,tn.floatExp,tn.float];kr.schema=Kc});var Er=y(Or=>{"use strict";var jc=L(),Fc=Ne(),Rc=Oe();function Nr(s){return typeof s=="bigint"||Number.isInteger(s)}var Jt=({value:s})=>JSON.stringify(s),Uc=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Jt},{identify:s=>s==null,createNode:()=>new jc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Jt},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Jt},{identify:Nr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Nr(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Jt}],xc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Yc=[Fc.map,Rc.seq].concat(Uc,xc);Or.schema=Yc});var rn=y(qr=>{"use strict";var Je=yt("buffer"),nn=L(),Hc=Ue(),Vc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Je.Buffer=="function")return Je.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";let o=t,a;if(typeof Je.Buffer=="function")a=o instanceof Je.Buffer?o.toString("base64"):Je.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=nn.Scalar.BLOCK_LITERAL),e!==nn.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let h=0,u=0;h<c;++h,u+=l)d[h]=a.substr(u,l);a=d.join(e===nn.Scalar.BLOCK_LITERAL?`
57
+ `:" ")}return Hc.stringifyString({comment:s,type:e,value:a},n,i,r)}};qr.binary=Vc});var zt=y(Wt=>{"use strict";var Qt=O(),on=ne(),Gc=L(),Jc=oe();function Cr(s,e){if(Qt.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!Qt.isPair(n)){if(Qt.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new on.Pair(new Gc.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
58
+ ${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
59
+ ${r.comment}`:n.comment}n=i}s.items[t]=Qt.isPair(n)?n:new on.Pair(n)}}else e("Expected a sequence for this tag");return s}function Lr(s,e,t){let{replacer:n}=t,i=new Jc.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(on.createPair(a,l,t))}return i}var Qc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Cr,createNode:Lr};Wt.createPairs=Lr;Wt.pairs=Qc;Wt.resolvePairs=Cr});var cn=y(ln=>{"use strict";var Ir=O(),an=Z(),Qe=re(),Wc=oe(),Tr=zt(),pe=class s extends Wc.YAMLSeq{constructor(){super(),this.add=Qe.YAMLMap.prototype.add.bind(this),this.delete=Qe.YAMLMap.prototype.delete.bind(this),this.get=Qe.YAMLMap.prototype.get.bind(this),this.has=Qe.YAMLMap.prototype.has.bind(this),this.set=Qe.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(Ir.isPair(i)?(r=an.toJS(i.key,"",t),o=an.toJS(i.value,r,t)):r=an.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=Tr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};pe.tag="tag:yaml.org,2002:omap";var zc={collection:"seq",identify:s=>s instanceof Map,nodeClass:pe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Tr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)Ir.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pe,t)},createNode:(s,e,t)=>pe.from(s,e,t)};ln.YAMLOMap=pe;ln.omap=zc});var Dr=y(un=>{"use strict";var Pr=L();function _r({value:s,source:e},t){return e&&(s?$r:Mr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var $r={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Pr.Scalar(!0),stringify:_r},Mr={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Pr.Scalar(!1),stringify:_r};un.falseTag=Mr;un.trueTag=$r});var Br=y(Xt=>{"use strict";var Xc=L(),fn=Ee(),Zc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:fn.stringifyNumber},eu={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():fn.stringifyNumber(s)}},tu={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Xc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:fn.stringifyNumber};Xt.float=tu;Xt.floatExp=eu;Xt.floatNaN=Zc});var jr=y(ze=>{"use strict";var Kr=Ee(),We=s=>typeof s=="bigint"||Number.isInteger(s);function Zt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function hn(s,e,t){let{value:n}=s;if(We(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return Kr.stringifyNumber(s)}var su={identify:We,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Zt(s,2,2,t),stringify:s=>hn(s,2,"0b")},nu={identify:We,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Zt(s,1,8,t),stringify:s=>hn(s,8,"0")},iu={identify:We,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Zt(s,0,10,t),stringify:Kr.stringifyNumber},ru={identify:We,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Zt(s,2,16,t),stringify:s=>hn(s,16,"0x")};ze.int=iu;ze.intBin=su;ze.intHex=ru;ze.intOct=nu});var pn=y(dn=>{"use strict";var ss=O(),es=ne(),ts=re(),me=class s extends ts.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;ss.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new es.Pair(e.key,null):t=new es.Pair(e,null),ts.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=ts.findPair(this.items,e);return!t&&ss.isPair(n)?ss.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ts.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new es.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(es.createPair(o,null,n));return r}};me.tag="tag:yaml.org,2002:set";var ou={collection:"map",identify:s=>s instanceof Set,nodeClass:me,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>me.from(s,e,t),resolve(s,e){if(ss.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new me,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};dn.YAMLSet=me;dn.set=ou});var gn=y(ns=>{"use strict";var au=Ee();function mn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Fr(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return au.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var lu={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>mn(s,t),stringify:Fr},cu={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>mn(s,!1),stringify:Fr},Rr={identify:s=>s 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(s){let e=s.match(Rr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),d=e[8];if(d&&d!=="Z"){let h=mn(d,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ns.floatTime=cu;ns.intTime=lu;ns.timestamp=Rr});var Yr=y(xr=>{"use strict";var uu=Ne(),fu=Yt(),hu=Oe(),du=Ge(),pu=rn(),Ur=Dr(),yn=Br(),is=jr(),mu=Dt(),gu=cn(),yu=zt(),bu=pn(),bn=gn(),wu=[uu.map,hu.seq,du.string,fu.nullTag,Ur.trueTag,Ur.falseTag,is.intBin,is.intOct,is.int,is.intHex,yn.floatNaN,yn.floatExp,yn.float,pu.binary,mu.merge,gu.omap,yu.pairs,bu.set,bn.intTime,bn.floatTime,bn.timestamp];xr.schema=wu});var eo=y(vn=>{"use strict";var Jr=Ne(),Su=Yt(),Qr=Oe(),vu=Ge(),ku=Ws(),wn=Xs(),Sn=en(),Au=Ar(),Nu=Er(),Wr=rn(),Xe=Dt(),zr=cn(),Xr=zt(),Hr=Yr(),Zr=pn(),rs=gn(),Vr=new Map([["core",Au.schema],["failsafe",[Jr.map,Qr.seq,vu.string]],["json",Nu.schema],["yaml11",Hr.schema],["yaml-1.1",Hr.schema]]),Gr={binary:Wr.binary,bool:ku.boolTag,float:wn.float,floatExp:wn.floatExp,floatNaN:wn.floatNaN,floatTime:rs.floatTime,int:Sn.int,intHex:Sn.intHex,intOct:Sn.intOct,intTime:rs.intTime,map:Jr.map,merge:Xe.merge,null:Su.nullTag,omap:zr.omap,pairs:Xr.pairs,seq:Qr.seq,set:Zr.set,timestamp:rs.timestamp},Ou={"tag:yaml.org,2002:binary":Wr.binary,"tag:yaml.org,2002:merge":Xe.merge,"tag:yaml.org,2002:omap":zr.omap,"tag:yaml.org,2002:pairs":Xr.pairs,"tag:yaml.org,2002:set":Zr.set,"tag:yaml.org,2002:timestamp":rs.timestamp};function Eu(s,e,t){let n=Vr.get(e);if(n&&!s)return t&&!n.includes(Xe.merge)?n.concat(Xe.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(Vr.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Xe.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Gr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Gr).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}vn.coreKnownTags=Ou;vn.getTags=Eu});var Nn=y(to=>{"use strict";var kn=O(),qu=Ne(),Cu=Oe(),Lu=Ge(),os=eo(),Iu=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,An=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?os.getTags(e,"compat"):e?os.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?os.coreKnownTags:{},this.tags=os.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,kn.MAP,{value:qu.map}),Object.defineProperty(this,kn.SCALAR,{value:Lu.string}),Object.defineProperty(this,kn.SEQ,{value:Cu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Iu:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};to.Schema=An});var no=y(so=>{"use strict";var Tu=O(),On=xe(),Ze=je();function Pu(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=On.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(Ze.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(Tu.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let d=r(s.contents.commentBefore);t.push(Ze.indentComment(d,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=On.stringify(s.contents,i,()=>a=null,l);a&&(c+=Ze.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(On.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
60
+ `)?(t.push("..."),t.push(Ze.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ze.indentComment(r(l),"")))}return t.join(`
61
+ `)+`
62
+ `}so.stringifyDocument=Pu});var et=y(io=>{"use strict";var _u=Be(),qe=qt(),U=O(),$u=ne(),Mu=Z(),Du=Nn(),Bu=no(),En=At(),Ku=Ls(),ju=Ke(),qn=Cs(),Cn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,U.NODE_TYPE,{value:U.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new qn.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[U.NODE_TYPE]:{value:U.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=U.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ce(this.contents)&&this.contents.add(e)}addIn(e,t){Ce(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=En.anchorNames(this);e.anchor=!t||n.has(t)?En.findNewAnchor(t||"a",n):t}return new _u.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=S=>typeof S=="number"||S instanceof String||S instanceof Number,b=t.filter(p).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=n??{},{onAnchor:h,setAnchors:u,sourceObjects:m}=En.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:h,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},f=ju.createNode(e,d,g);return a&&U.isCollection(f)&&(f.flow=!0),u(),f}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new $u.Pair(i,r)}delete(e){return Ce(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ce(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return U.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return qe.isEmptyPath(e)?!t&&U.isScalar(this.contents)?this.contents.value:this.contents:U.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return U.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return qe.isEmptyPath(e)?this.contents!==void 0:U.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qe.collectionFromPath(this.schema,[e],t):Ce(this.contents)&&this.contents.set(e,t)}setIn(e,t){qe.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=qe.collectionFromPath(this.schema,Array.from(e),t):Ce(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new qn.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new qn.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Du.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Mu.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?Ku.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Bu.stringifyDocument(this,e)}};function Ce(s){if(U.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}io.Document=Cn});var nt=y(st=>{"use strict";var tt=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},Ln=class extends tt{constructor(e,t,n){super("YAMLParseError",e,t,n)}},In=class extends tt{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Fu=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
63
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
64
+
65
+ ${o}
66
+ ${c}
67
+ `}};st.YAMLError=tt;st.YAMLParseError=Ln;st.YAMLWarning=In;st.prettifyError=Fu});var it=y(ro=>{"use strict";function Ru(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,h="",u="",m=!1,g=!1,f=null,p=null,b=null,S=null,v=null,k=null,A=null;for(let w of s)switch(g&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),f&&(c&&w.type!=="comment"&&w.type!=="newline"&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),w.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&w.source.includes(" ")&&(f=w),d=!0;break;case"comment":{d||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=w.source.substring(1)||" ";h?h+=u+T:h=T,u="",c=!1;break}case"newline":c?h?h+=w.source:(!k||t!=="seq-item-ind")&&(l=!0):u+=w.source,c=!0,m=!0,(p||b)&&(S=w),d=!0;break;case"anchor":p&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=w,A??(A=w.offset),c=!1,d=!1,g=!0;break;case"tag":{b&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),b=w,A??(A=w.offset),c=!1,d=!1,g=!0;break}case t:(p||b)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),k&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),k=w,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){v&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=w,c=!1,d=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,d=!1}let N=s[s.length-1],C=N?N.offset+N.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(c&&f.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:k,spaceBefore:l,comment:h,hasNewline:m,anchor:p,tag:b,newlineAfterProp:S,end:C,start:A??C}}ro.resolveProps=Ru});var as=y(oo=>{"use strict";function Tn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
68
+ `))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Tn(e.key)||Tn(e.value))return!0}return!1;default:return!0}}oo.containsNewline=Tn});var Pn=y(ao=>{"use strict";var Uu=as();function xu(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Uu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ao.flowIndentCheck=xu});var _n=y(co=>{"use strict";var lo=O();function Yu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||lo.isScalar(r)&&lo.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}co.mapIncludes=Yu});var go=y(mo=>{"use strict";var uo=ne(),Hu=re(),fo=it(),Vu=as(),ho=Pn(),Gu=_n(),po="All mapping items must start at the same column";function Ju({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Hu.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let d of n.items){let{start:h,key:u,sep:m,value:g}=d,f=fo.resolveProps(h,{indicator:"explicit-key-ind",next:u??m?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!f.found;if(p){if(u&&(u.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&i(l,"BAD_INDENT",po)),!f.anchor&&!f.tag&&!m){c=f.end,f.comment&&(a.comment?a.comment+=`
69
+ `+f.comment:a.comment=f.comment);continue}(f.newlineAfterProp||Vu.containsNewline(u))&&i(u??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else f.found?.indent!==n.indent&&i(l,"BAD_INDENT",po);t.atKey=!0;let b=f.end,S=u?s(t,u,f,i):e(t,b,h,null,f,i);t.schema.compat&&ho.flowIndentCheck(n.indent,u,i),t.atKey=!1,Gu.mapIncludes(t,a.items,S)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let v=fo.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=v.end,v.found){p&&(g?.type==="block-map"&&!v.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&f.start<v.found.offset-1024&&i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let k=g?s(t,g,v,i):e(t,l,m,null,v,i);t.schema.compat&&ho.flowIndentCheck(n.indent,g,i),l=k.range[2];let A=new uo.Pair(S,k);t.options.keepSourceTokens&&(A.srcToken=d),a.items.push(A)}else{p&&i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(S.comment?S.comment+=`
70
+ `+v.comment:S.comment=v.comment);let k=new uo.Pair(S);t.options.keepSourceTokens&&(k.srcToken=d),a.items.push(k)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}mo.resolveBlockMap=Ju});var bo=y(yo=>{"use strict";var Qu=oe(),Wu=it(),zu=Pn();function Xu({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Qu.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:d,value:h}of n.items){let u=Wu.resolveProps(d,{indicator:"seq-item-ind",next:h,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||h)h?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(a.comment=u.comment);continue}let m=h?s(t,h,u,i):e(t,u.end,d,null,u,i);t.schema.compat&&zu.flowIndentCheck(n.indent,h,i),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}yo.resolveBlockSeq=Xu});var Le=y(wo=>{"use strict";function Zu(s,e,t,n){let i="";if(s){let r=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}wo.resolveEnd=Zu});var Ao=y(ko=>{"use strict";var ef=O(),tf=ne(),So=re(),sf=oe(),nf=Le(),vo=it(),rf=as(),of=_n(),$n="Block collections are not allowed within flow collections",Mn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function af({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?So.YAMLMap:sf.YAMLSeq),c=new l(t.schema);c.flow=!0;let d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let h=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let b=n.items[p],{start:S,key:v,sep:k,value:A}=b,N=vo.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:v??k?.[0],offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!k&&!A){p===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<n.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(c.comment?c.comment+=`
71
+ `+N.comment:c.comment=N.comment),h=N.end;continue}!o&&t.options.strict&&rf.containsNewline(v)&&i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let C="";e:for(let w of S)switch(w.type){case"comma":case"space":break;case"comment":C=w.source.substring(1);break e;default:break e}if(C){let w=c.items[c.items.length-1];ef.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
72
+ `+C:w.comment=C,N.comment=N.comment.substring(C.length+1)}}if(!o&&!k&&!N.found){let C=A?s(t,A,N,i):e(t,N.end,k,null,N,i);c.items.push(C),h=C.range[2],Mn(A)&&i(C.range,"BLOCK_IN_FLOW",$n)}else{t.atKey=!0;let C=N.end,w=v?s(t,v,N,i):e(t,C,S,null,N,i);Mn(v)&&i(w.range,"BLOCK_IN_FLOW",$n),t.atKey=!1;let T=vo.resolveProps(k??[],{flow:a,indicator:"map-value-ind",next:A,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(T.found){if(!o&&!N.found&&t.options.strict){if(k)for(let P of k){if(P===T.found)break;if(P.type==="newline"){i(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<T.found.offset-1024&&i(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${a}`):i(T.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let X=A?s(t,A,T,i):T.found?e(t,T.end,k,null,T,i):null;X?Mn(A)&&i(X.range,"BLOCK_IN_FLOW",$n):T.comment&&(w.comment?w.comment+=`
73
+ `+T.comment:w.comment=T.comment);let we=new tf.Pair(w,X);if(t.options.keepSourceTokens&&(we.srcToken=b),o){let P=c;of.mapIncludes(t,P.items,w)&&i(C,"DUPLICATE_KEY","Map keys must be unique"),P.items.push(we)}else{let P=new So.YAMLMap(t.schema);P.flow=!0,P.items.push(we);let wi=(X??w).range;P.range=[w.range[0],wi[1],wi[2]],c.items.push(P)}h=X?X.range[2]:T.end}}let u=o?"}":"]",[m,...g]=n.end,f=h;if(m?.source===u)f=m.offset+m.source.length;else{let p=a[0].toUpperCase()+a.substring(1),b=d?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(h,d?"MISSING_CHAR":"BAD_INDENT",b),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let p=nf.resolveEnd(g,f,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
74
+ `+p.comment:c.comment=p.comment),c.range=[n.offset,f,p.offset]}else c.range=[n.offset,f,f];return c}ko.resolveFlowCollection=af});var Oo=y(No=>{"use strict";var lf=O(),cf=L(),uf=re(),ff=oe(),hf=go(),df=bo(),pf=Ao();function Dn(s,e,t,n,i,r){let o=t.type==="block-map"?hf.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?df.resolveBlockSeq(s,e,t,n,r):pf.resolveFlowCollection(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function mf(s,e,t,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){let{anchor:u,newlineAfterProp:m}=n,g=u&&r?u.offset>r.offset?u:r:u??r;g&&(!m||m.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===uf.YAMLMap.tagName&&a==="map"||o===ff.YAMLSeq.tagName&&a==="seq")return Dn(s,e,t,i,o);let l=e.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!l){let u=e.schema.knownTags[o];if(u?.collection===a)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Dn(s,e,t,i,o)}let c=Dn(s,e,t,i,o,l),d=l.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,h=lf.isNode(d)?d:new cf.Scalar(d);return h.range=c.range,h.tag=o,l?.format&&(h.format=l.format),h}No.composeCollection=mf});var Kn=y(Eo=>{"use strict";var Bn=L();function gf(s,e,t){let n=e.offset,i=yf(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?Bn.Scalar.BLOCK_FOLDED:Bn.Scalar.BLOCK_LITERAL,o=e.source?bf(e.source):[],a=o.length;for(let f=o.length-1;f>=0;--f){let p=o[f][1];if(p===""||p==="\r")a=f;else break}if(a===0){let f=i.chomp==="+"&&o.length>0?`
75
+ `.repeat(Math.max(1,o.length-1)):"",p=n+i.length;return e.source&&(p+=e.source.length),{value:f,type:r,comment:i.comment,range:[n,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,d=0;for(let f=0;f<a;++f){let[p,b]=o[f];if(b===""||b==="\r")i.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=p.length),d=f,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+b.length+1}for(let f=o.length-1;f>=a;--f)o[f][0].length>l&&(a=f+1);let h="",u="",m=!1;for(let f=0;f<d;++f)h+=o[f][0].slice(l)+`
76
+ `;for(let f=d;f<a;++f){let[p,b]=o[f];c+=p.length+b.length+1;let S=b[b.length-1]==="\r";if(S&&(b=b.slice(0,-1)),b&&p.length<l){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(S?2:1),"BAD_INDENT",k),p=""}r===Bn.Scalar.BLOCK_LITERAL?(h+=u+p.slice(l)+b,u=`
77
+ `):p.length>l||b[0]===" "?(u===" "?u=`
78
+ `:!m&&u===`
79
+ `&&(u=`
80
+
81
+ `),h+=u+p.slice(l)+b,u=`
82
+ `,m=!0):b===""?u===`
83
+ `?h+=`
84
+ `:u=`
85
+ `:(h+=u+b,u=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let f=a;f<o.length;++f)h+=`
86
+ `+o[f][0].slice(l);h[h.length-1]!==`
87
+ `&&(h+=`
88
+ `);break;default:h+=`
89
+ `}let g=n+i.length+e.source.length;return{value:h,type:r,comment:i.comment,range:[n,g,g]}}function yf({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let u=1;u<i.length;++u){let m=i[u];if(!a&&(m==="-"||m==="+"))a=m;else{let g=Number(m);!o&&g?o=g:l===-1&&(l=s+u)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",h=i.length;for(let u=1;u<e.length;++u){let m=e[u];switch(m.type){case"space":c=!0;case"newline":h+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=m.source.length,d=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),h+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",g);let f=m.source;f&&typeof f=="string"&&(h+=f.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:h}}function bf(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}Eo.resolveBlockScalar=gf});var Fn=y(Co=>{"use strict";var jn=L(),wf=Le();function Sf(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(u,m,g)=>t(n+u,m,g);switch(i){case"scalar":a=jn.Scalar.PLAIN,l=vf(r,c);break;case"single-quoted-scalar":a=jn.Scalar.QUOTE_SINGLE,l=kf(r,c);break;case"double-quoted-scalar":a=jn.Scalar.QUOTE_DOUBLE,l=Af(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let d=n+r.length,h=wf.resolveEnd(o,d,e,t);return{value:l,type:a,comment:h.comment,range:[n,d,h.offset]}}function vf(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),qo(s)}function kf(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),qo(s.slice(1,-1)).replace(/''/g,"'")}function qo(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
90
+ `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
91
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?r===`
92
+ `?i+=r:r=`
93
+ `:(i+=r+n[1],r=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),i+r+(n?.[1]??"")}function Af(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
94
+ `))if(i===`
95
+ `){let{fold:r,offset:o}=Nf(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n],o=Of[r];if(o)t+=o;else if(r===`
96
+ `)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
97
+ `)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];t+=Ef(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
98
+ `&&!(o==="\r"&&s[n+2]===`
99
+ `)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function Nf(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
100
+ `||n==="\r")&&!(n==="\r"&&s[e+2]!==`
101
+ `);)n===`
102
+ `&&(t+=`
103
+ `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var Of={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
104
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ef(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}Co.resolveFlowScalar=Sf});var To=y(Io=>{"use strict";var ge=O(),Lo=L(),qf=Kn(),Cf=Fn();function Lf(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?qf.resolveBlockScalar(s,e,n):Cf.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,h=>n(t,"TAG_RESOLVE_FAILED",h)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[ge.SCALAR]:l?c=If(s.schema,i,l,t,n):e.type==="scalar"?c=Tf(s,i,e,n):c=s.schema[ge.SCALAR];let d;try{let h=c.resolve(i,u=>n(t??e,"TAG_RESOLVE_FAILED",u),s.options);d=ge.isScalar(h)?h:new Lo.Scalar(h)}catch(h){let u=h instanceof Error?h.message:String(h);n(t??e,"TAG_RESOLVE_FAILED",u),d=new Lo.Scalar(i)}return d.range=a,d.source=i,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function If(s,e,t,n,i){if(t==="!")return s[ge.SCALAR];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[ge.SCALAR])}function Tf({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[ge.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[ge.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}Io.composeScalar=Lf});var _o=y(Po=>{"use strict";function Pf(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}Po.emptyScalarPosition=Pf});var Do=y(Un=>{"use strict";var _f=Be(),$f=O(),Mf=Oo(),$o=To(),Df=Le(),Bf=_o(),Kf={composeNode:Mo,composeEmptyNode:Rn};function Mo(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,d=!0;switch(e.type){case"alias":c=jf(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=$o.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Mf.composeCollection(Kf,s,e,t,n),a&&(c.anchor=a.source.substring(1));break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),c=Rn(s,e.offset,void 0,null,t,n),d=!1}}return a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!$f.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&d&&(c.srcToken=e),c}function Rn(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let d={type:"scalar",offset:Bf.emptyScalarPosition(e,t,n),indent:-1,source:""},h=$o.composeScalar(s,d,a,c);return o&&(h.anchor=o.source.substring(1),h.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),r&&(h.comment=r,h.range[2]=l),h}function jf({options:s},{offset:e,source:t,end:n},i){let r=new _f.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Df.resolveEnd(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Un.composeEmptyNode=Rn;Un.composeNode=Mo});var jo=y(Ko=>{"use strict";var Ff=et(),Bo=Do(),Rf=Le(),Uf=it();function xf(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new Ff.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Uf.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Bo.composeNode(c,i,d,o):Bo.composeEmptyNode(c,d.end,n,null,d,o);let h=l.contents.range[2],u=Rf.resolveEnd(r,h,!1,o);return u.comment&&(l.comment=u.comment),l.range=[t,h,u.offset],l}Ko.composeDoc=xf});var Yn=y(Uo=>{"use strict";var Yf=yt("process"),Hf=Cs(),Vf=et(),rt=nt(),Fo=O(),Gf=jo(),Jf=Le();function ot(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Ro(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
105
+
106
+ `:`
107
+ `)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var xn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=ot(t);r?this.warnings.push(new rt.YAMLWarning(o,n,i)):this.errors.push(new rt.YAMLParseError(o,n,i))},this.directives=new Hf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=Ro(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
108
+ ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(Fo.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Fo.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
109
+ ${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
110
+ ${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ro(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(Yf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=ot(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Gf.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new rt.YAMLParseError(ot(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new rt.YAMLParseError(ot(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Jf.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
111
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new rt.YAMLParseError(ot(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Vf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};Uo.Composer=xn});var Ho=y(ls=>{"use strict";var Qf=Kn(),Wf=Fn(),zf=nt(),xo=Ue();function Xf(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new zf.YAMLParseError([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Wf.resolveFlowScalar(s,e,n);case"block-scalar":return Qf.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Zf(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=xo.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
112
+ `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
113
+ `),d=a.substring(0,c),h=a.substring(c+1)+`
114
+ `,u=[{type:"block-scalar-header",offset:r,indent:n,source:d}];return Yo(u,l)||u.push({type:"newline",offset:-1,indent:n,source:`
115
+ `}),{type:"block-scalar",offset:r,indent:n,props:u,source:h}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function eh(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=xo.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":th(s,l);break;case'"':Hn(s,l,"double-quoted-scalar");break;case"'":Hn(s,l,"single-quoted-scalar");break;default:Hn(s,l,"scalar")}}function th(s,e){let t=e.indexOf(`
116
+ `),n=e.substring(0,t),i=e.substring(t+1)+`
117
+ `;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Yo(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
118
+ `});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function Yo(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function Hn(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
119
+ `};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}ls.createScalarToken=Zf;ls.resolveAsScalar=Xf;ls.setScalarValue=eh});var Go=y(Vo=>{"use strict";var sh=s=>"type"in s?us(s):cs(s);function us(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=us(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=cs(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=cs(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=cs(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function cs({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=us(e)),t)for(let r of t)i+=r.source;return n&&(i+=us(n)),i}Vo.stringify=sh});var zo=y(Wo=>{"use strict";var Vn=Symbol("break visit"),nh=Symbol("skip children"),Jo=Symbol("remove item");function ye(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Qo(Object.freeze([]),s,e)}ye.BREAK=Vn;ye.SKIP=nh;ye.REMOVE=Jo;ye.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};ye.parentCollection=(s,e)=>{let t=ye.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Qo(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Qo(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Vn)return Vn;a===Jo&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Wo.visit=ye});var fs=y(F=>{"use strict";var Gn=Ho(),ih=Go(),rh=zo(),Jn="\uFEFF",Qn="",Wn="",zn="",oh=s=>!!s&&"items"in s,ah=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function lh(s){switch(s){case Jn:return"<BOM>";case Qn:return"<DOC>";case Wn:return"<FLOW_END>";case zn:return"<SCALAR>";default:return JSON.stringify(s)}}function ch(s){switch(s){case Jn:return"byte-order-mark";case Qn:return"doc-mode";case Wn:return"flow-error-end";case zn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
120
+ `:case`\r
121
+ `: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(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}F.createScalarToken=Gn.createScalarToken;F.resolveAsScalar=Gn.resolveAsScalar;F.setScalarValue=Gn.setScalarValue;F.stringify=ih.stringify;F.visit=rh.visit;F.BOM=Jn;F.DOCUMENT=Qn;F.FLOW_END=Wn;F.SCALAR=zn;F.isCollection=oh;F.isScalar=ah;F.prettyToken=lh;F.tokenType=ch});var ei=y(Zo=>{"use strict";var at=fs();function H(s){switch(s){case void 0:case" ":case`
122
+ `:case"\r":case" ":return!0;default:return!1}}var Xo=new Set("0123456789ABCDEFabcdef"),uh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),hs=new Set(",[]{}"),fh=new Set(` ,[]{}
123
+ \r `),Xn=s=>!s||fh.has(s),Zn=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
124
+ `?!0:t==="\r"?this.buffer[e+1]===`
125
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
126
+ `||!i&&!this.atEnd)return e+n+1}return t===`
127
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&H(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
128
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===at.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield at.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&H(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!H(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&H(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Xn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&H(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield at.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Xn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||H(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
129
+ `,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
130
+ `,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>H(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
131
+ `:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
132
+ `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
133
+ `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
134
+ `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
135
+ `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield at.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(H(r)||e&&hs.has(r))break;t=n}else if(H(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
136
+ `?(n+=1,i=`
137
+ `,r=this.buffer[n+1]):t=n),r==="#"||e&&hs.has(r))break;if(i===`
138
+ `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&hs.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield at.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Xn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(H(t)||e&&hs.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!H(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(uh.has(t))t=this.buffer[++e];else if(t==="%"&&Xo.has(this.buffer[e+1])&&Xo.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
139
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
140
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Zo.Lexer=Zn});var si=y(ea=>{"use strict";var ti=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};ea.LineCounter=ti});var ii=y(ra=>{"use strict";var hh=yt("process"),ta=fs(),dh=ei();function ae(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function sa(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ia(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ds(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function Ie(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function na(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!ae(e.start,"explicit-key-ind")&&!ae(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ia(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var ni=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new dh.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,hh.env.LOG_TOKENS&&console.log("|",ta.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=ta.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&na(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&sa(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{sa(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=ds(this.peek(2)),n=Ie(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
141
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
142
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ae(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ia(t.key)&&!ae(t.sep,"newline")){let o=Ie(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ae(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Ie(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ae(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ae(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ae(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=ds(n),r=Ie(i);na(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
143
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
144
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=ds(e),n=Ie(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ds(e),n=Ie(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ra.Parser=ni});var ua=y(ct=>{"use strict";var oa=Yn(),ph=et(),lt=nt(),mh=Rs(),gh=O(),yh=si(),aa=ii();function la(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new yh.LineCounter||null,prettyErrors:e}}function bh(s,e={}){let{lineCounter:t,prettyErrors:n}=la(e),i=new aa.Parser(t?.addNewLine),r=new oa.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(lt.prettifyError(s,t)),a.warnings.forEach(lt.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ca(s,e={}){let{lineCounter:t,prettyErrors:n}=la(e),i=new aa.Parser(t?.addNewLine),r=new oa.Composer(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new lt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(lt.prettifyError(s,t)),o.warnings.forEach(lt.prettifyError(s,t))),o}function wh(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ca(s,t);if(!i)return null;if(i.warnings.forEach(r=>mh.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Sh(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return gh.isDocument(s)&&!n?s.toString(t):new ph.Document(s,n,t).toString(t)}ct.parse=wh;ct.parseAllDocuments=bh;ct.parseDocument=ca;ct.stringify=Sh});var ms=y(E=>{"use strict";var vh=Yn(),kh=et(),Ah=Nn(),ri=nt(),Nh=Be(),le=O(),Oh=ne(),Eh=L(),qh=re(),Ch=oe(),Lh=fs(),Ih=ei(),Th=si(),Ph=ii(),ps=ua(),fa=_e();E.Composer=vh.Composer;E.Document=kh.Document;E.Schema=Ah.Schema;E.YAMLError=ri.YAMLError;E.YAMLParseError=ri.YAMLParseError;E.YAMLWarning=ri.YAMLWarning;E.Alias=Nh.Alias;E.isAlias=le.isAlias;E.isCollection=le.isCollection;E.isDocument=le.isDocument;E.isMap=le.isMap;E.isNode=le.isNode;E.isPair=le.isPair;E.isScalar=le.isScalar;E.isSeq=le.isSeq;E.Pair=Oh.Pair;E.Scalar=Eh.Scalar;E.YAMLMap=qh.YAMLMap;E.YAMLSeq=Ch.YAMLSeq;E.CST=Lh;E.Lexer=Ih.Lexer;E.LineCounter=Th.LineCounter;E.Parser=Ph.Parser;E.parse=ps.parse;E.parseAllDocuments=ps.parseAllDocuments;E.parseDocument=ps.parseDocument;E.stringify=ps.stringify;E.visit=fa.visit;E.visitAsync=fa.visitAsync});var Ea={};fe(Ea,{runWizard:()=>Oa});import{createInterface as _h}from"node:readline";import{readFileSync as dt,writeFileSync as ka,existsSync as x,readdirSync as $h}from"node:fs";import{execFileSync as R}from"node:child_process";import{resolve as ut,join as I}from"node:path";import{MongoClient as Aa}from"mongodb";function q(s,e=""){let t=e?`${s} [${e}]: `:`${s}: `;return new Promise(n=>{oi.question(t,i=>{n(i.trim()||e)})})}async function D(s,e=!0){return(await q(`${s} (${e?"Y/n":"y/N"})`,e?"y":"n")).toLowerCase().startsWith("y")}function Mh(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 Hive Setup Wizard \u2551"),console.log("\u2551 Multi-Agent Slack Orchestration Framework \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("")}function V(s){console.log(""),console.log(`\u2500\u2500 ${s} ${"\u2500".repeat(Math.max(0,44-s.length))}`),console.log("")}function Na(){if(!x(gs))return{};let s={};for(let e of dt(gs,"utf-8").split(`
145
+ `)){let t=e.trim();if(!t||t.startsWith("#"))continue;let n=t.indexOf("=");if(n===-1)continue;let i=t.slice(0,n),r=t.slice(n+1);s[i]=r}return s}function ft(s){let e=["# Hive environment \u2014 generated by setup wizard","# Secrets and API keys. Do not commit this file.",""],t=[{header:"# Slack",keys:["SLACK_APP_TOKEN","SLACK_BOT_TOKEN","SLACK_MCP_TOKEN"]},{header:"# Anthropic",keys:["ANTHROPIC_API_KEY"]},{header:"# SMS (Quo/OpenPhone)",keys:["QUO_API_KEY","QUO_PHONE_NUMBER_ID"]},{header:"# Google",keys:["GOOGLE_ACCOUNT"]},{header:"# Project Management",keys:["LINEAR_API_KEY","CLICKUP_API_TOKEN"]},{header:"# External Communications",keys:["EXTERNAL_COMMS_ENABLED"]}],n=new Set;for(let i of t){let r=[];for(let o of i.keys){n.add(o);let a=s[o];a?r.push(`${o}=${a}`):r.push(`# ${o}=`)}r.some(o=>!o.startsWith("#"))&&(e.push(i.header),e.push(...r),e.push(""))}for(let[i,r]of Object.entries(s))!n.has(i)&&r&&e.push(`${i}=${r}`);ka(gs,e.join(`
146
+ `)+`
147
+ `)}function Dh(){return x(ys)?(0,pt.parse)(dt(ys,"utf-8"))??{}:{}}function ht(s){ka(ys,(0,pt.stringify)(s))}function ha(s){return!!(s.business?.name&&s.business?.owner?.name)}function da(s){return!!(s.SLACK_APP_TOKEN&&s.SLACK_BOT_TOKEN)}async function pa(){try{let s=new Aa(process.env.MONGODB_URI??"mongodb://localhost:27017");await s.connect();let t=await s.db(process.env.MONGODB_DB??"hive").collection("agent_definitions").findOne({_id:"chief-of-staff"});return await s.close(),!!t}catch{return!1}}function ma(s){return x(ut(import.meta.dirname,"..","pkg","server.min.js"))?!0:x(ut(s,"dist","index.js"))}async function Oa(s=K,e=ut(K,"setup","templates")){gs=I(s,".env"),ys=I(s,"hive.yaml"),Mh();let t=Na(),n=Dh(),i=[];if(ha(n)&&i.push("Business info"),da(t)&&i.push("Slack"),await pa()&&i.push("Agent setup"),ma(s)&&i.push("Build"),i.length>0){console.log("Resuming setup. Already completed:");for(let u of i)console.log(` \u2713 ${u}`);console.log("")}else console.log("This wizard will configure Hive for your business."),console.log("Progress is saved after each section \u2014 you can quit and resume anytime."),console.log(""),await q("Press Enter to begin...");if(ha(n)?(console.log(`Business: ${n.business.name} (${n.business.owner.name}, ${n.business.owner.role})`),await D("Redo business info?",!1)?await ga(n):console.log(" \u2713 Skipped")):await ga(n),da(t)?(console.log("Slack: \u2713 tokens configured"),await D("Redo Slack setup?",!1)?await ya(t):console.log(" \u2713 Skipped")):await ya(t),V("Anthropic"),t.ANTHROPIC_API_KEY?(console.log("Anthropic API key: \u2713 configured"),await D("Change it?",!1)?await ba(t):console.log(" \u2713 Skipped")):(console.log("Your Claude CLI session is already authenticated \u2014 Hive's Agent SDK"),console.log("will use that automatically. No API key needed."),console.log(""),await D("Use a separate API key instead?",!1)?await ba(t):(console.log(" \u2713 Using existing Claude authentication"),ft(t))),V("Optional Integrations"),console.log(`These can be added later. Press Enter to skip any.
148
+ `),await D("Enable SMS via Quo (OpenPhone)?",!1)){console.log("Get your API key from: Quo workspace settings \u2192 API tab"),t.QUO_API_KEY=await q("Quo API Key",t.QUO_API_KEY||""),t.QUO_PHONE_NUMBER_ID=await q("Default Phone Number ID (PNxxx)",t.QUO_PHONE_NUMBER_ID||"");let u=[],m={};if(await D("Configure named phone lines?",!1)){let f=!0;for(;f;){let p=await q("Line name (e.g. main, personal)"),b=await q("Phone Number ID (PNxxx)"),S=await q("Phone number (e.g. (555) 123-4567)"),v=await q("Label (e.g. Jane's Line)"),k=await q("Slack channel for incoming SMS",`sms-${p}`);m[p]={id:b,number:S,label:v},u.push({id:b,label:v,number:S,slackChannel:k}),f=await D("Add another line?",!1)}}u.length>0&&(n.sms={lines:u}),Object.keys(m).length>0&&(n.quo={lines:m})}if(await D("Enable Google Gmail/Calendar integration?",!1)){let u=!1;try{R("which",["gog"],{stdio:"pipe"}),u=!0,console.log(" \u2713 gog CLI found")}catch{console.log(" gog CLI not found. Installing via Homebrew...");try{R("brew",["install","gog"],{stdio:"inherit"}),u=!0,console.log(" \u2713 gog CLI installed")}catch{console.log(" \u26A0 Failed to install gog. Install manually: brew install gog")}}if(u){try{let g=R("gog",["auth","list"],{encoding:"utf-8",stdio:"pipe"}).trim();g&&!g.includes("no accounts")&&(console.log(`
149
+ Authenticated accounts:`),console.log(` ${g.replace(/\n/g,`
150
+ `)}`))}catch{}if(console.log(""),await D("Authenticate a Google account now?",!0)){let g=!0;for(;g;){let f=await q("Google account email");console.log(`
151
+ Opening browser for ${f}...`),console.log(` Complete the OAuth flow in your browser, then come back here.
152
+ `);try{R("gog",["auth","add",f],{stdio:"inherit"}),console.log(` \u2713 ${f} authenticated`)}catch{console.log(` \u26A0 Authentication failed for ${f}. You can retry later: gog auth add ${f}`)}g=await D("Authenticate another Google account?",!1)}}if(t.GOOGLE_ACCOUNT=await q("Primary Google account for Hive",t.GOOGLE_ACCOUNT||""),t.GOOGLE_ACCOUNT)try{R("gog",["gmail","search","is:unread","-a",t.GOOGLE_ACCOUNT,"--json","--results-only","--no-input"],{encoding:"utf-8",timeout:15e3}),console.log(` \u2713 Gmail access verified for ${t.GOOGLE_ACCOUNT}`)}catch{console.log(" \u26A0 Could not verify Gmail access \u2014 check authentication later")}}}if(await D("Enable project management integration?",!1)){let u=await q("Which system? (linear / clickup)","");u.toLowerCase().startsWith("l")?(t.LINEAR_API_KEY=await q("Linear API Key",t.LINEAR_API_KEY||""),console.log(" Get it from: Linear \u2192 Settings \u2192 API \u2192 Personal API Keys")):u.toLowerCase().startsWith("c")?(t.CLICKUP_API_TOKEN=await q("ClickUp API Token",t.CLICKUP_API_TOKEN||""),console.log(" Get it from: ClickUp \u2192 Settings \u2192 Apps \u2192 API Token")):console.log(" Skipped \u2014 you can configure this in .env later.")}ft(t),ht(n),console.log(`
153
+ \u2713 Configuration saved (.env + hive.yaml)`),V("Plugins");let l=I(s,"plugins");if(x(l)){let u=$h(l).filter(m=>x(I(l,m,"plugin.yaml")));if(u.length>0){console.log(`Available plugins:
154
+ `);for(let f of u){let p=(0,pt.parse)(dt(I(l,f,"plugin.yaml"),"utf-8"));console.log(` ${f} \u2014 ${p.description??"(no description)"}`)}console.log("");let m=(n.plugins??[]).join(", ")||"none",g=await q("Which plugins to enable? (comma-separated, or 'none')",m);g.toLowerCase()!=="none"?n.plugins=g.split(",").map(f=>f.trim()).filter(Boolean):n.plugins=[]}else console.log("No plugins found in plugins/ directory."),n.plugins=[]}else console.log("No plugins/ directory found."),n.plugins=[];ht(n),await pa()?(console.log(`
155
+ Chief of Staff agent: \u2713 already set up`),await D("Regenerate agent from template?",!1)?await wa(n):console.log(" \u2713 Skipped")):await wa(n),await Bh(n),V("Memory (MongoDB)"),await Kh(n,e),V("Build"),ma(s)?(console.log("Build output exists."),await D("Rebuild?",!0)?await Sa():console.log(" \u2713 Skipped")):await Sa(),V("Deploy");let c=I(process.env.HOME??"/tmp","services","hive");if(x(I(c,"package.json"))?(console.log(`Deploy directory exists: ${c}`),await D("Sync latest build and config?",!0)?await va(c):console.log(" \u2713 Skipped")):(console.log("Hive runs from a separate deploy directory (not this dev repo)."),console.log(` Dev: ${K}`),console.log(` Deploy: ${c}`),console.log(""),await D("Set up the deploy directory now?",!0)&&await va(c)),V("Service"),await D("Install Hive as a LaunchAgent (starts on login)?"))try{R("bash",["service/install.sh"],{cwd:K,stdio:"inherit",env:{...process.env,HIVE_DEPLOY_DIR:c}})}catch{console.log(" \u26A0 Service installation failed \u2014 you can start manually:"),console.log(` cd ${c} && npm start`)}console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 Hive is ready! \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("Quick reference:"),console.log(` Deploy dir: ${c}`),console.log(` Start: cd ${c} && npm start`),console.log(` Logs: tail -f ${c}/logs/hive.log`),console.log(` Dev mode: npm run dev (from ${K})`),console.log(` Redeploy: bash ${K}/service/deploy.sh`),console.log(""),console.log("Your chief-of-staff agent is stored in the agent_definitions collection."),console.log("Additional agents can be created through the chief of staff."),console.log(""),oi.close()}async function ga(s){V("Your Business");let e=await q("Business name",s.business?.name||""),t=await q("What does your business do? (one sentence)",s.business?.description||""),n=await q("Location (city, state)",s.business?.location||""),i=await q("Timezone (e.g. America/New_York)",s.business?.timezone||""),r=await q("Business hours (e.g. 9 AM - 5 PM)",s.business?.businessHours||"9 AM - 5 PM"),o=await q("Your name",s.business?.owner?.name||""),a=await q("Your role",s.business?.owner?.role||"CEO");s.business={name:e,description:t,...n?{location:n}:{},...i?{timezone:i}:{},businessHours:r,owner:{name:o,role:a}},ht(s),console.log(`
156
+ \u2713 Business info saved (hive.yaml)`)}async function ya(s){if(V("Slack App Setup"),console.log("You need a Slack app with Socket Mode enabled."),console.log(""),console.log("1. Go to: https://api.slack.com/apps"),console.log('2. Click "Create New App" \u2192 "From a manifest"'),console.log("3. Select your workspace"),console.log("4. Choose YAML format and paste this manifest:"),console.log(""),console.log("\u2500\u2500\u2500 Copy everything below this line \u2500\u2500\u2500"),console.log(dt(I(K,"setup","slack-manifest.yaml"),"utf-8")),console.log("\u2500\u2500\u2500 Copy everything above this line \u2500\u2500\u2500"),console.log(""),console.log('5. Click "Create"'),console.log('6. Go to "Install App" \u2192 Install to workspace'),console.log(""),await q("Press Enter when your app is created and installed..."),console.log(""),console.log("Now collect your tokens:"),console.log(""),console.log('App-Level Token: Go to "Basic Information" \u2192 "App-Level Tokens"'),console.log(' \u2192 "Generate Token and Scopes" \u2192 add scope "connections:write"'),s.SLACK_APP_TOKEN=await q("App-Level Token (xapp-...)",s.SLACK_APP_TOKEN||""),console.log(""),console.log('Bot Token: Go to "OAuth & Permissions" \u2192 "Bot User OAuth Token"'),s.SLACK_BOT_TOKEN=await q("Bot Token (xoxb-...)",s.SLACK_BOT_TOKEN||""),console.log(""),await D("Do you have a Slack MCP user token (xoxp-...)? (for Slack search)",!1)&&(s.SLACK_MCP_TOKEN=await q("Slack MCP Token (xoxp-...)",s.SLACK_MCP_TOKEN||"")),s.SLACK_APP_TOKEN&&s.SLACK_BOT_TOKEN)try{let t=R("curl",["-s","-H",`Authorization: Bearer ${s.SLACK_BOT_TOKEN}`,"https://slack.com/api/auth.test"],{encoding:"utf-8"}),n=JSON.parse(t);n.ok?console.log(`
157
+ \u2713 Slack connected as: ${n.user} in ${n.team}`):(console.log(`
158
+ \u26A0 Slack token test failed: ${n.error}`),console.log(" You can fix this in .env later."))}catch{console.log(`
159
+ \u26A0 Could not validate Slack token (no network?)`)}ft(s),console.log(" \u2713 Slack tokens saved (.env)")}async function ba(s){console.log("Get your API key from: https://console.anthropic.com/settings/keys"),console.log(""),s.ANTHROPIC_API_KEY=await q("Anthropic API Key (sk-ant-...)",s.ANTHROPIC_API_KEY||""),ft(s),console.log(" \u2713 Anthropic key saved (.env)")}async function wa(s){V("Chief of Staff Agent"),console.log("Hive starts with a Chief of Staff \u2014 your primary agent."),console.log(`Additional agents are created through it as needed.
160
+ `);let e=await q("Name your Chief of Staff","Mokie");s.agents||(s.agents={}),s.agents["chief-of-staff"]={name:e},ht(s),console.log(" Seeding agent definition..."),R("npx",["tsx","setup/setup-seeds.ts"],{cwd:K,stdio:"inherit"}),console.log(` \u2713 ${e} (Chief of Staff) is ready`)}async function Bh(s){V("Constitution \u2014 Chief of Staff Permissions");let e=s.agents?.["chief-of-staff"]?.name??"Chief of Staff",t=s.business?.owner?.name??"you",n=Object.keys(s.agents??{}).length>1;console.log("The constitution defines what your agents can and can't do."),console.log(`Since ${e} is your only agent right now, we need to decide`),console.log(`what permissions to grant.
161
+ `),s.constitution||(s.constitution={}),console.log("\u2500\u2500 Agent definitions (agent_definitions collection)"),console.log(`${e} can create new agents, edit their personality and config,`),console.log(`and manage the team roster.
162
+ `),s.constitution.cosCanManageAgents=!0,console.log(` \u2713 ${e} can manage agent definitions
163
+ `),console.log(`
164
+ \u2500\u2500 External communications (email, SMS)`),console.log("This is a hard gate \u2014 when off, email and SMS tools are completely"),console.log(`removed from all agents. Not just a policy, they literally can't send.
165
+ `),console.log("Default: OFF. You can enable later by setting EXTERNAL_COMMS_ENABLED=true"),console.log(`in .env and restarting Hive.
166
+ `),s.constitution.cosCanContactExternal=await D("Enable external communications now?",!1);let i=Na();s.constitution.cosCanContactExternal?(i.EXTERNAL_COMMS_ENABLED="true",console.log(" \u2713 External comms enabled \u2014 email/SMS tools available"),console.log(` (sensitive topics still escalate to ${t} per constitution)`)):(i.EXTERNAL_COMMS_ENABLED="",console.log(" \u2717 External comms disabled \u2014 no agent can send email or SMS"),console.log(" To enable later: set EXTERNAL_COMMS_ENABLED=true in .env")),ft(i),console.log(`
167
+ \u2500\u2500 Summary \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`),console.log(" Agent management: \u2713 yes"),console.log(` External communications: ${s.constitution.cosCanContactExternal?"\u2713 yes":"\u2717 no"}`),console.log(" Hive build & deploy: \u2717 no (external provisioning only)"),console.log(" Hive source code: \u2717 no (external provisioning only)"),ht(s),console.log(`
168
+ \u2713 Constitution preferences saved (hive.yaml)`)}async function Kh(s,e){let t=process.env.MONGODB_URI||"mongodb://localhost:27017",n=process.env.MONGODB_DB||"hive";console.log("Seeding shared memory to MongoDB...");try{let i=new Aa(t);await i.connect();let o=i.db(n).collection("memory");await o.createIndex({path:1},{unique:!0});let a=s.business??{},l=[`# Business Context
169
+ `,`**Company:** ${a.name??""}`,`**About:** ${a.description??""}`,a.location?`**Location:** ${a.location}`:"",a.timezone?`**Timezone:** ${a.timezone}`:"",a.businessHours?`**Business Hours:** ${a.businessHours}${a.timezone?` (${a.timezone})`:""}`:"",`**Owner:** ${a.owner?.name??""} (${a.owner?.role??""})`,"","## Additional Context","(Add more details about your business here \u2014 products, services, team, etc.)"].filter(Boolean).join(`
170
+ `);await o.updateOne({path:"shared/business-context.md"},{$set:{content:l,updatedAt:new Date,updatedBy:"setup-wizard"}},{upsert:!0}),console.log(" \u2713 shared/business-context.md");let c=I(e,"constitution.md.tpl");if(x(c)){let d=I(K,"setup","template-renderer.ts"),{render:h}=await import(d),u=dt(c,"utf-8"),m={};for(let[p,b]of Object.entries(s.agents??{}))m[p]=b.name??p;let f=h(u,{business:a,team:m});await o.updateOne({path:"shared/constitution.md"},{$set:{content:f,updatedAt:new Date,updatedBy:"setup-wizard"}},{upsert:!0}),console.log(" \u2713 shared/constitution.md")}await i.close(),console.log(" \u2713 Memory seeded to MongoDB")}catch(i){console.log(` \u26A0 Failed to seed memory: ${i}`),console.log(" Make sure MongoDB is running (brew services start mongodb-community)")}}async function Sa(){console.log(" Compiling TypeScript...");try{R("npm",["run","build"],{cwd:K,stdio:"pipe"}),console.log(" \u2713 Build complete")}catch(s){console.log(" \u26A0 Build failed:"),console.log(String(s))}}async function va(s){let{mkdirSync:e}=await import("node:fs");if(x(I(s,"package.json"))){console.log(" Pulling latest...");try{R("git",["pull","--ff-only"],{cwd:s,stdio:"inherit"})}catch{console.log(" \u26A0 git pull failed \u2014 continuing with existing code")}}else{console.log(" Cloning repository...");let r=ut(s,"..");e(r,{recursive:!0});let o=R("git",["remote","get-url","origin"],{cwd:K,encoding:"utf-8"}).trim();R("git",["clone",o,s],{stdio:"inherit"}),console.log(" \u2713 Repository cloned")}console.log(" Installing production dependencies..."),R("npm",["install","--omit=dev"],{cwd:s,stdio:"pipe"}),console.log(" \u2713 Dependencies installed"),console.log(" Syncing config and build output...");let t=I(K,".env");if(x(t)){let{copyFileSync:r}=await import("node:fs");r(t,I(s,".env")),console.log(" \u2713 .env")}let n=I(K,"hive.yaml");if(x(n)){let{copyFileSync:r}=await import("node:fs");r(n,I(s,"hive.yaml")),console.log(" \u2713 hive.yaml")}let i=I(K,"dist");x(i)&&(R("rsync",["-a","--delete",`${i}/`,`${I(s,"dist")}/`],{stdio:"pipe"}),console.log(" \u2713 dist/")),e(I(s,"logs"),{recursive:!0}),console.log(`
171
+ \u2713 Deploy directory ready: ${s}`)}var pt,K,gs,ys,oi,jh,qa=Q(()=>{"use strict";pt=As(ms(),1),K=ut(import.meta.dirname,"../.."),gs=I(K,".env"),ys=I(K,"hive.yaml"),oi=_h({input:process.stdin,output:process.stdout});jh=import.meta.url===`file://${process.argv[1]}`;jh&&Oa().catch(s=>{console.error("Setup failed:",s),oi.close(),process.exit(1)})});var Ca={};fe(Ca,{runSetupWizard:()=>Uh});import{mkdirSync as Fh,existsSync as Rh}from"node:fs";import{resolve as ai}from"node:path";async function Uh(s){console.log(`
172
+ Hive Setup Wizard`),console.log(`Home directory: ${M}
173
+ `),Fh(M,{recursive:!0}),await ki();let e=Rh(ai(s,"templates"))?ai(s,"templates"):ai(s,"setup","templates");console.log(`
174
+ Setup will write config to: ${M}`),console.log(`Templates from: ${e}
175
+ `),process.env.HIVE_HOME=M;let{runWizard:t}=await Promise.resolve().then(()=>(qa(),Ea));await t(M,e)}var La=Q(()=>{"use strict";Te();Ai()});var fi={};fe(fi,{startDaemon:()=>ci,stopDaemon:()=>ui});import{execFileSync as li}from"node:child_process";import{existsSync as bs,readFileSync as xh,writeFileSync as Yh,mkdirSync as Ia,symlinkSync as Hh,unlinkSync as Vh}from"node:fs";import{resolve as ce}from"node:path";function Gh(){let s=ce(M,process.env.HIVE_CONFIG??"hive.yaml");return bs(s)?((0,Ta.parse)(xh(s,"utf-8"))??{}).instance?.id??"hive":"hive"}function ws(){return`com.hive.${Gh()}.agent`}function Jh(){return ce(M,"service",`${ws()}.plist`)}function Pa(){let s=process.env.HOME??"/tmp";return ce(s,"Library","LaunchAgents",`${ws()}.plist`)}async function ci(s){let e=ws(),t=Jh(),n=Pa(),i=ce(M,"service"),r=ce(M,"logs");Ia(i,{recursive:!0}),Ia(r,{recursive:!0});let o=li("which",["node"],{encoding:"utf-8"}).trim(),a=bs(ce(s,"pkg","server.min.js"))?ce(s,"pkg","server.min.js"):ce(s,"dist","index.js"),l=process.env.HOME??"/tmp",c=process.env.PATH??"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin",d=`<?xml version="1.0" encoding="UTF-8"?>
176
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
177
+ <plist version="1.0">
178
+ <dict>
179
+ <key>Label</key>
180
+ <string>${e}</string>
181
+
182
+ <key>ProgramArguments</key>
183
+ <array>
184
+ <string>${o}</string>
185
+ <string>${a}</string>
186
+ </array>
187
+
188
+ <key>WorkingDirectory</key>
189
+ <string>${M}</string>
190
+
191
+ <key>EnvironmentVariables</key>
192
+ <dict>
193
+ <key>HIVE_HOME</key>
194
+ <string>${M}</string>
195
+ <key>PATH</key>
196
+ <string>${c}</string>
197
+ <key>HOME</key>
198
+ <string>${l}</string>
199
+ </dict>
200
+
201
+ <key>RunAtLoad</key>
202
+ <true/>
203
+
204
+ <key>KeepAlive</key>
205
+ <dict>
206
+ <key>SuccessfulExit</key>
207
+ <false/>
208
+ </dict>
209
+
210
+ <key>ThrottleInterval</key>
211
+ <integer>10</integer>
212
+
213
+ <key>StandardOutPath</key>
214
+ <string>${r}/hive.log</string>
215
+ <key>StandardErrorPath</key>
216
+ <string>${r}/hive.err</string>
217
+ </dict>
218
+ </plist>
219
+ `;Yh(t,d),console.log(`Generated plist: ${t}`),bs(n)&&Vh(n),Hh(t,n);try{li("launchctl",["load",n],{stdio:"inherit"}),console.log(`Started ${e}`)}catch{console.error(`Failed to start ${e}. Check: launchctl list | grep hive`),process.exit(1)}}async function ui(){let s=Pa(),e=ws();if(!bs(s)){console.log(`No LaunchAgent found for ${e}`);return}try{li("launchctl",["unload",s],{stdio:"inherit"}),console.log(`Stopped ${e}`)}catch{console.error(`Failed to stop ${e}`)}}var Ta,Ss=Q(()=>{"use strict";Ta=As(ms(),1);Te()});var Ma={};fe(Ma,{showStatus:()=>Xh});import{execFileSync as _a}from"node:child_process";import{existsSync as Qh,readFileSync as Wh}from"node:fs";import{resolve as zh}from"node:path";async function Xh(){console.log(`Hive home: ${M}`);let s=zh(M,process.env.HIVE_CONFIG??"hive.yaml");if(!Qh(s)){console.log("Status: not initialized (run 'hive init')");return}let t=((0,$a.parse)(Wh(s,"utf-8"))??{}).instance?.id??"hive",n=`com.hive.${t}.agent`;console.log(`Instance: ${t}`);try{let r=_a("launchctl",["list"],{encoding:"utf-8"}).split(`
220
+ `).find(o=>o.includes(n));if(r){let o=r.trim().split(/\s+/),a=o[0],l=o[1];console.log(`Service: running (PID ${a}, last exit ${l})`)}else console.log("Service: not running")}catch{console.log("Service: unknown (could not query launchctl)")}try{_a("mongosh",["--eval","db.runCommand({ping:1})","--quiet"],{encoding:"utf-8",timeout:5e3}),console.log("MongoDB: connected")}catch{console.log("MongoDB: not reachable")}}var $a,Da=Q(()=>{"use strict";$a=As(ms(),1);Te()});var Ka={};fe(Ka,{runUpdate:()=>ed});import{execFileSync as Ba}from"node:child_process";import{resolve as Zh}from"node:path";async function ed(){console.log("Stopping Hive..."),await ui(),console.log("Updating @keepur/hive...");try{Ba("npm",["update","-g","@keepur/hive"],{stdio:"inherit"}),console.log("Update complete.")}catch{console.error("Update failed."),process.exit(1)}let s=Ba("npm",["root","-g"],{encoding:"utf-8"}).trim(),e=Zh(s,"@keepur","hive");console.log("Restarting Hive..."),await ci(e)}var ja=Q(()=>{"use strict";Ss()});var Fa={};fe(Fa,{runDoctor:()=>td});import{execFileSync as pi}from"node:child_process";function hi(s){try{return pi("which",[s],{encoding:"utf-8"}),!0}catch{return!1}}function di(s){try{return pi("brew",["services","list"],{encoding:"utf-8"}).split(`
221
+ `).some(t=>t.startsWith(s)&&t.includes("started"))}catch{return!1}}async function td(){let s=[{name:"Node.js >= 22",required:!0,test:()=>parseInt(process.versions.node.split(".")[0])>=22},{name:"Homebrew",required:!0,test:()=>hi("brew")},{name:"MongoDB",required:!0,test:()=>di("mongodb-community")},{name:"Ollama",required:!1,test:()=>di("ollama")},{name:"Qdrant",required:!1,test:()=>di("qdrant")},{name:"gh CLI",required:!1,test:()=>hi("gh")},{name:"gog CLI",required:!1,test:()=>hi("gog")},{name:"Xcode CLI Tools",required:!0,test:()=>{try{return pi("xcode-select",["-p"],{encoding:"utf-8"}),!0}catch{return!1}}}],e=!0;for(let t of s){let n=t.test(),i=n?"\u2713":t.required?"\u2717":"\u25CB",r=t.required?"":" (optional)";console.log(` ${i} ${t.name}${r}`),!n&&t.required&&(e=!1)}e||(console.log(`
222
+ Some required checks failed. Run 'hive init' to install prerequisites.`),process.exit(1)),console.log(`
223
+ All checks passed.`)}var Ra=Q(()=>{"use strict"});var Ua={};fe(Ua,{runPlugin:()=>id});import{execFileSync as mi}from"node:child_process";import{existsSync as vs,mkdirSync as sd,readFileSync as nd}from"node:fs";import{resolve as gi}from"node:path";async function id(s,e){switch(s){case"add":{e||(console.error("Usage: hive plugin add <package-name>"),process.exit(1)),sd(ue,{recursive:!0});let t=gi(ue,"package.json");vs(t)||mi("npm",["init","-y"],{cwd:ue,stdio:"pipe"}),console.log(`Installing ${e}...`),mi("npm",["install",e],{cwd:ue,stdio:"inherit"}),console.log(`Installed ${e}`);break}case"list":{if(!vs(ue)){console.log("No plugins installed.");return}let t=gi(ue,"package.json");if(!vs(t)){console.log("No plugins installed.");return}let i=JSON.parse(nd(t,"utf-8")).dependencies??{};if(Object.keys(i).length===0){console.log("No plugins installed.");return}console.log("Installed plugins:");for(let[r,o]of Object.entries(i))console.log(` ${r}@${o}`);break}case"remove":{e||(console.error("Usage: hive plugin remove <package-name>"),process.exit(1)),vs(ue)||(console.error("No plugins directory found."),process.exit(1)),console.log(`Removing ${e}...`),mi("npm",["uninstall",e],{cwd:ue,stdio:"inherit"}),console.log(`Removed ${e}`);break}default:console.error("Usage: hive plugin <add|list|remove> [package]"),process.exit(1)}}var ue,xa=Q(()=>{"use strict";Te();ue=gi(M,"plugins")});import{parseArgs as rd}from"node:util";import{resolve as be}from"node:path";import{existsSync as Ya,readFileSync as od,statSync as ad}from"node:fs";var{positionals:yi,values:gt}=rd({allowPositionals:!0,options:{help:{type:"boolean",short:"h",default:!1},daemon:{type:"boolean",default:!1},config:{type:"string"},version:{type:"boolean",short:"v",default:!1}}}),bi=yi[0];if(gt.version){let s=JSON.parse(od(be(import.meta.dirname,"..","package.json"),"utf-8"));console.log(`hive v${s.version}`),process.exit(0)}(gt.help||!bi)&&(console.log(`
224
+ hive \u2014 AI agent platform
225
+
226
+ Usage:
227
+ hive <command> [options]
228
+
229
+ Commands:
230
+ init Setup wizard (prereqs + config)
231
+ start Start Hive (foreground)
232
+ start --daemon Install + start as LaunchAgent
233
+ stop Stop LaunchAgent
234
+ status Health check
235
+ update Stop \u2192 update package \u2192 restart
236
+ doctor Check prereqs, services, agent health
237
+ plugin add <pkg> Install a plugin package
238
+ plugin list List installed plugins
239
+ plugin remove Uninstall a plugin
240
+
241
+ Options:
242
+ --config <path> Path to hive.yaml
243
+ -v, --version Show version
244
+ -h, --help Show this help
245
+ `),process.exit(0));var mt=be(import.meta.dirname,"..");if(gt.config){let s=be(gt.config);if(Ya(s)){let e=ad(s);process.env.HIVE_HOME=e.isDirectory()?s:be(s,"..")}else console.error(`Config not found: ${s}`),process.exit(1)}switch(bi){case"init":{let{runSetupWizard:s}=await Promise.resolve().then(()=>(La(),Ca));await s(mt);break}case"start":{if(gt.daemon){let{startDaemon:s}=await Promise.resolve().then(()=>(Ss(),fi));await s(mt)}else{let{execFileSync:s}=await import("node:child_process"),e=Ya(be(mt,"pkg","server.min.js"))?be(mt,"pkg","server.min.js"):be(mt,"dist","index.js");s(process.execPath,[e],{stdio:"inherit",env:{...process.env,HIVE_HOME:process.env.HIVE_HOME??""}})}break}case"stop":{let{stopDaemon:s}=await Promise.resolve().then(()=>(Ss(),fi));await s();break}case"status":{let{showStatus:s}=await Promise.resolve().then(()=>(Da(),Ma));await s();break}case"update":{let{runUpdate:s}=await Promise.resolve().then(()=>(ja(),Ka));await s();break}case"doctor":{let{runDoctor:s}=await Promise.resolve().then(()=>(Ra(),Fa));await s();break}case"plugin":{let s=yi[1],e=yi[2],{runPlugin:t}=await Promise.resolve().then(()=>(xa(),Ua));await t(s,e);break}default:console.error(`Unknown command: ${bi}`),console.error('Run "hive --help" for usage.'),process.exit(1)}