exomind 0.3.5 → 0.3.7

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 CHANGED
@@ -3119,7 +3119,7 @@ var {
3119
3119
  // package.json
3120
3120
  var package_default = {
3121
3121
  name: "exomind",
3122
- version: "0.3.5",
3122
+ version: "0.3.7",
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"
@@ -4342,7 +4342,15 @@ async function whoami(client) {
4342
4342
  console.log(dim(` \u670D\u52A1\u5668: ${cfg.base_url}`));
4343
4343
  console.log(dim(` \u51ED\u8BC1: ${hint2} (${kind})`));
4344
4344
  if (me.authenticated) {
4345
- console.log(dim(` \u7528\u6237: ${me.name || me.login || "-"} (tenant: ${me.tenant_id || "-"})`));
4345
+ const userId = me.tenant_id || "-";
4346
+ const display = me.name || me.login || "";
4347
+ if (display) {
4348
+ console.log(dim(` \u7528\u6237: ${display} (\u7528\u6237ID: ${userId})`));
4349
+ } else if (me.method === "api_key") {
4350
+ console.log(dim(` \u7528\u6237ID: ${userId}\uFF08API Key \u4E0D\u643A\u5E26\u7528\u6237\u540D\uFF09`));
4351
+ } else {
4352
+ console.log(dim(` \u7528\u6237ID: ${userId}`));
4353
+ }
4346
4354
  }
4347
4355
  }
4348
4356
  );
@@ -4386,6 +4394,17 @@ function pruneBackups(file, keep) {
4386
4394
  } catch {
4387
4395
  }
4388
4396
  }
4397
+ function purgeMcpExomind(file) {
4398
+ const d = readJson2(file);
4399
+ if (!d) return false;
4400
+ const grp = d.mcpServers;
4401
+ if (!grp || !grp.exomind) return false;
4402
+ delete grp.exomind;
4403
+ if (Object.keys(grp).length === 0) delete d.mcpServers;
4404
+ backup(file);
4405
+ fs6.writeFileSync(file, JSON.stringify(d, null, 2) + "\n");
4406
+ return true;
4407
+ }
4389
4408
  async function install(_client, opts) {
4390
4409
  const claudeDir = path6.join(os2.homedir(), ".claude");
4391
4410
  const skillDestDir = path6.join(claudeDir, "skills", "exomind");
@@ -4431,11 +4450,29 @@ async function install(_client, opts) {
4431
4450
  ocMcp.exomind = { type: "local", command: ["exomind", "mcp"] };
4432
4451
  oc.mcp = ocMcp;
4433
4452
  fs6.writeFileSync(ocJson, JSON.stringify(oc, null, 2) + "\n");
4453
+ const purged = [];
4454
+ if (purgeMcpExomind(path6.join(claudeDir, "settings.json"))) purged.push("~/.claude/settings.json");
4455
+ let curDir = process.cwd();
4456
+ for (let i = 0; i < 12 && curDir !== path6.dirname(curDir); i++) {
4457
+ const f = path6.join(curDir, ".mcp.json");
4458
+ if (fs6.existsSync(f) && purgeMcpExomind(f)) purged.push(f.replace(os2.homedir(), "~"));
4459
+ curDir = path6.dirname(curDir);
4460
+ }
4461
+ if (purged.length) console.log(dim(` \u2192 \u6E05\u7406\u6B8B\u7559 exomind MCP \u6761\u76EE\uFF08\u907F\u514D\u8986\u76D6 stdio\uFF09: ${purged.join(", ")}`));
4434
4462
  console.log(ok("\u5DF2\u914D\u7F6E MCP server \u2192 exomind mcp"));
4435
4463
  console.log(dim(" \u2192 Claude Code: ~/.claude.json (mcpServers.exomind)"));
4436
4464
  console.log(dim(" \u2192 OpenCode: ~/.config/opencode/opencode.json (mcp.exomind)"));
4437
4465
  console.log(dim(" \u91CD\u542F\u5BF9\u5E94 Agent \u2192 \u62FF\u5230 mcp__exomind__* \u5DE5\u5177"));
4438
4466
  }
4467
+ const cfgFile = path6.join(os2.homedir(), ".exomind", "config.json");
4468
+ const cfg = readJson2(cfgFile);
4469
+ if (cfg && typeof cfg.base_url === "string" && cfg.base_url.includes("d.youhuale.cn")) {
4470
+ backup(cfgFile);
4471
+ cfg.base_url = DEFAULT_BASE_URL;
4472
+ fs6.writeFileSync(cfgFile, JSON.stringify(cfg, null, 2) + "\n");
4473
+ console.log(ok(`\u5DF2\u8FC1\u79FB base_url: d.youhuale.cn \u2192 ${DEFAULT_BASE_URL}`));
4474
+ console.log(dim(" (stdio MCP \u5B50\u8FDB\u7A0B\u8BFB\u6B64\u914D\u7F6E\uFF0C\u91CD\u542F Agent \u540E\u7528\u65B0\u57DF\u540D)"));
4475
+ }
4439
4476
  console.log(yellow("\n\u4E0B\u4E00\u6B65:"));
4440
4477
  console.log(dim(" 1. \u82E5\u672A\u914D\u7F6E\u51ED\u8BC1: exomind login"));
4441
4478
  console.log(dim(" 2. \u91CD\u542F Claude Code \u2192 skill + hook + mcp__exomind__* \u5168\u90E8\u751F\u6548"));