@kitelev/exocortex-cli 16.52.6 → 16.52.7
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 +2 -2
- 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.52.
|
|
2
|
+
// @kitelev/exocortex-cli v16.52.7
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -769,7 +769,7 @@ ${r}`}a(dZ,"serializeFile");function jN(n,e,t={}){let r=Iy.default.dirname(n),i=
|
|
|
769
769
|
\u{1F4CA} Applied to ${p}/${h.length} target(s) (${g} failed).`),g>0&&process.exit(5)}catch(r){oe.handle(r),process.exit(5)}})}a(rL,"applyCommand");var pa=require("fs"),_u=require("path");var nL=/^---\s*$/,YZ=/^exocmd__Grounding_type:\s*(.+?)\s*$/,QZ=/^"?\[\[[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?:\|[^\]]*)?\]\]"?$/i,KZ=new Set(["node_modules"]);function XZ(n){return n.startsWith(".")||KZ.has(n)}a(XZ,"shouldSkipDir");function*iL(n){let e;try{e=(0,pa.readdirSync)(n,{withFileTypes:!0})}catch(t){let r=t;if(r.code==="EPERM"||r.code==="EACCES"||r.code==="ENOENT")return;throw t}for(let t of e){let r=(0,_u.join)(n,t.name);if(t.isDirectory()){if(XZ(t.name))continue;yield*iL(r)}else t.isFile()&&t.name.endsWith(".md")&&(yield r)}}a(iL,"walkMarkdownFiles");function JZ(n){let e=n.split(/\r?\n/);if(e.length<2||!nL.test(e[0]))return null;for(let t=1;t<e.length;t++)if(nL.test(e[t]))return{lines:e.slice(1,t),startLine:2};return null}a(JZ,"extractFrontmatter");function ZZ(n){let e=n.trim();return e===""||e==="null"||e==="~"?!1:!QZ.test(e)}a(ZZ,"isLiteralForm");function eee(n){let e=[];for(let t of iL(n)){let r;try{r=(0,pa.readFileSync)(t,"utf-8")}catch{continue}let i=JZ(r);if(i)for(let s=0;s<i.lines.length;s++){let o=i.lines[s].match(YZ);if(!o)continue;let l=o[1];ZZ(l)&&e.push({path:(0,_u.relative)(n,t),line:i.startLine+s,value:l})}}return e}a(eee,"scanVaultForLiteralForm");function sL(){return new fe("grounding-type-literal-form").description("Detect post-Phase-4+1 regressions: any exocmd__Grounding_type literal-string form (not wikilink) in vault frontmatter").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(n=>{let e=n.output??"text";oe.setFormat(e);try{let t=(0,_u.resolve)(n.vault);if(!(0,pa.existsSync)(t)||!(0,pa.statSync)(t).isDirectory())throw new Pe(t);let r=eee(t);if(e==="json")console.log(JSON.stringify({vaultPath:t,violationCount:r.length,violations:r,clean:r.length===0},null,2));else if(r.length===0)console.log(`OK ${t}: 0 exocmd__Grounding_type literal-form violations`);else{console.error(`FAIL ${t}: ${r.length} exocmd__Grounding_type literal-form violation(s):`);for(let i of r)console.error(` ${i.path}:${i.line} \u2014 value: ${i.value}`);console.error("\nRFC 9d20c91f Phase 3 migrated all values to wikilink form `[[<uid>]]`. Re-run the Phase 3 migration script or hand-edit offending files.")}r.length>0&&(process.exitCode=1)}catch(t){oe.handle(t)}})}a(sL,"auditGroundingTypeLiteralFormCommand");function oL(){let n=new fe("audit").description("Audit vault for regression patterns (RFC cutover detectors)");return n.addCommand(sL()),n}a(oL,"auditCommand");var aL=require("fs"),lL=require("path");var tee=a(n=>{process.stderr.write(`${n}
|
|
770
770
|
`)},"DEFAULT_LOG"),Dy=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??tee}async confirmHardSwitch(e){if(this.verbose){let t=Array.from(e.filesToDestroy.values()).reduce((r,i)=>r+i.length,0);this.log(`[hard-switch] Target: ${e.targetProfileLabel} (${e.targetProfileUid})`),this.log(`[hard-switch] Source: ${e.sourceProfileLabel}`),this.log(`[hard-switch] ${t} files to remove, ${e.assetSpacesBeingTornDown.length} AS to tear down, ${e.assetSpacesBeingMaterialized.length} AS to materialize`)}return this.yes?!0:(this.log("[hard-switch] Refused: --yes flag required for headless mode (Decision #2 safety)."),!1)}};var ree="[hard-switch] CLI command scaffolded. hardSwitchProfile() implementation pending Phase 3.";function nee(n,e){return{targetProfileUid:n,targetProfileLabel:e,sourceProfileUid:null,sourceProfileLabel:"<unknown>",filesToDestroy:new Map,assetSpacesBeingTornDown:[],assetSpacesBeingMaterialized:[]}}a(nee,"buildScaffoldPlan");async function iee(n,e,t={}){let r=[],i=[],s=t.out??(_=>process.stdout.write(`${_}
|
|
771
771
|
`)),o=t.err??(_=>process.stderr.write(`${_}
|
|
772
|
-
`)),l=a(_=>{r.push(_),s(_)},"out"),c=a(_=>{i.push(_),o(_)},"err");if(!e.vault)throw new It("--vault is required");let u=(0,lL.resolve)(e.vault);if(!(0,aL.existsSync)(u))throw new Pe(u);if(!n||n.length===0)throw new It("profile-uid argument is required","exocortex hard-switch <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new lu({vaultPath:u,warn:a(_=>c(_),"warn")})).resolveFilter(n);if(d.outcome==="missing-profile")throw new It(`Profile not found: ${n}`,"Run `exocortex find --class exo__FocusProfile` to list available profiles");if(d.outcome==="error")return c(`[hard-switch] Resolver error: ${d.reason}`),{exitCode:5,stdout:r,stderr:i};if(d.outcome==="degraded")return c(`[hard-switch] Refused: profile resolution degraded \u2014 ${d.reason}. Hard switch aborted to prevent vault corruption.`),{exitCode:5,stdout:r,stderr:i};let h=t.confirmGate??new Dy({yes:e.yes??!1,verbose:e.verbose??!1,log:a(_=>c(_),"log")}),p=nee(n,n);return await h.confirmHardSwitch(p)?(l(ree),{exitCode:0,stdout:r,stderr:i}):{exitCode:0,stdout:r,stderr:i}}a(iee,"runHardSwitch");function cL(){return new fe("hard-switch").description("Hard switch to specified FocusProfile (filesystem mutation, Phase 3+). Requires --yes for headless mode.").argument("<profile-uid>","Target FocusProfile UID").requiredOption("--vault <path>","Path to Obsidian vault").option("--yes","Confirm hard switch (headless mode safety override per RFC 22b50a17 Decision #2)",!1).option("--verbose","Print plan summary to stderr before deciding",!1).action(async(e,t)=>{try{let r=await iee(e,t);process.exit(r.exitCode)}catch(r){oe.handle(r)}})}a(cL,"hardSwitchCommand");function uL(n){let e=new fe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.52.
|
|
772
|
+
`)),l=a(_=>{r.push(_),s(_)},"out"),c=a(_=>{i.push(_),o(_)},"err");if(!e.vault)throw new It("--vault is required");let u=(0,lL.resolve)(e.vault);if(!(0,aL.existsSync)(u))throw new Pe(u);if(!n||n.length===0)throw new It("profile-uid argument is required","exocortex hard-switch <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new lu({vaultPath:u,warn:a(_=>c(_),"warn")})).resolveFilter(n);if(d.outcome==="missing-profile")throw new It(`Profile not found: ${n}`,"Run `exocortex find --class exo__FocusProfile` to list available profiles");if(d.outcome==="error")return c(`[hard-switch] Resolver error: ${d.reason}`),{exitCode:5,stdout:r,stderr:i};if(d.outcome==="degraded")return c(`[hard-switch] Refused: profile resolution degraded \u2014 ${d.reason}. Hard switch aborted to prevent vault corruption.`),{exitCode:5,stdout:r,stderr:i};let h=t.confirmGate??new Dy({yes:e.yes??!1,verbose:e.verbose??!1,log:a(_=>c(_),"log")}),p=nee(n,n);return await h.confirmHardSwitch(p)?(l(ree),{exitCode:0,stdout:r,stderr:i}):{exitCode:0,stdout:r,stderr:i}}a(iee,"runHardSwitch");function cL(){return new fe("hard-switch").description("Hard switch to specified FocusProfile (filesystem mutation, Phase 3+). Requires --yes for headless mode.").argument("<profile-uid>","Target FocusProfile UID").requiredOption("--vault <path>","Path to Obsidian vault").option("--yes","Confirm hard switch (headless mode safety override per RFC 22b50a17 Decision #2)",!1).option("--verbose","Print plan summary to stderr before deciding",!1).action(async(e,t)=>{try{let r=await iee(e,t);process.exit(r.exitCode)}catch(r){oe.handle(r)}})}a(cL,"hardSwitchCommand");function uL(n){let e=new fe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.52.7"),e.addCommand(zN()),e.addCommand(rL()),e.addCommand(_D()),e.addCommand(vD()),e.addCommand(KD()),e.addCommand(AD()),e.addCommand(ID()),e.addCommand(PD()),e.addCommand(ZD()),e.addCommand(uN()),e.addCommand(hN()),e.addCommand(pN()),e.addCommand(gN()),e.addCommand(xN()),e.addCommand(CN()),e.addCommand(LN()),e.addCommand(WN()),e.addCommand(oL()),e.addCommand(cL()),e}a(uL,"createProgram");uL().parse();0&&(module.exports={createProgram});
|
|
773
773
|
/*! Bundled license information:
|
|
774
774
|
|
|
775
775
|
reflect-metadata/Reflect.js:
|