exomind 0.3.0 → 0.3.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.
- package/README.md +16 -18
- package/dist/cli.js +15 -4
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,35 +42,33 @@ exomind feedback "entities/Redis.md" positive
|
|
|
42
42
|
|
|
43
43
|
加 `--json` 获取机器可读输出(脚本/管道):`exomind --json stats | jq .total_nodes`。
|
|
44
44
|
|
|
45
|
-
## 接入 Claude Code
|
|
45
|
+
## 接入 Claude Code(一条命令,默认全装)
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
exomind install
|
|
48
|
+
exomind install # 装 skill + hook + MCP,全部自动(幂等+备份)
|
|
49
|
+
# 不想要某项: exomind install --no-hook 或 --no-mcp
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
一行完成三层,免手改任何 JSON:
|
|
53
|
+
- **① MCP 工具**(能力):写 `~/.claude.json` 的 `mcpServers.exomind` → Agent 拿到 `mcp__exomind__*` 确定性工具。
|
|
54
|
+
- **② skill**(指导):拷到 `~/.claude/skills/exomind/`。
|
|
55
|
+
- **③ hook**(闸门):写 `settings.json` 的 `UserPromptSubmit → exomind hook`。
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
重启 Claude Code 后:
|
|
58
|
+
- 说 **`存档`** / **`jdit`** → 自动回顾会话、摄入。
|
|
54
59
|
- 提问涉及知识库已有实体 → 自动注入 `[ExoMind 知识库上下文]`。
|
|
55
|
-
-
|
|
60
|
+
- Agent 需查询/摄入时 → 直接调 `mcp__exomind__*`(确定),或按 skill 跑 `exomind` CLI。
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
完整接入步骤见服务端仓库 `myExoMindManager/docs/new-machine-setup.md`。
|
|
58
63
|
|
|
59
|
-
##
|
|
64
|
+
## 关于 MCP 工具层(Claude Code 已默认装;OpenCode 需手写)
|
|
60
65
|
|
|
61
|
-
`exomind
|
|
66
|
+
`exomind install` 已默认把 MCP 写进 Claude Code 的 `~/.claude.json`(见上)。这里仅给**其它宿主/手写**场景:
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{ "mcpServers": { "exomind": { "command": "exomind", "args": ["mcp"] } } }
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**OpenCode**(`opencode.json`):
|
|
69
|
-
```json
|
|
70
|
-
{ "mcp": { "exomind": { "type": "local", "command": ["exomind", "mcp"] } } }
|
|
71
|
-
```
|
|
68
|
+
- **OpenCode**(`opencode.json`):`{ "mcp": { "exomind": { "type": "local", "command": ["exomind", "mcp"] } } }`
|
|
69
|
+
- **手写 Claude Code**:`~/.claude.json` 或项目 `.mcp.json`:`{ "mcpServers": { "exomind": { "command": "exomind", "args": ["mcp"] } } }`
|
|
72
70
|
|
|
73
|
-
|
|
71
|
+
`exomind mcp` 是本地 stdio MCP server,把 ingest/query/search/entity/relations/stats 暴露为 typed tool;复用同一份凭证,三平台都能跑(本地 stdio,不涉及远程 SSE 的 Windows 坑)。详见 [三层模式说明](./docs/mcp.md)。
|
|
74
72
|
|
|
75
73
|
## 命令一览
|
|
76
74
|
|
package/dist/cli.js
CHANGED
|
@@ -3119,7 +3119,7 @@ var {
|
|
|
3119
3119
|
// package.json
|
|
3120
3120
|
var package_default = {
|
|
3121
3121
|
name: "exomind",
|
|
3122
|
-
version: "0.3.
|
|
3122
|
+
version: "0.3.1",
|
|
3123
3123
|
description: "ExoMind \u8DE8\u5E73\u53F0\u547D\u4EE4\u884C\u5BA2\u6237\u7AEF \u2014 \u901A\u8FC7 REST \u4E0E ExoMind \u77E5\u8BC6\u5E93\u4EA4\u4E92(ingest/query/search/review),\u66FF\u4EE3 Windows \u4E0D\u53EF\u7528\u7684 MCP \u5BA2\u6237\u7AEF\u3002",
|
|
3124
3124
|
bin: {
|
|
3125
3125
|
exomind: "dist/cli.js"
|
|
@@ -4308,7 +4308,7 @@ async function install(_client, opts) {
|
|
|
4308
4308
|
fs6.copyFileSync(SKILL_SRC, path6.join(skillDestDir, "SKILL.md"));
|
|
4309
4309
|
console.log(ok("\u5DF2\u5B89\u88C5 Claude Code skill"));
|
|
4310
4310
|
console.log(dim(` \u2192 ${skillDestDir}/SKILL.md`));
|
|
4311
|
-
if (opts.
|
|
4311
|
+
if (opts.hook !== false) {
|
|
4312
4312
|
const settingsFile = path6.join(claudeDir, "settings.json");
|
|
4313
4313
|
fs6.mkdirSync(claudeDir, { recursive: true });
|
|
4314
4314
|
backup(settingsFile);
|
|
@@ -4327,9 +4327,20 @@ async function install(_client, opts) {
|
|
|
4327
4327
|
console.log(ok("\u5DF2\u914D\u7F6E UserPromptSubmit hook \u2192 exomind hook"));
|
|
4328
4328
|
console.log(dim(" \u91CD\u542F Claude Code \u751F\u6548\u3002hook \u51FA\u9519\u4E0D\u4F1A\u963B\u585E\u4F60\u7684\u8F93\u5165(\u9519\u8BEF\u53EA\u8FDB stderr)\u3002"));
|
|
4329
4329
|
}
|
|
4330
|
+
if (opts.mcp !== false) {
|
|
4331
|
+
const claudeJson = path6.join(os2.homedir(), ".claude.json");
|
|
4332
|
+
backup(claudeJson);
|
|
4333
|
+
const cc = readJson2(claudeJson) ?? {};
|
|
4334
|
+
const mcpServers = cc.mcpServers ?? {};
|
|
4335
|
+
mcpServers.exomind = { command: "exomind", args: ["mcp"] };
|
|
4336
|
+
cc.mcpServers = mcpServers;
|
|
4337
|
+
fs6.writeFileSync(claudeJson, JSON.stringify(cc, null, 2) + "\n");
|
|
4338
|
+
console.log(ok("\u5DF2\u914D\u7F6E MCP server \u2192 exomind mcp"));
|
|
4339
|
+
console.log(dim(" \u2192 ~/.claude.json (mcpServers.exomind);\u91CD\u542F Claude Code \u540E Agent \u62FF\u5230 mcp__exomind__* \u5DE5\u5177"));
|
|
4340
|
+
}
|
|
4330
4341
|
console.log(yellow("\n\u4E0B\u4E00\u6B65:"));
|
|
4331
4342
|
console.log(dim(" 1. \u82E5\u672A\u914D\u7F6E\u51ED\u8BC1: exomind login"));
|
|
4332
|
-
console.log(dim(" 2. \u91CD\u542F Claude Code
|
|
4343
|
+
console.log(dim(" 2. \u91CD\u542F Claude Code \u2192 skill + hook + mcp__exomind__* \u5168\u90E8\u751F\u6548"));
|
|
4333
4344
|
}
|
|
4334
4345
|
|
|
4335
4346
|
// src/cli.ts
|
|
@@ -4413,7 +4424,7 @@ program2.command("mcp").description("\u542F\u52A8 stdio MCP server(\u4F9B Claude
|
|
|
4413
4424
|
const client = new ApiClient(cfg);
|
|
4414
4425
|
await runMcpServer(client);
|
|
4415
4426
|
});
|
|
4416
|
-
program2.command("install").description("\u5B89\u88C5
|
|
4427
|
+
program2.command("install").description("\u5B89\u88C5 skill + hook + MCP(\u9ED8\u8BA4\u5168\u88C5;--no-hook / --no-mcp \u5173\u95ED\u67D0\u9879)").option("--no-hook", "\u4E0D\u5199 UserPromptSubmit hook").option("--no-mcp", "\u4E0D\u5199 MCP server \u914D\u7F6E").action(run(install));
|
|
4417
4428
|
async function main() {
|
|
4418
4429
|
const first = process.argv[2];
|
|
4419
4430
|
if (first && /^(-v|--version)$/.test(first)) {
|