@kitelev/exocortex-cli 17.5.9 → 17.5.10

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 +3 -3
  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 v17.5.9
2
+ // @kitelev/exocortex-cli v17.5.10
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -598,7 +598,7 @@ ${S.content}--- END PREVIEW ---
598
598
  `+_.map(E=>` - ${E.path}
599
599
  `).join("")),await Lg(5);return}process.stdout.write(JSON.stringify(_)+`
600
600
  `),await Lg(0)}catch(t){if(t instanceof il){process.stderr.write(`\u274C create-batch: ${t.message}
601
- `),await Lg(2);return}ue.handle(t)}})}a(CV,"createBatchCommand");function IV(r,e,t){return new sl.GenericAssetCreationService(r).withDeterminism({uidGenerator:{next:a(()=>e,"next")},clock:{now:a(()=>new Date(t.getTime()),"now")}})}a(IV,"pinnedService");ct();var no=require("path"),_p=require("fs"),cl=Q(Pe());St();Mt();var kg=Q(Pe());var ol="Asia/Almaty",Ja="exo__Asset_updatedAt";var EF={ems__Effort_status:{commands:["mark-done","move-to-backlog","rollback-to-backlog","start-effort","set-draft-status"]},ems__Task_zone:{commands:["set-criticality-high","set-criticality-medium","set-criticality-low"]},ems__Effort_parent:{commands:["set-parent"],argSuffix:`--input '{"parent":"<uid>"}'`},exo__Asset_label:{commands:["set-label"],argSuffix:`--input '{"label":"<text>"}'`},exo__Instance_class:{commands:["convert-to-task","convert-to-project"],note:"reclassing is a semantic operation with a precondition"},ems__Effort_startTimestamp:{commands:["start-effort","rollback-to-backlog","park-waiting"],clearedBy:["rollback-to-backlog","park-waiting"],note:"start-effort sets it; the others clear it as a side effect of the status change"},ems__Effort_endTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_resolutionTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_plannedStartTimestamp:{commands:["set-planned-start","plan-on-today","plan-for-evening","shift-day-forward","shift-day-backward"]},ems__Effort_plannedEndTimestamp:{commands:["set-planned-end"]},ems__Effort_scheduledDate:{commands:["set-scheduled-date"]},ems__Effort_votes:{commands:["vote-on-effort"]},archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]},exo__Asset_archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]}};function Mg(r){return Object.prototype.hasOwnProperty.call(EF,r)?EF[r]:void 0}a(Mg,"guardedRouteFor");function NE(r,e){if(e.size===0)return vF(r);let t=r.commands.filter(n=>e.has(n));return t.length===0?`apply ${r.commands.join("|")} <path> (\u26D4 none of these resolve in this vault \u2014 the owning assetspace looks unmounted)`:vF({...r,commands:t})}a(NE,"renderGuardedRouteResolved");function vF(r){let e=`apply ${r.commands.join("|")} <path>`,t=r.argSuffix?`${e} ${r.argSuffix}`:e;return r.note?`${t} (${r.note})`:t}a(vF,"renderGuardedRoute");var QBe=Object.fromEntries(Object.entries(EF).map(([r,e])=>[r,vF(e)])),kE={exo__Asset_uid:"the asset identity \u2014 changing it breaks UID-canon filenames and every inbound [[uid]] wikilink",[Ja]:"auto-managed (bumped on every mutation)"};function xV(r){let e=Mg(r);if(e===void 0)return;let t=e.clearedBy??[];if(t.length===0)return;let{note:n,...i}=e;return{...i,commands:t}}a(xV,"clearingRouteFor");function OV(r){return`Refusing to remove "${r}" via remove-property \u2014 it is guarded, and no dedicated command clears it (the ones that own it assign a value). If dropping the facet is intended, say so explicitly: --force --reason "<why>"`}a(OV,"renderNoClearingPathRefusal");function ME(r,e,t,n){return`Refusing to ${r} "${t}" via ${e} \u2014 it has a dedicated guarded command so the state machine / precondition is not bypassed. Use: exocortex ${n} --vault <v>`}a(ME,"renderGuardRefusal");function jE(r,e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}a(jE,"guardedReason");function al(r,e){let n=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(r),i=a(s=>n.find(o=>o.type===s)?.value??"00","get");return`${i("year")}-${i("month")}-${i("day")}T${i("hour")}:${i("minute")}:${i("second")}`}a(al,"stampTimestamp");var cSe=/^\s*exocmd__Command_cliName:\s*(.+?)\s*$/gm;function lSe(r){let e=r.trim();return e.length>=2&&(e[0]==='"'||e[0]==="'")&&e[e.length-1]===e[0]?e.slice(1,-1).trim():e}a(lSe,"unquote");var bp=class{constructor(e){this.vaultPath=e}static{a(this,"CommandNameRegistry")}async collect(){if(this.cache)return this.cache;let{readdir:e,readFile:t}=await import("fs/promises"),n=new Set,i=a(async s=>{let o;try{o=await e(s,{withFileTypes:!0})}catch{return}for(let c of o){let l=`${s}/${c.name}`;if(c.isDirectory()){if(c.name===".git"||c.name==="node_modules")continue;await i(l)}else if(c.isFile()&&c.name.endsWith(".md")){let u;try{u=await t(l,"utf-8")}catch{continue}for(let f of u.matchAll(cSe)){let d=lSe(f[1]);d&&n.add(d)}}}},"walk");return await i(this.vaultPath),this.cache=n,n}};var PV="exo__Asset_isDefinedBy";function uSe(r){let e=a(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean","isScalar");if(e(r)||Array.isArray(r)&&r.every(e))return;let t=r===null?"null":Array.isArray(r)?"an array with non-scalar elements":typeof r;throw new Error(`--input.value must be a scalar (string/number/boolean) or an array of scalars, not ${t}`)}a(uSe,"assertScalarOrScalarArray");function fSe(r,e){if(e==="")throw new Error(`Refusing to set "${r}" to an EMPTY value \u2014 an empty string writes a junk key (${r}: "") rather than clearing the property. To delete it use: exocortex remove-property <path> --property ${r} --vault <v>`)}a(fSe,"assertNonEmptyValue");function dSe(r){let e=r.input!==void 0,t=r.property!==void 0;if(e&&t)throw new Ye("Pass --input OR --property/--value, not both.",`set-property <path> --input '{"property":"<name>","value":<v>}'`);if(e){let n;try{n=JSON.parse(r.input)}catch(o){let c=o instanceof Error?o.message:String(o);throw new Error(`--input: invalid JSON (${c})`)}if(typeof n!="object"||n===null||Array.isArray(n))throw new Error('--input must be a JSON object of the form {"property":"<name>","value":<v>}');let i=n,s=i.property;if(typeof s!="string"||s.trim().length===0)throw new Error("--input.property must be a non-empty string");if(!("value"in i))throw new Error("--input.value is required");return{property:s.trim(),value:i.value}}if(t){if(r.value===void 0)throw new Error("--property requires --value (or use --input for a typed/array value)");return{property:r.property.trim(),value:r.value}}throw new Ye("No property provided.",`set-property <path> --input '{"property":"<name>","value":<v>}' OR set-property <path> --property <name> --value <string>`)}a(dSe,"resolvePropertyAndValue");function pSe(r,e,t){let n=cl.STRING_SCALAR_PROPERTIES.has(e);return Array.isArray(r)?r.map(i=>(0,cl.serializeYamlScalar)(i,n,t)):(0,cl.serializeYamlScalar)(r,n,t)}a(pSe,"serializeForWrite");function FV(){return new pe("set-property").description("Set an arbitrary non-guarded frontmatter property on an existing vault asset (bumps exo__Asset_updatedAt only when the value actually changed; a no-op leaves the file byte-identical). Refuses state-machine-guarded properties (status/zone/parent/label/fact-timestamps) \u2014 those keep their dedicated `apply` commands. Issues #3795 / #3848.").argument("<path>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>",'JSON {"property":"<name>","value":<v>} \u2014 value is JSON-typed (boolean/number/string/array). Primary form.').option("--property <name>","Property name (string-value convenience form; pair with --value; use --input for boolean/number/array values)").option("--value <value>","Property value as a string (pair with --property; use --input for typed/array values)").option("--skip-wikilink-validation","Skip [[...]] wikilink existence validation").option("--timezone <tz>","Timezone for the exo__Asset_updatedAt bump (defaults to Asia/Almaty)").option("--frozen-clock <iso>","Freeze the updatedAt clock to an ISO timestamp for test/replay").option("--dry-run","Preview the resulting frontmatter without writing").option("--yes","Accepted for symmetry with the apply/create subcommands (set-property is non-interactive; no-op)").action(async(r,e)=>{try{let t=(0,no.resolve)(e.vault);if(!(0,_p.existsSync)(t))throw new Le(t);let n=(0,no.resolve)(t,r),i=(0,no.relative)(t,n);if(i===".."||i.startsWith(`..${no.sep}`)||(0,no.isAbsolute)(i))throw new Error(`Target is outside the vault: ${r} (vault: ${t})`);let s;try{s=(0,_p.readFileSync)(n,"utf-8")}catch(w){throw w.code==="ENOENT"?new Error(`Target file not found: ${r}`):w}if(!/^\s*exo__Asset_uid:/m.test(s))throw new Error(`Not a vault asset (no exo__Asset_uid): ${i}. set-property only mutates existing assets.`);let{property:o,value:c}=dSe(e),l=cl.FrontmatterService.normalizeIRI(o),u=jE(kE,l);if(u!==void 0)throw new Error(`Refusing to set "${l}" \u2014 ${u}.`);let f=Mg(l);if(f!==void 0){let w=await new bp(t).collect();throw new Error(ME("set","set-property",l,NE(f,w)))}let d=new nl(t,{warn:a(w=>process.stderr.write(`\u26A0 ${w}
601
+ `),await Lg(2);return}ue.handle(t)}})}a(CV,"createBatchCommand");function IV(r,e,t){return new sl.GenericAssetCreationService(r).withDeterminism({uidGenerator:{next:a(()=>e,"next")},clock:{now:a(()=>new Date(t.getTime()),"now")}})}a(IV,"pinnedService");ct();var no=require("path"),_p=require("fs"),cl=Q(Pe());St();Mt();var kg=Q(Pe());var ol="Asia/Almaty",Ja="exo__Asset_updatedAt";var EF={ems__Effort_status:{commands:["mark-done","move-to-backlog","rollback-to-backlog","start-effort","set-draft-status"]},ems__Task_zone:{commands:["set-criticality-high","set-criticality-medium","set-criticality-low"]},ems__Effort_parent:{commands:["set-parent"],argSuffix:`--input '{"parent":"<uid>"}'`},exo__Asset_label:{commands:["set-label"],argSuffix:`--input '{"label":"<text>"}'`},exo__Instance_class:{commands:["convert-to-task","convert-to-project","append-instance-class","replace-instance-class"],note:`reclassing is a semantic operation with a precondition; append/replace take --input '{"class":"[[<uid>]]"}' \u2014 append ADDS a second class (dual-type deprecation), the others replace`},ems__Effort_startTimestamp:{commands:["start-effort","rollback-to-backlog","park-waiting"],clearedBy:["rollback-to-backlog","park-waiting"],note:"start-effort sets it; the others clear it as a side effect of the status change"},ems__Effort_endTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_resolutionTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_plannedStartTimestamp:{commands:["set-planned-start","plan-on-today","plan-for-evening","shift-day-forward","shift-day-backward"]},ems__Effort_plannedEndTimestamp:{commands:["set-planned-end"]},ems__Effort_scheduledDate:{commands:["set-scheduled-date"]},ems__Effort_votes:{commands:["vote-on-effort"]},archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]},exo__Asset_archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]}};function Mg(r){return Object.prototype.hasOwnProperty.call(EF,r)?EF[r]:void 0}a(Mg,"guardedRouteFor");function NE(r,e){if(e.size===0)return vF(r);let t=r.commands.filter(n=>e.has(n));return t.length===0?`apply ${r.commands.join("|")} <path> (\u26D4 none of these resolve in this vault \u2014 the owning assetspace looks unmounted)`:vF({...r,commands:t})}a(NE,"renderGuardedRouteResolved");function vF(r){let e=`apply ${r.commands.join("|")} <path>`,t=r.argSuffix?`${e} ${r.argSuffix}`:e;return r.note?`${t} (${r.note})`:t}a(vF,"renderGuardedRoute");var QBe=Object.fromEntries(Object.entries(EF).map(([r,e])=>[r,vF(e)])),kE={exo__Asset_uid:"the asset identity \u2014 changing it breaks UID-canon filenames and every inbound [[uid]] wikilink",[Ja]:"auto-managed (bumped on every mutation)"};function xV(r){let e=Mg(r);if(e===void 0)return;let t=e.clearedBy??[];if(t.length===0)return;let{note:n,...i}=e;return{...i,commands:t}}a(xV,"clearingRouteFor");function OV(r){return`Refusing to remove "${r}" via remove-property \u2014 it is guarded, and no dedicated command clears it (the ones that own it assign a value). If dropping the facet is intended, say so explicitly: --force --reason "<why>"`}a(OV,"renderNoClearingPathRefusal");function ME(r,e,t,n){return`Refusing to ${r} "${t}" via ${e} \u2014 it has a dedicated guarded command so the state machine / precondition is not bypassed. Use: exocortex ${n} --vault <v>`}a(ME,"renderGuardRefusal");function jE(r,e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}a(jE,"guardedReason");function al(r,e){let n=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(r),i=a(s=>n.find(o=>o.type===s)?.value??"00","get");return`${i("year")}-${i("month")}-${i("day")}T${i("hour")}:${i("minute")}:${i("second")}`}a(al,"stampTimestamp");var cSe=/^\s*exocmd__Command_cliName:\s*(.+?)\s*$/gm;function lSe(r){let e=r.trim();return e.length>=2&&(e[0]==='"'||e[0]==="'")&&e[e.length-1]===e[0]?e.slice(1,-1).trim():e}a(lSe,"unquote");var bp=class{constructor(e){this.vaultPath=e}static{a(this,"CommandNameRegistry")}async collect(){if(this.cache)return this.cache;let{readdir:e,readFile:t}=await import("fs/promises"),n=new Set,i=a(async s=>{let o;try{o=await e(s,{withFileTypes:!0})}catch{return}for(let c of o){let l=`${s}/${c.name}`;if(c.isDirectory()){if(c.name===".git"||c.name==="node_modules")continue;await i(l)}else if(c.isFile()&&c.name.endsWith(".md")){let u;try{u=await t(l,"utf-8")}catch{continue}for(let f of u.matchAll(cSe)){let d=lSe(f[1]);d&&n.add(d)}}}},"walk");return await i(this.vaultPath),this.cache=n,n}};var PV="exo__Asset_isDefinedBy";function uSe(r){let e=a(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean","isScalar");if(e(r)||Array.isArray(r)&&r.every(e))return;let t=r===null?"null":Array.isArray(r)?"an array with non-scalar elements":typeof r;throw new Error(`--input.value must be a scalar (string/number/boolean) or an array of scalars, not ${t}`)}a(uSe,"assertScalarOrScalarArray");function fSe(r,e){if(e==="")throw new Error(`Refusing to set "${r}" to an EMPTY value \u2014 an empty string writes a junk key (${r}: "") rather than clearing the property. To delete it use: exocortex remove-property <path> --property ${r} --vault <v>`)}a(fSe,"assertNonEmptyValue");function dSe(r){let e=r.input!==void 0,t=r.property!==void 0;if(e&&t)throw new Ye("Pass --input OR --property/--value, not both.",`set-property <path> --input '{"property":"<name>","value":<v>}'`);if(e){let n;try{n=JSON.parse(r.input)}catch(o){let c=o instanceof Error?o.message:String(o);throw new Error(`--input: invalid JSON (${c})`)}if(typeof n!="object"||n===null||Array.isArray(n))throw new Error('--input must be a JSON object of the form {"property":"<name>","value":<v>}');let i=n,s=i.property;if(typeof s!="string"||s.trim().length===0)throw new Error("--input.property must be a non-empty string");if(!("value"in i))throw new Error("--input.value is required");return{property:s.trim(),value:i.value}}if(t){if(r.value===void 0)throw new Error("--property requires --value (or use --input for a typed/array value)");return{property:r.property.trim(),value:r.value}}throw new Ye("No property provided.",`set-property <path> --input '{"property":"<name>","value":<v>}' OR set-property <path> --property <name> --value <string>`)}a(dSe,"resolvePropertyAndValue");function pSe(r,e,t){let n=cl.STRING_SCALAR_PROPERTIES.has(e);return Array.isArray(r)?r.map(i=>(0,cl.serializeYamlScalar)(i,n,t)):(0,cl.serializeYamlScalar)(r,n,t)}a(pSe,"serializeForWrite");function FV(){return new pe("set-property").description("Set an arbitrary non-guarded frontmatter property on an existing vault asset (bumps exo__Asset_updatedAt only when the value actually changed; a no-op leaves the file byte-identical). Refuses state-machine-guarded properties (status/zone/parent/label/fact-timestamps) \u2014 those keep their dedicated `apply` commands. Issues #3795 / #3848.").argument("<path>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>",'JSON {"property":"<name>","value":<v>} \u2014 value is JSON-typed (boolean/number/string/array). Primary form.').option("--property <name>","Property name (string-value convenience form; pair with --value; use --input for boolean/number/array values)").option("--value <value>","Property value as a string (pair with --property; use --input for typed/array values)").option("--skip-wikilink-validation","Skip [[...]] wikilink existence validation").option("--timezone <tz>","Timezone for the exo__Asset_updatedAt bump (defaults to Asia/Almaty)").option("--frozen-clock <iso>","Freeze the updatedAt clock to an ISO timestamp for test/replay").option("--dry-run","Preview the resulting frontmatter without writing").option("--yes","Accepted for symmetry with the apply/create subcommands (set-property is non-interactive; no-op)").action(async(r,e)=>{try{let t=(0,no.resolve)(e.vault);if(!(0,_p.existsSync)(t))throw new Le(t);let n=(0,no.resolve)(t,r),i=(0,no.relative)(t,n);if(i===".."||i.startsWith(`..${no.sep}`)||(0,no.isAbsolute)(i))throw new Error(`Target is outside the vault: ${r} (vault: ${t})`);let s;try{s=(0,_p.readFileSync)(n,"utf-8")}catch(w){throw w.code==="ENOENT"?new Error(`Target file not found: ${r}`):w}if(!/^\s*exo__Asset_uid:/m.test(s))throw new Error(`Not a vault asset (no exo__Asset_uid): ${i}. set-property only mutates existing assets.`);let{property:o,value:c}=dSe(e),l=cl.FrontmatterService.normalizeIRI(o),u=jE(kE,l);if(u!==void 0)throw new Error(`Refusing to set "${l}" \u2014 ${u}.`);let f=Mg(l);if(f!==void 0){let w=await new bp(t).collect();throw new Error(ME("set","set-property",l,NE(f,w)))}let d=new nl(t,{warn:a(w=>process.stderr.write(`\u26A0 ${w}
602
602
  `),"warn")});if(await d.validate([l]),uSe(c),fSe(o,c),!e.skipWikilinkValidation){let w=new rl(new Xn(t)),R=Array.isArray(c)?c:[c];for(let x of R)typeof x=="string"&&await w.validateValue(x)}l===PV&&await FE(c,new Xn(t),i,"set-property");let p=new cl.FrontmatterService,h=(0,kg.canonicalYamlKey)(l),g=await d.declaredRange(l),m=p.updateProperty(s,h,pSe(c,h,g)),b=m!==s,_=m,S;if(b){let w=e.frozenClock?new Date(e.frozenClock):new Date,R=e.timezone??ol;S=al(w,R),_=p.updateProperty(m,Ja,S)}let A;if(l===PV){let w=Array.isArray(c)?c[0]:c,R=await fV(new Xn(t),w);if(R!==null){let x=(0,no.dirname)(i),P=x==="."?"":x;P!==R&&(A=`\u26A0 co-location: exo__Asset_isDefinedBy now points at "${R||"<vault root>"}" but the file is in "${P||"<vault root>"}". Move it to match: exocortex apply repair-folder ${i} --vault <v>`)}}e.dryRun?process.stderr.write(`--- DRY RUN PREVIEW ---
