nexo-brain 5.3.19 → 5.3.20

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,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "5.3.19",
3
+ "version": "5.3.20",
4
4
  "description": "Local cognitive runtime for Claude Code \u2014 persistent memory, overnight learning, doctor diagnostics, personal scripts, recovery-aware jobs, startup preflight, and optional dashboard/power helper.",
5
5
  "author": {
6
6
  "name": "NEXO Brain",
package/bin/nexo-brain.js CHANGED
@@ -1692,6 +1692,40 @@ async function main() {
1692
1692
  }
1693
1693
  }
1694
1694
 
1695
+ // Restore operator shell alias + PATH if lost during previous updates
1696
+ const migOperatorName = installed.operator_name || "NEXO";
1697
+ const migAliasName = migOperatorName.toLowerCase();
1698
+ if (migAliasName !== "nexo") {
1699
+ const migAliasLine = `alias ${migAliasName}='nexo chat .'`;
1700
+ const migAliasComment = `# ${migOperatorName} — open the configured NEXO terminal client`;
1701
+ const migNexoPathLine = `export PATH="${path.join(NEXO_HOME, "bin")}:$PATH"`;
1702
+ const migNexoPathComment = "# NEXO runtime CLI";
1703
+ const migUserShell = process.env.SHELL || "/bin/bash";
1704
+ const migHomeDir = require("os").homedir();
1705
+ const migRcFiles = [];
1706
+ if (migUserShell.includes("zsh")) {
1707
+ migRcFiles.push(path.join(migHomeDir, ".zshrc"));
1708
+ } else {
1709
+ migRcFiles.push(path.join(migHomeDir, ".bash_profile"));
1710
+ migRcFiles.push(path.join(migHomeDir, ".bashrc"));
1711
+ }
1712
+ for (const rcFile of migRcFiles) {
1713
+ let rcContent = "";
1714
+ if (fs.existsSync(rcFile)) {
1715
+ rcContent = fs.readFileSync(rcFile, "utf8");
1716
+ }
1717
+ if (!rcContent.includes(migNexoPathLine)) {
1718
+ fs.appendFileSync(rcFile, `\n${migNexoPathComment}\n${migNexoPathLine}\n`);
1719
+ log(` Restored NEXO runtime CLI in ${path.basename(rcFile)}`);
1720
+ rcContent += `\n${migNexoPathComment}\n${migNexoPathLine}\n`;
1721
+ }
1722
+ if (!rcContent.includes(`alias ${migAliasName}=`)) {
1723
+ fs.appendFileSync(rcFile, `\n${migAliasComment}\n${migAliasLine}\n`);
1724
+ log(` Restored '${migAliasName}' alias in ${path.basename(rcFile)}`);
1725
+ }
1726
+ }
1727
+ }
1728
+
1695
1729
  console.log("");
1696
1730
  log(`Migration complete: v${installedVersion} → v${currentVersion}`);
1697
1731
  log("Your data (memories, learnings, preferences) is untouched.");
@@ -3138,14 +3172,11 @@ ${doScan ? `- Stack: ${Object.keys(profileData.code.languages || {}).slice(0, 5)
3138
3172
  await setupKeychainPassFile(NEXO_HOME);
3139
3173
 
3140
3174
  // Step 8: Create shell alias and add runtime CLI to PATH
3141
- log("Creating shell alias...");
3142
3175
  const aliasName = operatorName.toLowerCase();
3143
- const aliasLine = `alias ${aliasName}='nexo chat .'`;
3144
- const aliasComment = `# ${operatorName} — open the configured NEXO terminal client`;
3145
3176
  const nexoPathLine = `export PATH="${path.join(NEXO_HOME, "bin")}:$PATH"`;
3146
3177
  const nexoPathComment = "# NEXO runtime CLI";
3147
3178
 
3148
- // Detect shell and add alias
3179
+ // Detect shell rc files
3149
3180
  const userShell = process.env.SHELL || "/bin/bash";
3150
3181
  const homeDir = require("os").homedir();
3151
3182
  const rcFiles = [];
@@ -3160,6 +3191,11 @@ ${doScan ? `- Stack: ${Object.keys(profileData.code.languages || {}).slice(0, 5)
3160
3191
  rcFiles.push(bashrc);
3161
3192
  }
3162
3193
 
3194
+ // Skip alias when operator name matches the CLI binary ("nexo") to avoid shadowing it
3195
+ const skipAlias = aliasName === "nexo";
3196
+ const aliasLine = skipAlias ? null : `alias ${aliasName}='nexo chat .'`;
3197
+ const aliasComment = skipAlias ? null : `# ${operatorName} — open the configured NEXO terminal client`;
3198
+
3163
3199
  for (const rcFile of rcFiles) {
3164
3200
  let rcContent = "";
3165
3201
  if (fs.existsSync(rcFile)) {
@@ -3174,14 +3210,20 @@ ${doScan ? `- Stack: ${Object.keys(profileData.code.languages || {}).slice(0, 5)
3174
3210
  log(`Runtime CLI already present in ${path.basename(rcFile)}`);
3175
3211
  }
3176
3212
 
3177
- if (!rcContent.includes(`alias ${aliasName}=`)) {
3178
- fs.appendFileSync(rcFile, `\n${aliasComment}\n${aliasLine}\n`);
3179
- log(`Added '${aliasName}' alias to ${path.basename(rcFile)}`);
3180
- } else {
3181
- log(`Alias '${aliasName}' already exists in ${path.basename(rcFile)}`);
3213
+ if (!skipAlias) {
3214
+ if (!rcContent.includes(`alias ${aliasName}=`)) {
3215
+ fs.appendFileSync(rcFile, `\n${aliasComment}\n${aliasLine}\n`);
3216
+ log(`Added '${aliasName}' alias to ${path.basename(rcFile)}`);
3217
+ } else {
3218
+ log(`Alias '${aliasName}' already exists in ${path.basename(rcFile)}`);
3219
+ }
3182
3220
  }
3183
3221
  }
3184
- log(`After setup, open a new terminal and type: ${aliasName} or nexo`);
3222
+ if (skipAlias) {
3223
+ log(`Operator name is 'nexo' — skipping alias (CLI binary already provides 'nexo' command)`);
3224
+ } else {
3225
+ log(`After setup, open a new terminal and type: ${aliasName} or nexo`);
3226
+ }
3185
3227
  console.log("");
3186
3228
 
3187
3229
  // Step 9: Generate CLAUDE.md template
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "5.3.19",
3
+ "version": "5.3.20",
4
4
  "mcpName": "io.github.wazionapps/nexo",
5
5
  "description": "NEXO Brain — Shared brain for AI agents. Persistent memory, semantic RAG, natural forgetting, metacognitive guard, trust scoring, 150+ MCP tools. Works with Claude Code, Codex, Claude Desktop & any MCP client. 100% local, free.",
6
6
  "homepage": "https://nexo-brain.com",