faf 8.1.1 → 8.2.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/dist/index.js CHANGED
@@ -1,182 +1,182 @@
1
- import{createRequire as Fz}from"node:module";var Mz=Object.defineProperty;var _=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Oz=($)=>$;function _z($,Z){this[$]=Oz.bind(null,Z)}var Pz=($,Z)=>{for(var Q in Z)Mz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:_z.bind(Z,Q)})};var W$=Fz(import.meta.url);var x=_((dz)=>{var Z1=Symbol.for("yaml.alias"),h5=Symbol.for("yaml.document"),M6=Symbol.for("yaml.map"),u5=Symbol.for("yaml.pair"),Q1=Symbol.for("yaml.scalar"),O6=Symbol.for("yaml.seq"),v0=Symbol.for("yaml.node.type"),hz=($)=>!!$&&typeof $==="object"&&$[v0]===Z1,uz=($)=>!!$&&typeof $==="object"&&$[v0]===h5,fz=($)=>!!$&&typeof $==="object"&&$[v0]===M6,mz=($)=>!!$&&typeof $==="object"&&$[v0]===u5,f5=($)=>!!$&&typeof $==="object"&&$[v0]===Q1,pz=($)=>!!$&&typeof $==="object"&&$[v0]===O6;function m5($){if($&&typeof $==="object")switch($[v0]){case M6:case O6:return!0}return!1}function lz($){if($&&typeof $==="object")switch($[v0]){case Z1:case M6:case Q1:case O6:return!0}return!1}var cz=($)=>(f5($)||m5($))&&!!$.anchor;dz.ALIAS=Z1;dz.DOC=h5;dz.MAP=M6;dz.NODE_TYPE=v0;dz.PAIR=u5;dz.SCALAR=Q1;dz.SEQ=O6;dz.hasAnchor=cz;dz.isAlias=hz;dz.isCollection=m5;dz.isDocument=uz;dz.isMap=fz;dz.isNode=lz;dz.isPair=mz;dz.isScalar=f5;dz.isSeq=pz});var L$=_((GX)=>{var r=x(),z0=Symbol("break visit"),p5=Symbol("skip children"),C0=Symbol("remove node");function _6($,Z){let Q=l5(Z);if(r.isDocument($)){if(g2(null,$.contents,Q,Object.freeze([$]))===C0)$.contents=null}else g2(null,$,Q,Object.freeze([]))}_6.BREAK=z0;_6.SKIP=p5;_6.REMOVE=C0;function g2($,Z,Q,z){let X=c5($,Z,Q,z);if(r.isNode(X)||r.isPair(X))return d5($,z,X),g2($,X,Q,z);if(typeof X!=="symbol"){if(r.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let H=g2(U,Z.items[U],Q,z);if(typeof H==="number")U=H-1;else if(H===z0)return z0;else if(H===C0)Z.items.splice(U,1),U-=1}}else if(r.isPair(Z)){z=Object.freeze(z.concat(Z));let U=g2("key",Z.key,Q,z);if(U===z0)return z0;else if(U===C0)Z.key=null;let H=g2("value",Z.value,Q,z);if(H===z0)return z0;else if(H===C0)Z.value=null}}return X}async function P6($,Z){let Q=l5(Z);if(r.isDocument($)){if(await v2(null,$.contents,Q,Object.freeze([$]))===C0)$.contents=null}else await v2(null,$,Q,Object.freeze([]))}P6.BREAK=z0;P6.SKIP=p5;P6.REMOVE=C0;async function v2($,Z,Q,z){let X=await c5($,Z,Q,z);if(r.isNode(X)||r.isPair(X))return d5($,z,X),v2($,X,Q,z);if(typeof X!=="symbol"){if(r.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let H=await v2(U,Z.items[U],Q,z);if(typeof H==="number")U=H-1;else if(H===z0)return z0;else if(H===C0)Z.items.splice(U,1),U-=1}}else if(r.isPair(Z)){z=Object.freeze(z.concat(Z));let U=await v2("key",Z.key,Q,z);if(U===z0)return z0;else if(U===C0)Z.key=null;let H=await v2("value",Z.value,Q,z);if(H===z0)return z0;else if(H===C0)Z.value=null}}return X}function l5($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function c5($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(r.isMap(Z))return Q.Map?.($,Z,z);if(r.isSeq(Z))return Q.Seq?.($,Z,z);if(r.isPair(Z))return Q.Pair?.($,Z,z);if(r.isScalar(Z))return Q.Scalar?.($,Z,z);if(r.isAlias(Z))return Q.Alias?.($,Z,z);return}function d5($,Z,Q){let z=Z[Z.length-1];if(r.isCollection(z))z.items[$]=Q;else if(r.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(r.isDocument(z))z.contents=Q;else{let X=r.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}GX.visit=_6;GX.visitAsync=P6});var z1=_((KX)=>{var i5=x(),WX=L$(),BX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},qX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>BX[Z]);class J0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J0.defaultYaml,$),this.tags=Object.assign({},J0.defaultTags,Z)}clone(){let $=new J0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new J0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:J0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,U]=Q;return this.tags[X]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let U=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,U),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let U=$.slice(2,-1);if(U==="!"||U==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return U}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(U){return Z(String(U)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+qX($.substring(Q.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Q=Object.entries(this.tags),z;if($&&Q.length>0&&i5.isNode($.contents)){let X={};WX.visit($.contents,(U,H)=>{if(i5.isNode(H)&&H.tag)X[H.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,U]of Q){if(X==="!!"&&U==="tag:yaml.org,2002:")continue;if(!$||z.some((H)=>H.startsWith(U)))Z.push(`%TAG ${X} ${U}`)}return Z.join(`
2
- `)}}J0.defaultYaml={explicit:!1,version:"1.2"};J0.defaultTags={"!!":"tag:yaml.org,2002:"};KX.Directives=J0});var F6=_((OX)=>{var n5=x(),LX=L$();function IX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function r5($){let Z=new Set;return LX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function s5($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function MX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(U)=>{Q.push(U),X??(X=r5($));let H=s5(Z,X);return X.add(H),H},setAnchors:()=>{for(let U of Q){let H=z.get(U);if(typeof H==="object"&&H.anchor&&(n5.isScalar(H.node)||n5.isCollection(H.node)))H.node.anchor=H.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=U,J}}},sourceObjects:z}}OX.anchorIsValid=IX;OX.anchorNames=r5;OX.createNodeAnchors=MX;OX.findNewAnchor=s5});var X1=_((RX)=>{function I$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,U=z.length;X<U;++X){let H=z[X],J=I$($,z,String(X),H);if(J===void 0)delete z[X];else if(J!==H)z[X]=J}else if(z instanceof Map)for(let X of Array.from(z.keys())){let U=z.get(X),H=I$($,z,X,U);if(H===void 0)z.delete(X);else if(H!==U)z.set(X,H)}else if(z instanceof Set)for(let X of Array.from(z)){let U=I$($,z,X,X);if(U===void 0)z.delete(X);else if(U!==X)z.delete(X),z.add(U)}else for(let[X,U]of Object.entries(z)){let H=I$($,z,X,U);if(H===void 0)delete z[X];else if(H!==U)z[X]=H}return $.call(Z,Q,z)}RX.applyReviver=I$});var c0=_((CX)=>{var AX=x();function o5($,Z,Q){if(Array.isArray($))return $.map((z,X)=>o5(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!AX.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(U)=>{z.res=U,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}CX.toJS=o5});var N6=_((EX)=>{var wX=X1(),a5=x(),SX=c0();class t5{constructor($){Object.defineProperty(this,a5.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:Z,maxAliasCount:Q,onAnchor:z,reviver:X}={}){if(!a5.isDocument($))throw TypeError("A document argument is required");let U={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},H=SX.toJS(this,"",U);if(typeof z==="function")for(let{count:J,res:G}of U.anchors.values())z(G,J);return typeof X==="function"?wX.applyReviver(X,{"":H},"",H):H}}EX.NodeBase=t5});var M$=_((kX)=>{var yX=F6(),xX=L$(),k2=x(),gX=N6(),vX=c0();class e5 extends gX.NodeBase{constructor($){super(k2.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){if(Z?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let Q;if(Z?.aliasResolveCache)Q=Z.aliasResolveCache;else if(Q=[],xX.visit($,{Node:(X,U)=>{if(k2.isAlias(U)||k2.hasAnchor(U))Q.push(U)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,U=this.resolve(z,Z);if(!U){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let H=Q.get(U);if(!H)vX.toJS(U,null,Z),H=Q.get(U);if(H?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(H.count+=1,H.aliasCount===0)H.aliasCount=R6(z,U,Q);if(H.count*H.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return H.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(yX.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if($.implicitKey)return`${z} `}return z}}function R6($,Z,Q){if(k2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(k2.isCollection(Z)){let z=0;for(let X of Z.items){let U=R6($,X,Q);if(U>z)z=U}return z}else if(k2.isPair(Z)){let z=R6($,Z.key,Q),X=R6($,Z.value,Q);return Math.max(z,X)}return 1}kX.Alias=e5});var d=_((lX)=>{var uX=x(),fX=N6(),mX=c0(),pX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class U2 extends fX.NodeBase{constructor($){super(uX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:mX.toJS(this.value,$,Z)}toString(){return String(this.value)}}U2.BLOCK_FOLDED="BLOCK_FOLDED";U2.BLOCK_LITERAL="BLOCK_LITERAL";U2.PLAIN="PLAIN";U2.QUOTE_DOUBLE="QUOTE_DOUBLE";U2.QUOTE_SINGLE="QUOTE_SINGLE";lX.Scalar=U2;lX.isScalarValue=pX});var O$=_((oX)=>{var iX=M$(),H2=x(),$Z=d(),nX="tag:yaml.org,2002:";function rX($,Z,Q){if(Z){let z=Q.filter((U)=>U.tag===Z),X=z.find((U)=>!U.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function sX($,Z,Q){if(H2.isDocument($))$=$.contents;if(H2.isNode($))return $;if(H2.isPair($)){let W=Q.schema[H2.MAP].createNode?.(Q.schema,null,Q);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:X,onTagObj:U,schema:H,sourceObjects:J}=Q,G=void 0;if(z&&$&&typeof $==="object")if(G=J.get($),G)return G.anchor??(G.anchor=X($)),new iX.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(Z?.startsWith("!!"))Z=nX+Z.slice(2);let V=rX($,Z,H.tags);if(!V){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new $Z.Scalar($);if(G)G.node=W;return W}V=$ instanceof Map?H[H2.MAP]:(Symbol.iterator in Object($))?H[H2.SEQ]:H[H2.MAP]}if(U)U(V),delete Q.onTagObj;let Y=V?.createNode?V.createNode(Q.schema,$,Q):typeof V?.nodeClass?.from==="function"?V.nodeClass.from(Q.schema,$,Q):new $Z.Scalar($);if(Z)Y.tag=Z;else if(!V.default)Y.tag=V.tag;if(G)G.node=Y;return Y}oX.createNode=sX});var T6=_(($U)=>{var tX=O$(),j0=x(),eX=N6();function U1($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let U=Z[X];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let H=[];H[U]=z,z=H}else z=new Map([[U,z]])}return tX.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var ZZ=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class QZ extends eX.NodeBase{constructor($,Z){super($);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone($){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)Z.schema=$;if(Z.items=Z.items.map((Q)=>j0.isNode(Q)||j0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(ZZ($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(j0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,U1(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}deleteIn($){let[Z,...Q]=$;if(Q.length===0)return this.delete(Z);let z=this.get(Z,!0);if(j0.isCollection(z))return z.deleteIn(Q);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${Q}`)}getIn($,Z){let[Q,...z]=$,X=this.get(Q,!0);if(z.length===0)return!Z&&j0.isScalar(X)?X.value:X;else return j0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!j0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&j0.isScalar(Q)&&Q.value==null&&!Q.commentBefore&&!Q.comment&&!Q.tag})}hasIn($){let[Z,...Q]=$;if(Q.length===0)return this.has(Z);let z=this.get(Z,!0);return j0.isCollection(z)?z.hasIn(Q):!1}setIn($,Z){let[Q,...z]=$;if(z.length===0)this.set(Q,Z);else{let X=this.get(Q,!0);if(j0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,U1(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}$U.Collection=QZ;$U.collectionFromPath=U1;$U.isEmptyPath=ZZ});var _$=_((HU)=>{var XU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function H1($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var UU=($,Z,Q)=>$.endsWith(`
3
- `)?H1(Q,Z):Q.includes(`
1
+ import{createRequire as Nz}from"node:module";var Mz=Object.defineProperty;var M=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Pz=($)=>$;function Fz($,Z){this[$]=Pz.bind(null,Z)}var Rz=($,Z)=>{for(var Q in Z)Mz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:Fz.bind(Z,Q)})};var K$=Nz(import.meta.url);var x=M((nz)=>{var H5=Symbol.for("yaml.alias"),c1=Symbol.for("yaml.document"),O6=Symbol.for("yaml.map"),d1=Symbol.for("yaml.pair"),U5=Symbol.for("yaml.scalar"),_6=Symbol.for("yaml.seq"),k0=Symbol.for("yaml.node.type"),fz=($)=>!!$&&typeof $==="object"&&$[k0]===H5,mz=($)=>!!$&&typeof $==="object"&&$[k0]===c1,pz=($)=>!!$&&typeof $==="object"&&$[k0]===O6,lz=($)=>!!$&&typeof $==="object"&&$[k0]===d1,i1=($)=>!!$&&typeof $==="object"&&$[k0]===U5,cz=($)=>!!$&&typeof $==="object"&&$[k0]===_6;function n1($){if($&&typeof $==="object")switch($[k0]){case O6:case _6:return!0}return!1}function dz($){if($&&typeof $==="object")switch($[k0]){case H5:case O6:case U5:case _6:return!0}return!1}var iz=($)=>(i1($)||n1($))&&!!$.anchor;nz.ALIAS=H5;nz.DOC=c1;nz.MAP=O6;nz.NODE_TYPE=k0;nz.PAIR=d1;nz.SCALAR=U5;nz.SEQ=_6;nz.hasAnchor=iz;nz.isAlias=fz;nz.isCollection=n1;nz.isDocument=mz;nz.isMap=pz;nz.isNode=dz;nz.isPair=lz;nz.isScalar=i1;nz.isSeq=cz});var _$=M((YX)=>{var r=x(),z0=Symbol("break visit"),r1=Symbol("skip children"),C0=Symbol("remove node");function M6($,Z){let Q=s1(Z);if(r.isDocument($)){if(k2(null,$.contents,Q,Object.freeze([$]))===C0)$.contents=null}else k2(null,$,Q,Object.freeze([]))}M6.BREAK=z0;M6.SKIP=r1;M6.REMOVE=C0;function k2($,Z,Q,z){let X=o1($,Z,Q,z);if(r.isNode(X)||r.isPair(X))return a1($,z,X),k2($,X,Q,z);if(typeof X!=="symbol"){if(r.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=k2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===z0)return z0;else if(U===C0)Z.items.splice(H,1),H-=1}}else if(r.isPair(Z)){z=Object.freeze(z.concat(Z));let H=k2("key",Z.key,Q,z);if(H===z0)return z0;else if(H===C0)Z.key=null;let U=k2("value",Z.value,Q,z);if(U===z0)return z0;else if(U===C0)Z.value=null}}return X}async function P6($,Z){let Q=s1(Z);if(r.isDocument($)){if(await h2(null,$.contents,Q,Object.freeze([$]))===C0)$.contents=null}else await h2(null,$,Q,Object.freeze([]))}P6.BREAK=z0;P6.SKIP=r1;P6.REMOVE=C0;async function h2($,Z,Q,z){let X=await o1($,Z,Q,z);if(r.isNode(X)||r.isPair(X))return a1($,z,X),h2($,X,Q,z);if(typeof X!=="symbol"){if(r.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=await h2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===z0)return z0;else if(U===C0)Z.items.splice(H,1),H-=1}}else if(r.isPair(Z)){z=Object.freeze(z.concat(Z));let H=await h2("key",Z.key,Q,z);if(H===z0)return z0;else if(H===C0)Z.key=null;let U=await h2("value",Z.value,Q,z);if(U===z0)return z0;else if(U===C0)Z.value=null}}return X}function s1($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function o1($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(r.isMap(Z))return Q.Map?.($,Z,z);if(r.isSeq(Z))return Q.Seq?.($,Z,z);if(r.isPair(Z))return Q.Pair?.($,Z,z);if(r.isScalar(Z))return Q.Scalar?.($,Z,z);if(r.isAlias(Z))return Q.Alias?.($,Z,z);return}function a1($,Z,Q){let z=Z[Z.length-1];if(r.isCollection(z))z.items[$]=Q;else if(r.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(r.isDocument(z))z.contents=Q;else{let X=r.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}YX.visit=M6;YX.visitAsync=P6});var J5=M((LX)=>{var t1=x(),qX=_$(),KX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},DX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>KX[Z]);class J0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J0.defaultYaml,$),this.tags=Object.assign({},J0.defaultTags,Z)}clone(){let $=new J0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new J0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:J0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,H]=Q;return this.tags[X]=H,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let H=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,H),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let H=$.slice(2,-1);if(H==="!"||H==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return H}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(H){return Z(String(H)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+DX($.substring(Q.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Q=Object.entries(this.tags),z;if($&&Q.length>0&&t1.isNode($.contents)){let X={};qX.visit($.contents,(H,U)=>{if(t1.isNode(U)&&U.tag)X[U.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,H]of Q){if(X==="!!"&&H==="tag:yaml.org,2002:")continue;if(!$||z.some((U)=>U.startsWith(H)))Z.push(`%TAG ${X} ${H}`)}return Z.join(`
2
+ `)}}J0.defaultYaml={explicit:!1,version:"1.2"};J0.defaultTags={"!!":"tag:yaml.org,2002:"};LX.Directives=J0});var F6=M((PX)=>{var e1=x(),OX=_$();function _X($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function $4($){let Z=new Set;return OX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function Z4($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function MX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(H)=>{Q.push(H),X??(X=$4($));let U=Z4(Z,X);return X.add(U),U},setAnchors:()=>{for(let H of Q){let U=z.get(H);if(typeof U==="object"&&U.anchor&&(e1.isScalar(U.node)||e1.isCollection(U.node)))U.node.anchor=U.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=H,J}}},sourceObjects:z}}PX.anchorIsValid=_X;PX.anchorNames=$4;PX.createNodeAnchors=MX;PX.findNewAnchor=Z4});var G5=M((AX)=>{function M$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,H=z.length;X<H;++X){let U=z[X],J=M$($,z,String(X),U);if(J===void 0)delete z[X];else if(J!==U)z[X]=J}else if(z instanceof Map)for(let X of Array.from(z.keys())){let H=z.get(X),U=M$($,z,X,H);if(U===void 0)z.delete(X);else if(U!==H)z.set(X,U)}else if(z instanceof Set)for(let X of Array.from(z)){let H=M$($,z,X,X);if(H===void 0)z.delete(X);else if(H!==X)z.delete(X),z.add(H)}else for(let[X,H]of Object.entries(z)){let U=M$($,z,X,H);if(U===void 0)delete z[X];else if(U!==H)z[X]=U}return $.call(Z,Q,z)}AX.applyReviver=M$});var d0=M((wX)=>{var jX=x();function Q4($,Z,Q){if(Array.isArray($))return $.map((z,X)=>Q4(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!jX.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(H)=>{z.res=H,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}wX.toJS=Q4});var R6=M((yX)=>{var EX=G5(),z4=x(),bX=d0();class X4{constructor($){Object.defineProperty(this,z4.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:Z,maxAliasCount:Q,onAnchor:z,reviver:X}={}){if(!z4.isDocument($))throw TypeError("A document argument is required");let H={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},U=bX.toJS(this,"",H);if(typeof z==="function")for(let{count:J,res:G}of H.anchors.values())z(G,J);return typeof X==="function"?EX.applyReviver(X,{"":U},"",U):U}}yX.NodeBase=X4});var P$=M((uX)=>{var gX=F6(),vX=_$(),u2=x(),kX=R6(),hX=d0();class H4 extends kX.NodeBase{constructor($){super(u2.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){if(Z?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let Q;if(Z?.aliasResolveCache)Q=Z.aliasResolveCache;else if(Q=[],vX.visit($,{Node:(X,H)=>{if(u2.isAlias(H)||u2.hasAnchor(H))Q.push(H)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,H=this.resolve(z,Z);if(!H){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let U=Q.get(H);if(!U)hX.toJS(H,null,Z),U=Q.get(H);if(U?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(U.count+=1,U.aliasCount===0)U.aliasCount=N6(z,H,Q);if(U.count*U.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return U.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(gX.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if($.implicitKey)return`${z} `}return z}}function N6($,Z,Q){if(u2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(u2.isCollection(Z)){let z=0;for(let X of Z.items){let H=N6($,X,Q);if(H>z)z=H}return z}else if(u2.isPair(Z)){let z=N6($,Z.key,Q),X=N6($,Z.value,Q);return Math.max(z,X)}return 1}uX.Alias=H4});var d=M((dX)=>{var mX=x(),pX=R6(),lX=d0(),cX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class H2 extends pX.NodeBase{constructor($){super(mX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:lX.toJS(this.value,$,Z)}toString(){return String(this.value)}}H2.BLOCK_FOLDED="BLOCK_FOLDED";H2.BLOCK_LITERAL="BLOCK_LITERAL";H2.PLAIN="PLAIN";H2.QUOTE_DOUBLE="QUOTE_DOUBLE";H2.QUOTE_SINGLE="QUOTE_SINGLE";dX.Scalar=H2;dX.isScalarValue=cX});var F$=M((tX)=>{var rX=P$(),U2=x(),U4=d(),sX="tag:yaml.org,2002:";function oX($,Z,Q){if(Z){let z=Q.filter((H)=>H.tag===Z),X=z.find((H)=>!H.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function aX($,Z,Q){if(U2.isDocument($))$=$.contents;if(U2.isNode($))return $;if(U2.isPair($)){let W=Q.schema[U2.MAP].createNode?.(Q.schema,null,Q);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:X,onTagObj:H,schema:U,sourceObjects:J}=Q,G=void 0;if(z&&$&&typeof $==="object")if(G=J.get($),G)return G.anchor??(G.anchor=X($)),new rX.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(Z?.startsWith("!!"))Z=sX+Z.slice(2);let V=oX($,Z,U.tags);if(!V){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new U4.Scalar($);if(G)G.node=W;return W}V=$ instanceof Map?U[U2.MAP]:(Symbol.iterator in Object($))?U[U2.SEQ]:U[U2.MAP]}if(H)H(V),delete Q.onTagObj;let Y=V?.createNode?V.createNode(Q.schema,$,Q):typeof V?.nodeClass?.from==="function"?V.nodeClass.from(Q.schema,$,Q):new U4.Scalar($);if(Z)Y.tag=Z;else if(!V.default)Y.tag=V.tag;if(G)G.node=Y;return Y}tX.createNode=aX});var T6=M((QH)=>{var $H=F$(),j0=x(),ZH=R6();function V5($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let H=Z[X];if(typeof H==="number"&&Number.isInteger(H)&&H>=0){let U=[];U[H]=z,z=U}else z=new Map([[H,z]])}return $H.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var J4=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class G4 extends ZH.NodeBase{constructor($,Z){super($);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone($){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)Z.schema=$;if(Z.items=Z.items.map((Q)=>j0.isNode(Q)||j0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(J4($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(j0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,V5(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}deleteIn($){let[Z,...Q]=$;if(Q.length===0)return this.delete(Z);let z=this.get(Z,!0);if(j0.isCollection(z))return z.deleteIn(Q);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${Q}`)}getIn($,Z){let[Q,...z]=$,X=this.get(Q,!0);if(z.length===0)return!Z&&j0.isScalar(X)?X.value:X;else return j0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!j0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&j0.isScalar(Q)&&Q.value==null&&!Q.commentBefore&&!Q.comment&&!Q.tag})}hasIn($){let[Z,...Q]=$;if(Q.length===0)return this.has(Z);let z=this.get(Z,!0);return j0.isCollection(z)?z.hasIn(Q):!1}setIn($,Z){let[Q,...z]=$;if(z.length===0)this.set(Q,Z);else{let X=this.get(Q,!0);if(j0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,V5(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}QH.Collection=G4;QH.collectionFromPath=V5;QH.isEmptyPath=J4});var R$=M((GH)=>{var UH=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Y5($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var JH=($,Z,Q)=>$.endsWith(`
3
+ `)?Y5(Q,Z):Q.includes(`
4
4
  `)?`
5
- `+H1(Q,Z):($.endsWith(" ")?"":" ")+Q;HU.indentComment=H1;HU.lineComment=UU;HU.stringifyComment=XU});var XZ=_((WU)=>{function YU($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:U=20,onFold:H,onOverflow:J}={}){if(!X||X<0)return $;if(X<U)U=0;let G=Math.max(1+U,1+X-Z.length);if($.length<=G)return $;let V=[],Y={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,U))V.push(0);else W=X-z;let B=void 0,K=void 0,L=!1,q=-1,D=-1,M=-1;if(Q==="block"){if(q=zZ($,q,Z.length),q!==-1)W=q+G}for(let A;A=$[q+=1];){if(Q==="quoted"&&A==="\\"){switch(D=q,$[q+1]){case"x":q+=3;break;case"u":q+=5;break;case"U":q+=9;break;default:q+=1}M=q}if(A===`
6
- `){if(Q==="block")q=zZ($,q,Z.length);W=q+Z.length+G,B=void 0}else{if(A===" "&&K&&K!==" "&&K!==`
5
+ `+Y5(Q,Z):($.endsWith(" ")?"":" ")+Q;GH.indentComment=Y5;GH.lineComment=JH;GH.stringifyComment=UH});var Y4=M((qH)=>{function BH($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:H=20,onFold:U,onOverflow:J}={}){if(!X||X<0)return $;if(X<H)H=0;let G=Math.max(1+H,1+X-Z.length);if($.length<=G)return $;let V=[],Y={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,H))V.push(0);else W=X-z;let B=void 0,K=void 0,L=!1,q=-1,D=-1,O=-1;if(Q==="block"){if(q=V4($,q,Z.length),q!==-1)W=q+G}for(let C;C=$[q+=1];){if(Q==="quoted"&&C==="\\"){switch(D=q,$[q+1]){case"x":q+=3;break;case"u":q+=5;break;case"U":q+=9;break;default:q+=1}O=q}if(C===`
6
+ `){if(Q==="block")q=V4($,q,Z.length);W=q+Z.length+G,B=void 0}else{if(C===" "&&K&&K!==" "&&K!==`
7
7
  `&&K!=="\t"){let F=$[q+1];if(F&&F!==" "&&F!==`
8
- `&&F!=="\t")B=q}if(q>=W)if(B)V.push(B),W=B+G,B=void 0;else if(Q==="quoted"){while(K===" "||K==="\t")K=A,A=$[q+=1],L=!0;let F=q>M+1?q-2:D-1;if(Y[F])return $;V.push(F),Y[F]=!0,W=F+G,B=void 0}else L=!0}K=A}if(L&&J)J();if(V.length===0)return $;if(H)H();let O=$.slice(0,V[0]);for(let A=0;A<V.length;++A){let F=V[A],N=V[A+1]||$.length;if(F===0)O=`
9
- ${Z}${$.slice(0,N)}`;else{if(Q==="quoted"&&Y[F])O+=`${$[F]}\\`;O+=`
10
- ${Z}${$.slice(F+1,N)}`}}return O}function zZ($,Z,Q){let z=Z,X=Z+1,U=$[X];while(U===" "||U==="\t")if(Z<X+Q)U=$[++Z];else{do U=$[++Z];while(U&&U!==`
11
- `);z=Z,X=Z+1,U=$[X]}return z}WU.FOLD_BLOCK="block";WU.FOLD_FLOW="flow";WU.FOLD_QUOTED="quoted";WU.foldFlowLines=YU});var F$=_((OU)=>{var K0=d(),d0=XZ(),C6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),j6=($)=>/^(%|---|\.\.\.)/m.test($);function LU($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let U=0,H=0;U<X;++U)if($[U]===`
12
- `){if(U-H>z)return!0;if(H=U+1,X-H<=z)return!1}return!0}function P$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,U=Z.indent||(j6($)?" ":""),H="",J=0;for(let G=0,V=Q[G];V;V=Q[++G]){if(V===" "&&Q[G+1]==="\\"&&Q[G+2]==="n")H+=Q.slice(J,G)+"\\ ",G+=1,J=G,V="\\";if(V==="\\")switch(Q[G+1]){case"u":{H+=Q.slice(J,G);let Y=Q.substr(G+2,4);switch(Y){case"0000":H+="\\0";break;case"0007":H+="\\a";break;case"000b":H+="\\v";break;case"001b":H+="\\e";break;case"0085":H+="\\N";break;case"00a0":H+="\\_";break;case"2028":H+="\\L";break;case"2029":H+="\\P";break;default:if(Y.substr(0,2)==="00")H+="\\x"+Y.substr(2);else H+=Q.substr(G,6)}G+=5,J=G+1}break;case"n":if(z||Q[G+2]==='"'||Q.length<X)G+=1;else{H+=Q.slice(J,G)+`
8
+ `&&F!=="\t")B=q}if(q>=W)if(B)V.push(B),W=B+G,B=void 0;else if(Q==="quoted"){while(K===" "||K==="\t")K=C,C=$[q+=1],L=!0;let F=q>O+1?q-2:D-1;if(Y[F])return $;V.push(F),Y[F]=!0,W=F+G,B=void 0}else L=!0}K=C}if(L&&J)J();if(V.length===0)return $;if(U)U();let _=$.slice(0,V[0]);for(let C=0;C<V.length;++C){let F=V[C],R=V[C+1]||$.length;if(F===0)_=`
9
+ ${Z}${$.slice(0,R)}`;else{if(Q==="quoted"&&Y[F])_+=`${$[F]}\\`;_+=`
10
+ ${Z}${$.slice(F+1,R)}`}}return _}function V4($,Z,Q){let z=Z,X=Z+1,H=$[X];while(H===" "||H==="\t")if(Z<X+Q)H=$[++Z];else{do H=$[++Z];while(H&&H!==`
11
+ `);z=Z,X=Z+1,H=$[X]}return z}qH.FOLD_BLOCK="block";qH.FOLD_FLOW="flow";qH.FOLD_QUOTED="quoted";qH.foldFlowLines=BH});var T$=M((PH)=>{var K0=d(),i0=Y4(),C6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),j6=($)=>/^(%|---|\.\.\.)/m.test($);function OH($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let H=0,U=0;H<X;++H)if($[H]===`
12
+ `){if(H-U>z)return!0;if(U=H+1,X-U<=z)return!1}return!0}function N$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,H=Z.indent||(j6($)?" ":""),U="",J=0;for(let G=0,V=Q[G];V;V=Q[++G]){if(V===" "&&Q[G+1]==="\\"&&Q[G+2]==="n")U+=Q.slice(J,G)+"\\ ",G+=1,J=G,V="\\";if(V==="\\")switch(Q[G+1]){case"u":{U+=Q.slice(J,G);let Y=Q.substr(G+2,4);switch(Y){case"0000":U+="\\0";break;case"0007":U+="\\a";break;case"000b":U+="\\v";break;case"001b":U+="\\e";break;case"0085":U+="\\N";break;case"00a0":U+="\\_";break;case"2028":U+="\\L";break;case"2029":U+="\\P";break;default:if(Y.substr(0,2)==="00")U+="\\x"+Y.substr(2);else U+=Q.substr(G,6)}G+=5,J=G+1}break;case"n":if(z||Q[G+2]==='"'||Q.length<X)G+=1;else{U+=Q.slice(J,G)+`
13
13
 
14
- `;while(Q[G+2]==="\\"&&Q[G+3]==="n"&&Q[G+4]!=='"')H+=`
15
- `,G+=2;if(H+=U,Q[G+2]===" ")H+="\\";G+=1,J=G+1}break;default:G+=1}}return H=J?H+Q.slice(J):Q,z?H:d0.foldFlowLines(H,U,d0.FOLD_QUOTED,C6(Z,!1))}function J1($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test($))return P$($,Z);let Q=Z.indent||(j6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${Q}`)+"'";return Z.implicitKey?z:d0.foldFlowLines(z,Q,d0.FOLD_FLOW,C6(Z,!1))}function h2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=P$;else{let X=$.includes('"'),U=$.includes("'");if(X&&!U)z=J1;else if(U&&!X)z=P$;else z=Q?J1:P$}return z($,Z)}var G1;try{G1=new RegExp(`(^|(?<!
14
+ `;while(Q[G+2]==="\\"&&Q[G+3]==="n"&&Q[G+4]!=='"')U+=`
15
+ `,G+=2;if(U+=H,Q[G+2]===" ")U+="\\";G+=1,J=G+1}break;default:G+=1}}return U=J?U+Q.slice(J):Q,z?U:i0.foldFlowLines(U,H,i0.FOLD_QUOTED,C6(Z,!1))}function W5($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return N$($,Z);let Q=Z.indent||(j6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${Q}`)+"'";return Z.implicitKey?z:i0.foldFlowLines(z,Q,i0.FOLD_FLOW,C6(Z,!1))}function f2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=N$;else{let X=$.includes('"'),H=$.includes("'");if(X&&!H)z=W5;else if(H&&!X)z=N$;else z=Q?W5:N$}return z($,Z)}var B5;try{B5=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{G1=/\n+(?!\n|$)/g}function A6({comment:$,type:Z,value:Q},z,X,U){let{blockQuote:H,commentString:J,lineWidth:G}=z.options;if(!H||/\n[\t ]+$/.test(Q))return h2(Q,z);let V=z.indent||(z.forceBlockIndent||j6(Q)?" ":""),Y=H==="literal"?!0:H==="folded"||Z===K0.Scalar.BLOCK_FOLDED?!1:Z===K0.Scalar.BLOCK_LITERAL?!0:!LU(Q,G,V.length);if(!Q)return Y?`|
20
+ |$)`,"g")}catch{B5=/\n+(?!\n|$)/g}function A6({comment:$,type:Z,value:Q},z,X,H){let{blockQuote:U,commentString:J,lineWidth:G}=z.options;if(!U||/\n[\t ]+$/.test(Q))return f2(Q,z);let V=z.indent||(z.forceBlockIndent||j6(Q)?" ":""),Y=U==="literal"?!0:U==="folded"||Z===K0.Scalar.BLOCK_FOLDED?!1:Z===K0.Scalar.BLOCK_LITERAL?!0:!OH(Q,G,V.length);if(!Q)return Y?`|
21
21
  `:`>
22
- `;let W,B;for(B=Q.length;B>0;--B){let N=Q[B-1];if(N!==`
23
- `&&N!=="\t"&&N!==" ")break}let K=Q.substring(B),L=K.indexOf(`
24
- `);if(L===-1)W="-";else if(Q===K||L!==K.length-1){if(W="+",U)U()}else W="";if(K){if(Q=Q.slice(0,-K.length),K[K.length-1]===`
25
- `)K=K.slice(0,-1);K=K.replace(G1,`$&${V}`)}let q=!1,D,M=-1;for(D=0;D<Q.length;++D){let N=Q[D];if(N===" ")q=!0;else if(N===`
26
- `)M=D;else break}let O=Q.substring(0,M<D?M+1:D);if(O)Q=Q.substring(O.length),O=O.replace(/\n+/g,`$&${V}`);let F=(q?V?"2":"1":"")+W;if($){if(F+=" "+J($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!Y){let N=Q.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${V}`),R=!1,w=C6(z,!0);if(H!=="folded"&&Z!==K0.Scalar.BLOCK_FOLDED)w.onOverflow=()=>{R=!0};let P=d0.foldFlowLines(`${O}${N}${K}`,V,d0.FOLD_BLOCK,w);if(!R)return`>${F}
22
+ `;let W,B;for(B=Q.length;B>0;--B){let R=Q[B-1];if(R!==`
23
+ `&&R!=="\t"&&R!==" ")break}let K=Q.substring(B),L=K.indexOf(`
24
+ `);if(L===-1)W="-";else if(Q===K||L!==K.length-1){if(W="+",H)H()}else W="";if(K){if(Q=Q.slice(0,-K.length),K[K.length-1]===`
25
+ `)K=K.slice(0,-1);K=K.replace(B5,`$&${V}`)}let q=!1,D,O=-1;for(D=0;D<Q.length;++D){let R=Q[D];if(R===" ")q=!0;else if(R===`
26
+ `)O=D;else break}let _=Q.substring(0,O<D?O+1:D);if(_)Q=Q.substring(_.length),_=_.replace(/\n+/g,`$&${V}`);let F=(q?V?"2":"1":"")+W;if($){if(F+=" "+J($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!Y){let R=Q.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${V}`),N=!1,w=C6(z,!0);if(U!=="folded"&&Z!==K0.Scalar.BLOCK_FOLDED)w.onOverflow=()=>{N=!0};let P=i0.foldFlowLines(`${_}${R}${K}`,V,i0.FOLD_BLOCK,w);if(!N)return`>${F}
28
28
  ${V}${P}`}return Q=Q.replace(/\n+/g,`$&${V}`),`|${F}
29
- ${V}${O}${Q}${K}`}function IU($,Z,Q,z){let{type:X,value:U}=$,{actualString:H,implicitKey:J,indent:G,indentStep:V,inFlow:Y}=Z;if(J&&U.includes(`
30
- `)||Y&&/[[\]{},]/.test(U))return h2(U,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return J||Y||!U.includes(`
31
- `)?h2(U,Z):A6($,Z,Q,z);if(!J&&!Y&&X!==K0.Scalar.PLAIN&&U.includes(`
32
- `))return A6($,Z,Q,z);if(j6(U)){if(G==="")return Z.forceBlockIndent=!0,A6($,Z,Q,z);else if(J&&G===V)return h2(U,Z)}let W=U.replace(/\n+/g,`$&
33
- ${G}`);if(H){let B=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(W),{compat:K,tags:L}=Z.doc.schema;if(L.some(B)||K?.some(B))return h2(U,Z)}return J?W:d0.foldFlowLines(W,G,d0.FOLD_FLOW,C6(Z,!1))}function MU($,Z,Q,z){let{implicitKey:X,inFlow:U}=Z,H=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==K0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(H.value))J=K0.Scalar.QUOTE_DOUBLE}let G=(Y)=>{switch(Y){case K0.Scalar.BLOCK_FOLDED:case K0.Scalar.BLOCK_LITERAL:return X||U?h2(H.value,Z):A6(H,Z,Q,z);case K0.Scalar.QUOTE_DOUBLE:return P$(H.value,Z);case K0.Scalar.QUOTE_SINGLE:return J1(H.value,Z);case K0.Scalar.PLAIN:return IU(H,Z,Q,z);default:return null}},V=G(J);if(V===null){let{defaultKeyType:Y,defaultStringType:W}=Z.options,B=X&&Y||W;if(V=G(B),V===null)throw Error(`Unsupported default string type ${B}`)}return V}OU.stringifyString=MU});var N$=_((jU)=>{var PU=F6(),i0=x(),FU=_$(),NU=F$();function RU($,Z){let Q=Object.assign({blockQuote:!0,commentString:FU.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},$.schema.toStringOptions,Z),z;switch(Q.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:Q.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Q.indent==="number"?" ".repeat(Q.indent):" ",inFlow:z,options:Q}}function TU($,Z){if(Z.tag){let X=$.filter((U)=>U.tag===Z.tag);if(X.length>0)return X.find((U)=>U.format===Z.format)??X[0]}let Q=void 0,z;if(i0.isScalar(Z)){z=Z.value;let X=$.filter((U)=>U.identify?.(z));if(X.length>1){let U=X.filter((H)=>H.test);if(U.length>0)X=U}Q=X.find((U)=>U.format===Z.format)??X.find((U)=>!U.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function AU($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],U=(i0.isScalar($)||i0.isCollection($))&&$.anchor;if(U&&PU.anchorIsValid(U))Q.add(U),X.push(`&${U}`);let H=$.tag??(Z.default?null:Z.tag);if(H)X.push(z.directives.tagString(H));return X.join(" ")}function CU($,Z,Q,z){if(i0.isPair($))return $.toString(Z,Q,z);if(i0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,U=i0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>X=G});X??(X=TU(Z.doc.schema.tags,U));let H=AU(U,X,Z);if(H.length>0)Z.indentAtStart=(Z.indentAtStart??0)+H.length+1;let J=typeof X.stringify==="function"?X.stringify(U,Z,Q,z):i0.isScalar(U)?NU.stringifyString(U,Z,Q,z):U.toString(Z,Q,z);if(!H)return J;return i0.isScalar(U)||J[0]==="{"||J[0]==="["?`${H} ${J}`:`${H}
34
- ${Z.indent}${J}`}jU.createStringifyContext=RU;jU.stringify=CU});var JZ=_((bU)=>{var k0=x(),UZ=d(),HZ=N$(),R$=_$();function EU({key:$,value:Z},Q,z,X){let{allNullValues:U,doc:H,indent:J,indentStep:G,options:{commentString:V,indentSeq:Y,simpleKeys:W}}=Q,B=k0.isNode($)&&$.comment||null;if(W){if(B)throw Error("With simple keys, key nodes cannot have comments");if(k0.isCollection($)||!k0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||B&&Z==null&&!Q.inFlow||k0.isCollection($)||(k0.isScalar($)?$.type===UZ.Scalar.BLOCK_FOLDED||$.type===UZ.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!U),indent:J+G});let L=!1,q=!1,D=HZ.stringify($,Q,()=>L=!0,()=>q=!0);if(!K&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(U||Z==null){if(L&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(U&&!W||Z==null&&K){if(D=`? ${D}`,B&&!L)D+=R$.lineComment(D,Q.indent,V(B));else if(q&&X)X();return D}if(L)B=null;if(K){if(B)D+=R$.lineComment(D,Q.indent,V(B));D=`? ${D}
35
- ${J}:`}else if(D=`${D}:`,B)D+=R$.lineComment(D,Q.indent,V(B));let M,O,A;if(k0.isNode(Z))M=!!Z.spaceBefore,O=Z.commentBefore,A=Z.comment;else if(M=!1,O=null,A=null,Z&&typeof Z==="object")Z=H.createNode(Z);if(Q.implicitKey=!1,!K&&!B&&k0.isScalar(Z))Q.indentAtStart=D.length+1;if(q=!1,!Y&&G.length>=2&&!Q.inFlow&&!K&&k0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let F=!1,N=HZ.stringify(Z,Q,()=>F=!0,()=>q=!0),R=" ";if(B||M||O){if(R=M?`
36
- `:"",O){let w=V(O);R+=`
37
- ${R$.indentComment(w,Q.indent)}`}if(N===""&&!Q.inFlow){if(R===`
38
- `&&A)R=`
29
+ ${V}${_}${Q}${K}`}function _H($,Z,Q,z){let{type:X,value:H}=$,{actualString:U,implicitKey:J,indent:G,indentStep:V,inFlow:Y}=Z;if(J&&H.includes(`
30
+ `)||Y&&/[[\]{},]/.test(H))return f2(H,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||Y||!H.includes(`
31
+ `)?f2(H,Z):A6($,Z,Q,z);if(!J&&!Y&&X!==K0.Scalar.PLAIN&&H.includes(`
32
+ `))return A6($,Z,Q,z);if(j6(H)){if(G==="")return Z.forceBlockIndent=!0,A6($,Z,Q,z);else if(J&&G===V)return f2(H,Z)}let W=H.replace(/\n+/g,`$&
33
+ ${G}`);if(U){let B=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(W),{compat:K,tags:L}=Z.doc.schema;if(L.some(B)||K?.some(B))return f2(H,Z)}return J?W:i0.foldFlowLines(W,G,i0.FOLD_FLOW,C6(Z,!1))}function MH($,Z,Q,z){let{implicitKey:X,inFlow:H}=Z,U=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==K0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))J=K0.Scalar.QUOTE_DOUBLE}let G=(Y)=>{switch(Y){case K0.Scalar.BLOCK_FOLDED:case K0.Scalar.BLOCK_LITERAL:return X||H?f2(U.value,Z):A6(U,Z,Q,z);case K0.Scalar.QUOTE_DOUBLE:return N$(U.value,Z);case K0.Scalar.QUOTE_SINGLE:return W5(U.value,Z);case K0.Scalar.PLAIN:return _H(U,Z,Q,z);default:return null}},V=G(J);if(V===null){let{defaultKeyType:Y,defaultStringType:W}=Z.options,B=X&&Y||W;if(V=G(B),V===null)throw Error(`Unsupported default string type ${B}`)}return V}PH.stringifyString=MH});var A$=M((SH)=>{var RH=F6(),n0=x(),NH=R$(),TH=T$();function AH($,Z){let Q=Object.assign({blockQuote:!0,commentString:NH.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},$.schema.toStringOptions,Z),z;switch(Q.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:Q.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Q.indent==="number"?" ".repeat(Q.indent):" ",inFlow:z,options:Q}}function CH($,Z){if(Z.tag){let X=$.filter((H)=>H.tag===Z.tag);if(X.length>0)return X.find((H)=>H.format===Z.format)??X[0]}let Q=void 0,z;if(n0.isScalar(Z)){z=Z.value;let X=$.filter((H)=>H.identify?.(z));if(X.length>1){let H=X.filter((U)=>U.test);if(H.length>0)X=H}Q=X.find((H)=>H.format===Z.format)??X.find((H)=>!H.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function jH($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],H=(n0.isScalar($)||n0.isCollection($))&&$.anchor;if(H&&RH.anchorIsValid(H))Q.add(H),X.push(`&${H}`);let U=$.tag??(Z.default?null:Z.tag);if(U)X.push(z.directives.tagString(U));return X.join(" ")}function wH($,Z,Q,z){if(n0.isPair($))return $.toString(Z,Q,z);if(n0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,H=n0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>X=G});X??(X=CH(Z.doc.schema.tags,H));let U=jH(H,X,Z);if(U.length>0)Z.indentAtStart=(Z.indentAtStart??0)+U.length+1;let J=typeof X.stringify==="function"?X.stringify(H,Z,Q,z):n0.isScalar(H)?TH.stringifyString(H,Z,Q,z):H.toString(Z,Q,z);if(!U)return J;return n0.isScalar(H)||J[0]==="{"||J[0]==="["?`${U} ${J}`:`${U}
34
+ ${Z.indent}${J}`}SH.createStringifyContext=AH;SH.stringify=wH});var q4=M((xH)=>{var h0=x(),W4=d(),B4=A$(),C$=R$();function yH({key:$,value:Z},Q,z,X){let{allNullValues:H,doc:U,indent:J,indentStep:G,options:{commentString:V,indentSeq:Y,simpleKeys:W}}=Q,B=h0.isNode($)&&$.comment||null;if(W){if(B)throw Error("With simple keys, key nodes cannot have comments");if(h0.isCollection($)||!h0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||B&&Z==null&&!Q.inFlow||h0.isCollection($)||(h0.isScalar($)?$.type===W4.Scalar.BLOCK_FOLDED||$.type===W4.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!H),indent:J+G});let L=!1,q=!1,D=B4.stringify($,Q,()=>L=!0,()=>q=!0);if(!K&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(H||Z==null){if(L&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(H&&!W||Z==null&&K){if(D=`? ${D}`,B&&!L)D+=C$.lineComment(D,Q.indent,V(B));else if(q&&X)X();return D}if(L)B=null;if(K){if(B)D+=C$.lineComment(D,Q.indent,V(B));D=`? ${D}
35
+ ${J}:`}else if(D=`${D}:`,B)D+=C$.lineComment(D,Q.indent,V(B));let O,_,C;if(h0.isNode(Z))O=!!Z.spaceBefore,_=Z.commentBefore,C=Z.comment;else if(O=!1,_=null,C=null,Z&&typeof Z==="object")Z=U.createNode(Z);if(Q.implicitKey=!1,!K&&!B&&h0.isScalar(Z))Q.indentAtStart=D.length+1;if(q=!1,!Y&&G.length>=2&&!Q.inFlow&&!K&&h0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let F=!1,R=B4.stringify(Z,Q,()=>F=!0,()=>q=!0),N=" ";if(B||O||_){if(N=O?`
36
+ `:"",_){let w=V(_);N+=`
37
+ ${C$.indentComment(w,Q.indent)}`}if(R===""&&!Q.inFlow){if(N===`
38
+ `&&C)N=`
39
39
 
40
- `}else R+=`
41
- ${Q.indent}`}else if(!K&&k0.isCollection(Z)){let w=N[0],P=N.indexOf(`
42
- `),E=P!==-1,n=Q.inFlow??Z.flow??Z.items.length===0;if(E||!n){let a=!1;if(E&&(w==="&"||w==="!")){let g=N.indexOf(" ");if(w==="&"&&g!==-1&&g<P&&N[g+1]==="!")g=N.indexOf(" ",g+1);if(g===-1||P<g)a=!0}if(!a)R=`
43
- ${Q.indent}`}}else if(N===""||N[0]===`
44
- `)R="";if(D+=R+N,Q.inFlow){if(F&&z)z()}else if(A&&!F)D+=R$.lineComment(D,Q.indent,V(A));else if(q&&X)X();return D}bU.stringifyPair=EU});var V1=_((vU)=>{var GZ=W$("process");function xU($,...Z){if($==="debug")console.log(...Z)}function gU($,Z){if($==="debug"||$==="warn")if(typeof GZ.emitWarning==="function")GZ.emitWarning(Z);else console.warn(Z)}vU.debug=xU;vU.warn=gU});var b6=_((fU)=>{var E6=x(),VZ=d(),w6="<<",S6={identify:($)=>$===w6||typeof $==="symbol"&&$.description===w6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new VZ.Scalar(Symbol(w6)),{addToJSMap:YZ}),stringify:()=>w6},uU=($,Z)=>(S6.identify(Z)||E6.isScalar(Z)&&(!Z.type||Z.type===VZ.Scalar.PLAIN)&&S6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===S6.tag&&Q.default);function YZ($,Z,Q){let z=WZ($,Q);if(E6.isSeq(z))for(let X of z.items)Y1($,Z,X);else if(Array.isArray(z))for(let X of z)Y1($,Z,X);else Y1($,Z,z)}function Y1($,Z,Q){let z=WZ($,Q);if(!E6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[U,H]of X)if(Z instanceof Map){if(!Z.has(U))Z.set(U,H)}else if(Z instanceof Set)Z.add(U);else if(!Object.prototype.hasOwnProperty.call(Z,U))Object.defineProperty(Z,U,{value:H,writable:!0,enumerable:!0,configurable:!0});return Z}function WZ($,Z){return $&&E6.isAlias(Z)?Z.resolve($.doc,$):Z}fU.addMergeToJSMap=YZ;fU.isMergeKey=uU;fU.merge=S6});var B1=_((rU)=>{var cU=V1(),BZ=b6(),dU=N$(),qZ=x(),W1=c0();function iU($,Z,{key:Q,value:z}){if(qZ.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(BZ.isMergeKey($,Q))BZ.addMergeToJSMap($,Z,z);else{let X=W1.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,W1.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let U=nU(Q,X,$),H=W1.toJS(z,U,$);if(U in Z)Object.defineProperty(Z,U,{value:H,writable:!0,enumerable:!0,configurable:!0});else Z[U]=H}}return Z}function nU($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(qZ.isNode($)&&Q?.doc){let z=dU.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let U of Q.anchors.keys())z.anchors.add(U.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let U=JSON.stringify(X);if(U.length>40)U=U.substring(0,36)+'..."';cU.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}rU.addPairToJSMap=iU});var n0=_((eU)=>{var KZ=O$(),oU=JZ(),aU=B1(),y6=x();function tU($,Z,Q){let z=KZ.createNode($,void 0,Q),X=KZ.createNode(Z,void 0,Q);return new x6(z,X)}class x6{constructor($,Z=null){Object.defineProperty(this,y6.NODE_TYPE,{value:y6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(y6.isNode(Z))Z=Z.clone($);if(y6.isNode(Q))Q=Q.clone($);return new x6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return aU.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?oU.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}eU.Pair=x6;eU.createPair=tU});var q1=_((UH)=>{var J2=x(),DZ=N$(),g6=_$();function QH($,Z,Q){return(Z.inFlow??$.flow?XH:zH)($,Z,Q)}function zH({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:U,onChompKeep:H,onComment:J}){let{indent:G,options:{commentString:V}}=Q,Y=Object.assign({},Q,{indent:U,type:null}),W=!1,B=[];for(let L=0;L<Z.length;++L){let q=Z[L],D=null;if(J2.isNode(q)){if(!W&&q.spaceBefore)B.push("");if(v6(Q,B,q.commentBefore,W),q.comment)D=q.comment}else if(J2.isPair(q)){let O=J2.isNode(q.key)?q.key:null;if(O){if(!W&&O.spaceBefore)B.push("");v6(Q,B,O.commentBefore,W)}}W=!1;let M=DZ.stringify(q,Y,()=>D=null,()=>W=!0);if(D)M+=g6.lineComment(M,U,V(D));if(W&&D)W=!1;B.push(z+M)}let K;if(B.length===0)K=X.start+X.end;else{K=B[0];for(let L=1;L<B.length;++L){let q=B[L];K+=q?`
40
+ `}else N+=`
41
+ ${Q.indent}`}else if(!K&&h0.isCollection(Z)){let w=R[0],P=R.indexOf(`
42
+ `),E=P!==-1,n=Q.inFlow??Z.flow??Z.items.length===0;if(E||!n){let a=!1;if(E&&(w==="&"||w==="!")){let g=R.indexOf(" ");if(w==="&"&&g!==-1&&g<P&&R[g+1]==="!")g=R.indexOf(" ",g+1);if(g===-1||P<g)a=!0}if(!a)N=`
43
+ ${Q.indent}`}}else if(R===""||R[0]===`
44
+ `)N="";if(D+=N+R,Q.inFlow){if(F&&z)z()}else if(C&&!F)D+=C$.lineComment(D,Q.indent,V(C));else if(q&&X)X();return D}xH.stringifyPair=yH});var q5=M((hH)=>{var K4=K$("process");function vH($,...Z){if($==="debug")console.log(...Z)}function kH($,Z){if($==="debug"||$==="warn")if(typeof K4.emitWarning==="function")K4.emitWarning(Z);else console.warn(Z)}hH.debug=vH;hH.warn=kH});var b6=M((pH)=>{var E6=x(),D4=d(),w6="<<",S6={identify:($)=>$===w6||typeof $==="symbol"&&$.description===w6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new D4.Scalar(Symbol(w6)),{addToJSMap:L4}),stringify:()=>w6},mH=($,Z)=>(S6.identify(Z)||E6.isScalar(Z)&&(!Z.type||Z.type===D4.Scalar.PLAIN)&&S6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===S6.tag&&Q.default);function L4($,Z,Q){let z=I4($,Q);if(E6.isSeq(z))for(let X of z.items)K5($,Z,X);else if(Array.isArray(z))for(let X of z)K5($,Z,X);else K5($,Z,z)}function K5($,Z,Q){let z=I4($,Q);if(!E6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[H,U]of X)if(Z instanceof Map){if(!Z.has(H))Z.set(H,U)}else if(Z instanceof Set)Z.add(H);else if(!Object.prototype.hasOwnProperty.call(Z,H))Object.defineProperty(Z,H,{value:U,writable:!0,enumerable:!0,configurable:!0});return Z}function I4($,Z){return $&&E6.isAlias(Z)?Z.resolve($.doc,$):Z}pH.addMergeToJSMap=L4;pH.isMergeKey=mH;pH.merge=S6});var L5=M((oH)=>{var iH=q5(),O4=b6(),nH=A$(),_4=x(),D5=d0();function rH($,Z,{key:Q,value:z}){if(_4.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(O4.isMergeKey($,Q))O4.addMergeToJSMap($,Z,z);else{let X=D5.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,D5.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let H=sH(Q,X,$),U=D5.toJS(z,H,$);if(H in Z)Object.defineProperty(Z,H,{value:U,writable:!0,enumerable:!0,configurable:!0});else Z[H]=U}}return Z}function sH($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(_4.isNode($)&&Q?.doc){let z=nH.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let H of Q.anchors.keys())z.anchors.add(H.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let H=JSON.stringify(X);if(H.length>40)H=H.substring(0,36)+'..."';iH.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${H}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}oH.addPairToJSMap=rH});var r0=M((ZU)=>{var M4=F$(),tH=q4(),eH=L5(),y6=x();function $U($,Z,Q){let z=M4.createNode($,void 0,Q),X=M4.createNode(Z,void 0,Q);return new x6(z,X)}class x6{constructor($,Z=null){Object.defineProperty(this,y6.NODE_TYPE,{value:y6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(y6.isNode(Z))Z=Z.clone($);if(y6.isNode(Q))Q=Q.clone($);return new x6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return eH.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?tH.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}ZU.Pair=x6;ZU.createPair=$U});var I5=M((JU)=>{var J2=x(),P4=A$(),g6=R$();function XU($,Z,Q){return(Z.inFlow??$.flow?UU:HU)($,Z,Q)}function HU({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:H,onChompKeep:U,onComment:J}){let{indent:G,options:{commentString:V}}=Q,Y=Object.assign({},Q,{indent:H,type:null}),W=!1,B=[];for(let L=0;L<Z.length;++L){let q=Z[L],D=null;if(J2.isNode(q)){if(!W&&q.spaceBefore)B.push("");if(v6(Q,B,q.commentBefore,W),q.comment)D=q.comment}else if(J2.isPair(q)){let _=J2.isNode(q.key)?q.key:null;if(_){if(!W&&_.spaceBefore)B.push("");v6(Q,B,_.commentBefore,W)}}W=!1;let O=P4.stringify(q,Y,()=>D=null,()=>W=!0);if(D)O+=g6.lineComment(O,H,V(D));if(W&&D)W=!1;B.push(z+O)}let K;if(B.length===0)K=X.start+X.end;else{K=B[0];for(let L=1;L<B.length;++L){let q=B[L];K+=q?`
45
45
  ${G}${q}`:`
46
46
  `}}if($){if(K+=`
47
- `+g6.indentComment(V($),G),J)J()}else if(W&&H)H();return K}function XH({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:U,flowCollectionPadding:H,options:{commentString:J}}=Z;z+=U;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),V=!1,Y=0,W=[];for(let L=0;L<$.length;++L){let q=$[L],D=null;if(J2.isNode(q)){if(q.spaceBefore)W.push("");if(v6(Z,W,q.commentBefore,!1),q.comment)D=q.comment}else if(J2.isPair(q)){let O=J2.isNode(q.key)?q.key:null;if(O){if(O.spaceBefore)W.push("");if(v6(Z,W,O.commentBefore,!1),O.comment)V=!0}let A=J2.isNode(q.value)?q.value:null;if(A){if(A.comment)D=A.comment;if(A.commentBefore)V=!0}else if(q.value==null&&O?.comment)D=O.comment}if(D)V=!0;let M=DZ.stringify(q,G,()=>D=null);if(V||(V=W.length>Y||M.includes(`
48
- `)),L<$.length-1)M+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)V||(V=W.reduce((O,A)=>O+A.length+2,2)+(M.length+2)>Z.options.lineWidth);if(V)M+=","}if(D)M+=g6.lineComment(M,z,J(D));W.push(M),Y=W.length}let{start:B,end:K}=Q;if(W.length===0)return B+K;else{if(!V){let L=W.reduce((q,D)=>q+D.length+2,2);V=Z.options.lineWidth>0&&L>Z.options.lineWidth}if(V){let L=B;for(let q of W)L+=q?`
49
- ${U}${X}${q}`:`
47
+ `+g6.indentComment(V($),G),J)J()}else if(W&&U)U();return K}function UU({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:H,flowCollectionPadding:U,options:{commentString:J}}=Z;z+=H;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),V=!1,Y=0,W=[];for(let L=0;L<$.length;++L){let q=$[L],D=null;if(J2.isNode(q)){if(q.spaceBefore)W.push("");if(v6(Z,W,q.commentBefore,!1),q.comment)D=q.comment}else if(J2.isPair(q)){let _=J2.isNode(q.key)?q.key:null;if(_){if(_.spaceBefore)W.push("");if(v6(Z,W,_.commentBefore,!1),_.comment)V=!0}let C=J2.isNode(q.value)?q.value:null;if(C){if(C.comment)D=C.comment;if(C.commentBefore)V=!0}else if(q.value==null&&_?.comment)D=_.comment}if(D)V=!0;let O=P4.stringify(q,G,()=>D=null);if(V||(V=W.length>Y||O.includes(`
48
+ `)),L<$.length-1)O+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)V||(V=W.reduce((_,C)=>_+C.length+2,2)+(O.length+2)>Z.options.lineWidth);if(V)O+=","}if(D)O+=g6.lineComment(O,z,J(D));W.push(O),Y=W.length}let{start:B,end:K}=Q;if(W.length===0)return B+K;else{if(!V){let L=W.reduce((q,D)=>q+D.length+2,2);V=Z.options.lineWidth>0&&L>Z.options.lineWidth}if(V){let L=B;for(let q of W)L+=q?`
49
+ ${H}${X}${q}`:`
50
50
  `;return`${L}
51
- ${X}${K}`}else return`${B}${H}${W.join(" ")}${H}${K}`}}function v6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let U=g6.indentComment(Z(z),$);Q.push(U.trimStart())}}UH.stringifyCollection=QH});var s0=_((WH)=>{var JH=q1(),GH=B1(),VH=T6(),r0=x(),k6=n0(),YH=d();function T$($,Z){let Q=r0.isScalar(Z)?Z.value:Z;for(let z of $)if(r0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(r0.isScalar(z.key)&&z.key.value===Q)return z}return}class LZ extends VH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(r0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,U=new this($),H=(J,G)=>{if(typeof X==="function")G=X.call(Z,J,G);else if(Array.isArray(X)&&!X.includes(J))return;if(G!==void 0||z)U.items.push(k6.createPair(J,G,Q))};if(Z instanceof Map)for(let[J,G]of Z)H(J,G);else if(Z&&typeof Z==="object")for(let J of Object.keys(Z))H(J,Z[J]);if(typeof $.sortMapEntries==="function")U.items.sort($.sortMapEntries);return U}add($,Z){let Q;if(r0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new k6.Pair($,$?.value);else Q=new k6.Pair($.key,$.value);let z=T$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(r0.isScalar(z.value)&&YH.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let U=this.items.findIndex((H)=>X(Q,H)<0);if(U===-1)this.items.push(Q);else this.items.splice(U,0,Q)}else this.items.push(Q)}delete($){let Z=T$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=T$(this.items,$)?.value;return(!Z&&r0.isScalar(z)?z.value:z)??void 0}has($){return!!T$(this.items,$)}set($,Z){this.add(new k6.Pair($,Z),!0)}toJSON($,Z,Q){let z=Q?new Q:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(z);for(let X of this.items)GH.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!r0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return JH.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}WH.YAMLMap=LZ;WH.findPair=T$});var u2=_((LH)=>{var KH=x(),IZ=s0(),DH={collection:"map",default:!0,nodeClass:IZ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!KH.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>IZ.YAMLMap.from($,Z,Q)};LH.map=DH});var o0=_((NH)=>{var MH=O$(),OH=q1(),_H=T6(),u6=x(),PH=d(),FH=c0();class MZ extends _H.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(u6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=h6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=h6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&u6.isScalar(z)?z.value:z}has($){let Z=h6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=h6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(u6.isScalar(z)&&PH.isScalarValue(Z))z.value=Z;else this.items[Q]=Z}toJSON($,Z){let Q=[];if(Z?.onCreate)Z.onCreate(Q);let z=0;for(let X of this.items)Q.push(FH.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return OH.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let U=0;for(let H of Z){if(typeof z==="function"){let J=Z instanceof Set?H:String(U++);H=z.call(Z,J,H)}X.items.push(MH.createNode(H,void 0,Q))}}return X}}function h6($){let Z=u6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}NH.YAMLSeq=MZ});var f2=_((CH)=>{var TH=x(),OZ=o0(),AH={collection:"seq",default:!0,nodeClass:OZ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!TH.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>OZ.YAMLSeq.from($,Z,Q)};CH.seq=AH});var A$=_((EH)=>{var wH=F$(),SH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),wH.stringifyString($,Z,Q,z)}};EH.string=SH});var f6=_((yH)=>{var _Z=d(),PZ={identify:($)=>$==null,createNode:()=>new _Z.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _Z.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&PZ.test.test($)?$:Z.options.nullStr};yH.nullTag=PZ});var K1=_((vH)=>{var gH=d(),FZ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new gH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&FZ.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};vH.boolTag=FZ});var m2=_((uH)=>{function hH({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let U=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(U)&&!U.includes("e")){let H=U.indexOf(".");if(H<0)H=U.length,U+=".";let J=Z-(U.length-H-1);while(J-- >0)U+="0"}return U}uH.stringifyNumber=hH});var L1=_((dH)=>{var mH=d(),D1=m2(),pH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D1.stringifyNumber},lH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():D1.stringifyNumber($)}},cH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new mH.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:D1.stringifyNumber};dH.float=cH;dH.floatExp=lH;dH.floatNaN=pH});var M1=_((tH)=>{var NZ=m2(),m6=($)=>typeof $==="bigint"||Number.isInteger($),I1=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function RZ($,Z,Q){let{value:z}=$;if(m6(z)&&z>=0)return Q+z.toString(Z);return NZ.stringifyNumber($)}var sH={identify:($)=>m6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>I1($,2,8,Q),stringify:($)=>RZ($,8,"0o")},oH={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>I1($,0,10,Q),stringify:NZ.stringifyNumber},aH={identify:($)=>m6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>I1($,2,16,Q),stringify:($)=>RZ($,16,"0x")};tH.int=oH;tH.intHex=aH;tH.intOct=sH});var TZ=_((GJ)=>{var QJ=u2(),zJ=f6(),XJ=f2(),UJ=A$(),HJ=K1(),O1=L1(),_1=M1(),JJ=[QJ.map,XJ.seq,UJ.string,zJ.nullTag,HJ.boolTag,_1.intOct,_1.int,_1.intHex,O1.floatNaN,O1.floatExp,O1.float];GJ.schema=JJ});var CZ=_((LJ)=>{var YJ=d(),WJ=u2(),BJ=f2();function AZ($){return typeof $==="bigint"||Number.isInteger($)}var p6=({value:$})=>JSON.stringify($),qJ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:p6},{identify:($)=>$==null,createNode:()=>new YJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:p6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:p6},{identify:AZ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>AZ($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:p6}],KJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},DJ=[WJ.map,BJ.seq].concat(qJ,KJ);LJ.schema=DJ});var F1=_((_J)=>{var C$=W$("buffer"),P1=d(),MJ=F$(),OJ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof C$.Buffer==="function")return C$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,U){if(!Q)return"";let H=Q,J;if(typeof C$.Buffer==="function")J=H instanceof C$.Buffer?H.toString("base64"):C$.Buffer.from(H.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let V=0;V<H.length;++V)G+=String.fromCharCode(H[V]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=P1.Scalar.BLOCK_LITERAL),Z!==P1.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),V=Math.ceil(J.length/G),Y=Array(V);for(let W=0,B=0;W<V;++W,B+=G)Y[W]=J.substr(B,G);J=Y.join(Z===P1.Scalar.BLOCK_LITERAL?`
52
- `:" ")}return MJ.stringifyString({comment:$,type:Z,value:J},z,X,U)}};_J.binary=OJ});var c6=_((TJ)=>{var l6=x(),N1=n0(),FJ=d(),NJ=o0();function jZ($,Z){if(l6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(l6.isPair(z))continue;else if(l6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new N1.Pair(new FJ.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
53
- ${X.key.commentBefore}`:z.commentBefore;if(z.comment){let U=X.value??X.key;U.comment=U.comment?`${z.comment}
54
- ${U.comment}`:z.comment}z=X}$.items[Q]=l6.isPair(z)?z:new N1.Pair(z)}else Z("Expected a sequence for this tag");return $}function wZ($,Z,Q){let{replacer:z}=Q,X=new NJ.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let U=0;if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof z==="function")H=z.call(Z,String(U++),H);let J,G;if(Array.isArray(H))if(H.length===2)J=H[0],G=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let V=Object.keys(H);if(V.length===1)J=V[0],G=H[J];else throw TypeError(`Expected tuple with one key, not ${V.length} keys`)}else J=H;X.items.push(N1.createPair(J,G,Q))}return X}var RJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jZ,createNode:wZ};TJ.createPairs=wZ;TJ.pairs=RJ;TJ.resolvePairs=jZ});var T1=_((EJ)=>{var SZ=x(),R1=c0(),j$=s0(),wJ=o0(),EZ=c6();class G2 extends wJ.YAMLSeq{constructor(){super();this.add=j$.YAMLMap.prototype.add.bind(this),this.delete=j$.YAMLMap.prototype.delete.bind(this),this.get=j$.YAMLMap.prototype.get.bind(this),this.has=j$.YAMLMap.prototype.has.bind(this),this.set=j$.YAMLMap.prototype.set.bind(this),this.tag=G2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,U;if(SZ.isPair(z))X=R1.toJS(z.key,"",Z),U=R1.toJS(z.value,X,Z);else X=R1.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,U)}return Q}static from($,Z,Q){let z=EZ.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}G2.tag="tag:yaml.org,2002:omap";var SJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=EZ.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(SZ.isScalar(X))if(z.includes(X.value))Z(`Ordered maps must not include duplicate keys: ${X.value}`);else z.push(X.value);return Object.assign(new G2,Q)},createNode:($,Z,Q)=>G2.from($,Z,Q)};EJ.YAMLOMap=G2;EJ.omap=SJ});var vZ=_((xJ)=>{var bZ=d();function yZ({value:$,source:Z},Q){if(Z&&($?xZ:gZ).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var xZ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new bZ.Scalar(!0),stringify:yZ},gZ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new bZ.Scalar(!1),stringify:yZ};xJ.falseTag=gZ;xJ.trueTag=xZ});var kZ=_((mJ)=>{var kJ=d(),A1=m2(),hJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:A1.stringifyNumber},uJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():A1.stringifyNumber($)}},fJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new kJ.Scalar(parseFloat($.replace(/_/g,""))),Q=$.indexOf(".");if(Q!==-1){let z=$.substring(Q+1).replace(/_/g,"");if(z[z.length-1]==="0")Z.minFractionDigits=z.length}return Z},stringify:A1.stringifyNumber};mJ.float=fJ;mJ.floatExp=uJ;mJ.floatNaN=hJ});var uZ=_((sJ)=>{var hZ=m2(),w$=($)=>typeof $==="bigint"||Number.isInteger($);function d6($,Z,Q,{intAsBigInt:z}){let X=$[0];if(X==="-"||X==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(Q){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let H=BigInt($);return X==="-"?BigInt(-1)*H:H}let U=parseInt($,Q);return X==="-"?-1*U:U}function C1($,Z,Q){let{value:z}=$;if(w$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return hZ.stringifyNumber($)}var dJ={identify:w$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>d6($,2,2,Q),stringify:($)=>C1($,2,"0b")},iJ={identify:w$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>d6($,1,8,Q),stringify:($)=>C1($,8,"0")},nJ={identify:w$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>d6($,0,10,Q),stringify:hZ.stringifyNumber},rJ={identify:w$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>d6($,2,16,Q),stringify:($)=>C1($,16,"0x")};sJ.int=nJ;sJ.intBin=dJ;sJ.intHex=rJ;sJ.intOct=iJ});var j1=_((ZG)=>{var r6=x(),i6=n0(),n6=s0();class V2 extends n6.YAMLMap{constructor($){super($);this.tag=V2.tag}add($){let Z;if(r6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new i6.Pair($.key,null);else Z=new i6.Pair($,null);if(!n6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=n6.findPair(this.items,$);return!Z&&r6.isPair(Q)?r6.isScalar(Q.key)?Q.key.value:Q.key:Q}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let Q=n6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new i6.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,U,U);X.items.push(i6.createPair(U,null,Q))}return X}}V2.tag="tag:yaml.org,2002:set";var $G={collection:"map",identify:($)=>$ instanceof Set,nodeClass:V2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>V2.from($,Z,Q),resolve($,Z){if(r6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new V2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};ZG.YAMLSet=V2;ZG.set=$G});var S1=_((JG)=>{var XG=m2();function w1($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(H)=>Z?BigInt(H):Number(H),U=z.replace(/_/g,"").split(":").reduce((H,J)=>H*X(60)+X(J),X(0));return Q==="-"?X(-1)*U:U}function fZ($){let{value:Z}=$,Q=(H)=>H;if(typeof Z==="bigint")Q=(H)=>BigInt(H);else if(isNaN(Z)||!isFinite(Z))return XG.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),U=[Z%X];if(Z<60)U.unshift(0);else if(Z=(Z-U[0])/X,U.unshift(Z%X),Z>=60)Z=(Z-U[0])/X,U.unshift(Z);return z+U.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var UG={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,Z,{intAsBigInt:Q})=>w1($,Q),stringify:fZ},HG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>w1($,!1),stringify:fZ},mZ={identify:($)=>$ 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($){let Z=$.match(mZ.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,U,H,J]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,V=Date.UTC(Q,z-1,X,U||0,H||0,J||0,G),Y=Z[8];if(Y&&Y!=="Z"){let W=w1(Y,!1);if(Math.abs(W)<30)W*=60;V-=60000*W}return new Date(V)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};JG.floatTime=HG;JG.intTime=UG;JG.timestamp=mZ});var lZ=_((PG)=>{var WG=u2(),BG=f6(),qG=f2(),KG=A$(),DG=F1(),pZ=vZ(),E1=kZ(),s6=uZ(),LG=b6(),IG=T1(),MG=c6(),OG=j1(),b1=S1(),_G=[WG.map,qG.seq,KG.string,BG.nullTag,pZ.trueTag,pZ.falseTag,s6.intBin,s6.intOct,s6.int,s6.intHex,E1.floatNaN,E1.floatExp,E1.float,DG.binary,LG.merge,IG.omap,MG.pairs,OG.set,b1.intTime,b1.floatTime,b1.timestamp];PG.schema=_G});var eZ=_((SG)=>{var nZ=u2(),NG=f6(),rZ=f2(),RG=A$(),TG=K1(),y1=L1(),x1=M1(),AG=TZ(),CG=CZ(),sZ=F1(),S$=b6(),oZ=T1(),aZ=c6(),cZ=lZ(),tZ=j1(),o6=S1(),dZ=new Map([["core",AG.schema],["failsafe",[nZ.map,rZ.seq,RG.string]],["json",CG.schema],["yaml11",cZ.schema],["yaml-1.1",cZ.schema]]),iZ={binary:sZ.binary,bool:TG.boolTag,float:y1.float,floatExp:y1.floatExp,floatNaN:y1.floatNaN,floatTime:o6.floatTime,int:x1.int,intHex:x1.intHex,intOct:x1.intOct,intTime:o6.intTime,map:nZ.map,merge:S$.merge,null:NG.nullTag,omap:oZ.omap,pairs:aZ.pairs,seq:rZ.seq,set:tZ.set,timestamp:o6.timestamp},jG={"tag:yaml.org,2002:binary":sZ.binary,"tag:yaml.org,2002:merge":S$.merge,"tag:yaml.org,2002:omap":oZ.omap,"tag:yaml.org,2002:pairs":aZ.pairs,"tag:yaml.org,2002:set":tZ.set,"tag:yaml.org,2002:timestamp":o6.timestamp};function wG($,Z,Q){let z=dZ.get(Z);if(z&&!$)return Q&&!z.includes(S$.merge)?z.concat(S$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let U=Array.from(dZ.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${U} or define customTags array`)}if(Array.isArray($))for(let U of $)X=X.concat(U);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(S$.merge);return X.reduce((U,H)=>{let J=typeof H==="string"?iZ[H]:H;if(!J){let G=JSON.stringify(H),V=Object.keys(iZ).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${V}`)}if(!U.includes(J))U.push(J);return U},[])}SG.coreKnownTags=jG;SG.getTags=wG});var k1=_((kG)=>{var g1=x(),yG=u2(),xG=f2(),gG=A$(),a6=eZ(),vG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class v1{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:U,toStringDefaults:H}){this.compat=Array.isArray($)?a6.getTags($,"compat"):$?a6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?a6.coreKnownTags:{},this.tags=a6.getTags(Z,this.name,Q),this.toStringOptions=H??null,Object.defineProperty(this,g1.MAP,{value:yG.map}),Object.defineProperty(this,g1.SCALAR,{value:gG.string}),Object.defineProperty(this,g1.SEQ,{value:xG.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?vG:null}clone(){let $=Object.create(v1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}kG.Schema=v1});var $7=_((mG)=>{var uG=x(),h1=N$(),E$=_$();function fG($,Z){let Q=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)Q.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)Q.push("---");let X=h1.createStringifyContext($,Z),{commentString:U}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let G=U($.commentBefore);Q.unshift(E$.indentComment(G,""))}let H=!1,J=null;if($.contents){if(uG.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=U($.contents.commentBefore);Q.push(E$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>H=!0,V=h1.stringify($.contents,X,()=>J=null,G);if(J)V+=E$.lineComment(V,"",U(J));if((V[0]==="|"||V[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${V}`;else Q.push(V)}else Q.push(h1.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let G=U($.comment);if(G.includes(`
55
- `))Q.push("..."),Q.push(E$.indentComment(G,""));else Q.push(`... ${G}`)}else Q.push("...");else{let G=$.comment;if(G&&H)G=G.replace(/^\n+/,"");if(G){if((!H||J)&&Q[Q.length-1]!=="")Q.push("");Q.push(E$.indentComment(U(G),""))}}return Q.join(`
51
+ ${X}${K}`}else return`${B}${U}${W.join(" ")}${U}${K}`}}function v6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let H=g6.indentComment(Z(z),$);Q.push(H.trimStart())}}JU.stringifyCollection=XU});var o0=M((qU)=>{var VU=I5(),YU=L5(),WU=T6(),s0=x(),k6=r0(),BU=d();function j$($,Z){let Q=s0.isScalar(Z)?Z.value:Z;for(let z of $)if(s0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(s0.isScalar(z.key)&&z.key.value===Q)return z}return}class F4 extends WU.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(s0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,H=new this($),U=(J,G)=>{if(typeof X==="function")G=X.call(Z,J,G);else if(Array.isArray(X)&&!X.includes(J))return;if(G!==void 0||z)H.items.push(k6.createPair(J,G,Q))};if(Z instanceof Map)for(let[J,G]of Z)U(J,G);else if(Z&&typeof Z==="object")for(let J of Object.keys(Z))U(J,Z[J]);if(typeof $.sortMapEntries==="function")H.items.sort($.sortMapEntries);return H}add($,Z){let Q;if(s0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new k6.Pair($,$?.value);else Q=new k6.Pair($.key,$.value);let z=j$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(s0.isScalar(z.value)&&BU.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let H=this.items.findIndex((U)=>X(Q,U)<0);if(H===-1)this.items.push(Q);else this.items.splice(H,0,Q)}else this.items.push(Q)}delete($){let Z=j$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=j$(this.items,$)?.value;return(!Z&&s0.isScalar(z)?z.value:z)??void 0}has($){return!!j$(this.items,$)}set($,Z){this.add(new k6.Pair($,Z),!0)}toJSON($,Z,Q){let z=Q?new Q:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(z);for(let X of this.items)YU.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!s0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return VU.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}qU.YAMLMap=F4;qU.findPair=j$});var m2=M((OU)=>{var LU=x(),R4=o0(),IU={collection:"map",default:!0,nodeClass:R4.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!LU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>R4.YAMLMap.from($,Z,Q)};OU.map=IU});var a0=M((TU)=>{var MU=F$(),PU=I5(),FU=T6(),u6=x(),RU=d(),NU=d0();class N4 extends FU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(u6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=h6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=h6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&u6.isScalar(z)?z.value:z}has($){let Z=h6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=h6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(u6.isScalar(z)&&RU.isScalarValue(Z))z.value=Z;else this.items[Q]=Z}toJSON($,Z){let Q=[];if(Z?.onCreate)Z.onCreate(Q);let z=0;for(let X of this.items)Q.push(NU.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return PU.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let H=0;for(let U of Z){if(typeof z==="function"){let J=Z instanceof Set?U:String(H++);U=z.call(Z,J,U)}X.items.push(MU.createNode(U,void 0,Q))}}return X}}function h6($){let Z=u6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}TU.YAMLSeq=N4});var p2=M((wU)=>{var CU=x(),T4=a0(),jU={collection:"seq",default:!0,nodeClass:T4.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!CU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>T4.YAMLSeq.from($,Z,Q)};wU.seq=jU});var w$=M((yU)=>{var EU=T$(),bU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),EU.stringifyString($,Z,Q,z)}};yU.string=bU});var f6=M((gU)=>{var A4=d(),C4={identify:($)=>$==null,createNode:()=>new A4.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new A4.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&C4.test.test($)?$:Z.options.nullStr};gU.nullTag=C4});var O5=M((hU)=>{var kU=d(),j4={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new kU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&j4.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};hU.boolTag=j4});var l2=M((mU)=>{function fU({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let H=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(H)&&!H.includes("e")){let U=H.indexOf(".");if(U<0)U=H.length,H+=".";let J=Z-(H.length-U-1);while(J-- >0)H+="0"}return H}mU.stringifyNumber=fU});var M5=M((nU)=>{var lU=d(),_5=l2(),cU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_5.stringifyNumber},dU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():_5.stringifyNumber($)}},iU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new lU.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:_5.stringifyNumber};nU.float=iU;nU.floatExp=dU;nU.floatNaN=cU});var F5=M(($J)=>{var w4=l2(),m6=($)=>typeof $==="bigint"||Number.isInteger($),P5=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function S4($,Z,Q){let{value:z}=$;if(m6(z)&&z>=0)return Q+z.toString(Z);return w4.stringifyNumber($)}var aU={identify:($)=>m6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>P5($,2,8,Q),stringify:($)=>S4($,8,"0o")},tU={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>P5($,0,10,Q),stringify:w4.stringifyNumber},eU={identify:($)=>m6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>P5($,2,16,Q),stringify:($)=>S4($,16,"0x")};$J.int=tU;$J.intHex=eU;$J.intOct=aU});var E4=M((YJ)=>{var XJ=m2(),HJ=f6(),UJ=p2(),JJ=w$(),GJ=O5(),R5=M5(),N5=F5(),VJ=[XJ.map,UJ.seq,JJ.string,HJ.nullTag,GJ.boolTag,N5.intOct,N5.int,N5.intHex,R5.floatNaN,R5.floatExp,R5.float];YJ.schema=VJ});var y4=M((OJ)=>{var BJ=d(),qJ=m2(),KJ=p2();function b4($){return typeof $==="bigint"||Number.isInteger($)}var p6=({value:$})=>JSON.stringify($),DJ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:p6},{identify:($)=>$==null,createNode:()=>new BJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:p6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:p6},{identify:b4,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>b4($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:p6}],LJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},IJ=[qJ.map,KJ.seq].concat(DJ,LJ);OJ.schema=IJ});var A5=M((FJ)=>{var S$=K$("buffer"),T5=d(),MJ=T$(),PJ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof S$.Buffer==="function")return S$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,H){if(!Q)return"";let U=Q,J;if(typeof S$.Buffer==="function")J=U instanceof S$.Buffer?U.toString("base64"):S$.Buffer.from(U.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let V=0;V<U.length;++V)G+=String.fromCharCode(U[V]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=T5.Scalar.BLOCK_LITERAL),Z!==T5.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),V=Math.ceil(J.length/G),Y=Array(V);for(let W=0,B=0;W<V;++W,B+=G)Y[W]=J.substr(B,G);J=Y.join(Z===T5.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return MJ.stringifyString({comment:$,type:Z,value:J},z,X,H)}};FJ.binary=PJ});var c6=M((CJ)=>{var l6=x(),C5=r0(),NJ=d(),TJ=a0();function x4($,Z){if(l6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(l6.isPair(z))continue;else if(l6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new C5.Pair(new NJ.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
53
+ ${X.key.commentBefore}`:z.commentBefore;if(z.comment){let H=X.value??X.key;H.comment=H.comment?`${z.comment}
54
+ ${H.comment}`:z.comment}z=X}$.items[Q]=l6.isPair(z)?z:new C5.Pair(z)}else Z("Expected a sequence for this tag");return $}function g4($,Z,Q){let{replacer:z}=Q,X=new TJ.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let H=0;if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,String(H++),U);let J,G;if(Array.isArray(U))if(U.length===2)J=U[0],G=U[1];else throw TypeError(`Expected [key, value] tuple: ${U}`);else if(U&&U instanceof Object){let V=Object.keys(U);if(V.length===1)J=V[0],G=U[J];else throw TypeError(`Expected tuple with one key, not ${V.length} keys`)}else J=U;X.items.push(C5.createPair(J,G,Q))}return X}var AJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:x4,createNode:g4};CJ.createPairs=g4;CJ.pairs=AJ;CJ.resolvePairs=x4});var w5=M((yJ)=>{var v4=x(),j5=d0(),E$=o0(),EJ=a0(),k4=c6();class G2 extends EJ.YAMLSeq{constructor(){super();this.add=E$.YAMLMap.prototype.add.bind(this),this.delete=E$.YAMLMap.prototype.delete.bind(this),this.get=E$.YAMLMap.prototype.get.bind(this),this.has=E$.YAMLMap.prototype.has.bind(this),this.set=E$.YAMLMap.prototype.set.bind(this),this.tag=G2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,H;if(v4.isPair(z))X=j5.toJS(z.key,"",Z),H=j5.toJS(z.value,X,Z);else X=j5.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,H)}return Q}static from($,Z,Q){let z=k4.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}G2.tag="tag:yaml.org,2002:omap";var bJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=k4.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(v4.isScalar(X))if(z.includes(X.value))Z(`Ordered maps must not include duplicate keys: ${X.value}`);else z.push(X.value);return Object.assign(new G2,Q)},createNode:($,Z,Q)=>G2.from($,Z,Q)};yJ.YAMLOMap=G2;yJ.omap=bJ});var p4=M((vJ)=>{var h4=d();function u4({value:$,source:Z},Q){if(Z&&($?f4:m4).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var f4={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new h4.Scalar(!0),stringify:u4},m4={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new h4.Scalar(!1),stringify:u4};vJ.falseTag=m4;vJ.trueTag=f4});var l4=M((lJ)=>{var uJ=d(),S5=l2(),fJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:S5.stringifyNumber},mJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():S5.stringifyNumber($)}},pJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new uJ.Scalar(parseFloat($.replace(/_/g,""))),Q=$.indexOf(".");if(Q!==-1){let z=$.substring(Q+1).replace(/_/g,"");if(z[z.length-1]==="0")Z.minFractionDigits=z.length}return Z},stringify:S5.stringifyNumber};lJ.float=pJ;lJ.floatExp=mJ;lJ.floatNaN=fJ});var d4=M((aJ)=>{var c4=l2(),b$=($)=>typeof $==="bigint"||Number.isInteger($);function d6($,Z,Q,{intAsBigInt:z}){let X=$[0];if(X==="-"||X==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(Q){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let U=BigInt($);return X==="-"?BigInt(-1)*U:U}let H=parseInt($,Q);return X==="-"?-1*H:H}function E5($,Z,Q){let{value:z}=$;if(b$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return c4.stringifyNumber($)}var nJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>d6($,2,2,Q),stringify:($)=>E5($,2,"0b")},rJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>d6($,1,8,Q),stringify:($)=>E5($,8,"0")},sJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>d6($,0,10,Q),stringify:c4.stringifyNumber},oJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>d6($,2,16,Q),stringify:($)=>E5($,16,"0x")};aJ.int=sJ;aJ.intBin=nJ;aJ.intHex=oJ;aJ.intOct=rJ});var b5=M((zG)=>{var r6=x(),i6=r0(),n6=o0();class V2 extends n6.YAMLMap{constructor($){super($);this.tag=V2.tag}add($){let Z;if(r6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new i6.Pair($.key,null);else Z=new i6.Pair($,null);if(!n6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=n6.findPair(this.items,$);return!Z&&r6.isPair(Q)?r6.isScalar(Q.key)?Q.key.value:Q.key:Q}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let Q=n6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new i6.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof z==="function")H=z.call(Z,H,H);X.items.push(i6.createPair(H,null,Q))}return X}}V2.tag="tag:yaml.org,2002:set";var QG={collection:"map",identify:($)=>$ instanceof Set,nodeClass:V2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>V2.from($,Z,Q),resolve($,Z){if(r6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new V2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};zG.YAMLSet=V2;zG.set=QG});var x5=M((VG)=>{var UG=l2();function y5($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(U)=>Z?BigInt(U):Number(U),H=z.replace(/_/g,"").split(":").reduce((U,J)=>U*X(60)+X(J),X(0));return Q==="-"?X(-1)*H:H}function i4($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return UG.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),H=[Z%X];if(Z<60)H.unshift(0);else if(Z=(Z-H[0])/X,H.unshift(Z%X),Z>=60)Z=(Z-H[0])/X,H.unshift(Z);return z+H.map((U)=>String(U).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var JG={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,Z,{intAsBigInt:Q})=>y5($,Q),stringify:i4},GG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>y5($,!1),stringify:i4},n4={identify:($)=>$ 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($){let Z=$.match(n4.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,H,U,J]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,V=Date.UTC(Q,z-1,X,H||0,U||0,J||0,G),Y=Z[8];if(Y&&Y!=="Z"){let W=y5(Y,!1);if(Math.abs(W)<30)W*=60;V-=60000*W}return new Date(V)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};VG.floatTime=GG;VG.intTime=JG;VG.timestamp=n4});var s4=M((RG)=>{var qG=m2(),KG=f6(),DG=p2(),LG=w$(),IG=A5(),r4=p4(),g5=l4(),s6=d4(),OG=b6(),_G=w5(),MG=c6(),PG=b5(),v5=x5(),FG=[qG.map,DG.seq,LG.string,KG.nullTag,r4.trueTag,r4.falseTag,s6.intBin,s6.intOct,s6.int,s6.intHex,g5.floatNaN,g5.floatExp,g5.float,IG.binary,OG.merge,_G.omap,MG.pairs,PG.set,v5.intTime,v5.floatTime,v5.timestamp];RG.schema=FG});var H7=M((bG)=>{var e4=m2(),TG=f6(),$7=p2(),AG=w$(),CG=O5(),k5=M5(),h5=F5(),jG=E4(),wG=y4(),Z7=A5(),y$=b6(),Q7=w5(),z7=c6(),o4=s4(),X7=b5(),o6=x5(),a4=new Map([["core",jG.schema],["failsafe",[e4.map,$7.seq,AG.string]],["json",wG.schema],["yaml11",o4.schema],["yaml-1.1",o4.schema]]),t4={binary:Z7.binary,bool:CG.boolTag,float:k5.float,floatExp:k5.floatExp,floatNaN:k5.floatNaN,floatTime:o6.floatTime,int:h5.int,intHex:h5.intHex,intOct:h5.intOct,intTime:o6.intTime,map:e4.map,merge:y$.merge,null:TG.nullTag,omap:Q7.omap,pairs:z7.pairs,seq:$7.seq,set:X7.set,timestamp:o6.timestamp},SG={"tag:yaml.org,2002:binary":Z7.binary,"tag:yaml.org,2002:merge":y$.merge,"tag:yaml.org,2002:omap":Q7.omap,"tag:yaml.org,2002:pairs":z7.pairs,"tag:yaml.org,2002:set":X7.set,"tag:yaml.org,2002:timestamp":o6.timestamp};function EG($,Z,Q){let z=a4.get(Z);if(z&&!$)return Q&&!z.includes(y$.merge)?z.concat(y$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let H=Array.from(a4.keys()).filter((U)=>U!=="yaml11").map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${H} or define customTags array`)}if(Array.isArray($))for(let H of $)X=X.concat(H);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(y$.merge);return X.reduce((H,U)=>{let J=typeof U==="string"?t4[U]:U;if(!J){let G=JSON.stringify(U),V=Object.keys(t4).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${V}`)}if(!H.includes(J))H.push(J);return H},[])}bG.coreKnownTags=SG;bG.getTags=EG});var m5=M((uG)=>{var u5=x(),gG=m2(),vG=p2(),kG=w$(),a6=H7(),hG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class f5{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?a6.getTags($,"compat"):$?a6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?a6.coreKnownTags:{},this.tags=a6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,u5.MAP,{value:gG.map}),Object.defineProperty(this,u5.SCALAR,{value:kG.string}),Object.defineProperty(this,u5.SEQ,{value:vG.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?hG:null}clone(){let $=Object.create(f5.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}uG.Schema=f5});var U7=M((lG)=>{var mG=x(),p5=A$(),x$=R$();function pG($,Z){let Q=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)Q.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)Q.push("---");let X=p5.createStringifyContext($,Z),{commentString:H}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let G=H($.commentBefore);Q.unshift(x$.indentComment(G,""))}let U=!1,J=null;if($.contents){if(mG.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=H($.contents.commentBefore);Q.push(x$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>U=!0,V=p5.stringify($.contents,X,()=>J=null,G);if(J)V+=x$.lineComment(V,"",H(J));if((V[0]==="|"||V[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${V}`;else Q.push(V)}else Q.push(p5.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let G=H($.comment);if(G.includes(`
55
+ `))Q.push("..."),Q.push(x$.indentComment(G,""));else Q.push(`... ${G}`)}else Q.push("...");else{let G=$.comment;if(G&&U)G=G.replace(/^\n+/,"");if(G){if((!U||J)&&Q[Q.length-1]!=="")Q.push("");Q.push(x$.indentComment(H(G),""))}}return Q.join(`
56
56
  `)+`
57
- `}mG.stringifyDocument=fG});var b$=_((oG)=>{var lG=M$(),p2=T6(),G0=x(),cG=n0(),dG=c0(),iG=k1(),nG=$7(),u1=F6(),rG=X1(),sG=O$(),f1=z1();class m1{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G0.NODE_TYPE,{value:G0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:U}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new f1.Directives({version:U});this.setSchema(U,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(m1.prototype,{[G0.NODE_TYPE]:{value:G0.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=G0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(l2(this.contents))this.contents.add($)}addIn($,Z){if(l2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=u1.anchorNames(this);$.anchor=!Z||Q.has(Z)?u1.findNewAnchor(Z||"a",Q):Z}return new lG.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let q=(M)=>typeof M==="number"||M instanceof String||M instanceof Number,D=Z.filter(q).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:U,flow:H,keepUndefined:J,onTagObj:G,tag:V}=Q??{},{onAnchor:Y,setAnchors:W,sourceObjects:B}=u1.createNodeAnchors(this,U||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:B},L=sG.createNode($,V,K);if(H&&G0.isCollection(L))L.flow=!0;return W(),L}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new cG.Pair(z,X)}delete($){return l2(this.contents)?this.contents.delete($):!1}deleteIn($){if(p2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return l2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return G0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(p2.isEmptyPath($))return!Z&&G0.isScalar(this.contents)?this.contents.value:this.contents;return G0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return G0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(p2.isEmptyPath($))return this.contents!==void 0;return G0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=p2.collectionFromPath(this.schema,[$],Z);else if(l2(this.contents))this.contents.set($,Z)}setIn($,Z){if(p2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=p2.collectionFromPath(this.schema,Array.from($),Z);else if(l2(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let Q;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new f1.Directives({version:"1.1"});Q={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new f1.Directives({version:$});Q={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Q=null;break;default:{let z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(Q)this.schema=new iG.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:U}={}){let H={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},J=dG.toJS(this.contents,Z??"",H);if(typeof X==="function")for(let{count:G,res:V}of H.anchors.values())X(V,G);return typeof U==="function"?rG.applyReviver(U,{"":J},"",J):J}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return nG.stringifyDocument(this,$)}}function l2($){if(G0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}oG.Document=m1});var y$=_((eG)=>{class t6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class Z7 extends t6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class Q7 extends t6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var tG=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((J)=>Z.linePos(J));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let U=X-1,H=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(U>=60&&H.length>80){let J=Math.min(U-39,H.length-79);H="…"+H.substring(J),U-=J-1}if(H.length>80)H=H.substring(0,79)+"…";if(z>1&&/^ *$/.test(H.substring(0,U))){let J=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(J.length>80)J=J.substring(0,79)+`…
58
- `;H=J+H}if(/[^ ]/.test(H)){let J=1,G=Q.linePos[1];if(G?.line===z&&G.col>X)J=Math.max(1,Math.min(G.col-X,80-U));let V=" ".repeat(U)+"^".repeat(J);Q.message+=`:
57
+ `}lG.stringifyDocument=pG});var g$=M((tG)=>{var dG=P$(),c2=T6(),G0=x(),iG=r0(),nG=d0(),rG=m5(),sG=U7(),l5=F6(),oG=G5(),aG=F$(),c5=J5();class d5{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G0.NODE_TYPE,{value:G0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:H}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)H=this.directives.yaml.version}else this.directives=new c5.Directives({version:H});this.setSchema(H,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(d5.prototype,{[G0.NODE_TYPE]:{value:G0.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=G0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(d2(this.contents))this.contents.add($)}addIn($,Z){if(d2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=l5.anchorNames(this);$.anchor=!Z||Q.has(Z)?l5.findNewAnchor(Z||"a",Q):Z}return new dG.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let q=(O)=>typeof O==="number"||O instanceof String||O instanceof Number,D=Z.filter(q).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:H,flow:U,keepUndefined:J,onTagObj:G,tag:V}=Q??{},{onAnchor:Y,setAnchors:W,sourceObjects:B}=l5.createNodeAnchors(this,H||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:B},L=aG.createNode($,V,K);if(U&&G0.isCollection(L))L.flow=!0;return W(),L}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new iG.Pair(z,X)}delete($){return d2(this.contents)?this.contents.delete($):!1}deleteIn($){if(c2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return d2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return G0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(c2.isEmptyPath($))return!Z&&G0.isScalar(this.contents)?this.contents.value:this.contents;return G0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return G0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(c2.isEmptyPath($))return this.contents!==void 0;return G0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=c2.collectionFromPath(this.schema,[$],Z);else if(d2(this.contents))this.contents.set($,Z)}setIn($,Z){if(c2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=c2.collectionFromPath(this.schema,Array.from($),Z);else if(d2(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let Q;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new c5.Directives({version:"1.1"});Q={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new c5.Directives({version:$});Q={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Q=null;break;default:{let z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(Q)this.schema=new rG.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:H}={}){let U={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},J=nG.toJS(this.contents,Z??"",U);if(typeof X==="function")for(let{count:G,res:V}of U.anchors.values())X(V,G);return typeof H==="function"?oG.applyReviver(H,{"":J},"",J):J}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return sG.stringifyDocument(this,$)}}function d2($){if(G0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}tG.Document=d5});var v$=M((ZV)=>{class t6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class J7 extends t6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class G7 extends t6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var $V=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((J)=>Z.linePos(J));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let H=X-1,U=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(H>=60&&U.length>80){let J=Math.min(H-39,U.length-79);U="…"+U.substring(J),H-=J-1}if(U.length>80)U=U.substring(0,79)+"…";if(z>1&&/^ *$/.test(U.substring(0,H))){let J=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(J.length>80)J=J.substring(0,79)+`…
58
+ `;U=J+U}if(/[^ ]/.test(U)){let J=1,G=Q.linePos[1];if(G?.line===z&&G.col>X)J=Math.max(1,Math.min(G.col-X,80-H));let V=" ".repeat(H)+"^".repeat(J);Q.message+=`:
59
59
 
60
- ${H}
60
+ ${U}
61
61
  ${V}
62
- `}};eG.YAMLError=t6;eG.YAMLParseError=Z7;eG.YAMLWarning=Q7;eG.prettifyError=tG});var x$=_((UV)=>{function XV($,{flow:Z,indicator:Q,next:z,offset:X,onError:U,parentIndent:H,startOnNewline:J}){let G=!1,V=J,Y=J,W="",B="",K=!1,L=!1,q=null,D=null,M=null,O=null,A=null,F=null,N=null;for(let P of $){if(L){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")U(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(q){if(V&&P.type!=="comment"&&P.type!=="newline")U(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");q=null}switch(P.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&P.source.includes("\t"))q=P;Y=!0;break;case"comment":{if(!Y)U(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=P.source.substring(1)||" ";if(!W)W=E;else W+=B+E;B="",V=!1;break}case"newline":if(V){if(W)W+=P.source;else if(!F||Q!=="seq-item-ind")G=!0}else B+=P.source;if(V=!0,K=!0,D||M)O=P;Y=!0;break;case"anchor":if(D)U(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))U(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=P,N??(N=P.offset),V=!1,Y=!1,L=!0;break;case"tag":{if(M)U(P,"MULTIPLE_TAGS","A node can have at most one tag");M=P,N??(N=P.offset),V=!1,Y=!1,L=!0;break}case Q:if(D||M)U(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(F)U(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${Z??"collection"}`);F=P,V=Q==="seq-item-ind"||Q==="explicit-key-ind",Y=!1;break;case"comma":if(Z){if(A)U(P,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);A=P,V=!1,Y=!1;break}default:U(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),V=!1,Y=!1}}let R=$[$.length-1],w=R?R.offset+R.source.length:X;if(L&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))U(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(q&&(V&&q.indent<=H||z?.type==="block-map"||z?.type==="block-seq"))U(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:A,found:F,spaceBefore:G,comment:W,hasNewline:K,anchor:D,tag:M,newlineAfterProp:O,end:w,start:N??w}}UV.resolveProps=XV});var e6=_((JV)=>{function p1($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
63
- `))return!0;if($.end){for(let Z of $.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of $.items){for(let Q of Z.start)if(Q.type==="newline")return!0;if(Z.sep){for(let Q of Z.sep)if(Q.type==="newline")return!0}if(p1(Z.key)||p1(Z.value))return!0}return!1;default:return!0}}JV.containsNewline=p1});var l1=_((WV)=>{var VV=e6();function YV($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&VV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}WV.flowIndentCheck=YV});var c1=_((KV)=>{var z7=x();function qV($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(U,H)=>U===H||z7.isScalar(U)&&z7.isScalar(H)&&U.value===H.value;return Z.some((U)=>X(U.key,Q))}KV.mapIncludes=qV});var G7=_((_V)=>{var X7=n0(),LV=s0(),U7=x$(),IV=e6(),H7=l1(),MV=c1(),J7="All mapping items must start at the same column";function OV({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=new(U?.nodeClass??LV.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let G=z.offset,V=null;for(let Y of z.items){let{start:W,key:B,sep:K,value:L}=Y,q=U7.resolveProps(W,{indicator:"explicit-key-ind",next:B??K?.[0],offset:G,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!q.found;if(D){if(B){if(B.type==="block-seq")X(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==z.indent)X(G,"BAD_INDENT",J7)}if(!q.anchor&&!q.tag&&!K){if(V=q.end,q.comment)if(J.comment)J.comment+=`
64
- `+q.comment;else J.comment=q.comment;continue}if(q.newlineAfterProp||IV.containsNewline(B))X(B??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==z.indent)X(G,"BAD_INDENT",J7);Q.atKey=!0;let M=q.end,O=B?$(Q,B,q,X):Z(Q,M,W,null,q,X);if(Q.schema.compat)H7.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,MV.mapIncludes(Q,J.items,O))X(M,"DUPLICATE_KEY","Map keys must be unique");let A=U7.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:O.range[2],onError:X,parentIndent:z.indent,startOnNewline:!B||B.type==="block-scalar"});if(G=A.end,A.found){if(D){if(L?.type==="block-map"&&!A.hasNewline)X(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&q.start<A.found.offset-1024)X(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let F=L?$(Q,L,A,X):Z(Q,G,K,null,A,X);if(Q.schema.compat)H7.flowIndentCheck(z.indent,L,X);G=F.range[2];let N=new X7.Pair(O,F);if(Q.options.keepSourceTokens)N.srcToken=Y;J.items.push(N)}else{if(D)X(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(A.comment)if(O.comment)O.comment+=`
65
- `+A.comment;else O.comment=A.comment;let F=new X7.Pair(O);if(Q.options.keepSourceTokens)F.srcToken=Y;J.items.push(F)}}if(V&&V<G)X(V,"IMPOSSIBLE","Map comment with trailing content");return J.range=[z.offset,G,V??G],J}_V.resolveBlockMap=OV});var V7=_((AV)=>{var FV=o0(),NV=x$(),RV=l1();function TV({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=new(U?.nodeClass??FV.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let G=z.offset,V=null;for(let{start:Y,value:W}of z.items){let B=NV.resolveProps(Y,{indicator:"seq-item-ind",next:W,offset:G,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||W)if(W?.type==="block-seq")X(B.end,"BAD_INDENT","All sequence items must start at the same column");else X(G,"MISSING_CHAR","Sequence item without - indicator");else{if(V=B.end,B.comment)J.comment=B.comment;continue}let K=W?$(Q,W,B,X):Z(Q,B.end,Y,null,B,X);if(Q.schema.compat)RV.flowIndentCheck(z.indent,W,X);G=K.range[2],J.items.push(K)}return J.range=[z.offset,G,V??G],J}AV.resolveBlockSeq=TV});var c2=_((wV)=>{function jV($,Z,Q,z){let X="";if($){let U=!1,H="";for(let J of $){let{source:G,type:V}=J;switch(V){case"space":U=!0;break;case"comment":{if(Q&&!U)z(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=G.substring(1)||" ";if(!X)X=Y;else X+=H+Y;H="";break}case"newline":if(X)H+=G;U=!0;break;default:z(J,"UNEXPECTED_TOKEN",`Unexpected ${V} at node end`)}Z+=G.length}}return{comment:X,offset:Z}}wV.resolveEnd=jV});var B7=_((hV)=>{var EV=x(),bV=n0(),Y7=s0(),yV=o0(),xV=c2(),W7=x$(),gV=e6(),vV=c1(),d1="Block collections are not allowed within flow collections",i1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function kV({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=z.start.source==="{",J=H?"flow map":"flow sequence",V=new(U?.nodeClass??(H?Y7.YAMLMap:yV.YAMLSeq))(Q.schema);V.flow=!0;let Y=Q.atRoot;if(Y)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let W=z.offset+z.start.source.length;for(let D=0;D<z.items.length;++D){let M=z.items[D],{start:O,key:A,sep:F,value:N}=M,R=W7.resolveProps(O,{flow:J,indicator:"explicit-key-ind",next:A??F?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!F&&!N){if(D===0&&R.comma)X(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(R.comment)if(V.comment)V.comment+=`
66
- `+R.comment;else V.comment=R.comment;W=R.end;continue}if(!H&&Q.options.strict&&gV.containsNewline(A))X(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(R.comma)X(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!R.comma)X(R.start,"MISSING_CHAR",`Missing , between ${J} items`);if(R.comment){let w="";$:for(let P of O)switch(P.type){case"comma":case"space":break;case"comment":w=P.source.substring(1);break $;default:break $}if(w){let P=V.items[V.items.length-1];if(EV.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
67
- `+w;else P.comment=w;R.comment=R.comment.substring(w.length+1)}}}if(!H&&!F&&!R.found){let w=N?$(Q,N,R,X):Z(Q,R.end,F,null,R,X);if(V.items.push(w),W=w.range[2],i1(N))X(w.range,"BLOCK_IN_FLOW",d1)}else{Q.atKey=!0;let w=R.end,P=A?$(Q,A,R,X):Z(Q,w,O,null,R,X);if(i1(A))X(P.range,"BLOCK_IN_FLOW",d1);Q.atKey=!1;let E=W7.resolveProps(F??[],{flow:J,indicator:"map-value-ind",next:N,offset:P.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(E.found){if(!H&&!R.found&&Q.options.strict){if(F)for(let g of F){if(g===E.found)break;if(g.type==="newline"){X(g,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(R.start<E.found.offset-1024)X(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")X(N,"MISSING_CHAR",`Missing space after : in ${J}`);else X(E.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let n=N?$(Q,N,E,X):E.found?Z(Q,E.end,F,null,E,X):null;if(n){if(i1(N))X(n.range,"BLOCK_IN_FLOW",d1)}else if(E.comment)if(P.comment)P.comment+=`
68
- `+E.comment;else P.comment=E.comment;let a=new bV.Pair(P,n);if(Q.options.keepSourceTokens)a.srcToken=M;if(H){let g=V;if(vV.mapIncludes(Q,g.items,P))X(w,"DUPLICATE_KEY","Map keys must be unique");g.items.push(a)}else{let g=new Y7.YAMLMap(Q.schema);g.flow=!0,g.items.push(a);let T=(n??P).range;g.range=[P.range[0],T[1],T[2]],V.items.push(g)}W=n?n.range[2]:E.end}}let B=H?"}":"]",[K,...L]=z.end,q=W;if(K?.source===B)q=K.offset+K.source.length;else{let D=J[0].toUpperCase()+J.substring(1),M=Y?`${D} must end with a ${B}`:`${D} in block collection must be sufficiently indented and end with a ${B}`;if(X(W,Y?"MISSING_CHAR":"BAD_INDENT",M),K&&K.source.length!==1)L.unshift(K)}if(L.length>0){let D=xV.resolveEnd(L,q,Q.options.strict,X);if(D.comment)if(V.comment)V.comment+=`
69
- `+D.comment;else V.comment=D.comment;V.range=[z.offset,q,D.offset]}else V.range=[z.offset,q,q];return V}hV.resolveFlowCollection=kV});var q7=_((rV)=>{var fV=x(),mV=d(),pV=s0(),lV=o0(),cV=G7(),dV=V7(),iV=B7();function n1($,Z,Q,z,X,U){let H=Q.type==="block-map"?cV.resolveBlockMap($,Z,Q,z,U):Q.type==="block-seq"?dV.resolveBlockSeq($,Z,Q,z,U):iV.resolveFlowCollection($,Z,Q,z,U),J=H.constructor;if(X==="!"||X===J.tagName)return H.tag=J.tagName,H;if(X)H.tag=X;return H}function nV($,Z,Q,z,X){let U=z.tag,H=!U?null:Z.directives.tagName(U.source,(B)=>X(U,"TAG_RESOLVE_FAILED",B));if(Q.type==="block-seq"){let{anchor:B,newlineAfterProp:K}=z,L=B&&U?B.offset>U.offset?B:U:B??U;if(L&&(!K||K.offset<L.offset))X(L,"MISSING_CHAR","Missing newline after block sequence props")}let J=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!U||!H||H==="!"||H===pV.YAMLMap.tagName&&J==="map"||H===lV.YAMLSeq.tagName&&J==="seq")return n1($,Z,Q,X,H);let G=Z.schema.tags.find((B)=>B.tag===H&&B.collection===J);if(!G){let B=Z.schema.knownTags[H];if(B?.collection===J)Z.schema.tags.push(Object.assign({},B,{default:!1})),G=B;else{if(B)X(U,"BAD_COLLECTION_TYPE",`${B.tag} used for ${J} collection, but expects ${B.collection??"scalar"}`,!0);else X(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${H}`,!0);return n1($,Z,Q,X,H)}}let V=n1($,Z,Q,X,H,G),Y=G.resolve?.(V,(B)=>X(U,"TAG_RESOLVE_FAILED",B),Z.options)??V,W=fV.isNode(Y)?Y:new mV.Scalar(Y);if(W.range=V.range,W.tag=H,G?.format)W.format=G.format;return W}rV.composeCollection=nV});var s1=_((eV)=>{var r1=d();function oV($,Z,Q){let z=Z.offset,X=aV(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let U=X.mode===">"?r1.Scalar.BLOCK_FOLDED:r1.Scalar.BLOCK_LITERAL,H=Z.source?tV(Z.source):[],J=H.length;for(let q=H.length-1;q>=0;--q){let D=H[q][1];if(D===""||D==="\r")J=q;else break}if(J===0){let q=X.chomp==="+"&&H.length>0?`
70
- `.repeat(Math.max(1,H.length-1)):"",D=z+X.length;if(Z.source)D+=Z.source.length;return{value:q,type:U,comment:X.comment,range:[z,D,D]}}let G=Z.indent+X.indent,V=Z.offset+X.length,Y=0;for(let q=0;q<J;++q){let[D,M]=H[q];if(M===""||M==="\r"){if(X.indent===0&&D.length>G)G=D.length}else{if(D.length<G)Q(V+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)G=D.length;if(Y=q,G===0&&!$.atRoot)Q(V,"BAD_INDENT","Block scalar values in collections must be indented");break}V+=D.length+M.length+1}for(let q=H.length-1;q>=J;--q)if(H[q][0].length>G)J=q+1;let W="",B="",K=!1;for(let q=0;q<Y;++q)W+=H[q][0].slice(G)+`
71
- `;for(let q=Y;q<J;++q){let[D,M]=H[q];V+=D.length+M.length+1;let O=M[M.length-1]==="\r";if(O)M=M.slice(0,-1);if(M&&D.length<G){let F=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(V-M.length-(O?2:1),"BAD_INDENT",F),D=""}if(U===r1.Scalar.BLOCK_LITERAL)W+=B+D.slice(G)+M,B=`
72
- `;else if(D.length>G||M[0]==="\t"){if(B===" ")B=`
62
+ `}};ZV.YAMLError=t6;ZV.YAMLParseError=J7;ZV.YAMLWarning=G7;ZV.prettifyError=$V});var k$=M((JV)=>{function UV($,{flow:Z,indicator:Q,next:z,offset:X,onError:H,parentIndent:U,startOnNewline:J}){let G=!1,V=J,Y=J,W="",B="",K=!1,L=!1,q=null,D=null,O=null,_=null,C=null,F=null,R=null;for(let P of $){if(L){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")H(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(q){if(V&&P.type!=="comment"&&P.type!=="newline")H(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");q=null}switch(P.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&P.source.includes("\t"))q=P;Y=!0;break;case"comment":{if(!Y)H(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=P.source.substring(1)||" ";if(!W)W=E;else W+=B+E;B="",V=!1;break}case"newline":if(V){if(W)W+=P.source;else if(!F||Q!=="seq-item-ind")G=!0}else B+=P.source;if(V=!0,K=!0,D||O)_=P;Y=!0;break;case"anchor":if(D)H(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))H(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=P,R??(R=P.offset),V=!1,Y=!1,L=!0;break;case"tag":{if(O)H(P,"MULTIPLE_TAGS","A node can have at most one tag");O=P,R??(R=P.offset),V=!1,Y=!1,L=!0;break}case Q:if(D||O)H(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(F)H(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${Z??"collection"}`);F=P,V=Q==="seq-item-ind"||Q==="explicit-key-ind",Y=!1;break;case"comma":if(Z){if(C)H(P,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);C=P,V=!1,Y=!1;break}default:H(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),V=!1,Y=!1}}let N=$[$.length-1],w=N?N.offset+N.source.length:X;if(L&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))H(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(q&&(V&&q.indent<=U||z?.type==="block-map"||z?.type==="block-seq"))H(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:F,spaceBefore:G,comment:W,hasNewline:K,anchor:D,tag:O,newlineAfterProp:_,end:w,start:R??w}}JV.resolveProps=UV});var e6=M((VV)=>{function i5($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
63
+ `))return!0;if($.end){for(let Z of $.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of $.items){for(let Q of Z.start)if(Q.type==="newline")return!0;if(Z.sep){for(let Q of Z.sep)if(Q.type==="newline")return!0}if(i5(Z.key)||i5(Z.value))return!0}return!1;default:return!0}}VV.containsNewline=i5});var n5=M((qV)=>{var WV=e6();function BV($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&WV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}qV.flowIndentCheck=BV});var r5=M((LV)=>{var V7=x();function DV($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(H,U)=>H===U||V7.isScalar(H)&&V7.isScalar(U)&&H.value===U.value;return Z.some((H)=>X(H.key,Q))}LV.mapIncludes=DV});var K7=M((FV)=>{var Y7=r0(),OV=o0(),W7=k$(),_V=e6(),B7=n5(),MV=r5(),q7="All mapping items must start at the same column";function PV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??OV.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let G=z.offset,V=null;for(let Y of z.items){let{start:W,key:B,sep:K,value:L}=Y,q=W7.resolveProps(W,{indicator:"explicit-key-ind",next:B??K?.[0],offset:G,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!q.found;if(D){if(B){if(B.type==="block-seq")X(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==z.indent)X(G,"BAD_INDENT",q7)}if(!q.anchor&&!q.tag&&!K){if(V=q.end,q.comment)if(J.comment)J.comment+=`
64
+ `+q.comment;else J.comment=q.comment;continue}if(q.newlineAfterProp||_V.containsNewline(B))X(B??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==z.indent)X(G,"BAD_INDENT",q7);Q.atKey=!0;let O=q.end,_=B?$(Q,B,q,X):Z(Q,O,W,null,q,X);if(Q.schema.compat)B7.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,MV.mapIncludes(Q,J.items,_))X(O,"DUPLICATE_KEY","Map keys must be unique");let C=W7.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:_.range[2],onError:X,parentIndent:z.indent,startOnNewline:!B||B.type==="block-scalar"});if(G=C.end,C.found){if(D){if(L?.type==="block-map"&&!C.hasNewline)X(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&q.start<C.found.offset-1024)X(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let F=L?$(Q,L,C,X):Z(Q,G,K,null,C,X);if(Q.schema.compat)B7.flowIndentCheck(z.indent,L,X);G=F.range[2];let R=new Y7.Pair(_,F);if(Q.options.keepSourceTokens)R.srcToken=Y;J.items.push(R)}else{if(D)X(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(_.comment)_.comment+=`
65
+ `+C.comment;else _.comment=C.comment;let F=new Y7.Pair(_);if(Q.options.keepSourceTokens)F.srcToken=Y;J.items.push(F)}}if(V&&V<G)X(V,"IMPOSSIBLE","Map comment with trailing content");return J.range=[z.offset,G,V??G],J}FV.resolveBlockMap=PV});var D7=M((jV)=>{var NV=a0(),TV=k$(),AV=n5();function CV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??NV.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let G=z.offset,V=null;for(let{start:Y,value:W}of z.items){let B=TV.resolveProps(Y,{indicator:"seq-item-ind",next:W,offset:G,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||W)if(W?.type==="block-seq")X(B.end,"BAD_INDENT","All sequence items must start at the same column");else X(G,"MISSING_CHAR","Sequence item without - indicator");else{if(V=B.end,B.comment)J.comment=B.comment;continue}let K=W?$(Q,W,B,X):Z(Q,B.end,Y,null,B,X);if(Q.schema.compat)AV.flowIndentCheck(z.indent,W,X);G=K.range[2],J.items.push(K)}return J.range=[z.offset,G,V??G],J}jV.resolveBlockSeq=CV});var i2=M((EV)=>{function SV($,Z,Q,z){let X="";if($){let H=!1,U="";for(let J of $){let{source:G,type:V}=J;switch(V){case"space":H=!0;break;case"comment":{if(Q&&!H)z(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=G.substring(1)||" ";if(!X)X=Y;else X+=U+Y;U="";break}case"newline":if(X)U+=G;H=!0;break;default:z(J,"UNEXPECTED_TOKEN",`Unexpected ${V} at node end`)}Z+=G.length}}return{comment:X,offset:Z}}EV.resolveEnd=SV});var O7=M((fV)=>{var yV=x(),xV=r0(),L7=o0(),gV=a0(),vV=i2(),I7=k$(),kV=e6(),hV=r5(),s5="Block collections are not allowed within flow collections",o5=($)=>$&&($.type==="block-map"||$.type==="block-seq");function uV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let U=z.start.source==="{",J=U?"flow map":"flow sequence",V=new(H?.nodeClass??(U?L7.YAMLMap:gV.YAMLSeq))(Q.schema);V.flow=!0;let Y=Q.atRoot;if(Y)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let W=z.offset+z.start.source.length;for(let D=0;D<z.items.length;++D){let O=z.items[D],{start:_,key:C,sep:F,value:R}=O,N=I7.resolveProps(_,{flow:J,indicator:"explicit-key-ind",next:C??F?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!F&&!R){if(D===0&&N.comma)X(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(N.comment)if(V.comment)V.comment+=`
66
+ `+N.comment;else V.comment=N.comment;W=N.end;continue}if(!U&&Q.options.strict&&kV.containsNewline(C))X(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(N.comma)X(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!N.comma)X(N.start,"MISSING_CHAR",`Missing , between ${J} items`);if(N.comment){let w="";$:for(let P of _)switch(P.type){case"comma":case"space":break;case"comment":w=P.source.substring(1);break $;default:break $}if(w){let P=V.items[V.items.length-1];if(yV.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
67
+ `+w;else P.comment=w;N.comment=N.comment.substring(w.length+1)}}}if(!U&&!F&&!N.found){let w=R?$(Q,R,N,X):Z(Q,N.end,F,null,N,X);if(V.items.push(w),W=w.range[2],o5(R))X(w.range,"BLOCK_IN_FLOW",s5)}else{Q.atKey=!0;let w=N.end,P=C?$(Q,C,N,X):Z(Q,w,_,null,N,X);if(o5(C))X(P.range,"BLOCK_IN_FLOW",s5);Q.atKey=!1;let E=I7.resolveProps(F??[],{flow:J,indicator:"map-value-ind",next:R,offset:P.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(E.found){if(!U&&!N.found&&Q.options.strict){if(F)for(let g of F){if(g===E.found)break;if(g.type==="newline"){X(g,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(N.start<E.found.offset-1024)X(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(R)if("source"in R&&R.source?.[0]===":")X(R,"MISSING_CHAR",`Missing space after : in ${J}`);else X(E.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let n=R?$(Q,R,E,X):E.found?Z(Q,E.end,F,null,E,X):null;if(n){if(o5(R))X(n.range,"BLOCK_IN_FLOW",s5)}else if(E.comment)if(P.comment)P.comment+=`
68
+ `+E.comment;else P.comment=E.comment;let a=new xV.Pair(P,n);if(Q.options.keepSourceTokens)a.srcToken=O;if(U){let g=V;if(hV.mapIncludes(Q,g.items,P))X(w,"DUPLICATE_KEY","Map keys must be unique");g.items.push(a)}else{let g=new L7.YAMLMap(Q.schema);g.flow=!0,g.items.push(a);let A=(n??P).range;g.range=[P.range[0],A[1],A[2]],V.items.push(g)}W=n?n.range[2]:E.end}}let B=U?"}":"]",[K,...L]=z.end,q=W;if(K?.source===B)q=K.offset+K.source.length;else{let D=J[0].toUpperCase()+J.substring(1),O=Y?`${D} must end with a ${B}`:`${D} in block collection must be sufficiently indented and end with a ${B}`;if(X(W,Y?"MISSING_CHAR":"BAD_INDENT",O),K&&K.source.length!==1)L.unshift(K)}if(L.length>0){let D=vV.resolveEnd(L,q,Q.options.strict,X);if(D.comment)if(V.comment)V.comment+=`
69
+ `+D.comment;else V.comment=D.comment;V.range=[z.offset,q,D.offset]}else V.range=[z.offset,q,q];return V}fV.resolveFlowCollection=uV});var _7=M((oV)=>{var pV=x(),lV=d(),cV=o0(),dV=a0(),iV=K7(),nV=D7(),rV=O7();function a5($,Z,Q,z,X,H){let U=Q.type==="block-map"?iV.resolveBlockMap($,Z,Q,z,H):Q.type==="block-seq"?nV.resolveBlockSeq($,Z,Q,z,H):rV.resolveFlowCollection($,Z,Q,z,H),J=U.constructor;if(X==="!"||X===J.tagName)return U.tag=J.tagName,U;if(X)U.tag=X;return U}function sV($,Z,Q,z,X){let H=z.tag,U=!H?null:Z.directives.tagName(H.source,(B)=>X(H,"TAG_RESOLVE_FAILED",B));if(Q.type==="block-seq"){let{anchor:B,newlineAfterProp:K}=z,L=B&&H?B.offset>H.offset?B:H:B??H;if(L&&(!K||K.offset<L.offset))X(L,"MISSING_CHAR","Missing newline after block sequence props")}let J=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!H||!U||U==="!"||U===cV.YAMLMap.tagName&&J==="map"||U===dV.YAMLSeq.tagName&&J==="seq")return a5($,Z,Q,X,U);let G=Z.schema.tags.find((B)=>B.tag===U&&B.collection===J);if(!G){let B=Z.schema.knownTags[U];if(B?.collection===J)Z.schema.tags.push(Object.assign({},B,{default:!1})),G=B;else{if(B)X(H,"BAD_COLLECTION_TYPE",`${B.tag} used for ${J} collection, but expects ${B.collection??"scalar"}`,!0);else X(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,!0);return a5($,Z,Q,X,U)}}let V=a5($,Z,Q,X,U,G),Y=G.resolve?.(V,(B)=>X(H,"TAG_RESOLVE_FAILED",B),Z.options)??V,W=pV.isNode(Y)?Y:new lV.Scalar(Y);if(W.range=V.range,W.tag=U,G?.format)W.format=G.format;return W}oV.composeCollection=sV});var e5=M((ZY)=>{var t5=d();function tV($,Z,Q){let z=Z.offset,X=eV(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let H=X.mode===">"?t5.Scalar.BLOCK_FOLDED:t5.Scalar.BLOCK_LITERAL,U=Z.source?$Y(Z.source):[],J=U.length;for(let q=U.length-1;q>=0;--q){let D=U[q][1];if(D===""||D==="\r")J=q;else break}if(J===0){let q=X.chomp==="+"&&U.length>0?`
70
+ `.repeat(Math.max(1,U.length-1)):"",D=z+X.length;if(Z.source)D+=Z.source.length;return{value:q,type:H,comment:X.comment,range:[z,D,D]}}let G=Z.indent+X.indent,V=Z.offset+X.length,Y=0;for(let q=0;q<J;++q){let[D,O]=U[q];if(O===""||O==="\r"){if(X.indent===0&&D.length>G)G=D.length}else{if(D.length<G)Q(V+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)G=D.length;if(Y=q,G===0&&!$.atRoot)Q(V,"BAD_INDENT","Block scalar values in collections must be indented");break}V+=D.length+O.length+1}for(let q=U.length-1;q>=J;--q)if(U[q][0].length>G)J=q+1;let W="",B="",K=!1;for(let q=0;q<Y;++q)W+=U[q][0].slice(G)+`
71
+ `;for(let q=Y;q<J;++q){let[D,O]=U[q];V+=D.length+O.length+1;let _=O[O.length-1]==="\r";if(_)O=O.slice(0,-1);if(O&&D.length<G){let F=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(V-O.length-(_?2:1),"BAD_INDENT",F),D=""}if(H===t5.Scalar.BLOCK_LITERAL)W+=B+D.slice(G)+O,B=`
72
+ `;else if(D.length>G||O[0]==="\t"){if(B===" ")B=`
73
73
  `;else if(!K&&B===`
74
74
  `)B=`
75
75
 
76
- `;W+=B+D.slice(G)+M,B=`
77
- `,K=!0}else if(M==="")if(B===`
76
+ `;W+=B+D.slice(G)+O,B=`
77
+ `,K=!0}else if(O==="")if(B===`
78
78
  `)W+=`
79
79
  `;else B=`
80
- `;else W+=B+M,B=" ",K=!1}switch(X.chomp){case"-":break;case"+":for(let q=J;q<H.length;++q)W+=`
81
- `+H[q][0].slice(G);if(W[W.length-1]!==`
80
+ `;else W+=B+O,B=" ",K=!1}switch(X.chomp){case"-":break;case"+":for(let q=J;q<U.length;++q)W+=`
81
+ `+U[q][0].slice(G);if(W[W.length-1]!==`
82
82
  `)W+=`
83
83
  `;break;default:W+=`
84
- `}let L=z+X.length+Z.source.length;return{value:W,type:U,comment:X.comment,range:[z,L,L]}}function aV({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],U=X[0],H=0,J="",G=-1;for(let B=1;B<X.length;++B){let K=X[B];if(!J&&(K==="-"||K==="+"))J=K;else{let L=Number(K);if(!H&&L)H=L;else if(G===-1)G=$+B}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let V=!1,Y="",W=X.length;for(let B=1;B<Z.length;++B){let K=Z[B];switch(K.type){case"space":V=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!V)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,Y=K.source.substring(1);break;case"error":z(K,"UNEXPECTED_TOKEN",K.message),W+=K.source.length;break;default:{let L=`Unexpected token in block scalar header: ${K.type}`;z(K,"UNEXPECTED_TOKEN",L);let q=K.source;if(q&&typeof q==="string")W+=q.length}}}return{mode:U,indent:H,chomp:J,comment:Y,length:W}}function tV($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),U=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let H=1;H<Z.length;H+=2)U.push([Z[H],Z[H+1]]);return U}eV.resolveBlockScalar=oV});var a1=_((VY)=>{var o1=d(),ZY=c2();function QY($,Z,Q){let{offset:z,type:X,source:U,end:H}=$,J,G,V=(B,K,L)=>Q(z+B,K,L);switch(X){case"scalar":J=o1.Scalar.PLAIN,G=zY(U,V);break;case"single-quoted-scalar":J=o1.Scalar.QUOTE_SINGLE,G=XY(U,V);break;case"double-quoted-scalar":J=o1.Scalar.QUOTE_DOUBLE,G=UY(U,V);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+U.length,z+U.length]}}let Y=z+U.length,W=ZY.resolveEnd(H,Y,Z,Q);return{value:G,type:J,comment:W.comment,range:[z,Y,W.offset]}}function zY($,Z){let Q="";switch($[0]){case"\t":Q="a tab character";break;case",":Q="flow indicator character ,";break;case"%":Q="directive indicator character %";break;case"|":case">":{Q=`block scalar indicator ${$[0]}`;break}case"@":case"`":{Q=`reserved character ${$[0]}`;break}}if(Q)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${Q}`);return K7($)}function XY($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return K7($.slice(1,-1)).replace(/''/g,"'")}function K7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
84
+ `}let L=z+X.length+Z.source.length;return{value:W,type:H,comment:X.comment,range:[z,L,L]}}function eV({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],H=X[0],U=0,J="",G=-1;for(let B=1;B<X.length;++B){let K=X[B];if(!J&&(K==="-"||K==="+"))J=K;else{let L=Number(K);if(!U&&L)U=L;else if(G===-1)G=$+B}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let V=!1,Y="",W=X.length;for(let B=1;B<Z.length;++B){let K=Z[B];switch(K.type){case"space":V=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!V)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,Y=K.source.substring(1);break;case"error":z(K,"UNEXPECTED_TOKEN",K.message),W+=K.source.length;break;default:{let L=`Unexpected token in block scalar header: ${K.type}`;z(K,"UNEXPECTED_TOKEN",L);let q=K.source;if(q&&typeof q==="string")W+=q.length}}}return{mode:H,indent:U,chomp:J,comment:Y,length:W}}function $Y($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),H=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let U=1;U<Z.length;U+=2)H.push([Z[U],Z[U+1]]);return H}ZY.resolveBlockScalar=tV});var ZZ=M((WY)=>{var $Z=d(),zY=i2();function XY($,Z,Q){let{offset:z,type:X,source:H,end:U}=$,J,G,V=(B,K,L)=>Q(z+B,K,L);switch(X){case"scalar":J=$Z.Scalar.PLAIN,G=HY(H,V);break;case"single-quoted-scalar":J=$Z.Scalar.QUOTE_SINGLE,G=UY(H,V);break;case"double-quoted-scalar":J=$Z.Scalar.QUOTE_DOUBLE,G=JY(H,V);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+H.length,z+H.length]}}let Y=z+H.length,W=zY.resolveEnd(U,Y,Z,Q);return{value:G,type:J,comment:W.comment,range:[z,Y,W.offset]}}function HY($,Z){let Q="";switch($[0]){case"\t":Q="a tab character";break;case",":Q="flow indicator character ,";break;case"%":Q="directive indicator character %";break;case"|":case">":{Q=`block scalar indicator ${$[0]}`;break}case"@":case"`":{Q=`reserved character ${$[0]}`;break}}if(Q)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${Q}`);return M7($)}function UY($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return M7($.slice(1,-1)).replace(/''/g,"'")}function M7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
85
  `,"sy"),Q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
- `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],U=" ",H=Z.lastIndex;Q.lastIndex=H;while(z=Q.exec($)){if(z[1]==="")if(U===`
87
- `)X+=U;else U=`
88
- `;else X+=U+z[1],U=" ";H=Q.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=H,z=J.exec($),X+U+(z?.[1]??"")}function UY($,Z){let Q="";for(let z=1;z<$.length-1;++z){let X=$[z];if(X==="\r"&&$[z+1]===`
86
+ `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],H=" ",U=Z.lastIndex;Q.lastIndex=U;while(z=Q.exec($)){if(z[1]==="")if(H===`
87
+ `)X+=H;else H=`
88
+ `;else X+=H+z[1],H=" ";U=Q.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=U,z=J.exec($),X+H+(z?.[1]??"")}function JY($,Z){let Q="";for(let z=1;z<$.length-1;++z){let X=$[z];if(X==="\r"&&$[z+1]===`
89
89
  `)continue;if(X===`
90
- `){let{fold:U,offset:H}=HY($,z);Q+=U,z=H}else if(X==="\\"){let U=$[++z],H=JY[U];if(H)Q+=H;else if(U===`
91
- `){U=$[z+1];while(U===" "||U==="\t")U=$[++z+1]}else if(U==="\r"&&$[z+1]===`
92
- `){U=$[++z+1];while(U===" "||U==="\t")U=$[++z+1]}else if(U==="x"||U==="u"||U==="U"){let J=U==="x"?2:U==="u"?4:8;Q+=GY($,z+1,J,Z),z+=J}else{let J=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),Q+=J}}else if(X===" "||X==="\t"){let U=z,H=$[z+1];while(H===" "||H==="\t")H=$[++z+1];if(H!==`
93
- `&&!(H==="\r"&&$[z+2]===`
94
- `))Q+=z>U?$.slice(U,z+1):X}else Q+=X}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return Q}function HY($,Z){let Q="",z=$[Z+1];while(z===" "||z==="\t"||z===`
90
+ `){let{fold:H,offset:U}=GY($,z);Q+=H,z=U}else if(X==="\\"){let H=$[++z],U=VY[H];if(U)Q+=U;else if(H===`
91
+ `){H=$[z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="\r"&&$[z+1]===`
92
+ `){H=$[++z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="x"||H==="u"||H==="U"){let J=H==="x"?2:H==="u"?4:8;Q+=YY($,z+1,J,Z),z+=J}else{let J=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),Q+=J}}else if(X===" "||X==="\t"){let H=z,U=$[z+1];while(U===" "||U==="\t")U=$[++z+1];if(U!==`
93
+ `&&!(U==="\r"&&$[z+2]===`
94
+ `))Q+=z>H?$.slice(H,z+1):X}else Q+=X}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return Q}function GY($,Z){let Q="",z=$[Z+1];while(z===" "||z==="\t"||z===`
95
95
  `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
96
96
  `)break;if(z===`
97
97
  `)Q+=`
98
- `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var JY={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function GY($,Z,Q,z){let X=$.substr(Z,Q),H=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(H)}catch{let J=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}}VY.resolveFlowScalar=QY});var L7=_((LY)=>{var Y2=x(),D7=d(),WY=s1(),BY=a1();function qY($,Z,Q,z){let{value:X,type:U,comment:H,range:J}=Z.type==="block-scalar"?WY.resolveBlockScalar($,Z,z):BY.resolveFlowScalar(Z,$.options.strict,z),G=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,V;if($.options.stringKeys&&$.atKey)V=$.schema[Y2.SCALAR];else if(G)V=KY($.schema,X,G,Q,z);else if(Z.type==="scalar")V=DY($,X,Z,z);else V=$.schema[Y2.SCALAR];let Y;try{let W=V.resolve(X,(B)=>z(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);Y=Y2.isScalar(W)?W:new D7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new D7.Scalar(X)}if(Y.range=J,Y.source=X,U)Y.type=U;if(G)Y.tag=G;if(V.format)Y.format=V.format;if(H)Y.comment=H;return Y}function KY($,Z,Q,z,X){if(Q==="!")return $[Y2.SCALAR];let U=[];for(let J of $.tags)if(!J.collection&&J.tag===Q)if(J.default&&J.test)U.push(J);else return J;for(let J of U)if(J.test?.test(Z))return J;let H=$.knownTags[Q];if(H&&!H.collection)return $.tags.push(Object.assign({},H,{default:!1,test:void 0})),H;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[Y2.SCALAR]}function DY({atKey:$,directives:Z,schema:Q},z,X,U){let H=Q.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(z))||Q[Y2.SCALAR];if(Q.compat){let J=Q.compat.find((G)=>G.default&&G.test?.test(z))??Q[Y2.SCALAR];if(H.tag!==J.tag){let G=Z.tagString(H.tag),V=Z.tagString(J.tag),Y=`Value may be parsed as either ${G} or ${V}`;U(X,"TAG_RESOLVE_FAILED",Y,!0)}}return H}LY.composeScalar=qY});var I7=_((OY)=>{function MY($,Z,Q){if(Z){Q??(Q=Z.length);for(let z=Q-1;z>=0;--z){let X=Z[z];switch(X.type){case"space":case"comment":case"newline":$-=X.source.length;continue}X=Z[++z];while(X?.type==="space")$+=X.source.length,X=Z[++z];break}}return $}OY.emptyScalarPosition=MY});var _7=_((jY)=>{var PY=M$(),FY=x(),NY=q7(),M7=L7(),RY=c2(),TY=I7(),AY={composeNode:O7,composeEmptyNode:t1};function O7($,Z,Q,z){let X=$.atKey,{spaceBefore:U,comment:H,anchor:J,tag:G}=Q,V,Y=!0;switch(Z.type){case"alias":if(V=CY($,Z,z),J||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(V=M7.composeScalar($,Z,G,z),J)V.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(V=NY.composeCollection(AY,$,Z,Q,z),J)V.anchor=J.source.substring(1)}catch(W){let B=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",B)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),Y=!1}}if(V??(V=t1($,Z.offset,void 0,null,Q,z)),J&&V.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!FY.isScalar(V)||typeof V.value!=="string"||V.tag&&V.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)V.spaceBefore=!0;if(H)if(Z.type==="scalar"&&Z.source==="")V.comment=H;else V.commentBefore=H;if($.options.keepSourceTokens&&Y)V.srcToken=Z;return V}function t1($,Z,Q,z,{spaceBefore:X,comment:U,anchor:H,tag:J,end:G},V){let Y={type:"scalar",offset:TY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=M7.composeScalar($,Y,J,V);if(H){if(W.anchor=H.source.substring(1),W.anchor==="")V(H,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(U)W.comment=U,W.range[2]=G;return W}function CY({options:$},{offset:Z,source:Q,end:z},X){let U=new PY.Alias(Q.substring(1));if(U.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let H=Z+Q.length,J=RY.resolveEnd(z,H,$.strict,X);if(U.range=[Z,H,J.offset],J.comment)U.comment=J.comment;return U}jY.composeEmptyNode=t1;jY.composeNode=O7});var F7=_((gY)=>{var EY=b$(),P7=_7(),bY=c2(),yY=x$();function xY($,Z,{offset:Q,start:z,value:X,end:U},H){let J=Object.assign({_directives:Z},$),G=new EY.Document(void 0,J),V={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},Y=yY.resolveProps(z,{indicator:"doc-start",next:X??U?.[0],offset:Q,onError:H,parentIndent:0,startOnNewline:!0});if(Y.found){if(G.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!Y.hasNewline)H(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=X?P7.composeNode(V,X,Y,H):P7.composeEmptyNode(V,Y.end,z,null,Y,H);let W=G.contents.range[2],B=bY.resolveEnd(U,W,!1,H);if(B.comment)G.comment=B.comment;return G.range=[Q,W,B.offset],G}gY.composeDoc=xY});var e1=_((pY)=>{var kY=W$("process"),hY=z1(),uY=b$(),g$=y$(),N7=x(),fY=F7(),mY=c2();function v$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:Q}=$;return[Z,Z+(typeof Q==="string"?Q.length:1)]}function R7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let U=$[X];switch(U[0]){case"#":Z+=(Z===""?"":z?`
98
+ `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var VY={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function YY($,Z,Q,z){let X=$.substr(Z,Q),U=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(U)}catch{let J=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}}WY.resolveFlowScalar=XY});var F7=M((OY)=>{var Y2=x(),P7=d(),qY=e5(),KY=ZZ();function DY($,Z,Q,z){let{value:X,type:H,comment:U,range:J}=Z.type==="block-scalar"?qY.resolveBlockScalar($,Z,z):KY.resolveFlowScalar(Z,$.options.strict,z),G=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,V;if($.options.stringKeys&&$.atKey)V=$.schema[Y2.SCALAR];else if(G)V=LY($.schema,X,G,Q,z);else if(Z.type==="scalar")V=IY($,X,Z,z);else V=$.schema[Y2.SCALAR];let Y;try{let W=V.resolve(X,(B)=>z(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);Y=Y2.isScalar(W)?W:new P7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new P7.Scalar(X)}if(Y.range=J,Y.source=X,H)Y.type=H;if(G)Y.tag=G;if(V.format)Y.format=V.format;if(U)Y.comment=U;return Y}function LY($,Z,Q,z,X){if(Q==="!")return $[Y2.SCALAR];let H=[];for(let J of $.tags)if(!J.collection&&J.tag===Q)if(J.default&&J.test)H.push(J);else return J;for(let J of H)if(J.test?.test(Z))return J;let U=$.knownTags[Q];if(U&&!U.collection)return $.tags.push(Object.assign({},U,{default:!1,test:void 0})),U;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[Y2.SCALAR]}function IY({atKey:$,directives:Z,schema:Q},z,X,H){let U=Q.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(z))||Q[Y2.SCALAR];if(Q.compat){let J=Q.compat.find((G)=>G.default&&G.test?.test(z))??Q[Y2.SCALAR];if(U.tag!==J.tag){let G=Z.tagString(U.tag),V=Z.tagString(J.tag),Y=`Value may be parsed as either ${G} or ${V}`;H(X,"TAG_RESOLVE_FAILED",Y,!0)}}return U}OY.composeScalar=DY});var R7=M((PY)=>{function MY($,Z,Q){if(Z){Q??(Q=Z.length);for(let z=Q-1;z>=0;--z){let X=Z[z];switch(X.type){case"space":case"comment":case"newline":$-=X.source.length;continue}X=Z[++z];while(X?.type==="space")$+=X.source.length,X=Z[++z];break}}return $}PY.emptyScalarPosition=MY});var A7=M((SY)=>{var RY=P$(),NY=x(),TY=_7(),N7=F7(),AY=i2(),CY=R7(),jY={composeNode:T7,composeEmptyNode:QZ};function T7($,Z,Q,z){let X=$.atKey,{spaceBefore:H,comment:U,anchor:J,tag:G}=Q,V,Y=!0;switch(Z.type){case"alias":if(V=wY($,Z,z),J||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(V=N7.composeScalar($,Z,G,z),J)V.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(V=TY.composeCollection(jY,$,Z,Q,z),J)V.anchor=J.source.substring(1)}catch(W){let B=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",B)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),Y=!1}}if(V??(V=QZ($,Z.offset,void 0,null,Q,z)),J&&V.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!NY.isScalar(V)||typeof V.value!=="string"||V.tag&&V.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(H)V.spaceBefore=!0;if(U)if(Z.type==="scalar"&&Z.source==="")V.comment=U;else V.commentBefore=U;if($.options.keepSourceTokens&&Y)V.srcToken=Z;return V}function QZ($,Z,Q,z,{spaceBefore:X,comment:H,anchor:U,tag:J,end:G},V){let Y={type:"scalar",offset:CY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=N7.composeScalar($,Y,J,V);if(U){if(W.anchor=U.source.substring(1),W.anchor==="")V(U,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(H)W.comment=H,W.range[2]=G;return W}function wY({options:$},{offset:Z,source:Q,end:z},X){let H=new RY.Alias(Q.substring(1));if(H.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let U=Z+Q.length,J=AY.resolveEnd(z,U,$.strict,X);if(H.range=[Z,U,J.offset],J.comment)H.comment=J.comment;return H}SY.composeEmptyNode=QZ;SY.composeNode=T7});var j7=M((kY)=>{var yY=g$(),C7=A7(),xY=i2(),gY=k$();function vY($,Z,{offset:Q,start:z,value:X,end:H},U){let J=Object.assign({_directives:Z},$),G=new yY.Document(void 0,J),V={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},Y=gY.resolveProps(z,{indicator:"doc-start",next:X??H?.[0],offset:Q,onError:U,parentIndent:0,startOnNewline:!0});if(Y.found){if(G.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!Y.hasNewline)U(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=X?C7.composeNode(V,X,Y,U):C7.composeEmptyNode(V,Y.end,z,null,Y,U);let W=G.contents.range[2],B=xY.resolveEnd(H,W,!1,U);if(B.comment)G.comment=B.comment;return G.range=[Q,W,B.offset],G}kY.composeDoc=vY});var zZ=M((cY)=>{var uY=K$("process"),fY=J5(),mY=g$(),h$=v$(),w7=x(),pY=j7(),lY=i2();function u$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:Q}=$;return[Z,Z+(typeof Q==="string"?Q.length:1)]}function S7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let H=$[X];switch(H[0]){case"#":Z+=(Z===""?"":z?`
100
100
 
101
101
  `:`
102
- `)+(U.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class T7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let U=v$(Z);if(X)this.warnings.push(new g$.YAMLWarning(U,Q,z));else this.errors.push(new g$.YAMLParseError(U,Q,z))},this.directives=new hY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=R7(this.prelude);if(Q){let X=$.contents;if(Z)$.comment=$.comment?`${$.comment}
103
- ${Q}`:Q;else if(z||$.directives.docStart||!X)$.commentBefore=Q;else if(N7.isCollection(X)&&!X.flow&&X.items.length>0){let U=X.items[0];if(N7.isPair(U))U=U.key;let H=U.commentBefore;U.commentBefore=H?`${Q}
104
- ${H}`:Q}else{let U=X.commentBefore;X.commentBefore=U?`${Q}
105
- ${U}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:R7(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,Q=-1){for(let z of $)yield*this.next(z);yield*this.end(Z,Q)}*next($){if(kY.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=v$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=fY.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Z=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,Q=new g$.YAMLParseError(v$($),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(Q);else this.doc.errors.push(Q);break}case"doc-end":{if(!this.doc){this.errors.push(new g$.YAMLParseError(v$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=mY.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let Q=this.doc.comment;this.doc.comment=Q?`${Q}
106
- ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new g$.YAMLParseError(v$($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let Q=Object.assign({_directives:this.directives},this.options),z=new uY.Document(void 0,Q);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,Z,Z],this.decorate(z,!1),yield z}}}pY.Composer=T7});var j7=_((aY)=>{var cY=s1(),dY=a1(),iY=y$(),A7=F$();function nY($,Z=!0,Q){if($){let z=(X,U,H)=>{let J=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(J,U,H);else throw new iY.YAMLParseError([J,J+1],U,H)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return dY.resolveFlowScalar($,Z,z);case"block-scalar":return cY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function rY($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:U=-1,type:H="PLAIN"}=Z,J=A7.stringifyString({type:H,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
102
+ `)+(H.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class E7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let H=u$(Z);if(X)this.warnings.push(new h$.YAMLWarning(H,Q,z));else this.errors.push(new h$.YAMLParseError(H,Q,z))},this.directives=new fY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=S7(this.prelude);if(Q){let X=$.contents;if(Z)$.comment=$.comment?`${$.comment}
103
+ ${Q}`:Q;else if(z||$.directives.docStart||!X)$.commentBefore=Q;else if(w7.isCollection(X)&&!X.flow&&X.items.length>0){let H=X.items[0];if(w7.isPair(H))H=H.key;let U=H.commentBefore;H.commentBefore=U?`${Q}
104
+ ${U}`:Q}else{let H=X.commentBefore;X.commentBefore=H?`${Q}
105
+ ${H}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:S7(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,Q=-1){for(let z of $)yield*this.next(z);yield*this.end(Z,Q)}*next($){if(uY.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=u$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=pY.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Z=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,Q=new h$.YAMLParseError(u$($),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(Q);else this.doc.errors.push(Q);break}case"doc-end":{if(!this.doc){this.errors.push(new h$.YAMLParseError(u$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=lY.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let Q=this.doc.comment;this.doc.comment=Q?`${Q}
106
+ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new h$.YAMLParseError(u$($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let Q=Object.assign({_directives:this.directives},this.options),z=new mY.Document(void 0,Q);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,Z,Z],this.decorate(z,!1),yield z}}}cY.Composer=E7});var x7=M((eY)=>{var iY=e5(),nY=ZZ(),rY=v$(),b7=T$();function sY($,Z=!0,Q){if($){let z=(X,H,U)=>{let J=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(J,H,U);else throw new rY.YAMLParseError([J,J+1],H,U)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nY.resolveFlowScalar($,Z,z);case"block-scalar":return iY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function oY($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:H=-1,type:U="PLAIN"}=Z,J=b7.stringifyString({type:U,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
107
107
  `}];switch(J[0]){case"|":case">":{let V=J.indexOf(`
108
108
  `),Y=J.substring(0,V),W=J.substring(V+1)+`
109
- `,B=[{type:"block-scalar-header",offset:U,indent:z,source:Y}];if(!C7(B,G))B.push({type:"newline",offset:-1,indent:z,source:`
110
- `});return{type:"block-scalar",offset:U,indent:z,props:B,source:W}}case'"':return{type:"double-quoted-scalar",offset:U,indent:z,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:U,indent:z,source:J,end:G};default:return{type:"scalar",offset:U,indent:z,source:J,end:G}}}function sY($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:U=!1,type:H}=Q,J="indent"in $?$.indent:null;if(z&&typeof J==="number")J+=2;if(!H)switch($.type){case"single-quoted-scalar":H="QUOTE_SINGLE";break;case"double-quoted-scalar":H="QUOTE_DOUBLE";break;case"block-scalar":{let V=$.props[0];if(V.type!=="block-scalar-header")throw Error("Invalid block scalar header");H=V.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:H="PLAIN"}let G=A7.stringifyString({type:H,value:Z},{implicitKey:X||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":oY($,G);break;case'"':$4($,G,"double-quoted-scalar");break;case"'":$4($,G,"single-quoted-scalar");break;default:$4($,G,"scalar")}}function oY($,Z){let Q=Z.indexOf(`
109
+ `,B=[{type:"block-scalar-header",offset:H,indent:z,source:Y}];if(!y7(B,G))B.push({type:"newline",offset:-1,indent:z,source:`
110
+ `});return{type:"block-scalar",offset:H,indent:z,props:B,source:W}}case'"':return{type:"double-quoted-scalar",offset:H,indent:z,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:H,indent:z,source:J,end:G};default:return{type:"scalar",offset:H,indent:z,source:J,end:G}}}function aY($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:H=!1,type:U}=Q,J="indent"in $?$.indent:null;if(z&&typeof J==="number")J+=2;if(!U)switch($.type){case"single-quoted-scalar":U="QUOTE_SINGLE";break;case"double-quoted-scalar":U="QUOTE_DOUBLE";break;case"block-scalar":{let V=$.props[0];if(V.type!=="block-scalar-header")throw Error("Invalid block scalar header");U=V.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:U="PLAIN"}let G=b7.stringifyString({type:U,value:Z},{implicitKey:X||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":tY($,G);break;case'"':XZ($,G,"double-quoted-scalar");break;case"'":XZ($,G,"single-quoted-scalar");break;default:XZ($,G,"scalar")}}function tY($,Z){let Q=Z.indexOf(`
111
111
  `),z=Z.substring(0,Q),X=Z.substring(Q+1)+`
112
- `;if($.type==="block-scalar"){let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=z,$.source=X}else{let{offset:U}=$,H="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:U,indent:H,source:z}];if(!C7(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:H,source:`
113
- `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:H,props:J,source:X})}}function C7($,Z){if(Z)for(let Q of Z)switch(Q.type){case"space":case"comment":$.push(Q);break;case"newline":return $.push(Q),!0}return!1}function $4($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),X=Z.length;if($.props[0].type==="block-scalar-header")X-=$.props[0].source.length;for(let U of z)U.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
- `};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}aY.createScalarToken=rY;aY.resolveAsScalar=nY;aY.setScalarValue=sY});var w7=_((QW)=>{var ZW=($)=>("type"in $)?Z8($):$8($);function Z8($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=Z8(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=$8(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=$8(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=$8($);if($.end)for(let Q of $.end)Z+=Q.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let Q of $.end)Z+=Q.source;return Z}}}function $8({start:$,key:Z,sep:Q,value:z}){let X="";for(let U of $)X+=U.source;if(Z)X+=Z8(Z);if(Q)for(let U of Q)X+=U.source;if(z)X+=Z8(z);return X}QW.stringify=ZW});var b7=_((UW)=>{var Z4=Symbol("break visit"),XW=Symbol("skip children"),S7=Symbol("remove item");function W2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};E7(Object.freeze([]),$,Z)}W2.BREAK=Z4;W2.SKIP=XW;W2.REMOVE=S7;W2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let U=Q?.[z];if(U&&"items"in U)Q=U.items[X];else return}return Q};W2.parentCollection=($,Z)=>{let Q=W2.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],X=Q?.[z];if(X&&"items"in X)return X;throw Error("Parent collection not found")};function E7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let U=Z[X];if(U&&"items"in U){for(let H=0;H<U.items.length;++H){let J=E7(Object.freeze($.concat([[X,H]])),U.items[H],Q);if(typeof J==="number")H=J-1;else if(J===Z4)return Z4;else if(J===S7)U.items.splice(H,1),H-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}UW.visit=W2});var Q8=_((qW)=>{var Q4=j7(),JW=w7(),GW=b7(),z4="\uFEFF",X4="\x02",U4="\x18",H4="\x1F",VW=($)=>!!$&&("items"in $),YW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function WW($){switch($){case z4:return"<BOM>";case X4:return"<DOC>";case U4:return"<FLOW_END>";case H4:return"<SCALAR>";default:return JSON.stringify($)}}function BW($){switch($){case z4:return"byte-order-mark";case X4:return"doc-mode";case U4:return"flow-error-end";case H4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
112
+ `;if($.type==="block-scalar"){let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=z,$.source=X}else{let{offset:H}=$,U="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:H,indent:U,source:z}];if(!y7(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:U,source:`
113
+ `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:U,props:J,source:X})}}function y7($,Z){if(Z)for(let Q of Z)switch(Q.type){case"space":case"comment":$.push(Q);break;case"newline":return $.push(Q),!0}return!1}function XZ($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),X=Z.length;if($.props[0].type==="block-scalar-header")X-=$.props[0].source.length;for(let H of z)H.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
+ `};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((H)=>H.type==="space"||H.type==="comment"||H.type==="newline"):[];for(let H of Object.keys($))if(H!=="type"&&H!=="offset")delete $[H];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}eY.createScalarToken=oY;eY.resolveAsScalar=sY;eY.setScalarValue=aY});var g7=M((XW)=>{var zW=($)=>("type"in $)?Z8($):$8($);function Z8($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=Z8(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=$8(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=$8(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=$8($);if($.end)for(let Q of $.end)Z+=Q.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let Q of $.end)Z+=Q.source;return Z}}}function $8({start:$,key:Z,sep:Q,value:z}){let X="";for(let H of $)X+=H.source;if(Z)X+=Z8(Z);if(Q)for(let H of Q)X+=H.source;if(z)X+=Z8(z);return X}XW.stringify=zW});var h7=M((JW)=>{var HZ=Symbol("break visit"),UW=Symbol("skip children"),v7=Symbol("remove item");function W2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};k7(Object.freeze([]),$,Z)}W2.BREAK=HZ;W2.SKIP=UW;W2.REMOVE=v7;W2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let H=Q?.[z];if(H&&"items"in H)Q=H.items[X];else return}return Q};W2.parentCollection=($,Z)=>{let Q=W2.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],X=Q?.[z];if(X&&"items"in X)return X;throw Error("Parent collection not found")};function k7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let H=Z[X];if(H&&"items"in H){for(let U=0;U<H.items.length;++U){let J=k7(Object.freeze($.concat([[X,U]])),H.items[U],Q);if(typeof J==="number")U=J-1;else if(J===HZ)return HZ;else if(J===v7)H.items.splice(U,1),U-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}JW.visit=W2});var Q8=M((DW)=>{var UZ=x7(),VW=g7(),YW=h7(),JZ="\uFEFF",GZ="\x02",VZ="\x18",YZ="\x1F",WW=($)=>!!$&&("items"in $),BW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function qW($){switch($){case JZ:return"<BOM>";case GZ:return"<DOC>";case VZ:return"<FLOW_END>";case YZ:return"<SCALAR>";default:return JSON.stringify($)}}function KW($){switch($){case JZ:return"byte-order-mark";case GZ:return"doc-mode";case VZ:return"flow-error-end";case YZ:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
115
  `:case`\r
116
- `: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($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}qW.createScalarToken=Q4.createScalarToken;qW.resolveAsScalar=Q4.resolveAsScalar;qW.setScalarValue=Q4.setScalarValue;qW.stringify=JW.stringify;qW.visit=GW.visit;qW.BOM=z4;qW.DOCUMENT=X4;qW.FLOW_END=U4;qW.SCALAR=H4;qW.isCollection=VW;qW.isScalar=YW;qW.prettyToken=WW;qW.tokenType=BW});var G4=_((wW)=>{var k$=Q8();function D0($){switch($){case void 0:case" ":case`
117
- `:case"\r":case"\t":return!0;default:return!1}}var y7=new Set("0123456789ABCDEFabcdef"),CW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),z8=new Set(",[]{}"),jW=new Set(` ,[]{}
118
- \r `),J4=($)=>!$||jW.has($);class x7{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($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let Q=this.next??"stream";while(Q&&(Z||this.hasChars(1)))Q=yield*this.parseNext(Q)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
116
+ `: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($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}DW.createScalarToken=UZ.createScalarToken;DW.resolveAsScalar=UZ.resolveAsScalar;DW.setScalarValue=UZ.setScalarValue;DW.stringify=VW.stringify;DW.visit=YW.visit;DW.BOM=JZ;DW.DOCUMENT=GZ;DW.FLOW_END=VZ;DW.SCALAR=YZ;DW.isCollection=WW;DW.isScalar=BW;DW.prettyToken=qW;DW.tokenType=KW});var BZ=M((EW)=>{var f$=Q8();function D0($){switch($){case void 0:case" ":case`
117
+ `:case"\r":case"\t":return!0;default:return!1}}var u7=new Set("0123456789ABCDEFabcdef"),wW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),z8=new Set(",[]{}"),SW=new Set(` ,[]{}
118
+ \r `),WZ=($)=>!$||SW.has($);class f7{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($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let Q=this.next??"stream";while(Q&&(Z||this.hasChars(1)))Q=yield*this.parseNext(Q)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
119
119
  `)return!0;if(Z==="\r")return this.buffer[$+1]===`
120
120
  `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let Q=0;while(Z===" ")Z=this.buffer[++Q+$];if(Z==="\r"){let z=this.buffer[Q+$+1];if(z===`
121
121
  `||!z&&!this.atEnd)return $+Q+1}return Z===`
122
122
  `||Q>=this.indentNext||!Z&&!this.atEnd?$+Q:-1}if(Z==="-"||Z==="."){let Q=this.buffer.substr($,3);if((Q==="---"||Q==="...")&&D0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
123
- `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){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 $=this.getLine();if($===null)return this.setNext("stream");if($[0]===k$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,Q=$.indexOf("#");while(Q!==-1){let X=$[Q-1];if(X===" "||X==="\t"){Z=Q-1;break}else Q=$.indexOf("#",Q+1)}while(!0){let X=$[Z-1];if(X===" "||X==="\t")Z-=1;else break}let z=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield k$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&D0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!D0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&D0(Z)){let Q=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Q,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);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(J4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,Q=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=Q=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(Q!==-1&&Q<this.indentNext&&z[0]!=="#"||Q===0&&(z.startsWith("---")||z.startsWith("..."))&&D0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield k$.FLOW_END,yield*this.parseLineStart()}let X=0;while(z[X]===",")X+=yield*this.pushCount(1),X+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(X+=yield*this.pushIndicators(),z[X]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-X),"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(J4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||D0(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
123
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){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 $=this.getLine();if($===null)return this.setNext("stream");if($[0]===f$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,Q=$.indexOf("#");while(Q!==-1){let X=$[Q-1];if(X===" "||X==="\t"){Z=Q-1;break}else Q=$.indexOf("#",Q+1)}while(!0){let X=$[Z-1];if(X===" "||X==="\t")Z-=1;else break}let z=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield f$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&D0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!D0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&D0(Z)){let Q=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Q,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);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(WZ),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,Q=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=Q=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(Q!==-1&&Q<this.indentNext&&z[0]!=="#"||Q===0&&(z.startsWith("---")||z.startsWith("..."))&&D0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield f$.FLOW_END,yield*this.parseLineStart()}let X=0;while(z[X]===",")X+=yield*this.pushCount(1),X+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(X+=yield*this.pushIndicators(),z[X]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-X),"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(WZ),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||D0(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
124
124
  `,this.pos);if(z!==-1){while(z!==-1){let X=this.continueScalar(z+1);if(X===-1)break;z=Q.indexOf(`
125
125
  `,X)}if(z!==-1)Z=z-(Q[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>D0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,Q;$:for(let X=this.pos;Q=this.buffer[X];++X)switch(Q){case" ":Z+=1;break;case`
126
- `:$=X,Z=0;break;case"\r":{let U=this.buffer[X+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
126
+ `:$=X,Z=0;break;case"\r":{let H=this.buffer[X+1];if(!H&&!this.atEnd)return this.setNext("block-scalar");if(H===`
127
127
  `)break}default:break $}if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let X=this.continueScalar($+1);if(X===-1)break;$=this.buffer.indexOf(`
128
128
  `,X)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;Q=this.buffer[z];while(Q===" ")Q=this.buffer[++z];if(Q==="\t"){while(Q==="\t"||Q===" "||Q==="\r"||Q===`
129
- `)Q=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let X=$-1,U=this.buffer[X];if(U==="\r")U=this.buffer[--X];let H=X;while(U===" ")U=this.buffer[--X];if(U===`
130
- `&&X>=this.pos&&X+1+Z>H)$=X;else break}while(!0);return yield k$.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,Q=this.pos-1,z;while(z=this.buffer[++Q])if(z===":"){let X=this.buffer[Q+1];if(D0(X)||$&&z8.has(X))break;Z=Q}else if(D0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
129
+ `)Q=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let X=$-1,H=this.buffer[X];if(H==="\r")H=this.buffer[--X];let U=X;while(H===" ")H=this.buffer[--X];if(H===`
130
+ `&&X>=this.pos&&X+1+Z>U)$=X;else break}while(!0);return yield f$.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,Q=this.pos-1,z;while(z=this.buffer[++Q])if(z===":"){let X=this.buffer[Q+1];if(D0(X)||$&&z8.has(X))break;Z=Q}else if(D0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
131
131
  `)Q+=1,z=`
132
132
  `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&z8.has(X))break;if(z===`
133
- `){let U=this.continueScalar(Q+1);if(U===-1)break;Q=Math.max(Q,U-2)}}else{if($&&z8.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield k$.SCALAR,yield*this.pushToIndex(Z+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,Z){let Q=this.buffer.slice(this.pos,$);if(Q)return yield Q,this.pos+=Q.length,Q.length;else if(Z)yield"";return 0}*pushIndicators(){let $=0;$:while(!0){switch(this.charAt(0)){case"!":$+=yield*this.pushTag(),$+=yield*this.pushSpaces(!0);continue $;case"&":$+=yield*this.pushUntil(J4),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(D0(Q)||Z&&z8.has(Q)){if(!Z)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0);continue $}}}break $}return $}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!D0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(CW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&y7.has(this.buffer[$+1])&&y7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
133
+ `){let H=this.continueScalar(Q+1);if(H===-1)break;Q=Math.max(Q,H-2)}}else{if($&&z8.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield f$.SCALAR,yield*this.pushToIndex(Z+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,Z){let Q=this.buffer.slice(this.pos,$);if(Q)return yield Q,this.pos+=Q.length,Q.length;else if(Z)yield"";return 0}*pushIndicators(){let $=0;$:while(!0){switch(this.charAt(0)){case"!":$+=yield*this.pushTag(),$+=yield*this.pushSpaces(!0);continue $;case"&":$+=yield*this.pushUntil(WZ),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(D0(Q)||Z&&z8.has(Q)){if(!Z)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0);continue $}}}break $}return $}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!D0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(wW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&u7.has(this.buffer[$+1])&&u7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
134
134
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
135
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,Q;do Q=this.buffer[++Z];while(Q===" "||$&&Q==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,Q=this.buffer[Z];while(!$(Q))Q=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}wW.Lexer=x7});var V4=_((EW)=>{class g7{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,Q=this.lineStarts.length;while(Z<Q){let X=Z+Q>>1;if(this.lineStarts[X]<$)Z=X+1;else Q=X}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let z=this.lineStarts[Z-1];return{line:Z,col:$-z+1}}}}EW.LineCounter=g7});var Y4=_((gW)=>{var yW=W$("process"),v7=Q8(),xW=G4();function a0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function k7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function u7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function X8($){switch($.type){case"document":return $.start;case"block-map":{let Z=$.items[$.items.length-1];return Z.sep??Z.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function d2($){if($.length===0)return[];let Z=$.length;$:while(--Z>=0)switch($[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++Z]?.type==="space");return $.splice(Z,$.length)}function U8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function h7($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!a0(Z.start,"explicit-key-ind")&&!a0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,u7(Z.value))if(Z.value.end)U8(Z.value.end,Z.sep);else Z.value.end=Z.sep;else U8(Z.start,Z.sep);delete Z.sep}}}class f7{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new xW.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Q of this.lexer.lex($,Z))yield*this.next(Q);if(!Z)yield*this.end()}*next($){if(this.source=$,yW.env.LOG_TOKENS)console.log("|",v7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=v7.tokenType($);if(!Z){let Q=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:Q,source:$}),this.offset+=$.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Z=$??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let Q=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in Q?Q.indent:0;else if(Z.type==="flow-collection"&&Q.type==="document")Z.indent=0;if(Z.type==="flow-collection")h7(Z);switch(Q.type){case"document":Q.value=Z;break;case"block-scalar":Q.props.push(Z);break;case"block-map":{let z=Q.items[Q.items.length-1];if(z.value){Q.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=Z;else{Object.assign(z,{key:Z,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=Q.items[Q.items.length-1];if(z.value)Q.items.push({start:[],value:Z});else z.value=Z;break}case"flow-collection":{let z=Q.items[Q.items.length-1];if(!z||z.value)Q.items.push({start:[],key:Z,sep:[]});else if(z.sep)z.value=Z;else Object.assign(z,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((Q.type==="document"||Q.type==="block-map"||Q.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let z=Z.items[Z.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&k7(z.start)===-1&&(Z.indent===0||z.start.every((X)=>X.type!=="comment"||X.indent<Z.indent))){if(Q.type==="document")Q.end=z.start;else Q.items.push({start:z.start});Z.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 $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(k7($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=X8(this.peek(2)),Q=d2(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let X={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Q,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
135
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,Q;do Q=this.buffer[++Z];while(Q===" "||$&&Q==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,Q=this.buffer[Z];while(!$(Q))Q=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}EW.Lexer=f7});var qZ=M((yW)=>{class m7{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,Q=this.lineStarts.length;while(Z<Q){let X=Z+Q>>1;if(this.lineStarts[X]<$)Z=X+1;else Q=X}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let z=this.lineStarts[Z-1];return{line:Z,col:$-z+1}}}}yW.LineCounter=m7});var KZ=M((kW)=>{var gW=K$("process"),p7=Q8(),vW=BZ();function t0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function l7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function d7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function X8($){switch($.type){case"document":return $.start;case"block-map":{let Z=$.items[$.items.length-1];return Z.sep??Z.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function n2($){if($.length===0)return[];let Z=$.length;$:while(--Z>=0)switch($[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++Z]?.type==="space");return $.splice(Z,$.length)}function H8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function c7($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!t0(Z.start,"explicit-key-ind")&&!t0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,d7(Z.value))if(Z.value.end)H8(Z.value.end,Z.sep);else Z.value.end=Z.sep;else H8(Z.start,Z.sep);delete Z.sep}}}class i7{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vW.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Q of this.lexer.lex($,Z))yield*this.next(Q);if(!Z)yield*this.end()}*next($){if(this.source=$,gW.env.LOG_TOKENS)console.log("|",p7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=p7.tokenType($);if(!Z){let Q=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:Q,source:$}),this.offset+=$.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Z=$??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let Q=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in Q?Q.indent:0;else if(Z.type==="flow-collection"&&Q.type==="document")Z.indent=0;if(Z.type==="flow-collection")c7(Z);switch(Q.type){case"document":Q.value=Z;break;case"block-scalar":Q.props.push(Z);break;case"block-map":{let z=Q.items[Q.items.length-1];if(z.value){Q.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=Z;else{Object.assign(z,{key:Z,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=Q.items[Q.items.length-1];if(z.value)Q.items.push({start:[],value:Z});else z.value=Z;break}case"flow-collection":{let z=Q.items[Q.items.length-1];if(!z||z.value)Q.items.push({start:[],key:Z,sep:[]});else if(z.sep)z.value=Z;else Object.assign(z,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((Q.type==="document"||Q.type==="block-map"||Q.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let z=Z.items[Z.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&l7(z.start)===-1&&(Z.indent===0||z.start.every((X)=>X.type!=="comment"||X.indent<Z.indent))){if(Q.type==="document")Q.end=z.start;else Q.items.push({start:z.start});Z.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 $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(l7($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=X8(this.peek(2)),Q=n2(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let X={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Q,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
136
136
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
137
- `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){U8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let U=[];for(let H=0;H<Z.sep.length;++H){let J=Z.sep[H];switch(J.type){case"newline":U.push(H);break;case"space":break;case"comment":if(J.indent>$.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)X=Z.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(a0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let U=d2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(a0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]});else if(u7(Z.key)&&!a0(Z.sep,"newline")){let U=d2(Z.start),H=Z.key,J=Z.sep;J.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:H,sep:J}]})}else if(X.length>0)Z.sep=Z.sep.concat(X,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:X,key:null,sep:[this.sourceToken]});else if(a0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:U,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(U);else Object.assign(Z,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue($);if(U){if(U.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!a0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){U8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||a0(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let Q=this.startBlockValue($);if(Q){this.stack.push(Q);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let Q;do yield*this.pop(),Q=this.peek(1);while(Q?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:z,sep:[]});else if(Z.sep)this.stack.push(z);else Object.assign(Z,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let Q=this.startBlockValue($);if(Q)this.stack.push(Q);else yield*this.pop(),yield*this.step()}else{let Q=this.peek(2);if(Q.type==="block-map"&&(this.type==="map-value-ind"&&Q.indent===$.indent||this.type==="newline"&&!Q.items[Q.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Q.type!=="flow-collection"){let z=X8(Q),X=d2(z);h7($);let U=$.end.splice(1,$.end.length);U.push(this.sourceToken);let H={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
137
+ `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){H8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let H=[];for(let U=0;U<Z.sep.length;++U){let J=Z.sep[U];switch(J.type){case"newline":H.push(U);break;case"space":break;case"comment":if(J.indent>$.indent)H.length=0;break;default:H.length=0}}if(H.length>=2)X=Z.sep.splice(H[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(t0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let H=n2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]});else if(d7(Z.key)&&!t0(Z.sep,"newline")){let H=n2(Z.start),U=Z.key,J=Z.sep;J.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:U,sep:J}]})}else if(X.length>0)Z.sep=Z.sep.concat(X,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:X,key:null,sep:[this.sourceToken]});else if(t0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:H,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(H);else Object.assign(Z,{key:H,sep:[]}),this.onKeyLine=!0;return}default:{let H=this.startBlockValue($);if(H){if(H.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!t0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(H);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){H8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||t0(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let Q=this.startBlockValue($);if(Q){this.stack.push(Q);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let Q;do yield*this.pop(),Q=this.peek(1);while(Q?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:z,sep:[]});else if(Z.sep)this.stack.push(z);else Object.assign(Z,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let Q=this.startBlockValue($);if(Q)this.stack.push(Q);else yield*this.pop(),yield*this.step()}else{let Q=this.peek(2);if(Q.type==="block-map"&&(this.type==="map-value-ind"&&Q.indent===$.indent||this.type==="newline"&&!Q.items[Q.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Q.type!=="flow-collection"){let z=X8(Q),X=n2(z);c7($);let H=$.end.splice(1,$.end.length);H.push(this.sourceToken);let U={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
138
138
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
139
- `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 Z=X8($),Q=d2(Z);return Q.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=X8($),Q=d2(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((Q)=>Q.type==="newline"||Q.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}gW.Parser=f7});var d7=_((cW)=>{var m7=e1(),kW=b$(),h$=y$(),hW=V1(),uW=x(),fW=V4(),p7=Y4();function l7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new fW.LineCounter||null,prettyErrors:Z}}function mW($,Z={}){let{lineCounter:Q,prettyErrors:z}=l7(Z),X=new p7.Parser(Q?.addNewLine),U=new m7.Composer(Z),H=Array.from(U.compose(X.parse($)));if(z&&Q)for(let J of H)J.errors.forEach(h$.prettifyError($,Q)),J.warnings.forEach(h$.prettifyError($,Q));if(H.length>0)return H;return Object.assign([],{empty:!0},U.streamInfo())}function c7($,Z={}){let{lineCounter:Q,prettyErrors:z}=l7(Z),X=new p7.Parser(Q?.addNewLine),U=new m7.Composer(Z),H=null;for(let J of U.compose(X.parse($),!0,$.length))if(!H)H=J;else if(H.options.logLevel!=="silent"){H.errors.push(new h$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)H.errors.forEach(h$.prettifyError($,Q)),H.warnings.forEach(h$.prettifyError($,Q));return H}function pW($,Z,Q){let z=void 0;if(typeof Z==="function")z=Z;else if(Q===void 0&&Z&&typeof Z==="object")Q=Z;let X=c7($,Q);if(!X)return null;if(X.warnings.forEach((U)=>hW.warn(X.options.logLevel,U)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function lW($,Z,Q){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z;if(typeof Q==="string")Q=Q.length;if(typeof Q==="number"){let X=Math.round(Q);Q=X<1?void 0:X>8?{indent:8}:{indent:X}}if($===void 0){let{keepUndefined:X}=Q??Z??{};if(!X)return}if(uW.isDocument($)&&!z)return $.toString(Q);return new kW.Document($,z,Q).toString(Q)}cW.parse=pW;cW.parseAllDocuments=mW;cW.parseDocument=c7;cW.stringify=lW});var m=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],x0=new Map(m.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),E5=new Map(m.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),P_=new Map(m.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function b5($,Z){let Q=(X)=>{let U=X.split("."),H=$;for(let J of U)if(H&&typeof H==="object"&&J in H)H=H[J];else return;return H},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function Nz($){return m.filter((Z)=>Z.category===$)}var Rz=m.filter(($)=>$.index<=21),Tz=m,D6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),y5=new Set(["none","n/a","not applicable"]),L6="slotignored";function Az($){return typeof $==="string"&&y5.has($.trim().toLowerCase())}function n8($){return typeof $==="string"&&$.trim()!==""&&o($)}function o($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return D6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var E2="no classifying signals — fallback",Cz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function b2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(S2,$))return null;if(!S2[$].includes(Z.category))return!1;return!($==="framework"&&Cz.has(Z.path))}var S2={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],app:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};var r8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,B$=r8("1"),y2=r8("2"),N_=r8("3"),q$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},K$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,s8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,x2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var g0=[{name:"TROPHY",indicator:`${x2("✪")} ${x2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${x2(B$("★"))} ${x2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${K$("◆")} ${K$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${s8("◇")} ${s8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${B$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${y2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${y2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${y2("♡")}`,threshold:0}];function D$($){for(let Z of g0)if($>=Z.threshold)return Z;return g0[g0.length-1]}function jz($){let Z=D$($),Q=g0.indexOf(Z);return Q>0?g0[Q-1]:null}var e8={};Pz(e8,{validate:()=>Sz,sdkVersion:()=>gz,scoreFafb:()=>xz,scoreEnterprise:()=>wz,score:()=>t8,fafbInfo:()=>yz,decompile:()=>bz,compile:()=>Ez});var o8=null;function l0(){if(o8)return o8;try{let $=W$("faf-scoring-kernel");return o8=$,$}catch{throw Error(`faf-scoring-kernel not installed.
139
+ `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 Z=X8($),Q=n2(Z);return Q.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=X8($),Q=n2(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((Q)=>Q.type==="newline"||Q.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}kW.Parser=i7});var a7=M((iW)=>{var n7=zZ(),uW=g$(),m$=v$(),fW=q5(),mW=x(),pW=qZ(),r7=KZ();function s7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new pW.LineCounter||null,prettyErrors:Z}}function lW($,Z={}){let{lineCounter:Q,prettyErrors:z}=s7(Z),X=new r7.Parser(Q?.addNewLine),H=new n7.Composer(Z),U=Array.from(H.compose(X.parse($)));if(z&&Q)for(let J of U)J.errors.forEach(m$.prettifyError($,Q)),J.warnings.forEach(m$.prettifyError($,Q));if(U.length>0)return U;return Object.assign([],{empty:!0},H.streamInfo())}function o7($,Z={}){let{lineCounter:Q,prettyErrors:z}=s7(Z),X=new r7.Parser(Q?.addNewLine),H=new n7.Composer(Z),U=null;for(let J of H.compose(X.parse($),!0,$.length))if(!U)U=J;else if(U.options.logLevel!=="silent"){U.errors.push(new m$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)U.errors.forEach(m$.prettifyError($,Q)),U.warnings.forEach(m$.prettifyError($,Q));return U}function cW($,Z,Q){let z=void 0;if(typeof Z==="function")z=Z;else if(Q===void 0&&Z&&typeof Z==="object")Q=Z;let X=o7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>fW.warn(X.options.logLevel,H)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function dW($,Z,Q){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z;if(typeof Q==="string")Q=Q.length;if(typeof Q==="number"){let X=Math.round(Q);Q=X<1?void 0:X>8?{indent:8}:{indent:X}}if($===void 0){let{keepUndefined:X}=Q??Z??{};if(!X)return}if(mW.isDocument($)&&!z)return $.toString(Q);return new uW.Document($,z,Q).toString(Q)}iW.parse=cW;iW.parseAllDocuments=lW;iW.parseDocument=o7;iW.stringify=dW});var m=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],g0=new Map(m.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),k1=new Map(m.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),TM=new Map(m.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function h1($,Z){let Q=(X)=>{let H=X.split("."),U=$;for(let J of H)if(U&&typeof U==="object"&&J in U)U=U[J];else return;return U},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function Tz($){return m.filter((Z)=>Z.category===$)}var Az=m.filter(($)=>$.index<=21),Cz=m,D6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),u1=new Set(["none","n/a","not applicable"]),L6="slotignored";function jz($){return typeof $==="string"&&u1.has($.trim().toLowerCase())}function a8($){return typeof $==="string"&&$.trim()!==""&&o($)}function o($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return D6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var y2="no classifying signals — fallback",wz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function x2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(b2,$))return null;if(!b2[$].includes(Z.category))return!1;return!($==="framework"&&wz.has(Z.path))}var b2={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],app:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};var t8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,D$=t8("1"),g2=t8("2"),CM=t8("3"),L$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},I$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,e8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,v2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var v0=[{name:"TROPHY",indicator:`${v2("✪")} ${v2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${v2(D$("★"))} ${v2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I$("◆")} ${I$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${e8("◇")} ${e8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${D$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${g2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${g2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${g2("♡")}`,threshold:0}];function O$($){for(let Z of v0)if($>=Z.threshold)return Z;return v0[v0.length-1]}function Sz($){let Z=O$($),Q=v0.indexOf(Z);return Q>0?v0[Q-1]:null}var z5={};Rz(z5,{validate:()=>bz,sdkVersion:()=>kz,scoreFafb:()=>vz,scoreEnterprise:()=>Ez,score:()=>Q5,fafbInfo:()=>gz,decompile:()=>xz,compile:()=>yz});var $5=null;function c0(){if($5)return $5;try{let $=K$("faf-scoring-kernel");return $5=$,$}catch{throw Error(`faf-scoring-kernel not installed.
140
140
 
141
141
  Run: npm install faf-scoring-kernel
142
- `)}}var I6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function a8($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[E5.get(Q)??Q]=z;return{...$,slots:Z}}function t8($){return a8(JSON.parse(l0().score_faf(I6($))))}function wz($){return a8(JSON.parse(l0().score_faf_enterprise(I6($))))}function Sz($){return l0().validate_faf(I6($))}function Ez($){return l0().compile_fafb(I6($))}function bz($){return JSON.parse(l0().decompile_fafb($))}function yz($){return JSON.parse(l0().fafb_info($))}function xz($){return a8(JSON.parse(l0().score_fafb($)))}function gz(){return l0().sdk_version()}var x5=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function g5($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function v5($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],U=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),H=-1;if(U){let J=parseInt(U[1],10);if(J>=0&&J<=100)H=J}return{represents:X,sourceScore:H}}function vz($){return $.unknown?"unknown (—)":`${$.score}%`}function k5($){return{score:$.score,tier:D$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function $1($){let Z=v5($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?D$(Q):g0[g0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return k5(t8($))}function kz($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let Q=$;if(!Q.faf_version)Z.push("Missing required field: faf_version");if(!Q.project?.name)Z.push("Missing required field: project.name");if(Q.app_type==="about")Z.push("about is not an app_type — declare about.represents (owner/repo) instead");if(Q.about!==void 0){if(!g5(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!x5.test(Q.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${Q.about.represents})`);if(Q.about.source_score!==void 0){let z=Q.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}import{lstatSync as v9}from"fs";import{join as y9,dirname as S4,basename as qF,resolve as s$}from"path";var sW=e1(),oW=b$(),aW=k1(),W4=y$(),tW=M$(),t0=x(),eW=n0(),$B=d(),ZB=s0(),QB=o0(),aP=Q8(),zB=G4(),XB=V4(),UB=Y4(),H8=d7(),i7=L$();var HB=sW.Composer,J8=oW.Document,JB=aW.Schema,GB=W4.YAMLError,G8=W4.YAMLParseError,VB=W4.YAMLWarning,YB=tW.Alias,h0=t0.isAlias,B2=t0.isCollection,WB=t0.isDocument,p=t0.isMap,L0=t0.isNode,BB=t0.isPair,s=t0.isScalar,u0=t0.isSeq,qB=eW.Pair,KB=$B.Scalar,i2=ZB.YAMLMap,u$=QB.YAMLSeq;var DB=zB.Lexer,LB=XB.LineCounter,IB=UB.Parser,f0=H8.parse,MB=H8.parseAllDocuments,n2=H8.parseDocument,q2=H8.stringify,OB=i7.visit,_B=i7.visitAsync;import{accessSync as n7,closeSync as D4,constants as r7,existsSync as PB,fchmodSync as s7,fchownSync as FB,fsyncSync as o7,lstatSync as L4,mkdirSync as a7,mkdtempSync as $F,openSync as t7,readdirSync as NB,readFileSync as I4,readlinkSync as RB,realpathSync as TB,renameSync as AB,rmSync as ZF,statSync as r2,unlinkSync as e7,writeFileSync as CB}from"fs";import{randomBytes as jB}from"crypto";import{basename as e0,dirname as K2,isAbsolute as $9,join as s2,relative as M4,resolve as V0,sep as V8}from"path";class b extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var t=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),wB=new Set(Object.values(t).map(($)=>$.toLowerCase())),SB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),B4=($)=>wB.has($.toLowerCase());function o2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var EB=/\.fafm?$/i,bB=/^[a-z][a-z0-9-]*$/,w0=($)=>TB.native($),$2=($)=>$?.code;function m$($,Z){let Q=M4($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${V8}`)&&!$9(Q)}function Z9($){try{return RB($)}catch{return"?"}}function yB($,Z,Q,z){let X;try{X=w0(Q)}catch(U){let H=$2(U);if(H==="ENOENT"||H==="ELOOP"||H==="ENOTDIR")throw new b("dangling",Z,`${Z} is a link to ${Z9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw U}if(!m$($,X))throw new b("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(o2(X)&&!(z.inGit&&K2(X)===$))throw new b("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!r2(X).isFile())throw new b("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return xB(Z,X,z.read),X}function xB($,Z,Q){let z=e0($),X=e0(Z),U=B4(z)&&B4(X);if(Q&&!EB.test(X)&&!U){let H=B4(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new b("not-faf",$,`${$} is a link to ${Z}, which is not ${H} — refused.`)}if(!Q&&!SB(z,X)&&!U)throw new b("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function gB($,Z,Q,z){if(e0(V0($))!=="hooks"||!bB.test(e0(Z)))throw new b("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new b("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function vB($,Z,Q){if(e0($)!=="config"||Q!==Z)throw new b("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function h($,Z,Q={}){let z=w0(V0($)),X=V0($,Z),U=w0(K2(X));if(!m$(z,U))throw new b("outside",X,`${X} is in ${U}, outside ${z} — refused.`);let H=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(H)gB($,X,z,U);if(J)vB(X,z,U);let G=s2(U,e0(X));if(o2(G)&&!H&&!J)throw new b("git",X,G===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${G}, inside .git/ — refused.`);let V;try{V=L4(G)}catch(Y){if($2(Y)==="ENOENT")return G;throw Y}if(V.isSymbolicLink())return yB(z,X,G,{read:Q.read===!0,inGit:H||J});if(!V.isFile())throw new b("not-a-file",X,`${X} is not a regular file — refused.`);return w0(G)}var kB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function hB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return kB.decode($)}catch{}throw new b("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Z0($){return hB(I4($),$)}function I0($){try{return I4($)}catch(Z){if($2(Z)==="ENOENT")return null;throw Z}}function f$($,Z){let Q=V0(s2($,Z));if(!PB(Q))return null;let z,X;try{z=w0(uB($)),X=w0(Q)}catch{return null}if(!m$(z,X)||o2(M4(z,X)))return null;return X}var K4=[];function uB($){let Z=V0($);return K4.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(V8)?Q:Q+V8))??Z}function a2($,Z){K4.push(V0($));try{return Z()}finally{K4.pop()}}function I($,Z){return f$($,Z)!==null}function S($,Z){let Q=f$($,Z);if(Q===null)return null;try{return r2(Q).isFile()?I4(Q,"utf-8"):null}catch{return null}}function M0($,Z){let Q=f$($,Z);if(Q===null)return null;try{return r2(Q)}catch{return null}}function v($,Z="."){let Q=f$($,Z);if(Q===null)return null;let z;try{z=NB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||f$($,s2(Z,X.name))!==null)}function fB($){try{let Z=r2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if($2(Z)==="ENOENT")return;throw Z}}class Q9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var q4=($)=>new b("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function O4($,Z,Q){if(Z!==void 0){let X=I0($),U=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||U===null?X===U:X.equals(U)))throw q4($)}if(!Q)return;let z;try{z=r2($)}catch(X){if($2(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw q4($);try{n7($,r7.W_OK)}catch{throw q4($)}}function mB($,Z){if(process.platform!=="win32")try{FB($,Z.uid,Z.gid)}catch{}s7($,Z.mode)}function pB($){if(process.platform==="win32")return;try{let Z=t7($,"r");try{o7(Z)}finally{D4(Z)}}catch{}}function lB($,Z,Q,z){if($.fd=t7($.path,"wx",z??Q?.mode??438),$.created=!0,CB($.fd,Z),Q)mB($.fd,Q);if(z!==void 0)s7($.fd,z);o7($.fd),D4($.fd),$.fd=void 0}function cB($){if($.fd!==void 0)try{D4($.fd)}catch{}if($.created)try{e7($.path)}catch{}}function dB($,Z,Q){let z=K2($),X={path:s2(z,`.${e0($).slice(0,100)}.${process.pid}.${jB(6).toString("hex")}.faf-tmp`),created:!1},U=fB($);try{if(U)n7($,r7.W_OK);lB(X,Z,U,Q.mode),O4($,Q.expect,U),AB(X.path,$)}catch(H){if(cB(X),H instanceof b)throw H;let J=$2(H)??(H instanceof Error?H.message:String(H));throw new Q9($,`${$}: not written${U?"; original kept":""} (${J})`,{cause:H})}pB(z)}function iB($){return $ instanceof b&&!$.onWrite?new b($.reason,$.path,$.message,{onWrite:!0}):$}function e($,Z,Q={}){let z=V0($),X;try{X=h(Q.root??K2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(U){throw iB(U)}return dB(X,Z,Q),X}function z9($,Z,Q){let z=V0($),X=Q.root??K2(z),U=h(X,z),H=I0(U);if(Q.expect!==void 0)O4(U,Q.expect,void 0);if(H!==null&&Q.force!==!0&&!Q.owns(H))throw new b("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return e(U,Z,{root:X,expect:H})}function t2($,Z=$){let Q=V0($);a7(Q,{recursive:!0});let z=w0(Q),X=V0(Q,Z),U=M4(Q,X);if(U===".."||U.startsWith(`..${V8}`)||$9(U))throw new b("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let H=z;for(let J of U.split(/[\\/]/).filter(Boolean)){let G=s2(H,J);if(o2(G))throw new b("git",X,`${X} runs through ${G}, inside .git/ — refused.`,{onWrite:!0});H=nB(z,X,G)}return H}function nB($,Z,Q){let z;try{z=L4(Q)}catch(U){if($2(U)!=="ENOENT")throw U;return a7(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=w0(Q)}catch{throw new b("dangling",Z,`${Q} is a link to ${Z9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!m$($,X))throw new b("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(o2(X))throw new b("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!r2(X).isDirectory())throw new b("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function rB($,Z){let Q=V0($),z=w0(V0(Z.root??K2(Q))),X=w0(K2(Q));if(!m$(z,X))throw new b("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let U=s2(X,e0(Q));if(o2(U))throw new b("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let H;try{H=L4(U)}catch(J){if($2(J)==="ENOENT")return!1;throw J}if(!H.isFile())throw new b("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return O4(U,Z.expect,void 0),e7(U),!0}function u($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function p$($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if($===null||$===void 0)return"empty";if(typeof $==="string"){let Z=$.length>40?`${$.slice(0,40)}…`:$;return`a string (${JSON.stringify(Z)})`}if(typeof $==="object")return"a mapping";return`a ${typeof $} (${String($)})`}function Y8($,Z){if($===null||$===void 0)return{};if(!u($))throw new b("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${p$($)}. `+"faf left it unchanged — fix it by hand.");return $}var V9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function X9($){return typeof $==="object"&&$.collection===void 0}function sB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
143
- `)||typeof $.value!=="number")return;let z=Z.find((U)=>U.default===!0&&U.test?.test(Q));if(!z||!V9.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(s(X)?X.value:X,$.value)?Q:void 0}function oB($){let Z=$.filter(X9);return $.map((Q)=>{if(!X9(Q)||!V9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,U,H,J)=>sB(X,Z)??z(X,U,H,J)}})}var W8={keepSourceTokens:!0,customTags:oB};function aB($,Z){let Q=/^( *)[^\s#-][^#]*?:[ \t]*(?:#.*)?$/.exec($),z=/^( *)(\S)/.exec(Z);if(!Q||!z||z[2]==="#")return{};let X=z[1].length-Q[1].length;if(z[2]==="-")return X>=0?{indentSeq:X>0}:{};return X>=1&&X<=8?{indent:X}:{}}function tB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let U=aB(Z[X],Z[X+1]);Q??=U.indent,z??=U.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function R4($,Z){let Q=n2($,W8);if(Q.errors.length>0){let z=Q.errors[0].message.split(`
144
- `)[0];throw Error(`${Z}: not valid YAML (${z}) — faf left it unchanged.`,{cause:Q.errors[0]})}return Q}function D2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function l$($,Z){return $.lastIndexOf(`
145
- `,Z-1)+1}function Y9($,Z){if(Z>0&&$[Z-1]===`
142
+ `)}}var I6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function Z5($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[k1.get(Q)??Q]=z;return{...$,slots:Z}}function Q5($){return Z5(JSON.parse(c0().score_faf(I6($))))}function Ez($){return Z5(JSON.parse(c0().score_faf_enterprise(I6($))))}function bz($){return c0().validate_faf(I6($))}function yz($){return c0().compile_fafb(I6($))}function xz($){return JSON.parse(c0().decompile_fafb($))}function gz($){return JSON.parse(c0().fafb_info($))}function vz($){return Z5(JSON.parse(c0().score_fafb($)))}function kz(){return c0().sdk_version()}var f1=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function m1($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function p1($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],H=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),U=-1;if(H){let J=parseInt(H[1],10);if(J>=0&&J<=100)U=J}return{represents:X,sourceScore:U}}function hz($){return $.unknown?"unknown (—)":`${$.score}%`}function l1($){return{score:$.score,tier:O$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function X5($){let Z=p1($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?O$(Q):v0[v0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return l1(Q5($))}function uz($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let Q=$;if(!Q.faf_version)Z.push("Missing required field: faf_version");if(!Q.project?.name)Z.push("Missing required field: project.name");if(Q.app_type==="about")Z.push("about is not an app_type — declare about.represents (owner/repo) instead");if(Q.about!==void 0){if(!m1(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!f1.test(Q.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${Q.about.represents})`);if(Q.about.source_score!==void 0){let z=Q.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}import{lstatSync as p9}from"fs";import{join as u9,dirname as xZ,basename as IF,resolve as t$}from"path";var aW=zZ(),tW=g$(),eW=m5(),DZ=v$(),$B=P$(),e0=x(),ZB=r0(),QB=d(),zB=o0(),XB=a0(),ZF=Q8(),HB=BZ(),UB=qZ(),JB=KZ(),U8=a7(),t7=_$();var GB=aW.Composer,J8=tW.Document,VB=eW.Schema,YB=DZ.YAMLError,G8=DZ.YAMLParseError,WB=DZ.YAMLWarning,BB=$B.Alias,u0=e0.isAlias,B2=e0.isCollection,qB=e0.isDocument,p=e0.isMap,L0=e0.isNode,KB=e0.isPair,s=e0.isScalar,f0=e0.isSeq,DB=ZB.Pair,LB=QB.Scalar,r2=zB.YAMLMap,p$=XB.YAMLSeq;var IB=HB.Lexer,OB=UB.LineCounter,_B=JB.Parser,m0=U8.parse,MB=U8.parseAllDocuments,s2=U8.parseDocument,q2=U8.stringify,PB=t7.visit,FB=t7.visitAsync;import{accessSync as e7,closeSync as _Z,constants as $9,existsSync as RB,fchmodSync as Z9,fchownSync as NB,fsyncSync as Q9,lstatSync as MZ,mkdirSync as z9,mkdtempSync as XF,openSync as X9,readdirSync as TB,readFileSync as PZ,readlinkSync as AB,realpathSync as CB,renameSync as jB,rmSync as HF,statSync as o2,unlinkSync as H9,writeFileSync as wB}from"fs";import{randomBytes as SB}from"crypto";import{basename as $2,dirname as K2,isAbsolute as U9,join as a2,relative as FZ,resolve as V0,sep as V8}from"path";class b extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var t=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),EB=new Set(Object.values(t).map(($)=>$.toLowerCase())),bB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),LZ=($)=>EB.has($.toLowerCase());function t2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var yB=/\.fafm?$/i,xB=/^[a-z][a-z0-9-]*$/,w0=($)=>CB.native($),Z2=($)=>$?.code;function c$($,Z){let Q=FZ($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${V8}`)&&!U9(Q)}function J9($){try{return AB($)}catch{return"?"}}function gB($,Z,Q,z){let X;try{X=w0(Q)}catch(H){let U=Z2(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new b("dangling",Z,`${Z} is a link to ${J9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!c$($,X))throw new b("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(t2(X)&&!(z.inGit&&K2(X)===$))throw new b("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!o2(X).isFile())throw new b("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return vB(Z,X,z.read),X}function vB($,Z,Q){let z=$2($),X=$2(Z),H=LZ(z)&&LZ(X);if(Q&&!yB.test(X)&&!H){let U=LZ(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new b("not-faf",$,`${$} is a link to ${Z}, which is not ${U} — refused.`)}if(!Q&&!bB(z,X)&&!H)throw new b("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function kB($,Z,Q,z){if($2(V0($))!=="hooks"||!xB.test($2(Z)))throw new b("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new b("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function hB($,Z,Q){if($2($)!=="config"||Q!==Z)throw new b("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function h($,Z,Q={}){let z=w0(V0($)),X=V0($,Z),H=w0(K2(X));if(!c$(z,H))throw new b("outside",X,`${X} is in ${H}, outside ${z} — refused.`);let U=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(U)kB($,X,z,H);if(J)hB(X,z,H);let G=a2(H,$2(X));if(t2(G)&&!U&&!J)throw new b("git",X,G===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${G}, inside .git/ — refused.`);let V;try{V=MZ(G)}catch(Y){if(Z2(Y)==="ENOENT")return G;throw Y}if(V.isSymbolicLink())return gB(z,X,G,{read:Q.read===!0,inGit:U||J});if(!V.isFile())throw new b("not-a-file",X,`${X} is not a regular file — refused.`);return w0(G)}var uB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function fB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return uB.decode($)}catch{}throw new b("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Z0($){return fB(PZ($),$)}function I0($){try{return PZ($)}catch(Z){if(Z2(Z)==="ENOENT")return null;throw Z}}function l$($,Z){let Q=V0(a2($,Z));if(!RB(Q))return null;let z,X;try{z=w0(mB($)),X=w0(Q)}catch{return null}if(!c$(z,X)||t2(FZ(z,X)))return null;return X}var OZ=[];function mB($){let Z=V0($);return OZ.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(V8)?Q:Q+V8))??Z}function e2($,Z){OZ.push(V0($));try{return Z()}finally{OZ.pop()}}function I($,Z){return l$($,Z)!==null}function S($,Z){let Q=l$($,Z);if(Q===null)return null;try{return o2(Q).isFile()?PZ(Q,"utf-8"):null}catch{return null}}function O0($,Z){let Q=l$($,Z);if(Q===null)return null;try{return o2(Q)}catch{return null}}function v($,Z="."){let Q=l$($,Z);if(Q===null)return null;let z;try{z=TB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||l$($,a2(Z,X.name))!==null)}function pB($){try{let Z=o2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(Z2(Z)==="ENOENT")return;throw Z}}class G9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var IZ=($)=>new b("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function RZ($,Z,Q){if(Z!==void 0){let X=I0($),H=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||H===null?X===H:X.equals(H)))throw IZ($)}if(!Q)return;let z;try{z=o2($)}catch(X){if(Z2(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw IZ($);try{e7($,$9.W_OK)}catch{throw IZ($)}}function lB($,Z){if(process.platform!=="win32")try{NB($,Z.uid,Z.gid)}catch{}Z9($,Z.mode)}function cB($){if(process.platform==="win32")return;try{let Z=X9($,"r");try{Q9(Z)}finally{_Z(Z)}}catch{}}function dB($,Z,Q,z){if($.fd=X9($.path,"wx",z??Q?.mode??438),$.created=!0,wB($.fd,Z),Q)lB($.fd,Q);if(z!==void 0)Z9($.fd,z);Q9($.fd),_Z($.fd),$.fd=void 0}function iB($){if($.fd!==void 0)try{_Z($.fd)}catch{}if($.created)try{H9($.path)}catch{}}function nB($,Z,Q){let z=K2($),X={path:a2(z,`.${$2($).slice(0,100)}.${process.pid}.${SB(6).toString("hex")}.faf-tmp`),created:!1},H=pB($);try{if(H)e7($,$9.W_OK);dB(X,Z,H,Q.mode),RZ($,Q.expect,H),jB(X.path,$)}catch(U){if(iB(X),U instanceof b)throw U;let J=Z2(U)??(U instanceof Error?U.message:String(U));throw new G9($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}cB(z)}function rB($){return $ instanceof b&&!$.onWrite?new b($.reason,$.path,$.message,{onWrite:!0}):$}function e($,Z,Q={}){let z=V0($),X;try{X=h(Q.root??K2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw rB(H)}return nB(X,Z,Q),X}function V9($,Z,Q){let z=V0($),X=Q.root??K2(z),H=h(X,z),U=I0(H);if(Q.expect!==void 0)RZ(H,Q.expect,void 0);if(U!==null&&Q.force!==!0&&!Q.owns(U))throw new b("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return e(H,Z,{root:X,expect:U})}function $$($,Z=$){let Q=V0($);z9(Q,{recursive:!0});let z=w0(Q),X=V0(Q,Z),H=FZ(Q,X);if(H===".."||H.startsWith(`..${V8}`)||U9(H))throw new b("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let U=z;for(let J of H.split(/[\\/]/).filter(Boolean)){let G=a2(U,J);if(t2(G))throw new b("git",X,`${X} runs through ${G}, inside .git/ — refused.`,{onWrite:!0});U=sB(z,X,G)}return U}function sB($,Z,Q){let z;try{z=MZ(Q)}catch(H){if(Z2(H)!=="ENOENT")throw H;return z9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=w0(Q)}catch{throw new b("dangling",Z,`${Q} is a link to ${J9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!c$($,X))throw new b("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(t2(X))throw new b("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!o2(X).isDirectory())throw new b("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function oB($,Z){let Q=V0($),z=w0(V0(Z.root??K2(Q))),X=w0(K2(Q));if(!c$(z,X))throw new b("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=a2(X,$2(Q));if(t2(H))throw new b("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let U;try{U=MZ(H)}catch(J){if(Z2(J)==="ENOENT")return!1;throw J}if(!U.isFile())throw new b("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return RZ(H,Z.expect,void 0),H9(H),!0}function u($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function d$($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if($===null||$===void 0)return"empty";if(typeof $==="string"){let Z=$.length>40?`${$.slice(0,40)}…`:$;return`a string (${JSON.stringify(Z)})`}if(typeof $==="object")return"a mapping";return`a ${typeof $} (${String($)})`}function Y8($,Z){if($===null||$===void 0)return{};if(!u($))throw new b("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${d$($)}. `+"faf left it unchanged — fix it by hand.");return $}var D9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function Y9($){return typeof $==="object"&&$.collection===void 0}function aB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
143
+ `)||typeof $.value!=="number")return;let z=Z.find((H)=>H.default===!0&&H.test?.test(Q));if(!z||!D9.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(s(X)?X.value:X,$.value)?Q:void 0}function tB($){let Z=$.filter(Y9);return $.map((Q)=>{if(!Y9(Q)||!D9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,H,U,J)=>aB(X,Z)??z(X,H,U,J)}})}var W8={keepSourceTokens:!0,customTags:tB};function eB($,Z){let Q=/^( *)[^\s#-][^#]*?:[ \t]*(?:#.*)?$/.exec($),z=/^( *)(\S)/.exec(Z);if(!Q||!z||z[2]==="#")return{};let X=z[1].length-Q[1].length;if(z[2]==="-")return X>=0?{indentSeq:X>0}:{};return X>=1&&X<=8?{indent:X}:{}}function $q($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let H=eB(Z[X],Z[X+1]);Q??=H.indent,z??=H.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function jZ($,Z){let Q=s2($,W8);if(Q.errors.length>0){let z=Q.errors[0].message.split(`
144
+ `)[0];throw Error(`${Z}: not valid YAML (${z}) — faf left it unchanged.`,{cause:Q.errors[0]})}return Q}function D2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function i$($,Z){return $.lastIndexOf(`
145
+ `,Z-1)+1}function L9($,Z){if(Z>0&&$[Z-1]===`
146
146
  `)return Z;let Q=$.indexOf(`
147
- `,Z);return Q<0?$.length:Q+1}function U9($,Z){let Q=Z;if($[Q-1]===`
148
- `){if(Q--,$[Q-1]==="\r")Q--}return Q}function O0($){return $!==null&&$!==void 0}function X0($){let Z=L0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function W9($,Z){let Q=X0($),z=X0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function B9($){if(s($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return B2($)&&!$.flow}function B8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function q9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&B8($,Z)}function K9($,Z,Q,z){let X=new J8(void 0,W8);X.contents=Z(X);let H=X.toString($.piece).replace(/\n+$/,"").slice(Q),J=H.startsWith(" ")&&!H.includes(`
149
- `),G=" ".repeat(z),V=H.replace(/\n(?=.)/g,`
150
- ${G}`).replace(/\n/g,$.eol);return{inline:J,text:J?H.slice(1):V}}function P4($,Z,Q){return K9($,(z)=>{let X=new i2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function eB($,Z,Q){let z=K9($,()=>{let X=new u$;return X.items.push(Z),X},1,Q);if(z.inline)return z;return z.text.startsWith(" ")?{inline:!1,text:z.text.slice(1)}:null}function $q($){if(!L0($)||!O0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function Zq($,Z){if(!L0($)||!L0(Z))return Z;let Q=$,z=Z;if(!Q.anchor&&!Q.tag||Q.anchor!==z.anchor||Q.tag!==z.tag)return Z;let X=Z.clone();return X.anchor=void 0,X.tag=void 0,X}function Qq($,Z){let Q=X0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function zq($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function H9($,Z,Q,z,X=!1){let U=X0(Z);if(!U||z.kind==="root")return null;let H=Z.comment,J=L0(Q)?Q.comment:void 0,G=!O0(H)||H===J,V=G?$q(Q):Q,Y=X?V:Zq(Z,V),W=z.kind==="value"?P4($,Y,z.col):eB($,Y,z.col);return W?{range:U,keepTail:G,newComment:J,piece:W}:null}function Xq($,Z,Q,z){if(!z)return U9($,Y9($,Q[2]));return B9(Z)?U9($,Q[1]):Q[1]}function c$($,Z,Q,z,X){let U=H9($,Z,Q,z);if(!U)return!1;let H=Xq($.src,Z,U.range,U.keepTail);if(U.piece.inline&&(!B9(Z)||z.kind==="item"))return Uq($,U,H,z,X),!0;let J=U.keepTail?Z.comment:U.newComment;if(X!==void 0||O0(J))return!1;let G=z.kind==="value"?H9($,Z,Q,z,!0):U;return G!==null&&Hq($,G.range[0],H,G.piece,z)}function Uq($,Z,Q,z,X){let[U,H]=Z.range,G=U===H&&z.kind==="value"?zq($.src,U,Z.piece.text):Z.piece.text;D2($,U,Q,G+(X===void 0?"":` #${X}`))}function Hq($,Z,Q,z,X){if(X.kind==="item")return D2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let U=Qq($.src,X.key);if(U<0)return!1;return D2($,U,Q,z.inline?` ${z.text}`:z.text),!0}function Jq($,Z){return B8({...$,comment:void 0},{...Z,comment:void 0})}function Gq($,Z){if(O0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
- `)?void 0:Z.comment}function Vq($,Z,Q,z){if(q9(Z,Q))return!0;if(!Jq(Z,Q))return!1;let X=Gq(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return c$($,Z,Q,z,X)}function Yq($,Z,Q,z){if(!B8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return P4($,Z,0).text===P4($,Q,0).text||c$($,Z,Q,z);if(Q.items.length===0)return c$($,Z,Q,z);return p(Z)?Kq($,Z,Q):Lq($,Z,Q)}function T4($,Z,Q,z){if(!W9(Z,Q))return c$($,Z,Q,z);if(s(Z))return Vq($,Z,Q,z);if(h0(Z))return h0(Q)&&Z.source===Q.source&&B8(Z,Q)||c$($,Z,Q,z);if(!B2(Z)||!B2(Q))return!1;return Yq($,Z,Q,z)}function D9($,Z){return Z-l$($,Z)}function A4($,Z,Q){let z=$.slice(l$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function F4($){return L0($)&&(O0($.commentBefore)||!!$.spaceBefore)}function C4($,Z,Q){let z=X0(Z)??X0(Q);return z?Y9($.src,z[2]):-1}function L9($,Z,Q){let z=new J8(void 0,W8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
152
- `).map((H)=>H?X+H:H).join($.eol)+$.eol}function Wq($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
- `);D2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function I9($,Z,Q,z,X,U){let H=Q;if(H<0){let J=X0(Z);if(!J||F4(Z)||!A4($.src,J[0],U))return!1;H=l$($.src,J[0])}return Wq($,H,L9($,z,X)),!0}function Bq($,Z,Q){let z=l$($,Q),X=Z,U=O0(X.commentBefore),H=!!X.spaceBefore;while(z>0){let J=l$($,z-1),G=$.slice(J,z).trim();if(U&&G.startsWith("#"))z=J;else if(H&&G==="")z=J,H=!1;else break}return z}function M9($,Z,Q,z){let X=X0(Z);if(!X||!A4($.src,X[0],z))return!1;let U=C4($,Q,Z);if(U<0)return!1;return D2($,Bq($.src,Z,X[0]),U,""),!0}function O9($,Z){let Q=new Map,z=(X)=>{let U=X0(X);return U?U.join(":"):void 0};return $.forEach((X,U)=>{let H=z(Z(X));if(H!==void 0&&!Q.has(H))Q.set(H,U)}),(X)=>{let U=z(Z(X)),H=U===void 0?void 0:Q.get(U);return H!==void 0&&W9(Z($[H]),Z(X))?H:-1}}function qq($,Z){return s($)&&s(Z)?q9($,Z):$===Z}function Kq($,Z,Q){let z=Z.items[0]?.key,X=X0(z);if(!X)return!1;let U=D9($.src,X[0]),H=new Set,J=(W,B)=>{if(W.length===0)return!0;let K=new i2;K.items.push(...W);let L=B<0?-1:C4($,Z.items[B].value,Z.items[B].key);return I9($,z,L,K,U,!1)},G=O9(Z.items,(W)=>W.key),V=-1,Y=[];for(let W of Q.items){let B=G(W);if(B<0){Y.push(W);continue}if(B<=V||!J(Y,V)||!qq(Z.items[B].key,W.key))return!1;if(Y=[],!T4($,Z.items[B].value,W.value,{kind:"value",key:Z.items[B].key,col:U}))return!1;H.add(B),V=B}if(!J(Y,V))return!1;return Z.items.every((W,B)=>H.has(B)||Dq($,Z,B))}function Dq($,Z,Q){let z=Z.items[Q],X=X0(z.key);if(!X)return!1;if(A4($.src,X[0],!1))return M9($,z.key,z.value,!1);let U=Z.items[Q+1],H=X0(U?.key);if(Q!==0||!H||F4(z.key)||F4(U.key))return!1;return D2($,X[0],H[0],""),!0}function Lq($,Z,Q){let z=X0(Z);if(!z||Z.items.length===0)return!1;let X=D9($.src,z[0]),U=new Set,H=(Y,W)=>{if(Y.length===0)return!0;let B=new u$;B.items.push(...Y);let K=W<0?-1:C4($,Z.items[W]);return I9($,Z.items[0],K,B,X,!0)},J=O9(Z.items,(Y)=>Y),G=-1,V=[];for(let Y of Q.items){let W=J(Y);if(W<0){V.push(Y);continue}if(W<=G||!H(V,G))return!1;if(V=[],!T4($,Z.items[W],Y,{kind:"item",col:X}))return!1;U.add(W),G=W}if(!H(V,G))return!1;return Z.items.every((Y,W)=>U.has(W)||M9($,Y,Y,!0))}function Iq($,Z){let Q=[...Z].sort((U,H)=>H.start-U.start||H.end-U.end||H.seq-U.seq),z=$,X=1/0;for(let U of Q){if(U.end>X)return null;z=z.slice(0,U.start)+U.text+z.slice(U.end),X=U.start}return z}function Mq($,Z,Q){if(!p(Q)&&!u0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
- `)?$.eol:"",X=Z.commentBefore?$.eol:"";return D2($,$.src.length,$.src.length,z+X+L9($,Q,0)),!0}function Oq($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!O0(z))return!O0(X)||Mq($,Z,X);return O0(X)&&T4($,z,X,{kind:"root"})}function _q($,Z,Q,z,X){let U={src:$,eol:z,edits:[],piece:X};if(!Oq(U,Z,Q))return null;return Iq($,U.edits)}var J9=($)=>$.replace(/^[ \t]*\n/gm,"");function Pq($,Z,Q,z){let X=n2($,W8);if(X.errors.length>0||!l(X.toJS(),Z.toJS()))return!1;let U=X.toString(z);return U===Q||J9(U)===J9(Q)}function q8($,Z,Q="YAML"){let{text:z,changed:X}=Fq($,Z,Q);return{text:z,changed:X}}function Fq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),U=R4(X,Q),H=Nq(U);Z(H);let J={text:$,changed:!1,spliced:!1};if(l(H.toJS(),U.toJS()))return J;let G={lineWidth:0,...tB(X)},V=H.toString(G);if(V===U.toString(G))return J;let Y=X.includes(`\r
147
+ `,Z);return Q<0?$.length:Q+1}function W9($,Z){let Q=Z;if($[Q-1]===`
148
+ `){if(Q--,$[Q-1]==="\r")Q--}return Q}function _0($){return $!==null&&$!==void 0}function X0($){let Z=L0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function I9($,Z){let Q=X0($),z=X0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function O9($){if(s($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return B2($)&&!$.flow}function B8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function _9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&B8($,Z)}function M9($,Z,Q,z){let X=new J8(void 0,W8);X.contents=Z(X);let U=X.toString($.piece).replace(/\n+$/,"").slice(Q),J=U.startsWith(" ")&&!U.includes(`
149
+ `),G=" ".repeat(z),V=U.replace(/\n(?=.)/g,`
150
+ ${G}`).replace(/\n/g,$.eol);return{inline:J,text:J?U.slice(1):V}}function TZ($,Z,Q){return M9($,(z)=>{let X=new r2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function Zq($,Z,Q){let z=M9($,()=>{let X=new p$;return X.items.push(Z),X},1,Q);if(z.inline)return z;return z.text.startsWith(" ")?{inline:!1,text:z.text.slice(1)}:null}function Qq($){if(!L0($)||!_0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function zq($,Z){if(!L0($)||!L0(Z))return Z;let Q=$,z=Z;if(!Q.anchor&&!Q.tag||Q.anchor!==z.anchor||Q.tag!==z.tag)return Z;let X=Z.clone();return X.anchor=void 0,X.tag=void 0,X}function Xq($,Z){let Q=X0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function Hq($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function B9($,Z,Q,z,X=!1){let H=X0(Z);if(!H||z.kind==="root")return null;let U=Z.comment,J=L0(Q)?Q.comment:void 0,G=!_0(U)||U===J,V=G?Qq(Q):Q,Y=X?V:zq(Z,V),W=z.kind==="value"?TZ($,Y,z.col):Zq($,Y,z.col);return W?{range:H,keepTail:G,newComment:J,piece:W}:null}function Uq($,Z,Q,z){if(!z)return W9($,L9($,Q[2]));return O9(Z)?W9($,Q[1]):Q[1]}function n$($,Z,Q,z,X){let H=B9($,Z,Q,z);if(!H)return!1;let U=Uq($.src,Z,H.range,H.keepTail);if(H.piece.inline&&(!O9(Z)||z.kind==="item"))return Jq($,H,U,z,X),!0;let J=H.keepTail?Z.comment:H.newComment;if(X!==void 0||_0(J))return!1;let G=z.kind==="value"?B9($,Z,Q,z,!0):H;return G!==null&&Gq($,G.range[0],U,G.piece,z)}function Jq($,Z,Q,z,X){let[H,U]=Z.range,G=H===U&&z.kind==="value"?Hq($.src,H,Z.piece.text):Z.piece.text;D2($,H,Q,G+(X===void 0?"":` #${X}`))}function Gq($,Z,Q,z,X){if(X.kind==="item")return D2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let H=Xq($.src,X.key);if(H<0)return!1;return D2($,H,Q,z.inline?` ${z.text}`:z.text),!0}function Vq($,Z){return B8({...$,comment:void 0},{...Z,comment:void 0})}function Yq($,Z){if(_0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
+ `)?void 0:Z.comment}function Wq($,Z,Q,z){if(_9(Z,Q))return!0;if(!Vq(Z,Q))return!1;let X=Yq(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return n$($,Z,Q,z,X)}function Bq($,Z,Q,z){if(!B8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return TZ($,Z,0).text===TZ($,Q,0).text||n$($,Z,Q,z);if(Q.items.length===0)return n$($,Z,Q,z);return p(Z)?Lq($,Z,Q):Oq($,Z,Q)}function wZ($,Z,Q,z){if(!I9(Z,Q))return n$($,Z,Q,z);if(s(Z))return Wq($,Z,Q,z);if(u0(Z))return u0(Q)&&Z.source===Q.source&&B8(Z,Q)||n$($,Z,Q,z);if(!B2(Z)||!B2(Q))return!1;return Bq($,Z,Q,z)}function P9($,Z){return Z-i$($,Z)}function SZ($,Z,Q){let z=$.slice(i$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function AZ($){return L0($)&&(_0($.commentBefore)||!!$.spaceBefore)}function EZ($,Z,Q){let z=X0(Z)??X0(Q);return z?L9($.src,z[2]):-1}function F9($,Z,Q){let z=new J8(void 0,W8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
152
+ `).map((U)=>U?X+U:U).join($.eol)+$.eol}function qq($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
+ `);D2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function R9($,Z,Q,z,X,H){let U=Q;if(U<0){let J=X0(Z);if(!J||AZ(Z)||!SZ($.src,J[0],H))return!1;U=i$($.src,J[0])}return qq($,U,F9($,z,X)),!0}function Kq($,Z,Q){let z=i$($,Q),X=Z,H=_0(X.commentBefore),U=!!X.spaceBefore;while(z>0){let J=i$($,z-1),G=$.slice(J,z).trim();if(H&&G.startsWith("#"))z=J;else if(U&&G==="")z=J,U=!1;else break}return z}function N9($,Z,Q,z){let X=X0(Z);if(!X||!SZ($.src,X[0],z))return!1;let H=EZ($,Q,Z);if(H<0)return!1;return D2($,Kq($.src,Z,X[0]),H,""),!0}function T9($,Z){let Q=new Map,z=(X)=>{let H=X0(X);return H?H.join(":"):void 0};return $.forEach((X,H)=>{let U=z(Z(X));if(U!==void 0&&!Q.has(U))Q.set(U,H)}),(X)=>{let H=z(Z(X)),U=H===void 0?void 0:Q.get(H);return U!==void 0&&I9(Z($[U]),Z(X))?U:-1}}function Dq($,Z){return s($)&&s(Z)?_9($,Z):$===Z}function Lq($,Z,Q){let z=Z.items[0]?.key,X=X0(z);if(!X)return!1;let H=P9($.src,X[0]),U=new Set,J=(W,B)=>{if(W.length===0)return!0;let K=new r2;K.items.push(...W);let L=B<0?-1:EZ($,Z.items[B].value,Z.items[B].key);return R9($,z,L,K,H,!1)},G=T9(Z.items,(W)=>W.key),V=-1,Y=[];for(let W of Q.items){let B=G(W);if(B<0){Y.push(W);continue}if(B<=V||!J(Y,V)||!Dq(Z.items[B].key,W.key))return!1;if(Y=[],!wZ($,Z.items[B].value,W.value,{kind:"value",key:Z.items[B].key,col:H}))return!1;U.add(B),V=B}if(!J(Y,V))return!1;return Z.items.every((W,B)=>U.has(B)||Iq($,Z,B))}function Iq($,Z,Q){let z=Z.items[Q],X=X0(z.key);if(!X)return!1;if(SZ($.src,X[0],!1))return N9($,z.key,z.value,!1);let H=Z.items[Q+1],U=X0(H?.key);if(Q!==0||!U||AZ(z.key)||AZ(H.key))return!1;return D2($,X[0],U[0],""),!0}function Oq($,Z,Q){let z=X0(Z);if(!z||Z.items.length===0)return!1;let X=P9($.src,z[0]),H=new Set,U=(Y,W)=>{if(Y.length===0)return!0;let B=new p$;B.items.push(...Y);let K=W<0?-1:EZ($,Z.items[W]);return R9($,Z.items[0],K,B,X,!0)},J=T9(Z.items,(Y)=>Y),G=-1,V=[];for(let Y of Q.items){let W=J(Y);if(W<0){V.push(Y);continue}if(W<=G||!U(V,G))return!1;if(V=[],!wZ($,Z.items[W],Y,{kind:"item",col:X}))return!1;H.add(W),G=W}if(!U(V,G))return!1;return Z.items.every((Y,W)=>H.has(W)||N9($,Y,Y,!0))}function _q($,Z){let Q=[...Z].sort((H,U)=>U.start-H.start||U.end-H.end||U.seq-H.seq),z=$,X=1/0;for(let H of Q){if(H.end>X)return null;z=z.slice(0,H.start)+H.text+z.slice(H.end),X=H.start}return z}function Mq($,Z,Q){if(!p(Q)&&!f0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
+ `)?$.eol:"",X=Z.commentBefore?$.eol:"";return D2($,$.src.length,$.src.length,z+X+F9($,Q,0)),!0}function Pq($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!_0(z))return!_0(X)||Mq($,Z,X);return _0(X)&&wZ($,z,X,{kind:"root"})}function Fq($,Z,Q,z,X){let H={src:$,eol:z,edits:[],piece:X};if(!Pq(H,Z,Q))return null;return _q($,H.edits)}var q9=($)=>$.replace(/^[ \t]*\n/gm,"");function Rq($,Z,Q,z){let X=s2($,W8);if(X.errors.length>0||!l(X.toJS(),Z.toJS()))return!1;let H=X.toString(z);return H===Q||q9(H)===q9(Q)}function q8($,Z,Q="YAML"){let{text:z,changed:X}=Nq($,Z,Q);return{text:z,changed:X}}function Nq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),H=jZ(X,Q),U=Tq(H);Z(U);let J={text:$,changed:!1,spliced:!1};if(l(U.toJS(),H.toJS()))return J;let G={lineWidth:0,...$q(X)},V=U.toString(G);if(V===H.toString(G))return J;let Y=X.includes(`\r
155
155
  `)?`\r
156
156
  `:`
157
- `,W=_q(X,U,H,Y,{...G,verifyAliasOrder:!1}),B=W!==null&&Pq(W,H,V,G),K=B&&W!==null?W:V.replace(/\r?\n/g,Y);return{text:z+K,changed:z+K!==$,spliced:B}}function Nq($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function l($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>l(Q,Z[z]));if(u($)&&u(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&l($[z],Z[z]))}return!1}function i$($){let Z=s($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function Z2($,Z){return $.items.find((Q)=>i$(Q)===Z)}function _9($,Z){return L0(Z)?Z.toJS($):Z}function Rq($,Z,Q,z){return z.keepAliases===!0&&h0(Z)||l(_9($,Z),Q)}function K8($,Z,Q,z={}){if(Rq($,Z,Q,z))return Z;if(u(Q)&&p(Z))return Aq($,Z,Q,z),Z;if(Array.isArray(Q)&&u0(Z))return wq($,Z,Q,z),Z;if(!u(Q)&&!Array.isArray(Q)&&s(Z))return Z.value=Q,Z;return Tq(Z,$.createNode(Q))}function Tq($,Z){if(!s($)&&!h0($))return Z;let Q=$,z=Z;if(B2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=_4(z.commentBefore,Q.commentBefore,Q.comment),Z;if(B2(Z))Z.flow=!0;return z.comment=_4(z.comment??Q.comment),z.commentBefore=_4(z.commentBefore??Q.commentBefore),Z}function _4(...$){let Z=$.filter(O0);return Z.length>0?Z.join(`
158
- `):void 0}function Aq($,Z,Q,z={}){for(let[X,U]of Object.entries(Q)){if(U===void 0)continue;let H=Z2(Z,X);if(H)H.value=K8($,H.value,U,z);else Z.items.push($.createPair(X,U))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let U=i$(X);return U===void 0||Q[U]!==void 0})}function j4($,Z,Q,z){let X=u(Q)?Q:{};for(let[U,H]of Object.entries(z)){if(H===void 0)continue;let J=Z2(Z,U);if(!J)Z.items.push($.createPair(U,H));else if(Object.prototype.hasOwnProperty.call(X,U)&&l(X[U],H))continue;else if(u(H)&&u(X[U])&&p(J.value))j4($,J.value,X[U],H);else J.value=K8($,J.value,H,{keepAliases:!0})}}function d$($,Z,Q){if(h0($))Q.push({path:[...Z],node:$});else if(p($))for(let z of $.items){let X=i$(z);if(X!==void 0)d$(z.value,[...Z,X],Q)}else if(u0($))$.items.forEach((z,X)=>d$(z,[...Z,X],Q))}function G9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(u(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function P9($,Z,Q){let z=[];return d$($.contents,[],z),z.filter(({path:X,node:U})=>{let H=G9(Z,X);return H!==void 0&&!l(G9(Q,X),H)&&!l(U.toJS($),H)}).map(({path:X,node:U})=>({path:X.join("."),alias:`*${U.source}`}))}function F9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=Cq(Q,Z[X]);let z=Z[Z.length-1];if(p(Q)&&typeof z==="string"){let X=Z2(Q,z);return X?{node:X.value,put:(U)=>(X.value=U,!0)}:null}if(u0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,U=X.items[z];return{node:U,put:(H)=>X0(U)===void 0?(X.items[z]=H,!0):!1}}return null}function Cq($,Z){if(p($)&&typeof Z==="string")return Z2($,Z)?.value;if(u0($)&&typeof Z==="number")return $.items[Z];return}function N9($,Z){let Q=[];d$($.contents,[],Q);let z=[];for(let{path:X,node:U}of Q){let H=F9(Z,X);if(!H||h0(H.node)&&H.node.source===U.source)continue;if(!H.put(U.clone()))continue;z.push({path:X.join("."),alias:`*${U.source}`})}return z}function N4($,Z,Q,z){if(!L0($)||h0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(p($))for(let U of $.items){let H=i$(U);if(H!==void 0)N4(U.value,[...Z,H],Q,z)}else if(u0($))$.items.forEach((U,H)=>N4(U,[...Z,H],Q,z))}function R9($,Z){let Q=[];d$($.contents,[],Q);let z=new Set(Q.map((H)=>H.node.source));if(z.size===0)return[];let X=[];N4($.contents,[],z,X);let U=[];for(let{path:H,node:J}of X){let G=F9(Z,H);if(!G)continue;let V=J.anchor;if(L0(G.node)&&G.node.anchor===V&&l(J.toJS($),G.node.toJS(Z))||!G.put(J.clone()))continue;U.push({path:H.join("."),alias:`&${V}`,kind:"anchor"})}return U}function jq($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let H=Q-1;H>=0;H--)for(let J=z-1;J>=0;J--)X[H][J]=l($[H],Z[J])?X[H+1][J+1]+1:Math.max(X[H+1][J],X[H][J+1]);let U=[];for(let H=0,J=0;H<Q&&J<z;)if(l($[H],Z[J]))U.push([H,J]),H++,J++;else if(X[H+1][J]>=X[H][J+1])H++;else J++;return U}function wq($,Z,Q,z){let X=Z.items,U=X.map((V)=>_9($,V)),H=[],J=0,G=0;for(let[V,Y]of[...jq(U,Q),[X.length,Q.length]]){for(;J<V&&G<Y;J++,G++)H.push(K8($,X[J],Q[G],z));for(;G<Y;G++)H.push($.createNode(Q[G]));if(V<X.length)H.push(X[V]);J=V+1,G=Y+1}Z.items=H}function n$($,Z,Q,z){if(l(Q,z))return Z;if(!u(Q)||!u(z)||!p(Z))return K8($,Z,z);let X=new Set(Object.keys(Q).filter((U)=>!(U in z)||z[U]===void 0));Z.items=Z.items.filter((U)=>{let H=i$(U);return H===void 0||!X.has(H)});for(let[U,H]of Object.entries(z)){if(H===void 0)continue;let J=Z2(Z,U);if(!J)Z.items.push($.createPair(U,H));else if(!l(Q[U],H))J.value=n$($,J.value,Q[U],H)}return Z}function T9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new i2,z=$.contents;if(!p(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let U of Z){let H=Z2(X,U);if(H&&p(H.value)){X=H.value;continue}if(H&&!j9(H.value))throw Error(`${Q}: ${U} is not a mapping — faf left it unchanged.`);let J=new i2;if(H)H.value=C9(H.value,J);else X.items.push($.createPair(U,J));X=J}return X}function D8($,Z,Q,z,X){if(l(Q,z))return;let U=T9($,Z.slice(0,-1),X),H=Z[Z.length-1],J=Z2(U,H);if(z===void 0)U.items=U.items.filter((G)=>G!==J);else if(!J)U.items.push($.createPair(H,z));else J.value=n$($,J.value,Q,z)}function A9($,Z,Q){let z=T9($,Z.slice(0,-1),Q),X=Z[Z.length-1],U=Z2(z,X);if(U&&u0(U.value))return U.value;if(U&&!j9(U.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let H=new u$;if(U)U.value=C9(U.value,H);else z.items.push($.createPair(X,H));return H}function C9($,Z){if(!s($))return Z;let Q=[$.commentBefore,$.comment].filter(O0);if(Q.length>0)Z.commentBefore=Q.join(`
159
- `);return Z}function j9($){if($===null||$===void 0)return!0;return s($)&&($.value===null||$.value===void 0)}var w4=new WeakMap;function r$($){return typeof $==="object"&&$!==null?w4.get($):void 0}function L8($,Z){w4.set($,Z)}function w9($,Z){let Q=r$($);if(Q)w4.set(Z,Q);return Z}var S9=new WeakSet;function E9($){return S9.add($),$}function b9($){return typeof $==="object"&&$!==null&&S9.has($)}function I8($){let Z=s$($);return h(S4(Z),Z,{read:!0})}function k9($){if($ instanceof G8)return $;let Z=$?.cause;return Z instanceof G8?Z:null}function h9($,Z){let Q=Z.message.split(`
160
- `)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=s$($);return new b("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function Sq($){let Z=I8($),Q=Z0(Z),z;try{z=f0(Q)}catch(U){let H=k9(U);if(H)throw h9($,H);throw U}let X=Y8(z,$);return L8(X,{real:Z,text:Q}),X}function u9($){let Z=$._meta,Q={...$};delete Q._meta;let z=q2(Q,{lineWidth:0});if(Z?.found&&Z.found.length>0){let X=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(U,H,J)=>{if(J.includes("#"))return U;return`${H} # found: ${X}`})}return z}function Eq($,Z){return f9($,Z,void 0)}function f9($,Z,Q,z,X=!1){let U=I8($),H=Z0(U),J=[],G;try{G=q8(H,(V)=>{m9(V,$);let Y=V.clone();if(Z(V),J=N9(Y,V),X)J=[...J,...R9(Y,V)];if(z)J=[...J,...z(V,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(V){let Y=k9(V);if(Y)throw h9($,Y);throw V}if(!G.changed)return{written:!1,text:H,keptAliases:J};return e($,G.text,{expect:Q&&Q.real===U?Q.text:H}),{written:!0,text:G.text,keptAliases:J}}function x9($){try{return v9($),!0}catch{return!1}}function bq($){let Z=$.getIn(["project","type"],!0);return s(Z)?Z.value:Z}function m9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!p(Q))throw new b("not-yaml",s$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${p$($.toJS())}. faf left it unchanged — fix it by hand.`)}function yq($,Z,Q){m9($,Q);let z=$.contents,X=p(z)&&z.items.some((Y)=>s(Y.key)&&Y.key.value==="_meta"),{_meta:U,...H}=Z,J=bq($),G=p(z)?$.toJS():{},V=p(z)?z:$.createNode({});if($.contents=V,j4($,V,G,X?{...Z}:H),!X)gq($,U?.found,J)}function xq($,Z){let Q=$.contents;if(p(Q)&&Q.items.some((U)=>s(U.key)&&U.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function gq($,Z,Q){if(!Z||Z.length===0||!o(Q))return;let z=$.getIn(["project","type"],!0);if(s(z)&&!o(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function vq($,Z,Q={}){if(!Q.replace&&x9($)){let J=f9($,(G)=>yq(G,Z,$),r$(Z),(G,V)=>P9(G,xq(G,Z),V),b9(Z));L8(Z,{real:I8($),text:J.text});for(let G of J.keptAliases??[])Q.onAliasKept?.(G);return J.written}let z=s$($),X=u9(Z),U=x9($)?I0(h(S4(z),z)):null,H=e($,X,{expect:U});return L8(Z,{real:H,text:X}),!0}function p9($){return Z0(I8($))}function g9($,Z){let Q;try{Q=v9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return h($,s$(Z),{read:!0}),!0}function l9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=y9($,z);if(g9($,X))return X}let Q=S4($);if(Q!==$)for(let z of Z){let X=y9(Q,z);if(g9(Q,X))return X}return null}import{statSync as c9}from"fs";import{homedir as kq}from"os";import{parse as hq,resolve as d9}from"path";function i9($,Z){try{let Q=c9($,{bigint:!0}),z=c9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function uq($){let Z=d9($),Q=d9(kq()),z=hq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(i9(Z,Q))return"home";if(i9(Z,z))return"root";return null}function fq($=process.cwd()){return uq($)!==null}import{existsSync as mq,statSync as n9}from"fs";import{dirname as pq,join as lq}from"path";var cq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],dq=1000;function iq($,Z=pq($)){let Q=n9($).mtimeMs,z=cq.map((X)=>{let U=lq(Z,X);if(!mq(U))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let H=n9(U).mtimeMs,J=H-Q,G;if(Math.abs(J)<dq)G="in-sync";else if(J>0)G="newer";else G="older";return{file:X,exists:!0,mtime_ms:H,status:G,delta_ms:J}});return{source:$,source_mtime_ms:Q,targets:z,drifted:z.filter((X)=>X.status==="newer"||X.status==="older").length,in_sync:z.filter((X)=>X.status==="in-sync").length,missing:z.filter((X)=>X.status==="missing").length}}import{join as BK}from"path";import{deprecate as qK}from"node:util";import{createHash as tq}from"crypto";import{resolve as eq}from"path";class L2 extends Error{constructor($){super($);this.name="JsonEditError"}}var nq=new Set([" ","\t",`
161
- `,"\r"]);class y4{s;i=0;constructor($){this.s=$}parse(){if(this.s.startsWith("\uFEFF"))this.i=1;let $=this.value();if(this.ws(),this.i!==this.s.length)this.fail("text after the end of the JSON value");return $}fail($){throw new L2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&nq.has(this.s[this.i]))this.i++}value(){this.ws();let $=this.s[this.i];if($==="{")return this.object();if($==="[")return this.array();if($==='"'){let Z=this.i;return this.string(),{kind:"string",start:Z,end:this.i,members:[],items:[]}}if($==="-"||$>="0"&&$<="9")return this.number();for(let Z of["true","false","null"])if(this.s.startsWith(Z,this.i)){let Q=this.i;return this.i+=Z.length,{kind:"literal",start:Q,end:this.i,members:[],items:[]}}return this.fail($===void 0?"unexpected end":`unexpected ${JSON.stringify($)}`)}object(){let $=this.i++,Z=[];if(this.ws(),this.s[this.i]==="}")return this.i++,{kind:"object",start:$,end:this.i,members:Z,items:[]};for(;;){if(this.ws(),this.s[this.i]!=='"')this.fail("expected a key");let Q=this.i,z=this.string(),X=this.i;if(this.ws(),this.s[this.i]!==":")this.fail('expected ":"');if(this.i++,Z.push({key:z,keyStart:Q,keyEnd:X,value:this.value()}),this.ws(),this.s[this.i]===","){this.i++;continue}if(this.s[this.i]==="}")return this.i++,{kind:"object",start:$,end:this.i,members:Z,items:[]};this.fail('expected "," or "}"')}}array(){let $=this.i++,Z=[];if(this.ws(),this.s[this.i]==="]")return this.i++,{kind:"array",start:$,end:this.i,members:[],items:Z};for(;;){if(Z.push(this.value()),this.ws(),this.s[this.i]===","){this.i++;continue}if(this.s[this.i]==="]")return this.i++,{kind:"array",start:$,end:this.i,members:[],items:Z};this.fail('expected "," or "]"')}}string(){let $=this.i++;for(;;){let Z=this.s[this.i];if(Z===void 0)this.fail("unterminated string");if(Z==='"')break;if(Z<" ")this.fail("control character in a string");if(Z==="\\"){let Q=this.s[this.i+1];if(Q==="u"){if(!/^[0-9a-fA-F]{4}$/.test(this.s.slice(this.i+2,this.i+6)))this.fail("bad \\u escape");this.i+=6;continue}if(!'"\\/bfnrt'.includes(Q??"x"))this.fail("bad escape");this.i+=2;continue}this.i++}return this.i++,JSON.parse(this.s.slice($,this.i))}number(){let $=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(this.s.slice(this.i));if(!$)this.fail("bad number");let Z=this.i;return this.i+=$[0].length,{kind:"number",start:Z,end:this.i,members:[],items:[]}}}var E4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function b4($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>b4(Q,Z[z]));if(E4($)&&E4(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&b4($[z],Z[z]))}return!1}class r9{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
157
+ `,W=Fq(X,H,U,Y,{...G,verifyAliasOrder:!1}),B=W!==null&&Rq(W,U,V,G),K=B&&W!==null?W:V.replace(/\r?\n/g,Y);return{text:z+K,changed:z+K!==$,spliced:B}}function Tq($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function l($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>l(Q,Z[z]));if(u($)&&u(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&l($[z],Z[z]))}return!1}function s$($){let Z=s($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function Q2($,Z){return $.items.find((Q)=>s$(Q)===Z)}function A9($,Z){return L0(Z)?Z.toJS($):Z}function Aq($,Z,Q,z){return z.keepAliases===!0&&u0(Z)||l(A9($,Z),Q)}function K8($,Z,Q,z={}){if(Aq($,Z,Q,z))return Z;if(u(Q)&&p(Z))return jq($,Z,Q,z),Z;if(Array.isArray(Q)&&f0(Z))return Eq($,Z,Q,z),Z;if(!u(Q)&&!Array.isArray(Q)&&s(Z))return Z.value=Q,Z;return Cq(Z,$.createNode(Q))}function Cq($,Z){if(!s($)&&!u0($))return Z;let Q=$,z=Z;if(B2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=NZ(z.commentBefore,Q.commentBefore,Q.comment),Z;if(B2(Z))Z.flow=!0;return z.comment=NZ(z.comment??Q.comment),z.commentBefore=NZ(z.commentBefore??Q.commentBefore),Z}function NZ(...$){let Z=$.filter(_0);return Z.length>0?Z.join(`
158
+ `):void 0}function jq($,Z,Q,z={}){for(let[X,H]of Object.entries(Q)){if(H===void 0)continue;let U=Q2(Z,X);if(U)U.value=K8($,U.value,H,z);else Z.items.push($.createPair(X,H))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let H=s$(X);return H===void 0||Q[H]!==void 0})}function bZ($,Z,Q,z){let X=u(Q)?Q:{};for(let[H,U]of Object.entries(z)){if(U===void 0)continue;let J=Q2(Z,H);if(!J)Z.items.push($.createPair(H,U));else if(Object.prototype.hasOwnProperty.call(X,H)&&l(X[H],U))continue;else if(u(U)&&u(X[H])&&p(J.value))bZ($,J.value,X[H],U);else J.value=K8($,J.value,U,{keepAliases:!0})}}function r$($,Z,Q){if(u0($))Q.push({path:[...Z],node:$});else if(p($))for(let z of $.items){let X=s$(z);if(X!==void 0)r$(z.value,[...Z,X],Q)}else if(f0($))$.items.forEach((z,X)=>r$(z,[...Z,X],Q))}function K9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(u(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function C9($,Z,Q){let z=[];return r$($.contents,[],z),z.filter(({path:X,node:H})=>{let U=K9(Z,X);return U!==void 0&&!l(K9(Q,X),U)&&!l(H.toJS($),U)}).map(({path:X,node:H})=>({path:X.join("."),alias:`*${H.source}`}))}function j9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=wq(Q,Z[X]);let z=Z[Z.length-1];if(p(Q)&&typeof z==="string"){let X=Q2(Q,z);return X?{node:X.value,put:(H)=>(X.value=H,!0)}:null}if(f0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,H=X.items[z];return{node:H,put:(U)=>X0(H)===void 0?(X.items[z]=U,!0):!1}}return null}function wq($,Z){if(p($)&&typeof Z==="string")return Q2($,Z)?.value;if(f0($)&&typeof Z==="number")return $.items[Z];return}function w9($,Z){let Q=[];r$($.contents,[],Q);let z=[];for(let{path:X,node:H}of Q){let U=j9(Z,X);if(!U||u0(U.node)&&U.node.source===H.source)continue;if(!U.put(H.clone()))continue;z.push({path:X.join("."),alias:`*${H.source}`})}return z}function CZ($,Z,Q,z){if(!L0($)||u0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(p($))for(let H of $.items){let U=s$(H);if(U!==void 0)CZ(H.value,[...Z,U],Q,z)}else if(f0($))$.items.forEach((H,U)=>CZ(H,[...Z,U],Q,z))}function S9($,Z){let Q=[];r$($.contents,[],Q);let z=new Set(Q.map((U)=>U.node.source));if(z.size===0)return[];let X=[];CZ($.contents,[],z,X);let H=[];for(let{path:U,node:J}of X){let G=j9(Z,U);if(!G)continue;let V=J.anchor;if(L0(G.node)&&G.node.anchor===V&&l(J.toJS($),G.node.toJS(Z))||!G.put(J.clone()))continue;H.push({path:U.join("."),alias:`&${V}`,kind:"anchor"})}return H}function Sq($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let U=Q-1;U>=0;U--)for(let J=z-1;J>=0;J--)X[U][J]=l($[U],Z[J])?X[U+1][J+1]+1:Math.max(X[U+1][J],X[U][J+1]);let H=[];for(let U=0,J=0;U<Q&&J<z;)if(l($[U],Z[J]))H.push([U,J]),U++,J++;else if(X[U+1][J]>=X[U][J+1])U++;else J++;return H}function Eq($,Z,Q,z){let X=Z.items,H=X.map((V)=>A9($,V)),U=[],J=0,G=0;for(let[V,Y]of[...Sq(H,Q),[X.length,Q.length]]){for(;J<V&&G<Y;J++,G++)U.push(K8($,X[J],Q[G],z));for(;G<Y;G++)U.push($.createNode(Q[G]));if(V<X.length)U.push(X[V]);J=V+1,G=Y+1}Z.items=U}function o$($,Z,Q,z){if(l(Q,z))return Z;if(!u(Q)||!u(z)||!p(Z))return K8($,Z,z);let X=new Set(Object.keys(Q).filter((H)=>!(H in z)||z[H]===void 0));Z.items=Z.items.filter((H)=>{let U=s$(H);return U===void 0||!X.has(U)});for(let[H,U]of Object.entries(z)){if(U===void 0)continue;let J=Q2(Z,H);if(!J)Z.items.push($.createPair(H,U));else if(!l(Q[H],U))J.value=o$($,J.value,Q[H],U)}return Z}function E9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new r2,z=$.contents;if(!p(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let H of Z){let U=Q2(X,H);if(U&&p(U.value)){X=U.value;continue}if(U&&!x9(U.value))throw Error(`${Q}: ${H} is not a mapping — faf left it unchanged.`);let J=new r2;if(U)U.value=y9(U.value,J);else X.items.push($.createPair(H,J));X=J}return X}function D8($,Z,Q,z,X){if(l(Q,z))return;let H=E9($,Z.slice(0,-1),X),U=Z[Z.length-1],J=Q2(H,U);if(z===void 0)H.items=H.items.filter((G)=>G!==J);else if(!J)H.items.push($.createPair(U,z));else J.value=o$($,J.value,Q,z)}function b9($,Z,Q){let z=E9($,Z.slice(0,-1),Q),X=Z[Z.length-1],H=Q2(z,X);if(H&&f0(H.value))return H.value;if(H&&!x9(H.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let U=new p$;if(H)H.value=y9(H.value,U);else z.items.push($.createPair(X,U));return U}function y9($,Z){if(!s($))return Z;let Q=[$.commentBefore,$.comment].filter(_0);if(Q.length>0)Z.commentBefore=Q.join(`
159
+ `);return Z}function x9($){if($===null||$===void 0)return!0;return s($)&&($.value===null||$.value===void 0)}var yZ=new WeakMap;function a$($){return typeof $==="object"&&$!==null?yZ.get($):void 0}function L8($,Z){yZ.set($,Z)}function g9($,Z){let Q=a$($);if(Q)yZ.set(Z,Q);return Z}var v9=new WeakSet;function k9($){return v9.add($),$}function h9($){return typeof $==="object"&&$!==null&&v9.has($)}function I8($){let Z=t$($);return h(xZ(Z),Z,{read:!0})}function l9($){if($ instanceof G8)return $;let Z=$?.cause;return Z instanceof G8?Z:null}function c9($,Z){let Q=Z.message.split(`
160
+ `)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=t$($);return new b("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function bq($){let Z=I8($),Q=Z0(Z),z;try{z=m0(Q)}catch(H){let U=l9(H);if(U)throw c9($,U);throw H}let X=Y8(z,$);return L8(X,{real:Z,text:Q}),X}function d9($){let Z=$._meta,Q={...$};delete Q._meta;let z=q2(Q,{lineWidth:0});if(Z?.found&&Z.found.length>0){let X=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(H,U,J)=>{if(J.includes("#"))return H;return`${U} # found: ${X}`})}return z}function yq($,Z){return i9($,Z,void 0)}function i9($,Z,Q,z,X=!1){let H=I8($),U=Z0(H),J=[],G;try{G=q8(U,(V)=>{n9(V,$);let Y=V.clone();if(Z(V),J=w9(Y,V),X)J=[...J,...S9(Y,V)];if(z)J=[...J,...z(V,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(V){let Y=l9(V);if(Y)throw c9($,Y);throw V}if(!G.changed)return{written:!1,text:U,keptAliases:J};return e($,G.text,{expect:Q&&Q.real===H?Q.text:U}),{written:!0,text:G.text,keptAliases:J}}function f9($){try{return p9($),!0}catch{return!1}}function xq($){let Z=$.getIn(["project","type"],!0);return s(Z)?Z.value:Z}function n9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!p(Q))throw new b("not-yaml",t$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${d$($.toJS())}. faf left it unchanged — fix it by hand.`)}function gq($,Z,Q){n9($,Q);let z=$.contents,X=p(z)&&z.items.some((Y)=>s(Y.key)&&Y.key.value==="_meta"),{_meta:H,...U}=Z,J=xq($),G=p(z)?$.toJS():{},V=p(z)?z:$.createNode({});if($.contents=V,bZ($,V,G,X?{...Z}:U),!X)kq($,H?.found,J)}function vq($,Z){let Q=$.contents;if(p(Q)&&Q.items.some((H)=>s(H.key)&&H.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function kq($,Z,Q){if(!Z||Z.length===0||!o(Q))return;let z=$.getIn(["project","type"],!0);if(s(z)&&!o(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function hq($,Z,Q={}){if(!Q.replace&&f9($)){let J=i9($,(G)=>gq(G,Z,$),a$(Z),(G,V)=>C9(G,vq(G,Z),V),h9(Z));L8(Z,{real:I8($),text:J.text});for(let G of J.keptAliases??[])Q.onAliasKept?.(G);return J.written}let z=t$($),X=d9(Z),H=f9($)?I0(h(xZ(z),z)):null,U=e($,X,{expect:H});return L8(Z,{real:U,text:X}),!0}function r9($){return Z0(I8($))}function m9($,Z){let Q;try{Q=p9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return h($,t$(Z),{read:!0}),!0}function s9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=u9($,z);if(m9($,X))return X}let Q=xZ($);if(Q!==$)for(let z of Z){let X=u9(Q,z);if(m9(Q,X))return X}return null}import{statSync as o9}from"fs";import{homedir as uq}from"os";import{parse as fq,resolve as a9}from"path";function t9($,Z){try{let Q=o9($,{bigint:!0}),z=o9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function mq($){let Z=a9($),Q=a9(uq()),z=fq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(t9(Z,Q))return"home";if(t9(Z,z))return"root";return null}function pq($=process.cwd()){return mq($)!==null}import{existsSync as lq,statSync as e9}from"fs";import{dirname as cq,join as dq}from"path";var iq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],nq=1000;function rq($,Z=cq($)){let Q=e9($).mtimeMs,z=iq.map((X)=>{let H=dq(Z,X);if(!lq(H))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let U=e9(H).mtimeMs,J=U-Q,G;if(Math.abs(J)<nq)G="in-sync";else if(J>0)G="newer";else G="older";return{file:X,exists:!0,mtime_ms:U,status:G,delta_ms:J}});return{source:$,source_mtime_ms:Q,targets:z,drifted:z.filter((X)=>X.status==="newer"||X.status==="older").length,in_sync:z.filter((X)=>X.status==="in-sync").length,missing:z.filter((X)=>X.status==="missing").length}}import{join as KK}from"path";import{deprecate as DK}from"node:util";import{createHash as $K}from"crypto";import{resolve as ZK}from"path";class L2 extends Error{constructor($){super($);this.name="JsonEditError"}}var sq=new Set([" ","\t",`
161
+ `,"\r"]);class kZ{s;i=0;constructor($){this.s=$}parse(){if(this.s.startsWith("\uFEFF"))this.i=1;let $=this.value();if(this.ws(),this.i!==this.s.length)this.fail("text after the end of the JSON value");return $}fail($){throw new L2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&sq.has(this.s[this.i]))this.i++}value(){this.ws();let $=this.s[this.i];if($==="{")return this.object();if($==="[")return this.array();if($==='"'){let Z=this.i;return this.string(),{kind:"string",start:Z,end:this.i,members:[],items:[]}}if($==="-"||$>="0"&&$<="9")return this.number();for(let Z of["true","false","null"])if(this.s.startsWith(Z,this.i)){let Q=this.i;return this.i+=Z.length,{kind:"literal",start:Q,end:this.i,members:[],items:[]}}return this.fail($===void 0?"unexpected end":`unexpected ${JSON.stringify($)}`)}object(){let $=this.i++,Z=[];if(this.ws(),this.s[this.i]==="}")return this.i++,{kind:"object",start:$,end:this.i,members:Z,items:[]};for(;;){if(this.ws(),this.s[this.i]!=='"')this.fail("expected a key");let Q=this.i,z=this.string(),X=this.i;if(this.ws(),this.s[this.i]!==":")this.fail('expected ":"');if(this.i++,Z.push({key:z,keyStart:Q,keyEnd:X,value:this.value()}),this.ws(),this.s[this.i]===","){this.i++;continue}if(this.s[this.i]==="}")return this.i++,{kind:"object",start:$,end:this.i,members:Z,items:[]};this.fail('expected "," or "}"')}}array(){let $=this.i++,Z=[];if(this.ws(),this.s[this.i]==="]")return this.i++,{kind:"array",start:$,end:this.i,members:[],items:Z};for(;;){if(Z.push(this.value()),this.ws(),this.s[this.i]===","){this.i++;continue}if(this.s[this.i]==="]")return this.i++,{kind:"array",start:$,end:this.i,members:[],items:Z};this.fail('expected "," or "]"')}}string(){let $=this.i++;for(;;){let Z=this.s[this.i];if(Z===void 0)this.fail("unterminated string");if(Z==='"')break;if(Z<" ")this.fail("control character in a string");if(Z==="\\"){let Q=this.s[this.i+1];if(Q==="u"){if(!/^[0-9a-fA-F]{4}$/.test(this.s.slice(this.i+2,this.i+6)))this.fail("bad \\u escape");this.i+=6;continue}if(!'"\\/bfnrt'.includes(Q??"x"))this.fail("bad escape");this.i+=2;continue}this.i++}return this.i++,JSON.parse(this.s.slice($,this.i))}number(){let $=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(this.s.slice(this.i));if(!$)this.fail("bad number");let Z=this.i;return this.i+=$[0].length,{kind:"number",start:Z,end:this.i,members:[],items:[]}}}var gZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function vZ($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>vZ(Q,Z[z]));if(gZ($)&&gZ(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&vZ($[z],Z[z]))}return!1}class $Q{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
162
162
  `,$-1);return Z>=0&&/^[ \t]*$/.test(this.s.slice(Z+1,$))}indentOf($){return this.startsLine($)?this.s.slice(this.s.lastIndexOf(`
163
163
  `,$-1)+1,$):""}render($,Z,Q){if(!Q)return JSON.stringify($);return JSON.stringify($,null,this.style.unit).split(`
164
- `).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[U,H]of Object.entries(Z)){if(H===void 0)continue;let J=Q?`${Q}.${U}`:U,G=$.members.filter((B)=>B.key===U);if(G.length>1)throw new L2(`the key "${J}" is there more than once`);let V=G[0];if(!V){if($.members.length===0)X[U]=H;else this.insert($,U,H,Q);continue}let Y=this.startsLine(V.keyStart);if(E4(H)){if(V.value.kind!=="object")throw new L2(`"${J}" is not an object, so faf cannot add its keys to it`);this.apply(V.value,H,J,Y||this.s.slice(V.value.start,V.value.end).includes(`
165
- `));continue}let W=JSON.parse(this.s.slice(V.value.start,V.value.end));if(b4(W,H))continue;if(V.value.kind==="object"||V.value.kind==="array")throw new L2(`"${J}" is ${V.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:V.value.start,end:V.value.end,text:this.render(H,this.indentOf(V.keyStart),Y)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,U=X[X.length-1],J=(this.after[z]?.[Z]??[]).map((W)=>X.find((B)=>B.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=J&&J!==U?X[X.indexOf(J)+1]:U,B=this.indentOf(W.keyStart),K=this.s.slice(W.keyEnd,W.value.start),L=this.s.lastIndexOf(`
166
- `,W.keyStart-1),q=L>0&&this.s[L-1]==="\r"?L-1:L,D=`${this.style.eol}${B}${JSON.stringify(Z)}${K}${this.render(Q,B,!0)},`;this.edits.push({start:q,end:q,text:D});return}let G=J??U,V=this.s.slice(G.keyEnd,G.value.start),Y=X.length>1?this.s.slice(X[0].value.end,X[1].keyStart):", ";this.edits.push({start:G.value.end,end:G.value.end,text:`${Y}${JSON.stringify(Z)}${V}${this.render(Q,"",!1)}`})}append($,Z,Q,z){if(Z.length===0)return;if($.items.length===0){this.edits.push({start:$.start,end:$.end,text:this.render(Z,this.indentOf(Q),z)});return}let X=$.items[$.items.length-1];if(this.startsLine($.items[0].start)){let H=this.indentOf($.items[0].start),J=Z.map((G)=>`,${this.style.eol}${H}${this.render(G,H,!0)}`).join("");this.edits.push({start:X.end,end:X.end,text:J});return}let U=$.items.length>1?this.s.slice($.items[0].end,$.items[1].start):", ";this.edits.push({start:X.end,end:X.end,text:Z.map((H)=>`${U}${this.render(H,"",!1)}`).join("")})}lineLead($){let Z=this.s.lastIndexOf(`
167
- `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function rq($,Z){let Q=$.includes(`\r
164
+ `).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[H,U]of Object.entries(Z)){if(U===void 0)continue;let J=Q?`${Q}.${H}`:H,G=$.members.filter((B)=>B.key===H);if(G.length>1)throw new L2(`the key "${J}" is there more than once`);let V=G[0];if(!V){if($.members.length===0)X[H]=U;else this.insert($,H,U,Q);continue}let Y=this.startsLine(V.keyStart);if(gZ(U)){if(V.value.kind!=="object")throw new L2(`"${J}" is not an object, so faf cannot add its keys to it`);this.apply(V.value,U,J,Y||this.s.slice(V.value.start,V.value.end).includes(`
165
+ `));continue}let W=JSON.parse(this.s.slice(V.value.start,V.value.end));if(vZ(W,U))continue;if(V.value.kind==="object"||V.value.kind==="array")throw new L2(`"${J}" is ${V.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:V.value.start,end:V.value.end,text:this.render(U,this.indentOf(V.keyStart),Y)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,H=X[X.length-1],J=(this.after[z]?.[Z]??[]).map((W)=>X.find((B)=>B.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=J&&J!==H?X[X.indexOf(J)+1]:H,B=this.indentOf(W.keyStart),K=this.s.slice(W.keyEnd,W.value.start),L=this.s.lastIndexOf(`
166
+ `,W.keyStart-1),q=L>0&&this.s[L-1]==="\r"?L-1:L,D=`${this.style.eol}${B}${JSON.stringify(Z)}${K}${this.render(Q,B,!0)},`;this.edits.push({start:q,end:q,text:D});return}let G=J??H,V=this.s.slice(G.keyEnd,G.value.start),Y=X.length>1?this.s.slice(X[0].value.end,X[1].keyStart):", ";this.edits.push({start:G.value.end,end:G.value.end,text:`${Y}${JSON.stringify(Z)}${V}${this.render(Q,"",!1)}`})}append($,Z,Q,z){if(Z.length===0)return;if($.items.length===0){this.edits.push({start:$.start,end:$.end,text:this.render(Z,this.indentOf(Q),z)});return}let X=$.items[$.items.length-1];if(this.startsLine($.items[0].start)){let U=this.indentOf($.items[0].start),J=Z.map((G)=>`,${this.style.eol}${U}${this.render(G,U,!0)}`).join("");this.edits.push({start:X.end,end:X.end,text:J});return}let H=$.items.length>1?this.s.slice($.items[0].end,$.items[1].start):", ";this.edits.push({start:X.end,end:X.end,text:Z.map((U)=>`${H}${this.render(U,"",!1)}`).join("")})}lineLead($){let Z=this.s.lastIndexOf(`
167
+ `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function oq($,Z){let Q=$.includes(`\r
168
168
  `)?`\r
169
169
  `:`
170
170
  `,z=Z.members[0],X=z?$.lastIndexOf(`
171
- `,z.keyStart-1):-1,U=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(U)?U:" "}}function o$($,Z,Q={}){let z=new y4($).parse();if(z.kind!=="object")throw new L2("the JSON is not an object");let X=new r9($,rq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
- `)),s9($,X.edits)}function s9($,Z){if(Z.length===0)return{text:$,changed:!1};let Q=Z.map((X,U)=>({e:X,i:U})).sort((X,U)=>U.e.start-X.e.start||U.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function sq($){let Z=new y4($).parse();if(Z.kind!=="object")throw new L2("the JSON is not an object");return Z}function oq($,Z){let Q=$.lastIndexOf(`
173
- `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function aq($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(oq($,Q.keyStart)&&$[Q.value.end]===","){let X=$.lastIndexOf(`
174
- `,Q.keyStart-1);return{start:X>0&&$[X-1]==="\r"?X-1:X,end:Q.value.end+1,text:""}}if(z>0)return{start:Z.members[z-1].value.end,end:Q.value.end,text:""};return{start:Q.keyStart,end:Z.members[1].keyStart,text:""}}function o9($,Z){let Q=[],z=sq($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let U=z.members.filter((H)=>H.key===X);if(U.length!==1)return{count:U.length,chain:Q};Q.push({obj:z,member:U[0]}),z=U[0].value}return{count:1,chain:Q}}function a9($,Z){let{count:Q,chain:z}=o9($,Z);if(Q!==1)return{count:Q};let X=z[z.length-1].member.value;return{count:Q,value:JSON.parse($.slice(X.start,X.end))}}function x4($,Z,Q={}){let{count:z,chain:X}=o9($,Z);if(z!==1||X.length===0)return null;let U=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&U.obj.members.length===1)U=X[X.length-2];return s9($,[aq($,U.obj,U.member)]).text}var e9="one.faf/render";function v4($){return`sha256:${tq("sha256").update($,"utf8").digest("hex")}`}var $K=/^sha256:[0-9a-f]{64}$/,ZK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,QK='<meta name="faf-render"',zK='<meta name="description" content="Visual render of project.faf.';function XK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(zK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${v4($)}">
175
- `),Z.join("")}function $Q($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,U)=>{let H=X.replace(/\r?\n$/,""),J=ZK.exec(H);if(J)Q.push({at:U,hash:J[1]});else if(H.startsWith(QK))z=!0}),Q.length===0&&!z)return null;if(Q.length!==1||z)return"many";return Z.splice(Q[0].at,1),{hash:Q[0].hash,canonical:Z.join("")}}var g4=["_meta",e9];function UK($){return o$($,{_meta:{[e9]:v4($)}}).text}function HK($){try{return x4($,g4,{dropEmptyParent:!0})??$}catch{return $}}function JK($){let Z;try{Z=a9($,g4)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!$K.test(Z.value))return"many";let Q=x4($,g4,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function ZQ($,Z){return $==="html"?XK(Z):UK(Z)}function GK($,Z){if($==="json")return HK(Z);let Q=$Q(Z);return Q===null||Q==="many"?Z:Q.canonical}function t9($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?$Q(Q):JK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===v4(z.canonical)&&ZQ(Z,z.canonical)===Q?"match":"mismatch"}function VK($){let Z=new TextDecoder().decode($);if(!Z.includes(`\r
171
+ `,z.keyStart-1):-1,H=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(H)?H:" "}}function e$($,Z,Q={}){let z=new kZ($).parse();if(z.kind!=="object")throw new L2("the JSON is not an object");let X=new $Q($,oq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
+ `)),ZQ($,X.edits)}function ZQ($,Z){if(Z.length===0)return{text:$,changed:!1};let Q=Z.map((X,H)=>({e:X,i:H})).sort((X,H)=>H.e.start-X.e.start||H.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function aq($){let Z=new kZ($).parse();if(Z.kind!=="object")throw new L2("the JSON is not an object");return Z}function tq($,Z){let Q=$.lastIndexOf(`
173
+ `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function eq($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(tq($,Q.keyStart)&&$[Q.value.end]===","){let X=$.lastIndexOf(`
174
+ `,Q.keyStart-1);return{start:X>0&&$[X-1]==="\r"?X-1:X,end:Q.value.end+1,text:""}}if(z>0)return{start:Z.members[z-1].value.end,end:Q.value.end,text:""};return{start:Q.keyStart,end:Z.members[1].keyStart,text:""}}function QQ($,Z){let Q=[],z=aq($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let H=z.members.filter((U)=>U.key===X);if(H.length!==1)return{count:H.length,chain:Q};Q.push({obj:z,member:H[0]}),z=H[0].value}return{count:1,chain:Q}}function zQ($,Z){let{count:Q,chain:z}=QQ($,Z);if(Q!==1)return{count:Q};let X=z[z.length-1].member.value;return{count:Q,value:JSON.parse($.slice(X.start,X.end))}}function hZ($,Z,Q={}){let{count:z,chain:X}=QQ($,Z);if(z!==1||X.length===0)return null;let H=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&H.obj.members.length===1)H=X[X.length-2];return ZQ($,[eq($,H.obj,H.member)]).text}var HQ="one.faf/render";function fZ($){return`sha256:${$K("sha256").update($,"utf8").digest("hex")}`}var QK=/^sha256:[0-9a-f]{64}$/,zK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,XK='<meta name="faf-render"',HK='<meta name="description" content="Visual render of project.faf.';function UK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(HK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${fZ($)}">
175
+ `),Z.join("")}function UQ($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,H)=>{let U=X.replace(/\r?\n$/,""),J=zK.exec(U);if(J)Q.push({at:H,hash:J[1]});else if(U.startsWith(XK))z=!0}),Q.length===0&&!z)return null;if(Q.length!==1||z)return"many";return Z.splice(Q[0].at,1),{hash:Q[0].hash,canonical:Z.join("")}}var uZ=["_meta",HQ];function JK($){return e$($,{_meta:{[HQ]:fZ($)}}).text}function GK($){try{return hZ($,uZ,{dropEmptyParent:!0})??$}catch{return $}}function VK($){let Z;try{Z=zQ($,uZ)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!QK.test(Z.value))return"many";let Q=hZ($,uZ,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function JQ($,Z){return $==="html"?UK(Z):JK(Z)}function YK($,Z){if($==="json")return GK(Z);let Q=UQ(Z);return Q===null||Q==="many"?Z:Q.canonical}function XQ($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?UQ(Q):VK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===fZ(z.canonical)&&JQ(Z,z.canonical)===Q?"match":"mismatch"}function WK($){let Z=new TextDecoder().decode($);if(!Z.includes(`\r
176
176
  `)||/(?:^|[^\r])\n/.test(Z)||!Buffer.from(Z,"utf-8").equals($))return null;return Buffer.from(Z.replace(/\r\n/g,`
177
- `),"utf-8")}function YK($,Z,Q){let z=t9($,Q);return z!=="match"&&Z!==null&&t9(Z,Q)==="match"?"match":z}function a$($,Z,Q){let z=eq($),X=h(Q.root,z),U=GK(Q.format,Z),H=ZQ(Q.format,U),J=I0(X);if(J===null)return e(X,H,{root:Q.root,expect:null}),{path:X,result:"created"};if(J.equals(Buffer.from(H,"utf-8")))return{path:X,result:"unchanged"};let G=VK(J),V=G===null?H:H.replace(/\r?\n/g,`\r
178
- `);if(G!==null&&J.equals(Buffer.from(V,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!WK(z,J,G,U,Q))return{path:X,result:"unchanged"};return e(X,V,{root:Q.root,expect:J}),{path:X,result:"updated"}}function WK($,Z,Q,z,X){let U=YK(Z,Q,X.format);if(U==="match")return!0;if(U==="mismatch")throw new b("not-owned",$,`${$} was edited since faf wrote it — faf left it unchanged. Use --force to replace it.`,{onWrite:!0});if(!X.hasMark(Z))throw new b("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let H=Buffer.from(z,"utf-8");if(Z.equals(H)||Q!==null&&Q.equals(H))return!1;throw new b("not-owned",$,`${$} has no faf render hash (written before 7.13), so faf cannot tell whether it was edited — faf left it unchanged. Use --force once to replace it; after that faf recognises its own output.`,{onWrite:!0})}var QQ=q$.orange,KK=q$.cyan,DK=q$.cyanDeep,LK="#FF9500",IK="#FF3B30",MK="#E6EDF3",OK="#6E7681",zQ={TROPHY:{glyph:"✪",color:QQ},GOLD:{glyph:"★",color:QQ},SILVER:{glyph:"◆",color:KK},BRONZE:{glyph:"◇",color:DK},GREEN:{glyph:"●",color:MK},YELLOW:{glyph:"●",color:LK},RED:{glyph:"○",color:IK},WHITE:{glyph:"♡",color:OK}};function e2($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var XQ=["who","what","why","where","when","how"];function M8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${e2(Z)}</div><div class="v">${e2(Q)}</div></div>`).join(`
179
- `)}function k4($,Z,Q="project.faf"){let z=e2($.project?.name??"Project"),X=Z.tier?.name??"WHITE",U=zQ[X]??zQ.WHITE,H=Z.inherited?Z.represents?`inherited from ${e2(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,G=$.human_context??{},V=XQ.map((q)=>[q,G[q]]),Y=Object.entries(G).filter(([q])=>!XQ.includes(q)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],B=Object.entries($.stack??{}),K=B.filter(([,q])=>q&&q!=="slotignored"&&String(q).trim()!==""),L=B.filter(([,q])=>q==="slotignored").length;return`<!DOCTYPE html>
177
+ `),"utf-8")}function BK($,Z,Q){let z=XQ($,Q);return z!=="match"&&Z!==null&&XQ(Z,Q)==="match"?"match":z}function $6($,Z,Q){let z=ZK($),X=h(Q.root,z),H=YK(Q.format,Z),U=JQ(Q.format,H),J=I0(X);if(J===null)return e(X,U,{root:Q.root,expect:null}),{path:X,result:"created"};if(J.equals(Buffer.from(U,"utf-8")))return{path:X,result:"unchanged"};let G=WK(J),V=G===null?U:U.replace(/\r?\n/g,`\r
178
+ `);if(G!==null&&J.equals(Buffer.from(V,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!qK(z,J,G,H,Q))return{path:X,result:"unchanged"};return e(X,V,{root:Q.root,expect:J}),{path:X,result:"updated"}}function qK($,Z,Q,z,X){let H=BK(Z,Q,X.format);if(H==="match")return!0;if(H==="mismatch")throw new b("not-owned",$,`${$} was edited since faf wrote it — faf left it unchanged. Use --force to replace it.`,{onWrite:!0});if(!X.hasMark(Z))throw new b("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let U=Buffer.from(z,"utf-8");if(Z.equals(U)||Q!==null&&Q.equals(U))return!1;throw new b("not-owned",$,`${$} has no faf render hash (written before 7.13), so faf cannot tell whether it was edited — faf left it unchanged. Use --force once to replace it; after that faf recognises its own output.`,{onWrite:!0})}var GQ=L$.orange,LK=L$.cyan,IK=L$.cyanDeep,OK="#FF9500",_K="#FF3B30",MK="#E6EDF3",PK="#6E7681",VQ={TROPHY:{glyph:"✪",color:GQ},GOLD:{glyph:"★",color:GQ},SILVER:{glyph:"◆",color:LK},BRONZE:{glyph:"◇",color:IK},GREEN:{glyph:"●",color:MK},YELLOW:{glyph:"●",color:OK},RED:{glyph:"○",color:_K},WHITE:{glyph:"♡",color:PK}};function Z$($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var YQ=["who","what","why","where","when","how"];function O8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${Z$(Z)}</div><div class="v">${Z$(Q)}</div></div>`).join(`
179
+ `)}function mZ($,Z,Q="project.faf"){let z=Z$($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=VQ[X]??VQ.WHITE,U=Z.inherited?Z.represents?`inherited from ${Z$(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,G=$.human_context??{},V=YQ.map((q)=>[q,G[q]]),Y=Object.entries(G).filter(([q])=>!YQ.includes(q)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],B=Object.entries($.stack??{}),K=B.filter(([,q])=>q&&q!=="slotignored"&&String(q).trim()!==""),L=B.filter(([,q])=>q==="slotignored").length;return`<!DOCTYPE html>
180
180
  <html lang="en">
181
181
  <head>
182
182
  <meta charset="UTF-8">
@@ -188,19 +188,19 @@ ${G}`).replace(/\n/g,$.eol);return{inline:J,text:J?H.slice(1):V}}function P4($,Z
188
188
  *{margin:0;padding:0;box-sizing:border-box}
189
189
  body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#0a0a0a;color:#e6edf3;line-height:1.55;padding:48px 20px}
190
190
  .wrap{max-width:880px;margin:0 auto}
191
- .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${U.color},transparent);margin-bottom:40px}
191
+ .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${H.color},transparent);margin-bottom:40px}
192
192
  header{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:8px}
193
193
  h1{font-size:2.2rem;font-weight:800;letter-spacing:-1px}
194
- .badge{font-size:1.05rem;font-weight:800;color:${U.color};white-space:nowrap}
194
+ .badge{font-size:1.05rem;font-weight:800;color:${H.color};white-space:nowrap}
195
195
  .score{font-size:1.05rem;font-weight:700;color:#8b949e}
196
196
  .eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:#6e7681;margin-bottom:36px}
197
197
  section{margin-bottom:34px}
198
- h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${U.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
198
+ h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${H.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
199
199
  .row{display:flex;gap:18px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.04)}
200
200
  .k{flex:0 0 150px;color:#8b949e;font-size:.9rem;text-transform:capitalize}
201
201
  .v{flex:1;color:#e6edf3;font-size:.95rem;word-break:break-word}
202
202
  .meter{height:8px;border-radius:4px;background:rgba(255,255,255,.06);overflow:hidden;margin:6px 0 10px}
203
- .meter span{display:block;height:100%;background:${U.color};width:${Math.max(0,Math.min(100,Z.score))}%}
203
+ .meter span{display:block;height:100%;background:${H.color};width:${Math.max(0,Math.min(100,Z.score))}%}
204
204
  .award{font-size:.95rem}
205
205
  .statline{margin-bottom:32px}
206
206
  .awd-pre{color:#6E7681}
@@ -217,68 +217,68 @@ footer strong{color:#e6edf3}
217
217
  <div class="eyebrow">project.faf · visual render</div>
218
218
  <header>
219
219
  <h1>${z}</h1>
220
- <span class="badge">${U.glyph} ${e2(X)}</span>
221
- <span class="score">${H}</span>
220
+ <span class="badge">${H.glyph} ${Z$(X)}</span>
221
+ <span class="score">${U}</span>
222
222
  </header>
223
223
  <div class="meter"><span></span></div>
224
224
  ${J?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy ✪ Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${L?` · ${L} slotignored`:""}</p>`}
225
225
 
226
226
  <section>
227
227
  <h2>The 6 W's</h2>
228
- ${M8(V)||'<p class="muted">No human_context yet.</p>'}
229
- ${Y.length?M8(Y):""}
228
+ ${O8(V)||'<p class="muted">No human_context yet.</p>'}
229
+ ${Y.length?O8(Y):""}
230
230
  </section>
231
231
 
232
232
  <section>
233
233
  <h2>Project</h2>
234
- ${M8(W)||'<p class="muted">—</p>'}
234
+ ${O8(W)||'<p class="muted">—</p>'}
235
235
  </section>
236
236
 
237
237
  <section>
238
238
  <h2>Stack</h2>
239
- ${K.length?M8(K):'<p class="muted">No active stack slots.</p>'}
239
+ ${K.length?O8(K):'<p class="muted">No active stack slots.</p>'}
240
240
  </section>
241
241
 
242
242
  <footer>
243
- Rendered on-demand from your current <strong>${e2(Q)}</strong><br>
243
+ Rendered on-demand from your current <strong>${Z$(Q)}</strong><br>
244
244
  <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
245
245
  </footer>
246
246
  </div>
247
247
  </body>
248
248
  </html>
249
- `}var _K='<meta name="description" content="Visual render of project.faf.';function PK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(_K)&&Z.includes(" by faf"))}function FK($,Z,Q,z="project.faf",X={}){a$(BK($,"project.html"),k4(Z,Q,z),{root:$,format:"html",hasMark:PK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var NK=qK(k4,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as vK}from"path";import{deprecate as kK}from"node:util";var HQ="JSONRPC",t$="1.0",e$=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],_8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",JQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",GQ="1.0",RK="1.0",h4={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function VQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function I2($,Z={}){let Q=VQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:t$}];return[]}function TK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&e$.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function $6($,Z={}){let Q=$.agent??{},z=I2($,Z);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let X=String(Q.displayName??$.metadata?.persona??Q.name??"").trim(),U=String(Q.description??"").trim(),H=String(Q.version??"").trim();if(!X||!U||!H)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let J=String(Q.vendor??"").trim(),G=String(Q.homepage??"").trim(),V=J&&G?{organization:J,url:G}:void 0,Y=($.capabilities??[]).map((W)=>{let B=String(W.name??"").trim();if(!B)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&e$.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:B,name:B,description:String(W.description??"").trim()||B,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:U,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:HQ,protocolVersion:String(W.version??t$)})),...V?{provider:V}:{},version:H,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:TK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var AK=/^[a-z0-9][a-z0-9._-]*$/,CK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function C($){return String($??"").trim()}function O8($){return Array.isArray($)?$.map(C).filter(Boolean):[]}function jK($){return C($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function wK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!C($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!AK.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!CK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function SK($,Z){return($.skills??[]).filter((Q)=>C(Q.name)).map((Q)=>({name:C(Q.name),type:C(Q.type)||"tool",description:C(Q.description)||C(Q.name),tags:Z.length?Z:[C(Q.name).toLowerCase()]}))}function EK($){return($.packages??[]).filter((Z)=>C(Z.registryType)&&C(Z.identifier)).map((Z)=>({registryType:C(Z.registryType),identifier:C(Z.identifier),...C(Z.version)?{version:C(Z.version)}:{}}))}function bK($,Z){let Q=[...($.endpoints??[]).filter((z)=>C(z.url)).map((z)=>({protocol:C(z.protocol).toLowerCase(),transport:"http",location:C(z.url)})),...Z.map((z)=>({protocol:"mcp",transport:"stdio",location:z.identifier}))];if(Q.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return Q}function yK($,Z,Q,z){let X={domain:Z},U=[["repository",C($.repository)],["icon",C($.icon)],["organizationUrl",C($.organization_url)]];for(let[J,G]of U)if(G)X[J]=G;if(Q.length)X.keywords=Q;let H=O8($.example_requests);if(H.length)X.examples=H;if(z.length)X.packages=z;return X}function YQ($){let Z=C($.handle).toLowerCase(),Q=jK($.domain);wK($,Z,Q);let z=O8($.tags),X=EK($),U={name:Z,displayName:C($.display_name),id:`urn:air:${Q}:agent:${Z}`,...C($.organization)?{vendor:C($.organization)}:{},version:C($.version),description:C($.description),homepage:C($.homepage)||`https://${Q}`,...C($.license)?{license:C($.license)}:{}};return{version:RK,agent:U,capabilities:SK($,z),endpoints:bK($,X),metadata:{cards:yK($,Q,z,X)}}}function WQ($){return q2($,{lineWidth:0})}function Q2($){let Z=C($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=C($.metadata?.cards?.domain);if(z)return z;try{return new URL(C($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function BQ($){return u4($)}function u4($){let Z=C($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!Z)throw Error("The .fafa needs agent.name (the short name).");return Z}function qQ($){return`${Q2($).split(".").reverse().join(".")}/${u4($)}`}function UQ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function f4($){return($.endpoints??[]).filter((Z)=>C(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(C(Z.location))).map((Z)=>({type:"streamable-http",url:C(Z.location)}))}function xK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function KQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=C(Z.description),X=C(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let U={name:qQ($),version:X,description:UQ(z)},H=C(Z.displayName);if(H)U.title=UQ(H);let J=C(Z.homepage);if(J)U.websiteUrl=J;let G=xK(C(Q.repository));if(G)U.repository=G;if(C(Q.icon))U.icons=[{src:C(Q.icon)}];return U}function DQ($){let Z=f4($);if(Z.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:_8,...KQ($),remotes:Z}}function LQ($){let Z=f4($),Q=($.metadata?.cards?.packages??[]).map((z)=>({registryType:C(z.registryType),identifier:C(z.identifier),...C(z.version)?{version:C(z.version)}:{},transport:{type:"stdio"}}));if(Z.length===0&&Q.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");return{$schema:JQ,...KQ($),...Q.length?{packages:Q}:{},...Z.length?{remotes:Z}:{}}}function IQ($,Z,Q={}){let z=Q2($),X=u4($),U=$.agent??{},H=C(U.displayName)||C(U.name),J=C(U.description),G=C(U.version),V=Q.now??new Date().toISOString(),Y=(B,K,L)=>({identifier:`urn:air:${z}:${B}:${X}`,displayName:H,type:K,description:J,url:L,...G?{version:G}:{},updatedAt:V}),W=[];if(Z.includes("a2a"))W.push(Y("a2a",h4.a2a,`https://${z}/.well-known/agent-card.json`));if(Z.includes("server_card")){let B=f4($)[0];if(B)W.push(Y("mcp",h4.server_card,`${B.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa)W.push(Y("agent",h4.fafa,`https://${z}/.well-known/fafa`));return W}function P8($){let Z=$.agent??{},Q=C(Z.vendor)||C(Z.displayName)||C(Z.name);if(!Q)return;let z;try{z=Q2($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function MQ($,Z,Q={}){let z=P8($);return{specVersion:GQ,...z?{host:z}:{},entries:IQ($,Z,Q)}}function m4($){let Z=$.metadata?.cards??{},Q=O8(Z.keywords),z=O8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function OQ($,Z,Q={}){let z=P8($),X=m4($);return{specVersion:GQ,...z?{host:z}:{},entries:IQ($,Z,Q).map((U)=>({...U,...X}))}}function _Q($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:WQ($)};if(Q.has("a2a"))z.a2a=$6($,{extensions:Z.a2aExtensions});if(Q.has("server_card"))z.server_card=DQ($);if(Q.has("server_json"))z.server_json=LQ($);let X={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=MQ($,Z.cards,X);if(Q.has("ard"))z.ard=OQ($,Z.cards,X);return z}function gK($,Z){return _Q(YQ($),Z)}var PQ="application/vnd.faf+yaml",hK=_8,uK=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function NQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&uK.test(Z))return Z;let Q=$.project?.homepage??$.project?.website??$.project?.url,z="local";if(Q)try{z=new URL(Q).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let X=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${z}/${X}`}function fK($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function $$($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:PQ,iana:`https://www.iana.org/assignments/media-types/${PQ}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function Z6($,Z={}){let Q={$schema:hK,name:NQ($),version:String($.project?.version??"0.1.0"),description:fK($)},z=F8($)??$.project?.name;if(z&&z.length<=100)Q.title=z;let X=$.project?.homepage??$.project?.website??$.project?.url;if(X)Q.websiteUrl=X;if(Z.remoteUrl)Q.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return Q._meta={"one.faf/context":$$($,Z)},Q}var RQ="io.modelcontextprotocol.registry/publisher-provided",FQ=4096;function l4($,Z={}){let Q={"one.faf/context":$$($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>FQ)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${FQ}B cap`);return{[RQ]:Q}}function c4($){return NQ($)}function F8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function mK($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var p4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function TQ($){let Z=mK($);return p4(Z)&&p4(Z._meta)&&p4(Z._meta["one.faf/context"])}function pK($,Z,Q={},z={}){let X=Z6(Z,Q),U=vK($,"server-card");return a$(U,`${JSON.stringify(X,null,2)}
250
- `,{root:$,format:"json",hasMark:TQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),U}function lK($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return o$($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var cK=kK(Z6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as AQ}from"fs";import{basename as dK,dirname as jQ,join as CQ}from"path";import{deprecate as iK}from"node:util";var d4="https://faf.one/ext/context/v1",nK=["a2a","mcp","registry","catalog","ard"];function rK($){return f0(Z0(h(jQ($),dK($))))}function sK($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=CQ($,z);if(AQ(X))return X}let Q=jQ($);if(Q!==$)for(let z of Z){let X=CQ(Q,z);if(AQ(X))return X}return null}function oK($,Z,Q){let z=$$(Z,Q),X=$.agent??{},U={fafaSpecVersion:String($.version??t$),mediaTypes:[...e$],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)U.agentId=X.id;let H=aK($);if(H)U.passport=H;return U}function aK($){try{return`https://${Q2($)}/.well-known/fafa`}catch{return}}function i4($,Z,Q={}){if(I2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");if(!Z)return $6($,{doorUrl:Q.doorUrl});return $6($,{doorUrl:Q.doorUrl,extensions:[{uri:d4,description:"FAF passport and project DNA as typed parts",required:!1,params:oK($,Z,Q)}]})}var tK=iK(i4,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function eK($,Z){return Z.a2aCardUrl??`https://${Q2($)}/.well-known/agent-card.json`}function $D($,Z={},Q={}){let z=Q2($),X=BQ($),U=$.agent??{},H=Q.now??Z.generated??new Date().toISOString(),J=[];if(I2($,Q).length>0)J.push({identifier:`urn:air:${z}:a2a:${X}`,displayName:String(U.displayName??U.name??"A2A Agent Card"),type:"application/a2a-agent-card+json",description:"A2A v1.0 Agent Card. Projected from .fafa.",url:eK($,Q),updatedAt:H});return J.push({identifier:`urn:air:${z}:agent:${X}`,displayName:String(U.displayName??U.name??".fafa"),type:"application/vnd.fafa+yaml",description:"FAF agent passport (.fafa).",url:`https://${z}/.well-known/fafa`,updatedAt:H}),J}function ZD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function QD($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:U,...H})=>({specVersion:U,host:{...Q},...H}))(z):z;for(let U of Z){let H=ZD(X.entries,U);if(H>=0)X.entries[H]={...X.entries[H],url:U.url,type:U.type,...U.updatedAt?{updatedAt:U.updatedAt}:{}};else X.entries.push(U)}return X}function zD($,Z={}){return I2($,Z).length>0?["a2a","catalog","ard"]:["catalog","ard"]}var XD=["mcp","registry"];function UD($){let Z=$.opts??{},Q=$.faf,z=Q?nK:$.fafa?zD($.fafa,Z):[],X=new Set($.targets?.length?$.targets:z),U={};if(Q)U.block=$$(Q,Z);if(!Q&&XD.some((H)=>X.has(H)))throw Error("MCP and registry cards come from project.faf. Run 'faf init' to create one.");if(Q&&X.has("mcp"))U.mcp=Z6(Q,Z);if(Q&&X.has("registry")){let H=F8(Q);U.registry={name:c4(Q),...H?{title:H}:{},_meta:l4(Q,Z)}}if(X.has("a2a")||X.has("catalog")||X.has("ard")){if(!$.fafa){if($.targets?.some((H)=>H==="a2a"||H==="catalog"||H==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(X.has("a2a")&&$.fafa)if(I2($.fafa,Z).length===0){if($.targets?.includes("a2a"))throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.")}else U.a2a=i4($.fafa,Q,Z);if((X.has("catalog")||X.has("ard"))&&$.fafa){let H=$D($.fafa,Q,Z);if(X.has("catalog"))U.catalog=H;if(X.has("ard")){let G=m4($.fafa);U.ard=H.map((V)=>({...V,...G}))}let J=P8($.fafa);if(J)U.catalogHost=J}return HD(U),U}function HD($){if(!$.block)return;let Z=JSON.stringify($.block),Q=[];if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block");if($.a2a){let z=$.a2a.capabilities.extensions?.find((H)=>H.uri===d4);if(!z)throw Error("A2A card has no FAF context extension, but a project.faf was given");let X=z.params,U=$.block;if(X.provenance?.faf!==U.faf||X.provenance?.mediaType!==U.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var n4=["ephemeral","standard","high","critical"],z2=Object.fromEntries(n4.map(($,Z)=>[$,Z])),N8=new Set(["user","feedback","project","reference"]),r4=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),s4=new Set(["facts","sessions","preferences","custom"]),o4={low:"ephemeral",medium:"standard"};import{existsSync as JD}from"fs";import{dirname as xQ,resolve as gQ}from"path";function M2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function GD($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(f($))return"empty";if(typeof $==="string")return`a string (${JSON.stringify($.length>40?`${$.slice(0,40)}…`:$)})`;return`a ${typeof $}`}var Q$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function VD($){let Z=gQ($),Q=h(xQ(Z),Z,{read:!0});return{real:Q,text:Z0(Q)}}function wQ($,Z,Q,z){let X=gQ($),U=h(xQ(X),X),H=Q!==void 0&&Q.real===U;if(H&&Q.text===Z)return U;let J;try{J=I0(U)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return U;if(!H&&!z&&J)throw new b("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let G=H?Q.text:z?J:null;return e($,Z,G===void 0?{}:{expect:G})}function z$($){if(f($))return"standard";if(o4[$])return o4[$];if($ in z2)return $;return"standard"}var YD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function a4($){if(typeof $==="string")return{text:$,id:null,type:null,priority:"standard",tags:[],links:[],timestamp:null,source:null,extra:{}};if(!$||typeof $!=="object"||!("text"in $))throw Error(`fact must be a string or a mapping with 'text': ${JSON.stringify($)}`);let Z=$,Q={};for(let[z,X]of Object.entries(Z))if(!YD.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:z$(Z.priority),tags:Array.isArray(Z.tags)?Z.tags.slice():[],links:Array.isArray(Z.links)?Z.links.slice():[],timestamp:Z.timestamp??null,source:Z.source??null,extra:Q}}function Z$($){if(f($.id)&&f($.type)&&$.tags.length===0&&$.links.length===0&&f($.timestamp)&&f($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!f($.id))Q.id=$.id;if(!f($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!f($.timestamp))Q.timestamp=$.timestamp;if(!f($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function SQ($){let Z=$;return Q$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&Q$(Z.extra)&&typeof Z.priority==="string"?Z:a4($)}function WD($){if(typeof $==="string"||Q$($)&&"text"in $)return a4($);return null}var EQ=["profile","namepoint","created","last_etched","retention"];class Y0{namepoint;profile;retention;created;last_etched;_facts;_byId;_index;_sessions;_preferences;_custom;_extra;_memoryExtra;_version;_origin;_factAt=new WeakMap;_indexDerived=!0;_indexAtRecord=[];constructor($,Z={}){this.namepoint=$,this.profile=Z.profile??"knowledge",this.retention=Z.retention??"forever",this.created=Z.created??M2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(SQ):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),this._index=Z.index?Z.index.slice():[],this._sessions=Z.sessions?structuredClone(Z.sessions):[],this._preferences=Z.preferences?{...Z.preferences}:{},this._custom=Z.custom?{...Z.custom}:{},this._extra=Z.extra?{...Z.extra}:{},this._memoryExtra=Z.memoryExtra?{...Z.memoryExtra}:{},this._indexDerived=Z.index===void 0||l(this._index,this.derivedIndex()),this._indexAtRecord=this._index.slice()}get facts(){return this._facts}get index(){return this._index}get sessions(){return this._sessions}get preferences(){return this._preferences}get custom(){return this._custom}get extra(){return this._extra}get memoryExtra(){return this._memoryExtra}static load($){if(!JD($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=VD($);return Y0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=R4($,Z).toJS();if(!Q$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${GD(z)}`);let X=new vQ,U=X.pick("memory",z.memory,u)??{},H=new Y0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,U)});return(X.pick("memory.facts",U.facts,Array.isArray)??[]).forEach((J,G)=>{let V=WD(J);if(V)H.adopt(V,G)}),H.last_etched=String(z.last_etched??H.created),H._version=f(z.version)?void 0:String(z.version),H._origin={path:Z,real:Q,text:$,base:H.state(),residual:X.residual},H.recordIndex(),H}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!f($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return Y0.load($)}toDoc(){let $={facts:this._facts.map(Z$),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!s4.has(Q))$[Q]=structuredClone(z);let Z={version:this._version??"1.1",profile:this.profile,namepoint:this.namepoint,created:this.created,last_etched:this.last_etched,retention:this.retention,index:this._index.slice(),memory:$};for(let[Q,z]of Object.entries(this._extra))if(!r4.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return q2(this.toDoc(),{lineWidth:100})}derivedIndex($=80){return this._facts.map((Z)=>`${Z.id??"?"} — ${String(Z.text).slice(0,$)}`)}indexIsDerived($=80){return!this._origin?.residual.has("index")&&l(this._index,this.derivedIndex($))}rebuildIndex($=80){return this._index=this.derivedIndex($),this._indexDerived=!0,this._indexAtRecord=this._index.slice(),this._index}save($,Z={}){let Q=Z.reindex??(this._indexDerived&&l(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let G=this.toYaml(),V=wQ($,G,void 0,z);return this.settle($,G,new Map(this._facts.map((Y,W)=>[Y,W])),V),$}let U=new Map,{text:H}=q8(X.text,(G)=>{U=this.applyTo(G,X,Q)},$),J=wQ($,H,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,H,U,J),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,U]of Q)this._factAt.set(X,U);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(Z$(Z)))}return{top:Object.fromEntries(EQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),U=Z.path;for(let H of EQ)if(z.top[H]!==X.top[H])$.set(H,X.top[H]);if(!l(z.index,X.index)){if(Z.residual.has("index")&&!Q)Y0.refuse(Z,"index","replace it");D8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,U)}for(let H of yQ(z.extra,X.extra))D8($,[H],z.extra[H],X.extra[H],U);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...yQ(Q.memoryExtra,z.memoryExtra).map((U)=>[U,Q.memoryExtra[U],z.memoryExtra[U]])];for(let[U,H,J]of X){if(l(H,J))continue;if(Z.residual.has("memory"))Y0.refuse(Z,"memory",`change memory.${U}`);if(Z.residual.has(`memory.${U}`))Y0.refuse(Z,`memory.${U}`,"replace it");D8($,["memory",U],H,J,Z.path)}}sortFacts($){let Z=[],Q=[];for(let z of this._facts){let X=this._factAt.get(z);if(X===void 0){Q.push(z);continue}if(Q.length>0||Z.length>0&&X<=Z[Z.length-1][1])throw Error(`${$.path}: the facts were reordered — faf keeps the order soul.fafm has. Nothing written.`);Z.push([z,X])}return{kept:Z,added:Q}}applyFacts($,Z){let{kept:Q,added:z}=this.sortFacts(Z),X=new Set(Q.map(([,V])=>V)),U=[...Z.base.facts.keys()].filter((V)=>!X.has(V)).sort((V,Y)=>Y-V),H=Q.filter(([V,Y])=>!l(Z.base.facts.get(Y),Z$(V))),J=new Map(Q);if(z.length===0&&U.length===0&&H.length===0)return J;for(let V of["memory","memory.facts"])if(Z.residual.has(V))Y0.refuse(Z,V,"add facts to it");let G=A9($,["memory","facts"],Z.path);for(let[V,Y]of H)G.items[Y]=qD($,G.items[Y],Z.base.facts.get(Y),Z$(V));for(let V of U)G.items.splice(V,1);for(let[V,Y]of Q)J.set(V,Y-U.filter((W)=>W<Y).length);for(let V of z)J.set(V,G.items.length),G.items.push($.createNode(Z$(V)));return J}add($){let Z=SQ($);if(!f(Z.id)&&this._byId.has(Z.id)){let Q=this._byId.get(Z.id);if(Q!==void 0){let z=this._factAt.get(this._facts[Q]);if(this._facts[Q]=Z,z!==void 0)this._factAt.set(Z,z)}}else if(this._facts.push(Z),!f(Z.id))this._byId.set(Z.id,this._facts.length-1);if(Z.timestamp&&Z.timestamp>(this.last_etched||""))this.last_etched=Z.timestamp;return Z}etch($,Z={}){let Q=f(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(BD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:z$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:M2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=Q$($)?{...$,...Z}:Z,z=Q$($)?$.query:$,X=z2[z$(Q.minPriority??"ephemeral")]??0,U=typeof z==="string"?z.toLowerCase():"",H=new Set(Q.tags??[]),J=[];this._facts.forEach((V,Y)=>{if(U&&!String(V.text??"").toLowerCase().includes(U))return;if(H.size>0&&![...H].some((W)=>(V.tags??[]).includes(W)))return;if(!f(Q.type)&&V.type!==Q.type)return;if((z2[V.priority]??1)<X)return;J.push([Y,V])}),J.sort((V,Y)=>{let W=z2[V[1].priority]??1,B=z2[Y[1].priority]??1;if(B!==W)return B-W;let K=V[1].timestamp??"",L=Y[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return Y[0]-V[0]});let G=J.map(([,V])=>V);if(!f(Q.limit))return G.slice(0,Q.limit);return G}getFact($){let Z=this._byId.get($);return Z===void 0?null:this._facts[Z]}deleteFact($){let Z=this._byId.get($);if(Z===void 0)return!1;return this._facts.splice(Z,1),this._byId.clear(),this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),!0}}function BD($,Z,Q){let z=(X,U)=>f(X)?U:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:z$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:M2(),extra:{...$.extra}}}class vQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,p$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,u)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,u)??{}),extra:bQ($,r4),memoryExtra:bQ(Z,s4)}}}function bQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function yQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function qD($,Z,Q,z){if(!p(Z))return n$($,Z,Q,z);let X=(U)=>typeof U==="string"?{text:U}:U;return n$($,Z,X(Q),X(z))}import{readdirSync as KD,readFileSync as DD,statSync as kQ,existsSync as LD}from"fs";import{join as ID,basename as hQ,resolve as MD}from"path";var uQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),OD=/\[\[([^\]]+)\]\]/g;function _D($){let Z=kQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function PD($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=f0(Z[1]);if(!Q||typeof Q!=="object")return{fm:null,body:Z.slice(2).join("---").trim()};return{fm:Q,body:Z.slice(2).join("---").trim()}}catch{return{fm:null,body:$}}}function FD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!N8.has(X))return null;let U=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||U,G={};if(z.originSessionId)G.provenance=[`session:${z.originSessionId}`];let V=[...new Set([...Z.matchAll(OD)].map((Y)=>Y[1]))].sort();return{text:J,id:U,type:X,priority:"standard",tags:[],links:V,timestamp:_D($),source:`claude-code memory: ${hQ($)}`,extra:G}}function fQ($,Z={}){let Q=MD($);if(!LD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!kQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??uQ,X=Z.namepoint??`@claude-code:${hQ(Q)}`,U=[],H=KD(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of H){if(z.has(W))continue;let B=ID(Q,W),K;try{K=DD(B,"utf-8")}catch{continue}let{fm:L,body:q}=PD(K);if(!L)continue;let D=FD(B,q,L);if(D)U.push(D)}let J=U.map((W)=>W.timestamp).filter(Boolean),G=J.length?J.reduce((W,B)=>W<B?W:B):M2(),V=J.length?J.reduce((W,B)=>W>B?W:B):G,Y=new Y0(X,{profile:"knowledge",facts:U,created:G});return Y.last_etched=V,Y.rebuildIndex(),Y}var dQ="faf-interview/1",X$="(terse — 3-4 words)",t4=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${X$}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${X$}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${X$}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${X$}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${X$}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${X$}`,header:"How",type:"text",required:!0}],iQ=[{path:"project.main_language",question:"What is the primary programming language?",header:"Language",type:"select",required:!0,options:[{label:"TypeScript",value:"TypeScript",description:"JavaScript with types"},{label:"JavaScript",value:"JavaScript",description:"Vanilla JS or Node.js"},{label:"Python",value:"Python",description:"Python 3.x"},{label:"Rust",value:"Rust",description:"Systems programming"},{label:"Go",value:"Go",description:"Golang"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.frontend",question:"What frontend framework does it use?",header:"Frontend",type:"select",required:!1,options:[{label:"React",value:"React",description:"React.js"},{label:"Vue",value:"Vue",description:"Vue.js"},{label:"Svelte",value:"Svelte",description:"Svelte/SvelteKit"},{label:"Next.js",value:"Next.js",description:"React framework"},{label:"None",value:"None",description:"No frontend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.backend",question:"What backend framework does it use?",header:"Backend",type:"select",required:!1,options:[{label:"Express",value:"Express",description:"Node.js Express"},{label:"Fastify",value:"Fastify",description:"Node.js Fastify"},{label:"Django",value:"Django",description:"Python Django"},{label:"FastAPI",value:"FastAPI",description:"Python FastAPI"},{label:"None",value:"None",description:"No backend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.database",question:"What database does it use?",header:"Database",type:"select",required:!1,options:[{label:"PostgreSQL",value:"PostgreSQL",description:"Postgres"},{label:"MySQL",value:"MySQL",description:"MySQL/MariaDB"},{label:"SQLite",value:"SQLite",description:"Embedded SQL"},{label:"MongoDB",value:"MongoDB",description:"Document store"},{label:"None",value:"None",description:"No database"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.runtime",question:"What runtime does it run on?",header:"Runtime",type:"text",required:!1},{path:"stack.hosting",question:"Where is it hosted or distributed?",header:"Hosting",type:"text",required:!1},{path:"stack.build",question:"What is the build tool?",header:"Build",type:"text",required:!1},{path:"stack.cicd",question:"What CI/CD does it use?",header:"CI/CD",type:"text",required:!1}],U$=[...t4,...iQ],nQ=new Map(U$.map(($)=>[$.path,$])),ND=Object.fromEntries(U$.map(($)=>[$.path,$]));function e4($){let Z=nQ.get($);if(Z)return Z.question;let Q=x0.get($)??m.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function RD($,Z){return U$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let U of z)if(X&&typeof X==="object"&&U in X)X=X[U];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var TD=new Set(["developers","development teams","development team","teams","development","cloud platform","web platform","platform","best practices","improve development efficiency","development efficiency","modern development practices","modern development","test-driven development","production/stable","production","stable","app","project","tool"]),AD=[["npm",/\bnpm\b/i],["PyPI",/\bpypi\b/i],["crates.io",/\bcrates\.io\b/i],["Homebrew",/\bhomebrew\b/i],["Docker",/\bdocker\b/i],["Cloudflare",/\bcloudflare\b/i],["Vercel",/\bvercel\b/i],["Netlify",/\bnetlify\b/i],["AWS",/\baws\b/i],["Cloud Run",/\bcloud run\b/i],["edge",/\bedge\b/i],["browser",/\bbrowser\b/i],["WASM",/\bwasm\b/i],["GitHub",/\bgithub\b/i],["MCP Registry",/\bmcp registry\b/i],["Chrome Web Store",/\bchrome web store\b/i],["Smithery",/\bsmithery\b/i]],mQ=($)=>TD.has($.toLowerCase().trim()),CD=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function pQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&CD.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function rQ($){let Z={};if(!$||typeof $!=="string")return Z;let Q=$.trim(),z=Q.replace(/^[^A-Za-z0-9]+/,"").split(/\s+(?:for|that|which|to)\s+|\s+[—–]\s+|\s-\s|:\s|\.\s|,\s/)[0].trim(),X=pQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!mQ(X))Z.what=X;let U=AD.filter(([,G])=>G.test(Q)).map(([G])=>G);if(U.length)Z.where=U.slice(0,4).join(", ");let H=Q.match(/\bfor ((?:[A-Za-z][\w./+-]* )?(?:any |all )?(?:developers?|teams?|engineers?|builders?|users?|integrators?)\b[^.,;:—]*)/i),J=pQ((H?.[1]||"").trim().replace(/\s+/g," "));if(J&&!mQ(J))Z.who=J;return Z}function lQ($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function cQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!o(Z)}function jD($,Z={}){let Q=$&&typeof $==="object"?$:{},z=lQ(Q,"project.goal"),X=(cQ(z)?String(z).trim():"")||(Z.goal??"").trim(),U=rQ(X),H=Z.detailed??{},J={"project.goal":X||void 0,"human_context.what":U.what,"human_context.where":U.where,"human_context.who":U.who},G=(K)=>{let L=J[K];if(L)return{value:L,source:"project goal",confidence:0.9};let q=K.startsWith("human_context.")?K.slice(14):"",D=q?H[q]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},V=t4.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=lQ(Q,K.path);if(cQ(D))return{...q,value:String(D).trim(),status:"filled",seeded:!1};let M=G(K.path);if(M)return{...q,value:M.value,status:"seeded",seeded:!0,source:M.source,confidence:M.confidence};return{...q,value:"",status:"empty",seeded:!1}}),Y=V.filter((K)=>K.status==="filled").length,W=V.filter((K)=>K.status==="seeded").length,B=V.filter((K)=>K.status==="empty").length;return{version:dQ,rows:V,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function R8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||o(Z)}return!1}function wD($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function sQ($){if($==="project.goal")return!0;return x0.get($)?.category==="human"}function oQ($,Z=R8){let Q=[],z=[];for(let X of U$){let U=wD($,X.path);if(U==="slotignored")continue;if(!Z(U))continue;(sQ(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function aQ($,Z,Q=R8){let z=oQ(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let U=X==="needs-human"?$5(z):[];return{status:X,score:$,gaps:z,ask:U}}function $5($){return $.human.map((Z)=>({path:Z,question:e4(Z)}))}function SD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??R8,X=[],U=0;for(let J=0;J<=Q;J++){let G=$.read();if(!G)return{status:"no-faf",score:0,rounds:U,history:X,ask:[]};let V=$.score(G.yaml);X.push(V);let Y=aQ(V,G.data,z);if(Y.status==="done")return{status:"done",score:V,rounds:U,history:X,ask:[]};if(Y.status==="needs-human")return{status:"needs-human",score:V,rounds:U,history:X,ask:Y.ask};if(X.length>=2&&V<=X[X.length-2])return Y.gaps.human.length?{status:"needs-human",score:V,rounds:U,history:X,ask:$5(Y.gaps)}:{status:"stuck",score:V,rounds:U,history:X,ask:[]};if(U>=Q)return{status:"capped",score:V,rounds:U,history:X,ask:$5(Y.gaps)};$.runAuto(),U++}return{status:"capped",score:X[X.length-1]??0,rounds:U,history:X,ask:[]}}import{createHash as eQ}from"crypto";var Z5="faf-bench/1",ED={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function bD($,Z){return ED[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var $3=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],Q6=new Map;$3.forEach(($,Z)=>$.forEach((Q)=>Q6.set(Q,Z)));var yD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function T8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function tQ($){return T8($).split(" ").filter((Z)=>Z&&!yD.has(Z))}function Z3($,Z){let Q=T8($),z=T8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=Q6.get(Q);if(X!==void 0&&Q6.get(z)===X)return!0;let U=tQ($);if(U.length===0)return!1;let H=new Set(tQ(Z));return U.every((J)=>{if(H.has(J))return!0;let G=Q6.get(J);return G!==void 0&&[...H].some((V)=>Q6.get(V)===G)})}function xD($){let Z=$1($),Q=f0($),z=[],X={},U=0;for(let G of m){if(Z.slots[G.path]!=="populated")continue;let V=b5(Q,G);if(typeof V!=="string")continue;let Y=V.trim();if(!Y||D6.has(Y.toLowerCase()))continue;U+=1,z.push({n:U,path:G.path,question:bD(G.path,G.description)}),X[U]=Y}let H=JSON.stringify({v:Z5,q:z.map((G)=>[G.path,G.question])}),J=eQ("sha256").update(H).digest("hex").slice(0,12);return{version:Z5,qsetHash:J,questions:z,answers:X}}function gD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function vD($,Z){let Q=$.questions.map((X)=>{let U=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof U==="string"&&U.trim()!==""&&Z3($.answers[X.n],U)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function kD($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:eQ("sha256").update(Q).digest("hex")}}import{join as VI,extname as YI,resolve as WI}from"path";var Q5={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"Gemfile.lock":{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:34,intelligence:"high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"Package.swift":{frameworks:["Swift"],slots:{packageManager:"spm",mainLanguage:"Swift",buildTool:"swift build"},priority:36,intelligence:"ultra-high"},"*.csproj":{frameworks:["C#",".NET"],slots:{packageManager:"NuGet",mainLanguage:"C#",buildTool:"dotnet"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"settings.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:34,intelligence:"high"},"settings.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:34,intelligence:"high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","Swift"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",backend:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};import{join as uD}from"path";var H$={version:2,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs compose it. Bolster Dart/Flutter by editing THIS file. Logic stays in dart.ts. Refreshed 2026-08-01 (knowledge v2) — community receipt on top of 6.13.0 Dart Edition.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp","dart_mcpserver"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"],["jaspr","Jaspr"],["relic","Relic"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod_annotation","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"],["flutter_hooks","Hooks"]],routing:[["go_router","go_router"],["auto_route","auto_route"],["beamer","Beamer"],["routemaster","Routemaster"]]};var fD=H$.flutterDeps,mD=H$.mcpDeps,pD=H$.serverFrameworks,lD=H$.stateManagement,cD=H$.routing;function dD($){let Z=new Set,Q=!1;for(let z of $.split(`
251
- `)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){Q=!0;continue}if(/^\S/.test(z))Q=!1;if(Q){let X=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(X)Z.add(X[1].toLowerCase())}}return Z}function A8($){let Z=S($,"pubspec.yaml");if(Z===null)return null;let Q=dD(Z),z=(O)=>Q.has(O.toLowerCase()),X=fD.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),U=mD.find(z),H=pD.find(([O])=>z(O)),J=lD.find(([O])=>z(O)),G=J?J[1]:"",V=cD.find(([O])=>z(O)),Y=V?V[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",B=/^executables:\s*$/m.test(Z),K=(v($,"bin")??[]).some((O)=>O.name.endsWith(".dart")),L=B||K,q,D="",M;if(X)if(D="Flutter",I($,uD("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))q="mobile",M="pubspec.yaml (Flutter app)";else q="library",M="pubspec.yaml (Flutter package)";else if(U)q="mcp",M=`pubspec.yaml + ${U} (Dart MCP server)`;else if(H)q="backend",D=H[1],M=`pubspec.yaml + ${H[0]} (Dart backend)`;else if(L)q="cli",M=B?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else q="library",M="pubspec.yaml (Dart package)";return{appType:q,isFlutter:X,framework:D,stateManagement:G,routing:Y,testing:W,found:M}}import{join as nD}from"path";var C8={version:1,_doc:"SINGLE SOURCE of Go detection KNOWLEDGE (A+B hybrid, Truth-is-faf-cli). faf-cli imports this directly; SDKs/MCPs compose it. Bolster Go by editing THIS file. Logic stays in go.ts. Content-aware: go.mod ≠ one bucket — backend · CLI · MCP · library. 2026-08-01 initial (Dart composition pattern).",mcpModules:["github.com/mark3labs/mcp-go","github.com/modelcontextprotocol/go-sdk","github.com/metoro-io/mcp-golang","github.com/ThinkInAIXYZ/go-mcp"],serverFrameworks:[["github.com/gin-gonic/gin","Gin"],["github.com/labstack/echo","Echo"],["github.com/labstack/echo/v4","Echo"],["github.com/gofiber/fiber","Fiber"],["github.com/gofiber/fiber/v2","Fiber"],["github.com/go-chi/chi","Chi"],["github.com/go-chi/chi/v5","Chi"],["github.com/gorilla/mux","Gorilla Mux"],["github.com/gofiber/fiber/v3","Fiber"],["google.golang.org/grpc","gRPC"],["connectrpc.com/connect","Connect"],["github.com/go-kratos/kratos","Kratos"],["github.com/go-kratos/kratos/v2","Kratos"],["github.com/zeromicro/go-zero","go-zero"],["github.com/cloudwego/hertz","Hertz"]],cliFrameworks:[["github.com/spf13/cobra","Cobra"],["github.com/urfave/cli","urfave/cli"],["github.com/urfave/cli/v2","urfave/cli"],["github.com/alecthomas/kingpin","Kingpin"],["github.com/alecthomas/kong","Kong"]]};var rD=C8.mcpModules,sD=C8.serverFrameworks,oD=C8.cliFrameworks;function aD($){let Z=new Set,Q=!1;for(let z of $.split(`
252
- `)){let X=z.replace(/\/\/.*$/,"").trim();if(!X)continue;if(/^require\s*\(\s*$/.test(X)){Q=!0;continue}if(Q){if(X===")"){Q=!1;continue}let H=X.match(/^(\S+)/);if(H)Z.add(H[1].toLowerCase());continue}let U=X.match(/^require\s+(\S+)/);if(U&&U[1]!=="(")Z.add(U[1].toLowerCase())}return Z}function z3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function Q3($,Z){let Q;for(let z of Z){if(!z3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function tD($,Z){let Q;for(let z of Z){if(!z3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function eD($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function $L($){for(let{name:Z}of v($,"cmd")??[]){let Q=nD("cmd",Z),z=M0($,Q);if(z?.isDirectory()){if((v($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function ZL($){let Z=S($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function j8($){let Z=S($,"go.mod");if(Z===null)return null;let Q=eD(Z),z=aD(Z),X=tD(z,rD),U=Q3(z,sD),H=Q3(z,oD),J=$L($),G=ZL($),V,Y="",W;if(X)V="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(U)V="backend",Y=U[1],W=`go.mod + ${U[0]} (Go backend)`;else if(H)V="cli",Y=H[1],W=`go.mod + ${H[0]} (Go CLI)`;else if(J)V="cli",W="go.mod + cmd/ (Go CLI layout)";else if(G&&!U)V="cli",W="go.mod + main.go package main (Go CLI)";else V="library",W="go.mod (Go module)";return{appType:V,modulePath:Q,framework:Y,found:W}}var O2={version:1,_doc:"SINGLE SOURCE of C# /.NET detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Bolster C# by editing THIS file. Logic stays in csharp.ts. Content-aware: .csproj alone ≠ type — Sdk first, then props/packages. Kill line: .csproj alone ≠ type. 2026-08-01 initial.",mcpPackages:["ModelContextProtocol","ModelContextProtocol.AspNetCore","ModelContextProtocol.Core","ModelContextProtocol.Extensions.Tasks","ModelContextProtocol.Extensions.Apps"],cliPackages:[["System.CommandLine","System.CommandLine"],["Spectre.Console.Cli","Spectre.Console"],["Spectre.Console","Spectre.Console"],["McMaster.Extensions.CommandLineUtils","McMaster"]],testPackages:[["Microsoft.NET.Test.Sdk","VSTest"],["xunit.v3","xUnit"],["xunit","xUnit"],["NUnit","NUnit"],["MSTest.TestFramework","MSTest"],["MSTest","MSTest"]],grpcServerPackages:["Grpc.AspNetCore"],specializedSdks:[["Microsoft.NET.Sdk.Web","web","ASP.NET Core"],["Microsoft.NET.Sdk.Worker","worker","Worker"],["Microsoft.NET.Sdk.BlazorWebAssembly","blazor-wasm","Blazor WebAssembly"],["Microsoft.NET.Sdk.Razor","razor-lib","Razor Class Library"],["MSTest.Sdk","test","MSTest"],["Aspire.AppHost.Sdk","aspire","Aspire AppHost"]],baseSdk:"Microsoft.NET.Sdk"};var zL=O2.mcpPackages.map(($)=>$.toLowerCase()),XL=O2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),UL=O2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),HL=O2.grpcServerPackages.map(($)=>$.toLowerCase()),JL=O2.specializedSdks,X3=O2.baseSdk.toLowerCase();function GL($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),U=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],J=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||U||"").trim(),G=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),V=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),Y=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),B=new Set;for(let L of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());for(let L of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());let K=new Set;for(let L of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))K.add(L[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:J,isTestProject:G,useMaui:V,useWpf:Y,useWindowsForms:W,packages:B,frameworkRefs:K}}function z5($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let z of $)if(z===Q||z.startsWith(`${Q}.`))return!0;return!1}function U3($,Z){let Q;for(let[z,X]of Z){if(!z5($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function VL($){let Z;for(let Q of zL){if(!z5($,Q))continue;if(!Z||Q.length>Z.length)Z=Q}for(let Q of $)if(Q==="modelcontextprotocol"||Q.startsWith("modelcontextprotocol.")){if(!Z||Q.length>Z.length)Z=Q}return Z}function YL($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of JL){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function w8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function WL($,Z){if($==="mcp")return 0;if($==="mobile")return 1;if($==="backend")return 2;if($==="cli")return 3;if(Z&&Z!=="")return 4;return 5}function BL($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:U,outputType:H}=$,J,G="",V,Y=VL(X),W=YL(z),B=U3(X,UL),K=U3(X,XL),L=HL.some((D)=>z5(X,D)),q=U.has("microsoft.aspnetcore.app");if(Y)J="mcp",G="MCP",V=`${Z} + ${Y} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||B)J="library",G=B?.[1]||(W?.[1]==="test"?W[2]:"Test"),V=`${Z} + test (${G})`;else if($.useMaui)J="mobile",G="MAUI",V=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)J="backend",G=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",V=`${Z} + ${G}`;else if(W?.[1]==="web")J="backend",G=L?"gRPC":W[2],V=`${Z} + Sdk=${W[0]}${L?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")J="library",G=W[2],V=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(q&&w8(H))J="backend",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!w8(H))J="library",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(w8(H)||!H))J="cli",G=K[1],V=`${Z} + ${K[0]} (C# CLI)`;else if(w8(H))J="cli",V=`${Z} + OutputType=Exe (C# console)`;else{J="library";let D=z?` Sdk=${z}`:"";if(V=`${Z}${D} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===X3||z.toLowerCase().startsWith(`${X3}/`))V=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:G,found:V}}function J$($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function S8($){let Z=J$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let U=S($,X);if(U===null)continue;let H=GL(U),J=BL(H,X),G=WL(J.appType,J.framework);if(!Q||G<z)Q=J,z=G}return Q}import{join as _2}from"path";var _0={version:1,_doc:"SINGLE SOURCE of JVM (Java/Kotlin) detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Bolster JVM by editing THIS file. Logic stays in jvm.ts. Kill line: pom / gradle alone ≠ type. Content-aware: plugins · parents · packaging · deps · version catalogs. One brand JVM — Android/KMP are facets, not a second Kotlin Edition. 2026-08-03 initial (post-intel).",mcpArtifacts:["io.modelcontextprotocol.sdk:mcp","io.modelcontextprotocol.sdk:mcp-core","io.modelcontextprotocol.sdk:mcp-spring-webflux","io.modelcontextprotocol.sdk:mcp-spring-webmvc","org.springframework.ai:spring-ai-starter-mcp-server","org.springframework.ai:spring-ai-starter-mcp-server-webmvc","org.springframework.ai:spring-ai-starter-mcp-server-webflux","org.springframework.ai:spring-ai-starter-mcp-client","org.springframework.ai:spring-ai-mcp-server-spring-boot-starter","org.springframework.ai:spring-ai-mcp-client-spring-boot-starter","io.modelcontextprotocol:kotlin-sdk","io.modelcontextprotocol.kotlin:mcp"],webPlugins:[["org.springframework.boot","Spring Boot"],["io.quarkus","Quarkus"],["io.quarkus.gradle.plugin","Quarkus"],["io.micronaut.application","Micronaut"],["io.micronaut.library","Micronaut"]],webParents:[["org.springframework.boot:spring-boot-starter-parent","Spring Boot"],["io.quarkus.platform:quarkus-bom","Quarkus"],["io.micronaut.platform:micronaut-parent","Micronaut"]],webArtifacts:[["org.springframework.boot:spring-boot-starter-web","Spring Boot"],["org.springframework.boot:spring-boot-starter-webflux","Spring Boot"],["org.springframework.boot:spring-boot-starter","Spring Boot"],["io.quarkus:quarkus-core","Quarkus"],["io.micronaut:micronaut-http-server-netty","Micronaut"],["io.ktor:ktor-server-core","Ktor"],["io.ktor:ktor-server-netty","Ktor"],["io.ktor:ktor-server-cio","Ktor"]],androidPlugins:["com.android.application","com.android.library","com.android.kotlin.multiplatform.library"],kmpPlugins:["org.jetbrains.kotlin.multiplatform","kotlin-multiplatform"],jvmKotlinPlugins:["org.jetbrains.kotlin.jvm","kotlin-jvm","org.jetbrains.kotlin.android","kotlin-android"],cliPlugins:[["org.gradle.application","application"],["application","application"]],cliArtifacts:[["info.picocli:picocli","Picocli"],["com.github.ajalt.clikt:clikt","Clikt"],["com.github.ajalt.clikt:clikt-jvm","Clikt"]],libraryPlugins:["java-library","org.gradle.java-library"]};var KL=_0.mcpArtifacts.map(($)=>$.toLowerCase()),DL=_0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),LL=_0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),IL=_0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),HR=_0.androidPlugins.map(($)=>$.toLowerCase()),ML=_0.kmpPlugins.map(($)=>$.toLowerCase()),OL=_0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),_L=_0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),PL=_0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),FL=_0.libraryPlugins.map(($)=>$.toLowerCase()),NL=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function X5($){return NL.some((Z)=>I($,Z))}function RL($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
253
- `)){let U=X.replace(/#.*$/,"").trim();if(!U)continue;let H=U.match(/^\[([^\]]+)\]$/);if(H){z=H[1].trim().toLowerCase();continue}let J=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(J&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(J[1].replace(/-/g,".").toLowerCase(),J[2].toLowerCase()),Z.set(J[1].toLowerCase(),J[2].toLowerCase());continue}let G=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(G&&(z==="libraries"||z.endsWith(".libraries"))){let W=G[1].toLowerCase();Q.set(W,G[2].toLowerCase()),Q.set(W.replace(/-/g,"."),G[2].toLowerCase());continue}let V=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${V[2]}:${V[3]}`.toLowerCase(),B=V[1].toLowerCase();Q.set(B,W),Q.set(B.replace(/-/g,"."),W);continue}let Y=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(Y){let W=Y[1].toLowerCase(),B=Y[2];if(z==="plugins"||z.endsWith(".plugins")){let K=B.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=B.split(":");if(K.length>=2){let L=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,L),Q.set(W.replace(/-/g,"."),L)}}}}return{plugins:Z,libraries:Q}}function TL($){let Z=S($,_2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return RL(Z)}function AL($){let Z=[];for(let Q of $.matchAll(/include\s*\(\s*([^)]+)\)/g))for(let z of Q[1].split(",")){let X=z.replace(/['":\s]/g,"").replace(/^:/,"");if(X)Z.push(X.replace(/:/g,"/"))}for(let Q of $.matchAll(/include\s+((?:['"][^'"]+['"]\s*,?\s*)+)/g))for(let z of Q[1].split(",")){let X=z.replace(/['":\s]/g,"").replace(/^:/,"");if(X)Z.push(X.replace(/:/g,"/"))}for(let Q of $.matchAll(/project\s*\(\s*["']:([^"']+)["']\s*\)\s*\.projectDir\s*=\s*file\s*\(\s*["']([^"']+)["']\s*\)/g))Z.push(Q[2].replace(/^\.\//,""));return[...new Set(Z)]}function CL($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let U=X.replace(/\/\/.*$/,"").trim();if(!U||U.startsWith("id")||U.startsWith("kotlin")||U.startsWith("alias"))continue;let H=U.match(/^`([a-zA-Z0-9.-]+)`$/)||U.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(H)Q.add(H[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),U=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(U)Q.add(U);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function jL($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let U=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let H of U){let J=Z.libraries.get(H);if(J){Q.add(J.includes(":")?J.split(":").slice(0,2).join(":"):J);break}}}return Q}function G3($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,z=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(z){let H=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),J=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(H&&J)Q.add(`${H}:${J}`.toLowerCase())}let X=new Set;for(let H of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let J=H[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),G=H[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&G)X.add(`${J}:${G}`.toLowerCase())}let U=[];for(let H of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))U.push(H[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:U}}function m0($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let z of $)if(z===Q||z.endsWith(`.${Q}`)||z===Q.replace(/^org\.gradle\./,""))return!0;return!1}function z6($,Z,Q){let z;for(let[X,U]of Z){let H=!1;if(Q==="plugin")H=m0($,X);else if(H=$.has(X)||[...$].some((J)=>J===X||J.startsWith(`${X}:`)||J.startsWith(`${X}.`)),!H&&Q==="artifact")H=[...$].some((J)=>J===X||J.startsWith(`${X}`));if(!H)continue;if(!z||X.length>z[0].length)z=[X,U]}return z}function wL($){let Z;for(let Q of KL)for(let z of $){if(z===Q||z.startsWith(`${Q}:`)||z.startsWith(Q.replace(/:mcp$/,":"))){if(!Z||Q.length>Z.length)Z=Q}if(z.startsWith("io.modelcontextprotocol")||z.includes("spring-ai-starter-mcp")||z.includes("spring-ai-mcp")){if(!Z||z.length>Z.length)Z=z}}return Z}function V3($,Z){let Q=new Set,z=!1,X=!1,U=[_2(Z,"src"),_2(Z,"src","main")],H=(J,G)=>{if(G>4)return;let V=v($,J);if(!V)return;for(let{name:Y}of V){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=_2(J,Y),B=M0($,W);if(!B)continue;if(B.isDirectory())H(W,G+1);else if(Y.endsWith(".kt")||Y.endsWith(".kts"))z=!0;else if(Y.endsWith(".java"))X=!0}};for(let J of U)H(J,0);return{kotlin:z,java:X,hints:Q}}function SL($){let Z=[],Q=$.plugins,z=$.artifacts,X=ML.some((F)=>m0(Q,F))||$.sourceHints.has("commonMain"),U=m0(Q,"com.android.application"),H=m0(Q,"com.android.library")||m0(Q,"com.android.kotlin.multiplatform.library");if(U||H)Z.push("android");if(X)Z.push("multiplatform");let J=wL(z),G=z6(Q,DL,"plugin"),V=z6($.parents,LL,"parent"),Y=z6(z,IL,"artifact"),W=z6(Q,_L,"plugin"),B=z6(z,PL,"artifact"),K=FL.some((F)=>m0(Q,F)),L=$.packaging==="pom",q,D="",M;if(U)q="mobile",D=X?"Android+KMP":"Android",M=`${$.path||"root"} + com.android.application (${D})`;else if(J)q="mcp",D="MCP",Z.push("mcp"),M=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(G||V||Y){q="backend",D=G?.[1]||V?.[1]||Y?.[1]||"JVM";let F=G?.[0]||V?.[0]||Y?.[0]||"web";M=`${$.path||"root"} + ${F} (JVM backend)`}else if(X&&!H)q="library",D="Kotlin Multiplatform",M=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(H)q="library",D=X?"Android+KMP":"Android",M=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)q="cli",D=B?.[1]||"application",M=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)q="cli",D="application",M=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)q="library",M=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{q="library";let F=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(M=`${$.path||"root"} (${F} library)`,K)M=`${$.path||"root"} + java-library (JVM library)`}let O="Java";if($.kotlinSources&&$.javaSources)O="Java/Kotlin";else if($.kotlinSources||OL.some((F)=>m0(Q,F))||X)O="Kotlin";let A=[...new Set(Z)];return{appType:q,framework:D,facets:A,found:M,buildTool:$.buildTool,mainLanguage:O}}function EL($,Z){if($==="mcp")return 0;if($==="mobile")return 1;if(Z.includes("multiplatform")&&$==="backend")return 2;if($==="backend")return 3;if($==="cli")return 4;if(Z.includes("multiplatform"))return 5;if(Z.includes("android"))return 6;return 7}function H3($,Z,Q){let z=_2(Z,"build.gradle.kts"),X=_2(Z,"build.gradle"),U=I($,z)?z:I($,X)?X:null;if(!U)return null;let H=S($,U);if(!H)return null;let J=CL(H,Q),G=jL(H,Q),V=V3($,Z),Y=/mainClass\s*[.=]/.test(H)||/mainClassName\s*=/.test(H)||/Main-Class/.test(H),W=m0(J,"application")||m0(J,"org.gradle.application");return{path:Z||"build.gradle",plugins:J,artifacts:G,packaging:"jar",parents:new Set,hasMainClass:Y,hasApplicationPlugin:W,sourceHints:V.hints,kotlinSources:V.kotlin||U.endsWith(".kts"),javaSources:V.java,buildTool:"gradle"}}function J3($,Z){let Q=S($,_2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:U}=G3(Q),H=V3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:U,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:H.hints,kotlinSources:H.kotlin,javaSources:H.java,buildTool:"maven"}}function X6($){if(!X5($))return null;let Z=TL($),Q=[],z=null;for(let V of["settings.gradle.kts","settings.gradle"])if(I($,V)){z=S($,V);break}let X=z?AL(z):[],U=H3($,"",Z);if(U)Q.push(U);for(let V of X){let Y=H3($,V,Z);if(Y)Q.push(Y)}let H=J3($,"");if(H){Q.push(H);let V=S($,"pom.xml");if(V){let{modules:Y}=G3(V);for(let W of Y){let B=J3($,W);if(B)Q.push(B)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let J=null,G=999;for(let V of Q){let Y=SL(V),W=EL(Y.appType,Y.facets);if(!J||W<G)J={appType:Y.appType,framework:Y.framework,buildTool:Y.buildTool,mainLanguage:Y.mainLanguage,facets:Y.facets,found:Y.found},G=W}if(J&&X.length>0&&!J.found.includes("multi-project"));return J}import{join as yL}from"path";var U6={version:1,_doc:"SINGLE SOURCE of Ruby detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Kill line: Gemfile alone ≠ Rails. Content-aware: gem names + light layout. 2026-08-03 initial (post-intel ruby-edition).",mcpGems:["mcp","fast-mcp","fast_mcp","rails-mcp-server","rails_mcp_server","ruby-mcp-client","ruby_mcp_client","ruby_llm-mcp","ruby_llm_mcp"],webGems:[["rails","Rails"],["railties","Rails"],["sinatra","Sinatra"],["sinatra-contrib","Sinatra"],["roda","Roda"],["grape","Grape"],["hanami","Hanami"],["hanami-controller","Hanami"],["rack","Rack"]],cliGems:[["thor","Thor"],["gli","GLI"],["commander","Commander"],["slop","Slop"]],railsLayoutFiles:["config/application.rb","config/routes.rb","bin/rails","config/environment.rb"]};var xL=U6.mcpGems.map(($)=>$.toLowerCase()),gL=U6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),Y3=U6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),vL=U6.railsLayoutFiles;function kL($){return I($,"Gemfile")||I($,"gems.rb")||hL($)}function hL($){return(v($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function uL($){let Z=new Set;for(let Q of $.split(`
254
- `)){let z=Q.replace(/#.*$/,"").trim();if(!z)continue;let X=z.match(/^\s*gem\s+['"]([^'"]+)['"]/i)||z.match(/^\s*gem\s+:([A-Za-z0-9_.-]+)/i);if(X)Z.add(X[1].toLowerCase())}return Z}function fL($){let Z=new Set,Q=!1;for(let z of $.split(`
255
- `)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let U=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(U)Z.add(U[1].toLowerCase())}}return Z}function mL($){let Z=new Set;for(let Q of $.split(`
256
- `)){let X=Q.replace(/#.*$/,"").match(/add_(?:runtime_|development_)?dependency\s*\(?\s*['"]([^'"]+)['"]/i);if(X)Z.add(X[1].toLowerCase())}return Z}function pL($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let U=S($,X);if(U){for(let H of uL(U))Z.add(H);Q.push(X)}}let z=S($,"Gemfile.lock")||S($,"gems.locked");if(z){for(let X of fL(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let U=S($,X);if(U){for(let H of mL(U))Z.add(H);Q.push(X)}}return{gems:Z,sources:Q}}function H6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function U5($,Z){let Q;for(let[z,X]of Z){if(!H6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function lL($){let Z;for(let Q of xL)if(H6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function W3($){for(let Z of vL)if(I($,Z))return Z;return}function cL($,Z){let Q=U5(Z,Y3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let U=S($,X);if(U&&/executables\s*=/.test(U)&&!/executables\s*=\s*\[\s*\]/.test(U))return{hit:!0,why:`${X} executables`}}let z=v($,"bin");if(z){let U=z.map((H)=>H.name).filter((H)=>{if(H==="setup"||H==="console"||H==="rake")return!1;return M0($,yL("bin",H))?.isFile()===!0}).filter((H)=>H!=="rails");if(U.length>0&&!H6(Z,"rails")&&!W3($))return{hit:!0,why:`bin/${U[0]}`}}return{hit:!1,why:""}}function E8($){if(!kL($))return null;let{gems:Z,sources:Q}=pL($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",U=lL(Z),H=U5(Z,gL),J=W3($),G=H6(Z,"rails")||H6(Z,"railties"),V=cL($,Z),Y=I($,"config.ru"),W=G||!!J,B=H&&H[1]!=="Rails"&&!(H[0]==="rack"&&!Y)?H:void 0,K,L="",q;if(U)K="mcp",L="MCP",q=`${z} + gem ${U} (Ruby MCP)`;else if(W)if(K="backend",L="Rails",G&&J)q=`${z} + rails + ${J} (Rails)`;else if(G)q=`${z} + gem rails (Rails)`;else q=`${J} (Rails layout)`;else if(B)K="backend",L=B[1],q=`${z} + gem ${B[0]} (Ruby backend)`;else if(V.hit)K="cli",L=U5(Z,Y3)?.[1]||"",q=`${z} + ${V.why} (Ruby CLI)`;else K="library",q=`${z} (Ruby library)`;return{appType:K,framework:L,packageManager:X,found:q}}import{join as iL}from"path";var S0={version:1,_doc:"SINGLE SOURCE of Swift detection KNOWLEDGE (Truth-is-faf-cli). Kill line: Package.swift alone ≠ app. Static parse of products + package URLs + product names + light xcodeproj productType. Never execute Package.swift / swift build. 2026-08-03 post-intel swift-edition.",mcpPackageUrls:["modelcontextprotocol/swift-sdk","github.com/modelcontextprotocol/swift-sdk"],mcpProducts:["MCP"],serverPackageUrls:[["vapor/vapor","Vapor"],["github.com/vapor/vapor","Vapor"],["hummingbird-project/hummingbird","Hummingbird"],["github.com/hummingbird-project/hummingbird","Hummingbird"]],serverProducts:[["Vapor","Vapor"],["Hummingbird","Hummingbird"]],cliPackageUrls:[["apple/swift-argument-parser","ArgumentParser"],["github.com/apple/swift-argument-parser","ArgumentParser"]],cliProducts:[["ArgumentParser","ArgumentParser"]],appProductTypes:["com.apple.product-type.application"],cliProductTypes:["com.apple.product-type.tool"],vaporLayoutFiles:["Sources/App/configure.swift","Sources/App/routes.swift","Sources/App/entrypoint.swift"]};var nL=S0.mcpPackageUrls.map(($)=>$.toLowerCase()),rL=S0.mcpProducts.map(($)=>$.toLowerCase()),sL=S0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),oL=S0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),aL=S0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),tL=S0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),eL=S0.appProductTypes,$I=S0.cliProductTypes,ZI=S0.vaporLayoutFiles;function QI($){return I($,"Package.swift")||H5($).length>0}function H5($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&M0($,Z)?.isDirectory()===!0)}function zI($){let Z=XI($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,U;while((U=X.exec(Z))!==null)z.push(U[1]);let H=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((U=H.exec(Z))!==null)z.push(U[1]);let J=[],G=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((U=G.exec(Z))!==null)J.push(U[1]);let V=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((U=V.exec(Z))!==null)J.push(U[1]);let Y=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),B=/\.plugin\s*\(/.test(Q)&&!Y&&!W?!0:/\bproducts\s*:\s*\[[\s\S]*?\.plugin\s*\(/.test(Q),K=/\.executabletarget\s*\(/.test(Q),L=/\.target\s*\(/.test(Q)&&!K?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:z,productNames:J,hasLibraryProduct:Y,hasExecutableProduct:W,hasPluginProduct:!!B,hasExecutableTarget:K,hasLibraryTarget:L}}function XI($){let Z="",Q=0;while(Q<$.length){if($[Q]==='"'||$[Q]==="'"){let z=$[Q];Z+=z,Q++;while(Q<$.length){if($[Q]==="\\"&&Q+1<$.length){Z+=$[Q]+$[Q+1],Q+=2;continue}if(Z+=$[Q],$[Q]===z){Q++;break}Q++}continue}if($[Q]==="/"&&$[Q+1]==="/"){Q+=2;while(Q<$.length&&$[Q]!==`
257
- `)Q++;continue}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<$.length&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;Q+=2;continue}Z+=$[Q],Q++}return Z}function UI($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z.length))z=X;return z}function B3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)for(let H of Q)if(H.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function q3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function HI($){let Z=$.map((Q)=>Q.toLowerCase());return rL.some((Q)=>Z.includes(Q))}function JI($){let Z=!1,Q=!1,z;for(let X of H5($)){let U=S($,iL(X,"project.pbxproj"));if(!U)continue;for(let H of eL)if(U.includes(H))Z=!0,z=H;for(let H of $I)if(U.includes(H)){if(Q=!0,!z)z=H}}return{hasApplication:Z,hasTool:Q,hit:z}}function GI($){for(let Z of ZI)if(I($,Z))return Z;return}function J6($){if(!QI($))return null;let Z=I($,"Package.swift"),Q=H5($),z=Q.length>0,X=null;if(Z){let P=S($,"Package.swift");if(P)X=zI(P)}let U=z?JI($):{hasApplication:!1,hasTool:!1},H=GI($),J=X?.packageUrls??[],G=X?.productNames??[],V=UI(J,nL),Y=HI(G),W=B3(J,sL),B=q3(G,oL),K=B3(J,aL),L=q3(G,tL),q=!!(V||Y),D=!!(W||B||H),M=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),O=!!(K||L),A=U.hasApplication,F=Z&&z?"spm+xcode":Z?"spm":"xcode",N,R="",w;if(q)if(N="mcp",R="MCP",Y)w="Package.swift + product MCP (Swift MCP)";else w=`Package.swift + ${V} (Swift MCP)`;else if(D)if(N="backend",R=B?.[1]||W?.[1]||(H?"Vapor":""),B)w=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)w=`Package.swift + ${W[1]} (Swift backend)`;else w=`${H} (Swift backend layout)`;else if(A)N="app",R="",w=`${Q[0]} + ${U.hit||"application"} (Swift app)`;else if(O||M&&!D&&!q)if(N="cli",R=L?.[1]||K?.[1]||"",L)w=`Package.swift + product ${L[1]} (Swift CLI)`;else if(K)w=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)w="Package.swift + .executable product (Swift CLI)";else w="Package.swift + .executableTarget (Swift CLI)";else if(U.hasTool&&!Z)N="cli",w=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(N="library",X?.hasLibraryProduct)w="Package.swift + .library product (Swift library)";else w="Package.swift (Swift library)";else N="library",w=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:N,framework:R,packageManager:F,found:w}}var BI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),qI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),KI={mainLanguage:["project","main_language"],main_language:["project","main_language"],framework:["stack","frontend"],cssFramework:["stack","css_framework"],css:["stack","css_framework"],uiLibrary:["stack","ui_library"],ui_library:["stack","ui_library"],stateManagement:["stack","state_management"],state:["stack","state_management"],backend:["stack","backend"],apiType:["stack","api_type"],api:["stack","api_type"],runtime:["stack","runtime"],database:["stack","database"],db:["stack","database"],connection:["stack","connection"],hosting:["stack","hosting"],buildTool:["stack","build"],build_tool:["stack","build"],build:["stack","build"],packageManager:["stack","package_manager"],pkg_manager:["stack","package_manager"],cicd:["stack","cicd"]},DI=[["packageManager","package-manager"],["pkg_manager","package-manager"],["mainLanguage","language"],["main_language","language"],["framework","framework"],["backend","backend"],["database","database"],["db","database"],["cicd","ci-cd"],["hosting","hosting"],["buildTool","build"],["build_tool","build"],["build","build"],["runtime","runtime"],["cssFramework","css"],["css","css"],["uiLibrary","ui-library"],["stateManagement","state-management"],["apiType","api"],["api","api"]];function LI($,Z){for(let[Q,z]of DI)if(Q in $)return z;return Z.length>0?"framework":"config"}function II($,Z){try{let Q=JSON.parse(S($,Z)??""),z=["background","content_scripts","action","browser_action","permissions"].some((X)=>(X in Q));if(typeof Q.manifest_version==="number"&&z)return"chrome";return"other"}catch{return"other"}}function MI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return M0($,Z.name)?.isFile()===!0}function OI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return M0($,Z.name)?.isDirectory()===!0}function _I($){let Z=[],Q=WI($),z=new Set,X=v(Q);if(!X)return Z;for(let U of X){let H=U.name;if(H.endsWith(".xcodeproj")?!OI(Q,U):!MI(Q,U))continue;if(H.toLowerCase().endsWith(".csproj")){let G=S8(Q);if(G){let V={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile"&&G.framework)V.framework=G.framework;if(G.targetFramework)V.runtime=G.targetFramework;let Y=G.framework?[G.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:V,priority:36,frameworks:Y,fileName:H})}continue}if(H.endsWith(".xcodeproj")){let G=J6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="spm"?"spm":"Xcode",buildTool:G.packageManager.includes("spm")?"swift build":"xcodebuild"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:36,frameworks:Y,fileName:H})}continue}let J=Q5[H];if(!J)continue;if(H==="manifest.json"&&II(Q,H)!=="chrome")continue;if(H==="pubspec.yaml"){let G=A8(Q);if(G){let V={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(V.framework="Flutter",G.stateManagement)V.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="mcp")V.apiType="MCP";Z.push({slots:V,priority:J.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:H});continue}}if(H==="go.mod"){let G=j8(Q);if(G){let V={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Go"]:["Go"];Z.push({slots:V,priority:J.priority,frameworks:Y,fileName:H});continue}}if(H==="Gemfile"||H==="Gemfile.lock"||H==="gems.rb"){let G=E8(Q);if(G){let V={mainLanguage:"Ruby",packageManager:G.packageManager};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Ruby"]:["Ruby"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:H});continue}}if(H==="Package.swift"){let G=J6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:J.priority??36,frameworks:Y,fileName:H});continue}}if(H==="pom.xml"||H==="build.gradle"||H==="build.gradle.kts"||H==="settings.gradle"||H==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let G=X6(Q);if(G){let V={mainLanguage:G.mainLanguage==="Java/Kotlin"?"Kotlin":G.mainLanguage,packageManager:G.buildTool==="maven"?"maven":"gradle",buildTool:G.buildTool};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile")V.framework=G.framework||"Android";if(G.facets.includes("multiplatform"))V.framework=G.framework||"Kotlin Multiplatform";let Y=G.framework?[G.framework,"JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:H});continue}}Z.push({slots:J.slots||{},priority:J.priority,frameworks:J.frameworks,fileName:H})}return Z}function PI($){let Z=[];for(let Q of a2($,()=>D3($,2,{count:0}))){let z=Q5[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function K3($){let Z=[..._I($),...PI($)],Q={},z={},X=new Set;for(let V of Z){V.frameworks.forEach((Y)=>X.add(Y));for(let[Y,W]of Object.entries(V.slots))if(W&&!W.includes("/")&&(!(Y in Q)||V.priority>z[Y]))Q[Y]=W,z[Y]=V.priority}let U=new Map;for(let V of Z){if(!V.fileName)continue;if(!U.has(V.fileName))U.set(V.fileName,{fileName:V.fileName,category:LI(V.slots,V.frameworks),priority:V.priority})}let H=[...U.values()].sort((V,Y)=>Y.priority-V.priority||V.fileName.localeCompare(Y.fileName)),J=[];if(Q.mainLanguage)J.push(Q.mainLanguage.toLowerCase());if(Q.framework)J.push(Q.framework.toLowerCase());let G=J.length>0?J.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:H,stackSignature:G}}function b8($){let{slotFills:Z}=K3($),Q={};for(let[z,X]of Object.entries(Z)){let U=KI[z];if(!U||!X)continue;let[H,J]=U;if(H==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function D3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=v($);if(!X)return z;for(let U of X){if(Q.count++>400)break;if(!U.isDirectory()){let H=YI(U.name);if(qI.has(H))z.add(H);continue}if(BI.has(U.name)||U.name.startsWith("."))continue;for(let H of D3(VI($,U.name),Z-1,Q))z.add(H)}return z}var $0=($,Z,Q)=>({value:$,source:Z,confidence:Q});function L3($,Z={}){let Q=Z.toolingRoot?null:FI($),z=NI($),X={},U=(H,J)=>{if(J)X[H]=J};return U("what",AI(Q,z)),U("who",CI(z)),U("why",jI(z)),U("where",wI(Q,z)),U("when",SI(z)),U("how",EI(Q,z)),X}function y8($,Z={}){let Q=L3($,Z),z={};return Object.keys(Q).forEach((X)=>{let U=Q[X];if(U)z[X]=U.value}),z}function FI($){let Z=S($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function NI($){let Z=S($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
249
+ `}var FK='<meta name="description" content="Visual render of project.faf.';function RK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(FK)&&Z.includes(" by faf"))}function NK($,Z,Q,z="project.faf",X={}){$6(KK($,"project.html"),mZ(Z,Q,z),{root:$,format:"html",hasMark:RK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var TK=DK(mZ,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as cK}from"path";import{deprecate as dK}from"node:util";var Q$="https://faf.one/ext/context/v1",pZ="io.modelcontextprotocol.registry/publisher-provided";function S0($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:"application/vnd.faf+yaml",iana:"https://www.iana.org/assignments/media-types/application/vnd.faf+yaml",deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function I2($,Z={}){let Q={"one.faf/context":S0($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>4096)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${"4096"}B cap`);return{["io.modelcontextprotocol.registry/publisher-provided"]:Q}}var WQ="JSONRPC",dZ="1.0",M8=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],P8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",BQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",qQ="1.0",KQ="1.0",lZ={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function DQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function O2($,Z={}){let Q=DQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:dZ}];return[]}function AK($){try{return`https://${z$($)}/.well-known/fafa`}catch{return}}function iZ($,Z,Q={}){let z=S0(Z,Q),X=$.agent??{},H={fafaSpecVersion:String($.version??KQ),mediaTypes:[...M8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)H.agentId=X.id;let U=AK($);if(U)H.passport=U;return{uri:Q$,description:"FAF passport and project DNA as typed parts",required:!1,params:H}}function CK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&M8.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function F8($,Z={}){let Q=$.agent??{},z=O2($,Z);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let X=String(Q.displayName??$.metadata?.persona??Q.name??"").trim(),H=String(Q.description??"").trim(),U=String(Q.version??"").trim();if(!X||!H||!U)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let J=String(Q.vendor??"").trim(),G=String(Q.homepage??"").trim(),V=J&&G?{organization:J,url:G}:void 0,Y=($.capabilities??[]).map((W)=>{let B=String(W.name??"").trim();if(!B)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&M8.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:B,name:B,description:String(W.description??"").trim()||B,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:H,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:WQ,protocolVersion:String(W.version??dZ)})),...V?{provider:V}:{},version:U,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:CK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var jK=/^[a-z0-9][a-z0-9._-]*$/,wK=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,SK=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,EK=/^[A-Za-z0-9][^\s]*$/,bK=["a2a","mcp"],yK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function T($){return String($??"").trim()}function _8($){return Array.isArray($)?$.map(T).filter(Boolean):[]}function xK($){return T($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function gK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!T($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!jK.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!yK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function vK($,Z){return($.skills??[]).filter((Q)=>T(Q.name)).map((Q)=>({name:T(Q.name),type:T(Q.type)||"tool",description:T(Q.description)||T(Q.name),tags:Z.length?Z:[T(Q.name).toLowerCase()]}))}function kK($){let Z=($.packages??[]).filter((Q)=>T(Q.registryType)&&T(Q.identifier));for(let Q of Z){let z=T(Q.registryType),X=T(Q.identifier);if(z==="npm"&&!wK.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!SK.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z!=="npm"&&z!=="pypi"&&!EK.test(X))throw Error(`Package "${X}" is not a ${z} package identifier: it must start with a letter or digit and have no spaces.`)}return Z.map((Q)=>({registryType:T(Q.registryType),identifier:T(Q.identifier),...T(Q.version)?{version:T(Q.version)}:{}}))}function hK($){if(!/^https?:\/\/[^\s/]+/i.test(T($.url)))throw Error(`Where it runs: "${T($.url)}" is not an http(s) URL (or give an npm package).`);if(!bK.includes(T($.protocol).toLowerCase()))throw Error(`Protocol "${T($.protocol)}": a2a or mcp.`)}function uK($,Z){let Q=($.endpoints??[]).filter((X)=>T(X.url));Q.forEach(hK);let z=[...Q.map((X)=>({protocol:T(X.protocol).toLowerCase(),transport:"http",location:T(X.url)})),...Z.map((X)=>({protocol:"mcp",transport:"stdio",location:X.identifier}))];if(z.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return z}function fK($,Z,Q,z){let X={domain:Z},H=[["repository",T($.repository)],["icon",T($.icon)],["organizationUrl",T($.organization_url)]];for(let[J,G]of H)if(G)X[J]=G;if(Q.length)X.keywords=Q;let U=_8($.example_requests);if(U.length)X.examples=U;if(z.length)X.packages=z;return X}function LQ($){let Z=T($.handle).toLowerCase(),Q=xK($.domain);gK($,Z,Q);let z=_8($.tags),X=kK($),H={name:Z,displayName:T($.display_name),id:`urn:air:${Q}:agent:${Z}`,...T($.organization)?{vendor:T($.organization)}:{},version:T($.version),description:T($.description),homepage:T($.homepage)||`https://${Q}`,...T($.license)?{license:T($.license)}:{}};return{version:KQ,agent:H,capabilities:vK($,z),endpoints:uK($,X),metadata:{cards:fK($,Q,z,X)}}}function IQ($){return q2($,{lineWidth:0})}function z$($){let Z=T($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=T($.metadata?.cards?.domain);if(z)return z;try{return new URL(T($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function OQ($){let Z=T($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!Z)throw Error("The .fafa needs agent.name (the short name).");return Z}function nZ($){return`${z$($).split(".").reverse().join(".")}/${OQ($)}`}function cZ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function _2($){return($.endpoints??[]).filter((Z)=>T(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(T(Z.location))).map((Z)=>({type:"streamable-http",url:T(Z.location)}))}function mK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function _Q($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=T(Z.description),X=T(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let H={name:nZ($),version:X,description:cZ(z)},U=T(Z.displayName);if(U)H.title=cZ(U);let J=T(Z.homepage);if(J)H.websiteUrl=J;let G=mK(T(Q.repository));if(G)H.repository=G;if(T(Q.icon))H.icons=[{src:T(Q.icon)}];return H}function MQ($){return($.metadata?.cards?.packages??[]).map((Z)=>({registryType:T(Z.registryType),identifier:T(Z.identifier),...T(Z.version)?{version:T(Z.version)}:{},transport:{type:"stdio"}}))}function rZ($){return _2($).length>0||MQ($).length>0}function PQ($){let Z=T($.agent?.displayName);return{name:nZ($),...Z?{title:cZ(Z)}:{}}}function R8($,Z,Q={}){let z=_2($);if(z.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:P8,..._Q($),remotes:z,...Z?{_meta:{"one.faf/context":S0(Z,Q)}}:{}}}function FQ($,Z,Q={}){let z=_2($),X=MQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");return{$schema:BQ,..._Q($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:I2(Z,Q)}:{}}}function pK($,Z,Q){if(!Z.includes("a2a")||O2($,Q).length===0)return;return Q.a2aCardUrl??`https://${z$($)}/.well-known/agent-card.json`}function N8($,Z,Q={}){let z=z$($),X=OQ($),H=$.agent??{},U=T(H.displayName)||T(H.name),J=T(H.description),G=T(H.version),V=Q.now??new Date().toISOString(),Y=(K,L,q)=>({identifier:`urn:air:${z}:${K}:${X}`,displayName:U,type:L,description:J,url:q,...G?{version:G}:{},updatedAt:V}),W=[],B=pK($,Z,Q);if(B)W.push(Y("a2a",lZ.a2a,B));if(Z.includes("server_card")){let K=_2($)[0];if(K)W.push(Y("mcp",lZ.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(Y("agent",lZ.fafa,`https://${z}/.well-known/fafa`));return W}function T8($){let Z=$.agent??{},Q=T(Z.vendor)||T(Z.displayName)||T(Z.name);if(!Q)return;let z;try{z=z$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function RQ($,Z,Q={}){let z=T8($);return{specVersion:qQ,...z?{host:z}:{},entries:N8($,Z,Q)}}function sZ($){let Z=$.metadata?.cards??{},Q=_8(Z.keywords),z=_8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function NQ($,Z,Q={}){let z=T8($),X=sZ($);return{specVersion:qQ,...z?{host:z}:{},entries:N8($,Z,Q).map((H)=>({...H,...X}))}}function TQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:IQ($)},{faf:X}=Z;if(Q.has("a2a")){let U=[...Z.a2aExtensions??[],...X?[iZ($,X,Z)]:[]];z.a2a=F8($,{extensions:U})}if(Q.has("server_card"))z.server_card=R8($,X,Z);if(Q.has("server_json"))z.server_json=FQ($,X,Z);let H={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=RQ($,Z.cards,H);if(Q.has("ard"))z.ard=NQ($,Z.cards,H);return z}function lK($,Z){return TQ(LQ($),Z)}var iK=P8,nK=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function AQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&nK.test(Z))return Z;let Q=$.project?.homepage??$.project?.website??$.project?.url,z="local";if(Q)try{z=new URL(Q).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let X=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${z}/${X}`}function rK($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function Z6($,Z={}){let Q={$schema:iK,name:AQ($),version:String($.project?.version??"0.1.0"),description:rK($)},z=A8($)??$.project?.name;if(z&&z.length<=100)Q.title=z;let X=$.project?.homepage??$.project?.website??$.project?.url;if(X)Q.websiteUrl=X;if(Z.remoteUrl)Q.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return Q._meta={"one.faf/context":S0($,Z)},Q}function aZ($){return AQ($)}function A8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function sK($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var oZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function CQ($){let Z=sK($);return oZ(Z)&&oZ(Z._meta)&&oZ(Z._meta["one.faf/context"])}function oK($,Z,Q={},z={}){let X=Z6(Z,Q),H=cK($,"server-card");return $6(H,`${JSON.stringify(X,null,2)}
250
+ `,{root:$,format:"json",hasMark:CQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function aK($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return e$($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var tK=dK(Z6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as jQ}from"fs";import{basename as eK,dirname as SQ,join as wQ}from"path";import{deprecate as $D}from"node:util";var ZD=["a2a","mcp","registry","catalog","ard"];function QD($){return m0(Z0(h(SQ($),eK($))))}function zD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=wQ($,z);if(jQ(X))return X}let Q=SQ($);if(Q!==$)for(let z of Z){let X=wQ(Q,z);if(jQ(X))return X}return null}function tZ($,Z,Q={}){if(O2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");return F8($,{doorUrl:Q.doorUrl,extensions:Z?[iZ($,Z,Q)]:[]})}var XD=$D(tZ,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function HD($,Z={},Q={}){return N8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function UD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function JD($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:H,...U})=>({specVersion:H,host:{...Q},...U}))(z):z;for(let H of Z){let U=UD(X.entries,H);if(U>=0)X.entries[U]={...X.entries[U],url:H.url,type:H.type,...H.updatedAt?{updatedAt:H.updatedAt}:{}};else X.entries.push(H)}return X}function GD($,Z={}){return[...O2($,Z).length>0?["a2a"]:[],..._2($).length>0?["mcp"]:[],...rZ($)?["registry"]:[],"catalog","ard"]}function VD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=Q?ZD:z?GD(z,Z):[],H=new Set($.targets?.length?$.targets:X),U={};if(Q)U.block=S0(Q,Z);if(H.has("mcp"))if(z&&_2(z).length>0)U.mcp=R8(z,Q,Z);else if(Q)U.mcp=Z6(Q,Z);else throw Error("A Server Card needs an MCP endpoint at an http(s) URL in the .fafa, or a project.faf.");if(H.has("registry"))if(z&&rZ(z))U.registry={...PQ(z),...Q?{_meta:I2(Q,Z)}:{}};else if(Q){let J=A8(Q);U.registry={name:aZ(Q),...J?{title:J}:{},_meta:I2(Q,Z)}}else throw Error("A registry entry needs a package or a remote MCP URL in the .fafa, or a project.faf.");if(H.has("a2a")||H.has("catalog")||H.has("ard")){if(!$.fafa){if($.targets?.some((J)=>J==="a2a"||J==="catalog"||J==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(H.has("a2a")&&$.fafa)if(O2($.fafa,Z).length===0){if($.targets?.includes("a2a"))throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.")}else U.a2a=tZ($.fafa,Q,Z);if((H.has("catalog")||H.has("ard"))&&$.fafa){let J=HD($.fafa,Q,Z);if(H.has("catalog"))U.catalog=J;if(H.has("ard")){let V=sZ($.fafa);U.ard=J.map((Y)=>({...Y,...V}))}let G=T8($.fafa);if(G)U.catalogHost=G}return YD(U),U}function YD($){if(!$.block)return;let Z=JSON.stringify($.block),Q=[];if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry?._meta){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block");if($.a2a){let z=$.a2a.capabilities.extensions?.find((U)=>U.uri===Q$);if(!z)throw Error("A2A card has no FAF context extension, but a project.faf was given");let X=z.params,H=$.block;if(X.provenance?.faf!==H.faf||X.provenance?.mediaType!==H.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var eZ=["ephemeral","standard","high","critical"],z2=Object.fromEntries(eZ.map(($,Z)=>[$,Z])),C8=new Set(["user","feedback","project","reference"]),$1=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),Z1=new Set(["facts","sessions","preferences","custom"]),Q1={low:"ephemeral",medium:"standard"};import{existsSync as WD}from"fs";import{dirname as vQ,resolve as kQ}from"path";function M2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function BD($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(f($))return"empty";if(typeof $==="string")return`a string (${JSON.stringify($.length>40?`${$.slice(0,40)}…`:$)})`;return`a ${typeof $}`}var H$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function qD($){let Z=kQ($),Q=h(vQ(Z),Z,{read:!0});return{real:Q,text:Z0(Q)}}function EQ($,Z,Q,z){let X=kQ($),H=h(vQ(X),X),U=Q!==void 0&&Q.real===H;if(U&&Q.text===Z)return H;let J;try{J=I0(H)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return H;if(!U&&!z&&J)throw new b("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let G=U?Q.text:z?J:null;return e($,Z,G===void 0?{}:{expect:G})}function U$($){if(f($))return"standard";if(Q1[$])return Q1[$];if($ in z2)return $;return"standard"}var KD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function z1($){if(typeof $==="string")return{text:$,id:null,type:null,priority:"standard",tags:[],links:[],timestamp:null,source:null,extra:{}};if(!$||typeof $!=="object"||!("text"in $))throw Error(`fact must be a string or a mapping with 'text': ${JSON.stringify($)}`);let Z=$,Q={};for(let[z,X]of Object.entries(Z))if(!KD.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:U$(Z.priority),tags:Array.isArray(Z.tags)?Z.tags.slice():[],links:Array.isArray(Z.links)?Z.links.slice():[],timestamp:Z.timestamp??null,source:Z.source??null,extra:Q}}function X$($){if(f($.id)&&f($.type)&&$.tags.length===0&&$.links.length===0&&f($.timestamp)&&f($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!f($.id))Q.id=$.id;if(!f($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!f($.timestamp))Q.timestamp=$.timestamp;if(!f($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function bQ($){let Z=$;return H$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&H$(Z.extra)&&typeof Z.priority==="string"?Z:z1($)}function DD($){if(typeof $==="string"||H$($)&&"text"in $)return z1($);return null}var yQ=["profile","namepoint","created","last_etched","retention"];class Y0{namepoint;profile;retention;created;last_etched;_facts;_byId;_index;_sessions;_preferences;_custom;_extra;_memoryExtra;_version;_origin;_factAt=new WeakMap;_indexDerived=!0;_indexAtRecord=[];constructor($,Z={}){this.namepoint=$,this.profile=Z.profile??"knowledge",this.retention=Z.retention??"forever",this.created=Z.created??M2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(bQ):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),this._index=Z.index?Z.index.slice():[],this._sessions=Z.sessions?structuredClone(Z.sessions):[],this._preferences=Z.preferences?{...Z.preferences}:{},this._custom=Z.custom?{...Z.custom}:{},this._extra=Z.extra?{...Z.extra}:{},this._memoryExtra=Z.memoryExtra?{...Z.memoryExtra}:{},this._indexDerived=Z.index===void 0||l(this._index,this.derivedIndex()),this._indexAtRecord=this._index.slice()}get facts(){return this._facts}get index(){return this._index}get sessions(){return this._sessions}get preferences(){return this._preferences}get custom(){return this._custom}get extra(){return this._extra}get memoryExtra(){return this._memoryExtra}static load($){if(!WD($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=qD($);return Y0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=jZ($,Z).toJS();if(!H$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${BD(z)}`);let X=new hQ,H=X.pick("memory",z.memory,u)??{},U=new Y0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,H)});return(X.pick("memory.facts",H.facts,Array.isArray)??[]).forEach((J,G)=>{let V=DD(J);if(V)U.adopt(V,G)}),U.last_etched=String(z.last_etched??U.created),U._version=f(z.version)?void 0:String(z.version),U._origin={path:Z,real:Q,text:$,base:U.state(),residual:X.residual},U.recordIndex(),U}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!f($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return Y0.load($)}toDoc(){let $={facts:this._facts.map(X$),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!Z1.has(Q))$[Q]=structuredClone(z);let Z={version:this._version??"1.1",profile:this.profile,namepoint:this.namepoint,created:this.created,last_etched:this.last_etched,retention:this.retention,index:this._index.slice(),memory:$};for(let[Q,z]of Object.entries(this._extra))if(!$1.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return q2(this.toDoc(),{lineWidth:100})}derivedIndex($=80){return this._facts.map((Z)=>`${Z.id??"?"} — ${String(Z.text).slice(0,$)}`)}indexIsDerived($=80){return!this._origin?.residual.has("index")&&l(this._index,this.derivedIndex($))}rebuildIndex($=80){return this._index=this.derivedIndex($),this._indexDerived=!0,this._indexAtRecord=this._index.slice(),this._index}save($,Z={}){let Q=Z.reindex??(this._indexDerived&&l(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let G=this.toYaml(),V=EQ($,G,void 0,z);return this.settle($,G,new Map(this._facts.map((Y,W)=>[Y,W])),V),$}let H=new Map,{text:U}=q8(X.text,(G)=>{H=this.applyTo(G,X,Q)},$),J=EQ($,U,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,U,H,J),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,H]of Q)this._factAt.set(X,H);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(X$(Z)))}return{top:Object.fromEntries(yQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),H=Z.path;for(let U of yQ)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!l(z.index,X.index)){if(Z.residual.has("index")&&!Q)Y0.refuse(Z,"index","replace it");D8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of gQ(z.extra,X.extra))D8($,[U],z.extra[U],X.extra[U],H);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...gQ(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(l(U,J))continue;if(Z.residual.has("memory"))Y0.refuse(Z,"memory",`change memory.${H}`);if(Z.residual.has(`memory.${H}`))Y0.refuse(Z,`memory.${H}`,"replace it");D8($,["memory",H],U,J,Z.path)}}sortFacts($){let Z=[],Q=[];for(let z of this._facts){let X=this._factAt.get(z);if(X===void 0){Q.push(z);continue}if(Q.length>0||Z.length>0&&X<=Z[Z.length-1][1])throw Error(`${$.path}: the facts were reordered — faf keeps the order soul.fafm has. Nothing written.`);Z.push([z,X])}return{kept:Z,added:Q}}applyFacts($,Z){let{kept:Q,added:z}=this.sortFacts(Z),X=new Set(Q.map(([,V])=>V)),H=[...Z.base.facts.keys()].filter((V)=>!X.has(V)).sort((V,Y)=>Y-V),U=Q.filter(([V,Y])=>!l(Z.base.facts.get(Y),X$(V))),J=new Map(Q);if(z.length===0&&H.length===0&&U.length===0)return J;for(let V of["memory","memory.facts"])if(Z.residual.has(V))Y0.refuse(Z,V,"add facts to it");let G=b9($,["memory","facts"],Z.path);for(let[V,Y]of U)G.items[Y]=ID($,G.items[Y],Z.base.facts.get(Y),X$(V));for(let V of H)G.items.splice(V,1);for(let[V,Y]of Q)J.set(V,Y-H.filter((W)=>W<Y).length);for(let V of z)J.set(V,G.items.length),G.items.push($.createNode(X$(V)));return J}add($){let Z=bQ($);if(!f(Z.id)&&this._byId.has(Z.id)){let Q=this._byId.get(Z.id);if(Q!==void 0){let z=this._factAt.get(this._facts[Q]);if(this._facts[Q]=Z,z!==void 0)this._factAt.set(Z,z)}}else if(this._facts.push(Z),!f(Z.id))this._byId.set(Z.id,this._facts.length-1);if(Z.timestamp&&Z.timestamp>(this.last_etched||""))this.last_etched=Z.timestamp;return Z}etch($,Z={}){let Q=f(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(LD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:U$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:M2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=H$($)?{...$,...Z}:Z,z=H$($)?$.query:$,X=z2[U$(Q.minPriority??"ephemeral")]??0,H=typeof z==="string"?z.toLowerCase():"",U=new Set(Q.tags??[]),J=[];this._facts.forEach((V,Y)=>{if(H&&!String(V.text??"").toLowerCase().includes(H))return;if(U.size>0&&![...U].some((W)=>(V.tags??[]).includes(W)))return;if(!f(Q.type)&&V.type!==Q.type)return;if((z2[V.priority]??1)<X)return;J.push([Y,V])}),J.sort((V,Y)=>{let W=z2[V[1].priority]??1,B=z2[Y[1].priority]??1;if(B!==W)return B-W;let K=V[1].timestamp??"",L=Y[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return Y[0]-V[0]});let G=J.map(([,V])=>V);if(!f(Q.limit))return G.slice(0,Q.limit);return G}getFact($){let Z=this._byId.get($);return Z===void 0?null:this._facts[Z]}deleteFact($){let Z=this._byId.get($);if(Z===void 0)return!1;return this._facts.splice(Z,1),this._byId.clear(),this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),!0}}function LD($,Z,Q){let z=(X,H)=>f(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:U$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:M2(),extra:{...$.extra}}}class hQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,d$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,u)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,u)??{}),extra:xQ($,$1),memoryExtra:xQ(Z,Z1)}}}function xQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function gQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function ID($,Z,Q,z){if(!p(Z))return o$($,Z,Q,z);let X=(H)=>typeof H==="string"?{text:H}:H;return o$($,Z,X(Q),X(z))}import{readdirSync as OD,readFileSync as _D,statSync as uQ,existsSync as MD}from"fs";import{join as PD,basename as fQ,resolve as FD}from"path";var mQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),RD=/\[\[([^\]]+)\]\]/g;function ND($){let Z=uQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function TD($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=m0(Z[1]);if(!Q||typeof Q!=="object")return{fm:null,body:Z.slice(2).join("---").trim()};return{fm:Q,body:Z.slice(2).join("---").trim()}}catch{return{fm:null,body:$}}}function AD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!C8.has(X))return null;let H=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||H,G={};if(z.originSessionId)G.provenance=[`session:${z.originSessionId}`];let V=[...new Set([...Z.matchAll(RD)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:V,timestamp:ND($),source:`claude-code memory: ${fQ($)}`,extra:G}}function pQ($,Z={}){let Q=FD($);if(!MD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!uQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??mQ,X=Z.namepoint??`@claude-code:${fQ(Q)}`,H=[],U=OD(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=PD(Q,W),K;try{K=_D(B,"utf-8")}catch{continue}let{fm:L,body:q}=TD(K);if(!L)continue;let D=AD(B,q,L);if(D)H.push(D)}let J=H.map((W)=>W.timestamp).filter(Boolean),G=J.length?J.reduce((W,B)=>W<B?W:B):M2(),V=J.length?J.reduce((W,B)=>W>B?W:B):G,Y=new Y0(X,{profile:"knowledge",facts:H,created:G});return Y.last_etched=V,Y.rebuildIndex(),Y}var nQ="faf-interview/1",J$="(terse — 3-4 words)",X1=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${J$}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${J$}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${J$}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${J$}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${J$}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${J$}`,header:"How",type:"text",required:!0}],rQ=[{path:"project.main_language",question:"What is the primary programming language?",header:"Language",type:"select",required:!0,options:[{label:"TypeScript",value:"TypeScript",description:"JavaScript with types"},{label:"JavaScript",value:"JavaScript",description:"Vanilla JS or Node.js"},{label:"Python",value:"Python",description:"Python 3.x"},{label:"Rust",value:"Rust",description:"Systems programming"},{label:"Go",value:"Go",description:"Golang"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.frontend",question:"What frontend framework does it use?",header:"Frontend",type:"select",required:!1,options:[{label:"React",value:"React",description:"React.js"},{label:"Vue",value:"Vue",description:"Vue.js"},{label:"Svelte",value:"Svelte",description:"Svelte/SvelteKit"},{label:"Next.js",value:"Next.js",description:"React framework"},{label:"None",value:"None",description:"No frontend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.backend",question:"What backend framework does it use?",header:"Backend",type:"select",required:!1,options:[{label:"Express",value:"Express",description:"Node.js Express"},{label:"Fastify",value:"Fastify",description:"Node.js Fastify"},{label:"Django",value:"Django",description:"Python Django"},{label:"FastAPI",value:"FastAPI",description:"Python FastAPI"},{label:"None",value:"None",description:"No backend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.database",question:"What database does it use?",header:"Database",type:"select",required:!1,options:[{label:"PostgreSQL",value:"PostgreSQL",description:"Postgres"},{label:"MySQL",value:"MySQL",description:"MySQL/MariaDB"},{label:"SQLite",value:"SQLite",description:"Embedded SQL"},{label:"MongoDB",value:"MongoDB",description:"Document store"},{label:"None",value:"None",description:"No database"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.runtime",question:"What runtime does it run on?",header:"Runtime",type:"text",required:!1},{path:"stack.hosting",question:"Where is it hosted or distributed?",header:"Hosting",type:"text",required:!1},{path:"stack.build",question:"What is the build tool?",header:"Build",type:"text",required:!1},{path:"stack.cicd",question:"What CI/CD does it use?",header:"CI/CD",type:"text",required:!1}],G$=[...X1,...rQ],sQ=new Map(G$.map(($)=>[$.path,$])),CD=Object.fromEntries(G$.map(($)=>[$.path,$]));function H1($){let Z=sQ.get($);if(Z)return Z.question;let Q=g0.get($)??m.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function jD($,Z){return G$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let H of z)if(X&&typeof X==="object"&&H in X)X=X[H];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var wD=new Set(["developers","development teams","development team","teams","development","cloud platform","web platform","platform","best practices","improve development efficiency","development efficiency","modern development practices","modern development","test-driven development","production/stable","production","stable","app","project","tool"]),SD=[["npm",/\bnpm\b/i],["PyPI",/\bpypi\b/i],["crates.io",/\bcrates\.io\b/i],["Homebrew",/\bhomebrew\b/i],["Docker",/\bdocker\b/i],["Cloudflare",/\bcloudflare\b/i],["Vercel",/\bvercel\b/i],["Netlify",/\bnetlify\b/i],["AWS",/\baws\b/i],["Cloud Run",/\bcloud run\b/i],["edge",/\bedge\b/i],["browser",/\bbrowser\b/i],["WASM",/\bwasm\b/i],["GitHub",/\bgithub\b/i],["MCP Registry",/\bmcp registry\b/i],["Chrome Web Store",/\bchrome web store\b/i],["Smithery",/\bsmithery\b/i]],lQ=($)=>wD.has($.toLowerCase().trim()),ED=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function cQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&ED.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function oQ($){let Z={};if(!$||typeof $!=="string")return Z;let Q=$.trim(),z=Q.replace(/^[^A-Za-z0-9]+/,"").split(/\s+(?:for|that|which|to)\s+|\s+[—–]\s+|\s-\s|:\s|\.\s|,\s/)[0].trim(),X=cQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!lQ(X))Z.what=X;let H=SD.filter(([,G])=>G.test(Q)).map(([G])=>G);if(H.length)Z.where=H.slice(0,4).join(", ");let U=Q.match(/\bfor ((?:[A-Za-z][\w./+-]* )?(?:any |all )?(?:developers?|teams?|engineers?|builders?|users?|integrators?)\b[^.,;:—]*)/i),J=cQ((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!lQ(J))Z.who=J;return Z}function dQ($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function iQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!o(Z)}function bD($,Z={}){let Q=$&&typeof $==="object"?$:{},z=dQ(Q,"project.goal"),X=(iQ(z)?String(z).trim():"")||(Z.goal??"").trim(),H=oQ(X),U=Z.detailed??{},J={"project.goal":X||void 0,"human_context.what":H.what,"human_context.where":H.where,"human_context.who":H.who},G=(K)=>{let L=J[K];if(L)return{value:L,source:"project goal",confidence:0.9};let q=K.startsWith("human_context.")?K.slice(14):"",D=q?U[q]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},V=X1.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=dQ(Q,K.path);if(iQ(D))return{...q,value:String(D).trim(),status:"filled",seeded:!1};let O=G(K.path);if(O)return{...q,value:O.value,status:"seeded",seeded:!0,source:O.source,confidence:O.confidence};return{...q,value:"",status:"empty",seeded:!1}}),Y=V.filter((K)=>K.status==="filled").length,W=V.filter((K)=>K.status==="seeded").length,B=V.filter((K)=>K.status==="empty").length;return{version:nQ,rows:V,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function j8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||o(Z)}return!1}function yD($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function aQ($){if($==="project.goal")return!0;return g0.get($)?.category==="human"}function tQ($,Z=j8){let Q=[],z=[];for(let X of G$){let H=yD($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(aQ(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function eQ($,Z,Q=j8){let z=tQ(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let H=X==="needs-human"?U1(z):[];return{status:X,score:$,gaps:z,ask:H}}function U1($){return $.human.map((Z)=>({path:Z,question:H1(Z)}))}function xD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??j8,X=[],H=0;for(let J=0;J<=Q;J++){let G=$.read();if(!G)return{status:"no-faf",score:0,rounds:H,history:X,ask:[]};let V=$.score(G.yaml);X.push(V);let Y=eQ(V,G.data,z);if(Y.status==="done")return{status:"done",score:V,rounds:H,history:X,ask:[]};if(Y.status==="needs-human")return{status:"needs-human",score:V,rounds:H,history:X,ask:Y.ask};if(X.length>=2&&V<=X[X.length-2])return Y.gaps.human.length?{status:"needs-human",score:V,rounds:H,history:X,ask:U1(Y.gaps)}:{status:"stuck",score:V,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:V,rounds:H,history:X,ask:U1(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as Z3}from"crypto";var J1="faf-bench/1",gD={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function vD($,Z){return gD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var Q3=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],Q6=new Map;Q3.forEach(($,Z)=>$.forEach((Q)=>Q6.set(Q,Z)));var kD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function w8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function $3($){return w8($).split(" ").filter((Z)=>Z&&!kD.has(Z))}function z3($,Z){let Q=w8($),z=w8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=Q6.get(Q);if(X!==void 0&&Q6.get(z)===X)return!0;let H=$3($);if(H.length===0)return!1;let U=new Set($3(Z));return H.every((J)=>{if(U.has(J))return!0;let G=Q6.get(J);return G!==void 0&&[...U].some((V)=>Q6.get(V)===G)})}function hD($){let Z=X5($),Q=m0($),z=[],X={},H=0;for(let G of m){if(Z.slots[G.path]!=="populated")continue;let V=h1(Q,G);if(typeof V!=="string")continue;let Y=V.trim();if(!Y||D6.has(Y.toLowerCase()))continue;H+=1,z.push({n:H,path:G.path,question:vD(G.path,G.description)}),X[H]=Y}let U=JSON.stringify({v:J1,q:z.map((G)=>[G.path,G.question])}),J=Z3("sha256").update(U).digest("hex").slice(0,12);return{version:J1,qsetHash:J,questions:z,answers:X}}function uD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function fD($,Z){let Q=$.questions.map((X)=>{let H=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof H==="string"&&H.trim()!==""&&z3($.answers[X.n],H)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function mD($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:Z3("sha256").update(Q).digest("hex")}}import{join as qI,extname as KI,resolve as DI}from"path";var G1={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"Gemfile.lock":{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:34,intelligence:"high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"Package.swift":{frameworks:["Swift"],slots:{packageManager:"spm",mainLanguage:"Swift",buildTool:"swift build"},priority:36,intelligence:"ultra-high"},"*.csproj":{frameworks:["C#",".NET"],slots:{packageManager:"NuGet",mainLanguage:"C#",buildTool:"dotnet"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"settings.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:34,intelligence:"high"},"settings.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:34,intelligence:"high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","Swift"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",backend:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};import{join as lD}from"path";var V$={version:2,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs compose it. Bolster Dart/Flutter by editing THIS file. Logic stays in dart.ts. Refreshed 2026-08-01 (knowledge v2) — community receipt on top of 6.13.0 Dart Edition.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp","dart_mcpserver"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"],["jaspr","Jaspr"],["relic","Relic"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod_annotation","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"],["flutter_hooks","Hooks"]],routing:[["go_router","go_router"],["auto_route","auto_route"],["beamer","Beamer"],["routemaster","Routemaster"]]};var cD=V$.flutterDeps,dD=V$.mcpDeps,iD=V$.serverFrameworks,nD=V$.stateManagement,rD=V$.routing;function sD($){let Z=new Set,Q=!1;for(let z of $.split(`
251
+ `)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){Q=!0;continue}if(/^\S/.test(z))Q=!1;if(Q){let X=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(X)Z.add(X[1].toLowerCase())}}return Z}function S8($){let Z=S($,"pubspec.yaml");if(Z===null)return null;let Q=sD(Z),z=(_)=>Q.has(_.toLowerCase()),X=cD.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),H=dD.find(z),U=iD.find(([_])=>z(_)),J=nD.find(([_])=>z(_)),G=J?J[1]:"",V=rD.find(([_])=>z(_)),Y=V?V[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",B=/^executables:\s*$/m.test(Z),K=(v($,"bin")??[]).some((_)=>_.name.endsWith(".dart")),L=B||K,q,D="",O;if(X)if(D="Flutter",I($,lD("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))q="mobile",O="pubspec.yaml (Flutter app)";else q="library",O="pubspec.yaml (Flutter package)";else if(H)q="mcp",O=`pubspec.yaml + ${H} (Dart MCP server)`;else if(U)q="backend",D=U[1],O=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(L)q="cli",O=B?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else q="library",O="pubspec.yaml (Dart package)";return{appType:q,isFlutter:X,framework:D,stateManagement:G,routing:Y,testing:W,found:O}}import{join as aD}from"path";var E8={version:1,_doc:"SINGLE SOURCE of Go detection KNOWLEDGE (A+B hybrid, Truth-is-faf-cli). faf-cli imports this directly; SDKs/MCPs compose it. Bolster Go by editing THIS file. Logic stays in go.ts. Content-aware: go.mod ≠ one bucket — backend · CLI · MCP · library. 2026-08-01 initial (Dart composition pattern).",mcpModules:["github.com/mark3labs/mcp-go","github.com/modelcontextprotocol/go-sdk","github.com/metoro-io/mcp-golang","github.com/ThinkInAIXYZ/go-mcp"],serverFrameworks:[["github.com/gin-gonic/gin","Gin"],["github.com/labstack/echo","Echo"],["github.com/labstack/echo/v4","Echo"],["github.com/gofiber/fiber","Fiber"],["github.com/gofiber/fiber/v2","Fiber"],["github.com/go-chi/chi","Chi"],["github.com/go-chi/chi/v5","Chi"],["github.com/gorilla/mux","Gorilla Mux"],["github.com/gofiber/fiber/v3","Fiber"],["google.golang.org/grpc","gRPC"],["connectrpc.com/connect","Connect"],["github.com/go-kratos/kratos","Kratos"],["github.com/go-kratos/kratos/v2","Kratos"],["github.com/zeromicro/go-zero","go-zero"],["github.com/cloudwego/hertz","Hertz"]],cliFrameworks:[["github.com/spf13/cobra","Cobra"],["github.com/urfave/cli","urfave/cli"],["github.com/urfave/cli/v2","urfave/cli"],["github.com/alecthomas/kingpin","Kingpin"],["github.com/alecthomas/kong","Kong"]]};var tD=E8.mcpModules,eD=E8.serverFrameworks,$L=E8.cliFrameworks;function ZL($){let Z=new Set,Q=!1;for(let z of $.split(`
252
+ `)){let X=z.replace(/\/\/.*$/,"").trim();if(!X)continue;if(/^require\s*\(\s*$/.test(X)){Q=!0;continue}if(Q){if(X===")"){Q=!1;continue}let U=X.match(/^(\S+)/);if(U)Z.add(U[1].toLowerCase());continue}let H=X.match(/^require\s+(\S+)/);if(H&&H[1]!=="(")Z.add(H[1].toLowerCase())}return Z}function H3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function X3($,Z){let Q;for(let z of Z){if(!H3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function QL($,Z){let Q;for(let z of Z){if(!H3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function zL($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function XL($){for(let{name:Z}of v($,"cmd")??[]){let Q=aD("cmd",Z),z=O0($,Q);if(z?.isDirectory()){if((v($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function HL($){let Z=S($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function b8($){let Z=S($,"go.mod");if(Z===null)return null;let Q=zL(Z),z=ZL(Z),X=QL(z,tD),H=X3(z,eD),U=X3(z,$L),J=XL($),G=HL($),V,Y="",W;if(X)V="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(H)V="backend",Y=H[1],W=`go.mod + ${H[0]} (Go backend)`;else if(U)V="cli",Y=U[1],W=`go.mod + ${U[0]} (Go CLI)`;else if(J)V="cli",W="go.mod + cmd/ (Go CLI layout)";else if(G&&!H)V="cli",W="go.mod + main.go package main (Go CLI)";else V="library",W="go.mod (Go module)";return{appType:V,modulePath:Q,framework:Y,found:W}}var P2={version:1,_doc:"SINGLE SOURCE of C# /.NET detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Bolster C# by editing THIS file. Logic stays in csharp.ts. Content-aware: .csproj alone ≠ type — Sdk first, then props/packages. Kill line: .csproj alone ≠ type. 2026-08-01 initial.",mcpPackages:["ModelContextProtocol","ModelContextProtocol.AspNetCore","ModelContextProtocol.Core","ModelContextProtocol.Extensions.Tasks","ModelContextProtocol.Extensions.Apps"],cliPackages:[["System.CommandLine","System.CommandLine"],["Spectre.Console.Cli","Spectre.Console"],["Spectre.Console","Spectre.Console"],["McMaster.Extensions.CommandLineUtils","McMaster"]],testPackages:[["Microsoft.NET.Test.Sdk","VSTest"],["xunit.v3","xUnit"],["xunit","xUnit"],["NUnit","NUnit"],["MSTest.TestFramework","MSTest"],["MSTest","MSTest"]],grpcServerPackages:["Grpc.AspNetCore"],specializedSdks:[["Microsoft.NET.Sdk.Web","web","ASP.NET Core"],["Microsoft.NET.Sdk.Worker","worker","Worker"],["Microsoft.NET.Sdk.BlazorWebAssembly","blazor-wasm","Blazor WebAssembly"],["Microsoft.NET.Sdk.Razor","razor-lib","Razor Class Library"],["MSTest.Sdk","test","MSTest"],["Aspire.AppHost.Sdk","aspire","Aspire AppHost"]],baseSdk:"Microsoft.NET.Sdk"};var JL=P2.mcpPackages.map(($)=>$.toLowerCase()),GL=P2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),VL=P2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),YL=P2.grpcServerPackages.map(($)=>$.toLowerCase()),WL=P2.specializedSdks,U3=P2.baseSdk.toLowerCase();function BL($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),H=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],J=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||H||"").trim(),G=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),V=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),Y=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),B=new Set;for(let L of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());for(let L of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());let K=new Set;for(let L of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))K.add(L[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:J,isTestProject:G,useMaui:V,useWpf:Y,useWindowsForms:W,packages:B,frameworkRefs:K}}function V1($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let z of $)if(z===Q||z.startsWith(`${Q}.`))return!0;return!1}function J3($,Z){let Q;for(let[z,X]of Z){if(!V1($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function qL($){let Z;for(let Q of JL){if(!V1($,Q))continue;if(!Z||Q.length>Z.length)Z=Q}for(let Q of $)if(Q==="modelcontextprotocol"||Q.startsWith("modelcontextprotocol.")){if(!Z||Q.length>Z.length)Z=Q}return Z}function KL($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of WL){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function y8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function DL($,Z){if($==="mcp")return 0;if($==="mobile")return 1;if($==="backend")return 2;if($==="cli")return 3;if(Z&&Z!=="")return 4;return 5}function LL($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:H,outputType:U}=$,J,G="",V,Y=qL(X),W=KL(z),B=J3(X,VL),K=J3(X,GL),L=YL.some((D)=>V1(X,D)),q=H.has("microsoft.aspnetcore.app");if(Y)J="mcp",G="MCP",V=`${Z} + ${Y} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||B)J="library",G=B?.[1]||(W?.[1]==="test"?W[2]:"Test"),V=`${Z} + test (${G})`;else if($.useMaui)J="mobile",G="MAUI",V=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)J="backend",G=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",V=`${Z} + ${G}`;else if(W?.[1]==="web")J="backend",G=L?"gRPC":W[2],V=`${Z} + Sdk=${W[0]}${L?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")J="library",G=W[2],V=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(q&&y8(U))J="backend",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!y8(U))J="library",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(y8(U)||!U))J="cli",G=K[1],V=`${Z} + ${K[0]} (C# CLI)`;else if(y8(U))J="cli",V=`${Z} + OutputType=Exe (C# console)`;else{J="library";let D=z?` Sdk=${z}`:"";if(V=`${Z}${D} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===U3||z.toLowerCase().startsWith(`${U3}/`))V=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:G,found:V}}function Y$($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function x8($){let Z=Y$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let H=S($,X);if(H===null)continue;let U=BL(H),J=LL(U,X),G=DL(J.appType,J.framework);if(!Q||G<z)Q=J,z=G}return Q}import{join as F2}from"path";var M0={version:1,_doc:"SINGLE SOURCE of JVM (Java/Kotlin) detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Bolster JVM by editing THIS file. Logic stays in jvm.ts. Kill line: pom / gradle alone ≠ type. Content-aware: plugins · parents · packaging · deps · version catalogs. One brand JVM — Android/KMP are facets, not a second Kotlin Edition. 2026-08-03 initial (post-intel).",mcpArtifacts:["io.modelcontextprotocol.sdk:mcp","io.modelcontextprotocol.sdk:mcp-core","io.modelcontextprotocol.sdk:mcp-spring-webflux","io.modelcontextprotocol.sdk:mcp-spring-webmvc","org.springframework.ai:spring-ai-starter-mcp-server","org.springframework.ai:spring-ai-starter-mcp-server-webmvc","org.springframework.ai:spring-ai-starter-mcp-server-webflux","org.springframework.ai:spring-ai-starter-mcp-client","org.springframework.ai:spring-ai-mcp-server-spring-boot-starter","org.springframework.ai:spring-ai-mcp-client-spring-boot-starter","io.modelcontextprotocol:kotlin-sdk","io.modelcontextprotocol.kotlin:mcp"],webPlugins:[["org.springframework.boot","Spring Boot"],["io.quarkus","Quarkus"],["io.quarkus.gradle.plugin","Quarkus"],["io.micronaut.application","Micronaut"],["io.micronaut.library","Micronaut"]],webParents:[["org.springframework.boot:spring-boot-starter-parent","Spring Boot"],["io.quarkus.platform:quarkus-bom","Quarkus"],["io.micronaut.platform:micronaut-parent","Micronaut"]],webArtifacts:[["org.springframework.boot:spring-boot-starter-web","Spring Boot"],["org.springframework.boot:spring-boot-starter-webflux","Spring Boot"],["org.springframework.boot:spring-boot-starter","Spring Boot"],["io.quarkus:quarkus-core","Quarkus"],["io.micronaut:micronaut-http-server-netty","Micronaut"],["io.ktor:ktor-server-core","Ktor"],["io.ktor:ktor-server-netty","Ktor"],["io.ktor:ktor-server-cio","Ktor"]],androidPlugins:["com.android.application","com.android.library","com.android.kotlin.multiplatform.library"],kmpPlugins:["org.jetbrains.kotlin.multiplatform","kotlin-multiplatform"],jvmKotlinPlugins:["org.jetbrains.kotlin.jvm","kotlin-jvm","org.jetbrains.kotlin.android","kotlin-android"],cliPlugins:[["org.gradle.application","application"],["application","application"]],cliArtifacts:[["info.picocli:picocli","Picocli"],["com.github.ajalt.clikt:clikt","Clikt"],["com.github.ajalt.clikt:clikt-jvm","Clikt"]],libraryPlugins:["java-library","org.gradle.java-library"]};var OL=M0.mcpArtifacts.map(($)=>$.toLowerCase()),_L=M0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),ML=M0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),PL=M0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),LN=M0.androidPlugins.map(($)=>$.toLowerCase()),FL=M0.kmpPlugins.map(($)=>$.toLowerCase()),RL=M0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),NL=M0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),TL=M0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),AL=M0.libraryPlugins.map(($)=>$.toLowerCase()),CL=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function Y1($){return CL.some((Z)=>I($,Z))}function jL($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
253
+ `)){let H=X.replace(/#.*$/,"").trim();if(!H)continue;let U=H.match(/^\[([^\]]+)\]$/);if(U){z=U[1].trim().toLowerCase();continue}let J=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(J&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(J[1].replace(/-/g,".").toLowerCase(),J[2].toLowerCase()),Z.set(J[1].toLowerCase(),J[2].toLowerCase());continue}let G=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(G&&(z==="libraries"||z.endsWith(".libraries"))){let W=G[1].toLowerCase();Q.set(W,G[2].toLowerCase()),Q.set(W.replace(/-/g,"."),G[2].toLowerCase());continue}let V=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${V[2]}:${V[3]}`.toLowerCase(),B=V[1].toLowerCase();Q.set(B,W),Q.set(B.replace(/-/g,"."),W);continue}let Y=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(Y){let W=Y[1].toLowerCase(),B=Y[2];if(z==="plugins"||z.endsWith(".plugins")){let K=B.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=B.split(":");if(K.length>=2){let L=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,L),Q.set(W.replace(/-/g,"."),L)}}}}return{plugins:Z,libraries:Q}}function wL($){let Z=S($,F2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return jL(Z)}function SL($){let Z=[];for(let Q of $.matchAll(/include\s*\(\s*([^)]+)\)/g))for(let z of Q[1].split(",")){let X=z.replace(/['":\s]/g,"").replace(/^:/,"");if(X)Z.push(X.replace(/:/g,"/"))}for(let Q of $.matchAll(/include\s+((?:['"][^'"]+['"]\s*,?\s*)+)/g))for(let z of Q[1].split(",")){let X=z.replace(/['":\s]/g,"").replace(/^:/,"");if(X)Z.push(X.replace(/:/g,"/"))}for(let Q of $.matchAll(/project\s*\(\s*["']:([^"']+)["']\s*\)\s*\.projectDir\s*=\s*file\s*\(\s*["']([^"']+)["']\s*\)/g))Z.push(Q[2].replace(/^\.\//,""));return[...new Set(Z)]}function EL($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let H=X.replace(/\/\/.*$/,"").trim();if(!H||H.startsWith("id")||H.startsWith("kotlin")||H.startsWith("alias"))continue;let U=H.match(/^`([a-zA-Z0-9.-]+)`$/)||H.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(U)Q.add(U[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),H=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(H)Q.add(H);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function bL($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let H=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let U of H){let J=Z.libraries.get(U);if(J){Q.add(J.includes(":")?J.split(":").slice(0,2).join(":"):J);break}}}return Q}function Y3($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,z=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(z){let U=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),J=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(U&&J)Q.add(`${U}:${J}`.toLowerCase())}let X=new Set;for(let U of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let J=U[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),G=U[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&G)X.add(`${J}:${G}`.toLowerCase())}let H=[];for(let U of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))H.push(U[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:H}}function p0($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let z of $)if(z===Q||z.endsWith(`.${Q}`)||z===Q.replace(/^org\.gradle\./,""))return!0;return!1}function z6($,Z,Q){let z;for(let[X,H]of Z){let U=!1;if(Q==="plugin")U=p0($,X);else if(U=$.has(X)||[...$].some((J)=>J===X||J.startsWith(`${X}:`)||J.startsWith(`${X}.`)),!U&&Q==="artifact")U=[...$].some((J)=>J===X||J.startsWith(`${X}`));if(!U)continue;if(!z||X.length>z[0].length)z=[X,H]}return z}function yL($){let Z;for(let Q of OL)for(let z of $){if(z===Q||z.startsWith(`${Q}:`)||z.startsWith(Q.replace(/:mcp$/,":"))){if(!Z||Q.length>Z.length)Z=Q}if(z.startsWith("io.modelcontextprotocol")||z.includes("spring-ai-starter-mcp")||z.includes("spring-ai-mcp")){if(!Z||z.length>Z.length)Z=z}}return Z}function W3($,Z){let Q=new Set,z=!1,X=!1,H=[F2(Z,"src"),F2(Z,"src","main")],U=(J,G)=>{if(G>4)return;let V=v($,J);if(!V)return;for(let{name:Y}of V){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=F2(J,Y),B=O0($,W);if(!B)continue;if(B.isDirectory())U(W,G+1);else if(Y.endsWith(".kt")||Y.endsWith(".kts"))z=!0;else if(Y.endsWith(".java"))X=!0}};for(let J of H)U(J,0);return{kotlin:z,java:X,hints:Q}}function xL($){let Z=[],Q=$.plugins,z=$.artifacts,X=FL.some((F)=>p0(Q,F))||$.sourceHints.has("commonMain"),H=p0(Q,"com.android.application"),U=p0(Q,"com.android.library")||p0(Q,"com.android.kotlin.multiplatform.library");if(H||U)Z.push("android");if(X)Z.push("multiplatform");let J=yL(z),G=z6(Q,_L,"plugin"),V=z6($.parents,ML,"parent"),Y=z6(z,PL,"artifact"),W=z6(Q,NL,"plugin"),B=z6(z,TL,"artifact"),K=AL.some((F)=>p0(Q,F)),L=$.packaging==="pom",q,D="",O;if(H)q="mobile",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + com.android.application (${D})`;else if(J)q="mcp",D="MCP",Z.push("mcp"),O=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(G||V||Y){q="backend",D=G?.[1]||V?.[1]||Y?.[1]||"JVM";let F=G?.[0]||V?.[0]||Y?.[0]||"web";O=`${$.path||"root"} + ${F} (JVM backend)`}else if(X&&!U)q="library",D="Kotlin Multiplatform",O=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(U)q="library",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)q="cli",D=B?.[1]||"application",O=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)q="cli",D="application",O=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)q="library",O=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{q="library";let F=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(O=`${$.path||"root"} (${F} library)`,K)O=`${$.path||"root"} + java-library (JVM library)`}let _="Java";if($.kotlinSources&&$.javaSources)_="Java/Kotlin";else if($.kotlinSources||RL.some((F)=>p0(Q,F))||X)_="Kotlin";let C=[...new Set(Z)];return{appType:q,framework:D,facets:C,found:O,buildTool:$.buildTool,mainLanguage:_}}function gL($,Z){if($==="mcp")return 0;if($==="mobile")return 1;if(Z.includes("multiplatform")&&$==="backend")return 2;if($==="backend")return 3;if($==="cli")return 4;if(Z.includes("multiplatform"))return 5;if(Z.includes("android"))return 6;return 7}function G3($,Z,Q){let z=F2(Z,"build.gradle.kts"),X=F2(Z,"build.gradle"),H=I($,z)?z:I($,X)?X:null;if(!H)return null;let U=S($,H);if(!U)return null;let J=EL(U,Q),G=bL(U,Q),V=W3($,Z),Y=/mainClass\s*[.=]/.test(U)||/mainClassName\s*=/.test(U)||/Main-Class/.test(U),W=p0(J,"application")||p0(J,"org.gradle.application");return{path:Z||"build.gradle",plugins:J,artifacts:G,packaging:"jar",parents:new Set,hasMainClass:Y,hasApplicationPlugin:W,sourceHints:V.hints,kotlinSources:V.kotlin||H.endsWith(".kts"),javaSources:V.java,buildTool:"gradle"}}function V3($,Z){let Q=S($,F2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=Y3(Q),U=W3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:H,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:U.hints,kotlinSources:U.kotlin,javaSources:U.java,buildTool:"maven"}}function X6($){if(!Y1($))return null;let Z=wL($),Q=[],z=null;for(let V of["settings.gradle.kts","settings.gradle"])if(I($,V)){z=S($,V);break}let X=z?SL(z):[],H=G3($,"",Z);if(H)Q.push(H);for(let V of X){let Y=G3($,V,Z);if(Y)Q.push(Y)}let U=V3($,"");if(U){Q.push(U);let V=S($,"pom.xml");if(V){let{modules:Y}=Y3(V);for(let W of Y){let B=V3($,W);if(B)Q.push(B)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let J=null,G=999;for(let V of Q){let Y=xL(V),W=gL(Y.appType,Y.facets);if(!J||W<G)J={appType:Y.appType,framework:Y.framework,buildTool:Y.buildTool,mainLanguage:Y.mainLanguage,facets:Y.facets,found:Y.found},G=W}if(J&&X.length>0&&!J.found.includes("multi-project"));return J}import{join as kL}from"path";var H6={version:1,_doc:"SINGLE SOURCE of Ruby detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Kill line: Gemfile alone ≠ Rails. Content-aware: gem names + light layout. 2026-08-03 initial (post-intel ruby-edition).",mcpGems:["mcp","fast-mcp","fast_mcp","rails-mcp-server","rails_mcp_server","ruby-mcp-client","ruby_mcp_client","ruby_llm-mcp","ruby_llm_mcp"],webGems:[["rails","Rails"],["railties","Rails"],["sinatra","Sinatra"],["sinatra-contrib","Sinatra"],["roda","Roda"],["grape","Grape"],["hanami","Hanami"],["hanami-controller","Hanami"],["rack","Rack"]],cliGems:[["thor","Thor"],["gli","GLI"],["commander","Commander"],["slop","Slop"]],railsLayoutFiles:["config/application.rb","config/routes.rb","bin/rails","config/environment.rb"]};var hL=H6.mcpGems.map(($)=>$.toLowerCase()),uL=H6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),B3=H6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),fL=H6.railsLayoutFiles;function mL($){return I($,"Gemfile")||I($,"gems.rb")||pL($)}function pL($){return(v($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function lL($){let Z=new Set;for(let Q of $.split(`
254
+ `)){let z=Q.replace(/#.*$/,"").trim();if(!z)continue;let X=z.match(/^\s*gem\s+['"]([^'"]+)['"]/i)||z.match(/^\s*gem\s+:([A-Za-z0-9_.-]+)/i);if(X)Z.add(X[1].toLowerCase())}return Z}function cL($){let Z=new Set,Q=!1;for(let z of $.split(`
255
+ `)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let H=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(H)Z.add(H[1].toLowerCase())}}return Z}function dL($){let Z=new Set;for(let Q of $.split(`
256
+ `)){let X=Q.replace(/#.*$/,"").match(/add_(?:runtime_|development_)?dependency\s*\(?\s*['"]([^'"]+)['"]/i);if(X)Z.add(X[1].toLowerCase())}return Z}function iL($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let H=S($,X);if(H){for(let U of lL(H))Z.add(U);Q.push(X)}}let z=S($,"Gemfile.lock")||S($,"gems.locked");if(z){for(let X of cL(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let H=S($,X);if(H){for(let U of dL(H))Z.add(U);Q.push(X)}}return{gems:Z,sources:Q}}function U6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function W1($,Z){let Q;for(let[z,X]of Z){if(!U6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function nL($){let Z;for(let Q of hL)if(U6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function q3($){for(let Z of fL)if(I($,Z))return Z;return}function rL($,Z){let Q=W1(Z,B3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let H=S($,X);if(H&&/executables\s*=/.test(H)&&!/executables\s*=\s*\[\s*\]/.test(H))return{hit:!0,why:`${X} executables`}}let z=v($,"bin");if(z){let H=z.map((U)=>U.name).filter((U)=>{if(U==="setup"||U==="console"||U==="rake")return!1;return O0($,kL("bin",U))?.isFile()===!0}).filter((U)=>U!=="rails");if(H.length>0&&!U6(Z,"rails")&&!q3($))return{hit:!0,why:`bin/${H[0]}`}}return{hit:!1,why:""}}function g8($){if(!mL($))return null;let{gems:Z,sources:Q}=iL($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",H=nL(Z),U=W1(Z,uL),J=q3($),G=U6(Z,"rails")||U6(Z,"railties"),V=rL($,Z),Y=I($,"config.ru"),W=G||!!J,B=U&&U[1]!=="Rails"&&!(U[0]==="rack"&&!Y)?U:void 0,K,L="",q;if(H)K="mcp",L="MCP",q=`${z} + gem ${H} (Ruby MCP)`;else if(W)if(K="backend",L="Rails",G&&J)q=`${z} + rails + ${J} (Rails)`;else if(G)q=`${z} + gem rails (Rails)`;else q=`${J} (Rails layout)`;else if(B)K="backend",L=B[1],q=`${z} + gem ${B[0]} (Ruby backend)`;else if(V.hit)K="cli",L=W1(Z,B3)?.[1]||"",q=`${z} + ${V.why} (Ruby CLI)`;else K="library",q=`${z} (Ruby library)`;return{appType:K,framework:L,packageManager:X,found:q}}import{join as oL}from"path";var E0={version:1,_doc:"SINGLE SOURCE of Swift detection KNOWLEDGE (Truth-is-faf-cli). Kill line: Package.swift alone ≠ app. Static parse of products + package URLs + product names + light xcodeproj productType. Never execute Package.swift / swift build. 2026-08-03 post-intel swift-edition.",mcpPackageUrls:["modelcontextprotocol/swift-sdk","github.com/modelcontextprotocol/swift-sdk"],mcpProducts:["MCP"],serverPackageUrls:[["vapor/vapor","Vapor"],["github.com/vapor/vapor","Vapor"],["hummingbird-project/hummingbird","Hummingbird"],["github.com/hummingbird-project/hummingbird","Hummingbird"]],serverProducts:[["Vapor","Vapor"],["Hummingbird","Hummingbird"]],cliPackageUrls:[["apple/swift-argument-parser","ArgumentParser"],["github.com/apple/swift-argument-parser","ArgumentParser"]],cliProducts:[["ArgumentParser","ArgumentParser"]],appProductTypes:["com.apple.product-type.application"],cliProductTypes:["com.apple.product-type.tool"],vaporLayoutFiles:["Sources/App/configure.swift","Sources/App/routes.swift","Sources/App/entrypoint.swift"]};var aL=E0.mcpPackageUrls.map(($)=>$.toLowerCase()),tL=E0.mcpProducts.map(($)=>$.toLowerCase()),eL=E0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),$I=E0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),ZI=E0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),QI=E0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),zI=E0.appProductTypes,XI=E0.cliProductTypes,HI=E0.vaporLayoutFiles;function UI($){return I($,"Package.swift")||B1($).length>0}function B1($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&O0($,Z)?.isDirectory()===!0)}function JI($){let Z=GI($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,H;while((H=X.exec(Z))!==null)z.push(H[1]);let U=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((H=U.exec(Z))!==null)z.push(H[1]);let J=[],G=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((H=G.exec(Z))!==null)J.push(H[1]);let V=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((H=V.exec(Z))!==null)J.push(H[1]);let Y=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),B=/\.plugin\s*\(/.test(Q)&&!Y&&!W?!0:/\bproducts\s*:\s*\[[\s\S]*?\.plugin\s*\(/.test(Q),K=/\.executabletarget\s*\(/.test(Q),L=/\.target\s*\(/.test(Q)&&!K?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:z,productNames:J,hasLibraryProduct:Y,hasExecutableProduct:W,hasPluginProduct:!!B,hasExecutableTarget:K,hasLibraryTarget:L}}function GI($){let Z="",Q=0;while(Q<$.length){if($[Q]==='"'||$[Q]==="'"){let z=$[Q];Z+=z,Q++;while(Q<$.length){if($[Q]==="\\"&&Q+1<$.length){Z+=$[Q]+$[Q+1],Q+=2;continue}if(Z+=$[Q],$[Q]===z){Q++;break}Q++}continue}if($[Q]==="/"&&$[Q+1]==="/"){Q+=2;while(Q<$.length&&$[Q]!==`
257
+ `)Q++;continue}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<$.length&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;Q+=2;continue}Z+=$[Q],Q++}return Z}function VI($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let H of Q)if(H.includes(X)&&(!z||X.length>z.length))z=X;return z}function K3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,H]of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z[0].length))z=[X,H];return z}function D3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,H]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,H];return z}function YI($){let Z=$.map((Q)=>Q.toLowerCase());return tL.some((Q)=>Z.includes(Q))}function WI($){let Z=!1,Q=!1,z;for(let X of B1($)){let H=S($,oL(X,"project.pbxproj"));if(!H)continue;for(let U of zI)if(H.includes(U))Z=!0,z=U;for(let U of XI)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function BI($){for(let Z of HI)if(I($,Z))return Z;return}function J6($){if(!UI($))return null;let Z=I($,"Package.swift"),Q=B1($),z=Q.length>0,X=null;if(Z){let P=S($,"Package.swift");if(P)X=JI(P)}let H=z?WI($):{hasApplication:!1,hasTool:!1},U=BI($),J=X?.packageUrls??[],G=X?.productNames??[],V=VI(J,aL),Y=YI(G),W=K3(J,eL),B=D3(G,$I),K=K3(J,ZI),L=D3(G,QI),q=!!(V||Y),D=!!(W||B||U),O=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),_=!!(K||L),C=H.hasApplication,F=Z&&z?"spm+xcode":Z?"spm":"xcode",R,N="",w;if(q)if(R="mcp",N="MCP",Y)w="Package.swift + product MCP (Swift MCP)";else w=`Package.swift + ${V} (Swift MCP)`;else if(D)if(R="backend",N=B?.[1]||W?.[1]||(U?"Vapor":""),B)w=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)w=`Package.swift + ${W[1]} (Swift backend)`;else w=`${U} (Swift backend layout)`;else if(C)R="app",N="",w=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(_||O&&!D&&!q)if(R="cli",N=L?.[1]||K?.[1]||"",L)w=`Package.swift + product ${L[1]} (Swift CLI)`;else if(K)w=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)w="Package.swift + .executable product (Swift CLI)";else w="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Z)R="cli",w=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(R="library",X?.hasLibraryProduct)w="Package.swift + .library product (Swift library)";else w="Package.swift (Swift library)";else R="library",w=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:R,framework:N,packageManager:F,found:w}}var LI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),II=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),OI={mainLanguage:["project","main_language"],main_language:["project","main_language"],framework:["stack","frontend"],cssFramework:["stack","css_framework"],css:["stack","css_framework"],uiLibrary:["stack","ui_library"],ui_library:["stack","ui_library"],stateManagement:["stack","state_management"],state:["stack","state_management"],backend:["stack","backend"],apiType:["stack","api_type"],api:["stack","api_type"],runtime:["stack","runtime"],database:["stack","database"],db:["stack","database"],connection:["stack","connection"],hosting:["stack","hosting"],buildTool:["stack","build"],build_tool:["stack","build"],build:["stack","build"],packageManager:["stack","package_manager"],pkg_manager:["stack","package_manager"],cicd:["stack","cicd"]},_I=[["packageManager","package-manager"],["pkg_manager","package-manager"],["mainLanguage","language"],["main_language","language"],["framework","framework"],["backend","backend"],["database","database"],["db","database"],["cicd","ci-cd"],["hosting","hosting"],["buildTool","build"],["build_tool","build"],["build","build"],["runtime","runtime"],["cssFramework","css"],["css","css"],["uiLibrary","ui-library"],["stateManagement","state-management"],["apiType","api"],["api","api"]];function MI($,Z){for(let[Q,z]of _I)if(Q in $)return z;return Z.length>0?"framework":"config"}function PI($,Z){try{let Q=JSON.parse(S($,Z)??""),z=["background","content_scripts","action","browser_action","permissions"].some((X)=>(X in Q));if(typeof Q.manifest_version==="number"&&z)return"chrome";return"other"}catch{return"other"}}function FI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isFile()===!0}function RI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isDirectory()===!0}function NI($){let Z=[],Q=DI($),z=new Set,X=v(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!RI(Q,H):!FI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let G=x8(Q);if(G){let V={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile"&&G.framework)V.framework=G.framework;if(G.targetFramework)V.runtime=G.targetFramework;let Y=G.framework?[G.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:V,priority:36,frameworks:Y,fileName:U})}continue}if(U.endsWith(".xcodeproj")){let G=J6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="spm"?"spm":"Xcode",buildTool:G.packageManager.includes("spm")?"swift build":"xcodebuild"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:36,frameworks:Y,fileName:U})}continue}let J=G1[U];if(!J)continue;if(U==="manifest.json"&&PI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let G=S8(Q);if(G){let V={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(V.framework="Flutter",G.stateManagement)V.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="mcp")V.apiType="MCP";Z.push({slots:V,priority:J.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}if(U==="go.mod"){let G=b8(Q);if(G){let V={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Go"]:["Go"];Z.push({slots:V,priority:J.priority,frameworks:Y,fileName:U});continue}}if(U==="Gemfile"||U==="Gemfile.lock"||U==="gems.rb"){let G=g8(Q);if(G){let V={mainLanguage:"Ruby",packageManager:G.packageManager};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Ruby"]:["Ruby"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:U});continue}}if(U==="Package.swift"){let G=J6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:J.priority??36,frameworks:Y,fileName:U});continue}}if(U==="pom.xml"||U==="build.gradle"||U==="build.gradle.kts"||U==="settings.gradle"||U==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let G=X6(Q);if(G){let V={mainLanguage:G.mainLanguage==="Java/Kotlin"?"Kotlin":G.mainLanguage,packageManager:G.buildTool==="maven"?"maven":"gradle",buildTool:G.buildTool};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile")V.framework=G.framework||"Android";if(G.facets.includes("multiplatform"))V.framework=G.framework||"Kotlin Multiplatform";let Y=G.framework?[G.framework,"JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:U});continue}}Z.push({slots:J.slots||{},priority:J.priority,frameworks:J.frameworks,fileName:U})}return Z}function TI($){let Z=[];for(let Q of e2($,()=>I3($,2,{count:0}))){let z=G1[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function L3($){let Z=[...NI($),...TI($)],Q={},z={},X=new Set;for(let V of Z){V.frameworks.forEach((Y)=>X.add(Y));for(let[Y,W]of Object.entries(V.slots))if(W&&!W.includes("/")&&(!(Y in Q)||V.priority>z[Y]))Q[Y]=W,z[Y]=V.priority}let H=new Map;for(let V of Z){if(!V.fileName)continue;if(!H.has(V.fileName))H.set(V.fileName,{fileName:V.fileName,category:MI(V.slots,V.frameworks),priority:V.priority})}let U=[...H.values()].sort((V,Y)=>Y.priority-V.priority||V.fileName.localeCompare(Y.fileName)),J=[];if(Q.mainLanguage)J.push(Q.mainLanguage.toLowerCase());if(Q.framework)J.push(Q.framework.toLowerCase());let G=J.length>0?J.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:U,stackSignature:G}}function v8($){let{slotFills:Z}=L3($),Q={};for(let[z,X]of Object.entries(Z)){let H=OI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function I3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=v($);if(!X)return z;for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=KI(H.name);if(II.has(U))z.add(U);continue}if(LI.has(H.name)||H.name.startsWith("."))continue;for(let U of I3(qI($,H.name),Z-1,Q))z.add(U)}return z}var $0=($,Z,Q)=>({value:$,source:Z,confidence:Q});function O3($,Z={}){let Q=Z.toolingRoot?null:AI($),z=CI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",SI(Q,z)),H("who",EI(z)),H("why",bI(z)),H("where",yI(Q,z)),H("when",xI(z)),H("how",gI(Q,z)),X}function k8($,Z={}){let Q=O3($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function AI($){let Z=S($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function CI($){let Z=S($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
258
258
  `).filter((Q)=>!/^\s*\[!\[/.test(Q)&&!/^\s*!\[/.test(Q)).join(`
259
- `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function P2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function RI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function G$($,Z){let Q=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||RI(z[2])>0.4)return null;return{body:P2(z[2]),heading:z[1].trim()}}function TI($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return!1}function G6($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return P2(X[1])}return null}function AI($,Z){if($?.description&&$.description.length>20)return $0(P2($.description),"package.json:description",0.95);let Q=G$(Z,"Purpose|What|About|Overview|Description");if(Q)return $0(Q.body,`README:## ${Q.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((U)=>U.replace(/\s+/g," ").trim()).find((U)=>U.length>30&&!U.startsWith("#")&&!TI(U));if(z)return $0(P2(z),"README:first-paragraph",0.5);let X=G6(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return X?$0(X,"README:problem-heuristic",0.6):null}function CI($){let Z=G$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?$0(Q,"README:audience-heuristic",0.6):null}function jI($){let Z=G$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?$0(Q,"README:mission-heuristic",0.6):null}function wI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return $0(P2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return $0(P2($.homepage),"package.json:homepage",0.9);let z=G6(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?$0(z,"README:deploy-heuristic",0.6):null}function SI($){let Z=G$($,"Timeline|Status|Release|Roadmap");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?$0(Q,"README:since-heuristic",0.6):null}function EI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((H)=>Q.includes(H));if(z.length)return $0(P2(z.map((H)=>`npm run ${H}`).join(", ")),"package.json:scripts",0.9);let X=G$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return $0(X.body,`README:## ${X.heading}`,0.8);let U=G$(Z,"Architecture|Approach|How it works|Methodology|How");return U?$0(U.body,`README:## ${U.heading}`,0.7):null}var I3="3.0";import{join as O3}from"path";var M3=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"anyDependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"},{type:"devDependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"content",pattern:"app.py",key:"flask"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"content",pattern:"main.py",key:"fastapi"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"content",pattern:"Gemfile",key:"rails"},{type:"content",pattern:"Gemfile.lock",key:"rails ("},{type:"file",pattern:"config/application.rb"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"content",pattern:"pom.xml",key:"spring-boot"},{type:"content",pattern:"build.gradle",key:"springframework.boot"},{type:"content",pattern:"build.gradle.kts",key:"springframework.boot"},{type:"content",pattern:"gradle/libs.versions.toml",key:"springframework.boot"}]},{name:"Vapor",slug:"vapor",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"vapor/vapor"},{type:"content",pattern:"Package.swift",key:'product(name: "Vapor"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Vapor'"},{type:"file",pattern:"Sources/App/configure.swift"}]},{name:"Hummingbird",slug:"hummingbird",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"hummingbird-project/hummingbird"},{type:"content",pattern:"Package.swift",key:'product(name: "Hummingbird"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Hummingbird'"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function bI($){let Z=S($,"Cargo.toml");if(Z===null)return null;let Q=Z.match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return Q?Q[1]:null}function yI($){let Z=S($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function xI($,Z){if(Z?.keywords?.some((z)=>/^sdk(?:\s|-|$)|-sdk$/i.test(z)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let Q=bI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function gI($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let Q of Z){let z=S($,Q);if(z===null)continue;try{let X=JSON.parse(z);if(typeof X.manifest_version==="number")return`${Q} manifest_version ${X.manifest_version} (browser extension)`}catch{}}return null}function vI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=S($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=S($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function kI($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of Q)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(I($,"ios")&&I($,"android"))return"ios/ + android/ dirs";return null}function hI($,Z){let Q=S($,"Cargo.toml");if(Q!==null){if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(Q))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(Q))return"Cargo.toml wasm-bindgen/wasm-pack"}let z=S($,"build.zig");if(z!==null&&/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(z))return"build.zig wasm target";if(Z?.keywords?.some((X)=>/^wasm(?:-|$)|webassembly/i.test(X)))return'package.json keywords contains "wasm"';return null}function uI($,Z){if(!I($,"index.html"))return null;if(Z?.dependencies||Z?.devDependencies){let Q={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((X)=>Q[X]))return null}return"index.html (vanilla, no frontend framework)"}function fI($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((U)=>Q.test(U)),X=Z.files.some((U)=>/\.(md|MD)$|examples?\//.test(U)||U==="README.md"||U==="docs"||U==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function mI($,Z,Q){let z=Q.find((X)=>X.slug==="astro"||X.slug==="gatsby");if(z)return`${z.name} (static-site framework)`;if(Z?.keywords?.some((X)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(X)))return'package keywords contains "website"/"marketing"/"landing"';return null}function pI($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],U=z.some((J)=>Q[J]),H=X.some((J)=>Q[J]);if(U&&H)return"auth + payment dependencies";return null}function lI($,Z,Q){if(Z?.keywords?.some((U)=>/mcpaas/i.test(U)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((U)=>U.slug==="mcp"),X=Q.some((U)=>U.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function cI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var dI=new Set(["node_modules","dist","build","out","vendor","target","coverage","docs","doc","e2e","tests","test","__tests__","scripts","deploy","bin","public","examples","example","fixtures","assets","static","migrations","config","contracts","proto","protos"]),_3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,iI=new Set(["frontend","backend","database","css","ui","state"]);function nI($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||x8($,"requirements*.txt"))return!0;if(I($,"go.mod"))return!0;if(I($,"Cargo.toml"))return!0;if(I($,"Gemfile"))return!0;if(I($,"pom.xml")||x8($,"build.gradle*"))return!0;if(J$($).length>0)return!0;let Z=W0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function g8($){return a2($,()=>rI($))}function rI($){let Z=v($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||dI.has(z.name))continue;let X=O3($,z.name);if(!nI(X))continue;let U=k8(X);if(!U)continue;let H=v8(X).filter((Y)=>iI.has(Y.category)),J=H.find((Y)=>Y.category==="frontend"),G=H.find((Y)=>Y.category==="backend"),V=J??G??H[0]??null;Q.push({name:z.name,language:U,topFramework:V?.name??null,frontend:!!J,backend:!!G||_3.test(U),hasFramework:!!V,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function sI($,Z){if(Z?.workspaces||I($,"pnpm-workspace.yaml"))return null;let Q=g8($),z=new Set(Q.map((X)=>X.language));if(Q.length<2||z.size<2)return null;if(!Q.some((X)=>X.frontend)||!Q.some((X)=>X.backend))return null;return`polyglot: ${Q.map((X)=>`${X.name}/ (${X.language})`).join(", ")}`}function P3($){let Z=g8($);if(Z.length<2)return null;let Q=(H)=>(H.appRoot?2:0)+(_3.test(H.language)?2:0)+(H.hasFramework?1:0)+(H.frontend?0.5:0),z=[...Z].sort((H,J)=>Q(J)-Q(H)),X=new Set,U=[];for(let H of z){if(X.has(H.language))continue;X.add(H.language);let J=H.frontend?"frontend":H.backend?"backend":"service";U.push(H.topFramework?`${H.language} (${H.topFramework} · ${J})`:`${H.language} (${J})`)}return U.join("; ")}function W0($){let Z=S($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function x8($,Z){if(!Z.includes("*"))return I($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(v($)??[]).some((G)=>G.name.startsWith(J))}let z=O3(...Q.slice(0,-1)),X=Q[Q.length-1],U=X.split("*")[0],H=X.split("*")[1]||"";return(v($,z)??[]).some((J)=>J.name.startsWith(U)&&J.name.endsWith(H))}function oI($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"anyDependency":{let z=$.key??"";return!!(Z?.dependencies?.[z]||Z?.devDependencies?.[z])}case"file":return x8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!x8(Q,$.pattern))return!1;let z=S(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function v8($){let Z=W0($);return M3.map((Q)=>{let X=Q.signals.filter((U)=>oI(U,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function k8($){let Z=W0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(I($,"tsconfig.json"))return"TypeScript";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(J$($).length>0)return"C#";if(I($,"pyproject.toml")||I($,"setup.py"))return"Python";if(I($,"Gemfile"))return"Ruby";if(X5($)){let Q=X6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(I($,"Package.swift"))return"Swift";if(I($,"build.zig"))return"Zig";if(I($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function F3($){let Z=W0($),Q=v8($),z=[],X=fI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let U=xI($,Z);if(U)return z.push(U),{type:"sdk",found:z};let H=gI($);if(H)return z.push(H),{type:"extension",found:z};let J=lI($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let G=pI($,Z);if(G)return z.push(G),{type:"saas",found:z};let V=hI($,Z);if(V)return z.push(V),{type:"wasm",found:z};let Y=A8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=j8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=S8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=X6($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=E8($);if(L)return z.push(L.found),{type:L.appType,found:z};let q=J6($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=kI($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((j)=>j.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(yI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(I($,"build.zig")){if(z.push("build.zig"),I($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(I($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let O=Q.some((j)=>j.slug==="svelte"||j.slug==="sveltekit");if(Z?.private===!0&&(I($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&O)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(O)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let F=Q.some((j)=>j.category==="frontend"),N=Q.some((j)=>j.category==="backend");if(Z?.private&&(Z.workspaces||I($,"pnpm-workspace.yaml"))&&F&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let R=cI($,Z);if(R)return z.push(R),{type:"monorepo-root",found:z};let w=mI($,Z,Q);if(w)return z.push(w),{type:"website",found:z};if(Q.some((j)=>j.slug==="nextjs"||j.slug==="nuxt"))return z.push(Q.find((j)=>j.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let E=Q.some((j)=>j.category==="frontend"),n=Q.some((j)=>j.category==="backend");if(E&&n)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(E)return z.push("frontend framework"),{type:"frontend",found:z};if(n)return z.push("backend framework"),{type:"backend",found:z};let a=vI($);if(a)return z.push(a),{type:"data-science",found:z};let g=uI($,Z);if(g)return z.push(g),{type:"html",found:z};let T=sI($,Z);if(T)return z.push(T),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push(E2),{type:"library",found:z}}function N3($){if(I($,"bunfig.toml"))return"Bun";if(I($,"deno.json")||I($,"deno.jsonc"))return"Deno";if(W0($))return"Node.js";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(J$($).length>0)return".NET";if(I($,"pubspec.yaml"))return"Dart";return""}var aI=new Set(["npm","pnpm","yarn","bun"]);function tI($){let Z=W0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return aI.has(Q)?Q:""}function eI($){if(I($,"pubspec.yaml"))return"pub";if(I($,"go.mod"))return"go modules";if(J$($).length>0)return"NuGet";if(I($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>I($,Q))?"gradle":""}var $M=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function R3($){return eI($)||tI($)||($M.find(([Z])=>I($,Z))?.[1]??"")}function T3($){if(I($,".github/workflows"))return"GitHub Actions";if(I($,".gitlab-ci.yml"))return"GitLab CI";if(I($,".circleci"))return"CircleCI";if(I($,"Jenkinsfile"))return"Jenkins";return null}function A3($){if(I($,"vercel.json"))return"Vercel";if(I($,"netlify.toml"))return"Netlify";if(I($,"wrangler.toml"))return"Cloudflare";if(I($,"fly.toml"))return"Fly.io";if(I($,"render.yaml"))return"Render";return null}var ZM=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function QM($){for(let z of ZM){let X=S($,z)?.match(/@sveltejs\/adapter-(\w+)/);if(X)return X[1]}let Z=W0($);return Object.keys({...Z?.dependencies,...Z?.devDependencies}).map((z)=>/^@sveltejs\/adapter-(\w+)$/.exec(z)?.[1]).find(Boolean)??null}function C3($){let Z=QM($);if(Z)switch(Z){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return Z}return null}function J5($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function j3($){let Z=W0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return J5(Z);if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(I($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function h8($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>I($,Q))}function u8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=I($,"bun.lock")||I($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(I($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&zM($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(G5($,"build.zig")))Q.test="zig build test"}if(I($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&XM($))Q.test="pytest";return Q}function G5($,Z){return S($,Z)??""}function zM($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(G5($,"Cargo.toml"))}function XM($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(G5($,Z)))}function w3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let U=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let H of Q)if(U.has(H.category))X.push(H.name);if(I($,"bunfig.toml"))X.push("Bun");else if(I($,"deno.json")||I($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let H=Object.keys(Z.dependencies).slice(0,5);for(let J of H)if(!X.some((G)=>G.toLowerCase().includes(J.toLowerCase())))X.push(J)}return X}function UM($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function S3($){return V5($).data}function V5($){let Z=W0($),Q=v8($),z=F3($),X=z.type,U=z.found.some((y)=>y.startsWith("polyglot:")),H=U&&P3($)||k8($),J=N3($),G=R3($),V=T3($),Y=A3($),W=j3($),B=Q.find((y)=>y.slug==="sveltekit")??Q.find((y)=>y.category==="frontend"),K=Q.find((y)=>y.category==="css"),L=Q.find((y)=>y.category==="ui"),q=Q.find((y)=>y.category==="state"),D=Q.find((y)=>y.category==="backend"),M=Q.find((y)=>y.category==="database"),O=(y)=>b2(X,y)??b2("library",y)===!0,A=X==="framework",F=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit"),N=A&&F?"svelte":A?null:null,R=X==="svelte"||N==="svelte",w=R?C3($):null,P=R&&Q.some((y)=>y.slug==="sveltekit"),E={},n=m.filter((y)=>y.path.startsWith("stack."));for(let y of n){let k=y.path.replace("stack.","");switch(k){case"frontend":E[k]=B?.name??"";break;case"css_framework":E[k]=K?.name??"";break;case"ui_library":E[k]=L?.name??"";break;case"state_management":E[k]=q?.name??(R&&UM(Z)>=5?"Runes":"");break;case"backend":E[k]=R?P?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":E[k]=P?"Server Routes":"";break;case"runtime":E[k]=J;break;case"database":E[k]=M?.name??"";break;case"connection":E[k]=M?.name??"";break;case"hosting":if(R&&w)E[k]=w;else E[k]=Y??"";break;case"build":E[k]=P?J5(Z):W??"";break;case"cicd":E[k]=V??"";break;case"package_manager":E[k]=G;break;default:E[k]="";break}}let a={};for(let y of n){let k=y.path.replace("stack.","");a[k]=O(y)?E[k]:"slotignored"}let g={},T=m.filter((y)=>y.path.startsWith("monorepo."));for(let y of T){let k=y.path.replace("monorepo.","");if(!O(y))g[k]="slotignored";else g[k]=""}let j={name:Z?.name??$.split("/").pop()??"project",goal:U?"":Z?.description??"",main_language:H,type:X};if(A&&N)j.framework=N;let c=w3($,Z,Q,U?k8($):H);if(U){for(let y of g8($))for(let k of[y.language,y.topFramework])if(k&&!c.includes(k))c.push(k)}let q0=h8($),S5=u8($,Z),K6={faf_version:I3,project:j,stack:a,human_context:{who:"",what:U?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:g,_meta:{found:z.found}};if(c.length>0)K6.tech_stack=c;if(q0.length>0)K6.key_files=q0;if(Object.keys(S5).length>0)K6.commands=S5;return{data:K6,facts:E}}var E3={MIN_LENGTH:8,MAX_LENGTH:280},HM=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function P0($){let Z=$.trim();if(Z.length<E3.MIN_LENGTH)return!1;if(Z.length>E3.MAX_LENGTH)return!1;if(HM.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
- `).length>4)return!1;return!0}function JM($){let Z=$.split(`
259
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function R2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function jI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function W$($,Z){let Q=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||jI(z[2])>0.4)return null;return{body:R2(z[2]),heading:z[1].trim()}}function wI($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return!1}function G6($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return R2(X[1])}return null}function SI($,Z){if($?.description&&$.description.length>20)return $0(R2($.description),"package.json:description",0.95);let Q=W$(Z,"Purpose|What|About|Overview|Description");if(Q)return $0(Q.body,`README:## ${Q.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((H)=>H.replace(/\s+/g," ").trim()).find((H)=>H.length>30&&!H.startsWith("#")&&!wI(H));if(z)return $0(R2(z),"README:first-paragraph",0.5);let X=G6(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return X?$0(X,"README:problem-heuristic",0.6):null}function EI($){let Z=W$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?$0(Q,"README:audience-heuristic",0.6):null}function bI($){let Z=W$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?$0(Q,"README:mission-heuristic",0.6):null}function yI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return $0(R2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return $0(R2($.homepage),"package.json:homepage",0.9);let z=G6(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?$0(z,"README:deploy-heuristic",0.6):null}function xI($){let Z=W$($,"Timeline|Status|Release|Roadmap");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?$0(Q,"README:since-heuristic",0.6):null}function gI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return $0(R2(z.map((U)=>`npm run ${U}`).join(", ")),"package.json:scripts",0.9);let X=W$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return $0(X.body,`README:## ${X.heading}`,0.8);let H=W$(Z,"Architecture|Approach|How it works|Methodology|How");return H?$0(H.body,`README:## ${H.heading}`,0.7):null}var _3="3.0";import{join as P3}from"path";var M3=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"anyDependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"},{type:"devDependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"content",pattern:"app.py",key:"flask"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"content",pattern:"main.py",key:"fastapi"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"content",pattern:"Gemfile",key:"rails"},{type:"content",pattern:"Gemfile.lock",key:"rails ("},{type:"file",pattern:"config/application.rb"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"content",pattern:"pom.xml",key:"spring-boot"},{type:"content",pattern:"build.gradle",key:"springframework.boot"},{type:"content",pattern:"build.gradle.kts",key:"springframework.boot"},{type:"content",pattern:"gradle/libs.versions.toml",key:"springframework.boot"}]},{name:"Vapor",slug:"vapor",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"vapor/vapor"},{type:"content",pattern:"Package.swift",key:'product(name: "Vapor"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Vapor'"},{type:"file",pattern:"Sources/App/configure.swift"}]},{name:"Hummingbird",slug:"hummingbird",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"hummingbird-project/hummingbird"},{type:"content",pattern:"Package.swift",key:'product(name: "Hummingbird"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Hummingbird'"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function vI($){let Z=S($,"Cargo.toml");if(Z===null)return null;let Q=Z.match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return Q?Q[1]:null}function kI($){let Z=S($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function hI($,Z){if(Z?.keywords?.some((z)=>/^sdk(?:\s|-|$)|-sdk$/i.test(z)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let Q=vI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function uI($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let Q of Z){let z=S($,Q);if(z===null)continue;try{let X=JSON.parse(z);if(typeof X.manifest_version==="number")return`${Q} manifest_version ${X.manifest_version} (browser extension)`}catch{}}return null}function fI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=S($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=S($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function mI($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of Q)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(I($,"ios")&&I($,"android"))return"ios/ + android/ dirs";return null}function pI($,Z){let Q=S($,"Cargo.toml");if(Q!==null){if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(Q))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(Q))return"Cargo.toml wasm-bindgen/wasm-pack"}let z=S($,"build.zig");if(z!==null&&/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(z))return"build.zig wasm target";if(Z?.keywords?.some((X)=>/^wasm(?:-|$)|webassembly/i.test(X)))return'package.json keywords contains "wasm"';return null}function lI($,Z){if(!I($,"index.html"))return null;if(Z?.dependencies||Z?.devDependencies){let Q={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((X)=>Q[X]))return null}return"index.html (vanilla, no frontend framework)"}function cI($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((H)=>Q.test(H)),X=Z.files.some((H)=>/\.(md|MD)$|examples?\//.test(H)||H==="README.md"||H==="docs"||H==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function dI($,Z,Q){let z=Q.find((X)=>X.slug==="astro"||X.slug==="gatsby");if(z)return`${z.name} (static-site framework)`;if(Z?.keywords?.some((X)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(X)))return'package keywords contains "website"/"marketing"/"landing"';return null}function iI($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],H=z.some((J)=>Q[J]),U=X.some((J)=>Q[J]);if(H&&U)return"auth + payment dependencies";return null}function nI($,Z,Q){if(Z?.keywords?.some((H)=>/mcpaas/i.test(H)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((H)=>H.slug==="mcp"),X=Q.some((H)=>H.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function rI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var sI=new Set(["node_modules","dist","build","out","vendor","target","coverage","docs","doc","e2e","tests","test","__tests__","scripts","deploy","bin","public","examples","example","fixtures","assets","static","migrations","config","contracts","proto","protos"]),F3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,oI=new Set(["frontend","backend","database","css","ui","state"]);function aI($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||h8($,"requirements*.txt"))return!0;if(I($,"go.mod"))return!0;if(I($,"Cargo.toml"))return!0;if(I($,"Gemfile"))return!0;if(I($,"pom.xml")||h8($,"build.gradle*"))return!0;if(Y$($).length>0)return!0;let Z=W0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function u8($){return e2($,()=>tI($))}function tI($){let Z=v($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||sI.has(z.name))continue;let X=P3($,z.name);if(!aI(X))continue;let H=m8(X);if(!H)continue;let U=f8(X).filter((Y)=>oI.has(Y.category)),J=U.find((Y)=>Y.category==="frontend"),G=U.find((Y)=>Y.category==="backend"),V=J??G??U[0]??null;Q.push({name:z.name,language:H,topFramework:V?.name??null,frontend:!!J,backend:!!G||F3.test(H),hasFramework:!!V,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function eI($,Z){if(Z?.workspaces||I($,"pnpm-workspace.yaml"))return null;let Q=u8($),z=new Set(Q.map((X)=>X.language));if(Q.length<2||z.size<2)return null;if(!Q.some((X)=>X.frontend)||!Q.some((X)=>X.backend))return null;return`polyglot: ${Q.map((X)=>`${X.name}/ (${X.language})`).join(", ")}`}function R3($){let Z=u8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(F3.test(U.language)?2:0)+(U.hasFramework?1:0)+(U.frontend?0.5:0),z=[...Z].sort((U,J)=>Q(J)-Q(U)),X=new Set,H=[];for(let U of z){if(X.has(U.language))continue;X.add(U.language);let J=U.frontend?"frontend":U.backend?"backend":"service";H.push(U.topFramework?`${U.language} (${U.topFramework} · ${J})`:`${U.language} (${J})`)}return H.join("; ")}function W0($){let Z=S($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function h8($,Z){if(!Z.includes("*"))return I($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(v($)??[]).some((G)=>G.name.startsWith(J))}let z=P3(...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";return(v($,z)??[]).some((J)=>J.name.startsWith(H)&&J.name.endsWith(U))}function $O($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"anyDependency":{let z=$.key??"";return!!(Z?.dependencies?.[z]||Z?.devDependencies?.[z])}case"file":return h8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!h8(Q,$.pattern))return!1;let z=S(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function f8($){let Z=W0($);return M3.map((Q)=>{let X=Q.signals.filter((H)=>$O(H,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function m8($){let Z=W0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(I($,"tsconfig.json"))return"TypeScript";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(Y$($).length>0)return"C#";if(I($,"pyproject.toml")||I($,"setup.py"))return"Python";if(I($,"Gemfile"))return"Ruby";if(Y1($)){let Q=X6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(I($,"Package.swift"))return"Swift";if(I($,"build.zig"))return"Zig";if(I($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function N3($){let Z=W0($),Q=f8($),z=[],X=cI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=hI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=uI($);if(U)return z.push(U),{type:"extension",found:z};let J=nI($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let G=iI($,Z);if(G)return z.push(G),{type:"saas",found:z};let V=pI($,Z);if(V)return z.push(V),{type:"wasm",found:z};let Y=S8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=b8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=x8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=X6($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=g8($);if(L)return z.push(L.found),{type:L.appType,found:z};let q=J6($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=mI($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((j)=>j.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(kI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(I($,"build.zig")){if(z.push("build.zig"),I($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(I($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let _=Q.some((j)=>j.slug==="svelte"||j.slug==="sveltekit");if(Z?.private===!0&&(I($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&_)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(_)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let F=Q.some((j)=>j.category==="frontend"),R=Q.some((j)=>j.category==="backend");if(Z?.private&&(Z.workspaces||I($,"pnpm-workspace.yaml"))&&F&&R)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let N=rI($,Z);if(N)return z.push(N),{type:"monorepo-root",found:z};let w=dI($,Z,Q);if(w)return z.push(w),{type:"website",found:z};if(Q.some((j)=>j.slug==="nextjs"||j.slug==="nuxt"))return z.push(Q.find((j)=>j.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let E=Q.some((j)=>j.category==="frontend"),n=Q.some((j)=>j.category==="backend");if(E&&n)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(E)return z.push("frontend framework"),{type:"frontend",found:z};if(n)return z.push("backend framework"),{type:"backend",found:z};let a=fI($);if(a)return z.push(a),{type:"data-science",found:z};let g=lI($,Z);if(g)return z.push(g),{type:"html",found:z};let A=eI($,Z);if(A)return z.push(A),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push(y2),{type:"library",found:z}}function T3($){if(I($,"bunfig.toml"))return"Bun";if(I($,"deno.json")||I($,"deno.jsonc"))return"Deno";if(W0($))return"Node.js";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(Y$($).length>0)return".NET";if(I($,"pubspec.yaml"))return"Dart";return""}var ZO=new Set(["npm","pnpm","yarn","bun"]);function QO($){let Z=W0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return ZO.has(Q)?Q:""}function zO($){if(I($,"pubspec.yaml"))return"pub";if(I($,"go.mod"))return"go modules";if(Y$($).length>0)return"NuGet";if(I($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>I($,Q))?"gradle":""}var XO=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function A3($){return zO($)||QO($)||(XO.find(([Z])=>I($,Z))?.[1]??"")}function C3($){if(I($,".github/workflows"))return"GitHub Actions";if(I($,".gitlab-ci.yml"))return"GitLab CI";if(I($,".circleci"))return"CircleCI";if(I($,"Jenkinsfile"))return"Jenkins";return null}function j3($){if(I($,"vercel.json"))return"Vercel";if(I($,"netlify.toml"))return"Netlify";if(I($,"wrangler.toml"))return"Cloudflare";if(I($,"fly.toml"))return"Fly.io";if(I($,"render.yaml"))return"Render";return null}var HO=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function UO($){for(let z of HO){let X=S($,z)?.match(/@sveltejs\/adapter-(\w+)/);if(X)return X[1]}let Z=W0($);return Object.keys({...Z?.dependencies,...Z?.devDependencies}).map((z)=>/^@sveltejs\/adapter-(\w+)$/.exec(z)?.[1]).find(Boolean)??null}function w3($){let Z=UO($);if(Z)switch(Z){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return Z}return null}function q1($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function S3($){let Z=W0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return q1(Z);if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(I($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function p8($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>I($,Q))}function l8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=I($,"bun.lock")||I($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(I($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&JO($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(K1($,"build.zig")))Q.test="zig build test"}if(I($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&GO($))Q.test="pytest";return Q}function K1($,Z){return S($,Z)??""}function JO($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(K1($,"Cargo.toml"))}function GO($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(K1($,Z)))}function E3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let H=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let U of Q)if(H.has(U.category))X.push(U.name);if(I($,"bunfig.toml"))X.push("Bun");else if(I($,"deno.json")||I($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let U=Object.keys(Z.dependencies).slice(0,5);for(let J of U)if(!X.some((G)=>G.toLowerCase().includes(J.toLowerCase())))X.push(J)}return X}function VO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function b3($){return D1($).data}function D1($){let Z=W0($),Q=f8($),z=N3($),X=z.type,H=z.found.some((y)=>y.startsWith("polyglot:")),U=H&&R3($)||m8($),J=T3($),G=A3($),V=C3($),Y=j3($),W=S3($),B=Q.find((y)=>y.slug==="sveltekit")??Q.find((y)=>y.category==="frontend"),K=Q.find((y)=>y.category==="css"),L=Q.find((y)=>y.category==="ui"),q=Q.find((y)=>y.category==="state"),D=Q.find((y)=>y.category==="backend"),O=Q.find((y)=>y.category==="database"),_=(y)=>x2(X,y)??x2("library",y)===!0,C=X==="framework",F=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit"),R=C&&F?"svelte":C?null:null,N=X==="svelte"||R==="svelte",w=N?w3($):null,P=N&&Q.some((y)=>y.slug==="sveltekit"),E={},n=m.filter((y)=>y.path.startsWith("stack."));for(let y of n){let k=y.path.replace("stack.","");switch(k){case"frontend":E[k]=B?.name??"";break;case"css_framework":E[k]=K?.name??"";break;case"ui_library":E[k]=L?.name??"";break;case"state_management":E[k]=q?.name??(N&&VO(Z)>=5?"Runes":"");break;case"backend":E[k]=N?P?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":E[k]=P?"Server Routes":"";break;case"runtime":E[k]=J;break;case"database":E[k]=O?.name??"";break;case"connection":E[k]=O?.name??"";break;case"hosting":if(N&&w)E[k]=w;else E[k]=Y??"";break;case"build":E[k]=P?q1(Z):W??"";break;case"cicd":E[k]=V??"";break;case"package_manager":E[k]=G;break;default:E[k]="";break}}let a={};for(let y of n){let k=y.path.replace("stack.","");a[k]=_(y)?E[k]:"slotignored"}let g={},A=m.filter((y)=>y.path.startsWith("monorepo."));for(let y of A){let k=y.path.replace("monorepo.","");if(!_(y))g[k]="slotignored";else g[k]=""}let j={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(C&&R)j.framework=R;let c=E3($,Z,Q,H?m8($):U);if(H){for(let y of u8($))for(let k of[y.language,y.topFramework])if(k&&!c.includes(k))c.push(k)}let q0=p8($),v1=l8($,Z),K6={faf_version:_3,project:j,stack:a,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:g,_meta:{found:z.found}};if(c.length>0)K6.tech_stack=c;if(q0.length>0)K6.key_files=q0;if(Object.keys(v1).length>0)K6.commands=v1;return{data:K6,facts:E}}var y3={MIN_LENGTH:8,MAX_LENGTH:280},YO=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function P0($){let Z=$.trim();if(Z.length<y3.MIN_LENGTH)return!1;if(Z.length>y3.MAX_LENGTH)return!1;if(YO.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
+ `).length>4)return!1;return!0}function WO($){let Z=$.split(`
261
261
  `),Q=0;while(Q<Z.length&&/^(#\s|$)/.test(Z[Q].trim()))Q++;while(Q<Z.length){let z=Z[Q].trim();if(/^\[!\[/.test(z)){Q++;continue}if(/^!\[/.test(z)){Q++;continue}if(/^<img\s/i.test(z)){Q++;continue}if(z===""){Q++;continue}break}return Z.slice(Q).join(`
262
- `)}function GM($){let Q=JM($).split(`
263
- `),z=[];for(let X of Q){let U=X.trim();if(U===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(U))break;if(/^\*\*[^*]+\*\*\s*$/.test(U)&&z.length===0)continue;z.push(U)}if(z.length===0)return null;return z.join(" ").trim()}function F2($,Z){let Q=$.split(`
264
- `),z=0;while(z<Q.length){let U=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(U&&Z.test(U[2])){let H=U[1].length,J=[];z++;while(z<Q.length){let G=Q[z].trim(),V=G.match(/^(#{1,6})\s+/);if(V&&V[1].length<=H)break;if(G===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(G))break;J.push(G),z++}if(J.length===0)return null;return J.join(" ").trim()}z++}return null}function VM($){let Z=F2($,/^(use\s+cases?|goal)\b/i);if(Z&&P0(Z))return Z;let Q=GM($);if(Q&&P0(Q))return Q;return}function YM($){let Z=F2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&P0(Z))return Z;return}function WM($){let Z=F2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&P0(Z))return Z;return}function BM($){let Z=F2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&P0(Z))return Z;return}function qM($){let Z=F2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&P0(Z))return Z;return}function KM($){let Z=F2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&P0(Z))return Z;return}function DM($){let Z=F2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&P0(Z))return Z;return}function Y5($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(I($,K)){Q=K;break}if(!Q)return{};let z=S($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},U=VM(z);if(U)X.project={goal:U};let H={},J=YM(z);if(J)H.what=J;let G=WM(z);if(G)H.who=G;let V=BM(z);if(V)H.why=V;let Y=qM(z);if(Y)H.where=Y;let W=KM(z);if(W)H.when=W;let B=DM(z);if(B)H.how=B;if(Object.keys(H).length>0)X.human_context=H;return X}function LM($,Z){let Q=$.split(`
265
- `),z=!1;for(let X of Q){let U=X.trim();if(/^\[/.test(U)){z=U==="[package]";continue}if(!z)continue;let H=U.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(H){let J=H[1].trim();J=J.replace(/\s*#.*$/,"").trim();let G=J.match(/^"((?:[^"\\]|\\.)*)"$/)||J.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return J}}return null}function W5($){let Z=S($,"Cargo.toml");if(Z===null)return{};let Q=LM(Z,"description");if(Q&&P0(Q))return{project:{goal:Q}};return{}}import{join as b3}from"path";var IM=[{re:/^postgres|postgis|pgvector/,slot:"database",label:"PostgreSQL"},{re:/^mysql/,slot:"database",label:"MySQL"},{re:/^mariadb/,slot:"database",label:"MariaDB"},{re:/^mongo/,slot:"database",label:"MongoDB"},{re:/clickhouse/,slot:"database",label:"ClickHouse"},{re:/^cockroach/,slot:"database",label:"CockroachDB"},{re:/^redis|^valkey/,slot:"cache",label:"Redis"},{re:/^memcached/,slot:"cache",label:"Memcached"},{re:/elasticsearch/,slot:"search",label:"Elasticsearch"},{re:/opensearch/,slot:"search",label:"OpenSearch"},{re:/meilisearch/,slot:"search",label:"Meilisearch"},{re:/typesense/,slot:"search",label:"Typesense"},{re:/qdrant/,slot:"search",label:"Qdrant (vector)"},{re:/weaviate/,slot:"search",label:"Weaviate (vector)"},{re:/^minio/,slot:"storage",label:"MinIO (S3-compatible)"},{re:/localstack/,slot:"storage",label:"LocalStack (AWS)"},{re:/rabbitmq/,slot:"runtime",label:"RabbitMQ"},{re:/kafka/,slot:"runtime",label:"Kafka"},{re:/nats/,slot:"runtime",label:"NATS"},{re:/temporalio\/|temporal-server|temporal:/,slot:"runtime",label:"Temporal"}],MM=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function OM($){let Z=[],Q=(z,X)=>{for(let U of v($,z)??[])if(U.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(U.name))Z.push(b3(z,U.name));else if(U.isDirectory()&&X>0&&!U.name.startsWith(".")&&!MM.has(U.name))Q(b3(z,U.name),X-1)};return Q(".",1),Z}function V6($){return[...$].join(" · ")}function B5($){let Z=OM($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let U=S($,X);if(U===null)continue;for(let H of U.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let J=H[1].toLowerCase(),G=J.replace(/:[^/]*$/,"").split("/").pop()??J,V=J.replace(/:[^/]*$/,"");for(let{re:Y,slot:W,label:B}of IM)if(Y.test(G)||Y.test(V))Q[W].add(B)}}let z={};if(Q.database.size)z.database=V6(Q.database);if(Q.cache.size)z.cache=V6(Q.cache);if(Q.search.size)z.search=V6(Q.search);if(Q.storage.size)z.storage=V6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${V6(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as _M}from"path";var PM=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),FM=[{file:"Makefile",runner:"make",targets:($)=>[...$.matchAll(/^([a-zA-Z][\w-]*)\s*:(?!=)/gm)].map((Z)=>Z[1])},{file:"justfile",runner:"just",targets:($)=>[...$.matchAll(/^([a-zA-Z][\w-]*)\s*(?:\([^)]*\))?\s*:/gm)].map((Z)=>Z[1])},{file:"Taskfile.yml",runner:"task",targets:($)=>{let Z=$.indexOf("tasks:");if(Z===-1)return[];return[...$.slice(Z).matchAll(/^\s{2}([a-zA-Z][\w-]*):/gm)].map((Q)=>Q[1])}}];function q5($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function NM($){let Z=[$];for(let Q of v($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!PM.has(Q.name))Z.push(_M($,Q.name));return Z}function RM($){let Z=0;if(I($,"manage.py")||I($,"pyproject.toml")||I($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function K5($){return a2($,()=>TM($))}function TM($){let Z=[];for(let z of NM($)){let X=z===$,U=X?"":`cd ${z.slice($.length+1)} && `;for(let H of FM){let J=S(z,H.file);if(J===null)continue;let G=H.targets(J);if(G.length===0)continue;let V={},Y=q5(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=q5(G,[/^build$/i,/^compile$/i,/^build/i]),B=q5(G,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(Y)V.test=`${U}${H.runner} ${Y}`;if(W)V.build=`${U}${H.runner} ${W}`;if(B)V.lint=`${U}${H.runner} ${B}`;if(Object.keys(V).length===0)continue;Z.push({score:Object.keys(V).length+(X?10:RM(z)),commands:V})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var AM=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function D5($){for(let Z of AM)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function CM($,Z){let Q={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}},stack:{...Z.stack??{},...$.stack??{}},commands:{...Z.commands??{},...$.commands??{}},security:{...Z.security??{},...$.security??{}}};for(let z of["project","human_context","stack","commands","security"])if(Q[z]&&Object.keys(Q[z]).length===0)delete Q[z];return Q}function L5($){return[Y5($),W5($),B5($),K5($),D5($)].reduce(CM,{})}function y3($){try{let Z=n2($,{logLevel:"error"}).getIn(["project","type"],!0);return s(Z)&&typeof Z.comment==="string"&&Z.comment.includes(E2)}catch{return!1}}function I5($){let Z=S3($),Q=L5($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X={};if(Q.project)X.project=Q.project;if(Q.human_context)X.human_context=Q.human_context;let U=p0(p0(z,Z),X);kM(U);let J=(Z._meta?.found??[]).some((V)=>V.startsWith("polyglot:")),G=p0(U,b8($));return p0(G,{human_context:y8($,{toolingRoot:J})})}function jM($,Z){let Q=vM(Y8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=V5($),U=z,H=p0(Q,L5($)),J=p0(H,U),G=p0(J,b8($)),V=EM(p0(G,{human_context:y8($)}),Q),Y=bM(wM(Z,Q,U)?yM(x3(V,Q),Q,X):x3(V,Q),Q);return E9(w9(Z,Y))}function wM($,Z,Q){if(!o(U0(Z,"project.type"))){let X=r$($)?.text;return X===void 0||!y3(X)}return!(Q._meta?.found??[]).includes(E2)}function M5($){return $.canonical?[$.path,$.canonical]:[$.path]}function U0($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)?X[z]:void 0}function N2($,Z,Q){let[z,X]=Z.split("."),U=$[z];if(!u(U))return;if(Q===void 0?!(X in U):U[X]===Q)return;let H={...U};if(Q===void 0)delete H[X];else H[X]=Q;$[z]=H}var R2=($)=>typeof $==="string"&&$.trim()===L6;function SM($,Z){let Q=Z.map((z)=>U0($,z));return Q.some(R2)&&Q.every((z)=>o(z)||R2(z))}function x3($,Z){let Q={...$};for(let z of m){let X=M5(z);if(!SM(Z,X))continue;for(let U of X){let H=U0(Z,U);if(U0(Q,U)!==H)N2(Q,U,H)}}return Q}function T2($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)&&Object.prototype.hasOwnProperty.call(X,z)}function EM($,Z){let Q={...$};for(let z of m){if(!z.canonical||!T2(Z,z.canonical)||T2(Z,z.path))continue;let X=U0(Q,z.path);N2(Q,z.path,void 0);let U=U0(Q,z.canonical);if(f8(X)&&o(U))N2(Q,z.canonical,X)}return Q}function bM($,Z){let Q={...$};for(let z of m){if(!z.canonical||!T2(Z,z.canonical)||T2(Z,z.path))continue;let X=U0(Q,z.canonical);if(f8(X)||R2(X))N2(Q,z.path,X)}return Q}function yM($,Z,Q={}){let z=$.project,X=u(z)?z.type:void 0,U={...$};for(let H of m){if(H.category==="human"||H.category==="project")continue;let J=b2(X,H);if(J===null)return $;if(J)xM(U,Z,H,H.path.startsWith("stack.")?Q[H.path.slice(6)]:void 0);else gM(U,H)}return U}function xM($,Z,Q,z){let X=M5(Q);for(let H of X)if(R2(U0($,H))&&!R2(U0(Z,H)))N2($,H,T2(Z,H)?U0(Z,H):"");if(!f8(z))return;let U=X.filter((H)=>T2($,H));if(U.some((H)=>!o(U0($,H))))return;for(let H of U.length>0?U:[Q.path])N2($,H,z)}function gM($,Z){let Q=M5(Z).filter((X)=>T2($,X)),z=(X)=>!o(U0($,X))&&!R2(U0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(o(U0($,X)))N2($,X,L6)}function vM($){let Z=$.project;if(Z===null||Z===void 0||u(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function kM($){let Z=$.project?.type??"library",Q=S2[Z]||S2.library;for(let z of m){if(Q.includes(z.category))continue;let[X,U]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[U]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[U]="slotignored"}}function p0($,Z){return g3($,Z,"")}function hM($){let Z=x0.get($);return Z!==void 0&&Z.category!=="human"}function f8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!o($)&&!R2($)}function uM($,Z){return hM($)&&f8(Z)}function g3($,Z,Q){let z={...$};for(let[X,U]of Object.entries(Z)){let H=z[X],J=Q?`${Q}.${X}`:X;if(J==="_meta"&&H!==void 0)continue;if(n8(H)){if(uM(J,U))z[X]=U;continue}if(o(H))z[X]=U;else if(u(U)&&u(H))z[X]=g3(H,U,J)}return z}function fM($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let Q=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=Q.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(Q))return`${Q}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function v3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function mM($,Z={}){let Q=I5($);if(Z.repoUrl&&Q.project&&!W0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=v3(Z.repoUrl);return Q}import{existsSync as k3,lstatSync as pM}from"fs";import{join as lM,basename as cM}from"path";import{createHash as dM}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),N0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",iM=/^v?\d+\.\d+\.\d+$/,nM=new Set(["birth","doubled","peak","current"]);function p3($){return B0($)&&F0($.version)&&iM.test($.version)&&N0($.score)}var rM=($)=>N0($.birthDNA)?$.birthDNA:N0($.birthWeight)?$.birthWeight:null,sM=($)=>B0($)&&N0($.birthDNA)&&F0($.born),h3=($)=>B0($)&&F0($.born)&&N0($.birthDNA)&&N0($.lastScore)&&F0($.endedAt),oM=($)=>Array.isArray($)&&$.length>0&&$.every(p3),aM=($)=>B0($)&&N0($.score)&&F0($.version),tM=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function u3($){return B0($)&&sM($.birthCertificate)&&oM($.versions)&&aM($.current)&&tM($.growth)}function O5($){try{return pM($),!0}catch{return!1}}var _5=($)=>`${JSON.stringify($,null,2)}
266
- `,eM=new Set(["version","score","lastSync"]),$O=new Set(["type","score","date","version","label","emoji"]),f3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),P5={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},l3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),c3=($)=>f3($.current,eM)&&l3($).every((Z)=>f3(Z,$O)),ZO=($)=>l3($).every((Z)=>Z.label===P5[Z.type].label&&Z.emoji===P5[Z.type].emoji);function QO($){return c3($)&&ZO($)}var zO=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",XO=".faf-dna is not exactly as faf wrote it (hand formatting, key order, a repeated key or a number JSON cannot hold exactly): faf reads it and leaves it as it is.",UO=".faf-dna has a key of yours in an entry faf would replace (current, or the peak or current milestone): faf reads it and leaves it as it is.",HO=".faf-dna has a label or emoji of yours on a milestone faf would replace (the peak or current one): faf reads it and leaves it as it is.",JO=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function GO($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&nM.has(Z.type)&&N0(Z.score))}var A2=($,Z="")=>F0($)?$:Z;function VO($,Z){if(!Array.isArray($))return[];return $.filter(p3).map((Q)=>({version:Q.version,timestamp:A2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(F0):[],growth:N0(Q.growth)?Q.growth:Q.score-Z}))}function YO($,Z,Q,z){return{version:A2($.version,Z?.version??"v1.0.0"),score:N0($.score)?$.score:Z?.score??Q,lastSync:A2($.lastSync,z)}}function m3($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=rM(Z);if(Q===null)return null;let z=A2(Z.born),X=VO($.versions,Q),U=YO(B0($.current)?$.current:{},X[X.length-1],Q,z),H=B0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"||Z.birthWeightSource==="legacy"?"legacy":"init",projectDNA:A2(Z.projectDNA),certificate:A2(Z.certificate)},versions:X,current:U,growth:{totalGrowth:U.score-Q,daysActive:N0(H.daysActive)?H.daysActive:0,milestones:GO(Array.isArray(H.milestones)?H.milestones:$.milestones)},lastModified:A2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(h3)?{priorLineage:$.priorLineage.filter(h3)}:{}}}class d3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=lM($,".faf-dna")}exists(){let $=k3(this.dnaPath);if(!$&&!O5(this.dnaPath))this.sawNoFile=!0;return $}endingLineage(){let Z=this.dna??(()=>{let z=this.read();return z===null?null:m3(z.raw)})();if(!Z)return[];let Q=Z.birthCertificate;return[...Z.priorLineage??[],{born:Q.born,birthDNA:Q.birthDNA,certificate:Q.certificate,projectDNA:Q.projectDNA,lastScore:Z.current.score,endedAt:new Date().toISOString()}]}birth($){let Z=this.endingLineage();if(!O5(this.dnaPath))this.sawNoFile=!0;let Q=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Q,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Q,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Q},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Q,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Q,format:"faf-dna-v1",...Z.length>0?{priorLineage:Z}:{}},this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,U=$-X,H=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:H,timestamp:z,score:$,changes:Z,growth:U}),Q.current={version:H,score:$,lastSync:z},Q.growth.totalGrowth=U,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,H,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((U)=>U.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:F0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=F0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(F0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!k3(this.dnaPath)){if(!O5(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(u3(Q)&&_5(Q)===Z&&QO(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=m3(Q),this.reason=!this.dna?JO:!u3(Q)?zO:_5(Q)!==Z?XO:c3(Q)?HO:UO;return this.text=Z,this.dna}read(){let $;try{$=Z0(h(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=_5(this.dna),Z=this.text??(this.sawNoFile?null:I0(h(this.projectPath,".faf-dna")));e(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return dM("sha256").update([this.projectPath,Date.now().toString(),Math.random().toString(36)].join(":")).digest("hex").substring(0,16)}generateCertificate(){let $=new Date().getFullYear(),Z=Math.random().toString(36).substring(2,6).toUpperCase(),Q=cM(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${Q}-${Z}`}incrementVersion($){let[Z,Q,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${Q}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,Q){if(!this.dna)return;let z=this.dna.growth.milestones,X=(G)=>z.some((V)=>V.type===G),U=(G)=>z.push({type:G,score:$,date:Q,version:Z,...P5[G]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))U("doubled");let H=z.find((G)=>G.type==="peak");if(!H||$>H.score){if(H)z.splice(z.indexOf(H),1);U("peak")}let J=z.findIndex((G)=>G.type==="current");if(J>=0)z.splice(J,1);U("current")}}import{join as lO}from"path";import{existsSync as kO,statSync as rT}from"fs";import{join as Zz}from"path";import{dirname as a3,resolve as t3}from"path";var n3=100;var WO="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",BO=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${WO})(?=\\s|/?>|$)`,"i"),new RegExp(`^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*>)\\s*$`,"i")],qO=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],KO=["","-->","?>",">","]]>"],DO=/[#`~*+_=<>0-9-]/,LO=/(\d{1,9})([.)])/y,IO=/#{1,6}(?:[ \t]+|$)/y,MO=/`{3,}(?!.*`)|~{3,}/y,OO=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,_O=/(?:=+|-+)[ \t]*$/y,PO=/[^ \t\f\v\r\n]/;function Y6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var FO=($)=>$==="quote"||$==="list"||$==="item";function NO($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let U=$.length-1;U>=0;U--){let H=$[U],J=H===" "||H==="\t";for(let V=0;V<3;V++)if(H==="*-_"[V])z[V]++;else if(!J)X[V]=!1;let G="*-_".indexOf(H);Z[U]=G>=0&&X[G]&&z[G]>=3?1:0}return Z}var V$=($)=>$===" "||$==="\t";function RO($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var i3=($)=>$==="paragraph"||$==="code"||$==="html";function TO($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class R0{containers;stack=[{kind:"document"}];ln="";offset=0;column=0;nextNonspace=0;nextNonspaceColumn=0;indent=0;indented=!1;blank=!1;allClosed=!0;matched=0;htmlStarted=!1;hiddenIn=null;scannedFrom=-1;breaks=null;deep=!1;limit=-1;overflow=-1;starts;constructor($=!0){this.containers=$;this.starts=[()=>this.startQuote(),()=>this.startHeading(),()=>this.startFence(),(Z)=>this.startHtml(Z),(Z)=>this.startSetext(Z),()=>this.startBreak(),(Z)=>this.startItem(Z),()=>this.startIndentedCode()]}clone(){let $=new R0(this.containers);return $.stack=this.stack.map(TO),$.deep=this.deep,$}overflowAt($,Z){let Q=this.clone();return Q.limit=Z,Q.line($),Q.overflow}get tooDeep(){return this.deep}line($){if(this.deep)return null;this.ln=$,this.offset=0,this.column=0,this.blank=!1,this.htmlStarted=!1,this.hiddenIn=null,this.scannedFrom=-1,this.breaks=null;let Z=this.continueContainers();if(Z<0)return this.hiddenIn;let Q=this.openBlocks(Z);if(this.deep)return null;if(!this.allClosed&&!this.blank&&this.tip.kind==="paragraph")return null;return this.closeUnmatched(),this.addText(Q),this.hiddenIn}closer(){if(this.stack.length!==2)return null;let $=this.stack[1];if($.kind==="code")return $.fence?$.fence.char.repeat($.fence.len):null;if($.kind!=="html"||$.type>5)return null;return $.type===1?`</${$.tag}>`:KO[$.type-1]}get tip(){return this.stack[this.stack.length-1]}continueContainers(){let $=this.stack.length-1,Z=0;while(Z<$){this.findNextNonspace();let Q=this.continues(this.stack[Z+1],Z+1);if(Q===2)return-1;if(Q===1)break;Z++}return this.allClosed=Z===$,this.matched=Z,Z}openBlocks($){let Z=this.stack[$],Q=Z.kind!=="paragraph"&&i3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!DO.test(this.ln.charAt(z)))break;let X=0;for(let U of this.starts)if(X=U(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!i3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=qO[$.type-1].test(this.ln.slice(this.offset));if(!(this.htmlStarted&&$.type===2&&Z))this.hiddenIn=$.type===1?`<${$.tag}>`:$.type===2?"comment":"html";if(Z)this.stack.pop()}continues($,Z){switch($.kind){case"quote":return this.continueQuote();case"item":return this.continueItem($);case"code":return $.fence?this.continueFence($.fence,Z):this.continueIndentedCode();default:return this.continueOther($)}}continueOther($){if($.kind==="heading"||$.kind==="break")return 1;return($.kind==="paragraph"||$.kind==="html"&&$.type>=6)&&this.blank?1:0}continueQuote(){if(this.indented||this.ch!==">")return 1;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),V$(this.ln[this.offset]))this.advanceOffset(1,!0);return 0}continueItem($){let Z=$.list.markerOffset+$.list.padding;if(this.blank){if(!$.hasChild)return 1;this.advanceNextNonspace()}else if(this.indent>=Z)this.advanceOffset(Z,!0);else return 1;return 0}continueFence($,Z){let Q=this.indent<=3&&this.ch===$.char?Y6(OO,this.ln,this.nextNonspace):null;if(Q&&Q[0].length>=$.len)return this.stack.length=Z,this.hiddenIn="code fence",2;for(let z=$.offset;z>0&&V$(this.ln[this.offset]);z--)this.advanceOffset(1,!0);return 0}continueIndentedCode(){if(this.indent>=4)this.advanceOffset(4,!0);else if(this.blank)this.advanceNextNonspace();else return 1;return 0}get ch(){return this.ln.charAt(this.nextNonspace)}breakAhead(){return this.breaks??=NO(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),V$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!Y6(IO,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.addChild({kind:"heading"}),this.offset=this.ln.length,2}startFence(){let $=this.ch,Z=this.indented||$!=="`"&&$!=="~"?null:Y6(MO,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let U=BO[X-1].exec(z);if(U)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?U[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!Y6(_O,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.stack[this.stack.length-1]={kind:"heading"},this.offset=this.ln.length,2}startBreak(){if(this.indented||!this.breakAhead())return 0;return this.closeUnmatched(),this.addChild({kind:"break"}),this.offset=this.ln.length,2}startItem($){if(!this.containers||this.indented&&$.kind!=="list")return 0;let Z=this.listMarker($);if(!Z)return 0;this.closeUnmatched();let Q=this.tip;if(Q.kind!=="list"||Q.list.bullet!==Z.bullet||Q.list.delimiter!==Z.delimiter)this.addChild({kind:"list",list:Z});return this.addChild({kind:"item",list:Z,hasChild:!1}),1}startIndentedCode(){if(!this.indented||this.tip.kind==="paragraph"||this.blank)return 0;return this.advanceOffset(4,!0),this.closeUnmatched(),this.addChild({kind:"code",fence:null}),2}listMarker($){if(this.indent>=4)return null;let Z=this.markerAt($);if(!Z)return null;let Q=this.indent;return this.advanceNextNonspace(),this.advanceOffset(Z.width,!0),{...Z.kind,markerOffset:Q,padding:this.paddingAfter(Z.width)}}markerAt($){let Z=$.kind==="paragraph",Q=this.markerKind(Z);if(!Q)return null;let z=this.ln[this.nextNonspace+Q.width];if(!(z===void 0||V$(z)))return null;if(Z&&!PO.test(this.ln.slice(this.nextNonspace+Q.width)))return null;return Q}markerKind($){let Z=this.ch;if(Z==="*"||Z==="+"||Z==="-")return{width:1,kind:{bullet:Z,delimiter:null}};let Q=Z>="0"&&Z<="9"?Y6(LO,this.ln,this.nextNonspace):null;if(!Q||$&&Number(Q[1])!==1)return null;return{width:Q[0].length,kind:{bullet:null,delimiter:Q[2]}}}paddingAfter($){let Z=this.column,Q=this.offset;do this.advanceOffset(1,!0);while(this.column-Z<5&&V$(this.ln[this.offset]));let z=this.column-Z;if(z>=1&&z<5&&this.ln[this.offset]!==void 0)return $+z;if(this.column=Z,this.offset=Q,V$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!RO(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),FO($.kind)&&this.stack.length-1>100)this.deep=!0}closeUnmatched(){if(!this.allClosed)this.stack.length=this.matched+1,this.allClosed=!0}findNextNonspace(){let $=this.ln,Z=this.offset,Q=this.column;if(this.scannedFrom!==-1&&this.offset>=this.scannedFrom&&this.offset<=this.nextNonspace)Z=this.nextNonspace,Q=this.nextNonspaceColumn;else{this.scannedFrom=this.offset;for(;Z<$.length;Z++)if($[Z]===" ")Q++;else if($[Z]==="\t")Q+=4-Q%4;else break}this.blank=Z>=$.length,this.nextNonspace=Z,this.nextNonspaceColumn=Q,this.indent=Q-this.column,this.indented=this.indent>=4}advanceNextNonspace(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn}advanceOffset($,Z){let Q=$;while(Q>0&&this.offset<this.ln.length){if(this.ln[this.offset]!=="\t"){this.offset++,this.column++,Q--;continue}let z=4-this.column%4,X=Z&&z>Q;this.column+=X?Q:z,this.offset+=X?0:1,Q-=Z?Math.min(z,Q):1}}}var E0="<!-- faf:start -->",b0="<!-- faf:end -->",r3="\uFEFF";function B6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var Y$=($)=>$.replace(/\r?\n$|\r$/,""),e3=($)=>Y$($).replace(/^\uFEFF/,"").trimEnd();function*F5($){let Z=0;for(let Q of B6($)){let z=Y$(Q),X=Z===0&&z.charCodeAt(0)===65279?1:0;yield{offset:Z,from:Z+X,to:Z+z.length,content:z.slice(X)},Z+=Q.length}}function AO($,Z,Q,z){let X=$.some((H)=>H.start!==-1)&&z(Z.content),U=Q(Z.content);for(let H of $)if(H.start!==-1&&X)H.found={start:H.start,end:Z.to};else if(U)H.start=Z.from}function N5($,Z,Q){let[z,X]=[new R0(!0),new R0(!1)].map((U)=>({reader:U,start:-1,found:null}));for(let U of F5($)){let H=[z,X].map((G)=>G.reader.line(U.content));if(z.reader.tooDeep)return null;let J=[z,X].filter((G,V)=>H[V]===null);if(J.length>0)AO(J,U,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var s3=($)=>(Z)=>Z===$;function C2($,Z=E0,Q=b0){return N5($,s3(Z),s3(Q))}function o3($,Z){let Q=[];for(let z of[!0,!1]){let X=new R0(z);for(let U of B6($))X.line(Y$(U));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var CO=16;function jO($){let Z=new R0(!0);return $.map((Q)=>{let z=Z.overflowAt(Y$(Q),CO),X=Q;if(z>=0){let U=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),H=U?z+U[0].length:z;X=`${Q.slice(0,H)}\\${Q.slice(H)}`}return Z.line(Y$(X)),X})}function wO($,Z,Q){let X=jO(B6($).map((H)=>{let J=e3(H);return J===Z||J===Q?` ${H}`:H})).join(""),U=o3(X,Q);while(U.length>0&&U[0]!==null){let H=`${X}
267
- ${U[0]}`,J=o3(H,Q);if(J.length>=U.length)break;X=H,U=J}return X}function SO($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=B6(z).map((U)=>Y$(U)===""?`>${U}`:`> ${U}`).join("");return`${Z}
262
+ `)}function BO($){let Q=WO($).split(`
263
+ `),z=[];for(let X of Q){let H=X.trim();if(H===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(H))break;if(/^\*\*[^*]+\*\*\s*$/.test(H)&&z.length===0)continue;z.push(H)}if(z.length===0)return null;return z.join(" ").trim()}function N2($,Z){let Q=$.split(`
264
+ `),z=0;while(z<Q.length){let H=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(H&&Z.test(H[2])){let U=H[1].length,J=[];z++;while(z<Q.length){let G=Q[z].trim(),V=G.match(/^(#{1,6})\s+/);if(V&&V[1].length<=U)break;if(G===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(G))break;J.push(G),z++}if(J.length===0)return null;return J.join(" ").trim()}z++}return null}function qO($){let Z=N2($,/^(use\s+cases?|goal)\b/i);if(Z&&P0(Z))return Z;let Q=BO($);if(Q&&P0(Q))return Q;return}function KO($){let Z=N2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&P0(Z))return Z;return}function DO($){let Z=N2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&P0(Z))return Z;return}function LO($){let Z=N2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&P0(Z))return Z;return}function IO($){let Z=N2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&P0(Z))return Z;return}function OO($){let Z=N2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&P0(Z))return Z;return}function _O($){let Z=N2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&P0(Z))return Z;return}function L1($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(I($,K)){Q=K;break}if(!Q)return{};let z=S($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},H=qO(z);if(H)X.project={goal:H};let U={},J=KO(z);if(J)U.what=J;let G=DO(z);if(G)U.who=G;let V=LO(z);if(V)U.why=V;let Y=IO(z);if(Y)U.where=Y;let W=OO(z);if(W)U.when=W;let B=_O(z);if(B)U.how=B;if(Object.keys(U).length>0)X.human_context=U;return X}function MO($,Z){let Q=$.split(`
265
+ `),z=!1;for(let X of Q){let H=X.trim();if(/^\[/.test(H)){z=H==="[package]";continue}if(!z)continue;let U=H.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(U){let J=U[1].trim();J=J.replace(/\s*#.*$/,"").trim();let G=J.match(/^"((?:[^"\\]|\\.)*)"$/)||J.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return J}}return null}function I1($){let Z=S($,"Cargo.toml");if(Z===null)return{};let Q=MO(Z,"description");if(Q&&P0(Q))return{project:{goal:Q}};return{}}import{join as x3}from"path";var PO=[{re:/^postgres|postgis|pgvector/,slot:"database",label:"PostgreSQL"},{re:/^mysql/,slot:"database",label:"MySQL"},{re:/^mariadb/,slot:"database",label:"MariaDB"},{re:/^mongo/,slot:"database",label:"MongoDB"},{re:/clickhouse/,slot:"database",label:"ClickHouse"},{re:/^cockroach/,slot:"database",label:"CockroachDB"},{re:/^redis|^valkey/,slot:"cache",label:"Redis"},{re:/^memcached/,slot:"cache",label:"Memcached"},{re:/elasticsearch/,slot:"search",label:"Elasticsearch"},{re:/opensearch/,slot:"search",label:"OpenSearch"},{re:/meilisearch/,slot:"search",label:"Meilisearch"},{re:/typesense/,slot:"search",label:"Typesense"},{re:/qdrant/,slot:"search",label:"Qdrant (vector)"},{re:/weaviate/,slot:"search",label:"Weaviate (vector)"},{re:/^minio/,slot:"storage",label:"MinIO (S3-compatible)"},{re:/localstack/,slot:"storage",label:"LocalStack (AWS)"},{re:/rabbitmq/,slot:"runtime",label:"RabbitMQ"},{re:/kafka/,slot:"runtime",label:"Kafka"},{re:/nats/,slot:"runtime",label:"NATS"},{re:/temporalio\/|temporal-server|temporal:/,slot:"runtime",label:"Temporal"}],FO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function RO($){let Z=[],Q=(z,X)=>{for(let H of v($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(x3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!FO.has(H.name))Q(x3(z,H.name),X-1)};return Q(".",1),Z}function V6($){return[...$].join(" · ")}function O1($){let Z=RO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let H=S($,X);if(H===null)continue;for(let U of H.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let J=U[1].toLowerCase(),G=J.replace(/:[^/]*$/,"").split("/").pop()??J,V=J.replace(/:[^/]*$/,"");for(let{re:Y,slot:W,label:B}of PO)if(Y.test(G)||Y.test(V))Q[W].add(B)}}let z={};if(Q.database.size)z.database=V6(Q.database);if(Q.cache.size)z.cache=V6(Q.cache);if(Q.search.size)z.search=V6(Q.search);if(Q.storage.size)z.storage=V6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${V6(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as NO}from"path";var TO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),AO=[{file:"Makefile",runner:"make",targets:($)=>[...$.matchAll(/^([a-zA-Z][\w-]*)\s*:(?!=)/gm)].map((Z)=>Z[1])},{file:"justfile",runner:"just",targets:($)=>[...$.matchAll(/^([a-zA-Z][\w-]*)\s*(?:\([^)]*\))?\s*:/gm)].map((Z)=>Z[1])},{file:"Taskfile.yml",runner:"task",targets:($)=>{let Z=$.indexOf("tasks:");if(Z===-1)return[];return[...$.slice(Z).matchAll(/^\s{2}([a-zA-Z][\w-]*):/gm)].map((Q)=>Q[1])}}];function _1($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function CO($){let Z=[$];for(let Q of v($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!TO.has(Q.name))Z.push(NO($,Q.name));return Z}function jO($){let Z=0;if(I($,"manage.py")||I($,"pyproject.toml")||I($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function M1($){return e2($,()=>wO($))}function wO($){let Z=[];for(let z of CO($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of AO){let J=S(z,U.file);if(J===null)continue;let G=U.targets(J);if(G.length===0)continue;let V={},Y=_1(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=_1(G,[/^build$/i,/^compile$/i,/^build/i]),B=_1(G,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(Y)V.test=`${H}${U.runner} ${Y}`;if(W)V.build=`${H}${U.runner} ${W}`;if(B)V.lint=`${H}${U.runner} ${B}`;if(Object.keys(V).length===0)continue;Z.push({score:Object.keys(V).length+(X?10:jO(z)),commands:V})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var SO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function P1($){for(let Z of SO)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function EO($,Z){let Q={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}},stack:{...Z.stack??{},...$.stack??{}},commands:{...Z.commands??{},...$.commands??{}},security:{...Z.security??{},...$.security??{}}};for(let z of["project","human_context","stack","commands","security"])if(Q[z]&&Object.keys(Q[z]).length===0)delete Q[z];return Q}function F1($){return[L1($),I1($),O1($),M1($),P1($)].reduce(EO,{})}function g3($){try{let Z=s2($,{logLevel:"error"}).getIn(["project","type"],!0);return s(Z)&&typeof Z.comment==="string"&&Z.comment.includes(y2)}catch{return!1}}function R1($){let Z=b3($),Q=F1($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X={};if(Q.project)X.project=Q.project;if(Q.human_context)X.human_context=Q.human_context;let H=l0(l0(z,Z),X);mO(H);let J=(Z._meta?.found??[]).some((V)=>V.startsWith("polyglot:")),G=l0(H,v8($));return l0(G,{human_context:k8($,{toolingRoot:J})})}function bO($,Z){let Q=fO(Y8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=D1($),H=z,U=l0(Q,F1($)),J=l0(U,H),G=l0(J,v8($)),V=gO(l0(G,{human_context:k8($)}),Q),Y=vO(yO(Z,Q,H)?kO(v3(V,Q),Q,X):v3(V,Q),Q);return k9(g9(Z,Y))}function yO($,Z,Q){if(!o(H0(Z,"project.type"))){let X=a$($)?.text;return X===void 0||!g3(X)}return!(Q._meta?.found??[]).includes(y2)}function N1($){return $.canonical?[$.path,$.canonical]:[$.path]}function H0($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)?X[z]:void 0}function T2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!u(H))return;if(Q===void 0?!(X in H):H[X]===Q)return;let U={...H};if(Q===void 0)delete U[X];else U[X]=Q;$[z]=U}var A2=($)=>typeof $==="string"&&$.trim()===L6;function xO($,Z){let Q=Z.map((z)=>H0($,z));return Q.some(A2)&&Q.every((z)=>o(z)||A2(z))}function v3($,Z){let Q={...$};for(let z of m){let X=N1(z);if(!xO(Z,X))continue;for(let H of X){let U=H0(Z,H);if(H0(Q,H)!==U)T2(Q,H,U)}}return Q}function C2($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)&&Object.prototype.hasOwnProperty.call(X,z)}function gO($,Z){let Q={...$};for(let z of m){if(!z.canonical||!C2(Z,z.canonical)||C2(Z,z.path))continue;let X=H0(Q,z.path);T2(Q,z.path,void 0);let H=H0(Q,z.canonical);if(c8(X)&&o(H))T2(Q,z.canonical,X)}return Q}function vO($,Z){let Q={...$};for(let z of m){if(!z.canonical||!C2(Z,z.canonical)||C2(Z,z.path))continue;let X=H0(Q,z.canonical);if(c8(X)||A2(X))T2(Q,z.path,X)}return Q}function kO($,Z,Q={}){let z=$.project,X=u(z)?z.type:void 0,H={...$};for(let U of m){if(U.category==="human"||U.category==="project")continue;let J=x2(X,U);if(J===null)return $;if(J)hO(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0);else uO(H,U)}return H}function hO($,Z,Q,z){let X=N1(Q);for(let U of X)if(A2(H0($,U))&&!A2(H0(Z,U)))T2($,U,C2(Z,U)?H0(Z,U):"");if(!c8(z))return;let H=X.filter((U)=>C2($,U));if(H.some((U)=>!o(H0($,U))))return;for(let U of H.length>0?H:[Q.path])T2($,U,z)}function uO($,Z){let Q=N1(Z).filter((X)=>C2($,X)),z=(X)=>!o(H0($,X))&&!A2(H0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(o(H0($,X)))T2($,X,L6)}function fO($){let Z=$.project;if(Z===null||Z===void 0||u(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function mO($){let Z=$.project?.type??"library",Q=b2[Z]||b2.library;for(let z of m){if(Q.includes(z.category))continue;let[X,H]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[H]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[H]="slotignored"}}function l0($,Z){return k3($,Z,"")}function pO($){let Z=g0.get($);return Z!==void 0&&Z.category!=="human"}function c8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!o($)&&!A2($)}function lO($,Z){return pO($)&&c8(Z)}function k3($,Z,Q){let z={...$};for(let[X,H]of Object.entries(Z)){let U=z[X],J=Q?`${Q}.${X}`:X;if(J==="_meta"&&U!==void 0)continue;if(a8(U)){if(lO(J,H))z[X]=H;continue}if(o(U))z[X]=H;else if(u(H)&&u(U))z[X]=k3(U,H,J)}return z}function cO($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let Q=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=Q.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(Q))return`${Q}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function h3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function dO($,Z={}){let Q=R1($);if(Z.repoUrl&&Q.project&&!W0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=h3(Z.repoUrl);return Q}import{existsSync as u3,lstatSync as iO}from"fs";import{join as nO,basename as rO}from"path";import{createHash as sO}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),R0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",oO=/^v?\d+\.\d+\.\d+$/,aO=new Set(["birth","doubled","peak","current"]);function c3($){return B0($)&&F0($.version)&&oO.test($.version)&&R0($.score)}var tO=($)=>R0($.birthDNA)?$.birthDNA:R0($.birthWeight)?$.birthWeight:null,eO=($)=>B0($)&&R0($.birthDNA)&&F0($.born),f3=($)=>B0($)&&F0($.born)&&R0($.birthDNA)&&R0($.lastScore)&&F0($.endedAt),$_=($)=>Array.isArray($)&&$.length>0&&$.every(c3),Z_=($)=>B0($)&&R0($.score)&&F0($.version),Q_=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function m3($){return B0($)&&eO($.birthCertificate)&&$_($.versions)&&Z_($.current)&&Q_($.growth)}function T1($){try{return iO($),!0}catch{return!1}}var A1=($)=>`${JSON.stringify($,null,2)}
266
+ `,z_=new Set(["version","score","lastSync"]),X_=new Set(["type","score","date","version","label","emoji"]),p3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),C1={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},d3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),i3=($)=>p3($.current,z_)&&d3($).every((Z)=>p3(Z,X_)),H_=($)=>d3($).every((Z)=>Z.label===C1[Z.type].label&&Z.emoji===C1[Z.type].emoji);function U_($){return i3($)&&H_($)}var J_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",G_=".faf-dna is not exactly as faf wrote it (hand formatting, key order, a repeated key or a number JSON cannot hold exactly): faf reads it and leaves it as it is.",V_=".faf-dna has a key of yours in an entry faf would replace (current, or the peak or current milestone): faf reads it and leaves it as it is.",Y_=".faf-dna has a label or emoji of yours on a milestone faf would replace (the peak or current one): faf reads it and leaves it as it is.",W_=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function B_($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&aO.has(Z.type)&&R0(Z.score))}var j2=($,Z="")=>F0($)?$:Z;function q_($,Z){if(!Array.isArray($))return[];return $.filter(c3).map((Q)=>({version:Q.version,timestamp:j2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(F0):[],growth:R0(Q.growth)?Q.growth:Q.score-Z}))}function K_($,Z,Q,z){return{version:j2($.version,Z?.version??"v1.0.0"),score:R0($.score)?$.score:Z?.score??Q,lastSync:j2($.lastSync,z)}}function l3($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=tO(Z);if(Q===null)return null;let z=j2(Z.born),X=q_($.versions,Q),H=K_(B0($.current)?$.current:{},X[X.length-1],Q,z),U=B0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"||Z.birthWeightSource==="legacy"?"legacy":"init",projectDNA:j2(Z.projectDNA),certificate:j2(Z.certificate)},versions:X,current:H,growth:{totalGrowth:H.score-Q,daysActive:R0(U.daysActive)?U.daysActive:0,milestones:B_(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:j2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(f3)?{priorLineage:$.priorLineage.filter(f3)}:{}}}class n3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=nO($,".faf-dna")}exists(){let $=u3(this.dnaPath);if(!$&&!T1(this.dnaPath))this.sawNoFile=!0;return $}endingLineage(){let Z=this.dna??(()=>{let z=this.read();return z===null?null:l3(z.raw)})();if(!Z)return[];let Q=Z.birthCertificate;return[...Z.priorLineage??[],{born:Q.born,birthDNA:Q.birthDNA,certificate:Q.certificate,projectDNA:Q.projectDNA,lastScore:Z.current.score,endedAt:new Date().toISOString()}]}birth($){let Z=this.endingLineage();if(!T1(this.dnaPath))this.sawNoFile=!0;let Q=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Q,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Q,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Q},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Q,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Q,format:"faf-dna-v1",...Z.length>0?{priorLineage:Z}:{}},this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,H=$-X,U=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:U,timestamp:z,score:$,changes:Z,growth:H}),Q.current={version:U,score:$,lastSync:z},Q.growth.totalGrowth=H,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,U,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((H)=>H.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:F0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=F0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(F0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!u3(this.dnaPath)){if(!T1(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(m3(Q)&&A1(Q)===Z&&U_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=l3(Q),this.reason=!this.dna?W_:!m3(Q)?J_:A1(Q)!==Z?G_:i3(Q)?Y_:V_;return this.text=Z,this.dna}read(){let $;try{$=Z0(h(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=A1(this.dna),Z=this.text??(this.sawNoFile?null:I0(h(this.projectPath,".faf-dna")));e(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return sO("sha256").update([this.projectPath,Date.now().toString(),Math.random().toString(36)].join(":")).digest("hex").substring(0,16)}generateCertificate(){let $=new Date().getFullYear(),Z=Math.random().toString(36).substring(2,6).toUpperCase(),Q=rO(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${Q}-${Z}`}incrementVersion($){let[Z,Q,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${Q}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,Q){if(!this.dna)return;let z=this.dna.growth.milestones,X=(G)=>z.some((V)=>V.type===G),H=(G)=>z.push({type:G,score:$,date:Q,version:Z,...C1[G]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))H("doubled");let U=z.find((G)=>G.type==="peak");if(!U||$>U.score){if(U)z.splice(z.indexOf(U),1);H("peak")}let J=z.findIndex((G)=>G.type==="current");if(J>=0)z.splice(J,1);H("current")}}import{join as n_}from"path";import{existsSync as m_,statSync as XA}from"fs";import{join as zz}from"path";import{dirname as e3,resolve as $z}from"path";var s3=100;var D_="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",L_=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${D_})(?=\\s|/?>|$)`,"i"),new RegExp(`^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*>)\\s*$`,"i")],I_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],O_=["","-->","?>",">","]]>"],__=/[#`~*+_=<>0-9-]/,M_=/(\d{1,9})([.)])/y,P_=/#{1,6}(?:[ \t]+|$)/y,F_=/`{3,}(?!.*`)|~{3,}/y,R_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,N_=/(?:=+|-+)[ \t]*$/y,T_=/[^ \t\f\v\r\n]/;function Y6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var A_=($)=>$==="quote"||$==="list"||$==="item";function C_($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let H=$.length-1;H>=0;H--){let U=$[H],J=U===" "||U==="\t";for(let V=0;V<3;V++)if(U==="*-_"[V])z[V]++;else if(!J)X[V]=!1;let G="*-_".indexOf(U);Z[H]=G>=0&&X[G]&&z[G]>=3?1:0}return Z}var B$=($)=>$===" "||$==="\t";function j_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var r3=($)=>$==="paragraph"||$==="code"||$==="html";function w_($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class N0{containers;stack=[{kind:"document"}];ln="";offset=0;column=0;nextNonspace=0;nextNonspaceColumn=0;indent=0;indented=!1;blank=!1;allClosed=!0;matched=0;htmlStarted=!1;hiddenIn=null;scannedFrom=-1;breaks=null;deep=!1;limit=-1;overflow=-1;starts;constructor($=!0){this.containers=$;this.starts=[()=>this.startQuote(),()=>this.startHeading(),()=>this.startFence(),(Z)=>this.startHtml(Z),(Z)=>this.startSetext(Z),()=>this.startBreak(),(Z)=>this.startItem(Z),()=>this.startIndentedCode()]}clone(){let $=new N0(this.containers);return $.stack=this.stack.map(w_),$.deep=this.deep,$}overflowAt($,Z){let Q=this.clone();return Q.limit=Z,Q.line($),Q.overflow}get tooDeep(){return this.deep}line($){if(this.deep)return null;this.ln=$,this.offset=0,this.column=0,this.blank=!1,this.htmlStarted=!1,this.hiddenIn=null,this.scannedFrom=-1,this.breaks=null;let Z=this.continueContainers();if(Z<0)return this.hiddenIn;let Q=this.openBlocks(Z);if(this.deep)return null;if(!this.allClosed&&!this.blank&&this.tip.kind==="paragraph")return null;return this.closeUnmatched(),this.addText(Q),this.hiddenIn}closer(){if(this.stack.length!==2)return null;let $=this.stack[1];if($.kind==="code")return $.fence?$.fence.char.repeat($.fence.len):null;if($.kind!=="html"||$.type>5)return null;return $.type===1?`</${$.tag}>`:O_[$.type-1]}get tip(){return this.stack[this.stack.length-1]}continueContainers(){let $=this.stack.length-1,Z=0;while(Z<$){this.findNextNonspace();let Q=this.continues(this.stack[Z+1],Z+1);if(Q===2)return-1;if(Q===1)break;Z++}return this.allClosed=Z===$,this.matched=Z,Z}openBlocks($){let Z=this.stack[$],Q=Z.kind!=="paragraph"&&r3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!__.test(this.ln.charAt(z)))break;let X=0;for(let H of this.starts)if(X=H(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!r3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=I_[$.type-1].test(this.ln.slice(this.offset));if(!(this.htmlStarted&&$.type===2&&Z))this.hiddenIn=$.type===1?`<${$.tag}>`:$.type===2?"comment":"html";if(Z)this.stack.pop()}continues($,Z){switch($.kind){case"quote":return this.continueQuote();case"item":return this.continueItem($);case"code":return $.fence?this.continueFence($.fence,Z):this.continueIndentedCode();default:return this.continueOther($)}}continueOther($){if($.kind==="heading"||$.kind==="break")return 1;return($.kind==="paragraph"||$.kind==="html"&&$.type>=6)&&this.blank?1:0}continueQuote(){if(this.indented||this.ch!==">")return 1;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),B$(this.ln[this.offset]))this.advanceOffset(1,!0);return 0}continueItem($){let Z=$.list.markerOffset+$.list.padding;if(this.blank){if(!$.hasChild)return 1;this.advanceNextNonspace()}else if(this.indent>=Z)this.advanceOffset(Z,!0);else return 1;return 0}continueFence($,Z){let Q=this.indent<=3&&this.ch===$.char?Y6(R_,this.ln,this.nextNonspace):null;if(Q&&Q[0].length>=$.len)return this.stack.length=Z,this.hiddenIn="code fence",2;for(let z=$.offset;z>0&&B$(this.ln[this.offset]);z--)this.advanceOffset(1,!0);return 0}continueIndentedCode(){if(this.indent>=4)this.advanceOffset(4,!0);else if(this.blank)this.advanceNextNonspace();else return 1;return 0}get ch(){return this.ln.charAt(this.nextNonspace)}breakAhead(){return this.breaks??=C_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),B$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!Y6(P_,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.addChild({kind:"heading"}),this.offset=this.ln.length,2}startFence(){let $=this.ch,Z=this.indented||$!=="`"&&$!=="~"?null:Y6(F_,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let H=L_[X-1].exec(z);if(H)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?H[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!Y6(N_,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.stack[this.stack.length-1]={kind:"heading"},this.offset=this.ln.length,2}startBreak(){if(this.indented||!this.breakAhead())return 0;return this.closeUnmatched(),this.addChild({kind:"break"}),this.offset=this.ln.length,2}startItem($){if(!this.containers||this.indented&&$.kind!=="list")return 0;let Z=this.listMarker($);if(!Z)return 0;this.closeUnmatched();let Q=this.tip;if(Q.kind!=="list"||Q.list.bullet!==Z.bullet||Q.list.delimiter!==Z.delimiter)this.addChild({kind:"list",list:Z});return this.addChild({kind:"item",list:Z,hasChild:!1}),1}startIndentedCode(){if(!this.indented||this.tip.kind==="paragraph"||this.blank)return 0;return this.advanceOffset(4,!0),this.closeUnmatched(),this.addChild({kind:"code",fence:null}),2}listMarker($){if(this.indent>=4)return null;let Z=this.markerAt($);if(!Z)return null;let Q=this.indent;return this.advanceNextNonspace(),this.advanceOffset(Z.width,!0),{...Z.kind,markerOffset:Q,padding:this.paddingAfter(Z.width)}}markerAt($){let Z=$.kind==="paragraph",Q=this.markerKind(Z);if(!Q)return null;let z=this.ln[this.nextNonspace+Q.width];if(!(z===void 0||B$(z)))return null;if(Z&&!T_.test(this.ln.slice(this.nextNonspace+Q.width)))return null;return Q}markerKind($){let Z=this.ch;if(Z==="*"||Z==="+"||Z==="-")return{width:1,kind:{bullet:Z,delimiter:null}};let Q=Z>="0"&&Z<="9"?Y6(M_,this.ln,this.nextNonspace):null;if(!Q||$&&Number(Q[1])!==1)return null;return{width:Q[0].length,kind:{bullet:null,delimiter:Q[2]}}}paddingAfter($){let Z=this.column,Q=this.offset;do this.advanceOffset(1,!0);while(this.column-Z<5&&B$(this.ln[this.offset]));let z=this.column-Z;if(z>=1&&z<5&&this.ln[this.offset]!==void 0)return $+z;if(this.column=Z,this.offset=Q,B$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!j_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),A_($.kind)&&this.stack.length-1>100)this.deep=!0}closeUnmatched(){if(!this.allClosed)this.stack.length=this.matched+1,this.allClosed=!0}findNextNonspace(){let $=this.ln,Z=this.offset,Q=this.column;if(this.scannedFrom!==-1&&this.offset>=this.scannedFrom&&this.offset<=this.nextNonspace)Z=this.nextNonspace,Q=this.nextNonspaceColumn;else{this.scannedFrom=this.offset;for(;Z<$.length;Z++)if($[Z]===" ")Q++;else if($[Z]==="\t")Q+=4-Q%4;else break}this.blank=Z>=$.length,this.nextNonspace=Z,this.nextNonspaceColumn=Q,this.indent=Q-this.column,this.indented=this.indent>=4}advanceNextNonspace(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn}advanceOffset($,Z){let Q=$;while(Q>0&&this.offset<this.ln.length){if(this.ln[this.offset]!=="\t"){this.offset++,this.column++,Q--;continue}let z=4-this.column%4,X=Z&&z>Q;this.column+=X?Q:z,this.offset+=X?0:1,Q-=Z?Math.min(z,Q):1}}}var b0="<!-- faf:start -->",y0="<!-- faf:end -->",o3="\uFEFF";function B6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var q$=($)=>$.replace(/\r?\n$|\r$/,""),Zz=($)=>q$($).replace(/^\uFEFF/,"").trimEnd();function*j1($){let Z=0;for(let Q of B6($)){let z=q$(Q),X=Z===0&&z.charCodeAt(0)===65279?1:0;yield{offset:Z,from:Z+X,to:Z+z.length,content:z.slice(X)},Z+=Q.length}}function S_($,Z,Q,z){let X=$.some((U)=>U.start!==-1)&&z(Z.content),H=Q(Z.content);for(let U of $)if(U.start!==-1&&X)U.found={start:U.start,end:Z.to};else if(H)U.start=Z.from}function w1($,Z,Q){let[z,X]=[new N0(!0),new N0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of j1($)){let U=[z,X].map((G)=>G.reader.line(H.content));if(z.reader.tooDeep)return null;let J=[z,X].filter((G,V)=>U[V]===null);if(J.length>0)S_(J,H,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var a3=($)=>(Z)=>Z===$;function w2($,Z=b0,Q=y0){return w1($,a3(Z),a3(Q))}function t3($,Z){let Q=[];for(let z of[!0,!1]){let X=new N0(z);for(let H of B6($))X.line(q$(H));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var E_=16;function b_($){let Z=new N0(!0);return $.map((Q)=>{let z=Z.overflowAt(q$(Q),E_),X=Q;if(z>=0){let H=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),U=H?z+H[0].length:z;X=`${Q.slice(0,U)}\\${Q.slice(U)}`}return Z.line(q$(X)),X})}function y_($,Z,Q){let X=b_(B6($).map((U)=>{let J=Zz(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=t3(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
267
+ ${H[0]}`,J=t3(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function x_($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=B6(z).map((H)=>q$(H)===""?`>${H}`:`> ${H}`).join("");return`${Z}
268
268
  ${X}
269
- ${Q}`}function W6($,Z,Q,z=E0,X=b0,U="the file"){let H=(G)=>{let V=`${$}${G}${Q}`,Y=C2(V,z,X);return Y&&Y.start===$.length&&Y.end===$.length+G.length?V:null},J=H(Z)??H(SO(Z,z,X));if(J===null)throw new b("unplaceable",U,`${U}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return J}function R5($,Z=E0,Q=b0){return`${Z}
270
- ${wO($.trim(),Z,Q)}
271
- ${Q}`}function m8($,Z,Q=E0,z=b0,X){if($===null)return W6("",Z,`
272
- `,Q,z,X);let U=C2($,Q,z);if(U)return W6($.slice(0,U.start),Z,$.slice(U.end),Q,z,X);let H=$.startsWith(r3)?r3:"";return W6(H,Z,`
269
+ ${Q}`}function W6($,Z,Q,z=b0,X=y0,H="the file"){let U=(G)=>{let V=`${$}${G}${Q}`,Y=w2(V,z,X);return Y&&Y.start===$.length&&Y.end===$.length+G.length?V:null},J=U(Z)??U(x_(Z,z,X));if(J===null)throw new b("unplaceable",H,`${H}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return J}function S1($,Z=b0,Q=y0){return`${Z}
270
+ ${y_($.trim(),Z,Q)}
271
+ ${Q}`}function d8($,Z,Q=b0,z=y0,X){if($===null)return W6("",Z,`
272
+ `,Q,z,X);let H=w2($,Q,z);if(H)return W6($.slice(0,H.start),Z,$.slice(H.end),Q,z,X);let U=$.startsWith(o3)?o3:"";return W6(U,Z,`
273
273
 
274
- ${$.slice(H.length)}`,Q,z,X)}function q6($){try{return Z0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function T0($,Z,Q=E0,z=b0,X={}){let U=R5(Z,Q,z),H=t3($),J=X.root??a3(H),G=h(J,H),V=q6(G);e(G,m8(V,U,Q,z,H),{root:J,expect:V})}var EO="<!-- faf:";function bO($){if($==="code fence")return"a code fence";if($==="indented code")return"an indented code block";if($==="comment")return"an HTML comment";return $==="html"?"an HTML block":`a ${$} block`}function yO($,Z){let Q=[new R0(!0),new R0(!1)],z=!1;for(let{content:X}of F5($)){if(z){if(X===Z)return"too deep";continue}let[U,H]=Q.map((G)=>G.line(X));z=Q[0].tooDeep;let J=U??H;if(X===Z&&(z||J!==null))return z?"too deep":J}return null}function xO($,Z,Q){let z=[new R0(!0),new R0(!1)];for(let{content:X}of F5($)){let U=z.map((H)=>H.line(X));if(z[0].tooDeep)return!1;if((X===Z||X===Q)&&U.some((H)=>H===null))return!0}return!1}function p8($,Z,Q=E0,z=b0){if(Z===null||C2(Z,Q,z))return null;let X=e3(B6(Z)[0]??"");if(X.startsWith(EO)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let U=yO(Z,Q);if(U==="too deep")return`${$}: faf's block is now on top; the file nests more than ${n3} lists or quotes before an older faf block, so faf did not read that far — the older block is left as you had it; delete it by hand if you no longer want it.`;if(U!==null)return`${$}: faf's block is now on top; an older faf block below sits inside ${bO(U)} and is left as you had it — delete it by hand if you no longer want it.`;if(xO(Z,Q,z))return`${$}: faf's block is now on top; an older faf marker line below it has no matching pair, so the text there is left as you had it — delete it by hand if you no longer want it.`;return null}function gO($,Z,Q=E0,z=b0,X={}){try{let U=t3($);return p8(Z,q6(h(X.root??a3(U),U)),Q,z)}catch{return null}}var vO=new Set(["API","CI","CD","MCP","CLI","SDK","UI","UX","AI","ML","DB","ORM","OS","HTTP","HTTPS","REST","RPC","JSON","YAML","XML","SQL","CSS","HTML","AWS","GCP","CDN","DNS","JWT","ID","IP","URL","URI","TS","JS"]);function T5($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return vO.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function i($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function Q0($){let Z=x0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return T5(Q)}var A5=t.claude,hO="STATUS: SYNC ACTIVE";function uO($){let Z=Zz($,A5);if(!kO(Z))return null;return Z0(h($,A5))}function fO($,Z){T0(Zz($,A5),Z)}function y0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),U=String($.project?.goal??"").trim(),H=`<!-- faf: ${[Q,z,X,U].join(" | ")} -->`,J=[];if(Z.doc)J.push(`doc=${Z.doc}`);else J.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")J.push(`score=${Z.score}`);if(J.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)J.push(`siblings=${Z.siblings.join(",")}`);let G=`<!-- faf: ${J.join(" | ")} -->`;return`${H}
275
- ${G}`}function mO($){let Z=[],Q=$.project?.name??"Project",z=$.project?.main_language??"",X=$.project?.goal??"";if(Z.push(y0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),X)Z.push("## What This Is"),Z.push(""),Z.push(X),Z.push("");let U=$.stack??{},H=[];if(z)H.push(`**Language:** ${z}`);for(let[V,Y]of Object.entries(U))if(Y&&Y!=="slotignored"&&String(Y).trim())H.push(`**${Q0(`stack.${V}`)}:** ${Y}`);if(H.length>0){Z.push("## Stack"),Z.push("");for(let V of H)Z.push(`- ${V}`);Z.push("")}let J=$.human_context??{},G=[["who",J.who],["what",J.what],["why",J.why],["where",J.where],["when",J.when],["how",J.how]].filter(([,V])=>V&&String(V).trim()).map(([V,Y])=>`- **${Q0(`human_context.${V}`)}:** ${Y}`);if(G.length>0)Z.push("## Context"),Z.push(""),Z.push(...G),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${hO} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
- `)}function $z($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function pO($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=$z(Q[1].trim());if(!Z.project.name){let U=$.match(/\*\*Name:\*\*\s*(.+)/);if(U)Z.project.name=$z(U[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let U=$.match(/\*\*What Building:\*\*\s*(.+)/);if(U)Z.project.goal=U[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let U=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(U)Z.project.main_language=U[1].trim()}return Z}function j2($){let Z=String($??"").trim(),Q=Z.indexOf(" — ");if(Q<=0)return{cmd:Z,note:null};let z=Z.slice(0,Q).trim(),X=Z.slice(Q+3).trim();if(!z||!X)return{cmd:Z,note:null};return{cmd:z,note:X}}function X2($){return j2($).cmd}var H0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Qz=($)=>Array.isArray($)?$.join(", "):String($),cO=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),dO=new Set(["target_user","core_problem","mission_purpose"]);function zz($){let Z=[],Q=(T="")=>Z.push(T),z=$.ai_instructions,X=$.preferences,U=$.instant_context,H=$.security,J=$.commands,G=$.key_files??U?.key_files,V=H0($.project?.default_branch)?String($.project?.default_branch):"main",Y=J?Object.entries(J).filter(([,T])=>H0(T)):[],W=Y.filter(([T])=>/test/i.test(T)),B=Y.filter(([T])=>/lint|check/i.test(T)&&!/test/i.test(T)),K=Y.filter(([T])=>!/test|lint|check/i.test(T)),L=(T)=>{let j=T.toLowerCase();if(/install|deps/.test(j))return 0;if(/^build$|build/.test(j)&&!/rebuild/.test(j))return 1;if(/^dev$|develop/.test(j))return 2;if(/^start$|run/.test(j))return 3;return 4},q=[...K].sort((T,j)=>L(T[0])-L(j[0])||T[0].localeCompare(j[0])),D=[...W,...B],M=q.find(([T])=>/build/i.test(T)),O=W[0]?X2(W[0][1]):void 0,A=M?X2(M[1]):void 0;Q(y0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let F=[];if($.project?.main_language)F.push(String($.project.main_language));if(H0($.project?.type))F.push(`type: ${String($.project?.type)}`);if(H0($.project?.version))F.push(`v${String($.project?.version)}`);let N=$.project?.goal?String($.project.goal).trim():"";if(F.length)N+=(N?" — ":"")+F.join(" · ");if(N)Q(N),Q();if(Q("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand-written content outside the managed block is preserved."),Q(),q.length){Q("## Setup & build"),Q(),Q("```bash");for(let[T,j]of q){let{cmd:c,note:q0}=j2(j);Q(`${c} # ${q0??T}`)}Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,T]of D){let{cmd:j,note:c}=j2(T);Q(c?`${j} # ${c}`:j)}Q("```"),Q()}if(G&&G.length){Q("## Where things live"),Q();let T=G.map((j)=>{let c=String(j),q0=c.indexOf(" — ");return q0>0?{path:c.slice(0,q0),role:c.slice(q0+3)}:{path:c,role:""}});if(T.some((j)=>j.role)){Q("| Path | Role |"),Q("|------|------|");for(let j of T)Q(`| \`${j.path}\` | ${j.role} |`)}else for(let j of T)Q(`- \`${j.path}\``);Q()}let R=new Map,w=(T)=>{if(!T)return;for(let[j,c]of Object.entries(T)){if(cO.has(j)||!H0(c))continue;let q0=T5(j);if(!R.has(q0))R.set(q0,Qz(c))}};w(z?.working_style),w(X);let P=$.conventions??[];if(R.size||P.length){Q("## Conventions"),Q();for(let[T,j]of R)Q(`- **${T}:** ${j}`);for(let T of P)if(H0(T))Q(`- ${T}`);Q()}let E=(z?.warnings??[]).filter((T)=>H0(T)),n=["read the tree"];if(O)n.push(`run the tests (\`${O}\`)`);if(A)n.push("build the project");for(let[,T]of B.slice(0,1))n.push(`\`${X2(T)}\``);Q("## Guardrails"),Q();for(let T of E)Q(`- ${T}`);Q(`- **Always OK:** ${[...new Set(n)].join(" · ")}.`),Q("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),Q(`- **Never:** force-push · push straight to \`${V}\` (branch and open a PR) · commit secrets.`),Q();let a=[];for(let[,T]of B)a.push(`\`${X2(T)}\` exits 0`);for(let[,T]of W)a.push(`\`${X2(T)}\` passes`);if(a.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(a)].join(" · ")}.`),Q(),Q("## When stuck"),Q(),Q(`Ask a clarifying question, propose a short plan, or open a draft PR with notes — do not push large speculative changes to \`${V}\`.`),Q(),H&&(H0(H.secrets)||(H.never??[]).length)){if(Q("## Security & secrets"),Q(),H0(H.secrets)){let T=H0(H.example)?` (see \`${H.example}\`)`:"";Q(`- Secrets live in \`${H.secrets}\`${T}. Never read or commit them.`)}for(let T of H.never??[])if(H0(T))Q(`- Never read or commit \`${T}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&H0(X.commit_style))Q(`- Commit style: ${Qz(X.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${V}\` and open a PR — never commit to \`${V}\` directly.`),Q("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),Q(),$.stack){let T=[];for(let[j,c]of Object.entries($.stack)){if(dO.has(j))continue;if(i(c))T.push(`- **${Q0(`stack.${j}`)}:** ${c.trim()}`)}if(T.length){Q("## Stack"),Q();for(let j of T)Q(j);Q()}}let g=$.generated;if(H0(g))Q(`*Context authored: ${String(g)}*`);return Z.join(`
277
- `)}function iO($,Z){T0(lO($,t.agents),zz(Z))}import{join as nO}from"path";var rO=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),sO=new Set(["target_user","core_problem","mission_purpose"]);function Xz($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,U=z?Object.entries(z).filter(([,B])=>rO(B)):[],H=U.filter(([B])=>/test/i.test(B)),J=U.filter(([B])=>/lint|check/i.test(B)&&!/test/i.test(B)),G=U.filter(([B])=>!/test|lint|check/i.test(B)),V=(B)=>{let K=B.toLowerCase();if(/install|deps/.test(K))return 0;if(/^build$|build/.test(K)&&!/rebuild/.test(K))return 1;if(/^dev$|develop/.test(K))return 2;if(/^start$|run/.test(K))return 3;return 4},Y=[...G].sort((B,K)=>V(B[0])-V(K[0])||B[0].localeCompare(K[0])),W=[...H,...J];if(Z.push(y0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(Y.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[B,K]of Y){let{cmd:L,note:q}=j2(K);Z.push(`${L} # ${q??B}`)}Z.push("```")}if(W.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,B]of W){let{cmd:K,note:L}=j2(B);Z.push(L?`${K} # ${L}`:K)}Z.push("```")}if(X&&X.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let B of X)Z.push(`- \`${B}\``)}if($.stack){let B=[];for(let[K,L]of Object.entries($.stack)){if(sO.has(K))continue;if(i(L))B.push(`- ${Q0(`stack.${K}`)}: ${L.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let K of B)Z.push(K)}}return Z.push(""),Z.push("## Before changing things"),Z.push(""),Z.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Z.push("- Never: force-push · push straight to `main` · commit secrets."),Z.push(""),Z.join(`
278
- `)}function oO($,Z){T0(nO($,t.gemini),Xz(Z))}import{join as aO}from"path";function Uz($){let Z=[];if(Z.push(y0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Authored from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[Q,z]of Object.entries($.stack))if(i(z))Z.push(`# ${Q0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
279
- `)}function tO($,Z){T0(aO($,t.cursorrules),Uz(Z),"# faf:start","# faf:end")}import{join as eO}from"path";var Hz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],$_=new Set([...Hz.map(([$])=>$),"cicd"]);function Jz($){let Z=[],Q=$.project?.name??"Project";if(Z.push(y0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${Q}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),i($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(i($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[V,Y]of Object.entries(z)){if($_.has(V))continue;if(i(Y))X.push(`- **${Q0(`stack.${V}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let U=[];for(let[V,Y]of Hz){let W=z[V];if(i(W))U.push(`- ${Y} \`${W.trim()}\`.`)}if(i(z.cicd))U.push(`- CI runs on ${z.cicd.trim()}.`);if(U.length>0)Z.push("## Build & run","",...U,"");let H=$.human_context??{},G=[["who",H.who],["what",H.what],["why",H.why],["where",H.where],["when",H.when],["how",H.how]].filter(([,V])=>i(V)).map(([V,Y])=>`- **${Q0(`human_context.${V}`)}:** ${Y.trim()}`);if(G.length>0)Z.push("## Project context","",...G,"");return Z.join(`
280
- `)}function Z_($,Z){t2($,".github"),T0(eO($,".github",t.copilot),Jz(Z),E0,b0,{root:$})}import{existsSync as Q_,lstatSync as Bz,readFileSync as c8,realpathSync as C5,statSync as z_}from"fs";import{homedir as X_}from"os";import{basename as U_,dirname as j5,join as A0,resolve as w2}from"path";var Gz=200,Vz=200,Yz=12,H_="# Project Context (from project.faf)",J_="*This section is managed by tri-sync.";function G_($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function qz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=Gz)return Z;return`${Z.slice(0,Gz)}-${Math.abs(G_($)).toString(36)}`}function Kz($){try{let Z=Bz($);if(Z.isSymbolicLink()){let Q=z_($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function Wz($){try{return Bz($).isFile()}catch{return!1}}function V_($){let Z=$;for(;;){if(Kz(A0(Z,".git")))return Z;let Q=j5(Z);if(Q===Z)return null;Z=Q}}function Y_($){let Z;try{Z=c8(A0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=w2($,Z.slice(7).trim()),z=A0(Q,"commondir");if(!Wz(z))return $;let X=w2(Q,c8(z,"utf-8").trim());if(w2(j5(Q))!==A0(X,"worktrees"))return $;let U=A0(Q,"gitdir");if(!Wz(U))return $;let H=c8(U,"utf-8").trim();if(C5(w2(Q,H))!==A0(C5($),".git"))return $;if(U_(X)!==".git")return Kz(A0(X,".git"))?$:X;return j5(X)}catch{return $}}function Dz($){let Z=w2($);try{Z=C5.native(Z)}catch{}let Q=V_(Z);return(Q?Y_(Q):Z).normalize("NFC")}function i8($,Z={}){if(Z.memoryDir)return w2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||A0(X_(),".claude");return A0(w2(Q),"projects",qz(Dz($)),"memory").normalize("NFC")}function W_($,Z={}){return A0(i8($,Z),t.memory)}var B_=new Set(["target_user","core_problem","mission_purpose"]),q_=["who","what","why","where","when","how"];function Lz($){let Z=$.project??{},Q=[["Goal",Z.goal],["Language",Z.main_language],["Type",Z.type]],z=$.human_context??{},X=Array.isArray($.key_files)?$.key_files:[];return["## Project context — from project.faf","",`- **Name:** ${i(Z.name)?Z.name:"Project"}`,...Q.filter(([,H])=>i(H)).map(([H,J])=>`- **${H}:** ${J}`),...l8("Stack",Object.entries($.stack??{}).filter(([H,J])=>!B_.has(H)&&i(J)).map(([H,J])=>`- **${Q0(`stack.${H}`)}:** ${J}`)),...l8("Context",q_.filter((H)=>i(z[H])).map((H)=>`- **${Q0(`human_context.${H}`)}:** ${z[H]}`)),...l8("Commands",Object.entries($.commands??{}).filter(([,H])=>i(H)).slice(0,Yz).map(([H,J])=>`- ${H}: \`${X2(J)}\``)),...l8("Key files",X.filter(i).slice(0,Yz).map((H)=>`- ${H}`)),"","*faf keeps this block in step with project.faf. Everything outside it is Claude's own and is kept as written.*"].join(`
281
- `)}function l8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function Iz($){return N5($,(Z)=>Z.trimEnd()===H_,(Z)=>Z.startsWith(J_))}function d8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function K_($,Z,Q){if($===null)return{text:m8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=C2($),X=z??Iz($);if(X){let H=$.slice(0,X.start),J=$.slice(X.end);return{text:W6(H,Z,J,void 0,void 0,Q),action:z?"updated":"migrated",head:H,tail:J}}let U=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:m8($,Z,void 0,void 0,Q),action:"added",head:U,tail:$.slice(U.length)}}function w5($){return $>Vz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${Vz}; lines after that are kept in the file but not loaded.`]:[]}function D_($,Z={}){let Q=i8($,Z),z=A0(Q,t.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!Q_(Q))return X;let U=q6(h(Q,t.memory));if(U===null)return X;let H=C2(U),J=H?`${U.slice(0,H.start)}${U.slice(H.end)}`:U,G=d8(U);return{path:z,exists:!0,lines:G,hasBlock:H!==null,blockLines:H?d8(U.slice(H.start,H.end)):0,hasLegacySection:!H&&Iz(U)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((V)=>V.replace(/^\uFEFF/,"").trim()!=="").length,warnings:w5(G)}}function L_($,Z,Q={}){let z=i8($,Q);t2(z);let X=h(z,t.memory),U=q6(X),H=K_(U,R5(Lz(Z)),X);if(H.text===U){let B=d8(U);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:w5(B)}}let J=e(X,H.text,{root:z,expect:U}),G=c8(J,"utf-8"),V=G===H.text&&G.startsWith(H.head)&&G.endsWith(H.tail),Y=d8(G),W=H.action==="added"?p8(t.memory,U):null;return{path:J,action:H.action,written:!0,preserved:V,lines:Y,warnings:[...W?[W]:[],...w5(Y)]}}function I_($,Z){let Q=[],z=(G)=>I($,G),X=(G)=>S($,G)??"";if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let U=[],H=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in H)U.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in H)U.push("Prettier");let J=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(J))U.push("black");if(/\[tool\.ruff\]/.test(J))U.push("ruff");if(/\[tool\.mypy\]/.test(J))U.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))U.push("rustfmt");if(U.length)Q.push(`Style enforced by ${U.join(" · ")} — obey the configs`);return Q}function M_($,Z){let Q={...Z},z=null,X=S($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let U=u8($,z);if(Object.keys(U).length)Q.commands={...U,...Z.commands??{}};let H=Z.key_files??Z.instant_context?.key_files;if(!H||H.length===0){let J=h8($);if(J.length)Q.key_files=J}if(!Z.security){let G=[".env",".env.local",".env.development"].find((V)=>I($,V));if(G){let V=[".env.example",".env.sample",".env.template"].find((Y)=>I($,Y));Q.security={secrets:G,...V?{example:V}:{}}}}if(!Z.conventions){let J=I_($,z);if(J.length)Q.conventions=J}return Q}export{pK as writeServerCard,FK as writeProjectHtml,oO as writeGeminiMd,vq as writeFaf,tO as writeCursorrules,Z_ as writeCopilotInstructions,L_ as writeClaudeMemory,fO as writeClaudeMd,iO as writeAgentsMd,kz as validateFaf,M2 as utcNow,QD as upsertCatalog,Eq as updateFafFile,jM as updateExistingFaf,b8 as turboCatSlots,K3 as turboCatScan,Nz as slotsByCategory,u9 as serializeFaf,rQ as seedSixWsFromGoal,vz as scoreText,$1 as scoreFafYaml,e as safeWriteFile,rB as safeUnlink,z9 as safeReplaceOwned,SD as runLoop,h as resolveInside,W_ as resolveClaudeMemoryPath,i8 as resolveClaudeMemoryDir,v3 as repoNameFromUrl,k4 as renderProjectHtml,Xz as renderGeminiMd,Uz as renderCursorrules,Jz as renderCopilotInstructions,Lz as renderClaudeMemory,mO as renderClaudeMd,zz as renderAgentsMd,L3 as relentlessContextDetailed,y8 as relentlessContext,F8 as registryTitle,c4 as registryName,l4 as registryMeta,Z0 as readUtf8,rK as readFafa,p9 as readFafRaw,Sq as readFaf,uO as readClaudeMd,e4 as questionForSlot,gD as publicQuestions,LQ as projectServerJson,DQ as projectServerCard,_Q as projectPack,UD as projectCards,OQ as projectArd,MQ as projectAiCatalog,$6 as projectA2ACard,lK as patchServerJson,pO as parseClaudeMd,fM as normalizeGitUrl,T8 as normalizeAnswer,qQ as mcpName,t2 as makeDirInside,aQ as loopVerdict,gO as legacyStampNoteAt,p8 as legacyStampNote,e8 as kernel,o as isPlaceholder,fq as isNonProjectRoot,sQ as isHumanSlot,Az as isExplicitNone,R8 as isEmptyValue,RD as interviewForMissing,T0 as injectFafBlock,vD as gradeAnswers,D$ as getTier,jz as getNextTier,cK as generateServerCard,NK as generateProjectHtml,tK as generateA2ACard,fQ as fromClaudeDir,sK as findFafaFile,l9 as findFafFile,C2 as findFafBlock,p0 as fillEmpties,WQ as fafaYaml,Q2 as fafaDomain,y0 as fafMetaTag,$$ as fafContextBlock,k5 as enrichScore,M_ as enrichFromRepo,xD as deriveQuestionSet,iq as computeDrift,Dz as claudeProjectRoot,qz as claudeProjectId,D_ as claudeMemoryStatus,oQ as classifyGaps,z$ as canonicalPriority,jD as buildTableOf8,Z6 as buildServerCard,kD as buildReceipt,gK as buildPack,i4 as buildA2ACard,mM as authorFafFromRepo,I5 as assembleFreshFaf,YQ as answersToFafa,Z3 as answersMatch,g0 as TIERS,b as SafePathError,iQ as STACK_INTERVIEW,x0 as SLOT_BY_PATH,m as SLOTS,L6 as SLOTIGNORED,t4 as SIX_WS_INTERVIEW,JQ as SERVER_JSON_SCHEMA,_8 as SERVER_CARD_SCHEMA,RQ as REGISTRY_PUBLISHER_KEY,z2 as PRIORITY_RANK,n4 as PRIORITY_ORDER,D6 as PLACEHOLDERS,N8 as KNOWLEDGE_TYPES,dQ as INTERVIEW_VERSION,ND as INTERVIEW_PATHS,nQ as INTERVIEW_BY_PATH,U$ as INTERVIEW,Y0 as FafmSoul,d3 as FafDNAManager,E0 as FAF_START,q$ as FAF_HEX,b0 as FAF_END,y5 as EXPLICIT_NONE,Tz as ENTERPRISE_SLOTS,Z5 as BENCH_VERSION,Rz as BASE_SLOTS,$3 as ALIAS_GROUPS,d4 as A2A_CONTEXT_URI};
274
+ ${$.slice(U.length)}`,Q,z,X)}function q6($){try{return Z0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function T0($,Z,Q=b0,z=y0,X={}){let H=S1(Z,Q,z),U=$z($),J=X.root??e3(U),G=h(J,U),V=q6(G);e(G,d8(V,H,Q,z,U),{root:J,expect:V})}var g_="<!-- faf:";function v_($){if($==="code fence")return"a code fence";if($==="indented code")return"an indented code block";if($==="comment")return"an HTML comment";return $==="html"?"an HTML block":`a ${$} block`}function k_($,Z){let Q=[new N0(!0),new N0(!1)],z=!1;for(let{content:X}of j1($)){if(z){if(X===Z)return"too deep";continue}let[H,U]=Q.map((G)=>G.line(X));z=Q[0].tooDeep;let J=H??U;if(X===Z&&(z||J!==null))return z?"too deep":J}return null}function h_($,Z,Q){let z=[new N0(!0),new N0(!1)];for(let{content:X}of j1($)){let H=z.map((U)=>U.line(X));if(z[0].tooDeep)return!1;if((X===Z||X===Q)&&H.some((U)=>U===null))return!0}return!1}function i8($,Z,Q=b0,z=y0){if(Z===null||w2(Z,Q,z))return null;let X=Zz(B6(Z)[0]??"");if(X.startsWith(g_)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let H=k_(Z,Q);if(H==="too deep")return`${$}: faf's block is now on top; the file nests more than ${s3} lists or quotes before an older faf block, so faf did not read that far — the older block is left as you had it; delete it by hand if you no longer want it.`;if(H!==null)return`${$}: faf's block is now on top; an older faf block below sits inside ${v_(H)} and is left as you had it — delete it by hand if you no longer want it.`;if(h_(Z,Q,z))return`${$}: faf's block is now on top; an older faf marker line below it has no matching pair, so the text there is left as you had it — delete it by hand if you no longer want it.`;return null}function u_($,Z,Q=b0,z=y0,X={}){try{let H=$z($);return i8(Z,q6(h(X.root??e3(H),H)),Q,z)}catch{return null}}var f_=new Set(["API","CI","CD","MCP","CLI","SDK","UI","UX","AI","ML","DB","ORM","OS","HTTP","HTTPS","REST","RPC","JSON","YAML","XML","SQL","CSS","HTML","AWS","GCP","CDN","DNS","JWT","ID","IP","URL","URI","TS","JS"]);function E1($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return f_.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function i($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function Q0($){let Z=g0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return E1(Q)}var b1=t.claude,p_="STATUS: SYNC ACTIVE";function l_($){let Z=zz($,b1);if(!m_(Z))return null;return Z0(h($,b1))}function c_($,Z){T0(zz($,b1),Z)}function x0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),H=String($.project?.goal??"").trim(),U=`<!-- faf: ${[Q,z,X,H].join(" | ")} -->`,J=[];if(Z.doc)J.push(`doc=${Z.doc}`);else J.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")J.push(`score=${Z.score}`);if(J.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)J.push(`siblings=${Z.siblings.join(",")}`);let G=`<!-- faf: ${J.join(" | ")} -->`;return`${U}
275
+ ${G}`}function d_($){let Z=[],Q=$.project?.name??"Project",z=$.project?.main_language??"",X=$.project?.goal??"";if(Z.push(x0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),X)Z.push("## What This Is"),Z.push(""),Z.push(X),Z.push("");let H=$.stack??{},U=[];if(z)U.push(`**Language:** ${z}`);for(let[V,Y]of Object.entries(H))if(Y&&Y!=="slotignored"&&String(Y).trim())U.push(`**${Q0(`stack.${V}`)}:** ${Y}`);if(U.length>0){Z.push("## Stack"),Z.push("");for(let V of U)Z.push(`- ${V}`);Z.push("")}let J=$.human_context??{},G=[["who",J.who],["what",J.what],["why",J.why],["where",J.where],["when",J.when],["how",J.how]].filter(([,V])=>V&&String(V).trim()).map(([V,Y])=>`- **${Q0(`human_context.${V}`)}:** ${Y}`);if(G.length>0)Z.push("## Context"),Z.push(""),Z.push(...G),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${p_} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
+ `)}function Qz($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function i_($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=Qz(Q[1].trim());if(!Z.project.name){let H=$.match(/\*\*Name:\*\*\s*(.+)/);if(H)Z.project.name=Qz(H[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let H=$.match(/\*\*What Building:\*\*\s*(.+)/);if(H)Z.project.goal=H[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let H=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(H)Z.project.main_language=H[1].trim()}return Z}function S2($){let Z=String($??"").trim(),Q=Z.indexOf(" — ");if(Q<=0)return{cmd:Z,note:null};let z=Z.slice(0,Q).trim(),X=Z.slice(Q+3).trim();if(!z||!X)return{cmd:Z,note:null};return{cmd:z,note:X}}function X2($){return S2($).cmd}var U0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Xz=($)=>Array.isArray($)?$.join(", "):String($),r_=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),s_=new Set(["target_user","core_problem","mission_purpose"]);function Hz($){let Z=[],Q=(A="")=>Z.push(A),z=$.ai_instructions,X=$.preferences,H=$.instant_context,U=$.security,J=$.commands,G=$.key_files??H?.key_files,V=U0($.project?.default_branch)?String($.project?.default_branch):"main",Y=J?Object.entries(J).filter(([,A])=>U0(A)):[],W=Y.filter(([A])=>/test/i.test(A)),B=Y.filter(([A])=>/lint|check/i.test(A)&&!/test/i.test(A)),K=Y.filter(([A])=>!/test|lint|check/i.test(A)),L=(A)=>{let j=A.toLowerCase();if(/install|deps/.test(j))return 0;if(/^build$|build/.test(j)&&!/rebuild/.test(j))return 1;if(/^dev$|develop/.test(j))return 2;if(/^start$|run/.test(j))return 3;return 4},q=[...K].sort((A,j)=>L(A[0])-L(j[0])||A[0].localeCompare(j[0])),D=[...W,...B],O=q.find(([A])=>/build/i.test(A)),_=W[0]?X2(W[0][1]):void 0,C=O?X2(O[1]):void 0;Q(x0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let F=[];if($.project?.main_language)F.push(String($.project.main_language));if(U0($.project?.type))F.push(`type: ${String($.project?.type)}`);if(U0($.project?.version))F.push(`v${String($.project?.version)}`);let R=$.project?.goal?String($.project.goal).trim():"";if(F.length)R+=(R?" — ":"")+F.join(" · ");if(R)Q(R),Q();if(Q("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand-written content outside the managed block is preserved."),Q(),q.length){Q("## Setup & build"),Q(),Q("```bash");for(let[A,j]of q){let{cmd:c,note:q0}=S2(j);Q(`${c} # ${q0??A}`)}Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,A]of D){let{cmd:j,note:c}=S2(A);Q(c?`${j} # ${c}`:j)}Q("```"),Q()}if(G&&G.length){Q("## Where things live"),Q();let A=G.map((j)=>{let c=String(j),q0=c.indexOf(" — ");return q0>0?{path:c.slice(0,q0),role:c.slice(q0+3)}:{path:c,role:""}});if(A.some((j)=>j.role)){Q("| Path | Role |"),Q("|------|------|");for(let j of A)Q(`| \`${j.path}\` | ${j.role} |`)}else for(let j of A)Q(`- \`${j.path}\``);Q()}let N=new Map,w=(A)=>{if(!A)return;for(let[j,c]of Object.entries(A)){if(r_.has(j)||!U0(c))continue;let q0=E1(j);if(!N.has(q0))N.set(q0,Xz(c))}};w(z?.working_style),w(X);let P=$.conventions??[];if(N.size||P.length){Q("## Conventions"),Q();for(let[A,j]of N)Q(`- **${A}:** ${j}`);for(let A of P)if(U0(A))Q(`- ${A}`);Q()}let E=(z?.warnings??[]).filter((A)=>U0(A)),n=["read the tree"];if(_)n.push(`run the tests (\`${_}\`)`);if(C)n.push("build the project");for(let[,A]of B.slice(0,1))n.push(`\`${X2(A)}\``);Q("## Guardrails"),Q();for(let A of E)Q(`- ${A}`);Q(`- **Always OK:** ${[...new Set(n)].join(" · ")}.`),Q("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),Q(`- **Never:** force-push · push straight to \`${V}\` (branch and open a PR) · commit secrets.`),Q();let a=[];for(let[,A]of B)a.push(`\`${X2(A)}\` exits 0`);for(let[,A]of W)a.push(`\`${X2(A)}\` passes`);if(a.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(a)].join(" · ")}.`),Q(),Q("## When stuck"),Q(),Q(`Ask a clarifying question, propose a short plan, or open a draft PR with notes — do not push large speculative changes to \`${V}\`.`),Q(),U&&(U0(U.secrets)||(U.never??[]).length)){if(Q("## Security & secrets"),Q(),U0(U.secrets)){let A=U0(U.example)?` (see \`${U.example}\`)`:"";Q(`- Secrets live in \`${U.secrets}\`${A}. Never read or commit them.`)}for(let A of U.never??[])if(U0(A))Q(`- Never read or commit \`${A}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&U0(X.commit_style))Q(`- Commit style: ${Xz(X.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${V}\` and open a PR — never commit to \`${V}\` directly.`),Q("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),Q(),$.stack){let A=[];for(let[j,c]of Object.entries($.stack)){if(s_.has(j))continue;if(i(c))A.push(`- **${Q0(`stack.${j}`)}:** ${c.trim()}`)}if(A.length){Q("## Stack"),Q();for(let j of A)Q(j);Q()}}let g=$.generated;if(U0(g))Q(`*Context authored: ${String(g)}*`);return Z.join(`
277
+ `)}function o_($,Z){T0(n_($,t.agents),Hz(Z))}import{join as a_}from"path";var t_=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),e_=new Set(["target_user","core_problem","mission_purpose"]);function Uz($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,H=z?Object.entries(z).filter(([,B])=>t_(B)):[],U=H.filter(([B])=>/test/i.test(B)),J=H.filter(([B])=>/lint|check/i.test(B)&&!/test/i.test(B)),G=H.filter(([B])=>!/test|lint|check/i.test(B)),V=(B)=>{let K=B.toLowerCase();if(/install|deps/.test(K))return 0;if(/^build$|build/.test(K)&&!/rebuild/.test(K))return 1;if(/^dev$|develop/.test(K))return 2;if(/^start$|run/.test(K))return 3;return 4},Y=[...G].sort((B,K)=>V(B[0])-V(K[0])||B[0].localeCompare(K[0])),W=[...U,...J];if(Z.push(x0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(Y.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[B,K]of Y){let{cmd:L,note:q}=S2(K);Z.push(`${L} # ${q??B}`)}Z.push("```")}if(W.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,B]of W){let{cmd:K,note:L}=S2(B);Z.push(L?`${K} # ${L}`:K)}Z.push("```")}if(X&&X.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let B of X)Z.push(`- \`${B}\``)}if($.stack){let B=[];for(let[K,L]of Object.entries($.stack)){if(e_.has(K))continue;if(i(L))B.push(`- ${Q0(`stack.${K}`)}: ${L.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let K of B)Z.push(K)}}return Z.push(""),Z.push("## Before changing things"),Z.push(""),Z.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Z.push("- Never: force-push · push straight to `main` · commit secrets."),Z.push(""),Z.join(`
278
+ `)}function $M($,Z){T0(a_($,t.gemini),Uz(Z))}import{join as ZM}from"path";function Jz($){let Z=[];if(Z.push(x0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Authored from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[Q,z]of Object.entries($.stack))if(i(z))Z.push(`# ${Q0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
279
+ `)}function QM($,Z){T0(ZM($,t.cursorrules),Jz(Z),"# faf:start","# faf:end")}import{join as zM}from"path";var Gz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],XM=new Set([...Gz.map(([$])=>$),"cicd"]);function Vz($){let Z=[],Q=$.project?.name??"Project";if(Z.push(x0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${Q}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),i($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(i($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[V,Y]of Object.entries(z)){if(XM.has(V))continue;if(i(Y))X.push(`- **${Q0(`stack.${V}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let H=[];for(let[V,Y]of Gz){let W=z[V];if(i(W))H.push(`- ${Y} \`${W.trim()}\`.`)}if(i(z.cicd))H.push(`- CI runs on ${z.cicd.trim()}.`);if(H.length>0)Z.push("## Build & run","",...H,"");let U=$.human_context??{},G=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,V])=>i(V)).map(([V,Y])=>`- **${Q0(`human_context.${V}`)}:** ${Y.trim()}`);if(G.length>0)Z.push("## Project context","",...G,"");return Z.join(`
280
+ `)}function HM($,Z){$$($,".github"),T0(zM($,".github",t.copilot),Vz(Z),b0,y0,{root:$})}import{existsSync as UM,lstatSync as Kz,readFileSync as r8,realpathSync as y1,statSync as JM}from"fs";import{homedir as GM}from"os";import{basename as VM,dirname as x1,join as A0,resolve as E2}from"path";var Yz=200,Wz=200,Bz=12,YM="# Project Context (from project.faf)",WM="*This section is managed by tri-sync.";function BM($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function Dz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=Yz)return Z;return`${Z.slice(0,Yz)}-${Math.abs(BM($)).toString(36)}`}function Lz($){try{let Z=Kz($);if(Z.isSymbolicLink()){let Q=JM($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function qz($){try{return Kz($).isFile()}catch{return!1}}function qM($){let Z=$;for(;;){if(Lz(A0(Z,".git")))return Z;let Q=x1(Z);if(Q===Z)return null;Z=Q}}function KM($){let Z;try{Z=r8(A0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=E2($,Z.slice(7).trim()),z=A0(Q,"commondir");if(!qz(z))return $;let X=E2(Q,r8(z,"utf-8").trim());if(E2(x1(Q))!==A0(X,"worktrees"))return $;let H=A0(Q,"gitdir");if(!qz(H))return $;let U=r8(H,"utf-8").trim();if(y1(E2(Q,U))!==A0(y1($),".git"))return $;if(VM(X)!==".git")return Lz(A0(X,".git"))?$:X;return x1(X)}catch{return $}}function Iz($){let Z=E2($);try{Z=y1.native(Z)}catch{}let Q=qM(Z);return(Q?KM(Q):Z).normalize("NFC")}function o8($,Z={}){if(Z.memoryDir)return E2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||A0(GM(),".claude");return A0(E2(Q),"projects",Dz(Iz($)),"memory").normalize("NFC")}function DM($,Z={}){return A0(o8($,Z),t.memory)}var LM=new Set(["target_user","core_problem","mission_purpose"]),IM=["who","what","why","where","when","how"];function Oz($){let Z=$.project??{},Q=[["Goal",Z.goal],["Language",Z.main_language],["Type",Z.type]],z=$.human_context??{},X=Array.isArray($.key_files)?$.key_files:[];return["## Project context — from project.faf","",`- **Name:** ${i(Z.name)?Z.name:"Project"}`,...Q.filter(([,U])=>i(U)).map(([U,J])=>`- **${U}:** ${J}`),...n8("Stack",Object.entries($.stack??{}).filter(([U,J])=>!LM.has(U)&&i(J)).map(([U,J])=>`- **${Q0(`stack.${U}`)}:** ${J}`)),...n8("Context",IM.filter((U)=>i(z[U])).map((U)=>`- **${Q0(`human_context.${U}`)}:** ${z[U]}`)),...n8("Commands",Object.entries($.commands??{}).filter(([,U])=>i(U)).slice(0,Bz).map(([U,J])=>`- ${U}: \`${X2(J)}\``)),...n8("Key files",X.filter(i).slice(0,Bz).map((U)=>`- ${U}`)),"","*faf keeps this block in step with project.faf. Everything outside it is Claude's own and is kept as written.*"].join(`
281
+ `)}function n8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function _z($){return w1($,(Z)=>Z.trimEnd()===YM,(Z)=>Z.startsWith(WM))}function s8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function OM($,Z,Q){if($===null)return{text:d8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=w2($),X=z??_z($);if(X){let U=$.slice(0,X.start),J=$.slice(X.end);return{text:W6(U,Z,J,void 0,void 0,Q),action:z?"updated":"migrated",head:U,tail:J}}let H=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:d8($,Z,void 0,void 0,Q),action:"added",head:H,tail:$.slice(H.length)}}function g1($){return $>Wz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${Wz}; lines after that are kept in the file but not loaded.`]:[]}function _M($,Z={}){let Q=o8($,Z),z=A0(Q,t.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!UM(Q))return X;let H=q6(h(Q,t.memory));if(H===null)return X;let U=w2(H),J=U?`${H.slice(0,U.start)}${H.slice(U.end)}`:H,G=s8(H);return{path:z,exists:!0,lines:G,hasBlock:U!==null,blockLines:U?s8(H.slice(U.start,U.end)):0,hasLegacySection:!U&&_z(H)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((V)=>V.replace(/^\uFEFF/,"").trim()!=="").length,warnings:g1(G)}}function MM($,Z,Q={}){let z=o8($,Q);$$(z);let X=h(z,t.memory),H=q6(X),U=OM(H,S1(Oz(Z)),X);if(U.text===H){let B=s8(H);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:g1(B)}}let J=e(X,U.text,{root:z,expect:H}),G=r8(J,"utf-8"),V=G===U.text&&G.startsWith(U.head)&&G.endsWith(U.tail),Y=s8(G),W=U.action==="added"?i8(t.memory,H):null;return{path:J,action:U.action,written:!0,preserved:V,lines:Y,warnings:[...W?[W]:[],...g1(Y)]}}function PM($,Z){let Q=[],z=(G)=>I($,G),X=(G)=>S($,G)??"";if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let H=[],U=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in U)H.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in U)H.push("Prettier");let J=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(J))H.push("black");if(/\[tool\.ruff\]/.test(J))H.push("ruff");if(/\[tool\.mypy\]/.test(J))H.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))H.push("rustfmt");if(H.length)Q.push(`Style enforced by ${H.join(" · ")} — obey the configs`);return Q}function FM($,Z){let Q={...Z},z=null,X=S($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let H=l8($,z);if(Object.keys(H).length)Q.commands={...H,...Z.commands??{}};let U=Z.key_files??Z.instant_context?.key_files;if(!U||U.length===0){let J=p8($);if(J.length)Q.key_files=J}if(!Z.security){let G=[".env",".env.local",".env.development"].find((V)=>I($,V));if(G){let V=[".env.example",".env.sample",".env.template"].find((Y)=>I($,Y));Q.security={secrets:G,...V?{example:V}:{}}}}if(!Z.conventions){let J=PM($,z);if(J.length)Q.conventions=J}return Q}export{oK as writeServerCard,NK as writeProjectHtml,$M as writeGeminiMd,hq as writeFaf,QM as writeCursorrules,HM as writeCopilotInstructions,MM as writeClaudeMemory,c_ as writeClaudeMd,o_ as writeAgentsMd,uz as validateFaf,M2 as utcNow,JD as upsertCatalog,yq as updateFafFile,bO as updateExistingFaf,v8 as turboCatSlots,L3 as turboCatScan,Tz as slotsByCategory,d9 as serializeFaf,oQ as seedSixWsFromGoal,hz as scoreText,X5 as scoreFafYaml,e as safeWriteFile,oB as safeUnlink,V9 as safeReplaceOwned,xD as runLoop,h as resolveInside,DM as resolveClaudeMemoryPath,o8 as resolveClaudeMemoryDir,h3 as repoNameFromUrl,mZ as renderProjectHtml,Uz as renderGeminiMd,Jz as renderCursorrules,Vz as renderCopilotInstructions,Oz as renderClaudeMemory,d_ as renderClaudeMd,Hz as renderAgentsMd,O3 as relentlessContextDetailed,k8 as relentlessContext,A8 as registryTitle,aZ as registryName,I2 as registryMeta,Z0 as readUtf8,QD as readFafa,r9 as readFafRaw,bq as readFaf,l_ as readClaudeMd,H1 as questionForSlot,uD as publicQuestions,FQ as projectServerJson,R8 as projectServerCard,TQ as projectPack,VD as projectCards,NQ as projectArd,RQ as projectAiCatalog,F8 as projectA2ACard,aK as patchServerJson,i_ as parseClaudeMd,cO as normalizeGitUrl,w8 as normalizeAnswer,nZ as mcpName,$$ as makeDirInside,eQ as loopVerdict,u_ as legacyStampNoteAt,i8 as legacyStampNote,z5 as kernel,o as isPlaceholder,pq as isNonProjectRoot,aQ as isHumanSlot,jz as isExplicitNone,j8 as isEmptyValue,jD as interviewForMissing,T0 as injectFafBlock,fD as gradeAnswers,O$ as getTier,Sz as getNextTier,tK as generateServerCard,TK as generateProjectHtml,XD as generateA2ACard,pQ as fromClaudeDir,zD as findFafaFile,s9 as findFafFile,w2 as findFafBlock,l0 as fillEmpties,IQ as fafaYaml,z$ as fafaDomain,x0 as fafMetaTag,S0 as fafContextBlock,l1 as enrichScore,FM as enrichFromRepo,hD as deriveQuestionSet,rq as computeDrift,Iz as claudeProjectRoot,Dz as claudeProjectId,_M as claudeMemoryStatus,tQ as classifyGaps,U$ as canonicalPriority,bD as buildTableOf8,Z6 as buildServerCard,mD as buildReceipt,lK as buildPack,tZ as buildA2ACard,dO as authorFafFromRepo,R1 as assembleFreshFaf,LQ as answersToFafa,z3 as answersMatch,v0 as TIERS,b as SafePathError,rQ as STACK_INTERVIEW,g0 as SLOT_BY_PATH,m as SLOTS,L6 as SLOTIGNORED,X1 as SIX_WS_INTERVIEW,BQ as SERVER_JSON_SCHEMA,P8 as SERVER_CARD_SCHEMA,pZ as REGISTRY_PUBLISHER_KEY,z2 as PRIORITY_RANK,eZ as PRIORITY_ORDER,D6 as PLACEHOLDERS,C8 as KNOWLEDGE_TYPES,nQ as INTERVIEW_VERSION,CD as INTERVIEW_PATHS,sQ as INTERVIEW_BY_PATH,G$ as INTERVIEW,Y0 as FafmSoul,n3 as FafDNAManager,b0 as FAF_START,L$ as FAF_HEX,y0 as FAF_END,u1 as EXPLICIT_NONE,Cz as ENTERPRISE_SLOTS,J1 as BENCH_VERSION,Az as BASE_SLOTS,Q3 as ALIAS_GROUPS,Q$ as A2A_CONTEXT_URI};
282
282
 
283
- //# debugId=9C47E8BFFBD596CE64756E2164756E21
283
+ //# debugId=043A6E313BD0AEBA64756E2164756E21
284
284
  //# sourceMappingURL=index.js.map