crbro-memory 1.0.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 +122 -0
- package/bin/crbro.js +99 -0
- package/dist/engine/brain.d.ts +43 -0
- package/dist/engine/brain.d.ts.map +1 -0
- package/dist/engine/brain.js +179 -0
- package/dist/engine/brain.js.map +1 -0
- package/dist/engine/cortex.d.ts +70 -0
- package/dist/engine/cortex.d.ts.map +1 -0
- package/dist/engine/cortex.js +219 -0
- package/dist/engine/cortex.js.map +1 -0
- package/dist/engine/heat.d.ts +28 -0
- package/dist/engine/heat.d.ts.map +1 -0
- package/dist/engine/heat.js +112 -0
- package/dist/engine/heat.js.map +1 -0
- package/dist/engine/hippocampus.d.ts +26 -0
- package/dist/engine/hippocampus.d.ts.map +1 -0
- package/dist/engine/hippocampus.js +73 -0
- package/dist/engine/hippocampus.js.map +1 -0
- package/dist/engine/license.d.ts +29 -0
- package/dist/engine/license.d.ts.map +1 -0
- package/dist/engine/license.js +109 -0
- package/dist/engine/license.js.map +1 -0
- package/dist/engine/maintenance.d.ts +41 -0
- package/dist/engine/maintenance.d.ts.map +1 -0
- package/dist/engine/maintenance.js +156 -0
- package/dist/engine/maintenance.js.map +1 -0
- package/dist/engine/prefrontal.d.ts +31 -0
- package/dist/engine/prefrontal.d.ts.map +1 -0
- package/dist/engine/prefrontal.js +149 -0
- package/dist/engine/prefrontal.js.map +1 -0
- package/dist/engine/synapses.d.ts +39 -0
- package/dist/engine/synapses.d.ts.map +1 -0
- package/dist/engine/synapses.js +154 -0
- package/dist/engine/synapses.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/search/index.d.ts +31 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +139 -0
- package/dist/search/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +543 -0
- package/dist/server.js.map +1 -0
- package/dist/types/index.d.ts +121 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/fs.d.ts +35 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +110 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/ids.d.ts +32 -0
- package/dist/utils/ids.d.ts.map +1 -0
- package/dist/utils/ids.js +92 -0
- package/dist/utils/ids.js.map +1 -0
- package/package.json +52 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── CRBRO MCP Server ────────────────────────────────────────────
|
|
3
|
+
// Main server with all 15 tools registered
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createServer = createServer;
|
|
6
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const brain_js_1 = require("./engine/brain.js");
|
|
9
|
+
const cortex_js_1 = require("./engine/cortex.js");
|
|
10
|
+
const synapses_js_1 = require("./engine/synapses.js");
|
|
11
|
+
const heat_js_1 = require("./engine/heat.js");
|
|
12
|
+
const hippocampus_js_1 = require("./engine/hippocampus.js");
|
|
13
|
+
const prefrontal_js_1 = require("./engine/prefrontal.js");
|
|
14
|
+
const index_js_1 = require("./search/index.js");
|
|
15
|
+
const maintenance_js_1 = require("./engine/maintenance.js");
|
|
16
|
+
const license_js_1 = require("./engine/license.js");
|
|
17
|
+
function createServer() {
|
|
18
|
+
const server = new mcp_js_1.McpServer({
|
|
19
|
+
name: 'crbro-memory',
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
});
|
|
22
|
+
// ─── Initialize engines ──────────────────────────────────────
|
|
23
|
+
const brain = new brain_js_1.Brain();
|
|
24
|
+
const cortex = new cortex_js_1.Cortex(brain);
|
|
25
|
+
const synapses = new synapses_js_1.Synapses(brain);
|
|
26
|
+
const heatEngine = new heat_js_1.HeatEngine(brain);
|
|
27
|
+
const hippocampus = new hippocampus_js_1.Hippocampus(brain);
|
|
28
|
+
const prefrontal = new prefrontal_js_1.Prefrontal(brain);
|
|
29
|
+
const searchEngine = new index_js_1.SearchEngine(brain);
|
|
30
|
+
const maintenance = new maintenance_js_1.Maintenance(brain, cortex, synapses, heatEngine, hippocampus, prefrontal, searchEngine);
|
|
31
|
+
const license = new license_js_1.LicenseEngine(brain);
|
|
32
|
+
// ═══════════════════════════════════════════════════════════════
|
|
33
|
+
// TOOL 1: crbro_boot — Boot sequence
|
|
34
|
+
// ═══════════════════════════════════════════════════════════════
|
|
35
|
+
server.tool('crbro_boot', 'Boot the CRBRO brain. Run this at the start of every session. Initializes the brain on first use, loads hot topics and active context on subsequent uses.', {}, async () => {
|
|
36
|
+
try {
|
|
37
|
+
const result = await brain.boot();
|
|
38
|
+
// Initialize search engine
|
|
39
|
+
await searchEngine.init();
|
|
40
|
+
return {
|
|
41
|
+
content: [{
|
|
42
|
+
type: 'text',
|
|
43
|
+
text: JSON.stringify(result, null, 2),
|
|
44
|
+
}],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
return {
|
|
49
|
+
content: [{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: `CRBRO boot error: ${err instanceof Error ? err.message : String(err)}`,
|
|
52
|
+
}],
|
|
53
|
+
isError: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
// ═══════════════════════════════════════════════════════════════
|
|
58
|
+
// TOOL 2: crbro_status — Brain status
|
|
59
|
+
// ═══════════════════════════════════════════════════════════════
|
|
60
|
+
server.tool('crbro_status', 'Get the current status of the CRBRO brain — total neurons, synapses, sessions, and brain path.', {}, async () => {
|
|
61
|
+
try {
|
|
62
|
+
const manifest = await brain.getManifest();
|
|
63
|
+
const licenseInfo = await license.getLicenseInfo();
|
|
64
|
+
return {
|
|
65
|
+
content: [{
|
|
66
|
+
type: 'text',
|
|
67
|
+
text: JSON.stringify({
|
|
68
|
+
version: manifest.version,
|
|
69
|
+
total_neurons: manifest.total_neurons,
|
|
70
|
+
total_synapses: manifest.total_synapses,
|
|
71
|
+
total_sessions: manifest.total_sessions,
|
|
72
|
+
brain_path: manifest.brain_path,
|
|
73
|
+
last_boot: manifest.last_boot,
|
|
74
|
+
last_consolidation: manifest.last_consolidation,
|
|
75
|
+
license: licenseInfo,
|
|
76
|
+
}, null, 2),
|
|
77
|
+
}],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
return {
|
|
82
|
+
content: [{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `CRBRO status error: ${err instanceof Error ? err.message : String(err)}`,
|
|
85
|
+
}],
|
|
86
|
+
isError: true,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
// ═══════════════════════════════════════════════════════════════
|
|
91
|
+
// TOOL 3: crbro_learn — Add knowledge to the brain
|
|
92
|
+
// ═══════════════════════════════════════════════════════════════
|
|
93
|
+
server.tool('crbro_learn', 'Teach the brain a fact, decision, pattern, or preference about a topic. If the neuron (topic) does not exist, it will be created automatically. Use this to store knowledge that should persist across sessions.', {
|
|
94
|
+
topic: zod_1.z.string().describe('The topic name (e.g., "OctoChat", "Firebase", "SEO Strategy")'),
|
|
95
|
+
type: zod_1.z.enum(['fact', 'decision', 'pattern', 'preference']).describe('Type of knowledge to store'),
|
|
96
|
+
content: zod_1.z.string().describe('The knowledge content to remember'),
|
|
97
|
+
confidence: zod_1.z.number().min(0).max(1).optional().describe('Confidence level 0.0-1.0 (default 1.0)'),
|
|
98
|
+
domain: zod_1.z.string().optional().describe('Domain category (e.g., "proyectos-web", "infraestructura")'),
|
|
99
|
+
rationale: zod_1.z.string().optional().describe('Rationale for decisions'),
|
|
100
|
+
}, async (args) => {
|
|
101
|
+
try {
|
|
102
|
+
const result = await cortex.learn(args.topic, args.type, args.content, {
|
|
103
|
+
confidence: args.confidence,
|
|
104
|
+
domain: args.domain,
|
|
105
|
+
rationale: args.rationale,
|
|
106
|
+
});
|
|
107
|
+
// Update search index
|
|
108
|
+
await searchEngine.indexNeuron(result.neuron);
|
|
109
|
+
return {
|
|
110
|
+
content: [{
|
|
111
|
+
type: 'text',
|
|
112
|
+
text: JSON.stringify({
|
|
113
|
+
neuron_id: result.neuron.id,
|
|
114
|
+
action: result.action,
|
|
115
|
+
total_facts: result.neuron.facts.length,
|
|
116
|
+
total_decisions: result.neuron.decisions.length,
|
|
117
|
+
total_patterns: result.neuron.patterns.length,
|
|
118
|
+
message: result.action === 'created'
|
|
119
|
+
? `New neuron "${result.neuron.name}" created in ${result.neuron.domain}`
|
|
120
|
+
: `Updated neuron "${result.neuron.name}" — ${args.type} added`,
|
|
121
|
+
}, null, 2),
|
|
122
|
+
}],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
return {
|
|
127
|
+
content: [{
|
|
128
|
+
type: 'text',
|
|
129
|
+
text: `CRBRO learn error: ${err instanceof Error ? err.message : String(err)}`,
|
|
130
|
+
}],
|
|
131
|
+
isError: true,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
// ═══════════════════════════════════════════════════════════════
|
|
136
|
+
// TOOL 4: crbro_neuron — Read a specific neuron
|
|
137
|
+
// ═══════════════════════════════════════════════════════════════
|
|
138
|
+
server.tool('crbro_neuron', 'Read a specific neuron by ID or name. Returns all facts, decisions, patterns, connections, and heat score.', {
|
|
139
|
+
id: zod_1.z.string().describe('Neuron ID (e.g., "project_octochat") or name (e.g., "OctoChat")'),
|
|
140
|
+
}, async (args) => {
|
|
141
|
+
try {
|
|
142
|
+
// Try by ID first, then by name
|
|
143
|
+
let neuron = await cortex.get(args.id);
|
|
144
|
+
if (!neuron) {
|
|
145
|
+
neuron = await cortex.findByName(args.id);
|
|
146
|
+
if (neuron) {
|
|
147
|
+
// Touch the found neuron
|
|
148
|
+
neuron = await cortex.get(neuron.id);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (!neuron) {
|
|
152
|
+
return {
|
|
153
|
+
content: [{
|
|
154
|
+
type: 'text',
|
|
155
|
+
text: `Neuron not found: "${args.id}". Use crbro_neurons to list available neurons.`,
|
|
156
|
+
}],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
content: [{
|
|
161
|
+
type: 'text',
|
|
162
|
+
text: JSON.stringify(neuron, null, 2),
|
|
163
|
+
}],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
return {
|
|
168
|
+
content: [{
|
|
169
|
+
type: 'text',
|
|
170
|
+
text: `CRBRO neuron error: ${err instanceof Error ? err.message : String(err)}`,
|
|
171
|
+
}],
|
|
172
|
+
isError: true,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
// ═══════════════════════════════════════════════════════════════
|
|
177
|
+
// TOOL 5: crbro_neurons — List neurons
|
|
178
|
+
// ═══════════════════════════════════════════════════════════════
|
|
179
|
+
server.tool('crbro_neurons', 'List all neurons in the brain with optional filters. Returns ID, name, domain, heat, and facts count.', {
|
|
180
|
+
domain: zod_1.z.string().optional().describe('Filter by domain (e.g., "proyectos-web")'),
|
|
181
|
+
type: zod_1.z.enum(['project', 'tech', 'lang', 'person', 'domain', 'process']).optional().describe('Filter by neuron type'),
|
|
182
|
+
min_heat: zod_1.z.number().optional().describe('Minimum heat score (0.0-1.0)'),
|
|
183
|
+
limit: zod_1.z.number().optional().describe('Max results (default 50)'),
|
|
184
|
+
}, async (args) => {
|
|
185
|
+
try {
|
|
186
|
+
const neurons = await cortex.list({
|
|
187
|
+
domain: args.domain,
|
|
188
|
+
type: args.type,
|
|
189
|
+
min_heat: args.min_heat,
|
|
190
|
+
limit: args.limit,
|
|
191
|
+
});
|
|
192
|
+
return {
|
|
193
|
+
content: [{
|
|
194
|
+
type: 'text',
|
|
195
|
+
text: JSON.stringify({
|
|
196
|
+
total: neurons.length,
|
|
197
|
+
neurons,
|
|
198
|
+
}, null, 2),
|
|
199
|
+
}],
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
return {
|
|
204
|
+
content: [{
|
|
205
|
+
type: 'text',
|
|
206
|
+
text: `CRBRO neurons error: ${err instanceof Error ? err.message : String(err)}`,
|
|
207
|
+
}],
|
|
208
|
+
isError: true,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
// ═══════════════════════════════════════════════════════════════
|
|
213
|
+
// TOOL 6: crbro_recall — Search the brain
|
|
214
|
+
// ═══════════════════════════════════════════════════════════════
|
|
215
|
+
server.tool('crbro_recall', 'Search the brain for relevant knowledge using hybrid text search. Returns matching neurons ranked by relevance.', {
|
|
216
|
+
query: zod_1.z.string().describe('What to search for (e.g., "Firebase authentication setup")'),
|
|
217
|
+
domain: zod_1.z.string().optional().describe('Filter by domain'),
|
|
218
|
+
limit: zod_1.z.number().optional().describe('Max results (default 10)'),
|
|
219
|
+
}, async (args) => {
|
|
220
|
+
try {
|
|
221
|
+
const results = await searchEngine.search(args.query, {
|
|
222
|
+
domain: args.domain,
|
|
223
|
+
limit: args.limit,
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
content: [{
|
|
227
|
+
type: 'text',
|
|
228
|
+
text: JSON.stringify({
|
|
229
|
+
query: args.query,
|
|
230
|
+
total_results: results.length,
|
|
231
|
+
results,
|
|
232
|
+
}, null, 2),
|
|
233
|
+
}],
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
return {
|
|
238
|
+
content: [{
|
|
239
|
+
type: 'text',
|
|
240
|
+
text: `CRBRO recall error: ${err instanceof Error ? err.message : String(err)}`,
|
|
241
|
+
}],
|
|
242
|
+
isError: true,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
// ═══════════════════════════════════════════════════════════════
|
|
247
|
+
// TOOL 7: crbro_connect — Create/strengthen a synapse
|
|
248
|
+
// ═══════════════════════════════════════════════════════════════
|
|
249
|
+
server.tool('crbro_connect', 'Create or strengthen a connection (synapse) between two neurons. Synapses track relationships and strengthen with repeated co-access.', {
|
|
250
|
+
from: zod_1.z.string().describe('Source neuron ID'),
|
|
251
|
+
to: zod_1.z.string().describe('Target neuron ID'),
|
|
252
|
+
type: zod_1.z.enum(['dependency', 'causal', 'temporal', 'conceptual', 'hierarchy', 'alternative']).describe('Connection type'),
|
|
253
|
+
context: zod_1.z.string().optional().describe('Description of the relationship'),
|
|
254
|
+
}, async (args) => {
|
|
255
|
+
try {
|
|
256
|
+
const result = await synapses.connect(args.from, args.to, args.type, args.context);
|
|
257
|
+
return {
|
|
258
|
+
content: [{
|
|
259
|
+
type: 'text',
|
|
260
|
+
text: JSON.stringify({
|
|
261
|
+
synapse_id: result.synapse.id,
|
|
262
|
+
action: result.action,
|
|
263
|
+
strength: result.synapse.strength,
|
|
264
|
+
message: result.action === 'created'
|
|
265
|
+
? `New synapse: ${args.from} ↔ ${args.to} (${args.type})`
|
|
266
|
+
: `Synapse strengthened: ${args.from} ↔ ${args.to} → strength ${result.synapse.strength}`,
|
|
267
|
+
}, null, 2),
|
|
268
|
+
}],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
return {
|
|
273
|
+
content: [{
|
|
274
|
+
type: 'text',
|
|
275
|
+
text: `CRBRO connect error: ${err instanceof Error ? err.message : String(err)}`,
|
|
276
|
+
}],
|
|
277
|
+
isError: true,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
// ═══════════════════════════════════════════════════════════════
|
|
282
|
+
// TOOL 8: crbro_connections — Get neuron connections
|
|
283
|
+
// ═══════════════════════════════════════════════════════════════
|
|
284
|
+
server.tool('crbro_connections', 'Get all connections (synapses) for a specific neuron. Shows related topics with connection strength and type.', {
|
|
285
|
+
neuron_id: zod_1.z.string().describe('Neuron ID to get connections for'),
|
|
286
|
+
min_strength: zod_1.z.number().optional().describe('Minimum synapse strength (0.0-1.0)'),
|
|
287
|
+
}, async (args) => {
|
|
288
|
+
try {
|
|
289
|
+
const connections = await synapses.getConnections(args.neuron_id, args.min_strength);
|
|
290
|
+
return {
|
|
291
|
+
content: [{
|
|
292
|
+
type: 'text',
|
|
293
|
+
text: JSON.stringify({
|
|
294
|
+
neuron_id: args.neuron_id,
|
|
295
|
+
total_connections: connections.length,
|
|
296
|
+
connections,
|
|
297
|
+
}, null, 2),
|
|
298
|
+
}],
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
catch (err) {
|
|
302
|
+
return {
|
|
303
|
+
content: [{
|
|
304
|
+
type: 'text',
|
|
305
|
+
text: `CRBRO connections error: ${err instanceof Error ? err.message : String(err)}`,
|
|
306
|
+
}],
|
|
307
|
+
isError: true,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
// ═══════════════════════════════════════════════════════════════
|
|
312
|
+
// TOOL 9: crbro_session_log — Log a session
|
|
313
|
+
// ═══════════════════════════════════════════════════════════════
|
|
314
|
+
server.tool('crbro_session_log', 'Log a session summary to the hippocampus. Call at the end of a work session to record what was done.', {
|
|
315
|
+
summary: zod_1.z.string().describe('Summary of what happened in this session'),
|
|
316
|
+
topics_touched: zod_1.z.array(zod_1.z.string()).describe('List of neuron IDs that were relevant'),
|
|
317
|
+
key_facts_added: zod_1.z.number().optional().describe('Number of new facts stored'),
|
|
318
|
+
decisions_made: zod_1.z.number().optional().describe('Number of decisions recorded'),
|
|
319
|
+
}, async (args) => {
|
|
320
|
+
try {
|
|
321
|
+
const session = await hippocampus.logSession({
|
|
322
|
+
summary: args.summary,
|
|
323
|
+
topics_touched: args.topics_touched,
|
|
324
|
+
key_facts_added: args.key_facts_added,
|
|
325
|
+
decisions_made: args.decisions_made,
|
|
326
|
+
});
|
|
327
|
+
// Update active context with last session
|
|
328
|
+
await prefrontal.updateContext({
|
|
329
|
+
set_topics: args.topics_touched,
|
|
330
|
+
});
|
|
331
|
+
return {
|
|
332
|
+
content: [{
|
|
333
|
+
type: 'text',
|
|
334
|
+
text: JSON.stringify({
|
|
335
|
+
session_id: session.session_id,
|
|
336
|
+
date: session.date,
|
|
337
|
+
message: 'Session logged to hippocampus.',
|
|
338
|
+
}, null, 2),
|
|
339
|
+
}],
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
catch (err) {
|
|
343
|
+
return {
|
|
344
|
+
content: [{
|
|
345
|
+
type: 'text',
|
|
346
|
+
text: `CRBRO session_log error: ${err instanceof Error ? err.message : String(err)}`,
|
|
347
|
+
}],
|
|
348
|
+
isError: true,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
// ═══════════════════════════════════════════════════════════════
|
|
353
|
+
// TOOL 10: crbro_sessions — List recent sessions
|
|
354
|
+
// ═══════════════════════════════════════════════════════════════
|
|
355
|
+
server.tool('crbro_sessions', 'List recent session logs from the hippocampus.', {
|
|
356
|
+
limit: zod_1.z.number().optional().describe('Number of sessions to return (default 10)'),
|
|
357
|
+
}, async (args) => {
|
|
358
|
+
try {
|
|
359
|
+
const sessions = await hippocampus.listSessions(args.limit);
|
|
360
|
+
return {
|
|
361
|
+
content: [{
|
|
362
|
+
type: 'text',
|
|
363
|
+
text: JSON.stringify({
|
|
364
|
+
total: sessions.length,
|
|
365
|
+
sessions,
|
|
366
|
+
}, null, 2),
|
|
367
|
+
}],
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
catch (err) {
|
|
371
|
+
return {
|
|
372
|
+
content: [{
|
|
373
|
+
type: 'text',
|
|
374
|
+
text: `CRBRO sessions error: ${err instanceof Error ? err.message : String(err)}`,
|
|
375
|
+
}],
|
|
376
|
+
isError: true,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
// ═══════════════════════════════════════════════════════════════
|
|
381
|
+
// TOOL 11: crbro_context — Active context
|
|
382
|
+
// ═══════════════════════════════════════════════════════════════
|
|
383
|
+
server.tool('crbro_context', 'Read or update the active working context. Tracks current topics, pending tasks, and last session.', {
|
|
384
|
+
set_topics: zod_1.z.array(zod_1.z.string()).optional().describe('Set active topics (neuron IDs)'),
|
|
385
|
+
add_pending: zod_1.z.string().optional().describe('Add a pending task'),
|
|
386
|
+
resolve_pending: zod_1.z.string().optional().describe('Mark a pending task as resolved'),
|
|
387
|
+
}, async (args) => {
|
|
388
|
+
try {
|
|
389
|
+
const ctx = await prefrontal.updateContext({
|
|
390
|
+
set_topics: args.set_topics,
|
|
391
|
+
add_pending: args.add_pending,
|
|
392
|
+
resolve_pending: args.resolve_pending,
|
|
393
|
+
});
|
|
394
|
+
return {
|
|
395
|
+
content: [{
|
|
396
|
+
type: 'text',
|
|
397
|
+
text: JSON.stringify(ctx, null, 2),
|
|
398
|
+
}],
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
catch (err) {
|
|
402
|
+
return {
|
|
403
|
+
content: [{
|
|
404
|
+
type: 'text',
|
|
405
|
+
text: `CRBRO context error: ${err instanceof Error ? err.message : String(err)}`,
|
|
406
|
+
}],
|
|
407
|
+
isError: true,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
// ═══════════════════════════════════════════════════════════════
|
|
412
|
+
// TOOL 12: crbro_hot_topics — Hot topics
|
|
413
|
+
// ═══════════════════════════════════════════════════════════════
|
|
414
|
+
server.tool('crbro_hot_topics', 'Get the hottest topics — neurons with the highest heat scores (based on frequency, recency, and connectivity).', {
|
|
415
|
+
limit: zod_1.z.number().optional().describe('Number of topics to return (default 15)'),
|
|
416
|
+
}, async (args) => {
|
|
417
|
+
try {
|
|
418
|
+
const hotTopics = await prefrontal.getHotTopics(args.limit);
|
|
419
|
+
return {
|
|
420
|
+
content: [{
|
|
421
|
+
type: 'text',
|
|
422
|
+
text: JSON.stringify(hotTopics, null, 2),
|
|
423
|
+
}],
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
catch (err) {
|
|
427
|
+
return {
|
|
428
|
+
content: [{
|
|
429
|
+
type: 'text',
|
|
430
|
+
text: `CRBRO hot_topics error: ${err instanceof Error ? err.message : String(err)}`,
|
|
431
|
+
}],
|
|
432
|
+
isError: true,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
// ═══════════════════════════════════════════════════════════════
|
|
437
|
+
// TOOL 13: crbro_global_map — Global neural map [PREMIUM]
|
|
438
|
+
// ═══════════════════════════════════════════════════════════════
|
|
439
|
+
server.tool('crbro_global_map', '[PREMIUM] View the global neural map — clusters of related topics and bridges between domains. Requires Synthetica Zero Deck license.', {
|
|
440
|
+
rebuild: zod_1.z.boolean().optional().describe('Force rebuild the map (default: use cached)'),
|
|
441
|
+
}, async (args) => {
|
|
442
|
+
try {
|
|
443
|
+
const canUse = await license.canUse('crbro_global_map');
|
|
444
|
+
if (!canUse) {
|
|
445
|
+
return {
|
|
446
|
+
content: [{
|
|
447
|
+
type: 'text',
|
|
448
|
+
text: '🔒 PREMIUM FEATURE: crbro_global_map requires a Synthetica Zero Deck license. Visit https://synthetica-decks.web.app to get your license key, then set it via CRBRO_LICENSE_KEY environment variable.',
|
|
449
|
+
}],
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
const globalMap = await prefrontal.getGlobalMap(args.rebuild);
|
|
453
|
+
return {
|
|
454
|
+
content: [{
|
|
455
|
+
type: 'text',
|
|
456
|
+
text: JSON.stringify({
|
|
457
|
+
total_clusters: globalMap.clusters.length,
|
|
458
|
+
total_bridges: globalMap.bridges.length,
|
|
459
|
+
last_rebuilt: globalMap.last_rebuilt,
|
|
460
|
+
clusters: globalMap.clusters,
|
|
461
|
+
bridges: globalMap.bridges,
|
|
462
|
+
}, null, 2),
|
|
463
|
+
}],
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
catch (err) {
|
|
467
|
+
return {
|
|
468
|
+
content: [{
|
|
469
|
+
type: 'text',
|
|
470
|
+
text: `CRBRO global_map error: ${err instanceof Error ? err.message : String(err)}`,
|
|
471
|
+
}],
|
|
472
|
+
isError: true,
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
// ═══════════════════════════════════════════════════════════════
|
|
477
|
+
// TOOL 14: crbro_maintenance — Run maintenance [PREMIUM]
|
|
478
|
+
// ═══════════════════════════════════════════════════════════════
|
|
479
|
+
server.tool('crbro_maintenance', '[PREMIUM] Run brain maintenance — recalculate heat, prune weak synapses, archive cold neurons, rebuild search index. Requires Synthetica Zero Deck license.', {
|
|
480
|
+
dry_run: zod_1.z.boolean().optional().describe('If true, only report what would happen without acting'),
|
|
481
|
+
}, async (args) => {
|
|
482
|
+
try {
|
|
483
|
+
const canUse = await license.canUse('crbro_maintenance');
|
|
484
|
+
if (!canUse) {
|
|
485
|
+
return {
|
|
486
|
+
content: [{
|
|
487
|
+
type: 'text',
|
|
488
|
+
text: '🔒 PREMIUM FEATURE: crbro_maintenance requires a Synthetica Zero Deck license. Visit https://synthetica-decks.web.app to get your license key.',
|
|
489
|
+
}],
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
const report = await maintenance.run(args.dry_run);
|
|
493
|
+
return {
|
|
494
|
+
content: [{
|
|
495
|
+
type: 'text',
|
|
496
|
+
text: JSON.stringify({
|
|
497
|
+
mode: args.dry_run ? 'DRY RUN' : 'EXECUTED',
|
|
498
|
+
...report,
|
|
499
|
+
}, null, 2),
|
|
500
|
+
}],
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
catch (err) {
|
|
504
|
+
return {
|
|
505
|
+
content: [{
|
|
506
|
+
type: 'text',
|
|
507
|
+
text: `CRBRO maintenance error: ${err instanceof Error ? err.message : String(err)}`,
|
|
508
|
+
}],
|
|
509
|
+
isError: true,
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
// ═══════════════════════════════════════════════════════════════
|
|
514
|
+
// TOOL 15: crbro_consolidate — End-of-session consolidation
|
|
515
|
+
// ═══════════════════════════════════════════════════════════════
|
|
516
|
+
server.tool('crbro_consolidate', 'Consolidate the brain at end of session — persist search index, log session, recalculate heat scores, and update manifest.', {
|
|
517
|
+
summary: zod_1.z.string().describe('Summary of the session being consolidated'),
|
|
518
|
+
}, async (args) => {
|
|
519
|
+
try {
|
|
520
|
+
const result = await maintenance.consolidate(args.summary);
|
|
521
|
+
return {
|
|
522
|
+
content: [{
|
|
523
|
+
type: 'text',
|
|
524
|
+
text: JSON.stringify({
|
|
525
|
+
...result,
|
|
526
|
+
message: 'Session consolidated. Brain state persisted.',
|
|
527
|
+
}, null, 2),
|
|
528
|
+
}],
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
catch (err) {
|
|
532
|
+
return {
|
|
533
|
+
content: [{
|
|
534
|
+
type: 'text',
|
|
535
|
+
text: `CRBRO consolidate error: ${err instanceof Error ? err.message : String(err)}`,
|
|
536
|
+
}],
|
|
537
|
+
isError: true,
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
return server;
|
|
542
|
+
}
|
|
543
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,2CAA2C;;AAe3C,oCA6mBC;AA1nBD,oEAAoE;AACpE,6BAAwB;AAExB,gDAA0C;AAC1C,kDAA4C;AAC5C,sDAAgD;AAChD,8CAA8C;AAC9C,4DAAsD;AACtD,0DAAoD;AACpD,gDAAiD;AACjD,4DAAsD;AACtD,oDAAoD;AAEpD,SAAgB,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,cAAc;QACpB,OAAO,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