@kitelev/exocortex-cli 16.92.2 → 16.93.1

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.92.2
2
+ // @kitelev/exocortex-cli v16.93.1
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -775,7 +775,7 @@ Next steps:
775
775
  `),process.stdout.write(` File: ${e.file}
776
776
  `),process.stdout.write(` Commit: ${e.sha}
777
777
  `),process.stdout.write(` URL: ${e.url}
778
- `)),process.exit(0)}catch(e){let t=e instanceof Error?e:new Error(String(e)),r=new No;t.message=r.redact(t.message),t.stack&&(t.stack=r.redact(t.stack)),ge.handle(t)}})}a(Bie,"restPushCommand");var ko=require("node:fs"),I4=require("node:crypto"),Si=J(require("node:path"));var wi=J(nt());var Vie=a(async n=>{let e=await I4.webcrypto.subtle.digest("SHA-1",n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),Gie={parse:a(n=>br.load(n,{schema:br.CORE_SCHEMA}),"parse"),stringify:a(n=>br.dump(n,{schema:br.CORE_SCHEMA,lineWidth:-1}),"stringify")};function qie(n,e){if(n.tokenFromGh===!0)return No.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,r=n.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(r.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return r}a(qie,"resolveToken");function Wie(n){let e=a(r=>Si.join(n,r),"abs"),t=a(async(r,i)=>{let s;try{s=await ko.promises.readdir(r,{withFileTypes:!0})}catch{return}for(let o of s){let c=Si.join(r,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Si.relative(n,c).split(Si.sep).join("/"))}},"walk");return{async list(){let r=[];return(0,ko.existsSync)(n)&&await t(n,r),r},read:a(r=>ko.promises.readFile(e(r),"utf-8"),"read"),async readBinary(r){return new Uint8Array(await ko.promises.readFile(e(r)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(Wie,"nodeLocalFilesPort");function zie(n){let e=new ht(n),t=new wi.SpaceSpecAccumulator;for(let r of e.getAllFiles()){let i=e.getFrontmatter(r);if(!i)continue;let s=(0,wi.classifySpaceDeclaration)(i,r.path);if(s.kind==="not-space"||(s.warning!==void 0&&t.warnings.push(s.warning),s.kind==="skip"))continue;let o=t.offer(s.candidate);o!==null&&(0,ko.existsSync)(Si.join(n,o.localPath))&&t.commit(s.candidate)}return{specs:t.specs,warnings:t.warnings}}a(zie,"collectVaultSpecs");function Hie(n,e){for(let t of n.repos){let r=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${r}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,wi.summarizeParityRound)(n))}a(Hie,"printHumanReport");async function Kie(n,e={}){let t=e.out??(y=>console.log(y)),r=Si.resolve(n.vault);if(!(0,ko.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let i=qie(n,e),s=new No({token:i,...n.apiBase!==void 0?{apiBase:n.apiBase}:{}}),o=e.transportFactory?.(i,n.apiBase)??s.transport(),{specs:c,warnings:l}=zie(r);for(let y of l)t(`warn: ${y}`);if(c.length===0)return t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let u=n.configDir??".obsidian",f=Si.join(r,u,"plugins","exocortex",wi.WATERMARK_STORE_FILENAME),d=new wi.FileWatermarkStore({read:a(async()=>{try{return await ko.promises.readFile(f,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),h=new wi.ParityValidator({transport:o,sha1:Vie,localFilesFor:a(y=>Wie(Si.join(r,y.localPath)),"localFilesFor"),watermarks:{get:a(y=>d.get(y),"get")},yaml:Gie,redact:a(y=>s.redact(y),"redact"),...n.apiBase!==void 0?{baseURL:n.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${r}`);let p=await h.runRound(c,{trigger:"standalone"});return n.json===!0?t(JSON.stringify(p,null,2)):Hie(p,t),p.vacuous?2:p.ok?0:1}a(Kie,"runExosyncParity");function x4(){return new Ce("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").action(async n=>{try{process.exitCode=await Kie(n)}catch(e){ge.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(x4,"exosyncParityCommand");function R4(n){let e=new Ce;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.92.2"),e.addCommand(kM()),e.addCommand(zM()),e.addCommand(Rk()),e.addCommand(Ok()),e.addCommand(oM()),e.addCommand(Nk()),e.addCommand(kk()),e.addCommand(Bk()),e.addCommand(lM()),e.addCommand(bM()),e.addCommand(SM()),e.addCommand(AM()),e.addCommand(NM()),e.addCommand(a4()),e.addCommand(h4()),e.addCommand(p4()),e.addCommand(g4()),e.addCommand(S4()),e.addCommand(A4()),e.addCommand(x4()),e}a(R4,"createProgram");R4().parse();0&&(module.exports={createProgram});
778
+ `)),process.exit(0)}catch(e){let t=e instanceof Error?e:new Error(String(e)),r=new No;t.message=r.redact(t.message),t.stack&&(t.stack=r.redact(t.stack)),ge.handle(t)}})}a(Bie,"restPushCommand");var ko=require("node:fs"),I4=require("node:crypto"),Si=J(require("node:path"));var wi=J(nt());var Vie=a(async n=>{let e=await I4.webcrypto.subtle.digest("SHA-1",n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),Gie={parse:a(n=>br.load(n,{schema:br.CORE_SCHEMA}),"parse"),stringify:a(n=>br.dump(n,{schema:br.CORE_SCHEMA,lineWidth:-1}),"stringify")};function qie(n,e){if(n.tokenFromGh===!0)return No.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,r=n.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(r.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return r}a(qie,"resolveToken");function Wie(n){let e=a(r=>Si.join(n,r),"abs"),t=a(async(r,i)=>{let s;try{s=await ko.promises.readdir(r,{withFileTypes:!0})}catch{return}for(let o of s){let c=Si.join(r,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Si.relative(n,c).split(Si.sep).join("/"))}},"walk");return{async list(){let r=[];return(0,ko.existsSync)(n)&&await t(n,r),r},read:a(r=>ko.promises.readFile(e(r),"utf-8"),"read"),async readBinary(r){return new Uint8Array(await ko.promises.readFile(e(r)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(Wie,"nodeLocalFilesPort");function zie(n){let e=new ht(n),t=new wi.SpaceSpecAccumulator;for(let r of e.getAllFiles()){let i=e.getFrontmatter(r);if(!i)continue;let s=(0,wi.classifySpaceDeclaration)(i,r.path);if(s.kind==="not-space"||(s.warning!==void 0&&t.warnings.push(s.warning),s.kind==="skip"))continue;let o=t.offer(s.candidate);o!==null&&(0,ko.existsSync)(Si.join(n,o.localPath))&&t.commit(s.candidate)}return{specs:t.specs,warnings:t.warnings}}a(zie,"collectVaultSpecs");function Hie(n,e){for(let t of n.repos){let r=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${r}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,wi.summarizeParityRound)(n))}a(Hie,"printHumanReport");async function Kie(n,e={}){let t=e.out??(y=>console.log(y)),r=Si.resolve(n.vault);if(!(0,ko.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let i=qie(n,e),s=new No({token:i,...n.apiBase!==void 0?{apiBase:n.apiBase}:{}}),o=e.transportFactory?.(i,n.apiBase)??s.transport(),{specs:c,warnings:l}=zie(r);for(let y of l)t(`warn: ${y}`);if(c.length===0)return t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let u=n.configDir??".obsidian",f=Si.join(r,u,"plugins","exocortex",wi.WATERMARK_STORE_FILENAME),d=new wi.FileWatermarkStore({read:a(async()=>{try{return await ko.promises.readFile(f,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),h=new wi.ParityValidator({transport:o,sha1:Vie,localFilesFor:a(y=>Wie(Si.join(r,y.localPath)),"localFilesFor"),watermarks:{get:a(y=>d.get(y),"get")},yaml:Gie,redact:a(y=>s.redact(y),"redact"),...n.apiBase!==void 0?{baseURL:n.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${r}`);let p=await h.runRound(c,{trigger:"standalone"});return n.json===!0?t(JSON.stringify(p,null,2)):Hie(p,t),p.vacuous?2:p.ok?0:1}a(Kie,"runExosyncParity");function x4(){return new Ce("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").action(async n=>{try{process.exitCode=await Kie(n)}catch(e){ge.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(x4,"exosyncParityCommand");function R4(n){let e=new Ce;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.93.1"),e.addCommand(kM()),e.addCommand(zM()),e.addCommand(Rk()),e.addCommand(Ok()),e.addCommand(oM()),e.addCommand(Nk()),e.addCommand(kk()),e.addCommand(Bk()),e.addCommand(lM()),e.addCommand(bM()),e.addCommand(SM()),e.addCommand(AM()),e.addCommand(NM()),e.addCommand(a4()),e.addCommand(h4()),e.addCommand(p4()),e.addCommand(g4()),e.addCommand(S4()),e.addCommand(A4()),e.addCommand(x4()),e}a(R4,"createProgram");R4().parse();0&&(module.exports={createProgram});
779
779
  /*! Bundled license information:
780
780
 
781
781
  reflect-metadata/Reflect.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitelev/exocortex-cli",
3
- "version": "16.92.2",
3
+ "version": "16.93.1",
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": {