@kitelev/exocortex-cli 16.205.0 → 16.206.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.
- package/dist/index.js +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.
|
|
2
|
+
// @kitelev/exocortex-cli v16.206.0
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -646,7 +646,7 @@ FAIL: ${n.dangling.length} dangling + ${n.floorViolations.length} floor violatio
|
|
|
646
646
|
`).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(xde,"parseLastJsonLine");function pU(n,e){return e.filter(t=>{let r=n[t];return typeof r!="string"||r.trim().length===0})}a(pU,"missingStringFields");var tS=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:dU,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:dU,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:Ade,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:fU}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:Ide,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,r=e.arguments??{},i;if(t==="create_asset"){let c=pU(r,["vault","class","label"]);if(c.length>0)return Wf(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=cU(r);if(l!==null)return Wf(`create_asset: ${l}`,!0);i=lU(r)}else if(t==="create_effort"){let c=pU(r,["vault","command","target"]);if(c.length>0)return Wf(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=uU(r)}else return Wf(`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 Wf(`exocortex-cli exited ${s.exitCode}
|
|
647
647
|
${c}`,!0)}let o=xde(s.stdout);return Wf(o===void 0?s.stdout.trim():JSON.stringify(o))}};var gU=require("child_process");var Rde=32*1024*1024;function yU(n){return e=>new Promise(t=>{(0,gU.execFile)(process.execPath,[n,...e],{maxBuffer:Rde},(r,i,s)=>{let o=0;if(r){let c=r.code;o=typeof c=="number"?c:1}t({stdout:i,stderr:s,exitCode:o})})})}a(yU,"createSelfCliRunner");async function Cde(n,e,t){let r=(0,bU.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:hU,message:"Parse error: invalid JSON"}})+`
|
|
648
648
|
`);continue}let c;try{c=await n.handle(o)}catch(l){c={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:mU,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
|
|
649
|
-
`)}}a(Cde,"runStdioServer");function _U(n){return new Ae("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 tS({runCli:yU(t),version:n??"unknown"});await Cde(r,process.stdin,i=>process.stdout.write(i))})}a(_U,"mcpCommand");function rS(n){let e=new Ae;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.
|
|
649
|
+
`)}}a(Cde,"runStdioServer");function _U(n){return new Ae("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 tS({runCli:yU(t),version:n??"unknown"});await Cde(r,process.stdin,i=>process.stdout.write(i))})}a(_U,"mcpCommand");function rS(n){let e=new Ae;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.206.0"),e.addCommand(X$()),e.addCommand(o6()),e.addCommand(K5()),e.addCommand(Z5()),e.addCommand(b$()),e.addCommand(e$()),e.addCommand(o$()),e.addCommand(A$()),e.addCommand(O$()),e.addCommand(V$()),e.addCommand(G$()),e.addCommand(W$()),e.addCommand(z$()),e.addCommand(Y$()),e.addCommand(I6()),e.addCommand(C6()),e.addCommand(G6()),e.addCommand(H6()),e.addCommand(K6()),e.addCommand(Q6()),e.addCommand(eU()),e.addCommand(N6()),e.addCommand(B6()),e.addCommand(sU()),e.addCommand(oU()),e.addCommand(_U(n??"16.206.0")),e}a(rS,"createProgram");rS().parse();0&&(module.exports={createProgram});
|
|
650
650
|
/*! Bundled license information:
|
|
651
651
|
|
|
652
652
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED