nexus-prime 7.9.12 → 7.9.13

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/dist/cli.js CHANGED
@@ -928,8 +928,8 @@ program
928
928
  width: 76,
929
929
  lines: [
930
930
  'This uses ~12 threads and ~80MB per IDE tab.',
931
- 'Auto-spawn is on by default in v6.0.1. Set NEXUS_DAEMON_AUTOSPAWN=0 to stay standalone.',
932
- 'For shared single-instance mode you can also run: nexus-prime daemon',
931
+ 'IDE MCP configs keep daemon auto-spawn off to avoid host startup hangs.',
932
+ 'For shared single-instance mode run: nexus-prime daemon',
933
933
  'Queued-run insurance remains daemon-only; standalone tools run synchronously.',
934
934
  ],
935
935
  });
@@ -228,6 +228,8 @@ export declare class MemoryEngine {
228
228
  private relevanceScore;
229
229
  private importanceScore;
230
230
  private freshnessScore;
231
+ private ensureVaultDirs;
232
+ private readVaultDir;
231
233
  private syncVault;
232
234
  flushVaultSync(): void;
233
235
  /**
@@ -129,12 +129,7 @@ export class MemoryEngine {
129
129
  this.vaultRunNotesDir = path.join(this.vaultNotesDir, 'runs');
130
130
  this.vaultSessionNotesDir = path.join(this.vaultNotesDir, 'sessions');
131
131
  this.backupMetadataPath = path.join(this.vaultExportsDir, 'last-pre-compaction-backup.json');
132
- fs.mkdirSync(this.vaultItemsDir, { recursive: true });
133
- fs.mkdirSync(this.vaultExportsDir, { recursive: true });
134
- fs.mkdirSync(path.join(this.vaultNotesDir, 'memories'), { recursive: true });
135
- fs.mkdirSync(this.vaultEntityNotesDir, { recursive: true });
136
- fs.mkdirSync(this.vaultRunNotesDir, { recursive: true });
137
- fs.mkdirSync(this.vaultSessionNotesDir, { recursive: true });
132
+ this.ensureVaultDirs();
138
133
  this.initSchema();
139
134
  this.embedder = new Embedder(this.db);
140
135
  this.extractor = new MemoryExtractor();
@@ -1334,7 +1329,7 @@ export class MemoryEngine {
1334
1329
  // Ignore stale snapshot cleanup failures.
1335
1330
  }
1336
1331
  }
1337
- for (const file of fs.readdirSync(this.vaultItemsDir).filter((entry) => entry.endsWith('.json'))) {
1332
+ for (const file of this.readVaultDir(this.vaultItemsDir).filter((entry) => entry.endsWith('.json'))) {
1338
1333
  try {
1339
1334
  fs.unlinkSync(path.join(this.vaultItemsDir, file));
1340
1335
  }
@@ -2308,6 +2303,24 @@ export class MemoryEngine {
2308
2303
  const age = Date.now() - item.timestamp;
2309
2304
  return Math.max(0, Math.min(1, 1 - (age / horizon)));
2310
2305
  }
2306
+ ensureVaultDirs() {
2307
+ fs.mkdirSync(this.vaultItemsDir, { recursive: true });
2308
+ fs.mkdirSync(this.vaultExportsDir, { recursive: true });
2309
+ fs.mkdirSync(path.join(this.vaultNotesDir, 'memories'), { recursive: true });
2310
+ fs.mkdirSync(this.vaultEntityNotesDir, { recursive: true });
2311
+ fs.mkdirSync(this.vaultRunNotesDir, { recursive: true });
2312
+ fs.mkdirSync(this.vaultSessionNotesDir, { recursive: true });
2313
+ }
2314
+ readVaultDir(dir) {
2315
+ try {
2316
+ return fs.readdirSync(dir);
2317
+ }
2318
+ catch (error) {
2319
+ if (error?.code === 'ENOENT')
2320
+ return [];
2321
+ throw error;
2322
+ }
2323
+ }
2311
2324
  syncVault(force = false) {
2312
2325
  if (force) {
2313
2326
  this.vaultNeedsFullSync = true;
@@ -2382,6 +2395,7 @@ export class MemoryEngine {
2382
2395
  });
2383
2396
  }
2384
2397
  writeVaultIndex(payload) {
2398
+ this.ensureVaultDirs();
2385
2399
  const data = JSON.stringify(payload, null, 2);
2386
2400
  const targetPath = path.join(this.vaultDir, 'index.json');
2387
2401
  this.vaultIndexChain = this.vaultIndexChain
@@ -2390,6 +2404,7 @@ export class MemoryEngine {
2390
2404
  this.trackVaultWrite(this.vaultIndexChain);
2391
2405
  }
2392
2406
  syncVaultFull() {
2407
+ this.ensureVaultDirs();
2393
2408
  this.expireMemories();
2394
2409
  const items = this.listVaultLiveItems();
2395
2410
  const memoryNotesDir = path.join(this.vaultNotesDir, 'memories');
@@ -2418,7 +2433,7 @@ export class MemoryEngine {
2418
2433
  }
2419
2434
  }
2420
2435
  const seen = new Set(items.map((item) => item.id));
2421
- for (const entry of fs.readdirSync(this.vaultItemsDir)) {
2436
+ for (const entry of this.readVaultDir(this.vaultItemsDir)) {
2422
2437
  if (!entry.endsWith('.json'))
2423
2438
  continue;
2424
2439
  const memoryId = entry.replace(/\.json$/, '');
@@ -2427,7 +2442,7 @@ export class MemoryEngine {
2427
2442
  }
2428
2443
  }
2429
2444
  }
2430
- for (const entry of fs.readdirSync(memoryNotesDir)) {
2445
+ for (const entry of this.readVaultDir(memoryNotesDir)) {
2431
2446
  const notePath = path.join(memoryNotesDir, entry);
2432
2447
  if (!noteSeen.has(notePath)) {
2433
2448
  fs.unlinkSync(notePath);
@@ -2444,13 +2459,16 @@ export class MemoryEngine {
2444
2459
  });
2445
2460
  }
2446
2461
  writeVaultItem(item) {
2462
+ this.ensureVaultDirs();
2447
2463
  this.trackVaultWrite(fs.promises.writeFile(path.join(this.vaultItemsDir, `${item.id}.json`), JSON.stringify(this.buildVaultItemPayload(item), null, 2), 'utf8'));
2448
2464
  this.writeVaultNote(item);
2449
2465
  }
2450
2466
  writeVaultNote(item) {
2467
+ this.ensureVaultDirs();
2451
2468
  this.trackVaultWrite(fs.promises.writeFile(path.join(this.vaultNotesDir, 'memories', `${item.id}.md`), this.renderMemoryNote(item), 'utf8'));
2452
2469
  }
2453
2470
  removeVaultItem(id) {
2471
+ this.ensureVaultDirs();
2454
2472
  const jsonPath = path.join(this.vaultItemsDir, `${id}.json`);
2455
2473
  const notePath = path.join(this.vaultNotesDir, 'memories', `${id}.md`);
2456
2474
  if (fs.existsSync(jsonPath)) {
@@ -3813,7 +3831,7 @@ export class MemoryEngine {
3813
3831
  listVaultSnapshotPaths() {
3814
3832
  if (!fs.existsSync(this.vaultDir))
3815
3833
  return [];
3816
- return fs.readdirSync(this.vaultDir)
3834
+ return this.readVaultDir(this.vaultDir)
3817
3835
  .filter((entry) => /^vault-snapshot-\d+\.json$/.test(entry))
3818
3836
  .map((entry) => path.join(this.vaultDir, entry));
3819
3837
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexus-prime",
3
- "version": "7.9.12",
3
+ "version": "7.9.13",
4
4
  "description": "Local-first MCP control plane for coding agents with bootstrap-orchestrate execution, memory fabric, token budgeting, and worktree-backed swarms",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",