@kitelev/exocortex-cli 16.230.8 → 16.230.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.
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v16.230.
|
|
2
|
+
// @kitelev/exocortex-cli v16.230.10
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -639,7 +639,7 @@ Next steps:
|
|
|
639
639
|
`).map(r=>r.trim()).filter(r=>r.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(ghe,"parseLastJsonLine");function bB(n,e){return e.filter(t=>{let r=n[t];return typeof r!="string"||r.trim().length===0})}a(bB,"missingStringFields");var wS=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:_B,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,r=t===void 0;if(typeof e.method!="string")return r?null:{jsonrpc:"2.0",id:t??null,error:{code:_B,message:"Invalid request: missing method"}};if(r)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:hhe,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:yB}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:mhe,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,r=e.arguments??{},i;if(t==="create_asset"){let l=bB(r,["vault","class","label"]);if(l.length>0)return td(`create_asset: missing required argument(s): ${l.join(", ")}`,!0);let c=hB(r);if(c!==null)return td(`create_asset: ${c}`,!0);i=mB(r)}else if(t==="create_effort"){let l=bB(r,["vault","command","target"]);if(l.length>0)return td(`create_effort: missing required argument(s): ${l.join(", ")}`,!0);i=gB(r)}else return td(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let l=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return td(`exocortex-cli exited ${s.exitCode}
|
|
640
640
|
${l}`,!0)}let o=ghe(s.stdout);return td(o===void 0?s.stdout.trim():JSON.stringify(o))}};var EB=require("child_process");var yhe=32*1024*1024;function vB(n){return e=>new Promise(t=>{(0,EB.execFile)(process.execPath,[n,...e],{maxBuffer:yhe},(r,i,s)=>{let o=0;if(r){let l=r.code;o=typeof l=="number"?l:1}t({stdout:i,stderr:s,exitCode:o})})})}a(vB,"createSelfCliRunner");async function _he(n,e,t){let r=(0,TB.createInterface)({input:e,crlfDelay:1/0});for await(let i of r){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:SB,message:"Parse error: invalid JSON"}})+`
|
|
641
641
|
`);continue}let l;try{l=await n.handle(o)}catch(c){l={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:wB,message:`Internal error: ${c instanceof Error?c.message:String(c)}`}}}l!==null&&t(JSON.stringify(l)+`
|
|
642
|
-
`)}}a(_he,"runStdioServer");function AB(n){return new Ie("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],r=new wS({runCli:vB(t),version:n??"unknown"});await _he(r,process.stdin,i=>process.stdout.write(i))})}a(AB,"mcpCommand");function ES(n){let e=new Ie;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.230.
|
|
642
|
+
`)}}a(_he,"runStdioServer");function AB(n){return new Ie("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],r=new wS({runCli:vB(t),version:n??"unknown"});await _he(r,process.stdin,i=>process.stdout.write(i))})}a(AB,"mcpCommand");function ES(n){let e=new Ie;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.230.10"),e.addCommand(lU()),e.addCommand(yU()),e.addCommand(i6()),e.addCommand(l6()),e.addCommand(O6()),e.addCommand(c6()),e.addCommand(m6()),e.addCommand(g6()),e.addCommand(M6()),e.addCommand(V6()),e.addCommand(eU()),e.addCommand(tU()),e.addCommand(rU()),e.addCommand(iU()),e.addCommand(sU()),e.addCommand(MU()),e.addCommand(UU()),e.addCommand(tB()),e.addCommand(nB()),e.addCommand(oB()),e.addCommand(aB()),e.addCommand(fB()),e.addCommand(HU()),e.addCommand(JU()),e.addCommand(dB()),e.addCommand(AB(n??"16.230.10")),e}a(ES,"createProgram");ES().parse();0&&(module.exports={createProgram});
|
|
643
643
|
/*! Bundled license information:
|
|
644
644
|
|
|
645
645
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitelev/exocortex-cli",
|
|
3
|
-
"version": "16.230.
|
|
3
|
+
"version": "16.230.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": {
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@types/js-yaml": "^4.0.0",
|
|
69
69
|
"@types/node": "^20.19.24",
|
|
70
70
|
"esbuild": "^0.27.1",
|
|
71
|
-
"jest": "^30.2
|
|
71
|
+
"jest": "^30.4.2",
|
|
72
72
|
"reflect-metadata": "^0.2.2",
|
|
73
|
-
"ts-jest": "^29.4.
|
|
73
|
+
"ts-jest": "^29.4.12",
|
|
74
74
|
"tsyringe": "^4.8.0",
|
|
75
75
|
"typescript": "^5.9.3"
|
|
76
76
|
}
|