@kitelev/exocortex-cli 16.241.7 → 16.241.8
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.241.
|
|
2
|
+
// @kitelev/exocortex-cli v16.241.8
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -683,7 +683,7 @@ Next steps:
|
|
|
683
683
|
`).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(__e,"parseLastJsonLine");function J8(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(J8,"missingStringFields");var gE=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:Q8,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:Q8,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:y_e,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:X8}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:b_e,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=J8(n,["vault","class","label"]);if(c.length>0)return pp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=H8(n);if(l!==null)return pp(`create_asset: ${l}`,!0);i=K8(n)}else if(t==="create_effort"){let c=J8(n,["vault","command","target"]);if(c.length>0)return pp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=Y8(n)}else return pp(`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 pp(`exocortex-cli exited ${s.exitCode}
|
|
684
684
|
${c}`,!0)}let o=__e(s.stdout);return pp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var tV=require("child_process");var S_e=32*1024*1024;function rV(r){return e=>new Promise(t=>{(0,tV.execFile)(process.execPath,[r,...e],{maxBuffer:S_e},(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(rV,"createSelfCliRunner");async function w_e(r,e,t){let n=(0,nV.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:Z8,message:"Parse error: invalid JSON"}})+`
|
|
685
685
|
`);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:eV,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
|
|
686
|
-
`)}}a(w_e,"runStdioServer");function iV(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 gE({runCli:rV(t),version:r??"unknown"});await w_e(n,process.stdin,i=>process.stdout.write(i))})}a(iV,"mcpCommand");function yE(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??"16.241.
|
|
686
|
+
`)}}a(w_e,"runStdioServer");function iV(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 gE({runCli:rV(t),version:r??"unknown"});await w_e(n,process.stdin,i=>process.stdout.write(i))})}a(iV,"mcpCommand");function yE(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??"16.241.8"),e.addCommand(M7()),e.addCommand(z7()),e.addCommand(O6()),e.addCommand(L6()),e.addCommand(r7()),e.addCommand(N6()),e.addCommand(B6()),e.addCommand(V6()),e.addCommand(u7()),e.addCommand(m7()),e.addCommand(R7()),e.addCommand(O7()),e.addCommand(P7()),e.addCommand(D7()),e.addCommand(L7()),e.addCommand(y8()),e.addCommand(S8()),e.addCommand(N8()),e.addCommand(M8()),e.addCommand(U8()),e.addCommand(B8()),e.addCommand(q8()),e.addCommand(I8()),e.addCommand(F8()),e.addCommand(W8()),e.addCommand(iV(r??"16.241.8")),e}a(yE,"createProgram");yE().parse();0&&(module.exports={createProgram});
|
|
687
687
|
/*! Bundled license information:
|
|
688
688
|
|
|
689
689
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED