@soulcraft/brainy 3.19.0 → 3.19.1
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/CHANGELOG.md +2 -0
- package/bin/brainy.js +9 -2335
- package/dist/api/DataAPI.d.ts +1 -1
- package/dist/augmentations/cacheAugmentation.d.ts +1 -1
- package/dist/augmentations/metricsAugmentation.d.ts +20 -20
- package/dist/brainy.d.ts +1 -1
- package/dist/brainyData.js +1 -2
- package/dist/cli/catalog.js +8 -12
- package/dist/cli/commands/conversation.d.ts +22 -0
- package/dist/cli/commands/conversation.js +528 -0
- package/dist/cli/commands/core.js +61 -17
- package/dist/cli/commands/neural.js +4 -5
- package/dist/cli/commands/types.d.ts +30 -0
- package/dist/cli/commands/types.js +194 -0
- package/dist/cli/commands/utility.js +2 -3
- package/dist/cli/index.js +44 -2
- package/dist/cli/interactive.d.ts +3 -3
- package/dist/cli/interactive.js +5 -5
- package/dist/hnsw/hnswIndexOptimized.d.ts +1 -1
- package/dist/mcp/brainyMCPBroadcast.d.ts +2 -2
- package/dist/mcp/brainyMCPBroadcast.js +1 -1
- package/dist/mcp/brainyMCPClient.js +8 -4
- package/dist/neural/types.d.ts +2 -2
- package/dist/streaming/pipeline.d.ts +1 -1
- package/dist/universal/fs.d.ts +24 -66
- package/package.json +2 -2
package/dist/api/DataAPI.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare class DataAPI {
|
|
|
69
69
|
private getEntity;
|
|
70
70
|
private getRelation?;
|
|
71
71
|
private brain;
|
|
72
|
-
constructor(storage: StorageAdapter, getEntity: (id: string) => Promise<Entity | null>, getRelation?: (
|
|
72
|
+
constructor(storage: StorageAdapter, getEntity: (id: string) => Promise<Entity | null>, getRelation?: (id: string) => Promise<Relation | null>, brain?: any);
|
|
73
73
|
/**
|
|
74
74
|
* Create a backup of all data
|
|
75
75
|
*/
|
|
@@ -98,7 +98,7 @@ export declare class CacheAugmentation extends BaseAugmentation {
|
|
|
98
98
|
/**
|
|
99
99
|
* Get the underlying SearchCache instance (for compatibility)
|
|
100
100
|
*/
|
|
101
|
-
getSearchCache(): SearchCache<GraphNoun
|
|
101
|
+
getSearchCache(): SearchCache<GraphNoun>;
|
|
102
102
|
/**
|
|
103
103
|
* Get memory usage
|
|
104
104
|
*/
|
|
@@ -100,13 +100,13 @@ export declare class MetricsAugmentation extends BaseAugmentation {
|
|
|
100
100
|
p99Latency: number;
|
|
101
101
|
};
|
|
102
102
|
} | {
|
|
103
|
-
nounCount?: Record<string, number
|
|
104
|
-
verbCount?: Record<string, number
|
|
105
|
-
metadataCount?: Record<string, number
|
|
106
|
-
hnswIndexSize?: number
|
|
107
|
-
totalNodes?: number
|
|
108
|
-
totalEdges?: number
|
|
109
|
-
totalMetadata?: number
|
|
103
|
+
nounCount?: Record<string, number>;
|
|
104
|
+
verbCount?: Record<string, number>;
|
|
105
|
+
metadataCount?: Record<string, number>;
|
|
106
|
+
hnswIndexSize?: number;
|
|
107
|
+
totalNodes?: number;
|
|
108
|
+
totalEdges?: number;
|
|
109
|
+
totalMetadata?: number;
|
|
110
110
|
operations?: {
|
|
111
111
|
add: number;
|
|
112
112
|
search: number;
|
|
@@ -114,10 +114,10 @@ export declare class MetricsAugmentation extends BaseAugmentation {
|
|
|
114
114
|
update: number;
|
|
115
115
|
relate: number;
|
|
116
116
|
total: number;
|
|
117
|
-
}
|
|
118
|
-
fieldNames?: Record<string, string[]
|
|
119
|
-
standardFieldMappings?: Record<string, Record<string, string[]
|
|
120
|
-
contentTypes?: Record<string, number
|
|
117
|
+
};
|
|
118
|
+
fieldNames?: Record<string, string[]>;
|
|
119
|
+
standardFieldMappings?: Record<string, Record<string, string[]>>;
|
|
120
|
+
contentTypes?: Record<string, number>;
|
|
121
121
|
dataFreshness?: {
|
|
122
122
|
oldestEntry: string;
|
|
123
123
|
newestEntry: string;
|
|
@@ -129,32 +129,32 @@ export declare class MetricsAugmentation extends BaseAugmentation {
|
|
|
129
129
|
last30d: number;
|
|
130
130
|
older: number;
|
|
131
131
|
};
|
|
132
|
-
}
|
|
132
|
+
};
|
|
133
133
|
storageMetrics?: {
|
|
134
134
|
totalSizeBytes: number;
|
|
135
135
|
nounsSizeBytes: number;
|
|
136
136
|
verbsSizeBytes: number;
|
|
137
137
|
metadataSizeBytes: number;
|
|
138
138
|
indexSizeBytes: number;
|
|
139
|
-
}
|
|
139
|
+
};
|
|
140
140
|
searchMetrics?: {
|
|
141
141
|
totalSearches: number;
|
|
142
142
|
averageSearchTimeMs: number;
|
|
143
143
|
searchesLastHour: number;
|
|
144
144
|
searchesLastDay: number;
|
|
145
145
|
topSearchTerms?: string[];
|
|
146
|
-
}
|
|
146
|
+
};
|
|
147
147
|
verbStatistics?: {
|
|
148
148
|
totalVerbs: number;
|
|
149
149
|
verbTypes: Record<string, number>;
|
|
150
150
|
averageConnectionsPerVerb: number;
|
|
151
|
-
}
|
|
151
|
+
};
|
|
152
152
|
serviceActivity?: Record<string, {
|
|
153
153
|
firstActivity: string;
|
|
154
154
|
lastActivity: string;
|
|
155
155
|
totalOperations: number;
|
|
156
|
-
}
|
|
157
|
-
services?: import("../coreTypes.js").ServiceStatistics[]
|
|
156
|
+
}>;
|
|
157
|
+
services?: import("../coreTypes.js").ServiceStatistics[];
|
|
158
158
|
throttlingMetrics?: {
|
|
159
159
|
storage?: {
|
|
160
160
|
currentlyThrottled: boolean;
|
|
@@ -177,9 +177,9 @@ export declare class MetricsAugmentation extends BaseAugmentation {
|
|
|
177
177
|
lastThrottle: string;
|
|
178
178
|
status: "normal" | "throttled" | "recovering";
|
|
179
179
|
}>;
|
|
180
|
-
}
|
|
181
|
-
lastUpdated?: string
|
|
182
|
-
distributedConfig?: import("../types/distributedTypes.js").SharedConfig
|
|
180
|
+
};
|
|
181
|
+
lastUpdated?: string;
|
|
182
|
+
distributedConfig?: import("../types/distributedTypes.js").SharedConfig;
|
|
183
183
|
enabled: boolean;
|
|
184
184
|
note: string;
|
|
185
185
|
totalSearches?: undefined;
|
package/dist/brainy.d.ts
CHANGED
|
@@ -824,7 +824,7 @@ export declare class Brainy<T = any> implements BrainyInterface<T> {
|
|
|
824
824
|
*/
|
|
825
825
|
get augmentations(): {
|
|
826
826
|
list: () => string[];
|
|
827
|
-
get: (name: string) => import("./augmentations/brainyAugmentation.js").BrainyAugmentation
|
|
827
|
+
get: (name: string) => import("./augmentations/brainyAugmentation.js").BrainyAugmentation;
|
|
828
828
|
has: (name: string) => boolean;
|
|
829
829
|
};
|
|
830
830
|
/**
|
package/dist/brainyData.js
CHANGED
|
@@ -20,7 +20,6 @@ import { DistributedConfigManager, HashPartitioner, OperationalModeFactory, Doma
|
|
|
20
20
|
import { CacheAutoConfigurator } from './utils/cacheAutoConfig.js';
|
|
21
21
|
import { RequestDeduplicator } from './utils/requestDeduplicator.js';
|
|
22
22
|
import { AugmentationRegistry } from './augmentations/brainyAugmentation.js';
|
|
23
|
-
import { WALAugmentation } from './augmentations/walAugmentation.js';
|
|
24
23
|
import { RequestDeduplicatorAugmentation } from './augmentations/requestDeduplicatorAugmentation.js';
|
|
25
24
|
import { ConnectionPoolAugmentation } from './augmentations/connectionPoolAugmentation.js';
|
|
26
25
|
import { BatchProcessingAugmentation } from './augmentations/batchProcessingAugmentation.js';
|
|
@@ -310,7 +309,7 @@ export class BrainyData {
|
|
|
310
309
|
// Priority 100: Critical system operations
|
|
311
310
|
// Disable WAL in test environments to avoid directory creation issues
|
|
312
311
|
const isTestEnvironment = process.env.NODE_ENV === 'test' || process.env.VITEST === 'true';
|
|
313
|
-
|
|
312
|
+
// this.augmentations.register(new WALAugmentation({ enabled: !isTestEnvironment }));
|
|
314
313
|
this.augmentations.register(new ConnectionPoolAugmentation());
|
|
315
314
|
// Priority 95: Entity registry for fast external-ID to UUID mapping
|
|
316
315
|
this.augmentations.register(new EntityRegistryAugmentation({
|
package/dist/cli/catalog.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Local catalog with caching support
|
|
6
6
|
*/
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
-
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
|
9
|
-
import { join } from 'path';
|
|
10
|
-
import { homedir } from 'os';
|
|
8
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import { homedir } from 'node:os';
|
|
11
11
|
const CATALOG_API = process.env.BRAINY_CATALOG_URL || null;
|
|
12
12
|
const CACHE_PATH = join(homedir(), '.brainy', 'catalog-cache.json');
|
|
13
13
|
const CACHE_TTL = 24 * 60 * 60 * 1000; // 24 hours
|
|
@@ -237,7 +237,7 @@ function saveCache(catalog) {
|
|
|
237
237
|
try {
|
|
238
238
|
const dir = join(homedir(), '.brainy');
|
|
239
239
|
if (!existsSync(dir)) {
|
|
240
|
-
|
|
240
|
+
mkdirSync(dir, { recursive: true });
|
|
241
241
|
}
|
|
242
242
|
writeFileSync(CACHE_PATH, JSON.stringify({
|
|
243
243
|
catalog,
|
|
@@ -293,7 +293,10 @@ function readLicenseFile() {
|
|
|
293
293
|
return readFileSync(licensePath, 'utf8').trim();
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
catch {
|
|
296
|
+
catch (error) {
|
|
297
|
+
// License file read failed, return null
|
|
298
|
+
console.debug('Failed to read license file:', error);
|
|
299
|
+
}
|
|
297
300
|
return null;
|
|
298
301
|
}
|
|
299
302
|
function getDefaultCatalog() {
|
|
@@ -330,13 +333,6 @@ function getDefaultCatalog() {
|
|
|
330
333
|
description: 'Smart relationship scoring with taxonomy understanding',
|
|
331
334
|
status: 'available'
|
|
332
335
|
},
|
|
333
|
-
{
|
|
334
|
-
id: 'wal-augmentation',
|
|
335
|
-
name: 'WAL-based Augmentation',
|
|
336
|
-
category: 'enterprise',
|
|
337
|
-
description: 'Write-ahead log for reliable augmentation processing',
|
|
338
|
-
status: 'available'
|
|
339
|
-
},
|
|
340
336
|
{
|
|
341
337
|
id: 'connection-pooling',
|
|
342
338
|
name: 'Connection Pooling',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 💬 Conversation CLI Commands
|
|
3
|
+
*
|
|
4
|
+
* CLI interface for infinite agent memory and conversation management
|
|
5
|
+
*/
|
|
6
|
+
interface CommandArguments {
|
|
7
|
+
action?: string;
|
|
8
|
+
conversationId?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
role?: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
format?: string;
|
|
13
|
+
output?: string;
|
|
14
|
+
_: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare const conversationCommand: {
|
|
17
|
+
command: string;
|
|
18
|
+
describe: string;
|
|
19
|
+
builder: (yargs: any) => any;
|
|
20
|
+
handler: (argv: CommandArguments) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export default conversationCommand;
|