faf-cli 7.12.0 → 7.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,170 +1,206 @@
1
- import{createRequire as _4}from"node:module";var G4=Object.defineProperty;var P=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var V4=($)=>$;function B4($,Z){this[$]=V4.bind(null,Z)}var W4=($,Z)=>{for(var Q in Z)G4($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:B4.bind(Z,Q)})};var H2=_4(import.meta.url);var j=P((g4)=>{var K$=Symbol.for("yaml.alias"),I6=Symbol.for("yaml.document"),$1=Symbol.for("yaml.map"),K6=Symbol.for("yaml.pair"),L$=Symbol.for("yaml.scalar"),Z1=Symbol.for("yaml.seq"),G0=Symbol.for("yaml.node.type"),w4=($)=>!!$&&typeof $==="object"&&$[G0]===K$,C4=($)=>!!$&&typeof $==="object"&&$[G0]===I6,b4=($)=>!!$&&typeof $==="object"&&$[G0]===$1,E4=($)=>!!$&&typeof $==="object"&&$[G0]===K6,L6=($)=>!!$&&typeof $==="object"&&$[G0]===L$,j4=($)=>!!$&&typeof $==="object"&&$[G0]===Z1;function R6($){if($&&typeof $==="object")switch($[G0]){case $1:case Z1:return!0}return!1}function S4($){if($&&typeof $==="object")switch($[G0]){case K$:case $1:case L$:case Z1:return!0}return!1}var x4=($)=>(L6($)||R6($))&&!!$.anchor;g4.ALIAS=K$;g4.DOC=I6;g4.MAP=$1;g4.NODE_TYPE=G0;g4.PAIR=K6;g4.SCALAR=L$;g4.SEQ=Z1;g4.hasAnchor=x4;g4.isAlias=w4;g4.isCollection=R6;g4.isDocument=C4;g4.isMap=b4;g4.isNode=S4;g4.isPair=E4;g4.isScalar=L6;g4.isSeq=j4});var G2=P((o4)=>{var v=j(),p=Symbol("break visit"),M6=Symbol("skip children"),X0=Symbol("remove node");function Q1($,Z){let Q=F6(Z);if(v.isDocument($)){if(m0(null,$.contents,Q,Object.freeze([$]))===X0)$.contents=null}else m0(null,$,Q,Object.freeze([]))}Q1.BREAK=p;Q1.SKIP=M6;Q1.REMOVE=X0;function m0($,Z,Q,X){let z=N6($,Z,Q,X);if(v.isNode(z)||v.isPair(z))return P6($,X,z),m0($,z,Q,X);if(typeof z!=="symbol"){if(v.isCollection(Z)){X=Object.freeze(X.concat(Z));for(let J=0;J<Z.items.length;++J){let H=m0(J,Z.items[J],Q,X);if(typeof H==="number")J=H-1;else if(H===p)return p;else if(H===X0)Z.items.splice(J,1),J-=1}}else if(v.isPair(Z)){X=Object.freeze(X.concat(Z));let J=m0("key",Z.key,Q,X);if(J===p)return p;else if(J===X0)Z.key=null;let H=m0("value",Z.value,Q,X);if(H===p)return p;else if(H===X0)Z.value=null}}return z}async function X1($,Z){let Q=F6(Z);if(v.isDocument($)){if(await p0(null,$.contents,Q,Object.freeze([$]))===X0)$.contents=null}else await p0(null,$,Q,Object.freeze([]))}X1.BREAK=p;X1.SKIP=M6;X1.REMOVE=X0;async function p0($,Z,Q,X){let z=await N6($,Z,Q,X);if(v.isNode(z)||v.isPair(z))return P6($,X,z),p0($,z,Q,X);if(typeof z!=="symbol"){if(v.isCollection(Z)){X=Object.freeze(X.concat(Z));for(let J=0;J<Z.items.length;++J){let H=await p0(J,Z.items[J],Q,X);if(typeof H==="number")J=H-1;else if(H===p)return p;else if(H===X0)Z.items.splice(J,1),J-=1}}else if(v.isPair(Z)){X=Object.freeze(X.concat(Z));let J=await p0("key",Z.key,Q,X);if(J===p)return p;else if(J===X0)Z.key=null;let H=await p0("value",Z.value,Q,X);if(H===p)return p;else if(H===X0)Z.value=null}}return z}function F6($){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 N6($,Z,Q,X){if(typeof Q==="function")return Q($,Z,X);if(v.isMap(Z))return Q.Map?.($,Z,X);if(v.isSeq(Z))return Q.Seq?.($,Z,X);if(v.isPair(Z))return Q.Pair?.($,Z,X);if(v.isScalar(Z))return Q.Scalar?.($,Z,X);if(v.isAlias(Z))return Q.Alias?.($,Z,X);return}function P6($,Z,Q){let X=Z[Z.length-1];if(v.isCollection(X))X.items[$]=Q;else if(v.isPair(X))if($==="key")X.key=Q;else X.value=Q;else if(v.isDocument(X))X.contents=Q;else{let z=v.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${z} parent`)}}o4.visit=Q1;o4.visitAsync=X1});var R$=P((X3)=>{var A6=j(),$3=G2(),Z3={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Q3=($)=>$.replace(/[!,[\]{}]/g,(Z)=>Z3[Z]);class c{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},c.defaultYaml,$),this.tags=Object.assign({},c.defaultTags,Z)}clone(){let $=new c(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new c(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:c.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},c.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:c.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},c.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),X=Q.shift();switch(X){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[z,J]=Q;return this.tags[z]=J,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[z]=Q;if(z==="1.1"||z==="1.2")return this.yaml.version=z,!0;else{let J=/^\d+\.\d+$/.test(z);return Z(6,`Unsupported YAML version ${z}`,J),!1}}default:return Z(0,`Unknown directive ${X}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let J=$.slice(2,-1);if(J==="!"||J==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return J}let[,Q,X]=$.match(/^(.*!)([^!]*)$/s);if(!X)Z(`The ${$} tag has no suffix`);let z=this.tags[Q];if(z)try{return z+decodeURIComponent(X)}catch(J){return Z(String(J)),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+Q3($.substring(Q.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Q=Object.entries(this.tags),X;if($&&Q.length>0&&A6.isNode($.contents)){let z={};$3.visit($.contents,(J,H)=>{if(A6.isNode(H)&&H.tag)z[H.tag]=!0}),X=Object.keys(z)}else X=[];for(let[z,J]of Q){if(z==="!!"&&J==="tag:yaml.org,2002:")continue;if(!$||X.some((H)=>H.startsWith(J)))Z.push(`%TAG ${z} ${J}`)}return Z.join(`
2
- `)}}c.defaultYaml={explicit:!1,version:"1.2"};c.defaultTags={"!!":"tag:yaml.org,2002:"};X3.Directives=c});var z1=P((q3)=>{var T6=j(),J3=G2();function H3($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function w6($){let Z=new Set;return J3.visit($,{Value(Q,X){if(X.anchor)Z.add(X.anchor)}}),Z}function C6($,Z){for(let Q=1;;++Q){let X=`${$}${Q}`;if(!Z.has(X))return X}}function U3($,Z){let Q=[],X=new Map,z=null;return{onAnchor:(J)=>{Q.push(J),z??(z=w6($));let H=C6(Z,z);return z.add(H),H},setAnchors:()=>{for(let J of Q){let H=X.get(J);if(typeof H==="object"&&H.anchor&&(T6.isScalar(H.node)||T6.isCollection(H.node)))H.node.anchor=H.anchor;else{let U=Error("Failed to resolve repeated object (this should not happen)");throw U.source=J,U}}},sourceObjects:X}}q3.anchorIsValid=H3;q3.anchorNames=w6;q3.createNodeAnchors=U3;q3.findNewAnchor=C6});var M$=P((W3)=>{function V2($,Z,Q,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let z=0,J=X.length;z<J;++z){let H=X[z],U=V2($,X,String(z),H);if(U===void 0)delete X[z];else if(U!==H)X[z]=U}else if(X instanceof Map)for(let z of Array.from(X.keys())){let J=X.get(z),H=V2($,X,z,J);if(H===void 0)X.delete(z);else if(H!==J)X.set(z,H)}else if(X instanceof Set)for(let z of Array.from(X)){let J=V2($,X,z,z);if(J===void 0)X.delete(z);else if(J!==z)X.delete(z),X.add(J)}else for(let[z,J]of Object.entries(X)){let H=V2($,X,z,J);if(H===void 0)delete X[z];else if(H!==J)X[z]=H}return $.call(Z,Q,X)}W3.applyReviver=V2});var _0=P((D3)=>{var O3=j();function b6($,Z,Q){if(Array.isArray($))return $.map((X,z)=>b6(X,String(z),Q));if($&&typeof $.toJSON==="function"){if(!Q||!O3.hasAnchor($))return $.toJSON(Z,Q);let X={aliasCount:0,count:1,res:void 0};Q.anchors.set($,X),Q.onCreate=(J)=>{X.res=J,delete Q.onCreate};let z=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(z);return z}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}D3.toJS=b6});var J1=P((R3)=>{var K3=M$(),E6=j(),L3=_0();class j6{constructor($){Object.defineProperty(this,E6.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:X,reviver:z}={}){if(!E6.isDocument($))throw TypeError("A document argument is required");let J={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},H=L3.toJS(this,"",J);if(typeof X==="function")for(let{count:U,res:q}of J.anchors.values())X(q,U);return typeof z==="function"?K3.applyReviver(z,{"":H},"",H):H}}R3.NodeBase=j6});var B2=P((T3)=>{var F3=z1(),N3=G2(),l0=j(),P3=J1(),A3=_0();class S6 extends P3.NodeBase{constructor($){super(l0.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=[],N3.visit($,{Node:(z,J)=>{if(l0.isAlias(J)||l0.hasAnchor(J))Q.push(J)}}),Z)Z.aliasResolveCache=Q;let X=void 0;for(let z of Q){if(z===this)break;if(z.anchor===this.source)X=z}return X}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:X,maxAliasCount:z}=Z,J=this.resolve(X,Z);if(!J){let U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(U)}let H=Q.get(J);if(!H)A3.toJS(J,null,Z),H=Q.get(J);if(H?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(z>=0){if(H.count+=1,H.aliasCount===0)H.aliasCount=H1(X,J,Q);if(H.count*H.aliasCount>z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return H.res}toString($,Z,Q){let X=`*${this.source}`;if($){if(F3.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(z)}if($.implicitKey)return`${X} `}return X}}function H1($,Z,Q){if(l0.isAlias(Z)){let X=Z.resolve($),z=Q&&X&&Q.get(X);return z?z.count*z.aliasCount:0}else if(l0.isCollection(Z)){let X=0;for(let z of Z.items){let J=H1($,z,Q);if(J>X)X=J}return X}else if(l0.isPair(Z)){let X=H1($,Z.key,Q),z=H1($,Z.value,Q);return Math.max(X,z)}return 1}T3.Alias=S6});var h=P((S3)=>{var C3=j(),b3=J1(),E3=_0(),j3=($)=>!$||typeof $!=="function"&&typeof $!=="object";class w0 extends b3.NodeBase{constructor($){super(C3.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:E3.toJS(this.value,$,Z)}toString(){return String(this.value)}}w0.BLOCK_FOLDED="BLOCK_FOLDED";w0.BLOCK_LITERAL="BLOCK_LITERAL";w0.PLAIN="PLAIN";w0.QUOTE_DOUBLE="QUOTE_DOUBLE";w0.QUOTE_SINGLE="QUOTE_SINGLE";S3.Scalar=w0;S3.isScalarValue=j3});var W2=P((k3)=>{var y3=B2(),C0=j(),x6=h(),h3="tag:yaml.org,2002:";function v3($,Z,Q){if(Z){let X=Q.filter((J)=>J.tag===Z),z=X.find((J)=>!J.format)??X[0];if(!z)throw Error(`Tag ${Z} not found`);return z}return Q.find((X)=>X.identify?.($)&&!X.format)}function f3($,Z,Q){if(C0.isDocument($))$=$.contents;if(C0.isNode($))return $;if(C0.isPair($)){let V=Q.schema[C0.MAP].createNode?.(Q.schema,null,Q);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:X,onAnchor:z,onTagObj:J,schema:H,sourceObjects:U}=Q,q=void 0;if(X&&$&&typeof $==="object")if(q=U.get($),q)return q.anchor??(q.anchor=z($)),new y3.Alias(q.anchor);else q={anchor:null,node:null},U.set($,q);if(Z?.startsWith("!!"))Z=h3+Z.slice(2);let Y=v3($,Z,H.tags);if(!Y){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new x6.Scalar($);if(q)q.node=V;return V}Y=$ instanceof Map?H[C0.MAP]:(Symbol.iterator in Object($))?H[C0.SEQ]:H[C0.MAP]}if(J)J(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 x6.Scalar($);if(Z)G.tag=Z;else if(!Y.default)G.tag=Y.tag;if(q)q.node=G;return G}k3.createNode=f3});var U1=P((l3)=>{var m3=W2(),z0=j(),p3=J1();function F$($,Z,Q){let X=Q;for(let z=Z.length-1;z>=0;--z){let J=Z[z];if(typeof J==="number"&&Number.isInteger(J)&&J>=0){let H=[];H[J]=X,X=H}else X=new Map([[J,X]])}return m3.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var g6=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class y6 extends p3.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)=>z0.isNode(Q)||z0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(g6($))this.add(Z);else{let[Q,...X]=$,z=this.get(Q,!0);if(z0.isCollection(z))z.addIn(X,Z);else if(z===void 0&&this.schema)this.set(Q,F$(this.schema,X,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${X}`)}}deleteIn($){let[Z,...Q]=$;if(Q.length===0)return this.delete(Z);let X=this.get(Z,!0);if(z0.isCollection(X))return X.deleteIn(Q);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${Q}`)}getIn($,Z){let[Q,...X]=$,z=this.get(Q,!0);if(X.length===0)return!Z&&z0.isScalar(z)?z.value:z;else return z0.isCollection(z)?z.getIn(X,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!z0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&z0.isScalar(Q)&&Q.value==null&&!Q.commentBefore&&!Q.comment&&!Q.tag})}hasIn($){let[Z,...Q]=$;if(Q.length===0)return this.has(Z);let X=this.get(Z,!0);return z0.isCollection(X)?X.hasIn(Q):!1}setIn($,Z){let[Q,...X]=$;if(X.length===0)this.set(Q,Z);else{let z=this.get(Q,!0);if(z0.isCollection(z))z.setIn(X,Z);else if(z===void 0&&this.schema)this.set(Q,F$(this.schema,X,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${X}`)}}}l3.Collection=y6;l3.collectionFromPath=F$;l3.isEmptyPath=g6});var _2=P((a3)=>{var r3=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function N$($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var n3=($,Z,Q)=>$.endsWith(`
3
- `)?N$(Q,Z):Q.includes(`
1
+ import{createRequire as Gz}from"node:module";var Hz=Object.defineProperty;var P=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Uz=($)=>$;function Jz($,Z){this[$]=Uz.bind(null,Z)}var Vz=($,Z)=>{for(var Q in Z)Hz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:Jz.bind(Z,Q)})};var Z$=Gz(import.meta.url);var g=P((bz)=>{var a8=Symbol.for("yaml.alias"),j5=Symbol.for("yaml.document"),Y6=Symbol.for("yaml.map"),E5=Symbol.for("yaml.pair"),t8=Symbol.for("yaml.scalar"),W6=Symbol.for("yaml.seq"),E0=Symbol.for("yaml.node.type"),Az=($)=>!!$&&typeof $==="object"&&$[E0]===a8,Tz=($)=>!!$&&typeof $==="object"&&$[E0]===j5,Cz=($)=>!!$&&typeof $==="object"&&$[E0]===Y6,wz=($)=>!!$&&typeof $==="object"&&$[E0]===E5,S5=($)=>!!$&&typeof $==="object"&&$[E0]===t8,jz=($)=>!!$&&typeof $==="object"&&$[E0]===W6;function b5($){if($&&typeof $==="object")switch($[E0]){case Y6:case W6:return!0}return!1}function Ez($){if($&&typeof $==="object")switch($[E0]){case a8:case Y6:case t8:case W6:return!0}return!1}var Sz=($)=>(S5($)||b5($))&&!!$.anchor;bz.ALIAS=a8;bz.DOC=j5;bz.MAP=Y6;bz.NODE_TYPE=E0;bz.PAIR=E5;bz.SCALAR=t8;bz.SEQ=W6;bz.hasAnchor=Sz;bz.isAlias=Az;bz.isCollection=b5;bz.isDocument=Tz;bz.isMap=Cz;bz.isNode=Ez;bz.isPair=wz;bz.isScalar=S5;bz.isSeq=jz});var U$=P((sz)=>{var d=g(),e=Symbol("break visit"),g5=Symbol("skip children"),F0=Symbol("remove node");function B6($,Z){let Q=x5(Z);if(d.isDocument($)){if(j2(null,$.contents,Q,Object.freeze([$]))===F0)$.contents=null}else j2(null,$,Q,Object.freeze([]))}B6.BREAK=e;B6.SKIP=g5;B6.REMOVE=F0;function j2($,Z,Q,z){let X=v5($,Z,Q,z);if(d.isNode(X)||d.isPair(X))return y5($,z,X),j2($,X,Q,z);if(typeof X!=="symbol"){if(d.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=j2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===e)return e;else if(U===F0)Z.items.splice(H,1),H-=1}}else if(d.isPair(Z)){z=Object.freeze(z.concat(Z));let H=j2("key",Z.key,Q,z);if(H===e)return e;else if(H===F0)Z.key=null;let U=j2("value",Z.value,Q,z);if(U===e)return e;else if(U===F0)Z.value=null}}return X}async function q6($,Z){let Q=x5(Z);if(d.isDocument($)){if(await E2(null,$.contents,Q,Object.freeze([$]))===F0)$.contents=null}else await E2(null,$,Q,Object.freeze([]))}q6.BREAK=e;q6.SKIP=g5;q6.REMOVE=F0;async function E2($,Z,Q,z){let X=await v5($,Z,Q,z);if(d.isNode(X)||d.isPair(X))return y5($,z,X),E2($,X,Q,z);if(typeof X!=="symbol"){if(d.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=await E2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===e)return e;else if(U===F0)Z.items.splice(H,1),H-=1}}else if(d.isPair(Z)){z=Object.freeze(z.concat(Z));let H=await E2("key",Z.key,Q,z);if(H===e)return e;else if(H===F0)Z.key=null;let U=await E2("value",Z.value,Q,z);if(U===e)return e;else if(U===F0)Z.value=null}}return X}function x5($){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 v5($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(d.isMap(Z))return Q.Map?.($,Z,z);if(d.isSeq(Z))return Q.Seq?.($,Z,z);if(d.isPair(Z))return Q.Pair?.($,Z,z);if(d.isScalar(Z))return Q.Scalar?.($,Z,z);if(d.isAlias(Z))return Q.Alias?.($,Z,z);return}function y5($,Z,Q){let z=Z[Z.length-1];if(d.isCollection(z))z.items[$]=Q;else if(d.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(d.isDocument(z))z.contents=Q;else{let X=d.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}sz.visit=B6;sz.visitAsync=q6});var e8=P((ZX)=>{var k5=g(),tz=U$(),ez={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},$X=($)=>$.replace(/[!,[\]{}]/g,(Z)=>ez[Z]);class X0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},X0.defaultYaml,$),this.tags=Object.assign({},X0.defaultTags,Z)}clone(){let $=new X0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new X0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:X0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},X0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:X0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},X0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,H]=Q;return this.tags[X]=H,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let H=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,H),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let H=$.slice(2,-1);if(H==="!"||H==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return H}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(H){return Z(String(H)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+$X($.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&&k5.isNode($.contents)){let X={};tz.visit($.contents,(H,U)=>{if(k5.isNode(U)&&U.tag)X[U.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,H]of Q){if(X==="!!"&&H==="tag:yaml.org,2002:")continue;if(!$||z.some((U)=>U.startsWith(H)))Z.push(`%TAG ${X} ${H}`)}return Z.join(`
2
+ `)}}X0.defaultYaml={explicit:!1,version:"1.2"};X0.defaultTags={"!!":"tag:yaml.org,2002:"};ZX.Directives=X0});var K6=P((UX)=>{var h5=g(),zX=U$();function XX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function f5($){let Z=new Set;return zX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function u5($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function HX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(H)=>{Q.push(H),X??(X=f5($));let U=u5(Z,X);return X.add(U),U},setAnchors:()=>{for(let H of Q){let U=z.get(H);if(typeof U==="object"&&U.anchor&&(h5.isScalar(U.node)||h5.isCollection(U.node)))U.node.anchor=U.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=H,J}}},sourceObjects:z}}UX.anchorIsValid=XX;UX.anchorNames=f5;UX.createNodeAnchors=HX;UX.findNewAnchor=u5});var $1=P((WX)=>{function J$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,H=z.length;X<H;++X){let U=z[X],J=J$($,z,String(X),U);if(J===void 0)delete z[X];else if(J!==U)z[X]=J}else if(z instanceof Map)for(let X of Array.from(z.keys())){let H=z.get(X),U=J$($,z,X,H);if(U===void 0)z.delete(X);else if(U!==H)z.set(X,U)}else if(z instanceof Set)for(let X of Array.from(z)){let H=J$($,z,X,X);if(H===void 0)z.delete(X);else if(H!==X)z.delete(X),z.add(H)}else for(let[X,H]of Object.entries(z)){let U=J$($,z,X,H);if(U===void 0)delete z[X];else if(U!==H)z[X]=U}return $.call(Z,Q,z)}WX.applyReviver=J$});var m0=P((KX)=>{var qX=g();function m5($,Z,Q){if(Array.isArray($))return $.map((z,X)=>m5(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!qX.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(H)=>{z.res=H,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}KX.toJS=m5});var D6=P((_X)=>{var IX=$1(),p5=g(),LX=m0();class l5{constructor($){Object.defineProperty(this,p5.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(!p5.isDocument($))throw TypeError("A document argument is required");let H={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},U=LX.toJS(this,"",H);if(typeof z==="function")for(let{count:J,res:V}of H.anchors.values())z(V,J);return typeof X==="function"?IX.applyReviver(X,{"":U},"",U):U}}_X.NodeBase=l5});var V$=P((PX)=>{var MX=K6(),RX=U$(),S2=g(),FX=D6(),NX=m0();class c5 extends FX.NodeBase{constructor($){super(S2.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=[],RX.visit($,{Node:(X,H)=>{if(S2.isAlias(H)||S2.hasAnchor(H))Q.push(H)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,H=this.resolve(z,Z);if(!H){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let U=Q.get(H);if(!U)NX.toJS(H,null,Z),U=Q.get(H);if(U?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(U.count+=1,U.aliasCount===0)U.aliasCount=I6(z,H,Q);if(U.count*U.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return U.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(MX.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if($.implicitKey)return`${z} `}return z}}function I6($,Z,Q){if(S2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(S2.isCollection(Z)){let z=0;for(let X of Z.items){let H=I6($,X,Q);if(H>z)z=H}return z}else if(S2.isPair(Z)){let z=I6($,Z.key,Q),X=I6($,Z.value,Q);return Math.max(z,X)}return 1}PX.Alias=c5});var p=P((EX)=>{var TX=g(),CX=D6(),wX=m0(),jX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class Q2 extends CX.NodeBase{constructor($){super(TX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:wX.toJS(this.value,$,Z)}toString(){return String(this.value)}}Q2.BLOCK_FOLDED="BLOCK_FOLDED";Q2.BLOCK_LITERAL="BLOCK_LITERAL";Q2.PLAIN="PLAIN";Q2.QUOTE_DOUBLE="QUOTE_DOUBLE";Q2.QUOTE_SINGLE="QUOTE_SINGLE";EX.Scalar=Q2;EX.isScalarValue=jX});var G$=P((kX)=>{var gX=V$(),z2=g(),d5=p(),xX="tag:yaml.org,2002:";function vX($,Z,Q){if(Z){let z=Q.filter((H)=>H.tag===Z),X=z.find((H)=>!H.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function yX($,Z,Q){if(z2.isDocument($))$=$.contents;if(z2.isNode($))return $;if(z2.isPair($)){let W=Q.schema[z2.MAP].createNode?.(Q.schema,null,Q);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:X,onTagObj:H,schema:U,sourceObjects:J}=Q,V=void 0;if(z&&$&&typeof $==="object")if(V=J.get($),V)return V.anchor??(V.anchor=X($)),new gX.Alias(V.anchor);else V={anchor:null,node:null},J.set($,V);if(Z?.startsWith("!!"))Z=xX+Z.slice(2);let G=vX($,Z,U.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new d5.Scalar($);if(V)V.node=W;return W}G=$ instanceof Map?U[z2.MAP]:(Symbol.iterator in Object($))?U[z2.SEQ]:U[z2.MAP]}if(H)H(G),delete Q.onTagObj;let Y=G?.createNode?G.createNode(Q.schema,$,Q):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(Q.schema,$,Q):new d5.Scalar($);if(Z)Y.tag=Z;else if(!G.default)Y.tag=G.tag;if(V)V.node=Y;return Y}kX.createNode=yX});var L6=P((mX)=>{var fX=G$(),N0=g(),uX=D6();function Z1($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let H=Z[X];if(typeof H==="number"&&Number.isInteger(H)&&H>=0){let U=[];U[H]=z,z=U}else z=new Map([[H,z]])}return fX.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var i5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class n5 extends uX.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)=>N0.isNode(Q)||N0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(i5($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(N0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,Z1(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(N0.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&&N0.isScalar(X)?X.value:X;else return N0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!N0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&N0.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 N0.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(N0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,Z1(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}mX.Collection=n5;mX.collectionFromPath=Z1;mX.isEmptyPath=i5});var Y$=P((nX)=>{var dX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Q1($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var iX=($,Z,Q)=>$.endsWith(`
3
+ `)?Q1(Q,Z):Q.includes(`
4
4
  `)?`
5
- `+N$(Q,Z):($.endsWith(" ")?"":" ")+Q;a3.indentComment=N$;a3.lineComment=n3;a3.stringifyComment=r3});var v6=P(($7)=>{function e3($,Z,Q="flow",{indentAtStart:X,lineWidth:z=80,minContentWidth:J=20,onFold:H,onOverflow:U}={}){if(!z||z<0)return $;if(z<J)J=0;let q=Math.max(1+J,1+z-Z.length);if($.length<=q)return $;let Y=[],G={},V=z-Z.length;if(typeof X==="number")if(X>z-Math.max(2,J))Y.push(0);else V=z-X;let B=void 0,_=void 0,D=!1,W=-1,O=-1,I=-1;if(Q==="block"){if(W=h6($,W,Z.length),W!==-1)V=W+q}for(let F;F=$[W+=1];){if(Q==="quoted"&&F==="\\"){switch(O=W,$[W+1]){case"x":W+=3;break;case"u":W+=5;break;case"U":W+=9;break;default:W+=1}I=W}if(F===`
6
- `){if(Q==="block")W=h6($,W,Z.length);V=W+Z.length+q,B=void 0}else{if(F===" "&&_&&_!==" "&&_!==`
7
- `&&_!=="\t"){let A=$[W+1];if(A&&A!==" "&&A!==`
8
- `&&A!=="\t")B=W}if(W>=V)if(B)Y.push(B),V=B+q,B=void 0;else if(Q==="quoted"){while(_===" "||_==="\t")_=F,F=$[W+=1],D=!0;let A=W>I+1?W-2:O-1;if(G[A])return $;Y.push(A),G[A]=!0,V=A+q,B=void 0}else D=!0}_=F}if(D&&U)U();if(Y.length===0)return $;if(H)H();let N=$.slice(0,Y[0]);for(let F=0;F<Y.length;++F){let A=Y[F],w=Y[F+1]||$.length;if(A===0)N=`
9
- ${Z}${$.slice(0,w)}`;else{if(Q==="quoted"&&G[A])N+=`${$[A]}\\`;N+=`
10
- ${Z}${$.slice(A+1,w)}`}}return N}function h6($,Z,Q){let X=Z,z=Z+1,J=$[z];while(J===" "||J==="\t")if(Z<z+Q)J=$[++Z];else{do J=$[++Z];while(J&&J!==`
11
- `);X=Z,z=Z+1,J=$[z]}return X}$7.FOLD_BLOCK="block";$7.FOLD_FLOW="flow";$7.FOLD_QUOTED="quoted";$7.foldFlowLines=e3});var D2=P((q7)=>{var s=h(),O0=v6(),Y1=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),G1=($)=>/^(%|---|\.\.\.)/m.test($);function J7($,Z,Q){if(!Z||Z<0)return!1;let X=Z-Q,z=$.length;if(z<=X)return!1;for(let J=0,H=0;J<z;++J)if($[J]===`
12
- `){if(J-H>X)return!0;if(H=J+1,z-H<=X)return!1}return!0}function O2($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:X}=Z,z=Z.options.doubleQuotedMinMultiLineLength,J=Z.indent||(G1($)?" ":""),H="",U=0;for(let q=0,Y=Q[q];Y;Y=Q[++q]){if(Y===" "&&Q[q+1]==="\\"&&Q[q+2]==="n")H+=Q.slice(U,q)+"\\ ",q+=1,U=q,Y="\\";if(Y==="\\")switch(Q[q+1]){case"u":{H+=Q.slice(U,q);let G=Q.substr(q+2,4);switch(G){case"0000":H+="\\0";break;case"0007":H+="\\a";break;case"000b":H+="\\v";break;case"001b":H+="\\e";break;case"0085":H+="\\N";break;case"00a0":H+="\\_";break;case"2028":H+="\\L";break;case"2029":H+="\\P";break;default:if(G.substr(0,2)==="00")H+="\\x"+G.substr(2);else H+=Q.substr(q,6)}q+=5,U=q+1}break;case"n":if(X||Q[q+2]==='"'||Q.length<z)q+=1;else{H+=Q.slice(U,q)+`
5
+ `+Q1(Q,Z):($.endsWith(" ")?"":" ")+Q;nX.indentComment=Q1;nX.lineComment=iX;nX.stringifyComment=dX});var s5=P((tX)=>{function aX($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:H=20,onFold:U,onOverflow:J}={}){if(!X||X<0)return $;if(X<H)H=0;let V=Math.max(1+H,1+X-Z.length);if($.length<=V)return $;let G=[],Y={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,H))G.push(0);else W=X-z;let B=void 0,q=void 0,I=!1,K=-1,D=-1,L=-1;if(Q==="block"){if(K=r5($,K,Z.length),K!==-1)W=K+V}for(let N;N=$[K+=1];){if(Q==="quoted"&&N==="\\"){switch(D=K,$[K+1]){case"x":K+=3;break;case"u":K+=5;break;case"U":K+=9;break;default:K+=1}L=K}if(N===`
6
+ `){if(Q==="block")K=r5($,K,Z.length);W=K+Z.length+V,B=void 0}else{if(N===" "&&q&&q!==" "&&q!==`
7
+ `&&q!=="\t"){let A=$[K+1];if(A&&A!==" "&&A!==`
8
+ `&&A!=="\t")B=K}if(K>=W)if(B)G.push(B),W=B+V,B=void 0;else if(Q==="quoted"){while(q===" "||q==="\t")q=N,N=$[K+=1],I=!0;let A=K>L+1?K-2:D-1;if(Y[A])return $;G.push(A),Y[A]=!0,W=A+V,B=void 0}else I=!0}q=N}if(I&&J)J();if(G.length===0)return $;if(U)U();let F=$.slice(0,G[0]);for(let N=0;N<G.length;++N){let A=G[N],C=G[N+1]||$.length;if(A===0)F=`
9
+ ${Z}${$.slice(0,C)}`;else{if(Q==="quoted"&&Y[A])F+=`${$[A]}\\`;F+=`
10
+ ${Z}${$.slice(A+1,C)}`}}return F}function r5($,Z,Q){let z=Z,X=Z+1,H=$[X];while(H===" "||H==="\t")if(Z<X+Q)H=$[++Z];else{do H=$[++Z];while(H&&H!==`
11
+ `);z=Z,X=Z+1,H=$[X]}return z}tX.FOLD_BLOCK="block";tX.FOLD_FLOW="flow";tX.FOLD_QUOTED="quoted";tX.foldFlowLines=aX});var B$=P((UH)=>{var G0=p(),p0=s5(),O6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),M6=($)=>/^(%|---|\.\.\.)/m.test($);function zH($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let H=0,U=0;H<X;++H)if($[H]===`
12
+ `){if(H-U>z)return!0;if(U=H+1,X-U<=z)return!1}return!0}function W$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,H=Z.indent||(M6($)?" ":""),U="",J=0;for(let V=0,G=Q[V];G;G=Q[++V]){if(G===" "&&Q[V+1]==="\\"&&Q[V+2]==="n")U+=Q.slice(J,V)+"\\ ",V+=1,J=V,G="\\";if(G==="\\")switch(Q[V+1]){case"u":{U+=Q.slice(J,V);let Y=Q.substr(V+2,4);switch(Y){case"0000":U+="\\0";break;case"0007":U+="\\a";break;case"000b":U+="\\v";break;case"001b":U+="\\e";break;case"0085":U+="\\N";break;case"00a0":U+="\\_";break;case"2028":U+="\\L";break;case"2029":U+="\\P";break;default:if(Y.substr(0,2)==="00")U+="\\x"+Y.substr(2);else U+=Q.substr(V,6)}V+=5,J=V+1}break;case"n":if(z||Q[V+2]==='"'||Q.length<X)V+=1;else{U+=Q.slice(J,V)+`
13
13
 
14
- `;while(Q[q+2]==="\\"&&Q[q+3]==="n"&&Q[q+4]!=='"')H+=`
15
- `,q+=2;if(H+=J,Q[q+2]===" ")H+="\\";q+=1,U=q+1}break;default:q+=1}}return H=U?H+Q.slice(U):Q,X?H:O0.foldFlowLines(H,J,O0.FOLD_QUOTED,Y1(Z,!1))}function P$($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test($))return O2($,Z);let Q=Z.indent||(G1($)?" ":""),X="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${Q}`)+"'";return Z.implicitKey?X:O0.foldFlowLines(X,Q,O0.FOLD_FLOW,Y1(Z,!1))}function d0($,Z){let{singleQuote:Q}=Z.options,X;if(Q===!1)X=O2;else{let z=$.includes('"'),J=$.includes("'");if(z&&!J)X=P$;else if(J&&!z)X=O2;else X=Q?P$:O2}return X($,Z)}var A$;try{A$=new RegExp(`(^|(?<!
14
+ `;while(Q[V+2]==="\\"&&Q[V+3]==="n"&&Q[V+4]!=='"')U+=`
15
+ `,V+=2;if(U+=H,Q[V+2]===" ")U+="\\";V+=1,J=V+1}break;default:V+=1}}return U=J?U+Q.slice(J):Q,z?U:p0.foldFlowLines(U,H,p0.FOLD_QUOTED,O6(Z,!1))}function z1($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return W$($,Z);let Q=Z.indent||(M6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${Q}`)+"'";return Z.implicitKey?z:p0.foldFlowLines(z,Q,p0.FOLD_FLOW,O6(Z,!1))}function b2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=W$;else{let X=$.includes('"'),H=$.includes("'");if(X&&!H)z=z1;else if(H&&!X)z=W$;else z=Q?z1:W$}return z($,Z)}var X1;try{X1=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{A$=/\n+(?!\n|$)/g}function q1({comment:$,type:Z,value:Q},X,z,J){let{blockQuote:H,commentString:U,lineWidth:q}=X.options;if(!H||/\n[\t ]+$/.test(Q))return d0(Q,X);let Y=X.indent||(X.forceBlockIndent||G1(Q)?" ":""),G=H==="literal"?!0:H==="folded"||Z===s.Scalar.BLOCK_FOLDED?!1:Z===s.Scalar.BLOCK_LITERAL?!0:!J7(Q,q,Y.length);if(!Q)return G?`|
20
+ |$)`,"g")}catch{X1=/\n+(?!\n|$)/g}function _6({comment:$,type:Z,value:Q},z,X,H){let{blockQuote:U,commentString:J,lineWidth:V}=z.options;if(!U||/\n[\t ]+$/.test(Q))return b2(Q,z);let G=z.indent||(z.forceBlockIndent||M6(Q)?" ":""),Y=U==="literal"?!0:U==="folded"||Z===G0.Scalar.BLOCK_FOLDED?!1:Z===G0.Scalar.BLOCK_LITERAL?!0:!zH(Q,V,G.length);if(!Q)return Y?`|
21
21
  `:`>
22
- `;let V,B;for(B=Q.length;B>0;--B){let w=Q[B-1];if(w!==`
23
- `&&w!=="\t"&&w!==" ")break}let _=Q.substring(B),D=_.indexOf(`
24
- `);if(D===-1)V="-";else if(Q===_||D!==_.length-1){if(V="+",J)J()}else V="";if(_){if(Q=Q.slice(0,-_.length),_[_.length-1]===`
25
- `)_=_.slice(0,-1);_=_.replace(A$,`$&${Y}`)}let W=!1,O,I=-1;for(O=0;O<Q.length;++O){let w=Q[O];if(w===" ")W=!0;else if(w===`
26
- `)I=O;else break}let N=Q.substring(0,I<O?I+1:O);if(N)Q=Q.substring(N.length),N=N.replace(/\n+/g,`$&${Y}`);let A=(W?Y?"2":"1":"")+V;if($){if(A+=" "+U($.replace(/ ?[\r\n]+/g," ")),z)z()}if(!G){let w=Q.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),T=!1,C=Y1(X,!0);if(H!=="folded"&&Z!==s.Scalar.BLOCK_FOLDED)C.onOverflow=()=>{T=!0};let L=O0.foldFlowLines(`${N}${w}${_}`,Y,O0.FOLD_BLOCK,C);if(!T)return`>${A}
28
- ${Y}${L}`}return Q=Q.replace(/\n+/g,`$&${Y}`),`|${A}
29
- ${Y}${N}${Q}${_}`}function H7($,Z,Q,X){let{type:z,value:J}=$,{actualString:H,implicitKey:U,indent:q,indentStep:Y,inFlow:G}=Z;if(U&&J.includes(`
30
- `)||G&&/[[\]{},]/.test(J))return d0(J,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(J))return U||G||!J.includes(`
31
- `)?d0(J,Z):q1($,Z,Q,X);if(!U&&!G&&z!==s.Scalar.PLAIN&&J.includes(`
32
- `))return q1($,Z,Q,X);if(G1(J)){if(q==="")return Z.forceBlockIndent=!0,q1($,Z,Q,X);else if(U&&q===Y)return d0(J,Z)}let V=J.replace(/\n+/g,`$&
33
- ${q}`);if(H){let B=(W)=>W.default&&W.tag!=="tag:yaml.org,2002:str"&&W.test?.test(V),{compat:_,tags:D}=Z.doc.schema;if(D.some(B)||_?.some(B))return d0(J,Z)}return U?V:O0.foldFlowLines(V,q,O0.FOLD_FLOW,Y1(Z,!1))}function U7($,Z,Q,X){let{implicitKey:z,inFlow:J}=Z,H=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:U}=$;if(U!==s.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(H.value))U=s.Scalar.QUOTE_DOUBLE}let q=(G)=>{switch(G){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return z||J?d0(H.value,Z):q1(H,Z,Q,X);case s.Scalar.QUOTE_DOUBLE:return O2(H.value,Z);case s.Scalar.QUOTE_SINGLE:return P$(H.value,Z);case s.Scalar.PLAIN:return H7(H,Z,Q,X);default:return null}},Y=q(U);if(Y===null){let{defaultKeyType:G,defaultStringType:V}=Z.options,B=z&&G||V;if(Y=q(B),Y===null)throw Error(`Unsupported default string type ${B}`)}return Y}q7.stringifyString=U7});var I2=P((I7)=>{var G7=z1(),D0=j(),V7=_2(),B7=D2();function W7($,Z){let Q=Object.assign({blockQuote:!0,commentString:V7.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),X;switch(Q.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:$,flowCollectionPadding:Q.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Q.indent==="number"?" ".repeat(Q.indent):" ",inFlow:X,options:Q}}function _7($,Z){if(Z.tag){let z=$.filter((J)=>J.tag===Z.tag);if(z.length>0)return z.find((J)=>J.format===Z.format)??z[0]}let Q=void 0,X;if(D0.isScalar(Z)){X=Z.value;let z=$.filter((J)=>J.identify?.(X));if(z.length>1){let J=z.filter((H)=>H.test);if(J.length>0)z=J}Q=z.find((J)=>J.format===Z.format)??z.find((J)=>!J.format)}else X=Z,Q=$.find((z)=>z.nodeClass&&X instanceof z.nodeClass);if(!Q){let z=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${z} value`)}return Q}function O7($,Z,{anchors:Q,doc:X}){if(!X.directives)return"";let z=[],J=(D0.isScalar($)||D0.isCollection($))&&$.anchor;if(J&&G7.anchorIsValid(J))Q.add(J),z.push(`&${J}`);let H=$.tag??(Z.default?null:Z.tag);if(H)z.push(X.directives.tagString(H));return z.join(" ")}function D7($,Z,Q,X){if(D0.isPair($))return $.toString(Z,Q,X);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 z=void 0,J=D0.isNode($)?$:Z.doc.createNode($,{onTagObj:(q)=>z=q});z??(z=_7(Z.doc.schema.tags,J));let H=O7(J,z,Z);if(H.length>0)Z.indentAtStart=(Z.indentAtStart??0)+H.length+1;let U=typeof z.stringify==="function"?z.stringify(J,Z,Q,X):D0.isScalar(J)?B7.stringifyString(J,Z,Q,X):J.toString(Z,Q,X);if(!H)return U;return D0.isScalar(J)||U[0]==="{"||U[0]==="["?`${H} ${U}`:`${H}
34
- ${Z.indent}${U}`}I7.createStringifyContext=W7;I7.stringify=D7});var u6=P((M7)=>{var V0=j(),f6=h(),k6=I2(),K2=_2();function R7({key:$,value:Z},Q,X,z){let{allNullValues:J,doc:H,indent:U,indentStep:q,options:{commentString:Y,indentSeq:G,simpleKeys:V}}=Q,B=V0.isNode($)&&$.comment||null;if(V){if(B)throw Error("With simple keys, key nodes cannot have comments");if(V0.isCollection($)||!V0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let _=!V&&(!$||B&&Z==null&&!Q.inFlow||V0.isCollection($)||(V0.isScalar($)?$.type===f6.Scalar.BLOCK_FOLDED||$.type===f6.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!_&&(V||!J),indent:U+q});let D=!1,W=!1,O=k6.stringify($,Q,()=>D=!0,()=>W=!0);if(!_&&!Q.inFlow&&O.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(Q.inFlow){if(J||Z==null){if(D&&X)X();return O===""?"?":_?`? ${O}`:O}}else if(J&&!V||Z==null&&_){if(O=`? ${O}`,B&&!D)O+=K2.lineComment(O,Q.indent,Y(B));else if(W&&z)z();return O}if(D)B=null;if(_){if(B)O+=K2.lineComment(O,Q.indent,Y(B));O=`? ${O}
35
- ${U}:`}else if(O=`${O}:`,B)O+=K2.lineComment(O,Q.indent,Y(B));let I,N,F;if(V0.isNode(Z))I=!!Z.spaceBefore,N=Z.commentBefore,F=Z.comment;else if(I=!1,N=null,F=null,Z&&typeof Z==="object")Z=H.createNode(Z);if(Q.implicitKey=!1,!_&&!B&&V0.isScalar(Z))Q.indentAtStart=O.length+1;if(W=!1,!G&&q.length>=2&&!Q.inFlow&&!_&&V0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let A=!1,w=k6.stringify(Z,Q,()=>A=!0,()=>W=!0),T=" ";if(B||I||N){if(T=I?`
36
- `:"",N){let C=Y(N);T+=`
37
- ${K2.indentComment(C,Q.indent)}`}if(w===""&&!Q.inFlow){if(T===`
38
- `&&F)T=`
22
+ `;let W,B;for(B=Q.length;B>0;--B){let C=Q[B-1];if(C!==`
23
+ `&&C!=="\t"&&C!==" ")break}let q=Q.substring(B),I=q.indexOf(`
24
+ `);if(I===-1)W="-";else if(Q===q||I!==q.length-1){if(W="+",H)H()}else W="";if(q){if(Q=Q.slice(0,-q.length),q[q.length-1]===`
25
+ `)q=q.slice(0,-1);q=q.replace(X1,`$&${G}`)}let K=!1,D,L=-1;for(D=0;D<Q.length;++D){let C=Q[D];if(C===" ")K=!0;else if(C===`
26
+ `)L=D;else break}let F=Q.substring(0,L<D?L+1:D);if(F)Q=Q.substring(F.length),F=F.replace(/\n+/g,`$&${G}`);let A=(K?G?"2":"1":"")+W;if($){if(A+=" "+J($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!Y){let C=Q.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),T=!1,E=O6(z,!0);if(U!=="folded"&&Z!==G0.Scalar.BLOCK_FOLDED)E.onOverflow=()=>{T=!0};let _=p0.foldFlowLines(`${F}${C}${q}`,G,p0.FOLD_BLOCK,E);if(!T)return`>${A}
28
+ ${G}${_}`}return Q=Q.replace(/\n+/g,`$&${G}`),`|${A}
29
+ ${G}${F}${Q}${q}`}function XH($,Z,Q,z){let{type:X,value:H}=$,{actualString:U,implicitKey:J,indent:V,indentStep:G,inFlow:Y}=Z;if(J&&H.includes(`
30
+ `)||Y&&/[[\]{},]/.test(H))return b2(H,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||Y||!H.includes(`
31
+ `)?b2(H,Z):_6($,Z,Q,z);if(!J&&!Y&&X!==G0.Scalar.PLAIN&&H.includes(`
32
+ `))return _6($,Z,Q,z);if(M6(H)){if(V==="")return Z.forceBlockIndent=!0,_6($,Z,Q,z);else if(J&&V===G)return b2(H,Z)}let W=H.replace(/\n+/g,`$&
33
+ ${V}`);if(U){let B=(K)=>K.default&&K.tag!=="tag:yaml.org,2002:str"&&K.test?.test(W),{compat:q,tags:I}=Z.doc.schema;if(I.some(B)||q?.some(B))return b2(H,Z)}return J?W:p0.foldFlowLines(W,V,p0.FOLD_FLOW,O6(Z,!1))}function HH($,Z,Q,z){let{implicitKey:X,inFlow:H}=Z,U=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==G0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))J=G0.Scalar.QUOTE_DOUBLE}let V=(Y)=>{switch(Y){case G0.Scalar.BLOCK_FOLDED:case G0.Scalar.BLOCK_LITERAL:return X||H?b2(U.value,Z):_6(U,Z,Q,z);case G0.Scalar.QUOTE_DOUBLE:return W$(U.value,Z);case G0.Scalar.QUOTE_SINGLE:return z1(U.value,Z);case G0.Scalar.PLAIN:return XH(U,Z,Q,z);default:return null}},G=V(J);if(G===null){let{defaultKeyType:Y,defaultStringType:W}=Z.options,B=X&&Y||W;if(G=V(B),G===null)throw Error(`Unsupported default string type ${B}`)}return G}UH.stringifyString=HH});var q$=P((DH)=>{var VH=K6(),l0=g(),GH=Y$(),YH=B$();function WH($,Z){let Q=Object.assign({blockQuote:!0,commentString:GH.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 BH($,Z){if(Z.tag){let X=$.filter((H)=>H.tag===Z.tag);if(X.length>0)return X.find((H)=>H.format===Z.format)??X[0]}let Q=void 0,z;if(l0.isScalar(Z)){z=Z.value;let X=$.filter((H)=>H.identify?.(z));if(X.length>1){let H=X.filter((U)=>U.test);if(H.length>0)X=H}Q=X.find((H)=>H.format===Z.format)??X.find((H)=>!H.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function qH($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],H=(l0.isScalar($)||l0.isCollection($))&&$.anchor;if(H&&VH.anchorIsValid(H))Q.add(H),X.push(`&${H}`);let U=$.tag??(Z.default?null:Z.tag);if(U)X.push(z.directives.tagString(U));return X.join(" ")}function KH($,Z,Q,z){if(l0.isPair($))return $.toString(Z,Q,z);if(l0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,H=l0.isNode($)?$:Z.doc.createNode($,{onTagObj:(V)=>X=V});X??(X=BH(Z.doc.schema.tags,H));let U=qH(H,X,Z);if(U.length>0)Z.indentAtStart=(Z.indentAtStart??0)+U.length+1;let J=typeof X.stringify==="function"?X.stringify(H,Z,Q,z):l0.isScalar(H)?YH.stringifyString(H,Z,Q,z):H.toString(Z,Q,z);if(!U)return J;return l0.isScalar(H)||J[0]==="{"||J[0]==="["?`${U} ${J}`:`${U}
34
+ ${Z.indent}${J}`}DH.createStringifyContext=WH;DH.stringify=KH});var t5=P((OH)=>{var S0=g(),o5=p(),a5=q$(),K$=Y$();function _H({key:$,value:Z},Q,z,X){let{allNullValues:H,doc:U,indent:J,indentStep:V,options:{commentString:G,indentSeq:Y,simpleKeys:W}}=Q,B=S0.isNode($)&&$.comment||null;if(W){if(B)throw Error("With simple keys, key nodes cannot have comments");if(S0.isCollection($)||!S0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let q=!W&&(!$||B&&Z==null&&!Q.inFlow||S0.isCollection($)||(S0.isScalar($)?$.type===o5.Scalar.BLOCK_FOLDED||$.type===o5.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!q&&(W||!H),indent:J+V});let I=!1,K=!1,D=a5.stringify($,Q,()=>I=!0,()=>K=!0);if(!q&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");q=!0}if(Q.inFlow){if(H||Z==null){if(I&&z)z();return D===""?"?":q?`? ${D}`:D}}else if(H&&!W||Z==null&&q){if(D=`? ${D}`,B&&!I)D+=K$.lineComment(D,Q.indent,G(B));else if(K&&X)X();return D}if(I)B=null;if(q){if(B)D+=K$.lineComment(D,Q.indent,G(B));D=`? ${D}
35
+ ${J}:`}else if(D=`${D}:`,B)D+=K$.lineComment(D,Q.indent,G(B));let L,F,N;if(S0.isNode(Z))L=!!Z.spaceBefore,F=Z.commentBefore,N=Z.comment;else if(L=!1,F=null,N=null,Z&&typeof Z==="object")Z=U.createNode(Z);if(Q.implicitKey=!1,!q&&!B&&S0.isScalar(Z))Q.indentAtStart=D.length+1;if(K=!1,!Y&&V.length>=2&&!Q.inFlow&&!q&&S0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let A=!1,C=a5.stringify(Z,Q,()=>A=!0,()=>K=!0),T=" ";if(B||L||F){if(T=L?`
36
+ `:"",F){let E=G(F);T+=`
37
+ ${K$.indentComment(E,Q.indent)}`}if(C===""&&!Q.inFlow){if(T===`
38
+ `&&N)T=`
39
39
 
40
40
  `}else T+=`
41
- ${Q.indent}`}else if(!_&&V0.isCollection(Z)){let C=w[0],L=w.indexOf(`
42
- `),S=L!==-1,E=Q.inFlow??Z.flow??Z.items.length===0;if(S||!E){let m=!1;if(S&&(C==="&"||C==="!")){let M=w.indexOf(" ");if(C==="&"&&M!==-1&&M<L&&w[M+1]==="!")M=w.indexOf(" ",M+1);if(M===-1||L<M)m=!0}if(!m)T=`
43
- ${Q.indent}`}}else if(w===""||w[0]===`
44
- `)T="";if(O+=T+w,Q.inFlow){if(A&&X)X()}else if(F&&!A)O+=K2.lineComment(O,Q.indent,Y(F));else if(W&&z)z();return O}M7.stringifyPair=R7});var T$=P((A7)=>{var m6=H2("process");function N7($,...Z){if($==="debug")console.log(...Z)}function P7($,Z){if($==="debug"||$==="warn")if(typeof m6.emitWarning==="function")m6.emitWarning(Z);else console.warn(Z)}A7.debug=N7;A7.warn=P7});var _1=P((b7)=>{var W1=j(),p6=h(),V1="<<",B1={identify:($)=>$===V1||typeof $==="symbol"&&$.description===V1,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new p6.Scalar(Symbol(V1)),{addToJSMap:l6}),stringify:()=>V1},C7=($,Z)=>(B1.identify(Z)||W1.isScalar(Z)&&(!Z.type||Z.type===p6.Scalar.PLAIN)&&B1.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===B1.tag&&Q.default);function l6($,Z,Q){let X=d6($,Q);if(W1.isSeq(X))for(let z of X.items)w$($,Z,z);else if(Array.isArray(X))for(let z of X)w$($,Z,z);else w$($,Z,X)}function w$($,Z,Q){let X=d6($,Q);if(!W1.isMap(X))throw Error("Merge sources must be maps or map aliases");let z=X.toJSON(null,$,Map);for(let[J,H]of z)if(Z instanceof Map){if(!Z.has(J))Z.set(J,H)}else if(Z instanceof Set)Z.add(J);else if(!Object.prototype.hasOwnProperty.call(Z,J))Object.defineProperty(Z,J,{value:H,writable:!0,enumerable:!0,configurable:!0});return Z}function d6($,Z){return $&&W1.isAlias(Z)?Z.resolve($.doc,$):Z}b7.addMergeToJSMap=l6;b7.isMergeKey=C7;b7.merge=B1});var b$=P((v7)=>{var x7=T$(),c6=_1(),g7=I2(),i6=j(),C$=_0();function y7($,Z,{key:Q,value:X}){if(i6.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,X);else if(c6.isMergeKey($,Q))c6.addMergeToJSMap($,Z,X);else{let z=C$.toJS(Q,"",$);if(Z instanceof Map)Z.set(z,C$.toJS(X,z,$));else if(Z instanceof Set)Z.add(z);else{let J=h7(Q,z,$),H=C$.toJS(X,J,$);if(J in Z)Object.defineProperty(Z,J,{value:H,writable:!0,enumerable:!0,configurable:!0});else Z[J]=H}}return Z}function h7($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(i6.isNode($)&&Q?.doc){let X=g7.createStringifyContext(Q.doc,{});X.anchors=new Set;for(let J of Q.anchors.keys())X.anchors.add(J.anchor);X.inFlow=!0,X.inStringifyKey=!0;let z=$.toString(X);if(!Q.mapKeyWarned){let J=JSON.stringify(z);if(J.length>40)J=J.substring(0,36)+'..."';x7.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${J}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return z}return JSON.stringify(Z)}v7.addPairToJSMap=y7});var I0=P((p7)=>{var r6=W2(),k7=u6(),u7=b$(),O1=j();function m7($,Z,Q){let X=r6.createNode($,void 0,Q),z=r6.createNode(Z,void 0,Q);return new D1(X,z)}class D1{constructor($,Z=null){Object.defineProperty(this,O1.NODE_TYPE,{value:O1.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(O1.isNode(Z))Z=Z.clone($);if(O1.isNode(Q))Q=Q.clone($);return new D1(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return u7.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?k7.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}p7.Pair=D1;p7.createPair=m7});var E$=P((n7)=>{var b0=j(),n6=I2(),I1=_2();function c7($,Z,Q){return(Z.inFlow??$.flow?r7:i7)($,Z,Q)}function i7({comment:$,items:Z},Q,{blockItemPrefix:X,flowChars:z,itemIndent:J,onChompKeep:H,onComment:U}){let{indent:q,options:{commentString:Y}}=Q,G=Object.assign({},Q,{indent:J,type:null}),V=!1,B=[];for(let D=0;D<Z.length;++D){let W=Z[D],O=null;if(b0.isNode(W)){if(!V&&W.spaceBefore)B.push("");if(K1(Q,B,W.commentBefore,V),W.comment)O=W.comment}else if(b0.isPair(W)){let N=b0.isNode(W.key)?W.key:null;if(N){if(!V&&N.spaceBefore)B.push("");K1(Q,B,N.commentBefore,V)}}V=!1;let I=n6.stringify(W,G,()=>O=null,()=>V=!0);if(O)I+=I1.lineComment(I,J,Y(O));if(V&&O)V=!1;B.push(X+I)}let _;if(B.length===0)_=z.start+z.end;else{_=B[0];for(let D=1;D<B.length;++D){let W=B[D];_+=W?`
45
- ${q}${W}`:`
46
- `}}if($){if(_+=`
47
- `+I1.indentComment(Y($),q),U)U()}else if(V&&H)H();return _}function r7({items:$},Z,{flowChars:Q,itemIndent:X}){let{indent:z,indentStep:J,flowCollectionPadding:H,options:{commentString:U}}=Z;X+=J;let q=Object.assign({},Z,{indent:X,inFlow:!0,type:null}),Y=!1,G=0,V=[];for(let D=0;D<$.length;++D){let W=$[D],O=null;if(b0.isNode(W)){if(W.spaceBefore)V.push("");if(K1(Z,V,W.commentBefore,!1),W.comment)O=W.comment}else if(b0.isPair(W)){let N=b0.isNode(W.key)?W.key:null;if(N){if(N.spaceBefore)V.push("");if(K1(Z,V,N.commentBefore,!1),N.comment)Y=!0}let F=b0.isNode(W.value)?W.value:null;if(F){if(F.comment)O=F.comment;if(F.commentBefore)Y=!0}else if(W.value==null&&N?.comment)O=N.comment}if(O)Y=!0;let I=n6.stringify(W,q,()=>O=null);if(Y||(Y=V.length>G||I.includes(`
48
- `)),D<$.length-1)I+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)Y||(Y=V.reduce((N,F)=>N+F.length+2,2)+(I.length+2)>Z.options.lineWidth);if(Y)I+=","}if(O)I+=I1.lineComment(I,X,U(O));V.push(I),G=V.length}let{start:B,end:_}=Q;if(V.length===0)return B+_;else{if(!Y){let D=V.reduce((W,O)=>W+O.length+2,2);Y=Z.options.lineWidth>0&&D>Z.options.lineWidth}if(Y){let D=B;for(let W of V)D+=W?`
49
- ${J}${z}${W}`:`
50
- `;return`${D}
51
- ${z}${_}`}else return`${B}${H}${V.join(" ")}${H}${_}`}}function K1({indent:$,options:{commentString:Z}},Q,X,z){if(X&&z)X=X.replace(/^\n+/,"");if(X){let J=I1.indentComment(Z(X),$);Q.push(J.trimStart())}}n7.stringifyCollection=c7});var L0=P(($Q)=>{var s7=E$(),o7=b$(),t7=U1(),K0=j(),L1=I0(),e7=h();function L2($,Z){let Q=K0.isScalar(Z)?Z.value:Z;for(let X of $)if(K0.isPair(X)){if(X.key===Z||X.key===Q)return X;if(K0.isScalar(X.key)&&X.key.value===Q)return X}return}class a6 extends t7.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(K0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:X,replacer:z}=Q,J=new this($),H=(U,q)=>{if(typeof z==="function")q=z.call(Z,U,q);else if(Array.isArray(z)&&!z.includes(U))return;if(q!==void 0||X)J.items.push(L1.createPair(U,q,Q))};if(Z instanceof Map)for(let[U,q]of Z)H(U,q);else if(Z&&typeof Z==="object")for(let U of Object.keys(Z))H(U,Z[U]);if(typeof $.sortMapEntries==="function")J.items.sort($.sortMapEntries);return J}add($,Z){let Q;if(K0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new L1.Pair($,$?.value);else Q=new L1.Pair($.key,$.value);let X=L2(this.items,Q.key),z=this.schema?.sortMapEntries;if(X){if(!Z)throw Error(`Key ${Q.key} already set`);if(K0.isScalar(X.value)&&e7.isScalarValue(Q.value))X.value.value=Q.value;else X.value=Q.value}else if(z){let J=this.items.findIndex((H)=>z(Q,H)<0);if(J===-1)this.items.push(Q);else this.items.splice(J,0,Q)}else this.items.push(Q)}delete($){let Z=L2(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let X=L2(this.items,$)?.value;return(!Z&&K0.isScalar(X)?X.value:X)??void 0}has($){return!!L2(this.items,$)}set($,Z){this.add(new L1.Pair($,Z),!0)}toJSON($,Z,Q){let X=Q?new Q:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(X);for(let z of this.items)o7.addPairToJSMap(Z,X,z);return X}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let X of this.items)if(!K0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return s7.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}$Q.YAMLMap=a6;$Q.findPair=L2});var c0=P((JQ)=>{var XQ=j(),s6=L0(),zQ={collection:"map",default:!0,nodeClass:s6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!XQ.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>s6.YAMLMap.from($,Z,Q)};JQ.map=zQ});var R0=P((BQ)=>{var UQ=W2(),qQ=E$(),YQ=U1(),M1=j(),GQ=h(),VQ=_0();class o6 extends YQ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(M1.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=R1($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=R1($);if(typeof Q!=="number")return;let X=this.items[Q];return!Z&&M1.isScalar(X)?X.value:X}has($){let Z=R1($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=R1($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[Q];if(M1.isScalar(X)&&GQ.isScalarValue(Z))X.value=Z;else this.items[Q]=Z}toJSON($,Z){let Q=[];if(Z?.onCreate)Z.onCreate(Q);let X=0;for(let z of this.items)Q.push(VQ.toJS(z,String(X++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return qQ.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:X}=Q,z=new this($);if(Z&&Symbol.iterator in Object(Z)){let J=0;for(let H of Z){if(typeof X==="function"){let U=Z instanceof Set?H:String(J++);H=X.call(Z,U,H)}z.items.push(UQ.createNode(H,void 0,Q))}}return z}}function R1($){let Z=M1.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}BQ.YAMLSeq=o6});var i0=P((DQ)=>{var _Q=j(),t6=R0(),OQ={collection:"seq",default:!0,nodeClass:t6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!_Q.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>t6.YAMLSeq.from($,Z,Q)};DQ.seq=OQ});var R2=P((RQ)=>{var KQ=D2(),LQ={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,X){return Z=Object.assign({actualString:!0},Z),KQ.stringifyString($,Z,Q,X)}};RQ.string=LQ});var F1=P((FQ)=>{var e6=h(),$9={identify:($)=>$==null,createNode:()=>new e6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e6.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&$9.test.test($)?$:Z.options.nullStr};FQ.nullTag=$9});var j$=P((AQ)=>{var PQ=h(),Z9={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new PQ.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&Z9.test.test($)){let X=$[0]==="t"||$[0]==="T";if(Z===X)return $}return Z?Q.options.trueStr:Q.options.falseStr}};AQ.boolTag=Z9});var r0=P((CQ)=>{function wQ({format:$,minFractionDigits:Z,tag:Q,value:X}){if(typeof X==="bigint")return String(X);let z=typeof X==="number"?X:Number(X);if(!isFinite(z))return isNaN(z)?".nan":z<0?"-.inf":".inf";let J=Object.is(X,-0)?"-0":JSON.stringify(X);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(J)&&!J.includes("e")){let H=J.indexOf(".");if(H<0)H=J.length,J+=".";let U=Z-(J.length-H-1);while(U-- >0)J+="0"}return J}CQ.stringifyNumber=wQ});var x$=P((gQ)=>{var EQ=h(),S$=r0(),jQ={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:S$.stringifyNumber},SQ={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():S$.stringifyNumber($)}},xQ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new EQ.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:S$.stringifyNumber};gQ.float=xQ;gQ.floatExp=SQ;gQ.floatNaN=jQ});var y$=P((mQ)=>{var Q9=r0(),N1=($)=>typeof $==="bigint"||Number.isInteger($),g$=($,Z,Q,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(Z),Q);function X9($,Z,Q){let{value:X}=$;if(N1(X)&&X>=0)return Q+X.toString(Z);return Q9.stringifyNumber($)}var fQ={identify:($)=>N1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>g$($,2,8,Q),stringify:($)=>X9($,8,"0o")},kQ={identify:N1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>g$($,0,10,Q),stringify:Q9.stringifyNumber},uQ={identify:($)=>N1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>g$($,2,16,Q),stringify:($)=>X9($,16,"0x")};mQ.int=kQ;mQ.intHex=uQ;mQ.intOct=fQ});var z9=P((oQ)=>{var cQ=c0(),iQ=F1(),rQ=i0(),nQ=R2(),aQ=j$(),h$=x$(),v$=y$(),sQ=[cQ.map,rQ.seq,nQ.string,iQ.nullTag,aQ.boolTag,v$.intOct,v$.int,v$.intHex,h$.floatNaN,h$.floatExp,h$.float];oQ.schema=sQ});var H9=P((JX)=>{var eQ=h(),$X=c0(),ZX=i0();function J9($){return typeof $==="bigint"||Number.isInteger($)}var P1=({value:$})=>JSON.stringify($),QX=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:P1},{identify:($)=>$==null,createNode:()=>new eQ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:P1},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:P1},{identify:J9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>J9($)?$.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:P1}],XX={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},zX=[$X.map,ZX.seq].concat(QX,XX);JX.schema=zX});var k$=P((YX)=>{var M2=H2("buffer"),f$=h(),UX=D2(),qX={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof M2.Buffer==="function")return M2.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),X=new Uint8Array(Q.length);for(let z=0;z<Q.length;++z)X[z]=Q.charCodeAt(z);return X}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},X,z,J){if(!Q)return"";let H=Q,U;if(typeof M2.Buffer==="function")U=H instanceof M2.Buffer?H.toString("base64"):M2.Buffer.from(H.buffer).toString("base64");else if(typeof btoa==="function"){let q="";for(let Y=0;Y<H.length;++Y)q+=String.fromCharCode(H[Y]);U=btoa(q)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=f$.Scalar.BLOCK_LITERAL),Z!==f$.Scalar.QUOTE_DOUBLE){let q=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),Y=Math.ceil(U.length/q),G=Array(Y);for(let V=0,B=0;V<Y;++V,B+=q)G[V]=U.substr(B,q);U=G.join(Z===f$.Scalar.BLOCK_LITERAL?`
52
- `:" ")}return UX.stringifyString({comment:$,type:Z,value:U},X,z,J)}};YX.binary=qX});var T1=P((_X)=>{var A1=j(),u$=I0(),VX=h(),BX=R0();function U9($,Z){if(A1.isSeq($))for(let Q=0;Q<$.items.length;++Q){let X=$.items[Q];if(A1.isPair(X))continue;else if(A1.isMap(X)){if(X.items.length>1)Z("Each pair must have its own sequence indicator");let z=X.items[0]||new u$.Pair(new VX.Scalar(null));if(X.commentBefore)z.key.commentBefore=z.key.commentBefore?`${X.commentBefore}
53
- ${z.key.commentBefore}`:X.commentBefore;if(X.comment){let J=z.value??z.key;J.comment=J.comment?`${X.comment}
54
- ${J.comment}`:X.comment}X=z}$.items[Q]=A1.isPair(X)?X:new u$.Pair(X)}else Z("Expected a sequence for this tag");return $}function q9($,Z,Q){let{replacer:X}=Q,z=new BX.YAMLSeq($);z.tag="tag:yaml.org,2002:pairs";let J=0;if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof X==="function")H=X.call(Z,String(J++),H);let U,q;if(Array.isArray(H))if(H.length===2)U=H[0],q=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let Y=Object.keys(H);if(Y.length===1)U=Y[0],q=H[U];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else U=H;z.items.push(u$.createPair(U,q,Q))}return z}var WX={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:U9,createNode:q9};_X.createPairs=q9;_X.pairs=WX;_X.resolvePairs=U9});var p$=P((RX)=>{var Y9=j(),m$=_0(),F2=L0(),KX=R0(),G9=T1();class E0 extends KX.YAMLSeq{constructor(){super();this.add=F2.YAMLMap.prototype.add.bind(this),this.delete=F2.YAMLMap.prototype.delete.bind(this),this.get=F2.YAMLMap.prototype.get.bind(this),this.has=F2.YAMLMap.prototype.has.bind(this),this.set=F2.YAMLMap.prototype.set.bind(this),this.tag=E0.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let X of this.items){let z,J;if(Y9.isPair(X))z=m$.toJS(X.key,"",Z),J=m$.toJS(X.value,z,Z);else z=m$.toJS(X,"",Z);if(Q.has(z))throw Error("Ordered maps must not include duplicate keys");Q.set(z,J)}return Q}static from($,Z,Q){let X=G9.createPairs($,Z,Q),z=new this;return z.items=X.items,z}}E0.tag="tag:yaml.org,2002:omap";var LX={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:E0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=G9.resolvePairs($,Z),X=[];for(let{key:z}of Q.items)if(Y9.isScalar(z))if(X.includes(z.value))Z(`Ordered maps must not include duplicate keys: ${z.value}`);else X.push(z.value);return Object.assign(new E0,Q)},createNode:($,Z,Q)=>E0.from($,Z,Q)};RX.YAMLOMap=E0;RX.omap=LX});var O9=P((NX)=>{var V9=h();function B9({value:$,source:Z},Q){if(Z&&($?W9:_9).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var W9={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new V9.Scalar(!0),stringify:B9},_9={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new V9.Scalar(!1),stringify:B9};NX.falseTag=_9;NX.trueTag=W9});var D9=P((EX)=>{var TX=h(),l$=r0(),wX={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:l$.stringifyNumber},CX={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():l$.stringifyNumber($)}},bX={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new TX.Scalar(parseFloat($.replace(/_/g,""))),Q=$.indexOf(".");if(Q!==-1){let X=$.substring(Q+1).replace(/_/g,"");if(X[X.length-1]==="0")Z.minFractionDigits=X.length}return Z},stringify:l$.stringifyNumber};EX.float=bX;EX.floatExp=CX;EX.floatNaN=wX});var K9=P((fX)=>{var I9=r0(),N2=($)=>typeof $==="bigint"||Number.isInteger($);function w1($,Z,Q,{intAsBigInt:X}){let z=$[0];if(z==="-"||z==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),X){switch(Q){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let H=BigInt($);return z==="-"?BigInt(-1)*H:H}let J=parseInt($,Q);return z==="-"?-1*J:J}function d$($,Z,Q){let{value:X}=$;if(N2(X)){let z=X.toString(Z);return X<0?"-"+Q+z.substr(1):Q+z}return I9.stringifyNumber($)}var gX={identify:N2,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>w1($,2,2,Q),stringify:($)=>d$($,2,"0b")},yX={identify:N2,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>w1($,1,8,Q),stringify:($)=>d$($,8,"0")},hX={identify:N2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>w1($,0,10,Q),stringify:I9.stringifyNumber},vX={identify:N2,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>w1($,2,16,Q),stringify:($)=>d$($,16,"0x")};fX.int=hX;fX.intBin=gX;fX.intHex=vX;fX.intOct=yX});var c$=P((dX)=>{var E1=j(),C1=I0(),b1=L0();class j0 extends b1.YAMLMap{constructor($){super($);this.tag=j0.tag}add($){let Z;if(E1.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new C1.Pair($.key,null);else Z=new C1.Pair($,null);if(!b1.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=b1.findPair(this.items,$);return!Z&&E1.isPair(Q)?E1.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=b1.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new C1.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:X}=Q,z=new this($);if(Z&&Symbol.iterator in Object(Z))for(let J of Z){if(typeof X==="function")J=X.call(Z,J,J);z.items.push(C1.createPair(J,null,Q))}return z}}j0.tag="tag:yaml.org,2002:set";var lX={collection:"map",identify:($)=>$ instanceof Set,nodeClass:j0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>j0.from($,Z,Q),resolve($,Z){if(E1.isMap($))if($.hasAllNullValues(!0))return Object.assign(new j0,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};dX.YAMLSet=j0;dX.set=lX});var r$=P((sX)=>{var rX=r0();function i$($,Z){let Q=$[0],X=Q==="-"||Q==="+"?$.substring(1):$,z=(H)=>Z?BigInt(H):Number(H),J=X.replace(/_/g,"").split(":").reduce((H,U)=>H*z(60)+z(U),z(0));return Q==="-"?z(-1)*J:J}function L9($){let{value:Z}=$,Q=(H)=>H;if(typeof Z==="bigint")Q=(H)=>BigInt(H);else if(isNaN(Z)||!isFinite(Z))return rX.stringifyNumber($);let X="";if(Z<0)X="-",Z*=Q(-1);let z=Q(60),J=[Z%z];if(Z<60)J.unshift(0);else if(Z=(Z-J[0])/z,J.unshift(Z%z),Z>=60)Z=(Z-J[0])/z,J.unshift(Z);return X+J.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var nX={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})=>i$($,Q),stringify:L9},aX={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:($)=>i$($,!1),stringify:L9},R9={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(R9.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,X,z,J,H,U]=Z.map(Number),q=Z[7]?Number((Z[7]+"00").substr(1,3)):0,Y=Date.UTC(Q,X-1,z,J||0,H||0,U||0,q),G=Z[8];if(G&&G!=="Z"){let V=i$(G,!1);if(Math.abs(V)<30)V*=60;Y-=60000*V}return new Date(Y)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};sX.floatTime=aX;sX.intTime=nX;sX.timestamp=R9});var F9=P((Gz)=>{var $z=c0(),Zz=F1(),Qz=i0(),Xz=R2(),zz=k$(),M9=O9(),n$=D9(),j1=K9(),Jz=_1(),Hz=p$(),Uz=T1(),qz=c$(),a$=r$(),Yz=[$z.map,Qz.seq,Xz.string,Zz.nullTag,M9.trueTag,M9.falseTag,j1.intBin,j1.intOct,j1.int,j1.intHex,n$.floatNaN,n$.floatExp,n$.float,zz.binary,Jz.merge,Hz.omap,Uz.pairs,qz.set,a$.intTime,a$.floatTime,a$.timestamp];Gz.schema=Yz});var S9=P((Lz)=>{var T9=c0(),Bz=F1(),w9=i0(),Wz=R2(),_z=j$(),s$=x$(),o$=y$(),Oz=z9(),Dz=H9(),C9=k$(),P2=_1(),b9=p$(),E9=T1(),N9=F9(),j9=c$(),S1=r$(),P9=new Map([["core",Oz.schema],["failsafe",[T9.map,w9.seq,Wz.string]],["json",Dz.schema],["yaml11",N9.schema],["yaml-1.1",N9.schema]]),A9={binary:C9.binary,bool:_z.boolTag,float:s$.float,floatExp:s$.floatExp,floatNaN:s$.floatNaN,floatTime:S1.floatTime,int:o$.int,intHex:o$.intHex,intOct:o$.intOct,intTime:S1.intTime,map:T9.map,merge:P2.merge,null:Bz.nullTag,omap:b9.omap,pairs:E9.pairs,seq:w9.seq,set:j9.set,timestamp:S1.timestamp},Iz={"tag:yaml.org,2002:binary":C9.binary,"tag:yaml.org,2002:merge":P2.merge,"tag:yaml.org,2002:omap":b9.omap,"tag:yaml.org,2002:pairs":E9.pairs,"tag:yaml.org,2002:set":j9.set,"tag:yaml.org,2002:timestamp":S1.timestamp};function Kz($,Z,Q){let X=P9.get(Z);if(X&&!$)return Q&&!X.includes(P2.merge)?X.concat(P2.merge):X.slice();let z=X;if(!z)if(Array.isArray($))z=[];else{let J=Array.from(P9.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${J} or define customTags array`)}if(Array.isArray($))for(let J of $)z=z.concat(J);else if(typeof $==="function")z=$(z.slice());if(Q)z=z.concat(P2.merge);return z.reduce((J,H)=>{let U=typeof H==="string"?A9[H]:H;if(!U){let q=JSON.stringify(H),Y=Object.keys(A9).map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown custom tag ${q}; use one of ${Y}`)}if(!J.includes(U))J.push(U);return J},[])}Lz.coreKnownTags=Iz;Lz.getTags=Kz});var $8=P((Tz)=>{var t$=j(),Fz=c0(),Nz=i0(),Pz=R2(),x1=S9(),Az=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class e${constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:X,schema:z,sortMapEntries:J,toStringDefaults:H}){this.compat=Array.isArray($)?x1.getTags($,"compat"):$?x1.getTags(null,$):null,this.name=typeof z==="string"&&z||"core",this.knownTags=X?x1.coreKnownTags:{},this.tags=x1.getTags(Z,this.name,Q),this.toStringOptions=H??null,Object.defineProperty(this,t$.MAP,{value:Fz.map}),Object.defineProperty(this,t$.SCALAR,{value:Pz.string}),Object.defineProperty(this,t$.SEQ,{value:Nz.seq}),this.sortMapEntries=typeof J==="function"?J:J===!0?Az:null}clone(){let $=Object.create(e$.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}Tz.Schema=e$});var x9=P((Ez)=>{var Cz=j(),Z8=I2(),A2=_2();function bz($,Z){let Q=[],X=Z.directives===!0;if(Z.directives!==!1&&$.directives){let q=$.directives.toString($);if(q)Q.push(q),X=!0;else if($.directives.docStart)X=!0}if(X)Q.push("---");let z=Z8.createStringifyContext($,Z),{commentString:J}=z.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let q=J($.commentBefore);Q.unshift(A2.indentComment(q,""))}let H=!1,U=null;if($.contents){if(Cz.isNode($.contents)){if($.contents.spaceBefore&&X)Q.push("");if($.contents.commentBefore){let G=J($.contents.commentBefore);Q.push(A2.indentComment(G,""))}z.forceBlockIndent=!!$.comment,U=$.contents.comment}let q=U?void 0:()=>H=!0,Y=Z8.stringify($.contents,z,()=>U=null,q);if(U)Y+=A2.lineComment(Y,"",J(U));if((Y[0]==="|"||Y[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${Y}`;else Q.push(Y)}else Q.push(Z8.stringify($.contents,z));if($.directives?.docEnd)if($.comment){let q=J($.comment);if(q.includes(`
55
- `))Q.push("..."),Q.push(A2.indentComment(q,""));else Q.push(`... ${q}`)}else Q.push("...");else{let q=$.comment;if(q&&H)q=q.replace(/^\n+/,"");if(q){if((!H||U)&&Q[Q.length-1]!=="")Q.push("");Q.push(A2.indentComment(J(q),""))}}return Q.join(`
41
+ ${Q.indent}`}else if(!q&&S0.isCollection(Z)){let E=C[0],_=C.indexOf(`
42
+ `),w=_!==-1,c=Q.inFlow??Z.flow??Z.items.length===0;if(w||!c){let a=!1;if(w&&(E==="&"||E==="!")){let O=C.indexOf(" ");if(E==="&"&&O!==-1&&O<_&&C[O+1]==="!")O=C.indexOf(" ",O+1);if(O===-1||_<O)a=!0}if(!a)T=`
43
+ ${Q.indent}`}}else if(C===""||C[0]===`
44
+ `)T="";if(D+=T+C,Q.inFlow){if(A&&z)z()}else if(N&&!A)D+=K$.lineComment(D,Q.indent,G(N));else if(K&&X)X();return D}OH.stringifyPair=_H});var H1=P((NH)=>{var e5=Z$("process");function RH($,...Z){if($==="debug")console.log(...Z)}function FH($,Z){if($==="debug"||$==="warn")if(typeof e5.emitWarning==="function")e5.emitWarning(Z);else console.warn(Z)}NH.debug=RH;NH.warn=FH});var P6=P((CH)=>{var N6=g(),$Z=p(),R6="<<",F6={identify:($)=>$===R6||typeof $==="symbol"&&$.description===R6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $Z.Scalar(Symbol(R6)),{addToJSMap:ZZ}),stringify:()=>R6},TH=($,Z)=>(F6.identify(Z)||N6.isScalar(Z)&&(!Z.type||Z.type===$Z.Scalar.PLAIN)&&F6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===F6.tag&&Q.default);function ZZ($,Z,Q){let z=QZ($,Q);if(N6.isSeq(z))for(let X of z.items)U1($,Z,X);else if(Array.isArray(z))for(let X of z)U1($,Z,X);else U1($,Z,z)}function U1($,Z,Q){let z=QZ($,Q);if(!N6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[H,U]of X)if(Z instanceof Map){if(!Z.has(H))Z.set(H,U)}else if(Z instanceof Set)Z.add(H);else if(!Object.prototype.hasOwnProperty.call(Z,H))Object.defineProperty(Z,H,{value:U,writable:!0,enumerable:!0,configurable:!0});return Z}function QZ($,Z){return $&&N6.isAlias(Z)?Z.resolve($.doc,$):Z}CH.addMergeToJSMap=ZZ;CH.isMergeKey=TH;CH.merge=F6});var V1=P((vH)=>{var SH=H1(),zZ=P6(),bH=q$(),XZ=g(),J1=m0();function gH($,Z,{key:Q,value:z}){if(XZ.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(zZ.isMergeKey($,Q))zZ.addMergeToJSMap($,Z,z);else{let X=J1.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,J1.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let H=xH(Q,X,$),U=J1.toJS(z,H,$);if(H in Z)Object.defineProperty(Z,H,{value:U,writable:!0,enumerable:!0,configurable:!0});else Z[H]=U}}return Z}function xH($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(XZ.isNode($)&&Q?.doc){let z=bH.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let H of Q.anchors.keys())z.anchors.add(H.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let H=JSON.stringify(X);if(H.length>40)H=H.substring(0,36)+'..."';SH.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${H}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}vH.addPairToJSMap=gH});var c0=P((uH)=>{var HZ=G$(),kH=t5(),hH=V1(),A6=g();function fH($,Z,Q){let z=HZ.createNode($,void 0,Q),X=HZ.createNode(Z,void 0,Q);return new T6(z,X)}class T6{constructor($,Z=null){Object.defineProperty(this,A6.NODE_TYPE,{value:A6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(A6.isNode(Z))Z=Z.clone($);if(A6.isNode(Q))Q=Q.clone($);return new T6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return hH.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?kH.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}uH.Pair=T6;uH.createPair=fH});var G1=P((iH)=>{var X2=g(),UZ=q$(),C6=Y$();function lH($,Z,Q){return(Z.inFlow??$.flow?dH:cH)($,Z,Q)}function cH({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:H,onChompKeep:U,onComment:J}){let{indent:V,options:{commentString:G}}=Q,Y=Object.assign({},Q,{indent:H,type:null}),W=!1,B=[];for(let I=0;I<Z.length;++I){let K=Z[I],D=null;if(X2.isNode(K)){if(!W&&K.spaceBefore)B.push("");if(w6(Q,B,K.commentBefore,W),K.comment)D=K.comment}else if(X2.isPair(K)){let F=X2.isNode(K.key)?K.key:null;if(F){if(!W&&F.spaceBefore)B.push("");w6(Q,B,F.commentBefore,W)}}W=!1;let L=UZ.stringify(K,Y,()=>D=null,()=>W=!0);if(D)L+=C6.lineComment(L,H,G(D));if(W&&D)W=!1;B.push(z+L)}let q;if(B.length===0)q=X.start+X.end;else{q=B[0];for(let I=1;I<B.length;++I){let K=B[I];q+=K?`
45
+ ${V}${K}`:`
46
+ `}}if($){if(q+=`
47
+ `+C6.indentComment(G($),V),J)J()}else if(W&&U)U();return q}function dH({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:H,flowCollectionPadding:U,options:{commentString:J}}=Z;z+=H;let V=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),G=!1,Y=0,W=[];for(let I=0;I<$.length;++I){let K=$[I],D=null;if(X2.isNode(K)){if(K.spaceBefore)W.push("");if(w6(Z,W,K.commentBefore,!1),K.comment)D=K.comment}else if(X2.isPair(K)){let F=X2.isNode(K.key)?K.key:null;if(F){if(F.spaceBefore)W.push("");if(w6(Z,W,F.commentBefore,!1),F.comment)G=!0}let N=X2.isNode(K.value)?K.value:null;if(N){if(N.comment)D=N.comment;if(N.commentBefore)G=!0}else if(K.value==null&&F?.comment)D=F.comment}if(D)G=!0;let L=UZ.stringify(K,V,()=>D=null);if(G||(G=W.length>Y||L.includes(`
48
+ `)),I<$.length-1)L+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)G||(G=W.reduce((F,N)=>F+N.length+2,2)+(L.length+2)>Z.options.lineWidth);if(G)L+=","}if(D)L+=C6.lineComment(L,z,J(D));W.push(L),Y=W.length}let{start:B,end:q}=Q;if(W.length===0)return B+q;else{if(!G){let I=W.reduce((K,D)=>K+D.length+2,2);G=Z.options.lineWidth>0&&I>Z.options.lineWidth}if(G){let I=B;for(let K of W)I+=K?`
49
+ ${H}${X}${K}`:`
50
+ `;return`${I}
51
+ ${X}${q}`}else return`${B}${U}${W.join(" ")}${U}${q}`}}function w6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let H=C6.indentComment(Z(z),$);Q.push(H.trimStart())}}iH.stringifyCollection=lH});var i0=P((tH)=>{var rH=G1(),sH=V1(),oH=L6(),d0=g(),j6=c0(),aH=p();function D$($,Z){let Q=d0.isScalar(Z)?Z.value:Z;for(let z of $)if(d0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(d0.isScalar(z.key)&&z.key.value===Q)return z}return}class JZ extends oH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(d0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,H=new this($),U=(J,V)=>{if(typeof X==="function")V=X.call(Z,J,V);else if(Array.isArray(X)&&!X.includes(J))return;if(V!==void 0||z)H.items.push(j6.createPair(J,V,Q))};if(Z instanceof Map)for(let[J,V]of Z)U(J,V);else if(Z&&typeof Z==="object")for(let J of Object.keys(Z))U(J,Z[J]);if(typeof $.sortMapEntries==="function")H.items.sort($.sortMapEntries);return H}add($,Z){let Q;if(d0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new j6.Pair($,$?.value);else Q=new j6.Pair($.key,$.value);let z=D$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(d0.isScalar(z.value)&&aH.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let H=this.items.findIndex((U)=>X(Q,U)<0);if(H===-1)this.items.push(Q);else this.items.splice(H,0,Q)}else this.items.push(Q)}delete($){let Z=D$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=D$(this.items,$)?.value;return(!Z&&d0.isScalar(z)?z.value:z)??void 0}has($){return!!D$(this.items,$)}set($,Z){this.add(new j6.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)sH.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!d0.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 rH.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}tH.YAMLMap=JZ;tH.findPair=D$});var g2=P((zU)=>{var ZU=g(),VZ=i0(),QU={collection:"map",default:!0,nodeClass:VZ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!ZU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>VZ.YAMLMap.from($,Z,Q)};zU.map=QU});var n0=P((YU)=>{var HU=G$(),UU=G1(),JU=L6(),S6=g(),VU=p(),GU=m0();class GZ extends JU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(S6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=E6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=E6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&S6.isScalar(z)?z.value:z}has($){let Z=E6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=E6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(S6.isScalar(z)&&VU.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(GU.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return UU.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let H=0;for(let U of Z){if(typeof z==="function"){let J=Z instanceof Set?U:String(H++);U=z.call(Z,J,U)}X.items.push(HU.createNode(U,void 0,Q))}}return X}}function E6($){let Z=S6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}YU.YAMLSeq=GZ});var x2=P((KU)=>{var BU=g(),YZ=n0(),qU={collection:"seq",default:!0,nodeClass:YZ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!BU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>YZ.YAMLSeq.from($,Z,Q)};KU.seq=qU});var I$=P((_U)=>{var IU=B$(),LU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),IU.stringifyString($,Z,Q,z)}};_U.string=LU});var b6=P((MU)=>{var WZ=p(),BZ={identify:($)=>$==null,createNode:()=>new WZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new WZ.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&BZ.test.test($)?$:Z.options.nullStr};MU.nullTag=BZ});var Y1=P((NU)=>{var FU=p(),qZ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new FU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&qZ.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};NU.boolTag=qZ});var v2=P((TU)=>{function AU({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let H=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(H)&&!H.includes("e")){let U=H.indexOf(".");if(U<0)U=H.length,H+=".";let J=Z-(H.length-U-1);while(J-- >0)H+="0"}return H}TU.stringifyNumber=AU});var B1=P((bU)=>{var wU=p(),W1=v2(),jU={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:W1.stringifyNumber},EU={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():W1.stringifyNumber($)}},SU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new wU.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:W1.stringifyNumber};bU.float=SU;bU.floatExp=EU;bU.floatNaN=jU});var K1=P((fU)=>{var KZ=v2(),g6=($)=>typeof $==="bigint"||Number.isInteger($),q1=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function DZ($,Z,Q){let{value:z}=$;if(g6(z)&&z>=0)return Q+z.toString(Z);return KZ.stringifyNumber($)}var yU={identify:($)=>g6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>q1($,2,8,Q),stringify:($)=>DZ($,8,"0o")},kU={identify:g6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>q1($,0,10,Q),stringify:KZ.stringifyNumber},hU={identify:($)=>g6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>q1($,2,16,Q),stringify:($)=>DZ($,16,"0x")};fU.int=kU;fU.intHex=hU;fU.intOct=yU});var IZ=P((sU)=>{var lU=g2(),cU=b6(),dU=x2(),iU=I$(),nU=Y1(),D1=B1(),I1=K1(),rU=[lU.map,dU.seq,iU.string,cU.nullTag,nU.boolTag,I1.intOct,I1.int,I1.intHex,D1.floatNaN,D1.floatExp,D1.float];sU.schema=rU});var _Z=P((zJ)=>{var aU=p(),tU=g2(),eU=x2();function LZ($){return typeof $==="bigint"||Number.isInteger($)}var x6=({value:$})=>JSON.stringify($),$J=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:x6},{identify:($)=>$==null,createNode:()=>new aU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:x6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:x6},{identify:LZ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>LZ($)?$.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:x6}],ZJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},QJ=[tU.map,eU.seq].concat($J,ZJ);zJ.schema=QJ});var _1=P((JJ)=>{var L$=Z$("buffer"),L1=p(),HJ=B$(),UJ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof L$.Buffer==="function")return L$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,H){if(!Q)return"";let U=Q,J;if(typeof L$.Buffer==="function")J=U instanceof L$.Buffer?U.toString("base64"):L$.Buffer.from(U.buffer).toString("base64");else if(typeof btoa==="function"){let V="";for(let G=0;G<U.length;++G)V+=String.fromCharCode(U[G]);J=btoa(V)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=L1.Scalar.BLOCK_LITERAL),Z!==L1.Scalar.QUOTE_DOUBLE){let V=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),G=Math.ceil(J.length/V),Y=Array(G);for(let W=0,B=0;W<G;++W,B+=V)Y[W]=J.substr(B,V);J=Y.join(Z===L1.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return HJ.stringifyString({comment:$,type:Z,value:J},z,X,H)}};JJ.binary=UJ});var y6=P((BJ)=>{var v6=g(),O1=c0(),GJ=p(),YJ=n0();function OZ($,Z){if(v6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(v6.isPair(z))continue;else if(v6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new O1.Pair(new GJ.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
53
+ ${X.key.commentBefore}`:z.commentBefore;if(z.comment){let H=X.value??X.key;H.comment=H.comment?`${z.comment}
54
+ ${H.comment}`:z.comment}z=X}$.items[Q]=v6.isPair(z)?z:new O1.Pair(z)}else Z("Expected a sequence for this tag");return $}function MZ($,Z,Q){let{replacer:z}=Q,X=new YJ.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let H=0;if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,String(H++),U);let J,V;if(Array.isArray(U))if(U.length===2)J=U[0],V=U[1];else throw TypeError(`Expected [key, value] tuple: ${U}`);else if(U&&U instanceof Object){let G=Object.keys(U);if(G.length===1)J=G[0],V=U[J];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else J=U;X.items.push(O1.createPair(J,V,Q))}return X}var WJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:OZ,createNode:MZ};BJ.createPairs=MZ;BJ.pairs=WJ;BJ.resolvePairs=OZ});var R1=P((_J)=>{var RZ=g(),M1=m0(),_$=i0(),IJ=n0(),FZ=y6();class H2 extends IJ.YAMLSeq{constructor(){super();this.add=_$.YAMLMap.prototype.add.bind(this),this.delete=_$.YAMLMap.prototype.delete.bind(this),this.get=_$.YAMLMap.prototype.get.bind(this),this.has=_$.YAMLMap.prototype.has.bind(this),this.set=_$.YAMLMap.prototype.set.bind(this),this.tag=H2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,H;if(RZ.isPair(z))X=M1.toJS(z.key,"",Z),H=M1.toJS(z.value,X,Z);else X=M1.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,H)}return Q}static from($,Z,Q){let z=FZ.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}H2.tag="tag:yaml.org,2002:omap";var LJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:H2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=FZ.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(RZ.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 H2,Q)},createNode:($,Z,Q)=>H2.from($,Z,Q)};_J.YAMLOMap=H2;_J.omap=LJ});var CZ=P((RJ)=>{var NZ=p();function PZ({value:$,source:Z},Q){if(Z&&($?AZ:TZ).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var AZ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new NZ.Scalar(!0),stringify:PZ},TZ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new NZ.Scalar(!1),stringify:PZ};RJ.falseTag=TZ;RJ.trueTag=AZ});var wZ=P((wJ)=>{var PJ=p(),F1=v2(),AJ={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:F1.stringifyNumber},TJ={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():F1.stringifyNumber($)}},CJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new PJ.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:F1.stringifyNumber};wJ.float=CJ;wJ.floatExp=TJ;wJ.floatNaN=AJ});var EZ=P((yJ)=>{var jZ=v2(),O$=($)=>typeof $==="bigint"||Number.isInteger($);function k6($,Z,Q,{intAsBigInt:z}){let X=$[0];if(X==="-"||X==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(Q){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let U=BigInt($);return X==="-"?BigInt(-1)*U:U}let H=parseInt($,Q);return X==="-"?-1*H:H}function N1($,Z,Q){let{value:z}=$;if(O$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return jZ.stringifyNumber($)}var bJ={identify:O$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>k6($,2,2,Q),stringify:($)=>N1($,2,"0b")},gJ={identify:O$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>k6($,1,8,Q),stringify:($)=>N1($,8,"0")},xJ={identify:O$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>k6($,0,10,Q),stringify:jZ.stringifyNumber},vJ={identify:O$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>k6($,2,16,Q),stringify:($)=>N1($,16,"0x")};yJ.int=xJ;yJ.intBin=bJ;yJ.intHex=vJ;yJ.intOct=gJ});var P1=P((pJ)=>{var u6=g(),h6=c0(),f6=i0();class U2 extends f6.YAMLMap{constructor($){super($);this.tag=U2.tag}add($){let Z;if(u6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new h6.Pair($.key,null);else Z=new h6.Pair($,null);if(!f6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=f6.findPair(this.items,$);return!Z&&u6.isPair(Q)?u6.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=f6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new h6.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof z==="function")H=z.call(Z,H,H);X.items.push(h6.createPair(H,null,Q))}return X}}U2.tag="tag:yaml.org,2002:set";var mJ={collection:"map",identify:($)=>$ instanceof Set,nodeClass:U2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>U2.from($,Z,Q),resolve($,Z){if(u6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new U2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};pJ.YAMLSet=U2;pJ.set=mJ});var T1=P((rJ)=>{var dJ=v2();function A1($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(U)=>Z?BigInt(U):Number(U),H=z.replace(/_/g,"").split(":").reduce((U,J)=>U*X(60)+X(J),X(0));return Q==="-"?X(-1)*H:H}function SZ($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return dJ.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),H=[Z%X];if(Z<60)H.unshift(0);else if(Z=(Z-H[0])/X,H.unshift(Z%X),Z>=60)Z=(Z-H[0])/X,H.unshift(Z);return z+H.map((U)=>String(U).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var iJ={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})=>A1($,Q),stringify:SZ},nJ={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:($)=>A1($,!1),stringify:SZ},bZ={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(bZ.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,H,U,J]=Z.map(Number),V=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(Q,z-1,X,H||0,U||0,J||0,V),Y=Z[8];if(Y&&Y!=="Z"){let W=A1(Y,!1);if(Math.abs(W)<30)W*=60;G-=60000*W}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};rJ.floatTime=nJ;rJ.intTime=iJ;rJ.timestamp=bZ});var xZ=P((VV)=>{var tJ=g2(),eJ=b6(),$V=x2(),ZV=I$(),QV=_1(),gZ=CZ(),C1=wZ(),m6=EZ(),zV=P6(),XV=R1(),HV=y6(),UV=P1(),w1=T1(),JV=[tJ.map,$V.seq,ZV.string,eJ.nullTag,gZ.trueTag,gZ.falseTag,m6.intBin,m6.intOct,m6.int,m6.intHex,C1.floatNaN,C1.floatExp,C1.float,QV.binary,zV.merge,XV.omap,HV.pairs,UV.set,w1.intTime,w1.floatTime,w1.timestamp];VV.schema=JV});var cZ=P((LV)=>{var hZ=g2(),YV=b6(),fZ=x2(),WV=I$(),BV=Y1(),j1=B1(),E1=K1(),qV=IZ(),KV=_Z(),uZ=_1(),M$=P6(),mZ=R1(),pZ=y6(),vZ=xZ(),lZ=P1(),p6=T1(),yZ=new Map([["core",qV.schema],["failsafe",[hZ.map,fZ.seq,WV.string]],["json",KV.schema],["yaml11",vZ.schema],["yaml-1.1",vZ.schema]]),kZ={binary:uZ.binary,bool:BV.boolTag,float:j1.float,floatExp:j1.floatExp,floatNaN:j1.floatNaN,floatTime:p6.floatTime,int:E1.int,intHex:E1.intHex,intOct:E1.intOct,intTime:p6.intTime,map:hZ.map,merge:M$.merge,null:YV.nullTag,omap:mZ.omap,pairs:pZ.pairs,seq:fZ.seq,set:lZ.set,timestamp:p6.timestamp},DV={"tag:yaml.org,2002:binary":uZ.binary,"tag:yaml.org,2002:merge":M$.merge,"tag:yaml.org,2002:omap":mZ.omap,"tag:yaml.org,2002:pairs":pZ.pairs,"tag:yaml.org,2002:set":lZ.set,"tag:yaml.org,2002:timestamp":p6.timestamp};function IV($,Z,Q){let z=yZ.get(Z);if(z&&!$)return Q&&!z.includes(M$.merge)?z.concat(M$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let H=Array.from(yZ.keys()).filter((U)=>U!=="yaml11").map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${H} or define customTags array`)}if(Array.isArray($))for(let H of $)X=X.concat(H);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(M$.merge);return X.reduce((H,U)=>{let J=typeof U==="string"?kZ[U]:U;if(!J){let V=JSON.stringify(U),G=Object.keys(kZ).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${V}; use one of ${G}`)}if(!H.includes(J))H.push(J);return H},[])}LV.coreKnownTags=DV;LV.getTags=IV});var g1=P((PV)=>{var S1=g(),MV=g2(),RV=x2(),FV=I$(),l6=cZ(),NV=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class b1{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?l6.getTags($,"compat"):$?l6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?l6.coreKnownTags:{},this.tags=l6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,S1.MAP,{value:MV.map}),Object.defineProperty(this,S1.SCALAR,{value:FV.string}),Object.defineProperty(this,S1.SEQ,{value:RV.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?NV:null}clone(){let $=Object.create(b1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}PV.Schema=b1});var dZ=P((wV)=>{var TV=g(),x1=q$(),R$=Y$();function CV($,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=x1.createStringifyContext($,Z),{commentString:H}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=H($.commentBefore);Q.unshift(R$.indentComment(V,""))}let U=!1,J=null;if($.contents){if(TV.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=H($.contents.commentBefore);Q.push(R$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let V=J?void 0:()=>U=!0,G=x1.stringify($.contents,X,()=>J=null,V);if(J)G+=R$.lineComment(G,"",H(J));if((G[0]==="|"||G[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${G}`;else Q.push(G)}else Q.push(x1.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=H($.comment);if(V.includes(`
55
+ `))Q.push("..."),Q.push(R$.indentComment(V,""));else Q.push(`... ${V}`)}else Q.push("...");else{let V=$.comment;if(V&&U)V=V.replace(/^\n+/,"");if(V){if((!U||J)&&Q[Q.length-1]!=="")Q.push("");Q.push(R$.indentComment(H(V),""))}}return Q.join(`
56
56
  `)+`
57
- `}Ez.stringifyDocument=bz});var T2=P((kz)=>{var Sz=B2(),n0=U1(),i=j(),xz=I0(),gz=_0(),yz=$8(),hz=x9(),Q8=z1(),vz=M$(),fz=W2(),X8=R$();class z8{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,i.NODE_TYPE,{value:i.DOC});let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=z;let{version:J}=z;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)J=this.directives.yaml.version}else this.directives=new X8.Directives({version:J});this.setSchema(J,Q),this.contents=$===void 0?null:this.createNode($,X,Q)}clone(){let $=Object.create(z8.prototype,{[i.NODE_TYPE]:{value:i.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=i.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(a0(this.contents))this.contents.add($)}addIn($,Z){if(a0(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=Q8.anchorNames(this);$.anchor=!Z||Q.has(Z)?Q8.findNewAnchor(Z||"a",Q):Z}return new Sz.Alias($.anchor)}createNode($,Z,Q){let X=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),X=Z;else if(Array.isArray(Z)){let W=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,O=Z.filter(W).map(String);if(O.length>0)Z=Z.concat(O);X=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:z,anchorPrefix:J,flow:H,keepUndefined:U,onTagObj:q,tag:Y}=Q??{},{onAnchor:G,setAnchors:V,sourceObjects:B}=Q8.createNodeAnchors(this,J||"a"),_={aliasDuplicateObjects:z??!0,keepUndefined:U??!1,onAnchor:G,onTagObj:q,replacer:X,schema:this.schema,sourceObjects:B},D=fz.createNode($,Y,_);if(H&&i.isCollection(D))D.flow=!0;return V(),D}createPair($,Z,Q={}){let X=this.createNode($,null,Q),z=this.createNode(Z,null,Q);return new xz.Pair(X,z)}delete($){return a0(this.contents)?this.contents.delete($):!1}deleteIn($){if(n0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return a0(this.contents)?this.contents.deleteIn($):!1}get($,Z){return i.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(n0.isEmptyPath($))return!Z&&i.isScalar(this.contents)?this.contents.value:this.contents;return i.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return i.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(n0.isEmptyPath($))return this.contents!==void 0;return i.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=n0.collectionFromPath(this.schema,[$],Z);else if(a0(this.contents))this.contents.set($,Z)}setIn($,Z){if(n0.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=n0.collectionFromPath(this.schema,Array.from($),Z);else if(a0(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 X8.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 X8.Directives({version:$});Q={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Q=null;break;default:{let X=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(Q)this.schema=new yz.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:X,onAnchor:z,reviver:J}={}){let H={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},U=gz.toJS(this.contents,Z??"",H);if(typeof z==="function")for(let{count:q,res:Y}of H.anchors.values())z(Y,q);return typeof J==="function"?vz.applyReviver(J,{"":U},"",U):U}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 hz.stringifyDocument(this,$)}}function a0($){if(i.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}kz.Document=z8});var w2=P((pz)=>{class g1 extends Error{constructor($,Z,Q,X){super();this.name=$,this.code=Q,this.message=X,this.pos=Z}}class g9 extends g1{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class y9 extends g1{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var mz=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((U)=>Z.linePos(U));let{line:X,col:z}=Q.linePos[0];Q.message+=` at line ${X}, column ${z}`;let J=z-1,H=$.substring(Z.lineStarts[X-1],Z.lineStarts[X]).replace(/[\n\r]+$/,"");if(J>=60&&H.length>80){let U=Math.min(J-39,H.length-79);H="…"+H.substring(U),J-=U-1}if(H.length>80)H=H.substring(0,79)+"…";if(X>1&&/^ *$/.test(H.substring(0,J))){let U=$.substring(Z.lineStarts[X-2],Z.lineStarts[X-1]);if(U.length>80)U=U.substring(0,79)+`…
58
- `;H=U+H}if(/[^ ]/.test(H)){let U=1,q=Q.linePos[1];if(q?.line===X&&q.col>z)U=Math.max(1,Math.min(q.col-z,80-J));let Y=" ".repeat(J)+"^".repeat(U);Q.message+=`:
57
+ `}wV.stringifyDocument=CV});var F$=P((kV)=>{var EV=V$(),y2=L6(),H0=g(),SV=c0(),bV=m0(),gV=g1(),xV=dZ(),v1=K6(),vV=$1(),yV=G$(),y1=e8();class k1{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,H0.NODE_TYPE,{value:H0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:H}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)H=this.directives.yaml.version}else this.directives=new y1.Directives({version:H});this.setSchema(H,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(k1.prototype,{[H0.NODE_TYPE]:{value:H0.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=H0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(k2(this.contents))this.contents.add($)}addIn($,Z){if(k2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=v1.anchorNames(this);$.anchor=!Z||Q.has(Z)?v1.findNewAnchor(Z||"a",Q):Z}return new EV.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let K=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,D=Z.filter(K).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:H,flow:U,keepUndefined:J,onTagObj:V,tag:G}=Q??{},{onAnchor:Y,setAnchors:W,sourceObjects:B}=v1.createNodeAnchors(this,H||"a"),q={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:V,replacer:z,schema:this.schema,sourceObjects:B},I=yV.createNode($,G,q);if(U&&H0.isCollection(I))I.flow=!0;return W(),I}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new SV.Pair(z,X)}delete($){return k2(this.contents)?this.contents.delete($):!1}deleteIn($){if(y2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return k2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return H0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(y2.isEmptyPath($))return!Z&&H0.isScalar(this.contents)?this.contents.value:this.contents;return H0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return H0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(y2.isEmptyPath($))return this.contents!==void 0;return H0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=y2.collectionFromPath(this.schema,[$],Z);else if(k2(this.contents))this.contents.set($,Z)}setIn($,Z){if(y2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=y2.collectionFromPath(this.schema,Array.from($),Z);else if(k2(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 y1.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 y1.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 gV.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:H}={}){let U={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},J=bV.toJS(this.contents,Z??"",U);if(typeof X==="function")for(let{count:V,res:G}of U.anchors.values())X(G,V);return typeof H==="function"?vV.applyReviver(H,{"":J},"",J):J}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return xV.stringifyDocument(this,$)}}function k2($){if(H0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}kV.Document=k1});var N$=P((uV)=>{class c6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class iZ extends c6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class nZ extends c6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var fV=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((J)=>Z.linePos(J));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let H=X-1,U=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(H>=60&&U.length>80){let J=Math.min(H-39,U.length-79);U="…"+U.substring(J),H-=J-1}if(U.length>80)U=U.substring(0,79)+"…";if(z>1&&/^ *$/.test(U.substring(0,H))){let J=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(J.length>80)J=J.substring(0,79)+`…
58
+ `;U=J+U}if(/[^ ]/.test(U)){let J=1,V=Q.linePos[1];if(V?.line===z&&V.col>X)J=Math.max(1,Math.min(V.col-X,80-H));let G=" ".repeat(H)+"^".repeat(J);Q.message+=`:
59
59
 
60
- ${H}
61
- ${Y}
62
- `}};pz.YAMLError=g1;pz.YAMLParseError=g9;pz.YAMLWarning=y9;pz.prettifyError=mz});var C2=P((nz)=>{function rz($,{flow:Z,indicator:Q,next:X,offset:z,onError:J,parentIndent:H,startOnNewline:U}){let q=!1,Y=U,G=U,V="",B="",_=!1,D=!1,W=null,O=null,I=null,N=null,F=null,A=null,w=null;for(let L of $){if(D){if(L.type!=="space"&&L.type!=="newline"&&L.type!=="comma")J(L.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");D=!1}if(W){if(Y&&L.type!=="comment"&&L.type!=="newline")J(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");W=null}switch(L.type){case"space":if(!Z&&(Q!=="doc-start"||X?.type!=="flow-collection")&&L.source.includes("\t"))W=L;G=!0;break;case"comment":{if(!G)J(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let S=L.source.substring(1)||" ";if(!V)V=S;else V+=B+S;B="",Y=!1;break}case"newline":if(Y){if(V)V+=L.source;else if(!A||Q!=="seq-item-ind")q=!0}else B+=L.source;if(Y=!0,_=!0,O||I)N=L;G=!0;break;case"anchor":if(O)J(L,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(L.source.endsWith(":"))J(L.offset+L.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);O=L,w??(w=L.offset),Y=!1,G=!1,D=!0;break;case"tag":{if(I)J(L,"MULTIPLE_TAGS","A node can have at most one tag");I=L,w??(w=L.offset),Y=!1,G=!1,D=!0;break}case Q:if(O||I)J(L,"BAD_PROP_ORDER",`Anchors and tags must be after the ${L.source} indicator`);if(A)J(L,"UNEXPECTED_TOKEN",`Unexpected ${L.source} in ${Z??"collection"}`);A=L,Y=Q==="seq-item-ind"||Q==="explicit-key-ind",G=!1;break;case"comma":if(Z){if(F)J(L,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);F=L,Y=!1,G=!1;break}default:J(L,"UNEXPECTED_TOKEN",`Unexpected ${L.type} token`),Y=!1,G=!1}}let T=$[$.length-1],C=T?T.offset+T.source.length:z;if(D&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))J(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(W&&(Y&&W.indent<=H||X?.type==="block-map"||X?.type==="block-seq"))J(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:F,found:A,spaceBefore:q,comment:V,hasNewline:_,anchor:O,tag:I,newlineAfterProp:N,end:C,start:w??C}}nz.resolveProps=rz});var y1=P((sz)=>{function J8($){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(J8(Z.key)||J8(Z.value))return!0}return!1;default:return!0}}sz.containsNewline=J8});var H8=P(($J)=>{var tz=y1();function ez($,Z,Q){if(Z?.type==="flow-collection"){let X=Z.end[0];if(X.indent===$&&(X.source==="]"||X.source==="}")&&tz.containsNewline(Z))Q(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}$J.flowIndentCheck=ez});var U8=P((XJ)=>{var h9=j();function QJ($,Z,Q){let{uniqueKeys:X}=$.options;if(X===!1)return!1;let z=typeof X==="function"?X:(J,H)=>J===H||h9.isScalar(J)&&h9.isScalar(H)&&J.value===H.value;return Z.some((J)=>z(J.key,Q))}XJ.mapIncludes=QJ});var m9=P((YJ)=>{var v9=I0(),JJ=L0(),f9=C2(),HJ=y1(),k9=H8(),UJ=U8(),u9="All mapping items must start at the same column";function qJ({composeNode:$,composeEmptyNode:Z},Q,X,z,J){let U=new(J?.nodeClass??JJ.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let q=X.offset,Y=null;for(let G of X.items){let{start:V,key:B,sep:_,value:D}=G,W=f9.resolveProps(V,{indicator:"explicit-key-ind",next:B??_?.[0],offset:q,onError:z,parentIndent:X.indent,startOnNewline:!0}),O=!W.found;if(O){if(B){if(B.type==="block-seq")z(q,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==X.indent)z(q,"BAD_INDENT",u9)}if(!W.anchor&&!W.tag&&!_){if(Y=W.end,W.comment)if(U.comment)U.comment+=`
64
- `+W.comment;else U.comment=W.comment;continue}if(W.newlineAfterProp||HJ.containsNewline(B))z(B??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(W.found?.indent!==X.indent)z(q,"BAD_INDENT",u9);Q.atKey=!0;let I=W.end,N=B?$(Q,B,W,z):Z(Q,I,V,null,W,z);if(Q.schema.compat)k9.flowIndentCheck(X.indent,B,z);if(Q.atKey=!1,UJ.mapIncludes(Q,U.items,N))z(I,"DUPLICATE_KEY","Map keys must be unique");let F=f9.resolveProps(_??[],{indicator:"map-value-ind",next:D,offset:N.range[2],onError:z,parentIndent:X.indent,startOnNewline:!B||B.type==="block-scalar"});if(q=F.end,F.found){if(O){if(D?.type==="block-map"&&!F.hasNewline)z(q,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&W.start<F.found.offset-1024)z(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let A=D?$(Q,D,F,z):Z(Q,q,_,null,F,z);if(Q.schema.compat)k9.flowIndentCheck(X.indent,D,z);q=A.range[2];let w=new v9.Pair(N,A);if(Q.options.keepSourceTokens)w.srcToken=G;U.items.push(w)}else{if(O)z(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(F.comment)if(N.comment)N.comment+=`
65
- `+F.comment;else N.comment=F.comment;let A=new v9.Pair(N);if(Q.options.keepSourceTokens)A.srcToken=G;U.items.push(A)}}if(Y&&Y<q)z(Y,"IMPOSSIBLE","Map comment with trailing content");return U.range=[X.offset,q,Y??q],U}YJ.resolveBlockMap=qJ});var p9=P((OJ)=>{var VJ=R0(),BJ=C2(),WJ=H8();function _J({composeNode:$,composeEmptyNode:Z},Q,X,z,J){let U=new(J?.nodeClass??VJ.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let q=X.offset,Y=null;for(let{start:G,value:V}of X.items){let B=BJ.resolveProps(G,{indicator:"seq-item-ind",next:V,offset:q,onError:z,parentIndent:X.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||V)if(V?.type==="block-seq")z(B.end,"BAD_INDENT","All sequence items must start at the same column");else z(q,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=B.end,B.comment)U.comment=B.comment;continue}let _=V?$(Q,V,B,z):Z(Q,B.end,G,null,B,z);if(Q.schema.compat)WJ.flowIndentCheck(X.indent,V,z);q=_.range[2],U.items.push(_)}return U.range=[X.offset,q,Y??q],U}OJ.resolveBlockSeq=_J});var s0=P((KJ)=>{function IJ($,Z,Q,X){let z="";if($){let J=!1,H="";for(let U of $){let{source:q,type:Y}=U;switch(Y){case"space":J=!0;break;case"comment":{if(Q&&!J)X(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=q.substring(1)||" ";if(!z)z=G;else z+=H+G;H="";break}case"newline":if(z)H+=q;J=!0;break;default:X(U,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}Z+=q.length}}return{comment:z,offset:Z}}KJ.resolveEnd=IJ});var c9=P((wJ)=>{var RJ=j(),MJ=I0(),l9=L0(),FJ=R0(),NJ=s0(),d9=C2(),PJ=y1(),AJ=U8(),q8="Block collections are not allowed within flow collections",Y8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function TJ({composeNode:$,composeEmptyNode:Z},Q,X,z,J){let H=X.start.source==="{",U=H?"flow map":"flow sequence",Y=new(J?.nodeClass??(H?l9.YAMLMap:FJ.YAMLSeq))(Q.schema);Y.flow=!0;let G=Q.atRoot;if(G)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let V=X.offset+X.start.source.length;for(let O=0;O<X.items.length;++O){let I=X.items[O],{start:N,key:F,sep:A,value:w}=I,T=d9.resolveProps(N,{flow:U,indicator:"explicit-key-ind",next:F??A?.[0],offset:V,onError:z,parentIndent:X.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!A&&!w){if(O===0&&T.comma)z(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(O<X.items.length-1)z(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(T.comment)if(Y.comment)Y.comment+=`
66
- `+T.comment;else Y.comment=T.comment;V=T.end;continue}if(!H&&Q.options.strict&&PJ.containsNewline(F))z(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(O===0){if(T.comma)z(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`)}else{if(!T.comma)z(T.start,"MISSING_CHAR",`Missing , between ${U} items`);if(T.comment){let C="";$:for(let L of N)switch(L.type){case"comma":case"space":break;case"comment":C=L.source.substring(1);break $;default:break $}if(C){let L=Y.items[Y.items.length-1];if(RJ.isPair(L))L=L.value??L.key;if(L.comment)L.comment+=`
67
- `+C;else L.comment=C;T.comment=T.comment.substring(C.length+1)}}}if(!H&&!A&&!T.found){let C=w?$(Q,w,T,z):Z(Q,T.end,A,null,T,z);if(Y.items.push(C),V=C.range[2],Y8(w))z(C.range,"BLOCK_IN_FLOW",q8)}else{Q.atKey=!0;let C=T.end,L=F?$(Q,F,T,z):Z(Q,C,N,null,T,z);if(Y8(F))z(L.range,"BLOCK_IN_FLOW",q8);Q.atKey=!1;let S=d9.resolveProps(A??[],{flow:U,indicator:"map-value-ind",next:w,offset:L.range[2],onError:z,parentIndent:X.indent,startOnNewline:!1});if(S.found){if(!H&&!T.found&&Q.options.strict){if(A)for(let M of A){if(M===S.found)break;if(M.type==="newline"){z(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(T.start<S.found.offset-1024)z(S.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(w)if("source"in w&&w.source?.[0]===":")z(w,"MISSING_CHAR",`Missing space after : in ${U}`);else z(S.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let E=w?$(Q,w,S,z):S.found?Z(Q,S.end,A,null,S,z):null;if(E){if(Y8(w))z(E.range,"BLOCK_IN_FLOW",q8)}else if(S.comment)if(L.comment)L.comment+=`
68
- `+S.comment;else L.comment=S.comment;let m=new MJ.Pair(L,E);if(Q.options.keepSourceTokens)m.srcToken=I;if(H){let M=Y;if(AJ.mapIncludes(Q,M.items,L))z(C,"DUPLICATE_KEY","Map keys must be unique");M.items.push(m)}else{let M=new l9.YAMLMap(Q.schema);M.flow=!0,M.items.push(m);let b=(E??L).range;M.range=[L.range[0],b[1],b[2]],Y.items.push(M)}V=E?E.range[2]:S.end}}let B=H?"}":"]",[_,...D]=X.end,W=V;if(_?.source===B)W=_.offset+_.source.length;else{let O=U[0].toUpperCase()+U.substring(1),I=G?`${O} must end with a ${B}`:`${O} in block collection must be sufficiently indented and end with a ${B}`;if(z(V,G?"MISSING_CHAR":"BAD_INDENT",I),_&&_.source.length!==1)D.unshift(_)}if(D.length>0){let O=NJ.resolveEnd(D,W,Q.options.strict,z);if(O.comment)if(Y.comment)Y.comment+=`
69
- `+O.comment;else Y.comment=O.comment;Y.range=[X.offset,W,O.offset]}else Y.range=[X.offset,W,W];return Y}wJ.resolveFlowCollection=TJ});var i9=P((vJ)=>{var bJ=j(),EJ=h(),jJ=L0(),SJ=R0(),xJ=m9(),gJ=p9(),yJ=c9();function G8($,Z,Q,X,z,J){let H=Q.type==="block-map"?xJ.resolveBlockMap($,Z,Q,X,J):Q.type==="block-seq"?gJ.resolveBlockSeq($,Z,Q,X,J):yJ.resolveFlowCollection($,Z,Q,X,J),U=H.constructor;if(z==="!"||z===U.tagName)return H.tag=U.tagName,H;if(z)H.tag=z;return H}function hJ($,Z,Q,X,z){let J=X.tag,H=!J?null:Z.directives.tagName(J.source,(B)=>z(J,"TAG_RESOLVE_FAILED",B));if(Q.type==="block-seq"){let{anchor:B,newlineAfterProp:_}=X,D=B&&J?B.offset>J.offset?B:J:B??J;if(D&&(!_||_.offset<D.offset))z(D,"MISSING_CHAR","Missing newline after block sequence props")}let U=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!J||!H||H==="!"||H===jJ.YAMLMap.tagName&&U==="map"||H===SJ.YAMLSeq.tagName&&U==="seq")return G8($,Z,Q,z,H);let q=Z.schema.tags.find((B)=>B.tag===H&&B.collection===U);if(!q){let B=Z.schema.knownTags[H];if(B?.collection===U)Z.schema.tags.push(Object.assign({},B,{default:!1})),q=B;else{if(B)z(J,"BAD_COLLECTION_TYPE",`${B.tag} used for ${U} collection, but expects ${B.collection??"scalar"}`,!0);else z(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${H}`,!0);return G8($,Z,Q,z,H)}}let Y=G8($,Z,Q,z,H,q),G=q.resolve?.(Y,(B)=>z(J,"TAG_RESOLVE_FAILED",B),Z.options)??Y,V=bJ.isNode(G)?G:new EJ.Scalar(G);if(V.range=Y.range,V.tag=H,q?.format)V.format=q.format;return V}vJ.composeCollection=hJ});var B8=P((pJ)=>{var V8=h();function kJ($,Z,Q){let X=Z.offset,z=uJ(Z,$.options.strict,Q);if(!z)return{value:"",type:null,comment:"",range:[X,X,X]};let J=z.mode===">"?V8.Scalar.BLOCK_FOLDED:V8.Scalar.BLOCK_LITERAL,H=Z.source?mJ(Z.source):[],U=H.length;for(let W=H.length-1;W>=0;--W){let O=H[W][1];if(O===""||O==="\r")U=W;else break}if(U===0){let W=z.chomp==="+"&&H.length>0?`
70
- `.repeat(Math.max(1,H.length-1)):"",O=X+z.length;if(Z.source)O+=Z.source.length;return{value:W,type:J,comment:z.comment,range:[X,O,O]}}let q=Z.indent+z.indent,Y=Z.offset+z.length,G=0;for(let W=0;W<U;++W){let[O,I]=H[W];if(I===""||I==="\r"){if(z.indent===0&&O.length>q)q=O.length}else{if(O.length<q)Q(Y+O.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(z.indent===0)q=O.length;if(G=W,q===0&&!$.atRoot)Q(Y,"BAD_INDENT","Block scalar values in collections must be indented");break}Y+=O.length+I.length+1}for(let W=H.length-1;W>=U;--W)if(H[W][0].length>q)U=W+1;let V="",B="",_=!1;for(let W=0;W<G;++W)V+=H[W][0].slice(q)+`
71
- `;for(let W=G;W<U;++W){let[O,I]=H[W];Y+=O.length+I.length+1;let N=I[I.length-1]==="\r";if(N)I=I.slice(0,-1);if(I&&O.length<q){let A=`Block scalar lines must not be less indented than their ${z.indent?"explicit indentation indicator":"first line"}`;Q(Y-I.length-(N?2:1),"BAD_INDENT",A),O=""}if(J===V8.Scalar.BLOCK_LITERAL)V+=B+O.slice(q)+I,B=`
72
- `;else if(O.length>q||I[0]==="\t"){if(B===" ")B=`
73
- `;else if(!_&&B===`
60
+ ${U}
61
+ ${G}
62
+ `}};uV.YAMLError=c6;uV.YAMLParseError=iZ;uV.YAMLWarning=nZ;uV.prettifyError=fV});var P$=P((iV)=>{function dV($,{flow:Z,indicator:Q,next:z,offset:X,onError:H,parentIndent:U,startOnNewline:J}){let V=!1,G=J,Y=J,W="",B="",q=!1,I=!1,K=null,D=null,L=null,F=null,N=null,A=null,C=null;for(let _ of $){if(I){if(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma")H(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");I=!1}if(K){if(G&&_.type!=="comment"&&_.type!=="newline")H(K,"TAB_AS_INDENT","Tabs are not allowed as indentation");K=null}switch(_.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&_.source.includes("\t"))K=_;Y=!0;break;case"comment":{if(!Y)H(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=_.source.substring(1)||" ";if(!W)W=w;else W+=B+w;B="",G=!1;break}case"newline":if(G){if(W)W+=_.source;else if(!A||Q!=="seq-item-ind")V=!0}else B+=_.source;if(G=!0,q=!0,D||L)F=_;Y=!0;break;case"anchor":if(D)H(_,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(_.source.endsWith(":"))H(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=_,C??(C=_.offset),G=!1,Y=!1,I=!0;break;case"tag":{if(L)H(_,"MULTIPLE_TAGS","A node can have at most one tag");L=_,C??(C=_.offset),G=!1,Y=!1,I=!0;break}case Q:if(D||L)H(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`);if(A)H(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${Z??"collection"}`);A=_,G=Q==="seq-item-ind"||Q==="explicit-key-ind",Y=!1;break;case"comma":if(Z){if(N)H(_,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);N=_,G=!1,Y=!1;break}default:H(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),G=!1,Y=!1}}let T=$[$.length-1],E=T?T.offset+T.source.length:X;if(I&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))H(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(K&&(G&&K.indent<=U||z?.type==="block-map"||z?.type==="block-seq"))H(K,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:N,found:A,spaceBefore:V,comment:W,hasNewline:q,anchor:D,tag:L,newlineAfterProp:F,end:E,start:C??E}}iV.resolveProps=dV});var d6=P((rV)=>{function h1($){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(h1(Z.key)||h1(Z.value))return!0}return!1;default:return!0}}rV.containsNewline=h1});var f1=P((tV)=>{var oV=d6();function aV($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&oV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}tV.flowIndentCheck=aV});var u1=P((ZG)=>{var rZ=g();function $G($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(H,U)=>H===U||rZ.isScalar(H)&&rZ.isScalar(U)&&H.value===U.value;return Z.some((H)=>X(H.key,Q))}ZG.mapIncludes=$G});var eZ=P((JG)=>{var sZ=c0(),zG=i0(),oZ=P$(),XG=d6(),aZ=f1(),HG=u1(),tZ="All mapping items must start at the same column";function UG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??zG.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let V=z.offset,G=null;for(let Y of z.items){let{start:W,key:B,sep:q,value:I}=Y,K=oZ.resolveProps(W,{indicator:"explicit-key-ind",next:B??q?.[0],offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!K.found;if(D){if(B){if(B.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 B&&B.indent!==z.indent)X(V,"BAD_INDENT",tZ)}if(!K.anchor&&!K.tag&&!q){if(G=K.end,K.comment)if(J.comment)J.comment+=`
64
+ `+K.comment;else J.comment=K.comment;continue}if(K.newlineAfterProp||XG.containsNewline(B))X(B??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(K.found?.indent!==z.indent)X(V,"BAD_INDENT",tZ);Q.atKey=!0;let L=K.end,F=B?$(Q,B,K,X):Z(Q,L,W,null,K,X);if(Q.schema.compat)aZ.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,HG.mapIncludes(Q,J.items,F))X(L,"DUPLICATE_KEY","Map keys must be unique");let N=oZ.resolveProps(q??[],{indicator:"map-value-ind",next:I,offset:F.range[2],onError:X,parentIndent:z.indent,startOnNewline:!B||B.type==="block-scalar"});if(V=N.end,N.found){if(D){if(I?.type==="block-map"&&!N.hasNewline)X(V,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&K.start<N.found.offset-1024)X(F.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let A=I?$(Q,I,N,X):Z(Q,V,q,null,N,X);if(Q.schema.compat)aZ.flowIndentCheck(z.indent,I,X);V=A.range[2];let C=new sZ.Pair(F,A);if(Q.options.keepSourceTokens)C.srcToken=Y;J.items.push(C)}else{if(D)X(F.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(N.comment)if(F.comment)F.comment+=`
65
+ `+N.comment;else F.comment=N.comment;let A=new sZ.Pair(F);if(Q.options.keepSourceTokens)A.srcToken=Y;J.items.push(A)}}if(G&&G<V)X(G,"IMPOSSIBLE","Map comment with trailing content");return J.range=[z.offset,V,G??V],J}JG.resolveBlockMap=UG});var $7=P((qG)=>{var GG=n0(),YG=P$(),WG=f1();function BG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??GG.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let V=z.offset,G=null;for(let{start:Y,value:W}of z.items){let B=YG.resolveProps(Y,{indicator:"seq-item-ind",next:W,offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||W)if(W?.type==="block-seq")X(B.end,"BAD_INDENT","All sequence items must start at the same column");else X(V,"MISSING_CHAR","Sequence item without - indicator");else{if(G=B.end,B.comment)J.comment=B.comment;continue}let q=W?$(Q,W,B,X):Z(Q,B.end,Y,null,B,X);if(Q.schema.compat)WG.flowIndentCheck(z.indent,W,X);V=q.range[2],J.items.push(q)}return J.range=[z.offset,V,G??V],J}qG.resolveBlockSeq=BG});var h2=P((IG)=>{function DG($,Z,Q,z){let X="";if($){let H=!1,U="";for(let J of $){let{source:V,type:G}=J;switch(G){case"space":H=!0;break;case"comment":{if(Q&&!H)z(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=V.substring(1)||" ";if(!X)X=Y;else X+=U+Y;U="";break}case"newline":if(X)U+=V;H=!0;break;default:z(J,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=V.length}}return{comment:X,offset:Z}}IG.resolveEnd=DG});var z7=P((AG)=>{var _G=g(),OG=c0(),Z7=i0(),MG=n0(),RG=h2(),Q7=P$(),FG=d6(),NG=u1(),m1="Block collections are not allowed within flow collections",p1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function PG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let U=z.start.source==="{",J=U?"flow map":"flow sequence",G=new(H?.nodeClass??(U?Z7.YAMLMap:MG.YAMLSeq))(Q.schema);G.flow=!0;let Y=Q.atRoot;if(Y)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let W=z.offset+z.start.source.length;for(let D=0;D<z.items.length;++D){let L=z.items[D],{start:F,key:N,sep:A,value:C}=L,T=Q7.resolveProps(F,{flow:J,indicator:"explicit-key-ind",next:N??A?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!A&&!C){if(D===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(T.comment)if(G.comment)G.comment+=`
66
+ `+T.comment;else G.comment=T.comment;W=T.end;continue}if(!U&&Q.options.strict&&FG.containsNewline(N))X(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!T.comma)X(T.start,"MISSING_CHAR",`Missing , between ${J} items`);if(T.comment){let E="";$:for(let _ of F)switch(_.type){case"comma":case"space":break;case"comment":E=_.source.substring(1);break $;default:break $}if(E){let _=G.items[G.items.length-1];if(_G.isPair(_))_=_.value??_.key;if(_.comment)_.comment+=`
67
+ `+E;else _.comment=E;T.comment=T.comment.substring(E.length+1)}}}if(!U&&!A&&!T.found){let E=C?$(Q,C,T,X):Z(Q,T.end,A,null,T,X);if(G.items.push(E),W=E.range[2],p1(C))X(E.range,"BLOCK_IN_FLOW",m1)}else{Q.atKey=!0;let E=T.end,_=N?$(Q,N,T,X):Z(Q,E,F,null,T,X);if(p1(N))X(_.range,"BLOCK_IN_FLOW",m1);Q.atKey=!1;let w=Q7.resolveProps(A??[],{flow:J,indicator:"map-value-ind",next:C,offset:_.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(w.found){if(!U&&!T.found&&Q.options.strict){if(A)for(let O of A){if(O===w.found)break;if(O.type==="newline"){X(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(T.start<w.found.offset-1024)X(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(C)if("source"in C&&C.source?.[0]===":")X(C,"MISSING_CHAR",`Missing space after : in ${J}`);else X(w.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let c=C?$(Q,C,w,X):w.found?Z(Q,w.end,A,null,w,X):null;if(c){if(p1(C))X(c.range,"BLOCK_IN_FLOW",m1)}else if(w.comment)if(_.comment)_.comment+=`
68
+ `+w.comment;else _.comment=w.comment;let a=new OG.Pair(_,c);if(Q.options.keepSourceTokens)a.srcToken=L;if(U){let O=G;if(NG.mapIncludes(Q,O.items,_))X(E,"DUPLICATE_KEY","Map keys must be unique");O.items.push(a)}else{let O=new Z7.YAMLMap(Q.schema);O.flow=!0,O.items.push(a);let S=(c??_).range;O.range=[_.range[0],S[1],S[2]],G.items.push(O)}W=c?c.range[2]:w.end}}let B=U?"}":"]",[q,...I]=z.end,K=W;if(q?.source===B)K=q.offset+q.source.length;else{let D=J[0].toUpperCase()+J.substring(1),L=Y?`${D} must end with a ${B}`:`${D} in block collection must be sufficiently indented and end with a ${B}`;if(X(W,Y?"MISSING_CHAR":"BAD_INDENT",L),q&&q.source.length!==1)I.unshift(q)}if(I.length>0){let D=RG.resolveEnd(I,K,Q.options.strict,X);if(D.comment)if(G.comment)G.comment+=`
69
+ `+D.comment;else G.comment=D.comment;G.range=[z.offset,K,D.offset]}else G.range=[z.offset,K,K];return G}AG.resolveFlowCollection=PG});var X7=P((vG)=>{var CG=g(),wG=p(),jG=i0(),EG=n0(),SG=eZ(),bG=$7(),gG=z7();function l1($,Z,Q,z,X,H){let U=Q.type==="block-map"?SG.resolveBlockMap($,Z,Q,z,H):Q.type==="block-seq"?bG.resolveBlockSeq($,Z,Q,z,H):gG.resolveFlowCollection($,Z,Q,z,H),J=U.constructor;if(X==="!"||X===J.tagName)return U.tag=J.tagName,U;if(X)U.tag=X;return U}function xG($,Z,Q,z,X){let H=z.tag,U=!H?null:Z.directives.tagName(H.source,(B)=>X(H,"TAG_RESOLVE_FAILED",B));if(Q.type==="block-seq"){let{anchor:B,newlineAfterProp:q}=z,I=B&&H?B.offset>H.offset?B:H:B??H;if(I&&(!q||q.offset<I.offset))X(I,"MISSING_CHAR","Missing newline after block sequence props")}let J=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!H||!U||U==="!"||U===jG.YAMLMap.tagName&&J==="map"||U===EG.YAMLSeq.tagName&&J==="seq")return l1($,Z,Q,X,U);let V=Z.schema.tags.find((B)=>B.tag===U&&B.collection===J);if(!V){let B=Z.schema.knownTags[U];if(B?.collection===J)Z.schema.tags.push(Object.assign({},B,{default:!1})),V=B;else{if(B)X(H,"BAD_COLLECTION_TYPE",`${B.tag} used for ${J} collection, but expects ${B.collection??"scalar"}`,!0);else X(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,!0);return l1($,Z,Q,X,U)}}let G=l1($,Z,Q,X,U,V),Y=V.resolve?.(G,(B)=>X(H,"TAG_RESOLVE_FAILED",B),Z.options)??G,W=CG.isNode(Y)?Y:new wG.Scalar(Y);if(W.range=G.range,W.tag=U,V?.format)W.format=V.format;return W}vG.composeCollection=xG});var d1=P((uG)=>{var c1=p();function kG($,Z,Q){let z=Z.offset,X=hG(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let H=X.mode===">"?c1.Scalar.BLOCK_FOLDED:c1.Scalar.BLOCK_LITERAL,U=Z.source?fG(Z.source):[],J=U.length;for(let K=U.length-1;K>=0;--K){let D=U[K][1];if(D===""||D==="\r")J=K;else break}if(J===0){let K=X.chomp==="+"&&U.length>0?`
70
+ `.repeat(Math.max(1,U.length-1)):"",D=z+X.length;if(Z.source)D+=Z.source.length;return{value:K,type:H,comment:X.comment,range:[z,D,D]}}let V=Z.indent+X.indent,G=Z.offset+X.length,Y=0;for(let K=0;K<J;++K){let[D,L]=U[K];if(L===""||L==="\r"){if(X.indent===0&&D.length>V)V=D.length}else{if(D.length<V)Q(G+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(Y=K,V===0&&!$.atRoot)Q(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=D.length+L.length+1}for(let K=U.length-1;K>=J;--K)if(U[K][0].length>V)J=K+1;let W="",B="",q=!1;for(let K=0;K<Y;++K)W+=U[K][0].slice(V)+`
71
+ `;for(let K=Y;K<J;++K){let[D,L]=U[K];G+=D.length+L.length+1;let F=L[L.length-1]==="\r";if(F)L=L.slice(0,-1);if(L&&D.length<V){let A=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(G-L.length-(F?2:1),"BAD_INDENT",A),D=""}if(H===c1.Scalar.BLOCK_LITERAL)W+=B+D.slice(V)+L,B=`
72
+ `;else if(D.length>V||L[0]==="\t"){if(B===" ")B=`
73
+ `;else if(!q&&B===`
74
74
  `)B=`
75
75
 
76
- `;V+=B+O.slice(q)+I,B=`
77
- `,_=!0}else if(I==="")if(B===`
78
- `)V+=`
76
+ `;W+=B+D.slice(V)+L,B=`
77
+ `,q=!0}else if(L==="")if(B===`
78
+ `)W+=`
79
79
  `;else B=`
80
- `;else V+=B+I,B=" ",_=!1}switch(z.chomp){case"-":break;case"+":for(let W=U;W<H.length;++W)V+=`
81
- `+H[W][0].slice(q);if(V[V.length-1]!==`
82
- `)V+=`
83
- `;break;default:V+=`
84
- `}let D=X+z.length+Z.source.length;return{value:V,type:J,comment:z.comment,range:[X,D,D]}}function uJ({offset:$,props:Z},Q,X){if(Z[0].type!=="block-scalar-header")return X(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:z}=Z[0],J=z[0],H=0,U="",q=-1;for(let B=1;B<z.length;++B){let _=z[B];if(!U&&(_==="-"||_==="+"))U=_;else{let D=Number(_);if(!H&&D)H=D;else if(q===-1)q=$+B}}if(q!==-1)X(q,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${z}`);let Y=!1,G="",V=z.length;for(let B=1;B<Z.length;++B){let _=Z[B];switch(_.type){case"space":Y=!0;case"newline":V+=_.source.length;break;case"comment":if(Q&&!Y)X(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=_.source.length,G=_.source.substring(1);break;case"error":X(_,"UNEXPECTED_TOKEN",_.message),V+=_.source.length;break;default:{let D=`Unexpected token in block scalar header: ${_.type}`;X(_,"UNEXPECTED_TOKEN",D);let W=_.source;if(W&&typeof W==="string")V+=W.length}}}return{mode:J,indent:H,chomp:U,comment:G,length:V}}function mJ($){let Z=$.split(/\n( *)/),Q=Z[0],X=Q.match(/^( *)/),J=[X?.[1]?[X[1],Q.slice(X[1].length)]:["",Q]];for(let H=1;H<Z.length;H+=2)J.push([Z[H],Z[H+1]]);return J}pJ.resolveBlockScalar=kJ});var _8=P((tJ)=>{var W8=h(),dJ=s0();function cJ($,Z,Q){let{offset:X,type:z,source:J,end:H}=$,U,q,Y=(B,_,D)=>Q(X+B,_,D);switch(z){case"scalar":U=W8.Scalar.PLAIN,q=iJ(J,Y);break;case"single-quoted-scalar":U=W8.Scalar.QUOTE_SINGLE,q=rJ(J,Y);break;case"double-quoted-scalar":U=W8.Scalar.QUOTE_DOUBLE,q=nJ(J,Y);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${z}`),{value:"",type:null,comment:"",range:[X,X+J.length,X+J.length]}}let G=X+J.length,V=dJ.resolveEnd(H,G,Z,Q);return{value:q,type:U,comment:V.comment,range:[X,G,V.offset]}}function iJ($,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 r9($)}function rJ($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return r9($.slice(1,-1)).replace(/''/g,"'")}function r9($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
80
+ `;else W+=B+L,B=" ",q=!1}switch(X.chomp){case"-":break;case"+":for(let K=J;K<U.length;++K)W+=`
81
+ `+U[K][0].slice(V);if(W[W.length-1]!==`
82
+ `)W+=`
83
+ `;break;default:W+=`
84
+ `}let I=z+X.length+Z.source.length;return{value:W,type:H,comment:X.comment,range:[z,I,I]}}function hG({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],H=X[0],U=0,J="",V=-1;for(let B=1;B<X.length;++B){let q=X[B];if(!J&&(q==="-"||q==="+"))J=q;else{let I=Number(q);if(!U&&I)U=I;else if(V===-1)V=$+B}}if(V!==-1)z(V,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let G=!1,Y="",W=X.length;for(let B=1;B<Z.length;++B){let q=Z[B];switch(q.type){case"space":G=!0;case"newline":W+=q.source.length;break;case"comment":if(Q&&!G)z(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=q.source.length,Y=q.source.substring(1);break;case"error":z(q,"UNEXPECTED_TOKEN",q.message),W+=q.source.length;break;default:{let I=`Unexpected token in block scalar header: ${q.type}`;z(q,"UNEXPECTED_TOKEN",I);let K=q.source;if(K&&typeof K==="string")W+=K.length}}}return{mode:H,indent:U,chomp:J,comment:Y,length:W}}function fG($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),H=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let U=1;U<Z.length;U+=2)H.push([Z[U],Z[U+1]]);return H}uG.resolveBlockScalar=kG});var n1=P((oG)=>{var i1=p(),pG=h2();function lG($,Z,Q){let{offset:z,type:X,source:H,end:U}=$,J,V,G=(B,q,I)=>Q(z+B,q,I);switch(X){case"scalar":J=i1.Scalar.PLAIN,V=cG(H,G);break;case"single-quoted-scalar":J=i1.Scalar.QUOTE_SINGLE,V=dG(H,G);break;case"double-quoted-scalar":J=i1.Scalar.QUOTE_DOUBLE,V=iG(H,G);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+H.length,z+H.length]}}let Y=z+H.length,W=pG.resolveEnd(U,Y,Z,Q);return{value:V,type:J,comment:W.comment,range:[z,Y,W.offset]}}function cG($,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 H7($)}function dG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return H7($.slice(1,-1)).replace(/''/g,"'")}function H7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
85
  `,"sy"),Q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
- `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=Z.exec($);if(!X)return $;let z=X[1],J=" ",H=Z.lastIndex;Q.lastIndex=H;while(X=Q.exec($)){if(X[1]==="")if(J===`
87
- `)z+=J;else J=`
88
- `;else z+=J+X[1],J=" ";H=Q.lastIndex}let U=/[ \t]*(.*)/sy;return U.lastIndex=H,X=U.exec($),z+J+(X?.[1]??"")}function nJ($,Z){let Q="";for(let X=1;X<$.length-1;++X){let z=$[X];if(z==="\r"&&$[X+1]===`
89
- `)continue;if(z===`
90
- `){let{fold:J,offset:H}=aJ($,X);Q+=J,X=H}else if(z==="\\"){let J=$[++X],H=sJ[J];if(H)Q+=H;else if(J===`
91
- `){J=$[X+1];while(J===" "||J==="\t")J=$[++X+1]}else if(J==="\r"&&$[X+1]===`
92
- `){J=$[++X+1];while(J===" "||J==="\t")J=$[++X+1]}else if(J==="x"||J==="u"||J==="U"){let U=J==="x"?2:J==="u"?4:8;Q+=oJ($,X+1,U,Z),X+=U}else{let U=$.substr(X-1,2);Z(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),Q+=U}}else if(z===" "||z==="\t"){let J=X,H=$[X+1];while(H===" "||H==="\t")H=$[++X+1];if(H!==`
93
- `&&!(H==="\r"&&$[X+2]===`
94
- `))Q+=X>J?$.slice(J,X+1):z}else Q+=z}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return Q}function aJ($,Z){let Q="",X=$[Z+1];while(X===" "||X==="\t"||X===`
95
- `||X==="\r"){if(X==="\r"&&$[Z+2]!==`
96
- `)break;if(X===`
86
+ `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],H=" ",U=Z.lastIndex;Q.lastIndex=U;while(z=Q.exec($)){if(z[1]==="")if(H===`
87
+ `)X+=H;else H=`
88
+ `;else X+=H+z[1],H=" ";U=Q.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=U,z=J.exec($),X+H+(z?.[1]??"")}function iG($,Z){let Q="";for(let z=1;z<$.length-1;++z){let X=$[z];if(X==="\r"&&$[z+1]===`
89
+ `)continue;if(X===`
90
+ `){let{fold:H,offset:U}=nG($,z);Q+=H,z=U}else if(X==="\\"){let H=$[++z],U=rG[H];if(U)Q+=U;else if(H===`
91
+ `){H=$[z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="\r"&&$[z+1]===`
92
+ `){H=$[++z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="x"||H==="u"||H==="U"){let J=H==="x"?2:H==="u"?4:8;Q+=sG($,z+1,J,Z),z+=J}else{let J=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),Q+=J}}else if(X===" "||X==="\t"){let H=z,U=$[z+1];while(U===" "||U==="\t")U=$[++z+1];if(U!==`
93
+ `&&!(U==="\r"&&$[z+2]===`
94
+ `))Q+=z>H?$.slice(H,z+1):X}else Q+=X}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return Q}function nG($,Z){let Q="",z=$[Z+1];while(z===" "||z==="\t"||z===`
95
+ `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
96
+ `)break;if(z===`
97
97
  `)Q+=`
98
- `;Z+=1,X=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var sJ={"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 oJ($,Z,Q,X){let z=$.substr(Z,Q),H=z.length===Q&&/^[0-9a-fA-F]+$/.test(z)?parseInt(z,16):NaN;try{return String.fromCodePoint(H)}catch{let U=$.substr(Z-2,Q+2);return X(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),U}}tJ.resolveFlowScalar=cJ});var a9=P((JH)=>{var S0=j(),n9=h(),$H=B8(),ZH=_8();function QH($,Z,Q,X){let{value:z,type:J,comment:H,range:U}=Z.type==="block-scalar"?$H.resolveBlockScalar($,Z,X):ZH.resolveFlowScalar(Z,$.options.strict,X),q=Q?$.directives.tagName(Q.source,(V)=>X(Q,"TAG_RESOLVE_FAILED",V)):null,Y;if($.options.stringKeys&&$.atKey)Y=$.schema[S0.SCALAR];else if(q)Y=XH($.schema,z,q,Q,X);else if(Z.type==="scalar")Y=zH($,z,Z,X);else Y=$.schema[S0.SCALAR];let G;try{let V=Y.resolve(z,(B)=>X(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);G=S0.isScalar(V)?V:new n9.Scalar(V)}catch(V){let B=V instanceof Error?V.message:String(V);X(Q??Z,"TAG_RESOLVE_FAILED",B),G=new n9.Scalar(z)}if(G.range=U,G.source=z,J)G.type=J;if(q)G.tag=q;if(Y.format)G.format=Y.format;if(H)G.comment=H;return G}function XH($,Z,Q,X,z){if(Q==="!")return $[S0.SCALAR];let J=[];for(let U of $.tags)if(!U.collection&&U.tag===Q)if(U.default&&U.test)J.push(U);else return U;for(let U of J)if(U.test?.test(Z))return U;let H=$.knownTags[Q];if(H&&!H.collection)return $.tags.push(Object.assign({},H,{default:!1,test:void 0})),H;return z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[S0.SCALAR]}function zH({atKey:$,directives:Z,schema:Q},X,z,J){let H=Q.tags.find((U)=>(U.default===!0||$&&U.default==="key")&&U.test?.test(X))||Q[S0.SCALAR];if(Q.compat){let U=Q.compat.find((q)=>q.default&&q.test?.test(X))??Q[S0.SCALAR];if(H.tag!==U.tag){let q=Z.tagString(H.tag),Y=Z.tagString(U.tag),G=`Value may be parsed as either ${q} or ${Y}`;J(z,"TAG_RESOLVE_FAILED",G,!0)}}return H}JH.composeScalar=QH});var s9=P((qH)=>{function UH($,Z,Q){if(Z){Q??(Q=Z.length);for(let X=Q-1;X>=0;--X){let z=Z[X];switch(z.type){case"space":case"comment":case"newline":$-=z.source.length;continue}z=Z[++X];while(z?.type==="space")$+=z.source.length,z=Z[++X];break}}return $}qH.emptyScalarPosition=UH});var e9=P((IH)=>{var GH=B2(),VH=j(),BH=i9(),o9=a9(),WH=s0(),_H=s9(),OH={composeNode:t9,composeEmptyNode:O8};function t9($,Z,Q,X){let z=$.atKey,{spaceBefore:J,comment:H,anchor:U,tag:q}=Q,Y,G=!0;switch(Z.type){case"alias":if(Y=DH($,Z,X),U||q)X(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=o9.composeScalar($,Z,q,X),U)Y.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(Y=BH.composeCollection(OH,$,Z,Q,X),U)Y.anchor=U.source.substring(1)}catch(V){let B=V instanceof Error?V.message:String(V);X(Z,"RESOURCE_EXHAUSTION",B)}break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;X(Z,"UNEXPECTED_TOKEN",V),G=!1}}if(Y??(Y=O8($,Z.offset,void 0,null,Q,X)),U&&Y.anchor==="")X(U,"BAD_ALIAS","Anchor cannot be an empty string");if(z&&$.options.stringKeys&&(!VH.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))X(q??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(J)Y.spaceBefore=!0;if(H)if(Z.type==="scalar"&&Z.source==="")Y.comment=H;else Y.commentBefore=H;if($.options.keepSourceTokens&&G)Y.srcToken=Z;return Y}function O8($,Z,Q,X,{spaceBefore:z,comment:J,anchor:H,tag:U,end:q},Y){let G={type:"scalar",offset:_H.emptyScalarPosition(Z,Q,X),indent:-1,source:""},V=o9.composeScalar($,G,U,Y);if(H){if(V.anchor=H.source.substring(1),V.anchor==="")Y(H,"BAD_ALIAS","Anchor cannot be an empty string")}if(z)V.spaceBefore=!0;if(J)V.comment=J,V.range[2]=q;return V}function DH({options:$},{offset:Z,source:Q,end:X},z){let J=new GH.Alias(Q.substring(1));if(J.source==="")z(Z,"BAD_ALIAS","Alias cannot be an empty string");if(J.source.endsWith(":"))z(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let H=Z+Q.length,U=WH.resolveEnd(X,H,$.strict,z);if(J.range=[Z,H,U.offset],U.comment)J.comment=U.comment;return J}IH.composeEmptyNode=O8;IH.composeNode=t9});var ZZ=P((PH)=>{var RH=T2(),$Z=e9(),MH=s0(),FH=C2();function NH($,Z,{offset:Q,start:X,value:z,end:J},H){let U=Object.assign({_directives:Z},$),q=new RH.Document(void 0,U),Y={atKey:!1,atRoot:!0,directives:q.directives,options:q.options,schema:q.schema},G=FH.resolveProps(X,{indicator:"doc-start",next:z??J?.[0],offset:Q,onError:H,parentIndent:0,startOnNewline:!0});if(G.found){if(q.directives.docStart=!0,z&&(z.type==="block-map"||z.type==="block-seq")&&!G.hasNewline)H(G.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}q.contents=z?$Z.composeNode(Y,z,G,H):$Z.composeEmptyNode(Y,G.end,X,null,G,H);let V=q.contents.range[2],B=MH.resolveEnd(J,V,!1,H);if(B.comment)q.comment=B.comment;return q.range=[Q,V,B.offset],q}PH.composeDoc=NH});var D8=P((jH)=>{var TH=H2("process"),wH=R$(),CH=T2(),b2=w2(),QZ=j(),bH=ZZ(),EH=s0();function E2($){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 XZ($){let Z="",Q=!1,X=!1;for(let z=0;z<$.length;++z){let J=$[z];switch(J[0]){case"#":Z+=(Z===""?"":X?`
98
+ `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var rG={"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 sG($,Z,Q,z){let X=$.substr(Z,Q),U=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(U)}catch{let J=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}}oG.resolveFlowScalar=lG});var J7=P((zY)=>{var J2=g(),U7=p(),tG=d1(),eG=n1();function $Y($,Z,Q,z){let{value:X,type:H,comment:U,range:J}=Z.type==="block-scalar"?tG.resolveBlockScalar($,Z,z):eG.resolveFlowScalar(Z,$.options.strict,z),V=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[J2.SCALAR];else if(V)G=ZY($.schema,X,V,Q,z);else if(Z.type==="scalar")G=QY($,X,Z,z);else G=$.schema[J2.SCALAR];let Y;try{let W=G.resolve(X,(B)=>z(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);Y=J2.isScalar(W)?W:new U7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new U7.Scalar(X)}if(Y.range=J,Y.source=X,H)Y.type=H;if(V)Y.tag=V;if(G.format)Y.format=G.format;if(U)Y.comment=U;return Y}function ZY($,Z,Q,z,X){if(Q==="!")return $[J2.SCALAR];let H=[];for(let J of $.tags)if(!J.collection&&J.tag===Q)if(J.default&&J.test)H.push(J);else return J;for(let J of H)if(J.test?.test(Z))return J;let U=$.knownTags[Q];if(U&&!U.collection)return $.tags.push(Object.assign({},U,{default:!1,test:void 0})),U;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[J2.SCALAR]}function QY({atKey:$,directives:Z,schema:Q},z,X,H){let U=Q.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(z))||Q[J2.SCALAR];if(Q.compat){let J=Q.compat.find((V)=>V.default&&V.test?.test(z))??Q[J2.SCALAR];if(U.tag!==J.tag){let V=Z.tagString(U.tag),G=Z.tagString(J.tag),Y=`Value may be parsed as either ${V} or ${G}`;H(X,"TAG_RESOLVE_FAILED",Y,!0)}}return U}zY.composeScalar=$Y});var V7=P((UY)=>{function HY($,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 $}UY.emptyScalarPosition=HY});var W7=P((DY)=>{var VY=V$(),GY=g(),YY=X7(),G7=J7(),WY=h2(),BY=V7(),qY={composeNode:Y7,composeEmptyNode:r1};function Y7($,Z,Q,z){let X=$.atKey,{spaceBefore:H,comment:U,anchor:J,tag:V}=Q,G,Y=!0;switch(Z.type){case"alias":if(G=KY($,Z,z),J||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(G=G7.composeScalar($,Z,V,z),J)G.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=YY.composeCollection(qY,$,Z,Q,z),J)G.anchor=J.source.substring(1)}catch(W){let B=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",B)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),Y=!1}}if(G??(G=r1($,Z.offset,void 0,null,Q,z)),J&&G.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!GY.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))z(V??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(H)G.spaceBefore=!0;if(U)if(Z.type==="scalar"&&Z.source==="")G.comment=U;else G.commentBefore=U;if($.options.keepSourceTokens&&Y)G.srcToken=Z;return G}function r1($,Z,Q,z,{spaceBefore:X,comment:H,anchor:U,tag:J,end:V},G){let Y={type:"scalar",offset:BY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=G7.composeScalar($,Y,J,G);if(U){if(W.anchor=U.source.substring(1),W.anchor==="")G(U,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(H)W.comment=H,W.range[2]=V;return W}function KY({options:$},{offset:Z,source:Q,end:z},X){let H=new VY.Alias(Q.substring(1));if(H.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let U=Z+Q.length,J=WY.resolveEnd(z,U,$.strict,X);if(H.range=[Z,U,J.offset],J.comment)H.comment=J.comment;return H}DY.composeEmptyNode=r1;DY.composeNode=Y7});var q7=P((FY)=>{var _Y=F$(),B7=W7(),OY=h2(),MY=P$();function RY($,Z,{offset:Q,start:z,value:X,end:H},U){let J=Object.assign({_directives:Z},$),V=new _Y.Document(void 0,J),G={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},Y=MY.resolveProps(z,{indicator:"doc-start",next:X??H?.[0],offset:Q,onError:U,parentIndent:0,startOnNewline:!0});if(Y.found){if(V.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!Y.hasNewline)U(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}V.contents=X?B7.composeNode(G,X,Y,U):B7.composeEmptyNode(G,Y.end,z,null,Y,U);let W=V.contents.range[2],B=OY.resolveEnd(H,W,!1,U);if(B.comment)V.comment=B.comment;return V.range=[Q,W,B.offset],V}FY.composeDoc=RY});var s1=P((jY)=>{var PY=Z$("process"),AY=e8(),TY=F$(),A$=N$(),K7=g(),CY=q7(),wY=h2();function T$($){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 D7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let H=$[X];switch(H[0]){case"#":Z+=(Z===""?"":z?`
100
100
 
101
101
  `:`
102
- `)+(J.substring(1)||" "),Q=!0,X=!1;break;case"%":if($[z+1]?.[0]!=="#")z+=1;Q=!1;break;default:if(!Q)X=!0;Q=!1}}return{comment:Z,afterEmptyLine:X}}class zZ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,X,z)=>{let J=E2(Z);if(z)this.warnings.push(new b2.YAMLWarning(J,Q,X));else this.errors.push(new b2.YAMLParseError(J,Q,X))},this.directives=new wH.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:X}=XZ(this.prelude);if(Q){let z=$.contents;if(Z)$.comment=$.comment?`${$.comment}
103
- ${Q}`:Q;else if(X||$.directives.docStart||!z)$.commentBefore=Q;else if(QZ.isCollection(z)&&!z.flow&&z.items.length>0){let J=z.items[0];if(QZ.isPair(J))J=J.key;let H=J.commentBefore;J.commentBefore=H?`${Q}
104
- ${H}`:Q}else{let J=z.commentBefore;z.commentBefore=J?`${Q}
105
- ${J}`:Q}}if(Z){for(let z=0;z<this.errors.length;++z)$.errors.push(this.errors[z]);for(let z=0;z<this.warnings.length;++z)$.warnings.push(this.warnings[z])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:XZ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,Q=-1){for(let X of $)yield*this.next(X);yield*this.end(Z,Q)}*next($){if(TH.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,X)=>{let z=E2($);z[0]+=Z,this.onError(z,"BAD_DIRECTIVE",Q,X)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=bH.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 b2.YAMLParseError(E2($),"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 b2.YAMLParseError(E2($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=EH.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 b2.YAMLParseError(E2($),"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),X=new CH.Document(void 0,Q);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,Z,Z],this.decorate(X,!1),yield X}}}jH.Composer=zZ});var UZ=P((uH)=>{var xH=B8(),gH=_8(),yH=w2(),JZ=D2();function hH($,Z=!0,Q){if($){let X=(z,J,H)=>{let U=typeof z==="number"?z:Array.isArray(z)?z[0]:z.offset;if(Q)Q(U,J,H);else throw new yH.YAMLParseError([U,U+1],J,H)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gH.resolveFlowScalar($,Z,X);case"block-scalar":return xH.resolveBlockScalar({options:{strict:Z}},$,X)}}return null}function vH($,Z){let{implicitKey:Q=!1,indent:X,inFlow:z=!1,offset:J=-1,type:H="PLAIN"}=Z,U=JZ.stringifyString({type:H,value:$},{implicitKey:Q,indent:X>0?" ".repeat(X):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}}),q=Z.end??[{type:"newline",offset:-1,indent:X,source:`
107
- `}];switch(U[0]){case"|":case">":{let Y=U.indexOf(`
108
- `),G=U.substring(0,Y),V=U.substring(Y+1)+`
109
- `,B=[{type:"block-scalar-header",offset:J,indent:X,source:G}];if(!HZ(B,q))B.push({type:"newline",offset:-1,indent:X,source:`
110
- `});return{type:"block-scalar",offset:J,indent:X,props:B,source:V}}case'"':return{type:"double-quoted-scalar",offset:J,indent:X,source:U,end:q};case"'":return{type:"single-quoted-scalar",offset:J,indent:X,source:U,end:q};default:return{type:"scalar",offset:J,indent:X,source:U,end:q}}}function fH($,Z,Q={}){let{afterKey:X=!1,implicitKey:z=!1,inFlow:J=!1,type:H}=Q,U="indent"in $?$.indent:null;if(X&&typeof U==="number")U+=2;if(!H)switch($.type){case"single-quoted-scalar":H="QUOTE_SINGLE";break;case"double-quoted-scalar":H="QUOTE_DOUBLE";break;case"block-scalar":{let Y=$.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");H=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:H="PLAIN"}let q=JZ.stringifyString({type:H,value:Z},{implicitKey:z||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}});switch(q[0]){case"|":case">":kH($,q);break;case'"':I8($,q,"double-quoted-scalar");break;case"'":I8($,q,"single-quoted-scalar");break;default:I8($,q,"scalar")}}function kH($,Z){let Q=Z.indexOf(`
111
- `),X=Z.substring(0,Q),z=Z.substring(Q+1)+`
112
- `;if($.type==="block-scalar"){let J=$.props[0];if(J.type!=="block-scalar-header")throw Error("Invalid block scalar header");J.source=X,$.source=z}else{let{offset:J}=$,H="indent"in $?$.indent:-1,U=[{type:"block-scalar-header",offset:J,indent:H,source:X}];if(!HZ(U,"end"in $?$.end:void 0))U.push({type:"newline",offset:-1,indent:H,source:`
113
- `});for(let q of Object.keys($))if(q!=="type"&&q!=="offset")delete $[q];Object.assign($,{type:"block-scalar",indent:H,props:U,source:z})}}function HZ($,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 I8($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let X=$.props.slice(1),z=Z.length;if($.props[0].type==="block-scalar-header")z-=$.props[0].source.length;for(let J of X)J.offset+=z;delete $.props,Object.assign($,{type:Q,source:Z,end:X});break}case"block-map":case"block-seq":{let z={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
- `};delete $.items,Object.assign($,{type:Q,source:Z,end:[z]});break}default:{let X="indent"in $?$.indent:-1,z="end"in $&&Array.isArray($.end)?$.end.filter((J)=>J.type==="space"||J.type==="comment"||J.type==="newline"):[];for(let J of Object.keys($))if(J!=="type"&&J!=="offset")delete $[J];Object.assign($,{type:Q,indent:X,source:Z,end:z})}}}uH.createScalarToken=vH;uH.resolveAsScalar=hH;uH.setScalarValue=fH});var qZ=P((cH)=>{var dH=($)=>("type"in $)?v1($):h1($);function v1($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=v1(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=h1(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=h1(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=h1($);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 h1({start:$,key:Z,sep:Q,value:X}){let z="";for(let J of $)z+=J.source;if(Z)z+=v1(Z);if(Q)for(let J of Q)z+=J.source;if(X)z+=v1(X);return z}cH.stringify=dH});var VZ=P((nH)=>{var K8=Symbol("break visit"),rH=Symbol("skip children"),YZ=Symbol("remove item");function x0($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};GZ(Object.freeze([]),$,Z)}x0.BREAK=K8;x0.SKIP=rH;x0.REMOVE=YZ;x0.itemAtPath=($,Z)=>{let Q=$;for(let[X,z]of Z){let J=Q?.[X];if(J&&"items"in J)Q=J.items[z];else return}return Q};x0.parentCollection=($,Z)=>{let Q=x0.itemAtPath($,Z.slice(0,-1)),X=Z[Z.length-1][0],z=Q?.[X];if(z&&"items"in z)return z;throw Error("Parent collection not found")};function GZ($,Z,Q){let X=Q(Z,$);if(typeof X==="symbol")return X;for(let z of["key","value"]){let J=Z[z];if(J&&"items"in J){for(let H=0;H<J.items.length;++H){let U=GZ(Object.freeze($.concat([[z,H]])),J.items[H],Q);if(typeof U==="number")H=U-1;else if(U===K8)return K8;else if(U===YZ)J.items.splice(H,1),H-=1}if(typeof X==="function"&&z==="key")X=X(Z,$)}}return typeof X==="function"?X(Z,$):X}nH.visit=x0});var f1=P((QU)=>{var L8=UZ(),sH=qZ(),oH=VZ(),R8="\uFEFF",M8="\x02",F8="\x18",N8="\x1F",tH=($)=>!!$&&("items"in $),eH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function $U($){switch($){case R8:return"<BOM>";case M8:return"<DOC>";case F8:return"<FLOW_END>";case N8:return"<SCALAR>";default:return JSON.stringify($)}}function ZU($){switch($){case R8:return"byte-order-mark";case M8:return"doc-mode";case F8:return"flow-error-end";case N8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
102
+ `)+(H.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class I7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let H=T$(Z);if(X)this.warnings.push(new A$.YAMLWarning(H,Q,z));else this.errors.push(new A$.YAMLParseError(H,Q,z))},this.directives=new AY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=D7(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(K7.isCollection(X)&&!X.flow&&X.items.length>0){let H=X.items[0];if(K7.isPair(H))H=H.key;let U=H.commentBefore;H.commentBefore=U?`${Q}
104
+ ${U}`:Q}else{let H=X.commentBefore;X.commentBefore=H?`${Q}
105
+ ${H}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:D7(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(PY.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=T$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=CY.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Z=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,Q=new A$.YAMLParseError(T$($),"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 A$.YAMLParseError(T$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=wY.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 A$.YAMLParseError(T$($),"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 TY.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}}}jY.Composer=I7});var O7=P((hY)=>{var SY=d1(),bY=n1(),gY=N$(),L7=B$();function xY($,Z=!0,Q){if($){let z=(X,H,U)=>{let J=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(J,H,U);else throw new gY.YAMLParseError([J,J+1],H,U)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return bY.resolveFlowScalar($,Z,z);case"block-scalar":return SY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function vY($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:H=-1,type:U="PLAIN"}=Z,J=L7.stringifyString({type:U,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
+ `}];switch(J[0]){case"|":case">":{let G=J.indexOf(`
108
+ `),Y=J.substring(0,G),W=J.substring(G+1)+`
109
+ `,B=[{type:"block-scalar-header",offset:H,indent:z,source:Y}];if(!_7(B,V))B.push({type:"newline",offset:-1,indent:z,source:`
110
+ `});return{type:"block-scalar",offset:H,indent:z,props:B,source:W}}case'"':return{type:"double-quoted-scalar",offset:H,indent:z,source:J,end:V};case"'":return{type:"single-quoted-scalar",offset:H,indent:z,source:J,end:V};default:return{type:"scalar",offset:H,indent:z,source:J,end:V}}}function yY($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:H=!1,type:U}=Q,J="indent"in $?$.indent:null;if(z&&typeof J==="number")J+=2;if(!U)switch($.type){case"single-quoted-scalar":U="QUOTE_SINGLE";break;case"double-quoted-scalar":U="QUOTE_DOUBLE";break;case"block-scalar":{let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");U=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:U="PLAIN"}let V=L7.stringifyString({type:U,value:Z},{implicitKey:X||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(V[0]){case"|":case">":kY($,V);break;case'"':o1($,V,"double-quoted-scalar");break;case"'":o1($,V,"single-quoted-scalar");break;default:o1($,V,"scalar")}}function kY($,Z){let Q=Z.indexOf(`
111
+ `),z=Z.substring(0,Q),X=Z.substring(Q+1)+`
112
+ `;if($.type==="block-scalar"){let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=z,$.source=X}else{let{offset:H}=$,U="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:H,indent:U,source:z}];if(!_7(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:U,source:`
113
+ `});for(let V of Object.keys($))if(V!=="type"&&V!=="offset")delete $[V];Object.assign($,{type:"block-scalar",indent:U,props:J,source:X})}}function _7($,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 o1($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),X=Z.length;if($.props[0].type==="block-scalar-header")X-=$.props[0].source.length;for(let H of z)H.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
+ `};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((H)=>H.type==="space"||H.type==="comment"||H.type==="newline"):[];for(let H of Object.keys($))if(H!=="type"&&H!=="offset")delete $[H];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}hY.createScalarToken=vY;hY.resolveAsScalar=xY;hY.setScalarValue=yY});var M7=P((lY)=>{var pY=($)=>("type"in $)?n6($):i6($);function n6($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=n6(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=i6(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=i6(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=i6($);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 i6({start:$,key:Z,sep:Q,value:z}){let X="";for(let H of $)X+=H.source;if(Z)X+=n6(Z);if(Q)for(let H of Q)X+=H.source;if(z)X+=n6(z);return X}lY.stringify=pY});var N7=P((iY)=>{var a1=Symbol("break visit"),dY=Symbol("skip children"),R7=Symbol("remove item");function V2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};F7(Object.freeze([]),$,Z)}V2.BREAK=a1;V2.SKIP=dY;V2.REMOVE=R7;V2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let H=Q?.[z];if(H&&"items"in H)Q=H.items[X];else return}return Q};V2.parentCollection=($,Z)=>{let Q=V2.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],X=Q?.[z];if(X&&"items"in X)return X;throw Error("Parent collection not found")};function F7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let H=Z[X];if(H&&"items"in H){for(let U=0;U<H.items.length;++U){let J=F7(Object.freeze($.concat([[X,U]])),H.items[U],Q);if(typeof J==="number")U=J-1;else if(J===a1)return a1;else if(J===R7)H.items.splice(U,1),U-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}iY.visit=V2});var r6=P(($W)=>{var t1=O7(),rY=M7(),sY=N7(),e1="\uFEFF",$4="\x02",Z4="\x18",Q4="\x1F",oY=($)=>!!$&&("items"in $),aY=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function tY($){switch($){case e1:return"<BOM>";case $4:return"<DOC>";case Z4:return"<FLOW_END>";case Q4:return"<SCALAR>";default:return JSON.stringify($)}}function eY($){switch($){case e1:return"byte-order-mark";case $4:return"doc-mode";case Z4:return"flow-error-end";case Q4: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}QU.createScalarToken=L8.createScalarToken;QU.resolveAsScalar=L8.resolveAsScalar;QU.setScalarValue=L8.setScalarValue;QU.stringify=sH.stringify;QU.visit=oH.visit;QU.BOM=R8;QU.DOCUMENT=M8;QU.FLOW_END=F8;QU.SCALAR=N8;QU.isCollection=tH;QU.isScalar=eH;QU.prettyToken=$U;QU.tokenType=ZU});var A8=P((KU)=>{var j2=f1();function o($){switch($){case void 0:case" ":case`
117
- `:case"\r":case"\t":return!0;default:return!1}}var BZ=new Set("0123456789ABCDEFabcdef"),DU=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),k1=new Set(",[]{}"),IU=new Set(` ,[]{}
118
- \r `),P8=($)=>!$||IU.has($);class WZ{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}$W.createScalarToken=t1.createScalarToken;$W.resolveAsScalar=t1.resolveAsScalar;$W.setScalarValue=t1.setScalarValue;$W.stringify=rY.stringify;$W.visit=sY.visit;$W.BOM=e1;$W.DOCUMENT=$4;$W.FLOW_END=Z4;$W.SCALAR=Q4;$W.isCollection=oY;$W.isScalar=aY;$W.prettyToken=tY;$W.tokenType=eY});var X4=P((IW)=>{var C$=r6();function Y0($){switch($){case void 0:case" ":case`
117
+ `:case"\r":case"\t":return!0;default:return!1}}var P7=new Set("0123456789ABCDEFabcdef"),KW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),s6=new Set(",[]{}"),DW=new Set(` ,[]{}
118
+ \r `),z4=($)=>!$||DW.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===`
119
119
  `)return!0;if(Z==="\r")return this.buffer[$+1]===`
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 X=this.buffer[Q+$+1];if(X===`
121
- `||!X&&!this.atEnd)return $+Q+1}return Z===`
122
- `||Q>=this.indentNext||!Z&&!this.atEnd?$+Q:-1}if(Z==="-"||Z==="."){let Q=this.buffer.substr($,3);if((Q==="---"||Q==="...")&&o(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]===j2.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,Q=$.indexOf("#");while(Q!==-1){let z=$[Q-1];if(z===" "||z==="\t"){Z=Q-1;break}else Q=$.indexOf("#",Q+1)}while(!0){let z=$[Z-1];if(z===" "||z==="\t")Z-=1;else break}let X=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield j2.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==="...")&&o(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&&!o(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(($==="-"||$==="?"||$===":")&&o(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(P8),"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 X=this.getLine();if(X===null)return this.setNext("flow");if(Q!==-1&&Q<this.indentNext&&X[0]!=="#"||Q===0&&(X.startsWith("---")||X.startsWith("..."))&&o(X[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield j2.FLOW_END,yield*this.parseLineStart()}let z=0;while(X[z]===",")z+=yield*this.pushCount(1),z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(z+=yield*this.pushIndicators(),X[z]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-z),"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(P8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let J=this.charAt(1);if(this.flowKey||o(J)||J===",")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 z=0;while(this.buffer[Z-1-z]==="\\")z+=1;if(z%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),X=Q.indexOf(`
124
- `,this.pos);if(X!==-1){while(X!==-1){let z=this.continueScalar(X+1);if(z===-1)break;X=Q.indexOf(`
125
- `,z)}if(X!==-1)Z=X-(Q[X-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)=>o(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,Q;$:for(let z=this.pos;Q=this.buffer[z];++z)switch(Q){case" ":Z+=1;break;case`
126
- `:$=z,Z=0;break;case"\r":{let J=this.buffer[z+1];if(!J&&!this.atEnd)return this.setNext("block-scalar");if(J===`
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 z=this.continueScalar($+1);if(z===-1)break;$=this.buffer.indexOf(`
128
- `,z)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let X=$+1;Q=this.buffer[X];while(Q===" ")Q=this.buffer[++X];if(Q==="\t"){while(Q==="\t"||Q===" "||Q==="\r"||Q===`
129
- `)Q=this.buffer[++X];$=X-1}else if(!this.blockScalarKeep)do{let z=$-1,J=this.buffer[z];if(J==="\r")J=this.buffer[--z];let H=z;while(J===" ")J=this.buffer[--z];if(J===`
130
- `&&z>=this.pos&&z+1+Z>H)$=z;else break}while(!0);return yield j2.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,Q=this.pos-1,X;while(X=this.buffer[++Q])if(X===":"){let z=this.buffer[Q+1];if(o(z)||$&&k1.has(z))break;Z=Q}else if(o(X)){let z=this.buffer[Q+1];if(X==="\r")if(z===`
131
- `)Q+=1,X=`
132
- `,z=this.buffer[Q+1];else Z=Q;if(z==="#"||$&&k1.has(z))break;if(X===`
133
- `){let J=this.continueScalar(Q+1);if(J===-1)break;Q=Math.max(Q,J-2)}}else{if($&&k1.has(X))break;Z=Q}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield j2.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(P8),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(o(Q)||Z&&k1.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(!o(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(DU.has(Z))Z=this.buffer[++$];else if(Z==="%"&&BZ.has(this.buffer[$+1])&&BZ.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
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
+ `||!z&&!this.atEnd)return $+Q+1}return Z===`
122
+ `||Q>=this.indentNext||!Z&&!this.atEnd?$+Q:-1}if(Z==="-"||Z==="."){let Q=this.buffer.substr($,3);if((Q==="---"||Q==="...")&&Y0(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==="...")&&Y0(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&&!Y0(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(($==="-"||$==="?"||$===":")&&Y0(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(z4),"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("..."))&&Y0(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(z4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||Y0(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
124
+ `,this.pos);if(z!==-1){while(z!==-1){let X=this.continueScalar(z+1);if(X===-1)break;z=Q.indexOf(`
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)=>Y0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,Q;$:for(let X=this.pos;Q=this.buffer[X];++X)switch(Q){case" ":Z+=1;break;case`
126
+ `:$=X,Z=0;break;case"\r":{let H=this.buffer[X+1];if(!H&&!this.atEnd)return this.setNext("block-scalar");if(H===`
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
+ `,X)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;Q=this.buffer[z];while(Q===" ")Q=this.buffer[++z];if(Q==="\t"){while(Q==="\t"||Q===" "||Q==="\r"||Q===`
129
+ `)Q=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let X=$-1,H=this.buffer[X];if(H==="\r")H=this.buffer[--X];let U=X;while(H===" ")H=this.buffer[--X];if(H===`
130
+ `&&X>=this.pos&&X+1+Z>U)$=X;else break}while(!0);return yield 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(Y0(X)||$&&s6.has(X))break;Z=Q}else if(Y0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
131
+ `)Q+=1,z=`
132
+ `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&s6.has(X))break;if(z===`
133
+ `){let H=this.continueScalar(Q+1);if(H===-1)break;Q=Math.max(Q,H-2)}}else{if($&&s6.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(z4),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(Y0(Q)||Z&&s6.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(!Y0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(KW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&P7.has(this.buffer[$+1])&&P7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
134
134
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
135
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,Q;do Q=this.buffer[++Z];while(Q===" "||$&&Q==="\t");let X=Z-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=Z;return X}*pushUntil($){let Z=this.pos,Q=this.buffer[Z];while(!$(Q))Q=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}KU.Lexer=WZ});var T8=P((RU)=>{class _Z{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,Q=this.lineStarts.length;while(Z<Q){let z=Z+Q>>1;if(this.lineStarts[z]<$)Z=z+1;else Q=z}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let X=this.lineStarts[Z-1];return{line:Z,col:$-X+1}}}}RU.LineCounter=_Z});var w8=P((PU)=>{var FU=H2("process"),OZ=f1(),NU=A8();function M0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function DZ($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function KZ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function u1($){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 o0($){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 m1($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function IZ($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!M0(Z.start,"explicit-key-ind")&&!M0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,KZ(Z.value))if(Z.value.end)m1(Z.value.end,Z.sep);else Z.value.end=Z.sep;else m1(Z.start,Z.sep);delete Z.sep}}}class LZ{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 NU.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=$,FU.env.LOG_TOKENS)console.log("|",OZ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=OZ.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")IZ(Z);switch(Q.type){case"document":Q.value=Z;break;case"block-scalar":Q.props.push(Z);break;case"block-map":{let X=Q.items[Q.items.length-1];if(X.value){Q.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=Z;else{Object.assign(X,{key:Z,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=Q.items[Q.items.length-1];if(X.value)Q.items.push({start:[],value:Z});else X.value=Z;break}case"flow-collection":{let X=Q.items[Q.items.length-1];if(!X||X.value)Q.items.push({start:[],key:Z,sep:[]});else if(X.sep)X.value=Z;else Object.assign(X,{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 X=Z.items[Z.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&DZ(X.start)===-1&&(Z.indent===0||X.start.every((z)=>z.type!=="comment"||z.indent<Z.indent))){if(Q.type==="document")Q.end=X.start;else Q.items.push({start:X.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(DZ($.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=u1(this.peek(2)),Q=o0(Z),X;if($.end)X=$.end,X.push(this.sourceToken),delete $.end;else X=[this.sourceToken];let z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Q,key:$,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}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)}}IW.Lexer=A7});var H4=P((_W)=>{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}}}}_W.LineCounter=T7});var U4=P((FW)=>{var MW=Z$("process"),C7=r6(),RW=X4();function r0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function w7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function E7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o6($){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 f2($){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 a6($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function j7($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!r0(Z.start,"explicit-key-ind")&&!r0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,E7(Z.value))if(Z.value.end)a6(Z.value.end,Z.sep);else Z.value.end=Z.sep;else a6(Z.start,Z.sep);delete Z.sep}}}class S7{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new RW.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Q of this.lexer.lex($,Z))yield*this.next(Q);if(!Z)yield*this.end()}*next($){if(this.source=$,MW.env.LOG_TOKENS)console.log("|",C7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=C7.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")j7(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&&w7(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(w7($.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=o6(this.peek(2)),Q=f2(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 X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){m1(X,Z.start),X.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,X=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",z=[];if(X&&Z.sep&&!Z.value){let J=[];for(let H=0;H<Z.sep.length;++H){let U=Z.sep[H];switch(U.type){case"newline":J.push(H);break;case"space":break;case"comment":if(U.indent>$.indent)J.length=0;break;default:J.length=0}}if(J.length>=2)z=Z.sep.splice(J[1])}switch(this.type){case"anchor":case"tag":if(X||Z.value)z.push(this.sourceToken),$.items.push({start:z}),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(X||Z.value)z.push(this.sourceToken),$.items.push({start:z,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(M0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let J=o0(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(M0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(KZ(Z.key)&&!M0(Z.sep,"newline")){let J=o0(Z.start),H=Z.key,U=Z.sep;U.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:H,sep:U}]})}else if(z.length>0)Z.sep=Z.sep.concat(z,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||X)$.items.push({start:z,key:null,sep:[this.sourceToken]});else if(M0(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 J=this.flowScalar(this.type);if(X||Z.value)$.items.push({start:z,key:J,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(J);else Object.assign(Z,{key:J,sep:[]}),this.onKeyLine=!0;return}default:{let J=this.startBlockValue($);if(J){if(J.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!M0(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:z});this.stack.push(J);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 X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){m1(X,Z.start),X.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||M0(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 X=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:X,sep:[]});else if(Z.sep)this.stack.push(X);else Object.assign(Z,{key:X,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 X=u1(Q),z=o0(X);IZ($);let J=$.end.splice(1,$.end.length);J.push(this.sourceToken);let H={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
137
+ `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){a6(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let H=[];for(let U=0;U<Z.sep.length;++U){let J=Z.sep[U];switch(J.type){case"newline":H.push(U);break;case"space":break;case"comment":if(J.indent>$.indent)H.length=0;break;default:H.length=0}}if(H.length>=2)X=Z.sep.splice(H[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(r0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let H=f2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r0(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(E7(Z.key)&&!r0(Z.sep,"newline")){let H=f2(Z.start),U=Z.key,J=Z.sep;J.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:U,sep:J}]})}else if(X.length>0)Z.sep=Z.sep.concat(X,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:X,key:null,sep:[this.sourceToken]});else if(r0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:H,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(H);else Object.assign(Z,{key:H,sep:[]}),this.onKeyLine=!0;return}default:{let H=this.startBlockValue($);if(H){if(H.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!r0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(H);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){a6(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||r0(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=o6(Q),X=f2(z);j7($);let H=$.end.splice(1,$.end.length);H.push(this.sourceToken);let U={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
138
138
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
139
- `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=u1($),Q=o0(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=u1($),Q=o0(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()}}}PU.Parser=LZ});var PZ=P((xU)=>{var RZ=D8(),TU=T2(),S2=w2(),wU=T$(),CU=j(),bU=T8(),MZ=w8();function FZ($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new bU.LineCounter||null,prettyErrors:Z}}function EU($,Z={}){let{lineCounter:Q,prettyErrors:X}=FZ(Z),z=new MZ.Parser(Q?.addNewLine),J=new RZ.Composer(Z),H=Array.from(J.compose(z.parse($)));if(X&&Q)for(let U of H)U.errors.forEach(S2.prettifyError($,Q)),U.warnings.forEach(S2.prettifyError($,Q));if(H.length>0)return H;return Object.assign([],{empty:!0},J.streamInfo())}function NZ($,Z={}){let{lineCounter:Q,prettyErrors:X}=FZ(Z),z=new MZ.Parser(Q?.addNewLine),J=new RZ.Composer(Z),H=null;for(let U of J.compose(z.parse($),!0,$.length))if(!H)H=U;else if(H.options.logLevel!=="silent"){H.errors.push(new S2.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&Q)H.errors.forEach(S2.prettifyError($,Q)),H.warnings.forEach(S2.prettifyError($,Q));return H}function jU($,Z,Q){let X=void 0;if(typeof Z==="function")X=Z;else if(Q===void 0&&Z&&typeof Z==="object")Q=Z;let z=NZ($,Q);if(!z)return null;if(z.warnings.forEach((J)=>wU.warn(z.options.logLevel,J)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:X},Q))}function SU($,Z,Q){let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(Q===void 0&&Z)Q=Z;if(typeof Q==="string")Q=Q.length;if(typeof Q==="number"){let z=Math.round(Q);Q=z<1?void 0:z>8?{indent:8}:{indent:z}}if($===void 0){let{keepUndefined:z}=Q??Z??{};if(!z)return}if(CU.isDocument($)&&!X)return $.toString(Q);return new TU.Document($,X,Q).toString(Q)}xU.parse=jU;xU.parseAllDocuments=EU;xU.parseDocument=NZ;xU.stringify=SU});var f=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],A0=new Map(f.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),RW=new Map(f.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),MW=new Map(f.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function B6($,Z){let Q=(z)=>{let J=z.split("."),H=$;for(let U of J)if(H&&typeof H==="object"&&U in H)H=H[U];else return;return H},X=Q(Z.path);if(X!==void 0)return X;if(Z.canonical)return Q(Z.canonical);return}function O4($){return f.filter((Z)=>Z.category===$)}var D4=f.filter(($)=>$.index<=21),I4=f,o2=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function T0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return o2.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var k0={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],app:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};var B$=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,t2=B$("1"),U2=B$("2"),NW=B$("3"),q2={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},e2=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,W$=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,u0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var Y0=[{name:"TROPHY",indicator:`${u0("✪")} ${u0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${u0(t2("★"))} ${u0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${e2("◆")} ${e2("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${W$("◇")} ${W$("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${t2("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${U2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${U2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${U2("♡")}`,threshold:0}];function Y2($){for(let Z of Y0)if($>=Z.threshold)return Z;return Y0[Y0.length-1]}function K4($){let Z=Y2($),Q=Y0.indexOf(Z);return Q>0?Y0[Q-1]:null}var D$={};W4(D$,{validate:()=>R4,sdkVersion:()=>A4,scoreFafb:()=>P4,scoreEnterprise:()=>L4,score:()=>O$,fafbInfo:()=>N4,decompile:()=>F4,compile:()=>M4});var _$=null;function W0(){if(_$)return _$;try{let $=H2("faf-scoring-kernel");return _$=$,$}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=o6($),Q=f2(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=o6($),Q=f2(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()}}}FW.Parser=S7});var y7=P((SW)=>{var b7=s1(),PW=F$(),w$=N$(),AW=H1(),TW=g(),CW=H4(),g7=U4();function x7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new CW.LineCounter||null,prettyErrors:Z}}function wW($,Z={}){let{lineCounter:Q,prettyErrors:z}=x7(Z),X=new g7.Parser(Q?.addNewLine),H=new b7.Composer(Z),U=Array.from(H.compose(X.parse($)));if(z&&Q)for(let J of U)J.errors.forEach(w$.prettifyError($,Q)),J.warnings.forEach(w$.prettifyError($,Q));if(U.length>0)return U;return Object.assign([],{empty:!0},H.streamInfo())}function v7($,Z={}){let{lineCounter:Q,prettyErrors:z}=x7(Z),X=new g7.Parser(Q?.addNewLine),H=new b7.Composer(Z),U=null;for(let J of H.compose(X.parse($),!0,$.length))if(!U)U=J;else if(U.options.logLevel!=="silent"){U.errors.push(new w$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)U.errors.forEach(w$.prettifyError($,Q)),U.warnings.forEach(w$.prettifyError($,Q));return U}function jW($,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=v7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>AW.warn(X.options.logLevel,H)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function EW($,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(TW.isDocument($)&&!z)return $.toString(Q);return new PW.Document($,z,Q).toString(Q)}SW.parse=jW;SW.parseAllDocuments=wW;SW.parseDocument=v7;SW.stringify=EW});var f=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],w0=new Map(f.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),WM=new Map(f.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),BM=new Map(f.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function N5($,Z){let Q=(X)=>{let H=X.split("."),U=$;for(let J of H)if(U&&typeof U==="object"&&J in U)U=U[J];else return;return U},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function Yz($){return f.filter((Z)=>Z.category===$)}var Wz=f.filter(($)=>$.index<=21),Bz=f,J6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]),P5=new Set(["none","n/a","not applicable"]),V6="slotignored";function qz($){return typeof $==="string"&&P5.has($.trim().toLowerCase())}function c8($){return typeof $==="string"&&$.trim()!==""&&n($)}function n($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return J6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var A2="no classifying signals — fallback",Kz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function T2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(P2,$))return null;if(!P2[$].includes(Z.category))return!1;return!($==="framework"&&Kz.has(Z.path))}var P2={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],app:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};var d8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,Q$=d8("1"),C2=d8("2"),KM=d8("3"),z$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},X$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,i8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,w2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var j0=[{name:"TROPHY",indicator:`${w2("✪")} ${w2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${w2(Q$("★"))} ${w2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${X$("◆")} ${X$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${i8("◇")} ${i8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${Q$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${C2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${C2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${C2("♡")}`,threshold:0}];function H$($){for(let Z of j0)if($>=Z.threshold)return Z;return j0[j0.length-1]}function Dz($){let Z=H$($),Q=j0.indexOf(Z);return Q>0?j0[Q-1]:null}var s8={};Vz(s8,{validate:()=>Lz,sdkVersion:()=>Fz,scoreFafb:()=>Rz,scoreEnterprise:()=>Iz,score:()=>r8,fafbInfo:()=>Mz,decompile:()=>Oz,compile:()=>_z});var n8=null;function u0(){if(n8)return n8;try{let $=Z$("faf-scoring-kernel");return n8=$,$}catch{throw Error(`faf-scoring-kernel not installed.
140
140
 
141
141
  Run: npm install faf-scoring-kernel
142
- `)}}function O$($){return JSON.parse(W0().score_faf($))}function L4($){return JSON.parse(W0().score_faf_enterprise($))}function R4($){return W0().validate_faf($)}function M4($){return W0().compile_fafb($)}function F4($){return JSON.parse(W0().decompile_fafb($))}function N4($){return JSON.parse(W0().fafb_info($))}function P4($){return JSON.parse(W0().score_fafb($))}function A4(){return W0().sdk_version()}var W6=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function _6($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function O6($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",X=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!X)return null;let z=X[1],J=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),H=-1;if(J){let U=parseInt(J[1],10);if(U>=0&&U<=100)H=U}return{represents:z,sourceScore:H}}function D6($){return{score:$.score,tier:Y2($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function I$($){let Z=O6($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?Y2(Q):Y0[Y0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents}}return D6(O$($))}function T4($){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(!_6(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!W6.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 X=Q.about.source_score;if(typeof X!=="number"||X<0||X>100)Z.push(`about.source_score must be a number 0-100 (got: ${X})`)}}return{valid:Z.length===0,errors:Z}}import{readFileSync as CZ,writeFileSync as Mq,existsSync as TZ}from"fs";import{join as wZ,dirname as Fq,basename as $O}from"path";var fU=D8(),kU=T2(),uU=$8(),C8=w2(),mU=B2(),F0=j(),pU=I0(),lU=h(),dU=L0(),cU=R0(),s_=f1(),iU=A8(),rU=T8(),nU=w8(),p1=PZ(),AZ=G2();var aU=fU.Composer,sU=kU.Document,oU=uU.Schema,tU=C8.YAMLError,eU=C8.YAMLParseError,$q=C8.YAMLWarning,Zq=mU.Alias,Qq=F0.isAlias,Xq=F0.isCollection,zq=F0.isDocument,Jq=F0.isMap,Hq=F0.isNode,Uq=F0.isPair,qq=F0.isScalar,Yq=F0.isSeq,Gq=pU.Pair,Vq=lU.Scalar,Bq=dU.YAMLMap,Wq=cU.YAMLSeq;var _q=iU.Lexer,Oq=rU.LineCounter,Dq=nU.Parser,t=p1.parse,Iq=p1.parseAllDocuments,Kq=p1.parseDocument,x2=p1.stringify,Lq=AZ.visit,Rq=AZ.visitAsync;function Nq($){let Z=CZ($,"utf-8");return t(Z)}function bZ($){let Z=$._meta,Q={...$};delete Q._meta;let X=x2(Q,{lineWidth:0});if(Z?.found&&Z.found.length>0){let z=Z.found.join(" + ");X=X.replace(/^(\s+type:\s+\S+)(\s*)$/m,(J,H,U)=>{if(U.includes("#"))return J;return`${H} # found: ${z}`})}return X}function Pq($,Z){Mq($,bZ(Z),"utf-8")}function EZ($){return CZ($,"utf-8")}function jZ($=process.cwd()){let Z=["project.faf",".faf"];for(let X of Z){let z=wZ($,X);if(TZ(z))return z}let Q=Fq($);if(Q!==$)for(let X of Z){let z=wZ(Q,X);if(TZ(z))return z}return null}import{existsSync as Aq,statSync as SZ}from"fs";import{dirname as Tq,join as wq}from"path";var Cq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],bq=1000;function Eq($,Z=Tq($)){let Q=SZ($).mtimeMs,X=Cq.map((z)=>{let J=wq(Z,z);if(!Aq(J))return{file:z,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let H=SZ(J).mtimeMs,U=H-Q,q;if(Math.abs(U)<bq)q="in-sync";else if(U>0)q="newer";else q="older";return{file:z,exists:!0,mtime_ms:H,status:q,delta_ms:U}});return{source:$,source_mtime_ms:Q,targets:X,drifted:X.filter((z)=>z.status==="newer"||z.status==="older").length,in_sync:X.filter((z)=>z.status==="in-sync").length,missing:X.filter((z)=>z.status==="missing").length}}import{writeFileSync as jq}from"fs";import{join as Sq}from"path";import{deprecate as xq}from"node:util";var xZ=q2.orange,gq=q2.cyan,yq=q2.cyanDeep,hq="#FF9500",vq="#FF3B30",fq="#E6EDF3",kq="#6E7681",gZ={TROPHY:{glyph:"✪",color:xZ},GOLD:{glyph:"★",color:xZ},SILVER:{glyph:"◆",color:gq},BRONZE:{glyph:"◇",color:yq},GREEN:{glyph:"●",color:fq},YELLOW:{glyph:"●",color:hq},RED:{glyph:"○",color:vq},WHITE:{glyph:"♡",color:kq}};function t0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var yZ=["who","what","why","where","when","how"];function l1($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${t0(Z)}</div><div class="v">${t0(Q)}</div></div>`).join(`
143
- `)}function b8($,Z,Q="project.faf"){let X=t0($.project?.name??"Project"),z=Z.tier?.name??"WHITE",J=gZ[z]??gZ.WHITE,H=Z.inherited?Z.represents?`inherited from ${t0(Z.represents)}`:"inherited":`${Z.score}%`,U=z==="TROPHY"&&!Z.inherited,q=$.human_context??{},Y=yZ.map((W)=>[W,q[W]]),G=Object.entries(q).filter(([W])=>!yZ.includes(W)),V=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],B=Object.entries($.stack??{}),_=B.filter(([,W])=>W&&W!=="slotignored"&&String(W).trim()!==""),D=B.filter(([,W])=>W==="slotignored").length;return`<!DOCTYPE html>
142
+ `)}}var G6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function r8($){return JSON.parse(u0().score_faf(G6($)))}function Iz($){return JSON.parse(u0().score_faf_enterprise(G6($)))}function Lz($){return u0().validate_faf(G6($))}function _z($){return u0().compile_fafb(G6($))}function Oz($){return JSON.parse(u0().decompile_fafb($))}function Mz($){return JSON.parse(u0().fafb_info($))}function Rz($){return JSON.parse(u0().score_fafb($))}function Fz(){return u0().sdk_version()}var A5=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function T5($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function C5($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],H=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),U=-1;if(H){let J=parseInt(H[1],10);if(J>=0&&J<=100)U=J}return{represents:X,sourceScore:U}}function Nz($){return $.unknown?"unknown (—)":`${$.score}%`}function w5($){return{score:$.score,tier:H$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function o8($){let Z=C5($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?H$(Q):j0[j0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return w5(r8($))}function Pz($){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(!T5(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!A5.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 C9,dirname as N4,basename as XF,resolve as f$}from"path";var yW=s1(),kW=F$(),hW=g1(),J4=N$(),fW=V$(),s0=g(),uW=c0(),mW=p(),pW=i0(),lW=n0(),mR=r6(),cW=X4(),dW=H4(),iW=U4(),t6=y7(),k7=U$();var nW=yW.Composer,e6=kW.Document,rW=hW.Schema,sW=J4.YAMLError,$8=J4.YAMLParseError,oW=J4.YAMLWarning,aW=fW.Alias,b0=s0.isAlias,G2=s0.isCollection,tW=s0.isDocument,u=s0.isMap,W0=s0.isNode,eW=s0.isPair,i=s0.isScalar,g0=s0.isSeq,$B=uW.Pair,ZB=mW.Scalar,u2=pW.YAMLMap,j$=lW.YAMLSeq;var QB=cW.Lexer,zB=dW.LineCounter,XB=iW.Parser,x0=t6.parse,HB=t6.parseAllDocuments,m2=t6.parseDocument,E$=t6.stringify,UB=k7.visit,JB=k7.visitAsync;import{accessSync as h7,closeSync as Y4,constants as f7,fchmodSync as u7,fchownSync as VB,fsyncSync as m7,lstatSync as W4,mkdirSync as p7,mkdtempSync as cR,openSync as l7,readdirSync as dR,readFileSync as c7,readlinkSync as GB,realpathSync as YB,renameSync as WB,rmSync as iR,statSync as Z8,unlinkSync as d7,writeFileSync as BB}from"fs";import{randomBytes as qB}from"crypto";import{basename as a0,dirname as Y2,isAbsolute as i7,join as Q8,relative as n7,resolve as v0,sep as r7}from"path";class j 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 r=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),KB=new Set(Object.values(r).map(($)=>$.toLowerCase())),DB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),V4=($)=>KB.has($.toLowerCase());function S$($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var IB=/\.fafm?$/i,LB=/^[a-z][a-z0-9-]*$/,o0=($)=>YB.native($),t0=($)=>$?.code;function z8($,Z){let Q=n7($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${r7}`)&&!i7(Q)}function s7($){try{return GB($)}catch{return"?"}}function _B($,Z,Q,z){let X;try{X=o0(Q)}catch(H){let U=t0(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new j("dangling",Z,`${Z} is a link to ${s7(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!z8($,X))throw new j("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(S$(X)&&!(z.inGit&&Y2(X)===$))throw new j("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!Z8(X).isFile())throw new j("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return OB(Z,X,z.read),X}function OB($,Z,Q){let z=a0($),X=a0(Z),H=V4(z)&&V4(X);if(Q&&!IB.test(X)&&!H){let U=V4(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new j("not-faf",$,`${$} is a link to ${Z}, which is not ${U} — refused.`)}if(!Q&&!DB(z,X)&&!H)throw new j("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 MB($,Z,Q,z){if(a0(v0($))!=="hooks"||!LB.test(a0(Z)))throw new j("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new j("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function RB($,Z,Q){if(a0($)!=="config"||Q!==Z)throw new j("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function k($,Z,Q={}){let z=o0(v0($)),X=v0($,Z),H=o0(Y2(X));if(!z8(z,H))throw new j("outside",X,`${X} is in ${H}, outside ${z} — refused.`);let U=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(U)MB($,X,z,H);if(J)RB(X,z,H);let V=Q8(H,a0(X));if(S$(V)&&!U&&!J)throw new j("git",X,V===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${V}, inside .git/ — refused.`);let G;try{G=W4(V)}catch(Y){if(t0(Y)==="ENOENT")return V;throw Y}if(G.isSymbolicLink())return _B(z,X,V,{read:Q.read===!0,inGit:U||J});if(!G.isFile())throw new j("not-a-file",X,`${X} is not a regular file — refused.`);return o0(V)}var FB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function NB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return FB.decode($)}catch{}throw new j("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Q0($){return NB(c7($),$)}function B0($){try{return c7($)}catch(Z){if(t0(Z)==="ENOENT")return null;throw Z}}function PB($){try{let Z=Z8($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(t0(Z)==="ENOENT")return;throw Z}}class o7 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var G4=($)=>new j("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function B4($,Z,Q){if(Z!==void 0){let X=B0($),H=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||H===null?X===H:X.equals(H)))throw G4($)}if(!Q)return;let z;try{z=Z8($)}catch(X){if(t0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw G4($);try{h7($,f7.W_OK)}catch{throw G4($)}}function AB($,Z){if(process.platform!=="win32")try{VB($,Z.uid,Z.gid)}catch{}u7($,Z.mode)}function TB($){if(process.platform==="win32")return;try{let Z=l7($,"r");try{m7(Z)}finally{Y4(Z)}}catch{}}function CB($,Z,Q,z){if($.fd=l7($.path,"wx",z??Q?.mode??438),$.created=!0,BB($.fd,Z),Q)AB($.fd,Q);if(z!==void 0)u7($.fd,z);m7($.fd),Y4($.fd),$.fd=void 0}function wB($){if($.fd!==void 0)try{Y4($.fd)}catch{}if($.created)try{d7($.path)}catch{}}function jB($,Z,Q){let z=Y2($),X={path:Q8(z,`.${a0($).slice(0,100)}.${process.pid}.${qB(6).toString("hex")}.faf-tmp`),created:!1},H=PB($);try{if(H)h7($,f7.W_OK);CB(X,Z,H,Q.mode),B4($,Q.expect,H),WB(X.path,$)}catch(U){if(wB(X),U instanceof j)throw U;let J=t0(U)??(U instanceof Error?U.message:String(U));throw new o7($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}TB(z)}function EB($){return $ instanceof j&&!$.onWrite?new j($.reason,$.path,$.message,{onWrite:!0}):$}function s($,Z,Q={}){let z=v0($),X;try{X=k(Q.root??Y2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw EB(H)}return jB(X,Z,Q),X}function a7($,Z,Q){let z=v0($),X=Q.root??Y2(z),H=k(X,z),U=B0(H);if(Q.expect!==void 0)B4(H,Q.expect,void 0);if(U!==null&&Q.force!==!0&&!Q.owns(U))throw new j("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return s(H,Z,{root:X,expect:U})}function p2($,Z=$){let Q=v0($);p7(Q,{recursive:!0});let z=o0(Q),X=v0(Q,Z),H=n7(Q,X);if(H===".."||H.startsWith(`..${r7}`)||i7(H))throw new j("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let U=z;for(let J of H.split(/[\\/]/).filter(Boolean)){let V=Q8(U,J);if(S$(V))throw new j("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});U=SB(z,X,V)}return U}function SB($,Z,Q){let z;try{z=W4(Q)}catch(H){if(t0(H)!=="ENOENT")throw H;return p7(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=o0(Q)}catch{throw new j("dangling",Z,`${Q} is a link to ${s7(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!z8($,X))throw new j("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(S$(X))throw new j("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!Z8(X).isDirectory())throw new j("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function bB($,Z){let Q=v0($),z=o0(v0(Z.root??Y2(Q))),X=o0(Y2(Q));if(!z8(z,X))throw new j("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=Q8(X,a0(Q));if(S$(H))throw new j("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let U;try{U=W4(H)}catch(J){if(t0(J)==="ENOENT")return!1;throw J}if(!U.isFile())throw new j("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return B4(H,Z.expect,void 0),d7(H),!0}function y($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function b$($){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 X8($,Z){if($===null||$===void 0)return{};if(!y($))throw new j("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${b$($)}. `+"faf left it unchanged — fix it by hand.");return $}var z9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function t7($){return typeof $==="object"&&$.collection===void 0}function gB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
143
+ `)||typeof $.value!=="number")return;let z=Z.find((H)=>H.default===!0&&H.test?.test(Q));if(!z||!z9.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(i(X)?X.value:X,$.value)?Q:void 0}function xB($){let Z=$.filter(t7);return $.map((Q)=>{if(!t7(Q)||!z9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,H,U,J)=>gB(X,Z)??z(X,H,U,J)}})}var H8={keepSourceTokens:!0,customTags:xB};function vB($,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 yB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let H=vB(Z[X],Z[X+1]);Q??=H.indent,z??=H.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function L4($,Z){let Q=m2($,H8);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 W2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function g$($,Z){return $.lastIndexOf(`
145
+ `,Z-1)+1}function X9($,Z){if(Z>0&&$[Z-1]===`
146
+ `)return Z;let Q=$.indexOf(`
147
+ `,Z);return Q<0?$.length:Q+1}function e7($,Z){let Q=Z;if($[Q-1]===`
148
+ `){if(Q--,$[Q-1]==="\r")Q--}return Q}function q0($){return $!==null&&$!==void 0}function $0($){let Z=W0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function H9($,Z){let Q=$0($),z=$0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function U9($){if(i($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return G2($)&&!$.flow}function U8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function J9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&U8($,Z)}function V9($,Z,Q,z){let X=new e6(void 0,H8);X.contents=Z(X);let U=X.toString($.piece).replace(/\n+$/,"").slice(Q),J=U.startsWith(" ")&&!U.includes(`
149
+ `),V=" ".repeat(z),G=U.replace(/\n(?=.)/g,`
150
+ ${V}`).replace(/\n/g,$.eol);return{inline:J,text:J?U.slice(1):G}}function K4($,Z,Q){return V9($,(z)=>{let X=new u2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function kB($,Z,Q){let z=V9($,()=>{let X=new j$;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 hB($){if(!W0($)||!q0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function fB($,Z){if(!W0($)||!W0(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 uB($,Z){let Q=$0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function mB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function $9($,Z,Q,z,X=!1){let H=$0(Z);if(!H||z.kind==="root")return null;let U=Z.comment,J=W0(Q)?Q.comment:void 0,V=!q0(U)||U===J,G=V?hB(Q):Q,Y=X?G:fB(Z,G),W=z.kind==="value"?K4($,Y,z.col):kB($,Y,z.col);return W?{range:H,keepTail:V,newComment:J,piece:W}:null}function pB($,Z,Q,z){if(!z)return e7($,X9($,Q[2]));return U9(Z)?e7($,Q[1]):Q[1]}function x$($,Z,Q,z,X){let H=$9($,Z,Q,z);if(!H)return!1;let U=pB($.src,Z,H.range,H.keepTail);if(H.piece.inline&&(!U9(Z)||z.kind==="item"))return lB($,H,U,z,X),!0;let J=H.keepTail?Z.comment:H.newComment;if(X!==void 0||q0(J))return!1;let V=z.kind==="value"?$9($,Z,Q,z,!0):H;return V!==null&&cB($,V.range[0],U,V.piece,z)}function lB($,Z,Q,z,X){let[H,U]=Z.range,V=H===U&&z.kind==="value"?mB($.src,H,Z.piece.text):Z.piece.text;W2($,H,Q,V+(X===void 0?"":` #${X}`))}function cB($,Z,Q,z,X){if(X.kind==="item")return W2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let H=uB($.src,X.key);if(H<0)return!1;return W2($,H,Q,z.inline?` ${z.text}`:z.text),!0}function dB($,Z){return U8({...$,comment:void 0},{...Z,comment:void 0})}function iB($,Z){if(q0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
+ `)?void 0:Z.comment}function nB($,Z,Q,z){if(J9(Z,Q))return!0;if(!dB(Z,Q))return!1;let X=iB(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return x$($,Z,Q,z,X)}function rB($,Z,Q,z){if(!U8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return K4($,Z,0).text===K4($,Q,0).text||x$($,Z,Q,z);if(Q.items.length===0)return x$($,Z,Q,z);return u(Z)?tB($,Z,Q):$q($,Z,Q)}function _4($,Z,Q,z){if(!H9(Z,Q))return x$($,Z,Q,z);if(i(Z))return nB($,Z,Q,z);if(b0(Z))return b0(Q)&&Z.source===Q.source&&U8(Z,Q)||x$($,Z,Q,z);if(!G2(Z)||!G2(Q))return!1;return rB($,Z,Q,z)}function G9($,Z){return Z-g$($,Z)}function O4($,Z,Q){let z=$.slice(g$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function D4($){return W0($)&&(q0($.commentBefore)||!!$.spaceBefore)}function M4($,Z,Q){let z=$0(Z)??$0(Q);return z?X9($.src,z[2]):-1}function Y9($,Z,Q){let z=new e6(void 0,H8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
152
+ `).map((U)=>U?X+U:U).join($.eol)+$.eol}function sB($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
+ `);W2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function W9($,Z,Q,z,X,H){let U=Q;if(U<0){let J=$0(Z);if(!J||D4(Z)||!O4($.src,J[0],H))return!1;U=g$($.src,J[0])}return sB($,U,Y9($,z,X)),!0}function oB($,Z,Q){let z=g$($,Q),X=Z,H=q0(X.commentBefore),U=!!X.spaceBefore;while(z>0){let J=g$($,z-1),V=$.slice(J,z).trim();if(H&&V.startsWith("#"))z=J;else if(U&&V==="")z=J,U=!1;else break}return z}function B9($,Z,Q,z){let X=$0(Z);if(!X||!O4($.src,X[0],z))return!1;let H=M4($,Q,Z);if(H<0)return!1;return W2($,oB($.src,Z,X[0]),H,""),!0}function q9($,Z){let Q=new Map,z=(X)=>{let H=$0(X);return H?H.join(":"):void 0};return $.forEach((X,H)=>{let U=z(Z(X));if(U!==void 0&&!Q.has(U))Q.set(U,H)}),(X)=>{let H=z(Z(X)),U=H===void 0?void 0:Q.get(H);return U!==void 0&&H9(Z($[U]),Z(X))?U:-1}}function aB($,Z){return i($)&&i(Z)?J9($,Z):$===Z}function tB($,Z,Q){let z=Z.items[0]?.key,X=$0(z);if(!X)return!1;let H=G9($.src,X[0]),U=new Set,J=(W,B)=>{if(W.length===0)return!0;let q=new u2;q.items.push(...W);let I=B<0?-1:M4($,Z.items[B].value,Z.items[B].key);return W9($,z,I,q,H,!1)},V=q9(Z.items,(W)=>W.key),G=-1,Y=[];for(let W of Q.items){let B=V(W);if(B<0){Y.push(W);continue}if(B<=G||!J(Y,G)||!aB(Z.items[B].key,W.key))return!1;if(Y=[],!_4($,Z.items[B].value,W.value,{kind:"value",key:Z.items[B].key,col:H}))return!1;U.add(B),G=B}if(!J(Y,G))return!1;return Z.items.every((W,B)=>U.has(B)||eB($,Z,B))}function eB($,Z,Q){let z=Z.items[Q],X=$0(z.key);if(!X)return!1;if(O4($.src,X[0],!1))return B9($,z.key,z.value,!1);let H=Z.items[Q+1],U=$0(H?.key);if(Q!==0||!U||D4(z.key)||D4(H.key))return!1;return W2($,X[0],U[0],""),!0}function $q($,Z,Q){let z=$0(Z);if(!z||Z.items.length===0)return!1;let X=G9($.src,z[0]),H=new Set,U=(Y,W)=>{if(Y.length===0)return!0;let B=new j$;B.items.push(...Y);let q=W<0?-1:M4($,Z.items[W]);return W9($,Z.items[0],q,B,X,!0)},J=q9(Z.items,(Y)=>Y),V=-1,G=[];for(let Y of Q.items){let W=J(Y);if(W<0){G.push(Y);continue}if(W<=V||!U(G,V))return!1;if(G=[],!_4($,Z.items[W],Y,{kind:"item",col:X}))return!1;H.add(W),V=W}if(!U(G,V))return!1;return Z.items.every((Y,W)=>H.has(W)||B9($,Y,Y,!0))}function Zq($,Z){let Q=[...Z].sort((H,U)=>U.start-H.start||U.end-H.end||U.seq-H.seq),z=$,X=1/0;for(let H of Q){if(H.end>X)return null;z=z.slice(0,H.start)+H.text+z.slice(H.end),X=H.start}return z}function Qq($,Z,Q){if(!u(Q)&&!g0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
+ `)?$.eol:"",X=Z.commentBefore?$.eol:"";return W2($,$.src.length,$.src.length,z+X+Y9($,Q,0)),!0}function zq($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!q0(z))return!q0(X)||Qq($,Z,X);return q0(X)&&_4($,z,X,{kind:"root"})}function Xq($,Z,Q,z,X){let H={src:$,eol:z,edits:[],piece:X};if(!zq(H,Z,Q))return null;return Zq($,H.edits)}var Z9=($)=>$.replace(/^[ \t]*\n/gm,"");function Hq($,Z,Q,z){let X=m2($,H8);if(X.errors.length>0||!m(X.toJS(),Z.toJS()))return!1;let H=X.toString(z);return H===Q||Z9(H)===Z9(Q)}function J8($,Z,Q="YAML"){let{text:z,changed:X}=Uq($,Z,Q);return{text:z,changed:X}}function Uq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),H=L4(X,Q),U=Jq(H);Z(U);let J={text:$,changed:!1,spliced:!1};if(m(U.toJS(),H.toJS()))return J;let V={lineWidth:0,...yB(X)},G=U.toString(V);if(G===H.toString(V))return J;let Y=X.includes(`\r
155
+ `)?`\r
156
+ `:`
157
+ `,W=Xq(X,H,U,Y,{...V,verifyAliasOrder:!1}),B=W!==null&&Hq(W,U,G,V),q=B&&W!==null?W:G.replace(/\r?\n/g,Y);return{text:z+q,changed:z+q!==$,spliced:B}}function Jq($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function m($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>m(Q,Z[z]));if(y($)&&y(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&m($[z],Z[z]))}return!1}function y$($){let Z=i($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function e0($,Z){return $.items.find((Q)=>y$(Q)===Z)}function K9($,Z){return W0(Z)?Z.toJS($):Z}function Vq($,Z,Q,z){return z.keepAliases===!0&&b0(Z)||m(K9($,Z),Q)}function V8($,Z,Q,z={}){if(Vq($,Z,Q,z))return Z;if(y(Q)&&u(Z))return Yq($,Z,Q,z),Z;if(Array.isArray(Q)&&g0(Z))return qq($,Z,Q,z),Z;if(!y(Q)&&!Array.isArray(Q)&&i(Z))return Z.value=Q,Z;return Gq(Z,$.createNode(Q))}function Gq($,Z){if(!i($)&&!b0($))return Z;let Q=$,z=Z;if(G2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=q4(z.commentBefore,Q.commentBefore,Q.comment),Z;if(G2(Z))Z.flow=!0;return z.comment=q4(z.comment??Q.comment),z.commentBefore=q4(z.commentBefore??Q.commentBefore),Z}function q4(...$){let Z=$.filter(q0);return Z.length>0?Z.join(`
158
+ `):void 0}function Yq($,Z,Q,z={}){for(let[X,H]of Object.entries(Q)){if(H===void 0)continue;let U=e0(Z,X);if(U)U.value=V8($,U.value,H,z);else Z.items.push($.createPair(X,H))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let H=y$(X);return H===void 0||Q[H]!==void 0})}function R4($,Z,Q,z){let X=y(Q)?Q:{};for(let[H,U]of Object.entries(z)){if(U===void 0)continue;let J=e0(Z,H);if(!J)Z.items.push($.createPair(H,U));else if(Object.prototype.hasOwnProperty.call(X,H)&&m(X[H],U))continue;else if(y(U)&&y(X[H])&&u(J.value))R4($,J.value,X[H],U);else J.value=V8($,J.value,U,{keepAliases:!0})}}function v$($,Z,Q){if(b0($))Q.push({path:[...Z],node:$});else if(u($))for(let z of $.items){let X=y$(z);if(X!==void 0)v$(z.value,[...Z,X],Q)}else if(g0($))$.items.forEach((z,X)=>v$(z,[...Z,X],Q))}function Q9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(y(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function D9($,Z,Q){let z=[];return v$($.contents,[],z),z.filter(({path:X,node:H})=>{let U=Q9(Z,X);return U!==void 0&&!m(Q9(Q,X),U)&&!m(H.toJS($),U)}).map(({path:X,node:H})=>({path:X.join("."),alias:`*${H.source}`}))}function I9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=Wq(Q,Z[X]);let z=Z[Z.length-1];if(u(Q)&&typeof z==="string"){let X=e0(Q,z);return X?{node:X.value,put:(H)=>(X.value=H,!0)}:null}if(g0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,H=X.items[z];return{node:H,put:(U)=>$0(H)===void 0?(X.items[z]=U,!0):!1}}return null}function Wq($,Z){if(u($)&&typeof Z==="string")return e0($,Z)?.value;if(g0($)&&typeof Z==="number")return $.items[Z];return}function L9($,Z){let Q=[];v$($.contents,[],Q);let z=[];for(let{path:X,node:H}of Q){let U=I9(Z,X);if(!U||b0(U.node)&&U.node.source===H.source)continue;if(!U.put(H.clone()))continue;z.push({path:X.join("."),alias:`*${H.source}`})}return z}function I4($,Z,Q,z){if(!W0($)||b0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(u($))for(let H of $.items){let U=y$(H);if(U!==void 0)I4(H.value,[...Z,U],Q,z)}else if(g0($))$.items.forEach((H,U)=>I4(H,[...Z,U],Q,z))}function _9($,Z){let Q=[];v$($.contents,[],Q);let z=new Set(Q.map((U)=>U.node.source));if(z.size===0)return[];let X=[];I4($.contents,[],z,X);let H=[];for(let{path:U,node:J}of X){let V=I9(Z,U);if(!V)continue;let G=J.anchor;if(W0(V.node)&&V.node.anchor===G&&m(J.toJS($),V.node.toJS(Z))||!V.put(J.clone()))continue;H.push({path:U.join("."),alias:`&${G}`,kind:"anchor"})}return H}function Bq($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let U=Q-1;U>=0;U--)for(let J=z-1;J>=0;J--)X[U][J]=m($[U],Z[J])?X[U+1][J+1]+1:Math.max(X[U+1][J],X[U][J+1]);let H=[];for(let U=0,J=0;U<Q&&J<z;)if(m($[U],Z[J]))H.push([U,J]),U++,J++;else if(X[U+1][J]>=X[U][J+1])U++;else J++;return H}function qq($,Z,Q,z){let X=Z.items,H=X.map((G)=>K9($,G)),U=[],J=0,V=0;for(let[G,Y]of[...Bq(H,Q),[X.length,Q.length]]){for(;J<G&&V<Y;J++,V++)U.push(V8($,X[J],Q[V],z));for(;V<Y;V++)U.push($.createNode(Q[V]));if(G<X.length)U.push(X[G]);J=G+1,V=Y+1}Z.items=U}function k$($,Z,Q,z){if(m(Q,z))return Z;if(!y(Q)||!y(z)||!u(Z))return V8($,Z,z);let X=new Set(Object.keys(Q).filter((H)=>!(H in z)||z[H]===void 0));Z.items=Z.items.filter((H)=>{let U=y$(H);return U===void 0||!X.has(U)});for(let[H,U]of Object.entries(z)){if(U===void 0)continue;let J=e0(Z,H);if(!J)Z.items.push($.createPair(H,U));else if(!m(Q[H],U))J.value=k$($,J.value,Q[H],U)}return Z}function O9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new u2,z=$.contents;if(!u(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let H of Z){let U=e0(X,H);if(U&&u(U.value)){X=U.value;continue}if(U&&!F9(U.value))throw Error(`${Q}: ${H} is not a mapping — faf left it unchanged.`);let J=new u2;if(U)U.value=R9(U.value,J);else X.items.push($.createPair(H,J));X=J}return X}function G8($,Z,Q,z,X){if(m(Q,z))return;let H=O9($,Z.slice(0,-1),X),U=Z[Z.length-1],J=e0(H,U);if(z===void 0)H.items=H.items.filter((V)=>V!==J);else if(!J)H.items.push($.createPair(U,z));else J.value=k$($,J.value,Q,z)}function M9($,Z,Q){let z=O9($,Z.slice(0,-1),Q),X=Z[Z.length-1],H=e0(z,X);if(H&&g0(H.value))return H.value;if(H&&!F9(H.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let U=new j$;if(H)H.value=R9(H.value,U);else z.items.push($.createPair(X,U));return U}function R9($,Z){if(!i($))return Z;let Q=[$.commentBefore,$.comment].filter(q0);if(Q.length>0)Z.commentBefore=Q.join(`
159
+ `);return Z}function F9($){if($===null||$===void 0)return!0;return i($)&&($.value===null||$.value===void 0)}var F4=new WeakMap;function h$($){return typeof $==="object"&&$!==null?F4.get($):void 0}function Y8($,Z){F4.set($,Z)}function N9($,Z){let Q=h$($);if(Q)F4.set(Z,Q);return Z}var P9=new WeakSet;function A9($){return P9.add($),$}function T9($){return typeof $==="object"&&$!==null&&P9.has($)}function W8($){let Z=f$($);return k(N4(Z),Z,{read:!0})}function S9($){if($ instanceof $8)return $;let Z=$?.cause;return Z instanceof $8?Z:null}function b9($,Z){let Q=Z.message.split(`
160
+ `)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=f$($);return new j("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function Kq($){let Z=W8($),Q=Q0(Z),z;try{z=x0(Q)}catch(H){let U=S9(H);if(U)throw b9($,U);throw H}let X=X8(z,$);return Y8(X,{real:Z,text:Q}),X}function g9($){let Z=$._meta,Q={...$};delete Q._meta;let z=E$(Q,{lineWidth:0});if(Z?.found&&Z.found.length>0){let X=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(H,U,J)=>{if(J.includes("#"))return H;return`${U} # found: ${X}`})}return z}function Dq($,Z){return x9($,Z,void 0)}function x9($,Z,Q,z,X=!1){let H=W8($),U=Q0(H),J=[],V;try{V=J8(U,(G)=>{v9(G,$);let Y=G.clone();if(Z(G),J=L9(Y,G),X)J=[...J,..._9(Y,G)];if(z)J=[...J,...z(G,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(G){let Y=S9(G);if(Y)throw b9($,Y);throw G}if(!V.changed)return{written:!1,text:U,keptAliases:J};return s($,V.text,{expect:Q&&Q.real===H?Q.text:U}),{written:!0,text:V.text,keptAliases:J}}function w9($){try{return E9($),!0}catch{return!1}}function Iq($){let Z=$.getIn(["project","type"],!0);return i(Z)?Z.value:Z}function v9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!u(Q))throw new j("not-yaml",f$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${b$($.toJS())}. faf left it unchanged — fix it by hand.`)}function Lq($,Z,Q){v9($,Q);let z=$.contents,X=u(z)&&z.items.some((Y)=>i(Y.key)&&Y.key.value==="_meta"),{_meta:H,...U}=Z,J=Iq($),V=u(z)?$.toJS():{},G=u(z)?z:$.createNode({});if($.contents=G,R4($,G,V,X?{...Z}:U),!X)Oq($,H?.found,J)}function _q($,Z){let Q=$.contents;if(u(Q)&&Q.items.some((H)=>i(H.key)&&H.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function Oq($,Z,Q){if(!Z||Z.length===0||!n(Q))return;let z=$.getIn(["project","type"],!0);if(i(z)&&!n(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function Mq($,Z,Q={}){if(!Q.replace&&w9($)){let J=x9($,(V)=>Lq(V,Z,$),h$(Z),(V,G)=>D9(V,_q(V,Z),G),T9(Z));Y8(Z,{real:W8($),text:J.text});for(let V of J.keptAliases??[])Q.onAliasKept?.(V);return J.written}let z=f$($),X=g9(Z),H=w9($)?B0(k(N4(z),z)):null,U=s($,X,{expect:H});return Y8(Z,{real:U,text:X}),!0}function y9($){return Q0(W8($))}function j9($,Z){let Q;try{Q=E9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return k($,f$(Z),{read:!0}),!0}function k9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=C9($,z);if(j9($,X))return X}let Q=N4($);if(Q!==$)for(let z of Z){let X=C9(Q,z);if(j9(Q,X))return X}return null}import{statSync as h9}from"fs";import{homedir as Rq}from"os";import{parse as Fq,resolve as f9}from"path";function u9($,Z){try{let Q=h9($,{bigint:!0}),z=h9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function Nq($){let Z=f9($),Q=f9(Rq()),z=Fq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(u9(Z,Q))return"home";if(u9(Z,z))return"root";return null}function Pq($=process.cwd()){return Nq($)!==null}import{existsSync as Aq,statSync as m9}from"fs";import{dirname as Tq,join as Cq}from"path";var wq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],jq=1000;function Eq($,Z=Tq($)){let Q=m9($).mtimeMs,z=wq.map((X)=>{let H=Cq(Z,X);if(!Aq(H))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let U=m9(H).mtimeMs,J=U-Q,V;if(Math.abs(J)<jq)V="in-sync";else if(J>0)V="newer";else V="older";return{file:X,exists:!0,mtime_ms:U,status:V,delta_ms:J}});return{source:$,source_mtime_ms:Q,targets:z,drifted:z.filter((X)=>X.status==="newer"||X.status==="older").length,in_sync:z.filter((X)=>X.status==="in-sync").length,missing:z.filter((X)=>X.status==="missing").length}}import{join as oq}from"path";import{deprecate as aq}from"node:util";import{createHash as yq}from"crypto";import{resolve as kq}from"path";class B2 extends Error{constructor($){super($);this.name="JsonEditError"}}var Sq=new Set([" ","\t",`
161
+ `,"\r"]);class T4{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 B2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&Sq.has(this.s[this.i]))this.i++}value(){this.ws();let $=this.s[this.i];if($==="{")return this.object();if($==="[")return this.array();if($==='"'){let Z=this.i;return this.string(),{kind:"string",start:Z,end:this.i,members:[],items:[]}}if($==="-"||$>="0"&&$<="9")return this.number();for(let Z of["true","false","null"])if(this.s.startsWith(Z,this.i)){let Q=this.i;return this.i+=Z.length,{kind:"literal",start:Q,end:this.i,members:[],items:[]}}return this.fail($===void 0?"unexpected end":`unexpected ${JSON.stringify($)}`)}object(){let $=this.i++,Z=[];if(this.ws(),this.s[this.i]==="}")return this.i++,{kind:"object",start:$,end:this.i,members:Z,items:[]};for(;;){if(this.ws(),this.s[this.i]!=='"')this.fail("expected a key");let Q=this.i,z=this.string(),X=this.i;if(this.ws(),this.s[this.i]!==":")this.fail('expected ":"');if(this.i++,Z.push({key:z,keyStart:Q,keyEnd:X,value:this.value()}),this.ws(),this.s[this.i]===","){this.i++;continue}if(this.s[this.i]==="}")return this.i++,{kind:"object",start:$,end:this.i,members:Z,items:[]};this.fail('expected "," or "}"')}}array(){let $=this.i++,Z=[];if(this.ws(),this.s[this.i]==="]")return this.i++,{kind:"array",start:$,end:this.i,members:[],items:Z};for(;;){if(Z.push(this.value()),this.ws(),this.s[this.i]===","){this.i++;continue}if(this.s[this.i]==="]")return this.i++,{kind:"array",start:$,end:this.i,members:[],items:Z};this.fail('expected "," or "]"')}}string(){let $=this.i++;for(;;){let Z=this.s[this.i];if(Z===void 0)this.fail("unterminated string");if(Z==='"')break;if(Z<" ")this.fail("control character in a string");if(Z==="\\"){let Q=this.s[this.i+1];if(Q==="u"){if(!/^[0-9a-fA-F]{4}$/.test(this.s.slice(this.i+2,this.i+6)))this.fail("bad \\u escape");this.i+=6;continue}if(!'"\\/bfnrt'.includes(Q??"x"))this.fail("bad escape");this.i+=2;continue}this.i++}return this.i++,JSON.parse(this.s.slice($,this.i))}number(){let $=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(this.s.slice(this.i));if(!$)this.fail("bad number");let Z=this.i;return this.i+=$[0].length,{kind:"number",start:Z,end:this.i,members:[],items:[]}}}var P4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function A4($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>A4(Q,Z[z]));if(P4($)&&P4(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&A4($[z],Z[z]))}return!1}class p9{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
162
+ `,$-1);return Z>=0&&/^[ \t]*$/.test(this.s.slice(Z+1,$))}indentOf($){return this.startsLine($)?this.s.slice(this.s.lastIndexOf(`
163
+ `,$-1)+1,$):""}render($,Z,Q){if(!Q)return JSON.stringify($);return JSON.stringify($,null,this.style.unit).split(`
164
+ `).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[H,U]of Object.entries(Z)){if(U===void 0)continue;let J=Q?`${Q}.${H}`:H,V=$.members.filter((B)=>B.key===H);if(V.length>1)throw new B2(`the key "${J}" is there more than once`);let G=V[0];if(!G){if($.members.length===0)X[H]=U;else this.insert($,H,U,Q);continue}let Y=this.startsLine(G.keyStart);if(P4(U)){if(G.value.kind!=="object")throw new B2(`"${J}" is not an object, so faf cannot add its keys to it`);this.apply(G.value,U,J,Y||this.s.slice(G.value.start,G.value.end).includes(`
165
+ `));continue}let W=JSON.parse(this.s.slice(G.value.start,G.value.end));if(A4(W,U))continue;if(G.value.kind==="object"||G.value.kind==="array")throw new B2(`"${J}" is ${G.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:G.value.start,end:G.value.end,text:this.render(U,this.indentOf(G.keyStart),Y)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,H=X[X.length-1],J=(this.after[z]?.[Z]??[]).map((W)=>X.find((B)=>B.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=J&&J!==H?X[X.indexOf(J)+1]:H,B=this.indentOf(W.keyStart),q=this.s.slice(W.keyEnd,W.value.start),I=this.s.lastIndexOf(`
166
+ `,W.keyStart-1),K=I>0&&this.s[I-1]==="\r"?I-1:I,D=`${this.style.eol}${B}${JSON.stringify(Z)}${q}${this.render(Q,B,!0)},`;this.edits.push({start:K,end:K,text:D});return}let V=J??H,G=this.s.slice(V.keyEnd,V.value.start),Y=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:`${Y}${JSON.stringify(Z)}${G}${this.render(Q,"",!1)}`})}append($,Z,Q,z){if(Z.length===0)return;if($.items.length===0){this.edits.push({start:$.start,end:$.end,text:this.render(Z,this.indentOf(Q),z)});return}let X=$.items[$.items.length-1];if(this.startsLine($.items[0].start)){let U=this.indentOf($.items[0].start),J=Z.map((V)=>`,${this.style.eol}${U}${this.render(V,U,!0)}`).join("");this.edits.push({start:X.end,end:X.end,text:J});return}let H=$.items.length>1?this.s.slice($.items[0].end,$.items[1].start):", ";this.edits.push({start:X.end,end:X.end,text:Z.map((U)=>`${H}${this.render(U,"",!1)}`).join("")})}lineLead($){let Z=this.s.lastIndexOf(`
167
+ `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function bq($,Z){let Q=$.includes(`\r
168
+ `)?`\r
169
+ `:`
170
+ `,z=Z.members[0],X=z?$.lastIndexOf(`
171
+ `,z.keyStart-1):-1,H=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(H)?H:" "}}function B8($,Z,Q={}){let z=new T4($).parse();if(z.kind!=="object")throw new B2("the JSON is not an object");let X=new p9($,bq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
+ `)),l9($,X.edits)}function l9($,Z){if(Z.length===0)return{text:$,changed:!1};let Q=Z.map((X,H)=>({e:X,i:H})).sort((X,H)=>H.e.start-X.e.start||H.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function gq($){let Z=new T4($).parse();if(Z.kind!=="object")throw new B2("the JSON is not an object");return Z}function xq($,Z){let Q=$.lastIndexOf(`
173
+ `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function vq($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(xq($,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 c9($,Z){let Q=[],z=gq($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let H=z.members.filter((U)=>U.key===X);if(H.length!==1)return{count:H.length,chain:Q};Q.push({obj:z,member:H[0]}),z=H[0].value}return{count:1,chain:Q}}function d9($,Z){let{count:Q,chain:z}=c9($,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 C4($,Z,Q={}){let{count:z,chain:X}=c9($,Z);if(z!==1||X.length===0)return null;let H=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&H.obj.members.length===1)H=X[X.length-2];return l9($,[vq($,H.obj,H.member)]).text}var n9="one.faf/render";function j4($){return`sha256:${yq("sha256").update($,"utf8").digest("hex")}`}var hq=/^sha256:[0-9a-f]{64}$/,fq=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,uq='<meta name="faf-render"',mq='<meta name="description" content="Visual render of project.faf.';function pq($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(mq));return Z.splice(Q+1,0,`<meta name="faf-render" content="${j4($)}">
175
+ `),Z.join("")}function r9($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,H)=>{let U=X.replace(/\r?\n$/,""),J=fq.exec(U);if(J)Q.push({at:H,hash:J[1]});else if(U.startsWith(uq))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 w4=["_meta",n9];function lq($){return B8($,{_meta:{[n9]:j4($)}}).text}function cq($){try{return C4($,w4,{dropEmptyParent:!0})??$}catch{return $}}function dq($){let Z;try{Z=d9($,w4)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!hq.test(Z.value))return"many";let Q=C4($,w4,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function s9($,Z){return $==="html"?pq(Z):lq(Z)}function iq($,Z){if($==="json")return cq(Z);let Q=r9(Z);return Q===null||Q==="many"?Z:Q.canonical}function i9($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?r9(Q):dq(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===j4(z.canonical)&&s9(Z,z.canonical)===Q?"match":"mismatch"}function nq($){let Z=new TextDecoder().decode($);if(!Z.includes(`\r
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 rq($,Z,Q){let z=i9($,Q);return z!=="match"&&Z!==null&&i9(Z,Q)==="match"?"match":z}function u$($,Z,Q){let z=kq($),X=k(Q.root,z),H=iq(Q.format,Z),U=s9(Q.format,H),J=B0(X);if(J===null)return s(X,U,{root:Q.root,expect:null}),{path:X,result:"created"};if(J.equals(Buffer.from(U,"utf-8")))return{path:X,result:"unchanged"};let V=nq(J),G=V===null?U:U.replace(/\r?\n/g,`\r
178
+ `);if(V!==null&&J.equals(Buffer.from(G,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!sq(z,J,V,H,Q))return{path:X,result:"unchanged"};return s(X,G,{root:Q.root,expect:J}),{path:X,result:"updated"}}function sq($,Z,Q,z,X){let H=rq(Z,Q,X.format);if(H==="match")return!0;if(H==="mismatch")throw new j("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 j("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let U=Buffer.from(z,"utf-8");if(Z.equals(U)||Q!==null&&Q.equals(U))return!1;throw new j("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 o9=z$.orange,tq=z$.cyan,eq=z$.cyanDeep,$K="#FF9500",ZK="#FF3B30",QK="#E6EDF3",zK="#6E7681",a9={TROPHY:{glyph:"✪",color:o9},GOLD:{glyph:"★",color:o9},SILVER:{glyph:"◆",color:tq},BRONZE:{glyph:"◇",color:eq},GREEN:{glyph:"●",color:QK},YELLOW:{glyph:"●",color:$K},RED:{glyph:"○",color:ZK},WHITE:{glyph:"♡",color:zK}};function l2($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var t9=["who","what","why","where","when","how"];function q8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${l2(Z)}</div><div class="v">${l2(Q)}</div></div>`).join(`
179
+ `)}function E4($,Z,Q="project.faf"){let z=l2($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=a9[X]??a9.WHITE,U=Z.inherited?Z.represents?`inherited from ${l2(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,V=$.human_context??{},G=t9.map((K)=>[K,V[K]]),Y=Object.entries(V).filter(([K])=>!t9.includes(K)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],B=Object.entries($.stack??{}),q=B.filter(([,K])=>K&&K!=="slotignored"&&String(K).trim()!==""),I=B.filter(([,K])=>K==="slotignored").length;return`<!DOCTYPE html>
144
180
  <html lang="en">
145
181
  <head>
146
182
  <meta charset="UTF-8">
147
183
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
148
- <title>${X} — project.faf</title>
184
+ <title>${z} — project.faf</title>
149
185
  <meta name="description" content="Visual render of project.faf. Authored by faf — humans like visuals, we gave them one.">
150
186
  <meta name="robots" content="index,follow">
151
187
  <style>
152
188
  *{margin:0;padding:0;box-sizing:border-box}
153
189
  body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#0a0a0a;color:#e6edf3;line-height:1.55;padding:48px 20px}
154
190
  .wrap{max-width:880px;margin:0 auto}
155
- .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${J.color},transparent);margin-bottom:40px}
191
+ .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${H.color},transparent);margin-bottom:40px}
156
192
  header{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:8px}
157
193
  h1{font-size:2.2rem;font-weight:800;letter-spacing:-1px}
158
- .badge{font-size:1.05rem;font-weight:800;color:${J.color};white-space:nowrap}
194
+ .badge{font-size:1.05rem;font-weight:800;color:${H.color};white-space:nowrap}
159
195
  .score{font-size:1.05rem;font-weight:700;color:#8b949e}
160
196
  .eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:#6e7681;margin-bottom:36px}
161
197
  section{margin-bottom:34px}
162
- h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${J.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
198
+ h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${H.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
163
199
  .row{display:flex;gap:18px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.04)}
164
200
  .k{flex:0 0 150px;color:#8b949e;font-size:.9rem;text-transform:capitalize}
165
201
  .v{flex:1;color:#e6edf3;font-size:.95rem;word-break:break-word}
166
202
  .meter{height:8px;border-radius:4px;background:rgba(255,255,255,.06);overflow:hidden;margin:6px 0 10px}
167
- .meter span{display:block;height:100%;background:${J.color};width:${Math.max(0,Math.min(100,Z.score))}%}
203
+ .meter span{display:block;height:100%;background:${H.color};width:${Math.max(0,Math.min(100,Z.score))}%}
168
204
  .award{font-size:.95rem}
169
205
  .statline{margin-bottom:32px}
170
206
  .awd-pre{color:#6E7681}
@@ -180,65 +216,69 @@ footer strong{color:#e6edf3}
180
216
  <div class="bar"></div>
181
217
  <div class="eyebrow">project.faf · visual render</div>
182
218
  <header>
183
- <h1>${X}</h1>
184
- <span class="badge">${J.glyph} ${t0(z)}</span>
185
- <span class="score">${H}</span>
219
+ <h1>${z}</h1>
220
+ <span class="badge">${H.glyph} ${l2(X)}</span>
221
+ <span class="score">${U}</span>
186
222
  </header>
187
223
  <div class="meter"><span></span></div>
188
- ${U?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy ✪ Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${D?` · ${D} N/A`:""}</p>`}
224
+ ${J?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy ✪ Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${I?` · ${I} N/A`:""}</p>`}
189
225
 
190
226
  <section>
191
227
  <h2>The 6 W's</h2>
192
- ${l1(Y)||'<p class="muted">No human_context yet.</p>'}
193
- ${G.length?l1(G):""}
228
+ ${q8(G)||'<p class="muted">No human_context yet.</p>'}
229
+ ${Y.length?q8(Y):""}
194
230
  </section>
195
231
 
196
232
  <section>
197
233
  <h2>Project</h2>
198
- ${l1(V)||'<p class="muted">—</p>'}
234
+ ${q8(W)||'<p class="muted">—</p>'}
199
235
  </section>
200
236
 
201
237
  <section>
202
238
  <h2>Stack</h2>
203
- ${_.length?l1(_):'<p class="muted">No active stack slots.</p>'}
239
+ ${q.length?q8(q):'<p class="muted">No active stack slots.</p>'}
204
240
  </section>
205
241
 
206
242
  <footer>
207
- Rendered on-demand from your current <strong>${t0(Q)}</strong><br>
243
+ Rendered on-demand from your current <strong>${l2(Q)}</strong><br>
208
244
  <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
209
245
  </footer>
210
246
  </div>
211
247
  </body>
212
248
  </html>
213
- `}function uq($,Z,Q,X="project.faf"){jq(Sq($,"project.html"),b8(Z,Q,X),"utf-8")}var mq=xq(b8,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{writeFileSync as pq}from"fs";import{join as lq}from"path";import{deprecate as dq}from"node:util";var hZ="application/vnd.faf+yaml",cq="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",iq=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function fZ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&iq.test(Z))return Z;let Q=$.project?.homepage??$.project?.website??$.project?.url,X="local";if(Q)try{X=new URL(Q).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let z=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${X}/${z}`}function rq($){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 e0($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:hZ,iana:`https://www.iana.org/assignments/media-types/${hZ}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function g2($,Z={}){let Q={$schema:cq,name:fZ($),version:String($.project?.version??"0.1.0"),description:rq($)},X=S8($)??$.project?.name;if(X&&X.length<=100)Q.title=X;let z=$.project?.homepage??$.project?.website??$.project?.url;if(z)Q.websiteUrl=z;if(Z.remoteUrl)Q.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return Q._meta={"one.faf/context":e0($,Z)},Q}var kZ="io.modelcontextprotocol.registry/publisher-provided",vZ=4096;function E8($,Z={}){let Q={"one.faf/context":e0($,Z)},X=new TextEncoder().encode(JSON.stringify(Q)).length;if(X>vZ)throw Error(`publisher-provided _meta is ${X}B — exceeds the registry ${vZ}B cap`);return{[kZ]:Q}}function j8($){return fZ($)}function S8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function nq($,Z,Q={}){let X=g2(Z,Q),z=lq($,"server-card");return pq(z,`${JSON.stringify(X,null,2)}
214
- `,"utf-8"),z}var aq=dq(g2,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as uZ,mkdirSync as DO,readFileSync as sq,writeFileSync as IO}from"fs";import{dirname as oq,join as mZ}from"path";import{deprecate as tq}from"node:util";var pZ="https://faf.one/context",eq="JSONRPC",lZ="1.0",$Y=["a2a","mcp","registry","catalog"];function ZY($){return t(sq($,"utf-8"))}function QY($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let X of Z){let z=mZ($,X);if(uZ(z))return z}let Q=oq($);if(Q!==$)for(let X of Z){let z=mZ(Q,X);if(uZ(z))return z}return null}function XY($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function x8($,Z={}){let Q=XY($);if(Q.length>0)return Q;let X=Z.doorUrl?.trim();if(X)return[{protocol:"a2a",location:X,version:lZ}];return[]}function g8($,Z,Q={}){let X=$.agent??{},z=x8($,Q);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let J=String(X.displayName??$.metadata?.persona??X.name??"").trim(),H=String(X.description??"").trim(),U=String(X.version??"").trim(),q=String(X.vendor??"").trim(),Y=String(X.homepage??"").trim();if(!J||!H||!U||!q||!Y)throw Error("A2A card needs agent.displayName|name, description, version, vendor, homepage in .fafa");let G=e0(Z,Q),V=($.capabilities??[]).map((B)=>{let _=String(B.name??"").trim();if(!_)throw Error("A2A skill missing capabilities[].name");let D=Array.isArray(B.tags)?B.tags.map(String):[];return{id:_,name:_,description:String(B.description??"").trim()||_,tags:D}});return{name:J,description:H,supportedInterfaces:z.map((B)=>({url:String(B.location),protocolBinding:eq,protocolVersion:String(B.version??lZ)})),provider:{organization:q,url:Y},version:U,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[{uri:pZ,description:"FAF context provenance — the durable context block (one context, every door).",required:!1,params:G}]},defaultInputModes:["text/plain","application/json"],defaultOutputModes:["text/plain","application/json"],skills:V}}var zY=tq(g8,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function JY($){let Z=$.agent?.homepage;if(!Z)return"local";try{return new URL(Z).hostname.replace(/^www\./,"")}catch{return"local"}}function HY($,Z){if(Z.a2aCardUrl)return Z.a2aCardUrl;let Q=$.agent?.homepage;if(Q)try{return new URL("/.well-known/agent-card.json",Q).href}catch{}return"/.well-known/agent-card.json"}function UY($,Z,Q={}){let X=JY($),z=$.agent??{},J=String(z.name??"agent"),H=Q.now??Z.generated??new Date().toISOString(),U=[];if(x8($,Q).length>0)U.push({identifier:`urn:air:${X}:a2a:${J}`,displayName:String(z.displayName??z.name??"A2A Agent Card"),type:"application/a2a-agent-card+json",description:"A2A v1.0 Agent Card. Projected from .fafa.",url:HY($,Q),updatedAt:H});let q=qY($,"fafa");if(q)U.push({identifier:`urn:air:${X}:agent:${J}`,displayName:String(z.displayName??z.name??".fafa"),type:"application/vnd.fafa+yaml",description:"FAF agent passport (.fafa).",url:q,updatedAt:H});return U}function qY($,Z){let Q=$.agent?.homepage;if(!Q)return;try{return new URL(`/.well-known/${Z}`,Q).href}catch{return}}function YY($,Z){let Q=$.findIndex((X)=>X.identifier===Z.identifier);if(Q>=0)return Q;if(Z.type==="application/a2a-agent-card+json"||Z.type==="application/json"||Z.identifier.includes(":a2a:"))return $.findIndex((X)=>X.identifier.includes(":a2a:")||X.type==="application/a2a-agent-card+json"||String(X.url??"").includes("agent-card.json"));if(Z.type==="application/vnd.fafa+yaml")return $.findIndex((X)=>X.type==="application/vnd.fafa+yaml");return-1}function GY($,Z){let Q=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]};for(let X of Z){let z=YY(Q.entries,X);if(z>=0)Q.entries[z]={...Q.entries[z],url:X.url,type:X.type,...X.updatedAt?{updatedAt:X.updatedAt}:{}};else Q.entries.push(X)}return Q}function VY($){let Z=$.opts??{},Q=new Set($.targets?.length?$.targets:$Y),z={block:e0($.faf,Z)};if(Q.has("mcp"))z.mcp=g2($.faf,Z);if(Q.has("registry")){let J=S8($.faf);z.registry={name:j8($.faf),...J?{title:J}:{},_meta:E8($.faf,Z)}}if(Q.has("a2a")||Q.has("catalog")){if(!$.fafa){if($.targets?.includes("a2a")||$.targets?.includes("catalog"))throw Error("A2A/catalog require a .fafa (agent.fafa). Will not invent an agent.")}}if(Q.has("a2a")&&$.fafa)if(x8($.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 z.a2a=g8($.fafa,$.faf,Z);if(Q.has("catalog")&&$.fafa)z.catalog=UY($.fafa,$.faf,Z);return BY(z),z}function BY($){let Z=JSON.stringify($.block),Q=[];if($.a2a)Q.push(JSON.stringify($.a2a.capabilities.extensions[0].params));if($.mcp){let X=$.mcp._meta;Q.push(JSON.stringify(X["one.faf/context"]))}if($.registry){let X=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(X["one.faf/context"]))}for(let X of Q)if(X!==Z)throw Error("context block drifted across card targets — one projector, one block")}var y8=["ephemeral","standard","high","critical"],N0=Object.fromEntries(y8.map(($,Z)=>[$,Z])),d1=new Set(["user","feedback","project","reference"]),h8=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),v8=new Set(["facts","sessions","preferences","custom"]),f8={low:"ephemeral",medium:"standard"};import{readFileSync as WY,writeFileSync as _Y,existsSync as OY}from"fs";function $2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function u($){return $===null||$===void 0}function y2($){if(u($))return"standard";if(f8[$])return f8[$];if($ in N0)return $;return"standard"}var DY=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function dZ($){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[X,z]of Object.entries(Z))if(!DY.has(X))Q[X]=z;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:y2(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 cZ($){if(u($.id)&&u($.type)&&$.tags.length===0&&$.links.length===0&&u($.timestamp)&&u($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!u($.id))Q.id=$.id;if(!u($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!u($.timestamp))Q.timestamp=$.timestamp;if(!u($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}class g0{namepoint;profile;retention;created;last_etched;_facts;_byId;_index;_sessions;_preferences;_custom;_extra;_memoryExtra;constructor($,Z={}){this.namepoint=$,this.profile=Z.profile??"knowledge",this.retention=Z.retention??"forever",this.created=Z.created??$2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.slice():[],this._byId=new Map,this._facts.forEach((Q,X)=>{if(!u(Q.id))this._byId.set(Q.id,X)}),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}:{}}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(!OY($))throw Error(`soul file not found: ${$}`);let Z=WY($,"utf-8"),Q=t(Z);if(!Q||typeof Q!=="object")throw Error("soul is not a YAML mapping");let X=Q.memory&&typeof Q.memory==="object"?Q.memory:{},z=Array.isArray(X.facts)?X.facts:[],J={};for(let[q,Y]of Object.entries(Q))if(!h8.has(q))J[q]=structuredClone(Y);let H={};for(let[q,Y]of Object.entries(X))if(!v8.has(q))H[q]=structuredClone(Y);let U=new g0(String(Q.namepoint??$.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(Q.profile??"voice"),facts:z.map(dZ),retention:String(Q.retention??"forever"),created:Q.created??null,index:Array.isArray(Q.index)?Q.index.slice():[],sessions:Array.isArray(X.sessions)?structuredClone(X.sessions):[],preferences:X.preferences&&typeof X.preferences==="object"?structuredClone(X.preferences):{},custom:X.custom&&typeof X.custom==="object"?structuredClone(X.custom):{},extra:J,memoryExtra:H});return U.last_etched=String(Q.last_etched??U.created),U}static fromFile($){return g0.load($)}toDoc(){let $={facts:this._facts.map(cZ),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,X]of Object.entries(this._memoryExtra))if(!v8.has(Q))$[Q]=structuredClone(X);let Z={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,X]of Object.entries(this._extra))if(!h8.has(Q))Z[Q]=structuredClone(X);return Z}toYaml(){return x2(this.toDoc(),{lineWidth:100})}rebuildIndex($=80){return this._index=this._facts.map((Z)=>`${Z.id??"?"} — ${Z.text.slice(0,$)}`),this._index}save($,Z={}){if(Z.reindex!==!1)this.rebuildIndex();return _Y($,this.toYaml(),"utf-8"),$}toFile($,Z={}){return this.save($,Z)}add($){if(!u($.id)&&this._byId.has($.id)){let Z=this._byId.get($.id);if(Z!==void 0)this._facts[Z]=$}else if(this._facts.push($),!u($.id))this._byId.set($.id,this._facts.length-1);if($.timestamp&&$.timestamp>(this.last_etched||""))this.last_etched=$.timestamp;return $}etch($,Z={}){return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:y2(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:$2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=N0[y2(Z.minPriority??"ephemeral")]??0,X=($??"").toLowerCase(),z=new Set(Z.tags??[]),J=[];this._facts.forEach((U,q)=>{if(X&&!U.text.toLowerCase().includes(X))return;if(z.size>0&&![...z].some((Y)=>U.tags.includes(Y)))return;if(!u(Z.type)&&U.type!==Z.type)return;if((N0[U.priority]??1)<Q)return;J.push([q,U])}),J.sort((U,q)=>{let Y=N0[U[1].priority]??1,G=N0[q[1].priority]??1;if(G!==Y)return G-Y;let V=U[1].timestamp??"",B=q[1].timestamp??"";if(B!==V)return B<V?-1:B>V?1:0;return q[0]-U[0]});let H=J.map(([,U])=>U);if(!u(Z.limit))return H.slice(0,Z.limit);return H}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,X)=>{if(!u(Q.id))this._byId.set(Q.id,X)}),!0}}import{readdirSync as IY,readFileSync as KY,statSync as iZ,existsSync as LY}from"fs";import{join as RY,basename as rZ,resolve as MY}from"path";var nZ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),FY=/\[\[([^\]]+)\]\]/g;function NY($){let Z=iZ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function PY($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=t(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 AY($,Z,Q){if(!Q.name)return null;let X=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},z=X.type;if(typeof z!=="string"||!d1.has(z))return null;let J=String(Q.name).trim(),U=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||J,q={};if(X.originSessionId)q.provenance=[`session:${X.originSessionId}`];let Y=[...new Set([...Z.matchAll(FY)].map((G)=>G[1]))].sort();return{text:U,id:J,type:z,priority:"standard",tags:[],links:Y,timestamp:NY($),source:`claude-code memory: ${rZ($)}`,extra:q}}function aZ($,Z={}){let Q=MY($);if(!LY(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!iZ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let X=Z.skip??nZ,z=Z.namepoint??`@claude-code:${rZ(Q)}`,J=[],H=IY(Q).filter((V)=>V.endsWith(".md")).sort();for(let V of H){if(X.has(V))continue;let B=RY(Q,V),_;try{_=KY(B,"utf-8")}catch{continue}let{fm:D,body:W}=PY(_);if(!D)continue;let O=AY(B,W,D);if(O)J.push(O)}let U=J.map((V)=>V.timestamp).filter(Boolean),q=U.length?U.reduce((V,B)=>V<B?V:B):$2(),Y=U.length?U.reduce((V,B)=>V>B?V:B):q,G=new g0(z,{profile:"knowledge",facts:J,created:q});return G.last_etched=Y,G.rebuildIndex(),G}var $5="faf-interview/1",Z2="(terse — 3-4 words)",k8=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${Z2}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${Z2}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${Z2}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${Z2}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${Z2}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${Z2}`,header:"How",type:"text",required:!0}],Z5=[{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}],Q2=[...k8,...Z5],Q5=new Map(Q2.map(($)=>[$.path,$])),TY=Object.fromEntries(Q2.map(($)=>[$.path,$]));function u8($){let Z=Q5.get($);if(Z)return Z.question;let Q=A0.get($)??f.find((X)=>X.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function wY($,Z){return Q2.filter((Q)=>{let X=Q.path.split("."),z=$;for(let J of X)if(z&&typeof z==="object"&&J in z)z=z[J];else{z=void 0;break}if(z==="slotignored")return!1;return Z(z)})}var CY=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"]),bY=[["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]],sZ=($)=>CY.has($.toLowerCase().trim()),EY=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function oZ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&EY.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function X5($){let Z={};if(!$||typeof $!=="string")return Z;let Q=$.trim(),X=Q.replace(/^[^A-Za-z0-9]+/,"").split(/\s+(?:for|that|which|to)\s+|\s+[—–]\s+|\s-\s|:\s|\.\s|,\s/)[0].trim(),z=oZ(X);if(z.split(/\s+/).filter(Boolean).length>=2&&!sZ(z))Z.what=z;let J=bY.filter(([,q])=>q.test(Q)).map(([q])=>q);if(J.length)Z.where=J.slice(0,4).join(", ");let H=Q.match(/\bfor ((?:[A-Za-z][\w./+-]* )?(?:any |all )?(?:developers?|teams?|engineers?|builders?|users?|integrators?)\b[^.,;:—]*)/i),U=oZ((H?.[1]||"").trim().replace(/\s+/g," "));if(U&&!sZ(U))Z.who=U;return Z}function tZ($,Z){let Q=$;for(let X of Z.split("."))if(Q&&typeof Q==="object"&&X in Q)Q=Q[X];else return;return Q}function eZ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!T0(Z)}function jY($,Z={}){let Q=$&&typeof $==="object"?$:{},X=tZ(Q,"project.goal"),z=(eZ(X)?String(X).trim():"")||(Z.goal??"").trim(),J=X5(z),H=Z.detailed??{},U={"project.goal":z||void 0,"human_context.what":J.what,"human_context.where":J.where,"human_context.who":J.who},q=(_)=>{let D=U[_];if(D)return{value:D,source:"project goal",confidence:0.9};let W=_.startsWith("human_context.")?_.slice(14):"",O=W?H[W]:void 0;return O?{value:O.value,source:O.source,confidence:O.confidence}:void 0},Y=k8.map((_,D)=>{let W={n:D+1,path:_.path,header:_.header,question:_.question},O=tZ(Q,_.path);if(eZ(O))return{...W,value:String(O).trim(),status:"filled",seeded:!1};let I=q(_.path);if(I)return{...W,value:I.value,status:"seeded",seeded:!0,source:I.source,confidence:I.confidence};return{...W,value:"",status:"empty",seeded:!1}}),G=Y.filter((_)=>_.status==="filled").length,V=Y.filter((_)=>_.status==="seeded").length,B=Y.filter((_)=>_.status==="empty").length;return{version:$5,rows:Y,filledCount:G,seededCount:V,emptyCount:B,complete:B===0}}function c1($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||T0(Z)}return!1}function SY($,Z){let Q=$;for(let X of Z.split("."))if(Q&&typeof Q==="object"&&X in Q)Q=Q[X];else return;return Q}function z5($){if($==="project.goal")return!0;return A0.get($)?.category==="human"}function J5($,Z=c1){let Q=[],X=[];for(let z of Q2){let J=SY($,z.path);if(J==="slotignored")continue;if(!Z(J))continue;(z5(z.path)?Q:X).push(z.path)}return{human:Q,sourceable:X}}function H5($,Z,Q=c1){let X=J5(Z,Q),z;if($>=100||X.human.length===0&&X.sourceable.length===0)z="done";else if(X.sourceable.length>0)z="can-source";else z="needs-human";let J=z==="needs-human"?m8(X):[];return{status:z,score:$,gaps:X,ask:J}}function m8($){return $.human.map((Z)=>({path:Z,question:u8(Z)}))}function xY($,Z={}){let Q=Math.max(1,Z.maxRounds??5),X=Z.isEmpty??c1,z=[],J=0;for(let U=0;U<=Q;U++){let q=$.read();if(!q)return{status:"no-faf",score:0,rounds:J,history:z,ask:[]};let Y=$.score(q.yaml);z.push(Y);let G=H5(Y,q.data,X);if(G.status==="done")return{status:"done",score:Y,rounds:J,history:z,ask:[]};if(G.status==="needs-human")return{status:"needs-human",score:Y,rounds:J,history:z,ask:G.ask};if(z.length>=2&&Y<=z[z.length-2])return G.gaps.human.length?{status:"needs-human",score:Y,rounds:J,history:z,ask:m8(G.gaps)}:{status:"stuck",score:Y,rounds:J,history:z,ask:[]};if(J>=Q)return{status:"capped",score:Y,rounds:J,history:z,ask:m8(G.gaps)};$.runAuto(),J++}return{status:"capped",score:z[z.length-1]??0,rounds:J,history:z,ask:[]}}import{createHash as q5}from"crypto";var p8="faf-bench/1",gY={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function yY($,Z){return gY[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var Y5=[["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"]],h2=new Map;Y5.forEach(($,Z)=>$.forEach((Q)=>h2.set(Q,Z)));var hY=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function i1($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function U5($){return i1($).split(" ").filter((Z)=>Z&&!hY.has(Z))}function G5($,Z){let Q=i1($),X=i1(Z);if(!Q||!X)return!1;if(Q===X)return!0;let z=h2.get(Q);if(z!==void 0&&h2.get(X)===z)return!0;let J=U5($);if(J.length===0)return!1;let H=new Set(U5(Z));return J.every((U)=>{if(H.has(U))return!0;let q=h2.get(U);return q!==void 0&&[...H].some((Y)=>h2.get(Y)===q)})}function vY($){let Z=I$($),Q=t($),X=[],z={},J=0;for(let q of f){if(Z.slots[q.path]!=="populated")continue;let Y=B6(Q,q);if(typeof Y!=="string")continue;let G=Y.trim();if(!G||o2.has(G.toLowerCase()))continue;J+=1,X.push({n:J,path:q.path,question:yY(q.path,q.description)}),z[J]=G}let H=JSON.stringify({v:p8,q:X.map((q)=>[q.path,q.question])}),U=q5("sha256").update(H).digest("hex").slice(0,12);return{version:p8,qsetHash:U,questions:X,answers:z}}function fY($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function kY($,Z){let Q=$.questions.map((z)=>{let J=Z[String(z.n)]??Z[z.path]??"";return{n:z.n,path:z.path,ok:typeof J==="string"&&J.trim()!==""&&G5($.answers[z.n],J)}}),X=$.questions.filter((z)=>!Q[z.n-1].ok);return{correct:Q.filter((z)=>z.ok).length,total:$.questions.length,misses:X,perQuestion:Q}}function uY($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:q5("sha256").update(Q).digest("hex")}}import{existsSync as NV,readdirSync as w5,readFileSync as PV}from"fs";import{join as o8,dirname as AV,extname as TV,resolve as wV}from"path";var l8={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{targetUser:"developers",coreProblem:"understanding project",missionPurpose:"project documentation"},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",backend:"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",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",runtime:"Node.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+",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",runtime:"Node.js",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",runtime:"Node.js",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",runtime:"Node.js",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",database:"Required",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{hosting:"Docker",connection:"Containerized"},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker",connection:"Multi-container"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker",connection:"Multi-container"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes",connection:"Orchestrated"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes",connection:"Orchestrated"},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:{cicd:"Jest"},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{cicd:"Jest",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{cicd:"Vitest",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{cicd:"Cypress"},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{cicd:"Playwright",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{cicd:"Karma"},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{cicd:"Mocha"},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{cicd:"RSpec",mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{cicd:"Pytest",mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{cicd:"PHPUnit",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",framework:"Zig",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL",backend:"GraphQL Server"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL",backend:"GraphQL Server"},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",framework:"MLflow",backend:"MLflow",cicd:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",framework:"DVC",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{framework:"DVC"},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:{cicd:"Codecov"},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{cicd:"Dependabot"},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{cicd:"Renovate"},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",backend:"Helm"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{hosting:"Cloud",cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{hosting:"Cloud",cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{hosting:"Cloud",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:{cicd:"SonarQube"},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:{cicd:"pre-commit"},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};import{existsSync as V5,readFileSync as pY,readdirSync as lY}from"fs";import{join as d8}from"path";var X2={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 dY=X2.flutterDeps,cY=X2.mcpDeps,iY=X2.serverFrameworks,rY=X2.stateManagement,nY=X2.routing;function aY($){let Z=new Set,Q=!1;for(let X of $.split(`
215
- `)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(X)){Q=!0;continue}if(/^\S/.test(X))Q=!1;if(Q){let z=X.match(/^\s{2}([a-zA-Z0-9_]+):/);if(z)Z.add(z[1].toLowerCase())}}return Z}function r1($){let Z=d8($,"pubspec.yaml");if(!V5(Z))return null;let Q;try{Q=pY(Z,"utf-8")}catch{return null}let X=aY(Q),z=(F)=>X.has(F.toLowerCase()),J=dY.some(z)||/^flutter:\s*$/m.test(Q)||/\bsdk:\s*flutter\b/.test(Q),H=cY.find(z),U=iY.find(([F])=>z(F)),q=rY.find(([F])=>z(F)),Y=q?q[1]:"",G=nY.find(([F])=>z(F)),V=G?G[1]:"",B=z("flutter_test")?"flutter_test":z("test")?"test":"",_=/^executables:\s*$/m.test(Q),D=!1;try{D=lY(d8($,"bin")).some((F)=>F.endsWith(".dart"))}catch{}let W=_||D,O,I="",N;if(J)if(I="Flutter",V5(d8($,"lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Q))O="mobile",N="pubspec.yaml (Flutter app)";else O="library",N="pubspec.yaml (Flutter package)";else if(H)O="mcp",N=`pubspec.yaml + ${H} (Dart MCP server)`;else if(U)O="backend",I=U[1],N=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(W)O="cli",N=_?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else O="library",N="pubspec.yaml (Dart package)";return{appType:O,isFlutter:J,framework:I,stateManagement:Y,routing:V,testing:B,found:N}}import{existsSync as c8,readFileSync as _5,readdirSync as B5,statSync as oY}from"fs";import{join as a1}from"path";var n1={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 tY=n1.mcpModules,eY=n1.serverFrameworks,$G=n1.cliFrameworks;function ZG($){let Z=new Set,Q=!1;for(let X of $.split(`
216
- `)){let z=X.replace(/\/\/.*$/,"").trim();if(!z)continue;if(/^require\s*\(\s*$/.test(z)){Q=!0;continue}if(Q){if(z===")"){Q=!1;continue}let H=z.match(/^(\S+)/);if(H)Z.add(H[1].toLowerCase());continue}let J=z.match(/^require\s+(\S+)/);if(J&&J[1]!=="(")Z.add(J[1].toLowerCase())}return Z}function O5($,Z){let Q=Z.toLowerCase();for(let X of $)if(X===Q||X.startsWith(`${Q}/`))return!0;return!1}function W5($,Z){let Q;for(let X of Z){if(!O5($,X[0]))continue;if(!Q||X[0].length>Q[0].length)Q=X}return Q}function QG($,Z){let Q;for(let X of Z){if(!O5($,X))continue;if(!Q||X.length>Q.length)Q=X}return Q}function XG($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function zG($){let Z=a1($,"cmd");if(!c8(Z))return!1;try{for(let Q of B5(Z)){let X=a1(Z,Q);try{if(oY(X).isDirectory()){if(B5(X).some((J)=>J.endsWith(".go")))return!0}else if(Q.endsWith(".go"))return!0}catch{}}}catch{}return!1}function JG($){let Z=a1($,"main.go");if(!c8(Z))return!1;try{let Q=_5(Z,"utf-8");return/^package\s+main\b/m.test(Q)}catch{return!1}}function s1($){let Z=a1($,"go.mod");if(!c8(Z))return null;let Q;try{Q=_5(Z,"utf-8")}catch{return null}let X=XG(Q),z=ZG(Q),J=QG(z,tY),H=W5(z,eY),U=W5(z,$G),q=zG($),Y=JG($),G,V="",B;if(J)G="mcp",B=`go.mod + ${J} (Go MCP server)`;else if(H)G="backend",V=H[1],B=`go.mod + ${H[0]} (Go backend)`;else if(U)G="cli",V=U[1],B=`go.mod + ${U[0]} (Go CLI)`;else if(q)G="cli",B="go.mod + cmd/ (Go CLI layout)";else if(Y&&!H)G="cli",B="go.mod + main.go package main (Go CLI)";else G="library",B="go.mod (Go module)";return{appType:G,modulePath:X,framework:V,found:B}}import{existsSync as UG,readFileSync as qG,readdirSync as YG}from"fs";import{join as GG}from"path";var y0={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 VG=y0.mcpPackages.map(($)=>$.toLowerCase()),BG=y0.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),WG=y0.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),_G=y0.grpcServerPackages.map(($)=>$.toLowerCase()),OG=y0.specializedSdks,D5=y0.baseSdk.toLowerCase();function DG($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),X=(Z?.[1]||Q?.[1]||"").trim(),z=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),J=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],U=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||J||"").trim(),q=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),Y=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),G=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),V=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),B=new Set;for(let D of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(D[1].toLowerCase());for(let D of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(D[1].toLowerCase());let _=new Set;for(let D of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))_.add(D[1].toLowerCase());return{sdk:X,outputType:z,targetFramework:U,isTestProject:q,useMaui:Y,useWpf:G,useWindowsForms:V,packages:B,frameworkRefs:_}}function i8($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let X of $)if(X===Q||X.startsWith(`${Q}.`))return!0;return!1}function I5($,Z){let Q;for(let[X,z]of Z){if(!i8($,X))continue;if(!Q||X.length>Q[0].length)Q=[X,z]}return Q}function IG($){let Z;for(let Q of VG){if(!i8($,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 KG($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let X of OG){let z=X[0].toLowerCase();if(Z===z||Z.startsWith(`${z}/`)){if(!Q||z.length>Q[0].length)Q=X}}return Q}function o1($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function LG($,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 RG($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:X,packages:z,frameworkRefs:J,outputType:H}=$,U,q="",Y,G=IG(z),V=KG(X),B=I5(z,WG),_=I5(z,BG),D=_G.some((O)=>i8(z,O)),W=J.has("microsoft.aspnetcore.app");if(G)U="mcp",q="MCP",Y=`${Z} + ${G} (C# MCP server)`;else if($.isTestProject||V?.[1]==="test"||B)U="library",q=B?.[1]||(V?.[1]==="test"?V[2]:"Test"),Y=`${Z} + test (${q})`;else if($.useMaui)U="mobile",q="MAUI",Y=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)U="backend",q=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",Y=`${Z} + ${q}`;else if(V?.[1]==="web")U="backend",q=D?"gRPC":V[2],Y=`${Z} + Sdk=${V[0]}${D?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(V?.[1]==="worker")U="backend",q=V[2],Y=`${Z} + Sdk=${V[0]} (Worker)`;else if(V?.[1]==="blazor-wasm")U="backend",q=V[2],Y=`${Z} + Sdk=${V[0]} (Blazor WASM)`;else if(V?.[1]==="aspire")U="backend",q=V[2],Y=`${Z} + Sdk=${V[0]} (Aspire)`;else if(V?.[1]==="razor-lib")U="library",q=V[2],Y=`${Z} + Sdk=${V[0]} (Razor class library)`;else if(W&&o1(H))U="backend",q="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(W&&!o1(H))U="library",q="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(_&&(o1(H)||!H))U="cli",q=_[1],Y=`${Z} + ${_[0]} (C# CLI)`;else if(o1(H))U="cli",Y=`${Z} + OutputType=Exe (C# console)`;else{U="library";let O=X?` Sdk=${X}`:"";if(Y=`${Z}${O} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!X||X.toLowerCase()===D5||X.toLowerCase().startsWith(`${D5}/`))Y=`${Z} (C# class library)`}return{appType:U,projectName:Q,targetFramework:$.targetFramework,sdk:X||"Microsoft.NET.Sdk",framework:q,found:Y}}function z2($){if(!UG($))return[];try{return YG($).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}catch{return[]}}function t1($){let Z=z2($);if(Z.length===0)return null;let Q=null,X=999;for(let z of Z){let J=GG($,z),H;try{H=qG(J,"utf-8")}catch{continue}let U=DG(H),q=RG(U,z),Y=LG(q.appType,q.framework);if(!Q||Y<X)Q=q,X=Y}return Q}import{existsSync as h0,readFileSync as FG,readdirSync as NG,statSync as PG}from"fs";import{join as r}from"path";var e={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 AG=e.mcpArtifacts.map(($)=>$.toLowerCase()),TG=e.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),wG=e.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),CG=e.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),DD=e.androidPlugins.map(($)=>$.toLowerCase()),bG=e.kmpPlugins.map(($)=>$.toLowerCase()),EG=e.jvmKotlinPlugins.map(($)=>$.toLowerCase()),jG=e.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),SG=e.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),xG=e.libraryPlugins.map(($)=>$.toLowerCase()),gG=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function r8($){return gG.some((Z)=>h0(r($,Z)))}function f2($){try{return FG($,"utf-8")}catch{return null}}function yG($){let Z=new Map,Q=new Map,X="";for(let z of $.split(`
217
- `)){let J=z.replace(/#.*$/,"").trim();if(!J)continue;let H=J.match(/^\[([^\]]+)\]$/);if(H){X=H[1].trim().toLowerCase();continue}let U=J.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(U&&(X==="plugins"||X.endsWith(".plugins"))){Z.set(U[1].replace(/-/g,".").toLowerCase(),U[2].toLowerCase()),Z.set(U[1].toLowerCase(),U[2].toLowerCase());continue}let q=J.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(q&&(X==="libraries"||X.endsWith(".libraries"))){let V=q[1].toLowerCase();Q.set(V,q[2].toLowerCase()),Q.set(V.replace(/-/g,"."),q[2].toLowerCase());continue}let Y=J.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(Y&&(X==="libraries"||X.endsWith(".libraries"))){let V=`${Y[2]}:${Y[3]}`.toLowerCase(),B=Y[1].toLowerCase();Q.set(B,V),Q.set(B.replace(/-/g,"."),V);continue}let G=J.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(G){let V=G[1].toLowerCase(),B=G[2];if(X==="plugins"||X.endsWith(".plugins")){let _=B.split(":")[0].toLowerCase();Z.set(V,_),Z.set(V.replace(/-/g,"."),_)}else if(X==="libraries"||X.endsWith(".libraries")){let _=B.split(":");if(_.length>=2){let D=`${_[0]}:${_[1]}`.toLowerCase();Q.set(V,D),Q.set(V.replace(/-/g,"."),D)}}}}return{plugins:Z,libraries:Q}}function hG($){let Z=r($,"gradle","libs.versions.toml");if(!h0(Z))return{plugins:new Map,libraries:new Map};let Q=f2(Z);if(!Q)return{plugins:new Map,libraries:new Map};return yG(Q)}function vG($){let Z=[];for(let Q of $.matchAll(/include\s*\(\s*([^)]+)\)/g))for(let X of Q[1].split(",")){let z=X.replace(/['":\s]/g,"").replace(/^:/,"");if(z)Z.push(z.replace(/:/g,"/"))}for(let Q of $.matchAll(/include\s+((?:['"][^'"]+['"]\s*,?\s*)+)/g))for(let X of Q[1].split(",")){let z=X.replace(/['":\s]/g,"").replace(/^:/,"");if(z)Z.push(z.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 fG($,Z){let Q=new Set;for(let X of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(X[1].toLowerCase());for(let X of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(X[1].toLowerCase());for(let X of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let z of X[1].split(/[\n;]/)){let J=z.replace(/\/\/.*$/,"").trim();if(!J||J.startsWith("id")||J.startsWith("kotlin")||J.startsWith("alias"))continue;let H=J.match(/^`([a-zA-Z0-9.-]+)`$/)||J.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(H)Q.add(H[1].toLowerCase())}for(let X of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let z=X[1].toLowerCase();if(z==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(z==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(z==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${z}`)}for(let X of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let z=X[1].toLowerCase(),J=Z.plugins.get(z)||Z.plugins.get(z.replace(/\./g,"-"))||Z.plugins.get(z.replace(/-/g,"."));if(J)Q.add(J);else if(z.includes("spring")&&z.includes("boot"))Q.add("org.springframework.boot")}for(let X of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(X[1].toLowerCase());return Q}function kG($,Z){let Q=new Set;for(let X of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(X[1].toLowerCase());for(let X of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let z=X[1].toLowerCase();if(z.startsWith("plugins."))continue;let J=[z,z.replace(/\./g,"-"),z.replace(/-/g,".")];for(let H of J){let U=Z.libraries.get(H);if(U){Q.add(U.includes(":")?U.split(":").slice(0,2).join(":"):U);break}}}return Q}function R5($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,X=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(X){let H=X[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),U=X[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(H&&U)Q.add(`${H}:${U}`.toLowerCase())}let z=new Set;for(let H of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let U=H[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),q=H[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(U&&q)z.add(`${U}:${q}`.toLowerCase())}let J=[];for(let H of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))J.push(H[1].trim());return{packaging:Z,parents:Q,artifacts:z,modules:J}}function B0($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let X of $)if(X===Q||X.endsWith(`.${Q}`)||X===Q.replace(/^org\.gradle\./,""))return!0;return!1}function v2($,Z,Q){let X;for(let[z,J]of Z){let H=!1;if(Q==="plugin")H=B0($,z);else if(H=$.has(z)||[...$].some((U)=>U===z||U.startsWith(`${z}:`)||U.startsWith(`${z}.`)),!H&&Q==="artifact")H=[...$].some((U)=>U===z||U.startsWith(`${z}`));if(!H)continue;if(!X||z.length>X[0].length)X=[z,J]}return X}function uG($){let Z;for(let Q of AG)for(let X of $){if(X===Q||X.startsWith(`${Q}:`)||X.startsWith(Q.replace(/:mcp$/,":"))){if(!Z||Q.length>Z.length)Z=Q}if(X.startsWith("io.modelcontextprotocol")||X.includes("spring-ai-starter-mcp")||X.includes("spring-ai-mcp")){if(!Z||X.length>Z.length)Z=X}}return Z}function M5($){let Z=new Set,Q=!1,X=!1,z=[r($,"src"),r($,"src","main")],J=(H,U)=>{if(U>4||!h0(H))return;let q;try{q=NG(H)}catch{return}for(let Y of q){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Z.add(Y);let G=r(H,Y);try{if(PG(G).isDirectory())J(G,U+1);else if(Y.endsWith(".kt")||Y.endsWith(".kts"))Q=!0;else if(Y.endsWith(".java"))X=!0}catch{}}};for(let H of z)J(H,0);return{kotlin:Q,java:X,hints:Z}}function mG($){let Z=[],Q=$.plugins,X=$.artifacts,z=bG.some((A)=>B0(Q,A))||$.sourceHints.has("commonMain"),J=B0(Q,"com.android.application"),H=B0(Q,"com.android.library")||B0(Q,"com.android.kotlin.multiplatform.library");if(J||H)Z.push("android");if(z)Z.push("multiplatform");let U=uG(X),q=v2(Q,TG,"plugin"),Y=v2($.parents,wG,"parent"),G=v2(X,CG,"artifact"),V=v2(Q,jG,"plugin"),B=v2(X,SG,"artifact"),_=xG.some((A)=>B0(Q,A)),D=$.packaging==="pom",W,O="",I;if(J)W="mobile",O=z?"Android+KMP":"Android",I=`${$.path||"root"} + com.android.application (${O})`;else if(U)W="mcp",O="MCP",Z.push("mcp"),I=`${$.path||"root"} + ${U} (JVM MCP server)`;else if(q||Y||G){W="backend",O=q?.[1]||Y?.[1]||G?.[1]||"JVM";let A=q?.[0]||Y?.[0]||G?.[0]||"web";I=`${$.path||"root"} + ${A} (JVM backend)`}else if(z&&!H)W="library",O="Kotlin Multiplatform",I=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(H)W="library",O=z?"Android+KMP":"Android",I=`${$.path||"root"} + android library (${O})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||V)||V&&$.hasMainClass)W="cli",O=B?.[1]||"application",I=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!_)W="cli",O="application",I=`${$.path||"root"} + application plugin (JVM CLI)`;else if(D)W="library",I=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{W="library";let A=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(I=`${$.path||"root"} (${A} library)`,_)I=`${$.path||"root"} + java-library (JVM library)`}let N="Java";if($.kotlinSources&&$.javaSources)N="Java/Kotlin";else if($.kotlinSources||EG.some((A)=>B0(Q,A))||z)N="Kotlin";let F=[...new Set(Z)];return{appType:W,framework:O,facets:F,found:I,buildTool:$.buildTool,mainLanguage:N}}function pG($,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 K5($,Z,Q){let X=Z?r($,Z):$,z=r(X,"build.gradle.kts"),J=r(X,"build.gradle"),H=h0(z)?z:h0(J)?J:null;if(!H)return null;let U=f2(H);if(!U)return null;let q=fG(U,Q),Y=kG(U,Q),G=M5(X),V=/mainClass\s*[.=]/.test(U)||/mainClassName\s*=/.test(U)||/Main-Class/.test(U),B=B0(q,"application")||B0(q,"org.gradle.application");return{path:Z||"build.gradle",plugins:q,artifacts:Y,packaging:"jar",parents:new Set,hasMainClass:V,hasApplicationPlugin:B,sourceHints:G.hints,kotlinSources:G.kotlin||H.endsWith(".kts"),javaSources:G.java,buildTool:"gradle"}}function L5($,Z){let Q=Z?r($,Z):$,X=r(Q,"pom.xml");if(!h0(X))return null;let z=f2(X);if(!z)return null;let{packaging:J,parents:H,artifacts:U}=R5(z),q=M5(Q);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:U,packaging:J,parents:H,hasMainClass:/<mainClass>/.test(z),hasApplicationPlugin:!1,sourceHints:q.hints,kotlinSources:q.kotlin,javaSources:q.java,buildTool:"maven"}}function k2($){if(!r8($))return null;let Z=hG($),Q=[],X=null;for(let Y of["settings.gradle.kts","settings.gradle"]){let G=r($,Y);if(h0(G)){X=f2(G);break}}let z=X?vG(X):[],J=K5($,"",Z);if(J)Q.push(J);for(let Y of z){let G=K5($,Y,Z);if(G)Q.push(G)}let H=L5($,"");if(H){Q.push(H);let Y=f2(r($,"pom.xml"));if(Y){let{modules:G}=R5(Y);for(let V of G){let B=L5($,V);if(B)Q.push(B)}}}if(Q.length===0&&X)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let U=null,q=999;for(let Y of Q){let G=mG(Y),V=pG(G.appType,G.facets);if(!U||V<q)U={appType:G.appType,framework:G.framework,buildTool:G.buildTool,mainLanguage:G.mainLanguage,facets:G.facets,found:G.found},q=V}if(U&&z.length>0&&!U.found.includes("multi-project"));return U}import{existsSync as p2,readFileSync as dG,readdirSync as e1,statSync as cG}from"fs";import{join as $0}from"path";var u2={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 iG=u2.mcpGems.map(($)=>$.toLowerCase()),rG=u2.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),F5=u2.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),nG=u2.railsLayoutFiles;function aG($){return p2($0($,"Gemfile"))||p2($0($,"gems.rb"))||sG($)}function sG($){try{return e1($).some((Z)=>Z.endsWith(".gemspec"))}catch{return!1}}function m2($){try{return dG($,"utf-8")}catch{return null}}function oG($){let Z=new Set;for(let Q of $.split(`
218
- `)){let X=Q.replace(/#.*$/,"").trim();if(!X)continue;let z=X.match(/^\s*gem\s+['"]([^'"]+)['"]/i)||X.match(/^\s*gem\s+:([A-Za-z0-9_.-]+)/i);if(z)Z.add(z[1].toLowerCase())}return Z}function tG($){let Z=new Set,Q=!1;for(let X of $.split(`
219
- `)){let z=X.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(z)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(z)||z.startsWith("PLATFORMS")||z.startsWith("DEPENDENCIES")||z.startsWith("BUNDLED")||z.startsWith("RUBY VERSION")||z.startsWith("CHECKSUMS")){Q=!1;continue}let J=z.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(J)Z.add(J[1].toLowerCase())}}return Z}function eG($){let Z=new Set;for(let Q of $.split(`
220
- `)){let z=Q.replace(/#.*$/,"").match(/add_(?:runtime_|development_)?dependency\s*\(?\s*['"]([^'"]+)['"]/i);if(z)Z.add(z[1].toLowerCase())}return Z}function $V($){let Z=new Set,Q=[];for(let z of["Gemfile","gems.rb"]){let J=$0($,z),H=m2(J);if(H){for(let U of oG(H))Z.add(U);Q.push(z)}}let X=m2($0($,"Gemfile.lock"))||m2($0($,"gems.locked"));if(X){for(let z of tG(X))Z.add(z);Q.push("Gemfile.lock")}try{for(let z of e1($)){if(!z.endsWith(".gemspec"))continue;let J=m2($0($,z));if(J){for(let H of eG(J))Z.add(H);Q.push(z)}}}catch{}return{gems:Z,sources:Q}}function l2($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function n8($,Z){let Q;for(let[X,z]of Z){if(!l2($,X))continue;if(!Q||X.length>Q[0].length)Q=[X,z]}return Q}function ZV($){let Z;for(let Q of iG)if(l2($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function N5($){for(let Z of nG)if(p2($0($,Z)))return Z;return}function QV($,Z){let Q=n8(Z,F5);if(Q)return{hit:!0,why:Q[0]};try{for(let z of e1($)){if(!z.endsWith(".gemspec"))continue;let J=m2($0($,z));if(J&&/executables\s*=/.test(J)&&!/executables\s*=\s*\[\s*\]/.test(J))return{hit:!0,why:`${z} executables`}}}catch{}let X=$0($,"bin");if(p2(X))try{let J=e1(X).filter((H)=>{if(H==="setup"||H==="console"||H==="rake")return!1;try{return cG($0(X,H)).isFile()}catch{return!1}}).filter((H)=>H!=="rails");if(J.length>0&&!l2(Z,"rails")&&!N5($))return{hit:!0,why:`bin/${J[0]}`}}catch{}return{hit:!1,why:""}}function $$($){if(!aG($))return null;let{gems:Z,sources:Q}=$V($),X=Q[0]||"Gemfile",z=Q.some((O)=>O==="Gemfile"||O==="gems.rb"||O.includes("lock"))?"bundler":"rubygems",J=ZV(Z),H=n8(Z,rG),U=N5($),q=l2(Z,"rails")||l2(Z,"railties"),Y=QV($,Z),G=p2($0($,"config.ru")),V=q||!!U,B=H&&H[1]!=="Rails"&&!(H[0]==="rack"&&!G)?H:void 0,_,D="",W;if(J)_="mcp",D="MCP",W=`${X} + gem ${J} (Ruby MCP)`;else if(V)if(_="backend",D="Rails",q&&U)W=`${X} + rails + ${U} (Rails)`;else if(q)W=`${X} + gem rails (Rails)`;else W=`${U} (Rails layout)`;else if(B)_="backend",D=B[1],W=`${X} + gem ${B[0]} (Ruby backend)`;else if(Y.hit)_="cli",D=n8(Z,F5)?.[1]||"",W=`${X} + ${Y.why} (Ruby CLI)`;else _="library",W=`${X} (Ruby library)`;return{appType:_,framework:D,packageManager:z,found:W}}import{existsSync as a8,readFileSync as zV,readdirSync as JV,statSync as HV}from"fs";import{join as d2}from"path";var J0={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 UV=J0.mcpPackageUrls.map(($)=>$.toLowerCase()),qV=J0.mcpProducts.map(($)=>$.toLowerCase()),YV=J0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),GV=J0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),VV=J0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),BV=J0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),WV=J0.appProductTypes,_V=J0.cliProductTypes,OV=J0.vaporLayoutFiles;function DV($){return a8(d2($,"Package.swift"))||s8($).length>0}function s8($){try{return JV($).filter((Z)=>{if(!Z.endsWith(".xcodeproj"))return!1;try{return HV(d2($,Z)).isDirectory()}catch{return!1}})}catch{return[]}}function T5($){try{return zV($,"utf-8")}catch{return null}}function IV($){let Z=KV($),Q=Z.toLowerCase(),X=[],z=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,J;while((J=z.exec(Z))!==null)X.push(J[1]);let H=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((J=H.exec(Z))!==null)X.push(J[1]);let U=[],q=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((J=q.exec(Z))!==null)U.push(J[1]);let Y=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((J=Y.exec(Z))!==null)U.push(J[1]);let G=/\.library\s*\(/.test(Q),V=/\.executable\s*\(/.test(Q),B=/\.plugin\s*\(/.test(Q)&&!G&&!V?!0:/\bproducts\s*:\s*\[[\s\S]*?\.plugin\s*\(/.test(Q),_=/\.executabletarget\s*\(/.test(Q),D=/\.target\s*\(/.test(Q)&&!_?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:X,productNames:U,hasLibraryProduct:G,hasExecutableProduct:V,hasPluginProduct:!!B,hasExecutableTarget:_,hasLibraryTarget:D}}function KV($){let Z="",Q=0;while(Q<$.length){if($[Q]==='"'||$[Q]==="'"){let X=$[Q];Z+=X,Q++;while(Q<$.length){if($[Q]==="\\"&&Q+1<$.length){Z+=$[Q]+$[Q+1],Q+=2;continue}if(Z+=$[Q],$[Q]===X){Q++;break}Q++}continue}if($[Q]==="/"&&$[Q+1]==="/"){Q+=2;while(Q<$.length&&$[Q]!==`
221
- `)Q++;continue}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<$.length&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;Q+=2;continue}Z+=$[Q],Q++}return Z}function LV($,Z){let Q=$.map((z)=>z.toLowerCase()),X;for(let z of Z)for(let J of Q)if(J.includes(z)&&(!X||z.length>X.length))X=z;return X}function P5($,Z){let Q=$.map((z)=>z.toLowerCase()),X;for(let[z,J]of Z)for(let H of Q)if(H.includes(z)&&(!X||z.length>X[0].length))X=[z,J];return X}function A5($,Z){let Q=$.map((z)=>z.toLowerCase()),X;for(let[z,J]of Z)if(Q.includes(z)&&(!X||z.length>X[0].length))X=[z,J];return X}function RV($){let Z=$.map((Q)=>Q.toLowerCase());return qV.some((Q)=>Z.includes(Q))}function MV($){let Z=!1,Q=!1,X;for(let z of s8($)){let J=d2($,z,"project.pbxproj"),H=T5(J);if(!H)continue;for(let U of WV)if(H.includes(U))Z=!0,X=U;for(let U of _V)if(H.includes(U)){if(Q=!0,!X)X=U}}return{hasApplication:Z,hasTool:Q,hit:X}}function FV($){for(let Z of OV)if(a8(d2($,Z)))return Z;return}function c2($){if(!DV($))return null;let Z=d2($,"Package.swift"),Q=a8(Z),X=s8($),z=X.length>0,J=null;if(Q){let S=T5(Z);if(S)J=IV(S)}let H=z?MV($):{hasApplication:!1,hasTool:!1},U=FV($),q=J?.packageUrls??[],Y=J?.productNames??[],G=LV(q,UV),V=RV(Y),B=P5(q,YV),_=A5(Y,GV),D=P5(q,VV),W=A5(Y,BV),O=!!(G||V),I=!!(B||_||U),N=!!(J?.hasExecutableProduct||J?.hasExecutableTarget),F=!!(D||W),A=H.hasApplication,w=Q&&z?"spm+xcode":Q?"spm":"xcode",T,C="",L;if(O)if(T="mcp",C="MCP",V)L="Package.swift + product MCP (Swift MCP)";else L=`Package.swift + ${G} (Swift MCP)`;else if(I)if(T="backend",C=_?.[1]||B?.[1]||(U?"Vapor":""),_)L=`Package.swift + product ${_[1]} (Swift backend)`;else if(B)L=`Package.swift + ${B[1]} (Swift backend)`;else L=`${U} (Swift backend layout)`;else if(A)T="app",C="",L=`${X[0]} + ${H.hit||"application"} (Swift app)`;else if(F||N&&!I&&!O)if(T="cli",C=W?.[1]||D?.[1]||"",W)L=`Package.swift + product ${W[1]} (Swift CLI)`;else if(D)L=`Package.swift + ${D[1]} (Swift CLI)`;else if(J?.hasExecutableProduct)L="Package.swift + .executable product (Swift CLI)";else L="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Q)T="cli",L=`${X[0]} + tool productType (Swift CLI)`;else if(Q)if(T="library",J?.hasLibraryProduct)L="Package.swift + .library product (Swift library)";else L="Package.swift (Swift library)";else T="library",L=`${X[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:T,framework:C,packageManager:w,found:L}}var CV=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),bV=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),EV={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"]},jV=[["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 SV($,Z){for(let[Q,X]of jV)if(Q in $)return X;return Z.length>0?"framework":"config"}function xV($){try{let Z=JSON.parse(PV($,"utf-8")),Q=["background","content_scripts","action","browser_action","permissions"].some((X)=>(X in Z));if(typeof Z.manifest_version==="number"&&Q)return"chrome";return"other"}catch{return"other"}}function gV($){let Z=[],Q=wV($),X=NV(o8($,".git")),z=new Set;for(let J=0;J<10;J++){let H;try{H=w5(Q)}catch{break}for(let q of H){if(q.toLowerCase().endsWith(".csproj")){let G=t1(Q);if(G){let V={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile"&&G.framework)V.framework=G.framework;if(G.targetFramework)V.runtime=G.targetFramework;let B=G.framework?[G.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:V,priority:36,frameworks:B,fileName:q})}continue}if(q.endsWith(".xcodeproj")){let G=c2(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="spm"?"spm":"Xcode",buildTool:G.packageManager.includes("spm")?"swift build":"xcodebuild"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app")V.framework=G.framework||"Swift App";let B=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:36,frameworks:B,fileName:q})}continue}let Y=l8[q];if(!Y)continue;if(q==="manifest.json"&&xV(o8(Q,q))!=="chrome")continue;if(q==="pubspec.yaml"){let G=r1(Q);if(G){let V={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(V.framework="Flutter",G.stateManagement)V.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="mcp")V.apiType="MCP";Z.push({slots:V,priority:Y.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:q});continue}}if(q==="go.mod"){let G=s1(Q);if(G){let V={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let B=G.framework?[G.framework,"Go"]:["Go"];Z.push({slots:V,priority:Y.priority,frameworks:B,fileName:q});continue}}if(q==="Gemfile"||q==="Gemfile.lock"||q==="gems.rb"){let G=$$(Q);if(G){let V={mainLanguage:"Ruby",packageManager:G.packageManager};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let B=G.framework?[G.framework,"Ruby"]:["Ruby"];Z.push({slots:V,priority:Y.priority??35,frameworks:B,fileName:q});continue}}if(q==="Package.swift"){let G=c2(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app")V.framework=G.framework||"SwiftUI/App";let B=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:Y.priority??36,frameworks:B,fileName:q});continue}}if(q==="pom.xml"||q==="build.gradle"||q==="build.gradle.kts"||q==="settings.gradle"||q==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let G=k2(Q);if(G){let V={mainLanguage:G.mainLanguage==="Java/Kotlin"?"Kotlin":G.mainLanguage,packageManager:G.buildTool==="maven"?"maven":"gradle",buildTool:G.buildTool};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile")V.framework=G.framework||"Android";if(G.facets.includes("multiplatform"))V.framework=G.framework||"Kotlin Multiplatform";let B=G.framework?[G.framework,"JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:V,priority:Y.priority??35,frameworks:B,fileName:q});continue}}Z.push({slots:Y.slots||{},priority:Y.priority,frameworks:Y.frameworks,fileName:q})}if(X&&J===0)break;let U=AV(Q);if(U===Q)break;Q=U}return Z}function yV($){let Z=[];for(let Q of b5($,2,{count:0})){let X=l8[`*${Q}`],z=X?.slots?.mainLanguage;if(z)Z.push({slots:{mainLanguage:z},priority:X.priority,frameworks:X.frameworks})}return Z}function C5($){let Z=[...gV($),...yV($)],Q={},X={},z=new Set;for(let Y of Z){Y.frameworks.forEach((G)=>z.add(G));for(let[G,V]of Object.entries(Y.slots))if(V&&!V.includes("/")&&(!(G in Q)||Y.priority>X[G]))Q[G]=V,X[G]=Y.priority}let J=new Map;for(let Y of Z){if(!Y.fileName)continue;if(!J.has(Y.fileName))J.set(Y.fileName,{fileName:Y.fileName,category:SV(Y.slots,Y.frameworks),priority:Y.priority})}let H=[...J.values()].sort((Y,G)=>G.priority-Y.priority||Y.fileName.localeCompare(G.fileName)),U=[];if(Q.mainLanguage)U.push(Q.mainLanguage.toLowerCase());if(Q.framework)U.push(Q.framework.toLowerCase());let q=U.length>0?U.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...z],confirmedCount:Z.length,discoveredFormats:H,stackSignature:q}}function Z$($){let{slotFills:Z}=C5($),Q={};for(let[X,z]of Object.entries(Z)){let J=EV[X];if(!J||!z)continue;let[H,U]=J;if(H==="project")(Q.project??={})[U]=z;else(Q.stack??={})[U]=z}return Q}function b5($,Z,Q){let X=new Set;if(Z<0||Q.count>400)return X;let z;try{z=w5($,{withFileTypes:!0})}catch{return X}for(let J of z){if(Q.count++>400)break;if(!J.isDirectory()){let H=TV(J.name);if(bV.has(H))X.add(H);continue}if(CV.has(J.name)||J.name.startsWith("."))continue;for(let H of b5(o8($,J.name),Z-1,Q))X.add(H)}return X}import{existsSync as E5,readFileSync as j5}from"fs";import{join as S5}from"path";var k=($,Z,Q)=>({value:$,source:Z,confidence:Q});function x5($,Z={}){let Q=Z.toolingRoot?null:hV($),X=vV($),z={},J=(H,U)=>{if(U)z[H]=U};return J("what",uV(Q,X)),J("who",mV(X)),J("why",pV(X)),J("where",lV(Q,X)),J("when",dV(X)),J("how",cV(Q,X)),z}function Q$($,Z={}){let Q=x5($,Z),X={};return Object.keys(Q).forEach((z)=>{let J=Q[z];if(J)X[z]=J.value}),X}function hV($){let Z=S5($,"package.json");if(!E5(Z))return null;try{return JSON.parse(j5(Z,"utf-8"))}catch{return null}}function vV($){let Z=S5($,"README.md");if(!E5(Z))return"";let Q;try{Q=j5(Z,"utf-8")}catch{return""}return Q.replace(/<!--[\s\S]*?-->/g,"").split(`
222
- `).filter((X)=>!/^\s*\[!\[/.test(X)&&!/^\s*!\[/.test(X)).join(`
223
- `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function v0($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function fV($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function J2($,Z){let Q=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),X=$.match(Q);if(!X||!X[2]||X[2].trim().length<=20||fV(X[2])>0.4)return null;return{body:v0(X[2]),heading:X[1].trim()}}function kV($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((X)=>X.trim()).filter(Boolean);if(Q.length>=3&&Q.every((X)=>X.length<=24))return!0;return!1}function i2($,Z,Q=30){for(let X of Z){let z=$.match(X);if(z&&z[1]&&z[1].trim().length>=Q)return v0(z[1])}return null}function uV($,Z){if($?.description&&$.description.length>20)return k(v0($.description),"package.json:description",0.95);let Q=J2(Z,"Purpose|What|About|Overview|Description");if(Q)return k(Q.body,`README:## ${Q.heading}`,0.8);let X=Z.split(/\n\s*\n/).map((J)=>J.replace(/\s+/g," ").trim()).find((J)=>J.length>30&&!J.startsWith("#")&&!kV(J));if(X)return k(v0(X),"README:first-paragraph",0.5);let z=i2(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return z?k(z,"README:problem-heuristic",0.6):null}function mV($){let Z=J2($,"Audience|Who|Who is this for|Who it.s for");if(Z)return k(Z.body,`README:## ${Z.heading}`,0.8);let Q=i2($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?k(Q,"README:audience-heuristic",0.6):null}function pV($){let Z=J2($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return k(Z.body,`README:## ${Z.heading}`,0.8);let Q=i2($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?k(Q,"README:mission-heuristic",0.6):null}function lV($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return k(v0(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return k(v0($.homepage),"package.json:homepage",0.9);let X=i2(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return X?k(X,"README:deploy-heuristic",0.6):null}function dV($){let Z=J2($,"Timeline|Status|Release|Roadmap");if(Z)return k(Z.body,`README:## ${Z.heading}`,0.8);let Q=i2($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?k(Q,"README:since-heuristic",0.6):null}function cV($,Z){let Q=$?.scripts?Object.keys($.scripts):[],X=["start","dev","build"].filter((H)=>Q.includes(H));if(X.length)return k(v0(X.map((H)=>`npm run ${H}`).join(", ")),"package.json:scripts",0.9);let z=J2(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(z)return k(z.body,`README:## ${z.heading}`,0.8);let J=J2(Z,"Architecture|Approach|How it works|Methodology|How");return J?k(J.body,`README:## ${J.heading}`,0.7):null}var g5="3.0";import{existsSync as R,readFileSync as H0,readdirSync as t8}from"fs";import{join as K}from"path";var y5=[{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:"dependency",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 iV($){let Z=K($,"Cargo.toml");if(!R(Z))return null;try{let X=H0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return X?X[1]:null}catch{return null}}function rV($){let Z=K($,"Cargo.toml");if(!R(Z))return!1;try{let Q=H0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(Q)}catch{return!1}}function nV($,Z){if(Z?.keywords?.some((X)=>/^sdk(?:\s|-|$)|-sdk$/i.test(X)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let Q=iV($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function aV($){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 X=K($,Q);if(!R(X))continue;try{let z=JSON.parse(H0(X,"utf-8"));if(typeof z.manifest_version==="number")return`${Q} manifest_version ${z.manifest_version} (browser extension)`}catch{}}return null}function sV($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=K($,"pyproject.toml");if(R(Q))try{let J=H0(Q,"utf-8").match(Z);if(J)return`pyproject.toml depends on ${J[1]}`}catch{}let X=K($,"requirements.txt");if(R(X))try{let J=H0(X,"utf-8").match(Z);if(J)return`requirements.txt contains ${J[1]}`}catch{}return null}function oV($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let X of Q)if(Z.dependencies?.[X]||Z.devDependencies?.[X])return`${X} dependency`}if(R(K($,"ios"))&&R(K($,"android")))return"ios/ + android/ dirs";return null}function tV($,Z){let Q=K($,"Cargo.toml");if(R(Q))try{let z=H0(Q,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(z))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(z))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let X=K($,"build.zig");if(R(X))try{let z=H0(X,"utf-8");if(/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(z))return"build.zig wasm target"}catch{}if(Z?.keywords?.some((z)=>/^wasm(?:-|$)|webassembly/i.test(z)))return'package.json keywords contains "wasm"';return null}function eV($,Z){if(!R(K($,"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((z)=>Q[z]))return null}return"index.html (vanilla, no frontend framework)"}function $B($,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)$/,X=Z.files.some((J)=>Q.test(J)),z=Z.files.some((J)=>/\.(md|MD)$|examples?\//.test(J)||J==="README.md"||J==="docs"||J==="docs/");if(!X&&z)return"package.json files = docs/examples only (no source)"}return null}function ZB($,Z,Q){let X=Q.find((z)=>z.slug==="astro"||z.slug==="gatsby");if(X)return`${X.name} (static-site framework)`;if(Z?.keywords?.some((z)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(z)))return'package keywords contains "website"/"marketing"/"landing"';return null}function QB($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},X=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],z=["stripe","@stripe/stripe-js","lemonsqueezy"],J=X.some((U)=>Q[U]),H=z.some((U)=>Q[U]);if(J&&H)return"auth + payment dependencies";return null}function XB($,Z,Q){if(Z?.keywords?.some((J)=>/mcpaas/i.test(J)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let X=Q.some((J)=>J.slug==="mcp"),z=Q.some((J)=>J.category==="database");if(X&&z&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function zB($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||R(K($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}var JB=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"]),h5=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,HB=new Set(["frontend","backend","database","css","ui","state"]);function UB($){if(R(K($,"pyproject.toml"))||R(K($,"manage.py"))||R(K($,"setup.py"))||X$($,"requirements*.txt"))return!0;if(R(K($,"go.mod")))return!0;if(R(K($,"Cargo.toml")))return!0;if(R(K($,"Gemfile")))return!0;if(R(K($,"pom.xml"))||X$($,"build.gradle*"))return!0;if(z2($).length>0)return!0;let Z=P0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function z$($){let Z;try{Z=t8($,{withFileTypes:!0})}catch{return[]}let Q=[];for(let X of Z){if(!X.isDirectory()||X.name.startsWith(".")||JB.has(X.name))continue;let z=K($,X.name);if(!UB(z))continue;let J=H$(z);if(J==="Unknown")continue;let H=J$(z).filter((G)=>HB.has(G.category)),U=H.find((G)=>G.category==="frontend"),q=H.find((G)=>G.category==="backend"),Y=U??q??H[0]??null;Q.push({name:X.name,language:J,topFramework:Y?.name??null,frontend:!!U,backend:!!q||h5.test(J),hasFramework:!!Y,appRoot:R(K(z,"manage.py"))||R(K(z,"config.ru"))||R(K(z,"bin/rails"))||R(K(z,"artisan"))})}return Q}function qB($,Z){if(Z?.workspaces||R(K($,"pnpm-workspace.yaml")))return null;let Q=z$($),X=new Set(Q.map((z)=>z.language));if(Q.length<2||X.size<2)return null;if(!Q.some((z)=>z.frontend)||!Q.some((z)=>z.backend))return null;return`polyglot: ${Q.map((z)=>`${z.name}/ (${z.language})`).join(", ")}`}function v5($){let Z=z$($);if(Z.length<2)return null;let Q=(H)=>(H.appRoot?2:0)+(h5.test(H.language)?2:0)+(H.hasFramework?1:0)+(H.frontend?0.5:0),X=[...Z].sort((H,U)=>Q(U)-Q(H)),z=new Set,J=[];for(let H of X){if(z.has(H.language))continue;z.add(H.language);let U=H.frontend?"frontend":H.backend?"backend":"service";J.push(H.topFramework?`${H.language} (${H.topFramework} · ${U})`:`${H.language} (${U})`)}return J.join("; ")}function P0($){let Z=K($,"package.json");if(!R(Z))return null;try{return JSON.parse(H0(Z,"utf-8"))}catch{return null}}function X$($,Z){if(!Z.includes("*"))return R(K($,Z));let Q=Z.split("/");if(Q.length===1){let U=Z.split("*")[0];try{return t8($).some((q)=>q.startsWith(U))}catch{return!1}}let X=K($,...Q.slice(0,-1)),z=Q[Q.length-1],J=z.split("*")[0],H=z.split("*")[1]||"";try{return t8(X).some((U)=>U.startsWith(J)&&U.endsWith(H))}catch{return!1}}function YB($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return X$(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!X$(Q,$.pattern))return!1;try{let X=K(Q,$.pattern);if(!R(X))return!1;return H0(X,"utf-8").toLowerCase().includes($.key.toLowerCase())}catch{return!1}}default:return!1}}function J$($){let Z=P0($);return y5.map((Q)=>{let z=Q.signals.filter((J)=>YB(J,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:z}}).filter((Q)=>Q.confidence>0).sort((Q,X)=>X.confidence-Q.confidence)}function H$($){let Z=P0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(R(K($,"tsconfig.json")))return"TypeScript";if(R(K($,"Cargo.toml")))return"Rust";if(R(K($,"go.mod")))return"Go";if(z2($).length>0)return"C#";if(R(K($,"pyproject.toml"))||R(K($,"setup.py")))return"Python";if(R(K($,"Gemfile")))return"Ruby";if(r8($)){let Q=k2($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(R(K($,"Package.swift")))return"Swift";if(R(K($,"build.zig")))return"Zig";if(R(K($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function f5($){let Z=P0($),Q=J$($),X=[],z=$B($,Z);if(z)return X.push(z),{type:"documentation",found:X};let J=nV($,Z);if(J)return X.push(J),{type:"sdk",found:X};let H=aV($);if(H)return X.push(H),{type:"extension",found:X};let U=XB($,Z,Q);if(U)return X.push(U),{type:"mcpaas",found:X};let q=QB($,Z);if(q)return X.push(q),{type:"saas",found:X};let Y=tV($,Z);if(Y)return X.push(Y),{type:"wasm",found:X};let G=r1($);if(G)return X.push(G.found),{type:G.appType,found:X};let V=s1($);if(V)return X.push(V.found),{type:V.appType,found:X};let B=t1($);if(B)return X.push(B.found),{type:B.appType,found:X};let _=k2($);if(_)return X.push(_.found),{type:_.appType,found:X};let D=$$($);if(D)return X.push(D.found),{type:D.appType,found:X};let W=c2($);if(W)return X.push(W.found),{type:W.appType,found:X};let O=oV($,Z);if(O)return X.push(O),{type:"mobile",found:X};if(Q.some((x)=>x.slug==="mcp"))return X.push("MCP SDK signal"),{type:"mcp",found:X};if(Z?.bin)return X.push("package.json bin"),{type:"cli",found:X};if(rV($))return X.push("Cargo.toml [[bin]]"),{type:"cli",found:X};if(R(K($,"build.zig"))){if(X.push("build.zig"),R(K($,"src/main.zig")))return X.push("src/main.zig"),{type:"cli",found:X};if(R(K($,"src/root.zig")))return X.push("src/root.zig"),{type:"library",found:X}}let N=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit");if(Z?.private===!0&&(R(K($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&N)return X.push("private workspace","Svelte"),{type:"framework",found:X};if(N)return X.push("Svelte/SvelteKit"),{type:"svelte",found:X};let A=Q.some((x)=>x.category==="frontend"),w=Q.some((x)=>x.category==="backend");if(Z?.private&&(Z.workspaces||R(K($,"pnpm-workspace.yaml")))&&A&&w)return X.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:X};let T=zB($,Z);if(T)return X.push(T),{type:"monorepo-root",found:X};let C=ZB($,Z,Q);if(C)return X.push(C),{type:"website",found:X};if(Q.some((x)=>x.slug==="nextjs"||x.slug==="nuxt"))return X.push(Q.find((x)=>x.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:X};let S=Q.some((x)=>x.category==="frontend"),E=Q.some((x)=>x.category==="backend");if(S&&E)return X.push("frontend framework","backend framework"),{type:"fullstack",found:X};if(S)return X.push("frontend framework"),{type:"frontend",found:X};if(E)return X.push("backend framework"),{type:"backend",found:X};let m=sV($);if(m)return X.push(m),{type:"data-science",found:X};let M=eV($,Z);if(M)return X.push(M),{type:"html",found:X};let b=qB($,Z);if(b)return X.push(b),{type:"fullstack",found:X};if(Z?.main&&!Z?.bin)return X.push("package.json main (no bin)"),{type:"library",found:X};return X.push("no classifying signals — fallback"),{type:"library",found:X}}function k5($){if(R(K($,"bunfig.toml")))return"Bun";if(R(K($,"deno.json"))||R(K($,"deno.jsonc")))return"Deno";if(P0($))return"Node.js";if(R(K($,"Cargo.toml")))return"Rust";if(R(K($,"go.mod")))return"Go";if(z2($).length>0)return".NET";if(R(K($,"pubspec.yaml")))return"Dart";return"Unknown"}function u5($){if(R(K($,"pubspec.yaml")))return"pub";if(R(K($,"go.mod")))return"go modules";if(z2($).length>0)return"NuGet";if(R(K($,"pom.xml")))return"maven";if(R(K($,"build.gradle"))||R(K($,"build.gradle.kts"))||R(K($,"settings.gradle"))||R(K($,"settings.gradle.kts")))return"gradle";if(R(K($,"bun.lockb"))||R(K($,"bun.lock")))return"bun";if(R(K($,"pnpm-lock.yaml")))return"pnpm";if(R(K($,"yarn.lock")))return"yarn";if(R(K($,"package-lock.json")))return"npm";return"npm"}function m5($){if(R(K($,".github/workflows")))return"GitHub Actions";if(R(K($,".gitlab-ci.yml")))return"GitLab CI";if(R(K($,".circleci")))return"CircleCI";if(R(K($,"Jenkinsfile")))return"Jenkins";return null}function p5($){if(R(K($,"vercel.json")))return"Vercel";if(R(K($,"netlify.toml")))return"Netlify";if(R(K($,"wrangler.toml")))return"Cloudflare";if(R(K($,"Dockerfile")))return"Docker";if(R(K($,"fly.toml")))return"Fly.io";if(R(K($,"render.yaml")))return"Render";return null}function l5($){let Z=K($,"svelte.config.js");if(!R(Z))return null;try{let X=H0(Z,"utf-8").match(/@sveltejs\/adapter-(\w+)/);if(X){let z=X[1];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}catch{return null}}function d5($){let Z=P0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(R(K($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function U$($){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)=>R(K($,Q)))}function q$($,Z){let Q={};if(Z?.scripts){for(let X of["build","test","lint","dev","start"])if(Z.scripts[X]){let z=R(K($,"bun.lock"))||R(K($,"bun.lockb"))?"bun run":"npm run";Q[X]=`${z} ${X}`}}if(R(K($,"Cargo.toml"))){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint)Q.lint="cargo clippy"}if(R(K($,"build.zig"))){if(!Q.build)Q.build="zig build";if(!Q.test)Q.test="zig build test"}if(R(K($,"go.mod"))){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(R(K($,"pyproject.toml"))||R(K($,"pytest.ini"))){if(!Q.test)Q.test="pytest"}return Q}function c5($,Z,Q,X){let z=[];if(X&&X!=="Unknown")z.push(X);let J=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let H of Q)if(J.has(H.category))z.push(H.name);if(R(K($,"bunfig.toml")))z.push("Bun");else if(R(K($,"deno.json"))||R(K($,"deno.jsonc")))z.push("Deno");if(z.length<3&&Z?.dependencies){let H=Object.keys(Z.dependencies).slice(0,5);for(let U of H)if(!z.some((q)=>q.toLowerCase().includes(U.toLowerCase())))z.push(U)}return z}function e8($){let Z=P0($),Q=J$($),X=f5($),z=X.type,J=X.found.some((g)=>g.startsWith("polyglot:")),H=J&&v5($)||H$($),U=k5($),q=u5($),Y=m5($),G=p5($),V=d5($),B=Q.find((g)=>g.category==="frontend"),_=Q.find((g)=>g.category==="css"),D=Q.find((g)=>g.category==="ui"),W=Q.find((g)=>g.category==="state"),O=Q.find((g)=>g.category==="backend"),I=Q.find((g)=>g.category==="database"),N=k0[z]||k0.library,F=z==="framework",A=Q.some((g)=>g.slug==="svelte"||g.slug==="sveltekit"),w=F&&A?"svelte":F?null:null,T=z==="svelte"||w==="svelte",C=T?l5($):null,L=T&&Q.some((g)=>g.slug==="sveltekit"),S=new Set(["css_framework","ui_library","database","connection","hosting"]),E={},m=f.filter((g)=>g.path.startsWith("stack."));for(let g of m){let y=g.path.replace("stack.","");if(!N.includes(g.category)){E[y]="slotignored";continue}if(F&&S.has(y)){E[y]="slotignored";continue}switch(y){case"frontend":E[y]=B?.name??(z==="cli"?"CLI":"");break;case"css_framework":E[y]=_?.name??"";break;case"ui_library":E[y]=D?.name??"";break;case"state_management":E[y]=T?W?.name??"Runes":W?.name??"";break;case"backend":E[y]=T?L?"SvelteKit":O?.name??"":O?.name??"";break;case"api_type":E[y]=L?"Server Routes":"";break;case"runtime":E[y]=U!=="Unknown"?U:"";break;case"database":E[y]=I?.name??"";break;case"connection":E[y]=I?.name??"";break;case"hosting":if(T&&C)E[y]=C;else E[y]=G??"";break;case"build":E[y]=T?"Vite":V??"";break;case"cicd":E[y]=Y??"";break;case"package_manager":E[y]=q;break;default:E[y]="";break}}let M={},b=f.filter((g)=>g.path.startsWith("monorepo."));for(let g of b){let y=g.path.replace("monorepo.","");if(!N.includes(g.category))M[y]="slotignored";else M[y]=""}let x={name:Z?.name??$.split("/").pop()??"project",goal:J?"":Z?.description??"",main_language:H,type:z};if(F&&w)x.framework=w;let a=c5($,Z,Q,J?H$($):H);if(J){for(let g of z$($))for(let y of[g.language,g.topFramework])if(y&&!a.includes(y))a.push(y)}let G6=U$($),V6=q$($,Z),s2={faf_version:g5,project:x,stack:E,human_context:{who:"",what:J?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:M,_meta:{found:X.found}};if(a.length>0)s2.tech_stack=a;if(G6.length>0)s2.key_files=G6;if(Object.keys(V6).length>0)s2.commands=V6;return s2}import{existsSync as VB,readFileSync as BB}from"fs";import{join as WB}from"path";var i5={MIN_LENGTH:8,MAX_LENGTH:280},GB=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function Z0($){let Z=$.trim();if(Z.length<i5.MIN_LENGTH)return!1;if(Z.length>i5.MAX_LENGTH)return!1;if(GB.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
224
- `).length>4)return!1;return!0}function _B($){let Z=$.split(`
225
- `),Q=0;while(Q<Z.length&&/^(#\s|$)/.test(Z[Q].trim()))Q++;while(Q<Z.length){let X=Z[Q].trim();if(/^\[!\[/.test(X)){Q++;continue}if(/^!\[/.test(X)){Q++;continue}if(/^<img\s/i.test(X)){Q++;continue}if(X===""){Q++;continue}break}return Z.slice(Q).join(`
226
- `)}function OB($){let Q=_B($).split(`
227
- `),X=[];for(let z of Q){let J=z.trim();if(J===""){if(X.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(J))break;if(/^\*\*[^*]+\*\*\s*$/.test(J)&&X.length===0)continue;X.push(J)}if(X.length===0)return null;return X.join(" ").trim()}function f0($,Z){let Q=$.split(`
228
- `),X=0;while(X<Q.length){let J=Q[X].trim().match(/^(#{1,6})\s+(.+)$/);if(J&&Z.test(J[2])){let H=J[1].length,U=[];X++;while(X<Q.length){let q=Q[X].trim(),Y=q.match(/^(#{1,6})\s+/);if(Y&&Y[1].length<=H)break;if(q===""){if(U.length>0)break;X++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(q))break;U.push(q),X++}if(U.length===0)return null;return U.join(" ").trim()}X++}return null}function DB($){let Z=f0($,/^(use\s+cases?|goal)\b/i);if(Z&&Z0(Z))return Z;let Q=OB($);if(Q&&Z0(Q))return Q;return}function IB($){let Z=f0($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&Z0(Z))return Z;return}function KB($){let Z=f0($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&Z0(Z))return Z;return}function LB($){let Z=f0($,/^(why|motivation|problem|rationale)\b/i);if(Z&&Z0(Z))return Z;return}function RB($){let Z=f0($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&Z0(Z))return Z;return}function MB($){let Z=f0($,/^(status|history|timeline|since|launched)\b/i);if(Z&&Z0(Z))return Z;return}function FB($){let Z=f0($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&Z0(Z))return Z;return}function $6($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let _ of Z){let D=WB($,_);if(VB(D)){Q=D;break}}if(!Q)return{};let X;try{X=BB(Q,"utf-8")}catch{return{}}X=X.replace(/<!--[\s\S]*?-->/g,"");let z={},J=DB(X);if(J)z.project={goal:J};let H={},U=IB(X);if(U)H.what=U;let q=KB(X);if(q)H.who=q;let Y=LB(X);if(Y)H.why=Y;let G=RB(X);if(G)H.where=G;let V=MB(X);if(V)H.when=V;let B=FB(X);if(B)H.how=B;if(Object.keys(H).length>0)z.human_context=H;return z}import{existsSync as NB,readFileSync as PB}from"fs";import{join as AB}from"path";function TB($,Z){let Q=$.split(`
229
- `),X=!1;for(let z of Q){let J=z.trim();if(/^\[/.test(J)){X=J==="[package]";continue}if(!X)continue;let H=J.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(H){let U=H[1].trim();U=U.replace(/\s*#.*$/,"").trim();let q=U.match(/^"((?:[^"\\]|\\.)*)"$/)||U.match(/^'((?:[^'\\]|\\.)*)'$/);if(q)return q[1];return U}}return null}function Z6($){let Z=AB($,"Cargo.toml");if(!NB(Z))return{};let Q;try{Q=PB(Z,"utf-8")}catch{return{}}let X=TB(Q,"description");if(X&&Z0(X))return{project:{goal:X}};return{}}import{readFileSync as wB,readdirSync as CB}from"fs";import{join as r5}from"path";var bB=[{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"}],EB=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function jB($){let Z=[],Q=(X,z)=>{let J;try{J=CB(X,{withFileTypes:!0})}catch{return}for(let H of J)if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(r5(X,H.name));else if(H.isDirectory()&&z>0&&!H.name.startsWith(".")&&!EB.has(H.name))Q(r5(X,H.name),z-1)};return Q($,1),Z}function r2($){return[...$].join(" · ")}function Q6($){let Z=jB($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let z of Z){let J;try{J=wB(z,"utf-8")}catch{continue}for(let H of J.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let U=H[1].toLowerCase(),q=U.replace(/:[^/]*$/,"").split("/").pop()??U,Y=U.replace(/:[^/]*$/,"");for(let{re:G,slot:V,label:B}of bB)if(G.test(q)||G.test(Y))Q[V].add(B)}}let X={};if(Q.database.size)X.database=r2(Q.database);if(Q.cache.size)X.cache=r2(Q.cache);if(Q.search.size)X.search=r2(Q.search);if(Q.storage.size)X.storage=r2(Q.storage);if(Q.runtime.size)X.runtime=`Docker Compose (${r2(Q.runtime)})`;if(Object.keys(X).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return X.hosting="Docker Compose",{stack:X}}import{existsSync as Y$,readFileSync as SB,readdirSync as xB}from"fs";import{join as n2}from"path";var gB=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),yB=[{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 X6($,Z){for(let Q of Z){let X=$.find((z)=>Q.test(z));if(X)return X}return null}function hB($){let Z=[$];try{for(let Q of xB($,{withFileTypes:!0}))if(Q.isDirectory()&&!Q.name.startsWith(".")&&!gB.has(Q.name))Z.push(n2($,Q.name))}catch{}return Z}function vB($){let Z=0;if(Y$(n2($,"manage.py"))||Y$(n2($,"pyproject.toml"))||Y$(n2($,"Gemfile")))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function z6($){let Z=[];for(let X of hB($)){let z=X===$,J=z?"":`cd ${X.slice($.length+1)} && `;for(let H of yB){let U=n2(X,H.file);if(!Y$(U))continue;let q;try{q=SB(U,"utf-8")}catch{continue}let Y=H.targets(q);if(Y.length===0)continue;let G={},V=X6(Y,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),B=X6(Y,[/^build$/i,/^compile$/i,/^build/i]),_=X6(Y,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(V)G.test=`${J}${H.runner} ${V}`;if(B)G.build=`${J}${H.runner} ${B}`;if(_)G.lint=`${J}${H.runner} ${_}`;if(Object.keys(G).length===0)continue;Z.push({score:Object.keys(G).length+(z?10:vB(X)),commands:G})}}let Q=Z.sort((X,z)=>z.score-X.score)[0];return Q?{commands:Q.commands}:{}}import{existsSync as fB}from"fs";import{join as kB}from"path";var uB=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function J6($){for(let Z of uB)if(fB(kB($,Z)))return{security:{secrets:".env",example:Z}};return{}}function mB($,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 X of["project","human_context","stack","commands","security"])if(Q[X]&&Object.keys(Q[X]).length===0)delete Q[X];return Q}function H6($){return[$6($),Z6($),Q6($),z6($),J6($)].reduce(mB,{})}function pB($){let Z=e8($),Q=H6($),X={};if(Q.stack)X.stack=Q.stack;if(Q.commands)X.commands=Q.commands;if(Q.security)X.security=Q.security;let z={};if(Q.project)z.project=Q.project;if(Q.human_context)z.human_context=Q.human_context;let J=U0(U0(X,Z),z);dB(J);let U=(Z._meta?.found??[]).some((Y)=>Y.startsWith("polyglot:")),q=U0(J,Z$($));return U0(q,{human_context:Q$($,{toolingRoot:U})})}function lB($,Z){let Q=U0(Z,H6($)),X=U0(Q,e8($)),z=U0(X,Z$($));return U0(z,{human_context:Q$($)})}function dB($){let Z=$.project?.type??"library",Q=k0[Z]||k0.library;for(let X of f){if(Q.includes(X.category))continue;let[z,J]=X.path.split(".");if(z==="stack"&&$.stack)$.stack[J]="slotignored";if(z==="monorepo"&&$.monorepo)$.monorepo[J]="slotignored"}}function U0($,Z){let Q={...$};for(let[X,z]of Object.entries(Z)){let J=Q[X];if(T0(J))Q[X]=z;else if(typeof z==="object"&&z!==null&&!Array.isArray(z)&&typeof J==="object"&&J!==null&&!Array.isArray(J))Q[X]=U0(J,z)}return Q}import{join as XW}from"path";import{readFileSync as sB,existsSync as oB,statSync as lI}from"fs";import{join as $4}from"path";import{readFileSync as cB,writeFileSync as G$,existsSync as iB}from"fs";var U6="<!-- faf:start -->",q6="<!-- faf:end -->",rB="<!-- faf: ";function s5($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,X)=>Z!==""||Q<X.length-1)??[]}var o5=($)=>$.replace(/\r?\n$|\r$/,""),nB=($)=>$.startsWith("```")||$.startsWith("~~~");function n5($,Z,Q,X){let z=0,J=!1,H=-1;for(let U of s5($)){let q=o5(U),Y=z===0&&q.charCodeAt(0)===65279?1:0,G=q.slice(Y),V=G.trimEnd();if(H===-1){if(X&&nB(G.trim()))J=!J;else if(!J&&V===Z)H=z+Y}else if(V===Q)return{start:H,end:z+q.length};z+=U.length}return null}function a5($,Z){return s5($).some((Q)=>o5(Q).replace(/^\uFEFF/,"").trimEnd()===Z)}function t5($,Z=U6,Q=q6){return n5($,Z,Q,!0)??n5($,Z,Q,!1)}function Q0($,Z,Q=U6,X=q6){let z=`${Q}
230
- ${Z.trim()}
231
- ${X}`;if(!iB($)){G$($,`${z}
232
- `,"utf-8");return}let J=cB($,"utf-8"),H=t5(J,Q,X);if(H){G$($,`${J.slice(0,H.start)}${z}${J.slice(H.end)}`,"utf-8");return}if(J.trimStart().startsWith(rB)&&!a5(J,Q)&&!a5(J,X)){G$($,`${z}
233
- `,"utf-8");return}G$($,`${z}
249
+ `}var XK='<meta name="description" content="Visual render of project.faf.';function HK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(XK)&&Z.includes(" by faf"))}function UK($,Z,Q,z="project.faf",X={}){u$(oq($,"project.html"),E4(Z,Q,z),{root:$,format:"html",hasMark:HK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var JK=aq(E4,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as VK}from"path";import{deprecate as GK}from"node:util";var e9="application/vnd.faf+yaml",YK="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",WK=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function Z3($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&WK.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 BK($){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 c2($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:e9,iana:`https://www.iana.org/assignments/media-types/${e9}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function m$($,Z={}){let Q={$schema:YK,name:Z3($),version:String($.project?.version??"0.1.0"),description:BK($)},z=K8($)??$.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":c2($,Z)},Q}var Q3="io.modelcontextprotocol.registry/publisher-provided",$3=4096;function b4($,Z={}){let Q={"one.faf/context":c2($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>$3)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${$3}B cap`);return{[Q3]:Q}}function g4($){return Z3($)}function K8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function qK($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var S4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function z3($){let Z=qK($);return S4(Z)&&S4(Z._meta)&&S4(Z._meta["one.faf/context"])}function KK($,Z,Q={},z={}){let X=m$(Z,Q),H=VK($,"server-card");return u$(H,`${JSON.stringify(X,null,2)}
250
+ `,{root:$,format:"json",hasMark:z3,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function DK($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return B8($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var IK=GK(m$,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as X3,readFileSync as LK}from"fs";import{dirname as _K,join as H3}from"path";import{deprecate as OK}from"node:util";var U3="https://faf.one/context",MK="JSONRPC",J3="1.0",RK=["a2a","mcp","registry","catalog"];function FK($){return x0(LK($,"utf-8"))}function NK($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=H3($,z);if(X3(X))return X}let Q=_K($);if(Q!==$)for(let z of Z){let X=H3(Q,z);if(X3(X))return X}return null}function PK($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function x4($,Z={}){let Q=PK($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:J3}];return[]}function v4($,Z,Q={}){let z=$.agent??{},X=x4($,Q);if(X.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let H=String(z.displayName??$.metadata?.persona??z.name??"").trim(),U=String(z.description??"").trim(),J=String(z.version??"").trim(),V=String(z.vendor??"").trim(),G=String(z.homepage??"").trim();if(!H||!U||!J||!V||!G)throw Error("A2A card needs agent.displayName|name, description, version, vendor, homepage in .fafa");let Y=c2(Z,Q),W=($.capabilities??[]).map((B)=>{let q=String(B.name??"").trim();if(!q)throw Error("A2A skill missing capabilities[].name");let I=Array.isArray(B.tags)?B.tags.map(String):[];return{id:q,name:q,description:String(B.description??"").trim()||q,tags:I}});return{name:H,description:U,supportedInterfaces:X.map((B)=>({url:String(B.location),protocolBinding:MK,protocolVersion:String(B.version??J3)})),provider:{organization:V,url:G},version:J,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[{uri:U3,description:"FAF context provenance — the durable context block (one context, every door).",required:!1,params:Y}]},defaultInputModes:["text/plain","application/json"],defaultOutputModes:["text/plain","application/json"],skills:W}}var AK=OK(v4,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function TK($){let Z=$.agent?.homepage;if(!Z)return"local";try{return new URL(Z).hostname.replace(/^www\./,"")}catch{return"local"}}function CK($,Z){if(Z.a2aCardUrl)return Z.a2aCardUrl;let Q=$.agent?.homepage;if(Q)try{return new URL("/.well-known/agent-card.json",Q).href}catch{}return"/.well-known/agent-card.json"}function wK($,Z,Q={}){let z=TK($),X=$.agent??{},H=String(X.name??"agent"),U=Q.now??Z.generated??new Date().toISOString(),J=[];if(x4($,Q).length>0)J.push({identifier:`urn:air:${z}:a2a:${H}`,displayName:String(X.displayName??X.name??"A2A Agent Card"),type:"application/a2a-agent-card+json",description:"A2A v1.0 Agent Card. Projected from .fafa.",url:CK($,Q),updatedAt:U});let V=jK($,"fafa");if(V)J.push({identifier:`urn:air:${z}:agent:${H}`,displayName:String(X.displayName??X.name??".fafa"),type:"application/vnd.fafa+yaml",description:"FAF agent passport (.fafa).",url:V,updatedAt:U});return J}function jK($,Z){let Q=$.agent?.homepage;if(!Q)return;try{return new URL(`/.well-known/${Z}`,Q).href}catch{return}}function EK($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function SK($,Z){let Q=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]};for(let z of Z){let X=EK(Q.entries,z);if(X>=0)Q.entries[X]={...Q.entries[X],url:z.url,type:z.type,...z.updatedAt?{updatedAt:z.updatedAt}:{}};else Q.entries.push(z)}return Q}function bK($){let Z=$.opts??{},Q=new Set($.targets?.length?$.targets:RK),X={block:c2($.faf,Z)};if(Q.has("mcp"))X.mcp=m$($.faf,Z);if(Q.has("registry")){let H=K8($.faf);X.registry={name:g4($.faf),...H?{title:H}:{},_meta:b4($.faf,Z)}}if(Q.has("a2a")||Q.has("catalog")){if(!$.fafa){if($.targets?.includes("a2a")||$.targets?.includes("catalog"))throw Error("A2A/catalog require a .fafa (agent.fafa). Will not invent an agent.")}}if(Q.has("a2a")&&$.fafa)if(x4($.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 X.a2a=v4($.fafa,$.faf,Z);if(Q.has("catalog")&&$.fafa)X.catalog=wK($.fafa,$.faf,Z);return gK(X),X}function gK($){let Z=JSON.stringify($.block),Q=[];if($.a2a)Q.push(JSON.stringify($.a2a.capabilities.extensions[0].params));if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block")}var y4=["ephemeral","standard","high","critical"],$2=Object.fromEntries(y4.map(($,Z)=>[$,Z])),D8=new Set(["user","feedback","project","reference"]),k4=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),h4=new Set(["facts","sessions","preferences","custom"]),f4={low:"ephemeral",medium:"standard"};import{existsSync as xK}from"fs";import{dirname as q3,resolve as K3}from"path";function q2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function h($){return $===null||$===void 0}function vK($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(h($))return"empty";if(typeof $==="string")return`a string (${JSON.stringify($.length>40?`${$.slice(0,40)}…`:$)})`;return`a ${typeof $}`}var i2=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function yK($){let Z=K3($),Q=k(q3(Z),Z,{read:!0});return{real:Q,text:Q0(Q)}}function V3($,Z,Q,z){let X=K3($),H=k(q3(X),X),U=Q!==void 0&&Q.real===H;if(U&&Q.text===Z)return H;let J;try{J=B0(H)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return H;if(!U&&!z&&J)throw new j("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let V=U?Q.text:z?J:null;return s($,Z,V===void 0?{}:{expect:V})}function n2($){if(h($))return"standard";if(f4[$])return f4[$];if($ in $2)return $;return"standard"}var kK=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function u4($){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(!kK.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:n2(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 d2($){if(h($.id)&&h($.type)&&$.tags.length===0&&$.links.length===0&&h($.timestamp)&&h($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!h($.id))Q.id=$.id;if(!h($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!h($.timestamp))Q.timestamp=$.timestamp;if(!h($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function G3($){let Z=$;return i2($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&i2(Z.extra)&&typeof Z.priority==="string"?Z:u4($)}function hK($){if(typeof $==="string"||i2($)&&"text"in $)return u4($);return null}var Y3=["profile","namepoint","created","last_etched","retention"];class U0{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??q2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(G3):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!h(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||m(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(!xK($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=yK($);return U0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=L4($,Z).toJS();if(!i2(z))throw Error(`soul is not a YAML mapping: ${Z} is ${vK(z)}`);let X=new D3,H=X.pick("memory",z.memory,y)??{},U=new U0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,H)});return(X.pick("memory.facts",H.facts,Array.isArray)??[]).forEach((J,V)=>{let G=hK(J);if(G)U.adopt(G,V)}),U.last_etched=String(z.last_etched??U.created),U._version=h(z.version)?void 0:String(z.version),U._origin={path:Z,real:Q,text:$,base:U.state(),residual:X.residual},U.recordIndex(),U}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!h($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return U0.load($)}toDoc(){let $={facts:this._facts.map(d2),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!h4.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(!k4.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return E$(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")&&m(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&&m(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),G=V3($,V,void 0,z);return this.settle($,V,new Map(this._facts.map((Y,W)=>[Y,W])),G),$}let H=new Map,{text:U}=J8(X.text,(V)=>{H=this.applyTo(V,X,Q)},$),J=V3($,U,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,U,H,J),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,H]of Q)this._factAt.set(X,H);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(d2(Z)))}return{top:Object.fromEntries(Y3.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),H=Z.path;for(let U of Y3)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!m(z.index,X.index)){if(Z.residual.has("index")&&!Q)U0.refuse(Z,"index","replace it");G8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of B3(z.extra,X.extra))G8($,[U],z.extra[U],X.extra[U],H);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...B3(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(m(U,J))continue;if(Z.residual.has("memory"))U0.refuse(Z,"memory",`change memory.${H}`);if(Z.residual.has(`memory.${H}`))U0.refuse(Z,`memory.${H}`,"replace it");G8($,["memory",H],U,J,Z.path)}}sortFacts($){let Z=[],Q=[];for(let z of this._facts){let X=this._factAt.get(z);if(X===void 0){Q.push(z);continue}if(Q.length>0||Z.length>0&&X<=Z[Z.length-1][1])throw Error(`${$.path}: the facts were reordered — faf keeps the order soul.fafm has. Nothing written.`);Z.push([z,X])}return{kept:Z,added:Q}}applyFacts($,Z){let{kept:Q,added:z}=this.sortFacts(Z),X=new Set(Q.map(([,G])=>G)),H=[...Z.base.facts.keys()].filter((G)=>!X.has(G)).sort((G,Y)=>Y-G),U=Q.filter(([G,Y])=>!m(Z.base.facts.get(Y),d2(G))),J=new Map(Q);if(z.length===0&&H.length===0&&U.length===0)return J;for(let G of["memory","memory.facts"])if(Z.residual.has(G))U0.refuse(Z,G,"add facts to it");let V=M9($,["memory","facts"],Z.path);for(let[G,Y]of U)V.items[Y]=uK($,V.items[Y],Z.base.facts.get(Y),d2(G));for(let G of H)V.items.splice(G,1);for(let[G,Y]of Q)J.set(G,Y-H.filter((W)=>W<Y).length);for(let G of z)J.set(G,V.items.length),V.items.push($.createNode(d2(G)));return J}add($){let Z=G3($);if(!h(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),!h(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=h(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(fK(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:n2(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:q2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=i2($)?{...$,...Z}:Z,z=i2($)?$.query:$,X=$2[n2(Q.minPriority??"ephemeral")]??0,H=typeof z==="string"?z.toLowerCase():"",U=new Set(Q.tags??[]),J=[];this._facts.forEach((G,Y)=>{if(H&&!String(G.text??"").toLowerCase().includes(H))return;if(U.size>0&&![...U].some((W)=>(G.tags??[]).includes(W)))return;if(!h(Q.type)&&G.type!==Q.type)return;if(($2[G.priority]??1)<X)return;J.push([Y,G])}),J.sort((G,Y)=>{let W=$2[G[1].priority]??1,B=$2[Y[1].priority]??1;if(B!==W)return B-W;let q=G[1].timestamp??"",I=Y[1].timestamp??"";if(I!==q)return I<q?-1:I>q?1:0;return Y[0]-G[0]});let V=J.map(([,G])=>G);if(!h(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(!h(Q.id))this._byId.set(Q.id,z)}),!0}}function fK($,Z,Q){let z=(X,H)=>h(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:h(Q.priority)?$.priority:n2(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:q2(),extra:{...$.extra}}}class D3{residual=new Map;pick($,Z,Q){if(h(Z))return;if(Q(Z))return Z;this.residual.set($,b$(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,y)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,y)??{}),extra:W3($,k4),memoryExtra:W3(Z,h4)}}}function W3($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function B3($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function uK($,Z,Q,z){if(!u(Z))return k$($,Z,Q,z);let X=(H)=>typeof H==="string"?{text:H}:H;return k$($,Z,X(Q),X(z))}import{readdirSync as mK,readFileSync as pK,statSync as I3,existsSync as lK}from"fs";import{join as cK,basename as L3,resolve as dK}from"path";var _3=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),iK=/\[\[([^\]]+)\]\]/g;function nK($){let Z=I3($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function rK($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=x0(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 sK($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!D8.has(X))return null;let H=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||H,V={};if(z.originSessionId)V.provenance=[`session:${z.originSessionId}`];let G=[...new Set([...Z.matchAll(iK)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:G,timestamp:nK($),source:`claude-code memory: ${L3($)}`,extra:V}}function O3($,Z={}){let Q=dK($);if(!lK(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!I3(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??_3,X=Z.namepoint??`@claude-code:${L3(Q)}`,H=[],U=mK(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=cK(Q,W),q;try{q=pK(B,"utf-8")}catch{continue}let{fm:I,body:K}=rK(q);if(!I)continue;let D=sK(B,K,I);if(D)H.push(D)}let J=H.map((W)=>W.timestamp).filter(Boolean),V=J.length?J.reduce((W,B)=>W<B?W:B):q2(),G=J.length?J.reduce((W,B)=>W>B?W:B):V,Y=new U0(X,{profile:"knowledge",facts:H,created:V});return Y.last_etched=G,Y.rebuildIndex(),Y}var P3="faf-interview/1",r2="(terse — 3-4 words)",m4=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${r2}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${r2}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${r2}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${r2}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${r2}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${r2}`,header:"How",type:"text",required:!0}],A3=[{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}],s2=[...m4,...A3],T3=new Map(s2.map(($)=>[$.path,$])),oK=Object.fromEntries(s2.map(($)=>[$.path,$]));function p4($){let Z=T3.get($);if(Z)return Z.question;let Q=w0.get($)??f.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function aK($,Z){return s2.filter((Q)=>{let z=Q.path.split("."),X=$;for(let H of z)if(X&&typeof X==="object"&&H in X)X=X[H];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var tK=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"]),eK=[["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]],M3=($)=>tK.has($.toLowerCase().trim()),$D=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function R3($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&$D.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function C3($){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=R3(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!M3(X))Z.what=X;let H=eK.filter(([,V])=>V.test(Q)).map(([V])=>V);if(H.length)Z.where=H.slice(0,4).join(", ");let U=Q.match(/\bfor ((?:[A-Za-z][\w./+-]* )?(?:any |all )?(?:developers?|teams?|engineers?|builders?|users?|integrators?)\b[^.,;:—]*)/i),J=R3((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!M3(J))Z.who=J;return Z}function F3($,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 N3($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!n(Z)}function ZD($,Z={}){let Q=$&&typeof $==="object"?$:{},z=F3(Q,"project.goal"),X=(N3(z)?String(z).trim():"")||(Z.goal??"").trim(),H=C3(X),U=Z.detailed??{},J={"project.goal":X||void 0,"human_context.what":H.what,"human_context.where":H.where,"human_context.who":H.who},V=(q)=>{let I=J[q];if(I)return{value:I,source:"project goal",confidence:0.9};let K=q.startsWith("human_context.")?q.slice(14):"",D=K?U[K]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},G=m4.map((q,I)=>{let K={n:I+1,path:q.path,header:q.header,question:q.question},D=F3(Q,q.path);if(N3(D))return{...K,value:String(D).trim(),status:"filled",seeded:!1};let L=V(q.path);if(L)return{...K,value:L.value,status:"seeded",seeded:!0,source:L.source,confidence:L.confidence};return{...K,value:"",status:"empty",seeded:!1}}),Y=G.filter((q)=>q.status==="filled").length,W=G.filter((q)=>q.status==="seeded").length,B=G.filter((q)=>q.status==="empty").length;return{version:P3,rows:G,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function I8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||n(Z)}return!1}function QD($,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 w3($){if($==="project.goal")return!0;return w0.get($)?.category==="human"}function j3($,Z=I8){let Q=[],z=[];for(let X of s2){let H=QD($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(w3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function E3($,Z,Q=I8){let z=j3(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let H=X==="needs-human"?l4(z):[];return{status:X,score:$,gaps:z,ask:H}}function l4($){return $.human.map((Z)=>({path:Z,question:p4(Z)}))}function zD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??I8,X=[],H=0;for(let J=0;J<=Q;J++){let V=$.read();if(!V)return{status:"no-faf",score:0,rounds:H,history:X,ask:[]};let G=$.score(V.yaml);X.push(G);let Y=E3(G,V.data,z);if(Y.status==="done")return{status:"done",score:G,rounds:H,history:X,ask:[]};if(Y.status==="needs-human")return{status:"needs-human",score:G,rounds:H,history:X,ask:Y.ask};if(X.length>=2&&G<=X[X.length-2])return Y.gaps.human.length?{status:"needs-human",score:G,rounds:H,history:X,ask:l4(Y.gaps)}:{status:"stuck",score:G,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:G,rounds:H,history:X,ask:l4(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as b3}from"crypto";var c4="faf-bench/1",XD={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function HD($,Z){return XD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var g3=[["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"]],p$=new Map;g3.forEach(($,Z)=>$.forEach((Q)=>p$.set(Q,Z)));var UD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function L8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function S3($){return L8($).split(" ").filter((Z)=>Z&&!UD.has(Z))}function x3($,Z){let Q=L8($),z=L8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=p$.get(Q);if(X!==void 0&&p$.get(z)===X)return!0;let H=S3($);if(H.length===0)return!1;let U=new Set(S3(Z));return H.every((J)=>{if(U.has(J))return!0;let V=p$.get(J);return V!==void 0&&[...U].some((G)=>p$.get(G)===V)})}function JD($){let Z=o8($),Q=x0($),z=[],X={},H=0;for(let V of f){if(Z.slots[V.path]!=="populated")continue;let G=N5(Q,V);if(typeof G!=="string")continue;let Y=G.trim();if(!Y||J6.has(Y.toLowerCase()))continue;H+=1,z.push({n:H,path:V.path,question:HD(V.path,V.description)}),X[H]=Y}let U=JSON.stringify({v:c4,q:z.map((V)=>[V.path,V.question])}),J=b3("sha256").update(U).digest("hex").slice(0,12);return{version:c4,qsetHash:J,questions:z,answers:X}}function VD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function GD($,Z){let Q=$.questions.map((X)=>{let H=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof H==="string"&&H.trim()!==""&&x3($.answers[X.n],H)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function YD($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:b3("sha256").update(Q).digest("hex")}}import{readdirSync as a3,readFileSync as nI,statSync as t3}from"fs";import{join as T8,extname as rI,resolve as sI}from"path";var d4={"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{existsSync as v3,readFileSync as BD,readdirSync as qD}from"fs";import{join as i4}from"path";var o2={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 KD=o2.flutterDeps,DD=o2.mcpDeps,ID=o2.serverFrameworks,LD=o2.stateManagement,_D=o2.routing;function OD($){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 _8($){let Z=i4($,"pubspec.yaml");if(!v3(Z))return null;let Q;try{Q=BD(Z,"utf-8")}catch{return null}let z=OD(Q),X=(N)=>z.has(N.toLowerCase()),H=KD.some(X)||/^flutter:\s*$/m.test(Q)||/\bsdk:\s*flutter\b/.test(Q),U=DD.find(X),J=ID.find(([N])=>X(N)),V=LD.find(([N])=>X(N)),G=V?V[1]:"",Y=_D.find(([N])=>X(N)),W=Y?Y[1]:"",B=X("flutter_test")?"flutter_test":X("test")?"test":"",q=/^executables:\s*$/m.test(Q),I=!1;try{I=qD(i4($,"bin")).some((N)=>N.endsWith(".dart"))}catch{}let K=q||I,D,L="",F;if(H)if(L="Flutter",v3(i4($,"lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Q))D="mobile",F="pubspec.yaml (Flutter app)";else D="library",F="pubspec.yaml (Flutter package)";else if(U)D="mcp",F=`pubspec.yaml + ${U} (Dart MCP server)`;else if(J)D="backend",L=J[1],F=`pubspec.yaml + ${J[0]} (Dart backend)`;else if(K)D="cli",F=q?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else D="library",F="pubspec.yaml (Dart package)";return{appType:D,isFlutter:H,framework:L,stateManagement:G,routing:W,testing:B,found:F}}import{existsSync as n4,readFileSync as h3,readdirSync as y3,statSync as RD}from"fs";import{join as M8}from"path";var O8={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 FD=O8.mcpModules,ND=O8.serverFrameworks,PD=O8.cliFrameworks;function AD($){let Z=new Set,Q=!1;for(let z of $.split(`
252
+ `)){let X=z.replace(/\/\/.*$/,"").trim();if(!X)continue;if(/^require\s*\(\s*$/.test(X)){Q=!0;continue}if(Q){if(X===")"){Q=!1;continue}let U=X.match(/^(\S+)/);if(U)Z.add(U[1].toLowerCase());continue}let H=X.match(/^require\s+(\S+)/);if(H&&H[1]!=="(")Z.add(H[1].toLowerCase())}return Z}function f3($,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(!f3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function TD($,Z){let Q;for(let z of Z){if(!f3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function CD($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function wD($){let Z=M8($,"cmd");if(!n4(Z))return!1;try{for(let Q of y3(Z)){let z=M8(Z,Q);try{if(RD(z).isDirectory()){if(y3(z).some((H)=>H.endsWith(".go")))return!0}else if(Q.endsWith(".go"))return!0}catch{}}}catch{}return!1}function jD($){let Z=M8($,"main.go");if(!n4(Z))return!1;try{let Q=h3(Z,"utf-8");return/^package\s+main\b/m.test(Q)}catch{return!1}}function R8($){let Z=M8($,"go.mod");if(!n4(Z))return null;let Q;try{Q=h3(Z,"utf-8")}catch{return null}let z=CD(Q),X=AD(Q),H=TD(X,FD),U=k3(X,ND),J=k3(X,PD),V=wD($),G=jD($),Y,W="",B;if(H)Y="mcp",B=`go.mod + ${H} (Go MCP server)`;else if(U)Y="backend",W=U[1],B=`go.mod + ${U[0]} (Go backend)`;else if(J)Y="cli",W=J[1],B=`go.mod + ${J[0]} (Go CLI)`;else if(V)Y="cli",B="go.mod + cmd/ (Go CLI layout)";else if(G&&!U)Y="cli",B="go.mod + main.go package main (Go CLI)";else Y="library",B="go.mod (Go module)";return{appType:Y,modulePath:z,framework:W,found:B}}import{existsSync as SD,readFileSync as bD,readdirSync as gD}from"fs";import{join as xD}from"path";var K2={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 vD=K2.mcpPackages.map(($)=>$.toLowerCase()),yD=K2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),kD=K2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),hD=K2.grpcServerPackages.map(($)=>$.toLowerCase()),fD=K2.specializedSdks,u3=K2.baseSdk.toLowerCase();function uD($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),H=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],J=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||H||"").trim(),V=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),G=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),Y=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),B=new Set;for(let I of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(I[1].toLowerCase());for(let I of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(I[1].toLowerCase());let q=new Set;for(let I of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))q.add(I[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:J,isTestProject:V,useMaui:G,useWpf:Y,useWindowsForms:W,packages:B,frameworkRefs:q}}function r4($,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(!r4($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function mD($){let Z;for(let Q of vD){if(!r4($,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 pD($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of fD){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 lD($,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 cD($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:H,outputType:U}=$,J,V="",G,Y=mD(X),W=pD(z),B=m3(X,kD),q=m3(X,yD),I=hD.some((D)=>r4(X,D)),K=H.has("microsoft.aspnetcore.app");if(Y)J="mcp",V="MCP",G=`${Z} + ${Y} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||B)J="library",V=B?.[1]||(W?.[1]==="test"?W[2]:"Test"),G=`${Z} + test (${V})`;else if($.useMaui)J="mobile",V="MAUI",G=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)J="backend",V=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",G=`${Z} + ${V}`;else if(W?.[1]==="web")J="backend",V=I?"gRPC":W[2],G=`${Z} + Sdk=${W[0]}${I?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")J="backend",V=W[2],G=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")J="backend",V=W[2],G=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")J="backend",V=W[2],G=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")J="library",V=W[2],G=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(K&&F8(U))J="backend",V="ASP.NET Core",G=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(K&&!F8(U))J="library",V="ASP.NET Core",G=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(q&&(F8(U)||!U))J="cli",V=q[1],G=`${Z} + ${q[0]} (C# CLI)`;else if(F8(U))J="cli",G=`${Z} + OutputType=Exe (C# console)`;else{J="library";let D=z?` Sdk=${z}`:"";if(G=`${Z}${D} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===u3||z.toLowerCase().startsWith(`${u3}/`))G=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:V,found:G}}function a2($){if(!SD($))return[];try{return gD($).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}catch{return[]}}function N8($){let Z=a2($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let H=xD($,X),U;try{U=bD(H,"utf-8")}catch{continue}let J=uD(U),V=cD(J,X),G=lD(V.appType,V.framework);if(!Q||G<z)Q=V,z=G}return Q}import{existsSync as D2,readFileSync as iD,readdirSync as nD,statSync as rD}from"fs";import{join as J0}from"path";var K0={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 sD=K0.mcpArtifacts.map(($)=>$.toLowerCase()),oD=K0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),aD=K0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),tD=K0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),nN=K0.androidPlugins.map(($)=>$.toLowerCase()),eD=K0.kmpPlugins.map(($)=>$.toLowerCase()),$I=K0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),ZI=K0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),QI=K0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),zI=K0.libraryPlugins.map(($)=>$.toLowerCase()),XI=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function s4($){return XI.some((Z)=>D2(J0($,Z)))}function c$($){try{return iD($,"utf-8")}catch{return null}}function HI($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
253
+ `)){let H=X.replace(/#.*$/,"").trim();if(!H)continue;let U=H.match(/^\[([^\]]+)\]$/);if(U){z=U[1].trim().toLowerCase();continue}let J=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(J&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(J[1].replace(/-/g,".").toLowerCase(),J[2].toLowerCase()),Z.set(J[1].toLowerCase(),J[2].toLowerCase());continue}let V=H.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 G=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(G&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${G[2]}:${G[3]}`.toLowerCase(),B=G[1].toLowerCase();Q.set(B,W),Q.set(B.replace(/-/g,"."),W);continue}let Y=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(Y){let W=Y[1].toLowerCase(),B=Y[2];if(z==="plugins"||z.endsWith(".plugins")){let q=B.split(":")[0].toLowerCase();Z.set(W,q),Z.set(W.replace(/-/g,"."),q)}else if(z==="libraries"||z.endsWith(".libraries")){let q=B.split(":");if(q.length>=2){let I=`${q[0]}:${q[1]}`.toLowerCase();Q.set(W,I),Q.set(W.replace(/-/g,"."),I)}}}}return{plugins:Z,libraries:Q}}function UI($){let Z=J0($,"gradle","libs.versions.toml");if(!D2(Z))return{plugins:new Map,libraries:new Map};let Q=c$(Z);if(!Q)return{plugins:new Map,libraries:new Map};return HI(Q)}function JI($){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 VI($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let H=X.replace(/\/\/.*$/,"").trim();if(!H||H.startsWith("id")||H.startsWith("kotlin")||H.startsWith("alias"))continue;let U=H.match(/^`([a-zA-Z0-9.-]+)`$/)||H.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(U)Q.add(U[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),H=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(H)Q.add(H);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function GI($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let H=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let U of H){let J=Z.libraries.get(U);if(J){Q.add(J.includes(":")?J.split(":").slice(0,2).join(":"):J);break}}}return Q}function c3($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,z=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(z){let U=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),J=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(U&&J)Q.add(`${U}:${J}`.toLowerCase())}let X=new Set;for(let U of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let J=U[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),V=U[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&V)X.add(`${J}:${V}`.toLowerCase())}let H=[];for(let U of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))H.push(U[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:H}}function y0($,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 l$($,Z,Q){let z;for(let[X,H]of Z){let U=!1;if(Q==="plugin")U=y0($,X);else if(U=$.has(X)||[...$].some((J)=>J===X||J.startsWith(`${X}:`)||J.startsWith(`${X}.`)),!U&&Q==="artifact")U=[...$].some((J)=>J===X||J.startsWith(`${X}`));if(!U)continue;if(!z||X.length>z[0].length)z=[X,H]}return z}function YI($){let Z;for(let Q of sD)for(let z of $){if(z===Q||z.startsWith(`${Q}:`)||z.startsWith(Q.replace(/:mcp$/,":"))){if(!Z||Q.length>Z.length)Z=Q}if(z.startsWith("io.modelcontextprotocol")||z.includes("spring-ai-starter-mcp")||z.includes("spring-ai-mcp")){if(!Z||z.length>Z.length)Z=z}}return Z}function d3($){let Z=new Set,Q=!1,z=!1,X=[J0($,"src"),J0($,"src","main")],H=(U,J)=>{if(J>4||!D2(U))return;let V;try{V=nD(U)}catch{return}for(let G of V){if(G==="androidMain"||G==="commonMain"||G==="jvmMain"||G==="iosMain")Z.add(G);let Y=J0(U,G);try{if(rD(Y).isDirectory())H(Y,J+1);else if(G.endsWith(".kt")||G.endsWith(".kts"))Q=!0;else if(G.endsWith(".java"))z=!0}catch{}}};for(let U of X)H(U,0);return{kotlin:Q,java:z,hints:Z}}function WI($){let Z=[],Q=$.plugins,z=$.artifacts,X=eD.some((A)=>y0(Q,A))||$.sourceHints.has("commonMain"),H=y0(Q,"com.android.application"),U=y0(Q,"com.android.library")||y0(Q,"com.android.kotlin.multiplatform.library");if(H||U)Z.push("android");if(X)Z.push("multiplatform");let J=YI(z),V=l$(Q,oD,"plugin"),G=l$($.parents,aD,"parent"),Y=l$(z,tD,"artifact"),W=l$(Q,ZI,"plugin"),B=l$(z,QI,"artifact"),q=zI.some((A)=>y0(Q,A)),I=$.packaging==="pom",K,D="",L;if(H)K="mobile",D=X?"Android+KMP":"Android",L=`${$.path||"root"} + com.android.application (${D})`;else if(J)K="mcp",D="MCP",Z.push("mcp"),L=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(V||G||Y){K="backend",D=V?.[1]||G?.[1]||Y?.[1]||"JVM";let A=V?.[0]||G?.[0]||Y?.[0]||"web";L=`${$.path||"root"} + ${A} (JVM backend)`}else if(X&&!U)K="library",D="Kotlin Multiplatform",L=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(U)K="library",D=X?"Android+KMP":"Android",L=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)K="cli",D=B?.[1]||"application",L=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!q)K="cli",D="application",L=`${$.path||"root"} + application plugin (JVM CLI)`;else if(I)K="library",L=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{K="library";let A=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(L=`${$.path||"root"} (${A} library)`,q)L=`${$.path||"root"} + java-library (JVM library)`}let F="Java";if($.kotlinSources&&$.javaSources)F="Java/Kotlin";else if($.kotlinSources||$I.some((A)=>y0(Q,A))||X)F="Kotlin";let N=[...new Set(Z)];return{appType:K,framework:D,facets:N,found:L,buildTool:$.buildTool,mainLanguage:F}}function BI($,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 p3($,Z,Q){let z=Z?J0($,Z):$,X=J0(z,"build.gradle.kts"),H=J0(z,"build.gradle"),U=D2(X)?X:D2(H)?H:null;if(!U)return null;let J=c$(U);if(!J)return null;let V=VI(J,Q),G=GI(J,Q),Y=d3(z),W=/mainClass\s*[.=]/.test(J)||/mainClassName\s*=/.test(J)||/Main-Class/.test(J),B=y0(V,"application")||y0(V,"org.gradle.application");return{path:Z||"build.gradle",plugins:V,artifacts:G,packaging:"jar",parents:new Set,hasMainClass:W,hasApplicationPlugin:B,sourceHints:Y.hints,kotlinSources:Y.kotlin||U.endsWith(".kts"),javaSources:Y.java,buildTool:"gradle"}}function l3($,Z){let Q=Z?J0($,Z):$,z=J0(Q,"pom.xml");if(!D2(z))return null;let X=c$(z);if(!X)return null;let{packaging:H,parents:U,artifacts:J}=c3(X),V=d3(Q);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:J,packaging:H,parents:U,hasMainClass:/<mainClass>/.test(X),hasApplicationPlugin:!1,sourceHints:V.hints,kotlinSources:V.kotlin,javaSources:V.java,buildTool:"maven"}}function d$($){if(!s4($))return null;let Z=UI($),Q=[],z=null;for(let G of["settings.gradle.kts","settings.gradle"]){let Y=J0($,G);if(D2(Y)){z=c$(Y);break}}let X=z?JI(z):[],H=p3($,"",Z);if(H)Q.push(H);for(let G of X){let Y=p3($,G,Z);if(Y)Q.push(Y)}let U=l3($,"");if(U){Q.push(U);let G=c$(J0($,"pom.xml"));if(G){let{modules:Y}=c3(G);for(let W of Y){let B=l3($,W);if(B)Q.push(B)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let J=null,V=999;for(let G of Q){let Y=WI(G),W=BI(Y.appType,Y.facets);if(!J||W<V)J={appType:Y.appType,framework:Y.framework,buildTool:Y.buildTool,mainLanguage:Y.mainLanguage,facets:Y.facets,found:Y.found},V=W}if(J&&X.length>0&&!J.found.includes("multi-project"));return J}import{existsSync as r$,readFileSync as KI,readdirSync as P8,statSync as DI}from"fs";import{join as D0}from"path";var i$={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 II=i$.mcpGems.map(($)=>$.toLowerCase()),LI=i$.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),i3=i$.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),_I=i$.railsLayoutFiles;function OI($){return r$(D0($,"Gemfile"))||r$(D0($,"gems.rb"))||MI($)}function MI($){try{return P8($).some((Z)=>Z.endsWith(".gemspec"))}catch{return!1}}function n$($){try{return KI($,"utf-8")}catch{return null}}function RI($){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 FI($){let Z=new Set,Q=!1;for(let z of $.split(`
255
+ `)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let H=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(H)Z.add(H[1].toLowerCase())}}return Z}function NI($){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 PI($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let H=D0($,X),U=n$(H);if(U){for(let J of RI(U))Z.add(J);Q.push(X)}}let z=n$(D0($,"Gemfile.lock"))||n$(D0($,"gems.locked"));if(z){for(let X of FI(z))Z.add(X);Q.push("Gemfile.lock")}try{for(let X of P8($)){if(!X.endsWith(".gemspec"))continue;let H=n$(D0($,X));if(H){for(let U of NI(H))Z.add(U);Q.push(X)}}}catch{}return{gems:Z,sources:Q}}function s$($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function o4($,Z){let Q;for(let[z,X]of Z){if(!s$($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function AI($){let Z;for(let Q of II)if(s$($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function n3($){for(let Z of _I)if(r$(D0($,Z)))return Z;return}function TI($,Z){let Q=o4(Z,i3);if(Q)return{hit:!0,why:Q[0]};try{for(let X of P8($)){if(!X.endsWith(".gemspec"))continue;let H=n$(D0($,X));if(H&&/executables\s*=/.test(H)&&!/executables\s*=\s*\[\s*\]/.test(H))return{hit:!0,why:`${X} executables`}}}catch{}let z=D0($,"bin");if(r$(z))try{let H=P8(z).filter((U)=>{if(U==="setup"||U==="console"||U==="rake")return!1;try{return DI(D0(z,U)).isFile()}catch{return!1}}).filter((U)=>U!=="rails");if(H.length>0&&!s$(Z,"rails")&&!n3($))return{hit:!0,why:`bin/${H[0]}`}}catch{}return{hit:!1,why:""}}function A8($){if(!OI($))return null;let{gems:Z,sources:Q}=PI($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",H=AI(Z),U=o4(Z,LI),J=n3($),V=s$(Z,"rails")||s$(Z,"railties"),G=TI($,Z),Y=r$(D0($,"config.ru")),W=V||!!J,B=U&&U[1]!=="Rails"&&!(U[0]==="rack"&&!Y)?U:void 0,q,I="",K;if(H)q="mcp",I="MCP",K=`${z} + gem ${H} (Ruby MCP)`;else if(W)if(q="backend",I="Rails",V&&J)K=`${z} + rails + ${J} (Rails)`;else if(V)K=`${z} + gem rails (Rails)`;else K=`${J} (Rails layout)`;else if(B)q="backend",I=B[1],K=`${z} + gem ${B[0]} (Ruby backend)`;else if(G.hit)q="cli",I=o4(Z,i3)?.[1]||"",K=`${z} + ${G.why} (Ruby CLI)`;else q="library",K=`${z} (Ruby library)`;return{appType:q,framework:I,packageManager:X,found:K}}import{existsSync as a4,readFileSync as wI,readdirSync as jI,statSync as EI}from"fs";import{join as o$}from"path";var P0={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 SI=P0.mcpPackageUrls.map(($)=>$.toLowerCase()),bI=P0.mcpProducts.map(($)=>$.toLowerCase()),gI=P0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),xI=P0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),vI=P0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),yI=P0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),kI=P0.appProductTypes,hI=P0.cliProductTypes,fI=P0.vaporLayoutFiles;function uI($){return a4(o$($,"Package.swift"))||t4($).length>0}function t4($){try{return jI($).filter((Z)=>{if(!Z.endsWith(".xcodeproj"))return!1;try{return EI(o$($,Z)).isDirectory()}catch{return!1}})}catch{return[]}}function o3($){try{return wI($,"utf-8")}catch{return null}}function mI($){let Z=pI($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,H;while((H=X.exec(Z))!==null)z.push(H[1]);let U=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((H=U.exec(Z))!==null)z.push(H[1]);let J=[],V=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((H=V.exec(Z))!==null)J.push(H[1]);let G=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((H=G.exec(Z))!==null)J.push(H[1]);let Y=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),B=/\.plugin\s*\(/.test(Q)&&!Y&&!W?!0:/\bproducts\s*:\s*\[[\s\S]*?\.plugin\s*\(/.test(Q),q=/\.executabletarget\s*\(/.test(Q),I=/\.target\s*\(/.test(Q)&&!q?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:z,productNames:J,hasLibraryProduct:Y,hasExecutableProduct:W,hasPluginProduct:!!B,hasExecutableTarget:q,hasLibraryTarget:I}}function pI($){let Z="",Q=0;while(Q<$.length){if($[Q]==='"'||$[Q]==="'"){let z=$[Q];Z+=z,Q++;while(Q<$.length){if($[Q]==="\\"&&Q+1<$.length){Z+=$[Q]+$[Q+1],Q+=2;continue}if(Z+=$[Q],$[Q]===z){Q++;break}Q++}continue}if($[Q]==="/"&&$[Q+1]==="/"){Q+=2;while(Q<$.length&&$[Q]!==`
257
+ `)Q++;continue}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<$.length&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;Q+=2;continue}Z+=$[Q],Q++}return Z}function lI($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let H of Q)if(H.includes(X)&&(!z||X.length>z.length))z=X;return z}function r3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,H]of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z[0].length))z=[X,H];return z}function s3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,H]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,H];return z}function cI($){let Z=$.map((Q)=>Q.toLowerCase());return bI.some((Q)=>Z.includes(Q))}function dI($){let Z=!1,Q=!1,z;for(let X of t4($)){let H=o$($,X,"project.pbxproj"),U=o3(H);if(!U)continue;for(let J of kI)if(U.includes(J))Z=!0,z=J;for(let J of hI)if(U.includes(J)){if(Q=!0,!z)z=J}}return{hasApplication:Z,hasTool:Q,hit:z}}function iI($){for(let Z of fI)if(a4(o$($,Z)))return Z;return}function a$($){if(!uI($))return null;let Z=o$($,"Package.swift"),Q=a4(Z),z=t4($),X=z.length>0,H=null;if(Q){let w=o3(Z);if(w)H=mI(w)}let U=X?dI($):{hasApplication:!1,hasTool:!1},J=iI($),V=H?.packageUrls??[],G=H?.productNames??[],Y=lI(V,SI),W=cI(G),B=r3(V,gI),q=s3(G,xI),I=r3(V,vI),K=s3(G,yI),D=!!(Y||W),L=!!(B||q||J),F=!!(H?.hasExecutableProduct||H?.hasExecutableTarget),N=!!(I||K),A=U.hasApplication,C=Q&&X?"spm+xcode":Q?"spm":"xcode",T,E="",_;if(D)if(T="mcp",E="MCP",W)_="Package.swift + product MCP (Swift MCP)";else _=`Package.swift + ${Y} (Swift MCP)`;else if(L)if(T="backend",E=q?.[1]||B?.[1]||(J?"Vapor":""),q)_=`Package.swift + product ${q[1]} (Swift backend)`;else if(B)_=`Package.swift + ${B[1]} (Swift backend)`;else _=`${J} (Swift backend layout)`;else if(A)T="app",E="",_=`${z[0]} + ${U.hit||"application"} (Swift app)`;else if(N||F&&!L&&!D)if(T="cli",E=K?.[1]||I?.[1]||"",K)_=`Package.swift + product ${K[1]} (Swift CLI)`;else if(I)_=`Package.swift + ${I[1]} (Swift CLI)`;else if(H?.hasExecutableProduct)_="Package.swift + .executable product (Swift CLI)";else _="Package.swift + .executableTarget (Swift CLI)";else if(U.hasTool&&!Q)T="cli",_=`${z[0]} + tool productType (Swift CLI)`;else if(Q)if(T="library",H?.hasLibraryProduct)_="Package.swift + .library product (Swift library)";else _="Package.swift (Swift library)";else T="library",_=`${z[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:T,framework:E,packageManager:C,found:_}}var oI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),aI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),tI={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"]},eI=[["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 $L($,Z){for(let[Q,z]of eI)if(Q in $)return z;return Z.length>0?"framework":"config"}function ZL($){try{let Z=JSON.parse(nI($,"utf-8")),Q=["background","content_scripts","action","browser_action","permissions"].some((z)=>(z in Z));if(typeof Z.manifest_version==="number"&&Q)return"chrome";return"other"}catch{return"other"}}function QL($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;try{return t3(T8($,Z.name)).isFile()}catch{return!1}}function zL($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;try{return t3(T8($,Z.name)).isDirectory()}catch{return!1}}function XL($){let Z=[],Q=sI($),z=new Set,X;try{X=a3(Q,{withFileTypes:!0})}catch{return Z}for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!zL(Q,H):!QL(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let V=N8(Q);if(V){let G={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="mobile"&&V.framework)G.framework=V.framework;if(V.targetFramework)G.runtime=V.targetFramework;let Y=V.framework?[V.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:G,priority:36,frameworks:Y,fileName:U})}continue}if(U.endsWith(".xcodeproj")){let V=a$(Q);if(V){let G={mainLanguage:"Swift",packageManager:V.packageManager==="spm"?"spm":"Xcode",buildTool:V.packageManager.includes("spm")?"swift build":"xcodebuild"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="app"&&V.framework)G.framework=V.framework;let Y=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:G,priority:36,frameworks:Y,fileName:U})}continue}let J=d4[U];if(!J)continue;if(U==="manifest.json"&&ZL(T8(Q,U))!=="chrome")continue;if(U==="pubspec.yaml"){let V=_8(Q);if(V){let G={mainLanguage:"Dart",packageManager:"pub"};if(V.isFlutter){if(G.framework="Flutter",V.stateManagement)G.stateManagement=V.stateManagement}else if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="mcp")G.apiType="MCP";Z.push({slots:G,priority:J.priority,frameworks:V.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}if(U==="go.mod"){let V=R8(Q);if(V){let G={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";let Y=V.framework?[V.framework,"Go"]:["Go"];Z.push({slots:G,priority:J.priority,frameworks:Y,fileName:U});continue}}if(U==="Gemfile"||U==="Gemfile.lock"||U==="gems.rb"){let V=A8(Q);if(V){let G={mainLanguage:"Ruby",packageManager:V.packageManager};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";let Y=V.framework?[V.framework,"Ruby"]:["Ruby"];Z.push({slots:G,priority:J.priority??35,frameworks:Y,fileName:U});continue}}if(U==="Package.swift"){let V=a$(Q);if(V){let G={mainLanguage:"Swift",packageManager:V.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="app"&&V.framework)G.framework=V.framework;let Y=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:G,priority:J.priority??36,frameworks:Y,fileName:U});continue}}if(U==="pom.xml"||U==="build.gradle"||U==="build.gradle.kts"||U==="settings.gradle"||U==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let V=d$(Q);if(V){let G={mainLanguage:V.mainLanguage==="Java/Kotlin"?"Kotlin":V.mainLanguage,packageManager:V.buildTool==="maven"?"maven":"gradle",buildTool:V.buildTool};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="mobile")G.framework=V.framework||"Android";if(V.facets.includes("multiplatform"))G.framework=V.framework||"Kotlin Multiplatform";let Y=V.framework?[V.framework,"JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:G,priority:J.priority??35,frameworks:Y,fileName:U});continue}}Z.push({slots:J.slots||{},priority:J.priority,frameworks:J.frameworks,fileName:U})}return Z}function HL($){let Z=[];for(let Q of $Q($,2,{count:0})){let z=d4[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function e3($){let Z=[...XL($),...HL($)],Q={},z={},X=new Set;for(let G of Z){G.frameworks.forEach((Y)=>X.add(Y));for(let[Y,W]of Object.entries(G.slots))if(W&&!W.includes("/")&&(!(Y in Q)||G.priority>z[Y]))Q[Y]=W,z[Y]=G.priority}let H=new Map;for(let G of Z){if(!G.fileName)continue;if(!H.has(G.fileName))H.set(G.fileName,{fileName:G.fileName,category:$L(G.slots,G.frameworks),priority:G.priority})}let U=[...H.values()].sort((G,Y)=>Y.priority-G.priority||G.fileName.localeCompare(Y.fileName)),J=[];if(Q.mainLanguage)J.push(Q.mainLanguage.toLowerCase());if(Q.framework)J.push(Q.framework.toLowerCase());let V=J.length>0?J.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:U,stackSignature:V}}function C8($){let{slotFills:Z}=e3($),Q={};for(let[z,X]of Object.entries(Z)){let H=tI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function $Q($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X;try{X=a3($,{withFileTypes:!0})}catch{return z}for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=rI(H.name);if(aI.has(U))z.add(U);continue}if(oI.has(H.name)||H.name.startsWith("."))continue;for(let U of $Q(T8($,H.name),Z-1,Q))z.add(U)}return z}import{existsSync as ZQ,readFileSync as QQ}from"fs";import{join as zQ}from"path";var o=($,Z,Q)=>({value:$,source:Z,confidence:Q});function XQ($,Z={}){let Q=Z.toolingRoot?null:UL($),z=JL($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",YL(Q,z)),H("who",WL(z)),H("why",BL(z)),H("where",qL(Q,z)),H("when",KL(z)),H("how",DL(Q,z)),X}function w8($,Z={}){let Q=XQ($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function UL($){let Z=zQ($,"package.json");if(!ZQ(Z))return null;try{return JSON.parse(QQ(Z,"utf-8"))}catch{return null}}function JL($){let Z=zQ($,"README.md");if(!ZQ(Z))return"";let Q;try{Q=QQ(Z,"utf-8")}catch{return""}return Q.replace(/<!--[\s\S]*?-->/g,"").split(`
258
+ `).filter((z)=>!/^\s*\[!\[/.test(z)&&!/^\s*!\[/.test(z)).join(`
259
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function I2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function VL($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function t2($,Z){let Q=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||VL(z[2])>0.4)return null;return{body:I2(z[2]),heading:z[1].trim()}}function GL($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return!1}function t$($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return I2(X[1])}return null}function YL($,Z){if($?.description&&$.description.length>20)return o(I2($.description),"package.json:description",0.95);let Q=t2(Z,"Purpose|What|About|Overview|Description");if(Q)return o(Q.body,`README:## ${Q.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((H)=>H.replace(/\s+/g," ").trim()).find((H)=>H.length>30&&!H.startsWith("#")&&!GL(H));if(z)return o(I2(z),"README:first-paragraph",0.5);let X=t$(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return X?o(X,"README:problem-heuristic",0.6):null}function WL($){let Z=t2($,"Audience|Who|Who is this for|Who it.s for");if(Z)return o(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?o(Q,"README:audience-heuristic",0.6):null}function BL($){let Z=t2($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return o(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?o(Q,"README:mission-heuristic",0.6):null}function qL($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return o(I2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return o(I2($.homepage),"package.json:homepage",0.9);let z=t$(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?o(z,"README:deploy-heuristic",0.6):null}function KL($){let Z=t2($,"Timeline|Status|Release|Roadmap");if(Z)return o(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?o(Q,"README:since-heuristic",0.6):null}function DL($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return o(I2(z.map((U)=>`npm run ${U}`).join(", ")),"package.json:scripts",0.9);let X=t2(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return o(X.body,`README:## ${X.heading}`,0.8);let H=t2(Z,"Architecture|Approach|How it works|Methodology|How");return H?o(H.body,`README:## ${H.heading}`,0.7):null}var HQ="3.0";import{existsSync as R,readFileSync as I0,readdirSync as e4}from"fs";import{join as M}from"path";var UQ=[{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:"dependency",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 IL($){let Z=M($,"Cargo.toml");if(!R(Z))return null;try{let z=I0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function LL($){let Z=M($,"Cargo.toml");if(!R(Z))return!1;try{let Q=I0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(Q)}catch{return!1}}function _L($,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=IL($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function OL($){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=M($,Q);if(!R(z))continue;try{let X=JSON.parse(I0(z,"utf-8"));if(typeof X.manifest_version==="number")return`${Q} manifest_version ${X.manifest_version} (browser extension)`}catch{}}return null}function ML($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=M($,"pyproject.toml");if(R(Q))try{let H=I0(Q,"utf-8").match(Z);if(H)return`pyproject.toml depends on ${H[1]}`}catch{}let z=M($,"requirements.txt");if(R(z))try{let H=I0(z,"utf-8").match(Z);if(H)return`requirements.txt contains ${H[1]}`}catch{}return null}function RL($,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(R(M($,"ios"))&&R(M($,"android")))return"ios/ + android/ dirs";return null}function FL($,Z){let Q=M($,"Cargo.toml");if(R(Q))try{let X=I0(Q,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(X))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(X))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let z=M($,"build.zig");if(R(z))try{let X=I0(z,"utf-8");if(/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(X))return"build.zig wasm target"}catch{}if(Z?.keywords?.some((X)=>/^wasm(?:-|$)|webassembly/i.test(X)))return'package.json keywords contains "wasm"';return null}function NL($,Z){if(!R(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 PL($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((H)=>Q.test(H)),X=Z.files.some((H)=>/\.(md|MD)$|examples?\//.test(H)||H==="README.md"||H==="docs"||H==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function AL($,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 TL($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],H=z.some((J)=>Q[J]),U=X.some((J)=>Q[J]);if(H&&U)return"auth + payment dependencies";return null}function CL($,Z,Q){if(Z?.keywords?.some((H)=>/mcpaas/i.test(H)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((H)=>H.slug==="mcp"),X=Q.some((H)=>H.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function wL($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||R(M($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}var jL=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"]),JQ=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,EL=new Set(["frontend","backend","database","css","ui","state"]);function SL($){if(R(M($,"pyproject.toml"))||R(M($,"manage.py"))||R(M($,"setup.py"))||j8($,"requirements*.txt"))return!0;if(R(M($,"go.mod")))return!0;if(R(M($,"Cargo.toml")))return!0;if(R(M($,"Gemfile")))return!0;if(R(M($,"pom.xml"))||j8($,"build.gradle*"))return!0;if(a2($).length>0)return!0;let Z=L0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function E8($){let Z;try{Z=e4($,{withFileTypes:!0})}catch{return[]}let Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||jL.has(z.name))continue;let X=M($,z.name);if(!SL(X))continue;let H=b8(X);if(!H)continue;let U=S8(X).filter((Y)=>EL.has(Y.category)),J=U.find((Y)=>Y.category==="frontend"),V=U.find((Y)=>Y.category==="backend"),G=J??V??U[0]??null;Q.push({name:z.name,language:H,topFramework:G?.name??null,frontend:!!J,backend:!!V||JQ.test(H),hasFramework:!!G,appRoot:R(M(X,"manage.py"))||R(M(X,"config.ru"))||R(M(X,"bin/rails"))||R(M(X,"artisan"))})}return Q}function bL($,Z){if(Z?.workspaces||R(M($,"pnpm-workspace.yaml")))return null;let Q=E8($),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 VQ($){let Z=E8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(JQ.test(U.language)?2:0)+(U.hasFramework?1:0)+(U.frontend?0.5:0),z=[...Z].sort((U,J)=>Q(J)-Q(U)),X=new Set,H=[];for(let U of z){if(X.has(U.language))continue;X.add(U.language);let J=U.frontend?"frontend":U.backend?"backend":"service";H.push(U.topFramework?`${U.language} (${U.topFramework} · ${J})`:`${U.language} (${J})`)}return H.join("; ")}function L0($){let Z=M($,"package.json");if(!R(Z))return null;try{return JSON.parse(I0(Z,"utf-8"))}catch{return null}}function j8($,Z){if(!Z.includes("*"))return R(M($,Z));let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];try{return e4($).some((V)=>V.startsWith(J))}catch{return!1}}let z=M($,...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";try{return e4(z).some((J)=>J.startsWith(H)&&J.endsWith(U))}catch{return!1}}function gL($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return j8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!j8(Q,$.pattern))return!1;try{let z=M(Q,$.pattern);if(!R(z))return!1;return I0(z,"utf-8").toLowerCase().includes($.key.toLowerCase())}catch{return!1}}default:return!1}}function S8($){let Z=L0($);return UQ.map((Q)=>{let X=Q.signals.filter((H)=>gL(H,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function b8($){let Z=L0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(R(M($,"tsconfig.json")))return"TypeScript";if(R(M($,"Cargo.toml")))return"Rust";if(R(M($,"go.mod")))return"Go";if(a2($).length>0)return"C#";if(R(M($,"pyproject.toml"))||R(M($,"setup.py")))return"Python";if(R(M($,"Gemfile")))return"Ruby";if(s4($)){let Q=d$($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(R(M($,"Package.swift")))return"Swift";if(R(M($,"build.zig")))return"Zig";if(R(M($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return""}function GQ($){let Z=L0($),Q=S8($),z=[],X=PL($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=_L($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=OL($);if(U)return z.push(U),{type:"extension",found:z};let J=CL($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let V=TL($,Z);if(V)return z.push(V),{type:"saas",found:z};let G=FL($,Z);if(G)return z.push(G),{type:"wasm",found:z};let Y=_8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=R8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=N8($);if(B)return z.push(B.found),{type:B.appType,found:z};let q=d$($);if(q)return z.push(q.found),{type:q.appType,found:z};let I=A8($);if(I)return z.push(I.found),{type:I.appType,found:z};let K=a$($);if(K)return z.push(K.found),{type:K.appType,found:z};let D=RL($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((x)=>x.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(LL($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(R(M($,"build.zig"))){if(z.push("build.zig"),R(M($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(R(M($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let F=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit");if(Z?.private===!0&&(R(M($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&F)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(F)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let A=Q.some((x)=>x.category==="frontend"),C=Q.some((x)=>x.category==="backend");if(Z?.private&&(Z.workspaces||R(M($,"pnpm-workspace.yaml")))&&A&&C)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=wL($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let E=AL($,Z,Q);if(E)return z.push(E),{type:"website",found:z};if(Q.some((x)=>x.slug==="nextjs"||x.slug==="nuxt"))return z.push(Q.find((x)=>x.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let w=Q.some((x)=>x.category==="frontend"),c=Q.some((x)=>x.category==="backend");if(w&&c)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(w)return z.push("frontend framework"),{type:"frontend",found:z};if(c)return z.push("backend framework"),{type:"backend",found:z};let a=ML($);if(a)return z.push(a),{type:"data-science",found:z};let O=NL($,Z);if(O)return z.push(O),{type:"html",found:z};let S=bL($,Z);if(S)return z.push(S),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push(A2),{type:"library",found:z}}function YQ($){if(R(M($,"bunfig.toml")))return"Bun";if(R(M($,"deno.json"))||R(M($,"deno.jsonc")))return"Deno";if(L0($))return"Node.js";if(R(M($,"Cargo.toml")))return"Rust";if(R(M($,"go.mod")))return"Go";if(a2($).length>0)return".NET";if(R(M($,"pubspec.yaml")))return"Dart";return""}var xL=new Set(["npm","pnpm","yarn","bun"]);function vL($){let Z=L0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return xL.has(Q)?Q:""}function yL($){if(R(M($,"pubspec.yaml")))return"pub";if(R(M($,"go.mod")))return"go modules";if(a2($).length>0)return"NuGet";if(R(M($,"pom.xml")))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>R(M($,Q)))?"gradle":""}var kL=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function WQ($){return yL($)||vL($)||(kL.find(([Z])=>R(M($,Z)))?.[1]??"")}function BQ($){if(R(M($,".github/workflows")))return"GitHub Actions";if(R(M($,".gitlab-ci.yml")))return"GitLab CI";if(R(M($,".circleci")))return"CircleCI";if(R(M($,"Jenkinsfile")))return"Jenkins";return null}function qQ($){if(R(M($,"vercel.json")))return"Vercel";if(R(M($,"netlify.toml")))return"Netlify";if(R(M($,"wrangler.toml")))return"Cloudflare";if(R(M($,"fly.toml")))return"Fly.io";if(R(M($,"render.yaml")))return"Render";return null}function KQ($){let Z=M($,"svelte.config.js");if(!R(Z))return null;try{let z=I0(Z,"utf-8").match(/@sveltejs\/adapter-(\w+)/);if(z){let X=z[1];switch(X){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 X}}return null}catch{return null}}function DQ($){let Z=L0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(R(M($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function g8($){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)=>R(M($,Q)))}function x8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=R(M($,"bun.lock"))||R(M($,"bun.lockb"))?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(R(M($,"Cargo.toml"))){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&hL($))Q.lint="cargo clippy"}if(R(M($,"build.zig"))){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test($5($,"build.zig")))Q.test="zig build test"}if(R(M($,"go.mod"))){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&fL($))Q.test="pytest";return Q}function $5($,Z){try{return I0(M($,Z),"utf-8")}catch{return""}}function hL($){if(R(M($,"clippy.toml"))||R(M($,".clippy.toml")))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test($5($,"Cargo.toml"))}function fL($){if(R(M($,"pytest.ini"))||R(M($,"conftest.py")))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test($5($,Z)))}function IQ($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let H=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let U of Q)if(H.has(U.category))X.push(U.name);if(R(M($,"bunfig.toml")))X.push("Bun");else if(R(M($,"deno.json"))||R(M($,"deno.jsonc")))X.push("Deno");if(X.length<3&&Z?.dependencies){let U=Object.keys(Z.dependencies).slice(0,5);for(let J of U)if(!X.some((V)=>V.toLowerCase().includes(J.toLowerCase())))X.push(J)}return X}function uL($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function LQ($){return Z5($).data}function Z5($){let Z=L0($),Q=S8($),z=GQ($),X=z.type,H=z.found.some((b)=>b.startsWith("polyglot:")),U=H&&VQ($)||b8($),J=YQ($),V=WQ($),G=BQ($),Y=qQ($),W=DQ($),B=Q.find((b)=>b.category==="frontend"),q=Q.find((b)=>b.category==="css"),I=Q.find((b)=>b.category==="ui"),K=Q.find((b)=>b.category==="state"),D=Q.find((b)=>b.category==="backend"),L=Q.find((b)=>b.category==="database"),F=(b)=>T2(X,b)??T2("library",b)===!0,N=X==="framework",A=Q.some((b)=>b.slug==="svelte"||b.slug==="sveltekit"),C=N&&A?"svelte":N?null:null,T=X==="svelte"||C==="svelte",E=T?KQ($):null,_=T&&Q.some((b)=>b.slug==="sveltekit"),w={},c=f.filter((b)=>b.path.startsWith("stack."));for(let b of c){let v=b.path.replace("stack.","");switch(v){case"frontend":w[v]=B?.name??"";break;case"css_framework":w[v]=q?.name??"";break;case"ui_library":w[v]=I?.name??"";break;case"state_management":w[v]=K?.name??(T&&uL(Z)>=5?"Runes":"");break;case"backend":w[v]=T?_?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":w[v]=_?"Server Routes":"";break;case"runtime":w[v]=J;break;case"database":w[v]=L?.name??"";break;case"connection":w[v]=L?.name??"";break;case"hosting":if(T&&E)w[v]=E;else w[v]=Y??"";break;case"build":w[v]=_?"Vite":W??"";break;case"cicd":w[v]=G??"";break;case"package_manager":w[v]=V;break;default:w[v]="";break}}let a={};for(let b of c){let v=b.path.replace("stack.","");a[v]=F(b)?w[v]:"slotignored"}let O={},S=f.filter((b)=>b.path.startsWith("monorepo."));for(let b of S){let v=b.path.replace("monorepo.","");if(!F(b))O[v]="slotignored";else O[v]=""}let x={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(N&&C)x.framework=C;let V0=IQ($,Z,Q,H?b8($):U);if(H){for(let b of E8($))for(let v of[b.language,b.topFramework])if(v&&!V0.includes(v))V0.push(v)}let R5=g8($),F5=x8($,Z),U6={faf_version:HQ,project:x,stack:a,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:O,_meta:{found:z.found}};if(V0.length>0)U6.tech_stack=V0;if(R5.length>0)U6.key_files=R5;if(Object.keys(F5).length>0)U6.commands=F5;return{data:U6,facts:w}}import{existsSync as pL,readFileSync as lL}from"fs";import{join as cL}from"path";var _Q={MIN_LENGTH:8,MAX_LENGTH:280},mL=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function _0($){let Z=$.trim();if(Z.length<_Q.MIN_LENGTH)return!1;if(Z.length>_Q.MAX_LENGTH)return!1;if(mL.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
+ `).length>4)return!1;return!0}function dL($){let Z=$.split(`
261
+ `),Q=0;while(Q<Z.length&&/^(#\s|$)/.test(Z[Q].trim()))Q++;while(Q<Z.length){let z=Z[Q].trim();if(/^\[!\[/.test(z)){Q++;continue}if(/^!\[/.test(z)){Q++;continue}if(/^<img\s/i.test(z)){Q++;continue}if(z===""){Q++;continue}break}return Z.slice(Q).join(`
262
+ `)}function iL($){let Q=dL($).split(`
263
+ `),z=[];for(let X of Q){let H=X.trim();if(H===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(H))break;if(/^\*\*[^*]+\*\*\s*$/.test(H)&&z.length===0)continue;z.push(H)}if(z.length===0)return null;return z.join(" ").trim()}function L2($,Z){let Q=$.split(`
264
+ `),z=0;while(z<Q.length){let H=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(H&&Z.test(H[2])){let U=H[1].length,J=[];z++;while(z<Q.length){let V=Q[z].trim(),G=V.match(/^(#{1,6})\s+/);if(G&&G[1].length<=U)break;if(V===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(V))break;J.push(V),z++}if(J.length===0)return null;return J.join(" ").trim()}z++}return null}function nL($){let Z=L2($,/^(use\s+cases?|goal)\b/i);if(Z&&_0(Z))return Z;let Q=iL($);if(Q&&_0(Q))return Q;return}function rL($){let Z=L2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&_0(Z))return Z;return}function sL($){let Z=L2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&_0(Z))return Z;return}function oL($){let Z=L2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&_0(Z))return Z;return}function aL($){let Z=L2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&_0(Z))return Z;return}function tL($){let Z=L2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&_0(Z))return Z;return}function eL($){let Z=L2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&_0(Z))return Z;return}function Q5($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let q of Z){let I=cL($,q);if(pL(I)){Q=I;break}}if(!Q)return{};let z;try{z=lL(Q,"utf-8")}catch{return{}}z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},H=nL(z);if(H)X.project={goal:H};let U={},J=rL(z);if(J)U.what=J;let V=sL(z);if(V)U.who=V;let G=oL(z);if(G)U.why=G;let Y=aL(z);if(Y)U.where=Y;let W=tL(z);if(W)U.when=W;let B=eL(z);if(B)U.how=B;if(Object.keys(U).length>0)X.human_context=U;return X}import{existsSync as $_,readFileSync as Z_}from"fs";import{join as Q_}from"path";function z_($,Z){let Q=$.split(`
265
+ `),z=!1;for(let X of Q){let H=X.trim();if(/^\[/.test(H)){z=H==="[package]";continue}if(!z)continue;let U=H.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(U){let J=U[1].trim();J=J.replace(/\s*#.*$/,"").trim();let V=J.match(/^"((?:[^"\\]|\\.)*)"$/)||J.match(/^'((?:[^'\\]|\\.)*)'$/);if(V)return V[1];return J}}return null}function z5($){let Z=Q_($,"Cargo.toml");if(!$_(Z))return{};let Q;try{Q=Z_(Z,"utf-8")}catch{return{}}let z=z_(Q,"description");if(z&&_0(z))return{project:{goal:z}};return{}}import{readFileSync as X_,readdirSync as H_}from"fs";import{join as OQ}from"path";var U_=[{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"}],J_=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function V_($){let Z=[],Q=(z,X)=>{let H;try{H=H_(z,{withFileTypes:!0})}catch{return}for(let U of H)if(U.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(U.name))Z.push(OQ(z,U.name));else if(U.isDirectory()&&X>0&&!U.name.startsWith(".")&&!J_.has(U.name))Q(OQ(z,U.name),X-1)};return Q($,1),Z}function e$($){return[...$].join(" · ")}function X5($){let Z=V_($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let H;try{H=X_(X,"utf-8")}catch{continue}for(let U of H.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let J=U[1].toLowerCase(),V=J.replace(/:[^/]*$/,"").split("/").pop()??J,G=J.replace(/:[^/]*$/,"");for(let{re:Y,slot:W,label:B}of U_)if(Y.test(V)||Y.test(G))Q[W].add(B)}}let z={};if(Q.database.size)z.database=e$(Q.database);if(Q.cache.size)z.cache=e$(Q.cache);if(Q.search.size)z.search=e$(Q.search);if(Q.storage.size)z.storage=e$(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${e$(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{existsSync as v8,readFileSync as G_,readdirSync as Y_}from"fs";import{join as $6}from"path";var W_=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),B_=[{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 H5($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function q_($){let Z=[$];try{for(let Q of Y_($,{withFileTypes:!0}))if(Q.isDirectory()&&!Q.name.startsWith(".")&&!W_.has(Q.name))Z.push($6($,Q.name))}catch{}return Z}function K_($){let Z=0;if(v8($6($,"manage.py"))||v8($6($,"pyproject.toml"))||v8($6($,"Gemfile")))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function U5($){let Z=[];for(let z of q_($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of B_){let J=$6(z,U.file);if(!v8(J))continue;let V;try{V=G_(J,"utf-8")}catch{continue}let G=U.targets(V);if(G.length===0)continue;let Y={},W=H5(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),B=H5(G,[/^build$/i,/^compile$/i,/^build/i]),q=H5(G,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(W)Y.test=`${H}${U.runner} ${W}`;if(B)Y.build=`${H}${U.runner} ${B}`;if(q)Y.lint=`${H}${U.runner} ${q}`;if(Object.keys(Y).length===0)continue;Z.push({score:Object.keys(Y).length+(X?10:K_(z)),commands:Y})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}import{existsSync as D_}from"fs";import{join as I_}from"path";var L_=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function J5($){for(let Z of L_)if(D_(I_($,Z)))return{security:{secrets:".env",example:Z}};return{}}function __($,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 V5($){return[Q5($),z5($),X5($),U5($),J5($)].reduce(__,{})}function MQ($){try{let Z=m2($,{logLevel:"error"}).getIn(["project","type"],!0);return i(Z)&&typeof Z.comment==="string"&&Z.comment.includes(A2)}catch{return!1}}function G5($){let Z=LQ($),Q=V5($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X={};if(Q.project)X.project=Q.project;if(Q.human_context)X.human_context=Q.human_context;let H=k0(k0(z,Z),X);w_(H);let J=(Z._meta?.found??[]).some((G)=>G.startsWith("polyglot:")),V=k0(H,C8($));return k0(V,{human_context:w8($,{toolingRoot:J})})}function O_($,Z){let Q=C_(X8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=Z5($),H=z,U=k0(Q,V5($)),J=k0(U,H),V=k0(J,C8($)),G=F_(k0(V,{human_context:w8($)}),Q),Y=N_(M_(Z,Q,H)?P_(RQ(G,Q),Q,X):RQ(G,Q),Q);return A9(N9(Z,Y))}function M_($,Z,Q){if(!n(Z0(Z,"project.type"))){let X=h$($)?.text;return X===void 0||!MQ(X)}return!(Q._meta?.found??[]).includes(A2)}function Y5($){return $.canonical?[$.path,$.canonical]:[$.path]}function Z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return y(X)?X[z]:void 0}function _2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!y(H))return;if(Q===void 0?!(X in H):H[X]===Q)return;let U={...H};if(Q===void 0)delete U[X];else U[X]=Q;$[z]=U}var O2=($)=>typeof $==="string"&&$.trim()===V6;function R_($,Z){let Q=Z.map((z)=>Z0($,z));return Q.some(O2)&&Q.every((z)=>n(z)||O2(z))}function RQ($,Z){let Q={...$};for(let z of f){let X=Y5(z);if(!R_(Z,X))continue;for(let H of X){let U=Z0(Z,H);if(Z0(Q,H)!==U)_2(Q,H,U)}}return Q}function M2($,Z){let[Q,z]=Z.split("."),X=$[Q];return y(X)&&Object.prototype.hasOwnProperty.call(X,z)}function F_($,Z){let Q={...$};for(let z of f){if(!z.canonical||!M2(Z,z.canonical)||M2(Z,z.path))continue;let X=Z0(Q,z.path);_2(Q,z.path,void 0);let H=Z0(Q,z.canonical);if(y8(X)&&n(H))_2(Q,z.canonical,X)}return Q}function N_($,Z){let Q={...$};for(let z of f){if(!z.canonical||!M2(Z,z.canonical)||M2(Z,z.path))continue;let X=Z0(Q,z.canonical);if(y8(X)||O2(X))_2(Q,z.path,X)}return Q}function P_($,Z,Q={}){let z=$.project,X=y(z)?z.type:void 0,H={...$};for(let U of f){if(U.category==="human"||U.category==="project")continue;let J=T2(X,U);if(J===null)return $;if(J)A_(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0);else T_(H,U)}return H}function A_($,Z,Q,z){let X=Y5(Q);for(let U of X)if(O2(Z0($,U))&&!O2(Z0(Z,U)))_2($,U,M2(Z,U)?Z0(Z,U):"");if(!y8(z))return;let H=X.filter((U)=>M2($,U));if(H.some((U)=>!n(Z0($,U))))return;for(let U of H.length>0?H:[Q.path])_2($,U,z)}function T_($,Z){let Q=Y5(Z).filter((X)=>M2($,X)),z=(X)=>!n(Z0($,X))&&!O2(Z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(n(Z0($,X)))_2($,X,V6)}function C_($){let Z=$.project;if(Z===null||Z===void 0||y(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function w_($){let Z=$.project?.type??"library",Q=P2[Z]||P2.library;for(let z of f){if(Q.includes(z.category))continue;let[X,H]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[H]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[H]="slotignored"}}function k0($,Z){return FQ($,Z,"")}function j_($){let Z=w0.get($);return Z!==void 0&&Z.category!=="human"}function y8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!n($)&&!O2($)}function E_($,Z){return j_($)&&y8(Z)}function FQ($,Z,Q){let z={...$};for(let[X,H]of Object.entries(Z)){let U=z[X],J=Q?`${Q}.${X}`:X;if(J==="_meta"&&U!==void 0)continue;if(c8(U)){if(E_(J,H))z[X]=H;continue}if(n(U))z[X]=H;else if(y(H)&&y(U))z[X]=FQ(U,H,J)}return z}function S_($){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 NQ($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function b_($,Z={}){let Q=G5($);if(Z.repoUrl&&Q.project&&!L0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=NQ(Z.repoUrl);return Q}import{existsSync as PQ,lstatSync as g_}from"fs";import{join as x_,basename as v_}from"path";import{createHash as y_}from"crypto";var O0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),Z2=($)=>typeof $==="number"&&Number.isFinite($),h0=($)=>typeof $==="string",k_=/^v?\d+\.\d+\.\d+$/,h_=new Set(["birth","doubled","peak","current"]);function CQ($){return O0($)&&h0($.version)&&k_.test($.version)&&Z2($.score)}var f_=($)=>O0($)&&Z2($.birthDNA)&&h0($.born),u_=($)=>Array.isArray($)&&$.length>0&&$.every(CQ),m_=($)=>O0($)&&Z2($.score)&&h0($.version),p_=($)=>O0($)&&Array.isArray($.milestones)&&$.milestones.every(O0);function AQ($){return O0($)&&f_($.birthCertificate)&&u_($.versions)&&m_($.current)&&p_($.growth)}function W5($){try{return g_($),!0}catch{return!1}}var B5=($)=>`${JSON.stringify($,null,2)}
266
+ `,l_=new Set(["version","score","lastSync"]),c_=new Set(["type","score","date","version","label","emoji"]),TQ=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),q5={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},wQ=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),jQ=($)=>TQ($.current,l_)&&wQ($).every((Z)=>TQ(Z,c_)),d_=($)=>wQ($).every((Z)=>Z.label===q5[Z.type].label&&Z.emoji===q5[Z.type].emoji);function i_($){return jQ($)&&d_($)}var n_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",r_=".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.",s_=".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.",a_=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function t_($){if(!Array.isArray($))return[];return $.filter((Z)=>O0(Z)&&h0(Z.type)&&h_.has(Z.type)&&Z2(Z.score))}var R2=($,Z="")=>h0($)?$:Z;function e_($,Z){if(!Array.isArray($))return[];return $.filter(CQ).map((Q)=>({version:Q.version,timestamp:R2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(h0):[],growth:Z2(Q.growth)?Q.growth:Q.score-Z}))}function $O($,Z,Q,z){return{version:R2($.version,Z?.version??"v1.0.0"),score:Z2($.score)?$.score:Z?.score??Q,lastSync:R2($.lastSync,z)}}function ZO($){if(!O0($)||!O0($.birthCertificate)||!Z2($.birthCertificate.birthDNA))return null;let Z=$.birthCertificate,Q=Z.birthDNA,z=R2(Z.born),X=e_($.versions,Q),H=$O(O0($.current)?$.current:{},X[X.length-1],Q,z),U=O0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"?"legacy":"init",projectDNA:R2(Z.projectDNA),certificate:R2(Z.certificate)},versions:X,current:H,growth:{totalGrowth:H.score-Q,daysActive:Z2(U.daysActive)?U.daysActive:0,milestones:t_(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:R2($.lastModified,z),format:"faf-dna-v1"}}class EQ{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=x_($,".faf-dna")}exists(){let $=PQ(this.dnaPath);if(!$&&!W5(this.dnaPath))this.sawNoFile=!0;return $}birth($){if(!W5(this.dnaPath))this.sawNoFile=!0;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.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,H=$-X,U=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:U,timestamp:z,score:$,changes:Z,growth:H}),Q.current={version:U,score:$,lastSync:z},Q.growth.totalGrowth=H,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,U,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((H)=>H.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:h0($.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=h0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(h0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!PQ(this.dnaPath)){if(!W5(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(AQ(Q)&&B5(Q)===Z&&i_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=ZO(Q),this.reason=!this.dna?a_:!AQ(Q)?n_:B5(Q)!==Z?r_:jQ(Q)?o_:s_;return this.text=Z,this.dna}read(){let $;try{$=Q0(k(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 $=B5(this.dna),Z=this.text??(this.sawNoFile?null:B0(k(this.projectPath,".faf-dna")));s(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return y_("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=v_(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((G)=>G.type===V),H=(V)=>z.push({type:V,score:$,date:Q,version:Z,...q5[V]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))H("doubled");let U=z.find((V)=>V.type==="peak");if(!U||$>U.score){if(U)z.splice(z.indexOf(U),1);H("peak")}let J=z.findIndex((V)=>V.type==="current");if(J>=0)z.splice(J,1);H("current")}}import{join as gO}from"path";import{existsSync as CO,statSync as fA}from"fs";import{join as mQ}from"path";import{dirname as yQ,resolve as kQ}from"path";var bQ=100;var QO="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",zO=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${QO})(?=\\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")],XO=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],HO=["","-->","?>",">","]]>"],UO=/[#`~*+_=<>0-9-]/,JO=/(\d{1,9})([.)])/y,VO=/#{1,6}(?:[ \t]+|$)/y,GO=/`{3,}(?!.*`)|~{3,}/y,YO=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,WO=/(?:=+|-+)[ \t]*$/y,BO=/[^ \t\f\v\r\n]/;function Z6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var qO=($)=>$==="quote"||$==="list"||$==="item";function KO($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let H=$.length-1;H>=0;H--){let U=$[H],J=U===" "||U==="\t";for(let G=0;G<3;G++)if(U==="*-_"[G])z[G]++;else if(!J)X[G]=!1;let V="*-_".indexOf(U);Z[H]=V>=0&&X[V]&&z[V]>=3?1:0}return Z}var e2=($)=>$===" "||$==="\t";function DO($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var SQ=($)=>$==="paragraph"||$==="code"||$==="html";function IO($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class f0{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 f0(this.containers);return $.stack=this.stack.map(IO),$.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}>`:HO[$.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"&&SQ(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!UO.test(this.ln.charAt(z)))break;let X=0;for(let H of this.starts)if(X=H(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!SQ($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=XO[$.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),e2(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?Z6(YO,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&&e2(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??=KO(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),e2(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!Z6(VO,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:Z6(GO,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let H=zO[X-1].exec(z);if(H)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?H[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!Z6(WO,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||e2(z)))return null;if(Z&&!BO.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"?Z6(JO,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&&e2(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,e2(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!DO(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),qO($.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 A0="<!-- faf:start -->",T0="<!-- faf:end -->",gQ="\uFEFF";function z6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var $$=($)=>$.replace(/\r?\n$|\r$/,""),hQ=($)=>$$($).replace(/^\uFEFF/,"").trimEnd();function*fQ($){let Z=0;for(let Q of z6($)){let z=$$(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 LO($,Z,Q,z){let X=$.some((U)=>U.start!==-1)&&z(Z.content),H=Q(Z.content);for(let U of $)if(U.start!==-1&&X)U.found={start:U.start,end:Z.to};else if(H)U.start=Z.from}function K5($,Z,Q){let[z,X]=[new f0(!0),new f0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of fQ($)){let U=[z,X].map((V)=>V.reader.line(H.content));if(z.reader.tooDeep)return null;let J=[z,X].filter((V,G)=>U[G]===null);if(J.length>0)LO(J,H,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var xQ=($)=>(Z)=>Z===$;function F2($,Z=A0,Q=T0){return K5($,xQ(Z),xQ(Q))}function vQ($,Z){let Q=[];for(let z of[!0,!1]){let X=new f0(z);for(let H of z6($))X.line($$(H));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var _O=16;function OO($){let Z=new f0(!0);return $.map((Q)=>{let z=Z.overflowAt($$(Q),_O),X=Q;if(z>=0){let H=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),U=H?z+H[0].length:z;X=`${Q.slice(0,U)}\\${Q.slice(U)}`}return Z.line($$(X)),X})}function MO($,Z,Q){let X=OO(z6($).map((U)=>{let J=hQ(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=vQ(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
267
+ ${H[0]}`,J=vQ(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function RO($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=z6(z).map((H)=>$$(H)===""?`>${H}`:`> ${H}`).join("");return`${Z}
268
+ ${X}
269
+ ${Q}`}function Q6($,Z,Q,z=A0,X=T0,H="the file"){let U=(V)=>{let G=`${$}${V}${Q}`,Y=F2(G,z,X);return Y&&Y.start===$.length&&Y.end===$.length+V.length?G:null},J=U(Z)??U(RO(Z,z,X));if(J===null)throw new j("unplaceable",H,`${H}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return J}function D5($,Z=A0,Q=T0){return`${Z}
270
+ ${MO($.trim(),Z,Q)}
271
+ ${Q}`}function k8($,Z,Q=A0,z=T0,X){if($===null)return Q6("",Z,`
272
+ `,Q,z,X);let H=F2($,Q,z);if(H)return Q6($.slice(0,H.start),Z,$.slice(H.end),Q,z,X);let U=$.startsWith(gQ)?gQ:"";return Q6(U,Z,`
234
273
 
235
- ${J}`,"utf-8")}var aB=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 Y6($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return aB.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function l($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function n($){let Z=A0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return Y6(Q)}var Z4="CLAUDE.md",tB="STATUS: BI-SYNC ACTIVE";function eB($){let Z=$4($,Z4);if(!oB(Z))return null;return sB(Z,"utf-8")}function $W($,Z){Q0($4($,Z4),Z)}function q0($,Z={}){let Q=String($.project?.name??"").trim(),X=String($.project?.main_language??"").trim(),z=String($.project?.type??"").trim(),J=String($.project?.goal??"").trim(),H=`<!-- faf: ${[Q,X,z,J].join(" | ")} -->`,U=[];if(Z.doc)U.push(`doc=${Z.doc}`);else U.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")U.push(`score=${Z.score}`);if(U.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)U.push(`siblings=${Z.siblings.join(",")}`);let q=`<!-- faf: ${U.join(" | ")} -->`;return`${H}
236
- ${q}`}function ZW($){let Z=[],Q=$.project?.name??"Project",X=$.project?.main_language??"",z=$.project?.goal??"";if(Z.push(q0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),z)Z.push("## What This Is"),Z.push(""),Z.push(z),Z.push("");let J=$.stack??{},H=[];if(X)H.push(`**Language:** ${X}`);for(let[Y,G]of Object.entries(J))if(G&&G!=="slotignored"&&String(G).trim())H.push(`**${n(`stack.${Y}`)}:** ${G}`);if(H.length>0){Z.push("## Stack"),Z.push("");for(let Y of H)Z.push(`- ${Y}`);Z.push("")}let U=$.human_context??{},q=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,Y])=>Y&&String(Y).trim()).map(([Y,G])=>`- **${n(`human_context.${Y}`)}:** ${G}`);if(q.length>0)Z.push("## Context"),Z.push(""),Z.push(...q),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${tB} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
237
- `)}function e5($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function QW($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=e5(Q[1].trim());if(!Z.project.name){let J=$.match(/\*\*Name:\*\*\s*(.+)/);if(J)Z.project.name=e5(J[1].trim())}let X=$.match(/## What This Is\s*\n\s*\n(.+)/);if(X)Z.project.goal=X[1].trim();if(!Z.project.goal){let J=$.match(/\*\*What Building:\*\*\s*(.+)/);if(J)Z.project.goal=J[1].trim()}let z=$.match(/\*\*Language:\*\*\s*(.+)/);if(z)Z.project.main_language=z[1].trim();if(!Z.project.main_language){let J=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim()}return Z}var d=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Q4=($)=>Array.isArray($)?$.join(", "):String($),zW=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),JW=new Set(["target_user","core_problem","mission_purpose"]);function X4($){let Z=[],Q=(M="")=>Z.push(M),X=$.ai_instructions,z=$.preferences,J=$.instant_context,H=$.security,U=$.commands,q=$.key_files??J?.key_files,Y=d($.project?.default_branch)?String($.project?.default_branch):"main",G=U?Object.entries(U).filter(([,M])=>d(M)):[],V=G.filter(([M])=>/test/i.test(M)),B=G.filter(([M])=>/lint|check/i.test(M)&&!/test/i.test(M)),_=G.filter(([M])=>!/test|lint|check/i.test(M)),D=(M)=>{let b=M.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},W=[..._].sort((M,b)=>D(M[0])-D(b[0])||M[0].localeCompare(b[0])),O=[...V,...B],I=V[0]?.[1],N=W.find(([M])=>/build/i.test(M))?.[1];Q(q0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let F=[];if($.project?.main_language)F.push(String($.project.main_language));if(d($.project?.type))F.push(`type: ${String($.project?.type)}`);if(d($.project?.version))F.push(`v${String($.project?.version)}`);let A=$.project?.goal?String($.project.goal).trim():"";if(F.length)A+=(A?" — ":"")+F.join(" · ");if(A)Q(A),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(),W.length){Q("## Setup & build"),Q(),Q("```bash");for(let[M,b]of W)Q(`${b} # ${M}`);Q("```"),Q()}if(O.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,M]of O)Q(M);Q("```"),Q()}if(q&&q.length){Q("## Where things live"),Q();let M=q.map((b)=>{let x=String(b),a=x.indexOf(" — ");return a>0?{path:x.slice(0,a),role:x.slice(a+3)}:{path:x,role:""}});if(M.some((b)=>b.role)){Q("| Path | Role |"),Q("|------|------|");for(let b of M)Q(`| \`${b.path}\` | ${b.role} |`)}else for(let b of M)Q(`- \`${b.path}\``);Q()}let w=new Map,T=(M)=>{if(!M)return;for(let[b,x]of Object.entries(M)){if(zW.has(b)||!d(x))continue;let a=Y6(b);if(!w.has(a))w.set(a,Q4(x))}};T(X?.working_style),T(z);let C=$.conventions??[];if(w.size||C.length){Q("## Conventions"),Q();for(let[M,b]of w)Q(`- **${M}:** ${b}`);for(let M of C)if(d(M))Q(`- ${M}`);Q()}let L=(X?.warnings??[]).filter((M)=>d(M)),S=["read the tree"];if(I)S.push(`run the tests (\`${I}\`)`);if(N)S.push("build the project");for(let[,M]of B.slice(0,1))S.push(`\`${M}\``);Q("## Guardrails"),Q();for(let M of L)Q(`- ${M}`);Q(`- **Always OK:** ${[...new Set(S)].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 E=[];for(let[,M]of B)E.push(`\`${M}\` exits 0`);for(let[,M]of V)E.push(`\`${M}\` passes`);if(E.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(E)].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(),H&&(d(H.secrets)||(H.never??[]).length)){if(Q("## Security & secrets"),Q(),d(H.secrets)){let M=d(H.example)?` (see \`${H.example}\`)`:"";Q(`- Secrets live in \`${H.secrets}\`${M}. Never read or commit them.`)}for(let M of H.never??[])if(d(M))Q(`- Never read or commit \`${M}\`.`);Q()}if(Q("## Commit & PR"),Q(),z&&d(z.commit_style))Q(`- Commit style: ${Q4(z.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 M=[];for(let[b,x]of Object.entries($.stack)){if(JW.has(b))continue;if(l(x))M.push(`- **${n(`stack.${b}`)}:** ${x.trim()}`)}if(M.length){Q("## Stack"),Q();for(let b of M)Q(b);Q()}}let m=$.generated;if(d(m))Q(`*Context authored: ${String(m)}*`);return Z.join(`
238
- `)}function HW($,Z){Q0(XW($,"AGENTS.md"),X4(Z))}import{join as UW}from"path";var qW=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),YW=new Set(["target_user","core_problem","mission_purpose"]);function z4($){let Z=[],Q=$.instant_context,X=$.commands,z=$.key_files??Q?.key_files,J=X?Object.entries(X).filter(([,B])=>qW(B)):[],H=J.filter(([B])=>/test/i.test(B)),U=J.filter(([B])=>/lint|check/i.test(B)&&!/test/i.test(B)),q=J.filter(([B])=>!/test|lint|check/i.test(B)),Y=(B)=>{let _=B.toLowerCase();if(/install|deps/.test(_))return 0;if(/^build$|build/.test(_)&&!/rebuild/.test(_))return 1;if(/^dev$|develop/.test(_))return 2;if(/^start$|run/.test(_))return 3;return 4},G=[...q].sort((B,_)=>Y(B[0])-Y(_[0])||B[0].localeCompare(_[0])),V=[...H,...U];if(Z.push(q0($)),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[B,_]of G)Z.push(`${_} # ${B}`);Z.push("```")}if(V.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,B]of V)Z.push(B);Z.push("```")}if(z&&z.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let B of z)Z.push(`- \`${B}\``)}if($.stack){let B=[];for(let[_,D]of Object.entries($.stack)){if(YW.has(_))continue;if(l(D))B.push(`- ${n(`stack.${_}`)}: ${D.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let _ of B)Z.push(_)}}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(`
239
- `)}function GW($,Z){Q0(UW($,"GEMINI.md"),z4(Z))}import{join as VW}from"path";function J4($){let Z=[];if(Z.push(q0($)),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,X]of Object.entries($.stack))if(l(X))Z.push(`# ${n(`stack.${Q}`)}: ${X.trim()}`)}return Z.push(""),Z.join(`
240
- `)}function BW($,Z){Q0(VW($,".cursorrules"),J4(Z),"# faf:start","# faf:end")}import{join as H4}from"path";import{mkdirSync as WW}from"fs";var U4=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],_W=new Set([...U4.map(([$])=>$),"cicd"]);function q4($){let Z=[],Q=$.project?.name??"Project";if(Z.push(q0($)),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(""),l($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let X=$.stack??{},z=[];if(l($.project?.main_language))z.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[Y,G]of Object.entries(X)){if(_W.has(Y))continue;if(l(G))z.push(`- **${n(`stack.${Y}`)}:** ${G.trim()}`)}if(z.length>0)Z.push("## Tech stack","",...z,"");let J=[];for(let[Y,G]of U4){let V=X[Y];if(l(V))J.push(`- ${G} \`${V.trim()}\`.`)}if(l(X.cicd))J.push(`- CI runs on ${X.cicd.trim()}.`);if(J.length>0)Z.push("## Build & run","",...J,"");let H=$.human_context??{},q=[["who",H.who],["what",H.what],["why",H.why],["where",H.where],["when",H.when],["how",H.how]].filter(([,Y])=>l(Y)).map(([Y,G])=>`- **${n(`human_context.${Y}`)}:** ${G.trim()}`);if(q.length>0)Z.push("## Project context","",...q,"");return Z.join(`
241
- `)}function OW($,Z){WW(H4($,".github"),{recursive:!0}),Q0(H4($,".github","copilot-instructions.md"),q4(Z))}import{existsSync as V$,readFileSync as Y4}from"fs";import{join as a2}from"path";function DW($,Z){let Q=[],X=(q)=>V$(a2($,q)),z=(q)=>{try{return Y4(a2($,q),"utf-8")}catch{return""}};if(X("tsconfig.json")&&/"strict"\s*:\s*true/.test(z("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let J=[],H=Z?.devDependencies??{};if(X(".eslintrc")||X(".eslintrc.json")||X(".eslintrc.cjs")||X("eslint.config.js")||X("eslint.config.mjs")||"eslint"in H)J.push("ESLint");if(X(".prettierrc")||X(".prettierrc.json")||X("prettier.config.js")||"prettier"in H)J.push("Prettier");let U=X("pyproject.toml")?z("pyproject.toml"):"";if(/\[tool\.black\]/.test(U))J.push("black");if(/\[tool\.ruff\]/.test(U))J.push("ruff");if(/\[tool\.mypy\]/.test(U))J.push("mypy");if(X("rustfmt.toml")||X(".rustfmt.toml"))J.push("rustfmt");if(J.length)Q.push(`Style enforced by ${J.join(" · ")} — obey the configs`);return Q}function IW($,Z){let Q={...Z},X=null,z=a2($,"package.json");if(V$(z))try{X=JSON.parse(Y4(z,"utf-8"))}catch{X=null}let J=q$($,X);if(Object.keys(J).length)Q.commands={...J,...Z.commands??{}};let H=Z.key_files??Z.instant_context?.key_files;if(!H||H.length===0){let U=U$($);if(U.length)Q.key_files=U}if(!Z.security){let q=[".env",".env.local",".env.development"].find((Y)=>V$(a2($,Y)));if(q){let Y=[".env.example",".env.sample",".env.template"].find((G)=>V$(a2($,G)));Q.security={secrets:q,...Y?{example:Y}:{}}}}if(!Z.conventions){let U=DW($,X);if(U.length)Q.conventions=U}return Q}export{nq as writeServerCard,uq as writeProjectHtml,GW as writeGeminiMd,Pq as writeFaf,BW as writeCursorrules,OW as writeCopilotInstructions,$W as writeClaudeMd,HW as writeAgentsMd,T4 as validateFaf,$2 as utcNow,GY as upsertCatalog,lB as updateExistingFaf,Z$ as turboCatSlots,C5 as turboCatScan,O4 as slotsByCategory,bZ as serializeFaf,X5 as seedSixWsFromGoal,I$ as scoreFafYaml,xY as runLoop,b8 as renderProjectHtml,z4 as renderGeminiMd,J4 as renderCursorrules,q4 as renderCopilotInstructions,ZW as renderClaudeMd,X4 as renderAgentsMd,x5 as relentlessContextDetailed,Q$ as relentlessContext,j8 as registryName,E8 as registryMeta,ZY as readFafa,EZ as readFafRaw,Nq as readFaf,eB as readClaudeMd,u8 as questionForSlot,fY as publicQuestions,VY as projectCards,QW as parseClaudeMd,i1 as normalizeAnswer,H5 as loopVerdict,D$ as kernel,T0 as isPlaceholder,z5 as isHumanSlot,c1 as isEmptyValue,wY as interviewForMissing,Q0 as injectFafBlock,kY as gradeAnswers,Y2 as getTier,K4 as getNextTier,aq as generateServerCard,mq as generateProjectHtml,zY as generateA2ACard,aZ as fromClaudeDir,QY as findFafaFile,jZ as findFafFile,t5 as findFafBlock,U0 as fillEmpties,q0 as fafMetaTag,e0 as fafContextBlock,D6 as enrichScore,IW as enrichFromRepo,vY as deriveQuestionSet,Eq as computeDrift,J5 as classifyGaps,y2 as canonicalPriority,jY as buildTableOf8,g2 as buildServerCard,uY as buildReceipt,g8 as buildA2ACard,pB as assembleFreshFaf,G5 as answersMatch,Y0 as TIERS,Z5 as STACK_INTERVIEW,A0 as SLOT_BY_PATH,f as SLOTS,k8 as SIX_WS_INTERVIEW,kZ as REGISTRY_PUBLISHER_KEY,N0 as PRIORITY_RANK,y8 as PRIORITY_ORDER,o2 as PLACEHOLDERS,d1 as KNOWLEDGE_TYPES,$5 as INTERVIEW_VERSION,TY as INTERVIEW_PATHS,Q5 as INTERVIEW_BY_PATH,Q2 as INTERVIEW,g0 as FafmSoul,U6 as FAF_START,q2 as FAF_HEX,q6 as FAF_END,I4 as ENTERPRISE_SLOTS,p8 as BENCH_VERSION,D4 as BASE_SLOTS,Y5 as ALIAS_GROUPS,pZ as A2A_CONTEXT_URI};
274
+ ${$.slice(U.length)}`,Q,z,X)}function X6($){try{return Q0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function M0($,Z,Q=A0,z=T0,X={}){let H=D5(Z,Q,z),U=kQ($),J=X.root??yQ(U),V=k(J,U),G=X6(V);s(V,k8(G,H,Q,z,U),{root:J,expect:G})}var FO="<!-- faf:";function NO($){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 PO($,Z){let Q=[new f0(!0),new f0(!1)],z=!1;for(let{content:X}of fQ($)){if(z){if(X===Z)return"too deep";continue}let[H,U]=Q.map((V)=>V.line(X));z=Q[0].tooDeep;let J=H??U;if(X===Z&&(z||J!==null))return z?"too deep":J}return null}function h8($,Z,Q=A0,z=T0){if(Z===null||F2(Z,Q,z))return null;let X=hQ(z6(Z)[0]??"");if(X.startsWith(FO)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let H=PO(Z,Q);if(H===null)return null;if(H==="too deep")return`${$}: faf's block is now on top; the file nests more than ${bQ} 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.`;return`${$}: faf's block is now on top; an older faf block below sits inside ${NO(H)} and is left as you had it — delete it by hand if you no longer want it.`}function AO($,Z,Q=A0,z=T0,X={}){try{let H=kQ($);return h8(Z,X6(k(X.root??yQ(H),H)),Q,z)}catch{return null}}var TO=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 I5($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return TO.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function l($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function t($){let Z=w0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return I5(Q)}var L5=r.claude,wO="STATUS: SYNC ACTIVE";function jO($){let Z=mQ($,L5);if(!CO(Z))return null;return Q0(k($,L5))}function EO($,Z){M0(mQ($,L5),Z)}function C0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),H=String($.project?.goal??"").trim(),U=`<!-- faf: ${[Q,z,X,H].join(" | ")} -->`,J=[];if(Z.doc)J.push(`doc=${Z.doc}`);else J.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")J.push(`score=${Z.score}`);if(J.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)J.push(`siblings=${Z.siblings.join(",")}`);let V=`<!-- faf: ${J.join(" | ")} -->`;return`${U}
275
+ ${V}`}function SO($){let Z=[],Q=$.project?.name??"Project",z=$.project?.main_language??"",X=$.project?.goal??"";if(Z.push(C0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),X)Z.push("## What This Is"),Z.push(""),Z.push(X),Z.push("");let H=$.stack??{},U=[];if(z)U.push(`**Language:** ${z}`);for(let[G,Y]of Object.entries(H))if(Y&&Y!=="slotignored"&&String(Y).trim())U.push(`**${t(`stack.${G}`)}:** ${Y}`);if(U.length>0){Z.push("## Stack"),Z.push("");for(let G of U)Z.push(`- ${G}`);Z.push("")}let J=$.human_context??{},V=[["who",J.who],["what",J.what],["why",J.why],["where",J.where],["when",J.when],["how",J.how]].filter(([,G])=>G&&String(G).trim()).map(([G,Y])=>`- **${t(`human_context.${G}`)}:** ${Y}`);if(V.length>0)Z.push("## Context"),Z.push(""),Z.push(...V),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${wO} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
+ `)}function uQ($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function bO($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=uQ(Q[1].trim());if(!Z.project.name){let H=$.match(/\*\*Name:\*\*\s*(.+)/);if(H)Z.project.name=uQ(H[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let H=$.match(/\*\*What Building:\*\*\s*(.+)/);if(H)Z.project.goal=H[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let H=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(H)Z.project.main_language=H[1].trim()}return Z}var z0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),pQ=($)=>Array.isArray($)?$.join(", "):String($),xO=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),vO=new Set(["target_user","core_problem","mission_purpose"]);function lQ($){let Z=[],Q=(O="")=>Z.push(O),z=$.ai_instructions,X=$.preferences,H=$.instant_context,U=$.security,J=$.commands,V=$.key_files??H?.key_files,G=z0($.project?.default_branch)?String($.project?.default_branch):"main",Y=J?Object.entries(J).filter(([,O])=>z0(O)):[],W=Y.filter(([O])=>/test/i.test(O)),B=Y.filter(([O])=>/lint|check/i.test(O)&&!/test/i.test(O)),q=Y.filter(([O])=>!/test|lint|check/i.test(O)),I=(O)=>{let S=O.toLowerCase();if(/install|deps/.test(S))return 0;if(/^build$|build/.test(S)&&!/rebuild/.test(S))return 1;if(/^dev$|develop/.test(S))return 2;if(/^start$|run/.test(S))return 3;return 4},K=[...q].sort((O,S)=>I(O[0])-I(S[0])||O[0].localeCompare(S[0])),D=[...W,...B],L=W[0]?.[1],F=K.find(([O])=>/build/i.test(O))?.[1];Q(C0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let N=[];if($.project?.main_language)N.push(String($.project.main_language));if(z0($.project?.type))N.push(`type: ${String($.project?.type)}`);if(z0($.project?.version))N.push(`v${String($.project?.version)}`);let A=$.project?.goal?String($.project.goal).trim():"";if(N.length)A+=(A?" — ":"")+N.join(" · ");if(A)Q(A),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(),K.length){Q("## Setup & build"),Q(),Q("```bash");for(let[O,S]of K)Q(`${S} # ${O}`);Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,O]of D)Q(O);Q("```"),Q()}if(V&&V.length){Q("## Where things live"),Q();let O=V.map((S)=>{let x=String(S),V0=x.indexOf(" — ");return V0>0?{path:x.slice(0,V0),role:x.slice(V0+3)}:{path:x,role:""}});if(O.some((S)=>S.role)){Q("| Path | Role |"),Q("|------|------|");for(let S of O)Q(`| \`${S.path}\` | ${S.role} |`)}else for(let S of O)Q(`- \`${S.path}\``);Q()}let C=new Map,T=(O)=>{if(!O)return;for(let[S,x]of Object.entries(O)){if(xO.has(S)||!z0(x))continue;let V0=I5(S);if(!C.has(V0))C.set(V0,pQ(x))}};T(z?.working_style),T(X);let E=$.conventions??[];if(C.size||E.length){Q("## Conventions"),Q();for(let[O,S]of C)Q(`- **${O}:** ${S}`);for(let O of E)if(z0(O))Q(`- ${O}`);Q()}let _=(z?.warnings??[]).filter((O)=>z0(O)),w=["read the tree"];if(L)w.push(`run the tests (\`${L}\`)`);if(F)w.push("build the project");for(let[,O]of B.slice(0,1))w.push(`\`${O}\``);Q("## Guardrails"),Q();for(let O of _)Q(`- ${O}`);Q(`- **Always OK:** ${[...new Set(w)].join(" · ")}.`),Q("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),Q(`- **Never:** force-push · push straight to \`${G}\` (branch and open a PR) · commit secrets.`),Q();let c=[];for(let[,O]of B)c.push(`\`${O}\` exits 0`);for(let[,O]of W)c.push(`\`${O}\` passes`);if(c.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(c)].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 \`${G}\`.`),Q(),U&&(z0(U.secrets)||(U.never??[]).length)){if(Q("## Security & secrets"),Q(),z0(U.secrets)){let O=z0(U.example)?` (see \`${U.example}\`)`:"";Q(`- Secrets live in \`${U.secrets}\`${O}. Never read or commit them.`)}for(let O of U.never??[])if(z0(O))Q(`- Never read or commit \`${O}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&z0(X.commit_style))Q(`- Commit style: ${pQ(X.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${G}\` and open a PR — never commit to \`${G}\` directly.`),Q("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),Q(),$.stack){let O=[];for(let[S,x]of Object.entries($.stack)){if(vO.has(S))continue;if(l(x))O.push(`- **${t(`stack.${S}`)}:** ${x.trim()}`)}if(O.length){Q("## Stack"),Q();for(let S of O)Q(S);Q()}}let a=$.generated;if(z0(a))Q(`*Context authored: ${String(a)}*`);return Z.join(`
277
+ `)}function yO($,Z){M0(gO($,r.agents),lQ(Z))}import{join as kO}from"path";var hO=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),fO=new Set(["target_user","core_problem","mission_purpose"]);function cQ($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,H=z?Object.entries(z).filter(([,B])=>hO(B)):[],U=H.filter(([B])=>/test/i.test(B)),J=H.filter(([B])=>/lint|check/i.test(B)&&!/test/i.test(B)),V=H.filter(([B])=>!/test|lint|check/i.test(B)),G=(B)=>{let q=B.toLowerCase();if(/install|deps/.test(q))return 0;if(/^build$|build/.test(q)&&!/rebuild/.test(q))return 1;if(/^dev$|develop/.test(q))return 2;if(/^start$|run/.test(q))return 3;return 4},Y=[...V].sort((B,q)=>G(B[0])-G(q[0])||B[0].localeCompare(q[0])),W=[...U,...J];if(Z.push(C0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(Y.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[B,q]of Y)Z.push(`${q} # ${B}`);Z.push("```")}if(W.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,B]of W)Z.push(B);Z.push("```")}if(X&&X.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let B of X)Z.push(`- \`${B}\``)}if($.stack){let B=[];for(let[q,I]of Object.entries($.stack)){if(fO.has(q))continue;if(l(I))B.push(`- ${t(`stack.${q}`)}: ${I.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let q of B)Z.push(q)}}return Z.push(""),Z.push("## Before changing things"),Z.push(""),Z.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Z.push("- Never: force-push · push straight to `main` · commit secrets."),Z.push(""),Z.join(`
278
+ `)}function uO($,Z){M0(kO($,r.gemini),cQ(Z))}import{join as mO}from"path";function dQ($){let Z=[];if(Z.push(C0($)),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(l(z))Z.push(`# ${t(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
279
+ `)}function pO($,Z){M0(mO($,r.cursorrules),dQ(Z),"# faf:start","# faf:end")}import{join as lO}from"path";var iQ=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],cO=new Set([...iQ.map(([$])=>$),"cicd"]);function nQ($){let Z=[],Q=$.project?.name??"Project";if(Z.push(C0($)),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(""),l($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(l($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[G,Y]of Object.entries(z)){if(cO.has(G))continue;if(l(Y))X.push(`- **${t(`stack.${G}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let H=[];for(let[G,Y]of iQ){let W=z[G];if(l(W))H.push(`- ${Y} \`${W.trim()}\`.`)}if(l(z.cicd))H.push(`- CI runs on ${z.cicd.trim()}.`);if(H.length>0)Z.push("## Build & run","",...H,"");let U=$.human_context??{},V=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,G])=>l(G)).map(([G,Y])=>`- **${t(`human_context.${G}`)}:** ${Y.trim()}`);if(V.length>0)Z.push("## Project context","",...V,"");return Z.join(`
280
+ `)}function dO($,Z){p2($,".github"),M0(lO($,".github",r.copilot),nQ(Z),A0,T0,{root:$})}import{existsSync as iO,lstatSync as tQ,readFileSync as u8,realpathSync as _5,statSync as nO}from"fs";import{homedir as rO}from"os";import{basename as sO,dirname as O5,join as R0,resolve as N2}from"path";var rQ=200,sQ=200,oQ=12,oO="# Project Context (from project.faf)",aO="*This section is managed by tri-sync.";function tO($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function eQ($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=rQ)return Z;return`${Z.slice(0,rQ)}-${Math.abs(tO($)).toString(36)}`}function $z($){try{let Z=tQ($);if(Z.isSymbolicLink()){let Q=nO($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function aQ($){try{return tQ($).isFile()}catch{return!1}}function eO($){let Z=$;for(;;){if($z(R0(Z,".git")))return Z;let Q=O5(Z);if(Q===Z)return null;Z=Q}}function $M($){let Z;try{Z=u8(R0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=N2($,Z.slice(7).trim()),z=R0(Q,"commondir");if(!aQ(z))return $;let X=N2(Q,u8(z,"utf-8").trim());if(N2(O5(Q))!==R0(X,"worktrees"))return $;let H=R0(Q,"gitdir");if(!aQ(H))return $;let U=u8(H,"utf-8").trim();if(_5(N2(Q,U))!==R0(_5($),".git"))return $;if(sO(X)!==".git")return $z(R0(X,".git"))?$:X;return O5(X)}catch{return $}}function Zz($){let Z=N2($);try{Z=_5.native(Z)}catch{}let Q=eO(Z);return(Q?$M(Q):Z).normalize("NFC")}function p8($,Z={}){if(Z.memoryDir)return N2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||R0(rO(),".claude");return R0(N2(Q),"projects",eQ(Zz($)),"memory").normalize("NFC")}function ZM($,Z={}){return R0(p8($,Z),r.memory)}var QM=new Set(["target_user","core_problem","mission_purpose"]),zM=["who","what","why","where","when","how"];function Qz($){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:** ${l(Z.name)?Z.name:"Project"}`,...Q.filter(([,U])=>l(U)).map(([U,J])=>`- **${U}:** ${J}`),...f8("Stack",Object.entries($.stack??{}).filter(([U,J])=>!QM.has(U)&&l(J)).map(([U,J])=>`- **${t(`stack.${U}`)}:** ${J}`)),...f8("Context",zM.filter((U)=>l(z[U])).map((U)=>`- **${t(`human_context.${U}`)}:** ${z[U]}`)),...f8("Commands",Object.entries($.commands??{}).filter(([,U])=>l(U)).slice(0,oQ).map(([U,J])=>`- ${U}: \`${J}\``)),...f8("Key files",X.filter(l).slice(0,oQ).map((U)=>`- ${U}`)),"","*faf keeps this block in step with project.faf. Everything outside it is Claude's own and is kept as written.*"].join(`
281
+ `)}function f8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function zz($){return K5($,(Z)=>Z.trimEnd()===oO,(Z)=>Z.startsWith(aO))}function m8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function XM($,Z,Q){if($===null)return{text:k8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=F2($),X=z??zz($);if(X){let U=$.slice(0,X.start),J=$.slice(X.end);return{text:Q6(U,Z,J,void 0,void 0,Q),action:z?"updated":"migrated",head:U,tail:J}}let H=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:k8($,Z,void 0,void 0,Q),action:"added",head:H,tail:$.slice(H.length)}}function M5($){return $>sQ?[`MEMORY.md is ${$} lines. Claude Code loads the first ${sQ}; lines after that are kept in the file but not loaded.`]:[]}function HM($,Z={}){let Q=p8($,Z),z=R0(Q,r.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!iO(Q))return X;let H=X6(k(Q,r.memory));if(H===null)return X;let U=F2(H),J=U?`${H.slice(0,U.start)}${H.slice(U.end)}`:H,V=m8(H);return{path:z,exists:!0,lines:V,hasBlock:U!==null,blockLines:U?m8(H.slice(U.start,U.end)):0,hasLegacySection:!U&&zz(H)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((G)=>G.replace(/^\uFEFF/,"").trim()!=="").length,warnings:M5(V)}}function UM($,Z,Q={}){let z=p8($,Q);p2(z);let X=k(z,r.memory),H=X6(X),U=XM(H,D5(Qz(Z)),X);if(U.text===H){let B=m8(H);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:M5(B)}}let J=s(X,U.text,{root:z,expect:H}),V=u8(J,"utf-8"),G=V===U.text&&V.startsWith(U.head)&&V.endsWith(U.tail),Y=m8(V),W=U.action==="added"?h8(r.memory,H):null;return{path:J,action:U.action,written:!0,preserved:G,lines:Y,warnings:[...W?[W]:[],...M5(Y)]}}import{existsSync as l8,readFileSync as Xz}from"fs";import{join as H6}from"path";function JM($,Z){let Q=[],z=(V)=>l8(H6($,V)),X=(V)=>{try{return Xz(H6($,V),"utf-8")}catch{return""}};if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let H=[],U=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in U)H.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in U)H.push("Prettier");let J=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(J))H.push("black");if(/\[tool\.ruff\]/.test(J))H.push("ruff");if(/\[tool\.mypy\]/.test(J))H.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))H.push("rustfmt");if(H.length)Q.push(`Style enforced by ${H.join(" · ")} — obey the configs`);return Q}function VM($,Z){let Q={...Z},z=null,X=H6($,"package.json");if(l8(X))try{z=JSON.parse(Xz(X,"utf-8"))}catch{z=null}let H=x8($,z);if(Object.keys(H).length)Q.commands={...H,...Z.commands??{}};let U=Z.key_files??Z.instant_context?.key_files;if(!U||U.length===0){let J=g8($);if(J.length)Q.key_files=J}if(!Z.security){let V=[".env",".env.local",".env.development"].find((G)=>l8(H6($,G)));if(V){let G=[".env.example",".env.sample",".env.template"].find((Y)=>l8(H6($,Y)));Q.security={secrets:V,...G?{example:G}:{}}}}if(!Z.conventions){let J=JM($,z);if(J.length)Q.conventions=J}return Q}export{KK as writeServerCard,UK as writeProjectHtml,uO as writeGeminiMd,Mq as writeFaf,pO as writeCursorrules,dO as writeCopilotInstructions,UM as writeClaudeMemory,EO as writeClaudeMd,yO as writeAgentsMd,Pz as validateFaf,q2 as utcNow,SK as upsertCatalog,Dq as updateFafFile,O_ as updateExistingFaf,C8 as turboCatSlots,e3 as turboCatScan,Yz as slotsByCategory,g9 as serializeFaf,C3 as seedSixWsFromGoal,Nz as scoreText,o8 as scoreFafYaml,s as safeWriteFile,bB as safeUnlink,a7 as safeReplaceOwned,zD as runLoop,k as resolveInside,ZM as resolveClaudeMemoryPath,p8 as resolveClaudeMemoryDir,NQ as repoNameFromUrl,E4 as renderProjectHtml,cQ as renderGeminiMd,dQ as renderCursorrules,nQ as renderCopilotInstructions,Qz as renderClaudeMemory,SO as renderClaudeMd,lQ as renderAgentsMd,XQ as relentlessContextDetailed,w8 as relentlessContext,K8 as registryTitle,g4 as registryName,b4 as registryMeta,Q0 as readUtf8,FK as readFafa,y9 as readFafRaw,Kq as readFaf,jO as readClaudeMd,p4 as questionForSlot,VD as publicQuestions,bK as projectCards,DK as patchServerJson,bO as parseClaudeMd,S_ as normalizeGitUrl,L8 as normalizeAnswer,p2 as makeDirInside,E3 as loopVerdict,AO as legacyStampNoteAt,h8 as legacyStampNote,s8 as kernel,n as isPlaceholder,Pq as isNonProjectRoot,w3 as isHumanSlot,qz as isExplicitNone,I8 as isEmptyValue,aK as interviewForMissing,M0 as injectFafBlock,GD as gradeAnswers,H$ as getTier,Dz as getNextTier,IK as generateServerCard,JK as generateProjectHtml,AK as generateA2ACard,O3 as fromClaudeDir,NK as findFafaFile,k9 as findFafFile,F2 as findFafBlock,k0 as fillEmpties,C0 as fafMetaTag,c2 as fafContextBlock,w5 as enrichScore,VM as enrichFromRepo,JD as deriveQuestionSet,Eq as computeDrift,Zz as claudeProjectRoot,eQ as claudeProjectId,HM as claudeMemoryStatus,j3 as classifyGaps,n2 as canonicalPriority,ZD as buildTableOf8,m$ as buildServerCard,YD as buildReceipt,v4 as buildA2ACard,b_ as authorFafFromRepo,G5 as assembleFreshFaf,x3 as answersMatch,j0 as TIERS,j as SafePathError,A3 as STACK_INTERVIEW,w0 as SLOT_BY_PATH,f as SLOTS,V6 as SLOTIGNORED,m4 as SIX_WS_INTERVIEW,Q3 as REGISTRY_PUBLISHER_KEY,$2 as PRIORITY_RANK,y4 as PRIORITY_ORDER,J6 as PLACEHOLDERS,D8 as KNOWLEDGE_TYPES,P3 as INTERVIEW_VERSION,oK as INTERVIEW_PATHS,T3 as INTERVIEW_BY_PATH,s2 as INTERVIEW,U0 as FafmSoul,EQ as FafDNAManager,A0 as FAF_START,z$ as FAF_HEX,T0 as FAF_END,P5 as EXPLICIT_NONE,Bz as ENTERPRISE_SLOTS,c4 as BENCH_VERSION,Wz as BASE_SLOTS,g3 as ALIAS_GROUPS,U3 as A2A_CONTEXT_URI};
242
282
 
243
- //# debugId=BF5C086D07C3FBEC64756E2164756E21
283
+ //# debugId=DE05CBFEEDBF3CCC64756E2164756E21
244
284
  //# sourceMappingURL=index.js.map