faf-cli 8.10.0 → 8.10.1

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,28 +1,28 @@
1
- import{createRequire as az}from"node:module";var nz=Object.defineProperty;var _=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var rz=($)=>$;function sz($,Z){this[$]=rz.bind(null,Z)}var oz=($,Z)=>{for(var Q in Z)nz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:sz.bind(Z,Q)})};var M$=az(import.meta.url);var g=_((FX)=>{var K4=Symbol.for("yaml.alias"),Z1=Symbol.for("yaml.document"),N6=Symbol.for("yaml.map"),Q1=Symbol.for("yaml.pair"),D4=Symbol.for("yaml.scalar"),T6=Symbol.for("yaml.seq"),v0=Symbol.for("yaml.node.type"),KX=($)=>!!$&&typeof $==="object"&&$[v0]===K4,DX=($)=>!!$&&typeof $==="object"&&$[v0]===Z1,LX=($)=>!!$&&typeof $==="object"&&$[v0]===N6,MX=($)=>!!$&&typeof $==="object"&&$[v0]===Q1,z1=($)=>!!$&&typeof $==="object"&&$[v0]===D4,IX=($)=>!!$&&typeof $==="object"&&$[v0]===T6;function X1($){if($&&typeof $==="object")switch($[v0]){case N6:case T6:return!0}return!1}function OX($){if($&&typeof $==="object")switch($[v0]){case K4:case N6:case D4:case T6:return!0}return!1}var _X=($)=>(z1($)||X1($))&&!!$.anchor;FX.ALIAS=K4;FX.DOC=Z1;FX.MAP=N6;FX.NODE_TYPE=v0;FX.PAIR=Q1;FX.SCALAR=D4;FX.SEQ=T6;FX.hasAnchor=_X;FX.isAlias=KX;FX.isCollection=X1;FX.isDocument=DX;FX.isMap=LX;FX.isNode=OX;FX.isPair=MX;FX.isScalar=z1;FX.isSeq=IX});var R$=_((hX)=>{var s=g(),X0=Symbol("break visit"),U1=Symbol("skip children"),A0=Symbol("remove node");function A6($,Z){let Q=J1(Z);if(s.isDocument($)){if(h2(null,$.contents,Q,Object.freeze([$]))===A0)$.contents=null}else h2(null,$,Q,Object.freeze([]))}A6.BREAK=X0;A6.SKIP=U1;A6.REMOVE=A0;function h2($,Z,Q,z){let X=H1($,Z,Q,z);if(s.isNode(X)||s.isPair(X))return V1($,z,X),h2($,X,Q,z);if(typeof X!=="symbol"){if(s.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let J=h2(U,Z.items[U],Q,z);if(typeof J==="number")U=J-1;else if(J===X0)return X0;else if(J===A0)Z.items.splice(U,1),U-=1}}else if(s.isPair(Z)){z=Object.freeze(z.concat(Z));let U=h2("key",Z.key,Q,z);if(U===X0)return X0;else if(U===A0)Z.key=null;let J=h2("value",Z.value,Q,z);if(J===X0)return X0;else if(J===A0)Z.value=null}}return X}async function C6($,Z){let Q=J1(Z);if(s.isDocument($)){if(await u2(null,$.contents,Q,Object.freeze([$]))===A0)$.contents=null}else await u2(null,$,Q,Object.freeze([]))}C6.BREAK=X0;C6.SKIP=U1;C6.REMOVE=A0;async function u2($,Z,Q,z){let X=await H1($,Z,Q,z);if(s.isNode(X)||s.isPair(X))return V1($,z,X),u2($,X,Q,z);if(typeof X!=="symbol"){if(s.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let J=await u2(U,Z.items[U],Q,z);if(typeof J==="number")U=J-1;else if(J===X0)return X0;else if(J===A0)Z.items.splice(U,1),U-=1}}else if(s.isPair(Z)){z=Object.freeze(z.concat(Z));let U=await u2("key",Z.key,Q,z);if(U===X0)return X0;else if(U===A0)Z.key=null;let J=await u2("value",Z.value,Q,z);if(J===X0)return X0;else if(J===A0)Z.value=null}}return X}function J1($){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 H1($,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 V1($,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`)}}hX.visit=A6;hX.visitAsync=C6});var L4=_((cX)=>{var Y1=g(),fX=R$(),pX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},lX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>pX[Z]);class V0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},V0.defaultYaml,$),this.tags=Object.assign({},V0.defaultTags,Z)}clone(){let $=new V0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new V0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:V0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},V0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:V0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},V0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,U]=Q;return this.tags[X]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let U=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,U),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let U=$.slice(2,-1);if(U==="!"||U==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return U}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(U){return Z(String(U)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+lX($.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&&Y1.isNode($.contents)){let X={};fX.visit($.contents,(U,J)=>{if(Y1.isNode(J)&&J.tag)X[J.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,U]of Q){if(X==="!!"&&U==="tag:yaml.org,2002:")continue;if(!$||z.some((J)=>J.startsWith(U)))Z.push(`%TAG ${X} ${U}`)}return Z.join(`
2
- `)}}V0.defaultYaml={explicit:!1,version:"1.2"};V0.defaultTags={"!!":"tag:yaml.org,2002:"};cX.Directives=V0});var j6=_((sX)=>{var G1=g(),iX=R$();function nX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function W1($){let Z=new Set;return iX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function q1($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function rX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(U)=>{Q.push(U),X??(X=W1($));let J=q1(Z,X);return X.add(J),J},setAnchors:()=>{for(let U of Q){let J=z.get(U);if(typeof J==="object"&&J.anchor&&(G1.isScalar(J.node)||G1.isCollection(J.node)))J.node.anchor=J.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=U,H}}},sourceObjects:z}}sX.anchorIsValid=nX;sX.anchorNames=W1;sX.createNodeAnchors=rX;sX.findNewAnchor=q1});var M4=_(($U)=>{function N$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,U=z.length;X<U;++X){let J=z[X],H=N$($,z,String(X),J);if(H===void 0)delete z[X];else if(H!==J)z[X]=H}else if(z instanceof Map)for(let X of Array.from(z.keys())){let U=z.get(X),J=N$($,z,X,U);if(J===void 0)z.delete(X);else if(J!==U)z.set(X,J)}else if(z instanceof Set)for(let X of Array.from(z)){let U=N$($,z,X,X);if(U===void 0)z.delete(X);else if(U!==X)z.delete(X),z.add(U)}else for(let[X,U]of Object.entries(z)){let J=N$($,z,X,U);if(J===void 0)delete z[X];else if(J!==U)z[X]=J}return $.call(Z,Q,z)}$U.applyReviver=N$});var l0=_((zU)=>{var QU=g();function B1($,Z,Q){if(Array.isArray($))return $.map((z,X)=>B1(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!QU.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(U)=>{z.res=U,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}zU.toJS=B1});var w6=_((HU)=>{var UU=M4(),K1=g(),JU=l0();class D1{constructor($){Object.defineProperty(this,K1.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(!K1.isDocument($))throw TypeError("A document argument is required");let U={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},J=JU.toJS(this,"",U);if(typeof z==="function")for(let{count:H,res:V}of U.anchors.values())z(V,H);return typeof X==="function"?UU.applyReviver(X,{"":J},"",J):J}}HU.NodeBase=D1});var T$=_((BU)=>{var YU=j6(),GU=R$(),m2=g(),WU=w6(),qU=l0();class L1 extends WU.NodeBase{constructor($){super(m2.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=[],GU.visit($,{Node:(X,U)=>{if(m2.isAlias(U)||m2.hasAnchor(U))Q.push(U)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,U=this.resolve(z,Z);if(!U){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let J=Q.get(U);if(!J)qU.toJS(U,null,Z),J=Q.get(U);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=S6(z,U,Q);if(J.count*J.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(YU.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 S6($,Z,Q){if(m2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(m2.isCollection(Z)){let z=0;for(let X of Z.items){let U=S6($,X,Q);if(U>z)z=U}return z}else if(m2.isPair(Z)){let z=S6($,Z.key,Q),X=S6($,Z.value,Q);return Math.max(z,X)}return 1}BU.Alias=L1});var i=_((OU)=>{var DU=g(),LU=w6(),MU=l0(),IU=($)=>!$||typeof $!=="function"&&typeof $!=="object";class H2 extends LU.NodeBase{constructor($){super(DU.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:MU.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";OU.Scalar=H2;OU.isScalarValue=IU});var A$=_((AU)=>{var PU=T$(),V2=g(),M1=i(),RU="tag:yaml.org,2002:";function NU($,Z,Q){if(Z){let z=Q.filter((U)=>U.tag===Z),X=z.find((U)=>!U.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function TU($,Z,Q){if(V2.isDocument($))$=$.contents;if(V2.isNode($))return $;if(V2.isPair($)){let W=Q.schema[V2.MAP].createNode?.(Q.schema,null,Q);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:X,onTagObj:U,schema:J,sourceObjects:H}=Q,V=void 0;if(z&&$&&typeof $==="object")if(V=H.get($),V)return V.anchor??(V.anchor=X($)),new PU.Alias(V.anchor);else V={anchor:null,node:null},H.set($,V);if(Z?.startsWith("!!"))Z=RU+Z.slice(2);let Y=NU($,Z,J.tags);if(!Y){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new M1.Scalar($);if(V)V.node=W;return W}Y=$ instanceof Map?J[V2.MAP]:(Symbol.iterator in Object($))?J[V2.SEQ]:J[V2.MAP]}if(U)U(Y),delete Q.onTagObj;let G=Y?.createNode?Y.createNode(Q.schema,$,Q):typeof Y?.nodeClass?.from==="function"?Y.nodeClass.from(Q.schema,$,Q):new M1.Scalar($);if(Z)G.tag=Z;else if(!Y.default)G.tag=Y.tag;if(V)V.node=G;return G}AU.createNode=TU});var E6=_((SU)=>{var jU=A$(),C0=g(),wU=w6();function I4($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let U=Z[X];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let J=[];J[U]=z,z=J}else z=new Map([[U,z]])}return jU.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var I1=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class O1 extends wU.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)=>C0.isNode(Q)||C0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(I1($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(C0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,I4(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(C0.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&&C0.isScalar(X)?X.value:X;else return C0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!C0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&C0.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 C0.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(C0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,I4(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}SU.Collection=O1;SU.collectionFromPath=I4;SU.isEmptyPath=I1});var C$=_((vU)=>{var xU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function O4($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var gU=($,Z,Q)=>$.endsWith(`
3
- `)?O4(Q,Z):Q.includes(`
1
+ import{createRequire as az}from"node:module";var nz=Object.defineProperty;var _=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var rz=($)=>$;function sz($,Z){this[$]=rz.bind(null,Z)}var oz=($,Z)=>{for(var Q in Z)nz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:sz.bind(Z,Q)})};var I$=az(import.meta.url);var g=_((FX)=>{var D4=Symbol.for("yaml.alias"),Q1=Symbol.for("yaml.document"),N6=Symbol.for("yaml.map"),z1=Symbol.for("yaml.pair"),L4=Symbol.for("yaml.scalar"),T6=Symbol.for("yaml.seq"),k0=Symbol.for("yaml.node.type"),KX=($)=>!!$&&typeof $==="object"&&$[k0]===D4,DX=($)=>!!$&&typeof $==="object"&&$[k0]===Q1,LX=($)=>!!$&&typeof $==="object"&&$[k0]===N6,MX=($)=>!!$&&typeof $==="object"&&$[k0]===z1,X1=($)=>!!$&&typeof $==="object"&&$[k0]===L4,IX=($)=>!!$&&typeof $==="object"&&$[k0]===T6;function U1($){if($&&typeof $==="object")switch($[k0]){case N6:case T6:return!0}return!1}function OX($){if($&&typeof $==="object")switch($[k0]){case D4:case N6:case L4:case T6:return!0}return!1}var _X=($)=>(X1($)||U1($))&&!!$.anchor;FX.ALIAS=D4;FX.DOC=Q1;FX.MAP=N6;FX.NODE_TYPE=k0;FX.PAIR=z1;FX.SCALAR=L4;FX.SEQ=T6;FX.hasAnchor=_X;FX.isAlias=KX;FX.isCollection=U1;FX.isDocument=DX;FX.isMap=LX;FX.isNode=OX;FX.isPair=MX;FX.isScalar=X1;FX.isSeq=IX});var N$=_((hX)=>{var s=g(),X0=Symbol("break visit"),J1=Symbol("skip children"),A0=Symbol("remove node");function A6($,Z){let Q=H1(Z);if(s.isDocument($)){if(h2(null,$.contents,Q,Object.freeze([$]))===A0)$.contents=null}else h2(null,$,Q,Object.freeze([]))}A6.BREAK=X0;A6.SKIP=J1;A6.REMOVE=A0;function h2($,Z,Q,z){let X=V1($,Z,Q,z);if(s.isNode(X)||s.isPair(X))return Y1($,z,X),h2($,X,Q,z);if(typeof X!=="symbol"){if(s.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let J=h2(U,Z.items[U],Q,z);if(typeof J==="number")U=J-1;else if(J===X0)return X0;else if(J===A0)Z.items.splice(U,1),U-=1}}else if(s.isPair(Z)){z=Object.freeze(z.concat(Z));let U=h2("key",Z.key,Q,z);if(U===X0)return X0;else if(U===A0)Z.key=null;let J=h2("value",Z.value,Q,z);if(J===X0)return X0;else if(J===A0)Z.value=null}}return X}async function C6($,Z){let Q=H1(Z);if(s.isDocument($)){if(await u2(null,$.contents,Q,Object.freeze([$]))===A0)$.contents=null}else await u2(null,$,Q,Object.freeze([]))}C6.BREAK=X0;C6.SKIP=J1;C6.REMOVE=A0;async function u2($,Z,Q,z){let X=await V1($,Z,Q,z);if(s.isNode(X)||s.isPair(X))return Y1($,z,X),u2($,X,Q,z);if(typeof X!=="symbol"){if(s.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let J=await u2(U,Z.items[U],Q,z);if(typeof J==="number")U=J-1;else if(J===X0)return X0;else if(J===A0)Z.items.splice(U,1),U-=1}}else if(s.isPair(Z)){z=Object.freeze(z.concat(Z));let U=await u2("key",Z.key,Q,z);if(U===X0)return X0;else if(U===A0)Z.key=null;let J=await u2("value",Z.value,Q,z);if(J===X0)return X0;else if(J===A0)Z.value=null}}return X}function H1($){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 V1($,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 Y1($,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`)}}hX.visit=A6;hX.visitAsync=C6});var M4=_((cX)=>{var G1=g(),fX=N$(),pX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},lX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>pX[Z]);class V0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},V0.defaultYaml,$),this.tags=Object.assign({},V0.defaultTags,Z)}clone(){let $=new V0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new V0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:V0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},V0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:V0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},V0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,U]=Q;return this.tags[X]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let U=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,U),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let U=$.slice(2,-1);if(U==="!"||U==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return U}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(U){return Z(String(U)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+lX($.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&&G1.isNode($.contents)){let X={};fX.visit($.contents,(U,J)=>{if(G1.isNode(J)&&J.tag)X[J.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,U]of Q){if(X==="!!"&&U==="tag:yaml.org,2002:")continue;if(!$||z.some((J)=>J.startsWith(U)))Z.push(`%TAG ${X} ${U}`)}return Z.join(`
2
+ `)}}V0.defaultYaml={explicit:!1,version:"1.2"};V0.defaultTags={"!!":"tag:yaml.org,2002:"};cX.Directives=V0});var j6=_((sX)=>{var W1=g(),iX=N$();function nX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function q1($){let Z=new Set;return iX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function B1($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function rX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(U)=>{Q.push(U),X??(X=q1($));let J=B1(Z,X);return X.add(J),J},setAnchors:()=>{for(let U of Q){let J=z.get(U);if(typeof J==="object"&&J.anchor&&(W1.isScalar(J.node)||W1.isCollection(J.node)))J.node.anchor=J.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=U,H}}},sourceObjects:z}}sX.anchorIsValid=nX;sX.anchorNames=q1;sX.createNodeAnchors=rX;sX.findNewAnchor=B1});var I4=_(($U)=>{function T$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,U=z.length;X<U;++X){let J=z[X],H=T$($,z,String(X),J);if(H===void 0)delete z[X];else if(H!==J)z[X]=H}else if(z instanceof Map)for(let X of Array.from(z.keys())){let U=z.get(X),J=T$($,z,X,U);if(J===void 0)z.delete(X);else if(J!==U)z.set(X,J)}else if(z instanceof Set)for(let X of Array.from(z)){let U=T$($,z,X,X);if(U===void 0)z.delete(X);else if(U!==X)z.delete(X),z.add(U)}else for(let[X,U]of Object.entries(z)){let J=T$($,z,X,U);if(J===void 0)delete z[X];else if(J!==U)z[X]=J}return $.call(Z,Q,z)}$U.applyReviver=T$});var l0=_((zU)=>{var QU=g();function K1($,Z,Q){if(Array.isArray($))return $.map((z,X)=>K1(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!QU.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(U)=>{z.res=U,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}zU.toJS=K1});var w6=_((HU)=>{var UU=I4(),D1=g(),JU=l0();class L1{constructor($){Object.defineProperty(this,D1.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(!D1.isDocument($))throw TypeError("A document argument is required");let U={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},J=JU.toJS(this,"",U);if(typeof z==="function")for(let{count:H,res:V}of U.anchors.values())z(V,H);return typeof X==="function"?UU.applyReviver(X,{"":J},"",J):J}}HU.NodeBase=L1});var A$=_((BU)=>{var YU=j6(),GU=N$(),m2=g(),WU=w6(),qU=l0();class M1 extends WU.NodeBase{constructor($){super(m2.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=[],GU.visit($,{Node:(X,U)=>{if(m2.isAlias(U)||m2.hasAnchor(U))Q.push(U)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,U=this.resolve(z,Z);if(!U){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let J=Q.get(U);if(!J)qU.toJS(U,null,Z),J=Q.get(U);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=S6(z,U,Q);if(J.count*J.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(YU.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 S6($,Z,Q){if(m2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(m2.isCollection(Z)){let z=0;for(let X of Z.items){let U=S6($,X,Q);if(U>z)z=U}return z}else if(m2.isPair(Z)){let z=S6($,Z.key,Q),X=S6($,Z.value,Q);return Math.max(z,X)}return 1}BU.Alias=M1});var i=_((OU)=>{var DU=g(),LU=w6(),MU=l0(),IU=($)=>!$||typeof $!=="function"&&typeof $!=="object";class H2 extends LU.NodeBase{constructor($){super(DU.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:MU.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";OU.Scalar=H2;OU.isScalarValue=IU});var C$=_((AU)=>{var PU=A$(),V2=g(),I1=i(),RU="tag:yaml.org,2002:";function NU($,Z,Q){if(Z){let z=Q.filter((U)=>U.tag===Z),X=z.find((U)=>!U.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function TU($,Z,Q){if(V2.isDocument($))$=$.contents;if(V2.isNode($))return $;if(V2.isPair($)){let W=Q.schema[V2.MAP].createNode?.(Q.schema,null,Q);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:X,onTagObj:U,schema:J,sourceObjects:H}=Q,V=void 0;if(z&&$&&typeof $==="object")if(V=H.get($),V)return V.anchor??(V.anchor=X($)),new PU.Alias(V.anchor);else V={anchor:null,node:null},H.set($,V);if(Z?.startsWith("!!"))Z=RU+Z.slice(2);let Y=NU($,Z,J.tags);if(!Y){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new I1.Scalar($);if(V)V.node=W;return W}Y=$ instanceof Map?J[V2.MAP]:(Symbol.iterator in Object($))?J[V2.SEQ]:J[V2.MAP]}if(U)U(Y),delete Q.onTagObj;let G=Y?.createNode?Y.createNode(Q.schema,$,Q):typeof Y?.nodeClass?.from==="function"?Y.nodeClass.from(Q.schema,$,Q):new I1.Scalar($);if(Z)G.tag=Z;else if(!Y.default)G.tag=Y.tag;if(V)V.node=G;return G}AU.createNode=TU});var E6=_((SU)=>{var jU=C$(),C0=g(),wU=w6();function O4($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let U=Z[X];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let J=[];J[U]=z,z=J}else z=new Map([[U,z]])}return jU.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var O1=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class _1 extends wU.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)=>C0.isNode(Q)||C0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(O1($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(C0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,O4(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(C0.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&&C0.isScalar(X)?X.value:X;else return C0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!C0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&C0.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 C0.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(C0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,O4(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}SU.Collection=_1;SU.collectionFromPath=O4;SU.isEmptyPath=O1});var j$=_((vU)=>{var xU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function _4($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var gU=($,Z,Q)=>$.endsWith(`
3
+ `)?_4(Q,Z):Q.includes(`
4
4
  `)?`
5
- `+O4(Q,Z):($.endsWith(" ")?"":" ")+Q;vU.indentComment=O4;vU.lineComment=gU;vU.stringifyComment=xU});var F1=_((fU)=>{function mU($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:U=20,onFold:J,onOverflow:H}={}){if(!X||X<0)return $;if(X<U)U=0;let V=Math.max(1+U,1+X-Z.length);if($.length<=V)return $;let Y=[],G={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,U))Y.push(0);else W=X-z;let q=void 0,K=void 0,L=!1,B=-1,D=-1,I=-1;if(Q==="block"){if(B=_1($,B,Z.length),B!==-1)W=B+V}for(let C;C=$[B+=1];){if(Q==="quoted"&&C==="\\"){switch(D=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}I=B}if(C===`
6
- `){if(Q==="block")B=_1($,B,Z.length);W=B+Z.length+V,q=void 0}else{if(C===" "&&K&&K!==" "&&K!==`
5
+ `+_4(Q,Z):($.endsWith(" ")?"":" ")+Q;vU.indentComment=_4;vU.lineComment=gU;vU.stringifyComment=xU});var P1=_((fU)=>{function mU($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:U=20,onFold:J,onOverflow:H}={}){if(!X||X<0)return $;if(X<U)U=0;let V=Math.max(1+U,1+X-Z.length);if($.length<=V)return $;let Y=[],G={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,U))Y.push(0);else W=X-z;let q=void 0,K=void 0,L=!1,B=-1,D=-1,I=-1;if(Q==="block"){if(B=F1($,B,Z.length),B!==-1)W=B+V}for(let C;C=$[B+=1];){if(Q==="quoted"&&C==="\\"){switch(D=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}I=B}if(C===`
6
+ `){if(Q==="block")B=F1($,B,Z.length);W=B+Z.length+V,q=void 0}else{if(C===" "&&K&&K!==" "&&K!==`
7
7
  `&&K!=="\t"){let P=$[B+1];if(P&&P!==" "&&P!==`
8
8
  `&&P!=="\t")q=B}if(B>=W)if(q)Y.push(q),W=q+V,q=void 0;else if(Q==="quoted"){while(K===" "||K==="\t")K=C,C=$[B+=1],L=!0;let P=B>I+1?B-2:D-1;if(G[P])return $;Y.push(P),G[P]=!0,W=P+V,q=void 0}else L=!0}K=C}if(L&&H)H();if(Y.length===0)return $;if(J)J();let O=$.slice(0,Y[0]);for(let C=0;C<Y.length;++C){let P=Y[C],N=Y[C+1]||$.length;if(P===0)O=`
9
9
  ${Z}${$.slice(0,N)}`;else{if(Q==="quoted"&&G[P])O+=`${$[P]}\\`;O+=`
10
- ${Z}${$.slice(P+1,N)}`}}return O}function _1($,Z,Q){let z=Z,X=Z+1,U=$[X];while(U===" "||U==="\t")if(Z<X+Q)U=$[++Z];else{do U=$[++Z];while(U&&U!==`
11
- `);z=Z,X=Z+1,U=$[X]}return z}fU.FOLD_BLOCK="block";fU.FOLD_FLOW="flow";fU.FOLD_QUOTED="quoted";fU.foldFlowLines=mU});var w$=_((sU)=>{var D0=i(),c0=F1(),y6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),x6=($)=>/^(%|---|\.\.\.)/m.test($);function iU($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let U=0,J=0;U<X;++U)if($[U]===`
12
- `){if(U-J>z)return!0;if(J=U+1,X-J<=z)return!1}return!0}function j$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,U=Z.indent||(x6($)?" ":""),J="",H=0;for(let V=0,Y=Q[V];Y;Y=Q[++V]){if(Y===" "&&Q[V+1]==="\\"&&Q[V+2]==="n")J+=Q.slice(H,V)+"\\ ",V+=1,H=V,Y="\\";if(Y==="\\")switch(Q[V+1]){case"u":{J+=Q.slice(H,V);let G=Q.substr(V+2,4);switch(G){case"0000":J+="\\0";break;case"0007":J+="\\a";break;case"000b":J+="\\v";break;case"001b":J+="\\e";break;case"0085":J+="\\N";break;case"00a0":J+="\\_";break;case"2028":J+="\\L";break;case"2029":J+="\\P";break;default:if(G.substr(0,2)==="00")J+="\\x"+G.substr(2);else J+=Q.substr(V,6)}V+=5,H=V+1}break;case"n":if(z||Q[V+2]==='"'||Q.length<X)V+=1;else{J+=Q.slice(H,V)+`
10
+ ${Z}${$.slice(P+1,N)}`}}return O}function F1($,Z,Q){let z=Z,X=Z+1,U=$[X];while(U===" "||U==="\t")if(Z<X+Q)U=$[++Z];else{do U=$[++Z];while(U&&U!==`
11
+ `);z=Z,X=Z+1,U=$[X]}return z}fU.FOLD_BLOCK="block";fU.FOLD_FLOW="flow";fU.FOLD_QUOTED="quoted";fU.foldFlowLines=mU});var S$=_((sU)=>{var D0=i(),c0=P1(),y6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),x6=($)=>/^(%|---|\.\.\.)/m.test($);function iU($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let U=0,J=0;U<X;++U)if($[U]===`
12
+ `){if(U-J>z)return!0;if(J=U+1,X-J<=z)return!1}return!0}function w$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,U=Z.indent||(x6($)?" ":""),J="",H=0;for(let V=0,Y=Q[V];Y;Y=Q[++V]){if(Y===" "&&Q[V+1]==="\\"&&Q[V+2]==="n")J+=Q.slice(H,V)+"\\ ",V+=1,H=V,Y="\\";if(Y==="\\")switch(Q[V+1]){case"u":{J+=Q.slice(H,V);let G=Q.substr(V+2,4);switch(G){case"0000":J+="\\0";break;case"0007":J+="\\a";break;case"000b":J+="\\v";break;case"001b":J+="\\e";break;case"0085":J+="\\N";break;case"00a0":J+="\\_";break;case"2028":J+="\\L";break;case"2029":J+="\\P";break;default:if(G.substr(0,2)==="00")J+="\\x"+G.substr(2);else J+=Q.substr(V,6)}V+=5,H=V+1}break;case"n":if(z||Q[V+2]==='"'||Q.length<X)V+=1;else{J+=Q.slice(H,V)+`
13
13
 
14
14
  `;while(Q[V+2]==="\\"&&Q[V+3]==="n"&&Q[V+4]!=='"')J+=`
15
- `,V+=2;if(J+=U,Q[V+2]===" ")J+="\\";V+=1,H=V+1}break;default:V+=1}}return J=H?J+Q.slice(H):Q,z?J:c0.foldFlowLines(J,U,c0.FOLD_QUOTED,y6(Z,!1))}function _4($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test($))return j$($,Z);let Q=Z.indent||(x6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${Q}`)+"'";return Z.implicitKey?z:c0.foldFlowLines(z,Q,c0.FOLD_FLOW,y6(Z,!1))}function f2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=j$;else{let X=$.includes('"'),U=$.includes("'");if(X&&!U)z=_4;else if(U&&!X)z=j$;else z=Q?_4:j$}return z($,Z)}var F4;try{F4=new RegExp(`(^|(?<!
15
+ `,V+=2;if(J+=U,Q[V+2]===" ")J+="\\";V+=1,H=V+1}break;default:V+=1}}return J=H?J+Q.slice(H):Q,z?J:c0.foldFlowLines(J,U,c0.FOLD_QUOTED,y6(Z,!1))}function F4($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return w$($,Z);let Q=Z.indent||(x6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${Q}`)+"'";return Z.implicitKey?z:c0.foldFlowLines(z,Q,c0.FOLD_FLOW,y6(Z,!1))}function f2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=w$;else{let X=$.includes('"'),U=$.includes("'");if(X&&!U)z=F4;else if(U&&!X)z=w$;else z=Q?F4:w$}return z($,Z)}var P4;try{P4=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{F4=/\n+(?!\n|$)/g}function b6({comment:$,type:Z,value:Q},z,X,U){let{blockQuote:J,commentString:H,lineWidth:V}=z.options;if(!J||/\n[\t ]+$/.test(Q))return f2(Q,z);let Y=z.indent||(z.forceBlockIndent||x6(Q)?" ":""),G=J==="literal"?!0:J==="folded"||Z===D0.Scalar.BLOCK_FOLDED?!1:Z===D0.Scalar.BLOCK_LITERAL?!0:!iU(Q,V,Y.length);if(!Q)return G?`|
20
+ |$)`,"g")}catch{P4=/\n+(?!\n|$)/g}function b6({comment:$,type:Z,value:Q},z,X,U){let{blockQuote:J,commentString:H,lineWidth:V}=z.options;if(!J||/\n[\t ]+$/.test(Q))return f2(Q,z);let Y=z.indent||(z.forceBlockIndent||x6(Q)?" ":""),G=J==="literal"?!0:J==="folded"||Z===D0.Scalar.BLOCK_FOLDED?!1:Z===D0.Scalar.BLOCK_LITERAL?!0:!iU(Q,V,Y.length);if(!Q)return G?`|
21
21
  `:`>
22
22
  `;let W,q;for(q=Q.length;q>0;--q){let N=Q[q-1];if(N!==`
23
23
  `&&N!=="\t"&&N!==" ")break}let K=Q.substring(q),L=K.indexOf(`
24
24
  `);if(L===-1)W="-";else if(Q===K||L!==K.length-1){if(W="+",U)U()}else W="";if(K){if(Q=Q.slice(0,-K.length),K[K.length-1]===`
25
- `)K=K.slice(0,-1);K=K.replace(F4,`$&${Y}`)}let B=!1,D,I=-1;for(D=0;D<Q.length;++D){let N=Q[D];if(N===" ")B=!0;else if(N===`
25
+ `)K=K.slice(0,-1);K=K.replace(P4,`$&${Y}`)}let B=!1,D,I=-1;for(D=0;D<Q.length;++D){let N=Q[D];if(N===" ")B=!0;else if(N===`
26
26
  `)I=D;else break}let O=Q.substring(0,I<D?I+1:D);if(O)Q=Q.substring(O.length),O=O.replace(/\n+/g,`$&${Y}`);let P=(B?Y?"2":"1":"")+W;if($){if(P+=" "+H($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!G){let N=Q.replace(/\n+/g,`
27
27
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),T=!1,w=y6(z,!0);if(J!=="folded"&&Z!==D0.Scalar.BLOCK_FOLDED)w.onOverflow=()=>{T=!0};let F=c0.foldFlowLines(`${O}${N}${K}`,Y,c0.FOLD_BLOCK,w);if(!T)return`>${P}
28
28
  ${Y}${F}`}return Q=Q.replace(/\n+/g,`$&${Y}`),`|${P}
@@ -30,45 +30,45 @@ ${Y}${O}${Q}${K}`}function nU($,Z,Q,z){let{type:X,value:U}=$,{actualString:J,imp
30
30
  `)||G&&/[[\]{},]/.test(U))return f2(U,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return H||G||!U.includes(`
31
31
  `)?f2(U,Z):b6($,Z,Q,z);if(!H&&!G&&X!==D0.Scalar.PLAIN&&U.includes(`
32
32
  `))return b6($,Z,Q,z);if(x6(U)){if(V==="")return Z.forceBlockIndent=!0,b6($,Z,Q,z);else if(H&&V===Y)return f2(U,Z)}let W=U.replace(/\n+/g,`$&
33
- ${V}`);if(J){let q=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(W),{compat:K,tags:L}=Z.doc.schema;if(L.some(q)||K?.some(q))return f2(U,Z)}return H?W:c0.foldFlowLines(W,V,c0.FOLD_FLOW,y6(Z,!1))}function rU($,Z,Q,z){let{implicitKey:X,inFlow:U}=Z,J=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:H}=$;if(H!==D0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(J.value))H=D0.Scalar.QUOTE_DOUBLE}let V=(G)=>{switch(G){case D0.Scalar.BLOCK_FOLDED:case D0.Scalar.BLOCK_LITERAL:return X||U?f2(J.value,Z):b6(J,Z,Q,z);case D0.Scalar.QUOTE_DOUBLE:return j$(J.value,Z);case D0.Scalar.QUOTE_SINGLE:return _4(J.value,Z);case D0.Scalar.PLAIN:return nU(J,Z,Q,z);default:return null}},Y=V(H);if(Y===null){let{defaultKeyType:G,defaultStringType:W}=Z.options,q=X&&G||W;if(Y=V(q),Y===null)throw Error(`Unsupported default string type ${q}`)}return Y}sU.stringifyString=rU});var S$=_((XJ)=>{var aU=j6(),d0=g(),tU=C$(),eU=w$();function $J($,Z){let Q=Object.assign({blockQuote:!0,commentString:tU.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 ZJ($,Z){if(Z.tag){let X=$.filter((U)=>U.tag===Z.tag);if(X.length>0)return X.find((U)=>U.format===Z.format)??X[0]}let Q=void 0,z;if(d0.isScalar(Z)){z=Z.value;let X=$.filter((U)=>U.identify?.(z));if(X.length>1){let U=X.filter((J)=>J.test);if(U.length>0)X=U}Q=X.find((U)=>U.format===Z.format)??X.find((U)=>!U.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function QJ($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],U=(d0.isScalar($)||d0.isCollection($))&&$.anchor;if(U&&aU.anchorIsValid(U))Q.add(U),X.push(`&${U}`);let J=$.tag??(Z.default?null:Z.tag);if(J)X.push(z.directives.tagString(J));return X.join(" ")}function zJ($,Z,Q,z){if(d0.isPair($))return $.toString(Z,Q,z);if(d0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,U=d0.isNode($)?$:Z.doc.createNode($,{onTagObj:(V)=>X=V});X??(X=ZJ(Z.doc.schema.tags,U));let J=QJ(U,X,Z);if(J.length>0)Z.indentAtStart=(Z.indentAtStart??0)+J.length+1;let H=typeof X.stringify==="function"?X.stringify(U,Z,Q,z):d0.isScalar(U)?eU.stringifyString(U,Z,Q,z):U.toString(Z,Q,z);if(!J)return H;return d0.isScalar(U)||H[0]==="{"||H[0]==="["?`${J} ${H}`:`${J}
34
- ${Z.indent}${H}`}XJ.createStringifyContext=$J;XJ.stringify=zJ});var N1=_((VJ)=>{var k0=g(),P1=i(),R1=S$(),E$=C$();function HJ({key:$,value:Z},Q,z,X){let{allNullValues:U,doc:J,indent:H,indentStep:V,options:{commentString:Y,indentSeq:G,simpleKeys:W}}=Q,q=k0.isNode($)&&$.comment||null;if(W){if(q)throw Error("With simple keys, key nodes cannot have comments");if(k0.isCollection($)||!k0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||q&&Z==null&&!Q.inFlow||k0.isCollection($)||(k0.isScalar($)?$.type===P1.Scalar.BLOCK_FOLDED||$.type===P1.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!U),indent:H+V});let L=!1,B=!1,D=R1.stringify($,Q,()=>L=!0,()=>B=!0);if(!K&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(U||Z==null){if(L&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(U&&!W||Z==null&&K){if(D=`? ${D}`,q&&!L)D+=E$.lineComment(D,Q.indent,Y(q));else if(B&&X)X();return D}if(L)q=null;if(K){if(q)D+=E$.lineComment(D,Q.indent,Y(q));D=`? ${D}
35
- ${H}:`}else if(D=`${D}:`,q)D+=E$.lineComment(D,Q.indent,Y(q));let I,O,C;if(k0.isNode(Z))I=!!Z.spaceBefore,O=Z.commentBefore,C=Z.comment;else if(I=!1,O=null,C=null,Z&&typeof Z==="object")Z=J.createNode(Z);if(Q.implicitKey=!1,!K&&!q&&k0.isScalar(Z))Q.indentAtStart=D.length+1;if(B=!1,!G&&V.length>=2&&!Q.inFlow&&!K&&k0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let P=!1,N=R1.stringify(Z,Q,()=>P=!0,()=>B=!0),T=" ";if(q||I||O){if(T=I?`
33
+ ${V}`);if(J){let q=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(W),{compat:K,tags:L}=Z.doc.schema;if(L.some(q)||K?.some(q))return f2(U,Z)}return H?W:c0.foldFlowLines(W,V,c0.FOLD_FLOW,y6(Z,!1))}function rU($,Z,Q,z){let{implicitKey:X,inFlow:U}=Z,J=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:H}=$;if(H!==D0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(J.value))H=D0.Scalar.QUOTE_DOUBLE}let V=(G)=>{switch(G){case D0.Scalar.BLOCK_FOLDED:case D0.Scalar.BLOCK_LITERAL:return X||U?f2(J.value,Z):b6(J,Z,Q,z);case D0.Scalar.QUOTE_DOUBLE:return w$(J.value,Z);case D0.Scalar.QUOTE_SINGLE:return F4(J.value,Z);case D0.Scalar.PLAIN:return nU(J,Z,Q,z);default:return null}},Y=V(H);if(Y===null){let{defaultKeyType:G,defaultStringType:W}=Z.options,q=X&&G||W;if(Y=V(q),Y===null)throw Error(`Unsupported default string type ${q}`)}return Y}sU.stringifyString=rU});var E$=_((XJ)=>{var aU=j6(),d0=g(),tU=j$(),eU=S$();function $J($,Z){let Q=Object.assign({blockQuote:!0,commentString:tU.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 ZJ($,Z){if(Z.tag){let X=$.filter((U)=>U.tag===Z.tag);if(X.length>0)return X.find((U)=>U.format===Z.format)??X[0]}let Q=void 0,z;if(d0.isScalar(Z)){z=Z.value;let X=$.filter((U)=>U.identify?.(z));if(X.length>1){let U=X.filter((J)=>J.test);if(U.length>0)X=U}Q=X.find((U)=>U.format===Z.format)??X.find((U)=>!U.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function QJ($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],U=(d0.isScalar($)||d0.isCollection($))&&$.anchor;if(U&&aU.anchorIsValid(U))Q.add(U),X.push(`&${U}`);let J=$.tag??(Z.default?null:Z.tag);if(J)X.push(z.directives.tagString(J));return X.join(" ")}function zJ($,Z,Q,z){if(d0.isPair($))return $.toString(Z,Q,z);if(d0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,U=d0.isNode($)?$:Z.doc.createNode($,{onTagObj:(V)=>X=V});X??(X=ZJ(Z.doc.schema.tags,U));let J=QJ(U,X,Z);if(J.length>0)Z.indentAtStart=(Z.indentAtStart??0)+J.length+1;let H=typeof X.stringify==="function"?X.stringify(U,Z,Q,z):d0.isScalar(U)?eU.stringifyString(U,Z,Q,z):U.toString(Z,Q,z);if(!J)return H;return d0.isScalar(U)||H[0]==="{"||H[0]==="["?`${J} ${H}`:`${J}
34
+ ${Z.indent}${H}`}XJ.createStringifyContext=$J;XJ.stringify=zJ});var T1=_((VJ)=>{var h0=g(),R1=i(),N1=E$(),b$=j$();function HJ({key:$,value:Z},Q,z,X){let{allNullValues:U,doc:J,indent:H,indentStep:V,options:{commentString:Y,indentSeq:G,simpleKeys:W}}=Q,q=h0.isNode($)&&$.comment||null;if(W){if(q)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&&(!$||q&&Z==null&&!Q.inFlow||h0.isCollection($)||(h0.isScalar($)?$.type===R1.Scalar.BLOCK_FOLDED||$.type===R1.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!U),indent:H+V});let L=!1,B=!1,D=N1.stringify($,Q,()=>L=!0,()=>B=!0);if(!K&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(U||Z==null){if(L&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(U&&!W||Z==null&&K){if(D=`? ${D}`,q&&!L)D+=b$.lineComment(D,Q.indent,Y(q));else if(B&&X)X();return D}if(L)q=null;if(K){if(q)D+=b$.lineComment(D,Q.indent,Y(q));D=`? ${D}
35
+ ${H}:`}else if(D=`${D}:`,q)D+=b$.lineComment(D,Q.indent,Y(q));let I,O,C;if(h0.isNode(Z))I=!!Z.spaceBefore,O=Z.commentBefore,C=Z.comment;else if(I=!1,O=null,C=null,Z&&typeof Z==="object")Z=J.createNode(Z);if(Q.implicitKey=!1,!K&&!q&&h0.isScalar(Z))Q.indentAtStart=D.length+1;if(B=!1,!G&&V.length>=2&&!Q.inFlow&&!K&&h0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let P=!1,N=N1.stringify(Z,Q,()=>P=!0,()=>B=!0),T=" ";if(q||I||O){if(T=I?`
36
36
  `:"",O){let w=Y(O);T+=`
37
- ${E$.indentComment(w,Q.indent)}`}if(N===""&&!Q.inFlow){if(T===`
37
+ ${b$.indentComment(w,Q.indent)}`}if(N===""&&!Q.inFlow){if(T===`
38
38
  `&&C)T=`
39
39
 
40
40
  `}else T+=`
41
- ${Q.indent}`}else if(!K&&k0.isCollection(Z)){let w=N[0],F=N.indexOf(`
41
+ ${Q.indent}`}else if(!K&&h0.isCollection(Z)){let w=N[0],F=N.indexOf(`
42
42
  `),E=F!==-1,r=Q.inFlow??Z.flow??Z.items.length===0;if(E||!r){let t=!1;if(E&&(w==="&"||w==="!")){let v=N.indexOf(" ");if(w==="&"&&v!==-1&&v<F&&N[v+1]==="!")v=N.indexOf(" ",v+1);if(v===-1||F<v)t=!0}if(!t)T=`
43
43
  ${Q.indent}`}}else if(N===""||N[0]===`
44
- `)T="";if(D+=T+N,Q.inFlow){if(P&&z)z()}else if(C&&!P)D+=E$.lineComment(D,Q.indent,Y(C));else if(B&&X)X();return D}VJ.stringifyPair=HJ});var P4=_((qJ)=>{var T1=M$("process");function GJ($,...Z){if($==="debug")console.log(...Z)}function WJ($,Z){if($==="debug"||$==="warn")if(typeof T1.emitWarning==="function")T1.emitWarning(Z);else console.warn(Z)}qJ.debug=GJ;qJ.warn=WJ});var h6=_((LJ)=>{var k6=g(),A1=i(),g6="<<",v6={identify:($)=>$===g6||typeof $==="symbol"&&$.description===g6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new A1.Scalar(Symbol(g6)),{addToJSMap:C1}),stringify:()=>g6},DJ=($,Z)=>(v6.identify(Z)||k6.isScalar(Z)&&(!Z.type||Z.type===A1.Scalar.PLAIN)&&v6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===v6.tag&&Q.default);function C1($,Z,Q){let z=j1($,Q);if(k6.isSeq(z))for(let X of z.items)R4($,Z,X);else if(Array.isArray(z))for(let X of z)R4($,Z,X);else R4($,Z,z)}function R4($,Z,Q){let z=j1($,Q);if(!k6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[U,J]of X)if(Z instanceof Map){if(!Z.has(U))Z.set(U,J)}else if(Z instanceof Set)Z.add(U);else if(!Object.prototype.hasOwnProperty.call(Z,U))Object.defineProperty(Z,U,{value:J,writable:!0,enumerable:!0,configurable:!0});return Z}function j1($,Z){return $&&k6.isAlias(Z)?Z.resolve($.doc,$):Z}LJ.addMergeToJSMap=C1;LJ.isMergeKey=DJ;LJ.merge=v6});var T4=_((NJ)=>{var _J=P4(),w1=h6(),FJ=S$(),S1=g(),N4=l0();function PJ($,Z,{key:Q,value:z}){if(S1.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(w1.isMergeKey($,Q))w1.addMergeToJSMap($,Z,z);else{let X=N4.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,N4.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let U=RJ(Q,X,$),J=N4.toJS(z,U,$);if(U in Z)Object.defineProperty(Z,U,{value:J,writable:!0,enumerable:!0,configurable:!0});else Z[U]=J}}return Z}function RJ($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(S1.isNode($)&&Q?.doc){let z=FJ.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let U of Q.anchors.keys())z.anchors.add(U.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let U=JSON.stringify(X);if(U.length>40)U=U.substring(0,36)+'..."';_J.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}NJ.addPairToJSMap=PJ});var i0=_((wJ)=>{var E1=A$(),AJ=N1(),CJ=T4(),u6=g();function jJ($,Z,Q){let z=E1.createNode($,void 0,Q),X=E1.createNode(Z,void 0,Q);return new m6(z,X)}class m6{constructor($,Z=null){Object.defineProperty(this,u6.NODE_TYPE,{value:u6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(u6.isNode(Z))Z=Z.clone($);if(u6.isNode(Q))Q=Q.clone($);return new m6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return CJ.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?AJ.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}wJ.Pair=m6;wJ.createPair=jJ});var A4=_((gJ)=>{var Y2=g(),b1=S$(),f6=C$();function bJ($,Z,Q){return(Z.inFlow??$.flow?xJ:yJ)($,Z,Q)}function yJ({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:U,onChompKeep:J,onComment:H}){let{indent:V,options:{commentString:Y}}=Q,G=Object.assign({},Q,{indent:U,type:null}),W=!1,q=[];for(let L=0;L<Z.length;++L){let B=Z[L],D=null;if(Y2.isNode(B)){if(!W&&B.spaceBefore)q.push("");if(p6(Q,q,B.commentBefore,W),B.comment)D=B.comment}else if(Y2.isPair(B)){let O=Y2.isNode(B.key)?B.key:null;if(O){if(!W&&O.spaceBefore)q.push("");p6(Q,q,O.commentBefore,W)}}W=!1;let I=b1.stringify(B,G,()=>D=null,()=>W=!0);if(D)I+=f6.lineComment(I,U,Y(D));if(W&&D)W=!1;q.push(z+I)}let K;if(q.length===0)K=X.start+X.end;else{K=q[0];for(let L=1;L<q.length;++L){let B=q[L];K+=B?`
44
+ `)T="";if(D+=T+N,Q.inFlow){if(P&&z)z()}else if(C&&!P)D+=b$.lineComment(D,Q.indent,Y(C));else if(B&&X)X();return D}VJ.stringifyPair=HJ});var R4=_((qJ)=>{var A1=I$("process");function GJ($,...Z){if($==="debug")console.log(...Z)}function WJ($,Z){if($==="debug"||$==="warn")if(typeof A1.emitWarning==="function")A1.emitWarning(Z);else console.warn(Z)}qJ.debug=GJ;qJ.warn=WJ});var h6=_((LJ)=>{var k6=g(),C1=i(),g6="<<",v6={identify:($)=>$===g6||typeof $==="symbol"&&$.description===g6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new C1.Scalar(Symbol(g6)),{addToJSMap:j1}),stringify:()=>g6},DJ=($,Z)=>(v6.identify(Z)||k6.isScalar(Z)&&(!Z.type||Z.type===C1.Scalar.PLAIN)&&v6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===v6.tag&&Q.default);function j1($,Z,Q){let z=w1($,Q);if(k6.isSeq(z))for(let X of z.items)N4($,Z,X);else if(Array.isArray(z))for(let X of z)N4($,Z,X);else N4($,Z,z)}function N4($,Z,Q){let z=w1($,Q);if(!k6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[U,J]of X)if(Z instanceof Map){if(!Z.has(U))Z.set(U,J)}else if(Z instanceof Set)Z.add(U);else if(!Object.prototype.hasOwnProperty.call(Z,U))Object.defineProperty(Z,U,{value:J,writable:!0,enumerable:!0,configurable:!0});return Z}function w1($,Z){return $&&k6.isAlias(Z)?Z.resolve($.doc,$):Z}LJ.addMergeToJSMap=j1;LJ.isMergeKey=DJ;LJ.merge=v6});var A4=_((NJ)=>{var _J=R4(),S1=h6(),FJ=E$(),E1=g(),T4=l0();function PJ($,Z,{key:Q,value:z}){if(E1.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(S1.isMergeKey($,Q))S1.addMergeToJSMap($,Z,z);else{let X=T4.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,T4.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let U=RJ(Q,X,$),J=T4.toJS(z,U,$);if(U in Z)Object.defineProperty(Z,U,{value:J,writable:!0,enumerable:!0,configurable:!0});else Z[U]=J}}return Z}function RJ($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(E1.isNode($)&&Q?.doc){let z=FJ.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let U of Q.anchors.keys())z.anchors.add(U.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let U=JSON.stringify(X);if(U.length>40)U=U.substring(0,36)+'..."';_J.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}NJ.addPairToJSMap=PJ});var i0=_((wJ)=>{var b1=C$(),AJ=T1(),CJ=A4(),u6=g();function jJ($,Z,Q){let z=b1.createNode($,void 0,Q),X=b1.createNode(Z,void 0,Q);return new m6(z,X)}class m6{constructor($,Z=null){Object.defineProperty(this,u6.NODE_TYPE,{value:u6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(u6.isNode(Z))Z=Z.clone($);if(u6.isNode(Q))Q=Q.clone($);return new m6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return CJ.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?AJ.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}wJ.Pair=m6;wJ.createPair=jJ});var C4=_((gJ)=>{var Y2=g(),y1=E$(),f6=j$();function bJ($,Z,Q){return(Z.inFlow??$.flow?xJ:yJ)($,Z,Q)}function yJ({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:U,onChompKeep:J,onComment:H}){let{indent:V,options:{commentString:Y}}=Q,G=Object.assign({},Q,{indent:U,type:null}),W=!1,q=[];for(let L=0;L<Z.length;++L){let B=Z[L],D=null;if(Y2.isNode(B)){if(!W&&B.spaceBefore)q.push("");if(p6(Q,q,B.commentBefore,W),B.comment)D=B.comment}else if(Y2.isPair(B)){let O=Y2.isNode(B.key)?B.key:null;if(O){if(!W&&O.spaceBefore)q.push("");p6(Q,q,O.commentBefore,W)}}W=!1;let I=y1.stringify(B,G,()=>D=null,()=>W=!0);if(D)I+=f6.lineComment(I,U,Y(D));if(W&&D)W=!1;q.push(z+I)}let K;if(q.length===0)K=X.start+X.end;else{K=q[0];for(let L=1;L<q.length;++L){let B=q[L];K+=B?`
45
45
  ${V}${B}`:`
46
46
  `}}if($){if(K+=`
47
- `+f6.indentComment(Y($),V),H)H()}else if(W&&J)J();return K}function xJ({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:U,flowCollectionPadding:J,options:{commentString:H}}=Z;z+=U;let V=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),Y=!1,G=0,W=[];for(let L=0;L<$.length;++L){let B=$[L],D=null;if(Y2.isNode(B)){if(B.spaceBefore)W.push("");if(p6(Z,W,B.commentBefore,!1),B.comment)D=B.comment}else if(Y2.isPair(B)){let O=Y2.isNode(B.key)?B.key:null;if(O){if(O.spaceBefore)W.push("");if(p6(Z,W,O.commentBefore,!1),O.comment)Y=!0}let C=Y2.isNode(B.value)?B.value:null;if(C){if(C.comment)D=C.comment;if(C.commentBefore)Y=!0}else if(B.value==null&&O?.comment)D=O.comment}if(D)Y=!0;let I=b1.stringify(B,V,()=>D=null);if(Y||(Y=W.length>G||I.includes(`
47
+ `+f6.indentComment(Y($),V),H)H()}else if(W&&J)J();return K}function xJ({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:U,flowCollectionPadding:J,options:{commentString:H}}=Z;z+=U;let V=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),Y=!1,G=0,W=[];for(let L=0;L<$.length;++L){let B=$[L],D=null;if(Y2.isNode(B)){if(B.spaceBefore)W.push("");if(p6(Z,W,B.commentBefore,!1),B.comment)D=B.comment}else if(Y2.isPair(B)){let O=Y2.isNode(B.key)?B.key:null;if(O){if(O.spaceBefore)W.push("");if(p6(Z,W,O.commentBefore,!1),O.comment)Y=!0}let C=Y2.isNode(B.value)?B.value:null;if(C){if(C.comment)D=C.comment;if(C.commentBefore)Y=!0}else if(B.value==null&&O?.comment)D=O.comment}if(D)Y=!0;let I=y1.stringify(B,V,()=>D=null);if(Y||(Y=W.length>G||I.includes(`
48
48
  `)),L<$.length-1)I+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)Y||(Y=W.reduce((O,C)=>O+C.length+2,2)+(I.length+2)>Z.options.lineWidth);if(Y)I+=","}if(D)I+=f6.lineComment(I,z,H(D));W.push(I),G=W.length}let{start:q,end:K}=Q;if(W.length===0)return q+K;else{if(!Y){let L=W.reduce((B,D)=>B+D.length+2,2);Y=Z.options.lineWidth>0&&L>Z.options.lineWidth}if(Y){let L=q;for(let B of W)L+=B?`
49
49
  ${U}${X}${B}`:`
50
50
  `;return`${L}
51
- ${X}${K}`}else return`${q}${J}${W.join(" ")}${J}${K}`}}function p6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let U=f6.indentComment(Z(z),$);Q.push(U.trimStart())}}gJ.stringifyCollection=bJ});var r0=_((fJ)=>{var kJ=A4(),hJ=T4(),uJ=E6(),n0=g(),l6=i0(),mJ=i();function b$($,Z){let Q=n0.isScalar(Z)?Z.value:Z;for(let z of $)if(n0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(n0.isScalar(z.key)&&z.key.value===Q)return z}return}class y1 extends uJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(n0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,U=new this($),J=(H,V)=>{if(typeof X==="function")V=X.call(Z,H,V);else if(Array.isArray(X)&&!X.includes(H))return;if(V!==void 0||z)U.items.push(l6.createPair(H,V,Q))};if(Z instanceof Map)for(let[H,V]of Z)J(H,V);else if(Z&&typeof Z==="object")for(let H of Object.keys(Z))J(H,Z[H]);if(typeof $.sortMapEntries==="function")U.items.sort($.sortMapEntries);return U}add($,Z){let Q;if(n0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new l6.Pair($,$?.value);else Q=new l6.Pair($.key,$.value);let z=b$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(n0.isScalar(z.value)&&mJ.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let U=this.items.findIndex((J)=>X(Q,J)<0);if(U===-1)this.items.push(Q);else this.items.splice(U,0,Q)}else this.items.push(Q)}delete($){let Z=b$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=b$(this.items,$)?.value;return(!Z&&n0.isScalar(z)?z.value:z)??void 0}has($){return!!b$(this.items,$)}set($,Z){this.add(new l6.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)hJ.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!n0.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 kJ.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}fJ.YAMLMap=y1;fJ.findPair=b$});var p2=_((iJ)=>{var cJ=g(),x1=r0(),dJ={collection:"map",default:!0,nodeClass:x1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!cJ.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>x1.YAMLMap.from($,Z,Q)};iJ.map=dJ});var s0=_((eJ)=>{var rJ=A$(),sJ=A4(),oJ=E6(),d6=g(),aJ=i(),tJ=l0();class g1 extends oJ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(d6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=c6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=c6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&d6.isScalar(z)?z.value:z}has($){let Z=c6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=c6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(d6.isScalar(z)&&aJ.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(tJ.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return sJ.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let U=0;for(let J of Z){if(typeof z==="function"){let H=Z instanceof Set?J:String(U++);J=z.call(Z,H,J)}X.items.push(rJ.createNode(J,void 0,Q))}}return X}}function c6($){let Z=d6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}eJ.YAMLSeq=g1});var l2=_((zH)=>{var ZH=g(),v1=s0(),QH={collection:"seq",default:!0,nodeClass:v1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!ZH.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>v1.YAMLSeq.from($,Z,Q)};zH.seq=QH});var y$=_((HH)=>{var UH=w$(),JH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),UH.stringifyString($,Z,Q,z)}};HH.string=JH});var i6=_((YH)=>{var k1=i(),h1={identify:($)=>$==null,createNode:()=>new k1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new k1.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&h1.test.test($)?$:Z.options.nullStr};YH.nullTag=h1});var C4=_((qH)=>{var WH=i(),u1={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new WH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&u1.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};qH.boolTag=u1});var c2=_((DH)=>{function KH({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let U=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(U)&&!U.includes("e")){let J=U.indexOf(".");if(J<0)J=U.length,U+=".";let H=Z-(U.length-J-1);while(H-- >0)U+="0"}return U}DH.stringifyNumber=KH});var w4=_((FH)=>{var MH=i(),j4=c2(),IH={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:j4.stringifyNumber},OH={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():j4.stringifyNumber($)}},_H={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new MH.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:j4.stringifyNumber};FH.float=_H;FH.floatExp=OH;FH.floatNaN=IH});var E4=_((jH)=>{var m1=c2(),n6=($)=>typeof $==="bigint"||Number.isInteger($),S4=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function f1($,Z,Q){let{value:z}=$;if(n6(z)&&z>=0)return Q+z.toString(Z);return m1.stringifyNumber($)}var TH={identify:($)=>n6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>S4($,2,8,Q),stringify:($)=>f1($,8,"0o")},AH={identify:n6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>S4($,0,10,Q),stringify:m1.stringifyNumber},CH={identify:($)=>n6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>S4($,2,16,Q),stringify:($)=>f1($,16,"0x")};jH.int=AH;jH.intHex=CH;jH.intOct=TH});var p1=_((hH)=>{var bH=p2(),yH=i6(),xH=l2(),gH=y$(),vH=C4(),b4=w4(),y4=E4(),kH=[bH.map,xH.seq,gH.string,yH.nullTag,vH.boolTag,y4.intOct,y4.int,y4.intHex,b4.floatNaN,b4.floatExp,b4.float];hH.schema=kH});var c1=_((iH)=>{var mH=i(),fH=p2(),pH=l2();function l1($){return typeof $==="bigint"||Number.isInteger($)}var r6=({value:$})=>JSON.stringify($),lH=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:r6},{identify:($)=>$==null,createNode:()=>new mH.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:r6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:r6},{identify:l1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>l1($)?$.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:r6}],cH={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},dH=[fH.map,pH.seq].concat(lH,cH);iH.schema=dH});var g4=_((oH)=>{var x$=M$("buffer"),x4=i(),rH=w$(),sH={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof x$.Buffer==="function")return x$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,U){if(!Q)return"";let J=Q,H;if(typeof x$.Buffer==="function")H=J instanceof x$.Buffer?J.toString("base64"):x$.Buffer.from(J.buffer).toString("base64");else if(typeof btoa==="function"){let V="";for(let Y=0;Y<J.length;++Y)V+=String.fromCharCode(J[Y]);H=btoa(V)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=x4.Scalar.BLOCK_LITERAL),Z!==x4.Scalar.QUOTE_DOUBLE){let V=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),Y=Math.ceil(H.length/V),G=Array(Y);for(let W=0,q=0;W<Y;++W,q+=V)G[W]=H.substr(q,V);H=G.join(Z===x4.Scalar.BLOCK_LITERAL?`
52
- `:" ")}return rH.stringifyString({comment:$,type:Z,value:H},z,X,U)}};oH.binary=sH});var o6=_((ZV)=>{var s6=g(),v4=i0(),tH=i(),eH=s0();function d1($,Z){if(s6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(s6.isPair(z))continue;else if(s6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new v4.Pair(new tH.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
51
+ ${X}${K}`}else return`${q}${J}${W.join(" ")}${J}${K}`}}function p6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let U=f6.indentComment(Z(z),$);Q.push(U.trimStart())}}gJ.stringifyCollection=bJ});var r0=_((fJ)=>{var kJ=C4(),hJ=A4(),uJ=E6(),n0=g(),l6=i0(),mJ=i();function y$($,Z){let Q=n0.isScalar(Z)?Z.value:Z;for(let z of $)if(n0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(n0.isScalar(z.key)&&z.key.value===Q)return z}return}class x1 extends uJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(n0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,U=new this($),J=(H,V)=>{if(typeof X==="function")V=X.call(Z,H,V);else if(Array.isArray(X)&&!X.includes(H))return;if(V!==void 0||z)U.items.push(l6.createPair(H,V,Q))};if(Z instanceof Map)for(let[H,V]of Z)J(H,V);else if(Z&&typeof Z==="object")for(let H of Object.keys(Z))J(H,Z[H]);if(typeof $.sortMapEntries==="function")U.items.sort($.sortMapEntries);return U}add($,Z){let Q;if(n0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new l6.Pair($,$?.value);else Q=new l6.Pair($.key,$.value);let z=y$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(n0.isScalar(z.value)&&mJ.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let U=this.items.findIndex((J)=>X(Q,J)<0);if(U===-1)this.items.push(Q);else this.items.splice(U,0,Q)}else this.items.push(Q)}delete($){let Z=y$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=y$(this.items,$)?.value;return(!Z&&n0.isScalar(z)?z.value:z)??void 0}has($){return!!y$(this.items,$)}set($,Z){this.add(new l6.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)hJ.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!n0.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 kJ.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}fJ.YAMLMap=x1;fJ.findPair=y$});var p2=_((iJ)=>{var cJ=g(),g1=r0(),dJ={collection:"map",default:!0,nodeClass:g1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!cJ.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>g1.YAMLMap.from($,Z,Q)};iJ.map=dJ});var s0=_((eJ)=>{var rJ=C$(),sJ=C4(),oJ=E6(),d6=g(),aJ=i(),tJ=l0();class v1 extends oJ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(d6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=c6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=c6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&d6.isScalar(z)?z.value:z}has($){let Z=c6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=c6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(d6.isScalar(z)&&aJ.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(tJ.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return sJ.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let U=0;for(let J of Z){if(typeof z==="function"){let H=Z instanceof Set?J:String(U++);J=z.call(Z,H,J)}X.items.push(rJ.createNode(J,void 0,Q))}}return X}}function c6($){let Z=d6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}eJ.YAMLSeq=v1});var l2=_((zH)=>{var ZH=g(),k1=s0(),QH={collection:"seq",default:!0,nodeClass:k1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!ZH.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>k1.YAMLSeq.from($,Z,Q)};zH.seq=QH});var x$=_((HH)=>{var UH=S$(),JH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),UH.stringifyString($,Z,Q,z)}};HH.string=JH});var i6=_((YH)=>{var h1=i(),u1={identify:($)=>$==null,createNode:()=>new h1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h1.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&u1.test.test($)?$:Z.options.nullStr};YH.nullTag=u1});var j4=_((qH)=>{var WH=i(),m1={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new WH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&m1.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};qH.boolTag=m1});var c2=_((DH)=>{function KH({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let U=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(U)&&!U.includes("e")){let J=U.indexOf(".");if(J<0)J=U.length,U+=".";let H=Z-(U.length-J-1);while(H-- >0)U+="0"}return U}DH.stringifyNumber=KH});var S4=_((FH)=>{var MH=i(),w4=c2(),IH={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:w4.stringifyNumber},OH={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():w4.stringifyNumber($)}},_H={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new MH.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:w4.stringifyNumber};FH.float=_H;FH.floatExp=OH;FH.floatNaN=IH});var b4=_((jH)=>{var f1=c2(),n6=($)=>typeof $==="bigint"||Number.isInteger($),E4=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function p1($,Z,Q){let{value:z}=$;if(n6(z)&&z>=0)return Q+z.toString(Z);return f1.stringifyNumber($)}var TH={identify:($)=>n6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>E4($,2,8,Q),stringify:($)=>p1($,8,"0o")},AH={identify:n6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>E4($,0,10,Q),stringify:f1.stringifyNumber},CH={identify:($)=>n6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>E4($,2,16,Q),stringify:($)=>p1($,16,"0x")};jH.int=AH;jH.intHex=CH;jH.intOct=TH});var l1=_((hH)=>{var bH=p2(),yH=i6(),xH=l2(),gH=x$(),vH=j4(),y4=S4(),x4=b4(),kH=[bH.map,xH.seq,gH.string,yH.nullTag,vH.boolTag,x4.intOct,x4.int,x4.intHex,y4.floatNaN,y4.floatExp,y4.float];hH.schema=kH});var d1=_((iH)=>{var mH=i(),fH=p2(),pH=l2();function c1($){return typeof $==="bigint"||Number.isInteger($)}var r6=({value:$})=>JSON.stringify($),lH=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:r6},{identify:($)=>$==null,createNode:()=>new mH.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:r6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:r6},{identify:c1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>c1($)?$.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:r6}],cH={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},dH=[fH.map,pH.seq].concat(lH,cH);iH.schema=dH});var v4=_((oH)=>{var g$=I$("buffer"),g4=i(),rH=S$(),sH={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof g$.Buffer==="function")return g$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,U){if(!Q)return"";let J=Q,H;if(typeof g$.Buffer==="function")H=J instanceof g$.Buffer?J.toString("base64"):g$.Buffer.from(J.buffer).toString("base64");else if(typeof btoa==="function"){let V="";for(let Y=0;Y<J.length;++Y)V+=String.fromCharCode(J[Y]);H=btoa(V)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=g4.Scalar.BLOCK_LITERAL),Z!==g4.Scalar.QUOTE_DOUBLE){let V=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),Y=Math.ceil(H.length/V),G=Array(Y);for(let W=0,q=0;W<Y;++W,q+=V)G[W]=H.substr(q,V);H=G.join(Z===g4.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return rH.stringifyString({comment:$,type:Z,value:H},z,X,U)}};oH.binary=sH});var o6=_((ZV)=>{var s6=g(),k4=i0(),tH=i(),eH=s0();function i1($,Z){if(s6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(s6.isPair(z))continue;else if(s6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new k4.Pair(new tH.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
53
53
  ${X.key.commentBefore}`:z.commentBefore;if(z.comment){let U=X.value??X.key;U.comment=U.comment?`${z.comment}
54
- ${U.comment}`:z.comment}z=X}$.items[Q]=s6.isPair(z)?z:new v4.Pair(z)}else Z("Expected a sequence for this tag");return $}function i1($,Z,Q){let{replacer:z}=Q,X=new eH.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let U=0;if(Z&&Symbol.iterator in Object(Z))for(let J of Z){if(typeof z==="function")J=z.call(Z,String(U++),J);let H,V;if(Array.isArray(J))if(J.length===2)H=J[0],V=J[1];else throw TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let Y=Object.keys(J);if(Y.length===1)H=Y[0],V=J[H];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else H=J;X.items.push(v4.createPair(H,V,Q))}return X}var $V={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d1,createNode:i1};ZV.createPairs=i1;ZV.pairs=$V;ZV.resolvePairs=d1});var h4=_((HV)=>{var n1=g(),k4=l0(),g$=r0(),UV=s0(),r1=o6();class G2 extends UV.YAMLSeq{constructor(){super();this.add=g$.YAMLMap.prototype.add.bind(this),this.delete=g$.YAMLMap.prototype.delete.bind(this),this.get=g$.YAMLMap.prototype.get.bind(this),this.has=g$.YAMLMap.prototype.has.bind(this),this.set=g$.YAMLMap.prototype.set.bind(this),this.tag=G2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,U;if(n1.isPair(z))X=k4.toJS(z.key,"",Z),U=k4.toJS(z.value,X,Z);else X=k4.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,U)}return Q}static from($,Z,Q){let z=r1.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}G2.tag="tag:yaml.org,2002:omap";var JV={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=r1.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(n1.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)};HV.YAMLOMap=G2;HV.omap=JV});var e1=_((GV)=>{var s1=i();function o1({value:$,source:Z},Q){if(Z&&($?a1:t1).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var a1={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s1.Scalar(!0),stringify:o1},t1={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s1.Scalar(!1),stringify:o1};GV.falseTag=t1;GV.trueTag=a1});var $7=_((MV)=>{var BV=i(),u4=c2(),KV={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:u4.stringifyNumber},DV={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():u4.stringifyNumber($)}},LV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new BV.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:u4.stringifyNumber};MV.float=LV;MV.floatExp=DV;MV.floatNaN=KV});var Q7=_((TV)=>{var Z7=c2(),v$=($)=>typeof $==="bigint"||Number.isInteger($);function a6($,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 J=BigInt($);return X==="-"?BigInt(-1)*J:J}let U=parseInt($,Q);return X==="-"?-1*U:U}function m4($,Z,Q){let{value:z}=$;if(v$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return Z7.stringifyNumber($)}var FV={identify:v$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>a6($,2,2,Q),stringify:($)=>m4($,2,"0b")},PV={identify:v$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>a6($,1,8,Q),stringify:($)=>m4($,8,"0")},RV={identify:v$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>a6($,0,10,Q),stringify:Z7.stringifyNumber},NV={identify:v$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>a6($,2,16,Q),stringify:($)=>m4($,16,"0x")};TV.int=RV;TV.intBin=FV;TV.intHex=NV;TV.intOct=PV});var f4=_((EV)=>{var $8=g(),t6=i0(),e6=r0();class W2 extends e6.YAMLMap{constructor($){super($);this.tag=W2.tag}add($){let Z;if($8.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new t6.Pair($.key,null);else Z=new t6.Pair($,null);if(!e6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=e6.findPair(this.items,$);return!Z&&$8.isPair(Q)?$8.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=e6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new t6.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,U,U);X.items.push(t6.createPair(U,null,Q))}return X}}W2.tag="tag:yaml.org,2002:set";var SV={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($8.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 $}};EV.YAMLSet=W2;EV.set=SV});var l4=_((kV)=>{var xV=c2();function p4($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(J)=>Z?BigInt(J):Number(J),U=z.replace(/_/g,"").split(":").reduce((J,H)=>J*X(60)+X(H),X(0));return Q==="-"?X(-1)*U:U}function z7($){let{value:Z}=$,Q=(J)=>J;if(typeof Z==="bigint")Q=(J)=>BigInt(J);else if(isNaN(Z)||!isFinite(Z))return xV.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),U=[Z%X];if(Z<60)U.unshift(0);else if(Z=(Z-U[0])/X,U.unshift(Z%X),Z>=60)Z=(Z-U[0])/X,U.unshift(Z);return z+U.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var gV={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})=>p4($,Q),stringify:z7},vV={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:($)=>p4($,!1),stringify:z7},X7={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(X7.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,U,J,H]=Z.map(Number),V=Z[7]?Number((Z[7]+"00").substr(1,3)):0,Y=Date.UTC(Q,z-1,X,U||0,J||0,H||0,V),G=Z[8];if(G&&G!=="Z"){let W=p4(G,!1);if(Math.abs(W)<30)W*=60;Y-=60000*W}return new Date(Y)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};kV.floatTime=vV;kV.intTime=gV;kV.timestamp=X7});var J7=_((aV)=>{var fV=p2(),pV=i6(),lV=l2(),cV=y$(),dV=g4(),U7=e1(),c4=$7(),Z8=Q7(),iV=h6(),nV=h4(),rV=o6(),sV=f4(),d4=l4(),oV=[fV.map,lV.seq,cV.string,pV.nullTag,U7.trueTag,U7.falseTag,Z8.intBin,Z8.intOct,Z8.int,Z8.intHex,c4.floatNaN,c4.floatExp,c4.float,dV.binary,iV.merge,nV.omap,rV.pairs,sV.set,d4.intTime,d4.floatTime,d4.timestamp];aV.schema=oV});var L7=_((JY)=>{var G7=p2(),eV=i6(),W7=l2(),$Y=y$(),ZY=C4(),i4=w4(),n4=E4(),QY=p1(),zY=c1(),q7=g4(),k$=h6(),B7=h4(),K7=o6(),H7=J7(),D7=f4(),Q8=l4(),V7=new Map([["core",QY.schema],["failsafe",[G7.map,W7.seq,$Y.string]],["json",zY.schema],["yaml11",H7.schema],["yaml-1.1",H7.schema]]),Y7={binary:q7.binary,bool:ZY.boolTag,float:i4.float,floatExp:i4.floatExp,floatNaN:i4.floatNaN,floatTime:Q8.floatTime,int:n4.int,intHex:n4.intHex,intOct:n4.intOct,intTime:Q8.intTime,map:G7.map,merge:k$.merge,null:eV.nullTag,omap:B7.omap,pairs:K7.pairs,seq:W7.seq,set:D7.set,timestamp:Q8.timestamp},XY={"tag:yaml.org,2002:binary":q7.binary,"tag:yaml.org,2002:merge":k$.merge,"tag:yaml.org,2002:omap":B7.omap,"tag:yaml.org,2002:pairs":K7.pairs,"tag:yaml.org,2002:set":D7.set,"tag:yaml.org,2002:timestamp":Q8.timestamp};function UY($,Z,Q){let z=V7.get(Z);if(z&&!$)return Q&&!z.includes(k$.merge)?z.concat(k$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let U=Array.from(V7.keys()).filter((J)=>J!=="yaml11").map((J)=>JSON.stringify(J)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${U} or define customTags array`)}if(Array.isArray($))for(let U of $)X=X.concat(U);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(k$.merge);return X.reduce((U,J)=>{let H=typeof J==="string"?Y7[J]:J;if(!H){let V=JSON.stringify(J),Y=Object.keys(Y7).map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown custom tag ${V}; use one of ${Y}`)}if(!U.includes(H))U.push(H);return U},[])}JY.coreKnownTags=XY;JY.getTags=UY});var o4=_((BY)=>{var r4=g(),YY=p2(),GY=l2(),WY=y$(),z8=L7(),qY=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class s4{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:U,toStringDefaults:J}){this.compat=Array.isArray($)?z8.getTags($,"compat"):$?z8.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?z8.coreKnownTags:{},this.tags=z8.getTags(Z,this.name,Q),this.toStringOptions=J??null,Object.defineProperty(this,r4.MAP,{value:YY.map}),Object.defineProperty(this,r4.SCALAR,{value:WY.string}),Object.defineProperty(this,r4.SEQ,{value:GY.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?qY:null}clone(){let $=Object.create(s4.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}BY.Schema=s4});var M7=_((MY)=>{var DY=g(),a4=S$(),h$=C$();function LY($,Z){let Q=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let V=$.directives.toString($);if(V)Q.push(V),z=!0;else if($.directives.docStart)z=!0}if(z)Q.push("---");let X=a4.createStringifyContext($,Z),{commentString:U}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=U($.commentBefore);Q.unshift(h$.indentComment(V,""))}let J=!1,H=null;if($.contents){if(DY.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let G=U($.contents.commentBefore);Q.push(h$.indentComment(G,""))}X.forceBlockIndent=!!$.comment,H=$.contents.comment}let V=H?void 0:()=>J=!0,Y=a4.stringify($.contents,X,()=>H=null,V);if(H)Y+=h$.lineComment(Y,"",U(H));if((Y[0]==="|"||Y[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${Y}`;else Q.push(Y)}else Q.push(a4.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=U($.comment);if(V.includes(`
55
- `))Q.push("..."),Q.push(h$.indentComment(V,""));else Q.push(`... ${V}`)}else Q.push("...");else{let V=$.comment;if(V&&J)V=V.replace(/^\n+/,"");if(V){if((!J||H)&&Q[Q.length-1]!=="")Q.push("");Q.push(h$.indentComment(U(V),""))}}return Q.join(`
54
+ ${U.comment}`:z.comment}z=X}$.items[Q]=s6.isPair(z)?z:new k4.Pair(z)}else Z("Expected a sequence for this tag");return $}function n1($,Z,Q){let{replacer:z}=Q,X=new eH.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let U=0;if(Z&&Symbol.iterator in Object(Z))for(let J of Z){if(typeof z==="function")J=z.call(Z,String(U++),J);let H,V;if(Array.isArray(J))if(J.length===2)H=J[0],V=J[1];else throw TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let Y=Object.keys(J);if(Y.length===1)H=Y[0],V=J[H];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else H=J;X.items.push(k4.createPair(H,V,Q))}return X}var $V={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:i1,createNode:n1};ZV.createPairs=n1;ZV.pairs=$V;ZV.resolvePairs=i1});var u4=_((HV)=>{var r1=g(),h4=l0(),v$=r0(),UV=s0(),s1=o6();class G2 extends UV.YAMLSeq{constructor(){super();this.add=v$.YAMLMap.prototype.add.bind(this),this.delete=v$.YAMLMap.prototype.delete.bind(this),this.get=v$.YAMLMap.prototype.get.bind(this),this.has=v$.YAMLMap.prototype.has.bind(this),this.set=v$.YAMLMap.prototype.set.bind(this),this.tag=G2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,U;if(r1.isPair(z))X=h4.toJS(z.key,"",Z),U=h4.toJS(z.value,X,Z);else X=h4.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,U)}return Q}static from($,Z,Q){let z=s1.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}G2.tag="tag:yaml.org,2002:omap";var JV={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=s1.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(r1.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)};HV.YAMLOMap=G2;HV.omap=JV});var $7=_((GV)=>{var o1=i();function a1({value:$,source:Z},Q){if(Z&&($?t1:e1).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var t1={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new o1.Scalar(!0),stringify:a1},e1={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new o1.Scalar(!1),stringify:a1};GV.falseTag=e1;GV.trueTag=t1});var Z7=_((MV)=>{var BV=i(),m4=c2(),KV={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:m4.stringifyNumber},DV={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():m4.stringifyNumber($)}},LV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new BV.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:m4.stringifyNumber};MV.float=LV;MV.floatExp=DV;MV.floatNaN=KV});var z7=_((TV)=>{var Q7=c2(),k$=($)=>typeof $==="bigint"||Number.isInteger($);function a6($,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 J=BigInt($);return X==="-"?BigInt(-1)*J:J}let U=parseInt($,Q);return X==="-"?-1*U:U}function f4($,Z,Q){let{value:z}=$;if(k$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return Q7.stringifyNumber($)}var FV={identify:k$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>a6($,2,2,Q),stringify:($)=>f4($,2,"0b")},PV={identify:k$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>a6($,1,8,Q),stringify:($)=>f4($,8,"0")},RV={identify:k$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>a6($,0,10,Q),stringify:Q7.stringifyNumber},NV={identify:k$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>a6($,2,16,Q),stringify:($)=>f4($,16,"0x")};TV.int=RV;TV.intBin=FV;TV.intHex=NV;TV.intOct=PV});var p4=_((EV)=>{var $8=g(),t6=i0(),e6=r0();class W2 extends e6.YAMLMap{constructor($){super($);this.tag=W2.tag}add($){let Z;if($8.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new t6.Pair($.key,null);else Z=new t6.Pair($,null);if(!e6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=e6.findPair(this.items,$);return!Z&&$8.isPair(Q)?$8.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=e6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new t6.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,U,U);X.items.push(t6.createPair(U,null,Q))}return X}}W2.tag="tag:yaml.org,2002:set";var SV={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($8.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 $}};EV.YAMLSet=W2;EV.set=SV});var c4=_((kV)=>{var xV=c2();function l4($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(J)=>Z?BigInt(J):Number(J),U=z.replace(/_/g,"").split(":").reduce((J,H)=>J*X(60)+X(H),X(0));return Q==="-"?X(-1)*U:U}function X7($){let{value:Z}=$,Q=(J)=>J;if(typeof Z==="bigint")Q=(J)=>BigInt(J);else if(isNaN(Z)||!isFinite(Z))return xV.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),U=[Z%X];if(Z<60)U.unshift(0);else if(Z=(Z-U[0])/X,U.unshift(Z%X),Z>=60)Z=(Z-U[0])/X,U.unshift(Z);return z+U.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var gV={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})=>l4($,Q),stringify:X7},vV={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:($)=>l4($,!1),stringify:X7},U7={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(U7.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,U,J,H]=Z.map(Number),V=Z[7]?Number((Z[7]+"00").substr(1,3)):0,Y=Date.UTC(Q,z-1,X,U||0,J||0,H||0,V),G=Z[8];if(G&&G!=="Z"){let W=l4(G,!1);if(Math.abs(W)<30)W*=60;Y-=60000*W}return new Date(Y)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};kV.floatTime=vV;kV.intTime=gV;kV.timestamp=U7});var H7=_((aV)=>{var fV=p2(),pV=i6(),lV=l2(),cV=x$(),dV=v4(),J7=$7(),d4=Z7(),Z8=z7(),iV=h6(),nV=u4(),rV=o6(),sV=p4(),i4=c4(),oV=[fV.map,lV.seq,cV.string,pV.nullTag,J7.trueTag,J7.falseTag,Z8.intBin,Z8.intOct,Z8.int,Z8.intHex,d4.floatNaN,d4.floatExp,d4.float,dV.binary,iV.merge,nV.omap,rV.pairs,sV.set,i4.intTime,i4.floatTime,i4.timestamp];aV.schema=oV});var M7=_((JY)=>{var W7=p2(),eV=i6(),q7=l2(),$Y=x$(),ZY=j4(),n4=S4(),r4=b4(),QY=l1(),zY=d1(),B7=v4(),h$=h6(),K7=u4(),D7=o6(),V7=H7(),L7=p4(),Q8=c4(),Y7=new Map([["core",QY.schema],["failsafe",[W7.map,q7.seq,$Y.string]],["json",zY.schema],["yaml11",V7.schema],["yaml-1.1",V7.schema]]),G7={binary:B7.binary,bool:ZY.boolTag,float:n4.float,floatExp:n4.floatExp,floatNaN:n4.floatNaN,floatTime:Q8.floatTime,int:r4.int,intHex:r4.intHex,intOct:r4.intOct,intTime:Q8.intTime,map:W7.map,merge:h$.merge,null:eV.nullTag,omap:K7.omap,pairs:D7.pairs,seq:q7.seq,set:L7.set,timestamp:Q8.timestamp},XY={"tag:yaml.org,2002:binary":B7.binary,"tag:yaml.org,2002:merge":h$.merge,"tag:yaml.org,2002:omap":K7.omap,"tag:yaml.org,2002:pairs":D7.pairs,"tag:yaml.org,2002:set":L7.set,"tag:yaml.org,2002:timestamp":Q8.timestamp};function UY($,Z,Q){let z=Y7.get(Z);if(z&&!$)return Q&&!z.includes(h$.merge)?z.concat(h$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let U=Array.from(Y7.keys()).filter((J)=>J!=="yaml11").map((J)=>JSON.stringify(J)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${U} or define customTags array`)}if(Array.isArray($))for(let U of $)X=X.concat(U);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(h$.merge);return X.reduce((U,J)=>{let H=typeof J==="string"?G7[J]:J;if(!H){let V=JSON.stringify(J),Y=Object.keys(G7).map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown custom tag ${V}; use one of ${Y}`)}if(!U.includes(H))U.push(H);return U},[])}JY.coreKnownTags=XY;JY.getTags=UY});var a4=_((BY)=>{var s4=g(),YY=p2(),GY=l2(),WY=x$(),z8=M7(),qY=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class o4{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:U,toStringDefaults:J}){this.compat=Array.isArray($)?z8.getTags($,"compat"):$?z8.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?z8.coreKnownTags:{},this.tags=z8.getTags(Z,this.name,Q),this.toStringOptions=J??null,Object.defineProperty(this,s4.MAP,{value:YY.map}),Object.defineProperty(this,s4.SCALAR,{value:WY.string}),Object.defineProperty(this,s4.SEQ,{value:GY.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?qY:null}clone(){let $=Object.create(o4.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}BY.Schema=o4});var I7=_((MY)=>{var DY=g(),t4=E$(),u$=j$();function LY($,Z){let Q=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let V=$.directives.toString($);if(V)Q.push(V),z=!0;else if($.directives.docStart)z=!0}if(z)Q.push("---");let X=t4.createStringifyContext($,Z),{commentString:U}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=U($.commentBefore);Q.unshift(u$.indentComment(V,""))}let J=!1,H=null;if($.contents){if(DY.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let G=U($.contents.commentBefore);Q.push(u$.indentComment(G,""))}X.forceBlockIndent=!!$.comment,H=$.contents.comment}let V=H?void 0:()=>J=!0,Y=t4.stringify($.contents,X,()=>H=null,V);if(H)Y+=u$.lineComment(Y,"",U(H));if((Y[0]==="|"||Y[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${Y}`;else Q.push(Y)}else Q.push(t4.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=U($.comment);if(V.includes(`
55
+ `))Q.push("..."),Q.push(u$.indentComment(V,""));else Q.push(`... ${V}`)}else Q.push("...");else{let V=$.comment;if(V&&J)V=V.replace(/^\n+/,"");if(V){if((!J||H)&&Q[Q.length-1]!=="")Q.push("");Q.push(u$.indentComment(U(V),""))}}return Q.join(`
56
56
  `)+`
57
- `}MY.stringifyDocument=LY});var u$=_((AY)=>{var OY=T$(),d2=E6(),Y0=g(),_Y=i0(),FY=l0(),PY=o4(),RY=M7(),t4=j6(),NY=M4(),TY=A$(),e4=L4();class $5{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y0.NODE_TYPE,{value:Y0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:U}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new e4.Directives({version:U});this.setSchema(U,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create($5.prototype,{[Y0.NODE_TYPE]:{value:Y0.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=Y0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(i2(this.contents))this.contents.add($)}addIn($,Z){if(i2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=t4.anchorNames(this);$.anchor=!Z||Q.has(Z)?t4.findNewAnchor(Z||"a",Q):Z}return new OY.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,D=Z.filter(B).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:U,flow:J,keepUndefined:H,onTagObj:V,tag:Y}=Q??{},{onAnchor:G,setAnchors:W,sourceObjects:q}=t4.createNodeAnchors(this,U||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:H??!1,onAnchor:G,onTagObj:V,replacer:z,schema:this.schema,sourceObjects:q},L=TY.createNode($,Y,K);if(J&&Y0.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 _Y.Pair(z,X)}delete($){return i2(this.contents)?this.contents.delete($):!1}deleteIn($){if(d2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return i2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return Y0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(d2.isEmptyPath($))return!Z&&Y0.isScalar(this.contents)?this.contents.value:this.contents;return Y0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return Y0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(d2.isEmptyPath($))return this.contents!==void 0;return Y0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=d2.collectionFromPath(this.schema,[$],Z);else if(i2(this.contents))this.contents.set($,Z)}setIn($,Z){if(d2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=d2.collectionFromPath(this.schema,Array.from($),Z);else if(i2(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 e4.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 e4.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 PY.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:U}={}){let J={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},H=FY.toJS(this.contents,Z??"",J);if(typeof X==="function")for(let{count:V,res:Y}of J.anchors.values())X(Y,V);return typeof U==="function"?NY.applyReviver(U,{"":H},"",H):H}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 RY.stringifyDocument(this,$)}}function i2($){if(Y0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}AY.Document=$5});var m$=_((wY)=>{class X8 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class I7 extends X8{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class O7 extends X8{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var jY=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((H)=>Z.linePos(H));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let U=X-1,J=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(U>=60&&J.length>80){let H=Math.min(U-39,J.length-79);J="…"+J.substring(H),U-=H-1}if(J.length>80)J=J.substring(0,79)+"…";if(z>1&&/^ *$/.test(J.substring(0,U))){let H=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(H.length>80)H=H.substring(0,79)+`…
57
+ `}MY.stringifyDocument=LY});var m$=_((AY)=>{var OY=A$(),d2=E6(),Y0=g(),_Y=i0(),FY=l0(),PY=a4(),RY=I7(),e4=j6(),NY=I4(),TY=C$(),$5=M4();class Z5{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y0.NODE_TYPE,{value:Y0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:U}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new $5.Directives({version:U});this.setSchema(U,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(Z5.prototype,{[Y0.NODE_TYPE]:{value:Y0.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=Y0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(i2(this.contents))this.contents.add($)}addIn($,Z){if(i2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=e4.anchorNames(this);$.anchor=!Z||Q.has(Z)?e4.findNewAnchor(Z||"a",Q):Z}return new OY.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,D=Z.filter(B).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:U,flow:J,keepUndefined:H,onTagObj:V,tag:Y}=Q??{},{onAnchor:G,setAnchors:W,sourceObjects:q}=e4.createNodeAnchors(this,U||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:H??!1,onAnchor:G,onTagObj:V,replacer:z,schema:this.schema,sourceObjects:q},L=TY.createNode($,Y,K);if(J&&Y0.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 _Y.Pair(z,X)}delete($){return i2(this.contents)?this.contents.delete($):!1}deleteIn($){if(d2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return i2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return Y0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(d2.isEmptyPath($))return!Z&&Y0.isScalar(this.contents)?this.contents.value:this.contents;return Y0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return Y0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(d2.isEmptyPath($))return this.contents!==void 0;return Y0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=d2.collectionFromPath(this.schema,[$],Z);else if(i2(this.contents))this.contents.set($,Z)}setIn($,Z){if(d2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=d2.collectionFromPath(this.schema,Array.from($),Z);else if(i2(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 $5.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 $5.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 PY.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:U}={}){let J={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},H=FY.toJS(this.contents,Z??"",J);if(typeof X==="function")for(let{count:V,res:Y}of J.anchors.values())X(Y,V);return typeof U==="function"?NY.applyReviver(U,{"":H},"",H):H}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 RY.stringifyDocument(this,$)}}function i2($){if(Y0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}AY.Document=Z5});var f$=_((wY)=>{class X8 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class O7 extends X8{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class _7 extends X8{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var jY=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((H)=>Z.linePos(H));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let U=X-1,J=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(U>=60&&J.length>80){let H=Math.min(U-39,J.length-79);J="…"+J.substring(H),U-=H-1}if(J.length>80)J=J.substring(0,79)+"…";if(z>1&&/^ *$/.test(J.substring(0,U))){let H=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(H.length>80)H=H.substring(0,79)+`…
58
58
  `;J=H+J}if(/[^ ]/.test(J)){let H=1,V=Q.linePos[1];if(V?.line===z&&V.col>X)H=Math.max(1,Math.min(V.col-X,80-U));let Y=" ".repeat(U)+"^".repeat(H);Q.message+=`:
59
59
 
60
60
  ${J}
61
61
  ${Y}
62
- `}};wY.YAMLError=X8;wY.YAMLParseError=I7;wY.YAMLWarning=O7;wY.prettifyError=jY});var f$=_((gY)=>{function xY($,{flow:Z,indicator:Q,next:z,offset:X,onError:U,parentIndent:J,startOnNewline:H}){let V=!1,Y=H,G=H,W="",q="",K=!1,L=!1,B=null,D=null,I=null,O=null,C=null,P=null,N=null;for(let F of $){if(L){if(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma")U(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(B){if(Y&&F.type!=="comment"&&F.type!=="newline")U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(F.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&F.source.includes("\t"))B=F;G=!0;break;case"comment":{if(!G)U(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=F.source.substring(1)||" ";if(!W)W=E;else W+=q+E;q="",Y=!1;break}case"newline":if(Y){if(W)W+=F.source;else if(!P||Q!=="seq-item-ind")V=!0}else q+=F.source;if(Y=!0,K=!0,D||I)O=F;G=!0;break;case"anchor":if(D)U(F,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(F.source.endsWith(":"))U(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=F,N??(N=F.offset),Y=!1,G=!1,L=!0;break;case"tag":{if(I)U(F,"MULTIPLE_TAGS","A node can have at most one tag");I=F,N??(N=F.offset),Y=!1,G=!1,L=!0;break}case Q:if(D||I)U(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`);if(P)U(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${Z??"collection"}`);P=F,Y=Q==="seq-item-ind"||Q==="explicit-key-ind",G=!1;break;case"comma":if(Z){if(C)U(F,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);C=F,Y=!1,G=!1;break}default:U(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),Y=!1,G=!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!==""))U(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(Y&&B.indent<=J||z?.type==="block-map"||z?.type==="block-seq"))U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:P,spaceBefore:V,comment:W,hasNewline:K,anchor:D,tag:I,newlineAfterProp:O,end:w,start:N??w}}gY.resolveProps=xY});var U8=_((kY)=>{function Z5($){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(Z5(Z.key)||Z5(Z.value))return!0}return!1;default:return!0}}kY.containsNewline=Z5});var Q5=_((fY)=>{var uY=U8();function mY($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&uY.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fY.flowIndentCheck=mY});var z5=_((cY)=>{var _7=g();function lY($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(U,J)=>U===J||_7.isScalar(U)&&_7.isScalar(J)&&U.value===J.value;return Z.some((U)=>X(U.key,Q))}cY.mapIncludes=lY});var T7=_((oY)=>{var F7=i0(),iY=r0(),P7=f$(),nY=U8(),R7=Q5(),rY=z5(),N7="All mapping items must start at the same column";function sY({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=new(U?.nodeClass??iY.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let V=z.offset,Y=null;for(let G of z.items){let{start:W,key:q,sep:K,value:L}=G,B=P7.resolveProps(W,{indicator:"explicit-key-ind",next:q??K?.[0],offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!B.found;if(D){if(q){if(q.type==="block-seq")X(V,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in q&&q.indent!==z.indent)X(V,"BAD_INDENT",N7)}if(!B.anchor&&!B.tag&&!K){if(Y=B.end,B.comment)if(H.comment)H.comment+=`
64
- `+B.comment;else H.comment=B.comment;continue}if(B.newlineAfterProp||nY.containsNewline(q))X(q??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)X(V,"BAD_INDENT",N7);Q.atKey=!0;let I=B.end,O=q?$(Q,q,B,X):Z(Q,I,W,null,B,X);if(Q.schema.compat)R7.flowIndentCheck(z.indent,q,X);if(Q.atKey=!1,rY.mapIncludes(Q,H.items,O))X(I,"DUPLICATE_KEY","Map keys must be unique");let C=P7.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:O.range[2],onError:X,parentIndent:z.indent,startOnNewline:!q||q.type==="block-scalar"});if(V=C.end,C.found){if(D){if(L?.type==="block-map"&&!C.hasNewline)X(V,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&B.start<C.found.offset-1024)X(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let P=L?$(Q,L,C,X):Z(Q,V,K,null,C,X);if(Q.schema.compat)R7.flowIndentCheck(z.indent,L,X);V=P.range[2];let N=new F7.Pair(O,P);if(Q.options.keepSourceTokens)N.srcToken=G;H.items.push(N)}else{if(D)X(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(O.comment)O.comment+=`
65
- `+C.comment;else O.comment=C.comment;let P=new F7.Pair(O);if(Q.options.keepSourceTokens)P.srcToken=G;H.items.push(P)}}if(Y&&Y<V)X(Y,"IMPOSSIBLE","Map comment with trailing content");return H.range=[z.offset,V,Y??V],H}oY.resolveBlockMap=sY});var A7=_((QG)=>{var tY=s0(),eY=f$(),$G=Q5();function ZG({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=new(U?.nodeClass??tY.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let V=z.offset,Y=null;for(let{start:G,value:W}of z.items){let q=eY.resolveProps(G,{indicator:"seq-item-ind",next:W,offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!q.found)if(q.anchor||q.tag||W)if(W?.type==="block-seq")X(q.end,"BAD_INDENT","All sequence items must start at the same column");else X(V,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=q.end,q.comment)H.comment=q.comment;continue}let K=W?$(Q,W,q,X):Z(Q,q.end,G,null,q,X);if(Q.schema.compat)$G.flowIndentCheck(z.indent,W,X);V=K.range[2],H.items.push(K)}return H.range=[z.offset,V,Y??V],H}QG.resolveBlockSeq=ZG});var n2=_((UG)=>{function XG($,Z,Q,z){let X="";if($){let U=!1,J="";for(let H of $){let{source:V,type:Y}=H;switch(Y){case"space":U=!0;break;case"comment":{if(Q&&!U)z(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=V.substring(1)||" ";if(!X)X=G;else X+=J+G;J="";break}case"newline":if(X)J+=V;U=!0;break;default:z(H,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}Z+=V.length}}return{comment:X,offset:Z}}UG.resolveEnd=XG});var w7=_((KG)=>{var HG=g(),VG=i0(),C7=r0(),YG=s0(),GG=n2(),j7=f$(),WG=U8(),qG=z5(),X5="Block collections are not allowed within flow collections",U5=($)=>$&&($.type==="block-map"||$.type==="block-seq");function BG({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=z.start.source==="{",H=J?"flow map":"flow sequence",Y=new(U?.nodeClass??(J?C7.YAMLMap:YG.YAMLSeq))(Q.schema);Y.flow=!0;let G=Q.atRoot;if(G)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 I=z.items[D],{start:O,key:C,sep:P,value:N}=I,T=j7.resolveProps(O,{flow:H,indicator:"explicit-key-ind",next:C??P?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!P&&!N){if(D===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(D<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(T.comment)if(Y.comment)Y.comment+=`
62
+ `}};wY.YAMLError=X8;wY.YAMLParseError=O7;wY.YAMLWarning=_7;wY.prettifyError=jY});var p$=_((gY)=>{function xY($,{flow:Z,indicator:Q,next:z,offset:X,onError:U,parentIndent:J,startOnNewline:H}){let V=!1,Y=H,G=H,W="",q="",K=!1,L=!1,B=null,D=null,I=null,O=null,C=null,P=null,N=null;for(let F of $){if(L){if(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma")U(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(B){if(Y&&F.type!=="comment"&&F.type!=="newline")U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(F.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&F.source.includes("\t"))B=F;G=!0;break;case"comment":{if(!G)U(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=F.source.substring(1)||" ";if(!W)W=E;else W+=q+E;q="",Y=!1;break}case"newline":if(Y){if(W)W+=F.source;else if(!P||Q!=="seq-item-ind")V=!0}else q+=F.source;if(Y=!0,K=!0,D||I)O=F;G=!0;break;case"anchor":if(D)U(F,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(F.source.endsWith(":"))U(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=F,N??(N=F.offset),Y=!1,G=!1,L=!0;break;case"tag":{if(I)U(F,"MULTIPLE_TAGS","A node can have at most one tag");I=F,N??(N=F.offset),Y=!1,G=!1,L=!0;break}case Q:if(D||I)U(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`);if(P)U(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${Z??"collection"}`);P=F,Y=Q==="seq-item-ind"||Q==="explicit-key-ind",G=!1;break;case"comma":if(Z){if(C)U(F,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);C=F,Y=!1,G=!1;break}default:U(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),Y=!1,G=!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!==""))U(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(Y&&B.indent<=J||z?.type==="block-map"||z?.type==="block-seq"))U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:P,spaceBefore:V,comment:W,hasNewline:K,anchor:D,tag:I,newlineAfterProp:O,end:w,start:N??w}}gY.resolveProps=xY});var U8=_((kY)=>{function Q5($){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(Q5(Z.key)||Q5(Z.value))return!0}return!1;default:return!0}}kY.containsNewline=Q5});var z5=_((fY)=>{var uY=U8();function mY($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&uY.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fY.flowIndentCheck=mY});var X5=_((cY)=>{var F7=g();function lY($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(U,J)=>U===J||F7.isScalar(U)&&F7.isScalar(J)&&U.value===J.value;return Z.some((U)=>X(U.key,Q))}cY.mapIncludes=lY});var A7=_((oY)=>{var P7=i0(),iY=r0(),R7=p$(),nY=U8(),N7=z5(),rY=X5(),T7="All mapping items must start at the same column";function sY({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=new(U?.nodeClass??iY.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let V=z.offset,Y=null;for(let G of z.items){let{start:W,key:q,sep:K,value:L}=G,B=R7.resolveProps(W,{indicator:"explicit-key-ind",next:q??K?.[0],offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!B.found;if(D){if(q){if(q.type==="block-seq")X(V,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in q&&q.indent!==z.indent)X(V,"BAD_INDENT",T7)}if(!B.anchor&&!B.tag&&!K){if(Y=B.end,B.comment)if(H.comment)H.comment+=`
64
+ `+B.comment;else H.comment=B.comment;continue}if(B.newlineAfterProp||nY.containsNewline(q))X(q??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)X(V,"BAD_INDENT",T7);Q.atKey=!0;let I=B.end,O=q?$(Q,q,B,X):Z(Q,I,W,null,B,X);if(Q.schema.compat)N7.flowIndentCheck(z.indent,q,X);if(Q.atKey=!1,rY.mapIncludes(Q,H.items,O))X(I,"DUPLICATE_KEY","Map keys must be unique");let C=R7.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:O.range[2],onError:X,parentIndent:z.indent,startOnNewline:!q||q.type==="block-scalar"});if(V=C.end,C.found){if(D){if(L?.type==="block-map"&&!C.hasNewline)X(V,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&B.start<C.found.offset-1024)X(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let P=L?$(Q,L,C,X):Z(Q,V,K,null,C,X);if(Q.schema.compat)N7.flowIndentCheck(z.indent,L,X);V=P.range[2];let N=new P7.Pair(O,P);if(Q.options.keepSourceTokens)N.srcToken=G;H.items.push(N)}else{if(D)X(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(O.comment)O.comment+=`
65
+ `+C.comment;else O.comment=C.comment;let P=new P7.Pair(O);if(Q.options.keepSourceTokens)P.srcToken=G;H.items.push(P)}}if(Y&&Y<V)X(Y,"IMPOSSIBLE","Map comment with trailing content");return H.range=[z.offset,V,Y??V],H}oY.resolveBlockMap=sY});var C7=_((QG)=>{var tY=s0(),eY=p$(),$G=z5();function ZG({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=new(U?.nodeClass??tY.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let V=z.offset,Y=null;for(let{start:G,value:W}of z.items){let q=eY.resolveProps(G,{indicator:"seq-item-ind",next:W,offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!q.found)if(q.anchor||q.tag||W)if(W?.type==="block-seq")X(q.end,"BAD_INDENT","All sequence items must start at the same column");else X(V,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=q.end,q.comment)H.comment=q.comment;continue}let K=W?$(Q,W,q,X):Z(Q,q.end,G,null,q,X);if(Q.schema.compat)$G.flowIndentCheck(z.indent,W,X);V=K.range[2],H.items.push(K)}return H.range=[z.offset,V,Y??V],H}QG.resolveBlockSeq=ZG});var n2=_((UG)=>{function XG($,Z,Q,z){let X="";if($){let U=!1,J="";for(let H of $){let{source:V,type:Y}=H;switch(Y){case"space":U=!0;break;case"comment":{if(Q&&!U)z(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=V.substring(1)||" ";if(!X)X=G;else X+=J+G;J="";break}case"newline":if(X)J+=V;U=!0;break;default:z(H,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}Z+=V.length}}return{comment:X,offset:Z}}UG.resolveEnd=XG});var S7=_((KG)=>{var HG=g(),VG=i0(),j7=r0(),YG=s0(),GG=n2(),w7=p$(),WG=U8(),qG=X5(),U5="Block collections are not allowed within flow collections",J5=($)=>$&&($.type==="block-map"||$.type==="block-seq");function BG({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=z.start.source==="{",H=J?"flow map":"flow sequence",Y=new(U?.nodeClass??(J?j7.YAMLMap:YG.YAMLSeq))(Q.schema);Y.flow=!0;let G=Q.atRoot;if(G)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 I=z.items[D],{start:O,key:C,sep:P,value:N}=I,T=w7.resolveProps(O,{flow:H,indicator:"explicit-key-ind",next:C??P?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!P&&!N){if(D===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(D<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(T.comment)if(Y.comment)Y.comment+=`
66
66
  `+T.comment;else Y.comment=T.comment;W=T.end;continue}if(!J&&Q.options.strict&&WG.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 ${H}`)}else{if(!T.comma)X(T.start,"MISSING_CHAR",`Missing , between ${H} items`);if(T.comment){let w="";$:for(let F of O)switch(F.type){case"comma":case"space":break;case"comment":w=F.source.substring(1);break $;default:break $}if(w){let F=Y.items[Y.items.length-1];if(HG.isPair(F))F=F.value??F.key;if(F.comment)F.comment+=`
67
- `+w;else F.comment=w;T.comment=T.comment.substring(w.length+1)}}}if(!J&&!P&&!T.found){let w=N?$(Q,N,T,X):Z(Q,T.end,P,null,T,X);if(Y.items.push(w),W=w.range[2],U5(N))X(w.range,"BLOCK_IN_FLOW",X5)}else{Q.atKey=!0;let w=T.end,F=C?$(Q,C,T,X):Z(Q,w,O,null,T,X);if(U5(C))X(F.range,"BLOCK_IN_FLOW",X5);Q.atKey=!1;let E=j7.resolveProps(P??[],{flow:H,indicator:"map-value-ind",next:N,offset:F.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(E.found){if(!J&&!T.found&&Q.options.strict){if(P)for(let v of P){if(v===E.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<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 ${H}`);else X(E.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let r=N?$(Q,N,E,X):E.found?Z(Q,E.end,P,null,E,X):null;if(r){if(U5(N))X(r.range,"BLOCK_IN_FLOW",X5)}else if(E.comment)if(F.comment)F.comment+=`
68
- `+E.comment;else F.comment=E.comment;let t=new VG.Pair(F,r);if(Q.options.keepSourceTokens)t.srcToken=I;if(J){let v=Y;if(qG.mapIncludes(Q,v.items,F))X(w,"DUPLICATE_KEY","Map keys must be unique");v.items.push(t)}else{let v=new C7.YAMLMap(Q.schema);v.flow=!0,v.items.push(t);let A=(r??F).range;v.range=[F.range[0],A[1],A[2]],Y.items.push(v)}W=r?r.range[2]:E.end}}let q=J?"}":"]",[K,...L]=z.end,B=W;if(K?.source===q)B=K.offset+K.source.length;else{let D=H[0].toUpperCase()+H.substring(1),I=G?`${D} must end with a ${q}`:`${D} in block collection must be sufficiently indented and end with a ${q}`;if(X(W,G?"MISSING_CHAR":"BAD_INDENT",I),K&&K.source.length!==1)L.unshift(K)}if(L.length>0){let D=GG.resolveEnd(L,B,Q.options.strict,X);if(D.comment)if(Y.comment)Y.comment+=`
69
- `+D.comment;else Y.comment=D.comment;Y.range=[z.offset,B,D.offset]}else Y.range=[z.offset,B,B];return Y}KG.resolveFlowCollection=BG});var S7=_((NG)=>{var LG=g(),MG=i(),IG=r0(),OG=s0(),_G=T7(),FG=A7(),PG=w7();function J5($,Z,Q,z,X,U){let J=Q.type==="block-map"?_G.resolveBlockMap($,Z,Q,z,U):Q.type==="block-seq"?FG.resolveBlockSeq($,Z,Q,z,U):PG.resolveFlowCollection($,Z,Q,z,U),H=J.constructor;if(X==="!"||X===H.tagName)return J.tag=H.tagName,J;if(X)J.tag=X;return J}function RG($,Z,Q,z,X){let U=z.tag,J=!U?null:Z.directives.tagName(U.source,(q)=>X(U,"TAG_RESOLVE_FAILED",q));if(Q.type==="block-seq"){let{anchor:q,newlineAfterProp:K}=z,L=q&&U?q.offset>U.offset?q:U:q??U;if(L&&(!K||K.offset<L.offset))X(L,"MISSING_CHAR","Missing newline after block sequence props")}let H=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!U||!J||J==="!"||J===IG.YAMLMap.tagName&&H==="map"||J===OG.YAMLSeq.tagName&&H==="seq")return J5($,Z,Q,X,J);let V=Z.schema.tags.find((q)=>q.tag===J&&q.collection===H);if(!V){let q=Z.schema.knownTags[J];if(q?.collection===H)Z.schema.tags.push(Object.assign({},q,{default:!1})),V=q;else{if(q)X(U,"BAD_COLLECTION_TYPE",`${q.tag} used for ${H} collection, but expects ${q.collection??"scalar"}`,!0);else X(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,!0);return J5($,Z,Q,X,J)}}let Y=J5($,Z,Q,X,J,V),G=V.resolve?.(Y,(q)=>X(U,"TAG_RESOLVE_FAILED",q),Z.options)??Y,W=LG.isNode(G)?G:new MG.Scalar(G);if(W.range=Y.range,W.tag=J,V?.format)W.format=V.format;return W}NG.composeCollection=RG});var V5=_((wG)=>{var H5=i();function AG($,Z,Q){let z=Z.offset,X=CG(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let U=X.mode===">"?H5.Scalar.BLOCK_FOLDED:H5.Scalar.BLOCK_LITERAL,J=Z.source?jG(Z.source):[],H=J.length;for(let B=J.length-1;B>=0;--B){let D=J[B][1];if(D===""||D==="\r")H=B;else break}if(H===0){let B=X.chomp==="+"&&J.length>0?`
67
+ `+w;else F.comment=w;T.comment=T.comment.substring(w.length+1)}}}if(!J&&!P&&!T.found){let w=N?$(Q,N,T,X):Z(Q,T.end,P,null,T,X);if(Y.items.push(w),W=w.range[2],J5(N))X(w.range,"BLOCK_IN_FLOW",U5)}else{Q.atKey=!0;let w=T.end,F=C?$(Q,C,T,X):Z(Q,w,O,null,T,X);if(J5(C))X(F.range,"BLOCK_IN_FLOW",U5);Q.atKey=!1;let E=w7.resolveProps(P??[],{flow:H,indicator:"map-value-ind",next:N,offset:F.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(E.found){if(!J&&!T.found&&Q.options.strict){if(P)for(let v of P){if(v===E.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<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 ${H}`);else X(E.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let r=N?$(Q,N,E,X):E.found?Z(Q,E.end,P,null,E,X):null;if(r){if(J5(N))X(r.range,"BLOCK_IN_FLOW",U5)}else if(E.comment)if(F.comment)F.comment+=`
68
+ `+E.comment;else F.comment=E.comment;let t=new VG.Pair(F,r);if(Q.options.keepSourceTokens)t.srcToken=I;if(J){let v=Y;if(qG.mapIncludes(Q,v.items,F))X(w,"DUPLICATE_KEY","Map keys must be unique");v.items.push(t)}else{let v=new j7.YAMLMap(Q.schema);v.flow=!0,v.items.push(t);let A=(r??F).range;v.range=[F.range[0],A[1],A[2]],Y.items.push(v)}W=r?r.range[2]:E.end}}let q=J?"}":"]",[K,...L]=z.end,B=W;if(K?.source===q)B=K.offset+K.source.length;else{let D=H[0].toUpperCase()+H.substring(1),I=G?`${D} must end with a ${q}`:`${D} in block collection must be sufficiently indented and end with a ${q}`;if(X(W,G?"MISSING_CHAR":"BAD_INDENT",I),K&&K.source.length!==1)L.unshift(K)}if(L.length>0){let D=GG.resolveEnd(L,B,Q.options.strict,X);if(D.comment)if(Y.comment)Y.comment+=`
69
+ `+D.comment;else Y.comment=D.comment;Y.range=[z.offset,B,D.offset]}else Y.range=[z.offset,B,B];return Y}KG.resolveFlowCollection=BG});var E7=_((NG)=>{var LG=g(),MG=i(),IG=r0(),OG=s0(),_G=A7(),FG=C7(),PG=S7();function H5($,Z,Q,z,X,U){let J=Q.type==="block-map"?_G.resolveBlockMap($,Z,Q,z,U):Q.type==="block-seq"?FG.resolveBlockSeq($,Z,Q,z,U):PG.resolveFlowCollection($,Z,Q,z,U),H=J.constructor;if(X==="!"||X===H.tagName)return J.tag=H.tagName,J;if(X)J.tag=X;return J}function RG($,Z,Q,z,X){let U=z.tag,J=!U?null:Z.directives.tagName(U.source,(q)=>X(U,"TAG_RESOLVE_FAILED",q));if(Q.type==="block-seq"){let{anchor:q,newlineAfterProp:K}=z,L=q&&U?q.offset>U.offset?q:U:q??U;if(L&&(!K||K.offset<L.offset))X(L,"MISSING_CHAR","Missing newline after block sequence props")}let H=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!U||!J||J==="!"||J===IG.YAMLMap.tagName&&H==="map"||J===OG.YAMLSeq.tagName&&H==="seq")return H5($,Z,Q,X,J);let V=Z.schema.tags.find((q)=>q.tag===J&&q.collection===H);if(!V){let q=Z.schema.knownTags[J];if(q?.collection===H)Z.schema.tags.push(Object.assign({},q,{default:!1})),V=q;else{if(q)X(U,"BAD_COLLECTION_TYPE",`${q.tag} used for ${H} collection, but expects ${q.collection??"scalar"}`,!0);else X(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,!0);return H5($,Z,Q,X,J)}}let Y=H5($,Z,Q,X,J,V),G=V.resolve?.(Y,(q)=>X(U,"TAG_RESOLVE_FAILED",q),Z.options)??Y,W=LG.isNode(G)?G:new MG.Scalar(G);if(W.range=Y.range,W.tag=J,V?.format)W.format=V.format;return W}NG.composeCollection=RG});var Y5=_((wG)=>{var V5=i();function AG($,Z,Q){let z=Z.offset,X=CG(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let U=X.mode===">"?V5.Scalar.BLOCK_FOLDED:V5.Scalar.BLOCK_LITERAL,J=Z.source?jG(Z.source):[],H=J.length;for(let B=J.length-1;B>=0;--B){let D=J[B][1];if(D===""||D==="\r")H=B;else break}if(H===0){let B=X.chomp==="+"&&J.length>0?`
70
70
  `.repeat(Math.max(1,J.length-1)):"",D=z+X.length;if(Z.source)D+=Z.source.length;return{value:B,type:U,comment:X.comment,range:[z,D,D]}}let V=Z.indent+X.indent,Y=Z.offset+X.length,G=0;for(let B=0;B<H;++B){let[D,I]=J[B];if(I===""||I==="\r"){if(X.indent===0&&D.length>V)V=D.length}else{if(D.length<V)Q(Y+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)V=D.length;if(G=B,V===0&&!$.atRoot)Q(Y,"BAD_INDENT","Block scalar values in collections must be indented");break}Y+=D.length+I.length+1}for(let B=J.length-1;B>=H;--B)if(J[B][0].length>V)H=B+1;let W="",q="",K=!1;for(let B=0;B<G;++B)W+=J[B][0].slice(V)+`
71
- `;for(let B=G;B<H;++B){let[D,I]=J[B];Y+=D.length+I.length+1;let O=I[I.length-1]==="\r";if(O)I=I.slice(0,-1);if(I&&D.length<V){let P=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(Y-I.length-(O?2:1),"BAD_INDENT",P),D=""}if(U===H5.Scalar.BLOCK_LITERAL)W+=q+D.slice(V)+I,q=`
71
+ `;for(let B=G;B<H;++B){let[D,I]=J[B];Y+=D.length+I.length+1;let O=I[I.length-1]==="\r";if(O)I=I.slice(0,-1);if(I&&D.length<V){let P=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(Y-I.length-(O?2:1),"BAD_INDENT",P),D=""}if(U===V5.Scalar.BLOCK_LITERAL)W+=q+D.slice(V)+I,q=`
72
72
  `;else if(D.length>V||I[0]==="\t"){if(q===" ")q=`
73
73
  `;else if(!K&&q===`
74
74
  `)q=`
@@ -81,7 +81,7 @@ ${Y}
81
81
  `+J[B][0].slice(V);if(W[W.length-1]!==`
82
82
  `)W+=`
83
83
  `;break;default:W+=`
84
- `}let L=z+X.length+Z.source.length;return{value:W,type:U,comment:X.comment,range:[z,L,L]}}function CG({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],U=X[0],J=0,H="",V=-1;for(let q=1;q<X.length;++q){let K=X[q];if(!H&&(K==="-"||K==="+"))H=K;else{let L=Number(K);if(!J&&L)J=L;else if(V===-1)V=$+q}}if(V!==-1)z(V,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let Y=!1,G="",W=X.length;for(let q=1;q<Z.length;++q){let K=Z[q];switch(K.type){case"space":Y=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!Y)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,G=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 B=K.source;if(B&&typeof B==="string")W+=B.length}}}return{mode:U,indent:J,chomp:H,comment:G,length:W}}function jG($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),U=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let J=1;J<Z.length;J+=2)U.push([Z[J],Z[J+1]]);return U}wG.resolveBlockScalar=AG});var G5=_((uG)=>{var Y5=i(),EG=n2();function bG($,Z,Q){let{offset:z,type:X,source:U,end:J}=$,H,V,Y=(q,K,L)=>Q(z+q,K,L);switch(X){case"scalar":H=Y5.Scalar.PLAIN,V=yG(U,Y);break;case"single-quoted-scalar":H=Y5.Scalar.QUOTE_SINGLE,V=xG(U,Y);break;case"double-quoted-scalar":H=Y5.Scalar.QUOTE_DOUBLE,V=gG(U,Y);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+U.length,z+U.length]}}let G=z+U.length,W=EG.resolveEnd(J,G,Z,Q);return{value:V,type:H,comment:W.comment,range:[z,G,W.offset]}}function yG($,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 E7($)}function xG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return E7($.slice(1,-1)).replace(/''/g,"'")}function E7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
84
+ `}let L=z+X.length+Z.source.length;return{value:W,type:U,comment:X.comment,range:[z,L,L]}}function CG({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],U=X[0],J=0,H="",V=-1;for(let q=1;q<X.length;++q){let K=X[q];if(!H&&(K==="-"||K==="+"))H=K;else{let L=Number(K);if(!J&&L)J=L;else if(V===-1)V=$+q}}if(V!==-1)z(V,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let Y=!1,G="",W=X.length;for(let q=1;q<Z.length;++q){let K=Z[q];switch(K.type){case"space":Y=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!Y)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,G=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 B=K.source;if(B&&typeof B==="string")W+=B.length}}}return{mode:U,indent:J,chomp:H,comment:G,length:W}}function jG($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),U=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let J=1;J<Z.length;J+=2)U.push([Z[J],Z[J+1]]);return U}wG.resolveBlockScalar=AG});var W5=_((uG)=>{var G5=i(),EG=n2();function bG($,Z,Q){let{offset:z,type:X,source:U,end:J}=$,H,V,Y=(q,K,L)=>Q(z+q,K,L);switch(X){case"scalar":H=G5.Scalar.PLAIN,V=yG(U,Y);break;case"single-quoted-scalar":H=G5.Scalar.QUOTE_SINGLE,V=xG(U,Y);break;case"double-quoted-scalar":H=G5.Scalar.QUOTE_DOUBLE,V=gG(U,Y);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+U.length,z+U.length]}}let G=z+U.length,W=EG.resolveEnd(J,G,Z,Q);return{value:V,type:H,comment:W.comment,range:[z,G,W.offset]}}function yG($,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 b7($)}function xG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return b7($.slice(1,-1)).replace(/''/g,"'")}function b7($){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],U=" ",J=Z.lastIndex;Q.lastIndex=J;while(z=Q.exec($)){if(z[1]==="")if(U===`
87
87
  `)X+=U;else U=`
@@ -96,87 +96,87 @@ ${Y}
96
96
  `)break;if(z===`
97
97
  `)Q+=`
98
98
  `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var kG={"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 hG($,Z,Q,z){let X=$.substr(Z,Q),J=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(J)}catch{let H=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}}uG.resolveFlowScalar=bG});var y7=_((iG)=>{var q2=g(),b7=i(),fG=V5(),pG=G5();function lG($,Z,Q,z){let{value:X,type:U,comment:J,range:H}=Z.type==="block-scalar"?fG.resolveBlockScalar($,Z,z):pG.resolveFlowScalar(Z,$.options.strict,z),V=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,Y;if($.options.stringKeys&&$.atKey)Y=$.schema[q2.SCALAR];else if(V)Y=cG($.schema,X,V,Q,z);else if(Z.type==="scalar")Y=dG($,X,Z,z);else Y=$.schema[q2.SCALAR];let G;try{let W=Y.resolve(X,(q)=>z(Q??Z,"TAG_RESOLVE_FAILED",q),$.options);G=q2.isScalar(W)?W:new b7.Scalar(W)}catch(W){let q=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",q),G=new b7.Scalar(X)}if(G.range=H,G.source=X,U)G.type=U;if(V)G.tag=V;if(Y.format)G.format=Y.format;if(J)G.comment=J;return G}function cG($,Z,Q,z,X){if(Q==="!")return $[q2.SCALAR];let U=[];for(let H of $.tags)if(!H.collection&&H.tag===Q)if(H.default&&H.test)U.push(H);else return H;for(let H of U)if(H.test?.test(Z))return H;let J=$.knownTags[Q];if(J&&!J.collection)return $.tags.push(Object.assign({},J,{default:!1,test:void 0})),J;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[q2.SCALAR]}function dG({atKey:$,directives:Z,schema:Q},z,X,U){let J=Q.tags.find((H)=>(H.default===!0||$&&H.default==="key")&&H.test?.test(z))||Q[q2.SCALAR];if(Q.compat){let H=Q.compat.find((V)=>V.default&&V.test?.test(z))??Q[q2.SCALAR];if(J.tag!==H.tag){let V=Z.tagString(J.tag),Y=Z.tagString(H.tag),G=`Value may be parsed as either ${V} or ${Y}`;U(X,"TAG_RESOLVE_FAILED",G,!0)}}return J}iG.composeScalar=lG});var x7=_((sG)=>{function rG($,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 $}sG.emptyScalarPosition=rG});var k7=_((XW)=>{var aG=T$(),tG=g(),eG=S7(),g7=y7(),$W=n2(),ZW=x7(),QW={composeNode:v7,composeEmptyNode:W5};function v7($,Z,Q,z){let X=$.atKey,{spaceBefore:U,comment:J,anchor:H,tag:V}=Q,Y,G=!0;switch(Z.type){case"alias":if(Y=zW($,Z,z),H||V)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(Y=g7.composeScalar($,Z,V,z),H)Y.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(Y=eG.composeCollection(QW,$,Z,Q,z),H)Y.anchor=H.source.substring(1)}catch(W){let q=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",q)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),G=!1}}if(Y??(Y=W5($,Z.offset,void 0,null,Q,z)),H&&Y.anchor==="")z(H,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!tG.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))z(V??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)Y.spaceBefore=!0;if(J)if(Z.type==="scalar"&&Z.source==="")Y.comment=J;else Y.commentBefore=J;if($.options.keepSourceTokens&&G)Y.srcToken=Z;return Y}function W5($,Z,Q,z,{spaceBefore:X,comment:U,anchor:J,tag:H,end:V},Y){let G={type:"scalar",offset:ZW.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=g7.composeScalar($,G,H,Y);if(J){if(W.anchor=J.source.substring(1),W.anchor==="")Y(J,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(U)W.comment=U,W.range[2]=V;return W}function zW({options:$},{offset:Z,source:Q,end:z},X){let U=new aG.Alias(Q.substring(1));if(U.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let J=Z+Q.length,H=$W.resolveEnd(z,J,$.strict,X);if(U.range=[Z,J,H.offset],H.comment)U.comment=H.comment;return U}XW.composeEmptyNode=W5;XW.composeNode=v7});var u7=_((WW)=>{var HW=u$(),h7=k7(),VW=n2(),YW=f$();function GW($,Z,{offset:Q,start:z,value:X,end:U},J){let H=Object.assign({_directives:Z},$),V=new HW.Document(void 0,H),Y={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},G=YW.resolveProps(z,{indicator:"doc-start",next:X??U?.[0],offset:Q,onError:J,parentIndent:0,startOnNewline:!0});if(G.found){if(V.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!G.hasNewline)J(G.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}V.contents=X?h7.composeNode(Y,X,G,J):h7.composeEmptyNode(Y,G.end,z,null,G,J);let W=V.contents.range[2],q=VW.resolveEnd(U,W,!1,J);if(q.comment)V.comment=q.comment;return V.range=[Q,W,q.offset],V}WW.composeDoc=GW});var q5=_((IW)=>{var BW=M$("process"),KW=L4(),DW=u$(),p$=m$(),m7=g(),LW=u7(),MW=n2();function l$($){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 f7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let U=$[X];switch(U[0]){case"#":Z+=(Z===""?"":z?`
99
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function hG($,Z,Q,z){let X=$.substr(Z,Q),J=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(J)}catch{let H=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}}uG.resolveFlowScalar=bG});var x7=_((iG)=>{var q2=g(),y7=i(),fG=Y5(),pG=W5();function lG($,Z,Q,z){let{value:X,type:U,comment:J,range:H}=Z.type==="block-scalar"?fG.resolveBlockScalar($,Z,z):pG.resolveFlowScalar(Z,$.options.strict,z),V=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,Y;if($.options.stringKeys&&$.atKey)Y=$.schema[q2.SCALAR];else if(V)Y=cG($.schema,X,V,Q,z);else if(Z.type==="scalar")Y=dG($,X,Z,z);else Y=$.schema[q2.SCALAR];let G;try{let W=Y.resolve(X,(q)=>z(Q??Z,"TAG_RESOLVE_FAILED",q),$.options);G=q2.isScalar(W)?W:new y7.Scalar(W)}catch(W){let q=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",q),G=new y7.Scalar(X)}if(G.range=H,G.source=X,U)G.type=U;if(V)G.tag=V;if(Y.format)G.format=Y.format;if(J)G.comment=J;return G}function cG($,Z,Q,z,X){if(Q==="!")return $[q2.SCALAR];let U=[];for(let H of $.tags)if(!H.collection&&H.tag===Q)if(H.default&&H.test)U.push(H);else return H;for(let H of U)if(H.test?.test(Z))return H;let J=$.knownTags[Q];if(J&&!J.collection)return $.tags.push(Object.assign({},J,{default:!1,test:void 0})),J;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[q2.SCALAR]}function dG({atKey:$,directives:Z,schema:Q},z,X,U){let J=Q.tags.find((H)=>(H.default===!0||$&&H.default==="key")&&H.test?.test(z))||Q[q2.SCALAR];if(Q.compat){let H=Q.compat.find((V)=>V.default&&V.test?.test(z))??Q[q2.SCALAR];if(J.tag!==H.tag){let V=Z.tagString(J.tag),Y=Z.tagString(H.tag),G=`Value may be parsed as either ${V} or ${Y}`;U(X,"TAG_RESOLVE_FAILED",G,!0)}}return J}iG.composeScalar=lG});var g7=_((sG)=>{function rG($,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 $}sG.emptyScalarPosition=rG});var h7=_((XW)=>{var aG=A$(),tG=g(),eG=E7(),v7=x7(),$W=n2(),ZW=g7(),QW={composeNode:k7,composeEmptyNode:q5};function k7($,Z,Q,z){let X=$.atKey,{spaceBefore:U,comment:J,anchor:H,tag:V}=Q,Y,G=!0;switch(Z.type){case"alias":if(Y=zW($,Z,z),H||V)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(Y=v7.composeScalar($,Z,V,z),H)Y.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(Y=eG.composeCollection(QW,$,Z,Q,z),H)Y.anchor=H.source.substring(1)}catch(W){let q=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",q)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),G=!1}}if(Y??(Y=q5($,Z.offset,void 0,null,Q,z)),H&&Y.anchor==="")z(H,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!tG.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))z(V??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)Y.spaceBefore=!0;if(J)if(Z.type==="scalar"&&Z.source==="")Y.comment=J;else Y.commentBefore=J;if($.options.keepSourceTokens&&G)Y.srcToken=Z;return Y}function q5($,Z,Q,z,{spaceBefore:X,comment:U,anchor:J,tag:H,end:V},Y){let G={type:"scalar",offset:ZW.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=v7.composeScalar($,G,H,Y);if(J){if(W.anchor=J.source.substring(1),W.anchor==="")Y(J,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(U)W.comment=U,W.range[2]=V;return W}function zW({options:$},{offset:Z,source:Q,end:z},X){let U=new aG.Alias(Q.substring(1));if(U.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let J=Z+Q.length,H=$W.resolveEnd(z,J,$.strict,X);if(U.range=[Z,J,H.offset],H.comment)U.comment=H.comment;return U}XW.composeEmptyNode=q5;XW.composeNode=k7});var m7=_((WW)=>{var HW=m$(),u7=h7(),VW=n2(),YW=p$();function GW($,Z,{offset:Q,start:z,value:X,end:U},J){let H=Object.assign({_directives:Z},$),V=new HW.Document(void 0,H),Y={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},G=YW.resolveProps(z,{indicator:"doc-start",next:X??U?.[0],offset:Q,onError:J,parentIndent:0,startOnNewline:!0});if(G.found){if(V.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!G.hasNewline)J(G.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}V.contents=X?u7.composeNode(Y,X,G,J):u7.composeEmptyNode(Y,G.end,z,null,G,J);let W=V.contents.range[2],q=VW.resolveEnd(U,W,!1,J);if(q.comment)V.comment=q.comment;return V.range=[Q,W,q.offset],V}WW.composeDoc=GW});var B5=_((IW)=>{var BW=I$("process"),KW=M4(),DW=m$(),l$=f$(),f7=g(),LW=m7(),MW=n2();function c$($){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 p7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let U=$[X];switch(U[0]){case"#":Z+=(Z===""?"":z?`
100
100
 
101
101
  `:`
102
- `)+(U.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class p7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let U=l$(Z);if(X)this.warnings.push(new p$.YAMLWarning(U,Q,z));else this.errors.push(new p$.YAMLParseError(U,Q,z))},this.directives=new KW.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=f7(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(m7.isCollection(X)&&!X.flow&&X.items.length>0){let U=X.items[0];if(m7.isPair(U))U=U.key;let J=U.commentBefore;U.commentBefore=J?`${Q}
102
+ `)+(U.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class l7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let U=c$(Z);if(X)this.warnings.push(new l$.YAMLWarning(U,Q,z));else this.errors.push(new l$.YAMLParseError(U,Q,z))},this.directives=new KW.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=p7(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(f7.isCollection(X)&&!X.flow&&X.items.length>0){let U=X.items[0];if(f7.isPair(U))U=U.key;let J=U.commentBefore;U.commentBefore=J?`${Q}
104
104
  ${J}`:Q}else{let U=X.commentBefore;X.commentBefore=U?`${Q}
105
- ${U}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:f7(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(BW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=l$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=LW.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 p$.YAMLParseError(l$($),"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 p$.YAMLParseError(l$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=MW.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 p$.YAMLParseError(l$($),"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 DW.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}}}IW.Composer=p7});var d7=_((CW)=>{var _W=V5(),FW=G5(),PW=m$(),l7=w$();function RW($,Z=!0,Q){if($){let z=(X,U,J)=>{let H=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(H,U,J);else throw new PW.YAMLParseError([H,H+1],U,J)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return FW.resolveFlowScalar($,Z,z);case"block-scalar":return _W.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function NW($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:U=-1,type:J="PLAIN"}=Z,H=l7.stringifyString({type:J,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),V=Z.end??[{type:"newline",offset:-1,indent:z,source:`
105
+ ${U}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:p7(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(BW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=c$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=LW.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 l$.YAMLParseError(c$($),"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 l$.YAMLParseError(c$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=MW.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 l$.YAMLParseError(c$($),"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 DW.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}}}IW.Composer=l7});var i7=_((CW)=>{var _W=Y5(),FW=W5(),PW=f$(),c7=S$();function RW($,Z=!0,Q){if($){let z=(X,U,J)=>{let H=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(H,U,J);else throw new PW.YAMLParseError([H,H+1],U,J)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return FW.resolveFlowScalar($,Z,z);case"block-scalar":return _W.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function NW($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:U=-1,type:J="PLAIN"}=Z,H=c7.stringifyString({type:J,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),V=Z.end??[{type:"newline",offset:-1,indent:z,source:`
107
107
  `}];switch(H[0]){case"|":case">":{let Y=H.indexOf(`
108
108
  `),G=H.substring(0,Y),W=H.substring(Y+1)+`
109
- `,q=[{type:"block-scalar-header",offset:U,indent:z,source:G}];if(!c7(q,V))q.push({type:"newline",offset:-1,indent:z,source:`
110
- `});return{type:"block-scalar",offset:U,indent:z,props:q,source:W}}case'"':return{type:"double-quoted-scalar",offset:U,indent:z,source:H,end:V};case"'":return{type:"single-quoted-scalar",offset:U,indent:z,source:H,end:V};default:return{type:"scalar",offset:U,indent:z,source:H,end:V}}}function TW($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:U=!1,type:J}=Q,H="indent"in $?$.indent:null;if(z&&typeof H==="number")H+=2;if(!J)switch($.type){case"single-quoted-scalar":J="QUOTE_SINGLE";break;case"double-quoted-scalar":J="QUOTE_DOUBLE";break;case"block-scalar":{let Y=$.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");J=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:J="PLAIN"}let V=l7.stringifyString({type:J,value:Z},{implicitKey:X||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(V[0]){case"|":case">":AW($,V);break;case'"':B5($,V,"double-quoted-scalar");break;case"'":B5($,V,"single-quoted-scalar");break;default:B5($,V,"scalar")}}function AW($,Z){let Q=Z.indexOf(`
109
+ `,q=[{type:"block-scalar-header",offset:U,indent:z,source:G}];if(!d7(q,V))q.push({type:"newline",offset:-1,indent:z,source:`
110
+ `});return{type:"block-scalar",offset:U,indent:z,props:q,source:W}}case'"':return{type:"double-quoted-scalar",offset:U,indent:z,source:H,end:V};case"'":return{type:"single-quoted-scalar",offset:U,indent:z,source:H,end:V};default:return{type:"scalar",offset:U,indent:z,source:H,end:V}}}function TW($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:U=!1,type:J}=Q,H="indent"in $?$.indent:null;if(z&&typeof H==="number")H+=2;if(!J)switch($.type){case"single-quoted-scalar":J="QUOTE_SINGLE";break;case"double-quoted-scalar":J="QUOTE_DOUBLE";break;case"block-scalar":{let Y=$.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");J=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:J="PLAIN"}let V=c7.stringifyString({type:J,value:Z},{implicitKey:X||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(V[0]){case"|":case">":AW($,V);break;case'"':K5($,V,"double-quoted-scalar");break;case"'":K5($,V,"single-quoted-scalar");break;default:K5($,V,"scalar")}}function AW($,Z){let Q=Z.indexOf(`
111
111
  `),z=Z.substring(0,Q),X=Z.substring(Q+1)+`
112
- `;if($.type==="block-scalar"){let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=z,$.source=X}else{let{offset:U}=$,J="indent"in $?$.indent:-1,H=[{type:"block-scalar-header",offset:U,indent:J,source:z}];if(!c7(H,"end"in $?$.end:void 0))H.push({type:"newline",offset:-1,indent:J,source:`
113
- `});for(let V of Object.keys($))if(V!=="type"&&V!=="offset")delete $[V];Object.assign($,{type:"block-scalar",indent:J,props:H,source:X})}}function c7($,Z){if(Z)for(let Q of Z)switch(Q.type){case"space":case"comment":$.push(Q);break;case"newline":return $.push(Q),!0}return!1}function B5($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),X=Z.length;if($.props[0].type==="block-scalar-header")X-=$.props[0].source.length;for(let U of z)U.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
- `};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}CW.createScalarToken=NW;CW.resolveAsScalar=RW;CW.setScalarValue=TW});var i7=_((bW)=>{var EW=($)=>("type"in $)?H8($):J8($);function H8($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=H8(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=J8(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=J8(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=J8($);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 J8({start:$,key:Z,sep:Q,value:z}){let X="";for(let U of $)X+=U.source;if(Z)X+=H8(Z);if(Q)for(let U of Q)X+=U.source;if(z)X+=H8(z);return X}bW.stringify=EW});var s7=_((gW)=>{var K5=Symbol("break visit"),xW=Symbol("skip children"),n7=Symbol("remove item");function B2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};r7(Object.freeze([]),$,Z)}B2.BREAK=K5;B2.SKIP=xW;B2.REMOVE=n7;B2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let U=Q?.[z];if(U&&"items"in U)Q=U.items[X];else return}return Q};B2.parentCollection=($,Z)=>{let Q=B2.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 r7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let U=Z[X];if(U&&"items"in U){for(let J=0;J<U.items.length;++J){let H=r7(Object.freeze($.concat([[X,J]])),U.items[J],Q);if(typeof H==="number")J=H-1;else if(H===K5)return K5;else if(H===n7)U.items.splice(J,1),J-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}gW.visit=B2});var V8=_((lW)=>{var D5=d7(),kW=i7(),hW=s7(),L5="\uFEFF",M5="\x02",I5="\x18",O5="\x1F",uW=($)=>!!$&&("items"in $),mW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function fW($){switch($){case L5:return"<BOM>";case M5:return"<DOC>";case I5:return"<FLOW_END>";case O5:return"<SCALAR>";default:return JSON.stringify($)}}function pW($){switch($){case L5:return"byte-order-mark";case M5:return"doc-mode";case I5:return"flow-error-end";case O5:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
112
+ `;if($.type==="block-scalar"){let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=z,$.source=X}else{let{offset:U}=$,J="indent"in $?$.indent:-1,H=[{type:"block-scalar-header",offset:U,indent:J,source:z}];if(!d7(H,"end"in $?$.end:void 0))H.push({type:"newline",offset:-1,indent:J,source:`
113
+ `});for(let V of Object.keys($))if(V!=="type"&&V!=="offset")delete $[V];Object.assign($,{type:"block-scalar",indent:J,props:H,source:X})}}function d7($,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 K5($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),X=Z.length;if($.props[0].type==="block-scalar-header")X-=$.props[0].source.length;for(let U of z)U.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
+ `};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}CW.createScalarToken=NW;CW.resolveAsScalar=RW;CW.setScalarValue=TW});var n7=_((bW)=>{var EW=($)=>("type"in $)?H8($):J8($);function H8($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=H8(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=J8(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=J8(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=J8($);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 J8({start:$,key:Z,sep:Q,value:z}){let X="";for(let U of $)X+=U.source;if(Z)X+=H8(Z);if(Q)for(let U of Q)X+=U.source;if(z)X+=H8(z);return X}bW.stringify=EW});var o7=_((gW)=>{var D5=Symbol("break visit"),xW=Symbol("skip children"),r7=Symbol("remove item");function B2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};s7(Object.freeze([]),$,Z)}B2.BREAK=D5;B2.SKIP=xW;B2.REMOVE=r7;B2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let U=Q?.[z];if(U&&"items"in U)Q=U.items[X];else return}return Q};B2.parentCollection=($,Z)=>{let Q=B2.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 s7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let U=Z[X];if(U&&"items"in U){for(let J=0;J<U.items.length;++J){let H=s7(Object.freeze($.concat([[X,J]])),U.items[J],Q);if(typeof H==="number")J=H-1;else if(H===D5)return D5;else if(H===r7)U.items.splice(J,1),J-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}gW.visit=B2});var V8=_((lW)=>{var L5=i7(),kW=n7(),hW=o7(),M5="\uFEFF",I5="\x02",O5="\x18",_5="\x1F",uW=($)=>!!$&&("items"in $),mW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function fW($){switch($){case M5:return"<BOM>";case I5:return"<DOC>";case O5:return"<FLOW_END>";case _5:return"<SCALAR>";default:return JSON.stringify($)}}function pW($){switch($){case M5:return"byte-order-mark";case I5:return"doc-mode";case O5:return"flow-error-end";case _5: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}lW.createScalarToken=D5.createScalarToken;lW.resolveAsScalar=D5.resolveAsScalar;lW.setScalarValue=D5.setScalarValue;lW.stringify=kW.stringify;lW.visit=hW.visit;lW.BOM=L5;lW.DOCUMENT=M5;lW.FLOW_END=I5;lW.SCALAR=O5;lW.isCollection=uW;lW.isScalar=mW;lW.prettyToken=fW;lW.tokenType=pW});var F5=_((Uq)=>{var c$=V8();function L0($){switch($){case void 0:case" ":case`
117
- `:case"\r":case"\t":return!0;default:return!1}}var o7=new Set("0123456789ABCDEFabcdef"),zq=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Y8=new Set(",[]{}"),Xq=new Set(` ,[]{}
118
- \r `),_5=($)=>!$||Xq.has($);class a7{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}lW.createScalarToken=L5.createScalarToken;lW.resolveAsScalar=L5.resolveAsScalar;lW.setScalarValue=L5.setScalarValue;lW.stringify=kW.stringify;lW.visit=hW.visit;lW.BOM=M5;lW.DOCUMENT=I5;lW.FLOW_END=O5;lW.SCALAR=_5;lW.isCollection=uW;lW.isScalar=mW;lW.prettyToken=fW;lW.tokenType=pW});var P5=_((Uq)=>{var d$=V8();function L0($){switch($){case void 0:case" ":case`
117
+ `:case"\r":case"\t":return!0;default:return!1}}var a7=new Set("0123456789ABCDEFabcdef"),zq=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Y8=new Set(",[]{}"),Xq=new Set(` ,[]{}
118
+ \r `),F5=($)=>!$||Xq.has($);class t7{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==="...")&&L0(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]===c$.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 c$.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==="...")&&L0(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&&!L0(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(($==="-"||$==="?"||$===":")&&L0(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(_5),"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("..."))&&L0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield c$.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(_5),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||L0(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
123
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===d$.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 d$.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==="...")&&L0(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&&!L0(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(($==="-"||$==="?"||$===":")&&L0(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(F5),"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("..."))&&L0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield d$.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(F5),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||L0(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
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)=>L0(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 U=this.buffer[X+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
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,U=this.buffer[X];if(U==="\r")U=this.buffer[--X];let J=X;while(U===" ")U=this.buffer[--X];if(U===`
130
- `&&X>=this.pos&&X+1+Z>J)$=X;else break}while(!0);return yield c$.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(L0(X)||$&&Y8.has(X))break;Z=Q}else if(L0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
130
+ `&&X>=this.pos&&X+1+Z>J)$=X;else break}while(!0);return yield d$.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(L0(X)||$&&Y8.has(X))break;Z=Q}else if(L0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
131
131
  `)Q+=1,z=`
132
132
  `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&Y8.has(X))break;if(z===`
133
- `){let U=this.continueScalar(Q+1);if(U===-1)break;Q=Math.max(Q,U-2)}}else{if($&&Y8.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield c$.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(_5),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(L0(Q)||Z&&Y8.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(!L0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(zq.has(Z))Z=this.buffer[++$];else if(Z==="%"&&o7.has(this.buffer[$+1])&&o7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
133
+ `){let U=this.continueScalar(Q+1);if(U===-1)break;Q=Math.max(Q,U-2)}}else{if($&&Y8.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield d$.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(F5),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(L0(Q)||Z&&Y8.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(!L0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(zq.has(Z))Z=this.buffer[++$];else if(Z==="%"&&a7.has(this.buffer[$+1])&&a7.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)}}Uq.Lexer=a7});var P5=_((Hq)=>{class t7{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}}}}Hq.LineCounter=t7});var R5=_((Wq)=>{var Yq=M$("process"),e7=V8(),Gq=F5();function o0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function $9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function Q9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function G8($){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 r2($){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 W8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function Z9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!o0(Z.start,"explicit-key-ind")&&!o0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,Q9(Z.value))if(Z.value.end)W8(Z.value.end,Z.sep);else Z.value.end=Z.sep;else W8(Z.start,Z.sep);delete Z.sep}}}class z9{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 Gq.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=$,Yq.env.LOG_TOKENS)console.log("|",e7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=e7.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")Z9(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&&$9(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($9($.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=G8(this.peek(2)),Q=r2(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)}}Uq.Lexer=t7});var R5=_((Hq)=>{class e7{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}}}}Hq.LineCounter=e7});var N5=_((Wq)=>{var Yq=I$("process"),$9=V8(),Gq=P5();function o0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function Z9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function z9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function G8($){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 r2($){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 W8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function Q9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!o0(Z.start,"explicit-key-ind")&&!o0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,z9(Z.value))if(Z.value.end)W8(Z.value.end,Z.sep);else Z.value.end=Z.sep;else W8(Z.start,Z.sep);delete Z.sep}}}class X9{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 Gq.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=$,Yq.env.LOG_TOKENS)console.log("|",$9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=$9.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")Q9(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&&Z9(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(Z9($.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=G8(this.peek(2)),Q=r2(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)){W8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let U=[];for(let J=0;J<Z.sep.length;++J){let H=Z.sep[J];switch(H.type){case"newline":U.push(J);break;case"space":break;case"comment":if(H.indent>$.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)X=Z.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(o0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let U=r2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(o0(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(Q9(Z.key)&&!o0(Z.sep,"newline")){let U=r2(Z.start),J=Z.key,H=Z.sep;H.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:J,sep:H}]})}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(o0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:U,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(U);else Object.assign(Z,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue($);if(U){if(U.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!o0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){W8(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||o0(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=G8(Q),X=r2(z);Z9($);let U=$.end.splice(1,$.end.length);U.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}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)){W8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let U=[];for(let J=0;J<Z.sep.length;++J){let H=Z.sep[J];switch(H.type){case"newline":U.push(J);break;case"space":break;case"comment":if(H.indent>$.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)X=Z.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(o0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let U=r2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(o0(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(z9(Z.key)&&!o0(Z.sep,"newline")){let U=r2(Z.start),J=Z.key,H=Z.sep;H.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:J,sep:H}]})}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(o0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:U,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(U);else Object.assign(Z,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue($);if(U){if(U.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!o0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){W8(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||o0(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=G8(Q),X=r2(z);Q9($);let U=$.end.splice(1,$.end.length);U.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}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=G8($),Q=r2(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=G8($),Q=r2(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()}}}Wq.Parser=z9});var V9=_((_q)=>{var X9=q5(),Bq=u$(),d$=m$(),Kq=P4(),Dq=g(),Lq=P5(),U9=R5();function J9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new Lq.LineCounter||null,prettyErrors:Z}}function Mq($,Z={}){let{lineCounter:Q,prettyErrors:z}=J9(Z),X=new U9.Parser(Q?.addNewLine),U=new X9.Composer(Z),J=Array.from(U.compose(X.parse($)));if(z&&Q)for(let H of J)H.errors.forEach(d$.prettifyError($,Q)),H.warnings.forEach(d$.prettifyError($,Q));if(J.length>0)return J;return Object.assign([],{empty:!0},U.streamInfo())}function H9($,Z={}){let{lineCounter:Q,prettyErrors:z}=J9(Z),X=new U9.Parser(Q?.addNewLine),U=new X9.Composer(Z),J=null;for(let H of U.compose(X.parse($),!0,$.length))if(!J)J=H;else if(J.options.logLevel!=="silent"){J.errors.push(new d$.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)J.errors.forEach(d$.prettifyError($,Q)),J.warnings.forEach(d$.prettifyError($,Q));return J}function Iq($,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=H9($,Q);if(!X)return null;if(X.warnings.forEach((U)=>Kq.warn(X.options.logLevel,U)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function Oq($,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(Dq.isDocument($)&&!z)return $.toString(Q);return new Bq.Document($,z,Q).toString(Q)}_q.parse=Iq;_q.parseAllDocuments=Mq;_q.parseDocument=H9;_q.stringify=Oq});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:"The stage it is at, and since when",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How it works",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],x0=new Map(p.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),rZ=new Map(p.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),gF=new Map(p.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function sZ($,Z){let Q=(X)=>{let U=X.split("."),J=$;for(let H of U)if(J&&typeof J==="object"&&H in J)J=J[H];else return;return J},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function tz($){return p.filter((Z)=>Z.category===$)}var ez=p.filter(($)=>$.index<=21),$X=p,O6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),oZ=new Set(["none","n/a","not applicable"]),_6="slotignored";function ZX($){return typeof $==="string"&&oZ.has($.trim().toLowerCase())}function I$($){return typeof $==="string"&&$.trim()!==""&&l($)}function l($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return O6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var x2="no classifying signals — fallback",QX=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]),F6={skills:new Set(["stack.frontend"]),"skills-plugin":new Set(["stack.frontend","stack.runtime"])};function g2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(y2,$))return null;if(F6[$]?.has(Z.path))return!0;if(!y2[$].includes(Z.category))return!1;return!($==="framework"&&QX.has(Z.path))}var y2={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"]};function zX($=process.stdout){let Z=process.env.FORCE_COLOR;if(Z!==void 0)return Z!=="0"&&Z!=="false";if(process.env.NO_COLOR!==void 0&&process.env.NO_COLOR!=="")return!1;return Boolean($.isTTY)}var kF=new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`,"g");var P6=($,Z)=>zX()?`\x1B[${$}m${Z}\x1B[0m`:Z,H4=($)=>(Z)=>P6($,Z),O$=H4("1"),v2=H4("2"),hF=H4("3"),_$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},F$=($)=>P6("38;2;0;212;212",$),V4=($)=>P6("38;2;14;140;140",$),k2=($)=>P6("38;5;208",$);var g0=[{name:"TROPHY",indicator:`${k2("✪")} ${k2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${k2(O$("★"))} ${k2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${F$("◆")} ${F$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${V4("◇")} ${V4("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${O$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${v2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${v2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${v2("♡")}`,threshold:0}];function P$($){for(let Z of g0)if($>=Z.threshold)return Z;return g0[g0.length-1]}function XX($){let Z=P$($),Q=g0.indexOf(Z);return Q>0?g0[Q-1]:null}var q4={};oz(q4,{validate:()=>JX,sdkVersion:()=>WX,scoreFafb:()=>GX,scoreEnterprise:()=>UX,score:()=>W4,fafbInfo:()=>YX,decompile:()=>VX,compile:()=>HX});var Y4=null;function p0(){if(Y4)return Y4;try{let $=M$("faf-scoring-kernel");return Y4=$,$}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=G8($),Q=r2(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=G8($),Q=r2(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()}}}Wq.Parser=X9});var Y9=_((_q)=>{var U9=B5(),Bq=m$(),i$=f$(),Kq=R4(),Dq=g(),Lq=R5(),J9=N5();function H9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new Lq.LineCounter||null,prettyErrors:Z}}function Mq($,Z={}){let{lineCounter:Q,prettyErrors:z}=H9(Z),X=new J9.Parser(Q?.addNewLine),U=new U9.Composer(Z),J=Array.from(U.compose(X.parse($)));if(z&&Q)for(let H of J)H.errors.forEach(i$.prettifyError($,Q)),H.warnings.forEach(i$.prettifyError($,Q));if(J.length>0)return J;return Object.assign([],{empty:!0},U.streamInfo())}function V9($,Z={}){let{lineCounter:Q,prettyErrors:z}=H9(Z),X=new J9.Parser(Q?.addNewLine),U=new U9.Composer(Z),J=null;for(let H of U.compose(X.parse($),!0,$.length))if(!J)J=H;else if(J.options.logLevel!=="silent"){J.errors.push(new i$.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)J.errors.forEach(i$.prettifyError($,Q)),J.warnings.forEach(i$.prettifyError($,Q));return J}function Iq($,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=V9($,Q);if(!X)return null;if(X.warnings.forEach((U)=>Kq.warn(X.options.logLevel,U)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function Oq($,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(Dq.isDocument($)&&!z)return $.toString(Q);return new Bq.Document($,z,Q).toString(Q)}_q.parse=Iq;_q.parseAllDocuments=Mq;_q.parseDocument=V9;_q.stringify=Oq});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:"The stage it is at, and since when",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How it works",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,$]])),sZ=new Map(p.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),kF=new Map(p.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function oZ($,Z){let Q=(X)=>{let U=X.split("."),J=$;for(let H of U)if(J&&typeof J==="object"&&H in J)J=J[H];else return;return J},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function tz($){return p.filter((Z)=>Z.category===$)}var ez=p.filter(($)=>$.index<=21),$X=p,O6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),aZ=new Set(["none","n/a","not applicable"]),_6="slotignored";function ZX($){return typeof $==="string"&&aZ.has($.trim().toLowerCase())}function O$($){return typeof $==="string"&&$.trim()!==""&&l($)}function l($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return O6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var x2="no classifying signals — fallback",QX=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]),F6={skills:new Set(["stack.frontend"]),"skills-plugin":new Set(["stack.frontend","stack.runtime"])};function g2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(y2,$))return null;if(F6[$]?.has(Z.path))return!0;if(!y2[$].includes(Z.category))return!1;return!($==="framework"&&QX.has(Z.path))}var y2={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"]};function zX($=process.stdout){let Z=process.env.FORCE_COLOR;if(Z!==void 0)return Z!=="0"&&Z!=="false";if(process.env.NO_COLOR!==void 0&&process.env.NO_COLOR!=="")return!1;return Boolean($.isTTY)}var uF=new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`,"g");var P6=($,Z)=>zX()?`\x1B[${$}m${Z}\x1B[0m`:Z,V4=($)=>(Z)=>P6($,Z),_$=V4("1"),v2=V4("2"),mF=V4("3"),F$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},P$=($)=>P6("38;2;0;212;212",$),Y4=($)=>P6("38;2;14;140;140",$),k2=($)=>P6("38;5;208",$);var v0=[{name:"TROPHY",indicator:`${k2("✪")} ${k2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${k2(_$("★"))} ${k2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${P$("◆")} ${P$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${Y4("◇")} ${Y4("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${_$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${v2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${v2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${v2("♡")}`,threshold:0}];function R$($){for(let Z of v0)if($>=Z.threshold)return Z;return v0[v0.length-1]}function XX($){let Z=R$($),Q=v0.indexOf(Z);return Q>0?v0[Q-1]:null}var B4={};oz(B4,{validate:()=>JX,sdkVersion:()=>WX,scoreFafb:()=>GX,scoreEnterprise:()=>UX,score:()=>q4,fafbInfo:()=>YX,decompile:()=>VX,compile:()=>HX});var G4=null;function p0(){if(G4)return G4;try{let $=I$("faf-scoring-kernel");return G4=$,$}catch{throw Error(`faf-scoring-kernel not installed.
140
140
 
141
141
  Run: npm install faf-scoring-kernel
142
- `)}}var R6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function G4($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[rZ.get(Q)??Q]=z;return{...$,slots:Z}}function W4($){return G4(JSON.parse(p0().score_faf(R6($))))}function UX($){return G4(JSON.parse(p0().score_faf_enterprise(R6($))))}function JX($){return p0().validate_faf(R6($))}function HX($){return p0().compile_fafb(R6($))}function VX($){return JSON.parse(p0().decompile_fafb($))}function YX($){return JSON.parse(p0().fafb_info($))}function GX($){return G4(JSON.parse(p0().score_fafb($)))}function WX(){return p0().sdk_version()}var aZ=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function tZ($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function eZ($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],U=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),J=-1;if(U){let H=parseInt(U[1],10);if(H>=0&&H<=100)J=H}return{represents:X,sourceScore:J}}function qX($){return $.unknown?"unknown (—)":`${$.score}%`}function $1($){return{score:$.score,tier:P$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function B4($){let Z=eZ($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?P$(Q):g0[g0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return $1(W4($))}function BX($){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(!tZ(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!aZ.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 e9}from"fs";import{join as o9,dirname as c5,basename as jR,resolve as Z6}from"path";var Tq=q5(),Aq=u$(),Cq=o4(),N5=m$(),jq=T$(),a0=g(),wq=i0(),Sq=i(),Eq=r0(),bq=s0(),qR=V8(),yq=F5(),xq=P5(),gq=R5(),q8=V9(),Y9=R$();var vq=Tq.Composer,B8=Aq.Document,kq=Cq.Schema,hq=N5.YAMLError,K8=N5.YAMLParseError,uq=N5.YAMLWarning,mq=jq.Alias,h0=a0.isAlias,K2=a0.isCollection,fq=a0.isDocument,c=a0.isMap,M0=a0.isNode,pq=a0.isPair,o=a0.isScalar,u0=a0.isSeq,lq=wq.Pair,cq=Sq.Scalar,s2=Eq.YAMLMap,i$=bq.YAMLSeq;var dq=yq.Lexer,iq=xq.LineCounter,nq=gq.Parser,m0=q8.parse,rq=q8.parseAllDocuments,o2=q8.parseDocument,D2=q8.stringify,sq=Y9.visit,oq=Y9.visitAsync;import{accessSync as G9,closeSync as j5,constants as W9,existsSync as aq,fchmodSync as q9,fchownSync as tq,fsyncSync as B9,lstatSync as w5,mkdirSync as K9,mkdtempSync as DR,openSync as D9,readdirSync as eq,readFileSync as S5,readlinkSync as $B,realpathSync as ZB,renameSync as QB,rmSync as LR,statSync as a2,unlinkSync as L9,writeFileSync as zB}from"fs";import{randomBytes as XB}from"crypto";import{basename as t0,dirname as L2,isAbsolute as M9,join as t2,relative as E5,resolve as G0,sep as D8}from"path";class S 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 e=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),UB=new Set(Object.values(e).map(($)=>$.toLowerCase())),JB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),T5=($)=>UB.has($.toLowerCase());function e2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var HB=/\.fafm?$/i,VB=/^[a-z][a-z0-9-]*$/,j0=($)=>ZB.native($),e0=($)=>$?.code;function r$($,Z){let Q=E5($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${D8}`)&&!M9(Q)}function I9($){try{return $B($)}catch{return"?"}}function YB($,Z,Q,z){let X;try{X=j0(Q)}catch(U){let J=e0(U);if(J==="ENOENT"||J==="ELOOP"||J==="ENOTDIR")throw new S("dangling",Z,`${Z} is a link to ${I9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw U}if(!r$($,X))throw new S("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(e2(X)&&!(z.inGit&&L2(X)===$))throw new S("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!a2(X).isFile())throw new S("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return GB(Z,X,z.read),X}function GB($,Z,Q){let z=t0($),X=t0(Z),U=T5(z)&&T5(X);if(Q&&!HB.test(X)&&!U){let J=T5(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new S("not-faf",$,`${$} is a link to ${Z}, which is not ${J} — refused.`)}if(!Q&&!JB(z,X)&&!U)throw new S("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 WB($,Z,Q,z){if(t0(G0($))!=="hooks"||!VB.test(t0(Z)))throw new S("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new S("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function qB($,Z,Q){if(t0($)!=="config"||Q!==Z)throw new S("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function m($,Z,Q={}){let z=j0(G0($)),X=G0($,Z),U=j0(L2(X));if(!r$(z,U))throw new S("outside",X,`${X} is in ${U}, outside ${z} — refused.`);let J=Q.allowGitHooks===!0,H=Q.allowGitConfig===!0;if(J)WB($,X,z,U);if(H)qB(X,z,U);let V=t2(U,t0(X));if(e2(V)&&!J&&!H)throw new S("git",X,V===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${V}, inside .git/ — refused.`);let Y;try{Y=w5(V)}catch(G){if(e0(G)==="ENOENT")return V;throw G}if(Y.isSymbolicLink())return YB(z,X,V,{read:Q.read===!0,inGit:J||H});if(!Y.isFile())throw new S("not-a-file",X,`${X} is not a regular file — refused.`);return j0(V)}var BB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function KB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return BB.decode($)}catch{}throw new S("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Q0($){return KB(S5($),$)}function f0($){try{return S5($)}catch(Z){if(e0(Z)==="ENOENT")return null;throw Z}}function n$($,Z){let Q=G0(t2($,Z));if(!aq(Q))return null;let z,X;try{z=j0(DB($)),X=j0(Q)}catch{return null}if(!r$(z,X)||e2(E5(z,X)))return null;return X}var C5=[];function DB($){let Z=G0($);return C5.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(D8)?Q:Q+D8))??Z}function $$($,Z){C5.push(G0($));try{return Z()}finally{C5.pop()}}function M($,Z){return n$($,Z)!==null}function j($,Z){let Q=n$($,Z);if(Q===null)return null;try{return a2(Q).isFile()?S5(Q,"utf-8"):null}catch{return null}}function I0($,Z){let Q=n$($,Z);if(Q===null)return null;try{return a2(Q)}catch{return null}}function k($,Z="."){let Q=n$($,Z);if(Q===null)return null;let z;try{z=eq(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||n$($,t2(Z,X.name))!==null)}function LB($){try{let Z=a2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(e0(Z)==="ENOENT")return;throw Z}}class O9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var A5=($)=>new S("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function b5($,Z,Q){if(Z!==void 0){let X=f0($),U=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||U===null?X===U:X.equals(U)))throw A5($)}if(!Q)return;let z;try{z=a2($)}catch(X){if(e0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw A5($);try{G9($,W9.W_OK)}catch{throw A5($)}}function MB($,Z){if(process.platform!=="win32")try{tq($,Z.uid,Z.gid)}catch{}q9($,Z.mode)}function IB($){if(process.platform==="win32")return;try{let Z=D9($,"r");try{B9(Z)}finally{j5(Z)}}catch{}}function OB($,Z,Q,z){if($.fd=D9($.path,"wx",z??Q?.mode??438),$.created=!0,zB($.fd,Z),Q)MB($.fd,Q);if(z!==void 0)q9($.fd,z);B9($.fd),j5($.fd),$.fd=void 0}function _B($){if($.fd!==void 0)try{j5($.fd)}catch{}if($.created)try{L9($.path)}catch{}}function FB($,Z,Q){let z=L2($),X={path:t2(z,`.${t0($).slice(0,100)}.${process.pid}.${XB(6).toString("hex")}.faf-tmp`),created:!1},U=LB($);try{if(U)G9($,W9.W_OK);OB(X,Z,U,Q.mode),b5($,Q.expect,U),QB(X.path,$)}catch(J){if(_B(X),J instanceof S)throw J;let H=e0(J)??(J instanceof Error?J.message:String(J));throw new O9($,`${$}: not written${U?"; original kept":""} (${H})`,{cause:J})}IB(z)}function PB($){return $ instanceof S&&!$.onWrite?new S($.reason,$.path,$.message,{onWrite:!0}):$}function $0($,Z,Q={}){let z=G0($),X;try{X=m(Q.root??L2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(U){throw PB(U)}return FB(X,Z,Q),X}function _9($,Z,Q){let z=G0($),X=Q.root??L2(z),U=m(X,z),J=f0(U);if(Q.expect!==void 0)b5(U,Q.expect,void 0);if(J!==null&&Q.force!==!0&&!Q.owns(J))throw new S("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return $0(U,Z,{root:X,expect:J})}function Z$($,Z=$){let Q=G0($);K9(Q,{recursive:!0});let z=j0(Q),X=G0(Q,Z),U=E5(Q,X);if(U===".."||U.startsWith(`..${D8}`)||M9(U))throw new S("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let J=z;for(let H of U.split(/[\\/]/).filter(Boolean)){let V=t2(J,H);if(e2(V))throw new S("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});J=RB(z,X,V)}return J}function RB($,Z,Q){let z;try{z=w5(Q)}catch(U){if(e0(U)!=="ENOENT")throw U;return K9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=j0(Q)}catch{throw new S("dangling",Z,`${Q} is a link to ${I9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!r$($,X))throw new S("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(e2(X))throw new S("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!a2(X).isDirectory())throw new S("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function NB($,Z){let Q=G0($),z=j0(G0(Z.root??L2(Q))),X=j0(L2(Q));if(!r$(z,X))throw new S("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let U=t2(X,t0(Q));if(e2(U))throw new S("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let J;try{J=w5(U)}catch(H){if(e0(H)==="ENOENT")return!1;throw H}if(!J.isFile())throw new S("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return b5(U,Z.expect,void 0),L9(U),!0}function h($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function Q$($){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 L8($,Z){if($===null||$===void 0)return{};if(!h($))throw new S("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${Q$($)}. `+"faf left it unchanged — fix it by hand.");return $}var A9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function F9($){return typeof $==="object"&&$.collection===void 0}function TB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
143
- `)||typeof $.value!=="number")return;let z=Z.find((U)=>U.default===!0&&U.test?.test(Q));if(!z||!A9.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 AB($){let Z=$.filter(F9);return $.map((Q)=>{if(!F9(Q)||!A9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,U,J,H)=>TB(X,Z)??z(X,U,J,H)}})}var M8={keepSourceTokens:!0,customTags:AB};function CB($,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 jB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let U=CB(Z[X],Z[X+1]);Q??=U.indent,z??=U.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function k5($,Z){let Q=o2($,M8);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 M2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function s$($,Z){return $.lastIndexOf(`
145
- `,Z-1)+1}function C9($,Z){if(Z>0&&$[Z-1]===`
142
+ `)}}var R6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function W4($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[sZ.get(Q)??Q]=z;return{...$,slots:Z}}function q4($){return W4(JSON.parse(p0().score_faf(R6($))))}function UX($){return W4(JSON.parse(p0().score_faf_enterprise(R6($))))}function JX($){return p0().validate_faf(R6($))}function HX($){return p0().compile_fafb(R6($))}function VX($){return JSON.parse(p0().decompile_fafb($))}function YX($){return JSON.parse(p0().fafb_info($))}function GX($){return W4(JSON.parse(p0().score_fafb($)))}function WX(){return p0().sdk_version()}var tZ=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function eZ($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function $1($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],U=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),J=-1;if(U){let H=parseInt(U[1],10);if(H>=0&&H<=100)J=H}return{represents:X,sourceScore:J}}function qX($){return $.unknown?"unknown (—)":`${$.score}%`}function Z1($){return{score:$.score,tier:R$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function K4($){let Z=$1($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?R$(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 Z1(q4($))}function BX($){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(!eZ(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!tZ.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 e9}from"fs";import{join as a9,dirname as R8,basename as SR,resolve as z$}from"path";var Tq=B5(),Aq=m$(),Cq=a4(),T5=f$(),jq=A$(),a0=g(),wq=i0(),Sq=i(),Eq=r0(),bq=s0(),KR=V8(),yq=P5(),xq=R5(),gq=N5(),q8=Y9(),G9=N$();var vq=Tq.Composer,B8=Aq.Document,kq=Cq.Schema,hq=T5.YAMLError,K8=T5.YAMLParseError,uq=T5.YAMLWarning,mq=jq.Alias,u0=a0.isAlias,K2=a0.isCollection,fq=a0.isDocument,c=a0.isMap,M0=a0.isNode,pq=a0.isPair,o=a0.isScalar,m0=a0.isSeq,lq=wq.Pair,cq=Sq.Scalar,s2=Eq.YAMLMap,n$=bq.YAMLSeq;var dq=yq.Lexer,iq=xq.LineCounter,nq=gq.Parser,f0=q8.parse,rq=q8.parseAllDocuments,o2=q8.parseDocument,D2=q8.stringify,sq=G9.visit,oq=G9.visitAsync;import{accessSync as W9,closeSync as w5,constants as q9,existsSync as aq,fchmodSync as B9,fchownSync as tq,fsyncSync as K9,lstatSync as S5,mkdirSync as D9,mkdtempSync as MR,openSync as L9,readdirSync as eq,readFileSync as E5,readlinkSync as $B,realpathSync as ZB,renameSync as QB,rmSync as IR,statSync as a2,unlinkSync as M9,writeFileSync as zB}from"fs";import{randomBytes as XB}from"crypto";import{basename as t0,dirname as L2,isAbsolute as I9,join as t2,relative as b5,resolve as G0,sep as D8}from"path";class S 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 e=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),UB=new Set(Object.values(e).map(($)=>$.toLowerCase())),JB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),A5=($)=>UB.has($.toLowerCase());function e2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var HB=/\.fafm?$/i,VB=/^[a-z][a-z0-9-]*$/,j0=($)=>ZB.native($),e0=($)=>$?.code;function s$($,Z){let Q=b5($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${D8}`)&&!I9(Q)}function O9($){try{return $B($)}catch{return"?"}}function YB($,Z,Q,z){let X;try{X=j0(Q)}catch(U){let J=e0(U);if(J==="ENOENT"||J==="ELOOP"||J==="ENOTDIR")throw new S("dangling",Z,`${Z} is a link to ${O9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw U}if(!s$($,X))throw new S("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(e2(X)&&!(z.inGit&&L2(X)===$))throw new S("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!a2(X).isFile())throw new S("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return GB(Z,X,z.read),X}function GB($,Z,Q){let z=t0($),X=t0(Z),U=A5(z)&&A5(X);if(Q&&!HB.test(X)&&!U){let J=A5(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new S("not-faf",$,`${$} is a link to ${Z}, which is not ${J} — refused.`)}if(!Q&&!JB(z,X)&&!U)throw new S("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 WB($,Z,Q,z){if(t0(G0($))!=="hooks"||!VB.test(t0(Z)))throw new S("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new S("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function qB($,Z,Q){if(t0($)!=="config"||Q!==Z)throw new S("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function u($,Z,Q={}){let z=j0(G0($)),X=G0($,Z),U=j0(L2(X));if(!s$(z,U))throw new S("outside",X,`${X} is in ${U}, outside ${z} — refused.`);let J=Q.allowGitHooks===!0,H=Q.allowGitConfig===!0;if(J)WB($,X,z,U);if(H)qB(X,z,U);let V=t2(U,t0(X));if(e2(V)&&!J&&!H)throw new S("git",X,V===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${V}, inside .git/ — refused.`);let Y;try{Y=S5(V)}catch(G){if(e0(G)==="ENOENT")return V;throw G}if(Y.isSymbolicLink())return YB(z,X,V,{read:Q.read===!0,inGit:J||H});if(!Y.isFile())throw new S("not-a-file",X,`${X} is not a regular file — refused.`);return j0(V)}var BB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function KB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return BB.decode($)}catch{}throw new S("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Q0($){return KB(E5($),$)}function w0($){try{return E5($)}catch(Z){if(e0(Z)==="ENOENT")return null;throw Z}}function r$($,Z){let Q=G0(t2($,Z));if(!aq(Q))return null;let z,X;try{z=j0(DB($)),X=j0(Q)}catch{return null}if(!s$(z,X)||e2(b5(z,X)))return null;return X}var j5=[];function DB($){let Z=G0($);return j5.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(D8)?Q:Q+D8))??Z}function $$($,Z){j5.push(G0($));try{return Z()}finally{j5.pop()}}function M($,Z){return r$($,Z)!==null}function j($,Z){let Q=r$($,Z);if(Q===null)return null;try{return a2(Q).isFile()?E5(Q,"utf-8"):null}catch{return null}}function I0($,Z){let Q=r$($,Z);if(Q===null)return null;try{return a2(Q)}catch{return null}}function k($,Z="."){let Q=r$($,Z);if(Q===null)return null;let z;try{z=eq(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||r$($,t2(Z,X.name))!==null)}function LB($){try{let Z=a2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(e0(Z)==="ENOENT")return;throw Z}}class _9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var C5=($)=>new S("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function y5($,Z,Q){if(Z!==void 0){let X=w0($),U=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||U===null?X===U:X.equals(U)))throw C5($)}if(!Q)return;let z;try{z=a2($)}catch(X){if(e0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw C5($);try{W9($,q9.W_OK)}catch{throw C5($)}}function MB($,Z){if(process.platform!=="win32")try{tq($,Z.uid,Z.gid)}catch{}B9($,Z.mode)}function IB($){if(process.platform==="win32")return;try{let Z=L9($,"r");try{K9(Z)}finally{w5(Z)}}catch{}}function OB($,Z,Q,z){if($.fd=L9($.path,"wx",z??Q?.mode??438),$.created=!0,zB($.fd,Z),Q)MB($.fd,Q);if(z!==void 0)B9($.fd,z);K9($.fd),w5($.fd),$.fd=void 0}function _B($){if($.fd!==void 0)try{w5($.fd)}catch{}if($.created)try{M9($.path)}catch{}}function FB($,Z,Q){let z=L2($),X={path:t2(z,`.${t0($).slice(0,100)}.${process.pid}.${XB(6).toString("hex")}.faf-tmp`),created:!1},U=LB($);try{if(U)W9($,q9.W_OK);OB(X,Z,U,Q.mode),y5($,Q.expect,U),QB(X.path,$)}catch(J){if(_B(X),J instanceof S)throw J;let H=e0(J)??(J instanceof Error?J.message:String(J));throw new _9($,`${$}: not written${U?"; original kept":""} (${H})`,{cause:J})}IB(z)}function PB($){return $ instanceof S&&!$.onWrite?new S($.reason,$.path,$.message,{onWrite:!0}):$}function $0($,Z,Q={}){let z=G0($),X;try{X=u(Q.root??L2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(U){throw PB(U)}return FB(X,Z,Q),X}function F9($,Z,Q){let z=G0($),X=Q.root??L2(z),U=u(X,z),J=w0(U);if(Q.expect!==void 0)y5(U,Q.expect,void 0);if(J!==null&&Q.force!==!0&&!Q.owns(J))throw new S("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return $0(U,Z,{root:X,expect:J})}function Z$($,Z=$){let Q=G0($);D9(Q,{recursive:!0});let z=j0(Q),X=G0(Q,Z),U=b5(Q,X);if(U===".."||U.startsWith(`..${D8}`)||I9(U))throw new S("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let J=z;for(let H of U.split(/[\\/]/).filter(Boolean)){let V=t2(J,H);if(e2(V))throw new S("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});J=RB(z,X,V)}return J}function RB($,Z,Q){let z;try{z=S5(Q)}catch(U){if(e0(U)!=="ENOENT")throw U;return D9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=j0(Q)}catch{throw new S("dangling",Z,`${Q} is a link to ${O9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!s$($,X))throw new S("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(e2(X))throw new S("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!a2(X).isDirectory())throw new S("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function NB($,Z){let Q=G0($),z=j0(G0(Z.root??L2(Q))),X=j0(L2(Q));if(!s$(z,X))throw new S("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let U=t2(X,t0(Q));if(e2(U))throw new S("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let J;try{J=S5(U)}catch(H){if(e0(H)==="ENOENT")return!1;throw H}if(!J.isFile())throw new S("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return y5(U,Z.expect,void 0),M9(U),!0}function h($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function Q$($){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 L8($,Z){if($===null||$===void 0)return{};if(!h($))throw new S("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${Q$($)}. `+"faf left it unchanged — fix it by hand.");return $}var C9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function P9($){return typeof $==="object"&&$.collection===void 0}function TB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
143
+ `)||typeof $.value!=="number")return;let z=Z.find((U)=>U.default===!0&&U.test?.test(Q));if(!z||!C9.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 AB($){let Z=$.filter(P9);return $.map((Q)=>{if(!P9(Q)||!C9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,U,J,H)=>TB(X,Z)??z(X,U,J,H)}})}var M8={keepSourceTokens:!0,customTags:AB};function CB($,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 jB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let U=CB(Z[X],Z[X+1]);Q??=U.indent,z??=U.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function h5($,Z){let Q=o2($,M8);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 M2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function o$($,Z){return $.lastIndexOf(`
145
+ `,Z-1)+1}function j9($,Z){if(Z>0&&$[Z-1]===`
146
146
  `)return Z;let Q=$.indexOf(`
147
- `,Z);return Q<0?$.length:Q+1}function P9($,Z){let Q=Z;if($[Q-1]===`
148
- `){if(Q--,$[Q-1]==="\r")Q--}return Q}function O0($){return $!==null&&$!==void 0}function U0($){let Z=M0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function j9($,Z){let Q=U0($),z=U0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function w9($){if(o($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return K2($)&&!$.flow}function I8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function S9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&I8($,Z)}function E9($,Z,Q,z){let X=new B8(void 0,M8);X.contents=Z(X);let J=X.toString($.piece).replace(/\n+$/,"").slice(Q),H=J.startsWith(" ")&&!J.includes(`
147
+ `,Z);return Q<0?$.length:Q+1}function R9($,Z){let Q=Z;if($[Q-1]===`
148
+ `){if(Q--,$[Q-1]==="\r")Q--}return Q}function O0($){return $!==null&&$!==void 0}function U0($){let Z=M0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function w9($,Z){let Q=U0($),z=U0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function S9($){if(o($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return K2($)&&!$.flow}function I8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function E9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&I8($,Z)}function b9($,Z,Q,z){let X=new B8(void 0,M8);X.contents=Z(X);let J=X.toString($.piece).replace(/\n+$/,"").slice(Q),H=J.startsWith(" ")&&!J.includes(`
149
149
  `),V=" ".repeat(z),Y=J.replace(/\n(?=.)/g,`
150
- ${V}`).replace(/\n/g,$.eol);return{inline:H,text:H?J.slice(1):Y}}function x5($,Z,Q){return E9($,(z)=>{let X=new s2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function wB($,Z,Q){let z=E9($,()=>{let X=new i$;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 SB($){if(!M0($)||!O0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function EB($,Z){if(!M0($)||!M0(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 bB($,Z){let Q=U0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function yB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function R9($,Z,Q,z,X=!1){let U=U0(Z);if(!U||z.kind==="root")return null;let J=Z.comment,H=M0(Q)?Q.comment:void 0,V=!O0(J)||J===H,Y=V?SB(Q):Q,G=X?Y:EB(Z,Y),W=z.kind==="value"?x5($,G,z.col):wB($,G,z.col);return W?{range:U,keepTail:V,newComment:H,piece:W}:null}function xB($,Z,Q,z){if(!z)return P9($,C9($,Q[2]));return w9(Z)?P9($,Q[1]):Q[1]}function o$($,Z,Q,z,X){let U=R9($,Z,Q,z);if(!U)return!1;let J=xB($.src,Z,U.range,U.keepTail);if(U.piece.inline&&(!w9(Z)||z.kind==="item"))return gB($,U,J,z,X),!0;let H=U.keepTail?Z.comment:U.newComment;if(X!==void 0||O0(H))return!1;let V=z.kind==="value"?R9($,Z,Q,z,!0):U;return V!==null&&vB($,V.range[0],J,V.piece,z)}function gB($,Z,Q,z,X){let[U,J]=Z.range,V=U===J&&z.kind==="value"?yB($.src,U,Z.piece.text):Z.piece.text;M2($,U,Q,V+(X===void 0?"":` #${X}`))}function vB($,Z,Q,z,X){if(X.kind==="item")return M2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let U=bB($.src,X.key);if(U<0)return!1;return M2($,U,Q,z.inline?` ${z.text}`:z.text),!0}function kB($,Z){return I8({...$,comment:void 0},{...Z,comment:void 0})}function hB($,Z){if(O0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
- `)?void 0:Z.comment}function uB($,Z,Q,z){if(S9(Z,Q))return!0;if(!kB(Z,Q))return!1;let X=hB(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return o$($,Z,Q,z,X)}function mB($,Z,Q,z){if(!I8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return x5($,Z,0).text===x5($,Q,0).text||o$($,Z,Q,z);if(Q.items.length===0)return o$($,Z,Q,z);return c(Z)?cB($,Z,Q):iB($,Z,Q)}function h5($,Z,Q,z){if(!j9(Z,Q))return o$($,Z,Q,z);if(o(Z))return uB($,Z,Q,z);if(h0(Z))return h0(Q)&&Z.source===Q.source&&I8(Z,Q)||o$($,Z,Q,z);if(!K2(Z)||!K2(Q))return!1;return mB($,Z,Q,z)}function b9($,Z){return Z-s$($,Z)}function u5($,Z,Q){let z=$.slice(s$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function g5($){return M0($)&&(O0($.commentBefore)||!!$.spaceBefore)}function m5($,Z,Q){let z=U0(Z)??U0(Q);return z?C9($.src,z[2]):-1}function y9($,Z,Q){let z=new B8(void 0,M8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
150
+ ${V}`).replace(/\n/g,$.eol);return{inline:H,text:H?J.slice(1):Y}}function g5($,Z,Q){return b9($,(z)=>{let X=new s2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function wB($,Z,Q){let z=b9($,()=>{let X=new n$;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 SB($){if(!M0($)||!O0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function EB($,Z){if(!M0($)||!M0(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 bB($,Z){let Q=U0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function yB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function N9($,Z,Q,z,X=!1){let U=U0(Z);if(!U||z.kind==="root")return null;let J=Z.comment,H=M0(Q)?Q.comment:void 0,V=!O0(J)||J===H,Y=V?SB(Q):Q,G=X?Y:EB(Z,Y),W=z.kind==="value"?g5($,G,z.col):wB($,G,z.col);return W?{range:U,keepTail:V,newComment:H,piece:W}:null}function xB($,Z,Q,z){if(!z)return R9($,j9($,Q[2]));return S9(Z)?R9($,Q[1]):Q[1]}function a$($,Z,Q,z,X){let U=N9($,Z,Q,z);if(!U)return!1;let J=xB($.src,Z,U.range,U.keepTail);if(U.piece.inline&&(!S9(Z)||z.kind==="item"))return gB($,U,J,z,X),!0;let H=U.keepTail?Z.comment:U.newComment;if(X!==void 0||O0(H))return!1;let V=z.kind==="value"?N9($,Z,Q,z,!0):U;return V!==null&&vB($,V.range[0],J,V.piece,z)}function gB($,Z,Q,z,X){let[U,J]=Z.range,V=U===J&&z.kind==="value"?yB($.src,U,Z.piece.text):Z.piece.text;M2($,U,Q,V+(X===void 0?"":` #${X}`))}function vB($,Z,Q,z,X){if(X.kind==="item")return M2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let U=bB($.src,X.key);if(U<0)return!1;return M2($,U,Q,z.inline?` ${z.text}`:z.text),!0}function kB($,Z){return I8({...$,comment:void 0},{...Z,comment:void 0})}function hB($,Z){if(O0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
+ `)?void 0:Z.comment}function uB($,Z,Q,z){if(E9(Z,Q))return!0;if(!kB(Z,Q))return!1;let X=hB(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return a$($,Z,Q,z,X)}function mB($,Z,Q,z){if(!I8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return g5($,Z,0).text===g5($,Q,0).text||a$($,Z,Q,z);if(Q.items.length===0)return a$($,Z,Q,z);return c(Z)?cB($,Z,Q):iB($,Z,Q)}function u5($,Z,Q,z){if(!w9(Z,Q))return a$($,Z,Q,z);if(o(Z))return uB($,Z,Q,z);if(u0(Z))return u0(Q)&&Z.source===Q.source&&I8(Z,Q)||a$($,Z,Q,z);if(!K2(Z)||!K2(Q))return!1;return mB($,Z,Q,z)}function y9($,Z){return Z-o$($,Z)}function m5($,Z,Q){let z=$.slice(o$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function v5($){return M0($)&&(O0($.commentBefore)||!!$.spaceBefore)}function f5($,Z,Q){let z=U0(Z)??U0(Q);return z?j9($.src,z[2]):-1}function x9($,Z,Q){let z=new B8(void 0,M8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
152
152
  `).map((J)=>J?X+J:J).join($.eol)+$.eol}function fB($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
- `);M2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function x9($,Z,Q,z,X,U){let J=Q;if(J<0){let H=U0(Z);if(!H||g5(Z)||!u5($.src,H[0],U))return!1;J=s$($.src,H[0])}return fB($,J,y9($,z,X)),!0}function pB($,Z,Q){let z=s$($,Q),X=Z,U=O0(X.commentBefore),J=!!X.spaceBefore;while(z>0){let H=s$($,z-1),V=$.slice(H,z).trim();if(U&&V.startsWith("#"))z=H;else if(J&&V==="")z=H,J=!1;else break}return z}function g9($,Z,Q,z){let X=U0(Z);if(!X||!u5($.src,X[0],z))return!1;let U=m5($,Q,Z);if(U<0)return!1;return M2($,pB($.src,Z,X[0]),U,""),!0}function v9($,Z){let Q=new Map,z=(X)=>{let U=U0(X);return U?U.join(":"):void 0};return $.forEach((X,U)=>{let J=z(Z(X));if(J!==void 0&&!Q.has(J))Q.set(J,U)}),(X)=>{let U=z(Z(X)),J=U===void 0?void 0:Q.get(U);return J!==void 0&&j9(Z($[J]),Z(X))?J:-1}}function lB($,Z){return o($)&&o(Z)?S9($,Z):$===Z}function cB($,Z,Q){let z=Z.items[0]?.key,X=U0(z);if(!X)return!1;let U=b9($.src,X[0]),J=new Set,H=(W,q)=>{if(W.length===0)return!0;let K=new s2;K.items.push(...W);let L=q<0?-1:m5($,Z.items[q].value,Z.items[q].key);return x9($,z,L,K,U,!1)},V=v9(Z.items,(W)=>W.key),Y=-1,G=[];for(let W of Q.items){let q=V(W);if(q<0){G.push(W);continue}if(q<=Y||!H(G,Y)||!lB(Z.items[q].key,W.key))return!1;if(G=[],!h5($,Z.items[q].value,W.value,{kind:"value",key:Z.items[q].key,col:U}))return!1;J.add(q),Y=q}if(!H(G,Y))return!1;return Z.items.every((W,q)=>J.has(q)||dB($,Z,q))}function dB($,Z,Q){let z=Z.items[Q],X=U0(z.key);if(!X)return!1;if(u5($.src,X[0],!1))return g9($,z.key,z.value,!1);let U=Z.items[Q+1],J=U0(U?.key);if(Q!==0||!J||g5(z.key)||g5(U.key))return!1;return M2($,X[0],J[0],""),!0}function iB($,Z,Q){let z=U0(Z);if(!z||Z.items.length===0)return!1;let X=b9($.src,z[0]),U=new Set,J=(G,W)=>{if(G.length===0)return!0;let q=new i$;q.items.push(...G);let K=W<0?-1:m5($,Z.items[W]);return x9($,Z.items[0],K,q,X,!0)},H=v9(Z.items,(G)=>G),V=-1,Y=[];for(let G of Q.items){let W=H(G);if(W<0){Y.push(G);continue}if(W<=V||!J(Y,V))return!1;if(Y=[],!h5($,Z.items[W],G,{kind:"item",col:X}))return!1;U.add(W),V=W}if(!J(Y,V))return!1;return Z.items.every((G,W)=>U.has(W)||g9($,G,G,!0))}function nB($,Z){let Q=[...Z].sort((U,J)=>J.start-U.start||J.end-U.end||J.seq-U.seq),z=$,X=1/0;for(let U of Q){if(U.end>X)return null;z=z.slice(0,U.start)+U.text+z.slice(U.end),X=U.start}return z}function rB($,Z,Q){if(!c(Q)&&!u0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
- `)?$.eol:"",X=Z.commentBefore?$.eol:"";return M2($,$.src.length,$.src.length,z+X+y9($,Q,0)),!0}function sB($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!O0(z))return!O0(X)||rB($,Z,X);return O0(X)&&h5($,z,X,{kind:"root"})}function oB($,Z,Q,z,X){let U={src:$,eol:z,edits:[],piece:X};if(!sB(U,Z,Q))return null;return nB($,U.edits)}var N9=($)=>$.replace(/^[ \t]*\n/gm,"");function aB($,Z,Q,z){let X=o2($,M8);if(X.errors.length>0||!d(X.toJS(),Z.toJS()))return!1;let U=X.toString(z);return U===Q||N9(U)===N9(Q)}function O8($,Z,Q="YAML"){let{text:z,changed:X}=tB($,Z,Q);return{text:z,changed:X}}function tB($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),U=k5(X,Q),J=eB(U);Z(J);let H={text:$,changed:!1,spliced:!1};if(d(J.toJS(),U.toJS()))return H;let V={lineWidth:0,...jB(X)},Y=J.toString(V);if(Y===U.toString(V))return H;let G=X.includes(`\r
153
+ `);M2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function g9($,Z,Q,z,X,U){let J=Q;if(J<0){let H=U0(Z);if(!H||v5(Z)||!m5($.src,H[0],U))return!1;J=o$($.src,H[0])}return fB($,J,x9($,z,X)),!0}function pB($,Z,Q){let z=o$($,Q),X=Z,U=O0(X.commentBefore),J=!!X.spaceBefore;while(z>0){let H=o$($,z-1),V=$.slice(H,z).trim();if(U&&V.startsWith("#"))z=H;else if(J&&V==="")z=H,J=!1;else break}return z}function v9($,Z,Q,z){let X=U0(Z);if(!X||!m5($.src,X[0],z))return!1;let U=f5($,Q,Z);if(U<0)return!1;return M2($,pB($.src,Z,X[0]),U,""),!0}function k9($,Z){let Q=new Map,z=(X)=>{let U=U0(X);return U?U.join(":"):void 0};return $.forEach((X,U)=>{let J=z(Z(X));if(J!==void 0&&!Q.has(J))Q.set(J,U)}),(X)=>{let U=z(Z(X)),J=U===void 0?void 0:Q.get(U);return J!==void 0&&w9(Z($[J]),Z(X))?J:-1}}function lB($,Z){return o($)&&o(Z)?E9($,Z):$===Z}function cB($,Z,Q){let z=Z.items[0]?.key,X=U0(z);if(!X)return!1;let U=y9($.src,X[0]),J=new Set,H=(W,q)=>{if(W.length===0)return!0;let K=new s2;K.items.push(...W);let L=q<0?-1:f5($,Z.items[q].value,Z.items[q].key);return g9($,z,L,K,U,!1)},V=k9(Z.items,(W)=>W.key),Y=-1,G=[];for(let W of Q.items){let q=V(W);if(q<0){G.push(W);continue}if(q<=Y||!H(G,Y)||!lB(Z.items[q].key,W.key))return!1;if(G=[],!u5($,Z.items[q].value,W.value,{kind:"value",key:Z.items[q].key,col:U}))return!1;J.add(q),Y=q}if(!H(G,Y))return!1;return Z.items.every((W,q)=>J.has(q)||dB($,Z,q))}function dB($,Z,Q){let z=Z.items[Q],X=U0(z.key);if(!X)return!1;if(m5($.src,X[0],!1))return v9($,z.key,z.value,!1);let U=Z.items[Q+1],J=U0(U?.key);if(Q!==0||!J||v5(z.key)||v5(U.key))return!1;return M2($,X[0],J[0],""),!0}function iB($,Z,Q){let z=U0(Z);if(!z||Z.items.length===0)return!1;let X=y9($.src,z[0]),U=new Set,J=(G,W)=>{if(G.length===0)return!0;let q=new n$;q.items.push(...G);let K=W<0?-1:f5($,Z.items[W]);return g9($,Z.items[0],K,q,X,!0)},H=k9(Z.items,(G)=>G),V=-1,Y=[];for(let G of Q.items){let W=H(G);if(W<0){Y.push(G);continue}if(W<=V||!J(Y,V))return!1;if(Y=[],!u5($,Z.items[W],G,{kind:"item",col:X}))return!1;U.add(W),V=W}if(!J(Y,V))return!1;return Z.items.every((G,W)=>U.has(W)||v9($,G,G,!0))}function nB($,Z){let Q=[...Z].sort((U,J)=>J.start-U.start||J.end-U.end||J.seq-U.seq),z=$,X=1/0;for(let U of Q){if(U.end>X)return null;z=z.slice(0,U.start)+U.text+z.slice(U.end),X=U.start}return z}function rB($,Z,Q){if(!c(Q)&&!m0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
+ `)?$.eol:"",X=Z.commentBefore?$.eol:"";return M2($,$.src.length,$.src.length,z+X+x9($,Q,0)),!0}function sB($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!O0(z))return!O0(X)||rB($,Z,X);return O0(X)&&u5($,z,X,{kind:"root"})}function oB($,Z,Q,z,X){let U={src:$,eol:z,edits:[],piece:X};if(!sB(U,Z,Q))return null;return nB($,U.edits)}var T9=($)=>$.replace(/^[ \t]*\n/gm,"");function aB($,Z,Q,z){let X=o2($,M8);if(X.errors.length>0||!d(X.toJS(),Z.toJS()))return!1;let U=X.toString(z);return U===Q||T9(U)===T9(Q)}function O8($,Z,Q="YAML"){let{text:z,changed:X}=tB($,Z,Q);return{text:z,changed:X}}function tB($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),U=h5(X,Q),J=eB(U);Z(J);let H={text:$,changed:!1,spliced:!1};if(d(J.toJS(),U.toJS()))return H;let V={lineWidth:0,...jB(X)},Y=J.toString(V);if(Y===U.toString(V))return H;let G=X.includes(`\r
155
155
  `)?`\r
156
156
  `:`
157
- `,W=oB(X,U,J,G,{...V,verifyAliasOrder:!1}),q=W!==null&&aB(W,J,Y,V),K=q&&W!==null?W:Y.replace(/\r?\n/g,G);return{text:z+K,changed:z+K!==$,spliced:q}}function eB($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function d($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>d(Q,Z[z]));if(h($)&&h(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&d($[z],Z[z]))}return!1}function t$($){let Z=o($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function $2($,Z){return $.items.find((Q)=>t$(Q)===Z)}function k9($,Z){return M0(Z)?Z.toJS($):Z}function $K($,Z,Q,z){return z.keepAliases===!0&&h0(Z)||d(k9($,Z),Q)}function _8($,Z,Q,z={}){if($K($,Z,Q,z))return Z;if(h(Q)&&c(Z))return QK($,Z,Q,z),Z;if(Array.isArray(Q)&&u0(Z))return UK($,Z,Q,z),Z;if(!h(Q)&&!Array.isArray(Q)&&o(Z))return Z.value=Q,Z;return ZK(Z,$.createNode(Q))}function ZK($,Z){if(!o($)&&!h0($))return Z;let Q=$,z=Z;if(K2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=y5(z.commentBefore,Q.commentBefore,Q.comment),Z;if(K2(Z))Z.flow=!0;return z.comment=y5(z.comment??Q.comment),z.commentBefore=y5(z.commentBefore??Q.commentBefore),Z}function y5(...$){let Z=$.filter(O0);return Z.length>0?Z.join(`
158
- `):void 0}function QK($,Z,Q,z={}){for(let[X,U]of Object.entries(Q)){if(U===void 0)continue;let J=$2(Z,X);if(J)J.value=_8($,J.value,U,z);else Z.items.push($.createPair(X,U))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let U=t$(X);return U===void 0||Q[U]!==void 0})}function f5($,Z,Q,z){let X=h(Q)?Q:{};for(let[U,J]of Object.entries(z)){if(J===void 0)continue;let H=$2(Z,U);if(!H)Z.items.push($.createPair(U,J));else if(Object.prototype.hasOwnProperty.call(X,U)&&d(X[U],J))continue;else if(h(J)&&h(X[U])&&c(H.value))f5($,H.value,X[U],J);else H.value=_8($,H.value,J,{keepAliases:!0})}}function a$($,Z,Q){if(h0($))Q.push({path:[...Z],node:$});else if(c($))for(let z of $.items){let X=t$(z);if(X!==void 0)a$(z.value,[...Z,X],Q)}else if(u0($))$.items.forEach((z,X)=>a$(z,[...Z,X],Q))}function T9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(h(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function h9($,Z,Q){let z=[];return a$($.contents,[],z),z.filter(({path:X,node:U})=>{let J=T9(Z,X);return J!==void 0&&!d(T9(Q,X),J)&&!d(U.toJS($),J)}).map(({path:X,node:U})=>({path:X.join("."),alias:`*${U.source}`}))}function u9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=zK(Q,Z[X]);let z=Z[Z.length-1];if(c(Q)&&typeof z==="string"){let X=$2(Q,z);return X?{node:X.value,put:(U)=>(X.value=U,!0)}:null}if(u0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,U=X.items[z];return{node:U,put:(J)=>U0(U)===void 0?(X.items[z]=J,!0):!1}}return null}function zK($,Z){if(c($)&&typeof Z==="string")return $2($,Z)?.value;if(u0($)&&typeof Z==="number")return $.items[Z];return}function m9($,Z){let Q=[];a$($.contents,[],Q);let z=[];for(let{path:X,node:U}of Q){let J=u9(Z,X);if(!J||h0(J.node)&&J.node.source===U.source)continue;if(!J.put(U.clone()))continue;z.push({path:X.join("."),alias:`*${U.source}`})}return z}function v5($,Z,Q,z){if(!M0($)||h0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(c($))for(let U of $.items){let J=t$(U);if(J!==void 0)v5(U.value,[...Z,J],Q,z)}else if(u0($))$.items.forEach((U,J)=>v5(U,[...Z,J],Q,z))}function f9($,Z){let Q=[];a$($.contents,[],Q);let z=new Set(Q.map((J)=>J.node.source));if(z.size===0)return[];let X=[];v5($.contents,[],z,X);let U=[];for(let{path:J,node:H}of X){let V=u9(Z,J);if(!V)continue;let Y=H.anchor;if(M0(V.node)&&V.node.anchor===Y&&d(H.toJS($),V.node.toJS(Z))||!V.put(H.clone()))continue;U.push({path:J.join("."),alias:`&${Y}`,kind:"anchor"})}return U}function XK($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let J=Q-1;J>=0;J--)for(let H=z-1;H>=0;H--)X[J][H]=d($[J],Z[H])?X[J+1][H+1]+1:Math.max(X[J+1][H],X[J][H+1]);let U=[];for(let J=0,H=0;J<Q&&H<z;)if(d($[J],Z[H]))U.push([J,H]),J++,H++;else if(X[J+1][H]>=X[J][H+1])J++;else H++;return U}function UK($,Z,Q,z){let X=Z.items,U=X.map((Y)=>k9($,Y)),J=[],H=0,V=0;for(let[Y,G]of[...XK(U,Q),[X.length,Q.length]]){for(;H<Y&&V<G;H++,V++)J.push(_8($,X[H],Q[V],z));for(;V<G;V++)J.push($.createNode(Q[V]));if(Y<X.length)J.push(X[Y]);H=Y+1,V=G+1}Z.items=J}function e$($,Z,Q,z){if(d(Q,z))return Z;if(!h(Q)||!h(z)||!c(Z))return _8($,Z,z);let X=new Set(Object.keys(Q).filter((U)=>!(U in z)||z[U]===void 0));Z.items=Z.items.filter((U)=>{let J=t$(U);return J===void 0||!X.has(J)});for(let[U,J]of Object.entries(z)){if(J===void 0)continue;let H=$2(Z,U);if(!H)Z.items.push($.createPair(U,J));else if(!d(Q[U],J))H.value=e$($,H.value,Q[U],J)}return Z}function p9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new s2,z=$.contents;if(!c(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let U of Z){let J=$2(X,U);if(J&&c(J.value)){X=J.value;continue}if(J&&!d9(J.value))throw Error(`${Q}: ${U} is not a mapping — faf left it unchanged.`);let H=new s2;if(J)J.value=c9(J.value,H);else X.items.push($.createPair(U,H));X=H}return X}function F8($,Z,Q,z,X){if(d(Q,z))return;let U=p9($,Z.slice(0,-1),X),J=Z[Z.length-1],H=$2(U,J);if(z===void 0)U.items=U.items.filter((V)=>V!==H);else if(!H)U.items.push($.createPair(J,z));else H.value=e$($,H.value,Q,z)}function l9($,Z,Q){let z=p9($,Z.slice(0,-1),Q),X=Z[Z.length-1],U=$2(z,X);if(U&&u0(U.value))return U.value;if(U&&!d9(U.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let J=new i$;if(U)U.value=c9(U.value,J);else z.items.push($.createPair(X,J));return J}function c9($,Z){if(!o($))return Z;let Q=[$.commentBefore,$.comment].filter(O0);if(Q.length>0)Z.commentBefore=Q.join(`
159
- `);return Z}function d9($){if($===null||$===void 0)return!0;return o($)&&($.value===null||$.value===void 0)}var p5=new WeakMap;function $6($){return typeof $==="object"&&$!==null?p5.get($):void 0}function P8($,Z){p5.set($,Z)}function i9($,Z){let Q=$6($);if(Q)p5.set(Z,Q);return Z}var n9=new WeakSet;function r9($){return n9.add($),$}function s9($){return typeof $==="object"&&$!==null&&n9.has($)}function R8($){let Z=Z6($);return m(c5(Z),Z,{read:!0})}function l5($){return $ instanceof ReferenceError&&/Excessive alias count/.test($.message)}function $Q($){if($ instanceof K8||l5($))return $;let Z=$?.cause;return Z instanceof K8||l5(Z)?Z:null}function ZQ($,Z){let Q=l5(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=Z6($);return new S("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function JK($){let Z=R8($),Q=Q0(Z),z;try{z=m0(Q)}catch(U){let J=$Q(U);if(J)throw ZQ($,J);throw U}let X=L8(z,$);return P8(X,{real:Z,text:Q}),X}function QQ($){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,(U,J,H)=>{if(H.includes("#"))return U;return`${J} # found: ${X}`})}return z}function HK($,Z){return zQ($,Z,void 0)}function zQ($,Z,Q,z,X=!1){let U=R8($),J=Q0(U),H=[],V;try{V=O8(J,(Y)=>{XQ(Y,$);let G=Y.clone();if(Z(Y),H=m9(G,Y),X)H=[...H,...f9(G,Y)];if(z)H=[...H,...z(Y,G.toJS()).filter((W)=>!H.some((q)=>q.path===W.path))]},$)}catch(Y){let G=$Q(Y);if(G)throw ZQ($,G);throw Y}if(!V.changed)return{written:!1,text:J,keptAliases:H};return $0($,V.text,{expect:Q&&Q.real===U?Q.text:J}),{written:!0,text:V.text,keptAliases:H}}function a9($){try{return e9($),!0}catch{return!1}}function VK($){let Z=$.getIn(["project","type"],!0);return o(Z)?Z.value:Z}function XQ($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!c(Q))throw new S("not-yaml",Z6(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${Q$($.toJS())}. faf left it unchanged — fix it by hand.`)}function YK($,Z,Q){XQ($,Q);let z=$.contents,X=c(z)&&z.items.some((G)=>o(G.key)&&G.key.value==="_meta"),{_meta:U,...J}=Z,H=VK($),V=c(z)?$.toJS():{},Y=c(z)?z:$.createNode({});if($.contents=Y,f5($,Y,V,X?{...Z}:J),!X)WK($,U?.found,H)}function GK($,Z){let Q=$.contents;if(c(Q)&&Q.items.some((U)=>o(U.key)&&U.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function WK($,Z,Q){if(!Z||Z.length===0||!l(Q))return;let z=$.getIn(["project","type"],!0);if(o(z)&&!l(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function qK($,Z,Q={}){if(!Q.replace&&a9($)){let H=zQ($,(V)=>YK(V,Z,$),$6(Z),(V,Y)=>h9(V,GK(V,Z),Y),s9(Z));P8(Z,{real:R8($),text:H.text});for(let V of H.keptAliases??[])Q.onAliasKept?.(V);return H.written}let z=Z6($),X=QQ(Z),U=a9($)?f0(m(c5(z),z)):null,J=$0($,X,{expect:U});return P8(Z,{real:J,text:X}),!0}function UQ($){return Q0(R8($))}function t9($,Z){let Q;try{Q=e9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return m($,Z6(Z),{read:!0}),!0}function JQ($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=o9($,z);if(t9($,X))return X}let Q=c5($);if(Q!==$)for(let z of Z){let X=o9(Q,z);if(t9(Q,X))return X}return null}import{statSync as HQ}from"fs";import{homedir as BK}from"os";import{parse as KK,resolve as VQ}from"path";function YQ($,Z){try{let Q=HQ($,{bigint:!0}),z=HQ(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function DK($){let Z=VQ($),Q=VQ(BK()),z=KK(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(YQ(Z,Q))return"home";if(YQ(Z,z))return"root";return null}function LK($=process.cwd()){return DK($)!==null}import{existsSync as MK,statSync as GQ}from"fs";import{dirname as IK,join as OK}from"path";var _K=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],FK=1000;function PK($,Z=IK($)){let Q=GQ($).mtimeMs,z=_K.map((X)=>{let U=OK(Z,X);if(!MK(U))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let J=GQ(U).mtimeMs,H=J-Q,V;if(Math.abs(H)<FK)V="in-sync";else if(H>0)V="newer";else V="older";return{file:X,exists:!0,mtime_ms:J,status:V,delta_ms:H}});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 pK}from"path";import{deprecate as lK}from"node:util";import{createHash as jK}from"crypto";import{resolve as wK}from"path";class I2 extends Error{constructor($){super($);this.name="JsonEditError"}}var RK=new Set([" ","\t",`
161
- `,"\r"]);class n5{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 I2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&RK.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 d5=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function i5($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>i5(Q,Z[z]));if(d5($)&&d5(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&i5($[z],Z[z]))}return!1}class WQ{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
157
+ `,W=oB(X,U,J,G,{...V,verifyAliasOrder:!1}),q=W!==null&&aB(W,J,Y,V),K=q&&W!==null?W:Y.replace(/\r?\n/g,G);return{text:z+K,changed:z+K!==$,spliced:q}}function eB($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function d($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>d(Q,Z[z]));if(h($)&&h(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&d($[z],Z[z]))}return!1}function e$($){let Z=o($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function $2($,Z){return $.items.find((Q)=>e$(Q)===Z)}function h9($,Z){return M0(Z)?Z.toJS($):Z}function $K($,Z,Q,z){return z.keepAliases===!0&&u0(Z)||d(h9($,Z),Q)}function _8($,Z,Q,z={}){if($K($,Z,Q,z))return Z;if(h(Q)&&c(Z))return QK($,Z,Q,z),Z;if(Array.isArray(Q)&&m0(Z))return UK($,Z,Q,z),Z;if(!h(Q)&&!Array.isArray(Q)&&o(Z))return Z.value=Q,Z;return ZK(Z,$.createNode(Q))}function ZK($,Z){if(!o($)&&!u0($))return Z;let Q=$,z=Z;if(K2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=x5(z.commentBefore,Q.commentBefore,Q.comment),Z;if(K2(Z))Z.flow=!0;return z.comment=x5(z.comment??Q.comment),z.commentBefore=x5(z.commentBefore??Q.commentBefore),Z}function x5(...$){let Z=$.filter(O0);return Z.length>0?Z.join(`
158
+ `):void 0}function QK($,Z,Q,z={}){for(let[X,U]of Object.entries(Q)){if(U===void 0)continue;let J=$2(Z,X);if(J)J.value=_8($,J.value,U,z);else Z.items.push($.createPair(X,U))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let U=e$(X);return U===void 0||Q[U]!==void 0})}function p5($,Z,Q,z){let X=h(Q)?Q:{};for(let[U,J]of Object.entries(z)){if(J===void 0)continue;let H=$2(Z,U);if(!H)Z.items.push($.createPair(U,J));else if(Object.prototype.hasOwnProperty.call(X,U)&&d(X[U],J))continue;else if(h(J)&&h(X[U])&&c(H.value))p5($,H.value,X[U],J);else H.value=_8($,H.value,J,{keepAliases:!0})}}function t$($,Z,Q){if(u0($))Q.push({path:[...Z],node:$});else if(c($))for(let z of $.items){let X=e$(z);if(X!==void 0)t$(z.value,[...Z,X],Q)}else if(m0($))$.items.forEach((z,X)=>t$(z,[...Z,X],Q))}function A9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(h(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function u9($,Z,Q){let z=[];return t$($.contents,[],z),z.filter(({path:X,node:U})=>{let J=A9(Z,X);return J!==void 0&&!d(A9(Q,X),J)&&!d(U.toJS($),J)}).map(({path:X,node:U})=>({path:X.join("."),alias:`*${U.source}`}))}function m9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=zK(Q,Z[X]);let z=Z[Z.length-1];if(c(Q)&&typeof z==="string"){let X=$2(Q,z);return X?{node:X.value,put:(U)=>(X.value=U,!0)}:null}if(m0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,U=X.items[z];return{node:U,put:(J)=>U0(U)===void 0?(X.items[z]=J,!0):!1}}return null}function zK($,Z){if(c($)&&typeof Z==="string")return $2($,Z)?.value;if(m0($)&&typeof Z==="number")return $.items[Z];return}function f9($,Z){let Q=[];t$($.contents,[],Q);let z=[];for(let{path:X,node:U}of Q){let J=m9(Z,X);if(!J||u0(J.node)&&J.node.source===U.source)continue;if(!J.put(U.clone()))continue;z.push({path:X.join("."),alias:`*${U.source}`})}return z}function k5($,Z,Q,z){if(!M0($)||u0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(c($))for(let U of $.items){let J=e$(U);if(J!==void 0)k5(U.value,[...Z,J],Q,z)}else if(m0($))$.items.forEach((U,J)=>k5(U,[...Z,J],Q,z))}function p9($,Z){let Q=[];t$($.contents,[],Q);let z=new Set(Q.map((J)=>J.node.source));if(z.size===0)return[];let X=[];k5($.contents,[],z,X);let U=[];for(let{path:J,node:H}of X){let V=m9(Z,J);if(!V)continue;let Y=H.anchor;if(M0(V.node)&&V.node.anchor===Y&&d(H.toJS($),V.node.toJS(Z))||!V.put(H.clone()))continue;U.push({path:J.join("."),alias:`&${Y}`,kind:"anchor"})}return U}function XK($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let J=Q-1;J>=0;J--)for(let H=z-1;H>=0;H--)X[J][H]=d($[J],Z[H])?X[J+1][H+1]+1:Math.max(X[J+1][H],X[J][H+1]);let U=[];for(let J=0,H=0;J<Q&&H<z;)if(d($[J],Z[H]))U.push([J,H]),J++,H++;else if(X[J+1][H]>=X[J][H+1])J++;else H++;return U}function UK($,Z,Q,z){let X=Z.items,U=X.map((Y)=>h9($,Y)),J=[],H=0,V=0;for(let[Y,G]of[...XK(U,Q),[X.length,Q.length]]){for(;H<Y&&V<G;H++,V++)J.push(_8($,X[H],Q[V],z));for(;V<G;V++)J.push($.createNode(Q[V]));if(Y<X.length)J.push(X[Y]);H=Y+1,V=G+1}Z.items=J}function $6($,Z,Q,z){if(d(Q,z))return Z;if(!h(Q)||!h(z)||!c(Z))return _8($,Z,z);let X=new Set(Object.keys(Q).filter((U)=>!(U in z)||z[U]===void 0));Z.items=Z.items.filter((U)=>{let J=e$(U);return J===void 0||!X.has(J)});for(let[U,J]of Object.entries(z)){if(J===void 0)continue;let H=$2(Z,U);if(!H)Z.items.push($.createPair(U,J));else if(!d(Q[U],J))H.value=$6($,H.value,Q[U],J)}return Z}function l9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new s2,z=$.contents;if(!c(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let U of Z){let J=$2(X,U);if(J&&c(J.value)){X=J.value;continue}if(J&&!i9(J.value))throw Error(`${Q}: ${U} is not a mapping — faf left it unchanged.`);let H=new s2;if(J)J.value=d9(J.value,H);else X.items.push($.createPair(U,H));X=H}return X}function F8($,Z,Q,z,X){if(d(Q,z))return;let U=l9($,Z.slice(0,-1),X),J=Z[Z.length-1],H=$2(U,J);if(z===void 0)U.items=U.items.filter((V)=>V!==H);else if(!H)U.items.push($.createPair(J,z));else H.value=$6($,H.value,Q,z)}function c9($,Z,Q){let z=l9($,Z.slice(0,-1),Q),X=Z[Z.length-1],U=$2(z,X);if(U&&m0(U.value))return U.value;if(U&&!i9(U.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let J=new n$;if(U)U.value=d9(U.value,J);else z.items.push($.createPair(X,J));return J}function d9($,Z){if(!o($))return Z;let Q=[$.commentBefore,$.comment].filter(O0);if(Q.length>0)Z.commentBefore=Q.join(`
159
+ `);return Z}function i9($){if($===null||$===void 0)return!0;return o($)&&($.value===null||$.value===void 0)}var l5=new WeakMap;function Z6($){return typeof $==="object"&&$!==null?l5.get($):void 0}function P8($,Z){l5.set($,Z)}function n9($,Z){let Q=Z6($);if(Q)l5.set(Z,Q);return Z}var r9=new WeakSet;function s9($){return r9.add($),$}function o9($){return typeof $==="object"&&$!==null&&r9.has($)}function N8($){let Z=z$($);return u(R8(Z),Z,{read:!0})}function c5($){return $ instanceof ReferenceError&&/Excessive alias count/.test($.message)}function $Q($){if($ instanceof K8||c5($))return $;let Z=$?.cause;return Z instanceof K8||c5(Z)?Z:null}function ZQ($,Z){let Q=c5(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=z$($);return new S("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function JK($){let Z=N8($),Q=Q0(Z),z;try{z=f0(Q)}catch(U){let J=$Q(U);if(J)throw ZQ($,J);throw U}let X=L8(z,$);return P8(X,{real:Z,text:Q}),X}function QQ($){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,(U,J,H)=>{if(H.includes("#"))return U;return`${J} # found: ${X}`})}return z}function HK($,Z){return zQ($,Z,void 0)}function zQ($,Z,Q,z,X=!1){let U=N8($),J=Q0(U),H=[],V;try{V=O8(J,(Y)=>{XQ(Y,$);let G=Y.clone();if(Z(Y),H=f9(G,Y),X)H=[...H,...p9(G,Y)];if(z)H=[...H,...z(Y,G.toJS()).filter((W)=>!H.some((q)=>q.path===W.path))]},$)}catch(Y){let G=$Q(Y);if(G)throw ZQ($,G);throw Y}if(!V.changed)return{written:!1,text:J,keptAliases:H};return $0($,V.text,{expect:Q&&Q.real===U?Q.text:J}),{written:!0,text:V.text,keptAliases:H}}function VK(){return new Date().toISOString().replace(/[:.]/g,"-")}function YK($){if(!d5($))return null;let Z=z$($),Q=w0(u(R8(Z),Z));if(!Q)return null;let z=`${Z}.bak-${VK()}`;return $0(z,Q),z}function d5($){try{return e9($),!0}catch{return!1}}function GK($){let Z=$.getIn(["project","type"],!0);return o(Z)?Z.value:Z}function XQ($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!c(Q))throw new S("not-yaml",z$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${Q$($.toJS())}. faf left it unchanged — fix it by hand.`)}function WK($,Z,Q){XQ($,Q);let z=$.contents,X=c(z)&&z.items.some((G)=>o(G.key)&&G.key.value==="_meta"),{_meta:U,...J}=Z,H=GK($),V=c(z)?$.toJS():{},Y=c(z)?z:$.createNode({});if($.contents=Y,p5($,Y,V,X?{...Z}:J),!X)BK($,U?.found,H)}function qK($,Z){let Q=$.contents;if(c(Q)&&Q.items.some((U)=>o(U.key)&&U.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function BK($,Z,Q){if(!Z||Z.length===0||!l(Q))return;let z=$.getIn(["project","type"],!0);if(o(z)&&!l(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function KK($,Z,Q={}){if(!Q.replace&&d5($)){let V=zQ($,(Y)=>WK(Y,Z,$),Z6(Z),(Y,G)=>u9(Y,qK(Y,Z),G),o9(Z));P8(Z,{real:N8($),text:V.text});for(let Y of V.keptAliases??[])Q.onAliasKept?.(Y);return V.written}let z=z$($),X=YK($);if(X)Q.onReplacedBackup?.(X);let U=QQ(Z),J=X&&d5($)?w0(u(R8(z),z)):null,H=$0($,U,{expect:J});return P8(Z,{real:H,text:U}),!0}function UQ($){return Q0(N8($))}function t9($,Z){let Q;try{Q=e9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return u($,z$(Z),{read:!0}),!0}function JQ($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=a9($,z);if(t9($,X))return X}let Q=R8($);if(Q!==$)for(let z of Z){let X=a9(Q,z);if(t9(Q,X))return X}return null}import{statSync as HQ}from"fs";import{homedir as DK}from"os";import{parse as LK,resolve as VQ}from"path";function YQ($,Z){try{let Q=HQ($,{bigint:!0}),z=HQ(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function MK($){let Z=VQ($),Q=VQ(DK()),z=LK(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(YQ(Z,Q))return"home";if(YQ(Z,z))return"root";return null}function IK($=process.cwd()){return MK($)!==null}import{existsSync as OK,statSync as GQ}from"fs";import{dirname as _K,join as FK}from"path";var PK=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],RK=1000;function NK($,Z=_K($)){let Q=GQ($).mtimeMs,z=PK.map((X)=>{let U=FK(Z,X);if(!OK(U))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let J=GQ(U).mtimeMs,H=J-Q,V;if(Math.abs(H)<RK)V="in-sync";else if(H>0)V="newer";else V="older";return{file:X,exists:!0,mtime_ms:J,status:V,delta_ms:H}});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 cK}from"path";import{deprecate as dK}from"node:util";import{createHash as SK}from"crypto";import{resolve as EK}from"path";class I2 extends Error{constructor($){super($);this.name="JsonEditError"}}var TK=new Set([" ","\t",`
161
+ `,"\r"]);class r5{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 I2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&TK.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 i5=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function n5($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>n5(Q,Z[z]));if(i5($)&&i5(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&n5($[z],Z[z]))}return!1}class WQ{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
162
162
  `,$-1);return Z>=0&&/^[ \t]*$/.test(this.s.slice(Z+1,$))}indentOf($){return this.startsLine($)?this.s.slice(this.s.lastIndexOf(`
163
163
  `,$-1)+1,$):""}render($,Z,Q){if(!Q)return JSON.stringify($);return JSON.stringify($,null,this.style.unit).split(`
164
- `).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[U,J]of Object.entries(Z)){if(J===void 0)continue;let H=Q?`${Q}.${U}`:U,V=$.members.filter((q)=>q.key===U);if(V.length>1)throw new I2(`the key "${H}" is there more than once`);let Y=V[0];if(!Y){if($.members.length===0)X[U]=J;else this.insert($,U,J,Q);continue}let G=this.startsLine(Y.keyStart);if(d5(J)){if(Y.value.kind!=="object")throw new I2(`"${H}" is not an object, so faf cannot add its keys to it`);this.apply(Y.value,J,H,G||this.s.slice(Y.value.start,Y.value.end).includes(`
165
- `));continue}let W=JSON.parse(this.s.slice(Y.value.start,Y.value.end));if(i5(W,J))continue;if(Y.value.kind==="object"||Y.value.kind==="array")throw new I2(`"${H}" is ${Y.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:Y.value.start,end:Y.value.end,text:this.render(J,this.indentOf(Y.keyStart),G)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,U=X[X.length-1],H=(this.after[z]?.[Z]??[]).map((W)=>X.find((q)=>q.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=H&&H!==U?X[X.indexOf(H)+1]:U,q=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[U,J]of Object.entries(Z)){if(J===void 0)continue;let H=Q?`${Q}.${U}`:U,V=$.members.filter((q)=>q.key===U);if(V.length>1)throw new I2(`the key "${H}" is there more than once`);let Y=V[0];if(!Y){if($.members.length===0)X[U]=J;else this.insert($,U,J,Q);continue}let G=this.startsLine(Y.keyStart);if(i5(J)){if(Y.value.kind!=="object")throw new I2(`"${H}" is not an object, so faf cannot add its keys to it`);this.apply(Y.value,J,H,G||this.s.slice(Y.value.start,Y.value.end).includes(`
165
+ `));continue}let W=JSON.parse(this.s.slice(Y.value.start,Y.value.end));if(n5(W,J))continue;if(Y.value.kind==="object"||Y.value.kind==="array")throw new I2(`"${H}" is ${Y.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:Y.value.start,end:Y.value.end,text:this.render(J,this.indentOf(Y.keyStart),G)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,U=X[X.length-1],H=(this.after[z]?.[Z]??[]).map((W)=>X.find((q)=>q.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=H&&H!==U?X[X.indexOf(H)+1]:U,q=this.indentOf(W.keyStart),K=this.s.slice(W.keyEnd,W.value.start),L=this.s.lastIndexOf(`
166
166
  `,W.keyStart-1),B=L>0&&this.s[L-1]==="\r"?L-1:L,D=`${this.style.eol}${q}${JSON.stringify(Z)}${K}${this.render(Q,q,!0)},`;this.edits.push({start:B,end:B,text:D});return}let V=H??U,Y=this.s.slice(V.keyEnd,V.value.start),G=X.length>1?this.s.slice(X[0].value.end,X[1].keyStart):", ";this.edits.push({start:V.value.end,end:V.value.end,text:`${G}${JSON.stringify(Z)}${Y}${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 J=this.indentOf($.items[0].start),H=Z.map((V)=>`,${this.style.eol}${J}${this.render(V,J,!0)}`).join("");this.edits.push({start:X.end,end:X.end,text:H});return}let U=$.items.length>1?this.s.slice($.items[0].end,$.items[1].start):", ";this.edits.push({start:X.end,end:X.end,text:Z.map((J)=>`${U}${this.render(J,"",!1)}`).join("")})}lineLead($){let Z=this.s.lastIndexOf(`
167
- `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function NK($,Z){let Q=$.includes(`\r
167
+ `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function AK($,Z){let Q=$.includes(`\r
168
168
  `)?`\r
169
169
  `:`
170
170
  `,z=Z.members[0],X=z?$.lastIndexOf(`
171
- `,z.keyStart-1):-1,U=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(U)?U:" "}}function Q6($,Z,Q={}){let z=new n5($).parse();if(z.kind!=="object")throw new I2("the JSON is not an object");let X=new WQ($,NK($,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,U)=>({e:X,i:U})).sort((X,U)=>U.e.start-X.e.start||U.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function TK($){let Z=new n5($).parse();if(Z.kind!=="object")throw new I2("the JSON is not an object");return Z}function AK($,Z){let Q=$.lastIndexOf(`
173
- `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function CK($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(AK($,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 BQ($,Z){let Q=[],z=TK($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let U=z.members.filter((J)=>J.key===X);if(U.length!==1)return{count:U.length,chain:Q};Q.push({obj:z,member:U[0]}),z=U[0].value}return{count:1,chain:Q}}function KQ($,Z){let{count:Q,chain:z}=BQ($,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 r5($,Z,Q={}){let{count:z,chain:X}=BQ($,Z);if(z!==1||X.length===0)return null;let U=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&U.obj.members.length===1)U=X[X.length-2];return qQ($,[CK($,U.obj,U.member)]).text}var LQ="one.faf/render";function o5($){return`sha256:${jK("sha256").update($,"utf8").digest("hex")}`}var SK=/^sha256:[0-9a-f]{64}$/,EK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,bK='<meta name="faf-render"',yK='<meta name="description" content="Visual render of project.faf.';function xK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(yK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${o5($)}">
175
- `),Z.join("")}function MQ($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,U)=>{let J=X.replace(/\r?\n$/,""),H=EK.exec(J);if(H)Q.push({at:U,hash:H[1]});else if(J.startsWith(bK))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 s5=["_meta",LQ];function gK($){return Q6($,{_meta:{[LQ]:o5($)}}).text}function vK($){try{return r5($,s5,{dropEmptyParent:!0})??$}catch{return $}}function kK($){let Z;try{Z=KQ($,s5)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!SK.test(Z.value))return"many";let Q=r5($,s5,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function IQ($,Z){return $==="html"?xK(Z):gK(Z)}function hK($,Z){if($==="json")return vK(Z);let Q=MQ(Z);return Q===null||Q==="many"?Z:Q.canonical}function DQ($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?MQ(Q):kK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===o5(z.canonical)&&IQ(Z,z.canonical)===Q?"match":"mismatch"}function uK($){let Z=new TextDecoder().decode($);if(!Z.includes(`\r
171
+ `,z.keyStart-1):-1,U=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(U)?U:" "}}function Q6($,Z,Q={}){let z=new r5($).parse();if(z.kind!=="object")throw new I2("the JSON is not an object");let X=new WQ($,AK($,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,U)=>({e:X,i:U})).sort((X,U)=>U.e.start-X.e.start||U.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function CK($){let Z=new r5($).parse();if(Z.kind!=="object")throw new I2("the JSON is not an object");return Z}function jK($,Z){let Q=$.lastIndexOf(`
173
+ `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function wK($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(jK($,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 BQ($,Z){let Q=[],z=CK($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let U=z.members.filter((J)=>J.key===X);if(U.length!==1)return{count:U.length,chain:Q};Q.push({obj:z,member:U[0]}),z=U[0].value}return{count:1,chain:Q}}function KQ($,Z){let{count:Q,chain:z}=BQ($,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 s5($,Z,Q={}){let{count:z,chain:X}=BQ($,Z);if(z!==1||X.length===0)return null;let U=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&U.obj.members.length===1)U=X[X.length-2];return qQ($,[wK($,U.obj,U.member)]).text}var LQ="one.faf/render";function a5($){return`sha256:${SK("sha256").update($,"utf8").digest("hex")}`}var bK=/^sha256:[0-9a-f]{64}$/,yK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,xK='<meta name="faf-render"',gK='<meta name="description" content="Visual render of project.faf.';function vK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(gK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${a5($)}">
175
+ `),Z.join("")}function MQ($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,U)=>{let J=X.replace(/\r?\n$/,""),H=yK.exec(J);if(H)Q.push({at:U,hash:H[1]});else if(J.startsWith(xK))z=!0}),Q.length===0&&!z)return null;if(Q.length!==1||z)return"many";return Z.splice(Q[0].at,1),{hash:Q[0].hash,canonical:Z.join("")}}var o5=["_meta",LQ];function kK($){return Q6($,{_meta:{[LQ]:a5($)}}).text}function hK($){try{return s5($,o5,{dropEmptyParent:!0})??$}catch{return $}}function uK($){let Z;try{Z=KQ($,o5)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!bK.test(Z.value))return"many";let Q=s5($,o5,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function IQ($,Z){return $==="html"?vK(Z):kK(Z)}function mK($,Z){if($==="json")return hK(Z);let Q=MQ(Z);return Q===null||Q==="many"?Z:Q.canonical}function DQ($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?MQ(Q):uK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===a5(z.canonical)&&IQ(Z,z.canonical)===Q?"match":"mismatch"}function fK($){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 mK($,Z,Q){let z=DQ($,Q);return z!=="match"&&Z!==null&&DQ(Z,Q)==="match"?"match":z}function z6($,Z,Q){let z=wK($),X=m(Q.root,z),U=hK(Q.format,Z),J=IQ(Q.format,U),H=f0(X);if(H===null)return $0(X,J,{root:Q.root,expect:null}),{path:X,result:"created"};if(H.equals(Buffer.from(J,"utf-8")))return{path:X,result:"unchanged"};let V=uK(H),Y=V===null?J:J.replace(/\r?\n/g,`\r
178
- `);if(V!==null&&H.equals(Buffer.from(Y,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!fK(z,H,V,U,Q))return{path:X,result:"unchanged"};return $0(X,Y,{root:Q.root,expect:H}),{path:X,result:"updated"}}function fK($,Z,Q,z,X){let U=mK(Z,Q,X.format);if(U==="match")return!0;if(U==="mismatch")throw new S("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 S("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let J=Buffer.from(z,"utf-8");if(Z.equals(J)||Q!==null&&Q.equals(J))return!1;throw new S("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 OQ=_$.orange,cK=_$.cyan,dK=_$.cyanDeep,iK="#FF9500",nK="#FF3B30",rK="#E6EDF3",sK="#6E7681",_Q={TROPHY:{glyph:"✪",color:OQ},GOLD:{glyph:"★",color:OQ},SILVER:{glyph:"◆",color:cK},BRONZE:{glyph:"◇",color:dK},GREEN:{glyph:"●",color:rK},YELLOW:{glyph:"●",color:iK},RED:{glyph:"○",color:nK},WHITE:{glyph:"♡",color:sK}};function z$($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var FQ=["who","what","why","where","when","how"];function N8($){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 a5($,Z,Q="project.faf"){let z=z$($.project?.name??"Project"),X=Z.tier?.name??"WHITE",U=_Q[X]??_Q.WHITE,J=Z.inherited?Z.represents?`inherited from ${z$(Z.represents)}`:"inherited":`${Z.score}%`,H=X==="TROPHY"&&!Z.inherited,V=$.human_context??{},Y=FQ.map((B)=>[B,V[B]]),G=Object.entries(V).filter(([B])=>!FQ.includes(B)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],q=Object.entries($.stack??{}),K=q.filter(([,B])=>B&&B!=="slotignored"&&String(B).trim()!==""),L=q.filter(([,B])=>B==="slotignored").length;return`<!DOCTYPE html>
177
+ `),"utf-8")}function pK($,Z,Q){let z=DQ($,Q);return z!=="match"&&Z!==null&&DQ(Z,Q)==="match"?"match":z}function z6($,Z,Q){let z=EK($),X=u(Q.root,z),U=mK(Q.format,Z),J=IQ(Q.format,U),H=w0(X);if(H===null)return $0(X,J,{root:Q.root,expect:null}),{path:X,result:"created"};if(H.equals(Buffer.from(J,"utf-8")))return{path:X,result:"unchanged"};let V=fK(H),Y=V===null?J:J.replace(/\r?\n/g,`\r
178
+ `);if(V!==null&&H.equals(Buffer.from(Y,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!lK(z,H,V,U,Q))return{path:X,result:"unchanged"};return $0(X,Y,{root:Q.root,expect:H}),{path:X,result:"updated"}}function lK($,Z,Q,z,X){let U=pK(Z,Q,X.format);if(U==="match")return!0;if(U==="mismatch")throw new S("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 S("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let J=Buffer.from(z,"utf-8");if(Z.equals(J)||Q!==null&&Q.equals(J))return!1;throw new S("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 OQ=F$.orange,iK=F$.cyan,nK=F$.cyanDeep,rK="#FF9500",sK="#FF3B30",oK="#E6EDF3",aK="#6E7681",_Q={TROPHY:{glyph:"✪",color:OQ},GOLD:{glyph:"★",color:OQ},SILVER:{glyph:"◆",color:iK},BRONZE:{glyph:"◇",color:nK},GREEN:{glyph:"●",color:oK},YELLOW:{glyph:"●",color:rK},RED:{glyph:"○",color:sK},WHITE:{glyph:"♡",color:aK}};function X$($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var FQ=["who","what","why","where","when","how"];function T8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${X$(Z)}</div><div class="v">${X$(Q)}</div></div>`).join(`
179
+ `)}function t5($,Z,Q="project.faf"){let z=X$($.project?.name??"Project"),X=Z.tier?.name??"WHITE",U=_Q[X]??_Q.WHITE,J=Z.inherited?Z.represents?`inherited from ${X$(Z.represents)}`:"inherited":`${Z.score}%`,H=X==="TROPHY"&&!Z.inherited,V=$.human_context??{},Y=FQ.map((B)=>[B,V[B]]),G=Object.entries(V).filter(([B])=>!FQ.includes(B)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],q=Object.entries($.stack??{}),K=q.filter(([,B])=>B&&B!=="slotignored"&&String(B).trim()!==""),L=q.filter(([,B])=>B==="slotignored").length;return`<!DOCTYPE html>
180
180
  <html lang="en">
181
181
  <head>
182
182
  <meta charset="UTF-8">
@@ -217,7 +217,7 @@ footer strong{color:#e6edf3}
217
217
  <div class="eyebrow">project.faf · visual render</div>
218
218
  <header>
219
219
  <h1>${z}</h1>
220
- <span class="badge">${U.glyph} ${z$(X)}</span>
220
+ <span class="badge">${U.glyph} ${X$(X)}</span>
221
221
  <span class="score">${J}</span>
222
222
  </header>
223
223
  <div class="meter"><span></span></div>
@@ -225,61 +225,61 @@ ${H?'<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
- ${N8(Y)||'<p class="muted">No human_context yet.</p>'}
229
- ${G.length?N8(G):""}
228
+ ${T8(Y)||'<p class="muted">No human_context yet.</p>'}
229
+ ${G.length?T8(G):""}
230
230
  </section>
231
231
 
232
232
  <section>
233
233
  <h2>Project</h2>
234
- ${N8(W)||'<p class="muted">—</p>'}
234
+ ${T8(W)||'<p class="muted">—</p>'}
235
235
  </section>
236
236
 
237
237
  <section>
238
238
  <h2>Stack</h2>
239
- ${K.length?N8(K):'<p class="muted">No active stack slots.</p>'}
239
+ ${K.length?T8(K):'<p class="muted">No active stack slots.</p>'}
240
240
  </section>
241
241
 
242
242
  <footer>
243
- Rendered on-demand from your current <strong>${z$(Q)}</strong><br>
243
+ Rendered on-demand from your current <strong>${X$(Q)}</strong><br>
244
244
  <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
245
245
  </footer>
246
246
  </div>
247
247
  </body>
248
248
  </html>
249
- `}var oK='<meta name="description" content="Visual render of project.faf.';function aK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(oK)&&Z.includes(" by faf"))}function tK($,Z,Q,z="project.faf",X={}){z6(pK($,"project.html"),a5(Z,Q,z),{root:$,format:"html",hasMark:aK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var eK=lK(a5,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as FD}from"path";import{deprecate as PD}from"node:util";var X$="https://faf.one/ext/context/v1",t5="io.modelcontextprotocol.registry/publisher-provided";function w0($,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 O2($,Z={}){let Q={"one.faf/context":w0($,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 PQ="JSONRPC",ZZ="1.0",A8=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],C8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",RQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",NQ="1.0",TQ="1.0",e5={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function AQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function _2($,Z={}){let Q=AQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:ZZ}];return[]}function $D($){try{return`https://${U$($)}/.well-known/fafa`}catch{return}}function QZ($,Z,Q={}){let z=w0(Z,Q),X=$.agent??{},U={fafaSpecVersion:String($.version??TQ),mediaTypes:[...A8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)U.agentId=X.id;let J=$D($);if(J)U.passport=J;return{uri:X$,description:"FAF passport and project DNA as typed parts",required:!1,params:U}}function ZD($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&A8.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function j8($,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(),U=String(Q.description??"").trim(),J=String(Q.version??"").trim();if(!X||!U||!J)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let H=String(Q.vendor??"").trim(),V=String(Q.homepage??"").trim(),Y=H&&V?{organization:H,url:V}:void 0,G=($.capabilities??[]).map((W)=>{let q=String(W.name??"").trim();if(!q)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&A8.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:q,name:q,description:String(W.description??"").trim()||q,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:U,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:PQ,protocolVersion:String(W.version??ZZ)})),...Y?{provider:Y}:{},version:J,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:ZD($),defaultOutputModes:["text/plain","application/json"],skills:G}}var QD=["mcp","cli","library"],zD=/^[a-z0-9][a-z0-9._-]*$/,XD=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,UD=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,JD=/^[A-Za-z0-9][^\s]*$/,HD=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,VD=["a2a","mcp"],YD=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function R($){return String($??"").trim()}function T8($){return Array.isArray($)?$.map(R).filter(Boolean):[]}function GD($){return R($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function WD($,Z,Q){let z=["display_name","description","version"].filter((X)=>!R($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!zD.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!YD.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function qD($,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 BD($){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"&&!XD.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!UD.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z==="cargo"&&!HD.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"&&!JD.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 CQ($){if(/\s/.test($))return!1;try{let Z=new URL($);return(Z.protocol==="http:"||Z.protocol==="https:")&&Z.hostname!==""}catch{return!1}}function KD($){if(!CQ(R($.url)))throw Error(`Where it runs: "${R($.url)}" is not an http(s) URL (or give an npm package).`);if(!VD.includes(R($.protocol).toLowerCase()))throw Error(`Protocol "${R($.protocol)}": a2a or mcp.`)}function DD($){let Z=R($.package_kind).toLowerCase()||"mcp";if(!QD.includes(Z))throw Error(`Kind "${R($.package_kind)}" is not one faf knows: mcp, cli or library.`);return Z}function LD($,Z){let Q=($.endpoints??[]).filter((U)=>R(U.url));Q.forEach(KD);let z=DD($),X=[...Q.map((U)=>({protocol:R(U.protocol).toLowerCase(),transport:"http",location:R(U.url)})),...Z.map((U)=>({protocol:z,transport:"stdio",location:U.identifier}))];if(X.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return X}function MD($,Z,Q,z){let X={domain:Z},U=[["repository",R($.repository)],["icon",R($.icon)],["organizationUrl",R($.organization_url)]];for(let[H,V]of U)if(V)X[H]=V;if(Q.length)X.keywords=Q;let J=T8($.example_requests);if(J.length)X.examples=J;if(z.length)X.packages=z;return X}function jQ($){let Z=R($.handle).toLowerCase(),Q=GD($.domain);WD($,Z,Q);let z=T8($.tags),X=BD($),U=R($.homepage);if(U&&!CQ(U))throw Error(`Homepage: "${U}" is not an http(s) URL.`);let J={name:Z,displayName:R($.display_name),id:`urn:air:${Q}:agent:${Z}`,...R($.organization)?{vendor:R($.organization)}:{},version:R($.version),description:R($.description),homepage:U||`https://${Q}`,...R($.license)?{license:R($.license)}:{}};return{version:TQ,agent:J,capabilities:qD($,z),endpoints:LD($,X),metadata:{cards:MD($,Q,z,X)}}}function wQ($){return D2($,{lineWidth:0})}function U$($){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 SQ($){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 zZ($){return`${U$($).split(".").reverse().join(".")}/${SQ($)}`}function $Z($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function F2($){return($.endpoints??[]).filter((Z)=>R(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(R(Z.location))).map((Z)=>({type:"streamable-http",url:R(Z.location)}))}function ID($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function EQ($){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 U={name:zZ($),version:X,description:$Z(z)},J=R(Z.displayName);if(J)U.title=$Z(J);let H=R(Z.homepage);if(H)U.websiteUrl=H;let V=ID(R(Q.repository));if(V)U.repository=V;if(R(Q.icon))U.icons=[{src:R(Q.icon)}];return U}function bQ($){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 w8($){return($.endpoints??[]).some((Z)=>R(Z.protocol).toLowerCase()==="mcp")}function XZ($){return w8($)&&(F2($).length>0||bQ($).length>0)}function yQ($){let Z=R($.agent?.displayName);return{name:zZ($),...Z?{title:$Z(Z)}:{}}}function S8($,Z,Q={}){let z=F2($);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:C8,...EQ($),remotes:z,...Z?{_meta:{"one.faf/context":w0(Z,Q)}}:{}}}function xQ($,Z,Q={}){let z=F2($),X=bQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");if(!w8($))throw Error("A registry entry describes an MCP server: the .fafa has no mcp endpoint.");return{$schema:RQ,...EQ($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:O2(Z,Q)}:{}}}function OD($,Z,Q){if(!Z.includes("a2a")||_2($,Q).length===0)return;return Q.a2aCardUrl??`https://${U$($)}/.well-known/agent-card.json`}function E8($,Z,Q={}){let z=U$($),X=SQ($),U=$.agent??{},J=R(U.displayName)||R(U.name),H=R(U.description),V=R(U.version),Y=Q.now??new Date().toISOString(),G=(K,L,B)=>({identifier:`urn:air:${z}:${K}:${X}`,displayName:J,type:L,description:H,url:B,...V?{version:V}:{},updatedAt:Y}),W=[],q=OD($,Z,Q);if(q)W.push(G("a2a",e5.a2a,q));if(Z.includes("server_card")){let K=F2($)[0];if(K)W.push(G("mcp",e5.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(G("agent",e5.fafa,`https://${z}/.well-known/fafa`));return W}function b8($){let Z=$.agent??{},Q=R(Z.vendor)||R(Z.displayName)||R(Z.name);if(!Q)return;let z;try{z=U$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function gQ($,Z,Q={}){let z=b8($);return{specVersion:NQ,...z?{host:z}:{},entries:E8($,Z,Q)}}function UZ($){let Z=$.metadata?.cards??{},Q=T8(Z.keywords),z=T8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function vQ($,Z,Q={}){let z=b8($),X=UZ($);return{specVersion:NQ,...z?{host:z}:{},entries:E8($,Z,Q).map((U)=>({...U,...X}))}}function kQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:wQ($)},{faf:X}=Z;if(Q.has("a2a")){let J=[...Z.a2aExtensions??[],...X?[QZ($,X,Z)]:[]];z.a2a=j8($,{extensions:J})}if(Q.has("server_card"))z.server_card=S8($,X,Z);if(Q.has("server_json"))z.server_json=xQ($,X,Z);let U={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=gQ($,Z.cards,U);if(Q.has("ard"))z.ard=vQ($,Z.cards,U);return z}function _D($,Z){return kQ(jQ($),Z)}var RD=C8,ND=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function hQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&ND.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 TD($){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 X6($,Z={}){let Q={$schema:RD,name:hQ($),version:String($.project?.version??"0.1.0"),description:TD($)},z=y8($)??$.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":w0($,Z)},Q}function HZ($){return hQ($)}function y8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function AD($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var JZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function uQ($){let Z=AD($);return JZ(Z)&&JZ(Z._meta)&&JZ(Z._meta["one.faf/context"])}function CD($,Z,Q={},z={}){let X=X6(Z,Q),U=FD($,"server-card");return z6(U,`${JSON.stringify(X,null,2)}
250
- `,{root:$,format:"json",hasMark:uQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),U}function jD($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return Q6($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var wD=PD(X6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as mQ}from"fs";import{basename as SD,dirname as pQ,join as fQ}from"path";import{deprecate as ED}from"node:util";var bD=["a2a","mcp","registry","catalog","ard"];function yD($){return m0(Q0(m(pQ($),SD($))))}function xD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=fQ($,z);if(mQ(X))return X}let Q=pQ($);if(Q!==$)for(let z of Z){let X=fQ(Q,z);if(mQ(X))return X}return null}function VZ($,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 j8($,{doorUrl:Q.doorUrl,extensions:Z?[QZ($,Z,Q)]:[]})}var gD=ED(VZ,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function vD($,Z={},Q={}){return E8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function kD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function hD($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:U,...J})=>({specVersion:U,host:{...Q},...J}))(z):z;for(let U of Z){let J=kD(X.entries,U);if(J>=0)X.entries[J]={...X.entries[J],url:U.url,type:U.type,...U.updatedAt?{updatedAt:U.updatedAt}:{}};else X.entries.push(U)}return X}var uD="no mcp endpoint in agent.fafa";function mD($){return $!==void 0&&!w8($)}function fD($){let Z=$.project?.type??$.app_type;return typeof Z==="string"&&Z.trim()!==""?Z.trim():void 0}function pD($,Z){if($===void 0||Z!==void 0)return!1;let Q=fD($);return Q!==void 0&&!/^mcp/i.test(Q)}function lD($,Z={}){return[..._2($,Z).length>0?["a2a"]:[],...F2($).length>0?["mcp"]:[],...XZ($)?["registry"]:[],"catalog","ard"]}function cD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=mD(z),U=$.targets?.filter((G)=>G==="mcp"||G==="registry")??[];if(X&&U.length)throw Error(`${U.join(", ")}: ${uD} — these cards describe an MCP server.`);let J=pD(Q,z),H=(Q?bD:z?lD(z,Z):[]).filter((G)=>!(X||J)||G!=="mcp"&&G!=="registry"),V=new Set($.targets?.length?$.targets:H),Y={};if(Q)Y.block=w0(Q,Z);if(V.has("mcp"))if(z&&F2(z).length>0)Y.mcp=S8(z,Q,Z);else if(Q)Y.mcp=X6(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(V.has("registry"))if(z&&XZ(z))Y.registry={...yQ(z),...Q?{_meta:O2(Q,Z)}:{}};else if(Q){let G=y8(Q);Y.registry={name:HZ(Q),...G?{title:G}:{},_meta:O2(Q,Z)}}else throw Error("A registry entry needs a package or a remote MCP URL in the .fafa, or a project.faf.");if(V.has("a2a")||V.has("catalog")||V.has("ard")){if(!$.fafa){if($.targets?.some((G)=>G==="a2a"||G==="catalog"||G==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(V.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 Y.a2a=VZ($.fafa,Q,Z);if((V.has("catalog")||V.has("ard"))&&$.fafa){let G=vD($.fafa,Q,Z);if(V.has("catalog"))Y.catalog=G;if(V.has("ard")){let q=UZ($.fafa);Y.ard=G.map((K)=>({...K,...q}))}let W=b8($.fafa);if(W)Y.catalogHost=W}return dD(Y),Y}function dD($){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((J)=>J.uri===X$);if(!z)throw Error("A2A card has no FAF context extension, but a project.faf was given");let X=z.params,U=$.block;if(X.provenance?.faf!==U.faf||X.provenance?.mediaType!==U.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var YZ=["ephemeral","standard","high","critical"],Z2=Object.fromEntries(YZ.map(($,Z)=>[$,Z])),x8=new Set(["user","feedback","project","reference"]),GZ=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),WZ=new Set(["facts","sessions","preferences","custom"]),qZ={low:"ephemeral",medium:"standard"};import{existsSync as iD}from"fs";import{dirname as rQ,resolve as sQ}from"path";function P2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function nD($){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 rD($){let Z=sQ($),Q=m(rQ(Z),Z,{read:!0});return{real:Q,text:Q0(Q)}}function lQ($,Z,Q,z){let X=sQ($),U=m(rQ(X),X),J=Q!==void 0&&Q.real===U;if(J&&Q.text===Z)return U;let H;try{H=f0(U)}catch{H=void 0}if(H&&H.equals(Buffer.from(Z,"utf-8")))return U;if(!J&&!z&&H)throw new S("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let V=J?Q.text:z?H:null;return $0($,Z,V===void 0?{}:{expect:V})}function V$($){if(f($))return"standard";if(qZ[$])return qZ[$];if($ in Z2)return $;return"standard"}var sD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function BZ($){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(!sD.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:V$(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 J$($){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 cQ($){let Z=$;return H$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&H$(Z.extra)&&typeof Z.priority==="string"?Z:BZ($)}function oD($){if(typeof $==="string"||H$($)&&"text"in $)return BZ($);return null}var dQ=["profile","namepoint","created","last_etched","retention"];class W0{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??P2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(cQ):[],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||d(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(!iD($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=rD($);return W0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=k5($,Z).toJS();if(!H$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${nD(z)}`);let X=new oQ,U=X.pick("memory",z.memory,h)??{},J=new W0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,U)});return(X.pick("memory.facts",U.facts,Array.isArray)??[]).forEach((H,V)=>{let Y=oD(H);if(Y)J.adopt(Y,V)}),J.last_etched=String(z.last_etched??J.created),J._version=f(z.version)?void 0:String(z.version),J._origin={path:Z,real:Q,text:$,base:J.state(),residual:X.residual},J.recordIndex(),J}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 W0.load($)}toDoc(){let $={facts:this._facts.map(J$),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!WZ.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(!GZ.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")&&d(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&&d(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),Y=lQ($,V,void 0,z);return this.settle($,V,new Map(this._facts.map((G,W)=>[G,W])),Y),$}let U=new Map,{text:J}=O8(X.text,(V)=>{U=this.applyTo(V,X,Q)},$),H=lQ($,J,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,J,U,H),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,U]of Q)this._factAt.set(X,U);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(J$(Z)))}return{top:Object.fromEntries(dQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),U=Z.path;for(let J of dQ)if(z.top[J]!==X.top[J])$.set(J,X.top[J]);if(!d(z.index,X.index)){if(Z.residual.has("index")&&!Q)W0.refuse(Z,"index","replace it");F8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,U)}for(let J of nQ(z.extra,X.extra))F8($,[J],z.extra[J],X.extra[J],U);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...nQ(Q.memoryExtra,z.memoryExtra).map((U)=>[U,Q.memoryExtra[U],z.memoryExtra[U]])];for(let[U,J,H]of X){if(d(J,H))continue;if(Z.residual.has("memory"))W0.refuse(Z,"memory",`change memory.${U}`);if(Z.residual.has(`memory.${U}`))W0.refuse(Z,`memory.${U}`,"replace it");F8($,["memory",U],J,H,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(([,Y])=>Y)),U=[...Z.base.facts.keys()].filter((Y)=>!X.has(Y)).sort((Y,G)=>G-Y),J=Q.filter(([Y,G])=>!d(Z.base.facts.get(G),J$(Y))),H=new Map(Q);if(z.length===0&&U.length===0&&J.length===0)return H;for(let Y of["memory","memory.facts"])if(Z.residual.has(Y))W0.refuse(Z,Y,"add facts to it");let V=l9($,["memory","facts"],Z.path);for(let[Y,G]of J)V.items[G]=tD($,V.items[G],Z.base.facts.get(G),J$(Y));for(let Y of U)V.items.splice(Y,1);for(let[Y,G]of Q)H.set(Y,G-U.filter((W)=>W<G).length);for(let Y of z)H.set(Y,V.items.length),V.items.push($.createNode(J$(Y)));return H}add($){let Z=cQ($);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(aD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:V$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:P2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=H$($)?{...$,...Z}:Z,z=H$($)?$.query:$,X=Z2[V$(Q.minPriority??"ephemeral")]??0,U=typeof z==="string"?z.toLowerCase():"",J=new Set(Q.tags??[]),H=[];this._facts.forEach((Y,G)=>{if(U&&!String(Y.text??"").toLowerCase().includes(U))return;if(J.size>0&&![...J].some((W)=>(Y.tags??[]).includes(W)))return;if(!f(Q.type)&&Y.type!==Q.type)return;if((Z2[Y.priority]??1)<X)return;H.push([G,Y])}),H.sort((Y,G)=>{let W=Z2[Y[1].priority]??1,q=Z2[G[1].priority]??1;if(q!==W)return q-W;let K=Y[1].timestamp??"",L=G[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return G[0]-Y[0]});let V=H.map(([,Y])=>Y);if(!f(Q.limit))return V.slice(0,Q.limit);return V}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 aD($,Z,Q){let z=(X,U)=>f(X)?U:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:V$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:P2(),extra:{...$.extra}}}class oQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,Q$(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,h)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,h)??{}),extra:iQ($,GZ),memoryExtra:iQ(Z,WZ)}}}function iQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function nQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function tD($,Z,Q,z){if(!c(Z))return e$($,Z,Q,z);let X=(U)=>typeof U==="string"?{text:U}:U;return e$($,Z,X(Q),X(z))}import{readdirSync as eD,readFileSync as $L,statSync as aQ,existsSync as ZL}from"fs";import{join as QL,basename as tQ,resolve as zL}from"path";var eQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),XL=/\[\[([^\]]+)\]\]/g;function UL($){let Z=aQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function JL($){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 HL($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!x8.has(X))return null;let U=String(Q.name).trim(),H=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||U,V={};if(z.originSessionId)V.provenance=[`session:${z.originSessionId}`];let Y=[...new Set([...Z.matchAll(XL)].map((G)=>G[1]))].sort();return{text:H,id:U,type:X,priority:"standard",tags:[],links:Y,timestamp:UL($),source:`claude-code memory: ${tQ($)}`,extra:V}}function $3($,Z={}){let Q=zL($);if(!ZL(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!aQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??eQ,X=Z.namepoint??`@claude-code:${tQ(Q)}`,U=[],J=eD(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of J){if(z.has(W))continue;let q=QL(Q,W),K;try{K=$L(q,"utf-8")}catch{continue}let{fm:L,body:B}=JL(K);if(!L)continue;let D=HL(q,B,L);if(D)U.push(D)}let H=U.map((W)=>W.timestamp).filter(Boolean),V=H.length?H.reduce((W,q)=>W<q?W:q):P2(),Y=H.length?H.reduce((W,q)=>W>q?W:q):V,G=new W0(X,{profile:"knowledge",facts:U,created:V});return G.last_etched=Y,G.rebuildIndex(),G}var z3="faf-interview/1",Y$="(one line, every word earns its place)",KZ=[{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,help:"one sentence: what it does, and for whom"},{path:"human_context.who",question:`Who is this for? ${Y$}`,header:"Who",type:"text",required:!0,help:"the people who use it, not the author"},{path:"human_context.what",question:`What are they building? ${Y$}`,header:"What",type:"text",required:!0,help:"what they make or do with it"},{path:"human_context.why",question:`Why does it exist? ${Y$}`,header:"Why",type:"text",required:!0,help:"the problem it removes"},{path:"human_context.where",question:`Where does it run or ship? ${Y$}`,header:"Where",type:"text",required:!0,help:"where it runs or ships: platform, store, registry"},{path:"human_context.when",question:`When — what stage is it at, and since when? ${Y$}`,header:"When",type:"text",required:!0,help:"the stage it is at, and since when"},{path:"human_context.how",question:`How does it work? ${Y$}`,header:"How",type:"text",required:!0,help:"the mechanism, and the choice that shapes the code"}],X3=[{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$=[...KZ,...X3],U3=new Map(G$.map(($)=>[$.path,$])),VL=Object.fromEntries(G$.map(($)=>[$.path,$]));function DZ($){let Z=U3.get($);if(Z)return Z.question;let Q=x0.get($)??p.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function YL($,Z){return G$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let U of z)if(X&&typeof X==="object"&&U in X)X=X[U];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var GL=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"]),WL=[["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]],qL=($)=>GL.has($.toLowerCase().trim()),BL=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i,KL=12;function DL($){let Z=$.trim().split(/\s+/).filter(Boolean);if(Z.length>KL)return"";while(Z.length&&BL.test(Z[Z.length-1].replace(/[.,;:]+$/,"")))Z.pop();return Z.join(" ")}function J3($){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=DL(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!qL(X))Z.what=X;let U=WL.filter(([,J])=>J.test(Q)).map(([J])=>J);if(U.length)Z.where=U.slice(0,4).join(", ");return Z}function Z3($,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 Q3($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!l(Z)}function LL($,Z={}){let Q=$&&typeof $==="object"?$:{},z=Z3(Q,"project.goal"),X=(Q3(z)?String(z).trim():"")||(Z.goal??"").trim(),U=J3(X),J=Z.detailed??{},H={"project.goal":X||void 0,"human_context.what":U.what,"human_context.where":U.where,"human_context.who":U.who},V=(K)=>{let L=H[K];if(L)return{value:L,source:"project goal",confidence:0.9};let B=K.startsWith("human_context.")?K.slice(14):"",D=B?J[B]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},Y=KZ.map((K,L)=>{let B={n:L+1,path:K.path,header:K.header,question:K.question},D=Z3(Q,K.path);if(Q3(D))return{...B,value:String(D).trim(),status:"filled",seeded:!1};let I=V(K.path);if(I)return{...B,value:I.value,status:"seeded",seeded:!0,source:I.source,confidence:I.confidence};return{...B,value:"",status:"empty",seeded:!1}}),G=Y.filter((K)=>K.status==="filled").length,W=Y.filter((K)=>K.status==="seeded").length,q=Y.filter((K)=>K.status==="empty").length;return{version:z3,rows:Y,filledCount:G,seededCount:W,emptyCount:q,complete:q===0}}function g8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||l(Z)}return!1}function ML($,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 H3($){if($==="project.goal")return!0;return x0.get($)?.category==="human"}function V3($,Z=g8){let Q=[],z=[];for(let X of G$){let U=ML($,X.path);if(U==="slotignored")continue;if(!Z(U))continue;(H3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function Y3($,Z,Q=g8){let z=V3(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let U=X==="needs-human"?LZ(z):[];return{status:X,score:$,gaps:z,ask:U}}function LZ($){return $.human.map((Z)=>({path:Z,question:DZ(Z)}))}function IL($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??g8,X=[],U=0;for(let H=0;H<=Q;H++){let V=$.read();if(!V)return{status:"no-faf",score:0,rounds:U,history:X,ask:[]};let Y=$.score(V.yaml);X.push(Y);let G=Y3(Y,V.data,z);if(G.status==="done")return{status:"done",score:Y,rounds:U,history:X,ask:[]};if(G.status==="needs-human")return{status:"needs-human",score:Y,rounds:U,history:X,ask:G.ask};if(X.length>=2&&Y<=X[X.length-2])return G.gaps.human.length?{status:"needs-human",score:Y,rounds:U,history:X,ask:LZ(G.gaps)}:{status:"stuck",score:Y,rounds:U,history:X,ask:[]};if(U>=Q)return{status:"capped",score:Y,rounds:U,history:X,ask:LZ(G.gaps)};$.runAuto(),U++}return{status:"capped",score:X[X.length-1]??0,rounds:U,history:X,ask:[]}}import{createHash as W3}from"crypto";var MZ="faf-bench/1",OL={"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 stage is it at, and since when?","human_context.how":"How does it work?"};function _L($,Z){return OL[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var q3=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],U6=new Map;q3.forEach(($,Z)=>$.forEach((Q)=>U6.set(Q,Z)));var FL=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function v8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function G3($){return v8($).split(" ").filter((Z)=>Z&&!FL.has(Z))}function B3($,Z){let Q=v8($),z=v8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=U6.get(Q);if(X!==void 0&&U6.get(z)===X)return!0;let U=G3($);if(U.length===0)return!1;let J=new Set(G3(Z));return U.every((H)=>{if(J.has(H))return!0;let V=U6.get(H);return V!==void 0&&[...J].some((Y)=>U6.get(Y)===V)})}function PL($){let Z=B4($),Q=m0($),z=[],X={},U=0;for(let V of p){if(Z.slots[V.path]!=="populated")continue;let Y=sZ(Q,V);if(typeof Y!=="string")continue;let G=Y.trim();if(!G||O6.has(G.toLowerCase()))continue;U+=1,z.push({n:U,path:V.path,question:_L(V.path,V.description)}),X[U]=G}let J=JSON.stringify({v:MZ,q:z.map((V)=>[V.path,V.question])}),H=W3("sha256").update(J).digest("hex").slice(0,12);return{version:MZ,qsetHash:H,questions:z,answers:X}}function RL($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function NL($,Z){let Q=$.questions.map((X)=>{let U=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof U==="string"&&U.trim()!==""&&B3($.answers[X.n],U)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function TL($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:W3("sha256").update(Q).digest("hex")}}import{join as tM,extname as eM,resolve as $I}from"path";var IZ={"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 CL}from"path";var W$={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 jL=W$.flutterDeps,wL=W$.mcpDeps,SL=W$.serverFrameworks,EL=W$.stateManagement,bL=W$.routing;function yL($){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 k8($){let Z=j($,"pubspec.yaml");if(Z===null)return null;let Q=yL(Z),z=(O)=>Q.has(O.toLowerCase()),X=jL.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),U=wL.find(z),J=SL.find(([O])=>z(O)),H=EL.find(([O])=>z(O)),V=H?H[1]:"",Y=bL.find(([O])=>z(O)),G=Y?Y[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",q=/^executables:\s*$/m.test(Z),K=(k($,"bin")??[]).some((O)=>O.name.endsWith(".dart")),L=q||K,B,D="",I;if(X)if(D="Flutter",M($,CL("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))B="mobile",I="pubspec.yaml (Flutter app)";else B="library",I="pubspec.yaml (Flutter package)";else if(U)B="mcp",I=`pubspec.yaml + ${U} (Dart MCP server)`;else if(J)B="backend",D=J[1],I=`pubspec.yaml + ${J[0]} (Dart backend)`;else if(L)B="cli",I=q?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else B="library",I="pubspec.yaml (Dart package)";return{appType:B,isFlutter:X,framework:D,stateManagement:V,routing:G,testing:W,found:I}}import{join as gL}from"path";var h8={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 vL=h8.mcpModules,kL=h8.serverFrameworks,hL=h8.cliFrameworks;function uL($){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 J=X.match(/^(\S+)/);if(J)Z.add(J[1].toLowerCase());continue}let U=X.match(/^require\s+(\S+)/);if(U&&U[1]!=="(")Z.add(U[1].toLowerCase())}return Z}function D3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function K3($,Z){let Q;for(let z of Z){if(!D3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function mL($,Z){let Q;for(let z of Z){if(!D3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function fL($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function pL($){for(let{name:Z}of k($,"cmd")??[]){let Q=gL("cmd",Z),z=I0($,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 lL($){let Z=j($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function u8($){let Z=j($,"go.mod");if(Z===null)return null;let Q=fL(Z),z=uL(Z),X=mL(z,vL),U=K3(z,kL),J=K3(z,hL),H=pL($),V=lL($),Y,G="",W;if(X)Y="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(U)Y="backend",G=U[1],W=`go.mod + ${U[0]} (Go backend)`;else if(J)Y="cli",G=J[1],W=`go.mod + ${J[0]} (Go CLI)`;else if(H)Y="cli",W="go.mod + cmd/ (Go CLI layout)";else if(V&&!U)Y="cli",W="go.mod + main.go package main (Go CLI)";else Y="library",W="go.mod (Go module)";return{appType:Y,modulePath:Q,framework:G,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 dL=R2.mcpPackages.map(($)=>$.toLowerCase()),iL=R2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),nL=R2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),rL=R2.grpcServerPackages.map(($)=>$.toLowerCase()),sL=R2.specializedSdks,L3=R2.baseSdk.toLowerCase();function oL($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),U=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],H=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||U||"").trim(),V=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),Y=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),G=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),q=new Set;for(let L of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))q.add(L[1].toLowerCase());for(let L of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))q.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:H,isTestProject:V,useMaui:Y,useWpf:G,useWindowsForms:W,packages:q,frameworkRefs:K}}function OZ($,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 M3($,Z){let Q;for(let[z,X]of Z){if(!OZ($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function aL($){let Z;for(let Q of dL){if(!OZ($,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 tL($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of sL){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function m8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function eL($,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 $M($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:U,outputType:J}=$,H,V="",Y,G=aL(X),W=tL(z),q=M3(X,nL),K=M3(X,iL),L=rL.some((D)=>OZ(X,D)),B=U.has("microsoft.aspnetcore.app");if(G)H="mcp",V="MCP",Y=`${Z} + ${G} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||q)H="library",V=q?.[1]||(W?.[1]==="test"?W[2]:"Test"),Y=`${Z} + test (${V})`;else if($.useMaui)H="mobile",V="MAUI",Y=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)H="backend",V=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",Y=`${Z} + ${V}`;else if(W?.[1]==="web")H="backend",V=L?"gRPC":W[2],Y=`${Z} + Sdk=${W[0]}${L?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")H="library",V=W[2],Y=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(B&&m8(J))H="backend",V="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(B&&!m8(J))H="library",V="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(m8(J)||!J))H="cli",V=K[1],Y=`${Z} + ${K[0]} (C# CLI)`;else if(m8(J))H="cli",Y=`${Z} + OutputType=Exe (C# console)`;else{H="library";let D=z?` Sdk=${z}`:"";if(Y=`${Z}${D} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===L3||z.toLowerCase().startsWith(`${L3}/`))Y=`${Z} (C# class library)`}return{appType:H,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:V,found:Y}}function q$($){return(k($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function f8($){let Z=q$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let U=j($,X);if(U===null)continue;let J=oL(U),H=$M(J,X),V=eL(H.appType,H.framework);if(!Q||V<z)Q=H,z=V}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 QM=_0.mcpArtifacts.map(($)=>$.toLowerCase()),zM=_0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),XM=_0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),UM=_0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),JM=_0.androidPlugins.map(($)=>$.toLowerCase()),HM=_0.kmpPlugins.map(($)=>$.toLowerCase()),VM=_0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),YM=_0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),GM=_0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),WM=_0.libraryPlugins.map(($)=>$.toLowerCase()),qM=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function _Z($){return qM.some((Z)=>M($,Z))}function BM($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
253
- `)){let U=X.replace(/#.*$/,"").trim();if(!U)continue;let J=U.match(/^\[([^\]]+)\]$/);if(J){z=J[1].trim().toLowerCase();continue}let H=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(H&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(H[1].replace(/-/g,".").toLowerCase(),H[2].toLowerCase()),Z.set(H[1].toLowerCase(),H[2].toLowerCase());continue}let V=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=V[1].toLowerCase();Q.set(W,V[2].toLowerCase()),Q.set(W.replace(/-/g,"."),V[2].toLowerCase());continue}let Y=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(Y&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${Y[2]}:${Y[3]}`.toLowerCase(),q=Y[1].toLowerCase();Q.set(q,W),Q.set(q.replace(/-/g,"."),W);continue}let G=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(G){let W=G[1].toLowerCase(),q=G[2];if(z==="plugins"||z.endsWith(".plugins")){let K=q.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=q.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 KM($){let Z=j($,N2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return BM(Z)}function DM($){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 LM($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let U=X.replace(/\/\/.*$/,"").trim();if(!U||U.startsWith("id")||U.startsWith("kotlin")||U.startsWith("alias"))continue;let J=U.match(/^`([a-zA-Z0-9.-]+)`$/)||U.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(J)Q.add(J[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),U=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(U)Q.add(U);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function MM($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let U=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let J of U){let H=Z.libraries.get(J);if(H){Q.add(H.includes(":")?H.split(":").slice(0,2).join(":"):H);break}}}return Q}function _3($){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 J=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),H=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&H)Q.add(`${J}:${H}`.toLowerCase())}let X=new Set;for(let J of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let H=J[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),V=J[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(H&&V)X.add(`${H}:${V}`.toLowerCase())}let U=[];for(let J of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))U.push(J[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:U}}function Q2($,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 J6($,Z,Q){let z;for(let[X,U]of Z){let J=!1;if(Q==="plugin")J=Q2($,X);else if(J=$.has(X)||[...$].some((H)=>H===X||H.startsWith(`${X}:`)||H.startsWith(`${X}.`)),!J&&Q==="artifact")J=[...$].some((H)=>H===X||H.startsWith(`${X}`));if(!J)continue;if(!z||X.length>z[0].length)z=[X,U]}return z}function IM($){let Z;for(let Q of QM)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 F3($,Z){let Q=new Set,z=!1,X=!1,U=[N2(Z,"src"),N2(Z,"src","main")],J=(H,V)=>{if(V>4)return;let Y=k($,H);if(!Y)return;for(let{name:G}of Y){if(G==="androidMain"||G==="commonMain"||G==="jvmMain"||G==="iosMain")Q.add(G);let W=N2(H,G),q=I0($,W);if(!q)continue;if(q.isDirectory())J(W,V+1);else if(G.endsWith(".kt")||G.endsWith(".kts"))z=!0;else if(G.endsWith(".java"))X=!0}};for(let H of U)J(H,0);return{kotlin:z,java:X,hints:Q}}function OM($){let Z=[],Q=$.plugins,z=$.artifacts,X=HM.some((P)=>Q2(Q,P))||$.sourceHints.has("commonMain"),U=Q2(Q,"com.android.application"),J=!U&&JM.some((P)=>Q2(Q,P));if(U||J)Z.push("android");if(X)Z.push("multiplatform");let H=IM(z),V=J6(Q,zM,"plugin"),Y=J6($.parents,XM,"parent"),G=J6(z,UM,"artifact"),W=J6(Q,YM,"plugin"),q=J6(z,GM,"artifact"),K=WM.some((P)=>Q2(Q,P)),L=$.packaging==="pom",B,D="",I;if(U)B="mobile",D=X?"Android+KMP":"Android",I=`${$.path||"root"} + com.android.application (${D})`;else if(H)B="mcp",D="MCP",Z.push("mcp"),I=`${$.path||"root"} + ${H} (JVM MCP server)`;else if(V||Y||G){B="backend",D=V?.[1]||Y?.[1]||G?.[1]||"JVM";let P=V?.[0]||Y?.[0]||G?.[0]||"web";I=`${$.path||"root"} + ${P} (JVM backend)`}else if(X&&!J)B="library",D="Kotlin Multiplatform",I=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(J)B="library",D=X?"Android+KMP":"Android",I=`${$.path||"root"} + android library (${D})`;else if(q||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)B="cli",D=q?.[1]||"application",I=q?`${$.path||"root"} + ${q[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)B="cli",D="application",I=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)B="library",I=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{B="library";let P=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(I=`${$.path||"root"} (${P} library)`,K)I=`${$.path||"root"} + java-library (JVM library)`}let O="Java";if($.kotlinSources&&$.javaSources)O="Java/Kotlin";else if($.kotlinSources||VM.some((P)=>Q2(Q,P))||X)O="Kotlin";let C=[...new Set(Z)];return{appType:B,framework:D,facets:C,found:I,buildTool:$.buildTool,mainLanguage:O}}function _M($,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 I3($,Z,Q){let z=N2(Z,"build.gradle.kts"),X=N2(Z,"build.gradle"),U=M($,z)?z:M($,X)?X:null;if(!U)return null;let J=j($,U);if(!J)return null;let H=LM(J,Q),V=MM(J,Q),Y=F3($,Z),G=/mainClass\s*[.=]/.test(J)||/mainClassName\s*=/.test(J)||/Main-Class/.test(J),W=Q2(H,"application")||Q2(H,"org.gradle.application");return{path:Z||"build.gradle",plugins:H,artifacts:V,packaging:"jar",parents:new Set,hasMainClass:G,hasApplicationPlugin:W,sourceHints:Y.hints,kotlinSources:Y.kotlin||U.endsWith(".kts"),javaSources:Y.java,buildTool:"gradle"}}function O3($,Z){let Q=j($,N2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:U}=_3(Q),J=F3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:U,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:J.hints,kotlinSources:J.kotlin,javaSources:J.java,buildTool:"maven"}}function H6($){if(!_Z($))return null;let Z=KM($),Q=[],z=null;for(let Y of["settings.gradle.kts","settings.gradle"])if(M($,Y)){z=j($,Y);break}let X=z?DM(z):[],U=I3($,"",Z);if(U)Q.push(U);for(let Y of X){let G=I3($,Y,Z);if(G)Q.push(G)}let J=O3($,"");if(J){Q.push(J);let Y=j($,"pom.xml");if(Y){let{modules:G}=_3(Y);for(let W of G){let q=O3($,W);if(q)Q.push(q)}}}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 H=null,V=999;for(let Y of Q){let G=OM(Y),W=_M(G.appType,G.facets);if(!H||W<V)H={appType:G.appType,framework:G.framework,buildTool:G.buildTool,mainLanguage:G.mainLanguage,facets:G.facets,found:G.found},V=W}if(H&&X.length>0&&!H.found.includes("multi-project"));return H}import{join as PM}from"path";var V6={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 RM=V6.mcpGems.map(($)=>$.toLowerCase()),NM=V6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),P3=V6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),TM=V6.railsLayoutFiles;function AM($){return M($,"Gemfile")||M($,"gems.rb")||CM($)}function CM($){return(k($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function jM($){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 wM($){let Z=new Set,Q=!1;for(let z of $.split(`
255
- `)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let U=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(U)Z.add(U[1].toLowerCase())}}return Z}function SM($){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 EM($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let U=j($,X);if(U){for(let J of jM(U))Z.add(J);Q.push(X)}}let z=j($,"Gemfile.lock")||j($,"gems.locked");if(z){for(let X of wM(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of k($)??[]){if(!X.endsWith(".gemspec"))continue;let U=j($,X);if(U){for(let J of SM(U))Z.add(J);Q.push(X)}}return{gems:Z,sources:Q}}function Y6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function FZ($,Z){let Q;for(let[z,X]of Z){if(!Y6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function bM($){let Z;for(let Q of RM)if(Y6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function R3($){for(let Z of TM)if(M($,Z))return Z;return}function yM($,Z){let Q=FZ(Z,P3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of k($)??[]){if(!X.endsWith(".gemspec"))continue;let U=j($,X);if(U&&/executables\s*=/.test(U)&&!/executables\s*=\s*\[\s*\]/.test(U))return{hit:!0,why:`${X} executables`}}let z=k($,"bin");if(z){let U=z.map((J)=>J.name).filter((J)=>{if(J==="setup"||J==="console"||J==="rake")return!1;return I0($,PM("bin",J))?.isFile()===!0}).filter((J)=>J!=="rails");if(U.length>0&&!Y6(Z,"rails")&&!R3($))return{hit:!0,why:`bin/${U[0]}`}}return{hit:!1,why:""}}function p8($){if(!AM($))return null;let{gems:Z,sources:Q}=EM($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",U=bM(Z),J=FZ(Z,NM),H=R3($),V=Y6(Z,"rails")||Y6(Z,"railties"),Y=yM($,Z),G=M($,"config.ru"),W=V||!!H,q=J&&J[1]!=="Rails"&&!(J[0]==="rack"&&!G)?J:void 0,K,L="",B;if(U)K="mcp",L="MCP",B=`${z} + gem ${U} (Ruby MCP)`;else if(W)if(K="backend",L="Rails",V&&H)B=`${z} + rails + ${H} (Rails)`;else if(V)B=`${z} + gem rails (Rails)`;else B=`${H} (Rails layout)`;else if(q)K="backend",L=q[1],B=`${z} + gem ${q[0]} (Ruby backend)`;else if(Y.hit)K="cli",L=FZ(Z,P3)?.[1]||"",B=`${z} + ${Y.why} (Ruby CLI)`;else K="library",B=`${z} (Ruby library)`;return{appType:K,framework:L,packageManager:X,found:B}}import{join as gM}from"path";var S0={version:1,_doc:"SINGLE SOURCE of Swift detection KNOWLEDGE (Truth-is-faf-cli). Kill line: Package.swift alone ≠ app. Static parse of products + package URLs + product names + light xcodeproj productType. Never execute Package.swift / swift build. 2026-08-03 post-intel swift-edition.",mcpPackageUrls:["modelcontextprotocol/swift-sdk","github.com/modelcontextprotocol/swift-sdk"],mcpProducts:["MCP"],serverPackageUrls:[["vapor/vapor","Vapor"],["github.com/vapor/vapor","Vapor"],["hummingbird-project/hummingbird","Hummingbird"],["github.com/hummingbird-project/hummingbird","Hummingbird"]],serverProducts:[["Vapor","Vapor"],["Hummingbird","Hummingbird"]],cliPackageUrls:[["apple/swift-argument-parser","ArgumentParser"],["github.com/apple/swift-argument-parser","ArgumentParser"]],cliProducts:[["ArgumentParser","ArgumentParser"]],appProductTypes:["com.apple.product-type.application"],cliProductTypes:["com.apple.product-type.tool"],vaporLayoutFiles:["Sources/App/configure.swift","Sources/App/routes.swift","Sources/App/entrypoint.swift"]};var vM=S0.mcpPackageUrls.map(($)=>$.toLowerCase()),kM=S0.mcpProducts.map(($)=>$.toLowerCase()),hM=S0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),uM=S0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),mM=S0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),fM=S0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),pM=S0.appProductTypes,lM=S0.cliProductTypes,cM=S0.vaporLayoutFiles;function dM($){return M($,"Package.swift")||PZ($).length>0}function PZ($){return(k($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&I0($,Z)?.isDirectory()===!0)}function iM($){let Z=nM($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,U;while((U=X.exec(Z))!==null)z.push(U[1]);let J=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((U=J.exec(Z))!==null)z.push(U[1]);let H=[],V=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((U=V.exec(Z))!==null)H.push(U[1]);let Y=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((U=Y.exec(Z))!==null)H.push(U[1]);let G=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),q=/\.plugin\s*\(/.test(Q)&&!G&&!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:H,hasLibraryProduct:G,hasExecutableProduct:W,hasPluginProduct:!!q,hasExecutableTarget:K,hasLibraryTarget:L}}function nM($){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 rM($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z.length))z=X;return z}function N3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)for(let J of Q)if(J.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function T3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function sM($){let Z=$.map((Q)=>Q.toLowerCase());return kM.some((Q)=>Z.includes(Q))}function oM($){let Z=!1,Q=!1,z;for(let X of PZ($)){let U=j($,gM(X,"project.pbxproj"));if(!U)continue;for(let J of pM)if(U.includes(J))Z=!0,z=J;for(let J of lM)if(U.includes(J)){if(Q=!0,!z)z=J}}return{hasApplication:Z,hasTool:Q,hit:z}}function aM($){for(let Z of cM)if(M($,Z))return Z;return}function G6($){if(!dM($))return null;let Z=M($,"Package.swift"),Q=PZ($),z=Q.length>0,X=null;if(Z){let F=j($,"Package.swift");if(F)X=iM(F)}let U=z?oM($):{hasApplication:!1,hasTool:!1},J=aM($),H=X?.packageUrls??[],V=X?.productNames??[],Y=rM(H,vM),G=sM(V),W=N3(H,hM),q=T3(V,uM),K=N3(H,mM),L=T3(V,fM),B=!!(Y||G),D=!!(W||q||J),I=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),O=!!(K||L),C=U.hasApplication,P=Z&&z?"spm+xcode":Z?"spm":"xcode",N,T="",w;if(B)if(N="mcp",T="MCP",G)w="Package.swift + product MCP (Swift MCP)";else w=`Package.swift + ${Y} (Swift MCP)`;else if(D)if(N="backend",T=q?.[1]||W?.[1]||(J?"Vapor":""),q)w=`Package.swift + product ${q[1]} (Swift backend)`;else if(W)w=`Package.swift + ${W[1]} (Swift backend)`;else w=`${J} (Swift backend layout)`;else if(C)N="app",T="",w=`${Q[0]} + ${U.hit||"application"} (Swift app)`;else if(O||I&&!D&&!B)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(U.hasTool&&!Z)N="cli",w=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(N="library",X?.hasLibraryProduct)w="Package.swift + .library product (Swift library)";else w="Package.swift (Swift library)";else N="library",w=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:N,framework:T,packageManager:P,found:w}}var ZI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),QI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),zI={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"]},XI=[["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 UI($,Z){for(let[Q,z]of XI)if(Q in $)return z;return Z.length>0?"framework":"config"}function JI($,Z){try{let Q=JSON.parse(j($,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 HI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return I0($,Z.name)?.isFile()===!0}function VI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return I0($,Z.name)?.isDirectory()===!0}function YI($){let Z=[],Q=$I($),z=new Set,X=k(Q);if(!X)return Z;for(let U of X){let J=U.name;if(J.endsWith(".xcodeproj")?!VI(Q,U):!HI(Q,U))continue;if(J.toLowerCase().endsWith(".csproj")){let V=f8(Q);if(V){let Y={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="mobile"&&V.framework)Y.framework=V.framework;if(V.targetFramework)Y.runtime=V.targetFramework;let G=V.framework?[V.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:Y,priority:36,frameworks:G,fileName:J})}continue}if(J.endsWith(".xcodeproj")){let V=G6(Q);if(V){let Y={mainLanguage:"Swift",packageManager:V.packageManager==="spm"?"spm":"Xcode",buildTool:V.packageManager.includes("spm")?"swift build":"xcodebuild"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="app"&&V.framework)Y.framework=V.framework;let G=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:Y,priority:36,frameworks:G,fileName:J})}continue}let H=IZ[J];if(!H)continue;if(J==="manifest.json"&&JI(Q,J)!=="chrome")continue;if(J==="pubspec.yaml"){let V=k8(Q);if(V){let Y={mainLanguage:"Dart",packageManager:"pub"};if(V.isFlutter){if(Y.framework="Flutter",V.stateManagement)Y.stateManagement=V.stateManagement}else if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";Z.push({slots:Y,priority:H.priority,frameworks:V.isFlutter?["Flutter","Dart"]:["Dart"],fileName:J});continue}}if(J==="go.mod"){let V=u8(Q);if(V){let Y={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";let G=V.framework?[V.framework,"Go"]:["Go"];Z.push({slots:Y,priority:H.priority,frameworks:G,fileName:J});continue}}if(J==="Gemfile"||J==="Gemfile.lock"||J==="gems.rb"){let V=p8(Q);if(V){let Y={mainLanguage:"Ruby",packageManager:V.packageManager};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";let G=V.framework?[V.framework,"Ruby"]:["Ruby"];Z.push({slots:Y,priority:H.priority??35,frameworks:G,fileName:J});continue}}if(J==="Package.swift"){let V=G6(Q);if(V){let Y={mainLanguage:"Swift",packageManager:V.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="app"&&V.framework)Y.framework=V.framework;let G=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:Y,priority:H.priority??36,frameworks:G,fileName:J});continue}}if(J==="pom.xml"||J==="build.gradle"||J==="build.gradle.kts"||J==="settings.gradle"||J==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let V=H6(Q);if(V){let Y={mainLanguage:V.mainLanguage==="Java/Kotlin"?"Kotlin":V.mainLanguage,packageManager:V.buildTool==="maven"?"maven":"gradle",buildTool:V.buildTool};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="mobile")Y.framework=V.framework||"Android";if(V.facets.includes("multiplatform"))Y.framework=V.framework||"Kotlin Multiplatform";let G=V.framework?[V.framework,"JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:Y,priority:H.priority??35,frameworks:G,fileName:J});continue}}Z.push({slots:H.slots||{},priority:H.priority,frameworks:H.frameworks,fileName:J})}return Z}function GI($){let Z=[];for(let Q of $$($,()=>C3($,2,{count:0}))){let z=IZ[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function A3($){let Z=[...YI($),...GI($)],Q={},z={},X=new Set;for(let Y of Z){Y.frameworks.forEach((G)=>X.add(G));for(let[G,W]of Object.entries(Y.slots))if(W&&!W.includes("/")&&(!(G in Q)||Y.priority>z[G]))Q[G]=W,z[G]=Y.priority}let U=new Map;for(let Y of Z){if(!Y.fileName)continue;if(!U.has(Y.fileName))U.set(Y.fileName,{fileName:Y.fileName,category:UI(Y.slots,Y.frameworks),priority:Y.priority})}let J=[...U.values()].sort((Y,G)=>G.priority-Y.priority||Y.fileName.localeCompare(G.fileName)),H=[];if(Q.mainLanguage)H.push(Q.mainLanguage.toLowerCase());if(Q.framework)H.push(Q.framework.toLowerCase());let V=H.length>0?H.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:J,stackSignature:V}}function l8($){let{slotFills:Z}=A3($),Q={};for(let[z,X]of Object.entries(Z)){let U=zI[z];if(!U||!X)continue;let[J,H]=U;if(J==="project")(Q.project??={})[H]=X;else(Q.stack??={})[H]=X}return Q}function C3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=k($);if(!X)return z;for(let U of X){if(Q.count++>400)break;if(!U.isDirectory()){let J=eM(U.name);if(QI.has(J))z.add(J);continue}if(ZI.has(U.name)||U.name.startsWith("."))continue;for(let J of C3(tM($,U.name),Z-1,Q))z.add(J)}return z}var J0={goal:["use\\s+cases?","goals?"],what:["description","overview","purpose","introduction","what","what\\s+is\\s+(?!new\\b)\\S+","what\\s+it\\s+does"],who:["audience","target\\s+audience","for\\s+whom","who","who\\s+is\\s+(?:this|it)\\s+for","who\\s+it.s\\s+for"],why:["why","why\\s+(?:use\\s+)?(?!not\\b)\\S+","motivations?","(?:the\\s+)?problem","rationale","mission","vision"],where:["deployment","where","where\\s+it\\s+runs","hosting","platforms","supported\\s+platforms","platform\\s+support"],when:["status","(?:project|current)\\s+status","timeline","since","launched"],how:["architecture","how","how\\s+it\\s+works","how\\s+does\\s+it\\s+work","under\\s+the\\s+hood","internals","approach","methodology"]},B$={MIN_LENGTH:8,MAX_LENGTH:280},WI=[/^(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,/^(welcome|hello|hi|thanks|thank\s+you)\b/i,/\bwelcome[.!]?$/i,/^(copyright\b|\(c\)|©)/i,/\ball\s+rights\s+reserved\b/i,/^(?:(?:dual-)?licen[cs]ed\s+under|permission\s+is\s+hereby)\b/i,/\b(npm|pnpm|yarn|bun)\s+(i|install|add)\s|\bpip3?\s+install\s|\bcargo\s+(add|install)\s|\bgo\s+(get|install)\s|\bbrew\s+install\s/i,/^please\b/i,/\bto get started\b|\bread the (docs|documentation|guide)\b|\bstart with the (docs|documentation|guide)\b|\bread the announcement\b|\bcheck out (the|our)\b/i,/^["“'‘][\s\S]*["”'’]$/,/\?$/,/(&mdash;|&ndash;|[—–,;]|\s-)\s*$/,/^(the\s+)?mono-?repo\s+(for|of|containing|with)\b/i,/\bmono-?repo(\s+root)?\.?$/i,/[a-z]{2,}\.[A-Z][a-z]{2,}/,/^#{1,6}\s/,/\*\*[^*\n]{1,30}:\*\*[\s\S]*\*\*[^*\n]{1,30}:\*\*/];function j3($){return qI.some((Z)=>Z.test($))}var qI=[/\b(no longer (maintained|supported|developed)|unmaintained|deprecated|archived|end[- ]of[- ]life)\b/i,/^(sponsored|supported|funded|backed|brought to you) by\b/i,/\b(we['’]re|we are) hiring\b|^join (us|our)\b/i,/\b(documentation|docs) (is |are )?(available|can be found|lives?) (at|on|in)\b/i,/^looking for\b|\?\s/i,/^moved to\b|\b(has )?moved to\b|\bmirror of\b/i,/^(requires?|needs)\b/i,/^status\s*:/i,/^(warning|important|note|caution|attention|heads[- ]up|disclaimer|notice|danger)\s*:/i,/\b(t-?shirts?|mugs|stickers|merch(andise)?|donate|sponsor (us|me))\b/i,/^(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200d|\ufe0f|\s)+[\p{L}\p{N} '-]{1,30}:\s/u];function c8($){return/^\[!/.test($)||/^(⚠|🚧|❗|⛔|❌|🛑)/u.test($)||/\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($)}function d8($){let Z=$.findIndex((Q)=>Q.trim()!=="");if(Z>=0&&/^[-=]{3,}\s*$/.test($[Z+1]??""))return $.slice(Z+2);return $}function a($){let Z=$.trim();if(Z.length<B$.MIN_LENGTH)return!1;if(Z.length>B$.MAX_LENGTH)return!1;if(WI.some((Q)=>Q.test(Z)))return!1;if(/^(\||[-*+](\s|$))/.test(Z))return!1;if(Z.split(`
258
- `).length>4)return!1;if(BI(Z))return!1;return!0}function T2($){let Z=$.trim(),Q=/[.!?…]+(?=\s+\S|\s*$)/g;for(let z=Q.exec(Z);z;z=Q.exec(Z)){let X=z.index+z[0].length,U=Z.slice(0,X);if(X<Z.length){let J=Z.slice(X).trimStart();if(/(\.\.\.|…)$/.test(U))continue;if(/\b(e\.g|i\.e|vs|cf|approx|dr|mr|mrs|ms|st|jr|sr|no|fig)\.$/i.test(U))continue;if(/(\betc\.|(?:\b[A-Za-z]\.){2,})$/.test(U)&&/^[a-z]/.test(J))continue}return U.endsWith("?")?null:U}return null}function BI($){if(KI.test($))return!0;if($.includes("```"))return!0;if(/(^|\s)[-=]{3,}(\s|$)/.test($))return!0;if(/^\d+\.\s/.test($))return!0;if(/:\s*$/.test($))return!0;let Q=$.replace(/&nbsp;/gi," ").split(/\s*(?:\||·|•|&bull;)\s*/i).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return DI($)>0.5}var KI=/<\/?(?:p|div|img|br|hr|h[1-6]|picture|source|table|thead|tbody|tr|td|th|ul|ol|li|dl|dt|dd|details|summary|section|header|footer|center|video|iframe|svg|blockquote|pre)\b[^>]*>/i;function DI($){let Z=$.replace(/!\[[^\]]*\]\([^)]*\)/g,""),Q=[...Z.matchAll(/\[([^\]]*)\]\([^)]*\)/g)].map((X)=>X[1]).join(""),z=Z.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").trim();if(!z)return $.trim()?1:0;return Q.length/z.length}var z2=($,Z,Q)=>({value:$,source:Z,confidence:Q});function i8($,Z={}){let Q=Z.toolingRoot?null:MI($),z=II($),X={},U=(J,H)=>{if(H&&a(H.value))X[J]=H};return U("what",RI(Q,z)),U("who",NI(z)),U("why",TI(z)),U("when",AI(z)),U("how",CI(z)),X}function LI($,Z={}){let Q=i8($,Z),z={};return Object.keys(Q).forEach((X)=>{let U=Q[X];if(U)z[X]=U.value}),z}function MI($){let Z=j($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function II($){let Z=j($,"README.md");if(Z===null)return"";return d8(Z.replace(/<!--[\s\S]*?-->/g,"").split(`
249
+ `}var tK='<meta name="description" content="Visual render of project.faf.';function eK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(tK)&&Z.includes(" by faf"))}function $D($,Z,Q,z="project.faf",X={}){z6(cK($,"project.html"),t5(Z,Q,z),{root:$,format:"html",hasMark:eK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var ZD=dK(t5,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as RD}from"path";import{deprecate as ND}from"node:util";var U$="https://faf.one/ext/context/v1",e5="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 O2($,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 PQ="JSONRPC",QZ="1.0",C8=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],j8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",RQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",NQ="1.0",TQ="1.0",$Z={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function AQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function _2($,Z={}){let Q=AQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:QZ}];return[]}function QD($){try{return`https://${J$($)}/.well-known/fafa`}catch{return}}function zZ($,Z,Q={}){let z=S0(Z,Q),X=$.agent??{},U={fafaSpecVersion:String($.version??TQ),mediaTypes:[...C8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)U.agentId=X.id;let J=QD($);if(J)U.passport=J;return{uri:U$,description:"FAF passport and project DNA as typed parts",required:!1,params:U}}function zD($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&C8.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function w8($,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(),U=String(Q.description??"").trim(),J=String(Q.version??"").trim();if(!X||!U||!J)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let H=String(Q.vendor??"").trim(),V=String(Q.homepage??"").trim(),Y=H&&V?{organization:H,url:V}:void 0,G=($.capabilities??[]).map((W)=>{let q=String(W.name??"").trim();if(!q)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&C8.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:q,name:q,description:String(W.description??"").trim()||q,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:U,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:PQ,protocolVersion:String(W.version??QZ)})),...Y?{provider:Y}:{},version:J,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:zD($),defaultOutputModes:["text/plain","application/json"],skills:G}}var XD=["mcp","cli","library"],UD=/^[a-z0-9][a-z0-9._-]*$/,JD=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,HD=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,VD=/^[A-Za-z0-9][^\s]*$/,YD=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,GD=["a2a","mcp"],WD=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function R($){return String($??"").trim()}function A8($){return Array.isArray($)?$.map(R).filter(Boolean):[]}function qD($){return R($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function BD($,Z,Q){let z=["display_name","description","version"].filter((X)=>!R($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!UD.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!WD.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function KD($,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 DD($){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"&&!JD.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!HD.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z==="cargo"&&!YD.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"&&!VD.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 CQ($){if(/\s/.test($))return!1;try{let Z=new URL($);return(Z.protocol==="http:"||Z.protocol==="https:")&&Z.hostname!==""}catch{return!1}}function LD($){if(!CQ(R($.url)))throw Error(`Where it runs: "${R($.url)}" is not an http(s) URL (or give an npm package).`);if(!GD.includes(R($.protocol).toLowerCase()))throw Error(`Protocol "${R($.protocol)}": a2a or mcp.`)}function MD($){let Z=R($.package_kind).toLowerCase()||"mcp";if(!XD.includes(Z))throw Error(`Kind "${R($.package_kind)}" is not one faf knows: mcp, cli or library.`);return Z}function ID($,Z){let Q=($.endpoints??[]).filter((U)=>R(U.url));Q.forEach(LD);let z=MD($),X=[...Q.map((U)=>({protocol:R(U.protocol).toLowerCase(),transport:"http",location:R(U.url)})),...Z.map((U)=>({protocol:z,transport:"stdio",location:U.identifier}))];if(X.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return X}function OD($,Z,Q,z){let X={domain:Z},U=[["repository",R($.repository)],["icon",R($.icon)],["organizationUrl",R($.organization_url)]];for(let[H,V]of U)if(V)X[H]=V;if(Q.length)X.keywords=Q;let J=A8($.example_requests);if(J.length)X.examples=J;if(z.length)X.packages=z;return X}function jQ($){let Z=R($.handle).toLowerCase(),Q=qD($.domain);BD($,Z,Q);let z=A8($.tags),X=DD($),U=R($.homepage);if(U&&!CQ(U))throw Error(`Homepage: "${U}" is not an http(s) URL.`);let J={name:Z,displayName:R($.display_name),id:`urn:air:${Q}:agent:${Z}`,...R($.organization)?{vendor:R($.organization)}:{},version:R($.version),description:R($.description),homepage:U||`https://${Q}`,...R($.license)?{license:R($.license)}:{}};return{version:TQ,agent:J,capabilities:KD($,z),endpoints:ID($,X),metadata:{cards:OD($,Q,z,X)}}}function wQ($){return D2($,{lineWidth:0})}function J$($){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 SQ($){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 XZ($){return`${J$($).split(".").reverse().join(".")}/${SQ($)}`}function ZZ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function F2($){return($.endpoints??[]).filter((Z)=>R(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(R(Z.location))).map((Z)=>({type:"streamable-http",url:R(Z.location)}))}function _D($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function EQ($){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 U={name:XZ($),version:X,description:ZZ(z)},J=R(Z.displayName);if(J)U.title=ZZ(J);let H=R(Z.homepage);if(H)U.websiteUrl=H;let V=_D(R(Q.repository));if(V)U.repository=V;if(R(Q.icon))U.icons=[{src:R(Q.icon)}];return U}function bQ($){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 S8($){return($.endpoints??[]).some((Z)=>R(Z.protocol).toLowerCase()==="mcp")}function UZ($){return S8($)&&(F2($).length>0||bQ($).length>0)}function yQ($){let Z=R($.agent?.displayName);return{name:XZ($),...Z?{title:ZZ(Z)}:{}}}function E8($,Z,Q={}){let z=F2($);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:j8,...EQ($),remotes:z,...Z?{_meta:{"one.faf/context":S0(Z,Q)}}:{}}}function xQ($,Z,Q={}){let z=F2($),X=bQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");if(!S8($))throw Error("A registry entry describes an MCP server: the .fafa has no mcp endpoint.");return{$schema:RQ,...EQ($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:O2(Z,Q)}:{}}}function FD($,Z,Q){if(!Z.includes("a2a")||_2($,Q).length===0)return;return Q.a2aCardUrl??`https://${J$($)}/.well-known/agent-card.json`}function b8($,Z,Q={}){let z=J$($),X=SQ($),U=$.agent??{},J=R(U.displayName)||R(U.name),H=R(U.description),V=R(U.version),Y=Q.now??new Date().toISOString(),G=(K,L,B)=>({identifier:`urn:air:${z}:${K}:${X}`,displayName:J,type:L,description:H,url:B,...V?{version:V}:{},updatedAt:Y}),W=[],q=FD($,Z,Q);if(q)W.push(G("a2a",$Z.a2a,q));if(Z.includes("server_card")){let K=F2($)[0];if(K)W.push(G("mcp",$Z.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(G("agent",$Z.fafa,`https://${z}/.well-known/fafa`));return W}function y8($){let Z=$.agent??{},Q=R(Z.vendor)||R(Z.displayName)||R(Z.name);if(!Q)return;let z;try{z=J$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function gQ($,Z,Q={}){let z=y8($);return{specVersion:NQ,...z?{host:z}:{},entries:b8($,Z,Q)}}function JZ($){let Z=$.metadata?.cards??{},Q=A8(Z.keywords),z=A8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function vQ($,Z,Q={}){let z=y8($),X=JZ($);return{specVersion:NQ,...z?{host:z}:{},entries:b8($,Z,Q).map((U)=>({...U,...X}))}}function kQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:wQ($)},{faf:X}=Z;if(Q.has("a2a")){let J=[...Z.a2aExtensions??[],...X?[zZ($,X,Z)]:[]];z.a2a=w8($,{extensions:J})}if(Q.has("server_card"))z.server_card=E8($,X,Z);if(Q.has("server_json"))z.server_json=xQ($,X,Z);let U={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=gQ($,Z.cards,U);if(Q.has("ard"))z.ard=vQ($,Z.cards,U);return z}function PD($,Z){return kQ(jQ($),Z)}var TD=j8,AD=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function hQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&AD.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 CD($){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 X6($,Z={}){let Q={$schema:TD,name:hQ($),version:String($.project?.version??"0.1.0"),description:CD($)},z=x8($)??$.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 VZ($){return hQ($)}function x8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function jD($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var HZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function uQ($){let Z=jD($);return HZ(Z)&&HZ(Z._meta)&&HZ(Z._meta["one.faf/context"])}function wD($,Z,Q={},z={}){let X=X6(Z,Q),U=RD($,"server-card");return z6(U,`${JSON.stringify(X,null,2)}
250
+ `,{root:$,format:"json",hasMark:uQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),U}function SD($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return Q6($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var ED=ND(X6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as mQ}from"fs";import{basename as bD,dirname as pQ,join as fQ}from"path";import{deprecate as yD}from"node:util";var xD=["a2a","mcp","registry","catalog","ard"];function gD($){return f0(Q0(u(pQ($),bD($))))}function vD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=fQ($,z);if(mQ(X))return X}let Q=pQ($);if(Q!==$)for(let z of Z){let X=fQ(Q,z);if(mQ(X))return X}return null}function YZ($,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 w8($,{doorUrl:Q.doorUrl,extensions:Z?[zZ($,Z,Q)]:[]})}var kD=yD(YZ,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function hD($,Z={},Q={}){return b8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function uD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function mD($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:U,...J})=>({specVersion:U,host:{...Q},...J}))(z):z;for(let U of Z){let J=uD(X.entries,U);if(J>=0)X.entries[J]={...X.entries[J],url:U.url,type:U.type,...U.updatedAt?{updatedAt:U.updatedAt}:{}};else X.entries.push(U)}return X}var fD="no mcp endpoint in agent.fafa";function pD($){return $!==void 0&&!S8($)}function lD($){let Z=$.project?.type??$.app_type;return typeof Z==="string"&&Z.trim()!==""?Z.trim():void 0}function cD($,Z){if($===void 0||Z!==void 0)return!1;let Q=lD($);return Q!==void 0&&!/^mcp/i.test(Q)}function dD($,Z={}){return[..._2($,Z).length>0?["a2a"]:[],...F2($).length>0?["mcp"]:[],...UZ($)?["registry"]:[],"catalog","ard"]}function iD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=pD(z),U=$.targets?.filter((G)=>G==="mcp"||G==="registry")??[];if(X&&U.length)throw Error(`${U.join(", ")}: ${fD} — these cards describe an MCP server.`);let J=cD(Q,z),H=(Q?xD:z?dD(z,Z):[]).filter((G)=>!(X||J)||G!=="mcp"&&G!=="registry"),V=new Set($.targets?.length?$.targets:H),Y={};if(Q)Y.block=S0(Q,Z);if(V.has("mcp"))if(z&&F2(z).length>0)Y.mcp=E8(z,Q,Z);else if(Q)Y.mcp=X6(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(V.has("registry"))if(z&&UZ(z))Y.registry={...yQ(z),...Q?{_meta:O2(Q,Z)}:{}};else if(Q){let G=x8(Q);Y.registry={name:VZ(Q),...G?{title:G}:{},_meta:O2(Q,Z)}}else throw Error("A registry entry needs a package or a remote MCP URL in the .fafa, or a project.faf.");if(V.has("a2a")||V.has("catalog")||V.has("ard")){if(!$.fafa){if($.targets?.some((G)=>G==="a2a"||G==="catalog"||G==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(V.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 Y.a2a=YZ($.fafa,Q,Z);if((V.has("catalog")||V.has("ard"))&&$.fafa){let G=hD($.fafa,Q,Z);if(V.has("catalog"))Y.catalog=G;if(V.has("ard")){let q=JZ($.fafa);Y.ard=G.map((K)=>({...K,...q}))}let W=y8($.fafa);if(W)Y.catalogHost=W}return nD(Y),Y}function nD($){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((J)=>J.uri===U$);if(!z)throw Error("A2A card has no FAF context extension, but a project.faf was given");let X=z.params,U=$.block;if(X.provenance?.faf!==U.faf||X.provenance?.mediaType!==U.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var GZ=["ephemeral","standard","high","critical"],Z2=Object.fromEntries(GZ.map(($,Z)=>[$,Z])),g8=new Set(["user","feedback","project","reference"]),WZ=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),qZ=new Set(["facts","sessions","preferences","custom"]),BZ={low:"ephemeral",medium:"standard"};import{existsSync as rD}from"fs";import{dirname as rQ,resolve as sQ}from"path";function P2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function sD($){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 V$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function oD($){let Z=sQ($),Q=u(rQ(Z),Z,{read:!0});return{real:Q,text:Q0(Q)}}function lQ($,Z,Q,z){let X=sQ($),U=u(rQ(X),X),J=Q!==void 0&&Q.real===U;if(J&&Q.text===Z)return U;let H;try{H=w0(U)}catch{H=void 0}if(H&&H.equals(Buffer.from(Z,"utf-8")))return U;if(!J&&!z&&H)throw new S("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let V=J?Q.text:z?H:null;return $0($,Z,V===void 0?{}:{expect:V})}function Y$($){if(f($))return"standard";if(BZ[$])return BZ[$];if($ in Z2)return $;return"standard"}var aD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function KZ($){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(!aD.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:Y$(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 H$($){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 cQ($){let Z=$;return V$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&V$(Z.extra)&&typeof Z.priority==="string"?Z:KZ($)}function tD($){if(typeof $==="string"||V$($)&&"text"in $)return KZ($);return null}var dQ=["profile","namepoint","created","last_etched","retention"];class W0{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??P2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(cQ):[],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||d(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(!rD($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=oD($);return W0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=h5($,Z).toJS();if(!V$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${sD(z)}`);let X=new oQ,U=X.pick("memory",z.memory,h)??{},J=new W0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,U)});return(X.pick("memory.facts",U.facts,Array.isArray)??[]).forEach((H,V)=>{let Y=tD(H);if(Y)J.adopt(Y,V)}),J.last_etched=String(z.last_etched??J.created),J._version=f(z.version)?void 0:String(z.version),J._origin={path:Z,real:Q,text:$,base:J.state(),residual:X.residual},J.recordIndex(),J}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 W0.load($)}toDoc(){let $={facts:this._facts.map(H$),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!qZ.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(!WZ.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")&&d(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&&d(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),Y=lQ($,V,void 0,z);return this.settle($,V,new Map(this._facts.map((G,W)=>[G,W])),Y),$}let U=new Map,{text:J}=O8(X.text,(V)=>{U=this.applyTo(V,X,Q)},$),H=lQ($,J,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,J,U,H),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,U]of Q)this._factAt.set(X,U);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(H$(Z)))}return{top:Object.fromEntries(dQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),U=Z.path;for(let J of dQ)if(z.top[J]!==X.top[J])$.set(J,X.top[J]);if(!d(z.index,X.index)){if(Z.residual.has("index")&&!Q)W0.refuse(Z,"index","replace it");F8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,U)}for(let J of nQ(z.extra,X.extra))F8($,[J],z.extra[J],X.extra[J],U);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...nQ(Q.memoryExtra,z.memoryExtra).map((U)=>[U,Q.memoryExtra[U],z.memoryExtra[U]])];for(let[U,J,H]of X){if(d(J,H))continue;if(Z.residual.has("memory"))W0.refuse(Z,"memory",`change memory.${U}`);if(Z.residual.has(`memory.${U}`))W0.refuse(Z,`memory.${U}`,"replace it");F8($,["memory",U],J,H,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(([,Y])=>Y)),U=[...Z.base.facts.keys()].filter((Y)=>!X.has(Y)).sort((Y,G)=>G-Y),J=Q.filter(([Y,G])=>!d(Z.base.facts.get(G),H$(Y))),H=new Map(Q);if(z.length===0&&U.length===0&&J.length===0)return H;for(let Y of["memory","memory.facts"])if(Z.residual.has(Y))W0.refuse(Z,Y,"add facts to it");let V=c9($,["memory","facts"],Z.path);for(let[Y,G]of J)V.items[G]=$L($,V.items[G],Z.base.facts.get(G),H$(Y));for(let Y of U)V.items.splice(Y,1);for(let[Y,G]of Q)H.set(Y,G-U.filter((W)=>W<G).length);for(let Y of z)H.set(Y,V.items.length),V.items.push($.createNode(H$(Y)));return H}add($){let Z=cQ($);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(eD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:Y$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:P2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=V$($)?{...$,...Z}:Z,z=V$($)?$.query:$,X=Z2[Y$(Q.minPriority??"ephemeral")]??0,U=typeof z==="string"?z.toLowerCase():"",J=new Set(Q.tags??[]),H=[];this._facts.forEach((Y,G)=>{if(U&&!String(Y.text??"").toLowerCase().includes(U))return;if(J.size>0&&![...J].some((W)=>(Y.tags??[]).includes(W)))return;if(!f(Q.type)&&Y.type!==Q.type)return;if((Z2[Y.priority]??1)<X)return;H.push([G,Y])}),H.sort((Y,G)=>{let W=Z2[Y[1].priority]??1,q=Z2[G[1].priority]??1;if(q!==W)return q-W;let K=Y[1].timestamp??"",L=G[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return G[0]-Y[0]});let V=H.map(([,Y])=>Y);if(!f(Q.limit))return V.slice(0,Q.limit);return V}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 eD($,Z,Q){let z=(X,U)=>f(X)?U:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:Y$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:P2(),extra:{...$.extra}}}class oQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,Q$(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,h)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,h)??{}),extra:iQ($,WZ),memoryExtra:iQ(Z,qZ)}}}function iQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function nQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function $L($,Z,Q,z){if(!c(Z))return $6($,Z,Q,z);let X=(U)=>typeof U==="string"?{text:U}:U;return $6($,Z,X(Q),X(z))}import{readdirSync as ZL,readFileSync as QL,statSync as aQ,existsSync as zL}from"fs";import{join as XL,basename as tQ,resolve as UL}from"path";var eQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),JL=/\[\[([^\]]+)\]\]/g;function HL($){let Z=aQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function VL($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=f0(Z[1]);if(!Q||typeof Q!=="object")return{fm:null,body:Z.slice(2).join("---").trim()};return{fm:Q,body:Z.slice(2).join("---").trim()}}catch{return{fm:null,body:$}}}function YL($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!g8.has(X))return null;let U=String(Q.name).trim(),H=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||U,V={};if(z.originSessionId)V.provenance=[`session:${z.originSessionId}`];let Y=[...new Set([...Z.matchAll(JL)].map((G)=>G[1]))].sort();return{text:H,id:U,type:X,priority:"standard",tags:[],links:Y,timestamp:HL($),source:`claude-code memory: ${tQ($)}`,extra:V}}function $3($,Z={}){let Q=UL($);if(!zL(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!aQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??eQ,X=Z.namepoint??`@claude-code:${tQ(Q)}`,U=[],J=ZL(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of J){if(z.has(W))continue;let q=XL(Q,W),K;try{K=QL(q,"utf-8")}catch{continue}let{fm:L,body:B}=VL(K);if(!L)continue;let D=YL(q,B,L);if(D)U.push(D)}let H=U.map((W)=>W.timestamp).filter(Boolean),V=H.length?H.reduce((W,q)=>W<q?W:q):P2(),Y=H.length?H.reduce((W,q)=>W>q?W:q):V,G=new W0(X,{profile:"knowledge",facts:U,created:V});return G.last_etched=Y,G.rebuildIndex(),G}var z3="faf-interview/1",G$="(one line, every word earns its place)",DZ=[{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,help:"one sentence: what it does, and for whom"},{path:"human_context.who",question:`Who is this for? ${G$}`,header:"Who",type:"text",required:!0,help:"the people who use it, not the author"},{path:"human_context.what",question:`What are they building? ${G$}`,header:"What",type:"text",required:!0,help:"what they make or do with it"},{path:"human_context.why",question:`Why does it exist? ${G$}`,header:"Why",type:"text",required:!0,help:"the problem it removes"},{path:"human_context.where",question:`Where does it run or ship? ${G$}`,header:"Where",type:"text",required:!0,help:"where it runs or ships: platform, store, registry"},{path:"human_context.when",question:`When — what stage is it at, and since when? ${G$}`,header:"When",type:"text",required:!0,help:"the stage it is at, and since when"},{path:"human_context.how",question:`How does it work? ${G$}`,header:"How",type:"text",required:!0,help:"the mechanism, and the choice that shapes the code"}],X3=[{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}],W$=[...DZ,...X3],U3=new Map(W$.map(($)=>[$.path,$])),GL=Object.fromEntries(W$.map(($)=>[$.path,$]));function LZ($){let Z=U3.get($);if(Z)return Z.question;let Q=g0.get($)??p.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function WL($,Z){return W$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let U of z)if(X&&typeof X==="object"&&U in X)X=X[U];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var qL=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"]),BL=[["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]],KL=($)=>qL.has($.toLowerCase().trim()),DL=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i,LL=12;function ML($){let Z=$.trim().split(/\s+/).filter(Boolean);if(Z.length>LL)return"";while(Z.length&&DL.test(Z[Z.length-1].replace(/[.,;:]+$/,"")))Z.pop();return Z.join(" ")}function J3($){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=ML(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!KL(X))Z.what=X;let U=BL.filter(([,J])=>J.test(Q)).map(([J])=>J);if(U.length)Z.where=U.slice(0,4).join(", ");return Z}function Z3($,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 Q3($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!l(Z)}function IL($,Z={}){let Q=$&&typeof $==="object"?$:{},z=Z3(Q,"project.goal"),X=(Q3(z)?String(z).trim():"")||(Z.goal??"").trim(),U=J3(X),J=Z.detailed??{},H={"project.goal":X||void 0,"human_context.what":U.what,"human_context.where":U.where,"human_context.who":U.who},V=(K)=>{let L=H[K];if(L)return{value:L,source:"project goal",confidence:0.9};let B=K.startsWith("human_context.")?K.slice(14):"",D=B?J[B]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},Y=DZ.map((K,L)=>{let B={n:L+1,path:K.path,header:K.header,question:K.question},D=Z3(Q,K.path);if(Q3(D))return{...B,value:String(D).trim(),status:"filled",seeded:!1};let I=V(K.path);if(I)return{...B,value:I.value,status:"seeded",seeded:!0,source:I.source,confidence:I.confidence};return{...B,value:"",status:"empty",seeded:!1}}),G=Y.filter((K)=>K.status==="filled").length,W=Y.filter((K)=>K.status==="seeded").length,q=Y.filter((K)=>K.status==="empty").length;return{version:z3,rows:Y,filledCount:G,seededCount:W,emptyCount:q,complete:q===0}}function v8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||l(Z)}return!1}function OL($,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 H3($){if($==="project.goal")return!0;return g0.get($)?.category==="human"}function V3($,Z=v8){let Q=[],z=[];for(let X of W$){let U=OL($,X.path);if(U==="slotignored")continue;if(!Z(U))continue;(H3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function Y3($,Z,Q=v8){let z=V3(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let U=X==="needs-human"?MZ(z):[];return{status:X,score:$,gaps:z,ask:U}}function MZ($){return $.human.map((Z)=>({path:Z,question:LZ(Z)}))}function _L($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??v8,X=[],U=0;for(let H=0;H<=Q;H++){let V=$.read();if(!V)return{status:"no-faf",score:0,rounds:U,history:X,ask:[]};let Y=$.score(V.yaml);X.push(Y);let G=Y3(Y,V.data,z);if(G.status==="done")return{status:"done",score:Y,rounds:U,history:X,ask:[]};if(G.status==="needs-human")return{status:"needs-human",score:Y,rounds:U,history:X,ask:G.ask};if(X.length>=2&&Y<=X[X.length-2])return G.gaps.human.length?{status:"needs-human",score:Y,rounds:U,history:X,ask:MZ(G.gaps)}:{status:"stuck",score:Y,rounds:U,history:X,ask:[]};if(U>=Q)return{status:"capped",score:Y,rounds:U,history:X,ask:MZ(G.gaps)};$.runAuto(),U++}return{status:"capped",score:X[X.length-1]??0,rounds:U,history:X,ask:[]}}import{createHash as W3}from"crypto";var IZ="faf-bench/1",FL={"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 stage is it at, and since when?","human_context.how":"How does it work?"};function PL($,Z){return FL[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var q3=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],U6=new Map;q3.forEach(($,Z)=>$.forEach((Q)=>U6.set(Q,Z)));var RL=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function k8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function G3($){return k8($).split(" ").filter((Z)=>Z&&!RL.has(Z))}function B3($,Z){let Q=k8($),z=k8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=U6.get(Q);if(X!==void 0&&U6.get(z)===X)return!0;let U=G3($);if(U.length===0)return!1;let J=new Set(G3(Z));return U.every((H)=>{if(J.has(H))return!0;let V=U6.get(H);return V!==void 0&&[...J].some((Y)=>U6.get(Y)===V)})}function NL($){let Z=K4($),Q=f0($),z=[],X={},U=0;for(let V of p){if(Z.slots[V.path]!=="populated")continue;let Y=oZ(Q,V);if(typeof Y!=="string")continue;let G=Y.trim();if(!G||O6.has(G.toLowerCase()))continue;U+=1,z.push({n:U,path:V.path,question:PL(V.path,V.description)}),X[U]=G}let J=JSON.stringify({v:IZ,q:z.map((V)=>[V.path,V.question])}),H=W3("sha256").update(J).digest("hex").slice(0,12);return{version:IZ,qsetHash:H,questions:z,answers:X}}function TL($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function AL($,Z){let Q=$.questions.map((X)=>{let U=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof U==="string"&&U.trim()!==""&&B3($.answers[X.n],U)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function CL($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:W3("sha256").update(Q).digest("hex")}}import{join as $I,extname as ZI,resolve as QI}from"path";var OZ={"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 wL}from"path";var q$={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 SL=q$.flutterDeps,EL=q$.mcpDeps,bL=q$.serverFrameworks,yL=q$.stateManagement,xL=q$.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 h8($){let Z=j($,"pubspec.yaml");if(Z===null)return null;let Q=gL(Z),z=(O)=>Q.has(O.toLowerCase()),X=SL.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),U=EL.find(z),J=bL.find(([O])=>z(O)),H=yL.find(([O])=>z(O)),V=H?H[1]:"",Y=xL.find(([O])=>z(O)),G=Y?Y[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",q=/^executables:\s*$/m.test(Z),K=(k($,"bin")??[]).some((O)=>O.name.endsWith(".dart")),L=q||K,B,D="",I;if(X)if(D="Flutter",M($,wL("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))B="mobile",I="pubspec.yaml (Flutter app)";else B="library",I="pubspec.yaml (Flutter package)";else if(U)B="mcp",I=`pubspec.yaml + ${U} (Dart MCP server)`;else if(J)B="backend",D=J[1],I=`pubspec.yaml + ${J[0]} (Dart backend)`;else if(L)B="cli",I=q?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else B="library",I="pubspec.yaml (Dart package)";return{appType:B,isFlutter:X,framework:D,stateManagement:V,routing:G,testing:W,found:I}}import{join as kL}from"path";var u8={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 hL=u8.mcpModules,uL=u8.serverFrameworks,mL=u8.cliFrameworks;function fL($){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 J=X.match(/^(\S+)/);if(J)Z.add(J[1].toLowerCase());continue}let U=X.match(/^require\s+(\S+)/);if(U&&U[1]!=="(")Z.add(U[1].toLowerCase())}return Z}function D3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function K3($,Z){let Q;for(let z of Z){if(!D3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function pL($,Z){let Q;for(let z of Z){if(!D3($,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 cL($){for(let{name:Z}of k($,"cmd")??[]){let Q=kL("cmd",Z),z=I0($,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 dL($){let Z=j($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function m8($){let Z=j($,"go.mod");if(Z===null)return null;let Q=lL(Z),z=fL(Z),X=pL(z,hL),U=K3(z,uL),J=K3(z,mL),H=cL($),V=dL($),Y,G="",W;if(X)Y="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(U)Y="backend",G=U[1],W=`go.mod + ${U[0]} (Go backend)`;else if(J)Y="cli",G=J[1],W=`go.mod + ${J[0]} (Go CLI)`;else if(H)Y="cli",W="go.mod + cmd/ (Go CLI layout)";else if(V&&!U)Y="cli",W="go.mod + main.go package main (Go CLI)";else Y="library",W="go.mod (Go module)";return{appType:Y,modulePath:Q,framework:G,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 nL=R2.mcpPackages.map(($)=>$.toLowerCase()),rL=R2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),sL=R2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),oL=R2.grpcServerPackages.map(($)=>$.toLowerCase()),aL=R2.specializedSdks,L3=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(),U=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],H=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||U||"").trim(),V=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),Y=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),G=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),q=new Set;for(let L of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))q.add(L[1].toLowerCase());for(let L of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))q.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:H,isTestProject:V,useMaui:Y,useWpf:G,useWindowsForms:W,packages:q,frameworkRefs:K}}function _Z($,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 M3($,Z){let Q;for(let[z,X]of Z){if(!_Z($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function eL($){let Z;for(let Q of nL){if(!_Z($,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 $M($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of aL){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function f8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function ZM($,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 QM($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:U,outputType:J}=$,H,V="",Y,G=eL(X),W=$M(z),q=M3(X,sL),K=M3(X,rL),L=oL.some((D)=>_Z(X,D)),B=U.has("microsoft.aspnetcore.app");if(G)H="mcp",V="MCP",Y=`${Z} + ${G} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||q)H="library",V=q?.[1]||(W?.[1]==="test"?W[2]:"Test"),Y=`${Z} + test (${V})`;else if($.useMaui)H="mobile",V="MAUI",Y=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)H="backend",V=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",Y=`${Z} + ${V}`;else if(W?.[1]==="web")H="backend",V=L?"gRPC":W[2],Y=`${Z} + Sdk=${W[0]}${L?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")H="library",V=W[2],Y=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(B&&f8(J))H="backend",V="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(B&&!f8(J))H="library",V="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(f8(J)||!J))H="cli",V=K[1],Y=`${Z} + ${K[0]} (C# CLI)`;else if(f8(J))H="cli",Y=`${Z} + OutputType=Exe (C# console)`;else{H="library";let D=z?` Sdk=${z}`:"";if(Y=`${Z}${D} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===L3||z.toLowerCase().startsWith(`${L3}/`))Y=`${Z} (C# class library)`}return{appType:H,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:V,found:Y}}function B$($){return(k($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function p8($){let Z=B$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let U=j($,X);if(U===null)continue;let J=tL(U),H=QM(J,X),V=ZM(H.appType,H.framework);if(!Q||V<z)Q=H,z=V}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 XM=_0.mcpArtifacts.map(($)=>$.toLowerCase()),UM=_0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),JM=_0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),HM=_0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),VM=_0.androidPlugins.map(($)=>$.toLowerCase()),YM=_0.kmpPlugins.map(($)=>$.toLowerCase()),GM=_0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),WM=_0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),qM=_0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),BM=_0.libraryPlugins.map(($)=>$.toLowerCase()),KM=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function FZ($){return KM.some((Z)=>M($,Z))}function DM($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
253
+ `)){let U=X.replace(/#.*$/,"").trim();if(!U)continue;let J=U.match(/^\[([^\]]+)\]$/);if(J){z=J[1].trim().toLowerCase();continue}let H=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(H&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(H[1].replace(/-/g,".").toLowerCase(),H[2].toLowerCase()),Z.set(H[1].toLowerCase(),H[2].toLowerCase());continue}let V=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=V[1].toLowerCase();Q.set(W,V[2].toLowerCase()),Q.set(W.replace(/-/g,"."),V[2].toLowerCase());continue}let Y=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(Y&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${Y[2]}:${Y[3]}`.toLowerCase(),q=Y[1].toLowerCase();Q.set(q,W),Q.set(q.replace(/-/g,"."),W);continue}let G=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(G){let W=G[1].toLowerCase(),q=G[2];if(z==="plugins"||z.endsWith(".plugins")){let K=q.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=q.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 LM($){let Z=j($,N2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return DM(Z)}function MM($){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 IM($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let U=X.replace(/\/\/.*$/,"").trim();if(!U||U.startsWith("id")||U.startsWith("kotlin")||U.startsWith("alias"))continue;let J=U.match(/^`([a-zA-Z0-9.-]+)`$/)||U.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(J)Q.add(J[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),U=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(U)Q.add(U);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function OM($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let U=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let J of U){let H=Z.libraries.get(J);if(H){Q.add(H.includes(":")?H.split(":").slice(0,2).join(":"):H);break}}}return Q}function _3($){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 J=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),H=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&H)Q.add(`${J}:${H}`.toLowerCase())}let X=new Set;for(let J of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let H=J[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),V=J[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(H&&V)X.add(`${H}:${V}`.toLowerCase())}let U=[];for(let J of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))U.push(J[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:U}}function Q2($,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 J6($,Z,Q){let z;for(let[X,U]of Z){let J=!1;if(Q==="plugin")J=Q2($,X);else if(J=$.has(X)||[...$].some((H)=>H===X||H.startsWith(`${X}:`)||H.startsWith(`${X}.`)),!J&&Q==="artifact")J=[...$].some((H)=>H===X||H.startsWith(`${X}`));if(!J)continue;if(!z||X.length>z[0].length)z=[X,U]}return z}function _M($){let Z;for(let Q of XM)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 F3($,Z){let Q=new Set,z=!1,X=!1,U=[N2(Z,"src"),N2(Z,"src","main")],J=(H,V)=>{if(V>4)return;let Y=k($,H);if(!Y)return;for(let{name:G}of Y){if(G==="androidMain"||G==="commonMain"||G==="jvmMain"||G==="iosMain")Q.add(G);let W=N2(H,G),q=I0($,W);if(!q)continue;if(q.isDirectory())J(W,V+1);else if(G.endsWith(".kt")||G.endsWith(".kts"))z=!0;else if(G.endsWith(".java"))X=!0}};for(let H of U)J(H,0);return{kotlin:z,java:X,hints:Q}}function FM($){let Z=[],Q=$.plugins,z=$.artifacts,X=YM.some((P)=>Q2(Q,P))||$.sourceHints.has("commonMain"),U=Q2(Q,"com.android.application"),J=!U&&VM.some((P)=>Q2(Q,P));if(U||J)Z.push("android");if(X)Z.push("multiplatform");let H=_M(z),V=J6(Q,UM,"plugin"),Y=J6($.parents,JM,"parent"),G=J6(z,HM,"artifact"),W=J6(Q,WM,"plugin"),q=J6(z,qM,"artifact"),K=BM.some((P)=>Q2(Q,P)),L=$.packaging==="pom",B,D="",I;if(U)B="mobile",D=X?"Android+KMP":"Android",I=`${$.path||"root"} + com.android.application (${D})`;else if(H)B="mcp",D="MCP",Z.push("mcp"),I=`${$.path||"root"} + ${H} (JVM MCP server)`;else if(V||Y||G){B="backend",D=V?.[1]||Y?.[1]||G?.[1]||"JVM";let P=V?.[0]||Y?.[0]||G?.[0]||"web";I=`${$.path||"root"} + ${P} (JVM backend)`}else if(X&&!J)B="library",D="Kotlin Multiplatform",I=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(J)B="library",D=X?"Android+KMP":"Android",I=`${$.path||"root"} + android library (${D})`;else if(q||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)B="cli",D=q?.[1]||"application",I=q?`${$.path||"root"} + ${q[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)B="cli",D="application",I=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)B="library",I=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{B="library";let P=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(I=`${$.path||"root"} (${P} library)`,K)I=`${$.path||"root"} + java-library (JVM library)`}let O="Java";if($.kotlinSources&&$.javaSources)O="Java/Kotlin";else if($.kotlinSources||GM.some((P)=>Q2(Q,P))||X)O="Kotlin";let C=[...new Set(Z)];return{appType:B,framework:D,facets:C,found:I,buildTool:$.buildTool,mainLanguage:O}}function PM($,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 I3($,Z,Q){let z=N2(Z,"build.gradle.kts"),X=N2(Z,"build.gradle"),U=M($,z)?z:M($,X)?X:null;if(!U)return null;let J=j($,U);if(!J)return null;let H=IM(J,Q),V=OM(J,Q),Y=F3($,Z),G=/mainClass\s*[.=]/.test(J)||/mainClassName\s*=/.test(J)||/Main-Class/.test(J),W=Q2(H,"application")||Q2(H,"org.gradle.application");return{path:Z||"build.gradle",plugins:H,artifacts:V,packaging:"jar",parents:new Set,hasMainClass:G,hasApplicationPlugin:W,sourceHints:Y.hints,kotlinSources:Y.kotlin||U.endsWith(".kts"),javaSources:Y.java,buildTool:"gradle"}}function O3($,Z){let Q=j($,N2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:U}=_3(Q),J=F3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:U,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:J.hints,kotlinSources:J.kotlin,javaSources:J.java,buildTool:"maven"}}function H6($){if(!FZ($))return null;let Z=LM($),Q=[],z=null;for(let Y of["settings.gradle.kts","settings.gradle"])if(M($,Y)){z=j($,Y);break}let X=z?MM(z):[],U=I3($,"",Z);if(U)Q.push(U);for(let Y of X){let G=I3($,Y,Z);if(G)Q.push(G)}let J=O3($,"");if(J){Q.push(J);let Y=j($,"pom.xml");if(Y){let{modules:G}=_3(Y);for(let W of G){let q=O3($,W);if(q)Q.push(q)}}}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 H=null,V=999;for(let Y of Q){let G=FM(Y),W=PM(G.appType,G.facets);if(!H||W<V)H={appType:G.appType,framework:G.framework,buildTool:G.buildTool,mainLanguage:G.mainLanguage,facets:G.facets,found:G.found},V=W}if(H&&X.length>0&&!H.found.includes("multi-project"));return H}import{join as NM}from"path";var V6={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 TM=V6.mcpGems.map(($)=>$.toLowerCase()),AM=V6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),P3=V6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),CM=V6.railsLayoutFiles;function jM($){return M($,"Gemfile")||M($,"gems.rb")||wM($)}function wM($){return(k($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function SM($){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 EM($){let Z=new Set,Q=!1;for(let z of $.split(`
255
+ `)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let U=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(U)Z.add(U[1].toLowerCase())}}return Z}function bM($){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 yM($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let U=j($,X);if(U){for(let J of SM(U))Z.add(J);Q.push(X)}}let z=j($,"Gemfile.lock")||j($,"gems.locked");if(z){for(let X of EM(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of k($)??[]){if(!X.endsWith(".gemspec"))continue;let U=j($,X);if(U){for(let J of bM(U))Z.add(J);Q.push(X)}}return{gems:Z,sources:Q}}function Y6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function PZ($,Z){let Q;for(let[z,X]of Z){if(!Y6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function xM($){let Z;for(let Q of TM)if(Y6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function R3($){for(let Z of CM)if(M($,Z))return Z;return}function gM($,Z){let Q=PZ(Z,P3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of k($)??[]){if(!X.endsWith(".gemspec"))continue;let U=j($,X);if(U&&/executables\s*=/.test(U)&&!/executables\s*=\s*\[\s*\]/.test(U))return{hit:!0,why:`${X} executables`}}let z=k($,"bin");if(z){let U=z.map((J)=>J.name).filter((J)=>{if(J==="setup"||J==="console"||J==="rake")return!1;return I0($,NM("bin",J))?.isFile()===!0}).filter((J)=>J!=="rails");if(U.length>0&&!Y6(Z,"rails")&&!R3($))return{hit:!0,why:`bin/${U[0]}`}}return{hit:!1,why:""}}function l8($){if(!jM($))return null;let{gems:Z,sources:Q}=yM($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",U=xM(Z),J=PZ(Z,AM),H=R3($),V=Y6(Z,"rails")||Y6(Z,"railties"),Y=gM($,Z),G=M($,"config.ru"),W=V||!!H,q=J&&J[1]!=="Rails"&&!(J[0]==="rack"&&!G)?J:void 0,K,L="",B;if(U)K="mcp",L="MCP",B=`${z} + gem ${U} (Ruby MCP)`;else if(W)if(K="backend",L="Rails",V&&H)B=`${z} + rails + ${H} (Rails)`;else if(V)B=`${z} + gem rails (Rails)`;else B=`${H} (Rails layout)`;else if(q)K="backend",L=q[1],B=`${z} + gem ${q[0]} (Ruby backend)`;else if(Y.hit)K="cli",L=PZ(Z,P3)?.[1]||"",B=`${z} + ${Y.why} (Ruby CLI)`;else K="library",B=`${z} (Ruby library)`;return{appType:K,framework:L,packageManager:X,found:B}}import{join as kM}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 hM=E0.mcpPackageUrls.map(($)=>$.toLowerCase()),uM=E0.mcpProducts.map(($)=>$.toLowerCase()),mM=E0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),fM=E0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),pM=E0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),lM=E0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),cM=E0.appProductTypes,dM=E0.cliProductTypes,iM=E0.vaporLayoutFiles;function nM($){return M($,"Package.swift")||RZ($).length>0}function RZ($){return(k($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&I0($,Z)?.isDirectory()===!0)}function rM($){let Z=sM($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,U;while((U=X.exec(Z))!==null)z.push(U[1]);let J=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((U=J.exec(Z))!==null)z.push(U[1]);let H=[],V=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((U=V.exec(Z))!==null)H.push(U[1]);let Y=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((U=Y.exec(Z))!==null)H.push(U[1]);let G=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),q=/\.plugin\s*\(/.test(Q)&&!G&&!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:H,hasLibraryProduct:G,hasExecutableProduct:W,hasPluginProduct:!!q,hasExecutableTarget:K,hasLibraryTarget:L}}function sM($){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 oM($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z.length))z=X;return z}function N3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)for(let J of Q)if(J.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function T3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function aM($){let Z=$.map((Q)=>Q.toLowerCase());return uM.some((Q)=>Z.includes(Q))}function tM($){let Z=!1,Q=!1,z;for(let X of RZ($)){let U=j($,kM(X,"project.pbxproj"));if(!U)continue;for(let J of cM)if(U.includes(J))Z=!0,z=J;for(let J of dM)if(U.includes(J)){if(Q=!0,!z)z=J}}return{hasApplication:Z,hasTool:Q,hit:z}}function eM($){for(let Z of iM)if(M($,Z))return Z;return}function G6($){if(!nM($))return null;let Z=M($,"Package.swift"),Q=RZ($),z=Q.length>0,X=null;if(Z){let F=j($,"Package.swift");if(F)X=rM(F)}let U=z?tM($):{hasApplication:!1,hasTool:!1},J=eM($),H=X?.packageUrls??[],V=X?.productNames??[],Y=oM(H,hM),G=aM(V),W=N3(H,mM),q=T3(V,fM),K=N3(H,pM),L=T3(V,lM),B=!!(Y||G),D=!!(W||q||J),I=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),O=!!(K||L),C=U.hasApplication,P=Z&&z?"spm+xcode":Z?"spm":"xcode",N,T="",w;if(B)if(N="mcp",T="MCP",G)w="Package.swift + product MCP (Swift MCP)";else w=`Package.swift + ${Y} (Swift MCP)`;else if(D)if(N="backend",T=q?.[1]||W?.[1]||(J?"Vapor":""),q)w=`Package.swift + product ${q[1]} (Swift backend)`;else if(W)w=`Package.swift + ${W[1]} (Swift backend)`;else w=`${J} (Swift backend layout)`;else if(C)N="app",T="",w=`${Q[0]} + ${U.hit||"application"} (Swift app)`;else if(O||I&&!D&&!B)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(U.hasTool&&!Z)N="cli",w=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(N="library",X?.hasLibraryProduct)w="Package.swift + .library product (Swift library)";else w="Package.swift (Swift library)";else N="library",w=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:N,framework:T,packageManager:P,found:w}}var zI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),XI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),UI={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 HI($,Z){for(let[Q,z]of JI)if(Q in $)return z;return Z.length>0?"framework":"config"}function VI($,Z){try{let Q=JSON.parse(j($,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 YI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return I0($,Z.name)?.isFile()===!0}function GI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return I0($,Z.name)?.isDirectory()===!0}function WI($){let Z=[],Q=QI($),z=new Set,X=k(Q);if(!X)return Z;for(let U of X){let J=U.name;if(J.endsWith(".xcodeproj")?!GI(Q,U):!YI(Q,U))continue;if(J.toLowerCase().endsWith(".csproj")){let V=p8(Q);if(V){let Y={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="mobile"&&V.framework)Y.framework=V.framework;if(V.targetFramework)Y.runtime=V.targetFramework;let G=V.framework?[V.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:Y,priority:36,frameworks:G,fileName:J})}continue}if(J.endsWith(".xcodeproj")){let V=G6(Q);if(V){let Y={mainLanguage:"Swift",packageManager:V.packageManager==="spm"?"spm":"Xcode",buildTool:V.packageManager.includes("spm")?"swift build":"xcodebuild"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="app"&&V.framework)Y.framework=V.framework;let G=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:Y,priority:36,frameworks:G,fileName:J})}continue}let H=OZ[J];if(!H)continue;if(J==="manifest.json"&&VI(Q,J)!=="chrome")continue;if(J==="pubspec.yaml"){let V=h8(Q);if(V){let Y={mainLanguage:"Dart",packageManager:"pub"};if(V.isFlutter){if(Y.framework="Flutter",V.stateManagement)Y.stateManagement=V.stateManagement}else if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";Z.push({slots:Y,priority:H.priority,frameworks:V.isFlutter?["Flutter","Dart"]:["Dart"],fileName:J});continue}}if(J==="go.mod"){let V=m8(Q);if(V){let Y={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";let G=V.framework?[V.framework,"Go"]:["Go"];Z.push({slots:Y,priority:H.priority,frameworks:G,fileName:J});continue}}if(J==="Gemfile"||J==="Gemfile.lock"||J==="gems.rb"){let V=l8(Q);if(V){let Y={mainLanguage:"Ruby",packageManager:V.packageManager};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";let G=V.framework?[V.framework,"Ruby"]:["Ruby"];Z.push({slots:Y,priority:H.priority??35,frameworks:G,fileName:J});continue}}if(J==="Package.swift"){let V=G6(Q);if(V){let Y={mainLanguage:"Swift",packageManager:V.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="app"&&V.framework)Y.framework=V.framework;let G=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:Y,priority:H.priority??36,frameworks:G,fileName:J});continue}}if(J==="pom.xml"||J==="build.gradle"||J==="build.gradle.kts"||J==="settings.gradle"||J==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let V=H6(Q);if(V){let Y={mainLanguage:V.mainLanguage==="Java/Kotlin"?"Kotlin":V.mainLanguage,packageManager:V.buildTool==="maven"?"maven":"gradle",buildTool:V.buildTool};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="mobile")Y.framework=V.framework||"Android";if(V.facets.includes("multiplatform"))Y.framework=V.framework||"Kotlin Multiplatform";let G=V.framework?[V.framework,"JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:Y,priority:H.priority??35,frameworks:G,fileName:J});continue}}Z.push({slots:H.slots||{},priority:H.priority,frameworks:H.frameworks,fileName:J})}return Z}function qI($){let Z=[];for(let Q of $$($,()=>C3($,2,{count:0}))){let z=OZ[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function A3($){let Z=[...WI($),...qI($)],Q={},z={},X=new Set;for(let Y of Z){Y.frameworks.forEach((G)=>X.add(G));for(let[G,W]of Object.entries(Y.slots))if(W&&!W.includes("/")&&(!(G in Q)||Y.priority>z[G]))Q[G]=W,z[G]=Y.priority}let U=new Map;for(let Y of Z){if(!Y.fileName)continue;if(!U.has(Y.fileName))U.set(Y.fileName,{fileName:Y.fileName,category:HI(Y.slots,Y.frameworks),priority:Y.priority})}let J=[...U.values()].sort((Y,G)=>G.priority-Y.priority||Y.fileName.localeCompare(G.fileName)),H=[];if(Q.mainLanguage)H.push(Q.mainLanguage.toLowerCase());if(Q.framework)H.push(Q.framework.toLowerCase());let V=H.length>0?H.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:J,stackSignature:V}}function c8($){let{slotFills:Z}=A3($),Q={};for(let[z,X]of Object.entries(Z)){let U=UI[z];if(!U||!X)continue;let[J,H]=U;if(J==="project")(Q.project??={})[H]=X;else(Q.stack??={})[H]=X}return Q}function C3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=k($);if(!X)return z;for(let U of X){if(Q.count++>400)break;if(!U.isDirectory()){let J=ZI(U.name);if(XI.has(J))z.add(J);continue}if(zI.has(U.name)||U.name.startsWith("."))continue;for(let J of C3($I($,U.name),Z-1,Q))z.add(J)}return z}var J0={goal:["use\\s+cases?","goals?"],what:["description","overview","purpose","introduction","what","what\\s+is\\s+(?!new\\b)\\S+","what\\s+it\\s+does"],who:["audience","target\\s+audience","for\\s+whom","who","who\\s+is\\s+(?:this|it)\\s+for","who\\s+it.s\\s+for"],why:["why","why\\s+(?:use\\s+)?(?!not\\b)\\S+","motivations?","(?:the\\s+)?problem","rationale","mission","vision"],where:["deployment","where","where\\s+it\\s+runs","hosting","platforms","supported\\s+platforms","platform\\s+support"],when:["status","(?:project|current)\\s+status","timeline","since","launched"],how:["architecture","how","how\\s+it\\s+works","how\\s+does\\s+it\\s+work","under\\s+the\\s+hood","internals","approach","methodology"]},K$={MIN_LENGTH:8,MAX_LENGTH:280},BI=[/^(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,/^(welcome|hello|hi|thanks|thank\s+you)\b/i,/\bwelcome[.!]?$/i,/^(copyright\b|\(c\)|©)/i,/\ball\s+rights\s+reserved\b/i,/^(?:(?:dual-)?licen[cs]ed\s+under|permission\s+is\s+hereby)\b/i,/\b(npm|pnpm|yarn|bun)\s+(i|install|add)\s|\bpip3?\s+install\s|\bcargo\s+(add|install)\s|\bgo\s+(get|install)\s|\bbrew\s+install\s/i,/^please\b/i,/\bto get started\b|\bread the (docs|documentation|guide)\b|\bstart with the (docs|documentation|guide)\b|\bread the announcement\b|\bcheck out (the|our)\b/i,/^["“'‘][\s\S]*["”'’]$/,/\?$/,/(&mdash;|&ndash;|[—–,;]|\s-)\s*$/,/^(the\s+)?mono-?repo\s+(for|of|containing|with)\b/i,/\bmono-?repo(\s+root)?\.?$/i,/[a-z]{2,}\.[A-Z][a-z]{2,}/,/^#{1,6}\s/,/\*\*[^*\n]{1,30}:\*\*[\s\S]*\*\*[^*\n]{1,30}:\*\*/];function j3($){return KI.some((Z)=>Z.test($))}var KI=[/\b(no longer (maintained|supported|developed)|unmaintained|deprecated|archived|end[- ]of[- ]life)\b/i,/^(sponsored|supported|funded|backed|brought to you) by\b/i,/\b(we['’]re|we are) hiring\b|^join (us|our)\b/i,/\b(documentation|docs) (is |are )?(available|can be found|lives?) (at|on|in)\b/i,/^looking for\b|\?\s/i,/^moved to\b|\b(has )?moved to\b|\bmirror of\b/i,/^(requires?|needs)\b/i,/^status\s*:/i,/^(warning|important|note|caution|attention|heads[- ]up|disclaimer|notice|danger)\s*:/i,/\b(t-?shirts?|mugs|stickers|merch(andise)?|donate|sponsor (us|me))\b/i,/^(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200d|\ufe0f|\s)+[\p{L}\p{N} '-]{1,30}:\s/u];function d8($){return/^\[!/.test($)||/^(⚠|🚧|❗|⛔|❌|🛑)/u.test($)||/\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($)}function i8($){let Z=$.findIndex((Q)=>Q.trim()!=="");if(Z>=0&&/^[-=]{3,}\s*$/.test($[Z+1]??""))return $.slice(Z+2);return $}function a($){let Z=$.trim();if(Z.length<K$.MIN_LENGTH)return!1;if(Z.length>K$.MAX_LENGTH)return!1;if(BI.some((Q)=>Q.test(Z)))return!1;if(/^(\||[-*+](\s|$))/.test(Z))return!1;if(Z.split(`
258
+ `).length>4)return!1;if(DI(Z))return!1;return!0}function T2($){let Z=$.trim(),Q=/[.!?…]+(?=\s+\S|\s*$)/g;for(let z=Q.exec(Z);z;z=Q.exec(Z)){let X=z.index+z[0].length,U=Z.slice(0,X);if(X<Z.length){let J=Z.slice(X).trimStart();if(/(\.\.\.|…)$/.test(U))continue;if(/\b(e\.g|i\.e|vs|cf|approx|dr|mr|mrs|ms|st|jr|sr|no|fig)\.$/i.test(U))continue;if(/(\betc\.|(?:\b[A-Za-z]\.){2,})$/.test(U)&&/^[a-z]/.test(J))continue}return U.endsWith("?")?null:U}return null}function DI($){if(LI.test($))return!0;if($.includes("```"))return!0;if(/(^|\s)[-=]{3,}(\s|$)/.test($))return!0;if(/^\d+\.\s/.test($))return!0;if(/:\s*$/.test($))return!0;let Q=$.replace(/&nbsp;/gi," ").split(/\s*(?:\||·|•|&bull;)\s*/i).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return MI($)>0.5}var LI=/<\/?(?:p|div|img|br|hr|h[1-6]|picture|source|table|thead|tbody|tr|td|th|ul|ol|li|dl|dt|dd|details|summary|section|header|footer|center|video|iframe|svg|blockquote|pre)\b[^>]*>/i;function MI($){let Z=$.replace(/!\[[^\]]*\]\([^)]*\)/g,""),Q=[...Z.matchAll(/\[([^\]]*)\]\([^)]*\)/g)].map((X)=>X[1]).join(""),z=Z.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").trim();if(!z)return $.trim()?1:0;return Q.length/z.length}var z2=($,Z,Q)=>({value:$,source:Z,confidence:Q});function n8($,Z={}){let Q=Z.toolingRoot?null:OI($),z=_I($),X={},U=(J,H)=>{if(H&&a(H.value))X[J]=H};return U("what",TI(Q,z)),U("who",AI(z)),U("why",CI(z)),U("when",jI(z)),U("how",wI(z)),X}function II($,Z={}){let Q=n8($,Z),z={};return Object.keys(Q).forEach((X)=>{let U=Q[X];if(U)z[X]=U.value}),z}function OI($){let Z=j($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function _I($){let Z=j($,"README.md");if(Z===null)return"";return i8(Z.replace(/<!--[\s\S]*?-->/g,"").split(`
259
259
  `)).filter((Q)=>!/^\s*\[!\[/.test(Q)&&!/^\s*!\[/.test(Q)&&!/^\s*\[[^\]]+\]:\s*\S/.test(Q)&&!/^\s*https?:\/\/\S*\)?\s*$/.test(Q)).join(`
260
- `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function RZ($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim()}function OI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function W6($,Z){let Q=new RegExp(`^#{1,6}\\s+(${Z.join("|")})\\s*[:?]?\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n#|(?![\\s\\S]))`,"im"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||OI(z[2])>0.4)return null;return{body:RZ(z[2]),heading:z[1].trim()}}function _I($){let Z=$.split(`
261
- `).map((Q)=>Q.trim()).filter(Boolean);return Z.length>0&&Z.every((Q)=>/^\[[^\]]+\]:\s*\S/.test(Q))}function FI($){let Z=$.trim();if(!/^https?:\/\//.test(Z))return!1;return Z.replace(/https?:\/\/\S+\)?/g," ").replace(/\s+/g," ").trim()===""}function PI($){let Z=$.trim();if(_I(Z))return!0;if(FI(Z))return!0;if(/^>/.test(Z))return!0;if(/^(```|~~~|[-*+]\s|\d+\.\s|\|)/.test(Z))return!0;if(c8(Z))return!0;let z=Z.replace(/&nbsp;/gi," ").split(/\s*(?:\||·|•|&bull;)\s*/i).map((X)=>X.trim()).filter(Boolean);if(z.length>=3&&z.every((X)=>X.length<=24))return!0;return!1}function RI($,Z){if($?.description&&$.description.length>20)return z2(RZ($.description),"package.json:description",0.95);let Q=W6(Z,J0.what);if(Q)return z2(Q.body,`README:## ${Q.heading}`,0.8);let X=Z.split(/^#{2,6}\s/m)[0].split(/\n\s*\n/).map((H)=>H.replace(/\s+/g," ").trim()).find((H)=>H.length>30&&!H.startsWith("#")&&!PI(H));if(!X)return null;let U=RZ(X);if(U.length<=B$.MAX_LENGTH)return z2(U,"README:first-paragraph",0.5);let J=T2(U);return J?z2(J,"README:first-sentence",0.5):null}function NI($){let Z=W6($,J0.who);return Z?z2(Z.body,`README:## ${Z.heading}`,0.8):null}function TI($){let Z=W6($,J0.why);return Z?z2(Z.body,`README:## ${Z.heading}`,0.8):null}function AI($){let Z=W6($,J0.when);return Z?z2(Z.body,`README:## ${Z.heading}`,0.8):null}function CI($){let Z=W6($,J0.how);return Z?z2(Z.body,`README:## ${Z.heading}`,0.7):null}var w3="3.0";import{join as E3}from"path";var S3=[{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 jI($){let Z=j($,"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 wI($){let Z=j($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function SI($,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=jI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function EI($){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=j($,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 bI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=j($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=j($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function yI($,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(M($,"ios")&&M($,"android"))return"ios/ + android/ dirs";return null}function xI($,Z){let Q=j($,"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=j($,"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 gI($,Z){if(!M($,"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 vI($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((U)=>Q.test(U)),X=Z.files.some((U)=>/\.(md|MD)$|examples?\//.test(U)||U==="README.md"||U==="docs"||U==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function kI($,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 hI($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],U=z.some((H)=>Q[H]),J=X.some((H)=>Q[H]);if(U&&J)return"auth + payment dependencies";return null}function uI($,Z,Q){if(Z?.keywords?.some((U)=>/mcpaas/i.test(U)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((U)=>U.slug==="mcp"),X=Q.some((U)=>U.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function mI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||M($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var fI=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"]),b3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,pI=new Set(["frontend","backend","database","css","ui","state"]);function lI($){if(M($,"pyproject.toml")||M($,"manage.py")||M($,"setup.py")||n8($,"requirements*.txt"))return!0;if(M($,"go.mod"))return!0;if(M($,"Cargo.toml"))return!0;if(M($,"Gemfile"))return!0;if(M($,"pom.xml")||n8($,"build.gradle*"))return!0;if(q$($).length>0)return!0;let Z=q0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function r8($){return $$($,()=>cI($))}function cI($){let Z=k($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||fI.has(z.name))continue;let X=E3($,z.name);if(!lI(X))continue;let U=o8(X);if(!U)continue;let J=s8(X).filter((G)=>pI.has(G.category)),H=J.find((G)=>G.category==="frontend"),V=J.find((G)=>G.category==="backend"),Y=H??V??J[0]??null;Q.push({name:z.name,language:U,topFramework:Y?.name??null,frontend:!!H,backend:!!V||b3.test(U),hasFramework:!!Y,appRoot:M(X,"manage.py")||M(X,"config.ru")||M(X,"bin/rails")||M(X,"artisan")})}return Q}function dI($,Z){if(Z?.workspaces||M($,"pnpm-workspace.yaml"))return null;let Q=r8($),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 y3($){let Z=r8($);if(Z.length<2)return null;let Q=(J)=>(J.appRoot?2:0)+(b3.test(J.language)?2:0)+(J.hasFramework?1:0)+(J.frontend?0.5:0),z=[...Z].sort((J,H)=>Q(H)-Q(J)),X=new Set,U=[];for(let J of z){if(X.has(J.language))continue;X.add(J.language);let H=J.frontend?"frontend":J.backend?"backend":"service";U.push(J.topFramework?`${J.language} (${J.topFramework} · ${H})`:`${J.language} (${H})`)}return U.join("; ")}function q0($){let Z=j($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function n8($,Z){if(!Z.includes("*"))return M($,Z);let Q=Z.split("/");if(Q.length===1){let H=Z.split("*")[0];return(k($)??[]).some((V)=>V.name.startsWith(H))}let z=E3(...Q.slice(0,-1)),X=Q[Q.length-1],U=X.split("*")[0],J=X.split("*")[1]||"";return(k($,z)??[]).some((H)=>H.name.startsWith(U)&&H.name.endsWith(J))}function iI($,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 n8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!n8(Q,$.pattern))return!1;let z=j(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function s8($){let Z=q0($);return S3.map((Q)=>{let X=Q.signals.filter((U)=>iI(U,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function o8($){let Z=q0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(M($,"tsconfig.json"))return"TypeScript";if(M($,"Cargo.toml"))return"Rust";if(M($,"go.mod"))return"Go";if(q$($).length>0)return"C#";if(M($,"pyproject.toml")||M($,"setup.py"))return"Python";if(M($,"Gemfile"))return"Ruby";if(_Z($)){let Q=H6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(M($,"Package.swift"))return"Swift";if(M($,"build.zig"))return"Zig";if(M($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function x3($){let Z=[];if(M($,"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(M($,X))Z.push(X)}return Z}function nI($){let Z=x3($);if(Z.length===0)return null;let Q=[Z.length===1?Z[0]:`${Z.length} SKILL.md folders`];if(M($,".claude-plugin/plugin.json"))return Q.push(".claude-plugin/plugin.json"),{type:"skills-plugin",found:Q};return{type:"skills",found:Q}}function g3($){if(x3($).length===0)return"";return M($,".claude-plugin/plugin.json")?"Claude Code plugin":"Agent Skills"}function v3($){let Z=q0($),Q=s8($),z=[],X=vI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let U=SI($,Z);if(U)return z.push(U),{type:"sdk",found:z};let J=EI($);if(J)return z.push(J),{type:"extension",found:z};let H=uI($,Z,Q);if(H)return z.push(H),{type:"mcpaas",found:z};let V=hI($,Z);if(V)return z.push(V),{type:"saas",found:z};let Y=xI($,Z);if(Y)return z.push(Y),{type:"wasm",found:z};let G=k8($);if(G)return z.push(G.found),{type:G.appType,found:z};let W=u8($);if(W)return z.push(W.found),{type:W.appType,found:z};let q=f8($);if(q)return z.push(q.found),{type:q.appType,found:z};let K=H6($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=p8($);if(L)return z.push(L.found),{type:L.appType,found:z};let B=G6($);if(B)return z.push(B.found),{type:B.appType,found:z};let D=yI($,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(wI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(M($,"build.zig")){if(z.push("build.zig"),M($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(M($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let O=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit");if(Z?.private===!0&&(M($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&O)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(O)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let P=Q.some((y)=>y.category==="frontend"),N=Q.some((y)=>y.category==="backend");if(Z?.private&&(Z.workspaces||M($,"pnpm-workspace.yaml"))&&P&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=mI($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let w=kI($,Z,Q);if(w)return z.push(w),{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 E=Q.some((y)=>y.category==="frontend"),r=Q.some((y)=>y.category==="backend");if(E&&r)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(E)return z.push("frontend framework"),{type:"frontend",found:z};if(r)return z.push("backend framework"),{type:"backend",found:z};let t=bI($);if(t)return z.push(t),{type:"data-science",found:z};let v=gI($,Z);if(v)return z.push(v),{type:"html",found:z};let A=dI($,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=nI($);if(b)return z.push(...b.found),{type:b.type,found:z};return z.push(x2),{type:"library",found:z}}function k3($){if(M($,"bunfig.toml"))return"Bun";if(M($,"deno.json")||M($,"deno.jsonc"))return"Deno";if(q0($))return"Node.js";if(M($,"Cargo.toml"))return"Rust";if(M($,"go.mod"))return"Go";if(q$($).length>0)return".NET";if(M($,"pubspec.yaml"))return"Dart";return""}var rI=new Set(["npm","pnpm","yarn","bun"]);function sI($){let Z=q0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return rI.has(Q)?Q:""}function oI($){if(M($,"pubspec.yaml"))return"pub";if(M($,"go.mod"))return"go modules";if(q$($).length>0)return"NuGet";if(M($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>M($,Q))?"gradle":""}var aI=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function h3($){return oI($)||sI($)||(aI.find(([Z])=>M($,Z))?.[1]??"")}function u3($){if(M($,".github/workflows"))return"GitHub Actions";if(M($,".gitlab-ci.yml"))return"GitLab CI";if(M($,".circleci"))return"CircleCI";if(M($,"Jenkinsfile"))return"Jenkins";return null}function m3($){if(M($,"vercel.json"))return"Vercel";if(M($,"netlify.toml"))return"Netlify";if(M($,"wrangler.toml"))return"Cloudflare";if(M($,"fly.toml"))return"Fly.io";if(M($,"render.yaml"))return"Render";return null}var tI=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function eI($){for(let z of tI){let X=j($,z)?.match(/@sveltejs\/adapter-(\w+)/);if(X)return X[1]}let Z=q0($);return Object.keys({...Z?.dependencies,...Z?.devDependencies}).map((z)=>/^@sveltejs\/adapter-(\w+)$/.exec(z)?.[1]).find(Boolean)??null}function f3($){let Z=eI($);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 NZ($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function p3($){let Z=q0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return NZ(Z);if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(M($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function a8($){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)=>M($,Q))}function t8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=M($,"bun.lock")||M($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(M($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&$O($))Q.lint="cargo clippy"}if(M($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(TZ($,"build.zig")))Q.test="zig build test"}if(M($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&ZO($))Q.test="pytest";return Q}function TZ($,Z){return j($,Z)??""}function $O($){if(M($,"clippy.toml")||M($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(TZ($,"Cargo.toml"))}function ZO($){if(M($,"pytest.ini")||M($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(TZ($,Z)))}function l3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let U=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let J of Q)if(U.has(J.category))X.push(J.name);if(M($,"bunfig.toml"))X.push("Bun");else if(M($,"deno.json")||M($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let J=Object.keys(Z.dependencies).slice(0,5);for(let H of J)if(!X.some((V)=>V.toLowerCase().includes(H.toLowerCase())))X.push(H)}return X}function QO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function e8($){return AZ($).data}function AZ($){let Z=q0($),Q=s8($),z=v3($),X=z.type,U=z.found.some((x)=>x.startsWith("polyglot:")),J=U&&y3($)||o8($),H=k3($),V=h3($),Y=u3($),G=m3($),W=p3($),q=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"),B=Q.find((x)=>x.category==="state"),D=Q.find((x)=>x.category==="backend"),I=Q.find((x)=>x.category==="database"),O=(x)=>g2(X,x)??g2("library",x)===!0,C=X==="framework",P=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit"),N=C&&P?"svelte":C?null:null,T=X==="svelte"||N==="svelte",w=T?f3($):null,F=T&&Q.some((x)=>x.slug==="sveltekit"),E={},r=p.filter((x)=>x.path.startsWith("stack."));for(let x of r){let u=x.path.replace("stack.","");switch(u){case"frontend":E[u]=q?.name??g3($);break;case"css_framework":E[u]=K?.name??"";break;case"ui_library":E[u]=L?.name??"";break;case"state_management":E[u]=B?.name??(T&&QO(Z)>=5?"Runes":"");break;case"backend":E[u]=T?F?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":E[u]=F?"Server Routes":"";break;case"runtime":E[u]=H;break;case"database":E[u]=I?.name??"";break;case"connection":E[u]=I?.name??"";break;case"hosting":if(T&&w)E[u]=w;else E[u]=G??"";break;case"build":E[u]=F?NZ(Z):W??"";break;case"cicd":E[u]=Y??"";break;case"package_manager":E[u]=V;break;default:E[u]="";break}}let t={};for(let x of r){let u=x.path.replace("stack.","");t[u]=O(x)?E[u]:"slotignored"}let v={},A=p.filter((x)=>x.path.startsWith("monorepo."));for(let x of A){let u=x.path.replace("monorepo.","");if(!O(x))v[u]="slotignored";else v[u]=""}let b={name:Z?.name??$.split("/").pop()??"project",goal:U?"":Z?.description??"",main_language:J,type:X};if(C&&N)b.framework=N;let y=l3($,Z,Q,U?o8($):J);if(U){for(let x of r8($))for(let u of[x.language,x.topFramework])if(u&&!y.includes(u))y.push(u)}let K0=a8($),nZ=t8($,Z),I6={faf_version:w3,project:b,stack:t,human_context:{who:"",what:U?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:v,_meta:{found:z.found}};if(y.length>0)I6.tech_stack=y;if(K0.length>0)I6.key_files=K0;if(Object.keys(nZ).length>0)I6.commands=nZ;return{data:I6,facts:E}}var A2=($)=>new RegExp(`^(${$.join("|")})\\s*[:?]?$`,"i"),c3=A2(J0.goal),d3=A2(J0.what),i3=A2(J0.who),n3=A2(J0.why),r3=A2(J0.where),s3=A2(J0.when),o3=A2(J0.how),CZ=String.raw`(?:\*\*|__|\*|_)`,zO=String.raw`(?:(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200d|\ufe0f)+\s*)?`,a3=String.raw`${zO}${CZ}?[^*[\]:]{1,30}(?::${CZ}?|${CZ}:)`,t3=String.raw`\[[^\]]+\]\([^)]*\)`,XO=new RegExp(String.raw`^${a3}\s*(?:${t3}|https?:\/\/\S+)(?:\s*\([^()]{1,30}\))?\s*$`,"u"),UO=new RegExp(String.raw`^(?:${a3}\s*)?(?:\*\*)?${t3}`,"u");function JO($){let Z=d8($.split(`
262
- `)),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(/^<\/?[a-z][\w-]*/i.test(z)&&(HO.test(z)||z.replace(/<[^>]*>/g,"").trim()==="")){Q++;continue}if(/^#\s/.test(z)){Q++;continue}if(XO.test(z)){Q++;continue}if(UO.test(z)&&/[|·•]|&bull;/i.test(z)){Q++;continue}if(/^\[[^\]]+\]:\s*\S/.test(z)){Q++;continue}if(/^https?:\/\/\S*\)?\s*$/.test(z)){Q++;continue}if(z===""){Q++;continue}break}return Z.slice(Q).join(`
263
- `)}var HO=/^<\/?(?:p|div|img|h[1-6]|picture|source|table|center|details|summary|video|svg|br|hr)\b/i;function VO($,Z){let Q=$.replace(/^>\s*/,"");return!/^>/.test((Z??"").trim())&&Q&&!c8(Q)?Q:null}function e3($){let Q=JO($).split(`
264
- `),z=[];for(let[X,U]of Q.entries()){let J=U.trim();if(z.length===0&&/^>/.test(J))return VO(J,Q[X+1]);if(J===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(J))break;if(/^\[[^\]]+\]:\s*\S/.test(J))continue;if(/^https?:\/\/\S*\)?\s*$/.test(J))continue;if(/^\*\*[^*]+\*\*\s*$/.test(J)&&z.length===0)continue;z.push(J)}if(z.length===0)return null;return z.join(" ").trim()}function C2($,Z){return $z($,Z)?.text??null}function $z($,Z){let Q=$.split(`
265
- `),z=0;while(z<Q.length){let U=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(U&&Z.test(U[2])){let J=[];z++;while(z<Q.length){let H=Q[z].trim();if(H.match(/^(#{1,6})\s+/))break;if(H===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(H))break;J.push(H),z++}if(J.length===0)return null;return{text:J.join(" ").trim(),heading:U[2].trim()}}z++}return null}function YO($){let Z=C2($,c3);if(Z&&a(Z))return Z;let Q=e3($);if(Q&&a(Q))return Q;return}function GO($){let Z=C2($,d3);if(Z&&a(Z))return Z;return}function WO($){let Z=C2($,i3);if(Z&&a(Z))return Z;return}function qO($){let Z=C2($,n3);if(Z&&a(Z))return Z;return}function BO($){let Z=C2($,r3);if(Z&&a(Z))return Z;return}function KO($){let Z=C2($,s3);if(Z&&a(Z))return Z;return}function DO($){let Z=C2($,o3);if(Z&&a(Z))return Z;return}function jZ($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(M($,K)){Q=K;break}if(!Q)return{};let z=j($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},U=YO(z);if(U)X.project={goal:U};let J={},H=GO(z);if(H)J.what=H;let V=WO(z);if(V)J.who=V;let Y=qO(z);if(Y)J.why=Y;let G=BO(z);if(G)J.where=G;let W=KO(z);if(W)J.when=W;let q=DO(z);if(q)J.how=q;if(Object.keys(J).length>0)X.human_context=J;return X}function Zz($){let Z=["README.md","README.MD","Readme.md","readme.md"].find((J)=>M($,J));if(!Z)return{};let Q=j($,Z);if(Q===null)return{};let z=Q.replace(/<!--[\s\S]*?-->/g,""),X={},U=(J,H)=>{let V=$z(z,H);if(!V)return!1;let Y=a(V.text)?V.text:/:\s*$/.test(V.text)?T2(V.text):null;if(Y&&a(Y))return X[J]={value:Y,source:`${Z} § ${V.heading}`},!0;return!1};if(!U("project.goal",c3)){let J=e3(z);if(J&&a(J))X["project.goal"]={value:J,source:`${Z} § first paragraph`};else if(J&&J.length>B$.MAX_LENGTH){let H=T2(J);if(H&&a(H))X["project.goal"]={value:H,source:`${Z} § first sentence`}}}return U("human_context.what",d3),U("human_context.who",i3),U("human_context.why",n3),U("human_context.where",r3),U("human_context.when",s3),U("human_context.how",o3),X}function LO($,Z){let Q=$.split(`
266
- `),z=!1;for(let X of Q){let U=X.trim();if(/^\[/.test(U)){z=U==="[package]";continue}if(!z)continue;let J=U.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(J){let H=J[1].trim();H=H.replace(/\s*#.*$/,"").trim();let V=H.match(/^"((?:[^"\\]|\\.)*)"$/)||H.match(/^'((?:[^'\\]|\\.)*)'$/);if(V)return V[1];return H}}return null}function q6($){let Z=j($,"Cargo.toml");if(Z===null)return{};let Q=LO(Z,"description");if(Q&&a(Q))return{project:{goal:Q}};return{}}import{join as Qz}from"path";var MO=[{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"}],IO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function OO($){let Z=[],Q=(z,X)=>{for(let U of k($,z)??[])if(U.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(U.name))Z.push(Qz(z,U.name));else if(U.isDirectory()&&X>0&&!U.name.startsWith(".")&&!IO.has(U.name))Q(Qz(z,U.name),X-1)};return Q(".",1),Z}function B6($){return[...$].join(" · ")}function wZ($){let Z=OO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let U=j($,X);if(U===null)continue;for(let J of U.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let H=J[1].toLowerCase(),V=H.replace(/:[^/]*$/,"").split("/").pop()??H,Y=H.replace(/:[^/]*$/,"");for(let{re:G,slot:W,label:q}of MO)if(G.test(V)||G.test(Y))Q[W].add(q)}}let z={};if(Q.database.size)z.database=B6(Q.database);if(Q.cache.size)z.cache=B6(Q.cache);if(Q.search.size)z.search=B6(Q.search);if(Q.storage.size)z.storage=B6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${B6(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 _O}from"path";var FO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),PO=[{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 SZ($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function RO($){let Z=[$];for(let Q of k($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!FO.has(Q.name))Z.push(_O($,Q.name));return Z}function NO($){let Z=0;if(M($,"manage.py")||M($,"pyproject.toml")||M($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function EZ($){return $$($,()=>TO($))}function TO($){let Z=[];for(let z of RO($)){let X=z===$,U=X?"":`cd ${z.slice($.length+1)} && `;for(let J of PO){let H=j(z,J.file);if(H===null)continue;let V=J.targets(H);if(V.length===0)continue;let Y={},G=SZ(V,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=SZ(V,[/^build$/i,/^compile$/i,/^build/i]),q=SZ(V,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(G)Y.test=`${U}${J.runner} ${G}`;if(W)Y.build=`${U}${J.runner} ${W}`;if(q)Y.lint=`${U}${J.runner} ${q}`;if(Object.keys(Y).length===0)continue;Z.push({score:Object.keys(Y).length+(X?10:NO(z)),commands:Y})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var AO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function bZ($){for(let Z of AO)if(M($,Z))return{security:{secrets:".env",example:Z}};return{}}function CO($,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 yZ($){return[jZ($),q6($),wZ($),EZ($),bZ($)].reduce(CO,{})}function zz($){try{let Z=o2($,{logLevel:"error"}).getIn(["project","type"],!0);return o(Z)&&typeof Z.comment==="string"&&Z.comment.includes(x2)}catch{return!1}}function xZ($){let Z=e8($),Q=yZ($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X=K$(z,Uz(Z));return kO(X),K$(X,l8($))}function Uz($){let Z={...$};if(h(Z.project)&&"goal"in Z.project)Z.project={...Z.project,goal:""};if(h(Z.human_context))Z.human_context=Object.fromEntries(Object.keys(Z.human_context).map((Q)=>[Q,""]));return Z}function jO($,Z){let Q=vO(L8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=AZ($),U=z,{project:J,human_context:H,...V}=yZ($),Y=K$(Q,V),G=K$(Y,Uz(U)),W=EO(K$(G,l8($)),Q),q=bO(wO(Z,Q,U)?yO(Xz(W,Q),Q,X):Xz(W,Q),Q);return r9(i9(Z,q))}function wO($,Z,Q){if(!l(Z0(Z,"project.type"))){let X=$6($)?.text;return X===void 0||!zz(X)}return!(Q._meta?.found??[]).includes(x2)}function gZ($){return $.canonical?[$.path,$.canonical]:[$.path]}function Z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)?X[z]:void 0}function X2($,Z,Q){let[z,X]=Z.split("."),U=$[z];if(!h(U))return;if(Q===void 0?!(X in U):U[X]===Q)return;let J={...U};if(Q===void 0)delete J[X];else J[X]=Q;$[z]=J}var U2=($)=>typeof $==="string"&&$.trim()===_6;function SO($,Z){let Q=Z.map((z)=>Z0($,z));return Q.some(U2)&&Q.every((z)=>l(z)||U2(z))}function Xz($,Z){let Q={...$};for(let z of p){let X=gZ(z);if(!SO(Z,X))continue;for(let U of X){let J=Z0(Z,U);if(Z0(Q,U)!==J)X2(Q,U,J)}}return Q}function j2($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)&&Object.prototype.hasOwnProperty.call(X,z)}function EO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!j2(Z,z.canonical)||j2(Z,z.path))continue;let X=Z0(Q,z.path);X2(Q,z.path,void 0);let U=Z0(Q,z.canonical);if($4(X)&&l(U))X2(Q,z.canonical,X)}return Q}function bO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!j2(Z,z.canonical)||j2(Z,z.path))continue;let X=Z0(Q,z.canonical);if($4(X)||U2(X))X2(Q,z.path,X)}return Q}function yO($,Z,Q={}){let z=$.project,X=h(z)?z.type:void 0,U={...$};for(let J of p){if(J.category==="human"||J.category==="project")continue;let H=g2(X,J);if(H===null)return $;if(H){let V=typeof X==="string"&&F6[X]?.has(J.path)===!0;xO(U,Z,J,J.path.startsWith("stack.")?Q[J.path.slice(6)]:void 0,V)}else gO(U,J)}return U}function xO($,Z,Q,z,X=!1){let U=gZ(Q),J=(V)=>!l(Z0($,V))&&!U2(Z0($,V));for(let V of U){if(!U2(Z0($,V)))continue;if(X)X2($,V,U.some(J)?void 0:"");else if(!U2(Z0(Z,V)))X2($,V,j2(Z,V)?Z0(Z,V):"")}if(!$4(z))return;let H=U.filter((V)=>j2($,V));if(H.some((V)=>!l(Z0($,V))))return;for(let V of H.length>0?H:[Q.path])X2($,V,z)}function gO($,Z){let Q=gZ(Z).filter((X)=>j2($,X)),z=(X)=>!l(Z0($,X))&&!U2(Z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(l(Z0($,X)))X2($,X,_6)}function vO($){let Z=$.project;if(Z===null||Z===void 0||h(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function kO($){let Z=$.project?.type??"library",Q=y2[Z]||y2.library;for(let z of p){if(Q.includes(z.category)||F6[Z]?.has(z.path))continue;let[X,U]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[U]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[U]="slotignored"}}function K$($,Z){return Jz($,Z,"")}function hO($){let Z=x0.get($);return Z!==void 0&&Z.category!=="human"}function $4($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!l($)&&!U2($)}function uO($,Z){return hO($)&&$4(Z)}function Jz($,Z,Q){let z={...$};for(let[X,U]of Object.entries(Z)){let J=z[X],H=Q?`${Q}.${X}`:X;if(H==="_meta"&&J!==void 0)continue;if(I$(J)){if(uO(H,U))z[X]=U;continue}if(l(J))z[X]=U;else if(h(U)&&h(J))z[X]=Jz(J,U,H)}return z}function Hz($,Z){let Q=Z.split("."),z=$;for(let X of Q){if(z===null||z===void 0||typeof z!=="object")return;z=z[X]}return z}var vZ=["project.goal","human_context.who","human_context.what","human_context.why","human_context.where","human_context.when","human_context.how"];function Yz($){return vZ.includes($)}function mO($,Z){if(Z)return null;let Q=j($,"package.json");if(Q===null)return null;try{let z=JSON.parse(Q).description;return typeof z==="string"&&z.trim()?z.trim():null}catch{return null}}function Gz($,Z){let z=(e8($)._meta?.found??[]).some((W)=>W.startsWith("polyglot:")),X={},U=new Set(Z?vZ.filter((W)=>fO(Hz(Z,W))):[]),J=[],H=dO($),V=(W,q,K)=>{if(X[W]||U.has(W)||!q)return;let L=Wz(q,H),B=Vz(L),D=T2(L),I=D&&D!==L?Vz(D):null;if(!a(L)||rO(q,H)||iO(W,L)||J.some((O)=>sO(O,B)||O===I))return;if(J.push(B),I)J.push(I);X[W]={value:L,source:oO(K)}};nO($,V);let Y=mO($,z);V("project.goal",Y,"package.json description"),V("human_context.what",Y,"package.json description"),V("project.goal",q6($).project?.goal,"Cargo.toml description");let G=i8($,{toolingRoot:z});for(let W of["who","what","why","where","when","how"]){let q=G[W];if(q)V(`human_context.${W}`,q.value,q.source)}return X}function fO($){return I$($)||typeof $==="string"&&$.trim()!==""&&!l($)}function Wz($,Z=new Set){let Q=[],z=$.replace(/`([^`]+)`/g,(X,U)=>`${Q.push(U)-1}`);return cO(z.replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/(?<![\w\]])\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/(?<![\w\]])\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/(?<![\w\]])\[([^\]]+)\](?![[(:])/g,(X,U)=>Z.has(U.toLowerCase())?U:X).replace(/<\/?(?:a|b|i|em|strong|code|kbd|span|sup|sub|mark|small|u|s)\b[^>]*>/gi,"").replace(/_\*\*(.+?)\*\*_/g,"$1").replace(/\*\*_(.+?)_\*\*/g,"$1").replace(/[\s\S]*/,pO).replace(/(^|[^\w])(__)(?=\S)(.+?)(?<=\S)\2(?!\w|\.\w)/g,"$1$3").replace(/(^|[^\w])(_)(?=[^\s_])(.+?)(?<=[^\s_])\2(?!\w|\.\w)/g,"$1$3")).replace(/\uE000(\d+)\uE000/g,(X,U)=>Q[Number(U)]).replace(/\s+/g," ").trim()}function pO($){for(let Z=0;Z<4;Z++){let Q=$.replace(/(?<![\w/.*\\])(\*\*?)(?=[\p{L}\p{N}\p{Extended_Pictographic}])([^*\n]*?[\p{L}\p{N}.!?):])\1(?!\*)/gu,"$2");if(Q===$)break;$=Q}return $}var lO={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",bull:"•",mdash:"—",ndash:"–",hellip:"…",copy:"©",reg:"®",trade:"™"};function cO($){return $.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(Z,Q)=>{if(Q[0]!=="#")return lO[Q.toLowerCase()]??Z;let z=Q[1].toLowerCase()==="x"?Number.parseInt(Q.slice(2),16):Number(Q.slice(1));if(!Number.isFinite(z)||z<=31||z>1114111||z>=55296&&z<=57343)return Z;return String.fromCodePoint(z)})}function dO($){let Z=["README.md","README.MD","Readme.md","readme.md"].find((z)=>M($,z)),Q=Z?j($,Z)??"":"";return new Set([...Q.matchAll(/^ {0,3}\[([^\]]+)\]:\s*\S/gm)].map((z)=>z[1].toLowerCase()))}function iO($,Z){if($==="project.goal"||$==="human_context.what")return j3(Z);if($==="human_context.why")return/^[\p{L}\p{N}._-]+ (is|are) (a|an|the)\b/iu.test(Z);return!1}function nO($,Z){for(let[Q,z]of Object.entries(Zz($)))if(Yz(Q))Z(Q,z.value,z.source)}function rO($,Z){return Wz($.replace(/`[^`]*`/g," "),Z).includes("**")}function Vz($){return $.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function sO($,Z){let[Q,z]=$.length<=Z.length?[$,Z]:[Z,$];if(z.includes(Q)&&Q.length>=0.6*z.length)return!0;let X=new Set($.split(" ")),U=new Set(Z.split(" "));return[...X].filter((H)=>U.has(H)).length/new Set([...X,...U]).size>=0.7}function oO($){if($==="README:first-paragraph")return"README.md § first paragraph";if($==="README:first-sentence")return"README.md § first sentence";let Z=$.match(/^README:##\s*(.+)$/);if(Z)return`README.md § ${Z[1].trim()}`;return $.replace(/^package\.json:description$/,"package.json description")}function aO($,Z){let Q=Object.values(Gz($,Z)).filter((H)=>Boolean(H));if(Q.length===0)return null;let z=(H)=>{let V=H.split(/[\s:§]/)[0];return V==="README"?"README.md":V},X=[...new Set(Q.map((H)=>z(H.source)))].join(", "),[U,J]=Q.length===1?["suggestion","it"]:["suggestions","them"];return`${Q.length} ${U} for the goal and the six W's (${X}) — confirm ${J} in 'faf go'`}function tO($){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 qz($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function eO($,Z={}){let Q=xZ($);if(Z.repoUrl&&Q.project&&!q0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=qz(Z.repoUrl);return Q}import{existsSync as Bz,lstatSync as $_}from"fs";import{join as Z_,basename as Q_}from"path";import{createHash as z_}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),P0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",X_=/^v?\d+\.\d+\.\d+$/,U_=new Set(["birth","doubled","peak","current"]);function Mz($){return B0($)&&F0($.version)&&X_.test($.version)&&P0($.score)}var J_=($)=>P0($.birthDNA)?$.birthDNA:P0($.birthWeight)?$.birthWeight:null,H_=($)=>B0($)&&P0($.birthDNA)&&F0($.born),Kz=($)=>B0($)&&F0($.born)&&P0($.birthDNA)&&P0($.lastScore)&&F0($.endedAt),V_=($)=>Array.isArray($)&&$.length>0&&$.every(Mz),Y_=($)=>B0($)&&P0($.score)&&F0($.version),G_=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function Dz($){return B0($)&&H_($.birthCertificate)&&V_($.versions)&&Y_($.current)&&G_($.growth)}function W_($){try{return $_($),!0}catch{return!1}}var kZ=($)=>`${JSON.stringify($,null,2)}
267
- `,q_=new Set(["version","score","lastSync"]),B_=new Set(["type","score","date","version","label","emoji"]),Lz=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),hZ={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},Iz=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),Oz=($)=>Lz($.current,q_)&&Iz($).every((Z)=>Lz(Z,B_)),K_=($)=>Iz($).every((Z)=>Z.label===hZ[Z.type].label&&Z.emoji===hZ[Z.type].emoji);function D_($){return Oz($)&&K_($)}var L_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",M_=".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.",I_=".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.",O_=".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.",__=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function F_($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&U_.has(Z.type)&&P0(Z.score))}var w2=($,Z="")=>F0($)?$:Z;function P_($,Z){if(!Array.isArray($))return[];return $.filter(Mz).map((Q)=>({version:Q.version,timestamp:w2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(F0):[],growth:P0(Q.growth)?Q.growth:Q.score-Z}))}function R_($,Z,Q,z){return{version:w2($.version,Z?.version??"v1.0.0"),score:P0($.score)?$.score:Z?.score??Q,lastSync:w2($.lastSync,z)}}function N_($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=J_(Z);if(Q===null)return null;let z=w2(Z.born),X=P_($.versions,Q),U=R_(B0($.current)?$.current:{},X[X.length-1],Q,z),J=B0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"||Z.birthWeightSource==="legacy"?"legacy":"init",projectDNA:w2(Z.projectDNA),certificate:w2(Z.certificate)},versions:X,current:U,growth:{totalGrowth:U.score-Q,daysActive:P0(J.daysActive)?J.daysActive:0,milestones:F_(Array.isArray(J.milestones)?J.milestones:$.milestones)},lastModified:w2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(Kz)?{priorLineage:$.priorLineage.filter(Kz)}:{}}}class _z{projectPath;dnaPath;dna=null;own=!1;text;reason=null;constructor($){this.projectPath=$,this.dnaPath=Z_($,".faf-dna")}exists(){return Bz(this.dnaPath)}birth($){if(m(this.projectPath,".faf-dna"),W_(this.dnaPath))throw new S("exists",this.dnaPath,`${this.dnaPath} is already there: a birth certificate is written once and never replaced — not written; original kept`);let Z=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.text=void 0,this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,U=$-X,J=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:J,timestamp:z,score:$,changes:Z,growth:U}),Q.current={version:J,score:$,lastSync:z},Q.growth.totalGrowth=U,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,J,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((U)=>U.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:F0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=F0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(F0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!Bz(this.dnaPath))return null;let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(Dz(Q)&&kZ(Q)===Z&&D_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=N_(Q),this.reason=!this.dna?__:!Dz(Q)?L_:kZ(Q)!==Z?M_:Oz(Q)?O_:I_;return this.text=Z,this.dna}read(){let $;try{$=Q0(m(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 $=kZ(this.dna),Z=this.text??null;$0(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$}generateProjectDNA(){return z_("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=Q_(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=(V)=>z.some((Y)=>Y.type===V),U=(V)=>z.push({type:V,score:$,date:Q,version:Z,...hZ[V]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))U("doubled");let J=z.find((V)=>V.type==="peak");if(!J||$>J.score){if(J)z.splice(z.indexOf(J),1);U("peak")}let H=z.findIndex((V)=>V.type==="current");if(H>=0)z.splice(H,1);U("current")}}import{join as zF}from"path";import{existsSync as a_,statSync as TC}from"fs";import{join as Sz}from"path";import{dirname as Az,resolve as Cz}from"path";var Pz=100;var T_="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",A_=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${T_})(?=\\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")],C_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],j_=["","-->","?>",">","]]>"],w_=/[#`~*+_=<>0-9-]/,S_=/(\d{1,9})([.)])/y,E_=/#{1,6}(?:[ \t]+|$)/y,b_=/`{3,}(?!.*`)|~{3,}/y,y_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,x_=/(?:=+|-+)[ \t]*$/y,g_=/[^ \t\f\v\r\n]/;function K6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var v_=($)=>$==="quote"||$==="list"||$==="item";function k_($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let U=$.length-1;U>=0;U--){let J=$[U],H=J===" "||J==="\t";for(let Y=0;Y<3;Y++)if(J==="*-_"[Y])z[Y]++;else if(!H)X[Y]=!1;let V="*-_".indexOf(J);Z[U]=V>=0&&X[V]&&z[V]>=3?1:0}return Z}var D$=($)=>$===" "||$==="\t";function h_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var Fz=($)=>$==="paragraph"||$==="code"||$==="html";function u_($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class R0{containers;stack=[{kind:"document"}];ln="";offset=0;column=0;nextNonspace=0;nextNonspaceColumn=0;indent=0;indented=!1;blank=!1;allClosed=!0;matched=0;htmlStarted=!1;hiddenIn=null;scannedFrom=-1;breaks=null;deep=!1;limit=-1;overflow=-1;starts;constructor($=!0){this.containers=$;this.starts=[()=>this.startQuote(),()=>this.startHeading(),()=>this.startFence(),(Z)=>this.startHtml(Z),(Z)=>this.startSetext(Z),()=>this.startBreak(),(Z)=>this.startItem(Z),()=>this.startIndentedCode()]}clone(){let $=new R0(this.containers);return $.stack=this.stack.map(u_),$.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}>`:j_[$.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"&&Fz(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!w_.test(this.ln.charAt(z)))break;let X=0;for(let U of this.starts)if(X=U(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!Fz($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=C_[$.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),D$(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?K6(y_,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&&D$(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??=k_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),D$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!K6(E_,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:K6(b_,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let U=A_[X-1].exec(z);if(U)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?U[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!K6(x_,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||D$(z)))return null;if(Z&&!g_.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"?K6(S_,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&&D$(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,D$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!h_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),v_($.kind)&&this.stack.length-1>100)this.deep=!0}closeUnmatched(){if(!this.allClosed)this.stack.length=this.matched+1,this.allClosed=!0}findNextNonspace(){let $=this.ln,Z=this.offset,Q=this.column;if(this.scannedFrom!==-1&&this.offset>=this.scannedFrom&&this.offset<=this.nextNonspace)Z=this.nextNonspace,Q=this.nextNonspaceColumn;else{this.scannedFrom=this.offset;for(;Z<$.length;Z++)if($[Z]===" ")Q++;else if($[Z]==="\t")Q+=4-Q%4;else break}this.blank=Z>=$.length,this.nextNonspace=Z,this.nextNonspaceColumn=Q,this.indent=Q-this.column,this.indented=this.indent>=4}advanceNextNonspace(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn}advanceOffset($,Z){let Q=$;while(Q>0&&this.offset<this.ln.length){if(this.ln[this.offset]!=="\t"){this.offset++,this.column++,Q--;continue}let z=4-this.column%4,X=Z&&z>Q;this.column+=X?Q:z,this.offset+=X?0:1,Q-=Z?Math.min(z,Q):1}}}var E0="<!-- faf:start -->",b0="<!-- faf:end -->",Rz="\uFEFF";function L6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var L$=($)=>$.replace(/\r?\n$|\r$/,""),jz=($)=>L$($).replace(/^\uFEFF/,"").trimEnd();function*uZ($){let Z=0;for(let Q of L6($)){let z=L$(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 m_($,Z,Q,z){let X=$.some((J)=>J.start!==-1)&&z(Z.content),U=Q(Z.content);for(let J of $)if(J.start!==-1&&X)J.found={start:J.start,end:Z.to};else if(U)J.start=Z.from}function mZ($,Z,Q){let[z,X]=[new R0(!0),new R0(!1)].map((U)=>({reader:U,start:-1,found:null}));for(let U of uZ($)){let J=[z,X].map((V)=>V.reader.line(U.content));if(z.reader.tooDeep)return null;let H=[z,X].filter((V,Y)=>J[Y]===null);if(H.length>0)m_(H,U,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var Nz=($)=>(Z)=>Z===$;function S2($,Z=E0,Q=b0){return mZ($,Nz(Z),Nz(Q))}function Tz($,Z){let Q=[];for(let z of[!0,!1]){let X=new R0(z);for(let U of L6($))X.line(L$(U));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var f_=16;function p_($){let Z=new R0(!0);return $.map((Q)=>{let z=Z.overflowAt(L$(Q),f_),X=Q;if(z>=0){let U=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),J=U?z+U[0].length:z;X=`${Q.slice(0,J)}\\${Q.slice(J)}`}return Z.line(L$(X)),X})}function l_($,Z,Q){let X=p_(L6($).map((J)=>{let H=jz(J);return H===Z||H===Q?` ${J}`:J})).join(""),U=Tz(X,Q);while(U.length>0&&U[0]!==null){let J=`${X}
268
- ${U[0]}`,H=Tz(J,Q);if(H.length>=U.length)break;X=J,U=H}return X}function c_($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=L6(z).map((U)=>L$(U)===""?`>${U}`:`> ${U}`).join("");return`${Z}
260
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function NZ($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim()}function FI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function W6($,Z){let Q=new RegExp(`^#{1,6}\\s+(${Z.join("|")})\\s*[:?]?\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n#|(?![\\s\\S]))`,"im"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||FI(z[2])>0.4)return null;return{body:NZ(z[2]),heading:z[1].trim()}}function PI($){let Z=$.split(`
261
+ `).map((Q)=>Q.trim()).filter(Boolean);return Z.length>0&&Z.every((Q)=>/^\[[^\]]+\]:\s*\S/.test(Q))}function RI($){let Z=$.trim();if(!/^https?:\/\//.test(Z))return!1;return Z.replace(/https?:\/\/\S+\)?/g," ").replace(/\s+/g," ").trim()===""}function NI($){let Z=$.trim();if(PI(Z))return!0;if(RI(Z))return!0;if(/^>/.test(Z))return!0;if(/^(```|~~~|[-*+]\s|\d+\.\s|\|)/.test(Z))return!0;if(d8(Z))return!0;let z=Z.replace(/&nbsp;/gi," ").split(/\s*(?:\||·|•|&bull;)\s*/i).map((X)=>X.trim()).filter(Boolean);if(z.length>=3&&z.every((X)=>X.length<=24))return!0;return!1}function TI($,Z){if($?.description&&$.description.length>20)return z2(NZ($.description),"package.json:description",0.95);let Q=W6(Z,J0.what);if(Q)return z2(Q.body,`README:## ${Q.heading}`,0.8);let X=Z.split(/^#{2,6}\s/m)[0].split(/\n\s*\n/).map((H)=>H.replace(/\s+/g," ").trim()).find((H)=>H.length>30&&!H.startsWith("#")&&!NI(H));if(!X)return null;let U=NZ(X);if(U.length<=K$.MAX_LENGTH)return z2(U,"README:first-paragraph",0.5);let J=T2(U);return J?z2(J,"README:first-sentence",0.5):null}function AI($){let Z=W6($,J0.who);return Z?z2(Z.body,`README:## ${Z.heading}`,0.8):null}function CI($){let Z=W6($,J0.why);return Z?z2(Z.body,`README:## ${Z.heading}`,0.8):null}function jI($){let Z=W6($,J0.when);return Z?z2(Z.body,`README:## ${Z.heading}`,0.8):null}function wI($){let Z=W6($,J0.how);return Z?z2(Z.body,`README:## ${Z.heading}`,0.7):null}var w3="3.0";import{join as E3}from"path";var S3=[{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=j($,"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 EI($){let Z=j($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function bI($,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 yI($){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=j($,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 xI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=j($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=j($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function gI($,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(M($,"ios")&&M($,"android"))return"ios/ + android/ dirs";return null}function vI($,Z){let Q=j($,"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=j($,"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 kI($,Z){if(!M($,"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 hI($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((U)=>Q.test(U)),X=Z.files.some((U)=>/\.(md|MD)$|examples?\//.test(U)||U==="README.md"||U==="docs"||U==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function uI($,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 mI($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],U=z.some((H)=>Q[H]),J=X.some((H)=>Q[H]);if(U&&J)return"auth + payment dependencies";return null}function fI($,Z,Q){if(Z?.keywords?.some((U)=>/mcpaas/i.test(U)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((U)=>U.slug==="mcp"),X=Q.some((U)=>U.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function pI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||M($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var lI=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"]),b3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,cI=new Set(["frontend","backend","database","css","ui","state"]);function dI($){if(M($,"pyproject.toml")||M($,"manage.py")||M($,"setup.py")||r8($,"requirements*.txt"))return!0;if(M($,"go.mod"))return!0;if(M($,"Cargo.toml"))return!0;if(M($,"Gemfile"))return!0;if(M($,"pom.xml")||r8($,"build.gradle*"))return!0;if(B$($).length>0)return!0;let Z=q0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function s8($){return $$($,()=>iI($))}function iI($){let Z=k($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||lI.has(z.name))continue;let X=E3($,z.name);if(!dI(X))continue;let U=a8(X);if(!U)continue;let J=o8(X).filter((G)=>cI.has(G.category)),H=J.find((G)=>G.category==="frontend"),V=J.find((G)=>G.category==="backend"),Y=H??V??J[0]??null;Q.push({name:z.name,language:U,topFramework:Y?.name??null,frontend:!!H,backend:!!V||b3.test(U),hasFramework:!!Y,appRoot:M(X,"manage.py")||M(X,"config.ru")||M(X,"bin/rails")||M(X,"artisan")})}return Q}function nI($,Z){if(Z?.workspaces||M($,"pnpm-workspace.yaml"))return null;let Q=s8($),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 y3($){let Z=s8($);if(Z.length<2)return null;let Q=(J)=>(J.appRoot?2:0)+(b3.test(J.language)?2:0)+(J.hasFramework?1:0)+(J.frontend?0.5:0),z=[...Z].sort((J,H)=>Q(H)-Q(J)),X=new Set,U=[];for(let J of z){if(X.has(J.language))continue;X.add(J.language);let H=J.frontend?"frontend":J.backend?"backend":"service";U.push(J.topFramework?`${J.language} (${J.topFramework} · ${H})`:`${J.language} (${H})`)}return U.join("; ")}function q0($){let Z=j($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function r8($,Z){if(!Z.includes("*"))return M($,Z);let Q=Z.split("/");if(Q.length===1){let H=Z.split("*")[0];return(k($)??[]).some((V)=>V.name.startsWith(H))}let z=E3(...Q.slice(0,-1)),X=Q[Q.length-1],U=X.split("*")[0],J=X.split("*")[1]||"";return(k($,z)??[]).some((H)=>H.name.startsWith(U)&&H.name.endsWith(J))}function rI($,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 r8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!r8(Q,$.pattern))return!1;let z=j(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function o8($){let Z=q0($);return S3.map((Q)=>{let X=Q.signals.filter((U)=>rI(U,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function a8($){let Z=q0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(M($,"tsconfig.json"))return"TypeScript";if(M($,"Cargo.toml"))return"Rust";if(M($,"go.mod"))return"Go";if(B$($).length>0)return"C#";if(M($,"pyproject.toml")||M($,"setup.py"))return"Python";if(M($,"Gemfile"))return"Ruby";if(FZ($)){let Q=H6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(M($,"Package.swift"))return"Swift";if(M($,"build.zig"))return"Zig";if(M($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function x3($){let Z=[];if(M($,"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(M($,X))Z.push(X)}return Z}function sI($){let Z=x3($);if(Z.length===0)return null;let Q=[Z.length===1?Z[0]:`${Z.length} SKILL.md folders`];if(M($,".claude-plugin/plugin.json"))return Q.push(".claude-plugin/plugin.json"),{type:"skills-plugin",found:Q};return{type:"skills",found:Q}}function g3($){if(x3($).length===0)return"";return M($,".claude-plugin/plugin.json")?"Claude Code plugin":"Agent Skills"}function v3($){let Z=q0($),Q=o8($),z=[],X=hI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let U=bI($,Z);if(U)return z.push(U),{type:"sdk",found:z};let J=yI($);if(J)return z.push(J),{type:"extension",found:z};let H=fI($,Z,Q);if(H)return z.push(H),{type:"mcpaas",found:z};let V=mI($,Z);if(V)return z.push(V),{type:"saas",found:z};let Y=vI($,Z);if(Y)return z.push(Y),{type:"wasm",found:z};let G=h8($);if(G)return z.push(G.found),{type:G.appType,found:z};let W=m8($);if(W)return z.push(W.found),{type:W.appType,found:z};let q=p8($);if(q)return z.push(q.found),{type:q.appType,found:z};let K=H6($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=l8($);if(L)return z.push(L.found),{type:L.appType,found:z};let B=G6($);if(B)return z.push(B.found),{type:B.appType,found:z};let D=gI($,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(EI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(M($,"build.zig")){if(z.push("build.zig"),M($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(M($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let O=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit");if(Z?.private===!0&&(M($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&O)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(O)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let P=Q.some((y)=>y.category==="frontend"),N=Q.some((y)=>y.category==="backend");if(Z?.private&&(Z.workspaces||M($,"pnpm-workspace.yaml"))&&P&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=pI($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let w=uI($,Z,Q);if(w)return z.push(w),{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 E=Q.some((y)=>y.category==="frontend"),r=Q.some((y)=>y.category==="backend");if(E&&r)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(E)return z.push("frontend framework"),{type:"frontend",found:z};if(r)return z.push("backend framework"),{type:"backend",found:z};let t=xI($);if(t)return z.push(t),{type:"data-science",found:z};let v=kI($,Z);if(v)return z.push(v),{type:"html",found:z};let A=nI($,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=sI($);if(b)return z.push(...b.found),{type:b.type,found:z};return z.push(x2),{type:"library",found:z}}function k3($){if(M($,"bunfig.toml"))return"Bun";if(M($,"deno.json")||M($,"deno.jsonc"))return"Deno";if(q0($))return"Node.js";if(M($,"Cargo.toml"))return"Rust";if(M($,"go.mod"))return"Go";if(B$($).length>0)return".NET";if(M($,"pubspec.yaml"))return"Dart";return""}var oI=new Set(["npm","pnpm","yarn","bun"]);function aI($){let Z=q0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return oI.has(Q)?Q:""}function tI($){if(M($,"pubspec.yaml"))return"pub";if(M($,"go.mod"))return"go modules";if(B$($).length>0)return"NuGet";if(M($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>M($,Q))?"gradle":""}var eI=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function h3($){return tI($)||aI($)||(eI.find(([Z])=>M($,Z))?.[1]??"")}function u3($){if(M($,".github/workflows"))return"GitHub Actions";if(M($,".gitlab-ci.yml"))return"GitLab CI";if(M($,".circleci"))return"CircleCI";if(M($,"Jenkinsfile"))return"Jenkins";return null}function m3($){if(M($,"vercel.json"))return"Vercel";if(M($,"netlify.toml"))return"Netlify";if(M($,"wrangler.toml"))return"Cloudflare";if(M($,"fly.toml"))return"Fly.io";if(M($,"render.yaml"))return"Render";return null}var $O=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function ZO($){for(let z of $O){let X=j($,z)?.match(/@sveltejs\/adapter-(\w+)/);if(X)return X[1]}let Z=q0($);return Object.keys({...Z?.dependencies,...Z?.devDependencies}).map((z)=>/^@sveltejs\/adapter-(\w+)$/.exec(z)?.[1]).find(Boolean)??null}function f3($){let Z=ZO($);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 TZ($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function p3($){let Z=q0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return TZ(Z);if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(M($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function t8($){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)=>M($,Q))}function e8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=M($,"bun.lock")||M($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(M($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&QO($))Q.lint="cargo clippy"}if(M($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(AZ($,"build.zig")))Q.test="zig build test"}if(M($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&zO($))Q.test="pytest";return Q}function AZ($,Z){return j($,Z)??""}function QO($){if(M($,"clippy.toml")||M($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(AZ($,"Cargo.toml"))}function zO($){if(M($,"pytest.ini")||M($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(AZ($,Z)))}function l3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let U=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let J of Q)if(U.has(J.category))X.push(J.name);if(M($,"bunfig.toml"))X.push("Bun");else if(M($,"deno.json")||M($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let J=Object.keys(Z.dependencies).slice(0,5);for(let H of J)if(!X.some((V)=>V.toLowerCase().includes(H.toLowerCase())))X.push(H)}return X}function XO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function $4($){return CZ($).data}function CZ($){let Z=q0($),Q=o8($),z=v3($),X=z.type,U=z.found.some((x)=>x.startsWith("polyglot:")),J=U&&y3($)||a8($),H=k3($),V=h3($),Y=u3($),G=m3($),W=p3($),q=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"),B=Q.find((x)=>x.category==="state"),D=Q.find((x)=>x.category==="backend"),I=Q.find((x)=>x.category==="database"),O=(x)=>g2(X,x)??g2("library",x)===!0,C=X==="framework",P=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit"),N=C&&P?"svelte":C?null:null,T=X==="svelte"||N==="svelte",w=T?f3($):null,F=T&&Q.some((x)=>x.slug==="sveltekit"),E={},r=p.filter((x)=>x.path.startsWith("stack."));for(let x of r){let m=x.path.replace("stack.","");switch(m){case"frontend":E[m]=q?.name??g3($);break;case"css_framework":E[m]=K?.name??"";break;case"ui_library":E[m]=L?.name??"";break;case"state_management":E[m]=B?.name??(T&&XO(Z)>=5?"Runes":"");break;case"backend":E[m]=T?F?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":E[m]=F?"Server Routes":"";break;case"runtime":E[m]=H;break;case"database":E[m]=I?.name??"";break;case"connection":E[m]=I?.name??"";break;case"hosting":if(T&&w)E[m]=w;else E[m]=G??"";break;case"build":E[m]=F?TZ(Z):W??"";break;case"cicd":E[m]=Y??"";break;case"package_manager":E[m]=V;break;default:E[m]="";break}}let t={};for(let x of r){let m=x.path.replace("stack.","");t[m]=O(x)?E[m]:"slotignored"}let v={},A=p.filter((x)=>x.path.startsWith("monorepo."));for(let x of A){let m=x.path.replace("monorepo.","");if(!O(x))v[m]="slotignored";else v[m]=""}let b={name:Z?.name??$.split("/").pop()??"project",goal:U?"":Z?.description??"",main_language:J,type:X};if(C&&N)b.framework=N;let y=l3($,Z,Q,U?a8($):J);if(U){for(let x of s8($))for(let m of[x.language,x.topFramework])if(m&&!y.includes(m))y.push(m)}let K0=t8($),rZ=e8($,Z),I6={faf_version:w3,project:b,stack:t,human_context:{who:"",what:U?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:v,_meta:{found:z.found}};if(y.length>0)I6.tech_stack=y;if(K0.length>0)I6.key_files=K0;if(Object.keys(rZ).length>0)I6.commands=rZ;return{data:I6,facts:E}}var A2=($)=>new RegExp(`^(${$.join("|")})\\s*[:?]?$`,"i"),c3=A2(J0.goal),d3=A2(J0.what),i3=A2(J0.who),n3=A2(J0.why),r3=A2(J0.where),s3=A2(J0.when),o3=A2(J0.how),jZ=String.raw`(?:\*\*|__|\*|_)`,UO=String.raw`(?:(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200d|\ufe0f)+\s*)?`,a3=String.raw`${UO}${jZ}?[^*[\]:]{1,30}(?::${jZ}?|${jZ}:)`,t3=String.raw`\[[^\]]+\]\([^)]*\)`,JO=new RegExp(String.raw`^${a3}\s*(?:${t3}|https?:\/\/\S+)(?:\s*\([^()]{1,30}\))?\s*$`,"u"),HO=new RegExp(String.raw`^(?:${a3}\s*)?(?:\*\*)?${t3}`,"u");function VO($){let Z=i8($.split(`
262
+ `)),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(/^<\/?[a-z][\w-]*/i.test(z)&&(YO.test(z)||z.replace(/<[^>]*>/g,"").trim()==="")){Q++;continue}if(/^#\s/.test(z)){Q++;continue}if(JO.test(z)){Q++;continue}if(HO.test(z)&&/[|·•]|&bull;/i.test(z)){Q++;continue}if(/^\[[^\]]+\]:\s*\S/.test(z)){Q++;continue}if(/^https?:\/\/\S*\)?\s*$/.test(z)){Q++;continue}if(z===""){Q++;continue}break}return Z.slice(Q).join(`
263
+ `)}var YO=/^<\/?(?:p|div|img|h[1-6]|picture|source|table|center|details|summary|video|svg|br|hr)\b/i;function GO($,Z){let Q=$.replace(/^>\s*/,"");return!/^>/.test((Z??"").trim())&&Q&&!d8(Q)?Q:null}function e3($){let Q=VO($).split(`
264
+ `),z=[];for(let[X,U]of Q.entries()){let J=U.trim();if(z.length===0&&/^>/.test(J))return GO(J,Q[X+1]);if(J===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(J))break;if(/^\[[^\]]+\]:\s*\S/.test(J))continue;if(/^https?:\/\/\S*\)?\s*$/.test(J))continue;if(/^\*\*[^*]+\*\*\s*$/.test(J)&&z.length===0)continue;z.push(J)}if(z.length===0)return null;return z.join(" ").trim()}function C2($,Z){return $z($,Z)?.text??null}function $z($,Z){let Q=$.split(`
265
+ `),z=0;while(z<Q.length){let U=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(U&&Z.test(U[2])){let J=[];z++;while(z<Q.length){let H=Q[z].trim();if(H.match(/^(#{1,6})\s+/))break;if(H===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(H))break;J.push(H),z++}if(J.length===0)return null;return{text:J.join(" ").trim(),heading:U[2].trim()}}z++}return null}function WO($){let Z=C2($,c3);if(Z&&a(Z))return Z;let Q=e3($);if(Q&&a(Q))return Q;return}function qO($){let Z=C2($,d3);if(Z&&a(Z))return Z;return}function BO($){let Z=C2($,i3);if(Z&&a(Z))return Z;return}function KO($){let Z=C2($,n3);if(Z&&a(Z))return Z;return}function DO($){let Z=C2($,r3);if(Z&&a(Z))return Z;return}function LO($){let Z=C2($,s3);if(Z&&a(Z))return Z;return}function MO($){let Z=C2($,o3);if(Z&&a(Z))return Z;return}function wZ($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(M($,K)){Q=K;break}if(!Q)return{};let z=j($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},U=WO(z);if(U)X.project={goal:U};let J={},H=qO(z);if(H)J.what=H;let V=BO(z);if(V)J.who=V;let Y=KO(z);if(Y)J.why=Y;let G=DO(z);if(G)J.where=G;let W=LO(z);if(W)J.when=W;let q=MO(z);if(q)J.how=q;if(Object.keys(J).length>0)X.human_context=J;return X}function Zz($){let Z=["README.md","README.MD","Readme.md","readme.md"].find((J)=>M($,J));if(!Z)return{};let Q=j($,Z);if(Q===null)return{};let z=Q.replace(/<!--[\s\S]*?-->/g,""),X={},U=(J,H)=>{let V=$z(z,H);if(!V)return!1;let Y=a(V.text)?V.text:/:\s*$/.test(V.text)?T2(V.text):null;if(Y&&a(Y))return X[J]={value:Y,source:`${Z} § ${V.heading}`},!0;return!1};if(!U("project.goal",c3)){let J=e3(z);if(J&&a(J))X["project.goal"]={value:J,source:`${Z} § first paragraph`};else if(J&&J.length>K$.MAX_LENGTH){let H=T2(J);if(H&&a(H))X["project.goal"]={value:H,source:`${Z} § first sentence`}}}return U("human_context.what",d3),U("human_context.who",i3),U("human_context.why",n3),U("human_context.where",r3),U("human_context.when",s3),U("human_context.how",o3),X}function IO($,Z){let Q=$.split(`
266
+ `),z=!1;for(let X of Q){let U=X.trim();if(/^\[/.test(U)){z=U==="[package]";continue}if(!z)continue;let J=U.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(J){let H=J[1].trim();H=H.replace(/\s*#.*$/,"").trim();let V=H.match(/^"((?:[^"\\]|\\.)*)"$/)||H.match(/^'((?:[^'\\]|\\.)*)'$/);if(V)return V[1];return H}}return null}function q6($){let Z=j($,"Cargo.toml");if(Z===null)return{};let Q=IO(Z,"description");if(Q&&a(Q))return{project:{goal:Q}};return{}}import{join as Qz}from"path";var OO=[{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"}],_O=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function FO($){let Z=[],Q=(z,X)=>{for(let U of k($,z)??[])if(U.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(U.name))Z.push(Qz(z,U.name));else if(U.isDirectory()&&X>0&&!U.name.startsWith(".")&&!_O.has(U.name))Q(Qz(z,U.name),X-1)};return Q(".",1),Z}function B6($){return[...$].join(" · ")}function SZ($){let Z=FO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let U=j($,X);if(U===null)continue;for(let J of U.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let H=J[1].toLowerCase(),V=H.replace(/:[^/]*$/,"").split("/").pop()??H,Y=H.replace(/:[^/]*$/,"");for(let{re:G,slot:W,label:q}of OO)if(G.test(V)||G.test(Y))Q[W].add(q)}}let z={};if(Q.database.size)z.database=B6(Q.database);if(Q.cache.size)z.cache=B6(Q.cache);if(Q.search.size)z.search=B6(Q.search);if(Q.storage.size)z.storage=B6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${B6(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 PO}from"path";var RO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),NO=[{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 EZ($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function TO($){let Z=[$];for(let Q of k($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!RO.has(Q.name))Z.push(PO($,Q.name));return Z}function AO($){let Z=0;if(M($,"manage.py")||M($,"pyproject.toml")||M($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function bZ($){return $$($,()=>CO($))}function CO($){let Z=[];for(let z of TO($)){let X=z===$,U=X?"":`cd ${z.slice($.length+1)} && `;for(let J of NO){let H=j(z,J.file);if(H===null)continue;let V=J.targets(H);if(V.length===0)continue;let Y={},G=EZ(V,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=EZ(V,[/^build$/i,/^compile$/i,/^build/i]),q=EZ(V,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(G)Y.test=`${U}${J.runner} ${G}`;if(W)Y.build=`${U}${J.runner} ${W}`;if(q)Y.lint=`${U}${J.runner} ${q}`;if(Object.keys(Y).length===0)continue;Z.push({score:Object.keys(Y).length+(X?10:AO(z)),commands:Y})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var jO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function yZ($){for(let Z of jO)if(M($,Z))return{security:{secrets:".env",example:Z}};return{}}function wO($,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 xZ($){return[wZ($),q6($),SZ($),bZ($),yZ($)].reduce(wO,{})}function zz($){try{let Z=o2($,{logLevel:"error"}).getIn(["project","type"],!0);return o(Z)&&typeof Z.comment==="string"&&Z.comment.includes(x2)}catch{return!1}}function gZ($){let Z=$4($),Q=xZ($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X=D$(z,Uz(Z));return uO(X),D$(X,c8($))}function Uz($){let Z={...$};if(h(Z.project)&&"goal"in Z.project)Z.project={...Z.project,goal:""};if(h(Z.human_context))Z.human_context=Object.fromEntries(Object.keys(Z.human_context).map((Q)=>[Q,""]));return Z}function SO($,Z){let Q=hO(L8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=CZ($),U=z,{project:J,human_context:H,...V}=xZ($),Y=D$(Q,V),G=D$(Y,Uz(U)),W=yO(D$(G,c8($)),Q),q=xO(EO(Z,Q,U)?gO(Xz(W,Q),Q,X):Xz(W,Q),Q);return s9(n9(Z,q))}function EO($,Z,Q){if(!l(Z0(Z,"project.type"))){let X=Z6($)?.text;return X===void 0||!zz(X)}return!(Q._meta?.found??[]).includes(x2)}function vZ($){return $.canonical?[$.path,$.canonical]:[$.path]}function Z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)?X[z]:void 0}function X2($,Z,Q){let[z,X]=Z.split("."),U=$[z];if(!h(U))return;if(Q===void 0?!(X in U):U[X]===Q)return;let J={...U};if(Q===void 0)delete J[X];else J[X]=Q;$[z]=J}var U2=($)=>typeof $==="string"&&$.trim()===_6;function bO($,Z){let Q=Z.map((z)=>Z0($,z));return Q.some(U2)&&Q.every((z)=>l(z)||U2(z))}function Xz($,Z){let Q={...$};for(let z of p){let X=vZ(z);if(!bO(Z,X))continue;for(let U of X){let J=Z0(Z,U);if(Z0(Q,U)!==J)X2(Q,U,J)}}return Q}function j2($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)&&Object.prototype.hasOwnProperty.call(X,z)}function yO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!j2(Z,z.canonical)||j2(Z,z.path))continue;let X=Z0(Q,z.path);X2(Q,z.path,void 0);let U=Z0(Q,z.canonical);if(Z4(X)&&l(U))X2(Q,z.canonical,X)}return Q}function xO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!j2(Z,z.canonical)||j2(Z,z.path))continue;let X=Z0(Q,z.canonical);if(Z4(X)||U2(X))X2(Q,z.path,X)}return Q}function gO($,Z,Q={}){let z=$.project,X=h(z)?z.type:void 0,U={...$};for(let J of p){if(J.category==="human"||J.category==="project")continue;let H=g2(X,J);if(H===null)return $;if(H){let V=typeof X==="string"&&F6[X]?.has(J.path)===!0;vO(U,Z,J,J.path.startsWith("stack.")?Q[J.path.slice(6)]:void 0,V)}else kO(U,J)}return U}function vO($,Z,Q,z,X=!1){let U=vZ(Q),J=(V)=>!l(Z0($,V))&&!U2(Z0($,V));for(let V of U){if(!U2(Z0($,V)))continue;if(X)X2($,V,U.some(J)?void 0:"");else if(!U2(Z0(Z,V)))X2($,V,j2(Z,V)?Z0(Z,V):"")}if(!Z4(z))return;let H=U.filter((V)=>j2($,V));if(H.some((V)=>!l(Z0($,V))))return;for(let V of H.length>0?H:[Q.path])X2($,V,z)}function kO($,Z){let Q=vZ(Z).filter((X)=>j2($,X)),z=(X)=>!l(Z0($,X))&&!U2(Z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(l(Z0($,X)))X2($,X,_6)}function hO($){let Z=$.project;if(Z===null||Z===void 0||h(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function uO($){let Z=$.project?.type??"library",Q=y2[Z]||y2.library;for(let z of p){if(Q.includes(z.category)||F6[Z]?.has(z.path))continue;let[X,U]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[U]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[U]="slotignored"}}function D$($,Z){return Jz($,Z,"")}function mO($){let Z=g0.get($);return Z!==void 0&&Z.category!=="human"}function Z4($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!l($)&&!U2($)}function fO($,Z){return mO($)&&Z4(Z)}function Jz($,Z,Q){let z={...$};for(let[X,U]of Object.entries(Z)){let J=z[X],H=Q?`${Q}.${X}`:X;if(H==="_meta"&&J!==void 0)continue;if(O$(J)){if(fO(H,U))z[X]=U;continue}if(l(J))z[X]=U;else if(h(U)&&h(J))z[X]=Jz(J,U,H)}return z}function Hz($,Z){let Q=Z.split("."),z=$;for(let X of Q){if(z===null||z===void 0||typeof z!=="object")return;z=z[X]}return z}var kZ=["project.goal","human_context.who","human_context.what","human_context.why","human_context.where","human_context.when","human_context.how"];function Yz($){return kZ.includes($)}function pO($,Z){if(Z)return null;let Q=j($,"package.json");if(Q===null)return null;try{let z=JSON.parse(Q).description;return typeof z==="string"&&z.trim()?z.trim():null}catch{return null}}function Gz($,Z){let z=($4($)._meta?.found??[]).some((W)=>W.startsWith("polyglot:")),X={},U=new Set(Z?kZ.filter((W)=>lO(Hz(Z,W))):[]),J=[],H=nO($),V=(W,q,K)=>{if(X[W]||U.has(W)||!q)return;let L=Wz(q,H),B=Vz(L),D=T2(L),I=D&&D!==L?Vz(D):null;if(!a(L)||oO(q,H)||rO(W,L)||J.some((O)=>aO(O,B)||O===I))return;if(J.push(B),I)J.push(I);X[W]={value:L,source:tO(K)}};sO($,V);let Y=pO($,z);V("project.goal",Y,"package.json description"),V("human_context.what",Y,"package.json description"),V("project.goal",q6($).project?.goal,"Cargo.toml description");let G=n8($,{toolingRoot:z});for(let W of["who","what","why","where","when","how"]){let q=G[W];if(q)V(`human_context.${W}`,q.value,q.source)}return X}function lO($){return O$($)||typeof $==="string"&&$.trim()!==""&&!l($)}function Wz($,Z=new Set){let Q=[],z=$.replace(/`([^`]+)`/g,(X,U)=>`${Q.push(U)-1}`);return iO(z.replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/(?<![\w\]])\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/(?<![\w\]])\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/(?<![\w\]])\[([^\]]+)\](?![[(:])/g,(X,U)=>Z.has(U.toLowerCase())?U:X).replace(/<\/?(?:a|b|i|em|strong|code|kbd|span|sup|sub|mark|small|u|s)\b[^>]*>/gi,"").replace(/_\*\*(.+?)\*\*_/g,"$1").replace(/\*\*_(.+?)_\*\*/g,"$1").replace(/[\s\S]*/,cO).replace(/(^|[^\w])(__)(?=\S)(.+?)(?<=\S)\2(?!\w|\.\w)/g,"$1$3").replace(/(^|[^\w])(_)(?=[^\s_])(.+?)(?<=[^\s_])\2(?!\w|\.\w)/g,"$1$3")).replace(/\uE000(\d+)\uE000/g,(X,U)=>Q[Number(U)]).replace(/\s+/g," ").trim()}function cO($){for(let Z=0;Z<4;Z++){let Q=$.replace(/(?<![\w/.*\\])(\*\*?)(?=[\p{L}\p{N}\p{Extended_Pictographic}])([^*\n]*?[\p{L}\p{N}.!?):])\1(?!\*)/gu,"$2");if(Q===$)break;$=Q}return $}var dO={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",bull:"•",mdash:"—",ndash:"–",hellip:"…",copy:"©",reg:"®",trade:"™"};function iO($){return $.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(Z,Q)=>{if(Q[0]!=="#")return dO[Q.toLowerCase()]??Z;let z=Q[1].toLowerCase()==="x"?Number.parseInt(Q.slice(2),16):Number(Q.slice(1));if(!Number.isFinite(z)||z<=31||z>1114111||z>=55296&&z<=57343)return Z;return String.fromCodePoint(z)})}function nO($){let Z=["README.md","README.MD","Readme.md","readme.md"].find((z)=>M($,z)),Q=Z?j($,Z)??"":"";return new Set([...Q.matchAll(/^ {0,3}\[([^\]]+)\]:\s*\S/gm)].map((z)=>z[1].toLowerCase()))}function rO($,Z){if($==="project.goal"||$==="human_context.what")return j3(Z);if($==="human_context.why")return/^[\p{L}\p{N}._-]+ (is|are) (a|an|the)\b/iu.test(Z);return!1}function sO($,Z){for(let[Q,z]of Object.entries(Zz($)))if(Yz(Q))Z(Q,z.value,z.source)}function oO($,Z){return Wz($.replace(/`[^`]*`/g," "),Z).includes("**")}function Vz($){return $.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function aO($,Z){let[Q,z]=$.length<=Z.length?[$,Z]:[Z,$];if(z.includes(Q)&&Q.length>=0.6*z.length)return!0;let X=new Set($.split(" ")),U=new Set(Z.split(" "));return[...X].filter((H)=>U.has(H)).length/new Set([...X,...U]).size>=0.7}function tO($){if($==="README:first-paragraph")return"README.md § first paragraph";if($==="README:first-sentence")return"README.md § first sentence";let Z=$.match(/^README:##\s*(.+)$/);if(Z)return`README.md § ${Z[1].trim()}`;return $.replace(/^package\.json:description$/,"package.json description")}function eO($,Z){let Q=Object.values(Gz($,Z)).filter((H)=>Boolean(H));if(Q.length===0)return null;let z=(H)=>{let V=H.split(/[\s:§]/)[0];return V==="README"?"README.md":V},X=[...new Set(Q.map((H)=>z(H.source)))].join(", "),[U,J]=Q.length===1?["suggestion","it"]:["suggestions","them"];return`${Q.length} ${U} for the goal and the six W's (${X}) — confirm ${J} in 'faf go'`}function $_($){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 qz($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function Z_($,Z={}){let Q=gZ($);if(Z.repoUrl&&Q.project&&!q0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=qz(Z.repoUrl);return Q}import{existsSync as Bz,lstatSync as Q_}from"fs";import{join as z_,basename as X_}from"path";import{createHash as U_}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),P0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",J_=/^v?\d+\.\d+\.\d+$/,H_=new Set(["birth","doubled","peak","current"]);function Mz($){return B0($)&&F0($.version)&&J_.test($.version)&&P0($.score)}var V_=($)=>P0($.birthDNA)?$.birthDNA:P0($.birthWeight)?$.birthWeight:null,Y_=($)=>B0($)&&P0($.birthDNA)&&F0($.born),Kz=($)=>B0($)&&F0($.born)&&P0($.birthDNA)&&P0($.lastScore)&&F0($.endedAt),G_=($)=>Array.isArray($)&&$.length>0&&$.every(Mz),W_=($)=>B0($)&&P0($.score)&&F0($.version),q_=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function Dz($){return B0($)&&Y_($.birthCertificate)&&G_($.versions)&&W_($.current)&&q_($.growth)}function B_($){try{return Q_($),!0}catch{return!1}}var hZ=($)=>`${JSON.stringify($,null,2)}
267
+ `,K_=new Set(["version","score","lastSync"]),D_=new Set(["type","score","date","version","label","emoji"]),Lz=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),uZ={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},Iz=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),Oz=($)=>Lz($.current,K_)&&Iz($).every((Z)=>Lz(Z,D_)),L_=($)=>Iz($).every((Z)=>Z.label===uZ[Z.type].label&&Z.emoji===uZ[Z.type].emoji);function M_($){return Oz($)&&L_($)}var I_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",O_=".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.",__=".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.",F_=".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.",P_=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function R_($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&H_.has(Z.type)&&P0(Z.score))}var w2=($,Z="")=>F0($)?$:Z;function N_($,Z){if(!Array.isArray($))return[];return $.filter(Mz).map((Q)=>({version:Q.version,timestamp:w2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(F0):[],growth:P0(Q.growth)?Q.growth:Q.score-Z}))}function T_($,Z,Q,z){return{version:w2($.version,Z?.version??"v1.0.0"),score:P0($.score)?$.score:Z?.score??Q,lastSync:w2($.lastSync,z)}}function A_($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=V_(Z);if(Q===null)return null;let z=w2(Z.born),X=N_($.versions,Q),U=T_(B0($.current)?$.current:{},X[X.length-1],Q,z),J=B0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"||Z.birthWeightSource==="legacy"?"legacy":"init",projectDNA:w2(Z.projectDNA),certificate:w2(Z.certificate)},versions:X,current:U,growth:{totalGrowth:U.score-Q,daysActive:P0(J.daysActive)?J.daysActive:0,milestones:R_(Array.isArray(J.milestones)?J.milestones:$.milestones)},lastModified:w2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(Kz)?{priorLineage:$.priorLineage.filter(Kz)}:{}}}class _z{projectPath;dnaPath;dna=null;own=!1;text;reason=null;constructor($){this.projectPath=$,this.dnaPath=z_($,".faf-dna")}exists(){return Bz(this.dnaPath)}birth($){if(u(this.projectPath,".faf-dna"),B_(this.dnaPath))throw new S("exists",this.dnaPath,`${this.dnaPath} is already there: a birth certificate is written once and never replaced — not written; original kept`);let Z=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.text=void 0,this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,U=$-X,J=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:J,timestamp:z,score:$,changes:Z,growth:U}),Q.current={version:J,score:$,lastSync:z},Q.growth.totalGrowth=U,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,J,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((U)=>U.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:F0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=F0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(F0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!Bz(this.dnaPath))return null;let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(Dz(Q)&&hZ(Q)===Z&&M_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=A_(Q),this.reason=!this.dna?P_:!Dz(Q)?I_:hZ(Q)!==Z?O_:Oz(Q)?F_:__;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 $=hZ(this.dna),Z=this.text??null;$0(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$}generateProjectDNA(){return U_("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=X_(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=(V)=>z.some((Y)=>Y.type===V),U=(V)=>z.push({type:V,score:$,date:Q,version:Z,...uZ[V]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))U("doubled");let J=z.find((V)=>V.type==="peak");if(!J||$>J.score){if(J)z.splice(z.indexOf(J),1);U("peak")}let H=z.findIndex((V)=>V.type==="current");if(H>=0)z.splice(H,1);U("current")}}import{join as UF}from"path";import{existsSync as e_,statSync as CC}from"fs";import{join as Sz}from"path";import{dirname as Az,resolve as Cz}from"path";var Pz=100;var C_="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",j_=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${C_})(?=\\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")],w_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],S_=["","-->","?>",">","]]>"],E_=/[#`~*+_=<>0-9-]/,b_=/(\d{1,9})([.)])/y,y_=/#{1,6}(?:[ \t]+|$)/y,x_=/`{3,}(?!.*`)|~{3,}/y,g_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,v_=/(?:=+|-+)[ \t]*$/y,k_=/[^ \t\f\v\r\n]/;function K6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var h_=($)=>$==="quote"||$==="list"||$==="item";function u_($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let U=$.length-1;U>=0;U--){let J=$[U],H=J===" "||J==="\t";for(let Y=0;Y<3;Y++)if(J==="*-_"[Y])z[Y]++;else if(!H)X[Y]=!1;let V="*-_".indexOf(J);Z[U]=V>=0&&X[V]&&z[V]>=3?1:0}return Z}var L$=($)=>$===" "||$==="\t";function m_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var Fz=($)=>$==="paragraph"||$==="code"||$==="html";function f_($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class R0{containers;stack=[{kind:"document"}];ln="";offset=0;column=0;nextNonspace=0;nextNonspaceColumn=0;indent=0;indented=!1;blank=!1;allClosed=!0;matched=0;htmlStarted=!1;hiddenIn=null;scannedFrom=-1;breaks=null;deep=!1;limit=-1;overflow=-1;starts;constructor($=!0){this.containers=$;this.starts=[()=>this.startQuote(),()=>this.startHeading(),()=>this.startFence(),(Z)=>this.startHtml(Z),(Z)=>this.startSetext(Z),()=>this.startBreak(),(Z)=>this.startItem(Z),()=>this.startIndentedCode()]}clone(){let $=new R0(this.containers);return $.stack=this.stack.map(f_),$.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}>`:S_[$.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"&&Fz(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!E_.test(this.ln.charAt(z)))break;let X=0;for(let U of this.starts)if(X=U(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!Fz($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=w_[$.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),L$(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?K6(g_,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&&L$(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??=u_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),L$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!K6(y_,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:K6(x_,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let U=j_[X-1].exec(z);if(U)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?U[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!K6(v_,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||L$(z)))return null;if(Z&&!k_.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"?K6(b_,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&&L$(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,L$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!m_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),h_($.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 -->",Rz="\uFEFF";function L6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var M$=($)=>$.replace(/\r?\n$|\r$/,""),jz=($)=>M$($).replace(/^\uFEFF/,"").trimEnd();function*mZ($){let Z=0;for(let Q of L6($)){let z=M$(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 p_($,Z,Q,z){let X=$.some((J)=>J.start!==-1)&&z(Z.content),U=Q(Z.content);for(let J of $)if(J.start!==-1&&X)J.found={start:J.start,end:Z.to};else if(U)J.start=Z.from}function fZ($,Z,Q){let[z,X]=[new R0(!0),new R0(!1)].map((U)=>({reader:U,start:-1,found:null}));for(let U of mZ($)){let J=[z,X].map((V)=>V.reader.line(U.content));if(z.reader.tooDeep)return null;let H=[z,X].filter((V,Y)=>J[Y]===null);if(H.length>0)p_(H,U,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var Nz=($)=>(Z)=>Z===$;function S2($,Z=b0,Q=y0){return fZ($,Nz(Z),Nz(Q))}function Tz($,Z){let Q=[];for(let z of[!0,!1]){let X=new R0(z);for(let U of L6($))X.line(M$(U));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var l_=16;function c_($){let Z=new R0(!0);return $.map((Q)=>{let z=Z.overflowAt(M$(Q),l_),X=Q;if(z>=0){let U=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),J=U?z+U[0].length:z;X=`${Q.slice(0,J)}\\${Q.slice(J)}`}return Z.line(M$(X)),X})}function d_($,Z,Q){let X=c_(L6($).map((J)=>{let H=jz(J);return H===Z||H===Q?` ${J}`:J})).join(""),U=Tz(X,Q);while(U.length>0&&U[0]!==null){let J=`${X}
268
+ ${U[0]}`,H=Tz(J,Q);if(H.length>=U.length)break;X=J,U=H}return X}function i_($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=L6(z).map((U)=>M$(U)===""?`>${U}`:`> ${U}`).join("");return`${Z}
269
269
  ${X}
270
- ${Q}`}function D6($,Z,Q,z=E0,X=b0,U="the file"){let J=(V)=>{let Y=`${$}${V}${Q}`,G=S2(Y,z,X);return G&&G.start===$.length&&G.end===$.length+V.length?Y:null},H=J(Z)??J(c_(Z,z,X));if(H===null)throw new S("unplaceable",U,`${U}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return H}function fZ($,Z=E0,Q=b0){return`${Z}
271
- ${l_($.trim(),Z,Q)}
272
- ${Q}`}function Z4($,Z,Q=E0,z=b0,X){if($===null)return D6("",Z,`
270
+ ${Q}`}function D6($,Z,Q,z=b0,X=y0,U="the file"){let J=(V)=>{let Y=`${$}${V}${Q}`,G=S2(Y,z,X);return G&&G.start===$.length&&G.end===$.length+V.length?Y:null},H=J(Z)??J(i_(Z,z,X));if(H===null)throw new S("unplaceable",U,`${U}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return H}function pZ($,Z=b0,Q=y0){return`${Z}
271
+ ${d_($.trim(),Z,Q)}
272
+ ${Q}`}function Q4($,Z,Q=b0,z=y0,X){if($===null)return D6("",Z,`
273
273
  `,Q,z,X);let U=S2($,Q,z);if(U)return D6($.slice(0,U.start),Z,$.slice(U.end),Q,z,X);let J=$.startsWith(Rz)?Rz:"";return D6(J,Z,`
274
274
 
275
- ${$.slice(J.length)}`,Q,z,X)}function M6($){try{return Q0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function N0($,Z,Q=E0,z=b0,X={}){let U=fZ(Z,Q,z),J=Cz($),H=X.root??Az(J),V=m(H,J),Y=M6(V);$0(V,Z4(Y,U,Q,z,J),{root:H,expect:Y})}var d_="<!-- faf:";function i_($){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 n_($,Z){let Q=[new R0(!0),new R0(!1)],z=!1;for(let{content:X}of uZ($)){if(z){if(X===Z)return"too deep";continue}let[U,J]=Q.map((V)=>V.line(X));z=Q[0].tooDeep;let H=U??J;if(X===Z&&(z||H!==null))return z?"too deep":H}return null}function r_($,Z,Q){let z=[new R0(!0),new R0(!1)];for(let{content:X}of uZ($)){let U=z.map((J)=>J.line(X));if(z[0].tooDeep)return!1;if((X===Z||X===Q)&&U.some((J)=>J===null))return!0}return!1}function Q4($,Z,Q=E0,z=b0){if(Z===null||S2(Z,Q,z))return null;let X=jz(L6(Z)[0]??"");if(X.startsWith(d_)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let U=n_(Z,Q);if(U==="too deep")return`${$}: faf's block is now on top; the file nests more than ${Pz} lists or quotes before an older faf block, so faf did not read that far — the older block is left as you had it; delete it by hand if you no longer want it.`;if(U!==null)return`${$}: faf's block is now on top; an older faf block below sits inside ${i_(U)} and is left as you had it — delete it by hand if you no longer want it.`;if(r_(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 s_($,Z,Q=E0,z=b0,X={}){try{let U=Cz($);return Q4(Z,M6(m(X.root??Az(U),U)),Q,z)}catch{return null}}var o_=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 pZ($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return o_.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function n($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function z0($){let Z=x0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return pZ(Q)}var lZ=e.claude,t_="STATUS: SYNC ACTIVE";function e_($){let Z=Sz($,lZ);if(!a_(Z))return null;return Q0(m($,lZ))}function $F($,Z){N0(Sz($,lZ),Z)}function y0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),U=String($.project?.goal??"").trim(),J=`<!-- faf: ${[Q,z,X,U].join(" | ")} -->`,H=[];if(Z.doc)H.push(`doc=${Z.doc}`);else H.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")H.push(`score=${Z.score}`);if(H.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)H.push(`siblings=${Z.siblings.join(",")}`);let V=`<!-- faf: ${H.join(" | ")} -->`;return`${J}
276
- ${V}`}function ZF($){let Z=[],Q=$.project?.name??"Project",z=$.project?.main_language??"",X=$.project?.goal??"";if(Z.push(y0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),X)Z.push("## What This Is"),Z.push(""),Z.push(X),Z.push("");let U=$.stack??{},J=[];if(z)J.push(`**Language:** ${z}`);for(let[Y,G]of Object.entries(U))if(G&&G!=="slotignored"&&String(G).trim())J.push(`**${z0(`stack.${Y}`)}:** ${G}`);if(J.length>0){Z.push("## Stack"),Z.push("");for(let Y of J)Z.push(`- ${Y}`);Z.push("")}let H=$.human_context??{},V=[["who",H.who],["what",H.what],["why",H.why],["where",H.where],["when",H.when],["how",H.how]].filter(([,Y])=>Y&&String(Y).trim()).map(([Y,G])=>`- **${z0(`human_context.${Y}`)}:** ${G}`);if(V.length>0)Z.push("## Context"),Z.push(""),Z.push(...V),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${t_} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
277
- `)}function wz($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function QF($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=wz(Q[1].trim());if(!Z.project.name){let U=$.match(/\*\*Name:\*\*\s*(.+)/);if(U)Z.project.name=wz(U[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let U=$.match(/\*\*What Building:\*\*\s*(.+)/);if(U)Z.project.goal=U[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let U=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(U)Z.project.main_language=U[1].trim()}return Z}function E2($){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 J2($){return E2($).cmd}var H0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Ez=($)=>Array.isArray($)?$.join(", "):String($),XF=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),UF=new Set(["target_user","core_problem","mission_purpose"]);function bz($){let Z=[],Q=(A="")=>Z.push(A),z=$.ai_instructions,X=$.preferences,U=$.instant_context,J=$.security,H=$.commands,V=$.key_files??U?.key_files,Y=H0($.project?.default_branch)?String($.project?.default_branch):"main",G=H?Object.entries(H).filter(([,A])=>H0(A)):[],W=G.filter(([A])=>/test/i.test(A)),q=G.filter(([A])=>/lint|check/i.test(A)&&!/test/i.test(A)),K=G.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},B=[...K].sort((A,b)=>L(A[0])-L(b[0])||A[0].localeCompare(b[0])),D=[...W,...q],I=B.find(([A])=>/build/i.test(A)),O=W[0]?J2(W[0][1]):void 0,C=I?J2(I[1]):void 0;Q(y0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let P=[];if($.project?.main_language)P.push(String($.project.main_language));if(H0($.project?.type))P.push(`type: ${String($.project?.type)}`);if(H0($.project?.version))P.push(`v${String($.project?.version)}`);let N=$.project?.goal?String($.project.goal).trim():"";if(P.length)N+=(N?" — ":"")+P.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(),B.length){Q("## Setup & build"),Q(),Q("```bash");for(let[A,b]of B){let{cmd:y,note:K0}=E2(b);Q(`${y} # ${K0??A}`)}Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,A]of D){let{cmd:b,note:y}=E2(A);Q(y?`${b} # ${y}`:b)}Q("```"),Q()}if(V&&V.length){Q("## Where things live"),Q();let A=V.map((b)=>{let y=String(b),K0=y.indexOf(" — ");return K0>0?{path:y.slice(0,K0),role:y.slice(K0+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,w=(A)=>{if(!A)return;for(let[b,y]of Object.entries(A)){if(XF.has(b)||!H0(y))continue;let K0=pZ(b);if(!T.has(K0))T.set(K0,Ez(y))}};w(z?.working_style),w(X);let F=$.conventions??[];if(T.size||F.length){Q("## Conventions"),Q();for(let[A,b]of T)Q(`- **${A}:** ${b}`);for(let A of F)if(H0(A))Q(`- ${A}`);Q()}let E=(z?.warnings??[]).filter((A)=>H0(A)),r=["read the tree"];if(O)r.push(`run the tests (\`${O}\`)`);if(C)r.push("build the project");for(let[,A]of q.slice(0,1))r.push(`\`${J2(A)}\``);Q("## Guardrails"),Q();for(let A of E)Q(`- ${A}`);Q(`- **Always OK:** ${[...new Set(r)].join(" · ")}.`),Q("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),Q(`- **Never:** force-push · push straight to \`${Y}\` (branch and open a PR) · commit secrets.`),Q();let t=[];for(let[,A]of q)t.push(`\`${J2(A)}\` exits 0`);for(let[,A]of W)t.push(`\`${J2(A)}\` passes`);if(t.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(t)].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 \`${Y}\`.`),Q(),J&&(H0(J.secrets)||(J.never??[]).length)){if(Q("## Security & secrets"),Q(),H0(J.secrets)){let A=H0(J.example)?` (see \`${J.example}\`)`:"";Q(`- Secrets live in \`${J.secrets}\`${A}. Never read or commit them.`)}for(let A of J.never??[])if(H0(A))Q(`- Never read or commit \`${A}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&H0(X.commit_style))Q(`- Commit style: ${Ez(X.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${Y}\` and open a PR — never commit to \`${Y}\` 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(UF.has(b))continue;if(n(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(H0(v))Q(`*Context authored: ${String(v)}*`);return Z.join(`
278
- `)}function JF($,Z){N0(zF($,e.agents),bz(Z))}import{join as HF}from"path";var VF=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),YF=new Set(["target_user","core_problem","mission_purpose"]);function yz($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,U=z?Object.entries(z).filter(([,q])=>VF(q)):[],J=U.filter(([q])=>/test/i.test(q)),H=U.filter(([q])=>/lint|check/i.test(q)&&!/test/i.test(q)),V=U.filter(([q])=>!/test|lint|check/i.test(q)),Y=(q)=>{let K=q.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},G=[...V].sort((q,K)=>Y(q[0])-Y(K[0])||q[0].localeCompare(K[0])),W=[...J,...H];if(Z.push(y0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(G.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[q,K]of G){let{cmd:L,note:B}=E2(K);Z.push(`${L} # ${B??q}`)}Z.push("```")}if(W.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,q]of W){let{cmd:K,note:L}=E2(q);Z.push(L?`${K} # ${L}`:K)}Z.push("```")}if(X&&X.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let q of X)Z.push(`- \`${q}\``)}if($.stack){let q=[];for(let[K,L]of Object.entries($.stack)){if(YF.has(K))continue;if(n(L))q.push(`- ${z0(`stack.${K}`)}: ${L.trim()}`)}if(q.length){Z.push(""),Z.push("## Stack");for(let K of q)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(`
279
- `)}function GF($,Z){N0(HF($,e.gemini),yz(Z))}import{join as WF}from"path";function xz($){let Z=[];if(Z.push(y0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Authored from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[Q,z]of Object.entries($.stack))if(n(z))Z.push(`# ${z0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
280
- `)}function qF($,Z){N0(WF($,e.cursorrules),xz(Z),"# faf:start","# faf:end")}import{join as BF}from"path";var gz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],KF=new Set([...gz.map(([$])=>$),"cicd"]);function vz($){let Z=[],Q=$.project?.name??"Project";if(Z.push(y0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${Q}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),n($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(n($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[Y,G]of Object.entries(z)){if(KF.has(Y))continue;if(n(G))X.push(`- **${z0(`stack.${Y}`)}:** ${G.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let U=[];for(let[Y,G]of gz){let W=z[Y];if(n(W))U.push(`- ${G} \`${W.trim()}\`.`)}if(n(z.cicd))U.push(`- CI runs on ${z.cicd.trim()}.`);if(U.length>0)Z.push("## Build & run","",...U,"");let J=$.human_context??{},V=[["who",J.who],["what",J.what],["why",J.why],["where",J.where],["when",J.when],["how",J.how]].filter(([,Y])=>n(Y)).map(([Y,G])=>`- **${z0(`human_context.${Y}`)}:** ${G.trim()}`);if(V.length>0)Z.push("## Project context","",...V,"");return Z.join(`
281
- `)}function DF($,Z){Z$($,".github"),N0(BF($,".github",e.copilot),vz(Z),E0,b0,{root:$})}import{existsSync as LF,lstatSync as fz,readFileSync as X4,realpathSync as cZ,statSync as MF}from"fs";import{homedir as IF}from"os";import{basename as OF,dirname as dZ,join as T0,resolve as b2}from"path";var kz=200,hz=200,uz=12,_F="# Project Context (from project.faf)",FF="*This section is managed by tri-sync.";function PF($){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<=kz)return Z;return`${Z.slice(0,kz)}-${Math.abs(PF($)).toString(36)}`}function lz($){try{let Z=fz($);if(Z.isSymbolicLink()){let Q=MF($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function mz($){try{return fz($).isFile()}catch{return!1}}function RF($){let Z=$;for(;;){if(lz(T0(Z,".git")))return Z;let Q=dZ(Z);if(Q===Z)return null;Z=Q}}function NF($){let Z;try{Z=X4(T0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=b2($,Z.slice(7).trim()),z=T0(Q,"commondir");if(!mz(z))return $;let X=b2(Q,X4(z,"utf-8").trim());if(b2(dZ(Q))!==T0(X,"worktrees"))return $;let U=T0(Q,"gitdir");if(!mz(U))return $;let J=X4(U,"utf-8").trim();if(cZ(b2(Q,J))!==T0(cZ($),".git"))return $;if(OF(X)!==".git")return lz(T0(X,".git"))?$:X;return dZ(X)}catch{return $}}function cz($){let Z=b2($);try{Z=cZ.native(Z)}catch{}let Q=RF(Z);return(Q?NF(Q):Z).normalize("NFC")}function J4($,Z={}){if(Z.memoryDir)return b2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||T0(IF(),".claude");return T0(b2(Q),"projects",pz(cz($)),"memory").normalize("NFC")}function TF($,Z={}){return T0(J4($,Z),e.memory)}var AF=new Set(["target_user","core_problem","mission_purpose"]),CF=["who","what","why","where","when","how"];function dz($){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:** ${n(Z.name)?Z.name:"Project"}`,...Q.filter(([,J])=>n(J)).map(([J,H])=>`- **${J}:** ${H}`),...z4("Stack",Object.entries($.stack??{}).filter(([J,H])=>!AF.has(J)&&n(H)).map(([J,H])=>`- **${z0(`stack.${J}`)}:** ${H}`)),...z4("Context",CF.filter((J)=>n(z[J])).map((J)=>`- **${z0(`human_context.${J}`)}:** ${z[J]}`)),...z4("Commands",Object.entries($.commands??{}).filter(([,J])=>n(J)).slice(0,uz).map(([J,H])=>`- ${J}: \`${J2(H)}\``)),...z4("Key files",X.filter(n).slice(0,uz).map((J)=>`- ${J}`)),"","*faf keeps this block in step with project.faf. Everything outside it is Claude's own and is kept as written.*"].join(`
282
- `)}function z4($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function iz($){return mZ($,(Z)=>Z.trimEnd()===_F,(Z)=>Z.startsWith(FF))}function U4($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function jF($,Z,Q){if($===null)return{text:Z4(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=S2($),X=z??iz($);if(X){let J=$.slice(0,X.start),H=$.slice(X.end);return{text:D6(J,Z,H,void 0,void 0,Q),action:z?"updated":"migrated",head:J,tail:H}}let U=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:Z4($,Z,void 0,void 0,Q),action:"added",head:U,tail:$.slice(U.length)}}function iZ($){return $>hz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${hz}; lines after that are kept in the file but not loaded.`]:[]}function wF($,Z={}){let Q=J4($,Z),z=T0(Q,e.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!LF(Q))return X;let U=M6(m(Q,e.memory));if(U===null)return X;let J=S2(U),H=J?`${U.slice(0,J.start)}${U.slice(J.end)}`:U,V=U4(U);return{path:z,exists:!0,lines:V,hasBlock:J!==null,blockLines:J?U4(U.slice(J.start,J.end)):0,hasLegacySection:!J&&iz(U)!==null,otherLines:H.split(/\r\n|\r|\n/).filter((Y)=>Y.replace(/^\uFEFF/,"").trim()!=="").length,warnings:iZ(V)}}function SF($,Z,Q={}){let z=J4($,Q);Z$(z);let X=m(z,e.memory),U=M6(X),J=jF(U,fZ(dz(Z)),X);if(J.text===U){let q=U4(U);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:q,warnings:iZ(q)}}let H=$0(X,J.text,{root:z,expect:U}),V=X4(H,"utf-8"),Y=V===J.text&&V.startsWith(J.head)&&V.endsWith(J.tail),G=U4(V),W=J.action==="added"?Q4(e.memory,U):null;return{path:H,action:J.action,written:!0,preserved:Y,lines:G,warnings:[...W?[W]:[],...iZ(G)]}}function EF($,Z){let Q=[],z=(V)=>M($,V),X=(V)=>j($,V)??"";if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let U=[],J=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in J)U.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in J)U.push("Prettier");let H=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(H))U.push("black");if(/\[tool\.ruff\]/.test(H))U.push("ruff");if(/\[tool\.mypy\]/.test(H))U.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))U.push("rustfmt");if(U.length)Q.push(`Style enforced by ${U.join(" · ")} — obey the configs`);return Q}function bF($,Z){let Q={...Z},z=null,X=j($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let U=t8($,z);if(Object.keys(U).length)Q.commands={...U,...Z.commands??{}};let J=Z.key_files??Z.instant_context?.key_files;if(!J||J.length===0){let H=a8($);if(H.length)Q.key_files=H}if(!Z.security){let V=[".env",".env.local",".env.development"].find((Y)=>M($,Y));if(V){let Y=[".env.example",".env.sample",".env.template"].find((G)=>M($,G));Q.security={secrets:V,...Y?{example:Y}:{}}}}if(!Z.conventions){let H=EF($,z);if(H.length)Q.conventions=H}return Q}export{CD as writeServerCard,tK as writeProjectHtml,GF as writeGeminiMd,qK as writeFaf,qF as writeCursorrules,DF as writeCopilotInstructions,SF as writeClaudeMemory,$F as writeClaudeMd,JF as writeAgentsMd,BX as validateFaf,P2 as utcNow,hD as upsertCatalog,HK as updateFafFile,jO as updateExistingFaf,l8 as turboCatSlots,A3 as turboCatScan,aO as suggestionNote,Gz as suggestIntent,tz as slotsByCategory,QQ as serializeFaf,J3 as seedSixWsFromGoal,qX as scoreText,B4 as scoreFafYaml,$0 as safeWriteFile,NB as safeUnlink,_9 as safeReplaceOwned,IL as runLoop,m as resolveInside,TF as resolveClaudeMemoryPath,J4 as resolveClaudeMemoryDir,qz as repoNameFromUrl,a5 as renderProjectHtml,yz as renderGeminiMd,xz as renderCursorrules,vz as renderCopilotInstructions,dz as renderClaudeMemory,ZF as renderClaudeMd,bz as renderAgentsMd,i8 as relentlessContextDetailed,LI as relentlessContext,y8 as registryTitle,HZ as registryName,O2 as registryMeta,Q0 as readUtf8,yD as readFafa,UQ as readFafRaw,JK as readFaf,e_ as readClaudeMd,DZ as questionForSlot,RL as publicQuestions,xQ as projectServerJson,S8 as projectServerCard,kQ as projectPack,cD as projectCards,vQ as projectArd,gQ as projectAiCatalog,j8 as projectA2ACard,jD as patchServerJson,QF as parseClaudeMd,tO as normalizeGitUrl,v8 as normalizeAnswer,zZ as mcpName,Z$ as makeDirInside,Y3 as loopVerdict,s_ as legacyStampNoteAt,Q4 as legacyStampNote,q4 as kernel,l as isPlaceholder,LK as isNonProjectRoot,Yz as isIntentPath,H3 as isHumanSlot,ZX as isExplicitNone,g8 as isEmptyValue,YL as interviewForMissing,N0 as injectFafBlock,NL as gradeAnswers,P$ as getTier,XX as getNextTier,wD as generateServerCard,eK as generateProjectHtml,gD as generateA2ACard,$3 as fromClaudeDir,xD as findFafaFile,JQ as findFafFile,S2 as findFafBlock,K$ as fillEmpties,wQ as fafaYaml,U$ as fafaDomain,y0 as fafMetaTag,w0 as fafContextBlock,$1 as enrichScore,bF as enrichFromRepo,PL as deriveQuestionSet,PK as computeDrift,cz as claudeProjectRoot,pz as claudeProjectId,wF as claudeMemoryStatus,V3 as classifyGaps,V$ as canonicalPriority,LL as buildTableOf8,X6 as buildServerCard,TL as buildReceipt,_D as buildPack,VZ as buildA2ACard,eO as authorFafFromRepo,xZ as assembleFreshFaf,jQ as answersToFafa,B3 as answersMatch,g0 as TIERS,S as SafePathError,X3 as STACK_INTERVIEW,x0 as SLOT_BY_PATH,p as SLOTS,_6 as SLOTIGNORED,KZ as SIX_WS_INTERVIEW,RQ as SERVER_JSON_SCHEMA,C8 as SERVER_CARD_SCHEMA,t5 as REGISTRY_PUBLISHER_KEY,Z2 as PRIORITY_RANK,YZ as PRIORITY_ORDER,O6 as PLACEHOLDERS,x8 as KNOWLEDGE_TYPES,z3 as INTERVIEW_VERSION,VL as INTERVIEW_PATHS,U3 as INTERVIEW_BY_PATH,G$ as INTERVIEW,vZ as INTENT_PATHS,W0 as FafmSoul,_z as FafDNAManager,E0 as FAF_START,_$ as FAF_HEX,b0 as FAF_END,oZ as EXPLICIT_NONE,$X as ENTERPRISE_SLOTS,MZ as BENCH_VERSION,ez as BASE_SLOTS,q3 as ALIAS_GROUPS,X$ as A2A_CONTEXT_URI};
275
+ ${$.slice(J.length)}`,Q,z,X)}function M6($){try{return Q0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function N0($,Z,Q=b0,z=y0,X={}){let U=pZ(Z,Q,z),J=Cz($),H=X.root??Az(J),V=u(H,J),Y=M6(V);$0(V,Q4(Y,U,Q,z,J),{root:H,expect:Y})}var n_="<!-- faf:";function r_($){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 s_($,Z){let Q=[new R0(!0),new R0(!1)],z=!1;for(let{content:X}of mZ($)){if(z){if(X===Z)return"too deep";continue}let[U,J]=Q.map((V)=>V.line(X));z=Q[0].tooDeep;let H=U??J;if(X===Z&&(z||H!==null))return z?"too deep":H}return null}function o_($,Z,Q){let z=[new R0(!0),new R0(!1)];for(let{content:X}of mZ($)){let U=z.map((J)=>J.line(X));if(z[0].tooDeep)return!1;if((X===Z||X===Q)&&U.some((J)=>J===null))return!0}return!1}function z4($,Z,Q=b0,z=y0){if(Z===null||S2(Z,Q,z))return null;let X=jz(L6(Z)[0]??"");if(X.startsWith(n_)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let U=s_(Z,Q);if(U==="too deep")return`${$}: faf's block is now on top; the file nests more than ${Pz} lists or quotes before an older faf block, so faf did not read that far — the older block is left as you had it; delete it by hand if you no longer want it.`;if(U!==null)return`${$}: faf's block is now on top; an older faf block below sits inside ${r_(U)} and is left as you had it — delete it by hand if you no longer want it.`;if(o_(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 a_($,Z,Q=b0,z=y0,X={}){try{let U=Cz($);return z4(Z,M6(u(X.root??Az(U),U)),Q,z)}catch{return null}}var t_=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 lZ($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return t_.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function n($){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 lZ(Q)}var cZ=e.claude,$F="STATUS: SYNC ACTIVE";function ZF($){let Z=Sz($,cZ);if(!e_(Z))return null;return Q0(u($,cZ))}function QF($,Z){N0(Sz($,cZ),Z)}function x0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),U=String($.project?.goal??"").trim(),J=`<!-- faf: ${[Q,z,X,U].join(" | ")} -->`,H=[];if(Z.doc)H.push(`doc=${Z.doc}`);else H.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")H.push(`score=${Z.score}`);if(H.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)H.push(`siblings=${Z.siblings.join(",")}`);let V=`<!-- faf: ${H.join(" | ")} -->`;return`${J}
276
+ ${V}`}function zF($){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 U=$.stack??{},J=[];if(z)J.push(`**Language:** ${z}`);for(let[Y,G]of Object.entries(U))if(G&&G!=="slotignored"&&String(G).trim())J.push(`**${z0(`stack.${Y}`)}:** ${G}`);if(J.length>0){Z.push("## Stack"),Z.push("");for(let Y of J)Z.push(`- ${Y}`);Z.push("")}let H=$.human_context??{},V=[["who",H.who],["what",H.what],["why",H.why],["where",H.where],["when",H.when],["how",H.how]].filter(([,Y])=>Y&&String(Y).trim()).map(([Y,G])=>`- **${z0(`human_context.${Y}`)}:** ${G}`);if(V.length>0)Z.push("## Context"),Z.push(""),Z.push(...V),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${$F} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
277
+ `)}function wz($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function XF($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=wz(Q[1].trim());if(!Z.project.name){let U=$.match(/\*\*Name:\*\*\s*(.+)/);if(U)Z.project.name=wz(U[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let U=$.match(/\*\*What Building:\*\*\s*(.+)/);if(U)Z.project.goal=U[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let U=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(U)Z.project.main_language=U[1].trim()}return Z}function E2($){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 J2($){return E2($).cmd}var H0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Ez=($)=>Array.isArray($)?$.join(", "):String($),JF=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),HF=new Set(["target_user","core_problem","mission_purpose"]);function bz($){let Z=[],Q=(A="")=>Z.push(A),z=$.ai_instructions,X=$.preferences,U=$.instant_context,J=$.security,H=$.commands,V=$.key_files??U?.key_files,Y=H0($.project?.default_branch)?String($.project?.default_branch):"main",G=H?Object.entries(H).filter(([,A])=>H0(A)):[],W=G.filter(([A])=>/test/i.test(A)),q=G.filter(([A])=>/lint|check/i.test(A)&&!/test/i.test(A)),K=G.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},B=[...K].sort((A,b)=>L(A[0])-L(b[0])||A[0].localeCompare(b[0])),D=[...W,...q],I=B.find(([A])=>/build/i.test(A)),O=W[0]?J2(W[0][1]):void 0,C=I?J2(I[1]):void 0;Q(x0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let P=[];if($.project?.main_language)P.push(String($.project.main_language));if(H0($.project?.type))P.push(`type: ${String($.project?.type)}`);if(H0($.project?.version))P.push(`v${String($.project?.version)}`);let N=$.project?.goal?String($.project.goal).trim():"";if(P.length)N+=(N?" — ":"")+P.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(),B.length){Q("## Setup & build"),Q(),Q("```bash");for(let[A,b]of B){let{cmd:y,note:K0}=E2(b);Q(`${y} # ${K0??A}`)}Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,A]of D){let{cmd:b,note:y}=E2(A);Q(y?`${b} # ${y}`:b)}Q("```"),Q()}if(V&&V.length){Q("## Where things live"),Q();let A=V.map((b)=>{let y=String(b),K0=y.indexOf(" — ");return K0>0?{path:y.slice(0,K0),role:y.slice(K0+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,w=(A)=>{if(!A)return;for(let[b,y]of Object.entries(A)){if(JF.has(b)||!H0(y))continue;let K0=lZ(b);if(!T.has(K0))T.set(K0,Ez(y))}};w(z?.working_style),w(X);let F=$.conventions??[];if(T.size||F.length){Q("## Conventions"),Q();for(let[A,b]of T)Q(`- **${A}:** ${b}`);for(let A of F)if(H0(A))Q(`- ${A}`);Q()}let E=(z?.warnings??[]).filter((A)=>H0(A)),r=["read the tree"];if(O)r.push(`run the tests (\`${O}\`)`);if(C)r.push("build the project");for(let[,A]of q.slice(0,1))r.push(`\`${J2(A)}\``);Q("## Guardrails"),Q();for(let A of E)Q(`- ${A}`);Q(`- **Always OK:** ${[...new Set(r)].join(" · ")}.`),Q("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),Q(`- **Never:** force-push · push straight to \`${Y}\` (branch and open a PR) · commit secrets.`),Q();let t=[];for(let[,A]of q)t.push(`\`${J2(A)}\` exits 0`);for(let[,A]of W)t.push(`\`${J2(A)}\` passes`);if(t.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(t)].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 \`${Y}\`.`),Q(),J&&(H0(J.secrets)||(J.never??[]).length)){if(Q("## Security & secrets"),Q(),H0(J.secrets)){let A=H0(J.example)?` (see \`${J.example}\`)`:"";Q(`- Secrets live in \`${J.secrets}\`${A}. Never read or commit them.`)}for(let A of J.never??[])if(H0(A))Q(`- Never read or commit \`${A}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&H0(X.commit_style))Q(`- Commit style: ${Ez(X.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${Y}\` and open a PR — never commit to \`${Y}\` 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(HF.has(b))continue;if(n(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(H0(v))Q(`*Context authored: ${String(v)}*`);return Z.join(`
278
+ `)}function VF($,Z){N0(UF($,e.agents),bz(Z))}import{join as YF}from"path";var GF=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),WF=new Set(["target_user","core_problem","mission_purpose"]);function yz($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,U=z?Object.entries(z).filter(([,q])=>GF(q)):[],J=U.filter(([q])=>/test/i.test(q)),H=U.filter(([q])=>/lint|check/i.test(q)&&!/test/i.test(q)),V=U.filter(([q])=>!/test|lint|check/i.test(q)),Y=(q)=>{let K=q.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},G=[...V].sort((q,K)=>Y(q[0])-Y(K[0])||q[0].localeCompare(K[0])),W=[...J,...H];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(G.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[q,K]of G){let{cmd:L,note:B}=E2(K);Z.push(`${L} # ${B??q}`)}Z.push("```")}if(W.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,q]of W){let{cmd:K,note:L}=E2(q);Z.push(L?`${K} # ${L}`:K)}Z.push("```")}if(X&&X.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let q of X)Z.push(`- \`${q}\``)}if($.stack){let q=[];for(let[K,L]of Object.entries($.stack)){if(WF.has(K))continue;if(n(L))q.push(`- ${z0(`stack.${K}`)}: ${L.trim()}`)}if(q.length){Z.push(""),Z.push("## Stack");for(let K of q)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(`
279
+ `)}function qF($,Z){N0(YF($,e.gemini),yz(Z))}import{join as BF}from"path";function xz($){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(n(z))Z.push(`# ${z0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
280
+ `)}function KF($,Z){N0(BF($,e.cursorrules),xz(Z),"# faf:start","# faf:end")}import{join as DF}from"path";var gz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],LF=new Set([...gz.map(([$])=>$),"cicd"]);function vz($){let Z=[],Q=$.project?.name??"Project";if(Z.push(x0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${Q}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),n($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(n($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[Y,G]of Object.entries(z)){if(LF.has(Y))continue;if(n(G))X.push(`- **${z0(`stack.${Y}`)}:** ${G.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let U=[];for(let[Y,G]of gz){let W=z[Y];if(n(W))U.push(`- ${G} \`${W.trim()}\`.`)}if(n(z.cicd))U.push(`- CI runs on ${z.cicd.trim()}.`);if(U.length>0)Z.push("## Build & run","",...U,"");let J=$.human_context??{},V=[["who",J.who],["what",J.what],["why",J.why],["where",J.where],["when",J.when],["how",J.how]].filter(([,Y])=>n(Y)).map(([Y,G])=>`- **${z0(`human_context.${Y}`)}:** ${G.trim()}`);if(V.length>0)Z.push("## Project context","",...V,"");return Z.join(`
281
+ `)}function MF($,Z){Z$($,".github"),N0(DF($,".github",e.copilot),vz(Z),b0,y0,{root:$})}import{existsSync as IF,lstatSync as fz,readFileSync as U4,realpathSync as dZ,statSync as OF}from"fs";import{homedir as _F}from"os";import{basename as FF,dirname as iZ,join as T0,resolve as b2}from"path";var kz=200,hz=200,uz=12,PF="# Project Context (from project.faf)",RF="*This section is managed by tri-sync.";function NF($){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<=kz)return Z;return`${Z.slice(0,kz)}-${Math.abs(NF($)).toString(36)}`}function lz($){try{let Z=fz($);if(Z.isSymbolicLink()){let Q=OF($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function mz($){try{return fz($).isFile()}catch{return!1}}function TF($){let Z=$;for(;;){if(lz(T0(Z,".git")))return Z;let Q=iZ(Z);if(Q===Z)return null;Z=Q}}function AF($){let Z;try{Z=U4(T0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=b2($,Z.slice(7).trim()),z=T0(Q,"commondir");if(!mz(z))return $;let X=b2(Q,U4(z,"utf-8").trim());if(b2(iZ(Q))!==T0(X,"worktrees"))return $;let U=T0(Q,"gitdir");if(!mz(U))return $;let J=U4(U,"utf-8").trim();if(dZ(b2(Q,J))!==T0(dZ($),".git"))return $;if(FF(X)!==".git")return lz(T0(X,".git"))?$:X;return iZ(X)}catch{return $}}function cz($){let Z=b2($);try{Z=dZ.native(Z)}catch{}let Q=TF(Z);return(Q?AF(Q):Z).normalize("NFC")}function H4($,Z={}){if(Z.memoryDir)return b2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||T0(_F(),".claude");return T0(b2(Q),"projects",pz(cz($)),"memory").normalize("NFC")}function CF($,Z={}){return T0(H4($,Z),e.memory)}var jF=new Set(["target_user","core_problem","mission_purpose"]),wF=["who","what","why","where","when","how"];function dz($){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:** ${n(Z.name)?Z.name:"Project"}`,...Q.filter(([,J])=>n(J)).map(([J,H])=>`- **${J}:** ${H}`),...X4("Stack",Object.entries($.stack??{}).filter(([J,H])=>!jF.has(J)&&n(H)).map(([J,H])=>`- **${z0(`stack.${J}`)}:** ${H}`)),...X4("Context",wF.filter((J)=>n(z[J])).map((J)=>`- **${z0(`human_context.${J}`)}:** ${z[J]}`)),...X4("Commands",Object.entries($.commands??{}).filter(([,J])=>n(J)).slice(0,uz).map(([J,H])=>`- ${J}: \`${J2(H)}\``)),...X4("Key files",X.filter(n).slice(0,uz).map((J)=>`- ${J}`)),"","*faf keeps this block in step with project.faf. Everything outside it is Claude's own and is kept as written.*"].join(`
282
+ `)}function X4($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function iz($){return fZ($,(Z)=>Z.trimEnd()===PF,(Z)=>Z.startsWith(RF))}function J4($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function SF($,Z,Q){if($===null)return{text:Q4(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=S2($),X=z??iz($);if(X){let J=$.slice(0,X.start),H=$.slice(X.end);return{text:D6(J,Z,H,void 0,void 0,Q),action:z?"updated":"migrated",head:J,tail:H}}let U=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:Q4($,Z,void 0,void 0,Q),action:"added",head:U,tail:$.slice(U.length)}}function nZ($){return $>hz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${hz}; lines after that are kept in the file but not loaded.`]:[]}function EF($,Z={}){let Q=H4($,Z),z=T0(Q,e.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!IF(Q))return X;let U=M6(u(Q,e.memory));if(U===null)return X;let J=S2(U),H=J?`${U.slice(0,J.start)}${U.slice(J.end)}`:U,V=J4(U);return{path:z,exists:!0,lines:V,hasBlock:J!==null,blockLines:J?J4(U.slice(J.start,J.end)):0,hasLegacySection:!J&&iz(U)!==null,otherLines:H.split(/\r\n|\r|\n/).filter((Y)=>Y.replace(/^\uFEFF/,"").trim()!=="").length,warnings:nZ(V)}}function bF($,Z,Q={}){let z=H4($,Q);Z$(z);let X=u(z,e.memory),U=M6(X),J=SF(U,pZ(dz(Z)),X);if(J.text===U){let q=J4(U);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:q,warnings:nZ(q)}}let H=$0(X,J.text,{root:z,expect:U}),V=U4(H,"utf-8"),Y=V===J.text&&V.startsWith(J.head)&&V.endsWith(J.tail),G=J4(V),W=J.action==="added"?z4(e.memory,U):null;return{path:H,action:J.action,written:!0,preserved:Y,lines:G,warnings:[...W?[W]:[],...nZ(G)]}}function yF($,Z){let Q=[],z=(V)=>M($,V),X=(V)=>j($,V)??"";if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let U=[],J=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in J)U.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in J)U.push("Prettier");let H=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(H))U.push("black");if(/\[tool\.ruff\]/.test(H))U.push("ruff");if(/\[tool\.mypy\]/.test(H))U.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))U.push("rustfmt");if(U.length)Q.push(`Style enforced by ${U.join(" · ")} — obey the configs`);return Q}function xF($,Z){let Q={...Z},z=null,X=j($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let U=e8($,z);if(Object.keys(U).length)Q.commands={...U,...Z.commands??{}};let J=Z.key_files??Z.instant_context?.key_files;if(!J||J.length===0){let H=t8($);if(H.length)Q.key_files=H}if(!Z.security){let V=[".env",".env.local",".env.development"].find((Y)=>M($,Y));if(V){let Y=[".env.example",".env.sample",".env.template"].find((G)=>M($,G));Q.security={secrets:V,...Y?{example:Y}:{}}}}if(!Z.conventions){let H=yF($,z);if(H.length)Q.conventions=H}return Q}export{wD as writeServerCard,$D as writeProjectHtml,qF as writeGeminiMd,KK as writeFaf,KF as writeCursorrules,MF as writeCopilotInstructions,bF as writeClaudeMemory,QF as writeClaudeMd,VF as writeAgentsMd,BX as validateFaf,P2 as utcNow,mD as upsertCatalog,HK as updateFafFile,SO as updateExistingFaf,c8 as turboCatSlots,A3 as turboCatScan,eO as suggestionNote,Gz as suggestIntent,tz as slotsByCategory,QQ as serializeFaf,J3 as seedSixWsFromGoal,qX as scoreText,K4 as scoreFafYaml,$0 as safeWriteFile,NB as safeUnlink,F9 as safeReplaceOwned,_L as runLoop,u as resolveInside,CF as resolveClaudeMemoryPath,H4 as resolveClaudeMemoryDir,qz as repoNameFromUrl,t5 as renderProjectHtml,yz as renderGeminiMd,xz as renderCursorrules,vz as renderCopilotInstructions,dz as renderClaudeMemory,zF as renderClaudeMd,bz as renderAgentsMd,n8 as relentlessContextDetailed,II as relentlessContext,x8 as registryTitle,VZ as registryName,O2 as registryMeta,Q0 as readUtf8,gD as readFafa,UQ as readFafRaw,JK as readFaf,ZF as readClaudeMd,LZ as questionForSlot,TL as publicQuestions,xQ as projectServerJson,E8 as projectServerCard,kQ as projectPack,iD as projectCards,vQ as projectArd,gQ as projectAiCatalog,w8 as projectA2ACard,SD as patchServerJson,XF as parseClaudeMd,$_ as normalizeGitUrl,k8 as normalizeAnswer,XZ as mcpName,Z$ as makeDirInside,Y3 as loopVerdict,a_ as legacyStampNoteAt,z4 as legacyStampNote,B4 as kernel,l as isPlaceholder,IK as isNonProjectRoot,Yz as isIntentPath,H3 as isHumanSlot,ZX as isExplicitNone,v8 as isEmptyValue,WL as interviewForMissing,N0 as injectFafBlock,AL as gradeAnswers,R$ as getTier,XX as getNextTier,ED as generateServerCard,ZD as generateProjectHtml,kD as generateA2ACard,$3 as fromClaudeDir,vD as findFafaFile,JQ as findFafFile,S2 as findFafBlock,D$ as fillEmpties,wQ as fafaYaml,J$ as fafaDomain,x0 as fafMetaTag,S0 as fafContextBlock,Z1 as enrichScore,xF as enrichFromRepo,NL as deriveQuestionSet,NK as computeDrift,cz as claudeProjectRoot,pz as claudeProjectId,EF as claudeMemoryStatus,V3 as classifyGaps,Y$ as canonicalPriority,IL as buildTableOf8,X6 as buildServerCard,CL as buildReceipt,PD as buildPack,YZ as buildA2ACard,Z_ as authorFafFromRepo,gZ as assembleFreshFaf,jQ as answersToFafa,B3 as answersMatch,v0 as TIERS,S as SafePathError,X3 as STACK_INTERVIEW,g0 as SLOT_BY_PATH,p as SLOTS,_6 as SLOTIGNORED,DZ as SIX_WS_INTERVIEW,RQ as SERVER_JSON_SCHEMA,j8 as SERVER_CARD_SCHEMA,e5 as REGISTRY_PUBLISHER_KEY,Z2 as PRIORITY_RANK,GZ as PRIORITY_ORDER,O6 as PLACEHOLDERS,g8 as KNOWLEDGE_TYPES,z3 as INTERVIEW_VERSION,GL as INTERVIEW_PATHS,U3 as INTERVIEW_BY_PATH,W$ as INTERVIEW,kZ as INTENT_PATHS,W0 as FafmSoul,_z as FafDNAManager,b0 as FAF_START,F$ as FAF_HEX,y0 as FAF_END,aZ as EXPLICIT_NONE,$X as ENTERPRISE_SLOTS,IZ as BENCH_VERSION,ez as BASE_SLOTS,q3 as ALIAS_GROUPS,U$ as A2A_CONTEXT_URI};
283
283
 
284
- //# debugId=4AD6E32729F5CF9164756E2164756E21
284
+ //# debugId=F170F24ABB24D46264756E2164756E21
285
285
  //# sourceMappingURL=index.js.map