vault-go 0.23.1 → 0.23.3

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.
@@ -14,6 +14,8 @@ export declare function startLocalService(options?: {
14
14
  authenticate?: typeof authenticateWithBrowser;
15
15
  cacheKey?: Buffer;
16
16
  device?: ReturnType<typeof localDevice> | false;
17
+ /** Home dos clientes de IA (configs reais), separado do cofre de dados. */
18
+ clientHome?: string;
17
19
  context?: {
18
20
  list: () => ReturnType<typeof listContextEngines>;
19
21
  generate: typeof generateContext;
@@ -1,4 +1,5 @@
1
1
  import { createServer } from "node:http";
2
+ import { homedir } from "node:os";
2
3
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync, } from "node:fs";
3
4
  import { join } from "node:path";
4
5
  import { createHash, createHmac, randomBytes, timingSafeEqual, } from "node:crypto";
@@ -100,6 +101,7 @@ function readBody(req, limit = 8192) {
100
101
  }
101
102
  export async function startLocalService(options = {}) {
102
103
  const home = options.home ?? vaultHome();
104
+ const clientHome = options.clientHome ?? homedir();
103
105
  const token = localAccessToken(home);
104
106
  const cloud = options.cloud ?? new VaultCloudClient(home, fetch, false);
105
107
  let storage;
@@ -465,7 +467,7 @@ export async function startLocalService(options = {}) {
465
467
  return;
466
468
  }
467
469
  if (url.pathname === "/api/mcp/clients" && req.method === "GET") {
468
- json(200, { clients: listMcpClients(home) });
470
+ json(200, { clients: listMcpClients(clientHome) });
469
471
  return;
470
472
  }
471
473
  if (url.pathname === "/api/mcp/clients" && req.method === "POST") {
@@ -475,7 +477,7 @@ export async function startLocalService(options = {}) {
475
477
  json(400, { error: "invalid_client" });
476
478
  return;
477
479
  }
478
- const result = connectMcpClient(data.client, home);
480
+ const result = connectMcpClient(data.client, clientHome);
479
481
  json(200, { ok: true, ...result, connected: true });
480
482
  return;
481
483
  }
@@ -95,17 +95,24 @@ function serverConfiguredInToml(path) {
95
95
  }
96
96
  }
97
97
  function clientCliInstalled(client, home) {
98
+ if (home === homedir())
99
+ return clientCliWithEnv(client, process.env);
100
+ // Why: tests point home at a temp dir; pin each CLI's config env so the
101
+ // check reads the temp config, not the real one.
102
+ return clientCliWithEnv(client, {
103
+ ...process.env,
104
+ HOME: home,
105
+ CODEX_HOME: join(home, ".codex"),
106
+ CLAUDE_CONFIG_DIR: join(home, ".claude"),
107
+ });
108
+ }
109
+ function clientCliWithEnv(client, env) {
98
110
  try {
99
- return (spawnSync(client, ["mcp", "get", "vault-go"], {
111
+ return spawnSync(client, ["mcp", "get", "vault-go"], {
100
112
  timeout: 4000,
101
113
  stdio: "ignore",
102
- env: {
103
- ...process.env,
104
- HOME: home,
105
- CODEX_HOME: join(home, ".codex"),
106
- CLAUDE_CONFIG_DIR: join(home, ".claude"),
107
- },
108
- }).status === 0);
114
+ env,
115
+ }).status === 0;
109
116
  }
110
117
  catch {
111
118
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vault-go",
3
- "version": "0.23.1",
3
+ "version": "0.23.3",
4
4
  "description": "MCP server and installer for Vault Memory: search, capture, and use account memory across AI clients.",
5
5
  "type": "module",
6
6
  "bin": {