faf-cli 8.3.2 → 8.5.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,74 +1,74 @@
1
- import{createRequire as Az}from"node:module";var Fz=Object.defineProperty;var M=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Rz=($)=>$;function Nz($,Z){this[$]=Rz.bind(null,Z)}var Tz=($,Z)=>{for(var Q in Z)Fz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:Nz.bind(Z,Q)})};var K$=Az(import.meta.url);var x=M((sz)=>{var U5=Symbol.for("yaml.alias"),d1=Symbol.for("yaml.document"),O6=Symbol.for("yaml.map"),i1=Symbol.for("yaml.pair"),J5=Symbol.for("yaml.scalar"),_6=Symbol.for("yaml.seq"),k0=Symbol.for("yaml.node.type"),pz=($)=>!!$&&typeof $==="object"&&$[k0]===U5,lz=($)=>!!$&&typeof $==="object"&&$[k0]===d1,cz=($)=>!!$&&typeof $==="object"&&$[k0]===O6,dz=($)=>!!$&&typeof $==="object"&&$[k0]===i1,n1=($)=>!!$&&typeof $==="object"&&$[k0]===J5,iz=($)=>!!$&&typeof $==="object"&&$[k0]===_6;function r1($){if($&&typeof $==="object")switch($[k0]){case O6:case _6:return!0}return!1}function nz($){if($&&typeof $==="object")switch($[k0]){case U5:case O6:case J5:case _6:return!0}return!1}var rz=($)=>(n1($)||r1($))&&!!$.anchor;sz.ALIAS=U5;sz.DOC=d1;sz.MAP=O6;sz.NODE_TYPE=k0;sz.PAIR=i1;sz.SCALAR=J5;sz.SEQ=_6;sz.hasAnchor=rz;sz.isAlias=pz;sz.isCollection=r1;sz.isDocument=lz;sz.isMap=cz;sz.isNode=nz;sz.isPair=dz;sz.isScalar=n1;sz.isSeq=iz});var _$=M((BX)=>{var r=x(),z0=Symbol("break visit"),s1=Symbol("skip children"),C0=Symbol("remove node");function M6($,Z){let Q=o1(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=s1;M6.REMOVE=C0;function k2($,Z,Q,z){let X=a1($,Z,Q,z);if(r.isNode(X)||r.isPair(X))return t1($,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=o1(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=s1;P6.REMOVE=C0;async function h2($,Z,Q,z){let X=await a1($,Z,Q,z);if(r.isNode(X)||r.isPair(X))return t1($,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 o1($){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 a1($,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 t1($,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`)}}BX.visit=M6;BX.visitAsync=P6});var G5=M((OX)=>{var e1=x(),DX=_$(),LX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},IX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>LX[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+IX($.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&&e1.isNode($.contents)){let X={};DX.visit($.contents,(H,U)=>{if(e1.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:"};OX.Directives=J0});var F6=M((RX)=>{var $4=x(),MX=_$();function PX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function Z4($){let Z=new Set;return MX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function Q4($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function FX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(H)=>{Q.push(H),X??(X=Z4($));let U=Q4(Z,X);return X.add(U),U},setAnchors:()=>{for(let H of Q){let U=z.get(H);if(typeof U==="object"&&U.anchor&&($4.isScalar(U.node)||$4.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}}RX.anchorIsValid=PX;RX.anchorNames=Z4;RX.createNodeAnchors=FX;RX.findNewAnchor=Q4});var V5=M((jX)=>{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)}jX.applyReviver=M$});var d0=M((EX)=>{var SX=x();function z4($,Z,Q){if(Array.isArray($))return $.map((z,X)=>z4(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!SX.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 $}EX.toJS=z4});var R6=M((gX)=>{var yX=V5(),X4=x(),xX=d0();class H4{constructor($){Object.defineProperty(this,X4.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(!X4.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=xX.toJS(this,"",H);if(typeof z==="function")for(let{count:J,res:G}of H.anchors.values())z(G,J);return typeof X==="function"?yX.applyReviver(X,{"":U},"",U):U}}gX.NodeBase=H4});var P$=M((mX)=>{var kX=F6(),hX=_$(),u2=x(),uX=R6(),fX=d0();class U4 extends uX.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=[],hX.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)fX.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(kX.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}mX.Alias=U4});var d=M((nX)=>{var lX=x(),cX=R6(),dX=d0(),iX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class H2 extends cX.NodeBase{constructor($){super(lX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:dX.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";nX.Scalar=H2;nX.isScalarValue=iX});var F$=M(($H)=>{var oX=P$(),U2=x(),J4=d(),aX="tag:yaml.org,2002:";function tX($,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 eX($,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 oX.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(Z?.startsWith("!!"))Z=aX+Z.slice(2);let V=tX($,Z,U.tags);if(!V){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new J4.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 J4.Scalar($);if(Z)Y.tag=Z;else if(!V.default)Y.tag=V.tag;if(G)G.node=Y;return Y}$H.createNode=eX});var T6=M((XH)=>{var QH=F$(),j0=x(),zH=R6();function Y5($,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 QH.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var G4=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class V4 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(G4($))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,Y5(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,Y5(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}XH.Collection=V4;XH.collectionFromPath=Y5;XH.isEmptyPath=G4});var R$=M((YH)=>{var GH=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function W5($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var VH=($,Z,Q)=>$.endsWith(`
3
- `)?W5(Q,Z):Q.includes(`
1
+ import{createRequire as Sz}from"node:module";var Az=Object.defineProperty;var _=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Cz=($)=>$;function jz($,Z){this[$]=Cz.bind(null,Z)}var wz=($,Z)=>{for(var Q in Z)Az($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:jz.bind(Z,Q)})};var K$=Sz(import.meta.url);var g=_((ez)=>{var J5=Symbol.for("yaml.alias"),n1=Symbol.for("yaml.document"),M6=Symbol.for("yaml.map"),r1=Symbol.for("yaml.pair"),G5=Symbol.for("yaml.scalar"),_6=Symbol.for("yaml.seq"),k0=Symbol.for("yaml.node.type"),iz=($)=>!!$&&typeof $==="object"&&$[k0]===J5,nz=($)=>!!$&&typeof $==="object"&&$[k0]===n1,rz=($)=>!!$&&typeof $==="object"&&$[k0]===M6,sz=($)=>!!$&&typeof $==="object"&&$[k0]===r1,s1=($)=>!!$&&typeof $==="object"&&$[k0]===G5,oz=($)=>!!$&&typeof $==="object"&&$[k0]===_6;function o1($){if($&&typeof $==="object")switch($[k0]){case M6:case _6:return!0}return!1}function az($){if($&&typeof $==="object")switch($[k0]){case J5:case M6:case G5:case _6:return!0}return!1}var tz=($)=>(s1($)||o1($))&&!!$.anchor;ez.ALIAS=J5;ez.DOC=n1;ez.MAP=M6;ez.NODE_TYPE=k0;ez.PAIR=r1;ez.SCALAR=G5;ez.SEQ=_6;ez.hasAnchor=tz;ez.isAlias=iz;ez.isCollection=o1;ez.isDocument=nz;ez.isMap=rz;ez.isNode=az;ez.isPair=sz;ez.isScalar=s1;ez.isSeq=oz});var M$=_((LX)=>{var s=g(),X0=Symbol("break visit"),a1=Symbol("skip children"),C0=Symbol("remove node");function P6($,Z){let Q=t1(Z);if(s.isDocument($)){if(k2(null,$.contents,Q,Object.freeze([$]))===C0)$.contents=null}else k2(null,$,Q,Object.freeze([]))}P6.BREAK=X0;P6.SKIP=a1;P6.REMOVE=C0;function k2($,Z,Q,z){let X=e1($,Z,Q,z);if(s.isNode(X)||s.isPair(X))return $4($,z,X),k2($,X,Q,z);if(typeof X!=="symbol"){if(s.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===X0)return X0;else if(U===C0)Z.items.splice(H,1),H-=1}}else if(s.isPair(Z)){z=Object.freeze(z.concat(Z));let H=k2("key",Z.key,Q,z);if(H===X0)return X0;else if(H===C0)Z.key=null;let U=k2("value",Z.value,Q,z);if(U===X0)return X0;else if(U===C0)Z.value=null}}return X}async function F6($,Z){let Q=t1(Z);if(s.isDocument($)){if(await h2(null,$.contents,Q,Object.freeze([$]))===C0)$.contents=null}else await h2(null,$,Q,Object.freeze([]))}F6.BREAK=X0;F6.SKIP=a1;F6.REMOVE=C0;async function h2($,Z,Q,z){let X=await e1($,Z,Q,z);if(s.isNode(X)||s.isPair(X))return $4($,z,X),h2($,X,Q,z);if(typeof X!=="symbol"){if(s.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===X0)return X0;else if(U===C0)Z.items.splice(H,1),H-=1}}else if(s.isPair(Z)){z=Object.freeze(z.concat(Z));let H=await h2("key",Z.key,Q,z);if(H===X0)return X0;else if(H===C0)Z.key=null;let U=await h2("value",Z.value,Q,z);if(U===X0)return X0;else if(U===C0)Z.value=null}}return X}function t1($){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 e1($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(s.isMap(Z))return Q.Map?.($,Z,z);if(s.isSeq(Z))return Q.Seq?.($,Z,z);if(s.isPair(Z))return Q.Pair?.($,Z,z);if(s.isScalar(Z))return Q.Scalar?.($,Z,z);if(s.isAlias(Z))return Q.Alias?.($,Z,z);return}function $4($,Z,Q){let z=Z[Z.length-1];if(s.isCollection(z))z.items[$]=Q;else if(s.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(s.isDocument(z))z.contents=Q;else{let X=s.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}LX.visit=P6;LX.visitAsync=F6});var V5=_((FX)=>{var Z4=g(),MX=M$(),_X={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},PX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>_X[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+PX($.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&&Z4.isNode($.contents)){let X={};MX.visit($.contents,(H,U)=>{if(Z4.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:"};FX.Directives=J0});var R6=_((CX)=>{var Q4=g(),NX=M$();function TX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function z4($){let Z=new Set;return NX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function X4($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function AX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(H)=>{Q.push(H),X??(X=z4($));let U=X4(Z,X);return X.add(U),U},setAnchors:()=>{for(let H of Q){let U=z.get(H);if(typeof U==="object"&&U.anchor&&(Q4.isScalar(U.node)||Q4.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}}CX.anchorIsValid=TX;CX.anchorNames=z4;CX.createNodeAnchors=AX;CX.findNewAnchor=X4});var Y5=_((bX)=>{function _$($,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=_$($,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=_$($,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=_$($,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=_$($,z,X,H);if(U===void 0)delete z[X];else if(U!==H)z[X]=U}return $.call(Z,Q,z)}bX.applyReviver=_$});var d0=_((gX)=>{var xX=g();function H4($,Z,Q){if(Array.isArray($))return $.map((z,X)=>H4(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!xX.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 $}gX.toJS=H4});var N6=_((uX)=>{var kX=Y5(),U4=g(),hX=d0();class J4{constructor($){Object.defineProperty(this,U4.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(!U4.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=hX.toJS(this,"",H);if(typeof z==="function")for(let{count:J,res:G}of H.anchors.values())z(G,J);return typeof X==="function"?kX.applyReviver(X,{"":U},"",U):U}}uX.NodeBase=J4});var P$=_((dX)=>{var mX=R6(),pX=M$(),u2=g(),lX=N6(),cX=d0();class G4 extends lX.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=[],pX.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)cX.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=T6(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(mX.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 T6($,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=T6($,X,Q);if(H>z)z=H}return z}else if(u2.isPair(Z)){let z=T6($,Z.key,Q),X=T6($,Z.value,Q);return Math.max(z,X)}return 1}dX.Alias=G4});var d=_((aX)=>{var nX=g(),rX=N6(),sX=d0(),oX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class J2 extends rX.NodeBase{constructor($){super(nX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:sX.toJS(this.value,$,Z)}toString(){return String(this.value)}}J2.BLOCK_FOLDED="BLOCK_FOLDED";J2.BLOCK_LITERAL="BLOCK_LITERAL";J2.PLAIN="PLAIN";J2.QUOTE_DOUBLE="QUOTE_DOUBLE";J2.QUOTE_SINGLE="QUOTE_SINGLE";aX.Scalar=J2;aX.isScalarValue=oX});var F$=_((XH)=>{var $H=P$(),G2=g(),V4=d(),ZH="tag:yaml.org,2002:";function QH($,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 zH($,Z,Q){if(G2.isDocument($))$=$.contents;if(G2.isNode($))return $;if(G2.isPair($)){let W=Q.schema[G2.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 $H.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(Z?.startsWith("!!"))Z=ZH+Z.slice(2);let V=QH($,Z,U.tags);if(!V){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new V4.Scalar($);if(G)G.node=W;return W}V=$ instanceof Map?U[G2.MAP]:(Symbol.iterator in Object($))?U[G2.SEQ]:U[G2.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 V4.Scalar($);if(Z)Y.tag=Z;else if(!V.default)Y.tag=V.tag;if(G)G.node=Y;return Y}XH.createNode=zH});var A6=_((GH)=>{var UH=F$(),j0=g(),JH=N6();function W5($,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 UH.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var Y4=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class W4 extends JH.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(Y4($))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,W5(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,W5(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}GH.Collection=W4;GH.collectionFromPath=W5;GH.isEmptyPath=Y4});var R$=_((KH)=>{var BH=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function B5($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var qH=($,Z,Q)=>$.endsWith(`
3
+ `)?B5(Q,Z):Q.includes(`
4
4
  `)?`
5
- `+W5(Q,Z):($.endsWith(" ")?"":" ")+Q;YH.indentComment=W5;YH.lineComment=VH;YH.stringifyComment=GH});var W4=M((DH)=>{function KH($,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=Y4($,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=Y4($,q,Z.length);W=q+Z.length+G,B=void 0}else{if(C===" "&&K&&K!==" "&&K!==`
5
+ `+B5(Q,Z):($.endsWith(" ")?"":" ")+Q;KH.indentComment=B5;KH.lineComment=qH;KH.stringifyComment=BH});var q4=_((MH)=>{function OH($,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=B4($,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=B4($,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=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],N=V[C+1]||$.length;if(F===0)_=`
9
- ${Z}${$.slice(0,N)}`;else{if(Q==="quoted"&&Y[F])_+=`${$[F]}\\`;_+=`
10
- ${Z}${$.slice(F+1,N)}`}}return _}function Y4($,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}DH.FOLD_BLOCK="block";DH.FOLD_FLOW="flow";DH.FOLD_QUOTED="quoted";DH.foldFlowLines=KH});var T$=M((RH)=>{var K0=d(),i0=W4(),C6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),j6=($)=>/^(%|---|\.\.\.)/m.test($);function MH($,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)+`
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 M=$.slice(0,V[0]);for(let C=0;C<V.length;++C){let F=V[C],N=V[C+1]||$.length;if(F===0)M=`
9
+ ${Z}${$.slice(0,N)}`;else{if(Q==="quoted"&&Y[F])M+=`${$[F]}\\`;M+=`
10
+ ${Z}${$.slice(F+1,N)}`}}return M}function B4($,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}MH.FOLD_BLOCK="block";MH.FOLD_FLOW="flow";MH.FOLD_QUOTED="quoted";MH.foldFlowLines=OH});var T$=_((CH)=>{var K0=d(),i0=q4(),j6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),w6=($)=>/^(%|---|\.\.\.)/m.test($);function NH($,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||(w6($)?" ":""),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
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 B5($,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=B5;else if(H&&!X)z=N$;else z=Q?B5:N$}return z($,Z)}var q5;try{q5=new RegExp(`(^|(?<!
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,j6(Z,!1))}function q5($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return N$($,Z);let Q=Z.indent||(w6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${Q}`)+"'";return Z.implicitKey?z:i0.foldFlowLines(z,Q,i0.FOLD_FLOW,j6(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=q5;else if(H&&!X)z=N$;else z=Q?q5:N$}return z($,Z)}var K5;try{K5=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{q5=/\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:!MH(Q,G,V.length);if(!Q)return Y?`|
20
+ |$)`,"g")}catch{K5=/\n+(?!\n|$)/g}function C6({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||w6(Q)?" ":""),Y=U==="literal"?!0:U==="folded"||Z===K0.Scalar.BLOCK_FOLDED?!1:Z===K0.Scalar.BLOCK_LITERAL?!0:!NH(Q,G,V.length);if(!Q)return Y?`|
21
21
  `:`>
22
22
  `;let W,B;for(B=Q.length;B>0;--B){let N=Q[B-1];if(N!==`
23
23
  `&&N!=="\t"&&N!==" ")break}let K=Q.substring(B),L=K.indexOf(`
24
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(q5,`$&${V}`)}let q=!1,D,O=-1;for(D=0;D<Q.length;++D){let N=Q[D];if(N===" ")q=!0;else if(N===`
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 N=Q.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${V}`),T=!1,w=C6(z,!0);if(U!=="folded"&&Z!==K0.Scalar.BLOCK_FOLDED)w.onOverflow=()=>{T=!0};let P=i0.foldFlowLines(`${_}${N}${K}`,V,i0.FOLD_BLOCK,w);if(!T)return`>${F}
25
+ `)K=K.slice(0,-1);K=K.replace(K5,`$&${V}`)}let q=!1,D,O=-1;for(D=0;D<Q.length;++D){let N=Q[D];if(N===" ")q=!0;else if(N===`
26
+ `)O=D;else break}let M=Q.substring(0,O<D?O+1:D);if(M)Q=Q.substring(M.length),M=M.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}`),T=!1,j=j6(z,!0);if(U!=="folded"&&Z!==K0.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{T=!0};let P=i0.foldFlowLines(`${M}${N}${K}`,V,i0.FOLD_BLOCK,j);if(!T)return`>${F}
28
28
  ${V}${P}`}return Q=Q.replace(/\n+/g,`$&${V}`),`|${F}
29
- ${V}${_}${Q}${K}`}function PH($,Z,Q,z){let{type:X,value:H}=$,{actualString:U,implicitKey:J,indent:G,indentStep:V,inFlow:Y}=Z;if(J&&H.includes(`
29
+ ${V}${M}${Q}${K}`}function TH($,Z,Q,z){let{type:X,value:H}=$,{actualString:U,implicitKey:J,indent:G,indentStep:V,inFlow:Y}=Z;if(J&&H.includes(`
30
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 FH($,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 B5(U.value,Z);case K0.Scalar.PLAIN:return PH(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}RH.stringifyString=FH});var A$=M((bH)=>{var TH=F6(),n0=x(),AH=R$(),CH=T$();function jH($,Z){let Q=Object.assign({blockQuote:!0,commentString:AH.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 wH($,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 SH($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],H=(n0.isScalar($)||n0.isCollection($))&&$.anchor;if(H&&TH.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 EH($,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=wH(Z.doc.schema.tags,H));let U=SH(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)?CH.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}`}bH.createStringifyContext=jH;bH.stringify=EH});var K4=M((vH)=>{var h0=x(),B4=d(),q4=A$(),C$=R$();function gH({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===B4.Scalar.BLOCK_FOLDED||$.type===B4.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!H),indent:J+G});let L=!1,q=!1,D=q4.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,N=q4.stringify(Z,Q,()=>F=!0,()=>q=!0),T=" ";if(B||O||_){if(T=O?`
36
- `:"",_){let w=V(_);T+=`
37
- ${C$.indentComment(w,Q.indent)}`}if(N===""&&!Q.inFlow){if(T===`
31
+ `)?f2(H,Z):C6($,Z,Q,z);if(!J&&!Y&&X!==K0.Scalar.PLAIN&&H.includes(`
32
+ `))return C6($,Z,Q,z);if(w6(H)){if(G==="")return Z.forceBlockIndent=!0,C6($,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,j6(Z,!1))}function AH($,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):C6(U,Z,Q,z);case K0.Scalar.QUOTE_DOUBLE:return N$(U.value,Z);case K0.Scalar.QUOTE_SINGLE:return q5(U.value,Z);case K0.Scalar.PLAIN:return TH(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}CH.stringifyString=AH});var A$=_((vH)=>{var wH=R6(),n0=g(),SH=R$(),EH=T$();function bH($,Z){let Q=Object.assign({blockQuote:!0,commentString:SH.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 yH($,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 xH($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],H=(n0.isScalar($)||n0.isCollection($))&&$.anchor;if(H&&wH.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 gH($,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=yH(Z.doc.schema.tags,H));let U=xH(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)?EH.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}`}vH.createStringifyContext=bH;vH.stringify=gH});var L4=_((fH)=>{var h0=g(),K4=d(),D4=A$(),C$=R$();function uH({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===K4.Scalar.BLOCK_FOLDED||$.type===K4.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!H),indent:J+G});let L=!1,q=!1,D=D4.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,M,C;if(h0.isNode(Z))O=!!Z.spaceBefore,M=Z.commentBefore,C=Z.comment;else if(O=!1,M=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,N=D4.stringify(Z,Q,()=>F=!0,()=>q=!0),T=" ";if(B||O||M){if(T=O?`
36
+ `:"",M){let j=V(M);T+=`
37
+ ${C$.indentComment(j,Q.indent)}`}if(N===""&&!Q.inFlow){if(T===`
38
38
  `&&C)T=`
39
39
 
40
40
  `}else T+=`
41
- ${Q.indent}`}else if(!K&&h0.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)T=`
41
+ ${Q.indent}`}else if(!K&&h0.isCollection(Z)){let j=N[0],P=N.indexOf(`
42
+ `),S=P!==-1,n=Q.inFlow??Z.flow??Z.items.length===0;if(S||!n){let a=!1;if(S&&(j==="&"||j==="!")){let v=N.indexOf(" ");if(j==="&"&&v!==-1&&v<P&&N[v+1]==="!")v=N.indexOf(" ",v+1);if(v===-1||P<v)a=!0}if(!a)T=`
43
43
  ${Q.indent}`}}else if(N===""||N[0]===`
44
- `)T="";if(D+=T+N,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}vH.stringifyPair=gH});var K5=M((fH)=>{var D4=K$("process");function hH($,...Z){if($==="debug")console.log(...Z)}function uH($,Z){if($==="debug"||$==="warn")if(typeof D4.emitWarning==="function")D4.emitWarning(Z);else console.warn(Z)}fH.debug=hH;fH.warn=uH});var b6=M((cH)=>{var E6=x(),L4=d(),w6="<<",S6={identify:($)=>$===w6||typeof $==="symbol"&&$.description===w6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new L4.Scalar(Symbol(w6)),{addToJSMap:I4}),stringify:()=>w6},lH=($,Z)=>(S6.identify(Z)||E6.isScalar(Z)&&(!Z.type||Z.type===L4.Scalar.PLAIN)&&S6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===S6.tag&&Q.default);function I4($,Z,Q){let z=O4($,Q);if(E6.isSeq(z))for(let X of z.items)D5($,Z,X);else if(Array.isArray(z))for(let X of z)D5($,Z,X);else D5($,Z,z)}function D5($,Z,Q){let z=O4($,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 O4($,Z){return $&&E6.isAlias(Z)?Z.resolve($.doc,$):Z}cH.addMergeToJSMap=I4;cH.isMergeKey=lH;cH.merge=S6});var I5=M((tH)=>{var rH=K5(),_4=b6(),sH=A$(),M4=x(),L5=d0();function oH($,Z,{key:Q,value:z}){if(M4.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(_4.isMergeKey($,Q))_4.addMergeToJSMap($,Z,z);else{let X=L5.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,L5.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let H=aH(Q,X,$),U=L5.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 aH($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(M4.isNode($)&&Q?.doc){let z=sH.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)+'..."';rH.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)}tH.addPairToJSMap=oH});var r0=M((zU)=>{var P4=F$(),$U=K4(),ZU=I5(),y6=x();function QU($,Z,Q){let z=P4.createNode($,void 0,Q),X=P4.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 ZU.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?$U.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}zU.Pair=x6;zU.createPair=QU});var O5=M((VU)=>{var J2=x(),F4=A$(),g6=R$();function UU($,Z,Q){return(Z.inFlow??$.flow?GU:JU)($,Z,Q)}function JU({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=F4.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?`
44
+ `)T="";if(D+=T+N,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}fH.stringifyPair=uH});var D5=_((cH)=>{var I4=K$("process");function pH($,...Z){if($==="debug")console.log(...Z)}function lH($,Z){if($==="debug"||$==="warn")if(typeof I4.emitWarning==="function")I4.emitWarning(Z);else console.warn(Z)}cH.debug=pH;cH.warn=lH});var y6=_((rH)=>{var b6=g(),O4=d(),S6="<<",E6={identify:($)=>$===S6||typeof $==="symbol"&&$.description===S6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new O4.Scalar(Symbol(S6)),{addToJSMap:M4}),stringify:()=>S6},nH=($,Z)=>(E6.identify(Z)||b6.isScalar(Z)&&(!Z.type||Z.type===O4.Scalar.PLAIN)&&E6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===E6.tag&&Q.default);function M4($,Z,Q){let z=_4($,Q);if(b6.isSeq(z))for(let X of z.items)L5($,Z,X);else if(Array.isArray(z))for(let X of z)L5($,Z,X);else L5($,Z,z)}function L5($,Z,Q){let z=_4($,Q);if(!b6.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 _4($,Z){return $&&b6.isAlias(Z)?Z.resolve($.doc,$):Z}rH.addMergeToJSMap=M4;rH.isMergeKey=nH;rH.merge=E6});var O5=_((QU)=>{var tH=D5(),P4=y6(),eH=A$(),F4=g(),I5=d0();function $U($,Z,{key:Q,value:z}){if(F4.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(P4.isMergeKey($,Q))P4.addMergeToJSMap($,Z,z);else{let X=I5.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,I5.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let H=ZU(Q,X,$),U=I5.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 ZU($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(F4.isNode($)&&Q?.doc){let z=eH.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)+'..."';tH.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)}QU.addPairToJSMap=$U});var r0=_((JU)=>{var R4=F$(),XU=L4(),HU=O5(),x6=g();function UU($,Z,Q){let z=R4.createNode($,void 0,Q),X=R4.createNode(Z,void 0,Q);return new g6(z,X)}class g6{constructor($,Z=null){Object.defineProperty(this,x6.NODE_TYPE,{value:x6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(x6.isNode(Z))Z=Z.clone($);if(x6.isNode(Q))Q=Q.clone($);return new g6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return HU.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?XU.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}JU.Pair=g6;JU.createPair=UU});var M5=_((qU)=>{var V2=g(),N4=A$(),v6=R$();function YU($,Z,Q){return(Z.inFlow??$.flow?BU:WU)($,Z,Q)}function WU({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(V2.isNode(q)){if(!W&&q.spaceBefore)B.push("");if(k6(Q,B,q.commentBefore,W),q.comment)D=q.comment}else if(V2.isPair(q)){let M=V2.isNode(q.key)?q.key:null;if(M){if(!W&&M.spaceBefore)B.push("");k6(Q,B,M.commentBefore,W)}}W=!1;let O=N4.stringify(q,Y,()=>D=null,()=>W=!0);if(D)O+=v6.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&&U)U();return K}function GU({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=F4.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?`
47
+ `+v6.indentComment(V($),G),J)J()}else if(W&&U)U();return K}function BU({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(V2.isNode(q)){if(q.spaceBefore)W.push("");if(k6(Z,W,q.commentBefore,!1),q.comment)D=q.comment}else if(V2.isPair(q)){let M=V2.isNode(q.key)?q.key:null;if(M){if(M.spaceBefore)W.push("");if(k6(Z,W,M.commentBefore,!1),M.comment)V=!0}let C=V2.isNode(q.value)?q.value:null;if(C){if(C.comment)D=C.comment;if(C.commentBefore)V=!0}else if(q.value==null&&M?.comment)D=M.comment}if(D)V=!0;let O=N4.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((M,C)=>M+C.length+2,2)+(O.length+2)>Z.options.lineWidth);if(V)O+=","}if(D)O+=v6.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
49
  ${H}${X}${q}`:`
50
50
  `;return`${L}
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())}}VU.stringifyCollection=UU});var o0=M((DU)=>{var WU=O5(),BU=I5(),qU=T6(),s0=x(),k6=r0(),KU=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 R4 extends qU.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)&&KU.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)BU.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 WU.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}DU.YAMLMap=R4;DU.findPair=j$});var m2=M((MU)=>{var OU=x(),N4=o0(),_U={collection:"map",default:!0,nodeClass:N4.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!OU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>N4.YAMLMap.from($,Z,Q)};MU.map=_U});var a0=M((CU)=>{var FU=F$(),RU=O5(),NU=T6(),u6=x(),TU=d(),AU=d0();class T4 extends NU.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)&&TU.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(AU.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return RU.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(FU.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}CU.YAMLSeq=T4});var p2=M((EU)=>{var wU=x(),A4=a0(),SU={collection:"seq",default:!0,nodeClass:A4.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!wU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>A4.YAMLSeq.from($,Z,Q)};EU.seq=SU});var w$=M((gU)=>{var yU=T$(),xU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),yU.stringifyString($,Z,Q,z)}};gU.string=xU});var f6=M((kU)=>{var C4=d(),j4={identify:($)=>$==null,createNode:()=>new C4.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new C4.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&j4.test.test($)?$:Z.options.nullStr};kU.nullTag=j4});var _5=M((fU)=>{var uU=d(),w4={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new uU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&w4.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};fU.boolTag=w4});var l2=M((lU)=>{function pU({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}lU.stringifyNumber=pU});var P5=M((sU)=>{var dU=d(),M5=l2(),iU={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:M5.stringifyNumber},nU={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():M5.stringifyNumber($)}},rU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new dU.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:M5.stringifyNumber};sU.float=rU;sU.floatExp=nU;sU.floatNaN=iU});var R5=M((QJ)=>{var S4=l2(),m6=($)=>typeof $==="bigint"||Number.isInteger($),F5=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function E4($,Z,Q){let{value:z}=$;if(m6(z)&&z>=0)return Q+z.toString(Z);return S4.stringifyNumber($)}var eU={identify:($)=>m6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>F5($,2,8,Q),stringify:($)=>E4($,8,"0o")},$J={identify:m6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>F5($,0,10,Q),stringify:S4.stringifyNumber},ZJ={identify:($)=>m6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>F5($,2,16,Q),stringify:($)=>E4($,16,"0x")};QJ.int=$J;QJ.intHex=ZJ;QJ.intOct=eU});var b4=M((BJ)=>{var UJ=m2(),JJ=f6(),GJ=p2(),VJ=w$(),YJ=_5(),N5=P5(),T5=R5(),WJ=[UJ.map,GJ.seq,VJ.string,JJ.nullTag,YJ.boolTag,T5.intOct,T5.int,T5.intHex,N5.floatNaN,N5.floatExp,N5.float];BJ.schema=WJ});var x4=M((MJ)=>{var KJ=d(),DJ=m2(),LJ=p2();function y4($){return typeof $==="bigint"||Number.isInteger($)}var p6=({value:$})=>JSON.stringify($),IJ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:p6},{identify:($)=>$==null,createNode:()=>new KJ.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:y4,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>y4($)?$.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}],OJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},_J=[DJ.map,LJ.seq].concat(IJ,OJ);MJ.schema=_J});var C5=M((NJ)=>{var S$=K$("buffer"),A5=d(),FJ=T$(),RJ={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=A5.Scalar.BLOCK_LITERAL),Z!==A5.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===A5.Scalar.BLOCK_LITERAL?`
52
- `:" ")}return FJ.stringifyString({comment:$,type:Z,value:J},z,X,H)}};NJ.binary=RJ});var c6=M((wJ)=>{var l6=x(),j5=r0(),AJ=d(),CJ=a0();function g4($,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 j5.Pair(new AJ.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
51
+ ${X}${K}`}else return`${B}${U}${W.join(" ")}${U}${K}`}}function k6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let H=v6.indentComment(Z(z),$);Q.push(H.trimStart())}}qU.stringifyCollection=YU});var o0=_((MU)=>{var DU=M5(),LU=O5(),IU=A6(),s0=g(),h6=r0(),OU=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 T4 extends IU.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(h6.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 h6.Pair($,$?.value);else Q=new h6.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)&&OU.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 h6.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)LU.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 DU.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}MU.YAMLMap=T4;MU.findPair=j$});var m2=_((NU)=>{var FU=g(),A4=o0(),RU={collection:"map",default:!0,nodeClass:A4.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!FU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>A4.YAMLMap.from($,Z,Q)};NU.map=RU});var a0=_((EU)=>{var AU=F$(),CU=M5(),jU=A6(),f6=g(),wU=d(),SU=d0();class C4 extends jU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(f6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=u6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=u6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&f6.isScalar(z)?z.value:z}has($){let Z=u6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=u6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(f6.isScalar(z)&&wU.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(SU.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return CU.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(AU.createNode(U,void 0,Q))}}return X}}function u6($){let Z=f6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}EU.YAMLSeq=C4});var p2=_((gU)=>{var yU=g(),j4=a0(),xU={collection:"seq",default:!0,nodeClass:j4.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!yU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>j4.YAMLSeq.from($,Z,Q)};gU.seq=xU});var w$=_((uU)=>{var kU=T$(),hU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),kU.stringifyString($,Z,Q,z)}};uU.string=hU});var m6=_((mU)=>{var w4=d(),S4={identify:($)=>$==null,createNode:()=>new w4.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new w4.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&S4.test.test($)?$:Z.options.nullStr};mU.nullTag=S4});var _5=_((cU)=>{var lU=d(),E4={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new lU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&E4.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};cU.boolTag=E4});var l2=_((nU)=>{function iU({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}nU.stringifyNumber=iU});var F5=_((eU)=>{var sU=d(),P5=l2(),oU={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:P5.stringifyNumber},aU={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():P5.stringifyNumber($)}},tU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new sU.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:P5.stringifyNumber};eU.float=tU;eU.floatExp=aU;eU.floatNaN=oU});var N5=_((UJ)=>{var b4=l2(),p6=($)=>typeof $==="bigint"||Number.isInteger($),R5=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function y4($,Z,Q){let{value:z}=$;if(p6(z)&&z>=0)return Q+z.toString(Z);return b4.stringifyNumber($)}var zJ={identify:($)=>p6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>R5($,2,8,Q),stringify:($)=>y4($,8,"0o")},XJ={identify:p6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>R5($,0,10,Q),stringify:b4.stringifyNumber},HJ={identify:($)=>p6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>R5($,2,16,Q),stringify:($)=>y4($,16,"0x")};UJ.int=XJ;UJ.intHex=HJ;UJ.intOct=zJ});var x4=_((LJ)=>{var YJ=m2(),WJ=m6(),BJ=p2(),qJ=w$(),KJ=_5(),T5=F5(),A5=N5(),DJ=[YJ.map,BJ.seq,qJ.string,WJ.nullTag,KJ.boolTag,A5.intOct,A5.int,A5.intHex,T5.floatNaN,T5.floatExp,T5.float];LJ.schema=DJ});var v4=_((NJ)=>{var OJ=d(),MJ=m2(),_J=p2();function g4($){return typeof $==="bigint"||Number.isInteger($)}var l6=({value:$})=>JSON.stringify($),PJ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:l6},{identify:($)=>$==null,createNode:()=>new OJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:l6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:l6},{identify:g4,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>g4($)?$.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:l6}],FJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},RJ=[MJ.map,_J.seq].concat(PJ,FJ);NJ.schema=RJ});var j5=_((jJ)=>{var S$=K$("buffer"),C5=d(),AJ=T$(),CJ={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=C5.Scalar.BLOCK_LITERAL),Z!==C5.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===C5.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return AJ.stringifyString({comment:$,type:Z,value:J},z,X,H)}};jJ.binary=CJ});var d6=_((yJ)=>{var c6=g(),w5=r0(),SJ=d(),EJ=a0();function k4($,Z){if(c6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(c6.isPair(z))continue;else if(c6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new w5.Pair(new SJ.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
53
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 j5.Pair(z)}else Z("Expected a sequence for this tag");return $}function v4($,Z,Q){let{replacer:z}=Q,X=new CJ.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(j5.createPair(J,G,Q))}return X}var jJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:g4,createNode:v4};wJ.createPairs=v4;wJ.pairs=jJ;wJ.resolvePairs=g4});var S5=M((gJ)=>{var k4=x(),w5=d0(),E$=o0(),yJ=a0(),h4=c6();class G2 extends yJ.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(k4.isPair(z))X=w5.toJS(z.key,"",Z),H=w5.toJS(z.value,X,Z);else X=w5.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=h4.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}G2.tag="tag:yaml.org,2002:omap";var xJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=h4.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(k4.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)};gJ.YAMLOMap=G2;gJ.omap=xJ});var l4=M((hJ)=>{var u4=d();function f4({value:$,source:Z},Q){if(Z&&($?m4:p4).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var m4={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new u4.Scalar(!0),stringify:f4},p4={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new u4.Scalar(!1),stringify:f4};hJ.falseTag=p4;hJ.trueTag=m4});var c4=M((dJ)=>{var mJ=d(),E5=l2(),pJ={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:E5.stringifyNumber},lJ={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():E5.stringifyNumber($)}},cJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new mJ.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:E5.stringifyNumber};dJ.float=cJ;dJ.floatExp=lJ;dJ.floatNaN=pJ});var i4=M((eJ)=>{var d4=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 b5($,Z,Q){let{value:z}=$;if(b$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return d4.stringifyNumber($)}var sJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>d6($,2,2,Q),stringify:($)=>b5($,2,"0b")},oJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>d6($,1,8,Q),stringify:($)=>b5($,8,"0")},aJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>d6($,0,10,Q),stringify:d4.stringifyNumber},tJ={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:($)=>b5($,16,"0x")};eJ.int=aJ;eJ.intBin=sJ;eJ.intHex=tJ;eJ.intOct=oJ});var y5=M((HG)=>{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 XG={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 $}};HG.YAMLSet=V2;HG.set=XG});var g5=M((WG)=>{var GG=l2();function x5($,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 n4($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return GG.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 VG={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})=>x5($,Q),stringify:n4},YG={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:($)=>x5($,!1),stringify:n4},r4={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(r4.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=x5(Y,!1);if(Math.abs(W)<30)W*=60;V-=60000*W}return new Date(V)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};WG.floatTime=YG;WG.intTime=VG;WG.timestamp=r4});var o4=M((TG)=>{var DG=m2(),LG=f6(),IG=p2(),OG=w$(),_G=C5(),s4=l4(),v5=c4(),s6=i4(),MG=b6(),PG=S5(),FG=c6(),RG=y5(),k5=g5(),NG=[DG.map,IG.seq,OG.string,LG.nullTag,s4.trueTag,s4.falseTag,s6.intBin,s6.intOct,s6.int,s6.intHex,v5.floatNaN,v5.floatExp,v5.float,_G.binary,MG.merge,PG.omap,FG.pairs,RG.set,k5.intTime,k5.floatTime,k5.timestamp];TG.schema=NG});var U7=M((xG)=>{var $7=m2(),CG=f6(),Z7=p2(),jG=w$(),wG=_5(),h5=P5(),u5=R5(),SG=b4(),EG=x4(),Q7=C5(),y$=b6(),z7=S5(),X7=c6(),a4=o4(),H7=y5(),o6=g5(),t4=new Map([["core",SG.schema],["failsafe",[$7.map,Z7.seq,jG.string]],["json",EG.schema],["yaml11",a4.schema],["yaml-1.1",a4.schema]]),e4={binary:Q7.binary,bool:wG.boolTag,float:h5.float,floatExp:h5.floatExp,floatNaN:h5.floatNaN,floatTime:o6.floatTime,int:u5.int,intHex:u5.intHex,intOct:u5.intOct,intTime:o6.intTime,map:$7.map,merge:y$.merge,null:CG.nullTag,omap:z7.omap,pairs:X7.pairs,seq:Z7.seq,set:H7.set,timestamp:o6.timestamp},bG={"tag:yaml.org,2002:binary":Q7.binary,"tag:yaml.org,2002:merge":y$.merge,"tag:yaml.org,2002:omap":z7.omap,"tag:yaml.org,2002:pairs":X7.pairs,"tag:yaml.org,2002:set":H7.set,"tag:yaml.org,2002:timestamp":o6.timestamp};function yG($,Z,Q){let z=t4.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(t4.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"?e4[U]:U;if(!J){let G=JSON.stringify(U),V=Object.keys(e4).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},[])}xG.coreKnownTags=bG;xG.getTags=yG});var p5=M((mG)=>{var f5=x(),kG=m2(),hG=p2(),uG=w$(),a6=U7(),fG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class m5{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,f5.MAP,{value:kG.map}),Object.defineProperty(this,f5.SCALAR,{value:uG.string}),Object.defineProperty(this,f5.SEQ,{value:hG.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?fG:null}clone(){let $=Object.create(m5.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}mG.Schema=m5});var J7=M((dG)=>{var lG=x(),l5=A$(),x$=R$();function cG($,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=l5.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(lG.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=l5.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(l5.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let G=H($.comment);if(G.includes(`
54
+ ${H.comment}`:z.comment}z=X}$.items[Q]=c6.isPair(z)?z:new w5.Pair(z)}else Z("Expected a sequence for this tag");return $}function h4($,Z,Q){let{replacer:z}=Q,X=new EJ.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(w5.createPair(J,G,Q))}return X}var bJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:k4,createNode:h4};yJ.createPairs=h4;yJ.pairs=bJ;yJ.resolvePairs=k4});var E5=_((uJ)=>{var u4=g(),S5=d0(),E$=o0(),kJ=a0(),f4=d6();class Y2 extends kJ.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=Y2.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(u4.isPair(z))X=S5.toJS(z.key,"",Z),H=S5.toJS(z.value,X,Z);else X=S5.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=f4.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}Y2.tag="tag:yaml.org,2002:omap";var hJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:Y2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=f4.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(u4.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 Y2,Q)},createNode:($,Z,Q)=>Y2.from($,Z,Q)};uJ.YAMLOMap=Y2;uJ.omap=hJ});var d4=_((pJ)=>{var m4=d();function p4({value:$,source:Z},Q){if(Z&&($?l4:c4).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var l4={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new m4.Scalar(!0),stringify:p4},c4={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new m4.Scalar(!1),stringify:p4};pJ.falseTag=c4;pJ.trueTag=l4});var i4=_((sJ)=>{var dJ=d(),b5=l2(),iJ={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:b5.stringifyNumber},nJ={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():b5.stringifyNumber($)}},rJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new dJ.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:b5.stringifyNumber};sJ.float=rJ;sJ.floatExp=nJ;sJ.floatNaN=iJ});var r4=_((zG)=>{var n4=l2(),b$=($)=>typeof $==="bigint"||Number.isInteger($);function i6($,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 y5($,Z,Q){let{value:z}=$;if(b$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return n4.stringifyNumber($)}var eJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>i6($,2,2,Q),stringify:($)=>y5($,2,"0b")},$G={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>i6($,1,8,Q),stringify:($)=>y5($,8,"0")},ZG={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>i6($,0,10,Q),stringify:n4.stringifyNumber},QG={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>i6($,2,16,Q),stringify:($)=>y5($,16,"0x")};zG.int=ZG;zG.intBin=eJ;zG.intHex=QG;zG.intOct=$G});var x5=_((VG)=>{var s6=g(),n6=r0(),r6=o0();class W2 extends r6.YAMLMap{constructor($){super($);this.tag=W2.tag}add($){let Z;if(s6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new n6.Pair($.key,null);else Z=new n6.Pair($,null);if(!r6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=r6.findPair(this.items,$);return!Z&&s6.isPair(Q)?s6.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=r6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new n6.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(n6.createPair(H,null,Q))}return X}}W2.tag="tag:yaml.org,2002:set";var GG={collection:"map",identify:($)=>$ instanceof Set,nodeClass:W2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>W2.from($,Z,Q),resolve($,Z){if(s6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new W2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};VG.YAMLSet=W2;VG.set=GG});var v5=_((DG)=>{var BG=l2();function g5($,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 s4($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return BG.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 qG={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})=>g5($,Q),stringify:s4},KG={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:($)=>g5($,!1),stringify:s4},o4={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(o4.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=g5(Y,!1);if(Math.abs(W)<30)W*=60;V-=60000*W}return new Date(V)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};DG.floatTime=KG;DG.intTime=qG;DG.timestamp=o4});var t4=_((wG)=>{var MG=m2(),_G=m6(),PG=p2(),FG=w$(),RG=j5(),a4=d4(),k5=i4(),o6=r4(),NG=y6(),TG=E5(),AG=d6(),CG=x5(),h5=v5(),jG=[MG.map,PG.seq,FG.string,_G.nullTag,a4.trueTag,a4.falseTag,o6.intBin,o6.intOct,o6.int,o6.intHex,k5.floatNaN,k5.floatExp,k5.float,RG.binary,NG.merge,TG.omap,AG.pairs,CG.set,h5.intTime,h5.floatTime,h5.timestamp];wG.schema=jG});var G7=_((hG)=>{var Q7=m2(),EG=m6(),z7=p2(),bG=w$(),yG=_5(),u5=F5(),f5=N5(),xG=x4(),gG=v4(),X7=j5(),y$=y6(),H7=E5(),U7=d6(),e4=t4(),J7=x5(),a6=v5(),$7=new Map([["core",xG.schema],["failsafe",[Q7.map,z7.seq,bG.string]],["json",gG.schema],["yaml11",e4.schema],["yaml-1.1",e4.schema]]),Z7={binary:X7.binary,bool:yG.boolTag,float:u5.float,floatExp:u5.floatExp,floatNaN:u5.floatNaN,floatTime:a6.floatTime,int:f5.int,intHex:f5.intHex,intOct:f5.intOct,intTime:a6.intTime,map:Q7.map,merge:y$.merge,null:EG.nullTag,omap:H7.omap,pairs:U7.pairs,seq:z7.seq,set:J7.set,timestamp:a6.timestamp},vG={"tag:yaml.org,2002:binary":X7.binary,"tag:yaml.org,2002:merge":y$.merge,"tag:yaml.org,2002:omap":H7.omap,"tag:yaml.org,2002:pairs":U7.pairs,"tag:yaml.org,2002:set":J7.set,"tag:yaml.org,2002:timestamp":a6.timestamp};function kG($,Z,Q){let z=$7.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($7.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"?Z7[U]:U;if(!J){let G=JSON.stringify(U),V=Object.keys(Z7).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},[])}hG.coreKnownTags=vG;hG.getTags=kG});var l5=_((dG)=>{var m5=g(),mG=m2(),pG=p2(),lG=w$(),t6=G7(),cG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class p5{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?t6.getTags($,"compat"):$?t6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?t6.coreKnownTags:{},this.tags=t6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,m5.MAP,{value:mG.map}),Object.defineProperty(this,m5.SCALAR,{value:lG.string}),Object.defineProperty(this,m5.SEQ,{value:pG.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?cG:null}clone(){let $=Object.create(p5.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}dG.Schema=p5});var V7=_((sG)=>{var nG=g(),c5=A$(),x$=R$();function rG($,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=c5.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(nG.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=c5.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(c5.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let G=H($.comment);if(G.includes(`
55
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
- `}dG.stringifyDocument=cG});var g$=M(($V)=>{var nG=P$(),c2=T6(),G0=x(),rG=r0(),sG=d0(),oG=p5(),aG=J7(),c5=F6(),tG=V5(),eG=F$(),d5=G5();class i5{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 d5.Directives({version:H});this.setSchema(H,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(i5.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=c5.anchorNames(this);$.anchor=!Z||Q.has(Z)?c5.findNewAnchor(Z||"a",Q):Z}return new nG.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}=c5.createNodeAnchors(this,H||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:B},L=eG.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 rG.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 d5.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 d5.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 oG.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=sG.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"?tG.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 aG.stringifyDocument(this,$)}}function d2($){if(G0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}$V.Document=i5});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 G7 extends t6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class V7 extends t6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var QV=($,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)+`…
57
+ `}sG.stringifyDocument=rG});var g$=_((XV)=>{var aG=P$(),c2=A6(),G0=g(),tG=r0(),eG=d0(),$V=l5(),ZV=V7(),d5=R6(),QV=Y5(),zV=F$(),i5=V5();class n5{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 i5.Directives({version:H});this.setSchema(H,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(n5.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=d5.anchorNames(this);$.anchor=!Z||Q.has(Z)?d5.findNewAnchor(Z||"a",Q):Z}return new aG.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}=d5.createNodeAnchors(this,H||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:B},L=zV.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 tG.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 i5.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 i5.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 $V.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=eG.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"?QV.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 ZV.stringifyDocument(this,$)}}function d2($){if(G0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}XV.Document=n5});var v$=_((JV)=>{class e6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class Y7 extends e6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class W7 extends e6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var UV=($,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
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
60
  ${U}
61
61
  ${V}
62
- `}};zV.YAMLError=t6;zV.YAMLParseError=G7;zV.YAMLWarning=V7;zV.prettifyError=QV});var k$=M((VV)=>{function GV($,{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,N=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,N??(N=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,N??(N=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 T=$[$.length-1],w=T?T.offset+T.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:N??w}}VV.resolveProps=GV});var e6=M((WV)=>{function n5($){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(n5(Z.key)||n5(Z.value))return!0}return!1;default:return!0}}WV.containsNewline=n5});var r5=M((DV)=>{var qV=e6();function KV($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&qV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}DV.flowIndentCheck=KV});var s5=M((OV)=>{var Y7=x();function IV($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(H,U)=>H===U||Y7.isScalar(H)&&Y7.isScalar(U)&&H.value===U.value;return Z.some((H)=>X(H.key,Q))}OV.mapIncludes=IV});var D7=M((NV)=>{var W7=r0(),MV=o0(),B7=k$(),PV=e6(),q7=r5(),FV=s5(),K7="All mapping items must start at the same column";function RV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??MV.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=B7.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",K7)}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||PV.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",K7);Q.atKey=!0;let O=q.end,_=B?$(Q,B,q,X):Z(Q,O,W,null,q,X);if(Q.schema.compat)q7.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,FV.mapIncludes(Q,J.items,_))X(O,"DUPLICATE_KEY","Map keys must be unique");let C=B7.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)q7.flowIndentCheck(z.indent,L,X);G=F.range[2];let N=new W7.Pair(_,F);if(Q.options.keepSourceTokens)N.srcToken=Y;J.items.push(N)}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 W7.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}NV.resolveBlockMap=RV});var L7=M((SV)=>{var AV=a0(),CV=k$(),jV=r5();function wV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??AV.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=CV.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)jV.flowIndentCheck(z.indent,W,X);G=K.range[2],J.items.push(K)}return J.range=[z.offset,G,V??G],J}SV.resolveBlockSeq=wV});var i2=M((yV)=>{function bV($,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}}yV.resolveEnd=bV});var _7=M((pV)=>{var gV=x(),vV=r0(),I7=o0(),kV=a0(),hV=i2(),O7=k$(),uV=e6(),fV=s5(),o5="Block collections are not allowed within flow collections",a5=($)=>$&&($.type==="block-map"||$.type==="block-seq");function mV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let U=z.start.source==="{",J=U?"flow map":"flow sequence",V=new(H?.nodeClass??(U?I7.YAMLMap:kV.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:N}=O,T=O7.resolveProps(_,{flow:J,indicator:"explicit-key-ind",next:C??F?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!F&&!N){if(D===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(T.comment)if(V.comment)V.comment+=`
66
- `+T.comment;else V.comment=T.comment;W=T.end;continue}if(!U&&Q.options.strict&&uV.containsNewline(C))X(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!T.comma)X(T.start,"MISSING_CHAR",`Missing , between ${J} items`);if(T.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(gV.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
67
- `+w;else P.comment=w;T.comment=T.comment.substring(w.length+1)}}}if(!U&&!F&&!T.found){let w=N?$(Q,N,T,X):Z(Q,T.end,F,null,T,X);if(V.items.push(w),W=w.range[2],a5(N))X(w.range,"BLOCK_IN_FLOW",o5)}else{Q.atKey=!0;let w=T.end,P=C?$(Q,C,T,X):Z(Q,w,_,null,T,X);if(a5(C))X(P.range,"BLOCK_IN_FLOW",o5);Q.atKey=!1;let E=O7.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(!U&&!T.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(T.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(a5(N))X(n.range,"BLOCK_IN_FLOW",o5)}else if(E.comment)if(P.comment)P.comment+=`
68
- `+E.comment;else P.comment=E.comment;let a=new vV.Pair(P,n);if(Q.options.keepSourceTokens)a.srcToken=O;if(U){let g=V;if(fV.mapIncludes(Q,g.items,P))X(w,"DUPLICATE_KEY","Map keys must be unique");g.items.push(a)}else{let g=new I7.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=hV.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}pV.resolveFlowCollection=mV});var M7=M((tV)=>{var cV=x(),dV=d(),iV=o0(),nV=a0(),rV=D7(),sV=L7(),oV=_7();function t5($,Z,Q,z,X,H){let U=Q.type==="block-map"?rV.resolveBlockMap($,Z,Q,z,H):Q.type==="block-seq"?sV.resolveBlockSeq($,Z,Q,z,H):oV.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 aV($,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===iV.YAMLMap.tagName&&J==="map"||U===nV.YAMLSeq.tagName&&J==="seq")return t5($,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 t5($,Z,Q,X,U)}}let V=t5($,Z,Q,X,U,G),Y=G.resolve?.(V,(B)=>X(H,"TAG_RESOLVE_FAILED",B),Z.options)??V,W=cV.isNode(Y)?Y:new dV.Scalar(Y);if(W.range=V.range,W.tag=U,G?.format)W.format=G.format;return W}tV.composeCollection=aV});var $Z=M((zY)=>{var e5=d();function $Y($,Z,Q){let z=Z.offset,X=ZY(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let H=X.mode===">"?e5.Scalar.BLOCK_FOLDED:e5.Scalar.BLOCK_LITERAL,U=Z.source?QY(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?`
62
+ `}};JV.YAMLError=e6;JV.YAMLParseError=Y7;JV.YAMLWarning=W7;JV.prettifyError=UV});var k$=_((qV)=>{function BV($,{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,M=null,C=null,F=null,N=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 S=P.source.substring(1)||" ";if(!W)W=S;else W+=B+S;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)M=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,N??(N=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,N??(N=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 T=$[$.length-1],j=T?T.offset+T.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:M,end:j,start:N??j}}qV.resolveProps=BV});var $8=_((DV)=>{function r5($){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(r5(Z.key)||r5(Z.value))return!0}return!1;default:return!0}}DV.containsNewline=r5});var s5=_((MV)=>{var IV=$8();function OV($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&IV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}MV.flowIndentCheck=OV});var o5=_((FV)=>{var B7=g();function PV($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(H,U)=>H===U||B7.isScalar(H)&&B7.isScalar(U)&&H.value===U.value;return Z.some((H)=>X(H.key,Q))}FV.mapIncludes=PV});var I7=_((jV)=>{var q7=r0(),NV=o0(),K7=k$(),TV=$8(),D7=s5(),AV=o5(),L7="All mapping items must start at the same column";function CV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??NV.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=K7.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",L7)}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||TV.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",L7);Q.atKey=!0;let O=q.end,M=B?$(Q,B,q,X):Z(Q,O,W,null,q,X);if(Q.schema.compat)D7.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,AV.mapIncludes(Q,J.items,M))X(O,"DUPLICATE_KEY","Map keys must be unique");let C=K7.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:M.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(M.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)D7.flowIndentCheck(z.indent,L,X);G=F.range[2];let N=new q7.Pair(M,F);if(Q.options.keepSourceTokens)N.srcToken=Y;J.items.push(N)}else{if(D)X(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(M.comment)M.comment+=`
65
+ `+C.comment;else M.comment=C.comment;let F=new q7.Pair(M);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}jV.resolveBlockMap=CV});var O7=_((xV)=>{var SV=a0(),EV=k$(),bV=s5();function yV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??SV.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=EV.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)bV.flowIndentCheck(z.indent,W,X);G=K.range[2],J.items.push(K)}return J.range=[z.offset,G,V??G],J}xV.resolveBlockSeq=yV});var i2=_((kV)=>{function vV($,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}}kV.resolveEnd=vV});var P7=_((iV)=>{var uV=g(),fV=r0(),M7=o0(),mV=a0(),pV=i2(),_7=k$(),lV=$8(),cV=o5(),a5="Block collections are not allowed within flow collections",t5=($)=>$&&($.type==="block-map"||$.type==="block-seq");function dV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let U=z.start.source==="{",J=U?"flow map":"flow sequence",V=new(H?.nodeClass??(U?M7.YAMLMap:mV.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:M,key:C,sep:F,value:N}=O,T=_7.resolveProps(M,{flow:J,indicator:"explicit-key-ind",next:C??F?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!F&&!N){if(D===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(T.comment)if(V.comment)V.comment+=`
66
+ `+T.comment;else V.comment=T.comment;W=T.end;continue}if(!U&&Q.options.strict&&lV.containsNewline(C))X(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!T.comma)X(T.start,"MISSING_CHAR",`Missing , between ${J} items`);if(T.comment){let j="";$:for(let P of M)switch(P.type){case"comma":case"space":break;case"comment":j=P.source.substring(1);break $;default:break $}if(j){let P=V.items[V.items.length-1];if(uV.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
67
+ `+j;else P.comment=j;T.comment=T.comment.substring(j.length+1)}}}if(!U&&!F&&!T.found){let j=N?$(Q,N,T,X):Z(Q,T.end,F,null,T,X);if(V.items.push(j),W=j.range[2],t5(N))X(j.range,"BLOCK_IN_FLOW",a5)}else{Q.atKey=!0;let j=T.end,P=C?$(Q,C,T,X):Z(Q,j,M,null,T,X);if(t5(C))X(P.range,"BLOCK_IN_FLOW",a5);Q.atKey=!1;let S=_7.resolveProps(F??[],{flow:J,indicator:"map-value-ind",next:N,offset:P.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(S.found){if(!U&&!T.found&&Q.options.strict){if(F)for(let v of F){if(v===S.found)break;if(v.type==="newline"){X(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(T.start<S.found.offset-1024)X(S.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(S.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let n=N?$(Q,N,S,X):S.found?Z(Q,S.end,F,null,S,X):null;if(n){if(t5(N))X(n.range,"BLOCK_IN_FLOW",a5)}else if(S.comment)if(P.comment)P.comment+=`
68
+ `+S.comment;else P.comment=S.comment;let a=new fV.Pair(P,n);if(Q.options.keepSourceTokens)a.srcToken=O;if(U){let v=V;if(cV.mapIncludes(Q,v.items,P))X(j,"DUPLICATE_KEY","Map keys must be unique");v.items.push(a)}else{let v=new M7.YAMLMap(Q.schema);v.flow=!0,v.items.push(a);let A=(n??P).range;v.range=[P.range[0],A[1],A[2]],V.items.push(v)}W=n?n.range[2]:S.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=pV.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}iV.resolveFlowCollection=dV});var F7=_((QY)=>{var rV=g(),sV=d(),oV=o0(),aV=a0(),tV=I7(),eV=O7(),$Y=P7();function e5($,Z,Q,z,X,H){let U=Q.type==="block-map"?tV.resolveBlockMap($,Z,Q,z,H):Q.type==="block-seq"?eV.resolveBlockSeq($,Z,Q,z,H):$Y.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 ZY($,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===oV.YAMLMap.tagName&&J==="map"||U===aV.YAMLSeq.tagName&&J==="seq")return e5($,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 e5($,Z,Q,X,U)}}let V=e5($,Z,Q,X,U,G),Y=G.resolve?.(V,(B)=>X(H,"TAG_RESOLVE_FAILED",B),Z.options)??V,W=rV.isNode(Y)?Y:new sV.Scalar(Y);if(W.range=V.range,W.tag=U,G?.format)W.format=G.format;return W}QY.composeCollection=ZY});var ZZ=_((JY)=>{var $Z=d();function XY($,Z,Q){let z=Z.offset,X=HY(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let H=X.mode===">"?$Z.Scalar.BLOCK_FOLDED:$Z.Scalar.BLOCK_LITERAL,U=Z.source?UY(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
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===e5.Scalar.BLOCK_LITERAL)W+=B+D.slice(G)+O,B=`
71
+ `;for(let q=Y;q<J;++q){let[D,O]=U[q];V+=D.length+O.length+1;let M=O[O.length-1]==="\r";if(M)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-(M?2:1),"BAD_INDENT",F),D=""}if(H===$Z.Scalar.BLOCK_LITERAL)W+=B+D.slice(G)+O,B=`
72
72
  `;else if(D.length>G||O[0]==="\t"){if(B===" ")B=`
73
73
  `;else if(!K&&B===`
74
74
  `)B=`
@@ -81,102 +81,102 @@ ${V}
81
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:H,comment:X.comment,range:[z,L,L]}}function ZY({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 QY($){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=$Y});var QZ=M((qY)=>{var ZZ=d(),HY=i2();function UY($,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=ZZ.Scalar.PLAIN,G=JY(H,V);break;case"single-quoted-scalar":J=ZZ.Scalar.QUOTE_SINGLE,G=GY(H,V);break;case"double-quoted-scalar":J=ZZ.Scalar.QUOTE_DOUBLE,G=VY(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=HY.resolveEnd(U,Y,Z,Q);return{value:G,type:J,comment:W.comment,range:[z,Y,W.offset]}}function JY($,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 P7($)}function GY($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return P7($.slice(1,-1)).replace(/''/g,"'")}function P7($){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 HY({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 UY($){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}JY.resolveBlockScalar=XY});var zZ=_((IY)=>{var QZ=d(),VY=i2();function YY($,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=QZ.Scalar.PLAIN,G=WY(H,V);break;case"single-quoted-scalar":J=QZ.Scalar.QUOTE_SINGLE,G=BY(H,V);break;case"double-quoted-scalar":J=QZ.Scalar.QUOTE_DOUBLE,G=qY(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=VY.resolveEnd(U,Y,Z,Q);return{value:G,type:J,comment:W.comment,range:[z,Y,W.offset]}}function WY($,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 R7($)}function BY($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return R7($.slice(1,-1)).replace(/''/g,"'")}function R7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
85
  `,"sy"),Q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
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
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 VY($,Z){let Q="";for(let z=1;z<$.length-1;++z){let X=$[z];if(X==="\r"&&$[z+1]===`
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 qY($,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:H,offset:U}=YY($,z);Q+=H,z=U}else if(X==="\\"){let H=$[++z],U=WY[H];if(U)Q+=U;else if(H===`
90
+ `){let{fold:H,offset:U}=KY($,z);Q+=H,z=U}else if(X==="\\"){let H=$[++z],U=DY[H];if(U)Q+=U;else if(H===`
91
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+=BY($,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!==`
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+=LY($,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
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 YY($,Z){let Q="",z=$[Z+1];while(z===" "||z==="\t"||z===`
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 KY($,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 WY={"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 BY($,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}}qY.resolveFlowScalar=UY});var R7=M((MY)=>{var Y2=x(),F7=d(),DY=$Z(),LY=QZ();function IY($,Z,Q,z){let{value:X,type:H,comment:U,range:J}=Z.type==="block-scalar"?DY.resolveBlockScalar($,Z,z):LY.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=OY($.schema,X,G,Q,z);else if(Z.type==="scalar")V=_Y($,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 F7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new F7.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 OY($,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 _Y({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}MY.composeScalar=IY});var N7=M((RY)=>{function FY($,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 $}RY.emptyScalarPosition=FY});var C7=M((bY)=>{var TY=P$(),AY=x(),CY=M7(),T7=R7(),jY=i2(),wY=N7(),SY={composeNode:A7,composeEmptyNode:zZ};function A7($,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=EY($,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=T7.composeScalar($,Z,G,z),J)V.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(V=CY.composeCollection(SY,$,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=zZ($,Z.offset,void 0,null,Q,z)),J&&V.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!AY.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 zZ($,Z,Q,z,{spaceBefore:X,comment:H,anchor:U,tag:J,end:G},V){let Y={type:"scalar",offset:wY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=T7.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 EY({options:$},{offset:Z,source:Q,end:z},X){let H=new TY.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=jY.resolveEnd(z,U,$.strict,X);if(H.range=[Z,U,J.offset],J.comment)H.comment=J.comment;return H}bY.composeEmptyNode=zZ;bY.composeNode=A7});var w7=M((uY)=>{var gY=g$(),j7=C7(),vY=i2(),kY=k$();function hY($,Z,{offset:Q,start:z,value:X,end:H},U){let J=Object.assign({_directives:Z},$),G=new gY.Document(void 0,J),V={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},Y=kY.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?j7.composeNode(V,X,Y,U):j7.composeEmptyNode(V,Y.end,z,null,Y,U);let W=G.contents.range[2],B=vY.resolveEnd(H,W,!1,U);if(B.comment)G.comment=B.comment;return G.range=[Q,W,B.offset],G}uY.composeDoc=hY});var XZ=M((iY)=>{var mY=K$("process"),pY=G5(),lY=g$(),h$=v$(),S7=x(),cY=w7(),dY=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 E7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let H=$[X];switch(H[0]){case"#":Z+=(Z===""?"":z?`
98
+ `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var DY={"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 LY($,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}}IY.resolveFlowScalar=YY});var T7=_((NY)=>{var B2=g(),N7=d(),MY=ZZ(),_Y=zZ();function PY($,Z,Q,z){let{value:X,type:H,comment:U,range:J}=Z.type==="block-scalar"?MY.resolveBlockScalar($,Z,z):_Y.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[B2.SCALAR];else if(G)V=FY($.schema,X,G,Q,z);else if(Z.type==="scalar")V=RY($,X,Z,z);else V=$.schema[B2.SCALAR];let Y;try{let W=V.resolve(X,(B)=>z(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);Y=B2.isScalar(W)?W:new N7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new N7.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 FY($,Z,Q,z,X){if(Q==="!")return $[B2.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"),$[B2.SCALAR]}function RY({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[B2.SCALAR];if(Q.compat){let J=Q.compat.find((G)=>G.default&&G.test?.test(z))??Q[B2.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}NY.composeScalar=PY});var A7=_((CY)=>{function AY($,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 $}CY.emptyScalarPosition=AY});var w7=_((vY)=>{var wY=P$(),SY=g(),EY=F7(),C7=T7(),bY=i2(),yY=A7(),xY={composeNode:j7,composeEmptyNode:XZ};function j7($,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=gY($,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=C7.composeScalar($,Z,G,z),J)V.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(V=EY.composeCollection(xY,$,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=XZ($,Z.offset,void 0,null,Q,z)),J&&V.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!SY.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 XZ($,Z,Q,z,{spaceBefore:X,comment:H,anchor:U,tag:J,end:G},V){let Y={type:"scalar",offset:yY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=C7.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 gY({options:$},{offset:Z,source:Q,end:z},X){let H=new wY.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=bY.resolveEnd(z,U,$.strict,X);if(H.range=[Z,U,J.offset],J.comment)H.comment=J.comment;return H}vY.composeEmptyNode=XZ;vY.composeNode=j7});var E7=_((lY)=>{var uY=g$(),S7=w7(),fY=i2(),mY=k$();function pY($,Z,{offset:Q,start:z,value:X,end:H},U){let J=Object.assign({_directives:Z},$),G=new uY.Document(void 0,J),V={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},Y=mY.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?S7.composeNode(V,X,Y,U):S7.composeEmptyNode(V,Y.end,z,null,Y,U);let W=G.contents.range[2],B=fY.resolveEnd(H,W,!1,U);if(B.comment)G.comment=B.comment;return G.range=[Q,W,B.offset],G}lY.composeDoc=pY});var HZ=_((oY)=>{var dY=K$("process"),iY=V5(),nY=g$(),h$=v$(),b7=g(),rY=E7(),sY=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 y7($){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
- `)+(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 b7{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 pY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=E7(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(S7.isCollection(X)&&!X.flow&&X.items.length>0){let H=X.items[0];if(S7.isPair(H))H=H.key;let U=H.commentBefore;H.commentBefore=U?`${Q}
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 x7{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 iY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=y7(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(b7.isCollection(X)&&!X.flow&&X.items.length>0){let H=X.items[0];if(b7.isPair(H))H=H.key;let U=H.commentBefore;H.commentBefore=U?`${Q}
104
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:E7(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(mY.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=cY.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=dY.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 lY.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}}}iY.Composer=b7});var g7=M((ZW)=>{var rY=$Z(),sY=QZ(),oY=v$(),y7=T$();function aY($,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 oY.YAMLParseError([J,J+1],H,U)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return sY.resolveFlowScalar($,Z,z);case"block-scalar":return rY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function tY($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:H=-1,type:U="PLAIN"}=Z,J=y7.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:`
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:y7(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(dY.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=rY.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=sY.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 nY.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}}}oY.Composer=x7});var k7=_((HW)=>{var tY=ZZ(),eY=zZ(),$W=v$(),g7=T$();function ZW($,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 $W.YAMLParseError([J,J+1],H,U)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return eY.resolveFlowScalar($,Z,z);case"block-scalar":return tY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function QW($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:H=-1,type:U="PLAIN"}=Z,J=g7.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:H,indent:z,source:Y}];if(!x7(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 eY($,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=y7.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">":$W($,G);break;case'"':HZ($,G,"double-quoted-scalar");break;case"'":HZ($,G,"single-quoted-scalar");break;default:HZ($,G,"scalar")}}function $W($,Z){let Q=Z.indexOf(`
109
+ `,B=[{type:"block-scalar-header",offset:H,indent:z,source:Y}];if(!v7(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 zW($,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=g7.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">":XW($,G);break;case'"':UZ($,G,"double-quoted-scalar");break;case"'":UZ($,G,"single-quoted-scalar");break;default:UZ($,G,"scalar")}}function XW($,Z){let Q=Z.indexOf(`
111
111
  `),z=Z.substring(0,Q),X=Z.substring(Q+1)+`
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(!x7(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 x7($,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 HZ($,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})}}}ZW.createScalarToken=tY;ZW.resolveAsScalar=aY;ZW.setScalarValue=eY});var v7=M((UW)=>{var HW=($)=>("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}UW.stringify=HW});var u7=M((VW)=>{var UZ=Symbol("break visit"),GW=Symbol("skip children"),k7=Symbol("remove item");function W2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};h7(Object.freeze([]),$,Z)}W2.BREAK=UZ;W2.SKIP=GW;W2.REMOVE=k7;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 h7($,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=h7(Object.freeze($.concat([[X,U]])),H.items[U],Q);if(typeof J==="number")U=J-1;else if(J===UZ)return UZ;else if(J===k7)H.items.splice(U,1),U-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}VW.visit=W2});var Q8=M((IW)=>{var JZ=g7(),WW=v7(),BW=u7(),GZ="\uFEFF",VZ="\x02",YZ="\x18",WZ="\x1F",qW=($)=>!!$&&("items"in $),KW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function DW($){switch($){case GZ:return"<BOM>";case VZ:return"<DOC>";case YZ:return"<FLOW_END>";case WZ:return"<SCALAR>";default:return JSON.stringify($)}}function LW($){switch($){case GZ:return"byte-order-mark";case VZ:return"doc-mode";case YZ:return"flow-error-end";case WZ: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(!v7(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 v7($,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 UZ($,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})}}}HW.createScalarToken=QW;HW.resolveAsScalar=ZW;HW.setScalarValue=zW});var h7=_((YW)=>{var VW=($)=>("type"in $)?Q8($):Z8($);function Q8($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=Q8(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=Z8(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=Z8(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=Z8($);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 Z8({start:$,key:Z,sep:Q,value:z}){let X="";for(let H of $)X+=H.source;if(Z)X+=Q8(Z);if(Q)for(let H of Q)X+=H.source;if(z)X+=Q8(z);return X}YW.stringify=VW});var m7=_((qW)=>{var JZ=Symbol("break visit"),BW=Symbol("skip children"),u7=Symbol("remove item");function q2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};f7(Object.freeze([]),$,Z)}q2.BREAK=JZ;q2.SKIP=BW;q2.REMOVE=u7;q2.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};q2.parentCollection=($,Z)=>{let Q=q2.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 f7($,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=f7(Object.freeze($.concat([[X,U]])),H.items[U],Q);if(typeof J==="number")U=J-1;else if(J===JZ)return JZ;else if(J===u7)H.items.splice(U,1),U-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}qW.visit=q2});var z8=_((PW)=>{var GZ=k7(),DW=h7(),LW=m7(),VZ="\uFEFF",YZ="\x02",WZ="\x18",BZ="\x1F",IW=($)=>!!$&&("items"in $),OW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function MW($){switch($){case VZ:return"<BOM>";case YZ:return"<DOC>";case WZ:return"<FLOW_END>";case BZ:return"<SCALAR>";default:return JSON.stringify($)}}function _W($){switch($){case VZ:return"byte-order-mark";case YZ:return"doc-mode";case WZ:return"flow-error-end";case BZ: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}IW.createScalarToken=JZ.createScalarToken;IW.resolveAsScalar=JZ.resolveAsScalar;IW.setScalarValue=JZ.setScalarValue;IW.stringify=WW.stringify;IW.visit=BW.visit;IW.BOM=GZ;IW.DOCUMENT=VZ;IW.FLOW_END=YZ;IW.SCALAR=WZ;IW.isCollection=qW;IW.isScalar=KW;IW.prettyToken=DW;IW.tokenType=LW});var qZ=M((yW)=>{var f$=Q8();function D0($){switch($){case void 0:case" ":case`
117
- `:case"\r":case"\t":return!0;default:return!1}}var f7=new Set("0123456789ABCDEFabcdef"),EW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),z8=new Set(",[]{}"),bW=new Set(` ,[]{}
118
- \r `),BZ=($)=>!$||bW.has($);class m7{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}PW.createScalarToken=GZ.createScalarToken;PW.resolveAsScalar=GZ.resolveAsScalar;PW.setScalarValue=GZ.setScalarValue;PW.stringify=DW.stringify;PW.visit=LW.visit;PW.BOM=VZ;PW.DOCUMENT=YZ;PW.FLOW_END=WZ;PW.SCALAR=BZ;PW.isCollection=IW;PW.isScalar=OW;PW.prettyToken=MW;PW.tokenType=_W});var KZ=_((kW)=>{var f$=z8();function D0($){switch($){case void 0:case" ":case`
117
+ `:case"\r":case"\t":return!0;default:return!1}}var p7=new Set("0123456789ABCDEFabcdef"),gW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),X8=new Set(",[]{}"),vW=new Set(` ,[]{}
118
+ \r `),qZ=($)=>!$||vW.has($);class l7{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]===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(BZ),"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(BZ),"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(`
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(qZ),"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(qZ),"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
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
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===`
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)||$&&X8.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
- `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&z8.has(X))break;if(z===`
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(BZ),$+=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(EW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&f7.has(this.buffer[$+1])&&f7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
132
+ `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&X8.has(X))break;if(z===`
133
+ `){let H=this.continueScalar(Q+1);if(H===-1)break;Q=Math.max(Q,H-2)}}else{if($&&X8.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(qZ),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(D0(Q)||Z&&X8.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(gW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&p7.has(this.buffer[$+1])&&p7.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)}}yW.Lexer=m7});var KZ=M((gW)=>{class p7{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}}}}gW.LineCounter=p7});var DZ=M((uW)=>{var kW=K$("process"),l7=Q8(),hW=qZ();function t0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function c7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function i7($){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 d7($){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,i7(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 n7{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 hW.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=$,kW.env.LOG_TOKENS)console.log("|",l7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=l7.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")d7(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&&c7(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(c7($.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(`
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)}}kW.Lexer=l7});var DZ=_((uW)=>{class c7{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}}}}uW.LineCounter=c7});var LZ=_((lW)=>{var mW=K$("process"),d7=z8(),pW=KZ();function t0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function i7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function r7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function H8($){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 U8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function n7($){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,r7(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 s7{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 pW.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=$,mW.env.LOG_TOKENS)console.log("|",d7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=d7.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")n7(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&&i7(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(i7($.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=H8(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)){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(i7(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);d7($);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(`
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 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(r7(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)){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||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=H8(Q),X=n2(z);n7($);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=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()}}}uW.Parser=n7});var t7=M((rW)=>{var r7=XZ(),mW=g$(),m$=v$(),pW=K5(),lW=x(),cW=KZ(),s7=DZ();function o7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new cW.LineCounter||null,prettyErrors:Z}}function dW($,Z={}){let{lineCounter:Q,prettyErrors:z}=o7(Z),X=new s7.Parser(Q?.addNewLine),H=new r7.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 a7($,Z={}){let{lineCounter:Q,prettyErrors:z}=o7(Z),X=new s7.Parser(Q?.addNewLine),H=new r7.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 iW($,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=a7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>pW.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 nW($,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(lW.isDocument($)&&!z)return $.toString(Q);return new mW.Document($,z,Q).toString(Q)}rW.parse=iW;rW.parseAllDocuments=dW;rW.parseDocument=a7;rW.stringify=nW});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,$]])),h1=new Map(m.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),xM=new Map(m.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function u1($,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 Cz($){return m.filter((Z)=>Z.category===$)}var jz=m.filter(($)=>$.index<=21),wz=m,D6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),f1=new Set(["none","n/a","not applicable"]),L6="slotignored";function Sz($){return typeof $==="string"&&f1.has($.trim().toLowerCase())}function t8($){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",Ez=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"&&Ez.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 e8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,D$=e8("1"),g2=e8("2"),vM=e8("3"),L$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},I$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,$5=($)=>`\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:`${$5("◇")} ${$5("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 bz($){let Z=O$($),Q=v0.indexOf(Z);return Q>0?v0[Q-1]:null}var X5={};Tz(X5,{validate:()=>xz,sdkVersion:()=>uz,scoreFafb:()=>hz,scoreEnterprise:()=>yz,score:()=>z5,fafbInfo:()=>kz,decompile:()=>vz,compile:()=>gz});var Z5=null;function c0(){if(Z5)return Z5;try{let $=K$("faf-scoring-kernel");return Z5=$,$}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=H8($),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=H8($),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()}}}lW.Parser=s7});var $9=_((tW)=>{var o7=HZ(),dW=g$(),m$=v$(),iW=D5(),nW=g(),rW=DZ(),a7=LZ();function t7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new rW.LineCounter||null,prettyErrors:Z}}function sW($,Z={}){let{lineCounter:Q,prettyErrors:z}=t7(Z),X=new a7.Parser(Q?.addNewLine),H=new o7.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 e7($,Z={}){let{lineCounter:Q,prettyErrors:z}=t7(Z),X=new a7.Parser(Q?.addNewLine),H=new o7.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 oW($,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=e7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>iW.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 aW($,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(nW.isDocument($)&&!z)return $.toString(Q);return new dW.Document($,z,Q).toString(Q)}tW.parse=oW;tW.parseAllDocuments=sW;tW.parseDocument=e7;tW.stringify=aW});var p=[{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(p.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),f1=new Map(p.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),u_=new Map(p.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function m1($,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 Ez($){return p.filter((Z)=>Z.category===$)}var bz=p.filter(($)=>$.index<=21),yz=p,D6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),p1=new Set(["none","n/a","not applicable"]),L6="slotignored";function xz($){return typeof $==="string"&&p1.has($.trim().toLowerCase())}function e8($){return typeof $==="string"&&$.trim()!==""&&r($)}function r($){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",gz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]),I6={skills:new Set(["stack.frontend"]),"skills-plugin":new Set(["stack.frontend","stack.runtime"])};function x2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(b2,$))return null;if(I6[$]?.has(Z.path))return!0;if(!b2[$].includes(Z.category))return!1;return!($==="framework"&&gz.has(Z.path))}var b2={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],skills:["project","human"],cli:["project","human","universal"],"skills-plugin":["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 $5=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,D$=$5("1"),g2=$5("2"),m_=$5("3"),L$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},I$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,Z5=($)=>`\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:`${Z5("◇")} ${Z5("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 vz($){let Z=O$($),Q=v0.indexOf(Z);return Q>0?v0[Q-1]:null}var H5={};wz(H5,{validate:()=>hz,sdkVersion:()=>lz,scoreFafb:()=>pz,scoreEnterprise:()=>kz,score:()=>X5,fafbInfo:()=>mz,decompile:()=>fz,compile:()=>uz});var Q5=null;function c0(){if(Q5)return Q5;try{let $=K$("faf-scoring-kernel");return Q5=$,$}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 Q5($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[h1.get(Q)??Q]=z;return{...$,slots:Z}}function z5($){return Q5(JSON.parse(c0().score_faf(I6($))))}function yz($){return Q5(JSON.parse(c0().score_faf_enterprise(I6($))))}function xz($){return c0().validate_faf(I6($))}function gz($){return c0().compile_fafb(I6($))}function vz($){return JSON.parse(c0().decompile_fafb($))}function kz($){return JSON.parse(c0().fafb_info($))}function hz($){return Q5(JSON.parse(c0().score_fafb($)))}function uz(){return c0().sdk_version()}var m1=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function p1($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function l1($){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 fz($){return $.unknown?"unknown (—)":`${$.score}%`}function c1($){return{score:$.score,tier:O$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function H5($){let Z=l1($);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 c1(z5($))}function mz($){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(!p1(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!m1.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 l9}from"fs";import{join as f9,dirname as gZ,basename as AF,resolve as t$}from"path";var eW=XZ(),$B=g$(),ZB=p5(),LZ=v$(),QB=P$(),e0=x(),zB=r0(),XB=d(),HB=o0(),UB=a0(),YF=Q8(),JB=qZ(),GB=KZ(),VB=DZ(),U8=t7(),e7=_$();var YB=eW.Composer,J8=$B.Document,WB=ZB.Schema,BB=LZ.YAMLError,G8=LZ.YAMLParseError,qB=LZ.YAMLWarning,KB=QB.Alias,u0=e0.isAlias,B2=e0.isCollection,DB=e0.isDocument,p=e0.isMap,L0=e0.isNode,LB=e0.isPair,s=e0.isScalar,f0=e0.isSeq,IB=zB.Pair,OB=XB.Scalar,r2=HB.YAMLMap,p$=UB.YAMLSeq;var _B=JB.Lexer,MB=GB.LineCounter,PB=VB.Parser,m0=U8.parse,FB=U8.parseAllDocuments,s2=U8.parseDocument,q2=U8.stringify,RB=e7.visit,NB=e7.visitAsync;import{accessSync as $9,closeSync as MZ,constants as Z9,existsSync as TB,fchmodSync as Q9,fchownSync as AB,fsyncSync as z9,lstatSync as PZ,mkdirSync as X9,mkdtempSync as qF,openSync as H9,readdirSync as CB,readFileSync as FZ,readlinkSync as jB,realpathSync as wB,renameSync as SB,rmSync as KF,statSync as o2,unlinkSync as U9,writeFileSync as EB}from"fs";import{randomBytes as bB}from"crypto";import{basename as $2,dirname as K2,isAbsolute as J9,join as a2,relative as RZ,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"}),yB=new Set(Object.values(t).map(($)=>$.toLowerCase())),xB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),IZ=($)=>yB.has($.toLowerCase());function t2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var gB=/\.fafm?$/i,vB=/^[a-z][a-z0-9-]*$/,w0=($)=>wB.native($),Z2=($)=>$?.code;function c$($,Z){let Q=RZ($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${V8}`)&&!J9(Q)}function G9($){try{return jB($)}catch{return"?"}}function kB($,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 ${G9(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 hB(Z,X,z.read),X}function hB($,Z,Q){let z=$2($),X=$2(Z),H=IZ(z)&&IZ(X);if(Q&&!gB.test(X)&&!H){let U=IZ(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&&!xB(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 uB($,Z,Q,z){if($2(V0($))!=="hooks"||!vB.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 fB($,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)uB($,X,z,H);if(J)fB(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=PZ(G)}catch(Y){if(Z2(Y)==="ENOENT")return G;throw Y}if(V.isSymbolicLink())return kB(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 mB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function pB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return mB.decode($)}catch{}throw new b("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Z0($){return pB(FZ($),$)}function I0($){try{return FZ($)}catch(Z){if(Z2(Z)==="ENOENT")return null;throw Z}}function l$($,Z){let Q=V0(a2($,Z));if(!TB(Q))return null;let z,X;try{z=w0(lB($)),X=w0(Q)}catch{return null}if(!c$(z,X)||t2(RZ(z,X)))return null;return X}var _Z=[];function lB($){let Z=V0($);return _Z.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(V8)?Q:Q+V8))??Z}function e2($,Z){_Z.push(V0($));try{return Z()}finally{_Z.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()?FZ(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=CB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||l$($,a2(Z,X.name))!==null)}function cB($){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 V9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var OZ=($)=>new b("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function NZ($,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 OZ($)}if(!Q)return;let z;try{z=o2($)}catch(X){if(Z2(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw OZ($);try{$9($,Z9.W_OK)}catch{throw OZ($)}}function dB($,Z){if(process.platform!=="win32")try{AB($,Z.uid,Z.gid)}catch{}Q9($,Z.mode)}function iB($){if(process.platform==="win32")return;try{let Z=H9($,"r");try{z9(Z)}finally{MZ(Z)}}catch{}}function nB($,Z,Q,z){if($.fd=H9($.path,"wx",z??Q?.mode??438),$.created=!0,EB($.fd,Z),Q)dB($.fd,Q);if(z!==void 0)Q9($.fd,z);z9($.fd),MZ($.fd),$.fd=void 0}function rB($){if($.fd!==void 0)try{MZ($.fd)}catch{}if($.created)try{U9($.path)}catch{}}function sB($,Z,Q){let z=K2($),X={path:a2(z,`.${$2($).slice(0,100)}.${process.pid}.${bB(6).toString("hex")}.faf-tmp`),created:!1},H=cB($);try{if(H)$9($,Z9.W_OK);nB(X,Z,H,Q.mode),NZ($,Q.expect,H),SB(X.path,$)}catch(U){if(rB(X),U instanceof b)throw U;let J=Z2(U)??(U instanceof Error?U.message:String(U));throw new V9($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}iB(z)}function oB($){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 oB(H)}return sB(X,Z,Q),X}function Y9($,Z,Q){let z=V0($),X=Q.root??K2(z),H=h(X,z),U=I0(H);if(Q.expect!==void 0)NZ(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($);X9(Q,{recursive:!0});let z=w0(Q),X=V0(Q,Z),H=RZ(Q,X);if(H===".."||H.startsWith(`..${V8}`)||J9(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=aB(z,X,G)}return U}function aB($,Z,Q){let z;try{z=PZ(Q)}catch(H){if(Z2(H)!=="ENOENT")throw H;return X9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=w0(Q)}catch{throw new b("dangling",Z,`${Q} is a link to ${G9(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 tB($,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=PZ(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 NZ(H,Z.expect,void 0),U9(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 L9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function W9($){return typeof $==="object"&&$.collection===void 0}function eB($,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||!L9.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 $q($){let Z=$.filter(W9);return $.map((Q)=>{if(!W9(Q)||!L9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,H,U,J)=>eB(X,Z)??z(X,H,U,J)}})}var W8={keepSourceTokens:!0,customTags:$q};function Zq($,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 Qq($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let H=Zq(Z[X],Z[X+1]);Q??=H.indent,z??=H.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function wZ($,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 I9($,Z){if(Z>0&&$[Z-1]===`
142
+ `)}}var O6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function z5($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[f1.get(Q)??Q]=z;return{...$,slots:Z}}function X5($){return z5(JSON.parse(c0().score_faf(O6($))))}function kz($){return z5(JSON.parse(c0().score_faf_enterprise(O6($))))}function hz($){return c0().validate_faf(O6($))}function uz($){return c0().compile_fafb(O6($))}function fz($){return JSON.parse(c0().decompile_fafb($))}function mz($){return JSON.parse(c0().fafb_info($))}function pz($){return z5(JSON.parse(c0().score_fafb($)))}function lz(){return c0().sdk_version()}var l1=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function c1($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function d1($){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 cz($){return $.unknown?"unknown (—)":`${$.score}%`}function i1($){return{score:$.score,tier:O$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function U5($){let Z=d1($);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 i1(X5($))}function dz($){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(!c1(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!l1.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 d9}from"fs";import{join as p9,dirname as kZ,basename as EF,resolve as t$}from"path";var zB=HZ(),XB=g$(),HB=l5(),IZ=v$(),UB=P$(),e0=g(),JB=r0(),GB=d(),VB=o0(),YB=a0(),DF=z8(),WB=KZ(),BB=DZ(),qB=LZ(),J8=$9(),Z9=M$();var KB=zB.Composer,G8=XB.Document,DB=HB.Schema,LB=IZ.YAMLError,V8=IZ.YAMLParseError,IB=IZ.YAMLWarning,OB=UB.Alias,u0=e0.isAlias,K2=e0.isCollection,MB=e0.isDocument,l=e0.isMap,L0=e0.isNode,_B=e0.isPair,o=e0.isScalar,f0=e0.isSeq,PB=JB.Pair,FB=GB.Scalar,r2=VB.YAMLMap,p$=YB.YAMLSeq;var RB=WB.Lexer,NB=BB.LineCounter,TB=qB.Parser,m0=J8.parse,AB=J8.parseAllDocuments,s2=J8.parseDocument,D2=J8.stringify,CB=Z9.visit,jB=Z9.visitAsync;import{accessSync as Q9,closeSync as PZ,constants as z9,existsSync as wB,fchmodSync as X9,fchownSync as SB,fsyncSync as H9,lstatSync as FZ,mkdirSync as U9,mkdtempSync as OF,openSync as J9,readdirSync as EB,readFileSync as RZ,readlinkSync as bB,realpathSync as yB,renameSync as xB,rmSync as MF,statSync as o2,unlinkSync as G9,writeFileSync as gB}from"fs";import{randomBytes as vB}from"crypto";import{basename as $2,dirname as L2,isAbsolute as V9,join as a2,relative as NZ,resolve as V0,sep as Y8}from"path";class E 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"}),kB=new Set(Object.values(t).map(($)=>$.toLowerCase())),hB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),OZ=($)=>kB.has($.toLowerCase());function t2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var uB=/\.fafm?$/i,fB=/^[a-z][a-z0-9-]*$/,w0=($)=>yB.native($),Z2=($)=>$?.code;function c$($,Z){let Q=NZ($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${Y8}`)&&!V9(Q)}function Y9($){try{return bB($)}catch{return"?"}}function mB($,Z,Q,z){let X;try{X=w0(Q)}catch(H){let U=Z2(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new E("dangling",Z,`${Z} is a link to ${Y9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!c$($,X))throw new E("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(t2(X)&&!(z.inGit&&L2(X)===$))throw new E("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!o2(X).isFile())throw new E("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return pB(Z,X,z.read),X}function pB($,Z,Q){let z=$2($),X=$2(Z),H=OZ(z)&&OZ(X);if(Q&&!uB.test(X)&&!H){let U=OZ(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new E("not-faf",$,`${$} is a link to ${Z}, which is not ${U} — refused.`)}if(!Q&&!hB(z,X)&&!H)throw new E("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 lB($,Z,Q,z){if($2(V0($))!=="hooks"||!fB.test($2(Z)))throw new E("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new E("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function cB($,Z,Q){if($2($)!=="config"||Q!==Z)throw new E("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function u($,Z,Q={}){let z=w0(V0($)),X=V0($,Z),H=w0(L2(X));if(!c$(z,H))throw new E("outside",X,`${X} is in ${H}, outside ${z} — refused.`);let U=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(U)lB($,X,z,H);if(J)cB(X,z,H);let G=a2(H,$2(X));if(t2(G)&&!U&&!J)throw new E("git",X,G===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${G}, inside .git/ — refused.`);let V;try{V=FZ(G)}catch(Y){if(Z2(Y)==="ENOENT")return G;throw Y}if(V.isSymbolicLink())return mB(z,X,G,{read:Q.read===!0,inGit:U||J});if(!V.isFile())throw new E("not-a-file",X,`${X} is not a regular file — refused.`);return w0(G)}var dB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function iB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return dB.decode($)}catch{}throw new E("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Q0($){return iB(RZ($),$)}function I0($){try{return RZ($)}catch(Z){if(Z2(Z)==="ENOENT")return null;throw Z}}function l$($,Z){let Q=V0(a2($,Z));if(!wB(Q))return null;let z,X;try{z=w0(nB($)),X=w0(Q)}catch{return null}if(!c$(z,X)||t2(NZ(z,X)))return null;return X}var _Z=[];function nB($){let Z=V0($);return _Z.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(Y8)?Q:Q+Y8))??Z}function e2($,Z){_Z.push(V0($));try{return Z()}finally{_Z.pop()}}function I($,Z){return l$($,Z)!==null}function w($,Z){let Q=l$($,Z);if(Q===null)return null;try{return o2(Q).isFile()?RZ(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 k($,Z="."){let Q=l$($,Z);if(Q===null)return null;let z;try{z=EB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||l$($,a2(Z,X.name))!==null)}function rB($){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 W9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var MZ=($)=>new E("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function TZ($,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 MZ($)}if(!Q)return;let z;try{z=o2($)}catch(X){if(Z2(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw MZ($);try{Q9($,z9.W_OK)}catch{throw MZ($)}}function sB($,Z){if(process.platform!=="win32")try{SB($,Z.uid,Z.gid)}catch{}X9($,Z.mode)}function oB($){if(process.platform==="win32")return;try{let Z=J9($,"r");try{H9(Z)}finally{PZ(Z)}}catch{}}function aB($,Z,Q,z){if($.fd=J9($.path,"wx",z??Q?.mode??438),$.created=!0,gB($.fd,Z),Q)sB($.fd,Q);if(z!==void 0)X9($.fd,z);H9($.fd),PZ($.fd),$.fd=void 0}function tB($){if($.fd!==void 0)try{PZ($.fd)}catch{}if($.created)try{G9($.path)}catch{}}function eB($,Z,Q){let z=L2($),X={path:a2(z,`.${$2($).slice(0,100)}.${process.pid}.${vB(6).toString("hex")}.faf-tmp`),created:!1},H=rB($);try{if(H)Q9($,z9.W_OK);aB(X,Z,H,Q.mode),TZ($,Q.expect,H),xB(X.path,$)}catch(U){if(tB(X),U instanceof E)throw U;let J=Z2(U)??(U instanceof Error?U.message:String(U));throw new W9($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}oB(z)}function $q($){return $ instanceof E&&!$.onWrite?new E($.reason,$.path,$.message,{onWrite:!0}):$}function e($,Z,Q={}){let z=V0($),X;try{X=u(Q.root??L2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw $q(H)}return eB(X,Z,Q),X}function B9($,Z,Q){let z=V0($),X=Q.root??L2(z),H=u(X,z),U=I0(H);if(Q.expect!==void 0)TZ(H,Q.expect,void 0);if(U!==null&&Q.force!==!0&&!Q.owns(U))throw new E("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($);U9(Q,{recursive:!0});let z=w0(Q),X=V0(Q,Z),H=NZ(Q,X);if(H===".."||H.startsWith(`..${Y8}`)||V9(H))throw new E("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 E("git",X,`${X} runs through ${G}, inside .git/ — refused.`,{onWrite:!0});U=Zq(z,X,G)}return U}function Zq($,Z,Q){let z;try{z=FZ(Q)}catch(H){if(Z2(H)!=="ENOENT")throw H;return U9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=w0(Q)}catch{throw new E("dangling",Z,`${Q} is a link to ${Y9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!c$($,X))throw new E("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(t2(X))throw new E("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!o2(X).isDirectory())throw new E("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function Qq($,Z){let Q=V0($),z=w0(V0(Z.root??L2(Q))),X=w0(L2(Q));if(!c$(z,X))throw new E("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=a2(X,$2(Q));if(t2(H))throw new E("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let U;try{U=FZ(H)}catch(J){if(Z2(J)==="ENOENT")return!1;throw J}if(!U.isFile())throw new E("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return TZ(H,Z.expect,void 0),G9(H),!0}function f($){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 W8($,Z){if($===null||$===void 0)return{};if(!f($))throw new E("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 O9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function q9($){return typeof $==="object"&&$.collection===void 0}function zq($,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||!O9.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(o(X)?X.value:X,$.value)?Q:void 0}function Xq($){let Z=$.filter(q9);return $.map((Q)=>{if(!q9(Q)||!O9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,H,U,J)=>zq(X,Z)??z(X,H,U,J)}})}var B8={keepSourceTokens:!0,customTags:Xq};function Hq($,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 Uq($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let H=Hq(Z[X],Z[X+1]);Q??=H.indent,z??=H.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function SZ($,Z){let Q=s2($,B8);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 I2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function i$($,Z){return $.lastIndexOf(`
145
+ `,Z-1)+1}function M9($,Z){if(Z>0&&$[Z-1]===`
146
146
  `)return Z;let Q=$.indexOf(`
147
- `,Z);return Q<0?$.length:Q+1}function B9($,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 O9($,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 _9($){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 M9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&B8($,Z)}function P9($,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(`
147
+ `,Z);return Q<0?$.length:Q+1}function K9($,Z){let Q=Z;if($[Q-1]===`
148
+ `){if(Q--,$[Q-1]==="\r")Q--}return Q}function M0($){return $!==null&&$!==void 0}function H0($){let Z=L0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function _9($,Z){let Q=H0($),z=H0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function P9($){if(o($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return K2($)&&!$.flow}function q8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function F9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&q8($,Z)}function R9($,Z,Q,z){let X=new G8(void 0,B8);X.contents=Z(X);let U=X.toString($.piece).replace(/\n+$/,"").slice(Q),J=U.startsWith(" ")&&!U.includes(`
149
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 AZ($,Z,Q){return P9($,(z)=>{let X=new r2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function zq($,Z,Q){let z=P9($,()=>{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 Xq($){if(!L0($)||!_0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function Hq($,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 Uq($,Z){let Q=X0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function Jq($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function q9($,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?Xq(Q):Q,Y=X?V:Hq(Z,V),W=z.kind==="value"?AZ($,Y,z.col):zq($,Y,z.col);return W?{range:H,keepTail:G,newComment:J,piece:W}:null}function Gq($,Z,Q,z){if(!z)return B9($,I9($,Q[2]));return _9(Z)?B9($,Q[1]):Q[1]}function n$($,Z,Q,z,X){let H=q9($,Z,Q,z);if(!H)return!1;let U=Gq($.src,Z,H.range,H.keepTail);if(H.piece.inline&&(!_9(Z)||z.kind==="item"))return Vq($,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"?q9($,Z,Q,z,!0):H;return G!==null&&Yq($,G.range[0],U,G.piece,z)}function Vq($,Z,Q,z,X){let[H,U]=Z.range,G=H===U&&z.kind==="value"?Jq($.src,H,Z.piece.text):Z.piece.text;D2($,H,Q,G+(X===void 0?"":` #${X}`))}function Yq($,Z,Q,z,X){if(X.kind==="item")return D2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let H=Uq($.src,X.key);if(H<0)return!1;return D2($,H,Q,z.inline?` ${z.text}`:z.text),!0}function Wq($,Z){return B8({...$,comment:void 0},{...Z,comment:void 0})}function Bq($,Z){if(_0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
- `)?void 0:Z.comment}function qq($,Z,Q,z){if(M9(Z,Q))return!0;if(!Wq(Z,Q))return!1;let X=Bq(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return n$($,Z,Q,z,X)}function Kq($,Z,Q,z){if(!B8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return AZ($,Z,0).text===AZ($,Q,0).text||n$($,Z,Q,z);if(Q.items.length===0)return n$($,Z,Q,z);return p(Z)?Oq($,Z,Q):Mq($,Z,Q)}function SZ($,Z,Q,z){if(!O9(Z,Q))return n$($,Z,Q,z);if(s(Z))return qq($,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 Kq($,Z,Q,z)}function F9($,Z){return Z-i$($,Z)}function EZ($,Z,Q){let z=$.slice(i$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function CZ($){return L0($)&&(_0($.commentBefore)||!!$.spaceBefore)}function bZ($,Z,Q){let z=X0(Z)??X0(Q);return z?I9($.src,z[2]):-1}function R9($,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 Dq($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
- `);D2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function N9($,Z,Q,z,X,H){let U=Q;if(U<0){let J=X0(Z);if(!J||CZ(Z)||!EZ($.src,J[0],H))return!1;U=i$($.src,J[0])}return Dq($,U,R9($,z,X)),!0}function Lq($,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 T9($,Z,Q,z){let X=X0(Z);if(!X||!EZ($.src,X[0],z))return!1;let H=bZ($,Q,Z);if(H<0)return!1;return D2($,Lq($.src,Z,X[0]),H,""),!0}function A9($,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&&O9(Z($[U]),Z(X))?U:-1}}function Iq($,Z){return s($)&&s(Z)?M9($,Z):$===Z}function Oq($,Z,Q){let z=Z.items[0]?.key,X=X0(z);if(!X)return!1;let H=F9($.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:bZ($,Z.items[B].value,Z.items[B].key);return N9($,z,L,K,H,!1)},G=A9(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)||!Iq(Z.items[B].key,W.key))return!1;if(Y=[],!SZ($,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)||_q($,Z,B))}function _q($,Z,Q){let z=Z.items[Q],X=X0(z.key);if(!X)return!1;if(EZ($.src,X[0],!1))return T9($,z.key,z.value,!1);let H=Z.items[Q+1],U=X0(H?.key);if(Q!==0||!U||CZ(z.key)||CZ(H.key))return!1;return D2($,X[0],U[0],""),!0}function Mq($,Z,Q){let z=X0(Z);if(!z||Z.items.length===0)return!1;let X=F9($.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:bZ($,Z.items[W]);return N9($,Z.items[0],K,B,X,!0)},J=A9(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=[],!SZ($,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)||T9($,Y,Y,!0))}function Pq($,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 Fq($,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+R9($,Q,0)),!0}function Rq($,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)||Fq($,Z,X);return _0(X)&&SZ($,z,X,{kind:"root"})}function Nq($,Z,Q,z,X){let H={src:$,eol:z,edits:[],piece:X};if(!Rq(H,Z,Q))return null;return Pq($,H.edits)}var K9=($)=>$.replace(/^[ \t]*\n/gm,"");function Tq($,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||K9(H)===K9(Q)}function q8($,Z,Q="YAML"){let{text:z,changed:X}=Aq($,Z,Q);return{text:z,changed:X}}function Aq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),H=wZ(X,Q),U=Cq(H);Z(U);let J={text:$,changed:!1,spliced:!1};if(l(U.toJS(),H.toJS()))return J;let G={lineWidth:0,...Qq(X)},V=U.toString(G);if(V===H.toString(G))return J;let Y=X.includes(`\r
150
+ ${G}`).replace(/\n/g,$.eol);return{inline:J,text:J?U.slice(1):V}}function CZ($,Z,Q){return R9($,(z)=>{let X=new r2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function Jq($,Z,Q){let z=R9($,()=>{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 Gq($){if(!L0($)||!M0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function Vq($,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 Yq($,Z){let Q=H0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function Wq($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function D9($,Z,Q,z,X=!1){let H=H0(Z);if(!H||z.kind==="root")return null;let U=Z.comment,J=L0(Q)?Q.comment:void 0,G=!M0(U)||U===J,V=G?Gq(Q):Q,Y=X?V:Vq(Z,V),W=z.kind==="value"?CZ($,Y,z.col):Jq($,Y,z.col);return W?{range:H,keepTail:G,newComment:J,piece:W}:null}function Bq($,Z,Q,z){if(!z)return K9($,M9($,Q[2]));return P9(Z)?K9($,Q[1]):Q[1]}function n$($,Z,Q,z,X){let H=D9($,Z,Q,z);if(!H)return!1;let U=Bq($.src,Z,H.range,H.keepTail);if(H.piece.inline&&(!P9(Z)||z.kind==="item"))return qq($,H,U,z,X),!0;let J=H.keepTail?Z.comment:H.newComment;if(X!==void 0||M0(J))return!1;let G=z.kind==="value"?D9($,Z,Q,z,!0):H;return G!==null&&Kq($,G.range[0],U,G.piece,z)}function qq($,Z,Q,z,X){let[H,U]=Z.range,G=H===U&&z.kind==="value"?Wq($.src,H,Z.piece.text):Z.piece.text;I2($,H,Q,G+(X===void 0?"":` #${X}`))}function Kq($,Z,Q,z,X){if(X.kind==="item")return I2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let H=Yq($.src,X.key);if(H<0)return!1;return I2($,H,Q,z.inline?` ${z.text}`:z.text),!0}function Dq($,Z){return q8({...$,comment:void 0},{...Z,comment:void 0})}function Lq($,Z){if(M0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
+ `)?void 0:Z.comment}function Iq($,Z,Q,z){if(F9(Z,Q))return!0;if(!Dq(Z,Q))return!1;let X=Lq(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return n$($,Z,Q,z,X)}function Oq($,Z,Q,z){if(!q8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return CZ($,Z,0).text===CZ($,Q,0).text||n$($,Z,Q,z);if(Q.items.length===0)return n$($,Z,Q,z);return l(Z)?Fq($,Z,Q):Nq($,Z,Q)}function EZ($,Z,Q,z){if(!_9(Z,Q))return n$($,Z,Q,z);if(o(Z))return Iq($,Z,Q,z);if(u0(Z))return u0(Q)&&Z.source===Q.source&&q8(Z,Q)||n$($,Z,Q,z);if(!K2(Z)||!K2(Q))return!1;return Oq($,Z,Q,z)}function N9($,Z){return Z-i$($,Z)}function bZ($,Z,Q){let z=$.slice(i$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function jZ($){return L0($)&&(M0($.commentBefore)||!!$.spaceBefore)}function yZ($,Z,Q){let z=H0(Z)??H0(Q);return z?M9($.src,z[2]):-1}function T9($,Z,Q){let z=new G8(void 0,B8);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 Mq($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
+ `);I2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function A9($,Z,Q,z,X,H){let U=Q;if(U<0){let J=H0(Z);if(!J||jZ(Z)||!bZ($.src,J[0],H))return!1;U=i$($.src,J[0])}return Mq($,U,T9($,z,X)),!0}function _q($,Z,Q){let z=i$($,Q),X=Z,H=M0(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 C9($,Z,Q,z){let X=H0(Z);if(!X||!bZ($.src,X[0],z))return!1;let H=yZ($,Q,Z);if(H<0)return!1;return I2($,_q($.src,Z,X[0]),H,""),!0}function j9($,Z){let Q=new Map,z=(X)=>{let H=H0(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&&_9(Z($[U]),Z(X))?U:-1}}function Pq($,Z){return o($)&&o(Z)?F9($,Z):$===Z}function Fq($,Z,Q){let z=Z.items[0]?.key,X=H0(z);if(!X)return!1;let H=N9($.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:yZ($,Z.items[B].value,Z.items[B].key);return A9($,z,L,K,H,!1)},G=j9(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)||!Pq(Z.items[B].key,W.key))return!1;if(Y=[],!EZ($,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)||Rq($,Z,B))}function Rq($,Z,Q){let z=Z.items[Q],X=H0(z.key);if(!X)return!1;if(bZ($.src,X[0],!1))return C9($,z.key,z.value,!1);let H=Z.items[Q+1],U=H0(H?.key);if(Q!==0||!U||jZ(z.key)||jZ(H.key))return!1;return I2($,X[0],U[0],""),!0}function Nq($,Z,Q){let z=H0(Z);if(!z||Z.items.length===0)return!1;let X=N9($.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:yZ($,Z.items[W]);return A9($,Z.items[0],K,B,X,!0)},J=j9(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=[],!EZ($,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)||C9($,Y,Y,!0))}function Tq($,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 Aq($,Z,Q){if(!l(Q)&&!f0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
+ `)?$.eol:"",X=Z.commentBefore?$.eol:"";return I2($,$.src.length,$.src.length,z+X+T9($,Q,0)),!0}function Cq($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!M0(z))return!M0(X)||Aq($,Z,X);return M0(X)&&EZ($,z,X,{kind:"root"})}function jq($,Z,Q,z,X){let H={src:$,eol:z,edits:[],piece:X};if(!Cq(H,Z,Q))return null;return Tq($,H.edits)}var L9=($)=>$.replace(/^[ \t]*\n/gm,"");function wq($,Z,Q,z){let X=s2($,B8);if(X.errors.length>0||!c(X.toJS(),Z.toJS()))return!1;let H=X.toString(z);return H===Q||L9(H)===L9(Q)}function K8($,Z,Q="YAML"){let{text:z,changed:X}=Sq($,Z,Q);return{text:z,changed:X}}function Sq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),H=SZ(X,Q),U=Eq(H);Z(U);let J={text:$,changed:!1,spliced:!1};if(c(U.toJS(),H.toJS()))return J;let G={lineWidth:0,...Uq(X)},V=U.toString(G);if(V===H.toString(G))return J;let Y=X.includes(`\r
155
155
  `)?`\r
156
156
  `:`
157
- `,W=Nq(X,H,U,Y,{...G,verifyAliasOrder:!1}),B=W!==null&&Tq(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 Cq($){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 C9($,Z){return L0(Z)?Z.toJS($):Z}function jq($,Z,Q,z){return z.keepAliases===!0&&u0(Z)||l(C9($,Z),Q)}function K8($,Z,Q,z={}){if(jq($,Z,Q,z))return Z;if(u(Q)&&p(Z))return Sq($,Z,Q,z),Z;if(Array.isArray(Q)&&f0(Z))return yq($,Z,Q,z),Z;if(!u(Q)&&!Array.isArray(Q)&&s(Z))return Z.value=Q,Z;return wq(Z,$.createNode(Q))}function wq($,Z){if(!s($)&&!u0($))return Z;let Q=$,z=Z;if(B2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=TZ(z.commentBefore,Q.commentBefore,Q.comment),Z;if(B2(Z))Z.flow=!0;return z.comment=TZ(z.comment??Q.comment),z.commentBefore=TZ(z.commentBefore??Q.commentBefore),Z}function TZ(...$){let Z=$.filter(_0);return Z.length>0?Z.join(`
158
- `):void 0}function Sq($,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 yZ($,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))yZ($,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 D9($,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 j9($,Z,Q){let z=[];return r$($.contents,[],z),z.filter(({path:X,node:H})=>{let U=D9(Z,X);return U!==void 0&&!l(D9(Q,X),U)&&!l(H.toJS($),U)}).map(({path:X,node:H})=>({path:X.join("."),alias:`*${H.source}`}))}function w9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=Eq(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 Eq($,Z){if(p($)&&typeof Z==="string")return Q2($,Z)?.value;if(f0($)&&typeof Z==="number")return $.items[Z];return}function S9($,Z){let Q=[];r$($.contents,[],Q);let z=[];for(let{path:X,node:H}of Q){let U=w9(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 jZ($,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)jZ(H.value,[...Z,U],Q,z)}else if(f0($))$.items.forEach((H,U)=>jZ(H,[...Z,U],Q,z))}function E9($,Z){let Q=[];r$($.contents,[],Q);let z=new Set(Q.map((U)=>U.node.source));if(z.size===0)return[];let X=[];jZ($.contents,[],z,X);let H=[];for(let{path:U,node:J}of X){let G=w9(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 bq($,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 yq($,Z,Q,z){let X=Z.items,H=X.map((V)=>C9($,V)),U=[],J=0,G=0;for(let[V,Y]of[...bq(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 b9($,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&&!g9(U.value))throw Error(`${Q}: ${H} is not a mapping — faf left it unchanged.`);let J=new r2;if(U)U.value=x9(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=b9($,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 y9($,Z,Q){let z=b9($,Z.slice(0,-1),Q),X=Z[Z.length-1],H=Q2(z,X);if(H&&f0(H.value))return H.value;if(H&&!g9(H.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let U=new p$;if(H)H.value=x9(H.value,U);else z.items.push($.createPair(X,U));return U}function x9($,Z){if(!s($))return Z;let Q=[$.commentBefore,$.comment].filter(_0);if(Q.length>0)Z.commentBefore=Q.join(`
159
- `);return Z}function g9($){if($===null||$===void 0)return!0;return s($)&&($.value===null||$.value===void 0)}var xZ=new WeakMap;function a$($){return typeof $==="object"&&$!==null?xZ.get($):void 0}function L8($,Z){xZ.set($,Z)}function v9($,Z){let Q=a$($);if(Q)xZ.set(Z,Q);return Z}var k9=new WeakSet;function h9($){return k9.add($),$}function u9($){return typeof $==="object"&&$!==null&&k9.has($)}function I8($){let Z=t$($);return h(gZ(Z),Z,{read:!0})}function c9($){if($ instanceof G8)return $;let Z=$?.cause;return Z instanceof G8?Z:null}function d9($,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 xq($){let Z=I8($),Q=Z0(Z),z;try{z=m0(Q)}catch(H){let U=c9(H);if(U)throw d9($,U);throw H}let X=Y8(z,$);return L8(X,{real:Z,text:Q}),X}function i9($){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 gq($,Z){return n9($,Z,void 0)}function n9($,Z,Q,z,X=!1){let H=I8($),U=Z0(H),J=[],G;try{G=q8(U,(V)=>{r9(V,$);let Y=V.clone();if(Z(V),J=S9(Y,V),X)J=[...J,...E9(Y,V)];if(z)J=[...J,...z(V,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(V){let Y=c9(V);if(Y)throw d9($,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 m9($){try{return l9($),!0}catch{return!1}}function vq($){let Z=$.getIn(["project","type"],!0);return s(Z)?Z.value:Z}function r9($,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 kq($,Z,Q){r9($,Q);let z=$.contents,X=p(z)&&z.items.some((Y)=>s(Y.key)&&Y.key.value==="_meta"),{_meta:H,...U}=Z,J=vq($),G=p(z)?$.toJS():{},V=p(z)?z:$.createNode({});if($.contents=V,yZ($,V,G,X?{...Z}:U),!X)uq($,H?.found,J)}function hq($,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 uq($,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 fq($,Z,Q={}){if(!Q.replace&&m9($)){let J=n9($,(G)=>kq(G,Z,$),a$(Z),(G,V)=>j9(G,hq(G,Z),V),u9(Z));L8(Z,{real:I8($),text:J.text});for(let G of J.keptAliases??[])Q.onAliasKept?.(G);return J.written}let z=t$($),X=i9(Z),H=m9($)?I0(h(gZ(z),z)):null,U=e($,X,{expect:H});return L8(Z,{real:U,text:X}),!0}function s9($){return Z0(I8($))}function p9($,Z){let Q;try{Q=l9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return h($,t$(Z),{read:!0}),!0}function o9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=f9($,z);if(p9($,X))return X}let Q=gZ($);if(Q!==$)for(let z of Z){let X=f9(Q,z);if(p9(Q,X))return X}return null}import{statSync as a9}from"fs";import{homedir as mq}from"os";import{parse as pq,resolve as t9}from"path";function e9($,Z){try{let Q=a9($,{bigint:!0}),z=a9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function lq($){let Z=t9($),Q=t9(mq()),z=pq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(e9(Z,Q))return"home";if(e9(Z,z))return"root";return null}function cq($=process.cwd()){return lq($)!==null}import{existsSync as dq,statSync as $Q}from"fs";import{dirname as iq,join as nq}from"path";var rq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],sq=1000;function oq($,Z=iq($)){let Q=$Q($).mtimeMs,z=rq.map((X)=>{let H=nq(Z,X);if(!dq(H))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let U=$Q(H).mtimeMs,J=U-Q,G;if(Math.abs(J)<sq)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 LK}from"path";import{deprecate as IK}from"node:util";import{createHash as QK}from"crypto";import{resolve as zK}from"path";class L2 extends Error{constructor($){super($);this.name="JsonEditError"}}var aq=new Set([" ","\t",`
161
- `,"\r"]);class hZ{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&&aq.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 vZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function kZ($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>kZ(Q,Z[z]));if(vZ($)&&vZ(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&kZ($[z],Z[z]))}return!1}class ZQ{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
157
+ `,W=jq(X,H,U,Y,{...G,verifyAliasOrder:!1}),B=W!==null&&wq(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 Eq($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function c($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>c(Q,Z[z]));if(f($)&&f(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&c($[z],Z[z]))}return!1}function s$($){let Z=o($.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 w9($,Z){return L0(Z)?Z.toJS($):Z}function bq($,Z,Q,z){return z.keepAliases===!0&&u0(Z)||c(w9($,Z),Q)}function D8($,Z,Q,z={}){if(bq($,Z,Q,z))return Z;if(f(Q)&&l(Z))return xq($,Z,Q,z),Z;if(Array.isArray(Q)&&f0(Z))return kq($,Z,Q,z),Z;if(!f(Q)&&!Array.isArray(Q)&&o(Z))return Z.value=Q,Z;return yq(Z,$.createNode(Q))}function yq($,Z){if(!o($)&&!u0($))return Z;let Q=$,z=Z;if(K2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=AZ(z.commentBefore,Q.commentBefore,Q.comment),Z;if(K2(Z))Z.flow=!0;return z.comment=AZ(z.comment??Q.comment),z.commentBefore=AZ(z.commentBefore??Q.commentBefore),Z}function AZ(...$){let Z=$.filter(M0);return Z.length>0?Z.join(`
158
+ `):void 0}function xq($,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=D8($,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 xZ($,Z,Q,z){let X=f(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)&&c(X[H],U))continue;else if(f(U)&&f(X[H])&&l(J.value))xZ($,J.value,X[H],U);else J.value=D8($,J.value,U,{keepAliases:!0})}}function r$($,Z,Q){if(u0($))Q.push({path:[...Z],node:$});else if(l($))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 I9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(f(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function S9($,Z,Q){let z=[];return r$($.contents,[],z),z.filter(({path:X,node:H})=>{let U=I9(Z,X);return U!==void 0&&!c(I9(Q,X),U)&&!c(H.toJS($),U)}).map(({path:X,node:H})=>({path:X.join("."),alias:`*${H.source}`}))}function E9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=gq(Q,Z[X]);let z=Z[Z.length-1];if(l(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)=>H0(H)===void 0?(X.items[z]=U,!0):!1}}return null}function gq($,Z){if(l($)&&typeof Z==="string")return Q2($,Z)?.value;if(f0($)&&typeof Z==="number")return $.items[Z];return}function b9($,Z){let Q=[];r$($.contents,[],Q);let z=[];for(let{path:X,node:H}of Q){let U=E9(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 wZ($,Z,Q,z){if(!L0($)||u0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(l($))for(let H of $.items){let U=s$(H);if(U!==void 0)wZ(H.value,[...Z,U],Q,z)}else if(f0($))$.items.forEach((H,U)=>wZ(H,[...Z,U],Q,z))}function y9($,Z){let Q=[];r$($.contents,[],Q);let z=new Set(Q.map((U)=>U.node.source));if(z.size===0)return[];let X=[];wZ($.contents,[],z,X);let H=[];for(let{path:U,node:J}of X){let G=E9(Z,U);if(!G)continue;let V=J.anchor;if(L0(G.node)&&G.node.anchor===V&&c(J.toJS($),G.node.toJS(Z))||!G.put(J.clone()))continue;H.push({path:U.join("."),alias:`&${V}`,kind:"anchor"})}return H}function vq($,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]=c($[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(c($[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 kq($,Z,Q,z){let X=Z.items,H=X.map((V)=>w9($,V)),U=[],J=0,G=0;for(let[V,Y]of[...vq(H,Q),[X.length,Q.length]]){for(;J<V&&G<Y;J++,G++)U.push(D8($,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(c(Q,z))return Z;if(!f(Q)||!f(z)||!l(Z))return D8($,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(!c(Q[H],U))J.value=o$($,J.value,Q[H],U)}return Z}function x9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new r2,z=$.contents;if(!l(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&&l(U.value)){X=U.value;continue}if(U&&!k9(U.value))throw Error(`${Q}: ${H} is not a mapping — faf left it unchanged.`);let J=new r2;if(U)U.value=v9(U.value,J);else X.items.push($.createPair(H,J));X=J}return X}function L8($,Z,Q,z,X){if(c(Q,z))return;let H=x9($,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 g9($,Z,Q){let z=x9($,Z.slice(0,-1),Q),X=Z[Z.length-1],H=Q2(z,X);if(H&&f0(H.value))return H.value;if(H&&!k9(H.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let U=new p$;if(H)H.value=v9(H.value,U);else z.items.push($.createPair(X,U));return U}function v9($,Z){if(!o($))return Z;let Q=[$.commentBefore,$.comment].filter(M0);if(Q.length>0)Z.commentBefore=Q.join(`
159
+ `);return Z}function k9($){if($===null||$===void 0)return!0;return o($)&&($.value===null||$.value===void 0)}var gZ=new WeakMap;function a$($){return typeof $==="object"&&$!==null?gZ.get($):void 0}function I8($,Z){gZ.set($,Z)}function h9($,Z){let Q=a$($);if(Q)gZ.set(Z,Q);return Z}var u9=new WeakSet;function f9($){return u9.add($),$}function m9($){return typeof $==="object"&&$!==null&&u9.has($)}function O8($){let Z=t$($);return u(kZ(Z),Z,{read:!0})}function vZ($){return $ instanceof ReferenceError&&/Excessive alias count/.test($.message)}function i9($){if($ instanceof V8||vZ($))return $;let Z=$?.cause;return Z instanceof V8||vZ(Z)?Z:null}function n9($,Z){let Q=vZ(Z)?"its aliases expand too far":Z.message.split(`
160
+ `)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=t$($);return new E("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function hq($){let Z=O8($),Q=Q0(Z),z;try{z=m0(Q)}catch(H){let U=i9(H);if(U)throw n9($,U);throw H}let X=W8(z,$);return I8(X,{real:Z,text:Q}),X}function r9($){let Z=$._meta,Q={...$};delete Q._meta;let z=D2(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 uq($,Z){return s9($,Z,void 0)}function s9($,Z,Q,z,X=!1){let H=O8($),U=Q0(H),J=[],G;try{G=K8(U,(V)=>{o9(V,$);let Y=V.clone();if(Z(V),J=b9(Y,V),X)J=[...J,...y9(Y,V)];if(z)J=[...J,...z(V,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(V){let Y=i9(V);if(Y)throw n9($,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 l9($){try{return d9($),!0}catch{return!1}}function fq($){let Z=$.getIn(["project","type"],!0);return o(Z)?Z.value:Z}function o9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!l(Q))throw new E("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 mq($,Z,Q){o9($,Q);let z=$.contents,X=l(z)&&z.items.some((Y)=>o(Y.key)&&Y.key.value==="_meta"),{_meta:H,...U}=Z,J=fq($),G=l(z)?$.toJS():{},V=l(z)?z:$.createNode({});if($.contents=V,xZ($,V,G,X?{...Z}:U),!X)lq($,H?.found,J)}function pq($,Z){let Q=$.contents;if(l(Q)&&Q.items.some((H)=>o(H.key)&&H.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function lq($,Z,Q){if(!Z||Z.length===0||!r(Q))return;let z=$.getIn(["project","type"],!0);if(o(z)&&!r(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function cq($,Z,Q={}){if(!Q.replace&&l9($)){let J=s9($,(G)=>mq(G,Z,$),a$(Z),(G,V)=>S9(G,pq(G,Z),V),m9(Z));I8(Z,{real:O8($),text:J.text});for(let G of J.keptAliases??[])Q.onAliasKept?.(G);return J.written}let z=t$($),X=r9(Z),H=l9($)?I0(u(kZ(z),z)):null,U=e($,X,{expect:H});return I8(Z,{real:U,text:X}),!0}function a9($){return Q0(O8($))}function c9($,Z){let Q;try{Q=d9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return u($,t$(Z),{read:!0}),!0}function t9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=p9($,z);if(c9($,X))return X}let Q=kZ($);if(Q!==$)for(let z of Z){let X=p9(Q,z);if(c9(Q,X))return X}return null}import{statSync as e9}from"fs";import{homedir as dq}from"os";import{parse as iq,resolve as $Q}from"path";function ZQ($,Z){try{let Q=e9($,{bigint:!0}),z=e9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function nq($){let Z=$Q($),Q=$Q(dq()),z=iq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(ZQ(Z,Q))return"home";if(ZQ(Z,z))return"root";return null}function rq($=process.cwd()){return nq($)!==null}import{existsSync as sq,statSync as QQ}from"fs";import{dirname as oq,join as aq}from"path";var tq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],eq=1000;function $K($,Z=oq($)){let Q=QQ($).mtimeMs,z=tq.map((X)=>{let H=aq(Z,X);if(!sq(H))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let U=QQ(H).mtimeMs,J=U-Q,G;if(Math.abs(J)<eq)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 _K}from"path";import{deprecate as PK}from"node:util";import{createHash as UK}from"crypto";import{resolve as JK}from"path";class O2 extends Error{constructor($){super($);this.name="JsonEditError"}}var ZK=new Set([" ","\t",`
161
+ `,"\r"]);class fZ{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 O2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&ZK.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 hZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function uZ($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>uZ(Q,Z[z]));if(hZ($)&&hZ(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&uZ($[z],Z[z]))}return!1}class zQ{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[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(vZ(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(kZ(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(`
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 O2(`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(hZ(U)){if(V.value.kind!=="object")throw new O2(`"${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(uZ(W,U))continue;if(V.value.kind==="object"||V.value.kind==="array")throw new O2(`"${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
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 tq($,Z){let Q=$.includes(`\r
167
+ `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function QK($,Z){let Q=$.includes(`\r
168
168
  `)?`\r
169
169
  `:`
170
170
  `,z=Z.members[0],X=z?$.lastIndexOf(`
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 hZ($).parse();if(z.kind!=="object")throw new L2("the JSON is not an object");let X=new ZQ($,tq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
- `)),QQ($,X.edits)}function QQ($,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 eq($){let Z=new hZ($).parse();if(Z.kind!=="object")throw new L2("the JSON is not an object");return Z}function $K($,Z){let Q=$.lastIndexOf(`
173
- `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function ZK($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if($K($,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 zQ($,Z){let Q=[],z=eq($);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 XQ($,Z){let{count:Q,chain:z}=zQ($,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 uZ($,Z,Q={}){let{count:z,chain:X}=zQ($,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 QQ($,[ZK($,H.obj,H.member)]).text}var UQ="one.faf/render";function mZ($){return`sha256:${QK("sha256").update($,"utf8").digest("hex")}`}var XK=/^sha256:[0-9a-f]{64}$/,HK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,UK='<meta name="faf-render"',JK='<meta name="description" content="Visual render of project.faf.';function GK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(JK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${mZ($)}">
175
- `),Z.join("")}function JQ($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,H)=>{let U=X.replace(/\r?\n$/,""),J=HK.exec(U);if(J)Q.push({at:H,hash:J[1]});else if(U.startsWith(UK))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 fZ=["_meta",UQ];function VK($){return e$($,{_meta:{[UQ]:mZ($)}}).text}function YK($){try{return uZ($,fZ,{dropEmptyParent:!0})??$}catch{return $}}function WK($){let Z;try{Z=XQ($,fZ)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!XK.test(Z.value))return"many";let Q=uZ($,fZ,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function GQ($,Z){return $==="html"?GK(Z):VK(Z)}function BK($,Z){if($==="json")return YK(Z);let Q=JQ(Z);return Q===null||Q==="many"?Z:Q.canonical}function HQ($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?JQ(Q):WK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===mZ(z.canonical)&&GQ(Z,z.canonical)===Q?"match":"mismatch"}function qK($){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 fZ($).parse();if(z.kind!=="object")throw new O2("the JSON is not an object");let X=new zQ($,QK($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
+ `)),XQ($,X.edits)}function XQ($,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 zK($){let Z=new fZ($).parse();if(Z.kind!=="object")throw new O2("the JSON is not an object");return Z}function XK($,Z){let Q=$.lastIndexOf(`
173
+ `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function HK($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(XK($,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 HQ($,Z){let Q=[],z=zK($);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 UQ($,Z){let{count:Q,chain:z}=HQ($,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 mZ($,Z,Q={}){let{count:z,chain:X}=HQ($,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 XQ($,[HK($,H.obj,H.member)]).text}var GQ="one.faf/render";function lZ($){return`sha256:${UK("sha256").update($,"utf8").digest("hex")}`}var GK=/^sha256:[0-9a-f]{64}$/,VK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,YK='<meta name="faf-render"',WK='<meta name="description" content="Visual render of project.faf.';function BK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(WK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${lZ($)}">
175
+ `),Z.join("")}function VQ($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,H)=>{let U=X.replace(/\r?\n$/,""),J=VK.exec(U);if(J)Q.push({at:H,hash:J[1]});else if(U.startsWith(YK))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 pZ=["_meta",GQ];function qK($){return e$($,{_meta:{[GQ]:lZ($)}}).text}function KK($){try{return mZ($,pZ,{dropEmptyParent:!0})??$}catch{return $}}function DK($){let Z;try{Z=UQ($,pZ)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!GK.test(Z.value))return"many";let Q=mZ($,pZ,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function YQ($,Z){return $==="html"?BK(Z):qK(Z)}function LK($,Z){if($==="json")return KK(Z);let Q=VQ(Z);return Q===null||Q==="many"?Z:Q.canonical}function JQ($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?VQ(Q):DK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===lZ(z.canonical)&&YQ(Z,z.canonical)===Q?"match":"mismatch"}function IK($){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 KK($,Z,Q){let z=HQ($,Q);return z!=="match"&&Z!==null&&HQ(Z,Q)==="match"?"match":z}function $6($,Z,Q){let z=zK($),X=h(Q.root,z),H=BK(Q.format,Z),U=GQ(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=qK(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&&!DK(z,J,G,H,Q))return{path:X,result:"unchanged"};return e(X,V,{root:Q.root,expect:J}),{path:X,result:"updated"}}function DK($,Z,Q,z,X){let H=KK(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 VQ=L$.orange,OK=L$.cyan,_K=L$.cyanDeep,MK="#FF9500",PK="#FF3B30",FK="#E6EDF3",RK="#6E7681",YQ={TROPHY:{glyph:"✪",color:VQ},GOLD:{glyph:"★",color:VQ},SILVER:{glyph:"◆",color:OK},BRONZE:{glyph:"◇",color:_K},GREEN:{glyph:"●",color:FK},YELLOW:{glyph:"●",color:MK},RED:{glyph:"○",color:PK},WHITE:{glyph:"♡",color:RK}};function Z$($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var WQ=["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 pZ($,Z,Q="project.faf"){let z=Z$($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=YQ[X]??YQ.WHITE,U=Z.inherited?Z.represents?`inherited from ${Z$(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,G=$.human_context??{},V=WQ.map((q)=>[q,G[q]]),Y=Object.entries(G).filter(([q])=>!WQ.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 OK($,Z,Q){let z=JQ($,Q);return z!=="match"&&Z!==null&&JQ(Z,Q)==="match"?"match":z}function $6($,Z,Q){let z=JK($),X=u(Q.root,z),H=LK(Q.format,Z),U=YQ(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=IK(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&&!MK(z,J,G,H,Q))return{path:X,result:"unchanged"};return e(X,V,{root:Q.root,expect:J}),{path:X,result:"updated"}}function MK($,Z,Q,z,X){let H=OK(Z,Q,X.format);if(H==="match")return!0;if(H==="mismatch")throw new E("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 E("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 E("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 WQ=L$.orange,FK=L$.cyan,RK=L$.cyanDeep,NK="#FF9500",TK="#FF3B30",AK="#E6EDF3",CK="#6E7681",BQ={TROPHY:{glyph:"✪",color:WQ},GOLD:{glyph:"★",color:WQ},SILVER:{glyph:"◆",color:FK},BRONZE:{glyph:"◇",color:RK},GREEN:{glyph:"●",color:AK},YELLOW:{glyph:"●",color:NK},RED:{glyph:"○",color:TK},WHITE:{glyph:"♡",color:CK}};function Z$($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var qQ=["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">${Z$(Z)}</div><div class="v">${Z$(Q)}</div></div>`).join(`
179
+ `)}function cZ($,Z,Q="project.faf"){let z=Z$($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=BQ[X]??BQ.WHITE,U=Z.inherited?Z.represents?`inherited from ${Z$(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,G=$.human_context??{},V=qQ.map((q)=>[q,G[q]]),Y=Object.entries(G).filter(([q])=>!qQ.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">
@@ -225,18 +225,18 @@ ${J?'<p class="award statline"><span class="awd-pre">✅ All Required slots fill
225
225
 
226
226
  <section>
227
227
  <h2>The 6 W's</h2>
228
- ${O8(V)||'<p class="muted">No human_context yet.</p>'}
229
- ${Y.length?O8(Y):""}
228
+ ${M8(V)||'<p class="muted">No human_context yet.</p>'}
229
+ ${Y.length?M8(Y):""}
230
230
  </section>
231
231
 
232
232
  <section>
233
233
  <h2>Project</h2>
234
- ${O8(W)||'<p class="muted">—</p>'}
234
+ ${M8(W)||'<p class="muted">—</p>'}
235
235
  </section>
236
236
 
237
237
  <section>
238
238
  <h2>Stack</h2>
239
- ${K.length?O8(K):'<p class="muted">No active stack slots.</p>'}
239
+ ${K.length?M8(K):'<p class="muted">No active stack slots.</p>'}
240
240
  </section>
241
241
 
242
242
  <footer>
@@ -246,39 +246,39 @@ Rendered on-demand from your current <strong>${Z$(Q)}</strong><br>
246
246
  </div>
247
247
  </body>
248
248
  </html>
249
- `}var NK='<meta name="description" content="Visual render of project.faf.';function TK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(NK)&&Z.includes(" by faf"))}function AK($,Z,Q,z="project.faf",X={}){$6(LK($,"project.html"),pZ(Z,Q,z),{root:$,format:"html",hasMark:TK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var CK=IK(pZ,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as sK}from"path";import{deprecate as oK}from"node:util";var Q$="https://faf.one/ext/context/v1",lZ="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 BQ="JSONRPC",iZ="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",qQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",KQ="1.0",DQ="1.0",cZ={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function LQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function O2($,Z={}){let Q=LQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:iZ}];return[]}function jK($){try{return`https://${z$($)}/.well-known/fafa`}catch{return}}function nZ($,Z,Q={}){let z=S0(Z,Q),X=$.agent??{},H={fafaSpecVersion:String($.version??DQ),mediaTypes:[...M8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)H.agentId=X.id;let U=jK($);if(U)H.passport=U;return{uri:Q$,description:"FAF passport and project DNA as typed parts",required:!1,params:H}}function wK($){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:BQ,protocolVersion:String(W.version??iZ)})),...V?{provider:V}:{},version:U,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:wK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var SK=["mcp","cli","library"],EK=/^[a-z0-9][a-z0-9._-]*$/,bK=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,yK=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,xK=/^[A-Za-z0-9][^\s]*$/,gK=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,vK=["a2a","mcp"],kK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function R($){return String($??"").trim()}function _8($){return Array.isArray($)?$.map(R).filter(Boolean):[]}function hK($){return R($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function uK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!R($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!EK.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!kK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function fK($,Z){return($.skills??[]).filter((Q)=>R(Q.name)).map((Q)=>({name:R(Q.name),type:R(Q.type)||"tool",description:R(Q.description)||R(Q.name),tags:Z.length?Z:[R(Q.name).toLowerCase()]}))}function mK($){let Z=($.packages??[]).filter((Q)=>R(Q.registryType)&&R(Q.identifier));for(let Q of Z){let z=R(Q.registryType),X=R(Q.identifier);if(z==="npm"&&!bK.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!yK.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z==="cargo"&&!gK.test(X))throw Error(`Package "${X}" is not a crate name (e.g. weather-mcp or weather_mcp).`);if(z!=="npm"&&z!=="pypi"&&z!=="cargo"&&!xK.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:R(Q.registryType),identifier:R(Q.identifier),...R(Q.version)?{version:R(Q.version)}:{}}))}function IQ($){if(/\s/.test($))return!1;try{let Z=new URL($);return(Z.protocol==="http:"||Z.protocol==="https:")&&Z.hostname!==""}catch{return!1}}function pK($){if(!IQ(R($.url)))throw Error(`Where it runs: "${R($.url)}" is not an http(s) URL (or give an npm package).`);if(!vK.includes(R($.protocol).toLowerCase()))throw Error(`Protocol "${R($.protocol)}": a2a or mcp.`)}function lK($){let Z=R($.package_kind).toLowerCase()||"mcp";if(!SK.includes(Z))throw Error(`Kind "${R($.package_kind)}" is not one faf knows: mcp, cli or library.`);return Z}function cK($,Z){let Q=($.endpoints??[]).filter((H)=>R(H.url));Q.forEach(pK);let z=lK($),X=[...Q.map((H)=>({protocol:R(H.protocol).toLowerCase(),transport:"http",location:R(H.url)})),...Z.map((H)=>({protocol:z,transport:"stdio",location:H.identifier}))];if(X.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return X}function dK($,Z,Q,z){let X={domain:Z},H=[["repository",R($.repository)],["icon",R($.icon)],["organizationUrl",R($.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 OQ($){let Z=R($.handle).toLowerCase(),Q=hK($.domain);uK($,Z,Q);let z=_8($.tags),X=mK($),H=R($.homepage);if(H&&!IQ(H))throw Error(`Homepage: "${H}" is not an http(s) URL.`);let U={name:Z,displayName:R($.display_name),id:`urn:air:${Q}:agent:${Z}`,...R($.organization)?{vendor:R($.organization)}:{},version:R($.version),description:R($.description),homepage:H||`https://${Q}`,...R($.license)?{license:R($.license)}:{}};return{version:DQ,agent:U,capabilities:fK($,z),endpoints:cK($,X),metadata:{cards:dK($,Q,z,X)}}}function _Q($){return q2($,{lineWidth:0})}function z$($){let Z=R($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=R($.metadata?.cards?.domain);if(z)return z;try{return new URL(R($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function MQ($){let Z=R($.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 rZ($){return`${z$($).split(".").reverse().join(".")}/${MQ($)}`}function dZ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function _2($){return($.endpoints??[]).filter((Z)=>R(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(R(Z.location))).map((Z)=>({type:"streamable-http",url:R(Z.location)}))}function iK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function PQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=R(Z.description),X=R(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let H={name:rZ($),version:X,description:dZ(z)},U=R(Z.displayName);if(U)H.title=dZ(U);let J=R(Z.homepage);if(J)H.websiteUrl=J;let G=iK(R(Q.repository));if(G)H.repository=G;if(R(Q.icon))H.icons=[{src:R(Q.icon)}];return H}function FQ($){return($.metadata?.cards?.packages??[]).map((Z)=>({registryType:R(Z.registryType),identifier:R(Z.identifier),...R(Z.version)?{version:R(Z.version)}:{},transport:{type:"stdio"}}))}function R8($){return($.endpoints??[]).some((Z)=>R(Z.protocol).toLowerCase()==="mcp")}function sZ($){return R8($)&&(_2($).length>0||FQ($).length>0)}function RQ($){let Z=R($.agent?.displayName);return{name:rZ($),...Z?{title:dZ(Z)}:{}}}function N8($,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,...PQ($),remotes:z,...Z?{_meta:{"one.faf/context":S0(Z,Q)}}:{}}}function NQ($,Z,Q={}){let z=_2($),X=FQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");if(!R8($))throw Error("A registry entry describes an MCP server: the .fafa has no mcp endpoint.");return{$schema:qQ,...PQ($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:I2(Z,Q)}:{}}}function nK($,Z,Q){if(!Z.includes("a2a")||O2($,Q).length===0)return;return Q.a2aCardUrl??`https://${z$($)}/.well-known/agent-card.json`}function T8($,Z,Q={}){let z=z$($),X=MQ($),H=$.agent??{},U=R(H.displayName)||R(H.name),J=R(H.description),G=R(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=nK($,Z,Q);if(B)W.push(Y("a2a",cZ.a2a,B));if(Z.includes("server_card")){let K=_2($)[0];if(K)W.push(Y("mcp",cZ.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(Y("agent",cZ.fafa,`https://${z}/.well-known/fafa`));return W}function A8($){let Z=$.agent??{},Q=R(Z.vendor)||R(Z.displayName)||R(Z.name);if(!Q)return;let z;try{z=z$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function TQ($,Z,Q={}){let z=A8($);return{specVersion:KQ,...z?{host:z}:{},entries:T8($,Z,Q)}}function oZ($){let Z=$.metadata?.cards??{},Q=_8(Z.keywords),z=_8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function AQ($,Z,Q={}){let z=A8($),X=oZ($);return{specVersion:KQ,...z?{host:z}:{},entries:T8($,Z,Q).map((H)=>({...H,...X}))}}function CQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:_Q($)},{faf:X}=Z;if(Q.has("a2a")){let U=[...Z.a2aExtensions??[],...X?[nZ($,X,Z)]:[]];z.a2a=F8($,{extensions:U})}if(Q.has("server_card"))z.server_card=N8($,X,Z);if(Q.has("server_json"))z.server_json=NQ($,X,Z);let H={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=TQ($,Z.cards,H);if(Q.has("ard"))z.ard=AQ($,Z.cards,H);return z}function rK($,Z){return CQ(OQ($),Z)}var aK=P8,tK=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function jQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&tK.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 eK($){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:aK,name:jQ($),version:String($.project?.version??"0.1.0"),description:eK($)},z=C8($)??$.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 tZ($){return jQ($)}function C8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function $D($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var aZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function wQ($){let Z=$D($);return aZ(Z)&&aZ(Z._meta)&&aZ(Z._meta["one.faf/context"])}function ZD($,Z,Q={},z={}){let X=Z6(Z,Q),H=sK($,"server-card");return $6(H,`${JSON.stringify(X,null,2)}
250
- `,{root:$,format:"json",hasMark:wQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function QD($,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 zD=oK(Z6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as SQ}from"fs";import{basename as XD,dirname as bQ,join as EQ}from"path";import{deprecate as HD}from"node:util";var UD=["a2a","mcp","registry","catalog","ard"];function JD($){return m0(Z0(h(bQ($),XD($))))}function GD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=EQ($,z);if(SQ(X))return X}let Q=bQ($);if(Q!==$)for(let z of Z){let X=EQ(Q,z);if(SQ(X))return X}return null}function eZ($,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?[nZ($,Z,Q)]:[]})}var VD=HD(eZ,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function YD($,Z={},Q={}){return T8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function WD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function BD($,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=WD(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}var qD="no mcp endpoint in agent.fafa";function KD($){return $!==void 0&&!R8($)}function DD($){let Z=$.project?.type??$.app_type;return typeof Z==="string"&&Z.trim()!==""?Z.trim():void 0}function LD($,Z){if($===void 0||Z!==void 0)return!1;let Q=DD($);return Q!==void 0&&!/^mcp/i.test(Q)}function ID($,Z={}){return[...O2($,Z).length>0?["a2a"]:[],..._2($).length>0?["mcp"]:[],...sZ($)?["registry"]:[],"catalog","ard"]}function OD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=KD(z),H=$.targets?.filter((Y)=>Y==="mcp"||Y==="registry")??[];if(X&&H.length)throw Error(`${H.join(", ")}: ${qD} — these cards describe an MCP server.`);let U=LD(Q,z),J=(Q?UD:z?ID(z,Z):[]).filter((Y)=>!(X||U)||Y!=="mcp"&&Y!=="registry"),G=new Set($.targets?.length?$.targets:J),V={};if(Q)V.block=S0(Q,Z);if(G.has("mcp"))if(z&&_2(z).length>0)V.mcp=N8(z,Q,Z);else if(Q)V.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(G.has("registry"))if(z&&sZ(z))V.registry={...RQ(z),...Q?{_meta:I2(Q,Z)}:{}};else if(Q){let Y=C8(Q);V.registry={name:tZ(Q),...Y?{title:Y}:{},_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(G.has("a2a")||G.has("catalog")||G.has("ard")){if(!$.fafa){if($.targets?.some((Y)=>Y==="a2a"||Y==="catalog"||Y==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(G.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 V.a2a=eZ($.fafa,Q,Z);if((G.has("catalog")||G.has("ard"))&&$.fafa){let Y=YD($.fafa,Q,Z);if(G.has("catalog"))V.catalog=Y;if(G.has("ard")){let B=oZ($.fafa);V.ard=Y.map((K)=>({...K,...B}))}let W=A8($.fafa);if(W)V.catalogHost=W}return _D(V),V}function _D($){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 $1=["ephemeral","standard","high","critical"],z2=Object.fromEntries($1.map(($,Z)=>[$,Z])),j8=new Set(["user","feedback","project","reference"]),Z1=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),Q1=new Set(["facts","sessions","preferences","custom"]),z1={low:"ephemeral",medium:"standard"};import{existsSync as MD}from"fs";import{dirname as hQ,resolve as uQ}from"path";function M2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function PD($){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 FD($){let Z=uQ($),Q=h(hQ(Z),Z,{read:!0});return{real:Q,text:Z0(Q)}}function yQ($,Z,Q,z){let X=uQ($),H=h(hQ(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(z1[$])return z1[$];if($ in z2)return $;return"standard"}var RD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function X1($){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(!RD.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 xQ($){let Z=$;return H$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&H$(Z.extra)&&typeof Z.priority==="string"?Z:X1($)}function ND($){if(typeof $==="string"||H$($)&&"text"in $)return X1($);return null}var gQ=["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(xQ):[],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(!MD($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=FD($);return Y0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=wZ($,Z).toJS();if(!H$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${PD(z)}`);let X=new fQ,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=ND(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(!Q1.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(!Z1.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=yQ($,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=yQ($,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(gQ.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 gQ)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 kQ(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],...kQ(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=y9($,["memory","facts"],Z.path);for(let[V,Y]of U)G.items[Y]=AD($,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=xQ($);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(TD(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 TD($,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 fQ{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:vQ($,Z1),memoryExtra:vQ(Z,Q1)}}}function vQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function kQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function AD($,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 CD,readFileSync as jD,statSync as mQ,existsSync as wD}from"fs";import{join as SD,basename as pQ,resolve as ED}from"path";var lQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),bD=/\[\[([^\]]+)\]\]/g;function yD($){let Z=mQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function xD($){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 gD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!j8.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(bD)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:V,timestamp:yD($),source:`claude-code memory: ${pQ($)}`,extra:G}}function cQ($,Z={}){let Q=ED($);if(!wD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!mQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??lQ,X=Z.namepoint??`@claude-code:${pQ(Q)}`,H=[],U=CD(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=SD(Q,W),K;try{K=jD(B,"utf-8")}catch{continue}let{fm:L,body:q}=xD(K);if(!L)continue;let D=gD(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 sQ="faf-interview/1",J$="(terse — 3-4 words)",H1=[{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}],oQ=[{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$=[...H1,...oQ],aQ=new Map(G$.map(($)=>[$.path,$])),vD=Object.fromEntries(G$.map(($)=>[$.path,$]));function U1($){let Z=aQ.get($);if(Z)return Z.question;let Q=g0.get($)??m.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function kD($,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 hD=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"]),uD=[["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]],dQ=($)=>hD.has($.toLowerCase().trim()),fD=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function iQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&fD.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function tQ($){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=iQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!dQ(X))Z.what=X;let H=uD.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=iQ((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!dQ(J))Z.who=J;return Z}function nQ($,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 rQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!o(Z)}function mD($,Z={}){let Q=$&&typeof $==="object"?$:{},z=nQ(Q,"project.goal"),X=(rQ(z)?String(z).trim():"")||(Z.goal??"").trim(),H=tQ(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=H1.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=nQ(Q,K.path);if(rQ(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:sQ,rows:V,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function w8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||o(Z)}return!1}function pD($,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 eQ($){if($==="project.goal")return!0;return g0.get($)?.category==="human"}function $3($,Z=w8){let Q=[],z=[];for(let X of G$){let H=pD($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(eQ(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function Z3($,Z,Q=w8){let z=$3(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"?J1(z):[];return{status:X,score:$,gaps:z,ask:H}}function J1($){return $.human.map((Z)=>({path:Z,question:U1(Z)}))}function lD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??w8,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=Z3(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:J1(Y.gaps)}:{status:"stuck",score:V,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:V,rounds:H,history:X,ask:J1(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 G1="faf-bench/1",cD={"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 dD($,Z){return cD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var X3=[["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;X3.forEach(($,Z)=>$.forEach((Q)=>Q6.set(Q,Z)));var iD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function S8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function Q3($){return S8($).split(" ").filter((Z)=>Z&&!iD.has(Z))}function H3($,Z){let Q=S8($),z=S8(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=Q3($);if(H.length===0)return!1;let U=new Set(Q3(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 nD($){let Z=H5($),Q=m0($),z=[],X={},H=0;for(let G of m){if(Z.slots[G.path]!=="populated")continue;let V=u1(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:dD(G.path,G.description)}),X[H]=Y}let U=JSON.stringify({v:G1,q:z.map((G)=>[G.path,G.question])}),J=z3("sha256").update(U).digest("hex").slice(0,12);return{version:G1,qsetHash:J,questions:z,answers:X}}function rD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function sD($,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()!==""&&H3($.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 oD($,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 FI,extname as RI,resolve as NI}from"path";var V1={"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 tD}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 eD=V$.flutterDeps,$L=V$.mcpDeps,ZL=V$.serverFrameworks,QL=V$.stateManagement,zL=V$.routing;function XL($){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 E8($){let Z=S($,"pubspec.yaml");if(Z===null)return null;let Q=XL(Z),z=(_)=>Q.has(_.toLowerCase()),X=eD.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),H=$L.find(z),U=ZL.find(([_])=>z(_)),J=QL.find(([_])=>z(_)),G=J?J[1]:"",V=zL.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($,tD("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 UL}from"path";var b8={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 JL=b8.mcpModules,GL=b8.serverFrameworks,VL=b8.cliFrameworks;function YL($){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 J3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function U3($,Z){let Q;for(let z of Z){if(!J3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function WL($,Z){let Q;for(let z of Z){if(!J3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function BL($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function qL($){for(let{name:Z}of v($,"cmd")??[]){let Q=UL("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 KL($){let Z=S($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function y8($){let Z=S($,"go.mod");if(Z===null)return null;let Q=BL(Z),z=YL(Z),X=WL(z,JL),H=U3(z,GL),U=U3(z,VL),J=qL($),G=KL($),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 LL=P2.mcpPackages.map(($)=>$.toLowerCase()),IL=P2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),OL=P2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),_L=P2.grpcServerPackages.map(($)=>$.toLowerCase()),ML=P2.specializedSdks,G3=P2.baseSdk.toLowerCase();function PL($){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 Y1($,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 V3($,Z){let Q;for(let[z,X]of Z){if(!Y1($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function FL($){let Z;for(let Q of LL){if(!Y1($,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 RL($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of ML){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function x8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function NL($,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 TL($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:H,outputType:U}=$,J,G="",V,Y=FL(X),W=RL(z),B=V3(X,OL),K=V3(X,IL),L=_L.some((D)=>Y1(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&&x8(U))J="backend",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!x8(U))J="library",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(x8(U)||!U))J="cli",G=K[1],V=`${Z} + ${K[0]} (C# CLI)`;else if(x8(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()===G3||z.toLowerCase().startsWith(`${G3}/`))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 g8($){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=PL(H),J=TL(U,X),G=NL(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 CL=M0.mcpArtifacts.map(($)=>$.toLowerCase()),jL=M0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),wL=M0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),SL=M0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),TN=M0.androidPlugins.map(($)=>$.toLowerCase()),EL=M0.kmpPlugins.map(($)=>$.toLowerCase()),bL=M0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),yL=M0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),xL=M0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),gL=M0.libraryPlugins.map(($)=>$.toLowerCase()),vL=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function W1($){return vL.some((Z)=>I($,Z))}function kL($){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 hL($){let Z=S($,F2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return kL(Z)}function uL($){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 fL($,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 mL($,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 B3($){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 pL($){let Z;for(let Q of CL)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 q3($,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 lL($){let Z=[],Q=$.plugins,z=$.artifacts,X=EL.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=pL(z),G=z6(Q,jL,"plugin"),V=z6($.parents,wL,"parent"),Y=z6(z,SL,"artifact"),W=z6(Q,yL,"plugin"),B=z6(z,xL,"artifact"),K=gL.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||bL.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 cL($,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 Y3($,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=fL(U,Q),G=mL(U,Q),V=q3($,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 W3($,Z){let Q=S($,F2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=B3(Q),U=q3($,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(!W1($))return null;let Z=hL($),Q=[],z=null;for(let V of["settings.gradle.kts","settings.gradle"])if(I($,V)){z=S($,V);break}let X=z?uL(z):[],H=Y3($,"",Z);if(H)Q.push(H);for(let V of X){let Y=Y3($,V,Z);if(Y)Q.push(Y)}let U=W3($,"");if(U){Q.push(U);let V=S($,"pom.xml");if(V){let{modules:Y}=B3(V);for(let W of Y){let B=W3($,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=lL(V),W=cL(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 iL}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 nL=H6.mcpGems.map(($)=>$.toLowerCase()),rL=H6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),K3=H6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),sL=H6.railsLayoutFiles;function oL($){return I($,"Gemfile")||I($,"gems.rb")||aL($)}function aL($){return(v($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function tL($){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 eL($){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 $I($){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 ZI($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let H=S($,X);if(H){for(let U of tL(H))Z.add(U);Q.push(X)}}let z=S($,"Gemfile.lock")||S($,"gems.locked");if(z){for(let X of eL(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 $I(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 B1($,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 QI($){let Z;for(let Q of nL)if(U6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function D3($){for(let Z of sL)if(I($,Z))return Z;return}function zI($,Z){let Q=B1(Z,K3);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($,iL("bin",U))?.isFile()===!0}).filter((U)=>U!=="rails");if(H.length>0&&!U6(Z,"rails")&&!D3($))return{hit:!0,why:`bin/${H[0]}`}}return{hit:!1,why:""}}function v8($){if(!oL($))return null;let{gems:Z,sources:Q}=ZI($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",H=QI(Z),U=B1(Z,rL),J=D3($),G=U6(Z,"rails")||U6(Z,"railties"),V=zI($,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=B1(Z,K3)?.[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 HI}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 UI=E0.mcpPackageUrls.map(($)=>$.toLowerCase()),JI=E0.mcpProducts.map(($)=>$.toLowerCase()),GI=E0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),VI=E0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),YI=E0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),WI=E0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),BI=E0.appProductTypes,qI=E0.cliProductTypes,KI=E0.vaporLayoutFiles;function DI($){return I($,"Package.swift")||q1($).length>0}function q1($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&O0($,Z)?.isDirectory()===!0)}function LI($){let Z=II($),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 II($){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 OI($,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 L3($,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 I3($,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 _I($){let Z=$.map((Q)=>Q.toLowerCase());return JI.some((Q)=>Z.includes(Q))}function MI($){let Z=!1,Q=!1,z;for(let X of q1($)){let H=S($,HI(X,"project.pbxproj"));if(!H)continue;for(let U of BI)if(H.includes(U))Z=!0,z=U;for(let U of qI)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function PI($){for(let Z of KI)if(I($,Z))return Z;return}function J6($){if(!DI($))return null;let Z=I($,"Package.swift"),Q=q1($),z=Q.length>0,X=null;if(Z){let P=S($,"Package.swift");if(P)X=LI(P)}let H=z?MI($):{hasApplication:!1,hasTool:!1},U=PI($),J=X?.packageUrls??[],G=X?.productNames??[],V=OI(J,UI),Y=_I(G),W=L3(J,GI),B=I3(G,VI),K=L3(J,YI),L=I3(G,WI),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",N,T="",w;if(q)if(N="mcp",T="MCP",Y)w="Package.swift + product MCP (Swift MCP)";else w=`Package.swift + ${V} (Swift MCP)`;else if(D)if(N="backend",T=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)N="app",T="",w=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(_||O&&!D&&!q)if(N="cli",T=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)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:T,packageManager:F,found:w}}var TI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),AI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),CI={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"]},jI=[["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 wI($,Z){for(let[Q,z]of jI)if(Q in $)return z;return Z.length>0?"framework":"config"}function SI($,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 EI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isFile()===!0}function bI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isDirectory()===!0}function yI($){let Z=[],Q=NI($),z=new Set,X=v(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!bI(Q,H):!EI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let G=g8(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=V1[U];if(!J)continue;if(U==="manifest.json"&&SI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let G=E8(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=y8(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=v8(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 xI($){let Z=[];for(let Q of e2($,()=>_3($,2,{count:0}))){let z=V1[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function O3($){let Z=[...yI($),...xI($)],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:wI(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 k8($){let{slotFills:Z}=O3($),Q={};for(let[z,X]of Object.entries(Z)){let H=CI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function _3($,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=RI(H.name);if(AI.has(U))z.add(U);continue}if(TI.has(H.name)||H.name.startsWith("."))continue;for(let U of _3(FI($,H.name),Z-1,Q))z.add(U)}return z}var $0=($,Z,Q)=>({value:$,source:Z,confidence:Q});function M3($,Z={}){let Q=Z.toolingRoot?null:gI($),z=vI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",uI(Q,z)),H("who",fI(z)),H("why",mI(z)),H("where",pI(Q,z)),H("when",lI(z)),H("how",cI(Q,z)),X}function h8($,Z={}){let Q=M3($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function gI($){let Z=S($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function vI($){let Z=S($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
249
+ `}var jK='<meta name="description" content="Visual render of project.faf.';function wK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(jK)&&Z.includes(" by faf"))}function SK($,Z,Q,z="project.faf",X={}){$6(_K($,"project.html"),cZ(Z,Q,z),{root:$,format:"html",hasMark:wK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var EK=PK(cZ,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as eK}from"path";import{deprecate as $D}from"node:util";var Q$="https://faf.one/ext/context/v1",dZ="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 M2($,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 KQ="JSONRPC",rZ="1.0",P8=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],F8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",DQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",LQ="1.0",IQ="1.0",iZ={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function OQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function _2($,Z={}){let Q=OQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:rZ}];return[]}function bK($){try{return`https://${z$($)}/.well-known/fafa`}catch{return}}function sZ($,Z,Q={}){let z=S0(Z,Q),X=$.agent??{},H={fafaSpecVersion:String($.version??IQ),mediaTypes:[...P8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)H.agentId=X.id;let U=bK($);if(U)H.passport=U;return{uri:Q$,description:"FAF passport and project DNA as typed parts",required:!1,params:H}}function yK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&P8.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function R8($,Z={}){let Q=$.agent??{},z=_2($,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&&P8.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:KQ,protocolVersion:String(W.version??rZ)})),...V?{provider:V}:{},version:U,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:yK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var xK=["mcp","cli","library"],gK=/^[a-z0-9][a-z0-9._-]*$/,vK=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,kK=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,hK=/^[A-Za-z0-9][^\s]*$/,uK=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,fK=["a2a","mcp"],mK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function R($){return String($??"").trim()}function _8($){return Array.isArray($)?$.map(R).filter(Boolean):[]}function pK($){return R($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function lK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!R($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!gK.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!mK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function cK($,Z){return($.skills??[]).filter((Q)=>R(Q.name)).map((Q)=>({name:R(Q.name),type:R(Q.type)||"tool",description:R(Q.description)||R(Q.name),tags:Z.length?Z:[R(Q.name).toLowerCase()]}))}function dK($){let Z=($.packages??[]).filter((Q)=>R(Q.registryType)&&R(Q.identifier));for(let Q of Z){let z=R(Q.registryType),X=R(Q.identifier);if(z==="npm"&&!vK.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!kK.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z==="cargo"&&!uK.test(X))throw Error(`Package "${X}" is not a crate name (e.g. weather-mcp or weather_mcp).`);if(z!=="npm"&&z!=="pypi"&&z!=="cargo"&&!hK.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:R(Q.registryType),identifier:R(Q.identifier),...R(Q.version)?{version:R(Q.version)}:{}}))}function MQ($){if(/\s/.test($))return!1;try{let Z=new URL($);return(Z.protocol==="http:"||Z.protocol==="https:")&&Z.hostname!==""}catch{return!1}}function iK($){if(!MQ(R($.url)))throw Error(`Where it runs: "${R($.url)}" is not an http(s) URL (or give an npm package).`);if(!fK.includes(R($.protocol).toLowerCase()))throw Error(`Protocol "${R($.protocol)}": a2a or mcp.`)}function nK($){let Z=R($.package_kind).toLowerCase()||"mcp";if(!xK.includes(Z))throw Error(`Kind "${R($.package_kind)}" is not one faf knows: mcp, cli or library.`);return Z}function rK($,Z){let Q=($.endpoints??[]).filter((H)=>R(H.url));Q.forEach(iK);let z=nK($),X=[...Q.map((H)=>({protocol:R(H.protocol).toLowerCase(),transport:"http",location:R(H.url)})),...Z.map((H)=>({protocol:z,transport:"stdio",location:H.identifier}))];if(X.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return X}function sK($,Z,Q,z){let X={domain:Z},H=[["repository",R($.repository)],["icon",R($.icon)],["organizationUrl",R($.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 _Q($){let Z=R($.handle).toLowerCase(),Q=pK($.domain);lK($,Z,Q);let z=_8($.tags),X=dK($),H=R($.homepage);if(H&&!MQ(H))throw Error(`Homepage: "${H}" is not an http(s) URL.`);let U={name:Z,displayName:R($.display_name),id:`urn:air:${Q}:agent:${Z}`,...R($.organization)?{vendor:R($.organization)}:{},version:R($.version),description:R($.description),homepage:H||`https://${Q}`,...R($.license)?{license:R($.license)}:{}};return{version:IQ,agent:U,capabilities:cK($,z),endpoints:rK($,X),metadata:{cards:sK($,Q,z,X)}}}function PQ($){return D2($,{lineWidth:0})}function z$($){let Z=R($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=R($.metadata?.cards?.domain);if(z)return z;try{return new URL(R($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function FQ($){let Z=R($.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 oZ($){return`${z$($).split(".").reverse().join(".")}/${FQ($)}`}function nZ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function P2($){return($.endpoints??[]).filter((Z)=>R(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(R(Z.location))).map((Z)=>({type:"streamable-http",url:R(Z.location)}))}function oK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function RQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=R(Z.description),X=R(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let H={name:oZ($),version:X,description:nZ(z)},U=R(Z.displayName);if(U)H.title=nZ(U);let J=R(Z.homepage);if(J)H.websiteUrl=J;let G=oK(R(Q.repository));if(G)H.repository=G;if(R(Q.icon))H.icons=[{src:R(Q.icon)}];return H}function NQ($){return($.metadata?.cards?.packages??[]).map((Z)=>({registryType:R(Z.registryType),identifier:R(Z.identifier),...R(Z.version)?{version:R(Z.version)}:{},transport:{type:"stdio"}}))}function N8($){return($.endpoints??[]).some((Z)=>R(Z.protocol).toLowerCase()==="mcp")}function aZ($){return N8($)&&(P2($).length>0||NQ($).length>0)}function TQ($){let Z=R($.agent?.displayName);return{name:oZ($),...Z?{title:nZ(Z)}:{}}}function T8($,Z,Q={}){let z=P2($);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:F8,...RQ($),remotes:z,...Z?{_meta:{"one.faf/context":S0(Z,Q)}}:{}}}function AQ($,Z,Q={}){let z=P2($),X=NQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");if(!N8($))throw Error("A registry entry describes an MCP server: the .fafa has no mcp endpoint.");return{$schema:DQ,...RQ($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:M2(Z,Q)}:{}}}function aK($,Z,Q){if(!Z.includes("a2a")||_2($,Q).length===0)return;return Q.a2aCardUrl??`https://${z$($)}/.well-known/agent-card.json`}function A8($,Z,Q={}){let z=z$($),X=FQ($),H=$.agent??{},U=R(H.displayName)||R(H.name),J=R(H.description),G=R(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=aK($,Z,Q);if(B)W.push(Y("a2a",iZ.a2a,B));if(Z.includes("server_card")){let K=P2($)[0];if(K)W.push(Y("mcp",iZ.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(Y("agent",iZ.fafa,`https://${z}/.well-known/fafa`));return W}function C8($){let Z=$.agent??{},Q=R(Z.vendor)||R(Z.displayName)||R(Z.name);if(!Q)return;let z;try{z=z$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function CQ($,Z,Q={}){let z=C8($);return{specVersion:LQ,...z?{host:z}:{},entries:A8($,Z,Q)}}function tZ($){let Z=$.metadata?.cards??{},Q=_8(Z.keywords),z=_8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function jQ($,Z,Q={}){let z=C8($),X=tZ($);return{specVersion:LQ,...z?{host:z}:{},entries:A8($,Z,Q).map((H)=>({...H,...X}))}}function wQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:PQ($)},{faf:X}=Z;if(Q.has("a2a")){let U=[...Z.a2aExtensions??[],...X?[sZ($,X,Z)]:[]];z.a2a=R8($,{extensions:U})}if(Q.has("server_card"))z.server_card=T8($,X,Z);if(Q.has("server_json"))z.server_json=AQ($,X,Z);let H={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=CQ($,Z.cards,H);if(Q.has("ard"))z.ard=jQ($,Z.cards,H);return z}function tK($,Z){return wQ(_Q($),Z)}var ZD=F8,QD=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function SQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&QD.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 zD($){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:ZD,name:SQ($),version:String($.project?.version??"0.1.0"),description:zD($)},z=j8($)??$.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 $1($){return SQ($)}function j8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function XD($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var eZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function EQ($){let Z=XD($);return eZ(Z)&&eZ(Z._meta)&&eZ(Z._meta["one.faf/context"])}function HD($,Z,Q={},z={}){let X=Z6(Z,Q),H=eK($,"server-card");return $6(H,`${JSON.stringify(X,null,2)}
250
+ `,{root:$,format:"json",hasMark:EQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function UD($,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 JD=$D(Z6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as bQ}from"fs";import{basename as GD,dirname as xQ,join as yQ}from"path";import{deprecate as VD}from"node:util";var YD=["a2a","mcp","registry","catalog","ard"];function WD($){return m0(Q0(u(xQ($),GD($))))}function BD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=yQ($,z);if(bQ(X))return X}let Q=xQ($);if(Q!==$)for(let z of Z){let X=yQ(Q,z);if(bQ(X))return X}return null}function Z1($,Z,Q={}){if(_2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");return R8($,{doorUrl:Q.doorUrl,extensions:Z?[sZ($,Z,Q)]:[]})}var qD=VD(Z1,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function KD($,Z={},Q={}){return A8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function DD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function LD($,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=DD(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}var ID="no mcp endpoint in agent.fafa";function OD($){return $!==void 0&&!N8($)}function MD($){let Z=$.project?.type??$.app_type;return typeof Z==="string"&&Z.trim()!==""?Z.trim():void 0}function _D($,Z){if($===void 0||Z!==void 0)return!1;let Q=MD($);return Q!==void 0&&!/^mcp/i.test(Q)}function PD($,Z={}){return[..._2($,Z).length>0?["a2a"]:[],...P2($).length>0?["mcp"]:[],...aZ($)?["registry"]:[],"catalog","ard"]}function FD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=OD(z),H=$.targets?.filter((Y)=>Y==="mcp"||Y==="registry")??[];if(X&&H.length)throw Error(`${H.join(", ")}: ${ID} — these cards describe an MCP server.`);let U=_D(Q,z),J=(Q?YD:z?PD(z,Z):[]).filter((Y)=>!(X||U)||Y!=="mcp"&&Y!=="registry"),G=new Set($.targets?.length?$.targets:J),V={};if(Q)V.block=S0(Q,Z);if(G.has("mcp"))if(z&&P2(z).length>0)V.mcp=T8(z,Q,Z);else if(Q)V.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(G.has("registry"))if(z&&aZ(z))V.registry={...TQ(z),...Q?{_meta:M2(Q,Z)}:{}};else if(Q){let Y=j8(Q);V.registry={name:$1(Q),...Y?{title:Y}:{},_meta:M2(Q,Z)}}else throw Error("A registry entry needs a package or a remote MCP URL in the .fafa, or a project.faf.");if(G.has("a2a")||G.has("catalog")||G.has("ard")){if(!$.fafa){if($.targets?.some((Y)=>Y==="a2a"||Y==="catalog"||Y==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(G.has("a2a")&&$.fafa)if(_2($.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 V.a2a=Z1($.fafa,Q,Z);if((G.has("catalog")||G.has("ard"))&&$.fafa){let Y=KD($.fafa,Q,Z);if(G.has("catalog"))V.catalog=Y;if(G.has("ard")){let B=tZ($.fafa);V.ard=Y.map((K)=>({...K,...B}))}let W=C8($.fafa);if(W)V.catalogHost=W}return RD(V),V}function RD($){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 Q1=["ephemeral","standard","high","critical"],z2=Object.fromEntries(Q1.map(($,Z)=>[$,Z])),w8=new Set(["user","feedback","project","reference"]),z1=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),X1=new Set(["facts","sessions","preferences","custom"]),H1={low:"ephemeral",medium:"standard"};import{existsSync as ND}from"fs";import{dirname as fQ,resolve as mQ}from"path";function F2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function m($){return $===null||$===void 0}function TD($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(m($))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 AD($){let Z=mQ($),Q=u(fQ(Z),Z,{read:!0});return{real:Q,text:Q0(Q)}}function gQ($,Z,Q,z){let X=mQ($),H=u(fQ(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 E("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(m($))return"standard";if(H1[$])return H1[$];if($ in z2)return $;return"standard"}var CD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function U1($){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(!CD.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(m($.id)&&m($.type)&&$.tags.length===0&&$.links.length===0&&m($.timestamp)&&m($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!m($.id))Q.id=$.id;if(!m($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!m($.timestamp))Q.timestamp=$.timestamp;if(!m($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function vQ($){let Z=$;return H$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&H$(Z.extra)&&typeof Z.priority==="string"?Z:U1($)}function jD($){if(typeof $==="string"||H$($)&&"text"in $)return U1($);return null}var kQ=["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??F2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(vQ):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!m(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||c(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(!ND($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=AD($);return Y0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=SZ($,Z).toJS();if(!H$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${TD(z)}`);let X=new pQ,H=X.pick("memory",z.memory,f)??{},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=jD(J);if(V)U.adopt(V,G)}),U.last_etched=String(z.last_etched??U.created),U._version=m(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($),!m($.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(!X1.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(!z1.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return D2(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")&&c(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&&c(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let G=this.toYaml(),V=gQ($,G,void 0,z);return this.settle($,G,new Map(this._facts.map((Y,W)=>[Y,W])),V),$}let H=new Map,{text:U}=K8(X.text,(G)=>{H=this.applyTo(G,X,Q)},$),J=gQ($,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(kQ.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 kQ)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!c(z.index,X.index)){if(Z.residual.has("index")&&!Q)Y0.refuse(Z,"index","replace it");L8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of uQ(z.extra,X.extra))L8($,[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],...uQ(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(c(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");L8($,["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])=>!c(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=g9($,["memory","facts"],Z.path);for(let[V,Y]of U)G.items[Y]=SD($,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=vQ($);if(!m(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),!m(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=m(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(wD(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:F2(),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(!m(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(!m(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(!m(Q.id))this._byId.set(Q.id,z)}),!0}}function wD($,Z,Q){let z=(X,H)=>m(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:m(Q.priority)?$.priority:U$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:F2(),extra:{...$.extra}}}class pQ{residual=new Map;pick($,Z,Q){if(m(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,f)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,f)??{}),extra:hQ($,z1),memoryExtra:hQ(Z,X1)}}}function hQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function uQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function SD($,Z,Q,z){if(!l(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 ED,readFileSync as bD,statSync as lQ,existsSync as yD}from"fs";import{join as xD,basename as cQ,resolve as gD}from"path";var dQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),vD=/\[\[([^\]]+)\]\]/g;function kD($){let Z=lQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function hD($){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 uD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!w8.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(vD)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:V,timestamp:kD($),source:`claude-code memory: ${cQ($)}`,extra:G}}function iQ($,Z={}){let Q=gD($);if(!yD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!lQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??dQ,X=Z.namepoint??`@claude-code:${cQ(Q)}`,H=[],U=ED(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=xD(Q,W),K;try{K=bD(B,"utf-8")}catch{continue}let{fm:L,body:q}=hD(K);if(!L)continue;let D=uD(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):F2(),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 aQ="faf-interview/1",J$="(terse — 3-4 words)",J1=[{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}],tQ=[{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$=[...J1,...tQ],eQ=new Map(G$.map(($)=>[$.path,$])),fD=Object.fromEntries(G$.map(($)=>[$.path,$]));function G1($){let Z=eQ.get($);if(Z)return Z.question;let Q=g0.get($)??p.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function mD($,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 pD=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"]),lD=[["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]],nQ=($)=>pD.has($.toLowerCase().trim()),cD=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function rQ($,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 $3($){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=rQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!nQ(X))Z.what=X;let H=lD.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=rQ((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!nQ(J))Z.who=J;return Z}function sQ($,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 oQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!r(Z)}function dD($,Z={}){let Q=$&&typeof $==="object"?$:{},z=sQ(Q,"project.goal"),X=(oQ(z)?String(z).trim():"")||(Z.goal??"").trim(),H=$3(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=J1.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=sQ(Q,K.path);if(oQ(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:aQ,rows:V,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function S8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||r(Z)}return!1}function iD($,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 Z3($){if($==="project.goal")return!0;return g0.get($)?.category==="human"}function Q3($,Z=S8){let Q=[],z=[];for(let X of G$){let H=iD($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(Z3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function z3($,Z,Q=S8){let z=Q3(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"?V1(z):[];return{status:X,score:$,gaps:z,ask:H}}function V1($){return $.human.map((Z)=>({path:Z,question:G1(Z)}))}function nD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??S8,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=z3(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:V1(Y.gaps)}:{status:"stuck",score:V,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:V,rounds:H,history:X,ask:V1(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as H3}from"crypto";var Y1="faf-bench/1",rD={"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 sD($,Z){return rD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var U3=[["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;U3.forEach(($,Z)=>$.forEach((Q)=>Q6.set(Q,Z)));var oD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function E8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function X3($){return E8($).split(" ").filter((Z)=>Z&&!oD.has(Z))}function J3($,Z){let Q=E8($),z=E8(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=X3($);if(H.length===0)return!1;let U=new Set(X3(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 aD($){let Z=U5($),Q=m0($),z=[],X={},H=0;for(let G of p){if(Z.slots[G.path]!=="populated")continue;let V=m1(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:sD(G.path,G.description)}),X[H]=Y}let U=JSON.stringify({v:Y1,q:z.map((G)=>[G.path,G.question])}),J=H3("sha256").update(U).digest("hex").slice(0,12);return{version:Y1,qsetHash:J,questions:z,answers:X}}function tD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function eD($,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()!==""&&J3($.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 $L($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:H3("sha256").update(Q).digest("hex")}}import{join as AI,extname as CI,resolve as jI}from"path";var W1={"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 QL}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 zL=V$.flutterDeps,XL=V$.mcpDeps,HL=V$.serverFrameworks,UL=V$.stateManagement,JL=V$.routing;function GL($){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 b8($){let Z=w($,"pubspec.yaml");if(Z===null)return null;let Q=GL(Z),z=(M)=>Q.has(M.toLowerCase()),X=zL.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),H=XL.find(z),U=HL.find(([M])=>z(M)),J=UL.find(([M])=>z(M)),G=J?J[1]:"",V=JL.find(([M])=>z(M)),Y=V?V[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",B=/^executables:\s*$/m.test(Z),K=(k($,"bin")??[]).some((M)=>M.name.endsWith(".dart")),L=B||K,q,D="",O;if(X)if(D="Flutter",I($,QL("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 YL}from"path";var y8={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 WL=y8.mcpModules,BL=y8.serverFrameworks,qL=y8.cliFrameworks;function KL($){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 V3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function G3($,Z){let Q;for(let z of Z){if(!V3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function DL($,Z){let Q;for(let z of Z){if(!V3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function LL($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function IL($){for(let{name:Z}of k($,"cmd")??[]){let Q=YL("cmd",Z),z=O0($,Q);if(z?.isDirectory()){if((k($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function OL($){let Z=w($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function x8($){let Z=w($,"go.mod");if(Z===null)return null;let Q=LL(Z),z=KL(Z),X=DL(z,WL),H=G3(z,BL),U=G3(z,qL),J=IL($),G=OL($),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 R2={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 _L=R2.mcpPackages.map(($)=>$.toLowerCase()),PL=R2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),FL=R2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),RL=R2.grpcServerPackages.map(($)=>$.toLowerCase()),NL=R2.specializedSdks,Y3=R2.baseSdk.toLowerCase();function TL($){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 B1($,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 W3($,Z){let Q;for(let[z,X]of Z){if(!B1($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function AL($){let Z;for(let Q of _L){if(!B1($,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 CL($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of NL){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function g8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function jL($,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 wL($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:H,outputType:U}=$,J,G="",V,Y=AL(X),W=CL(z),B=W3(X,FL),K=W3(X,PL),L=RL.some((D)=>B1(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&&g8(U))J="backend",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!g8(U))J="library",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(g8(U)||!U))J="cli",G=K[1],V=`${Z} + ${K[0]} (C# CLI)`;else if(g8(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()===Y3||z.toLowerCase().startsWith(`${Y3}/`))V=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:G,found:V}}function Y$($){return(k($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function v8($){let Z=Y$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let H=w($,X);if(H===null)continue;let U=TL(H),J=wL(U,X),G=jL(J.appType,J.framework);if(!Q||G<z)Q=J,z=G}return Q}import{join as N2}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 EL=_0.mcpArtifacts.map(($)=>$.toLowerCase()),bL=_0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),yL=_0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),xL=_0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),SN=_0.androidPlugins.map(($)=>$.toLowerCase()),gL=_0.kmpPlugins.map(($)=>$.toLowerCase()),vL=_0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),kL=_0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),hL=_0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),uL=_0.libraryPlugins.map(($)=>$.toLowerCase()),fL=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function q1($){return fL.some((Z)=>I($,Z))}function mL($){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 pL($){let Z=w($,N2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return mL(Z)}function lL($){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 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 dL($,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 K3($){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 iL($){let Z;for(let Q of EL)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 D3($,Z){let Q=new Set,z=!1,X=!1,H=[N2(Z,"src"),N2(Z,"src","main")],U=(J,G)=>{if(G>4)return;let V=k($,J);if(!V)return;for(let{name:Y}of V){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=N2(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 nL($){let Z=[],Q=$.plugins,z=$.artifacts,X=gL.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=iL(z),G=z6(Q,bL,"plugin"),V=z6($.parents,yL,"parent"),Y=z6(z,xL,"artifact"),W=z6(Q,kL,"plugin"),B=z6(z,hL,"artifact"),K=uL.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 M="Java";if($.kotlinSources&&$.javaSources)M="Java/Kotlin";else if($.kotlinSources||vL.some((F)=>p0(Q,F))||X)M="Kotlin";let C=[...new Set(Z)];return{appType:q,framework:D,facets:C,found:O,buildTool:$.buildTool,mainLanguage:M}}function rL($,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 B3($,Z,Q){let z=N2(Z,"build.gradle.kts"),X=N2(Z,"build.gradle"),H=I($,z)?z:I($,X)?X:null;if(!H)return null;let U=w($,H);if(!U)return null;let J=cL(U,Q),G=dL(U,Q),V=D3($,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 q3($,Z){let Q=w($,N2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=K3(Q),U=D3($,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(!q1($))return null;let Z=pL($),Q=[],z=null;for(let V of["settings.gradle.kts","settings.gradle"])if(I($,V)){z=w($,V);break}let X=z?lL(z):[],H=B3($,"",Z);if(H)Q.push(H);for(let V of X){let Y=B3($,V,Z);if(Y)Q.push(Y)}let U=q3($,"");if(U){Q.push(U);let V=w($,"pom.xml");if(V){let{modules:Y}=K3(V);for(let W of Y){let B=q3($,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=nL(V),W=rL(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 oL}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 aL=H6.mcpGems.map(($)=>$.toLowerCase()),tL=H6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),L3=H6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),eL=H6.railsLayoutFiles;function $I($){return I($,"Gemfile")||I($,"gems.rb")||ZI($)}function ZI($){return(k($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function QI($){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 zI($){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 XI($){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 HI($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let H=w($,X);if(H){for(let U of QI(H))Z.add(U);Q.push(X)}}let z=w($,"Gemfile.lock")||w($,"gems.locked");if(z){for(let X of zI(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of k($)??[]){if(!X.endsWith(".gemspec"))continue;let H=w($,X);if(H){for(let U of XI(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 K1($,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 UI($){let Z;for(let Q of aL)if(U6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function I3($){for(let Z of eL)if(I($,Z))return Z;return}function JI($,Z){let Q=K1(Z,L3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of k($)??[]){if(!X.endsWith(".gemspec"))continue;let H=w($,X);if(H&&/executables\s*=/.test(H)&&!/executables\s*=\s*\[\s*\]/.test(H))return{hit:!0,why:`${X} executables`}}let z=k($,"bin");if(z){let H=z.map((U)=>U.name).filter((U)=>{if(U==="setup"||U==="console"||U==="rake")return!1;return O0($,oL("bin",U))?.isFile()===!0}).filter((U)=>U!=="rails");if(H.length>0&&!U6(Z,"rails")&&!I3($))return{hit:!0,why:`bin/${H[0]}`}}return{hit:!1,why:""}}function k8($){if(!$I($))return null;let{gems:Z,sources:Q}=HI($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",H=UI(Z),U=K1(Z,tL),J=I3($),G=U6(Z,"rails")||U6(Z,"railties"),V=JI($,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=K1(Z,L3)?.[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 VI}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 YI=E0.mcpPackageUrls.map(($)=>$.toLowerCase()),WI=E0.mcpProducts.map(($)=>$.toLowerCase()),BI=E0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),qI=E0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),KI=E0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),DI=E0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),LI=E0.appProductTypes,II=E0.cliProductTypes,OI=E0.vaporLayoutFiles;function MI($){return I($,"Package.swift")||D1($).length>0}function D1($){return(k($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&O0($,Z)?.isDirectory()===!0)}function _I($){let Z=PI($),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 PI($){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 FI($,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 O3($,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 M3($,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 RI($){let Z=$.map((Q)=>Q.toLowerCase());return WI.some((Q)=>Z.includes(Q))}function NI($){let Z=!1,Q=!1,z;for(let X of D1($)){let H=w($,VI(X,"project.pbxproj"));if(!H)continue;for(let U of LI)if(H.includes(U))Z=!0,z=U;for(let U of II)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function TI($){for(let Z of OI)if(I($,Z))return Z;return}function J6($){if(!MI($))return null;let Z=I($,"Package.swift"),Q=D1($),z=Q.length>0,X=null;if(Z){let P=w($,"Package.swift");if(P)X=_I(P)}let H=z?NI($):{hasApplication:!1,hasTool:!1},U=TI($),J=X?.packageUrls??[],G=X?.productNames??[],V=FI(J,YI),Y=RI(G),W=O3(J,BI),B=M3(G,qI),K=O3(J,KI),L=M3(G,DI),q=!!(V||Y),D=!!(W||B||U),O=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),M=!!(K||L),C=H.hasApplication,F=Z&&z?"spm+xcode":Z?"spm":"xcode",N,T="",j;if(q)if(N="mcp",T="MCP",Y)j="Package.swift + product MCP (Swift MCP)";else j=`Package.swift + ${V} (Swift MCP)`;else if(D)if(N="backend",T=B?.[1]||W?.[1]||(U?"Vapor":""),B)j=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)j=`Package.swift + ${W[1]} (Swift backend)`;else j=`${U} (Swift backend layout)`;else if(C)N="app",T="",j=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(M||O&&!D&&!q)if(N="cli",T=L?.[1]||K?.[1]||"",L)j=`Package.swift + product ${L[1]} (Swift CLI)`;else if(K)j=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)j="Package.swift + .executable product (Swift CLI)";else j="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Z)N="cli",j=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(N="library",X?.hasLibraryProduct)j="Package.swift + .library product (Swift library)";else j="Package.swift (Swift library)";else N="library",j=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:N,framework:T,packageManager:F,found:j}}var wI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),SI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),EI={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"]},bI=[["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 yI($,Z){for(let[Q,z]of bI)if(Q in $)return z;return Z.length>0?"framework":"config"}function xI($,Z){try{let Q=JSON.parse(w($,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 gI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isFile()===!0}function vI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isDirectory()===!0}function kI($){let Z=[],Q=jI($),z=new Set,X=k(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!vI(Q,H):!gI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let G=v8(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=W1[U];if(!J)continue;if(U==="manifest.json"&&xI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let G=b8(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=x8(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=k8(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 hI($){let Z=[];for(let Q of e2($,()=>P3($,2,{count:0}))){let z=W1[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function _3($){let Z=[...kI($),...hI($)],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:yI(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 h8($){let{slotFills:Z}=_3($),Q={};for(let[z,X]of Object.entries(Z)){let H=EI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function P3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=k($);if(!X)return z;for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=CI(H.name);if(SI.has(U))z.add(U);continue}if(wI.has(H.name)||H.name.startsWith("."))continue;for(let U of P3(AI($,H.name),Z-1,Q))z.add(U)}return z}var $0=($,Z,Q)=>({value:$,source:Z,confidence:Q});function F3($,Z={}){let Q=Z.toolingRoot?null:uI($),z=fI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",lI(Q,z)),H("who",cI(z)),H("why",dI(z)),H("where",iI(Q,z)),H("when",nI(z)),H("how",rI(Q,z)),X}function u8($,Z={}){let Q=F3($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function uI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function fI($){let Z=w($,"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 R2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function kI($){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||kI(z[2])>0.4)return null;return{body:R2(z[2]),heading:z[1].trim()}}function hI($){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 uI($,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("#")&&!hI(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 fI($){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 mI($){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 pI($,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 lI($){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 cI($,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 P3="3.0";import{join as R3}from"path";var F3=[{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 dI($){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 iI($){let Z=S($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function nI($,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=dI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function rI($){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 sI($){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 oI($,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 aI($,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 tI($,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 eI($,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 $O($,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 ZO($,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 QO($,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 zO($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var XO=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"]),N3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,HO=new Set(["frontend","backend","database","css","ui","state"]);function UO($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||u8($,"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")||u8($,"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 f8($){return e2($,()=>JO($))}function JO($){let Z=v($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||XO.has(z.name))continue;let X=R3($,z.name);if(!UO(X))continue;let H=p8(X);if(!H)continue;let U=m8(X).filter((Y)=>HO.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||N3.test(H),hasFramework:!!V,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function GO($,Z){if(Z?.workspaces||I($,"pnpm-workspace.yaml"))return null;let Q=f8($),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 T3($){let Z=f8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(N3.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 u8($,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=R3(...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 VO($,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 u8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!u8(Q,$.pattern))return!1;let z=S(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function m8($){let Z=W0($);return F3.map((Q)=>{let X=Q.signals.filter((H)=>VO(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 p8($){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(W1($)){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 A3($){let Z=W0($),Q=m8($),z=[],X=eI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=nI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=rI($);if(U)return z.push(U),{type:"extension",found:z};let J=QO($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let G=ZO($,Z);if(G)return z.push(G),{type:"saas",found:z};let V=aI($,Z);if(V)return z.push(V),{type:"wasm",found:z};let Y=E8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=y8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=g8($);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=v8($);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=oI($,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(iI($))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"),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 T=zO($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let w=$O($,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=sI($);if(a)return z.push(a),{type:"data-science",found:z};let g=tI($,Z);if(g)return z.push(g),{type:"html",found:z};let A=GO($,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 C3($){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 YO=new Set(["npm","pnpm","yarn","bun"]);function WO($){let Z=W0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return YO.has(Q)?Q:""}function BO($){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 qO=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function j3($){return BO($)||WO($)||(qO.find(([Z])=>I($,Z))?.[1]??"")}function w3($){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 S3($){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 KO=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function DO($){for(let z of KO){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 E3($){let Z=DO($);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 K1($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function b3($){let Z=W0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return K1(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 l8($){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 c8($,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&&LO($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(D1($,"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&&IO($))Q.test="pytest";return Q}function D1($,Z){return S($,Z)??""}function LO($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(D1($,"Cargo.toml"))}function IO($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(D1($,Z)))}function y3($,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 OO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function x3($){return L1($).data}function L1($){let Z=W0($),Q=m8($),z=A3($),X=z.type,H=z.found.some((y)=>y.startsWith("polyglot:")),U=H&&T3($)||p8($),J=C3($),G=j3($),V=w3($),Y=S3($),W=b3($),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"),N=C&&F?"svelte":C?null:null,T=X==="svelte"||N==="svelte",w=T?E3($):null,P=T&&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??(T&&OO(Z)>=5?"Runes":"");break;case"backend":E[k]=T?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(T&&w)E[k]=w;else E[k]=Y??"";break;case"build":E[k]=P?K1(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&&N)j.framework=N;let c=y3($,Z,Q,H?p8($):U);if(H){for(let y of f8($))for(let k of[y.language,y.topFramework])if(k&&!c.includes(k))c.push(k)}let q0=l8($),k1=c8($,Z),K6={faf_version:P3,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(k1).length>0)K6.commands=k1;return{data:K6,facts:E}}var g3={MIN_LENGTH:8,MAX_LENGTH:280},_O=[/^(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<g3.MIN_LENGTH)return!1;if(Z.length>g3.MAX_LENGTH)return!1;if(_O.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
- `).length>4)return!1;return!0}function MO($){let Z=$.split(`
259
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function T2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function mI($){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||mI(z[2])>0.4)return null;return{body:T2(z[2]),heading:z[1].trim()}}function pI($){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 T2(X[1])}return null}function lI($,Z){if($?.description&&$.description.length>20)return $0(T2($.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("#")&&!pI(H));if(z)return $0(T2(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=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 dI($){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 iI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return $0(T2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return $0(T2($.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 nI($){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 rI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return $0(T2(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 R3="3.0";import{join as T3}from"path";var N3=[{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 sI($){let Z=w($,"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 oI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function aI($,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=sI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function tI($){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=w($,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 eI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=w($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=w($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function $O($,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 ZO($,Z){let Q=w($,"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=w($,"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 QO($,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 zO($,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 XO($,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 HO($,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 UO($,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 JO($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var GO=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"]),A3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,VO=new Set(["frontend","backend","database","css","ui","state"]);function YO($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||f8($,"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")||f8($,"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 m8($){return e2($,()=>WO($))}function WO($){let Z=k($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||GO.has(z.name))continue;let X=T3($,z.name);if(!YO(X))continue;let H=l8(X);if(!H)continue;let U=p8(X).filter((Y)=>VO.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||A3.test(H),hasFramework:!!V,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function BO($,Z){if(Z?.workspaces||I($,"pnpm-workspace.yaml"))return null;let Q=m8($),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 C3($){let Z=m8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(A3.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=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function f8($,Z){if(!Z.includes("*"))return I($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(k($)??[]).some((G)=>G.name.startsWith(J))}let z=T3(...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";return(k($,z)??[]).some((J)=>J.name.startsWith(H)&&J.name.endsWith(U))}function qO($,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 f8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!f8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function p8($){let Z=W0($);return N3.map((Q)=>{let X=Q.signals.filter((H)=>qO(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 l8($){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(q1($)){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 j3($){let Z=[];if(I($,"SKILL.md"))Z.push("SKILL.md");for(let Q of["skills",""])for(let z of k($,Q||".")??[]){if(!z.isDirectory()||z.name.startsWith(".")||z.name==="node_modules")continue;if(Q===""&&z.name==="skills")continue;let X=Q?`${Q}/${z.name}/SKILL.md`:`${z.name}/SKILL.md`;if(I($,X))Z.push(X)}return Z}function KO($){let Z=j3($);if(Z.length===0)return null;let Q=[Z.length===1?Z[0]:`${Z.length} SKILL.md folders`];if(I($,".claude-plugin/plugin.json"))return Q.push(".claude-plugin/plugin.json"),{type:"skills-plugin",found:Q};return{type:"skills",found:Q}}function w3($){if(j3($).length===0)return"";return I($,".claude-plugin/plugin.json")?"Claude Code plugin":"Agent Skills"}function S3($){let Z=W0($),Q=p8($),z=[],X=zO($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=aI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=tI($);if(U)return z.push(U),{type:"extension",found:z};let J=UO($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let G=HO($,Z);if(G)return z.push(G),{type:"saas",found:z};let V=ZO($,Z);if(V)return z.push(V),{type:"wasm",found:z};let Y=b8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=x8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=v8($);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=k8($);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=$O($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((y)=>y.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(oI($))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 M=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit");if(Z?.private===!0&&(I($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&M)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(M)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let F=Q.some((y)=>y.category==="frontend"),N=Q.some((y)=>y.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 T=JO($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let j=XO($,Z,Q);if(j)return z.push(j),{type:"website",found:z};if(Q.some((y)=>y.slug==="nextjs"||y.slug==="nuxt"))return z.push(Q.find((y)=>y.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let S=Q.some((y)=>y.category==="frontend"),n=Q.some((y)=>y.category==="backend");if(S&&n)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(S)return z.push("frontend framework"),{type:"frontend",found:z};if(n)return z.push("backend framework"),{type:"backend",found:z};let a=eI($);if(a)return z.push(a),{type:"data-science",found:z};let v=QO($,Z);if(v)return z.push(v),{type:"html",found:z};let A=BO($,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};let b=KO($);if(b)return z.push(...b.found),{type:b.type,found:z};return z.push(y2),{type:"library",found:z}}function E3($){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 DO=new Set(["npm","pnpm","yarn","bun"]);function LO($){let Z=W0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return DO.has(Q)?Q:""}function IO($){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 OO=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function b3($){return IO($)||LO($)||(OO.find(([Z])=>I($,Z))?.[1]??"")}function y3($){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 x3($){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 MO=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function _O($){for(let z of MO){let X=w($,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 g3($){let Z=_O($);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 L1($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function v3($){let Z=W0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return L1(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 c8($){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 d8($,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&&PO($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(I1($,"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&&FO($))Q.test="pytest";return Q}function I1($,Z){return w($,Z)??""}function PO($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(I1($,"Cargo.toml"))}function FO($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(I1($,Z)))}function k3($,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 RO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function h3($){return O1($).data}function O1($){let Z=W0($),Q=p8($),z=S3($),X=z.type,H=z.found.some((x)=>x.startsWith("polyglot:")),U=H&&C3($)||l8($),J=E3($),G=b3($),V=y3($),Y=x3($),W=v3($),B=Q.find((x)=>x.slug==="sveltekit")??Q.find((x)=>x.category==="frontend"),K=Q.find((x)=>x.category==="css"),L=Q.find((x)=>x.category==="ui"),q=Q.find((x)=>x.category==="state"),D=Q.find((x)=>x.category==="backend"),O=Q.find((x)=>x.category==="database"),M=(x)=>x2(X,x)??x2("library",x)===!0,C=X==="framework",F=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit"),N=C&&F?"svelte":C?null:null,T=X==="svelte"||N==="svelte",j=T?g3($):null,P=T&&Q.some((x)=>x.slug==="sveltekit"),S={},n=p.filter((x)=>x.path.startsWith("stack."));for(let x of n){let h=x.path.replace("stack.","");switch(h){case"frontend":S[h]=B?.name??w3($);break;case"css_framework":S[h]=K?.name??"";break;case"ui_library":S[h]=L?.name??"";break;case"state_management":S[h]=q?.name??(T&&RO(Z)>=5?"Runes":"");break;case"backend":S[h]=T?P?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":S[h]=P?"Server Routes":"";break;case"runtime":S[h]=J;break;case"database":S[h]=O?.name??"";break;case"connection":S[h]=O?.name??"";break;case"hosting":if(T&&j)S[h]=j;else S[h]=Y??"";break;case"build":S[h]=P?L1(Z):W??"";break;case"cicd":S[h]=V??"";break;case"package_manager":S[h]=G;break;default:S[h]="";break}}let a={};for(let x of n){let h=x.path.replace("stack.","");a[h]=M(x)?S[h]:"slotignored"}let v={},A=p.filter((x)=>x.path.startsWith("monorepo."));for(let x of A){let h=x.path.replace("monorepo.","");if(!M(x))v[h]="slotignored";else v[h]=""}let b={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(C&&N)b.framework=N;let y=k3($,Z,Q,H?l8($):U);if(H){for(let x of m8($))for(let h of[x.language,x.topFramework])if(h&&!y.includes(h))y.push(h)}let q0=c8($),u1=d8($,Z),K6={faf_version:R3,project:b,stack:a,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:v,_meta:{found:z.found}};if(y.length>0)K6.tech_stack=y;if(q0.length>0)K6.key_files=q0;if(Object.keys(u1).length>0)K6.commands=u1;return{data:K6,facts:S}}var u3={MIN_LENGTH:8,MAX_LENGTH:280},NO=[/^(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<u3.MIN_LENGTH)return!1;if(Z.length>u3.MAX_LENGTH)return!1;if(NO.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
+ `).length>4)return!1;return!0}function TO($){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 PO($){let Q=MO($).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 FO($){let Z=N2($,/^(use\s+cases?|goal)\b/i);if(Z&&P0(Z))return Z;let Q=PO($);if(Q&&P0(Q))return Q;return}function RO($){let Z=N2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&P0(Z))return Z;return}function NO($){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 TO($){let Z=N2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&P0(Z))return Z;return}function AO($){let Z=N2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&P0(Z))return Z;return}function CO($){let Z=N2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&P0(Z))return Z;return}function jO($){let Z=N2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&P0(Z))return Z;return}function I1($){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=FO(z);if(H)X.project={goal:H};let U={},J=RO(z);if(J)U.what=J;let G=NO(z);if(G)U.who=G;let V=TO(z);if(V)U.why=V;let Y=AO(z);if(Y)U.where=Y;let W=CO(z);if(W)U.when=W;let B=jO(z);if(B)U.how=B;if(Object.keys(U).length>0)X.human_context=U;return X}function wO($,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 O1($){let Z=S($,"Cargo.toml");if(Z===null)return{};let Q=wO(Z,"description");if(Q&&P0(Q))return{project:{goal:Q}};return{}}import{join as v3}from"path";var SO=[{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"}],EO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function bO($){let Z=[],Q=(z,X)=>{for(let H of v($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(v3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!EO.has(H.name))Q(v3(z,H.name),X-1)};return Q(".",1),Z}function V6($){return[...$].join(" · ")}function _1($){let Z=bO($);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 SO)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 yO}from"path";var xO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),gO=[{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 M1($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function vO($){let Z=[$];for(let Q of v($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!xO.has(Q.name))Z.push(yO($,Q.name));return Z}function kO($){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 P1($){return e2($,()=>hO($))}function hO($){let Z=[];for(let z of vO($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of gO){let J=S(z,U.file);if(J===null)continue;let G=U.targets(J);if(G.length===0)continue;let V={},Y=M1(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=M1(G,[/^build$/i,/^compile$/i,/^build/i]),B=M1(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:kO(z)),commands:V})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var uO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function F1($){for(let Z of uO)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function fO($,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 R1($){return[I1($),O1($),_1($),P1($),F1($)].reduce(fO,{})}function k3($){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 N1($){let Z=x3($),Q=R1($),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);oO(H);let J=(Z._meta?.found??[]).some((V)=>V.startsWith("polyglot:")),G=l0(H,k8($));return l0(G,{human_context:h8($,{toolingRoot:J})})}function mO($,Z){let Q=sO(Y8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=L1($),H=z,U=l0(Q,R1($)),J=l0(U,H),G=l0(J,k8($)),V=cO(l0(G,{human_context:h8($)}),Q),Y=dO(pO(Z,Q,H)?iO(h3(V,Q),Q,X):h3(V,Q),Q);return h9(v9(Z,Y))}function pO($,Z,Q){if(!o(H0(Z,"project.type"))){let X=a$($)?.text;return X===void 0||!k3(X)}return!(Q._meta?.found??[]).includes(y2)}function T1($){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 lO($,Z){let Q=Z.map((z)=>H0($,z));return Q.some(A2)&&Q.every((z)=>o(z)||A2(z))}function h3($,Z){let Q={...$};for(let z of m){let X=T1(z);if(!lO(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 cO($,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(d8(X)&&o(H))T2(Q,z.canonical,X)}return Q}function dO($,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(d8(X)||A2(X))T2(Q,z.path,X)}return Q}function iO($,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)nO(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0);else rO(H,U)}return H}function nO($,Z,Q,z){let X=T1(Q);for(let U of X)if(A2(H0($,U))&&!A2(H0(Z,U)))T2($,U,C2(Z,U)?H0(Z,U):"");if(!d8(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 rO($,Z){let Q=T1(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 sO($){let Z=$.project;if(Z===null||Z===void 0||u(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function oO($){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 u3($,Z,"")}function aO($){let Z=g0.get($);return Z!==void 0&&Z.category!=="human"}function d8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!o($)&&!A2($)}function tO($,Z){return aO($)&&d8(Z)}function u3($,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(t8(U)){if(tO(J,H))z[X]=H;continue}if(o(U))z[X]=H;else if(u(H)&&u(U))z[X]=u3(U,H,J)}return z}function eO($){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 f3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function $_($,Z={}){let Q=N1($);if(Z.repoUrl&&Q.project&&!W0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=f3(Z.repoUrl);return Q}import{existsSync as m3,lstatSync as Z_}from"fs";import{join as Q_,basename as z_}from"path";import{createHash as X_}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),R0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",H_=/^v?\d+\.\d+\.\d+$/,U_=new Set(["birth","doubled","peak","current"]);function i3($){return B0($)&&F0($.version)&&H_.test($.version)&&R0($.score)}var J_=($)=>R0($.birthDNA)?$.birthDNA:R0($.birthWeight)?$.birthWeight:null,G_=($)=>B0($)&&R0($.birthDNA)&&F0($.born),p3=($)=>B0($)&&F0($.born)&&R0($.birthDNA)&&R0($.lastScore)&&F0($.endedAt),V_=($)=>Array.isArray($)&&$.length>0&&$.every(i3),Y_=($)=>B0($)&&R0($.score)&&F0($.version),W_=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function l3($){return B0($)&&G_($.birthCertificate)&&V_($.versions)&&Y_($.current)&&W_($.growth)}function A1($){try{return Z_($),!0}catch{return!1}}var C1=($)=>`${JSON.stringify($,null,2)}
266
- `,B_=new Set(["version","score","lastSync"]),q_=new Set(["type","score","date","version","label","emoji"]),c3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),j1={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},n3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),r3=($)=>c3($.current,B_)&&n3($).every((Z)=>c3(Z,q_)),K_=($)=>n3($).every((Z)=>Z.label===j1[Z.type].label&&Z.emoji===j1[Z.type].emoji);function D_($){return r3($)&&K_($)}var L_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",I_=".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.",O_=".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.",__=".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.",M_=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function P_($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&U_.has(Z.type)&&R0(Z.score))}var j2=($,Z="")=>F0($)?$:Z;function F_($,Z){if(!Array.isArray($))return[];return $.filter(i3).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 R_($,Z,Q,z){return{version:j2($.version,Z?.version??"v1.0.0"),score:R0($.score)?$.score:Z?.score??Q,lastSync:j2($.lastSync,z)}}function d3($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=J_(Z);if(Q===null)return null;let z=j2(Z.born),X=F_($.versions,Q),H=R_(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:P_(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:j2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(p3)?{priorLineage:$.priorLineage.filter(p3)}:{}}}class s3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=Q_($,".faf-dna")}exists(){let $=m3(this.dnaPath);if(!$&&!A1(this.dnaPath))this.sawNoFile=!0;return $}endingLineage(){let Z=this.dna??(()=>{let z=this.read();return z===null?null:d3(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(!A1(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(!m3(this.dnaPath)){if(!A1(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(l3(Q)&&C1(Q)===Z&&D_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=d3(Q),this.reason=!this.dna?M_:!l3(Q)?L_:C1(Q)!==Z?I_:r3(Q)?__:O_;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 $=C1(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 X_("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=z_(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,...j1[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 QM}from"path";import{existsSync as o_,statSync as qA}from"fs";import{join as Hz}from"path";import{dirname as Zz,resolve as Qz}from"path";var a3=100;var N_="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",T_=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${N_})(?=\\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")],A_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],C_=["","-->","?>",">","]]>"],j_=/[#`~*+_=<>0-9-]/,w_=/(\d{1,9})([.)])/y,S_=/#{1,6}(?:[ \t]+|$)/y,E_=/`{3,}(?!.*`)|~{3,}/y,b_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,y_=/(?:=+|-+)[ \t]*$/y,x_=/[^ \t\f\v\r\n]/;function Y6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var g_=($)=>$==="quote"||$==="list"||$==="item";function v_($){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 k_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var o3=($)=>$==="paragraph"||$==="code"||$==="html";function h_($){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(h_),$.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}>`:C_[$.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"&&o3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!j_.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(!o3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=A_[$.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(b_,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??=v_(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(S_,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(E_,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=T_[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(y_,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&&!x_.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(w_,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(!k_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),g_($.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 -->",t3="\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*w1($){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 u_($,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 S1($,Z,Q){let[z,X]=[new N0(!0),new N0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of w1($)){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)u_(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 e3=($)=>(Z)=>Z===$;function w2($,Z=b0,Q=y0){return S1($,e3(Z),e3(Q))}function $z($,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 f_=16;function m_($){let Z=new N0(!0);return $.map((Q)=>{let z=Z.overflowAt(q$(Q),f_),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 p_($,Z,Q){let X=m_(B6($).map((U)=>{let J=zz(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=$z(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
267
- ${H[0]}`,J=$z(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function l_($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=B6(z).map((H)=>q$(H)===""?`>${H}`:`> ${H}`).join("");return`${Z}
262
+ `)}function AO($){let Q=TO($).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 A2($,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 CO($){let Z=A2($,/^(use\s+cases?|goal)\b/i);if(Z&&P0(Z))return Z;let Q=AO($);if(Q&&P0(Q))return Q;return}function jO($){let Z=A2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&P0(Z))return Z;return}function wO($){let Z=A2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&P0(Z))return Z;return}function SO($){let Z=A2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&P0(Z))return Z;return}function EO($){let Z=A2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&P0(Z))return Z;return}function bO($){let Z=A2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&P0(Z))return Z;return}function yO($){let Z=A2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&P0(Z))return Z;return}function M1($){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=w($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},H=CO(z);if(H)X.project={goal:H};let U={},J=jO(z);if(J)U.what=J;let G=wO(z);if(G)U.who=G;let V=SO(z);if(V)U.why=V;let Y=EO(z);if(Y)U.where=Y;let W=bO(z);if(W)U.when=W;let B=yO(z);if(B)U.how=B;if(Object.keys(U).length>0)X.human_context=U;return X}function xO($,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 _1($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=xO(Z,"description");if(Q&&P0(Q))return{project:{goal:Q}};return{}}import{join as f3}from"path";var gO=[{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"}],vO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function kO($){let Z=[],Q=(z,X)=>{for(let H of k($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(f3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!vO.has(H.name))Q(f3(z,H.name),X-1)};return Q(".",1),Z}function V6($){return[...$].join(" · ")}function P1($){let Z=kO($);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=w($,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 gO)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 hO}from"path";var uO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),fO=[{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 F1($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function mO($){let Z=[$];for(let Q of k($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!uO.has(Q.name))Z.push(hO($,Q.name));return Z}function pO($){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 R1($){return e2($,()=>lO($))}function lO($){let Z=[];for(let z of mO($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of fO){let J=w(z,U.file);if(J===null)continue;let G=U.targets(J);if(G.length===0)continue;let V={},Y=F1(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=F1(G,[/^build$/i,/^compile$/i,/^build/i]),B=F1(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:pO(z)),commands:V})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var cO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function N1($){for(let Z of cO)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function dO($,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 T1($){return[M1($),_1($),P1($),R1($),N1($)].reduce(dO,{})}function m3($){try{let Z=s2($,{logLevel:"error"}).getIn(["project","type"],!0);return o(Z)&&typeof Z.comment==="string"&&Z.comment.includes(y2)}catch{return!1}}function A1($){let Z=h3($),Q=T1($),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);ZM(H);let J=(Z._meta?.found??[]).some((V)=>V.startsWith("polyglot:")),G=l0(H,h8($));return l0(G,{human_context:u8($,{toolingRoot:J})})}function iO($,Z){let Q=$M(W8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=O1($),H=z,U=l0(Q,T1($)),J=l0(U,H),G=l0(J,h8($)),V=sO(l0(G,{human_context:u8($)}),Q),Y=oO(nO(Z,Q,H)?aO(p3(V,Q),Q,X):p3(V,Q),Q);return f9(h9(Z,Y))}function nO($,Z,Q){if(!r(Z0(Z,"project.type"))){let X=a$($)?.text;return X===void 0||!m3(X)}return!(Q._meta?.found??[]).includes(y2)}function C1($){return $.canonical?[$.path,$.canonical]:[$.path]}function Z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return f(X)?X[z]:void 0}function X2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!f(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 H2=($)=>typeof $==="string"&&$.trim()===L6;function rO($,Z){let Q=Z.map((z)=>Z0($,z));return Q.some(H2)&&Q.every((z)=>r(z)||H2(z))}function p3($,Z){let Q={...$};for(let z of p){let X=C1(z);if(!rO(Z,X))continue;for(let H of X){let U=Z0(Z,H);if(Z0(Q,H)!==U)X2(Q,H,U)}}return Q}function C2($,Z){let[Q,z]=Z.split("."),X=$[Q];return f(X)&&Object.prototype.hasOwnProperty.call(X,z)}function sO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!C2(Z,z.canonical)||C2(Z,z.path))continue;let X=Z0(Q,z.path);X2(Q,z.path,void 0);let H=Z0(Q,z.canonical);if(i8(X)&&r(H))X2(Q,z.canonical,X)}return Q}function oO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!C2(Z,z.canonical)||C2(Z,z.path))continue;let X=Z0(Q,z.canonical);if(i8(X)||H2(X))X2(Q,z.path,X)}return Q}function aO($,Z,Q={}){let z=$.project,X=f(z)?z.type:void 0,H={...$};for(let U of p){if(U.category==="human"||U.category==="project")continue;let J=x2(X,U);if(J===null)return $;if(J){let G=typeof X==="string"&&I6[X]?.has(U.path)===!0;tO(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0,G)}else eO(H,U)}return H}function tO($,Z,Q,z,X=!1){let H=C1(Q),U=(G)=>!r(Z0($,G))&&!H2(Z0($,G));for(let G of H){if(!H2(Z0($,G)))continue;if(X)X2($,G,H.some(U)?void 0:"");else if(!H2(Z0(Z,G)))X2($,G,C2(Z,G)?Z0(Z,G):"")}if(!i8(z))return;let J=H.filter((G)=>C2($,G));if(J.some((G)=>!r(Z0($,G))))return;for(let G of J.length>0?J:[Q.path])X2($,G,z)}function eO($,Z){let Q=C1(Z).filter((X)=>C2($,X)),z=(X)=>!r(Z0($,X))&&!H2(Z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(r(Z0($,X)))X2($,X,L6)}function $M($){let Z=$.project;if(Z===null||Z===void 0||f(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function ZM($){let Z=$.project?.type??"library",Q=b2[Z]||b2.library;for(let z of p){if(Q.includes(z.category)||I6[Z]?.has(z.path))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 l3($,Z,"")}function QM($){let Z=g0.get($);return Z!==void 0&&Z.category!=="human"}function i8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!r($)&&!H2($)}function zM($,Z){return QM($)&&i8(Z)}function l3($,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(e8(U)){if(zM(J,H))z[X]=H;continue}if(r(U))z[X]=H;else if(f(H)&&f(U))z[X]=l3(U,H,J)}return z}function XM($){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 c3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function HM($,Z={}){let Q=A1($);if(Z.repoUrl&&Q.project&&!W0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=c3(Z.repoUrl);return Q}import{existsSync as d3,lstatSync as UM}from"fs";import{join as JM,basename as GM}from"path";import{createHash as VM}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),R0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",YM=/^v?\d+\.\d+\.\d+$/,WM=new Set(["birth","doubled","peak","current"]);function o3($){return B0($)&&F0($.version)&&YM.test($.version)&&R0($.score)}var BM=($)=>R0($.birthDNA)?$.birthDNA:R0($.birthWeight)?$.birthWeight:null,qM=($)=>B0($)&&R0($.birthDNA)&&F0($.born),i3=($)=>B0($)&&F0($.born)&&R0($.birthDNA)&&R0($.lastScore)&&F0($.endedAt),KM=($)=>Array.isArray($)&&$.length>0&&$.every(o3),DM=($)=>B0($)&&R0($.score)&&F0($.version),LM=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function n3($){return B0($)&&qM($.birthCertificate)&&KM($.versions)&&DM($.current)&&LM($.growth)}function j1($){try{return UM($),!0}catch{return!1}}var w1=($)=>`${JSON.stringify($,null,2)}
266
+ `,IM=new Set(["version","score","lastSync"]),OM=new Set(["type","score","date","version","label","emoji"]),r3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),S1={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},a3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),t3=($)=>r3($.current,IM)&&a3($).every((Z)=>r3(Z,OM)),MM=($)=>a3($).every((Z)=>Z.label===S1[Z.type].label&&Z.emoji===S1[Z.type].emoji);function _M($){return t3($)&&MM($)}var PM=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",FM=".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.",RM=".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.",NM=".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.",TM=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function AM($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&WM.has(Z.type)&&R0(Z.score))}var j2=($,Z="")=>F0($)?$:Z;function CM($,Z){if(!Array.isArray($))return[];return $.filter(o3).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 jM($,Z,Q,z){return{version:j2($.version,Z?.version??"v1.0.0"),score:R0($.score)?$.score:Z?.score??Q,lastSync:j2($.lastSync,z)}}function s3($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=BM(Z);if(Q===null)return null;let z=j2(Z.born),X=CM($.versions,Q),H=jM(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:AM(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:j2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(i3)?{priorLineage:$.priorLineage.filter(i3)}:{}}}class e3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=JM($,".faf-dna")}exists(){let $=d3(this.dnaPath);if(!$&&!j1(this.dnaPath))this.sawNoFile=!0;return $}endingLineage(){let Z=this.dna??(()=>{let z=this.read();return z===null?null:s3(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(!j1(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(!d3(this.dnaPath)){if(!j1(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(n3(Q)&&w1(Q)===Z&&_M(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=s3(Q),this.reason=!this.dna?TM:!n3(Q)?PM:w1(Q)!==Z?FM:t3(Q)?NM:RM;return this.text=Z,this.dna}read(){let $;try{$=Q0(u(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 $=w1(this.dna),Z=this.text??(this.sawNoFile?null:I0(u(this.projectPath,".faf-dna")));e(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return VM("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=GM(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,...S1[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 J_}from"path";import{existsSync as Z_,statSync as OA}from"fs";import{join as Vz}from"path";import{dirname as Hz,resolve as Uz}from"path";var Zz=100;var wM="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",SM=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${wM})(?=\\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")],EM=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],bM=["","-->","?>",">","]]>"],yM=/[#`~*+_=<>0-9-]/,xM=/(\d{1,9})([.)])/y,gM=/#{1,6}(?:[ \t]+|$)/y,vM=/`{3,}(?!.*`)|~{3,}/y,kM=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,hM=/(?:=+|-+)[ \t]*$/y,uM=/[^ \t\f\v\r\n]/;function Y6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var fM=($)=>$==="quote"||$==="list"||$==="item";function mM($){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 pM($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var $z=($)=>$==="paragraph"||$==="code"||$==="html";function lM($){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(lM),$.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}>`:bM[$.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"&&$z(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!yM.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(!$z($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=EM[$.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(kM,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??=mM(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(gM,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(vM,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=SM[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(hM,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&&!uM.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(xM,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(!pM(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),fM($.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 -->",Qz="\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$/,""),Jz=($)=>q$($).replace(/^\uFEFF/,"").trimEnd();function*E1($){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 cM($,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 b1($,Z,Q){let[z,X]=[new N0(!0),new N0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of E1($)){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)cM(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 zz=($)=>(Z)=>Z===$;function w2($,Z=b0,Q=y0){return b1($,zz(Z),zz(Q))}function Xz($,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 dM=16;function iM($){let Z=new N0(!0);return $.map((Q)=>{let z=Z.overflowAt(q$(Q),dM),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 nM($,Z,Q){let X=iM(B6($).map((U)=>{let J=Jz(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=Xz(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
267
+ ${H[0]}`,J=Xz(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function rM($,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=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(l_(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 E1($,Z=b0,Q=y0){return`${Z}
270
- ${p_($.trim(),Z,Q)}
271
- ${Q}`}function i8($,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(t3)?t3:"";return W6(U,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(rM(Z,z,X));if(J===null)throw new E("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 y1($,Z=b0,Q=y0){return`${Z}
270
+ ${nM($.trim(),Z,Q)}
271
+ ${Q}`}function n8($,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(Qz)?Qz:"";return W6(U,Z,`
273
273
 
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=E1(Z,Q,z),U=Qz($),J=X.root??Zz(U),G=h(J,U),V=q6(G);e(G,i8(V,H,Q,z,U),{root:J,expect:V})}var c_="<!-- faf:";function d_($){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 i_($,Z){let Q=[new N0(!0),new N0(!1)],z=!1;for(let{content:X}of w1($)){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 n_($,Z,Q){let z=[new N0(!0),new N0(!1)];for(let{content:X}of w1($)){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 n8($,Z,Q=b0,z=y0){if(Z===null||w2(Z,Q,z))return null;let X=zz(B6(Z)[0]??"");if(X.startsWith(c_)&&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=i_(Z,Q);if(H==="too deep")return`${$}: faf's block is now on top; the file nests more than ${a3} 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 ${d_(H)} and is left as you had it — delete it by hand if you no longer want it.`;if(n_(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 r_($,Z,Q=b0,z=y0,X={}){try{let H=Qz($);return n8(Z,q6(h(X.root??Zz(H),H)),Q,z)}catch{return null}}var s_=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 b1($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return s_.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 b1(Q)}var y1=t.claude,a_="STATUS: SYNC ACTIVE";function t_($){let Z=Hz($,y1);if(!o_(Z))return null;return Z0(h($,y1))}function e_($,Z){T0(Hz($,y1),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 $M($){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(`*${a_} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
- `)}function Xz($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function ZM($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=Xz(Q[1].trim());if(!Z.project.name){let H=$.match(/\*\*Name:\*\*\s*(.+)/);if(H)Z.project.name=Xz(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),Uz=($)=>Array.isArray($)?$.join(", "):String($),zM=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),XM=new Set(["target_user","core_problem","mission_purpose"]);function Jz($){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 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[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 T=new Map,w=(A)=>{if(!A)return;for(let[j,c]of Object.entries(A)){if(zM.has(j)||!U0(c))continue;let q0=b1(j);if(!T.has(q0))T.set(q0,Uz(c))}};w(z?.working_style),w(X);let P=$.conventions??[];if(T.size||P.length){Q("## Conventions"),Q();for(let[A,j]of T)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: ${Uz(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(XM.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 HM($,Z){T0(QM($,t.agents),Jz(Z))}import{join as UM}from"path";var JM=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),GM=new Set(["target_user","core_problem","mission_purpose"]);function Gz($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,H=z?Object.entries(z).filter(([,B])=>JM(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(GM.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 VM($,Z){T0(UM($,t.gemini),Gz(Z))}import{join as YM}from"path";function Vz($){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 WM($,Z){T0(YM($,t.cursorrules),Vz(Z),"# faf:start","# faf:end")}import{join as BM}from"path";var Yz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],qM=new Set([...Yz.map(([$])=>$),"cicd"]);function Wz($){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(qM.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 Yz){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 KM($,Z){$$($,".github"),T0(BM($,".github",t.copilot),Wz(Z),b0,y0,{root:$})}import{existsSync as DM,lstatSync as Lz,readFileSync as s8,realpathSync as x1,statSync as LM}from"fs";import{homedir as IM}from"os";import{basename as OM,dirname as g1,join as A0,resolve as E2}from"path";var Bz=200,qz=200,Kz=12,_M="# Project Context (from project.faf)",MM="*This section is managed by tri-sync.";function PM($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function Iz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=Bz)return Z;return`${Z.slice(0,Bz)}-${Math.abs(PM($)).toString(36)}`}function Oz($){try{let Z=Lz($);if(Z.isSymbolicLink()){let Q=LM($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function Dz($){try{return Lz($).isFile()}catch{return!1}}function FM($){let Z=$;for(;;){if(Oz(A0(Z,".git")))return Z;let Q=g1(Z);if(Q===Z)return null;Z=Q}}function RM($){let Z;try{Z=s8(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(!Dz(z))return $;let X=E2(Q,s8(z,"utf-8").trim());if(E2(g1(Q))!==A0(X,"worktrees"))return $;let H=A0(Q,"gitdir");if(!Dz(H))return $;let U=s8(H,"utf-8").trim();if(x1(E2(Q,U))!==A0(x1($),".git"))return $;if(OM(X)!==".git")return Oz(A0(X,".git"))?$:X;return g1(X)}catch{return $}}function _z($){let Z=E2($);try{Z=x1.native(Z)}catch{}let Q=FM(Z);return(Q?RM(Q):Z).normalize("NFC")}function a8($,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(IM(),".claude");return A0(E2(Q),"projects",Iz(_z($)),"memory").normalize("NFC")}function NM($,Z={}){return A0(a8($,Z),t.memory)}var TM=new Set(["target_user","core_problem","mission_purpose"]),AM=["who","what","why","where","when","how"];function Mz($){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}`),...r8("Stack",Object.entries($.stack??{}).filter(([U,J])=>!TM.has(U)&&i(J)).map(([U,J])=>`- **${Q0(`stack.${U}`)}:** ${J}`)),...r8("Context",AM.filter((U)=>i(z[U])).map((U)=>`- **${Q0(`human_context.${U}`)}:** ${z[U]}`)),...r8("Commands",Object.entries($.commands??{}).filter(([,U])=>i(U)).slice(0,Kz).map(([U,J])=>`- ${U}: \`${X2(J)}\``)),...r8("Key files",X.filter(i).slice(0,Kz).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 r8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function Pz($){return S1($,(Z)=>Z.trimEnd()===_M,(Z)=>Z.startsWith(MM))}function o8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function CM($,Z,Q){if($===null)return{text:i8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=w2($),X=z??Pz($);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:i8($,Z,void 0,void 0,Q),action:"added",head:H,tail:$.slice(H.length)}}function v1($){return $>qz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${qz}; lines after that are kept in the file but not loaded.`]:[]}function jM($,Z={}){let Q=a8($,Z),z=A0(Q,t.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!DM(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=o8(H);return{path:z,exists:!0,lines:G,hasBlock:U!==null,blockLines:U?o8(H.slice(U.start,U.end)):0,hasLegacySection:!U&&Pz(H)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((V)=>V.replace(/^\uFEFF/,"").trim()!=="").length,warnings:v1(G)}}function wM($,Z,Q={}){let z=a8($,Q);$$(z);let X=h(z,t.memory),H=q6(X),U=CM(H,E1(Mz(Z)),X);if(U.text===H){let B=o8(H);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:v1(B)}}let J=e(X,U.text,{root:z,expect:H}),G=s8(J,"utf-8"),V=G===U.text&&G.startsWith(U.head)&&G.endsWith(U.tail),Y=o8(G),W=U.action==="added"?n8(t.memory,H):null;return{path:J,action:U.action,written:!0,preserved:V,lines:Y,warnings:[...W?[W]:[],...v1(Y)]}}function SM($,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 EM($,Z){let Q={...Z},z=null,X=S($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let H=c8($,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=l8($);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=SM($,z);if(J.length)Q.conventions=J}return Q}export{ZD as writeServerCard,AK as writeProjectHtml,VM as writeGeminiMd,fq as writeFaf,WM as writeCursorrules,KM as writeCopilotInstructions,wM as writeClaudeMemory,e_ as writeClaudeMd,HM as writeAgentsMd,mz as validateFaf,M2 as utcNow,BD as upsertCatalog,gq as updateFafFile,mO as updateExistingFaf,k8 as turboCatSlots,O3 as turboCatScan,Cz as slotsByCategory,i9 as serializeFaf,tQ as seedSixWsFromGoal,fz as scoreText,H5 as scoreFafYaml,e as safeWriteFile,tB as safeUnlink,Y9 as safeReplaceOwned,lD as runLoop,h as resolveInside,NM as resolveClaudeMemoryPath,a8 as resolveClaudeMemoryDir,f3 as repoNameFromUrl,pZ as renderProjectHtml,Gz as renderGeminiMd,Vz as renderCursorrules,Wz as renderCopilotInstructions,Mz as renderClaudeMemory,$M as renderClaudeMd,Jz as renderAgentsMd,M3 as relentlessContextDetailed,h8 as relentlessContext,C8 as registryTitle,tZ as registryName,I2 as registryMeta,Z0 as readUtf8,JD as readFafa,s9 as readFafRaw,xq as readFaf,t_ as readClaudeMd,U1 as questionForSlot,rD as publicQuestions,NQ as projectServerJson,N8 as projectServerCard,CQ as projectPack,OD as projectCards,AQ as projectArd,TQ as projectAiCatalog,F8 as projectA2ACard,QD as patchServerJson,ZM as parseClaudeMd,eO as normalizeGitUrl,S8 as normalizeAnswer,rZ as mcpName,$$ as makeDirInside,Z3 as loopVerdict,r_ as legacyStampNoteAt,n8 as legacyStampNote,X5 as kernel,o as isPlaceholder,cq as isNonProjectRoot,eQ as isHumanSlot,Sz as isExplicitNone,w8 as isEmptyValue,kD as interviewForMissing,T0 as injectFafBlock,sD as gradeAnswers,O$ as getTier,bz as getNextTier,zD as generateServerCard,CK as generateProjectHtml,VD as generateA2ACard,cQ as fromClaudeDir,GD as findFafaFile,o9 as findFafFile,w2 as findFafBlock,l0 as fillEmpties,_Q as fafaYaml,z$ as fafaDomain,x0 as fafMetaTag,S0 as fafContextBlock,c1 as enrichScore,EM as enrichFromRepo,nD as deriveQuestionSet,oq as computeDrift,_z as claudeProjectRoot,Iz as claudeProjectId,jM as claudeMemoryStatus,$3 as classifyGaps,U$ as canonicalPriority,mD as buildTableOf8,Z6 as buildServerCard,oD as buildReceipt,rK as buildPack,eZ as buildA2ACard,$_ as authorFafFromRepo,N1 as assembleFreshFaf,OQ as answersToFafa,H3 as answersMatch,v0 as TIERS,b as SafePathError,oQ as STACK_INTERVIEW,g0 as SLOT_BY_PATH,m as SLOTS,L6 as SLOTIGNORED,H1 as SIX_WS_INTERVIEW,qQ as SERVER_JSON_SCHEMA,P8 as SERVER_CARD_SCHEMA,lZ as REGISTRY_PUBLISHER_KEY,z2 as PRIORITY_RANK,$1 as PRIORITY_ORDER,D6 as PLACEHOLDERS,j8 as KNOWLEDGE_TYPES,sQ as INTERVIEW_VERSION,vD as INTERVIEW_PATHS,aQ as INTERVIEW_BY_PATH,G$ as INTERVIEW,Y0 as FafmSoul,s3 as FafDNAManager,b0 as FAF_START,L$ as FAF_HEX,y0 as FAF_END,f1 as EXPLICIT_NONE,wz as ENTERPRISE_SLOTS,G1 as BENCH_VERSION,jz as BASE_SLOTS,X3 as ALIAS_GROUPS,Q$ as A2A_CONTEXT_URI};
274
+ ${$.slice(U.length)}`,Q,z,X)}function q6($){try{return Q0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function T0($,Z,Q=b0,z=y0,X={}){let H=y1(Z,Q,z),U=Uz($),J=X.root??Hz(U),G=u(J,U),V=q6(G);e(G,n8(V,H,Q,z,U),{root:J,expect:V})}var sM="<!-- faf:";function oM($){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 aM($,Z){let Q=[new N0(!0),new N0(!1)],z=!1;for(let{content:X}of E1($)){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 tM($,Z,Q){let z=[new N0(!0),new N0(!1)];for(let{content:X}of E1($)){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 r8($,Z,Q=b0,z=y0){if(Z===null||w2(Z,Q,z))return null;let X=Jz(B6(Z)[0]??"");if(X.startsWith(sM)&&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=aM(Z,Q);if(H==="too deep")return`${$}: faf's block is now on top; the file nests more than ${Zz} 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 ${oM(H)} and is left as you had it — delete it by hand if you no longer want it.`;if(tM(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 eM($,Z,Q=b0,z=y0,X={}){try{let H=Uz($);return r8(Z,q6(u(X.root??Hz(H),H)),Q,z)}catch{return null}}var $_=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 x1($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return $_.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function i($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function z0($){let Z=g0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return x1(Q)}var g1=t.claude,Q_="STATUS: SYNC ACTIVE";function z_($){let Z=Vz($,g1);if(!Z_(Z))return null;return Q0(u($,g1))}function X_($,Z){T0(Vz($,g1),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 H_($){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(`**${z0(`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])=>`- **${z0(`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(`*${Q_} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
+ `)}function Gz($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function U_($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=Gz(Q[1].trim());if(!Z.project.name){let H=$.match(/\*\*Name:\*\*\s*(.+)/);if(H)Z.project.name=Gz(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 U2($){return S2($).cmd}var U0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Yz=($)=>Array.isArray($)?$.join(", "):String($),G_=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),V_=new Set(["target_user","core_problem","mission_purpose"]);function Wz($){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 b=A.toLowerCase();if(/install|deps/.test(b))return 0;if(/^build$|build/.test(b)&&!/rebuild/.test(b))return 1;if(/^dev$|develop/.test(b))return 2;if(/^start$|run/.test(b))return 3;return 4},q=[...K].sort((A,b)=>L(A[0])-L(b[0])||A[0].localeCompare(b[0])),D=[...W,...B],O=q.find(([A])=>/build/i.test(A)),M=W[0]?U2(W[0][1]):void 0,C=O?U2(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 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[A,b]of q){let{cmd:y,note:q0}=S2(b);Q(`${y} # ${q0??A}`)}Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,A]of D){let{cmd:b,note:y}=S2(A);Q(y?`${b} # ${y}`:b)}Q("```"),Q()}if(G&&G.length){Q("## Where things live"),Q();let A=G.map((b)=>{let y=String(b),q0=y.indexOf(" — ");return q0>0?{path:y.slice(0,q0),role:y.slice(q0+3)}:{path:y,role:""}});if(A.some((b)=>b.role)){Q("| Path | Role |"),Q("|------|------|");for(let b of A)Q(`| \`${b.path}\` | ${b.role} |`)}else for(let b of A)Q(`- \`${b.path}\``);Q()}let T=new Map,j=(A)=>{if(!A)return;for(let[b,y]of Object.entries(A)){if(G_.has(b)||!U0(y))continue;let q0=x1(b);if(!T.has(q0))T.set(q0,Yz(y))}};j(z?.working_style),j(X);let P=$.conventions??[];if(T.size||P.length){Q("## Conventions"),Q();for(let[A,b]of T)Q(`- **${A}:** ${b}`);for(let A of P)if(U0(A))Q(`- ${A}`);Q()}let S=(z?.warnings??[]).filter((A)=>U0(A)),n=["read the tree"];if(M)n.push(`run the tests (\`${M}\`)`);if(C)n.push("build the project");for(let[,A]of B.slice(0,1))n.push(`\`${U2(A)}\``);Q("## Guardrails"),Q();for(let A of S)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(`\`${U2(A)}\` exits 0`);for(let[,A]of W)a.push(`\`${U2(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: ${Yz(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[b,y]of Object.entries($.stack)){if(V_.has(b))continue;if(i(y))A.push(`- **${z0(`stack.${b}`)}:** ${y.trim()}`)}if(A.length){Q("## Stack"),Q();for(let b of A)Q(b);Q()}}let v=$.generated;if(U0(v))Q(`*Context authored: ${String(v)}*`);return Z.join(`
277
+ `)}function Y_($,Z){T0(J_($,t.agents),Wz(Z))}import{join as W_}from"path";var B_=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),q_=new Set(["target_user","core_problem","mission_purpose"]);function Bz($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,H=z?Object.entries(z).filter(([,B])=>B_(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(q_.has(K))continue;if(i(L))B.push(`- ${z0(`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 K_($,Z){T0(W_($,t.gemini),Bz(Z))}import{join as D_}from"path";function qz($){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(`# ${z0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
279
+ `)}function L_($,Z){T0(D_($,t.cursorrules),qz(Z),"# faf:start","# faf:end")}import{join as I_}from"path";var Kz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],O_=new Set([...Kz.map(([$])=>$),"cicd"]);function Dz($){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(O_.has(V))continue;if(i(Y))X.push(`- **${z0(`stack.${V}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let H=[];for(let[V,Y]of Kz){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])=>`- **${z0(`human_context.${V}`)}:** ${Y.trim()}`);if(G.length>0)Z.push("## Project context","",...G,"");return Z.join(`
280
+ `)}function M_($,Z){$$($,".github"),T0(I_($,".github",t.copilot),Dz(Z),b0,y0,{root:$})}import{existsSync as __,lstatSync as _z,readFileSync as o8,realpathSync as v1,statSync as P_}from"fs";import{homedir as F_}from"os";import{basename as R_,dirname as k1,join as A0,resolve as E2}from"path";var Lz=200,Iz=200,Oz=12,N_="# Project Context (from project.faf)",T_="*This section is managed by tri-sync.";function A_($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function Pz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=Lz)return Z;return`${Z.slice(0,Lz)}-${Math.abs(A_($)).toString(36)}`}function Fz($){try{let Z=_z($);if(Z.isSymbolicLink()){let Q=P_($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function Mz($){try{return _z($).isFile()}catch{return!1}}function C_($){let Z=$;for(;;){if(Fz(A0(Z,".git")))return Z;let Q=k1(Z);if(Q===Z)return null;Z=Q}}function j_($){let Z;try{Z=o8(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(!Mz(z))return $;let X=E2(Q,o8(z,"utf-8").trim());if(E2(k1(Q))!==A0(X,"worktrees"))return $;let H=A0(Q,"gitdir");if(!Mz(H))return $;let U=o8(H,"utf-8").trim();if(v1(E2(Q,U))!==A0(v1($),".git"))return $;if(R_(X)!==".git")return Fz(A0(X,".git"))?$:X;return k1(X)}catch{return $}}function Rz($){let Z=E2($);try{Z=v1.native(Z)}catch{}let Q=C_(Z);return(Q?j_(Q):Z).normalize("NFC")}function t8($,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(F_(),".claude");return A0(E2(Q),"projects",Pz(Rz($)),"memory").normalize("NFC")}function w_($,Z={}){return A0(t8($,Z),t.memory)}var S_=new Set(["target_user","core_problem","mission_purpose"]),E_=["who","what","why","where","when","how"];function Nz($){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}`),...s8("Stack",Object.entries($.stack??{}).filter(([U,J])=>!S_.has(U)&&i(J)).map(([U,J])=>`- **${z0(`stack.${U}`)}:** ${J}`)),...s8("Context",E_.filter((U)=>i(z[U])).map((U)=>`- **${z0(`human_context.${U}`)}:** ${z[U]}`)),...s8("Commands",Object.entries($.commands??{}).filter(([,U])=>i(U)).slice(0,Oz).map(([U,J])=>`- ${U}: \`${U2(J)}\``)),...s8("Key files",X.filter(i).slice(0,Oz).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 s8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function Tz($){return b1($,(Z)=>Z.trimEnd()===N_,(Z)=>Z.startsWith(T_))}function a8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function b_($,Z,Q){if($===null)return{text:n8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=w2($),X=z??Tz($);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:n8($,Z,void 0,void 0,Q),action:"added",head:H,tail:$.slice(H.length)}}function h1($){return $>Iz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${Iz}; lines after that are kept in the file but not loaded.`]:[]}function y_($,Z={}){let Q=t8($,Z),z=A0(Q,t.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!__(Q))return X;let H=q6(u(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=a8(H);return{path:z,exists:!0,lines:G,hasBlock:U!==null,blockLines:U?a8(H.slice(U.start,U.end)):0,hasLegacySection:!U&&Tz(H)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((V)=>V.replace(/^\uFEFF/,"").trim()!=="").length,warnings:h1(G)}}function x_($,Z,Q={}){let z=t8($,Q);$$(z);let X=u(z,t.memory),H=q6(X),U=b_(H,y1(Nz(Z)),X);if(U.text===H){let B=a8(H);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:h1(B)}}let J=e(X,U.text,{root:z,expect:H}),G=o8(J,"utf-8"),V=G===U.text&&G.startsWith(U.head)&&G.endsWith(U.tail),Y=a8(G),W=U.action==="added"?r8(t.memory,H):null;return{path:J,action:U.action,written:!0,preserved:V,lines:Y,warnings:[...W?[W]:[],...h1(Y)]}}function g_($,Z){let Q=[],z=(G)=>I($,G),X=(G)=>w($,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 v_($,Z){let Q={...Z},z=null,X=w($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let H=d8($,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=c8($);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=g_($,z);if(J.length)Q.conventions=J}return Q}export{HD as writeServerCard,SK as writeProjectHtml,K_ as writeGeminiMd,cq as writeFaf,L_ as writeCursorrules,M_ as writeCopilotInstructions,x_ as writeClaudeMemory,X_ as writeClaudeMd,Y_ as writeAgentsMd,dz as validateFaf,F2 as utcNow,LD as upsertCatalog,uq as updateFafFile,iO as updateExistingFaf,h8 as turboCatSlots,_3 as turboCatScan,Ez as slotsByCategory,r9 as serializeFaf,$3 as seedSixWsFromGoal,cz as scoreText,U5 as scoreFafYaml,e as safeWriteFile,Qq as safeUnlink,B9 as safeReplaceOwned,nD as runLoop,u as resolveInside,w_ as resolveClaudeMemoryPath,t8 as resolveClaudeMemoryDir,c3 as repoNameFromUrl,cZ as renderProjectHtml,Bz as renderGeminiMd,qz as renderCursorrules,Dz as renderCopilotInstructions,Nz as renderClaudeMemory,H_ as renderClaudeMd,Wz as renderAgentsMd,F3 as relentlessContextDetailed,u8 as relentlessContext,j8 as registryTitle,$1 as registryName,M2 as registryMeta,Q0 as readUtf8,WD as readFafa,a9 as readFafRaw,hq as readFaf,z_ as readClaudeMd,G1 as questionForSlot,tD as publicQuestions,AQ as projectServerJson,T8 as projectServerCard,wQ as projectPack,FD as projectCards,jQ as projectArd,CQ as projectAiCatalog,R8 as projectA2ACard,UD as patchServerJson,U_ as parseClaudeMd,XM as normalizeGitUrl,E8 as normalizeAnswer,oZ as mcpName,$$ as makeDirInside,z3 as loopVerdict,eM as legacyStampNoteAt,r8 as legacyStampNote,H5 as kernel,r as isPlaceholder,rq as isNonProjectRoot,Z3 as isHumanSlot,xz as isExplicitNone,S8 as isEmptyValue,mD as interviewForMissing,T0 as injectFafBlock,eD as gradeAnswers,O$ as getTier,vz as getNextTier,JD as generateServerCard,EK as generateProjectHtml,qD as generateA2ACard,iQ as fromClaudeDir,BD as findFafaFile,t9 as findFafFile,w2 as findFafBlock,l0 as fillEmpties,PQ as fafaYaml,z$ as fafaDomain,x0 as fafMetaTag,S0 as fafContextBlock,i1 as enrichScore,v_ as enrichFromRepo,aD as deriveQuestionSet,$K as computeDrift,Rz as claudeProjectRoot,Pz as claudeProjectId,y_ as claudeMemoryStatus,Q3 as classifyGaps,U$ as canonicalPriority,dD as buildTableOf8,Z6 as buildServerCard,$L as buildReceipt,tK as buildPack,Z1 as buildA2ACard,HM as authorFafFromRepo,A1 as assembleFreshFaf,_Q as answersToFafa,J3 as answersMatch,v0 as TIERS,E as SafePathError,tQ as STACK_INTERVIEW,g0 as SLOT_BY_PATH,p as SLOTS,L6 as SLOTIGNORED,J1 as SIX_WS_INTERVIEW,DQ as SERVER_JSON_SCHEMA,F8 as SERVER_CARD_SCHEMA,dZ as REGISTRY_PUBLISHER_KEY,z2 as PRIORITY_RANK,Q1 as PRIORITY_ORDER,D6 as PLACEHOLDERS,w8 as KNOWLEDGE_TYPES,aQ as INTERVIEW_VERSION,fD as INTERVIEW_PATHS,eQ as INTERVIEW_BY_PATH,G$ as INTERVIEW,Y0 as FafmSoul,e3 as FafDNAManager,b0 as FAF_START,L$ as FAF_HEX,y0 as FAF_END,p1 as EXPLICIT_NONE,yz as ENTERPRISE_SLOTS,Y1 as BENCH_VERSION,bz as BASE_SLOTS,U3 as ALIAS_GROUPS,Q$ as A2A_CONTEXT_URI};
282
282
 
283
- //# debugId=6F75B9DC78FDB20364756E2164756E21
283
+ //# debugId=2178769CC7A6B7D764756E2164756E21
284
284
  //# sourceMappingURL=index.js.map