buildkeel 0.3.0 → 0.4.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/antigravity/dist/hooks/main.js +151 -15
- package/antigravity/dist/server/main.js +327 -314
- package/antigravity/package.json +1 -1
- package/antigravity/plugin.json +1 -1
- package/antigravity/rules/buildkeel.md +7 -5
- package/antigravity/skills/bk-approve/SKILL.md +11 -8
- package/antigravity/skills/bk-build/SKILL.md +93 -27
- package/antigravity/skills/bk-capture/SKILL.md +32 -14
- package/antigravity/skills/bk-done/SKILL.md +16 -6
- package/antigravity/skills/bk-impact/SKILL.md +5 -5
- package/antigravity/skills/bk-init/SKILL.md +4 -4
- package/antigravity/skills/bk-migrate/SKILL.md +32 -8
- package/antigravity/skills/bk-new/SKILL.md +4 -4
- package/antigravity/skills/bk-onboard/SKILL.md +11 -18
- package/antigravity/skills/bk-stats/SKILL.md +1 -1
- package/antigravity/skills/bk-status/SKILL.md +1 -1
- package/cli.mjs +1 -1
- package/package.json +1 -1
- package/antigravity/skills/bk-adhoc/SKILL.md +0 -49
- package/antigravity/skills/bk-start/SKILL.md +0 -44
|
@@ -1,22 +1,158 @@
|
|
|
1
1
|
import { createRequire as __bkCreateRequire } from 'node:module'; const require = __bkCreateRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
`)}var
|
|
4
|
-
`)
|
|
5
|
-
`)
|
|
6
|
-
|
|
7
|
-
`)
|
|
2
|
+
var Ia=Object.create;var Xn=Object.defineProperty;var $a=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Pa=Object.getPrototypeOf,Da=Object.prototype.hasOwnProperty;var Ze=(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 g=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Ma=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _a(e))!Da.call(s,i)&&i!==t&&Xn(s,i,{get:()=>e[i],enumerable:!(n=$a(e,i))||n.enumerable});return s};var Zn=(s,e,t)=>(t=s!=null?Ia(Pa(s)):{},Ma(e||!s||!s.__esModule?Xn(t,"default",{value:s,enumerable:!0}):t,s));var O=g(_=>{"use strict";var os=Symbol.for("yaml.alias"),pi=Symbol.for("yaml.document"),tt=Symbol.for("yaml.map"),mi=Symbol.for("yaml.pair"),as=Symbol.for("yaml.scalar"),st=Symbol.for("yaml.seq"),H=Symbol.for("yaml.node.type"),Za=s=>!!s&&typeof s=="object"&&s[H]===os,el=s=>!!s&&typeof s=="object"&&s[H]===pi,tl=s=>!!s&&typeof s=="object"&&s[H]===tt,sl=s=>!!s&&typeof s=="object"&&s[H]===mi,gi=s=>!!s&&typeof s=="object"&&s[H]===as,nl=s=>!!s&&typeof s=="object"&&s[H]===st;function yi(s){if(s&&typeof s=="object")switch(s[H]){case tt:case st:return!0}return!1}function il(s){if(s&&typeof s=="object")switch(s[H]){case os:case tt:case as:case st:return!0}return!1}var rl=s=>(gi(s)||yi(s))&&!!s.anchor;_.ALIAS=os;_.DOC=pi;_.MAP=tt;_.NODE_TYPE=H;_.PAIR=mi;_.SCALAR=as;_.SEQ=st;_.hasAnchor=rl;_.isAlias=Za;_.isCollection=yi;_.isDocument=el;_.isMap=tl;_.isNode=il;_.isPair=sl;_.isScalar=gi;_.isSeq=nl});var ve=g(ls=>{"use strict";var $=O(),D=Symbol("break visit"),bi=Symbol("skip children"),j=Symbol("remove node");function nt(s,e){let t=wi(e);$.isDocument(s)?fe(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):fe(null,s,t,Object.freeze([]))}nt.BREAK=D;nt.SKIP=bi;nt.REMOVE=j;function fe(s,e,t,n){let i=Si(s,e,t,n);if($.isNode(i)||$.isPair(i))return ki(s,n,i),fe(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=fe(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=fe("key",e.key,t,n);if(r===D)return D;r===j&&(e.key=null);let o=fe("value",e.value,t,n);if(o===D)return D;o===j&&(e.value=null)}}return i}async function it(s,e){let t=wi(e);$.isDocument(s)?await de(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):await de(null,s,t,Object.freeze([]))}it.BREAK=D;it.SKIP=bi;it.REMOVE=j;async function de(s,e,t,n){let i=await Si(s,e,t,n);if($.isNode(i)||$.isPair(i))return ki(s,n,i),de(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 de(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=await de("key",e.key,t,n);if(r===D)return D;r===j&&(e.key=null);let o=await de("value",e.value,t,n);if(o===D)return D;o===j&&(e.value=null)}}return i}function wi(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 Si(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 ki(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`)}}ls.visit=nt;ls.visitAsync=it});var cs=g(Ni=>{"use strict";var vi=O(),ol=ve(),al={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ll=s=>s.replace(/[!,[\]{}]/g,e=>al[e]),Ne=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+ll(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&&vi.isNode(e.contents)){let r={};ol.visit(e.contents,(o,a)=>{vi.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(`
|
|
3
|
+
`)}};Ne.defaultYaml={explicit:!1,version:"1.2"};Ne.defaultTags={"!!":"tag:yaml.org,2002:"};Ni.Directives=Ne});var rt=g(Ae=>{"use strict";var Ai=O(),cl=ve();function ul(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 Oi(s){let e=new Set;return cl.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ei(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function fl(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Oi(s));let o=Ei(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(Ai.isScalar(o.node)||Ai.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}}Ae.anchorIsValid=ul;Ae.anchorNames=Oi;Ae.createNodeAnchors=fl;Ae.findNewAnchor=Ei});var us=g(Ci=>{"use strict";function Oe(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=Oe(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=Oe(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=Oe(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=Oe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}Ci.applyReviver=Oe});var J=g(qi=>{"use strict";var dl=O();function Ti(s,e,t){if(Array.isArray(s))return s.map((n,i)=>Ti(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!dl.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}qi.toJS=Ti});var ot=g(Ii=>{"use strict";var hl=us(),Li=O(),pl=J(),fs=class{constructor(e){Object.defineProperty(this,Li.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(!Li.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=pl.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?hl.applyReviver(r,{"":a},"",a):a}};Ii.NodeBase=fs});var Ee=g($i=>{"use strict";var ml=rt(),gl=ve(),he=O(),yl=ot(),bl=J(),ds=class extends yl.NodeBase{constructor(e){super(he.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],gl.visit(e,{Node:(r,o)=>{(he.isAlias(o)||he.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)}if(i&&t){let{anchors:r,doc:o,maxAliasCount:a}=t,l=r.get(i);if(l||(bl.toJS(i,null,t),l=r.get(i)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=at(o,i,r)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(n).res}toString(e,t,n){let i=`*${this.source}`;if(e){if(ml.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 at(s,e,t){if(he.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(he.isCollection(e)){let n=0;for(let i of e.items){let r=at(s,i,t);r>n&&(n=r)}return n}else if(he.isPair(e)){let n=at(s,e.key,t),i=at(s,e.value,t);return Math.max(n,i)}return 1}$i.Alias=ds});var q=g(hs=>{"use strict";var wl=O(),Sl=ot(),kl=J(),vl=s=>!s||typeof s!="function"&&typeof s!="object",V=class extends Sl.NodeBase{constructor(e){super(wl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:kl.toJS(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";hs.Scalar=V;hs.isScalarValue=vl});var Ce=g(Pi=>{"use strict";var Nl=Ee(),se=O(),_i=q(),Al="tag:yaml.org,2002:";function Ol(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 El(s,e,t){if(se.isDocument(s)&&(s=s.contents),se.isNode(s))return s;if(se.isPair(s)){let u=t.schema[se.MAP].createNode?.(t.schema,null,t);return u.items.push(s),u}(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 Nl.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Al+e.slice(2));let c=Ol(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let u=new _i.Scalar(s);return l&&(l.node=u),u}c=s instanceof Map?o[se.MAP]:Symbol.iterator in Object(s)?o[se.SEQ]:o[se.MAP]}r&&(r(c),delete t.onTagObj);let h=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new _i.Scalar(s);return e?h.tag=e:c.default||(h.tag=c.tag),l&&(l.node=h),h}Pi.createNode=El});var ct=g(lt=>{"use strict";var Cl=Ce(),F=O(),Tl=ot();function ps(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 Cl.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 Di=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,ms=class extends Tl.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=>F.isNode(n)||F.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Di(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(F.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(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(F.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&&F.isScalar(r)?r.value:r:F.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F.isPair(t))return!1;let n=t.value;return n==null||e&&F.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 F.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(F.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};lt.Collection=ms;lt.collectionFromPath=ps;lt.isEmptyPath=Di});var Te=g(ut=>{"use strict";var ql=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function gs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Ll=(s,e,t)=>s.endsWith(`
|
|
4
|
+
`)?gs(t,e):t.includes(`
|
|
5
|
+
`)?`
|
|
6
|
+
`+gs(t,e):(s.endsWith(" ")?"":" ")+t;ut.indentComment=gs;ut.lineComment=Ll;ut.stringifyComment=ql});var Bi=g(qe=>{"use strict";var Il="flow",ys="block",ft="quoted";function $l(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=[],h={},u=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):u=i-n);let f,p,y=!1,d=-1,m=-1,w=-1;t===ys&&(d=Mi(s,d,e.length),d!==-1&&(u=d+l));for(let k;k=s[d+=1];){if(t===ft&&k==="\\"){switch(m=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}w=d}if(k===`
|
|
7
|
+
`)t===ys&&(d=Mi(s,d,e.length)),u=d+e.length+l,f=void 0;else{if(k===" "&&p&&p!==" "&&p!==`
|
|
8
|
+
`&&p!==" "){let v=s[d+1];v&&v!==" "&&v!==`
|
|
9
|
+
`&&v!==" "&&(f=d)}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===ft){for(;p===" "||p===" ";)p=k,k=s[d+=1],y=!0;let v=d>w+1?d-2:m-1;if(h[v])return s;c.push(v),h[v]=!0,u=v+l,f=void 0}else y=!0}p=k}if(y&&a&&a(),c.length===0)return s;o&&o();let S=s.slice(0,c[0]);for(let k=0;k<c.length;++k){let v=c[k],N=c[k+1]||s.length;v===0?S=`
|
|
10
|
+
${e}${s.slice(0,N)}`:(t===ft&&h[v]&&(S+=`${s[v]}\\`),S+=`
|
|
11
|
+
${e}${s.slice(v+1,N)}`)}return S}function Mi(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!==`
|
|
12
|
+
`);n=e,i=e+1,r=s[i]}return n}qe.FOLD_BLOCK=ys;qe.FOLD_FLOW=Il;qe.FOLD_QUOTED=ft;qe.foldFlowLines=$l});var Ie=g(xi=>{"use strict";var x=q(),W=Bi(),ht=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),pt=s=>/^(%|---|\.\.\.)/m.test(s);function _l(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]===`
|
|
13
|
+
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Le(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 h=t.substr(l+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.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)+`
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
16
|
+
`,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:W.foldFlowLines(o,r,W.FOLD_QUOTED,ht(e,!1))}function bs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Le(s,e);let t=e.indent||(pt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${t}`)+"'";return e.implicitKey?n:W.foldFlowLines(n,t,W.FOLD_FLOW,ht(e,!1))}function pe(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Le;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=bs:r&&!i?n=Le:n=t?bs:Le}return n(s,e)}var ws;try{ws=new RegExp(`(^|(?<!
|
|
19
|
+
))
|
|
20
|
+
+(?!
|
|
21
|
+
|$)`,"g")}catch{ws=/\n+(?!\n|$)/g}function dt({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 pe(t,n);let c=n.indent||(n.forceBlockIndent||pt(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===x.Scalar.BLOCK_FOLDED?!1:e===x.Scalar.BLOCK_LITERAL?!0:!_l(t,l,c.length);if(!t)return h?`|
|
|
22
|
+
`:`>
|
|
23
|
+
`;let u,f;for(f=t.length;f>0;--f){let N=t[f-1];if(N!==`
|
|
24
|
+
`&&N!==" "&&N!==" ")break}let p=t.substring(f),y=p.indexOf(`
|
|
25
|
+
`);y===-1?u="-":t===p||y!==p.length-1?(u="+",r&&r()):u="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
|
|
26
|
+
`&&(p=p.slice(0,-1)),p=p.replace(ws,`$&${c}`));let d=!1,m,w=-1;for(m=0;m<t.length;++m){let N=t[m];if(N===" ")d=!0;else if(N===`
|
|
27
|
+
`)w=m;else break}let S=t.substring(0,w<m?w+1:m);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let v=(d?c?"2":"1":"")+u;if(s&&(v+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){let N=t.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,C=ht(n,!0);o!=="folded"&&e!==x.Scalar.BLOCK_FOLDED&&(C.onOverflow=()=>{A=!0});let b=W.foldFlowLines(`${S}${N}${p}`,c,W.FOLD_BLOCK,C);if(!A)return`>${v}
|
|
29
|
+
${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${v}
|
|
30
|
+
${c}${S}${t}${p}`}function Pl(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=e;if(a&&r.includes(`
|
|
31
|
+
`)||h&&/[[\]{},]/.test(r))return pe(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
|
|
32
|
+
`)?pe(r,e):dt(s,e,t,n);if(!a&&!h&&i!==x.Scalar.PLAIN&&r.includes(`
|
|
33
|
+
`))return dt(s,e,t,n);if(pt(r)){if(l==="")return e.forceBlockIndent=!0,dt(s,e,t,n);if(a&&l===c)return pe(r,e)}let u=r.replace(/\n+/g,`$&
|
|
34
|
+
${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:p,tags:y}=e.doc.schema;if(y.some(f)||p?.some(f))return pe(r,e)}return a?u:W.foldFlowLines(u,l,W.FOLD_FLOW,ht(e,!1))}function Dl(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!==x.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=x.Scalar.QUOTE_DOUBLE);let l=h=>{switch(h){case x.Scalar.BLOCK_FOLDED:case x.Scalar.BLOCK_LITERAL:return i||r?pe(o.value,e):dt(o,e,t,n);case x.Scalar.QUOTE_DOUBLE:return Le(o.value,e);case x.Scalar.QUOTE_SINGLE:return bs(o.value,e);case x.Scalar.PLAIN:return Pl(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:h,defaultStringType:u}=e.options,f=i&&h||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}xi.stringifyString=Dl});var $e=g(Ss=>{"use strict";var Ml=rt(),G=O(),Bl=Te(),xl=Ie();function Kl(s,e){let t=Object.assign({blockQuote:!0,commentString:Bl.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},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 Rl(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(G.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 jl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(G.isScalar(s)||G.isCollection(s))&&s.anchor;r&&Ml.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 Fl(s,e,t,n){if(G.isPair(s))return s.toString(e,t,n);if(G.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=G.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i??(i=Rl(e.doc.schema.tags,r));let o=jl(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):G.isScalar(r)?xl.stringifyString(r,e,t,n):r.toString(e,t,n);return o?G.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
+
${e.indent}${a}`:a}Ss.createStringifyContext=Kl;Ss.stringify=Fl});var Fi=g(ji=>{"use strict";var U=O(),Ki=q(),Ri=$e(),_e=Te();function Hl({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:u}}=t,f=U.isNode(s)&&s.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(s)||!U.isNode(s)&&typeof s=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let p=!u&&(!s||f&&e==null&&!t.inFlow||U.isCollection(s)||(U.isScalar(s)?s.type===Ki.Scalar.BLOCK_FOLDED||s.type===Ki.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(u||!r),indent:a+l});let y=!1,d=!1,m=Ri.stringify(s,t,()=>y=!0,()=>d=!0);if(!p&&!t.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),m===""?"?":p?`? ${m}`:m}else if(r&&!u||e==null&&p)return m=`? ${m}`,f&&!y?m+=_e.lineComment(m,t.indent,c(f)):d&&i&&i(),m;y&&(f=null),p?(f&&(m+=_e.lineComment(m,t.indent,c(f))),m=`? ${m}
|
|
36
|
+
${a}:`):(m=`${m}:`,f&&(m+=_e.lineComment(m,t.indent,c(f))));let w,S,k;U.isNode(e)?(w=!!e.spaceBefore,S=e.commentBefore,k=e.comment):(w=!1,S=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!f&&U.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!h&&l.length>=2&&!t.inFlow&&!p&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let v=!1,N=Ri.stringify(e,t,()=>v=!0,()=>d=!0),A=" ";if(f||w||S){if(A=w?`
|
|
37
|
+
`:"",S){let C=c(S);A+=`
|
|
38
|
+
${_e.indentComment(C,t.indent)}`}N===""&&!t.inFlow?A===`
|
|
39
|
+
`&&k&&(A=`
|
|
40
|
+
|
|
41
|
+
`):A+=`
|
|
42
|
+
${t.indent}`}else if(!p&&U.isCollection(e)){let C=N[0],b=N.indexOf(`
|
|
43
|
+
`),L=b!==-1,Y=t.inFlow??e.flow??e.items.length===0;if(L||!Y){let ue=!1;if(L&&(C==="&"||C==="!")){let I=N.indexOf(" ");C==="&"&&I!==-1&&I<b&&N[I+1]==="!"&&(I=N.indexOf(" ",I+1)),(I===-1||b<I)&&(ue=!0)}ue||(A=`
|
|
44
|
+
${t.indent}`)}}else(N===""||N[0]===`
|
|
45
|
+
`)&&(A="");return m+=A+N,t.inFlow?v&&n&&n():k&&!v?m+=_e.lineComment(m,t.indent,c(k)):d&&i&&i(),m}ji.stringifyPair=Hl});var vs=g(ks=>{"use strict";var Hi=Ze("process");function Ul(s,...e){s==="debug"&&console.log(...e)}function Yl(s,e){(s==="debug"||s==="warn")&&(typeof Hi.emitWarning=="function"?Hi.emitWarning(e):console.warn(e))}ks.debug=Ul;ks.warn=Yl});var wt=g(bt=>{"use strict";var yt=O(),Ui=q(),mt="<<",gt={identify:s=>s===mt||typeof s=="symbol"&&s.description===mt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ui.Scalar(Symbol(mt)),{addToJSMap:Yi}),stringify:()=>mt},Jl=(s,e)=>(gt.identify(e)||yt.isScalar(e)&&(!e.type||e.type===Ui.Scalar.PLAIN)&>.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===gt.tag&&t.default);function Yi(s,e,t){let n=Ji(s,t);if(yt.isSeq(n))for(let i of n.items)Ns(s,e,i);else if(Array.isArray(n))for(let i of n)Ns(s,e,i);else Ns(s,e,n)}function Ns(s,e,t){let n=Ji(s,t);if(!yt.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}function Ji(s,e){return s&&yt.isAlias(e)?e.resolve(s.doc,s):e}bt.addMergeToJSMap=Yi;bt.isMergeKey=Jl;bt.merge=gt});var Os=g(Gi=>{"use strict";var Vl=vs(),Vi=wt(),Wl=$e(),Wi=O(),As=J();function Gl(s,e,{key:t,value:n}){if(Wi.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Vi.isMergeKey(s,t))Vi.addMergeToJSMap(s,e,n);else{let i=As.toJS(t,"",s);if(e instanceof Map)e.set(i,As.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=Ql(t,i,s),o=As.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 Ql(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Wi.isNode(s)&&t?.doc){let n=Wl.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)+'..."'),Vl.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)}Gi.addPairToJSMap=Gl});var Q=g(Es=>{"use strict";var Qi=Ce(),zl=Fi(),Xl=Os(),St=O();function Zl(s,e,t){let n=Qi.createNode(s,void 0,t),i=Qi.createNode(e,void 0,t);return new kt(n,i)}var kt=class s{constructor(e,t=null){Object.defineProperty(this,St.NODE_TYPE,{value:St.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return St.isNode(t)&&(t=t.clone(e)),St.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Xl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?zl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Es.Pair=kt;Es.createPair=Zl});var Cs=g(Xi=>{"use strict";var ne=O(),zi=$e(),vt=Te();function ec(s,e,t){return(e.inFlow??s.flow?sc:tc)(s,e,t)}function tc({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null}),u=!1,f=[];for(let y=0;y<e.length;++y){let d=e[y],m=null;if(ne.isNode(d))!u&&d.spaceBefore&&f.push(""),Nt(t,f,d.commentBefore,u),d.comment&&(m=d.comment);else if(ne.isPair(d)){let S=ne.isNode(d.key)?d.key:null;S&&(!u&&S.spaceBefore&&f.push(""),Nt(t,f,S.commentBefore,u))}u=!1;let w=zi.stringify(d,h,()=>m=null,()=>u=!0);m&&(w+=vt.lineComment(w,r,c(m))),u&&m&&(u=!1),f.push(n+w)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let y=1;y<f.length;++y){let d=f[y];p+=d?`
|
|
46
|
+
${l}${d}`:`
|
|
47
|
+
`}}return s?(p+=`
|
|
48
|
+
`+vt.indentComment(c(s),l),a&&a()):u&&o&&o(),p}function sc({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,h=0,u=[];for(let y=0;y<s.length;++y){let d=s[y],m=null;if(ne.isNode(d))d.spaceBefore&&u.push(""),Nt(e,u,d.commentBefore,!1),d.comment&&(m=d.comment);else if(ne.isPair(d)){let S=ne.isNode(d.key)?d.key:null;S&&(S.spaceBefore&&u.push(""),Nt(e,u,S.commentBefore,!1),S.comment&&(c=!0));let k=ne.isNode(d.value)?d.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(c=!0)):d.value==null&&S?.comment&&(m=S.comment)}m&&(c=!0);let w=zi.stringify(d,l,()=>m=null);c||(c=u.length>h||w.includes(`
|
|
49
|
+
`)),y<s.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce((S,k)=>S+k.length+2,2)+(w.length+2)>e.options.lineWidth)),c&&(w+=",")),m&&(w+=vt.lineComment(w,n,a(m))),u.push(w),h=u.length}let{start:f,end:p}=t;if(u.length===0)return f+p;if(!c){let y=u.reduce((d,m)=>d+m.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=f;for(let d of u)y+=d?`
|
|
50
|
+
${r}${i}${d}`:`
|
|
51
|
+
`;return`${y}
|
|
52
|
+
${i}${p}`}else return`${f}${o}${u.join(" ")}${o}${p}`}function Nt({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=vt.indentComment(e(n),s);t.push(r.trimStart())}}Xi.stringifyCollection=ec});var X=g(qs=>{"use strict";var nc=Cs(),ic=Os(),rc=ct(),z=O(),At=Q(),oc=q();function Pe(s,e){let t=z.isScalar(e)?e.value:e;for(let n of s)if(z.isPair(n)&&(n.key===e||n.key===t||z.isScalar(n.key)&&n.key.value===t))return n}var Ts=class extends rc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(z.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(At.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;z.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new At.Pair(e,e?.value):n=new At.Pair(e.key,e.value);let i=Pe(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);z.isScalar(i.value)&&oc.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=Pe(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Pe(this.items,e)?.value;return(!t&&z.isScalar(i)?i.value:i)??void 0}has(e){return!!Pe(this.items,e)}set(e,t){this.add(new At.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)ic.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!z.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})),nc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};qs.YAMLMap=Ts;qs.findPair=Pe});var me=g(er=>{"use strict";var ac=O(),Zi=X(),lc={collection:"map",default:!0,nodeClass:Zi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return ac.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>Zi.YAMLMap.from(s,e,t)};er.map=lc});var Z=g(tr=>{"use strict";var cc=Ce(),uc=Cs(),fc=ct(),Et=O(),dc=q(),hc=J(),Ls=class extends fc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Et.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ot(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Ot(e);if(typeof n!="number")return;let i=this.items[n];return!t&&Et.isScalar(i)?i.value:i}has(e){let t=Ot(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Ot(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Et.isScalar(i)&&dc.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(hc.toJS(r,String(i++),t));return n}toString(e,t,n){return e?uc.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(cc.createNode(a,void 0,n))}}return r}};function Ot(s){let e=Et.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}tr.YAMLSeq=Ls});var ge=g(nr=>{"use strict";var pc=O(),sr=Z(),mc={collection:"seq",default:!0,nodeClass:sr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return pc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>sr.YAMLSeq.from(s,e,t)};nr.seq=mc});var De=g(ir=>{"use strict";var gc=Ie(),yc={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),gc.stringifyString(s,e,t,n)}};ir.string=yc});var Ct=g(ar=>{"use strict";var rr=q(),or={identify:s=>s==null,createNode:()=>new rr.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rr.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&or.test.test(s)?s:e.options.nullStr};ar.nullTag=or});var Is=g(cr=>{"use strict";var bc=q(),lr={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new bc.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&lr.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};cr.boolTag=lr});var ye=g(ur=>{"use strict";function wc({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)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}ur.stringifyNumber=wc});var _s=g(Tt=>{"use strict";var Sc=q(),$s=ye(),kc={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:$s.stringifyNumber},vc={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():$s.stringifyNumber(s)}},Nc={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 Sc.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:$s.stringifyNumber};Tt.float=Nc;Tt.floatExp=vc;Tt.floatNaN=kc});var Ds=g(Lt=>{"use strict";var fr=ye(),qt=s=>typeof s=="bigint"||Number.isInteger(s),Ps=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function dr(s,e,t){let{value:n}=s;return qt(n)&&n>=0?t+n.toString(e):fr.stringifyNumber(s)}var Ac={identify:s=>qt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Ps(s,2,8,t),stringify:s=>dr(s,8,"0o")},Oc={identify:qt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Ps(s,0,10,t),stringify:fr.stringifyNumber},Ec={identify:s=>qt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Ps(s,2,16,t),stringify:s=>dr(s,16,"0x")};Lt.int=Oc;Lt.intHex=Ec;Lt.intOct=Ac});var pr=g(hr=>{"use strict";var Cc=me(),Tc=Ct(),qc=ge(),Lc=De(),Ic=Is(),Ms=_s(),Bs=Ds(),$c=[Cc.map,qc.seq,Lc.string,Tc.nullTag,Ic.boolTag,Bs.intOct,Bs.int,Bs.intHex,Ms.floatNaN,Ms.floatExp,Ms.float];hr.schema=$c});var yr=g(gr=>{"use strict";var _c=q(),Pc=me(),Dc=ge();function mr(s){return typeof s=="bigint"||Number.isInteger(s)}var It=({value:s})=>JSON.stringify(s),Mc=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:It},{identify:s=>s==null,createNode:()=>new _c.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:It},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:It},{identify:mr,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})=>mr(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:It}],Bc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},xc=[Pc.map,Dc.seq].concat(Mc,Bc);gr.schema=xc});var Ks=g(br=>{"use strict";var Me=Ze("buffer"),xs=q(),Kc=Ie(),Rc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Me.Buffer=="function")return Me.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 Me.Buffer=="function")a=o instanceof Me.Buffer?o.toString("base64"):Me.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=xs.Scalar.BLOCK_LITERAL),e!==xs.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)h[u]=a.substr(f,l);a=h.join(e===xs.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Kc.stringifyString({comment:s,type:e,value:a},n,i,r)}};br.binary=Rc});var Pt=g(_t=>{"use strict";var $t=O(),Rs=Q(),jc=q(),Fc=Z();function wr(s,e){if($t.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!$t.isPair(n)){if($t.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Rs.Pair(new jc.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
54
|
+
${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
55
|
+
${r.comment}`:n.comment}n=i}s.items[t]=$t.isPair(n)?n:new Rs.Pair(n)}}else e("Expected a sequence for this tag");return s}function Sr(s,e,t){let{replacer:n}=t,i=new Fc.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(Rs.createPair(a,l,t))}return i}var Hc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wr,createNode:Sr};_t.createPairs=Sr;_t.pairs=Hc;_t.resolvePairs=wr});var Hs=g(Fs=>{"use strict";var kr=O(),js=J(),Be=X(),Uc=Z(),vr=Pt(),ie=class s extends Uc.YAMLSeq{constructor(){super(),this.add=Be.YAMLMap.prototype.add.bind(this),this.delete=Be.YAMLMap.prototype.delete.bind(this),this.get=Be.YAMLMap.prototype.get.bind(this),this.has=Be.YAMLMap.prototype.has.bind(this),this.set=Be.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(kr.isPair(i)?(r=js.toJS(i.key,"",t),o=js.toJS(i.value,r,t)):r=js.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=vr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ie.tag="tag:yaml.org,2002:omap";var Yc={collection:"seq",identify:s=>s instanceof Map,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=vr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)kr.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ie,t)},createNode:(s,e,t)=>ie.from(s,e,t)};Fs.YAMLOMap=ie;Fs.omap=Yc});var Cr=g(Us=>{"use strict";var Nr=q();function Ar({value:s,source:e},t){return e&&(s?Or:Er).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Or={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 Nr.Scalar(!0),stringify:Ar},Er={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 Nr.Scalar(!1),stringify:Ar};Us.falseTag=Er;Us.trueTag=Or});var Tr=g(Dt=>{"use strict";var Jc=q(),Ys=ye(),Vc={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:Ys.stringifyNumber},Wc={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():Ys.stringifyNumber(s)}},Gc={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 Jc.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:Ys.stringifyNumber};Dt.float=Gc;Dt.floatExp=Wc;Dt.floatNaN=Vc});var Lr=g(Ke=>{"use strict";var qr=ye(),xe=s=>typeof s=="bigint"||Number.isInteger(s);function Mt(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 Js(s,e,t){let{value:n}=s;if(xe(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return qr.stringifyNumber(s)}var Qc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Mt(s,2,2,t),stringify:s=>Js(s,2,"0b")},zc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Mt(s,1,8,t),stringify:s=>Js(s,8,"0")},Xc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Mt(s,0,10,t),stringify:qr.stringifyNumber},Zc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Mt(s,2,16,t),stringify:s=>Js(s,16,"0x")};Ke.int=Xc;Ke.intBin=Qc;Ke.intHex=Zc;Ke.intOct=zc});var Ws=g(Vs=>{"use strict";var Kt=O(),Bt=Q(),xt=X(),re=class s extends xt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Kt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Bt.Pair(e.key,null):t=new Bt.Pair(e,null),xt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=xt.findPair(this.items,e);return!t&&Kt.isPair(n)?Kt.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=xt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Bt.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(Bt.createPair(o,null,n));return r}};re.tag="tag:yaml.org,2002:set";var eu={collection:"map",identify:s=>s instanceof Set,nodeClass:re,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>re.from(s,e,t),resolve(s,e){if(Kt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new re,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Vs.YAMLSet=re;Vs.set=eu});var Qs=g(Rt=>{"use strict";var tu=ye();function Gs(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 Ir(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return tu.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 su={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})=>Gs(s,t),stringify:Ir},nu={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=>Gs(s,!1),stringify:Ir},$r={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($r.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),h=e[8];if(h&&h!=="Z"){let u=Gs(h,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Rt.floatTime=nu;Rt.intTime=su;Rt.timestamp=$r});var Dr=g(Pr=>{"use strict";var iu=me(),ru=Ct(),ou=ge(),au=De(),lu=Ks(),_r=Cr(),zs=Tr(),jt=Lr(),cu=wt(),uu=Hs(),fu=Pt(),du=Ws(),Xs=Qs(),hu=[iu.map,ou.seq,au.string,ru.nullTag,_r.trueTag,_r.falseTag,jt.intBin,jt.intOct,jt.int,jt.intHex,zs.floatNaN,zs.floatExp,zs.float,lu.binary,cu.merge,uu.omap,fu.pairs,du.set,Xs.intTime,Xs.floatTime,Xs.timestamp];Pr.schema=hu});var Yr=g(tn=>{"use strict";var Kr=me(),pu=Ct(),Rr=ge(),mu=De(),gu=Is(),Zs=_s(),en=Ds(),yu=pr(),bu=yr(),jr=Ks(),Re=wt(),Fr=Hs(),Hr=Pt(),Mr=Dr(),Ur=Ws(),Ft=Qs(),Br=new Map([["core",yu.schema],["failsafe",[Kr.map,Rr.seq,mu.string]],["json",bu.schema],["yaml11",Mr.schema],["yaml-1.1",Mr.schema]]),xr={binary:jr.binary,bool:gu.boolTag,float:Zs.float,floatExp:Zs.floatExp,floatNaN:Zs.floatNaN,floatTime:Ft.floatTime,int:en.int,intHex:en.intHex,intOct:en.intOct,intTime:Ft.intTime,map:Kr.map,merge:Re.merge,null:pu.nullTag,omap:Fr.omap,pairs:Hr.pairs,seq:Rr.seq,set:Ur.set,timestamp:Ft.timestamp},wu={"tag:yaml.org,2002:binary":jr.binary,"tag:yaml.org,2002:merge":Re.merge,"tag:yaml.org,2002:omap":Fr.omap,"tag:yaml.org,2002:pairs":Hr.pairs,"tag:yaml.org,2002:set":Ur.set,"tag:yaml.org,2002:timestamp":Ft.timestamp};function Su(s,e,t){let n=Br.get(e);if(n&&!s)return t&&!n.includes(Re.merge)?n.concat(Re.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(Br.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(Re.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?xr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(xr).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}tn.coreKnownTags=wu;tn.getTags=Su});var rn=g(Jr=>{"use strict";var sn=O(),ku=me(),vu=ge(),Nu=De(),Ht=Yr(),Au=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,nn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ht.getTags(e,"compat"):e?Ht.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ht.coreKnownTags:{},this.tags=Ht.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,sn.MAP,{value:ku.map}),Object.defineProperty(this,sn.SCALAR,{value:Nu.string}),Object.defineProperty(this,sn.SEQ,{value:vu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Au:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Jr.Schema=nn});var Wr=g(Vr=>{"use strict";var Ou=O(),on=$e(),je=Te();function Eu(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(je.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(Ou.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let h=r(s.contents.commentBefore);t.push(je.indentComment(h,""))}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+=je.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(`
|
|
56
|
+
`)?(t.push("..."),t.push(je.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(je.indentComment(r(l),"")))}return t.join(`
|
|
57
|
+
`)+`
|
|
58
|
+
`}Vr.stringifyDocument=Eu});var Fe=g(Gr=>{"use strict";var Cu=Ee(),be=ct(),B=O(),Tu=Q(),qu=J(),Lu=rn(),Iu=Wr(),an=rt(),$u=us(),_u=Ce(),ln=cs(),cn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.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 ln.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,{[B.NODE_TYPE]:{value:B.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=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){we(this.contents)&&this.contents.add(e)}addIn(e,t){we(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=an.anchorNames(this);e.anchor=!t||n.has(t)?an.findNewAnchor(t||"a",n):t}return new Cu.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 m=S=>typeof S=="number"||S instanceof String||S instanceof Number,w=t.filter(m).map(String);w.length>0&&(t=t.concat(w)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:p}=an.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},d=_u.createNode(e,h,y);return a&&B.isCollection(d)&&(d.flow=!0),f(),d}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Tu.Pair(i,r)}delete(e){return we(this.contents)?this.contents.delete(e):!1}deleteIn(e){return be.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):we(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return be.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return be.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=be.collectionFromPath(this.schema,[e],t):we(this.contents)&&this.contents.set(e,t)}setIn(e,t){be.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=be.collectionFromPath(this.schema,Array.from(e),t):we(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 ln.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 ln.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 Lu.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=qu.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?$u.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 Iu.stringifyDocument(this,e)}};function we(s){if(B.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Gr.Document=cn});var Ye=g(Ue=>{"use strict";var He=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},un=class extends He{constructor(e,t,n){super("YAMLParseError",e,t,n)}},fn=class extends He{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Pu=(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
|
|
59
|
+
`),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+=`:
|
|
60
|
+
|
|
61
|
+
${o}
|
|
62
|
+
${c}
|
|
63
|
+
`}};Ue.YAMLError=He;Ue.YAMLParseError=un;Ue.YAMLWarning=fn;Ue.prettifyError=Pu});var Je=g(Qr=>{"use strict";function Du(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,u="",f="",p=!1,y=!1,d=null,m=null,w=null,S=null,k=null,v=null,N=null;for(let b of s)switch(y&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(c&&b.type!=="comment"&&b.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),b.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(d=b),h=!0;break;case"comment":{h||r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=b.source.substring(1)||" ";u?u+=f+L:u=L,f="",c=!1;break}case"newline":c?u?u+=b.source:(!v||t!=="seq-item-ind")&&(l=!0):f+=b.source,c=!0,p=!0,(m||w)&&(S=b),h=!0;break;case"anchor":m&&r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,N??(N=b.offset),c=!1,h=!1,y=!0;break;case"tag":{w&&r(b,"MULTIPLE_TAGS","A node can have at most one tag"),w=b,N??(N=b.offset),c=!1,h=!1,y=!0;break}case t:(m||w)&&r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),v&&r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),v=b,c=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){k&&r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,c=!1,h=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,h=!1}let A=s[s.length-1],C=A?A.offset+A.source.length:i;return y&&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"),d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:v,spaceBefore:l,comment:u,hasNewline:p,anchor:m,tag:w,newlineAfterProp:S,end:C,start:N??C}}Qr.resolveProps=Du});var Ut=g(zr=>{"use strict";function dn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
64
|
+
`))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(dn(e.key)||dn(e.value))return!0}return!1;default:return!0}}zr.containsNewline=dn});var hn=g(Xr=>{"use strict";var Mu=Ut();function Bu(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Mu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Xr.flowIndentCheck=Bu});var pn=g(eo=>{"use strict";var Zr=O();function xu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||Zr.isScalar(r)&&Zr.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}eo.mapIncludes=xu});var oo=g(ro=>{"use strict";var to=Q(),Ku=X(),so=Je(),Ru=Ut(),no=hn(),ju=pn(),io="All mapping items must start at the same column";function Fu({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Ku.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let h of n.items){let{start:u,key:f,sep:p,value:y}=h,d=so.resolveProps(u,{indicator:"explicit-key-ind",next:f??p?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!d.found;if(m){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(l,"BAD_INDENT",io)),!d.anchor&&!d.tag&&!p){c=d.end,d.comment&&(a.comment?a.comment+=`
|
|
65
|
+
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Ru.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(l,"BAD_INDENT",io);t.atKey=!0;let w=d.end,S=f?s(t,f,d,i):e(t,w,u,null,d,i);t.schema.compat&&no.flowIndentCheck(n.indent,f,i),t.atKey=!1,ju.mapIncludes(t,a.items,S)&&i(w,"DUPLICATE_KEY","Map keys must be unique");let k=so.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=k.end,k.found){m&&(y?.type==="block-map"&&!k.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<k.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 v=y?s(t,y,k,i):e(t,l,p,null,k,i);t.schema.compat&&no.flowIndentCheck(n.indent,y,i),l=v.range[2];let N=new to.Pair(S,v);t.options.keepSourceTokens&&(N.srcToken=h),a.items.push(N)}else{m&&i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(S.comment?S.comment+=`
|
|
66
|
+
`+k.comment:S.comment=k.comment);let v=new to.Pair(S);t.options.keepSourceTokens&&(v.srcToken=h),a.items.push(v)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}ro.resolveBlockMap=Fu});var lo=g(ao=>{"use strict";var Hu=Z(),Uu=Je(),Yu=hn();function Ju({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Hu.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:h,value:u}of n.items){let f=Uu.resolveProps(h,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let p=u?s(t,u,f,i):e(t,f.end,h,null,f,i);t.schema.compat&&Yu.flowIndentCheck(n.indent,u,i),l=p.range[2],a.items.push(p)}return a.range=[n.offset,l,c??l],a}ao.resolveBlockSeq=Ju});var Se=g(co=>{"use strict";function Vu(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 h=l.substring(1)||" ";i?i+=o+h:i=h,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}}co.resolveEnd=Vu});var po=g(ho=>{"use strict";var Wu=O(),Gu=Q(),uo=X(),Qu=Z(),zu=Se(),fo=Je(),Xu=Ut(),Zu=pn(),mn="Block collections are not allowed within flow collections",gn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function ef({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?uo.YAMLMap:Qu.YAMLSeq),c=new l(t.schema);c.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset+n.start.source.length;for(let m=0;m<n.items.length;++m){let w=n.items[m],{start:S,key:k,sep:v,value:N}=w,A=fo.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:k??v?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!v&&!N){m===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<n.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
|
|
67
|
+
`+A.comment:c.comment=A.comment),u=A.end;continue}!o&&t.options.strict&&Xu.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let C="";e:for(let b of S)switch(b.type){case"comma":case"space":break;case"comment":C=b.source.substring(1);break e;default:break e}if(C){let b=c.items[c.items.length-1];Wu.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
|
|
68
|
+
`+C:b.comment=C,A.comment=A.comment.substring(C.length+1)}}if(!o&&!v&&!A.found){let C=N?s(t,N,A,i):e(t,A.end,v,null,A,i);c.items.push(C),u=C.range[2],gn(N)&&i(C.range,"BLOCK_IN_FLOW",mn)}else{t.atKey=!0;let C=A.end,b=k?s(t,k,A,i):e(t,C,S,null,A,i);gn(k)&&i(b.range,"BLOCK_IN_FLOW",mn),t.atKey=!1;let L=fo.resolveProps(v??[],{flow:a,indicator:"map-value-ind",next:N,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(L.found){if(!o&&!A.found&&t.options.strict){if(v)for(let I of v){if(I===L.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<L.found.offset-1024&&i(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source?.[0]===":"?i(N,"MISSING_CHAR",`Missing space after : in ${a}`):i(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Y=N?s(t,N,L,i):L.found?e(t,L.end,v,null,L,i):null;Y?gn(N)&&i(Y.range,"BLOCK_IN_FLOW",mn):L.comment&&(b.comment?b.comment+=`
|
|
69
|
+
`+L.comment:b.comment=L.comment);let ue=new Gu.Pair(b,Y);if(t.options.keepSourceTokens&&(ue.srcToken=w),o){let I=c;Zu.mapIncludes(t,I.items,b)&&i(C,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(ue)}else{let I=new uo.YAMLMap(t.schema);I.flow=!0,I.items.push(ue);let zn=(Y??b).range;I.range=[b.range[0],zn[1],zn[2]],c.items.push(I)}u=Y?Y.range[2]:L.end}}let f=o?"}":"]",[p,...y]=n.end,d=u;if(p?.source===f)d=p.offset+p.source.length;else{let m=a[0].toUpperCase()+a.substring(1),w=h?`${m} must end with a ${f}`:`${m} in block collection must be sufficiently indented and end with a ${f}`;i(u,h?"MISSING_CHAR":"BAD_INDENT",w),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let m=zu.resolveEnd(y,d,t.options.strict,i);m.comment&&(c.comment?c.comment+=`
|
|
70
|
+
`+m.comment:c.comment=m.comment),c.range=[n.offset,d,m.offset]}else c.range=[n.offset,d,d];return c}ho.resolveFlowCollection=ef});var go=g(mo=>{"use strict";var tf=O(),sf=q(),nf=X(),rf=Z(),of=oo(),af=lo(),lf=po();function yn(s,e,t,n,i,r){let o=t.type==="block-map"?of.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?af.resolveBlockSeq(s,e,t,n,r):lf.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 cf(s,e,t,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,f=>i(r,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,y=f&&r?f.offset>r.offset?f:r:f??r;y&&(!p||p.offset<y.offset)&&i(y,"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===nf.YAMLMap.tagName&&a==="map"||o===rf.YAMLSeq.tagName&&a==="seq")return yn(s,e,t,i,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),yn(s,e,t,i,o)}let c=yn(s,e,t,i,o,l),h=l.resolve?.(c,f=>i(r,"TAG_RESOLVE_FAILED",f),e.options)??c,u=tf.isNode(h)?h:new sf.Scalar(h);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}mo.composeCollection=cf});var wn=g(yo=>{"use strict";var bn=q();function uf(s,e,t){let n=e.offset,i=ff(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?df(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let m=o[d][1];if(m===""||m==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,o.length-1)):"",m=n+i.length;return e.source&&(m+=e.source.length),{value:d,type:r,comment:i.comment,range:[n,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,h=0;for(let d=0;d<a;++d){let[m,w]=o[d];if(w===""||w==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),h=d,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+w.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let u="",f="",p=!1;for(let d=0;d<h;++d)u+=o[d][0].slice(l)+`
|
|
72
|
+
`;for(let d=h;d<a;++d){let[m,w]=o[d];c+=m.length+w.length+1;let S=w[w.length-1]==="\r";if(S&&(w=w.slice(0,-1)),w&&m.length<l){let v=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-w.length-(S?2:1),"BAD_INDENT",v),m=""}r===bn.Scalar.BLOCK_LITERAL?(u+=f+m.slice(l)+w,f=`
|
|
73
|
+
`):m.length>l||w[0]===" "?(f===" "?f=`
|
|
74
|
+
`:!p&&f===`
|
|
75
|
+
`&&(f=`
|
|
76
|
+
|
|
77
|
+
`),u+=f+m.slice(l)+w,f=`
|
|
78
|
+
`,p=!0):w===""?f===`
|
|
79
|
+
`?u+=`
|
|
80
|
+
`:f=`
|
|
81
|
+
`:(u+=f+w,f=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)u+=`
|
|
82
|
+
`+o[d][0].slice(l);u[u.length-1]!==`
|
|
83
|
+
`&&(u+=`
|
|
84
|
+
`);break;default:u+=`
|
|
85
|
+
`}let y=n+i.length+e.source.length;return{value:u,type:r,comment:i.comment,range:[n,y,y]}}function ff({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 f=1;f<i.length;++f){let p=i[f];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!o&&y?o=y:l===-1&&(l=s+f)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",u=i.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":c=!0;case"newline":u+=p.source.length;break;case"comment":t&&!c&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=p.source.length,h=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),u+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",y);let d=p.source;d&&typeof d=="string"&&(u+=d.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:u}}function df(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}yo.resolveBlockScalar=uf});var kn=g(wo=>{"use strict";var Sn=q(),hf=Se();function pf(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(f,p,y)=>t(n+f,p,y);switch(i){case"scalar":a=Sn.Scalar.PLAIN,l=mf(r,c);break;case"single-quoted-scalar":a=Sn.Scalar.QUOTE_SINGLE,l=gf(r,c);break;case"double-quoted-scalar":a=Sn.Scalar.QUOTE_DOUBLE,l=yf(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 h=n+r.length,u=hf.resolveEnd(o,h,e,t);return{value:l,type:a,comment:u.comment,range:[n,h,u.offset]}}function mf(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}`),bo(s)}function gf(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),bo(s.slice(1,-1)).replace(/''/g,"'")}function bo(s){let e=/(.*?)\r?\n/sy,t=e.exec(s);if(!t)return s;let n,i;try{n=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(n,""),o=" ",a=e.lastIndex;for(;t=e.exec(s);){let c=t[1].replace(i,"");c===""?o===`
|
|
86
|
+
`?r+=o:o=`
|
|
87
|
+
`:(r+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,t=l.exec(s),r+o+(t?.[1]??"")}function yf(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
88
|
+
`))if(i===`
|
|
89
|
+
`){let{fold:r,offset:o}=bf(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n],o=wf[r];if(o)t+=o;else if(r===`
|
|
90
|
+
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
91
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=Sf(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!==`
|
|
92
|
+
`&&!(o==="\r"&&s[n+2]===`
|
|
93
|
+
`)&&(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 bf(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
94
|
+
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
95
|
+
`);)n===`
|
|
96
|
+
`&&(t+=`
|
|
97
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var wf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
98
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Sf(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}wo.resolveFlowScalar=pf});var vo=g(ko=>{"use strict";var oe=O(),So=q(),kf=wn(),vf=kn();function Nf(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?kf.resolveBlockScalar(s,e,n):vf.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,u=>n(t,"TAG_RESOLVE_FAILED",u)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[oe.SCALAR]:l?c=Af(s.schema,i,l,t,n):e.type==="scalar"?c=Of(s,i,e,n):c=s.schema[oe.SCALAR];let h;try{let u=c.resolve(i,f=>n(t??e,"TAG_RESOLVE_FAILED",f),s.options);h=oe.isScalar(u)?u:new So.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(t??e,"TAG_RESOLVE_FAILED",f),h=new So.Scalar(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function Af(s,e,t,n,i){if(t==="!")return s[oe.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[oe.SCALAR])}function Of({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[oe.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[oe.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",h,!0)}}return o}ko.composeScalar=Nf});var Ao=g(No=>{"use strict";function Ef(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}No.emptyScalarPosition=Ef});var Co=g(Nn=>{"use strict";var Cf=Ee(),Tf=O(),qf=go(),Oo=vo(),Lf=Se(),If=Ao(),$f={composeNode:Eo,composeEmptyNode:vn};function Eo(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,h=!0;switch(e.type){case"alias":c=_f(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=Oo.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=qf.composeCollection($f,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),h=!1}}return c??(c=vn(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!Tf.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&&h&&(c.srcToken=e),c}function vn(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let h={type:"scalar",offset:If.emptyScalarPosition(e,t,n),indent:-1,source:""},u=Oo.composeScalar(s,h,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function _f({options:s},{offset:e,source:t,end:n},i){let r=new Cf.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=Lf.resolveEnd(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Nn.composeEmptyNode=vn;Nn.composeNode=Eo});var Lo=g(qo=>{"use strict";var Pf=Fe(),To=Co(),Df=Se(),Mf=Je();function Bf(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new Pf.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=Mf.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?To.composeNode(c,i,h,o):To.composeEmptyNode(c,h.end,n,null,h,o);let u=l.contents.range[2],f=Df.resolveEnd(r,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}qo.composeDoc=Bf});var On=g(_o=>{"use strict";var xf=Ze("process"),Kf=cs(),Rf=Fe(),Ve=Ye(),Io=O(),jf=Lo(),Ff=Se();function We(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 $o(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?`
|
|
99
|
+
|
|
100
|
+
`:`
|
|
101
|
+
`)+(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 An=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=We(t);r?this.warnings.push(new Ve.YAMLWarning(o,n,i)):this.errors.push(new Ve.YAMLParseError(o,n,i))},this.directives=new Kf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=$o(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
102
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(Io.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Io.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
103
|
+
${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
|
|
104
|
+
${o}`:n}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$o(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(xf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=We(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=jf.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 Ve.YAMLParseError(We(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 Ve.YAMLParseError(We(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Ff.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}
|
|
105
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ve.YAMLParseError(We(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 Rf.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}}};_o.Composer=An});var Mo=g(Yt=>{"use strict";var Hf=wn(),Uf=kn(),Yf=Ye(),Po=Ie();function Jf(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 Yf.YAMLParseError([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Uf.resolveFlowScalar(s,e,n);case"block-scalar":return Hf.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Vf(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Po.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:`
|
|
106
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
107
|
+
`),h=a.substring(0,c),u=a.substring(c+1)+`
|
|
108
|
+
`,f=[{type:"block-scalar-header",offset:r,indent:n,source:h}];return Do(f,l)||f.push({type:"newline",offset:-1,indent:n,source:`
|
|
109
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:f,source:u}}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 Wf(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=Po.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">":Gf(s,l);break;case'"':En(s,l,"double-quoted-scalar");break;case"'":En(s,l,"single-quoted-scalar");break;default:En(s,l,"scalar")}}function Gf(s,e){let t=e.indexOf(`
|
|
110
|
+
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
111
|
+
`;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}];Do(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
112
|
+
`});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 Do(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 En(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:`
|
|
113
|
+
`};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})}}}Yt.createScalarToken=Vf;Yt.resolveAsScalar=Jf;Yt.setScalarValue=Wf});var xo=g(Bo=>{"use strict";var Qf=s=>"type"in s?Vt(s):Jt(s);function Vt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Vt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Jt(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Jt(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Jt(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 Jt({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Vt(e)),t)for(let r of t)i+=r.source;return n&&(i+=Vt(n)),i}Bo.stringify=Qf});var Fo=g(jo=>{"use strict";var Cn=Symbol("break visit"),zf=Symbol("skip children"),Ko=Symbol("remove item");function ae(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Ro(Object.freeze([]),s,e)}ae.BREAK=Cn;ae.SKIP=zf;ae.REMOVE=Ko;ae.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};ae.parentCollection=(s,e)=>{let t=ae.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 Ro(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=Ro(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Cn)return Cn;a===Ko&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}jo.visit=ae});var Wt=g(M=>{"use strict";var Tn=Mo(),Xf=xo(),Zf=Fo(),qn="\uFEFF",Ln="",In="",$n="",ed=s=>!!s&&"items"in s,td=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function sd(s){switch(s){case qn:return"<BOM>";case Ln:return"<DOC>";case In:return"<FLOW_END>";case $n:return"<SCALAR>";default:return JSON.stringify(s)}}function nd(s){switch(s){case qn:return"byte-order-mark";case Ln:return"doc-mode";case In:return"flow-error-end";case $n:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
114
|
+
`:case`\r
|
|
115
|
+
`: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}M.createScalarToken=Tn.createScalarToken;M.resolveAsScalar=Tn.resolveAsScalar;M.setScalarValue=Tn.setScalarValue;M.stringify=Xf.stringify;M.visit=Zf.visit;M.BOM=qn;M.DOCUMENT=Ln;M.FLOW_END=In;M.SCALAR=$n;M.isCollection=ed;M.isScalar=td;M.prettyToken=sd;M.tokenType=nd});var Dn=g(Uo=>{"use strict";var Ge=Wt();function K(s){switch(s){case void 0:case" ":case`
|
|
116
|
+
`:case"\r":case" ":return!0;default:return!1}}var Ho=new Set("0123456789ABCDEFabcdef"),id=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Gt=new Set(",[]{}"),rd=new Set(` ,[]{}
|
|
117
|
+
\r `),_n=s=>!s||rd.has(s),Pn=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===`
|
|
118
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
119
|
+
`:!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===`
|
|
120
|
+
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
121
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&K(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
122
|
+
`,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]===Ge.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 Ge.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&K(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&K(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(_n),"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("..."))&&K(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Ge.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(_n),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||K(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
123
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
124
|
+
`,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=>K(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`
|
|
125
|
+
`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
126
|
+
`)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(`
|
|
127
|
+
`,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===`
|
|
128
|
+
`;)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===`
|
|
129
|
+
`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Ge.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(K(r)||e&&Gt.has(r))break;t=n}else if(K(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
130
|
+
`?(n+=1,i=`
|
|
131
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&Gt.has(r))break;if(i===`
|
|
132
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Gt.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ge.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(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(_n),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(K(n)||t&&Gt.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!K(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(id.has(t))t=this.buffer[++e];else if(t==="%"&&Ho.has(this.buffer[e+1])&&Ho.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===`
|
|
133
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
134
|
+
`?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)}};Uo.Lexer=Pn});var Bn=g(Yo=>{"use strict";var Mn=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}}}};Yo.LineCounter=Mn});var Kn=g(Qo=>{"use strict";var od=Ze("process"),Jo=Wt(),ad=Dn();function ee(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Vo(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 Go(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 Qt(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 ke(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 zt(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function Wo(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!ee(e.start,"explicit-key-ind")&&!ee(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Go(e.value)?e.value.end?zt(e.value.end,e.sep):e.value.end=e.sep:zt(e.start,e.sep),delete e.sep)}var xn=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 ad.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,od.env.LOG_TOKENS&&console.log("|",Jo.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Jo.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"&&Wo(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&&Vo(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":{Vo(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=Qt(this.peek(2)),n=ke(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(`
|
|
135
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
136
|
+
`,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)){zt(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(ee(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(Go(t.key)&&!ee(t.sep,"newline")){let o=ke(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(ee(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=ke(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]}):ee(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&&!ee(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)){zt(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||ee(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=Qt(n),r=ke(i);Wo(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(`
|
|
137
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
+
`,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=Qt(e),n=ke(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=Qt(e),n=ke(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())}}};Qo.Parser=xn});var ta=g(ze=>{"use strict";var zo=On(),ld=Fe(),Qe=Ye(),cd=vs(),ud=O(),fd=Bn(),Xo=Kn();function Zo(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new fd.LineCounter||null,prettyErrors:e}}function dd(s,e={}){let{lineCounter:t,prettyErrors:n}=Zo(e),i=new Xo.Parser(t?.addNewLine),r=new zo.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(Qe.prettifyError(s,t)),a.warnings.forEach(Qe.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ea(s,e={}){let{lineCounter:t,prettyErrors:n}=Zo(e),i=new Xo.Parser(t?.addNewLine),r=new zo.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 Qe.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Qe.prettifyError(s,t)),o.warnings.forEach(Qe.prettifyError(s,t))),o}function hd(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ea(s,t);if(!i)return null;if(i.warnings.forEach(r=>cd.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 pd(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 ud.isDocument(s)&&!n?s.toString(t):new ld.Document(s,n,t).toString(t)}ze.parse=hd;ze.parseAllDocuments=dd;ze.parseDocument=ea;ze.stringify=pd});var jn=g(E=>{"use strict";var md=On(),gd=Fe(),yd=rn(),Rn=Ye(),bd=Ee(),te=O(),wd=Q(),Sd=q(),kd=X(),vd=Z(),Nd=Wt(),Ad=Dn(),Od=Bn(),Ed=Kn(),Xt=ta(),sa=ve();E.Composer=md.Composer;E.Document=gd.Document;E.Schema=yd.Schema;E.YAMLError=Rn.YAMLError;E.YAMLParseError=Rn.YAMLParseError;E.YAMLWarning=Rn.YAMLWarning;E.Alias=bd.Alias;E.isAlias=te.isAlias;E.isCollection=te.isCollection;E.isDocument=te.isDocument;E.isMap=te.isMap;E.isNode=te.isNode;E.isPair=te.isPair;E.isScalar=te.isScalar;E.isSeq=te.isSeq;E.Pair=wd.Pair;E.Scalar=Sd.Scalar;E.YAMLMap=kd.YAMLMap;E.YAMLSeq=vd.YAMLSeq;E.CST=Nd;E.Lexer=Ad.Lexer;E.LineCounter=Od.LineCounter;E.Parser=Ed.Parser;E.parse=Xt.parse;E.parseAllDocuments=Xt.parseAllDocuments;E.parseDocument=Xt.parseDocument;E.stringify=Xt.stringify;E.visit=sa.visit;E.visitAsync=sa.visitAsync});import{appendFileSync as dh,readFileSync as hh}from"node:fs";var Ba=["claude-code","antigravity"],ei=s=>Ba.includes(s);function R(s,e){return s==="antigravity"?`/bk-${e}`:`/bk:${e}`}function ti(s,e){return s.replace(/\{\{bk:([a-z][a-z-]*)\}\}/g,(t,n)=>R(e,n))}import{isAbsolute as ns,relative as ja,resolve as ii}from"node:path";import{existsSync as si}from"node:fs";import{dirname as xa,join as ni,resolve as Ka}from"node:path";var Ra=".buildkeel.yaml";function et(s){let e=Ka(s);for(;;){if(si(ni(e,Ra)))return e;if(si(ni(e,".git")))return null;let t=xa(e);if(t===e)return null;e=t}}var oi=["write_to_file","replace_file_content","multi_replace_file_content"],Nh=oi.join("|");var Fa={decision:"allow"},ri={decision:"ask"},is=(s,e)=>{let t=ja(s,e);return t===""||!t.startsWith("..")&&!ns(t)};function ss(s,e){let t=(s.workspacePaths??[]).filter(i=>typeof i=="string"&&i!==""),n=e?[...t.filter(i=>is(i,e)),...t.filter(i=>!is(i,e))]:t;return n.find(i=>et(i)!==null)??n[0]??process.cwd()}var ai={parse(s,e){let t=s??{};switch(e[0]){case"PreInvocation":return t.conversationId?{kind:"prompt",cwd:ss(t),conversation:t.conversationId,newMessage:t.invocationNum===0,transcript:t.transcriptPath??null}:{kind:"ignored"};case"PreToolUse":case"PostToolUse":{let n=t.toolCall?.name??"",i=t.toolCall?.args?.TargetFile,r=oi.includes(n)&&typeof i=="string"&&i!==""?i:null;if(e[0]==="PostToolUse"){if(!r||t.error)return{kind:"ignored"};let l=ss(t,ns(r)?r:void 0);return{kind:"after-edit",cwd:l,tool:n,files:[ii(l,r)],...t.conversationId?{deferTo:t.conversationId}:{}}}let o=ss(t,r&&ns(r)?r:void 0),a=[...t.workspacePaths??[],...t.artifactDirectoryPath?[t.artifactDirectoryPath]:[]].filter(l=>typeof l=="string"&&l!=="");return{kind:"before-edit",cwd:o,tool:n,files:r?[ii(o,r)]:[],folders:a}}default:return{kind:"ignored"}}},render(s,e){if(e.kind==="prompt"){let t=s.context?{injectSteps:[{ephemeralMessage:s.context}]}:{};return{stdout:JSON.stringify(t),exitCode:0}}if(e.kind==="before-edit"){let t=e.files.length>0&&e.files.every(i=>(e.folders??[]).some(r=>is(r,i))),n=s.block?{decision:"deny",reason:s.block}:t?Fa:ri;return{stdout:JSON.stringify(n),exitCode:0}}return{stdout:"{}",exitCode:0}},failed:s=>({stdout:JSON.stringify(s[0]==="PreToolUse"?ri:{}),exitCode:0})};var li={Edit:"file_path",Write:"file_path",MultiEdit:"file_path",NotebookEdit:"notebook_path"},Oh=Object.keys(li).join("|"),Ha=["Bash","PowerShell"],Ua={startup:"startup",resume:"resume",clear:"clear",compact:"compact",fork:"resume"},ci={parse(s){let e=s??{},t=e.cwd??process.cwd();switch(e.hook_event_name){case"SessionStart":{let n=Ua[e.source??"startup"]??"startup";return{kind:"session-start",cwd:t,reason:n}}case"PreToolUse":case"PostToolUse":{let n=e.tool_name??"";if(e.hook_event_name==="PreToolUse"&&Ha.includes(n)){let o=e.tool_input?.command;return typeof o=="string"?{kind:"before-shell",cwd:t,tool:n,command:o}:{kind:"ignored"}}let i=li[n],r=i?e.tool_input?.[i]:void 0;return typeof r!="string"?{kind:"ignored"}:{kind:e.hook_event_name==="PreToolUse"?"before-edit":"after-edit",cwd:t,tool:n,files:[r]}}default:return{kind:"ignored"}}},render(s,e){if(e.kind==="session-start")return{stdout:s.context??"",exitCode:0};if(e.kind==="before-shell"&&s.context)return{stdout:JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:s.context}}),exitCode:0};if(e.kind==="before-edit"&&(s.block||s.context)){let t={hookSpecificOutput:{hookEventName:"PreToolUse",...s.block?{permissionDecision:"deny",permissionDecisionReason:s.block}:{},...s.context?{additionalContext:s.context}:{}}};return{stdout:JSON.stringify(t),exitCode:0}}return e.kind==="after-edit"&&s.context?{stdout:JSON.stringify({hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:s.context}}),exitCode:0}:{stdout:"",exitCode:0}},failed:()=>({stdout:"",exitCode:1})};import{existsSync as Th,readFileSync as Ya,writeFileSync as qh}from"node:fs";import{join as rs}from"node:path";var P=".buildkeel",Ja="hook-cache.json",Va="context.md",ui=s=>rs(s,P,Va),Wa="context-short.md",fi=s=>rs(s,P,Wa);function Ga(s){return rs(s,P,Ja)}function di(s){try{let e=JSON.parse(Ya(Ga(s),"utf8"));return e?.version===1?e:null}catch{return null}}var Ih=`${P}/`;import{appendFileSync as Id,closeSync as $d,fstatSync as _d,mkdirSync as la,openSync as Pd,readFileSync as ca,readSync as Dd,renameSync as ua,rmSync as Md,statSync as Bd,writeFileSync as xd}from"node:fs";import{homedir as Kd}from"node:os";import{join as ts}from"node:path";import{randomBytes as Qa}from"node:crypto";import{dirname as za,join as Xa}from"node:path";var hi=s=>Xa(za(s),`.${Qa(6).toString("hex")}.bk-tmp`);import{readFileSync as Td}from"node:fs";var Fn=Zn(jn(),1);var Cd=Zn(jn(),1);var Hn={type:"test-plan",dir:"test-plan",file:"plan.md",idSuffix:"-TP"},Un={type:"design",dir:"design",file:"design.md",idSuffix:"-DD"},om=[{type:Hn.type,dir:Hn.dir,file:Hn.file,suffix:"TP"},{type:Un.type,dir:Un.dir,file:Un.file,suffix:"DD"}];function na(s){return/^([A-Z][A-Z0-9]*-[A-Za-z0-9]+)(?:-|$)/.exec(s)?.[1]??null}var Zt=(s,e)=>e?`${s} "${e}"`:s;function Yn(s,e){let t=[{key:"setup",text:`BuildKeel is set up in this repository. Until the user runs a BuildKeel command, or you are about to change a file, converse as you would without it, and leave BuildKeel's artifacts, IDs and commands out of it. Be a thinking partner: check facts in the code and docs before asking; for a design choice, lay out the options, trade-offs, risks and pitfalls, then ask one question in prose and say why it matters. Recommend only when the evidence supports it, and say what it rests on; never assume the user's intent, priorities or constraints, and ask when only they know. When you look something up, say what you found and give the sources. Keep what was decided apart from what is still open. Take the space the reasoning needs; do not cut it short or push toward a conclusion or a plan. Use your question tool only for a closed choice between comparable options, and let several answers be picked when more than one can apply. Until the user signals the discussion has reached a point, end your replies without mentioning BuildKeel, the spec tree or its artifacts, and without offering to draft, record, plan or build anything; settling the last open question is not that signal, so wait for the user to say it. When they signal it, such as with "sounds good" or "I think that's it", ask once, in prose, whether there is more to explore or they are ready to capture it with ${R(e,"capture")}; if they keep talking or say no, do not offer again until something new is settled. Never start it yourself.`,fingerprint:""}];if(s.activeUnit){let n=s.activeBranch?` on branch ${s.activeBranch}`:"";t.push({key:"unit",text:`Active unit: ${Zt(s.activeUnit,s.activeTitle)}${n}.`,fingerprint:`${s.activeUnit}${n}`})}else s.untrackedSince?t.push({key:"unit",text:`No active unit in this working tree: the user chose to work without one here since ${s.untrackedSince}, so changes made now belong to no unit. Starting a unit with ${R(e,"build")} <ID> ends this.`,fingerprint:`untracked:${s.untrackedSince}`}):t.push({key:"unit",text:"No unit is active in this working tree.",fingerprint:""});if(t.push({key:"rules",text:"Read and change the spec tree only through the BuildKeel tools, never by editing its files.",fingerprint:""}),t.push({key:"review",text:"Before you save anything to the spec tree, show what changes, in full, in your reply, and ask in plain text. Agreement saves it; anything else is feedback: discuss it, then list each point with how it was addressed, show the final version, and save only once the user agrees. When work would change a document the user agreed, say which, what and why, and take it through the same review. Never add, change or remove a requirement, criterion, scenario or task on your own initiative."+(s.mode==="spec-driven"?" Report each tick in a line; do not ask about ticks. Tick with save_draft tick, change one requirement with save_draft requirement, and read one file of a change with query file, rather than resending or rereading whole files.":""),fingerprint:s.mode==="spec-driven"?"spec-driven":""}),s.mode==="spec-driven")t.push({key:"stages",text:"This spec tree is Spec-driven: its capability specs say how the system behaves now, and each change says how it will change; nothing in it is approved. Before discussing how the system behaves, look up the capability specs with the BuildKeel query tool. Each BuildKeel command follows its part for a Spec-driven tree.",fingerprint:"spec-driven"},{key:"consistency",text:"When you edit one file of an open change (its proposal, a spec change, its design or its tasks), check the others against the edit, in any direction, and name the follow-on edits in the same reply; then take each through the review, one edit at a time, with what changes and why. Never edit code as part of this.",fingerprint:"spec-driven"},{key:"build",text:`While a change is open, commit each task's work as it is done, adding "BuildKeel-Task: <number>" to a commit that does exactly that one task, and tick each task once its verification passes. Name a change with its title, never by its ID alone, such as CH-001 "Download historical market data". When the user asks in words to build a change's tasks, suggest ${R(e,"build")} once; if they say to go ahead without it, build the tasks anyway by the same rules, and if they say not now, build nothing. A specific edit they ask for needs no suggestion. While building, stop and ask when a test fails and you cannot fix it, or a requirement is unclear. Before adding a requirement to a change with more than half its tasks ticked, ask once whether it belongs in that change or a new one, and draft nothing until they answer.`,fingerprint:`spec-driven|${e}`},{key:"tests",text:"Put the ID of the scenario a test checks in square brackets in the test's name, one ID per bracket.",fingerprint:"spec-driven"}),s.guide==="on"&&t.push({key:"guide",text:"This person chose to be guided through their first change: at each step of it, from drafting to finishing, add one or two plain lines on what just happened and what comes next, as BuildKeel's tool results say. If they ask you to stop explaining, turn it off with the BuildKeel manage tool (action guide, guide off).",fingerprint:"on"});else if(s.stages){let n=(s.stageExamples??[]).map(r=>`\`${r}\``),i=n.length>1?`${n.slice(0,-1).join(", ")} or ${n.at(-1)}`:n[0]??"";t.push({key:"stages",text:`This spec tree's stages, as the team names them: ${s.stages}. Use these names with the user, in each command's help, questions and output; BuildKeel's tools accept them as types, and the usual names too.`+(i?` Examples of what to draft, in the team's words: ${i}; use these in place of a command's usual examples.`:""),fingerprint:`${s.stages}|${n.join(",")}`})}return t}var qd=8e3;function ra(s,e){try{return ti(Td(s,"utf8").trimEnd(),e)}catch{return null}}function Ld(s,e,t){return e.activeUnit?ra(ui(s),t):null}function es(s,e,t,n){let i=ia(Ld(s,e,t),e,t,n);if(i.length<=qd||!e.activeUnit)return i;let r=ra(fi(s),t);return r?ia(r,e,t,n):i}function ia(s,e,t,n){let i=["BuildKeel:"];for(let r of Yn(e,t)){let o=r.key==="unit"&&e.activeUnit?s?n?" Its context is loaded again below.":" Its context follows.":" BuildKeel has no context for it; call the BuildKeel get_context tool to see why.":"";i.push(`- ${r.text}${o}`)}return s&&i.push("",s),i.join(`
|
|
139
|
+
`)}var oa=({event:s,codeRoot:e,cache:t,host:n})=>s.kind!=="session-start"?null:{context:es(e,t,n,s.reason==="compact")};var fa=(s,e,t)=>ts(s,P,"conversations",`${e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,100)}.${t}`),Rd=(s,e)=>fa(s,e,"json"),da=(s,e)=>fa(s,e,"notices");function ha(s,e,t){let n=da(s,e);la(ts(n,".."),{recursive:!0}),Id(n,`${JSON.stringify(t)}
|
|
140
|
+
`)}function jd(s,e){let t=da(s,e),n=hi(t),i;try{ua(t,n),i=ca(n,"utf8")}catch{return[]}finally{Md(n,{force:!0})}return i.split(`
|
|
141
|
+
`).filter(Boolean).flatMap(r=>{try{return[String(JSON.parse(r))]}catch{return[]}})}function Fd(s){try{let e=JSON.parse(ca(s,"utf8"));return e.version===1?e:null}catch{return null}}function aa(s,e){la(ts(s,".."),{recursive:!0});let t=`${s}.${process.pid}.tmp`;xd(t,`${JSON.stringify(e,null,2)}
|
|
142
|
+
`),ua(t,s)}var pa=s=>s==="~"||s.startsWith("~/")?ts(Kd(),s.slice(1)):s;function Hd(s,e){let t;try{t=Pd(pa(s),"r")}catch{return{ok:!1,offset:e,checkpoint:null}}try{let n=_d(t).size,i=n<e?0:e,r=Buffer.alloc(n-i),o=r.length>0?Dd(t,r,0,r.length,i):0,a=r.subarray(0,o).lastIndexOf(10);if(a<0)return{ok:!0,offset:i,checkpoint:null};let l=!0,c=null;for(let h of r.subarray(0,a).toString("utf8").split(`
|
|
143
|
+
`))if(h.trim())try{let u=JSON.parse(h);typeof u.step_index!="number"||typeof u.type!="string"?l=!1:u.type==="CHECKPOINT"&&(c=Math.max(c??-1,u.step_index))}catch{l=!1}return{ok:l,offset:i+a+1,checkpoint:c}}catch{return{ok:!1,offset:e,checkpoint:null}}finally{$d(t)}}function Ud(s){if(!s)return 0;try{return Bd(pa(s)).size}catch{return 0}}var ma=s=>{if(s.event.kind!=="prompt")return null;let e=jd(s.codeRoot,s.event.conversation),n=[Yd(s)?.context,...e].filter(Boolean).join(`
|
|
144
|
+
|
|
145
|
+
`);return n?{context:n}:null},Yd=({event:s,codeRoot:e,cache:t,host:n})=>{if(s.kind!=="prompt")return null;let i=Rd(e,s.conversation),r=Yn(t,n),o=Object.fromEntries(r.map(f=>[f.key,f.fingerprint])),a=Fd(i);if(!a)return aa(i,{version:1,startedAt:new Date().toISOString(),reported:o,transcript:{offset:Ud(s.transcript),checkpoint:null}}),{context:es(e,t,n,!1)};let l=s.transcript?Hd(s.transcript,a.transcript.offset):{ok:!1,offset:a.transcript.offset,checkpoint:null},c=l.checkpoint!==null&&(a.transcript.checkpoint===null||l.checkpoint>a.transcript.checkpoint),h={...a,transcript:{offset:l.offset,checkpoint:c?l.checkpoint:a.transcript.checkpoint}},u=null;if(c)u=es(e,t,n,!0),h.reported=o;else if(s.newMessage){let f=r.filter(p=>a.reported[p.key]!==p.fingerprint).map(p=>`- ${p.text}`);if(!l.ok&&t.activeUnit){let p=`- Active unit: ${t.activeUnit}. If its requirements and test cases are no longer in view, call the BuildKeel get_context tool.`,y=f.findIndex(d=>d.startsWith("- Active unit:"));y>=0?f[y]=`${f[y]} If its requirements and test cases are no longer in view, call the BuildKeel get_context tool.`:f.unshift(p)}f.length>0&&(u=["BuildKeel:",...f].join(`
|
|
146
|
+
`)),h.reported=o}return JSON.stringify(h)!==JSON.stringify(a)&&aa(i,h),u?{context:u}:null};import{appendFileSync as th,mkdirSync as sh}from"node:fs";import{dirname as nh,join as ih,resolve as rh}from"node:path";import{existsSync as Jd,realpathSync as ga}from"node:fs";import{basename as va,dirname as ya,isAbsolute as Vd,join as Wd,relative as Na,resolve as Gd,sep as Qd}from"node:path";var Jn={versions:"the frozen copy",approvals:"an approval record",completions:"a completion record",repins:"a re-pin decision record"},zd={"test-plan":"TP",design:"DD"},Xd=process.platform==="win32",T=s=>Xd?s.toLowerCase():s;function le(s,e){let t=ba(s,e);if(t!==null)return t;try{let n=e;for(;!Jd(n)&&ya(n)!==n;)n=ya(n);let i=Wd(ga(n),Na(n,e));return ba(ga(s),i)}catch{return null}}var ce=(s,e)=>le(s,e);function ba(s,e){let t=Na(s,e);return t===""||t.startsWith("..")||Vd(t)?null:t.split(Qd).join("/")}var wa="Make the change you want through a new change, drafted with the BuildKeel save_draft tool (type change): finishing it writes the next versions.",Zd="It is kept, read-only, as the history of how the system came to be before this spec tree moved to Full SDLC. Change behavior through the team's stages, as a new version of the artifact it became.";function Sa(s,e){if(s.conversion!=="finished")return eh(s,e);if(T(e)===T("onboarding/conversion.yaml"))return`BuildKeel: ${e} records how this spec tree moved to Full SDLC, and where each scenario went. It was finished when the tree switched, and is never edited.`;let[t]=e.split("/").map(T);return t!==T("capabilities")&&t!==T("changes")?null:`BuildKeel: ${e} is part of the capability specs and changes this spec tree had before it moved to Full SDLC. ${Zd}`}function eh(s,e){let t=e.split("/"),[n,,i]=t.map(T);if(n===T("capabilities")&&t.length>=3){let a=/^v(0|[1-9][0-9]*)\.(md|yaml)$/.exec(va(e)),l=a?`${t[1]} v${a[1]}`:t[1]??"",c=a?.[2]==="yaml"?`the record of ${l}`:a?`${l}, a capability spec version`:`part of capability ${l}`;return`BuildKeel: ${e} is ${c}, written when a change was archived. Capability specs are never edited directly. ${wa}`}if(n!==T("changes")||t.length<3)return null;let r=na((t[1]??"").toUpperCase()),o=r??t[1]??"";return t.length===3&&i===T("discarded.yaml")?`BuildKeel: ${e} is the discard record of ${o}. BuildKeel writes it once when a change is discarded, and it is never edited.`:t.length===3&&i===T("archive.yaml")?`BuildKeel: ${e} is the archive record of ${o}, written once when it was archived. It is never edited.`:t.length===4&&i!==void 0&&Object.hasOwn(Jn,i)?`BuildKeel: ${e} is ${Jn[i]} of ${o}. BuildKeel writes these records once and they are never edited, by hand or by the agent.`:r&&(s.archivedChanges??[]).some(a=>T(a)===T(r))?`BuildKeel: ${e} belongs to ${o}, which is archived: its files are its record and are never edited. ${wa}`:null}function Xe(s,e){let t=ce(s.specRoot,e);return t===null?null:/^bugs\/[^/]+\/closed\.yaml$/.test(T(t))?`BuildKeel: ${t} is the closing record of ${t.split("/")[1]}. BuildKeel writes it once when the bug is closed, and it is never edited. A defect that returns is a new bug.`:s.mode==="spec-driven"?Sa(s,t)??(s.conversion?ka(s,t):null):(s.conversion==="finished"?Sa(s,t):null)??ka(s,t)}function ka(s,e){let t=e.split("/"),n=s.documents??zd,i=t.length>=4&&t[2]!==void 0&&Object.hasOwn(n,t[2])?n[t[2]]:void 0,r=i!==void 0,o=t[r?3:2],a=`${t[1]??""}${r?`-${i}`:""}`,l=r?5:4;if(o&&t.length===l&&s.lockedDirs.map(T).includes(T(o))){if(T(o)==="versions"){let u=/^v(0|[1-9][0-9]*)\.md$/.exec(va(e))?.[1],f=u?`${a} v${u}`:a;return`BuildKeel: ${e} is the frozen copy of ${f}, which is approved and cannot be changed. To change ${a}, call the BuildKeel save_draft tool with id ${a} and the whole changed file: that opens the next version as a draft, and the approved version stays in force until the new one is approved.`}let h=Jn[o.toLowerCase()]??"a record";return`BuildKeel: ${e} is ${h} of ${a}. BuildKeel writes these records once and they are never edited, by hand or by the agent.`+(T(o)==="approvals"?" To approve a new version, use the BuildKeel approve tool.":"")}if((s.lockedSources??[]).find(h=>T(e).startsWith(`${T(h)}/`))){let h=`${t[1]??""}${r?`-${i}`:""}`;return`BuildKeel: ${e} is a source kept with ${h} v0, frozen when version 0 was approved: sources stay exactly as they were read. To change what ${h} says, call the BuildKeel save_draft tool with id ${h} and the whole changed file: that opens its next version as a draft.`}return s.lockedFiles.some(h=>T(h)===T(e))?`BuildKeel: ${e} is the working file of ${a}, which is approved and has no new version open, so it is not edited directly. To change ${a}, call the BuildKeel save_draft tool with id ${a} and the whole changed file: that opens the next version as a draft, and the approved version stays in force until the new one is approved.`:null}var Aa=({event:s,cache:e})=>{if(s.kind!=="before-edit"&&s.kind!=="after-edit")return null;let t=e.lockMode??"block";if(!(t==="block"?s.kind==="before-edit":t==="warn"&&s.kind==="after-edit"))return null;let i=s.files.map(r=>Xe(e,Gd(s.cwd,r))).filter(r=>r!==null);return i.length===0?null:s.kind==="before-edit"?{block:[...new Set(i)].join(`
|
|
11
147
|
|
|
12
148
|
`)}:{context:i.map(r=>`BuildKeel: this tree's lock gate is set to warn, so the edit went ahead. ${r.replace(/^BuildKeel: /,"")} Validation and the status overview report the change. Tell the user, and undo it unless they asked for it.`).join(`
|
|
13
149
|
|
|
14
|
-
`)}};var
|
|
150
|
+
`)}};var Vn=(s,e)=>ih(s,P,"journal",`${e}.jsonl`),Oa=({event:s,codeRoot:e,cache:t})=>{if(s.kind!=="after-edit"||!t.activeUnit)return null;let n=new Date().toISOString(),i=[];for(let o of s.files){let a=rh(s.cwd,o);if(Xe(t,a)||ce(t.specRoot,a)!==null)continue;let l=le(e,a);if(l===null||l===P||l.startsWith(`${P}/`))continue;let c={at:n,tool:s.tool,file:l};i.push(JSON.stringify(c))}if(i.length===0)return null;let r=Vn(e,t.activeUnit);return sh(nh(r),{recursive:!0}),th(r,`${i.join(`
|
|
15
151
|
`)}
|
|
16
|
-
`),null};import{resolve as
|
|
17
|
-
`).filter(Boolean);return new Set(
|
|
152
|
+
`),null};var oh=/\bgit(?:\s+-{1,2}[^\s;&|]+(?:\s+(?!push\b)[^\s;&|-][^\s;&|]*)?)*\s+push\b|\bgh\s+pr\s+(?:create|merge)\b/,ah=s=>oh.test(s),Ea=({event:s,cache:e,host:t})=>s.kind!=="before-shell"||!e.activeUnit||!ah(s.command)?null:{context:`BuildKeel: ${Zt(e.activeUnit,e.activeTitle)} is not finished: tell the user to run ${R(t,"done")} before merging. The command goes ahead.`};import{resolve as lh}from"node:path";var Ca=({event:s,codeRoot:e,cache:t,host:n})=>{if(s.kind!=="before-edit"||t.activeUnit||t.untrackedSince)return null;let i=s.files.flatMap(r=>{let o=lh(s.cwd,r);if(ce(t.specRoot,o)!==null)return[];let a=le(e,o);return a===null||a===P||a.startsWith(`${P}/`)?[]:[a]});return i.length===0?null:{block:`BuildKeel: there is no active unit in this working tree, so a change to ${i.join(", ")} would belong to no unit of work. Before changing it, ask the user how to go on, recommending the choice that fits: capture what you discussed, which the user starts by running ${R(n,"capture")} (you cannot start it), turning it into the artifacts the team's process needs, to approve and then build; start the unit it belongs to with ${R(n,"build")} <ID>; record it as an ad-hoc unit, with a short title you propose (create it with the BuildKeel save_draft tool, type adhoc, then start it with start_work); or go ahead without a unit, which only the user can choose (then call the BuildKeel manage tool with action untracked). Make the change once one of these is done.`}};import{readFileSync as ch}from"node:fs";import{resolve as uh}from"node:path";function Wn(s,e){return e.some(t=>t.endsWith("/")?s.startsWith(t):s===t||s.startsWith(`${t}/`))}function Gn(s){let e=s.split("/"),t=e.at(-1)??"";return e.slice(0,-1).some(n=>["test","tests","__tests__","spec"].includes(n))||/[._-](test|spec)\.[^.]+$/.test(t)||/^test_.*\.py$/.test(t)}var Qn=8;function fh(s,e){try{let t=ch(Vn(s,e),"utf8").split(`
|
|
153
|
+
`).filter(Boolean);return new Set(t.map(n=>JSON.parse(n).file))}catch{return new Set}}var Ta=({event:s,codeRoot:e,cache:t})=>{if(s.kind!=="after-edit"||!t.activeUnit||t.scope.length===0)return null;let n=fh(e,t.activeUnit),i=[];for(let a of s.files){let l=uh(s.cwd,a);if(Xe(t,l)||ce(t.specRoot,l)!==null)continue;let c=le(e,l);c===null||c===P||c.startsWith(`${P}/`)||!Wn(c,t.scope)&&!Gn(c)&&!n.has(c)&&!i.includes(c)&&i.push(c)}if(i.length===0)return null;let r=t.activeUnit,o=t.scope.slice(0,Qn).join(", ")+(t.scope.length>Qn?`, and ${t.scope.length-Qn} more`:"");return{context:`BuildKeel: ${i.join(", ")} ${i.length===1?"is":"are"} outside the areas ${r} relates to so far (${o}): its scope and its story's, and what its own work and the other work on its story changed. If the change belongs to ${r}, carry on and tell the user it widens what ${r} touches. If it belongs to other work, stop and ask the user which unit it belongs to.`}};function qa(s,e,t="claude-code"){if(s.kind==="ignored")return{};let n=et(s.cwd);if(!n)return{};let i=di(n);if(!i)return{};let r=e.map(l=>l({event:s,codeRoot:n,cache:i,host:t})).filter(l=>l!==null),o=r.find(l=>l.block)?.block,a=r.map(l=>l.context).filter(Boolean).join(`
|
|
18
154
|
|
|
19
|
-
`);return s
|
|
20
|
-
`),1;let i=
|
|
21
|
-
`);let
|
|
22
|
-
`);let{stdout:
|
|
155
|
+
`);return a&&s.kind==="after-edit"&&s.deferTo?(ha(n,s.deferTo,a),o?{block:o}:{}):{...o?{block:o}:{},...a?{context:a}:{}}}var La=[Aa,Ca,Ta,Oa,oa,ma,Ea];var ph={"claude-code":ci,antigravity:ai};function mh(s){let e=s.indexOf("--host"),t=e>=0?s[e+1]:void 0,n=t&&ei(t)?ph[t]:void 0;if(!n)return process.stderr.write(`BuildKeel hook: unsupported host "${t??""}".
|
|
156
|
+
`),1;let i=s.filter((r,o)=>o!==e&&o!==e+1);try{let r=hh(0,"utf8");process.env.BUILDKEEL_HOOK_LOG&&dh(process.env.BUILDKEEL_HOOK_LOG,`${JSON.stringify({host:t,args:i,input:r.trim()?JSON.parse(r):null})}
|
|
157
|
+
`);let o=n.parse(r.trim()?JSON.parse(r):{},i),a=qa(o,La,t),{stdout:l,exitCode:c}=n.render(a,o);return l&&process.stdout.write(l),c}catch(r){process.stderr.write(`BuildKeel hook failed: ${r instanceof Error?r.message:String(r)}
|
|
158
|
+
`);let{stdout:o,exitCode:a}=n.failed(i);return o&&process.stdout.write(o),a}}process.exitCode=mh(process.argv.slice(2));
|