@strvmarv/total-recall 0.6.8-beta.3 → 0.6.8-beta.4

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "total-recall",
3
3
  "description": "Multi-tiered memory and knowledge base with semantic search, auto-compaction, and built-in evaluation. Works across Claude Code, Copilot CLI, OpenCode, Cline, and Cursor.",
4
- "version": "0.6.8-beta.3",
4
+ "version": "0.6.8-beta.4",
5
5
  "author": {
6
6
  "name": "strvmarv"
7
7
  },
package/bin/start.cjs CHANGED
@@ -1,37 +1,50 @@
1
1
  'use strict';
2
2
  // Bootstrap wrapper for the total-recall MCP server.
3
- // Runs as plain CJS (no imports) so it works even when node_modules is absent.
4
- // Detects missing/incomplete node_modules and self-heals via npm install,
5
- // then re-execs dist/index.js with inherited stdio as a transparent passthrough.
3
+ //
4
+ // Why this exists: .mcp.json launches us under `node` (guaranteed present
5
+ // wherever Claude Code runs). Since 0.6.8 the server uses `bun:sqlite`, which
6
+ // only resolves under the Bun runtime, so this script locates bun and
7
+ // re-execs dist/index.js under it.
8
+ //
9
+ // Lookup order:
10
+ // 1. Bundled bun at ~/.total-recall/bun/<BUN_VERSION>/bun[.exe]
11
+ // (downloaded by scripts/postinstall.js during `npm install`)
12
+ // 2. System bun on PATH
13
+ // 3. Hard fail — node cannot run dist/index.js (bun:sqlite import errors)
14
+ //
15
+ // Kept as plain CJS (no imports) so it works even when node_modules is absent.
6
16
 
7
17
  const { existsSync } = require('fs');
8
- const { join, dirname } = require('path');
18
+ const { join } = require('path');
9
19
  const { spawnSync } = require('child_process');
20
+ const os = require('os');
10
21
 
11
- const root = join(__dirname, '..');
12
-
13
- // Use better-sqlite3/lib as the canary — it only exists after a successful install.
14
- const canary = join(root, 'node_modules', 'better-sqlite3', 'lib');
22
+ // Keep in sync with scripts/postinstall.js BUN_VERSION.
23
+ const BUN_VERSION = '1.2.10';
15
24
 
16
- if (!existsSync(canary)) {
17
- process.stderr.write('[total-recall] node_modules missing or incomplete — running npm install...\n');
25
+ const root = join(__dirname, '..');
26
+ const entry = join(root, 'dist', 'index.js');
18
27
 
19
- const npm = findNpm();
20
- const install = spawnSync(npm, ['install', '--production', '--prefer-offline'], {
21
- cwd: root,
22
- stdio: 'inherit',
23
- shell: true, // required on Windows to execute .cmd files; harmless on macOS/Linux
24
- });
28
+ if (!existsSync(entry)) {
29
+ process.stderr.write(
30
+ '[total-recall] dist/index.js not found. Run `npm install` (marketplace) or `npm run build` (git checkout).\n'
31
+ );
32
+ process.exit(1);
33
+ }
25
34
 
26
- if (install.status !== 0) {
27
- process.stderr.write('[total-recall] npm install failed — see output above for details\n');
28
- process.exit(1);
29
- }
35
+ const bun = findBun();
36
+ if (!bun) {
37
+ process.stderr.write(
38
+ '[total-recall] bun runtime not found.\n' +
39
+ ` Expected bundled bun at ~/.total-recall/bun/${BUN_VERSION}/bun (installed by \`npm install\`).\n` +
40
+ ' Fix: run `npm install` inside the plugin directory, or install bun manually (https://bun.sh/install).\n'
41
+ );
42
+ process.exit(1);
30
43
  }
31
44
 
32
- // Re-exec dist/index.js as a subprocess with inherited stdio.
33
- // spawnSync blocks until the server exits, transparently passing all I/O through.
34
- const server = spawnSync(process.execPath, [join(root, 'dist', 'index.js')], {
45
+ // Re-exec dist/index.js under bun with inherited stdio so the MCP JSON-RPC
46
+ // channel passes through transparently.
47
+ const server = spawnSync(bun, [entry], {
35
48
  stdio: 'inherit',
36
49
  env: process.env,
37
50
  });
@@ -40,18 +53,20 @@ process.exit(server.status ?? 1);
40
53
 
41
54
  // ---------------------------------------------------------------------------
42
55
 
43
- function findNpm() {
44
- const nodeDir = dirname(process.execPath);
56
+ function findBun() {
57
+ const isWin = process.platform === 'win32';
58
+ const ext = isWin ? '.exe' : '';
45
59
 
46
- // npm installs alongside node. On Windows it's npm.cmd; on macOS/Linux it's npm.
47
- const candidates = process.platform === 'win32'
48
- ? [join(nodeDir, 'npm.cmd'), join(nodeDir, 'npm')]
49
- : [join(nodeDir, 'npm')];
60
+ // 1. Bundled bun (preferred version-pinned, matches what postinstall downloaded)
61
+ const bundled = join(os.homedir(), '.total-recall', 'bun', BUN_VERSION, `bun${ext}`);
62
+ if (existsSync(bundled)) return bundled;
50
63
 
51
- for (const candidate of candidates) {
52
- if (existsSync(candidate)) return candidate;
64
+ // 2. System bun on PATH — let the OS resolver find it
65
+ const probe = spawnSync(isWin ? 'where' : 'which', ['bun'], { encoding: 'utf8' });
66
+ if (probe.status === 0) {
67
+ const first = String(probe.stdout || '').split(/\r?\n/).find(Boolean);
68
+ if (first && existsSync(first)) return first;
53
69
  }
54
70
 
55
- // Last resort: hope npm is somewhere on PATH.
56
- return 'npm';
71
+ return null;
57
72
  }
@@ -1,7 +1,8 @@
1
1
  @echo off
2
2
  SETLOCAL EnableDelayedExpansion
3
3
  :: total-recall MCP server launcher for Windows
4
- :: Prefers bundled Bun, falls back to system Bun, then system Node.
4
+ :: Requires Bun dist\index.js uses bun:sqlite, which node cannot resolve.
5
+ :: Prefers bundled Bun (installed by scripts\postinstall.js), falls back to system Bun.
5
6
 
6
7
  SET BUN_VERSION=1.2.10
7
8
  SET BUNDLED_BUN=%USERPROFILE%\.total-recall\bun\%BUN_VERSION%\bun.exe
@@ -21,7 +22,7 @@ IF EXIST "%BUNDLED_BUN%" (
21
22
  exit /b %ERRORLEVEL%
22
23
  )
23
24
 
24
- :: Priority 2: system Bun (warn)
25
+ :: Priority 2: system Bun (warn — version may not match)
25
26
  WHERE bun >nul 2>&1
26
27
  IF %ERRORLEVEL% EQU 0 (
27
28
  echo total-recall: warning: bundled bun v%BUN_VERSION% not found, using system bun. Version mismatch possible. 1>&2
@@ -30,15 +31,7 @@ IF %ERRORLEVEL% EQU 0 (
30
31
  exit /b !ERRORLEVEL!
31
32
  )
32
33
 
33
- :: Priority 3: system Node (warn)
34
- WHERE node >nul 2>&1
35
- IF %ERRORLEVEL% EQU 0 (
36
- echo total-recall: warning: bun not found, falling back to node. ABI issues may occur. 1>&2
37
- echo Install bun (https://bun.sh/install) or re-run 'npm install' to fix this. 1>&2
38
- node "%ENTRY%" %*
39
- exit /b !ERRORLEVEL!
40
- )
41
-
42
- echo total-recall: error: neither bun nor node found. 1>&2
43
- echo Install bun: https://bun.sh/install 1>&2
34
+ echo total-recall: error: bun runtime not found. 1>&2
35
+ echo Expected bundled bun at %%USERPROFILE%%\.total-recall\bun\%BUN_VERSION%\bun.exe (installed by 'npm install'). 1>&2
36
+ echo Fix: run 'npm install' inside the plugin directory, or install bun manually (https://bun.sh/install). 1>&2
44
37
  exit /b 1
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  # total-recall MCP server launcher
3
- # Prefers bundled Bun, falls back to system Bun, then system Node.
3
+ # Requires Bun dist/index.js uses bun:sqlite, which node cannot resolve.
4
+ # Prefers bundled Bun (installed by scripts/postinstall.js), falls back to system Bun.
4
5
 
5
6
  BUN_VERSION="1.2.10"
6
7
 
@@ -25,67 +26,6 @@ find_system_bun() {
25
26
  return 1
26
27
  }
27
28
 
28
- find_node() {
29
- # Check PATH first
30
- if command -v node &>/dev/null; then
31
- echo "node"
32
- return 0
33
- fi
34
-
35
- # Check nvm
36
- if [ -d "$HOME/.nvm/versions/node" ]; then
37
- local latest=$(ls -1d "$HOME/.nvm/versions/node"/v* 2>/dev/null | sort -V | tail -1)
38
- if [ -n "$latest" ] && [ -x "$latest/bin/node" ]; then
39
- echo "$latest/bin/node"
40
- return 0
41
- fi
42
- fi
43
-
44
- # Check fnm
45
- if [ -d "$HOME/.local/share/fnm/node-versions" ]; then
46
- local latest=$(ls -1d "$HOME/.local/share/fnm/node-versions"/v*/installation 2>/dev/null | sort -V | tail -1)
47
- if [ -n "$latest" ] && [ -x "$latest/bin/node" ]; then
48
- echo "$latest/bin/node"
49
- return 0
50
- fi
51
- fi
52
-
53
- # Check Homebrew
54
- if [ -x "/home/linuxbrew/.linuxbrew/bin/node" ]; then
55
- echo "/home/linuxbrew/.linuxbrew/bin/node"
56
- return 0
57
- fi
58
- if [ -x "/opt/homebrew/bin/node" ]; then
59
- echo "/opt/homebrew/bin/node"
60
- return 0
61
- fi
62
- if [ -x "/usr/local/bin/node" ]; then
63
- echo "/usr/local/bin/node"
64
- return 0
65
- fi
66
-
67
- # Check Volta
68
- if [ -x "$HOME/.volta/bin/node" ]; then
69
- echo "$HOME/.volta/bin/node"
70
- return 0
71
- fi
72
-
73
- # Check nvm4w (Windows nvm — Git Bash exposes C:\ as /c/)
74
- if [ -x "/c/nvm4w/nodejs/node" ]; then
75
- echo "/c/nvm4w/nodejs/node"
76
- return 0
77
- fi
78
-
79
- # Check MacPorts
80
- if [ -x "/opt/local/bin/node" ]; then
81
- echo "/opt/local/bin/node"
82
- return 0
83
- fi
84
-
85
- echo ""
86
- return 1
87
- }
88
-
89
29
  # Find the package entry point
90
30
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
91
31
  PACKAGE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
@@ -103,7 +43,7 @@ if [ -n "$RUNTIME" ]; then
103
43
  exec "$RUNTIME" "$ENTRY" "$@"
104
44
  fi
105
45
 
106
- # Priority 2: system Bun (warn)
46
+ # Priority 2: system Bun (warn — version may not match)
107
47
  RUNTIME=$(find_system_bun)
108
48
  if [ -n "$RUNTIME" ]; then
109
49
  echo "total-recall: warning: bundled bun v$BUN_VERSION not found, using system bun. Version mismatch possible." >&2
@@ -111,14 +51,7 @@ if [ -n "$RUNTIME" ]; then
111
51
  exec "$RUNTIME" "$ENTRY" "$@"
112
52
  fi
113
53
 
114
- # Priority 3: system Node (warn)
115
- RUNTIME=$(find_node)
116
- if [ -n "$RUNTIME" ]; then
117
- echo "total-recall: warning: bun not found, falling back to node. Native addon ABI issues may occur." >&2
118
- echo " Install bun (https://bun.sh/install) or re-run 'npm install' to fix this." >&2
119
- exec "$RUNTIME" "$ENTRY" "$@"
120
- fi
121
-
122
- echo "total-recall: error: neither bun nor node found." >&2
123
- echo " Install bun: https://bun.sh/install" >&2
54
+ echo "total-recall: error: bun runtime not found." >&2
55
+ echo " Expected bundled bun at ~/.total-recall/bun/$BUN_VERSION/bun (installed by 'npm install')." >&2
56
+ echo " Fix: run 'npm install' inside the plugin directory, or install bun manually (https://bun.sh/install)." >&2
124
57
  exit 1
package/dist/index.js CHANGED
@@ -8664,6 +8664,9 @@ var Embedder = class {
8664
8664
  }
8665
8665
  };
8666
8666
 
8667
+ // src/tools/registry.ts
8668
+ import { readFileSync as readFileSync15 } from "fs";
8669
+
8667
8670
  // node_modules/zod/v3/helpers/util.js
8668
8671
  var util;
8669
8672
  (function(util2) {
@@ -26875,9 +26878,13 @@ async function handleExtraTool(name, args, ctx) {
26875
26878
  }
26876
26879
 
26877
26880
  // src/tools/registry.ts
26881
+ function readPackageVersion() {
26882
+ const pkg = JSON.parse(readFileSync15(pkgPath("package.json"), "utf-8"));
26883
+ return pkg.version;
26884
+ }
26878
26885
  async function startServer(ctx) {
26879
26886
  const server = new Server(
26880
- { name: "total-recall", version: "0.5.9" },
26887
+ { name: "total-recall", version: readPackageVersion() },
26881
26888
  { capabilities: { tools: {} } }
26882
26889
  );
26883
26890
  server.oninitialized = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strvmarv/total-recall",
3
- "version": "0.6.8-beta.3",
3
+ "version": "0.6.8-beta.4",
4
4
  "description": "Multi-tiered memory and knowledge base plugin for TUI coding assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",