exomind 0.3.10 → 0.3.12

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.10",
3122
+ version: "0.3.12",
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,11 +4427,35 @@ 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;
4433
4457
  try {
4434
- child = (0, import_node_child_process.spawn)("exomind", ["mcp"], { stdio: ["pipe", "pipe", "pipe"], shell: true });
4458
+ child = (0, import_node_child_process.spawn)("exomind", ["mcp"], { stdio: ["pipe", "pipe", "pipe"], shell: process.platform === "win32" });
4435
4459
  } catch (e) {
4436
4460
  resolve6({ ok: false, detail: `\u65E0\u6CD5\u542F\u52A8: ${e instanceof Error ? e.message : e}` });
4437
4461
  return;
@@ -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");
@@ -4554,7 +4580,9 @@ async function install(client, opts) {
4554
4580
  if (!live.api_key) {
4555
4581
  console.log(dim(" \uFF08\u672A\u914D\u7F6E API Key\uFF0C\u8DF3\u8FC7\u81EA\u68C0\uFF1Bexomind login \u540E\u91CD\u8DD1 install \u53EF\u81EA\u68C0\uFF09"));
4556
4582
  } else {
4557
- console.log(me && me.authenticated ? ok(" \u670D\u52A1\u5668\u8FDE\u901A + \u9274\u6743\u6709\u6548") : yellow(" \u2717 \u670D\u52A1\u5668\u8FDE\u901A/\u9274\u6743\u5F02\u5E38 \u2192 exomind whoami \u6838\u9A8C"));
4583
+ console.log(
4584
+ me && me.authenticated ? ok(` \u670D\u52A1\u5668\u8FDE\u901A + \u9274\u6743\u6709\u6548\uFF08tenant ${me.tenant_id} \xB7 ${keyHint}\uFF09`) : yellow(" \u2717 \u670D\u52A1\u5668\u8FDE\u901A/\u9274\u6743\u5F02\u5E38 \u2192 exomind whoami \u6838\u9A8C")
4585
+ );
4558
4586
  console.log(mcp.ok ? ok(` MCP \u670D\u52A1\u7AEF\u53EF\u7528\uFF08${mcp.detail}\uFF09`) : yellow(` \u2717 MCP \u670D\u52A1\u7AEF\u5F02\u5E38\uFF1A${mcp.detail}`));
4559
4587
  }
4560
4588
  console.log(yellow("\n\u4E0B\u4E00\u6B65:"));
@@ -4562,7 +4590,6 @@ async function install(client, opts) {
4562
4590
  console.log(dim(" 1. exomind login\uFF08\u7C98\u8D34 API Key\uFF09"));
4563
4591
  console.log(dim(" 2. \u91CD\u542F Claude Code\uFF08\u52A0\u8F7D skill/hook/MCP\uFF09\u2192 mcp__exomind__* \u751F\u6548"));
4564
4592
  } else if (me && me.authenticated && mcp.ok) {
4565
- console.log(ok(`\u51ED\u8BC1\u6709\u6548\uFF1A${live.base_url}\uFF08${keyHint}\uFF09\xB7 tenant ${me.tenant_id}`));
4566
4593
  console.log(dim(" \u81EA\u68C0\u5168\u8FC7 \u2192 \u91CD\u542F Claude Code\uFF08skill/hook/MCP \u542F\u52A8\u65F6\u8F7D\u5165\uFF09\u5373\u751F\u6548"));
4567
4594
  } else {
4568
4595
  console.log(yellow("\u81EA\u68C0\u6709\u5F02\u5E38\uFF0C\u8BF7\u6309\u4E0A\u65B9 \u2717 \u63D0\u793A\u6838\u9A8C\u540E\u518D\u91CD\u542F\u4F7F\u7528\u3002"));