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/README.md +9 -2
- package/dist/cli.js +5 -5
- package/dist/cli.js.map +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -2
- package/project.faf +3 -3
package/README.md
CHANGED
|
@@ -132,7 +132,14 @@ faf memory etch "a durable fact" --id my-fact
|
|
|
132
132
|
faf memory show
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
### What's New in v7.12.
|
|
135
|
+
### What's New in v7.12.1 — The Open Renderers Edition
|
|
136
|
+
|
|
137
|
+
**`faf sync` is the one name: "bi-sync" is gone from its help, its output and the footer every rendered CLAUDE.md carries.**
|
|
138
|
+
|
|
139
|
+
- **One word for one command.** `faf sync` keeps working exactly as before: the newer of `project.faf` and CLAUDE.md wins, and CLAUDE.md → `.faf` runs only at ✪ Trophy. `faf bi-sync` still runs as a hidden alias.
|
|
140
|
+
- **Tools built on faf-cli follow automatically.** Anything that composes `renderClaudeMd` writes the new `STATUS: SYNC ACTIVE` footer on its next sync, with no release of its own.
|
|
141
|
+
|
|
142
|
+
#### v7.12.0 — the Edition release
|
|
136
143
|
|
|
137
144
|
**faf-cli opens its renderers, injector and `faf auto` update chain as public exports — consumers compose instead of port — and `faf export --agents` is idempotent again: one block, every run.**
|
|
138
145
|
|
|
@@ -189,7 +196,7 @@ Your own rules for the AI — *"use full words in identifiers," "use bun, not np
|
|
|
189
196
|
## Sync
|
|
190
197
|
|
|
191
198
|
```
|
|
192
|
-
|
|
199
|
+
sync: .faf ←── 8ms ──→ CLAUDE.md
|
|
193
200
|
tri-sync: .faf ←── 8ms ──→ CLAUDE.md ↔ MEMORY.md
|
|
194
201
|
```
|
|
195
202
|
|
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 X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){P8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let X=!this.onKeyLine&&this.indent===$.indent,z=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",J=[];if(z&&Z.sep&&!Z.value){let Q=[];for(let Y=0;Y<Z.sep.length;++Y){let W=Z.sep[Y];switch(W.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(W.indent>$.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)J=Z.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)J.push(this.sourceToken),$.items.push({start:J}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)J.push(this.sourceToken),$.items.push({start:J,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(I1(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=H$(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(I1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]});else if(sX(Z.key)&&!I1(Z.sep,"newline")){let Q=H$(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:Q,key:Y,sep:W}]})}else if(J.length>0)Z.sep=Z.sep.concat(J,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(I1(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(z||Z.value)$.items.push({start:J,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&&!I1(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(X)$.items.push({start:J});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 X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){P8(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||I1(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let X=this.startBlockValue($);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:z,sep:[]});else if(Z.sep)this.stack.push(z);else Object.assign(Z,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let X=this.startBlockValue($);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===$.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let z=C8(X),J=H$(z);rX($);let Q=$.end.splice(1,$.end.length);Q.push(this.sourceToken);let Y={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};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=C8($),X=H$(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=C8($),X=H$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((X)=>X.type==="newline"||X.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()}}}LO.Parser=aX});var Zz=E((PO)=>{var oX=a3(),IO=M2(),T2=O2(),TO=Y3(),AO=i(),RO=YZ(),tX=WZ();function eX($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new RO.LineCounter||null,prettyErrors:Z}}function _O($,Z={}){let{lineCounter:X,prettyErrors:z}=eX(Z),J=new tX.Parser(X?.addNewLine),Q=new oX.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let W of Y)W.errors.forEach(T2.prettifyError($,X)),W.warnings.forEach(T2.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function $z($,Z={}){let{lineCounter:X,prettyErrors:z}=eX(Z),J=new tX.Parser(X?.addNewLine),Q=new oX.Composer(Z),Y=null;for(let W of Q.compose(J.parse($),!0,$.length))if(!Y)Y=W;else if(Y.options.logLevel!=="silent"){Y.errors.push(new T2.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(T2.prettifyError($,X)),Y.warnings.forEach(T2.prettifyError($,X));return Y}function FO($,Z,X){let z=void 0;if(typeof Z==="function")z=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let J=$z($,X);if(!J)return null;if(J.warnings.forEach((Q)=>TO.warn(J.options.logLevel,Q)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:z},X))}function CO($,Z,X){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let J=Math.round(X);X=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=X??Z??{};if(!J)return}if(AO.isDocument($)&&!z)return $.toString(X);return new IO.Document($,z,X).toString(X)}PO.parse=FO;PO.parseAllDocuments=_O;PO.parseDocument=$z;PO.stringify=CO});var Uz={};w9(Uz,{orange:()=>H0,italic:()=>LN,fafCyanDeep:()=>w8,fafCyan:()=>I,dim:()=>M,bold:()=>A,FAF_HEX:()=>R2});var GZ=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,A,M,LN,R2,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,w8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,H0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var l=v(()=>{A=GZ("1"),M=GZ("2"),LN=GZ("3"),R2={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var $5=E((Rb,$R)=>{$R.exports={name:"faf-cli",version:"7.12.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"}},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 && 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)",prepublishOnly:"bun run build && bun run check:no-hardcode"},keywords:["faf","ai-context","project-dna","bi-sync","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:">=18.0.0"},publishConfig:{access:"public"}}});function w($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function N($,Z,X,z){if(X==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!z:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?z:X==="a"?z.call($):z?z.value:Z.get($)}var W1=()=>{};var X5=function(){let{crypto:$}=globalThis;if($?.randomUUID)return X5=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),X=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(z)=>(+z^X()&15>>+z/4).toString(16))};function U1($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var i2=($)=>{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,W0,O0,C1,w$,S$,j$,x$,b$,k$,y$,v$,g$;var _0=v(()=>{k=class k extends Error{};W0=class W0 extends k{constructor($,Z,X,z,J){super(`${W0.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z,this.type=J??null}static makeMessage($,Z,X){let z=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):X;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,Z,X,z){if(!$||!z)return new C1({message:X,cause:i2(Z)});let J=Z,Q=J?.error?.type;if($===400)return new S$($,J,X,z,Q);if($===401)return new j$($,J,X,z,Q);if($===403)return new x$($,J,X,z,Q);if($===404)return new b$($,J,X,z,Q);if($===409)return new k$($,J,X,z,Q);if($===422)return new y$($,J,X,z,Q);if($===429)return new v$($,J,X,z,Q);if($>=500)return new g$($,J,X,z,Q);return new W0($,J,X,z,Q)}};O0=class O0 extends W0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};C1=class C1 extends W0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};w$=class w$ extends C1{constructor({message:$}={}){super({message:$??"Request timed out."})}};S$=class S$ extends W0{};j$=class j$ extends W0{};x$=class x$ extends W0{};b$=class b$ extends W0{};k$=class k$ extends W0{};y$=class y$ extends W0{};v$=class v$ extends W0{};g$=class g$ extends W0{}});function H4($){if(typeof $!=="object")return{};return $??{}}function Q5($){if(!$)return!0;for(let Z in $)return!1;return!0}function oQ($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var vR,aQ=($)=>{return vR.test($)},z5=($)=>(z5=Array.isArray,z5($)),J5,tQ=($,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},B4=($)=>{try{return JSON.parse($)}catch(Z){return}};var r1=v(()=>{_0();vR=/^[a-z][a-z0-9+.-]*:/i,J5=z5});var eQ=($)=>new Promise((Z)=>setTimeout(Z,$));var P1="0.91.1";function gR(){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 hR(){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:X}of $){let z=X.exec(navigator.userAgent);if(z){let J=z[1]||0,Q=z[2]||0,Y=z[3]||0;return{browser:Z,version:`${J}.${Q}.${Y}`}}}return null}var zY=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},fR=()=>{let $=gR();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":P1,"X-Stainless-OS":ZY(Deno.build.os),"X-Stainless-Arch":$Y(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":P1,"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":P1,"X-Stainless-OS":ZY(globalThis.process.platform??"unknown"),"X-Stainless-Arch":$Y(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=hR();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":P1,"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":P1,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},$Y=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},ZY=($)=>{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"},XY,JY=()=>{return XY??(XY=fR())};var Y5=()=>{};function QY(){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 W5(...$){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 M4($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return W5({start(){},async pull(X){let{done:z,value:J}=await Z.next();if(z)X.close();else X.enqueue(J)},async cancel(){await Z.return?.()}})}function n2($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let X=await Z.read();if(X?.done)Z.releaseLock();return X}catch(X){throw Z.releaseLock(),X}},async return(){let X=Z.cancel();return Z.releaseLock(),await X,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function YY($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var WY=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function UY($){return Object.entries($).filter(([Z,X])=>typeof X<"u").map(([Z,X])=>{if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(X)}`;if(X===null)return`${encodeURIComponent(Z)}=`;throw new k(`Cannot stringify type ${typeof X}; 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 qY=v(()=>{_0()});function KY($){let Z=0;for(let J of $)Z+=J.length;let X=new Uint8Array(Z),z=0;for(let J of $)X.set(J,z),z+=J.length;return X}function r2($){let Z;return(GY??(Z=new globalThis.TextEncoder,GY=Z.encode.bind(Z)))($)}function U5($){let Z;return(VY??(Z=new globalThis.TextDecoder,VY=Z.decode.bind(Z)))($)}var GY,VY;class E1{constructor(){S0.set(this,void 0),j0.set(this,void 0),w(this,S0,new Uint8Array,"f"),w(this,j0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?r2($):$;w(this,S0,KY([N(this,S0,"f"),Z]),"f");let X=[],z;while((z=cR(N(this,S0,"f"),N(this,j0,"f")))!=null){if(z.carriage&&N(this,j0,"f")==null){w(this,j0,z.index,"f");continue}if(N(this,j0,"f")!=null&&(z.index!==N(this,j0,"f")+1||z.carriage)){X.push(U5(N(this,S0,"f").subarray(0,N(this,j0,"f")-1))),w(this,S0,N(this,S0,"f").subarray(N(this,j0,"f")),"f"),w(this,j0,null,"f");continue}let J=N(this,j0,"f")!==null?z.preceding-1:z.preceding,Q=U5(N(this,S0,"f").subarray(0,J));X.push(Q),w(this,S0,N(this,S0,"f").subarray(z.index),"f"),w(this,j0,null,"f")}return X}flush(){if(!N(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=C8($),X=H$(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=C8($),X=H$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((X)=>X.type==="newline"||X.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()}}}LO.Parser=aX});var Zz=E((PO)=>{var oX=a3(),IO=M2(),T2=O2(),TO=Y3(),AO=i(),RO=YZ(),tX=WZ();function eX($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new RO.LineCounter||null,prettyErrors:Z}}function _O($,Z={}){let{lineCounter:X,prettyErrors:z}=eX(Z),J=new tX.Parser(X?.addNewLine),Q=new oX.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let W of Y)W.errors.forEach(T2.prettifyError($,X)),W.warnings.forEach(T2.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function $z($,Z={}){let{lineCounter:X,prettyErrors:z}=eX(Z),J=new tX.Parser(X?.addNewLine),Q=new oX.Composer(Z),Y=null;for(let W of Q.compose(J.parse($),!0,$.length))if(!Y)Y=W;else if(Y.options.logLevel!=="silent"){Y.errors.push(new T2.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(T2.prettifyError($,X)),Y.warnings.forEach(T2.prettifyError($,X));return Y}function FO($,Z,X){let z=void 0;if(typeof Z==="function")z=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let J=$z($,X);if(!J)return null;if(J.warnings.forEach((Q)=>TO.warn(J.options.logLevel,Q)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:z},X))}function CO($,Z,X){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let J=Math.round(X);X=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=X??Z??{};if(!J)return}if(AO.isDocument($)&&!z)return $.toString(X);return new IO.Document($,z,X).toString(X)}PO.parse=FO;PO.parseAllDocuments=_O;PO.parseDocument=$z;PO.stringify=CO});var Uz={};w9(Uz,{orange:()=>H0,italic:()=>LN,fafCyanDeep:()=>w8,fafCyan:()=>I,dim:()=>M,bold:()=>A,FAF_HEX:()=>R2});var GZ=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,A,M,LN,R2,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,w8=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,H0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var l=v(()=>{A=GZ("1"),M=GZ("2"),LN=GZ("3"),R2={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var $5=E((Rb,$R)=>{$R.exports={name:"faf-cli",version:"7.12.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"}},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 && 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)",prepublishOnly:"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:">=18.0.0"},publishConfig:{access:"public"}}});function w($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function N($,Z,X,z){if(X==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!z:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?z:X==="a"?z.call($):z?z.value:Z.get($)}var W1=()=>{};var X5=function(){let{crypto:$}=globalThis;if($?.randomUUID)return X5=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),X=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(z)=>(+z^X()&15>>+z/4).toString(16))};function U1($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var i2=($)=>{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,W0,O0,C1,w$,S$,j$,x$,b$,k$,y$,v$,g$;var _0=v(()=>{k=class k extends Error{};W0=class W0 extends k{constructor($,Z,X,z,J){super(`${W0.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z,this.type=J??null}static makeMessage($,Z,X){let z=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):X;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,Z,X,z){if(!$||!z)return new C1({message:X,cause:i2(Z)});let J=Z,Q=J?.error?.type;if($===400)return new S$($,J,X,z,Q);if($===401)return new j$($,J,X,z,Q);if($===403)return new x$($,J,X,z,Q);if($===404)return new b$($,J,X,z,Q);if($===409)return new k$($,J,X,z,Q);if($===422)return new y$($,J,X,z,Q);if($===429)return new v$($,J,X,z,Q);if($>=500)return new g$($,J,X,z,Q);return new W0($,J,X,z,Q)}};O0=class O0 extends W0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};C1=class C1 extends W0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};w$=class w$ extends C1{constructor({message:$}={}){super({message:$??"Request timed out."})}};S$=class S$ extends W0{};j$=class j$ extends W0{};x$=class x$ extends W0{};b$=class b$ extends W0{};k$=class k$ extends W0{};y$=class y$ extends W0{};v$=class v$ extends W0{};g$=class g$ extends W0{}});function H4($){if(typeof $!=="object")return{};return $??{}}function Q5($){if(!$)return!0;for(let Z in $)return!1;return!0}function oQ($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var vR,aQ=($)=>{return vR.test($)},z5=($)=>(z5=Array.isArray,z5($)),J5,tQ=($,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},B4=($)=>{try{return JSON.parse($)}catch(Z){return}};var r1=v(()=>{_0();vR=/^[a-z][a-z0-9+.-]*:/i,J5=z5});var eQ=($)=>new Promise((Z)=>setTimeout(Z,$));var P1="0.91.1";function gR(){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 hR(){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:X}of $){let z=X.exec(navigator.userAgent);if(z){let J=z[1]||0,Q=z[2]||0,Y=z[3]||0;return{browser:Z,version:`${J}.${Q}.${Y}`}}}return null}var zY=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},fR=()=>{let $=gR();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":P1,"X-Stainless-OS":ZY(Deno.build.os),"X-Stainless-Arch":$Y(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":P1,"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":P1,"X-Stainless-OS":ZY(globalThis.process.platform??"unknown"),"X-Stainless-Arch":$Y(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=hR();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":P1,"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":P1,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},$Y=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},ZY=($)=>{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"},XY,JY=()=>{return XY??(XY=fR())};var Y5=()=>{};function QY(){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 W5(...$){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 M4($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return W5({start(){},async pull(X){let{done:z,value:J}=await Z.next();if(z)X.close();else X.enqueue(J)},async cancel(){await Z.return?.()}})}function n2($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let X=await Z.read();if(X?.done)Z.releaseLock();return X}catch(X){throw Z.releaseLock(),X}},async return(){let X=Z.cancel();return Z.releaseLock(),await X,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function YY($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var WY=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function UY($){return Object.entries($).filter(([Z,X])=>typeof X<"u").map(([Z,X])=>{if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(X)}`;if(X===null)return`${encodeURIComponent(Z)}=`;throw new k(`Cannot stringify type ${typeof X}; 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 qY=v(()=>{_0()});function KY($){let Z=0;for(let J of $)Z+=J.length;let X=new Uint8Array(Z),z=0;for(let J of $)X.set(J,z),z+=J.length;return X}function r2($){let Z;return(GY??(Z=new globalThis.TextEncoder,GY=Z.encode.bind(Z)))($)}function U5($){let Z;return(VY??(Z=new globalThis.TextDecoder,VY=Z.decode.bind(Z)))($)}var GY,VY;class E1{constructor(){S0.set(this,void 0),j0.set(this,void 0),w(this,S0,new Uint8Array,"f"),w(this,j0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?r2($):$;w(this,S0,KY([N(this,S0,"f"),Z]),"f");let X=[],z;while((z=cR(N(this,S0,"f"),N(this,j0,"f")))!=null){if(z.carriage&&N(this,j0,"f")==null){w(this,j0,z.index,"f");continue}if(N(this,j0,"f")!=null&&(z.index!==N(this,j0,"f")+1||z.carriage)){X.push(U5(N(this,S0,"f").subarray(0,N(this,j0,"f")-1))),w(this,S0,N(this,S0,"f").subarray(N(this,j0,"f")),"f"),w(this,j0,null,"f");continue}let J=N(this,j0,"f")!==null?z.preceding-1:z.preceding,Q=U5(N(this,S0,"f").subarray(0,J));X.push(Q),w(this,S0,N(this,S0,"f").subarray(z.index),"f"),w(this,j0,null,"f")}return X}flush(){if(!N(this,S0,"f").length)return[];return this.decode(`
|
|
166
166
|
`)}}function cR($,Z){for(let J=Z??0;J<$.length;J++){if($[J]===10)return{preceding:J,index:J+1,carriage:!1};if($[J]===13)return{preceding:J,index:J+1,carriage:!0}}return null}function HY($){for(let z=0;z<$.length-1;z++){if($[z]===10&&$[z+1]===10)return z+2;if($[z]===13&&$[z+1]===13)return z+2;if($[z]===13&&$[z+1]===10&&z+3<$.length&&$[z+2]===13&&$[z+3]===10)return z+4}return-1}var S0,j0;var q5=v(()=>{W1();S0=new WeakMap,j0=new WeakMap;E1.NEWLINE_CHARS=new Set([`
|
|
167
167
|
`,"\r"]);E1.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function s2(){}function O4($,Z,X){if(!Z||N4[$]>N4[X])return s2;else return Z[$].bind(Z)}function M0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return lR;let z=BY.get(Z);if(z&&z[0]===X)return z[1];let J={error:O4("error",Z,X),warn:O4("warn",Z,X),info:O4("info",Z,X),debug:O4("debug",Z,X)};return BY.set(Z,[X,J]),J}var N4,G5=($,Z,X)=>{if(!$)return;if(oQ(N4,$))return $;M0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(N4))}`);return},lR,BY,q1=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([Z,X])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":X]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var L4=v(()=>{r1();N4={off:0,error:200,warn:300,info:400,debug:500};lR={error:s2,warn:s2,info:s2,debug:s2},BY=new WeakMap});async function*dR($,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 X=new MY,z=new E1,J=n2($.body);for await(let Q of pR(J))for(let Y of z.decode(Q)){let W=X.decode(Y);if(W)yield W}for(let Q of z.flush()){let Y=X.decode(Q);if(Y)yield Y}}async function*pR($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?r2(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=HY(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class MY{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 J={event:this.event,data:this.data.join(`
|
|
168
168
|
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],J}if(this.chunks.push($),$.startsWith(":"))return null;let[Z,X,z]=iR($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function iR($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var a2,x0;var V5=v(()=>{W1();_0();q5();r1();L4();_0();x0=class x0{constructor($,Z,X){this.iterator=$,a2.set(this,void 0),this.controller=Z,w(this,a2,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?M0(X):console;async function*Q(){if(z)throw new k("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let W of dR($,Z)){if(W.event==="completion")try{yield JSON.parse(W.data)}catch(U){throw J.error("Could not parse message into JSON:",W.data),J.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 J.error("Could not parse message into JSON:",W.data),J.error("From chunk:",W.raw),U}if(W.event==="ping")continue;if(W.event==="error"){let U=B4(W.data)??W.data,q=U?.error?.type;throw new W0(void 0,U,void 0,$.headers,q)}}Y=!0}catch(W){if(U1(W))return;throw W}finally{if(!Y)Z.abort()}}return new x0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new E1,W=n2($);for await(let U of W)for(let q of Y.decode(U))yield q;for(let U of Y.flush())yield U}async function*Q(){if(z)throw new k("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let W of J()){if(Y)continue;if(W)yield JSON.parse(W)}Y=!0}catch(W){if(U1(W))return;throw W}finally{if(!Y)Z.abort()}}return new x0(Q,Z,X)}[(a2=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],X=this.iterator(),z=(J)=>{return{next:()=>{if(J.length===0){let Q=X.next();$.push(Q),Z.push(Q)}return J.shift()}}};return[new x0(()=>z($),this.controller,N(this,a2,"f")),new x0(()=>z(Z),this.controller,N(this,a2,"f"))]}toReadableStream(){let $=this,Z;return W5({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=r2(JSON.stringify(z)+`
|
|
@@ -232,11 +232,11 @@ ${z}`;if(!XT($)){o8($,`${J}
|
|
|
232
232
|
`,"utf-8");return}let Q=ZT($,"utf-8"),Y=QT(Q,X,z);if(Y){o8($,`${Q.slice(0,Y.start)}${J}${Q.slice(Y.end)}`,"utf-8");return}if(Q.trimStart().startsWith(zT)&&!YJ(Q,X)&&!YJ(Q,z)){o8($,`${J}
|
|
233
233
|
`,"utf-8");return}o8($,`${J}
|
|
234
234
|
|
|
235
|
-
${Q}`,"utf-8")}var YT=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 gZ($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return YT.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function I0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function f0($){let Z=O$.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return gZ(X)}var HJ="CLAUDE.md",qT="STATUS:
|
|
235
|
+
${Q}`,"utf-8")}var YT=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 gZ($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return YT.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function I0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function f0($){let Z=O$.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return gZ(X)}var HJ="CLAUDE.md",qT="STATUS: SYNC ACTIVE";function BJ($){let Z=KJ($,HJ);if(!UT(Z))return null;return WT(Z,"utf-8")}function MJ($,Z){g0(KJ($,HJ),Z)}function Y1($,Z={}){let X=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),J=String($.project?.type??"").trim(),Q=String($.project?.goal??"").trim(),Y=`<!-- faf: ${[X,z,J,Q].join(" | ")} -->`,W=[];if(Z.doc)W.push(`doc=${Z.doc}`);else W.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")W.push(`score=${Z.score}`);if(W.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)W.push(`siblings=${Z.siblings.join(",")}`);let U=`<!-- faf: ${W.join(" | ")} -->`;return`${Y}
|
|
236
236
|
${U}`}function OJ($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(Y1($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let Q=$.stack??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[q,G]of Object.entries(Q))if(G&&G!=="slotignored"&&String(G).trim())Y.push(`**${f0(`stack.${q}`)}:** ${G}`);if(Y.length>0){Z.push("## Stack"),Z.push("");for(let q of Y)Z.push(`- ${q}`);Z.push("")}let W=$.human_context??{},U=[["who",W.who],["what",W.what],["why",W.why],["where",W.where],["when",W.when],["how",W.how]].filter(([,q])=>q&&String(q).trim()).map(([q,G])=>`- **${f0(`human_context.${q}`)}:** ${G}`);if(U.length>0)Z.push("## Context"),Z.push(""),Z.push(...U),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${qT} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
|
|
237
237
|
`)}function VJ($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function t8($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=VJ(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=VJ(Q[1].trim())}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let Q=$.match(/\*\*What Building:\*\*\s*(.+)/);if(Q)Z.project.goal=Q[1].trim()}let J=$.match(/\*\*Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim();if(!Z.project.main_language){let Q=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(Q)Z.project.main_language=Q[1].trim()}return Z}import{readFileSync as uS,writeFileSync as GT,existsSync as mS}from"fs";import{join as VT}from"path";function NJ($,Z){GT(VT($,"MEMORY.md"),Z,"utf-8")}l();function _$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function fZ($={}){let Z=process.cwd(),X=f(Z);if(!X)console.error(`Error: project.faf not found
|
|
238
238
|
|
|
239
|
-
Run 'faf init' to create one.`),process.exit(2);let z=DJ(Z,"CLAUDE.md"),J=DJ(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")IJ(X,z,Z);else if(Q==="push")TJ(X,Z);else if(Q==="pull")HT(X,z);if(_$())AJ(X,J,Z);if($.watch)console.log(M("watching for changes... (Ctrl+C to stop)")),MT(X,z,J,Z)}function IJ($,Z,X){TJ($,X)}function TJ($,Z){let X=m($),z=OJ(X);MJ(Z,z),console.log(`${I("◆")} sync .faf → CLAUDE.md
|
|
239
|
+
Run 'faf init' to create one.`),process.exit(2);let z=DJ(Z,"CLAUDE.md"),J=DJ(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")IJ(X,z,Z);else if(Q==="push")TJ(X,Z);else if(Q==="pull")HT(X,z);if(_$())AJ(X,J,Z);if($.watch)console.log(M("watching for changes... (Ctrl+C to stop)")),MT(X,z,J,Z)}function IJ($,Z,X){TJ($,X)}function TJ($,Z){let X=m($),z=OJ(X);MJ(Z,z),console.log(`${I("◆")} sync .faf → CLAUDE.md`);let J=B0(G0(u($)));Y0(J,$)}function HT($,Z){let X=B0(G0(u($)));if(X.tier.name!=="TROPHY")console.error(`${A("×")} sync --pull blocked: requires ✪ Trophy (currently ${X.score}%)`),console.error(M(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=BJ(KT(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=t8(z),Q=m($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};$0($,Q),console.log(`${I("◆")} sync CLAUDE.md → .faf ${M("(Trophy-gated)")}`);let Y=B0(G0(u($)));Y0(Y,$)}function AJ($,Z,X){let z=m($),J=LJ($).mtimeMs,Q=e8(Z)?LJ(Z).mtimeMs:0;if(!e8(Z)||J>Q){let Y=BT(z);NJ(X,Y),console.log(`${I("◆")} sync .faf → MEMORY.md ${M("← tri-sync")}`)}else console.log(`${I("◆")} sync MEMORY.md → .faf ${M("← tri-sync")}`)}function BT($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Authored by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return`${X.join(`
|
|
240
240
|
`)}
|
|
241
241
|
`}function MT($,Z,X,z){let{watch:J}=C0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(M("change detected...")),IJ($,Z,z),_$())AJ($,X,z)},200)};if(J($,Y),e8(Z))J(Z,Y);if(_$()&&e8(X))J(X,Y)}import{writeFileSync as OT}from"fs";l();function RJ($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
|
|
242
242
|
|
|
@@ -541,8 +541,8 @@ ${A("faf bench — agent-native protocol")} ${M(`qset ${Q.qsetHash} · ${Q.ques
|
|
|
541
541
|
`),console.log(` profile ${Z.profile}`),console.log(` facts ${Z.facts.length}`),console.log(` index ${Z.index.length}`),console.log(` created ${Z.created}`),console.log(` last_etched ${Z.last_etched}`),Z.index.length){console.log(`
|
|
542
542
|
${A("index")}`);for(let X of Z.index.slice(0,20))console.log(M(` ${X}`));if(Z.index.length>20)console.log(M(` … +${Z.index.length-20} more`))}}function LW($,Z,X={}){if(Z&&typeof Z==="object")X=Z,Z=void 0;switch($){case"convert":wF(Z,X);break;case"ls":case"list":SF(X);break;case"recall":jF(Z,X);break;case"etch":xF(Z,X);break;case"show":bF(X);break;case void 0:case"help":OW();break;default:console.error(`Unknown memory subcommand: ${$}`),OW(),process.exit(2)}}function OW(){console.log(`${I("faf memory")} ${M("— .fafm soul ops (knowledge profile)")}
|
|
543
543
|
`),console.log(" convert <dir> Claude Code memory dir → soul.fafm"),console.log(" etch <text> Write a fact (creates soul.fafm if needed)"),console.log(" ls List facts (ranked)"),console.log(" recall [query] Deterministic recall"),console.log(` show Soul summary
|
|
544
|
-
`),console.log(M(" Options: --file · --output · --namepoint · --id · --type · --tag · --priority · --limit · --json")),console.log(M(" INTEROP: claude-fafm-sdk 1.0 · application/vnd.fafm+yaml v1.1"))}var{version:DW}=$5(),g=new n9;g.name("faf").description("Foundational AI context + memory — .faf and .fafm for any AI").version(DW,"-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(($)=>kZ($));g.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>XJ());g.command("auto").description("Zero to 100% in one command").action(()=>r8());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(($)=>JJ($));g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>sQ($));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)=>j8($,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,X)=>UW($,Z,X));g.command("show").description("Render project.faf → project.html and open it").action(()=>UQ());g.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>fZ($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>RJ($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>_J($,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)=>GQ($,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)=>IQ($,Z));g.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>LQ($??[]));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(($)=>TQ($));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(($)=>EQ($));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(($)=>PQ($));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 (.well-known/mcp/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").action(($)=>i1($));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)").action(($)=>QQ($));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 (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").action(($)=>WQ($));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)=>hZ($,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(($)=>wQ($));g.command("formats").description("Show supported formats").action(()=>SQ());g.command("clear").description("Clear cached data").action(()=>jQ());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>xQ($));g.command("context").description("Author context output").action(()=>bQ());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(($)=>qW($));g.command("drift").description("Check context drift").option("--json","Emit the drift report as structured JSON").action(($)=>gQ($));g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>fQ($,Z));g.command("recover").description("Recover .faf from context files").action(()=>hQ());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>uQ($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>mQ($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>cQ($));g.command("demo").description("Demo walkthrough").action(()=>dQ());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>pQ($,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").action(($,Z)=>nQ($,Z));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>sY($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>tY($,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(($)=>$W($));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").action(($,Z,X)=>LW($,Z,X));g.command("bi-sync",{hidden:!0}).action(()=>fZ());g.command("status",{hidden:!0}).action(()=>j8(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>i1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>i1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>i1({gemini:!0}));g.command("grok",{hidden:!0}).action(()=>i1({grok:!0}));g.command("llms",{hidden:!0}).action(()=>i1({llms:!0}));g.command("validate",{hidden:!0}).action(($)=>hZ($));g.command("yolo",{hidden:!0}).action(()=>kZ({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (l(),Uz)),z=process.cwd().replace(process.env.HOME??"","~"),J="\x1B[38;2;150;150;150m",Q="\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"} ${X($("faf"))} ${Z(`v${DW}`)}`);let q="\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(`${q}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(` ${z}`)}`),console.log("");try{await j8(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("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(`
|
|
544
|
+
`),console.log(M(" Options: --file · --output · --namepoint · --id · --type · --tag · --priority · --limit · --json")),console.log(M(" INTEROP: claude-fafm-sdk 1.0 · application/vnd.fafm+yaml v1.1"))}var{version:DW}=$5(),g=new n9;g.name("faf").description("Foundational AI context + memory — .faf and .fafm for any AI").version(DW,"-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(($)=>kZ($));g.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>XJ());g.command("auto").description("Zero to 100% in one command").action(()=>r8());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(($)=>JJ($));g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>sQ($));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)=>j8($,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,X)=>UW($,Z,X));g.command("show").description("Render project.faf → project.html and open it").action(()=>UQ());g.command("sync").description(".faf ↔ CLAUDE.md (mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>fZ($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>RJ($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>_J($,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)=>GQ($,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)=>IQ($,Z));g.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>LQ($??[]));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(($)=>TQ($));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(($)=>EQ($));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(($)=>PQ($));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 (.well-known/mcp/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").action(($)=>i1($));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)").action(($)=>QQ($));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 (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").action(($)=>WQ($));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)=>hZ($,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(($)=>wQ($));g.command("formats").description("Show supported formats").action(()=>SQ());g.command("clear").description("Clear cached data").action(()=>jQ());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>xQ($));g.command("context").description("Author context output").action(()=>bQ());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(($)=>qW($));g.command("drift").description("Check context drift").option("--json","Emit the drift report as structured JSON").action(($)=>gQ($));g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>fQ($,Z));g.command("recover").description("Recover .faf from context files").action(()=>hQ());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>uQ($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>mQ($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>cQ($));g.command("demo").description("Demo walkthrough").action(()=>dQ());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>pQ($,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").action(($,Z)=>nQ($,Z));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>sY($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>tY($,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(($)=>$W($));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").action(($,Z,X)=>LW($,Z,X));g.command("bi-sync",{hidden:!0}).action(()=>fZ());g.command("status",{hidden:!0}).action(()=>j8(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>i1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>i1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>i1({gemini:!0}));g.command("grok",{hidden:!0}).action(()=>i1({grok:!0}));g.command("llms",{hidden:!0}).action(()=>i1({llms:!0}));g.command("validate",{hidden:!0}).action(($)=>hZ($));g.command("yolo",{hidden:!0}).action(()=>kZ({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (l(),Uz)),z=process.cwd().replace(process.env.HOME??"","~"),J="\x1B[38;2;150;150;150m",Q="\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"} ${X($("faf"))} ${Z(`v${DW}`)}`);let q="\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(`${q}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(` ${z}`)}`),console.log("");try{await j8(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("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(`
|
|
545
545
|
`)),g.parse(process.argv);
|
|
546
546
|
|
|
547
|
-
//# debugId=
|
|
547
|
+
//# debugId=9E529F60ADBEB95264756E2164756E21
|
|
548
548
|
//# sourceMappingURL=cli.js.map
|