nexo-brain 7.0.0 → 7.1.0

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.
Files changed (84) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/README.md +4 -2
  3. package/bin/nexo-brain.js +310 -44
  4. package/bin/nexo.js +6 -0
  5. package/package.json +2 -2
  6. package/src/agent_runner.py +3 -2
  7. package/src/auto_close_sessions.py +9 -2
  8. package/src/auto_update.py +957 -25
  9. package/src/automation_controls.py +814 -0
  10. package/src/classifier_local.py +43 -1
  11. package/src/cli.py +194 -16
  12. package/src/cli_email.py +213 -20
  13. package/src/client_preferences.py +7 -4
  14. package/src/client_sync.py +188 -115
  15. package/src/cron_recovery.py +12 -2
  16. package/src/crons/manifest.json +39 -0
  17. package/src/crons/sync.py +101 -20
  18. package/src/dashboard/app.py +9 -14
  19. package/src/db/__init__.py +1 -0
  20. package/src/db/_core.py +22 -9
  21. package/src/db/_email_accounts.py +93 -7
  22. package/src/db/_personal_scripts.py +122 -24
  23. package/src/db/_schema.py +73 -0
  24. package/src/db/_skills.py +143 -1
  25. package/src/desktop_bridge.py +29 -5
  26. package/src/doctor/providers/runtime.py +2 -2
  27. package/src/email_config.py +144 -33
  28. package/src/enforcement_engine.py +126 -5
  29. package/src/guardian_config.py +3 -3
  30. package/src/guardian_runtime_surfaces.py +248 -0
  31. package/src/guardian_telemetry.py +4 -1
  32. package/src/hook_guardrails.py +2 -0
  33. package/src/hooks/auto_capture.py +7 -2
  34. package/src/hooks/capture-session.sh +6 -2
  35. package/src/hooks/session-start.sh +41 -11
  36. package/src/hooks/session_start.py +5 -1
  37. package/src/paths.py +80 -7
  38. package/src/plugins/personal_plugins.py +12 -6
  39. package/src/plugins/personal_scripts.py +4 -1
  40. package/src/plugins/schedule.py +4 -3
  41. package/src/plugins/update.py +58 -5
  42. package/src/presets/guardian_default.json +2 -2
  43. package/src/public_contribution.py +10 -6
  44. package/src/resonance_map.py +2 -0
  45. package/src/runtime_power.py +1 -1
  46. package/src/script_registry.py +419 -39
  47. package/src/scripts/backfill_task_owner.py +263 -0
  48. package/src/scripts/deep-sleep/apply_findings.py +70 -7
  49. package/src/scripts/deep-sleep/collect.py +73 -11
  50. package/src/scripts/deep-sleep/extract.py +19 -7
  51. package/src/scripts/deep-sleep/synthesize.py +3 -1
  52. package/src/scripts/nexo-auto-update.py +3 -2
  53. package/src/scripts/nexo-backup.sh +4 -1
  54. package/src/scripts/nexo-catchup.py +7 -6
  55. package/src/scripts/nexo-cognitive-decay.py +4 -3
  56. package/src/scripts/nexo-cortex-cycle.py +3 -2
  57. package/src/scripts/nexo-cron-wrapper.sh +4 -1
  58. package/src/scripts/nexo-daily-self-audit.py +55 -23
  59. package/src/scripts/nexo-deep-sleep.sh +4 -1
  60. package/src/scripts/nexo-email-migrate-config.py +111 -25
  61. package/src/scripts/nexo-email-monitor.py +2180 -0
  62. package/src/scripts/nexo-evolution-run.py +20 -17
  63. package/src/scripts/nexo-followup-hygiene.py +4 -3
  64. package/src/scripts/nexo-followup-runner.py +921 -0
  65. package/src/scripts/nexo-immune.py +7 -6
  66. package/src/scripts/nexo-impact-scorer.py +3 -2
  67. package/src/scripts/nexo-learning-housekeep.py +3 -2
  68. package/src/scripts/nexo-learning-validator.py +4 -3
  69. package/src/scripts/nexo-morning-agent.py +433 -0
  70. package/src/scripts/nexo-outcome-checker.py +3 -2
  71. package/src/scripts/nexo-postmortem-consolidator.py +10 -9
  72. package/src/scripts/nexo-pre-commit.py +2 -1
  73. package/src/scripts/nexo-proactive-dashboard.py +6 -4
  74. package/src/scripts/nexo-runtime-preflight.py +5 -4
  75. package/src/scripts/nexo-send-reply.py +483 -0
  76. package/src/scripts/nexo-sleep.py +9 -8
  77. package/src/scripts/nexo-synthesis.py +7 -6
  78. package/src/scripts/nexo-watchdog-smoke.py +7 -5
  79. package/src/scripts/nexo-watchdog.sh +24 -13
  80. package/src/scripts/phase_guardian_analysis.py +3 -2
  81. package/src/state_watchers_runtime.py +6 -4
  82. package/src/system_catalog.py +20 -19
  83. package/src/user_context.py +11 -5
  84. package/src/user_data_portability.py +17 -4
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import json
6
6
  import os
7
+ import paths
7
8
  import shlex
8
9
  import shutil
9
10
  import subprocess
@@ -363,7 +364,7 @@ def _record_automation_run(
363
364
 
364
365
 
365
366
  def _resolve_claude_cli() -> str:
366
- saved = NEXO_HOME / "config" / "claude-cli-path"
367
+ saved = paths.config_dir() / "claude-cli-path"
367
368
  if saved.exists():
368
369
  candidate = saved.read_text().strip()
369
370
  if candidate and Path(candidate).exists():
@@ -869,7 +870,7 @@ def _build_enforcement_system_prompt() -> str:
869
870
 
870
871
  _ANTHROPIC_API_KEY_SEARCH_PATHS = (
871
872
  Path.home() / ".claude" / "anthropic-api-key.txt",
872
- Path.home() / ".nexo" / "config" / "anthropic-api-key.txt",
873
+ paths.config_dir() / "anthropic-api-key.txt",
873
874
  )
874
875
 
875
876
 
@@ -11,8 +11,15 @@ import os
11
11
  import sys
12
12
  import datetime
13
13
 
14
- # Ensure we can import from the source directory
15
- sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
14
+ # Ensure imports work both from ``src/auto_close_sessions.py`` and from the
15
+ # packaged runtime copy under ``core/scripts/auto_close_sessions.py``.
16
+ _THIS_DIR = os.path.dirname(os.path.abspath(__file__))
17
+ _IMPORT_ROOTS = [_THIS_DIR]
18
+ if os.path.basename(_THIS_DIR) == "scripts":
19
+ _IMPORT_ROOTS.append(os.path.dirname(_THIS_DIR))
20
+ for _candidate in _IMPORT_ROOTS:
21
+ if _candidate and _candidate not in sys.path:
22
+ sys.path.insert(0, _candidate)
16
23
  os.environ["NEXO_SKIP_FS_INDEX"] = "1" # Skip FTS rebuild on import
17
24
 
18
25
  from db import (