nano-brain 2026.6.6 → 2026.6.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nano-brain",
3
- "version": "2026.6.6",
3
+ "version": "2026.6.7",
4
4
  "description": "Persistent memory and code intelligence for AI coding agents. Local MCP server with self-learning hybrid search (BM25 + vector + knowledge graph + LLM reranking), automatic session ingestion, codebase indexing, and 22 tools. Learns your preferences over time. Works with OpenCode, Claude, Cursor, Windsurf, and any MCP client.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/server.ts CHANGED
@@ -91,7 +91,7 @@ export function resolveWorkspace(deps: ServerDeps, filePath?: string, workspaceP
91
91
  }
92
92
  const wsStore = openWorkspaceStore(deps.dataDir, wsPath);
93
93
  if (wsStore) {
94
- return { store: wsStore, workspaceRoot: wsPath, projectHash: wsHash, needsClose: true };
94
+ return { store: wsStore, workspaceRoot: wsPath, projectHash: wsHash, needsClose: false };
95
95
  }
96
96
  }
97
97
  }
@@ -111,7 +111,7 @@ export function resolveWorkspace(deps: ServerDeps, filePath?: string, workspaceP
111
111
  }
112
112
  const wsStore = openWorkspaceStore(deps.dataDir, bestMatch.wsPath);
113
113
  if (wsStore) {
114
- return { store: wsStore, workspaceRoot: bestMatch.wsPath, projectHash: wsHash, needsClose: true };
114
+ return { store: wsStore, workspaceRoot: bestMatch.wsPath, projectHash: wsHash, needsClose: false };
115
115
  }
116
116
  }
117
117
  }
@@ -1122,7 +1122,7 @@ export function createMcpServer(deps: ServerDeps): McpServer {
1122
1122
  // Open the correct workspace's symbol graph DB (not deps.db which is the startup workspace)
1123
1123
  let symbolGraphDb = deps.db;
1124
1124
  let symbolGraphDbNeedsClose = false;
1125
- if (resolved?.needsClose && deps.dataDir && resolved.workspaceRoot) {
1125
+ if (resolved && resolved.projectHash !== deps.currentProjectHash && deps.dataDir && resolved.workspaceRoot) {
1126
1126
  const wsDbPath = resolveWorkspaceDbPath(deps.dataDir, resolved.workspaceRoot);
1127
1127
  symbolGraphDb = openDatabase(wsDbPath);
1128
1128
  symbolGraphDbNeedsClose = true;
@@ -2609,17 +2609,8 @@ export async function startServer(options: ServerOptions): Promise<void> {
2609
2609
  let resolvedWorkspaceRoot: string;
2610
2610
  if (daemon && config?.workspaces && Object.keys(config.workspaces).length > 0) {
2611
2611
  const configuredWorkspaces = Object.keys(config.workspaces);
2612
- const cwd = root || process.cwd();
2613
- const cwdMatch = configuredWorkspaces.find(ws => cwd === ws || cwd.startsWith(ws + '/'));
2614
- if (cwdMatch) {
2615
- resolvedWorkspaceRoot = cwdMatch;
2616
- log('server', 'Daemon mode: cwd matches configured workspace');
2617
- log('server', `Daemon mode: workspace from cwd = ${resolvedWorkspaceRoot}`);
2618
- } else {
2619
- resolvedWorkspaceRoot = configuredWorkspaces[0];
2620
- log('server', 'Daemon mode: cwd does not match any workspace, using first configured');
2621
- log('server', `Daemon mode: primary workspace = ${resolvedWorkspaceRoot}`);
2622
- }
2612
+ resolvedWorkspaceRoot = configuredWorkspaces[0];
2613
+ log('server', `Daemon mode: primary workspace = ${resolvedWorkspaceRoot}`);
2623
2614
  } else {
2624
2615
  resolvedWorkspaceRoot = root || process.cwd();
2625
2616
  }
package/src/store.ts CHANGED
@@ -80,7 +80,7 @@ export function createStore(dbPath: string): Store {
80
80
 
81
81
  const cached = storeCache.get(resolvedPath);
82
82
  if (cached) {
83
- log('store', 'createStore returning cached instance for ' + resolvedPath);
83
+ log('store', 'createStore cache hit for ' + resolvedPath, 'debug');
84
84
  return cached;
85
85
  }
86
86
 
@@ -1197,7 +1197,7 @@ export function createStore(dbPath: string): Store {
1197
1197
 
1198
1198
  close() {
1199
1199
  if (_cached) {
1200
- log('store', 'close() skipped for cached store');
1200
+ log('store', 'close() skipped for cached store', 'debug');
1201
1201
  return;
1202
1202
  }
1203
1203
  try { db.pragma('wal_checkpoint(PASSIVE)'); } catch { /* ignore checkpoint errors */ }