faf-cli 7.15.0 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,182 +1,182 @@
1
- import{createRequire as Bz}from"node:module";var Vz=Object.defineProperty;var P=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Gz=($)=>$;function Yz($,Z){this[$]=Gz.bind(null,Z)}var Wz=($,Z)=>{for(var Q in Z)Vz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:Yz.bind(Z,Q)})};var J$=Bz(import.meta.url);var x=P((gz)=>{var o8=Symbol.for("yaml.alias"),j5=Symbol.for("yaml.document"),B6=Symbol.for("yaml.map"),w5=Symbol.for("yaml.pair"),a8=Symbol.for("yaml.scalar"),q6=Symbol.for("yaml.seq"),b0=Symbol.for("yaml.node.type"),jz=($)=>!!$&&typeof $==="object"&&$[b0]===o8,wz=($)=>!!$&&typeof $==="object"&&$[b0]===j5,Sz=($)=>!!$&&typeof $==="object"&&$[b0]===B6,Ez=($)=>!!$&&typeof $==="object"&&$[b0]===w5,S5=($)=>!!$&&typeof $==="object"&&$[b0]===a8,bz=($)=>!!$&&typeof $==="object"&&$[b0]===q6;function E5($){if($&&typeof $==="object")switch($[b0]){case B6:case q6:return!0}return!1}function yz($){if($&&typeof $==="object")switch($[b0]){case o8:case B6:case a8:case q6:return!0}return!1}var xz=($)=>(S5($)||E5($))&&!!$.anchor;gz.ALIAS=o8;gz.DOC=j5;gz.MAP=B6;gz.NODE_TYPE=b0;gz.PAIR=w5;gz.SCALAR=a8;gz.SEQ=q6;gz.hasAnchor=xz;gz.isAlias=jz;gz.isCollection=E5;gz.isDocument=wz;gz.isMap=Sz;gz.isNode=yz;gz.isPair=Ez;gz.isScalar=S5;gz.isSeq=bz});var B$=P((tz)=>{var n=x(),Q0=Symbol("break visit"),b5=Symbol("skip children"),R0=Symbol("remove node");function K6($,Z){let Q=y5(Z);if(n.isDocument($)){if(S2(null,$.contents,Q,Object.freeze([$]))===R0)$.contents=null}else S2(null,$,Q,Object.freeze([]))}K6.BREAK=Q0;K6.SKIP=b5;K6.REMOVE=R0;function S2($,Z,Q,z){let X=x5($,Z,Q,z);if(n.isNode(X)||n.isPair(X))return g5($,z,X),S2($,X,Q,z);if(typeof X!=="symbol"){if(n.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=S2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===Q0)return Q0;else if(U===R0)Z.items.splice(H,1),H-=1}}else if(n.isPair(Z)){z=Object.freeze(z.concat(Z));let H=S2("key",Z.key,Q,z);if(H===Q0)return Q0;else if(H===R0)Z.key=null;let U=S2("value",Z.value,Q,z);if(U===Q0)return Q0;else if(U===R0)Z.value=null}}return X}async function D6($,Z){let Q=y5(Z);if(n.isDocument($)){if(await E2(null,$.contents,Q,Object.freeze([$]))===R0)$.contents=null}else await E2(null,$,Q,Object.freeze([]))}D6.BREAK=Q0;D6.SKIP=b5;D6.REMOVE=R0;async function E2($,Z,Q,z){let X=await x5($,Z,Q,z);if(n.isNode(X)||n.isPair(X))return g5($,z,X),E2($,X,Q,z);if(typeof X!=="symbol"){if(n.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===Q0)return Q0;else if(U===R0)Z.items.splice(H,1),H-=1}}else if(n.isPair(Z)){z=Object.freeze(z.concat(Z));let H=await E2("key",Z.key,Q,z);if(H===Q0)return Q0;else if(H===R0)Z.key=null;let U=await E2("value",Z.value,Q,z);if(U===Q0)return Q0;else if(U===R0)Z.value=null}}return X}function y5($){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 x5($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(n.isMap(Z))return Q.Map?.($,Z,z);if(n.isSeq(Z))return Q.Seq?.($,Z,z);if(n.isPair(Z))return Q.Pair?.($,Z,z);if(n.isScalar(Z))return Q.Scalar?.($,Z,z);if(n.isAlias(Z))return Q.Alias?.($,Z,z);return}function g5($,Z,Q){let z=Z[Z.length-1];if(n.isCollection(z))z.items[$]=Q;else if(n.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(n.isDocument(z))z.contents=Q;else{let X=n.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}tz.visit=K6;tz.visitAsync=D6});var t8=P((XX)=>{var v5=x(),ZX=B$(),QX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},zX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>QX[Z]);class U0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},U0.defaultYaml,$),this.tags=Object.assign({},U0.defaultTags,Z)}clone(){let $=new U0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new U0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:U0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},U0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:U0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},U0.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+zX($.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&&v5.isNode($.contents)){let X={};ZX.visit($.contents,(H,U)=>{if(v5.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
- `)}}U0.defaultYaml={explicit:!1,version:"1.2"};U0.defaultTags={"!!":"tag:yaml.org,2002:"};XX.Directives=U0});var L6=P((GX)=>{var k5=x(),UX=B$();function JX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function h5($){let Z=new Set;return UX.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 VX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(H)=>{Q.push(H),X??(X=h5($));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&&(k5.isScalar(U.node)||k5.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}}GX.anchorIsValid=JX;GX.anchorNames=h5;GX.createNodeAnchors=VX;GX.findNewAnchor=u5});var e8=P((KX)=>{function q$($,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=q$($,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=q$($,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=q$($,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=q$($,z,X,H);if(U===void 0)delete z[X];else if(U!==H)z[X]=U}return $.call(Z,Q,z)}KX.applyReviver=q$});var p0=P((IX)=>{var LX=x();function f5($,Z,Q){if(Array.isArray($))return $.map((z,X)=>f5(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!LX.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 $}IX.toJS=f5});var I6=P((PX)=>{var _X=e8(),m5=x(),MX=p0();class p5{constructor($){Object.defineProperty(this,m5.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(!m5.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=MX.toJS(this,"",H);if(typeof z==="function")for(let{count:J,res:V}of H.anchors.values())z(V,J);return typeof X==="function"?_X.applyReviver(X,{"":U},"",U):U}}PX.NodeBase=p5});var K$=P((CX)=>{var RX=L6(),FX=B$(),b2=x(),TX=I6(),AX=p0();class l5 extends TX.NodeBase{constructor($){super(b2.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=[],FX.visit($,{Node:(X,H)=>{if(b2.isAlias(H)||b2.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)AX.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=O6(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(RX.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 O6($,Z,Q){if(b2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(b2.isCollection(Z)){let z=0;for(let X of Z.items){let H=O6($,X,Q);if(H>z)z=H}return z}else if(b2.isPair(Z)){let z=O6($,Z.key,Q),X=O6($,Z.value,Q);return Math.max(z,X)}return 1}CX.Alias=l5});var c=P((yX)=>{var wX=x(),SX=I6(),EX=p0(),bX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class Q2 extends SX.NodeBase{constructor($){super(wX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:EX.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";yX.Scalar=Q2;yX.isScalarValue=bX});var D$=P((fX)=>{var vX=K$(),z2=x(),c5=c(),kX="tag:yaml.org,2002:";function hX($,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 uX($,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 vX.Alias(V.anchor);else V={anchor:null,node:null},J.set($,V);if(Z?.startsWith("!!"))Z=kX+Z.slice(2);let G=hX($,Z,U.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new c5.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 c5.Scalar($);if(Z)Y.tag=Z;else if(!G.default)Y.tag=G.tag;if(V)V.node=Y;return Y}fX.createNode=uX});var _6=P((cX)=>{var pX=D$(),F0=x(),lX=I6();function $1($,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 pX.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var d5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class i5 extends lX.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)=>F0.isNode(Q)||F0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(d5($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(F0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,$1(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(F0.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&&F0.isScalar(X)?X.value:X;else return F0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!F0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&F0.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 F0.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(F0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,$1(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}cX.Collection=i5;cX.collectionFromPath=$1;cX.isEmptyPath=d5});var L$=P((oX)=>{var rX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Z1($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var sX=($,Z,Q)=>$.endsWith(`
3
- `)?Z1(Q,Z):Q.includes(`
1
+ import{createRequire as Dz}from"node:module";var Wz=Object.defineProperty;var P=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var Bz=($)=>$;function qz($,Z){this[$]=Bz.bind(null,Z)}var Kz=($,Z)=>{for(var Q in Z)Wz($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:qz.bind(Z,Q)})};var G$=Dz(import.meta.url);var x=P((hz)=>{var a8=Symbol.for("yaml.alias"),E5=Symbol.for("yaml.document"),K6=Symbol.for("yaml.map"),b5=Symbol.for("yaml.pair"),t8=Symbol.for("yaml.scalar"),D6=Symbol.for("yaml.seq"),b0=Symbol.for("yaml.node.type"),Ez=($)=>!!$&&typeof $==="object"&&$[b0]===a8,bz=($)=>!!$&&typeof $==="object"&&$[b0]===E5,yz=($)=>!!$&&typeof $==="object"&&$[b0]===K6,xz=($)=>!!$&&typeof $==="object"&&$[b0]===b5,y5=($)=>!!$&&typeof $==="object"&&$[b0]===t8,gz=($)=>!!$&&typeof $==="object"&&$[b0]===D6;function x5($){if($&&typeof $==="object")switch($[b0]){case K6:case D6:return!0}return!1}function vz($){if($&&typeof $==="object")switch($[b0]){case a8:case K6:case t8:case D6:return!0}return!1}var kz=($)=>(y5($)||x5($))&&!!$.anchor;hz.ALIAS=a8;hz.DOC=E5;hz.MAP=K6;hz.NODE_TYPE=b0;hz.PAIR=b5;hz.SCALAR=t8;hz.SEQ=D6;hz.hasAnchor=kz;hz.isAlias=Ez;hz.isCollection=x5;hz.isDocument=bz;hz.isMap=yz;hz.isNode=vz;hz.isPair=xz;hz.isScalar=y5;hz.isSeq=gz});var q$=P((ZX)=>{var n=x(),Q0=Symbol("break visit"),g5=Symbol("skip children"),R0=Symbol("remove node");function L6($,Z){let Q=v5(Z);if(n.isDocument($)){if(E2(null,$.contents,Q,Object.freeze([$]))===R0)$.contents=null}else E2(null,$,Q,Object.freeze([]))}L6.BREAK=Q0;L6.SKIP=g5;L6.REMOVE=R0;function E2($,Z,Q,z){let X=k5($,Z,Q,z);if(n.isNode(X)||n.isPair(X))return h5($,z,X),E2($,X,Q,z);if(typeof X!=="symbol"){if(n.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let H=E2(U,Z.items[U],Q,z);if(typeof H==="number")U=H-1;else if(H===Q0)return Q0;else if(H===R0)Z.items.splice(U,1),U-=1}}else if(n.isPair(Z)){z=Object.freeze(z.concat(Z));let U=E2("key",Z.key,Q,z);if(U===Q0)return Q0;else if(U===R0)Z.key=null;let H=E2("value",Z.value,Q,z);if(H===Q0)return Q0;else if(H===R0)Z.value=null}}return X}async function I6($,Z){let Q=v5(Z);if(n.isDocument($)){if(await b2(null,$.contents,Q,Object.freeze([$]))===R0)$.contents=null}else await b2(null,$,Q,Object.freeze([]))}I6.BREAK=Q0;I6.SKIP=g5;I6.REMOVE=R0;async function b2($,Z,Q,z){let X=await k5($,Z,Q,z);if(n.isNode(X)||n.isPair(X))return h5($,z,X),b2($,X,Q,z);if(typeof X!=="symbol"){if(n.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let H=await b2(U,Z.items[U],Q,z);if(typeof H==="number")U=H-1;else if(H===Q0)return Q0;else if(H===R0)Z.items.splice(U,1),U-=1}}else if(n.isPair(Z)){z=Object.freeze(z.concat(Z));let U=await b2("key",Z.key,Q,z);if(U===Q0)return Q0;else if(U===R0)Z.key=null;let H=await b2("value",Z.value,Q,z);if(H===Q0)return Q0;else if(H===R0)Z.value=null}}return X}function v5($){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 k5($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(n.isMap(Z))return Q.Map?.($,Z,z);if(n.isSeq(Z))return Q.Seq?.($,Z,z);if(n.isPair(Z))return Q.Pair?.($,Z,z);if(n.isScalar(Z))return Q.Scalar?.($,Z,z);if(n.isAlias(Z))return Q.Alias?.($,Z,z);return}function h5($,Z,Q){let z=Z[Z.length-1];if(n.isCollection(z))z.items[$]=Q;else if(n.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(n.isDocument(z))z.contents=Q;else{let X=n.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}ZX.visit=L6;ZX.visitAsync=I6});var e8=P((JX)=>{var u5=x(),XX=q$(),UX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},HX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>UX[Z]);class H0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},H0.defaultYaml,$),this.tags=Object.assign({},H0.defaultTags,Z)}clone(){let $=new H0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new H0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:H0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},H0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:H0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},H0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,U]=Q;return this.tags[X]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let U=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,U),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let U=$.slice(2,-1);if(U==="!"||U==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return U}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(U){return Z(String(U)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+HX($.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&&u5.isNode($.contents)){let X={};XX.visit($.contents,(U,H)=>{if(u5.isNode(H)&&H.tag)X[H.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,U]of Q){if(X==="!!"&&U==="tag:yaml.org,2002:")continue;if(!$||z.some((H)=>H.startsWith(U)))Z.push(`%TAG ${X} ${U}`)}return Z.join(`
2
+ `)}}H0.defaultYaml={explicit:!1,version:"1.2"};H0.defaultTags={"!!":"tag:yaml.org,2002:"};JX.Directives=H0});var O6=P((BX)=>{var f5=x(),VX=q$();function YX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function m5($){let Z=new Set;return VX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function p5($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function WX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(U)=>{Q.push(U),X??(X=m5($));let H=p5(Z,X);return X.add(H),H},setAnchors:()=>{for(let U of Q){let H=z.get(U);if(typeof H==="object"&&H.anchor&&(f5.isScalar(H.node)||f5.isCollection(H.node)))H.node.anchor=H.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=U,J}}},sourceObjects:z}}BX.anchorIsValid=YX;BX.anchorNames=m5;BX.createNodeAnchors=WX;BX.findNewAnchor=p5});var $1=P((IX)=>{function K$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,U=z.length;X<U;++X){let H=z[X],J=K$($,z,String(X),H);if(J===void 0)delete z[X];else if(J!==H)z[X]=J}else if(z instanceof Map)for(let X of Array.from(z.keys())){let U=z.get(X),H=K$($,z,X,U);if(H===void 0)z.delete(X);else if(H!==U)z.set(X,H)}else if(z instanceof Set)for(let X of Array.from(z)){let U=K$($,z,X,X);if(U===void 0)z.delete(X);else if(U!==X)z.delete(X),z.add(U)}else for(let[X,U]of Object.entries(z)){let H=K$($,z,X,U);if(H===void 0)delete z[X];else if(H!==U)z[X]=H}return $.call(Z,Q,z)}IX.applyReviver=K$});var p0=P((MX)=>{var _X=x();function l5($,Z,Q){if(Array.isArray($))return $.map((z,X)=>l5(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!_X.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(U)=>{z.res=U,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}MX.toJS=l5});var _6=P((FX)=>{var NX=$1(),c5=x(),RX=p0();class d5{constructor($){Object.defineProperty(this,c5.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(!c5.isDocument($))throw TypeError("A document argument is required");let U={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},H=RX.toJS(this,"",U);if(typeof z==="function")for(let{count:J,res:G}of U.anchors.values())z(G,J);return typeof X==="function"?NX.applyReviver(X,{"":H},"",H):H}}FX.NodeBase=d5});var D$=P((SX)=>{var AX=O6(),CX=q$(),y2=x(),jX=_6(),wX=p0();class i5 extends jX.NodeBase{constructor($){super(y2.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=[],CX.visit($,{Node:(X,U)=>{if(y2.isAlias(U)||y2.hasAnchor(U))Q.push(U)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,U=this.resolve(z,Z);if(!U){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let H=Q.get(U);if(!H)wX.toJS(U,null,Z),H=Q.get(U);if(H?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(H.count+=1,H.aliasCount===0)H.aliasCount=M6(z,U,Q);if(H.count*H.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return H.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(AX.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 M6($,Z,Q){if(y2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(y2.isCollection(Z)){let z=0;for(let X of Z.items){let U=M6($,X,Q);if(U>z)z=U}return z}else if(y2.isPair(Z)){let z=M6($,Z.key,Q),X=M6($,Z.value,Q);return Math.max(z,X)}return 1}SX.Alias=i5});var c=P((vX)=>{var bX=x(),yX=_6(),xX=p0(),gX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class z2 extends yX.NodeBase{constructor($){super(bX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:xX.toJS(this.value,$,Z)}toString(){return String(this.value)}}z2.BLOCK_FOLDED="BLOCK_FOLDED";z2.BLOCK_LITERAL="BLOCK_LITERAL";z2.PLAIN="PLAIN";z2.QUOTE_DOUBLE="QUOTE_DOUBLE";z2.QUOTE_SINGLE="QUOTE_SINGLE";vX.Scalar=z2;vX.isScalarValue=gX});var L$=P((lX)=>{var uX=D$(),X2=x(),n5=c(),fX="tag:yaml.org,2002:";function mX($,Z,Q){if(Z){let z=Q.filter((U)=>U.tag===Z),X=z.find((U)=>!U.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function pX($,Z,Q){if(X2.isDocument($))$=$.contents;if(X2.isNode($))return $;if(X2.isPair($)){let W=Q.schema[X2.MAP].createNode?.(Q.schema,null,Q);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:X,onTagObj:U,schema:H,sourceObjects:J}=Q,G=void 0;if(z&&$&&typeof $==="object")if(G=J.get($),G)return G.anchor??(G.anchor=X($)),new uX.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(Z?.startsWith("!!"))Z=fX+Z.slice(2);let V=mX($,Z,H.tags);if(!V){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new n5.Scalar($);if(G)G.node=W;return W}V=$ instanceof Map?H[X2.MAP]:(Symbol.iterator in Object($))?H[X2.SEQ]:H[X2.MAP]}if(U)U(V),delete Q.onTagObj;let Y=V?.createNode?V.createNode(Q.schema,$,Q):typeof V?.nodeClass?.from==="function"?V.nodeClass.from(Q.schema,$,Q):new n5.Scalar($);if(Z)Y.tag=Z;else if(!V.default)Y.tag=V.tag;if(G)G.node=Y;return Y}lX.createNode=pX});var P6=P((nX)=>{var dX=L$(),F0=x(),iX=_6();function Z1($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let U=Z[X];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let H=[];H[U]=z,z=H}else z=new Map([[U,z]])}return dX.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var r5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class s5 extends iX.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)=>F0.isNode(Q)||F0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(r5($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(F0.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(F0.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&&F0.isScalar(X)?X.value:X;else return F0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!F0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&F0.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 F0.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(F0.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}`)}}}nX.Collection=s5;nX.collectionFromPath=Z1;nX.isEmptyPath=r5});var I$=P((eX)=>{var aX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Q1($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var tX=($,Z,Q)=>$.endsWith(`
3
+ `)?Q1(Q,Z):Q.includes(`
4
4
  `)?`
5
- `+Z1(Q,Z):($.endsWith(" ")?"":" ")+Q;oX.indentComment=Z1;oX.lineComment=sX;oX.stringifyComment=rX});var r5=P((ZH)=>{function $H($,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,K=void 0,L=!1,q=-1,D=-1,O=-1;if(Q==="block"){if(q=n5($,q,Z.length),q!==-1)W=q+V}for(let F;F=$[q+=1];){if(Q==="quoted"&&F==="\\"){switch(D=q,$[q+1]){case"x":q+=3;break;case"u":q+=5;break;case"U":q+=9;break;default:q+=1}O=q}if(F===`
6
- `){if(Q==="block")q=n5($,q,Z.length);W=q+Z.length+V,B=void 0}else{if(F===" "&&K&&K!==" "&&K!==`
5
+ `+Q1(Q,Z):($.endsWith(" ")?"":" ")+Q;eX.indentComment=Q1;eX.lineComment=tX;eX.stringifyComment=aX});var a5=P((XU)=>{function zU($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:U=20,onFold:H,onOverflow:J}={}){if(!X||X<0)return $;if(X<U)U=0;let G=Math.max(1+U,1+X-Z.length);if($.length<=G)return $;let V=[],Y={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,U))V.push(0);else W=X-z;let B=void 0,K=void 0,L=!1,q=-1,D=-1,O=-1;if(Q==="block"){if(q=o5($,q,Z.length),q!==-1)W=q+G}for(let F;F=$[q+=1];){if(Q==="quoted"&&F==="\\"){switch(D=q,$[q+1]){case"x":q+=3;break;case"u":q+=5;break;case"U":q+=9;break;default:q+=1}O=q}if(F===`
6
+ `){if(Q==="block")q=o5($,q,Z.length);W=q+Z.length+G,B=void 0}else{if(F===" "&&K&&K!==" "&&K!==`
7
7
  `&&K!=="\t"){let R=$[q+1];if(R&&R!==" "&&R!==`
8
- `&&R!=="\t")B=q}if(q>=W)if(B)G.push(B),W=B+V,B=void 0;else if(Q==="quoted"){while(K===" "||K==="\t")K=F,F=$[q+=1],L=!0;let R=q>O+1?q-2:D-1;if(Y[R])return $;G.push(R),Y[R]=!0,W=R+V,B=void 0}else L=!0}K=F}if(L&&J)J();if(G.length===0)return $;if(U)U();let M=$.slice(0,G[0]);for(let F=0;F<G.length;++F){let R=G[F],T=G[F+1]||$.length;if(R===0)M=`
8
+ `&&R!=="\t")B=q}if(q>=W)if(B)V.push(B),W=B+G,B=void 0;else if(Q==="quoted"){while(K===" "||K==="\t")K=F,F=$[q+=1],L=!0;let R=q>O+1?q-2:D-1;if(Y[R])return $;V.push(R),Y[R]=!0,W=R+G,B=void 0}else L=!0}K=F}if(L&&J)J();if(V.length===0)return $;if(H)H();let M=$.slice(0,V[0]);for(let F=0;F<V.length;++F){let R=V[F],T=V[F+1]||$.length;if(R===0)M=`
9
9
  ${Z}${$.slice(0,T)}`;else{if(Q==="quoted"&&Y[R])M+=`${$[R]}\\`;M+=`
10
- ${Z}${$.slice(R+1,T)}`}}return M}function n5($,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}ZH.FOLD_BLOCK="block";ZH.FOLD_FLOW="flow";ZH.FOLD_QUOTED="quoted";ZH.foldFlowLines=$H});var O$=P((GH)=>{var W0=c(),l0=r5(),P6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),N6=($)=>/^(%|---|\.\.\.)/m.test($);function UH($,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 I$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,H=Z.indent||(N6($)?" ":""),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)+`
10
+ ${Z}${$.slice(R+1,T)}`}}return M}function o5($,Z,Q){let z=Z,X=Z+1,U=$[X];while(U===" "||U==="\t")if(Z<X+Q)U=$[++Z];else{do U=$[++Z];while(U&&U!==`
11
+ `);z=Z,X=Z+1,U=$[X]}return z}XU.FOLD_BLOCK="block";XU.FOLD_FLOW="flow";XU.FOLD_QUOTED="quoted";XU.foldFlowLines=zU});var _$=P((BU)=>{var W0=c(),l0=a5(),R6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),F6=($)=>/^(%|---|\.\.\.)/m.test($);function VU($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let U=0,H=0;U<X;++U)if($[U]===`
12
+ `){if(U-H>z)return!0;if(H=U+1,X-H<=z)return!1}return!0}function O$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,U=Z.indent||(F6($)?" ":""),H="",J=0;for(let G=0,V=Q[G];V;V=Q[++G]){if(V===" "&&Q[G+1]==="\\"&&Q[G+2]==="n")H+=Q.slice(J,G)+"\\ ",G+=1,J=G,V="\\";if(V==="\\")switch(Q[G+1]){case"u":{H+=Q.slice(J,G);let Y=Q.substr(G+2,4);switch(Y){case"0000":H+="\\0";break;case"0007":H+="\\a";break;case"000b":H+="\\v";break;case"001b":H+="\\e";break;case"0085":H+="\\N";break;case"00a0":H+="\\_";break;case"2028":H+="\\L";break;case"2029":H+="\\P";break;default:if(Y.substr(0,2)==="00")H+="\\x"+Y.substr(2);else H+=Q.substr(G,6)}G+=5,J=G+1}break;case"n":if(z||Q[G+2]==='"'||Q.length<X)G+=1;else{H+=Q.slice(J,G)+`
13
13
 
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:l0.foldFlowLines(U,H,l0.FOLD_QUOTED,P6(Z,!1))}function Q1($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test($))return I$($,Z);let Q=Z.indent||(N6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${Q}`)+"'";return Z.implicitKey?z:l0.foldFlowLines(z,Q,l0.FOLD_FLOW,P6(Z,!1))}function y2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=I$;else{let X=$.includes('"'),H=$.includes("'");if(X&&!H)z=Q1;else if(H&&!X)z=I$;else z=Q?Q1:I$}return z($,Z)}var z1;try{z1=new RegExp(`(^|(?<!
14
+ `;while(Q[G+2]==="\\"&&Q[G+3]==="n"&&Q[G+4]!=='"')H+=`
15
+ `,G+=2;if(H+=U,Q[G+2]===" ")H+="\\";G+=1,J=G+1}break;default:G+=1}}return H=J?H+Q.slice(J):Q,z?H:l0.foldFlowLines(H,U,l0.FOLD_QUOTED,R6(Z,!1))}function z1($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return O$($,Z);let Q=Z.indent||(F6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${Q}`)+"'";return Z.implicitKey?z:l0.foldFlowLines(z,Q,l0.FOLD_FLOW,R6(Z,!1))}function x2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=O$;else{let X=$.includes('"'),U=$.includes("'");if(X&&!U)z=z1;else if(U&&!X)z=O$;else z=Q?z1:O$}return z($,Z)}var X1;try{X1=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{z1=/\n+(?!\n|$)/g}function M6({comment:$,type:Z,value:Q},z,X,H){let{blockQuote:U,commentString:J,lineWidth:V}=z.options;if(!U||/\n[\t ]+$/.test(Q))return y2(Q,z);let G=z.indent||(z.forceBlockIndent||N6(Q)?" ":""),Y=U==="literal"?!0:U==="folded"||Z===W0.Scalar.BLOCK_FOLDED?!1:Z===W0.Scalar.BLOCK_LITERAL?!0:!UH(Q,V,G.length);if(!Q)return Y?`|
20
+ |$)`,"g")}catch{X1=/\n+(?!\n|$)/g}function N6({comment:$,type:Z,value:Q},z,X,U){let{blockQuote:H,commentString:J,lineWidth:G}=z.options;if(!H||/\n[\t ]+$/.test(Q))return x2(Q,z);let V=z.indent||(z.forceBlockIndent||F6(Q)?" ":""),Y=H==="literal"?!0:H==="folded"||Z===W0.Scalar.BLOCK_FOLDED?!1:Z===W0.Scalar.BLOCK_LITERAL?!0:!VU(Q,G,V.length);if(!Q)return Y?`|
21
21
  `:`>
22
22
  `;let W,B;for(B=Q.length;B>0;--B){let T=Q[B-1];if(T!==`
23
23
  `&&T!=="\t"&&T!==" ")break}let K=Q.substring(B),L=K.indexOf(`
24
- `);if(L===-1)W="-";else if(Q===K||L!==K.length-1){if(W="+",H)H()}else W="";if(K){if(Q=Q.slice(0,-K.length),K[K.length-1]===`
25
- `)K=K.slice(0,-1);K=K.replace(z1,`$&${G}`)}let q=!1,D,O=-1;for(D=0;D<Q.length;++D){let T=Q[D];if(T===" ")q=!0;else if(T===`
26
- `)O=D;else break}let M=Q.substring(0,O<D?O+1:D);if(M)Q=Q.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let R=(q?G?"2":"1":"")+W;if($){if(R+=" "+J($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!Y){let T=Q.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,j=P6(z,!0);if(U!=="folded"&&Z!==W0.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{A=!0};let N=l0.foldFlowLines(`${M}${T}${K}`,G,l0.FOLD_BLOCK,j);if(!A)return`>${R}
28
- ${G}${N}`}return Q=Q.replace(/\n+/g,`$&${G}`),`|${R}
29
- ${G}${M}${Q}${K}`}function JH($,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 y2(H,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||Y||!H.includes(`
31
- `)?y2(H,Z):M6($,Z,Q,z);if(!J&&!Y&&X!==W0.Scalar.PLAIN&&H.includes(`
32
- `))return M6($,Z,Q,z);if(N6(H)){if(V==="")return Z.forceBlockIndent=!0,M6($,Z,Q,z);else if(J&&V===G)return y2(H,Z)}let W=H.replace(/\n+/g,`$&
33
- ${V}`);if(U){let B=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(W),{compat:K,tags:L}=Z.doc.schema;if(L.some(B)||K?.some(B))return y2(H,Z)}return J?W:l0.foldFlowLines(W,V,l0.FOLD_FLOW,P6(Z,!1))}function VH($,Z,Q,z){let{implicitKey:X,inFlow:H}=Z,U=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==W0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))J=W0.Scalar.QUOTE_DOUBLE}let V=(Y)=>{switch(Y){case W0.Scalar.BLOCK_FOLDED:case W0.Scalar.BLOCK_LITERAL:return X||H?y2(U.value,Z):M6(U,Z,Q,z);case W0.Scalar.QUOTE_DOUBLE:return I$(U.value,Z);case W0.Scalar.QUOTE_SINGLE:return Q1(U.value,Z);case W0.Scalar.PLAIN:return JH(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}GH.stringifyString=VH});var _$=P((OH)=>{var WH=L6(),c0=x(),BH=L$(),qH=O$();function KH($,Z){let Q=Object.assign({blockQuote:!0,commentString:BH.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 DH($,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(c0.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 LH($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],H=(c0.isScalar($)||c0.isCollection($))&&$.anchor;if(H&&WH.anchorIsValid(H))Q.add(H),X.push(`&${H}`);let U=$.tag??(Z.default?null:Z.tag);if(U)X.push(z.directives.tagString(U));return X.join(" ")}function IH($,Z,Q,z){if(c0.isPair($))return $.toString(Z,Q,z);if(c0.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=c0.isNode($)?$:Z.doc.createNode($,{onTagObj:(V)=>X=V});X??(X=DH(Z.doc.schema.tags,H));let U=LH(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):c0.isScalar(H)?qH.stringifyString(H,Z,Q,z):H.toString(Z,Q,z);if(!U)return J;return c0.isScalar(H)||J[0]==="{"||J[0]==="["?`${U} ${J}`:`${U}
34
- ${Z.indent}${J}`}OH.createStringifyContext=KH;OH.stringify=IH});var a5=P((NH)=>{var y0=x(),s5=c(),o5=_$(),M$=L$();function PH({key:$,value:Z},Q,z,X){let{allNullValues:H,doc:U,indent:J,indentStep:V,options:{commentString:G,indentSeq:Y,simpleKeys:W}}=Q,B=y0.isNode($)&&$.comment||null;if(W){if(B)throw Error("With simple keys, key nodes cannot have comments");if(y0.isCollection($)||!y0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||B&&Z==null&&!Q.inFlow||y0.isCollection($)||(y0.isScalar($)?$.type===s5.Scalar.BLOCK_FOLDED||$.type===s5.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!H),indent:J+V});let L=!1,q=!1,D=o5.stringify($,Q,()=>L=!0,()=>q=!0);if(!K&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(H||Z==null){if(L&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(H&&!W||Z==null&&K){if(D=`? ${D}`,B&&!L)D+=M$.lineComment(D,Q.indent,G(B));else if(q&&X)X();return D}if(L)B=null;if(K){if(B)D+=M$.lineComment(D,Q.indent,G(B));D=`? ${D}
35
- ${J}:`}else if(D=`${D}:`,B)D+=M$.lineComment(D,Q.indent,G(B));let O,M,F;if(y0.isNode(Z))O=!!Z.spaceBefore,M=Z.commentBefore,F=Z.comment;else if(O=!1,M=null,F=null,Z&&typeof Z==="object")Z=U.createNode(Z);if(Q.implicitKey=!1,!K&&!B&&y0.isScalar(Z))Q.indentAtStart=D.length+1;if(q=!1,!Y&&V.length>=2&&!Q.inFlow&&!K&&y0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let R=!1,T=o5.stringify(Z,Q,()=>R=!0,()=>q=!0),A=" ";if(B||O||M){if(A=O?`
36
- `:"",M){let j=G(M);A+=`
37
- ${M$.indentComment(j,Q.indent)}`}if(T===""&&!Q.inFlow){if(A===`
24
+ `);if(L===-1)W="-";else if(Q===K||L!==K.length-1){if(W="+",U)U()}else W="";if(K){if(Q=Q.slice(0,-K.length),K[K.length-1]===`
25
+ `)K=K.slice(0,-1);K=K.replace(X1,`$&${V}`)}let q=!1,D,O=-1;for(D=0;D<Q.length;++D){let T=Q[D];if(T===" ")q=!0;else if(T===`
26
+ `)O=D;else break}let M=Q.substring(0,O<D?O+1:D);if(M)Q=Q.substring(M.length),M=M.replace(/\n+/g,`$&${V}`);let R=(q?V?"2":"1":"")+W;if($){if(R+=" "+J($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!Y){let T=Q.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${V}`),A=!1,j=R6(z,!0);if(H!=="folded"&&Z!==W0.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{A=!0};let N=l0.foldFlowLines(`${M}${T}${K}`,V,l0.FOLD_BLOCK,j);if(!A)return`>${R}
28
+ ${V}${N}`}return Q=Q.replace(/\n+/g,`$&${V}`),`|${R}
29
+ ${V}${M}${Q}${K}`}function YU($,Z,Q,z){let{type:X,value:U}=$,{actualString:H,implicitKey:J,indent:G,indentStep:V,inFlow:Y}=Z;if(J&&U.includes(`
30
+ `)||Y&&/[[\]{},]/.test(U))return x2(U,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return J||Y||!U.includes(`
31
+ `)?x2(U,Z):N6($,Z,Q,z);if(!J&&!Y&&X!==W0.Scalar.PLAIN&&U.includes(`
32
+ `))return N6($,Z,Q,z);if(F6(U)){if(G==="")return Z.forceBlockIndent=!0,N6($,Z,Q,z);else if(J&&G===V)return x2(U,Z)}let W=U.replace(/\n+/g,`$&
33
+ ${G}`);if(H){let B=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(W),{compat:K,tags:L}=Z.doc.schema;if(L.some(B)||K?.some(B))return x2(U,Z)}return J?W:l0.foldFlowLines(W,G,l0.FOLD_FLOW,R6(Z,!1))}function WU($,Z,Q,z){let{implicitKey:X,inFlow:U}=Z,H=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==W0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(H.value))J=W0.Scalar.QUOTE_DOUBLE}let G=(Y)=>{switch(Y){case W0.Scalar.BLOCK_FOLDED:case W0.Scalar.BLOCK_LITERAL:return X||U?x2(H.value,Z):N6(H,Z,Q,z);case W0.Scalar.QUOTE_DOUBLE:return O$(H.value,Z);case W0.Scalar.QUOTE_SINGLE:return z1(H.value,Z);case W0.Scalar.PLAIN:return YU(H,Z,Q,z);default:return null}},V=G(J);if(V===null){let{defaultKeyType:Y,defaultStringType:W}=Z.options,B=X&&Y||W;if(V=G(B),V===null)throw Error(`Unsupported default string type ${B}`)}return V}BU.stringifyString=WU});var M$=P((PU)=>{var KU=O6(),c0=x(),DU=I$(),LU=_$();function IU($,Z){let Q=Object.assign({blockQuote:!0,commentString:DU.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 OU($,Z){if(Z.tag){let X=$.filter((U)=>U.tag===Z.tag);if(X.length>0)return X.find((U)=>U.format===Z.format)??X[0]}let Q=void 0,z;if(c0.isScalar(Z)){z=Z.value;let X=$.filter((U)=>U.identify?.(z));if(X.length>1){let U=X.filter((H)=>H.test);if(U.length>0)X=U}Q=X.find((U)=>U.format===Z.format)??X.find((U)=>!U.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function _U($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],U=(c0.isScalar($)||c0.isCollection($))&&$.anchor;if(U&&KU.anchorIsValid(U))Q.add(U),X.push(`&${U}`);let H=$.tag??(Z.default?null:Z.tag);if(H)X.push(z.directives.tagString(H));return X.join(" ")}function MU($,Z,Q,z){if(c0.isPair($))return $.toString(Z,Q,z);if(c0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,U=c0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>X=G});X??(X=OU(Z.doc.schema.tags,U));let H=_U(U,X,Z);if(H.length>0)Z.indentAtStart=(Z.indentAtStart??0)+H.length+1;let J=typeof X.stringify==="function"?X.stringify(U,Z,Q,z):c0.isScalar(U)?LU.stringifyString(U,Z,Q,z):U.toString(Z,Q,z);if(!H)return J;return c0.isScalar(U)||J[0]==="{"||J[0]==="["?`${H} ${J}`:`${H}
34
+ ${Z.indent}${J}`}PU.createStringifyContext=IU;PU.stringify=MU});var $Z=P((TU)=>{var y0=x(),t5=c(),e5=M$(),P$=I$();function FU({key:$,value:Z},Q,z,X){let{allNullValues:U,doc:H,indent:J,indentStep:G,options:{commentString:V,indentSeq:Y,simpleKeys:W}}=Q,B=y0.isNode($)&&$.comment||null;if(W){if(B)throw Error("With simple keys, key nodes cannot have comments");if(y0.isCollection($)||!y0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||B&&Z==null&&!Q.inFlow||y0.isCollection($)||(y0.isScalar($)?$.type===t5.Scalar.BLOCK_FOLDED||$.type===t5.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!U),indent:J+G});let L=!1,q=!1,D=e5.stringify($,Q,()=>L=!0,()=>q=!0);if(!K&&!Q.inFlow&&D.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(U||Z==null){if(L&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(U&&!W||Z==null&&K){if(D=`? ${D}`,B&&!L)D+=P$.lineComment(D,Q.indent,V(B));else if(q&&X)X();return D}if(L)B=null;if(K){if(B)D+=P$.lineComment(D,Q.indent,V(B));D=`? ${D}
35
+ ${J}:`}else if(D=`${D}:`,B)D+=P$.lineComment(D,Q.indent,V(B));let O,M,F;if(y0.isNode(Z))O=!!Z.spaceBefore,M=Z.commentBefore,F=Z.comment;else if(O=!1,M=null,F=null,Z&&typeof Z==="object")Z=H.createNode(Z);if(Q.implicitKey=!1,!K&&!B&&y0.isScalar(Z))Q.indentAtStart=D.length+1;if(q=!1,!Y&&G.length>=2&&!Q.inFlow&&!K&&y0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let R=!1,T=e5.stringify(Z,Q,()=>R=!0,()=>q=!0),A=" ";if(B||O||M){if(A=O?`
36
+ `:"",M){let j=V(M);A+=`
37
+ ${P$.indentComment(j,Q.indent)}`}if(T===""&&!Q.inFlow){if(A===`
38
38
  `&&F)A=`
39
39
 
40
40
  `}else A+=`
41
41
  ${Q.indent}`}else if(!K&&y0.isCollection(Z)){let j=T[0],N=T.indexOf(`
42
42
  `),S=N!==-1,i=Q.inFlow??Z.flow??Z.items.length===0;if(S||!i){let e=!1;if(S&&(j==="&"||j==="!")){let _=T.indexOf(" ");if(j==="&"&&_!==-1&&_<N&&T[_+1]==="!")_=T.indexOf(" ",_+1);if(_===-1||N<_)e=!0}if(!e)A=`
43
43
  ${Q.indent}`}}else if(T===""||T[0]===`
44
- `)A="";if(D+=A+T,Q.inFlow){if(R&&z)z()}else if(F&&!R)D+=M$.lineComment(D,Q.indent,G(F));else if(q&&X)X();return D}NH.stringifyPair=PH});var X1=P((AH)=>{var t5=J$("process");function FH($,...Z){if($==="debug")console.log(...Z)}function TH($,Z){if($==="debug"||$==="warn")if(typeof t5.emitWarning==="function")t5.emitWarning(Z);else console.warn(Z)}AH.debug=FH;AH.warn=TH});var A6=P((SH)=>{var T6=x(),e5=c(),R6="<<",F6={identify:($)=>$===R6||typeof $==="symbol"&&$.description===R6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new e5.Scalar(Symbol(R6)),{addToJSMap:$Z}),stringify:()=>R6},wH=($,Z)=>(F6.identify(Z)||T6.isScalar(Z)&&(!Z.type||Z.type===e5.Scalar.PLAIN)&&F6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===F6.tag&&Q.default);function $Z($,Z,Q){let z=ZZ($,Q);if(T6.isSeq(z))for(let X of z.items)H1($,Z,X);else if(Array.isArray(z))for(let X of z)H1($,Z,X);else H1($,Z,z)}function H1($,Z,Q){let z=ZZ($,Q);if(!T6.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 ZZ($,Z){return $&&T6.isAlias(Z)?Z.resolve($.doc,$):Z}SH.addMergeToJSMap=$Z;SH.isMergeKey=wH;SH.merge=F6});var J1=P((hH)=>{var xH=X1(),QZ=A6(),gH=_$(),zZ=x(),U1=p0();function vH($,Z,{key:Q,value:z}){if(zZ.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(QZ.isMergeKey($,Q))QZ.addMergeToJSMap($,Z,z);else{let X=U1.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,U1.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let H=kH(Q,X,$),U=U1.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 kH($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(zZ.isNode($)&&Q?.doc){let z=gH.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)+'..."';xH.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)}hH.addPairToJSMap=vH});var d0=P((lH)=>{var XZ=D$(),fH=a5(),mH=J1(),C6=x();function pH($,Z,Q){let z=XZ.createNode($,void 0,Q),X=XZ.createNode(Z,void 0,Q);return new j6(z,X)}class j6{constructor($,Z=null){Object.defineProperty(this,C6.NODE_TYPE,{value:C6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(C6.isNode(Z))Z=Z.clone($);if(C6.isNode(Q))Q=Q.clone($);return new j6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return mH.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?fH.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}lH.Pair=j6;lH.createPair=pH});var V1=P((sH)=>{var X2=x(),HZ=_$(),w6=L$();function iH($,Z,Q){return(Z.inFlow??$.flow?rH:nH)($,Z,Q)}function nH({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 L=0;L<Z.length;++L){let q=Z[L],D=null;if(X2.isNode(q)){if(!W&&q.spaceBefore)B.push("");if(S6(Q,B,q.commentBefore,W),q.comment)D=q.comment}else if(X2.isPair(q)){let M=X2.isNode(q.key)?q.key:null;if(M){if(!W&&M.spaceBefore)B.push("");S6(Q,B,M.commentBefore,W)}}W=!1;let O=HZ.stringify(q,Y,()=>D=null,()=>W=!0);if(D)O+=w6.lineComment(O,H,G(D));if(W&&D)W=!1;B.push(z+O)}let K;if(B.length===0)K=X.start+X.end;else{K=B[0];for(let L=1;L<B.length;++L){let q=B[L];K+=q?`
45
- ${V}${q}`:`
44
+ `)A="";if(D+=A+T,Q.inFlow){if(R&&z)z()}else if(F&&!R)D+=P$.lineComment(D,Q.indent,V(F));else if(q&&X)X();return D}TU.stringifyPair=FU});var U1=P((wU)=>{var ZZ=G$("process");function CU($,...Z){if($==="debug")console.log(...Z)}function jU($,Z){if($==="debug"||$==="warn")if(typeof ZZ.emitWarning==="function")ZZ.emitWarning(Z);else console.warn(Z)}wU.debug=CU;wU.warn=jU});var j6=P((yU)=>{var C6=x(),QZ=c(),T6="<<",A6={identify:($)=>$===T6||typeof $==="symbol"&&$.description===T6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new QZ.Scalar(Symbol(T6)),{addToJSMap:zZ}),stringify:()=>T6},bU=($,Z)=>(A6.identify(Z)||C6.isScalar(Z)&&(!Z.type||Z.type===QZ.Scalar.PLAIN)&&A6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===A6.tag&&Q.default);function zZ($,Z,Q){let z=XZ($,Q);if(C6.isSeq(z))for(let X of z.items)H1($,Z,X);else if(Array.isArray(z))for(let X of z)H1($,Z,X);else H1($,Z,z)}function H1($,Z,Q){let z=XZ($,Q);if(!C6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[U,H]of X)if(Z instanceof Map){if(!Z.has(U))Z.set(U,H)}else if(Z instanceof Set)Z.add(U);else if(!Object.prototype.hasOwnProperty.call(Z,U))Object.defineProperty(Z,U,{value:H,writable:!0,enumerable:!0,configurable:!0});return Z}function XZ($,Z){return $&&C6.isAlias(Z)?Z.resolve($.doc,$):Z}yU.addMergeToJSMap=zZ;yU.isMergeKey=bU;yU.merge=A6});var G1=P((mU)=>{var kU=U1(),UZ=j6(),hU=M$(),HZ=x(),J1=p0();function uU($,Z,{key:Q,value:z}){if(HZ.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(UZ.isMergeKey($,Q))UZ.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 U=fU(Q,X,$),H=J1.toJS(z,U,$);if(U in Z)Object.defineProperty(Z,U,{value:H,writable:!0,enumerable:!0,configurable:!0});else Z[U]=H}}return Z}function fU($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(HZ.isNode($)&&Q?.doc){let z=hU.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let U of Q.anchors.keys())z.anchors.add(U.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let U=JSON.stringify(X);if(U.length>40)U=U.substring(0,36)+'..."';kU.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}mU.addPairToJSMap=uU});var d0=P((iU)=>{var JZ=L$(),lU=$Z(),cU=G1(),w6=x();function dU($,Z,Q){let z=JZ.createNode($,void 0,Q),X=JZ.createNode(Z,void 0,Q);return new S6(z,X)}class S6{constructor($,Z=null){Object.defineProperty(this,w6.NODE_TYPE,{value:w6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(w6.isNode(Z))Z=Z.clone($);if(w6.isNode(Q))Q=Q.clone($);return new S6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return cU.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?lU.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}iU.Pair=S6;iU.createPair=dU});var V1=P((tU)=>{var U2=x(),GZ=M$(),E6=I$();function sU($,Z,Q){return(Z.inFlow??$.flow?aU:oU)($,Z,Q)}function oU({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:U,onChompKeep:H,onComment:J}){let{indent:G,options:{commentString:V}}=Q,Y=Object.assign({},Q,{indent:U,type:null}),W=!1,B=[];for(let L=0;L<Z.length;++L){let q=Z[L],D=null;if(U2.isNode(q)){if(!W&&q.spaceBefore)B.push("");if(b6(Q,B,q.commentBefore,W),q.comment)D=q.comment}else if(U2.isPair(q)){let M=U2.isNode(q.key)?q.key:null;if(M){if(!W&&M.spaceBefore)B.push("");b6(Q,B,M.commentBefore,W)}}W=!1;let O=GZ.stringify(q,Y,()=>D=null,()=>W=!0);if(D)O+=E6.lineComment(O,U,V(D));if(W&&D)W=!1;B.push(z+O)}let K;if(B.length===0)K=X.start+X.end;else{K=B[0];for(let L=1;L<B.length;++L){let q=B[L];K+=q?`
45
+ ${G}${q}`:`
46
46
  `}}if($){if(K+=`
47
- `+w6.indentComment(G($),V),J)J()}else if(W&&U)U();return K}function rH({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 L=0;L<$.length;++L){let q=$[L],D=null;if(X2.isNode(q)){if(q.spaceBefore)W.push("");if(S6(Z,W,q.commentBefore,!1),q.comment)D=q.comment}else if(X2.isPair(q)){let M=X2.isNode(q.key)?q.key:null;if(M){if(M.spaceBefore)W.push("");if(S6(Z,W,M.commentBefore,!1),M.comment)G=!0}let F=X2.isNode(q.value)?q.value:null;if(F){if(F.comment)D=F.comment;if(F.commentBefore)G=!0}else if(q.value==null&&M?.comment)D=M.comment}if(D)G=!0;let O=HZ.stringify(q,V,()=>D=null);if(G||(G=W.length>Y||O.includes(`
48
- `)),L<$.length-1)O+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)G||(G=W.reduce((M,F)=>M+F.length+2,2)+(O.length+2)>Z.options.lineWidth);if(G)O+=","}if(D)O+=w6.lineComment(O,z,J(D));W.push(O),Y=W.length}let{start:B,end:K}=Q;if(W.length===0)return B+K;else{if(!G){let L=W.reduce((q,D)=>q+D.length+2,2);G=Z.options.lineWidth>0&&L>Z.options.lineWidth}if(G){let L=B;for(let q of W)L+=q?`
49
- ${H}${X}${q}`:`
47
+ `+E6.indentComment(V($),G),J)J()}else if(W&&H)H();return K}function aU({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:U,flowCollectionPadding:H,options:{commentString:J}}=Z;z+=U;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),V=!1,Y=0,W=[];for(let L=0;L<$.length;++L){let q=$[L],D=null;if(U2.isNode(q)){if(q.spaceBefore)W.push("");if(b6(Z,W,q.commentBefore,!1),q.comment)D=q.comment}else if(U2.isPair(q)){let M=U2.isNode(q.key)?q.key:null;if(M){if(M.spaceBefore)W.push("");if(b6(Z,W,M.commentBefore,!1),M.comment)V=!0}let F=U2.isNode(q.value)?q.value:null;if(F){if(F.comment)D=F.comment;if(F.commentBefore)V=!0}else if(q.value==null&&M?.comment)D=M.comment}if(D)V=!0;let O=GZ.stringify(q,G,()=>D=null);if(V||(V=W.length>Y||O.includes(`
48
+ `)),L<$.length-1)O+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)V||(V=W.reduce((M,F)=>M+F.length+2,2)+(O.length+2)>Z.options.lineWidth);if(V)O+=","}if(D)O+=E6.lineComment(O,z,J(D));W.push(O),Y=W.length}let{start:B,end:K}=Q;if(W.length===0)return B+K;else{if(!V){let L=W.reduce((q,D)=>q+D.length+2,2);V=Z.options.lineWidth>0&&L>Z.options.lineWidth}if(V){let L=B;for(let q of W)L+=q?`
49
+ ${U}${X}${q}`:`
50
50
  `;return`${L}
51
- ${X}${K}`}else return`${B}${U}${W.join(" ")}${U}${K}`}}function S6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let H=w6.indentComment(Z(z),$);Q.push(H.trimStart())}}sH.stringifyCollection=iH});var n0=P((ZU)=>{var aH=V1(),tH=J1(),eH=_6(),i0=x(),E6=d0(),$U=c();function P$($,Z){let Q=i0.isScalar(Z)?Z.value:Z;for(let z of $)if(i0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(i0.isScalar(z.key)&&z.key.value===Q)return z}return}class UZ extends eH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(i0.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(E6.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(i0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new E6.Pair($,$?.value);else Q=new E6.Pair($.key,$.value);let z=P$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(i0.isScalar(z.value)&&$U.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=P$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=P$(this.items,$)?.value;return(!Z&&i0.isScalar(z)?z.value:z)??void 0}has($){return!!P$(this.items,$)}set($,Z){this.add(new E6.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)tH.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!i0.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 aH.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}ZU.YAMLMap=UZ;ZU.findPair=P$});var x2=P((UU)=>{var XU=x(),JZ=n0(),HU={collection:"map",default:!0,nodeClass:JZ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!XU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>JZ.YAMLMap.from($,Z,Q)};UU.map=HU});var r0=P((qU)=>{var VU=D$(),GU=V1(),YU=_6(),y6=x(),WU=c(),BU=p0();class VZ extends YU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(y6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=b6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=b6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&y6.isScalar(z)?z.value:z}has($){let Z=b6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=b6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(y6.isScalar(z)&&WU.isScalarValue(Z))z.value=Z;else this.items[Q]=Z}toJSON($,Z){let Q=[];if(Z?.onCreate)Z.onCreate(Q);let z=0;for(let X of this.items)Q.push(BU.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return GU.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(VU.createNode(U,void 0,Q))}}return X}}function b6($){let Z=y6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}qU.YAMLSeq=VZ});var g2=P((IU)=>{var DU=x(),GZ=r0(),LU={collection:"seq",default:!0,nodeClass:GZ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!DU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>GZ.YAMLSeq.from($,Z,Q)};IU.seq=LU});var N$=P((PU)=>{var _U=O$(),MU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),_U.stringifyString($,Z,Q,z)}};PU.string=MU});var x6=P((RU)=>{var YZ=c(),WZ={identify:($)=>$==null,createNode:()=>new YZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new YZ.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&WZ.test.test($)?$:Z.options.nullStr};RU.nullTag=WZ});var G1=P((AU)=>{var TU=c(),BZ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new TU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&BZ.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};AU.boolTag=BZ});var v2=P((wU)=>{function jU({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}wU.stringifyNumber=jU});var W1=P((gU)=>{var EU=c(),Y1=v2(),bU={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:Y1.stringifyNumber},yU={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():Y1.stringifyNumber($)}},xU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new EU.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:Y1.stringifyNumber};gU.float=xU;gU.floatExp=yU;gU.floatNaN=bU});var q1=P((pU)=>{var qZ=v2(),g6=($)=>typeof $==="bigint"||Number.isInteger($),B1=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function KZ($,Z,Q){let{value:z}=$;if(g6(z)&&z>=0)return Q+z.toString(Z);return qZ.stringifyNumber($)}var uU={identify:($)=>g6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>B1($,2,8,Q),stringify:($)=>KZ($,8,"0o")},fU={identify:g6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>B1($,0,10,Q),stringify:qZ.stringifyNumber},mU={identify:($)=>g6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>B1($,2,16,Q),stringify:($)=>KZ($,16,"0x")};pU.int=fU;pU.intHex=mU;pU.intOct=uU});var DZ=P((tU)=>{var iU=x2(),nU=x6(),rU=g2(),sU=N$(),oU=G1(),K1=W1(),D1=q1(),aU=[iU.map,rU.seq,sU.string,nU.nullTag,oU.boolTag,D1.intOct,D1.int,D1.intHex,K1.floatNaN,K1.floatExp,K1.float];tU.schema=aU});var IZ=P((UJ)=>{var $J=c(),ZJ=x2(),QJ=g2();function LZ($){return typeof $==="bigint"||Number.isInteger($)}var v6=({value:$})=>JSON.stringify($),zJ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:v6},{identify:($)=>$==null,createNode:()=>new $J.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:v6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:v6},{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:v6}],XJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},HJ=[ZJ.map,QJ.seq].concat(zJ,XJ);UJ.schema=HJ});var I1=P((YJ)=>{var R$=J$("buffer"),L1=c(),VJ=O$(),GJ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof R$.Buffer==="function")return R$.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 R$.Buffer==="function")J=U instanceof R$.Buffer?U.toString("base64"):R$.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 VJ.stringifyString({comment:$,type:Z,value:J},z,X,H)}};YJ.binary=GJ});var h6=P((DJ)=>{var k6=x(),O1=d0(),BJ=c(),qJ=r0();function OZ($,Z){if(k6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(k6.isPair(z))continue;else if(k6.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 BJ.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]=k6.isPair(z)?z:new O1.Pair(z)}else Z("Expected a sequence for this tag");return $}function _Z($,Z,Q){let{replacer:z}=Q,X=new qJ.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 KJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:OZ,createNode:_Z};DJ.createPairs=_Z;DJ.pairs=KJ;DJ.resolvePairs=OZ});var M1=P((PJ)=>{var MZ=x(),_1=p0(),F$=n0(),_J=r0(),PZ=h6();class H2 extends _J.YAMLSeq{constructor(){super();this.add=F$.YAMLMap.prototype.add.bind(this),this.delete=F$.YAMLMap.prototype.delete.bind(this),this.get=F$.YAMLMap.prototype.get.bind(this),this.has=F$.YAMLMap.prototype.has.bind(this),this.set=F$.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(MZ.isPair(z))X=_1.toJS(z.key,"",Z),H=_1.toJS(z.value,X,Z);else X=_1.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=PZ.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}H2.tag="tag:yaml.org,2002:omap";var MJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:H2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=PZ.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(MZ.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)};PJ.YAMLOMap=H2;PJ.omap=MJ});var AZ=P((FJ)=>{var NZ=c();function RZ({value:$,source:Z},Q){if(Z&&($?FZ:TZ).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var FZ={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:RZ},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:RZ};FJ.falseTag=TZ;FJ.trueTag=FZ});var CZ=P((EJ)=>{var CJ=c(),P1=v2(),jJ={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:P1.stringifyNumber},wJ={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():P1.stringifyNumber($)}},SJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new CJ.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:P1.stringifyNumber};EJ.float=SJ;EJ.floatExp=wJ;EJ.floatNaN=jJ});var wZ=P((uJ)=>{var jZ=v2(),T$=($)=>typeof $==="bigint"||Number.isInteger($);function u6($,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(T$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return jZ.stringifyNumber($)}var gJ={identify:T$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>u6($,2,2,Q),stringify:($)=>N1($,2,"0b")},vJ={identify:T$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>u6($,1,8,Q),stringify:($)=>N1($,8,"0")},kJ={identify:T$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>u6($,0,10,Q),stringify:jZ.stringifyNumber},hJ={identify:T$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>u6($,2,16,Q),stringify:($)=>N1($,16,"0x")};uJ.int=kJ;uJ.intBin=gJ;uJ.intHex=hJ;uJ.intOct=vJ});var R1=P((dJ)=>{var p6=x(),f6=d0(),m6=n0();class U2 extends m6.YAMLMap{constructor($){super($);this.tag=U2.tag}add($){let Z;if(p6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new f6.Pair($.key,null);else Z=new f6.Pair($,null);if(!m6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=m6.findPair(this.items,$);return!Z&&p6.isPair(Q)?p6.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=m6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new f6.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(f6.createPair(H,null,Q))}return X}}U2.tag="tag:yaml.org,2002:set";var cJ={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(p6.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 $}};dJ.YAMLSet=U2;dJ.set=cJ});var T1=P((aJ)=>{var rJ=v2();function F1($,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 rJ.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 sJ={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})=>F1($,Q),stringify:SZ},oJ={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:($)=>F1($,!1),stringify:SZ},EZ={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(EZ.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=F1(Y,!1);if(Math.abs(W)<30)W*=60;G-=60000*W}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};aJ.floatTime=oJ;aJ.intTime=sJ;aJ.timestamp=EZ});var yZ=P((WV)=>{var ZV=x2(),QV=x6(),zV=g2(),XV=N$(),HV=I1(),bZ=AZ(),A1=CZ(),l6=wZ(),UV=A6(),JV=M1(),VV=h6(),GV=R1(),C1=T1(),YV=[ZV.map,zV.seq,XV.string,QV.nullTag,bZ.trueTag,bZ.falseTag,l6.intBin,l6.intOct,l6.int,l6.intHex,A1.floatNaN,A1.floatExp,A1.float,HV.binary,UV.merge,JV.omap,VV.pairs,GV.set,C1.intTime,C1.floatTime,C1.timestamp];WV.schema=YV});var lZ=P((MV)=>{var kZ=x2(),qV=x6(),hZ=g2(),KV=N$(),DV=G1(),j1=W1(),w1=q1(),LV=DZ(),IV=IZ(),uZ=I1(),A$=A6(),fZ=M1(),mZ=h6(),xZ=yZ(),pZ=R1(),c6=T1(),gZ=new Map([["core",LV.schema],["failsafe",[kZ.map,hZ.seq,KV.string]],["json",IV.schema],["yaml11",xZ.schema],["yaml-1.1",xZ.schema]]),vZ={binary:uZ.binary,bool:DV.boolTag,float:j1.float,floatExp:j1.floatExp,floatNaN:j1.floatNaN,floatTime:c6.floatTime,int:w1.int,intHex:w1.intHex,intOct:w1.intOct,intTime:c6.intTime,map:kZ.map,merge:A$.merge,null:qV.nullTag,omap:fZ.omap,pairs:mZ.pairs,seq:hZ.seq,set:pZ.set,timestamp:c6.timestamp},OV={"tag:yaml.org,2002:binary":uZ.binary,"tag:yaml.org,2002:merge":A$.merge,"tag:yaml.org,2002:omap":fZ.omap,"tag:yaml.org,2002:pairs":mZ.pairs,"tag:yaml.org,2002:set":pZ.set,"tag:yaml.org,2002:timestamp":c6.timestamp};function _V($,Z,Q){let z=gZ.get(Z);if(z&&!$)return Q&&!z.includes(A$.merge)?z.concat(A$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let H=Array.from(gZ.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(A$.merge);return X.reduce((H,U)=>{let J=typeof U==="string"?vZ[U]:U;if(!J){let V=JSON.stringify(U),G=Object.keys(vZ).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},[])}MV.coreKnownTags=OV;MV.getTags=_V});var b1=P((CV)=>{var S1=x(),RV=x2(),FV=g2(),TV=N$(),d6=lZ(),AV=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class E1{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?d6.getTags($,"compat"):$?d6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?d6.coreKnownTags:{},this.tags=d6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,S1.MAP,{value:RV.map}),Object.defineProperty(this,S1.SCALAR,{value:TV.string}),Object.defineProperty(this,S1.SEQ,{value:FV.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?AV:null}clone(){let $=Object.create(E1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}CV.Schema=E1});var cZ=P((EV)=>{var wV=x(),y1=_$(),C$=L$();function SV($,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=y1.createStringifyContext($,Z),{commentString:H}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=H($.commentBefore);Q.unshift(C$.indentComment(V,""))}let U=!1,J=null;if($.contents){if(wV.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=H($.contents.commentBefore);Q.push(C$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let V=J?void 0:()=>U=!0,G=y1.stringify($.contents,X,()=>J=null,V);if(J)G+=C$.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(y1.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=H($.comment);if(V.includes(`
55
- `))Q.push("..."),Q.push(C$.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(C$.indentComment(H(V),""))}}return Q.join(`
51
+ ${X}${K}`}else return`${B}${H}${W.join(" ")}${H}${K}`}}function b6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let U=E6.indentComment(Z(z),$);Q.push(U.trimStart())}}tU.stringifyCollection=sU});var n0=P((XH)=>{var $H=V1(),ZH=G1(),QH=P6(),i0=x(),y6=d0(),zH=c();function N$($,Z){let Q=i0.isScalar(Z)?Z.value:Z;for(let z of $)if(i0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(i0.isScalar(z.key)&&z.key.value===Q)return z}return}class VZ extends QH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(i0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,U=new this($),H=(J,G)=>{if(typeof X==="function")G=X.call(Z,J,G);else if(Array.isArray(X)&&!X.includes(J))return;if(G!==void 0||z)U.items.push(y6.createPair(J,G,Q))};if(Z instanceof Map)for(let[J,G]of Z)H(J,G);else if(Z&&typeof Z==="object")for(let J of Object.keys(Z))H(J,Z[J]);if(typeof $.sortMapEntries==="function")U.items.sort($.sortMapEntries);return U}add($,Z){let Q;if(i0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new y6.Pair($,$?.value);else Q=new y6.Pair($.key,$.value);let z=N$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(i0.isScalar(z.value)&&zH.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let U=this.items.findIndex((H)=>X(Q,H)<0);if(U===-1)this.items.push(Q);else this.items.splice(U,0,Q)}else this.items.push(Q)}delete($){let Z=N$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=N$(this.items,$)?.value;return(!Z&&i0.isScalar(z)?z.value:z)??void 0}has($){return!!N$(this.items,$)}set($,Z){this.add(new y6.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)ZH.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!i0.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 $H.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}XH.YAMLMap=VZ;XH.findPair=N$});var g2=P((VH)=>{var JH=x(),YZ=n0(),GH={collection:"map",default:!0,nodeClass:YZ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!JH.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>YZ.YAMLMap.from($,Z,Q)};VH.map=GH});var r0=P((LH)=>{var WH=L$(),BH=V1(),qH=P6(),g6=x(),KH=c(),DH=p0();class WZ extends qH.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(g6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=x6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=x6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&g6.isScalar(z)?z.value:z}has($){let Z=x6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=x6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(g6.isScalar(z)&&KH.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(DH.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return BH.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let U=0;for(let H of Z){if(typeof z==="function"){let J=Z instanceof Set?H:String(U++);H=z.call(Z,J,H)}X.items.push(WH.createNode(H,void 0,Q))}}return X}}function x6($){let Z=g6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}LH.YAMLSeq=WZ});var v2=P((MH)=>{var OH=x(),BZ=r0(),_H={collection:"seq",default:!0,nodeClass:BZ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!OH.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>BZ.YAMLSeq.from($,Z,Q)};MH.seq=_H});var R$=P((FH)=>{var NH=_$(),RH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),NH.stringifyString($,Z,Q,z)}};FH.string=RH});var v6=P((AH)=>{var qZ=c(),KZ={identify:($)=>$==null,createNode:()=>new qZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qZ.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&KZ.test.test($)?$:Z.options.nullStr};AH.nullTag=KZ});var Y1=P((wH)=>{var jH=c(),DZ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new jH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&DZ.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};wH.boolTag=DZ});var k2=P((bH)=>{function EH({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let U=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(U)&&!U.includes("e")){let H=U.indexOf(".");if(H<0)H=U.length,U+=".";let J=Z-(U.length-H-1);while(J-- >0)U+="0"}return U}bH.stringifyNumber=EH});var B1=P((hH)=>{var xH=c(),W1=k2(),gH={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},vH={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($)}},kH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new xH.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:W1.stringifyNumber};hH.float=kH;hH.floatExp=vH;hH.floatNaN=gH});var K1=P((dH)=>{var LZ=k2(),k6=($)=>typeof $==="bigint"||Number.isInteger($),q1=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function IZ($,Z,Q){let{value:z}=$;if(k6(z)&&z>=0)return Q+z.toString(Z);return LZ.stringifyNumber($)}var pH={identify:($)=>k6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>q1($,2,8,Q),stringify:($)=>IZ($,8,"0o")},lH={identify:k6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>q1($,0,10,Q),stringify:LZ.stringifyNumber},cH={identify:($)=>k6($)&&$>=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:($)=>IZ($,16,"0x")};dH.int=lH;dH.intHex=cH;dH.intOct=pH});var OZ=P((ZJ)=>{var sH=g2(),oH=v6(),aH=v2(),tH=R$(),eH=Y1(),D1=B1(),L1=K1(),$J=[sH.map,aH.seq,tH.string,oH.nullTag,eH.boolTag,L1.intOct,L1.int,L1.intHex,D1.floatNaN,D1.floatExp,D1.float];ZJ.schema=$J});var MZ=P((VJ)=>{var zJ=c(),XJ=g2(),UJ=v2();function _Z($){return typeof $==="bigint"||Number.isInteger($)}var h6=({value:$})=>JSON.stringify($),HJ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:h6},{identify:($)=>$==null,createNode:()=>new zJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:h6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:h6},{identify:_Z,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>_Z($)?$.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:h6}],JJ={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},GJ=[XJ.map,UJ.seq].concat(HJ,JJ);VJ.schema=GJ});var O1=P((qJ)=>{var F$=G$("buffer"),I1=c(),WJ=_$(),BJ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof F$.Buffer==="function")return F$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,U){if(!Q)return"";let H=Q,J;if(typeof F$.Buffer==="function")J=H instanceof F$.Buffer?H.toString("base64"):F$.Buffer.from(H.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let V=0;V<H.length;++V)G+=String.fromCharCode(H[V]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=I1.Scalar.BLOCK_LITERAL),Z!==I1.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),V=Math.ceil(J.length/G),Y=Array(V);for(let W=0,B=0;W<V;++W,B+=G)Y[W]=J.substr(B,G);J=Y.join(Z===I1.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return WJ.stringifyString({comment:$,type:Z,value:J},z,X,U)}};qJ.binary=BJ});var f6=P((OJ)=>{var u6=x(),_1=d0(),DJ=c(),LJ=r0();function PZ($,Z){if(u6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(u6.isPair(z))continue;else if(u6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new _1.Pair(new DJ.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
53
+ ${X.key.commentBefore}`:z.commentBefore;if(z.comment){let U=X.value??X.key;U.comment=U.comment?`${z.comment}
54
+ ${U.comment}`:z.comment}z=X}$.items[Q]=u6.isPair(z)?z:new _1.Pair(z)}else Z("Expected a sequence for this tag");return $}function NZ($,Z,Q){let{replacer:z}=Q,X=new LJ.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let U=0;if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof z==="function")H=z.call(Z,String(U++),H);let J,G;if(Array.isArray(H))if(H.length===2)J=H[0],G=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let V=Object.keys(H);if(V.length===1)J=V[0],G=H[J];else throw TypeError(`Expected tuple with one key, not ${V.length} keys`)}else J=H;X.items.push(_1.createPair(J,G,Q))}return X}var IJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PZ,createNode:NZ};OJ.createPairs=NZ;OJ.pairs=IJ;OJ.resolvePairs=PZ});var P1=P((FJ)=>{var RZ=x(),M1=p0(),T$=n0(),NJ=r0(),FZ=f6();class H2 extends NJ.YAMLSeq{constructor(){super();this.add=T$.YAMLMap.prototype.add.bind(this),this.delete=T$.YAMLMap.prototype.delete.bind(this),this.get=T$.YAMLMap.prototype.get.bind(this),this.has=T$.YAMLMap.prototype.has.bind(this),this.set=T$.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,U;if(RZ.isPair(z))X=M1.toJS(z.key,"",Z),U=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,U)}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 RJ={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)};FJ.YAMLOMap=H2;FJ.omap=RJ});var wZ=P((CJ)=>{var TZ=c();function AZ({value:$,source:Z},Q){if(Z&&($?CZ:jZ).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var CZ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new TZ.Scalar(!0),stringify:AZ},jZ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new TZ.Scalar(!1),stringify:AZ};CJ.falseTag=jZ;CJ.trueTag=CZ});var SZ=P((xJ)=>{var SJ=c(),N1=k2(),EJ={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:N1.stringifyNumber},bJ={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():N1.stringifyNumber($)}},yJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new SJ.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:N1.stringifyNumber};xJ.float=yJ;xJ.floatExp=bJ;xJ.floatNaN=EJ});var bZ=P((pJ)=>{var EZ=k2(),A$=($)=>typeof $==="bigint"||Number.isInteger($);function m6($,Z,Q,{intAsBigInt:z}){let X=$[0];if(X==="-"||X==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(Q){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let H=BigInt($);return X==="-"?BigInt(-1)*H:H}let U=parseInt($,Q);return X==="-"?-1*U:U}function R1($,Z,Q){let{value:z}=$;if(A$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return EZ.stringifyNumber($)}var hJ={identify:A$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>m6($,2,2,Q),stringify:($)=>R1($,2,"0b")},uJ={identify:A$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>m6($,1,8,Q),stringify:($)=>R1($,8,"0")},fJ={identify:A$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>m6($,0,10,Q),stringify:EZ.stringifyNumber},mJ={identify:A$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>m6($,2,16,Q),stringify:($)=>R1($,16,"0x")};pJ.int=fJ;pJ.intBin=hJ;pJ.intHex=mJ;pJ.intOct=uJ});var F1=P((rJ)=>{var c6=x(),p6=d0(),l6=n0();class J2 extends l6.YAMLMap{constructor($){super($);this.tag=J2.tag}add($){let Z;if(c6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new p6.Pair($.key,null);else Z=new p6.Pair($,null);if(!l6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=l6.findPair(this.items,$);return!Z&&c6.isPair(Q)?c6.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=l6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new p6.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,U,U);X.items.push(p6.createPair(U,null,Q))}return X}}J2.tag="tag:yaml.org,2002:set";var nJ={collection:"map",identify:($)=>$ instanceof Set,nodeClass:J2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>J2.from($,Z,Q),resolve($,Z){if(c6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new J2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};rJ.YAMLSet=J2;rJ.set=nJ});var A1=P(($G)=>{var aJ=k2();function T1($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(H)=>Z?BigInt(H):Number(H),U=z.replace(/_/g,"").split(":").reduce((H,J)=>H*X(60)+X(J),X(0));return Q==="-"?X(-1)*U:U}function yZ($){let{value:Z}=$,Q=(H)=>H;if(typeof Z==="bigint")Q=(H)=>BigInt(H);else if(isNaN(Z)||!isFinite(Z))return aJ.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),U=[Z%X];if(Z<60)U.unshift(0);else if(Z=(Z-U[0])/X,U.unshift(Z%X),Z>=60)Z=(Z-U[0])/X,U.unshift(Z);return z+U.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var tJ={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})=>T1($,Q),stringify:yZ},eJ={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:($)=>T1($,!1),stringify:yZ},xZ={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(xZ.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,U,H,J]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,V=Date.UTC(Q,z-1,X,U||0,H||0,J||0,G),Y=Z[8];if(Y&&Y!=="Z"){let W=T1(Y,!1);if(Math.abs(W)<30)W*=60;V-=60000*W}return new Date(V)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$G.floatTime=eJ;$G.intTime=tJ;$G.timestamp=xZ});var vZ=P((KG)=>{var XG=g2(),UG=v6(),HG=v2(),JG=R$(),GG=O1(),gZ=wZ(),C1=SZ(),d6=bZ(),VG=j6(),YG=P1(),WG=f6(),BG=F1(),j1=A1(),qG=[XG.map,HG.seq,JG.string,UG.nullTag,gZ.trueTag,gZ.falseTag,d6.intBin,d6.intOct,d6.int,d6.intHex,C1.floatNaN,C1.floatExp,C1.float,GG.binary,VG.merge,YG.omap,WG.pairs,BG.set,j1.intTime,j1.floatTime,j1.timestamp];KG.schema=qG});var iZ=P((RG)=>{var fZ=g2(),LG=v6(),mZ=v2(),IG=R$(),OG=Y1(),w1=B1(),S1=K1(),_G=OZ(),MG=MZ(),pZ=O1(),C$=j6(),lZ=P1(),cZ=f6(),kZ=vZ(),dZ=F1(),i6=A1(),hZ=new Map([["core",_G.schema],["failsafe",[fZ.map,mZ.seq,IG.string]],["json",MG.schema],["yaml11",kZ.schema],["yaml-1.1",kZ.schema]]),uZ={binary:pZ.binary,bool:OG.boolTag,float:w1.float,floatExp:w1.floatExp,floatNaN:w1.floatNaN,floatTime:i6.floatTime,int:S1.int,intHex:S1.intHex,intOct:S1.intOct,intTime:i6.intTime,map:fZ.map,merge:C$.merge,null:LG.nullTag,omap:lZ.omap,pairs:cZ.pairs,seq:mZ.seq,set:dZ.set,timestamp:i6.timestamp},PG={"tag:yaml.org,2002:binary":pZ.binary,"tag:yaml.org,2002:merge":C$.merge,"tag:yaml.org,2002:omap":lZ.omap,"tag:yaml.org,2002:pairs":cZ.pairs,"tag:yaml.org,2002:set":dZ.set,"tag:yaml.org,2002:timestamp":i6.timestamp};function NG($,Z,Q){let z=hZ.get(Z);if(z&&!$)return Q&&!z.includes(C$.merge)?z.concat(C$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let U=Array.from(hZ.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${U} or define customTags array`)}if(Array.isArray($))for(let U of $)X=X.concat(U);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(C$.merge);return X.reduce((U,H)=>{let J=typeof H==="string"?uZ[H]:H;if(!J){let G=JSON.stringify(H),V=Object.keys(uZ).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${V}`)}if(!U.includes(J))U.push(J);return U},[])}RG.coreKnownTags=PG;RG.getTags=NG});var y1=P((SG)=>{var E1=x(),AG=g2(),CG=v2(),jG=R$(),n6=iZ(),wG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class b1{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:U,toStringDefaults:H}){this.compat=Array.isArray($)?n6.getTags($,"compat"):$?n6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?n6.coreKnownTags:{},this.tags=n6.getTags(Z,this.name,Q),this.toStringOptions=H??null,Object.defineProperty(this,E1.MAP,{value:AG.map}),Object.defineProperty(this,E1.SCALAR,{value:jG.string}),Object.defineProperty(this,E1.SEQ,{value:CG.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?wG:null}clone(){let $=Object.create(b1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}SG.Schema=b1});var nZ=P((xG)=>{var bG=x(),x1=M$(),j$=I$();function yG($,Z){let Q=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)Q.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)Q.push("---");let X=x1.createStringifyContext($,Z),{commentString:U}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let G=U($.commentBefore);Q.unshift(j$.indentComment(G,""))}let H=!1,J=null;if($.contents){if(bG.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=U($.contents.commentBefore);Q.push(j$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>H=!0,V=x1.stringify($.contents,X,()=>J=null,G);if(J)V+=j$.lineComment(V,"",U(J));if((V[0]==="|"||V[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${V}`;else Q.push(V)}else Q.push(x1.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let G=U($.comment);if(G.includes(`
55
+ `))Q.push("..."),Q.push(j$.indentComment(G,""));else Q.push(`... ${G}`)}else Q.push("...");else{let G=$.comment;if(G&&H)G=G.replace(/^\n+/,"");if(G){if((!H||J)&&Q[Q.length-1]!=="")Q.push("");Q.push(j$.indentComment(U(G),""))}}return Q.join(`
56
56
  `)+`
57
- `}EV.stringifyDocument=SV});var j$=P((fV)=>{var yV=K$(),k2=_6(),J0=x(),xV=d0(),gV=p0(),vV=b1(),kV=cZ(),x1=L6(),hV=e8(),uV=D$(),g1=t8();class v1{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,J0.NODE_TYPE,{value:J0.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 g1.Directives({version:H});this.setSchema(H,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(v1.prototype,{[J0.NODE_TYPE]:{value:J0.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=J0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(h2(this.contents))this.contents.add($)}addIn($,Z){if(h2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=x1.anchorNames(this);$.anchor=!Z||Q.has(Z)?x1.findNewAnchor(Z||"a",Q):Z}return new yV.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let q=(O)=>typeof O==="number"||O instanceof String||O instanceof Number,D=Z.filter(q).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:H,flow:U,keepUndefined:J,onTagObj:V,tag:G}=Q??{},{onAnchor:Y,setAnchors:W,sourceObjects:B}=x1.createNodeAnchors(this,H||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:V,replacer:z,schema:this.schema,sourceObjects:B},L=uV.createNode($,G,K);if(U&&J0.isCollection(L))L.flow=!0;return W(),L}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new xV.Pair(z,X)}delete($){return h2(this.contents)?this.contents.delete($):!1}deleteIn($){if(k2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return h2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return J0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(k2.isEmptyPath($))return!Z&&J0.isScalar(this.contents)?this.contents.value:this.contents;return J0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return J0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(k2.isEmptyPath($))return this.contents!==void 0;return J0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=k2.collectionFromPath(this.schema,[$],Z);else if(h2(this.contents))this.contents.set($,Z)}setIn($,Z){if(k2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=k2.collectionFromPath(this.schema,Array.from($),Z);else if(h2(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 g1.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 g1.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 vV.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=gV.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"?hV.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 kV.stringifyDocument(this,$)}}function h2($){if(J0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}fV.Document=v1});var w$=P((lV)=>{class i6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class dZ extends i6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class iZ extends i6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var pV=($,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+=`:
57
+ `}xG.stringifyDocument=yG});var w$=P((lG)=>{var vG=D$(),h2=P6(),J0=x(),kG=d0(),hG=p0(),uG=y1(),fG=nZ(),g1=O6(),mG=$1(),pG=L$(),v1=e8();class k1{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,J0.NODE_TYPE,{value:J0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:U}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new v1.Directives({version:U});this.setSchema(U,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(k1.prototype,{[J0.NODE_TYPE]:{value:J0.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=J0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(u2(this.contents))this.contents.add($)}addIn($,Z){if(u2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=g1.anchorNames(this);$.anchor=!Z||Q.has(Z)?g1.findNewAnchor(Z||"a",Q):Z}return new vG.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let q=(O)=>typeof O==="number"||O instanceof String||O instanceof Number,D=Z.filter(q).map(String);if(D.length>0)Z=Z.concat(D);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:U,flow:H,keepUndefined:J,onTagObj:G,tag:V}=Q??{},{onAnchor:Y,setAnchors:W,sourceObjects:B}=g1.createNodeAnchors(this,U||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:B},L=pG.createNode($,V,K);if(H&&J0.isCollection(L))L.flow=!0;return W(),L}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new kG.Pair(z,X)}delete($){return u2(this.contents)?this.contents.delete($):!1}deleteIn($){if(h2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return u2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return J0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(h2.isEmptyPath($))return!Z&&J0.isScalar(this.contents)?this.contents.value:this.contents;return J0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return J0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(h2.isEmptyPath($))return this.contents!==void 0;return J0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=h2.collectionFromPath(this.schema,[$],Z);else if(u2(this.contents))this.contents.set($,Z)}setIn($,Z){if(h2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=h2.collectionFromPath(this.schema,Array.from($),Z);else if(u2(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 v1.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 v1.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 uG.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:U}={}){let H={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},J=hG.toJS(this.contents,Z??"",H);if(typeof X==="function")for(let{count:G,res:V}of H.anchors.values())X(V,G);return typeof U==="function"?mG.applyReviver(U,{"":J},"",J):J}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return fG.stringifyDocument(this,$)}}function u2($){if(J0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}lG.Document=k1});var S$=P((iG)=>{class r6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class rZ extends r6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class sZ extends r6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var dG=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((J)=>Z.linePos(J));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let U=X-1,H=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(U>=60&&H.length>80){let J=Math.min(U-39,H.length-79);H="…"+H.substring(J),U-=J-1}if(H.length>80)H=H.substring(0,79)+"…";if(z>1&&/^ *$/.test(H.substring(0,U))){let J=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(J.length>80)J=J.substring(0,79)+`…
58
+ `;H=J+H}if(/[^ ]/.test(H)){let J=1,G=Q.linePos[1];if(G?.line===z&&G.col>X)J=Math.max(1,Math.min(G.col-X,80-U));let V=" ".repeat(U)+"^".repeat(J);Q.message+=`:
59
59
 
60
- ${U}
61
- ${G}
62
- `}};lV.YAMLError=i6;lV.YAMLParseError=dZ;lV.YAMLWarning=iZ;lV.prettifyError=pV});var S$=P((sV)=>{function rV($,{flow:Z,indicator:Q,next:z,offset:X,onError:H,parentIndent:U,startOnNewline:J}){let V=!1,G=J,Y=J,W="",B="",K=!1,L=!1,q=null,D=null,O=null,M=null,F=null,R=null,T=null;for(let N of $){if(L){if(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma")H(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(q){if(G&&N.type!=="comment"&&N.type!=="newline")H(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");q=null}switch(N.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&N.source.includes("\t"))q=N;Y=!0;break;case"comment":{if(!Y)H(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let S=N.source.substring(1)||" ";if(!W)W=S;else W+=B+S;B="",G=!1;break}case"newline":if(G){if(W)W+=N.source;else if(!R||Q!=="seq-item-ind")V=!0}else B+=N.source;if(G=!0,K=!0,D||O)M=N;Y=!0;break;case"anchor":if(D)H(N,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(N.source.endsWith(":"))H(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=N,T??(T=N.offset),G=!1,Y=!1,L=!0;break;case"tag":{if(O)H(N,"MULTIPLE_TAGS","A node can have at most one tag");O=N,T??(T=N.offset),G=!1,Y=!1,L=!0;break}case Q:if(D||O)H(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`);if(R)H(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${Z??"collection"}`);R=N,G=Q==="seq-item-ind"||Q==="explicit-key-ind",Y=!1;break;case"comma":if(Z){if(F)H(N,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);F=N,G=!1,Y=!1;break}default:H(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),G=!1,Y=!1}}let A=$[$.length-1],j=A?A.offset+A.source.length:X;if(L&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))H(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(q&&(G&&q.indent<=U||z?.type==="block-map"||z?.type==="block-seq"))H(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:F,found:R,spaceBefore:V,comment:W,hasNewline:K,anchor:D,tag:O,newlineAfterProp:M,end:j,start:T??j}}sV.resolveProps=rV});var n6=P((aV)=>{function k1($){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(k1(Z.key)||k1(Z.value))return!0}return!1;default:return!0}}aV.containsNewline=k1});var h1=P((ZG)=>{var eV=n6();function $G($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&eV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ZG.flowIndentCheck=$G});var u1=P((XG)=>{var nZ=x();function zG($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(H,U)=>H===U||nZ.isScalar(H)&&nZ.isScalar(U)&&H.value===U.value;return Z.some((H)=>X(H.key,Q))}XG.mapIncludes=zG});var tZ=P((YG)=>{var rZ=d0(),UG=n0(),sZ=S$(),JG=n6(),oZ=h1(),VG=u1(),aZ="All mapping items must start at the same column";function GG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??UG.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:K,value:L}=Y,q=sZ.resolveProps(W,{indicator:"explicit-key-ind",next:B??K?.[0],offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!q.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",aZ)}if(!q.anchor&&!q.tag&&!K){if(G=q.end,q.comment)if(J.comment)J.comment+=`
64
- `+q.comment;else J.comment=q.comment;continue}if(q.newlineAfterProp||JG.containsNewline(B))X(B??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==z.indent)X(V,"BAD_INDENT",aZ);Q.atKey=!0;let O=q.end,M=B?$(Q,B,q,X):Z(Q,O,W,null,q,X);if(Q.schema.compat)oZ.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,VG.mapIncludes(Q,J.items,M))X(O,"DUPLICATE_KEY","Map keys must be unique");let F=sZ.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:M.range[2],onError:X,parentIndent:z.indent,startOnNewline:!B||B.type==="block-scalar"});if(V=F.end,F.found){if(D){if(L?.type==="block-map"&&!F.hasNewline)X(V,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&q.start<F.found.offset-1024)X(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let R=L?$(Q,L,F,X):Z(Q,V,K,null,F,X);if(Q.schema.compat)oZ.flowIndentCheck(z.indent,L,X);V=R.range[2];let T=new rZ.Pair(M,R);if(Q.options.keepSourceTokens)T.srcToken=Y;J.items.push(T)}else{if(D)X(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(F.comment)if(M.comment)M.comment+=`
65
- `+F.comment;else M.comment=F.comment;let R=new rZ.Pair(M);if(Q.options.keepSourceTokens)R.srcToken=Y;J.items.push(R)}}if(G&&G<V)X(G,"IMPOSSIBLE","Map comment with trailing content");return J.range=[z.offset,V,G??V],J}YG.resolveBlockMap=GG});var eZ=P((LG)=>{var BG=r0(),qG=S$(),KG=h1();function DG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??BG.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=qG.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 K=W?$(Q,W,B,X):Z(Q,B.end,Y,null,B,X);if(Q.schema.compat)KG.flowIndentCheck(z.indent,W,X);V=K.range[2],J.items.push(K)}return J.range=[z.offset,V,G??V],J}LG.resolveBlockSeq=DG});var u2=P((_G)=>{function OG($,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}}_G.resolveEnd=OG});var Q7=P((jG)=>{var PG=x(),NG=d0(),$7=n0(),RG=r0(),FG=u2(),Z7=S$(),TG=n6(),AG=u1(),f1="Block collections are not allowed within flow collections",m1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function CG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let U=z.start.source==="{",J=U?"flow map":"flow sequence",G=new(H?.nodeClass??(U?$7.YAMLMap:RG.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 O=z.items[D],{start:M,key:F,sep:R,value:T}=O,A=Z7.resolveProps(M,{flow:J,indicator:"explicit-key-ind",next:F??R?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!R&&!T){if(D===0&&A.comma)X(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(A.comment)if(G.comment)G.comment+=`
66
- `+A.comment;else G.comment=A.comment;W=A.end;continue}if(!U&&Q.options.strict&&TG.containsNewline(F))X(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(A.comma)X(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!A.comma)X(A.start,"MISSING_CHAR",`Missing , between ${J} items`);if(A.comment){let j="";$:for(let N of M)switch(N.type){case"comma":case"space":break;case"comment":j=N.source.substring(1);break $;default:break $}if(j){let N=G.items[G.items.length-1];if(PG.isPair(N))N=N.value??N.key;if(N.comment)N.comment+=`
67
- `+j;else N.comment=j;A.comment=A.comment.substring(j.length+1)}}}if(!U&&!R&&!A.found){let j=T?$(Q,T,A,X):Z(Q,A.end,R,null,A,X);if(G.items.push(j),W=j.range[2],m1(T))X(j.range,"BLOCK_IN_FLOW",f1)}else{Q.atKey=!0;let j=A.end,N=F?$(Q,F,A,X):Z(Q,j,M,null,A,X);if(m1(F))X(N.range,"BLOCK_IN_FLOW",f1);Q.atKey=!1;let S=Z7.resolveProps(R??[],{flow:J,indicator:"map-value-ind",next:T,offset:N.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(S.found){if(!U&&!A.found&&Q.options.strict){if(R)for(let _ of R){if(_===S.found)break;if(_.type==="newline"){X(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<S.found.offset-1024)X(S.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(T)if("source"in T&&T.source?.[0]===":")X(T,"MISSING_CHAR",`Missing space after : in ${J}`);else X(S.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let i=T?$(Q,T,S,X):S.found?Z(Q,S.end,R,null,S,X):null;if(i){if(m1(T))X(i.range,"BLOCK_IN_FLOW",f1)}else if(S.comment)if(N.comment)N.comment+=`
68
- `+S.comment;else N.comment=S.comment;let e=new NG.Pair(N,i);if(Q.options.keepSourceTokens)e.srcToken=O;if(U){let _=G;if(AG.mapIncludes(Q,_.items,N))X(j,"DUPLICATE_KEY","Map keys must be unique");_.items.push(e)}else{let _=new $7.YAMLMap(Q.schema);_.flow=!0,_.items.push(e);let b=(i??N).range;_.range=[N.range[0],b[1],b[2]],G.items.push(_)}W=i?i.range[2]:S.end}}let B=U?"}":"]",[K,...L]=z.end,q=W;if(K?.source===B)q=K.offset+K.source.length;else{let D=J[0].toUpperCase()+J.substring(1),O=Y?`${D} must end with a ${B}`:`${D} in block collection must be sufficiently indented and end with a ${B}`;if(X(W,Y?"MISSING_CHAR":"BAD_INDENT",O),K&&K.source.length!==1)L.unshift(K)}if(L.length>0){let D=FG.resolveEnd(L,q,Q.options.strict,X);if(D.comment)if(G.comment)G.comment+=`
69
- `+D.comment;else G.comment=D.comment;G.range=[z.offset,q,D.offset]}else G.range=[z.offset,q,q];return G}jG.resolveFlowCollection=CG});var z7=P((hG)=>{var SG=x(),EG=c(),bG=n0(),yG=r0(),xG=tZ(),gG=eZ(),vG=Q7();function p1($,Z,Q,z,X,H){let U=Q.type==="block-map"?xG.resolveBlockMap($,Z,Q,z,H):Q.type==="block-seq"?gG.resolveBlockSeq($,Z,Q,z,H):vG.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 kG($,Z,Q,z,X){let H=z.tag,U=!H?null:Z.directives.tagName(H.source,(B)=>X(H,"TAG_RESOLVE_FAILED",B));if(Q.type==="block-seq"){let{anchor:B,newlineAfterProp:K}=z,L=B&&H?B.offset>H.offset?B:H:B??H;if(L&&(!K||K.offset<L.offset))X(L,"MISSING_CHAR","Missing newline after block sequence props")}let J=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!H||!U||U==="!"||U===bG.YAMLMap.tagName&&J==="map"||U===yG.YAMLSeq.tagName&&J==="seq")return p1($,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 p1($,Z,Q,X,U)}}let G=p1($,Z,Q,X,U,V),Y=V.resolve?.(G,(B)=>X(H,"TAG_RESOLVE_FAILED",B),Z.options)??G,W=SG.isNode(Y)?Y:new EG.Scalar(Y);if(W.range=G.range,W.tag=U,V?.format)W.format=V.format;return W}hG.composeCollection=kG});var c1=P((lG)=>{var l1=c();function fG($,Z,Q){let z=Z.offset,X=mG(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let H=X.mode===">"?l1.Scalar.BLOCK_FOLDED:l1.Scalar.BLOCK_LITERAL,U=Z.source?pG(Z.source):[],J=U.length;for(let q=U.length-1;q>=0;--q){let D=U[q][1];if(D===""||D==="\r")J=q;else break}if(J===0){let q=X.chomp==="+"&&U.length>0?`
70
- `.repeat(Math.max(1,U.length-1)):"",D=z+X.length;if(Z.source)D+=Z.source.length;return{value:q,type:H,comment:X.comment,range:[z,D,D]}}let V=Z.indent+X.indent,G=Z.offset+X.length,Y=0;for(let q=0;q<J;++q){let[D,O]=U[q];if(O===""||O==="\r"){if(X.indent===0&&D.length>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=q,V===0&&!$.atRoot)Q(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=D.length+O.length+1}for(let q=U.length-1;q>=J;--q)if(U[q][0].length>V)J=q+1;let W="",B="",K=!1;for(let q=0;q<Y;++q)W+=U[q][0].slice(V)+`
71
- `;for(let q=Y;q<J;++q){let[D,O]=U[q];G+=D.length+O.length+1;let M=O[O.length-1]==="\r";if(M)O=O.slice(0,-1);if(O&&D.length<V){let R=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(G-O.length-(M?2:1),"BAD_INDENT",R),D=""}if(H===l1.Scalar.BLOCK_LITERAL)W+=B+D.slice(V)+O,B=`
72
- `;else if(D.length>V||O[0]==="\t"){if(B===" ")B=`
60
+ ${H}
61
+ ${V}
62
+ `}};iG.YAMLError=r6;iG.YAMLParseError=rZ;iG.YAMLWarning=sZ;iG.prettifyError=dG});var E$=P((tG)=>{function aG($,{flow:Z,indicator:Q,next:z,offset:X,onError:U,parentIndent:H,startOnNewline:J}){let G=!1,V=J,Y=J,W="",B="",K=!1,L=!1,q=null,D=null,O=null,M=null,F=null,R=null,T=null;for(let N of $){if(L){if(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma")U(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(q){if(V&&N.type!=="comment"&&N.type!=="newline")U(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");q=null}switch(N.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&N.source.includes("\t"))q=N;Y=!0;break;case"comment":{if(!Y)U(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let S=N.source.substring(1)||" ";if(!W)W=S;else W+=B+S;B="",V=!1;break}case"newline":if(V){if(W)W+=N.source;else if(!R||Q!=="seq-item-ind")G=!0}else B+=N.source;if(V=!0,K=!0,D||O)M=N;Y=!0;break;case"anchor":if(D)U(N,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(N.source.endsWith(":"))U(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=N,T??(T=N.offset),V=!1,Y=!1,L=!0;break;case"tag":{if(O)U(N,"MULTIPLE_TAGS","A node can have at most one tag");O=N,T??(T=N.offset),V=!1,Y=!1,L=!0;break}case Q:if(D||O)U(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`);if(R)U(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${Z??"collection"}`);R=N,V=Q==="seq-item-ind"||Q==="explicit-key-ind",Y=!1;break;case"comma":if(Z){if(F)U(N,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);F=N,V=!1,Y=!1;break}default:U(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),V=!1,Y=!1}}let A=$[$.length-1],j=A?A.offset+A.source.length:X;if(L&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))U(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(q&&(V&&q.indent<=H||z?.type==="block-map"||z?.type==="block-seq"))U(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:F,found:R,spaceBefore:G,comment:W,hasNewline:K,anchor:D,tag:O,newlineAfterProp:M,end:j,start:T??j}}tG.resolveProps=aG});var s6=P(($V)=>{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}}$V.containsNewline=h1});var u1=P((XV)=>{var QV=s6();function zV($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&QV.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}XV.flowIndentCheck=zV});var f1=P((JV)=>{var oZ=x();function HV($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(U,H)=>U===H||oZ.isScalar(U)&&oZ.isScalar(H)&&U.value===H.value;return Z.some((U)=>X(U.key,Q))}JV.mapIncludes=HV});var Z7=P((qV)=>{var aZ=d0(),VV=n0(),tZ=E$(),YV=s6(),eZ=u1(),WV=f1(),$7="All mapping items must start at the same column";function BV({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=new(U?.nodeClass??VV.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let G=z.offset,V=null;for(let Y of z.items){let{start:W,key:B,sep:K,value:L}=Y,q=tZ.resolveProps(W,{indicator:"explicit-key-ind",next:B??K?.[0],offset:G,onError:X,parentIndent:z.indent,startOnNewline:!0}),D=!q.found;if(D){if(B){if(B.type==="block-seq")X(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==z.indent)X(G,"BAD_INDENT",$7)}if(!q.anchor&&!q.tag&&!K){if(V=q.end,q.comment)if(J.comment)J.comment+=`
64
+ `+q.comment;else J.comment=q.comment;continue}if(q.newlineAfterProp||YV.containsNewline(B))X(B??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==z.indent)X(G,"BAD_INDENT",$7);Q.atKey=!0;let O=q.end,M=B?$(Q,B,q,X):Z(Q,O,W,null,q,X);if(Q.schema.compat)eZ.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,WV.mapIncludes(Q,J.items,M))X(O,"DUPLICATE_KEY","Map keys must be unique");let F=tZ.resolveProps(K??[],{indicator:"map-value-ind",next:L,offset:M.range[2],onError:X,parentIndent:z.indent,startOnNewline:!B||B.type==="block-scalar"});if(G=F.end,F.found){if(D){if(L?.type==="block-map"&&!F.hasNewline)X(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&q.start<F.found.offset-1024)X(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let R=L?$(Q,L,F,X):Z(Q,G,K,null,F,X);if(Q.schema.compat)eZ.flowIndentCheck(z.indent,L,X);G=R.range[2];let T=new aZ.Pair(M,R);if(Q.options.keepSourceTokens)T.srcToken=Y;J.items.push(T)}else{if(D)X(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(F.comment)if(M.comment)M.comment+=`
65
+ `+F.comment;else M.comment=F.comment;let R=new aZ.Pair(M);if(Q.options.keepSourceTokens)R.srcToken=Y;J.items.push(R)}}if(V&&V<G)X(V,"IMPOSSIBLE","Map comment with trailing content");return J.range=[z.offset,G,V??G],J}qV.resolveBlockMap=BV});var Q7=P((_V)=>{var DV=r0(),LV=E$(),IV=u1();function OV({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=new(U?.nodeClass??DV.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let G=z.offset,V=null;for(let{start:Y,value:W}of z.items){let B=LV.resolveProps(Y,{indicator:"seq-item-ind",next:W,offset:G,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||W)if(W?.type==="block-seq")X(B.end,"BAD_INDENT","All sequence items must start at the same column");else X(G,"MISSING_CHAR","Sequence item without - indicator");else{if(V=B.end,B.comment)J.comment=B.comment;continue}let K=W?$(Q,W,B,X):Z(Q,B.end,Y,null,B,X);if(Q.schema.compat)IV.flowIndentCheck(z.indent,W,X);G=K.range[2],J.items.push(K)}return J.range=[z.offset,G,V??G],J}_V.resolveBlockSeq=OV});var f2=P((NV)=>{function PV($,Z,Q,z){let X="";if($){let U=!1,H="";for(let J of $){let{source:G,type:V}=J;switch(V){case"space":U=!0;break;case"comment":{if(Q&&!U)z(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=G.substring(1)||" ";if(!X)X=Y;else X+=H+Y;H="";break}case"newline":if(X)H+=G;U=!0;break;default:z(J,"UNEXPECTED_TOKEN",`Unexpected ${V} at node end`)}Z+=G.length}}return{comment:X,offset:Z}}NV.resolveEnd=PV});var U7=P((EV)=>{var FV=x(),TV=d0(),z7=n0(),AV=r0(),CV=f2(),X7=E$(),jV=s6(),wV=f1(),m1="Block collections are not allowed within flow collections",p1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function SV({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=z.start.source==="{",J=H?"flow map":"flow sequence",V=new(U?.nodeClass??(H?z7.YAMLMap:AV.YAMLSeq))(Q.schema);V.flow=!0;let Y=Q.atRoot;if(Y)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let W=z.offset+z.start.source.length;for(let D=0;D<z.items.length;++D){let O=z.items[D],{start:M,key:F,sep:R,value:T}=O,A=X7.resolveProps(M,{flow:J,indicator:"explicit-key-ind",next:F??R?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!R&&!T){if(D===0&&A.comma)X(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(A.comment)if(V.comment)V.comment+=`
66
+ `+A.comment;else V.comment=A.comment;W=A.end;continue}if(!H&&Q.options.strict&&jV.containsNewline(F))X(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(A.comma)X(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!A.comma)X(A.start,"MISSING_CHAR",`Missing , between ${J} items`);if(A.comment){let j="";$:for(let N of M)switch(N.type){case"comma":case"space":break;case"comment":j=N.source.substring(1);break $;default:break $}if(j){let N=V.items[V.items.length-1];if(FV.isPair(N))N=N.value??N.key;if(N.comment)N.comment+=`
67
+ `+j;else N.comment=j;A.comment=A.comment.substring(j.length+1)}}}if(!H&&!R&&!A.found){let j=T?$(Q,T,A,X):Z(Q,A.end,R,null,A,X);if(V.items.push(j),W=j.range[2],p1(T))X(j.range,"BLOCK_IN_FLOW",m1)}else{Q.atKey=!0;let j=A.end,N=F?$(Q,F,A,X):Z(Q,j,M,null,A,X);if(p1(F))X(N.range,"BLOCK_IN_FLOW",m1);Q.atKey=!1;let S=X7.resolveProps(R??[],{flow:J,indicator:"map-value-ind",next:T,offset:N.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(S.found){if(!H&&!A.found&&Q.options.strict){if(R)for(let _ of R){if(_===S.found)break;if(_.type==="newline"){X(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<S.found.offset-1024)X(S.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(T)if("source"in T&&T.source?.[0]===":")X(T,"MISSING_CHAR",`Missing space after : in ${J}`);else X(S.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let i=T?$(Q,T,S,X):S.found?Z(Q,S.end,R,null,S,X):null;if(i){if(p1(T))X(i.range,"BLOCK_IN_FLOW",m1)}else if(S.comment)if(N.comment)N.comment+=`
68
+ `+S.comment;else N.comment=S.comment;let e=new TV.Pair(N,i);if(Q.options.keepSourceTokens)e.srcToken=O;if(H){let _=V;if(wV.mapIncludes(Q,_.items,N))X(j,"DUPLICATE_KEY","Map keys must be unique");_.items.push(e)}else{let _=new z7.YAMLMap(Q.schema);_.flow=!0,_.items.push(e);let b=(i??N).range;_.range=[N.range[0],b[1],b[2]],V.items.push(_)}W=i?i.range[2]:S.end}}let B=H?"}":"]",[K,...L]=z.end,q=W;if(K?.source===B)q=K.offset+K.source.length;else{let D=J[0].toUpperCase()+J.substring(1),O=Y?`${D} must end with a ${B}`:`${D} in block collection must be sufficiently indented and end with a ${B}`;if(X(W,Y?"MISSING_CHAR":"BAD_INDENT",O),K&&K.source.length!==1)L.unshift(K)}if(L.length>0){let D=CV.resolveEnd(L,q,Q.options.strict,X);if(D.comment)if(V.comment)V.comment+=`
69
+ `+D.comment;else V.comment=D.comment;V.range=[z.offset,q,D.offset]}else V.range=[z.offset,q,q];return V}EV.resolveFlowCollection=SV});var H7=P((mV)=>{var yV=x(),xV=c(),gV=n0(),vV=r0(),kV=Z7(),hV=Q7(),uV=U7();function l1($,Z,Q,z,X,U){let H=Q.type==="block-map"?kV.resolveBlockMap($,Z,Q,z,U):Q.type==="block-seq"?hV.resolveBlockSeq($,Z,Q,z,U):uV.resolveFlowCollection($,Z,Q,z,U),J=H.constructor;if(X==="!"||X===J.tagName)return H.tag=J.tagName,H;if(X)H.tag=X;return H}function fV($,Z,Q,z,X){let U=z.tag,H=!U?null:Z.directives.tagName(U.source,(B)=>X(U,"TAG_RESOLVE_FAILED",B));if(Q.type==="block-seq"){let{anchor:B,newlineAfterProp:K}=z,L=B&&U?B.offset>U.offset?B:U:B??U;if(L&&(!K||K.offset<L.offset))X(L,"MISSING_CHAR","Missing newline after block sequence props")}let J=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!U||!H||H==="!"||H===gV.YAMLMap.tagName&&J==="map"||H===vV.YAMLSeq.tagName&&J==="seq")return l1($,Z,Q,X,H);let G=Z.schema.tags.find((B)=>B.tag===H&&B.collection===J);if(!G){let B=Z.schema.knownTags[H];if(B?.collection===J)Z.schema.tags.push(Object.assign({},B,{default:!1})),G=B;else{if(B)X(U,"BAD_COLLECTION_TYPE",`${B.tag} used for ${J} collection, but expects ${B.collection??"scalar"}`,!0);else X(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${H}`,!0);return l1($,Z,Q,X,H)}}let V=l1($,Z,Q,X,H,G),Y=G.resolve?.(V,(B)=>X(U,"TAG_RESOLVE_FAILED",B),Z.options)??V,W=yV.isNode(Y)?Y:new xV.Scalar(Y);if(W.range=V.range,W.tag=H,G?.format)W.format=G.format;return W}mV.composeCollection=fV});var d1=P((iV)=>{var c1=c();function lV($,Z,Q){let z=Z.offset,X=cV(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let U=X.mode===">"?c1.Scalar.BLOCK_FOLDED:c1.Scalar.BLOCK_LITERAL,H=Z.source?dV(Z.source):[],J=H.length;for(let q=H.length-1;q>=0;--q){let D=H[q][1];if(D===""||D==="\r")J=q;else break}if(J===0){let q=X.chomp==="+"&&H.length>0?`
70
+ `.repeat(Math.max(1,H.length-1)):"",D=z+X.length;if(Z.source)D+=Z.source.length;return{value:q,type:U,comment:X.comment,range:[z,D,D]}}let G=Z.indent+X.indent,V=Z.offset+X.length,Y=0;for(let q=0;q<J;++q){let[D,O]=H[q];if(O===""||O==="\r"){if(X.indent===0&&D.length>G)G=D.length}else{if(D.length<G)Q(V+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)G=D.length;if(Y=q,G===0&&!$.atRoot)Q(V,"BAD_INDENT","Block scalar values in collections must be indented");break}V+=D.length+O.length+1}for(let q=H.length-1;q>=J;--q)if(H[q][0].length>G)J=q+1;let W="",B="",K=!1;for(let q=0;q<Y;++q)W+=H[q][0].slice(G)+`
71
+ `;for(let q=Y;q<J;++q){let[D,O]=H[q];V+=D.length+O.length+1;let M=O[O.length-1]==="\r";if(M)O=O.slice(0,-1);if(O&&D.length<G){let R=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(V-O.length-(M?2:1),"BAD_INDENT",R),D=""}if(U===c1.Scalar.BLOCK_LITERAL)W+=B+D.slice(G)+O,B=`
72
+ `;else if(D.length>G||O[0]==="\t"){if(B===" ")B=`
73
73
  `;else if(!K&&B===`
74
74
  `)B=`
75
75
 
76
- `;W+=B+D.slice(V)+O,B=`
76
+ `;W+=B+D.slice(G)+O,B=`
77
77
  `,K=!0}else if(O==="")if(B===`
78
78
  `)W+=`
79
79
  `;else B=`
80
- `;else W+=B+O,B=" ",K=!1}switch(X.chomp){case"-":break;case"+":for(let q=J;q<U.length;++q)W+=`
81
- `+U[q][0].slice(V);if(W[W.length-1]!==`
80
+ `;else W+=B+O,B=" ",K=!1}switch(X.chomp){case"-":break;case"+":for(let q=J;q<H.length;++q)W+=`
81
+ `+H[q][0].slice(G);if(W[W.length-1]!==`
82
82
  `)W+=`
83
83
  `;break;default:W+=`
84
- `}let L=z+X.length+Z.source.length;return{value:W,type:H,comment:X.comment,range:[z,L,L]}}function mG({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 K=X[B];if(!J&&(K==="-"||K==="+"))J=K;else{let L=Number(K);if(!U&&L)U=L;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 K=Z[B];switch(K.type){case"space":G=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!G)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,Y=K.source.substring(1);break;case"error":z(K,"UNEXPECTED_TOKEN",K.message),W+=K.source.length;break;default:{let L=`Unexpected token in block scalar header: ${K.type}`;z(K,"UNEXPECTED_TOKEN",L);let q=K.source;if(q&&typeof q==="string")W+=q.length}}}return{mode:H,indent:U,chomp:J,comment:Y,length:W}}function pG($){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}lG.resolveBlockScalar=fG});var i1=P((eG)=>{var d1=c(),dG=u2();function iG($,Z,Q){let{offset:z,type:X,source:H,end:U}=$,J,V,G=(B,K,L)=>Q(z+B,K,L);switch(X){case"scalar":J=d1.Scalar.PLAIN,V=nG(H,G);break;case"single-quoted-scalar":J=d1.Scalar.QUOTE_SINGLE,V=rG(H,G);break;case"double-quoted-scalar":J=d1.Scalar.QUOTE_DOUBLE,V=sG(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=dG.resolveEnd(U,Y,Z,Q);return{value:V,type:J,comment:W.comment,range:[z,Y,W.offset]}}function nG($,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 X7($)}function rG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return X7($.slice(1,-1)).replace(/''/g,"'")}function X7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
84
+ `}let L=z+X.length+Z.source.length;return{value:W,type:U,comment:X.comment,range:[z,L,L]}}function cV({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],U=X[0],H=0,J="",G=-1;for(let B=1;B<X.length;++B){let K=X[B];if(!J&&(K==="-"||K==="+"))J=K;else{let L=Number(K);if(!H&&L)H=L;else if(G===-1)G=$+B}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let V=!1,Y="",W=X.length;for(let B=1;B<Z.length;++B){let K=Z[B];switch(K.type){case"space":V=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!V)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,Y=K.source.substring(1);break;case"error":z(K,"UNEXPECTED_TOKEN",K.message),W+=K.source.length;break;default:{let L=`Unexpected token in block scalar header: ${K.type}`;z(K,"UNEXPECTED_TOKEN",L);let q=K.source;if(q&&typeof q==="string")W+=q.length}}}return{mode:U,indent:H,chomp:J,comment:Y,length:W}}function dV($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),U=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let H=1;H<Z.length;H+=2)U.push([Z[H],Z[H+1]]);return U}iV.resolveBlockScalar=lV});var n1=P((QY)=>{var i1=c(),rV=f2();function sV($,Z,Q){let{offset:z,type:X,source:U,end:H}=$,J,G,V=(B,K,L)=>Q(z+B,K,L);switch(X){case"scalar":J=i1.Scalar.PLAIN,G=oV(U,V);break;case"single-quoted-scalar":J=i1.Scalar.QUOTE_SINGLE,G=aV(U,V);break;case"double-quoted-scalar":J=i1.Scalar.QUOTE_DOUBLE,G=tV(U,V);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+U.length,z+U.length]}}let Y=z+U.length,W=rV.resolveEnd(H,Y,Z,Q);return{value:G,type:J,comment:W.comment,range:[z,Y,W.offset]}}function oV($,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 J7($)}function aV($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return J7($.slice(1,-1)).replace(/''/g,"'")}function J7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
85
  `,"sy"),Q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
- `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],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 sG($,Z){let Q="";for(let z=1;z<$.length-1;++z){let X=$[z];if(X==="\r"&&$[z+1]===`
86
+ `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],U=" ",H=Z.lastIndex;Q.lastIndex=H;while(z=Q.exec($)){if(z[1]==="")if(U===`
87
+ `)X+=U;else U=`
88
+ `;else X+=U+z[1],U=" ";H=Q.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=H,z=J.exec($),X+U+(z?.[1]??"")}function tV($,Z){let Q="";for(let z=1;z<$.length-1;++z){let X=$[z];if(X==="\r"&&$[z+1]===`
89
89
  `)continue;if(X===`
90
- `){let{fold:H,offset:U}=oG($,z);Q+=H,z=U}else if(X==="\\"){let H=$[++z],U=aG[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+=tG($,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 oG($,Z){let Q="",z=$[Z+1];while(z===" "||z==="\t"||z===`
90
+ `){let{fold:U,offset:H}=eV($,z);Q+=U,z=H}else if(X==="\\"){let U=$[++z],H=$Y[U];if(H)Q+=H;else if(U===`
91
+ `){U=$[z+1];while(U===" "||U==="\t")U=$[++z+1]}else if(U==="\r"&&$[z+1]===`
92
+ `){U=$[++z+1];while(U===" "||U==="\t")U=$[++z+1]}else if(U==="x"||U==="u"||U==="U"){let J=U==="x"?2:U==="u"?4:8;Q+=ZY($,z+1,J,Z),z+=J}else{let J=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),Q+=J}}else if(X===" "||X==="\t"){let U=z,H=$[z+1];while(H===" "||H==="\t")H=$[++z+1];if(H!==`
93
+ `&&!(H==="\r"&&$[z+2]===`
94
+ `))Q+=z>U?$.slice(U,z+1):X}else Q+=X}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return Q}function eV($,Z){let Q="",z=$[Z+1];while(z===" "||z==="\t"||z===`
95
95
  `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
96
96
  `)break;if(z===`
97
97
  `)Q+=`
98
- `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var aG={"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 tG($,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}}eG.resolveFlowScalar=iG});var U7=P((UY)=>{var J2=x(),H7=c(),ZY=c1(),QY=i1();function zY($,Z,Q,z){let{value:X,type:H,comment:U,range:J}=Z.type==="block-scalar"?ZY.resolveBlockScalar($,Z,z):QY.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=XY($.schema,X,V,Q,z);else if(Z.type==="scalar")G=HY($,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 H7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new H7.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 XY($,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 HY({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}UY.composeScalar=zY});var J7=P((GY)=>{function VY($,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 $}GY.emptyScalarPosition=VY});var Y7=P((OY)=>{var WY=K$(),BY=x(),qY=z7(),V7=U7(),KY=u2(),DY=J7(),LY={composeNode:G7,composeEmptyNode:n1};function G7($,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=IY($,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=V7.composeScalar($,Z,V,z),J)G.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=qY.composeCollection(LY,$,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=n1($,Z.offset,void 0,null,Q,z)),J&&G.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!BY.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 n1($,Z,Q,z,{spaceBefore:X,comment:H,anchor:U,tag:J,end:V},G){let Y={type:"scalar",offset:DY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=V7.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 IY({options:$},{offset:Z,source:Q,end:z},X){let H=new WY.Alias(Q.substring(1));if(H.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let U=Z+Q.length,J=KY.resolveEnd(z,U,$.strict,X);if(H.range=[Z,U,J.offset],J.comment)H.comment=J.comment;return H}OY.composeEmptyNode=n1;OY.composeNode=G7});var B7=P((TY)=>{var PY=j$(),W7=Y7(),NY=u2(),RY=S$();function FY($,Z,{offset:Q,start:z,value:X,end:H},U){let J=Object.assign({_directives:Z},$),V=new PY.Document(void 0,J),G={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},Y=RY.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?W7.composeNode(G,X,Y,U):W7.composeEmptyNode(G,Y.end,z,null,Y,U);let W=V.contents.range[2],B=NY.resolveEnd(H,W,!1,U);if(B.comment)V.comment=B.comment;return V.range=[Q,W,B.offset],V}TY.composeDoc=FY});var r1=P((bY)=>{var CY=J$("process"),jY=t8(),wY=j$(),E$=w$(),q7=x(),SY=B7(),EY=u2();function b$($){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 K7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let H=$[X];switch(H[0]){case"#":Z+=(Z===""?"":z?`
98
+ `;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var $Y={"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 ZY($,Z,Q,z){let X=$.substr(Z,Q),H=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(H)}catch{let J=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}}QY.resolveFlowScalar=sV});var V7=P((VY)=>{var G2=x(),G7=c(),XY=d1(),UY=n1();function HY($,Z,Q,z){let{value:X,type:U,comment:H,range:J}=Z.type==="block-scalar"?XY.resolveBlockScalar($,Z,z):UY.resolveFlowScalar(Z,$.options.strict,z),G=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,V;if($.options.stringKeys&&$.atKey)V=$.schema[G2.SCALAR];else if(G)V=JY($.schema,X,G,Q,z);else if(Z.type==="scalar")V=GY($,X,Z,z);else V=$.schema[G2.SCALAR];let Y;try{let W=V.resolve(X,(B)=>z(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);Y=G2.isScalar(W)?W:new G7.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new G7.Scalar(X)}if(Y.range=J,Y.source=X,U)Y.type=U;if(G)Y.tag=G;if(V.format)Y.format=V.format;if(H)Y.comment=H;return Y}function JY($,Z,Q,z,X){if(Q==="!")return $[G2.SCALAR];let U=[];for(let J of $.tags)if(!J.collection&&J.tag===Q)if(J.default&&J.test)U.push(J);else return J;for(let J of U)if(J.test?.test(Z))return J;let H=$.knownTags[Q];if(H&&!H.collection)return $.tags.push(Object.assign({},H,{default:!1,test:void 0})),H;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[G2.SCALAR]}function GY({atKey:$,directives:Z,schema:Q},z,X,U){let H=Q.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(z))||Q[G2.SCALAR];if(Q.compat){let J=Q.compat.find((G)=>G.default&&G.test?.test(z))??Q[G2.SCALAR];if(H.tag!==J.tag){let G=Z.tagString(H.tag),V=Z.tagString(J.tag),Y=`Value may be parsed as either ${G} or ${V}`;U(X,"TAG_RESOLVE_FAILED",Y,!0)}}return H}VY.composeScalar=HY});var Y7=P((BY)=>{function WY($,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 $}BY.emptyScalarPosition=WY});var q7=P((PY)=>{var KY=D$(),DY=x(),LY=H7(),W7=V7(),IY=f2(),OY=Y7(),_Y={composeNode:B7,composeEmptyNode:r1};function B7($,Z,Q,z){let X=$.atKey,{spaceBefore:U,comment:H,anchor:J,tag:G}=Q,V,Y=!0;switch(Z.type){case"alias":if(V=MY($,Z,z),J||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(V=W7.composeScalar($,Z,G,z),J)V.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(V=LY.composeCollection(_Y,$,Z,Q,z),J)V.anchor=J.source.substring(1)}catch(W){let B=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",B)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),Y=!1}}if(V??(V=r1($,Z.offset,void 0,null,Q,z)),J&&V.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!DY.isScalar(V)||typeof V.value!=="string"||V.tag&&V.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)V.spaceBefore=!0;if(H)if(Z.type==="scalar"&&Z.source==="")V.comment=H;else V.commentBefore=H;if($.options.keepSourceTokens&&Y)V.srcToken=Z;return V}function r1($,Z,Q,z,{spaceBefore:X,comment:U,anchor:H,tag:J,end:G},V){let Y={type:"scalar",offset:OY.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=W7.composeScalar($,Y,J,V);if(H){if(W.anchor=H.source.substring(1),W.anchor==="")V(H,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(U)W.comment=U,W.range[2]=G;return W}function MY({options:$},{offset:Z,source:Q,end:z},X){let U=new KY.Alias(Q.substring(1));if(U.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let H=Z+Q.length,J=IY.resolveEnd(z,H,$.strict,X);if(U.range=[Z,H,J.offset],J.comment)U.comment=J.comment;return U}PY.composeEmptyNode=r1;PY.composeNode=B7});var D7=P((jY)=>{var FY=w$(),K7=q7(),TY=f2(),AY=E$();function CY($,Z,{offset:Q,start:z,value:X,end:U},H){let J=Object.assign({_directives:Z},$),G=new FY.Document(void 0,J),V={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},Y=AY.resolveProps(z,{indicator:"doc-start",next:X??U?.[0],offset:Q,onError:H,parentIndent:0,startOnNewline:!0});if(Y.found){if(G.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!Y.hasNewline)H(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=X?K7.composeNode(V,X,Y,H):K7.composeEmptyNode(V,Y.end,z,null,Y,H);let W=G.contents.range[2],B=TY.resolveEnd(U,W,!1,H);if(B.comment)G.comment=B.comment;return G.range=[Q,W,B.offset],G}jY.composeDoc=CY});var s1=P((gY)=>{var SY=G$("process"),EY=e8(),bY=w$(),b$=S$(),L7=x(),yY=D7(),xY=f2();function y$($){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 I7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let U=$[X];switch(U[0]){case"#":Z+=(Z===""?"":z?`
100
100
 
101
101
  `:`
102
- `)+(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 D7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let H=b$(Z);if(X)this.warnings.push(new E$.YAMLWarning(H,Q,z));else this.errors.push(new E$.YAMLParseError(H,Q,z))},this.directives=new jY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=K7(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(q7.isCollection(X)&&!X.flow&&X.items.length>0){let H=X.items[0];if(q7.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:K7(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(CY.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=b$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=SY.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 E$.YAMLParseError(b$($),"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 E$.YAMLParseError(b$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=EY.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 E$.YAMLParseError(b$($),"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 wY.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}}}bY.Composer=D7});var O7=P((mY)=>{var xY=c1(),gY=i1(),vY=w$(),L7=O$();function kY($,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 vY.YAMLParseError([J,J+1],H,U)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gY.resolveFlowScalar($,Z,z);case"block-scalar":return xY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function hY($,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(!I7(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 uY($,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">":fY($,V);break;case'"':s1($,V,"double-quoted-scalar");break;case"'":s1($,V,"single-quoted-scalar");break;default:s1($,V,"scalar")}}function fY($,Z){let Q=Z.indexOf(`
102
+ `)+(U.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class O7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let U=y$(Z);if(X)this.warnings.push(new b$.YAMLWarning(U,Q,z));else this.errors.push(new b$.YAMLParseError(U,Q,z))},this.directives=new EY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=I7(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(L7.isCollection(X)&&!X.flow&&X.items.length>0){let U=X.items[0];if(L7.isPair(U))U=U.key;let H=U.commentBefore;U.commentBefore=H?`${Q}
104
+ ${H}`:Q}else{let U=X.commentBefore;X.commentBefore=U?`${Q}
105
+ ${U}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:I7(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(SY.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=y$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=yY.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 b$.YAMLParseError(y$($),"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 b$.YAMLParseError(y$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=xY.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 b$.YAMLParseError(y$($),"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 bY.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}}}gY.Composer=O7});var P7=P((cY)=>{var kY=d1(),hY=n1(),uY=S$(),_7=_$();function fY($,Z=!0,Q){if($){let z=(X,U,H)=>{let J=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(J,U,H);else throw new uY.YAMLParseError([J,J+1],U,H)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hY.resolveFlowScalar($,Z,z);case"block-scalar":return kY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function mY($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:U=-1,type:H="PLAIN"}=Z,J=_7.stringifyString({type:H,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
107
+ `}];switch(J[0]){case"|":case">":{let V=J.indexOf(`
108
+ `),Y=J.substring(0,V),W=J.substring(V+1)+`
109
+ `,B=[{type:"block-scalar-header",offset:U,indent:z,source:Y}];if(!M7(B,G))B.push({type:"newline",offset:-1,indent:z,source:`
110
+ `});return{type:"block-scalar",offset:U,indent:z,props:B,source:W}}case'"':return{type:"double-quoted-scalar",offset:U,indent:z,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:U,indent:z,source:J,end:G};default:return{type:"scalar",offset:U,indent:z,source:J,end:G}}}function pY($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:U=!1,type:H}=Q,J="indent"in $?$.indent:null;if(z&&typeof J==="number")J+=2;if(!H)switch($.type){case"single-quoted-scalar":H="QUOTE_SINGLE";break;case"double-quoted-scalar":H="QUOTE_DOUBLE";break;case"block-scalar":{let V=$.props[0];if(V.type!=="block-scalar-header")throw Error("Invalid block scalar header");H=V.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:H="PLAIN"}let G=_7.stringifyString({type:H,value:Z},{implicitKey:X||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":lY($,G);break;case'"':o1($,G,"double-quoted-scalar");break;case"'":o1($,G,"single-quoted-scalar");break;default:o1($,G,"scalar")}}function lY($,Z){let Q=Z.indexOf(`
111
111
  `),z=Z.substring(0,Q),X=Z.substring(Q+1)+`
112
- `;if($.type==="block-scalar"){let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=z,$.source=X}else{let{offset:H}=$,U="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:H,indent:U,source:z}];if(!I7(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 I7($,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 s1($,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})}}}mY.createScalarToken=hY;mY.resolveAsScalar=kY;mY.setScalarValue=uY});var _7=P((iY)=>{var dY=($)=>("type"in $)?s6($):r6($);function s6($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=s6(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=r6(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=r6(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=r6($);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 r6({start:$,key:Z,sep:Q,value:z}){let X="";for(let H of $)X+=H.source;if(Z)X+=s6(Z);if(Q)for(let H of Q)X+=H.source;if(z)X+=s6(z);return X}iY.stringify=dY});var N7=P((sY)=>{var o1=Symbol("break visit"),rY=Symbol("skip children"),M7=Symbol("remove item");function V2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};P7(Object.freeze([]),$,Z)}V2.BREAK=o1;V2.SKIP=rY;V2.REMOVE=M7;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 P7($,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=P7(Object.freeze($.concat([[X,U]])),H.items[U],Q);if(typeof J==="number")U=J-1;else if(J===o1)return o1;else if(J===M7)H.items.splice(U,1),U-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}sY.visit=V2});var o6=P((zW)=>{var a1=O7(),aY=_7(),tY=N7(),t1="\uFEFF",e1="\x02",$4="\x18",Z4="\x1F",eY=($)=>!!$&&("items"in $),$W=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function ZW($){switch($){case t1:return"<BOM>";case e1:return"<DOC>";case $4:return"<FLOW_END>";case Z4:return"<SCALAR>";default:return JSON.stringify($)}}function QW($){switch($){case t1:return"byte-order-mark";case e1:return"doc-mode";case $4:return"flow-error-end";case Z4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
112
+ `;if($.type==="block-scalar"){let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=z,$.source=X}else{let{offset:U}=$,H="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:U,indent:H,source:z}];if(!M7(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:H,source:`
113
+ `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:H,props:J,source:X})}}function M7($,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 U of z)U.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
114
+ `};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}cY.createScalarToken=mY;cY.resolveAsScalar=fY;cY.setScalarValue=pY});var N7=P((sY)=>{var rY=($)=>("type"in $)?a6($):o6($);function a6($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=a6(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=o6(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=o6(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=o6($);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 o6({start:$,key:Z,sep:Q,value:z}){let X="";for(let U of $)X+=U.source;if(Z)X+=a6(Z);if(Q)for(let U of Q)X+=U.source;if(z)X+=a6(z);return X}sY.stringify=rY});var T7=P((tY)=>{var a1=Symbol("break visit"),aY=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=aY;V2.REMOVE=R7;V2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let U=Q?.[z];if(U&&"items"in U)Q=U.items[X];else return}return Q};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 U=Z[X];if(U&&"items"in U){for(let H=0;H<U.items.length;++H){let J=F7(Object.freeze($.concat([[X,H]])),U.items[H],Q);if(typeof J==="number")H=J-1;else if(J===a1)return a1;else if(J===R7)U.items.splice(H,1),H-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}tY.visit=V2});var t6=P((HW)=>{var t1=P7(),$W=N7(),ZW=T7(),e1="\uFEFF",$4="\x02",Z4="\x18",Q4="\x1F",QW=($)=>!!$&&("items"in $),zW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function XW($){switch($){case e1:return"<BOM>";case $4:return"<DOC>";case Z4:return"<FLOW_END>";case Q4:return"<SCALAR>";default:return JSON.stringify($)}}function UW($){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}zW.createScalarToken=a1.createScalarToken;zW.resolveAsScalar=a1.resolveAsScalar;zW.setScalarValue=a1.setScalarValue;zW.stringify=aY.stringify;zW.visit=tY.visit;zW.BOM=t1;zW.DOCUMENT=e1;zW.FLOW_END=$4;zW.SCALAR=Z4;zW.isCollection=eY;zW.isScalar=$W;zW.prettyToken=ZW;zW.tokenType=QW});var z4=P((_W)=>{var y$=o6();function B0($){switch($){case void 0:case" ":case`
117
- `:case"\r":case"\t":return!0;default:return!1}}var R7=new Set("0123456789ABCDEFabcdef"),IW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),a6=new Set(",[]{}"),OW=new Set(` ,[]{}
118
- \r `),Q4=($)=>!$||OW.has($);class F7{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let Q=this.next??"stream";while(Q&&(Z||this.hasChars(1)))Q=yield*this.parseNext(Q)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
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}HW.createScalarToken=t1.createScalarToken;HW.resolveAsScalar=t1.resolveAsScalar;HW.setScalarValue=t1.setScalarValue;HW.stringify=$W.stringify;HW.visit=ZW.visit;HW.BOM=e1;HW.DOCUMENT=$4;HW.FLOW_END=Z4;HW.SCALAR=Q4;HW.isCollection=QW;HW.isScalar=zW;HW.prettyToken=XW;HW.tokenType=UW});var X4=P((NW)=>{var x$=t6();function B0($){switch($){case void 0:case" ":case`
117
+ `:case"\r":case"\t":return!0;default:return!1}}var A7=new Set("0123456789ABCDEFabcdef"),MW=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),e6=new Set(",[]{}"),PW=new Set(` ,[]{}
118
+ \r `),z4=($)=>!$||PW.has($);class C7{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let Q=this.next??"stream";while(Q&&(Z||this.hasChars(1)))Q=yield*this.parseNext(Q)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
119
119
  `)return!0;if(Z==="\r")return this.buffer[$+1]===`
120
120
  `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let Q=0;while(Z===" ")Z=this.buffer[++Q+$];if(Z==="\r"){let z=this.buffer[Q+$+1];if(z===`
121
121
  `||!z&&!this.atEnd)return $+Q+1}return Z===`
122
122
  `||Q>=this.indentNext||!Z&&!this.atEnd?$+Q:-1}if(Z==="-"||Z==="."){let Q=this.buffer.substr($,3);if((Q==="---"||Q==="...")&&B0(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]===y$.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 y$.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==="...")&&B0(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&&!B0(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(($==="-"||$==="?"||$===":")&&B0(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(Q4),"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("..."))&&B0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield y$.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(Q4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||B0(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
123
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===x$.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 x$.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==="...")&&B0(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&&!B0(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(($==="-"||$==="?"||$===":")&&B0(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("..."))&&B0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield x$.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 U=this.charAt(1);if(this.flowKey||B0(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
124
124
  `,this.pos);if(z!==-1){while(z!==-1){let X=this.continueScalar(z+1);if(X===-1)break;z=Q.indexOf(`
125
125
  `,X)}if(z!==-1)Z=z-(Q[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>B0(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===`
126
+ `:$=X,Z=0;break;case"\r":{let U=this.buffer[X+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
127
127
  `)break}default:break $}if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let X=this.continueScalar($+1);if(X===-1)break;$=this.buffer.indexOf(`
128
128
  `,X)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;Q=this.buffer[z];while(Q===" ")Q=this.buffer[++z];if(Q==="\t"){while(Q==="\t"||Q===" "||Q==="\r"||Q===`
129
- `)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 y$.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(B0(X)||$&&a6.has(X))break;Z=Q}else if(B0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
129
+ `)Q=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let X=$-1,U=this.buffer[X];if(U==="\r")U=this.buffer[--X];let H=X;while(U===" ")U=this.buffer[--X];if(U===`
130
+ `&&X>=this.pos&&X+1+Z>H)$=X;else break}while(!0);return yield x$.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(B0(X)||$&&e6.has(X))break;Z=Q}else if(B0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
131
131
  `)Q+=1,z=`
132
- `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&a6.has(X))break;if(z===`
133
- `){let H=this.continueScalar(Q+1);if(H===-1)break;Q=Math.max(Q,H-2)}}else{if($&&a6.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield y$.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(Q4),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(B0(Q)||Z&&a6.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(!B0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(IW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&R7.has(this.buffer[$+1])&&R7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
132
+ `,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&e6.has(X))break;if(z===`
133
+ `){let U=this.continueScalar(Q+1);if(U===-1)break;Q=Math.max(Q,U-2)}}else{if($&&e6.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield x$.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(B0(Q)||Z&&e6.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(!B0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(MW.has(Z))Z=this.buffer[++$];else if(Z==="%"&&A7.has(this.buffer[$+1])&&A7.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
134
134
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
135
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,Q;do Q=this.buffer[++Z];while(Q===" "||$&&Q==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,Q=this.buffer[Z];while(!$(Q))Q=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}_W.Lexer=F7});var X4=P((PW)=>{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}}}}PW.LineCounter=T7});var H4=P((TW)=>{var RW=J$("process"),A7=o6(),FW=z4();function s0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function C7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function w7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function t6($){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 e6($,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&&!s0(Z.start,"explicit-key-ind")&&!s0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,w7(Z.value))if(Z.value.end)e6(Z.value.end,Z.sep);else Z.value.end=Z.sep;else e6(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 FW.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=$,RW.env.LOG_TOKENS)console.log("|",A7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=A7.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&&C7(z.start)===-1&&(Z.indent===0||z.start.every((X)=>X.type!=="comment"||X.indent<Z.indent))){if(Q.type==="document")Q.end=z.start;else Q.items.push({start:z.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(C7($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=t6(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(`
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)}}NW.Lexer=C7});var U4=P((FW)=>{class j7{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}}}}FW.LineCounter=j7});var H4=P((jW)=>{var AW=G$("process"),w7=t6(),CW=X4();function s0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function S7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function b7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $8($){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 m2($){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 Z8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function E7($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!s0(Z.start,"explicit-key-ind")&&!s0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,b7(Z.value))if(Z.value.end)Z8(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Z8(Z.start,Z.sep);delete Z.sep}}}class y7{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 CW.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=$,AW.env.LOG_TOKENS)console.log("|",w7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=w7.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")E7(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&&S7(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(S7($.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=$8(this.peek(2)),Q=m2(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let X={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Q,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
136
136
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
137
- `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){e6(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(s0(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(s0(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(w7(Z.key)&&!s0(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(s0(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&&!s0(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)){e6(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||s0(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=t6(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(`
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)){Z8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let U=[];for(let H=0;H<Z.sep.length;++H){let J=Z.sep[H];switch(J.type){case"newline":U.push(H);break;case"space":break;case"comment":if(J.indent>$.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)X=Z.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(s0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let U=m2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(s0(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(b7(Z.key)&&!s0(Z.sep,"newline")){let U=m2(Z.start),H=Z.key,J=Z.sep;J.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:H,sep:J}]})}else if(X.length>0)Z.sep=Z.sep.concat(X,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:X,key:null,sep:[this.sourceToken]});else if(s0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:U,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(U);else Object.assign(Z,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue($);if(U){if(U.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!s0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Z8(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||s0(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=$8(Q),X=m2(z);E7($);let U=$.end.splice(1,$.end.length);U.push(this.sourceToken);let H={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
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=t6($),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=t6($),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()}}}TW.Parser=S7});var g7=P((xW)=>{var E7=r1(),CW=j$(),x$=w$(),jW=X1(),wW=x(),SW=X4(),b7=H4();function y7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new SW.LineCounter||null,prettyErrors:Z}}function EW($,Z={}){let{lineCounter:Q,prettyErrors:z}=y7(Z),X=new b7.Parser(Q?.addNewLine),H=new E7.Composer(Z),U=Array.from(H.compose(X.parse($)));if(z&&Q)for(let J of U)J.errors.forEach(x$.prettifyError($,Q)),J.warnings.forEach(x$.prettifyError($,Q));if(U.length>0)return U;return Object.assign([],{empty:!0},H.streamInfo())}function x7($,Z={}){let{lineCounter:Q,prettyErrors:z}=y7(Z),X=new b7.Parser(Q?.addNewLine),H=new E7.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 x$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)U.errors.forEach(x$.prettifyError($,Q)),U.warnings.forEach(x$.prettifyError($,Q));return U}function bW($,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=x7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>jW.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 yW($,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(wW.isDocument($)&&!z)return $.toString(Q);return new CW.Document($,z,Q).toString(Q)}xW.parse=bW;xW.parseAllDocuments=EW;xW.parseDocument=x7;xW.stringify=yW});var m=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],S0=new Map(m.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),JM=new Map(m.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),VM=new Map(m.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 qz($){return m.filter((Z)=>Z.category===$)}var Kz=m.filter(($)=>$.index<=21),Dz=m,G6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]),R5=new Set(["none","n/a","not applicable"]),Y6="slotignored";function Lz($){return typeof $==="string"&&R5.has($.trim().toLowerCase())}function l8($){return typeof $==="string"&&$.trim()!==""&&s($)}function s($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return G6.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",Iz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function C2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(T2,$))return null;if(!T2[$].includes(Z.category))return!1;return!($==="framework"&&Iz.has(Z.path))}var T2={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 c8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,V$=c8("1"),j2=c8("2"),YM=c8("3"),G$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},Y$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,d8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,w2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var E0=[{name:"TROPHY",indicator:`${w2("✪")} ${w2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${w2(V$("★"))} ${w2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${Y$("◆")} ${Y$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${d8("◇")} ${d8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${V$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${j2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${j2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${j2("♡")}`,threshold:0}];function W$($){for(let Z of E0)if($>=Z.threshold)return Z;return E0[E0.length-1]}function Oz($){let Z=W$($),Q=E0.indexOf(Z);return Q>0?E0[Q-1]:null}var r8={};Wz(r8,{validate:()=>Mz,sdkVersion:()=>Tz,scoreFafb:()=>Fz,scoreEnterprise:()=>_z,score:()=>n8,fafbInfo:()=>Rz,decompile:()=>Nz,compile:()=>Pz});var i8=null;function m0(){if(i8)return i8;try{let $=J$("faf-scoring-kernel");return i8=$,$}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=$8($),Q=m2(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=$8($),Q=m2(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()}}}jW.Parser=y7});var h7=P((kW)=>{var x7=s1(),SW=w$(),g$=S$(),EW=U1(),bW=x(),yW=U4(),g7=H4();function v7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new yW.LineCounter||null,prettyErrors:Z}}function xW($,Z={}){let{lineCounter:Q,prettyErrors:z}=v7(Z),X=new g7.Parser(Q?.addNewLine),U=new x7.Composer(Z),H=Array.from(U.compose(X.parse($)));if(z&&Q)for(let J of H)J.errors.forEach(g$.prettifyError($,Q)),J.warnings.forEach(g$.prettifyError($,Q));if(H.length>0)return H;return Object.assign([],{empty:!0},U.streamInfo())}function k7($,Z={}){let{lineCounter:Q,prettyErrors:z}=v7(Z),X=new g7.Parser(Q?.addNewLine),U=new x7.Composer(Z),H=null;for(let J of U.compose(X.parse($),!0,$.length))if(!H)H=J;else if(H.options.logLevel!=="silent"){H.errors.push(new g$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)H.errors.forEach(g$.prettifyError($,Q)),H.warnings.forEach(g$.prettifyError($,Q));return H}function gW($,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=k7($,Q);if(!X)return null;if(X.warnings.forEach((U)=>EW.warn(X.options.logLevel,U)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function vW($,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(bW.isDocument($)&&!z)return $.toString(Q);return new SW.Document($,z,Q).toString(Q)}kW.parse=gW;kW.parseAllDocuments=xW;kW.parseDocument=k7;kW.stringify=vW});var m=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],S0=new Map(m.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),VM=new Map(m.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),YM=new Map(m.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function T5($,Z){let Q=(X)=>{let U=X.split("."),H=$;for(let J of U)if(H&&typeof H==="object"&&J in H)H=H[J];else return;return H},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function Lz($){return m.filter((Z)=>Z.category===$)}var Iz=m.filter(($)=>$.index<=21),Oz=m,W6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]),A5=new Set(["none","n/a","not applicable"]),B6="slotignored";function _z($){return typeof $==="string"&&A5.has($.trim().toLowerCase())}function c8($){return typeof $==="string"&&$.trim()!==""&&s($)}function s($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return W6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var C2="no classifying signals — fallback",Mz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function j2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(A2,$))return null;if(!A2[$].includes(Z.category))return!1;return!($==="framework"&&Mz.has(Z.path))}var A2={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`,V$=d8("1"),w2=d8("2"),BM=d8("3"),Y$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},W$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,i8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,S2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var E0=[{name:"TROPHY",indicator:`${S2("✪")} ${S2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${S2(V$("★"))} ${S2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${W$("◆")} ${W$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${i8("◇")} ${i8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${V$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${w2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${w2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${w2("♡")}`,threshold:0}];function B$($){for(let Z of E0)if($>=Z.threshold)return Z;return E0[E0.length-1]}function Pz($){let Z=B$($),Q=E0.indexOf(Z);return Q>0?E0[Q-1]:null}var s8={};Kz(s8,{validate:()=>Rz,sdkVersion:()=>jz,scoreFafb:()=>Cz,scoreEnterprise:()=>Nz,score:()=>r8,fafbInfo:()=>Az,decompile:()=>Tz,compile:()=>Fz});var n8=null;function m0(){if(n8)return n8;try{let $=G$("faf-scoring-kernel");return n8=$,$}catch{throw Error(`faf-scoring-kernel not installed.
140
140
 
141
141
  Run: npm install faf-scoring-kernel
142
- `)}}var W6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function n8($){return JSON.parse(m0().score_faf(W6($)))}function _z($){return JSON.parse(m0().score_faf_enterprise(W6($)))}function Mz($){return m0().validate_faf(W6($))}function Pz($){return m0().compile_fafb(W6($))}function Nz($){return JSON.parse(m0().decompile_fafb($))}function Rz($){return JSON.parse(m0().fafb_info($))}function Fz($){return JSON.parse(m0().score_fafb($))}function Tz(){return m0().sdk_version()}var F5=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function T5($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function A5($){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 Az($){return $.unknown?"unknown (—)":`${$.score}%`}function C5($){return{score:$.score,tier:W$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function s8($){let Z=A5($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?W$(Q):E0[E0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return C5(n8($))}function Cz($){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(!F5.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 A9}from"fs";import{join as R9,dirname as T4,basename as eP,resolve as d$}from"path";var uW=r1(),fW=j$(),mW=b1(),U4=w$(),pW=K$(),o0=x(),lW=d0(),cW=c(),dW=n0(),iW=r0(),kP=o6(),nW=z4(),rW=X4(),sW=H4(),$8=g7(),v7=B$();var oW=uW.Composer,Z8=fW.Document,aW=mW.Schema,tW=U4.YAMLError,Q8=U4.YAMLParseError,eW=U4.YAMLWarning,$B=pW.Alias,x0=o0.isAlias,G2=o0.isCollection,ZB=o0.isDocument,p=o0.isMap,q0=o0.isNode,QB=o0.isPair,r=o0.isScalar,g0=o0.isSeq,zB=lW.Pair,XB=cW.Scalar,m2=dW.YAMLMap,g$=iW.YAMLSeq;var HB=nW.Lexer,UB=rW.LineCounter,JB=sW.Parser,v0=$8.parse,VB=$8.parseAllDocuments,p2=$8.parseDocument,Y2=$8.stringify,GB=v7.visit,YB=v7.visitAsync;import{accessSync as k7,closeSync as Y4,constants as h7,existsSync as WB,fchmodSync as u7,fchownSync as BB,fsyncSync as f7,lstatSync as W4,mkdirSync as m7,mkdtempSync as fP,openSync as p7,readdirSync as qB,readFileSync as B4,readlinkSync as KB,realpathSync as DB,renameSync as LB,rmSync as mP,statSync as l2,unlinkSync as l7,writeFileSync as IB}from"fs";import{randomBytes as OB}from"crypto";import{basename as a0,dirname as W2,isAbsolute as c7,join as c2,relative as q4,resolve as V0,sep as z8}from"path";class E extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var o=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),_B=new Set(Object.values(o).map(($)=>$.toLowerCase())),MB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),J4=($)=>_B.has($.toLowerCase());function d2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var PB=/\.fafm?$/i,NB=/^[a-z][a-z0-9-]*$/,T0=($)=>DB.native($),t0=($)=>$?.code;function k$($,Z){let Q=q4($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${z8}`)&&!c7(Q)}function d7($){try{return KB($)}catch{return"?"}}function RB($,Z,Q,z){let X;try{X=T0(Q)}catch(H){let U=t0(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new E("dangling",Z,`${Z} is a link to ${d7(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!k$($,X))throw new E("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(d2(X)&&!(z.inGit&&W2(X)===$))throw new E("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!l2(X).isFile())throw new E("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return FB(Z,X,z.read),X}function FB($,Z,Q){let z=a0($),X=a0(Z),H=J4(z)&&J4(X);if(Q&&!PB.test(X)&&!H){let U=J4(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new E("not-faf",$,`${$} is a link to ${Z}, which is not ${U} — refused.`)}if(!Q&&!MB(z,X)&&!H)throw new E("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function TB($,Z,Q,z){if(a0(V0($))!=="hooks"||!NB.test(a0(Z)))throw new E("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new E("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function AB($,Z,Q){if(a0($)!=="config"||Q!==Z)throw new E("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function h($,Z,Q={}){let z=T0(V0($)),X=V0($,Z),H=T0(W2(X));if(!k$(z,H))throw new E("outside",X,`${X} is in ${H}, outside ${z} — refused.`);let U=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(U)TB($,X,z,H);if(J)AB(X,z,H);let V=c2(H,a0(X));if(d2(V)&&!U&&!J)throw new E("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 RB(z,X,V,{read:Q.read===!0,inGit:U||J});if(!G.isFile())throw new E("not-a-file",X,`${X} is not a regular file — refused.`);return T0(V)}var CB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function jB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return CB.decode($)}catch{}throw new E("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function $0($){return jB(B4($),$)}function K0($){try{return B4($)}catch(Z){if(t0(Z)==="ENOENT")return null;throw Z}}function v$($,Z){let Q=V0(c2($,Z));if(!WB(Q))return null;let z,X;try{z=T0(wB($)),X=T0(Q)}catch{return null}if(!k$(z,X)||d2(q4(z,X)))return null;return X}var G4=[];function wB($){let Z=V0($);return G4.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(z8)?Q:Q+z8))??Z}function i2($,Z){G4.push(V0($));try{return Z()}finally{G4.pop()}}function I($,Z){return v$($,Z)!==null}function w($,Z){let Q=v$($,Z);if(Q===null)return null;try{return l2(Q).isFile()?B4(Q,"utf-8"):null}catch{return null}}function D0($,Z){let Q=v$($,Z);if(Q===null)return null;try{return l2(Q)}catch{return null}}function v($,Z="."){let Q=v$($,Z);if(Q===null)return null;let z;try{z=qB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||v$($,c2(Z,X.name))!==null)}function SB($){try{let Z=l2($);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 i7 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var V4=($)=>new E("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function K4($,Z,Q){if(Z!==void 0){let X=K0($),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 V4($)}if(!Q)return;let z;try{z=l2($)}catch(X){if(t0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw V4($);try{k7($,h7.W_OK)}catch{throw V4($)}}function EB($,Z){if(process.platform!=="win32")try{BB($,Z.uid,Z.gid)}catch{}u7($,Z.mode)}function bB($){if(process.platform==="win32")return;try{let Z=p7($,"r");try{f7(Z)}finally{Y4(Z)}}catch{}}function yB($,Z,Q,z){if($.fd=p7($.path,"wx",z??Q?.mode??438),$.created=!0,IB($.fd,Z),Q)EB($.fd,Q);if(z!==void 0)u7($.fd,z);f7($.fd),Y4($.fd),$.fd=void 0}function xB($){if($.fd!==void 0)try{Y4($.fd)}catch{}if($.created)try{l7($.path)}catch{}}function gB($,Z,Q){let z=W2($),X={path:c2(z,`.${a0($).slice(0,100)}.${process.pid}.${OB(6).toString("hex")}.faf-tmp`),created:!1},H=SB($);try{if(H)k7($,h7.W_OK);yB(X,Z,H,Q.mode),K4($,Q.expect,H),LB(X.path,$)}catch(U){if(xB(X),U instanceof E)throw U;let J=t0(U)??(U instanceof Error?U.message:String(U));throw new i7($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}bB(z)}function vB($){return $ instanceof E&&!$.onWrite?new E($.reason,$.path,$.message,{onWrite:!0}):$}function a($,Z,Q={}){let z=V0($),X;try{X=h(Q.root??W2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw vB(H)}return gB(X,Z,Q),X}function n7($,Z,Q){let z=V0($),X=Q.root??W2(z),H=h(X,z),U=K0(H);if(Q.expect!==void 0)K4(H,Q.expect,void 0);if(U!==null&&Q.force!==!0&&!Q.owns(U))throw new E("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return a(H,Z,{root:X,expect:U})}function n2($,Z=$){let Q=V0($);m7(Q,{recursive:!0});let z=T0(Q),X=V0(Q,Z),H=q4(Q,X);if(H===".."||H.startsWith(`..${z8}`)||c7(H))throw new E("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let U=z;for(let J of H.split(/[\\/]/).filter(Boolean)){let V=c2(U,J);if(d2(V))throw new E("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});U=kB(z,X,V)}return U}function kB($,Z,Q){let z;try{z=W4(Q)}catch(H){if(t0(H)!=="ENOENT")throw H;return m7(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=T0(Q)}catch{throw new E("dangling",Z,`${Q} is a link to ${d7(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!k$($,X))throw new E("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(d2(X))throw new E("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!l2(X).isDirectory())throw new E("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function hB($,Z){let Q=V0($),z=T0(V0(Z.root??W2(Q))),X=T0(W2(Q));if(!k$(z,X))throw new E("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=c2(X,a0(Q));if(d2(H))throw new E("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 E("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return K4(H,Z.expect,void 0),l7(H),!0}function u($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function h$($){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(!u($))throw new E("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${h$($)}. `+"faf left it unchanged — fix it by hand.");return $}var e7=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function r7($){return typeof $==="object"&&$.collection===void 0}function uB($,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||!e7.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(r(X)?X.value:X,$.value)?Q:void 0}function fB($){let Z=$.filter(r7);return $.map((Q)=>{if(!r7(Q)||!e7.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,H,U,J)=>uB(X,Z)??z(X,H,U,J)}})}var H8={keepSourceTokens:!0,customTags:fB};function mB($,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 pB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let H=mB(Z[X],Z[X+1]);Q??=H.indent,z??=H.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function _4($,Z){let Q=p2($,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 B2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function u$($,Z){return $.lastIndexOf(`
145
- `,Z-1)+1}function $9($,Z){if(Z>0&&$[Z-1]===`
142
+ `)}}var q6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function r8($){return JSON.parse(m0().score_faf(q6($)))}function Nz($){return JSON.parse(m0().score_faf_enterprise(q6($)))}function Rz($){return m0().validate_faf(q6($))}function Fz($){return m0().compile_fafb(q6($))}function Tz($){return JSON.parse(m0().decompile_fafb($))}function Az($){return JSON.parse(m0().fafb_info($))}function Cz($){return JSON.parse(m0().score_fafb($))}function jz(){return m0().sdk_version()}var C5=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function j5($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function w5($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],U=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),H=-1;if(U){let J=parseInt(U[1],10);if(J>=0&&J<=100)H=J}return{represents:X,sourceScore:H}}function wz($){return $.unknown?"unknown (—)":`${$.score}%`}function S5($){return{score:$.score,tier:B$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function o8($){let Z=w5($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?B$(Q):E0[E0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return S5(r8($))}function Sz($){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(!j5(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!C5.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 w9}from"fs";import{join as A9,dirname as A4,basename as ZN,resolve as i$}from"path";var pW=s1(),lW=w$(),cW=y1(),J4=S$(),dW=D$(),o0=x(),iW=d0(),nW=c(),rW=n0(),sW=r0(),uP=t6(),oW=X4(),aW=U4(),tW=H4(),Q8=h7(),u7=q$();var eW=pW.Composer,z8=lW.Document,$B=cW.Schema,ZB=J4.YAMLError,X8=J4.YAMLParseError,QB=J4.YAMLWarning,zB=dW.Alias,x0=o0.isAlias,Y2=o0.isCollection,XB=o0.isDocument,p=o0.isMap,q0=o0.isNode,UB=o0.isPair,r=o0.isScalar,g0=o0.isSeq,HB=iW.Pair,JB=nW.Scalar,p2=rW.YAMLMap,v$=sW.YAMLSeq;var GB=oW.Lexer,VB=aW.LineCounter,YB=tW.Parser,v0=Q8.parse,WB=Q8.parseAllDocuments,l2=Q8.parseDocument,W2=Q8.stringify,BB=u7.visit,qB=u7.visitAsync;import{accessSync as f7,closeSync as W4,constants as m7,existsSync as KB,fchmodSync as p7,fchownSync as DB,fsyncSync as l7,lstatSync as B4,mkdirSync as c7,mkdtempSync as pP,openSync as d7,readdirSync as LB,readFileSync as q4,readlinkSync as IB,realpathSync as OB,renameSync as _B,rmSync as lP,statSync as c2,unlinkSync as i7,writeFileSync as MB}from"fs";import{randomBytes as PB}from"crypto";import{basename as a0,dirname as B2,isAbsolute as n7,join as d2,relative as K4,resolve as G0,sep as U8}from"path";class E extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var o=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),NB=new Set(Object.values(o).map(($)=>$.toLowerCase())),RB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),G4=($)=>NB.has($.toLowerCase());function i2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var FB=/\.fafm?$/i,TB=/^[a-z][a-z0-9-]*$/,T0=($)=>OB.native($),t0=($)=>$?.code;function h$($,Z){let Q=K4($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${U8}`)&&!n7(Q)}function r7($){try{return IB($)}catch{return"?"}}function AB($,Z,Q,z){let X;try{X=T0(Q)}catch(U){let H=t0(U);if(H==="ENOENT"||H==="ELOOP"||H==="ENOTDIR")throw new E("dangling",Z,`${Z} is a link to ${r7(Q)}, which does not exist. faf does not create files through a link — refused.`);throw U}if(!h$($,X))throw new E("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(i2(X)&&!(z.inGit&&B2(X)===$))throw new E("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!c2(X).isFile())throw new E("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return CB(Z,X,z.read),X}function CB($,Z,Q){let z=a0($),X=a0(Z),U=G4(z)&&G4(X);if(Q&&!FB.test(X)&&!U){let H=G4(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new E("not-faf",$,`${$} is a link to ${Z}, which is not ${H} — refused.`)}if(!Q&&!RB(z,X)&&!U)throw new E("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function jB($,Z,Q,z){if(a0(G0($))!=="hooks"||!TB.test(a0(Z)))throw new E("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new E("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function wB($,Z,Q){if(a0($)!=="config"||Q!==Z)throw new E("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function h($,Z,Q={}){let z=T0(G0($)),X=G0($,Z),U=T0(B2(X));if(!h$(z,U))throw new E("outside",X,`${X} is in ${U}, outside ${z} — refused.`);let H=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(H)jB($,X,z,U);if(J)wB(X,z,U);let G=d2(U,a0(X));if(i2(G)&&!H&&!J)throw new E("git",X,G===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${G}, inside .git/ — refused.`);let V;try{V=B4(G)}catch(Y){if(t0(Y)==="ENOENT")return G;throw Y}if(V.isSymbolicLink())return AB(z,X,G,{read:Q.read===!0,inGit:H||J});if(!V.isFile())throw new E("not-a-file",X,`${X} is not a regular file — refused.`);return T0(G)}var SB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function EB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return SB.decode($)}catch{}throw new E("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function $0($){return EB(q4($),$)}function K0($){try{return q4($)}catch(Z){if(t0(Z)==="ENOENT")return null;throw Z}}function k$($,Z){let Q=G0(d2($,Z));if(!KB(Q))return null;let z,X;try{z=T0(bB($)),X=T0(Q)}catch{return null}if(!h$(z,X)||i2(K4(z,X)))return null;return X}var Y4=[];function bB($){let Z=G0($);return Y4.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(U8)?Q:Q+U8))??Z}function n2($,Z){Y4.push(G0($));try{return Z()}finally{Y4.pop()}}function I($,Z){return k$($,Z)!==null}function w($,Z){let Q=k$($,Z);if(Q===null)return null;try{return c2(Q).isFile()?q4(Q,"utf-8"):null}catch{return null}}function D0($,Z){let Q=k$($,Z);if(Q===null)return null;try{return c2(Q)}catch{return null}}function v($,Z="."){let Q=k$($,Z);if(Q===null)return null;let z;try{z=LB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||k$($,d2(Z,X.name))!==null)}function yB($){try{let Z=c2($);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 s7 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var V4=($)=>new E("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function D4($,Z,Q){if(Z!==void 0){let X=K0($),U=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||U===null?X===U:X.equals(U)))throw V4($)}if(!Q)return;let z;try{z=c2($)}catch(X){if(t0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw V4($);try{f7($,m7.W_OK)}catch{throw V4($)}}function xB($,Z){if(process.platform!=="win32")try{DB($,Z.uid,Z.gid)}catch{}p7($,Z.mode)}function gB($){if(process.platform==="win32")return;try{let Z=d7($,"r");try{l7(Z)}finally{W4(Z)}}catch{}}function vB($,Z,Q,z){if($.fd=d7($.path,"wx",z??Q?.mode??438),$.created=!0,MB($.fd,Z),Q)xB($.fd,Q);if(z!==void 0)p7($.fd,z);l7($.fd),W4($.fd),$.fd=void 0}function kB($){if($.fd!==void 0)try{W4($.fd)}catch{}if($.created)try{i7($.path)}catch{}}function hB($,Z,Q){let z=B2($),X={path:d2(z,`.${a0($).slice(0,100)}.${process.pid}.${PB(6).toString("hex")}.faf-tmp`),created:!1},U=yB($);try{if(U)f7($,m7.W_OK);vB(X,Z,U,Q.mode),D4($,Q.expect,U),_B(X.path,$)}catch(H){if(kB(X),H instanceof E)throw H;let J=t0(H)??(H instanceof Error?H.message:String(H));throw new s7($,`${$}: not written${U?"; original kept":""} (${J})`,{cause:H})}gB(z)}function uB($){return $ instanceof E&&!$.onWrite?new E($.reason,$.path,$.message,{onWrite:!0}):$}function a($,Z,Q={}){let z=G0($),X;try{X=h(Q.root??B2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(U){throw uB(U)}return hB(X,Z,Q),X}function o7($,Z,Q){let z=G0($),X=Q.root??B2(z),U=h(X,z),H=K0(U);if(Q.expect!==void 0)D4(U,Q.expect,void 0);if(H!==null&&Q.force!==!0&&!Q.owns(H))throw new E("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return a(U,Z,{root:X,expect:H})}function r2($,Z=$){let Q=G0($);c7(Q,{recursive:!0});let z=T0(Q),X=G0(Q,Z),U=K4(Q,X);if(U===".."||U.startsWith(`..${U8}`)||n7(U))throw new E("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let H=z;for(let J of U.split(/[\\/]/).filter(Boolean)){let G=d2(H,J);if(i2(G))throw new E("git",X,`${X} runs through ${G}, inside .git/ — refused.`,{onWrite:!0});H=fB(z,X,G)}return H}function fB($,Z,Q){let z;try{z=B4(Q)}catch(U){if(t0(U)!=="ENOENT")throw U;return c7(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=T0(Q)}catch{throw new E("dangling",Z,`${Q} is a link to ${r7(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!h$($,X))throw new E("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(i2(X))throw new E("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!c2(X).isDirectory())throw new E("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function mB($,Z){let Q=G0($),z=T0(G0(Z.root??B2(Q))),X=T0(B2(Q));if(!h$(z,X))throw new E("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let U=d2(X,a0(Q));if(i2(U))throw new E("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let H;try{H=B4(U)}catch(J){if(t0(J)==="ENOENT")return!1;throw J}if(!H.isFile())throw new E("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return D4(U,Z.expect,void 0),i7(U),!0}function u($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function u$($){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 H8($,Z){if($===null||$===void 0)return{};if(!u($))throw new E("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${u$($)}. `+"faf left it unchanged — fix it by hand.");return $}var Q9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function a7($){return typeof $==="object"&&$.collection===void 0}function pB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
143
+ `)||typeof $.value!=="number")return;let z=Z.find((U)=>U.default===!0&&U.test?.test(Q));if(!z||!Q9.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(r(X)?X.value:X,$.value)?Q:void 0}function lB($){let Z=$.filter(a7);return $.map((Q)=>{if(!a7(Q)||!Q9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,U,H,J)=>pB(X,Z)??z(X,U,H,J)}})}var J8={keepSourceTokens:!0,customTags:lB};function cB($,Z){let Q=/^( *)[^\s#-][^#]*?:[ \t]*(?:#.*)?$/.exec($),z=/^( *)(\S)/.exec(Z);if(!Q||!z||z[2]==="#")return{};let X=z[1].length-Q[1].length;if(z[2]==="-")return X>=0?{indentSeq:X>0}:{};return X>=1&&X<=8?{indent:X}:{}}function dB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let U=cB(Z[X],Z[X+1]);Q??=U.indent,z??=U.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function M4($,Z){let Q=l2($,J8);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 q2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function f$($,Z){return $.lastIndexOf(`
145
+ `,Z-1)+1}function z9($,Z){if(Z>0&&$[Z-1]===`
146
146
  `)return Z;let Q=$.indexOf(`
147
- `,Z);return Q<0?$.length:Q+1}function s7($,Z){let Q=Z;if($[Q-1]===`
148
- `){if(Q--,$[Q-1]==="\r")Q--}return Q}function L0($){return $!==null&&$!==void 0}function z0($){let Z=q0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function Z9($,Z){let Q=z0($),z=z0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function Q9($){if(r($))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 z9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&U8($,Z)}function X9($,Z,Q,z){let X=new Z8(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 L4($,Z,Q){return X9($,(z)=>{let X=new m2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function lB($,Z,Q){let z=X9($,()=>{let X=new g$;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 cB($){if(!q0($)||!L0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function dB($,Z){if(!q0($)||!q0(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 iB($,Z){let Q=z0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function nB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function o7($,Z,Q,z,X=!1){let H=z0(Z);if(!H||z.kind==="root")return null;let U=Z.comment,J=q0(Q)?Q.comment:void 0,V=!L0(U)||U===J,G=V?cB(Q):Q,Y=X?G:dB(Z,G),W=z.kind==="value"?L4($,Y,z.col):lB($,Y,z.col);return W?{range:H,keepTail:V,newComment:J,piece:W}:null}function rB($,Z,Q,z){if(!z)return s7($,$9($,Q[2]));return Q9(Z)?s7($,Q[1]):Q[1]}function f$($,Z,Q,z,X){let H=o7($,Z,Q,z);if(!H)return!1;let U=rB($.src,Z,H.range,H.keepTail);if(H.piece.inline&&(!Q9(Z)||z.kind==="item"))return sB($,H,U,z,X),!0;let J=H.keepTail?Z.comment:H.newComment;if(X!==void 0||L0(J))return!1;let V=z.kind==="value"?o7($,Z,Q,z,!0):H;return V!==null&&oB($,V.range[0],U,V.piece,z)}function sB($,Z,Q,z,X){let[H,U]=Z.range,V=H===U&&z.kind==="value"?nB($.src,H,Z.piece.text):Z.piece.text;B2($,H,Q,V+(X===void 0?"":` #${X}`))}function oB($,Z,Q,z,X){if(X.kind==="item")return B2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let H=iB($.src,X.key);if(H<0)return!1;return B2($,H,Q,z.inline?` ${z.text}`:z.text),!0}function aB($,Z){return U8({...$,comment:void 0},{...Z,comment:void 0})}function tB($,Z){if(L0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
- `)?void 0:Z.comment}function eB($,Z,Q,z){if(z9(Z,Q))return!0;if(!aB(Z,Q))return!1;let X=tB(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return f$($,Z,Q,z,X)}function $q($,Z,Q,z){if(!U8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return L4($,Z,0).text===L4($,Q,0).text||f$($,Z,Q,z);if(Q.items.length===0)return f$($,Z,Q,z);return p(Z)?Xq($,Z,Q):Uq($,Z,Q)}function M4($,Z,Q,z){if(!Z9(Z,Q))return f$($,Z,Q,z);if(r(Z))return eB($,Z,Q,z);if(x0(Z))return x0(Q)&&Z.source===Q.source&&U8(Z,Q)||f$($,Z,Q,z);if(!G2(Z)||!G2(Q))return!1;return $q($,Z,Q,z)}function H9($,Z){return Z-u$($,Z)}function P4($,Z,Q){let z=$.slice(u$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function I4($){return q0($)&&(L0($.commentBefore)||!!$.spaceBefore)}function N4($,Z,Q){let z=z0(Z)??z0(Q);return z?$9($.src,z[2]):-1}function U9($,Z,Q){let z=new Z8(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 Zq($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
- `);B2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function J9($,Z,Q,z,X,H){let U=Q;if(U<0){let J=z0(Z);if(!J||I4(Z)||!P4($.src,J[0],H))return!1;U=u$($.src,J[0])}return Zq($,U,U9($,z,X)),!0}function Qq($,Z,Q){let z=u$($,Q),X=Z,H=L0(X.commentBefore),U=!!X.spaceBefore;while(z>0){let J=u$($,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 V9($,Z,Q,z){let X=z0(Z);if(!X||!P4($.src,X[0],z))return!1;let H=N4($,Q,Z);if(H<0)return!1;return B2($,Qq($.src,Z,X[0]),H,""),!0}function G9($,Z){let Q=new Map,z=(X)=>{let H=z0(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&&Z9(Z($[U]),Z(X))?U:-1}}function zq($,Z){return r($)&&r(Z)?z9($,Z):$===Z}function Xq($,Z,Q){let z=Z.items[0]?.key,X=z0(z);if(!X)return!1;let H=H9($.src,X[0]),U=new Set,J=(W,B)=>{if(W.length===0)return!0;let K=new m2;K.items.push(...W);let L=B<0?-1:N4($,Z.items[B].value,Z.items[B].key);return J9($,z,L,K,H,!1)},V=G9(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)||!zq(Z.items[B].key,W.key))return!1;if(Y=[],!M4($,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)||Hq($,Z,B))}function Hq($,Z,Q){let z=Z.items[Q],X=z0(z.key);if(!X)return!1;if(P4($.src,X[0],!1))return V9($,z.key,z.value,!1);let H=Z.items[Q+1],U=z0(H?.key);if(Q!==0||!U||I4(z.key)||I4(H.key))return!1;return B2($,X[0],U[0],""),!0}function Uq($,Z,Q){let z=z0(Z);if(!z||Z.items.length===0)return!1;let X=H9($.src,z[0]),H=new Set,U=(Y,W)=>{if(Y.length===0)return!0;let B=new g$;B.items.push(...Y);let K=W<0?-1:N4($,Z.items[W]);return J9($,Z.items[0],K,B,X,!0)},J=G9(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=[],!M4($,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)||V9($,Y,Y,!0))}function Jq($,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 Vq($,Z,Q){if(!p(Q)&&!g0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
- `)?$.eol:"",X=Z.commentBefore?$.eol:"";return B2($,$.src.length,$.src.length,z+X+U9($,Q,0)),!0}function Gq($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!L0(z))return!L0(X)||Vq($,Z,X);return L0(X)&&M4($,z,X,{kind:"root"})}function Yq($,Z,Q,z,X){let H={src:$,eol:z,edits:[],piece:X};if(!Gq(H,Z,Q))return null;return Jq($,H.edits)}var a7=($)=>$.replace(/^[ \t]*\n/gm,"");function Wq($,Z,Q,z){let X=p2($,H8);if(X.errors.length>0||!l(X.toJS(),Z.toJS()))return!1;let H=X.toString(z);return H===Q||a7(H)===a7(Q)}function J8($,Z,Q="YAML"){let{text:z,changed:X}=Bq($,Z,Q);return{text:z,changed:X}}function Bq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),H=_4(X,Q),U=qq(H);Z(U);let J={text:$,changed:!1,spliced:!1};if(l(U.toJS(),H.toJS()))return J;let V={lineWidth:0,...pB(X)},G=U.toString(V);if(G===H.toString(V))return J;let Y=X.includes(`\r
147
+ `,Z);return Q<0?$.length:Q+1}function t7($,Z){let Q=Z;if($[Q-1]===`
148
+ `){if(Q--,$[Q-1]==="\r")Q--}return Q}function L0($){return $!==null&&$!==void 0}function z0($){let Z=q0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function X9($,Z){let Q=z0($),z=z0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function U9($){if(r($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return Y2($)&&!$.flow}function G8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function H9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&G8($,Z)}function J9($,Z,Q,z){let X=new z8(void 0,J8);X.contents=Z(X);let H=X.toString($.piece).replace(/\n+$/,"").slice(Q),J=H.startsWith(" ")&&!H.includes(`
149
+ `),G=" ".repeat(z),V=H.replace(/\n(?=.)/g,`
150
+ ${G}`).replace(/\n/g,$.eol);return{inline:J,text:J?H.slice(1):V}}function I4($,Z,Q){return J9($,(z)=>{let X=new p2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function iB($,Z,Q){let z=J9($,()=>{let X=new v$;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 nB($){if(!q0($)||!L0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function rB($,Z){if(!q0($)||!q0(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 sB($,Z){let Q=z0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function oB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function e7($,Z,Q,z,X=!1){let U=z0(Z);if(!U||z.kind==="root")return null;let H=Z.comment,J=q0(Q)?Q.comment:void 0,G=!L0(H)||H===J,V=G?nB(Q):Q,Y=X?V:rB(Z,V),W=z.kind==="value"?I4($,Y,z.col):iB($,Y,z.col);return W?{range:U,keepTail:G,newComment:J,piece:W}:null}function aB($,Z,Q,z){if(!z)return t7($,z9($,Q[2]));return U9(Z)?t7($,Q[1]):Q[1]}function m$($,Z,Q,z,X){let U=e7($,Z,Q,z);if(!U)return!1;let H=aB($.src,Z,U.range,U.keepTail);if(U.piece.inline&&(!U9(Z)||z.kind==="item"))return tB($,U,H,z,X),!0;let J=U.keepTail?Z.comment:U.newComment;if(X!==void 0||L0(J))return!1;let G=z.kind==="value"?e7($,Z,Q,z,!0):U;return G!==null&&eB($,G.range[0],H,G.piece,z)}function tB($,Z,Q,z,X){let[U,H]=Z.range,G=U===H&&z.kind==="value"?oB($.src,U,Z.piece.text):Z.piece.text;q2($,U,Q,G+(X===void 0?"":` #${X}`))}function eB($,Z,Q,z,X){if(X.kind==="item")return q2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let U=sB($.src,X.key);if(U<0)return!1;return q2($,U,Q,z.inline?` ${z.text}`:z.text),!0}function $q($,Z){return G8({...$,comment:void 0},{...Z,comment:void 0})}function Zq($,Z){if(L0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
151
+ `)?void 0:Z.comment}function Qq($,Z,Q,z){if(H9(Z,Q))return!0;if(!$q(Z,Q))return!1;let X=Zq(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return m$($,Z,Q,z,X)}function zq($,Z,Q,z){if(!G8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return I4($,Z,0).text===I4($,Q,0).text||m$($,Z,Q,z);if(Q.items.length===0)return m$($,Z,Q,z);return p(Z)?Jq($,Z,Q):Vq($,Z,Q)}function P4($,Z,Q,z){if(!X9(Z,Q))return m$($,Z,Q,z);if(r(Z))return Qq($,Z,Q,z);if(x0(Z))return x0(Q)&&Z.source===Q.source&&G8(Z,Q)||m$($,Z,Q,z);if(!Y2(Z)||!Y2(Q))return!1;return zq($,Z,Q,z)}function G9($,Z){return Z-f$($,Z)}function N4($,Z,Q){let z=$.slice(f$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function O4($){return q0($)&&(L0($.commentBefore)||!!$.spaceBefore)}function R4($,Z,Q){let z=z0(Z)??z0(Q);return z?z9($.src,z[2]):-1}function V9($,Z,Q){let z=new z8(void 0,J8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
152
+ `).map((H)=>H?X+H:H).join($.eol)+$.eol}function Xq($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
153
+ `);q2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function Y9($,Z,Q,z,X,U){let H=Q;if(H<0){let J=z0(Z);if(!J||O4(Z)||!N4($.src,J[0],U))return!1;H=f$($.src,J[0])}return Xq($,H,V9($,z,X)),!0}function Uq($,Z,Q){let z=f$($,Q),X=Z,U=L0(X.commentBefore),H=!!X.spaceBefore;while(z>0){let J=f$($,z-1),G=$.slice(J,z).trim();if(U&&G.startsWith("#"))z=J;else if(H&&G==="")z=J,H=!1;else break}return z}function W9($,Z,Q,z){let X=z0(Z);if(!X||!N4($.src,X[0],z))return!1;let U=R4($,Q,Z);if(U<0)return!1;return q2($,Uq($.src,Z,X[0]),U,""),!0}function B9($,Z){let Q=new Map,z=(X)=>{let U=z0(X);return U?U.join(":"):void 0};return $.forEach((X,U)=>{let H=z(Z(X));if(H!==void 0&&!Q.has(H))Q.set(H,U)}),(X)=>{let U=z(Z(X)),H=U===void 0?void 0:Q.get(U);return H!==void 0&&X9(Z($[H]),Z(X))?H:-1}}function Hq($,Z){return r($)&&r(Z)?H9($,Z):$===Z}function Jq($,Z,Q){let z=Z.items[0]?.key,X=z0(z);if(!X)return!1;let U=G9($.src,X[0]),H=new Set,J=(W,B)=>{if(W.length===0)return!0;let K=new p2;K.items.push(...W);let L=B<0?-1:R4($,Z.items[B].value,Z.items[B].key);return Y9($,z,L,K,U,!1)},G=B9(Z.items,(W)=>W.key),V=-1,Y=[];for(let W of Q.items){let B=G(W);if(B<0){Y.push(W);continue}if(B<=V||!J(Y,V)||!Hq(Z.items[B].key,W.key))return!1;if(Y=[],!P4($,Z.items[B].value,W.value,{kind:"value",key:Z.items[B].key,col:U}))return!1;H.add(B),V=B}if(!J(Y,V))return!1;return Z.items.every((W,B)=>H.has(B)||Gq($,Z,B))}function Gq($,Z,Q){let z=Z.items[Q],X=z0(z.key);if(!X)return!1;if(N4($.src,X[0],!1))return W9($,z.key,z.value,!1);let U=Z.items[Q+1],H=z0(U?.key);if(Q!==0||!H||O4(z.key)||O4(U.key))return!1;return q2($,X[0],H[0],""),!0}function Vq($,Z,Q){let z=z0(Z);if(!z||Z.items.length===0)return!1;let X=G9($.src,z[0]),U=new Set,H=(Y,W)=>{if(Y.length===0)return!0;let B=new v$;B.items.push(...Y);let K=W<0?-1:R4($,Z.items[W]);return Y9($,Z.items[0],K,B,X,!0)},J=B9(Z.items,(Y)=>Y),G=-1,V=[];for(let Y of Q.items){let W=J(Y);if(W<0){V.push(Y);continue}if(W<=G||!H(V,G))return!1;if(V=[],!P4($,Z.items[W],Y,{kind:"item",col:X}))return!1;U.add(W),G=W}if(!H(V,G))return!1;return Z.items.every((Y,W)=>U.has(W)||W9($,Y,Y,!0))}function Yq($,Z){let Q=[...Z].sort((U,H)=>H.start-U.start||H.end-U.end||H.seq-U.seq),z=$,X=1/0;for(let U of Q){if(U.end>X)return null;z=z.slice(0,U.start)+U.text+z.slice(U.end),X=U.start}return z}function Wq($,Z,Q){if(!p(Q)&&!g0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
154
+ `)?$.eol:"",X=Z.commentBefore?$.eol:"";return q2($,$.src.length,$.src.length,z+X+V9($,Q,0)),!0}function Bq($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!L0(z))return!L0(X)||Wq($,Z,X);return L0(X)&&P4($,z,X,{kind:"root"})}function qq($,Z,Q,z,X){let U={src:$,eol:z,edits:[],piece:X};if(!Bq(U,Z,Q))return null;return Yq($,U.edits)}var $9=($)=>$.replace(/^[ \t]*\n/gm,"");function Kq($,Z,Q,z){let X=l2($,J8);if(X.errors.length>0||!l(X.toJS(),Z.toJS()))return!1;let U=X.toString(z);return U===Q||$9(U)===$9(Q)}function V8($,Z,Q="YAML"){let{text:z,changed:X}=Dq($,Z,Q);return{text:z,changed:X}}function Dq($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),U=M4(X,Q),H=Lq(U);Z(H);let J={text:$,changed:!1,spliced:!1};if(l(H.toJS(),U.toJS()))return J;let G={lineWidth:0,...dB(X)},V=H.toString(G);if(V===U.toString(G))return J;let Y=X.includes(`\r
155
155
  `)?`\r
156
156
  `:`
157
- `,W=Yq(X,H,U,Y,{...V,verifyAliasOrder:!1}),B=W!==null&&Wq(W,U,G,V),K=B&&W!==null?W:G.replace(/\r?\n/g,Y);return{text:z+K,changed:z+K!==$,spliced:B}}function qq($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function l($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>l(Q,Z[z]));if(u($)&&u(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&l($[z],Z[z]))}return!1}function p$($){let Z=r($.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)=>p$(Q)===Z)}function Y9($,Z){return q0(Z)?Z.toJS($):Z}function Kq($,Z,Q,z){return z.keepAliases===!0&&x0(Z)||l(Y9($,Z),Q)}function V8($,Z,Q,z={}){if(Kq($,Z,Q,z))return Z;if(u(Q)&&p(Z))return Lq($,Z,Q,z),Z;if(Array.isArray(Q)&&g0(Z))return _q($,Z,Q,z),Z;if(!u(Q)&&!Array.isArray(Q)&&r(Z))return Z.value=Q,Z;return Dq(Z,$.createNode(Q))}function Dq($,Z){if(!r($)&&!x0($))return Z;let Q=$,z=Z;if(G2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=D4(z.commentBefore,Q.commentBefore,Q.comment),Z;if(G2(Z))Z.flow=!0;return z.comment=D4(z.comment??Q.comment),z.commentBefore=D4(z.commentBefore??Q.commentBefore),Z}function D4(...$){let Z=$.filter(L0);return Z.length>0?Z.join(`
158
- `):void 0}function Lq($,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=p$(X);return H===void 0||Q[H]!==void 0})}function R4($,Z,Q,z){let X=u(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)&&l(X[H],U))continue;else if(u(U)&&u(X[H])&&p(J.value))R4($,J.value,X[H],U);else J.value=V8($,J.value,U,{keepAliases:!0})}}function m$($,Z,Q){if(x0($))Q.push({path:[...Z],node:$});else if(p($))for(let z of $.items){let X=p$(z);if(X!==void 0)m$(z.value,[...Z,X],Q)}else if(g0($))$.items.forEach((z,X)=>m$(z,[...Z,X],Q))}function t7($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(u(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function W9($,Z,Q){let z=[];return m$($.contents,[],z),z.filter(({path:X,node:H})=>{let U=t7(Z,X);return U!==void 0&&!l(t7(Q,X),U)&&!l(H.toJS($),U)}).map(({path:X,node:H})=>({path:X.join("."),alias:`*${H.source}`}))}function B9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=Iq(Q,Z[X]);let z=Z[Z.length-1];if(p(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)=>z0(H)===void 0?(X.items[z]=U,!0):!1}}return null}function Iq($,Z){if(p($)&&typeof Z==="string")return e0($,Z)?.value;if(g0($)&&typeof Z==="number")return $.items[Z];return}function q9($,Z){let Q=[];m$($.contents,[],Q);let z=[];for(let{path:X,node:H}of Q){let U=B9(Z,X);if(!U||x0(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 O4($,Z,Q,z){if(!q0($)||x0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(p($))for(let H of $.items){let U=p$(H);if(U!==void 0)O4(H.value,[...Z,U],Q,z)}else if(g0($))$.items.forEach((H,U)=>O4(H,[...Z,U],Q,z))}function K9($,Z){let Q=[];m$($.contents,[],Q);let z=new Set(Q.map((U)=>U.node.source));if(z.size===0)return[];let X=[];O4($.contents,[],z,X);let H=[];for(let{path:U,node:J}of X){let V=B9(Z,U);if(!V)continue;let G=J.anchor;if(q0(V.node)&&V.node.anchor===G&&l(J.toJS($),V.node.toJS(Z))||!V.put(J.clone()))continue;H.push({path:U.join("."),alias:`&${G}`,kind:"anchor"})}return H}function Oq($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let U=Q-1;U>=0;U--)for(let J=z-1;J>=0;J--)X[U][J]=l($[U],Z[J])?X[U+1][J+1]+1:Math.max(X[U+1][J],X[U][J+1]);let H=[];for(let U=0,J=0;U<Q&&J<z;)if(l($[U],Z[J]))H.push([U,J]),U++,J++;else if(X[U+1][J]>=X[U][J+1])U++;else J++;return H}function _q($,Z,Q,z){let X=Z.items,H=X.map((G)=>Y9($,G)),U=[],J=0,V=0;for(let[G,Y]of[...Oq(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 l$($,Z,Q,z){if(l(Q,z))return Z;if(!u(Q)||!u(z)||!p(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=p$(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(!l(Q[H],U))J.value=l$($,J.value,Q[H],U)}return Z}function D9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new m2,z=$.contents;if(!p(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let H of Z){let U=e0(X,H);if(U&&p(U.value)){X=U.value;continue}if(U&&!O9(U.value))throw Error(`${Q}: ${H} is not a mapping — faf left it unchanged.`);let J=new m2;if(U)U.value=I9(U.value,J);else X.items.push($.createPair(H,J));X=J}return X}function G8($,Z,Q,z,X){if(l(Q,z))return;let H=D9($,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=l$($,J.value,Q,z)}function L9($,Z,Q){let z=D9($,Z.slice(0,-1),Q),X=Z[Z.length-1],H=e0(z,X);if(H&&g0(H.value))return H.value;if(H&&!O9(H.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let U=new g$;if(H)H.value=I9(H.value,U);else z.items.push($.createPair(X,U));return U}function I9($,Z){if(!r($))return Z;let Q=[$.commentBefore,$.comment].filter(L0);if(Q.length>0)Z.commentBefore=Q.join(`
159
- `);return Z}function O9($){if($===null||$===void 0)return!0;return r($)&&($.value===null||$.value===void 0)}var F4=new WeakMap;function c$($){return typeof $==="object"&&$!==null?F4.get($):void 0}function Y8($,Z){F4.set($,Z)}function _9($,Z){let Q=c$($);if(Q)F4.set(Z,Q);return Z}var M9=new WeakSet;function P9($){return M9.add($),$}function N9($){return typeof $==="object"&&$!==null&&M9.has($)}function W8($){let Z=d$($);return h(T4(Z),Z,{read:!0})}function C9($){if($ instanceof Q8)return $;let Z=$?.cause;return Z instanceof Q8?Z:null}function j9($,Z){let Q=Z.message.split(`
160
- `)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=d$($);return new E("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function Mq($){let Z=W8($),Q=$0(Z),z;try{z=v0(Q)}catch(H){let U=C9(H);if(U)throw j9($,U);throw H}let X=X8(z,$);return Y8(X,{real:Z,text:Q}),X}function w9($){let Z=$._meta,Q={...$};delete Q._meta;let z=Y2(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 Pq($,Z){return S9($,Z,void 0)}function S9($,Z,Q,z,X=!1){let H=W8($),U=$0(H),J=[],V;try{V=J8(U,(G)=>{E9(G,$);let Y=G.clone();if(Z(G),J=q9(Y,G),X)J=[...J,...K9(Y,G)];if(z)J=[...J,...z(G,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(G){let Y=C9(G);if(Y)throw j9($,Y);throw G}if(!V.changed)return{written:!1,text:U,keptAliases:J};return a($,V.text,{expect:Q&&Q.real===H?Q.text:U}),{written:!0,text:V.text,keptAliases:J}}function F9($){try{return A9($),!0}catch{return!1}}function Nq($){let Z=$.getIn(["project","type"],!0);return r(Z)?Z.value:Z}function E9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!p(Q))throw new E("not-yaml",d$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${h$($.toJS())}. faf left it unchanged — fix it by hand.`)}function Rq($,Z,Q){E9($,Q);let z=$.contents,X=p(z)&&z.items.some((Y)=>r(Y.key)&&Y.key.value==="_meta"),{_meta:H,...U}=Z,J=Nq($),V=p(z)?$.toJS():{},G=p(z)?z:$.createNode({});if($.contents=G,R4($,G,V,X?{...Z}:U),!X)Tq($,H?.found,J)}function Fq($,Z){let Q=$.contents;if(p(Q)&&Q.items.some((H)=>r(H.key)&&H.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function Tq($,Z,Q){if(!Z||Z.length===0||!s(Q))return;let z=$.getIn(["project","type"],!0);if(r(z)&&!s(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function Aq($,Z,Q={}){if(!Q.replace&&F9($)){let J=S9($,(V)=>Rq(V,Z,$),c$(Z),(V,G)=>W9(V,Fq(V,Z),G),N9(Z));Y8(Z,{real:W8($),text:J.text});for(let V of J.keptAliases??[])Q.onAliasKept?.(V);return J.written}let z=d$($),X=w9(Z),H=F9($)?K0(h(T4(z),z)):null,U=a($,X,{expect:H});return Y8(Z,{real:U,text:X}),!0}function b9($){return $0(W8($))}function T9($,Z){let Q;try{Q=A9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return h($,d$(Z),{read:!0}),!0}function y9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=R9($,z);if(T9($,X))return X}let Q=T4($);if(Q!==$)for(let z of Z){let X=R9(Q,z);if(T9(Q,X))return X}return null}import{statSync as x9}from"fs";import{homedir as Cq}from"os";import{parse as jq,resolve as g9}from"path";function v9($,Z){try{let Q=x9($,{bigint:!0}),z=x9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function wq($){let Z=g9($),Q=g9(Cq()),z=jq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(v9(Z,Q))return"home";if(v9(Z,z))return"root";return null}function Sq($=process.cwd()){return wq($)!==null}import{existsSync as Eq,statSync as k9}from"fs";import{dirname as bq,join as yq}from"path";var xq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],gq=1000;function vq($,Z=bq($)){let Q=k9($).mtimeMs,z=xq.map((X)=>{let H=yq(Z,X);if(!Eq(H))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let U=k9(H).mtimeMs,J=U-Q,V;if(Math.abs(J)<gq)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 QK}from"path";import{deprecate as zK}from"node:util";import{createHash as pq}from"crypto";import{resolve as lq}from"path";class q2 extends Error{constructor($){super($);this.name="JsonEditError"}}var kq=new Set([" ","\t",`
161
- `,"\r"]);class j4{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 q2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&kq.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 A4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function C4($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>C4(Q,Z[z]));if(A4($)&&A4(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&C4($[z],Z[z]))}return!1}class h9{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
157
+ `,W=qq(X,U,H,Y,{...G,verifyAliasOrder:!1}),B=W!==null&&Kq(W,H,V,G),K=B&&W!==null?W:V.replace(/\r?\n/g,Y);return{text:z+K,changed:z+K!==$,spliced:B}}function Lq($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function l($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>l(Q,Z[z]));if(u($)&&u(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&l($[z],Z[z]))}return!1}function l$($){let Z=r($.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)=>l$(Q)===Z)}function q9($,Z){return q0(Z)?Z.toJS($):Z}function Iq($,Z,Q,z){return z.keepAliases===!0&&x0(Z)||l(q9($,Z),Q)}function Y8($,Z,Q,z={}){if(Iq($,Z,Q,z))return Z;if(u(Q)&&p(Z))return _q($,Z,Q,z),Z;if(Array.isArray(Q)&&g0(Z))return Nq($,Z,Q,z),Z;if(!u(Q)&&!Array.isArray(Q)&&r(Z))return Z.value=Q,Z;return Oq(Z,$.createNode(Q))}function Oq($,Z){if(!r($)&&!x0($))return Z;let Q=$,z=Z;if(Y2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=L4(z.commentBefore,Q.commentBefore,Q.comment),Z;if(Y2(Z))Z.flow=!0;return z.comment=L4(z.comment??Q.comment),z.commentBefore=L4(z.commentBefore??Q.commentBefore),Z}function L4(...$){let Z=$.filter(L0);return Z.length>0?Z.join(`
158
+ `):void 0}function _q($,Z,Q,z={}){for(let[X,U]of Object.entries(Q)){if(U===void 0)continue;let H=e0(Z,X);if(H)H.value=Y8($,H.value,U,z);else Z.items.push($.createPair(X,U))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let U=l$(X);return U===void 0||Q[U]!==void 0})}function F4($,Z,Q,z){let X=u(Q)?Q:{};for(let[U,H]of Object.entries(z)){if(H===void 0)continue;let J=e0(Z,U);if(!J)Z.items.push($.createPair(U,H));else if(Object.prototype.hasOwnProperty.call(X,U)&&l(X[U],H))continue;else if(u(H)&&u(X[U])&&p(J.value))F4($,J.value,X[U],H);else J.value=Y8($,J.value,H,{keepAliases:!0})}}function p$($,Z,Q){if(x0($))Q.push({path:[...Z],node:$});else if(p($))for(let z of $.items){let X=l$(z);if(X!==void 0)p$(z.value,[...Z,X],Q)}else if(g0($))$.items.forEach((z,X)=>p$(z,[...Z,X],Q))}function Z9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(u(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function K9($,Z,Q){let z=[];return p$($.contents,[],z),z.filter(({path:X,node:U})=>{let H=Z9(Z,X);return H!==void 0&&!l(Z9(Q,X),H)&&!l(U.toJS($),H)}).map(({path:X,node:U})=>({path:X.join("."),alias:`*${U.source}`}))}function D9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=Mq(Q,Z[X]);let z=Z[Z.length-1];if(p(Q)&&typeof z==="string"){let X=e0(Q,z);return X?{node:X.value,put:(U)=>(X.value=U,!0)}:null}if(g0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,U=X.items[z];return{node:U,put:(H)=>z0(U)===void 0?(X.items[z]=H,!0):!1}}return null}function Mq($,Z){if(p($)&&typeof Z==="string")return e0($,Z)?.value;if(g0($)&&typeof Z==="number")return $.items[Z];return}function L9($,Z){let Q=[];p$($.contents,[],Q);let z=[];for(let{path:X,node:U}of Q){let H=D9(Z,X);if(!H||x0(H.node)&&H.node.source===U.source)continue;if(!H.put(U.clone()))continue;z.push({path:X.join("."),alias:`*${U.source}`})}return z}function _4($,Z,Q,z){if(!q0($)||x0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(p($))for(let U of $.items){let H=l$(U);if(H!==void 0)_4(U.value,[...Z,H],Q,z)}else if(g0($))$.items.forEach((U,H)=>_4(U,[...Z,H],Q,z))}function I9($,Z){let Q=[];p$($.contents,[],Q);let z=new Set(Q.map((H)=>H.node.source));if(z.size===0)return[];let X=[];_4($.contents,[],z,X);let U=[];for(let{path:H,node:J}of X){let G=D9(Z,H);if(!G)continue;let V=J.anchor;if(q0(G.node)&&G.node.anchor===V&&l(J.toJS($),G.node.toJS(Z))||!G.put(J.clone()))continue;U.push({path:H.join("."),alias:`&${V}`,kind:"anchor"})}return U}function Pq($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let H=Q-1;H>=0;H--)for(let J=z-1;J>=0;J--)X[H][J]=l($[H],Z[J])?X[H+1][J+1]+1:Math.max(X[H+1][J],X[H][J+1]);let U=[];for(let H=0,J=0;H<Q&&J<z;)if(l($[H],Z[J]))U.push([H,J]),H++,J++;else if(X[H+1][J]>=X[H][J+1])H++;else J++;return U}function Nq($,Z,Q,z){let X=Z.items,U=X.map((V)=>q9($,V)),H=[],J=0,G=0;for(let[V,Y]of[...Pq(U,Q),[X.length,Q.length]]){for(;J<V&&G<Y;J++,G++)H.push(Y8($,X[J],Q[G],z));for(;G<Y;G++)H.push($.createNode(Q[G]));if(V<X.length)H.push(X[V]);J=V+1,G=Y+1}Z.items=H}function c$($,Z,Q,z){if(l(Q,z))return Z;if(!u(Q)||!u(z)||!p(Z))return Y8($,Z,z);let X=new Set(Object.keys(Q).filter((U)=>!(U in z)||z[U]===void 0));Z.items=Z.items.filter((U)=>{let H=l$(U);return H===void 0||!X.has(H)});for(let[U,H]of Object.entries(z)){if(H===void 0)continue;let J=e0(Z,U);if(!J)Z.items.push($.createPair(U,H));else if(!l(Q[U],H))J.value=c$($,J.value,Q[U],H)}return Z}function O9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new p2,z=$.contents;if(!p(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let U of Z){let H=e0(X,U);if(H&&p(H.value)){X=H.value;continue}if(H&&!P9(H.value))throw Error(`${Q}: ${U} is not a mapping — faf left it unchanged.`);let J=new p2;if(H)H.value=M9(H.value,J);else X.items.push($.createPair(U,J));X=J}return X}function W8($,Z,Q,z,X){if(l(Q,z))return;let U=O9($,Z.slice(0,-1),X),H=Z[Z.length-1],J=e0(U,H);if(z===void 0)U.items=U.items.filter((G)=>G!==J);else if(!J)U.items.push($.createPair(H,z));else J.value=c$($,J.value,Q,z)}function _9($,Z,Q){let z=O9($,Z.slice(0,-1),Q),X=Z[Z.length-1],U=e0(z,X);if(U&&g0(U.value))return U.value;if(U&&!P9(U.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let H=new v$;if(U)U.value=M9(U.value,H);else z.items.push($.createPair(X,H));return H}function M9($,Z){if(!r($))return Z;let Q=[$.commentBefore,$.comment].filter(L0);if(Q.length>0)Z.commentBefore=Q.join(`
159
+ `);return Z}function P9($){if($===null||$===void 0)return!0;return r($)&&($.value===null||$.value===void 0)}var T4=new WeakMap;function d$($){return typeof $==="object"&&$!==null?T4.get($):void 0}function B8($,Z){T4.set($,Z)}function N9($,Z){let Q=d$($);if(Q)T4.set(Z,Q);return Z}var R9=new WeakSet;function F9($){return R9.add($),$}function T9($){return typeof $==="object"&&$!==null&&R9.has($)}function q8($){let Z=i$($);return h(A4(Z),Z,{read:!0})}function S9($){if($ instanceof X8)return $;let Z=$?.cause;return Z instanceof X8?Z:null}function E9($,Z){let Q=Z.message.split(`
160
+ `)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=i$($);return new E("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function Rq($){let Z=q8($),Q=$0(Z),z;try{z=v0(Q)}catch(U){let H=S9(U);if(H)throw E9($,H);throw U}let X=H8(z,$);return B8(X,{real:Z,text:Q}),X}function b9($){let Z=$._meta,Q={...$};delete Q._meta;let z=W2(Q,{lineWidth:0});if(Z?.found&&Z.found.length>0){let X=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(U,H,J)=>{if(J.includes("#"))return U;return`${H} # found: ${X}`})}return z}function Fq($,Z){return y9($,Z,void 0)}function y9($,Z,Q,z,X=!1){let U=q8($),H=$0(U),J=[],G;try{G=V8(H,(V)=>{x9(V,$);let Y=V.clone();if(Z(V),J=L9(Y,V),X)J=[...J,...I9(Y,V)];if(z)J=[...J,...z(V,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(V){let Y=S9(V);if(Y)throw E9($,Y);throw V}if(!G.changed)return{written:!1,text:H,keptAliases:J};return a($,G.text,{expect:Q&&Q.real===U?Q.text:H}),{written:!0,text:G.text,keptAliases:J}}function C9($){try{return w9($),!0}catch{return!1}}function Tq($){let Z=$.getIn(["project","type"],!0);return r(Z)?Z.value:Z}function x9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!p(Q))throw new E("not-yaml",i$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${u$($.toJS())}. faf left it unchanged — fix it by hand.`)}function Aq($,Z,Q){x9($,Q);let z=$.contents,X=p(z)&&z.items.some((Y)=>r(Y.key)&&Y.key.value==="_meta"),{_meta:U,...H}=Z,J=Tq($),G=p(z)?$.toJS():{},V=p(z)?z:$.createNode({});if($.contents=V,F4($,V,G,X?{...Z}:H),!X)jq($,U?.found,J)}function Cq($,Z){let Q=$.contents;if(p(Q)&&Q.items.some((U)=>r(U.key)&&U.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function jq($,Z,Q){if(!Z||Z.length===0||!s(Q))return;let z=$.getIn(["project","type"],!0);if(r(z)&&!s(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function wq($,Z,Q={}){if(!Q.replace&&C9($)){let J=y9($,(G)=>Aq(G,Z,$),d$(Z),(G,V)=>K9(G,Cq(G,Z),V),T9(Z));B8(Z,{real:q8($),text:J.text});for(let G of J.keptAliases??[])Q.onAliasKept?.(G);return J.written}let z=i$($),X=b9(Z),U=C9($)?K0(h(A4(z),z)):null,H=a($,X,{expect:U});return B8(Z,{real:H,text:X}),!0}function g9($){return $0(q8($))}function j9($,Z){let Q;try{Q=w9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return h($,i$(Z),{read:!0}),!0}function v9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=A9($,z);if(j9($,X))return X}let Q=A4($);if(Q!==$)for(let z of Z){let X=A9(Q,z);if(j9(Q,X))return X}return null}import{statSync as k9}from"fs";import{homedir as Sq}from"os";import{parse as Eq,resolve as h9}from"path";function u9($,Z){try{let Q=k9($,{bigint:!0}),z=k9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function bq($){let Z=h9($),Q=h9(Sq()),z=Eq(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 yq($=process.cwd()){return bq($)!==null}import{existsSync as xq,statSync as f9}from"fs";import{dirname as gq,join as vq}from"path";var kq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],hq=1000;function uq($,Z=gq($)){let Q=f9($).mtimeMs,z=kq.map((X)=>{let U=vq(Z,X);if(!xq(U))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let H=f9(U).mtimeMs,J=H-Q,G;if(Math.abs(J)<hq)G="in-sync";else if(J>0)G="newer";else G="older";return{file:X,exists:!0,mtime_ms:H,status:G,delta_ms:J}});return{source:$,source_mtime_ms:Q,targets:z,drifted:z.filter((X)=>X.status==="newer"||X.status==="older").length,in_sync:z.filter((X)=>X.status==="in-sync").length,missing:z.filter((X)=>X.status==="missing").length}}import{join as UK}from"path";import{deprecate as HK}from"node:util";import{createHash as dq}from"crypto";import{resolve as iq}from"path";class K2 extends Error{constructor($){super($);this.name="JsonEditError"}}var fq=new Set([" ","\t",`
161
+ `,"\r"]);class w4{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 K2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&fq.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 C4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function j4($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>j4(Q,Z[z]));if(C4($)&&C4(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&j4($[z],Z[z]))}return!1}class m9{s;style;after;edits=[];constructor($,Z,Q){this.s=$;this.style=Z;this.after=Q}startsLine($){let Z=this.s.lastIndexOf(`
162
162
  `,$-1);return Z>=0&&/^[ \t]*$/.test(this.s.slice(Z+1,$))}indentOf($){return this.startsLine($)?this.s.slice(this.s.lastIndexOf(`
163
163
  `,$-1)+1,$):""}render($,Z,Q){if(!Q)return JSON.stringify($);return JSON.stringify($,null,this.style.unit).split(`
164
- `).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[H,U]of Object.entries(Z)){if(U===void 0)continue;let J=Q?`${Q}.${H}`:H,V=$.members.filter((B)=>B.key===H);if(V.length>1)throw new q2(`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(A4(U)){if(G.value.kind!=="object")throw new q2(`"${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(C4(W,U))continue;if(G.value.kind==="object"||G.value.kind==="array")throw new q2(`"${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),K=this.s.slice(W.keyEnd,W.value.start),L=this.s.lastIndexOf(`
166
- `,W.keyStart-1),q=L>0&&this.s[L-1]==="\r"?L-1:L,D=`${this.style.eol}${B}${JSON.stringify(Z)}${K}${this.render(Q,B,!0)},`;this.edits.push({start:q,end:q,text:D});return}let 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 hq($,Z){let Q=$.includes(`\r
164
+ `).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[U,H]of Object.entries(Z)){if(H===void 0)continue;let J=Q?`${Q}.${U}`:U,G=$.members.filter((B)=>B.key===U);if(G.length>1)throw new K2(`the key "${J}" is there more than once`);let V=G[0];if(!V){if($.members.length===0)X[U]=H;else this.insert($,U,H,Q);continue}let Y=this.startsLine(V.keyStart);if(C4(H)){if(V.value.kind!=="object")throw new K2(`"${J}" is not an object, so faf cannot add its keys to it`);this.apply(V.value,H,J,Y||this.s.slice(V.value.start,V.value.end).includes(`
165
+ `));continue}let W=JSON.parse(this.s.slice(V.value.start,V.value.end));if(j4(W,H))continue;if(V.value.kind==="object"||V.value.kind==="array")throw new K2(`"${J}" is ${V.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:V.value.start,end:V.value.end,text:this.render(H,this.indentOf(V.keyStart),Y)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,U=X[X.length-1],J=(this.after[z]?.[Z]??[]).map((W)=>X.find((B)=>B.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=J&&J!==U?X[X.indexOf(J)+1]:U,B=this.indentOf(W.keyStart),K=this.s.slice(W.keyEnd,W.value.start),L=this.s.lastIndexOf(`
166
+ `,W.keyStart-1),q=L>0&&this.s[L-1]==="\r"?L-1:L,D=`${this.style.eol}${B}${JSON.stringify(Z)}${K}${this.render(Q,B,!0)},`;this.edits.push({start:q,end:q,text:D});return}let G=J??U,V=this.s.slice(G.keyEnd,G.value.start),Y=X.length>1?this.s.slice(X[0].value.end,X[1].keyStart):", ";this.edits.push({start:G.value.end,end:G.value.end,text:`${Y}${JSON.stringify(Z)}${V}${this.render(Q,"",!1)}`})}append($,Z,Q,z){if(Z.length===0)return;if($.items.length===0){this.edits.push({start:$.start,end:$.end,text:this.render(Z,this.indentOf(Q),z)});return}let X=$.items[$.items.length-1];if(this.startsLine($.items[0].start)){let H=this.indentOf($.items[0].start),J=Z.map((G)=>`,${this.style.eol}${H}${this.render(G,H,!0)}`).join("");this.edits.push({start:X.end,end:X.end,text:J});return}let U=$.items.length>1?this.s.slice($.items[0].end,$.items[1].start):", ";this.edits.push({start:X.end,end:X.end,text:Z.map((H)=>`${U}${this.render(H,"",!1)}`).join("")})}lineLead($){let Z=this.s.lastIndexOf(`
167
+ `,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function mq($,Z){let Q=$.includes(`\r
168
168
  `)?`\r
169
169
  `:`
170
170
  `,z=Z.members[0],X=z?$.lastIndexOf(`
171
- `,z.keyStart-1):-1,H=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(H)?H:" "}}function B8($,Z,Q={}){let z=new j4($).parse();if(z.kind!=="object")throw new q2("the JSON is not an object");let X=new h9($,hq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
- `)),u9($,X.edits)}function u9($,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 uq($){let Z=new j4($).parse();if(Z.kind!=="object")throw new q2("the JSON is not an object");return Z}function fq($,Z){let Q=$.lastIndexOf(`
173
- `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function mq($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(fq($,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 f9($,Z){let Q=[],z=uq($);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 m9($,Z){let{count:Q,chain:z}=f9($,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 w4($,Z,Q={}){let{count:z,chain:X}=f9($,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 u9($,[mq($,H.obj,H.member)]).text}var l9="one.faf/render";function E4($){return`sha256:${pq("sha256").update($,"utf8").digest("hex")}`}var cq=/^sha256:[0-9a-f]{64}$/,dq=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,iq='<meta name="faf-render"',nq='<meta name="description" content="Visual render of project.faf.';function rq($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(nq));return Z.splice(Q+1,0,`<meta name="faf-render" content="${E4($)}">
175
- `),Z.join("")}function c9($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,H)=>{let U=X.replace(/\r?\n$/,""),J=dq.exec(U);if(J)Q.push({at:H,hash:J[1]});else if(U.startsWith(iq))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 S4=["_meta",l9];function sq($){return B8($,{_meta:{[l9]:E4($)}}).text}function oq($){try{return w4($,S4,{dropEmptyParent:!0})??$}catch{return $}}function aq($){let Z;try{Z=m9($,S4)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!cq.test(Z.value))return"many";let Q=w4($,S4,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function d9($,Z){return $==="html"?rq(Z):sq(Z)}function tq($,Z){if($==="json")return oq(Z);let Q=c9(Z);return Q===null||Q==="many"?Z:Q.canonical}function p9($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?c9(Q):aq(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===E4(z.canonical)&&d9(Z,z.canonical)===Q?"match":"mismatch"}function eq($){let Z=new TextDecoder().decode($);if(!Z.includes(`\r
171
+ `,z.keyStart-1):-1,U=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(U)?U:" "}}function n$($,Z,Q={}){let z=new w4($).parse();if(z.kind!=="object")throw new K2("the JSON is not an object");let X=new m9($,mq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
172
+ `)),p9($,X.edits)}function p9($,Z){if(Z.length===0)return{text:$,changed:!1};let Q=Z.map((X,U)=>({e:X,i:U})).sort((X,U)=>U.e.start-X.e.start||U.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function pq($){let Z=new w4($).parse();if(Z.kind!=="object")throw new K2("the JSON is not an object");return Z}function lq($,Z){let Q=$.lastIndexOf(`
173
+ `,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function cq($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(lq($,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 l9($,Z){let Q=[],z=pq($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let U=z.members.filter((H)=>H.key===X);if(U.length!==1)return{count:U.length,chain:Q};Q.push({obj:z,member:U[0]}),z=U[0].value}return{count:1,chain:Q}}function c9($,Z){let{count:Q,chain:z}=l9($,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 S4($,Z,Q={}){let{count:z,chain:X}=l9($,Z);if(z!==1||X.length===0)return null;let U=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&U.obj.members.length===1)U=X[X.length-2];return p9($,[cq($,U.obj,U.member)]).text}var i9="one.faf/render";function b4($){return`sha256:${dq("sha256").update($,"utf8").digest("hex")}`}var nq=/^sha256:[0-9a-f]{64}$/,rq=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,sq='<meta name="faf-render"',oq='<meta name="description" content="Visual render of project.faf.';function aq($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(oq));return Z.splice(Q+1,0,`<meta name="faf-render" content="${b4($)}">
175
+ `),Z.join("")}function n9($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,U)=>{let H=X.replace(/\r?\n$/,""),J=rq.exec(H);if(J)Q.push({at:U,hash:J[1]});else if(H.startsWith(sq))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 E4=["_meta",i9];function tq($){return n$($,{_meta:{[i9]:b4($)}}).text}function eq($){try{return S4($,E4,{dropEmptyParent:!0})??$}catch{return $}}function $K($){let Z;try{Z=c9($,E4)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!nq.test(Z.value))return"many";let Q=S4($,E4,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function r9($,Z){return $==="html"?aq(Z):tq(Z)}function ZK($,Z){if($==="json")return eq(Z);let Q=n9(Z);return Q===null||Q==="many"?Z:Q.canonical}function d9($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?n9(Q):$K(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===b4(z.canonical)&&r9(Z,z.canonical)===Q?"match":"mismatch"}function QK($){let Z=new TextDecoder().decode($);if(!Z.includes(`\r
176
176
  `)||/(?:^|[^\r])\n/.test(Z)||!Buffer.from(Z,"utf-8").equals($))return null;return Buffer.from(Z.replace(/\r\n/g,`
177
- `),"utf-8")}function $K($,Z,Q){let z=p9($,Q);return z!=="match"&&Z!==null&&p9(Z,Q)==="match"?"match":z}function i$($,Z,Q){let z=lq($),X=h(Q.root,z),H=tq(Q.format,Z),U=d9(Q.format,H),J=K0(X);if(J===null)return a(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=eq(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&&!ZK(z,J,V,H,Q))return{path:X,result:"unchanged"};return a(X,G,{root:Q.root,expect:J}),{path:X,result:"updated"}}function ZK($,Z,Q,z,X){let H=$K(Z,Q,X.format);if(H==="match")return!0;if(H==="mismatch")throw new E("not-owned",$,`${$} was edited since faf wrote it — faf left it unchanged. Use --force to replace it.`,{onWrite:!0});if(!X.hasMark(Z))throw new E("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let U=Buffer.from(z,"utf-8");if(Z.equals(U)||Q!==null&&Q.equals(U))return!1;throw new E("not-owned",$,`${$} has no faf render hash (written before 7.13), so faf cannot tell whether it was edited — faf left it unchanged. Use --force once to replace it; after that faf recognises its own output.`,{onWrite:!0})}var i9=G$.orange,XK=G$.cyan,HK=G$.cyanDeep,UK="#FF9500",JK="#FF3B30",VK="#E6EDF3",GK="#6E7681",n9={TROPHY:{glyph:"✪",color:i9},GOLD:{glyph:"★",color:i9},SILVER:{glyph:"◆",color:XK},BRONZE:{glyph:"◇",color:HK},GREEN:{glyph:"●",color:VK},YELLOW:{glyph:"●",color:UK},RED:{glyph:"○",color:JK},WHITE:{glyph:"♡",color:GK}};function r2($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var r9=["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">${r2(Z)}</div><div class="v">${r2(Q)}</div></div>`).join(`
179
- `)}function b4($,Z,Q="project.faf"){let z=r2($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=n9[X]??n9.WHITE,U=Z.inherited?Z.represents?`inherited from ${r2(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,V=$.human_context??{},G=r9.map((q)=>[q,V[q]]),Y=Object.entries(V).filter(([q])=>!r9.includes(q)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],B=Object.entries($.stack??{}),K=B.filter(([,q])=>q&&q!=="slotignored"&&String(q).trim()!==""),L=B.filter(([,q])=>q==="slotignored").length;return`<!DOCTYPE html>
177
+ `),"utf-8")}function zK($,Z,Q){let z=d9($,Q);return z!=="match"&&Z!==null&&d9(Z,Q)==="match"?"match":z}function r$($,Z,Q){let z=iq($),X=h(Q.root,z),U=ZK(Q.format,Z),H=r9(Q.format,U),J=K0(X);if(J===null)return a(X,H,{root:Q.root,expect:null}),{path:X,result:"created"};if(J.equals(Buffer.from(H,"utf-8")))return{path:X,result:"unchanged"};let G=QK(J),V=G===null?H:H.replace(/\r?\n/g,`\r
178
+ `);if(G!==null&&J.equals(Buffer.from(V,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!XK(z,J,G,U,Q))return{path:X,result:"unchanged"};return a(X,V,{root:Q.root,expect:J}),{path:X,result:"updated"}}function XK($,Z,Q,z,X){let U=zK(Z,Q,X.format);if(U==="match")return!0;if(U==="mismatch")throw new E("not-owned",$,`${$} was edited since faf wrote it — faf left it unchanged. Use --force to replace it.`,{onWrite:!0});if(!X.hasMark(Z))throw new E("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let H=Buffer.from(z,"utf-8");if(Z.equals(H)||Q!==null&&Q.equals(H))return!1;throw new E("not-owned",$,`${$} has no faf render hash (written before 7.13), so faf cannot tell whether it was edited — faf left it unchanged. Use --force once to replace it; after that faf recognises its own output.`,{onWrite:!0})}var s9=Y$.orange,JK=Y$.cyan,GK=Y$.cyanDeep,VK="#FF9500",YK="#FF3B30",WK="#E6EDF3",BK="#6E7681",o9={TROPHY:{glyph:"✪",color:s9},GOLD:{glyph:"★",color:s9},SILVER:{glyph:"◆",color:JK},BRONZE:{glyph:"◇",color:GK},GREEN:{glyph:"●",color:WK},YELLOW:{glyph:"●",color:VK},RED:{glyph:"○",color:YK},WHITE:{glyph:"♡",color:BK}};function s2($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var a9=["who","what","why","where","when","how"];function K8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${s2(Z)}</div><div class="v">${s2(Q)}</div></div>`).join(`
179
+ `)}function y4($,Z,Q="project.faf"){let z=s2($.project?.name??"Project"),X=Z.tier?.name??"WHITE",U=o9[X]??o9.WHITE,H=Z.inherited?Z.represents?`inherited from ${s2(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,G=$.human_context??{},V=a9.map((q)=>[q,G[q]]),Y=Object.entries(G).filter(([q])=>!a9.includes(q)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],B=Object.entries($.stack??{}),K=B.filter(([,q])=>q&&q!=="slotignored"&&String(q).trim()!==""),L=B.filter(([,q])=>q==="slotignored").length;return`<!DOCTYPE html>
180
180
  <html lang="en">
181
181
  <head>
182
182
  <meta charset="UTF-8">
@@ -188,19 +188,19 @@ ${V}`).replace(/\n/g,$.eol);return{inline:J,text:J?U.slice(1):G}}function L4($,Z
188
188
  *{margin:0;padding:0;box-sizing:border-box}
189
189
  body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#0a0a0a;color:#e6edf3;line-height:1.55;padding:48px 20px}
190
190
  .wrap{max-width:880px;margin:0 auto}
191
- .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${H.color},transparent);margin-bottom:40px}
191
+ .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${U.color},transparent);margin-bottom:40px}
192
192
  header{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:8px}
193
193
  h1{font-size:2.2rem;font-weight:800;letter-spacing:-1px}
194
- .badge{font-size:1.05rem;font-weight:800;color:${H.color};white-space:nowrap}
194
+ .badge{font-size:1.05rem;font-weight:800;color:${U.color};white-space:nowrap}
195
195
  .score{font-size:1.05rem;font-weight:700;color:#8b949e}
196
196
  .eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:#6e7681;margin-bottom:36px}
197
197
  section{margin-bottom:34px}
198
- h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${H.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:${U.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
199
199
  .row{display:flex;gap:18px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.04)}
200
200
  .k{flex:0 0 150px;color:#8b949e;font-size:.9rem;text-transform:capitalize}
201
201
  .v{flex:1;color:#e6edf3;font-size:.95rem;word-break:break-word}
202
202
  .meter{height:8px;border-radius:4px;background:rgba(255,255,255,.06);overflow:hidden;margin:6px 0 10px}
203
- .meter span{display:block;height:100%;background:${H.color};width:${Math.max(0,Math.min(100,Z.score))}%}
203
+ .meter span{display:block;height:100%;background:${U.color};width:${Math.max(0,Math.min(100,Z.score))}%}
204
204
  .award{font-size:.95rem}
205
205
  .statline{margin-bottom:32px}
206
206
  .awd-pre{color:#6E7681}
@@ -217,68 +217,68 @@ footer strong{color:#e6edf3}
217
217
  <div class="eyebrow">project.faf · visual render</div>
218
218
  <header>
219
219
  <h1>${z}</h1>
220
- <span class="badge">${H.glyph} ${r2(X)}</span>
221
- <span class="score">${U}</span>
220
+ <span class="badge">${U.glyph} ${s2(X)}</span>
221
+ <span class="score">${H}</span>
222
222
  </header>
223
223
  <div class="meter"><span></span></div>
224
224
  ${J?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy ✪ Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${L?` · ${L} slotignored`:""}</p>`}
225
225
 
226
226
  <section>
227
227
  <h2>The 6 W's</h2>
228
- ${q8(G)||'<p class="muted">No human_context yet.</p>'}
229
- ${Y.length?q8(Y):""}
228
+ ${K8(V)||'<p class="muted">No human_context yet.</p>'}
229
+ ${Y.length?K8(Y):""}
230
230
  </section>
231
231
 
232
232
  <section>
233
233
  <h2>Project</h2>
234
- ${q8(W)||'<p class="muted">—</p>'}
234
+ ${K8(W)||'<p class="muted">—</p>'}
235
235
  </section>
236
236
 
237
237
  <section>
238
238
  <h2>Stack</h2>
239
- ${K.length?q8(K):'<p class="muted">No active stack slots.</p>'}
239
+ ${K.length?K8(K):'<p class="muted">No active stack slots.</p>'}
240
240
  </section>
241
241
 
242
242
  <footer>
243
- Rendered on-demand from your current <strong>${r2(Q)}</strong><br>
243
+ Rendered on-demand from your current <strong>${s2(Q)}</strong><br>
244
244
  <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
245
245
  </footer>
246
246
  </div>
247
247
  </body>
248
248
  </html>
249
- `}var YK='<meta name="description" content="Visual render of project.faf.';function WK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(YK)&&Z.includes(" by faf"))}function BK($,Z,Q,z="project.faf",X={}){i$(QK($,"project.html"),b4(Z,Q,z),{root:$,format:"html",hasMark:WK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var qK=zK(b4,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as CK}from"path";import{deprecate as jK}from"node:util";var o9="JSONRPC",n$="1.0",r$=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],D8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",a9="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",KK="1.0",DK="1.0",y4={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function t9($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function s2($,Z={}){let Q=t9($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:n$}];return[]}function LK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&r$.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function L8($,Z={}){let Q=$.agent??{},z=s2($,Z);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let X=String(Q.displayName??$.metadata?.persona??Q.name??"").trim(),H=String(Q.description??"").trim(),U=String(Q.version??"").trim();if(!X||!H||!U)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let J=String(Q.vendor??"").trim(),V=String(Q.homepage??"").trim(),G=J&&V?{organization:J,url:V}:void 0,Y=($.capabilities??[]).map((W)=>{let B=String(W.name??"").trim();if(!B)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&r$.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:B,name:B,description:String(W.description??"").trim()||B,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:H,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:o9,protocolVersion:String(W.version??n$)})),...G?{provider:G}:{},version:U,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:LK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var IK=/^[a-z0-9][a-z0-9._-]*$/,OK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function C($){return String($??"").trim()}function K8($){return Array.isArray($)?$.map(C).filter(Boolean):[]}function _K($){return C($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function MK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!C($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!IK.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!OK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function PK($,Z){return($.skills??[]).filter((Q)=>C(Q.name)).map((Q)=>({name:C(Q.name),type:C(Q.type)||"tool",description:C(Q.description)||C(Q.name),tags:Z.length?Z:[C(Q.name).toLowerCase()]}))}function NK($){return($.packages??[]).filter((Z)=>C(Z.registryType)&&C(Z.identifier)).map((Z)=>({registryType:C(Z.registryType),identifier:C(Z.identifier),...C(Z.version)?{version:C(Z.version)}:{}}))}function RK($,Z){let Q=[...($.endpoints??[]).filter((z)=>C(z.url)).map((z)=>({protocol:C(z.protocol).toLowerCase(),transport:"http",location:C(z.url)})),...Z.map((z)=>({protocol:"mcp",transport:"stdio",location:z.identifier}))];if(Q.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return Q}function FK($,Z,Q,z){let X={domain:Z},H=[["repository",C($.repository)],["icon",C($.icon)],["organizationUrl",C($.organization_url)]];for(let[J,V]of H)if(V)X[J]=V;if(Q.length)X.keywords=Q;let U=K8($.example_requests);if(U.length)X.examples=U;if(z.length)X.packages=z;return X}function e9($){let Z=C($.handle).toLowerCase(),Q=_K($.domain);MK($,Z,Q);let z=K8($.tags),X=NK($),H={name:Z,displayName:C($.display_name),id:`urn:air:${Q}:agent:${Z}`,...C($.organization)?{vendor:C($.organization)}:{},version:C($.version),description:C($.description),homepage:C($.homepage)||`https://${Q}`,...C($.license)?{license:C($.license)}:{}};return{version:DK,agent:H,capabilities:PK($,z),endpoints:RK($,X),metadata:{cards:FK($,Q,z,X)}}}function $Q($){return Y2($,{lineWidth:0})}function I8($){let Z=C($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=C($.metadata?.cards?.domain);if(z)return z;try{return new URL(C($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function ZQ($){let Z=C($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!Z)throw Error("The .fafa needs agent.name (the short name).");return Z}function QQ($){return`${I8($).split(".").reverse().join(".")}/${ZQ($)}`}function s9($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function x4($){return($.endpoints??[]).filter((Z)=>C(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(C(Z.location))).map((Z)=>({type:"streamable-http",url:C(Z.location)}))}function TK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function zQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=C(Z.description),X=C(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let H={name:QQ($),version:X,description:s9(z)},U=C(Z.displayName);if(U)H.title=s9(U);let J=C(Z.homepage);if(J)H.websiteUrl=J;let V=TK(C(Q.repository));if(V)H.repository=V;if(C(Q.icon))H.icons=[{src:C(Q.icon)}];return H}function XQ($){let Z=x4($);if(Z.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:D8,...zQ($),remotes:Z}}function HQ($){let Z=x4($),Q=($.metadata?.cards?.packages??[]).map((z)=>({registryType:C(z.registryType),identifier:C(z.identifier),...C(z.version)?{version:C(z.version)}:{},transport:{type:"stdio"}}));if(Z.length===0&&Q.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");return{$schema:a9,...zQ($),...Q.length?{packages:Q}:{},...Z.length?{remotes:Z}:{}}}function UQ($,Z,Q={}){let z=I8($),X=ZQ($),H=$.agent??{},U=C(H.displayName)||C(H.name),J=C(H.description),V=C(H.version),G=Q.now??new Date().toISOString(),Y=(B,K,L)=>({identifier:`urn:air:${z}:${B}:${X}`,displayName:U,type:K,description:J,url:L,...V?{version:V}:{},updatedAt:G}),W=[];if(Z.includes("a2a"))W.push(Y("a2a",y4.a2a,`https://${z}/.well-known/agent-card.json`));if(Z.includes("server_card")){let B=x4($)[0];if(B)W.push(Y("mcp",y4.server_card,`${B.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa)W.push(Y("agent",y4.fafa,`https://${z}/.well-known/fafa`));return W}function JQ($,Z,Q={}){let z=$.agent??{},X=C(z.vendor)||C(z.displayName)||C(z.name);return{specVersion:KK,host:{displayName:X,identifier:I8($)},entries:UQ($,Z,Q)}}function VQ($,Z,Q={}){let z=$.metadata?.cards??{},X=K8(z.keywords),H=K8(z.examples);return{entries:UQ($,Z,Q).map((U)=>({...U,...X.length?{tags:X}:{},...H.length?{representativeQueries:H}:{}}))}}function GQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:$Q($)};if(Q.has("a2a"))z.a2a=L8($,{extensions:Z.a2aExtensions});if(Q.has("server_card"))z.server_card=XQ($);if(Q.has("server_json"))z.server_json=HQ($);let X={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=JQ($,Z.cards,X);if(Q.has("ard"))z.ard=VQ($,Z.cards,X);return z}function AK($,Z){return GQ(e9($),Z)}var YQ="application/vnd.faf+yaml",wK=D8,SK=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function BQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&SK.test(Z))return Z;let Q=$.project?.homepage??$.project?.website??$.project?.url,z="local";if(Q)try{z=new URL(Q).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let X=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${z}/${X}`}function EK($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function o2($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:YQ,iana:`https://www.iana.org/assignments/media-types/${YQ}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function s$($,Z={}){let Q={$schema:wK,name:BQ($),version:String($.project?.version??"0.1.0"),description:EK($)},z=O8($)??$.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":o2($,Z)},Q}var qQ="io.modelcontextprotocol.registry/publisher-provided",WQ=4096;function v4($,Z={}){let Q={"one.faf/context":o2($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>WQ)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${WQ}B cap`);return{[qQ]:Q}}function k4($){return BQ($)}function O8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function bK($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var g4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function KQ($){let Z=bK($);return g4(Z)&&g4(Z._meta)&&g4(Z._meta["one.faf/context"])}function yK($,Z,Q={},z={}){let X=s$(Z,Q),H=CK($,"server-card");return i$(H,`${JSON.stringify(X,null,2)}
250
- `,{root:$,format:"json",hasMark:KQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function xK($,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 gK=jK(s$,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as DQ}from"fs";import{basename as vK,dirname as IQ,join as LQ}from"path";import{deprecate as kK}from"node:util";var OQ="https://faf.one/ext/context/v1",hK=["a2a","mcp","registry","catalog"];function uK($){return v0($0(h(IQ($),vK($))))}function fK($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=LQ($,z);if(DQ(X))return X}let Q=IQ($);if(Q!==$)for(let z of Z){let X=LQ(Q,z);if(DQ(X))return X}return null}function mK($,Z,Q){let z=o2(Z,Q),X=$.agent??{},H={fafaSpecVersion:String($.version??n$),mediaTypes:[...r$],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)H.agentId=X.id;let U=_Q($,"fafa");if(U)H.passport=U;return H}function h4($,Z,Q={}){if(s2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");return L8($,{doorUrl:Q.doorUrl,extensions:[{uri:OQ,description:"FAF passport and project DNA as typed parts",required:!1,params:mK($,Z,Q)}]})}var pK=kK(h4,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function lK($){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 dK($,Z,Q={}){let z=lK($),X=$.agent??{},H=String(X.name??"agent"),U=Q.now??Z.generated??new Date().toISOString(),J=[];if(s2($,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=_Q($,"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 _Q($,Z){let Q=$.agent?.homepage;if(!Q)return;try{return new URL(`/.well-known/${Z}`,Q).href}catch{return}}function iK($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function nK($,Z){let Q=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]};for(let z of Z){let X=iK(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 rK($){let Z=$.opts??{},Q=new Set($.targets?.length?$.targets:hK),X={block:o2($.faf,Z)};if(Q.has("mcp"))X.mcp=s$($.faf,Z);if(Q.has("registry")){let H=O8($.faf);X.registry={name:k4($.faf),...H?{title:H}:{},_meta:v4($.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(s2($.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=h4($.fafa,$.faf,Z);if(Q.has("catalog")&&$.fafa)X.catalog=dK($.fafa,$.faf,Z);return sK(X),X}function sK($){let Z=JSON.stringify($.block),Q=[];if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block");if($.a2a){let z=$.a2a.capabilities.extensions[0].params,X=$.block;if(z.provenance?.faf!==X.faf||z.provenance?.mediaType!==X.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var u4=["ephemeral","standard","high","critical"],$2=Object.fromEntries(u4.map(($,Z)=>[$,Z])),_8=new Set(["user","feedback","project","reference"]),f4=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),m4=new Set(["facts","sessions","preferences","custom"]),p4={low:"ephemeral",medium:"standard"};import{existsSync as oK}from"fs";import{dirname as TQ,resolve as AQ}from"path";function K2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function aK($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(f($))return"empty";if(typeof $==="string")return`a string (${JSON.stringify($.length>40?`${$.slice(0,40)}…`:$)})`;return`a ${typeof $}`}var t2=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function tK($){let Z=AQ($),Q=h(TQ(Z),Z,{read:!0});return{real:Q,text:$0(Q)}}function MQ($,Z,Q,z){let X=AQ($),H=h(TQ(X),X),U=Q!==void 0&&Q.real===H;if(U&&Q.text===Z)return H;let J;try{J=K0(H)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return H;if(!U&&!z&&J)throw new E("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let V=U?Q.text:z?J:null;return a($,Z,V===void 0?{}:{expect:V})}function e2($){if(f($))return"standard";if(p4[$])return p4[$];if($ in $2)return $;return"standard"}var eK=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function l4($){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(!eK.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:e2(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 a2($){if(f($.id)&&f($.type)&&$.tags.length===0&&$.links.length===0&&f($.timestamp)&&f($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!f($.id))Q.id=$.id;if(!f($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!f($.timestamp))Q.timestamp=$.timestamp;if(!f($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function PQ($){let Z=$;return t2($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&t2(Z.extra)&&typeof Z.priority==="string"?Z:l4($)}function $D($){if(typeof $==="string"||t2($)&&"text"in $)return l4($);return null}var NQ=["profile","namepoint","created","last_etched","retention"];class G0{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??K2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(PQ):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),this._index=Z.index?Z.index.slice():[],this._sessions=Z.sessions?structuredClone(Z.sessions):[],this._preferences=Z.preferences?{...Z.preferences}:{},this._custom=Z.custom?{...Z.custom}:{},this._extra=Z.extra?{...Z.extra}:{},this._memoryExtra=Z.memoryExtra?{...Z.memoryExtra}:{},this._indexDerived=Z.index===void 0||l(this._index,this.derivedIndex()),this._indexAtRecord=this._index.slice()}get facts(){return this._facts}get index(){return this._index}get sessions(){return this._sessions}get preferences(){return this._preferences}get custom(){return this._custom}get extra(){return this._extra}get memoryExtra(){return this._memoryExtra}static load($){if(!oK($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=tK($);return G0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=_4($,Z).toJS();if(!t2(z))throw Error(`soul is not a YAML mapping: ${Z} is ${aK(z)}`);let X=new CQ,H=X.pick("memory",z.memory,u)??{},U=new G0(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=$D(J);if(G)U.adopt(G,V)}),U.last_etched=String(z.last_etched??U.created),U._version=f(z.version)?void 0:String(z.version),U._origin={path:Z,real:Q,text:$,base:U.state(),residual:X.residual},U.recordIndex(),U}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!f($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return G0.load($)}toDoc(){let $={facts:this._facts.map(a2),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!m4.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(!f4.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return Y2(this.toDoc(),{lineWidth:100})}derivedIndex($=80){return this._facts.map((Z)=>`${Z.id??"?"} — ${String(Z.text).slice(0,$)}`)}indexIsDerived($=80){return!this._origin?.residual.has("index")&&l(this._index,this.derivedIndex($))}rebuildIndex($=80){return this._index=this.derivedIndex($),this._indexDerived=!0,this._indexAtRecord=this._index.slice(),this._index}save($,Z={}){let Q=Z.reindex??(this._indexDerived&&l(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),G=MQ($,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=MQ($,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(a2(Z)))}return{top:Object.fromEntries(NQ.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 NQ)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!l(z.index,X.index)){if(Z.residual.has("index")&&!Q)G0.refuse(Z,"index","replace it");G8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of FQ(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],...FQ(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(l(U,J))continue;if(Z.residual.has("memory"))G0.refuse(Z,"memory",`change memory.${H}`);if(Z.residual.has(`memory.${H}`))G0.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])=>!l(Z.base.facts.get(Y),a2(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))G0.refuse(Z,G,"add facts to it");let V=L9($,["memory","facts"],Z.path);for(let[G,Y]of U)V.items[Y]=QD($,V.items[Y],Z.base.facts.get(Y),a2(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(a2(G)));return J}add($){let Z=PQ($);if(!f(Z.id)&&this._byId.has(Z.id)){let Q=this._byId.get(Z.id);if(Q!==void 0){let z=this._factAt.get(this._facts[Q]);if(this._facts[Q]=Z,z!==void 0)this._factAt.set(Z,z)}}else if(this._facts.push(Z),!f(Z.id))this._byId.set(Z.id,this._facts.length-1);if(Z.timestamp&&Z.timestamp>(this.last_etched||""))this.last_etched=Z.timestamp;return Z}etch($,Z={}){let Q=f(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(ZD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:e2(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:K2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=t2($)?{...$,...Z}:Z,z=t2($)?$.query:$,X=$2[e2(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(!f(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 K=G[1].timestamp??"",L=Y[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return Y[0]-G[0]});let V=J.map(([,G])=>G);if(!f(Q.limit))return V.slice(0,Q.limit);return V}getFact($){let Z=this._byId.get($);return Z===void 0?null:this._facts[Z]}deleteFact($){let Z=this._byId.get($);if(Z===void 0)return!1;return this._facts.splice(Z,1),this._byId.clear(),this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),!0}}function ZD($,Z,Q){let z=(X,H)=>f(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:e2(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:K2(),extra:{...$.extra}}}class CQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,h$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,u)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,u)??{}),extra:RQ($,f4),memoryExtra:RQ(Z,m4)}}}function RQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function FQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function QD($,Z,Q,z){if(!p(Z))return l$($,Z,Q,z);let X=(H)=>typeof H==="string"?{text:H}:H;return l$($,Z,X(Q),X(z))}import{readdirSync as zD,readFileSync as XD,statSync as jQ,existsSync as HD}from"fs";import{join as UD,basename as wQ,resolve as JD}from"path";var SQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),VD=/\[\[([^\]]+)\]\]/g;function GD($){let Z=jQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function YD($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=v0(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 WD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!_8.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(VD)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:G,timestamp:GD($),source:`claude-code memory: ${wQ($)}`,extra:V}}function EQ($,Z={}){let Q=JD($);if(!HD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!jQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??SQ,X=Z.namepoint??`@claude-code:${wQ(Q)}`,H=[],U=zD(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=UD(Q,W),K;try{K=XD(B,"utf-8")}catch{continue}let{fm:L,body:q}=YD(K);if(!L)continue;let D=WD(B,q,L);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):K2(),G=J.length?J.reduce((W,B)=>W>B?W:B):V,Y=new G0(X,{profile:"knowledge",facts:H,created:V});return Y.last_etched=G,Y.rebuildIndex(),Y}var vQ="faf-interview/1",$$="(terse — 3-4 words)",c4=[{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? ${$$}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${$$}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${$$}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${$$}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${$$}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${$$}`,header:"How",type:"text",required:!0}],kQ=[{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}],Z$=[...c4,...kQ],hQ=new Map(Z$.map(($)=>[$.path,$])),BD=Object.fromEntries(Z$.map(($)=>[$.path,$]));function d4($){let Z=hQ.get($);if(Z)return Z.question;let Q=S0.get($)??m.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function qD($,Z){return Z$.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 KD=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"]),DD=[["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]],bQ=($)=>KD.has($.toLowerCase().trim()),LD=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function yQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&LD.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function uQ($){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=yQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!bQ(X))Z.what=X;let H=DD.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=yQ((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!bQ(J))Z.who=J;return Z}function xQ($,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 gQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!s(Z)}function ID($,Z={}){let Q=$&&typeof $==="object"?$:{},z=xQ(Q,"project.goal"),X=(gQ(z)?String(z).trim():"")||(Z.goal??"").trim(),H=uQ(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=(K)=>{let L=J[K];if(L)return{value:L,source:"project goal",confidence:0.9};let q=K.startsWith("human_context.")?K.slice(14):"",D=q?U[q]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},G=c4.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=xQ(Q,K.path);if(gQ(D))return{...q,value:String(D).trim(),status:"filled",seeded:!1};let O=V(K.path);if(O)return{...q,value:O.value,status:"seeded",seeded:!0,source:O.source,confidence:O.confidence};return{...q,value:"",status:"empty",seeded:!1}}),Y=G.filter((K)=>K.status==="filled").length,W=G.filter((K)=>K.status==="seeded").length,B=G.filter((K)=>K.status==="empty").length;return{version:vQ,rows:G,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function M8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||s(Z)}return!1}function OD($,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 fQ($){if($==="project.goal")return!0;return S0.get($)?.category==="human"}function mQ($,Z=M8){let Q=[],z=[];for(let X of Z$){let H=OD($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(fQ(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function pQ($,Z,Q=M8){let z=mQ(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"?i4(z):[];return{status:X,score:$,gaps:z,ask:H}}function i4($){return $.human.map((Z)=>({path:Z,question:d4(Z)}))}function _D($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??M8,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=pQ(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:i4(Y.gaps)}:{status:"stuck",score:G,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:G,rounds:H,history:X,ask:i4(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as cQ}from"crypto";var n4="faf-bench/1",MD={"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 PD($,Z){return MD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var dQ=[["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"]],o$=new Map;dQ.forEach(($,Z)=>$.forEach((Q)=>o$.set(Q,Z)));var ND=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function P8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function lQ($){return P8($).split(" ").filter((Z)=>Z&&!ND.has(Z))}function iQ($,Z){let Q=P8($),z=P8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=o$.get(Q);if(X!==void 0&&o$.get(z)===X)return!0;let H=lQ($);if(H.length===0)return!1;let U=new Set(lQ(Z));return H.every((J)=>{if(U.has(J))return!0;let V=o$.get(J);return V!==void 0&&[...U].some((G)=>o$.get(G)===V)})}function RD($){let Z=s8($),Q=v0($),z=[],X={},H=0;for(let V of m){if(Z.slots[V.path]!=="populated")continue;let G=N5(Q,V);if(typeof G!=="string")continue;let Y=G.trim();if(!Y||G6.has(Y.toLowerCase()))continue;H+=1,z.push({n:H,path:V.path,question:PD(V.path,V.description)}),X[H]=Y}let U=JSON.stringify({v:n4,q:z.map((V)=>[V.path,V.question])}),J=cQ("sha256").update(U).digest("hex").slice(0,12);return{version:n4,qsetHash:J,questions:z,answers:X}}function FD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function TD($,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()!==""&&iQ($.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 AD($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:cQ("sha256").update(Q).digest("hex")}}import{join as tL,extname as eL,resolve as $I}from"path";var r4={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"Gemfile.lock":{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:34,intelligence:"high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"Package.swift":{frameworks:["Swift"],slots:{packageManager:"spm",mainLanguage:"Swift",buildTool:"swift build"},priority:36,intelligence:"ultra-high"},"*.csproj":{frameworks:["C#",".NET"],slots:{packageManager:"NuGet",mainLanguage:"C#",buildTool:"dotnet"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"settings.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:34,intelligence:"high"},"settings.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:34,intelligence:"high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","Swift"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",backend:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};import{join as jD}from"path";var Q$={version:2,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs compose it. Bolster Dart/Flutter by editing THIS file. Logic stays in dart.ts. Refreshed 2026-08-01 (knowledge v2) — community receipt on top of 6.13.0 Dart Edition.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp","dart_mcpserver"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"],["jaspr","Jaspr"],["relic","Relic"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod_annotation","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"],["flutter_hooks","Hooks"]],routing:[["go_router","go_router"],["auto_route","auto_route"],["beamer","Beamer"],["routemaster","Routemaster"]]};var wD=Q$.flutterDeps,SD=Q$.mcpDeps,ED=Q$.serverFrameworks,bD=Q$.stateManagement,yD=Q$.routing;function xD($){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 N8($){let Z=w($,"pubspec.yaml");if(Z===null)return null;let Q=xD(Z),z=(M)=>Q.has(M.toLowerCase()),X=wD.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),H=SD.find(z),U=ED.find(([M])=>z(M)),J=bD.find(([M])=>z(M)),V=J?J[1]:"",G=yD.find(([M])=>z(M)),Y=G?G[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",B=/^executables:\s*$/m.test(Z),K=(v($,"bin")??[]).some((M)=>M.name.endsWith(".dart")),L=B||K,q,D="",O;if(X)if(D="Flutter",I($,jD("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))q="mobile",O="pubspec.yaml (Flutter app)";else q="library",O="pubspec.yaml (Flutter package)";else if(H)q="mcp",O=`pubspec.yaml + ${H} (Dart MCP server)`;else if(U)q="backend",D=U[1],O=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(L)q="cli",O=B?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else q="library",O="pubspec.yaml (Dart package)";return{appType:q,isFlutter:X,framework:D,stateManagement:V,routing:Y,testing:W,found:O}}import{join as vD}from"path";var R8={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 kD=R8.mcpModules,hD=R8.serverFrameworks,uD=R8.cliFrameworks;function fD($){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 rQ($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function nQ($,Z){let Q;for(let z of Z){if(!rQ($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function mD($,Z){let Q;for(let z of Z){if(!rQ($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function pD($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function lD($){for(let{name:Z}of v($,"cmd")??[]){let Q=vD("cmd",Z),z=D0($,Q);if(z?.isDirectory()){if((v($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function cD($){let Z=w($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function F8($){let Z=w($,"go.mod");if(Z===null)return null;let Q=pD(Z),z=fD(Z),X=mD(z,kD),H=nQ(z,hD),U=nQ(z,uD),J=lD($),V=cD($),G,Y="",W;if(X)G="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(H)G="backend",Y=H[1],W=`go.mod + ${H[0]} (Go backend)`;else if(U)G="cli",Y=U[1],W=`go.mod + ${U[0]} (Go CLI)`;else if(J)G="cli",W="go.mod + cmd/ (Go CLI layout)";else if(V&&!H)G="cli",W="go.mod + main.go package main (Go CLI)";else G="library",W="go.mod (Go module)";return{appType:G,modulePath:Q,framework:Y,found:W}}var D2={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 iD=D2.mcpPackages.map(($)=>$.toLowerCase()),nD=D2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),rD=D2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),sD=D2.grpcServerPackages.map(($)=>$.toLowerCase()),oD=D2.specializedSdks,sQ=D2.baseSdk.toLowerCase();function aD($){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 L of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());for(let L of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());let K=new Set;for(let L of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))K.add(L[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:J,isTestProject:V,useMaui:G,useWpf:Y,useWindowsForms:W,packages:B,frameworkRefs:K}}function s4($,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 oQ($,Z){let Q;for(let[z,X]of Z){if(!s4($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function tD($){let Z;for(let Q of iD){if(!s4($,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 eD($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of oD){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function T8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function $L($,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 ZL($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:H,outputType:U}=$,J,V="",G,Y=tD(X),W=eD(z),B=oQ(X,rD),K=oQ(X,nD),L=sD.some((D)=>s4(X,D)),q=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=L?"gRPC":W[2],G=`${Z} + Sdk=${W[0]}${L?" + 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(q&&T8(U))J="backend",V="ASP.NET Core",G=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!T8(U))J="library",V="ASP.NET Core",G=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(T8(U)||!U))J="cli",V=K[1],G=`${Z} + ${K[0]} (C# CLI)`;else if(T8(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()===sQ||z.toLowerCase().startsWith(`${sQ}/`))G=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:V,found:G}}function z$($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function A8($){let Z=z$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let H=w($,X);if(H===null)continue;let U=aD(H),J=ZL(U,X),V=$L(J.appType,J.framework);if(!Q||V<z)Q=J,z=V}return Q}import{join as L2}from"path";var I0={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 zL=I0.mcpArtifacts.map(($)=>$.toLowerCase()),XL=I0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),HL=I0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),UL=I0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),iR=I0.androidPlugins.map(($)=>$.toLowerCase()),JL=I0.kmpPlugins.map(($)=>$.toLowerCase()),VL=I0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),GL=I0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),YL=I0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),WL=I0.libraryPlugins.map(($)=>$.toLowerCase()),BL=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function o4($){return BL.some((Z)=>I($,Z))}function qL($){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 K=B.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=B.split(":");if(K.length>=2){let L=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,L),Q.set(W.replace(/-/g,"."),L)}}}}return{plugins:Z,libraries:Q}}function KL($){let Z=w($,L2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return qL(Z)}function DL($){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 LL($,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 IL($,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 eQ($){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 k0($,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 a$($,Z,Q){let z;for(let[X,H]of Z){let U=!1;if(Q==="plugin")U=k0($,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 OL($){let Z;for(let Q of zL)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 $3($,Z){let Q=new Set,z=!1,X=!1,H=[L2(Z,"src"),L2(Z,"src","main")],U=(J,V)=>{if(V>4)return;let G=v($,J);if(!G)return;for(let{name:Y}of G){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=L2(J,Y),B=D0($,W);if(!B)continue;if(B.isDirectory())U(W,V+1);else if(Y.endsWith(".kt")||Y.endsWith(".kts"))z=!0;else if(Y.endsWith(".java"))X=!0}};for(let J of H)U(J,0);return{kotlin:z,java:X,hints:Q}}function _L($){let Z=[],Q=$.plugins,z=$.artifacts,X=JL.some((R)=>k0(Q,R))||$.sourceHints.has("commonMain"),H=k0(Q,"com.android.application"),U=k0(Q,"com.android.library")||k0(Q,"com.android.kotlin.multiplatform.library");if(H||U)Z.push("android");if(X)Z.push("multiplatform");let J=OL(z),V=a$(Q,XL,"plugin"),G=a$($.parents,HL,"parent"),Y=a$(z,UL,"artifact"),W=a$(Q,GL,"plugin"),B=a$(z,YL,"artifact"),K=WL.some((R)=>k0(Q,R)),L=$.packaging==="pom",q,D="",O;if(H)q="mobile",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + com.android.application (${D})`;else if(J)q="mcp",D="MCP",Z.push("mcp"),O=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(V||G||Y){q="backend",D=V?.[1]||G?.[1]||Y?.[1]||"JVM";let R=V?.[0]||G?.[0]||Y?.[0]||"web";O=`${$.path||"root"} + ${R} (JVM backend)`}else if(X&&!U)q="library",D="Kotlin Multiplatform",O=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(U)q="library",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)q="cli",D=B?.[1]||"application",O=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)q="cli",D="application",O=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)q="library",O=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{q="library";let R=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(O=`${$.path||"root"} (${R} library)`,K)O=`${$.path||"root"} + java-library (JVM library)`}let M="Java";if($.kotlinSources&&$.javaSources)M="Java/Kotlin";else if($.kotlinSources||VL.some((R)=>k0(Q,R))||X)M="Kotlin";let F=[...new Set(Z)];return{appType:q,framework:D,facets:F,found:O,buildTool:$.buildTool,mainLanguage:M}}function ML($,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 aQ($,Z,Q){let z=L2(Z,"build.gradle.kts"),X=L2(Z,"build.gradle"),H=I($,z)?z:I($,X)?X:null;if(!H)return null;let U=w($,H);if(!U)return null;let J=LL(U,Q),V=IL(U,Q),G=$3($,Z),Y=/mainClass\s*[.=]/.test(U)||/mainClassName\s*=/.test(U)||/Main-Class/.test(U),W=k0(J,"application")||k0(J,"org.gradle.application");return{path:Z||"build.gradle",plugins:J,artifacts:V,packaging:"jar",parents:new Set,hasMainClass:Y,hasApplicationPlugin:W,sourceHints:G.hints,kotlinSources:G.kotlin||H.endsWith(".kts"),javaSources:G.java,buildTool:"gradle"}}function tQ($,Z){let Q=w($,L2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=eQ(Q),U=$3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:H,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:U.hints,kotlinSources:U.kotlin,javaSources:U.java,buildTool:"maven"}}function t$($){if(!o4($))return null;let Z=KL($),Q=[],z=null;for(let G of["settings.gradle.kts","settings.gradle"])if(I($,G)){z=w($,G);break}let X=z?DL(z):[],H=aQ($,"",Z);if(H)Q.push(H);for(let G of X){let Y=aQ($,G,Z);if(Y)Q.push(Y)}let U=tQ($,"");if(U){Q.push(U);let G=w($,"pom.xml");if(G){let{modules:Y}=eQ(G);for(let W of Y){let B=tQ($,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=_L(G),W=ML(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{join as NL}from"path";var e$={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 RL=e$.mcpGems.map(($)=>$.toLowerCase()),FL=e$.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),Z3=e$.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),TL=e$.railsLayoutFiles;function AL($){return I($,"Gemfile")||I($,"gems.rb")||CL($)}function CL($){return(v($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function jL($){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 wL($){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 SL($){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 EL($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let H=w($,X);if(H){for(let U of jL(H))Z.add(U);Q.push(X)}}let z=w($,"Gemfile.lock")||w($,"gems.locked");if(z){for(let X of wL(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let H=w($,X);if(H){for(let U of SL(H))Z.add(U);Q.push(X)}}return{gems:Z,sources:Q}}function $6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function a4($,Z){let Q;for(let[z,X]of Z){if(!$6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function bL($){let Z;for(let Q of RL)if($6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function Q3($){for(let Z of TL)if(I($,Z))return Z;return}function yL($,Z){let Q=a4(Z,Z3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let H=w($,X);if(H&&/executables\s*=/.test(H)&&!/executables\s*=\s*\[\s*\]/.test(H))return{hit:!0,why:`${X} executables`}}let z=v($,"bin");if(z){let H=z.map((U)=>U.name).filter((U)=>{if(U==="setup"||U==="console"||U==="rake")return!1;return D0($,NL("bin",U))?.isFile()===!0}).filter((U)=>U!=="rails");if(H.length>0&&!$6(Z,"rails")&&!Q3($))return{hit:!0,why:`bin/${H[0]}`}}return{hit:!1,why:""}}function C8($){if(!AL($))return null;let{gems:Z,sources:Q}=EL($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",H=bL(Z),U=a4(Z,FL),J=Q3($),V=$6(Z,"rails")||$6(Z,"railties"),G=yL($,Z),Y=I($,"config.ru"),W=V||!!J,B=U&&U[1]!=="Rails"&&!(U[0]==="rack"&&!Y)?U:void 0,K,L="",q;if(H)K="mcp",L="MCP",q=`${z} + gem ${H} (Ruby MCP)`;else if(W)if(K="backend",L="Rails",V&&J)q=`${z} + rails + ${J} (Rails)`;else if(V)q=`${z} + gem rails (Rails)`;else q=`${J} (Rails layout)`;else if(B)K="backend",L=B[1],q=`${z} + gem ${B[0]} (Ruby backend)`;else if(G.hit)K="cli",L=a4(Z,Z3)?.[1]||"",q=`${z} + ${G.why} (Ruby CLI)`;else K="library",q=`${z} (Ruby library)`;return{appType:K,framework:L,packageManager:X,found:q}}import{join as gL}from"path";var A0={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 vL=A0.mcpPackageUrls.map(($)=>$.toLowerCase()),kL=A0.mcpProducts.map(($)=>$.toLowerCase()),hL=A0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),uL=A0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),fL=A0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),mL=A0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),pL=A0.appProductTypes,lL=A0.cliProductTypes,cL=A0.vaporLayoutFiles;function dL($){return I($,"Package.swift")||t4($).length>0}function t4($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&D0($,Z)?.isDirectory()===!0)}function iL($){let Z=nL($),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),K=/\.executabletarget\s*\(/.test(Q),L=/\.target\s*\(/.test(Q)&&!K?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:z,productNames:J,hasLibraryProduct:Y,hasExecutableProduct:W,hasPluginProduct:!!B,hasExecutableTarget:K,hasLibraryTarget:L}}function nL($){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 rL($,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 z3($,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 X3($,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 sL($){let Z=$.map((Q)=>Q.toLowerCase());return kL.some((Q)=>Z.includes(Q))}function oL($){let Z=!1,Q=!1,z;for(let X of t4($)){let H=w($,gL(X,"project.pbxproj"));if(!H)continue;for(let U of pL)if(H.includes(U))Z=!0,z=U;for(let U of lL)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function aL($){for(let Z of cL)if(I($,Z))return Z;return}function Z6($){if(!dL($))return null;let Z=I($,"Package.swift"),Q=t4($),z=Q.length>0,X=null;if(Z){let N=w($,"Package.swift");if(N)X=iL(N)}let H=z?oL($):{hasApplication:!1,hasTool:!1},U=aL($),J=X?.packageUrls??[],V=X?.productNames??[],G=rL(J,vL),Y=sL(V),W=z3(J,hL),B=X3(V,uL),K=z3(J,fL),L=X3(V,mL),q=!!(G||Y),D=!!(W||B||U),O=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),M=!!(K||L),F=H.hasApplication,R=Z&&z?"spm+xcode":Z?"spm":"xcode",T,A="",j;if(q)if(T="mcp",A="MCP",Y)j="Package.swift + product MCP (Swift MCP)";else j=`Package.swift + ${G} (Swift MCP)`;else if(D)if(T="backend",A=B?.[1]||W?.[1]||(U?"Vapor":""),B)j=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)j=`Package.swift + ${W[1]} (Swift backend)`;else j=`${U} (Swift backend layout)`;else if(F)T="app",A="",j=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(M||O&&!D&&!q)if(T="cli",A=L?.[1]||K?.[1]||"",L)j=`Package.swift + product ${L[1]} (Swift CLI)`;else if(K)j=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)j="Package.swift + .executable product (Swift CLI)";else j="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Z)T="cli",j=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(T="library",X?.hasLibraryProduct)j="Package.swift + .library product (Swift library)";else j="Package.swift (Swift library)";else T="library",j=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:T,framework:A,packageManager:R,found:j}}var ZI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),QI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),zI={mainLanguage:["project","main_language"],main_language:["project","main_language"],framework:["stack","frontend"],cssFramework:["stack","css_framework"],css:["stack","css_framework"],uiLibrary:["stack","ui_library"],ui_library:["stack","ui_library"],stateManagement:["stack","state_management"],state:["stack","state_management"],backend:["stack","backend"],apiType:["stack","api_type"],api:["stack","api_type"],runtime:["stack","runtime"],database:["stack","database"],db:["stack","database"],connection:["stack","connection"],hosting:["stack","hosting"],buildTool:["stack","build"],build_tool:["stack","build"],build:["stack","build"],packageManager:["stack","package_manager"],pkg_manager:["stack","package_manager"],cicd:["stack","cicd"]},XI=[["packageManager","package-manager"],["pkg_manager","package-manager"],["mainLanguage","language"],["main_language","language"],["framework","framework"],["backend","backend"],["database","database"],["db","database"],["cicd","ci-cd"],["hosting","hosting"],["buildTool","build"],["build_tool","build"],["build","build"],["runtime","runtime"],["cssFramework","css"],["css","css"],["uiLibrary","ui-library"],["stateManagement","state-management"],["apiType","api"],["api","api"]];function HI($,Z){for(let[Q,z]of XI)if(Q in $)return z;return Z.length>0?"framework":"config"}function UI($,Z){try{let Q=JSON.parse(w($,Z)??""),z=["background","content_scripts","action","browser_action","permissions"].some((X)=>(X in Q));if(typeof Q.manifest_version==="number"&&z)return"chrome";return"other"}catch{return"other"}}function JI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return D0($,Z.name)?.isFile()===!0}function VI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return D0($,Z.name)?.isDirectory()===!0}function GI($){let Z=[],Q=$I($),z=new Set,X=v(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!VI(Q,H):!JI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let V=A8(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=Z6(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=r4[U];if(!J)continue;if(U==="manifest.json"&&UI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let V=N8(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=F8(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=C8(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=Z6(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=t$(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 YI($){let Z=[];for(let Q of i2($,()=>U3($,2,{count:0}))){let z=r4[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function H3($){let Z=[...GI($),...YI($)],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:HI(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 j8($){let{slotFills:Z}=H3($),Q={};for(let[z,X]of Object.entries(Z)){let H=zI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function U3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=v($);if(!X)return z;for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=eL(H.name);if(QI.has(U))z.add(U);continue}if(ZI.has(H.name)||H.name.startsWith("."))continue;for(let U of U3(tL($,H.name),Z-1,Q))z.add(U)}return z}var t=($,Z,Q)=>({value:$,source:Z,confidence:Q});function J3($,Z={}){let Q=Z.toolingRoot?null:WI($),z=BI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",DI(Q,z)),H("who",LI(z)),H("why",II(z)),H("where",OI(Q,z)),H("when",_I(z)),H("how",MI(Q,z)),X}function w8($,Z={}){let Q=J3($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function WI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function BI($){let Z=w($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
249
+ `}var qK='<meta name="description" content="Visual render of project.faf.';function KK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(qK)&&Z.includes(" by faf"))}function DK($,Z,Q,z="project.faf",X={}){r$(UK($,"project.html"),y4(Z,Q,z),{root:$,format:"html",hasMark:KK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var LK=HK(y4,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as wK}from"path";import{deprecate as SK}from"node:util";var e9="JSONRPC",s$="1.0",o$=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],L8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",$Q="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",ZQ="1.0",IK="1.0",x4={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function QQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function o2($,Z={}){let Q=QQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:s$}];return[]}function OK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&o$.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function I8($,Z={}){let Q=$.agent??{},z=o2($,Z);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let X=String(Q.displayName??$.metadata?.persona??Q.name??"").trim(),U=String(Q.description??"").trim(),H=String(Q.version??"").trim();if(!X||!U||!H)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let J=String(Q.vendor??"").trim(),G=String(Q.homepage??"").trim(),V=J&&G?{organization:J,url:G}:void 0,Y=($.capabilities??[]).map((W)=>{let B=String(W.name??"").trim();if(!B)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&o$.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:B,name:B,description:String(W.description??"").trim()||B,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:U,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:e9,protocolVersion:String(W.version??s$)})),...V?{provider:V}:{},version:H,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:OK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var _K=/^[a-z0-9][a-z0-9._-]*$/,MK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function C($){return String($??"").trim()}function D8($){return Array.isArray($)?$.map(C).filter(Boolean):[]}function PK($){return C($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function NK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!C($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!_K.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!MK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function RK($,Z){return($.skills??[]).filter((Q)=>C(Q.name)).map((Q)=>({name:C(Q.name),type:C(Q.type)||"tool",description:C(Q.description)||C(Q.name),tags:Z.length?Z:[C(Q.name).toLowerCase()]}))}function FK($){return($.packages??[]).filter((Z)=>C(Z.registryType)&&C(Z.identifier)).map((Z)=>({registryType:C(Z.registryType),identifier:C(Z.identifier),...C(Z.version)?{version:C(Z.version)}:{}}))}function TK($,Z){let Q=[...($.endpoints??[]).filter((z)=>C(z.url)).map((z)=>({protocol:C(z.protocol).toLowerCase(),transport:"http",location:C(z.url)})),...Z.map((z)=>({protocol:"mcp",transport:"stdio",location:z.identifier}))];if(Q.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return Q}function AK($,Z,Q,z){let X={domain:Z},U=[["repository",C($.repository)],["icon",C($.icon)],["organizationUrl",C($.organization_url)]];for(let[J,G]of U)if(G)X[J]=G;if(Q.length)X.keywords=Q;let H=D8($.example_requests);if(H.length)X.examples=H;if(z.length)X.packages=z;return X}function zQ($){let Z=C($.handle).toLowerCase(),Q=PK($.domain);NK($,Z,Q);let z=D8($.tags),X=FK($),U={name:Z,displayName:C($.display_name),id:`urn:air:${Q}:agent:${Z}`,...C($.organization)?{vendor:C($.organization)}:{},version:C($.version),description:C($.description),homepage:C($.homepage)||`https://${Q}`,...C($.license)?{license:C($.license)}:{}};return{version:IK,agent:U,capabilities:RK($,z),endpoints:TK($,X),metadata:{cards:AK($,Q,z,X)}}}function XQ($){return W2($,{lineWidth:0})}function $2($){let Z=C($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=C($.metadata?.cards?.domain);if(z)return z;try{return new URL(C($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function UQ($){return g4($)}function g4($){let Z=C($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!Z)throw Error("The .fafa needs agent.name (the short name).");return Z}function HQ($){return`${$2($).split(".").reverse().join(".")}/${g4($)}`}function t9($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function v4($){return($.endpoints??[]).filter((Z)=>C(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(C(Z.location))).map((Z)=>({type:"streamable-http",url:C(Z.location)}))}function CK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function JQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=C(Z.description),X=C(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let U={name:HQ($),version:X,description:t9(z)},H=C(Z.displayName);if(H)U.title=t9(H);let J=C(Z.homepage);if(J)U.websiteUrl=J;let G=CK(C(Q.repository));if(G)U.repository=G;if(C(Q.icon))U.icons=[{src:C(Q.icon)}];return U}function GQ($){let Z=v4($);if(Z.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:L8,...JQ($),remotes:Z}}function VQ($){let Z=v4($),Q=($.metadata?.cards?.packages??[]).map((z)=>({registryType:C(z.registryType),identifier:C(z.identifier),...C(z.version)?{version:C(z.version)}:{},transport:{type:"stdio"}}));if(Z.length===0&&Q.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");return{$schema:$Q,...JQ($),...Q.length?{packages:Q}:{},...Z.length?{remotes:Z}:{}}}function YQ($,Z,Q={}){let z=$2($),X=g4($),U=$.agent??{},H=C(U.displayName)||C(U.name),J=C(U.description),G=C(U.version),V=Q.now??new Date().toISOString(),Y=(B,K,L)=>({identifier:`urn:air:${z}:${B}:${X}`,displayName:H,type:K,description:J,url:L,...G?{version:G}:{},updatedAt:V}),W=[];if(Z.includes("a2a"))W.push(Y("a2a",x4.a2a,`https://${z}/.well-known/agent-card.json`));if(Z.includes("server_card")){let B=v4($)[0];if(B)W.push(Y("mcp",x4.server_card,`${B.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa)W.push(Y("agent",x4.fafa,`https://${z}/.well-known/fafa`));return W}function O8($){let Z=$.agent??{},Q=C(Z.vendor)||C(Z.displayName)||C(Z.name);if(!Q)return;let z;try{z=$2($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function WQ($,Z,Q={}){let z=O8($);return{specVersion:ZQ,...z?{host:z}:{},entries:YQ($,Z,Q)}}function k4($){let Z=$.metadata?.cards??{},Q=D8(Z.keywords),z=D8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function BQ($,Z,Q={}){let z=O8($),X=k4($);return{specVersion:ZQ,...z?{host:z}:{},entries:YQ($,Z,Q).map((U)=>({...U,...X}))}}function qQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:XQ($)};if(Q.has("a2a"))z.a2a=I8($,{extensions:Z.a2aExtensions});if(Q.has("server_card"))z.server_card=GQ($);if(Q.has("server_json"))z.server_json=VQ($);let X={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=WQ($,Z.cards,X);if(Q.has("ard"))z.ard=BQ($,Z.cards,X);return z}function jK($,Z){return qQ(zQ($),Z)}var KQ="application/vnd.faf+yaml",EK=L8,bK=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function LQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&bK.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 yK($){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 a2($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:KQ,iana:`https://www.iana.org/assignments/media-types/${KQ}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function a$($,Z={}){let Q={$schema:EK,name:LQ($),version:String($.project?.version??"0.1.0"),description:yK($)},z=_8($)??$.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":a2($,Z)},Q}var IQ="io.modelcontextprotocol.registry/publisher-provided",DQ=4096;function u4($,Z={}){let Q={"one.faf/context":a2($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>DQ)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${DQ}B cap`);return{[IQ]:Q}}function f4($){return LQ($)}function _8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function xK($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var h4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function OQ($){let Z=xK($);return h4(Z)&&h4(Z._meta)&&h4(Z._meta["one.faf/context"])}function gK($,Z,Q={},z={}){let X=a$(Z,Q),U=wK($,"server-card");return r$(U,`${JSON.stringify(X,null,2)}
250
+ `,{root:$,format:"json",hasMark:OQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),U}function vK($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return n$($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var kK=SK(a$,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as _Q}from"fs";import{basename as hK,dirname as PQ,join as MQ}from"path";import{deprecate as uK}from"node:util";var NQ="https://faf.one/ext/context/v1",fK=["a2a","mcp","registry","catalog","ard"];function mK($){return v0($0(h(PQ($),hK($))))}function pK($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=MQ($,z);if(_Q(X))return X}let Q=PQ($);if(Q!==$)for(let z of Z){let X=MQ(Q,z);if(_Q(X))return X}return null}function lK($,Z,Q){let z=a2(Z,Q),X=$.agent??{},U={fafaSpecVersion:String($.version??s$),mediaTypes:[...o$],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)U.agentId=X.id;let H=cK($);if(H)U.passport=H;return U}function cK($){try{return`https://${$2($)}/.well-known/fafa`}catch{return}}function m4($,Z,Q={}){if(o2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");return I8($,{doorUrl:Q.doorUrl,extensions:[{uri:NQ,description:"FAF passport and project DNA as typed parts",required:!1,params:lK($,Z,Q)}]})}var dK=uK(m4,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function iK($,Z){return Z.a2aCardUrl??`https://${$2($)}/.well-known/agent-card.json`}function nK($,Z,Q={}){let z=$2($),X=UQ($),U=$.agent??{},H=Q.now??Z.generated??new Date().toISOString(),J=[];if(o2($,Q).length>0)J.push({identifier:`urn:air:${z}:a2a:${X}`,displayName:String(U.displayName??U.name??"A2A Agent Card"),type:"application/a2a-agent-card+json",description:"A2A v1.0 Agent Card. Projected from .fafa.",url:iK($,Q),updatedAt:H});return J.push({identifier:`urn:air:${z}:agent:${X}`,displayName:String(U.displayName??U.name??".fafa"),type:"application/vnd.fafa+yaml",description:"FAF agent passport (.fafa).",url:`https://${z}/.well-known/fafa`,updatedAt:H}),J}function rK($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function sK($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:U,...H})=>({specVersion:U,host:{...Q},...H}))(z):z;for(let U of Z){let H=rK(X.entries,U);if(H>=0)X.entries[H]={...X.entries[H],url:U.url,type:U.type,...U.updatedAt?{updatedAt:U.updatedAt}:{}};else X.entries.push(U)}return X}function oK($){let Z=$.opts??{},Q=new Set($.targets?.length?$.targets:fK),X={block:a2($.faf,Z)};if(Q.has("mcp"))X.mcp=a$($.faf,Z);if(Q.has("registry")){let U=_8($.faf);X.registry={name:f4($.faf),...U?{title:U}:{},_meta:u4($.faf,Z)}}if(Q.has("a2a")||Q.has("catalog")||Q.has("ard")){if(!$.fafa){if($.targets?.some((U)=>U==="a2a"||U==="catalog"||U==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(Q.has("a2a")&&$.fafa)if(o2($.fafa,Z).length===0){if($.targets?.includes("a2a"))throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.")}else X.a2a=m4($.fafa,$.faf,Z);if((Q.has("catalog")||Q.has("ard"))&&$.fafa){let U=nK($.fafa,$.faf,Z);if(Q.has("catalog"))X.catalog=U;if(Q.has("ard")){let J=k4($.fafa);X.ard=U.map((G)=>({...G,...J}))}let H=O8($.fafa);if(H)X.catalogHost=H}return aK(X),X}function aK($){let Z=JSON.stringify($.block),Q=[];if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block");if($.a2a){let z=$.a2a.capabilities.extensions[0].params,X=$.block;if(z.provenance?.faf!==X.faf||z.provenance?.mediaType!==X.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var p4=["ephemeral","standard","high","critical"],Z2=Object.fromEntries(p4.map(($,Z)=>[$,Z])),M8=new Set(["user","feedback","project","reference"]),l4=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),c4=new Set(["facts","sessions","preferences","custom"]),d4={low:"ephemeral",medium:"standard"};import{existsSync as tK}from"fs";import{dirname as jQ,resolve as wQ}from"path";function D2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function eK($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(f($))return"empty";if(typeof $==="string")return`a string (${JSON.stringify($.length>40?`${$.slice(0,40)}…`:$)})`;return`a ${typeof $}`}var e2=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function $D($){let Z=wQ($),Q=h(jQ(Z),Z,{read:!0});return{real:Q,text:$0(Q)}}function RQ($,Z,Q,z){let X=wQ($),U=h(jQ(X),X),H=Q!==void 0&&Q.real===U;if(H&&Q.text===Z)return U;let J;try{J=K0(U)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return U;if(!H&&!z&&J)throw new E("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let G=H?Q.text:z?J:null;return a($,Z,G===void 0?{}:{expect:G})}function $$($){if(f($))return"standard";if(d4[$])return d4[$];if($ in Z2)return $;return"standard"}var ZD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function i4($){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(!ZD.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:$$(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 t2($){if(f($.id)&&f($.type)&&$.tags.length===0&&$.links.length===0&&f($.timestamp)&&f($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!f($.id))Q.id=$.id;if(!f($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!f($.timestamp))Q.timestamp=$.timestamp;if(!f($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function FQ($){let Z=$;return e2($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&e2(Z.extra)&&typeof Z.priority==="string"?Z:i4($)}function QD($){if(typeof $==="string"||e2($)&&"text"in $)return i4($);return null}var TQ=["profile","namepoint","created","last_etched","retention"];class V0{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??D2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(FQ):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),this._index=Z.index?Z.index.slice():[],this._sessions=Z.sessions?structuredClone(Z.sessions):[],this._preferences=Z.preferences?{...Z.preferences}:{},this._custom=Z.custom?{...Z.custom}:{},this._extra=Z.extra?{...Z.extra}:{},this._memoryExtra=Z.memoryExtra?{...Z.memoryExtra}:{},this._indexDerived=Z.index===void 0||l(this._index,this.derivedIndex()),this._indexAtRecord=this._index.slice()}get facts(){return this._facts}get index(){return this._index}get sessions(){return this._sessions}get preferences(){return this._preferences}get custom(){return this._custom}get extra(){return this._extra}get memoryExtra(){return this._memoryExtra}static load($){if(!tK($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=$D($);return V0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=M4($,Z).toJS();if(!e2(z))throw Error(`soul is not a YAML mapping: ${Z} is ${eK(z)}`);let X=new SQ,U=X.pick("memory",z.memory,u)??{},H=new V0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,U)});return(X.pick("memory.facts",U.facts,Array.isArray)??[]).forEach((J,G)=>{let V=QD(J);if(V)H.adopt(V,G)}),H.last_etched=String(z.last_etched??H.created),H._version=f(z.version)?void 0:String(z.version),H._origin={path:Z,real:Q,text:$,base:H.state(),residual:X.residual},H.recordIndex(),H}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!f($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return V0.load($)}toDoc(){let $={facts:this._facts.map(t2),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!c4.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(!l4.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return W2(this.toDoc(),{lineWidth:100})}derivedIndex($=80){return this._facts.map((Z)=>`${Z.id??"?"} — ${String(Z.text).slice(0,$)}`)}indexIsDerived($=80){return!this._origin?.residual.has("index")&&l(this._index,this.derivedIndex($))}rebuildIndex($=80){return this._index=this.derivedIndex($),this._indexDerived=!0,this._indexAtRecord=this._index.slice(),this._index}save($,Z={}){let Q=Z.reindex??(this._indexDerived&&l(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let G=this.toYaml(),V=RQ($,G,void 0,z);return this.settle($,G,new Map(this._facts.map((Y,W)=>[Y,W])),V),$}let U=new Map,{text:H}=V8(X.text,(G)=>{U=this.applyTo(G,X,Q)},$),J=RQ($,H,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,H,U,J),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,U]of Q)this._factAt.set(X,U);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(t2(Z)))}return{top:Object.fromEntries(TQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),U=Z.path;for(let H of TQ)if(z.top[H]!==X.top[H])$.set(H,X.top[H]);if(!l(z.index,X.index)){if(Z.residual.has("index")&&!Q)V0.refuse(Z,"index","replace it");W8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,U)}for(let H of CQ(z.extra,X.extra))W8($,[H],z.extra[H],X.extra[H],U);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...CQ(Q.memoryExtra,z.memoryExtra).map((U)=>[U,Q.memoryExtra[U],z.memoryExtra[U]])];for(let[U,H,J]of X){if(l(H,J))continue;if(Z.residual.has("memory"))V0.refuse(Z,"memory",`change memory.${U}`);if(Z.residual.has(`memory.${U}`))V0.refuse(Z,`memory.${U}`,"replace it");W8($,["memory",U],H,J,Z.path)}}sortFacts($){let Z=[],Q=[];for(let z of this._facts){let X=this._factAt.get(z);if(X===void 0){Q.push(z);continue}if(Q.length>0||Z.length>0&&X<=Z[Z.length-1][1])throw Error(`${$.path}: the facts were reordered — faf keeps the order soul.fafm has. Nothing written.`);Z.push([z,X])}return{kept:Z,added:Q}}applyFacts($,Z){let{kept:Q,added:z}=this.sortFacts(Z),X=new Set(Q.map(([,V])=>V)),U=[...Z.base.facts.keys()].filter((V)=>!X.has(V)).sort((V,Y)=>Y-V),H=Q.filter(([V,Y])=>!l(Z.base.facts.get(Y),t2(V))),J=new Map(Q);if(z.length===0&&U.length===0&&H.length===0)return J;for(let V of["memory","memory.facts"])if(Z.residual.has(V))V0.refuse(Z,V,"add facts to it");let G=_9($,["memory","facts"],Z.path);for(let[V,Y]of H)G.items[Y]=XD($,G.items[Y],Z.base.facts.get(Y),t2(V));for(let V of U)G.items.splice(V,1);for(let[V,Y]of Q)J.set(V,Y-U.filter((W)=>W<Y).length);for(let V of z)J.set(V,G.items.length),G.items.push($.createNode(t2(V)));return J}add($){let Z=FQ($);if(!f(Z.id)&&this._byId.has(Z.id)){let Q=this._byId.get(Z.id);if(Q!==void 0){let z=this._factAt.get(this._facts[Q]);if(this._facts[Q]=Z,z!==void 0)this._factAt.set(Z,z)}}else if(this._facts.push(Z),!f(Z.id))this._byId.set(Z.id,this._facts.length-1);if(Z.timestamp&&Z.timestamp>(this.last_etched||""))this.last_etched=Z.timestamp;return Z}etch($,Z={}){let Q=f(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(zD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:$$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:D2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=e2($)?{...$,...Z}:Z,z=e2($)?$.query:$,X=Z2[$$(Q.minPriority??"ephemeral")]??0,U=typeof z==="string"?z.toLowerCase():"",H=new Set(Q.tags??[]),J=[];this._facts.forEach((V,Y)=>{if(U&&!String(V.text??"").toLowerCase().includes(U))return;if(H.size>0&&![...H].some((W)=>(V.tags??[]).includes(W)))return;if(!f(Q.type)&&V.type!==Q.type)return;if((Z2[V.priority]??1)<X)return;J.push([Y,V])}),J.sort((V,Y)=>{let W=Z2[V[1].priority]??1,B=Z2[Y[1].priority]??1;if(B!==W)return B-W;let K=V[1].timestamp??"",L=Y[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return Y[0]-V[0]});let G=J.map(([,V])=>V);if(!f(Q.limit))return G.slice(0,Q.limit);return G}getFact($){let Z=this._byId.get($);return Z===void 0?null:this._facts[Z]}deleteFact($){let Z=this._byId.get($);if(Z===void 0)return!1;return this._facts.splice(Z,1),this._byId.clear(),this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),!0}}function zD($,Z,Q){let z=(X,U)=>f(X)?U:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:$$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:D2(),extra:{...$.extra}}}class SQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,u$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,u)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,u)??{}),extra:AQ($,l4),memoryExtra:AQ(Z,c4)}}}function AQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function CQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function XD($,Z,Q,z){if(!p(Z))return c$($,Z,Q,z);let X=(U)=>typeof U==="string"?{text:U}:U;return c$($,Z,X(Q),X(z))}import{readdirSync as UD,readFileSync as HD,statSync as EQ,existsSync as JD}from"fs";import{join as GD,basename as bQ,resolve as VD}from"path";var yQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),YD=/\[\[([^\]]+)\]\]/g;function WD($){let Z=EQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function BD($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=v0(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 qD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!M8.has(X))return null;let U=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||U,G={};if(z.originSessionId)G.provenance=[`session:${z.originSessionId}`];let V=[...new Set([...Z.matchAll(YD)].map((Y)=>Y[1]))].sort();return{text:J,id:U,type:X,priority:"standard",tags:[],links:V,timestamp:WD($),source:`claude-code memory: ${bQ($)}`,extra:G}}function xQ($,Z={}){let Q=VD($);if(!JD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!EQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??yQ,X=Z.namepoint??`@claude-code:${bQ(Q)}`,U=[],H=UD(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of H){if(z.has(W))continue;let B=GD(Q,W),K;try{K=HD(B,"utf-8")}catch{continue}let{fm:L,body:q}=BD(K);if(!L)continue;let D=qD(B,q,L);if(D)U.push(D)}let J=U.map((W)=>W.timestamp).filter(Boolean),G=J.length?J.reduce((W,B)=>W<B?W:B):D2(),V=J.length?J.reduce((W,B)=>W>B?W:B):G,Y=new V0(X,{profile:"knowledge",facts:U,created:G});return Y.last_etched=V,Y.rebuildIndex(),Y}var uQ="faf-interview/1",Z$="(terse — 3-4 words)",n4=[{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? ${Z$}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${Z$}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${Z$}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${Z$}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${Z$}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${Z$}`,header:"How",type:"text",required:!0}],fQ=[{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}],Q$=[...n4,...fQ],mQ=new Map(Q$.map(($)=>[$.path,$])),KD=Object.fromEntries(Q$.map(($)=>[$.path,$]));function r4($){let Z=mQ.get($);if(Z)return Z.question;let Q=S0.get($)??m.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function DD($,Z){return Q$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let U of z)if(X&&typeof X==="object"&&U in X)X=X[U];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var LD=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"]),ID=[["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]],gQ=($)=>LD.has($.toLowerCase().trim()),OD=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function vQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&OD.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function pQ($){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=vQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!gQ(X))Z.what=X;let U=ID.filter(([,G])=>G.test(Q)).map(([G])=>G);if(U.length)Z.where=U.slice(0,4).join(", ");let H=Q.match(/\bfor ((?:[A-Za-z][\w./+-]* )?(?:any |all )?(?:developers?|teams?|engineers?|builders?|users?|integrators?)\b[^.,;:—]*)/i),J=vQ((H?.[1]||"").trim().replace(/\s+/g," "));if(J&&!gQ(J))Z.who=J;return Z}function kQ($,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 hQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!s(Z)}function _D($,Z={}){let Q=$&&typeof $==="object"?$:{},z=kQ(Q,"project.goal"),X=(hQ(z)?String(z).trim():"")||(Z.goal??"").trim(),U=pQ(X),H=Z.detailed??{},J={"project.goal":X||void 0,"human_context.what":U.what,"human_context.where":U.where,"human_context.who":U.who},G=(K)=>{let L=J[K];if(L)return{value:L,source:"project goal",confidence:0.9};let q=K.startsWith("human_context.")?K.slice(14):"",D=q?H[q]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},V=n4.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=kQ(Q,K.path);if(hQ(D))return{...q,value:String(D).trim(),status:"filled",seeded:!1};let O=G(K.path);if(O)return{...q,value:O.value,status:"seeded",seeded:!0,source:O.source,confidence:O.confidence};return{...q,value:"",status:"empty",seeded:!1}}),Y=V.filter((K)=>K.status==="filled").length,W=V.filter((K)=>K.status==="seeded").length,B=V.filter((K)=>K.status==="empty").length;return{version:uQ,rows:V,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function P8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||s(Z)}return!1}function MD($,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 lQ($){if($==="project.goal")return!0;return S0.get($)?.category==="human"}function cQ($,Z=P8){let Q=[],z=[];for(let X of Q$){let U=MD($,X.path);if(U==="slotignored")continue;if(!Z(U))continue;(lQ(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function dQ($,Z,Q=P8){let z=cQ(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let U=X==="needs-human"?s4(z):[];return{status:X,score:$,gaps:z,ask:U}}function s4($){return $.human.map((Z)=>({path:Z,question:r4(Z)}))}function PD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??P8,X=[],U=0;for(let J=0;J<=Q;J++){let G=$.read();if(!G)return{status:"no-faf",score:0,rounds:U,history:X,ask:[]};let V=$.score(G.yaml);X.push(V);let Y=dQ(V,G.data,z);if(Y.status==="done")return{status:"done",score:V,rounds:U,history:X,ask:[]};if(Y.status==="needs-human")return{status:"needs-human",score:V,rounds:U,history:X,ask:Y.ask};if(X.length>=2&&V<=X[X.length-2])return Y.gaps.human.length?{status:"needs-human",score:V,rounds:U,history:X,ask:s4(Y.gaps)}:{status:"stuck",score:V,rounds:U,history:X,ask:[]};if(U>=Q)return{status:"capped",score:V,rounds:U,history:X,ask:s4(Y.gaps)};$.runAuto(),U++}return{status:"capped",score:X[X.length-1]??0,rounds:U,history:X,ask:[]}}import{createHash as nQ}from"crypto";var o4="faf-bench/1",ND={"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 RD($,Z){return ND[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var rQ=[["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"]],t$=new Map;rQ.forEach(($,Z)=>$.forEach((Q)=>t$.set(Q,Z)));var FD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function N8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function iQ($){return N8($).split(" ").filter((Z)=>Z&&!FD.has(Z))}function sQ($,Z){let Q=N8($),z=N8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=t$.get(Q);if(X!==void 0&&t$.get(z)===X)return!0;let U=iQ($);if(U.length===0)return!1;let H=new Set(iQ(Z));return U.every((J)=>{if(H.has(J))return!0;let G=t$.get(J);return G!==void 0&&[...H].some((V)=>t$.get(V)===G)})}function TD($){let Z=o8($),Q=v0($),z=[],X={},U=0;for(let G of m){if(Z.slots[G.path]!=="populated")continue;let V=T5(Q,G);if(typeof V!=="string")continue;let Y=V.trim();if(!Y||W6.has(Y.toLowerCase()))continue;U+=1,z.push({n:U,path:G.path,question:RD(G.path,G.description)}),X[U]=Y}let H=JSON.stringify({v:o4,q:z.map((G)=>[G.path,G.question])}),J=nQ("sha256").update(H).digest("hex").slice(0,12);return{version:o4,qsetHash:J,questions:z,answers:X}}function AD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function CD($,Z){let Q=$.questions.map((X)=>{let U=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof U==="string"&&U.trim()!==""&&sQ($.answers[X.n],U)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function jD($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:nQ("sha256").update(Q).digest("hex")}}import{join as $I,extname as ZI,resolve as QI}from"path";var a4={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"Gemfile.lock":{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:34,intelligence:"high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"Package.swift":{frameworks:["Swift"],slots:{packageManager:"spm",mainLanguage:"Swift",buildTool:"swift build"},priority:36,intelligence:"ultra-high"},"*.csproj":{frameworks:["C#",".NET"],slots:{packageManager:"NuGet",mainLanguage:"C#",buildTool:"dotnet"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"settings.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:34,intelligence:"high"},"settings.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:34,intelligence:"high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","Swift"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",backend:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};import{join as SD}from"path";var z$={version:2,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs compose it. Bolster Dart/Flutter by editing THIS file. Logic stays in dart.ts. Refreshed 2026-08-01 (knowledge v2) — community receipt on top of 6.13.0 Dart Edition.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp","dart_mcpserver"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"],["jaspr","Jaspr"],["relic","Relic"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod_annotation","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"],["flutter_hooks","Hooks"]],routing:[["go_router","go_router"],["auto_route","auto_route"],["beamer","Beamer"],["routemaster","Routemaster"]]};var ED=z$.flutterDeps,bD=z$.mcpDeps,yD=z$.serverFrameworks,xD=z$.stateManagement,gD=z$.routing;function vD($){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 R8($){let Z=w($,"pubspec.yaml");if(Z===null)return null;let Q=vD(Z),z=(M)=>Q.has(M.toLowerCase()),X=ED.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),U=bD.find(z),H=yD.find(([M])=>z(M)),J=xD.find(([M])=>z(M)),G=J?J[1]:"",V=gD.find(([M])=>z(M)),Y=V?V[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",B=/^executables:\s*$/m.test(Z),K=(v($,"bin")??[]).some((M)=>M.name.endsWith(".dart")),L=B||K,q,D="",O;if(X)if(D="Flutter",I($,SD("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))q="mobile",O="pubspec.yaml (Flutter app)";else q="library",O="pubspec.yaml (Flutter package)";else if(U)q="mcp",O=`pubspec.yaml + ${U} (Dart MCP server)`;else if(H)q="backend",D=H[1],O=`pubspec.yaml + ${H[0]} (Dart backend)`;else if(L)q="cli",O=B?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else q="library",O="pubspec.yaml (Dart package)";return{appType:q,isFlutter:X,framework:D,stateManagement:G,routing:Y,testing:W,found:O}}import{join as hD}from"path";var F8={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 uD=F8.mcpModules,fD=F8.serverFrameworks,mD=F8.cliFrameworks;function pD($){let Z=new Set,Q=!1;for(let z of $.split(`
252
+ `)){let X=z.replace(/\/\/.*$/,"").trim();if(!X)continue;if(/^require\s*\(\s*$/.test(X)){Q=!0;continue}if(Q){if(X===")"){Q=!1;continue}let H=X.match(/^(\S+)/);if(H)Z.add(H[1].toLowerCase());continue}let U=X.match(/^require\s+(\S+)/);if(U&&U[1]!=="(")Z.add(U[1].toLowerCase())}return Z}function aQ($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function oQ($,Z){let Q;for(let z of Z){if(!aQ($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function lD($,Z){let Q;for(let z of Z){if(!aQ($,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 dD($){for(let{name:Z}of v($,"cmd")??[]){let Q=hD("cmd",Z),z=D0($,Q);if(z?.isDirectory()){if((v($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function iD($){let Z=w($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function T8($){let Z=w($,"go.mod");if(Z===null)return null;let Q=cD(Z),z=pD(Z),X=lD(z,uD),U=oQ(z,fD),H=oQ(z,mD),J=dD($),G=iD($),V,Y="",W;if(X)V="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(U)V="backend",Y=U[1],W=`go.mod + ${U[0]} (Go backend)`;else if(H)V="cli",Y=H[1],W=`go.mod + ${H[0]} (Go CLI)`;else if(J)V="cli",W="go.mod + cmd/ (Go CLI layout)";else if(G&&!U)V="cli",W="go.mod + main.go package main (Go CLI)";else V="library",W="go.mod (Go module)";return{appType:V,modulePath:Q,framework:Y,found:W}}var L2={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 rD=L2.mcpPackages.map(($)=>$.toLowerCase()),sD=L2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),oD=L2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),aD=L2.grpcServerPackages.map(($)=>$.toLowerCase()),tD=L2.specializedSdks,tQ=L2.baseSdk.toLowerCase();function eD($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),U=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],J=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||U||"").trim(),G=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),V=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),Y=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),B=new Set;for(let L of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());for(let L of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(L[1].toLowerCase());let K=new Set;for(let L of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))K.add(L[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:J,isTestProject:G,useMaui:V,useWpf:Y,useWindowsForms:W,packages:B,frameworkRefs:K}}function t4($,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 eQ($,Z){let Q;for(let[z,X]of Z){if(!t4($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function $L($){let Z;for(let Q of rD){if(!t4($,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 ZL($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of tD){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function A8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function QL($,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 zL($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:U,outputType:H}=$,J,G="",V,Y=$L(X),W=ZL(z),B=eQ(X,oD),K=eQ(X,sD),L=aD.some((D)=>t4(X,D)),q=U.has("microsoft.aspnetcore.app");if(Y)J="mcp",G="MCP",V=`${Z} + ${Y} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||B)J="library",G=B?.[1]||(W?.[1]==="test"?W[2]:"Test"),V=`${Z} + test (${G})`;else if($.useMaui)J="mobile",G="MAUI",V=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)J="backend",G=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",V=`${Z} + ${G}`;else if(W?.[1]==="web")J="backend",G=L?"gRPC":W[2],V=`${Z} + Sdk=${W[0]}${L?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")J="backend",G=W[2],V=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")J="library",G=W[2],V=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(q&&A8(H))J="backend",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!A8(H))J="library",G="ASP.NET Core",V=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(A8(H)||!H))J="cli",G=K[1],V=`${Z} + ${K[0]} (C# CLI)`;else if(A8(H))J="cli",V=`${Z} + OutputType=Exe (C# console)`;else{J="library";let D=z?` Sdk=${z}`:"";if(V=`${Z}${D} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===tQ||z.toLowerCase().startsWith(`${tQ}/`))V=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:G,found:V}}function X$($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function C8($){let Z=X$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let U=w($,X);if(U===null)continue;let H=eD(U),J=zL(H,X),G=QL(J.appType,J.framework);if(!Q||G<z)Q=J,z=G}return Q}import{join as I2}from"path";var I0={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 UL=I0.mcpArtifacts.map(($)=>$.toLowerCase()),HL=I0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),JL=I0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),GL=I0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),rR=I0.androidPlugins.map(($)=>$.toLowerCase()),VL=I0.kmpPlugins.map(($)=>$.toLowerCase()),YL=I0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),WL=I0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),BL=I0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),qL=I0.libraryPlugins.map(($)=>$.toLowerCase()),KL=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function e4($){return KL.some((Z)=>I($,Z))}function DL($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
253
+ `)){let U=X.replace(/#.*$/,"").trim();if(!U)continue;let H=U.match(/^\[([^\]]+)\]$/);if(H){z=H[1].trim().toLowerCase();continue}let J=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(J&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(J[1].replace(/-/g,".").toLowerCase(),J[2].toLowerCase()),Z.set(J[1].toLowerCase(),J[2].toLowerCase());continue}let G=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(G&&(z==="libraries"||z.endsWith(".libraries"))){let W=G[1].toLowerCase();Q.set(W,G[2].toLowerCase()),Q.set(W.replace(/-/g,"."),G[2].toLowerCase());continue}let V=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${V[2]}:${V[3]}`.toLowerCase(),B=V[1].toLowerCase();Q.set(B,W),Q.set(B.replace(/-/g,"."),W);continue}let Y=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(Y){let W=Y[1].toLowerCase(),B=Y[2];if(z==="plugins"||z.endsWith(".plugins")){let K=B.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=B.split(":");if(K.length>=2){let L=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,L),Q.set(W.replace(/-/g,"."),L)}}}}return{plugins:Z,libraries:Q}}function LL($){let Z=w($,I2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return DL(Z)}function IL($){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 OL($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let U=X.replace(/\/\/.*$/,"").trim();if(!U||U.startsWith("id")||U.startsWith("kotlin")||U.startsWith("alias"))continue;let H=U.match(/^`([a-zA-Z0-9.-]+)`$/)||U.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(H)Q.add(H[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),U=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(U)Q.add(U);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function _L($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let U=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let H of U){let J=Z.libraries.get(H);if(J){Q.add(J.includes(":")?J.split(":").slice(0,2).join(":"):J);break}}}return Q}function Q3($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,z=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(z){let H=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),J=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(H&&J)Q.add(`${H}:${J}`.toLowerCase())}let X=new Set;for(let H of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let J=H[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),G=H[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&G)X.add(`${J}:${G}`.toLowerCase())}let U=[];for(let H of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))U.push(H[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:U}}function k0($,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 e$($,Z,Q){let z;for(let[X,U]of Z){let H=!1;if(Q==="plugin")H=k0($,X);else if(H=$.has(X)||[...$].some((J)=>J===X||J.startsWith(`${X}:`)||J.startsWith(`${X}.`)),!H&&Q==="artifact")H=[...$].some((J)=>J===X||J.startsWith(`${X}`));if(!H)continue;if(!z||X.length>z[0].length)z=[X,U]}return z}function ML($){let Z;for(let Q of UL)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 z3($,Z){let Q=new Set,z=!1,X=!1,U=[I2(Z,"src"),I2(Z,"src","main")],H=(J,G)=>{if(G>4)return;let V=v($,J);if(!V)return;for(let{name:Y}of V){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=I2(J,Y),B=D0($,W);if(!B)continue;if(B.isDirectory())H(W,G+1);else if(Y.endsWith(".kt")||Y.endsWith(".kts"))z=!0;else if(Y.endsWith(".java"))X=!0}};for(let J of U)H(J,0);return{kotlin:z,java:X,hints:Q}}function PL($){let Z=[],Q=$.plugins,z=$.artifacts,X=VL.some((R)=>k0(Q,R))||$.sourceHints.has("commonMain"),U=k0(Q,"com.android.application"),H=k0(Q,"com.android.library")||k0(Q,"com.android.kotlin.multiplatform.library");if(U||H)Z.push("android");if(X)Z.push("multiplatform");let J=ML(z),G=e$(Q,HL,"plugin"),V=e$($.parents,JL,"parent"),Y=e$(z,GL,"artifact"),W=e$(Q,WL,"plugin"),B=e$(z,BL,"artifact"),K=qL.some((R)=>k0(Q,R)),L=$.packaging==="pom",q,D="",O;if(U)q="mobile",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + com.android.application (${D})`;else if(J)q="mcp",D="MCP",Z.push("mcp"),O=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(G||V||Y){q="backend",D=G?.[1]||V?.[1]||Y?.[1]||"JVM";let R=G?.[0]||V?.[0]||Y?.[0]||"web";O=`${$.path||"root"} + ${R} (JVM backend)`}else if(X&&!H)q="library",D="Kotlin Multiplatform",O=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(H)q="library",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)q="cli",D=B?.[1]||"application",O=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)q="cli",D="application",O=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)q="library",O=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{q="library";let R=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(O=`${$.path||"root"} (${R} library)`,K)O=`${$.path||"root"} + java-library (JVM library)`}let M="Java";if($.kotlinSources&&$.javaSources)M="Java/Kotlin";else if($.kotlinSources||YL.some((R)=>k0(Q,R))||X)M="Kotlin";let F=[...new Set(Z)];return{appType:q,framework:D,facets:F,found:O,buildTool:$.buildTool,mainLanguage:M}}function NL($,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 $3($,Z,Q){let z=I2(Z,"build.gradle.kts"),X=I2(Z,"build.gradle"),U=I($,z)?z:I($,X)?X:null;if(!U)return null;let H=w($,U);if(!H)return null;let J=OL(H,Q),G=_L(H,Q),V=z3($,Z),Y=/mainClass\s*[.=]/.test(H)||/mainClassName\s*=/.test(H)||/Main-Class/.test(H),W=k0(J,"application")||k0(J,"org.gradle.application");return{path:Z||"build.gradle",plugins:J,artifacts:G,packaging:"jar",parents:new Set,hasMainClass:Y,hasApplicationPlugin:W,sourceHints:V.hints,kotlinSources:V.kotlin||U.endsWith(".kts"),javaSources:V.java,buildTool:"gradle"}}function Z3($,Z){let Q=w($,I2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:U}=Q3(Q),H=z3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:U,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:H.hints,kotlinSources:H.kotlin,javaSources:H.java,buildTool:"maven"}}function $6($){if(!e4($))return null;let Z=LL($),Q=[],z=null;for(let V of["settings.gradle.kts","settings.gradle"])if(I($,V)){z=w($,V);break}let X=z?IL(z):[],U=$3($,"",Z);if(U)Q.push(U);for(let V of X){let Y=$3($,V,Z);if(Y)Q.push(Y)}let H=Z3($,"");if(H){Q.push(H);let V=w($,"pom.xml");if(V){let{modules:Y}=Q3(V);for(let W of Y){let B=Z3($,W);if(B)Q.push(B)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let J=null,G=999;for(let V of Q){let Y=PL(V),W=NL(Y.appType,Y.facets);if(!J||W<G)J={appType:Y.appType,framework:Y.framework,buildTool:Y.buildTool,mainLanguage:Y.mainLanguage,facets:Y.facets,found:Y.found},G=W}if(J&&X.length>0&&!J.found.includes("multi-project"));return J}import{join as FL}from"path";var Z6={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 TL=Z6.mcpGems.map(($)=>$.toLowerCase()),AL=Z6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),X3=Z6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),CL=Z6.railsLayoutFiles;function jL($){return I($,"Gemfile")||I($,"gems.rb")||wL($)}function wL($){return(v($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function SL($){let Z=new Set;for(let Q of $.split(`
254
+ `)){let z=Q.replace(/#.*$/,"").trim();if(!z)continue;let X=z.match(/^\s*gem\s+['"]([^'"]+)['"]/i)||z.match(/^\s*gem\s+:([A-Za-z0-9_.-]+)/i);if(X)Z.add(X[1].toLowerCase())}return Z}function EL($){let Z=new Set,Q=!1;for(let z of $.split(`
255
+ `)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let U=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(U)Z.add(U[1].toLowerCase())}}return Z}function bL($){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 yL($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let U=w($,X);if(U){for(let H of SL(U))Z.add(H);Q.push(X)}}let z=w($,"Gemfile.lock")||w($,"gems.locked");if(z){for(let X of EL(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let U=w($,X);if(U){for(let H of bL(U))Z.add(H);Q.push(X)}}return{gems:Z,sources:Q}}function Q6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function $5($,Z){let Q;for(let[z,X]of Z){if(!Q6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function xL($){let Z;for(let Q of TL)if(Q6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function U3($){for(let Z of CL)if(I($,Z))return Z;return}function gL($,Z){let Q=$5(Z,X3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let U=w($,X);if(U&&/executables\s*=/.test(U)&&!/executables\s*=\s*\[\s*\]/.test(U))return{hit:!0,why:`${X} executables`}}let z=v($,"bin");if(z){let U=z.map((H)=>H.name).filter((H)=>{if(H==="setup"||H==="console"||H==="rake")return!1;return D0($,FL("bin",H))?.isFile()===!0}).filter((H)=>H!=="rails");if(U.length>0&&!Q6(Z,"rails")&&!U3($))return{hit:!0,why:`bin/${U[0]}`}}return{hit:!1,why:""}}function j8($){if(!jL($))return null;let{gems:Z,sources:Q}=yL($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",U=xL(Z),H=$5(Z,AL),J=U3($),G=Q6(Z,"rails")||Q6(Z,"railties"),V=gL($,Z),Y=I($,"config.ru"),W=G||!!J,B=H&&H[1]!=="Rails"&&!(H[0]==="rack"&&!Y)?H:void 0,K,L="",q;if(U)K="mcp",L="MCP",q=`${z} + gem ${U} (Ruby MCP)`;else if(W)if(K="backend",L="Rails",G&&J)q=`${z} + rails + ${J} (Rails)`;else if(G)q=`${z} + gem rails (Rails)`;else q=`${J} (Rails layout)`;else if(B)K="backend",L=B[1],q=`${z} + gem ${B[0]} (Ruby backend)`;else if(V.hit)K="cli",L=$5(Z,X3)?.[1]||"",q=`${z} + ${V.why} (Ruby CLI)`;else K="library",q=`${z} (Ruby library)`;return{appType:K,framework:L,packageManager:X,found:q}}import{join as kL}from"path";var A0={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 hL=A0.mcpPackageUrls.map(($)=>$.toLowerCase()),uL=A0.mcpProducts.map(($)=>$.toLowerCase()),fL=A0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),mL=A0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),pL=A0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),lL=A0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),cL=A0.appProductTypes,dL=A0.cliProductTypes,iL=A0.vaporLayoutFiles;function nL($){return I($,"Package.swift")||Z5($).length>0}function Z5($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&D0($,Z)?.isDirectory()===!0)}function rL($){let Z=sL($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,U;while((U=X.exec(Z))!==null)z.push(U[1]);let H=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((U=H.exec(Z))!==null)z.push(U[1]);let J=[],G=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((U=G.exec(Z))!==null)J.push(U[1]);let V=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((U=V.exec(Z))!==null)J.push(U[1]);let Y=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),B=/\.plugin\s*\(/.test(Q)&&!Y&&!W?!0:/\bproducts\s*:\s*\[[\s\S]*?\.plugin\s*\(/.test(Q),K=/\.executabletarget\s*\(/.test(Q),L=/\.target\s*\(/.test(Q)&&!K?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:z,productNames:J,hasLibraryProduct:Y,hasExecutableProduct:W,hasPluginProduct:!!B,hasExecutableTarget:K,hasLibraryTarget:L}}function sL($){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 oL($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z.length))z=X;return z}function H3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)for(let H of Q)if(H.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function J3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function aL($){let Z=$.map((Q)=>Q.toLowerCase());return uL.some((Q)=>Z.includes(Q))}function tL($){let Z=!1,Q=!1,z;for(let X of Z5($)){let U=w($,kL(X,"project.pbxproj"));if(!U)continue;for(let H of cL)if(U.includes(H))Z=!0,z=H;for(let H of dL)if(U.includes(H)){if(Q=!0,!z)z=H}}return{hasApplication:Z,hasTool:Q,hit:z}}function eL($){for(let Z of iL)if(I($,Z))return Z;return}function z6($){if(!nL($))return null;let Z=I($,"Package.swift"),Q=Z5($),z=Q.length>0,X=null;if(Z){let N=w($,"Package.swift");if(N)X=rL(N)}let U=z?tL($):{hasApplication:!1,hasTool:!1},H=eL($),J=X?.packageUrls??[],G=X?.productNames??[],V=oL(J,hL),Y=aL(G),W=H3(J,fL),B=J3(G,mL),K=H3(J,pL),L=J3(G,lL),q=!!(V||Y),D=!!(W||B||H),O=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),M=!!(K||L),F=U.hasApplication,R=Z&&z?"spm+xcode":Z?"spm":"xcode",T,A="",j;if(q)if(T="mcp",A="MCP",Y)j="Package.swift + product MCP (Swift MCP)";else j=`Package.swift + ${V} (Swift MCP)`;else if(D)if(T="backend",A=B?.[1]||W?.[1]||(H?"Vapor":""),B)j=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)j=`Package.swift + ${W[1]} (Swift backend)`;else j=`${H} (Swift backend layout)`;else if(F)T="app",A="",j=`${Q[0]} + ${U.hit||"application"} (Swift app)`;else if(M||O&&!D&&!q)if(T="cli",A=L?.[1]||K?.[1]||"",L)j=`Package.swift + product ${L[1]} (Swift CLI)`;else if(K)j=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)j="Package.swift + .executable product (Swift CLI)";else j="Package.swift + .executableTarget (Swift CLI)";else if(U.hasTool&&!Z)T="cli",j=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(T="library",X?.hasLibraryProduct)j="Package.swift + .library product (Swift library)";else j="Package.swift (Swift library)";else T="library",j=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:T,framework:A,packageManager:R,found:j}}var zI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),XI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),UI={mainLanguage:["project","main_language"],main_language:["project","main_language"],framework:["stack","frontend"],cssFramework:["stack","css_framework"],css:["stack","css_framework"],uiLibrary:["stack","ui_library"],ui_library:["stack","ui_library"],stateManagement:["stack","state_management"],state:["stack","state_management"],backend:["stack","backend"],apiType:["stack","api_type"],api:["stack","api_type"],runtime:["stack","runtime"],database:["stack","database"],db:["stack","database"],connection:["stack","connection"],hosting:["stack","hosting"],buildTool:["stack","build"],build_tool:["stack","build"],build:["stack","build"],packageManager:["stack","package_manager"],pkg_manager:["stack","package_manager"],cicd:["stack","cicd"]},HI=[["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 JI($,Z){for(let[Q,z]of HI)if(Q in $)return z;return Z.length>0?"framework":"config"}function GI($,Z){try{let Q=JSON.parse(w($,Z)??""),z=["background","content_scripts","action","browser_action","permissions"].some((X)=>(X in Q));if(typeof Q.manifest_version==="number"&&z)return"chrome";return"other"}catch{return"other"}}function VI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return D0($,Z.name)?.isFile()===!0}function YI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return D0($,Z.name)?.isDirectory()===!0}function WI($){let Z=[],Q=QI($),z=new Set,X=v(Q);if(!X)return Z;for(let U of X){let H=U.name;if(H.endsWith(".xcodeproj")?!YI(Q,U):!VI(Q,U))continue;if(H.toLowerCase().endsWith(".csproj")){let G=C8(Q);if(G){let V={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile"&&G.framework)V.framework=G.framework;if(G.targetFramework)V.runtime=G.targetFramework;let Y=G.framework?[G.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:V,priority:36,frameworks:Y,fileName:H})}continue}if(H.endsWith(".xcodeproj")){let G=z6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="spm"?"spm":"Xcode",buildTool:G.packageManager.includes("spm")?"swift build":"xcodebuild"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:36,frameworks:Y,fileName:H})}continue}let J=a4[H];if(!J)continue;if(H==="manifest.json"&&GI(Q,H)!=="chrome")continue;if(H==="pubspec.yaml"){let G=R8(Q);if(G){let V={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(V.framework="Flutter",G.stateManagement)V.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="mcp")V.apiType="MCP";Z.push({slots:V,priority:J.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:H});continue}}if(H==="go.mod"){let G=T8(Q);if(G){let V={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Go"]:["Go"];Z.push({slots:V,priority:J.priority,frameworks:Y,fileName:H});continue}}if(H==="Gemfile"||H==="Gemfile.lock"||H==="gems.rb"){let G=j8(Q);if(G){let V={mainLanguage:"Ruby",packageManager:G.packageManager};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Ruby"]:["Ruby"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:H});continue}}if(H==="Package.swift"){let G=z6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:J.priority??36,frameworks:Y,fileName:H});continue}}if(H==="pom.xml"||H==="build.gradle"||H==="build.gradle.kts"||H==="settings.gradle"||H==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let G=$6(Q);if(G){let V={mainLanguage:G.mainLanguage==="Java/Kotlin"?"Kotlin":G.mainLanguage,packageManager:G.buildTool==="maven"?"maven":"gradle",buildTool:G.buildTool};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile")V.framework=G.framework||"Android";if(G.facets.includes("multiplatform"))V.framework=G.framework||"Kotlin Multiplatform";let Y=G.framework?[G.framework,"JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:H});continue}}Z.push({slots:J.slots||{},priority:J.priority,frameworks:J.frameworks,fileName:H})}return Z}function BI($){let Z=[];for(let Q of n2($,()=>V3($,2,{count:0}))){let z=a4[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function G3($){let Z=[...WI($),...BI($)],Q={},z={},X=new Set;for(let V of Z){V.frameworks.forEach((Y)=>X.add(Y));for(let[Y,W]of Object.entries(V.slots))if(W&&!W.includes("/")&&(!(Y in Q)||V.priority>z[Y]))Q[Y]=W,z[Y]=V.priority}let U=new Map;for(let V of Z){if(!V.fileName)continue;if(!U.has(V.fileName))U.set(V.fileName,{fileName:V.fileName,category:JI(V.slots,V.frameworks),priority:V.priority})}let H=[...U.values()].sort((V,Y)=>Y.priority-V.priority||V.fileName.localeCompare(Y.fileName)),J=[];if(Q.mainLanguage)J.push(Q.mainLanguage.toLowerCase());if(Q.framework)J.push(Q.framework.toLowerCase());let G=J.length>0?J.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:H,stackSignature:G}}function w8($){let{slotFills:Z}=G3($),Q={};for(let[z,X]of Object.entries(Z)){let U=UI[z];if(!U||!X)continue;let[H,J]=U;if(H==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function V3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=v($);if(!X)return z;for(let U of X){if(Q.count++>400)break;if(!U.isDirectory()){let H=ZI(U.name);if(XI.has(H))z.add(H);continue}if(zI.has(U.name)||U.name.startsWith("."))continue;for(let H of V3($I($,U.name),Z-1,Q))z.add(H)}return z}var t=($,Z,Q)=>({value:$,source:Z,confidence:Q});function Y3($,Z={}){let Q=Z.toolingRoot?null:qI($),z=KI($),X={},U=(H,J)=>{if(J)X[H]=J};return U("what",II(Q,z)),U("who",OI(z)),U("why",_I(z)),U("where",MI(Q,z)),U("when",PI(z)),U("how",NI(Q,z)),X}function S8($,Z={}){let Q=Y3($,Z),z={};return Object.keys(Q).forEach((X)=>{let U=Q[X];if(U)z[X]=U.value}),z}function qI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function KI($){let Z=w($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
258
258
  `).filter((Q)=>!/^\s*\[!\[/.test(Q)&&!/^\s*!\[/.test(Q)).join(`
259
- `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function I2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function qI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function X$($,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||qI(z[2])>0.4)return null;return{body:I2(z[2]),heading:z[1].trim()}}function KI($){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 Q6($,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 DI($,Z){if($?.description&&$.description.length>20)return t(I2($.description),"package.json:description",0.95);let Q=X$(Z,"Purpose|What|About|Overview|Description");if(Q)return t(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("#")&&!KI(H));if(z)return t(I2(z),"README:first-paragraph",0.5);let X=Q6(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?t(X,"README:problem-heuristic",0.6):null}function LI($){let Z=X$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return t(Z.body,`README:## ${Z.heading}`,0.8);let Q=Q6($,[/\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?t(Q,"README:audience-heuristic",0.6):null}function II($){let Z=X$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return t(Z.body,`README:## ${Z.heading}`,0.8);let Q=Q6($,[/(?: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?t(Q,"README:mission-heuristic",0.6):null}function OI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return t(I2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return t(I2($.homepage),"package.json:homepage",0.9);let z=Q6(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?t(z,"README:deploy-heuristic",0.6):null}function _I($){let Z=X$($,"Timeline|Status|Release|Roadmap");if(Z)return t(Z.body,`README:## ${Z.heading}`,0.8);let Q=Q6($,[/\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?t(Q,"README:since-heuristic",0.6):null}function MI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return t(I2(z.map((U)=>`npm run ${U}`).join(", ")),"package.json:scripts",0.9);let X=X$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return t(X.body,`README:## ${X.heading}`,0.8);let H=X$(Z,"Architecture|Approach|How it works|Methodology|How");return H?t(H.body,`README:## ${H.heading}`,0.7):null}var V3="3.0";import{join as Y3}from"path";var G3=[{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 PI($){let Z=w($,"Cargo.toml");if(Z===null)return null;let Q=Z.match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return Q?Q[1]:null}function NI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function RI($,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=PI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function FI($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let Q of Z){let z=w($,Q);if(z===null)continue;try{let X=JSON.parse(z);if(typeof X.manifest_version==="number")return`${Q} manifest_version ${X.manifest_version} (browser extension)`}catch{}}return null}function TI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=w($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=w($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function AI($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of Q)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(I($,"ios")&&I($,"android"))return"ios/ + android/ dirs";return null}function CI($,Z){let Q=w($,"Cargo.toml");if(Q!==null){if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(Q))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(Q))return"Cargo.toml wasm-bindgen/wasm-pack"}let z=w($,"build.zig");if(z!==null&&/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(z))return"build.zig wasm target";if(Z?.keywords?.some((X)=>/^wasm(?:-|$)|webassembly/i.test(X)))return'package.json keywords contains "wasm"';return null}function jI($,Z){if(!I($,"index.html"))return null;if(Z?.dependencies||Z?.devDependencies){let Q={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((X)=>Q[X]))return null}return"index.html (vanilla, no frontend framework)"}function wI($,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 SI($,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 EI($,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 bI($,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 yI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var xI=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"]),W3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,gI=new Set(["frontend","backend","database","css","ui","state"]);function vI($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||S8($,"requirements*.txt"))return!0;if(I($,"go.mod"))return!0;if(I($,"Cargo.toml"))return!0;if(I($,"Gemfile"))return!0;if(I($,"pom.xml")||S8($,"build.gradle*"))return!0;if(z$($).length>0)return!0;let Z=O0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function E8($){return i2($,()=>kI($))}function kI($){let Z=v($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||xI.has(z.name))continue;let X=Y3($,z.name);if(!vI(X))continue;let H=y8(X);if(!H)continue;let U=b8(X).filter((Y)=>gI.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||W3.test(H),hasFramework:!!G,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function hI($,Z){if(Z?.workspaces||I($,"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 B3($){let Z=E8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(W3.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 O0($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function S8($,Z){if(!Z.includes("*"))return I($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(v($)??[]).some((V)=>V.name.startsWith(J))}let z=Y3(...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";return(v($,z)??[]).some((J)=>J.name.startsWith(H)&&J.name.endsWith(U))}function uI($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return S8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!S8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function b8($){let Z=O0($);return G3.map((Q)=>{let X=Q.signals.filter((H)=>uI(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 y8($){let Z=O0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(I($,"tsconfig.json"))return"TypeScript";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(z$($).length>0)return"C#";if(I($,"pyproject.toml")||I($,"setup.py"))return"Python";if(I($,"Gemfile"))return"Ruby";if(o4($)){let Q=t$($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(I($,"Package.swift"))return"Swift";if(I($,"build.zig"))return"Zig";if(I($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function q3($){let Z=O0($),Q=b8($),z=[],X=wI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=RI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=FI($);if(U)return z.push(U),{type:"extension",found:z};let J=bI($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let V=EI($,Z);if(V)return z.push(V),{type:"saas",found:z};let G=CI($,Z);if(G)return z.push(G),{type:"wasm",found:z};let Y=N8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=F8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=A8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=t$($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=C8($);if(L)return z.push(L.found),{type:L.appType,found:z};let q=Z6($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=AI($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((g)=>g.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(NI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(I($,"build.zig")){if(z.push("build.zig"),I($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(I($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let M=Q.some((g)=>g.slug==="svelte"||g.slug==="sveltekit");if(Z?.private===!0&&(I($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&M)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(M)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let R=Q.some((g)=>g.category==="frontend"),T=Q.some((g)=>g.category==="backend");if(Z?.private&&(Z.workspaces||I($,"pnpm-workspace.yaml"))&&R&&T)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let A=yI($,Z);if(A)return z.push(A),{type:"monorepo-root",found:z};let j=SI($,Z,Q);if(j)return z.push(j),{type:"website",found:z};if(Q.some((g)=>g.slug==="nextjs"||g.slug==="nuxt"))return z.push(Q.find((g)=>g.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let S=Q.some((g)=>g.category==="frontend"),i=Q.some((g)=>g.category==="backend");if(S&&i)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(S)return z.push("frontend framework"),{type:"frontend",found:z};if(i)return z.push("backend framework"),{type:"backend",found:z};let e=TI($);if(e)return z.push(e),{type:"data-science",found:z};let _=jI($,Z);if(_)return z.push(_),{type:"html",found:z};let b=hI($,Z);if(b)return z.push(b),{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 K3($){if(I($,"bunfig.toml"))return"Bun";if(I($,"deno.json")||I($,"deno.jsonc"))return"Deno";if(O0($))return"Node.js";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(z$($).length>0)return".NET";if(I($,"pubspec.yaml"))return"Dart";return""}var fI=new Set(["npm","pnpm","yarn","bun"]);function mI($){let Z=O0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return fI.has(Q)?Q:""}function pI($){if(I($,"pubspec.yaml"))return"pub";if(I($,"go.mod"))return"go modules";if(z$($).length>0)return"NuGet";if(I($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>I($,Q))?"gradle":""}var lI=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function D3($){return pI($)||mI($)||(lI.find(([Z])=>I($,Z))?.[1]??"")}function L3($){if(I($,".github/workflows"))return"GitHub Actions";if(I($,".gitlab-ci.yml"))return"GitLab CI";if(I($,".circleci"))return"CircleCI";if(I($,"Jenkinsfile"))return"Jenkins";return null}function I3($){if(I($,"vercel.json"))return"Vercel";if(I($,"netlify.toml"))return"Netlify";if(I($,"wrangler.toml"))return"Cloudflare";if(I($,"fly.toml"))return"Fly.io";if(I($,"render.yaml"))return"Render";return null}function O3($){let Z=w($,"svelte.config.js");if(Z===null)return null;let Q=Z.match(/@sveltejs\/adapter-(\w+)/);if(Q){let z=Q[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}function _3($){let Z=O0($);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(I($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function x8($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>I($,Q))}function g8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=I($,"bun.lock")||I($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(I($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&cI($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(e4($,"build.zig")))Q.test="zig build test"}if(I($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&dI($))Q.test="pytest";return Q}function e4($,Z){return w($,Z)??""}function cI($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(e4($,"Cargo.toml"))}function dI($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(e4($,Z)))}function M3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let H=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let U of Q)if(H.has(U.category))X.push(U.name);if(I($,"bunfig.toml"))X.push("Bun");else if(I($,"deno.json")||I($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let U=Object.keys(Z.dependencies).slice(0,5);for(let J of U)if(!X.some((V)=>V.toLowerCase().includes(J.toLowerCase())))X.push(J)}return X}function iI($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function P3($){return $5($).data}function $5($){let Z=O0($),Q=b8($),z=q3($),X=z.type,H=z.found.some((y)=>y.startsWith("polyglot:")),U=H&&B3($)||y8($),J=K3($),V=D3($),G=L3($),Y=I3($),W=_3($),B=Q.find((y)=>y.category==="frontend"),K=Q.find((y)=>y.category==="css"),L=Q.find((y)=>y.category==="ui"),q=Q.find((y)=>y.category==="state"),D=Q.find((y)=>y.category==="backend"),O=Q.find((y)=>y.category==="database"),M=(y)=>C2(X,y)??C2("library",y)===!0,F=X==="framework",R=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit"),T=F&&R?"svelte":F?null:null,A=X==="svelte"||T==="svelte",j=A?O3($):null,N=A&&Q.some((y)=>y.slug==="sveltekit"),S={},i=m.filter((y)=>y.path.startsWith("stack."));for(let y of i){let k=y.path.replace("stack.","");switch(k){case"frontend":S[k]=B?.name??"";break;case"css_framework":S[k]=K?.name??"";break;case"ui_library":S[k]=L?.name??"";break;case"state_management":S[k]=q?.name??(A&&iI(Z)>=5?"Runes":"");break;case"backend":S[k]=A?N?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":S[k]=N?"Server Routes":"";break;case"runtime":S[k]=J;break;case"database":S[k]=O?.name??"";break;case"connection":S[k]=O?.name??"";break;case"hosting":if(A&&j)S[k]=j;else S[k]=Y??"";break;case"build":S[k]=N?"Vite":W??"";break;case"cicd":S[k]=G??"";break;case"package_manager":S[k]=V;break;default:S[k]="";break}}let e={};for(let y of i){let k=y.path.replace("stack.","");e[k]=M(y)?S[k]:"slotignored"}let _={},b=m.filter((y)=>y.path.startsWith("monorepo."));for(let y of b){let k=y.path.replace("monorepo.","");if(!M(y))_[k]="slotignored";else _[k]=""}let g={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(F&&T)g.framework=T;let Y0=M3($,Z,Q,H?y8($):U);if(H){for(let y of E8($))for(let k of[y.language,y.topFramework])if(k&&!Y0.includes(k))Y0.push(k)}let M5=x8($),P5=g8($,Z),V6={faf_version:V3,project:g,stack:e,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:_,_meta:{found:z.found}};if(Y0.length>0)V6.tech_stack=Y0;if(M5.length>0)V6.key_files=M5;if(Object.keys(P5).length>0)V6.commands=P5;return{data:V6,facts:S}}var N3={MIN_LENGTH:8,MAX_LENGTH:280},nI=[/^(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<N3.MIN_LENGTH)return!1;if(Z.length>N3.MAX_LENGTH)return!1;if(nI.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
- `).length>4)return!1;return!0}function rI($){let Z=$.split(`
259
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function O2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function DI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function U$($,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||DI(z[2])>0.4)return null;return{body:O2(z[2]),heading:z[1].trim()}}function LI($){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 X6($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return O2(X[1])}return null}function II($,Z){if($?.description&&$.description.length>20)return t(O2($.description),"package.json:description",0.95);let Q=U$(Z,"Purpose|What|About|Overview|Description");if(Q)return t(Q.body,`README:## ${Q.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((U)=>U.replace(/\s+/g," ").trim()).find((U)=>U.length>30&&!U.startsWith("#")&&!LI(U));if(z)return t(O2(z),"README:first-paragraph",0.5);let X=X6(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?t(X,"README:problem-heuristic",0.6):null}function OI($){let Z=U$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return t(Z.body,`README:## ${Z.heading}`,0.8);let Q=X6($,[/\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?t(Q,"README:audience-heuristic",0.6):null}function _I($){let Z=U$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return t(Z.body,`README:## ${Z.heading}`,0.8);let Q=X6($,[/(?: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?t(Q,"README:mission-heuristic",0.6):null}function MI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return t(O2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return t(O2($.homepage),"package.json:homepage",0.9);let z=X6(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?t(z,"README:deploy-heuristic",0.6):null}function PI($){let Z=U$($,"Timeline|Status|Release|Roadmap");if(Z)return t(Z.body,`README:## ${Z.heading}`,0.8);let Q=X6($,[/\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?t(Q,"README:since-heuristic",0.6):null}function NI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((H)=>Q.includes(H));if(z.length)return t(O2(z.map((H)=>`npm run ${H}`).join(", ")),"package.json:scripts",0.9);let X=U$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return t(X.body,`README:## ${X.heading}`,0.8);let U=U$(Z,"Architecture|Approach|How it works|Methodology|How");return U?t(U.body,`README:## ${U.heading}`,0.7):null}var W3="3.0";import{join as q3}from"path";var B3=[{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 RI($){let Z=w($,"Cargo.toml");if(Z===null)return null;let Q=Z.match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return Q?Q[1]:null}function FI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function TI($,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=RI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function AI($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let Q of Z){let z=w($,Q);if(z===null)continue;try{let X=JSON.parse(z);if(typeof X.manifest_version==="number")return`${Q} manifest_version ${X.manifest_version} (browser extension)`}catch{}}return null}function CI($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,Q=w($,"pyproject.toml");if(Q!==null){let X=Q.match(Z);if(X)return`pyproject.toml depends on ${X[1]}`}let z=w($,"requirements.txt");if(z!==null){let X=z.match(Z);if(X)return`requirements.txt contains ${X[1]}`}return null}function jI($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of Q)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(I($,"ios")&&I($,"android"))return"ios/ + android/ dirs";return null}function wI($,Z){let Q=w($,"Cargo.toml");if(Q!==null){if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(Q))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(Q))return"Cargo.toml wasm-bindgen/wasm-pack"}let z=w($,"build.zig");if(z!==null&&/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(z))return"build.zig wasm target";if(Z?.keywords?.some((X)=>/^wasm(?:-|$)|webassembly/i.test(X)))return'package.json keywords contains "wasm"';return null}function SI($,Z){if(!I($,"index.html"))return null;if(Z?.dependencies||Z?.devDependencies){let Q={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((X)=>Q[X]))return null}return"index.html (vanilla, no frontend framework)"}function EI($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((U)=>Q.test(U)),X=Z.files.some((U)=>/\.(md|MD)$|examples?\//.test(U)||U==="README.md"||U==="docs"||U==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function bI($,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 yI($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],U=z.some((J)=>Q[J]),H=X.some((J)=>Q[J]);if(U&&H)return"auth + payment dependencies";return null}function xI($,Z,Q){if(Z?.keywords?.some((U)=>/mcpaas/i.test(U)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((U)=>U.slug==="mcp"),X=Q.some((U)=>U.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function gI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var vI=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"]),K3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,kI=new Set(["frontend","backend","database","css","ui","state"]);function hI($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||E8($,"requirements*.txt"))return!0;if(I($,"go.mod"))return!0;if(I($,"Cargo.toml"))return!0;if(I($,"Gemfile"))return!0;if(I($,"pom.xml")||E8($,"build.gradle*"))return!0;if(X$($).length>0)return!0;let Z=O0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function b8($){return n2($,()=>uI($))}function uI($){let Z=v($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||vI.has(z.name))continue;let X=q3($,z.name);if(!hI(X))continue;let U=x8(X);if(!U)continue;let H=y8(X).filter((Y)=>kI.has(Y.category)),J=H.find((Y)=>Y.category==="frontend"),G=H.find((Y)=>Y.category==="backend"),V=J??G??H[0]??null;Q.push({name:z.name,language:U,topFramework:V?.name??null,frontend:!!J,backend:!!G||K3.test(U),hasFramework:!!V,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function fI($,Z){if(Z?.workspaces||I($,"pnpm-workspace.yaml"))return null;let Q=b8($),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 D3($){let Z=b8($);if(Z.length<2)return null;let Q=(H)=>(H.appRoot?2:0)+(K3.test(H.language)?2:0)+(H.hasFramework?1:0)+(H.frontend?0.5:0),z=[...Z].sort((H,J)=>Q(J)-Q(H)),X=new Set,U=[];for(let H of z){if(X.has(H.language))continue;X.add(H.language);let J=H.frontend?"frontend":H.backend?"backend":"service";U.push(H.topFramework?`${H.language} (${H.topFramework} · ${J})`:`${H.language} (${J})`)}return U.join("; ")}function O0($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function E8($,Z){if(!Z.includes("*"))return I($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(v($)??[]).some((G)=>G.name.startsWith(J))}let z=q3(...Q.slice(0,-1)),X=Q[Q.length-1],U=X.split("*")[0],H=X.split("*")[1]||"";return(v($,z)??[]).some((J)=>J.name.startsWith(U)&&J.name.endsWith(H))}function mI($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return E8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!E8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function y8($){let Z=O0($);return B3.map((Q)=>{let X=Q.signals.filter((U)=>mI(U,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function x8($){let Z=O0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(I($,"tsconfig.json"))return"TypeScript";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(X$($).length>0)return"C#";if(I($,"pyproject.toml")||I($,"setup.py"))return"Python";if(I($,"Gemfile"))return"Ruby";if(e4($)){let Q=$6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(I($,"Package.swift"))return"Swift";if(I($,"build.zig"))return"Zig";if(I($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function L3($){let Z=O0($),Q=y8($),z=[],X=EI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let U=TI($,Z);if(U)return z.push(U),{type:"sdk",found:z};let H=AI($);if(H)return z.push(H),{type:"extension",found:z};let J=xI($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let G=yI($,Z);if(G)return z.push(G),{type:"saas",found:z};let V=wI($,Z);if(V)return z.push(V),{type:"wasm",found:z};let Y=R8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=T8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=C8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=$6($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=j8($);if(L)return z.push(L.found),{type:L.appType,found:z};let q=z6($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=jI($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((g)=>g.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(FI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(I($,"build.zig")){if(z.push("build.zig"),I($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(I($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let M=Q.some((g)=>g.slug==="svelte"||g.slug==="sveltekit");if(Z?.private===!0&&(I($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&M)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(M)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let R=Q.some((g)=>g.category==="frontend"),T=Q.some((g)=>g.category==="backend");if(Z?.private&&(Z.workspaces||I($,"pnpm-workspace.yaml"))&&R&&T)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let A=gI($,Z);if(A)return z.push(A),{type:"monorepo-root",found:z};let j=bI($,Z,Q);if(j)return z.push(j),{type:"website",found:z};if(Q.some((g)=>g.slug==="nextjs"||g.slug==="nuxt"))return z.push(Q.find((g)=>g.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let S=Q.some((g)=>g.category==="frontend"),i=Q.some((g)=>g.category==="backend");if(S&&i)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(S)return z.push("frontend framework"),{type:"frontend",found:z};if(i)return z.push("backend framework"),{type:"backend",found:z};let e=CI($);if(e)return z.push(e),{type:"data-science",found:z};let _=SI($,Z);if(_)return z.push(_),{type:"html",found:z};let b=fI($,Z);if(b)return z.push(b),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push(C2),{type:"library",found:z}}function I3($){if(I($,"bunfig.toml"))return"Bun";if(I($,"deno.json")||I($,"deno.jsonc"))return"Deno";if(O0($))return"Node.js";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(X$($).length>0)return".NET";if(I($,"pubspec.yaml"))return"Dart";return""}var pI=new Set(["npm","pnpm","yarn","bun"]);function lI($){let Z=O0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return pI.has(Q)?Q:""}function cI($){if(I($,"pubspec.yaml"))return"pub";if(I($,"go.mod"))return"go modules";if(X$($).length>0)return"NuGet";if(I($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>I($,Q))?"gradle":""}var dI=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function O3($){return cI($)||lI($)||(dI.find(([Z])=>I($,Z))?.[1]??"")}function _3($){if(I($,".github/workflows"))return"GitHub Actions";if(I($,".gitlab-ci.yml"))return"GitLab CI";if(I($,".circleci"))return"CircleCI";if(I($,"Jenkinsfile"))return"Jenkins";return null}function M3($){if(I($,"vercel.json"))return"Vercel";if(I($,"netlify.toml"))return"Netlify";if(I($,"wrangler.toml"))return"Cloudflare";if(I($,"fly.toml"))return"Fly.io";if(I($,"render.yaml"))return"Render";return null}function P3($){let Z=w($,"svelte.config.js");if(Z===null)return null;let Q=Z.match(/@sveltejs\/adapter-(\w+)/);if(Q){let z=Q[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}function N3($){let Z=O0($);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(I($,"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)=>I($,Q))}function v8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=I($,"bun.lock")||I($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(I($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&iI($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(Q5($,"build.zig")))Q.test="zig build test"}if(I($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&nI($))Q.test="pytest";return Q}function Q5($,Z){return w($,Z)??""}function iI($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(Q5($,"Cargo.toml"))}function nI($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(Q5($,Z)))}function R3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let U=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let H of Q)if(U.has(H.category))X.push(H.name);if(I($,"bunfig.toml"))X.push("Bun");else if(I($,"deno.json")||I($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let H=Object.keys(Z.dependencies).slice(0,5);for(let J of H)if(!X.some((G)=>G.toLowerCase().includes(J.toLowerCase())))X.push(J)}return X}function rI($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function F3($){return z5($).data}function z5($){let Z=O0($),Q=y8($),z=L3($),X=z.type,U=z.found.some((y)=>y.startsWith("polyglot:")),H=U&&D3($)||x8($),J=I3($),G=O3($),V=_3($),Y=M3($),W=N3($),B=Q.find((y)=>y.category==="frontend"),K=Q.find((y)=>y.category==="css"),L=Q.find((y)=>y.category==="ui"),q=Q.find((y)=>y.category==="state"),D=Q.find((y)=>y.category==="backend"),O=Q.find((y)=>y.category==="database"),M=(y)=>j2(X,y)??j2("library",y)===!0,F=X==="framework",R=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit"),T=F&&R?"svelte":F?null:null,A=X==="svelte"||T==="svelte",j=A?P3($):null,N=A&&Q.some((y)=>y.slug==="sveltekit"),S={},i=m.filter((y)=>y.path.startsWith("stack."));for(let y of i){let k=y.path.replace("stack.","");switch(k){case"frontend":S[k]=B?.name??"";break;case"css_framework":S[k]=K?.name??"";break;case"ui_library":S[k]=L?.name??"";break;case"state_management":S[k]=q?.name??(A&&rI(Z)>=5?"Runes":"");break;case"backend":S[k]=A?N?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":S[k]=N?"Server Routes":"";break;case"runtime":S[k]=J;break;case"database":S[k]=O?.name??"";break;case"connection":S[k]=O?.name??"";break;case"hosting":if(A&&j)S[k]=j;else S[k]=Y??"";break;case"build":S[k]=N?"Vite":W??"";break;case"cicd":S[k]=V??"";break;case"package_manager":S[k]=G;break;default:S[k]="";break}}let e={};for(let y of i){let k=y.path.replace("stack.","");e[k]=M(y)?S[k]:"slotignored"}let _={},b=m.filter((y)=>y.path.startsWith("monorepo."));for(let y of b){let k=y.path.replace("monorepo.","");if(!M(y))_[k]="slotignored";else _[k]=""}let g={name:Z?.name??$.split("/").pop()??"project",goal:U?"":Z?.description??"",main_language:H,type:X};if(F&&T)g.framework=T;let Y0=R3($,Z,Q,U?x8($):H);if(U){for(let y of b8($))for(let k of[y.language,y.topFramework])if(k&&!Y0.includes(k))Y0.push(k)}let R5=g8($),F5=v8($,Z),Y6={faf_version:W3,project:g,stack:e,human_context:{who:"",what:U?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:_,_meta:{found:z.found}};if(Y0.length>0)Y6.tech_stack=Y0;if(R5.length>0)Y6.key_files=R5;if(Object.keys(F5).length>0)Y6.commands=F5;return{data:Y6,facts:S}}var T3={MIN_LENGTH:8,MAX_LENGTH:280},sI=[/^(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<T3.MIN_LENGTH)return!1;if(Z.length>T3.MAX_LENGTH)return!1;if(sI.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
260
+ `).length>4)return!1;return!0}function oI($){let Z=$.split(`
261
261
  `),Q=0;while(Q<Z.length&&/^(#\s|$)/.test(Z[Q].trim()))Q++;while(Q<Z.length){let z=Z[Q].trim();if(/^\[!\[/.test(z)){Q++;continue}if(/^!\[/.test(z)){Q++;continue}if(/^<img\s/i.test(z)){Q++;continue}if(z===""){Q++;continue}break}return Z.slice(Q).join(`
262
- `)}function sI($){let Q=rI($).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 O2($,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 oI($){let Z=O2($,/^(use\s+cases?|goal)\b/i);if(Z&&_0(Z))return Z;let Q=sI($);if(Q&&_0(Q))return Q;return}function aI($){let Z=O2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&_0(Z))return Z;return}function tI($){let Z=O2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&_0(Z))return Z;return}function eI($){let Z=O2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&_0(Z))return Z;return}function $O($){let Z=O2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&_0(Z))return Z;return}function ZO($){let Z=O2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&_0(Z))return Z;return}function QO($){let Z=O2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&_0(Z))return Z;return}function Z5($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(I($,K)){Q=K;break}if(!Q)return{};let z=w($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},H=oI(z);if(H)X.project={goal:H};let U={},J=aI(z);if(J)U.what=J;let V=tI(z);if(V)U.who=V;let G=eI(z);if(G)U.why=G;let Y=$O(z);if(Y)U.where=Y;let W=ZO(z);if(W)U.when=W;let B=QO(z);if(B)U.how=B;if(Object.keys(U).length>0)X.human_context=U;return X}function zO($,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 Q5($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=zO(Z,"description");if(Q&&_0(Q))return{project:{goal:Q}};return{}}import{join as R3}from"path";var XO=[{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"}],HO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function UO($){let Z=[],Q=(z,X)=>{for(let H of v($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(R3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!HO.has(H.name))Q(R3(z,H.name),X-1)};return Q(".",1),Z}function z6($){return[...$].join(" · ")}function z5($){let Z=UO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let H=w($,X);if(H===null)continue;for(let U of H.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let J=U[1].toLowerCase(),V=J.replace(/:[^/]*$/,"").split("/").pop()??J,G=J.replace(/:[^/]*$/,"");for(let{re:Y,slot:W,label:B}of XO)if(Y.test(V)||Y.test(G))Q[W].add(B)}}let z={};if(Q.database.size)z.database=z6(Q.database);if(Q.cache.size)z.cache=z6(Q.cache);if(Q.search.size)z.search=z6(Q.search);if(Q.storage.size)z.storage=z6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${z6(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as JO}from"path";var VO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),GO=[{file:"Makefile",runner:"make",targets:($)=>[...$.matchAll(/^([a-zA-Z][\w-]*)\s*:(?!=)/gm)].map((Z)=>Z[1])},{file:"justfile",runner:"just",targets:($)=>[...$.matchAll(/^([a-zA-Z][\w-]*)\s*(?:\([^)]*\))?\s*:/gm)].map((Z)=>Z[1])},{file:"Taskfile.yml",runner:"task",targets:($)=>{let Z=$.indexOf("tasks:");if(Z===-1)return[];return[...$.slice(Z).matchAll(/^\s{2}([a-zA-Z][\w-]*):/gm)].map((Q)=>Q[1])}}];function X5($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function YO($){let Z=[$];for(let Q of v($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!VO.has(Q.name))Z.push(JO($,Q.name));return Z}function WO($){let Z=0;if(I($,"manage.py")||I($,"pyproject.toml")||I($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function H5($){return i2($,()=>BO($))}function BO($){let Z=[];for(let z of YO($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of GO){let J=w(z,U.file);if(J===null)continue;let V=U.targets(J);if(V.length===0)continue;let G={},Y=X5(V,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=X5(V,[/^build$/i,/^compile$/i,/^build/i]),B=X5(V,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(Y)G.test=`${H}${U.runner} ${Y}`;if(W)G.build=`${H}${U.runner} ${W}`;if(B)G.lint=`${H}${U.runner} ${B}`;if(Object.keys(G).length===0)continue;Z.push({score:Object.keys(G).length+(X?10:WO(z)),commands:G})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var qO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function U5($){for(let Z of qO)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function KO($,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 J5($){return[Z5($),Q5($),z5($),H5($),U5($)].reduce(KO,{})}function F3($){try{let Z=p2($,{logLevel:"error"}).getIn(["project","type"],!0);return r(Z)&&typeof Z.comment==="string"&&Z.comment.includes(A2)}catch{return!1}}function V5($){let Z=P3($),Q=J5($),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=h0(h0(z,Z),X);FO(H);let J=(Z._meta?.found??[]).some((G)=>G.startsWith("polyglot:")),V=h0(H,j8($));return h0(V,{human_context:w8($,{toolingRoot:J})})}function DO($,Z){let Q=RO(X8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=$5($),H=z,U=h0(Q,J5($)),J=h0(U,H),V=h0(J,j8($)),G=OO(h0(V,{human_context:w8($)}),Q),Y=_O(LO(Z,Q,H)?MO(T3(G,Q),Q,X):T3(G,Q),Q);return P9(_9(Z,Y))}function LO($,Z,Q){if(!s(X0(Z,"project.type"))){let X=c$($)?.text;return X===void 0||!F3(X)}return!(Q._meta?.found??[]).includes(A2)}function G5($){return $.canonical?[$.path,$.canonical]:[$.path]}function X0($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)?X[z]:void 0}function _2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!u(H))return;if(Q===void 0?!(X in H):H[X]===Q)return;let U={...H};if(Q===void 0)delete U[X];else U[X]=Q;$[z]=U}var M2=($)=>typeof $==="string"&&$.trim()===Y6;function IO($,Z){let Q=Z.map((z)=>X0($,z));return Q.some(M2)&&Q.every((z)=>s(z)||M2(z))}function T3($,Z){let Q={...$};for(let z of m){let X=G5(z);if(!IO(Z,X))continue;for(let H of X){let U=X0(Z,H);if(X0(Q,H)!==U)_2(Q,H,U)}}return Q}function P2($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)&&Object.prototype.hasOwnProperty.call(X,z)}function OO($,Z){let Q={...$};for(let z of m){if(!z.canonical||!P2(Z,z.canonical)||P2(Z,z.path))continue;let X=X0(Q,z.path);_2(Q,z.path,void 0);let H=X0(Q,z.canonical);if(v8(X)&&s(H))_2(Q,z.canonical,X)}return Q}function _O($,Z){let Q={...$};for(let z of m){if(!z.canonical||!P2(Z,z.canonical)||P2(Z,z.path))continue;let X=X0(Q,z.canonical);if(v8(X)||M2(X))_2(Q,z.path,X)}return Q}function MO($,Z,Q={}){let z=$.project,X=u(z)?z.type:void 0,H={...$};for(let U of m){if(U.category==="human"||U.category==="project")continue;let J=C2(X,U);if(J===null)return $;if(J)PO(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0);else NO(H,U)}return H}function PO($,Z,Q,z){let X=G5(Q);for(let U of X)if(M2(X0($,U))&&!M2(X0(Z,U)))_2($,U,P2(Z,U)?X0(Z,U):"");if(!v8(z))return;let H=X.filter((U)=>P2($,U));if(H.some((U)=>!s(X0($,U))))return;for(let U of H.length>0?H:[Q.path])_2($,U,z)}function NO($,Z){let Q=G5(Z).filter((X)=>P2($,X)),z=(X)=>!s(X0($,X))&&!M2(X0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(s(X0($,X)))_2($,X,Y6)}function RO($){let Z=$.project;if(Z===null||Z===void 0||u(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function FO($){let Z=$.project?.type??"library",Q=T2[Z]||T2.library;for(let z of m){if(Q.includes(z.category))continue;let[X,H]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[H]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[H]="slotignored"}}function h0($,Z){return A3($,Z,"")}function TO($){let Z=S0.get($);return Z!==void 0&&Z.category!=="human"}function v8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!s($)&&!M2($)}function AO($,Z){return TO($)&&v8(Z)}function A3($,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(l8(U)){if(AO(J,H))z[X]=H;continue}if(s(U))z[X]=H;else if(u(H)&&u(U))z[X]=A3(U,H,J)}return z}function CO($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let Q=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=Q.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(Q))return`${Q}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function C3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function jO($,Z={}){let Q=V5($);if(Z.repoUrl&&Q.project&&!O0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=C3(Z.repoUrl);return Q}import{existsSync as j3,lstatSync as wO}from"fs";import{join as SO,basename as EO}from"path";import{createHash as bO}from"crypto";var M0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),Z2=($)=>typeof $==="number"&&Number.isFinite($),u0=($)=>typeof $==="string",yO=/^v?\d+\.\d+\.\d+$/,xO=new Set(["birth","doubled","peak","current"]);function E3($){return M0($)&&u0($.version)&&yO.test($.version)&&Z2($.score)}var gO=($)=>M0($)&&Z2($.birthDNA)&&u0($.born),vO=($)=>Array.isArray($)&&$.length>0&&$.every(E3),kO=($)=>M0($)&&Z2($.score)&&u0($.version),hO=($)=>M0($)&&Array.isArray($.milestones)&&$.milestones.every(M0);function w3($){return M0($)&&gO($.birthCertificate)&&vO($.versions)&&kO($.current)&&hO($.growth)}function Y5($){try{return wO($),!0}catch{return!1}}var W5=($)=>`${JSON.stringify($,null,2)}
266
- `,uO=new Set(["version","score","lastSync"]),fO=new Set(["type","score","date","version","label","emoji"]),S3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),B5={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},b3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),y3=($)=>S3($.current,uO)&&b3($).every((Z)=>S3(Z,fO)),mO=($)=>b3($).every((Z)=>Z.label===B5[Z.type].label&&Z.emoji===B5[Z.type].emoji);function pO($){return y3($)&&mO($)}var lO=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",cO=".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.",dO=".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.",iO=".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.",nO=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function rO($){if(!Array.isArray($))return[];return $.filter((Z)=>M0(Z)&&u0(Z.type)&&xO.has(Z.type)&&Z2(Z.score))}var N2=($,Z="")=>u0($)?$:Z;function sO($,Z){if(!Array.isArray($))return[];return $.filter(E3).map((Q)=>({version:Q.version,timestamp:N2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(u0):[],growth:Z2(Q.growth)?Q.growth:Q.score-Z}))}function oO($,Z,Q,z){return{version:N2($.version,Z?.version??"v1.0.0"),score:Z2($.score)?$.score:Z?.score??Q,lastSync:N2($.lastSync,z)}}function aO($){if(!M0($)||!M0($.birthCertificate)||!Z2($.birthCertificate.birthDNA))return null;let Z=$.birthCertificate,Q=Z.birthDNA,z=N2(Z.born),X=sO($.versions,Q),H=oO(M0($.current)?$.current:{},X[X.length-1],Q,z),U=M0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"?"legacy":"init",projectDNA:N2(Z.projectDNA),certificate:N2(Z.certificate)},versions:X,current:H,growth:{totalGrowth:H.score-Q,daysActive:Z2(U.daysActive)?U.daysActive:0,milestones:rO(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:N2($.lastModified,z),format:"faf-dna-v1"}}class x3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=SO($,".faf-dna")}exists(){let $=j3(this.dnaPath);if(!$&&!Y5(this.dnaPath))this.sawNoFile=!0;return $}birth($){if(!Y5(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:u0($.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=u0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(u0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!j3(this.dnaPath)){if(!Y5(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(w3(Q)&&W5(Q)===Z&&pO(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=aO(Q),this.reason=!this.dna?nO:!w3(Q)?lO:W5(Q)!==Z?cO:y3(Q)?iO:dO;return this.text=Z,this.dna}read(){let $;try{$=$0(h(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=W5(this.dna),Z=this.text??(this.sawNoFile?null:K0(h(this.projectPath,".faf-dna")));a(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return bO("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=EO(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,...B5[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 w_}from"path";import{existsSync as R_,statSync as xT}from"fs";import{join as d3}from"path";import{dirname as f3,resolve as m3}from"path";var v3=100;var tO="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",eO=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${tO})(?=\\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")],$_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],Z_=["","-->","?>",">","]]>"],Q_=/[#`~*+_=<>0-9-]/,z_=/(\d{1,9})([.)])/y,X_=/#{1,6}(?:[ \t]+|$)/y,H_=/`{3,}(?!.*`)|~{3,}/y,U_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,J_=/(?:=+|-+)[ \t]*$/y,V_=/[^ \t\f\v\r\n]/;function X6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var G_=($)=>$==="quote"||$==="list"||$==="item";function Y_($){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 H$=($)=>$===" "||$==="\t";function W_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var g3=($)=>$==="paragraph"||$==="code"||$==="html";function B_($){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(B_),$.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}>`:Z_[$.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"&&g3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!Q_.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(!g3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=$_[$.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),H$(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?X6(U_,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&&H$(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??=Y_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),H$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!X6(X_,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:X6(H_,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=eO[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!=="-"||!X6(J_,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||H$(z)))return null;if(Z&&!V_.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"?X6(z_,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&&H$(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,H$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!W_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),G_($.kind)&&this.stack.length-1>100)this.deep=!0}closeUnmatched(){if(!this.allClosed)this.stack.length=this.matched+1,this.allClosed=!0}findNextNonspace(){let $=this.ln,Z=this.offset,Q=this.column;if(this.scannedFrom!==-1&&this.offset>=this.scannedFrom&&this.offset<=this.nextNonspace)Z=this.nextNonspace,Q=this.nextNonspaceColumn;else{this.scannedFrom=this.offset;for(;Z<$.length;Z++)if($[Z]===" ")Q++;else if($[Z]==="\t")Q+=4-Q%4;else break}this.blank=Z>=$.length,this.nextNonspace=Z,this.nextNonspaceColumn=Q,this.indent=Q-this.column,this.indented=this.indent>=4}advanceNextNonspace(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn}advanceOffset($,Z){let Q=$;while(Q>0&&this.offset<this.ln.length){if(this.ln[this.offset]!=="\t"){this.offset++,this.column++,Q--;continue}let z=4-this.column%4,X=Z&&z>Q;this.column+=X?Q:z,this.offset+=X?0:1,Q-=Z?Math.min(z,Q):1}}}var C0="<!-- faf:start -->",j0="<!-- faf:end -->",k3="\uFEFF";function U6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var U$=($)=>$.replace(/\r?\n$|\r$/,""),p3=($)=>U$($).replace(/^\uFEFF/,"").trimEnd();function*l3($){let Z=0;for(let Q of U6($)){let z=U$(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 q_($,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 q5($,Z,Q){let[z,X]=[new f0(!0),new f0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of l3($)){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)q_(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 h3=($)=>(Z)=>Z===$;function R2($,Z=C0,Q=j0){return q5($,h3(Z),h3(Q))}function u3($,Z){let Q=[];for(let z of[!0,!1]){let X=new f0(z);for(let H of U6($))X.line(U$(H));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var K_=16;function D_($){let Z=new f0(!0);return $.map((Q)=>{let z=Z.overflowAt(U$(Q),K_),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(U$(X)),X})}function L_($,Z,Q){let X=D_(U6($).map((U)=>{let J=p3(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=u3(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
267
- ${H[0]}`,J=u3(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function I_($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=U6(z).map((H)=>U$(H)===""?`>${H}`:`> ${H}`).join("");return`${Z}
262
+ `)}function aI($){let Q=oI($).split(`
263
+ `),z=[];for(let X of Q){let U=X.trim();if(U===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(U))break;if(/^\*\*[^*]+\*\*\s*$/.test(U)&&z.length===0)continue;z.push(U)}if(z.length===0)return null;return z.join(" ").trim()}function _2($,Z){let Q=$.split(`
264
+ `),z=0;while(z<Q.length){let U=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(U&&Z.test(U[2])){let H=U[1].length,J=[];z++;while(z<Q.length){let G=Q[z].trim(),V=G.match(/^(#{1,6})\s+/);if(V&&V[1].length<=H)break;if(G===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(G))break;J.push(G),z++}if(J.length===0)return null;return J.join(" ").trim()}z++}return null}function tI($){let Z=_2($,/^(use\s+cases?|goal)\b/i);if(Z&&_0(Z))return Z;let Q=aI($);if(Q&&_0(Q))return Q;return}function eI($){let Z=_2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&_0(Z))return Z;return}function $O($){let Z=_2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&_0(Z))return Z;return}function ZO($){let Z=_2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&_0(Z))return Z;return}function QO($){let Z=_2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&_0(Z))return Z;return}function zO($){let Z=_2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&_0(Z))return Z;return}function XO($){let Z=_2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&_0(Z))return Z;return}function X5($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(I($,K)){Q=K;break}if(!Q)return{};let z=w($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},U=tI(z);if(U)X.project={goal:U};let H={},J=eI(z);if(J)H.what=J;let G=$O(z);if(G)H.who=G;let V=ZO(z);if(V)H.why=V;let Y=QO(z);if(Y)H.where=Y;let W=zO(z);if(W)H.when=W;let B=XO(z);if(B)H.how=B;if(Object.keys(H).length>0)X.human_context=H;return X}function UO($,Z){let Q=$.split(`
265
+ `),z=!1;for(let X of Q){let U=X.trim();if(/^\[/.test(U)){z=U==="[package]";continue}if(!z)continue;let H=U.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(H){let J=H[1].trim();J=J.replace(/\s*#.*$/,"").trim();let G=J.match(/^"((?:[^"\\]|\\.)*)"$/)||J.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return J}}return null}function U5($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=UO(Z,"description");if(Q&&_0(Q))return{project:{goal:Q}};return{}}import{join as A3}from"path";var HO=[{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"}],JO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function GO($){let Z=[],Q=(z,X)=>{for(let U of v($,z)??[])if(U.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(U.name))Z.push(A3(z,U.name));else if(U.isDirectory()&&X>0&&!U.name.startsWith(".")&&!JO.has(U.name))Q(A3(z,U.name),X-1)};return Q(".",1),Z}function U6($){return[...$].join(" · ")}function H5($){let Z=GO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let U=w($,X);if(U===null)continue;for(let H of U.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let J=H[1].toLowerCase(),G=J.replace(/:[^/]*$/,"").split("/").pop()??J,V=J.replace(/:[^/]*$/,"");for(let{re:Y,slot:W,label:B}of HO)if(Y.test(G)||Y.test(V))Q[W].add(B)}}let z={};if(Q.database.size)z.database=U6(Q.database);if(Q.cache.size)z.cache=U6(Q.cache);if(Q.search.size)z.search=U6(Q.search);if(Q.storage.size)z.storage=U6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${U6(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as VO}from"path";var YO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),WO=[{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 J5($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function BO($){let Z=[$];for(let Q of v($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!YO.has(Q.name))Z.push(VO($,Q.name));return Z}function qO($){let Z=0;if(I($,"manage.py")||I($,"pyproject.toml")||I($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function G5($){return n2($,()=>KO($))}function KO($){let Z=[];for(let z of BO($)){let X=z===$,U=X?"":`cd ${z.slice($.length+1)} && `;for(let H of WO){let J=w(z,H.file);if(J===null)continue;let G=H.targets(J);if(G.length===0)continue;let V={},Y=J5(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=J5(G,[/^build$/i,/^compile$/i,/^build/i]),B=J5(G,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(Y)V.test=`${U}${H.runner} ${Y}`;if(W)V.build=`${U}${H.runner} ${W}`;if(B)V.lint=`${U}${H.runner} ${B}`;if(Object.keys(V).length===0)continue;Z.push({score:Object.keys(V).length+(X?10:qO(z)),commands:V})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var DO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function V5($){for(let Z of DO)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function LO($,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 Y5($){return[X5($),U5($),H5($),G5($),V5($)].reduce(LO,{})}function C3($){try{let Z=l2($,{logLevel:"error"}).getIn(["project","type"],!0);return r(Z)&&typeof Z.comment==="string"&&Z.comment.includes(C2)}catch{return!1}}function W5($){let Z=F3($),Q=Y5($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X={};if(Q.project)X.project=Q.project;if(Q.human_context)X.human_context=Q.human_context;let U=h0(h0(z,Z),X);AO(U);let J=(Z._meta?.found??[]).some((V)=>V.startsWith("polyglot:")),G=h0(U,w8($));return h0(G,{human_context:S8($,{toolingRoot:J})})}function IO($,Z){let Q=TO(H8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=z5($),U=z,H=h0(Q,Y5($)),J=h0(H,U),G=h0(J,w8($)),V=MO(h0(G,{human_context:S8($)}),Q),Y=PO(OO(Z,Q,U)?NO(j3(V,Q),Q,X):j3(V,Q),Q);return F9(N9(Z,Y))}function OO($,Z,Q){if(!s(X0(Z,"project.type"))){let X=d$($)?.text;return X===void 0||!C3(X)}return!(Q._meta?.found??[]).includes(C2)}function B5($){return $.canonical?[$.path,$.canonical]:[$.path]}function X0($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)?X[z]:void 0}function M2($,Z,Q){let[z,X]=Z.split("."),U=$[z];if(!u(U))return;if(Q===void 0?!(X in U):U[X]===Q)return;let H={...U};if(Q===void 0)delete H[X];else H[X]=Q;$[z]=H}var P2=($)=>typeof $==="string"&&$.trim()===B6;function _O($,Z){let Q=Z.map((z)=>X0($,z));return Q.some(P2)&&Q.every((z)=>s(z)||P2(z))}function j3($,Z){let Q={...$};for(let z of m){let X=B5(z);if(!_O(Z,X))continue;for(let U of X){let H=X0(Z,U);if(X0(Q,U)!==H)M2(Q,U,H)}}return Q}function N2($,Z){let[Q,z]=Z.split("."),X=$[Q];return u(X)&&Object.prototype.hasOwnProperty.call(X,z)}function MO($,Z){let Q={...$};for(let z of m){if(!z.canonical||!N2(Z,z.canonical)||N2(Z,z.path))continue;let X=X0(Q,z.path);M2(Q,z.path,void 0);let U=X0(Q,z.canonical);if(k8(X)&&s(U))M2(Q,z.canonical,X)}return Q}function PO($,Z){let Q={...$};for(let z of m){if(!z.canonical||!N2(Z,z.canonical)||N2(Z,z.path))continue;let X=X0(Q,z.canonical);if(k8(X)||P2(X))M2(Q,z.path,X)}return Q}function NO($,Z,Q={}){let z=$.project,X=u(z)?z.type:void 0,U={...$};for(let H of m){if(H.category==="human"||H.category==="project")continue;let J=j2(X,H);if(J===null)return $;if(J)RO(U,Z,H,H.path.startsWith("stack.")?Q[H.path.slice(6)]:void 0);else FO(U,H)}return U}function RO($,Z,Q,z){let X=B5(Q);for(let H of X)if(P2(X0($,H))&&!P2(X0(Z,H)))M2($,H,N2(Z,H)?X0(Z,H):"");if(!k8(z))return;let U=X.filter((H)=>N2($,H));if(U.some((H)=>!s(X0($,H))))return;for(let H of U.length>0?U:[Q.path])M2($,H,z)}function FO($,Z){let Q=B5(Z).filter((X)=>N2($,X)),z=(X)=>!s(X0($,X))&&!P2(X0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(s(X0($,X)))M2($,X,B6)}function TO($){let Z=$.project;if(Z===null||Z===void 0||u(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function AO($){let Z=$.project?.type??"library",Q=A2[Z]||A2.library;for(let z of m){if(Q.includes(z.category))continue;let[X,U]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[U]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[U]="slotignored"}}function h0($,Z){return w3($,Z,"")}function CO($){let Z=S0.get($);return Z!==void 0&&Z.category!=="human"}function k8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!s($)&&!P2($)}function jO($,Z){return CO($)&&k8(Z)}function w3($,Z,Q){let z={...$};for(let[X,U]of Object.entries(Z)){let H=z[X],J=Q?`${Q}.${X}`:X;if(J==="_meta"&&H!==void 0)continue;if(c8(H)){if(jO(J,U))z[X]=U;continue}if(s(H))z[X]=U;else if(u(U)&&u(H))z[X]=w3(H,U,J)}return z}function wO($){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 S3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function SO($,Z={}){let Q=W5($);if(Z.repoUrl&&Q.project&&!O0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=S3(Z.repoUrl);return Q}import{existsSync as E3,lstatSync as EO}from"fs";import{join as bO,basename as yO}from"path";import{createHash as xO}from"crypto";var M0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),Q2=($)=>typeof $==="number"&&Number.isFinite($),u0=($)=>typeof $==="string",gO=/^v?\d+\.\d+\.\d+$/,vO=new Set(["birth","doubled","peak","current"]);function x3($){return M0($)&&u0($.version)&&gO.test($.version)&&Q2($.score)}var kO=($)=>M0($)&&Q2($.birthDNA)&&u0($.born),hO=($)=>Array.isArray($)&&$.length>0&&$.every(x3),uO=($)=>M0($)&&Q2($.score)&&u0($.version),fO=($)=>M0($)&&Array.isArray($.milestones)&&$.milestones.every(M0);function b3($){return M0($)&&kO($.birthCertificate)&&hO($.versions)&&uO($.current)&&fO($.growth)}function q5($){try{return EO($),!0}catch{return!1}}var K5=($)=>`${JSON.stringify($,null,2)}
266
+ `,mO=new Set(["version","score","lastSync"]),pO=new Set(["type","score","date","version","label","emoji"]),y3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),D5={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},g3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),v3=($)=>y3($.current,mO)&&g3($).every((Z)=>y3(Z,pO)),lO=($)=>g3($).every((Z)=>Z.label===D5[Z.type].label&&Z.emoji===D5[Z.type].emoji);function cO($){return v3($)&&lO($)}var dO=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",iO=".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.",nO=".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.",rO=".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.",sO=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function oO($){if(!Array.isArray($))return[];return $.filter((Z)=>M0(Z)&&u0(Z.type)&&vO.has(Z.type)&&Q2(Z.score))}var R2=($,Z="")=>u0($)?$:Z;function aO($,Z){if(!Array.isArray($))return[];return $.filter(x3).map((Q)=>({version:Q.version,timestamp:R2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(u0):[],growth:Q2(Q.growth)?Q.growth:Q.score-Z}))}function tO($,Z,Q,z){return{version:R2($.version,Z?.version??"v1.0.0"),score:Q2($.score)?$.score:Z?.score??Q,lastSync:R2($.lastSync,z)}}function eO($){if(!M0($)||!M0($.birthCertificate)||!Q2($.birthCertificate.birthDNA))return null;let Z=$.birthCertificate,Q=Z.birthDNA,z=R2(Z.born),X=aO($.versions,Q),U=tO(M0($.current)?$.current:{},X[X.length-1],Q,z),H=M0($.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:U,growth:{totalGrowth:U.score-Q,daysActive:Q2(H.daysActive)?H.daysActive:0,milestones:oO(Array.isArray(H.milestones)?H.milestones:$.milestones)},lastModified:R2($.lastModified,z),format:"faf-dna-v1"}}class k3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=bO($,".faf-dna")}exists(){let $=E3(this.dnaPath);if(!$&&!q5(this.dnaPath))this.sawNoFile=!0;return $}birth($){if(!q5(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,U=$-X,H=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:H,timestamp:z,score:$,changes:Z,growth:U}),Q.current={version:H,score:$,lastSync:z},Q.growth.totalGrowth=U,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,H,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((U)=>U.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:u0($.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=u0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(u0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!E3(this.dnaPath)){if(!q5(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(b3(Q)&&K5(Q)===Z&&cO(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=eO(Q),this.reason=!this.dna?sO:!b3(Q)?dO:K5(Q)!==Z?iO:v3(Q)?rO:nO;return this.text=Z,this.dna}read(){let $;try{$=$0(h(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=K5(this.dna),Z=this.text??(this.sawNoFile?null:K0(h(this.projectPath,".faf-dna")));a(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return xO("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=yO(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${Q}-${Z}`}incrementVersion($){let[Z,Q,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${Q}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,Q){if(!this.dna)return;let z=this.dna.growth.milestones,X=(G)=>z.some((V)=>V.type===G),U=(G)=>z.push({type:G,score:$,date:Q,version:Z,...D5[G]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))U("doubled");let H=z.find((G)=>G.type==="peak");if(!H||$>H.score){if(H)z.splice(z.indexOf(H),1);U("peak")}let J=z.findIndex((G)=>G.type==="current");if(J>=0)z.splice(J,1);U("current")}}import{join as E_}from"path";import{existsSync as T_,statSync as vT}from"fs";import{join as r3}from"path";import{dirname as l3,resolve as c3}from"path";var u3=100;var $_="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",Z_=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${$_})(?=\\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")],Q_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],z_=["","-->","?>",">","]]>"],X_=/[#`~*+_=<>0-9-]/,U_=/(\d{1,9})([.)])/y,H_=/#{1,6}(?:[ \t]+|$)/y,J_=/`{3,}(?!.*`)|~{3,}/y,G_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,V_=/(?:=+|-+)[ \t]*$/y,Y_=/[^ \t\f\v\r\n]/;function H6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var W_=($)=>$==="quote"||$==="list"||$==="item";function B_($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let U=$.length-1;U>=0;U--){let H=$[U],J=H===" "||H==="\t";for(let V=0;V<3;V++)if(H==="*-_"[V])z[V]++;else if(!J)X[V]=!1;let G="*-_".indexOf(H);Z[U]=G>=0&&X[G]&&z[G]>=3?1:0}return Z}var H$=($)=>$===" "||$==="\t";function q_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var h3=($)=>$==="paragraph"||$==="code"||$==="html";function K_($){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(K_),$.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}>`:z_[$.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"&&h3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!X_.test(this.ln.charAt(z)))break;let X=0;for(let U of this.starts)if(X=U(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!h3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=Q_[$.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),H$(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?H6(G_,this.ln,this.nextNonspace):null;if(Q&&Q[0].length>=$.len)return this.stack.length=Z,this.hiddenIn="code fence",2;for(let z=$.offset;z>0&&H$(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??=B_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),H$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!H6(H_,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:H6(J_,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let U=Z_[X-1].exec(z);if(U)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?U[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!H6(V_,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.stack[this.stack.length-1]={kind:"heading"},this.offset=this.ln.length,2}startBreak(){if(this.indented||!this.breakAhead())return 0;return this.closeUnmatched(),this.addChild({kind:"break"}),this.offset=this.ln.length,2}startItem($){if(!this.containers||this.indented&&$.kind!=="list")return 0;let Z=this.listMarker($);if(!Z)return 0;this.closeUnmatched();let Q=this.tip;if(Q.kind!=="list"||Q.list.bullet!==Z.bullet||Q.list.delimiter!==Z.delimiter)this.addChild({kind:"list",list:Z});return this.addChild({kind:"item",list:Z,hasChild:!1}),1}startIndentedCode(){if(!this.indented||this.tip.kind==="paragraph"||this.blank)return 0;return this.advanceOffset(4,!0),this.closeUnmatched(),this.addChild({kind:"code",fence:null}),2}listMarker($){if(this.indent>=4)return null;let Z=this.markerAt($);if(!Z)return null;let Q=this.indent;return this.advanceNextNonspace(),this.advanceOffset(Z.width,!0),{...Z.kind,markerOffset:Q,padding:this.paddingAfter(Z.width)}}markerAt($){let Z=$.kind==="paragraph",Q=this.markerKind(Z);if(!Q)return null;let z=this.ln[this.nextNonspace+Q.width];if(!(z===void 0||H$(z)))return null;if(Z&&!Y_.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"?H6(U_,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&&H$(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,H$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!q_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),W_($.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 C0="<!-- faf:start -->",j0="<!-- faf:end -->",f3="\uFEFF";function G6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var J$=($)=>$.replace(/\r?\n$|\r$/,""),d3=($)=>J$($).replace(/^\uFEFF/,"").trimEnd();function*i3($){let Z=0;for(let Q of G6($)){let z=J$(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 D_($,Z,Q,z){let X=$.some((H)=>H.start!==-1)&&z(Z.content),U=Q(Z.content);for(let H of $)if(H.start!==-1&&X)H.found={start:H.start,end:Z.to};else if(U)H.start=Z.from}function L5($,Z,Q){let[z,X]=[new f0(!0),new f0(!1)].map((U)=>({reader:U,start:-1,found:null}));for(let U of i3($)){let H=[z,X].map((G)=>G.reader.line(U.content));if(z.reader.tooDeep)return null;let J=[z,X].filter((G,V)=>H[V]===null);if(J.length>0)D_(J,U,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var m3=($)=>(Z)=>Z===$;function F2($,Z=C0,Q=j0){return L5($,m3(Z),m3(Q))}function p3($,Z){let Q=[];for(let z of[!0,!1]){let X=new f0(z);for(let U of G6($))X.line(J$(U));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var L_=16;function I_($){let Z=new f0(!0);return $.map((Q)=>{let z=Z.overflowAt(J$(Q),L_),X=Q;if(z>=0){let U=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),H=U?z+U[0].length:z;X=`${Q.slice(0,H)}\\${Q.slice(H)}`}return Z.line(J$(X)),X})}function O_($,Z,Q){let X=I_(G6($).map((H)=>{let J=d3(H);return J===Z||J===Q?` ${H}`:H})).join(""),U=p3(X,Q);while(U.length>0&&U[0]!==null){let H=`${X}
267
+ ${U[0]}`,J=p3(H,Q);if(J.length>=U.length)break;X=H,U=J}return X}function __($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=G6(z).map((U)=>J$(U)===""?`>${U}`:`> ${U}`).join("");return`${Z}
268
268
  ${X}
269
- ${Q}`}function H6($,Z,Q,z=C0,X=j0,H="the file"){let U=(V)=>{let G=`${$}${V}${Q}`,Y=R2(G,z,X);return Y&&Y.start===$.length&&Y.end===$.length+V.length?G:null},J=U(Z)??U(I_(Z,z,X));if(J===null)throw new E("unplaceable",H,`${H}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return J}function K5($,Z=C0,Q=j0){return`${Z}
270
- ${L_($.trim(),Z,Q)}
271
- ${Q}`}function k8($,Z,Q=C0,z=j0,X){if($===null)return H6("",Z,`
272
- `,Q,z,X);let H=R2($,Q,z);if(H)return H6($.slice(0,H.start),Z,$.slice(H.end),Q,z,X);let U=$.startsWith(k3)?k3:"";return H6(U,Z,`
269
+ ${Q}`}function J6($,Z,Q,z=C0,X=j0,U="the file"){let H=(G)=>{let V=`${$}${G}${Q}`,Y=F2(V,z,X);return Y&&Y.start===$.length&&Y.end===$.length+G.length?V:null},J=H(Z)??H(__(Z,z,X));if(J===null)throw new E("unplaceable",U,`${U}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return J}function I5($,Z=C0,Q=j0){return`${Z}
270
+ ${O_($.trim(),Z,Q)}
271
+ ${Q}`}function h8($,Z,Q=C0,z=j0,X){if($===null)return J6("",Z,`
272
+ `,Q,z,X);let U=F2($,Q,z);if(U)return J6($.slice(0,U.start),Z,$.slice(U.end),Q,z,X);let H=$.startsWith(f3)?f3:"";return J6(H,Z,`
273
273
 
274
- ${$.slice(U.length)}`,Q,z,X)}function J6($){try{return $0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function P0($,Z,Q=C0,z=j0,X={}){let H=K5(Z,Q,z),U=m3($),J=X.root??f3(U),V=h(J,U),G=J6(V);a(V,k8(G,H,Q,z,U),{root:J,expect:G})}var O_="<!-- faf:";function __($){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 M_($,Z){let Q=[new f0(!0),new f0(!1)],z=!1;for(let{content:X}of l3($)){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=C0,z=j0){if(Z===null||R2(Z,Q,z))return null;let X=p3(U6(Z)[0]??"");if(X.startsWith(O_)&&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=M_(Z,Q);if(H===null)return null;if(H==="too deep")return`${$}: faf's block is now on top; the file nests more than ${v3} 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 ${__(H)} and is left as you had it — delete it by hand if you no longer want it.`}function P_($,Z,Q=C0,z=j0,X={}){try{let H=m3($);return h8(Z,J6(h(X.root??f3(H),H)),Q,z)}catch{return null}}var N_=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 D5($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return N_.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function d($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function Z0($){let Z=S0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return D5(Q)}var L5=o.claude,F_="STATUS: SYNC ACTIVE";function T_($){let Z=d3($,L5);if(!R_(Z))return null;return $0(h($,L5))}function A_($,Z){P0(d3($,L5),Z)}function w0($,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 C_($){let Z=[],Q=$.project?.name??"Project",z=$.project?.main_language??"",X=$.project?.goal??"";if(Z.push(w0($)),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(`**${Z0(`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])=>`- **${Z0(`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(`*${F_} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
- `)}function c3($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function j_($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=c3(Q[1].trim());if(!Z.project.name){let H=$.match(/\*\*Name:\*\*\s*(.+)/);if(H)Z.project.name=c3(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 H0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),i3=($)=>Array.isArray($)?$.join(", "):String($),S_=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),E_=new Set(["target_user","core_problem","mission_purpose"]);function n3($){let Z=[],Q=(_="")=>Z.push(_),z=$.ai_instructions,X=$.preferences,H=$.instant_context,U=$.security,J=$.commands,V=$.key_files??H?.key_files,G=H0($.project?.default_branch)?String($.project?.default_branch):"main",Y=J?Object.entries(J).filter(([,_])=>H0(_)):[],W=Y.filter(([_])=>/test/i.test(_)),B=Y.filter(([_])=>/lint|check/i.test(_)&&!/test/i.test(_)),K=Y.filter(([_])=>!/test|lint|check/i.test(_)),L=(_)=>{let b=_.toLowerCase();if(/install|deps/.test(b))return 0;if(/^build$|build/.test(b)&&!/rebuild/.test(b))return 1;if(/^dev$|develop/.test(b))return 2;if(/^start$|run/.test(b))return 3;return 4},q=[...K].sort((_,b)=>L(_[0])-L(b[0])||_[0].localeCompare(b[0])),D=[...W,...B],O=W[0]?.[1],M=q.find(([_])=>/build/i.test(_))?.[1];Q(w0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let F=[];if($.project?.main_language)F.push(String($.project.main_language));if(H0($.project?.type))F.push(`type: ${String($.project?.type)}`);if(H0($.project?.version))F.push(`v${String($.project?.version)}`);let R=$.project?.goal?String($.project.goal).trim():"";if(F.length)R+=(R?" — ":"")+F.join(" · ");if(R)Q(R),Q();if(Q("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand-written content outside the managed block is preserved."),Q(),q.length){Q("## Setup & build"),Q(),Q("```bash");for(let[_,b]of q)Q(`${b} # ${_}`);Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,_]of D)Q(_);Q("```"),Q()}if(V&&V.length){Q("## Where things live"),Q();let _=V.map((b)=>{let g=String(b),Y0=g.indexOf(" — ");return Y0>0?{path:g.slice(0,Y0),role:g.slice(Y0+3)}:{path:g,role:""}});if(_.some((b)=>b.role)){Q("| Path | Role |"),Q("|------|------|");for(let b of _)Q(`| \`${b.path}\` | ${b.role} |`)}else for(let b of _)Q(`- \`${b.path}\``);Q()}let T=new Map,A=(_)=>{if(!_)return;for(let[b,g]of Object.entries(_)){if(S_.has(b)||!H0(g))continue;let Y0=D5(b);if(!T.has(Y0))T.set(Y0,i3(g))}};A(z?.working_style),A(X);let j=$.conventions??[];if(T.size||j.length){Q("## Conventions"),Q();for(let[_,b]of T)Q(`- **${_}:** ${b}`);for(let _ of j)if(H0(_))Q(`- ${_}`);Q()}let N=(z?.warnings??[]).filter((_)=>H0(_)),S=["read the tree"];if(O)S.push(`run the tests (\`${O}\`)`);if(M)S.push("build the project");for(let[,_]of B.slice(0,1))S.push(`\`${_}\``);Q("## Guardrails"),Q();for(let _ of N)Q(`- ${_}`);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 \`${G}\` (branch and open a PR) · commit secrets.`),Q();let i=[];for(let[,_]of B)i.push(`\`${_}\` exits 0`);for(let[,_]of W)i.push(`\`${_}\` passes`);if(i.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(i)].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&&(H0(U.secrets)||(U.never??[]).length)){if(Q("## Security & secrets"),Q(),H0(U.secrets)){let _=H0(U.example)?` (see \`${U.example}\`)`:"";Q(`- Secrets live in \`${U.secrets}\`${_}. Never read or commit them.`)}for(let _ of U.never??[])if(H0(_))Q(`- Never read or commit \`${_}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&H0(X.commit_style))Q(`- Commit style: ${i3(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 _=[];for(let[b,g]of Object.entries($.stack)){if(E_.has(b))continue;if(d(g))_.push(`- **${Z0(`stack.${b}`)}:** ${g.trim()}`)}if(_.length){Q("## Stack"),Q();for(let b of _)Q(b);Q()}}let e=$.generated;if(H0(e))Q(`*Context authored: ${String(e)}*`);return Z.join(`
277
- `)}function b_($,Z){P0(w_($,o.agents),n3(Z))}import{join as y_}from"path";var x_=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),g_=new Set(["target_user","core_problem","mission_purpose"]);function r3($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,H=z?Object.entries(z).filter(([,B])=>x_(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 K=B.toLowerCase();if(/install|deps/.test(K))return 0;if(/^build$|build/.test(K)&&!/rebuild/.test(K))return 1;if(/^dev$|develop/.test(K))return 2;if(/^start$|run/.test(K))return 3;return 4},Y=[...V].sort((B,K)=>G(B[0])-G(K[0])||B[0].localeCompare(K[0])),W=[...U,...J];if(Z.push(w0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(Y.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[B,K]of Y)Z.push(`${K} # ${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[K,L]of Object.entries($.stack)){if(g_.has(K))continue;if(d(L))B.push(`- ${Z0(`stack.${K}`)}: ${L.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let K of B)Z.push(K)}}return Z.push(""),Z.push("## Before changing things"),Z.push(""),Z.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Z.push("- Never: force-push · push straight to `main` · commit secrets."),Z.push(""),Z.join(`
278
- `)}function v_($,Z){P0(y_($,o.gemini),r3(Z))}import{join as k_}from"path";function s3($){let Z=[];if(Z.push(w0($)),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(d(z))Z.push(`# ${Z0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
279
- `)}function h_($,Z){P0(k_($,o.cursorrules),s3(Z),"# faf:start","# faf:end")}import{join as u_}from"path";var o3=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],f_=new Set([...o3.map(([$])=>$),"cicd"]);function a3($){let Z=[],Q=$.project?.name??"Project";if(Z.push(w0($)),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(""),d($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(d($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[G,Y]of Object.entries(z)){if(f_.has(G))continue;if(d(Y))X.push(`- **${Z0(`stack.${G}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let H=[];for(let[G,Y]of o3){let W=z[G];if(d(W))H.push(`- ${Y} \`${W.trim()}\`.`)}if(d(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])=>d(G)).map(([G,Y])=>`- **${Z0(`human_context.${G}`)}:** ${Y.trim()}`);if(V.length>0)Z.push("## Project context","",...V,"");return Z.join(`
280
- `)}function m_($,Z){n2($,".github"),P0(u_($,".github",o.copilot),a3(Z),C0,j0,{root:$})}import{existsSync as p_,lstatSync as Qz,readFileSync as f8,realpathSync as I5,statSync as l_}from"fs";import{homedir as c_}from"os";import{basename as d_,dirname as O5,join as N0,resolve as F2}from"path";var t3=200,e3=200,$z=12,i_="# Project Context (from project.faf)",n_="*This section is managed by tri-sync.";function r_($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function zz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=t3)return Z;return`${Z.slice(0,t3)}-${Math.abs(r_($)).toString(36)}`}function Xz($){try{let Z=Qz($);if(Z.isSymbolicLink()){let Q=l_($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function Zz($){try{return Qz($).isFile()}catch{return!1}}function s_($){let Z=$;for(;;){if(Xz(N0(Z,".git")))return Z;let Q=O5(Z);if(Q===Z)return null;Z=Q}}function o_($){let Z;try{Z=f8(N0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=F2($,Z.slice(7).trim()),z=N0(Q,"commondir");if(!Zz(z))return $;let X=F2(Q,f8(z,"utf-8").trim());if(F2(O5(Q))!==N0(X,"worktrees"))return $;let H=N0(Q,"gitdir");if(!Zz(H))return $;let U=f8(H,"utf-8").trim();if(I5(F2(Q,U))!==N0(I5($),".git"))return $;if(d_(X)!==".git")return Xz(N0(X,".git"))?$:X;return O5(X)}catch{return $}}function Hz($){let Z=F2($);try{Z=I5.native(Z)}catch{}let Q=s_(Z);return(Q?o_(Q):Z).normalize("NFC")}function p8($,Z={}){if(Z.memoryDir)return F2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||N0(c_(),".claude");return N0(F2(Q),"projects",zz(Hz($)),"memory").normalize("NFC")}function a_($,Z={}){return N0(p8($,Z),o.memory)}var t_=new Set(["target_user","core_problem","mission_purpose"]),e_=["who","what","why","where","when","how"];function Uz($){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:** ${d(Z.name)?Z.name:"Project"}`,...Q.filter(([,U])=>d(U)).map(([U,J])=>`- **${U}:** ${J}`),...u8("Stack",Object.entries($.stack??{}).filter(([U,J])=>!t_.has(U)&&d(J)).map(([U,J])=>`- **${Z0(`stack.${U}`)}:** ${J}`)),...u8("Context",e_.filter((U)=>d(z[U])).map((U)=>`- **${Z0(`human_context.${U}`)}:** ${z[U]}`)),...u8("Commands",Object.entries($.commands??{}).filter(([,U])=>d(U)).slice(0,$z).map(([U,J])=>`- ${U}: \`${J}\``)),...u8("Key files",X.filter(d).slice(0,$z).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 u8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function Jz($){return q5($,(Z)=>Z.trimEnd()===i_,(Z)=>Z.startsWith(n_))}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 $M($,Z,Q){if($===null)return{text:k8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=R2($),X=z??Jz($);if(X){let U=$.slice(0,X.start),J=$.slice(X.end);return{text:H6(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 _5($){return $>e3?[`MEMORY.md is ${$} lines. Claude Code loads the first ${e3}; lines after that are kept in the file but not loaded.`]:[]}function ZM($,Z={}){let Q=p8($,Z),z=N0(Q,o.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!p_(Q))return X;let H=J6(h(Q,o.memory));if(H===null)return X;let U=R2(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&&Jz(H)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((G)=>G.replace(/^\uFEFF/,"").trim()!=="").length,warnings:_5(V)}}function QM($,Z,Q={}){let z=p8($,Q);n2(z);let X=h(z,o.memory),H=J6(X),U=$M(H,K5(Uz(Z)),X);if(U.text===H){let B=m8(H);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:_5(B)}}let J=a(X,U.text,{root:z,expect:H}),V=f8(J,"utf-8"),G=V===U.text&&V.startsWith(U.head)&&V.endsWith(U.tail),Y=m8(V),W=U.action==="added"?h8(o.memory,H):null;return{path:J,action:U.action,written:!0,preserved:G,lines:Y,warnings:[...W?[W]:[],..._5(Y)]}}function zM($,Z){let Q=[],z=(V)=>I($,V),X=(V)=>w($,V)??"";if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let 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 XM($,Z){let Q={...Z},z=null,X=w($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let H=g8($,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=x8($);if(J.length)Q.key_files=J}if(!Z.security){let V=[".env",".env.local",".env.development"].find((G)=>I($,G));if(V){let G=[".env.example",".env.sample",".env.template"].find((Y)=>I($,Y));Q.security={secrets:V,...G?{example:G}:{}}}}if(!Z.conventions){let J=zM($,z);if(J.length)Q.conventions=J}return Q}export{yK as writeServerCard,BK as writeProjectHtml,v_ as writeGeminiMd,Aq as writeFaf,h_ as writeCursorrules,m_ as writeCopilotInstructions,QM as writeClaudeMemory,A_ as writeClaudeMd,b_ as writeAgentsMd,Cz as validateFaf,K2 as utcNow,nK as upsertCatalog,Pq as updateFafFile,DO as updateExistingFaf,j8 as turboCatSlots,H3 as turboCatScan,qz as slotsByCategory,w9 as serializeFaf,uQ as seedSixWsFromGoal,Az as scoreText,s8 as scoreFafYaml,a as safeWriteFile,hB as safeUnlink,n7 as safeReplaceOwned,_D as runLoop,h as resolveInside,a_ as resolveClaudeMemoryPath,p8 as resolveClaudeMemoryDir,C3 as repoNameFromUrl,b4 as renderProjectHtml,r3 as renderGeminiMd,s3 as renderCursorrules,a3 as renderCopilotInstructions,Uz as renderClaudeMemory,C_ as renderClaudeMd,n3 as renderAgentsMd,J3 as relentlessContextDetailed,w8 as relentlessContext,O8 as registryTitle,k4 as registryName,v4 as registryMeta,$0 as readUtf8,uK as readFafa,b9 as readFafRaw,Mq as readFaf,T_ as readClaudeMd,d4 as questionForSlot,FD as publicQuestions,HQ as projectServerJson,XQ as projectServerCard,GQ as projectPack,rK as projectCards,VQ as projectArd,JQ as projectAiCatalog,L8 as projectA2ACard,xK as patchServerJson,j_ as parseClaudeMd,CO as normalizeGitUrl,P8 as normalizeAnswer,QQ as mcpName,n2 as makeDirInside,pQ as loopVerdict,P_ as legacyStampNoteAt,h8 as legacyStampNote,r8 as kernel,s as isPlaceholder,Sq as isNonProjectRoot,fQ as isHumanSlot,Lz as isExplicitNone,M8 as isEmptyValue,qD as interviewForMissing,P0 as injectFafBlock,TD as gradeAnswers,W$ as getTier,Oz as getNextTier,gK as generateServerCard,qK as generateProjectHtml,pK as generateA2ACard,EQ as fromClaudeDir,fK as findFafaFile,y9 as findFafFile,R2 as findFafBlock,h0 as fillEmpties,$Q as fafaYaml,I8 as fafaDomain,w0 as fafMetaTag,o2 as fafContextBlock,C5 as enrichScore,XM as enrichFromRepo,RD as deriveQuestionSet,vq as computeDrift,Hz as claudeProjectRoot,zz as claudeProjectId,ZM as claudeMemoryStatus,mQ as classifyGaps,e2 as canonicalPriority,ID as buildTableOf8,s$ as buildServerCard,AD as buildReceipt,AK as buildPack,h4 as buildA2ACard,jO as authorFafFromRepo,V5 as assembleFreshFaf,e9 as answersToFafa,iQ as answersMatch,E0 as TIERS,E as SafePathError,kQ as STACK_INTERVIEW,S0 as SLOT_BY_PATH,m as SLOTS,Y6 as SLOTIGNORED,c4 as SIX_WS_INTERVIEW,a9 as SERVER_JSON_SCHEMA,D8 as SERVER_CARD_SCHEMA,qQ as REGISTRY_PUBLISHER_KEY,$2 as PRIORITY_RANK,u4 as PRIORITY_ORDER,G6 as PLACEHOLDERS,_8 as KNOWLEDGE_TYPES,vQ as INTERVIEW_VERSION,BD as INTERVIEW_PATHS,hQ as INTERVIEW_BY_PATH,Z$ as INTERVIEW,G0 as FafmSoul,x3 as FafDNAManager,C0 as FAF_START,G$ as FAF_HEX,j0 as FAF_END,R5 as EXPLICIT_NONE,Dz as ENTERPRISE_SLOTS,n4 as BENCH_VERSION,Kz as BASE_SLOTS,dQ as ALIAS_GROUPS,OQ as A2A_CONTEXT_URI};
274
+ ${$.slice(H.length)}`,Q,z,X)}function V6($){try{return $0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function P0($,Z,Q=C0,z=j0,X={}){let U=I5(Z,Q,z),H=c3($),J=X.root??l3(H),G=h(J,H),V=V6(G);a(G,h8(V,U,Q,z,H),{root:J,expect:V})}var M_="<!-- faf:";function P_($){if($==="code fence")return"a code fence";if($==="indented code")return"an indented code block";if($==="comment")return"an HTML comment";return $==="html"?"an HTML block":`a ${$} block`}function N_($,Z){let Q=[new f0(!0),new f0(!1)],z=!1;for(let{content:X}of i3($)){if(z){if(X===Z)return"too deep";continue}let[U,H]=Q.map((G)=>G.line(X));z=Q[0].tooDeep;let J=U??H;if(X===Z&&(z||J!==null))return z?"too deep":J}return null}function u8($,Z,Q=C0,z=j0){if(Z===null||F2(Z,Q,z))return null;let X=d3(G6(Z)[0]??"");if(X.startsWith(M_)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let U=N_(Z,Q);if(U===null)return null;if(U==="too deep")return`${$}: faf's block is now on top; the file nests more than ${u3} 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 ${P_(U)} and is left as you had it — delete it by hand if you no longer want it.`}function R_($,Z,Q=C0,z=j0,X={}){try{let U=c3($);return u8(Z,V6(h(X.root??l3(U),U)),Q,z)}catch{return null}}var F_=new Set(["API","CI","CD","MCP","CLI","SDK","UI","UX","AI","ML","DB","ORM","OS","HTTP","HTTPS","REST","RPC","JSON","YAML","XML","SQL","CSS","HTML","AWS","GCP","CDN","DNS","JWT","ID","IP","URL","URI","TS","JS"]);function O5($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return F_.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function d($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function Z0($){let Z=S0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return O5(Q)}var _5=o.claude,A_="STATUS: SYNC ACTIVE";function C_($){let Z=r3($,_5);if(!T_(Z))return null;return $0(h($,_5))}function j_($,Z){P0(r3($,_5),Z)}function w0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),U=String($.project?.goal??"").trim(),H=`<!-- faf: ${[Q,z,X,U].join(" | ")} -->`,J=[];if(Z.doc)J.push(`doc=${Z.doc}`);else J.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")J.push(`score=${Z.score}`);if(J.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)J.push(`siblings=${Z.siblings.join(",")}`);let G=`<!-- faf: ${J.join(" | ")} -->`;return`${H}
275
+ ${G}`}function w_($){let Z=[],Q=$.project?.name??"Project",z=$.project?.main_language??"",X=$.project?.goal??"";if(Z.push(w0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),X)Z.push("## What This Is"),Z.push(""),Z.push(X),Z.push("");let U=$.stack??{},H=[];if(z)H.push(`**Language:** ${z}`);for(let[V,Y]of Object.entries(U))if(Y&&Y!=="slotignored"&&String(Y).trim())H.push(`**${Z0(`stack.${V}`)}:** ${Y}`);if(H.length>0){Z.push("## Stack"),Z.push("");for(let V of H)Z.push(`- ${V}`);Z.push("")}let J=$.human_context??{},G=[["who",J.who],["what",J.what],["why",J.why],["where",J.where],["when",J.when],["how",J.how]].filter(([,V])=>V&&String(V).trim()).map(([V,Y])=>`- **${Z0(`human_context.${V}`)}:** ${Y}`);if(G.length>0)Z.push("## Context"),Z.push(""),Z.push(...G),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${A_} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
276
+ `)}function n3($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function S_($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=n3(Q[1].trim());if(!Z.project.name){let U=$.match(/\*\*Name:\*\*\s*(.+)/);if(U)Z.project.name=n3(U[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let U=$.match(/\*\*What Building:\*\*\s*(.+)/);if(U)Z.project.goal=U[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let U=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(U)Z.project.main_language=U[1].trim()}return Z}var U0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),s3=($)=>Array.isArray($)?$.join(", "):String($),b_=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),y_=new Set(["target_user","core_problem","mission_purpose"]);function o3($){let Z=[],Q=(_="")=>Z.push(_),z=$.ai_instructions,X=$.preferences,U=$.instant_context,H=$.security,J=$.commands,G=$.key_files??U?.key_files,V=U0($.project?.default_branch)?String($.project?.default_branch):"main",Y=J?Object.entries(J).filter(([,_])=>U0(_)):[],W=Y.filter(([_])=>/test/i.test(_)),B=Y.filter(([_])=>/lint|check/i.test(_)&&!/test/i.test(_)),K=Y.filter(([_])=>!/test|lint|check/i.test(_)),L=(_)=>{let b=_.toLowerCase();if(/install|deps/.test(b))return 0;if(/^build$|build/.test(b)&&!/rebuild/.test(b))return 1;if(/^dev$|develop/.test(b))return 2;if(/^start$|run/.test(b))return 3;return 4},q=[...K].sort((_,b)=>L(_[0])-L(b[0])||_[0].localeCompare(b[0])),D=[...W,...B],O=W[0]?.[1],M=q.find(([_])=>/build/i.test(_))?.[1];Q(w0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let F=[];if($.project?.main_language)F.push(String($.project.main_language));if(U0($.project?.type))F.push(`type: ${String($.project?.type)}`);if(U0($.project?.version))F.push(`v${String($.project?.version)}`);let R=$.project?.goal?String($.project.goal).trim():"";if(F.length)R+=(R?" — ":"")+F.join(" · ");if(R)Q(R),Q();if(Q("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand-written content outside the managed block is preserved."),Q(),q.length){Q("## Setup & build"),Q(),Q("```bash");for(let[_,b]of q)Q(`${b} # ${_}`);Q("```"),Q()}if(D.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,_]of D)Q(_);Q("```"),Q()}if(G&&G.length){Q("## Where things live"),Q();let _=G.map((b)=>{let g=String(b),Y0=g.indexOf(" — ");return Y0>0?{path:g.slice(0,Y0),role:g.slice(Y0+3)}:{path:g,role:""}});if(_.some((b)=>b.role)){Q("| Path | Role |"),Q("|------|------|");for(let b of _)Q(`| \`${b.path}\` | ${b.role} |`)}else for(let b of _)Q(`- \`${b.path}\``);Q()}let T=new Map,A=(_)=>{if(!_)return;for(let[b,g]of Object.entries(_)){if(b_.has(b)||!U0(g))continue;let Y0=O5(b);if(!T.has(Y0))T.set(Y0,s3(g))}};A(z?.working_style),A(X);let j=$.conventions??[];if(T.size||j.length){Q("## Conventions"),Q();for(let[_,b]of T)Q(`- **${_}:** ${b}`);for(let _ of j)if(U0(_))Q(`- ${_}`);Q()}let N=(z?.warnings??[]).filter((_)=>U0(_)),S=["read the tree"];if(O)S.push(`run the tests (\`${O}\`)`);if(M)S.push("build the project");for(let[,_]of B.slice(0,1))S.push(`\`${_}\``);Q("## Guardrails"),Q();for(let _ of N)Q(`- ${_}`);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 \`${V}\` (branch and open a PR) · commit secrets.`),Q();let i=[];for(let[,_]of B)i.push(`\`${_}\` exits 0`);for(let[,_]of W)i.push(`\`${_}\` passes`);if(i.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(i)].join(" · ")}.`),Q(),Q("## When stuck"),Q(),Q(`Ask a clarifying question, propose a short plan, or open a draft PR with notes — do not push large speculative changes to \`${V}\`.`),Q(),H&&(U0(H.secrets)||(H.never??[]).length)){if(Q("## Security & secrets"),Q(),U0(H.secrets)){let _=U0(H.example)?` (see \`${H.example}\`)`:"";Q(`- Secrets live in \`${H.secrets}\`${_}. Never read or commit them.`)}for(let _ of H.never??[])if(U0(_))Q(`- Never read or commit \`${_}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&U0(X.commit_style))Q(`- Commit style: ${s3(X.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${V}\` and open a PR — never commit to \`${V}\` directly.`),Q("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),Q(),$.stack){let _=[];for(let[b,g]of Object.entries($.stack)){if(y_.has(b))continue;if(d(g))_.push(`- **${Z0(`stack.${b}`)}:** ${g.trim()}`)}if(_.length){Q("## Stack"),Q();for(let b of _)Q(b);Q()}}let e=$.generated;if(U0(e))Q(`*Context authored: ${String(e)}*`);return Z.join(`
277
+ `)}function x_($,Z){P0(E_($,o.agents),o3(Z))}import{join as g_}from"path";var v_=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),k_=new Set(["target_user","core_problem","mission_purpose"]);function a3($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,U=z?Object.entries(z).filter(([,B])=>v_(B)):[],H=U.filter(([B])=>/test/i.test(B)),J=U.filter(([B])=>/lint|check/i.test(B)&&!/test/i.test(B)),G=U.filter(([B])=>!/test|lint|check/i.test(B)),V=(B)=>{let K=B.toLowerCase();if(/install|deps/.test(K))return 0;if(/^build$|build/.test(K)&&!/rebuild/.test(K))return 1;if(/^dev$|develop/.test(K))return 2;if(/^start$|run/.test(K))return 3;return 4},Y=[...G].sort((B,K)=>V(B[0])-V(K[0])||B[0].localeCompare(K[0])),W=[...H,...J];if(Z.push(w0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(Y.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[B,K]of Y)Z.push(`${K} # ${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[K,L]of Object.entries($.stack)){if(k_.has(K))continue;if(d(L))B.push(`- ${Z0(`stack.${K}`)}: ${L.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let K of B)Z.push(K)}}return Z.push(""),Z.push("## Before changing things"),Z.push(""),Z.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Z.push("- Never: force-push · push straight to `main` · commit secrets."),Z.push(""),Z.join(`
278
+ `)}function h_($,Z){P0(g_($,o.gemini),a3(Z))}import{join as u_}from"path";function t3($){let Z=[];if(Z.push(w0($)),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(d(z))Z.push(`# ${Z0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
279
+ `)}function f_($,Z){P0(u_($,o.cursorrules),t3(Z),"# faf:start","# faf:end")}import{join as m_}from"path";var e3=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],p_=new Set([...e3.map(([$])=>$),"cicd"]);function $z($){let Z=[],Q=$.project?.name??"Project";if(Z.push(w0($)),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(""),d($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(d($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[V,Y]of Object.entries(z)){if(p_.has(V))continue;if(d(Y))X.push(`- **${Z0(`stack.${V}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let U=[];for(let[V,Y]of e3){let W=z[V];if(d(W))U.push(`- ${Y} \`${W.trim()}\`.`)}if(d(z.cicd))U.push(`- CI runs on ${z.cicd.trim()}.`);if(U.length>0)Z.push("## Build & run","",...U,"");let H=$.human_context??{},G=[["who",H.who],["what",H.what],["why",H.why],["where",H.where],["when",H.when],["how",H.how]].filter(([,V])=>d(V)).map(([V,Y])=>`- **${Z0(`human_context.${V}`)}:** ${Y.trim()}`);if(G.length>0)Z.push("## Project context","",...G,"");return Z.join(`
280
+ `)}function l_($,Z){r2($,".github"),P0(m_($,".github",o.copilot),$z(Z),C0,j0,{root:$})}import{existsSync as c_,lstatSync as Uz,readFileSync as m8,realpathSync as M5,statSync as d_}from"fs";import{homedir as i_}from"os";import{basename as n_,dirname as P5,join as N0,resolve as T2}from"path";var Zz=200,Qz=200,zz=12,r_="# Project Context (from project.faf)",s_="*This section is managed by tri-sync.";function o_($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function Hz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=Zz)return Z;return`${Z.slice(0,Zz)}-${Math.abs(o_($)).toString(36)}`}function Jz($){try{let Z=Uz($);if(Z.isSymbolicLink()){let Q=d_($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function Xz($){try{return Uz($).isFile()}catch{return!1}}function a_($){let Z=$;for(;;){if(Jz(N0(Z,".git")))return Z;let Q=P5(Z);if(Q===Z)return null;Z=Q}}function t_($){let Z;try{Z=m8(N0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=T2($,Z.slice(7).trim()),z=N0(Q,"commondir");if(!Xz(z))return $;let X=T2(Q,m8(z,"utf-8").trim());if(T2(P5(Q))!==N0(X,"worktrees"))return $;let U=N0(Q,"gitdir");if(!Xz(U))return $;let H=m8(U,"utf-8").trim();if(M5(T2(Q,H))!==N0(M5($),".git"))return $;if(n_(X)!==".git")return Jz(N0(X,".git"))?$:X;return P5(X)}catch{return $}}function Gz($){let Z=T2($);try{Z=M5.native(Z)}catch{}let Q=a_(Z);return(Q?t_(Q):Z).normalize("NFC")}function l8($,Z={}){if(Z.memoryDir)return T2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||N0(i_(),".claude");return N0(T2(Q),"projects",Hz(Gz($)),"memory").normalize("NFC")}function e_($,Z={}){return N0(l8($,Z),o.memory)}var $M=new Set(["target_user","core_problem","mission_purpose"]),ZM=["who","what","why","where","when","how"];function Vz($){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:** ${d(Z.name)?Z.name:"Project"}`,...Q.filter(([,H])=>d(H)).map(([H,J])=>`- **${H}:** ${J}`),...f8("Stack",Object.entries($.stack??{}).filter(([H,J])=>!$M.has(H)&&d(J)).map(([H,J])=>`- **${Z0(`stack.${H}`)}:** ${J}`)),...f8("Context",ZM.filter((H)=>d(z[H])).map((H)=>`- **${Z0(`human_context.${H}`)}:** ${z[H]}`)),...f8("Commands",Object.entries($.commands??{}).filter(([,H])=>d(H)).slice(0,zz).map(([H,J])=>`- ${H}: \`${J}\``)),...f8("Key files",X.filter(d).slice(0,zz).map((H)=>`- ${H}`)),"","*faf keeps this block in step with project.faf. Everything outside it is Claude's own and is kept as written.*"].join(`
281
+ `)}function f8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function Yz($){return L5($,(Z)=>Z.trimEnd()===r_,(Z)=>Z.startsWith(s_))}function p8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function QM($,Z,Q){if($===null)return{text:h8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=F2($),X=z??Yz($);if(X){let H=$.slice(0,X.start),J=$.slice(X.end);return{text:J6(H,Z,J,void 0,void 0,Q),action:z?"updated":"migrated",head:H,tail:J}}let U=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:h8($,Z,void 0,void 0,Q),action:"added",head:U,tail:$.slice(U.length)}}function N5($){return $>Qz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${Qz}; lines after that are kept in the file but not loaded.`]:[]}function zM($,Z={}){let Q=l8($,Z),z=N0(Q,o.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!c_(Q))return X;let U=V6(h(Q,o.memory));if(U===null)return X;let H=F2(U),J=H?`${U.slice(0,H.start)}${U.slice(H.end)}`:U,G=p8(U);return{path:z,exists:!0,lines:G,hasBlock:H!==null,blockLines:H?p8(U.slice(H.start,H.end)):0,hasLegacySection:!H&&Yz(U)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((V)=>V.replace(/^\uFEFF/,"").trim()!=="").length,warnings:N5(G)}}function XM($,Z,Q={}){let z=l8($,Q);r2(z);let X=h(z,o.memory),U=V6(X),H=QM(U,I5(Vz(Z)),X);if(H.text===U){let B=p8(U);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:N5(B)}}let J=a(X,H.text,{root:z,expect:U}),G=m8(J,"utf-8"),V=G===H.text&&G.startsWith(H.head)&&G.endsWith(H.tail),Y=p8(G),W=H.action==="added"?u8(o.memory,U):null;return{path:J,action:H.action,written:!0,preserved:V,lines:Y,warnings:[...W?[W]:[],...N5(Y)]}}function UM($,Z){let Q=[],z=(G)=>I($,G),X=(G)=>w($,G)??"";if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(X("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let U=[],H=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in H)U.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in H)U.push("Prettier");let J=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(J))U.push("black");if(/\[tool\.ruff\]/.test(J))U.push("ruff");if(/\[tool\.mypy\]/.test(J))U.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))U.push("rustfmt");if(U.length)Q.push(`Style enforced by ${U.join(" · ")} — obey the configs`);return Q}function HM($,Z){let Q={...Z},z=null,X=w($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let U=v8($,z);if(Object.keys(U).length)Q.commands={...U,...Z.commands??{}};let H=Z.key_files??Z.instant_context?.key_files;if(!H||H.length===0){let J=g8($);if(J.length)Q.key_files=J}if(!Z.security){let G=[".env",".env.local",".env.development"].find((V)=>I($,V));if(G){let V=[".env.example",".env.sample",".env.template"].find((Y)=>I($,Y));Q.security={secrets:G,...V?{example:V}:{}}}}if(!Z.conventions){let J=UM($,z);if(J.length)Q.conventions=J}return Q}export{gK as writeServerCard,DK as writeProjectHtml,h_ as writeGeminiMd,wq as writeFaf,f_ as writeCursorrules,l_ as writeCopilotInstructions,XM as writeClaudeMemory,j_ as writeClaudeMd,x_ as writeAgentsMd,Sz as validateFaf,D2 as utcNow,sK as upsertCatalog,Fq as updateFafFile,IO as updateExistingFaf,w8 as turboCatSlots,G3 as turboCatScan,Lz as slotsByCategory,b9 as serializeFaf,pQ as seedSixWsFromGoal,wz as scoreText,o8 as scoreFafYaml,a as safeWriteFile,mB as safeUnlink,o7 as safeReplaceOwned,PD as runLoop,h as resolveInside,e_ as resolveClaudeMemoryPath,l8 as resolveClaudeMemoryDir,S3 as repoNameFromUrl,y4 as renderProjectHtml,a3 as renderGeminiMd,t3 as renderCursorrules,$z as renderCopilotInstructions,Vz as renderClaudeMemory,w_ as renderClaudeMd,o3 as renderAgentsMd,Y3 as relentlessContextDetailed,S8 as relentlessContext,_8 as registryTitle,f4 as registryName,u4 as registryMeta,$0 as readUtf8,mK as readFafa,g9 as readFafRaw,Rq as readFaf,C_ as readClaudeMd,r4 as questionForSlot,AD as publicQuestions,VQ as projectServerJson,GQ as projectServerCard,qQ as projectPack,oK as projectCards,BQ as projectArd,WQ as projectAiCatalog,I8 as projectA2ACard,vK as patchServerJson,S_ as parseClaudeMd,wO as normalizeGitUrl,N8 as normalizeAnswer,HQ as mcpName,r2 as makeDirInside,dQ as loopVerdict,R_ as legacyStampNoteAt,u8 as legacyStampNote,s8 as kernel,s as isPlaceholder,yq as isNonProjectRoot,lQ as isHumanSlot,_z as isExplicitNone,P8 as isEmptyValue,DD as interviewForMissing,P0 as injectFafBlock,CD as gradeAnswers,B$ as getTier,Pz as getNextTier,kK as generateServerCard,LK as generateProjectHtml,dK as generateA2ACard,xQ as fromClaudeDir,pK as findFafaFile,v9 as findFafFile,F2 as findFafBlock,h0 as fillEmpties,XQ as fafaYaml,$2 as fafaDomain,w0 as fafMetaTag,a2 as fafContextBlock,S5 as enrichScore,HM as enrichFromRepo,TD as deriveQuestionSet,uq as computeDrift,Gz as claudeProjectRoot,Hz as claudeProjectId,zM as claudeMemoryStatus,cQ as classifyGaps,$$ as canonicalPriority,_D as buildTableOf8,a$ as buildServerCard,jD as buildReceipt,jK as buildPack,m4 as buildA2ACard,SO as authorFafFromRepo,W5 as assembleFreshFaf,zQ as answersToFafa,sQ as answersMatch,E0 as TIERS,E as SafePathError,fQ as STACK_INTERVIEW,S0 as SLOT_BY_PATH,m as SLOTS,B6 as SLOTIGNORED,n4 as SIX_WS_INTERVIEW,$Q as SERVER_JSON_SCHEMA,L8 as SERVER_CARD_SCHEMA,IQ as REGISTRY_PUBLISHER_KEY,Z2 as PRIORITY_RANK,p4 as PRIORITY_ORDER,W6 as PLACEHOLDERS,M8 as KNOWLEDGE_TYPES,uQ as INTERVIEW_VERSION,KD as INTERVIEW_PATHS,mQ as INTERVIEW_BY_PATH,Q$ as INTERVIEW,V0 as FafmSoul,k3 as FafDNAManager,C0 as FAF_START,Y$ as FAF_HEX,j0 as FAF_END,A5 as EXPLICIT_NONE,Oz as ENTERPRISE_SLOTS,o4 as BENCH_VERSION,Iz as BASE_SLOTS,rQ as ALIAS_GROUPS,NQ as A2A_CONTEXT_URI};
282
282
 
283
- //# debugId=B557893CC9892B9164756E2164756E21
283
+ //# debugId=6B32855CDEEB27E664756E2164756E21
284
284
  //# sourceMappingURL=index.js.map