603
603
  ${_}
604
604
  --- END PREVIEW ---
@@ -708,7 +708,7 @@ Next steps:
708
708
  `).map(n=>n.trim()).filter(n=>n.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(jEe,"parseLastJsonLine");function uq(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(uq,"missingStringFields");var dv=class{constructor(e){this.deps=e}static{a(this,"McpServer")}async handle(e){if(typeof e!="object"||e===null||Array.isArray(e))return{jsonrpc:"2.0",id:null,error:{code:lq,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,n=t===void 0;if(typeof e.method!="string")return n?null:{jsonrpc:"2.0",id:t??null,error:{code:lq,message:"Invalid request: missing method"}};if(n)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:kEe,capabilities:{tools:{}},serverInfo:{name:"exocortex",version:this.deps.version}}};case"ping":return{jsonrpc:"2.0",id:i,result:{}};case"tools/list":return{jsonrpc:"2.0",id:i,result:{tools:cq}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:MEe,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=uq(n,["vault","class","label"]);if(c.length>0)return Dp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=sq(n);if(l!==null)return Dp(`create_asset: ${l}`,!0);i=oq(n)}else if(t==="create_effort"){let c=uq(n,["vault","command","target"]);if(c.length>0)return Dp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=aq(n)}else return Dp(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let c=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return Dp(`exocortex-cli exited ${s.exitCode}
