faf-cli 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4 -4
- package/dist/cli.js.map +4 -4
- package/package.json +1 -1
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)){Array.prototype.push.apply(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(G$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=o$(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(G$(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(_9(Z.key)&&!G$(Z.sep,"newline")){let Q=o$(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(G$(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&&!G$(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)){Array.prototype.push.apply(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||G$(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=n2(X),J=o$(z);F9($);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=n2($),X=o$(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=n2($),X=o$(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()}}}sH.Parser=P9});var S9=F((JB)=>{var C9=e8(),oH=$4(),Y4=Z4(),tH=G8(),eH=d(),$B=G3(),w9=q3();function E9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new $B.LineCounter||null,prettyErrors:Z}}function ZB($,Z={}){let{lineCounter:X,prettyErrors:z}=E9(Z),J=new w9.Parser(X?.addNewLine),Q=new C9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let W of Y)W.errors.forEach(Y4.prettifyError($,X)),W.warnings.forEach(Y4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function j9($,Z={}){let{lineCounter:X,prettyErrors:z}=E9(Z),J=new w9.Parser(X?.addNewLine),Q=new C9.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 Y4.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(Y4.prettifyError($,X)),Y.warnings.forEach(Y4.prettifyError($,X));return Y}function XB($,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=j9($,X);if(!J)return null;if(J.warnings.forEach((Q)=>tH.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 zB($,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(eH.isDocument($)&&!z)return $.toString(X);return new oH.Document($,z,X).toString(X)}JB.parse=XB;JB.parseAllDocuments=ZB;JB.parseDocument=j9;JB.stringify=zB});var v9={};Y5(v9,{orange:()=>H0,italic:()=>sB,fafCyanDeep:()=>s2,fafCyan:()=>D,dim:()=>L,bold:()=>I,FAF_HEX:()=>W4});var B3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,I,L,sB,W4,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,s2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,H0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var c=x(()=>{I=B3("1"),L=B3("2"),sB=B3("3"),W4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var f3=F((DP,JO)=>{JO.exports={name:"faf-cli",version:"7.0.1",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 _($,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 M($,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 a0=()=>{};var h3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return h3=$.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 o0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var M4=($)=>{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 S,J0,K0,H$,K1,H1,B1,L1,M1,N1,O1,T1,D1;var O0=x(()=>{S=class S extends Error{};J0=class J0 extends S{constructor($,Z,X,z,J){super(`${J0.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 H$({message:X,cause:M4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new H1($,J,X,z,Q);if($===401)return new B1($,J,X,z,Q);if($===403)return new L1($,J,X,z,Q);if($===404)return new M1($,J,X,z,Q);if($===409)return new N1($,J,X,z,Q);if($===422)return new O1($,J,X,z,Q);if($===429)return new T1($,J,X,z,Q);if($>=500)return new D1($,J,X,z,Q);return new J0($,J,X,z,Q)}};K0=class K0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};H$=class H$ extends J0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};K1=class K1 extends H${constructor({message:$}={}){super({message:$??"Request timed out."})}};H1=class H1 extends J0{};B1=class B1 extends J0{};L1=class L1 extends J0{};M1=class M1 extends J0{};N1=class N1 extends J0{};O1=class O1 extends J0{};T1=class T1 extends J0{};D1=class D1 extends J0{}});function N6($){if(typeof $!=="object")return{};return $??{}}function c3($){if(!$)return!0;for(let Z in $)return!1;return!0}function gz($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var gO,fz=($)=>{return gO.test($)},u3=($)=>(u3=Array.isArray,u3($)),m3,vz=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new S(`${$} must be an integer`);if(Z<0)throw new S(`${$} must be a positive integer`);return Z},O6=($)=>{try{return JSON.parse($)}catch(Z){return}};var b$=x(()=>{O0();gO=/^[a-z][a-z0-9+.-]*:/i,m3=u3});var hz=($)=>new Promise((Z)=>setTimeout(Z,$));var B$="0.91.1";function vO(){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 uO(){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 dz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},hO=()=>{let $=vO();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"X-Stainless-OS":mz(Deno.build.os),"X-Stainless-Arch":uz(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":B$,"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":B$,"X-Stainless-OS":mz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":uz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=uO();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"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":B$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},uz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},mz=($)=>{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"},cz,pz=()=>{return cz??(cz=hO())};var d3=()=>{};function lz(){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 p3(...$){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 T6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return p3({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 N4($){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 iz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var nz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function rz($){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 S(`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 sz=x(()=>{O0()});function tz($){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 O4($){let Z;return(az??(Z=new globalThis.TextEncoder,az=Z.encode.bind(Z)))($)}function l3($){let Z;return(oz??(Z=new globalThis.TextDecoder,oz=Z.decode.bind(Z)))($)}var az,oz;class L${constructor(){F0.set(this,void 0),_0.set(this,void 0),_(this,F0,new Uint8Array,"f"),_(this,_0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?O4($):$;_(this,F0,tz([M(this,F0,"f"),Z]),"f");let X=[],z;while((z=dO(M(this,F0,"f"),M(this,_0,"f")))!=null){if(z.carriage&&M(this,_0,"f")==null){_(this,_0,z.index,"f");continue}if(M(this,_0,"f")!=null&&(z.index!==M(this,_0,"f")+1||z.carriage)){X.push(l3(M(this,F0,"f").subarray(0,M(this,_0,"f")-1))),_(this,F0,M(this,F0,"f").subarray(M(this,_0,"f")),"f"),_(this,_0,null,"f");continue}let J=M(this,_0,"f")!==null?z.preceding-1:z.preceding,Q=l3(M(this,F0,"f").subarray(0,J));X.push(Q),_(this,F0,M(this,F0,"f").subarray(z.index),"f"),_(this,_0,null,"f")}return X}flush(){if(!M(this,F0,"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=n2($),X=o$(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=n2($),X=o$(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()}}}sH.Parser=P9});var S9=F((JB)=>{var C9=e8(),oH=$4(),Y4=Z4(),tH=G8(),eH=d(),$B=G3(),w9=q3();function E9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new $B.LineCounter||null,prettyErrors:Z}}function ZB($,Z={}){let{lineCounter:X,prettyErrors:z}=E9(Z),J=new w9.Parser(X?.addNewLine),Q=new C9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let W of Y)W.errors.forEach(Y4.prettifyError($,X)),W.warnings.forEach(Y4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function j9($,Z={}){let{lineCounter:X,prettyErrors:z}=E9(Z),J=new w9.Parser(X?.addNewLine),Q=new C9.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 Y4.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(Y4.prettifyError($,X)),Y.warnings.forEach(Y4.prettifyError($,X));return Y}function XB($,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=j9($,X);if(!J)return null;if(J.warnings.forEach((Q)=>tH.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 zB($,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(eH.isDocument($)&&!z)return $.toString(X);return new oH.Document($,z,X).toString(X)}JB.parse=XB;JB.parseAllDocuments=ZB;JB.parseDocument=j9;JB.stringify=zB});var v9={};Y5(v9,{orange:()=>H0,italic:()=>sB,fafCyanDeep:()=>s2,fafCyan:()=>D,dim:()=>L,bold:()=>I,FAF_HEX:()=>W4});var B3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,I,L,sB,W4,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,s2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,H0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var c=x(()=>{I=B3("1"),L=B3("2"),sB=B3("3"),W4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var f3=F((DP,JO)=>{JO.exports={name:"faf-cli",version:"7.0.2",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 _($,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 M($,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 a0=()=>{};var h3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return h3=$.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 o0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var M4=($)=>{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 S,J0,K0,H$,K1,H1,B1,L1,M1,N1,O1,T1,D1;var O0=x(()=>{S=class S extends Error{};J0=class J0 extends S{constructor($,Z,X,z,J){super(`${J0.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 H$({message:X,cause:M4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new H1($,J,X,z,Q);if($===401)return new B1($,J,X,z,Q);if($===403)return new L1($,J,X,z,Q);if($===404)return new M1($,J,X,z,Q);if($===409)return new N1($,J,X,z,Q);if($===422)return new O1($,J,X,z,Q);if($===429)return new T1($,J,X,z,Q);if($>=500)return new D1($,J,X,z,Q);return new J0($,J,X,z,Q)}};K0=class K0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};H$=class H$ extends J0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};K1=class K1 extends H${constructor({message:$}={}){super({message:$??"Request timed out."})}};H1=class H1 extends J0{};B1=class B1 extends J0{};L1=class L1 extends J0{};M1=class M1 extends J0{};N1=class N1 extends J0{};O1=class O1 extends J0{};T1=class T1 extends J0{};D1=class D1 extends J0{}});function N6($){if(typeof $!=="object")return{};return $??{}}function c3($){if(!$)return!0;for(let Z in $)return!1;return!0}function gz($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var gO,fz=($)=>{return gO.test($)},u3=($)=>(u3=Array.isArray,u3($)),m3,vz=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new S(`${$} must be an integer`);if(Z<0)throw new S(`${$} must be a positive integer`);return Z},O6=($)=>{try{return JSON.parse($)}catch(Z){return}};var b$=x(()=>{O0();gO=/^[a-z][a-z0-9+.-]*:/i,m3=u3});var hz=($)=>new Promise((Z)=>setTimeout(Z,$));var B$="0.91.1";function vO(){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 uO(){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 dz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},hO=()=>{let $=vO();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"X-Stainless-OS":mz(Deno.build.os),"X-Stainless-Arch":uz(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":B$,"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":B$,"X-Stainless-OS":mz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":uz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=uO();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"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":B$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},uz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},mz=($)=>{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"},cz,pz=()=>{return cz??(cz=hO())};var d3=()=>{};function lz(){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 p3(...$){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 T6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return p3({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 N4($){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 iz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var nz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function rz($){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 S(`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 sz=x(()=>{O0()});function tz($){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 O4($){let Z;return(az??(Z=new globalThis.TextEncoder,az=Z.encode.bind(Z)))($)}function l3($){let Z;return(oz??(Z=new globalThis.TextDecoder,oz=Z.decode.bind(Z)))($)}var az,oz;class L${constructor(){F0.set(this,void 0),_0.set(this,void 0),_(this,F0,new Uint8Array,"f"),_(this,_0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?O4($):$;_(this,F0,tz([M(this,F0,"f"),Z]),"f");let X=[],z;while((z=dO(M(this,F0,"f"),M(this,_0,"f")))!=null){if(z.carriage&&M(this,_0,"f")==null){_(this,_0,z.index,"f");continue}if(M(this,_0,"f")!=null&&(z.index!==M(this,_0,"f")+1||z.carriage)){X.push(l3(M(this,F0,"f").subarray(0,M(this,_0,"f")-1))),_(this,F0,M(this,F0,"f").subarray(M(this,_0,"f")),"f"),_(this,_0,null,"f");continue}let J=M(this,_0,"f")!==null?z.preceding-1:z.preceding,Q=l3(M(this,F0,"f").subarray(0,J));X.push(Q),_(this,F0,M(this,F0,"f").subarray(z.index),"f"),_(this,_0,null,"f")}return X}flush(){if(!M(this,F0,"f").length)return[];return this.decode(`
|
|
166
166
|
`)}}function dO($,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 ez($){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 F0,_0;var i3=x(()=>{a0();F0=new WeakMap,_0=new WeakMap;L$.NEWLINE_CHARS=new Set([`
|
|
167
167
|
`,"\r"]);L$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function T4(){}function D6($,Z,X){if(!Z||I6[$]>I6[X])return T4;else return Z[$].bind(Z)}function V0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return pO;let z=$J.get(Z);if(z&&z[0]===X)return z[1];let J={error:D6("error",Z,X),warn:D6("warn",Z,X),info:D6("info",Z,X),debug:D6("debug",Z,X)};return $J.set(Z,[X,J]),J}var I6,n3=($,Z,X)=>{if(!$)return;if(gz(I6,$))return $;V0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(I6))}`);return},pO,$J,t0=($)=>{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 A6=x(()=>{b$();I6={off:0,error:200,warn:300,info:400,debug:500};pO={error:T4,warn:T4,info:T4,debug:T4},$J=new WeakMap});async function*lO($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new S("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 S("Attempted to iterate over a response with no body")}let X=new ZJ,z=new L$,J=N4($.body);for await(let Q of iO(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*iO($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?O4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=ez(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class ZJ{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]=nO($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function nO($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var D4,P0;var r3=x(()=>{a0();O0();i3();b$();A6();O0();P0=class P0{constructor($,Z,X){this.iterator=$,D4.set(this,void 0),this.controller=Z,_(this,D4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?V0(X):console;async function*Q(){if(z)throw new S("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let W of lO($,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=O6(W.data)??W.data,G=U?.error?.type;throw new J0(void 0,U,void 0,$.headers,G)}}Y=!0}catch(W){if(o0(W))return;throw W}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new L$,W=N4($);for await(let U of W)for(let G of Y.decode(U))yield G;for(let U of Y.flush())yield U}async function*Q(){if(z)throw new S("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(o0(W))return;throw W}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}[(D4=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 P0(()=>z($),this.controller,M(this,D4,"f")),new P0(()=>z(Z),this.controller,M(this,D4,"f"))]}toReadableStream(){let $=this,Z;return p3({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=O4(JSON.stringify(z)+`
|
|
@@ -329,7 +329,7 @@ Rendered on-demand from your current <strong>${W1(X)}</strong><br>
|
|
|
329
329
|
Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=j3($.in??"./server.json");if(!rX(z))console.error(`Error: ${z} not found.
|
|
330
330
|
|
|
331
331
|
'faf server-card' patches the identity into an existing registry server.json;
|
|
332
|
-
it does not create packages/icons. Seed a server.json first, then run this.`),process.exit(2);let J=JSON.parse(DN(z,"utf-8")),Y=J._meta?.[w3]?.["one.faf/context"]?.generated,W=$.generated??Y,U=iX(X),G=E3(X),q=lX(X,{fafPointer:"./project.faf",now:W}),V={...J,name:U,...$.
|
|
332
|
+
it does not create packages/icons. Seed a server.json first, then run this.`),process.exit(2);let J=JSON.parse(DN(z,"utf-8")),Y=J._meta?.[w3]?.["one.faf/context"]?.generated,W=$.generated??Y,U=iX(X),G=E3(X),q=lX(X,{fafPointer:"./project.faf",now:W}),V={...J,name:U,...$.setVersion?{version:$.setVersion}:{},_meta:{...J._meta??{},...q}};if(G)V.title=G;else delete V.title;let K={};for(let B of AN)if(B in V&&V[B]!==void 0)K[B]=V[B];for(let B of Object.keys(V))if(!(B in K)&&V[B]!==void 0)K[B]=V[B];let H=JSON.stringify(K,null,2)+`
|
|
333
333
|
`;if($.check){process.stdout.write(H);return}let T=j3($.out??z);IN(T,H),console.error(`${D("✓")} ${T} — name=${U} title=${G??"(none)"} ${L("(identity emitted from faf-cli)")}`)}import{join as RN}from"path";import FN from"open";c();function _N($){if(process.env.CI)return!1;try{return FN($).catch(()=>{return}),!0}catch{return!1}}function aX(){let $=g();if(!$)console.error(`Error: project.faf not found
|
|
334
334
|
|
|
335
335
|
Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=m($),z=X0(h($));q6(Z,X,z,$);let J=RN(Z,"project.html"),Q=_N(J);console.log(" project.html"),console.log(Q?`${D("opened")} ${L("in your browser")}`:`${D("rendered")} ${L(`file://${J}`)}`)}import{mkdirSync as PN,rmSync as CN,existsSync as wN}from"fs";import{join as oX,resolve as EN}from"path";import{execFileSync as jN}from"child_process";import{tmpdir as SN}from"os";c();function xN($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let X=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=X.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(X))return`${X}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function bN($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function kN($,Z,X){return["clone","--depth","1",...X?["--branch",X]:[],"--",$,Z]}function yN($,Z=process.cwd()){if($.stdout)return{outputPath:null};let X=$.output?EN(Z,$.output):oX(Z,"project.faf");if(wN(X)&&!$.force)throw Error(`${X} already exists — refusing to overwrite your context.
|
|
@@ -515,8 +515,8 @@ ${I("faf bench — agent-native protocol")} ${L(`qset ${Q.qsetHash} · ${Q.ques
|
|
|
515
515
|
`),console.log(L("Grading is mechanical against your own project.faf — the .faf IS the answer key.")),console.log(L(`Receipts carry protocol: in-session (honor-system cold). qset ${Q.qsetHash}.`))}import{existsSync as LD,writeFileSync as MD}from"fs";c();function sJ($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
|
|
516
516
|
|
|
517
517
|
Run 'faf init' to create one.`),process.exit(2);let X=h(Z),z=X0(X),J=new r0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,W=Y!=null?z.score-Y:0,U=Y!=null&&W!==0,G=Z.replace(/\.faf$/,".fafb"),q=null;if(LD(G)){let V=a2(X);MD(G,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:z.score,tier:z.tier,baseline:Y,delta:W,drifted:U,fafb:q!=null?{reCompiled:!0,bytes:q}:{reCompiled:!1},journey:J.getJourney()||null},null,2));else{if(console.log(`${D("refresh")} ${L("— re-grounding on the live .faf")}
|
|
518
|
-
`),U){let V=W>0?"↑":"↓";console.log(` drift: ${L(`${Y}%`)} ${V} ${I(`${z.score}%`)} ${L(`(${W>0?"+":""}${W})`)}`)}else if(Y!=null)console.log(` no drift ${L(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${L(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${L(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${k0(z.tier)} ${I(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:aJ}=f3(),f=new F5;f.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(aJ,"-v, --version");f.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(($)=>R3($));f.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>qX());f.command("auto").description("Zero to 100% in one command").action(()=>z6());f.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(($)=>KX($));f.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>yz($));f.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)=>o2($,Z));f.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)=>rJ($,Z,X));f.command("show").description("Render project.faf → project.html and open it").action(()=>aX());f.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(($)=>P3($));f.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>_X($,Z));f.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>PX($,Z));f.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)=>tX($,Z));f.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)=>Uz($,Z));f.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>Yz($??[]));f.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(($)=>Gz($));f.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(($)=>Mz($));f.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(($)=>Lz($));f.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--copilot","Generate .github/copilot-instructions.md (GitHub Copilot)").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(($)=>U1($));f.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("--version <version>","Set the version field (default: preserve existing)").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(($)=>sX($));f.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)=>C3($,Z));f.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(($)=>Nz($));f.command("formats").description("Show supported formats").action(()=>Oz());f.command("clear").description("Clear cached data").action(()=>Tz());f.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Dz($));f.command("context").description("Generate context output").action(()=>Iz());f.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(($)=>sJ($));f.command("drift").description("Check context drift").action(()=>Rz());f.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>Fz($,Z));f.command("recover").description("Recover .faf from context files").action(()=>_z());f.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Pz($));f.command("pro [subcommand]").description("Pro features & licensing").action(($)=>Cz($));f.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>wz($));f.command("demo").description("Demo walkthrough").action(()=>jz());f.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>Sz($,Z));f.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)=>bz($,Z));f.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>yJ($));f.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>vJ($,Z));f.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(($)=>uJ($));f.command("bi-sync",{hidden:!0}).action(()=>P3());f.command("status",{hidden:!0}).action(()=>o2(void 0,{status:!0}));f.command("agents",{hidden:!0}).action(()=>U1({agents:!0}));f.command("cursor",{hidden:!0}).action(()=>U1({cursor:!0}));f.command("gemini",{hidden:!0}).action(()=>U1({gemini:!0}));f.command("grok",{hidden:!0}).action(()=>U1({grok:!0}));f.command("validate",{hidden:!0}).action(($)=>C3($));f.command("yolo",{hidden:!0}).action(()=>R3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (c(),v9)),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${aJ}`)}`);let G="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await o2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else f.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(`
|
|
518
|
+
`),U){let V=W>0?"↑":"↓";console.log(` drift: ${L(`${Y}%`)} ${V} ${I(`${z.score}%`)} ${L(`(${W>0?"+":""}${W})`)}`)}else if(Y!=null)console.log(` no drift ${L(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${L(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${L(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${k0(z.tier)} ${I(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:aJ}=f3(),f=new F5;f.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(aJ,"-v, --version");f.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(($)=>R3($));f.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>qX());f.command("auto").description("Zero to 100% in one command").action(()=>z6());f.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(($)=>KX($));f.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>yz($));f.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)=>o2($,Z));f.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)=>rJ($,Z,X));f.command("show").description("Render project.faf → project.html and open it").action(()=>aX());f.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(($)=>P3($));f.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>_X($,Z));f.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>PX($,Z));f.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)=>tX($,Z));f.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)=>Uz($,Z));f.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>Yz($??[]));f.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(($)=>Gz($));f.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(($)=>Mz($));f.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(($)=>Lz($));f.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--copilot","Generate .github/copilot-instructions.md (GitHub Copilot)").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(($)=>U1($));f.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(($)=>sX($));f.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)=>C3($,Z));f.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(($)=>Nz($));f.command("formats").description("Show supported formats").action(()=>Oz());f.command("clear").description("Clear cached data").action(()=>Tz());f.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Dz($));f.command("context").description("Generate context output").action(()=>Iz());f.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(($)=>sJ($));f.command("drift").description("Check context drift").action(()=>Rz());f.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>Fz($,Z));f.command("recover").description("Recover .faf from context files").action(()=>_z());f.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Pz($));f.command("pro [subcommand]").description("Pro features & licensing").action(($)=>Cz($));f.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>wz($));f.command("demo").description("Demo walkthrough").action(()=>jz());f.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>Sz($,Z));f.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)=>bz($,Z));f.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>yJ($));f.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>vJ($,Z));f.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(($)=>uJ($));f.command("bi-sync",{hidden:!0}).action(()=>P3());f.command("status",{hidden:!0}).action(()=>o2(void 0,{status:!0}));f.command("agents",{hidden:!0}).action(()=>U1({agents:!0}));f.command("cursor",{hidden:!0}).action(()=>U1({cursor:!0}));f.command("gemini",{hidden:!0}).action(()=>U1({gemini:!0}));f.command("grok",{hidden:!0}).action(()=>U1({grok:!0}));f.command("validate",{hidden:!0}).action(($)=>C3($));f.command("yolo",{hidden:!0}).action(()=>R3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (c(),v9)),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${aJ}`)}`);let G="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await o2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else f.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(`
|
|
519
519
|
`)),f.parse(process.argv);
|
|
520
520
|
|
|
521
|
-
//# debugId=
|
|
521
|
+
//# debugId=46C1B5B4E266B6CF64756E2164756E21
|
|
522
522
|
//# sourceMappingURL=cli.js.map
|