crbro-memory 1.0.1 β 1.2.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 +121 -122
- package/bin/crbro.js +280 -41
- package/dist/engine/license.d.ts +32 -7
- package/dist/engine/license.d.ts.map +1 -1
- package/dist/engine/license.js +243 -50
- package/dist/engine/license.js.map +1 -1
- package/dist/miner/extractor.d.ts +12 -0
- package/dist/miner/extractor.d.ts.map +1 -0
- package/dist/miner/extractor.js +167 -0
- package/dist/miner/extractor.js.map +1 -0
- package/dist/miner/index.d.ts +60 -0
- package/dist/miner/index.d.ts.map +1 -0
- package/dist/miner/index.js +285 -0
- package/dist/miner/index.js.map +1 -0
- package/dist/miner/scheduler.d.ts +30 -0
- package/dist/miner/scheduler.d.ts.map +1 -0
- package/dist/miner/scheduler.js +293 -0
- package/dist/miner/scheduler.js.map +1 -0
- package/dist/miner/types.d.ts +11 -0
- package/dist/miner/types.d.ts.map +1 -0
- package/dist/miner/types.js +4 -0
- package/dist/miner/types.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +17 -8
- package/dist/server.js.map +1 -1
- package/package.json +52 -52
package/README.md
CHANGED
|
@@ -1,122 +1,121 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| `
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
βββ
|
|
87
|
-
βββ
|
|
88
|
-
β
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
βββ
|
|
95
|
-
β βββ
|
|
96
|
-
β
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
βββ .
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- **
|
|
108
|
-
- **
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
npx crbro-memory
|
|
115
|
-
npx crbro-memory
|
|
116
|
-
npx crbro-memory
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
MIT β Part of [Synthetica Decks](https://synthetica-decks.web.app) by 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
|
+
|
|
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.
|
package/bin/crbro.js
CHANGED
|
@@ -2,98 +2,337 @@
|
|
|
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,
|
|
6
|
+
// remove-miner, and MCP server mode (default)
|
|
7
|
+
|
|
8
|
+
import { platform, homedir } from 'os';
|
|
9
|
+
import { join } from 'path';
|
|
10
|
+
import { existsSync } from 'fs';
|
|
5
11
|
|
|
6
12
|
const args = process.argv.slice(2);
|
|
7
13
|
const command = args[0];
|
|
8
14
|
|
|
15
|
+
// βββ IDE Detection ββββββββββββββββββββββββββββββββββββββββββββββ
|
|
16
|
+
const IDE_CONFIGS = [
|
|
17
|
+
{
|
|
18
|
+
name: 'Antigravity (Google Gemini)',
|
|
19
|
+
id: 'antigravity',
|
|
20
|
+
configPath: () => join(homedir(), '.gemini', 'antigravity', 'mcp_config.json'),
|
|
21
|
+
configFormat: 'mcpServers',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Cursor',
|
|
25
|
+
id: 'cursor',
|
|
26
|
+
configPath: () => join(homedir(), '.cursor', 'mcp.json'),
|
|
27
|
+
configFormat: 'mcpServers',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Windsurf',
|
|
31
|
+
id: 'windsurf',
|
|
32
|
+
configPath: () => join(homedir(), '.windsurf', 'mcp.json'),
|
|
33
|
+
configFormat: 'mcpServers',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Claude Desktop',
|
|
37
|
+
id: 'claude-desktop',
|
|
38
|
+
configPath: () => {
|
|
39
|
+
if (platform() === 'win32') {
|
|
40
|
+
return join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json');
|
|
41
|
+
}
|
|
42
|
+
return join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
43
|
+
},
|
|
44
|
+
configFormat: 'mcpServers',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Claude Code (user scope)',
|
|
48
|
+
id: 'claude-code',
|
|
49
|
+
configPath: () => join(homedir(), '.claude.json'),
|
|
50
|
+
configFormat: 'mcpServers',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'VS Code + Continue',
|
|
54
|
+
id: 'continue',
|
|
55
|
+
configPath: () => join(homedir(), '.continue', 'config.json'),
|
|
56
|
+
configFormat: 'mcpServers',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'ChatGPT Desktop',
|
|
60
|
+
id: 'chatgpt',
|
|
61
|
+
configPath: () => {
|
|
62
|
+
if (platform() === 'win32') {
|
|
63
|
+
return join(process.env.APPDATA || '', 'ChatGPT', 'mcp_config.json');
|
|
64
|
+
}
|
|
65
|
+
return join(homedir(), 'Library', 'Application Support', 'ChatGPT', 'mcp_config.json');
|
|
66
|
+
},
|
|
67
|
+
configFormat: 'mcpServers',
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
function detectIDEs() {
|
|
72
|
+
const detected = [];
|
|
73
|
+
for (const ide of IDE_CONFIGS) {
|
|
74
|
+
try {
|
|
75
|
+
const configPath = ide.configPath();
|
|
76
|
+
if (existsSync(configPath)) {
|
|
77
|
+
detected.push({ ...ide, configPath: configPath, exists: true });
|
|
78
|
+
} else {
|
|
79
|
+
// Check if the parent directory exists (IDE installed but no config yet)
|
|
80
|
+
const parentDir = configPath.split(/[/\\]/).slice(0, -1).join(platform() === 'win32' ? '\\' : '/');
|
|
81
|
+
if (existsSync(parentDir)) {
|
|
82
|
+
detected.push({ ...ide, configPath: configPath, exists: false });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} catch { /* skip */ }
|
|
86
|
+
}
|
|
87
|
+
return detected;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function generateMCPSnippet(envVars) {
|
|
91
|
+
return JSON.stringify({
|
|
92
|
+
"crbro": {
|
|
93
|
+
"command": "npx",
|
|
94
|
+
"args": ["-y", "crbro-memory"],
|
|
95
|
+
...(envVars ? { "env": envVars } : {})
|
|
96
|
+
}
|
|
97
|
+
}, null, 2);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// βββ Commands βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
101
|
+
|
|
9
102
|
if (command === 'init') {
|
|
10
|
-
// Initialize brain
|
|
103
|
+
// βββ Initialize brain + IDE detection ββββββββββββββββββββββββββ
|
|
11
104
|
import('../dist/engine/brain.js').then(async ({ Brain }) => {
|
|
12
105
|
const brain = new Brain();
|
|
13
106
|
const manifest = await brain.initialize();
|
|
14
|
-
|
|
15
|
-
console.log(` Path: ${manifest.brain_path}`);
|
|
107
|
+
|
|
16
108
|
console.log('');
|
|
17
|
-
console.log('
|
|
109
|
+
console.log(' π§ CRBRO brain initialized!');
|
|
110
|
+
console.log(` Path: ${manifest.brain_path}`);
|
|
18
111
|
console.log('');
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
112
|
+
|
|
113
|
+
// Detect IDEs
|
|
114
|
+
const ides = detectIDEs();
|
|
115
|
+
|
|
116
|
+
if (ides.length > 0) {
|
|
117
|
+
console.log(' π‘ Detected IDEs:');
|
|
118
|
+
console.log('');
|
|
119
|
+
for (const ide of ides) {
|
|
120
|
+
const status = ide.exists ? 'β
config exists' : 'π needs config';
|
|
121
|
+
console.log(` ${ide.name}: ${status}`);
|
|
122
|
+
console.log(` β ${ide.configPath}`);
|
|
25
123
|
}
|
|
26
|
-
|
|
124
|
+
console.log('');
|
|
125
|
+
console.log(' Add this to your MCP config (inside "mcpServers"):');
|
|
126
|
+
} else {
|
|
127
|
+
console.log(' β οΈ No IDE detected. Add this to your MCP config manually:');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
console.log('');
|
|
131
|
+
console.log(' ' + generateMCPSnippet().split('\n').join('\n '));
|
|
132
|
+
console.log('');
|
|
133
|
+
console.log(' Next steps:');
|
|
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!');
|
|
138
|
+
console.log('');
|
|
27
139
|
}).catch(console.error);
|
|
28
140
|
|
|
29
141
|
} else if (command === 'status') {
|
|
30
|
-
// Show brain status
|
|
142
|
+
// βββ Show brain status βββββββββββββββββββββββββββββββββββββββββ
|
|
31
143
|
import('../dist/engine/brain.js').then(async ({ Brain }) => {
|
|
32
144
|
const brain = new Brain();
|
|
33
145
|
try {
|
|
34
146
|
const manifest = await brain.getManifest();
|
|
35
|
-
console.log('
|
|
36
|
-
console.log(
|
|
37
|
-
console.log(
|
|
38
|
-
console.log(`
|
|
39
|
-
console.log(`
|
|
40
|
-
console.log(`
|
|
41
|
-
console.log(`
|
|
147
|
+
console.log('');
|
|
148
|
+
console.log(' π§ CRBRO Brain Status');
|
|
149
|
+
console.log(' βββββββββββββββββββββ');
|
|
150
|
+
console.log(` Version: ${manifest.version}`);
|
|
151
|
+
console.log(` Path: ${manifest.brain_path}`);
|
|
152
|
+
console.log(` Neurons: ${manifest.total_neurons}`);
|
|
153
|
+
console.log(` Synapses: ${manifest.total_synapses}`);
|
|
154
|
+
console.log(` Sessions: ${manifest.total_sessions}`);
|
|
155
|
+
console.log(` Last Boot: ${manifest.last_boot || 'never'}`);
|
|
156
|
+
console.log(` Last Consolidate: ${manifest.last_consolidation || 'never'}`);
|
|
157
|
+
console.log(` License: ${manifest.license_key ? 'β
Active' : 'β Not activated'}`);
|
|
158
|
+
console.log('');
|
|
159
|
+
|
|
160
|
+
// Show detected IDEs
|
|
161
|
+
const ides = detectIDEs();
|
|
162
|
+
if (ides.length > 0) {
|
|
163
|
+
console.log(' π‘ Connected IDEs:');
|
|
164
|
+
for (const ide of ides) {
|
|
165
|
+
console.log(` ${ide.exists ? 'β
' : 'β οΈ '} ${ide.name}`);
|
|
166
|
+
}
|
|
167
|
+
console.log('');
|
|
168
|
+
}
|
|
42
169
|
} catch {
|
|
43
|
-
console.log('
|
|
170
|
+
console.log('');
|
|
171
|
+
console.log(' π§ CRBRO brain not initialized.');
|
|
172
|
+
console.log(' Run: npx crbro-memory init');
|
|
173
|
+
console.log('');
|
|
44
174
|
}
|
|
45
175
|
}).catch(console.error);
|
|
46
176
|
|
|
47
177
|
} else if (command === 'activate') {
|
|
48
|
-
// Activate license key
|
|
178
|
+
// βββ Activate license key ββββββββββββββββββββββββββββββββββββββ
|
|
49
179
|
const key = args[1];
|
|
50
180
|
if (!key) {
|
|
51
|
-
console.log('β Usage: npx crbro-memory activate SYNTH-ZERO-XXXX-XXXX-XXXX');
|
|
52
181
|
console.log('');
|
|
53
|
-
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('');
|
|
54
186
|
process.exit(1);
|
|
55
187
|
}
|
|
56
188
|
|
|
57
189
|
import('../dist/engine/brain.js').then(async ({ Brain }) => {
|
|
58
190
|
const brain = new Brain();
|
|
59
191
|
try {
|
|
60
|
-
await brain.getManifest();
|
|
192
|
+
await brain.getManifest();
|
|
61
193
|
} catch {
|
|
62
|
-
console.log('π§ Brain not initialized. Initializing now...');
|
|
194
|
+
console.log(' π§ Brain not initialized. Initializing now...');
|
|
63
195
|
await brain.initialize();
|
|
64
196
|
}
|
|
65
197
|
|
|
66
198
|
// Validate key format
|
|
67
199
|
if (!key.startsWith('SYNTH-ZERO-') || key.length < 20) {
|
|
68
|
-
console.log('β Invalid license key format.');
|
|
69
|
-
console.log('
|
|
200
|
+
console.log(' β Invalid license key format.');
|
|
201
|
+
console.log(' Keys start with SYNTH-ZERO- and are at least 20 characters.');
|
|
70
202
|
process.exit(1);
|
|
71
203
|
}
|
|
72
204
|
|
|
73
205
|
// Persist key in manifest
|
|
74
206
|
await brain.updateManifest({ license_key: key });
|
|
75
|
-
console.log('β
License key activated!');
|
|
76
207
|
console.log('');
|
|
77
|
-
console.log('
|
|
78
|
-
console.log('
|
|
79
|
-
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);
|
|
217
|
+
|
|
218
|
+
} else if (command === 'mine') {
|
|
219
|
+
// βββ One-shot mining βββββββββββββββββββββββββββββββββββββββββββ
|
|
220
|
+
const targetDir = args[1];
|
|
221
|
+
|
|
222
|
+
import('../dist/miner/index.js').then(async ({ Miner }) => {
|
|
223
|
+
console.log('');
|
|
224
|
+
console.log(' βοΈ CRBRO Miner β Scanning for knowledge...');
|
|
225
|
+
console.log('');
|
|
226
|
+
|
|
227
|
+
const miner = new Miner();
|
|
228
|
+
const result = await miner.mine(targetDir);
|
|
229
|
+
|
|
230
|
+
console.log(' ββββββββββββββββββββββββββββββββ');
|
|
231
|
+
console.log(` Files scanned: ${result.scanned}`);
|
|
232
|
+
console.log(` New files mined: ${result.new_files}`);
|
|
233
|
+
console.log(` Neurons created: ${result.neurons_created}`);
|
|
234
|
+
console.log(` Neurons updated: ${result.neurons_updated}`);
|
|
235
|
+
console.log(` Facts added: ${result.facts_added}`);
|
|
236
|
+
console.log(` Decisions found: ${result.decisions_added}`);
|
|
237
|
+
|
|
238
|
+
if (result.technologies_found.length > 0) {
|
|
239
|
+
console.log(` Technologies: ${result.technologies_found.slice(0, 10).join(', ')}`);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (result.errors.length > 0) {
|
|
243
|
+
console.log('');
|
|
244
|
+
console.log(' β οΈ Errors:');
|
|
245
|
+
for (const err of result.errors.slice(0, 5)) {
|
|
246
|
+
console.log(` ${err}`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
console.log('');
|
|
251
|
+
}).catch(console.error);
|
|
252
|
+
|
|
253
|
+
} else if (command === 'setup-miner') {
|
|
254
|
+
// βββ Setup automatic mining ββββββββββββββββββββββββββββββββββββ
|
|
255
|
+
import('../dist/miner/scheduler.js').then(async ({ setupScheduler }) => {
|
|
256
|
+
console.log('');
|
|
257
|
+
console.log(' β° Setting up CRBRO Auto-Miner...');
|
|
258
|
+
console.log('');
|
|
259
|
+
|
|
260
|
+
const result = await setupScheduler();
|
|
261
|
+
console.log(result.message);
|
|
262
|
+
console.log('');
|
|
263
|
+
}).catch(console.error);
|
|
264
|
+
|
|
265
|
+
} else if (command === 'miner-status') {
|
|
266
|
+
// βββ Check miner status ββββββββββββββββββββββββββββββββββββββββ
|
|
267
|
+
Promise.all([
|
|
268
|
+
import('../dist/miner/scheduler.js'),
|
|
269
|
+
import('../dist/miner/index.js'),
|
|
270
|
+
]).then(async ([{ getSchedulerStatus }, { Miner }]) => {
|
|
271
|
+
console.log('');
|
|
272
|
+
console.log(' βοΈ CRBRO Miner Status');
|
|
273
|
+
console.log(' βββββββββββββββββββββ');
|
|
274
|
+
|
|
275
|
+
// Scheduler status
|
|
276
|
+
const schedStatus = await getSchedulerStatus();
|
|
277
|
+
console.log(` Scheduler: ${schedStatus.installed ? 'β
Installed' : 'β Not installed'}`);
|
|
278
|
+
console.log(` Platform: ${schedStatus.platform}`);
|
|
279
|
+
if (schedStatus.details) {
|
|
280
|
+
console.log(` Details: ${schedStatus.details}`);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Miner state
|
|
284
|
+
const miner = new Miner();
|
|
285
|
+
const status = await miner.getStatus();
|
|
286
|
+
console.log('');
|
|
287
|
+
console.log(` Last run: ${status.state.last_run || 'never'}`);
|
|
288
|
+
console.log(` Total mined: ${status.state.total_mined} files`);
|
|
289
|
+
console.log(` Tracked: ${Object.keys(status.state.mined_files).length} files`);
|
|
290
|
+
console.log('');
|
|
291
|
+
|
|
292
|
+
if (status.detected_dirs.length > 0) {
|
|
293
|
+
console.log(' π Scan directories:');
|
|
294
|
+
for (const dir of status.detected_dirs) {
|
|
295
|
+
console.log(` ${dir}`);
|
|
296
|
+
}
|
|
297
|
+
} else {
|
|
298
|
+
console.log(' β οΈ No IDE directories detected.');
|
|
299
|
+
}
|
|
300
|
+
console.log('');
|
|
301
|
+
}).catch(console.error);
|
|
302
|
+
|
|
303
|
+
} else if (command === 'remove-miner') {
|
|
304
|
+
// βββ Remove automatic mining βββββββββββββββββββββββββββββββββββ
|
|
305
|
+
import('../dist/miner/scheduler.js').then(async ({ removeScheduler }) => {
|
|
306
|
+
const result = await removeScheduler();
|
|
307
|
+
console.log('');
|
|
308
|
+
console.log(result.success ? ` β
${result.message}` : ` β ${result.message}`);
|
|
80
309
|
console.log('');
|
|
81
|
-
console.log(' Restart your IDE to apply changes.');
|
|
82
310
|
}).catch(console.error);
|
|
83
311
|
|
|
84
312
|
} else if (command === '--help' || command === '-h') {
|
|
85
|
-
|
|
313
|
+
// βββ Help ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
314
|
+
console.log('');
|
|
315
|
+
console.log(' π§ CRBRO β Persistent Neural Memory for AI');
|
|
316
|
+
console.log(' βββββββββββββββββββββββββββββββββββββββββββ');
|
|
317
|
+
console.log('');
|
|
318
|
+
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');
|
|
321
|
+
console.log(' npx crbro-memory status Show brain status');
|
|
322
|
+
console.log('');
|
|
323
|
+
console.log(' Auto-Mining:');
|
|
324
|
+
console.log(' npx crbro-memory mine [dir] One-shot mining of artifacts');
|
|
325
|
+
console.log(' npx crbro-memory setup-miner Install scheduled auto-miner');
|
|
326
|
+
console.log(' npx crbro-memory miner-status Check auto-miner status');
|
|
327
|
+
console.log(' npx crbro-memory remove-miner Remove auto-miner');
|
|
328
|
+
console.log('');
|
|
329
|
+
console.log(' Server:');
|
|
330
|
+
console.log(' npx crbro-memory Start MCP server (stdio)');
|
|
86
331
|
console.log('');
|
|
87
|
-
console.log('
|
|
88
|
-
console.log(' npx crbro-memory Start MCP server (stdio)');
|
|
89
|
-
console.log(' npx crbro-memory init Initialize brain directory');
|
|
90
|
-
console.log(' npx crbro-memory status Show brain status');
|
|
91
|
-
console.log(' npx crbro-memory activate KEY Activate premium license');
|
|
92
|
-
console.log(' npx crbro-memory --help Show this help');
|
|
332
|
+
console.log(' Part of Synthetica Decks β https://synthetica-decks.web.app');
|
|
93
333
|
console.log('');
|
|
94
|
-
console.log('Part of Synthetica Decks β https://synthetica-decks.web.app');
|
|
95
334
|
|
|
96
335
|
} else {
|
|
97
|
-
// Default: start MCP server
|
|
336
|
+
// βββ Default: start MCP server βββββββββββββββββββββββββββββββββ
|
|
98
337
|
import('../dist/index.js').catch(console.error);
|
|
99
338
|
}
|