vault-go 0.31.0 → 0.31.2

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 CHANGED
@@ -243,9 +243,10 @@ bun run typecheck
243
243
  bun test src
244
244
  bun run build
245
245
  npm run pack:check
246
+ npm run pack:smoke
246
247
  ```
247
248
 
248
- Pushes to `main` run CI. Conventional commits publish to npm (`fix` → patch, `feat` → minor, `BREAKING CHANGE` → major). `NPM_TOKEN` lives only in GitHub Actions.
249
+ CI and release currently run only when the **CI** workflow is started manually in GitHub Actions. The default run validates only. To publish after the checks pass, start it on `main` with the `publish` input enabled; pushes alone do not start it. The package smoke check installs the actual tarball in a temporary directory and checks the CLI and MCP handshake without account credentials. Conventional commits determine the version (`fix` → patch, `feat` → minor, `BREAKING CHANGE` → major). `NPM_TOKEN` lives only in GitHub Actions.
249
250
 
250
251
  ## Links
251
252
 
@@ -1,19 +1,64 @@
1
- export function redact(value) {
1
+ const SENSITIVE_KEY = /api[_-]?key|secret|token|password|authorization|cookie|credential|private[_-]?key/i;
2
+ /** Keep quoted values together: whitespace/escaped quotes must not leave a secret tail. */
3
+ function redactText(value, depth = 0) {
4
+ // Nested stringified payloads are untrusted. Do not recurse indefinitely.
5
+ if (depth >= 12)
6
+ return '[redacted]';
7
+ if (/^\s*[\[{\"]/.test(value)) {
8
+ try {
9
+ // Parsing handles arrays/objects used as credentials, escaped key names,
10
+ // and JSON string literals wrapping another serialized payload.
11
+ // Keep the capture field a string; its caller need not know it contained JSON.
12
+ return JSON.stringify(redactValue(JSON.parse(value), depth + 1));
13
+ }
14
+ catch { /* Partial JSON and pasted logs still use the text filter below. */ }
15
+ }
16
+ return value
17
+ .replace(new RegExp(`<(private|vault-private|${["claude", "mem", "context"].join("-")}|system_instruction|system-instruction|persisted-output|system-reminder)\\b[^>]*>[\\s\\S]*?(?:<\\/\\1\\s*>|$)`, "gi"), "[redacted]")
18
+ // Raw HTTP headers can contain spaces, auth schemes and several cookies.
19
+ // Stop at a shell argument's quote or a new line, preserving adjacent diagnostics.
20
+ .replace(/(\b(?:authorization|proxy-authorization|cookie|set-cookie)[ \t]*:[ \t]*)[^\r\n'\"]+/gi, '$1[redacted]')
21
+ .replace(/((?:["']?\b[\w-]+["']?)[ \t]*[:=][ \t]*)("(?:\\[\s\S]|[^"\\])*(?:"|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|\[redacted\]|[^\s,"'{}\]]+)/g, (match, prefix, credential) => {
22
+ const key = prefix.replace(/["'\s:=]/g, '');
23
+ const quote = credential[0] === '"' || credential[0] === "'" ? credential[0] : '';
24
+ // A public field can itself contain serialized JSON, shell output or a
25
+ // pasted header. Inspect its contents instead of skipping the whole value.
26
+ if (!SENSITIVE_KEY.test(key)) {
27
+ if (!quote)
28
+ return match;
29
+ const closed = credential.endsWith(quote) && credential.length > 1;
30
+ const inner = credential.slice(1, closed ? -1 : undefined);
31
+ // JSON unescaping makes escaped credential keys visible to the same filter.
32
+ if (quote === '"' && closed) {
33
+ try {
34
+ return `${prefix}${JSON.stringify(redactText(JSON.parse(credential), depth + 1))}`;
35
+ }
36
+ catch { /* Shell strings are not necessarily valid JSON. */ }
37
+ }
38
+ return `${prefix}${quote}${redactText(inner, depth + 1)}${closed ? quote : ''}`;
39
+ }
40
+ return `${prefix}${quote}[redacted]${quote}`;
41
+ });
42
+ }
43
+ function redactValue(value, depth) {
44
+ if (depth >= 12)
45
+ return '[redacted]';
2
46
  if (typeof value === "string") {
3
- return value
4
- .replace(new RegExp(`<(private|vault-private|${["claude", "mem", "context"].join("-")}|system_instruction|system-instruction|persisted-output|system-reminder)\\b[^>]*>[\\s\\S]*?(?:<\\/\\1\\s*>|$)`, "gi"), "[redacted]")
5
- .replace(/(api[_-]?key|secret|token|password)\s*[:=]\s*['"]?[^\s'"]+/gi, "$1=[redacted]");
47
+ return redactText(value, depth);
6
48
  }
7
49
  if (Array.isArray(value))
8
- return value.map(redact);
50
+ return value.map(nested => redactValue(nested, depth + 1));
9
51
  if (value && typeof value === "object") {
10
52
  const output = {};
11
53
  for (const [key, nested] of Object.entries(value)) {
12
- output[key] = /api[_-]?key|secret|token|password|authorization|cookie|credential|private[_-]?key/i.test(key)
54
+ output[key] = SENSITIVE_KEY.test(key)
13
55
  ? "[redacted]"
14
- : redact(nested);
56
+ : redactValue(nested, depth + 1);
15
57
  }
16
58
  return output;
17
59
  }
18
60
  return value;
19
61
  }
62
+ export function redact(value) {
63
+ return redactValue(value, 0);
64
+ }
@@ -2,7 +2,7 @@ import { lstatSync, readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { z } from 'zod';
5
- const unavailable = 'Abra o Vault Desktop e ative a integração Vault MCP no Crystal.';
5
+ const unavailable = 'Para usar o Crystal local neste computador, abra o Vault Desktop e ative a integração Vault MCP no Crystal. Em uma sessão nativa do Vault Cloud, use vault_crystal_status, vault_crystal_list, vault_crystal_read e vault_crystal_search; a conexão local do Vault Go não alcança outro computador.';
6
6
  const invalidConnection = 'Conexão local do Crystal inválida. Reative a integração no Vault Desktop.';
7
7
  const MAX_RESPONSE = 32 * 1024 * 1024;
8
8
  export const CRYSTAL_LOCKED = 'CRYSTAL_LOCKED';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vault-go",
3
- "version": "0.31.0",
3
+ "version": "0.31.2",
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": {
@@ -160,7 +160,8 @@
160
160
  "test": "bun run build && bun test src",
161
161
  "pack:check": "npm pack --dry-run",
162
162
  "release": "semantic-release",
163
- "prepublishOnly": "bun test src && npm run pack:check"
163
+ "prepublishOnly": "bun test src && npm run pack:check",
164
+ "pack:smoke": "node scripts/smoke-package.mjs"
164
165
  },
165
166
  "engines": {
166
167
  "bun": ">=1.3.0",
@@ -216,18 +217,18 @@
216
217
  "@ast-grep/lang-toml": "0.0.9",
217
218
  "@ast-grep/lang-yaml": "0.0.6",
218
219
  "@ast-grep/napi": "0.45.3",
219
- "@modelcontextprotocol/sdk": "1.29.0",
220
+ "@modelcontextprotocol/sdk": "1.32.1",
220
221
  "@tree-sitter-grammars/tree-sitter-zig": "1.1.2",
221
222
  "zod": "3.25.76"
222
223
  },
223
224
  "devDependencies": {
224
225
  "@semantic-release/commit-analyzer": "13.0.1",
225
- "@semantic-release/github": "12.0.9",
226
- "@semantic-release/npm": "13.1.5",
226
+ "@semantic-release/github": "12.0.10",
227
+ "@semantic-release/npm": "13.2.0",
227
228
  "@semantic-release/release-notes-generator": "14.1.1",
228
229
  "@types/bun": "^1.3.0",
229
230
  "@types/node": "^22.15.0",
230
- "semantic-release": "25.0.8",
231
+ "semantic-release": "25.0.9",
231
232
  "typescript": "^5.9.3"
232
233
  },
233
234
  "overrides": {