nexus-prime 7.9.11 → 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
@@ -221,7 +221,7 @@ function renderCodexManagedBlock(content) {
221
221
  CODEX_MANAGED_START,
222
222
  '## Nexus Prime Bootstrap (managed)',
223
223
  '',
224
- '> This block is managed by `nexus-prime setup codex`.',
224
+ '> This block is managed by `nexus-prime setup codex` or automatic bootstrap.',
225
225
  '> Keep your project-specific Codex guidance above or below it.',
226
226
  '',
227
227
  content.trim(),
@@ -815,6 +815,11 @@ program
815
815
  // stdio transport requires strict JSON-RPC on stdout — no console.log here.
816
816
  const workspaceContext = resolveWorkspaceContext({ workspaceRoot: getWorkspaceRoot() });
817
817
  const caller = detectCallerIDE();
818
+ process.env.NEXUS_DAEMON_AUTOSPAWN ??= '0';
819
+ process.env.NEXUS_DASHBOARD_IN_MCP ??= '0';
820
+ process.env.NEXUS_ARCHITECTS_LAZY ??= '1';
821
+ process.env.NEXUS_SYNAPSE_LAZY ??= '1';
822
+ process.env.NEXUS_AUTOMATION_SCHEDULER_DISABLED ??= '1';
818
823
  const marker = readSetupMarker();
819
824
  const autoConfigEnabled = process.env.NEXUS_MCP_AUTO_CONFIG === '1';
820
825
  if (caller && autoConfigEnabled) {
@@ -866,7 +871,7 @@ program
866
871
  console.error(`[nexus-prime] ${caller} MCP config written. Future runs skip this step.`);
867
872
  }
868
873
  catch (err) {
869
- console.error(`[nexus-prime] Auto-config failed: ${err?.message ?? err}. Run \`npx nexus-prime setup\` manually.`);
874
+ console.error(`[nexus-prime] Auto-config failed: ${err?.message ?? err}. Run \`nexus-prime setup\` manually.`);
870
875
  }
871
876
  }
872
877
  }
@@ -923,8 +928,8 @@ program
923
928
  width: 76,
924
929
  lines: [
925
930
  'This uses ~12 threads and ~80MB per IDE tab.',
926
- 'Auto-spawn is on by default in v6.0.1. Set NEXUS_DAEMON_AUTOSPAWN=0 to stay standalone.',
927
- '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',
928
933
  'Queued-run insurance remains daemon-only; standalone tools run synchronously.',
929
934
  ],
930
935
  });
@@ -9,6 +9,11 @@ export function buildNexusMcpEnv(workspaceRoot) {
9
9
  NEXUS_MCP_TOOL_PROFILE: 'autonomous',
10
10
  NEXUS_MCP_AUTO_CONFIG: '0',
11
11
  NEXUS_MCP_DAEMON_TIMEOUT_MS: '5000',
12
+ NEXUS_DAEMON_AUTOSPAWN: '0',
13
+ NEXUS_DASHBOARD_IN_MCP: '0',
14
+ NEXUS_ARCHITECTS_LAZY: '1',
15
+ NEXUS_SYNAPSE_LAZY: '1',
16
+ NEXUS_AUTOMATION_SCHEDULER_DISABLED: '1',
12
17
  ...(workspaceRoot ? { NEXUS_WORKSPACE_ROOT: workspaceRoot } : {}),
13
18
  };
14
19
  }
@@ -29,5 +34,6 @@ export function isStableNexusMcpServerConfig(server, envKey = 'env') {
29
34
  && args.includes('mcp')
30
35
  && !args.includes('-y')
31
36
  && env?.NEXUS_MCP_TOOL_PROFILE === 'autonomous'
32
- && env?.NEXUS_MCP_AUTO_CONFIG === '0');
37
+ && env?.NEXUS_MCP_AUTO_CONFIG === '0'
38
+ && env?.NEXUS_DAEMON_AUTOSPAWN === '0');
33
39
  }
@@ -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.11",
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",