crbro-memory 1.6.1 β†’ 1.8.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/README.md CHANGED
@@ -1,174 +1,260 @@
1
- # 🧠 CRBRO β€” Persistent Neural Memory for AI
2
-
3
- [![npm](https://img.shields.io/npm/v/crbro-memory)](https://www.npmjs.com/package/crbro-memory)
4
- [![license](https://img.shields.io/github/license/Octonove/crbro-memory)](LICENSE)
5
- [![MCP](https://img.shields.io/badge/MCP-Claude%20Code%20%C2%B7%20Claude%20Desktop%20%C2%B7%20Cursor-1E3A5F)](https://modelcontextprotocol.io)
6
-
7
- **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.
8
-
9
- ![CRBRO demo](docs/demo.gif)
10
-
11
- Free and open source (MIT). All 18 tools included β€” no license, no account, no tiers.
12
-
13
- > ⭐ **If CRBRO gives your AI a memory worth keeping, a star on GitHub is the best way to support it.**
14
-
15
- ## Features
16
-
17
- - **🧬 Biological Architecture** β€” Knowledge organized as neurons (cortex), connections (synapses), and session memory (hippocampus)
18
- - **πŸ” Fact-Level Search** β€” Powered by [Orama](https://orama.com/). Every fact is indexed on its own, so a topic with hundreds of facts stays as findable as one with three, and each result comes back with the exact fact that matched and the date it was recorded
19
- - **πŸ”₯ Heat Scores** β€” Automatic relevance tracking based on frequency, recency, and connectivity
20
- - **✏️ Correctable** β€” Knowledge can be superseded or retracted, not just piled up. A memory that only appends keeps serving yesterday's answer with today's confidence
21
- - **πŸ” Credential-aware** β€” API keys, tokens and passwords are replaced with a marker before they touch the disk. The sentence around them survives; the secret does not
22
- - **πŸ‘₯ Safe with two editors open** β€” Writes are serialised per neuron, so running CRBRO in two IDEs at once does not silently lose facts
23
- - **πŸ—ΊοΈ Global Map** β€” Cluster detection and cross-domain bridge identification
24
- - **⛏️ Knowledge Miner** β€” Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
25
- - **πŸ”’ Fully Local** β€” Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
26
- - **πŸ’Ύ File-Based** β€” All data stored as readable JSON files in `~/.crbro/` β€” inspectable, diffable, and versionable with git
27
- - **πŸ”Œ MCP Native** β€” Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client
28
-
29
- ## Quick Start
30
-
31
- ### 1. Initialize
32
-
33
- ```bash
34
- npx crbro-memory init
35
- ```
36
-
37
- ### 2. Add to your MCP config
38
-
39
- > **Register CRBRO at the user level, not per-project.** Your brain lives in
40
- > `~/.crbro/` and is shared across every folder β€” but if you register the
41
- > server inside a single project, other folders won't have the tools and it
42
- > will *look* like the memory is gone. User-level registration makes it
43
- > available everywhere, which is the whole point.
44
-
45
- **Claude Code** (one command, available in every folder):
46
- ```bash
47
- claude mcp add --scope user crbro -- npx -y crbro-memory
48
- ```
49
-
50
- **Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
51
- ```json
52
- {
53
- "mcpServers": {
54
- "crbro": {
55
- "command": "npx",
56
- "args": ["-y", "crbro-memory"]
57
- }
58
- }
59
- }
60
- ```
61
-
62
- **Cursor** (`~/.cursor/mcp.json` β€” the one in your home folder, not a project's `.cursor/`):
63
- ```json
64
- {
65
- "mcpServers": {
66
- "crbro": {
67
- "command": "npx",
68
- "args": ["-y", "crbro-memory"]
69
- }
70
- }
71
- }
72
- ```
73
-
74
- ### 3. Start using it
75
-
76
- Your AI will now have access to 18 memory tools. Start any session with `crbro_boot`.
77
-
78
- ## Tools
79
-
80
- | Tool | Description |
81
- |------|-------------|
82
- | `crbro_boot` | Boot the brain at session start β€” loads hot topics and context |
83
- | `crbro_status` | Brain status β€” neurons, synapses, sessions count |
84
- | `crbro_learn` | Store a fact, decision, pattern, or preference |
85
- | `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
86
- | `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
87
- | `crbro_recall` | Search every stored fact, not just topic names β€” returns the fact that matched |
88
- | `crbro_connect` | Create or strengthen a connection between neurons |
89
- | `crbro_connections` | Get all connections for a neuron |
90
- | `crbro_session_log` | Log a session summary |
91
- | `crbro_sessions` | List recent sessions |
92
- | `crbro_context` | Read/update active working context |
93
- | `crbro_hot_topics` | Get the most active topics by heat score |
94
- | `crbro_global_map` | View the neural network β€” clusters and cross-domain bridges |
95
- | `crbro_revise` | Mark facts as superseded or retracted when they stop being true |
96
- | `crbro_audit` | Find credentials stored in the brain β€” reports the kind, never the value |
97
- | `crbro_forget` | Remove facts for good, keeping a copy in `.quarantine/` first |
98
- | `crbro_maintenance` | Brain maintenance β€” heat, pruning, integrity, index rebuild |
99
- | `crbro_consolidate` | End-of-session consolidation |
100
-
101
- ## Architecture
102
-
103
- ```
104
- ~/.crbro/
105
- β”œβ”€β”€ manifest.json ← Brain metadata
106
- β”œβ”€β”€ cortex/ ← One JSON per neuron (topic)
107
- β”‚ β”œβ”€β”€ project_octochat.json
108
- β”‚ └── tech_firebase.json
109
- β”œβ”€β”€ synapses/ ← One JSON per connection
110
- β”‚ └── syn_octochat__firebase.json
111
- β”œβ”€β”€ hippocampus/ ← One JSON per session
112
- β”‚ └── session_2026-05-06.json
113
- β”œβ”€β”€ prefrontal/ ← Working memory
114
- β”‚ β”œβ”€β”€ active_context.json
115
- β”‚ β”œβ”€β”€ hot_topics.json
116
- β”‚ └── global_map.json
117
- β”œβ”€β”€ archives/ ← Cold neurons (opt-in; nothing is archived unless you ask)
118
- └── .search/ ← Orama search index
119
- └── chunks.index.json ← one document per fact
120
- ```
121
-
122
- ## Heat Score Algorithm
123
-
124
- Each neuron has a heat score (0.0 - 1.0) calculated from:
125
-
126
- - **Frequency (35%)** β€” How often the neuron is accessed
127
- - **Recency (40%)** β€” When it was last accessed (today = 1.0, >3 months = 0.05)
128
- - **Connectivity (25%)** β€” How many synapses connect to it
129
-
130
- ## Knowledge Miner
131
-
132
- 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.
133
-
134
- ```bash
135
- npx crbro-memory mine [dir] # One-shot scan of a directory
136
- npx crbro-memory setup-miner # Install a scheduled auto-scan (OS task scheduler)
137
- npx crbro-memory miner-status # Check the auto-miner status
138
- npx crbro-memory remove-miner # Remove the scheduled task
139
- ```
140
-
141
- > Naming note: "miner" here means *knowledge* mining β€” extracting facts from your own text files. Nothing to do with cryptocurrency.
142
-
143
- ## CLI Commands
144
-
145
- ```bash
146
- npx crbro-memory # Start MCP server (stdio)
147
- npx crbro-memory init # Initialize brain + detect IDEs
148
- npx crbro-memory status # Show brain status
149
- npx crbro-memory reindex # Rebuild the search index
150
- npx crbro-memory eval # Measure retrieval quality against your own query set
151
- npx crbro-memory --help # Help
152
- ```
153
-
154
- ### Measuring retrieval
155
-
156
- `eval` is there so you can tell a fix from a feeling. Write
157
- `~/.crbro/.eval/queries.json` as a list of questions you would actually ask,
158
- each naming the neuron that should answer it:
159
-
160
- ```json
161
- [
162
- { "query": "how we deploy the api",
163
- "expect_neuron": "project_octochat",
164
- "expect_contains": "Cloud Run" }
165
- ]
166
- ```
167
-
168
- Then `npx crbro-memory eval` reports how often the right neuron comes back
169
- first, how often it makes the top three, and MRR β€” plus every miss, so you can
170
- see what it got wrong instead of guessing.
171
-
172
- ## License
173
-
174
- MIT β€” see [LICENSE](LICENSE). Built by [Octonove](https://github.com/Octonove).
1
+ # 🧠 CRBRO β€” Persistent Neural Memory for AI
2
+
3
+ [![npm](https://img.shields.io/npm/v/crbro-memory)](https://www.npmjs.com/package/crbro-memory)
4
+ [![license](https://img.shields.io/github/license/Octonove/crbro-memory)](LICENSE)
5
+ [![MCP](https://img.shields.io/badge/MCP-Claude%20Code%20%C2%B7%20Claude%20Desktop%20%C2%B7%20Cursor-1E3A5F)](https://modelcontextprotocol.io)
6
+
7
+ **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.
8
+
9
+ ![CRBRO demo](docs/demo.gif)
10
+
11
+ Free and open source (MIT). All 22 tools included β€” no license, no account, no tiers.
12
+
13
+ > ⭐ **If CRBRO gives your AI a memory worth keeping, a star on GitHub is the best way to support it.**
14
+
15
+ ## Features
16
+
17
+ - **🧬 Biological Architecture** β€” Knowledge organized as neurons (cortex), connections (synapses), and session memory (hippocampus)
18
+ - **πŸ” Fact-Level Search** β€” Powered by [Orama](https://orama.com/). Every fact is indexed on its own, so a topic with hundreds of facts stays as findable as one with three, and each result comes back with the exact fact that matched and the date it was recorded
19
+ - **πŸ”₯ Heat Scores** β€” Automatic relevance tracking based on frequency, recency, and connectivity
20
+ - **✏️ Correctable** β€” Knowledge can be superseded or retracted, not just piled up. A memory that only appends keeps serving yesterday's answer with today's confidence
21
+ - **πŸ” Credential-aware** β€” API keys, tokens and passwords are replaced with a marker before they touch the disk. The sentence around them survives; the secret does not β€” and `crbro_secret` puts the real value in your operating system's own keychain, so refusing it does not leave you with nowhere to put it
22
+ - **πŸ‘₯ Safe with two editors open** β€” Writes are serialised per neuron, so running CRBRO in two IDEs at once does not silently lose facts
23
+ - **🀝 Shareable per project** β€” Put one project in a team space and it stays in step across everyone's machine. Everything else in your brain never leaves it
24
+ - **πŸ—ΊοΈ Global Map** β€” Cluster detection and cross-domain bridge identification
25
+ - **⛏️ Knowledge Miner** β€” Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
26
+ - **πŸ”’ Fully Local** β€” Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
27
+ - **πŸ’Ύ File-Based** β€” All data stored as readable JSON files in `~/.crbro/` β€” inspectable, diffable, and versionable with git
28
+ - **πŸ”Œ MCP Native** β€” Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client
29
+
30
+ ## Quick Start
31
+
32
+ ### 1. Initialize
33
+
34
+ ```bash
35
+ npx crbro-memory init
36
+ ```
37
+
38
+ ### 2. Add to your MCP config
39
+
40
+ > **Register CRBRO at the user level, not per-project.** Your brain lives in
41
+ > `~/.crbro/` and is shared across every folder β€” but if you register the
42
+ > server inside a single project, other folders won't have the tools and it
43
+ > will *look* like the memory is gone. User-level registration makes it
44
+ > available everywhere, which is the whole point.
45
+
46
+ **Claude Code** (one command, available in every folder):
47
+ ```bash
48
+ claude mcp add --scope user crbro -- npx -y crbro-memory
49
+ ```
50
+
51
+ **Claude Desktop** (`~/AppData/Roaming/Claude/claude_desktop_config.json`):
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "crbro": {
56
+ "command": "npx",
57
+ "args": ["-y", "crbro-memory"]
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ **Cursor** (`~/.cursor/mcp.json` β€” the one in your home folder, not a project's `.cursor/`):
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "crbro": {
68
+ "command": "npx",
69
+ "args": ["-y", "crbro-memory"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### 3. Start using it
76
+
77
+ Your AI will now have access to 22 memory tools. Start any session with `crbro_boot`.
78
+
79
+ ## Tools
80
+
81
+ | Tool | Description |
82
+ |------|-------------|
83
+ | `crbro_boot` | Boot the brain at session start β€” loads hot topics and context |
84
+ | `crbro_status` | Brain status β€” neurons, synapses, sessions count |
85
+ | `crbro_learn` | Store a fact, decision, pattern, or preference |
86
+ | `crbro_neuron` | Read a specific neuron (topic) with all its knowledge |
87
+ | `crbro_neurons` | List neurons with optional filters (domain, type, heat) |
88
+ | `crbro_recall` | Search every stored fact, not just topic names β€” returns the fact that matched |
89
+ | `crbro_connect` | Create or strengthen a connection between neurons |
90
+ | `crbro_connections` | Get all connections for a neuron |
91
+ | `crbro_session_log` | Log a session summary |
92
+ | `crbro_sessions` | List recent sessions |
93
+ | `crbro_context` | Read/update active working context |
94
+ | `crbro_hot_topics` | Get the most active topics by heat score |
95
+ | `crbro_global_map` | View the neural network β€” clusters and cross-domain bridges |
96
+ | `crbro_revise` | Mark facts as superseded or retracted when they stop being true |
97
+ | `crbro_audit` | Find credentials stored in the brain β€” reports the kind, never the value |
98
+ | `crbro_forget` | Remove facts for good, keeping a copy in `.quarantine/` first |
99
+ | `crbro_secret` | Put a credential in the OS keychain and keep only its name in the brain |
100
+ | `crbro_space` | Create or join a team space β€” a private git repo for shared projects |
101
+ | `crbro_share` | Put one project into a space, after showing exactly what would be sent |
102
+ | `crbro_sync` | Exchange notes with teammates now, instead of waiting for the next session |
103
+ | `crbro_maintenance` | Brain maintenance β€” heat, pruning, integrity, index rebuild |
104
+ | `crbro_consolidate` | End-of-session consolidation |
105
+
106
+ ## Credentials
107
+
108
+ A memory should not hold your passwords, and CRBRO refuses to: anything shaped
109
+ like a credential is replaced with a marker before it reaches the disk. But
110
+ refusing on its own is not much help β€” the password still exists, and it ends
111
+ up back in a config file in plain text.
112
+
113
+ So `crbro_secret` gives it somewhere to go: the credential store your machine
114
+ already ships with.
115
+
116
+ | Platform | Where the value actually lives |
117
+ |----------|--------------------------------|
118
+ | macOS | Keychain, via `security` |
119
+ | Linux | Secret Service, via `secret-tool` |
120
+ | Windows | Sealed with DPAPI to your Windows account |
121
+
122
+ On a machine with no credential store β€” a headless server, a CI runner, a
123
+ locked keychain over SSH β€” `crbro_secret` says so in plain words instead of
124
+ failing. Environment variables keep working, and the rest of CRBRO is
125
+ unaffected.
126
+
127
+ CRBRO keeps no copy and writes no crypto of its own. The store sits **outside
128
+ the brain**, so no sync, no team space and no `crbro_share` can reach it. What
129
+ goes in the brain is the *name*:
130
+
131
+ > "The WordPress password for example.com is in `WP_EXAMPLE_APP_PASSWORD`."
132
+
133
+ Which is all an assistant needs to find it again next week, and useless to
134
+ anyone who reads your memory files.
135
+
136
+ An environment variable of the same name always wins, so CI and one-off
137
+ overrides work without touching the keychain. On a headless box with no
138
+ credential store, `crbro_secret` says so plainly instead of failing β€” the
139
+ environment variables still work, and the rest of CRBRO is unaffected.
140
+
141
+ ## Team memory
142
+
143
+ Two people working on the same thing shouldn't have to tell their assistants
144
+ the same things twice. A **space** is one or more projects shared with
145
+ teammates, carried by a private git repository you own β€” no server, no account,
146
+ nothing to pay for.
147
+
148
+ ```bash
149
+ # One person, once:
150
+ crbro_space action: create name: "team" remote: git@github.com:acme/team-memory.git author: "ana"
151
+ crbro_share neuron: "project_x" space: "team"
152
+
153
+ # Everyone else, once:
154
+ crbro_space action: join name: "team" remote: git@github.com:acme/team-memory.git author: "bruno"
155
+ ```
156
+
157
+ After that it is invisible: notes are exchanged at the start and end of every
158
+ session. What each person learns about that project, the others' assistants
159
+ know next time they sit down.
160
+
161
+ **How it stays out of your way**
162
+
163
+ - Nobody ever writes to anybody else's file. Each person appends to their own
164
+ log and every machine rebuilds the project from all of them, so there is no
165
+ conflict to resolve β€” not now, not after a week apart.
166
+ - If someone marks a fact as no longer true, that wins. Retracted knowledge
167
+ cannot come back to life because a stale copy still called it current.
168
+ - No connection is a normal answer, not an error. Your memory works offline and
169
+ whatever you saved goes out on the next sync.
170
+
171
+ **What never leaves your machine**
172
+
173
+ - Every project you did not explicitly share.
174
+ - Preferences β€” not shareable at all, at any setting. They are the field most
175
+ likely to hold a key.
176
+ - Credentials. `crbro_share` refuses outright if it finds one, and tells you
177
+ where. It will not redact it and send the rest.
178
+
179
+ > **Sharing cannot be undone.** Once a teammate has pulled a project it is on
180
+ > their disk. Removing their repository access stops anything new from reaching
181
+ > them; it does not take back what they already have. That is true of any
182
+ > sync system β€” worth knowing before you share, not after.
183
+
184
+ ## Architecture
185
+
186
+ ```
187
+ ~/.crbro/
188
+ β”œβ”€β”€ manifest.json ← Brain metadata
189
+ β”œβ”€β”€ cortex/ ← One JSON per neuron (topic)
190
+ β”‚ β”œβ”€β”€ project_octochat.json
191
+ β”‚ └── tech_firebase.json
192
+ β”œβ”€β”€ synapses/ ← One JSON per connection
193
+ β”‚ └── syn_octochat__firebase.json
194
+ β”œβ”€β”€ hippocampus/ ← One JSON per session
195
+ β”‚ └── session_2026-05-06.json
196
+ β”œβ”€β”€ prefrontal/ ← Working memory
197
+ β”‚ β”œβ”€β”€ active_context.json
198
+ β”‚ β”œβ”€β”€ hot_topics.json
199
+ β”‚ └── global_map.json
200
+ β”œβ”€β”€ archives/ ← Cold neurons (opt-in; nothing is archived unless you ask)
201
+ β”œβ”€β”€ shared/ ← One git repo per team space. Notes only, never the cortex
202
+ β”‚ └── team/
203
+ β”‚ └── neurons/project_x/ops/ana.a1b2c3.jsonl
204
+ └── .search/ ← Orama search index
205
+ └── chunks.index.json ← one document per fact
206
+ ```
207
+
208
+ ## Heat Score Algorithm
209
+
210
+ Each neuron has a heat score (0.0 - 1.0) calculated from:
211
+
212
+ - **Frequency (35%)** β€” How often the neuron is accessed
213
+ - **Recency (40%)** β€” When it was last accessed (today = 1.0, >3 months = 0.05)
214
+ - **Connectivity (25%)** β€” How many synapses connect to it
215
+
216
+ ## Knowledge Miner
217
+
218
+ 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.
219
+
220
+ ```bash
221
+ npx crbro-memory mine [dir] # One-shot scan of a directory
222
+ npx crbro-memory setup-miner # Install a scheduled auto-scan (OS task scheduler)
223
+ npx crbro-memory miner-status # Check the auto-miner status
224
+ npx crbro-memory remove-miner # Remove the scheduled task
225
+ ```
226
+
227
+ > Naming note: "miner" here means *knowledge* mining β€” extracting facts from your own text files. Nothing to do with cryptocurrency.
228
+
229
+ ## CLI Commands
230
+
231
+ ```bash
232
+ npx crbro-memory # Start MCP server (stdio)
233
+ npx crbro-memory init # Initialize brain + detect IDEs
234
+ npx crbro-memory status # Show brain status
235
+ npx crbro-memory reindex # Rebuild the search index
236
+ npx crbro-memory eval # Measure retrieval quality against your own query set
237
+ npx crbro-memory --help # Help
238
+ ```
239
+
240
+ ### Measuring retrieval
241
+
242
+ `eval` is there so you can tell a fix from a feeling. Write
243
+ `~/.crbro/.eval/queries.json` as a list of questions you would actually ask,
244
+ each naming the neuron that should answer it:
245
+
246
+ ```json
247
+ [
248
+ { "query": "how we deploy the api",
249
+ "expect_neuron": "project_octochat",
250
+ "expect_contains": "Cloud Run" }
251
+ ]
252
+ ```
253
+
254
+ Then `npx crbro-memory eval` reports how often the right neuron comes back
255
+ first, how often it makes the top three, and MRR β€” plus every miss, so you can
256
+ see what it got wrong instead of guessing.
257
+
258
+ ## License
259
+
260
+ MIT β€” see [LICENSE](LICENSE). Built by [Octonove](https://github.com/Octonove).
@@ -8,6 +8,8 @@ export declare class BrainPaths {
8
8
  readonly archives: string;
9
9
  /** Copies kept before anything is removed. Nothing is deleted outright. */
10
10
  readonly quarantine: string;
11
+ /** One directory per shared space. Each one is a git repository. */
12
+ readonly shared: string;
11
13
  readonly search: string;
12
14
  readonly prompts: string;
13
15
  constructor(rootDir?: string);
@@ -1 +1 @@
1
- {"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/engine/brain.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAoC,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAQnH,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,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,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OA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C5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,CAAC,EAAE,MAAM;IAa5B,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,8DAA8D;IAC9D,WAAW,IAAI,MAAM;IAIrB,kFAAkF;IAClF,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;IAoDrC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAgEjC;;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"}
@@ -22,6 +22,8 @@ class BrainPaths {
22
22
  archives;
23
23
  /** Copies kept before anything is removed. Nothing is deleted outright. */
24
24
  quarantine;
25
+ /** One directory per shared space. Each one is a git repository. */
26
+ shared;
25
27
  search;
26
28
  prompts;
27
29
  constructor(rootDir) {
@@ -32,6 +34,7 @@ class BrainPaths {
32
34
  this.prefrontal = node_path_1.default.join(this.root, 'prefrontal');
33
35
  this.archives = node_path_1.default.join(this.root, 'archives');
34
36
  this.quarantine = node_path_1.default.join(this.root, '.quarantine');
37
+ this.shared = node_path_1.default.join(this.root, 'shared');
35
38
  this.search = node_path_1.default.join(this.root, '.search');
36
39
  this.prompts = node_path_1.default.join(this.root, 'prompts');
37
40
  }
@@ -86,6 +89,7 @@ class Brain {
86
89
  this.paths.prefrontal,
87
90
  this.paths.archives,
88
91
  this.paths.quarantine,
92
+ this.paths.shared,
89
93
  this.paths.search,
90
94
  this.paths.prompts,
91
95
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"brain.js","sourceRoot":"","sources":["../../src/engine/brain.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,gEAAgE;;;;;;AAEhE,0DAA6B;AAC7B,qCAAyC;AACzC,0CAAsE;AAGtE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,mBAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC7H,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B,oEAAoE;AAEpE,MAAa,UAAU;IACZ,IAAI,CAAS;IACb,MAAM,CAAS;IACf,QAAQ,CAAS;IACjB,WAAW,CAAS;IACpB,UAAU,CAAS;IACnB,QAAQ,CAAS;IAC1B,2EAA2E;IAClE,UAAU,CAAS;IACnB,MAAM,CAAS;IACf,OAAO,CAAS;IAEzB,YAAY,OAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,SAAS,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,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ACnB,CAAC;CACF;AA5MD,sBA4MC"}
@@ -1,6 +1,34 @@
1
1
  import type { Brain } from './brain.js';
2
2
  import type { Neuron, NeuronType, FactStatus } from '../types/index.js';
3
3
  export type Indexer = (neuron: Neuron) => Promise<void> | void;
4
+ /**
5
+ * Called after a write so shared neurons can append a note to the team log.
6
+ * A hook rather than a direct call, because the sync layer needs the Cortex
7
+ * and the Cortex would then need the sync layer.
8
+ */
9
+ export type Emitter = (neuronId: string, change: {
10
+ kind: 'fact';
11
+ text: string;
12
+ fid: string;
13
+ conf: number;
14
+ at: string;
15
+ src?: string;
16
+ } | {
17
+ kind: 'status';
18
+ fid: string;
19
+ to: 'superseded' | 'retracted';
20
+ at: string;
21
+ why?: string;
22
+ } | {
23
+ kind: 'decision';
24
+ text: string;
25
+ why?: string;
26
+ at: string;
27
+ } | {
28
+ kind: 'pattern';
29
+ text: string;
30
+ at: string;
31
+ }) => Promise<void> | void;
4
32
  export declare class Cortex {
5
33
  private brain;
6
34
  /**
@@ -10,6 +38,7 @@ export declare class Cortex {
10
38
  * 91% of the brain never reached the index.
11
39
  */
12
40
  private indexer;
41
+ private emitter;
13
42
  /** What this session has actually written, for an honest consolidate(). */
14
43
  private tally;
15
44
  constructor(brain: Brain);
@@ -21,6 +50,14 @@ export declare class Cortex {
21
50
  };
22
51
  resetSessionTally(): void;
23
52
  setIndexer(indexer: Indexer | null): void;
53
+ setEmitter(emitter: Emitter | null): void;
54
+ private emit;
55
+ /**
56
+ * Overwrite a neuron with the result of merging the team's notes.
57
+ * Only the sync layer calls this, and only with a neuron that already
58
+ * contains everything local plus whatever arrived.
59
+ */
60
+ replaceFromSync(neuron: Neuron): Promise<Neuron>;
24
61
  private reindex;
25
62
  /**
26
63
  * Get a neuron by ID.
@@ -1 +1 @@
1
- {"version":3,"file":"cortex.d.ts","sourceRoot":"","sources":["../../src/engine/cortex.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC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