exomind 0.3.11 → 0.3.13
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/cli.js +35 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
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.13",
|
|
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"
|
|
@@ -4427,6 +4427,30 @@ function purgeMcpExomind(file) {
|
|
|
4427
4427
|
fs6.writeFileSync(file, JSON.stringify(d, null, 2) + "\n");
|
|
4428
4428
|
return true;
|
|
4429
4429
|
}
|
|
4430
|
+
function configureCodexMcp() {
|
|
4431
|
+
const codexConfig = path6.join(os2.homedir(), ".codex", "config.toml");
|
|
4432
|
+
try {
|
|
4433
|
+
fs6.mkdirSync(path6.dirname(codexConfig), { recursive: true });
|
|
4434
|
+
} catch {
|
|
4435
|
+
}
|
|
4436
|
+
let existing = "";
|
|
4437
|
+
try {
|
|
4438
|
+
existing = fs6.readFileSync(codexConfig, "utf-8");
|
|
4439
|
+
} catch {
|
|
4440
|
+
existing = "";
|
|
4441
|
+
}
|
|
4442
|
+
if (/^\[mcp_servers\.exomind\]\s*$/m.test(existing)) {
|
|
4443
|
+
return false;
|
|
4444
|
+
}
|
|
4445
|
+
backup(codexConfig);
|
|
4446
|
+
const prefix = existing && !existing.endsWith("\n") ? "\n\n" : existing ? "\n" : "";
|
|
4447
|
+
const snippet = `${prefix}[mcp_servers.exomind]
|
|
4448
|
+
command = "exomind"
|
|
4449
|
+
args = ["mcp"]
|
|
4450
|
+
`;
|
|
4451
|
+
fs6.writeFileSync(codexConfig, existing + snippet);
|
|
4452
|
+
return true;
|
|
4453
|
+
}
|
|
4430
4454
|
function checkMcp(timeoutMs = 6e3) {
|
|
4431
4455
|
return new Promise((resolve6) => {
|
|
4432
4456
|
let child;
|
|
@@ -4516,6 +4540,7 @@ async function install(client, opts) {
|
|
|
4516
4540
|
ocMcp.exomind = { type: "local", command: ["exomind", "mcp"] };
|
|
4517
4541
|
oc.mcp = ocMcp;
|
|
4518
4542
|
fs6.writeFileSync(ocJson, JSON.stringify(oc, null, 2) + "\n");
|
|
4543
|
+
configureCodexMcp();
|
|
4519
4544
|
const purged = [];
|
|
4520
4545
|
if (purgeMcpExomind(path6.join(claudeDir, "settings.json"))) purged.push("~/.claude/settings.json");
|
|
4521
4546
|
let curDir = process.cwd();
|
|
@@ -4528,6 +4553,7 @@ async function install(client, opts) {
|
|
|
4528
4553
|
console.log(ok("\u5DF2\u914D\u7F6E MCP server \u2192 exomind mcp"));
|
|
4529
4554
|
console.log(dim(" \u2192 Claude Code: ~/.claude.json (mcpServers.exomind)"));
|
|
4530
4555
|
console.log(dim(" \u2192 OpenCode: ~/.config/opencode/opencode.json (mcp.exomind)"));
|
|
4556
|
+
console.log(dim(" \u2192 Codex: ~/.codex/config.toml ([mcp_servers.exomind])"));
|
|
4531
4557
|
console.log(dim(" \u91CD\u542F\u5BF9\u5E94 Agent \u2192 \u62FF\u5230 mcp__exomind__* \u5DE5\u5177"));
|
|
4532
4558
|
}
|
|
4533
4559
|
const cfgFile = path6.join(os2.homedir(), ".exomind", "config.json");
|
|
@@ -4543,10 +4569,14 @@ async function install(client, opts) {
|
|
|
4543
4569
|
const keyHint = live.api_key ? `${live.api_key.slice(0, 8)}\u2026${live.api_key.slice(-4)}` : "";
|
|
4544
4570
|
let me = null;
|
|
4545
4571
|
if (live.api_key) {
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4572
|
+
for (let i = 0; i < 3; i++) {
|
|
4573
|
+
try {
|
|
4574
|
+
me = await client.get("/auth/me", { timeoutMs: 6e3 });
|
|
4575
|
+
if (me && me.authenticated) break;
|
|
4576
|
+
} catch {
|
|
4577
|
+
me = null;
|
|
4578
|
+
}
|
|
4579
|
+
if (i < 2) await new Promise((r) => setTimeout(r, 1e3));
|
|
4550
4580
|
}
|
|
4551
4581
|
}
|
|
4552
4582
|
const mcp = live.api_key ? await checkMcp() : { ok: false, detail: "\u672A\u914D\u7F6E API Key" };
|