@kitelev/exocortex-cli 16.233.0 → 16.233.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.233.0
2
+ // @kitelev/exocortex-cli v16.233.1
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -666,7 +666,7 @@ Next steps:
666
666
  `).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(Xye,"parseLastJsonLine");function x7(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(x7,"missingStringFields");var Uw=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:C7,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:C7,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:Yye,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:R7}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:Qye,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=x7(n,["vault","class","label"]);if(c.length>0)return Xd(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=T7(n);if(l!==null)return Xd(`create_asset: ${l}`,!0);i=A7(n)}else if(t==="create_effort"){let c=x7(n,["vault","command","target"]);if(c.length>0)return Xd(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=I7(n)}else return Xd(`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 Xd(`exocortex-cli exited ${s.exitCode}
667
667
  ${c}`,!0)}let o=Xye(s.stdout);return Xd(o===void 0?s.stdout.trim():JSON.stringify(o))}};var F7=require("child_process");var Jye=32*1024*1024;function D7(r){return e=>new Promise(t=>{(0,F7.execFile)(process.execPath,[r,...e],{maxBuffer:Jye},(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(D7,"createSelfCliRunner");async function Zye(r,e,t){let n=(0,L7.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:O7,message:"Parse error: invalid JSON"}})+`
668
668
  `);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:P7,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
669
- `)}}a(Zye,"runStdioServer");function N7(r){return new fe("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 Uw({runCli:D7(t),version:r??"unknown"});await Zye(n,process.stdin,i=>process.stdout.write(i))})}a(N7,"mcpCommand");function Bw(r){let e=new fe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"16.233.0"),e.addCommand(_B()),e.addCommand(RB()),e.addCommand(h6()),e.addCommand(_6()),e.addCommand(U6()),e.addCommand(b6()),e.addCommand(A6()),e.addCommand(I6()),e.addCommand(z6()),e.addCommand(J6()),e.addCommand(uB()),e.addCommand(fB()),e.addCommand(dB()),e.addCommand(hB()),e.addCommand(mB()),e.addCommand(zB()),e.addCommand(QB()),e.addCommand(f7()),e.addCommand(p7()),e.addCommand(g7()),e.addCommand(y7()),e.addCommand(w7()),e.addCommand(r7()),e.addCommand(c7()),e.addCommand(E7()),e.addCommand(N7(r??"16.233.0")),e}a(Bw,"createProgram");Bw().parse();0&&(module.exports={createProgram});
669
+ `)}}a(Zye,"runStdioServer");function N7(r){return new fe("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 Uw({runCli:D7(t),version:r??"unknown"});await Zye(n,process.stdin,i=>process.stdout.write(i))})}a(N7,"mcpCommand");function Bw(r){let e=new fe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"16.233.1"),e.addCommand(_B()),e.addCommand(RB()),e.addCommand(h6()),e.addCommand(_6()),e.addCommand(U6()),e.addCommand(b6()),e.addCommand(A6()),e.addCommand(I6()),e.addCommand(z6()),e.addCommand(J6()),e.addCommand(uB()),e.addCommand(fB()),e.addCommand(dB()),e.addCommand(hB()),e.addCommand(mB()),e.addCommand(zB()),e.addCommand(QB()),e.addCommand(f7()),e.addCommand(p7()),e.addCommand(g7()),e.addCommand(y7()),e.addCommand(w7()),e.addCommand(r7()),e.addCommand(c7()),e.addCommand(E7()),e.addCommand(N7(r??"16.233.1")),e}a(Bw,"createProgram");Bw().parse();0&&(module.exports={createProgram});
670
670
  /*! Bundled license information:
671
671
 
672
672
  reflect-metadata/Reflect.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitelev/exocortex-cli",
3
- "version": "16.233.0",
3
+ "version": "16.233.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": {