nexo-brain 3.1.8 → 3.1.9

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": "3.1.8",
3
+ "version": "3.1.9",
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "3.1.8",
3
+ "version": "3.1.9",
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",
@@ -1186,27 +1186,38 @@ def _source_repo_status(repo_dir: Path) -> dict:
1186
1186
  }
1187
1187
 
1188
1188
 
1189
+ def _discover_runtime_root_python_modules(base_dir: Path) -> list[str]:
1190
+ """Return every top-level runtime `.py` module in the source/runtime root."""
1191
+ if not base_dir.is_dir():
1192
+ return []
1193
+ modules: list[str] = []
1194
+ for item in sorted(base_dir.iterdir(), key=lambda path: path.name):
1195
+ if not item.is_file() or item.suffix != ".py":
1196
+ continue
1197
+ if item.name.startswith(".") or item.name == "__init__.py":
1198
+ continue
1199
+ modules.append(item.name)
1200
+ return modules
1201
+
1202
+
1203
+ def _runtime_flat_files(base_dir: Path) -> list[str]:
1204
+ ordered: list[str] = []
1205
+ seen: set[str] = set()
1206
+ for name in _discover_runtime_root_python_modules(base_dir) + ["requirements.txt", "package.json", "version.json"]:
1207
+ if name in seen:
1208
+ continue
1209
+ seen.add(name)
1210
+ ordered.append(name)
1211
+ return ordered
1212
+
1213
+
1189
1214
  def _backup_runtime_tree(dest: Path = NEXO_HOME) -> str:
1190
1215
  timestamp = time.strftime("%Y-%m-%d-%H%M%S")
1191
1216
  backup_dir = NEXO_HOME / "backups" / f"runtime-tree-{timestamp}"
1192
1217
  backup_dir.mkdir(parents=True, exist_ok=True)
1193
1218
 
1194
1219
  code_dirs = ["hooks", "plugins", "db", "cognitive", "dashboard", "rules", "crons", "scripts", "doctor", "skills-core"]
1195
- flat_files = [
1196
- "server.py", "plugin_loader.py", "knowledge_graph.py", "kg_populate.py",
1197
- "maintenance.py", "storage_router.py", "claim_graph.py", "hnsw_index.py",
1198
- "evolution_cycle.py", "migrate_embeddings.py", "auto_close_sessions.py",
1199
- "client_sync.py",
1200
- "client_preferences.py", "agent_runner.py", "bootstrap_docs.py",
1201
- "hook_guardrails.py", "protocol_settings.py", "public_evolution_queue.py",
1202
- "auto_update.py", "tools_sessions.py", "tools_coordination.py",
1203
- "tools_hot_context.py",
1204
- "tools_reminders.py", "tools_reminders_crud.py", "tools_learnings.py",
1205
- "tools_credentials.py", "tools_task_history.py", "tools_menu.py",
1206
- "cli.py", "script_registry.py", "skills_runtime.py", "user_context.py",
1207
- "public_contribution.py",
1208
- "cron_recovery.py", "runtime_power.py", "requirements.txt", "package.json", "version.json",
1209
- ]
1220
+ flat_files = _runtime_flat_files(dest)
1210
1221
  for name in code_dirs:
1211
1222
  src = dest / name
1212
1223
  if src.is_dir():
@@ -1244,21 +1255,7 @@ def _copy_runtime_from_source(src_dir: Path, repo_dir: Path, dest: Path = NEXO_H
1244
1255
  import shutil
1245
1256
 
1246
1257
  packages = ["db", "cognitive", "doctor", "dashboard", "rules", "crons", "hooks"]
1247
- flat_files = [
1248
- "server.py", "plugin_loader.py", "knowledge_graph.py", "kg_populate.py",
1249
- "maintenance.py", "storage_router.py", "claim_graph.py", "hnsw_index.py",
1250
- "evolution_cycle.py", "migrate_embeddings.py", "auto_close_sessions.py",
1251
- "client_sync.py",
1252
- "client_preferences.py", "agent_runner.py", "bootstrap_docs.py",
1253
- "hook_guardrails.py", "protocol_settings.py", "public_evolution_queue.py",
1254
- "auto_update.py", "tools_sessions.py", "tools_coordination.py",
1255
- "tools_hot_context.py",
1256
- "tools_reminders.py", "tools_reminders_crud.py", "tools_learnings.py",
1257
- "tools_credentials.py", "tools_task_history.py", "tools_menu.py",
1258
- "cli.py", "script_registry.py", "skills_runtime.py", "user_context.py",
1259
- "public_contribution.py",
1260
- "cron_recovery.py", "runtime_power.py", "requirements.txt",
1261
- ]
1258
+ flat_files = _runtime_flat_files(src_dir)
1262
1259
  copied_packages = 0
1263
1260
  copied_files = 0
1264
1261