faf 8.9.0 → 8.11.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 +25 -23
- package/dist/cli.js +364 -346
- package/dist/cli.js.map +1 -1
- package/dist/core/dot-path.d.ts +23 -0
- package/dist/core/interview.d.ts +18 -6
- package/dist/core/suggest.d.ts +55 -0
- package/dist/detect/assemble.d.ts +4 -2
- package/dist/detect/relentless.d.ts +3 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +179 -178
- package/dist/index.js.map +1 -1
- package/dist/interop/agents.d.ts +7 -5
- package/dist/interop/claude.d.ts +1 -1
- package/dist/interop/copilot-instructions.d.ts +2 -2
- package/dist/interop/cursorrules.d.ts +2 -2
- package/dist/interop/faf.d.ts +16 -0
- package/dist/interop/gemini.d.ts +2 -2
- package/dist/interop/labels.d.ts +29 -0
- package/dist/interrogate/readme.d.ts +9 -0
- package/dist/interrogate/types.d.ts +34 -0
- package/package.json +2 -2
- package/project.faf +5 -5
package/dist/index.js
CHANGED
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`)}}
|
|
3
|
-
`)?
|
|
1
|
+
import{createRequire as ZX}from"node:module";var az=Object.defineProperty;var _=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var tz=($)=>$;function ez($,Z){this[$]=tz.bind(null,Z)}var $X=($,Z)=>{for(var Q in Z)az($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:ez.bind(Z,Q)})};var F$=ZX(import.meta.url);var x=_((TX)=>{var M4=Symbol.for("yaml.alias"),J1=Symbol.for("yaml.document"),C6=Symbol.for("yaml.map"),H1=Symbol.for("yaml.pair"),I4=Symbol.for("yaml.scalar"),j6=Symbol.for("yaml.seq"),m0=Symbol.for("yaml.node.type"),IX=($)=>!!$&&typeof $==="object"&&$[m0]===M4,OX=($)=>!!$&&typeof $==="object"&&$[m0]===J1,_X=($)=>!!$&&typeof $==="object"&&$[m0]===C6,PX=($)=>!!$&&typeof $==="object"&&$[m0]===H1,V1=($)=>!!$&&typeof $==="object"&&$[m0]===I4,FX=($)=>!!$&&typeof $==="object"&&$[m0]===j6;function Y1($){if($&&typeof $==="object")switch($[m0]){case C6:case j6:return!0}return!1}function RX($){if($&&typeof $==="object")switch($[m0]){case M4:case C6:case I4:case j6:return!0}return!1}var NX=($)=>(V1($)||Y1($))&&!!$.anchor;TX.ALIAS=M4;TX.DOC=J1;TX.MAP=C6;TX.NODE_TYPE=m0;TX.PAIR=H1;TX.SCALAR=I4;TX.SEQ=j6;TX.hasAnchor=NX;TX.isAlias=IX;TX.isCollection=Y1;TX.isDocument=OX;TX.isMap=_X;TX.isNode=RX;TX.isPair=PX;TX.isScalar=V1;TX.isSeq=FX});var j$=_((pX)=>{var i=x(),z0=Symbol("break visit"),G1=Symbol("skip children"),j0=Symbol("remove node");function w6($,Z){let Q=W1(Z);if(i.isDocument($)){if(p2(null,$.contents,Q,Object.freeze([$]))===j0)$.contents=null}else p2(null,$,Q,Object.freeze([]))}w6.BREAK=z0;w6.SKIP=G1;w6.REMOVE=j0;function p2($,Z,Q,z){let X=q1($,Z,Q,z);if(i.isNode(X)||i.isPair(X))return B1($,z,X),p2($,X,Q,z);if(typeof X!=="symbol"){if(i.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let J=p2(U,Z.items[U],Q,z);if(typeof J==="number")U=J-1;else if(J===z0)return z0;else if(J===j0)Z.items.splice(U,1),U-=1}}else if(i.isPair(Z)){z=Object.freeze(z.concat(Z));let U=p2("key",Z.key,Q,z);if(U===z0)return z0;else if(U===j0)Z.key=null;let J=p2("value",Z.value,Q,z);if(J===z0)return z0;else if(J===j0)Z.value=null}}return X}async function S6($,Z){let Q=W1(Z);if(i.isDocument($)){if(await l2(null,$.contents,Q,Object.freeze([$]))===j0)$.contents=null}else await l2(null,$,Q,Object.freeze([]))}S6.BREAK=z0;S6.SKIP=G1;S6.REMOVE=j0;async function l2($,Z,Q,z){let X=await q1($,Z,Q,z);if(i.isNode(X)||i.isPair(X))return B1($,z,X),l2($,X,Q,z);if(typeof X!=="symbol"){if(i.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let U=0;U<Z.items.length;++U){let J=await l2(U,Z.items[U],Q,z);if(typeof J==="number")U=J-1;else if(J===z0)return z0;else if(J===j0)Z.items.splice(U,1),U-=1}}else if(i.isPair(Z)){z=Object.freeze(z.concat(Z));let U=await l2("key",Z.key,Q,z);if(U===z0)return z0;else if(U===j0)Z.key=null;let J=await l2("value",Z.value,Q,z);if(J===z0)return z0;else if(J===j0)Z.value=null}}return X}function W1($){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 q1($,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 B1($,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`)}}pX.visit=w6;pX.visitAsync=S6});var O4=_((rX)=>{var K1=x(),dX=j$(),iX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},nX=($)=>$.replace(/[!,[\]{}]/g,(Z)=>iX[Z]);class V0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},V0.defaultYaml,$),this.tags=Object.assign({},V0.defaultTags,Z)}clone(){let $=new V0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new V0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:V0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},V0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:V0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},V0.defaultTags),this.atNextDocument=!1;let Q=$.trim().split(/[ \t]+/),z=Q.shift();switch(z){case"%TAG":{if(Q.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),Q.length<2)return!1}let[X,U]=Q;return this.tags[X]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,Q.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[X]=Q;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let U=/^\d+\.\d+$/.test(X);return Z(6,`Unsupported YAML version ${X}`,U),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let U=$.slice(2,-1);if(U==="!"||U==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return U}let[,Q,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let X=this.tags[Q];if(X)try{return X+decodeURIComponent(z)}catch(U){return Z(String(U)),null}if(Q==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,Q]of Object.entries(this.tags))if($.startsWith(Q))return Z+nX($.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&&K1.isNode($.contents)){let X={};dX.visit($.contents,(U,J)=>{if(K1.isNode(J)&&J.tag)X[J.tag]=!0}),z=Object.keys(X)}else z=[];for(let[X,U]of Q){if(X==="!!"&&U==="tag:yaml.org,2002:")continue;if(!$||z.some((J)=>J.startsWith(U)))Z.push(`%TAG ${X} ${U}`)}return Z.join(`
|
|
2
|
+
`)}}V0.defaultYaml={explicit:!1,version:"1.2"};V0.defaultTags={"!!":"tag:yaml.org,2002:"};rX.Directives=V0});var E6=_((eX)=>{var D1=x(),oX=j$();function aX($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Q=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Q)}return!0}function L1($){let Z=new Set;return oX.visit($,{Value(Q,z){if(z.anchor)Z.add(z.anchor)}}),Z}function M1($,Z){for(let Q=1;;++Q){let z=`${$}${Q}`;if(!Z.has(z))return z}}function tX($,Z){let Q=[],z=new Map,X=null;return{onAnchor:(U)=>{Q.push(U),X??(X=L1($));let J=M1(Z,X);return X.add(J),J},setAnchors:()=>{for(let U of Q){let J=z.get(U);if(typeof J==="object"&&J.anchor&&(D1.isScalar(J.node)||D1.isCollection(J.node)))J.node.anchor=J.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=U,H}}},sourceObjects:z}}eX.anchorIsValid=aX;eX.anchorNames=L1;eX.createNodeAnchors=tX;eX.findNewAnchor=M1});var _4=_((XU)=>{function w$($,Z,Q,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let X=0,U=z.length;X<U;++X){let J=z[X],H=w$($,z,String(X),J);if(H===void 0)delete z[X];else if(H!==J)z[X]=H}else if(z instanceof Map)for(let X of Array.from(z.keys())){let U=z.get(X),J=w$($,z,X,U);if(J===void 0)z.delete(X);else if(J!==U)z.set(X,J)}else if(z instanceof Set)for(let X of Array.from(z)){let U=w$($,z,X,X);if(U===void 0)z.delete(X);else if(U!==X)z.delete(X),z.add(U)}else for(let[X,U]of Object.entries(z)){let J=w$($,z,X,U);if(J===void 0)delete z[X];else if(J!==U)z[X]=J}return $.call(Z,Q,z)}XU.applyReviver=w$});var i0=_((HU)=>{var JU=x();function I1($,Z,Q){if(Array.isArray($))return $.map((z,X)=>I1(z,String(X),Q));if($&&typeof $.toJSON==="function"){if(!Q||!JU.hasAnchor($))return $.toJSON(Z,Q);let z={aliasCount:0,count:1,res:void 0};Q.anchors.set($,z),Q.onCreate=(U)=>{z.res=U,delete Q.onCreate};let X=$.toJSON(Z,Q);if(Q.onCreate)Q.onCreate(X);return X}if(typeof $==="bigint"&&!Q?.keep)return Number($);return $}HU.toJS=I1});var b6=_((WU)=>{var YU=_4(),O1=x(),GU=i0();class _1{constructor($){Object.defineProperty(this,O1.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(!O1.isDocument($))throw TypeError("A document argument is required");let U={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},J=GU.toJS(this,"",U);if(typeof z==="function")for(let{count:H,res:V}of U.anchors.values())z(V,H);return typeof X==="function"?YU.applyReviver(X,{"":J},"",J):J}}WU.NodeBase=_1});var S$=_((MU)=>{var BU=E6(),KU=j$(),c2=x(),DU=b6(),LU=i0();class P1 extends DU.NodeBase{constructor($){super(c2.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=[],KU.visit($,{Node:(X,U)=>{if(c2.isAlias(U)||c2.hasAnchor(U))Q.push(U)}}),Z)Z.aliasResolveCache=Q;let z=void 0;for(let X of Q){if(X===this)break;if(X.anchor===this.source)z=X}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:Q,doc:z,maxAliasCount:X}=Z,U=this.resolve(z,Z);if(!U){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let J=Q.get(U);if(!J)LU.toJS(U,null,Z),J=Q.get(U);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=y6(z,U,Q);if(J.count*J.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString($,Z,Q){let z=`*${this.source}`;if($){if(BU.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 y6($,Z,Q){if(c2.isAlias(Z)){let z=Z.resolve($),X=Q&&z&&Q.get(z);return X?X.count*X.aliasCount:0}else if(c2.isCollection(Z)){let z=0;for(let X of Z.items){let U=y6($,X,Q);if(U>z)z=U}return z}else if(c2.isPair(Z)){let z=y6($,Z.key,Q),X=y6($,Z.value,Q);return Math.max(z,X)}return 1}MU.Alias=P1});var d=_((RU)=>{var OU=x(),_U=b6(),PU=i0(),FU=($)=>!$||typeof $!=="function"&&typeof $!=="object";class W2 extends _U.NodeBase{constructor($){super(OU.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:PU.toJS(this.value,$,Z)}toString(){return String(this.value)}}W2.BLOCK_FOLDED="BLOCK_FOLDED";W2.BLOCK_LITERAL="BLOCK_LITERAL";W2.PLAIN="PLAIN";W2.QUOTE_DOUBLE="QUOTE_DOUBLE";W2.QUOTE_SINGLE="QUOTE_SINGLE";RU.Scalar=W2;RU.isScalarValue=FU});var E$=_((SU)=>{var AU=S$(),q2=x(),F1=d(),CU="tag:yaml.org,2002:";function jU($,Z,Q){if(Z){let z=Q.filter((U)=>U.tag===Z),X=z.find((U)=>!U.format)??z[0];if(!X)throw Error(`Tag ${Z} not found`);return X}return Q.find((z)=>z.identify?.($)&&!z.format)}function wU($,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:U,schema:J,sourceObjects:H}=Q,V=void 0;if(z&&$&&typeof $==="object")if(V=H.get($),V)return V.anchor??(V.anchor=X($)),new AU.Alias(V.anchor);else V={anchor:null,node:null},H.set($,V);if(Z?.startsWith("!!"))Z=CU+Z.slice(2);let Y=jU($,Z,J.tags);if(!Y){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new F1.Scalar($);if(V)V.node=W;return W}Y=$ instanceof Map?J[q2.MAP]:(Symbol.iterator in Object($))?J[q2.SEQ]:J[q2.MAP]}if(U)U(Y),delete Q.onTagObj;let G=Y?.createNode?Y.createNode(Q.schema,$,Q):typeof Y?.nodeClass?.from==="function"?Y.nodeClass.from(Q.schema,$,Q):new F1.Scalar($);if(Z)G.tag=Z;else if(!Y.default)G.tag=Y.tag;if(V)V.node=G;return G}SU.createNode=wU});var x6=_((xU)=>{var bU=E$(),w0=x(),yU=b6();function P4($,Z,Q){let z=Q;for(let X=Z.length-1;X>=0;--X){let U=Z[X];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let J=[];J[U]=z,z=J}else z=new Map([[U,z]])}return bU.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var R1=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class N1 extends yU.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)=>w0.isNode(Q)||w0.isPair(Q)?Q.clone($):Q),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(R1($))this.add(Z);else{let[Q,...z]=$,X=this.get(Q,!0);if(w0.isCollection(X))X.addIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,P4(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(w0.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&&w0.isScalar(X)?X.value:X;else return w0.isCollection(X)?X.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!w0.isPair(Z))return!1;let Q=Z.value;return Q==null||$&&w0.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 w0.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(w0.isCollection(X))X.setIn(z,Z);else if(X===void 0&&this.schema)this.set(Q,P4(this.schema,z,Z));else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${z}`)}}}xU.Collection=N1;xU.collectionFromPath=P4;xU.isEmptyPath=R1});var b$=_((mU)=>{var hU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function F4($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var uU=($,Z,Q)=>$.endsWith(`
|
|
3
|
+
`)?F4(Q,Z):Q.includes(`
|
|
4
4
|
`)?`
|
|
5
|
-
`+
|
|
6
|
-
`){if(Q==="block")
|
|
7
|
-
`&&K!=="\t"){let
|
|
8
|
-
`&&
|
|
9
|
-
${Z}${$.slice(0,N)}`;else{if(Q==="quoted"&&
|
|
10
|
-
${Z}${$.slice(
|
|
11
|
-
`);z=Z,X=Z+1,
|
|
12
|
-
`){if(
|
|
5
|
+
`+F4(Q,Z):($.endsWith(" ")?"":" ")+Q;mU.indentComment=F4;mU.lineComment=uU;mU.stringifyComment=hU});var A1=_((dU)=>{function cU($,Z,Q="flow",{indentAtStart:z,lineWidth:X=80,minContentWidth:U=20,onFold:J,onOverflow:H}={}){if(!X||X<0)return $;if(X<U)U=0;let V=Math.max(1+U,1+X-Z.length);if($.length<=V)return $;let Y=[],G={},W=X-Z.length;if(typeof z==="number")if(z>X-Math.max(2,U))Y.push(0);else W=X-z;let q=void 0,K=void 0,D=!1,B=-1,L=-1,I=-1;if(Q==="block"){if(B=T1($,B,Z.length),B!==-1)W=B+V}for(let A;A=$[B+=1];){if(Q==="quoted"&&A==="\\"){switch(L=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}I=B}if(A===`
|
|
6
|
+
`){if(Q==="block")B=T1($,B,Z.length);W=B+Z.length+V,q=void 0}else{if(A===" "&&K&&K!==" "&&K!==`
|
|
7
|
+
`&&K!=="\t"){let R=$[B+1];if(R&&R!==" "&&R!==`
|
|
8
|
+
`&&R!=="\t")q=B}if(B>=W)if(q)Y.push(q),W=q+V,q=void 0;else if(Q==="quoted"){while(K===" "||K==="\t")K=A,A=$[B+=1],D=!0;let R=B>I+1?B-2:L-1;if(G[R])return $;Y.push(R),G[R]=!0,W=R+V,q=void 0}else D=!0}K=A}if(D&&H)H();if(Y.length===0)return $;if(J)J();let O=$.slice(0,Y[0]);for(let A=0;A<Y.length;++A){let R=Y[A],N=Y[A+1]||$.length;if(R===0)O=`
|
|
9
|
+
${Z}${$.slice(0,N)}`;else{if(Q==="quoted"&&G[R])O+=`${$[R]}\\`;O+=`
|
|
10
|
+
${Z}${$.slice(R+1,N)}`}}return O}function T1($,Z,Q){let z=Z,X=Z+1,U=$[X];while(U===" "||U==="\t")if(Z<X+Q)U=$[++Z];else{do U=$[++Z];while(U&&U!==`
|
|
11
|
+
`);z=Z,X=Z+1,U=$[X]}return z}dU.FOLD_BLOCK="block";dU.FOLD_FLOW="flow";dU.FOLD_QUOTED="quoted";dU.foldFlowLines=cU});var x$=_((eU)=>{var D0=d(),n0=A1(),v6=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),k6=($)=>/^(%|---|\.\.\.)/m.test($);function oU($,Z,Q){if(!Z||Z<0)return!1;let z=Z-Q,X=$.length;if(X<=z)return!1;for(let U=0,J=0;U<X;++U)if($[U]===`
|
|
12
|
+
`){if(U-J>z)return!0;if(J=U+1,X-J<=z)return!1}return!0}function y$($,Z){let Q=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return Q;let{implicitKey:z}=Z,X=Z.options.doubleQuotedMinMultiLineLength,U=Z.indent||(k6($)?" ":""),J="",H=0;for(let V=0,Y=Q[V];Y;Y=Q[++V]){if(Y===" "&&Q[V+1]==="\\"&&Q[V+2]==="n")J+=Q.slice(H,V)+"\\ ",V+=1,H=V,Y="\\";if(Y==="\\")switch(Q[V+1]){case"u":{J+=Q.slice(H,V);let G=Q.substr(V+2,4);switch(G){case"0000":J+="\\0";break;case"0007":J+="\\a";break;case"000b":J+="\\v";break;case"001b":J+="\\e";break;case"0085":J+="\\N";break;case"00a0":J+="\\_";break;case"2028":J+="\\L";break;case"2029":J+="\\P";break;default:if(G.substr(0,2)==="00")J+="\\x"+G.substr(2);else J+=Q.substr(V,6)}V+=5,H=V+1}break;case"n":if(z||Q[V+2]==='"'||Q.length<X)V+=1;else{J+=Q.slice(H,V)+`
|
|
13
13
|
|
|
14
|
-
`;while(Q[
|
|
15
|
-
`,
|
|
16
|
-
`)||/[ \t]\n|\n[ \t]/.test($))return
|
|
17
|
-
${Q}`)+"'";return Z.implicitKey?z:
|
|
14
|
+
`;while(Q[V+2]==="\\"&&Q[V+3]==="n"&&Q[V+4]!=='"')J+=`
|
|
15
|
+
`,V+=2;if(J+=U,Q[V+2]===" ")J+="\\";V+=1,H=V+1}break;default:V+=1}}return J=H?J+Q.slice(H):Q,z?J:n0.foldFlowLines(J,U,n0.FOLD_QUOTED,v6(Z,!1))}function R4($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test($))return y$($,Z);let Q=Z.indent||(k6($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${Q}`)+"'";return Z.implicitKey?z:n0.foldFlowLines(z,Q,n0.FOLD_FLOW,v6(Z,!1))}function d2($,Z){let{singleQuote:Q}=Z.options,z;if(Q===!1)z=y$;else{let X=$.includes('"'),U=$.includes("'");if(X&&!U)z=R4;else if(U&&!X)z=y$;else z=Q?R4:y$}return z($,Z)}var N4;try{N4=new RegExp(`(^|(?<!
|
|
18
18
|
))
|
|
19
19
|
+(?!
|
|
20
|
-
|$)`,"g")}catch{
|
|
20
|
+
|$)`,"g")}catch{N4=/\n+(?!\n|$)/g}function g6({comment:$,type:Z,value:Q},z,X,U){let{blockQuote:J,commentString:H,lineWidth:V}=z.options;if(!J||/\n[\t ]+$/.test(Q))return d2(Q,z);let Y=z.indent||(z.forceBlockIndent||k6(Q)?" ":""),G=J==="literal"?!0:J==="folded"||Z===D0.Scalar.BLOCK_FOLDED?!1:Z===D0.Scalar.BLOCK_LITERAL?!0:!oU(Q,V,Y.length);if(!Q)return G?`|
|
|
21
21
|
`:`>
|
|
22
|
-
`;let W,
|
|
23
|
-
`&&N!=="\t"&&N!==" ")break}let K=Q.substring(
|
|
24
|
-
`);if(
|
|
25
|
-
`)K=K.slice(0,-1);K=K.replace(
|
|
26
|
-
`)
|
|
27
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
`)||
|
|
31
|
-
`)?
|
|
32
|
-
`))return
|
|
33
|
-
${
|
|
34
|
-
${Z.indent}${
|
|
35
|
-
${
|
|
36
|
-
`:"",
|
|
37
|
-
${
|
|
38
|
-
`&&
|
|
22
|
+
`;let W,q;for(q=Q.length;q>0;--q){let N=Q[q-1];if(N!==`
|
|
23
|
+
`&&N!=="\t"&&N!==" ")break}let K=Q.substring(q),D=K.indexOf(`
|
|
24
|
+
`);if(D===-1)W="-";else if(Q===K||D!==K.length-1){if(W="+",U)U()}else W="";if(K){if(Q=Q.slice(0,-K.length),K[K.length-1]===`
|
|
25
|
+
`)K=K.slice(0,-1);K=K.replace(N4,`$&${Y}`)}let B=!1,L,I=-1;for(L=0;L<Q.length;++L){let N=Q[L];if(N===" ")B=!0;else if(N===`
|
|
26
|
+
`)I=L;else break}let O=Q.substring(0,I<L?I+1:L);if(O)Q=Q.substring(O.length),O=O.replace(/\n+/g,`$&${Y}`);let R=(B?Y?"2":"1":"")+W;if($){if(R+=" "+H($.replace(/ ?[\r\n]+/g," ")),X)X()}if(!G){let N=Q.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${Y}`),T=!1,S=v6(z,!0);if(J!=="folded"&&Z!==D0.Scalar.BLOCK_FOLDED)S.onOverflow=()=>{T=!0};let P=n0.foldFlowLines(`${O}${N}${K}`,Y,n0.FOLD_BLOCK,S);if(!T)return`>${R}
|
|
28
|
+
${Y}${P}`}return Q=Q.replace(/\n+/g,`$&${Y}`),`|${R}
|
|
29
|
+
${Y}${O}${Q}${K}`}function aU($,Z,Q,z){let{type:X,value:U}=$,{actualString:J,implicitKey:H,indent:V,indentStep:Y,inFlow:G}=Z;if(H&&U.includes(`
|
|
30
|
+
`)||G&&/[[\]{},]/.test(U))return d2(U,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return H||G||!U.includes(`
|
|
31
|
+
`)?d2(U,Z):g6($,Z,Q,z);if(!H&&!G&&X!==D0.Scalar.PLAIN&&U.includes(`
|
|
32
|
+
`))return g6($,Z,Q,z);if(k6(U)){if(V==="")return Z.forceBlockIndent=!0,g6($,Z,Q,z);else if(H&&V===Y)return d2(U,Z)}let W=U.replace(/\n+/g,`$&
|
|
33
|
+
${V}`);if(J){let q=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(W),{compat:K,tags:D}=Z.doc.schema;if(D.some(q)||K?.some(q))return d2(U,Z)}return H?W:n0.foldFlowLines(W,V,n0.FOLD_FLOW,v6(Z,!1))}function tU($,Z,Q,z){let{implicitKey:X,inFlow:U}=Z,J=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:H}=$;if(H!==D0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(J.value))H=D0.Scalar.QUOTE_DOUBLE}let V=(G)=>{switch(G){case D0.Scalar.BLOCK_FOLDED:case D0.Scalar.BLOCK_LITERAL:return X||U?d2(J.value,Z):g6(J,Z,Q,z);case D0.Scalar.QUOTE_DOUBLE:return y$(J.value,Z);case D0.Scalar.QUOTE_SINGLE:return R4(J.value,Z);case D0.Scalar.PLAIN:return aU(J,Z,Q,z);default:return null}},Y=V(H);if(Y===null){let{defaultKeyType:G,defaultStringType:W}=Z.options,q=X&&G||W;if(Y=V(q),Y===null)throw Error(`Unsupported default string type ${q}`)}return Y}eU.stringifyString=tU});var g$=_((VJ)=>{var ZJ=E6(),r0=x(),QJ=b$(),zJ=x$();function XJ($,Z){let Q=Object.assign({blockQuote:!0,commentString:QJ.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 UJ($,Z){if(Z.tag){let X=$.filter((U)=>U.tag===Z.tag);if(X.length>0)return X.find((U)=>U.format===Z.format)??X[0]}let Q=void 0,z;if(r0.isScalar(Z)){z=Z.value;let X=$.filter((U)=>U.identify?.(z));if(X.length>1){let U=X.filter((J)=>J.test);if(U.length>0)X=U}Q=X.find((U)=>U.format===Z.format)??X.find((U)=>!U.format)}else z=Z,Q=$.find((X)=>X.nodeClass&&z instanceof X.nodeClass);if(!Q){let X=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${X} value`)}return Q}function JJ($,Z,{anchors:Q,doc:z}){if(!z.directives)return"";let X=[],U=(r0.isScalar($)||r0.isCollection($))&&$.anchor;if(U&&ZJ.anchorIsValid(U))Q.add(U),X.push(`&${U}`);let J=$.tag??(Z.default?null:Z.tag);if(J)X.push(z.directives.tagString(J));return X.join(" ")}function HJ($,Z,Q,z){if(r0.isPair($))return $.toString(Z,Q,z);if(r0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let X=void 0,U=r0.isNode($)?$:Z.doc.createNode($,{onTagObj:(V)=>X=V});X??(X=UJ(Z.doc.schema.tags,U));let J=JJ(U,X,Z);if(J.length>0)Z.indentAtStart=(Z.indentAtStart??0)+J.length+1;let H=typeof X.stringify==="function"?X.stringify(U,Z,Q,z):r0.isScalar(U)?zJ.stringifyString(U,Z,Q,z):U.toString(Z,Q,z);if(!J)return H;return r0.isScalar(U)||H[0]==="{"||H[0]==="["?`${J} ${H}`:`${J}
|
|
34
|
+
${Z.indent}${H}`}VJ.createStringifyContext=XJ;VJ.stringify=HJ});var w1=_((qJ)=>{var f0=x(),C1=d(),j1=g$(),v$=b$();function WJ({key:$,value:Z},Q,z,X){let{allNullValues:U,doc:J,indent:H,indentStep:V,options:{commentString:Y,indentSeq:G,simpleKeys:W}}=Q,q=f0.isNode($)&&$.comment||null;if(W){if(q)throw Error("With simple keys, key nodes cannot have comments");if(f0.isCollection($)||!f0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let K=!W&&(!$||q&&Z==null&&!Q.inFlow||f0.isCollection($)||(f0.isScalar($)?$.type===C1.Scalar.BLOCK_FOLDED||$.type===C1.Scalar.BLOCK_LITERAL:typeof $==="object"));Q=Object.assign({},Q,{allNullValues:!1,implicitKey:!K&&(W||!U),indent:H+V});let D=!1,B=!1,L=j1.stringify($,Q,()=>D=!0,()=>B=!0);if(!K&&!Q.inFlow&&L.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");K=!0}if(Q.inFlow){if(U||Z==null){if(D&&z)z();return L===""?"?":K?`? ${L}`:L}}else if(U&&!W||Z==null&&K){if(L=`? ${L}`,q&&!D)L+=v$.lineComment(L,Q.indent,Y(q));else if(B&&X)X();return L}if(D)q=null;if(K){if(q)L+=v$.lineComment(L,Q.indent,Y(q));L=`? ${L}
|
|
35
|
+
${H}:`}else if(L=`${L}:`,q)L+=v$.lineComment(L,Q.indent,Y(q));let I,O,A;if(f0.isNode(Z))I=!!Z.spaceBefore,O=Z.commentBefore,A=Z.comment;else if(I=!1,O=null,A=null,Z&&typeof Z==="object")Z=J.createNode(Z);if(Q.implicitKey=!1,!K&&!q&&f0.isScalar(Z))Q.indentAtStart=L.length+1;if(B=!1,!G&&V.length>=2&&!Q.inFlow&&!K&&f0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)Q.indent=Q.indent.substring(2);let R=!1,N=j1.stringify(Z,Q,()=>R=!0,()=>B=!0),T=" ";if(q||I||O){if(T=I?`
|
|
36
|
+
`:"",O){let S=Y(O);T+=`
|
|
37
|
+
${v$.indentComment(S,Q.indent)}`}if(N===""&&!Q.inFlow){if(T===`
|
|
38
|
+
`&&A)T=`
|
|
39
39
|
|
|
40
40
|
`}else T+=`
|
|
41
|
-
${Q.indent}`}else if(!K&&
|
|
42
|
-
`),
|
|
41
|
+
${Q.indent}`}else if(!K&&f0.isCollection(Z)){let S=N[0],P=N.indexOf(`
|
|
42
|
+
`),b=P!==-1,$0=Q.inFlow??Z.flow??Z.items.length===0;if(b||!$0){let a=!1;if(b&&(S==="&"||S==="!")){let g=N.indexOf(" ");if(S==="&"&&g!==-1&&g<P&&N[g+1]==="!")g=N.indexOf(" ",g+1);if(g===-1||P<g)a=!0}if(!a)T=`
|
|
43
43
|
${Q.indent}`}}else if(N===""||N[0]===`
|
|
44
|
-
`)T="";if(
|
|
45
|
-
${
|
|
44
|
+
`)T="";if(L+=T+N,Q.inFlow){if(R&&z)z()}else if(A&&!R)L+=v$.lineComment(L,Q.indent,Y(A));else if(B&&X)X();return L}qJ.stringifyPair=WJ});var T4=_((LJ)=>{var S1=F$("process");function KJ($,...Z){if($==="debug")console.log(...Z)}function DJ($,Z){if($==="debug"||$==="warn")if(typeof S1.emitWarning==="function")S1.emitWarning(Z);else console.warn(Z)}LJ.debug=KJ;LJ.warn=DJ});var f6=_((_J)=>{var m6=x(),E1=d(),h6="<<",u6={identify:($)=>$===h6||typeof $==="symbol"&&$.description===h6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new E1.Scalar(Symbol(h6)),{addToJSMap:b1}),stringify:()=>h6},OJ=($,Z)=>(u6.identify(Z)||m6.isScalar(Z)&&(!Z.type||Z.type===E1.Scalar.PLAIN)&&u6.identify(Z.value))&&$?.doc.schema.tags.some((Q)=>Q.tag===u6.tag&&Q.default);function b1($,Z,Q){let z=y1($,Q);if(m6.isSeq(z))for(let X of z.items)A4($,Z,X);else if(Array.isArray(z))for(let X of z)A4($,Z,X);else A4($,Z,z)}function A4($,Z,Q){let z=y1($,Q);if(!m6.isMap(z))throw Error("Merge sources must be maps or map aliases");let X=z.toJSON(null,$,Map);for(let[U,J]of X)if(Z instanceof Map){if(!Z.has(U))Z.set(U,J)}else if(Z instanceof Set)Z.add(U);else if(!Object.prototype.hasOwnProperty.call(Z,U))Object.defineProperty(Z,U,{value:J,writable:!0,enumerable:!0,configurable:!0});return Z}function y1($,Z){return $&&m6.isAlias(Z)?Z.resolve($.doc,$):Z}_J.addMergeToJSMap=b1;_J.isMergeKey=OJ;_J.merge=u6});var j4=_((jJ)=>{var NJ=T4(),x1=f6(),TJ=g$(),g1=x(),C4=i0();function AJ($,Z,{key:Q,value:z}){if(g1.isNode(Q)&&Q.addToJSMap)Q.addToJSMap($,Z,z);else if(x1.isMergeKey($,Q))x1.addMergeToJSMap($,Z,z);else{let X=C4.toJS(Q,"",$);if(Z instanceof Map)Z.set(X,C4.toJS(z,X,$));else if(Z instanceof Set)Z.add(X);else{let U=CJ(Q,X,$),J=C4.toJS(z,U,$);if(U in Z)Object.defineProperty(Z,U,{value:J,writable:!0,enumerable:!0,configurable:!0});else Z[U]=J}}return Z}function CJ($,Z,Q){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(g1.isNode($)&&Q?.doc){let z=TJ.createStringifyContext(Q.doc,{});z.anchors=new Set;for(let U of Q.anchors.keys())z.anchors.add(U.anchor);z.inFlow=!0,z.inStringifyKey=!0;let X=$.toString(z);if(!Q.mapKeyWarned){let U=JSON.stringify(X);if(U.length>40)U=U.substring(0,36)+'..."';NJ.warn(Q.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),Q.mapKeyWarned=!0}return X}return JSON.stringify(Z)}jJ.addPairToJSMap=AJ});var s0=_((yJ)=>{var v1=E$(),SJ=w1(),EJ=j4(),p6=x();function bJ($,Z,Q){let z=v1.createNode($,void 0,Q),X=v1.createNode(Z,void 0,Q);return new l6(z,X)}class l6{constructor($,Z=null){Object.defineProperty(this,p6.NODE_TYPE,{value:p6.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:Q}=this;if(p6.isNode(Z))Z=Z.clone($);if(p6.isNode(Q))Q=Q.clone($);return new l6(Z,Q)}toJSON($,Z){let Q=Z?.mapAsMap?new Map:{};return EJ.addPairToJSMap(Z,Q,this)}toString($,Z,Q){return $?.doc?SJ.stringifyPair(this,$,Z,Q):JSON.stringify(this)}}yJ.Pair=l6;yJ.createPair=bJ});var w4=_((uJ)=>{var B2=x(),k1=g$(),c6=b$();function vJ($,Z,Q){return(Z.inFlow??$.flow?hJ:kJ)($,Z,Q)}function kJ({comment:$,items:Z},Q,{blockItemPrefix:z,flowChars:X,itemIndent:U,onChompKeep:J,onComment:H}){let{indent:V,options:{commentString:Y}}=Q,G=Object.assign({},Q,{indent:U,type:null}),W=!1,q=[];for(let D=0;D<Z.length;++D){let B=Z[D],L=null;if(B2.isNode(B)){if(!W&&B.spaceBefore)q.push("");if(d6(Q,q,B.commentBefore,W),B.comment)L=B.comment}else if(B2.isPair(B)){let O=B2.isNode(B.key)?B.key:null;if(O){if(!W&&O.spaceBefore)q.push("");d6(Q,q,O.commentBefore,W)}}W=!1;let I=k1.stringify(B,G,()=>L=null,()=>W=!0);if(L)I+=c6.lineComment(I,U,Y(L));if(W&&L)W=!1;q.push(z+I)}let K;if(q.length===0)K=X.start+X.end;else{K=q[0];for(let D=1;D<q.length;++D){let B=q[D];K+=B?`
|
|
45
|
+
${V}${B}`:`
|
|
46
46
|
`}}if($){if(K+=`
|
|
47
|
-
`+
|
|
48
|
-
`)),
|
|
49
|
-
${
|
|
50
|
-
`;return`${
|
|
51
|
-
${X}${K}`}else return`${
|
|
52
|
-
`:" ")}return
|
|
53
|
-
${X.key.commentBefore}`:z.commentBefore;if(z.comment){let
|
|
54
|
-
${H.comment}`:z.comment}z=X}$.items[Q]=d6.isPair(z)?z:new S5.Pair(z)}else Z("Expected a sequence for this tag");return $}function h4($,Z,Q){let{replacer:z}=Q,X=new EJ.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let H=0;if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,String(H++),U);let J,G;if(Array.isArray(U))if(U.length===2)J=U[0],G=U[1];else throw TypeError(`Expected [key, value] tuple: ${U}`);else if(U&&U instanceof Object){let V=Object.keys(U);if(V.length===1)J=V[0],G=U[J];else throw TypeError(`Expected tuple with one key, not ${V.length} keys`)}else J=U;X.items.push(S5.createPair(J,G,Q))}return X}var bJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:k4,createNode:h4};yJ.createPairs=h4;yJ.pairs=bJ;yJ.resolvePairs=k4});var b5=_((uJ)=>{var u4=g(),E5=c0(),E$=s0(),kJ=o0(),f4=i6();class Y2 extends kJ.YAMLSeq{constructor(){super();this.add=E$.YAMLMap.prototype.add.bind(this),this.delete=E$.YAMLMap.prototype.delete.bind(this),this.get=E$.YAMLMap.prototype.get.bind(this),this.has=E$.YAMLMap.prototype.has.bind(this),this.set=E$.YAMLMap.prototype.set.bind(this),this.tag=Y2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,H;if(u4.isPair(z))X=E5.toJS(z.key,"",Z),H=E5.toJS(z.value,X,Z);else X=E5.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,H)}return Q}static from($,Z,Q){let z=f4.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}Y2.tag="tag:yaml.org,2002:omap";var hJ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:Y2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=f4.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(u4.isScalar(X))if(z.includes(X.value))Z(`Ordered maps must not include duplicate keys: ${X.value}`);else z.push(X.value);return Object.assign(new Y2,Q)},createNode:($,Z,Q)=>Y2.from($,Z,Q)};uJ.YAMLOMap=Y2;uJ.omap=hJ});var d4=_((pJ)=>{var m4=d();function p4({value:$,source:Z},Q){if(Z&&($?l4:c4).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var l4={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new m4.Scalar(!0),stringify:p4},c4={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new m4.Scalar(!1),stringify:p4};pJ.falseTag=c4;pJ.trueTag=l4});var i4=_((sJ)=>{var dJ=d(),y5=l2(),iJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:y5.stringifyNumber},nJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():y5.stringifyNumber($)}},rJ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new dJ.Scalar(parseFloat($.replace(/_/g,""))),Q=$.indexOf(".");if(Q!==-1){let z=$.substring(Q+1).replace(/_/g,"");if(z[z.length-1]==="0")Z.minFractionDigits=z.length}return Z},stringify:y5.stringifyNumber};sJ.float=rJ;sJ.floatExp=nJ;sJ.floatNaN=iJ});var r4=_((zG)=>{var n4=l2(),b$=($)=>typeof $==="bigint"||Number.isInteger($);function n6($,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 x5($,Z,Q){let{value:z}=$;if(b$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return n4.stringifyNumber($)}var eJ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>n6($,2,2,Q),stringify:($)=>x5($,2,"0b")},$G={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>n6($,1,8,Q),stringify:($)=>x5($,8,"0")},ZG={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>n6($,0,10,Q),stringify:n4.stringifyNumber},QG={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>n6($,2,16,Q),stringify:($)=>x5($,16,"0x")};zG.int=ZG;zG.intBin=eJ;zG.intHex=QG;zG.intOct=$G});var g5=_((VG)=>{var o6=g(),r6=n0(),s6=s0();class W2 extends s6.YAMLMap{constructor($){super($);this.tag=W2.tag}add($){let Z;if(o6.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new r6.Pair($.key,null);else Z=new r6.Pair($,null);if(!s6.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=s6.findPair(this.items,$);return!Z&&o6.isPair(Q)?o6.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=s6.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new r6.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(r6.createPair(H,null,Q))}return X}}W2.tag="tag:yaml.org,2002:set";var GG={collection:"map",identify:($)=>$ instanceof Set,nodeClass:W2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>W2.from($,Z,Q),resolve($,Z){if(o6.isMap($))if($.hasAllNullValues(!0))return Object.assign(new W2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};VG.YAMLSet=W2;VG.set=GG});var k5=_((DG)=>{var BG=l2();function v5($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(U)=>Z?BigInt(U):Number(U),H=z.replace(/_/g,"").split(":").reduce((U,J)=>U*X(60)+X(J),X(0));return Q==="-"?X(-1)*H:H}function s4($){let{value:Z}=$,Q=(U)=>U;if(typeof Z==="bigint")Q=(U)=>BigInt(U);else if(isNaN(Z)||!isFinite(Z))return BG.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),H=[Z%X];if(Z<60)H.unshift(0);else if(Z=(Z-H[0])/X,H.unshift(Z%X),Z>=60)Z=(Z-H[0])/X,H.unshift(Z);return z+H.map((U)=>String(U).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var qG={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,Z,{intAsBigInt:Q})=>v5($,Q),stringify:s4},KG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>v5($,!1),stringify:s4},o4={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let Z=$.match(o4.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,H,U,J]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,V=Date.UTC(Q,z-1,X,H||0,U||0,J||0,G),Y=Z[8];if(Y&&Y!=="Z"){let W=v5(Y,!1);if(Math.abs(W)<30)W*=60;V-=60000*W}return new Date(V)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};DG.floatTime=KG;DG.intTime=qG;DG.timestamp=o4});var t4=_((wG)=>{var MG=m2(),_G=p6(),PG=p2(),FG=w$(),RG=w5(),a4=d4(),h5=i4(),a6=r4(),NG=x6(),TG=b5(),AG=i6(),CG=g5(),u5=k5(),jG=[MG.map,PG.seq,FG.string,_G.nullTag,a4.trueTag,a4.falseTag,a6.intBin,a6.intOct,a6.int,a6.intHex,h5.floatNaN,h5.floatExp,h5.float,RG.binary,NG.merge,TG.omap,AG.pairs,CG.set,u5.intTime,u5.floatTime,u5.timestamp];wG.schema=jG});var G7=_((hG)=>{var Q7=m2(),EG=p6(),z7=p2(),bG=w$(),yG=P5(),f5=R5(),m5=T5(),xG=x4(),gG=v4(),X7=w5(),y$=x6(),H7=b5(),U7=i6(),e4=t4(),J7=g5(),t6=k5(),$7=new Map([["core",xG.schema],["failsafe",[Q7.map,z7.seq,bG.string]],["json",gG.schema],["yaml11",e4.schema],["yaml-1.1",e4.schema]]),Z7={binary:X7.binary,bool:yG.boolTag,float:f5.float,floatExp:f5.floatExp,floatNaN:f5.floatNaN,floatTime:t6.floatTime,int:m5.int,intHex:m5.intHex,intOct:m5.intOct,intTime:t6.intTime,map:Q7.map,merge:y$.merge,null:EG.nullTag,omap:H7.omap,pairs:U7.pairs,seq:z7.seq,set:J7.set,timestamp:t6.timestamp},vG={"tag:yaml.org,2002:binary":X7.binary,"tag:yaml.org,2002:merge":y$.merge,"tag:yaml.org,2002:omap":H7.omap,"tag:yaml.org,2002:pairs":U7.pairs,"tag:yaml.org,2002:set":J7.set,"tag:yaml.org,2002:timestamp":t6.timestamp};function kG($,Z,Q){let z=$7.get(Z);if(z&&!$)return Q&&!z.includes(y$.merge)?z.concat(y$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let H=Array.from($7.keys()).filter((U)=>U!=="yaml11").map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${H} or define customTags array`)}if(Array.isArray($))for(let H of $)X=X.concat(H);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(y$.merge);return X.reduce((H,U)=>{let J=typeof U==="string"?Z7[U]:U;if(!J){let G=JSON.stringify(U),V=Object.keys(Z7).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${V}`)}if(!H.includes(J))H.push(J);return H},[])}hG.coreKnownTags=vG;hG.getTags=kG});var c5=_((dG)=>{var p5=g(),mG=m2(),pG=p2(),lG=w$(),e6=G7(),cG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class l5{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:H,toStringDefaults:U}){this.compat=Array.isArray($)?e6.getTags($,"compat"):$?e6.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?e6.coreKnownTags:{},this.tags=e6.getTags(Z,this.name,Q),this.toStringOptions=U??null,Object.defineProperty(this,p5.MAP,{value:mG.map}),Object.defineProperty(this,p5.SCALAR,{value:lG.string}),Object.defineProperty(this,p5.SEQ,{value:pG.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?cG:null}clone(){let $=Object.create(l5.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}dG.Schema=l5});var V7=_((sG)=>{var nG=g(),d5=A$(),x$=R$();function rG($,Z){let Q=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)Q.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)Q.push("---");let X=d5.createStringifyContext($,Z),{commentString:H}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let G=H($.commentBefore);Q.unshift(x$.indentComment(G,""))}let U=!1,J=null;if($.contents){if(nG.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let Y=H($.contents.commentBefore);Q.push(x$.indentComment(Y,""))}X.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>U=!0,V=d5.stringify($.contents,X,()=>J=null,G);if(J)V+=x$.lineComment(V,"",H(J));if((V[0]==="|"||V[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${V}`;else Q.push(V)}else Q.push(d5.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let G=H($.comment);if(G.includes(`
|
|
55
|
-
`))Q.push("..."),Q.push(
|
|
47
|
+
`+c6.indentComment(Y($),V),H)H()}else if(W&&J)J();return K}function hJ({items:$},Z,{flowChars:Q,itemIndent:z}){let{indent:X,indentStep:U,flowCollectionPadding:J,options:{commentString:H}}=Z;z+=U;let V=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),Y=!1,G=0,W=[];for(let D=0;D<$.length;++D){let B=$[D],L=null;if(B2.isNode(B)){if(B.spaceBefore)W.push("");if(d6(Z,W,B.commentBefore,!1),B.comment)L=B.comment}else if(B2.isPair(B)){let O=B2.isNode(B.key)?B.key:null;if(O){if(O.spaceBefore)W.push("");if(d6(Z,W,O.commentBefore,!1),O.comment)Y=!0}let A=B2.isNode(B.value)?B.value:null;if(A){if(A.comment)L=A.comment;if(A.commentBefore)Y=!0}else if(B.value==null&&O?.comment)L=O.comment}if(L)Y=!0;let I=k1.stringify(B,V,()=>L=null);if(Y||(Y=W.length>G||I.includes(`
|
|
48
|
+
`)),D<$.length-1)I+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)Y||(Y=W.reduce((O,A)=>O+A.length+2,2)+(I.length+2)>Z.options.lineWidth);if(Y)I+=","}if(L)I+=c6.lineComment(I,z,H(L));W.push(I),G=W.length}let{start:q,end:K}=Q;if(W.length===0)return q+K;else{if(!Y){let D=W.reduce((B,L)=>B+L.length+2,2);Y=Z.options.lineWidth>0&&D>Z.options.lineWidth}if(Y){let D=q;for(let B of W)D+=B?`
|
|
49
|
+
${U}${X}${B}`:`
|
|
50
|
+
`;return`${D}
|
|
51
|
+
${X}${K}`}else return`${q}${J}${W.join(" ")}${J}${K}`}}function d6({indent:$,options:{commentString:Z}},Q,z,X){if(z&&X)z=z.replace(/^\n+/,"");if(z){let U=c6.indentComment(Z(z),$);Q.push(U.trimStart())}}uJ.stringifyCollection=vJ});var a0=_((dJ)=>{var fJ=w4(),pJ=j4(),lJ=x6(),o0=x(),i6=s0(),cJ=d();function k$($,Z){let Q=o0.isScalar(Z)?Z.value:Z;for(let z of $)if(o0.isPair(z)){if(z.key===Z||z.key===Q)return z;if(o0.isScalar(z.key)&&z.key.value===Q)return z}return}class h1 extends lJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(o0.MAP,$);this.items=[]}static from($,Z,Q){let{keepUndefined:z,replacer:X}=Q,U=new this($),J=(H,V)=>{if(typeof X==="function")V=X.call(Z,H,V);else if(Array.isArray(X)&&!X.includes(H))return;if(V!==void 0||z)U.items.push(i6.createPair(H,V,Q))};if(Z instanceof Map)for(let[H,V]of Z)J(H,V);else if(Z&&typeof Z==="object")for(let H of Object.keys(Z))J(H,Z[H]);if(typeof $.sortMapEntries==="function")U.items.sort($.sortMapEntries);return U}add($,Z){let Q;if(o0.isPair($))Q=$;else if(!$||typeof $!=="object"||!("key"in $))Q=new i6.Pair($,$?.value);else Q=new i6.Pair($.key,$.value);let z=k$(this.items,Q.key),X=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${Q.key} already set`);if(o0.isScalar(z.value)&&cJ.isScalarValue(Q.value))z.value.value=Q.value;else z.value=Q.value}else if(X){let U=this.items.findIndex((J)=>X(Q,J)<0);if(U===-1)this.items.push(Q);else this.items.splice(U,0,Q)}else this.items.push(Q)}delete($){let Z=k$(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=k$(this.items,$)?.value;return(!Z&&o0.isScalar(z)?z.value:z)??void 0}has($){return!!k$(this.items,$)}set($,Z){this.add(new i6.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)pJ.addPairToJSMap(Z,z,X);return z}toString($,Z,Q){if(!$)return JSON.stringify(this);for(let z of this.items)if(!o0.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 fJ.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Q,onComment:Z})}}dJ.YAMLMap=h1;dJ.findPair=k$});var i2=_((oJ)=>{var rJ=x(),u1=a0(),sJ={collection:"map",default:!0,nodeClass:u1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!rJ.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,Q)=>u1.YAMLMap.from($,Z,Q)};oJ.map=sJ});var t0=_((zH)=>{var tJ=E$(),eJ=w4(),$H=x6(),r6=x(),ZH=d(),QH=i0();class m1 extends $H.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(r6.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=n6($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let Q=n6($);if(typeof Q!=="number")return;let z=this.items[Q];return!Z&&r6.isScalar(z)?z.value:z}has($){let Z=n6($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let Q=n6($);if(typeof Q!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Q];if(r6.isScalar(z)&&ZH.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(QH.toJS(X,String(z++),Z));return Q}toString($,Z,Q){if(!$)return JSON.stringify(this);return eJ.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Q,onComment:Z})}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z)){let U=0;for(let J of Z){if(typeof z==="function"){let H=Z instanceof Set?J:String(U++);J=z.call(Z,H,J)}X.items.push(tJ.createNode(J,void 0,Q))}}return X}}function n6($){let Z=r6.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}zH.YAMLSeq=m1});var n2=_((HH)=>{var UH=x(),f1=t0(),JH={collection:"seq",default:!0,nodeClass:f1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!UH.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,Q)=>f1.YAMLSeq.from($,Z,Q)};HH.seq=JH});var h$=_((WH)=>{var YH=x$(),GH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,Q,z){return Z=Object.assign({actualString:!0},Z),YH.stringifyString($,Z,Q,z)}};WH.string=GH});var s6=_((BH)=>{var p1=d(),l1={identify:($)=>$==null,createNode:()=>new p1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new p1.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&l1.test.test($)?$:Z.options.nullStr};BH.nullTag=l1});var S4=_((LH)=>{var DH=d(),c1={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new DH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},Q){if($&&c1.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?Q.options.trueStr:Q.options.falseStr}};LH.boolTag=c1});var r2=_((OH)=>{function IH({format:$,minFractionDigits:Z,tag:Q,value:z}){if(typeof z==="bigint")return String(z);let X=typeof z==="number"?z:Number(z);if(!isFinite(X))return isNaN(X)?".nan":X<0?"-.inf":".inf";let U=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!Q||Q==="tag:yaml.org,2002:float")&&/^-?\d/.test(U)&&!U.includes("e")){let J=U.indexOf(".");if(J<0)J=U.length,U+=".";let H=Z-(U.length-J-1);while(H-- >0)U+="0"}return U}OH.stringifyNumber=IH});var b4=_((TH)=>{var PH=d(),E4=r2(),FH={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:E4.stringifyNumber},RH={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():E4.stringifyNumber($)}},NH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new PH.Scalar(parseFloat($)),Q=$.indexOf(".");if(Q!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-Q-1;return Z},stringify:E4.stringifyNumber};TH.float=NH;TH.floatExp=RH;TH.floatNaN=FH});var x4=_((bH)=>{var d1=r2(),o6=($)=>typeof $==="bigint"||Number.isInteger($),y4=($,Z,Q,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),Q);function i1($,Z,Q){let{value:z}=$;if(o6(z)&&z>=0)return Q+z.toString(Z);return d1.stringifyNumber($)}var wH={identify:($)=>o6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,Q)=>y4($,2,8,Q),stringify:($)=>i1($,8,"0o")},SH={identify:o6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,Q)=>y4($,0,10,Q),stringify:d1.stringifyNumber},EH={identify:($)=>o6($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,Q)=>y4($,2,16,Q),stringify:($)=>i1($,16,"0x")};bH.int=SH;bH.intHex=EH;bH.intOct=wH});var n1=_((pH)=>{var vH=i2(),kH=s6(),hH=n2(),uH=h$(),mH=S4(),g4=b4(),v4=x4(),fH=[vH.map,hH.seq,uH.string,kH.nullTag,mH.boolTag,v4.intOct,v4.int,v4.intHex,g4.floatNaN,g4.floatExp,g4.float];pH.schema=fH});var s1=_((oH)=>{var cH=d(),dH=i2(),iH=n2();function r1($){return typeof $==="bigint"||Number.isInteger($)}var a6=({value:$})=>JSON.stringify($),nH=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:a6},{identify:($)=>$==null,createNode:()=>new cH.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:a6},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:a6},{identify:r1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:Q})=>Q?BigInt($):parseInt($,10),stringify:({value:$})=>r1($)?$.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:a6}],rH={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},sH=[dH.map,iH.seq].concat(nH,rH);oH.schema=sH});var h4=_(($V)=>{var u$=F$("buffer"),k4=d(),tH=x$(),eH={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof u$.Buffer==="function")return u$.Buffer.from($,"base64");else if(typeof atob==="function"){let Q=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Q.length);for(let X=0;X<Q.length;++X)z[X]=Q.charCodeAt(X);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:Q},z,X,U){if(!Q)return"";let J=Q,H;if(typeof u$.Buffer==="function")H=J instanceof u$.Buffer?J.toString("base64"):u$.Buffer.from(J.buffer).toString("base64");else if(typeof btoa==="function"){let V="";for(let Y=0;Y<J.length;++Y)V+=String.fromCharCode(J[Y]);H=btoa(V)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=k4.Scalar.BLOCK_LITERAL),Z!==k4.Scalar.QUOTE_DOUBLE){let V=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),Y=Math.ceil(H.length/V),G=Array(Y);for(let W=0,q=0;W<Y;++W,q+=V)G[W]=H.substr(q,V);H=G.join(Z===k4.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return tH.stringifyString({comment:$,type:Z,value:H},z,X,U)}};$V.binary=eH});var e6=_((UV)=>{var t6=x(),u4=s0(),QV=d(),zV=t0();function o1($,Z){if(t6.isSeq($))for(let Q=0;Q<$.items.length;++Q){let z=$.items[Q];if(t6.isPair(z))continue;else if(t6.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let X=z.items[0]||new u4.Pair(new QV.Scalar(null));if(z.commentBefore)X.key.commentBefore=X.key.commentBefore?`${z.commentBefore}
|
|
53
|
+
${X.key.commentBefore}`:z.commentBefore;if(z.comment){let U=X.value??X.key;U.comment=U.comment?`${z.comment}
|
|
54
|
+
${U.comment}`:z.comment}z=X}$.items[Q]=t6.isPair(z)?z:new u4.Pair(z)}else Z("Expected a sequence for this tag");return $}function a1($,Z,Q){let{replacer:z}=Q,X=new zV.YAMLSeq($);X.tag="tag:yaml.org,2002:pairs";let U=0;if(Z&&Symbol.iterator in Object(Z))for(let J of Z){if(typeof z==="function")J=z.call(Z,String(U++),J);let H,V;if(Array.isArray(J))if(J.length===2)H=J[0],V=J[1];else throw TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let Y=Object.keys(J);if(Y.length===1)H=Y[0],V=J[H];else throw TypeError(`Expected tuple with one key, not ${Y.length} keys`)}else H=J;X.items.push(u4.createPair(H,V,Q))}return X}var XV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o1,createNode:a1};UV.createPairs=a1;UV.pairs=XV;UV.resolvePairs=o1});var f4=_((WV)=>{var t1=x(),m4=i0(),m$=a0(),YV=t0(),e1=e6();class K2 extends YV.YAMLSeq{constructor(){super();this.add=m$.YAMLMap.prototype.add.bind(this),this.delete=m$.YAMLMap.prototype.delete.bind(this),this.get=m$.YAMLMap.prototype.get.bind(this),this.has=m$.YAMLMap.prototype.has.bind(this),this.set=m$.YAMLMap.prototype.set.bind(this),this.tag=K2.tag}toJSON($,Z){if(!Z)return super.toJSON($);let Q=new Map;if(Z?.onCreate)Z.onCreate(Q);for(let z of this.items){let X,U;if(t1.isPair(z))X=m4.toJS(z.key,"",Z),U=m4.toJS(z.value,X,Z);else X=m4.toJS(z,"",Z);if(Q.has(X))throw Error("Ordered maps must not include duplicate keys");Q.set(X,U)}return Q}static from($,Z,Q){let z=e1.createPairs($,Z,Q),X=new this;return X.items=z.items,X}}K2.tag="tag:yaml.org,2002:omap";var GV={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:K2,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let Q=e1.resolvePairs($,Z),z=[];for(let{key:X}of Q.items)if(t1.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 K2,Q)},createNode:($,Z,Q)=>K2.from($,Z,Q)};WV.YAMLOMap=K2;WV.omap=GV});var X7=_((KV)=>{var $7=d();function Z7({value:$,source:Z},Q){if(Z&&($?Q7:z7).test.test(Z))return Z;return $?Q.options.trueStr:Q.options.falseStr}var Q7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $7.Scalar(!0),stringify:Z7},z7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $7.Scalar(!1),stringify:Z7};KV.falseTag=z7;KV.trueTag=Q7});var U7=_((PV)=>{var MV=d(),p4=r2(),IV={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:p4.stringifyNumber},OV={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():p4.stringifyNumber($)}},_V={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new MV.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:p4.stringifyNumber};PV.float=_V;PV.floatExp=OV;PV.floatNaN=IV});var H7=_((wV)=>{var J7=r2(),f$=($)=>typeof $==="bigint"||Number.isInteger($);function $8($,Z,Q,{intAsBigInt:z}){let X=$[0];if(X==="-"||X==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(Q){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let J=BigInt($);return X==="-"?BigInt(-1)*J:J}let U=parseInt($,Q);return X==="-"?-1*U:U}function l4($,Z,Q){let{value:z}=$;if(f$(z)){let X=z.toString(Z);return z<0?"-"+Q+X.substr(1):Q+X}return J7.stringifyNumber($)}var TV={identify:f$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,Q)=>$8($,2,2,Q),stringify:($)=>l4($,2,"0b")},AV={identify:f$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,Q)=>$8($,1,8,Q),stringify:($)=>l4($,8,"0")},CV={identify:f$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,Q)=>$8($,0,10,Q),stringify:J7.stringifyNumber},jV={identify:f$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,Q)=>$8($,2,16,Q),stringify:($)=>l4($,16,"0x")};wV.int=CV;wV.intBin=TV;wV.intHex=jV;wV.intOct=AV});var c4=_((gV)=>{var z8=x(),Z8=s0(),Q8=a0();class D2 extends Q8.YAMLMap{constructor($){super($);this.tag=D2.tag}add($){let Z;if(z8.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new Z8.Pair($.key,null);else Z=new Z8.Pair($,null);if(!Q8.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let Q=Q8.findPair(this.items,$);return!Z&&z8.isPair(Q)?z8.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=Q8.findPair(this.items,$);if(Q&&!Z)this.items.splice(this.items.indexOf(Q),1);else if(!Q&&Z)this.items.push(new Z8.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,Q){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,Q);else throw Error("Set items must all have null values")}static from($,Z,Q){let{replacer:z}=Q,X=new this($);if(Z&&Symbol.iterator in Object(Z))for(let U of Z){if(typeof z==="function")U=z.call(Z,U,U);X.items.push(Z8.createPair(U,null,Q))}return X}}D2.tag="tag:yaml.org,2002:set";var xV={collection:"map",identify:($)=>$ instanceof Set,nodeClass:D2,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,Q)=>D2.from($,Z,Q),resolve($,Z){if(z8.isMap($))if($.hasAllNullValues(!0))return Object.assign(new D2,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};gV.YAMLSet=D2;gV.set=xV});var i4=_((fV)=>{var hV=r2();function d4($,Z){let Q=$[0],z=Q==="-"||Q==="+"?$.substring(1):$,X=(J)=>Z?BigInt(J):Number(J),U=z.replace(/_/g,"").split(":").reduce((J,H)=>J*X(60)+X(H),X(0));return Q==="-"?X(-1)*U:U}function V7($){let{value:Z}=$,Q=(J)=>J;if(typeof Z==="bigint")Q=(J)=>BigInt(J);else if(isNaN(Z)||!isFinite(Z))return hV.stringifyNumber($);let z="";if(Z<0)z="-",Z*=Q(-1);let X=Q(60),U=[Z%X];if(Z<60)U.unshift(0);else if(Z=(Z-U[0])/X,U.unshift(Z%X),Z>=60)Z=(Z-U[0])/X,U.unshift(Z);return z+U.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var uV={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})=>d4($,Q),stringify:V7},mV={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:($)=>d4($,!1),stringify:V7},Y7={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(Y7.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Q,z,X,U,J,H]=Z.map(Number),V=Z[7]?Number((Z[7]+"00").substr(1,3)):0,Y=Date.UTC(Q,z-1,X,U||0,J||0,H||0,V),G=Z[8];if(G&&G!=="Z"){let W=d4(G,!1);if(Math.abs(W)<30)W*=60;Y-=60000*W}return new Date(Y)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};fV.floatTime=mV;fV.intTime=uV;fV.timestamp=Y7});var W7=_((ZY)=>{var dV=i2(),iV=s6(),nV=n2(),rV=h$(),sV=h4(),G7=X7(),n4=U7(),X8=H7(),oV=f6(),aV=f4(),tV=e6(),eV=c4(),r4=i4(),$Y=[dV.map,nV.seq,rV.string,iV.nullTag,G7.trueTag,G7.falseTag,X8.intBin,X8.intOct,X8.int,X8.intHex,n4.floatNaN,n4.floatExp,n4.float,sV.binary,oV.merge,aV.omap,tV.pairs,eV.set,r4.intTime,r4.floatTime,r4.timestamp];ZY.schema=$Y});var P7=_((GY)=>{var D7=i2(),zY=s6(),L7=n2(),XY=h$(),UY=S4(),s4=b4(),o4=x4(),JY=n1(),HY=s1(),M7=h4(),p$=f6(),I7=f4(),O7=e6(),q7=W7(),_7=c4(),U8=i4(),B7=new Map([["core",JY.schema],["failsafe",[D7.map,L7.seq,XY.string]],["json",HY.schema],["yaml11",q7.schema],["yaml-1.1",q7.schema]]),K7={binary:M7.binary,bool:UY.boolTag,float:s4.float,floatExp:s4.floatExp,floatNaN:s4.floatNaN,floatTime:U8.floatTime,int:o4.int,intHex:o4.intHex,intOct:o4.intOct,intTime:U8.intTime,map:D7.map,merge:p$.merge,null:zY.nullTag,omap:I7.omap,pairs:O7.pairs,seq:L7.seq,set:_7.set,timestamp:U8.timestamp},VY={"tag:yaml.org,2002:binary":M7.binary,"tag:yaml.org,2002:merge":p$.merge,"tag:yaml.org,2002:omap":I7.omap,"tag:yaml.org,2002:pairs":O7.pairs,"tag:yaml.org,2002:set":_7.set,"tag:yaml.org,2002:timestamp":U8.timestamp};function YY($,Z,Q){let z=B7.get(Z);if(z&&!$)return Q&&!z.includes(p$.merge)?z.concat(p$.merge):z.slice();let X=z;if(!X)if(Array.isArray($))X=[];else{let U=Array.from(B7.keys()).filter((J)=>J!=="yaml11").map((J)=>JSON.stringify(J)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${U} or define customTags array`)}if(Array.isArray($))for(let U of $)X=X.concat(U);else if(typeof $==="function")X=$(X.slice());if(Q)X=X.concat(p$.merge);return X.reduce((U,J)=>{let H=typeof J==="string"?K7[J]:J;if(!H){let V=JSON.stringify(J),Y=Object.keys(K7).map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown custom tag ${V}; use one of ${Y}`)}if(!U.includes(H))U.push(H);return U},[])}GY.coreKnownTags=VY;GY.getTags=YY});var e4=_((MY)=>{var a4=x(),BY=i2(),KY=n2(),DY=h$(),J8=P7(),LY=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class t4{constructor({compat:$,customTags:Z,merge:Q,resolveKnownTags:z,schema:X,sortMapEntries:U,toStringDefaults:J}){this.compat=Array.isArray($)?J8.getTags($,"compat"):$?J8.getTags(null,$):null,this.name=typeof X==="string"&&X||"core",this.knownTags=z?J8.coreKnownTags:{},this.tags=J8.getTags(Z,this.name,Q),this.toStringOptions=J??null,Object.defineProperty(this,a4.MAP,{value:BY.map}),Object.defineProperty(this,a4.SCALAR,{value:DY.string}),Object.defineProperty(this,a4.SEQ,{value:KY.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?LY:null}clone(){let $=Object.create(t4.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}MY.Schema=t4});var F7=_((PY)=>{var OY=x(),$5=g$(),l$=b$();function _Y($,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=$5.createStringifyContext($,Z),{commentString:U}=X.options;if($.commentBefore){if(Q.length!==1)Q.unshift("");let V=U($.commentBefore);Q.unshift(l$.indentComment(V,""))}let J=!1,H=null;if($.contents){if(OY.isNode($.contents)){if($.contents.spaceBefore&&z)Q.push("");if($.contents.commentBefore){let G=U($.contents.commentBefore);Q.push(l$.indentComment(G,""))}X.forceBlockIndent=!!$.comment,H=$.contents.comment}let V=H?void 0:()=>J=!0,Y=$5.stringify($.contents,X,()=>H=null,V);if(H)Y+=l$.lineComment(Y,"",U(H));if((Y[0]==="|"||Y[0]===">")&&Q[Q.length-1]==="---")Q[Q.length-1]=`--- ${Y}`;else Q.push(Y)}else Q.push($5.stringify($.contents,X));if($.directives?.docEnd)if($.comment){let V=U($.comment);if(V.includes(`
|
|
55
|
+
`))Q.push("..."),Q.push(l$.indentComment(V,""));else Q.push(`... ${V}`)}else Q.push("...");else{let V=$.comment;if(V&&J)V=V.replace(/^\n+/,"");if(V){if((!J||H)&&Q[Q.length-1]!=="")Q.push("");Q.push(l$.indentComment(U(V),""))}}return Q.join(`
|
|
56
56
|
`)+`
|
|
57
|
-
`}
|
|
58
|
-
`;
|
|
57
|
+
`}PY.stringifyDocument=_Y});var c$=_((SY)=>{var RY=S$(),s2=x6(),Y0=x(),NY=s0(),TY=i0(),AY=e4(),CY=F7(),Z5=E6(),jY=_4(),wY=E$(),Q5=O4();class z5{constructor($,Z,Q){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y0.NODE_TYPE,{value:Y0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z,Z=void 0;let X=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Q);this.options=X;let{version:U}=X;if(Q?._directives){if(this.directives=Q._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new Q5.Directives({version:U});this.setSchema(U,Q),this.contents=$===void 0?null:this.createNode($,z,Q)}clone(){let $=Object.create(z5.prototype,{[Y0.NODE_TYPE]:{value:Y0.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=Y0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(o2(this.contents))this.contents.add($)}addIn($,Z){if(o2(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let Q=Z5.anchorNames(this);$.anchor=!Z||Q.has(Z)?Z5.findNewAnchor(Z||"a",Q):Z}return new RY.Alias($.anchor)}createNode($,Z,Q){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,L=Z.filter(B).map(String);if(L.length>0)Z=Z.concat(L);z=Z}else if(Q===void 0&&Z)Q=Z,Z=void 0;let{aliasDuplicateObjects:X,anchorPrefix:U,flow:J,keepUndefined:H,onTagObj:V,tag:Y}=Q??{},{onAnchor:G,setAnchors:W,sourceObjects:q}=Z5.createNodeAnchors(this,U||"a"),K={aliasDuplicateObjects:X??!0,keepUndefined:H??!1,onAnchor:G,onTagObj:V,replacer:z,schema:this.schema,sourceObjects:q},D=wY.createNode($,Y,K);if(J&&Y0.isCollection(D))D.flow=!0;return W(),D}createPair($,Z,Q={}){let z=this.createNode($,null,Q),X=this.createNode(Z,null,Q);return new NY.Pair(z,X)}delete($){return o2(this.contents)?this.contents.delete($):!1}deleteIn($){if(s2.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return o2(this.contents)?this.contents.deleteIn($):!1}get($,Z){return Y0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(s2.isEmptyPath($))return!Z&&Y0.isScalar(this.contents)?this.contents.value:this.contents;return Y0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return Y0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(s2.isEmptyPath($))return this.contents!==void 0;return Y0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=s2.collectionFromPath(this.schema,[$],Z);else if(o2(this.contents))this.contents.set($,Z)}setIn($,Z){if(s2.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=s2.collectionFromPath(this.schema,Array.from($),Z);else if(o2(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 Q5.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 Q5.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 AY.Schema(Object.assign(Q,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:Q,maxAliasCount:z,onAnchor:X,reviver:U}={}){let J={anchors:new Map,doc:this,keep:!$,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},H=TY.toJS(this.contents,Z??"",J);if(typeof X==="function")for(let{count:V,res:Y}of J.anchors.values())X(Y,V);return typeof U==="function"?jY.applyReviver(U,{"":H},"",H):H}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return CY.stringifyDocument(this,$)}}function o2($){if(Y0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}SY.Document=z5});var d$=_((yY)=>{class H8 extends Error{constructor($,Z,Q,z){super();this.name=$,this.code=Q,this.message=z,this.pos=Z}}class R7 extends H8{constructor($,Z,Q){super("YAMLParseError",$,Z,Q)}}class N7 extends H8{constructor($,Z,Q){super("YAMLWarning",$,Z,Q)}}var bY=($,Z)=>(Q)=>{if(Q.pos[0]===-1)return;Q.linePos=Q.pos.map((H)=>Z.linePos(H));let{line:z,col:X}=Q.linePos[0];Q.message+=` at line ${z}, column ${X}`;let U=X-1,J=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(U>=60&&J.length>80){let H=Math.min(U-39,J.length-79);J="…"+J.substring(H),U-=H-1}if(J.length>80)J=J.substring(0,79)+"…";if(z>1&&/^ *$/.test(J.substring(0,U))){let H=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(H.length>80)H=H.substring(0,79)+`…
|
|
58
|
+
`;J=H+J}if(/[^ ]/.test(J)){let H=1,V=Q.linePos[1];if(V?.line===z&&V.col>X)H=Math.max(1,Math.min(V.col-X,80-U));let Y=" ".repeat(U)+"^".repeat(H);Q.message+=`:
|
|
59
59
|
|
|
60
|
-
${
|
|
61
|
-
${
|
|
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(
|
|
64
|
-
`+
|
|
65
|
-
`+
|
|
66
|
-
`+T.comment;else
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`.repeat(Math.max(1,
|
|
71
|
-
`;for(let
|
|
72
|
-
`;else if(
|
|
73
|
-
`;else if(!K&&
|
|
74
|
-
`)
|
|
60
|
+
${J}
|
|
61
|
+
${Y}
|
|
62
|
+
`}};yY.YAMLError=H8;yY.YAMLParseError=R7;yY.YAMLWarning=N7;yY.prettifyError=bY});var i$=_((uY)=>{function hY($,{flow:Z,indicator:Q,next:z,offset:X,onError:U,parentIndent:J,startOnNewline:H}){let V=!1,Y=H,G=H,W="",q="",K=!1,D=!1,B=null,L=null,I=null,O=null,A=null,R=null,N=null;for(let P of $){if(D){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")U(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");D=!1}if(B){if(Y&&P.type!=="comment"&&P.type!=="newline")U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(P.type){case"space":if(!Z&&(Q!=="doc-start"||z?.type!=="flow-collection")&&P.source.includes("\t"))B=P;G=!0;break;case"comment":{if(!G)U(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let b=P.source.substring(1)||" ";if(!W)W=b;else W+=q+b;q="",Y=!1;break}case"newline":if(Y){if(W)W+=P.source;else if(!R||Q!=="seq-item-ind")V=!0}else q+=P.source;if(Y=!0,K=!0,L||I)O=P;G=!0;break;case"anchor":if(L)U(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))U(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=P,N??(N=P.offset),Y=!1,G=!1,D=!0;break;case"tag":{if(I)U(P,"MULTIPLE_TAGS","A node can have at most one tag");I=P,N??(N=P.offset),Y=!1,G=!1,D=!0;break}case Q:if(L||I)U(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(R)U(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${Z??"collection"}`);R=P,Y=Q==="seq-item-ind"||Q==="explicit-key-ind",G=!1;break;case"comma":if(Z){if(A)U(P,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);A=P,Y=!1,G=!1;break}default:U(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),Y=!1,G=!1}}let T=$[$.length-1],S=T?T.offset+T.source.length:X;if(D&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))U(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(Y&&B.indent<=J||z?.type==="block-map"||z?.type==="block-seq"))U(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:A,found:R,spaceBefore:V,comment:W,hasNewline:K,anchor:L,tag:I,newlineAfterProp:O,end:S,start:N??S}}uY.resolveProps=hY});var V8=_((fY)=>{function X5($){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(X5(Z.key)||X5(Z.value))return!0}return!1;default:return!0}}fY.containsNewline=X5});var U5=_((dY)=>{var lY=V8();function cY($,Z,Q){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&lY.containsNewline(Z))Q(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}dY.flowIndentCheck=cY});var J5=_((rY)=>{var T7=x();function nY($,Z,Q){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let X=typeof z==="function"?z:(U,J)=>U===J||T7.isScalar(U)&&T7.isScalar(J)&&U.value===J.value;return Z.some((U)=>X(U.key,Q))}rY.mapIncludes=nY});var S7=_(($G)=>{var A7=s0(),oY=a0(),C7=i$(),aY=V8(),j7=U5(),tY=J5(),w7="All mapping items must start at the same column";function eY({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=new(U?.nodeClass??oY.YAMLMap)(Q.schema);if(Q.atRoot)Q.atRoot=!1;let V=z.offset,Y=null;for(let G of z.items){let{start:W,key:q,sep:K,value:D}=G,B=C7.resolveProps(W,{indicator:"explicit-key-ind",next:q??K?.[0],offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0}),L=!B.found;if(L){if(q){if(q.type==="block-seq")X(V,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in q&&q.indent!==z.indent)X(V,"BAD_INDENT",w7)}if(!B.anchor&&!B.tag&&!K){if(Y=B.end,B.comment)if(H.comment)H.comment+=`
|
|
64
|
+
`+B.comment;else H.comment=B.comment;continue}if(B.newlineAfterProp||aY.containsNewline(q))X(q??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)X(V,"BAD_INDENT",w7);Q.atKey=!0;let I=B.end,O=q?$(Q,q,B,X):Z(Q,I,W,null,B,X);if(Q.schema.compat)j7.flowIndentCheck(z.indent,q,X);if(Q.atKey=!1,tY.mapIncludes(Q,H.items,O))X(I,"DUPLICATE_KEY","Map keys must be unique");let A=C7.resolveProps(K??[],{indicator:"map-value-ind",next:D,offset:O.range[2],onError:X,parentIndent:z.indent,startOnNewline:!q||q.type==="block-scalar"});if(V=A.end,A.found){if(L){if(D?.type==="block-map"&&!A.hasNewline)X(V,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Q.options.strict&&B.start<A.found.offset-1024)X(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let R=D?$(Q,D,A,X):Z(Q,V,K,null,A,X);if(Q.schema.compat)j7.flowIndentCheck(z.indent,D,X);V=R.range[2];let N=new A7.Pair(O,R);if(Q.options.keepSourceTokens)N.srcToken=G;H.items.push(N)}else{if(L)X(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(A.comment)if(O.comment)O.comment+=`
|
|
65
|
+
`+A.comment;else O.comment=A.comment;let R=new A7.Pair(O);if(Q.options.keepSourceTokens)R.srcToken=G;H.items.push(R)}}if(Y&&Y<V)X(Y,"IMPOSSIBLE","Map comment with trailing content");return H.range=[z.offset,V,Y??V],H}$G.resolveBlockMap=eY});var E7=_((JG)=>{var QG=t0(),zG=i$(),XG=U5();function UG({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let H=new(U?.nodeClass??QG.YAMLSeq)(Q.schema);if(Q.atRoot)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let V=z.offset,Y=null;for(let{start:G,value:W}of z.items){let q=zG.resolveProps(G,{indicator:"seq-item-ind",next:W,offset:V,onError:X,parentIndent:z.indent,startOnNewline:!0});if(!q.found)if(q.anchor||q.tag||W)if(W?.type==="block-seq")X(q.end,"BAD_INDENT","All sequence items must start at the same column");else X(V,"MISSING_CHAR","Sequence item without - indicator");else{if(Y=q.end,q.comment)H.comment=q.comment;continue}let K=W?$(Q,W,q,X):Z(Q,q.end,G,null,q,X);if(Q.schema.compat)XG.flowIndentCheck(z.indent,W,X);V=K.range[2],H.items.push(K)}return H.range=[z.offset,V,Y??V],H}JG.resolveBlockSeq=UG});var a2=_((YG)=>{function VG($,Z,Q,z){let X="";if($){let U=!1,J="";for(let H of $){let{source:V,type:Y}=H;switch(Y){case"space":U=!0;break;case"comment":{if(Q&&!U)z(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=V.substring(1)||" ";if(!X)X=G;else X+=J+G;J="";break}case"newline":if(X)J+=V;U=!0;break;default:z(H,"UNEXPECTED_TOKEN",`Unexpected ${Y} at node end`)}Z+=V.length}}return{comment:X,offset:Z}}YG.resolveEnd=VG});var x7=_((IG)=>{var WG=x(),qG=s0(),b7=a0(),BG=t0(),KG=a2(),y7=i$(),DG=V8(),LG=J5(),H5="Block collections are not allowed within flow collections",V5=($)=>$&&($.type==="block-map"||$.type==="block-seq");function MG({composeNode:$,composeEmptyNode:Z},Q,z,X,U){let J=z.start.source==="{",H=J?"flow map":"flow sequence",Y=new(U?.nodeClass??(J?b7.YAMLMap:BG.YAMLSeq))(Q.schema);Y.flow=!0;let G=Q.atRoot;if(G)Q.atRoot=!1;if(Q.atKey)Q.atKey=!1;let W=z.offset+z.start.source.length;for(let L=0;L<z.items.length;++L){let I=z.items[L],{start:O,key:A,sep:R,value:N}=I,T=y7.resolveProps(O,{flow:H,indicator:"explicit-key-ind",next:A??R?.[0],offset:W,onError:X,parentIndent:z.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!R&&!N){if(L===0&&T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(L<z.items.length-1)X(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(T.comment)if(Y.comment)Y.comment+=`
|
|
66
|
+
`+T.comment;else Y.comment=T.comment;W=T.end;continue}if(!J&&Q.options.strict&&DG.containsNewline(A))X(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(T.comma)X(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!T.comma)X(T.start,"MISSING_CHAR",`Missing , between ${H} items`);if(T.comment){let S="";$:for(let P of O)switch(P.type){case"comma":case"space":break;case"comment":S=P.source.substring(1);break $;default:break $}if(S){let P=Y.items[Y.items.length-1];if(WG.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
|
|
67
|
+
`+S;else P.comment=S;T.comment=T.comment.substring(S.length+1)}}}if(!J&&!R&&!T.found){let S=N?$(Q,N,T,X):Z(Q,T.end,R,null,T,X);if(Y.items.push(S),W=S.range[2],V5(N))X(S.range,"BLOCK_IN_FLOW",H5)}else{Q.atKey=!0;let S=T.end,P=A?$(Q,A,T,X):Z(Q,S,O,null,T,X);if(V5(A))X(P.range,"BLOCK_IN_FLOW",H5);Q.atKey=!1;let b=y7.resolveProps(R??[],{flow:H,indicator:"map-value-ind",next:N,offset:P.range[2],onError:X,parentIndent:z.indent,startOnNewline:!1});if(b.found){if(!J&&!T.found&&Q.options.strict){if(R)for(let g of R){if(g===b.found)break;if(g.type==="newline"){X(g,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(T.start<b.found.offset-1024)X(b.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")X(N,"MISSING_CHAR",`Missing space after : in ${H}`);else X(b.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let $0=N?$(Q,N,b,X):b.found?Z(Q,b.end,R,null,b,X):null;if($0){if(V5(N))X($0.range,"BLOCK_IN_FLOW",H5)}else if(b.comment)if(P.comment)P.comment+=`
|
|
68
|
+
`+b.comment;else P.comment=b.comment;let a=new qG.Pair(P,$0);if(Q.options.keepSourceTokens)a.srcToken=I;if(J){let g=Y;if(LG.mapIncludes(Q,g.items,P))X(S,"DUPLICATE_KEY","Map keys must be unique");g.items.push(a)}else{let g=new b7.YAMLMap(Q.schema);g.flow=!0,g.items.push(a);let C0=($0??P).range;g.range=[P.range[0],C0[1],C0[2]],Y.items.push(g)}W=$0?$0.range[2]:b.end}}let q=J?"}":"]",[K,...D]=z.end,B=W;if(K?.source===q)B=K.offset+K.source.length;else{let L=H[0].toUpperCase()+H.substring(1),I=G?`${L} must end with a ${q}`:`${L} in block collection must be sufficiently indented and end with a ${q}`;if(X(W,G?"MISSING_CHAR":"BAD_INDENT",I),K&&K.source.length!==1)D.unshift(K)}if(D.length>0){let L=KG.resolveEnd(D,B,Q.options.strict,X);if(L.comment)if(Y.comment)Y.comment+=`
|
|
69
|
+
`+L.comment;else Y.comment=L.comment;Y.range=[z.offset,B,L.offset]}else Y.range=[z.offset,B,B];return Y}IG.resolveFlowCollection=MG});var g7=_((jG)=>{var _G=x(),PG=d(),FG=a0(),RG=t0(),NG=S7(),TG=E7(),AG=x7();function Y5($,Z,Q,z,X,U){let J=Q.type==="block-map"?NG.resolveBlockMap($,Z,Q,z,U):Q.type==="block-seq"?TG.resolveBlockSeq($,Z,Q,z,U):AG.resolveFlowCollection($,Z,Q,z,U),H=J.constructor;if(X==="!"||X===H.tagName)return J.tag=H.tagName,J;if(X)J.tag=X;return J}function CG($,Z,Q,z,X){let U=z.tag,J=!U?null:Z.directives.tagName(U.source,(q)=>X(U,"TAG_RESOLVE_FAILED",q));if(Q.type==="block-seq"){let{anchor:q,newlineAfterProp:K}=z,D=q&&U?q.offset>U.offset?q:U:q??U;if(D&&(!K||K.offset<D.offset))X(D,"MISSING_CHAR","Missing newline after block sequence props")}let H=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!U||!J||J==="!"||J===FG.YAMLMap.tagName&&H==="map"||J===RG.YAMLSeq.tagName&&H==="seq")return Y5($,Z,Q,X,J);let V=Z.schema.tags.find((q)=>q.tag===J&&q.collection===H);if(!V){let q=Z.schema.knownTags[J];if(q?.collection===H)Z.schema.tags.push(Object.assign({},q,{default:!1})),V=q;else{if(q)X(U,"BAD_COLLECTION_TYPE",`${q.tag} used for ${H} collection, but expects ${q.collection??"scalar"}`,!0);else X(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,!0);return Y5($,Z,Q,X,J)}}let Y=Y5($,Z,Q,X,J,V),G=V.resolve?.(Y,(q)=>X(U,"TAG_RESOLVE_FAILED",q),Z.options)??Y,W=_G.isNode(G)?G:new PG.Scalar(G);if(W.range=Y.range,W.tag=J,V?.format)W.format=V.format;return W}jG.composeCollection=CG});var W5=_((yG)=>{var G5=d();function SG($,Z,Q){let z=Z.offset,X=EG(Z,$.options.strict,Q);if(!X)return{value:"",type:null,comment:"",range:[z,z,z]};let U=X.mode===">"?G5.Scalar.BLOCK_FOLDED:G5.Scalar.BLOCK_LITERAL,J=Z.source?bG(Z.source):[],H=J.length;for(let B=J.length-1;B>=0;--B){let L=J[B][1];if(L===""||L==="\r")H=B;else break}if(H===0){let B=X.chomp==="+"&&J.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,J.length-1)):"",L=z+X.length;if(Z.source)L+=Z.source.length;return{value:B,type:U,comment:X.comment,range:[z,L,L]}}let V=Z.indent+X.indent,Y=Z.offset+X.length,G=0;for(let B=0;B<H;++B){let[L,I]=J[B];if(I===""||I==="\r"){if(X.indent===0&&L.length>V)V=L.length}else{if(L.length<V)Q(Y+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(X.indent===0)V=L.length;if(G=B,V===0&&!$.atRoot)Q(Y,"BAD_INDENT","Block scalar values in collections must be indented");break}Y+=L.length+I.length+1}for(let B=J.length-1;B>=H;--B)if(J[B][0].length>V)H=B+1;let W="",q="",K=!1;for(let B=0;B<G;++B)W+=J[B][0].slice(V)+`
|
|
71
|
+
`;for(let B=G;B<H;++B){let[L,I]=J[B];Y+=L.length+I.length+1;let O=I[I.length-1]==="\r";if(O)I=I.slice(0,-1);if(I&&L.length<V){let R=`Block scalar lines must not be less indented than their ${X.indent?"explicit indentation indicator":"first line"}`;Q(Y-I.length-(O?2:1),"BAD_INDENT",R),L=""}if(U===G5.Scalar.BLOCK_LITERAL)W+=q+L.slice(V)+I,q=`
|
|
72
|
+
`;else if(L.length>V||I[0]==="\t"){if(q===" ")q=`
|
|
73
|
+
`;else if(!K&&q===`
|
|
74
|
+
`)q=`
|
|
75
75
|
|
|
76
|
-
`;W+=
|
|
77
|
-
`,K=!0}else if(
|
|
76
|
+
`;W+=q+L.slice(V)+I,q=`
|
|
77
|
+
`,K=!0}else if(I==="")if(q===`
|
|
78
78
|
`)W+=`
|
|
79
|
-
`;else
|
|
80
|
-
`;else W+=
|
|
81
|
-
`+
|
|
79
|
+
`;else q=`
|
|
80
|
+
`;else W+=q+I,q=" ",K=!1}switch(X.chomp){case"-":break;case"+":for(let B=H;B<J.length;++B)W+=`
|
|
81
|
+
`+J[B][0].slice(V);if(W[W.length-1]!==`
|
|
82
82
|
`)W+=`
|
|
83
83
|
`;break;default:W+=`
|
|
84
|
-
`}let
|
|
84
|
+
`}let D=z+X.length+Z.source.length;return{value:W,type:U,comment:X.comment,range:[z,D,D]}}function EG({offset:$,props:Z},Q,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:X}=Z[0],U=X[0],J=0,H="",V=-1;for(let q=1;q<X.length;++q){let K=X[q];if(!H&&(K==="-"||K==="+"))H=K;else{let D=Number(K);if(!J&&D)J=D;else if(V===-1)V=$+q}}if(V!==-1)z(V,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${X}`);let Y=!1,G="",W=X.length;for(let q=1;q<Z.length;++q){let K=Z[q];switch(K.type){case"space":Y=!0;case"newline":W+=K.source.length;break;case"comment":if(Q&&!Y)z(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=K.source.length,G=K.source.substring(1);break;case"error":z(K,"UNEXPECTED_TOKEN",K.message),W+=K.source.length;break;default:{let D=`Unexpected token in block scalar header: ${K.type}`;z(K,"UNEXPECTED_TOKEN",D);let B=K.source;if(B&&typeof B==="string")W+=B.length}}}return{mode:U,indent:J,chomp:H,comment:G,length:W}}function bG($){let Z=$.split(/\n( *)/),Q=Z[0],z=Q.match(/^( *)/),U=[z?.[1]?[z[1],Q.slice(z[1].length)]:["",Q]];for(let J=1;J<Z.length;J+=2)U.push([Z[J],Z[J+1]]);return U}yG.resolveBlockScalar=SG});var B5=_((lG)=>{var q5=d(),gG=a2();function vG($,Z,Q){let{offset:z,type:X,source:U,end:J}=$,H,V,Y=(q,K,D)=>Q(z+q,K,D);switch(X){case"scalar":H=q5.Scalar.PLAIN,V=kG(U,Y);break;case"single-quoted-scalar":H=q5.Scalar.QUOTE_SINGLE,V=hG(U,Y);break;case"double-quoted-scalar":H=q5.Scalar.QUOTE_DOUBLE,V=uG(U,Y);break;default:return Q($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${X}`),{value:"",type:null,comment:"",range:[z,z+U.length,z+U.length]}}let G=z+U.length,W=gG.resolveEnd(J,G,Z,Q);return{value:V,type:H,comment:W.comment,range:[z,G,W.offset]}}function kG($,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 v7($)}function hG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return v7($.slice(1,-1)).replace(/''/g,"'")}function v7($){let Z,Q;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
85
|
`,"sy"),Q=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
-
`,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],
|
|
87
|
-
`)X+=
|
|
88
|
-
`;else X+=
|
|
86
|
+
`,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,Q=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let X=z[1],U=" ",J=Z.lastIndex;Q.lastIndex=J;while(z=Q.exec($)){if(z[1]==="")if(U===`
|
|
87
|
+
`)X+=U;else U=`
|
|
88
|
+
`;else X+=U+z[1],U=" ";J=Q.lastIndex}let H=/[ \t]*(.*)/sy;return H.lastIndex=J,z=H.exec($),X+U+(z?.[1]??"")}function uG($,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:
|
|
91
|
-
`){
|
|
92
|
-
`){
|
|
93
|
-
`&&!(
|
|
94
|
-
`))Q+=z>
|
|
90
|
+
`){let{fold:U,offset:J}=mG($,z);Q+=U,z=J}else if(X==="\\"){let U=$[++z],J=fG[U];if(J)Q+=J;else if(U===`
|
|
91
|
+
`){U=$[z+1];while(U===" "||U==="\t")U=$[++z+1]}else if(U==="\r"&&$[z+1]===`
|
|
92
|
+
`){U=$[++z+1];while(U===" "||U==="\t")U=$[++z+1]}else if(U==="x"||U==="u"||U==="U"){let H=U==="x"?2:U==="u"?4:8;Q+=pG($,z+1,H,Z),z+=H}else{let H=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),Q+=H}}else if(X===" "||X==="\t"){let U=z,J=$[z+1];while(J===" "||J==="\t")J=$[++z+1];if(J!==`
|
|
93
|
+
`&&!(J==="\r"&&$[z+2]===`
|
|
94
|
+
`))Q+=z>U?$.slice(U,z+1):X}else Q+=X}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return Q}function mG($,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 fG={"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 pG($,Z,Q,z){let X=$.substr(Z,Q),J=X.length===Q&&/^[0-9a-fA-F]+$/.test(X)?parseInt(X,16):NaN;try{return String.fromCodePoint(J)}catch{let H=$.substr(Z-2,Q+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}}lG.resolveFlowScalar=vG});var h7=_((oG)=>{var L2=x(),k7=d(),dG=W5(),iG=B5();function nG($,Z,Q,z){let{value:X,type:U,comment:J,range:H}=Z.type==="block-scalar"?dG.resolveBlockScalar($,Z,z):iG.resolveFlowScalar(Z,$.options.strict,z),V=Q?$.directives.tagName(Q.source,(W)=>z(Q,"TAG_RESOLVE_FAILED",W)):null,Y;if($.options.stringKeys&&$.atKey)Y=$.schema[L2.SCALAR];else if(V)Y=rG($.schema,X,V,Q,z);else if(Z.type==="scalar")Y=sG($,X,Z,z);else Y=$.schema[L2.SCALAR];let G;try{let W=Y.resolve(X,(q)=>z(Q??Z,"TAG_RESOLVE_FAILED",q),$.options);G=L2.isScalar(W)?W:new k7.Scalar(W)}catch(W){let q=W instanceof Error?W.message:String(W);z(Q??Z,"TAG_RESOLVE_FAILED",q),G=new k7.Scalar(X)}if(G.range=H,G.source=X,U)G.type=U;if(V)G.tag=V;if(Y.format)G.format=Y.format;if(J)G.comment=J;return G}function rG($,Z,Q,z,X){if(Q==="!")return $[L2.SCALAR];let U=[];for(let H of $.tags)if(!H.collection&&H.tag===Q)if(H.default&&H.test)U.push(H);else return H;for(let H of U)if(H.test?.test(Z))return H;let J=$.knownTags[Q];if(J&&!J.collection)return $.tags.push(Object.assign({},J,{default:!1,test:void 0})),J;return X(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,Q!=="tag:yaml.org,2002:str"),$[L2.SCALAR]}function sG({atKey:$,directives:Z,schema:Q},z,X,U){let J=Q.tags.find((H)=>(H.default===!0||$&&H.default==="key")&&H.test?.test(z))||Q[L2.SCALAR];if(Q.compat){let H=Q.compat.find((V)=>V.default&&V.test?.test(z))??Q[L2.SCALAR];if(J.tag!==H.tag){let V=Z.tagString(J.tag),Y=Z.tagString(H.tag),G=`Value may be parsed as either ${V} or ${Y}`;U(X,"TAG_RESOLVE_FAILED",G,!0)}}return J}oG.composeScalar=nG});var u7=_((eG)=>{function tG($,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 $}eG.emptyScalarPosition=tG});var p7=_((VW)=>{var ZW=S$(),QW=x(),zW=g7(),m7=h7(),XW=a2(),UW=u7(),JW={composeNode:f7,composeEmptyNode:K5};function f7($,Z,Q,z){let X=$.atKey,{spaceBefore:U,comment:J,anchor:H,tag:V}=Q,Y,G=!0;switch(Z.type){case"alias":if(Y=HW($,Z,z),H||V)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(Y=m7.composeScalar($,Z,V,z),H)Y.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(Y=zW.composeCollection(JW,$,Z,Q,z),H)Y.anchor=H.source.substring(1)}catch(W){let q=W instanceof Error?W.message:String(W);z(Z,"RESOURCE_EXHAUSTION",q)}break;default:{let W=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",W),G=!1}}if(Y??(Y=K5($,Z.offset,void 0,null,Q,z)),H&&Y.anchor==="")z(H,"BAD_ALIAS","Anchor cannot be an empty string");if(X&&$.options.stringKeys&&(!QW.isScalar(Y)||typeof Y.value!=="string"||Y.tag&&Y.tag!=="tag:yaml.org,2002:str"))z(V??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)Y.spaceBefore=!0;if(J)if(Z.type==="scalar"&&Z.source==="")Y.comment=J;else Y.commentBefore=J;if($.options.keepSourceTokens&&G)Y.srcToken=Z;return Y}function K5($,Z,Q,z,{spaceBefore:X,comment:U,anchor:J,tag:H,end:V},Y){let G={type:"scalar",offset:UW.emptyScalarPosition(Z,Q,z),indent:-1,source:""},W=m7.composeScalar($,G,H,Y);if(J){if(W.anchor=J.source.substring(1),W.anchor==="")Y(J,"BAD_ALIAS","Anchor cannot be an empty string")}if(X)W.spaceBefore=!0;if(U)W.comment=U,W.range[2]=V;return W}function HW({options:$},{offset:Z,source:Q,end:z},X){let U=new ZW.Alias(Q.substring(1));if(U.source==="")X(Z,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))X(Z+Q.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let J=Z+Q.length,H=XW.resolveEnd(z,J,$.strict,X);if(U.range=[Z,J,H.offset],H.comment)U.comment=H.comment;return U}VW.composeEmptyNode=K5;VW.composeNode=f7});var c7=_((DW)=>{var WW=c$(),l7=p7(),qW=a2(),BW=i$();function KW($,Z,{offset:Q,start:z,value:X,end:U},J){let H=Object.assign({_directives:Z},$),V=new WW.Document(void 0,H),Y={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},G=BW.resolveProps(z,{indicator:"doc-start",next:X??U?.[0],offset:Q,onError:J,parentIndent:0,startOnNewline:!0});if(G.found){if(V.directives.docStart=!0,X&&(X.type==="block-map"||X.type==="block-seq")&&!G.hasNewline)J(G.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}V.contents=X?l7.composeNode(Y,X,G,J):l7.composeEmptyNode(Y,G.end,z,null,G,J);let W=V.contents.range[2],q=qW.resolveEnd(U,W,!1,J);if(q.comment)V.comment=q.comment;return V.range=[Q,W,q.offset],V}DW.composeDoc=KW});var D5=_((FW)=>{var MW=F$("process"),IW=O4(),OW=c$(),n$=d$(),d7=x(),_W=c7(),PW=a2();function r$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:Q}=$;return[Z,Z+(typeof Q==="string"?Q.length:1)]}function i7($){let Z="",Q=!1,z=!1;for(let X=0;X<$.length;++X){let U=$[X];switch(U[0]){case"#":Z+=(Z===""?"":z?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(
|
|
103
|
-
${Q}`:Q;else if(z||$.directives.docStart||!X)$.commentBefore=Q;else if(
|
|
104
|
-
${
|
|
105
|
-
${
|
|
106
|
-
${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new
|
|
107
|
-
`}];switch(
|
|
108
|
-
`),
|
|
109
|
-
`,
|
|
110
|
-
`});return{type:"block-scalar",offset:
|
|
102
|
+
`)+(U.substring(1)||" "),Q=!0,z=!1;break;case"%":if($[X+1]?.[0]!=="#")X+=1;Q=!1;break;default:if(!Q)z=!0;Q=!1}}return{comment:Z,afterEmptyLine:z}}class n7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,Q,z,X)=>{let U=r$(Z);if(X)this.warnings.push(new n$.YAMLWarning(U,Q,z));else this.errors.push(new n$.YAMLParseError(U,Q,z))},this.directives=new IW.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:Q,afterEmptyLine:z}=i7(this.prelude);if(Q){let X=$.contents;if(Z)$.comment=$.comment?`${$.comment}
|
|
103
|
+
${Q}`:Q;else if(z||$.directives.docStart||!X)$.commentBefore=Q;else if(d7.isCollection(X)&&!X.flow&&X.items.length>0){let U=X.items[0];if(d7.isPair(U))U=U.key;let J=U.commentBefore;U.commentBefore=J?`${Q}
|
|
104
|
+
${J}`:Q}else{let U=X.commentBefore;X.commentBefore=U?`${Q}
|
|
105
|
+
${U}`:Q}}if(Z){for(let X=0;X<this.errors.length;++X)$.errors.push(this.errors[X]);for(let X=0;X<this.warnings.length;++X)$.warnings.push(this.warnings[X])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:i7(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,Q=-1){for(let z of $)yield*this.next(z);yield*this.end(Z,Q)}*next($){if(MW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,Q,z)=>{let X=r$($);X[0]+=Z,this.onError(X,"BAD_DIRECTIVE",Q,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=_W.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 n$.YAMLParseError(r$($),"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 n$.YAMLParseError(r$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=PW.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 n$.YAMLParseError(r$($),"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 OW.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}}}FW.Composer=n7});var o7=_((EW)=>{var NW=W5(),TW=B5(),AW=d$(),r7=x$();function CW($,Z=!0,Q){if($){let z=(X,U,J)=>{let H=typeof X==="number"?X:Array.isArray(X)?X[0]:X.offset;if(Q)Q(H,U,J);else throw new AW.YAMLParseError([H,H+1],U,J)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return TW.resolveFlowScalar($,Z,z);case"block-scalar":return NW.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function jW($,Z){let{implicitKey:Q=!1,indent:z,inFlow:X=!1,offset:U=-1,type:J="PLAIN"}=Z,H=r7.stringifyString({type:J,value:$},{implicitKey:Q,indent:z>0?" ".repeat(z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}}),V=Z.end??[{type:"newline",offset:-1,indent:z,source:`
|
|
107
|
+
`}];switch(H[0]){case"|":case">":{let Y=H.indexOf(`
|
|
108
|
+
`),G=H.substring(0,Y),W=H.substring(Y+1)+`
|
|
109
|
+
`,q=[{type:"block-scalar-header",offset:U,indent:z,source:G}];if(!s7(q,V))q.push({type:"newline",offset:-1,indent:z,source:`
|
|
110
|
+
`});return{type:"block-scalar",offset:U,indent:z,props:q,source:W}}case'"':return{type:"double-quoted-scalar",offset:U,indent:z,source:H,end:V};case"'":return{type:"single-quoted-scalar",offset:U,indent:z,source:H,end:V};default:return{type:"scalar",offset:U,indent:z,source:H,end:V}}}function wW($,Z,Q={}){let{afterKey:z=!1,implicitKey:X=!1,inFlow:U=!1,type:J}=Q,H="indent"in $?$.indent:null;if(z&&typeof H==="number")H+=2;if(!J)switch($.type){case"single-quoted-scalar":J="QUOTE_SINGLE";break;case"double-quoted-scalar":J="QUOTE_DOUBLE";break;case"block-scalar":{let Y=$.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");J=Y.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:J="PLAIN"}let V=r7.stringifyString({type:J,value:Z},{implicitKey:X||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(V[0]){case"|":case">":SW($,V);break;case'"':L5($,V,"double-quoted-scalar");break;case"'":L5($,V,"single-quoted-scalar");break;default:L5($,V,"scalar")}}function SW($,Z){let Q=Z.indexOf(`
|
|
111
111
|
`),z=Z.substring(0,Q),X=Z.substring(Q+1)+`
|
|
112
|
-
`;if($.type==="block-scalar"){let
|
|
113
|
-
`});for(let
|
|
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((
|
|
112
|
+
`;if($.type==="block-scalar"){let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=z,$.source=X}else{let{offset:U}=$,J="indent"in $?$.indent:-1,H=[{type:"block-scalar-header",offset:U,indent:J,source:z}];if(!s7(H,"end"in $?$.end:void 0))H.push({type:"newline",offset:-1,indent:J,source:`
|
|
113
|
+
`});for(let V of Object.keys($))if(V!=="type"&&V!=="offset")delete $[V];Object.assign($,{type:"block-scalar",indent:J,props:H,source:X})}}function s7($,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 L5($,Z,Q){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Q,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),X=Z.length;if($.props[0].type==="block-scalar-header")X-=$.props[0].source.length;for(let U of z)U.offset+=X;delete $.props,Object.assign($,{type:Q,source:Z,end:z});break}case"block-map":case"block-seq":{let X={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
|
|
114
|
+
`};delete $.items,Object.assign($,{type:Q,source:Z,end:[X]});break}default:{let z="indent"in $?$.indent:-1,X="end"in $&&Array.isArray($.end)?$.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:Q,indent:z,source:Z,end:X})}}}EW.createScalarToken=jW;EW.resolveAsScalar=CW;EW.setScalarValue=wW});var a7=_((vW)=>{var gW=($)=>("type"in $)?G8($):Y8($);function G8($){switch($.type){case"block-scalar":{let Z="";for(let Q of $.props)Z+=G8(Q);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let Q of $.items)Z+=Y8(Q);return Z}case"flow-collection":{let Z=$.start.source;for(let Q of $.items)Z+=Y8(Q);for(let Q of $.end)Z+=Q.source;return Z}case"document":{let Z=Y8($);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 Y8({start:$,key:Z,sep:Q,value:z}){let X="";for(let U of $)X+=U.source;if(Z)X+=G8(Z);if(Q)for(let U of Q)X+=U.source;if(z)X+=G8(z);return X}vW.stringify=gW});var $9=_((uW)=>{var M5=Symbol("break visit"),hW=Symbol("skip children"),t7=Symbol("remove item");function M2($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};e7(Object.freeze([]),$,Z)}M2.BREAK=M5;M2.SKIP=hW;M2.REMOVE=t7;M2.itemAtPath=($,Z)=>{let Q=$;for(let[z,X]of Z){let U=Q?.[z];if(U&&"items"in U)Q=U.items[X];else return}return Q};M2.parentCollection=($,Z)=>{let Q=M2.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 e7($,Z,Q){let z=Q(Z,$);if(typeof z==="symbol")return z;for(let X of["key","value"]){let U=Z[X];if(U&&"items"in U){for(let J=0;J<U.items.length;++J){let H=e7(Object.freeze($.concat([[X,J]])),U.items[J],Q);if(typeof H==="number")J=H-1;else if(H===M5)return M5;else if(H===t7)U.items.splice(J,1),J-=1}if(typeof z==="function"&&X==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}uW.visit=M2});var W8=_((nW)=>{var I5=o7(),fW=a7(),pW=$9(),O5="\uFEFF",_5="\x02",P5="\x18",F5="\x1F",lW=($)=>!!$&&("items"in $),cW=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function dW($){switch($){case O5:return"<BOM>";case _5:return"<DOC>";case P5:return"<FLOW_END>";case F5:return"<SCALAR>";default:return JSON.stringify($)}}function iW($){switch($){case O5:return"byte-order-mark";case _5:return"doc-mode";case P5:return"flow-error-end";case F5: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 `),
|
|
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}nW.createScalarToken=I5.createScalarToken;nW.resolveAsScalar=I5.resolveAsScalar;nW.setScalarValue=I5.setScalarValue;nW.stringify=fW.stringify;nW.visit=pW.visit;nW.BOM=O5;nW.DOCUMENT=_5;nW.FLOW_END=P5;nW.SCALAR=F5;nW.isCollection=lW;nW.isScalar=cW;nW.prettyToken=dW;nW.tokenType=iW});var N5=_((Yq)=>{var s$=W8();function L0($){switch($){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var Z9=new Set("0123456789ABCDEFabcdef"),Hq=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),q8=new Set(",[]{}"),Vq=new Set(` ,[]{}
|
|
118
|
+
\r `),R5=($)=>!$||Vq.has($);class Q9{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let Q=this.next??"stream";while(Q&&(Z||this.hasChars(1)))Q=yield*this.parseNext(Q)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
|
|
119
119
|
`)return!0;if(Z==="\r")return this.buffer[$+1]===`
|
|
120
120
|
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let Q=0;while(Z===" ")Z=this.buffer[++Q+$];if(Z==="\r"){let z=this.buffer[Q+$+1];if(z===`
|
|
121
121
|
`||!z&&!this.atEnd)return $+Q+1}return Z===`
|
|
122
|
-
`||Q>=this.indentNext||!Z&&!this.atEnd?$+Q:-1}if(Z==="-"||Z==="."){let Q=this.buffer.substr($,3);if((Q==="---"||Q==="...")&&
|
|
123
|
-
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===
|
|
122
|
+
`||Q>=this.indentNext||!Z&&!this.atEnd?$+Q:-1}if(Z==="-"||Z==="."){let Q=this.buffer.substr($,3);if((Q==="---"||Q==="...")&&L0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===s$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,Q=$.indexOf("#");while(Q!==-1){let X=$[Q-1];if(X===" "||X==="\t"){Z=Q-1;break}else Q=$.indexOf("#",Q+1)}while(!0){let X=$[Z-1];if(X===" "||X==="\t")Z-=1;else break}let z=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield s$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&L0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!L0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&L0(Z)){let Q=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Q,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(R5),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,Q=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=Q=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(Q!==-1&&Q<this.indentNext&&z[0]!=="#"||Q===0&&(z.startsWith("---")||z.startsWith("..."))&&L0(z[3])){if(!(Q===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield s$.FLOW_END,yield*this.parseLineStart()}let X=0;while(z[X]===",")X+=yield*this.pushCount(1),X+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(X+=yield*this.pushIndicators(),z[X]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-X),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(R5),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||L0(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let X=0;while(this.buffer[Z-1-X]==="\\")X+=1;if(X%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let Q=this.buffer.substring(0,Z),z=Q.indexOf(`
|
|
124
124
|
`,this.pos);if(z!==-1){while(z!==-1){let X=this.continueScalar(z+1);if(X===-1)break;z=Q.indexOf(`
|
|
125
|
-
`,X)}if(z!==-1)Z=z-(Q[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>
|
|
126
|
-
`:$=X,Z=0;break;case"\r":{let
|
|
125
|
+
`,X)}if(z!==-1)Z=z-(Q[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>L0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,Q;$:for(let X=this.pos;Q=this.buffer[X];++X)switch(Q){case" ":Z+=1;break;case`
|
|
126
|
+
`:$=X,Z=0;break;case"\r":{let U=this.buffer[X+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
|
|
127
127
|
`)break}default:break $}if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let X=this.continueScalar($+1);if(X===-1)break;$=this.buffer.indexOf(`
|
|
128
128
|
`,X)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;Q=this.buffer[z];while(Q===" ")Q=this.buffer[++z];if(Q==="\t"){while(Q==="\t"||Q===" "||Q==="\r"||Q===`
|
|
129
|
-
`)Q=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let X=$-1,
|
|
130
|
-
`&&X>=this.pos&&X+1+Z>
|
|
129
|
+
`)Q=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let X=$-1,U=this.buffer[X];if(U==="\r")U=this.buffer[--X];let J=X;while(U===" ")U=this.buffer[--X];if(U===`
|
|
130
|
+
`&&X>=this.pos&&X+1+Z>J)$=X;else break}while(!0);return yield 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(L0(X)||$&&q8.has(X))break;Z=Q}else if(L0(z)){let X=this.buffer[Q+1];if(z==="\r")if(X===`
|
|
131
131
|
`)Q+=1,z=`
|
|
132
|
-
`,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&
|
|
133
|
-
`){let
|
|
132
|
+
`,X=this.buffer[Q+1];else Z=Q;if(X==="#"||$&&q8.has(X))break;if(z===`
|
|
133
|
+
`){let U=this.continueScalar(Q+1);if(U===-1)break;Q=Math.max(Q,U-2)}}else{if($&&q8.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(R5),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let Z=this.flowLevel>0,Q=this.charAt(1);if(L0(Q)||Z&&q8.has(Q)){if(!Z)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0);continue $}}}break $}return $}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!L0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(Hq.has(Z))Z=this.buffer[++$];else if(Z==="%"&&Z9.has(this.buffer[$+1])&&Z9.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)}}Yq.Lexer=Q9});var T5=_((Wq)=>{class z9{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}}}}Wq.LineCounter=z9});var A5=_((Dq)=>{var Bq=F$("process"),X9=W8(),Kq=N5();function e0($,Z){for(let Q=0;Q<$.length;++Q)if($[Q].type===Z)return!0;return!1}function U9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function H9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function B8($){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 t2($){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 K8($,Z){if(Z.length<1e5)Array.prototype.push.apply($,Z);else for(let Q=0;Q<Z.length;++Q)$.push(Z[Q])}function J9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!e0(Z.start,"explicit-key-ind")&&!e0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,H9(Z.value))if(Z.value.end)K8(Z.value.end,Z.sep);else Z.value.end=Z.sep;else K8(Z.start,Z.sep);delete Z.sep}}}class V9{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 Kq.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=$,Bq.env.LOG_TOKENS)console.log("|",X9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=X9.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")J9(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&&U9(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(U9($.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=B8(this.peek(2)),Q=t2(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)){
|
|
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)){K8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Q=!this.onKeyLine&&this.indent===$.indent,z=Q&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(z&&Z.sep&&!Z.value){let U=[];for(let J=0;J<Z.sep.length;++J){let H=Z.sep[J];switch(H.type){case"newline":U.push(J);break;case"space":break;case"comment":if(H.indent>$.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)X=Z.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)X.push(this.sourceToken),$.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(e0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let U=t2(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(e0(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(H9(Z.key)&&!e0(Z.sep,"newline")){let U=t2(Z.start),J=Z.key,H=Z.sep;H.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:J,sep:H}]})}else if(X.length>0)Z.sep=Z.sep.concat(X,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:X,key:null,sep:[this.sourceToken]});else if(e0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:X,key:U,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(U);else Object.assign(Z,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue($);if(U){if(U.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!e0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Q)$.items.push({start:X});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let Q="end"in Z.value?Z.value.end:void 0;if((Array.isArray(Q)?Q[Q.length-1]:void 0)?.type==="comment")Q?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){K8(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||e0(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=B8(Q),X=t2(z);J9($);let U=$.end.splice(1,$.end.length);U.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
|
|
138
138
|
`)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
|
|
139
|
-
`,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=U8($),Q=n2(Z);return Q.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=U8($),Q=n2(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((Q)=>Q.type==="newline"||Q.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}lW.Parser=s7});var $9=_((tW)=>{var o7=UZ(),dW=g$(),m$=v$(),iW=L5(),nW=g(),rW=LZ(),a7=IZ();function t7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new rW.LineCounter||null,prettyErrors:Z}}function sW($,Z={}){let{lineCounter:Q,prettyErrors:z}=t7(Z),X=new a7.Parser(Q?.addNewLine),H=new o7.Composer(Z),U=Array.from(H.compose(X.parse($)));if(z&&Q)for(let J of U)J.errors.forEach(m$.prettifyError($,Q)),J.warnings.forEach(m$.prettifyError($,Q));if(U.length>0)return U;return Object.assign([],{empty:!0},H.streamInfo())}function e7($,Z={}){let{lineCounter:Q,prettyErrors:z}=t7(Z),X=new a7.Parser(Q?.addNewLine),H=new o7.Composer(Z),U=null;for(let J of H.compose(X.parse($),!0,$.length))if(!U)U=J;else if(U.options.logLevel!=="silent"){U.errors.push(new m$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)U.errors.forEach(m$.prettifyError($,Q)),U.warnings.forEach(m$.prettifyError($,Q));return U}function oW($,Z,Q){let z=void 0;if(typeof Z==="function")z=Z;else if(Q===void 0&&Z&&typeof Z==="object")Q=Z;let X=e7($,Q);if(!X)return null;if(X.warnings.forEach((H)=>iW.warn(X.options.logLevel,H)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function aW($,Z,Q){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(Q===void 0&&Z)Q=Z;if(typeof Q==="string")Q=Q.length;if(typeof Q==="number"){let X=Math.round(Q);Q=X<1?void 0:X>8?{indent:8}:{indent:X}}if($===void 0){let{keepUndefined:X}=Q??Z??{};if(!X)return}if(nW.isDocument($)&&!z)return $.toString(Q);return new dW.Document($,z,Q).toString(Q)}tW.parse=oW;tW.parseAllDocuments=sW;tW.parseDocument=e7;tW.stringify=aW});var p=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],x0=new Map(p.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),f1=new Map(p.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),p_=new Map(p.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function m1($,Z){let Q=(X)=>{let H=X.split("."),U=$;for(let J of H)if(U&&typeof U==="object"&&J in U)U=U[J];else return;return U},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function Sz($){return p.filter((Z)=>Z.category===$)}var Ez=p.filter(($)=>$.index<=21),bz=p,D6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),p1=new Set(["none","n/a","not applicable"]),L6="slotignored";function yz($){return typeof $==="string"&&p1.has($.trim().toLowerCase())}function $5($){return typeof $==="string"&&$.trim()!==""&&r($)}function r($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return D6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var y2="no classifying signals — fallback",xz=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]),I6={skills:new Set(["stack.frontend"]),"skills-plugin":new Set(["stack.frontend","stack.runtime"])};function x2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(b2,$))return null;if(I6[$]?.has(Z.path))return!0;if(!b2[$].includes(Z.category))return!1;return!($==="framework"&&xz.has(Z.path))}var b2={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],skills:["project","human"],cli:["project","human","universal"],"skills-plugin":["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],app:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};function gz($=process.stdout){let Z=process.env.FORCE_COLOR;if(Z!==void 0)return Z!=="0"&&Z!=="false";if(process.env.NO_COLOR!==void 0&&process.env.NO_COLOR!=="")return!1;return Boolean($.isTTY)}var c_=new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`,"g");var O6=($,Z)=>gz()?`\x1B[${$}m${Z}\x1B[0m`:Z,Z5=($)=>(Z)=>O6($,Z),D$=Z5("1"),g2=Z5("2"),d_=Z5("3"),L$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},I$=($)=>O6("38;2;0;212;212",$),Q5=($)=>O6("38;2;14;140;140",$),v2=($)=>O6("38;5;208",$);var g0=[{name:"TROPHY",indicator:`${v2("✪")} ${v2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${v2(D$("★"))} ${v2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I$("◆")} ${I$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${Q5("◇")} ${Q5("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${D$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${g2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${g2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${g2("♡")}`,threshold:0}];function O$($){for(let Z of g0)if($>=Z.threshold)return Z;return g0[g0.length-1]}function vz($){let Z=O$($),Q=g0.indexOf(Z);return Q>0?g0[Q-1]:null}var U5={};jz(U5,{validate:()=>hz,sdkVersion:()=>lz,scoreFafb:()=>pz,scoreEnterprise:()=>kz,score:()=>H5,fafbInfo:()=>mz,decompile:()=>fz,compile:()=>uz});var z5=null;function l0(){if(z5)return z5;try{let $=K$("faf-scoring-kernel");return z5=$,$}catch{throw Error(`faf-scoring-kernel not installed.
|
|
139
|
+
`,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=B8($),Q=t2(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=B8($),Q=t2(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()}}}Dq.Parser=V9});var B9=_((Nq)=>{var Y9=D5(),Mq=c$(),o$=d$(),Iq=T4(),Oq=x(),_q=T5(),G9=A5();function W9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new _q.LineCounter||null,prettyErrors:Z}}function Pq($,Z={}){let{lineCounter:Q,prettyErrors:z}=W9(Z),X=new G9.Parser(Q?.addNewLine),U=new Y9.Composer(Z),J=Array.from(U.compose(X.parse($)));if(z&&Q)for(let H of J)H.errors.forEach(o$.prettifyError($,Q)),H.warnings.forEach(o$.prettifyError($,Q));if(J.length>0)return J;return Object.assign([],{empty:!0},U.streamInfo())}function q9($,Z={}){let{lineCounter:Q,prettyErrors:z}=W9(Z),X=new G9.Parser(Q?.addNewLine),U=new Y9.Composer(Z),J=null;for(let H of U.compose(X.parse($),!0,$.length))if(!J)J=H;else if(J.options.logLevel!=="silent"){J.errors.push(new o$.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Q)J.errors.forEach(o$.prettifyError($,Q)),J.warnings.forEach(o$.prettifyError($,Q));return J}function Fq($,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=q9($,Q);if(!X)return null;if(X.warnings.forEach((U)=>Iq.warn(X.options.logLevel,U)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:z},Q))}function Rq($,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(Oq.isDocument($)&&!z)return $.toString(Q);return new Mq.Document($,z,Q).toString(Q)}Nq.parse=Fq;Nq.parseAllDocuments=Pq;Nq.parseDocument=q9;Nq.stringify=Rq});var p=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"The stage it is at, and since when",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How it works",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],h0=new Map(p.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),eZ=new Map(p.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),lP=new Map(p.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function $1($,Z){let Q=(X)=>{let U=X.split("."),J=$;for(let H of U)if(J&&typeof J==="object"&&H in J)J=J[H];else return;return J},z=Q(Z.path);if(z!==void 0)return z;if(Z.canonical)return Q(Z.canonical);return}function QX($){return p.filter((Z)=>Z.category===$)}var zX=p.filter(($)=>$.index<=21),XX=p,F6=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","tbd","todo","n/a","not applicable"]),Z1=new Set(["none","n/a","not applicable"]),R6="slotignored";function UX($){return typeof $==="string"&&Z1.has($.trim().toLowerCase())}function R$($){return typeof $==="string"&&$.trim()!==""&&m($)}function m($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return F6.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var h2="no classifying signals — fallback",JX=new Set(["stack.css_framework","stack.ui_library","stack.database","stack.connection","stack.hosting"]),N6={skills:new Set(["stack.frontend"]),"skills-plugin":new Set(["stack.frontend","stack.runtime"])};function u2($,Z){if(typeof $!=="string"||!Object.prototype.hasOwnProperty.call(k2,$))return null;if(N6[$]?.has(Z.path))return!0;if(!k2[$].includes(Z.category))return!1;return!($==="framework"&&JX.has(Z.path))}var k2={documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],skills:["project","human"],cli:["project","human","universal"],"skills-plugin":["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],app:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};function HX($=process.stdout){let Z=process.env.FORCE_COLOR;if(Z!==void 0)return Z!=="0"&&Z!=="false";if(process.env.NO_COLOR!==void 0&&process.env.NO_COLOR!=="")return!1;return Boolean($.isTTY)}var dP=new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`,"g");var T6=($,Z)=>HX()?`\x1B[${$}m${Z}\x1B[0m`:Z,G4=($)=>(Z)=>T6($,Z),N$=G4("1"),m2=G4("2"),iP=G4("3"),T$={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},A$=($)=>T6("38;2;0;212;212",$),W4=($)=>T6("38;2;14;140;140",$),f2=($)=>T6("38;5;208",$);var u0=[{name:"TROPHY",indicator:`${f2("✪")} ${f2("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${f2(N$("★"))} ${f2("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${A$("◆")} ${A$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${W4("◇")} ${W4("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${N$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${m2("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${m2("○")} RED`,threshold:1},{name:"WHITE",indicator:`${m2("♡")}`,threshold:0}];function C$($){for(let Z of u0)if($>=Z.threshold)return Z;return u0[u0.length-1]}function VX($){let Z=C$($),Q=u0.indexOf(Z);return Q>0?u0[Q-1]:null}var D4={};$X(D4,{validate:()=>GX,sdkVersion:()=>DX,scoreFafb:()=>KX,scoreEnterprise:()=>YX,score:()=>K4,fafbInfo:()=>BX,decompile:()=>qX,compile:()=>WX});var q4=null;function d0(){if(q4)return q4;try{let $=F$("faf-scoring-kernel");return q4=$,$}catch{throw Error(`faf-scoring-kernel not installed.
|
|
140
140
|
|
|
141
141
|
Run: npm install faf-scoring-kernel
|
|
142
|
-
`)}}var M6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function X5($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[f1.get(Q)??Q]=z;return{...$,slots:Z}}function H5($){return X5(JSON.parse(l0().score_faf(M6($))))}function kz($){return X5(JSON.parse(l0().score_faf_enterprise(M6($))))}function hz($){return l0().validate_faf(M6($))}function uz($){return l0().compile_fafb(M6($))}function fz($){return JSON.parse(l0().decompile_fafb($))}function mz($){return JSON.parse(l0().fafb_info($))}function pz($){return X5(JSON.parse(l0().score_fafb($)))}function lz(){return l0().sdk_version()}var l1=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function c1($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function d1($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],H=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),U=-1;if(H){let J=parseInt(H[1],10);if(J>=0&&J<=100)U=J}return{represents:X,sourceScore:U}}function cz($){return $.unknown?"unknown (—)":`${$.score}%`}function i1($){return{score:$.score,tier:O$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function J5($){let Z=d1($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?O$(Q):g0[g0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return i1(H5($))}function dz($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let Q=$;if(!Q.faf_version)Z.push("Missing required field: faf_version");if(!Q.project?.name)Z.push("Missing required field: project.name");if(Q.app_type==="about")Z.push("about is not an app_type — declare about.represents (owner/repo) instead");if(Q.about!==void 0){if(!c1(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!l1.test(Q.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${Q.about.represents})`);if(Q.about.source_score!==void 0){let z=Q.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}import{lstatSync as d9}from"fs";import{join as p9,dirname as hZ,basename as gF,resolve as t$}from"path";var zB=UZ(),XB=g$(),HB=c5(),OZ=v$(),UB=P$(),t0=g(),JB=n0(),GB=d(),VB=s0(),YB=o0(),MF=X8(),WB=DZ(),BB=LZ(),qB=IZ(),G8=$9(),Z9=M$();var KB=zB.Composer,V8=XB.Document,DB=HB.Schema,LB=OZ.YAMLError,Y8=OZ.YAMLParseError,IB=OZ.YAMLWarning,OB=UB.Alias,h0=t0.isAlias,K2=t0.isCollection,MB=t0.isDocument,l=t0.isMap,L0=t0.isNode,_B=t0.isPair,o=t0.isScalar,u0=t0.isSeq,PB=JB.Pair,FB=GB.Scalar,r2=VB.YAMLMap,p$=YB.YAMLSeq;var RB=WB.Lexer,NB=BB.LineCounter,TB=qB.Parser,f0=G8.parse,AB=G8.parseAllDocuments,s2=G8.parseDocument,D2=G8.stringify,CB=Z9.visit,jB=Z9.visitAsync;import{accessSync as Q9,closeSync as FZ,constants as z9,existsSync as wB,fchmodSync as X9,fchownSync as SB,fsyncSync as H9,lstatSync as RZ,mkdirSync as U9,mkdtempSync as FF,openSync as J9,readdirSync as EB,readFileSync as NZ,readlinkSync as bB,realpathSync as yB,renameSync as xB,rmSync as RF,statSync as o2,unlinkSync as G9,writeFileSync as gB}from"fs";import{randomBytes as vB}from"crypto";import{basename as e0,dirname as L2,isAbsolute as V9,join as a2,relative as TZ,resolve as V0,sep as W8}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 t=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),kB=new Set(Object.values(t).map(($)=>$.toLowerCase())),hB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),MZ=($)=>kB.has($.toLowerCase());function t2($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var uB=/\.fafm?$/i,fB=/^[a-z][a-z0-9-]*$/,j0=($)=>yB.native($),$2=($)=>$?.code;function c$($,Z){let Q=TZ($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${W8}`)&&!V9(Q)}function Y9($){try{return bB($)}catch{return"?"}}function mB($,Z,Q,z){let X;try{X=j0(Q)}catch(H){let U=$2(H);if(U==="ENOENT"||U==="ELOOP"||U==="ENOTDIR")throw new S("dangling",Z,`${Z} is a link to ${Y9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw H}if(!c$($,X))throw new S("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(t2(X)&&!(z.inGit&&L2(X)===$))throw new S("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!o2(X).isFile())throw new S("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return pB(Z,X,z.read),X}function pB($,Z,Q){let z=e0($),X=e0(Z),H=MZ(z)&&MZ(X);if(Q&&!uB.test(X)&&!H){let U=MZ(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&&!hB(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 lB($,Z,Q,z){if(e0(V0($))!=="hooks"||!fB.test(e0(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 cB($,Z,Q){if(e0($)!=="config"||Q!==Z)throw new S("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function u($,Z,Q={}){let z=j0(V0($)),X=V0($,Z),H=j0(L2(X));if(!c$(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)lB($,X,z,H);if(J)cB(X,z,H);let G=a2(H,e0(X));if(t2(G)&&!U&&!J)throw new S("git",X,G===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${G}, inside .git/ — refused.`);let V;try{V=RZ(G)}catch(Y){if($2(Y)==="ENOENT")return G;throw Y}if(V.isSymbolicLink())return mB(z,X,G,{read:Q.read===!0,inGit:U||J});if(!V.isFile())throw new S("not-a-file",X,`${X} is not a regular file — refused.`);return j0(G)}var dB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function iB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return dB.decode($)}catch{}throw new S("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Q0($){return iB(NZ($),$)}function m0($){try{return NZ($)}catch(Z){if($2(Z)==="ENOENT")return null;throw Z}}function l$($,Z){let Q=V0(a2($,Z));if(!wB(Q))return null;let z,X;try{z=j0(nB($)),X=j0(Q)}catch{return null}if(!c$(z,X)||t2(TZ(z,X)))return null;return X}var PZ=[];function nB($){let Z=V0($);return PZ.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(W8)?Q:Q+W8))??Z}function e2($,Z){PZ.push(V0($));try{return Z()}finally{PZ.pop()}}function I($,Z){return l$($,Z)!==null}function w($,Z){let Q=l$($,Z);if(Q===null)return null;try{return o2(Q).isFile()?NZ(Q,"utf-8"):null}catch{return null}}function I0($,Z){let Q=l$($,Z);if(Q===null)return null;try{return o2(Q)}catch{return null}}function k($,Z="."){let Q=l$($,Z);if(Q===null)return null;let z;try{z=EB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||l$($,a2(Z,X.name))!==null)}function rB($){try{let Z=o2($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if($2(Z)==="ENOENT")return;throw Z}}class W9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var _Z=($)=>new S("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function AZ($,Z,Q){if(Z!==void 0){let X=m0($),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 _Z($)}if(!Q)return;let z;try{z=o2($)}catch(X){if($2(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw _Z($);try{Q9($,z9.W_OK)}catch{throw _Z($)}}function sB($,Z){if(process.platform!=="win32")try{SB($,Z.uid,Z.gid)}catch{}X9($,Z.mode)}function oB($){if(process.platform==="win32")return;try{let Z=J9($,"r");try{H9(Z)}finally{FZ(Z)}}catch{}}function aB($,Z,Q,z){if($.fd=J9($.path,"wx",z??Q?.mode??438),$.created=!0,gB($.fd,Z),Q)sB($.fd,Q);if(z!==void 0)X9($.fd,z);H9($.fd),FZ($.fd),$.fd=void 0}function tB($){if($.fd!==void 0)try{FZ($.fd)}catch{}if($.created)try{G9($.path)}catch{}}function eB($,Z,Q){let z=L2($),X={path:a2(z,`.${e0($).slice(0,100)}.${process.pid}.${vB(6).toString("hex")}.faf-tmp`),created:!1},H=rB($);try{if(H)Q9($,z9.W_OK);aB(X,Z,H,Q.mode),AZ($,Q.expect,H),xB(X.path,$)}catch(U){if(tB(X),U instanceof S)throw U;let J=$2(U)??(U instanceof Error?U.message:String(U));throw new W9($,`${$}: not written${H?"; original kept":""} (${J})`,{cause:U})}oB(z)}function $q($){return $ instanceof S&&!$.onWrite?new S($.reason,$.path,$.message,{onWrite:!0}):$}function e($,Z,Q={}){let z=V0($),X;try{X=u(Q.root??L2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(H){throw $q(H)}return eB(X,Z,Q),X}function B9($,Z,Q){let z=V0($),X=Q.root??L2(z),H=u(X,z),U=m0(H);if(Q.expect!==void 0)AZ(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 e(H,Z,{root:X,expect:U})}function $$($,Z=$){let Q=V0($);U9(Q,{recursive:!0});let z=j0(Q),X=V0(Q,Z),H=TZ(Q,X);if(H===".."||H.startsWith(`..${W8}`)||V9(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 G=a2(U,J);if(t2(G))throw new S("git",X,`${X} runs through ${G}, inside .git/ — refused.`,{onWrite:!0});U=Zq(z,X,G)}return U}function Zq($,Z,Q){let z;try{z=RZ(Q)}catch(H){if($2(H)!=="ENOENT")throw H;return U9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=j0(Q)}catch{throw new S("dangling",Z,`${Q} is a link to ${Y9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!c$($,X))throw new S("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(t2(X))throw new S("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!o2(X).isDirectory())throw new S("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function Qq($,Z){let Q=V0($),z=j0(V0(Z.root??L2(Q))),X=j0(L2(Q));if(!c$(z,X))throw new S("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let H=a2(X,e0(Q));if(t2(H))throw new S("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let U;try{U=RZ(H)}catch(J){if($2(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 AZ(H,Z.expect,void 0),G9(H),!0}function f($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function d$($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if($===null||$===void 0)return"empty";if(typeof $==="string"){let Z=$.length>40?`${$.slice(0,40)}…`:$;return`a string (${JSON.stringify(Z)})`}if(typeof $==="object")return"a mapping";return`a ${typeof $} (${String($)})`}function B8($,Z){if($===null||$===void 0)return{};if(!f($))throw new S("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${d$($)}. `+"faf left it unchanged — fix it by hand.");return $}var O9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function q9($){return typeof $==="object"&&$.collection===void 0}function zq($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
|
|
143
|
-
`)||typeof $.value!=="number")return;let z=Z.find((
|
|
144
|
-
`)[0];throw Error(`${Z}: not valid YAML (${z}) — faf left it unchanged.`,{cause:Q.errors[0]})}return Q}function
|
|
145
|
-
`,Z-1)+1}function
|
|
142
|
+
`)}}var A6=($)=>$.startsWith("\uFEFF")?$.slice(1):$;function B4($){let Z={};for(let[Q,z]of Object.entries($.slots??{}))Z[eZ.get(Q)??Q]=z;return{...$,slots:Z}}function K4($){return B4(JSON.parse(d0().score_faf(A6($))))}function YX($){return B4(JSON.parse(d0().score_faf_enterprise(A6($))))}function GX($){return d0().validate_faf(A6($))}function WX($){return d0().compile_fafb(A6($))}function qX($){return JSON.parse(d0().decompile_fafb($))}function BX($){return JSON.parse(d0().fafb_info($))}function KX($){return B4(JSON.parse(d0().score_fafb($)))}function DX(){return d0().sdk_version()}var Q1=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;function z1($){let Z=$?.about?.represents;return typeof Z==="string"&&Z.length>0}function X1($){let Z=$.match(/^about:\s*\n((?:[ \t]+.*\n?)*)/m);if(!Z)return null;let Q=Z[1]??"",z=Q.match(/^[ \t]+represents:\s*(\S+)\s*$/m);if(!z)return null;let X=z[1],U=Q.match(/^[ \t]+source_score:\s*(\d+)\s*$/m),J=-1;if(U){let H=parseInt(U[1],10);if(H>=0&&H<=100)J=H}return{represents:X,sourceScore:J}}function LX($){return $.unknown?"unknown (—)":`${$.score}%`}function U1($){return{score:$.score,tier:C$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function L4($){let Z=X1($);if(Z){let Q=Z.sourceScore;return{score:Q,tier:Q>=0?C$(Q):u0[u0.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Z.represents,...Q<0?{unknown:!0}:{}}}return U1(K4($))}function MX($){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(!z1(Q)||typeof Q.about.represents!=="string")Z.push("about.represents is required (owner/repo of the source codebase)");else if(!Q1.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 zQ,realpathSync as gR}from"fs";import{join as ZQ,dirname as T8,basename as kR,resolve as H$,relative as hR,isAbsolute as uR,sep as mR}from"path";var wq=D5(),Sq=c$(),Eq=e4(),C5=d$(),bq=S$(),$2=x(),yq=s0(),xq=d(),gq=a0(),vq=t0(),_R=W8(),kq=N5(),hq=T5(),uq=A5(),D8=B9(),K9=j$();var mq=wq.Composer,L8=Sq.Document,fq=Eq.Schema,pq=C5.YAMLError,M8=C5.YAMLParseError,lq=C5.YAMLWarning,cq=bq.Alias,p0=$2.isAlias,I2=$2.isCollection,dq=$2.isDocument,l=$2.isMap,M0=$2.isNode,iq=$2.isPair,n=$2.isScalar,l0=$2.isSeq,nq=yq.Pair,rq=xq.Scalar,e2=gq.YAMLMap,a$=vq.YAMLSeq;var sq=kq.Lexer,oq=hq.LineCounter,aq=uq.Parser,I0=D8.parse,tq=D8.parseAllDocuments,Z2=D8.parseDocument,O2=D8.stringify,eq=K9.visit,$B=K9.visitAsync;import{accessSync as D9,closeSync as E5,constants as L9,existsSync as ZB,fchmodSync as M9,fchownSync as QB,fsyncSync as I9,lstatSync as b5,mkdirSync as O9,mkdtempSync as RR,openSync as _9,readdirSync as zB,readFileSync as y5,readlinkSync as XB,realpathSync as UB,renameSync as JB,rmSync as NR,statSync as $$,unlinkSync as P9,writeFileSync as HB}from"fs";import{randomBytes as VB}from"crypto";import{basename as Q2,dirname as _2,isAbsolute as F9,join as Z$,relative as x5,resolve as G0,sep as I8}from"path";class E extends Error{reason;path;onWrite;constructor($,Z,Q,z={}){super(Q,z.cause===void 0?void 0:{cause:z.cause});this.name="SafePathError",this.reason=$,this.path=Z,this.onWrite=z.onWrite===!0}}var t=Object.freeze({claude:"CLAUDE.md",agents:"AGENTS.md",gemini:"GEMINI.md",cursorrules:".cursorrules",copilot:"copilot-instructions.md",memory:"MEMORY.md",llms:"llms.txt"}),YB=new Set(Object.values(t).map(($)=>$.toLowerCase())),GB=($,Z)=>$.toLowerCase()===Z.toLowerCase(),j5=($)=>YB.has($.toLowerCase());function Q$($){return $.split(/[\\/]/).some((Z)=>Z.toLowerCase()===".git")}var WB=/\.fafm?$/i,qB=/^[a-z][a-z0-9-]*$/,S0=($)=>UB.native($),z2=($)=>$?.code;function e$($,Z){let Q=x5($,Z);return Q===""||Q!==".."&&!Q.startsWith(`..${I8}`)&&!F9(Q)}function R9($){try{return XB($)}catch{return"?"}}function BB($,Z,Q,z){let X;try{X=S0(Q)}catch(U){let J=z2(U);if(J==="ENOENT"||J==="ELOOP"||J==="ENOTDIR")throw new E("dangling",Z,`${Z} is a link to ${R9(Q)}, which does not exist. faf does not create files through a link — refused.`);throw U}if(!e$($,X))throw new E("outside",Z,`${Z} is a link to ${X}, outside ${$} — refused.`);if(Q$(X)&&!(z.inGit&&_2(X)===$))throw new E("git",Z,`${Z} is a link to ${X}, inside .git/ — refused.`);if(!$$(X).isFile())throw new E("not-a-file",Z,`${Z} is a link to ${X}, which is not a regular file — refused.`);return KB(Z,X,z.read),X}function KB($,Z,Q){let z=Q2($),X=Q2(Z),U=j5(z)&&j5(X);if(Q&&!WB.test(X)&&!U){let J=j5(z)?"a .faf or .fafm file, nor another AI context file":"a .faf or .fafm file";throw new E("not-faf",$,`${$} is a link to ${Z}, which is not ${J} — refused.`)}if(!Q&&!GB(z,X)&&!U)throw new E("other-file",$,`${$} is a link to ${Z}, a file with another name — refused (faf follows a link only to a file of the same name, or from one AI context file to another).`)}function DB($,Z,Q,z){if(Q2(G0($))!=="hooks"||!qB.test(Q2(Z)))throw new E("git",Z,`${Z} is not a git hook in a hooks folder — refused.`);if(z!==Q)throw new E("git",Z,`${Z} is not directly in the hooks folder ${Q} — refused.`)}function LB($,Z,Q){if(Q2($)!=="config"||Q!==Z)throw new E("git",$,`${$} is not the git config file directly in ${Z} — refused.`)}function h($,Z,Q={}){let z=S0(G0($)),X=G0($,Z),U=S0(_2(X));if(!e$(z,U))throw new E("outside",X,`${X} is in ${U}, outside ${z} — refused.`);let J=Q.allowGitHooks===!0,H=Q.allowGitConfig===!0;if(J)DB($,X,z,U);if(H)LB(X,z,U);let V=Z$(U,Q2(X));if(Q$(V)&&!J&&!H)throw new E("git",X,V===X?`${X} is inside .git/ — refused.`:`${X} resolves to ${V}, inside .git/ — refused.`);let Y;try{Y=b5(V)}catch(G){if(z2(G)==="ENOENT")return V;throw G}if(Y.isSymbolicLink())return BB(z,X,V,{read:Q.read===!0,inGit:J||H});if(!Y.isFile())throw new E("not-a-file",X,`${X} is not a regular file — refused.`);return S0(V)}var MB=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function IB($,Z){if(!($.length>=2&&($[0]===255&&$[1]===254||$[0]===254&&$[1]===255)))try{return MB.decode($)}catch{}throw new E("not-utf8",Z,`${Z} is not UTF-8 — faf left it unchanged`)}function Q0($){return IB(y5($),$)}function E0($){try{return y5($)}catch(Z){if(z2(Z)==="ENOENT")return null;throw Z}}function t$($,Z){let Q=G0(Z$($,Z));if(!ZB(Q))return null;let z,X;try{z=S0(OB($)),X=S0(Q)}catch{return null}if(!e$(z,X)||Q$(x5(z,X)))return null;return X}var S5=[];function OB($){let Z=G0($);return S5.find((Q)=>Z===Q||Z.startsWith(Q.endsWith(I8)?Q:Q+I8))??Z}function z$($,Z){S5.push(G0($));try{return Z()}finally{S5.pop()}}function M($,Z){return t$($,Z)!==null}function w($,Z){let Q=t$($,Z);if(Q===null)return null;try{return $$(Q).isFile()?y5(Q,"utf-8"):null}catch{return null}}function O0($,Z){let Q=t$($,Z);if(Q===null)return null;try{return $$(Q)}catch{return null}}function v($,Z="."){let Q=t$($,Z);if(Q===null)return null;let z;try{z=zB(Q,{withFileTypes:!0})}catch{return null}return z.filter((X)=>!X.isSymbolicLink()||t$($,Z$(Z,X.name))!==null)}function _B($){try{let Z=$$($);return{mode:Z.mode&511,perm:Z.mode&4095,uid:Z.uid,gid:Z.gid}}catch(Z){if(z2(Z)==="ENOENT")return;throw Z}}class N9 extends Error{path;constructor($,Z,Q={}){super(Z,{cause:Q.cause});this.path=$}}var w5=($)=>new E("changed",$,`${$} changed on disk while faf was writing — not written; original kept`,{onWrite:!0});function g5($,Z,Q){if(Z!==void 0){let X=E0($),U=Z===null?null:typeof Z==="string"?Buffer.from(Z,"utf-8"):Buffer.from(Z);if(!(X===null||U===null?X===U:X.equals(U)))throw w5($)}if(!Q)return;let z;try{z=$$($)}catch(X){if(z2(X)==="ENOENT")return;throw X}if((z.mode&4095)!==Q.perm)throw w5($);try{D9($,L9.W_OK)}catch{throw w5($)}}function PB($,Z){if(process.platform!=="win32")try{QB($,Z.uid,Z.gid)}catch{}M9($,Z.mode)}function FB($){if(process.platform==="win32")return;try{let Z=_9($,"r");try{I9(Z)}finally{E5(Z)}}catch{}}function RB($,Z,Q,z){if($.fd=_9($.path,"wx",z??Q?.mode??438),$.created=!0,HB($.fd,Z),Q)PB($.fd,Q);if(z!==void 0)M9($.fd,z);I9($.fd),E5($.fd),$.fd=void 0}function NB($){if($.fd!==void 0)try{E5($.fd)}catch{}if($.created)try{P9($.path)}catch{}}function TB($,Z,Q){let z=_2($),X={path:Z$(z,`.${Q2($).slice(0,100)}.${process.pid}.${VB(6).toString("hex")}.faf-tmp`),created:!1},U=_B($);try{if(U)D9($,L9.W_OK);RB(X,Z,U,Q.mode),g5($,Q.expect,U),JB(X.path,$)}catch(J){if(NB(X),J instanceof E)throw J;let H=z2(J)??(J instanceof Error?J.message:String(J));throw new N9($,`${$}: not written${U?"; original kept":""} (${H})`,{cause:J})}FB(z)}function AB($){return $ instanceof E&&!$.onWrite?new E($.reason,$.path,$.message,{onWrite:!0}):$}function e($,Z,Q={}){let z=G0($),X;try{X=h(Q.root??_2(z),z,{allowGitHooks:Q.allowGitHooks,allowGitConfig:Q.allowGitConfig})}catch(U){throw AB(U)}return TB(X,Z,Q),X}function T9($,Z,Q){let z=G0($),X=Q.root??_2(z),U=h(X,z),J=E0(U);if(Q.expect!==void 0)g5(U,Q.expect,void 0);if(J!==null&&Q.force!==!0&&!Q.owns(J))throw new E("not-owned",z,`${z} has no ${Q.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});return e(U,Z,{root:X,expect:J})}function X$($,Z=$){let Q=G0($);O9(Q,{recursive:!0});let z=S0(Q),X=G0(Q,Z),U=x5(Q,X);if(U===".."||U.startsWith(`..${I8}`)||F9(U))throw new E("outside",X,`${X} is outside ${z} — refused.`,{onWrite:!0});let J=z;for(let H of U.split(/[\\/]/).filter(Boolean)){let V=Z$(J,H);if(Q$(V))throw new E("git",X,`${X} runs through ${V}, inside .git/ — refused.`,{onWrite:!0});J=CB(z,X,V)}return J}function CB($,Z,Q){let z;try{z=b5(Q)}catch(U){if(z2(U)!=="ENOENT")throw U;return O9(Q),Q}let X=Q;if(z.isSymbolicLink()){try{X=S0(Q)}catch{throw new E("dangling",Z,`${Q} is a link to ${R9(Q)}, which does not exist. faf does not create folders through a link — refused.`,{onWrite:!0})}if(!e$($,X))throw new E("outside",Z,`${Q} is a link to ${X}, outside ${$} — refused.`,{onWrite:!0});if(Q$(X))throw new E("git",Z,`${Q} is a link to ${X}, inside .git/ — refused.`,{onWrite:!0})}if(!$$(X).isDirectory())throw new E("not-a-file",Z,`${Q} is not a folder — refused.`,{onWrite:!0});return X}function jB($,Z){let Q=G0($),z=S0(G0(Z.root??_2(Q))),X=S0(_2(Q));if(!e$(z,X))throw new E("outside",Q,`${Q} is in ${X}, outside ${z} — refused.`,{onWrite:!0});let U=Z$(X,Q2(Q));if(Q$(U))throw new E("git",Q,`${Q} is inside .git/ — refused.`,{onWrite:!0});let J;try{J=b5(U)}catch(H){if(z2(H)==="ENOENT")return!1;throw H}if(!J.isFile())throw new E("not-a-file",Q,`${Q} is not a regular file faf wrote — left as it is.`,{onWrite:!0});return g5(U,Z.expect,void 0),P9(U),!0}function k($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function U$($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if($===null||$===void 0)return"empty";if(typeof $==="string"){let Z=$.length>40?`${$.slice(0,40)}…`:$;return`a string (${JSON.stringify(Z)})`}if(typeof $==="object")return"a mapping";return`a ${typeof $} (${String($)})`}function O8($,Z){if($===null||$===void 0)return{};if(!k($))throw new E("not-yaml",Z,`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${U$($)}. `+"faf left it unchanged — fix it by hand.");return $}var E9=new Set(["tag:yaml.org,2002:int","tag:yaml.org,2002:float"]);function A9($){return typeof $==="object"&&$.collection===void 0}function wB($,Z){let Q=$.source;if(typeof Q!=="string"||Q.includes(`
|
|
143
|
+
`)||typeof $.value!=="number")return;let z=Z.find((U)=>U.default===!0&&U.test?.test(Q));if(!z||!E9.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 SB($){let Z=$.filter(A9);return $.map((Q)=>{if(!A9(Q)||!E9.has(Q.tag)||!Q.stringify)return Q;let z=Q.stringify;return{...Q,stringify:(X,U,J,H)=>wB(X,Z)??z(X,U,J,H)}})}var _8={keepSourceTokens:!0,customTags:SB};function EB($,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 bB($){let Z=$.split(/\r?\n/),Q,z;for(let X=0;X+1<Z.length;X++){let U=EB(Z[X],Z[X+1]);Q??=U.indent,z??=U.indentSeq}return{indent:Q??2,indentSeq:z??!0}}function m5($,Z){let Q=Z2($,_8);if(Q.errors.length>0){let z=Q.errors[0].message.split(`
|
|
144
|
+
`)[0];throw Error(`${Z}: not valid YAML (${z}) — faf left it unchanged.`,{cause:Q.errors[0]})}return Q}function P2($,Z,Q,z){$.edits.push({start:Z,end:Q,text:z,seq:$.edits.length})}function $6($,Z){return $.lastIndexOf(`
|
|
145
|
+
`,Z-1)+1}function b9($,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
|
|
149
|
-
`),
|
|
150
|
-
${
|
|
151
|
-
`)?void 0:Z.comment}function
|
|
152
|
-
`).map((
|
|
153
|
-
`);
|
|
154
|
-
`)?$.eol:"",X=Z.commentBefore?$.eol:"";return
|
|
147
|
+
`,Z);return Q<0?$.length:Q+1}function C9($,Z){let Q=Z;if($[Q-1]===`
|
|
148
|
+
`){if(Q--,$[Q-1]==="\r")Q--}return Q}function _0($){return $!==null&&$!==void 0}function X0($){let Z=M0($)?$.range:void 0;return Z?[Z[0],Z[1],Z[2]]:void 0}function y9($,Z){let Q=X0($),z=X0(Z);return!!Q&&!!z&&Q[0]===z[0]&&Q[1]===z[1]&&Q[2]===z[2]&&$.constructor===Z.constructor}function x9($){if(n($))return $.type==="BLOCK_LITERAL"||$.type==="BLOCK_FOLDED";return I2($)&&!$.flow}function P8($,Z){return $.anchor===Z.anchor&&$.tag===Z.tag&&$.comment===Z.comment&&$.commentBefore===Z.commentBefore&&!!$.spaceBefore===!!Z.spaceBefore}function g9($,Z){return Object.is($.value,Z.value)&&$.type===Z.type&&$.format===Z.format&&$.minFractionDigits===Z.minFractionDigits&&P8($,Z)}function v9($,Z,Q,z){let X=new L8(void 0,_8);X.contents=Z(X);let J=X.toString($.piece).replace(/\n+$/,"").slice(Q),H=J.startsWith(" ")&&!J.includes(`
|
|
149
|
+
`),V=" ".repeat(z),Y=J.replace(/\n(?=.)/g,`
|
|
150
|
+
${V}`).replace(/\n/g,$.eol);return{inline:H,text:H?J.slice(1):Y}}function k5($,Z,Q){return v9($,(z)=>{let X=new e2;return X.items.push(z.createPair("k",Z)),X},2,Q)}function yB($,Z,Q){let z=v9($,()=>{let X=new a$;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 xB($){if(!M0($)||!_0($.comment))return $;let Z=$.clone();return Z.comment=void 0,Z}function gB($,Z){if(!M0($)||!M0(Z))return Z;let Q=$,z=Z;if(!Q.anchor&&!Q.tag||Q.anchor!==z.anchor||Q.tag!==z.tag)return Z;let X=Z.clone();return X.anchor=void 0,X.tag=void 0,X}function vB($,Z){let Q=X0(Z);if(!Q)return-1;let z=Q[2];while($[z]===" "||$[z]==="\t")z++;return $[z]===":"?z+1:-1}function kB($,Z,Q){let z=$[Z-1]===" "||$[Z-1]==="\t"?"":" ",X=$[Z]==="#"?" ":"";return`${z}${Q}${X}`}function j9($,Z,Q,z,X=!1){let U=X0(Z);if(!U||z.kind==="root")return null;let J=Z.comment,H=M0(Q)?Q.comment:void 0,V=!_0(J)||J===H,Y=V?xB(Q):Q,G=X?Y:gB(Z,Y),W=z.kind==="value"?k5($,G,z.col):yB($,G,z.col);return W?{range:U,keepTail:V,newComment:H,piece:W}:null}function hB($,Z,Q,z){if(!z)return C9($,b9($,Q[2]));return x9(Z)?C9($,Q[1]):Q[1]}function Z6($,Z,Q,z,X){let U=j9($,Z,Q,z);if(!U)return!1;let J=hB($.src,Z,U.range,U.keepTail);if(U.piece.inline&&(!x9(Z)||z.kind==="item"))return uB($,U,J,z,X),!0;let H=U.keepTail?Z.comment:U.newComment;if(X!==void 0||_0(H))return!1;let V=z.kind==="value"?j9($,Z,Q,z,!0):U;return V!==null&&mB($,V.range[0],J,V.piece,z)}function uB($,Z,Q,z,X){let[U,J]=Z.range,V=U===J&&z.kind==="value"?kB($.src,U,Z.piece.text):Z.piece.text;P2($,U,Q,V+(X===void 0?"":` #${X}`))}function mB($,Z,Q,z,X){if(X.kind==="item")return P2($,Z,Q,z.text),!0;if(X.kind!=="value")return!1;let U=vB($.src,X.key);if(U<0)return!1;return P2($,U,Q,z.inline?` ${z.text}`:z.text),!0}function fB($,Z){return P8({...$,comment:void 0},{...Z,comment:void 0})}function pB($,Z){if(_0($.comment)||typeof Z.comment!=="string")return;return Z.comment.includes(`
|
|
151
|
+
`)?void 0:Z.comment}function lB($,Z,Q,z){if(g9(Z,Q))return!0;if(!fB(Z,Q))return!1;let X=pB(Z,Q);if(Z.comment!==Q.comment&&X===void 0)return!1;return Z6($,Z,Q,z,X)}function cB($,Z,Q,z){if(!P8(Z,Q)||!!Z.flow!==!!Q.flow)return!1;if(Z.flow)return k5($,Z,0).text===k5($,Q,0).text||Z6($,Z,Q,z);if(Q.items.length===0)return Z6($,Z,Q,z);return l(Z)?rB($,Z,Q):oB($,Z,Q)}function f5($,Z,Q,z){if(!y9(Z,Q))return Z6($,Z,Q,z);if(n(Z))return lB($,Z,Q,z);if(p0(Z))return p0(Q)&&Z.source===Q.source&&P8(Z,Q)||Z6($,Z,Q,z);if(!I2(Z)||!I2(Q))return!1;return cB($,Z,Q,z)}function k9($,Z){return Z-$6($,Z)}function p5($,Z,Q){let z=$.slice($6($,Z),Z);return Q?/^ *- +$/.test(z)||/^ *$/.test(z):/^ *$/.test(z)}function h5($){return M0($)&&(_0($.commentBefore)||!!$.spaceBefore)}function l5($,Z,Q){let z=X0(Z)??X0(Q);return z?b9($.src,z[2]):-1}function h9($,Z,Q){let z=new L8(void 0,_8);z.contents=Z;let X=" ".repeat(Q);return z.toString($.piece).replace(/\n+$/,"").split(`
|
|
152
|
+
`).map((J)=>J?X+J:J).join($.eol)+$.eol}function dB($,Z,Q){let z=Z===$.src.length&&Z>0&&!$.src.endsWith(`
|
|
153
|
+
`);P2($,Z,Z,z?$.eol+Q.slice(0,-$.eol.length):Q)}function u9($,Z,Q,z,X,U){let J=Q;if(J<0){let H=X0(Z);if(!H||h5(Z)||!p5($.src,H[0],U))return!1;J=$6($.src,H[0])}return dB($,J,h9($,z,X)),!0}function iB($,Z,Q){let z=$6($,Q),X=Z,U=_0(X.commentBefore),J=!!X.spaceBefore;while(z>0){let H=$6($,z-1),V=$.slice(H,z).trim();if(U&&V.startsWith("#"))z=H;else if(J&&V==="")z=H,J=!1;else break}return z}function m9($,Z,Q,z){let X=X0(Z);if(!X||!p5($.src,X[0],z))return!1;let U=l5($,Q,Z);if(U<0)return!1;return P2($,iB($.src,Z,X[0]),U,""),!0}function f9($,Z){let Q=new Map,z=(X)=>{let U=X0(X);return U?U.join(":"):void 0};return $.forEach((X,U)=>{let J=z(Z(X));if(J!==void 0&&!Q.has(J))Q.set(J,U)}),(X)=>{let U=z(Z(X)),J=U===void 0?void 0:Q.get(U);return J!==void 0&&y9(Z($[J]),Z(X))?J:-1}}function nB($,Z){return n($)&&n(Z)?g9($,Z):$===Z}function rB($,Z,Q){let z=Z.items[0]?.key,X=X0(z);if(!X)return!1;let U=k9($.src,X[0]),J=new Set,H=(W,q)=>{if(W.length===0)return!0;let K=new e2;K.items.push(...W);let D=q<0?-1:l5($,Z.items[q].value,Z.items[q].key);return u9($,z,D,K,U,!1)},V=f9(Z.items,(W)=>W.key),Y=-1,G=[];for(let W of Q.items){let q=V(W);if(q<0){G.push(W);continue}if(q<=Y||!H(G,Y)||!nB(Z.items[q].key,W.key))return!1;if(G=[],!f5($,Z.items[q].value,W.value,{kind:"value",key:Z.items[q].key,col:U}))return!1;J.add(q),Y=q}if(!H(G,Y))return!1;return Z.items.every((W,q)=>J.has(q)||sB($,Z,q))}function sB($,Z,Q){let z=Z.items[Q],X=X0(z.key);if(!X)return!1;if(p5($.src,X[0],!1))return m9($,z.key,z.value,!1);let U=Z.items[Q+1],J=X0(U?.key);if(Q!==0||!J||h5(z.key)||h5(U.key))return!1;return P2($,X[0],J[0],""),!0}function oB($,Z,Q){let z=X0(Z);if(!z||Z.items.length===0)return!1;let X=k9($.src,z[0]),U=new Set,J=(G,W)=>{if(G.length===0)return!0;let q=new a$;q.items.push(...G);let K=W<0?-1:l5($,Z.items[W]);return u9($,Z.items[0],K,q,X,!0)},H=f9(Z.items,(G)=>G),V=-1,Y=[];for(let G of Q.items){let W=H(G);if(W<0){Y.push(G);continue}if(W<=V||!J(Y,V))return!1;if(Y=[],!f5($,Z.items[W],G,{kind:"item",col:X}))return!1;U.add(W),V=W}if(!J(Y,V))return!1;return Z.items.every((G,W)=>U.has(W)||m9($,G,G,!0))}function aB($,Z){let Q=[...Z].sort((U,J)=>J.start-U.start||J.end-U.end||J.seq-U.seq),z=$,X=1/0;for(let U of Q){if(U.end>X)return null;z=z.slice(0,U.start)+U.text+z.slice(U.end),X=U.start}return z}function tB($,Z,Q){if(!l(Q)&&!l0(Q))return!1;let z=$.src.length>0&&!$.src.endsWith(`
|
|
154
|
+
`)?$.eol:"",X=Z.commentBefore?$.eol:"";return P2($,$.src.length,$.src.length,z+X+h9($,Q,0)),!0}function eB($,Z,Q){if(Z.commentBefore!==Q.commentBefore||Z.comment!==Q.comment)return!1;let z=Z.contents,X=Q.contents;if(!_0(z))return!_0(X)||tB($,Z,X);return _0(X)&&f5($,z,X,{kind:"root"})}function $K($,Z,Q,z,X){let U={src:$,eol:z,edits:[],piece:X};if(!eB(U,Z,Q))return null;return aB($,U.edits)}var w9=($)=>$.replace(/^[ \t]*\n/gm,"");function ZK($,Z,Q,z){let X=Z2($,_8);if(X.errors.length>0||!c(X.toJS(),Z.toJS()))return!1;let U=X.toString(z);return U===Q||w9(U)===w9(Q)}function F8($,Z,Q="YAML"){let{text:z,changed:X}=QK($,Z,Q);return{text:z,changed:X}}function QK($,Z,Q="YAML"){let z=$.startsWith("\uFEFF")?"\uFEFF":"",X=$.slice(z.length),U=m5(X,Q),J=zK(U);Z(J);let H={text:$,changed:!1,spliced:!1};if(c(J.toJS(),U.toJS()))return H;let V={lineWidth:0,...bB(X)},Y=J.toString(V);if(Y===U.toString(V))return H;let G=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=
|
|
161
|
-
`,"\r"]);class
|
|
157
|
+
`,W=$K(X,U,J,G,{...V,verifyAliasOrder:!1}),q=W!==null&&ZK(W,J,Y,V),K=q&&W!==null?W:Y.replace(/\r?\n/g,G);return{text:z+K,changed:z+K!==$,spliced:q}}function zK($){let Z=$.clone();if($.directives&&Z.directives)Z.directives.docEnd=$.directives.docEnd;return Z}function c($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>c(Q,Z[z]));if(k($)&&k(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&c($[z],Z[z]))}return!1}function z6($){let Z=n($.key)?$.key.value:$.key;return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"?String(Z):void 0}function X2($,Z){return $.items.find((Q)=>z6(Q)===Z)}function p9($,Z){return M0(Z)?Z.toJS($):Z}function XK($,Z,Q,z){return z.keepAliases===!0&&p0(Z)||c(p9($,Z),Q)}function R8($,Z,Q,z={}){if(XK($,Z,Q,z))return Z;if(k(Q)&&l(Z))return JK($,Z,Q,z),Z;if(Array.isArray(Q)&&l0(Z))return YK($,Z,Q,z),Z;if(!k(Q)&&!Array.isArray(Q)&&n(Z))return Z.value=Q,Z;return UK(Z,$.createNode(Q))}function UK($,Z){if(!n($)&&!p0($))return Z;let Q=$,z=Z;if(I2(Z)&&Z.items.length>0&&!Z.flow)return z.commentBefore=v5(z.commentBefore,Q.commentBefore,Q.comment),Z;if(I2(Z))Z.flow=!0;return z.comment=v5(z.comment??Q.comment),z.commentBefore=v5(z.commentBefore??Q.commentBefore),Z}function v5(...$){let Z=$.filter(_0);return Z.length>0?Z.join(`
|
|
158
|
+
`):void 0}function JK($,Z,Q,z={}){for(let[X,U]of Object.entries(Q)){if(U===void 0)continue;let J=X2(Z,X);if(J)J.value=R8($,J.value,U,z);else Z.items.push($.createPair(X,U))}if(!z.prune)return;Z.items=Z.items.filter((X)=>{let U=z6(X);return U===void 0||Q[U]!==void 0})}function c5($,Z,Q,z){let X=k(Q)?Q:{};for(let[U,J]of Object.entries(z)){if(J===void 0)continue;let H=X2(Z,U);if(!H)Z.items.push($.createPair(U,J));else if(Object.prototype.hasOwnProperty.call(X,U)&&c(X[U],J))continue;else if(k(J)&&k(X[U])&&l(H.value))c5($,H.value,X[U],J);else H.value=R8($,H.value,J,{keepAliases:!0})}}function Q6($,Z,Q){if(p0($))Q.push({path:[...Z],node:$});else if(l($))for(let z of $.items){let X=z6(z);if(X!==void 0)Q6(z.value,[...Z,X],Q)}else if(l0($))$.items.forEach((z,X)=>Q6(z,[...Z,X],Q))}function S9($,Z){let Q=$;for(let z of Z)if(Array.isArray(Q)&&typeof z==="number")Q=Q[z];else if(k(Q)&&typeof z==="string")Q=Q[z];else return;return Q}function l9($,Z,Q){let z=[];return Q6($.contents,[],z),z.filter(({path:X,node:U})=>{let J=S9(Z,X);return J!==void 0&&!c(S9(Q,X),J)&&!c(U.toJS($),J)}).map(({path:X,node:U})=>({path:X.join("."),alias:`*${U.source}`}))}function c9($,Z){let Q=$.contents;for(let X=0;X<Z.length-1&&Q!==void 0;X++)Q=HK(Q,Z[X]);let z=Z[Z.length-1];if(l(Q)&&typeof z==="string"){let X=X2(Q,z);return X?{node:X.value,put:(U)=>(X.value=U,!0)}:null}if(l0(Q)&&typeof z==="number"&&z<Q.items.length){let X=Q,U=X.items[z];return{node:U,put:(J)=>X0(U)===void 0?(X.items[z]=J,!0):!1}}return null}function HK($,Z){if(l($)&&typeof Z==="string")return X2($,Z)?.value;if(l0($)&&typeof Z==="number")return $.items[Z];return}function d9($,Z){let Q=[];Q6($.contents,[],Q);let z=[];for(let{path:X,node:U}of Q){let J=c9(Z,X);if(!J||p0(J.node)&&J.node.source===U.source)continue;if(!J.put(U.clone()))continue;z.push({path:X.join("."),alias:`*${U.source}`})}return z}function u5($,Z,Q,z){if(!M0($)||p0($))return;let X=$.anchor;if(X&&Q.has(X))z.push({path:[...Z],node:$});if(l($))for(let U of $.items){let J=z6(U);if(J!==void 0)u5(U.value,[...Z,J],Q,z)}else if(l0($))$.items.forEach((U,J)=>u5(U,[...Z,J],Q,z))}function i9($,Z){let Q=[];Q6($.contents,[],Q);let z=new Set(Q.map((J)=>J.node.source));if(z.size===0)return[];let X=[];u5($.contents,[],z,X);let U=[];for(let{path:J,node:H}of X){let V=c9(Z,J);if(!V)continue;let Y=H.anchor;if(M0(V.node)&&V.node.anchor===Y&&c(H.toJS($),V.node.toJS(Z))||!V.put(H.clone()))continue;U.push({path:J.join("."),alias:`&${Y}`,kind:"anchor"})}return U}function VK($,Z){let Q=$.length,z=Z.length,X=Array.from({length:Q+1},()=>Array(z+1).fill(0));for(let J=Q-1;J>=0;J--)for(let H=z-1;H>=0;H--)X[J][H]=c($[J],Z[H])?X[J+1][H+1]+1:Math.max(X[J+1][H],X[J][H+1]);let U=[];for(let J=0,H=0;J<Q&&H<z;)if(c($[J],Z[H]))U.push([J,H]),J++,H++;else if(X[J+1][H]>=X[J][H+1])J++;else H++;return U}function YK($,Z,Q,z){let X=Z.items,U=X.map((Y)=>p9($,Y)),J=[],H=0,V=0;for(let[Y,G]of[...VK(U,Q),[X.length,Q.length]]){for(;H<Y&&V<G;H++,V++)J.push(R8($,X[H],Q[V],z));for(;V<G;V++)J.push($.createNode(Q[V]));if(Y<X.length)J.push(X[Y]);H=Y+1,V=G+1}Z.items=J}function X6($,Z,Q,z){if(c(Q,z))return Z;if(!k(Q)||!k(z)||!l(Z))return R8($,Z,z);let X=new Set(Object.keys(Q).filter((U)=>!(U in z)||z[U]===void 0));Z.items=Z.items.filter((U)=>{let J=z6(U);return J===void 0||!X.has(J)});for(let[U,J]of Object.entries(z)){if(J===void 0)continue;let H=X2(Z,U);if(!H)Z.items.push($.createPair(U,J));else if(!c(Q[U],J))H.value=X6($,H.value,Q[U],J)}return Z}function n9($,Z,Q){let z=$.contents;if(z===null||z===void 0)$.contents=new e2,z=$.contents;if(!l(z))throw Error(`${Q}: the document is not a mapping — faf left it unchanged.`);let X=z;for(let U of Z){let J=X2(X,U);if(J&&l(J.value)){X=J.value;continue}if(J&&!o9(J.value))throw Error(`${Q}: ${U} is not a mapping — faf left it unchanged.`);let H=new e2;if(J)J.value=s9(J.value,H);else X.items.push($.createPair(U,H));X=H}return X}function N8($,Z,Q,z,X){if(c(Q,z))return;let U=n9($,Z.slice(0,-1),X),J=Z[Z.length-1],H=X2(U,J);if(z===void 0)U.items=U.items.filter((V)=>V!==H);else if(!H)U.items.push($.createPair(J,z));else H.value=X6($,H.value,Q,z)}function r9($,Z,Q){let z=n9($,Z.slice(0,-1),Q),X=Z[Z.length-1],U=X2(z,X);if(U&&l0(U.value))return U.value;if(U&&!o9(U.value))throw Error(`${Q}: ${Z.join(".")} is not a list — faf left it unchanged.`);let J=new a$;if(U)U.value=s9(U.value,J);else z.items.push($.createPair(X,J));return J}function s9($,Z){if(!n($))return Z;let Q=[$.commentBefore,$.comment].filter(_0);if(Q.length>0)Z.commentBefore=Q.join(`
|
|
159
|
+
`);return Z}function o9($){if($===null||$===void 0)return!0;return n($)&&($.value===null||$.value===void 0)}var d5=new WeakMap;function c0($){return typeof $==="object"&&$!==null?d5.get($):void 0}function J$($,Z){d5.set($,Z)}function a9($,Z){let Q=c0($);if(Q)d5.set(Z,Q);return Z}var t9=new WeakSet;function e9($){return t9.add($),$}function $Q($){return typeof $==="object"&&$!==null&&t9.has($)}function A8($){let Z=H$($);return h(T8(Z),Z,{read:!0})}function i5($){return $ instanceof ReferenceError&&/Excessive alias count/.test($.message)}function XQ($){if($ instanceof M8||i5($))return $;let Z=$?.cause;return Z instanceof M8||i5(Z)?Z:null}function UQ($,Z){let Q=i5(Z)?"its aliases expand too far":Z.message.split(`
|
|
160
|
+
`)[0].replace(/ at line \d+, column \d+:?\s*$/,"").replace(/:\s*$/,""),z=Z.linePos?.[0]?.line,X=H$($);return new E("not-yaml",X,`${X} is not valid YAML (${Q}${z===void 0?"":`, line ${z}`}) — faf left it unchanged`,{cause:Z})}function GK($){let Z=A8($),Q=Q0(Z),z;try{z=I0(Q)}catch(U){let J=XQ(U);if(J)throw UQ($,J);throw U}let X=O8(z,$);return J$(X,{real:Z,text:Q}),X}function JQ($){let Z=$._meta,Q={...$};delete Q._meta;let z=O2(Q,{lineWidth:0});if(Z?.found&&Z.found.length>0){let X=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(U,J,H)=>{if(H.includes("#"))return U;return`${J} # found: ${X}`})}return z}function WK($,Z){return HQ($,Z,void 0)}function HQ($,Z,Q,z,X=!1){let U=A8($),J=Q0(U),H=[],V;try{V=F8(J,(Y)=>{VQ(Y,$);let G=Y.clone();if(Z(Y),H=d9(G,Y),X)H=[...H,...i9(G,Y)];if(z)H=[...H,...z(Y,G.toJS()).filter((W)=>!H.some((q)=>q.path===W.path))]},$)}catch(Y){let G=XQ(Y);if(G)throw UQ($,G);throw Y}if(!V.changed)return{written:!1,text:J,keptAliases:H};return e($,V.text,{expect:Q&&Q.real===U?Q.text:J}),{written:!0,text:V.text,keptAliases:H}}function qK(){return new Date().toISOString().replace(/[:.]/g,"-")}function BK($){if(!n5($))return null;let Z=H$($),Q=E0(h(T8(Z),Z));if(!Q)return null;let z=`${Z}.bak-${qK()}`;return e(z,Q),z}function n5($){try{return zQ($),!0}catch{return!1}}function KK($){let Z=$.getIn(["project","type"],!0);return n(Z)?Z.value:Z}function VQ($,Z){let Q=$.contents;if(Q!==null&&Q!==void 0&&!l(Q))throw new E("not-yaml",H$(Z),`${Z}: a .faf must be a YAML mapping (key: value pairs), but this one is ${U$($.toJS())}. faf left it unchanged — fix it by hand.`)}function DK($,Z,Q){VQ($,Q);let z=$.contents,X=l(z)&&z.items.some((G)=>n(G.key)&&G.key.value==="_meta"),{_meta:U,...J}=Z,H=KK($),V=l(z)?$.toJS():{},Y=l(z)?z:$.createNode({});if($.contents=Y,c5($,Y,V,X?{...Z}:J),!X)MK($,U?.found,H)}function LK($,Z){let Q=$.contents;if(l(Q)&&Q.items.some((U)=>n(U.key)&&U.key.value==="_meta"))return Z;let{_meta:z,...X}=Z;return X}function MK($,Z,Q){if(!Z||Z.length===0||!m(Q))return;let z=$.getIn(["project","type"],!0);if(n(z)&&!m(z.value)&&(z.comment===null||z.comment===void 0))z.comment=` found: ${Z.join(" + ")}`}function IK($,Z,Q={}){if(!Q.replace&&n5($)){let V=HQ($,(Y)=>DK(Y,Z,$),c0(Z),(Y,G)=>l9(Y,LK(Y,Z),G),$Q(Z));J$(Z,{real:A8($),text:V.text});for(let Y of V.keptAliases??[])Q.onAliasKept?.(Y);return V.written}let z=H$($),X=BK($);if(X)Q.onReplacedBackup?.(X);let U=JQ(Z),J=X&&n5($)?E0(h(T8(z),z)):null,H=e($,U,{expect:J});return J$(Z,{real:H,text:U}),!0}function YQ($){return Q0(A8($))}function QQ($,Z){let Q;try{Q=zQ(Z)}catch{return!1}if(!Q.isSymbolicLink()&&!Q.isFile())return!1;return h($,H$(Z),{read:!0}),!0}function GQ($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let X=ZQ($,z);if(QQ($,X))return X}let Q=T8($);if(Q!==$)for(let z of Z){let X=ZQ(Q,z);if(QQ(Q,X))return X}return null}import{statSync as WQ}from"fs";import{homedir as OK}from"os";import{parse as _K,resolve as qQ}from"path";function BQ($,Z){try{let Q=WQ($,{bigint:!0}),z=WQ(Z,{bigint:!0});return Q.isDirectory()&&Q.ino!==0n&&Q.dev===z.dev&&Q.ino===z.ino}catch{return!1}}function PK($){let Z=qQ($),Q=qQ(OK()),z=_K(Z).root;if(Z===Q)return"home";if(Z===z||Z==="/"||/^[A-Za-z]:[\\/]?$/.test(Z))return"root";if(BQ(Z,Q))return"home";if(BQ(Z,z))return"root";return null}function FK($=process.cwd()){return PK($)!==null}import{existsSync as RK,statSync as KQ}from"fs";import{dirname as NK,join as TK}from"path";var AK=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"],CK=1000;function jK($,Z=NK($)){let Q=KQ($).mtimeMs,z=AK.map((X)=>{let U=TK(Z,X);if(!RK(U))return{file:X,exists:!1,mtime_ms:null,status:"missing",delta_ms:null};let J=KQ(U).mtimeMs,H=J-Q,V;if(Math.abs(H)<CK)V="in-sync";else if(H>0)V="newer";else V="older";return{file:X,exists:!0,mtime_ms:J,status:V,delta_ms:H}});return{source:$,source_mtime_ms:Q,targets:z,drifted:z.filter((X)=>X.status==="newer"||X.status==="older").length,in_sync:z.filter((X)=>X.status==="in-sync").length,missing:z.filter((X)=>X.status==="missing").length}}import{join as rK}from"path";import{deprecate as sK}from"node:util";import{createHash as xK}from"crypto";import{resolve as gK}from"path";class F2 extends Error{constructor($){super($);this.name="JsonEditError"}}var wK=new Set([" ","\t",`
|
|
161
|
+
`,"\r"]);class o5{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 F2(`not valid JSON (${$} at offset ${this.i})`)}ws(){while(this.i<this.s.length&&wK.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 r5=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function s5($,Z){if(Object.is($,Z))return!0;if(Array.isArray($)&&Array.isArray(Z))return $.length===Z.length&&$.every((Q,z)=>s5(Q,Z[z]));if(r5($)&&r5(Z)){let Q=Object.keys($);return Q.length===Object.keys(Z).length&&Q.every((z)=>(z in Z)&&s5($[z],Z[z]))}return!1}class DQ{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[
|
|
165
|
-
`));continue}let W=JSON.parse(this.s.slice(
|
|
166
|
-
`,W.keyStart-1),
|
|
167
|
-
`,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function
|
|
164
|
+
`).join(this.style.eol+Z)}apply($,Z,Q,z){let X={};for(let[U,J]of Object.entries(Z)){if(J===void 0)continue;let H=Q?`${Q}.${U}`:U,V=$.members.filter((q)=>q.key===U);if(V.length>1)throw new F2(`the key "${H}" is there more than once`);let Y=V[0];if(!Y){if($.members.length===0)X[U]=J;else this.insert($,U,J,Q);continue}let G=this.startsLine(Y.keyStart);if(r5(J)){if(Y.value.kind!=="object")throw new F2(`"${H}" is not an object, so faf cannot add its keys to it`);this.apply(Y.value,J,H,G||this.s.slice(Y.value.start,Y.value.end).includes(`
|
|
165
|
+
`));continue}let W=JSON.parse(this.s.slice(Y.value.start,Y.value.end));if(s5(W,J))continue;if(Y.value.kind==="object"||Y.value.kind==="array")throw new F2(`"${H}" is ${Y.value.kind==="object"?"an object":"an array"}, so faf will not replace it with a value`);this.edits.push({start:Y.value.start,end:Y.value.end,text:this.render(J,this.indentOf(Y.keyStart),G)})}if(Object.keys(X).length>0)this.fillEmpty($,X,z)}fillEmpty($,Z,Q){let z=this.indentOf(this.lineLead($.start)),X=Q?this.render(Z,z,!0):JSON.stringify(Z);this.edits.push({start:$.start,end:$.end,text:X})}insert($,Z,Q,z){let X=$.members,U=X[X.length-1],H=(this.after[z]?.[Z]??[]).map((W)=>X.find((q)=>q.key===W)).find((W)=>W!==void 0);if(this.startsLine(X[0].keyStart)){let W=H&&H!==U?X[X.indexOf(H)+1]:U,q=this.indentOf(W.keyStart),K=this.s.slice(W.keyEnd,W.value.start),D=this.s.lastIndexOf(`
|
|
166
|
+
`,W.keyStart-1),B=D>0&&this.s[D-1]==="\r"?D-1:D,L=`${this.style.eol}${q}${JSON.stringify(Z)}${K}${this.render(Q,q,!0)},`;this.edits.push({start:B,end:B,text:L});return}let V=H??U,Y=this.s.slice(V.keyEnd,V.value.start),G=X.length>1?this.s.slice(X[0].value.end,X[1].keyStart):", ";this.edits.push({start:V.value.end,end:V.value.end,text:`${G}${JSON.stringify(Z)}${Y}${this.render(Q,"",!1)}`})}append($,Z,Q,z){if(Z.length===0)return;if($.items.length===0){this.edits.push({start:$.start,end:$.end,text:this.render(Z,this.indentOf(Q),z)});return}let X=$.items[$.items.length-1];if(this.startsLine($.items[0].start)){let J=this.indentOf($.items[0].start),H=Z.map((V)=>`,${this.style.eol}${J}${this.render(V,J,!0)}`).join("");this.edits.push({start:X.end,end:X.end,text:H});return}let U=$.items.length>1?this.s.slice($.items[0].end,$.items[1].start):", ";this.edits.push({start:X.end,end:X.end,text:Z.map((J)=>`${U}${this.render(J,"",!1)}`).join("")})}lineLead($){let Z=this.s.lastIndexOf(`
|
|
167
|
+
`,$-1)+1;while(Z<$&&(this.s[Z]===" "||this.s[Z]==="\t"))Z++;return Z}}function SK($,Z){let Q=$.includes(`\r
|
|
168
168
|
`)?`\r
|
|
169
169
|
`:`
|
|
170
170
|
`,z=Z.members[0],X=z?$.lastIndexOf(`
|
|
171
|
-
`,z.keyStart-1):-1,
|
|
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,U=z&&X>=0?$.slice(X+1,z.keyStart):"";return{eol:Q,unit:/^[ \t]+$/.test(U)?U:" "}}function U6($,Z,Q={}){let z=new o5($).parse();if(z.kind!=="object")throw new F2("the JSON is not an object");let X=new DQ($,SK($,z),Q);return X.apply(z,Z,"",$.slice(z.start,z.end).includes(`
|
|
172
|
+
`)),LQ($,X.edits)}function LQ($,Z){if(Z.length===0)return{text:$,changed:!1};let Q=Z.map((X,U)=>({e:X,i:U})).sort((X,U)=>U.e.start-X.e.start||U.i-X.i),z=$;for(let{e:X}of Q)z=z.slice(0,X.start)+X.text+z.slice(X.end);return{text:z,changed:z!==$}}function EK($){let Z=new o5($).parse();if(Z.kind!=="object")throw new F2("the JSON is not an object");return Z}function bK($,Z){let Q=$.lastIndexOf(`
|
|
173
|
+
`,Z-1);return Q>=0&&/^[ \t]*$/.test($.slice(Q+1,Z))}function yK($,Z,Q){if(Z.members.length===1)return{start:Z.start,end:Z.end,text:"{}"};let z=Z.members.indexOf(Q);if(bK($,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 MQ($,Z){let Q=[],z=EK($);for(let X of Z){if(z.kind!=="object")return{count:0,chain:Q};let U=z.members.filter((J)=>J.key===X);if(U.length!==1)return{count:U.length,chain:Q};Q.push({obj:z,member:U[0]}),z=U[0].value}return{count:1,chain:Q}}function IQ($,Z){let{count:Q,chain:z}=MQ($,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 a5($,Z,Q={}){let{count:z,chain:X}=MQ($,Z);if(z!==1||X.length===0)return null;let U=X[X.length-1];if(Q.dropEmptyParent&&X.length>1&&U.obj.members.length===1)U=X[X.length-2];return LQ($,[yK($,U.obj,U.member)]).text}var _Q="one.faf/render";function e5($){return`sha256:${xK("sha256").update($,"utf8").digest("hex")}`}var vK=/^sha256:[0-9a-f]{64}$/,kK=/^<meta name="faf-render" content="(sha256:[0-9a-f]{64})">$/,hK='<meta name="faf-render"',uK='<meta name="description" content="Visual render of project.faf.';function mK($){let Z=$.split(/(?<=\n)/),Q=Z.findIndex((z)=>z.startsWith(uK));return Z.splice(Q+1,0,`<meta name="faf-render" content="${e5($)}">
|
|
175
|
+
`),Z.join("")}function PQ($){let Z=$.split(/(?<=\n)/),Q=[],z=!1;if(Z.forEach((X,U)=>{let J=X.replace(/\r?\n$/,""),H=kK.exec(J);if(H)Q.push({at:U,hash:H[1]});else if(J.startsWith(hK))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 t5=["_meta",_Q];function fK($){return U6($,{_meta:{[_Q]:e5($)}}).text}function pK($){try{return a5($,t5,{dropEmptyParent:!0})??$}catch{return $}}function lK($){let Z;try{Z=IQ($,t5)}catch{return null}if(Z.count===0)return null;if(Z.count>1||typeof Z.value!=="string"||!vK.test(Z.value))return"many";let Q=a5($,t5,{dropEmptyParent:!0});return Q===null?"many":{hash:Z.value,canonical:Q}}function FQ($,Z){return $==="html"?mK(Z):fK(Z)}function cK($,Z){if($==="json")return pK(Z);let Q=PQ(Z);return Q===null||Q==="many"?Z:Q.canonical}function OQ($,Z){let Q=new TextDecoder().decode($),z=Z==="html"?PQ(Q):lK(Q);if(z===null)return"none";if(z==="many")return"mismatch";return Buffer.from(Q,"utf-8").equals(Buffer.from($))&&z.hash===e5(z.canonical)&&FQ(Z,z.canonical)===Q?"match":"mismatch"}function dK($){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(
|
|
179
|
-
`)}function
|
|
177
|
+
`),"utf-8")}function iK($,Z,Q){let z=OQ($,Q);return z!=="match"&&Z!==null&&OQ(Z,Q)==="match"?"match":z}function J6($,Z,Q){let z=gK($),X=h(Q.root,z),U=cK(Q.format,Z),J=FQ(Q.format,U),H=E0(X);if(H===null)return e(X,J,{root:Q.root,expect:null}),{path:X,result:"created"};if(H.equals(Buffer.from(J,"utf-8")))return{path:X,result:"unchanged"};let V=dK(H),Y=V===null?J:J.replace(/\r?\n/g,`\r
|
|
178
|
+
`);if(V!==null&&H.equals(Buffer.from(Y,"utf-8")))return{path:X,result:"unchanged"};if(Q.force!==!0&&!nK(z,H,V,U,Q))return{path:X,result:"unchanged"};return e(X,Y,{root:Q.root,expect:H}),{path:X,result:"updated"}}function nK($,Z,Q,z,X){let U=iK(Z,Q,X.format);if(U==="match")return!0;if(U==="mismatch")throw new E("not-owned",$,`${$} was edited since faf wrote it — faf left it unchanged. Use --force to replace it.`,{onWrite:!0});if(!X.hasMark(Z))throw new E("not-owned",$,`${$} has no ${X.mark}, so faf did not write it — faf left it unchanged.`,{onWrite:!0});let J=Buffer.from(z,"utf-8");if(Z.equals(J)||Q!==null&&Q.equals(J))return!1;throw new E("not-owned",$,`${$} has no faf render hash (written before 7.13), so faf cannot tell whether it was edited — faf left it unchanged. Use --force once to replace it; after that faf recognises its own output.`,{onWrite:!0})}var RQ=T$.orange,oK=T$.cyan,aK=T$.cyanDeep,tK="#FF9500",eK="#FF3B30",$D="#E6EDF3",ZD="#6E7681",NQ={TROPHY:{glyph:"✪",color:RQ},GOLD:{glyph:"★",color:RQ},SILVER:{glyph:"◆",color:oK},BRONZE:{glyph:"◇",color:aK},GREEN:{glyph:"●",color:$D},YELLOW:{glyph:"●",color:tK},RED:{glyph:"○",color:eK},WHITE:{glyph:"♡",color:ZD}};function V$($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var TQ=["who","what","why","where","when","how"];function C8($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,Q])=>`<div class="row"><div class="k">${V$(Z)}</div><div class="v">${V$(Q)}</div></div>`).join(`
|
|
179
|
+
`)}function $Z($,Z,Q="project.faf"){let z=V$($.project?.name??"Project"),X=Z.tier?.name??"WHITE",U=NQ[X]??NQ.WHITE,J=Z.inherited?Z.represents?`inherited from ${V$(Z.represents)}`:"inherited":`${Z.score}%`,H=X==="TROPHY"&&!Z.inherited,V=$.human_context??{},Y=TQ.map((B)=>[B,V[B]]),G=Object.entries(V).filter(([B])=>!TQ.includes(B)),W=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],q=Object.entries($.stack??{}),K=q.filter(([,B])=>B&&B!=="slotignored"&&String(B).trim()!==""),D=q.filter(([,B])=>B==="slotignored").length;return`<!DOCTYPE html>
|
|
180
180
|
<html lang="en">
|
|
181
181
|
<head>
|
|
182
182
|
<meta charset="UTF-8">
|
|
@@ -188,19 +188,19 @@ ${G}`).replace(/\n/g,$.eol);return{inline:J,text:J?U.slice(1):V}}function jZ($,Z
|
|
|
188
188
|
*{margin:0;padding:0;box-sizing:border-box}
|
|
189
189
|
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#0a0a0a;color:#e6edf3;line-height:1.55;padding:48px 20px}
|
|
190
190
|
.wrap{max-width:880px;margin:0 auto}
|
|
191
|
-
.bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${
|
|
191
|
+
.bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${U.color},transparent);margin-bottom:40px}
|
|
192
192
|
header{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:8px}
|
|
193
193
|
h1{font-size:2.2rem;font-weight:800;letter-spacing:-1px}
|
|
194
|
-
.badge{font-size:1.05rem;font-weight:800;color:${
|
|
194
|
+
.badge{font-size:1.05rem;font-weight:800;color:${U.color};white-space:nowrap}
|
|
195
195
|
.score{font-size:1.05rem;font-weight:700;color:#8b949e}
|
|
196
196
|
.eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:#6e7681;margin-bottom:36px}
|
|
197
197
|
section{margin-bottom:34px}
|
|
198
|
-
h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${
|
|
198
|
+
h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${U.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
|
|
199
199
|
.row{display:flex;gap:18px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.04)}
|
|
200
200
|
.k{flex:0 0 150px;color:#8b949e;font-size:.9rem;text-transform:capitalize}
|
|
201
201
|
.v{flex:1;color:#e6edf3;font-size:.95rem;word-break:break-word}
|
|
202
202
|
.meter{height:8px;border-radius:4px;background:rgba(255,255,255,.06);overflow:hidden;margin:6px 0 10px}
|
|
203
|
-
.meter span{display:block;height:100%;background:${
|
|
203
|
+
.meter span{display:block;height:100%;background:${U.color};width:${Math.max(0,Math.min(100,Z.score))}%}
|
|
204
204
|
.award{font-size:.95rem}
|
|
205
205
|
.statline{margin-bottom:32px}
|
|
206
206
|
.awd-pre{color:#6E7681}
|
|
@@ -217,68 +217,69 @@ footer strong{color:#e6edf3}
|
|
|
217
217
|
<div class="eyebrow">project.faf · visual render</div>
|
|
218
218
|
<header>
|
|
219
219
|
<h1>${z}</h1>
|
|
220
|
-
<span class="badge">${
|
|
221
|
-
<span class="score">${
|
|
220
|
+
<span class="badge">${U.glyph} ${V$(X)}</span>
|
|
221
|
+
<span class="score">${J}</span>
|
|
222
222
|
</header>
|
|
223
223
|
<div class="meter"><span></span></div>
|
|
224
|
-
${
|
|
224
|
+
${H?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy ✪ Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${D?` · ${D} slotignored`:""}</p>`}
|
|
225
225
|
|
|
226
226
|
<section>
|
|
227
227
|
<h2>The 6 W's</h2>
|
|
228
|
-
${
|
|
229
|
-
${
|
|
228
|
+
${C8(Y)||'<p class="muted">No human_context yet.</p>'}
|
|
229
|
+
${G.length?C8(G):""}
|
|
230
230
|
</section>
|
|
231
231
|
|
|
232
232
|
<section>
|
|
233
233
|
<h2>Project</h2>
|
|
234
|
-
${
|
|
234
|
+
${C8(W)||'<p class="muted">—</p>'}
|
|
235
235
|
</section>
|
|
236
236
|
|
|
237
237
|
<section>
|
|
238
238
|
<h2>Stack</h2>
|
|
239
|
-
${K.length?
|
|
239
|
+
${K.length?C8(K):'<p class="muted">No active stack slots.</p>'}
|
|
240
240
|
</section>
|
|
241
241
|
|
|
242
242
|
<footer>
|
|
243
|
-
Rendered on-demand from your current <strong>${
|
|
243
|
+
Rendered on-demand from your current <strong>${V$(Q)}</strong><br>
|
|
244
244
|
<strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
|
|
245
245
|
</footer>
|
|
246
246
|
</div>
|
|
247
247
|
</body>
|
|
248
248
|
</html>
|
|
249
|
-
`}var jK='<meta name="description" content="Visual render of project.faf.';function wK($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(jK)&&Z.includes(" by faf"))}function SK($,Z,Q,z="project.faf",X={}){$6(_K($,"project.html"),dZ(Z,Q,z),{root:$,format:"html",hasMark:wK,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var EK=PK(dZ,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as eK}from"path";import{deprecate as $D}from"node:util";var Q$="https://faf.one/ext/context/v1",iZ="io.modelcontextprotocol.registry/publisher-provided";function w0($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:"application/vnd.faf+yaml",iana:"https://www.iana.org/assignments/media-types/application/vnd.faf+yaml",deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function M2($,Z={}){let Q={"one.faf/context":w0($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>4096)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${"4096"}B cap`);return{["io.modelcontextprotocol.registry/publisher-provided"]:Q}}var KQ="JSONRPC",sZ="1.0",F8=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],R8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",DQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",LQ="1.0",IQ="1.0",nZ={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function OQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function _2($,Z={}){let Q=OQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:sZ}];return[]}function bK($){try{return`https://${z$($)}/.well-known/fafa`}catch{return}}function oZ($,Z,Q={}){let z=w0(Z,Q),X=$.agent??{},H={fafaSpecVersion:String($.version??IQ),mediaTypes:[...F8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)H.agentId=X.id;let U=bK($);if(U)H.passport=U;return{uri:Q$,description:"FAF passport and project DNA as typed parts",required:!1,params:H}}function yK($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&F8.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function N8($,Z={}){let Q=$.agent??{},z=_2($,Z);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let X=String(Q.displayName??$.metadata?.persona??Q.name??"").trim(),H=String(Q.description??"").trim(),U=String(Q.version??"").trim();if(!X||!H||!U)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let J=String(Q.vendor??"").trim(),G=String(Q.homepage??"").trim(),V=J&&G?{organization:J,url:G}:void 0,Y=($.capabilities??[]).map((W)=>{let B=String(W.name??"").trim();if(!B)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],L=W.cites_spec&&F8.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:B,name:B,description:String(W.description??"").trim()||B,tags:K,...L?{inputModes:L}:{}}});return{name:X,description:H,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:KQ,protocolVersion:String(W.version??sZ)})),...V?{provider:V}:{},version:U,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:yK($),defaultOutputModes:["text/plain","application/json"],skills:Y}}var xK=["mcp","cli","library"],gK=/^[a-z0-9][a-z0-9._-]*$/,vK=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,kK=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,hK=/^[A-Za-z0-9][^\s]*$/,uK=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,fK=["a2a","mcp"],mK=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function R($){return String($??"").trim()}function P8($){return Array.isArray($)?$.map(R).filter(Boolean):[]}function pK($){return R($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function lK($,Z,Q){let z=["display_name","description","version"].filter((X)=>!R($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!gK.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!mK.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function cK($,Z){return($.skills??[]).filter((Q)=>R(Q.name)).map((Q)=>({name:R(Q.name),type:R(Q.type)||"tool",description:R(Q.description)||R(Q.name),tags:Z.length?Z:[R(Q.name).toLowerCase()]}))}function dK($){let Z=($.packages??[]).filter((Q)=>R(Q.registryType)&&R(Q.identifier));for(let Q of Z){let z=R(Q.registryType),X=R(Q.identifier);if(z==="npm"&&!vK.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!kK.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z==="cargo"&&!uK.test(X))throw Error(`Package "${X}" is not a crate name (e.g. weather-mcp or weather_mcp).`);if(z!=="npm"&&z!=="pypi"&&z!=="cargo"&&!hK.test(X))throw Error(`Package "${X}" is not a ${z} package identifier: it must start with a letter or digit and have no spaces.`)}return Z.map((Q)=>({registryType:R(Q.registryType),identifier:R(Q.identifier),...R(Q.version)?{version:R(Q.version)}:{}}))}function MQ($){if(/\s/.test($))return!1;try{let Z=new URL($);return(Z.protocol==="http:"||Z.protocol==="https:")&&Z.hostname!==""}catch{return!1}}function iK($){if(!MQ(R($.url)))throw Error(`Where it runs: "${R($.url)}" is not an http(s) URL (or give an npm package).`);if(!fK.includes(R($.protocol).toLowerCase()))throw Error(`Protocol "${R($.protocol)}": a2a or mcp.`)}function nK($){let Z=R($.package_kind).toLowerCase()||"mcp";if(!xK.includes(Z))throw Error(`Kind "${R($.package_kind)}" is not one faf knows: mcp, cli or library.`);return Z}function rK($,Z){let Q=($.endpoints??[]).filter((H)=>R(H.url));Q.forEach(iK);let z=nK($),X=[...Q.map((H)=>({protocol:R(H.protocol).toLowerCase(),transport:"http",location:R(H.url)})),...Z.map((H)=>({protocol:z,transport:"stdio",location:H.identifier}))];if(X.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return X}function sK($,Z,Q,z){let X={domain:Z},H=[["repository",R($.repository)],["icon",R($.icon)],["organizationUrl",R($.organization_url)]];for(let[J,G]of H)if(G)X[J]=G;if(Q.length)X.keywords=Q;let U=P8($.example_requests);if(U.length)X.examples=U;if(z.length)X.packages=z;return X}function _Q($){let Z=R($.handle).toLowerCase(),Q=pK($.domain);lK($,Z,Q);let z=P8($.tags),X=dK($),H=R($.homepage);if(H&&!MQ(H))throw Error(`Homepage: "${H}" is not an http(s) URL.`);let U={name:Z,displayName:R($.display_name),id:`urn:air:${Q}:agent:${Z}`,...R($.organization)?{vendor:R($.organization)}:{},version:R($.version),description:R($.description),homepage:H||`https://${Q}`,...R($.license)?{license:R($.license)}:{}};return{version:IQ,agent:U,capabilities:cK($,z),endpoints:rK($,X),metadata:{cards:sK($,Q,z,X)}}}function PQ($){return D2($,{lineWidth:0})}function z$($){let Z=R($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=R($.metadata?.cards?.domain);if(z)return z;try{return new URL(R($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function FQ($){let Z=R($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!Z)throw Error("The .fafa needs agent.name (the short name).");return Z}function aZ($){return`${z$($).split(".").reverse().join(".")}/${FQ($)}`}function rZ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function P2($){return($.endpoints??[]).filter((Z)=>R(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(R(Z.location))).map((Z)=>({type:"streamable-http",url:R(Z.location)}))}function oK($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function RQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=R(Z.description),X=R(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let H={name:aZ($),version:X,description:rZ(z)},U=R(Z.displayName);if(U)H.title=rZ(U);let J=R(Z.homepage);if(J)H.websiteUrl=J;let G=oK(R(Q.repository));if(G)H.repository=G;if(R(Q.icon))H.icons=[{src:R(Q.icon)}];return H}function NQ($){return($.metadata?.cards?.packages??[]).map((Z)=>({registryType:R(Z.registryType),identifier:R(Z.identifier),...R(Z.version)?{version:R(Z.version)}:{},transport:{type:"stdio"}}))}function T8($){return($.endpoints??[]).some((Z)=>R(Z.protocol).toLowerCase()==="mcp")}function tZ($){return T8($)&&(P2($).length>0||NQ($).length>0)}function TQ($){let Z=R($.agent?.displayName);return{name:aZ($),...Z?{title:rZ(Z)}:{}}}function A8($,Z,Q={}){let z=P2($);if(z.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:R8,...RQ($),remotes:z,...Z?{_meta:{"one.faf/context":w0(Z,Q)}}:{}}}function AQ($,Z,Q={}){let z=P2($),X=NQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");if(!T8($))throw Error("A registry entry describes an MCP server: the .fafa has no mcp endpoint.");return{$schema:DQ,...RQ($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:M2(Z,Q)}:{}}}function aK($,Z,Q){if(!Z.includes("a2a")||_2($,Q).length===0)return;return Q.a2aCardUrl??`https://${z$($)}/.well-known/agent-card.json`}function C8($,Z,Q={}){let z=z$($),X=FQ($),H=$.agent??{},U=R(H.displayName)||R(H.name),J=R(H.description),G=R(H.version),V=Q.now??new Date().toISOString(),Y=(K,L,q)=>({identifier:`urn:air:${z}:${K}:${X}`,displayName:U,type:L,description:J,url:q,...G?{version:G}:{},updatedAt:V}),W=[],B=aK($,Z,Q);if(B)W.push(Y("a2a",nZ.a2a,B));if(Z.includes("server_card")){let K=P2($)[0];if(K)W.push(Y("mcp",nZ.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(Y("agent",nZ.fafa,`https://${z}/.well-known/fafa`));return W}function j8($){let Z=$.agent??{},Q=R(Z.vendor)||R(Z.displayName)||R(Z.name);if(!Q)return;let z;try{z=z$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function CQ($,Z,Q={}){let z=j8($);return{specVersion:LQ,...z?{host:z}:{},entries:C8($,Z,Q)}}function eZ($){let Z=$.metadata?.cards??{},Q=P8(Z.keywords),z=P8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function jQ($,Z,Q={}){let z=j8($),X=eZ($);return{specVersion:LQ,...z?{host:z}:{},entries:C8($,Z,Q).map((H)=>({...H,...X}))}}function wQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:PQ($)},{faf:X}=Z;if(Q.has("a2a")){let U=[...Z.a2aExtensions??[],...X?[oZ($,X,Z)]:[]];z.a2a=N8($,{extensions:U})}if(Q.has("server_card"))z.server_card=A8($,X,Z);if(Q.has("server_json"))z.server_json=AQ($,X,Z);let H={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=CQ($,Z.cards,H);if(Q.has("ard"))z.ard=jQ($,Z.cards,H);return z}function tK($,Z){return wQ(_Q($),Z)}var ZD=R8,QD=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function SQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&QD.test(Z))return Z;let Q=$.project?.homepage??$.project?.website??$.project?.url,z="local";if(Q)try{z=new URL(Q).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let X=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${z}/${X}`}function zD($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function Z6($,Z={}){let Q={$schema:ZD,name:SQ($),version:String($.project?.version??"0.1.0"),description:zD($)},z=w8($)??$.project?.name;if(z&&z.length<=100)Q.title=z;let X=$.project?.homepage??$.project?.website??$.project?.url;if(X)Q.websiteUrl=X;if(Z.remoteUrl)Q.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return Q._meta={"one.faf/context":w0($,Z)},Q}function Z1($){return SQ($)}function w8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function XD($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var $1=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function EQ($){let Z=XD($);return $1(Z)&&$1(Z._meta)&&$1(Z._meta["one.faf/context"])}function HD($,Z,Q={},z={}){let X=Z6(Z,Q),H=eK($,"server-card");return $6(H,`${JSON.stringify(X,null,2)}
|
|
250
|
-
`,{root:$,format:"json",hasMark:EQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),H}function UD($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return e$($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var JD=$D(Z6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as bQ}from"fs";import{basename as GD,dirname as xQ,join as yQ}from"path";import{deprecate as VD}from"node:util";var YD=["a2a","mcp","registry","catalog","ard"];function WD($){return f0(Q0(u(xQ($),GD($))))}function BD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=yQ($,z);if(bQ(X))return X}let Q=xQ($);if(Q!==$)for(let z of Z){let X=yQ(Q,z);if(bQ(X))return X}return null}function Q1($,Z,Q={}){if(_2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");return N8($,{doorUrl:Q.doorUrl,extensions:Z?[oZ($,Z,Q)]:[]})}var qD=VD(Q1,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function KD($,Z={},Q={}){return C8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function DD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function LD($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:H,...U})=>({specVersion:H,host:{...Q},...U}))(z):z;for(let H of Z){let U=DD(X.entries,H);if(U>=0)X.entries[U]={...X.entries[U],url:H.url,type:H.type,...H.updatedAt?{updatedAt:H.updatedAt}:{}};else X.entries.push(H)}return X}var ID="no mcp endpoint in agent.fafa";function OD($){return $!==void 0&&!T8($)}function MD($){let Z=$.project?.type??$.app_type;return typeof Z==="string"&&Z.trim()!==""?Z.trim():void 0}function _D($,Z){if($===void 0||Z!==void 0)return!1;let Q=MD($);return Q!==void 0&&!/^mcp/i.test(Q)}function PD($,Z={}){return[..._2($,Z).length>0?["a2a"]:[],...P2($).length>0?["mcp"]:[],...tZ($)?["registry"]:[],"catalog","ard"]}function FD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=OD(z),H=$.targets?.filter((Y)=>Y==="mcp"||Y==="registry")??[];if(X&&H.length)throw Error(`${H.join(", ")}: ${ID} — these cards describe an MCP server.`);let U=_D(Q,z),J=(Q?YD:z?PD(z,Z):[]).filter((Y)=>!(X||U)||Y!=="mcp"&&Y!=="registry"),G=new Set($.targets?.length?$.targets:J),V={};if(Q)V.block=w0(Q,Z);if(G.has("mcp"))if(z&&P2(z).length>0)V.mcp=A8(z,Q,Z);else if(Q)V.mcp=Z6(Q,Z);else throw Error("A Server Card needs an MCP endpoint at an http(s) URL in the .fafa, or a project.faf.");if(G.has("registry"))if(z&&tZ(z))V.registry={...TQ(z),...Q?{_meta:M2(Q,Z)}:{}};else if(Q){let Y=w8(Q);V.registry={name:Z1(Q),...Y?{title:Y}:{},_meta:M2(Q,Z)}}else throw Error("A registry entry needs a package or a remote MCP URL in the .fafa, or a project.faf.");if(G.has("a2a")||G.has("catalog")||G.has("ard")){if(!$.fafa){if($.targets?.some((Y)=>Y==="a2a"||Y==="catalog"||Y==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(G.has("a2a")&&$.fafa)if(_2($.fafa,Z).length===0){if($.targets?.includes("a2a"))throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.")}else V.a2a=Q1($.fafa,Q,Z);if((G.has("catalog")||G.has("ard"))&&$.fafa){let Y=KD($.fafa,Q,Z);if(G.has("catalog"))V.catalog=Y;if(G.has("ard")){let B=eZ($.fafa);V.ard=Y.map((K)=>({...K,...B}))}let W=j8($.fafa);if(W)V.catalogHost=W}return RD(V),V}function RD($){if(!$.block)return;let Z=JSON.stringify($.block),Q=[];if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry?._meta){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block");if($.a2a){let z=$.a2a.capabilities.extensions?.find((U)=>U.uri===Q$);if(!z)throw Error("A2A card has no FAF context extension, but a project.faf was given");let X=z.params,H=$.block;if(X.provenance?.faf!==H.faf||X.provenance?.mediaType!==H.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var z1=["ephemeral","standard","high","critical"],Q2=Object.fromEntries(z1.map(($,Z)=>[$,Z])),S8=new Set(["user","feedback","project","reference"]),X1=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),H1=new Set(["facts","sessions","preferences","custom"]),U1={low:"ephemeral",medium:"standard"};import{existsSync as ND}from"fs";import{dirname as fQ,resolve as mQ}from"path";function F2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function m($){return $===null||$===void 0}function TD($){if(Array.isArray($))return`a list (${$.length} item${$.length===1?"":"s"})`;if(m($))return"empty";if(typeof $==="string")return`a string (${JSON.stringify($.length>40?`${$.slice(0,40)}…`:$)})`;return`a ${typeof $}`}var H$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function AD($){let Z=mQ($),Q=u(fQ(Z),Z,{read:!0});return{real:Q,text:Q0(Q)}}function gQ($,Z,Q,z){let X=mQ($),H=u(fQ(X),X),U=Q!==void 0&&Q.real===H;if(U&&Q.text===Z)return H;let J;try{J=m0(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 G=U?Q.text:z?J:null;return e($,Z,G===void 0?{}:{expect:G})}function U$($){if(m($))return"standard";if(U1[$])return U1[$];if($ in Q2)return $;return"standard"}var CD=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function J1($){if(typeof $==="string")return{text:$,id:null,type:null,priority:"standard",tags:[],links:[],timestamp:null,source:null,extra:{}};if(!$||typeof $!=="object"||!("text"in $))throw Error(`fact must be a string or a mapping with 'text': ${JSON.stringify($)}`);let Z=$,Q={};for(let[z,X]of Object.entries(Z))if(!CD.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:U$(Z.priority),tags:Array.isArray(Z.tags)?Z.tags.slice():[],links:Array.isArray(Z.links)?Z.links.slice():[],timestamp:Z.timestamp??null,source:Z.source??null,extra:Q}}function X$($){if(m($.id)&&m($.type)&&$.tags.length===0&&$.links.length===0&&m($.timestamp)&&m($.source)&&Object.keys($.extra).length===0&&$.priority==="standard")return $.text;let Q={text:$.text};if(!m($.id))Q.id=$.id;if(!m($.type))Q.type=$.type;if(Q.priority=$.priority,$.tags.length)Q.tags=$.tags;if($.links.length)Q.links=$.links;if(!m($.timestamp))Q.timestamp=$.timestamp;if(!m($.source))Q.source=$.source;return Object.assign(Q,$.extra),Q}function vQ($){let Z=$;return H$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&H$(Z.extra)&&typeof Z.priority==="string"?Z:J1($)}function jD($){if(typeof $==="string"||H$($)&&"text"in $)return J1($);return null}var kQ=["profile","namepoint","created","last_etched","retention"];class Y0{namepoint;profile;retention;created;last_etched;_facts;_byId;_index;_sessions;_preferences;_custom;_extra;_memoryExtra;_version;_origin;_factAt=new WeakMap;_indexDerived=!0;_indexAtRecord=[];constructor($,Z={}){this.namepoint=$,this.profile=Z.profile??"knowledge",this.retention=Z.retention??"forever",this.created=Z.created??F2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(vQ):[],this._byId=new Map,this._facts.forEach((Q,z)=>{if(!m(Q.id))this._byId.set(Q.id,z)}),this._index=Z.index?Z.index.slice():[],this._sessions=Z.sessions?structuredClone(Z.sessions):[],this._preferences=Z.preferences?{...Z.preferences}:{},this._custom=Z.custom?{...Z.custom}:{},this._extra=Z.extra?{...Z.extra}:{},this._memoryExtra=Z.memoryExtra?{...Z.memoryExtra}:{},this._indexDerived=Z.index===void 0||c(this._index,this.derivedIndex()),this._indexAtRecord=this._index.slice()}get facts(){return this._facts}get index(){return this._index}get sessions(){return this._sessions}get preferences(){return this._preferences}get custom(){return this._custom}get extra(){return this._extra}get memoryExtra(){return this._memoryExtra}static load($){if(!ND($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=AD($);return Y0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=EZ($,Z).toJS();if(!H$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${TD(z)}`);let X=new pQ,H=X.pick("memory",z.memory,f)??{},U=new Y0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,H)});return(X.pick("memory.facts",H.facts,Array.isArray)??[]).forEach((J,G)=>{let V=jD(J);if(V)U.adopt(V,G)}),U.last_etched=String(z.last_etched??U.created),U._version=m(z.version)?void 0:String(z.version),U._origin={path:Z,real:Q,text:$,base:U.state(),residual:X.residual},U.recordIndex(),U}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!m($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return Y0.load($)}toDoc(){let $={facts:this._facts.map(X$),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!H1.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(!X1.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return D2(this.toDoc(),{lineWidth:100})}derivedIndex($=80){return this._facts.map((Z)=>`${Z.id??"?"} — ${String(Z.text).slice(0,$)}`)}indexIsDerived($=80){return!this._origin?.residual.has("index")&&c(this._index,this.derivedIndex($))}rebuildIndex($=80){return this._index=this.derivedIndex($),this._indexDerived=!0,this._indexAtRecord=this._index.slice(),this._index}save($,Z={}){let Q=Z.reindex??(this._indexDerived&&c(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let G=this.toYaml(),V=gQ($,G,void 0,z);return this.settle($,G,new Map(this._facts.map((Y,W)=>[Y,W])),V),$}let H=new Map,{text:U}=D8(X.text,(G)=>{H=this.applyTo(G,X,Q)},$),J=gQ($,U,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,U,H,J),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,H]of Q)this._factAt.set(X,H);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(X$(Z)))}return{top:Object.fromEntries(kQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),H=Z.path;for(let U of kQ)if(z.top[U]!==X.top[U])$.set(U,X.top[U]);if(!c(z.index,X.index)){if(Z.residual.has("index")&&!Q)Y0.refuse(Z,"index","replace it");I8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,H)}for(let U of uQ(z.extra,X.extra))I8($,[U],z.extra[U],X.extra[U],H);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...uQ(Q.memoryExtra,z.memoryExtra).map((H)=>[H,Q.memoryExtra[H],z.memoryExtra[H]])];for(let[H,U,J]of X){if(c(U,J))continue;if(Z.residual.has("memory"))Y0.refuse(Z,"memory",`change memory.${H}`);if(Z.residual.has(`memory.${H}`))Y0.refuse(Z,`memory.${H}`,"replace it");I8($,["memory",H],U,J,Z.path)}}sortFacts($){let Z=[],Q=[];for(let z of this._facts){let X=this._factAt.get(z);if(X===void 0){Q.push(z);continue}if(Q.length>0||Z.length>0&&X<=Z[Z.length-1][1])throw Error(`${$.path}: the facts were reordered — faf keeps the order soul.fafm has. Nothing written.`);Z.push([z,X])}return{kept:Z,added:Q}}applyFacts($,Z){let{kept:Q,added:z}=this.sortFacts(Z),X=new Set(Q.map(([,V])=>V)),H=[...Z.base.facts.keys()].filter((V)=>!X.has(V)).sort((V,Y)=>Y-V),U=Q.filter(([V,Y])=>!c(Z.base.facts.get(Y),X$(V))),J=new Map(Q);if(z.length===0&&H.length===0&&U.length===0)return J;for(let V of["memory","memory.facts"])if(Z.residual.has(V))Y0.refuse(Z,V,"add facts to it");let G=g9($,["memory","facts"],Z.path);for(let[V,Y]of U)G.items[Y]=SD($,G.items[Y],Z.base.facts.get(Y),X$(V));for(let V of H)G.items.splice(V,1);for(let[V,Y]of Q)J.set(V,Y-H.filter((W)=>W<Y).length);for(let V of z)J.set(V,G.items.length),G.items.push($.createNode(X$(V)));return J}add($){let Z=vQ($);if(!m(Z.id)&&this._byId.has(Z.id)){let Q=this._byId.get(Z.id);if(Q!==void 0){let z=this._factAt.get(this._facts[Q]);if(this._facts[Q]=Z,z!==void 0)this._factAt.set(Z,z)}}else if(this._facts.push(Z),!m(Z.id))this._byId.set(Z.id,this._facts.length-1);if(Z.timestamp&&Z.timestamp>(this.last_etched||""))this.last_etched=Z.timestamp;return Z}etch($,Z={}){let Q=m(Z.id)?null:this.getFact(Z.id);if(Q)return this.add(wD(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:U$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:F2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=H$($)?{...$,...Z}:Z,z=H$($)?$.query:$,X=Q2[U$(Q.minPriority??"ephemeral")]??0,H=typeof z==="string"?z.toLowerCase():"",U=new Set(Q.tags??[]),J=[];this._facts.forEach((V,Y)=>{if(H&&!String(V.text??"").toLowerCase().includes(H))return;if(U.size>0&&![...U].some((W)=>(V.tags??[]).includes(W)))return;if(!m(Q.type)&&V.type!==Q.type)return;if((Q2[V.priority]??1)<X)return;J.push([Y,V])}),J.sort((V,Y)=>{let W=Q2[V[1].priority]??1,B=Q2[Y[1].priority]??1;if(B!==W)return B-W;let K=V[1].timestamp??"",L=Y[1].timestamp??"";if(L!==K)return L<K?-1:L>K?1:0;return Y[0]-V[0]});let G=J.map(([,V])=>V);if(!m(Q.limit))return G.slice(0,Q.limit);return G}getFact($){let Z=this._byId.get($);return Z===void 0?null:this._facts[Z]}deleteFact($){let Z=this._byId.get($);if(Z===void 0)return!1;return this._facts.splice(Z,1),this._byId.clear(),this._facts.forEach((Q,z)=>{if(!m(Q.id))this._byId.set(Q.id,z)}),!0}}function wD($,Z,Q){let z=(X,H)=>m(X)?H:X;return{...$,text:Z,type:z(Q.type,$.type),priority:m(Q.priority)?$.priority:U$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:F2(),extra:{...$.extra}}}class pQ{residual=new Map;pick($,Z,Q){if(m(Z))return;if(Q(Z))return Z;this.residual.set($,d$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,f)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,f)??{}),extra:hQ($,X1),memoryExtra:hQ(Z,H1)}}}function hQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function uQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function SD($,Z,Q,z){if(!l(Z))return o$($,Z,Q,z);let X=(H)=>typeof H==="string"?{text:H}:H;return o$($,Z,X(Q),X(z))}import{readdirSync as ED,readFileSync as bD,statSync as lQ,existsSync as yD}from"fs";import{join as xD,basename as cQ,resolve as gD}from"path";var dQ=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),vD=/\[\[([^\]]+)\]\]/g;function kD($){let Z=lQ($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function hD($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=f0(Z[1]);if(!Q||typeof Q!=="object")return{fm:null,body:Z.slice(2).join("---").trim()};return{fm:Q,body:Z.slice(2).join("---").trim()}}catch{return{fm:null,body:$}}}function uD($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!S8.has(X))return null;let H=String(Q.name).trim(),J=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||H,G={};if(z.originSessionId)G.provenance=[`session:${z.originSessionId}`];let V=[...new Set([...Z.matchAll(vD)].map((Y)=>Y[1]))].sort();return{text:J,id:H,type:X,priority:"standard",tags:[],links:V,timestamp:kD($),source:`claude-code memory: ${cQ($)}`,extra:G}}function iQ($,Z={}){let Q=gD($);if(!yD(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!lQ(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??dQ,X=Z.namepoint??`@claude-code:${cQ(Q)}`,H=[],U=ED(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of U){if(z.has(W))continue;let B=xD(Q,W),K;try{K=bD(B,"utf-8")}catch{continue}let{fm:L,body:q}=hD(K);if(!L)continue;let D=uD(B,q,L);if(D)H.push(D)}let J=H.map((W)=>W.timestamp).filter(Boolean),G=J.length?J.reduce((W,B)=>W<B?W:B):F2(),V=J.length?J.reduce((W,B)=>W>B?W:B):G,Y=new Y0(X,{profile:"knowledge",facts:H,created:G});return Y.last_etched=V,Y.rebuildIndex(),Y}var aQ="faf-interview/1",J$="(terse — 3-4 words)",G1=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${J$}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${J$}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${J$}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${J$}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${J$}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${J$}`,header:"How",type:"text",required:!0}],tQ=[{path:"project.main_language",question:"What is the primary programming language?",header:"Language",type:"select",required:!0,options:[{label:"TypeScript",value:"TypeScript",description:"JavaScript with types"},{label:"JavaScript",value:"JavaScript",description:"Vanilla JS or Node.js"},{label:"Python",value:"Python",description:"Python 3.x"},{label:"Rust",value:"Rust",description:"Systems programming"},{label:"Go",value:"Go",description:"Golang"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.frontend",question:"What frontend framework does it use?",header:"Frontend",type:"select",required:!1,options:[{label:"React",value:"React",description:"React.js"},{label:"Vue",value:"Vue",description:"Vue.js"},{label:"Svelte",value:"Svelte",description:"Svelte/SvelteKit"},{label:"Next.js",value:"Next.js",description:"React framework"},{label:"None",value:"None",description:"No frontend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.backend",question:"What backend framework does it use?",header:"Backend",type:"select",required:!1,options:[{label:"Express",value:"Express",description:"Node.js Express"},{label:"Fastify",value:"Fastify",description:"Node.js Fastify"},{label:"Django",value:"Django",description:"Python Django"},{label:"FastAPI",value:"FastAPI",description:"Python FastAPI"},{label:"None",value:"None",description:"No backend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.database",question:"What database does it use?",header:"Database",type:"select",required:!1,options:[{label:"PostgreSQL",value:"PostgreSQL",description:"Postgres"},{label:"MySQL",value:"MySQL",description:"MySQL/MariaDB"},{label:"SQLite",value:"SQLite",description:"Embedded SQL"},{label:"MongoDB",value:"MongoDB",description:"Document store"},{label:"None",value:"None",description:"No database"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.runtime",question:"What runtime does it run on?",header:"Runtime",type:"text",required:!1},{path:"stack.hosting",question:"Where is it hosted or distributed?",header:"Hosting",type:"text",required:!1},{path:"stack.build",question:"What is the build tool?",header:"Build",type:"text",required:!1},{path:"stack.cicd",question:"What CI/CD does it use?",header:"CI/CD",type:"text",required:!1}],G$=[...G1,...tQ],eQ=new Map(G$.map(($)=>[$.path,$])),fD=Object.fromEntries(G$.map(($)=>[$.path,$]));function V1($){let Z=eQ.get($);if(Z)return Z.question;let Q=x0.get($)??p.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function mD($,Z){return G$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let H of z)if(X&&typeof X==="object"&&H in X)X=X[H];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var pD=new Set(["developers","development teams","development team","teams","development","cloud platform","web platform","platform","best practices","improve development efficiency","development efficiency","modern development practices","modern development","test-driven development","production/stable","production","stable","app","project","tool"]),lD=[["npm",/\bnpm\b/i],["PyPI",/\bpypi\b/i],["crates.io",/\bcrates\.io\b/i],["Homebrew",/\bhomebrew\b/i],["Docker",/\bdocker\b/i],["Cloudflare",/\bcloudflare\b/i],["Vercel",/\bvercel\b/i],["Netlify",/\bnetlify\b/i],["AWS",/\baws\b/i],["Cloud Run",/\bcloud run\b/i],["edge",/\bedge\b/i],["browser",/\bbrowser\b/i],["WASM",/\bwasm\b/i],["GitHub",/\bgithub\b/i],["MCP Registry",/\bmcp registry\b/i],["Chrome Web Store",/\bchrome web store\b/i],["Smithery",/\bsmithery\b/i]],nQ=($)=>pD.has($.toLowerCase().trim()),cD=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i;function rQ($,Z=5){let Q=$.trim().split(/\s+/).filter(Boolean).slice(0,Z);while(Q.length&&cD.test(Q[Q.length-1].replace(/[.,;:]+$/,"")))Q.pop();return Q.join(" ")}function $3($){let Z={};if(!$||typeof $!=="string")return Z;let Q=$.trim(),z=Q.replace(/^[^A-Za-z0-9]+/,"").split(/\s+(?:for|that|which|to)\s+|\s+[—–]\s+|\s-\s|:\s|\.\s|,\s/)[0].trim(),X=rQ(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!nQ(X))Z.what=X;let H=lD.filter(([,G])=>G.test(Q)).map(([G])=>G);if(H.length)Z.where=H.slice(0,4).join(", ");let U=Q.match(/\bfor ((?:[A-Za-z][\w./+-]* )?(?:any |all )?(?:developers?|teams?|engineers?|builders?|users?|integrators?)\b[^.,;:—]*)/i),J=rQ((U?.[1]||"").trim().replace(/\s+/g," "));if(J&&!nQ(J))Z.who=J;return Z}function sQ($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function oQ($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!r(Z)}function dD($,Z={}){let Q=$&&typeof $==="object"?$:{},z=sQ(Q,"project.goal"),X=(oQ(z)?String(z).trim():"")||(Z.goal??"").trim(),H=$3(X),U=Z.detailed??{},J={"project.goal":X||void 0,"human_context.what":H.what,"human_context.where":H.where,"human_context.who":H.who},G=(K)=>{let L=J[K];if(L)return{value:L,source:"project goal",confidence:0.9};let q=K.startsWith("human_context.")?K.slice(14):"",D=q?U[q]:void 0;return D?{value:D.value,source:D.source,confidence:D.confidence}:void 0},V=G1.map((K,L)=>{let q={n:L+1,path:K.path,header:K.header,question:K.question},D=sQ(Q,K.path);if(oQ(D))return{...q,value:String(D).trim(),status:"filled",seeded:!1};let O=G(K.path);if(O)return{...q,value:O.value,status:"seeded",seeded:!0,source:O.source,confidence:O.confidence};return{...q,value:"",status:"empty",seeded:!1}}),Y=V.filter((K)=>K.status==="filled").length,W=V.filter((K)=>K.status==="seeded").length,B=V.filter((K)=>K.status==="empty").length;return{version:aQ,rows:V,filledCount:Y,seededCount:W,emptyCount:B,complete:B===0}}function E8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||r(Z)}return!1}function iD($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function Z3($){if($==="project.goal")return!0;return x0.get($)?.category==="human"}function Q3($,Z=E8){let Q=[],z=[];for(let X of G$){let H=iD($,X.path);if(H==="slotignored")continue;if(!Z(H))continue;(Z3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function z3($,Z,Q=E8){let z=Q3(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let H=X==="needs-human"?Y1(z):[];return{status:X,score:$,gaps:z,ask:H}}function Y1($){return $.human.map((Z)=>({path:Z,question:V1(Z)}))}function nD($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??E8,X=[],H=0;for(let J=0;J<=Q;J++){let G=$.read();if(!G)return{status:"no-faf",score:0,rounds:H,history:X,ask:[]};let V=$.score(G.yaml);X.push(V);let Y=z3(V,G.data,z);if(Y.status==="done")return{status:"done",score:V,rounds:H,history:X,ask:[]};if(Y.status==="needs-human")return{status:"needs-human",score:V,rounds:H,history:X,ask:Y.ask};if(X.length>=2&&V<=X[X.length-2])return Y.gaps.human.length?{status:"needs-human",score:V,rounds:H,history:X,ask:Y1(Y.gaps)}:{status:"stuck",score:V,rounds:H,history:X,ask:[]};if(H>=Q)return{status:"capped",score:V,rounds:H,history:X,ask:Y1(Y.gaps)};$.runAuto(),H++}return{status:"capped",score:X[X.length-1]??0,rounds:H,history:X,ask:[]}}import{createHash as H3}from"crypto";var W1="faf-bench/1",rD={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function sD($,Z){return rD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var U3=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],Q6=new Map;U3.forEach(($,Z)=>$.forEach((Q)=>Q6.set(Q,Z)));var oD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function b8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function X3($){return b8($).split(" ").filter((Z)=>Z&&!oD.has(Z))}function J3($,Z){let Q=b8($),z=b8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=Q6.get(Q);if(X!==void 0&&Q6.get(z)===X)return!0;let H=X3($);if(H.length===0)return!1;let U=new Set(X3(Z));return H.every((J)=>{if(U.has(J))return!0;let G=Q6.get(J);return G!==void 0&&[...U].some((V)=>Q6.get(V)===G)})}function aD($){let Z=J5($),Q=f0($),z=[],X={},H=0;for(let G of p){if(Z.slots[G.path]!=="populated")continue;let V=m1(Q,G);if(typeof V!=="string")continue;let Y=V.trim();if(!Y||D6.has(Y.toLowerCase()))continue;H+=1,z.push({n:H,path:G.path,question:sD(G.path,G.description)}),X[H]=Y}let U=JSON.stringify({v:W1,q:z.map((G)=>[G.path,G.question])}),J=H3("sha256").update(U).digest("hex").slice(0,12);return{version:W1,qsetHash:J,questions:z,answers:X}}function tD($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function eD($,Z){let Q=$.questions.map((X)=>{let H=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof H==="string"&&H.trim()!==""&&J3($.answers[X.n],H)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function $L($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:H3("sha256").update(Q).digest("hex")}}import{join as CI,extname as jI,resolve as wI}from"path";var B1={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"Gemfile.lock":{frameworks:["Ruby"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:34,intelligence:"high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"Package.swift":{frameworks:["Swift"],slots:{packageManager:"spm",mainLanguage:"Swift",buildTool:"swift build"},priority:36,intelligence:"ultra-high"},"*.csproj":{frameworks:["C#",".NET"],slots:{packageManager:"NuGet",mainLanguage:"C#",buildTool:"dotnet"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"settings.gradle":{frameworks:["Java","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java",buildTool:"gradle"},priority:34,intelligence:"high"},"settings.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:34,intelligence:"high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","Swift"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Kotlin","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",backend:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};import{join as QL}from"path";var V$={version:2,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs compose it. Bolster Dart/Flutter by editing THIS file. Logic stays in dart.ts. Refreshed 2026-08-01 (knowledge v2) — community receipt on top of 6.13.0 Dart Edition.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp","dart_mcpserver"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"],["jaspr","Jaspr"],["relic","Relic"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod_annotation","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"],["flutter_hooks","Hooks"]],routing:[["go_router","go_router"],["auto_route","auto_route"],["beamer","Beamer"],["routemaster","Routemaster"]]};var zL=V$.flutterDeps,XL=V$.mcpDeps,HL=V$.serverFrameworks,UL=V$.stateManagement,JL=V$.routing;function GL($){let Z=new Set,Q=!1;for(let z of $.split(`
|
|
251
|
-
`)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){Q=!0;continue}if(/^\S/.test(z))Q=!1;if(Q){let X=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(X)Z.add(X[1].toLowerCase())}}return Z}function
|
|
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
|
|
253
|
-
`)){let H=X.replace(/#.*$/,"").trim();if(!H)continue;let U=H.match(/^\[([^\]]+)\]$/);if(U){z=U[1].trim().toLowerCase();continue}let J=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(J&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(J[1].replace(/-/g,".").toLowerCase(),J[2].toLowerCase()),Z.set(J[1].toLowerCase(),J[2].toLowerCase());continue}let G=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(G&&(z==="libraries"||z.endsWith(".libraries"))){let W=G[1].toLowerCase();Q.set(W,G[2].toLowerCase()),Q.set(W.replace(/-/g,"."),G[2].toLowerCase());continue}let V=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${V[2]}:${V[3]}`.toLowerCase(),B=V[1].toLowerCase();Q.set(B,W),Q.set(B.replace(/-/g,"."),W);continue}let Y=H.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(Y){let W=Y[1].toLowerCase(),B=Y[2];if(z==="plugins"||z.endsWith(".plugins")){let K=B.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=B.split(":");if(K.length>=2){let L=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,L),Q.set(W.replace(/-/g,"."),L)}}}}return{plugins:Z,libraries:Q}}function lL($){let Z=w($,N2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return pL(Z)}function cL($){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 dL($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let H=X.replace(/\/\/.*$/,"").trim();if(!H||H.startsWith("id")||H.startsWith("kotlin")||H.startsWith("alias"))continue;let U=H.match(/^`([a-zA-Z0-9.-]+)`$/)||H.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(U)Q.add(U[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),H=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(H)Q.add(H);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function iL($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let H=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let U of H){let J=Z.libraries.get(U);if(J){Q.add(J.includes(":")?J.split(":").slice(0,2).join(":"):J);break}}}return Q}function K3($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,z=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(z){let U=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),J=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(U&&J)Q.add(`${U}:${J}`.toLowerCase())}let X=new Set;for(let U of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let J=U[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),G=U[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&G)X.add(`${J}:${G}`.toLowerCase())}let H=[];for(let U of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))H.push(U[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:H}}function z2($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;for(let z of $)if(z===Q||z.endsWith(`.${Q}`)||z===Q.replace(/^org\.gradle\./,""))return!0;return!1}function z6($,Z,Q){let z;for(let[X,H]of Z){let U=!1;if(Q==="plugin")U=z2($,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 nL($){let Z;for(let Q of EL)for(let z of $){if(z===Q||z.startsWith(`${Q}:`)||z.startsWith(Q.replace(/:mcp$/,":"))){if(!Z||Q.length>Z.length)Z=Q}if(z.startsWith("io.modelcontextprotocol")||z.includes("spring-ai-starter-mcp")||z.includes("spring-ai-mcp")){if(!Z||z.length>Z.length)Z=z}}return Z}function D3($,Z){let Q=new Set,z=!1,X=!1,H=[N2(Z,"src"),N2(Z,"src","main")],U=(J,G)=>{if(G>4)return;let V=k($,J);if(!V)return;for(let{name:Y}of V){if(Y==="androidMain"||Y==="commonMain"||Y==="jvmMain"||Y==="iosMain")Q.add(Y);let W=N2(J,Y),B=I0($,W);if(!B)continue;if(B.isDirectory())U(W,G+1);else if(Y.endsWith(".kt")||Y.endsWith(".kts"))z=!0;else if(Y.endsWith(".java"))X=!0}};for(let J of H)U(J,0);return{kotlin:z,java:X,hints:Q}}function rL($){let Z=[],Q=$.plugins,z=$.artifacts,X=vL.some((F)=>z2(Q,F))||$.sourceHints.has("commonMain"),H=z2(Q,"com.android.application"),U=!H&&gL.some((F)=>z2(Q,F));if(H||U)Z.push("android");if(X)Z.push("multiplatform");let J=nL(z),G=z6(Q,bL,"plugin"),V=z6($.parents,yL,"parent"),Y=z6(z,xL,"artifact"),W=z6(Q,hL,"plugin"),B=z6(z,uL,"artifact"),K=fL.some((F)=>z2(Q,F)),L=$.packaging==="pom",q,D="",O;if(H)q="mobile",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + com.android.application (${D})`;else if(J)q="mcp",D="MCP",Z.push("mcp"),O=`${$.path||"root"} + ${J} (JVM MCP server)`;else if(G||V||Y){q="backend",D=G?.[1]||V?.[1]||Y?.[1]||"JVM";let F=G?.[0]||V?.[0]||Y?.[0]||"web";O=`${$.path||"root"} + ${F} (JVM backend)`}else if(X&&!U)q="library",D="Kotlin Multiplatform",O=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(U)q="library",D=X?"Android+KMP":"Android",O=`${$.path||"root"} + android library (${D})`;else if(B||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)q="cli",D=B?.[1]||"application",O=B?`${$.path||"root"} + ${B[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)q="cli",D="application",O=`${$.path||"root"} + application plugin (JVM CLI)`;else if(L)q="library",O=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{q="library";let F=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(O=`${$.path||"root"} (${F} library)`,K)O=`${$.path||"root"} + java-library (JVM library)`}let M="Java";if($.kotlinSources&&$.javaSources)M="Java/Kotlin";else if($.kotlinSources||kL.some((F)=>z2(Q,F))||X)M="Kotlin";let C=[...new Set(Z)];return{appType:q,framework:D,facets:C,found:O,buildTool:$.buildTool,mainLanguage:M}}function sL($,Z){if($==="mcp")return 0;if($==="mobile")return 1;if(Z.includes("multiplatform")&&$==="backend")return 2;if($==="backend")return 3;if($==="cli")return 4;if(Z.includes("multiplatform"))return 5;if(Z.includes("android"))return 6;return 7}function B3($,Z,Q){let z=N2(Z,"build.gradle.kts"),X=N2(Z,"build.gradle"),H=I($,z)?z:I($,X)?X:null;if(!H)return null;let U=w($,H);if(!U)return null;let J=dL(U,Q),G=iL(U,Q),V=D3($,Z),Y=/mainClass\s*[.=]/.test(U)||/mainClassName\s*=/.test(U)||/Main-Class/.test(U),W=z2(J,"application")||z2(J,"org.gradle.application");return{path:Z||"build.gradle",plugins:J,artifacts:G,packaging:"jar",parents:new Set,hasMainClass:Y,hasApplicationPlugin:W,sourceHints:V.hints,kotlinSources:V.kotlin||H.endsWith(".kts"),javaSources:V.java,buildTool:"gradle"}}function q3($,Z){let Q=w($,N2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:H}=K3(Q),U=D3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:H,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:U.hints,kotlinSources:U.kotlin,javaSources:U.java,buildTool:"maven"}}function X6($){if(!K1($))return null;let Z=lL($),Q=[],z=null;for(let V of["settings.gradle.kts","settings.gradle"])if(I($,V)){z=w($,V);break}let X=z?cL(z):[],H=B3($,"",Z);if(H)Q.push(H);for(let V of X){let Y=B3($,V,Z);if(Y)Q.push(Y)}let U=q3($,"");if(U){Q.push(U);let V=w($,"pom.xml");if(V){let{modules:Y}=K3(V);for(let W of Y){let B=q3($,W);if(B)Q.push(B)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let J=null,G=999;for(let V of Q){let Y=rL(V),W=sL(Y.appType,Y.facets);if(!J||W<G)J={appType:Y.appType,framework:Y.framework,buildTool:Y.buildTool,mainLanguage:Y.mainLanguage,facets:Y.facets,found:Y.found},G=W}if(J&&X.length>0&&!J.found.includes("multi-project"));return J}import{join as aL}from"path";var H6={version:1,_doc:"SINGLE SOURCE of Ruby detection KNOWLEDGE (Truth-is-faf-cli). faf-cli imports this; SDKs/MCPs compose it. Kill line: Gemfile alone ≠ Rails. Content-aware: gem names + light layout. 2026-08-03 initial (post-intel ruby-edition).",mcpGems:["mcp","fast-mcp","fast_mcp","rails-mcp-server","rails_mcp_server","ruby-mcp-client","ruby_mcp_client","ruby_llm-mcp","ruby_llm_mcp"],webGems:[["rails","Rails"],["railties","Rails"],["sinatra","Sinatra"],["sinatra-contrib","Sinatra"],["roda","Roda"],["grape","Grape"],["hanami","Hanami"],["hanami-controller","Hanami"],["rack","Rack"]],cliGems:[["thor","Thor"],["gli","GLI"],["commander","Commander"],["slop","Slop"]],railsLayoutFiles:["config/application.rb","config/routes.rb","bin/rails","config/environment.rb"]};var tL=H6.mcpGems.map(($)=>$.toLowerCase()),eL=H6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),L3=H6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),$I=H6.railsLayoutFiles;function ZI($){return I($,"Gemfile")||I($,"gems.rb")||QI($)}function QI($){return(k($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function zI($){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
|
|
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 RI($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let H of Q)if(H.includes(X)&&(!z||X.length>z.length))z=X;return z}function O3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,H]of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z[0].length))z=[X,H];return z}function M3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,H]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,H];return z}function NI($){let Z=$.map((Q)=>Q.toLowerCase());return BI.some((Q)=>Z.includes(Q))}function TI($){let Z=!1,Q=!1,z;for(let X of L1($)){let H=w($,YI(X,"project.pbxproj"));if(!H)continue;for(let U of II)if(H.includes(U))Z=!0,z=U;for(let U of OI)if(H.includes(U)){if(Q=!0,!z)z=U}}return{hasApplication:Z,hasTool:Q,hit:z}}function AI($){for(let Z of MI)if(I($,Z))return Z;return}function J6($){if(!_I($))return null;let Z=I($,"Package.swift"),Q=L1($),z=Q.length>0,X=null;if(Z){let P=w($,"Package.swift");if(P)X=PI(P)}let H=z?TI($):{hasApplication:!1,hasTool:!1},U=AI($),J=X?.packageUrls??[],G=X?.productNames??[],V=RI(J,WI),Y=NI(G),W=O3(J,qI),B=M3(G,KI),K=O3(J,DI),L=M3(G,LI),q=!!(V||Y),D=!!(W||B||U),O=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),M=!!(K||L),C=H.hasApplication,F=Z&&z?"spm+xcode":Z?"spm":"xcode",N,T="",j;if(q)if(N="mcp",T="MCP",Y)j="Package.swift + product MCP (Swift MCP)";else j=`Package.swift + ${V} (Swift MCP)`;else if(D)if(N="backend",T=B?.[1]||W?.[1]||(U?"Vapor":""),B)j=`Package.swift + product ${B[1]} (Swift backend)`;else if(W)j=`Package.swift + ${W[1]} (Swift backend)`;else j=`${U} (Swift backend layout)`;else if(C)N="app",T="",j=`${Q[0]} + ${H.hit||"application"} (Swift app)`;else if(M||O&&!D&&!q)if(N="cli",T=L?.[1]||K?.[1]||"",L)j=`Package.swift + product ${L[1]} (Swift CLI)`;else if(K)j=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)j="Package.swift + .executable product (Swift CLI)";else j="Package.swift + .executableTarget (Swift CLI)";else if(H.hasTool&&!Z)N="cli",j=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(N="library",X?.hasLibraryProduct)j="Package.swift + .library product (Swift library)";else j="Package.swift (Swift library)";else N="library",j=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:N,framework:T,packageManager:F,found:j}}var SI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),EI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),bI={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"]},yI=[["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 xI($,Z){for(let[Q,z]of yI)if(Q in $)return z;return Z.length>0?"framework":"config"}function gI($,Z){try{let Q=JSON.parse(w($,Z)??""),z=["background","content_scripts","action","browser_action","permissions"].some((X)=>(X in Q));if(typeof Q.manifest_version==="number"&&z)return"chrome";return"other"}catch{return"other"}}function vI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return I0($,Z.name)?.isFile()===!0}function kI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return I0($,Z.name)?.isDirectory()===!0}function hI($){let Z=[],Q=wI($),z=new Set,X=k(Q);if(!X)return Z;for(let H of X){let U=H.name;if(U.endsWith(".xcodeproj")?!kI(Q,H):!vI(Q,H))continue;if(U.toLowerCase().endsWith(".csproj")){let G=k8(Q);if(G){let V={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile"&&G.framework)V.framework=G.framework;if(G.targetFramework)V.runtime=G.targetFramework;let Y=G.framework?[G.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:V,priority:36,frameworks:Y,fileName:U})}continue}if(U.endsWith(".xcodeproj")){let G=J6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="spm"?"spm":"Xcode",buildTool:G.packageManager.includes("spm")?"swift build":"xcodebuild"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:36,frameworks:Y,fileName:U})}continue}let J=B1[U];if(!J)continue;if(U==="manifest.json"&&gI(Q,U)!=="chrome")continue;if(U==="pubspec.yaml"){let G=y8(Q);if(G){let V={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(V.framework="Flutter",G.stateManagement)V.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="mcp")V.apiType="MCP";Z.push({slots:V,priority:J.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}if(U==="go.mod"){let G=g8(Q);if(G){let V={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Go"]:["Go"];Z.push({slots:V,priority:J.priority,frameworks:Y,fileName:U});continue}}if(U==="Gemfile"||U==="Gemfile.lock"||U==="gems.rb"){let G=h8(Q);if(G){let V={mainLanguage:"Ruby",packageManager:G.packageManager};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";let Y=G.framework?[G.framework,"Ruby"]:["Ruby"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:U});continue}}if(U==="Package.swift"){let G=J6(Q);if(G){let V={mainLanguage:"Swift",packageManager:G.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="app"&&G.framework)V.framework=G.framework;let Y=G.framework?[G.framework,"Swift"]:["Swift"];Z.push({slots:V,priority:J.priority??36,frameworks:Y,fileName:U});continue}}if(U==="pom.xml"||U==="build.gradle"||U==="build.gradle.kts"||U==="settings.gradle"||U==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let G=X6(Q);if(G){let V={mainLanguage:G.mainLanguage==="Java/Kotlin"?"Kotlin":G.mainLanguage,packageManager:G.buildTool==="maven"?"maven":"gradle",buildTool:G.buildTool};if(G.appType==="backend"&&G.framework)V.backend=G.framework;else if(G.appType==="cli"&&G.framework)V.framework=G.framework;else if(G.appType==="mcp")V.apiType="MCP";else if(G.appType==="mobile")V.framework=G.framework||"Android";if(G.facets.includes("multiplatform"))V.framework=G.framework||"Kotlin Multiplatform";let Y=G.framework?[G.framework,"JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",G.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:V,priority:J.priority??35,frameworks:Y,fileName:U});continue}}Z.push({slots:J.slots||{},priority:J.priority,frameworks:J.frameworks,fileName:U})}return Z}function uI($){let Z=[];for(let Q of e2($,()=>P3($,2,{count:0}))){let z=B1[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function _3($){let Z=[...hI($),...uI($)],Q={},z={},X=new Set;for(let V of Z){V.frameworks.forEach((Y)=>X.add(Y));for(let[Y,W]of Object.entries(V.slots))if(W&&!W.includes("/")&&(!(Y in Q)||V.priority>z[Y]))Q[Y]=W,z[Y]=V.priority}let H=new Map;for(let V of Z){if(!V.fileName)continue;if(!H.has(V.fileName))H.set(V.fileName,{fileName:V.fileName,category:xI(V.slots,V.frameworks),priority:V.priority})}let U=[...H.values()].sort((V,Y)=>Y.priority-V.priority||V.fileName.localeCompare(Y.fileName)),J=[];if(Q.mainLanguage)J.push(Q.mainLanguage.toLowerCase());if(Q.framework)J.push(Q.framework.toLowerCase());let G=J.length>0?J.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:U,stackSignature:G}}function u8($){let{slotFills:Z}=_3($),Q={};for(let[z,X]of Object.entries(Z)){let H=bI[z];if(!H||!X)continue;let[U,J]=H;if(U==="project")(Q.project??={})[J]=X;else(Q.stack??={})[J]=X}return Q}function P3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=k($);if(!X)return z;for(let H of X){if(Q.count++>400)break;if(!H.isDirectory()){let U=jI(H.name);if(EI.has(U))z.add(U);continue}if(SI.has(H.name)||H.name.startsWith("."))continue;for(let U of P3(CI($,H.name),Z-1,Q))z.add(U)}return z}var $0=($,Z,Q)=>({value:$,source:Z,confidence:Q});function F3($,Z={}){let Q=Z.toolingRoot?null:fI($),z=mI($),X={},H=(U,J)=>{if(J)X[U]=J};return H("what",cI(Q,z)),H("who",dI(z)),H("why",iI(z)),H("where",nI(Q,z)),H("when",rI(z)),H("how",sI(Q,z)),X}function f8($,Z={}){let Q=F3($,Z),z={};return Object.keys(Q).forEach((X)=>{let H=Q[X];if(H)z[X]=H.value}),z}function fI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function mI($){let Z=w($,"README.md");if(Z===null)return"";return Z.replace(/<!--[\s\S]*?-->/g,"").split(`
|
|
258
|
-
`).
|
|
259
|
-
`).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function T2($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function pI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function W$($,Z){let Q=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||pI(z[2])>0.4)return null;return{body:T2(z[2]),heading:z[1].trim()}}function lI($){let Z=$.trim();if(/^>/.test(Z))return!0;if(/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test(Z))return!0;let Q=Z.split(/[·|]/).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return!1}function G6($,Z,Q=30){for(let z of Z){let X=$.match(z);if(X&&X[1]&&X[1].trim().length>=Q)return T2(X[1])}return null}function cI($,Z){if($?.description&&$.description.length>20)return $0(T2($.description),"package.json:description",0.95);let Q=W$(Z,"Purpose|What|About|Overview|Description");if(Q)return $0(Q.body,`README:## ${Q.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((H)=>H.replace(/\s+/g," ").trim()).find((H)=>H.length>30&&!H.startsWith("#")&&!lI(H));if(z)return $0(T2(z),"README:first-paragraph",0.5);let X=G6(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return X?$0(X,"README:problem-heuristic",0.6):null}function dI($){let Z=W$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return Q?$0(Q,"README:audience-heuristic",0.6):null}function iI($){let Z=W$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return Q?$0(Q,"README:mission-heuristic",0.6):null}function nI($,Z){let Q=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(Q)return $0(T2(Q.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return $0(T2($.homepage),"package.json:homepage",0.9);let z=G6(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?$0(z,"README:deploy-heuristic",0.6):null}function rI($){let Z=W$($,"Timeline|Status|Release|Roadmap");if(Z)return $0(Z.body,`README:## ${Z.heading}`,0.8);let Q=G6($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return Q?$0(Q,"README:since-heuristic",0.6):null}function sI($,Z){let Q=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((U)=>Q.includes(U));if(z.length)return $0(T2(z.map((U)=>`npm run ${U}`).join(", ")),"package.json:scripts",0.9);let X=W$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(X)return $0(X.body,`README:## ${X.heading}`,0.8);let H=W$(Z,"Architecture|Approach|How it works|Methodology|How");return H?$0(H.body,`README:## ${H.heading}`,0.7):null}var R3="3.0";import{join as T3}from"path";var N3=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"anyDependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"},{type:"devDependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"content",pattern:"app.py",key:"flask"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"content",pattern:"main.py",key:"fastapi"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"content",pattern:"Gemfile",key:"rails"},{type:"content",pattern:"Gemfile.lock",key:"rails ("},{type:"file",pattern:"config/application.rb"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"content",pattern:"pom.xml",key:"spring-boot"},{type:"content",pattern:"build.gradle",key:"springframework.boot"},{type:"content",pattern:"build.gradle.kts",key:"springframework.boot"},{type:"content",pattern:"gradle/libs.versions.toml",key:"springframework.boot"}]},{name:"Vapor",slug:"vapor",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"vapor/vapor"},{type:"content",pattern:"Package.swift",key:'product(name: "Vapor"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Vapor'"},{type:"file",pattern:"Sources/App/configure.swift"}]},{name:"Hummingbird",slug:"hummingbird",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"hummingbird-project/hummingbird"},{type:"content",pattern:"Package.swift",key:'product(name: "Hummingbird"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Hummingbird'"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function oI($){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 aI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function tI($,Z){if(Z?.keywords?.some((z)=>/^sdk(?:\s|-|$)|-sdk$/i.test(z)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let Q=oI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function eI($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let Q of Z){let z=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 $O($){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 ZO($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of Q)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(I($,"ios")&&I($,"android"))return"ios/ + android/ dirs";return null}function QO($,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 zO($,Z){if(!I($,"index.html"))return null;if(Z?.dependencies||Z?.devDependencies){let Q={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((X)=>Q[X]))return null}return"index.html (vanilla, no frontend framework)"}function XO($,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 HO($,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 UO($,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 JO($,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 GO($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||I($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var VO=new Set(["node_modules","dist","build","out","vendor","target","coverage","docs","doc","e2e","tests","test","__tests__","scripts","deploy","bin","public","examples","example","fixtures","assets","static","migrations","config","contracts","proto","protos"]),A3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,YO=new Set(["frontend","backend","database","css","ui","state"]);function WO($){if(I($,"pyproject.toml")||I($,"manage.py")||I($,"setup.py")||m8($,"requirements*.txt"))return!0;if(I($,"go.mod"))return!0;if(I($,"Cargo.toml"))return!0;if(I($,"Gemfile"))return!0;if(I($,"pom.xml")||m8($,"build.gradle*"))return!0;if(Y$($).length>0)return!0;let Z=W0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function p8($){return e2($,()=>BO($))}function BO($){let Z=k($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||VO.has(z.name))continue;let X=T3($,z.name);if(!WO(X))continue;let H=c8(X);if(!H)continue;let U=l8(X).filter((Y)=>YO.has(Y.category)),J=U.find((Y)=>Y.category==="frontend"),G=U.find((Y)=>Y.category==="backend"),V=J??G??U[0]??null;Q.push({name:z.name,language:H,topFramework:V?.name??null,frontend:!!J,backend:!!G||A3.test(H),hasFramework:!!V,appRoot:I(X,"manage.py")||I(X,"config.ru")||I(X,"bin/rails")||I(X,"artisan")})}return Q}function qO($,Z){if(Z?.workspaces||I($,"pnpm-workspace.yaml"))return null;let Q=p8($),z=new Set(Q.map((X)=>X.language));if(Q.length<2||z.size<2)return null;if(!Q.some((X)=>X.frontend)||!Q.some((X)=>X.backend))return null;return`polyglot: ${Q.map((X)=>`${X.name}/ (${X.language})`).join(", ")}`}function C3($){let Z=p8($);if(Z.length<2)return null;let Q=(U)=>(U.appRoot?2:0)+(A3.test(U.language)?2:0)+(U.hasFramework?1:0)+(U.frontend?0.5:0),z=[...Z].sort((U,J)=>Q(J)-Q(U)),X=new Set,H=[];for(let U of z){if(X.has(U.language))continue;X.add(U.language);let J=U.frontend?"frontend":U.backend?"backend":"service";H.push(U.topFramework?`${U.language} (${U.topFramework} · ${J})`:`${U.language} (${J})`)}return H.join("; ")}function W0($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function m8($,Z){if(!Z.includes("*"))return I($,Z);let Q=Z.split("/");if(Q.length===1){let J=Z.split("*")[0];return(k($)??[]).some((G)=>G.name.startsWith(J))}let z=T3(...Q.slice(0,-1)),X=Q[Q.length-1],H=X.split("*")[0],U=X.split("*")[1]||"";return(k($,z)??[]).some((J)=>J.name.startsWith(H)&&J.name.endsWith(U))}function KO($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"anyDependency":{let z=$.key??"";return!!(Z?.dependencies?.[z]||Z?.devDependencies?.[z])}case"file":return m8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!m8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function l8($){let Z=W0($);return N3.map((Q)=>{let X=Q.signals.filter((H)=>KO(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 c8($){let Z=W0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(I($,"tsconfig.json"))return"TypeScript";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(Y$($).length>0)return"C#";if(I($,"pyproject.toml")||I($,"setup.py"))return"Python";if(I($,"Gemfile"))return"Ruby";if(K1($)){let Q=X6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(I($,"Package.swift"))return"Swift";if(I($,"build.zig"))return"Zig";if(I($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function j3($){let Z=[];if(I($,"SKILL.md"))Z.push("SKILL.md");for(let Q of["skills",""])for(let z of k($,Q||".")??[]){if(!z.isDirectory()||z.name.startsWith(".")||z.name==="node_modules")continue;if(Q===""&&z.name==="skills")continue;let X=Q?`${Q}/${z.name}/SKILL.md`:`${z.name}/SKILL.md`;if(I($,X))Z.push(X)}return Z}function DO($){let Z=j3($);if(Z.length===0)return null;let Q=[Z.length===1?Z[0]:`${Z.length} SKILL.md folders`];if(I($,".claude-plugin/plugin.json"))return Q.push(".claude-plugin/plugin.json"),{type:"skills-plugin",found:Q};return{type:"skills",found:Q}}function w3($){if(j3($).length===0)return"";return I($,".claude-plugin/plugin.json")?"Claude Code plugin":"Agent Skills"}function S3($){let Z=W0($),Q=l8($),z=[],X=XO($,Z);if(X)return z.push(X),{type:"documentation",found:z};let H=tI($,Z);if(H)return z.push(H),{type:"sdk",found:z};let U=eI($);if(U)return z.push(U),{type:"extension",found:z};let J=JO($,Z,Q);if(J)return z.push(J),{type:"mcpaas",found:z};let G=UO($,Z);if(G)return z.push(G),{type:"saas",found:z};let V=QO($,Z);if(V)return z.push(V),{type:"wasm",found:z};let Y=y8($);if(Y)return z.push(Y.found),{type:Y.appType,found:z};let W=g8($);if(W)return z.push(W.found),{type:W.appType,found:z};let B=k8($);if(B)return z.push(B.found),{type:B.appType,found:z};let K=X6($);if(K)return z.push(K.found),{type:K.appType,found:z};let L=h8($);if(L)return z.push(L.found),{type:L.appType,found:z};let q=J6($);if(q)return z.push(q.found),{type:q.appType,found:z};let D=ZO($,Z);if(D)return z.push(D),{type:"mobile",found:z};if(Q.some((y)=>y.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(aI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(I($,"build.zig")){if(z.push("build.zig"),I($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(I($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let M=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit");if(Z?.private===!0&&(I($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&M)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(M)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let F=Q.some((y)=>y.category==="frontend"),N=Q.some((y)=>y.category==="backend");if(Z?.private&&(Z.workspaces||I($,"pnpm-workspace.yaml"))&&F&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=GO($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let j=HO($,Z,Q);if(j)return z.push(j),{type:"website",found:z};if(Q.some((y)=>y.slug==="nextjs"||y.slug==="nuxt"))return z.push(Q.find((y)=>y.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let E=Q.some((y)=>y.category==="frontend"),n=Q.some((y)=>y.category==="backend");if(E&&n)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(E)return z.push("frontend framework"),{type:"frontend",found:z};if(n)return z.push("backend framework"),{type:"backend",found:z};let a=$O($);if(a)return z.push(a),{type:"data-science",found:z};let v=zO($,Z);if(v)return z.push(v),{type:"html",found:z};let A=qO($,Z);if(A)return z.push(A),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};let b=DO($);if(b)return z.push(...b.found),{type:b.type,found:z};return z.push(y2),{type:"library",found:z}}function E3($){if(I($,"bunfig.toml"))return"Bun";if(I($,"deno.json")||I($,"deno.jsonc"))return"Deno";if(W0($))return"Node.js";if(I($,"Cargo.toml"))return"Rust";if(I($,"go.mod"))return"Go";if(Y$($).length>0)return".NET";if(I($,"pubspec.yaml"))return"Dart";return""}var LO=new Set(["npm","pnpm","yarn","bun"]);function IO($){let Z=W0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return LO.has(Q)?Q:""}function OO($){if(I($,"pubspec.yaml"))return"pub";if(I($,"go.mod"))return"go modules";if(Y$($).length>0)return"NuGet";if(I($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>I($,Q))?"gradle":""}var MO=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function b3($){return OO($)||IO($)||(MO.find(([Z])=>I($,Z))?.[1]??"")}function y3($){if(I($,".github/workflows"))return"GitHub Actions";if(I($,".gitlab-ci.yml"))return"GitLab CI";if(I($,".circleci"))return"CircleCI";if(I($,"Jenkinsfile"))return"Jenkins";return null}function x3($){if(I($,"vercel.json"))return"Vercel";if(I($,"netlify.toml"))return"Netlify";if(I($,"wrangler.toml"))return"Cloudflare";if(I($,"fly.toml"))return"Fly.io";if(I($,"render.yaml"))return"Render";return null}var _O=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function PO($){for(let z of _O){let X=w($,z)?.match(/@sveltejs\/adapter-(\w+)/);if(X)return X[1]}let Z=W0($);return Object.keys({...Z?.dependencies,...Z?.devDependencies}).map((z)=>/^@sveltejs\/adapter-(\w+)$/.exec(z)?.[1]).find(Boolean)??null}function g3($){let Z=PO($);if(Z)switch(Z){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return Z}return null}function I1($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function v3($){let Z=W0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return I1(Z);if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(I($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function d8($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>I($,Q))}function i8($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=I($,"bun.lock")||I($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(I($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&FO($))Q.lint="cargo clippy"}if(I($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(O1($,"build.zig")))Q.test="zig build test"}if(I($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&RO($))Q.test="pytest";return Q}function O1($,Z){return w($,Z)??""}function FO($){if(I($,"clippy.toml")||I($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(O1($,"Cargo.toml"))}function RO($){if(I($,"pytest.ini")||I($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(O1($,Z)))}function k3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let H=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let U of Q)if(H.has(U.category))X.push(U.name);if(I($,"bunfig.toml"))X.push("Bun");else if(I($,"deno.json")||I($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let U=Object.keys(Z.dependencies).slice(0,5);for(let J of U)if(!X.some((G)=>G.toLowerCase().includes(J.toLowerCase())))X.push(J)}return X}function NO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function h3($){return M1($).data}function M1($){let Z=W0($),Q=l8($),z=S3($),X=z.type,H=z.found.some((x)=>x.startsWith("polyglot:")),U=H&&C3($)||c8($),J=E3($),G=b3($),V=y3($),Y=x3($),W=v3($),B=Q.find((x)=>x.slug==="sveltekit")??Q.find((x)=>x.category==="frontend"),K=Q.find((x)=>x.category==="css"),L=Q.find((x)=>x.category==="ui"),q=Q.find((x)=>x.category==="state"),D=Q.find((x)=>x.category==="backend"),O=Q.find((x)=>x.category==="database"),M=(x)=>x2(X,x)??x2("library",x)===!0,C=X==="framework",F=Q.some((x)=>x.slug==="svelte"||x.slug==="sveltekit"),N=C&&F?"svelte":C?null:null,T=X==="svelte"||N==="svelte",j=T?g3($):null,P=T&&Q.some((x)=>x.slug==="sveltekit"),E={},n=p.filter((x)=>x.path.startsWith("stack."));for(let x of n){let h=x.path.replace("stack.","");switch(h){case"frontend":E[h]=B?.name??w3($);break;case"css_framework":E[h]=K?.name??"";break;case"ui_library":E[h]=L?.name??"";break;case"state_management":E[h]=q?.name??(T&&NO(Z)>=5?"Runes":"");break;case"backend":E[h]=T?P?"SvelteKit":D?.name??"":D?.name??"";break;case"api_type":E[h]=P?"Server Routes":"";break;case"runtime":E[h]=J;break;case"database":E[h]=O?.name??"";break;case"connection":E[h]=O?.name??"";break;case"hosting":if(T&&j)E[h]=j;else E[h]=Y??"";break;case"build":E[h]=P?I1(Z):W??"";break;case"cicd":E[h]=V??"";break;case"package_manager":E[h]=G;break;default:E[h]="";break}}let a={};for(let x of n){let h=x.path.replace("stack.","");a[h]=M(x)?E[h]:"slotignored"}let v={},A=p.filter((x)=>x.path.startsWith("monorepo."));for(let x of A){let h=x.path.replace("monorepo.","");if(!M(x))v[h]="slotignored";else v[h]=""}let b={name:Z?.name??$.split("/").pop()??"project",goal:H?"":Z?.description??"",main_language:U,type:X};if(C&&N)b.framework=N;let y=k3($,Z,Q,H?c8($):U);if(H){for(let x of p8($))for(let h of[x.language,x.topFramework])if(h&&!y.includes(h))y.push(h)}let q0=d8($),u1=i8($,Z),K6={faf_version:R3,project:b,stack:a,human_context:{who:"",what:H?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:v,_meta:{found:z.found}};if(y.length>0)K6.tech_stack=y;if(q0.length>0)K6.key_files=q0;if(Object.keys(u1).length>0)K6.commands=u1;return{data:K6,facts:E}}var u3={MIN_LENGTH:8,MAX_LENGTH:280},TO=[/^(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<u3.MIN_LENGTH)return!1;if(Z.length>u3.MAX_LENGTH)return!1;if(TO.some((Q)=>Q.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
|
|
260
|
-
`).length>4)return
|
|
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
|
-
`)
|
|
263
|
-
`)
|
|
264
|
-
`),z=
|
|
265
|
-
`),z=!1;for(let X of Q){let H=X.trim();if(/^\[/.test(H)){z=H==="[package]";continue}if(!z)continue;let U=H.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(U){let J=U[1].trim();J=J.replace(/\s*#.*$/,"").trim();let G=J.match(/^"((?:[^"\\]|\\.)*)"$/)||J.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return J}}return null}function P1($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=gO(Z,"description");if(Q&&_0(Q))return{project:{goal:Q}};return{}}import{join as f3}from"path";var vO=[{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"}],kO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function hO($){let Z=[],Q=(z,X)=>{for(let H of k($,z)??[])if(H.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(H.name))Z.push(f3(z,H.name));else if(H.isDirectory()&&X>0&&!H.name.startsWith(".")&&!kO.has(H.name))Q(f3(z,H.name),X-1)};return Q(".",1),Z}function V6($){return[...$].join(" · ")}function F1($){let Z=hO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let H=w($,X);if(H===null)continue;for(let U of H.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let J=U[1].toLowerCase(),G=J.replace(/:[^/]*$/,"").split("/").pop()??J,V=J.replace(/:[^/]*$/,"");for(let{re:Y,slot:W,label:B}of vO)if(Y.test(G)||Y.test(V))Q[W].add(B)}}let z={};if(Q.database.size)z.database=V6(Q.database);if(Q.cache.size)z.cache=V6(Q.cache);if(Q.search.size)z.search=V6(Q.search);if(Q.storage.size)z.storage=V6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${V6(Q.runtime)})`;if(Object.keys(z).length===0&&!Q.runtime.size)return{stack:{hosting:"Docker Compose"}};return z.hosting="Docker Compose",{stack:z}}import{join as uO}from"path";var fO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),mO=[{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 R1($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function pO($){let Z=[$];for(let Q of k($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!fO.has(Q.name))Z.push(uO($,Q.name));return Z}function lO($){let Z=0;if(I($,"manage.py")||I($,"pyproject.toml")||I($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function N1($){return e2($,()=>cO($))}function cO($){let Z=[];for(let z of pO($)){let X=z===$,H=X?"":`cd ${z.slice($.length+1)} && `;for(let U of mO){let J=w(z,U.file);if(J===null)continue;let G=U.targets(J);if(G.length===0)continue;let V={},Y=R1(G,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=R1(G,[/^build$/i,/^compile$/i,/^build/i]),B=R1(G,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(Y)V.test=`${H}${U.runner} ${Y}`;if(W)V.build=`${H}${U.runner} ${W}`;if(B)V.lint=`${H}${U.runner} ${B}`;if(Object.keys(V).length===0)continue;Z.push({score:Object.keys(V).length+(X?10:lO(z)),commands:V})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var dO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function T1($){for(let Z of dO)if(I($,Z))return{security:{secrets:".env",example:Z}};return{}}function iO($,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 A1($){return[_1($),P1($),F1($),N1($),T1($)].reduce(iO,{})}function m3($){try{let Z=s2($,{logLevel:"error"}).getIn(["project","type"],!0);return o(Z)&&typeof Z.comment==="string"&&Z.comment.includes(y2)}catch{return!1}}function C1($){let Z=h3($),Q=A1($),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=p0(p0(z,Z),X);QM(H);let J=(Z._meta?.found??[]).some((V)=>V.startsWith("polyglot:")),G=p0(H,u8($));return p0(G,{human_context:f8($,{toolingRoot:J})})}function nO($,Z){let Q=ZM(B8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=M1($),H=z,U=p0(Q,A1($)),J=p0(U,H),G=p0(J,u8($)),V=oO(p0(G,{human_context:f8($)}),Q),Y=aO(rO(Z,Q,H)?tO(p3(V,Q),Q,X):p3(V,Q),Q);return f9(h9(Z,Y))}function rO($,Z,Q){if(!r(Z0(Z,"project.type"))){let X=a$($)?.text;return X===void 0||!m3(X)}return!(Q._meta?.found??[]).includes(y2)}function j1($){return $.canonical?[$.path,$.canonical]:[$.path]}function Z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return f(X)?X[z]:void 0}function X2($,Z,Q){let[z,X]=Z.split("."),H=$[z];if(!f(H))return;if(Q===void 0?!(X in H):H[X]===Q)return;let U={...H};if(Q===void 0)delete U[X];else U[X]=Q;$[z]=U}var H2=($)=>typeof $==="string"&&$.trim()===L6;function sO($,Z){let Q=Z.map((z)=>Z0($,z));return Q.some(H2)&&Q.every((z)=>r(z)||H2(z))}function p3($,Z){let Q={...$};for(let z of p){let X=j1(z);if(!sO(Z,X))continue;for(let H of X){let U=Z0(Z,H);if(Z0(Q,H)!==U)X2(Q,H,U)}}return Q}function C2($,Z){let[Q,z]=Z.split("."),X=$[Q];return f(X)&&Object.prototype.hasOwnProperty.call(X,z)}function oO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!C2(Z,z.canonical)||C2(Z,z.path))continue;let X=Z0(Q,z.path);X2(Q,z.path,void 0);let H=Z0(Q,z.canonical);if(n8(X)&&r(H))X2(Q,z.canonical,X)}return Q}function aO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!C2(Z,z.canonical)||C2(Z,z.path))continue;let X=Z0(Q,z.canonical);if(n8(X)||H2(X))X2(Q,z.path,X)}return Q}function tO($,Z,Q={}){let z=$.project,X=f(z)?z.type:void 0,H={...$};for(let U of p){if(U.category==="human"||U.category==="project")continue;let J=x2(X,U);if(J===null)return $;if(J){let G=typeof X==="string"&&I6[X]?.has(U.path)===!0;eO(H,Z,U,U.path.startsWith("stack.")?Q[U.path.slice(6)]:void 0,G)}else $M(H,U)}return H}function eO($,Z,Q,z,X=!1){let H=j1(Q),U=(G)=>!r(Z0($,G))&&!H2(Z0($,G));for(let G of H){if(!H2(Z0($,G)))continue;if(X)X2($,G,H.some(U)?void 0:"");else if(!H2(Z0(Z,G)))X2($,G,C2(Z,G)?Z0(Z,G):"")}if(!n8(z))return;let J=H.filter((G)=>C2($,G));if(J.some((G)=>!r(Z0($,G))))return;for(let G of J.length>0?J:[Q.path])X2($,G,z)}function $M($,Z){let Q=j1(Z).filter((X)=>C2($,X)),z=(X)=>!r(Z0($,X))&&!H2(Z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(r(Z0($,X)))X2($,X,L6)}function ZM($){let Z=$.project;if(Z===null||Z===void 0||f(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function QM($){let Z=$.project?.type??"library",Q=b2[Z]||b2.library;for(let z of p){if(Q.includes(z.category)||I6[Z]?.has(z.path))continue;let[X,H]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[H]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[H]="slotignored"}}function p0($,Z){return l3($,Z,"")}function zM($){let Z=x0.get($);return Z!==void 0&&Z.category!=="human"}function n8($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!r($)&&!H2($)}function XM($,Z){return zM($)&&n8(Z)}function l3($,Z,Q){let z={...$};for(let[X,H]of Object.entries(Z)){let U=z[X],J=Q?`${Q}.${X}`:X;if(J==="_meta"&&U!==void 0)continue;if($5(U)){if(XM(J,H))z[X]=H;continue}if(r(U))z[X]=H;else if(f(H)&&f(U))z[X]=l3(U,H,J)}return z}function HM($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let Q=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=Q.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(Q))return`${Q}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function c3($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function UM($,Z={}){let Q=C1($);if(Z.repoUrl&&Q.project&&!W0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=c3(Z.repoUrl);return Q}import{existsSync as d3,lstatSync as JM}from"fs";import{join as GM,basename as VM}from"path";import{createHash as YM}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),F0=($)=>typeof $==="number"&&Number.isFinite($),P0=($)=>typeof $==="string",WM=/^v?\d+\.\d+\.\d+$/,BM=new Set(["birth","doubled","peak","current"]);function s3($){return B0($)&&P0($.version)&&WM.test($.version)&&F0($.score)}var qM=($)=>F0($.birthDNA)?$.birthDNA:F0($.birthWeight)?$.birthWeight:null,KM=($)=>B0($)&&F0($.birthDNA)&&P0($.born),i3=($)=>B0($)&&P0($.born)&&F0($.birthDNA)&&F0($.lastScore)&&P0($.endedAt),DM=($)=>Array.isArray($)&&$.length>0&&$.every(s3),LM=($)=>B0($)&&F0($.score)&&P0($.version),IM=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function n3($){return B0($)&&KM($.birthCertificate)&&DM($.versions)&&LM($.current)&&IM($.growth)}function OM($){try{return JM($),!0}catch{return!1}}var w1=($)=>`${JSON.stringify($,null,2)}
|
|
266
|
-
`,MM=new Set(["version","score","lastSync"]),_M=new Set(["type","score","date","version","label","emoji"]),r3=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),S1={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},o3=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),a3=($)=>r3($.current,MM)&&o3($).every((Z)=>r3(Z,_M)),PM=($)=>o3($).every((Z)=>Z.label===S1[Z.type].label&&Z.emoji===S1[Z.type].emoji);function FM($){return a3($)&&PM($)}var RM=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",NM=".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.",TM=".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.",AM=".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.",CM=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function jM($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&P0(Z.type)&&BM.has(Z.type)&&F0(Z.score))}var j2=($,Z="")=>P0($)?$:Z;function wM($,Z){if(!Array.isArray($))return[];return $.filter(s3).map((Q)=>({version:Q.version,timestamp:j2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(P0):[],growth:F0(Q.growth)?Q.growth:Q.score-Z}))}function SM($,Z,Q,z){return{version:j2($.version,Z?.version??"v1.0.0"),score:F0($.score)?$.score:Z?.score??Q,lastSync:j2($.lastSync,z)}}function EM($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=qM(Z);if(Q===null)return null;let z=j2(Z.born),X=wM($.versions,Q),H=SM(B0($.current)?$.current:{},X[X.length-1],Q,z),U=B0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"||Z.birthWeightSource==="legacy"?"legacy":"init",projectDNA:j2(Z.projectDNA),certificate:j2(Z.certificate)},versions:X,current:H,growth:{totalGrowth:H.score-Q,daysActive:F0(U.daysActive)?U.daysActive:0,milestones:jM(Array.isArray(U.milestones)?U.milestones:$.milestones)},lastModified:j2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(i3)?{priorLineage:$.priorLineage.filter(i3)}:{}}}class t3{projectPath;dnaPath;dna=null;own=!1;text;reason=null;constructor($){this.projectPath=$,this.dnaPath=GM($,".faf-dna")}exists(){return d3(this.dnaPath)}birth($){if(u(this.projectPath,".faf-dna"),OM(this.dnaPath))throw new S("exists",this.dnaPath,`${this.dnaPath} is already there: a birth certificate is written once and never replaced — not written; original kept`);let Z=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.text=void 0,this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,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:P0($.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=P0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(P0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!d3(this.dnaPath))return null;let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(n3(Q)&&w1(Q)===Z&&FM(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=EM(Q),this.reason=!this.dna?CM:!n3(Q)?RM:w1(Q)!==Z?NM:a3(Q)?AM:TM;return this.text=Z,this.dna}read(){let $;try{$=Q0(u(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=w1(this.dna),Z=this.text??null;e(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$}generateProjectDNA(){return YM("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=VM(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${Q}-${Z}`}incrementVersion($){let[Z,Q,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${Q}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,Q){if(!this.dna)return;let z=this.dna.growth.milestones,X=(G)=>z.some((V)=>V.type===G),H=(G)=>z.push({type:G,score:$,date:Q,version:Z,...S1[G]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))H("doubled");let U=z.find((G)=>G.type==="peak");if(!U||$>U.score){if(U)z.splice(z.indexOf(U),1);H("peak")}let J=z.findIndex((G)=>G.type==="current");if(J>=0)z.splice(J,1);H("current")}}import{join as Y_}from"path";import{existsSync as X_,statSync as PA}from"fs";import{join as Gz}from"path";import{dirname as Xz,resolve as Hz}from"path";var $z=100;var bM="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",yM=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${bM})(?=\\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")],xM=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],gM=["","-->","?>",">","]]>"],vM=/[#`~*+_=<>0-9-]/,kM=/(\d{1,9})([.)])/y,hM=/#{1,6}(?:[ \t]+|$)/y,uM=/`{3,}(?!.*`)|~{3,}/y,fM=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,mM=/(?:=+|-+)[ \t]*$/y,pM=/[^ \t\f\v\r\n]/;function Y6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var lM=($)=>$==="quote"||$==="list"||$==="item";function cM($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let H=$.length-1;H>=0;H--){let U=$[H],J=U===" "||U==="\t";for(let V=0;V<3;V++)if(U==="*-_"[V])z[V]++;else if(!J)X[V]=!1;let G="*-_".indexOf(U);Z[H]=G>=0&&X[G]&&z[G]>=3?1:0}return Z}var B$=($)=>$===" "||$==="\t";function dM($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var e3=($)=>$==="paragraph"||$==="code"||$==="html";function iM($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class R0{containers;stack=[{kind:"document"}];ln="";offset=0;column=0;nextNonspace=0;nextNonspaceColumn=0;indent=0;indented=!1;blank=!1;allClosed=!0;matched=0;htmlStarted=!1;hiddenIn=null;scannedFrom=-1;breaks=null;deep=!1;limit=-1;overflow=-1;starts;constructor($=!0){this.containers=$;this.starts=[()=>this.startQuote(),()=>this.startHeading(),()=>this.startFence(),(Z)=>this.startHtml(Z),(Z)=>this.startSetext(Z),()=>this.startBreak(),(Z)=>this.startItem(Z),()=>this.startIndentedCode()]}clone(){let $=new R0(this.containers);return $.stack=this.stack.map(iM),$.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}>`:gM[$.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"&&e3(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!vM.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(!e3($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=xM[$.type-1].test(this.ln.slice(this.offset));if(!(this.htmlStarted&&$.type===2&&Z))this.hiddenIn=$.type===1?`<${$.tag}>`:$.type===2?"comment":"html";if(Z)this.stack.pop()}continues($,Z){switch($.kind){case"quote":return this.continueQuote();case"item":return this.continueItem($);case"code":return $.fence?this.continueFence($.fence,Z):this.continueIndentedCode();default:return this.continueOther($)}}continueOther($){if($.kind==="heading"||$.kind==="break")return 1;return($.kind==="paragraph"||$.kind==="html"&&$.type>=6)&&this.blank?1:0}continueQuote(){if(this.indented||this.ch!==">")return 1;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),B$(this.ln[this.offset]))this.advanceOffset(1,!0);return 0}continueItem($){let Z=$.list.markerOffset+$.list.padding;if(this.blank){if(!$.hasChild)return 1;this.advanceNextNonspace()}else if(this.indent>=Z)this.advanceOffset(Z,!0);else return 1;return 0}continueFence($,Z){let Q=this.indent<=3&&this.ch===$.char?Y6(fM,this.ln,this.nextNonspace):null;if(Q&&Q[0].length>=$.len)return this.stack.length=Z,this.hiddenIn="code fence",2;for(let z=$.offset;z>0&&B$(this.ln[this.offset]);z--)this.advanceOffset(1,!0);return 0}continueIndentedCode(){if(this.indent>=4)this.advanceOffset(4,!0);else if(this.blank)this.advanceNextNonspace();else return 1;return 0}get ch(){return this.ln.charAt(this.nextNonspace)}breakAhead(){return this.breaks??=cM(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),B$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!Y6(hM,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.addChild({kind:"heading"}),this.offset=this.ln.length,2}startFence(){let $=this.ch,Z=this.indented||$!=="`"&&$!=="~"?null:Y6(uM,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=yM[X-1].exec(z);if(H)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?H[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!Y6(mM,this.ln,this.nextNonspace))return 0;return this.closeUnmatched(),this.stack[this.stack.length-1]={kind:"heading"},this.offset=this.ln.length,2}startBreak(){if(this.indented||!this.breakAhead())return 0;return this.closeUnmatched(),this.addChild({kind:"break"}),this.offset=this.ln.length,2}startItem($){if(!this.containers||this.indented&&$.kind!=="list")return 0;let Z=this.listMarker($);if(!Z)return 0;this.closeUnmatched();let Q=this.tip;if(Q.kind!=="list"||Q.list.bullet!==Z.bullet||Q.list.delimiter!==Z.delimiter)this.addChild({kind:"list",list:Z});return this.addChild({kind:"item",list:Z,hasChild:!1}),1}startIndentedCode(){if(!this.indented||this.tip.kind==="paragraph"||this.blank)return 0;return this.advanceOffset(4,!0),this.closeUnmatched(),this.addChild({kind:"code",fence:null}),2}listMarker($){if(this.indent>=4)return null;let Z=this.markerAt($);if(!Z)return null;let Q=this.indent;return this.advanceNextNonspace(),this.advanceOffset(Z.width,!0),{...Z.kind,markerOffset:Q,padding:this.paddingAfter(Z.width)}}markerAt($){let Z=$.kind==="paragraph",Q=this.markerKind(Z);if(!Q)return null;let z=this.ln[this.nextNonspace+Q.width];if(!(z===void 0||B$(z)))return null;if(Z&&!pM.test(this.ln.slice(this.nextNonspace+Q.width)))return null;return Q}markerKind($){let Z=this.ch;if(Z==="*"||Z==="+"||Z==="-")return{width:1,kind:{bullet:Z,delimiter:null}};let Q=Z>="0"&&Z<="9"?Y6(kM,this.ln,this.nextNonspace):null;if(!Q||$&&Number(Q[1])!==1)return null;return{width:Q[0].length,kind:{bullet:null,delimiter:Q[2]}}}paddingAfter($){let Z=this.column,Q=this.offset;do this.advanceOffset(1,!0);while(this.column-Z<5&&B$(this.ln[this.offset]));let z=this.column-Z;if(z>=1&&z<5&&this.ln[this.offset]!==void 0)return $+z;if(this.column=Z,this.offset=Q,B$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!dM(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),lM($.kind)&&this.stack.length-1>100)this.deep=!0}closeUnmatched(){if(!this.allClosed)this.stack.length=this.matched+1,this.allClosed=!0}findNextNonspace(){let $=this.ln,Z=this.offset,Q=this.column;if(this.scannedFrom!==-1&&this.offset>=this.scannedFrom&&this.offset<=this.nextNonspace)Z=this.nextNonspace,Q=this.nextNonspaceColumn;else{this.scannedFrom=this.offset;for(;Z<$.length;Z++)if($[Z]===" ")Q++;else if($[Z]==="\t")Q+=4-Q%4;else break}this.blank=Z>=$.length,this.nextNonspace=Z,this.nextNonspaceColumn=Q,this.indent=Q-this.column,this.indented=this.indent>=4}advanceNextNonspace(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn}advanceOffset($,Z){let Q=$;while(Q>0&&this.offset<this.ln.length){if(this.ln[this.offset]!=="\t"){this.offset++,this.column++,Q--;continue}let z=4-this.column%4,X=Z&&z>Q;this.column+=X?Q:z,this.offset+=X?0:1,Q-=Z?Math.min(z,Q):1}}}var E0="<!-- faf:start -->",b0="<!-- faf:end -->",Zz="\uFEFF";function B6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var q$=($)=>$.replace(/\r?\n$|\r$/,""),Uz=($)=>q$($).replace(/^\uFEFF/,"").trimEnd();function*E1($){let Z=0;for(let Q of B6($)){let z=q$(Q),X=Z===0&&z.charCodeAt(0)===65279?1:0;yield{offset:Z,from:Z+X,to:Z+z.length,content:z.slice(X)},Z+=Q.length}}function nM($,Z,Q,z){let X=$.some((U)=>U.start!==-1)&&z(Z.content),H=Q(Z.content);for(let U of $)if(U.start!==-1&&X)U.found={start:U.start,end:Z.to};else if(H)U.start=Z.from}function b1($,Z,Q){let[z,X]=[new R0(!0),new R0(!1)].map((H)=>({reader:H,start:-1,found:null}));for(let H of E1($)){let U=[z,X].map((G)=>G.reader.line(H.content));if(z.reader.tooDeep)return null;let J=[z,X].filter((G,V)=>U[V]===null);if(J.length>0)nM(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 Qz=($)=>(Z)=>Z===$;function w2($,Z=E0,Q=b0){return b1($,Qz(Z),Qz(Q))}function zz($,Z){let Q=[];for(let z of[!0,!1]){let X=new R0(z);for(let H of B6($))X.line(q$(H));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var rM=16;function sM($){let Z=new R0(!0);return $.map((Q)=>{let z=Z.overflowAt(q$(Q),rM),X=Q;if(z>=0){let H=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),U=H?z+H[0].length:z;X=`${Q.slice(0,U)}\\${Q.slice(U)}`}return Z.line(q$(X)),X})}function oM($,Z,Q){let X=sM(B6($).map((U)=>{let J=Uz(U);return J===Z||J===Q?` ${U}`:U})).join(""),H=zz(X,Q);while(H.length>0&&H[0]!==null){let U=`${X}
|
|
267
|
-
${H[0]}`,J=zz(U,Q);if(J.length>=H.length)break;X=U,H=J}return X}function aM($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=B6(z).map((H)=>q$(H)===""?`>${H}`:`> ${H}`).join("");return`${Z}
|
|
249
|
+
`}var QD='<meta name="description" content="Visual render of project.faf.';function zD($){return new TextDecoder().decode($).split(/\r?\n/).some((Z)=>Z.trim().startsWith(QD)&&Z.includes(" by faf"))}function XD($,Z,Q,z="project.faf",X={}){J6(rK($,"project.html"),$Z(Z,Q,z),{root:$,format:"html",hasMark:zD,mark:"faf mark (the `Visual render of project.faf` description line)",force:X.force})}var UD=sK($Z,"faf-cli: generateProjectHtml is deprecated, use renderProjectHtml","FAF0001");import{join as CD}from"path";import{deprecate as jD}from"node:util";var Y$="https://faf.one/ext/context/v1",ZZ="io.modelcontextprotocol.registry/publisher-provided";function b0($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:"application/vnd.faf+yaml",iana:"https://www.iana.org/assignments/media-types/application/vnd.faf+yaml",deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function R2($,Z={}){let Q={"one.faf/context":b0($,Z)},z=new TextEncoder().encode(JSON.stringify(Q)).length;if(z>4096)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${"4096"}B cap`);return{["io.modelcontextprotocol.registry/publisher-provided"]:Q}}var AQ="JSONRPC",XZ="1.0",w8=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],S8="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",CQ="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",jQ="1.0",wQ="1.0",QZ={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function SQ($){return($.endpoints??[]).filter((Z)=>String(Z.protocol??"").toLowerCase()==="a2a"&&Z.location)}function N2($,Z={}){let Q=SQ($);if(Q.length>0)return Q;let z=Z.doorUrl?.trim();if(z)return[{protocol:"a2a",location:z,version:XZ}];return[]}function JD($){try{return`https://${G$($)}/.well-known/fafa`}catch{return}}function UZ($,Z,Q={}){let z=b0(Z,Q),X=$.agent??{},U={fafaSpecVersion:String($.version??wQ),mediaTypes:[...w8],provenance:{faf:z.faf,mediaType:z.mediaType},generated:z.generated};if(X.id)U.agentId=X.id;let J=JD($);if(J)U.passport=J;return{uri:Y$,description:"FAF passport and project DNA as typed parts",required:!1,params:U}}function HD($){let Z=new Set;for(let Q of $.capabilities??[])if(Q.cites_spec&&w8.includes(Q.cites_spec))Z.add(Q.cites_spec);return["text/plain",...Z]}function E8($,Z={}){let Q=$.agent??{},z=N2($,Z);if(z.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let X=String(Q.displayName??$.metadata?.persona??Q.name??"").trim(),U=String(Q.description??"").trim(),J=String(Q.version??"").trim();if(!X||!U||!J)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let H=String(Q.vendor??"").trim(),V=String(Q.homepage??"").trim(),Y=H&&V?{organization:H,url:V}:void 0,G=($.capabilities??[]).map((W)=>{let q=String(W.name??"").trim();if(!q)throw Error("A2A skill missing capabilities[].name");let K=Array.isArray(W.tags)?W.tags.map(String):[],D=W.cites_spec&&w8.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:q,name:q,description:String(W.description??"").trim()||q,tags:K,...D?{inputModes:D}:{}}});return{name:X,description:U,supportedInterfaces:z.map((W)=>({url:String(W.location),protocolBinding:AQ,protocolVersion:String(W.version??XZ)})),...Y?{provider:Y}:{},version:J,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...Z.extensions??[]]},defaultInputModes:HD($),defaultOutputModes:["text/plain","application/json"],skills:G}}var VD=["mcp","cli","library"],YD=/^[a-z0-9][a-z0-9._-]*$/,GD=/^(@[a-z0-9~][a-z0-9-._~]*\/)?[a-z0-9~][a-z0-9-._~]*$/,WD=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/,qD=/^[A-Za-z0-9][^\s]*$/,BD=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,KD=["a2a","mcp"],DD=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function F($){return String($??"").trim()}function j8($){return Array.isArray($)?$.map(F).filter(Boolean):[]}function LD($){return F($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function MD($,Z,Q){let z=["display_name","description","version"].filter((X)=>!F($[X]));if(z.length)throw Error(`Missing answer: ${z.join(", ")}`);if(!YD.test(Z))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!DD.test(Q))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function ID($,Z){return($.skills??[]).filter((Q)=>F(Q.name)).map((Q)=>({name:F(Q.name),type:F(Q.type)||"tool",description:F(Q.description)||F(Q.name),tags:Z.length?Z:[F(Q.name).toLowerCase()]}))}function OD($){let Z=($.packages??[]).filter((Q)=>F(Q.registryType)&&F(Q.identifier));for(let Q of Z){let z=F(Q.registryType),X=F(Q.identifier);if(z==="npm"&&!GD.test(X))throw Error(`Package "${X}" is not an npm package name (e.g. weather-mcp or @acme/weather).`);if(z==="pypi"&&!WD.test(X))throw Error(`Package "${X}" is not a PyPI package name (e.g. weather-mcp or weather_mcp).`);if(z==="cargo"&&!BD.test(X))throw Error(`Package "${X}" is not a crate name (e.g. weather-mcp or weather_mcp).`);if(z!=="npm"&&z!=="pypi"&&z!=="cargo"&&!qD.test(X))throw Error(`Package "${X}" is not a ${z} package identifier: it must start with a letter or digit and have no spaces.`)}return Z.map((Q)=>({registryType:F(Q.registryType),identifier:F(Q.identifier),...F(Q.version)?{version:F(Q.version)}:{}}))}function EQ($){if(/\s/.test($))return!1;try{let Z=new URL($);return(Z.protocol==="http:"||Z.protocol==="https:")&&Z.hostname!==""}catch{return!1}}function _D($){if(!EQ(F($.url)))throw Error(`Where it runs: "${F($.url)}" is not an http(s) URL (or give an npm package).`);if(!KD.includes(F($.protocol).toLowerCase()))throw Error(`Protocol "${F($.protocol)}": a2a or mcp.`)}function PD($){let Z=F($.package_kind).toLowerCase()||"mcp";if(!VD.includes(Z))throw Error(`Kind "${F($.package_kind)}" is not one faf knows: mcp, cli or library.`);return Z}function FD($,Z){let Q=($.endpoints??[]).filter((U)=>F(U.url));Q.forEach(_D);let z=PD($),X=[...Q.map((U)=>({protocol:F(U.protocol).toLowerCase(),transport:"http",location:F(U.url)})),...Z.map((U)=>({protocol:z,transport:"stdio",location:U.identifier}))];if(X.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return X}function RD($,Z,Q,z){let X={domain:Z},U=[["repository",F($.repository)],["icon",F($.icon)],["organizationUrl",F($.organization_url)]];for(let[H,V]of U)if(V)X[H]=V;if(Q.length)X.keywords=Q;let J=j8($.example_requests);if(J.length)X.examples=J;if(z.length)X.packages=z;return X}function bQ($){let Z=F($.handle).toLowerCase(),Q=LD($.domain);MD($,Z,Q);let z=j8($.tags),X=OD($),U=F($.homepage);if(U&&!EQ(U))throw Error(`Homepage: "${U}" is not an http(s) URL.`);let J={name:Z,displayName:F($.display_name),id:`urn:air:${Q}:agent:${Z}`,...F($.organization)?{vendor:F($.organization)}:{},version:F($.version),description:F($.description),homepage:U||`https://${Q}`,...F($.license)?{license:F($.license)}:{}};return{version:wQ,agent:J,capabilities:ID($,z),endpoints:FD($,X),metadata:{cards:RD($,Q,z,X)}}}function yQ($){return O2($,{lineWidth:0})}function G$($){let Z=F($.agent?.id),Q=/^urn:air:([^:]+):/.exec(Z);if(Q)return Q[1];let z=F($.metadata?.cards?.domain);if(z)return z;try{return new URL(F($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function xQ($){let Z=F($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!Z)throw Error("The .fafa needs agent.name (the short name).");return Z}function JZ($){return`${G$($).split(".").reverse().join(".")}/${xQ($)}`}function zZ($){let Z=$.replace(/\s+/g," ").trim();return Z.length<=100?Z:`${Z.slice(0,97).trimEnd()}...`}function T2($){return($.endpoints??[]).filter((Z)=>F(Z.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(F(Z.location))).map((Z)=>({type:"streamable-http",url:F(Z.location)}))}function ND($){if(!$)return;try{let Z=new URL($).hostname.replace(/^www\./,"");return{url:$,source:Z.split(".")[0]}}catch{return}}function gQ($){let Z=$.agent??{},Q=$.metadata?.cards??{},z=F(Z.description),X=F(Z.version);if(!z||!X)throw Error("An MCP card needs agent.description and agent.version in .fafa");let U={name:JZ($),version:X,description:zZ(z)},J=F(Z.displayName);if(J)U.title=zZ(J);let H=F(Z.homepage);if(H)U.websiteUrl=H;let V=ND(F(Q.repository));if(V)U.repository=V;if(F(Q.icon))U.icons=[{src:F(Q.icon)}];return U}function vQ($){return($.metadata?.cards?.packages??[]).map((Z)=>({registryType:F(Z.registryType),identifier:F(Z.identifier),...F(Z.version)?{version:F(Z.version)}:{},transport:{type:"stdio"}}))}function b8($){return($.endpoints??[]).some((Z)=>F(Z.protocol).toLowerCase()==="mcp")}function HZ($){return b8($)&&(T2($).length>0||vQ($).length>0)}function kQ($){let Z=F($.agent?.displayName);return{name:JZ($),...Z?{title:zZ(Z)}:{}}}function y8($,Z,Q={}){let z=T2($);if(z.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:S8,...gQ($),remotes:z,...Z?{_meta:{"one.faf/context":b0(Z,Q)}}:{}}}function hQ($,Z,Q={}){let z=T2($),X=vQ($);if(z.length===0&&X.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");if(!b8($))throw Error("A registry entry describes an MCP server: the .fafa has no mcp endpoint.");return{$schema:CQ,...gQ($),...X.length?{packages:X}:{},...z.length?{remotes:z}:{},...Z?{_meta:R2(Z,Q)}:{}}}function TD($,Z,Q){if(!Z.includes("a2a")||N2($,Q).length===0)return;return Q.a2aCardUrl??`https://${G$($)}/.well-known/agent-card.json`}function x8($,Z,Q={}){let z=G$($),X=xQ($),U=$.agent??{},J=F(U.displayName)||F(U.name),H=F(U.description),V=F(U.version),Y=Q.now??new Date().toISOString(),G=(K,D,B)=>({identifier:`urn:air:${z}:${K}:${X}`,displayName:J,type:D,description:H,url:B,...V?{version:V}:{},updatedAt:Y}),W=[],q=TD($,Z,Q);if(q)W.push(G("a2a",QZ.a2a,q));if(Z.includes("server_card")){let K=T2($)[0];if(K)W.push(G("mcp",QZ.server_card,`${K.url.replace(/\/+$/,"")}/server-card`))}if(Q.listFafa!==!1)W.push(G("agent",QZ.fafa,`https://${z}/.well-known/fafa`));return W}function g8($){let Z=$.agent??{},Q=F(Z.vendor)||F(Z.displayName)||F(Z.name);if(!Q)return;let z;try{z=G$($)}catch{z=void 0}return{displayName:Q,...z?{identifier:z}:{}}}function uQ($,Z,Q={}){let z=g8($);return{specVersion:jQ,...z?{host:z}:{},entries:x8($,Z,Q)}}function VZ($){let Z=$.metadata?.cards??{},Q=j8(Z.keywords),z=j8(Z.examples);return{...Q.length?{tags:Q}:{},...z.length?{representativeQueries:z}:{}}}function mQ($,Z,Q={}){let z=g8($),X=VZ($);return{specVersion:jQ,...z?{host:z}:{},entries:x8($,Z,Q).map((U)=>({...U,...X}))}}function fQ($,Z){let Q=new Set(Z.cards),z={fafa:$,fafaText:yQ($)},{faf:X}=Z;if(Q.has("a2a")){let J=[...Z.a2aExtensions??[],...X?[UZ($,X,Z)]:[]];z.a2a=E8($,{extensions:J})}if(Q.has("server_card"))z.server_card=y8($,X,Z);if(Q.has("server_json"))z.server_json=hQ($,X,Z);let U={now:Z.now,listFafa:Z.listFafa};if(Q.has("ai_catalog"))z.ai_catalog=uQ($,Z.cards,U);if(Q.has("ard"))z.ard=mQ($,Z.cards,U);return z}function AD($,Z){return fQ(bQ($),Z)}var wD=S8,SD=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function pQ($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&SD.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 ED($){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 H6($,Z={}){let Q={$schema:wD,name:pQ($),version:String($.project?.version??"0.1.0"),description:ED($)},z=v8($)??$.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":b0($,Z)},Q}function GZ($){return pQ($)}function v8($){let Z=$.project?.title;if(typeof Z==="string"){let Q=Z.trim();if(Q&&Q.length<=100)return Q}return}function bD($){try{return JSON.parse(new TextDecoder().decode($).replace(/^\uFEFF/,""))}catch{return}}var YZ=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function lQ($){let Z=bD($);return YZ(Z)&&YZ(Z._meta)&&YZ(Z._meta["one.faf/context"])}function yD($,Z,Q={},z={}){let X=H6(Z,Q),U=CD($,"server-card");return J6(U,`${JSON.stringify(X,null,2)}
|
|
250
|
+
`,{root:$,format:"json",hasMark:lQ,mark:'FAF context-block (`_meta["one.faf/context"]`)',force:z.force}),U}function xD($,Z){let Q={name:Z.name,title:Z.title,version:Z.version,_meta:Z.meta};return U6($,Q,{"":{name:["$schema"],title:["name"],version:["description","title","name"]}})}var gD=jD(H6,"faf-cli: generateServerCard is deprecated, use buildServerCard","FAF0002");import{existsSync as cQ}from"fs";import{basename as vD,dirname as iQ,join as dQ}from"path";import{deprecate as kD}from"node:util";var hD=["a2a","mcp","registry","catalog","ard"];function uD($){return I0(Q0(h(iQ($),vD($))))}function mD($=process.cwd()){let Z=["agent.fafa",".fafa"];for(let z of Z){let X=dQ($,z);if(cQ(X))return X}let Q=iQ($);if(Q!==$)for(let z of Z){let X=dQ(Q,z);if(cQ(X))return X}return null}function WZ($,Z,Q={}){if(N2($,Q).length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");return E8($,{doorUrl:Q.doorUrl,extensions:Z?[UZ($,Z,Q)]:[]})}var fD=kD(WZ,"faf-cli: generateA2ACard is deprecated, use buildA2ACard","FAF0003");function pD($,Z={},Q={}){return x8($,["a2a","server_card"],{now:Q.now??Z.generated??new Date().toISOString(),a2aCardUrl:Q.a2aCardUrl,doorUrl:Q.doorUrl})}function lD($,Z){return $.findIndex((Q)=>Q.identifier===Z.identifier)}function cD($,Z,Q){let z=$?{...$,entries:[...$.entries??[]]}:{specVersion:"1.0",entries:[]},X=Q&&z.host===void 0?(({specVersion:U,...J})=>({specVersion:U,host:{...Q},...J}))(z):z;for(let U of Z){let J=lD(X.entries,U);if(J>=0)X.entries[J]={...X.entries[J],url:U.url,type:U.type,...U.updatedAt?{updatedAt:U.updatedAt}:{}};else X.entries.push(U)}return X}var dD="no mcp endpoint in agent.fafa";function iD($){return $!==void 0&&!b8($)}function nD($){let Z=$.project?.type??$.app_type;return typeof Z==="string"&&Z.trim()!==""?Z.trim():void 0}function rD($,Z){if($===void 0||Z!==void 0)return!1;let Q=nD($);return Q!==void 0&&!/^mcp/i.test(Q)}function sD($,Z={}){return[...N2($,Z).length>0?["a2a"]:[],...T2($).length>0?["mcp"]:[],...HZ($)?["registry"]:[],"catalog","ard"]}function oD($){let Z=$.opts??{},Q=$.faf,z=$.fafa,X=iD(z),U=$.targets?.filter((G)=>G==="mcp"||G==="registry")??[];if(X&&U.length)throw Error(`${U.join(", ")}: ${dD} — these cards describe an MCP server.`);let J=rD(Q,z),H=(Q?hD:z?sD(z,Z):[]).filter((G)=>!(X||J)||G!=="mcp"&&G!=="registry"),V=new Set($.targets?.length?$.targets:H),Y={};if(Q)Y.block=b0(Q,Z);if(V.has("mcp"))if(z&&T2(z).length>0)Y.mcp=y8(z,Q,Z);else if(Q)Y.mcp=H6(Q,Z);else throw Error("A Server Card needs an MCP endpoint at an http(s) URL in the .fafa, or a project.faf.");if(V.has("registry"))if(z&&HZ(z))Y.registry={...kQ(z),...Q?{_meta:R2(Q,Z)}:{}};else if(Q){let G=v8(Q);Y.registry={name:GZ(Q),...G?{title:G}:{},_meta:R2(Q,Z)}}else throw Error("A registry entry needs a package or a remote MCP URL in the .fafa, or a project.faf.");if(V.has("a2a")||V.has("catalog")||V.has("ard")){if(!$.fafa){if($.targets?.some((G)=>G==="a2a"||G==="catalog"||G==="ard"))throw Error("A2A/catalog/ARD require a .fafa (agent.fafa). Will not invent an agent.")}}if(V.has("a2a")&&$.fafa)if(N2($.fafa,Z).length===0){if($.targets?.includes("a2a"))throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.")}else Y.a2a=WZ($.fafa,Q,Z);if((V.has("catalog")||V.has("ard"))&&$.fafa){let G=pD($.fafa,Q,Z);if(V.has("catalog"))Y.catalog=G;if(V.has("ard")){let q=VZ($.fafa);Y.ard=G.map((K)=>({...K,...q}))}let W=g8($.fafa);if(W)Y.catalogHost=W}return aD(Y),Y}function aD($){if(!$.block)return;let Z=JSON.stringify($.block),Q=[];if($.mcp){let z=$.mcp._meta;Q.push(JSON.stringify(z["one.faf/context"]))}if($.registry?._meta){let z=$.registry._meta["io.modelcontextprotocol.registry/publisher-provided"];Q.push(JSON.stringify(z["one.faf/context"]))}for(let z of Q)if(z!==Z)throw Error("context block drifted across card targets — one projector, one block");if($.a2a){let z=$.a2a.capabilities.extensions?.find((J)=>J.uri===Y$);if(!z)throw Error("A2A card has no FAF context extension, but a project.faf was given");let X=z.params,U=$.block;if(X.provenance?.faf!==U.faf||X.provenance?.mediaType!==U.mediaType)throw Error("A2A extension provenance drifted from the context block — one context, every door")}}var qZ=["ephemeral","standard","high","critical"],U2=Object.fromEntries(qZ.map(($,Z)=>[$,Z])),k8=new Set(["user","feedback","project","reference"]),BZ=new Set(["version","profile","namepoint","created","last_etched","retention","index","memory"]),KZ=new Set(["facts","sessions","preferences","custom"]),DZ={low:"ephemeral",medium:"standard"};import{existsSync as tD}from"fs";import{dirname as tQ,resolve as eQ}from"path";function A2(){return new Date().toISOString().replace(/\.\d{3}Z$/,"Z")}function f($){return $===null||$===void 0}function eD($){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 q$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($);function $L($){let Z=eQ($),Q=h(tQ(Z),Z,{read:!0});return{real:Q,text:Q0(Q)}}function nQ($,Z,Q,z){let X=eQ($),U=h(tQ(X),X),J=Q!==void 0&&Q.real===U;if(J&&Q.text===Z)return U;let H;try{H=E0(U)}catch{H=void 0}if(H&&H.equals(Buffer.from(Z,"utf-8")))return U;if(!J&&!z&&H)throw new E("changed",X,`${X} already exists — not written; pass { replace: true } (faf memory convert --force) to replace it`,{onWrite:!0});let V=J?Q.text:z?H:null;return e($,Z,V===void 0?{}:{expect:V})}function B$($){if(f($))return"standard";if(DZ[$])return DZ[$];if($ in U2)return $;return"standard"}var ZL=new Set(["text","id","type","priority","tags","links","timestamp","source"]);function LZ($){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(!ZL.has(z))Q[z]=X;return{text:String(Z.text),id:Z.id??null,type:Z.type??null,priority:B$(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 W$($){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 rQ($){let Z=$;return q$($)&&typeof Z.text==="string"&&Array.isArray(Z.tags)&&Array.isArray(Z.links)&&q$(Z.extra)&&typeof Z.priority==="string"?Z:LZ($)}function QL($){if(typeof $==="string"||q$($)&&"text"in $)return LZ($);return null}var sQ=["profile","namepoint","created","last_etched","retention"];class W0{namepoint;profile;retention;created;last_etched;_facts;_byId;_index;_sessions;_preferences;_custom;_extra;_memoryExtra;_version;_origin;_factAt=new WeakMap;_indexDerived=!0;_indexAtRecord=[];constructor($,Z={}){this.namepoint=$,this.profile=Z.profile??"knowledge",this.retention=Z.retention??"forever",this.created=Z.created??A2(),this.last_etched=this.created,this._facts=Z.facts?Z.facts.map(rQ):[],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||c(this._index,this.derivedIndex()),this._indexAtRecord=this._index.slice()}get facts(){return this._facts}get index(){return this._index}get sessions(){return this._sessions}get preferences(){return this._preferences}get custom(){return this._custom}get extra(){return this._extra}get memoryExtra(){return this._memoryExtra}static load($){if(!tD($))throw Error(`soul file not found: ${$}`);let{real:Z,text:Q}=$L($);return W0.fromText(Q,$,Z)}static fromText($,Z,Q){let z=m5($,Z).toJS();if(!q$(z))throw Error(`soul is not a YAML mapping: ${Z} is ${eD(z)}`);let X=new $3,U=X.pick("memory",z.memory,k)??{},J=new W0(String(z.namepoint??Z.replace(/.*\//,"").replace(/\.fafm$/,"")),{profile:String(z.profile??"voice"),retention:String(z.retention??"forever"),created:z.created??null,...X.modelled(z,U)});return(X.pick("memory.facts",U.facts,Array.isArray)??[]).forEach((H,V)=>{let Y=QL(H);if(Y)J.adopt(Y,V)}),J.last_etched=String(z.last_etched??J.created),J._version=f(z.version)?void 0:String(z.version),J._origin={path:Z,real:Q,text:$,base:J.state(),residual:X.residual},J.recordIndex(),J}recordIndex(){this._indexDerived=this.indexIsDerived(),this._indexAtRecord=this._index.slice()}adopt($,Z){if(this._facts.push($),!f($.id))this._byId.set($.id,this._facts.length-1);this._factAt.set($,Z)}static fromFile($){return W0.load($)}toDoc(){let $={facts:this._facts.map(W$),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom)};for(let[Q,z]of Object.entries(this._memoryExtra))if(!KZ.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(!BZ.has(Q))Z[Q]=structuredClone(z);return Z}toYaml(){return O2(this.toDoc(),{lineWidth:100})}derivedIndex($=80){return this._facts.map((Z)=>`${Z.id??"?"} — ${String(Z.text).slice(0,$)}`)}indexIsDerived($=80){return!this._origin?.residual.has("index")&&c(this._index,this.derivedIndex($))}rebuildIndex($=80){return this._index=this.derivedIndex($),this._indexDerived=!0,this._indexAtRecord=this._index.slice(),this._index}save($,Z={}){let Q=Z.reindex??(this._indexDerived&&c(this._index,this._indexAtRecord));if(Q)this.rebuildIndex();let z=Z.replace===!0,X=this._origin;if(!X){let V=this.toYaml(),Y=nQ($,V,void 0,z);return this.settle($,V,new Map(this._facts.map((G,W)=>[G,W])),Y),$}let U=new Map,{text:J}=F8(X.text,(V)=>{U=this.applyTo(V,X,Q)},$),H=nQ($,J,X.real===void 0?void 0:{real:X.real,text:X.text},z);return this.settle($,J,U,H),$}toFile($,Z={}){return this.save($,Z)}settle($,Z,Q,z){this._factAt=new WeakMap;for(let[X,U]of Q)this._factAt.set(X,U);this._origin={path:$,real:z,text:Z,base:this.state(),residual:this._origin?.residual??new Map},this.recordIndex()}state(){let $=new Map;for(let Z of this._facts){let Q=this._factAt.get(Z);if(Q!==void 0)$.set(Q,structuredClone(W$(Z)))}return{top:Object.fromEntries(sQ.map((Z)=>[Z,this[Z]])),index:this._index.slice(),sessions:structuredClone(this._sessions),preferences:structuredClone(this._preferences),custom:structuredClone(this._custom),extra:structuredClone(this._extra),memoryExtra:structuredClone(this._memoryExtra),facts:$}}static refuse($,Z,Q){throw Error(`${$.path}: ${Z} is ${$.residual.get(Z)} in the file, not the shape faf writes — `+`faf keeps it as it is and will not ${Q}. Nothing written.`)}applyTo($,Z,Q){let z=Z.base,X=this.state(),U=Z.path;for(let J of sQ)if(z.top[J]!==X.top[J])$.set(J,X.top[J]);if(!c(z.index,X.index)){if(Z.residual.has("index")&&!Q)W0.refuse(Z,"index","replace it");N8($,["index"],Z.residual.has("index")?void 0:z.index,X.index,U)}for(let J of aQ(z.extra,X.extra))N8($,[J],z.extra[J],X.extra[J],U);return this.applyMemory($,Z,z,X),this.applyFacts($,Z)}applyMemory($,Z,Q,z){let X=[["sessions",Q.sessions,z.sessions],["preferences",Q.preferences,z.preferences],["custom",Q.custom,z.custom],...aQ(Q.memoryExtra,z.memoryExtra).map((U)=>[U,Q.memoryExtra[U],z.memoryExtra[U]])];for(let[U,J,H]of X){if(c(J,H))continue;if(Z.residual.has("memory"))W0.refuse(Z,"memory",`change memory.${U}`);if(Z.residual.has(`memory.${U}`))W0.refuse(Z,`memory.${U}`,"replace it");N8($,["memory",U],J,H,Z.path)}}sortFacts($){let Z=[],Q=[];for(let z of this._facts){let X=this._factAt.get(z);if(X===void 0){Q.push(z);continue}if(Q.length>0||Z.length>0&&X<=Z[Z.length-1][1])throw Error(`${$.path}: the facts were reordered — faf keeps the order soul.fafm has. Nothing written.`);Z.push([z,X])}return{kept:Z,added:Q}}applyFacts($,Z){let{kept:Q,added:z}=this.sortFacts(Z),X=new Set(Q.map(([,Y])=>Y)),U=[...Z.base.facts.keys()].filter((Y)=>!X.has(Y)).sort((Y,G)=>G-Y),J=Q.filter(([Y,G])=>!c(Z.base.facts.get(G),W$(Y))),H=new Map(Q);if(z.length===0&&U.length===0&&J.length===0)return H;for(let Y of["memory","memory.facts"])if(Z.residual.has(Y))W0.refuse(Z,Y,"add facts to it");let V=r9($,["memory","facts"],Z.path);for(let[Y,G]of J)V.items[G]=XL($,V.items[G],Z.base.facts.get(G),W$(Y));for(let Y of U)V.items.splice(Y,1);for(let[Y,G]of Q)H.set(Y,G-U.filter((W)=>W<G).length);for(let Y of z)H.set(Y,V.items.length),V.items.push($.createNode(W$(Y)));return H}add($){let Z=rQ($);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(zL(Q,$,Z));return this.add({text:$,id:Z.id??null,type:Z.type??null,priority:B$(Z.priority),tags:Z.tags?Z.tags.slice():[],links:Z.links?Z.links.slice():[],timestamp:A2(),source:Z.source??null,extra:{}})}recall($,Z={}){let Q=q$($)?{...$,...Z}:Z,z=q$($)?$.query:$,X=U2[B$(Q.minPriority??"ephemeral")]??0,U=typeof z==="string"?z.toLowerCase():"",J=new Set(Q.tags??[]),H=[];this._facts.forEach((Y,G)=>{if(U&&!String(Y.text??"").toLowerCase().includes(U))return;if(J.size>0&&![...J].some((W)=>(Y.tags??[]).includes(W)))return;if(!f(Q.type)&&Y.type!==Q.type)return;if((U2[Y.priority]??1)<X)return;H.push([G,Y])}),H.sort((Y,G)=>{let W=U2[Y[1].priority]??1,q=U2[G[1].priority]??1;if(q!==W)return q-W;let K=Y[1].timestamp??"",D=G[1].timestamp??"";if(D!==K)return D<K?-1:D>K?1:0;return G[0]-Y[0]});let V=H.map(([,Y])=>Y);if(!f(Q.limit))return V.slice(0,Q.limit);return V}getFact($){let Z=this._byId.get($);return Z===void 0?null:this._facts[Z]}deleteFact($){let Z=this._byId.get($);if(Z===void 0)return!1;return this._facts.splice(Z,1),this._byId.clear(),this._facts.forEach((Q,z)=>{if(!f(Q.id))this._byId.set(Q.id,z)}),!0}}function zL($,Z,Q){let z=(X,U)=>f(X)?U:X;return{...$,text:Z,type:z(Q.type,$.type),priority:f(Q.priority)?$.priority:B$(Q.priority),tags:z(Q.tags,$.tags).slice(),links:z(Q.links,$.links).slice(),source:z(Q.source,$.source),timestamp:A2(),extra:{...$.extra}}}class $3{residual=new Map;pick($,Z,Q){if(f(Z))return;if(Q(Z))return Z;this.residual.set($,U$(Z));return}modelled($,Z){return{index:(this.pick("index",$.index,Array.isArray)??[]).map(String),sessions:this.pick("memory.sessions",Z.sessions,Array.isArray)??[],preferences:structuredClone(this.pick("memory.preferences",Z.preferences,k)??{}),custom:structuredClone(this.pick("memory.custom",Z.custom,k)??{}),extra:oQ($,BZ),memoryExtra:oQ(Z,KZ)}}}function oQ($,Z){let Q={};for(let[z,X]of Object.entries($))if(!Z.has(z))Q[z]=structuredClone(X);return Q}function aQ($,Z){return[...new Set([...Object.keys($),...Object.keys(Z)])]}function XL($,Z,Q,z){if(!l(Z))return X6($,Z,Q,z);let X=(U)=>typeof U==="string"?{text:U}:U;return X6($,Z,X(Q),X(z))}import{readdirSync as UL,readFileSync as JL,statSync as Z3,existsSync as HL}from"fs";import{join as VL,basename as Q3,resolve as YL}from"path";var z3=new Set(["MEMORY.md","MEMORY-FULL.md","README.md"]),GL=/\[\[([^\]]+)\]\]/g;function WL($){let Z=Z3($).mtimeMs;return new Date(Z).toISOString().replace(/\.\d{3}Z$/,"Z")}function qL($){if(!$.startsWith("---"))return{fm:null,body:$};let Z=$.split("---");if(Z.length<3)return{fm:null,body:$};try{let Q=I0(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 BL($,Z,Q){if(!Q.name)return null;let z=Q.metadata&&typeof Q.metadata==="object"?Q.metadata:{},X=z.type;if(typeof X!=="string"||!k8.has(X))return null;let U=String(Q.name).trim(),H=(Q.description!==void 0&&Q.description!==null&&String(Q.description).trim()?String(Q.description).trim():"")||U,V={};if(z.originSessionId)V.provenance=[`session:${z.originSessionId}`];let Y=[...new Set([...Z.matchAll(GL)].map((G)=>G[1]))].sort();return{text:H,id:U,type:X,priority:"standard",tags:[],links:Y,timestamp:WL($),source:`claude-code memory: ${Q3($)}`,extra:V}}function X3($,Z={}){let Q=YL($);if(!HL(Q))throw Error(`Claude memory directory not found: ${Q}`);if(!Z3(Q).isDirectory())throw Error(`Claude memory path is not a directory: ${Q}`);let z=Z.skip??z3,X=Z.namepoint??`@claude-code:${Q3(Q)}`,U=[],J=UL(Q).filter((W)=>W.endsWith(".md")).sort();for(let W of J){if(z.has(W))continue;let q=VL(Q,W),K;try{K=JL(q,"utf-8")}catch{continue}let{fm:D,body:B}=qL(K);if(!D)continue;let L=BL(q,B,D);if(L)U.push(L)}let H=U.map((W)=>W.timestamp).filter(Boolean),V=H.length?H.reduce((W,q)=>W<q?W:q):A2(),Y=H.length?H.reduce((W,q)=>W>q?W:q):V,G=new W0(X,{profile:"knowledge",facts:U,created:V});return G.last_etched=Y,G.rebuildIndex(),G}var H3="faf-interview/1",K$="(one line, every word earns its place)",MZ=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0,help:"one sentence: what it does, and for whom"},{path:"human_context.who",question:`Who is this for? ${K$}`,header:"Who",type:"text",required:!0,help:"the people who use it, not the author"},{path:"human_context.what",question:`What are they building? ${K$}`,header:"What",type:"text",required:!0,help:"what they make or do with it"},{path:"human_context.why",question:`Why does it exist? ${K$}`,header:"Why",type:"text",required:!0,help:"the problem it removes"},{path:"human_context.where",question:`Where does it run or ship? ${K$}`,header:"Where",type:"text",required:!0,help:"where it runs or ships: platform, store, registry"},{path:"human_context.when",question:`When — what stage is it at, and since when? ${K$}`,header:"When",type:"text",required:!0,help:"the stage it is at, and since when"},{path:"human_context.how",question:`How does it work? ${K$}`,header:"How",type:"text",required:!0,help:"the mechanism, and the choice that shapes the code"}],V3=[{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}],D$=[...MZ,...V3],Y3=new Map(D$.map(($)=>[$.path,$])),KL=Object.fromEntries(D$.map(($)=>[$.path,$]));function IZ($){let Z=Y3.get($);if(Z)return Z.question;let Q=h0.get($)??p.find((z)=>z.canonical===$);return Q?`${Q.description}?`.replace(/\?\?$/,"?"):`${$}?`}function DL($,Z){return D$.filter((Q)=>{let z=Q.path.split("."),X=$;for(let U of z)if(X&&typeof X==="object"&&U in X)X=X[U];else{X=void 0;break}if(X==="slotignored")return!1;return Z(X)})}var LL=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"]),ML=[["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]],IL=($)=>LL.has($.toLowerCase().trim()),OL=/^(?:with|and|or|using|for|to|that|who|whom|whose|the|a|an|in|on|of|via|by|&)$/i,_L=12;function PL($){let Z=$.trim().split(/\s+/).filter(Boolean);if(Z.length>_L)return"";while(Z.length&&OL.test(Z[Z.length-1].replace(/[.,;:]+$/,"")))Z.pop();return Z.join(" ")}function G3($){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=PL(z);if(X.split(/\s+/).filter(Boolean).length>=2&&!IL(X))Z.what=X;let U=ML.filter(([,J])=>J.test(Q)).map(([J])=>J);if(U.length)Z.where=U.slice(0,4).join(", ");return Z}function U3($,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 J3($){if(typeof $!=="string")return!1;let Z=$.trim();if(!Z||Z==="slotignored")return!1;return!m(Z)}function FL($,Z={}){let Q=$&&typeof $==="object"?$:{},z=U3(Q,"project.goal"),X=(J3(z)?String(z).trim():"")||(Z.goal??"").trim(),U=G3(X),J=Z.detailed??{},H={"project.goal":X||void 0,"human_context.what":U.what,"human_context.where":U.where,"human_context.who":U.who},V=(K)=>{let D=H[K];if(D)return{value:D,source:"project goal",confidence:0.9};let B=K.startsWith("human_context.")?K.slice(14):"",L=B?J[B]:void 0;return L?{value:L.value,source:L.source,confidence:L.confidence}:void 0},Y=MZ.map((K,D)=>{let B={n:D+1,path:K.path,header:K.header,question:K.question},L=U3(Q,K.path);if(J3(L))return{...B,value:String(L).trim(),status:"filled",seeded:!1};let I=V(K.path);if(I)return{...B,value:I.value,status:"seeded",seeded:!0,source:I.source,confidence:I.confidence};return{...B,value:"",status:"empty",seeded:!1}}),G=Y.filter((K)=>K.status==="filled").length,W=Y.filter((K)=>K.status==="seeded").length,q=Y.filter((K)=>K.status==="empty").length;return{version:H3,rows:Y,filledCount:G,seededCount:W,emptyCount:q,complete:q===0}}function h8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||m(Z)}return!1}function RL($,Z){let Q=$;for(let z of Z.split("."))if(Q&&typeof Q==="object"&&z in Q)Q=Q[z];else return;return Q}function W3($){if($==="project.goal")return!0;return h0.get($)?.category==="human"}function q3($,Z=h8){let Q=[],z=[];for(let X of D$){let U=RL($,X.path);if(U==="slotignored")continue;if(!Z(U))continue;(W3(X.path)?Q:z).push(X.path)}return{human:Q,sourceable:z}}function B3($,Z,Q=h8){let z=q3(Z,Q),X;if($>=100||z.human.length===0&&z.sourceable.length===0)X="done";else if(z.sourceable.length>0)X="can-source";else X="needs-human";let U=X==="needs-human"?OZ(z):[];return{status:X,score:$,gaps:z,ask:U}}function OZ($){return $.human.map((Z)=>({path:Z,question:IZ(Z)}))}function NL($,Z={}){let Q=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??h8,X=[],U=0;for(let H=0;H<=Q;H++){let V=$.read();if(!V)return{status:"no-faf",score:0,rounds:U,history:X,ask:[]};let Y=$.score(V.yaml);X.push(Y);let G=B3(Y,V.data,z);if(G.status==="done")return{status:"done",score:Y,rounds:U,history:X,ask:[]};if(G.status==="needs-human")return{status:"needs-human",score:Y,rounds:U,history:X,ask:G.ask};if(X.length>=2&&Y<=X[X.length-2])return G.gaps.human.length?{status:"needs-human",score:Y,rounds:U,history:X,ask:OZ(G.gaps)}:{status:"stuck",score:Y,rounds:U,history:X,ask:[]};if(U>=Q)return{status:"capped",score:Y,rounds:U,history:X,ask:OZ(G.gaps)};$.runAuto(),U++}return{status:"capped",score:X[X.length-1]??0,rounds:U,history:X,ask:[]}}import{createHash as D3}from"crypto";var _Z="faf-bench/1",TL={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what stage is it at, and since when?","human_context.how":"How does it work?"};function AL($,Z){return TL[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var L3=[["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"]],V6=new Map;L3.forEach(($,Z)=>$.forEach((Q)=>V6.set(Q,Z)));var CL=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function u8($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function K3($){return u8($).split(" ").filter((Z)=>Z&&!CL.has(Z))}function M3($,Z){let Q=u8($),z=u8(Z);if(!Q||!z)return!1;if(Q===z)return!0;let X=V6.get(Q);if(X!==void 0&&V6.get(z)===X)return!0;let U=K3($);if(U.length===0)return!1;let J=new Set(K3(Z));return U.every((H)=>{if(J.has(H))return!0;let V=V6.get(H);return V!==void 0&&[...J].some((Y)=>V6.get(Y)===V)})}function jL($){let Z=L4($),Q=I0($),z=[],X={},U=0;for(let V of p){if(Z.slots[V.path]!=="populated")continue;let Y=$1(Q,V);if(typeof Y!=="string")continue;let G=Y.trim();if(!G||F6.has(G.toLowerCase()))continue;U+=1,z.push({n:U,path:V.path,question:AL(V.path,V.description)}),X[U]=G}let J=JSON.stringify({v:_Z,q:z.map((V)=>[V.path,V.question])}),H=D3("sha256").update(J).digest("hex").slice(0,12);return{version:_Z,qsetHash:H,questions:z,answers:X}}function wL($){return{version:$.version,qsetHash:$.qsetHash,questions:$.questions}}function SL($,Z){let Q=$.questions.map((X)=>{let U=Z[String(X.n)]??Z[X.path]??"";return{n:X.n,path:X.path,ok:typeof U==="string"&&U.trim()!==""&&M3($.answers[X.n],U)}}),z=$.questions.filter((X)=>!Q[X.n-1].ok);return{correct:Q.filter((X)=>X.ok).length,total:$.questions.length,misses:z,perQuestion:Q}}function EL($,Z){let Q=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:Q,hash:D3("sha256").update(Q).digest("hex")}}import{join as XI,extname as UI,resolve as JI}from"path";var PZ={"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 yL}from"path";var L$={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 xL=L$.flutterDeps,gL=L$.mcpDeps,vL=L$.serverFrameworks,kL=L$.stateManagement,hL=L$.routing;function uL($){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 m8($){let Z=w($,"pubspec.yaml");if(Z===null)return null;let Q=uL(Z),z=(O)=>Q.has(O.toLowerCase()),X=xL.some(z)||/^flutter:\s*$/m.test(Z)||/\bsdk:\s*flutter\b/.test(Z),U=gL.find(z),J=vL.find(([O])=>z(O)),H=kL.find(([O])=>z(O)),V=H?H[1]:"",Y=hL.find(([O])=>z(O)),G=Y?Y[1]:"",W=z("flutter_test")?"flutter_test":z("test")?"test":"",q=/^executables:\s*$/m.test(Z),K=(v($,"bin")??[]).some((O)=>O.name.endsWith(".dart")),D=q||K,B,L="",I;if(X)if(L="Flutter",M($,yL("lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(Z))B="mobile",I="pubspec.yaml (Flutter app)";else B="library",I="pubspec.yaml (Flutter package)";else if(U)B="mcp",I=`pubspec.yaml + ${U} (Dart MCP server)`;else if(J)B="backend",L=J[1],I=`pubspec.yaml + ${J[0]} (Dart backend)`;else if(D)B="cli",I=q?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else B="library",I="pubspec.yaml (Dart package)";return{appType:B,isFlutter:X,framework:L,stateManagement:V,routing:G,testing:W,found:I}}import{join as fL}from"path";var f8={version:1,_doc:"SINGLE SOURCE of Go detection KNOWLEDGE (A+B hybrid, Truth-is-faf-cli). faf-cli imports this directly; SDKs/MCPs compose it. Bolster Go by editing THIS file. Logic stays in go.ts. Content-aware: go.mod ≠ one bucket — backend · CLI · MCP · library. 2026-08-01 initial (Dart composition pattern).",mcpModules:["github.com/mark3labs/mcp-go","github.com/modelcontextprotocol/go-sdk","github.com/metoro-io/mcp-golang","github.com/ThinkInAIXYZ/go-mcp"],serverFrameworks:[["github.com/gin-gonic/gin","Gin"],["github.com/labstack/echo","Echo"],["github.com/labstack/echo/v4","Echo"],["github.com/gofiber/fiber","Fiber"],["github.com/gofiber/fiber/v2","Fiber"],["github.com/go-chi/chi","Chi"],["github.com/go-chi/chi/v5","Chi"],["github.com/gorilla/mux","Gorilla Mux"],["github.com/gofiber/fiber/v3","Fiber"],["google.golang.org/grpc","gRPC"],["connectrpc.com/connect","Connect"],["github.com/go-kratos/kratos","Kratos"],["github.com/go-kratos/kratos/v2","Kratos"],["github.com/zeromicro/go-zero","go-zero"],["github.com/cloudwego/hertz","Hertz"]],cliFrameworks:[["github.com/spf13/cobra","Cobra"],["github.com/urfave/cli","urfave/cli"],["github.com/urfave/cli/v2","urfave/cli"],["github.com/alecthomas/kingpin","Kingpin"],["github.com/alecthomas/kong","Kong"]]};var pL=f8.mcpModules,lL=f8.serverFrameworks,cL=f8.cliFrameworks;function dL($){let Z=new Set,Q=!1;for(let z of $.split(`
|
|
252
|
+
`)){let X=z.replace(/\/\/.*$/,"").trim();if(!X)continue;if(/^require\s*\(\s*$/.test(X)){Q=!0;continue}if(Q){if(X===")"){Q=!1;continue}let J=X.match(/^(\S+)/);if(J)Z.add(J[1].toLowerCase());continue}let U=X.match(/^require\s+(\S+)/);if(U&&U[1]!=="(")Z.add(U[1].toLowerCase())}return Z}function O3($,Z){let Q=Z.toLowerCase();for(let z of $)if(z===Q||z.startsWith(`${Q}/`))return!0;return!1}function I3($,Z){let Q;for(let z of Z){if(!O3($,z[0]))continue;if(!Q||z[0].length>Q[0].length)Q=z}return Q}function iL($,Z){let Q;for(let z of Z){if(!O3($,z))continue;if(!Q||z.length>Q.length)Q=z}return Q}function nL($){let Z=$.match(/^module\s+(\S+)/m);return Z?Z[1]:""}function rL($){for(let{name:Z}of v($,"cmd")??[]){let Q=fL("cmd",Z),z=O0($,Q);if(z?.isDirectory()){if((v($,Q)??[]).some((X)=>X.name.endsWith(".go")))return!0}else if(z&&Z.endsWith(".go"))return!0}return!1}function sL($){let Z=w($,"main.go");return Z!==null&&/^package\s+main\b/m.test(Z)}function p8($){let Z=w($,"go.mod");if(Z===null)return null;let Q=nL(Z),z=dL(Z),X=iL(z,pL),U=I3(z,lL),J=I3(z,cL),H=rL($),V=sL($),Y,G="",W;if(X)Y="mcp",W=`go.mod + ${X} (Go MCP server)`;else if(U)Y="backend",G=U[1],W=`go.mod + ${U[0]} (Go backend)`;else if(J)Y="cli",G=J[1],W=`go.mod + ${J[0]} (Go CLI)`;else if(H)Y="cli",W="go.mod + cmd/ (Go CLI layout)";else if(V&&!U)Y="cli",W="go.mod + main.go package main (Go CLI)";else Y="library",W="go.mod (Go module)";return{appType:Y,modulePath:Q,framework:G,found:W}}var C2={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 aL=C2.mcpPackages.map(($)=>$.toLowerCase()),tL=C2.cliPackages.map(([$,Z])=>[$.toLowerCase(),Z]),eL=C2.testPackages.map(([$,Z])=>[$.toLowerCase(),Z]),$M=C2.grpcServerPackages.map(($)=>$.toLowerCase()),ZM=C2.specializedSdks,_3=C2.baseSdk.toLowerCase();function QM($){let Z=$.match(/<Project\b[^>]*\bSdk\s*=\s*"([^"/]+)(?:\/[^"]*)?"/i),Q=$.match(/<Sdk\b[^>]*\bName\s*=\s*"([^"]+)"/i),z=(Z?.[1]||Q?.[1]||"").trim(),X=($.match(/<OutputType>\s*([^<]+?)\s*<\/OutputType>/i)?.[1]||"").trim(),U=$.match(/<TargetFramework>\s*([^<]+?)\s*<\/TargetFramework>/i)?.[1],H=($.match(/<TargetFrameworks>\s*([^<]+?)\s*<\/TargetFrameworks>/i)?.[1]||U||"").trim(),V=/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test($),Y=/<UseMaui>\s*true\s*<\/UseMaui>/i.test($),G=/<UseWPF>\s*true\s*<\/UseWPF>/i.test($),W=/<UseWindowsForms>\s*true\s*<\/UseWindowsForms>/i.test($),q=new Set;for(let D of $.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))q.add(D[1].toLowerCase());for(let D of $.matchAll(/<PackageReference\s+Include\s*=\s*"([^"]+)"/gi))q.add(D[1].toLowerCase());let K=new Set;for(let D of $.matchAll(/<FrameworkReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi))K.add(D[1].toLowerCase());return{sdk:z,outputType:X,targetFramework:H,isTestProject:V,useMaui:Y,useWpf:G,useWindowsForms:W,packages:q,frameworkRefs:K}}function FZ($,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 P3($,Z){let Q;for(let[z,X]of Z){if(!FZ($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function zM($){let Z;for(let Q of aL){if(!FZ($,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 XM($){let Z=$.toLowerCase();if(!Z)return;let Q;for(let z of ZM){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 UM($,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 JM($,Z){let Q=Z.replace(/\.csproj$/i,""),{sdk:z,packages:X,frameworkRefs:U,outputType:J}=$,H,V="",Y,G=zM(X),W=XM(z),q=P3(X,eL),K=P3(X,tL),D=$M.some((L)=>FZ(X,L)),B=U.has("microsoft.aspnetcore.app");if(G)H="mcp",V="MCP",Y=`${Z} + ${G} (C# MCP server)`;else if($.isTestProject||W?.[1]==="test"||q)H="library",V=q?.[1]||(W?.[1]==="test"?W[2]:"Test"),Y=`${Z} + test (${V})`;else if($.useMaui)H="mobile",V="MAUI",Y=`${Z} + UseMaui (MAUI)`;else if($.useWpf||$.useWindowsForms)H="backend",V=$.useWpf&&$.useWindowsForms?"WPF+WinForms":$.useWpf?"WPF":"Windows Forms",Y=`${Z} + ${V}`;else if(W?.[1]==="web")H="backend",V=D?"gRPC":W[2],Y=`${Z} + Sdk=${W[0]}${D?" + Grpc.AspNetCore":""} (ASP.NET Core)`;else if(W?.[1]==="worker")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Worker)`;else if(W?.[1]==="blazor-wasm")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Blazor WASM)`;else if(W?.[1]==="aspire")H="backend",V=W[2],Y=`${Z} + Sdk=${W[0]} (Aspire)`;else if(W?.[1]==="razor-lib")H="library",V=W[2],Y=`${Z} + Sdk=${W[0]} (Razor class library)`;else if(B&&l8(J))H="backend",V="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (host)`;else if(B&&!l8(J))H="library",V="ASP.NET Core",Y=`${Z} + FrameworkReference Microsoft.AspNetCore.App (web library)`;else if(K&&(l8(J)||!J))H="cli",V=K[1],Y=`${Z} + ${K[0]} (C# CLI)`;else if(l8(J))H="cli",Y=`${Z} + OutputType=Exe (C# console)`;else{H="library";let L=z?` Sdk=${z}`:"";if(Y=`${Z}${L} (C# class library)`.replace(" Sdk=Microsoft.NET.Sdk",""),!z||z.toLowerCase()===_3||z.toLowerCase().startsWith(`${_3}/`))Y=`${Z} (C# class library)`}return{appType:H,projectName:Q,targetFramework:$.targetFramework,sdk:z||"Microsoft.NET.Sdk",framework:V,found:Y}}function M$($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.toLowerCase().endsWith(".csproj")).sort()}function c8($){let Z=M$($);if(Z.length===0)return null;let Q=null,z=999;for(let X of Z){let U=w($,X);if(U===null)continue;let J=QM(U),H=JM(J,X),V=UM(H.appType,H.framework);if(!Q||V<z)Q=H,z=V}return Q}import{join as j2}from"path";var P0={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 VM=P0.mcpArtifacts.map(($)=>$.toLowerCase()),YM=P0.webPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),GM=P0.webParents.map(([$,Z])=>[$.toLowerCase(),Z]),WM=P0.webArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),qM=P0.androidPlugins.map(($)=>$.toLowerCase()),BM=P0.kmpPlugins.map(($)=>$.toLowerCase()),KM=P0.jvmKotlinPlugins.map(($)=>$.toLowerCase()),DM=P0.cliPlugins.map(([$,Z])=>[$.toLowerCase(),Z]),LM=P0.cliArtifacts.map(([$,Z])=>[$.toLowerCase(),Z]),MM=P0.libraryPlugins.map(($)=>$.toLowerCase()),IM=["pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"];function RZ($){return IM.some((Z)=>M($,Z))}function OM($){let Z=new Map,Q=new Map,z="";for(let X of $.split(`
|
|
253
|
+
`)){let U=X.replace(/#.*$/,"").trim();if(!U)continue;let J=U.match(/^\[([^\]]+)\]$/);if(J){z=J[1].trim().toLowerCase();continue}let H=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bid\s*=\s*"([^"]+)"/);if(H&&(z==="plugins"||z.endsWith(".plugins"))){Z.set(H[1].replace(/-/g,".").toLowerCase(),H[2].toLowerCase()),Z.set(H[1].toLowerCase(),H[2].toLowerCase());continue}let V=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"([^"]+)"/);if(V&&(z==="libraries"||z.endsWith(".libraries"))){let W=V[1].toLowerCase();Q.set(W,V[2].toLowerCase()),Q.set(W.replace(/-/g,"."),V[2].toLowerCase());continue}let Y=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"([^"]+)"[^}]*\bname\s*=\s*"([^"]+)"/);if(Y&&(z==="libraries"||z.endsWith(".libraries"))){let W=`${Y[2]}:${Y[3]}`.toLowerCase(),q=Y[1].toLowerCase();Q.set(q,W),Q.set(q.replace(/-/g,"."),W);continue}let G=U.match(/^([A-Za-z0-9_.-]+)\s*=\s*"([^"]+)"/);if(G){let W=G[1].toLowerCase(),q=G[2];if(z==="plugins"||z.endsWith(".plugins")){let K=q.split(":")[0].toLowerCase();Z.set(W,K),Z.set(W.replace(/-/g,"."),K)}else if(z==="libraries"||z.endsWith(".libraries")){let K=q.split(":");if(K.length>=2){let D=`${K[0]}:${K[1]}`.toLowerCase();Q.set(W,D),Q.set(W.replace(/-/g,"."),D)}}}}return{plugins:Z,libraries:Q}}function _M($){let Z=w($,j2("gradle","libs.versions.toml"));if(!Z)return{plugins:new Map,libraries:new Map};return OM(Z)}function PM($){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 FM($,Z){let Q=new Set;for(let z of $.matchAll(/\bid\s*\(\s*["']([^"']+)["']\s*\)/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/\bid\s+['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/plugins\s*\{([\s\S]*?)\}/g))for(let X of z[1].split(/[\n;]/)){let U=X.replace(/\/\/.*$/,"").trim();if(!U||U.startsWith("id")||U.startsWith("kotlin")||U.startsWith("alias"))continue;let J=U.match(/^`([a-zA-Z0-9.-]+)`$/)||U.match(/^([a-zA-Z][a-zA-Z0-9.-]*)$/);if(J)Q.add(J[1].toLowerCase())}for(let z of $.matchAll(/\bkotlin\s*\(\s*["']([^"']+)["']\s*\)/g)){let X=z[1].toLowerCase();if(X==="jvm")Q.add("org.jetbrains.kotlin.jvm");else if(X==="multiplatform")Q.add("org.jetbrains.kotlin.multiplatform");else if(X==="android")Q.add("org.jetbrains.kotlin.android");else Q.add(`org.jetbrains.kotlin.${X}`)}for(let z of $.matchAll(/libs\.plugins\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase(),U=Z.plugins.get(X)||Z.plugins.get(X.replace(/\./g,"-"))||Z.plugins.get(X.replace(/-/g,"."));if(U)Q.add(U);else if(X.includes("spring")&&X.includes("boot"))Q.add("org.springframework.boot")}for(let z of $.matchAll(/apply\s+plugin\s*:\s*['"]([^'"]+)['"]/g))Q.add(z[1].toLowerCase());return Q}function RM($,Z){let Q=new Set;for(let z of $.matchAll(/["']([A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+)(?::[^"']+)?["']/g))Q.add(z[1].toLowerCase());for(let z of $.matchAll(/libs\.([A-Za-z0-9_.]+)/g)){let X=z[1].toLowerCase();if(X.startsWith("plugins."))continue;let U=[X,X.replace(/\./g,"-"),X.replace(/-/g,".")];for(let J of U){let H=Z.libraries.get(J);if(H){Q.add(H.includes(":")?H.split(":").slice(0,2).join(":"):H);break}}}return Q}function N3($){let Z=($.match(/<packaging>\s*([^<]+?)\s*<\/packaging>/i)?.[1]||"jar").trim().toLowerCase(),Q=new Set,z=$.match(/<parent>([\s\S]*?)<\/parent>/i);if(z){let J=z[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),H=z[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(J&&H)Q.add(`${J}:${H}`.toLowerCase())}let X=new Set;for(let J of $.matchAll(/<dependency>([\s\S]*?)<\/dependency>/gi)){let H=J[1].match(/<groupId>\s*([^<]+?)\s*<\/groupId>/i)?.[1]?.trim(),V=J[1].match(/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i)?.[1]?.trim();if(H&&V)X.add(`${H}:${V}`.toLowerCase())}let U=[];for(let J of $.matchAll(/<module>\s*([^<]+?)\s*<\/module>/gi))U.push(J[1].trim());return{packaging:Z,parents:Q,artifacts:X,modules:U}}function J2($,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 Y6($,Z,Q){let z;for(let[X,U]of Z){let J=!1;if(Q==="plugin")J=J2($,X);else if(J=$.has(X)||[...$].some((H)=>H===X||H.startsWith(`${X}:`)||H.startsWith(`${X}.`)),!J&&Q==="artifact")J=[...$].some((H)=>H===X||H.startsWith(`${X}`));if(!J)continue;if(!z||X.length>z[0].length)z=[X,U]}return z}function NM($){let Z;for(let Q of VM)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 T3($,Z){let Q=new Set,z=!1,X=!1,U=[j2(Z,"src"),j2(Z,"src","main")],J=(H,V)=>{if(V>4)return;let Y=v($,H);if(!Y)return;for(let{name:G}of Y){if(G==="androidMain"||G==="commonMain"||G==="jvmMain"||G==="iosMain")Q.add(G);let W=j2(H,G),q=O0($,W);if(!q)continue;if(q.isDirectory())J(W,V+1);else if(G.endsWith(".kt")||G.endsWith(".kts"))z=!0;else if(G.endsWith(".java"))X=!0}};for(let H of U)J(H,0);return{kotlin:z,java:X,hints:Q}}function TM($){let Z=[],Q=$.plugins,z=$.artifacts,X=BM.some((R)=>J2(Q,R))||$.sourceHints.has("commonMain"),U=J2(Q,"com.android.application"),J=!U&&qM.some((R)=>J2(Q,R));if(U||J)Z.push("android");if(X)Z.push("multiplatform");let H=NM(z),V=Y6(Q,YM,"plugin"),Y=Y6($.parents,GM,"parent"),G=Y6(z,WM,"artifact"),W=Y6(Q,DM,"plugin"),q=Y6(z,LM,"artifact"),K=MM.some((R)=>J2(Q,R)),D=$.packaging==="pom",B,L="",I;if(U)B="mobile",L=X?"Android+KMP":"Android",I=`${$.path||"root"} + com.android.application (${L})`;else if(H)B="mcp",L="MCP",Z.push("mcp"),I=`${$.path||"root"} + ${H} (JVM MCP server)`;else if(V||Y||G){B="backend",L=V?.[1]||Y?.[1]||G?.[1]||"JVM";let R=V?.[0]||Y?.[0]||G?.[0]||"web";I=`${$.path||"root"} + ${R} (JVM backend)`}else if(X&&!J)B="library",L="Kotlin Multiplatform",I=`${$.path||"root"} + kotlin multiplatform (KMP library)`;else if(J)B="library",L=X?"Android+KMP":"Android",I=`${$.path||"root"} + android library (${L})`;else if(q||$.hasApplicationPlugin&&($.hasMainClass||W)||W&&$.hasMainClass)B="cli",L=q?.[1]||"application",I=q?`${$.path||"root"} + ${q[0]} (JVM CLI)`:`${$.path||"root"} + application plugin (JVM CLI)`;else if($.hasApplicationPlugin&&!K)B="cli",L="application",I=`${$.path||"root"} + application plugin (JVM CLI)`;else if(D)B="library",I=`${$.path||"root"} + packaging=pom (Maven aggregator/BOM)`;else{B="library";let R=$.kotlinSources&&!$.javaSources?"Kotlin":"JVM";if(I=`${$.path||"root"} (${R} library)`,K)I=`${$.path||"root"} + java-library (JVM library)`}let O="Java";if($.kotlinSources&&$.javaSources)O="Java/Kotlin";else if($.kotlinSources||KM.some((R)=>J2(Q,R))||X)O="Kotlin";let A=[...new Set(Z)];return{appType:B,framework:L,facets:A,found:I,buildTool:$.buildTool,mainLanguage:O}}function AM($,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 F3($,Z,Q){let z=j2(Z,"build.gradle.kts"),X=j2(Z,"build.gradle"),U=M($,z)?z:M($,X)?X:null;if(!U)return null;let J=w($,U);if(!J)return null;let H=FM(J,Q),V=RM(J,Q),Y=T3($,Z),G=/mainClass\s*[.=]/.test(J)||/mainClassName\s*=/.test(J)||/Main-Class/.test(J),W=J2(H,"application")||J2(H,"org.gradle.application");return{path:Z||"build.gradle",plugins:H,artifacts:V,packaging:"jar",parents:new Set,hasMainClass:G,hasApplicationPlugin:W,sourceHints:Y.hints,kotlinSources:Y.kotlin||U.endsWith(".kts"),javaSources:Y.java,buildTool:"gradle"}}function R3($,Z){let Q=w($,j2(Z,"pom.xml"));if(!Q)return null;let{packaging:z,parents:X,artifacts:U}=N3(Q),J=T3($,Z);return{path:Z?`${Z}/pom.xml`:"pom.xml",plugins:new Set,artifacts:U,packaging:z,parents:X,hasMainClass:/<mainClass>/.test(Q),hasApplicationPlugin:!1,sourceHints:J.hints,kotlinSources:J.kotlin,javaSources:J.java,buildTool:"maven"}}function G6($){if(!RZ($))return null;let Z=_M($),Q=[],z=null;for(let Y of["settings.gradle.kts","settings.gradle"])if(M($,Y)){z=w($,Y);break}let X=z?PM(z):[],U=F3($,"",Z);if(U)Q.push(U);for(let Y of X){let G=F3($,Y,Z);if(G)Q.push(G)}let J=R3($,"");if(J){Q.push(J);let Y=w($,"pom.xml");if(Y){let{modules:G}=N3(Y);for(let W of G){let q=R3($,W);if(q)Q.push(q)}}}if(Q.length===0&&z)return{appType:"library",framework:"",buildTool:"gradle",mainLanguage:"Java/Kotlin",facets:[],found:"settings.gradle (Gradle multi-project root)"};if(Q.length===0)return null;let H=null,V=999;for(let Y of Q){let G=TM(Y),W=AM(G.appType,G.facets);if(!H||W<V)H={appType:G.appType,framework:G.framework,buildTool:G.buildTool,mainLanguage:G.mainLanguage,facets:G.facets,found:G.found},V=W}if(H&&X.length>0&&!H.found.includes("multi-project"));return H}import{join as jM}from"path";var W6={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 wM=W6.mcpGems.map(($)=>$.toLowerCase()),SM=W6.webGems.map(([$,Z])=>[$.toLowerCase(),Z]),A3=W6.cliGems.map(([$,Z])=>[$.toLowerCase(),Z]),EM=W6.railsLayoutFiles;function bM($){return M($,"Gemfile")||M($,"gems.rb")||yM($)}function yM($){return(v($)??[]).some((Z)=>Z.name.endsWith(".gemspec"))}function xM($){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 gM($){let Z=new Set,Q=!1;for(let z of $.split(`
|
|
255
|
+
`)){let X=z.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(X)){Q=!0;continue}if(Q){if(/^[A-Z]/.test(X)||X.startsWith("PLATFORMS")||X.startsWith("DEPENDENCIES")||X.startsWith("BUNDLED")||X.startsWith("RUBY VERSION")||X.startsWith("CHECKSUMS")){Q=!1;continue}let U=X.match(/^\s{2,}([a-zA-Z0-9_.-]+)\s*\(/);if(U)Z.add(U[1].toLowerCase())}}return Z}function vM($){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 kM($){let Z=new Set,Q=[];for(let X of["Gemfile","gems.rb"]){let U=w($,X);if(U){for(let J of xM(U))Z.add(J);Q.push(X)}}let z=w($,"Gemfile.lock")||w($,"gems.locked");if(z){for(let X of gM(z))Z.add(X);Q.push("Gemfile.lock")}for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let U=w($,X);if(U){for(let J of vM(U))Z.add(J);Q.push(X)}}return{gems:Z,sources:Q}}function q6($,Z){let Q=Z.toLowerCase();if($.has(Q))return!0;return!1}function NZ($,Z){let Q;for(let[z,X]of Z){if(!q6($,z))continue;if(!Q||z.length>Q[0].length)Q=[z,X]}return Q}function hM($){let Z;for(let Q of wM)if(q6($,Q)&&(!Z||Q.length>Z.length))Z=Q;return Z}function C3($){for(let Z of EM)if(M($,Z))return Z;return}function uM($,Z){let Q=NZ(Z,A3);if(Q)return{hit:!0,why:Q[0]};for(let{name:X}of v($)??[]){if(!X.endsWith(".gemspec"))continue;let U=w($,X);if(U&&/executables\s*=/.test(U)&&!/executables\s*=\s*\[\s*\]/.test(U))return{hit:!0,why:`${X} executables`}}let z=v($,"bin");if(z){let U=z.map((J)=>J.name).filter((J)=>{if(J==="setup"||J==="console"||J==="rake")return!1;return O0($,jM("bin",J))?.isFile()===!0}).filter((J)=>J!=="rails");if(U.length>0&&!q6(Z,"rails")&&!C3($))return{hit:!0,why:`bin/${U[0]}`}}return{hit:!1,why:""}}function d8($){if(!bM($))return null;let{gems:Z,sources:Q}=kM($),z=Q[0]||"Gemfile",X=Q.some((L)=>L==="Gemfile"||L==="gems.rb"||L.includes("lock"))?"bundler":"rubygems",U=hM(Z),J=NZ(Z,SM),H=C3($),V=q6(Z,"rails")||q6(Z,"railties"),Y=uM($,Z),G=M($,"config.ru"),W=V||!!H,q=J&&J[1]!=="Rails"&&!(J[0]==="rack"&&!G)?J:void 0,K,D="",B;if(U)K="mcp",D="MCP",B=`${z} + gem ${U} (Ruby MCP)`;else if(W)if(K="backend",D="Rails",V&&H)B=`${z} + rails + ${H} (Rails)`;else if(V)B=`${z} + gem rails (Rails)`;else B=`${H} (Rails layout)`;else if(q)K="backend",D=q[1],B=`${z} + gem ${q[0]} (Ruby backend)`;else if(Y.hit)K="cli",D=NZ(Z,A3)?.[1]||"",B=`${z} + ${Y.why} (Ruby CLI)`;else K="library",B=`${z} (Ruby library)`;return{appType:K,framework:D,packageManager:X,found:B}}import{join as fM}from"path";var y0={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 pM=y0.mcpPackageUrls.map(($)=>$.toLowerCase()),lM=y0.mcpProducts.map(($)=>$.toLowerCase()),cM=y0.serverPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),dM=y0.serverProducts.map(([$,Z])=>[$.toLowerCase(),Z]),iM=y0.cliPackageUrls.map(([$,Z])=>[$.toLowerCase(),Z]),nM=y0.cliProducts.map(([$,Z])=>[$.toLowerCase(),Z]),rM=y0.appProductTypes,sM=y0.cliProductTypes,oM=y0.vaporLayoutFiles;function aM($){return M($,"Package.swift")||TZ($).length>0}function TZ($){return(v($)??[]).map((Z)=>Z.name).filter((Z)=>Z.endsWith(".xcodeproj")&&O0($,Z)?.isDirectory()===!0)}function tM($){let Z=eM($),Q=Z.toLowerCase(),z=[],X=/\.package\s*\(\s*url\s*:\s*"([^"]+)"/gi,U;while((U=X.exec(Z))!==null)z.push(U[1]);let J=/\.package\s*\(\s*url\s*:\s*'([^']+)'/gi;while((U=J.exec(Z))!==null)z.push(U[1]);let H=[],V=/\.product\s*\(\s*name\s*:\s*"([^"]+)"/gi;while((U=V.exec(Z))!==null)H.push(U[1]);let Y=/\.product\s*\(\s*name\s*:\s*'([^']+)'/gi;while((U=Y.exec(Z))!==null)H.push(U[1]);let G=/\.library\s*\(/.test(Q),W=/\.executable\s*\(/.test(Q),q=/\.plugin\s*\(/.test(Q)&&!G&&!W?!0:/\bproducts\s*:\s*\[[\s\S]*?\.plugin\s*\(/.test(Q),K=/\.executabletarget\s*\(/.test(Q),D=/\.target\s*\(/.test(Q)&&!K?!0:(Q.match(/\.target\s*\(/g)||[]).length>(Q.match(/\.executabletarget\s*\(/g)||[]).length+(Q.match(/\.testtarget\s*\(/g)||[]).length;return{packageUrls:z,productNames:H,hasLibraryProduct:G,hasExecutableProduct:W,hasPluginProduct:!!q,hasExecutableTarget:K,hasLibraryTarget:D}}function eM($){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 $I($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let X of Z)for(let U of Q)if(U.includes(X)&&(!z||X.length>z.length))z=X;return z}function j3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)for(let J of Q)if(J.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function w3($,Z){let Q=$.map((X)=>X.toLowerCase()),z;for(let[X,U]of Z)if(Q.includes(X)&&(!z||X.length>z[0].length))z=[X,U];return z}function ZI($){let Z=$.map((Q)=>Q.toLowerCase());return lM.some((Q)=>Z.includes(Q))}function QI($){let Z=!1,Q=!1,z;for(let X of TZ($)){let U=w($,fM(X,"project.pbxproj"));if(!U)continue;for(let J of rM)if(U.includes(J))Z=!0,z=J;for(let J of sM)if(U.includes(J)){if(Q=!0,!z)z=J}}return{hasApplication:Z,hasTool:Q,hit:z}}function zI($){for(let Z of oM)if(M($,Z))return Z;return}function B6($){if(!aM($))return null;let Z=M($,"Package.swift"),Q=TZ($),z=Q.length>0,X=null;if(Z){let P=w($,"Package.swift");if(P)X=tM(P)}let U=z?QI($):{hasApplication:!1,hasTool:!1},J=zI($),H=X?.packageUrls??[],V=X?.productNames??[],Y=$I(H,pM),G=ZI(V),W=j3(H,cM),q=w3(V,dM),K=j3(H,iM),D=w3(V,nM),B=!!(Y||G),L=!!(W||q||J),I=!!(X?.hasExecutableProduct||X?.hasExecutableTarget),O=!!(K||D),A=U.hasApplication,R=Z&&z?"spm+xcode":Z?"spm":"xcode",N,T="",S;if(B)if(N="mcp",T="MCP",G)S="Package.swift + product MCP (Swift MCP)";else S=`Package.swift + ${Y} (Swift MCP)`;else if(L)if(N="backend",T=q?.[1]||W?.[1]||(J?"Vapor":""),q)S=`Package.swift + product ${q[1]} (Swift backend)`;else if(W)S=`Package.swift + ${W[1]} (Swift backend)`;else S=`${J} (Swift backend layout)`;else if(A)N="app",T="",S=`${Q[0]} + ${U.hit||"application"} (Swift app)`;else if(O||I&&!L&&!B)if(N="cli",T=D?.[1]||K?.[1]||"",D)S=`Package.swift + product ${D[1]} (Swift CLI)`;else if(K)S=`Package.swift + ${K[1]} (Swift CLI)`;else if(X?.hasExecutableProduct)S="Package.swift + .executable product (Swift CLI)";else S="Package.swift + .executableTarget (Swift CLI)";else if(U.hasTool&&!Z)N="cli",S=`${Q[0]} + tool productType (Swift CLI)`;else if(Z)if(N="library",X?.hasLibraryProduct)S="Package.swift + .library product (Swift library)";else S="Package.swift (Swift library)";else N="library",S=`${Q[0]||"xcodeproj"} (Swift — no classifying productType)`;return{appType:N,framework:T,packageManager:R,found:S}}var HI=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),VI=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),YI={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"]},GI=[["packageManager","package-manager"],["pkg_manager","package-manager"],["mainLanguage","language"],["main_language","language"],["framework","framework"],["backend","backend"],["database","database"],["db","database"],["cicd","ci-cd"],["hosting","hosting"],["buildTool","build"],["build_tool","build"],["build","build"],["runtime","runtime"],["cssFramework","css"],["css","css"],["uiLibrary","ui-library"],["stateManagement","state-management"],["apiType","api"],["api","api"]];function WI($,Z){for(let[Q,z]of GI)if(Q in $)return z;return Z.length>0?"framework":"config"}function qI($,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 BI($,Z){if(Z.isFile())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isFile()===!0}function KI($,Z){if(Z.isDirectory())return!0;if(!Z.isSymbolicLink())return!1;return O0($,Z.name)?.isDirectory()===!0}function DI($){let Z=[],Q=JI($),z=new Set,X=v(Q);if(!X)return Z;for(let U of X){let J=U.name;if(J.endsWith(".xcodeproj")?!KI(Q,U):!BI(Q,U))continue;if(J.toLowerCase().endsWith(".csproj")){let V=c8(Q);if(V){let Y={mainLanguage:"C#",packageManager:"NuGet",buildTool:"dotnet"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="mobile"&&V.framework)Y.framework=V.framework;if(V.targetFramework)Y.runtime=V.targetFramework;let G=V.framework?[V.framework,"C#",".NET"]:["C#",".NET"];Z.push({slots:Y,priority:36,frameworks:G,fileName:J})}continue}if(J.endsWith(".xcodeproj")){let V=B6(Q);if(V){let Y={mainLanguage:"Swift",packageManager:V.packageManager==="spm"?"spm":"Xcode",buildTool:V.packageManager.includes("spm")?"swift build":"xcodebuild"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="app"&&V.framework)Y.framework=V.framework;let G=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:Y,priority:36,frameworks:G,fileName:J})}continue}let H=PZ[J];if(!H)continue;if(J==="manifest.json"&&qI(Q,J)!=="chrome")continue;if(J==="pubspec.yaml"){let V=m8(Q);if(V){let Y={mainLanguage:"Dart",packageManager:"pub"};if(V.isFlutter){if(Y.framework="Flutter",V.stateManagement)Y.stateManagement=V.stateManagement}else if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";Z.push({slots:Y,priority:H.priority,frameworks:V.isFlutter?["Flutter","Dart"]:["Dart"],fileName:J});continue}}if(J==="go.mod"){let V=p8(Q);if(V){let Y={mainLanguage:"Go",packageManager:"go modules",buildTool:"go build"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";let G=V.framework?[V.framework,"Go"]:["Go"];Z.push({slots:Y,priority:H.priority,frameworks:G,fileName:J});continue}}if(J==="Gemfile"||J==="Gemfile.lock"||J==="gems.rb"){let V=d8(Q);if(V){let Y={mainLanguage:"Ruby",packageManager:V.packageManager};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";let G=V.framework?[V.framework,"Ruby"]:["Ruby"];Z.push({slots:Y,priority:H.priority??35,frameworks:G,fileName:J});continue}}if(J==="Package.swift"){let V=B6(Q);if(V){let Y={mainLanguage:"Swift",packageManager:V.packageManager==="xcode"?"Xcode":"spm",buildTool:"swift build"};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="app"&&V.framework)Y.framework=V.framework;let G=V.framework?[V.framework,"Swift"]:["Swift"];Z.push({slots:Y,priority:H.priority??36,frameworks:G,fileName:J});continue}}if(J==="pom.xml"||J==="build.gradle"||J==="build.gradle.kts"||J==="settings.gradle"||J==="settings.gradle.kts"){if(z.has(Q))continue;z.add(Q);let V=G6(Q);if(V){let Y={mainLanguage:V.mainLanguage==="Java/Kotlin"?"Kotlin":V.mainLanguage,packageManager:V.buildTool==="maven"?"maven":"gradle",buildTool:V.buildTool};if(V.appType==="backend"&&V.framework)Y.backend=V.framework;else if(V.appType==="cli"&&V.framework)Y.framework=V.framework;else if(V.appType==="mcp")Y.apiType="MCP";else if(V.appType==="mobile")Y.framework=V.framework||"Android";if(V.facets.includes("multiplatform"))Y.framework=V.framework||"Kotlin Multiplatform";let G=V.framework?[V.framework,"JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"]:["JVM",V.mainLanguage==="Kotlin"?"Kotlin":"Java"];Z.push({slots:Y,priority:H.priority??35,frameworks:G,fileName:J});continue}}Z.push({slots:H.slots||{},priority:H.priority,frameworks:H.frameworks,fileName:J})}return Z}function LI($){let Z=[];for(let Q of z$($,()=>E3($,2,{count:0}))){let z=PZ[`*${Q}`],X=z?.slots?.mainLanguage;if(X)Z.push({slots:{mainLanguage:X},priority:z.priority,frameworks:z.frameworks})}return Z}function S3($){let Z=[...DI($),...LI($)],Q={},z={},X=new Set;for(let Y of Z){Y.frameworks.forEach((G)=>X.add(G));for(let[G,W]of Object.entries(Y.slots))if(W&&!W.includes("/")&&(!(G in Q)||Y.priority>z[G]))Q[G]=W,z[G]=Y.priority}let U=new Map;for(let Y of Z){if(!Y.fileName)continue;if(!U.has(Y.fileName))U.set(Y.fileName,{fileName:Y.fileName,category:WI(Y.slots,Y.frameworks),priority:Y.priority})}let J=[...U.values()].sort((Y,G)=>G.priority-Y.priority||Y.fileName.localeCompare(G.fileName)),H=[];if(Q.mainLanguage)H.push(Q.mainLanguage.toLowerCase());if(Q.framework)H.push(Q.framework.toLowerCase());let V=H.length>0?H.join("-"):"unknown-stack";return{slotFills:Q,frameworks:[...X],confirmedCount:Z.length,discoveredFormats:J,stackSignature:V}}function i8($){let{slotFills:Z}=S3($),Q={};for(let[z,X]of Object.entries(Z)){let U=YI[z];if(!U||!X)continue;let[J,H]=U;if(J==="project")(Q.project??={})[H]=X;else(Q.stack??={})[H]=X}return Q}function E3($,Z,Q){let z=new Set;if(Z<0||Q.count>400)return z;let X=v($);if(!X)return z;for(let U of X){if(Q.count++>400)break;if(!U.isDirectory()){let J=UI(U.name);if(VI.has(J))z.add(J);continue}if(HI.has(U.name)||U.name.startsWith("."))continue;for(let J of E3(XI($,U.name),Z-1,Q))z.add(J)}return z}var U0={goal:["use\\s+cases?","goals?"],what:["description","overview","purpose","introduction","what","what\\s+is\\s+(?!new\\b)\\S+","what\\s+it\\s+does"],who:["audience","target\\s+audience","for\\s+whom","who","who\\s+is\\s+(?:this|it)\\s+for","who\\s+it.s\\s+for"],why:["why","why\\s+(?:use\\s+)?(?!not\\b)\\S+","motivations?","(?:the\\s+)?problem","rationale","mission","vision"],where:["deployment","where","where\\s+it\\s+runs","hosting","platforms","supported\\s+platforms","platform\\s+support"],when:["status","(?:project|current)\\s+status","timeline","since","launched"],how:["architecture","how","how\\s+it\\s+works","how\\s+does\\s+it\\s+work","under\\s+the\\s+hood","internals","approach","methodology"]},I$={MIN_LENGTH:8,MAX_LENGTH:280},MI=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i,/^(welcome|hello|hi|thanks|thank\s+you)\b/i,/\bwelcome[.!]?$/i,/^(copyright\b|\(c\)|©)/i,/\ball\s+rights\s+reserved\b/i,/^(?:(?:dual-)?licen[cs]ed\s+under|permission\s+is\s+hereby)\b/i,/\b(npm|pnpm|yarn|bun)\s+(i|install|add)\s|\bpip3?\s+install\s|\bcargo\s+(add|install)\s|\bgo\s+(get|install)\s|\bbrew\s+install\s/i,/^please\b/i,/\bto get started\b|\bread the (docs|documentation|guide)\b|\bstart with the (docs|documentation|guide)\b|\bread the announcement\b|\bcheck out (the|our)\b/i,/^["“'‘][\s\S]*["”'’]$/,/\?$/,/(—|–|[—–,;]|\s-)\s*$/,/^(the\s+)?mono-?repo\s+(for|of|containing|with)\b/i,/\bmono-?repo(\s+root)?\.?$/i,/[a-z]{2,}\.[A-Z][a-z]{2,}/,/^#{1,6}\s/,/\*\*[^*\n]{1,30}:\*\*[\s\S]*\*\*[^*\n]{1,30}:\*\*/];function b3($){return II.some((Z)=>Z.test($))}var II=[/\b(no longer (maintained|supported|developed)|unmaintained|deprecated|archived|end[- ]of[- ]life)\b/i,/^(sponsored|supported|funded|backed|brought to you) by\b/i,/\b(we['’]re|we are) hiring\b|^join (us|our)\b/i,/\b(documentation|docs) (is |are )?(available|can be found|lives?) (at|on|in)\b/i,/^looking for\b|\?\s/i,/^moved to\b|\b(has )?moved to\b|\bmirror of\b/i,/^(requires?|needs)\b/i,/^status\s*:/i,/^(warning|important|note|caution|attention|heads[- ]up|disclaimer|notice|danger)\s*:/i,/\b(t-?shirts?|mugs|stickers|merch(andise)?|donate|sponsor (us|me))\b/i,/^(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200d|\ufe0f|\s)+[\p{L}\p{N} '-]{1,30}:\s/u];function n8($){return/^\[!/.test($)||/^(⚠|🚧|❗|⛔|❌|🛑)/u.test($)||/\b(nightly (release|build)|pre-?release|work[-\s]in[-\s]progress|rough edges|early (access|testing|preview)|use at your own risk|not (yet )?production[-\s]?ready|expect (rough|breaking)|experimental release)\b/i.test($)}function r8($){let Z=$.findIndex((Q)=>Q.trim()!=="");if(Z>=0&&/^[-=]{3,}\s*$/.test($[Z+1]??""))return $.slice(Z+2);return $}function r($){let Z=$.trim();if(Z.length<I$.MIN_LENGTH)return!1;if(Z.length>I$.MAX_LENGTH)return!1;if(MI.some((Q)=>Q.test(Z)))return!1;if(/^(\||[-*+](\s|$))/.test(Z))return!1;if(Z.split(`
|
|
258
|
+
`).length>4)return!1;if(OI(Z))return!1;return!0}function w2($){let Z=$.trim(),Q=/[.!?…]+(?=\s+\S|\s*$)/g;for(let z=Q.exec(Z);z;z=Q.exec(Z)){let X=z.index+z[0].length,U=Z.slice(0,X);if(X<Z.length){let J=Z.slice(X).trimStart();if(/(\.\.\.|…)$/.test(U))continue;if(/\b(e\.g|i\.e|vs|cf|approx|dr|mr|mrs|ms|st|jr|sr|no|fig)\.$/i.test(U))continue;if(/(\betc\.|(?:\b[A-Za-z]\.){2,})$/.test(U)&&/^[a-z]/.test(J))continue}return U.endsWith("?")?null:U}return null}function OI($){if(_I.test($))return!0;if($.includes("```"))return!0;if(/(^|\s)[-=]{3,}(\s|$)/.test($))return!0;if(/^\d+\.\s/.test($))return!0;if(/:\s*$/.test($))return!0;let Q=$.replace(/ /gi," ").split(/\s*(?:\||·|•|•)\s*/i).map((z)=>z.trim()).filter(Boolean);if(Q.length>=3&&Q.every((z)=>z.length<=24))return!0;return PI($)>0.5}var _I=/<\/?(?:p|div|img|br|hr|h[1-6]|picture|source|table|thead|tbody|tr|td|th|ul|ol|li|dl|dt|dd|details|summary|section|header|footer|center|video|iframe|svg|blockquote|pre)\b[^>]*>/i;function PI($){let Z=$.replace(/!\[[^\]]*\]\([^)]*\)/g,""),Q=[...Z.matchAll(/\[([^\]]*)\]\([^)]*\)/g)].map((X)=>X[1]).join(""),z=Z.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").trim();if(!z)return $.trim()?1:0;return Q.length/z.length}var H2=($,Z,Q)=>({value:$,source:Z,confidence:Q});function s8($,Z={}){let Q=Z.toolingRoot?null:RI($),z=NI($),X={},U=(J,H)=>{if(H&&r(H.value))X[J]=H};return U("what",wI(Q,z)),U("who",SI(z)),U("why",EI(z)),U("when",bI(z)),U("how",yI(z)),X}function FI($,Z={}){let Q=s8($,Z),z={};return Object.keys(Q).forEach((X)=>{let U=Q[X];if(U)z[X]=U.value}),z}function RI($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function NI($){let Z=w($,"README.md");if(Z===null)return"";return r8(Z.replace(/<!--[\s\S]*?-->/g,"").split(`
|
|
259
|
+
`)).filter((Q)=>!/^\s*\[!\[/.test(Q)&&!/^\s*!\[/.test(Q)&&!/^\s*\[[^\]]+\]:\s*\S/.test(Q)&&!/^\s*https?:\/\/\S*\)?\s*$/.test(Q)).join(`
|
|
260
|
+
`).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function AZ($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim()}function TI($){if(!$)return 0;return($.match(/\[[^\]]*\]\([^)]*\)/g)??[]).join("").length/$.length}function K6($,Z){let Q=new RegExp(`^#{1,6}\\s+(${Z.join("|")})\\s*[:?]?\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n#|(?![\\s\\S]))`,"im"),z=$.match(Q);if(!z||!z[2]||z[2].trim().length<=20||TI(z[2])>0.4)return null;return{body:AZ(z[2]),heading:z[1].trim()}}function AI($){let Z=$.split(`
|
|
261
|
+
`).map((Q)=>Q.trim()).filter(Boolean);return Z.length>0&&Z.every((Q)=>/^\[[^\]]+\]:\s*\S/.test(Q))}function CI($){let Z=$.trim();if(!/^https?:\/\//.test(Z))return!1;return Z.replace(/https?:\/\/\S+\)?/g," ").replace(/\s+/g," ").trim()===""}function jI($){let Z=$.trim();if(AI(Z))return!0;if(CI(Z))return!0;if(/^>/.test(Z))return!0;if(/^(```|~~~|[-*+]\s|\d+\.\s|\|)/.test(Z))return!0;if(n8(Z))return!0;let z=Z.replace(/ /gi," ").split(/\s*(?:\||·|•|•)\s*/i).map((X)=>X.trim()).filter(Boolean);if(z.length>=3&&z.every((X)=>X.length<=24))return!0;return!1}function wI($,Z){if($?.description&&$.description.length>20)return H2(AZ($.description),"package.json:description",0.95);let Q=K6(Z,U0.what);if(Q)return H2(Q.body,`README:## ${Q.heading}`,0.8);let X=Z.split(/^#{2,6}\s/m)[0].split(/\n\s*\n/).map((H)=>H.replace(/\s+/g," ").trim()).find((H)=>H.length>30&&!H.startsWith("#")&&!jI(H));if(!X)return null;let U=AZ(X);if(U.length<=I$.MAX_LENGTH)return H2(U,"README:first-paragraph",0.5);let J=w2(U);return J?H2(J,"README:first-sentence",0.5):null}function SI($){let Z=K6($,U0.who);return Z?H2(Z.body,`README:## ${Z.heading}`,0.8):null}function EI($){let Z=K6($,U0.why);return Z?H2(Z.body,`README:## ${Z.heading}`,0.8):null}function bI($){let Z=K6($,U0.when);return Z?H2(Z.body,`README:## ${Z.heading}`,0.8):null}function yI($){let Z=K6($,U0.how);return Z?H2(Z.body,`README:## ${Z.heading}`,0.7):null}var y3="3.0";import{join as g3}from"path";var x3=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"anyDependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"},{type:"devDependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"content",pattern:"app.py",key:"flask"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"content",pattern:"main.py",key:"fastapi"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"content",pattern:"Gemfile",key:"rails"},{type:"content",pattern:"Gemfile.lock",key:"rails ("},{type:"file",pattern:"config/application.rb"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"content",pattern:"pom.xml",key:"spring-boot"},{type:"content",pattern:"build.gradle",key:"springframework.boot"},{type:"content",pattern:"build.gradle.kts",key:"springframework.boot"},{type:"content",pattern:"gradle/libs.versions.toml",key:"springframework.boot"}]},{name:"Vapor",slug:"vapor",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"vapor/vapor"},{type:"content",pattern:"Package.swift",key:'product(name: "Vapor"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Vapor'"},{type:"file",pattern:"Sources/App/configure.swift"}]},{name:"Hummingbird",slug:"hummingbird",category:"backend",signals:[{type:"content",pattern:"Package.swift",key:"hummingbird-project/hummingbird"},{type:"content",pattern:"Package.swift",key:'product(name: "Hummingbird"'},{type:"content",pattern:"Package.swift",key:"product(name: 'Hummingbird'"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function xI($){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 gI($){let Z=w($,"Cargo.toml");return Z!==null&&/^\s*\[\[bin\]\]/m.test(Z)}function vI($,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=xI($);if(Q&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(Q))return`Cargo.toml name "${Q}" → sdk`;return null}function kI($){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 hI($){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 uI($,Z){let Q=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of Q)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(M($,"ios")&&M($,"android"))return"ios/ + android/ dirs";return null}function mI($,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 fI($,Z){if(!M($,"index.html"))return null;if(Z?.dependencies||Z?.devDependencies){let Q={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((X)=>Q[X]))return null}return"index.html (vanilla, no frontend framework)"}function pI($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((Q)=>/^(specification|format-spec|standard)$/i.test(Q)))return'package keywords contains "specification"';if(Z?.bin)return null;if(Z?.files&&Z.files.length>0){let Q=/^(dist|src|lib|build|bin)(\/|$)|\/(dist|src|lib|build|bin)(\/|$)|(\.|\/)(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((U)=>Q.test(U)),X=Z.files.some((U)=>/\.(md|MD)$|examples?\//.test(U)||U==="README.md"||U==="docs"||U==="docs/");if(!z&&X)return"package.json files = docs/examples only (no source)"}return null}function lI($,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 cI($,Z){if(!Z)return null;let Q={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],X=["stripe","@stripe/stripe-js","lemonsqueezy"],U=z.some((H)=>Q[H]),J=X.some((H)=>Q[H]);if(U&&J)return"auth + payment dependencies";return null}function dI($,Z,Q){if(Z?.keywords?.some((U)=>/mcpaas/i.test(U)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=Q.some((U)=>U.slug==="mcp"),X=Q.some((U)=>U.category==="database");if(z&&X&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function iI($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||M($,"pnpm-workspace.yaml")))return null;return"private workspace + multi-package"}var nI=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"]),v3=/^(Python|Go|Rust|Ruby|Java|Kotlin)$/,rI=new Set(["frontend","backend","database","css","ui","state"]);function sI($){if(M($,"pyproject.toml")||M($,"manage.py")||M($,"setup.py")||o8($,"requirements*.txt"))return!0;if(M($,"go.mod"))return!0;if(M($,"Cargo.toml"))return!0;if(M($,"Gemfile"))return!0;if(M($,"pom.xml")||o8($,"build.gradle*"))return!0;if(M$($).length>0)return!0;let Z=q0($);if(Z&&Object.keys(Z.dependencies??{}).length>0)return!0;return!1}function a8($){return z$($,()=>oI($))}function oI($){let Z=v($)??[],Q=[];for(let z of Z){if(!z.isDirectory()||z.name.startsWith(".")||nI.has(z.name))continue;let X=g3($,z.name);if(!sI(X))continue;let U=e8(X);if(!U)continue;let J=t8(X).filter((G)=>rI.has(G.category)),H=J.find((G)=>G.category==="frontend"),V=J.find((G)=>G.category==="backend"),Y=H??V??J[0]??null;Q.push({name:z.name,language:U,topFramework:Y?.name??null,frontend:!!H,backend:!!V||v3.test(U),hasFramework:!!Y,appRoot:M(X,"manage.py")||M(X,"config.ru")||M(X,"bin/rails")||M(X,"artisan")})}return Q}function aI($,Z){if(Z?.workspaces||M($,"pnpm-workspace.yaml"))return null;let Q=a8($),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 k3($){let Z=a8($);if(Z.length<2)return null;let Q=(J)=>(J.appRoot?2:0)+(v3.test(J.language)?2:0)+(J.hasFramework?1:0)+(J.frontend?0.5:0),z=[...Z].sort((J,H)=>Q(H)-Q(J)),X=new Set,U=[];for(let J of z){if(X.has(J.language))continue;X.add(J.language);let H=J.frontend?"frontend":J.backend?"backend":"service";U.push(J.topFramework?`${J.language} (${J.topFramework} · ${H})`:`${J.language} (${H})`)}return U.join("; ")}function q0($){let Z=w($,"package.json");if(Z===null)return null;try{return JSON.parse(Z)}catch{return null}}function o8($,Z){if(!Z.includes("*"))return M($,Z);let Q=Z.split("/");if(Q.length===1){let H=Z.split("*")[0];return(v($)??[]).some((V)=>V.name.startsWith(H))}let z=g3(...Q.slice(0,-1)),X=Q[Q.length-1],U=X.split("*")[0],J=X.split("*")[1]||"";return(v($,z)??[]).some((H)=>H.name.startsWith(U)&&H.name.endsWith(J))}function tI($,Z,Q){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"anyDependency":{let z=$.key??"";return!!(Z?.dependencies?.[z]||Z?.devDependencies?.[z])}case"file":return o8(Q,$.pattern);case"content":{if(!$.pattern||!$.key)return!1;if(!o8(Q,$.pattern))return!1;let z=w(Q,$.pattern);return z!==null&&z.toLowerCase().includes($.key.toLowerCase())}default:return!1}}function t8($){let Z=q0($);return x3.map((Q)=>{let X=Q.signals.filter((U)=>tI(U,Z,$)).length/Q.signals.length;return{name:Q.name,slug:Q.slug,category:Q.category,confidence:X}}).filter((Q)=>Q.confidence>0).sort((Q,z)=>z.confidence-Q.confidence)}function e8($){let Z=q0($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(M($,"tsconfig.json"))return"TypeScript";if(M($,"Cargo.toml"))return"Rust";if(M($,"go.mod"))return"Go";if(M$($).length>0)return"C#";if(M($,"pyproject.toml")||M($,"setup.py"))return"Python";if(M($,"Gemfile"))return"Ruby";if(RZ($)){let Q=G6($);if(Q)return Q.mainLanguage==="Java/Kotlin"?"Kotlin":Q.mainLanguage;return"Java"}if(M($,"Package.swift"))return"Swift";if(M($,"build.zig"))return"Zig";if(M($,"pubspec.yaml"))return"Dart";if(Z)return"JavaScript";return""}function h3($){let Z=[];if(M($,"SKILL.md"))Z.push("SKILL.md");for(let Q of["skills",""])for(let z of v($,Q||".")??[]){if(!z.isDirectory()||z.name.startsWith(".")||z.name==="node_modules")continue;if(Q===""&&z.name==="skills")continue;let X=Q?`${Q}/${z.name}/SKILL.md`:`${z.name}/SKILL.md`;if(M($,X))Z.push(X)}return Z}function eI($){let Z=h3($);if(Z.length===0)return null;let Q=[Z.length===1?Z[0]:`${Z.length} SKILL.md folders`];if(M($,".claude-plugin/plugin.json"))return Q.push(".claude-plugin/plugin.json"),{type:"skills-plugin",found:Q};return{type:"skills",found:Q}}function u3($){if(h3($).length===0)return"";return M($,".claude-plugin/plugin.json")?"Claude Code plugin":"Agent Skills"}function m3($){let Z=q0($),Q=t8($),z=[],X=pI($,Z);if(X)return z.push(X),{type:"documentation",found:z};let U=vI($,Z);if(U)return z.push(U),{type:"sdk",found:z};let J=kI($);if(J)return z.push(J),{type:"extension",found:z};let H=dI($,Z,Q);if(H)return z.push(H),{type:"mcpaas",found:z};let V=cI($,Z);if(V)return z.push(V),{type:"saas",found:z};let Y=mI($,Z);if(Y)return z.push(Y),{type:"wasm",found:z};let G=m8($);if(G)return z.push(G.found),{type:G.appType,found:z};let W=p8($);if(W)return z.push(W.found),{type:W.appType,found:z};let q=c8($);if(q)return z.push(q.found),{type:q.appType,found:z};let K=G6($);if(K)return z.push(K.found),{type:K.appType,found:z};let D=d8($);if(D)return z.push(D.found),{type:D.appType,found:z};let B=B6($);if(B)return z.push(B.found),{type:B.appType,found:z};let L=uI($,Z);if(L)return z.push(L),{type:"mobile",found:z};if(Q.some((j)=>j.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(gI($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(M($,"build.zig")){if(z.push("build.zig"),M($,"src/main.zig"))return z.push("src/main.zig"),{type:"cli",found:z};if(M($,"src/root.zig"))return z.push("src/root.zig"),{type:"library",found:z}}let O=Q.some((j)=>j.slug==="svelte"||j.slug==="sveltekit");if(Z?.private===!0&&(M($,"pnpm-workspace.yaml")||Z?.workspaces!==void 0)&&O)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(O)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let R=Q.some((j)=>j.category==="frontend"),N=Q.some((j)=>j.category==="backend");if(Z?.private&&(Z.workspaces||M($,"pnpm-workspace.yaml"))&&R&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let T=iI($,Z);if(T)return z.push(T),{type:"monorepo-root",found:z};let S=lI($,Z,Q);if(S)return z.push(S),{type:"website",found:z};if(Q.some((j)=>j.slug==="nextjs"||j.slug==="nuxt"))return z.push(Q.find((j)=>j.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let b=Q.some((j)=>j.category==="frontend"),$0=Q.some((j)=>j.category==="backend");if(b&&$0)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(b)return z.push("frontend framework"),{type:"frontend",found:z};if($0)return z.push("backend framework"),{type:"backend",found:z};let a=hI($);if(a)return z.push(a),{type:"data-science",found:z};let g=fI($,Z);if(g)return z.push(g),{type:"html",found:z};let C0=aI($,Z);if(C0)return z.push(C0),{type:"fullstack",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};let C=eI($);if(C)return z.push(...C.found),{type:C.type,found:z};return z.push(h2),{type:"library",found:z}}function f3($){if(M($,"bunfig.toml"))return"Bun";if(M($,"deno.json")||M($,"deno.jsonc"))return"Deno";if(q0($))return"Node.js";if(M($,"Cargo.toml"))return"Rust";if(M($,"go.mod"))return"Go";if(M$($).length>0)return".NET";if(M($,"pubspec.yaml"))return"Dart";return""}var $O=new Set(["npm","pnpm","yarn","bun"]);function ZO($){let Z=q0($)?.packageManager;if(typeof Z!=="string")return"";let Q=/^([a-z]+)@/i.exec(Z.trim())?.[1]?.toLowerCase()??"";return $O.has(Q)?Q:""}function QO($){if(M($,"pubspec.yaml"))return"pub";if(M($,"go.mod"))return"go modules";if(M$($).length>0)return"NuGet";if(M($,"pom.xml"))return"maven";return["build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts"].some((Q)=>M($,Q))?"gradle":""}var zO=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function p3($){return QO($)||ZO($)||(zO.find(([Z])=>M($,Z))?.[1]??"")}function l3($){if(M($,".github/workflows"))return"GitHub Actions";if(M($,".gitlab-ci.yml"))return"GitLab CI";if(M($,".circleci"))return"CircleCI";if(M($,"Jenkinsfile"))return"Jenkins";return null}function c3($){if(M($,"vercel.json"))return"Vercel";if(M($,"netlify.toml"))return"Netlify";if(M($,"wrangler.toml"))return"Cloudflare";if(M($,"fly.toml"))return"Fly.io";if(M($,"render.yaml"))return"Render";return null}var XO=["svelte.config.js","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"];function UO($){for(let z of XO){let X=w($,z)?.match(/@sveltejs\/adapter-(\w+)/);if(X)return X[1]}let Z=q0($);return Object.keys({...Z?.dependencies,...Z?.devDependencies}).map((z)=>/^@sveltejs\/adapter-(\w+)$/.exec(z)?.[1]).find(Boolean)??null}function d3($){let Z=UO($);if(Z)switch(Z){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return Z}return null}function CZ($){let Z=$?.devDependencies?.vite??$?.dependencies?.vite,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?"Vite":`Vite ${Q}`}function i3($){let Z=q0($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return CZ(Z);if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(M($,"tsconfig.json")&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function $4($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((Q)=>M($,Q))}function Z4($,Z){let Q={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let X=M($,"bun.lock")||M($,"bun.lockb")?"bun run":"npm run";Q[z]=`${X} ${z}`}}if(M($,"Cargo.toml")){if(!Q.build)Q.build="cargo build --release";if(!Q.test)Q.test="cargo test";if(!Q.lint&&JO($))Q.lint="cargo clippy"}if(M($,"build.zig")){if(!Q.build)Q.build="zig build";if(!Q.test&&/\.step\(\s*"test"/.test(jZ($,"build.zig")))Q.test="zig build test"}if(M($,"go.mod")){if(!Q.build)Q.build="go build ./...";if(!Q.test)Q.test="go test ./..."}if(!Q.test&&HO($))Q.test="pytest";return Q}function jZ($,Z){return w($,Z)??""}function JO($){if(M($,"clippy.toml")||M($,".clippy.toml"))return!0;return/^\s*\[(workspace\.)?lints\.clippy\]/m.test(jZ($,"Cargo.toml"))}function HO($){if(M($,"pytest.ini")||M($,"conftest.py"))return!0;return["pyproject.toml","setup.cfg","tox.ini"].some((Z)=>/\bpytest\b/.test(jZ($,Z)))}function n3($,Z,Q,z){let X=[];if(z&&z!=="Unknown")X.push(z);let U=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let J of Q)if(U.has(J.category))X.push(J.name);if(M($,"bunfig.toml"))X.push("Bun");else if(M($,"deno.json")||M($,"deno.jsonc"))X.push("Deno");if(X.length<3&&Z?.dependencies){let J=Object.keys(Z.dependencies).slice(0,5);for(let H of J)if(!X.some((V)=>V.toLowerCase().includes(H.toLowerCase())))X.push(H)}return X}function VO($){let Z=$?.dependencies?.svelte??$?.devDependencies?.svelte,Q=typeof Z==="string"?/\d+/.exec(Z)?.[0]:void 0;return Q===void 0?NaN:Number(Q)}function Q4($){return wZ($).data}function wZ($){let Z=q0($),Q=t8($),z=m3($),X=z.type,U=z.found.some((y)=>y.startsWith("polyglot:")),J=U&&k3($)||e8($),H=f3($),V=p3($),Y=l3($),G=c3($),W=i3($),q=Q.find((y)=>y.slug==="sveltekit")??Q.find((y)=>y.category==="frontend"),K=Q.find((y)=>y.category==="css"),D=Q.find((y)=>y.category==="ui"),B=Q.find((y)=>y.category==="state"),L=Q.find((y)=>y.category==="backend"),I=Q.find((y)=>y.category==="database"),O=(y)=>u2(X,y)??u2("library",y)===!0,A=X==="framework",R=Q.some((y)=>y.slug==="svelte"||y.slug==="sveltekit"),N=A&&R?"svelte":A?null:null,T=X==="svelte"||N==="svelte",S=T?d3($):null,P=T&&Q.some((y)=>y.slug==="sveltekit"),b={},$0=p.filter((y)=>y.path.startsWith("stack."));for(let y of $0){let u=y.path.replace("stack.","");switch(u){case"frontend":b[u]=q?.name??u3($);break;case"css_framework":b[u]=K?.name??"";break;case"ui_library":b[u]=D?.name??"";break;case"state_management":b[u]=B?.name??(T&&VO(Z)>=5?"Runes":"");break;case"backend":b[u]=T?P?"SvelteKit":L?.name??"":L?.name??"";break;case"api_type":b[u]=P?"Server Routes":"";break;case"runtime":b[u]=H;break;case"database":b[u]=I?.name??"";break;case"connection":b[u]=I?.name??"";break;case"hosting":if(T&&S)b[u]=S;else b[u]=G??"";break;case"build":b[u]=P?CZ(Z):W??"";break;case"cicd":b[u]=Y??"";break;case"package_manager":b[u]=V;break;default:b[u]="";break}}let a={};for(let y of $0){let u=y.path.replace("stack.","");a[u]=O(y)?b[u]:"slotignored"}let g={},C0=p.filter((y)=>y.path.startsWith("monorepo."));for(let y of C0){let u=y.path.replace("monorepo.","");if(!O(y))g[u]="slotignored";else g[u]=""}let C={name:Z?.name??$.split("/").pop()??"project",goal:U?"":Z?.description??"",main_language:J,type:X};if(A&&N)C.framework=N;let j=n3($,Z,Q,U?e8($):J);if(U){for(let y of a8($))for(let u of[y.language,y.topFramework])if(u&&!j.includes(u))j.push(u)}let s=$4($),K0=Z4($,Z),P6={faf_version:y3,project:C,stack:a,human_context:{who:"",what:U?"":Z?.description??"",why:"",where:"",when:"",how:""},monorepo:g,_meta:{found:z.found}};if(j.length>0)P6.tech_stack=j;if(s.length>0)P6.key_files=s;if(Object.keys(K0).length>0)P6.commands=K0;return{data:P6,facts:b}}var S2=($)=>new RegExp(`^(${$.join("|")})\\s*[:?]?$`,"i"),r3=S2(U0.goal),s3=S2(U0.what),o3=S2(U0.who),a3=S2(U0.why),t3=S2(U0.where),e3=S2(U0.when),$z=S2(U0.how),SZ=String.raw`(?:\*\*|__|\*|_)`,YO=String.raw`(?:(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u200d|\ufe0f)+\s*)?`,Zz=String.raw`${YO}${SZ}?[^*[\]:]{1,30}(?::${SZ}?|${SZ}:)`,Qz=String.raw`\[[^\]]+\]\([^)]*\)`,GO=new RegExp(String.raw`^${Zz}\s*(?:${Qz}|https?:\/\/\S+)(?:\s*\([^()]{1,30}\))?\s*$`,"u"),WO=new RegExp(String.raw`^(?:${Zz}\s*)?(?:\*\*)?${Qz}`,"u");function qO($){let Z=r8($.split(`
|
|
262
|
+
`)),Q=0;while(Q<Z.length&&/^(#\s|$)/.test(Z[Q].trim()))Q++;while(Q<Z.length){let z=Z[Q].trim();if(/^\[!\[/.test(z)){Q++;continue}if(/^!\[/.test(z)){Q++;continue}if(/^<\/?[a-z][\w-]*/i.test(z)&&(BO.test(z)||z.replace(/<[^>]*>/g,"").trim()==="")){Q++;continue}if(/^#\s/.test(z)){Q++;continue}if(GO.test(z)){Q++;continue}if(WO.test(z)&&/[|·•]|•/i.test(z)){Q++;continue}if(/^\[[^\]]+\]:\s*\S/.test(z)){Q++;continue}if(/^https?:\/\/\S*\)?\s*$/.test(z)){Q++;continue}if(z===""){Q++;continue}break}return Z.slice(Q).join(`
|
|
263
|
+
`)}var BO=/^<\/?(?:p|div|img|h[1-6]|picture|source|table|center|details|summary|video|svg|br|hr)\b/i;function KO($,Z){let Q=$.replace(/^>\s*/,"");return!/^>/.test((Z??"").trim())&&Q&&!n8(Q)?Q:null}function zz($){let Q=qO($).split(`
|
|
264
|
+
`),z=[];for(let[X,U]of Q.entries()){let J=U.trim();if(z.length===0&&/^>/.test(J))return KO(J,Q[X+1]);if(J===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(J))break;if(/^\[[^\]]+\]:\s*\S/.test(J))continue;if(/^https?:\/\/\S*\)?\s*$/.test(J))continue;if(/^\*\*[^*]+\*\*\s*$/.test(J)&&z.length===0)continue;z.push(J)}if(z.length===0)return null;return z.join(" ").trim()}function E2($,Z){return Xz($,Z)?.text??null}function Xz($,Z){let Q=$.split(`
|
|
265
|
+
`),z=0;while(z<Q.length){let U=Q[z].trim().match(/^(#{1,6})\s+(.+)$/);if(U&&Z.test(U[2])){let J=[];z++;while(z<Q.length){let H=Q[z].trim();if(H.match(/^(#{1,6})\s+/))break;if(H===""){if(J.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(H))break;J.push(H),z++}if(J.length===0)return null;return{text:J.join(" ").trim(),heading:U[2].trim()}}z++}return null}function DO($){let Z=E2($,r3);if(Z&&r(Z))return Z;let Q=zz($);if(Q&&r(Q))return Q;return}function LO($){let Z=E2($,s3);if(Z&&r(Z))return Z;return}function MO($){let Z=E2($,o3);if(Z&&r(Z))return Z;return}function IO($){let Z=E2($,a3);if(Z&&r(Z))return Z;return}function OO($){let Z=E2($,t3);if(Z&&r(Z))return Z;return}function _O($){let Z=E2($,e3);if(Z&&r(Z))return Z;return}function PO($){let Z=E2($,$z);if(Z&&r(Z))return Z;return}function EZ($){let Z=["README.md","README.MD","Readme.md","readme.md"],Q=null;for(let K of Z)if(M($,K)){Q=K;break}if(!Q)return{};let z=w($,Q);if(z===null)return{};z=z.replace(/<!--[\s\S]*?-->/g,"");let X={},U=DO(z);if(U)X.project={goal:U};let J={},H=LO(z);if(H)J.what=H;let V=MO(z);if(V)J.who=V;let Y=IO(z);if(Y)J.why=Y;let G=OO(z);if(G)J.where=G;let W=_O(z);if(W)J.when=W;let q=PO(z);if(q)J.how=q;if(Object.keys(J).length>0)X.human_context=J;return X}function Uz($){let Z=["README.md","README.MD","Readme.md","readme.md"].find((J)=>M($,J));if(!Z)return{};let Q=w($,Z);if(Q===null)return{};let z=Q.replace(/<!--[\s\S]*?-->/g,""),X={},U=(J,H)=>{let V=Xz(z,H);if(!V)return!1;let Y=r(V.text)?V.text:/:\s*$/.test(V.text)?w2(V.text):null;if(Y&&r(Y))return X[J]={value:Y,source:`${Z} § ${V.heading}`},!0;return!1};if(!U("project.goal",r3)){let J=zz(z);if(J&&r(J))X["project.goal"]={value:J,source:`${Z} § first paragraph`};else if(J&&J.length>I$.MAX_LENGTH){let H=w2(J);if(H&&r(H))X["project.goal"]={value:H,source:`${Z} § first sentence`}}}return U("human_context.what",s3),U("human_context.who",o3),U("human_context.why",a3),U("human_context.where",t3),U("human_context.when",e3),U("human_context.how",$z),X}function FO($,Z){let Q=$.split(`
|
|
266
|
+
`),z=!1;for(let X of Q){let U=X.trim();if(/^\[/.test(U)){z=U==="[package]";continue}if(!z)continue;let J=U.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(J){let H=J[1].trim();H=H.replace(/\s*#.*$/,"").trim();let V=H.match(/^"((?:[^"\\]|\\.)*)"$/)||H.match(/^'((?:[^'\\]|\\.)*)'$/);if(V)return V[1];return H}}return null}function D6($){let Z=w($,"Cargo.toml");if(Z===null)return{};let Q=FO(Z,"description");if(Q&&r(Q))return{project:{goal:Q}};return{}}import{join as Jz}from"path";var RO=[{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"}],NO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","tests","test"]);function TO($){let Z=[],Q=(z,X)=>{for(let U of v($,z)??[])if(U.isFile()&&/^(docker-)?compose.*\.ya?ml$/i.test(U.name))Z.push(Jz(z,U.name));else if(U.isDirectory()&&X>0&&!U.name.startsWith(".")&&!NO.has(U.name))Q(Jz(z,U.name),X-1)};return Q(".",1),Z}function L6($){return[...$].join(" · ")}function bZ($){let Z=TO($);if(Z.length===0)return{};let Q={database:new Set,cache:new Set,search:new Set,storage:new Set,runtime:new Set};for(let X of Z){let U=w($,X);if(U===null)continue;for(let J of U.matchAll(/^\s*image:\s*["']?([^\s"'#]+)/gm)){let H=J[1].toLowerCase(),V=H.replace(/:[^/]*$/,"").split("/").pop()??H,Y=H.replace(/:[^/]*$/,"");for(let{re:G,slot:W,label:q}of RO)if(G.test(V)||G.test(Y))Q[W].add(q)}}let z={};if(Q.database.size)z.database=L6(Q.database);if(Q.cache.size)z.cache=L6(Q.cache);if(Q.search.size)z.search=L6(Q.search);if(Q.storage.size)z.storage=L6(Q.storage);if(Q.runtime.size)z.runtime=`Docker Compose (${L6(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 AO}from"path";var CO=new Set(["node_modules",".git","dist","build","vendor","target","e2e","docs","scripts"]),jO=[{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 yZ($,Z){for(let Q of Z){let z=$.find((X)=>Q.test(X));if(z)return z}return null}function wO($){let Z=[$];for(let Q of v($)??[])if(Q.isDirectory()&&!Q.name.startsWith(".")&&!CO.has(Q.name))Z.push(AO($,Q.name));return Z}function SO($){let Z=0;if(M($,"manage.py")||M($,"pyproject.toml")||M($,"Gemfile"))Z+=3;if(/(?:^|\/)(backend|api|server|core|app)$/.test($))Z+=2;return Z}function xZ($){return z$($,()=>EO($))}function EO($){let Z=[];for(let z of wO($)){let X=z===$,U=X?"":`cd ${z.slice($.length+1)} && `;for(let J of jO){let H=w(z,J.file);if(H===null)continue;let V=J.targets(H);if(V.length===0)continue;let Y={},G=yZ(V,[/^test$/i,/^tests$/i,/test-all/i,/^test-unit/i,/^test/i]),W=yZ(V,[/^build$/i,/^compile$/i,/^build/i]),q=yZ(V,[/^check-all$/i,/^check$/i,/^lint$/i,/^lint/i,/^fmt$/i,/^format$/i]);if(G)Y.test=`${U}${J.runner} ${G}`;if(W)Y.build=`${U}${J.runner} ${W}`;if(q)Y.lint=`${U}${J.runner} ${q}`;if(Object.keys(Y).length===0)continue;Z.push({score:Object.keys(Y).length+(X?10:SO(z)),commands:Y})}}let Q=Z.sort((z,X)=>X.score-z.score)[0];return Q?{commands:Q.commands}:{}}var bO=[".env.example",".env.sample",".env.template",".env.dist","env.example",".env.local.example"];function gZ($){for(let Z of bO)if(M($,Z))return{security:{secrets:".env",example:Z}};return{}}function yO($,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 vZ($){return[EZ($),D6($),bZ($),xZ($),gZ($)].reduce(yO,{})}function Hz($){try{let Z=Z2($,{logLevel:"error"}).getIn(["project","type"],!0);return n(Z)&&typeof Z.comment==="string"&&Z.comment.includes(h2)}catch{return!1}}function kZ($){let Z=Q4($),Q=vZ($),z={};if(Q.stack)z.stack=Q.stack;if(Q.commands)z.commands=Q.commands;if(Q.security)z.security=Q.security;let X=O$(z,Yz(Z));return lO(X),O$(X,i8($))}function Yz($){let Z={...$};if(k(Z.project)&&"goal"in Z.project)Z.project={...Z.project,goal:""};if(k(Z.human_context))Z.human_context=Object.fromEntries(Object.keys(Z.human_context).map((Q)=>[Q,""]));return Z}function xO($,Z){let Q=pO(O8(Z,"updateExistingFaf: the existing .faf")),{data:z,facts:X}=wZ($),U=z,{project:J,human_context:H,...V}=vZ($),Y=O$(Q,V),G=O$(Y,Yz(U)),W=kO(O$(G,i8($)),Q),q=hO(gO(Z,Q,U)?uO(Vz(W,Q),Q,X):Vz(W,Q),Q);return e9(a9(Z,q))}function gO($,Z,Q){if(!m(Z0(Z,"project.type"))){let X=c0($)?.text;return X===void 0||!Hz(X)}return!(Q._meta?.found??[]).includes(h2)}function hZ($){return $.canonical?[$.path,$.canonical]:[$.path]}function Z0($,Z){let[Q,z]=Z.split("."),X=$[Q];return k(X)?X[z]:void 0}function V2($,Z,Q){let[z,X]=Z.split("."),U=$[z];if(!k(U))return;if(Q===void 0?!(X in U):U[X]===Q)return;let J={...U};if(Q===void 0)delete J[X];else J[X]=Q;$[z]=J}var Y2=($)=>typeof $==="string"&&$.trim()===R6;function vO($,Z){let Q=Z.map((z)=>Z0($,z));return Q.some(Y2)&&Q.every((z)=>m(z)||Y2(z))}function Vz($,Z){let Q={...$};for(let z of p){let X=hZ(z);if(!vO(Z,X))continue;for(let U of X){let J=Z0(Z,U);if(Z0(Q,U)!==J)V2(Q,U,J)}}return Q}function b2($,Z){let[Q,z]=Z.split("."),X=$[Q];return k(X)&&Object.prototype.hasOwnProperty.call(X,z)}function kO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!b2(Z,z.canonical)||b2(Z,z.path))continue;let X=Z0(Q,z.path);V2(Q,z.path,void 0);let U=Z0(Q,z.canonical);if(z4(X)&&m(U))V2(Q,z.canonical,X)}return Q}function hO($,Z){let Q={...$};for(let z of p){if(!z.canonical||!b2(Z,z.canonical)||b2(Z,z.path))continue;let X=Z0(Q,z.canonical);if(z4(X)||Y2(X))V2(Q,z.path,X)}return Q}function uO($,Z,Q={}){let z=$.project,X=k(z)?z.type:void 0,U={...$};for(let J of p){if(J.category==="human"||J.category==="project")continue;let H=u2(X,J);if(H===null)return $;if(H){let V=typeof X==="string"&&N6[X]?.has(J.path)===!0;mO(U,Z,J,J.path.startsWith("stack.")?Q[J.path.slice(6)]:void 0,V)}else fO(U,J)}return U}function mO($,Z,Q,z,X=!1){let U=hZ(Q),J=(V)=>!m(Z0($,V))&&!Y2(Z0($,V));for(let V of U){if(!Y2(Z0($,V)))continue;if(X)V2($,V,U.some(J)?void 0:"");else if(!Y2(Z0(Z,V)))V2($,V,b2(Z,V)?Z0(Z,V):"")}if(!z4(z))return;let H=U.filter((V)=>b2($,V));if(H.some((V)=>!m(Z0($,V))))return;for(let V of H.length>0?H:[Q.path])V2($,V,z)}function fO($,Z){let Q=hZ(Z).filter((X)=>b2($,X)),z=(X)=>!m(Z0($,X))&&!Y2(Z0($,X));if(Q.some(z))return;for(let X of Q.length>0?Q:[Z.path])if(m(Z0($,X)))V2($,X,R6)}function pO($){let Z=$.project;if(Z===null||Z===void 0||k(Z)||Array.isArray(Z))return $;return{...$,project:{name:String(Z)}}}function lO($){let Z=$.project?.type??"library",Q=k2[Z]||k2.library;for(let z of p){if(Q.includes(z.category)||N6[Z]?.has(z.path))continue;let[X,U]=z.path.split(".");if(X==="stack"&&$.stack)$.stack[U]="slotignored";if(X==="monorepo"&&$.monorepo)$.monorepo[U]="slotignored"}}function O$($,Z){return Gz($,Z,"")}function cO($){let Z=h0.get($);return Z!==void 0&&Z.category!=="human"}function z4($){if(typeof $==="number"||typeof $==="boolean")return!0;return typeof $==="string"&&$.trim()!==""&&!m($)&&!Y2($)}function dO($,Z){return cO($)&&z4(Z)}function Gz($,Z,Q){let z={...$};for(let[X,U]of Object.entries(Z)){let J=z[X],H=Q?`${Q}.${X}`:X;if(H==="_meta"&&J!==void 0)continue;if(R$(J)){if(dO(H,U))z[X]=U;continue}if(m(J))z[X]=U;else if(k(U)&&k(J))z[X]=Gz(J,U,H)}return z}function Wz($,Z){let Q=Z.split("."),z=$;for(let X of Q){if(z===null||z===void 0||typeof z!=="object")return;z=z[X]}return z}var uZ=["project.goal","human_context.who","human_context.what","human_context.why","human_context.where","human_context.when","human_context.how"];function Bz($){return uZ.includes($)}function iO($,Z){if(Z)return null;let Q=w($,"package.json");if(Q===null)return null;try{let z=JSON.parse(Q).description;return typeof z==="string"&&z.trim()?z.trim():null}catch{return null}}function Kz($,Z){let z=(Q4($)._meta?.found??[]).some((W)=>W.startsWith("polyglot:")),X={},U=new Set(Z?uZ.filter((W)=>nO(Wz(Z,W))):[]),J=[],H=aO($),V=(W,q,K)=>{if(X[W]||U.has(W)||!q)return;let D=Dz(q,H),B=qz(D),L=w2(D),I=L&&L!==D?qz(L):null;if(!r(D)||$_(q,H)||tO(W,D)||J.some((O)=>Z_(O,B)||O===I))return;if(J.push(B),I)J.push(I);X[W]={value:D,source:Q_(K)}};eO($,V);let Y=iO($,z);V("project.goal",Y,"package.json description"),V("human_context.what",Y,"package.json description"),V("project.goal",D6($).project?.goal,"Cargo.toml description");let G=s8($,{toolingRoot:z});for(let W of["who","what","why","where","when","how"]){let q=G[W];if(q)V(`human_context.${W}`,q.value,q.source)}return X}function nO($){return R$($)||typeof $==="string"&&$.trim()!==""&&!m($)}function Dz($,Z=new Set){let Q=[],z=$.replace(/`([^`]+)`/g,(X,U)=>`${Q.push(U)-1}`);return oO(z.replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/(?<![\w\]])\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/(?<![\w\]])\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/(?<![\w\]])\[([^\]]+)\](?![[(:])/g,(X,U)=>Z.has(U.toLowerCase())?U:X).replace(/<\/?(?:a|b|i|em|strong|code|kbd|span|sup|sub|mark|small|u|s)\b[^>]*>/gi,"").replace(/_\*\*(.+?)\*\*_/g,"$1").replace(/\*\*_(.+?)_\*\*/g,"$1").replace(/[\s\S]*/,rO).replace(/(^|[^\w])(__)(?=\S)(.+?)(?<=\S)\2(?!\w|\.\w)/g,"$1$3").replace(/(^|[^\w])(_)(?=[^\s_])(.+?)(?<=[^\s_])\2(?!\w|\.\w)/g,"$1$3")).replace(/\uE000(\d+)\uE000/g,(X,U)=>Q[Number(U)]).replace(/\s+/g," ").trim()}function rO($){for(let Z=0;Z<4;Z++){let Q=$.replace(/(?<![\w/.*\\])(\*\*?)(?=[\p{L}\p{N}\p{Extended_Pictographic}])([^*\n]*?[\p{L}\p{N}.!?):])\1(?!\*)/gu,"$2");if(Q===$)break;$=Q}return $}var sO={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",bull:"•",mdash:"—",ndash:"–",hellip:"…",copy:"©",reg:"®",trade:"™"};function oO($){return $.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(Z,Q)=>{if(Q[0]!=="#")return sO[Q.toLowerCase()]??Z;let z=Q[1].toLowerCase()==="x"?Number.parseInt(Q.slice(2),16):Number(Q.slice(1));if(!Number.isFinite(z)||z<=31||z>1114111||z>=55296&&z<=57343)return Z;return String.fromCodePoint(z)})}function aO($){let Z=["README.md","README.MD","Readme.md","readme.md"].find((z)=>M($,z)),Q=Z?w($,Z)??"":"";return new Set([...Q.matchAll(/^ {0,3}\[([^\]]+)\]:\s*\S/gm)].map((z)=>z[1].toLowerCase()))}function tO($,Z){if($==="project.goal"||$==="human_context.what")return b3(Z);if($==="human_context.why")return/^[\p{L}\p{N}._-]+ (is|are) (a|an|the)\b/iu.test(Z);return!1}function eO($,Z){for(let[Q,z]of Object.entries(Uz($)))if(Bz(Q))Z(Q,z.value,z.source)}function $_($,Z){return Dz($.replace(/`[^`]*`/g," "),Z).includes("**")}function qz($){return $.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function Z_($,Z){let[Q,z]=$.length<=Z.length?[$,Z]:[Z,$];if(z.includes(Q)&&Q.length>=0.6*z.length)return!0;let X=new Set($.split(" ")),U=new Set(Z.split(" "));return[...X].filter((H)=>U.has(H)).length/new Set([...X,...U]).size>=0.7}function Q_($){if($==="README:first-paragraph")return"README.md § first paragraph";if($==="README:first-sentence")return"README.md § first sentence";let Z=$.match(/^README:##\s*(.+)$/);if(Z)return`README.md § ${Z[1].trim()}`;return $.replace(/^package\.json:description$/,"package.json description")}function z_($,Z){let Q=Object.values(Kz($,Z)).filter((H)=>Boolean(H));if(Q.length===0)return null;let z=(H)=>{let V=H.split(/[\s:§]/)[0];return V==="README"?"README.md":V},X=[...new Set(Q.map((H)=>z(H.source)))].join(", "),[U,J]=Q.length===1?["suggestion","it"]:["suggestions","them"];return`${Q.length} ${U} for the goal and the six W's (${X}) — confirm ${J} in 'faf go'`}function X_($){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 Lz($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function U_($,Z={}){let Q=kZ($);if(Z.repoUrl&&Q.project&&!q0($)?.name&&Q.project.name===$.split("/").pop())Q.project.name=Lz(Z.repoUrl);return Q}import{existsSync as Mz,lstatSync as J_}from"fs";import{join as H_,basename as V_}from"path";import{createHash as Y_}from"crypto";var B0=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),R0=($)=>typeof $==="number"&&Number.isFinite($),F0=($)=>typeof $==="string",G_=/^v?\d+\.\d+\.\d+$/,W_=new Set(["birth","doubled","peak","current"]);function Pz($){return B0($)&&F0($.version)&&G_.test($.version)&&R0($.score)}var q_=($)=>R0($.birthDNA)?$.birthDNA:R0($.birthWeight)?$.birthWeight:null,B_=($)=>B0($)&&R0($.birthDNA)&&F0($.born),Iz=($)=>B0($)&&F0($.born)&&R0($.birthDNA)&&R0($.lastScore)&&F0($.endedAt),K_=($)=>Array.isArray($)&&$.length>0&&$.every(Pz),D_=($)=>B0($)&&R0($.score)&&F0($.version),L_=($)=>B0($)&&Array.isArray($.milestones)&&$.milestones.every(B0);function Oz($){return B0($)&&B_($.birthCertificate)&&K_($.versions)&&D_($.current)&&L_($.growth)}function M_($){try{return J_($),!0}catch{return!1}}var mZ=($)=>`${JSON.stringify($,null,2)}
|
|
267
|
+
`,I_=new Set(["version","score","lastSync"]),O_=new Set(["type","score","date","version","label","emoji"]),_z=($,Z)=>Object.keys($).every((Q)=>Z.has(Q)),fZ={birth:{label:"Birth",emoji:"\uD83D\uDC23"},doubled:{label:"Doubled",emoji:"2️⃣"},peak:{label:"Peak",emoji:"\uD83C\uDFD4️"},current:{label:"Current",emoji:"\uD83D\uDCCD"}},Fz=($)=>$.growth.milestones.filter((Z)=>Z.type==="peak"||Z.type==="current"),Rz=($)=>_z($.current,I_)&&Fz($).every((Z)=>_z(Z,O_)),__=($)=>Fz($).every((Z)=>Z.label===fZ[Z.type].label&&Z.emoji===fZ[Z.type].emoji);function P_($){return Rz($)&&__($)}var F_=".faf-dna is not in faf's shape: faf reads it and leaves it as it is.",R_=".faf-dna is not exactly as faf wrote it (hand formatting, key order, a repeated key or a number JSON cannot hold exactly): faf reads it and leaves it as it is.",N_=".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.",T_=".faf-dna has a label or emoji of yours on a milestone faf would replace (the peak or current one): faf reads it and leaves it as it is.",A_=".faf-dna has no birth certificate faf can read: faf leaves it as it is.";function C_($){if(!Array.isArray($))return[];return $.filter((Z)=>B0(Z)&&F0(Z.type)&&W_.has(Z.type)&&R0(Z.score))}var y2=($,Z="")=>F0($)?$:Z;function j_($,Z){if(!Array.isArray($))return[];return $.filter(Pz).map((Q)=>({version:Q.version,timestamp:y2(Q.timestamp),score:Q.score,changes:Array.isArray(Q.changes)?Q.changes.filter(F0):[],growth:R0(Q.growth)?Q.growth:Q.score-Z}))}function w_($,Z,Q,z){return{version:y2($.version,Z?.version??"v1.0.0"),score:R0($.score)?$.score:Z?.score??Q,lastSync:y2($.lastSync,z)}}function S_($){if(!B0($)||!B0($.birthCertificate))return null;let Z=$.birthCertificate,Q=q_(Z);if(Q===null)return null;let z=y2(Z.born),X=j_($.versions,Q),U=w_(B0($.current)?$.current:{},X[X.length-1],Q,z),J=B0($.growth)?$.growth:{};return{birthCertificate:{born:z,birthDNA:Q,birthDNASource:Z.birthDNASource==="legacy"||Z.birthWeightSource==="legacy"?"legacy":"init",projectDNA:y2(Z.projectDNA),certificate:y2(Z.certificate)},versions:X,current:U,growth:{totalGrowth:U.score-Q,daysActive:R0(J.daysActive)?J.daysActive:0,milestones:C_(Array.isArray(J.milestones)?J.milestones:$.milestones)},lastModified:y2($.lastModified,z),format:"faf-dna-v1",...Array.isArray($.priorLineage)&&$.priorLineage.some(Iz)?{priorLineage:$.priorLineage.filter(Iz)}:{}}}class Nz{projectPath;dnaPath;dna=null;own=!1;text;reason=null;constructor($){this.projectPath=$,this.dnaPath=H_($,".faf-dna")}exists(){return Mz(this.dnaPath)}birth($){if(h(this.projectPath,".faf-dna"),M_(this.dnaPath))throw new E("exists",this.dnaPath,`${this.dnaPath} is already there: a birth certificate is written once and never replaced — not written; original kept`);let Z=new Date().toISOString();return this.own=!0,this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.text=void 0,this.save(),this.dna}isFafShape(){return this.load()!==null&&this.own}readOnlyReason(){return this.load(),this.own?null:this.reason}recordGrowth($,Z){if(!this.dna&&!this.load())return null;if(!this.own)return null;let Q=this.dna;if($===Q.current.score)return Q;let z=new Date().toISOString(),X=Q.birthCertificate.birthDNA,U=$-X,J=this.incrementVersion(Q.versions[Q.versions.length-1].version);return Q.versions.push({version:J,timestamp:z,score:$,changes:Z,growth:U}),Q.current={version:J,score:$,lastSync:z},Q.growth.totalGrowth=U,Q.growth.daysActive=this.daysSince(Q.birthCertificate.born),this.updateMilestones($,J,z),this.save(),Q}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,Q=$.growth.milestones.find((U)=>U.type==="peak"),z=$.current.score,X=`${Z}%`;if(Q&&Q.score!==Z){if(X+=` → ${Q.score}%`,z<Q.score)X+=` ← ${z}%`}else if(z!==Z)X+=` → ${z}%`;return X}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:F0($.birthCertificate.born)?$.birthCertificate.born:""}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA",Q=F0($.timestamp)?$.timestamp.split("T")[0]:"",z=Array.isArray($.changes)?$.changes.filter(F0).join(", "):"";return`${$.version} — ${$.score}% ${Z} (${Q}) ${z}`})}load(){if(this.dna)return this.dna;if(!Mz(this.dnaPath))return null;let $=this.read();if($===null)return null;let{text:Z,raw:Q}=$;if(Oz(Q)&&mZ(Q)===Z&&P_(Q))this.own=!0,this.reason=null,this.dna=Q;else this.own=!1,this.dna=S_(Q),this.reason=!this.dna?A_:!Oz(Q)?F_:mZ(Q)!==Z?R_:Rz(Q)?T_:N_;return this.text=Z,this.dna}read(){let $;try{$=Q0(h(this.projectPath,".faf-dna"))}catch(Z){return this.reason=Z instanceof Error?Z.message:String(Z),null}try{return{text:$,raw:JSON.parse($)}}catch{return this.reason=".faf-dna is not JSON: faf leaves it as it is.",null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString();let $=mZ(this.dna),Z=this.text??null;e(this.dnaPath,$,{root:this.projectPath,expect:Z}),this.text=$}generateProjectDNA(){return Y_("sha256").update([this.projectPath,Date.now().toString(),Math.random().toString(36)].join(":")).digest("hex").substring(0,16)}generateCertificate(){let $=new Date().getFullYear(),Z=Math.random().toString(36).substring(2,6).toUpperCase(),Q=V_(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${Q}-${Z}`}incrementVersion($){let[Z,Q,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${Q}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,Q){if(!this.dna)return;let z=this.dna.growth.milestones,X=(V)=>z.some((Y)=>Y.type===V),U=(V)=>z.push({type:V,score:$,date:Q,version:Z,...fZ[V]});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!X("doubled"))U("doubled");let J=z.find((V)=>V.type==="peak");if(!J||$>J.score){if(J)z.splice(z.indexOf(J),1);U("peak")}let H=z.findIndex((V)=>V.type==="current");if(H>=0)z.splice(H,1);U("current")}}import{join as qP}from"path";import{existsSync as JP,statSync as uC}from"fs";import{join as xz}from"path";import{dirname as Sz,resolve as Ez}from"path";var Az=100;var E_="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",b_=[/^<(script|pre|style|textarea)(?=\s|>|$)/i,/^<!--/,/^<\?/,/^<![A-Za-z]/,/^<!\[CDATA\[/,new RegExp(`^</?(?:${E_})(?=\\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")],y_=[/<\/(?:script|pre|style|textarea)>/i,/-->/,/\?>/,/>/,/\]\]>/],x_=["","-->","?>",">","]]>"],g_=/[#`~*+_=<>0-9-]/,v_=/(\d{1,9})([.)])/y,k_=/#{1,6}(?:[ \t]+|$)/y,h_=/`{3,}(?!.*`)|~{3,}/y,u_=/(?:`{3,}|~{3,})(?=[ \t]*$)/y,m_=/(?:=+|-+)[ \t]*$/y,f_=/[^ \t\f\v\r\n]/;function M6($,Z,Q){return $.lastIndex=Q,$.exec(Z)}var p_=($)=>$==="quote"||$==="list"||$==="item";function l_($){let Z=new Uint8Array($.length),Q="*-_",z=[0,0,0],X=[!0,!0,!0];for(let U=$.length-1;U>=0;U--){let J=$[U],H=J===" "||J==="\t";for(let Y=0;Y<3;Y++)if(J==="*-_"[Y])z[Y]++;else if(!H)X[Y]=!1;let V="*-_".indexOf(J);Z[U]=V>=0&&X[V]&&z[V]>=3?1:0}return Z}var _$=($)=>$===" "||$==="\t";function c_($,Z){if($==="document"||$==="quote"||$==="item")return Z!=="item";return $==="list"&&Z==="item"}var Tz=($)=>$==="paragraph"||$==="code"||$==="html";function d_($){if($.kind==="list"||$.kind==="item")return{...$,list:{...$.list}};if($.kind==="code")return{...$,fence:$.fence&&{...$.fence}};return{...$}}class N0{containers;stack=[{kind:"document"}];ln="";offset=0;column=0;nextNonspace=0;nextNonspaceColumn=0;indent=0;indented=!1;blank=!1;allClosed=!0;matched=0;htmlStarted=!1;hiddenIn=null;scannedFrom=-1;breaks=null;deep=!1;limit=-1;overflow=-1;starts;constructor($=!0){this.containers=$;this.starts=[()=>this.startQuote(),()=>this.startHeading(),()=>this.startFence(),(Z)=>this.startHtml(Z),(Z)=>this.startSetext(Z),()=>this.startBreak(),(Z)=>this.startItem(Z),()=>this.startIndentedCode()]}clone(){let $=new N0(this.containers);return $.stack=this.stack.map(d_),$.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}>`:x_[$.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"&&Tz(Z.kind);while(!Q&&!this.deep){this.findNextNonspace();let z=this.nextNonspace;if(!this.indented&&!g_.test(this.ln.charAt(z)))break;let X=0;for(let U of this.starts)if(X=U(Z),X!==0)break;if(X===0)break;this.noteOverflow(z,X),Z=this.tip,Q=X===2}if(!Q)this.advanceNextNonspace();return Z}noteOverflow($,Z){if(Z===1&&this.limit>=0&&this.overflow<0&&this.stack.length-1>this.limit)this.overflow=$}addText($){if($.kind==="code")this.hiddenIn=$.fence?"code fence":"indented code";else if($.kind==="html")this.addHtmlLine($);else if(!Tz($.kind)&&this.offset<this.ln.length&&!this.blank)this.addChild({kind:"paragraph"})}addHtmlLine($){if($.type>5)return;let Z=y_[$.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),_$(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?M6(u_,this.ln,this.nextNonspace):null;if(Q&&Q[0].length>=$.len)return this.stack.length=Z,this.hiddenIn="code fence",2;for(let z=$.offset;z>0&&_$(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??=l_(this.ln),this.breaks[this.nextNonspace]===1}startQuote(){if(!this.containers||this.indented||this.ch!==">")return 0;if(this.advanceNextNonspace(),this.advanceOffset(1,!1),_$(this.ln[this.offset]))this.advanceOffset(1,!0);return this.closeUnmatched(),this.addChild({kind:"quote"}),1}startHeading(){if(this.indented||this.ch!=="#"||!M6(k_,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:M6(h_,this.ln,this.nextNonspace);if(!Z)return 0;return this.closeUnmatched(),this.addChild({kind:"code",fence:{char:Z[0][0],len:Z[0].length,offset:this.indent}}),this.advanceNextNonspace(),this.advanceOffset(Z[0].length,!1),2}startHtml($){if(this.indented||this.ch!=="<")return 0;let Z=!this.allClosed&&!this.blank&&this.tip.kind==="paragraph",Q=$.kind!=="paragraph"&&!Z,z=this.ln.slice(this.nextNonspace);for(let X=1;X<=(Q?7:6);X++){let U=b_[X-1].exec(z);if(U)return this.closeUnmatched(),this.addChild({kind:"html",type:X,tag:X===1?U[1].toLowerCase():""}),this.htmlStarted=!0,2}return 0}startSetext($){let Z=this.ch;if(this.indented||$.kind!=="paragraph"||Z!=="="&&Z!=="-"||!M6(m_,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||_$(z)))return null;if(Z&&!f_.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"?M6(v_,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&&_$(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,_$(this.ln[this.offset]))this.advanceOffset(1,!0);return $+1}addChild($){while(!c_(this.tip.kind,$.kind))this.stack.pop();if(this.tip.hasChild=!0,this.stack.push($),p_($.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 x0="<!-- faf:start -->",g0="<!-- faf:end -->",Cz="\uFEFF";function O6($){return $.match(/[^\r\n]*(?:\r\n|\r|\n|$)/g)?.filter((Z,Q,z)=>Z!==""||Q<z.length-1)??[]}var P$=($)=>$.replace(/\r?\n$|\r$/,""),bz=($)=>P$($).replace(/^\uFEFF/,"").trimEnd();function*pZ($){let Z=0;for(let Q of O6($)){let z=P$(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 i_($,Z,Q,z){let X=$.some((J)=>J.start!==-1)&&z(Z.content),U=Q(Z.content);for(let J of $)if(J.start!==-1&&X)J.found={start:J.start,end:Z.to};else if(U)J.start=Z.from}function lZ($,Z,Q){let[z,X]=[new N0(!0),new N0(!1)].map((U)=>({reader:U,start:-1,found:null}));for(let U of pZ($)){let J=[z,X].map((V)=>V.reader.line(U.content));if(z.reader.tooDeep)return null;let H=[z,X].filter((V,Y)=>J[Y]===null);if(H.length>0)i_(H,U,Z,Q);if(z.found||X.found)return z.found&&X.found&&z.found.start===X.found.start?z.found:null}return null}var jz=($)=>(Z)=>Z===$;function x2($,Z=x0,Q=g0){return lZ($,jz(Z),jz(Q))}function wz($,Z){let Q=[];for(let z of[!0,!1]){let X=new N0(z);for(let U of O6($))X.line(P$(U));if(X.clone().line(Z)!==null)Q.push(X.closer())}return Q}var n_=16;function r_($){let Z=new N0(!0);return $.map((Q)=>{let z=Z.overflowAt(P$(Q),n_),X=Q;if(z>=0){let U=/^\d{1,9}(?=[.)])/.exec(Q.slice(z)),J=U?z+U[0].length:z;X=`${Q.slice(0,J)}\\${Q.slice(J)}`}return Z.line(P$(X)),X})}function s_($,Z,Q){let X=r_(O6($).map((J)=>{let H=bz(J);return H===Z||H===Q?` ${J}`:J})).join(""),U=wz(X,Q);while(U.length>0&&U[0]!==null){let J=`${X}
|
|
268
|
+
${U[0]}`,H=wz(J,Q);if(H.length>=U.length)break;X=J,U=H}return X}function o_($,Z,Q){let z=$.slice(Z.length+1,$.length-Q.length-1),X=O6(z).map((U)=>P$(U)===""?`>${U}`:`> ${U}`).join("");return`${Z}
|
|
268
269
|
${X}
|
|
269
|
-
${Q}`}function
|
|
270
|
-
${
|
|
271
|
-
${Q}`}function
|
|
272
|
-
`,Q,z,X);let
|
|
270
|
+
${Q}`}function I6($,Z,Q,z=x0,X=g0,U="the file"){let J=(V)=>{let Y=`${$}${V}${Q}`,G=x2(Y,z,X);return G&&G.start===$.length&&G.end===$.length+V.length?Y:null},H=J(Z)??J(o_(Z,z,X));if(H===null)throw new E("unplaceable",U,`${U}: faf could not place its block where the next run finds it again — faf left it unchanged`,{onWrite:!0});return H}function cZ($,Z=x0,Q=g0){return`${Z}
|
|
271
|
+
${s_($.trim(),Z,Q)}
|
|
272
|
+
${Q}`}function X4($,Z,Q=x0,z=g0,X){if($===null)return I6("",Z,`
|
|
273
|
+
`,Q,z,X);let U=x2($,Q,z);if(U)return I6($.slice(0,U.start),Z,$.slice(U.end),Q,z,X);let J=$.startsWith(Cz)?Cz:"";return I6(J,Z,`
|
|
273
274
|
|
|
274
|
-
${$.slice(
|
|
275
|
-
${
|
|
276
|
-
`)}function
|
|
277
|
-
`)}function
|
|
278
|
-
`)}function
|
|
279
|
-
`)}function
|
|
280
|
-
`)}function
|
|
281
|
-
`)}function
|
|
275
|
+
${$.slice(J.length)}`,Q,z,X)}function _6($){try{return Q0($)}catch(Z){if(Z.code==="ENOENT")return null;throw Z}}function T0($,Z,Q=x0,z=g0,X={}){let U=cZ(Z,Q,z),J=Ez($),H=X.root??Sz(J),V=h(H,J),Y=_6(V);e(V,X4(Y,U,Q,z,J),{root:H,expect:Y})}var a_="<!-- faf:";function t_($){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 e_($,Z){let Q=[new N0(!0),new N0(!1)],z=!1;for(let{content:X}of pZ($)){if(z){if(X===Z)return"too deep";continue}let[U,J]=Q.map((V)=>V.line(X));z=Q[0].tooDeep;let H=U??J;if(X===Z&&(z||H!==null))return z?"too deep":H}return null}function $P($,Z,Q){let z=[new N0(!0),new N0(!1)];for(let{content:X}of pZ($)){let U=z.map((J)=>J.line(X));if(z[0].tooDeep)return!1;if((X===Z||X===Q)&&U.some((J)=>J===null))return!0}return!1}function U4($,Z,Q=x0,z=g0){if(Z===null||x2(Z,Q,z))return null;let X=bz(O6(Z)[0]??"");if(X.startsWith(a_)&&X!==Q&&X!==z)return`${$}: faf's block is now on top; the old faf text below it is left as you had it — delete it by hand if you no longer want it.`;let U=e_(Z,Q);if(U==="too deep")return`${$}: faf's block is now on top; the file nests more than ${Az} lists or quotes before an older faf block, so faf did not read that far — the older block is left as you had it; delete it by hand if you no longer want it.`;if(U!==null)return`${$}: faf's block is now on top; an older faf block below sits inside ${t_(U)} and is left as you had it — delete it by hand if you no longer want it.`;if($P(Z,Q,z))return`${$}: faf's block is now on top; an older faf marker line below it has no matching pair, so the text there is left as you had it — delete it by hand if you no longer want it.`;return null}function ZP($,Z,Q=x0,z=g0,X={}){try{let U=Ez($);return U4(Z,_6(h(X.root??Sz(U),U)),Q,z)}catch{return null}}var QP=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 rZ($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return QP.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function o($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function iZ($){if($===null||$===void 0)return null;if(typeof $==="string"){let Z=$.replace(/\s+/g," ").trim();if(Z===""||Z.toLowerCase()==="slotignored"||m(Z))return null;return Z}if(typeof $==="number"||typeof $==="boolean")return String($);if($ instanceof Date){let Z=$.toISOString();return Z.endsWith("T00:00:00.000Z")?Z.slice(0,10):Z}if(Array.isArray($)){let Z=$.map(iZ).filter((Q)=>Q!==null);return Z.length?Z.join(", "):null}if(typeof $==="object"){let Z=Object.entries($).map(([Q,z])=>{let X=iZ(z);return X===null?null:`${Q}: ${X}`}).filter((Q)=>Q!==null);return Z.length?Z.join("; "):null}return null}var dZ=new WeakMap;function zP($){let Z=c0($);if(!Z)return;if(!dZ.has(Z)){let Q;try{Q=Z2(Z.text,{schema:"failsafe"}).toJS()}catch{Q=void 0}dZ.set(Z,Q)}return dZ.get(Z)}function XP($,Z){if(typeof Z!=="string")return $;let Q;try{Q=I0(Z)}catch{return $}return typeof Q==="number"&&(Object.is(Q,$)||Number.isNaN(Q)&&Number.isNaN($))?Z:$}function nZ($,Z){if(typeof $==="number")return XP($,Z);if(Array.isArray($))return $.map((Q,z)=>nZ(Q,Array.isArray(Z)?Z[z]:void 0));if($!==null&&typeof $==="object"&&!($ instanceof Date)){let Q=Z!==null&&typeof Z==="object"&&!Array.isArray(Z)?Z:{};return Object.fromEntries(Object.entries($).map(([z,X])=>[z,nZ(X,Q[z])]))}return $}function UP($,Z){let Q=$,z=zP($);for(let X of Z)Q=Q!==null&&typeof Q==="object"?Q[X]:void 0,z=z!==null&&typeof z==="object"?z[X]:void 0;return iZ(nZ(Q,z))}function v0($){let Z=[];for(let Q of["who","what","why","where","when","how"]){let z=UP($,["human_context",Q]);if(z!==null)Z.push([J0(`human_context.${Q}`),z])}return Z}function J0($){let Z=h0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return rZ(Q)}var sZ=t.claude,HP="STATUS: SYNC ACTIVE";function VP($){let Z=xz($,sZ);if(!JP(Z))return null;return Q0(h($,sZ))}function YP($,Z){T0(xz($,sZ),Z)}function k0($,Z={}){let Q=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),X=String($.project?.type??"").trim(),U=String($.project?.goal??"").trim(),J=`<!-- faf: ${[Q,z,X,U].join(" | ")} -->`,H=[];if(Z.doc)H.push(`doc=${Z.doc}`);else H.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")H.push(`score=${Z.score}`);if(H.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)H.push(`siblings=${Z.siblings.join(",")}`);let V=`<!-- faf: ${H.join(" | ")} -->`;return`${J}
|
|
276
|
+
${V}`}function GP($,Z="project.faf"){let Q=[],z=$.project?.name??"Project",X=$.project?.main_language??"",U=$.project?.goal??"";if(Q.push(k0($,{claim:Z})),Q.push(""),Q.push(`# CLAUDE.md — ${z}`),Q.push(""),U)Q.push("## What This Is"),Q.push(""),Q.push(U),Q.push("");let J=$.stack??{},H=[];if(X)H.push(`**Language:** ${X}`);for(let[Y,G]of Object.entries(J))if(G&&G!=="slotignored"&&String(G).trim())H.push(`**${J0(`stack.${Y}`)}:** ${G}`);if(H.length>0){Q.push("## Stack"),Q.push("");for(let Y of H)Q.push(`- ${Y}`);Q.push("")}let V=v0($).map(([Y,G])=>`- **${Y}:** ${G}`);if(V.length>0)Q.push("## Context"),Q.push(""),Q.push(...V),Q.push("");return Q.push("---"),Q.push(""),Q.push(`*${HP} — ${new Date().toISOString()}*`),Q.push(""),Q.join(`
|
|
277
|
+
`)}function yz($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function WP($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=yz(Q[1].trim());if(!Z.project.name){let U=$.match(/\*\*Name:\*\*\s*(.+)/);if(U)Z.project.name=yz(U[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let U=$.match(/\*\*What Building:\*\*\s*(.+)/);if(U)Z.project.goal=U[1].trim()}let X=$.match(/\*\*Language:\*\*\s*(.+)/);if(X)Z.project.main_language=X[1].trim();if(!Z.project.main_language){let U=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(U)Z.project.main_language=U[1].trim()}return Z}function g2($){let Z=String($??"").trim(),Q=Z.indexOf(" — ");if(Q<=0)return{cmd:Z,note:null};let z=Z.slice(0,Q).trim(),X=Z.slice(Q+3).trim();if(!z||!X)return{cmd:Z,note:null};return{cmd:z,note:X}}function G2($){return g2($).cmd}var H0=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),gz=($)=>Array.isArray($)?$.join(", "):String($),BP=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),KP=new Set(["target_user","core_problem","mission_purpose"]);function vz($,Z="project.faf"){let Q=[],z=(C="")=>Q.push(C),X=$.ai_instructions,U=$.preferences,J=$.instant_context,H=$.security,V=$.commands,Y=$.key_files??J?.key_files,G=H0($.project?.default_branch)?String($.project?.default_branch):"main",W=V?Object.entries(V).filter(([,C])=>H0(C)):[],q=W.filter(([C])=>/test/i.test(C)),K=W.filter(([C])=>/lint|check/i.test(C)&&!/test/i.test(C)),D=W.filter(([C])=>!/test|lint|check/i.test(C)),B=(C)=>{let j=C.toLowerCase();if(/install|deps/.test(j))return 0;if(/^build$|build/.test(j)&&!/rebuild/.test(j))return 1;if(/^dev$|develop/.test(j))return 2;if(/^start$|run/.test(j))return 3;return 4},L=[...D].sort((C,j)=>B(C[0])-B(j[0])||C[0].localeCompare(j[0])),I=[...q,...K],O=L.find(([C])=>/build/i.test(C)),A=q[0]?G2(q[0][1]):void 0,R=O?G2(O[1]):void 0;z(k0($,{claim:Z})),z(),z(`# AGENTS.md — ${$.project?.name??"Project"}`),z();let N=[];if($.project?.main_language)N.push(String($.project.main_language));if(H0($.project?.type))N.push(`type: ${String($.project?.type)}`);if(H0($.project?.version))N.push(`v${String($.project?.version)}`);let T=$.project?.goal?String($.project.goal).trim():"";if(N.length)T+=(T?" — ":"")+N.join(" · ");if(T)z(T),z();if(z("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand-written content outside the managed block is preserved."),z(),L.length){z("## Setup & build"),z(),z("```bash");for(let[C,j]of L){let{cmd:s,note:K0}=g2(j);z(`${s} # ${K0??C}`)}z("```"),z()}if(I.length){z("## Run the tests"),z(),z("```bash");for(let[,C]of I){let{cmd:j,note:s}=g2(C);z(s?`${j} # ${s}`:j)}z("```"),z()}if(Y&&Y.length){z("## Where things live"),z();let C=Y.map((j)=>{let s=String(j),K0=s.indexOf(" — ");return K0>0?{path:s.slice(0,K0),role:s.slice(K0+3)}:{path:s,role:""}});if(C.some((j)=>j.role)){z("| Path | Role |"),z("|------|------|");for(let j of C)z(`| \`${j.path}\` | ${j.role} |`)}else for(let j of C)z(`- \`${j.path}\``);z()}let S=new Map,P=(C)=>{if(!C)return;for(let[j,s]of Object.entries(C)){if(BP.has(j)||!H0(s))continue;let K0=rZ(j);if(!S.has(K0))S.set(K0,gz(s))}};P(X?.working_style),P(U);let b=$.conventions??[];if(S.size||b.length){z("## Conventions"),z();for(let[C,j]of S)z(`- **${C}:** ${j}`);for(let C of b)if(H0(C))z(`- ${C}`);z()}let $0=(X?.warnings??[]).filter((C)=>H0(C)),a=["read the tree"];if(A)a.push(`run the tests (\`${A}\`)`);if(R)a.push("build the project");for(let[,C]of K.slice(0,1))a.push(`\`${G2(C)}\``);z("## Guardrails"),z();for(let C of $0)z(`- ${C}`);z(`- **Always OK:** ${[...new Set(a)].join(" · ")}.`),z("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),z(`- **Never:** force-push · push straight to \`${G}\` (branch and open a PR) · commit secrets.`),z();let g=[];for(let[,C]of K)g.push(`\`${G2(C)}\` exits 0`);for(let[,C]of q)g.push(`\`${G2(C)}\` passes`);if(g.push("changes committed with a conventional message"),z("## Definition of Done"),z(),z(`Done when: ${[...new Set(g)].join(" · ")}.`),z(),z("## When stuck"),z(),z(`Ask a clarifying question, propose a short plan, or open a draft PR with notes — do not push large speculative changes to \`${G}\`.`),z(),H&&(H0(H.secrets)||(H.never??[]).length)){if(z("## Security & secrets"),z(),H0(H.secrets)){let C=H0(H.example)?` (see \`${H.example}\`)`:"";z(`- Secrets live in \`${H.secrets}\`${C}. Never read or commit them.`)}for(let C of H.never??[])if(H0(C))z(`- Never read or commit \`${C}\`.`);z()}if(z("## Commit & PR"),z(),U&&H0(U.commit_style))z(`- Commit style: ${gz(U.commit_style)}`);else z("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(z(`- Branch off \`${G}\` and open a PR — never commit to \`${G}\` directly.`),z("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),z(),$.stack){let C=[];for(let[j,s]of Object.entries($.stack)){if(KP.has(j))continue;if(o(s))C.push(`- **${J0(`stack.${j}`)}:** ${s.trim()}`)}if(C.length){z("## Stack"),z();for(let j of C)z(j);z()}}z("## Project facts"),z(),z(`The six W's (who, what, why, where, when, how) and the project's other facts are in \`${Z}\`.`),z();let C0=$.generated;if(H0(C0))z(`*Context authored: ${String(C0)}*`);return Q.join(`
|
|
278
|
+
`)}function DP($,Z,Q="project.faf"){T0(qP($,t.agents),vz(Z,Q))}import{join as LP}from"path";var MP=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),IP=new Set(["target_user","core_problem","mission_purpose"]);function kz($,Z="project.faf"){let Q=[],z=$.instant_context,X=$.commands,U=$.key_files??z?.key_files,J=X?Object.entries(X).filter(([,D])=>MP(D)):[],H=J.filter(([D])=>/test/i.test(D)),V=J.filter(([D])=>/lint|check/i.test(D)&&!/test/i.test(D)),Y=J.filter(([D])=>!/test|lint|check/i.test(D)),G=(D)=>{let B=D.toLowerCase();if(/install|deps/.test(B))return 0;if(/^build$|build/.test(B)&&!/rebuild/.test(B))return 1;if(/^dev$|develop/.test(B))return 2;if(/^start$|run/.test(B))return 3;return 4},W=[...Y].sort((D,B)=>G(D[0])-G(B[0])||D[0].localeCompare(B[0])),q=[...H,...V];if(Q.push(k0($,{claim:Z})),Q.push(""),Q.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Q.push(""),Q.push(`> Authored from ${Z} — refresh with \`faf export --gemini\`.`),Q.push(""),$.project?.name)Q.push(`Project: ${$.project.name}`);if($.project?.goal)Q.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Q.push(`Language: ${$.project.main_language}`);if(W.length){Q.push(""),Q.push("## Setup & build"),Q.push(""),Q.push("```bash");for(let[D,B]of W){let{cmd:L,note:I}=g2(B);Q.push(`${L} # ${I??D}`)}Q.push("```")}if(q.length){Q.push(""),Q.push("## Test & verify"),Q.push(""),Q.push("```bash");for(let[,D]of q){let{cmd:B,note:L}=g2(D);Q.push(L?`${B} # ${L}`:B)}Q.push("```")}if(U&&U.length){Q.push(""),Q.push("## Where things live"),Q.push("");for(let D of U)Q.push(`- \`${D}\``)}if($.stack){let D=[];for(let[B,L]of Object.entries($.stack)){if(IP.has(B))continue;if(o(L))D.push(`- ${J0(`stack.${B}`)}: ${L.trim()}`)}if(D.length){Q.push(""),Q.push("## Stack");for(let B of D)Q.push(B)}}let K=v0($);if(K.length>0){Q.push(""),Q.push("## Context"),Q.push("");for(let[D,B]of K)Q.push(`- **${D}:** ${B}`)}return Q.push(""),Q.push("## Before changing things"),Q.push(""),Q.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Q.push("- Never: force-push · push straight to `main` · commit secrets."),Q.push(""),Q.join(`
|
|
279
|
+
`)}function OP($,Z,Q="project.faf"){T0(LP($,t.gemini),kz(Z,Q))}import{join as _P}from"path";function hz($,Z="project.faf"){let Q=[];if(Q.push(k0($,{claim:Z})),Q.push(""),Q.push("# .cursorrules"),Q.push(`# Authored from ${Z} — ${$.project?.name??"Project"}`),Q.push(""),$.project?.main_language)Q.push(`language: ${$.project.main_language}`);if($.stack){Q.push(""),Q.push("# Stack");for(let[X,U]of Object.entries($.stack))if(o(U))Q.push(`# ${J0(`stack.${X}`)}: ${U.trim()}`)}let z=v0($);if(z.length>0){Q.push(""),Q.push("# Context");for(let[X,U]of z)Q.push(`# ${X}: ${U}`)}return Q.push(""),Q.join(`
|
|
280
|
+
`)}function PP($,Z,Q="project.faf"){T0(_P($,t.cursorrules),hz(Z,Q),"# faf:start","# faf:end")}import{join as FP}from"path";var uz=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],RP=new Set([...uz.map(([$])=>$),"cicd"]);function mz($,Z="project.faf"){let Q=[],z=$.project?.name??"Project";if(Q.push(k0($,{claim:Z})),Q.push(""),Q.push(`# GitHub Copilot Instructions — ${z}`),Q.push(""),Q.push(`> Authored from ${Z} by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable.`),Q.push(""),o($.project?.goal))Q.push($.project.goal.trim()),Q.push("");let X=$.stack??{},U=[];if(o($.project?.main_language))U.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[V,Y]of Object.entries(X)){if(RP.has(V))continue;if(o(Y))U.push(`- **${J0(`stack.${V}`)}:** ${Y.trim()}`)}if(U.length>0)Q.push("## Tech stack","",...U,"");let J=[];for(let[V,Y]of uz){let G=X[V];if(o(G))J.push(`- ${Y} \`${G.trim()}\`.`)}if(o(X.cicd))J.push(`- CI runs on ${X.cicd.trim()}.`);if(J.length>0)Q.push("## Build & run","",...J,"");let H=v0($).map(([V,Y])=>`- **${V}:** ${Y}`);if(H.length>0)Q.push("## Project context","",...H,"");return Q.join(`
|
|
281
|
+
`)}function NP($,Z,Q="project.faf"){X$($,".github"),T0(FP($,".github",t.copilot),mz(Z,Q),x0,g0,{root:$})}import{existsSync as TP,lstatSync as dz,readFileSync as H4,realpathSync as oZ,statSync as AP}from"fs";import{homedir as CP}from"os";import{basename as jP,dirname as aZ,join as A0,resolve as v2}from"path";var fz=200,pz=200,lz=12,wP="# Project Context (from project.faf)",SP="*This section is managed by tri-sync.";function EP($){let Z=0;for(let Q=0;Q<$.length;Q++)Z=(Z<<5)-Z+$.charCodeAt(Q)|0;return Z}function iz($){let Z=$.replace(/[^a-zA-Z0-9]/g,"-");if(Z.length<=fz)return Z;return`${Z.slice(0,fz)}-${Math.abs(EP($)).toString(36)}`}function nz($){try{let Z=dz($);if(Z.isSymbolicLink()){let Q=AP($);return Q.isDirectory()||Q.isFile()}return Z.isDirectory()||Z.isFile()}catch{return!1}}function cz($){try{return dz($).isFile()}catch{return!1}}function bP($){let Z=$;for(;;){if(nz(A0(Z,".git")))return Z;let Q=aZ(Z);if(Q===Z)return null;Z=Q}}function yP($){let Z;try{Z=H4(A0($,".git"),"utf-8").trim()}catch{return $}try{if(!Z.startsWith("gitdir:"))return $;let Q=v2($,Z.slice(7).trim()),z=A0(Q,"commondir");if(!cz(z))return $;let X=v2(Q,H4(z,"utf-8").trim());if(v2(aZ(Q))!==A0(X,"worktrees"))return $;let U=A0(Q,"gitdir");if(!cz(U))return $;let J=H4(U,"utf-8").trim();if(oZ(v2(Q,J))!==A0(oZ($),".git"))return $;if(jP(X)!==".git")return nz(A0(X,".git"))?$:X;return aZ(X)}catch{return $}}function rz($){let Z=v2($);try{Z=oZ.native(Z)}catch{}let Q=bP(Z);return(Q?yP(Q):Z).normalize("NFC")}function Y4($,Z={}){if(Z.memoryDir)return v2(Z.memoryDir);let Q=Z.configDir||process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR||process.env.CLAUDE_CONFIG_DIR||A0(CP(),".claude");return A0(v2(Q),"projects",iz(rz($)),"memory").normalize("NFC")}function xP($,Z={}){return A0(Y4($,Z),t.memory)}var gP=new Set(["target_user","core_problem","mission_purpose"]);function sz($){let Z=$.project??{},Q=[["Goal",Z.goal],["Language",Z.main_language],["Type",Z.type]],z=Array.isArray($.key_files)?$.key_files:[];return["## Project context — from project.faf","",`- **Name:** ${o(Z.name)?Z.name:"Project"}`,...Q.filter(([,U])=>o(U)).map(([U,J])=>`- **${U}:** ${J}`),...J4("Stack",Object.entries($.stack??{}).filter(([U,J])=>!gP.has(U)&&o(J)).map(([U,J])=>`- **${J0(`stack.${U}`)}:** ${J}`)),...J4("Context",v0($).map(([U,J])=>`- **${U}:** ${J}`)),...J4("Commands",Object.entries($.commands??{}).filter(([,U])=>o(U)).slice(0,lz).map(([U,J])=>`- ${U}: \`${G2(J)}\``)),...J4("Key files",z.filter(o).slice(0,lz).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(`
|
|
282
|
+
`)}function J4($,Z){return Z.length>0?["",`### ${$}`,...Z]:[]}function oz($){return lZ($,(Z)=>Z.trimEnd()===wP,(Z)=>Z.startsWith(SP))}function V4($){if($==="")return 0;let Z=$.match(/\r\n|\r|\n/g)?.length??0;return/(\r\n|\r|\n)$/.test($)?Z:Z+1}function vP($,Z,Q){if($===null)return{text:X4(null,Z,void 0,void 0,Q),action:"created",head:"",tail:""};let z=x2($),X=z??oz($);if(X){let J=$.slice(0,X.start),H=$.slice(X.end);return{text:I6(J,Z,H,void 0,void 0,Q),action:z?"updated":"migrated",head:J,tail:H}}let U=$.startsWith("\uFEFF")?"\uFEFF":"";return{text:X4($,Z,void 0,void 0,Q),action:"added",head:U,tail:$.slice(U.length)}}function tZ($){return $>pz?[`MEMORY.md is ${$} lines. Claude Code loads the first ${pz}; lines after that are kept in the file but not loaded.`]:[]}function kP($,Z={}){let Q=Y4($,Z),z=A0(Q,t.memory),X={path:z,exists:!1,lines:0,hasBlock:!1,blockLines:0,hasLegacySection:!1,otherLines:0,warnings:[]};if(!TP(Q))return X;let U=_6(h(Q,t.memory));if(U===null)return X;let J=x2(U),H=J?`${U.slice(0,J.start)}${U.slice(J.end)}`:U,V=V4(U);return{path:z,exists:!0,lines:V,hasBlock:J!==null,blockLines:J?V4(U.slice(J.start,J.end)):0,hasLegacySection:!J&&oz(U)!==null,otherLines:H.split(/\r\n|\r|\n/).filter((Y)=>Y.replace(/^\uFEFF/,"").trim()!=="").length,warnings:tZ(V)}}function hP($,Z,Q={}){let z=Y4($,Q);X$(z);let X=h(z,t.memory),U=_6(X),J=vP(U,cZ(sz(Z)),X);if(J.text===U){let q=V4(U);return{path:X,action:"unchanged",written:!1,preserved:!0,lines:q,warnings:tZ(q)}}let H=e(X,J.text,{root:z,expect:U}),V=H4(H,"utf-8"),Y=V===J.text&&V.startsWith(J.head)&&V.endsWith(J.tail),G=V4(V),W=J.action==="added"?U4(t.memory,U):null;return{path:H,action:J.action,written:!0,preserved:Y,lines:G,warnings:[...W?[W]:[],...tZ(G)]}}function uP($,Z){let Q=[],z=(V)=>M($,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 U=[],J=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in J)U.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in J)U.push("Prettier");let H=z("pyproject.toml")?X("pyproject.toml"):"";if(/\[tool\.black\]/.test(H))U.push("black");if(/\[tool\.ruff\]/.test(H))U.push("ruff");if(/\[tool\.mypy\]/.test(H))U.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))U.push("rustfmt");if(U.length)Q.push(`Style enforced by ${U.join(" · ")} — obey the configs`);return Q}function mP($,Z){let Q={...Z},z=c0(Z);if(z)J$(Q,z);let X=null,U=w($,"package.json");if(U!==null)try{X=JSON.parse(U)}catch{X=null}let J=Z4($,X);if(Object.keys(J).length)Q.commands={...J,...Z.commands??{}};let H=Z.key_files??Z.instant_context?.key_files;if(!H||H.length===0){let V=$4($);if(V.length)Q.key_files=V}if(!Z.security){let Y=[".env",".env.local",".env.development"].find((G)=>M($,G));if(Y){let G=[".env.example",".env.sample",".env.template"].find((W)=>M($,W));Q.security={secrets:Y,...G?{example:G}:{}}}}if(!Z.conventions){let V=uP($,X);if(V.length)Q.conventions=V}return Q}export{yD as writeServerCard,XD as writeProjectHtml,OP as writeGeminiMd,IK as writeFaf,PP as writeCursorrules,NP as writeCopilotInstructions,hP as writeClaudeMemory,YP as writeClaudeMd,DP as writeAgentsMd,MX as validateFaf,A2 as utcNow,cD as upsertCatalog,WK as updateFafFile,xO as updateExistingFaf,i8 as turboCatSlots,S3 as turboCatScan,z_ as suggestionNote,Kz as suggestIntent,QX as slotsByCategory,JQ as serializeFaf,G3 as seedSixWsFromGoal,LX as scoreText,L4 as scoreFafYaml,e as safeWriteFile,jB as safeUnlink,T9 as safeReplaceOwned,NL as runLoop,h as resolveInside,xP as resolveClaudeMemoryPath,Y4 as resolveClaudeMemoryDir,Lz as repoNameFromUrl,$Z as renderProjectHtml,kz as renderGeminiMd,hz as renderCursorrules,mz as renderCopilotInstructions,sz as renderClaudeMemory,GP as renderClaudeMd,vz as renderAgentsMd,s8 as relentlessContextDetailed,FI as relentlessContext,v8 as registryTitle,GZ as registryName,R2 as registryMeta,Q0 as readUtf8,uD as readFafa,YQ as readFafRaw,GK as readFaf,VP as readClaudeMd,IZ as questionForSlot,wL as publicQuestions,hQ as projectServerJson,y8 as projectServerCard,fQ as projectPack,oD as projectCards,mQ as projectArd,uQ as projectAiCatalog,E8 as projectA2ACard,xD as patchServerJson,WP as parseClaudeMd,X_ as normalizeGitUrl,u8 as normalizeAnswer,JZ as mcpName,X$ as makeDirInside,B3 as loopVerdict,ZP as legacyStampNoteAt,U4 as legacyStampNote,D4 as kernel,m as isPlaceholder,FK as isNonProjectRoot,Bz as isIntentPath,W3 as isHumanSlot,UX as isExplicitNone,h8 as isEmptyValue,DL as interviewForMissing,T0 as injectFafBlock,SL as gradeAnswers,C$ as getTier,VX as getNextTier,gD as generateServerCard,UD as generateProjectHtml,fD as generateA2ACard,X3 as fromClaudeDir,mD as findFafaFile,GQ as findFafFile,x2 as findFafBlock,O$ as fillEmpties,yQ as fafaYaml,G$ as fafaDomain,k0 as fafMetaTag,b0 as fafContextBlock,U1 as enrichScore,mP as enrichFromRepo,jL as deriveQuestionSet,jK as computeDrift,rz as claudeProjectRoot,iz as claudeProjectId,kP as claudeMemoryStatus,q3 as classifyGaps,B$ as canonicalPriority,FL as buildTableOf8,H6 as buildServerCard,EL as buildReceipt,AD as buildPack,WZ as buildA2ACard,U_ as authorFafFromRepo,kZ as assembleFreshFaf,bQ as answersToFafa,M3 as answersMatch,u0 as TIERS,E as SafePathError,V3 as STACK_INTERVIEW,h0 as SLOT_BY_PATH,p as SLOTS,R6 as SLOTIGNORED,MZ as SIX_WS_INTERVIEW,CQ as SERVER_JSON_SCHEMA,S8 as SERVER_CARD_SCHEMA,ZZ as REGISTRY_PUBLISHER_KEY,U2 as PRIORITY_RANK,qZ as PRIORITY_ORDER,F6 as PLACEHOLDERS,k8 as KNOWLEDGE_TYPES,H3 as INTERVIEW_VERSION,KL as INTERVIEW_PATHS,Y3 as INTERVIEW_BY_PATH,D$ as INTERVIEW,uZ as INTENT_PATHS,W0 as FafmSoul,Nz as FafDNAManager,x0 as FAF_START,T$ as FAF_HEX,g0 as FAF_END,Z1 as EXPLICIT_NONE,XX as ENTERPRISE_SLOTS,_Z as BENCH_VERSION,zX as BASE_SLOTS,L3 as ALIAS_GROUPS,Y$ as A2A_CONTEXT_URI};
|
|
282
283
|
|
|
283
|
-
//# debugId=
|
|
284
|
+
//# debugId=066FEC46573B259A64756E2164756E21
|
|
284
285
|
//# sourceMappingURL=index.js.map
|