@timmeck/brain 3.36.14 → 3.36.16

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 (33) hide show
  1. package/README.md +178 -188
  2. package/dist/brain.d.ts +5 -0
  3. package/dist/brain.js +196 -6
  4. package/dist/brain.js.map +1 -1
  5. package/dist/cli/commands/__tests__/borg.test.d.ts +1 -0
  6. package/dist/cli/commands/__tests__/borg.test.js +84 -0
  7. package/dist/cli/commands/__tests__/borg.test.js.map +1 -0
  8. package/dist/cli/commands/__tests__/plugins.test.d.ts +1 -0
  9. package/dist/cli/commands/__tests__/plugins.test.js +69 -0
  10. package/dist/cli/commands/__tests__/plugins.test.js.map +1 -0
  11. package/dist/cli/commands/__tests__/watchdog.test.d.ts +1 -0
  12. package/dist/cli/commands/__tests__/watchdog.test.js +63 -0
  13. package/dist/cli/commands/__tests__/watchdog.test.js.map +1 -0
  14. package/dist/cli/commands/borg.d.ts +2 -0
  15. package/dist/cli/commands/borg.js +77 -0
  16. package/dist/cli/commands/borg.js.map +1 -0
  17. package/dist/cli/commands/plugins.d.ts +2 -0
  18. package/dist/cli/commands/plugins.js +75 -0
  19. package/dist/cli/commands/plugins.js.map +1 -0
  20. package/dist/cli/commands/service.d.ts +2 -0
  21. package/dist/cli/commands/service.js +101 -0
  22. package/dist/cli/commands/service.js.map +1 -0
  23. package/dist/cli/commands/watchdog.d.ts +2 -0
  24. package/dist/cli/commands/watchdog.js +69 -0
  25. package/dist/cli/commands/watchdog.js.map +1 -0
  26. package/dist/index.js +8 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/ipc/router.d.ts +7 -0
  29. package/dist/ipc/router.js +40 -5
  30. package/dist/ipc/router.js.map +1 -1
  31. package/dist/mcp/debate-tools.js +48 -0
  32. package/dist/mcp/debate-tools.js.map +1 -1
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
6
  [![GitHub stars](https://img.shields.io/github/stars/timmeck/brain-ecosystem?style=social)](https://github.com/timmeck/brain-ecosystem)
7
7
 
8
- **Autonomous Error Memory, Code Intelligence & Self-Improving AI for Claude Code — 134 MCP Tools, 30+ Engines**
8
+ **Autonomous Error Memory, Code Intelligence & Self-Improving AI for Claude Code — 134 MCP Tools, 60+ Engines**
9
9
 
10
- Brain is an MCP server that gives Claude Code a persistent, self-improving memory. It remembers errors, learns solutions, and runs 30+ autonomous engines in a 40-step feedback cycle. It observes itself, detects anomalies, forms and tests hypotheses, distills principles, reasons in chains, feels emotions, evolves strategies genetically, debates itself, gets curious about knowledge gaps, and modifies its own source code. It dreams consolidating memories during idle periods like biological sleep. 134 MCP tools. 2496 tests.
10
+ Brain is an MCP server that gives Claude Code a persistent, self-improving memory. It remembers errors, learns solutions, and runs 60+ autonomous engines in a 40-step feedback cycle. It observes itself, detects anomalies, forms and tests hypotheses, distills principles, reasons in chains, feels emotions, evolves strategies genetically, debates itself, challenges its own principles (Advocatus Diaboli), gets curious about knowledge gaps, syncs knowledge via Borg collective, loads community plugins, and modifies its own source code. Multi-provider LLM (Anthropic + Ollama). Autonomous web research missions. Live tech radar scanning. 137 MCP tools. 1407 tests.
11
11
 
12
12
  ## Quick Start
13
13
 
@@ -18,6 +18,29 @@ brain setup
18
18
 
19
19
  That's it. One command configures MCP, hooks, and starts the daemon.
20
20
 
21
+ ## Architecture
22
+
23
+ ```
24
+ Claude Code ──MCP stdio──► Brain Daemon (:7777)
25
+ Cursor/Windsurf ─MCP SSE──► MCP HTTP Server (:7778)
26
+ Browser ────────HTTP──────► Mission Control (:7788)
27
+ Command Center (:7790)
28
+
29
+ ┌───────────────┼───────────────┐
30
+ ▼ ▼ ▼
31
+ Error Memory Research Engine 60+ Engines
32
+ Code Intel Mission Engine ResearchOrchestrator
33
+ Synapse Net LLM Service 40-step feedback loop
34
+ Prevention Web Research │
35
+ Git Intel TechRadar ┌───┴───────────┐
36
+ │ ▼ ▼
37
+ ▼ Self-Modification Dream Mode
38
+ SQLite (~/.brain) CodeGenerator Memory
39
+ SelfScanner Consolidation
40
+ ```
41
+
42
+ Cross-brain communication via IPC named pipes (trading-brain, marketing-brain).
43
+
21
44
  ## Features
22
45
 
23
46
  ### Error Memory & Code Intelligence
@@ -32,221 +55,188 @@ That's it. One command configures MCP, hooks, and starts the daemon.
32
55
  - **Memory System** — Remember preferences, decisions, context, facts, goals, and lessons across sessions
33
56
  - **Session Tracking** — Auto-tracks conversation sessions with goals, summaries, and outcomes
34
57
  - **Decision History** — Record architecture/design decisions with alternatives and rationale
35
- - **Semantic Changelog** — Track what changed, why, and how it connects to errors and decisions
36
- - **Task/Goal Tracking** — Manage tasks with priorities, subtasks, and full context aggregation
58
+ - **Semantic Changelog** — Tracks every file change with semantic meaning, diffs, and context
59
+ - **Task & Goal Tracking** — Persistent tasks with priority, status, and cross-session continuity
37
60
  - **Semantic Search** — Local all-MiniLM-L6-v2 embeddings (23MB, no cloud required)
38
61
 
39
- ### 30+ Autonomous Engines
40
-
41
- The ResearchOrchestrator runs a 40-step feedback cycle every 5 minutes, coordinating all engines:
42
-
43
- #### Core Research (9 Engines)
44
-
45
- | Engine | What It Does |
46
- |--------|-------------|
47
- | **SelfObserver** | Observes Brain's own performance and generates insights |
48
- | **AnomalyDetective** | Detects statistical outliers using Z-scores and drift analysis |
49
- | **CrossDomainEngine** | Finds correlations between events across brains |
50
- | **AdaptiveStrategy** | Adjusts strategies, reverts if performance drops |
51
- | **ExperimentEngine** | A/B tests on Brain's own parameters every 5 cycles |
52
- | **KnowledgeDistiller** | Extracts principles from confirmed hypotheses |
53
- | **ResearchAgenda** | Prioritizes what to research next |
54
- | **CounterfactualEngine** | "What if" analysis for hypothetical interventions |
55
- | **Journal** | Logs all discoveries, experiments, breakthroughs |
56
-
57
- #### Intelligence & Awareness
58
-
59
- | Engine | What It Does |
60
- |--------|-------------|
61
- | **AttentionEngine** | Dynamic focus, context detection, burst detection, engine weight allocation |
62
- | **TransferEngine** | Cross-brain knowledge transfer, analogies, cross-domain rules |
63
- | **NarrativeEngine** | Brain explains itself in natural language, finds contradictions, generates digests |
64
- | **CuriosityEngine** | Knowledge gap detection, UCB1 explore/exploit, blind spot detection |
65
- | **EmergenceEngine** | Emergent behavior detection, complexity metrics (entropy, phi), phase transitions |
66
- | **DebateEngine** | Multi-agent debates, advocatus diaboli, consensus synthesis |
67
- | **ReasoningEngine** | Forward chaining, abductive reasoning, temporal inference, counterfactuals |
68
- | **EmotionalModel** | 8 emotion dimensions, 6 moods, mood-based behavior recommendations |
69
-
70
- #### Meta-Cognition & Optimization
71
-
72
- | Engine | What It Does |
73
- |--------|-------------|
74
- | **ParameterRegistry** | Central tunable parameter store with 30+ parameters, bounds, snapshots |
75
- | **MetaCognitionLayer** | Engine performance grading (A-F), frequency adjustment |
76
- | **AutoExperimentEngine** | Autonomous parameter tuning with snapshot/rollback |
77
- | **EvolutionEngine** | Genetic algorithm — tournament selection, crossover, mutation, elitism |
78
- | **GoalEngine** | Goal planning with progress tracking, linear regression forecasting |
79
- | **MemoryPalace** | Knowledge graph with BFS pathfinding and auto-connection building |
80
-
81
- #### Autonomy & Self-Improvement
82
-
83
- | Engine | What It Does |
84
- |--------|-------------|
85
- | **SelfTestEngine** | Tests if brain truly understands its principles vs memorization |
86
- | **TeachEngine** | Generates teaching packages for other brains |
87
- | **DataScout** | External data acquisition from GitHub/npm/HN |
88
- | **SimulationEngine** | What-if scenarios via CausalGraph + PredictionEngine |
89
- | **SelfScanner** | Indexes own TypeScript source code with SHA256 change detection |
90
- | **SelfModificationEngine** | Generates and tests code changes autonomously via Claude API |
91
- | **BootstrapService** | Cold-start fix: seeds data so engines produce output from cycle 1 |
62
+ ### LLM Service
63
+ - **Multi-Provider** — Anthropic Claude + Ollama local models with auto-routing
64
+ - **Smart Caching** Content-hash cache, avoid duplicate API calls
65
+ - **Rate Limiting** — Per-hour and per-day token budgets with automatic throttling
66
+ - **Usage Tracking** Calls, tokens, latency, cache hit rate, cost tracking
67
+ - **Tier Routing** — Templates mapped to tiers (critical/standard/bulk), auto-routed to best provider
68
+
69
+ ### Research Missions
70
+ - **5-Phase Pipeline** Decompose Gather Hypothesize Analyze → Synthesize
71
+ - **Web Research** Brave Search + Jina Reader + Playwright + Firecrawl fallback chain
72
+ - **Autonomous** Brain decides what to research and executes independently
73
+ - **Source Tracking** Every finding traced back to its original source
74
+
75
+ ### TechRadar
76
+ - **Daily Scanning** Tracks trending repos, tech news, library updates
77
+ - **Repo Watching** Monitor specific repos for changes (3 default repos configured)
78
+ - **LLM Relevance Scoring** AI judges how relevant each finding is to your stack
79
+ - **Digest Generation** — Daily summaries of what's new and relevant
80
+
81
+ ### 60+ Autonomous Engines
82
+
83
+ The ResearchOrchestrator runs a 40-step feedback cycle every 5 minutes:
84
+
85
+ #### Core Research Engines
86
+
87
+ | Engine | Purpose |
88
+ |--------|---------|
89
+ | SelfObserver | Monitors Brain's own performance metrics and behavior |
90
+ | AnomalyDetective | Detects statistical anomalies in error patterns and metrics |
91
+ | DataScout | Discovers external data sources and imports relevant data |
92
+ | SignalScanner | Scans GitHub repos, HN, crypto markets for signals |
93
+ | TechRadar | Daily tech landscape scanning with relevance scoring |
94
+ | HypothesisEngine | Generates and statistically tests hypotheses about patterns |
95
+ | ExperimentEngine | Proposes, runs, and measures controlled experiments |
96
+ | AutoExperimentEngine | Autonomously discovers and runs parameter experiments |
97
+ | SimulationEngine | What-if scenarios and counterfactual reasoning |
98
+ | KnowledgeDistiller | Extracts principles and anti-patterns from experience |
99
+
100
+ #### Intelligence Engines
101
+
102
+ | Engine | Purpose |
103
+ |--------|---------|
104
+ | AttentionEngine | Dynamic focus allocation across topics and engines |
105
+ | CausalGraph | Discovers cause-effect relationships between events |
106
+ | CrossDomainEngine | Finds correlations across brain domains |
107
+ | PatternExtractor | Mines recurring code and error patterns |
108
+ | TransferEngine | Transfers knowledge between domains via analogies |
109
+ | NarrativeEngine | Generates natural language explanations of findings |
110
+ | CuriosityEngine | Detects knowledge gaps and generates exploration questions |
111
+ | ResearchAgendaEngine | Prioritizes what to investigate next |
112
+ | CounterfactualEngine | "What if X hadn't happened?" reasoning |
113
+
114
+ #### Meta-Cognition Engines
115
+
116
+ | Engine | Purpose |
117
+ |--------|---------|
118
+ | MetaCognitionLayer | Evaluates engine effectiveness, produces report cards |
119
+ | DebateEngine | Multi-perspective reasoning with synthesis |
120
+ | EmergenceEngine | Detects emergent properties from engine interactions |
121
+ | ConceptAbstraction | Forms hierarchical concept taxonomies |
122
+ | MemoryPalace | Builds associative knowledge graph for navigation |
123
+ | ReasoningEngine | Deductive, abductive, and temporal inference chains |
124
+ | EmotionalModel | Frustration, curiosity, satisfaction — influences priorities |
125
+ | SelfTestEngine | Tests understanding of its own principles |
126
+ | TeachEngine | Packages knowledge for transfer to other brains |
127
+
128
+ #### Autonomy Engines
129
+
130
+ | Engine | Purpose |
131
+ |--------|---------|
132
+ | SelfModificationEngine | Generates code improvements, tests before applying |
133
+ | CodeGenerator | Produces new code from learned patterns |
134
+ | CodeMiner | Extracts reusable patterns from codebases |
135
+ | GoalEngine | Sets, tracks, and forecasts autonomous goals |
136
+ | EvolutionEngine | Genetic algorithm for strategy optimization |
137
+ | AdaptiveStrategyEngine | Real-time parameter adaptation based on outcomes |
138
+ | DreamEngine | Offline memory consolidation during idle |
139
+ | ResearchOrchestrator | Orchestrates the entire 40-step feedback cycle |
92
140
 
93
141
  ### Self-Improvement Loop
94
- - **Hypothesis Engine** — Forms hypotheses from observed patterns, tests them statistically
95
- - **Auto-Experiments** — Tests its own parameters (Z-Threshold, Decay Rate, Research Interval)
96
- - **Self-Metrics** — Tracks own cycle data: anomaly_count, insight_count, cycle_duration_ms
97
- - **Frustration Detection** — If a suggestion is ignored 3x, generates alternative approaches
98
- - **Improvement Requests** — Writes "Tell Claude:" suggestions to `~/.brain/improvement-requests.md`
99
- - **Knowledge Distillation** — Confirmed hypotheses become reusable principles
100
142
 
101
- ### Dream Mode
102
- - **Memory Replay** — Spreading Activation strengthens active memory pathways
103
- - **Synapse Pruning** — Weak connections (weight < 0.15) are deleted
104
- - **Memory Compression** — Similar memories are clustered and merged
105
- - **Importance Decay** — Old memories gradually lose importance, eventually archived
106
- - **Triggers** — Every 20 cycles, after 5 minutes idle, or manually
107
-
108
- ### Mission Control Dashboard (`:7788`)
109
-
110
- <p align="center"><img src="../../docs/assets/mission-control.png" alt="Mission Control Dashboard" width="700"></p>
143
+ Brain continuously improves itself through a closed-loop cycle:
111
144
 
112
- - **7 Tabs** — Overview, Consciousness, Thoughts, CodeGen, Self-Mod, Engines, Intelligence
113
- - **Consciousness Entity** — Living animated visualization of the brain's emotional/consciousness state: pulsing orb colored by mood (flow=cyan, excited=gold, anxious=red, reflective=violet, bored=gray, determined=white), organic tentacles, 8-dimension ring, ambient particles, floating thoughts, inner eye tracking attention focus
114
- - **Thought Stream** — Real-time feed of every engine's activity with significance filtering
115
- - **CodeGen** — Generate, review, approve/reject code with syntax highlighting
116
- - **Self-Mod** — Pending modifications with side-by-side diff viewer
117
- - **Engine Status** — Live status cards for all 30+ engines
118
- - **Intelligence** — Attention topics, transfer analogies, cross-domain rules
119
- - **Trigger Cycle** — Button to manually trigger a feedback cycle
120
-
121
- ### Prediction Engine
122
- - **Holt-Winters** — Double Exponential Smoothing for metric forecasting
123
- - **EWMA Fallback** — When insufficient data for Holt-Winters
124
- - **Auto-Calibration** — Confidence calibrated against actual outcomes
125
- - **Self-Resolving** — Predictions are checked against reality and scored
145
+ 1. **Observe** — SelfObserver records performance metrics (error rates, resolution times, cache hits)
146
+ 2. **Hypothesize** — HypothesisEngine generates testable theories about what could work better
147
+ 3. **Experiment** — AutoExperimentEngine runs controlled A/B tests on parameters
148
+ 4. **Measure** — MetaCognitionLayer evaluates which experiments improved outcomes
149
+ 5. **Adapt** — AdaptiveStrategy applies winning parameters, reverts failures
150
+ 6. **Evolve** — EvolutionEngine genetically breeds the best strategy combinations
126
151
 
127
- ### AutoResponder
128
- - **Anomaly Response** — Automatically adjusts parameters when anomalies are detected
129
- - **Configurable Rules** — Define which anomalies trigger which actions
130
- - **Cooldown System** — Prevents response storms
131
- - **Journal Logging** — Every auto-response is logged for review
132
-
133
- ### Code Generation & Mining
134
- - **CodeGenerator** — Claude API integration, uses brain knowledge (principles, anti-patterns, strategies, patterns) as context
135
- - **Human-in-the-Loop** — Generated code is reviewed: approve or reject with notes
136
- - **CodeMiner** — Mines GitHub repos (README, package.json, directory trees) for pattern learning
137
- - **PatternExtractor** — Extracts dependency, tech stack, structure, and README patterns from mined repos
138
- - **CodeGen Tab** — Integrated in Mission Control at http://localhost:7788 for reviewing and managing code generations
139
- - **Signal Scanner** — Tracks GitHub trending repos, Hacker News mentions, crypto signals
140
-
141
- ### Dashboards
142
-
143
- | Dashboard | Port | What It Shows |
144
- |-----------|------|--------------|
145
- | **Mission Control** | 7788 | Unified 7-tab dashboard: Overview, Consciousness (Entity visualization), Thoughts, CodeGen, Self-Mod, Engines, Intelligence |
146
-
147
- ## Architecture
152
+ Frustration Detection: EmotionalModel tracks repeated failures. High frustration triggers more aggressive exploration via CuriosityEngine.
148
153
 
149
- ```
150
- Claude Code / Cursor / Browser
151
- |
152
- MCP / HTTP / REST
153
- |
154
- +----+----+
155
- | BrainCore|
156
- +----+----+
157
- |
158
- +------+------+------+------+------+
159
- | | | | | |
160
- Error Code Synapse Memory Git Embedding
161
- Memory Intel Network System Intel Engine
162
- | | | | | |
163
- +------+------+------+------+------+
164
- |
165
- ResearchOrchestrator (40 steps)
166
- |
167
- +------+------+------+------+------+------+------+
168
- | | | | | | | |
169
- Dream Pred. AutoR Hypo. CodeGen Signal Attention
170
- Engine Engine espond Engine (Claude) Scanner Engine
171
- | | | | | | | |
172
- +------+------+------+------+------+------+------+
173
- |
174
- 30+ Engines in Feedback Loops
175
- (Research, Intelligence, MetaCog, Evolution,
176
- Reasoning, Emotions, Self-Modification, ...)
177
- |
178
- SQLite (better-sqlite3, WAL mode)
179
- ```
180
-
181
- ## MCP Tools (134 tools)
182
-
183
- **Error & Code**: brain_report_error, brain_query_error, brain_report_solution, brain_report_attempt, brain_find_reusable_code, brain_register_code, brain_check_code_similarity
184
-
185
- **Memory & Sessions**: brain_remember, brain_recall, brain_session_start, brain_session_end, brain_session_history
154
+ ### Dream Mode
186
155
 
187
- **Decisions, Changes, Tasks, Docs**: brain_record_decision, brain_query_decisions, brain_record_change, brain_query_changes, brain_add_task, brain_update_task, brain_list_tasks, brain_task_context, brain_index_project, brain_query_docs, brain_project_context
156
+ During idle periods (no active conversations), DreamEngine performs memory consolidation:
188
157
 
189
- **Research & Learning**: brain_explore, brain_connections, brain_insights, brain_rate_insight, brain_suggest, brain_explain_learning, brain_override_rule, brain_get_suggestions
158
+ - **Replay** Re-processes important experiences to strengthen synaptic connections
159
+ - **Pruning** — Removes low-value memories and weak synapse connections
160
+ - **Compression** — Merges similar patterns into generalized principles
161
+ - **Decay** — Time-based weight reduction on unused knowledge
162
+ - **Triggers** — Starts automatically after configurable idle period, or manually via `dream.start`
190
163
 
191
- **9 Research Engines** (5 tools each): self_observer, anomaly_detective, cross_domain, adaptive_strategy, experiment, knowledge_distiller, research_agenda, counterfactual, journal — each with _status, _list, _get, _summary, _config
164
+ ### Prediction Engine
192
165
 
193
- **Dream Mode**: brain_dream_status, brain_dream_consolidate, brain_dream_history
166
+ Forecasts future metrics using statistical models:
194
167
 
195
- **Consciousness**: brain_consciousness_status, brain_consciousness_thoughts
168
+ - **Holt-Winters** Triple exponential smoothing for seasonal patterns
169
+ - **EWMA** — Exponential weighted moving average for trend detection
170
+ - **Auto-Calibration** — Tracks prediction accuracy and adjusts model parameters
171
+ - **Domain-Aware** — Separate models per domain (errors, performance, learning)
196
172
 
197
- **Prediction**: brain_predict, brain_prediction_accuracy, brain_predictions_list
173
+ ### AutoResponder
198
174
 
199
- **AutoResponder**: brain_responder_status, brain_responder_history, brain_responder_rules
175
+ Automatic anomaly response system:
200
176
 
201
- **CodeGen**: brain_generate_code, brain_codegen_status, brain_codegen_review, brain_codeminer_status, brain_codeminer_patterns
177
+ - **Rule-Based** Configurable rules: "if error_rate > threshold, trigger learning cycle"
178
+ - **Cooldown** — Prevents response storms with per-rule cooldown periods
179
+ - **Action Types** — Learning cycles, notifications, parameter adjustments, dream triggers
180
+ - **History** — Full audit trail of what was detected and what action was taken
202
181
 
203
- **Attention**: brain_focus_status, brain_focus_set, brain_focus_history
182
+ ### Code Generation & Mining
204
183
 
205
- **Transfer**: brain_transfer_status, brain_transfer_analogies, brain_transfer_rules
184
+ - **CodeGenerator** Generates code improvements via Claude API with full diff preview
185
+ - **CodeMiner** — Analyzes codebases to extract reusable patterns and modules
186
+ - **PatternExtractor** — Identifies recurring code patterns across projects
187
+ - **SignalScanner** — Monitors GitHub trending, Hacker News, crypto markets for relevant signals
188
+ - **Self-Improvement Proposals** — Engines can propose improvements to their own source code
206
189
 
207
- **Narrative**: brain_explain, brain_ask, brain_weekly_digest, brain_contradictions
190
+ ### Self-Modification
191
+ - **SelfScanner** — Indexes own TypeScript source code with SHA256 change detection
192
+ - **SelfModificationEngine** — Generates improvements via Claude API, tests before applying
193
+ - **Experiment Ledger** — Tracks hypothesis, risk level, metrics before/after for every modification
194
+ - **Safety** — All modifications require explicit approval, automatic rollback on test failure
208
195
 
209
- **Curiosity**: brain_curiosity_status, brain_curiosity_gaps, brain_curiosity_questions, brain_curiosity_explore
196
+ ### Notifications
197
+ - **Discord, Telegram, Email** — Multi-channel alert routing
198
+ - **Notification Bridge** — IPC-based cross-brain notification relay
199
+ - **Configurable** — All providers optional, graceful fallback
200
+ - **Event Routing** — Different events route to different channels
210
201
 
211
- **Emergence**: brain_emergence_status, brain_emergence_detect, brain_emergence_complexity_metrics, brain_emergence_journal
202
+ ### Dashboards
212
203
 
213
- **Debate**: brain_debate_start, brain_debate_synthesize, brain_debate_perspective, brain_debate_history
204
+ | Dashboard | Port | What It Shows |
205
+ |-----------|------|--------------|
206
+ | **Mission Control** | 7788 | 7-tab: Overview, Consciousness Entity, Thoughts, CodeGen, Self-Mod, Engines, Intelligence |
207
+ | **Command Center** | 7790 | 8-page: Ecosystem, Learning, Trading, Marketing, Cross-Brain & Borg, Debates & Challenges, Activity & Missions, Infrastructure |
214
208
 
215
- **MetaCognition**: brain_metacognition_status, brain_engine_report, brain_auto_experiment_status, brain_parameter_registry
209
+ **Mission Control** — The Consciousness Entity visualization shows Brain's current emotional state, active thought streams, engine activity heatmap, and real-time thought generation. CodeGen tab shows pending code proposals. Self-Mod tab shows modification history with diffs.
216
210
 
217
- **SelfAware**: brain_selftest_run, brain_selftest_results, brain_teach_status, brain_teach_create, brain_datascout_status, brain_datascout_scan, brain_simulation_run, brain_simulation_results, brain_simulation_scenarios, brain_palace_status, brain_palace_map, brain_palace_path, brain_palace_build, brain_goal_status, brain_goal_create, brain_goal_progress
211
+ **Command Center** Live overview of the entire ecosystem: all 3 brains, 60+ engines, error log, self-modification feed, research missions, knowledge growth chart, engine dependency flow, quick actions, animated Borg network, peer graph, debate history, Advocatus Diaboli challenges with resilience bars, watchdog daemon monitoring, LLM usage tracking.
218
212
 
219
- **Evolution**: brain_evolution_status, brain_evolution_history, brain_evolution_best, brain_evolution_run
213
+ ## MCP Tools (137 tools)
220
214
 
221
- **Reasoning**: brain_reasoning_status, brain_reason, brain_explain_why, brain_what_if
215
+ **Error & Code**: brain_report_error, brain_query_error, brain_report_solution, brain_report_attempt, brain_find_reusable_code, brain_register_code, brain_check_code_similarity
222
216
 
223
- **Emotions**: brain_emotional_status, brain_mood_history, brain_mood_influences, brain_mood_advice
217
+ **Memory & Sessions**: brain_remember, brain_recall, brain_session_start, brain_session_end, brain_session_history
224
218
 
225
- **Self-Modification**: brain_selfmod_status, brain_selfmod_pending, brain_selfmod_approve, brain_selfmod_history
219
+ **Research Engines** (5 tools each): self_observer, anomaly_detective, cross_domain, adaptive_strategy, experiment, knowledge_distiller, research_agenda, counterfactual, journal
226
220
 
227
- **Ecosystem**: brain_status, brain_notifications, brain_ecosystem_status, brain_query_peer, brain_error_trading_context, brain_unified_status
221
+ **Dream, Consciousness, Prediction, AutoResponder, Attention, Transfer, Narrative, Curiosity, Emergence, Debate, Challenge (Advocatus Diaboli), MetaCognition, Evolution, Reasoning, Emotions, Self-Modification, Ecosystem, Borg, Plugins** — full tool suites for each
228
222
 
229
223
  ## CLI Commands
230
224
 
231
225
  ```
232
226
  brain setup One-command setup: MCP + hooks + daemon
233
- brain start Start the Brain daemon
234
- brain stop Stop the daemon
235
- brain status Show stats
227
+ brain start / stop Daemon management (with watchdog)
228
+ brain status Stats: errors, solutions, engines, synapses
236
229
  brain doctor Health check: daemon, DB, MCP, hooks
237
230
  brain query <text> Search for errors and solutions
238
- brain modules List registered code modules
239
- brain insights Show research insights
240
- brain network Explore the synapse network
241
231
  brain learn Trigger a learning cycle
242
- brain explain <id> Full error report
243
- brain rules List active learned rules
244
- brain synapses Show strongest synapse connections
245
- brain config View and manage configuration
246
- brain export Export Brain data as JSON
247
- brain import <dir> Import a project directory
248
- brain dashboard Generate interactive HTML dashboard
249
232
  brain peers Show peer brains in the ecosystem
233
+ brain dashboard Generate interactive HTML dashboard
234
+ brain missions Research mission management (create, list, report)
235
+ brain watchdog Watchdog daemon status and control
236
+ brain service Windows service management (install, uninstall, status)
237
+ brain borg Borg collective sync (status, enable, disable, sync, history)
238
+ brain plugins Community plugins (list, routes, tools)
239
+ brain export Export Brain data as JSON
250
240
  ```
251
241
 
252
242
  ## Configuration
@@ -256,20 +246,20 @@ brain peers Show peer brains in the ecosystem
256
246
  | `BRAIN_DATA_DIR` | `~/.brain` | Data directory |
257
247
  | `BRAIN_LOG_LEVEL` | `info` | Log level |
258
248
  | `BRAIN_API_PORT` | `7777` | REST API port |
259
- | `BRAIN_API_KEY` | — | API authentication key |
260
249
  | `BRAIN_MCP_HTTP_PORT` | `7778` | MCP HTTP/SSE port |
261
- | `BRAIN_EMBEDDINGS_ENABLED` | `true` | Enable local embeddings |
262
- | `ANTHROPIC_API_KEY` | — | Enables CodeGenerator + CodeGen Dashboard |
250
+ | `ANTHROPIC_API_KEY` | | Enables LLM features, CodeGen, Self-Mod |
251
+ | `BRAVE_SEARCH_API_KEY` | — | Enables web research missions |
263
252
  | `GITHUB_TOKEN` | — | Enables CodeMiner + Signal Scanner |
253
+ | `OLLAMA_HOST` | `http://localhost:11434` | Ollama local model endpoint |
264
254
 
265
255
  ## Brain Ecosystem
266
256
 
267
- | Brain | Version | Purpose | Ports |
268
- |-------|---------|---------|-------|
269
- | **Brain** | v3.34.0 | Error memory, code intelligence, full autonomy & self-modification | **7777** / 7778 / 7788 |
270
- | [Trading Brain](../trading-brain) | v2.29.0 | Adaptive trading intelligence with signal learning & backtesting | 7779 / 7780 |
271
- | [Marketing Brain](../marketing-brain) | v1.30.0 | Content strategy, engagement & cross-platform optimization | 7781 / 7782 / 7783 |
272
- | [Brain Core](../brain-core) | v2.34.0 | Shared infrastructure — 30+ engines, synapses, IPC, MCP, dream, consciousness, codegen | — |
257
+ | Brain | Purpose | Ports |
258
+ |-------|---------|-------|
259
+ | **Brain** (this) | Error memory, code intelligence, full autonomy & self-modification | **7777** / 7778 / 7788 / 7790 |
260
+ | [Trading Brain](../trading-brain) | Adaptive trading intelligence with signal learning & paper trading | 7779 / 7780 |
261
+ | [Marketing Brain](../marketing-brain) | Content strategy, social engagement & cross-platform optimization | 7781 / 7782 / 7783 |
262
+ | [Brain Core](../brain-core) | Shared infrastructure — 60+ engines | — |
273
263
 
274
264
  ## Support
275
265
 
package/dist/brain.d.ts CHANGED
@@ -16,12 +16,16 @@ export declare class BrainCore {
16
16
  private attentionEngine;
17
17
  private transferEngine;
18
18
  private unifiedServer;
19
+ private commandCenter;
19
20
  private narrativeEngine;
20
21
  private curiosityEngine;
21
22
  private emergenceEngine;
22
23
  private debateEngine;
23
24
  private peerNetwork;
25
+ private pluginRegistry;
26
+ private borgSync;
24
27
  private cleanupTimer;
28
+ private retentionTimer;
25
29
  private config;
26
30
  private configPath?;
27
31
  private restarting;
@@ -29,6 +33,7 @@ export declare class BrainCore {
29
33
  private restartWindowStart;
30
34
  start(configPath?: string): void;
31
35
  private logCrash;
36
+ private runRetentionCleanup;
32
37
  private cleanup;
33
38
  restart(): void;
34
39
  stop(): void;