@timmeck/brain-core 2.31.2 → 2.33.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.
Files changed (32) hide show
  1. package/codegen-dashboard.html +222 -1
  2. package/dist/codegen/codegen-server.d.ts +5 -0
  3. package/dist/codegen/codegen-server.js +106 -1
  4. package/dist/codegen/codegen-server.js.map +1 -1
  5. package/dist/codegen/context-builder.d.ts +4 -0
  6. package/dist/codegen/context-builder.js +26 -2
  7. package/dist/codegen/context-builder.js.map +1 -1
  8. package/dist/index.d.ts +6 -0
  9. package/dist/index.js +6 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/research/bootstrap-service.d.ts +57 -0
  12. package/dist/research/bootstrap-service.js +325 -0
  13. package/dist/research/bootstrap-service.js.map +1 -0
  14. package/dist/research/data-miner.d.ts +1 -0
  15. package/dist/research/data-miner.js +22 -5
  16. package/dist/research/data-miner.js.map +1 -1
  17. package/dist/research/research-orchestrator.d.ts +14 -0
  18. package/dist/research/research-orchestrator.js +140 -0
  19. package/dist/research/research-orchestrator.js.map +1 -1
  20. package/dist/self-modification/index.d.ts +2 -0
  21. package/dist/self-modification/index.js +2 -0
  22. package/dist/self-modification/index.js.map +1 -0
  23. package/dist/self-modification/self-modification-engine.d.ts +93 -0
  24. package/dist/self-modification/self-modification-engine.js +588 -0
  25. package/dist/self-modification/self-modification-engine.js.map +1 -0
  26. package/dist/self-scanner/index.d.ts +2 -0
  27. package/dist/self-scanner/index.js +2 -0
  28. package/dist/self-scanner/index.js.map +1 -0
  29. package/dist/self-scanner/self-scanner.d.ts +99 -0
  30. package/dist/self-scanner/self-scanner.js +397 -0
  31. package/dist/self-scanner/self-scanner.js.map +1 -0
  32. package/package.json +1 -1
