@kitelev/exocortex-cli 17.14.5 → 17.15.0

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 v17.14.5
2
+ // @kitelev/exocortex-cli v17.15.0
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -714,7 +714,7 @@ Next steps:
714
714
  `).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(cAe,"parseLastJsonLine");function DW(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(DW,"missingStringFields");var Gv=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:LW,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:LW,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:oAe,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:FW}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:aAe,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=DW(n,["vault","class","label"]);if(c.length>0)return Yp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=OW(n);if(l!==null)return Yp(`create_asset: ${l}`,!0);i=xW(n)}else if(t==="create_effort"){let c=DW(n,["vault","command","target"]);if(c.length>0)return Yp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=PW(n)}else return Yp(`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 Yp(`exocortex-cli exited ${s.exitCode}
715
715
  ${c}`,!0)}let o=cAe(s.stdout);return Yp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var MW=require("child_process");var lAe=32*1024*1024;function $W(r){return e=>new Promise(t=>{(0,MW.execFile)(process.execPath,[r,...e],{maxBuffer:lAe},(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($W,"createSelfCliRunner");async function uAe(r,e,t){let n=(0,jW.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:NW,message:"Parse error: invalid JSON"}})+`
716
716
  `);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:kW,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
717
- `)}}a(uAe,"runStdioServer");function BW(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 Gv({runCli:$W(t),version:r??"unknown"});await uAe(n,process.stdin,i=>process.stdout.write(i))})}a(BW,"mcpCommand");function qv(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.14.5"),e.addCommand(aq()),e.addCommand(yq()),e.addCommand(BV()),e.addCommand(WV()),e.addCommand(dG()),e.addCommand(KV()),e.addCommand(QV()),e.addCommand(JV()),e.addCommand(SG()),e.addCommand(AG()),e.addCommand(WG()),e.addCommand(XG()),e.addCommand(eq()),e.addCommand(tq()),e.addCommand(rq()),e.addCommand(nq()),e.addCommand(iq()),e.addCommand(Uq()),e.addCommand(qq()),e.addCommand(yW()),e.addCommand(_W()),e.addCommand(EW()),e.addCommand(vW()),e.addCommand(IW()),e.addCommand(oW()),e.addCommand(hW()),e.addCommand(RW()),e.addCommand(BW(r??"17.14.5")),e}a(qv,"createProgram");qv().parse();0&&(module.exports={createProgram});
717
+ `)}}a(uAe,"runStdioServer");function BW(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 Gv({runCli:$W(t),version:r??"unknown"});await uAe(n,process.stdin,i=>process.stdout.write(i))})}a(BW,"mcpCommand");function qv(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.15.0"),e.addCommand(aq()),e.addCommand(yq()),e.addCommand(BV()),e.addCommand(WV()),e.addCommand(dG()),e.addCommand(KV()),e.addCommand(QV()),e.addCommand(JV()),e.addCommand(SG()),e.addCommand(AG()),e.addCommand(WG()),e.addCommand(XG()),e.addCommand(eq()),e.addCommand(tq()),e.addCommand(rq()),e.addCommand(nq()),e.addCommand(iq()),e.addCommand(Uq()),e.addCommand(qq()),e.addCommand(yW()),e.addCommand(_W()),e.addCommand(EW()),e.addCommand(vW()),e.addCommand(IW()),e.addCommand(oW()),e.addCommand(hW()),e.addCommand(RW()),e.addCommand(BW(r??"17.15.0")),e}a(qv,"createProgram");qv().parse();0&&(module.exports={createProgram});
718
718
  /*! Bundled license information:
719
719
 
720
720
  reflect-metadata/Reflect.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitelev/exocortex-cli",
3
- "version": "17.14.5",
3
+ "version": "17.15.0",
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": {