faf 6.11.0 → 6.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <div style="display: flex; align-items: center; gap: 12px;">
5
5
  <img src="https://www.faf.one/orange-smiley.svg" alt="FAF" width="40" />
6
6
  <div>
7
- <h1 style="margin: 0; color: #000000;">faf-cli — The Ledger Edition</h1>
7
+ <h1 style="margin: 0; color: #000000;">faf-cli — The Single-Source Edition</h1>
8
8
  <p style="margin: 2px 0 0 0; font-size: 0.85em; letter-spacing: 0.12em; opacity: 0.7; text-transform: uppercase;"><strong>Persistent AI Context Standard</strong></p>
9
9
  <p style="margin: 6px 0 0 0;"><strong>Persistent Project Context for AI.</strong></p>
10
10
  <p style="margin: 0;"><strong>Define once. Run anywhere.</strong></p>
@@ -63,6 +63,21 @@ Run `faf` with no arguments:
63
63
 
64
64
  ---
65
65
 
66
+ ## v6.12 — The Single-Source Edition
67
+
68
+ **faf-cli is now the single source for the registry `_meta`** — it emits the `one.faf/context` block every FAF MCP server composes: `registryMeta`/`registryName`/`fafContextBlock`, one deterministic projection, byte-identical, end-to-end across every surface, verifiable by sha, re-derivable instantly on-demand.
69
+
70
+ ```ts
71
+ import { registryMeta, registryName } from 'faf-cli';
72
+
73
+ serverJson.name = registryName(faf); // → one.faf/<name>, derived from project.homepage
74
+ serverJson._meta = registryMeta(faf); // nests one.faf/context under publisher-provided (4 KB cap)
75
+ ```
76
+
77
+ Honest-first: the block carries `{ faf, mediaType, iana, deterministic, generated }` — **no baked score**. One emitter, every door, byte-identical.
78
+
79
+ ---
80
+
66
81
  ## v6.11 — The Ledger Edition
67
82
 
68
83
  **`faf bench --submit` posts your cold-vs-grounded receipt to the public ledger — the context bench goes public, one command.** Run the grounding benchmark, then submit the full pair receipt:
@@ -164,9 +179,9 @@ v6 is a ground-up rewrite. All-in on Bun — same toolchain as Claude Code.
164
179
  | **Language** | TypeScript | TypeScript |
165
180
  | **Compile** | Bun bytecode | `bun build --compile` |
166
181
 
167
- 408 tests in ~13s. 296KB bundle in 2.4s. Single portable binary, 4 platforms. npx backward-compatible.
182
+ 880 tests in ~18s. 296KB bundle in 2.4s. Single portable binary, 4 platforms. npx backward-compatible.
168
183
 
169
- 26 commands. 408 tests. WJTTC-tested. 93% smaller than v5.
184
+ 32 commands. 880 tests. WJTTC-tested. 93% smaller than v5.
170
185
 
171
186
  ```
172
187
  commands → interop → core → wasm
@@ -286,7 +301,7 @@ src/
286
301
  > **Robust. Reliable. Next-level WJTTC tested.** — The Foundation Edition.
287
302
 
288
303
  ```bash
