faf-cli 7.12.0 → 7.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -232,7 +232,7 @@ ${X}`;if(!iB($)){G$($,`${z}
232
232
  `,"utf-8");return}let J=cB($,"utf-8"),H=t5(J,Q,X);if(H){G$($,`${J.slice(0,H.start)}${z}${J.slice(H.end)}`,"utf-8");return}if(J.trimStart().startsWith(rB)&&!a5(J,Q)&&!a5(J,X)){G$($,`${z}
233
233
  `,"utf-8");return}G$($,`${z}
234
234
 
235
- ${J}`,"utf-8")}var aB=new Set(["API","CI","CD","MCP","CLI","SDK","UI","UX","AI","ML","DB","ORM","OS","HTTP","HTTPS","REST","RPC","JSON","YAML","XML","SQL","CSS","HTML","AWS","GCP","CDN","DNS","JWT","ID","IP","URL","URI","TS","JS"]);function Y6($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return aB.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function l($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function n($){let Z=A0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return Y6(Q)}var Z4="CLAUDE.md",tB="STATUS: BI-SYNC ACTIVE";function eB($){let Z=$4($,Z4);if(!oB(Z))return null;return sB(Z,"utf-8")}function $W($,Z){Q0($4($,Z4),Z)}function q0($,Z={}){let Q=String($.project?.name??"").trim(),X=String($.project?.main_language??"").trim(),z=String($.project?.type??"").trim(),J=String($.project?.goal??"").trim(),H=`<!-- faf: ${[Q,X,z,J].join(" | ")} -->`,U=[];if(Z.doc)U.push(`doc=${Z.doc}`);else U.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")U.push(`score=${Z.score}`);if(U.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)U.push(`siblings=${Z.siblings.join(",")}`);let q=`<!-- faf: ${U.join(" | ")} -->`;return`${H}
235
+ ${J}`,"utf-8")}var aB=new Set(["API","CI","CD","MCP","CLI","SDK","UI","UX","AI","ML","DB","ORM","OS","HTTP","HTTPS","REST","RPC","JSON","YAML","XML","SQL","CSS","HTML","AWS","GCP","CDN","DNS","JWT","ID","IP","URL","URI","TS","JS"]);function Y6($){return $.split("_").map((Z)=>{if(!Z)return Z;let Q=Z.toUpperCase();return aB.has(Q)?Q:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function l($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function n($){let Z=A0.get($);if(Z?.label)return Z.label;let Q=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return Y6(Q)}var Z4="CLAUDE.md",tB="STATUS: SYNC ACTIVE";function eB($){let Z=$4($,Z4);if(!oB(Z))return null;return sB(Z,"utf-8")}function $W($,Z){Q0($4($,Z4),Z)}function q0($,Z={}){let Q=String($.project?.name??"").trim(),X=String($.project?.main_language??"").trim(),z=String($.project?.type??"").trim(),J=String($.project?.goal??"").trim(),H=`<!-- faf: ${[Q,X,z,J].join(" | ")} -->`,U=[];if(Z.doc)U.push(`doc=${Z.doc}`);else U.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")U.push(`score=${Z.score}`);if(U.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)U.push(`siblings=${Z.siblings.join(",")}`);let q=`<!-- faf: ${U.join(" | ")} -->`;return`${H}
236
236
  ${q}`}function ZW($){let Z=[],Q=$.project?.name??"Project",X=$.project?.main_language??"",z=$.project?.goal??"";if(Z.push(q0($)),Z.push(""),Z.push(`# CLAUDE.md — ${Q}`),Z.push(""),z)Z.push("## What This Is"),Z.push(""),Z.push(z),Z.push("");let J=$.stack??{},H=[];if(X)H.push(`**Language:** ${X}`);for(let[Y,G]of Object.entries(J))if(G&&G!=="slotignored"&&String(G).trim())H.push(`**${n(`stack.${Y}`)}:** ${G}`);if(H.length>0){Z.push("## Stack"),Z.push("");for(let Y of H)Z.push(`- ${Y}`);Z.push("")}let U=$.human_context??{},q=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,Y])=>Y&&String(Y).trim()).map(([Y,G])=>`- **${n(`human_context.${Y}`)}:** ${G}`);if(q.length>0)Z.push("## Context"),Z.push(""),Z.push(...q),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${tB} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
237
237
  `)}function e5($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function QW($){let Z={project:{}},Q=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Q)Z.project.name=e5(Q[1].trim());if(!Z.project.name){let J=$.match(/\*\*Name:\*\*\s*(.+)/);if(J)Z.project.name=e5(J[1].trim())}let X=$.match(/## What This Is\s*\n\s*\n(.+)/);if(X)Z.project.goal=X[1].trim();if(!Z.project.goal){let J=$.match(/\*\*What Building:\*\*\s*(.+)/);if(J)Z.project.goal=J[1].trim()}let z=$.match(/\*\*Language:\*\*\s*(.+)/);if(z)Z.project.main_language=z[1].trim();if(!Z.project.main_language){let J=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim()}return Z}var d=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),Q4=($)=>Array.isArray($)?$.join(", "):String($),zW=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),JW=new Set(["target_user","core_problem","mission_purpose"]);function X4($){let Z=[],Q=(M="")=>Z.push(M),X=$.ai_instructions,z=$.preferences,J=$.instant_context,H=$.security,U=$.commands,q=$.key_files??J?.key_files,Y=d($.project?.default_branch)?String($.project?.default_branch):"main",G=U?Object.entries(U).filter(([,M])=>d(M)):[],V=G.filter(([M])=>/test/i.test(M)),B=G.filter(([M])=>/lint|check/i.test(M)&&!/test/i.test(M)),_=G.filter(([M])=>!/test|lint|check/i.test(M)),D=(M)=>{let b=M.toLowerCase();if(/install|deps/.test(b))return 0;if(/^build$|build/.test(b)&&!/rebuild/.test(b))return 1;if(/^dev$|develop/.test(b))return 2;if(/^start$|run/.test(b))return 3;return 4},W=[..._].sort((M,b)=>D(M[0])-D(b[0])||M[0].localeCompare(b[0])),O=[...V,...B],I=V[0]?.[1],N=W.find(([M])=>/build/i.test(M))?.[1];Q(q0($)),Q(),Q(`# AGENTS.md — ${$.project?.name??"Project"}`),Q();let F=[];if($.project?.main_language)F.push(String($.project.main_language));if(d($.project?.type))F.push(`type: ${String($.project?.type)}`);if(d($.project?.version))F.push(`v${String($.project?.version)}`);let A=$.project?.goal?String($.project.goal).trim():"";if(F.length)A+=(A?" — ":"")+F.join(" · ");if(A)Q(A),Q();if(Q("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand-written content outside the managed block is preserved."),Q(),W.length){Q("## Setup & build"),Q(),Q("```bash");for(let[M,b]of W)Q(`${b} # ${M}`);Q("```"),Q()}if(O.length){Q("## Run the tests"),Q(),Q("```bash");for(let[,M]of O)Q(M);Q("```"),Q()}if(q&&q.length){Q("## Where things live"),Q();let M=q.map((b)=>{let x=String(b),a=x.indexOf(" — ");return a>0?{path:x.slice(0,a),role:x.slice(a+3)}:{path:x,role:""}});if(M.some((b)=>b.role)){Q("| Path | Role |"),Q("|------|------|");for(let b of M)Q(`| \`${b.path}\` | ${b.role} |`)}else for(let b of M)Q(`- \`${b.path}\``);Q()}let w=new Map,T=(M)=>{if(!M)return;for(let[b,x]of Object.entries(M)){if(zW.has(b)||!d(x))continue;let a=Y6(b);if(!w.has(a))w.set(a,Q4(x))}};T(X?.working_style),T(z);let C=$.conventions??[];if(w.size||C.length){Q("## Conventions"),Q();for(let[M,b]of w)Q(`- **${M}:** ${b}`);for(let M of C)if(d(M))Q(`- ${M}`);Q()}let L=(X?.warnings??[]).filter((M)=>d(M)),S=["read the tree"];if(I)S.push(`run the tests (\`${I}\`)`);if(N)S.push("build the project");for(let[,M]of B.slice(0,1))S.push(`\`${M}\``);Q("## Guardrails"),Q();for(let M of L)Q(`- ${M}`);Q(`- **Always OK:** ${[...new Set(S)].join(" · ")}.`),Q("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),Q(`- **Never:** force-push · push straight to \`${Y}\` (branch and open a PR) · commit secrets.`),Q();let E=[];for(let[,M]of B)E.push(`\`${M}\` exits 0`);for(let[,M]of V)E.push(`\`${M}\` passes`);if(E.push("changes committed with a conventional message"),Q("## Definition of Done"),Q(),Q(`Done when: ${[...new Set(E)].join(" · ")}.`),Q(),Q("## When stuck"),Q(),Q(`Ask a clarifying question, propose a short plan, or open a draft PR with notes — do not push large speculative changes to \`${Y}\`.`),Q(),H&&(d(H.secrets)||(H.never??[]).length)){if(Q("## Security & secrets"),Q(),d(H.secrets)){let M=d(H.example)?` (see \`${H.example}\`)`:"";Q(`- Secrets live in \`${H.secrets}\`${M}. Never read or commit them.`)}for(let M of H.never??[])if(d(M))Q(`- Never read or commit \`${M}\`.`);Q()}if(Q("## Commit & PR"),Q(),z&&d(z.commit_style))Q(`- Commit style: ${Q4(z.commit_style)}`);else Q("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(Q(`- Branch off \`${Y}\` and open a PR — never commit to \`${Y}\` directly.`),Q("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),Q(),$.stack){let M=[];for(let[b,x]of Object.entries($.stack)){if(JW.has(b))continue;if(l(x))M.push(`- **${n(`stack.${b}`)}:** ${x.trim()}`)}if(M.length){Q("## Stack"),Q();for(let b of M)Q(b);Q()}}let m=$.generated;if(d(m))Q(`*Context authored: ${String(m)}*`);return Z.join(`
238
238
  `)}function HW($,Z){Q0(XW($,"AGENTS.md"),X4(Z))}import{join as UW}from"path";var qW=($)=>$!==null&&$!==void 0&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),YW=new Set(["target_user","core_problem","mission_purpose"]);function z4($){let Z=[],Q=$.instant_context,X=$.commands,z=$.key_files??Q?.key_files,J=X?Object.entries(X).filter(([,B])=>qW(B)):[],H=J.filter(([B])=>/test/i.test(B)),U=J.filter(([B])=>/lint|check/i.test(B)&&!/test/i.test(B)),q=J.filter(([B])=>!/test|lint|check/i.test(B)),Y=(B)=>{let _=B.toLowerCase();if(/install|deps/.test(_))return 0;if(/^build$|build/.test(_)&&!/rebuild/.test(_))return 1;if(/^dev$|develop/.test(_))return 2;if(/^start$|run/.test(_))return 3;return 4},G=[...q].sort((B,_)=>Y(B[0])-Y(_[0])||B[0].localeCompare(_[0])),V=[...H,...U];if(Z.push(q0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored from project.faf — refresh with `faf export --gemini`."),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if(G.length){Z.push(""),Z.push("## Setup & build"),Z.push(""),Z.push("```bash");for(let[B,_]of G)Z.push(`${_} # ${B}`);Z.push("```")}if(V.length){Z.push(""),Z.push("## Test & verify"),Z.push(""),Z.push("```bash");for(let[,B]of V)Z.push(B);Z.push("```")}if(z&&z.length){Z.push(""),Z.push("## Where things live"),Z.push("");for(let B of z)Z.push(`- \`${B}\``)}if($.stack){let B=[];for(let[_,D]of Object.entries($.stack)){if(YW.has(_))continue;if(l(D))B.push(`- ${n(`stack.${_}`)}: ${D.trim()}`)}if(B.length){Z.push(""),Z.push("## Stack");for(let _ of B)Z.push(_)}}return Z.push(""),Z.push("## Before changing things"),Z.push(""),Z.push("- Ask first: dependency installs, deletions, migrations, schema changes, publish/release."),Z.push("- Never: force-push · push straight to `main` · commit secrets."),Z.push(""),Z.join(`
@@ -240,5 +240,5 @@ ${q}`}function ZW($){let Z=[],Q=$.project?.name??"Project",X=$.project?.main_lan
240
240
  `)}function BW($,Z){Q0(VW($,".cursorrules"),J4(Z),"# faf:start","# faf:end")}import{join as H4}from"path";import{mkdirSync as WW}from"fs";var U4=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],_W=new Set([...U4.map(([$])=>$),"cicd"]);function q4($){let Z=[],Q=$.project?.name??"Project";if(Z.push(q0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${Q}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),l($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let X=$.stack??{},z=[];if(l($.project?.main_language))z.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[Y,G]of Object.entries(X)){if(_W.has(Y))continue;if(l(G))z.push(`- **${n(`stack.${Y}`)}:** ${G.trim()}`)}if(z.length>0)Z.push("## Tech stack","",...z,"");let J=[];for(let[Y,G]of U4){let V=X[Y];if(l(V))J.push(`- ${G} \`${V.trim()}\`.`)}if(l(X.cicd))J.push(`- CI runs on ${X.cicd.trim()}.`);if(J.length>0)Z.push("## Build & run","",...J,"");let H=$.human_context??{},q=[["who",H.who],["what",H.what],["why",H.why],["where",H.where],["when",H.when],["how",H.how]].filter(([,Y])=>l(Y)).map(([Y,G])=>`- **${n(`human_context.${Y}`)}:** ${G.trim()}`);if(q.length>0)Z.push("## Project context","",...q,"");return Z.join(`
241
241
  `)}function OW($,Z){WW(H4($,".github"),{recursive:!0}),Q0(H4($,".github","copilot-instructions.md"),q4(Z))}import{existsSync as V$,readFileSync as Y4}from"fs";import{join as a2}from"path";function DW($,Z){let Q=[],X=(q)=>V$(a2($,q)),z=(q)=>{try{return Y4(a2($,q),"utf-8")}catch{return""}};if(X("tsconfig.json")&&/"strict"\s*:\s*true/.test(z("tsconfig.json")))Q.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")Q.push("ESM modules (`type: module`)");let J=[],H=Z?.devDependencies??{};if(X(".eslintrc")||X(".eslintrc.json")||X(".eslintrc.cjs")||X("eslint.config.js")||X("eslint.config.mjs")||"eslint"in H)J.push("ESLint");if(X(".prettierrc")||X(".prettierrc.json")||X("prettier.config.js")||"prettier"in H)J.push("Prettier");let U=X("pyproject.toml")?z("pyproject.toml"):"";if(/\[tool\.black\]/.test(U))J.push("black");if(/\[tool\.ruff\]/.test(U))J.push("ruff");if(/\[tool\.mypy\]/.test(U))J.push("mypy");if(X("rustfmt.toml")||X(".rustfmt.toml"))J.push("rustfmt");if(J.length)Q.push(`Style enforced by ${J.join(" · ")} — obey the configs`);return Q}function IW($,Z){let Q={...Z},X=null,z=a2($,"package.json");if(V$(z))try{X=JSON.parse(Y4(z,"utf-8"))}catch{X=null}let J=q$($,X);if(Object.keys(J).length)Q.commands={...J,...Z.commands??{}};let H=Z.key_files??Z.instant_context?.key_files;if(!H||H.length===0){let U=U$($);if(U.length)Q.key_files=U}if(!Z.security){let q=[".env",".env.local",".env.development"].find((Y)=>V$(a2($,Y)));if(q){let Y=[".env.example",".env.sample",".env.template"].find((G)=>V$(a2($,G)));Q.security={secrets:q,...Y?{example:Y}:{}}}}if(!Z.conventions){let U=DW($,X);if(U.length)Q.conventions=U}return Q}export{nq as writeServerCard,uq as writeProjectHtml,GW as writeGeminiMd,Pq as writeFaf,BW as writeCursorrules,OW as writeCopilotInstructions,$W as writeClaudeMd,HW as writeAgentsMd,T4 as validateFaf,$2 as utcNow,GY as upsertCatalog,lB as updateExistingFaf,Z$ as turboCatSlots,C5 as turboCatScan,O4 as slotsByCategory,bZ as serializeFaf,X5 as seedSixWsFromGoal,I$ as scoreFafYaml,xY as runLoop,b8 as renderProjectHtml,z4 as renderGeminiMd,J4 as renderCursorrules,q4 as renderCopilotInstructions,ZW as renderClaudeMd,X4 as renderAgentsMd,x5 as relentlessContextDetailed,Q$ as relentlessContext,j8 as registryName,E8 as registryMeta,ZY as readFafa,EZ as readFafRaw,Nq as readFaf,eB as readClaudeMd,u8 as questionForSlot,fY as publicQuestions,VY as projectCards,QW as parseClaudeMd,i1 as normalizeAnswer,H5 as loopVerdict,D$ as kernel,T0 as isPlaceholder,z5 as isHumanSlot,c1 as isEmptyValue,wY as interviewForMissing,Q0 as injectFafBlock,kY as gradeAnswers,Y2 as getTier,K4 as getNextTier,aq as generateServerCard,mq as generateProjectHtml,zY as generateA2ACard,aZ as fromClaudeDir,QY as findFafaFile,jZ as findFafFile,t5 as findFafBlock,U0 as fillEmpties,q0 as fafMetaTag,e0 as fafContextBlock,D6 as enrichScore,IW as enrichFromRepo,vY as deriveQuestionSet,Eq as computeDrift,J5 as classifyGaps,y2 as canonicalPriority,jY as buildTableOf8,g2 as buildServerCard,uY as buildReceipt,g8 as buildA2ACard,pB as assembleFreshFaf,G5 as answersMatch,Y0 as TIERS,Z5 as STACK_INTERVIEW,A0 as SLOT_BY_PATH,f as SLOTS,k8 as SIX_WS_INTERVIEW,kZ as REGISTRY_PUBLISHER_KEY,N0 as PRIORITY_RANK,y8 as PRIORITY_ORDER,o2 as PLACEHOLDERS,d1 as KNOWLEDGE_TYPES,$5 as INTERVIEW_VERSION,TY as INTERVIEW_PATHS,Q5 as INTERVIEW_BY_PATH,Q2 as INTERVIEW,g0 as FafmSoul,U6 as FAF_START,q2 as FAF_HEX,q6 as FAF_END,I4 as ENTERPRISE_SLOTS,p8 as BENCH_VERSION,D4 as BASE_SLOTS,Y5 as ALIAS_GROUPS,pZ as A2A_CONTEXT_URI};
242
242
 
243
- //# debugId=BF5C086D07C3FBEC64756E2164756E21
243
+ //# debugId=26D6DA5087179B3064756E2164756E21
244
244
  //# sourceMappingURL=index.js.map