@kitelev/exocortex-cli 16.53.2 → 16.53.4

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -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.53.2
2
+ // @kitelev/exocortex-cli v16.53.4
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -779,7 +779,7 @@ ${r}`}a(TZ,"serializeFile");function XN(n,e,t={}){let r=Dy.default.dirname(n),i=
779
779
  \u{1F4CA} Applied to ${p}/${h.length} target(s) (${g} failed).`),g>0&&process.exit(5)}catch(r){ae.handle(r),process.exit(5)}})}a(mL,"applyCommand");var ba=require("fs"),Tu=require("path");var gL=/^---\s*$/,oee=/^exocmd__Grounding_type:\s*(.+?)\s*$/,aee=/^"?\[\[[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?:\|[^\]]*)?\]\]"?$/i,lee=new Set(["node_modules"]);function cee(n){return n.startsWith(".")||lee.has(n)}a(cee,"shouldSkipDir");function*yL(n){let e;try{e=(0,ba.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,Tu.join)(n,t.name);if(t.isDirectory()){if(cee(t.name))continue;yield*yL(r)}else t.isFile()&&t.name.endsWith(".md")&&(yield r)}}a(yL,"walkMarkdownFiles");function uee(n){let e=n.split(/\r?\n/);if(e.length<2||!gL.test(e[0]))return null;for(let t=1;t<e.length;t++)if(gL.test(e[t]))return{lines:e.slice(1,t),startLine:2};return null}a(uee,"extractFrontmatter");function fee(n){let e=n.trim();return e===""||e==="null"||e==="~"?!1:!aee.test(e)}a(fee,"isLiteralForm");function dee(n){let e=[];for(let t of yL(n)){let r;try{r=(0,ba.readFileSync)(t,"utf-8")}catch{continue}let i=uee(r);if(i)for(let s=0;s<i.lines.length;s++){let o=i.lines[s].match(oee);if(!o)continue;let l=o[1];fee(l)&&e.push({path:(0,Tu.relative)(n,t),line:i.startLine+s,value:l})}}return e}a(dee,"scanVaultForLiteralForm");function _L(){return new pe("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";ae.setFormat(e);try{let t=(0,Tu.resolve)(n.vault);if(!(0,ba.existsSync)(t)||!(0,ba.statSync)(t).isDirectory())throw new Se(t);let r=dee(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){ae.handle(t)}})}a(_L,"auditGroundingTypeLiteralFormCommand");function bL(){let n=new pe("audit").description("Audit vault for regression patterns (RFC cutover detectors)");return n.addCommand(_L()),n}a(bL,"auditCommand");var SL=require("fs"),wL=require("path");var hee=a(n=>{process.stderr.write(`${n}
780
780
  `)},"DEFAULT_LOG"),Uy=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??hee}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 pee="[hard-switch] CLI command scaffolded. hardSwitchProfile() implementation pending Phase 3.";function mee(n,e){return{targetProfileUid:n,targetProfileLabel:e,sourceProfileUid:null,sourceProfileLabel:"<unknown>",filesToDestroy:new Map,assetSpacesBeingTornDown:[],assetSpacesBeingMaterialized:[]}}a(mee,"buildScaffoldPlan");async function gee(n,e,t={}){let r=[],i=[],s=t.out??(_=>process.stdout.write(`${_}
781
781
  `)),o=t.err??(_=>process.stderr.write(`${_}
782
- `)),l=a(_=>{r.push(_),s(_)},"out"),c=a(_=>{i.push(_),o(_)},"err");if(!e.vault)throw new Ct("--vault is required");let u=(0,wL.resolve)(e.vault);if(!(0,SL.existsSync)(u))throw new Se(u);if(!n||n.length===0)throw new Ct("profile-uid argument is required","exocortex hard-switch <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new mu({vaultPath:u,warn:a(_=>c(_),"warn")})).resolveFilter(n);if(d.outcome==="missing-profile")throw new Ct(`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 Uy({yes:e.yes??!1,verbose:e.verbose??!1,log:a(_=>c(_),"log")}),p=mee(n,n);return await h.confirmHardSwitch(p)?(l(pee),{exitCode:0,stdout:r,stderr:i}):{exitCode:0,stdout:r,stderr:i}}a(gee,"runHardSwitch");function vL(){return new pe("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 gee(e,t);process.exit(r.exitCode)}catch(r){ae.handle(r)}})}a(vL,"hardSwitchCommand");function EL(n){let e=new pe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.53.2"),e.addCommand(sL()),e.addCommand(mL()),e.addCommand(OD()),e.addCommand(WD()),e.addCommand(cN()),e.addCommand(YD()),e.addCommand(KD()),e.addCommand(tN()),e.addCommand(dN()),e.addCommand(EN()),e.addCommand(IN()),e.addCommand(CN()),e.addCommand(RN()),e.addCommand(UN()),e.addCommand(VN()),e.addCommand(QN()),e.addCommand(iL()),e.addCommand(bL()),e.addCommand(vL()),e}a(EL,"createProgram");EL().parse();0&&(module.exports={createProgram});
782
+ `)),l=a(_=>{r.push(_),s(_)},"out"),c=a(_=>{i.push(_),o(_)},"err");if(!e.vault)throw new Ct("--vault is required");let u=(0,wL.resolve)(e.vault);if(!(0,SL.existsSync)(u))throw new Se(u);if(!n||n.length===0)throw new Ct("profile-uid argument is required","exocortex hard-switch <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new mu({vaultPath:u,warn:a(_=>c(_),"warn")})).resolveFilter(n);if(d.outcome==="missing-profile")throw new Ct(`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 Uy({yes:e.yes??!1,verbose:e.verbose??!1,log:a(_=>c(_),"log")}),p=mee(n,n);return await h.confirmHardSwitch(p)?(l(pee),{exitCode:0,stdout:r,stderr:i}):{exitCode:0,stdout:r,stderr:i}}a(gee,"runHardSwitch");function vL(){return new pe("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 gee(e,t);process.exit(r.exitCode)}catch(r){ae.handle(r)}})}a(vL,"hardSwitchCommand");function EL(n){let e=new pe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.53.4"),e.addCommand(sL()),e.addCommand(mL()),e.addCommand(OD()),e.addCommand(WD()),e.addCommand(cN()),e.addCommand(YD()),e.addCommand(KD()),e.addCommand(tN()),e.addCommand(dN()),e.addCommand(EN()),e.addCommand(IN()),e.addCommand(CN()),e.addCommand(RN()),e.addCommand(UN()),e.addCommand(VN()),e.addCommand(QN()),e.addCommand(iL()),e.addCommand(bL()),e.addCommand(vL()),e}a(EL,"createProgram");EL().parse();0&&(module.exports={createProgram});
783
783
  /*! Bundled license information:
784
784
 
785
785
  reflect-metadata/Reflect.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitelev/exocortex-cli",
3
- "version": "16.53.2",
3
+ "version": "16.53.4",
4
4
  "description": "CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more",
5
5
  "main": "dist/index.js",
6
6
  "bin": {