709
709
  ${c}`,!0)}let o=jEe(s.stdout);return Dp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var pq=require("child_process");var $Ee=32*1024*1024;function hq(r){return e=>new Promise(t=>{(0,pq.execFile)(process.execPath,[r,...e],{maxBuffer:$Ee},(n,i,s)=>{let o=0;if(n){let c=n.code;o=typeof c=="number"?c:1}t({stdout:i,stderr:s,exitCode:o})})})}a(hq,"createSelfCliRunner");async function UEe(r,e,t){let n=(0,mq.createInterface)({input:e,crlfDelay:1/0});for await(let i of n){let s=i.trim();if(s.length===0)continue;let o;try{o=JSON.parse(s)}catch{t(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:fq,message:"Parse error: invalid JSON"}})+`
710
710
  `);continue}let c;try{c=await r.handle(o)}catch(l){c={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:dq,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
711
- `)}}a(UEe,"runStdioServer");function gq(r){return new pe("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new dv({runCli:hq(t),version:r??"unknown"});await UEe(n,process.stdin,i=>process.stdout.write(i))})}a(gq,"mcpCommand");function pv(r){let e=new pe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"17.5.9"),e.addCommand($V()),e.addCommand(YV()),e.addCommand(S7()),e.addCommand(T7()),e.addCommand(W7()),e.addCommand(A7()),e.addCommand(O7()),e.addCommand(P7()),e.addCommand(Z7()),e.addCommand(iV()),e.addCommand(vV()),e.addCommand(CV()),e.addCommand(FV()),e.addCommand(DV()),e.addCommand(NV()),e.addCommand(kV()),e.addCommand(bG()),e.addCommand(wG()),e.addCommand(HG()),e.addCommand(YG()),e.addCommand(JG()),e.addCommand(ZG()),e.addCommand(rq()),e.addCommand(kG()),e.addCommand(qG()),e.addCommand(nq()),e.addCommand(gq(r??"17.5.9")),e}a(pv,"createProgram");pv().parse();0&&(module.exports={createProgram});
711
+ `)}}a(UEe,"runStdioServer");function gq(r){return new pe("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new dv({runCli:hq(t),version:r??"unknown"});await UEe(n,process.stdin,i=>process.stdout.write(i))})}a(gq,"mcpCommand");function pv(r){let e=new pe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"17.5.10"),e.addCommand($V()),e.addCommand(YV()),e.addCommand(S7()),e.addCommand(T7()),e.addCommand(W7()),e.addCommand(A7()),e.addCommand(O7()),e.addCommand(P7()),e.addCommand(Z7()),e.addCommand(iV()),e.addCommand(vV()),e.addCommand(CV()),e.addCommand(FV()),e.addCommand(DV()),e.addCommand(NV()),e.addCommand(kV()),e.addCommand(bG()),e.addCommand(wG()),e.addCommand(HG()),e.addCommand(YG()),e.addCommand(JG()),e.addCommand(ZG()),e.addCommand(rq()),e.addCommand(kG()),e.addCommand(qG()),e.addCommand(nq()),e.addCommand(gq(r??"17.5.10")),e}a(pv,"createProgram");pv().parse();0&&(module.exports={createProgram});
712
712
  /*! Bundled license information:
713
713
 
714
714
  reflect-metadata/Reflect.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitelev/exocortex-cli",
3
- "version": "17.5.9",
3
+ "version": "17.5.10",
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": {