crbro-memory 1.2.1 β†’ 1.4.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Octonove Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,121 +1,129 @@
1
- # 🧠 CRBRO β€” Persistent Neural Memory for AI
2
-
3
- **CRBRO** is a local MCP (Model Context Protocol) server that gives your AI assistant **persistent long-term memory** across sessions. It uses a biological neural architecture β€” cortex, synapses, hippocampus β€” to store, connect, and retrieve knowledge automatically.
4
-
5
-
6
- ## Features
7
-
8
- - **🧬 Biological Architecture** β€” Knowledge organized as neurons (cortex), connections (synapses), and session memory (hippocampus)
9
- - **πŸ” Hybrid Search** β€” Powered by [Orama](https://orama.com/) for fast BM25 + fuzzy text search
10
- - **πŸ”₯ Heat Scores** β€” Automatic relevance tracking based on frequency, recency, and connectivity
11
- - **πŸ—ΊοΈ Global Map** β€” Cluster detection and cross-domain bridge identification *(premium)*
12
- - **πŸ“¦ Zero Dependencies** β€” Pure Node.js, no Python, no Docker, no external databases
13
- - **πŸ’Ύ File-Based** β€” All data stored as readable JSON files in `~/.crbro/`
14
- - **πŸ”Œ MCP Native** β€” Works with Claude Desktop, Cursor, Windsurf, and any MCP-compatible client
15
-
16
- ## Quick Start
17
-
18
- ### 1. Initialize
19
-
20
- ```bash
21
- npx crbro-memory init
22
- ```
23
-
24
- ### 2. Add to your MCP config
25
-
26
- **Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
27
- ```json
28
- {
29
- "mcpServers": {
30
- "crbro": {
31
- "command": "npx",
32
- "args": ["-y", "crbro-memory"]
33
- }
34
- }
35
- }
36
- ```
37
-
38
- **Cursor** (`.cursor/mcp.json`):
39
- ```json
40
- {
41
- "mcpServers": {
42
- "crbro": {
43
- "command": "npx",
44
- "args": ["-y", "crbro-memory"]
45
- }
46
- }
47
- }
48
- ```
49
-
50
- ### 3. Start using it
51
-
52
- Your AI will now have access to 15 memory tools. Start any session with `crbro_boot`.
53
-
54
- ## Tools
55
-
56
- ### Free (always available)
57
-
58
- | Tool | Description |
59
- |------|-------------|
60
- | `crbro_boot` | Boot the brain at session start β€” loads hot topics and context |
61
- | `crbro_status` | Brain status β€” neurons, synapses, sessions count |
62
- | `crbro_learn` | Store a fact, decision, pattern, or preference |
63
- | `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
64
- | `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
65
- | `crbro_recall` | Search the brain using hybrid text search |
66
- | `crbro_connect` | Create or strengthen a connection between neurons |
67
- | `crbro_connections` | Get all connections for a neuron |
68
- | `crbro_session_log` | Log a session summary |
69
- | `crbro_sessions` | List recent sessions |
70
- | `crbro_context` | Read/update active working context |
71
- | `crbro_hot_topics` | Get the most active topics by heat score |
72
- | `crbro_consolidate` | End-of-session consolidation |
73
-
74
- ### Premium (requires Synthetica Zero Deck license)
75
-
76
- | Tool | Description |
77
- |------|-------------|
78
- | `crbro_global_map` | View the neural network β€” clusters and cross-domain bridges |
79
- | `crbro_maintenance` | Full brain maintenance β€” archive, prune, rebuild |
80
-
81
- ## Architecture
82
-
83
- ```
84
- ~/.crbro/
85
- β”œβ”€β”€ manifest.json ← Brain metadata
86
- β”œβ”€β”€ cortex/ ← One JSON per neuron (topic)
87
- β”‚ β”œβ”€β”€ project_octochat.json
88
- β”‚ └── tech_firebase.json
89
- β”œβ”€β”€ synapses/ ← One JSON per connection
90
- β”‚ └── syn_octochat__firebase.json
91
- β”œβ”€β”€ hippocampus/ ← One JSON per session
92
- β”‚ └── session_2026-05-06.json
93
- β”œβ”€β”€ prefrontal/ ← Working memory
94
- β”‚ β”œβ”€β”€ active_context.json
95
- β”‚ β”œβ”€β”€ hot_topics.json
96
- β”‚ └── global_map.json
97
- β”œβ”€β”€ archives/ ← Cold neurons
98
- └── .search/ ← Orama search index
99
- └── orama.index.json
100
- ```
101
-
102
- ## Heat Score Algorithm
103
-
104
- Each neuron has a heat score (0.0 - 1.0) calculated from:
105
-
106
- - **Frequency (35%)** β€” How often the neuron is accessed
107
- - **Recency (40%)** β€” When it was last accessed (today = 1.0, >3 months = 0.05)
108
- - **Connectivity (25%)** β€” How many synapses connect to it
109
-
110
- ## CLI Commands
111
-
112
- ```bash
113
- npx crbro-memory # Start MCP server
114
- npx crbro-memory init # Initialize brain
115
- npx crbro-memory status # Show brain status
116
- npx crbro-memory --help # Help
117
- ```
118
-
119
- ## License
120
-
121
- MIT β€” Part of Octonove Agency.
1
+ # 🧠 CRBRO β€” Persistent Neural Memory for AI
2
+
3
+ **CRBRO** is a local MCP (Model Context Protocol) server that gives your AI assistant **persistent long-term memory** across sessions. It uses a biological neural architecture β€” cortex, synapses, hippocampus β€” to store, connect, and retrieve knowledge automatically.
4
+
5
+ Free and open source (MIT). All 15 tools included β€” no license, no account, no tiers.
6
+
7
+ ## Features
8
+
9
+ - **🧬 Biological Architecture** β€” Knowledge organized as neurons (cortex), connections (synapses), and session memory (hippocampus)
10
+ - **πŸ” Hybrid Search** β€” Powered by [Orama](https://orama.com/) for fast BM25 + fuzzy text search
11
+ - **πŸ”₯ Heat Scores** β€” Automatic relevance tracking based on frequency, recency, and connectivity
12
+ - **πŸ—ΊοΈ Global Map** β€” Cluster detection and cross-domain bridge identification
13
+ - **⛏️ Knowledge Miner** β€” Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
14
+ - **πŸ”’ Fully Local** β€” Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
15
+ - **πŸ’Ύ File-Based** β€” All data stored as readable JSON files in `~/.crbro/` β€” inspectable, diffable, and versionable with git
16
+ - **πŸ”Œ MCP Native** β€” Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client
17
+
18
+ ## Quick Start
19
+
20
+ ### 1. Initialize
21
+
22
+ ```bash
23
+ npx crbro-memory init
24
+ ```
25
+
26
+ ### 2. Add to your MCP config
27
+
28
+ **Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "crbro": {
33
+ "command": "npx",
34
+ "args": ["-y", "crbro-memory"]
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ **Cursor** (`.cursor/mcp.json`):
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "crbro": {
45
+ "command": "npx",
46
+ "args": ["-y", "crbro-memory"]
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ ### 3. Start using it
53
+
54
+ Your AI will now have access to 15 memory tools. Start any session with `crbro_boot`.
55
+
56
+ ## Tools
57
+
58
+ | Tool | Description |
59
+ |------|-------------|
60
+ | `crbro_boot` | Boot the brain at session start β€” loads hot topics and context |
61
+ | `crbro_status` | Brain status β€” neurons, synapses, sessions count |
62
+ | `crbro_learn` | Store a fact, decision, pattern, or preference |
63
+ | `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
64
+ | `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
65
+ | `crbro_recall` | Search the brain using hybrid text search |
66
+ | `crbro_connect` | Create or strengthen a connection between neurons |
67
+ | `crbro_connections` | Get all connections for a neuron |
68
+ | `crbro_session_log` | Log a session summary |
69
+ | `crbro_sessions` | List recent sessions |
70
+ | `crbro_context` | Read/update active working context |
71
+ | `crbro_hot_topics` | Get the most active topics by heat score |
72
+ | `crbro_global_map` | View the neural network β€” clusters and cross-domain bridges |
73
+ | `crbro_maintenance` | Full brain maintenance β€” archive, prune, rebuild |
74
+ | `crbro_consolidate` | End-of-session consolidation |
75
+
76
+ ## Architecture
77
+
78
+ ```
79
+ ~/.crbro/
80
+ β”œβ”€β”€ manifest.json ← Brain metadata
81
+ β”œβ”€β”€ cortex/ ← One JSON per neuron (topic)
82
+ β”‚ β”œβ”€β”€ project_octochat.json
83
+ β”‚ └── tech_firebase.json
84
+ β”œβ”€β”€ synapses/ ← One JSON per connection
85
+ β”‚ └── syn_octochat__firebase.json
86
+ β”œβ”€β”€ hippocampus/ ← One JSON per session
87
+ β”‚ └── session_2026-05-06.json
88
+ β”œβ”€β”€ prefrontal/ ← Working memory
89
+ β”‚ β”œβ”€β”€ active_context.json
90
+ β”‚ β”œβ”€β”€ hot_topics.json
91
+ β”‚ └── global_map.json
92
+ β”œβ”€β”€ archives/ ← Cold neurons
93
+ └── .search/ ← Orama search index
94
+ └── orama.index.json
95
+ ```
96
+
97
+ ## Heat Score Algorithm
98
+
99
+ Each neuron has a heat score (0.0 - 1.0) calculated from:
100
+
101
+ - **Frequency (35%)** β€” How often the neuron is accessed
102
+ - **Recency (40%)** β€” When it was last accessed (today = 1.0, >3 months = 0.05)
103
+ - **Connectivity (25%)** β€” How many synapses connect to it
104
+
105
+ ## Knowledge Miner
106
+
107
+ The miner is an **optional, fully local** helper that scans a directory for `.md` and `.txt` files (notes, docs, journals) and extracts knowledge into the brain β€” so CRBRO can learn from what you already wrote, not just from conversations. It never touches the network and never leaves your machine.
108
+
109
+ ```bash
110
+ npx crbro-memory mine [dir] # One-shot scan of a directory
111
+ npx crbro-memory setup-miner # Install a scheduled auto-scan (OS task scheduler)
112
+ npx crbro-memory miner-status # Check the auto-miner status
113
+ npx crbro-memory remove-miner # Remove the scheduled task
114
+ ```
115
+
116
+ > Naming note: "miner" here means *knowledge* mining β€” extracting facts from your own text files. Nothing to do with cryptocurrency.
117
+
118
+ ## CLI Commands
119
+
120
+ ```bash
121
+ npx crbro-memory # Start MCP server (stdio)
122
+ npx crbro-memory init # Initialize brain + detect IDEs
123
+ npx crbro-memory status # Show brain status
124
+ npx crbro-memory --help # Help
125
+ ```
126
+
127
+ ## License
128
+
129
+ MIT β€” see [LICENSE](LICENSE). Built by [Octonove](https://github.com/Octonove).
@@ -2,7 +2,7 @@
2
2
 
3
3
  // ─── CRBRO CLI ───────────────────────────────────────────────────
4
4
  // Command-line interface for CRBRO memory system
5
- // Supports: init, status, activate, mine, setup-miner, miner-status,
5
+ // Supports: init, status, mine, setup-miner, miner-status,
6
6
  // remove-miner, and MCP server mode (default)
7
7
 
8
8
  import { platform, homedir } from 'os';
@@ -132,9 +132,8 @@ if (command === 'init') {
132
132
  console.log('');
133
133
  console.log(' Next steps:');
134
134
  console.log(' 1. Add the config above to your IDE\'s MCP settings');
135
- console.log(' 2. npx crbro-memory activate YOUR-LICENSE-KEY');
136
- console.log(' 3. (Optional) npx crbro-memory setup-miner');
137
- console.log(' 4. Restart your IDE β€” CRBRO boots automatically!');
135
+ console.log(' 2. (Optional) npx crbro-memory setup-miner');
136
+ console.log(' 3. Restart your IDE β€” CRBRO boots automatically!');
138
137
  console.log('');
139
138
  }).catch(console.error);
140
139
 
@@ -154,7 +153,6 @@ if (command === 'init') {
154
153
  console.log(` Sessions: ${manifest.total_sessions}`);
155
154
  console.log(` Last Boot: ${manifest.last_boot || 'never'}`);
156
155
  console.log(` Last Consolidate: ${manifest.last_consolidation || 'never'}`);
157
- console.log(` License: ${manifest.license_key ? 'βœ… Active' : '❌ Not activated'}`);
158
156
  console.log('');
159
157
 
160
158
  // Show detected IDEs
@@ -175,45 +173,11 @@ if (command === 'init') {
175
173
  }).catch(console.error);
176
174
 
177
175
  } else if (command === 'activate') {
178
- // ─── Activate license key ──────────────────────────────────────
179
- const key = args[1];
180
- if (!key) {
181
- console.log('');
182
- console.log(' ❌ Usage: npx crbro-memory activate SYNTH-ZERO-XXXX-XXXX-XXXX');
183
- console.log('');
184
- console.log(' Get your license key at https://synthetica-decks.web.app');
185
- console.log('');
186
- process.exit(1);
187
- }
188
-
189
- import('../dist/engine/brain.js').then(async ({ Brain }) => {
190
- const brain = new Brain();
191
- try {
192
- await brain.getManifest();
193
- } catch {
194
- console.log(' 🧠 Brain not initialized. Initializing now...');
195
- await brain.initialize();
196
- }
197
-
198
- // Validate key format
199
- if (!key.startsWith('SYNTH-ZERO-') || key.length < 20) {
200
- console.log(' ❌ Invalid license key format.');
201
- console.log(' Keys start with SYNTH-ZERO- and are at least 20 characters.');
202
- process.exit(1);
203
- }
204
-
205
- // Persist key in manifest
206
- await brain.updateManifest({ license_key: key });
207
- console.log('');
208
- console.log(' βœ… License key activated!');
209
- console.log('');
210
- console.log(' πŸ”“ Premium features unlocked:');
211
- console.log(' β€’ crbro_global_map β€” Neural cluster visualization');
212
- console.log(' β€’ crbro_maintenance β€” Automated brain optimization');
213
- console.log('');
214
- console.log(' Restart your IDE to apply changes.');
215
- console.log('');
216
- }).catch(console.error);
176
+ // ─── Legacy command (pre-1.4.0) β€” CRBRO is now fully free ──────
177
+ console.log('');
178
+ console.log(' βœ… Good news: since v1.4.0 CRBRO is fully free.');
179
+ console.log(' All 15 tools are available β€” no license key needed.');
180
+ console.log('');
217
181
 
218
182
  } else if (command === 'mine') {
219
183
  // ─── One-shot mining ───────────────────────────────────────────
@@ -316,8 +280,7 @@ if (command === 'init') {
316
280
  console.log(' ═══════════════════════════════════════════');
317
281
  console.log('');
318
282
  console.log(' Setup:');
319
- console.log(' npx crbro-memory init Initialize brain + detect IDEs');
320
- console.log(' npx crbro-memory activate KEY Activate premium license');
283
+ console.log(' npx crbro-memory init Initialize brain + detect IDEs');
321
284
  console.log(' npx crbro-memory status Show brain status');
322
285
  console.log('');
323
286
  console.log(' Auto-Mining:');
@@ -329,7 +292,7 @@ if (command === 'init') {
329
292
  console.log(' Server:');
330
293
  console.log(' npx crbro-memory Start MCP server (stdio)');
331
294
  console.log('');
332
- console.log(' Part of Synthetica Decks β€” https://synthetica-decks.web.app');
295
+ console.log(' Open source (MIT) β€” https://github.com/Octonove/crbro-memory');
333
296
  console.log('');
334
297
 
335
298
  } else {
@@ -1,4 +1,4 @@
1
- import type { Manifest, BootResult } from '../types/index.js';
1
+ import type { Manifest, BootResult, ProtocolDirective } from '../types/index.js';
2
2
  export declare class BrainPaths {
3
3
  readonly root: string;
4
4
  readonly cortex: string;
@@ -7,6 +7,7 @@ export declare class BrainPaths {
7
7
  readonly prefrontal: string;
8
8
  readonly archives: string;
9
9
  readonly search: string;
10
+ readonly prompts: string;
10
11
  constructor(rootDir?: string);
11
12
  manifest(): string;
12
13
  neuron(id: string): string;
@@ -39,5 +40,11 @@ export declare class Brain {
39
40
  * Update the manifest counters.
40
41
  */
41
42
  updateManifest(updates: Partial<Manifest>): Promise<void>;
43
+ /**
44
+ * Load all active protocol neurons and return as directives.
45
+ * Protocols are neurons with type 'protocol' β€” their facts
46
+ * become enforcement instructions injected at boot.
47
+ */
48
+ loadProtocols(): Promise<ProtocolDirective[]>;
42
49
  }
43
50
  //# sourceMappingURL=brain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/engine/brain.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAA4B,MAAM,mBAAmB,CAAC;AAQxF,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACt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AE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,CAAC,EAAE,MAAM;IAW5B,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI1B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI3B,aAAa,IAAI,MAAM;IAIvB,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;IAInB,WAAW,IAAI,MAAM;CAGtB;AAID,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAyB;IACzC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;gBAEf,OAAO,CAAC,EAAE,MAAM;IAI5B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC;IAkDrC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAmDjC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC;IAUtC;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/D;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;CA4CpD"}
@@ -21,6 +21,7 @@ class BrainPaths {
21
21
  prefrontal;
22
22
  archives;
23
23
  search;
24
+ prompts;
24
25
  constructor(rootDir) {
25
26
  this.root = rootDir || CRBRO_DIR;
26
27
  this.cortex = node_path_1.default.join(this.root, 'cortex');
@@ -29,6 +30,7 @@ class BrainPaths {
29
30
  this.prefrontal = node_path_1.default.join(this.root, 'prefrontal');
30
31
  this.archives = node_path_1.default.join(this.root, 'archives');
31
32
  this.search = node_path_1.default.join(this.root, '.search');
33
+ this.prompts = node_path_1.default.join(this.root, 'prompts');
32
34
  }
33
35
  manifest() {
34
36
  return node_path_1.default.join(this.root, MANIFEST_FILE);
@@ -76,6 +78,7 @@ class Brain {
76
78
  this.paths.prefrontal,
77
79
  this.paths.archives,
78
80
  this.paths.search,
81
+ this.paths.prompts,
79
82
  ];
80
83
  for (const dir of dirs) {
81
84
  await node_fs_1.promises.mkdir(dir, { recursive: true });
@@ -91,7 +94,6 @@ class Brain {
91
94
  total_sessions: 0,
92
95
  last_boot: null,
93
96
  last_consolidation: null,
94
- license_key: null,
95
97
  };
96
98
  await (0, fs_js_1.writeJSON)(this.paths.manifest(), manifest);
97
99
  this.manifest = manifest;
@@ -127,6 +129,7 @@ class Brain {
127
129
  hot_topics: [],
128
130
  last_session: null,
129
131
  active_context: null,
132
+ active_protocols: [],
130
133
  message: `CRBRO brain initialized at ${this.paths.root}. Ready for first session.`,
131
134
  };
132
135
  }
@@ -139,6 +142,8 @@ class Brain {
139
142
  const hotTopics = await (0, fs_js_1.readJSON)(this.paths.hotTopics());
140
143
  // Load active context
141
144
  const activeContext = await (0, fs_js_1.readJSON)(this.paths.activeContext());
145
+ // Load active protocols
146
+ const activeProtocols = await this.loadProtocols();
142
147
  // Update boot timestamp
143
148
  this.manifest.last_boot = (0, fs_js_1.now)();
144
149
  await (0, fs_js_1.writeJSON)(this.paths.manifest(), this.manifest);
@@ -150,7 +155,8 @@ class Brain {
150
155
  hot_topics: hotTopics?.topics || [],
151
156
  last_session: activeContext?.last_session || null,
152
157
  active_context: activeContext,
153
- message: `CRBRO boot complete. ${this.manifest.total_neurons} neurons, ${this.manifest.total_synapses} synapses, ${this.manifest.total_sessions} sessions.`,
158
+ active_protocols: activeProtocols,
159
+ message: `CRBRO boot complete. ${this.manifest.total_neurons} neurons, ${this.manifest.total_synapses} synapses, ${this.manifest.total_sessions} sessions. ${activeProtocols.length} active protocol(s).`,
154
160
  };
155
161
  }
156
162
  /**
@@ -174,6 +180,50 @@ class Brain {
174
180
  await (0, fs_js_1.writeJSON)(this.paths.manifest(), manifest);
175
181
  this.manifest = manifest;
176
182
  }
183
+ /**
184
+ * Load all active protocol neurons and return as directives.
185
+ * Protocols are neurons with type 'protocol' β€” their facts
186
+ * become enforcement instructions injected at boot.
187
+ */
188
+ async loadProtocols() {
189
+ const cortexDir = this.paths.cortex;
190
+ const protocols = [];
191
+ try {
192
+ const files = await node_fs_1.promises.readdir(cortexDir);
193
+ for (const file of files) {
194
+ if (!file.startsWith('protocol_') || !file.endsWith('.json'))
195
+ continue;
196
+ const neuron = await (0, fs_js_1.readJSON)(node_path_1.default.join(cortexDir, file));
197
+ if (!neuron)
198
+ continue;
199
+ // Extract priority from tags (e.g., "priority:10")
200
+ const priorityTag = neuron.tags.find(t => t.startsWith('priority:'));
201
+ const priority = priorityTag ? parseInt(priorityTag.split(':')[1]) : 5;
202
+ // Extract source from tags (e.g., "source:zero-deck")
203
+ const sourceTag = neuron.tags.find(t => t.startsWith('source:'));
204
+ const source = sourceTag ? sourceTag.split(':')[1] : 'manual';
205
+ // Combine all facts into a single instruction block
206
+ const instructions = neuron.facts
207
+ .map(f => f.text)
208
+ .join('\n\n');
209
+ if (instructions.trim()) {
210
+ protocols.push({
211
+ id: neuron.id,
212
+ name: neuron.name,
213
+ priority,
214
+ instructions,
215
+ source,
216
+ });
217
+ }
218
+ }
219
+ }
220
+ catch {
221
+ // Cortex dir may not exist yet β€” return empty
222
+ }
223
+ // Sort by priority (highest first)
224
+ protocols.sort((a, b) => b.priority - a.priority);
225
+ return protocols;
226
+ }
177
227
  }
178
228
  exports.Brain = Brain;
179
229
  //# sourceMappingURL=brain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"brain.js","sourceRoot":"","sources":["../../src/engine/brain.ts"],"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AC,CAAC,CAAC,CAAC,QAAQ,CAAC;gBAE9D,oDAAoD;gBACpD,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK;qBAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;qBAChB,IAAI,CAAC,MAAM,CAAC,CAAC;gBAEhB,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;oBACxB,SAAS,CAAC,IAAI,CAAC;wBACb,EAAE,EAAE,MAAM,CAAC,EAAE;wBACb,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,QAAQ;wBACR,YAAY;wBACZ,MAAM;qBACP,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,8CAA8C;QAChD,CAAC;QAED,mCAAmC;QACnC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;QAClD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA7LD,sBA6LC"}
@@ -56,7 +56,7 @@ class Prefrontal {
56
56
  topics: ht.topics.slice(0, limit),
57
57
  };
58
58
  }
59
- // ─── Global Map (Premium Feature) ──────────────────────────────
59
+ // ─── Global Map ────────────────────────────────────────────────
60
60
  /**
61
61
  * Build the global map β€” clusters of related neurons and bridges between domains.
62
62
  */
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE,wBAAgB,YAAY,IAAI,SAAS,CA0pBxC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAYpE,wBAAgB,YAAY,IAAI,SAAS,CA4lBxC"}