@kitelev/exocortex-cli 16.257.0 → 16.257.2
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/README.md +6 -8
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,7 +81,6 @@ npx @kitelev/exocortex-cli find --class ems__Task --vault ~/vault
|
|
|
81
81
|
| Option | Default | Description |
|
|
82
82
|
| ------------------ | ------- | --------------------------------------------------------------------------------------------- |
|
|
83
83
|
| `--vault <path>` | cwd | Path to Obsidian vault |
|
|
84
|
-
| `--also <path>` | — | Additional vault to include (repeatable) |
|
|
85
84
|
| `--sparql <query>` | — | SPARQL SELECT query (must bind `?path`) |
|
|
86
85
|
| `--class <value>` | — | Filter by class label via the vault's `find__Alias` asset labelled `class` (e.g. `ems__Task`) |
|
|
87
86
|
|
|
@@ -203,7 +202,6 @@ npx @kitelev/exocortex-cli query "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10" -
|
|
|
203
202
|
| Option | Default | Description |
|
|
204
203
|
| ----------------------- | ------- | -------------------------------------------------------------------------------------------- |
|
|
205
204
|
| `--vault <path>` | cwd | Path to Obsidian vault |
|
|
206
|
-
| `--also <path>` | — | Additional vault to include in the query (repeatable) |
|
|
207
205
|
| `--format <type>` | `table` | Output format: `table`, `json`, `csv`, `ntriples` |
|
|
208
206
|
| `--output <type>` | `text` | Response format: `text` or `json` (for MCP tools) |
|
|
209
207
|
| `--timeout <duration>` | `30s` | Query timeout (e.g. `30s`, `5000ms`); env fallback `EXOCORTEX_SPARQL_TIMEOUT` |
|
|
@@ -220,6 +218,8 @@ npx @kitelev/exocortex-cli query "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10" -
|
|
|
220
218
|
|
|
221
219
|
**Built-in templates:** `tasks-by-date`, `tasks-by-status`, `projects-active`, `concepts-by-domain`, `sleep-analysis`.
|
|
222
220
|
|
|
221
|
+
**One vault per call.** The query store is built from the AssetSpaces mounted in `--vault` only (a vault is an environment; its profile decides what is mounted). The former `--also <path>` flag was removed in #3646. To query data your working vault does not mount — for example a cold archive AssetSpace — point `--vault` at a vault whose profile mounts it; no separate flag is needed.
|
|
222
|
+
|
|
223
223
|
**Examples:**
|
|
224
224
|
|
|
225
225
|
```bash
|
|
@@ -232,9 +232,9 @@ npx @kitelev/exocortex-cli query \
|
|
|
232
232
|
?task exo:Asset_label ?label .
|
|
233
233
|
}" --vault ~/vault
|
|
234
234
|
|
|
235
|
-
#
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
# Query an AssetSpace your working vault does not mount (e.g. a cold archive):
|
|
236
|
+
# run against a vault where it IS mounted — there is no extra-vault flag
|
|
237
|
+
npx @kitelev/exocortex-cli query "SELECT ?s WHERE { ?s ?p ?o }" --vault ~/vault-with-archive
|
|
238
238
|
|
|
239
239
|
# Template with parameters
|
|
240
240
|
npx @kitelev/exocortex-cli query --template tasks-by-date --param date=2026-01-15 --vault ~/vault
|
|
@@ -275,7 +275,6 @@ npx @kitelev/exocortex-cli index --vault ~/vault --stats
|
|
|
275
275
|
| Option | Default | Description |
|
|
276
276
|
| ----------------- | ------- | -------------------------------------------------------------- |
|
|
277
277
|
| `--vault <path>` | cwd | Path to Obsidian vault |
|
|
278
|
-
| `--also <path>` | — | Additional vault to include in the combined index (repeatable) |
|
|
279
278
|
| `--output <type>` | `text` | Response format: `text` or `json` |
|
|
280
279
|
| `--stats` | off | Show cache statistics after building |
|
|
281
280
|
| `--force` | off | Force rebuild even if the cache is valid |
|
|
@@ -297,10 +296,9 @@ Check frontmatter properties against the ontology (schema linting), or run SHACL
|
|
|
297
296
|
| Option | Default | Description |
|
|
298
297
|
| ----------------- | ------- | -------------------------------------------------------------------------------------- |
|
|
299
298
|
| `--vault <path>` | cwd | Path to Obsidian vault |
|
|
300
|
-
| `--also <path>` | — | Additional vault merged into the validation graph (repeatable; disables `--use-cache`) |
|
|
301
299
|
| `--output <type>` | `text` | Response format: `text` or `json` |
|
|
302
300
|
| `--staged` | off | Only validate git-staged `.md` files (for pre-commit hooks) |
|
|
303
|
-
| `--use-cache` | off | Use the persistent triple cache
|
|
301
|
+
| `--use-cache` | off | Use the persistent triple cache |
|
|
304
302
|
| `--shapes-mode` | off | Run SHACL-lite shapes validation instead of schema linting |
|
|
305
303
|
| `--format <type>` | `text` | Shapes-mode output format: `text`, `json`, `earl` |
|
|
306
304
|
| `--class <iri>` | — | Only validate assets whose `exo__Instance_class` matches this IRI/slug |
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v16.257.
|
|
2
|
+
// @kitelev/exocortex-cli v16.257.2
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -701,7 +701,7 @@ Next steps:
|
|
|
701
701
|
`).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(Rwe,"parseLastJsonLine");function _G(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(_G,"missingStringFields");var qE=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:bG,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:bG,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:Awe,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:yG}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:Iwe,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=_G(n,["vault","class","label"]);if(c.length>0)return Tp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=hG(n);if(l!==null)return Tp(`create_asset: ${l}`,!0);i=mG(n)}else if(t==="create_effort"){let c=_G(n,["vault","command","target"]);if(c.length>0)return Tp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=gG(n)}else return Tp(`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 Tp(`exocortex-cli exited ${s.exitCode}
|
|
702
702
|
${c}`,!0)}let o=Rwe(s.stdout);return Tp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var EG=require("child_process");var Cwe=32*1024*1024;function vG(r){return e=>new Promise(t=>{(0,EG.execFile)(process.execPath,[r,...e],{maxBuffer:Cwe},(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(vG,"createSelfCliRunner");async function xwe(r,e,t){let n=(0,TG.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:SG,message:"Parse error: invalid JSON"}})+`
|
|
703
703
|
`);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:wG,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
|
|
704
|
-
`)}}a(xwe,"runStdioServer");function AG(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 qE({runCli:vG(t),version:r??"unknown"});await xwe(n,process.stdin,i=>process.stdout.write(i))})}a(AG,"mcpCommand");function WE(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.257.
|
|
704
|
+
`)}}a(xwe,"runStdioServer");function AG(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 qE({runCli:vG(t),version:r??"unknown"});await xwe(n,process.stdin,i=>process.stdout.write(i))})}a(AG,"mcpCommand");function WE(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.257.2"),e.addCommand(nV()),e.addCommand(pV()),e.addCommand(j8()),e.addCommand(V8()),e.addCommand(l7()),e.addCommand(G8()),e.addCommand(K8()),e.addCommand(Y8()),e.addCommand(y7()),e.addCommand(E7()),e.addCommand(B7()),e.addCommand(z7()),e.addCommand(X7()),e.addCommand(Q7()),e.addCommand(Z7()),e.addCommand(eV()),e.addCommand(kV()),e.addCommand($V()),e.addCommand(rG()),e.addCommand(iG()),e.addCommand(aG()),e.addCommand(cG()),e.addCommand(fG()),e.addCommand(WV()),e.addCommand(ZV()),e.addCommand(dG()),e.addCommand(AG(r??"16.257.2")),e}a(WE,"createProgram");WE().parse();0&&(module.exports={createProgram});
|
|
705
705
|
/*! Bundled license information:
|
|
706
706
|
|
|
707
707
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED