faf-cli 7.16.0 → 7.16.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/README.md +2 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/project.faf +3 -3
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ detected from your real stack, scored, and versioned with your code. No drift. N
|
|
|
25
25
|
|
|
26
26
|
<br>
|
|
27
27
|
|
|
28
|
-
**
|
|
28
|
+
**144.4k downloads** · see [faf.one/downloads](https://faf.one/downloads) for latest stats · **IANA-registered · Anthropic-merged (#2759)**
|
|
29
29
|
|
|
30
30
|
⭐ Bookmarks it for you, helps other devs find it too.
|
|
31
31
|
|
|
@@ -142,6 +142,7 @@ faf memory show
|
|
|
142
142
|
|
|
143
143
|
**Recent sprint**
|
|
144
144
|
|
|
145
|
+
- 🧭 [7.16.1](https://github.com/Wolfe-Jam/faf-cli/releases/tag/v7.16.1) `faf` back in step with `faf-cli`
|
|
145
146
|
- 🧭 [7.16.0](https://github.com/Wolfe-Jam/faf-cli/releases/tag/v7.16.0) The Discoverable Edition
|
|
146
147
|
- 🎴 [7.15.0](https://github.com/Wolfe-Jam/faf-cli/releases/tag/v7.15.0) The Pack Edition
|
|
147
148
|
- 🛂 [7.14.0](https://github.com/Wolfe-Jam/faf-cli/releases/tag/v7.14.0) The Passport Edition
|
package/dist/cli.js
CHANGED
|
@@ -162,7 +162,7 @@ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.pus
|
|
|
162
162
|
`)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
|
|
163
163
|
`,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 z="end"in Z.value?Z.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.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 Q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(Q)){Y5(Q,Z.start),Q.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let z=!this.onKeyLine&&this.indent===$.indent,Q=z&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",X=[];if(Q&&Z.sep&&!Z.value){let J=[];for(let Y=0;Y<Z.sep.length;++Y){let W=Z.sep[Y];switch(W.type){case"newline":J.push(Y);break;case"space":break;case"comment":if(W.indent>$.indent)J.length=0;break;default:J.length=0}}if(J.length>=2)X=Z.sep.splice(J[1])}switch(this.type){case"anchor":case"tag":if(Q||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(Q||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(Q6(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let J=L$(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q6(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(fJ(Z.key)&&!Q6(Z.sep,"newline")){let J=L$(Z.start),Y=Z.key,W=Z.sep;W.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:Y,sep:W}]})}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||Q)$.items.push({start:X,key:null,sep:[this.sourceToken]});else if(Q6(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 J=this.flowScalar(this.type);if(Q||Z.value)$.items.push({start:X,key:J,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(J);else Object.assign(Z,{key:J,sep:[]}),this.onKeyLine=!0;return}default:{let J=this.startBlockValue($);if(J){if(J.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!Q6(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(z)$.items.push({start:X});this.stack.push(J);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let z="end"in Z.value?Z.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.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 Q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(Q)){Y5(Q,Z.start),Q.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||Q6(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let z=this.startBlockValue($);if(z){this.stack.push(z);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let z;do yield*this.pop(),z=this.peek(1);while(z?.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 Q=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:Q,sep:[]});else if(Z.sep)this.stack.push(Q);else Object.assign(Z,{key:Q,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let z=this.startBlockValue($);if(z)this.stack.push(z);else yield*this.pop(),yield*this.step()}else{let z=this.peek(2);if(z.type==="block-map"&&(this.type==="map-value-ind"&&z.indent===$.indent||this.type==="newline"&&!z.items[z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&z.type!=="flow-collection"){let Q=J5(z),X=L$(Q);hJ($);let J=$.end.splice(1,$.end.length);J.push(this.sourceToken);let Y={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Y}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
|
|
164
164
|
`)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
|
|
165
|
-
`,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=J5($),z=L$(Z);return z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=J5($),z=L$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((z)=>z.type==="newline"||z.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()}}}uI.Parser=uJ});var dJ=P((sI)=>{var mJ=d7(),cI=w1(),g1=x1(),pI=Z7(),lI=o(),dI=Z3(),cJ=z3();function pJ($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new dI.LineCounter||null,prettyErrors:Z}}function iI($,Z={}){let{lineCounter:z,prettyErrors:Q}=pJ(Z),X=new cJ.Parser(z?.addNewLine),J=new mJ.Composer(Z),Y=Array.from(J.compose(X.parse($)));if(Q&&z)for(let W of Y)W.errors.forEach(g1.prettifyError($,z)),W.warnings.forEach(g1.prettifyError($,z));if(Y.length>0)return Y;return Object.assign([],{empty:!0},J.streamInfo())}function lJ($,Z={}){let{lineCounter:z,prettyErrors:Q}=pJ(Z),X=new cJ.Parser(z?.addNewLine),J=new mJ.Composer(Z),Y=null;for(let W of J.compose(X.parse($),!0,$.length))if(!Y)Y=W;else if(Y.options.logLevel!=="silent"){Y.errors.push(new g1.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Q&&z)Y.errors.forEach(g1.prettifyError($,z)),Y.warnings.forEach(g1.prettifyError($,z));return Y}function nI($,Z,z){let Q=void 0;if(typeof Z==="function")Q=Z;else if(z===void 0&&Z&&typeof Z==="object")z=Z;let X=lJ($,z);if(!X)return null;if(X.warnings.forEach((J)=>pI.warn(X.options.logLevel,J)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:Q},z))}function rI($,Z,z){let Q=null;if(typeof Z==="function"||Array.isArray(Z))Q=Z;else if(z===void 0&&Z)z=Z;if(typeof z==="string")z=z.length;if(typeof z==="number"){let X=Math.round(z);z=X<1?void 0:X>8?{indent:8}:{indent:X}}if($===void 0){let{keepUndefined:X}=z??Z??{};if(!X)return}if(lI.isDocument($)&&!Q)return $.toString(z);return new cI.Document($,Q,z).toString(z)}sI.parse=nI;sI.parseAllDocuments=iI;sI.parseDocument=lJ;sI.stringify=rI});var cY={};DQ(cY,{orange:()=>_0,italic:()=>pA,fafCyanDeep:()=>_5,fafCyan:()=>I,dim:()=>M,bold:()=>C,FAF_HEX:()=>a1});var R3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,C,M,pA,a1,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,_5=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,_0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var d=v(()=>{C=R3("1"),M=R3("2"),pA=R3("3"),a1={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var u9=P((Xc,Zj)=>{Zj.exports={name:"faf-cli",version:"7.16.0",description:"Persistent AI context + memory — .faf and .fafm, IANA-registered. Anthropic-merged.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",types:"./dist/index.d.ts",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./pack":{types:"./dist/interop/pack.d.ts",default:"./dist/pack.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",clean:"rm -rf dist",build:"bun run clean && bun build src/cli.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/index.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/interop/pack.ts --outdir dist --target=browser --minify --sourcemap=linked && tsc -p tsconfig.build.json",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test --timeout=120000","test:watch":"bun test --watch --timeout=120000",lint:"eslint 'src/**/*.ts'",format:"prettier --write 'src/**/*.ts'","check:no-hardcode":"! grep -rEln '/(Users|home/runner|private/var)/' dist/ || (echo '❌ Hardcoded build-machine path leaked into dist — see grep output above. Externalize the offending dep in the build script.'; exit 1)","check:engines":"node scripts/check-engines.mjs",prepublishOnly:"bun run check:engines && bun run build && bun run check:no-hardcode"},keywords:["faf","ai-context","project-dna","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational","agents-md","context-engineering","codex","windsurf","fafm","ai-memory","agents"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.3","faf-scoring-kernel":"^2.0.3",open:"^11.0.0",yaml:"^2.9.0"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@faf/specification":"github:Wolfe-Jam/faf","@types/bun":"^1.3.14","@types/node":"^22.20.1","@typescript-eslint/eslint-plugin":"^8.66.0","@typescript-eslint/parser":"^8.66.0",ajv:"^8.20.0",eslint:"^9.39.5",prettier:"^3.9.6",typescript:"^5.9.3","typescript-eslint":"^8.66.0"},overrides:{"brace-expansion":"^1.1.18","fast-uri":"^3.1.5",picomatch:"^4.0.5"},engines:{node:">=22.0.0"},publishConfig:{access:"public"}}});function S($,Z,z,Q,X){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="a"&&!X)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!X:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Q==="a"?X.call($,z):X?X.value=z:Z.set($,z),z}function O($,Z,z,Q){if(z==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!Q:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return z==="m"?Q:z==="a"?Q.call($):Q?Q.value:Z.get($)}var l2=()=>{};var d9=function(){let{crypto:$}=globalThis;if($?.randomUUID)return d9=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),z=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^z()&15>>+Q/4).toString(16))};function d2($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var R4=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let Z=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)Z.stack=$.stack;if($.cause&&!Z.cause)Z.cause=$.cause;if($.name)Z.name=$.name;return Z}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var k,N0,E0,L6,c$,p$,l$,d$,i$,n$,r$,s$,o$;var p0=v(()=>{k=class k extends Error{};N0=class N0 extends k{constructor($,Z,z,Q,X){super(`${N0.makeMessage($,Z,z)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=Z,this.type=X??null}static makeMessage($,Z,z){let Q=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):z;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,Z,z,Q){if(!$||!Q)return new L6({message:z,cause:R4(Z)});let X=Z,J=X?.error?.type;if($===400)return new p$($,X,z,Q,J);if($===401)return new l$($,X,z,Q,J);if($===403)return new d$($,X,z,Q,J);if($===404)return new i$($,X,z,Q,J);if($===409)return new n$($,X,z,Q,J);if($===422)return new r$($,X,z,Q,J);if($===429)return new s$($,X,z,Q,J);if($>=500)return new o$($,X,z,Q,J);return new N0($,X,z,Q,J)}};E0=class E0 extends N0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};L6=class L6 extends N0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};c$=class c$ extends L6{constructor({message:$}={}){super({message:$??"Request timed out."})}};p$=class p$ extends N0{};l$=class l$ extends N0{};d$=class d$ extends N0{};i$=class i$ extends N0{};n$=class n$ extends N0{};r$=class r$ extends N0{};s$=class s$ extends N0{};o$=class o$ extends N0{}});function GZ($){if(typeof $!=="object")return{};return $??{}}function r9($){if(!$)return!0;for(let Z in $)return!1;return!0}function LV($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var yj,MV=($)=>{return yj.test($)},i9=($)=>(i9=Array.isArray,i9($)),n9,NV=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new k(`${$} must be an integer`);if(Z<0)throw new k(`${$} must be a positive integer`);return Z},VZ=($)=>{try{return JSON.parse($)}catch(Z){return}};var a6=v(()=>{p0();yj=/^[a-z][a-z0-9+.-]*:/i,n9=i9});var OV=($)=>new Promise((Z)=>setTimeout(Z,$));var N6="0.91.1";function kj(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function vj(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:z}of $){let Q=z.exec(navigator.userAgent);if(Q){let X=Q[1]||0,J=Q[2]||0,Y=Q[3]||0;return{browser:Z,version:`${X}.${J}.${Y}`}}}return null}var AV=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},bj=()=>{let $=kj();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":IV(Deno.build.os),"X-Stainless-Arch":DV(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":IV(globalThis.process.platform??"unknown"),"X-Stainless-Arch":DV(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=vj();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},DV=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},IV=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},TV,CV=()=>{return TV??(TV=bj())};var s9=()=>{};function _V(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function o9(...$){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...$)}function qZ($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return o9({start(){},async pull(z){let{done:Q,value:X}=await Z.next();if(Q)z.close();else z.enqueue(X)},async cancel(){await Z.return?.()}})}function F4($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let z=await Z.read();if(z?.done)Z.releaseLock();return z}catch(z){throw Z.releaseLock(),z}},async return(){let z=Z.cancel();return Z.releaseLock(),await z,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function RV($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),z=Z.cancel();Z.releaseLock(),await z}var FV=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function PV($){return Object.entries($).filter(([Z,z])=>typeof z<"u").map(([Z,z])=>{if(typeof z==="string"||typeof z==="number"||typeof z==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(z)}`;if(z===null)return`${encodeURIComponent(Z)}=`;throw new k(`Cannot stringify type ${typeof z}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var SV=v(()=>{p0()});function wV($){let Z=0;for(let X of $)Z+=X.length;let z=new Uint8Array(Z),Q=0;for(let X of $)z.set(X,Q),Q+=X.length;return z}function P4($){let Z;return(EV??(Z=new globalThis.TextEncoder,EV=Z.encode.bind(Z)))($)}function a9($){let Z;return(jV??(Z=new globalThis.TextDecoder,jV=Z.decode.bind(Z)))($)}var EV,jV;class O6{constructor(){s0.set(this,void 0),o0.set(this,void 0),S(this,s0,new Uint8Array,"f"),S(this,o0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?P4($):$;S(this,s0,wV([O(this,s0,"f"),Z]),"f");let z=[],Q;while((Q=fj(O(this,s0,"f"),O(this,o0,"f")))!=null){if(Q.carriage&&O(this,o0,"f")==null){S(this,o0,Q.index,"f");continue}if(O(this,o0,"f")!=null&&(Q.index!==O(this,o0,"f")+1||Q.carriage)){z.push(a9(O(this,s0,"f").subarray(0,O(this,o0,"f")-1))),S(this,s0,O(this,s0,"f").subarray(O(this,o0,"f")),"f"),S(this,o0,null,"f");continue}let X=O(this,o0,"f")!==null?Q.preceding-1:Q.preceding,J=a9(O(this,s0,"f").subarray(0,X));z.push(J),S(this,s0,O(this,s0,"f").subarray(Q.index),"f"),S(this,o0,null,"f")}return z}flush(){if(!O(this,s0,"f").length)return[];return this.decode(`
|
|
165
|
+
`,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=J5($),z=L$(Z);return z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=J5($),z=L$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((z)=>z.type==="newline"||z.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()}}}uI.Parser=uJ});var dJ=P((sI)=>{var mJ=d7(),cI=w1(),g1=x1(),pI=Z7(),lI=o(),dI=Z3(),cJ=z3();function pJ($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new dI.LineCounter||null,prettyErrors:Z}}function iI($,Z={}){let{lineCounter:z,prettyErrors:Q}=pJ(Z),X=new cJ.Parser(z?.addNewLine),J=new mJ.Composer(Z),Y=Array.from(J.compose(X.parse($)));if(Q&&z)for(let W of Y)W.errors.forEach(g1.prettifyError($,z)),W.warnings.forEach(g1.prettifyError($,z));if(Y.length>0)return Y;return Object.assign([],{empty:!0},J.streamInfo())}function lJ($,Z={}){let{lineCounter:z,prettyErrors:Q}=pJ(Z),X=new cJ.Parser(z?.addNewLine),J=new mJ.Composer(Z),Y=null;for(let W of J.compose(X.parse($),!0,$.length))if(!Y)Y=W;else if(Y.options.logLevel!=="silent"){Y.errors.push(new g1.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Q&&z)Y.errors.forEach(g1.prettifyError($,z)),Y.warnings.forEach(g1.prettifyError($,z));return Y}function nI($,Z,z){let Q=void 0;if(typeof Z==="function")Q=Z;else if(z===void 0&&Z&&typeof Z==="object")z=Z;let X=lJ($,z);if(!X)return null;if(X.warnings.forEach((J)=>pI.warn(X.options.logLevel,J)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:Q},z))}function rI($,Z,z){let Q=null;if(typeof Z==="function"||Array.isArray(Z))Q=Z;else if(z===void 0&&Z)z=Z;if(typeof z==="string")z=z.length;if(typeof z==="number"){let X=Math.round(z);z=X<1?void 0:X>8?{indent:8}:{indent:X}}if($===void 0){let{keepUndefined:X}=z??Z??{};if(!X)return}if(lI.isDocument($)&&!Q)return $.toString(z);return new cI.Document($,Q,z).toString(z)}sI.parse=nI;sI.parseAllDocuments=iI;sI.parseDocument=lJ;sI.stringify=rI});var cY={};DQ(cY,{orange:()=>_0,italic:()=>pA,fafCyanDeep:()=>_5,fafCyan:()=>I,dim:()=>M,bold:()=>C,FAF_HEX:()=>a1});var R3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,C,M,pA,a1,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,_5=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,_0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var d=v(()=>{C=R3("1"),M=R3("2"),pA=R3("3"),a1={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var u9=P((Xc,Zj)=>{Zj.exports={name:"faf-cli",version:"7.16.1",description:"Persistent AI context + memory — .faf and .fafm, IANA-registered. Anthropic-merged.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",types:"./dist/index.d.ts",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./pack":{types:"./dist/interop/pack.d.ts",default:"./dist/pack.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",clean:"rm -rf dist",build:"bun run clean && bun build src/cli.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/index.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/interop/pack.ts --outdir dist --target=browser --minify --sourcemap=linked && tsc -p tsconfig.build.json",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test --timeout=120000","test:watch":"bun test --watch --timeout=120000",lint:"eslint 'src/**/*.ts'",format:"prettier --write 'src/**/*.ts'","check:no-hardcode":"! grep -rEln '/(Users|home/runner|private/var)/' dist/ || (echo '❌ Hardcoded build-machine path leaked into dist — see grep output above. Externalize the offending dep in the build script.'; exit 1)","check:engines":"node scripts/check-engines.mjs",prepublishOnly:"bun run check:engines && bun run build && bun run check:no-hardcode"},keywords:["faf","ai-context","project-dna","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational","agents-md","context-engineering","codex","windsurf","fafm","ai-memory","agents"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.3","faf-scoring-kernel":"^2.0.3",open:"^11.0.0",yaml:"^2.9.0"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@faf/specification":"github:Wolfe-Jam/faf","@types/bun":"^1.3.14","@types/node":"^22.20.1","@typescript-eslint/eslint-plugin":"^8.66.0","@typescript-eslint/parser":"^8.66.0",ajv:"^8.20.0",eslint:"^9.39.5",prettier:"^3.9.6",typescript:"^5.9.3","typescript-eslint":"^8.66.0"},overrides:{"brace-expansion":"^1.1.18","fast-uri":"^3.1.5",picomatch:"^4.0.5"},engines:{node:">=22.0.0"},publishConfig:{access:"public"}}});function S($,Z,z,Q,X){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="a"&&!X)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!X:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Q==="a"?X.call($,z):X?X.value=z:Z.set($,z),z}function O($,Z,z,Q){if(z==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!Q:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return z==="m"?Q:z==="a"?Q.call($):Q?Q.value:Z.get($)}var l2=()=>{};var d9=function(){let{crypto:$}=globalThis;if($?.randomUUID)return d9=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),z=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^z()&15>>+Q/4).toString(16))};function d2($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var R4=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let Z=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)Z.stack=$.stack;if($.cause&&!Z.cause)Z.cause=$.cause;if($.name)Z.name=$.name;return Z}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var k,N0,E0,L6,c$,p$,l$,d$,i$,n$,r$,s$,o$;var p0=v(()=>{k=class k extends Error{};N0=class N0 extends k{constructor($,Z,z,Q,X){super(`${N0.makeMessage($,Z,z)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=Z,this.type=X??null}static makeMessage($,Z,z){let Q=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):z;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,Z,z,Q){if(!$||!Q)return new L6({message:z,cause:R4(Z)});let X=Z,J=X?.error?.type;if($===400)return new p$($,X,z,Q,J);if($===401)return new l$($,X,z,Q,J);if($===403)return new d$($,X,z,Q,J);if($===404)return new i$($,X,z,Q,J);if($===409)return new n$($,X,z,Q,J);if($===422)return new r$($,X,z,Q,J);if($===429)return new s$($,X,z,Q,J);if($>=500)return new o$($,X,z,Q,J);return new N0($,X,z,Q,J)}};E0=class E0 extends N0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};L6=class L6 extends N0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};c$=class c$ extends L6{constructor({message:$}={}){super({message:$??"Request timed out."})}};p$=class p$ extends N0{};l$=class l$ extends N0{};d$=class d$ extends N0{};i$=class i$ extends N0{};n$=class n$ extends N0{};r$=class r$ extends N0{};s$=class s$ extends N0{};o$=class o$ extends N0{}});function GZ($){if(typeof $!=="object")return{};return $??{}}function r9($){if(!$)return!0;for(let Z in $)return!1;return!0}function LV($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var yj,MV=($)=>{return yj.test($)},i9=($)=>(i9=Array.isArray,i9($)),n9,NV=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new k(`${$} must be an integer`);if(Z<0)throw new k(`${$} must be a positive integer`);return Z},VZ=($)=>{try{return JSON.parse($)}catch(Z){return}};var a6=v(()=>{p0();yj=/^[a-z][a-z0-9+.-]*:/i,n9=i9});var OV=($)=>new Promise((Z)=>setTimeout(Z,$));var N6="0.91.1";function kj(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function vj(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:z}of $){let Q=z.exec(navigator.userAgent);if(Q){let X=Q[1]||0,J=Q[2]||0,Y=Q[3]||0;return{browser:Z,version:`${X}.${J}.${Y}`}}}return null}var AV=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},bj=()=>{let $=kj();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":IV(Deno.build.os),"X-Stainless-Arch":DV(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":IV(globalThis.process.platform??"unknown"),"X-Stainless-Arch":DV(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=vj();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},DV=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},IV=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},TV,CV=()=>{return TV??(TV=bj())};var s9=()=>{};function _V(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function o9(...$){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...$)}function qZ($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return o9({start(){},async pull(z){let{done:Q,value:X}=await Z.next();if(Q)z.close();else z.enqueue(X)},async cancel(){await Z.return?.()}})}function F4($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let z=await Z.read();if(z?.done)Z.releaseLock();return z}catch(z){throw Z.releaseLock(),z}},async return(){let z=Z.cancel();return Z.releaseLock(),await z,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function RV($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),z=Z.cancel();Z.releaseLock(),await z}var FV=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function PV($){return Object.entries($).filter(([Z,z])=>typeof z<"u").map(([Z,z])=>{if(typeof z==="string"||typeof z==="number"||typeof z==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(z)}`;if(z===null)return`${encodeURIComponent(Z)}=`;throw new k(`Cannot stringify type ${typeof z}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var SV=v(()=>{p0()});function wV($){let Z=0;for(let X of $)Z+=X.length;let z=new Uint8Array(Z),Q=0;for(let X of $)z.set(X,Q),Q+=X.length;return z}function P4($){let Z;return(EV??(Z=new globalThis.TextEncoder,EV=Z.encode.bind(Z)))($)}function a9($){let Z;return(jV??(Z=new globalThis.TextDecoder,jV=Z.decode.bind(Z)))($)}var EV,jV;class O6{constructor(){s0.set(this,void 0),o0.set(this,void 0),S(this,s0,new Uint8Array,"f"),S(this,o0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?P4($):$;S(this,s0,wV([O(this,s0,"f"),Z]),"f");let z=[],Q;while((Q=fj(O(this,s0,"f"),O(this,o0,"f")))!=null){if(Q.carriage&&O(this,o0,"f")==null){S(this,o0,Q.index,"f");continue}if(O(this,o0,"f")!=null&&(Q.index!==O(this,o0,"f")+1||Q.carriage)){z.push(a9(O(this,s0,"f").subarray(0,O(this,o0,"f")-1))),S(this,s0,O(this,s0,"f").subarray(O(this,o0,"f")),"f"),S(this,o0,null,"f");continue}let X=O(this,o0,"f")!==null?Q.preceding-1:Q.preceding,J=a9(O(this,s0,"f").subarray(0,X));z.push(J),S(this,s0,O(this,s0,"f").subarray(Q.index),"f"),S(this,o0,null,"f")}return z}flush(){if(!O(this,s0,"f").length)return[];return this.decode(`
|
|
166
166
|
`)}}function fj($,Z){for(let X=Z??0;X<$.length;X++){if($[X]===10)return{preceding:X,index:X+1,carriage:!1};if($[X]===13)return{preceding:X,index:X+1,carriage:!0}}return null}function xV($){for(let Q=0;Q<$.length-1;Q++){if($[Q]===10&&$[Q+1]===10)return Q+2;if($[Q]===13&&$[Q+1]===13)return Q+2;if($[Q]===13&&$[Q+1]===10&&Q+3<$.length&&$[Q+2]===13&&$[Q+3]===10)return Q+4}return-1}var s0,o0;var t9=v(()=>{l2();s0=new WeakMap,o0=new WeakMap;O6.NEWLINE_CHARS=new Set([`
|
|
167
167
|
`,"\r"]);O6.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function S4(){}function HZ($,Z,z){if(!Z||KZ[$]>KZ[z])return S4;else return Z[$].bind(Z)}function P0($){let Z=$.logger,z=$.logLevel??"off";if(!Z)return uj;let Q=yV.get(Z);if(Q&&Q[0]===z)return Q[1];let X={error:HZ("error",Z,z),warn:HZ("warn",Z,z),info:HZ("info",Z,z),debug:HZ("debug",Z,z)};return yV.set(Z,[z,X]),X}var KZ,e9=($,Z,z)=>{if(!$)return;if(LV(KZ,$))return $;P0(z).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(KZ))}`);return},uj,yV,i2=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([Z,z])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":z]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var BZ=v(()=>{a6();KZ={off:0,error:200,warn:300,info:400,debug:500};uj={error:S4,warn:S4,info:S4,debug:S4},yV=new WeakMap});async function*mj($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new k("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new k("Attempted to iterate over a response with no body")}let z=new kV,Q=new O6,X=F4($.body);for await(let J of cj(X))for(let Y of Q.decode(J)){let W=z.decode(Y);if(W)yield W}for(let J of Q.flush()){let Y=z.decode(J);if(Y)yield Y}}async function*cj($){let Z=new Uint8Array;for await(let z of $){if(z==null)continue;let Q=z instanceof ArrayBuffer?new Uint8Array(z):typeof z==="string"?P4(z):z,X=new Uint8Array(Z.length+Q.length);X.set(Z),X.set(Q,Z.length),Z=X;let J;while((J=xV(Z))!==-1)yield Z.slice(0,J),Z=Z.slice(J)}if(Z.length>0)yield Z}class kV{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let X={event:this.event,data:this.data.join(`
|
|
168
168
|
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],X}if(this.chunks.push($),$.startsWith(":"))return null;let[Z,z,Q]=pj($,":");if(Q.startsWith(" "))Q=Q.substring(1);if(Z==="event")this.event=Q;else if(Z==="data")this.data.push(Q);return null}}function pj($,Z){let z=$.indexOf(Z);if(z!==-1)return[$.substring(0,z),Z,$.substring(z+Z.length)];return[$,"",""]}var E4,a0;var $z=v(()=>{l2();p0();t9();a6();BZ();p0();a0=class a0{constructor($,Z,z){this.iterator=$,E4.set(this,void 0),this.controller=Z,S(this,E4,z,"f")}static fromSSEResponse($,Z,z){let Q=!1,X=z?P0(z):console;async function*J(){if(Q)throw new k("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let Y=!1;try{for await(let W of mj($,Z)){if(W.event==="completion")try{yield JSON.parse(W.data)}catch(U){throw X.error("Could not parse message into JSON:",W.data),X.error("From chunk:",W.raw),U}if(W.event==="message_start"||W.event==="message_delta"||W.event==="message_stop"||W.event==="content_block_start"||W.event==="content_block_delta"||W.event==="content_block_stop"||W.event==="message"||W.event==="user.message"||W.event==="user.interrupt"||W.event==="user.tool_confirmation"||W.event==="user.custom_tool_result"||W.event==="agent.message"||W.event==="agent.thinking"||W.event==="agent.tool_use"||W.event==="agent.tool_result"||W.event==="agent.mcp_tool_use"||W.event==="agent.mcp_tool_result"||W.event==="agent.custom_tool_use"||W.event==="agent.thread_context_compacted"||W.event==="session.status_running"||W.event==="session.status_idle"||W.event==="session.status_rescheduled"||W.event==="session.status_terminated"||W.event==="session.error"||W.event==="session.deleted"||W.event==="span.model_request_start"||W.event==="span.model_request_end")try{yield JSON.parse(W.data)}catch(U){throw X.error("Could not parse message into JSON:",W.data),X.error("From chunk:",W.raw),U}if(W.event==="ping")continue;if(W.event==="error"){let U=VZ(W.data)??W.data,G=U?.error?.type;throw new N0(void 0,U,void 0,$.headers,G)}}Y=!0}catch(W){if(d2(W))return;throw W}finally{if(!Y)Z.abort()}}return new a0(J,Z,z)}static fromReadableStream($,Z,z){let Q=!1;async function*X(){let Y=new O6,W=F4($);for await(let U of W)for(let G of Y.decode(U))yield G;for(let U of Y.flush())yield U}async function*J(){if(Q)throw new k("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let Y=!1;try{for await(let W of X()){if(Y)continue;if(W)yield JSON.parse(W)}Y=!0}catch(W){if(d2(W))return;throw W}finally{if(!Y)Z.abort()}}return new a0(J,Z,z)}[(E4=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],z=this.iterator(),Q=(X)=>{return{next:()=>{if(X.length===0){let J=z.next();$.push(J),Z.push(J)}return X.shift()}}};return[new a0(()=>Q($),this.controller,O(this,E4,"f")),new a0(()=>Q(Z),this.controller,O(this,E4,"f"))]}toReadableStream(){let $=this,Z;return o9({async start(){Z=$[Symbol.asyncIterator]()},async pull(z){try{let{value:Q,done:X}=await Z.next();if(X)return z.close();let J=P4(JSON.stringify(Q)+`
|
|
@@ -571,5 +571,5 @@ ${C("faf bench — agent-native protocol")} ${M(`qset ${J.qsetHash} · ${J.ques
|
|
|
571
571
|
`),console.log(M(" Options: --file · --output · --namepoint · --id · --type · --tag · --priority · --limit · --json · --force")),console.log(M(" INTEROP: claude-fafm-sdk 1.0 · application/vnd.fafm+yaml v1.1"))}var{version:mq}=u9(),g=new gQ;g.name("faf").description("Foundational AI context + memory — .faf and .fafm for any AI").version(mq,"-v, --version");g.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>t3($));g.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>fW());g.command("auto").description("Fill every tech slot from the repo, then score").action(()=>c5());g.command("loop").description("Drive to 100% — source what we can, then ask only the human").option("-r, --rounds <n>","max auto rounds before stopping","5").action(($)=>mW($));g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>BV($));g.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,Z)=>P5($,Z));g.command("bench [action] [answersFile]").description("AI-grounding benchmark — cold vs with-faf (the .faf is the answer key)").option("--json","Output as JSON").option("--cold","Grade as the without-context run").option("--faf","Grade as the with-context run").option("--tokens <n>","Tokens used in the run (reported by the agent)").option("--model <name>","Model that answered (reported)").option("--file <path>","Path to project.faf (default: discovered)").option("--submit","Submit the full-pair receipt to the public bench ledger").option("--endpoint <url>","Override the submit endpoint").action(($,Z,z)=>_q($,Z,z));g.command("show").description("Render project.faf → project.html and open it").option("--force","Replace a project.html faf cannot prove it rendered (edited since, or not faf's)").action(($)=>MG($));g.command("sync").description(".faf → CLAUDE.md (--direction pull: Trophy-gated backfill into .faf)").option("--watch","Watch for changes").option("--direction <dir>","auto|push write CLAUDE.md from .faf; pull backfills .faf at ✪ Trophy","auto").action(($)=>U9($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").option("--force","Replace an output file that is not a .fafb faf compiled").action(($,Z)=>NU($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").option("--force","With --output: replace a file faf cannot prove it wrote (edited since, or not a faf decompile)").action(($,Z)=>SU($,Z));g.command("git <url>").description("Instant scored context from any GitHub repo (any branch/tag with --ref)").option("--ref <ref>","Clone at a specific branch or tag (versioned context)").option("--output <path>","Write to a custom path (default: ./project.faf)").option("--force","Overwrite an existing project.faf").option("--stdout","Print the .faf to stdout instead of writing a file").action(($,Z)=>IG($,Z));g.command("diff [range]").description("Semantic context diff between two .faf versions (slot deltas + score). git ranges: <ref>, A..B, A...B").option("--json","Emit the delta as structured JSON").option("--install-driver","Wire faf diff into native git — `git diff` renders .faf score+slot deltas").option("--uninstall-driver","Remove the native-git diff driver").action(($,Z)=>xG($,Z));g.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>PG($??[]));g.command("log").description("Score timeline across git history — the .faf score at every commit that touched it").option("-n, --limit <n>","Max commits to show (default 20)").option("--all","Show every commit, no cap").option("--reverse","Oldest-first instead of newest-first").option("--json","Emit the timeline as structured JSON").action(($)=>yG($));g.command("hooks").description("Pre-commit context guard — scores staged .faf vs HEAD, warns (or --strict blocks) on regression").option("--install","Install the pre-commit hook").option("--uninstall","Remove the faf hook block (preserves other hooks)").option("--strict","With --install: block the commit on a score regression (default: warn only)").action(($)=>nG($));g.command("hooks-run",{hidden:!0}).description("Internal: the pre-commit context guard the git hook invokes").option("--strict","Exit non-zero on a score regression").action(($)=>iG($));g.command("export").description("Export context files from .faf").option("--agents","Author AGENTS.md").option("--cursor","Author .cursorrules").option("--gemini","Author GEMINI.md").option("--copilot","Author .github/copilot-instructions.md (GitHub Copilot)").option("--grok","Wire grok-faf-mcp into .grok/config.toml").option("--llms","Author llms.txt (llmstxt.org view of authored 6Ws — opt-in)").option("--conductor","Author conductor config").option("--html","Author project.html (visual render of project.faf)").option("--card","Author MCP Server Card (./server-card) with the FAF context-block").option("--all","Author all formats").option("--output <path>","Write exported files to this directory instead of the current one").option("--force","Replace a project.html or Server Card faf cannot prove it wrote (edited since, or not faf's)").action(($)=>o6($));g.command("server-card").description("Emit the registry server.json identity (name + title + _meta) from project.faf — the cross-language server-card emitter; patches an existing file").option("--in <path>","Existing server.json to patch (default: ./server.json)").option("--out <path>","Output path (default: same as --in)").option("--faf <path>","project.faf path (default: auto-discover)").option("--set-version <version>","Set the version field (default: preserve existing). NOTE: not --version, which is the global CLI-version flag").option("--generated <iso>","Override the _meta generated stamp (default: preserve existing)").option("--check","Print to stdout, do not write (diff/verify — the idempotency-test hook)").option("--force","With --out: replace a file faf cannot prove it wrote (edited since, or no faf identity)").action(($)=>qG($));g.command("cards").description("Project .faf + .fafa onto A2A / MCP / registry / catalog cards — one context block, every door").option("--target <list>","Comma list: a2a,mcp,registry,catalog,ard (default: whatever inputs allow)").option("--faf <path>","project.faf path (default: auto-discover)").option("--fafa <path>","agent.fafa path (default: auto-discover)").option("--dir <path>","Working directory (default: cwd)").option("--a2a-url <url>","Public URL of the A2A card (catalog row)").option("--door-url <url>","A2A door when .fafa has no a2a endpoint").option("--faf-pointer <url>","Absolute .faf pointer for served cards (default: ./project.faf)").option("--check","Print projected cards to stdout, do not write").option("--force","Replace a card file faf cannot prove it wrote (edited since, or not faf's)").action(($)=>BG($));g.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").option("--verbose","Show slot breakdown").action(($,Z)=>I9($,Z));g.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>rG($));g.command("formats").description("Show supported formats").action(()=>sG());g.command("clear").description("Clear cached data").action(()=>oG());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>aG($));g.command("context").description("Author context output").action(()=>tG());g.command("refresh").description("Re-ground on the live .faf — re-score, measure drift vs the DNA baseline, keep .fafb current").option("--json","Output as JSON").action(($)=>Rq($));g.command("drift").description("Check context drift").option("--json","Emit the drift report as structured JSON").action(($)=>zV($));g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>QV($,Z));g.command("recover").description("Recover .faf from context files").action(()=>XV());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>JV($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>YV($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>WV($));g.command("demo").description("Demo walkthrough").action(()=>UV());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>GV($,Z));g.command("taf [subcommand]").description("TAF Receipts — `faf taf setup` wires the CI receipt printer; bare snapshot deprecated → faf score --json").option("--output <path>","Write score snapshot to file").option("--write","taf setup: create .github/workflows/taf.yml").option("--force","With --output: replace a file faf cannot prove it wrote (edited since, or not a TAF snapshot)").action(($,Z)=>qV($,Z));g.command("ai [subcommand]").description("Ask Claude for suggestions about project.faf (analyze)").action(($)=>Bq($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>Lq($,Z));g.command("wjttc").description("Audit test suite for WJTTC tier coverage (vendor-neutral)").option("--path <path>","Test directory (default: tests)").option("--strict","Exit non-zero if any tests are untiered").option("--json","Output as JSON for CI consumption").action(($)=>Oq($));g.command("memory [subcommand] [arg]").description(".fafm soul ops — convert Claude memory, etch, recall, ls, show").option("-f, --file <path>","Soul file (default: ./soul.fafm)").option("-o, --output <path>","Output path (convert)").option("--namepoint <handle>","Namepoint for new/converted soul").option("--id <id>","Fact id (etch)").option("--type <type>","Fact type filter / etch type").option("--tag <tags>","Comma-separated tags (recall)").option("--priority <level>","Min priority floor (recall) or etch priority").option("--limit <n>","Max recall hits").option("--json","JSON output").option("--force","Overwrite an existing soul.fafm (convert)").action(($,Z,z)=>uq($,Z,z));g.command("bi-sync",{hidden:!0}).action(()=>U9());g.command("status",{hidden:!0}).action(()=>P5(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>o6({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>o6({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>o6({gemini:!0}));g.command("grok",{hidden:!0}).action(()=>o6({grok:!0}));g.command("llms",{hidden:!0}).action(()=>o6({llms:!0}));g.command("validate",{hidden:!0}).action(($)=>I9($));g.command("yolo",{hidden:!0}).action(()=>t3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:z}=await Promise.resolve().then(() => (d(),cY)),Q=process.cwd().replace(process.env.HOME??"","~"),X="\x1B[38;2;150;150;150m",J="\x1B[48;2;150;150;150m",Y="\x1B[38;2;29;29;29m",W="\x1B[48;2;29;29;29m",U="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${z($("faf"))} ${Z(`v${mq}`)}`);let G="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(` ${Q}`)}`),console.log("");try{await P5(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${z("faf --help")} ${Z("for commands")}`)})();else g.addHelpText("after",["","Git-native (The GIT Version):"," faf diff [range] semantic context diff + score delta (A..B, A...B)"," faf diff --install-driver make native `git diff` render .faf deltas"," faf log score timeline across history (Proof-Over-Time)"," faf hooks --install pre-commit guard against context regression"," faf git <url> [--ref] instant scored context from any repo, any branch/tag","",' "FAF is to Context what Git is to Versions."',""].join(`
|
|
572
572
|
`)),g.parseAsync(process.argv).catch(($)=>{if(!x$($))throw $;console.error(K6($,fx())),process.exit(1)});function fx(){let $=process.argv[2];return g.commands.find((z)=>z.name()===$||z.aliases().includes($))?.options.some((z)=>z.long==="--force")??!1}
|
|
573
573
|
|
|
574
|
-
//# debugId=
|
|
574
|
+
//# debugId=23B35E055284313364756E2164756E21
|
|
575
575
|
//# sourceMappingURL=cli.js.map
|