@staix/vault-mem 0.1.0 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.1] - 2026-10-30
4
+
5
+ - `vmem setup` registers the PATH `bun` launcher when it runs the same binary, so host MCP entries survive a runtime upgrade that removes the versioned real path.
6
+
3
7
  ## [0.1.0] - 2026-10-30
4
8
 
5
9
  - Add vault registration, bounded configuration, home resolution, diagnostics and explicit unregister confirmation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staix/vault-mem",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Validated Obsidian-compatible knowledge vaults for agents and people",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/setup.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { closeSync, constants, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
1
+ import { closeSync, constants, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { dirname, isAbsolute, join, resolve } from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -149,8 +149,13 @@ function readReceipt(file: string): Receipt | undefined {
149
149
  if (value?.version !== 1 || typeof value.file !== "string") throw new Error(`${file}: unreadable setup receipt`);
150
150
  return value;
151
151
  }
152
+ /** The PATH `bun` when it runs the same binary: a versioned real path (e.g. Homebrew Cellar) disappears on upgrade. */
153
+ export function stableRuntime(execPath: string = process.execPath, onPath: string | null = Bun.which("bun")): string {
154
+ if (!onPath || !isAbsolute(onPath)) return execPath;
155
+ try { return realpathSync(onPath) === realpathSync(execPath) ? onPath : execPath; } catch { return execPath; }
156
+ }
152
157
  export function defaultEntry(): McpEntry {
153
- return { command: process.execPath, args: ["--smol", fileURLToPath(new URL("../bin/vmem.js", import.meta.url)), "mcp"] };
158
+ return { command: stableRuntime(), args: ["--smol", fileURLToPath(new URL("../bin/vmem.js", import.meta.url)), "mcp"] };
154
159
  }
155
160
  /**
156
161
  * Plan, apply or undo vmem MCP registration. Dry-run writes nothing. Apply is idempotent, edits only