faf-cli 6.14.0 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,10 @@ export interface SlotDef {
15
15
  canonical?: string;
16
16
  /** Human description */
17
17
  description: string;
18
+ /** Canonical short display label for emitted AI-context files (CLAUDE / AGENTS /
19
+ * copilot-instructions / GEMINI / .cursorrules). The single source of truth for
20
+ * how a slot is labelled — e.g. `cicd` → "CI/CD", `api_type` → "API". */
21
+ label?: string;
18
22
  /** Category this slot belongs to */
19
23
  category: SlotCategory;
20
24
  }
package/dist/index.js CHANGED
@@ -136,7 +136,7 @@ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.pus
136
136
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
137
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 U="end"in Z.value?Z.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,Z.start),X.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let U=!this.onKeyLine&&this.indent===$.indent,X=U&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",z=[];if(X&&Z.sep&&!Z.value){let Q=[];for(let J=0;J<Z.sep.length;++J){let q=Z.sep[J];switch(q.type){case"newline":Q.push(J);break;case"space":break;case"comment":if(q.indent>$.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)z=Z.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(X||Z.value)z.push(this.sourceToken),$.items.push({start:z}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(X||Z.value)z.push(this.sourceToken),$.items.push({start:z,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(Q0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=j0(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(a8(Z.key)&&!Q0(Z.sep,"newline")){let Q=j0(Z.start),J=Z.key,q=Z.sep;q.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:J,sep:q}]})}else if(z.length>0)Z.sep=Z.sep.concat(z,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||X)$.items.push({start:z,key:null,sep:[this.sourceToken]});else if(Q0(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 Q=this.flowScalar(this.type);if(X||Z.value)$.items.push({start:z,key:Q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(Q);else Object.assign(Z,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue($);if(Q){if(Q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!Q0(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(U)$.items.push({start:z});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let U="end"in Z.value?Z.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,Z.start),X.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||Q0(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let U=this.startBlockValue($);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:X,sep:[]});else if(Z.sep)this.stack.push(X);else Object.assign(Z,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let U=this.startBlockValue($);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===$.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let X=z9(U),z=j0(X);c8($);let Q=$.end.splice(1,$.end.length);Q.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:Q}]};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=z9($),U=j0(Z);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=z9($),U=j0(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((U)=>U.type==="newline"||U.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()}}}LQ.Parser=i8});var t8=R((TQ)=>{var s8=O2(),_Q=Q$(),B$=J$(),DQ=A9(),IQ=b(),RQ=A2(),r8=N2();function n8($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new RQ.LineCounter||null,prettyErrors:Z}}function MQ($,Z={}){let{lineCounter:U,prettyErrors:X}=n8(Z),z=new r8.Parser(U?.addNewLine),Q=new s8.Composer(Z),J=Array.from(Q.compose(z.parse($)));if(X&&U)for(let q of J)q.errors.forEach(B$.prettifyError($,U)),q.warnings.forEach(B$.prettifyError($,U));if(J.length>0)return J;return Object.assign([],{empty:!0},Q.streamInfo())}function o8($,Z={}){let{lineCounter:U,prettyErrors:X}=n8(Z),z=new r8.Parser(U?.addNewLine),Q=new s8.Composer(Z),J=null;for(let q of Q.compose(z.parse($),!0,$.length))if(!J)J=q;else if(J.options.logLevel!=="silent"){J.errors.push(new B$.YAMLParseError(q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&U)J.errors.forEach(B$.prettifyError($,U)),J.warnings.forEach(B$.prettifyError($,U));return J}function PQ($,Z,U){let X=void 0;if(typeof Z==="function")X=Z;else if(U===void 0&&Z&&typeof Z==="object")U=Z;let z=o8($,U);if(!z)return null;if(z.warnings.forEach((Q)=>DQ.warn(z.options.logLevel,Q)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:X},U))}function FQ($,Z,U){let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(U===void 0&&Z)U=Z;if(typeof U==="string")U=U.length;if(typeof U==="number"){let z=Math.round(U);U=z<1?void 0:z>8?{indent:8}:{indent:z}}if($===void 0){let{keepUndefined:z}=U??Z??{};if(!z)return}if(IQ.isDocument($)&&!X)return $.toString(U);return new _Q.Document($,X,U).toString(U)}TQ.parse=PQ;TQ.parseAllDocuments=MQ;TQ.parseDocument=o8;TQ.stringify=FQ});var y=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],u0=new Map(y.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),zH=new Map(y.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),QH=new Map(y.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function d2($,Z){let U=(z)=>{let Q=z.split("."),J=$;for(let q of Q)if(J&&typeof J==="object"&&q in J)J=J[q];else return;return J},X=U(Z.path);if(X!==void 0)return X;if(Z.canonical)return U(Z.canonical);return}function Q6($){return y.filter((Z)=>Z.category===$)}var J6=y.filter(($)=>$.index<=21),q6=y,_$=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function q0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return _$.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var I0={about:[],documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};var B9=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,D$=B9("1"),k0=B9("2"),qH=B9("3"),v0={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},I$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,V9=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,R0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var i=[{name:"TROPHY",indicator:`${R0("\uD83C\uDFC6")} ${R0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${R0(D$("★"))} ${R0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I$("◆")} ${I$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${V9("◇")} ${V9("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${D$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${k0("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${k0("○")} RED`,threshold:1},{name:"WHITE",indicator:`${k0("♡")}`,threshold:0}];function m0($){for(let Z of i)if($>=Z.threshold)return Z;return i[i.length-1]}function H6($){let Z=m0($),U=i.indexOf(Z);return U>0?i[U-1]:null}var O9={};X6(O9,{validate:()=>Y6,sdkVersion:()=>O6,scoreFafb:()=>L6,scoreEnterprise:()=>G6,score:()=>L9,fafbInfo:()=>W6,decompile:()=>V6,compile:()=>B6});var W9=null;function o(){if(W9)return W9;try{let $=h0("faf-scoring-kernel");return W9=$,$}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=z9($),U=j0(Z);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=z9($),U=j0(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((U)=>U.type==="newline"||U.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()}}}LQ.Parser=i8});var t8=R((TQ)=>{var s8=O2(),_Q=Q$(),B$=J$(),DQ=A9(),IQ=b(),RQ=A2(),r8=N2();function n8($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new RQ.LineCounter||null,prettyErrors:Z}}function MQ($,Z={}){let{lineCounter:U,prettyErrors:X}=n8(Z),z=new r8.Parser(U?.addNewLine),Q=new s8.Composer(Z),J=Array.from(Q.compose(z.parse($)));if(X&&U)for(let q of J)q.errors.forEach(B$.prettifyError($,U)),q.warnings.forEach(B$.prettifyError($,U));if(J.length>0)return J;return Object.assign([],{empty:!0},Q.streamInfo())}function o8($,Z={}){let{lineCounter:U,prettyErrors:X}=n8(Z),z=new r8.Parser(U?.addNewLine),Q=new s8.Composer(Z),J=null;for(let q of Q.compose(z.parse($),!0,$.length))if(!J)J=q;else if(J.options.logLevel!=="silent"){J.errors.push(new B$.YAMLParseError(q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&U)J.errors.forEach(B$.prettifyError($,U)),J.warnings.forEach(B$.prettifyError($,U));return J}function PQ($,Z,U){let X=void 0;if(typeof Z==="function")X=Z;else if(U===void 0&&Z&&typeof Z==="object")U=Z;let z=o8($,U);if(!z)return null;if(z.warnings.forEach((Q)=>DQ.warn(z.options.logLevel,Q)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:X},U))}function FQ($,Z,U){let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(U===void 0&&Z)U=Z;if(typeof U==="string")U=U.length;if(typeof U==="number"){let z=Math.round(U);U=z<1?void 0:z>8?{indent:8}:{indent:z}}if($===void 0){let{keepUndefined:z}=U??Z??{};if(!z)return}if(IQ.isDocument($)&&!X)return $.toString(U);return new _Q.Document($,X,U).toString(U)}TQ.parse=PQ;TQ.parseAllDocuments=MQ;TQ.parseDocument=o8;TQ.stringify=FQ});var y=[{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"}],u0=new Map(y.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),zH=new Map(y.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),QH=new Map(y.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function d2($,Z){let U=(z)=>{let Q=z.split("."),J=$;for(let q of Q)if(J&&typeof J==="object"&&q in J)J=J[q];else return;return J},X=U(Z.path);if(X!==void 0)return X;if(Z.canonical)return U(Z.canonical);return}function Q6($){return y.filter((Z)=>Z.category===$)}var J6=y.filter(($)=>$.index<=21),q6=y,_$=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function q0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return _$.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var I0={about:[],documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};var B9=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,D$=B9("1"),k0=B9("2"),qH=B9("3"),v0={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"},I$=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,V9=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,R0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var i=[{name:"TROPHY",indicator:`${R0("\uD83C\uDFC6")} ${R0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${R0(D$("★"))} ${R0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I$("◆")} ${I$("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${V9("◇")} ${V9("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${D$("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${k0("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${k0("○")} RED`,threshold:1},{name:"WHITE",indicator:`${k0("♡")}`,threshold:0}];function m0($){for(let Z of i)if($>=Z.threshold)return Z;return i[i.length-1]}function H6($){let Z=m0($),U=i.indexOf(Z);return U>0?i[U-1]:null}var O9={};X6(O9,{validate:()=>Y6,sdkVersion:()=>O6,scoreFafb:()=>L6,scoreEnterprise:()=>G6,score:()=>L9,fafbInfo:()=>W6,decompile:()=>V6,compile:()=>B6});var W9=null;function o(){if(W9)return W9;try{let $=h0("faf-scoring-kernel");return W9=$,$}catch{throw Error(`faf-scoring-kernel not installed.
140
140
 
141
141
  Run: npm install faf-scoring-kernel
142
142
  `)}}function L9($){return JSON.parse(o().score_faf($))}function G6($){return JSON.parse(o().score_faf_enterprise($))}function Y6($){return o().validate_faf($)}function B6($){return o().compile_fafb($)}function V6($){return JSON.parse(o().decompile_fafb($))}function W6($){return JSON.parse(o().fafb_info($))}function L6($){return JSON.parse(o().score_fafb($))}function O6(){return o().sdk_version()}function c2($){return{score:$.score,tier:m0($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function _9($){if(/^\s*app_type:\s*about\s*$/m.test($)){let U=$.match(/^\s+source_score:\s*(\d+)\s*$/m),X=U?parseInt(U[1],10):-1,z=X>=0&&X<=100?X:-1,Q=$.match(/^\s+represents:\s*(\S+)\s*$/m),J=Q?Q[1]:void 0;return{score:z,tier:z>=0?m0(z):i[i.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:J}}return c2(L9($))}function _6($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let U=$;if(!U.faf_version)Z.push("Missing required field: faf_version");if(!U.project?.name)Z.push("Missing required field: project.name");if(U.app_type==="about"){if(!U.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(U.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${U.about.represents})`);if(U.about?.source_score!==void 0){let X=U.about.source_score;if(typeof X!=="number"||X<0||X>100)Z.push(`about.source_score must be a number 0-100 (got: ${X})`)}}return{valid:Z.length===0,errors:Z}}import{readFileSync as X4,writeFileSync as fG,existsSync as Z4}from"fs";import{join as U4,dirname as BJ}from"path";var bQ=O2(),CQ=Q$(),jQ=e9(),w2=J$(),SQ=d0(),J0=b(),EQ=Z0(),gQ=g(),fQ=X0(),yQ=z0(),SG=U9(),xQ=K2(),hQ=A2(),uQ=N2(),Q9=t8(),e8=p0();var kQ=bQ.Composer,vQ=CQ.Document,mQ=jQ.Schema,pQ=w2.YAMLError,lQ=w2.YAMLParseError,dQ=w2.YAMLWarning,cQ=SQ.Alias,aQ=J0.isAlias,iQ=J0.isCollection,sQ=J0.isDocument,rQ=J0.isMap,nQ=J0.isNode,oQ=J0.isPair,tQ=J0.isScalar,eQ=J0.isSeq,$J=EQ.Pair,ZJ=gQ.Scalar,UJ=fQ.YAMLMap,XJ=yQ.YAMLSeq;var zJ=xQ.Lexer,QJ=hQ.LineCounter,JJ=uQ.Parser,V$=Q9.parse,qJ=Q9.parseAllDocuments,HJ=Q9.parseDocument,$4=Q9.stringify,GJ=e8.visit,YJ=e8.visitAsync;function VJ($){let Z=X4($,"utf-8");return V$(Z)}function z4($){return X4($,"utf-8")}function Q4($=process.cwd()){let Z=["project.faf",".faf"];for(let X of Z){let z=U4($,X);if(Z4(z))return z}let U=BJ($);if(U!==$)for(let X of Z){let z=U4(U,X);if(Z4(z))return z}return null}import{writeFileSync as WJ}from"fs";import{join as LJ}from"path";var J4=v0.orange,OJ=v0.cyan,_J=v0.cyanDeep,DJ="#FF9500",IJ="#FF3B30",RJ="#E6EDF3",MJ="#6E7681",q4={TROPHY:{glyph:"\uD83C\uDFC6",color:J4},GOLD:{glyph:"★",color:J4},SILVER:{glyph:"◆",color:OJ},BRONZE:{glyph:"◇",color:_J},GREEN:{glyph:"●",color:RJ},YELLOW:{glyph:"●",color:DJ},RED:{glyph:"○",color:IJ},WHITE:{glyph:"♡",color:MJ}};function S0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var H4=["who","what","why","where","when","how"];function J9($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,U])=>`<div class="row"><div class="k">${S0(Z)}</div><div class="v">${S0(U)}</div></div>`).join(`
@@ -222,5 +222,5 @@ Rendered on-demand from your current <strong>${S0(U)}</strong><br>
222
222
  `),X=0;while(X<U.length){let Q=U[X].trim().match(/^(#{1,6})\s+(.+)$/);if(Q&&Z.test(Q[2])){let J=Q[1].length,q=[];X++;while(X<U.length){let H=U[X].trim(),G=H.match(/^(#{1,6})\s+/);if(G&&G[1].length<=J)break;if(H===""){if(q.length>0)break;X++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(H))break;q.push(H),X++}if(q.length===0)return null;return q.join(" ").trim()}X++}return null}function pq($){let Z=D0($,/^(use\s+cases?|goal)\b/i);if(Z&&p(Z))return Z;let U=mq($);if(U&&p(U))return U;return}function lq($){let Z=D0($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&p(Z))return Z;return}function dq($){let Z=D0($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&p(Z))return Z;return}function cq($){let Z=D0($,/^(why|motivation|problem|rationale)\b/i);if(Z&&p(Z))return Z;return}function aq($){let Z=D0($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&p(Z))return Z;return}function iq($){let Z=D0($,/^(status|history|timeline|since|launched)\b/i);if(Z&&p(Z))return Z;return}function sq($){let Z=D0($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&p(Z))return Z;return}function k2($){let Z=["README.md","README.MD","Readme.md","readme.md"],U=null;for(let L of Z){let _=kq($,L);if(hq(_)){U=_;break}}if(!U)return{};let X;try{X=uq(U,"utf-8")}catch{return{}}let z={},Q=pq(X);if(Q)z.project={goal:Q};let J={},q=lq(X);if(q)J.what=q;let H=dq(X);if(H)J.who=H;let G=cq(X);if(G)J.why=G;let W=aq(X);if(W)J.where=W;let Y=iq(X);if(Y)J.when=Y;let V=sq(X);if(V)J.how=V;if(Object.keys(J).length>0)z.human_context=J;return z}import{existsSync as rq,readFileSync as nq}from"fs";import{join as oq}from"path";function tq($,Z){let U=$.split(`
223
223
  `),X=!1;for(let z of U){let Q=z.trim();if(/^\[/.test(Q)){X=Q==="[package]";continue}if(!X)continue;let J=Q.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(J){let q=J[1].trim();q=q.replace(/\s*#.*$/,"").trim();let H=q.match(/^"((?:[^"\\]|\\.)*)"$/)||q.match(/^'((?:[^'\\]|\\.)*)'$/);if(H)return H[1];return q}}return null}function v2($){let Z=oq($,"Cargo.toml");if(!rq(Z))return{};let U;try{U=nq(Z,"utf-8")}catch{return{}}let X=tq(U,"description");if(X&&p(X))return{project:{goal:X}};return{}}function eq($,Z){let U={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}}};if(U.project&&Object.keys(U.project).length===0)delete U.project;if(U.human_context&&Object.keys(U.human_context).length===0)delete U.human_context;return U}function e4($){return eq(k2($),v2($))}function $H($){let Z=o4($),U=e4($),X=Y9(Z,U);ZH(X);let z=Y9(X,x2($));return Y9(z,{human_context:h2($)})}function ZH($){let Z=$.project?.type??"library",U=I0[Z]||I0.library;for(let X of y){if(U.includes(X.category))continue;let[z,Q]=X.path.split(".");if(z==="stack"&&$.stack)$.stack[Q]="slotignored";if(z==="monorepo"&&$.monorepo)$.monorepo[Q]="slotignored"}}function Y9($,Z){let U={...$};for(let[X,z]of Object.entries(Z)){let Q=U[X];if(q0(Q))U[X]=z;else if(typeof z==="object"&&z!==null&&!Array.isArray(z)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))U[X]=Y9(Q,z)}return U}export{CJ as writeServerCard,PJ as writeProjectHtml,_6 as validateFaf,x2 as turboCatSlots,E4 as turboCatScan,Q6 as slotsByCategory,F4 as seedSixWsFromGoal,_9 as scoreFafYaml,hJ as runLoop,h4 as relentlessContextDetailed,h2 as relentlessContext,bJ as registryName,wJ as registryMeta,z4 as readFafRaw,VJ as readFaf,j2 as questionForSlot,pJ as publicQuestions,H9 as normalizeAnswer,A4 as loopVerdict,O9 as kernel,q0 as isPlaceholder,T4 as isHumanSlot,q9 as isEmptyValue,SJ as interviewForMissing,lJ as gradeAnswers,m0 as getTier,H6 as getNextTier,W4 as generateServerCard,G4 as generateProjectHtml,Q4 as findFafFile,b2 as fafContextBlock,c2 as enrichScore,mJ as deriveQuestionSet,K4 as classifyGaps,yJ as buildTableOf8,dJ as buildReceipt,$H as assembleFreshFaf,C4 as answersMatch,i as TIERS,M4 as STACK_INTERVIEW,u0 as SLOT_BY_PATH,y as SLOTS,C2 as SIX_WS_INTERVIEW,L4 as REGISTRY_PUBLISHER_KEY,_$ as PLACEHOLDERS,R4 as INTERVIEW_VERSION,jJ as INTERVIEW_PATHS,P4 as INTERVIEW_BY_PATH,g0 as INTERVIEW,v0 as FAF_HEX,q6 as ENTERPRISE_SLOTS,E2 as BENCH_VERSION,J6 as BASE_SLOTS,b4 as ALIAS_GROUPS};
224
224
 
225
- //# debugId=19374E9A7C62E83064756E2164756E21
225
+ //# debugId=3E447D06C123060264756E2164756E21
226
226
  //# sourceMappingURL=index.js.map