faf-cli 7.13.1 → 7.14.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/README.md +11 -35
- package/dist/cli.js +240 -240
- package/dist/cli.js.map +4 -4
- package/dist/index.js +121 -121
- package/dist/index.js.map +3 -3
- package/dist/interop/cards.d.ts +18 -3
- package/package.json +1 -1
- package/project.faf +3 -3
package/dist/index.js
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`)}}H0.defaultYaml={explicit:!1,version:"1.2"};H0.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
1
|
+
import{createRequire as c3}from"node:module";var u3=Object.defineProperty;var P=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var m3=($)=>$;function p3($,Z){this[$]=m3.bind(null,Z)}var l3=($,Z)=>{for(var Q in Z)u3($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:p3.bind(Z,Q)})};var X$=c3(import.meta.url);var y=P((qz)=>{var p8=Symbol.for("yaml.alias"),P5=Symbol.for("yaml.document"),V6=Symbol.for("yaml.map"),N5=Symbol.for("yaml.pair"),l8=Symbol.for("yaml.scalar"),G6=Symbol.for("yaml.seq"),E0=Symbol.for("yaml.node.type"),Uz=($)=>!!$&&typeof $==="object"&&$[E0]===p8,Jz=($)=>!!$&&typeof $==="object"&&$[E0]===P5,Vz=($)=>!!$&&typeof $==="object"&&$[E0]===V6,Gz=($)=>!!$&&typeof $==="object"&&$[E0]===N5,R5=($)=>!!$&&typeof $==="object"&&$[E0]===l8,Yz=($)=>!!$&&typeof $==="object"&&$[E0]===G6;function F5($){if($&&typeof $==="object")switch($[E0]){case V6:case G6:return!0}return!1}function Wz($){if($&&typeof $==="object")switch($[E0]){case p8:case V6:case l8:case G6:return!0}return!1}var Bz=($)=>(R5($)||F5($))&&!!$.anchor;qz.ALIAS=p8;qz.DOC=P5;qz.MAP=V6;qz.NODE_TYPE=E0;qz.PAIR=N5;qz.SCALAR=l8;qz.SEQ=G6;qz.hasAnchor=Bz;qz.isAlias=Uz;qz.isCollection=F5;qz.isDocument=Jz;qz.isMap=Vz;qz.isNode=Wz;qz.isPair=Gz;qz.isScalar=R5;qz.isSeq=Yz});var G$=P((Sz)=>{var i=y(),Z0=Symbol("break visit"),A5=Symbol("skip children"),N0=Symbol("remove node");function Y6($,Z){let Q=T5(Z);if(i.isDocument($)){if(w2(null,$.contents,Q,Object.freeze([$]))===N0)$.contents=null}else w2(null,$,Q,Object.freeze([]))}Y6.BREAK=Z0;Y6.SKIP=A5;Y6.REMOVE=N0;function w2($,Z,Q,z){let X=C5($,Z,Q,z);if(i.isNode(X)||i.isPair(X))return w5($,z,X),w2($,X,Q,z);if(typeof X!=="symbol"){if(i.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=w2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===Z0)return Z0;else if(U===N0)Z.items.splice(H,1),H-=1}}else if(i.isPair(Z)){z=Object.freeze(z.concat(Z));let H=w2("key",Z.key,Q,z);if(H===Z0)return Z0;else if(H===N0)Z.key=null;let U=w2("value",Z.value,Q,z);if(U===Z0)return Z0;else if(U===N0)Z.value=null}}return X}async function W6($,Z){let Q=T5(Z);if(i.isDocument($)){if(await j2(null,$.contents,Q,Object.freeze([$]))===N0)$.contents=null}else await j2(null,$,Q,Object.freeze([]))}W6.BREAK=Z0;W6.SKIP=A5;W6.REMOVE=N0;async function j2($,Z,Q,z){let X=await C5($,Z,Q,z);if(i.isNode(X)||i.isPair(X))return w5($,z,X),j2($,X,Q,z);if(typeof X!=="symbol"){if(i.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let H=0;H<Z.items.length;++H){let U=await j2(H,Z.items[H],Q,z);if(typeof U==="number")H=U-1;else if(U===Z0)return Z0;else if(U===N0)Z.items.splice(H,1),H-=1}}else if(i.isPair(Z)){z=Object.freeze(z.concat(Z));let H=await j2("key",Z.key,Q,z);if(H===Z0)return Z0;else if(H===N0)Z.key=null;let U=await j2("value",Z.value,Q,z);if(U===Z0)return Z0;else if(U===N0)Z.value=null}}return X}function T5($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function C5($,Z,Q,z){if(typeof Q==="function")return Q($,Z,z);if(i.isMap(Z))return Q.Map?.($,Z,z);if(i.isSeq(Z))return Q.Seq?.($,Z,z);if(i.isPair(Z))return Q.Pair?.($,Z,z);if(i.isScalar(Z))return Q.Scalar?.($,Z,z);if(i.isAlias(Z))return Q.Alias?.($,Z,z);return}function w5($,Z,Q){let z=Z[Z.length-1];if(i.isCollection(z))z.items[$]=Q;else if(i.isPair(z))if($==="key")z.key=Q;else z.value=Q;else if(i.isDocument(z))z.contents=Q;else{let X=i.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}Sz.visit=Y6;Sz.visitAsync=W6});var c8=P((vz)=>{var j5=y(),yz=G$(),xz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gz=($)=>$.replace(/[!,[\]{}]/g,(Z)=>xz[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,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+gz($.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&&j5.isNode($.contents)){let X={};yz.visit($.contents,(H,U)=>{if(j5.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
|
+
`)}}H0.defaultYaml={explicit:!1,version:"1.2"};H0.defaultTags={"!!":"tag:yaml.org,2002:"};vz.Directives=H0});var B6=P((mz)=>{var S5=y(),hz=G$();function fz($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function E5($){let Z=new Set;return hz.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function b5($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function uz($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(H)=>{Q.push(H),X??(X=E5($));let U=b5(Z,X);return X.add(U),U},setAnchors:()=>{for(let H of Q){let U=z.get(H);if(typeof U==="object"&&U.anchor&&(S5.isScalar(U.node)||S5.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}}mz.anchorIsValid=fz;mz.anchorNames=E5;mz.createNodeAnchors=uz;mz.findNewAnchor=b5});var d8=P((iz)=>{function Y$($,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=Y$($,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=Y$($,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=Y$($,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=Y$($,z,X,H);if(U===void 0)delete z[X];else if(U!==H)z[X]=U}return $.call(Z,Q,z)}iz.applyReviver=Y$});var m0=P((rz)=>{var sz=y();function y5($,Z,Q){if(Array.isArray($))return $.map((z,X)=>y5(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!sz.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 $}rz.toJS=y5});var q6=P((ez)=>{var az=d8(),x5=y(),tz=m0();class g5{constructor($){Object.defineProperty(this,x5.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(!x5.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=tz.toJS(this,"",H);if(typeof z==="function")for(let{count:J,res:V}of H.anchors.values())z(V,J);return typeof X==="function"?az.applyReviver(X,{"":U},"",U):U}}ez.NodeBase=g5});var W$=P((HX)=>{var ZX=B6(),QX=G$(),S2=y(),zX=q6(),XX=m0();class v5 extends zX.NodeBase{constructor($){super(S2.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){if(Z?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let Q;if(Z?.aliasResolveCache)Q=Z.aliasResolveCache;else if(Q=[],QX.visit($,{Node:(X,H)=>{if(S2.isAlias(H)||S2.hasAnchor(H))Q.push(H)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,H=this.resolve(z,Z);if(!H){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let U=Q.get(H);if(!U)XX.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=K6(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(ZX.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 K6($,Z,Q){if(S2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(S2.isCollection(Z)){let z=0;for(let X of Z.items){let H=K6($,X,Q);if(H>z)z=H}return z}else if(S2.isPair(Z)){let z=K6($,Z.key,Q),X=K6($,Z.value,Q);return Math.max(z,X)}return 1}HX.Alias=v5});var l=P((WX)=>{var JX=y(),VX=q6(),GX=m0(),YX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class Z2 extends VX.NodeBase{constructor($){super(JX.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:GX.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";WX.Scalar=Z2;WX.isScalarValue=YX});var B$=P((OX)=>{var KX=W$(),Q2=y(),k5=l(),DX="tag:yaml.org,2002:";function IX($,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 LX($,Z,Q){if(Q2.isDocument($))$=$.contents;if(Q2.isNode($))return $;if(Q2.isPair($)){let W=Q.schema[Q2.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 KX.Alias(V.anchor);else V={anchor:null,node:null},J.set($,V);if(Z?.startsWith("!!"))Z=DX+Z.slice(2);let G=IX($,Z,U.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new k5.Scalar($);if(V)V.node=W;return W}G=$ instanceof Map?U[Q2.MAP]:(Symbol.iterator in Object($))?U[Q2.SEQ]:U[Q2.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 k5.Scalar($);if(Z)Y.tag=Z;else if(!G.default)Y.tag=G.tag;if(V)V.node=Y;return Y}OX.createNode=LX});var D6=P((NX)=>{var MX=B$(),R0=y(),PX=q6();function i8($,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 MX.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var h5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class f5 extends PX.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)=>R0.isNode(Q)||R0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(h5($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(R0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,i8(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(R0.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&&R0.isScalar(X)?X.value:X;else return R0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!R0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&R0.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 R0.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(R0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,i8(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}NX.Collection=f5;NX.collectionFromPath=i8;NX.isEmptyPath=h5});var q$=P((wX)=>{var TX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function n8($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var CX=($,Z,Q)=>$.endsWith(`
|
|
3
3
|
`)?n8(Q,Z):Q.includes(`
|
|
4
4
|
`)?`
|
|
5
|
-
`+n8(Q,Z):($.endsWith(" ")?"":" ")+Q;
|
|
6
|
-
`){if(Q==="block")q=
|
|
7
|
-
`&&K!=="\t"){let
|
|
8
|
-
`&&
|
|
9
|
-
${Z}${$.slice(0,A)}`;else{if(Q==="quoted"&&Y[
|
|
10
|
-
${Z}${$.slice(
|
|
11
|
-
`);z=Z,X=Z+1,H=$[X]}return z}
|
|
12
|
-
`){if(H-U>z)return!0;if(U=H+1,X-U<=z)return!1}return!0}function K$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,H=Z.indent||(
|
|
5
|
+
`+n8(Q,Z):($.endsWith(" ")?"":" ")+Q;wX.indentComment=n8;wX.lineComment=CX;wX.stringifyComment=TX});var m5=P((yX)=>{function bX($,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,I=!1,q=-1,D=-1,O=-1;if(Q==="block"){if(q=u5($,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=u5($,q,Z.length);W=q+Z.length+V,B=void 0}else{if(F===" "&&K&&K!==" "&&K!==`
|
|
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],I=!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 I=!0}K=F}if(I&&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],A=G[F+1]||$.length;if(R===0)M=`
|
|
9
|
+
${Z}${$.slice(0,A)}`;else{if(Q==="quoted"&&Y[R])M+=`${$[R]}\\`;M+=`
|
|
10
|
+
${Z}${$.slice(R+1,A)}`}}return M}function u5($,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}yX.FOLD_BLOCK="block";yX.FOLD_FLOW="flow";yX.FOLD_QUOTED="quoted";yX.foldFlowLines=bX});var D$=P((mX)=>{var Y0=l(),p0=m5(),L6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),O6=($)=>/^(%|---|\.\.\.)/m.test($);function hX($,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 K$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,H=Z.indent||(O6($)?" ":""),U="",J=0;for(let V=0,G=Q[V];G;G=Q[++V]){if(G===" "&&Q[V+1]==="\\"&&Q[V+2]==="n")U+=Q.slice(J,V)+"\\ ",V+=1,J=V,G="\\";if(G==="\\")switch(Q[V+1]){case"u":{U+=Q.slice(J,V);let Y=Q.substr(V+2,4);switch(Y){case"0000":U+="\\0";break;case"0007":U+="\\a";break;case"000b":U+="\\v";break;case"001b":U+="\\e";break;case"0085":U+="\\N";break;case"00a0":U+="\\_";break;case"2028":U+="\\L";break;case"2029":U+="\\P";break;default:if(Y.substr(0,2)==="00")U+="\\x"+Y.substr(2);else U+=Q.substr(V,6)}V+=5,J=V+1}break;case"n":if(z||Q[V+2]==='"'||Q.length<X)V+=1;else{U+=Q.slice(J,V)+`
|
|
13
13
|
|
|
14
14
|
`;while(Q[V+2]==="\\"&&Q[V+3]==="n"&&Q[V+4]!=='"')U+=`
|
|
15
15
|
`,V+=2;if(U+=H,Q[V+2]===" ")U+="\\";V+=1,J=V+1}break;default:V+=1}}return U=J?U+Q.slice(J):Q,z?U:p0.foldFlowLines(U,H,p0.FOLD_QUOTED,L6(Z,!1))}function s8($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
|
|
16
|
-
`)||/[ \t]\n|\n[ \t]/.test($))return K$($,Z);let Q=Z.indent||(
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test($))return K$($,Z);let Q=Z.indent||(O6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
17
|
${Q}`)+"'";return Z.implicitKey?z:p0.foldFlowLines(z,Q,p0.FOLD_FLOW,L6(Z,!1))}function E2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=K$;else{let X=$.includes('"'),H=$.includes("'");if(X&&!H)z=s8;else if(H&&!X)z=K$;else z=Q?s8:K$}return z($,Z)}var r8;try{r8=new RegExp(`(^|(?<!
|
|
18
18
|
))
|
|
19
19
|
+(?!
|
|
20
|
-
|$)`,"g")}catch{r8=/\n+(?!\n|$)/g}function I6({comment:$,type:Z,value:Q},z,X,H){let{blockQuote:U,commentString:J,lineWidth:V}=z.options;if(!U||/\n[\t ]+$/.test(Q))return E2(Q,z);let G=z.indent||(z.forceBlockIndent||
|
|
20
|
+
|$)`,"g")}catch{r8=/\n+(?!\n|$)/g}function I6({comment:$,type:Z,value:Q},z,X,H){let{blockQuote:U,commentString:J,lineWidth:V}=z.options;if(!U||/\n[\t ]+$/.test(Q))return E2(Q,z);let G=z.indent||(z.forceBlockIndent||O6(Q)?" ":""),Y=U==="literal"?!0:U==="folded"||Z===Y0.Scalar.BLOCK_FOLDED?!1:Z===Y0.Scalar.BLOCK_LITERAL?!0:!hX(Q,V,G.length);if(!Q)return Y?`|
|
|
21
21
|
`:`>
|
|
22
22
|
`;let W,B;for(B=Q.length;B>0;--B){let A=Q[B-1];if(A!==`
|
|
23
23
|
`&&A!=="\t"&&A!==" ")break}let K=Q.substring(B),I=K.indexOf(`
|
|
24
24
|
`);if(I===-1)W="-";else if(Q===K||I!==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(r8,`$&${G}`)}let q=!1,D,
|
|
26
|
-
`)
|
|
27
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),T=!1,C=L6(z,!0);if(U!=="folded"&&Z!==Y0.Scalar.BLOCK_FOLDED)C.onOverflow=()=>{T=!0};let
|
|
28
|
-
${G}${
|
|
29
|
-
${G}${M}${Q}${K}`}function
|
|
25
|
+
`)K=K.slice(0,-1);K=K.replace(r8,`$&${G}`)}let q=!1,D,O=-1;for(D=0;D<Q.length;++D){let A=Q[D];if(A===" ")q=!0;else if(A===`
|
|
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 A=Q.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),T=!1,C=L6(z,!0);if(U!=="folded"&&Z!==Y0.Scalar.BLOCK_FOLDED)C.onOverflow=()=>{T=!0};let N=p0.foldFlowLines(`${M}${A}${K}`,G,p0.FOLD_BLOCK,C);if(!T)return`>${R}
|
|
28
|
+
${G}${N}`}return Q=Q.replace(/\n+/g,`$&${G}`),`|${R}
|
|
29
|
+
${G}${M}${Q}${K}`}function fX($,Z,Q,z){let{type:X,value:H}=$,{actualString:U,implicitKey:J,indent:V,indentStep:G,inFlow:Y}=Z;if(J&&H.includes(`
|
|
30
30
|
`)||Y&&/[[\]{},]/.test(H))return E2(H,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||Y||!H.includes(`
|
|
31
31
|
`)?E2(H,Z):I6($,Z,Q,z);if(!J&&!Y&&X!==Y0.Scalar.PLAIN&&H.includes(`
|
|
32
|
-
`))return I6($,Z,Q,z);if(
|
|
33
|
-
${V}`);if(U){let B=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(W),{compat:K,tags:I}=Z.doc.schema;if(I.some(B)||K?.some(B))return E2(H,Z)}return J?W:p0.foldFlowLines(W,V,p0.FOLD_FLOW,L6(Z,!1))}function
|
|
34
|
-
${Z.indent}${J}`}
|
|
35
|
-
${J}:`}else if(D=`${D}:`,B)D+=L$.lineComment(D,Q.indent,G(B));let
|
|
32
|
+
`))return I6($,Z,Q,z);if(O6(H)){if(V==="")return Z.forceBlockIndent=!0,I6($,Z,Q,z);else if(J&&V===G)return E2(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:I}=Z.doc.schema;if(I.some(B)||K?.some(B))return E2(H,Z)}return J?W:p0.foldFlowLines(W,V,p0.FOLD_FLOW,L6(Z,!1))}function uX($,Z,Q,z){let{implicitKey:X,inFlow:H}=Z,U=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==Y0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))J=Y0.Scalar.QUOTE_DOUBLE}let V=(Y)=>{switch(Y){case Y0.Scalar.BLOCK_FOLDED:case Y0.Scalar.BLOCK_LITERAL:return X||H?E2(U.value,Z):I6(U,Z,Q,z);case Y0.Scalar.QUOTE_DOUBLE:return K$(U.value,Z);case Y0.Scalar.QUOTE_SINGLE:return s8(U.value,Z);case Y0.Scalar.PLAIN:return fX(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}mX.stringifyString=uX});var I$=P((oX)=>{var lX=B6(),l0=y(),cX=q$(),dX=D$();function iX($,Z){let Q=Object.assign({blockQuote:!0,commentString:cX.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 nX($,Z){if(Z.tag){let X=$.filter((H)=>H.tag===Z.tag);if(X.length>0)return X.find((H)=>H.format===Z.format)??X[0]}let Q=void 0,z;if(l0.isScalar(Z)){z=Z.value;let X=$.filter((H)=>H.identify?.(z));if(X.length>1){let H=X.filter((U)=>U.test);if(H.length>0)X=H}Q=X.find((H)=>H.format===Z.format)??X.find((H)=>!H.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function sX($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],H=(l0.isScalar($)||l0.isCollection($))&&$.anchor;if(H&&lX.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 rX($,Z,Q,z){if(l0.isPair($))return $.toString(Z,Q,z);if(l0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,H=l0.isNode($)?$:Z.doc.createNode($,{onTagObj:(V)=>X=V});X??(X=nX(Z.doc.schema.tags,H));let U=sX(H,X,Z);if(U.length>0)Z.indentAtStart=(Z.indentAtStart??0)+U.length+1;let J=typeof X.stringify==="function"?X.stringify(H,Z,Q,z):l0.isScalar(H)?dX.stringifyString(H,Z,Q,z):H.toString(Z,Q,z);if(!U)return J;return l0.isScalar(H)||J[0]==="{"||J[0]==="["?`${U} ${J}`:`${U}
|
|
34
|
+
${Z.indent}${J}`}oX.createStringifyContext=iX;oX.stringify=rX});var c5=P(($H)=>{var b0=y(),p5=l(),l5=I$(),L$=q$();function eX({key:$,value:Z},Q,z,X){let{allNullValues:H,doc:U,indent:J,indentStep:V,options:{commentString:G,indentSeq:Y,simpleKeys:W}}=Q,B=b0.isNode($)&&$.comment||null;if(W){if(B)throw Error("With simple keys, key nodes cannot have comments");if(b0.isCollection($)||!b0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||B&&Z==null&&!Q.inFlow||b0.isCollection($)||(b0.isScalar($)?$.type===p5.Scalar.BLOCK_FOLDED||$.type===p5.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!H),indent:J+V});let I=!1,q=!1,D=l5.stringify($,Q,()=>I=!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(I&&z)z();return D===""?"?":K?`? ${D}`:D}}else if(H&&!W||Z==null&&K){if(D=`? ${D}`,B&&!I)D+=L$.lineComment(D,Q.indent,G(B));else if(q&&X)X();return D}if(I)B=null;if(K){if(B)D+=L$.lineComment(D,Q.indent,G(B));D=`? ${D}
|
|
35
|
+
${J}:`}else if(D=`${D}:`,B)D+=L$.lineComment(D,Q.indent,G(B));let O,M,F;if(b0.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&&b0.isScalar(Z))Q.indentAtStart=D.length+1;if(q=!1,!Y&&V.length>=2&&!Q.inFlow&&!K&&b0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let R=!1,A=l5.stringify(Z,Q,()=>R=!0,()=>q=!0),T=" ";if(B||O||M){if(T=O?`
|
|
36
36
|
`:"",M){let C=G(M);T+=`
|
|
37
37
|
${L$.indentComment(C,Q.indent)}`}if(A===""&&!Q.inFlow){if(T===`
|
|
38
38
|
`&&F)T=`
|
|
39
39
|
|
|
40
40
|
`}else T+=`
|
|
41
|
-
${Q.indent}`}else if(!K&&b0.isCollection(Z)){let C=A[0],
|
|
42
|
-
`),j=
|
|
41
|
+
${Q.indent}`}else if(!K&&b0.isCollection(Z)){let C=A[0],N=A.indexOf(`
|
|
42
|
+
`),j=N!==-1,d=Q.inFlow??Z.flow??Z.items.length===0;if(j||!d){let t=!1;if(j&&(C==="&"||C==="!")){let _=A.indexOf(" ");if(C==="&"&&_!==-1&&_<N&&A[_+1]==="!")_=A.indexOf(" ",_+1);if(_===-1||N<_)t=!0}if(!t)T=`
|
|
43
43
|
${Q.indent}`}}else if(A===""||A[0]===`
|
|
44
|
-
`)T="";if(D+=T+A,Q.inFlow){if(
|
|
44
|
+
`)T="";if(D+=T+A,Q.inFlow){if(R&&z)z()}else if(F&&!R)D+=L$.lineComment(D,Q.indent,G(F));else if(q&&X)X();return D}$H.stringifyPair=eX});var o8=P((XH)=>{var d5=X$("process");function QH($,...Z){if($==="debug")console.log(...Z)}function zH($,Z){if($==="debug"||$==="warn")if(typeof d5.emitWarning==="function")d5.emitWarning(Z);else console.warn(Z)}XH.debug=QH;XH.warn=zH});var N6=P((VH)=>{var P6=y(),i5=l(),_6="<<",M6={identify:($)=>$===_6||typeof $==="symbol"&&$.description===_6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new i5.Scalar(Symbol(_6)),{addToJSMap:n5}),stringify:()=>_6},JH=($,Z)=>(M6.identify(Z)||P6.isScalar(Z)&&(!Z.type||Z.type===i5.Scalar.PLAIN)&&M6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===M6.tag&&Q.default);function n5($,Z,Q){let z=s5($,Q);if(P6.isSeq(z))for(let X of z.items)a8($,Z,X);else if(Array.isArray(z))for(let X of z)a8($,Z,X);else a8($,Z,z)}function a8($,Z,Q){let z=s5($,Q);if(!P6.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 s5($,Z){return $&&P6.isAlias(Z)?Z.resolve($.doc,$):Z}VH.addMergeToJSMap=n5;VH.isMergeKey=JH;VH.merge=M6});var e8=P((IH)=>{var BH=o8(),r5=N6(),qH=I$(),o5=y(),t8=m0();function KH($,Z,{key:Q,value:z}){if(o5.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(r5.isMergeKey($,Q))r5.addMergeToJSMap($,Z,z);else{let X=t8.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,t8.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let H=DH(Q,X,$),U=t8.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 DH($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(o5.isNode($)&&Q?.doc){let z=qH.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)+'..."';BH.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)}IH.addPairToJSMap=KH});var c0=P((PH)=>{var a5=B$(),OH=c5(),_H=e8(),R6=y();function MH($,Z,Q){let z=a5.createNode($,void 0,Q),X=a5.createNode(Z,void 0,Q);return new F6(z,X)}class F6{constructor($,Z=null){Object.defineProperty(this,R6.NODE_TYPE,{value:R6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(R6.isNode(Z))Z=Z.clone($);if(R6.isNode(Q))Q=Q.clone($);return new F6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return _H.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?OH.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}PH.Pair=F6;PH.createPair=MH});var $1=P((CH)=>{var z2=y(),t5=I$(),A6=q$();function FH($,Z,Q){return(Z.inFlow??$.flow?TH:AH)($,Z,Q)}function AH({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:H,onChompKeep:U,onComment:J}){let{indent:V,options:{commentString:G}}=Q,Y=Object.assign({},Q,{indent:H,type:null}),W=!1,B=[];for(let I=0;I<Z.length;++I){let q=Z[I],D=null;if(z2.isNode(q)){if(!W&&q.spaceBefore)B.push("");if(T6(Q,B,q.commentBefore,W),q.comment)D=q.comment}else if(z2.isPair(q)){let M=z2.isNode(q.key)?q.key:null;if(M){if(!W&&M.spaceBefore)B.push("");T6(Q,B,M.commentBefore,W)}}W=!1;let O=t5.stringify(q,Y,()=>D=null,()=>W=!0);if(D)O+=A6.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 I=1;I<B.length;++I){let q=B[I];K+=q?`
|
|
45
45
|
${V}${q}`:`
|
|
46
46
|
`}}if($){if(K+=`
|
|
47
|
-
`+A6.indentComment(G($),V),J)J()}else if(W&&U)U();return K}function
|
|
48
|
-
`)),I<$.length-1)
|
|
47
|
+
`+A6.indentComment(G($),V),J)J()}else if(W&&U)U();return K}function TH({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:H,flowCollectionPadding:U,options:{commentString:J}}=Z;z+=H;let V=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),G=!1,Y=0,W=[];for(let I=0;I<$.length;++I){let q=$[I],D=null;if(z2.isNode(q)){if(q.spaceBefore)W.push("");if(T6(Z,W,q.commentBefore,!1),q.comment)D=q.comment}else if(z2.isPair(q)){let M=z2.isNode(q.key)?q.key:null;if(M){if(M.spaceBefore)W.push("");if(T6(Z,W,M.commentBefore,!1),M.comment)G=!0}let F=z2.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=t5.stringify(q,V,()=>D=null);if(G||(G=W.length>Y||O.includes(`
|
|
48
|
+
`)),I<$.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+=A6.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 I=W.reduce((q,D)=>q+D.length+2,2);G=Z.options.lineWidth>0&&I>Z.options.lineWidth}if(G){let I=B;for(let q of W)I+=q?`
|
|
49
49
|
${H}${X}${q}`:`
|
|
50
50
|
`;return`${I}
|
|
51
|
-
${X}${K}`}else return`${B}${U}${W.join(" ")}${U}${K}`}}function T6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let H=A6.indentComment(Z(z),$);Q.push(H.trimStart())}}
|
|
52
|
-
`:" ")}return
|
|
51
|
+
${X}${K}`}else return`${B}${U}${W.join(" ")}${U}${K}`}}function T6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let H=A6.indentComment(Z(z),$);Q.push(H.trimStart())}}CH.stringifyCollection=FH});var i0=P((yH)=>{var jH=$1(),SH=e8(),EH=D6(),d0=y(),C6=c0(),bH=l();function O$($,Z){let Q=d0.isScalar(Z)?Z.value:Z;for(let z of $)if(d0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(d0.isScalar(z.key)&&z.key.value===Q)return z}return}class e5 extends EH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(d0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,H=new this($),U=(J,V)=>{if(typeof X==="function")V=X.call(Z,J,V);else if(Array.isArray(X)&&!X.includes(J))return;if(V!==void 0||z)H.items.push(C6.createPair(J,V,Q))};if(Z instanceof Map)for(let[J,V]of Z)U(J,V);else if(Z&&typeof Z==="object")for(let J of Object.keys(Z))U(J,Z[J]);if(typeof $.sortMapEntries==="function")H.items.sort($.sortMapEntries);return H}add($,Z){let Q;if(d0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new C6.Pair($,$?.value);else Q=new C6.Pair($.key,$.value);let z=O$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(d0.isScalar(z.value)&&bH.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=O$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=O$(this.items,$)?.value;return(!Z&&d0.isScalar(z)?z.value:z)??void 0}has($){return!!O$(this.items,$)}set($,Z){this.add(new C6.Pair($,Z),!0)}toJSON($,Z,Q){let z=Q?new Q:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(z);for(let X of this.items)SH.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!d0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return jH.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}yH.YAMLMap=e5;yH.findPair=O$});var b2=P((hH)=>{var vH=y(),$Z=i0(),kH={collection:"map",default:!0,nodeClass:$Z.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!vH.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>$Z.YAMLMap.from($,Z,Q)};hH.map=kH});var n0=P((dH)=>{var uH=B$(),mH=$1(),pH=D6(),j6=y(),lH=l(),cH=m0();class ZZ extends pH.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(j6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=w6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=w6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&j6.isScalar(z)?z.value:z}has($){let Z=w6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=w6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(j6.isScalar(z)&&lH.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(cH.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return mH.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(uH.createNode(U,void 0,Q))}}return X}}function w6($){let Z=j6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}dH.YAMLSeq=ZZ});var y2=P((rH)=>{var nH=y(),QZ=n0(),sH={collection:"seq",default:!0,nodeClass:QZ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!nH.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>QZ.YAMLSeq.from($,Z,Q)};rH.seq=sH});var _$=P((eH)=>{var aH=D$(),tH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),aH.stringifyString($,Z,Q,z)}};eH.string=tH});var S6=P((ZU)=>{var zZ=l(),XZ={identify:($)=>$==null,createNode:()=>new zZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new zZ.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&XZ.test.test($)?$:Z.options.nullStr};ZU.nullTag=XZ});var Z1=P((XU)=>{var zU=l(),HZ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new zU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&HZ.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};XU.boolTag=HZ});var x2=P((JU)=>{function UU({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}JU.stringifyNumber=UU});var z1=P((qU)=>{var GU=l(),Q1=x2(),YU={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:Q1.stringifyNumber},WU={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():Q1.stringifyNumber($)}},BU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new GU.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:Q1.stringifyNumber};qU.float=BU;qU.floatExp=WU;qU.floatNaN=YU});var H1=P((MU)=>{var UZ=x2(),E6=($)=>typeof $==="bigint"||Number.isInteger($),X1=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function JZ($,Z,Q){let{value:z}=$;if(E6(z)&&z>=0)return Q+z.toString(Z);return UZ.stringifyNumber($)}var LU={identify:($)=>E6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>X1($,2,8,Q),stringify:($)=>JZ($,8,"0o")},OU={identify:E6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>X1($,0,10,Q),stringify:UZ.stringifyNumber},_U={identify:($)=>E6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>X1($,2,16,Q),stringify:($)=>JZ($,16,"0x")};MU.int=OU;MU.intHex=_U;MU.intOct=LU});var VZ=P((SU)=>{var FU=b2(),AU=S6(),TU=y2(),CU=_$(),wU=Z1(),U1=z1(),J1=H1(),jU=[FU.map,TU.seq,CU.string,AU.nullTag,wU.boolTag,J1.intOct,J1.int,J1.intHex,U1.floatNaN,U1.floatExp,U1.float];SU.schema=jU});var YZ=P((hU)=>{var bU=l(),yU=b2(),xU=y2();function GZ($){return typeof $==="bigint"||Number.isInteger($)}var b6=({value:$})=>JSON.stringify($),gU=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:b6},{identify:($)=>$==null,createNode:()=>new bU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:b6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:b6},{identify:GZ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>GZ($)?$.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:b6}],vU={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},kU=[yU.map,xU.seq].concat(gU,vU);hU.schema=kU});var G1=P((pU)=>{var M$=X$("buffer"),V1=l(),uU=D$(),mU={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof M$.Buffer==="function")return M$.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 M$.Buffer==="function")J=U instanceof M$.Buffer?U.toString("base64"):M$.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=V1.Scalar.BLOCK_LITERAL),Z!==V1.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===V1.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return uU.stringifyString({comment:$,type:Z,value:J},z,X,H)}};pU.binary=mU});var x6=P((nU)=>{var y6=y(),Y1=c0(),cU=l(),dU=n0();function WZ($,Z){if(y6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(y6.isPair(z))continue;else if(y6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new Y1.Pair(new cU.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
|
|
53
53
|
${X.key.commentBefore}`:z.commentBefore;if(z.comment){let H=X.value??X.key;H.comment=H.comment?`${z.comment}
|
|
54
|
-
${H.comment}`:z.comment}z=X}$.items[Q]=y6.isPair(z)?z:new Y1.Pair(z)}else Z("Expected a sequence for this tag");return $}function YZ($,Z,Q){let{replacer:z}=Q,X=new lU.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(Y1.createPair(J,V,Q))}return X}var cU={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:GZ,createNode:YZ};dU.createPairs=YZ;dU.pairs=cU;dU.resolvePairs=GZ});var B1=P((aU)=>{var WZ=y(),W1=m0(),P$=i0(),rU=n0(),BZ=x6();class X2 extends rU.YAMLSeq{constructor(){super();this.add=P$.YAMLMap.prototype.add.bind(this),this.delete=P$.YAMLMap.prototype.delete.bind(this),this.get=P$.YAMLMap.prototype.get.bind(this),this.has=P$.YAMLMap.prototype.has.bind(this),this.set=P$.YAMLMap.prototype.set.bind(this),this.tag=X2.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(WZ.isPair(z))X=W1.toJS(z.key,"",Z),H=W1.toJS(z.value,X,Z);else X=W1.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=BZ.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}X2.tag="tag:yaml.org,2002:omap";var oU={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:X2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=BZ.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(WZ.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 X2,Q)},createNode:($,Z,Q)=>X2.from($,Z,Q)};aU.YAMLOMap=X2;aU.omap=oU});var LZ=P(($J)=>{var qZ=l();function KZ({value:$,source:Z},Q){if(Z&&($?DZ:IZ).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var DZ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new qZ.Scalar(!0),stringify:KZ},IZ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new qZ.Scalar(!1),stringify:KZ};$J.falseTag=IZ;$J.trueTag=DZ});var _Z=P((JJ)=>{var zJ=l(),q1=x2(),XJ={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:q1.stringifyNumber},HJ={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():q1.stringifyNumber($)}},UJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new zJ.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:q1.stringifyNumber};JJ.float=UJ;JJ.floatExp=HJ;JJ.floatNaN=XJ});var MZ=P((DJ)=>{var OZ=x2(),R$=($)=>typeof $==="bigint"||Number.isInteger($);function g6($,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 K1($,Z,Q){let{value:z}=$;if(R$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return OZ.stringifyNumber($)}var WJ={identify:R$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>g6($,2,2,Q),stringify:($)=>K1($,2,"0b")},BJ={identify:R$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>g6($,1,8,Q),stringify:($)=>K1($,8,"0")},qJ={identify:R$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>g6($,0,10,Q),stringify:OZ.stringifyNumber},KJ={identify:R$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>g6($,2,16,Q),stringify:($)=>K1($,16,"0x")};DJ.int=qJ;DJ.intBin=WJ;DJ.intHex=KJ;DJ.intOct=BJ});var D1=P((PJ)=>{var h6=y(),v6=c0(),k6=i0();class H2 extends k6.YAMLMap{constructor($){super($);this.tag=H2.tag}add($){let Z;if(h6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new v6.Pair($.key,null);else Z=new v6.Pair($,null);if(!k6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=k6.findPair(this.items,$);return!Z&&h6.isPair(Q)?h6.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=k6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new v6.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(v6.createPair(H,null,Q))}return X}}H2.tag="tag:yaml.org,2002:set";var MJ={collection:"map",identify:($)=>$ instanceof Set,nodeClass:H2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>H2.from($,Z,Q),resolve($,Z){if(h6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new H2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};PJ.YAMLSet=H2;PJ.set=MJ});var L1=P((CJ)=>{var FJ=x2();function I1($,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 PZ($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return FJ.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 AJ={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})=>I1($,Q),stringify:PZ},TJ={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:($)=>I1($,!1),stringify:PZ},RZ={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(RZ.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=I1(Y,!1);if(Math.abs(W)<30)W*=60;G-=60000*W}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};CJ.floatTime=TJ;CJ.intTime=AJ;CJ.timestamp=RZ});var FZ=P((mJ)=>{var EJ=b2(),bJ=S6(),yJ=y2(),xJ=O$(),gJ=G1(),NZ=LZ(),_1=_Z(),f6=MZ(),vJ=R6(),kJ=B1(),hJ=x6(),fJ=D1(),O1=L1(),uJ=[EJ.map,yJ.seq,xJ.string,bJ.nullTag,NZ.trueTag,NZ.falseTag,f6.intBin,f6.intOct,f6.int,f6.intHex,_1.floatNaN,_1.floatExp,_1.float,gJ.binary,vJ.merge,kJ.omap,hJ.pairs,fJ.set,O1.intTime,O1.floatTime,O1.timestamp];mJ.schema=uJ});var xZ=P((oJ)=>{var wZ=b2(),lJ=S6(),jZ=y2(),cJ=O$(),dJ=Z1(),M1=z1(),P1=H1(),iJ=UZ(),nJ=VZ(),SZ=G1(),N$=R6(),EZ=B1(),bZ=x6(),AZ=FZ(),yZ=D1(),u6=L1(),TZ=new Map([["core",iJ.schema],["failsafe",[wZ.map,jZ.seq,cJ.string]],["json",nJ.schema],["yaml11",AZ.schema],["yaml-1.1",AZ.schema]]),CZ={binary:SZ.binary,bool:dJ.boolTag,float:M1.float,floatExp:M1.floatExp,floatNaN:M1.floatNaN,floatTime:u6.floatTime,int:P1.int,intHex:P1.intHex,intOct:P1.intOct,intTime:u6.intTime,map:wZ.map,merge:N$.merge,null:lJ.nullTag,omap:EZ.omap,pairs:bZ.pairs,seq:jZ.seq,set:yZ.set,timestamp:u6.timestamp},sJ={"tag:yaml.org,2002:binary":SZ.binary,"tag:yaml.org,2002:merge":N$.merge,"tag:yaml.org,2002:omap":EZ.omap,"tag:yaml.org,2002:pairs":bZ.pairs,"tag:yaml.org,2002:set":yZ.set,"tag:yaml.org,2002:timestamp":u6.timestamp};function rJ($,Z,Q){let z=TZ.get(Z);if(z&&!$)return Q&&!z.includes(N$.merge)?z.concat(N$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let H=Array.from(TZ.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(N$.merge);return X.reduce((H,U)=>{let J=typeof U==="string"?CZ[U]:U;if(!J){let V=JSON.stringify(U),G=Object.keys(CZ).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},[])}oJ.coreKnownTags=sJ;oJ.getTags=rJ});var F1=P((zV)=>{var R1=y(),eJ=b2(),$V=y2(),ZV=O$(),m6=xZ(),QV=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class N1{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?m6.getTags($,"compat"):$?m6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?m6.coreKnownTags:{},this.tags=m6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,R1.MAP,{value:eJ.map}),Object.defineProperty(this,R1.SCALAR,{value:ZV.string}),Object.defineProperty(this,R1.SEQ,{value:$V.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?QV:null}clone(){let $=Object.create(N1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}zV.Schema=N1});var gZ=P((JV)=>{var HV=y(),A1=I$(),F$=q$();function UV($,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=A1.createStringifyContext($,Z),{commentString:H}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=H($.commentBefore);Q.unshift(F$.indentComment(V,""))}let U=!1,J=null;if($.contents){if(HV.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=H($.contents.commentBefore);Q.push(F$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let V=J?void 0:()=>U=!0,G=A1.stringify($.contents,X,()=>J=null,V);if(J)G+=F$.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(A1.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=H($.comment);if(V.includes(`
|
|
54
|
+
${H.comment}`:z.comment}z=X}$.items[Q]=y6.isPair(z)?z:new Y1.Pair(z)}else Z("Expected a sequence for this tag");return $}function BZ($,Z,Q){let{replacer:z}=Q,X=new dU.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(Y1.createPair(J,V,Q))}return X}var iU={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:WZ,createNode:BZ};nU.createPairs=BZ;nU.pairs=iU;nU.resolvePairs=WZ});var B1=P((eU)=>{var qZ=y(),W1=m0(),P$=i0(),aU=n0(),KZ=x6();class X2 extends aU.YAMLSeq{constructor(){super();this.add=P$.YAMLMap.prototype.add.bind(this),this.delete=P$.YAMLMap.prototype.delete.bind(this),this.get=P$.YAMLMap.prototype.get.bind(this),this.has=P$.YAMLMap.prototype.has.bind(this),this.set=P$.YAMLMap.prototype.set.bind(this),this.tag=X2.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(qZ.isPair(z))X=W1.toJS(z.key,"",Z),H=W1.toJS(z.value,X,Z);else X=W1.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=KZ.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}X2.tag="tag:yaml.org,2002:omap";var tU={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:X2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=KZ.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(qZ.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 X2,Q)},createNode:($,Z,Q)=>X2.from($,Z,Q)};eU.YAMLOMap=X2;eU.omap=tU});var _Z=P((QJ)=>{var DZ=l();function IZ({value:$,source:Z},Q){if(Z&&($?LZ:OZ).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var LZ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new DZ.Scalar(!0),stringify:IZ},OZ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new DZ.Scalar(!1),stringify:IZ};QJ.falseTag=OZ;QJ.trueTag=LZ});var MZ=P((GJ)=>{var HJ=l(),q1=x2(),UJ={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:q1.stringifyNumber},JJ={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():q1.stringifyNumber($)}},VJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new HJ.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:q1.stringifyNumber};GJ.float=VJ;GJ.floatExp=JJ;GJ.floatNaN=UJ});var NZ=P((LJ)=>{var PZ=x2(),N$=($)=>typeof $==="bigint"||Number.isInteger($);function g6($,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 K1($,Z,Q){let{value:z}=$;if(N$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return PZ.stringifyNumber($)}var qJ={identify:N$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>g6($,2,2,Q),stringify:($)=>K1($,2,"0b")},KJ={identify:N$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>g6($,1,8,Q),stringify:($)=>K1($,8,"0")},DJ={identify:N$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>g6($,0,10,Q),stringify:PZ.stringifyNumber},IJ={identify:N$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>g6($,2,16,Q),stringify:($)=>K1($,16,"0x")};LJ.int=DJ;LJ.intBin=qJ;LJ.intHex=IJ;LJ.intOct=KJ});var D1=P((RJ)=>{var h6=y(),v6=c0(),k6=i0();class H2 extends k6.YAMLMap{constructor($){super($);this.tag=H2.tag}add($){let Z;if(h6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new v6.Pair($.key,null);else Z=new v6.Pair($,null);if(!k6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=k6.findPair(this.items,$);return!Z&&h6.isPair(Q)?h6.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=k6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new v6.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(v6.createPair(H,null,Q))}return X}}H2.tag="tag:yaml.org,2002:set";var NJ={collection:"map",identify:($)=>$ instanceof Set,nodeClass:H2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>H2.from($,Z,Q),resolve($,Z){if(h6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new H2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};RJ.YAMLSet=H2;RJ.set=NJ});var L1=P((jJ)=>{var TJ=x2();function I1($,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 RZ($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return TJ.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 CJ={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})=>I1($,Q),stringify:RZ},wJ={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:($)=>I1($,!1),stringify:RZ},FZ={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(FZ.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=I1(Y,!1);if(Math.abs(W)<30)W*=60;G-=60000*W}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};jJ.floatTime=wJ;jJ.intTime=CJ;jJ.timestamp=FZ});var TZ=P((lJ)=>{var yJ=b2(),xJ=S6(),gJ=y2(),vJ=_$(),kJ=G1(),AZ=_Z(),O1=MZ(),f6=NZ(),hJ=N6(),fJ=B1(),uJ=x6(),mJ=D1(),_1=L1(),pJ=[yJ.map,gJ.seq,vJ.string,xJ.nullTag,AZ.trueTag,AZ.falseTag,f6.intBin,f6.intOct,f6.int,f6.intHex,O1.floatNaN,O1.floatExp,O1.float,kJ.binary,hJ.merge,fJ.omap,uJ.pairs,mJ.set,_1.intTime,_1.floatTime,_1.timestamp];lJ.schema=pJ});var vZ=P((tJ)=>{var SZ=b2(),dJ=S6(),EZ=y2(),iJ=_$(),nJ=Z1(),M1=z1(),P1=H1(),sJ=VZ(),rJ=YZ(),bZ=G1(),R$=N6(),yZ=B1(),xZ=x6(),CZ=TZ(),gZ=D1(),u6=L1(),wZ=new Map([["core",sJ.schema],["failsafe",[SZ.map,EZ.seq,iJ.string]],["json",rJ.schema],["yaml11",CZ.schema],["yaml-1.1",CZ.schema]]),jZ={binary:bZ.binary,bool:nJ.boolTag,float:M1.float,floatExp:M1.floatExp,floatNaN:M1.floatNaN,floatTime:u6.floatTime,int:P1.int,intHex:P1.intHex,intOct:P1.intOct,intTime:u6.intTime,map:SZ.map,merge:R$.merge,null:dJ.nullTag,omap:yZ.omap,pairs:xZ.pairs,seq:EZ.seq,set:gZ.set,timestamp:u6.timestamp},oJ={"tag:yaml.org,2002:binary":bZ.binary,"tag:yaml.org,2002:merge":R$.merge,"tag:yaml.org,2002:omap":yZ.omap,"tag:yaml.org,2002:pairs":xZ.pairs,"tag:yaml.org,2002:set":gZ.set,"tag:yaml.org,2002:timestamp":u6.timestamp};function aJ($,Z,Q){let z=wZ.get(Z);if(z&&!$)return Q&&!z.includes(R$.merge)?z.concat(R$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let H=Array.from(wZ.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(R$.merge);return X.reduce((H,U)=>{let J=typeof U==="string"?jZ[U]:U;if(!J){let V=JSON.stringify(U),G=Object.keys(jZ).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},[])}tJ.coreKnownTags=oJ;tJ.getTags=aJ});var F1=P((HV)=>{var N1=y(),ZV=b2(),QV=y2(),zV=_$(),m6=vZ(),XV=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class R1{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?m6.getTags($,"compat"):$?m6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?m6.coreKnownTags:{},this.tags=m6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,N1.MAP,{value:ZV.map}),Object.defineProperty(this,N1.SCALAR,{value:zV.string}),Object.defineProperty(this,N1.SEQ,{value:QV.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?XV:null}clone(){let $=Object.create(R1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}HV.Schema=R1});var kZ=P((GV)=>{var JV=y(),A1=I$(),F$=q$();function VV($,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=A1.createStringifyContext($,Z),{commentString:H}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=H($.commentBefore);Q.unshift(F$.indentComment(V,""))}let U=!1,J=null;if($.contents){if(JV.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=H($.contents.commentBefore);Q.push(F$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let V=J?void 0:()=>U=!0,G=A1.stringify($.contents,X,()=>J=null,V);if(J)G+=F$.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(A1.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=H($.comment);if(V.includes(`
|
|
55
55
|
`))Q.push("..."),Q.push(F$.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(F$.indentComment(H(V),""))}}return Q.join(`
|
|
56
56
|
`)+`
|
|
57
|
-
`}
|
|
57
|
+
`}GV.stringifyDocument=VV});var A$=P((OV)=>{var WV=W$(),g2=D6(),U0=y(),BV=c0(),qV=m0(),KV=F1(),DV=kZ(),T1=B6(),IV=d8(),LV=B$(),C1=c8();class w1{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,U0.NODE_TYPE,{value:U0.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 C1.Directives({version:H});this.setSchema(H,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(w1.prototype,{[U0.NODE_TYPE]:{value:U0.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=U0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(v2(this.contents))this.contents.add($)}addIn($,Z){if(v2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=T1.anchorNames(this);$.anchor=!Z||Q.has(Z)?T1.findNewAnchor(Z||"a",Q):Z}return new WV.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}=T1.createNodeAnchors(this,H||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:J??!1,onAnchor:Y,onTagObj:V,replacer:z,schema:this.schema,sourceObjects:B},I=LV.createNode($,G,K);if(U&&U0.isCollection(I))I.flow=!0;return W(),I}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new BV.Pair(z,X)}delete($){return v2(this.contents)?this.contents.delete($):!1}deleteIn($){if(g2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return v2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return U0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(g2.isEmptyPath($))return!Z&&U0.isScalar(this.contents)?this.contents.value:this.contents;return U0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return U0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(g2.isEmptyPath($))return this.contents!==void 0;return U0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=g2.collectionFromPath(this.schema,[$],Z);else if(v2(this.contents))this.contents.set($,Z)}setIn($,Z){if(g2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=g2.collectionFromPath(this.schema,Array.from($),Z);else if(v2(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 C1.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 C1.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 KV.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=qV.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"?IV.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 DV.stringifyDocument(this,$)}}function v2($){if(U0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}OV.Document=w1});var T$=P((PV)=>{class p6 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class hZ extends p6{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class fZ extends p6{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var MV=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((J)=>Z.linePos(J));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let H=X-1,U=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(H>=60&&U.length>80){let J=Math.min(H-39,U.length-79);U="…"+U.substring(J),H-=J-1}if(U.length>80)U=U.substring(0,79)+"…";if(z>1&&/^ *$/.test(U.substring(0,H))){let J=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(J.length>80)J=J.substring(0,79)+`…
|
|
58
58
|
`;U=J+U}if(/[^ ]/.test(U)){let J=1,V=Q.linePos[1];if(V?.line===z&&V.col>X)J=Math.max(1,Math.min(V.col-X,80-H));let G=" ".repeat(H)+"^".repeat(J);Q.message+=`:
|
|
59
59
|
|
|
60
60
|
${U}
|
|
61
61
|
${G}
|
|
62
|
-
`}};
|
|
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(j1(Z.key)||j1(Z.value))return!0}return!1;default:return!0}}
|
|
64
|
-
`+q.comment;else J.comment=q.comment;continue}if(q.newlineAfterProp||
|
|
65
|
-
`+F.comment;else M.comment=F.comment;let
|
|
66
|
-
`+T.comment;else G.comment=T.comment;W=T.end;continue}if(!U&&Q.options.strict&&
|
|
67
|
-
`+C;else
|
|
68
|
-
`+j.comment;else
|
|
69
|
-
`+D.comment;else G.comment=D.comment;G.range=[z.offset,q,D.offset]}else G.range=[z.offset,q,q];return G}
|
|
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,
|
|
71
|
-
`;for(let q=Y;q<J;++q){let[D,
|
|
72
|
-
`;else if(D.length>V||
|
|
62
|
+
`}};PV.YAMLError=p6;PV.YAMLParseError=hZ;PV.YAMLWarning=fZ;PV.prettifyError=MV});var C$=P((CV)=>{function TV($,{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,I=!1,q=null,D=null,O=null,M=null,F=null,R=null,A=null;for(let N of $){if(I){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");I=!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 j=N.source.substring(1)||" ";if(!W)W=j;else W+=B+j;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,A??(A=N.offset),G=!1,Y=!1,I=!0;break;case"tag":{if(O)H(N,"MULTIPLE_TAGS","A node can have at most one tag");O=N,A??(A=N.offset),G=!1,Y=!1,I=!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 T=$[$.length-1],C=T?T.offset+T.source.length:X;if(I&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))H(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(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:C,start:A??C}}CV.resolveProps=TV});var l6=P((jV)=>{function j1($){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(j1(Z.key)||j1(Z.value))return!0}return!1;default:return!0}}jV.containsNewline=j1});var S1=P((yV)=>{var EV=l6();function bV($,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)}}yV.flowIndentCheck=bV});var E1=P((vV)=>{var uZ=y();function gV($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(H,U)=>H===U||uZ.isScalar(H)&&uZ.isScalar(U)&&H.value===U.value;return Z.some((H)=>X(H.key,Q))}vV.mapIncludes=gV});var dZ=P((pV)=>{var mZ=c0(),hV=i0(),pZ=C$(),fV=l6(),lZ=S1(),uV=E1(),cZ="All mapping items must start at the same column";function mV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??hV.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:I}=Y,q=pZ.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",cZ)}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||fV.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",cZ);Q.atKey=!0;let O=q.end,M=B?$(Q,B,q,X):Z(Q,O,W,null,q,X);if(Q.schema.compat)lZ.flowIndentCheck(z.indent,B,X);if(Q.atKey=!1,uV.mapIncludes(Q,J.items,M))X(O,"DUPLICATE_KEY","Map keys must be unique");let F=pZ.resolveProps(K??[],{indicator:"map-value-ind",next:I,offset:M.range[2],onError:X,parentIndent:z.indent,startOnNewline:!B||B.type==="block-scalar"});if(V=F.end,F.found){if(D){if(I?.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=I?$(Q,I,F,X):Z(Q,V,K,null,F,X);if(Q.schema.compat)lZ.flowIndentCheck(z.indent,I,X);V=R.range[2];let A=new mZ.Pair(M,R);if(Q.options.keepSourceTokens)A.srcToken=Y;J.items.push(A)}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 mZ.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}pV.resolveBlockMap=mV});var iZ=P((sV)=>{var cV=n0(),dV=C$(),iV=S1();function nV({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let J=new(H?.nodeClass??cV.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=dV.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)iV.flowIndentCheck(z.indent,W,X);V=K.range[2],J.items.push(K)}return J.range=[z.offset,V,G??V],J}sV.resolveBlockSeq=nV});var k2=P((aV)=>{function oV($,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}}aV.resolveEnd=oV});var rZ=P((UG)=>{var eV=y(),$G=c0(),nZ=i0(),ZG=n0(),QG=k2(),sZ=C$(),zG=l6(),XG=E1(),b1="Block collections are not allowed within flow collections",y1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function HG({composeNode:$,composeEmptyNode:Z},Q,z,X,H){let U=z.start.source==="{",J=U?"flow map":"flow sequence",G=new(H?.nodeClass??(U?nZ.YAMLMap:ZG.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:A}=O,T=sZ.resolveProps(M,{flow:J,indicator:"explicit-key-ind",next:F??R?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!R&&!A){if(D===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(D<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(T.comment)if(G.comment)G.comment+=`
|
|
66
|
+
`+T.comment;else G.comment=T.comment;W=T.end;continue}if(!U&&Q.options.strict&&zG.containsNewline(F))X(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!T.comma)X(T.start,"MISSING_CHAR",`Missing , between ${J} items`);if(T.comment){let C="";$:for(let N of M)switch(N.type){case"comma":case"space":break;case"comment":C=N.source.substring(1);break $;default:break $}if(C){let N=G.items[G.items.length-1];if(eV.isPair(N))N=N.value??N.key;if(N.comment)N.comment+=`
|
|
67
|
+
`+C;else N.comment=C;T.comment=T.comment.substring(C.length+1)}}}if(!U&&!R&&!T.found){let C=A?$(Q,A,T,X):Z(Q,T.end,R,null,T,X);if(G.items.push(C),W=C.range[2],y1(A))X(C.range,"BLOCK_IN_FLOW",b1)}else{Q.atKey=!0;let C=T.end,N=F?$(Q,F,T,X):Z(Q,C,M,null,T,X);if(y1(F))X(N.range,"BLOCK_IN_FLOW",b1);Q.atKey=!1;let j=sZ.resolveProps(R??[],{flow:J,indicator:"map-value-ind",next:A,offset:N.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(j.found){if(!U&&!T.found&&Q.options.strict){if(R)for(let _ of R){if(_===j.found)break;if(_.type==="newline"){X(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(T.start<j.found.offset-1024)X(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(A)if("source"in A&&A.source?.[0]===":")X(A,"MISSING_CHAR",`Missing space after : in ${J}`);else X(j.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let d=A?$(Q,A,j,X):j.found?Z(Q,j.end,R,null,j,X):null;if(d){if(y1(A))X(d.range,"BLOCK_IN_FLOW",b1)}else if(j.comment)if(N.comment)N.comment+=`
|
|
68
|
+
`+j.comment;else N.comment=j.comment;let t=new $G.Pair(N,d);if(Q.options.keepSourceTokens)t.srcToken=O;if(U){let _=G;if(XG.mapIncludes(Q,_.items,N))X(C,"DUPLICATE_KEY","Map keys must be unique");_.items.push(t)}else{let _=new nZ.YAMLMap(Q.schema);_.flow=!0,_.items.push(t);let E=(d??N).range;_.range=[N.range[0],E[1],E[2]],G.items.push(_)}W=d?d.range[2]:j.end}}let B=U?"}":"]",[K,...I]=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)I.unshift(K)}if(I.length>0){let D=QG.resolveEnd(I,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}UG.resolveFlowCollection=HG});var oZ=P((IG)=>{var VG=y(),GG=l(),YG=i0(),WG=n0(),BG=dZ(),qG=iZ(),KG=rZ();function x1($,Z,Q,z,X,H){let U=Q.type==="block-map"?BG.resolveBlockMap($,Z,Q,z,H):Q.type==="block-seq"?qG.resolveBlockSeq($,Z,Q,z,H):KG.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 DG($,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,I=B&&H?B.offset>H.offset?B:H:B??H;if(I&&(!K||K.offset<I.offset))X(I,"MISSING_CHAR","Missing newline after block sequence props")}let J=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!H||!U||U==="!"||U===YG.YAMLMap.tagName&&J==="map"||U===WG.YAMLSeq.tagName&&J==="seq")return x1($,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 x1($,Z,Q,X,U)}}let G=x1($,Z,Q,X,U,V),Y=V.resolve?.(G,(B)=>X(H,"TAG_RESOLVE_FAILED",B),Z.options)??G,W=VG.isNode(Y)?Y:new GG.Scalar(Y);if(W.range=G.range,W.tag=U,V?.format)W.format=V.format;return W}IG.composeCollection=DG});var v1=P((PG)=>{var g1=l();function OG($,Z,Q){let z=Z.offset,X=_G(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let H=X.mode===">"?g1.Scalar.BLOCK_FOLDED:g1.Scalar.BLOCK_LITERAL,U=Z.source?MG(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===g1.Scalar.BLOCK_LITERAL)W+=B+D.slice(V)+O,B=`
|
|
72
|
+
`;else if(D.length>V||O[0]==="\t"){if(B===" ")B=`
|
|
73
73
|
`;else if(!K&&B===`
|
|
74
74
|
`)B=`
|
|
75
75
|
|
|
76
|
-
`;W+=B+D.slice(V)+
|
|
77
|
-
`,K=!0}else if(
|
|
76
|
+
`;W+=B+D.slice(V)+O,B=`
|
|
77
|
+
`,K=!0}else if(O==="")if(B===`
|
|
78
78
|
`)W+=`
|
|
79
79
|
`;else B=`
|
|
80
|
-
`;else W+=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
81
|
`+U[q][0].slice(V);if(W[W.length-1]!==`
|
|
82
82
|
`)W+=`
|
|
83
83
|
`;break;default:W+=`
|
|
84
|
-
`}let I=z+X.length+Z.source.length;return{value:W,type:H,comment:X.comment,range:[z,I,I]}}function
|
|
84
|
+
`}let I=z+X.length+Z.source.length;return{value:W,type:H,comment:X.comment,range:[z,I,I]}}function _G({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 I=Number(K);if(!U&&I)U=I;else if(V===-1)V=$+B}}if(V!==-1)z(V,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let G=!1,Y="",W=X.length;for(let B=1;B<Z.length;++B){let 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 I=`Unexpected token in block scalar header: ${K.type}`;z(K,"UNEXPECTED_TOKEN",I);let q=K.source;if(q&&typeof q==="string")W+=q.length}}}return{mode:H,indent:U,chomp:J,comment:Y,length:W}}function MG($){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}PG.resolveBlockScalar=OG});var h1=P((EG)=>{var k1=l(),RG=k2();function FG($,Z,Q){let{offset:z,type:X,source:H,end:U}=$,J,V,G=(B,K,I)=>Q(z+B,K,I);switch(X){case"scalar":J=k1.Scalar.PLAIN,V=AG(H,G);break;case"single-quoted-scalar":J=k1.Scalar.QUOTE_SINGLE,V=TG(H,G);break;case"double-quoted-scalar":J=k1.Scalar.QUOTE_DOUBLE,V=CG(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=RG.resolveEnd(U,Y,Z,Q);return{value:V,type:J,comment:W.comment,range:[z,Y,W.offset]}}function AG($,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 aZ($)}function TG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return aZ($.slice(1,-1)).replace(/''/g,"'")}function aZ($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
85
|
`,"sy"),Q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
86
|
`,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],H=" ",U=Z.lastIndex;Q.lastIndex=U;while(z=Q.exec($)){if(z[1]==="")if(H===`
|
|
87
87
|
`)X+=H;else H=`
|
|
88
|
-
`;else X+=H+z[1],H=" ";U=Q.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=U,z=J.exec($),X+H+(z?.[1]??"")}function
|
|
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 CG($,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}=
|
|
90
|
+
`){let{fold:H,offset:U}=wG($,z);Q+=H,z=U}else if(X==="\\"){let H=$[++z],U=jG[H];if(U)Q+=U;else if(H===`
|
|
91
91
|
`){H=$[z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="\r"&&$[z+1]===`
|
|
92
|
-
`){H=$[++z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="x"||H==="u"||H==="U"){let J=H==="x"?2:H==="u"?4:8;Q+=
|
|
92
|
+
`){H=$[++z+1];while(H===" "||H==="\t")H=$[++z+1]}else if(H==="x"||H==="u"||H==="U"){let J=H==="x"?2:H==="u"?4:8;Q+=SG($,z+1,J,Z),z+=J}else{let J=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),Q+=J}}else if(X===" "||X==="\t"){let H=z,U=$[z+1];while(U===" "||U==="\t")U=$[++z+1];if(U!==`
|
|
93
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
|
|
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 wG($,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
|
|
99
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
98
|
+
`;Z+=1,z=$[Z+1]}if(!Q)Q=" ";return{fold:Q,offset:Z}}var jG={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function SG($,Z,Q,z){let X=$.substr(Z,Q),U=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(U)}catch{let J=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}}EG.resolveFlowScalar=FG});var eZ=P((hG)=>{var U2=y(),tZ=l(),yG=v1(),xG=h1();function gG($,Z,Q,z){let{value:X,type:H,comment:U,range:J}=Z.type==="block-scalar"?yG.resolveBlockScalar($,Z,z):xG.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[U2.SCALAR];else if(V)G=vG($.schema,X,V,Q,z);else if(Z.type==="scalar")G=kG($,X,Z,z);else G=$.schema[U2.SCALAR];let Y;try{let W=G.resolve(X,(B)=>z(Q??Z,"TAG_RESOLVE_FAILED",B),$.options);Y=U2.isScalar(W)?W:new tZ.Scalar(W)}catch(W){let B=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",B),Y=new tZ.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 vG($,Z,Q,z,X){if(Q==="!")return $[U2.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"),$[U2.SCALAR]}function kG({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[U2.SCALAR];if(Q.compat){let J=Q.compat.find((V)=>V.default&&V.test?.test(z))??Q[U2.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}hG.composeScalar=gG});var $7=P((mG)=>{function uG($,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 $}mG.emptyScalarPosition=uG});var z7=P((oG)=>{var lG=W$(),cG=y(),dG=oZ(),Z7=eZ(),iG=k2(),nG=$7(),sG={composeNode:Q7,composeEmptyNode:f1};function Q7($,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=rG($,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=Z7.composeScalar($,Z,V,z),J)G.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=dG.composeCollection(sG,$,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=f1($,Z.offset,void 0,null,Q,z)),J&&G.anchor==="")z(J,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!cG.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 f1($,Z,Q,z,{spaceBefore:X,comment:H,anchor:U,tag:J,end:V},G){let Y={type:"scalar",offset:nG.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=Z7.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 rG({options:$},{offset:Z,source:Q,end:z},X){let H=new lG.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=iG.resolveEnd(z,U,$.strict,X);if(H.range=[Z,U,J.offset],J.comment)H.comment=J.comment;return H}oG.composeEmptyNode=f1;oG.composeNode=Q7});var H7=P((zY)=>{var eG=A$(),X7=z7(),$Y=k2(),ZY=C$();function QY($,Z,{offset:Q,start:z,value:X,end:H},U){let J=Object.assign({_directives:Z},$),V=new eG.Document(void 0,J),G={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},Y=ZY.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?X7.composeNode(G,X,Y,U):X7.composeEmptyNode(G,Y.end,z,null,Y,U);let W=V.contents.range[2],B=$Y.resolveEnd(H,W,!1,U);if(B.comment)V.comment=B.comment;return V.range=[Q,W,B.offset],V}zY.composeDoc=QY});var u1=P((YY)=>{var HY=X$("process"),UY=c8(),JY=A$(),w$=T$(),U7=y(),VY=H7(),GY=k2();function j$($){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 J7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let H=$[X];switch(H[0]){case"#":Z+=(Z===""?"":z?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(H.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class
|
|
103
|
-
${Q}`:Q;else if(z||$.directives.docStart||!X)$.commentBefore=Q;else if(
|
|
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 V7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let H=j$(Z);if(X)this.warnings.push(new w$.YAMLWarning(H,Q,z));else this.errors.push(new w$.YAMLParseError(H,Q,z))},this.directives=new UY.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=J7(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(U7.isCollection(X)&&!X.flow&&X.items.length>0){let H=X.items[0];if(U7.isPair(H))H=H.key;let U=H.commentBefore;H.commentBefore=U?`${Q}
|
|
104
104
|
${U}`:Q}else{let H=X.commentBefore;X.commentBefore=H?`${Q}
|
|
105
|
-
${H}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
106
|
-
${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new w$.YAMLParseError(j$($),"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
|
|
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:J7(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(HY.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=j$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=VY.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 w$.YAMLParseError(j$($),"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 w$.YAMLParseError(j$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=GY.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 w$.YAMLParseError(j$($),"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 JY.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}}}YY.Composer=V7});var W7=P((_Y)=>{var BY=v1(),qY=h1(),KY=T$(),G7=D$();function DY($,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 KY.YAMLParseError([J,J+1],H,U)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return qY.resolveFlowScalar($,Z,z);case"block-scalar":return BY.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function IY($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:H=-1,type:U="PLAIN"}=Z,J=G7.stringifyString({type:U,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),V=Z.end??[{type:"newline",offset:-1,indent:z,source:`
|
|
107
107
|
`}];switch(J[0]){case"|":case">":{let G=J.indexOf(`
|
|
108
108
|
`),Y=J.substring(0,G),W=J.substring(G+1)+`
|
|
109
|
-
`,B=[{type:"block-scalar-header",offset:H,indent:z,source:Y}];if(!
|
|
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
|
|
109
|
+
`,B=[{type:"block-scalar-header",offset:H,indent:z,source:Y}];if(!Y7(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 LY($,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=G7.stringifyString({type:U,value:Z},{implicitKey:X||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(V[0]){case"|":case">":OY($,V);break;case'"':m1($,V,"double-quoted-scalar");break;case"'":m1($,V,"single-quoted-scalar");break;default:m1($,V,"scalar")}}function OY($,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(!
|
|
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
|
|
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})}}}
|
|
112
|
+
`;if($.type==="block-scalar"){let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=z,$.source=X}else{let{offset:H}=$,U="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:H,indent:U,source:z}];if(!Y7(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:U,source:`
|
|
113
|
+
`});for(let V of Object.keys($))if(V!=="type"&&V!=="offset")delete $[V];Object.assign($,{type:"block-scalar",indent:U,props:J,source:X})}}function Y7($,Z){if(Z)for(let Q of Z)switch(Q.type){case"space":case"comment":$.push(Q);break;case"newline":return $.push(Q),!0}return!1}function m1($,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})}}}_Y.createScalarToken=IY;_Y.resolveAsScalar=DY;_Y.setScalarValue=LY});var B7=P((FY)=>{var RY=($)=>("type"in $)?d6($):c6($);function d6($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=d6(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=c6(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=c6(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=c6($);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 c6({start:$,key:Z,sep:Q,value:z}){let X="";for(let H of $)X+=H.source;if(Z)X+=d6(Z);if(Q)for(let H of Q)X+=H.source;if(z)X+=d6(z);return X}FY.stringify=RY});var D7=P((CY)=>{var p1=Symbol("break visit"),TY=Symbol("skip children"),q7=Symbol("remove item");function J2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};K7(Object.freeze([]),$,Z)}J2.BREAK=p1;J2.SKIP=TY;J2.REMOVE=q7;J2.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};J2.parentCollection=($,Z)=>{let Q=J2.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],X=Q?.[z];if(X&&"items"in X)return X;throw Error("Parent collection not found")};function K7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let H=Z[X];if(H&&"items"in H){for(let U=0;U<H.items.length;++U){let J=K7(Object.freeze($.concat([[X,U]])),H.items[U],Q);if(typeof J==="number")U=J-1;else if(J===p1)return p1;else if(J===q7)H.items.splice(U,1),U-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}CY.visit=J2});var i6=P((gY)=>{var l1=W7(),jY=B7(),SY=D7(),c1="\uFEFF",d1="\x02",i1="\x18",n1="\x1F",EY=($)=>!!$&&("items"in $),bY=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function yY($){switch($){case c1:return"<BOM>";case d1:return"<DOC>";case i1:return"<FLOW_END>";case n1:return"<SCALAR>";default:return JSON.stringify($)}}function xY($){switch($){case c1:return"byte-order-mark";case d1:return"doc-mode";case i1:return"flow-error-end";case n1: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}
|
|
117
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
118
|
-
\r `),s1=($)=>!$||
|
|
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}gY.createScalarToken=l1.createScalarToken;gY.resolveAsScalar=l1.resolveAsScalar;gY.setScalarValue=l1.setScalarValue;gY.stringify=jY.stringify;gY.visit=SY.visit;gY.BOM=c1;gY.DOCUMENT=d1;gY.FLOW_END=i1;gY.SCALAR=n1;gY.isCollection=EY;gY.isScalar=bY;gY.prettyToken=yY;gY.tokenType=xY});var r1=P((aY)=>{var S$=i6();function W0($){switch($){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var I7=new Set("0123456789ABCDEFabcdef"),rY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),n6=new Set(",[]{}"),oY=new Set(` ,[]{}
|
|
118
|
+
\r `),s1=($)=>!$||oY.has($);class L7{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let Q=this.next??"stream";while(Q&&(Z||this.hasChars(1)))Q=yield*this.parseNext(Q)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
|
|
119
119
|
`)return!0;if(Z==="\r")return this.buffer[$+1]===`
|
|
120
120
|
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let Q=0;while(Z===" ")Z=this.buffer[++Q+$];if(Z==="\r"){let z=this.buffer[Q+$+1];if(z===`
|
|
121
121
|
`||!z&&!this.atEnd)return $+Q+1}return Z===`
|
|
@@ -130,53 +130,53 @@ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.pus
|
|
|
130
130
|
`&&X>=this.pos&&X+1+Z>U)$=X;else break}while(!0);return yield S$.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(W0(X)||$&&n6.has(X))break;Z=Q}else if(W0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
|
|
131
131
|
`)Q+=1,z=`
|
|
132
132
|
`,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&n6.has(X))break;if(z===`
|
|
133
|
-
`){let H=this.continueScalar(Q+1);if(H===-1)break;Q=Math.max(Q,H-2)}}else{if($&&n6.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield S$.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(s1),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(W0(Q)||Z&&n6.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(!W0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(
|
|
133
|
+
`){let H=this.continueScalar(Q+1);if(H===-1)break;Q=Math.max(Q,H-2)}}else{if($&&n6.has(z))break;Z=Q}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield S$.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(s1),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(W0(Q)||Z&&n6.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(!W0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(rY.has(Z))Z=this.buffer[++$];else if(Z==="%"&&I7.has(this.buffer[$+1])&&I7.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)}}
|
|
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)}}aY.Lexer=L7});var o1=P((eY)=>{class O7{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}}}}eY.LineCounter=O7});var a1=P((zW)=>{var ZW=X$("process"),_7=i6(),QW=r1();function s0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function M7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function N7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function s6($){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 h2($){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 r6($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function P7($){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,N7(Z.value))if(Z.value.end)r6(Z.value.end,Z.sep);else Z.value.end=Z.sep;else r6(Z.start,Z.sep);delete Z.sep}}}class R7{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 QW.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=$,ZW.env.LOG_TOKENS)console.log("|",_7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=_7.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")P7(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&&M7(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(M7($.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=s6(this.peek(2)),Q=h2(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)){r6(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=h2(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(
|
|
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)){r6(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=h2(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(N7(Z.key)&&!s0(Z.sep,"newline")){let H=h2(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)){r6(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=s6(Q),X=h2(z);P7($);let H=$.end.splice(1,$.end.length);H.push(this.sourceToken);let U={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
|
|
138
138
|
`)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
|
|
139
|
-
`,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=s6($),Q=h2(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=s6($),Q=h2(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()}}}ZW.Parser=P7});var T7=P((YW)=>{var R7=u1(),zW=A$(),E$=T$(),XW=o8(),HW=y(),UW=o1(),N7=a1();function F7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new UW.LineCounter||null,prettyErrors:Z}}function JW($,Z={}){let{lineCounter:Q,prettyErrors:z}=F7(Z),X=new N7.Parser(Q?.addNewLine),H=new R7.Composer(Z),U=Array.from(H.compose(X.parse($)));if(z&&Q)for(let J of U)J.errors.forEach(E$.prettifyError($,Q)),J.warnings.forEach(E$.prettifyError($,Q));if(U.length>0)return U;return Object.assign([],{empty:!0},H.streamInfo())}function A7($,Z={}){let{lineCounter:Q,prettyErrors:z}=F7(Z),X=new N7.Parser(Q?.addNewLine),H=new R7.Composer(Z),U=null;for(let J of H.compose(X.parse($),!0,$.length))if(!U)U=J;else if(U.options.logLevel!=="silent"){U.errors.push(new E$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)U.errors.forEach(E$.prettifyError($,Q)),U.warnings.forEach(E$.prettifyError($,Q));return U}function VW($,Z,Q){let z=void 0;if(typeof Z==="function")z=Z;else if(Q===void 0&&Z&&typeof Z==="object")Q=Z;let X=A7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>XW.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 GW($,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(HW.isDocument($)&&!z)return $.toString(Q);return new zW.Document($,z,Q).toString(Q)}YW.parse=VW;YW.parseAllDocuments=JW;YW.parseDocument=A7;YW.stringify=GW});var u=[{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"}],j0=new Map(u.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),TO=new Map(u.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),CO=new Map(u.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function q5($,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 lQ($){return u.filter((Z)=>Z.category===$)}var cQ=u.filter(($)=>$.index<=21),dQ=u,H6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]),K5=new Set(["none","n/a","not applicable"]),U6="slotignored";function iQ($){return typeof $==="string"&&K5.has($.trim().toLowerCase())}function g8($){return typeof $==="string"&&$.trim()!==""&&s($)}function s($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return H6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var F2="no classifying signals — fallback",nQ=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function A2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(N2,$))return null;if(!N2[$].includes(Z.category))return!1;return!($==="framework"&&nQ.has(Z.path))}var N2={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 v8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,H$=v8("1"),T2=v8("2"),jO=v8("3"),U$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},J$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,k8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,C2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var S0=[{name:"TROPHY",indicator:`${C2("✪")} ${C2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${C2(H$("★"))} ${C2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${J$("◆")} ${J$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${k8("◇")} ${k8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${H$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${T2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${T2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${T2("♡")}`,threshold:0}];function V$($){for(let Z of S0)if($>=Z.threshold)return Z;return S0[S0.length-1]}function sQ($){let Z=V$($),Q=S0.indexOf(Z);return Q>0?S0[Q-1]:null}var u8={};mQ(u8,{validate:()=>oQ,sdkVersion:()=>Zz,scoreFafb:()=>$z,scoreEnterprise:()=>rQ,score:()=>f8,fafbInfo:()=>eQ,decompile:()=>tQ,compile:()=>aQ});var h8=null;function u0(){if(h8)return h8;try{let $=X$("faf-scoring-kernel");return h8=$,$}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=s6($),Q=h2(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=s6($),Q=h2(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()}}}zW.Parser=R7});var w7=P((BW)=>{var F7=u1(),HW=A$(),E$=T$(),UW=o8(),JW=y(),VW=o1(),A7=a1();function T7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new VW.LineCounter||null,prettyErrors:Z}}function GW($,Z={}){let{lineCounter:Q,prettyErrors:z}=T7(Z),X=new A7.Parser(Q?.addNewLine),H=new F7.Composer(Z),U=Array.from(H.compose(X.parse($)));if(z&&Q)for(let J of U)J.errors.forEach(E$.prettifyError($,Q)),J.warnings.forEach(E$.prettifyError($,Q));if(U.length>0)return U;return Object.assign([],{empty:!0},H.streamInfo())}function C7($,Z={}){let{lineCounter:Q,prettyErrors:z}=T7(Z),X=new A7.Parser(Q?.addNewLine),H=new F7.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 E$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)U.errors.forEach(E$.prettifyError($,Q)),U.warnings.forEach(E$.prettifyError($,Q));return U}function YW($,Z,Q){let z=void 0;if(typeof Z==="function")z=Z;else if(Q===void 0&&Z&&typeof Z==="object")Q=Z;let X=C7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>UW.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 WW($,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(JW.isDocument($)&&!z)return $.toString(Q);return new HW.Document($,z,Q).toString(Q)}BW.parse=YW;BW.parseAllDocuments=GW;BW.parseDocument=C7;BW.stringify=WW});var u=[{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"}],j0=new Map(u.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),j_=new Map(u.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),S_=new Map(u.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function D5($,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 d3($){return u.filter((Z)=>Z.category===$)}var i3=u.filter(($)=>$.index<=21),n3=u,H6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]),I5=new Set(["none","n/a","not applicable"]),U6="slotignored";function s3($){return typeof $==="string"&&I5.has($.trim().toLowerCase())}function g8($){return typeof $==="string"&&$.trim()!==""&&s($)}function s($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return H6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var F2="no classifying signals — fallback",r3=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]);function A2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(R2,$))return null;if(!R2[$].includes(Z.category))return!1;return!($==="framework"&&r3.has(Z.path))}var R2={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 v8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,H$=v8("1"),T2=v8("2"),b_=v8("3"),U$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},J$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,k8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,C2=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var S0=[{name:"TROPHY",indicator:`${C2("✪")} ${C2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${C2(H$("★"))} ${C2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${J$("◆")} ${J$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${k8("◇")} ${k8("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${H$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${T2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${T2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${T2("♡")}`,threshold:0}];function V$($){for(let Z of S0)if($>=Z.threshold)return Z;return S0[S0.length-1]}function o3($){let Z=V$($),Q=S0.indexOf(Z);return Q>0?S0[Q-1]:null}var u8={};l3(u8,{validate:()=>t3,sdkVersion:()=>zz,scoreFafb:()=>Qz,scoreEnterprise:()=>a3,score:()=>f8,fafbInfo:()=>Zz,decompile:()=>$z,compile:()=>e3});var h8=null;function u0(){if(h8)return h8;try{let $=X$("faf-scoring-kernel");return h8=$,$}catch{throw Error(`faf-scoring-kernel not installed.
|
|
140
140
|
|
|
141
141
|
Run: npm install faf-scoring-kernel
|
|
142
|
-
`)}}var J6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function f8($){return JSON.parse(u0().score_faf(J6($)))}function rQ($){return JSON.parse(u0().score_faf_enterprise(J6($)))}function oQ($){return u0().validate_faf(J6($))}function aQ($){return u0().compile_fafb(J6($))}function tQ($){return JSON.parse(u0().decompile_fafb($))}function eQ($){return JSON.parse(u0().fafb_info($))}function $z($){return JSON.parse(u0().score_fafb($))}function Zz(){return u0().sdk_version()}var D5=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function I5($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function L5($){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 Qz($){return $.unknown?"unknown (—)":`${$.score}%`}function _5($){return{score:$.score,tier:V$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function m8($){let Z=L5($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?V$(Q):S0[S0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return _5(f8($))}function zz($){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(!I5(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!D5.test(Q.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${Q.about.represents})`);if(Q.about.source_score!==void 0){let z=Q.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}import{lstatSync as L9}from"fs";import{join as K9,dirname as L4,basename as _P,resolve as l$}from"path";var DW=u1(),IW=A$(),LW=F1(),t1=T$(),_W=W$(),r0=y(),OW=c0(),MW=l(),PW=i0(),RW=n0(),QP=i6(),NW=r1(),FW=o1(),AW=a1(),o6=T7(),C7=G$();var TW=DW.Composer,a6=IW.Document,CW=LW.Schema,wW=t1.YAMLError,t6=t1.YAMLParseError,jW=t1.YAMLWarning,SW=_W.Alias,y0=r0.isAlias,V2=r0.isCollection,EW=r0.isDocument,m=r0.isMap,B0=r0.isNode,bW=r0.isPair,n=r0.isScalar,x0=r0.isSeq,yW=OW.Pair,xW=MW.Scalar,f2=PW.YAMLMap,b$=RW.YAMLSeq;var gW=NW.Lexer,vW=FW.LineCounter,kW=AW.Parser,g0=o6.parse,hW=o6.parseAllDocuments,u2=o6.parseDocument,y$=o6.stringify,fW=C7.visit,uW=C7.visitAsync;import{accessSync as w7,closeSync as Q4,constants as j7,existsSync as mW,fchmodSync as S7,fchownSync as pW,fsyncSync as E7,lstatSync as z4,mkdirSync as b7,mkdtempSync as HP,openSync as y7,readdirSync as lW,readFileSync as X4,readlinkSync as cW,realpathSync as dW,renameSync as iW,rmSync as UP,statSync as m2,unlinkSync as x7,writeFileSync as nW}from"fs";import{randomBytes as sW}from"crypto";import{basename as o0,dirname as G2,isAbsolute as g7,join as p2,relative as H4,resolve as J0,sep as e6}from"path";class S extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var r=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),rW=new Set(Object.values(r).map(($)=>$.toLowerCase())),oW=($,Z)=>$.toLowerCase()===Z.toLowerCase(),e1=($)=>rW.has($.toLowerCase());function l2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var aW=/\.fafm?$/i,tW=/^[a-z][a-z0-9-]*$/,F0=($)=>dW.native($),a0=($)=>$?.code;function g$($,Z){let Q=H4($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${e6}`)&&!g7(Q)}function v7($){try{return cW($)}catch{return"?"}}function eW($,Z,Q,z){let X;try{X=F0(Q)}catch(H){let U=a0(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new S("dangling",Z,`${Z} is a link to ${v7(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!g$($,X))throw new S("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(l2(X)&&!(z.inGit&&G2(X)===$))throw new S("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!m2(X).isFile())throw new S("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return $B(Z,X,z.read),X}function $B($,Z,Q){let z=o0($),X=o0(Z),H=e1(z)&&e1(X);if(Q&&!aW.test(X)&&!H){let U=e1(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new S("not-faf",$,`${$} is a link to ${Z}, which is not ${U} — refused.`)}if(!Q&&!oW(z,X)&&!H)throw new S("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function ZB($,Z,Q,z){if(o0(J0($))!=="hooks"||!tW.test(o0(Z)))throw new S("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new S("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function QB($,Z,Q){if(o0($)!=="config"||Q!==Z)throw new S("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function k($,Z,Q={}){let z=F0(J0($)),X=J0($,Z),H=F0(G2(X));if(!g$(z,H))throw new S("outside",X,`${X} is in ${H}, outside ${z} — refused.`);let U=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(U)ZB($,X,z,H);if(J)QB(X,z,H);let V=p2(H,o0(X));if(l2(V)&&!U&&!J)throw new S("git",X,V===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${V}, inside .git/ — refused.`);let G;try{G=z4(V)}catch(Y){if(a0(Y)==="ENOENT")return V;throw Y}if(G.isSymbolicLink())return eW(z,X,V,{read:Q.read===!0,inGit:U||J});if(!G.isFile())throw new S("not-a-file",X,`${X} is not a regular file — refused.`);return F0(V)}var zB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function XB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return zB.decode($)}catch{}throw new S("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function e($){return XB(X4($),$)}function q0($){try{return X4($)}catch(Z){if(a0(Z)==="ENOENT")return null;throw Z}}function x$($,Z){let Q=J0(p2($,Z));if(!mW(Q))return null;let z,X;try{z=F0(HB($)),X=F0(Q)}catch{return null}if(!g$(z,X)||l2(H4(z,X)))return null;return X}var Z4=[];function HB($){let Z=J0($);return Z4.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(e6)?Q:Q+e6))??Z}function c2($,Z){Z4.push(J0($));try{return Z()}finally{Z4.pop()}}function L($,Z){return x$($,Z)!==null}function w($,Z){let Q=x$($,Z);if(Q===null)return null;try{return m2(Q).isFile()?X4(Q,"utf-8"):null}catch{return null}}function K0($,Z){let Q=x$($,Z);if(Q===null)return null;try{return m2(Q)}catch{return null}}function g($,Z="."){let Q=x$($,Z);if(Q===null)return null;let z;try{z=lW(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||x$($,p2(Z,X.name))!==null)}function UB($){try{let Z=m2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(a0(Z)==="ENOENT")return;throw Z}}class k7 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var $4=($)=>new S("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function U4($,Z,Q){if(Z!==void 0){let X=q0($),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 $4($)}if(!Q)return;let z;try{z=m2($)}catch(X){if(a0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw $4($);try{w7($,j7.W_OK)}catch{throw $4($)}}function JB($,Z){if(process.platform!=="win32")try{pW($,Z.uid,Z.gid)}catch{}S7($,Z.mode)}function VB($){if(process.platform==="win32")return;try{let Z=y7($,"r");try{E7(Z)}finally{Q4(Z)}}catch{}}function GB($,Z,Q,z){if($.fd=y7($.path,"wx",z??Q?.mode??438),$.created=!0,nW($.fd,Z),Q)JB($.fd,Q);if(z!==void 0)S7($.fd,z);E7($.fd),Q4($.fd),$.fd=void 0}function YB($){if($.fd!==void 0)try{Q4($.fd)}catch{}if($.created)try{x7($.path)}catch{}}function WB($,Z,Q){let z=G2($),X={path:p2(z,`.${o0($).slice(0,100)}.${process.pid}.${sW(6).toString("hex")}.faf-tmp`),created:!1},H=UB($);try{if(H)w7($,j7.W_OK);GB(X,Z,H,Q.mode),U4($,Q.expect,H),iW(X.path,$)}catch(U){if(YB(X),U instanceof S)throw U;let J=a0(U)??(U instanceof Error?U.message:String(U));throw new k7($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}VB(z)}function BB($){return $ instanceof S&&!$.onWrite?new S($.reason,$.path,$.message,{onWrite:!0}):$}function o($,Z,Q={}){let z=J0($),X;try{X=k(Q.root??G2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw BB(H)}return WB(X,Z,Q),X}function h7($,Z,Q){let z=J0($),X=Q.root??G2(z),H=k(X,z),U=q0(H);if(Q.expect!==void 0)U4(H,Q.expect,void 0);if(U!==null&&Q.force!==!0&&!Q.owns(U))throw new S("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return o(H,Z,{root:X,expect:U})}function d2($,Z=$){let Q=J0($);b7(Q,{recursive:!0});let z=F0(Q),X=J0(Q,Z),H=H4(Q,X);if(H===".."||H.startsWith(`..${e6}`)||g7(H))throw new S("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let U=z;for(let J of H.split(/[\\/]/).filter(Boolean)){let V=p2(U,J);if(l2(V))throw new S("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});U=qB(z,X,V)}return U}function qB($,Z,Q){let z;try{z=z4(Q)}catch(H){if(a0(H)!=="ENOENT")throw H;return b7(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=F0(Q)}catch{throw new S("dangling",Z,`${Q} is a link to ${v7(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!g$($,X))throw new S("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(l2(X))throw new S("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!m2(X).isDirectory())throw new S("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function KB($,Z){let Q=J0($),z=F0(J0(Z.root??G2(Q))),X=F0(G2(Q));if(!g$(z,X))throw new S("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=p2(X,o0(Q));if(l2(H))throw new S("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let U;try{U=z4(H)}catch(J){if(a0(J)==="ENOENT")return!1;throw J}if(!U.isFile())throw new S("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return U4(H,Z.expect,void 0),x7(H),!0}function h($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function v$($){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 $8($,Z){if($===null||$===void 0)return{};if(!h($))throw new S("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${v$($)}. `+"faf left it unchanged — fix it by hand.");return $}var c7=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function f7($){return typeof $==="object"&&$.collection===void 0}function DB($,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||!
|
|
142
|
+
`)}}var J6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function f8($){return JSON.parse(u0().score_faf(J6($)))}function a3($){return JSON.parse(u0().score_faf_enterprise(J6($)))}function t3($){return u0().validate_faf(J6($))}function e3($){return u0().compile_fafb(J6($))}function $z($){return JSON.parse(u0().decompile_fafb($))}function Zz($){return JSON.parse(u0().fafb_info($))}function Qz($){return JSON.parse(u0().score_fafb($))}function zz(){return u0().sdk_version()}var L5=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function O5($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function _5($){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 Xz($){return $.unknown?"unknown (—)":`${$.score}%`}function M5($){return{score:$.score,tier:V$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function m8($){let Z=_5($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?V$(Q):S0[S0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return M5(f8($))}function Hz($){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(!O5(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!L5.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 _9}from"fs";import{join as I9,dirname as L4,basename as PP,resolve as l$}from"path";var LW=u1(),OW=A$(),_W=F1(),t1=T$(),MW=W$(),r0=y(),PW=c0(),NW=l(),RW=i0(),FW=n0(),HP=i6(),AW=r1(),TW=o1(),CW=a1(),o6=w7(),j7=G$();var wW=LW.Composer,a6=OW.Document,jW=_W.Schema,SW=t1.YAMLError,t6=t1.YAMLParseError,EW=t1.YAMLWarning,bW=MW.Alias,y0=r0.isAlias,V2=r0.isCollection,yW=r0.isDocument,m=r0.isMap,B0=r0.isNode,xW=r0.isPair,n=r0.isScalar,x0=r0.isSeq,gW=PW.Pair,vW=NW.Scalar,f2=RW.YAMLMap,b$=FW.YAMLSeq;var kW=AW.Lexer,hW=TW.LineCounter,fW=CW.Parser,g0=o6.parse,uW=o6.parseAllDocuments,u2=o6.parseDocument,y$=o6.stringify,mW=j7.visit,pW=j7.visitAsync;import{accessSync as S7,closeSync as Q4,constants as E7,existsSync as lW,fchmodSync as b7,fchownSync as cW,fsyncSync as y7,lstatSync as z4,mkdirSync as x7,mkdtempSync as VP,openSync as g7,readdirSync as dW,readFileSync as X4,readlinkSync as iW,realpathSync as nW,renameSync as sW,rmSync as GP,statSync as m2,unlinkSync as v7,writeFileSync as rW}from"fs";import{randomBytes as oW}from"crypto";import{basename as o0,dirname as G2,isAbsolute as k7,join as p2,relative as H4,resolve as J0,sep as e6}from"path";class S extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var r=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),aW=new Set(Object.values(r).map(($)=>$.toLowerCase())),tW=($,Z)=>$.toLowerCase()===Z.toLowerCase(),e1=($)=>aW.has($.toLowerCase());function l2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var eW=/\.fafm?$/i,$B=/^[a-z][a-z0-9-]*$/,F0=($)=>nW.native($),a0=($)=>$?.code;function g$($,Z){let Q=H4($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${e6}`)&&!k7(Q)}function h7($){try{return iW($)}catch{return"?"}}function ZB($,Z,Q,z){let X;try{X=F0(Q)}catch(H){let U=a0(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new S("dangling",Z,`${Z} is a link to ${h7(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!g$($,X))throw new S("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(l2(X)&&!(z.inGit&&G2(X)===$))throw new S("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!m2(X).isFile())throw new S("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return QB(Z,X,z.read),X}function QB($,Z,Q){let z=o0($),X=o0(Z),H=e1(z)&&e1(X);if(Q&&!eW.test(X)&&!H){let U=e1(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new S("not-faf",$,`${$} is a link to ${Z}, which is not ${U} — refused.`)}if(!Q&&!tW(z,X)&&!H)throw new S("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function zB($,Z,Q,z){if(o0(J0($))!=="hooks"||!$B.test(o0(Z)))throw new S("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new S("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function XB($,Z,Q){if(o0($)!=="config"||Q!==Z)throw new S("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function k($,Z,Q={}){let z=F0(J0($)),X=J0($,Z),H=F0(G2(X));if(!g$(z,H))throw new S("outside",X,`${X} is in ${H}, outside ${z} — refused.`);let U=Q.allowGitHooks===!0,J=Q.allowGitConfig===!0;if(U)zB($,X,z,H);if(J)XB(X,z,H);let V=p2(H,o0(X));if(l2(V)&&!U&&!J)throw new S("git",X,V===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${V}, inside .git/ — refused.`);let G;try{G=z4(V)}catch(Y){if(a0(Y)==="ENOENT")return V;throw Y}if(G.isSymbolicLink())return ZB(z,X,V,{read:Q.read===!0,inGit:U||J});if(!G.isFile())throw new S("not-a-file",X,`${X} is not a regular file — refused.`);return F0(V)}var HB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function UB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return HB.decode($)}catch{}throw new S("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function e($){return UB(X4($),$)}function q0($){try{return X4($)}catch(Z){if(a0(Z)==="ENOENT")return null;throw Z}}function x$($,Z){let Q=J0(p2($,Z));if(!lW(Q))return null;let z,X;try{z=F0(JB($)),X=F0(Q)}catch{return null}if(!g$(z,X)||l2(H4(z,X)))return null;return X}var Z4=[];function JB($){let Z=J0($);return Z4.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(e6)?Q:Q+e6))??Z}function c2($,Z){Z4.push(J0($));try{return Z()}finally{Z4.pop()}}function L($,Z){return x$($,Z)!==null}function w($,Z){let Q=x$($,Z);if(Q===null)return null;try{return m2(Q).isFile()?X4(Q,"utf-8"):null}catch{return null}}function K0($,Z){let Q=x$($,Z);if(Q===null)return null;try{return m2(Q)}catch{return null}}function g($,Z="."){let Q=x$($,Z);if(Q===null)return null;let z;try{z=dW(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||x$($,p2(Z,X.name))!==null)}function VB($){try{let Z=m2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(a0(Z)==="ENOENT")return;throw Z}}class f7 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var $4=($)=>new S("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function U4($,Z,Q){if(Z!==void 0){let X=q0($),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 $4($)}if(!Q)return;let z;try{z=m2($)}catch(X){if(a0(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw $4($);try{S7($,E7.W_OK)}catch{throw $4($)}}function GB($,Z){if(process.platform!=="win32")try{cW($,Z.uid,Z.gid)}catch{}b7($,Z.mode)}function YB($){if(process.platform==="win32")return;try{let Z=g7($,"r");try{y7(Z)}finally{Q4(Z)}}catch{}}function WB($,Z,Q,z){if($.fd=g7($.path,"wx",z??Q?.mode??438),$.created=!0,rW($.fd,Z),Q)GB($.fd,Q);if(z!==void 0)b7($.fd,z);y7($.fd),Q4($.fd),$.fd=void 0}function BB($){if($.fd!==void 0)try{Q4($.fd)}catch{}if($.created)try{v7($.path)}catch{}}function qB($,Z,Q){let z=G2($),X={path:p2(z,`.${o0($).slice(0,100)}.${process.pid}.${oW(6).toString("hex")}.faf-tmp`),created:!1},H=VB($);try{if(H)S7($,E7.W_OK);WB(X,Z,H,Q.mode),U4($,Q.expect,H),sW(X.path,$)}catch(U){if(BB(X),U instanceof S)throw U;let J=a0(U)??(U instanceof Error?U.message:String(U));throw new f7($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}YB(z)}function KB($){return $ instanceof S&&!$.onWrite?new S($.reason,$.path,$.message,{onWrite:!0}):$}function o($,Z,Q={}){let z=J0($),X;try{X=k(Q.root??G2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw KB(H)}return qB(X,Z,Q),X}function u7($,Z,Q){let z=J0($),X=Q.root??G2(z),H=k(X,z),U=q0(H);if(Q.expect!==void 0)U4(H,Q.expect,void 0);if(U!==null&&Q.force!==!0&&!Q.owns(U))throw new S("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return o(H,Z,{root:X,expect:U})}function d2($,Z=$){let Q=J0($);x7(Q,{recursive:!0});let z=F0(Q),X=J0(Q,Z),H=H4(Q,X);if(H===".."||H.startsWith(`..${e6}`)||k7(H))throw new S("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let U=z;for(let J of H.split(/[\\/]/).filter(Boolean)){let V=p2(U,J);if(l2(V))throw new S("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});U=DB(z,X,V)}return U}function DB($,Z,Q){let z;try{z=z4(Q)}catch(H){if(a0(H)!=="ENOENT")throw H;return x7(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=F0(Q)}catch{throw new S("dangling",Z,`${Q} is a link to ${h7(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!g$($,X))throw new S("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(l2(X))throw new S("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!m2(X).isDirectory())throw new S("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function IB($,Z){let Q=J0($),z=F0(J0(Z.root??G2(Q))),X=F0(G2(Q));if(!g$(z,X))throw new S("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=p2(X,o0(Q));if(l2(H))throw new S("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let U;try{U=z4(H)}catch(J){if(a0(J)==="ENOENT")return!1;throw J}if(!U.isFile())throw new S("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return U4(H,Z.expect,void 0),v7(H),!0}function h($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function v$($){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 $8($,Z){if($===null||$===void 0)return{};if(!h($))throw new S("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${v$($)}. `+"faf left it unchanged — fix it by hand.");return $}var i7=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function m7($){return typeof $==="object"&&$.collection===void 0}function LB($,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||!i7.has(z.tag))return;let X;try{X=z.resolve(Q,()=>{return},{})}catch{return}return Object.is(n(X)?X.value:X,$.value)?Q:void 0}function OB($){let Z=$.filter(m7);return $.map((Q)=>{if(!m7(Q)||!i7.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,H,U,J)=>LB(X,Z)??z(X,H,U,J)}})}var Z8={keepSourceTokens:!0,customTags:OB};function _B($,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 MB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let H=_B(Z[X],Z[X+1]);Q??=H.indent,z??=H.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function W4($,Z){let Q=u2($,Z8);if(Q.errors.length>0){let z=Q.errors[0].message.split(`
|
|
144
144
|
`)[0];throw Error(`${Z}: not valid YAML (${z}) — faf left it unchanged.`,{cause:Q.errors[0]})}return Q}function Y2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function k$($,Z){return $.lastIndexOf(`
|
|
145
|
-
`,Z-1)+1}function
|
|
145
|
+
`,Z-1)+1}function n7($,Z){if(Z>0&&$[Z-1]===`
|
|
146
146
|
`)return Z;let Q=$.indexOf(`
|
|
147
|
-
`,Z);return Q<0?$.length:Q+1}function
|
|
148
|
-
`){if(Q--,$[Q-1]==="\r")Q--}return Q}function D0($){return $!==null&&$!==void 0}function Q0($){let Z=B0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function
|
|
147
|
+
`,Z);return Q<0?$.length:Q+1}function p7($,Z){let Q=Z;if($[Q-1]===`
|
|
148
|
+
`){if(Q--,$[Q-1]==="\r")Q--}return Q}function D0($){return $!==null&&$!==void 0}function Q0($){let Z=B0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function s7($,Z){let Q=Q0($),z=Q0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function r7($){if(n($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return V2($)&&!$.flow}function Q8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function o7($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&Q8($,Z)}function a7($,Z,Q,z){let X=new a6(void 0,Z8);X.contents=Z(X);let U=X.toString($.piece).replace(/\n+$/,"").slice(Q),J=U.startsWith(" ")&&!U.includes(`
|
|
149
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 V4($,Z,Q){return
|
|
151
|
-
`)?void 0:Z.comment}function
|
|
152
|
-
`).map((U)=>U?X+U:U).join($.eol)+$.eol}function
|
|
153
|
-
`);Y2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function
|
|
154
|
-
`)?$.eol:"",X=Z.commentBefore?$.eol:"";return Y2($,$.src.length,$.src.length,z+X+
|
|
150
|
+
${V}`).replace(/\n/g,$.eol);return{inline:J,text:J?U.slice(1):G}}function V4($,Z,Q){return a7($,(z)=>{let X=new f2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function PB($,Z,Q){let z=a7($,()=>{let X=new b$;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(!B0($)||!D0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function RB($,Z){if(!B0($)||!B0(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 FB($,Z){let Q=Q0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function AB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function l7($,Z,Q,z,X=!1){let H=Q0(Z);if(!H||z.kind==="root")return null;let U=Z.comment,J=B0(Q)?Q.comment:void 0,V=!D0(U)||U===J,G=V?NB(Q):Q,Y=X?G:RB(Z,G),W=z.kind==="value"?V4($,Y,z.col):PB($,Y,z.col);return W?{range:H,keepTail:V,newComment:J,piece:W}:null}function TB($,Z,Q,z){if(!z)return p7($,n7($,Q[2]));return r7(Z)?p7($,Q[1]):Q[1]}function h$($,Z,Q,z,X){let H=l7($,Z,Q,z);if(!H)return!1;let U=TB($.src,Z,H.range,H.keepTail);if(H.piece.inline&&(!r7(Z)||z.kind==="item"))return CB($,H,U,z,X),!0;let J=H.keepTail?Z.comment:H.newComment;if(X!==void 0||D0(J))return!1;let V=z.kind==="value"?l7($,Z,Q,z,!0):H;return V!==null&&wB($,V.range[0],U,V.piece,z)}function CB($,Z,Q,z,X){let[H,U]=Z.range,V=H===U&&z.kind==="value"?AB($.src,H,Z.piece.text):Z.piece.text;Y2($,H,Q,V+(X===void 0?"":` #${X}`))}function wB($,Z,Q,z,X){if(X.kind==="item")return Y2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let H=FB($.src,X.key);if(H<0)return!1;return Y2($,H,Q,z.inline?` ${z.text}`:z.text),!0}function jB($,Z){return Q8({...$,comment:void 0},{...Z,comment:void 0})}function SB($,Z){if(D0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
|
|
151
|
+
`)?void 0:Z.comment}function EB($,Z,Q,z){if(o7(Z,Q))return!0;if(!jB(Z,Q))return!1;let X=SB(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return h$($,Z,Q,z,X)}function bB($,Z,Q,z){if(!Q8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return V4($,Z,0).text===V4($,Q,0).text||h$($,Z,Q,z);if(Q.items.length===0)return h$($,Z,Q,z);return m(Z)?vB($,Z,Q):hB($,Z,Q)}function B4($,Z,Q,z){if(!s7(Z,Q))return h$($,Z,Q,z);if(n(Z))return EB($,Z,Q,z);if(y0(Z))return y0(Q)&&Z.source===Q.source&&Q8(Z,Q)||h$($,Z,Q,z);if(!V2(Z)||!V2(Q))return!1;return bB($,Z,Q,z)}function t7($,Z){return Z-k$($,Z)}function q4($,Z,Q){let z=$.slice(k$($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function G4($){return B0($)&&(D0($.commentBefore)||!!$.spaceBefore)}function K4($,Z,Q){let z=Q0(Z)??Q0(Q);return z?n7($.src,z[2]):-1}function e7($,Z,Q){let z=new a6(void 0,Z8);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 yB($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
|
|
153
|
+
`);Y2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function $9($,Z,Q,z,X,H){let U=Q;if(U<0){let J=Q0(Z);if(!J||G4(Z)||!q4($.src,J[0],H))return!1;U=k$($.src,J[0])}return yB($,U,e7($,z,X)),!0}function xB($,Z,Q){let z=k$($,Q),X=Z,H=D0(X.commentBefore),U=!!X.spaceBefore;while(z>0){let J=k$($,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 Z9($,Z,Q,z){let X=Q0(Z);if(!X||!q4($.src,X[0],z))return!1;let H=K4($,Q,Z);if(H<0)return!1;return Y2($,xB($.src,Z,X[0]),H,""),!0}function Q9($,Z){let Q=new Map,z=(X)=>{let H=Q0(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&&s7(Z($[U]),Z(X))?U:-1}}function gB($,Z){return n($)&&n(Z)?o7($,Z):$===Z}function vB($,Z,Q){let z=Z.items[0]?.key,X=Q0(z);if(!X)return!1;let H=t7($.src,X[0]),U=new Set,J=(W,B)=>{if(W.length===0)return!0;let K=new f2;K.items.push(...W);let I=B<0?-1:K4($,Z.items[B].value,Z.items[B].key);return $9($,z,I,K,H,!1)},V=Q9(Z.items,(W)=>W.key),G=-1,Y=[];for(let W of Q.items){let B=V(W);if(B<0){Y.push(W);continue}if(B<=G||!J(Y,G)||!gB(Z.items[B].key,W.key))return!1;if(Y=[],!B4($,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)||kB($,Z,B))}function kB($,Z,Q){let z=Z.items[Q],X=Q0(z.key);if(!X)return!1;if(q4($.src,X[0],!1))return Z9($,z.key,z.value,!1);let H=Z.items[Q+1],U=Q0(H?.key);if(Q!==0||!U||G4(z.key)||G4(H.key))return!1;return Y2($,X[0],U[0],""),!0}function hB($,Z,Q){let z=Q0(Z);if(!z||Z.items.length===0)return!1;let X=t7($.src,z[0]),H=new Set,U=(Y,W)=>{if(Y.length===0)return!0;let B=new b$;B.items.push(...Y);let K=W<0?-1:K4($,Z.items[W]);return $9($,Z.items[0],K,B,X,!0)},J=Q9(Z.items,(Y)=>Y),V=-1,G=[];for(let Y of Q.items){let W=J(Y);if(W<0){G.push(Y);continue}if(W<=V||!U(G,V))return!1;if(G=[],!B4($,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)||Z9($,Y,Y,!0))}function fB($,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 uB($,Z,Q){if(!m(Q)&&!x0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
|
|
154
|
+
`)?$.eol:"",X=Z.commentBefore?$.eol:"";return Y2($,$.src.length,$.src.length,z+X+e7($,Q,0)),!0}function mB($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!D0(z))return!D0(X)||uB($,Z,X);return D0(X)&&B4($,z,X,{kind:"root"})}function pB($,Z,Q,z,X){let H={src:$,eol:z,edits:[],piece:X};if(!mB(H,Z,Q))return null;return fB($,H.edits)}var c7=($)=>$.replace(/^[ \t]*\n/gm,"");function lB($,Z,Q,z){let X=u2($,Z8);if(X.errors.length>0||!p(X.toJS(),Z.toJS()))return!1;let H=X.toString(z);return H===Q||c7(H)===c7(Q)}function z8($,Z,Q="YAML"){let{text:z,changed:X}=cB($,Z,Q);return{text:z,changed:X}}function cB($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),H=W4(X,Q),U=dB(H);Z(U);let J={text:$,changed:!1,spliced:!1};if(p(U.toJS(),H.toJS()))return J;let V={lineWidth:0,...MB(X)},G=U.toString(V);if(G===H.toString(V))return J;let Y=X.includes(`\r
|
|
155
155
|
`)?`\r
|
|
156
156
|
`:`
|
|
157
|
-
`,W=
|
|
158
|
-
`):void 0}function
|
|
159
|
-
`);return Z}function
|
|
160
|
-
`)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=l$($);return new S("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function
|
|
161
|
-
`,"\r"]);class M4{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 W2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&
|
|
157
|
+
`,W=pB(X,H,U,Y,{...V,verifyAliasOrder:!1}),B=W!==null&&lB(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 dB($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function p($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>p(Q,Z[z]));if(h($)&&h(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&p($[z],Z[z]))}return!1}function u$($){let Z=n($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function t0($,Z){return $.items.find((Q)=>u$(Q)===Z)}function z9($,Z){return B0(Z)?Z.toJS($):Z}function iB($,Z,Q,z){return z.keepAliases===!0&&y0(Z)||p(z9($,Z),Q)}function X8($,Z,Q,z={}){if(iB($,Z,Q,z))return Z;if(h(Q)&&m(Z))return sB($,Z,Q,z),Z;if(Array.isArray(Q)&&x0(Z))return aB($,Z,Q,z),Z;if(!h(Q)&&!Array.isArray(Q)&&n(Z))return Z.value=Q,Z;return nB(Z,$.createNode(Q))}function nB($,Z){if(!n($)&&!y0($))return Z;let Q=$,z=Z;if(V2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=J4(z.commentBefore,Q.commentBefore,Q.comment),Z;if(V2(Z))Z.flow=!0;return z.comment=J4(z.comment??Q.comment),z.commentBefore=J4(z.commentBefore??Q.commentBefore),Z}function J4(...$){let Z=$.filter(D0);return Z.length>0?Z.join(`
|
|
158
|
+
`):void 0}function sB($,Z,Q,z={}){for(let[X,H]of Object.entries(Q)){if(H===void 0)continue;let U=t0(Z,X);if(U)U.value=X8($,U.value,H,z);else Z.items.push($.createPair(X,H))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let H=u$(X);return H===void 0||Q[H]!==void 0})}function D4($,Z,Q,z){let X=h(Q)?Q:{};for(let[H,U]of Object.entries(z)){if(U===void 0)continue;let J=t0(Z,H);if(!J)Z.items.push($.createPair(H,U));else if(Object.prototype.hasOwnProperty.call(X,H)&&p(X[H],U))continue;else if(h(U)&&h(X[H])&&m(J.value))D4($,J.value,X[H],U);else J.value=X8($,J.value,U,{keepAliases:!0})}}function f$($,Z,Q){if(y0($))Q.push({path:[...Z],node:$});else if(m($))for(let z of $.items){let X=u$(z);if(X!==void 0)f$(z.value,[...Z,X],Q)}else if(x0($))$.items.forEach((z,X)=>f$(z,[...Z,X],Q))}function d7($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(h(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function X9($,Z,Q){let z=[];return f$($.contents,[],z),z.filter(({path:X,node:H})=>{let U=d7(Z,X);return U!==void 0&&!p(d7(Q,X),U)&&!p(H.toJS($),U)}).map(({path:X,node:H})=>({path:X.join("."),alias:`*${H.source}`}))}function H9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=rB(Q,Z[X]);let z=Z[Z.length-1];if(m(Q)&&typeof z==="string"){let X=t0(Q,z);return X?{node:X.value,put:(H)=>(X.value=H,!0)}:null}if(x0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,H=X.items[z];return{node:H,put:(U)=>Q0(H)===void 0?(X.items[z]=U,!0):!1}}return null}function rB($,Z){if(m($)&&typeof Z==="string")return t0($,Z)?.value;if(x0($)&&typeof Z==="number")return $.items[Z];return}function U9($,Z){let Q=[];f$($.contents,[],Q);let z=[];for(let{path:X,node:H}of Q){let U=H9(Z,X);if(!U||y0(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 Y4($,Z,Q,z){if(!B0($)||y0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(m($))for(let H of $.items){let U=u$(H);if(U!==void 0)Y4(H.value,[...Z,U],Q,z)}else if(x0($))$.items.forEach((H,U)=>Y4(H,[...Z,U],Q,z))}function J9($,Z){let Q=[];f$($.contents,[],Q);let z=new Set(Q.map((U)=>U.node.source));if(z.size===0)return[];let X=[];Y4($.contents,[],z,X);let H=[];for(let{path:U,node:J}of X){let V=H9(Z,U);if(!V)continue;let G=J.anchor;if(B0(V.node)&&V.node.anchor===G&&p(J.toJS($),V.node.toJS(Z))||!V.put(J.clone()))continue;H.push({path:U.join("."),alias:`&${G}`,kind:"anchor"})}return H}function oB($,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]=p($[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(p($[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 aB($,Z,Q,z){let X=Z.items,H=X.map((G)=>z9($,G)),U=[],J=0,V=0;for(let[G,Y]of[...oB(H,Q),[X.length,Q.length]]){for(;J<G&&V<Y;J++,V++)U.push(X8($,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 m$($,Z,Q,z){if(p(Q,z))return Z;if(!h(Q)||!h(z)||!m(Z))return X8($,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=u$(H);return U===void 0||!X.has(U)});for(let[H,U]of Object.entries(z)){if(U===void 0)continue;let J=t0(Z,H);if(!J)Z.items.push($.createPair(H,U));else if(!p(Q[H],U))J.value=m$($,J.value,Q[H],U)}return Z}function V9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new f2,z=$.contents;if(!m(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let H of Z){let U=t0(X,H);if(U&&m(U.value)){X=U.value;continue}if(U&&!W9(U.value))throw Error(`${Q}: ${H} is not a mapping — faf left it unchanged.`);let J=new f2;if(U)U.value=Y9(U.value,J);else X.items.push($.createPair(H,J));X=J}return X}function H8($,Z,Q,z,X){if(p(Q,z))return;let H=V9($,Z.slice(0,-1),X),U=Z[Z.length-1],J=t0(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=m$($,J.value,Q,z)}function G9($,Z,Q){let z=V9($,Z.slice(0,-1),Q),X=Z[Z.length-1],H=t0(z,X);if(H&&x0(H.value))return H.value;if(H&&!W9(H.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let U=new b$;if(H)H.value=Y9(H.value,U);else z.items.push($.createPair(X,U));return U}function Y9($,Z){if(!n($))return Z;let Q=[$.commentBefore,$.comment].filter(D0);if(Q.length>0)Z.commentBefore=Q.join(`
|
|
159
|
+
`);return Z}function W9($){if($===null||$===void 0)return!0;return n($)&&($.value===null||$.value===void 0)}var I4=new WeakMap;function p$($){return typeof $==="object"&&$!==null?I4.get($):void 0}function U8($,Z){I4.set($,Z)}function B9($,Z){let Q=p$($);if(Q)I4.set(Z,Q);return Z}var q9=new WeakSet;function K9($){return q9.add($),$}function D9($){return typeof $==="object"&&$!==null&&q9.has($)}function J8($){let Z=l$($);return k(L4(Z),Z,{read:!0})}function M9($){if($ instanceof t6)return $;let Z=$?.cause;return Z instanceof t6?Z:null}function P9($,Z){let Q=Z.message.split(`
|
|
160
|
+
`)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=l$($);return new S("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function tB($){let Z=J8($),Q=e(Z),z;try{z=g0(Q)}catch(H){let U=M9(H);if(U)throw P9($,U);throw H}let X=$8(z,$);return U8(X,{real:Z,text:Q}),X}function N9($){let Z=$._meta,Q={...$};delete Q._meta;let z=y$(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 eB($,Z){return R9($,Z,void 0)}function R9($,Z,Q,z,X=!1){let H=J8($),U=e(H),J=[],V;try{V=z8(U,(G)=>{F9(G,$);let Y=G.clone();if(Z(G),J=U9(Y,G),X)J=[...J,...J9(Y,G)];if(z)J=[...J,...z(G,Y.toJS()).filter((W)=>!J.some((B)=>B.path===W.path))]},$)}catch(G){let Y=M9(G);if(Y)throw P9($,Y);throw G}if(!V.changed)return{written:!1,text:U,keptAliases:J};return o($,V.text,{expect:Q&&Q.real===H?Q.text:U}),{written:!0,text:V.text,keptAliases:J}}function L9($){try{return _9($),!0}catch{return!1}}function $q($){let Z=$.getIn(["project","type"],!0);return n(Z)?Z.value:Z}function F9($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!m(Q))throw new S("not-yaml",l$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${v$($.toJS())}. faf left it unchanged — fix it by hand.`)}function Zq($,Z,Q){F9($,Q);let z=$.contents,X=m(z)&&z.items.some((Y)=>n(Y.key)&&Y.key.value==="_meta"),{_meta:H,...U}=Z,J=$q($),V=m(z)?$.toJS():{},G=m(z)?z:$.createNode({});if($.contents=G,D4($,G,V,X?{...Z}:U),!X)zq($,H?.found,J)}function Qq($,Z){let Q=$.contents;if(m(Q)&&Q.items.some((H)=>n(H.key)&&H.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function zq($,Z,Q){if(!Z||Z.length===0||!s(Q))return;let z=$.getIn(["project","type"],!0);if(n(z)&&!s(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function Xq($,Z,Q={}){if(!Q.replace&&L9($)){let J=R9($,(V)=>Zq(V,Z,$),p$(Z),(V,G)=>X9(V,Qq(V,Z),G),D9(Z));U8(Z,{real:J8($),text:J.text});for(let V of J.keptAliases??[])Q.onAliasKept?.(V);return J.written}let z=l$($),X=N9(Z),H=L9($)?q0(k(L4(z),z)):null,U=o($,X,{expect:H});return U8(Z,{real:U,text:X}),!0}function A9($){return e(J8($))}function O9($,Z){let Q;try{Q=_9(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return k($,l$(Z),{read:!0}),!0}function T9($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=I9($,z);if(O9($,X))return X}let Q=L4($);if(Q!==$)for(let z of Z){let X=I9(Q,z);if(O9(Q,X))return X}return null}import{statSync as C9}from"fs";import{homedir as Hq}from"os";import{parse as Uq,resolve as w9}from"path";function j9($,Z){try{let Q=C9($,{bigint:!0}),z=C9(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function Jq($){let Z=w9($),Q=w9(Hq()),z=Uq(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(j9(Z,Q))return"home";if(j9(Z,z))return"root";return null}function Vq($=process.cwd()){return Jq($)!==null}import{existsSync as Gq,statSync as S9}from"fs";import{dirname as Yq,join as Wq}from"path";var Bq=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],qq=1000;function Kq($,Z=Yq($)){let Q=S9($).mtimeMs,z=Bq.map((X)=>{let H=Wq(Z,X);if(!Gq(H))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let U=S9(H).mtimeMs,J=U-Q,V;if(Math.abs(J)<qq)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 xq}from"path";import{deprecate as gq}from"node:util";import{createHash as Mq}from"crypto";import{resolve as Pq}from"path";class W2 extends Error{constructor($){super($);this.name="JsonEditError"}}var Dq=new Set([" ","\t",`
|
|
161
|
+
`,"\r"]);class M4{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 W2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&Dq.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 O4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function _4($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>_4(Q,Z[z]));if(O4($)&&O4(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&_4($[z],Z[z]))}return!1}class E9{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 W2(`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(
|
|
165
|
-
`));continue}let W=JSON.parse(this.s.slice(G.value.start,G.value.end));if(
|
|
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 W2(`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(O4(U)){if(G.value.kind!=="object")throw new W2(`"${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(_4(W,U))continue;if(G.value.kind==="object"||G.value.kind==="array")throw new W2(`"${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),I=this.s.lastIndexOf(`
|
|
166
166
|
`,W.keyStart-1),q=I>0&&this.s[I-1]==="\r"?I-1:I,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
|
|
167
|
+
`,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function Iq($,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 V8($,Z,Q={}){let z=new M4($).parse();if(z.kind!=="object")throw new W2("the JSON is not an object");let X=new
|
|
172
|
-
`)),
|
|
173
|
-
`,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function
|
|
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
|
|
175
|
-
`),Z.join("")}function
|
|
171
|
+
`,z.keyStart-1):-1,H=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(H)?H:" "}}function V8($,Z,Q={}){let z=new M4($).parse();if(z.kind!=="object")throw new W2("the JSON is not an object");let X=new E9($,Iq($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
|
|
172
|
+
`)),b9($,X.edits)}function b9($,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 Lq($){let Z=new M4($).parse();if(Z.kind!=="object")throw new W2("the JSON is not an object");return Z}function Oq($,Z){let Q=$.lastIndexOf(`
|
|
173
|
+
`,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function _q($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(Oq($,Q.keyStart)&&$[Q.value.end]===","){let X=$.lastIndexOf(`
|
|
174
|
+
`,Q.keyStart-1);return{start:X>0&&$[X-1]==="\r"?X-1:X,end:Q.value.end+1,text:""}}if(z>0)return{start:Z.members[z-1].value.end,end:Q.value.end,text:""};return{start:Q.keyStart,end:Z.members[1].keyStart,text:""}}function y9($,Z){let Q=[],z=Lq($);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 x9($,Z){let{count:Q,chain:z}=y9($,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 P4($,Z,Q={}){let{count:z,chain:X}=y9($,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 b9($,[_q($,H.obj,H.member)]).text}var v9="one.faf/render";function R4($){return`sha256:${Mq("sha256").update($,"utf8").digest("hex")}`}var Nq=/^sha256:[0-9a-f]{64}$/,Rq=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,Fq='<meta name="faf-render"',Aq='<meta name="description" content="Visual render of project.faf.';function Tq($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(Aq));return Z.splice(Q+1,0,`<meta name="faf-render" content="${R4($)}">
|
|
175
|
+
`),Z.join("")}function k9($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,H)=>{let U=X.replace(/\r?\n$/,""),J=Rq.exec(U);if(J)Q.push({at:H,hash:J[1]});else if(U.startsWith(Fq))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 N4=["_meta",v9];function Cq($){return V8($,{_meta:{[v9]:R4($)}}).text}function wq($){try{return P4($,N4,{dropEmptyParent:!0})??$}catch{return $}}function jq($){let Z;try{Z=x9($,N4)}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=P4($,N4,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function h9($,Z){return $==="html"?Tq(Z):Cq(Z)}function Sq($,Z){if($==="json")return wq(Z);let Q=k9(Z);return Q===null||Q==="many"?Z:Q.canonical}function g9($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?k9(Q):jq(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===R4(z.canonical)&&h9(Z,z.canonical)===Q?"match":"mismatch"}function Eq($){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
|
|
178
|
-
`);if(V!==null&&J.equals(Buffer.from(G,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!
|
|
179
|
-
`)}function F4($,Z,Q="project.faf"){let z=i2($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=
|
|
177
|
+
`),"utf-8")}function bq($,Z,Q){let z=g9($,Q);return z!=="match"&&Z!==null&&g9(Z,Q)==="match"?"match":z}function c$($,Z,Q){let z=Pq($),X=k(Q.root,z),H=Sq(Q.format,Z),U=h9(Q.format,H),J=q0(X);if(J===null)return o(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&&!yq(z,J,V,H,Q))return{path:X,result:"unchanged"};return o(X,G,{root:Q.root,expect:J}),{path:X,result:"updated"}}function yq($,Z,Q,z,X){let H=bq(Z,Q,X.format);if(H==="match")return!0;if(H==="mismatch")throw new S("not-owned",$,`${$} was edited since faf wrote it — faf left it unchanged. Use --force to replace it.`,{onWrite:!0});if(!X.hasMark(Z))throw new S("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let U=Buffer.from(z,"utf-8");if(Z.equals(U)||Q!==null&&Q.equals(U))return!1;throw new S("not-owned",$,`${$} has no faf render hash (written before 7.13), so faf cannot tell whether it was edited — faf left it unchanged. Use --force once to replace it; after that faf recognises its own output.`,{onWrite:!0})}var f9=U$.orange,vq=U$.cyan,kq=U$.cyanDeep,hq="#FF9500",fq="#FF3B30",uq="#E6EDF3",mq="#6E7681",u9={TROPHY:{glyph:"✪",color:f9},GOLD:{glyph:"★",color:f9},SILVER:{glyph:"◆",color:vq},BRONZE:{glyph:"◇",color:kq},GREEN:{glyph:"●",color:uq},YELLOW:{glyph:"●",color:hq},RED:{glyph:"○",color:fq},WHITE:{glyph:"♡",color:mq}};function i2($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var m9=["who","what","why","where","when","how"];function G8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${i2(Z)}</div><div class="v">${i2(Q)}</div></div>`).join(`
|
|
179
|
+
`)}function F4($,Z,Q="project.faf"){let z=i2($.project?.name??"Project"),X=Z.tier?.name??"WHITE",H=u9[X]??u9.WHITE,U=Z.inherited?Z.represents?`inherited from ${i2(Z.represents)}`:"inherited":`${Z.score}%`,J=X==="TROPHY"&&!Z.inherited,V=$.human_context??{},G=m9.map((q)=>[q,V[q]]),Y=Object.entries(V).filter(([q])=>!m9.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()!==""),I=B.filter(([,q])=>q==="slotignored").length;return`<!DOCTYPE html>
|
|
180
180
|
<html lang="en">
|
|
181
181
|
<head>
|
|
182
182
|
<meta charset="UTF-8">
|
|
@@ -246,39 +246,39 @@ Rendered on-demand from your current <strong>${i2(Q)}</strong><br>
|
|
|
246
246
|
</div>
|
|
247
247
|
</body>
|
|
248
248
|
</html>
|
|
249
|
-
`}var
|
|
250
|
-
`,{root:$,format:"json",hasMark:c9,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function aq($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return V8($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var tq=dq(d$,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as d9}from"fs";import{basename as eq,dirname as n9,join as i9}from"path";import{deprecate as $K}from"node:util";var s9="https://faf.one/context",ZK="JSONRPC",r9="1.0",QK=["a2a","mcp","registry","catalog"];function zK($){return g0(e(k(n9($),eq($))))}function XK($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=i9($,z);if(d9(X))return X}let Q=n9($);if(Q!==$)for(let z of Z){let X=i9(Q,z);if(d9(X))return X}return null}function HK($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function w4($,Z={}){let Q=HK($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:r9}];return[]}function j4($,Z,Q={}){let z=$.agent??{},X=w4($,Q);if(X.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let H=String(z.displayName??$.metadata?.persona??z.name??"").trim(),U=String(z.description??"").trim(),J=String(z.version??"").trim(),V=String(z.vendor??"").trim(),G=String(z.homepage??"").trim();if(!H||!U||!J||!V||!G)throw Error("A2A card needs agent.displayName|name, description, version, vendor, homepage in .fafa");let Y=n2(Z,Q),W=($.capabilities??[]).map((B)=>{let K=String(B.name??"").trim();if(!K)throw Error("A2A skill missing capabilities[].name");let I=Array.isArray(B.tags)?B.tags.map(String):[];return{id:K,name:K,description:String(B.description??"").trim()||K,tags:I}});return{name:H,description:U,supportedInterfaces:X.map((B)=>({url:String(B.location),protocolBinding:ZK,protocolVersion:String(B.version??r9)})),provider:{organization:V,url:G},version:J,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[{uri:s9,description:"FAF context provenance — the durable context block (one context, every door).",required:!1,params:Y}]},defaultInputModes:["text/plain","application/json"],defaultOutputModes:["text/plain","application/json"],skills:W}}var UK=$K(j4,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function JK($){let Z=$.agent?.homepage;if(!Z)return"local";try{return new URL(Z).hostname.replace(/^www\./,"")}catch{return"local"}}function VK($,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 GK($,Z,Q={}){let z=JK($),X=$.agent??{},H=String(X.name??"agent"),U=Q.now??Z.generated??new Date().toISOString(),J=[];if(w4($,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:VK($,Q),updatedAt:U});let V=YK($,"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 YK($,Z){let Q=$.agent?.homepage;if(!Q)return;try{return new URL(`/.well-known/${Z}`,Q).href}catch{return}}function WK($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function BK($,Z){let Q=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]};for(let z of Z){let X=WK(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 qK($){let Z=$.opts??{},Q=new Set($.targets?.length?$.targets:QK),X={block:n2($.faf,Z)};if(Q.has("mcp"))X.mcp=d$($.faf,Z);if(Q.has("registry")){let H=Y8($.faf);X.registry={name:C4($.faf),...H?{title:H}:{},_meta:T4($.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(w4($.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=j4($.fafa,$.faf,Z);if(Q.has("catalog")&&$.fafa)X.catalog=GK($.fafa,$.faf,Z);return KK(X),X}function KK($){let Z=JSON.stringify($.block),Q=[];if($.a2a)Q.push(JSON.stringify($.a2a.capabilities.extensions[0].params));if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block")}var S4=["ephemeral","standard","high","critical"],e0=Object.fromEntries(S4.map(($,Z)=>[$,Z])),W8=new Set(["user","feedback","project","reference"]),E4=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),b4=new Set(["facts","sessions","preferences","custom"]),y4={low:"ephemeral",medium:"standard"};import{existsSync as DK}from"fs";import{dirname as Z3,resolve as Q3}from"path";function B2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function IK($){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 r2=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function LK($){let Z=Q3($),Q=k(Z3(Z),Z,{read:!0});return{real:Q,text:e(Q)}}function o9($,Z,Q,z){let X=Q3($),H=k(Z3(X),X),U=Q!==void 0&&Q.real===H;if(U&&Q.text===Z)return H;let J;try{J=q0(H)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return H;if(!U&&!z&&J)throw new S("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 o($,Z,V===void 0?{}:{expect:V})}function o2($){if(f($))return"standard";if(y4[$])return y4[$];if($ in e0)return $;return"standard"}var _K=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function x4($){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(!_K.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:o2(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 s2($){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 a9($){let Z=$;return r2($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&r2(Z.extra)&&typeof Z.priority==="string"?Z:x4($)}function OK($){if(typeof $==="string"||r2($)&&"text"in $)return x4($);return null}var t9=["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??B2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(a9):[],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||p(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(!DK($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=LK($);return V0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=W4($,Z).toJS();if(!r2(z))throw Error(`soul is not a YAML mapping: ${Z} is ${IK(z)}`);let X=new z3,H=X.pick("memory",z.memory,h)??{},U=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,H)});return(X.pick("memory.facts",H.facts,Array.isArray)??[]).forEach((J,V)=>{let G=OK(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 V0.load($)}toDoc(){let $={facts:this._facts.map(s2),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!b4.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(!E4.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return y$(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")&&p(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&&p(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),G=o9($,V,void 0,z);return this.settle($,V,new Map(this._facts.map((Y,W)=>[Y,W])),G),$}let H=new Map,{text:U}=z8(X.text,(V)=>{H=this.applyTo(V,X,Q)},$),J=o9($,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(s2(Z)))}return{top:Object.fromEntries(t9.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 t9)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!p(z.index,X.index)){if(Z.residual.has("index")&&!Q)V0.refuse(Z,"index","replace it");H8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of $3(z.extra,X.extra))H8($,[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],...$3(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(p(U,J))continue;if(Z.residual.has("memory"))V0.refuse(Z,"memory",`change memory.${H}`);if(Z.residual.has(`memory.${H}`))V0.refuse(Z,`memory.${H}`,"replace it");H8($,["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])=>!p(Z.base.facts.get(Y),s2(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))V0.refuse(Z,G,"add facts to it");let V=J9($,["memory","facts"],Z.path);for(let[G,Y]of U)V.items[Y]=PK($,V.items[Y],Z.base.facts.get(Y),s2(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(s2(G)));return J}add($){let Z=a9($);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(MK(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:o2(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:B2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=r2($)?{...$,...Z}:Z,z=r2($)?$.query:$,X=e0[o2(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((e0[G.priority]??1)<X)return;J.push([Y,G])}),J.sort((G,Y)=>{let W=e0[G[1].priority]??1,B=e0[Y[1].priority]??1;if(B!==W)return B-W;let K=G[1].timestamp??"",I=Y[1].timestamp??"";if(I!==K)return I<K?-1:I>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 MK($,Z,Q){let z=(X,H)=>f(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:o2(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:B2(),extra:{...$.extra}}}class z3{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,v$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,h)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,h)??{}),extra:e9($,E4),memoryExtra:e9(Z,b4)}}}function e9($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function $3($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function PK($,Z,Q,z){if(!m(Z))return m$($,Z,Q,z);let X=(H)=>typeof H==="string"?{text:H}:H;return m$($,Z,X(Q),X(z))}import{readdirSync as RK,readFileSync as NK,statSync as X3,existsSync as FK}from"fs";import{join as AK,basename as H3,resolve as TK}from"path";var U3=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),CK=/\[\[([^\]]+)\]\]/g;function wK($){let Z=X3($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function jK($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=g0(Z[1]);if(!Q||typeof Q!=="object")return{fm:null,body:Z.slice(2).join("---").trim()};return{fm:Q,body:Z.slice(2).join("---").trim()}}catch{return{fm:null,body:$}}}function SK($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!W8.has(X))return null;let H=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||H,V={};if(z.originSessionId)V.provenance=[`session:${z.originSessionId}`];let G=[...new Set([...Z.matchAll(CK)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:G,timestamp:wK($),source:`claude-code memory: ${H3($)}`,extra:V}}function J3($,Z={}){let Q=TK($);if(!FK(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!X3(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??U3,X=Z.namepoint??`@claude-code:${H3(Q)}`,H=[],U=RK(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=AK(Q,W),K;try{K=NK(B,"utf-8")}catch{continue}let{fm:I,body:q}=jK(K);if(!I)continue;let D=SK(B,q,I);if(D)H.push(D)}let J=H.map((W)=>W.timestamp).filter(Boolean),V=J.length?J.reduce((W,B)=>W<B?W:B):B2(),G=J.length?J.reduce((W,B)=>W>B?W:B):V,Y=new V0(X,{profile:"knowledge",facts:H,created:V});return Y.last_etched=G,Y.rebuildIndex(),Y}var B3="faf-interview/1",a2="(terse — 3-4 words)",g4=[{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? ${a2}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${a2}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${a2}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${a2}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${a2}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${a2}`,header:"How",type:"text",required:!0}],q3=[{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}],t2=[...g4,...q3],K3=new Map(t2.map(($)=>[$.path,$])),EK=Object.fromEntries(t2.map(($)=>[$.path,$]));function v4($){let Z=K3.get($);if(Z)return Z.question;let Q=j0.get($)??u.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function bK($,Z){return t2.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 yK=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"]),xK=[["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]],V3=($)=>yK.has($.toLowerCase().trim()),gK=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function G3($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&gK.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function D3($){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=G3(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!V3(X))Z.what=X;let H=xK.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=G3((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!V3(J))Z.who=J;return Z}function Y3($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function W3($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!s(Z)}function vK($,Z={}){let Q=$&&typeof $==="object"?$:{},z=Y3(Q,"project.goal"),X=(W3(z)?String(z).trim():"")||(Z.goal??"").trim(),H=D3(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 I=J[K];if(I)return{value:I,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=g4.map((K,I)=>{let q={n:I+1,path:K.path,header:K.header,question:K.question},D=Y3(Q,K.path);if(W3(D))return{...q,value:String(D).trim(),status:"filled",seeded:!1};let _=V(K.path);if(_)return{...q,value:_.value,status:"seeded",seeded:!0,source:_.source,confidence:_.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:B3,rows:G,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function B8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||s(Z)}return!1}function kK($,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 I3($){if($==="project.goal")return!0;return j0.get($)?.category==="human"}function L3($,Z=B8){let Q=[],z=[];for(let X of t2){let H=kK($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(I3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function _3($,Z,Q=B8){let z=L3(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"?k4(z):[];return{status:X,score:$,gaps:z,ask:H}}function k4($){return $.human.map((Z)=>({path:Z,question:v4(Z)}))}function hK($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??B8,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=_3(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:k4(Y.gaps)}:{status:"stuck",score:G,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:G,rounds:H,history:X,ask:k4(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as M3}from"crypto";var h4="faf-bench/1",fK={"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 uK($,Z){return fK[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var P3=[["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"]],i$=new Map;P3.forEach(($,Z)=>$.forEach((Q)=>i$.set(Q,Z)));var mK=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function q8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function O3($){return q8($).split(" ").filter((Z)=>Z&&!mK.has(Z))}function R3($,Z){let Q=q8($),z=q8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=i$.get(Q);if(X!==void 0&&i$.get(z)===X)return!0;let H=O3($);if(H.length===0)return!1;let U=new Set(O3(Z));return H.every((J)=>{if(U.has(J))return!0;let V=i$.get(J);return V!==void 0&&[...U].some((G)=>i$.get(G)===V)})}function pK($){let Z=m8($),Q=g0($),z=[],X={},H=0;for(let V of u){if(Z.slots[V.path]!=="populated")continue;let G=q5(Q,V);if(typeof G!=="string")continue;let Y=G.trim();if(!Y||H6.has(Y.toLowerCase()))continue;H+=1,z.push({n:H,path:V.path,question:uK(V.path,V.description)}),X[H]=Y}let U=JSON.stringify({v:h4,q:z.map((V)=>[V.path,V.question])}),J=M3("sha256").update(U).digest("hex").slice(0,12);return{version:h4,qsetHash:J,questions:z,answers:X}}function lK($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function cK($,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()!==""&&R3($.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 dK($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:M3("sha256").update(Q).digest("hex")}}import{join as LI,extname as _I,resolve as OI}from"path";var f4={"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 nK}from"path";var e2={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 sK=e2.flutterDeps,rK=e2.mcpDeps,oK=e2.serverFrameworks,aK=e2.stateManagement,tK=e2.routing;function eK($){let Z=new Set,Q=!1;for(let z of $.split(`
|
|
251
|
-
`)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){Q=!0;continue}if(/^\S/.test(z))Q=!1;if(Q){let X=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(X)Z.add(X[1].toLowerCase())}}return Z}function K8($){let Z=w($,"pubspec.yaml");if(Z===null)return null;let Q=
|
|
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
|
|
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 I=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,I),Q.set(W.replace(/-/g,"."),I)}}}}return{plugins:Z,libraries:Q}}function yD($){let Z=w($,K2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return bD(Z)}function xD($){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 gD($,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 vD($,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 j3($){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 v0($,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 n$($,Z,Q){let z;for(let[X,H]of Z){let U=!1;if(Q==="plugin")U=v0($,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 kD($){let Z;for(let Q of RD)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 S3($,Z){let Q=new Set,z=!1,X=!1,H=[K2(Z,"src"),K2(Z,"src","main")],U=(J,V)=>{if(V>4)return;let G=g($,J);if(!G)return;for(let{name:Y}of G){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=K2(J,Y),B=K0($,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 hD($){let Z=[],Q=$.plugins,z=$.artifacts,X=TD.some((N)=>v0(Q,N))||$.sourceHints.has("commonMain"),H=v0(Q,"com.android.application"),U=v0(Q,"com.android.library")||v0(Q,"com.android.kotlin.multiplatform.library");if(H||U)Z.push("android");if(X)Z.push("multiplatform");let J=kD(z),V=n$(Q,ND,"plugin"),G=n$($.parents,FD,"parent"),Y=n$(z,AD,"artifact"),W=n$(Q,wD,"plugin"),B=n$(z,jD,"artifact"),K=SD.some((N)=>v0(Q,N)),I=$.packaging==="pom",q,D="",_;if(H)q="mobile",D=X?"Android+KMP":"Android",_=`${$.path||"root"} + com.android.application (${D})`;else if(J)q="mcp",D="MCP",Z.push("mcp"),_=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(V||G||Y){q="backend",D=V?.[1]||G?.[1]||Y?.[1]||"JVM";let N=V?.[0]||G?.[0]||Y?.[0]||"web";_=`${$.path||"root"} + ${N} (JVM backend)`}else if(X&&!U)q="library",D="Kotlin Multiplatform",_=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(U)q="library",D=X?"Android+KMP":"Android",_=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)q="cli",D=B?.[1]||"application",_=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)q="cli",D="application",_=`${$.path||"root"} + application plugin (JVM CLI)`;else if(I)q="library",_=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{q="library";let N=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(_=`${$.path||"root"} (${N} library)`,K)_=`${$.path||"root"} + java-library (JVM library)`}let M="Java";if($.kotlinSources&&$.javaSources)M="Java/Kotlin";else if($.kotlinSources||CD.some((N)=>v0(Q,N))||X)M="Kotlin";let F=[...new Set(Z)];return{appType:q,framework:D,facets:F,found:_,buildTool:$.buildTool,mainLanguage:M}}function fD($,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 C3($,Z,Q){let z=K2(Z,"build.gradle.kts"),X=K2(Z,"build.gradle"),H=L($,z)?z:L($,X)?X:null;if(!H)return null;let U=w($,H);if(!U)return null;let J=gD(U,Q),V=vD(U,Q),G=S3($,Z),Y=/mainClass\s*[.=]/.test(U)||/mainClassName\s*=/.test(U)||/Main-Class/.test(U),W=v0(J,"application")||v0(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 w3($,Z){let Q=w($,K2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=j3(Q),U=S3($,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 s$($){if(!m4($))return null;let Z=yD($),Q=[],z=null;for(let G of["settings.gradle.kts","settings.gradle"])if(L($,G)){z=w($,G);break}let X=z?xD(z):[],H=C3($,"",Z);if(H)Q.push(H);for(let G of X){let Y=C3($,G,Z);if(Y)Q.push(Y)}let U=w3($,"");if(U){Q.push(U);let G=w($,"pom.xml");if(G){let{modules:Y}=j3(G);for(let W of Y){let B=w3($,W);if(B)Q.push(B)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let J=null,V=999;for(let G of Q){let Y=hD(G),W=fD(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 mD}from"path";var r$={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 pD=r$.mcpGems.map(($)=>$.toLowerCase()),lD=r$.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),E3=r$.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),cD=r$.railsLayoutFiles;function dD($){return L($,"Gemfile")||L($,"gems.rb")||iD($)}function iD($){return(g($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function nD($){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
|
|
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
|
|
256
|
-
`)){let X=Q.replace(/#.*$/,"").match(/add_(?:runtime_|development_)?dependency\s*\(?\s*['"]([^'"]+)['"]/i);if(X)Z.add(X[1].toLowerCase())}return Z}function
|
|
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 qI($,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 y3($,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 KI($){let Z=$.map((Q)=>Q.toLowerCase());return QI.some((Q)=>Z.includes(Q))}function DI($){let Z=!1,Q=!1,z;for(let X of l4($)){let H=w($,$I(X,"project.pbxproj"));if(!H)continue;for(let U of JI)if(H.includes(U))Z=!0,z=U;for(let U of VI)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function II($){for(let Z of GI)if(L($,Z))return Z;return}function a$($){if(!YI($))return null;let Z=L($,"Package.swift"),Q=l4($),z=Q.length>0,X=null;if(Z){let R=w($,"Package.swift");if(R)X=WI(R)}let H=z?DI($):{hasApplication:!1,hasTool:!1},U=II($),J=X?.packageUrls??[],V=X?.productNames??[],G=qI(J,ZI),Y=KI(V),W=y3(J,zI),B=x3(V,XI),K=y3(J,HI),I=x3(V,UI),q=!!(G||Y),D=!!(W||B||U),_=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),M=!!(K||I),F=H.hasApplication,N=Z&&z?"spm+xcode":Z?"spm":"xcode",A,T="",C;if(q)if(A="mcp",T="MCP",Y)C="Package.swift + product MCP (Swift MCP)";else C=`Package.swift + ${G} (Swift MCP)`;else if(D)if(A="backend",T=B?.[1]||W?.[1]||(U?"Vapor":""),B)C=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)C=`Package.swift + ${W[1]} (Swift backend)`;else C=`${U} (Swift backend layout)`;else if(F)A="app",T="",C=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(M||_&&!D&&!q)if(A="cli",T=I?.[1]||K?.[1]||"",I)C=`Package.swift + product ${I[1]} (Swift CLI)`;else if(K)C=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)C="Package.swift + .executable product (Swift CLI)";else C="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Z)A="cli",C=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(A="library",X?.hasLibraryProduct)C="Package.swift + .library product (Swift library)";else C="Package.swift (Swift library)";else A="library",C=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:A,framework:T,packageManager:N,found:C}}var MI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),PI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),RI={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"]},NI=[["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 FI($,Z){for(let[Q,z]of NI)if(Q in $)return z;return Z.length>0?"framework":"config"}function AI($,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 TI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return K0($,Z.name)?.isFile()===!0}function CI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return K0($,Z.name)?.isDirectory()===!0}function wI($){let Z=[],Q=OI($),z=new Set,X=g(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!CI(Q,H):!TI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let V=_8(Q);if(V){let G={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="mobile"&&V.framework)G.framework=V.framework;if(V.targetFramework)G.runtime=V.targetFramework;let Y=V.framework?[V.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:G,priority:36,frameworks:Y,fileName:U})}continue}if(U.endsWith(".xcodeproj")){let V=a$(Q);if(V){let G={mainLanguage:"Swift",packageManager:V.packageManager==="spm"?"spm":"Xcode",buildTool:V.packageManager.includes("spm")?"swift build":"xcodebuild"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="app"&&V.framework)G.framework=V.framework;let Y=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:G,priority:36,frameworks:Y,fileName:U})}continue}let J=f4[U];if(!J)continue;if(U==="manifest.json"&&AI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let V=K8(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=I8(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=O8(Q);if(V){let G={mainLanguage:"Ruby",packageManager:V.packageManager};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";let Y=V.framework?[V.framework,"Ruby"]:["Ruby"];Z.push({slots:G,priority:J.priority??35,frameworks:Y,fileName:U});continue}}if(U==="Package.swift"){let V=a$(Q);if(V){let G={mainLanguage:"Swift",packageManager:V.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="app"&&V.framework)G.framework=V.framework;let Y=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:G,priority:J.priority??36,frameworks:Y,fileName:U});continue}}if(U==="pom.xml"||U==="build.gradle"||U==="build.gradle.kts"||U==="settings.gradle"||U==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let V=s$(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 jI($){let Z=[];for(let Q of c2($,()=>v3($,2,{count:0}))){let z=f4[`*${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($),...jI($)],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:FI(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 M8($){let{slotFills:Z}=g3($),Q={};for(let[z,X]of Object.entries(Z)){let H=RI[z];if(!H||!X)continue;let[U,J]=H;if(U==="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=g($);if(!X)return z;for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=_I(H.name);if(PI.has(U))z.add(U);continue}if(MI.has(H.name)||H.name.startsWith("."))continue;for(let U of v3(LI($,H.name),Z-1,Q))z.add(U)}return z}var a=($,Z,Q)=>({value:$,source:Z,confidence:Q});function k3($,Z={}){let Q=Z.toolingRoot?null:SI($),z=EI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",xI(Q,z)),H("who",gI(z)),H("why",vI(z)),H("where",kI(Q,z)),H("when",hI(z)),H("how",fI(Q,z)),X}function P8($,Z={}){let Q=k3($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function SI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function EI($){let Z=w($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
|
|
249
|
+
`}var pq='<meta name="description" content="Visual render of project.faf.';function lq($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(pq)&&Z.includes(" by faf"))}function cq($,Z,Q,z="project.faf",X={}){c$(xq($,"project.html"),F4(Z,Q,z),{root:$,format:"html",hasMark:lq,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var dq=gq(F4,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as iq}from"path";import{deprecate as nq}from"node:util";var p9="application/vnd.faf+yaml",sq="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",rq=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function c9($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&rq.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 oq($){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 n2($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:p9,iana:`https://www.iana.org/assignments/media-types/${p9}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function d$($,Z={}){let Q={$schema:sq,name:c9($),version:String($.project?.version??"0.1.0"),description:oq($)},z=Y8($)??$.project?.name;if(z&&z.length<=100)Q.title=z;let X=$.project?.homepage??$.project?.website??$.project?.url;if(X)Q.websiteUrl=X;if(Z.remoteUrl)Q.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return Q._meta={"one.faf/context":n2($,Z)},Q}var d9="io.modelcontextprotocol.registry/publisher-provided",l9=4096;function T4($,Z={}){let Q={"one.faf/context":n2($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>l9)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${l9}B cap`);return{[d9]:Q}}function C4($){return c9($)}function Y8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function aq($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var A4=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function i9($){let Z=aq($);return A4(Z)&&A4(Z._meta)&&A4(Z._meta["one.faf/context"])}function tq($,Z,Q={},z={}){let X=d$(Z,Q),H=iq($,"server-card");return c$(H,`${JSON.stringify(X,null,2)}
|
|
250
|
+
`,{root:$,format:"json",hasMark:i9,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function eq($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return V8($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var $K=nq(d$,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as n9}from"fs";import{basename as ZK,dirname as r9,join as s9}from"path";import{deprecate as QK}from"node:util";var o9="https://faf.one/ext/context/v1",zK="JSONRPC",w4="1.0",j4=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],XK=["a2a","mcp","registry","catalog"];function HK($){return g0(e(k(r9($),ZK($))))}function UK($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=s9($,z);if(n9(X))return X}let Q=r9($);if(Q!==$)for(let z of Z){let X=s9(Q,z);if(n9(X))return X}return null}function JK($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function S4($,Z={}){let Q=JK($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:w4}];return[]}function VK($,Z,Q){let z=n2(Z,Q),X=$.agent??{},H={fafaSpecVersion:String($.version??w4),mediaTypes:[...j4],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)H.agentId=X.id;let U=a9($,"fafa");if(U)H.passport=U;return H}function GK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&j4.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function E4($,Z,Q={}){let z=$.agent??{},X=S4($,Q);if(X.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let H=String(z.displayName??$.metadata?.persona??z.name??"").trim(),U=String(z.description??"").trim(),J=String(z.version??"").trim();if(!H||!U||!J)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let V=String(z.vendor??"").trim(),G=String(z.homepage??"").trim(),Y=V&&G?{organization:V,url:G}:void 0,W=($.capabilities??[]).map((B)=>{let K=String(B.name??"").trim();if(!K)throw Error("A2A skill missing capabilities[].name");let I=Array.isArray(B.tags)?B.tags.map(String):[],q=B.cites_spec&&j4.includes(B.cites_spec)?[B.cites_spec,"text/plain"]:void 0;return{id:K,name:K,description:String(B.description??"").trim()||K,tags:I,...q?{inputModes:q}:{}}});return{name:H,description:U,supportedInterfaces:X.map((B)=>({url:String(B.location),protocolBinding:zK,protocolVersion:String(B.version??w4)})),...Y?{provider:Y}:{},version:J,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[{uri:o9,description:"FAF passport and project DNA as typed parts",required:!1,params:VK($,Z,Q)}]},defaultInputModes:GK($),defaultOutputModes:["text/plain","application/json"],skills:W}}var YK=QK(E4,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function WK($){let Z=$.agent?.homepage;if(!Z)return"local";try{return new URL(Z).hostname.replace(/^www\./,"")}catch{return"local"}}function BK($,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 qK($,Z,Q={}){let z=WK($),X=$.agent??{},H=String(X.name??"agent"),U=Q.now??Z.generated??new Date().toISOString(),J=[];if(S4($,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:BK($,Q),updatedAt:U});let V=a9($,"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 a9($,Z){let Q=$.agent?.homepage;if(!Q)return;try{return new URL(`/.well-known/${Z}`,Q).href}catch{return}}function KK($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function DK($,Z){let Q=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]};for(let z of Z){let X=KK(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 IK($){let Z=$.opts??{},Q=new Set($.targets?.length?$.targets:XK),X={block:n2($.faf,Z)};if(Q.has("mcp"))X.mcp=d$($.faf,Z);if(Q.has("registry")){let H=Y8($.faf);X.registry={name:C4($.faf),...H?{title:H}:{},_meta:T4($.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(S4($.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=E4($.fafa,$.faf,Z);if(Q.has("catalog")&&$.fafa)X.catalog=qK($.fafa,$.faf,Z);return LK(X),X}function LK($){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 b4=["ephemeral","standard","high","critical"],e0=Object.fromEntries(b4.map(($,Z)=>[$,Z])),W8=new Set(["user","feedback","project","reference"]),y4=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),x4=new Set(["facts","sessions","preferences","custom"]),g4={low:"ephemeral",medium:"standard"};import{existsSync as OK}from"fs";import{dirname as zQ,resolve as XQ}from"path";function B2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function _K($){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 r2=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function MK($){let Z=XQ($),Q=k(zQ(Z),Z,{read:!0});return{real:Q,text:e(Q)}}function t9($,Z,Q,z){let X=XQ($),H=k(zQ(X),X),U=Q!==void 0&&Q.real===H;if(U&&Q.text===Z)return H;let J;try{J=q0(H)}catch{J=void 0}if(J&&J.equals(Buffer.from(Z,"utf-8")))return H;if(!U&&!z&&J)throw new S("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 o($,Z,V===void 0?{}:{expect:V})}function o2($){if(f($))return"standard";if(g4[$])return g4[$];if($ in e0)return $;return"standard"}var PK=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function v4($){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(!PK.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:o2(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 s2($){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 e9($){let Z=$;return r2($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&r2(Z.extra)&&typeof Z.priority==="string"?Z:v4($)}function NK($){if(typeof $==="string"||r2($)&&"text"in $)return v4($);return null}var $Q=["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??B2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(e9):[],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||p(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}=MK($);return V0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=W4($,Z).toJS();if(!r2(z))throw Error(`soul is not a YAML mapping: ${Z} is ${_K(z)}`);let X=new HQ,H=X.pick("memory",z.memory,h)??{},U=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,H)});return(X.pick("memory.facts",H.facts,Array.isArray)??[]).forEach((J,V)=>{let G=NK(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 V0.load($)}toDoc(){let $={facts:this._facts.map(s2),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!x4.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(!y4.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return y$(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")&&p(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&&p(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),G=t9($,V,void 0,z);return this.settle($,V,new Map(this._facts.map((Y,W)=>[Y,W])),G),$}let H=new Map,{text:U}=z8(X.text,(V)=>{H=this.applyTo(V,X,Q)},$),J=t9($,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(s2(Z)))}return{top:Object.fromEntries($Q.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 $Q)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!p(z.index,X.index)){if(Z.residual.has("index")&&!Q)V0.refuse(Z,"index","replace it");H8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of QQ(z.extra,X.extra))H8($,[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],...QQ(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(p(U,J))continue;if(Z.residual.has("memory"))V0.refuse(Z,"memory",`change memory.${H}`);if(Z.residual.has(`memory.${H}`))V0.refuse(Z,`memory.${H}`,"replace it");H8($,["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])=>!p(Z.base.facts.get(Y),s2(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))V0.refuse(Z,G,"add facts to it");let V=G9($,["memory","facts"],Z.path);for(let[G,Y]of U)V.items[Y]=FK($,V.items[Y],Z.base.facts.get(Y),s2(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(s2(G)));return J}add($){let Z=e9($);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(RK(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:o2(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:B2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=r2($)?{...$,...Z}:Z,z=r2($)?$.query:$,X=e0[o2(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((e0[G.priority]??1)<X)return;J.push([Y,G])}),J.sort((G,Y)=>{let W=e0[G[1].priority]??1,B=e0[Y[1].priority]??1;if(B!==W)return B-W;let K=G[1].timestamp??"",I=Y[1].timestamp??"";if(I!==K)return I<K?-1:I>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 RK($,Z,Q){let z=(X,H)=>f(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:o2(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:B2(),extra:{...$.extra}}}class HQ{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,v$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,h)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,h)??{}),extra:ZQ($,y4),memoryExtra:ZQ(Z,x4)}}}function ZQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function QQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function FK($,Z,Q,z){if(!m(Z))return m$($,Z,Q,z);let X=(H)=>typeof H==="string"?{text:H}:H;return m$($,Z,X(Q),X(z))}import{readdirSync as AK,readFileSync as TK,statSync as UQ,existsSync as CK}from"fs";import{join as wK,basename as JQ,resolve as jK}from"path";var VQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),SK=/\[\[([^\]]+)\]\]/g;function EK($){let Z=UQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function bK($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=g0(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 yK($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!W8.has(X))return null;let H=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||H,V={};if(z.originSessionId)V.provenance=[`session:${z.originSessionId}`];let G=[...new Set([...Z.matchAll(SK)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:G,timestamp:EK($),source:`claude-code memory: ${JQ($)}`,extra:V}}function GQ($,Z={}){let Q=jK($);if(!CK(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!UQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??VQ,X=Z.namepoint??`@claude-code:${JQ(Q)}`,H=[],U=AK(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=wK(Q,W),K;try{K=TK(B,"utf-8")}catch{continue}let{fm:I,body:q}=bK(K);if(!I)continue;let D=yK(B,q,I);if(D)H.push(D)}let J=H.map((W)=>W.timestamp).filter(Boolean),V=J.length?J.reduce((W,B)=>W<B?W:B):B2(),G=J.length?J.reduce((W,B)=>W>B?W:B):V,Y=new V0(X,{profile:"knowledge",facts:H,created:V});return Y.last_etched=G,Y.rebuildIndex(),Y}var KQ="faf-interview/1",a2="(terse — 3-4 words)",k4=[{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? ${a2}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${a2}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${a2}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${a2}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${a2}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${a2}`,header:"How",type:"text",required:!0}],DQ=[{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}],t2=[...k4,...DQ],IQ=new Map(t2.map(($)=>[$.path,$])),xK=Object.fromEntries(t2.map(($)=>[$.path,$]));function h4($){let Z=IQ.get($);if(Z)return Z.question;let Q=j0.get($)??u.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function gK($,Z){return t2.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 vK=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"]),kK=[["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]],YQ=($)=>vK.has($.toLowerCase().trim()),hK=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function WQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&hK.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function LQ($){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=WQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!YQ(X))Z.what=X;let H=kK.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=WQ((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!YQ(J))Z.who=J;return Z}function BQ($,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 qQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!s(Z)}function fK($,Z={}){let Q=$&&typeof $==="object"?$:{},z=BQ(Q,"project.goal"),X=(qQ(z)?String(z).trim():"")||(Z.goal??"").trim(),H=LQ(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 I=J[K];if(I)return{value:I,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=k4.map((K,I)=>{let q={n:I+1,path:K.path,header:K.header,question:K.question},D=BQ(Q,K.path);if(qQ(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:KQ,rows:G,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function B8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||s(Z)}return!1}function uK($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function OQ($){if($==="project.goal")return!0;return j0.get($)?.category==="human"}function _Q($,Z=B8){let Q=[],z=[];for(let X of t2){let H=uK($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(OQ(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function MQ($,Z,Q=B8){let z=_Q(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"?f4(z):[];return{status:X,score:$,gaps:z,ask:H}}function f4($){return $.human.map((Z)=>({path:Z,question:h4(Z)}))}function mK($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??B8,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=MQ(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:f4(Y.gaps)}:{status:"stuck",score:G,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:G,rounds:H,history:X,ask:f4(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as NQ}from"crypto";var u4="faf-bench/1",pK={"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 lK($,Z){return pK[$]??`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"]],i$=new Map;RQ.forEach(($,Z)=>$.forEach((Q)=>i$.set(Q,Z)));var cK=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function q8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function PQ($){return q8($).split(" ").filter((Z)=>Z&&!cK.has(Z))}function FQ($,Z){let Q=q8($),z=q8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=i$.get(Q);if(X!==void 0&&i$.get(z)===X)return!0;let H=PQ($);if(H.length===0)return!1;let U=new Set(PQ(Z));return H.every((J)=>{if(U.has(J))return!0;let V=i$.get(J);return V!==void 0&&[...U].some((G)=>i$.get(G)===V)})}function dK($){let Z=m8($),Q=g0($),z=[],X={},H=0;for(let V of u){if(Z.slots[V.path]!=="populated")continue;let G=D5(Q,V);if(typeof G!=="string")continue;let Y=G.trim();if(!Y||H6.has(Y.toLowerCase()))continue;H+=1,z.push({n:H,path:V.path,question:lK(V.path,V.description)}),X[H]=Y}let U=JSON.stringify({v:u4,q:z.map((V)=>[V.path,V.question])}),J=NQ("sha256").update(U).digest("hex").slice(0,12);return{version:u4,qsetHash:J,questions:z,answers:X}}function iK($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function nK($,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()!==""&&FQ($.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 sK($,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 MI,extname as PI,resolve as NI}from"path";var m4={"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 oK}from"path";var e2={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 aK=e2.flutterDeps,tK=e2.mcpDeps,eK=e2.serverFrameworks,$D=e2.stateManagement,ZD=e2.routing;function QD($){let Z=new Set,Q=!1;for(let z of $.split(`
|
|
251
|
+
`)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){Q=!0;continue}if(/^\S/.test(z))Q=!1;if(Q){let X=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(X)Z.add(X[1].toLowerCase())}}return Z}function K8($){let Z=w($,"pubspec.yaml");if(Z===null)return null;let Q=QD(Z),z=(M)=>Q.has(M.toLowerCase()),X=aK.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),H=tK.find(z),U=eK.find(([M])=>z(M)),J=$D.find(([M])=>z(M)),V=J?J[1]:"",G=ZD.find(([M])=>z(M)),Y=G?G[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",B=/^executables:\s*$/m.test(Z),K=(g($,"bin")??[]).some((M)=>M.name.endsWith(".dart")),I=B||K,q,D="",O;if(X)if(D="Flutter",L($,oK("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(I)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 XD}from"path";var D8={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 HD=D8.mcpModules,UD=D8.serverFrameworks,JD=D8.cliFrameworks;function VD($){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 TQ($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function AQ($,Z){let Q;for(let z of Z){if(!TQ($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function GD($,Z){let Q;for(let z of Z){if(!TQ($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function YD($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function WD($){for(let{name:Z}of g($,"cmd")??[]){let Q=XD("cmd",Z),z=K0($,Q);if(z?.isDirectory()){if((g($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function BD($){let Z=w($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function I8($){let Z=w($,"go.mod");if(Z===null)return null;let Q=YD(Z),z=VD(Z),X=GD(z,HD),H=AQ(z,UD),U=AQ(z,JD),J=WD($),V=BD($),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 q2={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 KD=q2.mcpPackages.map(($)=>$.toLowerCase()),DD=q2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),ID=q2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),LD=q2.grpcServerPackages.map(($)=>$.toLowerCase()),OD=q2.specializedSdks,CQ=q2.baseSdk.toLowerCase();function _D($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),H=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],J=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||H||"").trim(),V=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),G=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),Y=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),B=new Set;for(let I of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))B.add(I[1].toLowerCase());for(let I of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))B.add(I[1].toLowerCase());let K=new Set;for(let I of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))K.add(I[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:J,isTestProject:V,useMaui:G,useWpf:Y,useWindowsForms:W,packages:B,frameworkRefs:K}}function p4($,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 wQ($,Z){let Q;for(let[z,X]of Z){if(!p4($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function MD($){let Z;for(let Q of KD){if(!p4($,Q))continue;if(!Z||Q.length>Z.length)Z=Q}for(let Q of $)if(Q==="modelcontextprotocol"||Q.startsWith("modelcontextprotocol.")){if(!Z||Q.length>Z.length)Z=Q}return Z}function PD($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of OD){let X=z[0].toLowerCase();if(Z===X||Z.startsWith(`${X}/`)){if(!Q||X.length>Q[0].length)Q=z}}return Q}function L8($){let Z=$.toLowerCase();return Z==="exe"||Z==="winexe"}function ND($,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 RD($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:H,outputType:U}=$,J,V="",G,Y=MD(X),W=PD(z),B=wQ(X,ID),K=wQ(X,DD),I=LD.some((D)=>p4(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=I?"gRPC":W[2],G=`${Z} + Sdk=${W[0]}${I?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")J="backend",V=W[2],G=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")J="backend",V=W[2],G=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")J="backend",V=W[2],G=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")J="library",V=W[2],G=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(q&&L8(U))J="backend",V="ASP.NET Core",G=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(q&&!L8(U))J="library",V="ASP.NET Core",G=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(L8(U)||!U))J="cli",V=K[1],G=`${Z} + ${K[0]} (C# CLI)`;else if(L8(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()===CQ||z.toLowerCase().startsWith(`${CQ}/`))G=`${Z} (C# class library)`}return{appType:J,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:V,found:G}}function $$($){return(g($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function O8($){let 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=_D(H),J=RD(U,X),V=ND(J.appType,J.framework);if(!Q||V<z)Q=J,z=V}return Q}import{join as K2}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 AD=I0.mcpArtifacts.map(($)=>$.toLowerCase()),TD=I0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),CD=I0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),wD=I0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),GR=I0.androidPlugins.map(($)=>$.toLowerCase()),jD=I0.kmpPlugins.map(($)=>$.toLowerCase()),SD=I0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),ED=I0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),bD=I0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),yD=I0.libraryPlugins.map(($)=>$.toLowerCase()),xD=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function l4($){return xD.some((Z)=>L($,Z))}function gD($){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 I=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,I),Q.set(W.replace(/-/g,"."),I)}}}}return{plugins:Z,libraries:Q}}function vD($){let Z=w($,K2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return gD(Z)}function kD($){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 hD($,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 fD($,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 v0($,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 n$($,Z,Q){let z;for(let[X,H]of Z){let U=!1;if(Q==="plugin")U=v0($,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 uD($){let Z;for(let Q of AD)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 bQ($,Z){let Q=new Set,z=!1,X=!1,H=[K2(Z,"src"),K2(Z,"src","main")],U=(J,V)=>{if(V>4)return;let G=g($,J);if(!G)return;for(let{name:Y}of G){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=K2(J,Y),B=K0($,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 mD($){let Z=[],Q=$.plugins,z=$.artifacts,X=jD.some((R)=>v0(Q,R))||$.sourceHints.has("commonMain"),H=v0(Q,"com.android.application"),U=v0(Q,"com.android.library")||v0(Q,"com.android.kotlin.multiplatform.library");if(H||U)Z.push("android");if(X)Z.push("multiplatform");let J=uD(z),V=n$(Q,TD,"plugin"),G=n$($.parents,CD,"parent"),Y=n$(z,wD,"artifact"),W=n$(Q,ED,"plugin"),B=n$(z,bD,"artifact"),K=yD.some((R)=>v0(Q,R)),I=$.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(I)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||SD.some((R)=>v0(Q,R))||X)M="Kotlin";let F=[...new Set(Z)];return{appType:q,framework:D,facets:F,found:O,buildTool:$.buildTool,mainLanguage:M}}function pD($,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 jQ($,Z,Q){let z=K2(Z,"build.gradle.kts"),X=K2(Z,"build.gradle"),H=L($,z)?z:L($,X)?X:null;if(!H)return null;let U=w($,H);if(!U)return null;let J=hD(U,Q),V=fD(U,Q),G=bQ($,Z),Y=/mainClass\s*[.=]/.test(U)||/mainClassName\s*=/.test(U)||/Main-Class/.test(U),W=v0(J,"application")||v0(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 SQ($,Z){let Q=w($,K2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=EQ(Q),U=bQ($,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 s$($){if(!l4($))return null;let Z=vD($),Q=[],z=null;for(let G of["settings.gradle.kts","settings.gradle"])if(L($,G)){z=w($,G);break}let X=z?kD(z):[],H=jQ($,"",Z);if(H)Q.push(H);for(let G of X){let Y=jQ($,G,Z);if(Y)Q.push(Y)}let U=SQ($,"");if(U){Q.push(U);let G=w($,"pom.xml");if(G){let{modules:Y}=EQ(G);for(let W of Y){let B=SQ($,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=mD(G),W=pD(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 cD}from"path";var r$={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 dD=r$.mcpGems.map(($)=>$.toLowerCase()),iD=r$.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),yQ=r$.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),nD=r$.railsLayoutFiles;function sD($){return L($,"Gemfile")||L($,"gems.rb")||rD($)}function rD($){return(g($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function oD($){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 aD($){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 tD($){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 eD($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let H=w($,X);if(H){for(let U of oD(H))Z.add(U);Q.push(X)}}let z=w($,"Gemfile.lock")||w($,"gems.locked");if(z){for(let X of aD(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of g($)??[]){if(!X.endsWith(".gemspec"))continue;let H=w($,X);if(H){for(let U of tD(H))Z.add(U);Q.push(X)}}return{gems:Z,sources:Q}}function o$($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function c4($,Z){let Q;for(let[z,X]of Z){if(!o$($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function $I($){let Z;for(let Q of dD)if(o$($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function xQ($){for(let Z of nD)if(L($,Z))return Z;return}function ZI($,Z){let Q=c4(Z,yQ);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of g($)??[]){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=g($,"bin");if(z){let H=z.map((U)=>U.name).filter((U)=>{if(U==="setup"||U==="console"||U==="rake")return!1;return K0($,cD("bin",U))?.isFile()===!0}).filter((U)=>U!=="rails");if(H.length>0&&!o$(Z,"rails")&&!xQ($))return{hit:!0,why:`bin/${H[0]}`}}return{hit:!1,why:""}}function _8($){if(!sD($))return null;let{gems:Z,sources:Q}=eD($),z=Q[0]||"Gemfile",X=Q.some((D)=>D==="Gemfile"||D==="gems.rb"||D.includes("lock"))?"bundler":"rubygems",H=$I(Z),U=c4(Z,iD),J=xQ($),V=o$(Z,"rails")||o$(Z,"railties"),G=ZI($,Z),Y=L($,"config.ru"),W=V||!!J,B=U&&U[1]!=="Rails"&&!(U[0]==="rack"&&!Y)?U:void 0,K,I="",q;if(H)K="mcp",I="MCP",q=`${z} + gem ${H} (Ruby MCP)`;else if(W)if(K="backend",I="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",I=B[1],q=`${z} + gem ${B[0]} (Ruby backend)`;else if(G.hit)K="cli",I=c4(Z,yQ)?.[1]||"",q=`${z} + ${G.why} (Ruby CLI)`;else K="library",q=`${z} (Ruby library)`;return{appType:K,framework:I,packageManager:X,found:q}}import{join as zI}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 XI=A0.mcpPackageUrls.map(($)=>$.toLowerCase()),HI=A0.mcpProducts.map(($)=>$.toLowerCase()),UI=A0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),JI=A0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),VI=A0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),GI=A0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),YI=A0.appProductTypes,WI=A0.cliProductTypes,BI=A0.vaporLayoutFiles;function qI($){return L($,"Package.swift")||d4($).length>0}function d4($){return(g($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&K0($,Z)?.isDirectory()===!0)}function KI($){let Z=DI($),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),I=/\.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:I}}function DI($){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 II($,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 gQ($,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 vQ($,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 LI($){let Z=$.map((Q)=>Q.toLowerCase());return HI.some((Q)=>Z.includes(Q))}function OI($){let Z=!1,Q=!1,z;for(let X of d4($)){let H=w($,zI(X,"project.pbxproj"));if(!H)continue;for(let U of YI)if(H.includes(U))Z=!0,z=U;for(let U of WI)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function _I($){for(let Z of BI)if(L($,Z))return Z;return}function a$($){if(!qI($))return null;let Z=L($,"Package.swift"),Q=d4($),z=Q.length>0,X=null;if(Z){let N=w($,"Package.swift");if(N)X=KI(N)}let H=z?OI($):{hasApplication:!1,hasTool:!1},U=_I($),J=X?.packageUrls??[],V=X?.productNames??[],G=II(J,XI),Y=LI(V),W=gQ(J,UI),B=vQ(V,JI),K=gQ(J,VI),I=vQ(V,GI),q=!!(G||Y),D=!!(W||B||U),O=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),M=!!(K||I),F=H.hasApplication,R=Z&&z?"spm+xcode":Z?"spm":"xcode",A,T="",C;if(q)if(A="mcp",T="MCP",Y)C="Package.swift + product MCP (Swift MCP)";else C=`Package.swift + ${G} (Swift MCP)`;else if(D)if(A="backend",T=B?.[1]||W?.[1]||(U?"Vapor":""),B)C=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)C=`Package.swift + ${W[1]} (Swift backend)`;else C=`${U} (Swift backend layout)`;else if(F)A="app",T="",C=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(M||O&&!D&&!q)if(A="cli",T=I?.[1]||K?.[1]||"",I)C=`Package.swift + product ${I[1]} (Swift CLI)`;else if(K)C=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)C="Package.swift + .executable product (Swift CLI)";else C="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Z)A="cli",C=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(A="library",X?.hasLibraryProduct)C="Package.swift + .library product (Swift library)";else C="Package.swift (Swift library)";else A="library",C=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:A,framework:T,packageManager:R,found:C}}var RI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),FI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),AI={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"]},TI=[["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 CI($,Z){for(let[Q,z]of TI)if(Q in $)return z;return Z.length>0?"framework":"config"}function wI($,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 K0($,Z.name)?.isFile()===!0}function SI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return K0($,Z.name)?.isDirectory()===!0}function EI($){let Z=[],Q=NI($),z=new Set,X=g(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!SI(Q,H):!jI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let V=O8(Q);if(V){let G={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="mobile"&&V.framework)G.framework=V.framework;if(V.targetFramework)G.runtime=V.targetFramework;let Y=V.framework?[V.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:G,priority:36,frameworks:Y,fileName:U})}continue}if(U.endsWith(".xcodeproj")){let V=a$(Q);if(V){let G={mainLanguage:"Swift",packageManager:V.packageManager==="spm"?"spm":"Xcode",buildTool:V.packageManager.includes("spm")?"swift build":"xcodebuild"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="app"&&V.framework)G.framework=V.framework;let Y=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:G,priority:36,frameworks:Y,fileName:U})}continue}let J=m4[U];if(!J)continue;if(U==="manifest.json"&&wI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let V=K8(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=I8(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=_8(Q);if(V){let G={mainLanguage:"Ruby",packageManager:V.packageManager};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";let Y=V.framework?[V.framework,"Ruby"]:["Ruby"];Z.push({slots:G,priority:J.priority??35,frameworks:Y,fileName:U});continue}}if(U==="Package.swift"){let V=a$(Q);if(V){let G={mainLanguage:"Swift",packageManager:V.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(V.appType==="backend"&&V.framework)G.backend=V.framework;else if(V.appType==="cli"&&V.framework)G.framework=V.framework;else if(V.appType==="mcp")G.apiType="MCP";else if(V.appType==="app"&&V.framework)G.framework=V.framework;let Y=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:G,priority:J.priority??36,frameworks:Y,fileName:U});continue}}if(U==="pom.xml"||U==="build.gradle"||U==="build.gradle.kts"||U==="settings.gradle"||U==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let V=s$(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 bI($){let Z=[];for(let Q of c2($,()=>hQ($,2,{count:0}))){let z=m4[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function kQ($){let Z=[...EI($),...bI($)],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:CI(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 M8($){let{slotFills:Z}=kQ($),Q={};for(let[z,X]of Object.entries(Z)){let H=AI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function hQ($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=g($);if(!X)return z;for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=PI(H.name);if(FI.has(U))z.add(U);continue}if(RI.has(H.name)||H.name.startsWith("."))continue;for(let U of hQ(MI($,H.name),Z-1,Q))z.add(U)}return z}var a=($,Z,Q)=>({value:$,source:Z,confidence:Q});function fQ($,Z={}){let Q=Z.toolingRoot?null:yI($),z=xI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",kI(Q,z)),H("who",hI(z)),H("why",fI(z)),H("where",uI(Q,z)),H("when",mI(z)),H("how",pI(Q,z)),X}function P8($,Z={}){let Q=fQ($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function yI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function xI($){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 D2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function bI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function Z$($,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||bI(z[2])>0.4)return null;return{body:D2(z[2]),heading:z[1].trim()}}function yI($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return!1}function t$($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return D2(X[1])}return null}function xI($,Z){if($?.description&&$.description.length>20)return a(D2($.description),"package.json:description",0.95);let Q=Z$(Z,"Purpose|What|About|Overview|Description");if(Q)return a(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("#")&&!yI(H));if(z)return a(D2(z),"README:first-paragraph",0.5);let X=t$(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return X?a(X,"README:problem-heuristic",0.6):null}function gI($){let Z=Z$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return a(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?a(Q,"README:audience-heuristic",0.6):null}function vI($){let Z=Z$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return a(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?a(Q,"README:mission-heuristic",0.6):null}function kI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return a(D2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return a(D2($.homepage),"package.json:homepage",0.9);let z=t$(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?a(z,"README:deploy-heuristic",0.6):null}function hI($){let Z=Z$($,"Timeline|Status|Release|Roadmap");if(Z)return a(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?a(Q,"README:since-heuristic",0.6):null}function fI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return a(D2(z.map((U)=>`npm run ${U}`).join(", ")),"package.json:scripts",0.9);let X=Z$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return a(X.body,`README:## ${X.heading}`,0.8);let H=Z$(Z,"Architecture|Approach|How it works|Methodology|How");return H?a(H.body,`README:## ${H.heading}`,0.7):null}var h3="3.0";import{join as u3}from"path";var f3=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"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 uI($){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 mI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function pI($,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=uI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function lI($){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 dI($,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(L($,"ios")&&L($,"android"))return"ios/ + android/ dirs";return null}function iI($,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 nI($,Z){if(!L($,"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 sI($,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 rI($,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 oI($,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 aI($,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 tI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||L($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var eI=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"]),m3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,$L=new Set(["frontend","backend","database","css","ui","state"]);function ZL($){if(L($,"pyproject.toml")||L($,"manage.py")||L($,"setup.py")||R8($,"requirements*.txt"))return!0;if(L($,"go.mod"))return!0;if(L($,"Cargo.toml"))return!0;if(L($,"Gemfile"))return!0;if(L($,"pom.xml")||R8($,"build.gradle*"))return!0;if($$($).length>0)return!0;let Z=L0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function N8($){return c2($,()=>QL($))}function QL($){let Z=g($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||eI.has(z.name))continue;let X=u3($,z.name);if(!ZL(X))continue;let H=A8(X);if(!H)continue;let U=F8(X).filter((Y)=>$L.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||m3.test(H),hasFramework:!!G,appRoot:L(X,"manage.py")||L(X,"config.ru")||L(X,"bin/rails")||L(X,"artisan")})}return Q}function zL($,Z){if(Z?.workspaces||L($,"pnpm-workspace.yaml"))return null;let Q=N8($),z=new Set(Q.map((X)=>X.language));if(Q.length<2||z.size<2)return null;if(!Q.some((X)=>X.frontend)||!Q.some((X)=>X.backend))return null;return`polyglot: ${Q.map((X)=>`${X.name}/ (${X.language})`).join(", ")}`}function p3($){let Z=N8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(m3.test(U.language)?2:0)+(U.hasFramework?1:0)+(U.frontend?0.5:0),z=[...Z].sort((U,J)=>Q(J)-Q(U)),X=new Set,H=[];for(let U of z){if(X.has(U.language))continue;X.add(U.language);let J=U.frontend?"frontend":U.backend?"backend":"service";H.push(U.topFramework?`${U.language} (${U.topFramework} · ${J})`:`${U.language} (${J})`)}return H.join("; ")}function L0($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function R8($,Z){if(!Z.includes("*"))return L($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(g($)??[]).some((V)=>V.name.startsWith(J))}let z=u3(...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";return(g($,z)??[]).some((J)=>J.name.startsWith(H)&&J.name.endsWith(U))}function XL($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return R8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!R8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function F8($){let Z=L0($);return f3.map((Q)=>{let X=Q.signals.filter((H)=>XL(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 A8($){let Z=L0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(L($,"tsconfig.json"))return"TypeScript";if(L($,"Cargo.toml"))return"Rust";if(L($,"go.mod"))return"Go";if($$($).length>0)return"C#";if(L($,"pyproject.toml")||L($,"setup.py"))return"Python";if(L($,"Gemfile"))return"Ruby";if(m4($)){let Q=s$($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(L($,"Package.swift"))return"Swift";if(L($,"build.zig"))return"Zig";if(L($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function l3($){let Z=L0($),Q=F8($),z=[],X=sI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=pI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=lI($);if(U)return z.push(U),{type:"extension",found:z};let J=aI($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let V=oI($,Z);if(V)return z.push(V),{type:"saas",found:z};let G=iI($,Z);if(G)return z.push(G),{type:"wasm",found:z};let Y=K8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=I8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=_8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=s$($);if(K)return z.push(K.found),{type:K.appType,found:z};let I=O8($);if(I)return z.push(I.found),{type:I.appType,found:z};let q=a$($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=dI($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((x)=>x.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(mI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(L($,"build.zig")){if(z.push("build.zig"),L($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(L($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let M=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit");if(Z?.private===!0&&(L($,"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 N=Q.some((x)=>x.category==="frontend"),A=Q.some((x)=>x.category==="backend");if(Z?.private&&(Z.workspaces||L($,"pnpm-workspace.yaml"))&&N&&A)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=tI($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let C=rI($,Z,Q);if(C)return z.push(C),{type:"website",found:z};if(Q.some((x)=>x.slug==="nextjs"||x.slug==="nuxt"))return z.push(Q.find((x)=>x.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let j=Q.some((x)=>x.category==="frontend"),d=Q.some((x)=>x.category==="backend");if(j&&d)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(j)return z.push("frontend framework"),{type:"frontend",found:z};if(d)return z.push("backend framework"),{type:"backend",found:z};let t=cI($);if(t)return z.push(t),{type:"data-science",found:z};let O=nI($,Z);if(O)return z.push(O),{type:"html",found:z};let E=zL($,Z);if(E)return z.push(E),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push(F2),{type:"library",found:z}}function c3($){if(L($,"bunfig.toml"))return"Bun";if(L($,"deno.json")||L($,"deno.jsonc"))return"Deno";if(L0($))return"Node.js";if(L($,"Cargo.toml"))return"Rust";if(L($,"go.mod"))return"Go";if($$($).length>0)return".NET";if(L($,"pubspec.yaml"))return"Dart";return""}var HL=new Set(["npm","pnpm","yarn","bun"]);function UL($){let Z=L0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return HL.has(Q)?Q:""}function JL($){if(L($,"pubspec.yaml"))return"pub";if(L($,"go.mod"))return"go modules";if($$($).length>0)return"NuGet";if(L($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>L($,Q))?"gradle":""}var VL=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function d3($){return JL($)||UL($)||(VL.find(([Z])=>L($,Z))?.[1]??"")}function i3($){if(L($,".github/workflows"))return"GitHub Actions";if(L($,".gitlab-ci.yml"))return"GitLab CI";if(L($,".circleci"))return"CircleCI";if(L($,"Jenkinsfile"))return"Jenkins";return null}function n3($){if(L($,"vercel.json"))return"Vercel";if(L($,"netlify.toml"))return"Netlify";if(L($,"wrangler.toml"))return"Cloudflare";if(L($,"fly.toml"))return"Fly.io";if(L($,"render.yaml"))return"Render";return null}function s3($){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 r3($){let Z=L0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(L($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function T8($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>L($,Q))}function C8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=L($,"bun.lock")||L($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(L($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&GL($))Q.lint="cargo clippy"}if(L($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(c4($,"build.zig")))Q.test="zig build test"}if(L($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&YL($))Q.test="pytest";return Q}function c4($,Z){return w($,Z)??""}function GL($){if(L($,"clippy.toml")||L($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(c4($,"Cargo.toml"))}function YL($){if(L($,"pytest.ini")||L($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(c4($,Z)))}function o3($,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(L($,"bunfig.toml"))X.push("Bun");else if(L($,"deno.json")||L($,"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 WL($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function a3($){return d4($).data}function d4($){let Z=L0($),Q=F8($),z=l3($),X=z.type,H=z.found.some((b)=>b.startsWith("polyglot:")),U=H&&p3($)||A8($),J=c3($),V=d3($),G=i3($),Y=n3($),W=r3($),B=Q.find((b)=>b.category==="frontend"),K=Q.find((b)=>b.category==="css"),I=Q.find((b)=>b.category==="ui"),q=Q.find((b)=>b.category==="state"),D=Q.find((b)=>b.category==="backend"),_=Q.find((b)=>b.category==="database"),M=(b)=>A2(X,b)??A2("library",b)===!0,F=X==="framework",N=Q.some((b)=>b.slug==="svelte"||b.slug==="sveltekit"),A=F&&N?"svelte":F?null:null,T=X==="svelte"||A==="svelte",C=T?s3($):null,R=T&&Q.some((b)=>b.slug==="sveltekit"),j={},d=u.filter((b)=>b.path.startsWith("stack."));for(let b of d){let v=b.path.replace("stack.","");switch(v){case"frontend":j[v]=B?.name??"";break;case"css_framework":j[v]=K?.name??"";break;case"ui_library":j[v]=I?.name??"";break;case"state_management":j[v]=q?.name??(T&&WL(Z)>=5?"Runes":"");break;case"backend":j[v]=T?R?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":j[v]=R?"Server Routes":"";break;case"runtime":j[v]=J;break;case"database":j[v]=_?.name??"";break;case"connection":j[v]=_?.name??"";break;case"hosting":if(T&&C)j[v]=C;else j[v]=Y??"";break;case"build":j[v]=R?"Vite":W??"";break;case"cicd":j[v]=G??"";break;case"package_manager":j[v]=V;break;default:j[v]="";break}}let t={};for(let b of d){let v=b.path.replace("stack.","");t[v]=M(b)?j[v]:"slotignored"}let O={},E=u.filter((b)=>b.path.startsWith("monorepo."));for(let b of E){let v=b.path.replace("monorepo.","");if(!M(b))O[v]="slotignored";else O[v]=""}let x={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(F&&A)x.framework=A;let G0=o3($,Z,Q,H?A8($):U);if(H){for(let b of N8($))for(let v of[b.language,b.topFramework])if(v&&!G0.includes(v))G0.push(v)}let W5=T8($),B5=C8($,Z),X6={faf_version:h3,project:x,stack:t,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:O,_meta:{found:z.found}};if(G0.length>0)X6.tech_stack=G0;if(W5.length>0)X6.key_files=W5;if(Object.keys(B5).length>0)X6.commands=B5;return{data:X6,facts:j}}var t3={MIN_LENGTH:8,MAX_LENGTH:280},BL=[/^(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(BL.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
|
|
260
|
-
`).length>4)return!1;return!0}function
|
|
259
|
+
`).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function D2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function gI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function Z$($,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||gI(z[2])>0.4)return null;return{body:D2(z[2]),heading:z[1].trim()}}function vI($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return!1}function t$($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return D2(X[1])}return null}function kI($,Z){if($?.description&&$.description.length>20)return a(D2($.description),"package.json:description",0.95);let Q=Z$(Z,"Purpose|What|About|Overview|Description");if(Q)return a(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("#")&&!vI(H));if(z)return a(D2(z),"README:first-paragraph",0.5);let X=t$(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return X?a(X,"README:problem-heuristic",0.6):null}function hI($){let Z=Z$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return a(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?a(Q,"README:audience-heuristic",0.6):null}function fI($){let Z=Z$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return a(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?a(Q,"README:mission-heuristic",0.6):null}function uI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return a(D2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return a(D2($.homepage),"package.json:homepage",0.9);let z=t$(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?a(z,"README:deploy-heuristic",0.6):null}function mI($){let Z=Z$($,"Timeline|Status|Release|Roadmap");if(Z)return a(Z.body,`README:## ${Z.heading}`,0.8);let Q=t$($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?a(Q,"README:since-heuristic",0.6):null}function pI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return a(D2(z.map((U)=>`npm run ${U}`).join(", ")),"package.json:scripts",0.9);let X=Z$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return a(X.body,`README:## ${X.heading}`,0.8);let H=Z$(Z,"Architecture|Approach|How it works|Methodology|How");return H?a(H.body,`README:## ${H.heading}`,0.7):null}var uQ="3.0";import{join as pQ}from"path";var mQ=[{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 lI($){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 cI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function dI($,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=lI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function iI($){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 nI($){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 sI($,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(L($,"ios")&&L($,"android"))return"ios/ + android/ dirs";return null}function rI($,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 oI($,Z){if(!L($,"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 aI($,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 tI($,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 $L($,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 ZL($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||L($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var QL=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"]),lQ=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,zL=new Set(["frontend","backend","database","css","ui","state"]);function XL($){if(L($,"pyproject.toml")||L($,"manage.py")||L($,"setup.py")||N8($,"requirements*.txt"))return!0;if(L($,"go.mod"))return!0;if(L($,"Cargo.toml"))return!0;if(L($,"Gemfile"))return!0;if(L($,"pom.xml")||N8($,"build.gradle*"))return!0;if($$($).length>0)return!0;let Z=L0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function R8($){return c2($,()=>HL($))}function HL($){let Z=g($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||QL.has(z.name))continue;let X=pQ($,z.name);if(!XL(X))continue;let H=A8(X);if(!H)continue;let U=F8(X).filter((Y)=>zL.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||lQ.test(H),hasFramework:!!G,appRoot:L(X,"manage.py")||L(X,"config.ru")||L(X,"bin/rails")||L(X,"artisan")})}return Q}function UL($,Z){if(Z?.workspaces||L($,"pnpm-workspace.yaml"))return null;let Q=R8($),z=new Set(Q.map((X)=>X.language));if(Q.length<2||z.size<2)return null;if(!Q.some((X)=>X.frontend)||!Q.some((X)=>X.backend))return null;return`polyglot: ${Q.map((X)=>`${X.name}/ (${X.language})`).join(", ")}`}function cQ($){let Z=R8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(lQ.test(U.language)?2:0)+(U.hasFramework?1:0)+(U.frontend?0.5:0),z=[...Z].sort((U,J)=>Q(J)-Q(U)),X=new Set,H=[];for(let U of z){if(X.has(U.language))continue;X.add(U.language);let J=U.frontend?"frontend":U.backend?"backend":"service";H.push(U.topFramework?`${U.language} (${U.topFramework} · ${J})`:`${U.language} (${J})`)}return H.join("; ")}function L0($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function N8($,Z){if(!Z.includes("*"))return L($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(g($)??[]).some((V)=>V.name.startsWith(J))}let z=pQ(...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";return(g($,z)??[]).some((J)=>J.name.startsWith(H)&&J.name.endsWith(U))}function JL($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return N8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!N8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function F8($){let Z=L0($);return mQ.map((Q)=>{let X=Q.signals.filter((H)=>JL(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 A8($){let Z=L0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(L($,"tsconfig.json"))return"TypeScript";if(L($,"Cargo.toml"))return"Rust";if(L($,"go.mod"))return"Go";if($$($).length>0)return"C#";if(L($,"pyproject.toml")||L($,"setup.py"))return"Python";if(L($,"Gemfile"))return"Ruby";if(l4($)){let Q=s$($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(L($,"Package.swift"))return"Swift";if(L($,"build.zig"))return"Zig";if(L($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function dQ($){let Z=L0($),Q=F8($),z=[],X=aI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=dI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=iI($);if(U)return z.push(U),{type:"extension",found:z};let J=$L($,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=rI($,Z);if(G)return z.push(G),{type:"wasm",found:z};let Y=K8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=I8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=O8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=s$($);if(K)return z.push(K.found),{type:K.appType,found:z};let I=_8($);if(I)return z.push(I.found),{type:I.appType,found:z};let q=a$($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=sI($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((x)=>x.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(cI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(L($,"build.zig")){if(z.push("build.zig"),L($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(L($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let M=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit");if(Z?.private===!0&&(L($,"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((x)=>x.category==="frontend"),A=Q.some((x)=>x.category==="backend");if(Z?.private&&(Z.workspaces||L($,"pnpm-workspace.yaml"))&&R&&A)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=ZL($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let C=tI($,Z,Q);if(C)return z.push(C),{type:"website",found:z};if(Q.some((x)=>x.slug==="nextjs"||x.slug==="nuxt"))return z.push(Q.find((x)=>x.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let j=Q.some((x)=>x.category==="frontend"),d=Q.some((x)=>x.category==="backend");if(j&&d)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(j)return z.push("frontend framework"),{type:"frontend",found:z};if(d)return z.push("backend framework"),{type:"backend",found:z};let t=nI($);if(t)return z.push(t),{type:"data-science",found:z};let _=oI($,Z);if(_)return z.push(_),{type:"html",found:z};let E=UL($,Z);if(E)return z.push(E),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push(F2),{type:"library",found:z}}function iQ($){if(L($,"bunfig.toml"))return"Bun";if(L($,"deno.json")||L($,"deno.jsonc"))return"Deno";if(L0($))return"Node.js";if(L($,"Cargo.toml"))return"Rust";if(L($,"go.mod"))return"Go";if($$($).length>0)return".NET";if(L($,"pubspec.yaml"))return"Dart";return""}var VL=new Set(["npm","pnpm","yarn","bun"]);function GL($){let Z=L0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return VL.has(Q)?Q:""}function YL($){if(L($,"pubspec.yaml"))return"pub";if(L($,"go.mod"))return"go modules";if($$($).length>0)return"NuGet";if(L($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>L($,Q))?"gradle":""}var WL=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function nQ($){return YL($)||GL($)||(WL.find(([Z])=>L($,Z))?.[1]??"")}function sQ($){if(L($,".github/workflows"))return"GitHub Actions";if(L($,".gitlab-ci.yml"))return"GitLab CI";if(L($,".circleci"))return"CircleCI";if(L($,"Jenkinsfile"))return"Jenkins";return null}function rQ($){if(L($,"vercel.json"))return"Vercel";if(L($,"netlify.toml"))return"Netlify";if(L($,"wrangler.toml"))return"Cloudflare";if(L($,"fly.toml"))return"Fly.io";if(L($,"render.yaml"))return"Render";return null}function oQ($){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 aQ($){let Z=L0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(L($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function T8($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>L($,Q))}function C8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=L($,"bun.lock")||L($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(L($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&BL($))Q.lint="cargo clippy"}if(L($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(i4($,"build.zig")))Q.test="zig build test"}if(L($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&qL($))Q.test="pytest";return Q}function i4($,Z){return w($,Z)??""}function BL($){if(L($,"clippy.toml")||L($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(i4($,"Cargo.toml"))}function qL($){if(L($,"pytest.ini")||L($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(i4($,Z)))}function tQ($,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(L($,"bunfig.toml"))X.push("Bun");else if(L($,"deno.json")||L($,"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 KL($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function eQ($){return n4($).data}function n4($){let Z=L0($),Q=F8($),z=dQ($),X=z.type,H=z.found.some((b)=>b.startsWith("polyglot:")),U=H&&cQ($)||A8($),J=iQ($),V=nQ($),G=sQ($),Y=rQ($),W=aQ($),B=Q.find((b)=>b.category==="frontend"),K=Q.find((b)=>b.category==="css"),I=Q.find((b)=>b.category==="ui"),q=Q.find((b)=>b.category==="state"),D=Q.find((b)=>b.category==="backend"),O=Q.find((b)=>b.category==="database"),M=(b)=>A2(X,b)??A2("library",b)===!0,F=X==="framework",R=Q.some((b)=>b.slug==="svelte"||b.slug==="sveltekit"),A=F&&R?"svelte":F?null:null,T=X==="svelte"||A==="svelte",C=T?oQ($):null,N=T&&Q.some((b)=>b.slug==="sveltekit"),j={},d=u.filter((b)=>b.path.startsWith("stack."));for(let b of d){let v=b.path.replace("stack.","");switch(v){case"frontend":j[v]=B?.name??"";break;case"css_framework":j[v]=K?.name??"";break;case"ui_library":j[v]=I?.name??"";break;case"state_management":j[v]=q?.name??(T&&KL(Z)>=5?"Runes":"");break;case"backend":j[v]=T?N?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":j[v]=N?"Server Routes":"";break;case"runtime":j[v]=J;break;case"database":j[v]=O?.name??"";break;case"connection":j[v]=O?.name??"";break;case"hosting":if(T&&C)j[v]=C;else j[v]=Y??"";break;case"build":j[v]=N?"Vite":W??"";break;case"cicd":j[v]=G??"";break;case"package_manager":j[v]=V;break;default:j[v]="";break}}let t={};for(let b of d){let v=b.path.replace("stack.","");t[v]=M(b)?j[v]:"slotignored"}let _={},E=u.filter((b)=>b.path.startsWith("monorepo."));for(let b of E){let v=b.path.replace("monorepo.","");if(!M(b))_[v]="slotignored";else _[v]=""}let x={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(F&&A)x.framework=A;let G0=tQ($,Z,Q,H?A8($):U);if(H){for(let b of R8($))for(let v of[b.language,b.topFramework])if(v&&!G0.includes(v))G0.push(v)}let q5=T8($),K5=C8($,Z),X6={faf_version:uQ,project:x,stack:t,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:_,_meta:{found:z.found}};if(G0.length>0)X6.tech_stack=G0;if(q5.length>0)X6.key_files=q5;if(Object.keys(K5).length>0)X6.commands=K5;return{data:X6,facts:j}}var $3={MIN_LENGTH:8,MAX_LENGTH:280},DL=[/^(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 O0($){let Z=$.trim();if(Z.length<$3.MIN_LENGTH)return!1;if(Z.length>$3.MAX_LENGTH)return!1;if(DL.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
|
|
260
|
+
`).length>4)return!1;return!0}function IL($){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
|
|
262
|
+
`)}function LL($){let Q=IL($).split(`
|
|
263
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 I2($,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
|
|
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 n4($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=RL(Z,"description");if(Q&&_0(Q))return{project:{goal:Q}};return{}}import{join as e3}from"path";var NL=[{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"}],FL=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function AL($){let Z=[],Q=(z,X)=>{for(let H of g($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(e3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!FL.has(H.name))Q(e3(z,H.name),X-1)};return Q(".",1),Z}function e$($){return[...$].join(" · ")}function s4($){let Z=AL($);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 NL)if(Y.test(V)||Y.test(G))Q[W].add(B)}}let z={};if(Q.database.size)z.database=e$(Q.database);if(Q.cache.size)z.cache=e$(Q.cache);if(Q.search.size)z.search=e$(Q.search);if(Q.storage.size)z.storage=e$(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${e$(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as TL}from"path";var CL=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),wL=[{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 r4($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function jL($){let Z=[$];for(let Q of g($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!CL.has(Q.name))Z.push(TL($,Q.name));return Z}function SL($){let Z=0;if(L($,"manage.py")||L($,"pyproject.toml")||L($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function o4($){return c2($,()=>EL($))}function EL($){let Z=[];for(let z of jL($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of wL){let J=w(z,U.file);if(J===null)continue;let V=U.targets(J);if(V.length===0)continue;let G={},Y=r4(V,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=r4(V,[/^build$/i,/^compile$/i,/^build/i]),B=r4(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:SL(z)),commands:G})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var bL=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function a4($){for(let Z of bL)if(L($,Z))return{security:{secrets:".env",example:Z}};return{}}function yL($,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 t4($){return[i4($),n4($),s4($),o4($),a4($)].reduce(yL,{})}function $Q($){try{let Z=u2($,{logLevel:"error"}).getIn(["project","type"],!0);return n(Z)&&typeof Z.comment==="string"&&Z.comment.includes(F2)}catch{return!1}}function e4($){let Z=a3($),Q=t4($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X={};if(Q.project)X.project=Q.project;if(Q.human_context)X.human_context=Q.human_context;let H=k0(k0(z,Z),X);lL(H);let J=(Z._meta?.found??[]).some((G)=>G.startsWith("polyglot:")),V=k0(H,M8($));return k0(V,{human_context:P8($,{toolingRoot:J})})}function xL($,Z){let Q=pL($8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=d4($),H=z,U=k0(Q,t4($)),J=k0(U,H),V=k0(J,M8($)),G=kL(k0(V,{human_context:P8($)}),Q),Y=hL(gL(Z,Q,H)?fL(ZQ(G,Q),Q,X):ZQ(G,Q),Q);return B9(Y9(Z,Y))}function gL($,Z,Q){if(!s(z0(Z,"project.type"))){let X=p$($)?.text;return X===void 0||!$Q(X)}return!(Q._meta?.found??[]).includes(F2)}function $5($){return $.canonical?[$.path,$.canonical]:[$.path]}function z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)?X[z]:void 0}function L2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!h(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 _2=($)=>typeof $==="string"&&$.trim()===U6;function vL($,Z){let Q=Z.map((z)=>z0($,z));return Q.some(_2)&&Q.every((z)=>s(z)||_2(z))}function ZQ($,Z){let Q={...$};for(let z of u){let X=$5(z);if(!vL(Z,X))continue;for(let H of X){let U=z0(Z,H);if(z0(Q,H)!==U)L2(Q,H,U)}}return Q}function O2($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)&&Object.prototype.hasOwnProperty.call(X,z)}function kL($,Z){let Q={...$};for(let z of u){if(!z.canonical||!O2(Z,z.canonical)||O2(Z,z.path))continue;let X=z0(Q,z.path);L2(Q,z.path,void 0);let H=z0(Q,z.canonical);if(w8(X)&&s(H))L2(Q,z.canonical,X)}return Q}function hL($,Z){let Q={...$};for(let z of u){if(!z.canonical||!O2(Z,z.canonical)||O2(Z,z.path))continue;let X=z0(Q,z.canonical);if(w8(X)||_2(X))L2(Q,z.path,X)}return Q}function fL($,Z,Q={}){let z=$.project,X=h(z)?z.type:void 0,H={...$};for(let U of u){if(U.category==="human"||U.category==="project")continue;let J=A2(X,U);if(J===null)return $;if(J)uL(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0);else mL(H,U)}return H}function uL($,Z,Q,z){let X=$5(Q);for(let U of X)if(_2(z0($,U))&&!_2(z0(Z,U)))L2($,U,O2(Z,U)?z0(Z,U):"");if(!w8(z))return;let H=X.filter((U)=>O2($,U));if(H.some((U)=>!s(z0($,U))))return;for(let U of H.length>0?H:[Q.path])L2($,U,z)}function mL($,Z){let Q=$5(Z).filter((X)=>O2($,X)),z=(X)=>!s(z0($,X))&&!_2(z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(s(z0($,X)))L2($,X,U6)}function pL($){let Z=$.project;if(Z===null||Z===void 0||h(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function lL($){let Z=$.project?.type??"library",Q=N2[Z]||N2.library;for(let z of u){if(Q.includes(z.category))continue;let[X,H]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[H]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[H]="slotignored"}}function k0($,Z){return QQ($,Z,"")}function cL($){let Z=j0.get($);return Z!==void 0&&Z.category!=="human"}function w8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!s($)&&!_2($)}function dL($,Z){return cL($)&&w8(Z)}function QQ($,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(g8(U)){if(dL(J,H))z[X]=H;continue}if(s(U))z[X]=H;else if(h(H)&&h(U))z[X]=QQ(U,H,J)}return z}function iL($){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 zQ($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function nL($,Z={}){let Q=e4($);if(Z.repoUrl&&Q.project&&!L0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=zQ(Z.repoUrl);return Q}import{existsSync as XQ,lstatSync as sL}from"fs";import{join as rL,basename as oL}from"path";import{createHash as aL}from"crypto";var O0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),$2=($)=>typeof $==="number"&&Number.isFinite($),h0=($)=>typeof $==="string",tL=/^v?\d+\.\d+\.\d+$/,eL=new Set(["birth","doubled","peak","current"]);function JQ($){return O0($)&&h0($.version)&&tL.test($.version)&&$2($.score)}var $_=($)=>O0($)&&$2($.birthDNA)&&h0($.born),Z_=($)=>Array.isArray($)&&$.length>0&&$.every(JQ),Q_=($)=>O0($)&&$2($.score)&&h0($.version),z_=($)=>O0($)&&Array.isArray($.milestones)&&$.milestones.every(O0);function HQ($){return O0($)&&$_($.birthCertificate)&&Z_($.versions)&&Q_($.current)&&z_($.growth)}function Z5($){try{return sL($),!0}catch{return!1}}var Q5=($)=>`${JSON.stringify($,null,2)}
|
|
266
|
-
`,X_=new Set(["version","score","lastSync"]),H_=new Set(["type","score","date","version","label","emoji"]),UQ=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),z5={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},VQ=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),GQ=($)=>UQ($.current,X_)&&VQ($).every((Z)=>UQ(Z,H_)),U_=($)=>VQ($).every((Z)=>Z.label===z5[Z.type].label&&Z.emoji===z5[Z.type].emoji);function J_($){return GQ($)&&U_($)}var V_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",G_=".faf-dna is not exactly as faf wrote it (hand formatting, key order, a repeated key or a number JSON cannot hold exactly): faf reads it and leaves it as it is.",Y_=".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.",W_=".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.",B_=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function q_($){if(!Array.isArray($))return[];return $.filter((Z)=>O0(Z)&&h0(Z.type)&&eL.has(Z.type)&&$2(Z.score))}var M2=($,Z="")=>h0($)?$:Z;function K_($,Z){if(!Array.isArray($))return[];return $.filter(JQ).map((Q)=>({version:Q.version,timestamp:M2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(h0):[],growth:$2(Q.growth)?Q.growth:Q.score-Z}))}function D_($,Z,Q,z){return{version:M2($.version,Z?.version??"v1.0.0"),score:$2($.score)?$.score:Z?.score??Q,lastSync:M2($.lastSync,z)}}function I_($){if(!O0($)||!O0($.birthCertificate)||!$2($.birthCertificate.birthDNA))return null;let Z=$.birthCertificate,Q=Z.birthDNA,z=M2(Z.born),X=K_($.versions,Q),H=D_(O0($.current)?$.current:{},X[X.length-1],Q,z),U=O0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"?"legacy":"init",projectDNA:M2(Z.projectDNA),certificate:M2(Z.certificate)},versions:X,current:H,growth:{totalGrowth:H.score-Q,daysActive:$2(U.daysActive)?U.daysActive:0,milestones:q_(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:M2($.lastModified,z),format:"faf-dna-v1"}}class YQ{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=rL($,".faf-dna")}exists(){let $=XQ(this.dnaPath);if(!$&&!Z5(this.dnaPath))this.sawNoFile=!0;return $}birth($){if(!Z5(this.dnaPath))this.sawNoFile=!0;let Z=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,H=$-X,U=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:U,timestamp:z,score:$,changes:Z,growth:H}),Q.current={version:U,score:$,lastSync:z},Q.growth.totalGrowth=H,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,U,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((H)=>H.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:h0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=h0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(h0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!XQ(this.dnaPath)){if(!Z5(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(HQ(Q)&&Q5(Q)===Z&&J_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=I_(Q),this.reason=!this.dna?B_:!HQ(Q)?V_:Q5(Q)!==Z?G_:GQ(Q)?W_:Y_;return this.text=Z,this.dna}read(){let $;try{$=e(k(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=Q5(this.dna),Z=this.text??(this.sawNoFile?null:q0(k(this.projectPath,".faf-dna")));o(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return aL("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=oL(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,...z5[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 s_}from"path";import{existsSync as p_,statSync as sF}from"fs";import{join as PQ}from"path";import{dirname as IQ,resolve as LQ}from"path";var BQ=100;var L_="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",__=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${L_})(?=\\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")],O_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],M_=["","-->","?>",">","]]>"],P_=/[#`~*+_=<>0-9-]/,R_=/(\d{1,9})([.)])/y,N_=/#{1,6}(?:[ \t]+|$)/y,F_=/`{3,}(?!.*`)|~{3,}/y,A_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,T_=/(?:=+|-+)[ \t]*$/y,C_=/[^ \t\f\v\r\n]/;function $6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var w_=($)=>$==="quote"||$==="list"||$==="item";function j_($){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 Q$=($)=>$===" "||$==="\t";function S_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var WQ=($)=>$==="paragraph"||$==="code"||$==="html";function E_($){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(E_),$.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}>`:M_[$.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"&&WQ(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!P_.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(!WQ($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=O_[$.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),Q$(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?$6(A_,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&&Q$(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??=j_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),Q$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!$6(N_,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:$6(F_,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let H=__[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!=="-"||!$6(T_,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||Q$(z)))return null;if(Z&&!C_.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"?$6(R_,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&&Q$(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,Q$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!S_(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 T0="<!-- faf:start -->",C0="<!-- faf:end -->",qQ="\uFEFF";function Q6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var z$=($)=>$.replace(/\r?\n$|\r$/,""),_Q=($)=>z$($).replace(/^\uFEFF/,"").trimEnd();function*OQ($){let Z=0;for(let Q of Q6($)){let z=z$(Q),X=Z===0&&z.charCodeAt(0)===65279?1:0;yield{offset:Z,from:Z+X,to:Z+z.length,content:z.slice(X)},Z+=Q.length}}function b_($,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 X5($,Z,Q){let[z,X]=[new f0(!0),new f0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of OQ($)){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)b_(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 KQ=($)=>(Z)=>Z===$;function P2($,Z=T0,Q=C0){return X5($,KQ(Z),KQ(Q))}function DQ($,Z){let Q=[];for(let z of[!0,!1]){let X=new f0(z);for(let H of Q6($))X.line(z$(H));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var y_=16;function x_($){let Z=new f0(!0);return $.map((Q)=>{let z=Z.overflowAt(z$(Q),y_),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(z$(X)),X})}function g_($,Z,Q){let X=x_(Q6($).map((U)=>{let J=_Q(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=DQ(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
|
|
267
|
-
${H[0]}`,J=
|
|
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 OL($){let Z=I2($,/^(use\s+cases?|goal)\b/i);if(Z&&O0(Z))return Z;let Q=LL($);if(Q&&O0(Q))return Q;return}function _L($){let Z=I2($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&O0(Z))return Z;return}function ML($){let Z=I2($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&O0(Z))return Z;return}function PL($){let Z=I2($,/^(why|motivation|problem|rationale)\b/i);if(Z&&O0(Z))return Z;return}function NL($){let Z=I2($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&O0(Z))return Z;return}function RL($){let Z=I2($,/^(status|history|timeline|since|launched)\b/i);if(Z&&O0(Z))return Z;return}function FL($){let Z=I2($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&O0(Z))return Z;return}function s4($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(L($,K)){Q=K;break}if(!Q)return{};let z=w($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},H=OL(z);if(H)X.project={goal:H};let U={},J=_L(z);if(J)U.what=J;let V=ML(z);if(V)U.who=V;let G=PL(z);if(G)U.why=G;let Y=NL(z);if(Y)U.where=Y;let W=RL(z);if(W)U.when=W;let B=FL(z);if(B)U.how=B;if(Object.keys(U).length>0)X.human_context=U;return X}function AL($,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 r4($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=AL(Z,"description");if(Q&&O0(Q))return{project:{goal:Q}};return{}}import{join as Z3}from"path";var TL=[{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"}],CL=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function wL($){let Z=[],Q=(z,X)=>{for(let H of g($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(Z3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!CL.has(H.name))Q(Z3(z,H.name),X-1)};return Q(".",1),Z}function e$($){return[...$].join(" · ")}function o4($){let Z=wL($);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 TL)if(Y.test(V)||Y.test(G))Q[W].add(B)}}let z={};if(Q.database.size)z.database=e$(Q.database);if(Q.cache.size)z.cache=e$(Q.cache);if(Q.search.size)z.search=e$(Q.search);if(Q.storage.size)z.storage=e$(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${e$(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as jL}from"path";var SL=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),EL=[{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 a4($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function bL($){let Z=[$];for(let Q of g($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!SL.has(Q.name))Z.push(jL($,Q.name));return Z}function yL($){let Z=0;if(L($,"manage.py")||L($,"pyproject.toml")||L($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function t4($){return c2($,()=>xL($))}function xL($){let Z=[];for(let z of bL($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of EL){let J=w(z,U.file);if(J===null)continue;let V=U.targets(J);if(V.length===0)continue;let G={},Y=a4(V,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=a4(V,[/^build$/i,/^compile$/i,/^build/i]),B=a4(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:yL(z)),commands:G})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var gL=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function e4($){for(let Z of gL)if(L($,Z))return{security:{secrets:".env",example:Z}};return{}}function vL($,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 $5($){return[s4($),r4($),o4($),t4($),e4($)].reduce(vL,{})}function Q3($){try{let Z=u2($,{logLevel:"error"}).getIn(["project","type"],!0);return n(Z)&&typeof Z.comment==="string"&&Z.comment.includes(F2)}catch{return!1}}function Z5($){let Z=eQ($),Q=$5($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X={};if(Q.project)X.project=Q.project;if(Q.human_context)X.human_context=Q.human_context;let H=k0(k0(z,Z),X);iL(H);let J=(Z._meta?.found??[]).some((G)=>G.startsWith("polyglot:")),V=k0(H,M8($));return k0(V,{human_context:P8($,{toolingRoot:J})})}function kL($,Z){let Q=dL($8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=n4($),H=z,U=k0(Q,$5($)),J=k0(U,H),V=k0(J,M8($)),G=uL(k0(V,{human_context:P8($)}),Q),Y=mL(hL(Z,Q,H)?pL(z3(G,Q),Q,X):z3(G,Q),Q);return K9(B9(Z,Y))}function hL($,Z,Q){if(!s(z0(Z,"project.type"))){let X=p$($)?.text;return X===void 0||!Q3(X)}return!(Q._meta?.found??[]).includes(F2)}function Q5($){return $.canonical?[$.path,$.canonical]:[$.path]}function z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)?X[z]:void 0}function L2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!h(H))return;if(Q===void 0?!(X in H):H[X]===Q)return;let U={...H};if(Q===void 0)delete U[X];else U[X]=Q;$[z]=U}var O2=($)=>typeof $==="string"&&$.trim()===U6;function fL($,Z){let Q=Z.map((z)=>z0($,z));return Q.some(O2)&&Q.every((z)=>s(z)||O2(z))}function z3($,Z){let Q={...$};for(let z of u){let X=Q5(z);if(!fL(Z,X))continue;for(let H of X){let U=z0(Z,H);if(z0(Q,H)!==U)L2(Q,H,U)}}return Q}function _2($,Z){let[Q,z]=Z.split("."),X=$[Q];return h(X)&&Object.prototype.hasOwnProperty.call(X,z)}function uL($,Z){let Q={...$};for(let z of u){if(!z.canonical||!_2(Z,z.canonical)||_2(Z,z.path))continue;let X=z0(Q,z.path);L2(Q,z.path,void 0);let H=z0(Q,z.canonical);if(w8(X)&&s(H))L2(Q,z.canonical,X)}return Q}function mL($,Z){let Q={...$};for(let z of u){if(!z.canonical||!_2(Z,z.canonical)||_2(Z,z.path))continue;let X=z0(Q,z.canonical);if(w8(X)||O2(X))L2(Q,z.path,X)}return Q}function pL($,Z,Q={}){let z=$.project,X=h(z)?z.type:void 0,H={...$};for(let U of u){if(U.category==="human"||U.category==="project")continue;let J=A2(X,U);if(J===null)return $;if(J)lL(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0);else cL(H,U)}return H}function lL($,Z,Q,z){let X=Q5(Q);for(let U of X)if(O2(z0($,U))&&!O2(z0(Z,U)))L2($,U,_2(Z,U)?z0(Z,U):"");if(!w8(z))return;let H=X.filter((U)=>_2($,U));if(H.some((U)=>!s(z0($,U))))return;for(let U of H.length>0?H:[Q.path])L2($,U,z)}function cL($,Z){let Q=Q5(Z).filter((X)=>_2($,X)),z=(X)=>!s(z0($,X))&&!O2(z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(s(z0($,X)))L2($,X,U6)}function dL($){let Z=$.project;if(Z===null||Z===void 0||h(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function iL($){let Z=$.project?.type??"library",Q=R2[Z]||R2.library;for(let z of u){if(Q.includes(z.category))continue;let[X,H]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[H]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[H]="slotignored"}}function k0($,Z){return X3($,Z,"")}function nL($){let Z=j0.get($);return Z!==void 0&&Z.category!=="human"}function w8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!s($)&&!O2($)}function sL($,Z){return nL($)&&w8(Z)}function X3($,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(g8(U)){if(sL(J,H))z[X]=H;continue}if(s(U))z[X]=H;else if(h(H)&&h(U))z[X]=X3(U,H,J)}return z}function rL($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let Q=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=Q.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(Q))return`${Q}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function H3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function oL($,Z={}){let Q=Z5($);if(Z.repoUrl&&Q.project&&!L0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=H3(Z.repoUrl);return Q}import{existsSync as U3,lstatSync as aL}from"fs";import{join as tL,basename as eL}from"path";import{createHash as $O}from"crypto";var _0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),$2=($)=>typeof $==="number"&&Number.isFinite($),h0=($)=>typeof $==="string",ZO=/^v?\d+\.\d+\.\d+$/,QO=new Set(["birth","doubled","peak","current"]);function G3($){return _0($)&&h0($.version)&&ZO.test($.version)&&$2($.score)}var zO=($)=>_0($)&&$2($.birthDNA)&&h0($.born),XO=($)=>Array.isArray($)&&$.length>0&&$.every(G3),HO=($)=>_0($)&&$2($.score)&&h0($.version),UO=($)=>_0($)&&Array.isArray($.milestones)&&$.milestones.every(_0);function J3($){return _0($)&&zO($.birthCertificate)&&XO($.versions)&&HO($.current)&&UO($.growth)}function z5($){try{return aL($),!0}catch{return!1}}var X5=($)=>`${JSON.stringify($,null,2)}
|
|
266
|
+
`,JO=new Set(["version","score","lastSync"]),VO=new Set(["type","score","date","version","label","emoji"]),V3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),H5={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},Y3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),W3=($)=>V3($.current,JO)&&Y3($).every((Z)=>V3(Z,VO)),GO=($)=>Y3($).every((Z)=>Z.label===H5[Z.type].label&&Z.emoji===H5[Z.type].emoji);function YO($){return W3($)&&GO($)}var WO=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",BO=".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.",qO=".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.",KO=".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.",DO=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function IO($){if(!Array.isArray($))return[];return $.filter((Z)=>_0(Z)&&h0(Z.type)&&QO.has(Z.type)&&$2(Z.score))}var M2=($,Z="")=>h0($)?$:Z;function LO($,Z){if(!Array.isArray($))return[];return $.filter(G3).map((Q)=>({version:Q.version,timestamp:M2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(h0):[],growth:$2(Q.growth)?Q.growth:Q.score-Z}))}function OO($,Z,Q,z){return{version:M2($.version,Z?.version??"v1.0.0"),score:$2($.score)?$.score:Z?.score??Q,lastSync:M2($.lastSync,z)}}function _O($){if(!_0($)||!_0($.birthCertificate)||!$2($.birthCertificate.birthDNA))return null;let Z=$.birthCertificate,Q=Z.birthDNA,z=M2(Z.born),X=LO($.versions,Q),H=OO(_0($.current)?$.current:{},X[X.length-1],Q,z),U=_0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"?"legacy":"init",projectDNA:M2(Z.projectDNA),certificate:M2(Z.certificate)},versions:X,current:H,growth:{totalGrowth:H.score-Q,daysActive:$2(U.daysActive)?U.daysActive:0,milestones:IO(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:M2($.lastModified,z),format:"faf-dna-v1"}}class B3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;sawNoFile=!1;constructor($){this.projectPath=$,this.dnaPath=tL($,".faf-dna")}exists(){let $=U3(this.dnaPath);if(!$&&!z5(this.dnaPath))this.sawNoFile=!0;return $}birth($){if(!z5(this.dnaPath))this.sawNoFile=!0;let Z=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,H=$-X,U=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:U,timestamp:z,score:$,changes:Z,growth:H}),Q.current={version:U,score:$,lastSync:z},Q.growth.totalGrowth=H,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,U,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((H)=>H.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:h0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=h0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(h0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!U3(this.dnaPath)){if(!z5(this.dnaPath))this.sawNoFile=!0;return null}let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(J3(Q)&&X5(Q)===Z&&YO(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=_O(Q),this.reason=!this.dna?DO:!J3(Q)?WO:X5(Q)!==Z?BO:W3(Q)?KO:qO;return this.text=Z,this.dna}read(){let $;try{$=e(k(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=X5(this.dna),Z=this.text??(this.sawNoFile?null:q0(k(this.projectPath,".faf-dna")));o(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$,this.sawNoFile=!1}generateProjectDNA(){return $O("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=eL(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,...H5[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 aO}from"path";import{existsSync as dO,statSync as aF}from"fs";import{join as R3}from"path";import{dirname as O3,resolve as _3}from"path";var K3=100;var MO="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",PO=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${MO})(?=\\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")],NO=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],RO=["","-->","?>",">","]]>"],FO=/[#`~*+_=<>0-9-]/,AO=/(\d{1,9})([.)])/y,TO=/#{1,6}(?:[ \t]+|$)/y,CO=/`{3,}(?!.*`)|~{3,}/y,wO=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,jO=/(?:=+|-+)[ \t]*$/y,SO=/[^ \t\f\v\r\n]/;function $6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var EO=($)=>$==="quote"||$==="list"||$==="item";function bO($){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 Q$=($)=>$===" "||$==="\t";function yO($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var q3=($)=>$==="paragraph"||$==="code"||$==="html";function xO($){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(xO),$.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}>`:RO[$.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"&&q3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!FO.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(!q3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=NO[$.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),Q$(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?$6(wO,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&&Q$(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??=bO(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),Q$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!$6(TO,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:$6(CO,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=PO[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!=="-"||!$6(jO,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||Q$(z)))return null;if(Z&&!SO.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"?$6(AO,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&&Q$(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,Q$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!yO(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),EO($.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 T0="<!-- faf:start -->",C0="<!-- faf:end -->",D3="\uFEFF";function Q6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var z$=($)=>$.replace(/\r?\n$|\r$/,""),M3=($)=>z$($).replace(/^\uFEFF/,"").trimEnd();function*P3($){let Z=0;for(let Q of Q6($)){let z=z$(Q),X=Z===0&&z.charCodeAt(0)===65279?1:0;yield{offset:Z,from:Z+X,to:Z+z.length,content:z.slice(X)},Z+=Q.length}}function gO($,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 U5($,Z,Q){let[z,X]=[new f0(!0),new f0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of P3($)){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)gO(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 I3=($)=>(Z)=>Z===$;function P2($,Z=T0,Q=C0){return U5($,I3(Z),I3(Q))}function L3($,Z){let Q=[];for(let z of[!0,!1]){let X=new f0(z);for(let H of Q6($))X.line(z$(H));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var vO=16;function kO($){let Z=new f0(!0);return $.map((Q)=>{let z=Z.overflowAt(z$(Q),vO),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(z$(X)),X})}function hO($,Z,Q){let X=kO(Q6($).map((U)=>{let J=M3(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=L3(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
|
|
267
|
+
${H[0]}`,J=L3(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function fO($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=Q6(z).map((H)=>z$(H)===""?`>${H}`:`> ${H}`).join("");return`${Z}
|
|
268
268
|
${X}
|
|
269
|
-
${Q}`}function Z6($,Z,Q,z=T0,X=C0,H="the file"){let U=(V)=>{let G=`${$}${V}${Q}`,Y=P2(G,z,X);return Y&&Y.start===$.length&&Y.end===$.length+V.length?G:null},J=U(Z)??U(
|
|
270
|
-
${
|
|
269
|
+
${Q}`}function Z6($,Z,Q,z=T0,X=C0,H="the file"){let U=(V)=>{let G=`${$}${V}${Q}`,Y=P2(G,z,X);return Y&&Y.start===$.length&&Y.end===$.length+V.length?G:null},J=U(Z)??U(fO(Z,z,X));if(J===null)throw new S("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 J5($,Z=T0,Q=C0){return`${Z}
|
|
270
|
+
${hO($.trim(),Z,Q)}
|
|
271
271
|
${Q}`}function j8($,Z,Q=T0,z=C0,X){if($===null)return Z6("",Z,`
|
|
272
|
-
`,Q,z,X);let H=P2($,Q,z);if(H)return Z6($.slice(0,H.start),Z,$.slice(H.end),Q,z,X);let U=$.startsWith(
|
|
272
|
+
`,Q,z,X);let H=P2($,Q,z);if(H)return Z6($.slice(0,H.start),Z,$.slice(H.end),Q,z,X);let U=$.startsWith(D3)?D3:"";return Z6(U,Z,`
|
|
273
273
|
|
|
274
|
-
${$.slice(U.length)}`,Q,z,X)}function z6($){try{return e($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function M0($,Z,Q=T0,z=C0,X={}){let H=
|
|
275
|
-
${V}`}function
|
|
276
|
-
`)}function
|
|
277
|
-
`)}function
|
|
278
|
-
`)}function
|
|
279
|
-
`)}function
|
|
280
|
-
`)}function
|
|
281
|
-
`)}function E8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function
|
|
274
|
+
${$.slice(U.length)}`,Q,z,X)}function z6($){try{return e($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function M0($,Z,Q=T0,z=C0,X={}){let H=J5(Z,Q,z),U=_3($),J=X.root??O3(U),V=k(J,U),G=z6(V);o(V,j8(G,H,Q,z,U),{root:J,expect:G})}var uO="<!-- faf:";function mO($){if($==="code fence")return"a code fence";if($==="indented code")return"an indented code block";if($==="comment")return"an HTML comment";return $==="html"?"an HTML block":`a ${$} block`}function pO($,Z){let Q=[new f0(!0),new f0(!1)],z=!1;for(let{content:X}of P3($)){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 S8($,Z,Q=T0,z=C0){if(Z===null||P2(Z,Q,z))return null;let X=M3(Q6(Z)[0]??"");if(X.startsWith(uO)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let H=pO(Z,Q);if(H===null)return null;if(H==="too deep")return`${$}: faf's block is now on top; the file nests more than ${K3} 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 ${mO(H)} and is left as you had it — delete it by hand if you no longer want it.`}function lO($,Z,Q=T0,z=C0,X={}){try{let H=_3($);return S8(Z,z6(k(X.root??O3(H),H)),Q,z)}catch{return null}}var cO=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 V5($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return cO.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function c($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function $0($){let Z=j0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return V5(Q)}var G5=r.claude,iO="STATUS: SYNC ACTIVE";function nO($){let Z=R3($,G5);if(!dO(Z))return null;return e(k($,G5))}function sO($,Z){M0(R3($,G5),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 rO($){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(`**${$0(`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])=>`- **${$0(`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(`*${iO} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
|
|
276
|
+
`)}function N3($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function oO($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=N3(Q[1].trim());if(!Z.project.name){let H=$.match(/\*\*Name:\*\*\s*(.+)/);if(H)Z.project.name=N3(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 X0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),F3=($)=>Array.isArray($)?$.join(", "):String($),tO=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),eO=new Set(["target_user","core_problem","mission_purpose"]);function A3($){let Z=[],Q=(_="")=>Z.push(_),z=$.ai_instructions,X=$.preferences,H=$.instant_context,U=$.security,J=$.commands,V=$.key_files??H?.key_files,G=X0($.project?.default_branch)?String($.project?.default_branch):"main",Y=J?Object.entries(J).filter(([,_])=>X0(_)):[],W=Y.filter(([_])=>/test/i.test(_)),B=Y.filter(([_])=>/lint|check/i.test(_)&&!/test/i.test(_)),K=Y.filter(([_])=>!/test|lint|check/i.test(_)),I=(_)=>{let E=_.toLowerCase();if(/install|deps/.test(E))return 0;if(/^build$|build/.test(E)&&!/rebuild/.test(E))return 1;if(/^dev$|develop/.test(E))return 2;if(/^start$|run/.test(E))return 3;return 4},q=[...K].sort((_,E)=>I(_[0])-I(E[0])||_[0].localeCompare(E[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(X0($.project?.type))F.push(`type: ${String($.project?.type)}`);if(X0($.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[_,E]of q)Q(`${E} # ${_}`);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((E)=>{let x=String(E),G0=x.indexOf(" — ");return G0>0?{path:x.slice(0,G0),role:x.slice(G0+3)}:{path:x,role:""}});if(_.some((E)=>E.role)){Q("| Path | Role |"),Q("|------|------|");for(let E of _)Q(`| \`${E.path}\` | ${E.role} |`)}else for(let E of _)Q(`- \`${E.path}\``);Q()}let A=new Map,T=(_)=>{if(!_)return;for(let[E,x]of Object.entries(_)){if(tO.has(E)||!X0(x))continue;let G0=V5(E);if(!A.has(G0))A.set(G0,F3(x))}};T(z?.working_style),T(X);let C=$.conventions??[];if(A.size||C.length){Q("## Conventions"),Q();for(let[_,E]of A)Q(`- **${_}:** ${E}`);for(let _ of C)if(X0(_))Q(`- ${_}`);Q()}let N=(z?.warnings??[]).filter((_)=>X0(_)),j=["read the tree"];if(O)j.push(`run the tests (\`${O}\`)`);if(M)j.push("build the project");for(let[,_]of B.slice(0,1))j.push(`\`${_}\``);Q("## Guardrails"),Q();for(let _ of N)Q(`- ${_}`);Q(`- **Always OK:** ${[...new Set(j)].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 d=[];for(let[,_]of B)d.push(`\`${_}\` exits 0`);for(let[,_]of W)d.push(`\`${_}\` passes`);if(d.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(d)].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&&(X0(U.secrets)||(U.never??[]).length)){if(Q("## Security & secrets"),Q(),X0(U.secrets)){let _=X0(U.example)?` (see \`${U.example}\`)`:"";Q(`- Secrets live in \`${U.secrets}\`${_}. Never read or commit them.`)}for(let _ of U.never??[])if(X0(_))Q(`- Never read or commit \`${_}\`.`);Q()}if(Q("## Commit & PR"),Q(),X&&X0(X.commit_style))Q(`- Commit style: ${F3(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[E,x]of Object.entries($.stack)){if(eO.has(E))continue;if(c(x))_.push(`- **${$0(`stack.${E}`)}:** ${x.trim()}`)}if(_.length){Q("## Stack"),Q();for(let E of _)Q(E);Q()}}let t=$.generated;if(X0(t))Q(`*Context authored: ${String(t)}*`);return Z.join(`
|
|
277
|
+
`)}function $_($,Z){M0(aO($,r.agents),A3(Z))}import{join as Z_}from"path";var Q_=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),z_=new Set(["target_user","core_problem","mission_purpose"]);function T3($){let Z=[],Q=$.instant_context,z=$.commands,X=$.key_files??Q?.key_files,H=z?Object.entries(z).filter(([,B])=>Q_(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,I]of Object.entries($.stack)){if(z_.has(K))continue;if(c(I))B.push(`- ${$0(`stack.${K}`)}: ${I.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 X_($,Z){M0(Z_($,r.gemini),T3(Z))}import{join as H_}from"path";function C3($){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(c(z))Z.push(`# ${$0(`stack.${Q}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
|
|
279
|
+
`)}function U_($,Z){M0(H_($,r.cursorrules),C3(Z),"# faf:start","# faf:end")}import{join as J_}from"path";var w3=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],V_=new Set([...w3.map(([$])=>$),"cicd"]);function j3($){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(""),c($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},X=[];if(c($.project?.main_language))X.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[G,Y]of Object.entries(z)){if(V_.has(G))continue;if(c(Y))X.push(`- **${$0(`stack.${G}`)}:** ${Y.trim()}`)}if(X.length>0)Z.push("## Tech stack","",...X,"");let H=[];for(let[G,Y]of w3){let W=z[G];if(c(W))H.push(`- ${Y} \`${W.trim()}\`.`)}if(c(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])=>c(G)).map(([G,Y])=>`- **${$0(`human_context.${G}`)}:** ${Y.trim()}`);if(V.length>0)Z.push("## Project context","",...V,"");return Z.join(`
|
|
280
|
+
`)}function G_($,Z){d2($,".github"),M0(J_($,".github",r.copilot),j3(Z),T0,C0,{root:$})}import{existsSync as Y_,lstatSync as x3,readFileSync as b8,realpathSync as Y5,statSync as W_}from"fs";import{homedir as B_}from"os";import{basename as q_,dirname as W5,join as P0,resolve as N2}from"path";var S3=200,E3=200,b3=12,K_="# Project Context (from project.faf)",D_="*This section is managed by tri-sync.";function I_($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function g3($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=S3)return Z;return`${Z.slice(0,S3)}-${Math.abs(I_($)).toString(36)}`}function v3($){try{let Z=x3($);if(Z.isSymbolicLink()){let Q=W_($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function y3($){try{return x3($).isFile()}catch{return!1}}function L_($){let Z=$;for(;;){if(v3(P0(Z,".git")))return Z;let Q=W5(Z);if(Q===Z)return null;Z=Q}}function O_($){let Z;try{Z=b8(P0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=N2($,Z.slice(7).trim()),z=P0(Q,"commondir");if(!y3(z))return $;let X=N2(Q,b8(z,"utf-8").trim());if(N2(W5(Q))!==P0(X,"worktrees"))return $;let H=P0(Q,"gitdir");if(!y3(H))return $;let U=b8(H,"utf-8").trim();if(Y5(N2(Q,U))!==P0(Y5($),".git"))return $;if(q_(X)!==".git")return v3(P0(X,".git"))?$:X;return W5(X)}catch{return $}}function k3($){let Z=N2($);try{Z=Y5.native(Z)}catch{}let Q=L_(Z);return(Q?O_(Q):Z).normalize("NFC")}function x8($,Z={}){if(Z.memoryDir)return N2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||P0(B_(),".claude");return P0(N2(Q),"projects",g3(k3($)),"memory").normalize("NFC")}function __($,Z={}){return P0(x8($,Z),r.memory)}var M_=new Set(["target_user","core_problem","mission_purpose"]),P_=["who","what","why","where","when","how"];function h3($){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:** ${c(Z.name)?Z.name:"Project"}`,...Q.filter(([,U])=>c(U)).map(([U,J])=>`- **${U}:** ${J}`),...E8("Stack",Object.entries($.stack??{}).filter(([U,J])=>!M_.has(U)&&c(J)).map(([U,J])=>`- **${$0(`stack.${U}`)}:** ${J}`)),...E8("Context",P_.filter((U)=>c(z[U])).map((U)=>`- **${$0(`human_context.${U}`)}:** ${z[U]}`)),...E8("Commands",Object.entries($.commands??{}).filter(([,U])=>c(U)).slice(0,b3).map(([U,J])=>`- ${U}: \`${J}\``)),...E8("Key files",X.filter(c).slice(0,b3).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 E8($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function f3($){return U5($,(Z)=>Z.trimEnd()===K_,(Z)=>Z.startsWith(D_))}function y8($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function N_($,Z,Q){if($===null)return{text:j8(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=P2($),X=z??f3($);if(X){let U=$.slice(0,X.start),J=$.slice(X.end);return{text:Z6(U,Z,J,void 0,void 0,Q),action:z?"updated":"migrated",head:U,tail:J}}let H=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:j8($,Z,void 0,void 0,Q),action:"added",head:H,tail:$.slice(H.length)}}function B5($){return $>E3?[`MEMORY.md is ${$} lines. Claude Code loads the first ${E3}; lines after that are kept in the file but not loaded.`]:[]}function R_($,Z={}){let Q=x8($,Z),z=P0(Q,r.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!Y_(Q))return X;let H=z6(k(Q,r.memory));if(H===null)return X;let U=P2(H),J=U?`${H.slice(0,U.start)}${H.slice(U.end)}`:H,V=y8(H);return{path:z,exists:!0,lines:V,hasBlock:U!==null,blockLines:U?y8(H.slice(U.start,U.end)):0,hasLegacySection:!U&&f3(H)!==null,otherLines:J.split(/\r\n|\r|\n/).filter((G)=>G.replace(/^\uFEFF/,"").trim()!=="").length,warnings:B5(V)}}function F_($,Z,Q={}){let z=x8($,Q);d2(z);let X=k(z,r.memory),H=z6(X),U=N_(H,J5(h3(Z)),X);if(U.text===H){let B=y8(H);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:B,warnings:B5(B)}}let J=o(X,U.text,{root:z,expect:H}),V=b8(J,"utf-8"),G=V===U.text&&V.startsWith(U.head)&&V.endsWith(U.tail),Y=y8(V),W=U.action==="added"?S8(r.memory,H):null;return{path:J,action:U.action,written:!0,preserved:G,lines:Y,warnings:[...W?[W]:[],...B5(Y)]}}function A_($,Z){let Q=[],z=(V)=>L($,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 T_($,Z){let Q={...Z},z=null,X=w($,"package.json");if(X!==null)try{z=JSON.parse(X)}catch{z=null}let H=C8($,z);if(Object.keys(H).length)Q.commands={...H,...Z.commands??{}};let U=Z.key_files??Z.instant_context?.key_files;if(!U||U.length===0){let J=T8($);if(J.length)Q.key_files=J}if(!Z.security){let V=[".env",".env.local",".env.development"].find((G)=>L($,G));if(V){let G=[".env.example",".env.sample",".env.template"].find((Y)=>L($,Y));Q.security={secrets:V,...G?{example:G}:{}}}}if(!Z.conventions){let J=A_($,z);if(J.length)Q.conventions=J}return Q}export{tq as writeServerCard,cq as writeProjectHtml,X_ as writeGeminiMd,Xq as writeFaf,U_ as writeCursorrules,G_ as writeCopilotInstructions,F_ as writeClaudeMemory,sO as writeClaudeMd,$_ as writeAgentsMd,Hz as validateFaf,B2 as utcNow,DK as upsertCatalog,eB as updateFafFile,kL as updateExistingFaf,M8 as turboCatSlots,kQ as turboCatScan,d3 as slotsByCategory,N9 as serializeFaf,LQ as seedSixWsFromGoal,Xz as scoreText,m8 as scoreFafYaml,o as safeWriteFile,IB as safeUnlink,u7 as safeReplaceOwned,mK as runLoop,k as resolveInside,__ as resolveClaudeMemoryPath,x8 as resolveClaudeMemoryDir,H3 as repoNameFromUrl,F4 as renderProjectHtml,T3 as renderGeminiMd,C3 as renderCursorrules,j3 as renderCopilotInstructions,h3 as renderClaudeMemory,rO as renderClaudeMd,A3 as renderAgentsMd,fQ as relentlessContextDetailed,P8 as relentlessContext,Y8 as registryTitle,C4 as registryName,T4 as registryMeta,e as readUtf8,HK as readFafa,A9 as readFafRaw,tB as readFaf,nO as readClaudeMd,h4 as questionForSlot,iK as publicQuestions,IK as projectCards,eq as patchServerJson,oO as parseClaudeMd,rL as normalizeGitUrl,q8 as normalizeAnswer,d2 as makeDirInside,MQ as loopVerdict,lO as legacyStampNoteAt,S8 as legacyStampNote,u8 as kernel,s as isPlaceholder,Vq as isNonProjectRoot,OQ as isHumanSlot,s3 as isExplicitNone,B8 as isEmptyValue,gK as interviewForMissing,M0 as injectFafBlock,nK as gradeAnswers,V$ as getTier,o3 as getNextTier,$K as generateServerCard,dq as generateProjectHtml,YK as generateA2ACard,GQ as fromClaudeDir,UK as findFafaFile,T9 as findFafFile,P2 as findFafBlock,k0 as fillEmpties,w0 as fafMetaTag,n2 as fafContextBlock,M5 as enrichScore,T_ as enrichFromRepo,dK as deriveQuestionSet,Kq as computeDrift,k3 as claudeProjectRoot,g3 as claudeProjectId,R_ as claudeMemoryStatus,_Q as classifyGaps,o2 as canonicalPriority,fK as buildTableOf8,d$ as buildServerCard,sK as buildReceipt,E4 as buildA2ACard,oL as authorFafFromRepo,Z5 as assembleFreshFaf,FQ as answersMatch,S0 as TIERS,S as SafePathError,DQ as STACK_INTERVIEW,j0 as SLOT_BY_PATH,u as SLOTS,U6 as SLOTIGNORED,k4 as SIX_WS_INTERVIEW,d9 as REGISTRY_PUBLISHER_KEY,e0 as PRIORITY_RANK,b4 as PRIORITY_ORDER,H6 as PLACEHOLDERS,W8 as KNOWLEDGE_TYPES,KQ as INTERVIEW_VERSION,xK as INTERVIEW_PATHS,IQ as INTERVIEW_BY_PATH,t2 as INTERVIEW,V0 as FafmSoul,B3 as FafDNAManager,T0 as FAF_START,U$ as FAF_HEX,C0 as FAF_END,I5 as EXPLICIT_NONE,n3 as ENTERPRISE_SLOTS,u4 as BENCH_VERSION,i3 as BASE_SLOTS,RQ as ALIAS_GROUPS,o9 as A2A_CONTEXT_URI};
|
|
282
282
|
|
|
283
|
-
//# debugId=
|
|
283
|
+
//# debugId=8884F59A31DA9A6864756E2164756E21
|
|
284
284
|
//# sourceMappingURL=index.js.map
|