@@ -0,0 +1,99 @@
1
+ import type Database from 'better-sqlite3';
2
+ export interface SelfScannerConfig {
3
+ brainName: string;
4
+ /** Glob patterns relative to root. Default: packages/star/src */
5
+ scanDirs?: string[];
6
+ /** File extension to scan. Default: .ts */
7
+ extension?: string;
8
+ }
9
+ export interface SourceFile {
10
+ id: number;
11
+ package_name: string;
12
+ file_path: string;
13
+ content: string;
14
+ content_hash: string;
15
+ size_bytes: number;
16
+ last_scanned: string;
17
+ }
18
+ export interface CodeEntity {
19
+ id: number;
20
+ file_id: number;
21
+ entity_type: EntityType;
22
+ entity_name: string;
23
+ line_start: number;
24
+ line_end: number;
25
+ signature: string;
26
+ parent_entity: string | null;
27
+ }
28
+ export type EntityType = 'class' | 'function' | 'interface' | 'type' | 'const' | 'method';
29
+ export interface EntityFilter {
30
+ entityType?: EntityType;
31
+ entityName?: string;
32
+ packageName?: string;
33
+ }
34
+ export interface ModuleMapEntry {
35
+ package_name: string;
36
+ file_path: string;
37
+ entity_type: EntityType;
38
+ entity_name: string;
39
+ }
40
+ export interface SelfScanResult {
41
+ totalFiles: number;
42
+ newFiles: number;
43
+ updatedFiles: number;
44
+ unchangedFiles: number;
45
+ totalEntities: number;
46
+ durationMs: number;
47
+ }
48
+ export interface SelfScannerStatus {
49
+ brainName: string;
50
+ totalFiles: number;
51
+ totalEntities: number;
52
+ byPackage: Record<string, number>;
53
+ byEntityType: Record<string, number>;
54
+ lastScanTime: string | null;
55
+ }
56
+ export declare function runSelfScannerMigration(db: Database.Database): void;
57
+ export declare class SelfScanner {
58
+ private readonly db;
59
+ private readonly config;
60
+ private readonly log;
61
+ private lastScanTime;
62
+ private readonly stmtGetFileByPath;
63
+ private readonly stmtInsertFile;
64
+ private readonly stmtUpdateFile;
65
+ private readonly stmtDeleteEntities;
66
+ private readonly stmtInsertEntity;
67
+ private readonly stmtGetFileContent;
68
+ private readonly stmtGetEntities;
69
+ private readonly stmtGetModuleMap;
70
+ private readonly stmtCountFiles;
71
+ private readonly stmtCountEntities;
72
+ private readonly stmtCountByPackage;
73
+ private readonly stmtCountByEntityType;
74
+ constructor(db: Database.Database, config: SelfScannerConfig);
75
+ /** Recursively scan TypeScript source files from the project root. */
76
+ scan(rootPath: string): SelfScanResult;
77
+ /** Parse code entities from source content using regex patterns. */
78
+ parseEntities(content: string, fileId: number): number;
79
+ /** Get stored source content for a file. */
80
+ getFileContent(filePath: string): string | null;
81
+ /** Get code entities with optional filtering. */
82
+ getEntities(filter?: EntityFilter): (CodeEntity & {
83
+ file_path: string;
84
+ package_name: string;
85
+ })[];
86
+ /** Get a map of which classes/interfaces/functions live where. */
87
+ getModuleMap(): ModuleMapEntry[];
88
+ /** Generate a compact architecture summary suitable for Claude API context. */
89
+ getArchitectureSummary(): string;
90
+ /** Get scanner status with statistics. */
91
+ getStatus(): SelfScannerStatus;
92
+ private discoverFiles;
93
+ private expandGlob;
94
+ private walkDir;
95
+ private extractPackageName;
96
+ private findBlockEnd;
97
+ private findTypeEnd;
98
+ private findConstEnd;
99
+ }
@@ -0,0 +1,397 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import crypto from 'node:crypto';
4
+ import { getLogger } from '../utils/logger.js';
5
+ // ── Migration ────────────────────────────────────────────
6
+ export function runSelfScannerMigration(db) {
7
+ db.exec(`
8
+ CREATE TABLE IF NOT EXISTS own_source_files (
9
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
10
+ package_name TEXT NOT NULL,
11
+ file_path TEXT NOT NULL UNIQUE,
12
+ content TEXT NOT NULL,
13
+ content_hash TEXT NOT NULL,
14
+ size_bytes INTEGER NOT NULL,
15
+ last_scanned TEXT DEFAULT (datetime('now'))
16
+ );
17
+ CREATE INDEX IF NOT EXISTS idx_own_source_pkg ON own_source_files(package_name);
18
+
19
+ CREATE TABLE IF NOT EXISTS own_code_entities (
20
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
21
+ file_id INTEGER NOT NULL REFERENCES own_source_files(id) ON DELETE CASCADE,
22
+ entity_type TEXT NOT NULL,
23
+ entity_name TEXT NOT NULL,
24
+ line_start INTEGER NOT NULL,
25
+ line_end INTEGER NOT NULL,
26
+ signature TEXT NOT NULL DEFAULT '',
27
+ parent_entity TEXT
28
+ );
29
+ CREATE INDEX IF NOT EXISTS idx_own_entities_file ON own_code_entities(file_id);
30
+ CREATE INDEX IF NOT EXISTS idx_own_entities_type ON own_code_entities(entity_type);
31
+ CREATE INDEX IF NOT EXISTS idx_own_entities_name ON own_code_entities(entity_name);
32
+ `);
33
+ }
34
+ // ── SelfScanner ──────────────────────────────────────────
35
+ export class SelfScanner {
36
+ db;
37
+ config;
38
+ log = getLogger();
39
+ lastScanTime = null;
40
+ // Prepared statements
41
+ stmtGetFileByPath;
42
+ stmtInsertFile;
43
+ stmtUpdateFile;
44
+ stmtDeleteEntities;
45
+ stmtInsertEntity;
46
+ stmtGetFileContent;
47
+ stmtGetEntities;
48
+ stmtGetModuleMap;
49
+ stmtCountFiles;
50
+ stmtCountEntities;
51
+ stmtCountByPackage;
52
+ stmtCountByEntityType;
53
+ constructor(db, config) {
54
+ this.db = db;
55
+ this.config = {
56
+ brainName: config.brainName,
57
+ scanDirs: config.scanDirs ?? ['packages/*/src'],
58
+ extension: config.extension ?? '.ts',
59
+ };
60
+ runSelfScannerMigration(db);
61
+ this.stmtGetFileByPath = db.prepare('SELECT id, content_hash FROM own_source_files WHERE file_path = ?');
62
+ this.stmtInsertFile = db.prepare('INSERT INTO own_source_files (package_name, file_path, content, content_hash, size_bytes) VALUES (?, ?, ?, ?, ?)');
63
+ this.stmtUpdateFile = db.prepare('UPDATE own_source_files SET content = ?, content_hash = ?, size_bytes = ?, last_scanned = datetime(\'now\') WHERE id = ?');
64
+ this.stmtDeleteEntities = db.prepare('DELETE FROM own_code_entities WHERE file_id = ?');
65
+ this.stmtInsertEntity = db.prepare('INSERT INTO own_code_entities (file_id, entity_type, entity_name, line_start, line_end, signature, parent_entity) VALUES (?, ?, ?, ?, ?, ?, ?)');
66
+ this.stmtGetFileContent = db.prepare('SELECT content FROM own_source_files WHERE file_path = ?');
67
+ this.stmtGetEntities = db.prepare(`
68
+ SELECT e.*, f.file_path, f.package_name
69
+ FROM own_code_entities e
70
+ JOIN own_source_files f ON e.file_id = f.id
71
+ ORDER BY f.package_name, f.file_path, e.line_start
72
+ `);
73
+ this.stmtGetModuleMap = db.prepare(`
74
+ SELECT f.package_name, f.file_path, e.entity_type, e.entity_name
75
+ FROM own_code_entities e
76
+ JOIN own_source_files f ON e.file_id = f.id
77
+ WHERE e.entity_type IN ('class', 'interface', 'function')
78
+ ORDER BY f.package_name, e.entity_name
79
+ `);
80
+ this.stmtCountFiles = db.prepare('SELECT COUNT(*) as count FROM own_source_files');
81
+ this.stmtCountEntities = db.prepare('SELECT COUNT(*) as count FROM own_code_entities');
82
+ this.stmtCountByPackage = db.prepare('SELECT package_name, COUNT(*) as count FROM own_source_files GROUP BY package_name');
83
+ this.stmtCountByEntityType = db.prepare('SELECT entity_type, COUNT(*) as count FROM own_code_entities GROUP BY entity_type');
84
+ }
85
+ /** Recursively scan TypeScript source files from the project root. */
86
+ scan(rootPath) {
87
+ const start = Date.now();
88
+ const resolvedRoot = path.resolve(rootPath);
89
+ let newFiles = 0;
90
+ let updatedFiles = 0;
91
+ let unchangedFiles = 0;
92
+ let totalEntities = 0;
93
+ // Discover all .ts files matching scanDirs patterns
94
+ const files = this.discoverFiles(resolvedRoot);
95
+ const transaction = this.db.transaction(() => {
96
+ for (const filePath of files) {
97
+ const relativePath = path.relative(resolvedRoot, filePath).replace(/\\/g, '/');
98
+ const packageName = this.extractPackageName(relativePath);
99
+ let content;
100
+ try {
101
+ content = fs.readFileSync(filePath, 'utf-8');
102
+ }
103
+ catch {
104
+ continue;
105
+ }
106
+ const hash = crypto.createHash('sha256').update(content).digest('hex');
107
+ const existing = this.stmtGetFileByPath.get(relativePath);
108
+ if (!existing) {
109
+ // New file
110
+ const result = this.stmtInsertFile.run(packageName, relativePath, content, hash, Buffer.byteLength(content));
111
+ const fileId = result.lastInsertRowid;
112
+ totalEntities += this.parseEntities(content, fileId);
113
+ newFiles++;
114
+ }
115
+ else if (existing.content_hash !== hash) {
116
+ // Updated file
117
+ this.stmtUpdateFile.run(content, hash, Buffer.byteLength(content), existing.id);
118
+ this.stmtDeleteEntities.run(existing.id);
119
+ totalEntities += this.parseEntities(content, existing.id);
120
+ updatedFiles++;
121
+ }
122
+ else {
123
+ unchangedFiles++;
124
+ }
125
+ }
126
+ });
127
+ transaction();
128
+ this.lastScanTime = new Date().toISOString();
129
+ const durationMs = Date.now() - start;
130
+ this.log.info(`[self-scanner] Scanned ${files.length} files: ${newFiles} new, ${updatedFiles} updated, ${unchangedFiles} unchanged (${durationMs}ms)`);
131
+ return {
132
+ totalFiles: files.length,
133
+ newFiles,
134
+ updatedFiles,
135
+ unchangedFiles,
136
+ totalEntities,
137
+ durationMs,
138
+ };
139
+ }
140
+ /** Parse code entities from source content using regex patterns. */
141
+ parseEntities(content, fileId) {
142
+ const lines = content.split('\n');
143
+ let count = 0;
144
+ let currentClass = null;
145
+ let classDepth = 0;
146
+ let braceDepth = 0;
147
+ for (let i = 0; i < lines.length; i++) {
148
+ const line = lines[i];
149
+ const lineNum = i + 1;
150
+ // Track brace depth for class scope
151
+ for (const ch of line) {
152
+ if (ch === '{')
153
+ braceDepth++;
154
+ if (ch === '}')
155
+ braceDepth--;
156
+ }
157
+ if (currentClass && braceDepth < classDepth) {
158
+ currentClass = null;
159
+ classDepth = 0;
160
+ }
161
+ // Class
162
+ const classMatch = line.match(/^export\s+(?:abstract\s+)?class\s+(\w+)/);
163
+ if (classMatch) {
164
+ const name = classMatch[1];
165
+ const endLine = this.findBlockEnd(lines, i);
166
+ this.stmtInsertEntity.run(fileId, 'class', name, lineNum, endLine, line.trim(), null);
167
+ currentClass = name;
168
+ classDepth = braceDepth;
169
+ count++;
170
+ continue;
171
+ }
172
+ // Interface
173
+ const ifaceMatch = line.match(/^export\s+interface\s+(\w+)/);
174
+ if (ifaceMatch) {
175
+ const name = ifaceMatch[1];
176
+ const endLine = this.findBlockEnd(lines, i);
177
+ this.stmtInsertEntity.run(fileId, 'interface', name, lineNum, endLine, line.trim(), null);
178
+ count++;
179
+ continue;
180
+ }
181
+ // Type
182
+ const typeMatch = line.match(/^export\s+type\s+(\w+)/);
183
+ if (typeMatch) {
184
+ const name = typeMatch[1];
185
+ const endLine = this.findTypeEnd(lines, i);
186
+ this.stmtInsertEntity.run(fileId, 'type', name, lineNum, endLine, line.trim(), null);
187
+ count++;
188
+ continue;
189
+ }
190
+ // Function
191
+ const funcMatch = line.match(/^export\s+(?:async\s+)?function\s+(\w+)/);
192
+ if (funcMatch) {
193
+ const name = funcMatch[1];
194
+ const endLine = this.findBlockEnd(lines, i);
195
+ this.stmtInsertEntity.run(fileId, 'function', name, lineNum, endLine, line.trim(), null);
196
+ count++;
197
+ continue;
198
+ }
199
+ // Const
200
+ const constMatch = line.match(/^export\s+const\s+(\w+)/);
201
+ if (constMatch) {
202
+ const name = constMatch[1];
203
+ const endLine = this.findConstEnd(lines, i);
204
+ this.stmtInsertEntity.run(fileId, 'const', name, lineNum, endLine, line.trim(), null);
205
+ count++;
206
+ continue;
207
+ }
208
+ // Methods (inside classes)
209
+ if (currentClass) {
210
+ const methodMatch = line.match(/^\s+(?:private\s+|public\s+|protected\s+|readonly\s+)?(?:static\s+)?(?:async\s+)?(\w+)\s*\(/);
211
+ if (methodMatch) {
212
+ const name = methodMatch[1];
213
+ // Skip constructor and common non-method patterns
214
+ if (name === 'if' || name === 'for' || name === 'while' || name === 'switch' || name === 'catch' || name === 'return')
215
+ continue;
216
+ const endLine = this.findBlockEnd(lines, i);
217
+ this.stmtInsertEntity.run(fileId, 'method', name, lineNum, endLine, line.trim(), currentClass);
218
+ count++;
219
+ }
220
+ }
221
+ }
222
+ return count;
223
+ }
224
+ /** Get stored source content for a file. */
225
+ getFileContent(filePath) {
226
+ const row = this.stmtGetFileContent.get(filePath);
227
+ return row?.content ?? null;
228
+ }
229
+ /** Get code entities with optional filtering. */
230
+ getEntities(filter) {
231
+ let rows = this.stmtGetEntities.all();
232
+ if (filter?.entityType) {
233
+ rows = rows.filter(r => r.entity_type === filter.entityType);
234
+ }
235
+ if (filter?.entityName) {
236
+ const name = filter.entityName.toLowerCase();
237
+ rows = rows.filter(r => r.entity_name.toLowerCase().includes(name));
238
+ }
239
+ if (filter?.packageName) {
240
+ rows = rows.filter(r => r.package_name === filter.packageName);
241
+ }
242
+ return rows;
243
+ }
244
+ /** Get a map of which classes/interfaces/functions live where. */
245
+ getModuleMap() {
246
+ return this.stmtGetModuleMap.all();
247
+ }
248
+ /** Generate a compact architecture summary suitable for Claude API context. */
249
+ getArchitectureSummary() {
250
+ const moduleMap = this.getModuleMap();
251
+ if (moduleMap.length === 0)
252
+ return 'No source files scanned yet.';
253
+ const sections = [];
254
+ const byPackage = new Map();
255
+ for (const entry of moduleMap) {
256
+ const existing = byPackage.get(entry.package_name) ?? [];
257
+ existing.push(entry);
258
+ byPackage.set(entry.package_name, existing);
259
+ }
260
+ for (const [pkg, entries] of byPackage) {
261
+ const classes = entries.filter(e => e.entity_type === 'class').map(e => e.entity_name);
262
+ const interfaces = entries.filter(e => e.entity_type === 'interface').map(e => e.entity_name);
263
+ const functions = entries.filter(e => e.entity_type === 'function').map(e => e.entity_name);
264
+ sections.push(`### ${pkg}`);
265
+ if (classes.length > 0)
266
+ sections.push(`Classes: ${classes.join(', ')}`);
267
+ if (interfaces.length > 0)
268
+ sections.push(`Interfaces: ${interfaces.join(', ')}`);
269
+ if (functions.length > 0)
270
+ sections.push(`Functions: ${functions.join(', ')}`);
271
+ sections.push('');
272
+ }
273
+ return sections.join('\n');
274
+ }
275
+ /** Get scanner status with statistics. */
276
+ getStatus() {
277
+ const fileCount = this.stmtCountFiles.get().count;
278
+ const entityCount = this.stmtCountEntities.get().count;
279
+ const byPackage = {};
280
+ for (const row of this.stmtCountByPackage.all()) {
281
+ byPackage[row.package_name] = row.count;
282
+ }
283
+ const byEntityType = {};
284
+ for (const row of this.stmtCountByEntityType.all()) {
285
+ byEntityType[row.entity_type] = row.count;
286
+ }
287
+ return {
288
+ brainName: this.config.brainName,
289
+ totalFiles: fileCount,
290
+ totalEntities: entityCount,
291
+ byPackage,
292
+ byEntityType,
293
+ lastScanTime: this.lastScanTime,
294
+ };
295
+ }
296
+ // ── Private Helpers ────────────────────────────────────
297
+ discoverFiles(rootPath) {
298
+ const files = [];
299
+ const ext = this.config.extension;
300
+ for (const pattern of this.config.scanDirs) {
301
+ // Expand simple glob: 'packages/*/src' → find all matching dirs
302
+ const parts = pattern.split('/');
303
+ const resolved = this.expandGlob(rootPath, parts, 0);
304
+ for (const dir of resolved) {
305
+ this.walkDir(dir, ext, files);
306
+ }
307
+ }
308
+ return files;
309
+ }
310
+ expandGlob(base, parts, index) {
311
+ if (index >= parts.length)
312
+ return [base];
313
+ const part = parts[index];
314
+ if (part === '*') {
315
+ const results = [];
316
+ try {
317
+ const entries = fs.readdirSync(base, { withFileTypes: true });
318
+ for (const entry of entries) {
319
+ if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
320
+ results.push(...this.expandGlob(path.join(base, entry.name), parts, index + 1));
321
+ }
322
+ }
323
+ }
324
+ catch { /* directory might not exist */ }
325
+ return results;
326
+ }
327
+ const next = path.join(base, part);
328
+ if (fs.existsSync(next)) {
329
+ return this.expandGlob(next, parts, index + 1);
330
+ }
331
+ return [];
332
+ }
333
+ walkDir(dir, ext, result) {
334
+ try {
335
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
336
+ for (const entry of entries) {
337
+ const fullPath = path.join(dir, entry.name);
338
+ if (entry.isDirectory()) {
339
+ if (entry.name !== 'node_modules' && entry.name !== 'dist' && entry.name !== '__tests__' && !entry.name.startsWith('.')) {
340
+ this.walkDir(fullPath, ext, result);
341
+ }
342
+ }
343
+ else if (entry.name.endsWith(ext) && !entry.name.endsWith('.test.ts') && !entry.name.endsWith('.spec.ts') && !entry.name.endsWith('.d.ts')) {
344
+ result.push(fullPath);
345
+ }
346
+ }
347
+ }
348
+ catch { /* permission or access error */ }
349
+ }
350
+ extractPackageName(relativePath) {
351
+ // packages/brain-core/src/foo.ts → brain-core
352
+ const match = relativePath.match(/^packages\/([^/]+)\//);
353
+ return match?.[1] ?? 'unknown';
354
+ }
355
+ findBlockEnd(lines, startIndex) {
356
+ let depth = 0;
357
+ let foundOpen = false;
358
+ for (let i = startIndex; i < lines.length; i++) {
359
+ for (const ch of lines[i]) {
360
+ if (ch === '{') {
361
+ depth++;
362
+ foundOpen = true;
363
+ }
364
+ if (ch === '}')
365
+ depth--;
366
+ if (foundOpen && depth === 0)
367
+ return i + 1;
368
+ }
369
+ }
370
+ return startIndex + 1;
371
+ }
372
+ findTypeEnd(lines, startIndex) {
373
+ // Types end at semicolon or next export
374
+ for (let i = startIndex + 1; i < Math.min(startIndex + 50, lines.length); i++) {
375
+ const line = lines[i];
376
+ if (line.trimEnd().endsWith(';') || line.match(/^export\s/))
377
+ return i + 1;
378
+ }
379
+ return startIndex + 1;
380
+ }
381
+ findConstEnd(lines, startIndex) {
382
+ // Simple consts end at semicolon, complex ones end at closing bracket + semicolon
383
+ let depth = 0;
384
+ for (let i = startIndex; i < Math.min(startIndex + 100, lines.length); i++) {
385
+ for (const ch of lines[i]) {
386
+ if (ch === '{' || ch === '[' || ch === '(')
387
+ depth++;
388
+ if (ch === '}' || ch === ']' || ch === ')')
389
+ depth--;
390
+ }
391
+ if (depth <= 0 && lines[i].trimEnd().endsWith(';'))
392
+ return i + 1;
393
+ }
394
+ return startIndex + 1;
395
+ }
396
+ }
397
+ //# sourceMappingURL=self-scanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-scanner.js","sourceRoot":"","sources":["../../src/self-scanner/self-scanner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAkE/C,4DAA4D;AAE5D,MAAM,UAAU,uBAAuB,CAAC,EAAqB;IAC3D,EAAE,CAAC,IAAI,CAAC;;;;;;;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YACtD,CAAC;YACD,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,UAAU,GAAG,CAAC,CAAC;IACxB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timmeck/brain-core",
3
- "version": "2.31.2",
3
+ "version": "2.33.0",
4
4
  "description": "Shared core infrastructure for the Brain ecosystem — IPC, MCP, CLI, DB connection, and utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",