289
- bun test # 408 tests, 42 files, ~13s
304
+ bun test # 880 tests, 75 files, ~18s
290
305
  ```
291
306
 
292
307
  - **WJTTC Build Resilience** (13) — every regression class locked.
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 X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,Z.start),X.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let z=!this.onKeyLine&&this.indent===$.indent,X=z&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",J=[];if(X&&Z.sep&&!Z.value){let Q=[];for(let Y=0;Y<Z.sep.length;++Y){let U=Z.sep[Y];switch(U.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(U.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(X||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(X||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(z$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=p$(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(z$(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(p9(Z.key)&&!z$(Z.sep,"newline")){let Q=p$(Z.start),Y=Z.key,U=Z.sep;U.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:U}]})}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||X)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(z$(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(X||Z.value)$.items.push({start: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&&!z$(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: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 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 X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,Z.start),X.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||z$(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 X=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:X,sep:[]});else if(Z.sep)this.stack.push(X);else Object.assign(Z,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let 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 X=b2(z),J=p$(X);d9($);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=b2($),z=p$(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=b2($),z=p$(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()}}}vK.Parser=l9});var a9=A((sK)=>{var i9=E8(),mK=c1(),s1=d1(),cK=v6(),dK=c(),pK=v8(),n9=u8();function s9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new pK.LineCounter||null,prettyErrors:Z}}function lK($,Z={}){let{lineCounter:z,prettyErrors:X}=s9(Z),J=new n9.Parser(z?.addNewLine),Q=new i9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(X&&z)for(let U of Y)U.errors.forEach(s1.prettifyError($,z)),U.warnings.forEach(s1.prettifyError($,z));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function r9($,Z={}){let{lineCounter:z,prettyErrors:X}=s9(Z),J=new n9.Parser(z?.addNewLine),Q=new i9.Composer(Z),Y=null;for(let U of Q.compose(J.parse($),!0,$.length))if(!Y)Y=U;else if(Y.options.logLevel!=="silent"){Y.errors.push(new s1.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&z)Y.errors.forEach(s1.prettifyError($,z)),Y.warnings.forEach(s1.prettifyError($,z));return Y}function iK($,Z,z){let X=void 0;if(typeof Z==="function")X=Z;else if(z===void 0&&Z&&typeof Z==="object")z=Z;let J=r9($,z);if(!J)return null;if(J.warnings.forEach((Q)=>cK.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:X},z))}function nK($,Z,z){let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(z===void 0&&Z)z=Z;if(typeof z==="string")z=z.length;if(typeof z==="number"){let J=Math.round(z);z=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=z??Z??{};if(!J)return}if(dK.isDocument($)&&!X)return $.toString(z);return new mK.Document($,X,z).toString(z)}sK.parse=iK;sK.parseAllDocuments=lK;sK.parseDocument=r9;sK.stringify=nK});var Z7={};wZ(Z7,{orange:()=>V0,italic:()=>hH,fafCyanDeep:()=>k2,fafCyan:()=>D,dim:()=>N,bold:()=>w,FAF_HEX:()=>r1});var d8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,w,N,hH,r1,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,k2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,V0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var d=S(()=>{w=d8("1"),N=d8("2"),hH=d8("3"),r1={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var Z3=A(($R,nL)=>{nL.exports={name:"faf",version:"6.11.0",description:"Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-approved.",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",build:"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"],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.1","faf-scoring-kernel":"^2.0.3",open:"^11.0.0",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@faf/specification":"github:Wolfe-Jam/faf",ajv:"^8.17.1","@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function R($,Z,z,X,J){if(X==="m")throw TypeError("Private method is not writable");if(X==="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 X==="a"?J.call($,z):J?J.value=z:Z.set($,z),z}function H($,Z,z,X){if(z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!X:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return z==="m"?X:z==="a"?X.call($):X?X.value:Z.get($)}var d0=()=>{};var J3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return J3=$.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,(X)=>(+X^z()&15>>+X/4).toString(16))};function p0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var Z4=($)=>{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 _,X0,q0,Y$,$1,Z1,z1,X1,J1,Q1,Y1,U1,G1;var N0=S(()=>{_=class _ extends Error{};X0=class X0 extends _{constructor($,Z,z,X,J){super(`${X0.makeMessage($,Z,z)}`);this.status=$,this.headers=X,this.requestID=X?.get("request-id"),this.error=Z,this.type=J??null}static makeMessage($,Z,z){let X=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):z;if($&&X)return`${$} ${X}`;if($)return`${$} status code (no body)`;if(X)return X;return"(no status code or body)"}static generate($,Z,z,X){if(!$||!X)return new Y$({message:z,cause:Z4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new Z1($,J,z,X,Q);if($===401)return new z1($,J,z,X,Q);if($===403)return new X1($,J,z,X,Q);if($===404)return new J1($,J,z,X,Q);if($===409)return new Q1($,J,z,X,Q);if($===422)return new Y1($,J,z,X,Q);if($===429)return new U1($,J,z,X,Q);if($>=500)return new G1($,J,z,X,Q);return new X0($,J,z,X,Q)}};q0=class q0 extends X0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};Y$=class Y$ extends X0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};$1=class $1 extends Y${constructor({message:$}={}){super({message:$??"Request timed out."})}};Z1=class Z1 extends X0{};z1=class z1 extends X0{};X1=class X1 extends X0{};J1=class J1 extends X0{};Q1=class Q1 extends X0{};Y1=class Y1 extends X0{};U1=class U1 extends X0{};G1=class G1 extends X0{}});function n2($){if(typeof $!=="object")return{};return $??{}}function U3($){if(!$)return!0;for(let Z in $)return!1;return!0}function _z($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var RN,Pz=($)=>{return RN.test($)},Q3=($)=>(Q3=Array.isArray,Q3($)),Y3,Cz=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new _(`${$} must be an integer`);if(Z<0)throw new _(`${$} must be a positive integer`);return Z},s2=($)=>{try{return JSON.parse($)}catch(Z){return}};var P$=S(()=>{N0();RN=/^[a-z][a-z0-9+.-]*:/i,Y3=Q3});var Ez=($)=>new Promise((Z)=>setTimeout(Z,$));var U$="0.91.1";function FN(){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 PN(){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 X=z.exec(navigator.userAgent);if(X){let J=X[1]||0,Q=X[2]||0,Y=X[3]||0;return{browser:Z,version:`${J}.${Q}.${Y}`}}}return null}var xz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},wN=()=>{let $=FN();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":U$,"X-Stainless-OS":Sz(Deno.build.os),"X-Stainless-Arch":jz(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":U$,"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":U$,"X-Stainless-OS":Sz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":jz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=PN();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":U$,"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":U$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},jz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},Sz=($)=>{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"},bz,kz=()=>{return bz??(bz=wN())};var G3=()=>{};function yz(){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 W3(...$){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 r2($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return W3({start(){},async pull(z){let{done:X,value:J}=await Z.next();if(X)z.close();else z.enqueue(J)},async cancel(){await Z.return?.()}})}function z4($){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 fz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),z=Z.cancel();Z.releaseLock(),await z}var gz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function hz($){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 _(`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 vz=S(()=>{N0()});function cz($){let Z=0;for(let J of $)Z+=J.length;let z=new Uint8Array(Z),X=0;for(let J of $)z.set(J,X),X+=J.length;return z}function X4($){let Z;return(uz??(Z=new globalThis.TextEncoder,uz=Z.encode.bind(Z)))($)}function q3($){let Z;return(mz??(Z=new globalThis.TextDecoder,mz=Z.decode.bind(Z)))($)}var uz,mz;class G${constructor(){O0.set(this,void 0),D0.set(this,void 0),R(this,O0,new Uint8Array,"f"),R(this,D0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?X4($):$;R(this,O0,cz([H(this,O0,"f"),Z]),"f");let z=[],X;while((X=EN(H(this,O0,"f"),H(this,D0,"f")))!=null){if(X.carriage&&H(this,D0,"f")==null){R(this,D0,X.index,"f");continue}if(H(this,D0,"f")!=null&&(X.index!==H(this,D0,"f")+1||X.carriage)){z.push(q3(H(this,O0,"f").subarray(0,H(this,D0,"f")-1))),R(this,O0,H(this,O0,"f").subarray(H(this,D0,"f")),"f"),R(this,D0,null,"f");continue}let J=H(this,D0,"f")!==null?X.preceding-1:X.preceding,Q=q3(H(this,O0,"f").subarray(0,J));z.push(Q),R(this,O0,H(this,O0,"f").subarray(X.index),"f"),R(this,D0,null,"f")}return z}flush(){if(!H(this,O0,"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=b2($),z=p$(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=b2($),z=p$(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()}}}vK.Parser=l9});var a9=A((sK)=>{var i9=E8(),mK=c1(),s1=d1(),cK=v6(),dK=c(),pK=v8(),n9=u8();function s9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new pK.LineCounter||null,prettyErrors:Z}}function lK($,Z={}){let{lineCounter:z,prettyErrors:X}=s9(Z),J=new n9.Parser(z?.addNewLine),Q=new i9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(X&&z)for(let U of Y)U.errors.forEach(s1.prettifyError($,z)),U.warnings.forEach(s1.prettifyError($,z));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function r9($,Z={}){let{lineCounter:z,prettyErrors:X}=s9(Z),J=new n9.Parser(z?.addNewLine),Q=new i9.Composer(Z),Y=null;for(let U of Q.compose(J.parse($),!0,$.length))if(!Y)Y=U;else if(Y.options.logLevel!=="silent"){Y.errors.push(new s1.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&z)Y.errors.forEach(s1.prettifyError($,z)),Y.warnings.forEach(s1.prettifyError($,z));return Y}function iK($,Z,z){let X=void 0;if(typeof Z==="function")X=Z;else if(z===void 0&&Z&&typeof Z==="object")z=Z;let J=r9($,z);if(!J)return null;if(J.warnings.forEach((Q)=>cK.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:X},z))}function nK($,Z,z){let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(z===void 0&&Z)z=Z;if(typeof z==="string")z=z.length;if(typeof z==="number"){let J=Math.round(z);z=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=z??Z??{};if(!J)return}if(dK.isDocument($)&&!X)return $.toString(z);return new mK.Document($,X,z).toString(z)}sK.parse=iK;sK.parseAllDocuments=lK;sK.parseDocument=r9;sK.stringify=nK});var Z7={};wZ(Z7,{orange:()=>V0,italic:()=>hH,fafCyanDeep:()=>k2,fafCyan:()=>D,dim:()=>N,bold:()=>w,FAF_HEX:()=>r1});var d8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,w,N,hH,r1,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,k2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,V0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var d=S(()=>{w=d8("1"),N=d8("2"),hH=d8("3"),r1={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var Z3=A(($R,nL)=>{nL.exports={name:"faf",version:"6.12.0",description:"Persistent AI Context Standard — project DNA for AI. 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"],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.1","faf-scoring-kernel":"^2.0.3",open:"^11.0.0",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@faf/specification":"github:Wolfe-Jam/faf",ajv:"^8.17.1","@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function R($,Z,z,X,J){if(X==="m")throw TypeError("Private method is not writable");if(X==="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 X==="a"?J.call($,z):J?J.value=z:Z.set($,z),z}function H($,Z,z,X){if(z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!X:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return z==="m"?X:z==="a"?X.call($):X?X.value:Z.get($)}var d0=()=>{};var J3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return J3=$.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,(X)=>(+X^z()&15>>+X/4).toString(16))};function p0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var Z4=($)=>{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 _,X0,q0,Y$,$1,Z1,z1,X1,J1,Q1,Y1,U1,G1;var N0=S(()=>{_=class _ extends Error{};X0=class X0 extends _{constructor($,Z,z,X,J){super(`${X0.makeMessage($,Z,z)}`);this.status=$,this.headers=X,this.requestID=X?.get("request-id"),this.error=Z,this.type=J??null}static makeMessage($,Z,z){let X=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):z;if($&&X)return`${$} ${X}`;if($)return`${$} status code (no body)`;if(X)return X;return"(no status code or body)"}static generate($,Z,z,X){if(!$||!X)return new Y$({message:z,cause:Z4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new Z1($,J,z,X,Q);if($===401)return new z1($,J,z,X,Q);if($===403)return new X1($,J,z,X,Q);if($===404)return new J1($,J,z,X,Q);if($===409)return new Q1($,J,z,X,Q);if($===422)return new Y1($,J,z,X,Q);if($===429)return new U1($,J,z,X,Q);if($>=500)return new G1($,J,z,X,Q);return new X0($,J,z,X,Q)}};q0=class q0 extends X0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};Y$=class Y$ extends X0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};$1=class $1 extends Y${constructor({message:$}={}){super({message:$??"Request timed out."})}};Z1=class Z1 extends X0{};z1=class z1 extends X0{};X1=class X1 extends X0{};J1=class J1 extends X0{};Q1=class Q1 extends X0{};Y1=class Y1 extends X0{};U1=class U1 extends X0{};G1=class G1 extends X0{}});function n2($){if(typeof $!=="object")return{};return $??{}}function U3($){if(!$)return!0;for(let Z in $)return!1;return!0}function _z($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var RN,Pz=($)=>{return RN.test($)},Q3=($)=>(Q3=Array.isArray,Q3($)),Y3,Cz=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new _(`${$} must be an integer`);if(Z<0)throw new _(`${$} must be a positive integer`);return Z},s2=($)=>{try{return JSON.parse($)}catch(Z){return}};var P$=S(()=>{N0();RN=/^[a-z][a-z0-9+.-]*:/i,Y3=Q3});var Ez=($)=>new Promise((Z)=>setTimeout(Z,$));var U$="0.91.1";function FN(){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 PN(){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 X=z.exec(navigator.userAgent);if(X){let J=X[1]||0,Q=X[2]||0,Y=X[3]||0;return{browser:Z,version:`${J}.${Q}.${Y}`}}}return null}var xz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},wN=()=>{let $=FN();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":U$,"X-Stainless-OS":Sz(Deno.build.os),"X-Stainless-Arch":jz(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":U$,"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":U$,"X-Stainless-OS":Sz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":jz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=PN();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":U$,"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":U$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},jz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},Sz=($)=>{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"},bz,kz=()=>{return bz??(bz=wN())};var G3=()=>{};function yz(){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 W3(...$){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 r2($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return W3({start(){},async pull(z){let{done:X,value:J}=await Z.next();if(X)z.close();else z.enqueue(J)},async cancel(){await Z.return?.()}})}function z4($){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 fz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),z=Z.cancel();Z.releaseLock(),await z}var gz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function hz($){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 _(`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 vz=S(()=>{N0()});function cz($){let Z=0;for(let J of $)Z+=J.length;let z=new Uint8Array(Z),X=0;for(let J of $)z.set(J,X),X+=J.length;return z}function X4($){let Z;return(uz??(Z=new globalThis.TextEncoder,uz=Z.encode.bind(Z)))($)}function q3($){let Z;return(mz??(Z=new globalThis.TextDecoder,mz=Z.decode.bind(Z)))($)}var uz,mz;class G${constructor(){O0.set(this,void 0),D0.set(this,void 0),R(this,O0,new Uint8Array,"f"),R(this,D0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?X4($):$;R(this,O0,cz([H(this,O0,"f"),Z]),"f");let z=[],X;while((X=EN(H(this,O0,"f"),H(this,D0,"f")))!=null){if(X.carriage&&H(this,D0,"f")==null){R(this,D0,X.index,"f");continue}if(H(this,D0,"f")!=null&&(X.index!==H(this,D0,"f")+1||X.carriage)){z.push(q3(H(this,O0,"f").subarray(0,H(this,D0,"f")-1))),R(this,O0,H(this,O0,"f").subarray(H(this,D0,"f")),"f"),R(this,D0,null,"f");continue}let J=H(this,D0,"f")!==null?X.preceding-1:X.preceding,Q=q3(H(this,O0,"f").subarray(0,J));z.push(Q),R(this,O0,H(this,O0,"f").subarray(X.index),"f"),R(this,D0,null,"f")}return z}flush(){if(!H(this,O0,"f").length)return[];return this.decode(`
166
166
  `)}}function EN($,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 dz($){for(let X=0;X<$.length-1;X++){if($[X]===10&&$[X+1]===10)return X+2;if($[X]===13&&$[X+1]===13)return X+2;if($[X]===13&&$[X+1]===10&&X+3<$.length&&$[X+2]===13&&$[X+3]===10)return X+4}return-1}var O0,D0;var V3=S(()=>{d0();O0=new WeakMap,D0=new WeakMap;G$.NEWLINE_CHARS=new Set([`
167
167
  `,"\r"]);G$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function J4(){}function a2($,Z,z){if(!Z||o2[$]>o2[z])return J4;else return Z[$].bind(Z)}function G0($){let Z=$.logger,z=$.logLevel??"off";if(!Z)return jN;let X=pz.get(Z);if(X&&X[0]===z)return X[1];let J={error:a2("error",Z,z),warn:a2("warn",Z,z),info:a2("info",Z,z),debug:a2("debug",Z,z)};return pz.set(Z,[z,J]),J}var o2,K3=($,Z,z)=>{if(!$)return;if(_z(o2,$))return $;G0(z).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(o2))}`);return},jN,pz,l0=($)=>{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 t2=S(()=>{P$();o2={off:0,error:200,warn:300,info:400,debug:500};jN={error:J4,warn:J4,info:J4,debug:J4},pz=new WeakMap});async function*SN($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new _("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 _("Attempted to iterate over a response with no body")}let z=new lz,X=new G$,J=z4($.body);for await(let Q of bN(J))for(let Y of X.decode(Q)){let U=z.decode(Y);if(U)yield U}for(let Q of X.flush()){let Y=z.decode(Q);if(Y)yield Y}}async function*bN($){let Z=new Uint8Array;for await(let z of $){if(z==null)continue;let X=z instanceof ArrayBuffer?new Uint8Array(z):typeof z==="string"?X4(z):z,J=new Uint8Array(Z.length+X.length);J.set(Z),J.set(X,Z.length),Z=J;let Q;while((Q=dz(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class lz{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,z,X]=xN($,":");if(X.startsWith(" "))X=X.substring(1);if(Z==="event")this.event=X;else if(Z==="data")this.data.push(X);return null}}function xN($,Z){let z=$.indexOf(Z);if(z!==-1)return[$.substring(0,z),Z,$.substring(z+Z.length)];return[$,"",""]}var Q4,I0;var H3=S(()=>{d0();N0();V3();P$();t2();N0();I0=class I0{constructor($,Z,z){this.iterator=$,Q4.set(this,void 0),this.controller=Z,R(this,Q4,z,"f")}static fromSSEResponse($,Z,z){let X=!1,J=z?G0(z):console;async function*Q(){if(X)throw new _("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");X=!0;let Y=!1;try{for await(let U of SN($,Z)){if(U.event==="completion")try{yield JSON.parse(U.data)}catch(G){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),G}if(U.event==="message_start"||U.event==="message_delta"||U.event==="message_stop"||U.event==="content_block_start"||U.event==="content_block_delta"||U.event==="content_block_stop"||U.event==="message"||U.event==="user.message"||U.event==="user.interrupt"||U.event==="user.tool_confirmation"||U.event==="user.custom_tool_result"||U.event==="agent.message"||U.event==="agent.thinking"||U.event==="agent.tool_use"||U.event==="agent.tool_result"||U.event==="agent.mcp_tool_use"||U.event==="agent.mcp_tool_result"||U.event==="agent.custom_tool_use"||U.event==="agent.thread_context_compacted"||U.event==="session.status_running"||U.event==="session.status_idle"||U.event==="session.status_rescheduled"||U.event==="session.status_terminated"||U.event==="session.error"||U.event==="session.deleted"||U.event==="span.model_request_start"||U.event==="span.model_request_end")try{yield JSON.parse(U.data)}catch(G){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),G}if(U.event==="ping")continue;if(U.event==="error"){let G=s2(U.data)??U.data,W=G?.error?.type;throw new X0(void 0,G,void 0,$.headers,W)}}Y=!0}catch(U){if(p0(U))return;throw U}finally{if(!Y)Z.abort()}}return new I0(Q,Z,z)}static fromReadableStream($,Z,z){let X=!1;async function*J(){let Y=new G$,U=z4($);for await(let G of U)for(let W of Y.decode(G))yield W;for(let G of Y.flush())yield G}async function*Q(){if(X)throw new _("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");X=!0;let Y=!1;try{for await(let U of J()){if(Y)continue;if(U)yield JSON.parse(U)}Y=!0}catch(U){if(p0(U))return;throw U}finally{if(!Y)Z.abort()}}return new I0(Q,Z,z)}[(Q4=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],z=this.iterator(),X=(J)=>{return{next:()=>{if(J.length===0){let Q=z.next();$.push(Q),Z.push(Q)}return J.shift()}}};return[new I0(()=>X($),this.controller,H(this,Q4,"f")),new I0(()=>X(Z),this.controller,H(this,Q4,"f"))]}toReadableStream(){let $=this,Z;return W3({async start(){Z=$[Symbol.asyncIterator]()},async pull(z){try{let{value:X,done:J}=await Z.next();if(J)return z.close();let Q=X4(JSON.stringify(X)+`
@@ -317,7 +317,7 @@ Rendered on-demand from your current <strong>${o$(z)}</strong><br>
317
317
  </div>
318
318
  </body>
319
319
  </html>
320
- `}function l2($,Z,z,X="project.faf"){RL(FL($,"project.html"),SL(Z,z,X),"utf-8")}import{writeFileSync as bL}from"fs";import{join as xL}from"path";var Zz="application/vnd.faf+yaml",kL="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",yL=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function fL($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&yL.test(Z))return Z;let z=$.project?.homepage??$.project?.website??$.project?.url,X="local";if(z)try{X=new URL(z).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let J=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${X}/${J}`}function gL($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:Z.slice(0,97).trimEnd()+"..."}function hL($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:Zz,iana:`https://www.iana.org/assignments/media-types/${Zz}`,deterministic:!0,generated:$.generated??Z.now??new Date().toISOString()}}function vL($,Z={}){let z={$schema:kL,name:fL($),version:String($.project?.version??"0.1.0"),description:gL($)},X=$.project?.name;if(X&&X.length<=100)z.title=X;let J=$.project?.homepage??$.project?.website??$.project?.url;if(J)z.websiteUrl=J;if(Z.remoteUrl)z.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return z._meta={"one.faf/context":hL($,Z)},z}function zz($,Z,z={}){let X=vL(Z,z),J=xL($,"server-card");return bL(J,JSON.stringify(X,null,2)+`
320
+ `}function l2($,Z,z,X="project.faf"){RL(FL($,"project.html"),SL(Z,z,X),"utf-8")}import{writeFileSync as bL}from"fs";import{join as xL}from"path";var Zz="application/vnd.faf+yaml",kL="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",yL=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function fL($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&yL.test(Z))return Z;let z=$.project?.homepage??$.project?.website??$.project?.url,X="local";if(z)try{X=new URL(z).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let J=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${X}/${J}`}function gL($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:Z.slice(0,97).trimEnd()+"..."}function hL($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:Zz,iana:`https://www.iana.org/assignments/media-types/${Zz}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function vL($,Z={}){let z={$schema:kL,name:fL($),version:String($.project?.version??"0.1.0"),description:gL($)},X=$.project?.name;if(X&&X.length<=100)z.title=X;let J=$.project?.homepage??$.project?.website??$.project?.url;if(J)z.websiteUrl=J;if(Z.remoteUrl)z.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return z._meta={"one.faf/context":hL($,Z)},z}function zz($,Z,z={}){let X=vL(Z,z),J=xL($,"server-card");return bL(J,JSON.stringify(X,null,2)+`
321
321
  `,"utf-8"),J}d();function t$($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
322
322
 
323
323
  Run 'faf init' to create one.`),process.exit(2);let z=process.cwd(),X=l(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)l7(z,X),console.log(" AGENTS.md");if(J||$.cursor)i7(z,X),console.log(" .cursorrules");if(J||$.gemini)n7(z,X),console.log(" GEMINI.md");if($.grok){let Y=o7(z,X);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=H0(u(Z));l2(z,X,Y,Z),console.log(" project.html")}let Q=X.app_type==="server-card"||X.project?.type==="server-card";if($.card||J&&Q){let Y=zz(z,X);console.log(` ${Y.replace(`${z}/`,"")}`)}console.log(`${D("exported")} ${N(`from ${Z}`)}`)}import{join as uL}from"path";import mL from"open";d();function cL($){if(process.env.CI)return!1;try{return mL($).catch(()=>{return}),!0}catch{return!1}}function Xz(){let $=v();if(!$)console.error(`Error: project.faf not found
@@ -447,5 +447,5 @@ ${w("faf bench — agent-native protocol")} ${N(`qset ${Q.qsetHash} · ${Q.ques
447
447
  Run 'faf init' to create one.`),process.exit(2);let z=u(Z),X=H0(z),J=new c0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,U=Y!=null?X.score-Y:0,G=Y!=null&&U!==0,W=Z.replace(/\.faf$/,".fafb"),q=null;if(ZT(W)){let V=y2(z);zT(W,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:X.score,tier:X.tier,baseline:Y,delta:U,drifted:G,fafb:q!=null?{reCompiled:!0,bytes:q}:{reCompiled:!1},journey:J.getJourney()||null},null,2));else{if(console.log(`${D("refresh")} ${N("— re-grounding on the live .faf")}
448
448
  `),G){let V=U>0?"↑":"↓";console.log(` drift: ${N(`${Y}%`)} ${V} ${w(`${X.score}%`)} ${N(`(${U>0?"+":""}${U})`)}`)}else if(Y!=null)console.log(` no drift ${N(`— steady at ${X.score}%`)}`);else console.log(` baseline set ${N(`— ${X.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${N(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${i$(X.tier)} ${w(`${X.score}%`)}`)}if(J.exists())J.recordGrowth(X.score,["refresh — re-grounded"]);else J.birth(X.score)}var{version:uX}=Z3(),h=new dZ;h.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(uX,"-v, --version");h.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(($)=>t8($));h.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>C7());h.command("auto").description("Zero to 100% in one command").action(()=>E7());h.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>wz($));h.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)=>f2($,Z));h.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)=>hX($,Z,z));h.command("show").description("Render project.faf → project.html and open it").action(()=>Xz());h.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(($)=>e8($));h.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>c7($,Z));h.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>d7($,Z));h.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>Qz($));h.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--grok","Wire grok-faf-mcp into .grok/config.toml").option("--conductor","Generate conductor config").option("--html","Generate project.html (visual render of project.faf)").option("--card","Generate MCP Server Card (.well-known/mcp/server-card) with the FAF context-block").option("--all","Generate all formats").action(($)=>t$($));h.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").action(($,Z)=>$3($,Z));h.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(($)=>Yz($));h.command("formats").description("Show supported formats").action(()=>Uz());h.command("clear").description("Clear cached data").action(()=>Gz());h.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Wz($));h.command("context").description("Generate context output").action(()=>qz());h.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(($)=>vX($));h.command("drift").description("Check context drift").action(()=>Kz());h.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>Hz($,Z));h.command("recover").description("Recover .faf from context files").action(()=>Bz());h.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Lz($));h.command("pro [subcommand]").description("Pro features & licensing").action(($)=>Nz($));h.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>Mz($));h.command("demo").description("Demo walkthrough").action(()=>Oz());h.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>Dz($,Z));h.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>Iz($));h.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>wX($));h.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>CX($,Z));h.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(($)=>jX($));h.command("bi-sync",{hidden:!0}).action(()=>e8());h.command("status",{hidden:!0}).action(()=>f2(void 0,{status:!0}));h.command("agents",{hidden:!0}).action(()=>t$({agents:!0}));h.command("cursor",{hidden:!0}).action(()=>t$({cursor:!0}));h.command("gemini",{hidden:!0}).action(()=>t$({gemini:!0}));h.command("grok",{hidden:!0}).action(()=>t$({grok:!0}));h.command("validate",{hidden:!0}).action(($)=>$3($));h.command("yolo",{hidden:!0}).action(()=>t8({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:z}=await Promise.resolve().then(() => (d(),Z7)),X=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",U="\x1B[48;2;29;29;29m",G="\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${uX}`)}`);let W="\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(`${W}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+X)}`),console.log("");try{await f2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${z("faf --help")} ${Z("for commands")}`)})();else h.parse(process.argv);
449
449
 
450
- //# debugId=B35C42FCC11FC33864756E2164756E21
450
+ //# debugId=DBC82539EF0DA7B564756E2164756E21
451
451
  //# sourceMappingURL=cli.js.map