@kitelev/exocortex-cli 16.178.0 → 16.178.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/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v16.178.
|
|
2
|
+
// @kitelev/exocortex-cli v16.178.2
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -484,7 +484,7 @@ Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <
|
|
|
484
484
|
`),console.log(i.formatAnalysis(s,"text"))):(console.log(i.formatAnalysis(s,"text")),process.exit(2));return}let r=new or.ExoQLParser;try{let i=r.parse(n);if(i.type!=="update"){let o=new or.ExoQLAlgebraTranslator().translate(i);if(!e.noOptimize&&o.type!=="construct")o=new or.AlgebraOptimizer().optimize(o);else if(!e.noOptimize&&o.type==="construct"){let c=new or.AlgebraOptimizer,l=o;o={...l,where:c.optimize(l.where)}}}if(t==="json"){let s=tt.success({valid:!0,queryType:Ej(i),message:"Query syntax is valid"});console.log(JSON.stringify(s,null,2))}else console.log("\u2705 Query syntax is valid"),console.log(` Query type: ${Ej(i)}`)}catch(i){Ij(i,n,t)}}a(Fne,"executeDryRun");function Ej(n){return n.type==="update"?"UPDATE":"queryType"in n?n.queryType:"UNKNOWN"}a(Ej,"getQueryType");function Lne(n,e){switch(e){case"json":let t=new F0;console.log(t.format(n));break;case"csv":let r=new L0;console.log(r.format(n));break;case"table":default:let i=new Mu;console.log(i.format(n));break}}a(Lne,"formatSelectResults");function Nne(n,e){let t=new ju;switch(e){case"json":console.log(t.formatJson(n));break;case"ntriples":console.log(t.formatNTriples(n));break;case"table":default:console.log(t.formatTable(n));break}}a(Nne,"formatConstructResults");function kne(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"csv":if(n.length===0){console.log("");return}let t=Object.keys(n[0]);console.log(t.join(","));for(let i of n){let s=t.map(o=>{let c=i[o];return c==null?"":String(c).includes(",")?`"${c}"`:String(c)});console.log(s.join(","))}break;case"table":default:if(n.length===0){console.log("No results.");return}let r=Object.keys(n[0]);console.log(r.join(" ")),console.log(r.map(()=>"---").join(" "));for(let i of n){let s=r.map(o=>String(i[o]??""));console.log(s.join(" "))}break}}a(kne,"formatCachedSelectResults");function Mne(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"ntriples":for(let t of n)console.log(`<${t.subject}> <${t.predicate}> ${jne(t.object)} .`);break;case"table":default:console.log("Subject Predicate Object"),console.log("--- --- ---");for(let t of n)console.log(`${t.subject} ${t.predicate} ${t.object}`);break}}a(Mne,"formatCachedConstructResults");function jne(n){return Q0.formatObject(n)}a(jne,"formatNTriplesObject");function $ne(n,e){for(let t of n){let r=[`${t.type.toUpperCase()}`];switch(t.inserted!==void 0&&r.push(`inserted: ${t.inserted}`),t.deleted!==void 0&&r.push(`deleted: ${t.deleted}`),r.push(t.success?"OK":"FAILED"),e){case"json":console.log(JSON.stringify(t,null,2));break;case"csv":n.indexOf(t)===0&&console.log("type,inserted,deleted,success"),console.log(`${t.type},${t.inserted??""},${t.deleted??""},${t.success}`);break;case"table":default:console.log(`\u2705 ${r.join(" | ")}`);break}}}a($ne,"formatUpdateResults");var Aj=require("fs"),Rj=require("path"),Ws=be(it());function Oj(){return new Le("index").description("Build or refresh the triple cache for faster SPARQL queries").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--stats","Show cache statistics after building").option("--force","Force rebuild even if cache is valid").option("--strict","Fail on first invalid IRI instead of skipping").option("--no-inference","Disable RDFS subClassOf inference materialization").action(async n=>{let e=n.output||"text";ge.setFormat(e);try{let t=(0,Rj.resolve)(n.vault);if(!(0,Aj.existsSync)(t))throw new Qe(t);let r=new zn(t),i=r.getCachePath();n.force&&(e==="text"&&console.log("\u{1F5D1}\uFE0F Invalidating existing cache..."),await r.invalidate()),e==="text"&&console.log(`\u{1F4E6} Building triple cache for: ${t}...`);let s=Date.now(),o=await r.buildCacheWithValidation({strict:n.strict??!1}),c=0;if(n.inference!==!1){let{triples:u}=await r.loadOrBuild(),f=new Ws.InMemoryTripleStore;await f.addAll(u),c=await new Ws.RDFSInferenceEngine().materialize(f);let h=new Ws.NonInheritablePropertyRegistry;await h.initialize(f);let p=new Ws.PropertyCardinalityRegistry;await p.initialize(f);let _=await new Ws.PrototypeChainMaterializer(h,p).materialize(f);if(c+=_,c>0){let S=await f.match();await r.saveTriples(S),o.tripleCount+=c}e==="text"&&c>0&&console.log(`\u{1F9E0} Materialized ${c} inferred triples (RDFS + prototype chain)`)}let l=Date.now()-s;if(e==="json"){let u={action:"build",cachePath:i,tripleCount:o.tripleCount,durationMs:o.durationMs},f={summary:o.summary,skippedFiles:o.skippedFiles};if(n.stats){let d=await r.getCacheStats();if(d){let h={tripleCount:d.tripleCount,createdAt:d.createdAt.toISOString(),isValid:d.isValid,sizeBytes:d.sizeBytes,cachePath:i},p=tt.success({cache:u,stats:h,validation:f},{durationMs:l});console.log(JSON.stringify(p,null,2))}}else{let d=tt.success({cache:u,validation:f},{durationMs:l});console.log(JSON.stringify(d,null,2))}}else{if(o.skippedFiles.length>0){console.log(`
|
|
485
485
|
\u26A0\uFE0F Files skipped due to IRI issues:`);for(let u of o.skippedFiles)console.log(` - ${u.path}`),console.log(` ${u.reason}`);console.log("")}if(console.log(`\u2705 Indexed ${o.summary.indexed} files, skipped ${o.summary.skipped} (total: ${o.summary.total})`),console.log(`\u{1F4CA} Created cache with ${o.tripleCount.toLocaleString()} triples at ${i}`),console.log(`\u23F1\uFE0F Build time: ${o.durationMs}ms`),n.stats){let u=await r.getCacheStats();u&&(console.log(`
|
|
486
486
|
\u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${Une(u.sizeBytes)}`))}}}catch(t){ge.handle(t)}})}a(Oj,"sparqlIndexCommand");function Une(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}a(Une,"formatBytes");var e_=require("fs"),ls=require("path");function Cj(){return new Le("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(n,e)=>{let t=e.output||"text";ge.setFormat(t);try{let r=Date.now();if(!Bne(n))throw new lt(`Invalid UUID format: ${n}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:n});let i=(0,ls.resolve)(e.vault);if(!(0,e_.existsSync)(i))throw new Qe(i);let s=Vne(i,n,e.partial??!1),o=Date.now()-r;if(s.length===0){if(t==="json"){let c=tt.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${n}`,3,{context:{uuid:n}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${n}`);process.exit(1)}e.partial||s.length>1?Gne(s,i,e.format,t,n,o):qne(s[0],i,e.format,t,n,o)}catch(r){ge.handle(r)}})}a(Cj,"resolveCommand");function Bne(n){if(n.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(n)||t.test(n)}a(Bne,"isValidUuidFormat");function Vne(n,e,t){let r=[],i=e.toLowerCase();function s(o){let c=(0,e_.readdirSync)(o,{withFileTypes:!0});for(let l of c){let u=(0,ls.join)(o,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&r.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&r.push(u)}}}return a(s,"walk"),s(n),r}a(Vne,"findFilesWithUuid");function xj(n){return`obsidian://vault/${encodeURI(n)}`}a(xj,"pathToObsidianUri");function Pj(n){let e=n.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,ls.basename)(n,".md")}a(Pj,"extractUuidFromFilename");function qne(n,e,t,r,i,s){let o=(0,ls.relative)(e,n),c=xj(o),l=Pj((0,ls.basename)(n));if(r==="json"){let u={uuid:l,path:o,absolutePath:n,uri:c},f=tt.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(n);break;case"json":console.log(JSON.stringify({uuid:l,path:o,absolutePath:n,uri:c},null,2));break;case"uri":default:console.log(c);break}}a(qne,"outputSingleResult");function Gne(n,e,t,r,i,s){let o=n.map(c=>{let l=(0,ls.relative)(e,c),u=xj(l);return{uuid:Pj((0,ls.basename)(c)),path:l,absolutePath:c,uri:u}});if(r==="json"){let c=tt.success({matches:o,count:o.length},{durationMs:s,searchUuid:i,itemCount:o.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of o)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(o,null,2));break;case"uri":default:for(let c of o)console.log(c.uri);break}}a(Gne,"outputMultipleResults");var lA=require("fs"),us=require("path"),ar=be(it());var Dj=be(it());function t_(n,e){return t=>{let r=typeof t.filePath=="string"&&t.filePath.length>0?t.filePath:null;if(r===null||r.split("/").includes("09 Templates"))return!1;let i=n.getAbstractFileByPath(r);if(i===null||!("basename"in i))return!1;let s=i,o=n.getFrontmatter(s)??{},c=e.getExpectedFolderSync(s,o),l=typeof t.currentFolder=="string"?t.currentFolder:s.parent?.path??"";return(0,Dj.needsFolderRepair)(l,c)}}a(t_,"createIsInWrongFolderHostFunction");var Fj=be(it());function r_(n){return e=>{let t=typeof e.filePath=="string"&&e.filePath.length>0?e.filePath:null;if(t===null||t.split("/").includes("09 Templates"))return!1;let r=n.getAbstractFileByPath(t);if(r===null||!("basename"in r))return!1;let i=r,s=n.getFrontmatter(i)??{};return(0,Fj.hasEmptyProperties)(s)}}a(r_,"createHasEmptyPropertiesHostFunction");var Wne=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function Lj(n){if(typeof n!="string")return null;let e=n.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t!==-1&&(e=e.slice(0,t).trim()),e.length>0?e:null}a(Lj,"cleanRef");function Hne(n){if(!n)return[];let e=n.exo__Instance_class,t=[],r=a(i=>{let s=Lj(i);s&&!t.includes(s)&&t.push(s)},"collect");if(typeof e=="string")r(e);else if(Array.isArray(e))for(let i of e)r(i);return t}a(Hne,"extractClasses");function zne(n){let e=n.match(/\/ontology\/([^#/]+)#(.+)$/);return e?`${e[1]}__${e[2]}`:null}a(zne,"ontologyIriToSymbolic");async function Kne(n,e){let t=await n.match(new ar.IRI(e),ar.Namespace.EXO.term("Instance_class"),void 0),r=[];for(let i of t){let s=typeof i.object.value=="string"?i.object.value:String(i.object),o=zne(s);o&&!r.includes(o)&&r.push(o)}return r}a(Kne,"deriveStoreSymbolicClasses");async function Yne(n){let e=new ar.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),t=await n.match(void 0,e,void 0),r=new Map;for(let i of t){let s=typeof i.subject.value=="string"?i.subject.value:String(i.subject),o=typeof i.object.value=="string"?i.object.value:String(i.object),c=s.match(Wne);c&&o.length>0&&r.set(c[1],o)}return r}a(Yne,"buildCliNameMap");async function Qne(n,e,t=(0,ar.liveClock)()){let r=(0,us.resolve)(n);if(!(0,lA.existsSync)(r))throw new Qe(r);let i=(0,us.resolve)(r,e);if(!(0,lA.existsSync)(i))throw new Error(`Target file not found: ${e}`);let s=(0,us.relative)(r,i);if(s===".."||s.startsWith(`..${us.sep}`)||(0,us.isAbsolute)(s))throw new Error(`Target is outside the vault: ${e} (vault: ${r})`);let o=new Dt(r),l=await new ar.NoteToRDFConverter(o).convertVault(),u=new ar.InMemoryTripleStore;await u.addAll(l);let f=(0,ar.vaultPathToIRI)(s),d=o.getAbstractFileByPath(s),h=d!==null&&"basename"in d?d:null,p=h?o.getFrontmatter(h):null,y=Hne(p),_=await Kne(u,f),S=[...new Set([...y,..._])],w=Lj(p?.exo__Asset_prototype),E=p?.exo__Asset_uid,x=typeof E=="string"?E:void 0,C=await new ar.CommandResolver(u).resolveForAssetMulti(f,S,w??void 0),F=new ar.FolderRepairService(o),X=new ar.PreconditionEvaluator(u,void 0,{clock:t});(0,ar.registerDefaultHostFunctions)(X),X.registerHostFunction("isInWrongFolder",t_(o,F)),X.registerHostFunction("hasObsoleteProperties",r_(o));let U=(0,us.dirname)(s),j={targetIRI:f,filePath:s,fileBasename:h?.basename,currentFolder:U==="."?"":U,assetUid:x},K=await Yne(u),N=await Promise.all(C.map(async ye=>{let Y;try{Y=await X.evaluate(ye.command.precondition,f,j)}catch{Y=!1}return{rc:ye,available:Y}})),le=a(ye=>({id:ye.command.id,label:ye.command.name,cliName:K.get(ye.command.id)??null,category:ye.command.category??null}),"toEntry"),Se=N.filter(ye=>ye.available).map(ye=>le(ye.rc)),Z=N.filter(ye=>!ye.available).map(ye=>({...le(ye.rc),reason:"precondition-false"}));return{target:s,classes:S,prototype:w,visible:Se,hidden:Z}}a(Qne,"resolveButtons");function Xne(n,e){let t=a(r=>`${r.label}${r.cliName?` (${r.cliName})`:""}`,"fmt");if(console.log(`Command buttons on "${n.target}" (${n.visible.length} visible):`),n.visible.length===0)console.log(" (none)");else for(let r of n.visible)console.log(` \u2713 ${t(r)}`);if(e)if(console.log(`
|
|
487
|
-
Hidden by precondition (${n.hidden.length}):`),n.hidden.length===0)console.log(" (none)");else for(let r of n.hidden)console.log(` \u2717 ${t(r)} \u2014 precondition not satisfied`)}a(Xne,"printHuman");function Nj(){return new Le("resolve-buttons").description("Print the actual command button-set for an asset \u2014 binding-match \u2229 precondition-eval (Issue #3833). The authoritative button-visibility oracle; strictly more complete than `apply --dry-run` (precondition-only).").argument("<target>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--json","Emit structured JSON instead of human-readable text").option("--show-hidden","Also list commands that bind but are hidden by their precondition").action(async(n,e)=>{ge.setFormat(e.json?"json":"text");try{let t=await Qne(e.vault,n);if(e.json){let r=e.showHidden?t:{...t,hidden:[]};console.log(JSON.stringify(r,null,2))}else Xne(t,e.showHidden??!1)}catch(t){ge.handle(t),process.exit(5)}})}a(Nj,"resolveButtonsCommand");var Jj=require("fs"),Zj=require("path");var Hs=require("fs"),Go=require("path"),kj=require("child_process"),ut=be(it());var Jne=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),fA=new Map([["exo__","https://exocortex.my/ontology/exo#"],["ems__","https://exocortex.my/ontology/ems#"],["exocmd__","https://exocortex.my/ontology/exocmd#"],["ims__","https://exocortex.my/ontology/ims#"],["exoql__","https://exocortex.my/ontology/exoql#"],["query__","https://exocortex.my/ontology/query#"],["ztlk__","https://exocortex.my/ontology/ztlk#"],["ptms__","https://exocortex.my/ontology/ptms#"],["lit__","https://exocortex.my/ontology/lit#"],["inbox__","https://exocortex.my/ontology/inbox#"],["place__","https://exocortex.my/ontology/place#"],["pn__","https://exocortex.my/ontology/pn#"],["period__","https://exocortex.my/ontology/period#"],["rdf__","http://www.w3.org/1999/02/22-rdf-syntax-ns#"],["rdfs__","http://www.w3.org/2000/01/rdf-schema#"],["owl__","http://www.w3.org/2002/07/owl#"]]);function Zne(n,e){if(!n)return!1;let t=n.exo__Instance_class;if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/),o=s?s[1]:i;if(o===e||o.includes(e))return!0}return!1}a(Zne,"frontmatterMatchesClass");async function Mj(n,e){let t,r=!1;if(e){let s=await new zn(n).loadOrBuild();t=s.triples,r=s.cacheHit}else{let i=new Dt(n);t=await new ut.NoteToRDFConverter(i).convertVault()}return{triples:t,cacheHit:r}}a(Mj,"loadTriplesFromAllVaults");var eie="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function jj(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return n.match(/^---\r?\n---/)?{}:null;let t=e[1].split(`
|
|
487
|
+
Hidden by precondition (${n.hidden.length}):`),n.hidden.length===0)console.log(" (none)");else for(let r of n.hidden)console.log(` \u2717 ${t(r)} \u2014 precondition not satisfied`)}a(Xne,"printHuman");function Nj(){return new Le("resolve-inline-buttons").alias("resolve-buttons").description("Print the actual command button-set for an asset \u2014 binding-match \u2229 precondition-eval (Issue #3833). The authoritative button-visibility oracle; strictly more complete than `apply --dry-run` (precondition-only).").argument("<target>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--json","Emit structured JSON instead of human-readable text").option("--show-hidden","Also list commands that bind but are hidden by their precondition").action(async(n,e)=>{ge.setFormat(e.json?"json":"text");try{let t=await Qne(e.vault,n);if(e.json){let r=e.showHidden?t:{...t,hidden:[]};console.log(JSON.stringify(r,null,2))}else Xne(t,e.showHidden??!1)}catch(t){ge.handle(t),process.exit(5)}})}a(Nj,"resolveButtonsCommand");var Jj=require("fs"),Zj=require("path");var Hs=require("fs"),Go=require("path"),kj=require("child_process"),ut=be(it());var Jne=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),fA=new Map([["exo__","https://exocortex.my/ontology/exo#"],["ems__","https://exocortex.my/ontology/ems#"],["exocmd__","https://exocortex.my/ontology/exocmd#"],["ims__","https://exocortex.my/ontology/ims#"],["exoql__","https://exocortex.my/ontology/exoql#"],["query__","https://exocortex.my/ontology/query#"],["ztlk__","https://exocortex.my/ontology/ztlk#"],["ptms__","https://exocortex.my/ontology/ptms#"],["lit__","https://exocortex.my/ontology/lit#"],["inbox__","https://exocortex.my/ontology/inbox#"],["place__","https://exocortex.my/ontology/place#"],["pn__","https://exocortex.my/ontology/pn#"],["period__","https://exocortex.my/ontology/period#"],["rdf__","http://www.w3.org/1999/02/22-rdf-syntax-ns#"],["rdfs__","http://www.w3.org/2000/01/rdf-schema#"],["owl__","http://www.w3.org/2002/07/owl#"]]);function Zne(n,e){if(!n)return!1;let t=n.exo__Instance_class;if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/),o=s?s[1]:i;if(o===e||o.includes(e))return!0}return!1}a(Zne,"frontmatterMatchesClass");async function Mj(n,e){let t,r=!1;if(e){let s=await new zn(n).loadOrBuild();t=s.triples,r=s.cacheHit}else{let i=new Dt(n);t=await new ut.NoteToRDFConverter(i).convertVault()}return{triples:t,cacheHit:r}}a(Mj,"loadTriplesFromAllVaults");var eie="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function jj(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return n.match(/^---\r?\n---/)?{}:null;let t=e[1].split(`
|
|
488
488
|
`),r={};for(let i of t){let s=i.match(/^(\w[\w]*):\s*(.*)$/);s&&(r[s[1]]=!0)}return r}a(jj,"extractFrontmatter");function $j(n){for(let e of fA.keys())if(n.startsWith(e))return!0;return!1}a($j,"hasKnownPrefix");function Uj(n){for(let[e,t]of fA)if(n.startsWith(e))return t+n.substring(e.length);return null}a(Uj,"keyToURI");function tie(n){let e=[],t=[];for(let r of n)Jne.has(r)||($j(r)?e.push(r):t.push(r));return{toValidate:e,unknownPrefix:t}}a(tie,"classifyKeys");function Bj(n){try{return(0,kj.execSync)("git diff --cached --name-only",{cwd:n,encoding:"utf-8"}).split(`
|
|
489
489
|
`).filter(t=>t.endsWith(".md")&&t.trim().length>0)}catch{return[]}}a(Bj,"getStagedMdFiles");function rie(n){let e=[];function t(r){let i=(0,Hs.readdirSync)(r);for(let s of i){if(s.startsWith(".")||s==="node_modules")continue;let o=(0,Go.join)(r,s);(0,Hs.statSync)(o).isDirectory()?t(o):s.endsWith(".md")&&e.push((0,Go.relative)(n,o))}}return a(t,"walk"),t(n),e}a(rie,"collectMdFiles");function nie(n){let e=n.lastIndexOf("/");if(e===-1)return null;let t=decodeURIComponent(n.substring(e+1));return t.endsWith(".md")&&(t=t.slice(0,-3)),$j(t)?t:null}a(nie,"extractPropertyNameFromURI");async function iie(n){let e=new ut.InMemoryTripleStore;await e.addAll(n);let t=new ut.ExoQLParser,r=qu(`SELECT ?s ?label WHERE {
|
|
490
490
|
{
|
|
@@ -613,7 +613,7 @@ Duplicate bindings (${n.duplicates.length}) \u2014 uid claimed by >1 test (warni
|
|
|
613
613
|
Skipped floor check for ${n.unknownPriority} requirement(s) with unparseable priority (fail-open).`),n.clean?e==="hard"&&!n.rampReady?console.error(`
|
|
614
614
|
FAIL (hard gate): ramp not ready \u2014 ${n.p0Orphans} P0 requirement(s) unbound`+(n.p0Total===0?" (no P0 requirements found)":"")+"."):console.log(`
|
|
615
615
|
OK: no hard findings (dangling tags + binding-class floor are clean).`):console.error(`
|
|
616
|
-
FAIL: ${n.dangling.length} dangling + ${n.floorViolations.length} floor violation(s) + ${n.activeViolations.length} active-requirement invariant violation(s) + ${n.danglingEvidence.length} dangling evidence link(s).`)}a(Uoe,"renderText");function Boe(n,e,t){return!n.clean||t&&n.orphans.length>0||e==="hard"&&!n.rampReady}a(Boe,"isHardFail");function V9(){return new Le("audit").description("Audit requirement\u2194test traceability: orphans, dangling @req tags, duplicate bindings, binding-class floor, coverage, P0 ramp-readiness").requiredOption("--reqs <path>","Directory tree containing req__Requirement assets (a vault or a reqs assetspace clone)").option("--tests <path>","Test-corpus root scanned for @req:<uid> tags",".").option("--output <type>","Response format: text|json","text").option("--strict","Also exit 1 on orphan requirements",!1).option("--gate <mode>","Gate mode: soft (warn only on hard findings) | hard (also block when the P0 checklist is not ramp-ready)","soft").action(async n=>{let e=n.output??"text";ge.setFormat(e);let t=n.gate==="hard"?"hard":"soft";try{let r=(0,Va.resolve)(n.reqs);if(!(0,qa.existsSync)(r)||!(0,qa.statSync)(r).isDirectory())throw new Qe(r);let i=(0,Va.resolve)(n.tests??".");if(!(0,qa.existsSync)(i)||!(0,qa.statSync)(i).isDirectory())throw new Qe(i);let[s,o]=await Promise.all([Noe(r),Moe(i)]),c=joe(s,o);e==="json"?console.log(JSON.stringify({...c,gate:t},null,2)):Uoe(c,t),Boe(c,t,n.strict===!0)&&(process.exitCode=1)}catch(r){ge.handle(r)}})}a(V9,"requirementsAuditCommand");function q9(){let n=new Le("requirements").description("Requirements-management tooling (RFC 0003): traceability checker");return n.addCommand(V9()),n}a(q9,"requirementsCommand");function F_(n){let e=new Le;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.178.
|
|
616
|
+
FAIL: ${n.dangling.length} dangling + ${n.floorViolations.length} floor violation(s) + ${n.activeViolations.length} active-requirement invariant violation(s) + ${n.danglingEvidence.length} dangling evidence link(s).`)}a(Uoe,"renderText");function Boe(n,e,t){return!n.clean||t&&n.orphans.length>0||e==="hard"&&!n.rampReady}a(Boe,"isHardFail");function V9(){return new Le("audit").description("Audit requirement\u2194test traceability: orphans, dangling @req tags, duplicate bindings, binding-class floor, coverage, P0 ramp-readiness").requiredOption("--reqs <path>","Directory tree containing req__Requirement assets (a vault or a reqs assetspace clone)").option("--tests <path>","Test-corpus root scanned for @req:<uid> tags",".").option("--output <type>","Response format: text|json","text").option("--strict","Also exit 1 on orphan requirements",!1).option("--gate <mode>","Gate mode: soft (warn only on hard findings) | hard (also block when the P0 checklist is not ramp-ready)","soft").action(async n=>{let e=n.output??"text";ge.setFormat(e);let t=n.gate==="hard"?"hard":"soft";try{let r=(0,Va.resolve)(n.reqs);if(!(0,qa.existsSync)(r)||!(0,qa.statSync)(r).isDirectory())throw new Qe(r);let i=(0,Va.resolve)(n.tests??".");if(!(0,qa.existsSync)(i)||!(0,qa.statSync)(i).isDirectory())throw new Qe(i);let[s,o]=await Promise.all([Noe(r),Moe(i)]),c=joe(s,o);e==="json"?console.log(JSON.stringify({...c,gate:t},null,2)):Uoe(c,t),Boe(c,t,n.strict===!0)&&(process.exitCode=1)}catch(r){ge.handle(r)}})}a(V9,"requirementsAuditCommand");function q9(){let n=new Le("requirements").description("Requirements-management tooling (RFC 0003): traceability checker");return n.addCommand(V9()),n}a(q9,"requirementsCommand");function F_(n){let e=new Le;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.178.2"),e.addCommand($4()),e.addCommand(z4()),e.addCommand(Tj()),e.addCommand(Oj()),e.addCommand(e4()),e.addCommand(Cj()),e.addCommand(Nj()),e.addCommand(a4()),e.addCommand(d4()),e.addCommand(S4()),e.addCommand(v4()),e.addCommand(k4()),e.addCommand(l9()),e.addCommand(d9()),e.addCommand(O9()),e.addCommand(x9()),e.addCommand(F9()),e.addCommand(L9()),e.addCommand(j9()),e.addCommand(b9()),e.addCommand(I9()),e.addCommand(q9()),e}a(F_,"createProgram");F_().parse();0&&(module.exports={createProgram});
|
|
617
617
|
/*! Bundled license information:
|
|
618
618
|
|
|
619
619
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED