@soulcraft/brainy 0.41.0 → 0.44.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 +605 -194
- package/dist/augmentationFactory.d.ts.map +1 -0
- package/dist/augmentationFactory.js +342 -0
- package/dist/augmentationFactory.js.map +1 -0
- package/dist/augmentationPipeline.d.ts.map +1 -0
- package/dist/augmentationPipeline.js +472 -0
- package/dist/augmentationPipeline.js.map +1 -0
- package/dist/augmentationRegistry.d.ts.map +1 -0
- package/dist/augmentationRegistry.js +105 -0
- package/dist/augmentationRegistry.js.map +1 -0
- package/dist/augmentationRegistryLoader.d.ts.map +1 -0
- package/dist/augmentationRegistryLoader.js +213 -0
- package/dist/augmentationRegistryLoader.js.map +1 -0
- package/dist/augmentations/conduitAugmentations.js +1158 -0
- package/dist/augmentations/conduitAugmentations.js.map +1 -0
- package/dist/augmentations/memoryAugmentations.d.ts +2 -0
- package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
- package/dist/augmentations/memoryAugmentations.js +270 -0
- package/dist/augmentations/memoryAugmentations.js.map +1 -0
- package/dist/augmentations/serverSearchAugmentations.js +531 -0
- package/dist/augmentations/serverSearchAugmentations.js.map +1 -0
- package/dist/brainyData.d.ts.map +1 -0
- package/dist/brainyData.js +3999 -0
- package/dist/brainyData.js.map +1 -0
- package/dist/browserFramework.d.ts +15 -0
- package/dist/browserFramework.d.ts.map +1 -0
- package/dist/browserFramework.js +31 -0
- package/dist/browserFramework.js.map +1 -0
- package/dist/coreTypes.d.ts.map +1 -0
- package/dist/coreTypes.js +5 -0
- package/dist/coreTypes.js.map +1 -0
- package/dist/demo.d.ts +106 -0
- package/dist/demo.d.ts.map +1 -0
- package/dist/demo.js +201 -0
- package/dist/demo.js.map +1 -0
- package/dist/distributed/configManager.d.ts.map +1 -0
- package/dist/distributed/configManager.js +322 -0
- package/dist/distributed/configManager.js.map +1 -0
- package/dist/distributed/domainDetector.d.ts.map +1 -0
- package/dist/distributed/domainDetector.js +307 -0
- package/dist/distributed/domainDetector.js.map +1 -0
- package/dist/distributed/hashPartitioner.d.ts.map +1 -0
- package/dist/distributed/hashPartitioner.js +146 -0
- package/dist/distributed/hashPartitioner.js.map +1 -0
- package/dist/distributed/healthMonitor.d.ts.map +1 -0
- package/dist/distributed/healthMonitor.js +244 -0
- package/dist/distributed/healthMonitor.js.map +1 -0
- package/dist/distributed/index.d.ts.map +1 -0
- package/dist/distributed/index.js +9 -0
- package/dist/distributed/index.js.map +1 -0
- package/dist/distributed/operationalModes.d.ts.map +1 -0
- package/dist/distributed/operationalModes.js +201 -0
- package/dist/distributed/operationalModes.js.map +1 -0
- package/dist/errors/brainyError.d.ts.map +1 -0
- package/dist/errors/brainyError.js +113 -0
- package/dist/errors/brainyError.js.map +1 -0
- package/dist/examples/basicUsage.js +118 -0
- package/dist/examples/basicUsage.js.map +1 -0
- package/dist/hnsw/distributedSearch.js +452 -0
- package/dist/hnsw/distributedSearch.js.map +1 -0
- package/dist/hnsw/hnswIndex.js +602 -0
- package/dist/hnsw/hnswIndex.js.map +1 -0
- package/dist/hnsw/hnswIndexOptimized.js +471 -0
- package/dist/hnsw/hnswIndexOptimized.js.map +1 -0
- package/dist/hnsw/optimizedHNSWIndex.js +313 -0
- package/dist/hnsw/optimizedHNSWIndex.js.map +1 -0
- package/dist/hnsw/partitionedHNSWIndex.js +304 -0
- package/dist/hnsw/partitionedHNSWIndex.js.map +1 -0
- package/dist/hnsw/scaledHNSWSystem.js +559 -0
- package/dist/hnsw/scaledHNSWSystem.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/brainyMCPAdapter.js +142 -0
- package/dist/mcp/brainyMCPAdapter.js.map +1 -0
- package/dist/mcp/brainyMCPService.js +248 -0
- package/dist/mcp/brainyMCPService.js.map +1 -0
- package/dist/mcp/index.js +17 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/mcpAugmentationToolset.js +180 -0
- package/dist/mcp/mcpAugmentationToolset.js.map +1 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +590 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/sequentialPipeline.d.ts.map +1 -0
- package/dist/sequentialPipeline.js +417 -0
- package/dist/sequentialPipeline.js.map +1 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +46 -0
- package/dist/setup.js.map +1 -0
- package/dist/storage/adapters/baseStorageAdapter.js +349 -0
- package/dist/storage/adapters/baseStorageAdapter.js.map +1 -0
- package/dist/storage/adapters/batchS3Operations.js +287 -0
- package/dist/storage/adapters/batchS3Operations.js.map +1 -0
- package/dist/storage/adapters/fileSystemStorage.js +846 -0
- package/dist/storage/adapters/fileSystemStorage.js.map +1 -0
- package/dist/storage/adapters/memoryStorage.js +532 -0
- package/dist/storage/adapters/memoryStorage.js.map +1 -0
- package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
- package/dist/storage/adapters/opfsStorage.js +1118 -0
- package/dist/storage/adapters/opfsStorage.js.map +1 -0
- package/dist/storage/adapters/optimizedS3Search.js +248 -0
- package/dist/storage/adapters/optimizedS3Search.js.map +1 -0
- package/dist/storage/adapters/s3CompatibleStorage.js +2026 -0
- package/dist/storage/adapters/s3CompatibleStorage.js.map +1 -0
- package/dist/storage/baseStorage.js +603 -0
- package/dist/storage/baseStorage.js.map +1 -0
- package/dist/storage/cacheManager.js +1306 -0
- package/dist/storage/cacheManager.js.map +1 -0
- package/dist/storage/enhancedCacheManager.js +520 -0
- package/dist/storage/enhancedCacheManager.js.map +1 -0
- package/dist/storage/readOnlyOptimizations.js +425 -0
- package/dist/storage/readOnlyOptimizations.js.map +1 -0
- package/dist/storage/storageFactory.d.ts +0 -1
- package/dist/storage/storageFactory.d.ts.map +1 -1
- package/dist/storage/storageFactory.js +227 -0
- package/dist/storage/storageFactory.js.map +1 -0
- package/dist/types/augmentations.js +16 -0
- package/dist/types/augmentations.js.map +1 -0
- package/dist/types/brainyDataInterface.js +8 -0
- package/dist/types/brainyDataInterface.js.map +1 -0
- package/dist/types/distributedTypes.js +6 -0
- package/dist/types/distributedTypes.js.map +1 -0
- package/dist/types/fileSystemTypes.js +8 -0
- package/dist/types/fileSystemTypes.js.map +1 -0
- package/dist/types/graphTypes.js +247 -0
- package/dist/types/graphTypes.js.map +1 -0
- package/dist/types/mcpTypes.js +22 -0
- package/dist/types/mcpTypes.js.map +1 -0
- package/dist/types/paginationTypes.js +5 -0
- package/dist/types/paginationTypes.js.map +1 -0
- package/dist/types/pipelineTypes.js +7 -0
- package/dist/types/pipelineTypes.js.map +1 -0
- package/dist/types/tensorflowTypes.js +6 -0
- package/dist/types/tensorflowTypes.js.map +1 -0
- package/dist/unified.d.ts.map +1 -0
- package/dist/unified.js +52 -128251
- package/dist/unified.js.map +1 -0
- package/dist/utils/autoConfiguration.js +341 -0
- package/dist/utils/autoConfiguration.js.map +1 -0
- package/dist/utils/cacheAutoConfig.js +261 -0
- package/dist/utils/cacheAutoConfig.js.map +1 -0
- package/dist/utils/crypto.js +45 -0
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/distance.js +239 -0
- package/dist/utils/distance.js.map +1 -0
- package/dist/utils/embedding.d.ts.map +1 -1
- package/dist/utils/embedding.js +702 -0
- package/dist/utils/embedding.js.map +1 -0
- package/dist/utils/environment.js +75 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/fieldNameTracking.js +90 -0
- package/dist/utils/fieldNameTracking.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/jsonProcessing.js +179 -0
- package/dist/utils/jsonProcessing.js.map +1 -0
- package/dist/utils/logger.js +129 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/operationUtils.js +126 -0
- package/dist/utils/operationUtils.js.map +1 -0
- package/dist/utils/robustModelLoader.d.ts +14 -0
- package/dist/utils/robustModelLoader.d.ts.map +1 -1
- package/dist/utils/robustModelLoader.js +537 -0
- package/dist/utils/robustModelLoader.js.map +1 -0
- package/dist/utils/searchCache.js +248 -0
- package/dist/utils/searchCache.js.map +1 -0
- package/dist/utils/statistics.js +25 -0
- package/dist/utils/statistics.js.map +1 -0
- package/dist/utils/statisticsCollector.js +224 -0
- package/dist/utils/statisticsCollector.js.map +1 -0
- package/dist/utils/textEncoding.js +309 -0
- package/dist/utils/textEncoding.js.map +1 -0
- package/dist/utils/typeUtils.js +40 -0
- package/dist/utils/typeUtils.js.map +1 -0
- package/dist/utils/version.d.ts +15 -3
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +24 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/utils/workerUtils.js +458 -0
- package/dist/utils/workerUtils.js.map +1 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +54 -0
- package/dist/worker.js.map +1 -0
- package/package.json +30 -29
- package/dist/brainy.js +0 -90220
- package/dist/brainy.min.js +0 -12511
- package/dist/patched-platform-node.d.ts +0 -17
- package/dist/statistics/statisticsManager.d.ts +0 -121
- package/dist/storage/fileSystemStorage.d.ts +0 -73
- package/dist/storage/fileSystemStorage.d.ts.map +0 -1
- package/dist/storage/opfsStorage.d.ts +0 -236
- package/dist/storage/opfsStorage.d.ts.map +0 -1
- package/dist/storage/s3CompatibleStorage.d.ts +0 -157
- package/dist/storage/s3CompatibleStorage.d.ts.map +0 -1
- package/dist/testing/prettyReporter.d.ts +0 -23
- package/dist/testing/prettySummaryReporter.d.ts +0 -22
- package/dist/unified.min.js +0 -16153
- package/dist/utils/environmentDetection.d.ts +0 -47
- package/dist/utils/environmentDetection.d.ts.map +0 -1
- package/dist/utils/tensorflowUtils.d.ts +0 -17
- package/dist/utils/tensorflowUtils.d.ts.map +0 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Factory
|
|
3
|
+
* Creates the appropriate storage adapter based on the environment and configuration
|
|
4
|
+
*/
|
|
5
|
+
import { MemoryStorage } from './adapters/memoryStorage.js';
|
|
6
|
+
import { OPFSStorage } from './adapters/opfsStorage.js';
|
|
7
|
+
import { S3CompatibleStorage, R2Storage } from './adapters/s3CompatibleStorage.js';
|
|
8
|
+
// FileSystemStorage is dynamically imported to avoid issues in browser environments
|
|
9
|
+
import { isBrowser } from '../utils/environment.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create a storage adapter based on the environment and configuration
|
|
12
|
+
* @param options Options for creating the storage adapter
|
|
13
|
+
* @returns Promise that resolves to a storage adapter
|
|
14
|
+
*/
|
|
15
|
+
export async function createStorage(options = {}) {
|
|
16
|
+
// If memory storage is forced, use it regardless of other options
|
|
17
|
+
if (options.forceMemoryStorage) {
|
|
18
|
+
console.log('Using memory storage (forced)');
|
|
19
|
+
return new MemoryStorage();
|
|
20
|
+
}
|
|
21
|
+
// If file system storage is forced, use it regardless of other options
|
|
22
|
+
if (options.forceFileSystemStorage) {
|
|
23
|
+
if (isBrowser()) {
|
|
24
|
+
console.warn('FileSystemStorage is not available in browser environments, falling back to memory storage');
|
|
25
|
+
return new MemoryStorage();
|
|
26
|
+
}
|
|
27
|
+
console.log('Using file system storage (forced)');
|
|
28
|
+
try {
|
|
29
|
+
const { FileSystemStorage } = await import('./adapters/fileSystemStorage.js');
|
|
30
|
+
return new FileSystemStorage(options.rootDirectory || './brainy-data');
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.warn('Failed to load FileSystemStorage, falling back to memory storage:', error);
|
|
34
|
+
return new MemoryStorage();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// If a specific storage type is specified, use it
|
|
38
|
+
if (options.type && options.type !== 'auto') {
|
|
39
|
+
switch (options.type) {
|
|
40
|
+
case 'memory':
|
|
41
|
+
console.log('Using memory storage');
|
|
42
|
+
return new MemoryStorage();
|
|
43
|
+
case 'opfs': {
|
|
44
|
+
// Check if OPFS is available
|
|
45
|
+
const opfsStorage = new OPFSStorage();
|
|
46
|
+
if (opfsStorage.isOPFSAvailable()) {
|
|
47
|
+
console.log('Using OPFS storage');
|
|
48
|
+
await opfsStorage.init();
|
|
49
|
+
// Request persistent storage if specified
|
|
50
|
+
if (options.requestPersistentStorage) {
|
|
51
|
+
const isPersistent = await opfsStorage.requestPersistentStorage();
|
|
52
|
+
console.log(`Persistent storage ${isPersistent ? 'granted' : 'denied'}`);
|
|
53
|
+
}
|
|
54
|
+
return opfsStorage;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.warn('OPFS storage is not available, falling back to memory storage');
|
|
58
|
+
return new MemoryStorage();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
case 'filesystem': {
|
|
62
|
+
if (isBrowser()) {
|
|
63
|
+
console.warn('FileSystemStorage is not available in browser environments, falling back to memory storage');
|
|
64
|
+
return new MemoryStorage();
|
|
65
|
+
}
|
|
66
|
+
console.log('Using file system storage');
|
|
67
|
+
try {
|
|
68
|
+
const { FileSystemStorage } = await import('./adapters/fileSystemStorage.js');
|
|
69
|
+
return new FileSystemStorage(options.rootDirectory || './brainy-data');
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.warn('Failed to load FileSystemStorage, falling back to memory storage:', error);
|
|
73
|
+
return new MemoryStorage();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
case 's3':
|
|
77
|
+
if (options.s3Storage) {
|
|
78
|
+
console.log('Using Amazon S3 storage');
|
|
79
|
+
return new S3CompatibleStorage({
|
|
80
|
+
bucketName: options.s3Storage.bucketName,
|
|
81
|
+
region: options.s3Storage.region,
|
|
82
|
+
accessKeyId: options.s3Storage.accessKeyId,
|
|
83
|
+
secretAccessKey: options.s3Storage.secretAccessKey,
|
|
84
|
+
sessionToken: options.s3Storage.sessionToken,
|
|
85
|
+
serviceType: 's3',
|
|
86
|
+
operationConfig: options.operationConfig,
|
|
87
|
+
cacheConfig: options.cacheConfig
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.warn('S3 storage configuration is missing, falling back to memory storage');
|
|
92
|
+
return new MemoryStorage();
|
|
93
|
+
}
|
|
94
|
+
case 'r2':
|
|
95
|
+
if (options.r2Storage) {
|
|
96
|
+
console.log('Using Cloudflare R2 storage');
|
|
97
|
+
return new R2Storage({
|
|
98
|
+
bucketName: options.r2Storage.bucketName,
|
|
99
|
+
accountId: options.r2Storage.accountId,
|
|
100
|
+
accessKeyId: options.r2Storage.accessKeyId,
|
|
101
|
+
secretAccessKey: options.r2Storage.secretAccessKey,
|
|
102
|
+
serviceType: 'r2',
|
|
103
|
+
cacheConfig: options.cacheConfig
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.warn('R2 storage configuration is missing, falling back to memory storage');
|
|
108
|
+
return new MemoryStorage();
|
|
109
|
+
}
|
|
110
|
+
case 'gcs':
|
|
111
|
+
if (options.gcsStorage) {
|
|
112
|
+
console.log('Using Google Cloud Storage');
|
|
113
|
+
return new S3CompatibleStorage({
|
|
114
|
+
bucketName: options.gcsStorage.bucketName,
|
|
115
|
+
region: options.gcsStorage.region,
|
|
116
|
+
endpoint: options.gcsStorage.endpoint || 'https://storage.googleapis.com',
|
|
117
|
+
accessKeyId: options.gcsStorage.accessKeyId,
|
|
118
|
+
secretAccessKey: options.gcsStorage.secretAccessKey,
|
|
119
|
+
serviceType: 'gcs',
|
|
120
|
+
cacheConfig: options.cacheConfig
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
console.warn('GCS storage configuration is missing, falling back to memory storage');
|
|
125
|
+
return new MemoryStorage();
|
|
126
|
+
}
|
|
127
|
+
default:
|
|
128
|
+
console.warn(`Unknown storage type: ${options.type}, falling back to memory storage`);
|
|
129
|
+
return new MemoryStorage();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// If custom S3-compatible storage is specified, use it
|
|
133
|
+
if (options.customS3Storage) {
|
|
134
|
+
console.log(`Using custom S3-compatible storage: ${options.customS3Storage.serviceType || 'custom'}`);
|
|
135
|
+
return new S3CompatibleStorage({
|
|
136
|
+
bucketName: options.customS3Storage.bucketName,
|
|
137
|
+
region: options.customS3Storage.region,
|
|
138
|
+
endpoint: options.customS3Storage.endpoint,
|
|
139
|
+
accessKeyId: options.customS3Storage.accessKeyId,
|
|
140
|
+
secretAccessKey: options.customS3Storage.secretAccessKey,
|
|
141
|
+
serviceType: options.customS3Storage.serviceType || 'custom',
|
|
142
|
+
cacheConfig: options.cacheConfig
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// If R2 storage is specified, use it
|
|
146
|
+
if (options.r2Storage) {
|
|
147
|
+
console.log('Using Cloudflare R2 storage');
|
|
148
|
+
return new R2Storage({
|
|
149
|
+
bucketName: options.r2Storage.bucketName,
|
|
150
|
+
accountId: options.r2Storage.accountId,
|
|
151
|
+
accessKeyId: options.r2Storage.accessKeyId,
|
|
152
|
+
secretAccessKey: options.r2Storage.secretAccessKey,
|
|
153
|
+
serviceType: 'r2',
|
|
154
|
+
cacheConfig: options.cacheConfig
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
// If S3 storage is specified, use it
|
|
158
|
+
if (options.s3Storage) {
|
|
159
|
+
console.log('Using Amazon S3 storage');
|
|
160
|
+
return new S3CompatibleStorage({
|
|
161
|
+
bucketName: options.s3Storage.bucketName,
|
|
162
|
+
region: options.s3Storage.region,
|
|
163
|
+
accessKeyId: options.s3Storage.accessKeyId,
|
|
164
|
+
secretAccessKey: options.s3Storage.secretAccessKey,
|
|
165
|
+
sessionToken: options.s3Storage.sessionToken,
|
|
166
|
+
serviceType: 's3',
|
|
167
|
+
cacheConfig: options.cacheConfig
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
// If GCS storage is specified, use it
|
|
171
|
+
if (options.gcsStorage) {
|
|
172
|
+
console.log('Using Google Cloud Storage');
|
|
173
|
+
return new S3CompatibleStorage({
|
|
174
|
+
bucketName: options.gcsStorage.bucketName,
|
|
175
|
+
region: options.gcsStorage.region,
|
|
176
|
+
endpoint: options.gcsStorage.endpoint || 'https://storage.googleapis.com',
|
|
177
|
+
accessKeyId: options.gcsStorage.accessKeyId,
|
|
178
|
+
secretAccessKey: options.gcsStorage.secretAccessKey,
|
|
179
|
+
serviceType: 'gcs',
|
|
180
|
+
cacheConfig: options.cacheConfig
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Auto-detect the best storage adapter based on the environment
|
|
184
|
+
// First, try OPFS (browser only)
|
|
185
|
+
const opfsStorage = new OPFSStorage();
|
|
186
|
+
if (opfsStorage.isOPFSAvailable()) {
|
|
187
|
+
console.log('Using OPFS storage (auto-detected)');
|
|
188
|
+
await opfsStorage.init();
|
|
189
|
+
// Request persistent storage if specified
|
|
190
|
+
if (options.requestPersistentStorage) {
|
|
191
|
+
const isPersistent = await opfsStorage.requestPersistentStorage();
|
|
192
|
+
console.log(`Persistent storage ${isPersistent ? 'granted' : 'denied'}`);
|
|
193
|
+
}
|
|
194
|
+
return opfsStorage;
|
|
195
|
+
}
|
|
196
|
+
// Next, try file system storage (Node.js only)
|
|
197
|
+
try {
|
|
198
|
+
// Check if we're in a Node.js environment
|
|
199
|
+
if (typeof process !== 'undefined' &&
|
|
200
|
+
process.versions &&
|
|
201
|
+
process.versions.node) {
|
|
202
|
+
console.log('Using file system storage (auto-detected)');
|
|
203
|
+
try {
|
|
204
|
+
const { FileSystemStorage } = await import('./adapters/fileSystemStorage.js');
|
|
205
|
+
return new FileSystemStorage(options.rootDirectory || './brainy-data');
|
|
206
|
+
}
|
|
207
|
+
catch (fsError) {
|
|
208
|
+
console.warn('Failed to load FileSystemStorage, falling back to memory storage:', fsError);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
// Not in a Node.js environment or file system is not available
|
|
214
|
+
console.warn('Not in a Node.js environment:', error);
|
|
215
|
+
}
|
|
216
|
+
// Finally, fall back to memory storage
|
|
217
|
+
console.log('Using memory storage (auto-detected)');
|
|
218
|
+
return new MemoryStorage();
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Export storage adapters
|
|
222
|
+
*/
|
|
223
|
+
export { MemoryStorage, OPFSStorage, S3CompatibleStorage, R2Storage };
|
|
224
|
+
// Export FileSystemStorage conditionally
|
|
225
|
+
// NOTE: FileSystemStorage is now only imported dynamically to avoid fs imports in browser builds
|
|
226
|
+
// export { FileSystemStorage } from './adapters/fileSystemStorage.js'
|
|
227
|
+
//# sourceMappingURL=storageFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storageFactory.js","sourceRoot":"","sources":["../../src/storage/storageFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EACL,mBAAmB,EACnB,SAAS,EACV,MAAM,mCAAmC,CAAA;AAC1C,oFAAoF;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAwNnD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAA0B,EAAE;IAE5B,kEAAkE;IAClE,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAA;QAC5C,OAAO,IAAI,aAAa,EAAE,CAAA;IAC5B,CAAC;IAED,uEAAuE;IACvE,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACnC,IAAI,SAAS,EAAE,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CACV,4FAA4F,CAC7F,CAAA;YACD,OAAO,IAAI,aAAa,EAAE,CAAA;QAC5B,CAAC;QACD,OAAO,CA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AE,CAAC,CAAA;QAC1E,CAAC;QAED,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,+CAA+C;IAC/C,IAAI,CAAC;QACH,0CAA0C;QAC1C,IACE,OAAO,OAAO,KAAK,WAAW;YAC9B,OAAO,CAAC,QAAQ;YAChB,OAAO,CAAC,QAAQ,CAAC,IAAI,EACrB,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAA;YACxD,IAAI,CAAC;gBACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CACxC,iCAAiC,CAClC,CAAA;gBACD,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,aAAa,IAAI,eAAe,CAAC,CAAA;YACxE,CAAC;YAAC,OAAO,OAAO,EAAE,CAAC;gBACjB,OAAO,CAAC,IAAI,CACV,mEAAmE,EACnE,OAAO,CACR,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+DAA+D;QAC/D,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,uCAAuC;IACvC,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAA;IACnD,OAAO,IAAI,aAAa,EAAE,CAAA;AAC5B,CAAC;AAED;;GAEG;AACH,OAAO,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,SAAS,EACV,CAAA;AAED,yCAAyC;AACzC,iGAAiG;AACjG,sEAAsE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Common types for the augmentation system */
|
|
2
|
+
/**
|
|
3
|
+
* Enum representing all types of augmentations available in the Brainy system.
|
|
4
|
+
*/
|
|
5
|
+
export var AugmentationType;
|
|
6
|
+
(function (AugmentationType) {
|
|
7
|
+
AugmentationType["SENSE"] = "sense";
|
|
8
|
+
AugmentationType["CONDUIT"] = "conduit";
|
|
9
|
+
AugmentationType["COGNITION"] = "cognition";
|
|
10
|
+
AugmentationType["MEMORY"] = "memory";
|
|
11
|
+
AugmentationType["PERCEPTION"] = "perception";
|
|
12
|
+
AugmentationType["DIALOG"] = "dialog";
|
|
13
|
+
AugmentationType["ACTIVATION"] = "activation";
|
|
14
|
+
AugmentationType["WEBSOCKET"] = "webSocket";
|
|
15
|
+
})(AugmentationType || (AugmentationType = {}));
|
|
16
|
+
//# sourceMappingURL=augmentations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augmentations.js","sourceRoot":"","sources":["../../src/types/augmentations.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C;;GAEG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;IACjB,6CAAyB,CAAA;IACzB,qCAAiB,CAAA;IACjB,6CAAyB,CAAA;IACzB,2CAAuB,CAAA;AACzB,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BrainyDataInterface
|
|
3
|
+
*
|
|
4
|
+
* This interface defines the methods from BrainyData that are used by serverSearchAugmentations.ts.
|
|
5
|
+
* It's used to break the circular dependency between brainyData.ts and serverSearchAugmentations.ts.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=brainyDataInterface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainyDataInterface.js","sourceRoot":"","sources":["../../src/types/brainyDataInterface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distributedTypes.js","sourceRoot":"","sources":["../../src/types/distributedTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for the File System Access API
|
|
3
|
+
* Extends the FileSystemDirectoryHandle interface to include the [Symbol.asyncIterator] method
|
|
4
|
+
* and FileSystemHandle to include getFile() method for TypeScript compatibility
|
|
5
|
+
*/
|
|
6
|
+
// Export something to make this a module
|
|
7
|
+
export const fileSystemTypesLoaded = true;
|
|
8
|
+
//# sourceMappingURL=fileSystemTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileSystemTypes.js","sourceRoot":"","sources":["../../src/types/fileSystemTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,yCAAyC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Types - Standardized Noun and Verb Type System
|
|
3
|
+
*
|
|
4
|
+
* This module defines a comprehensive, standardized set of noun and verb types
|
|
5
|
+
* that can be used to model any kind of graph, semantic network, or data model.
|
|
6
|
+
*
|
|
7
|
+
* ## Purpose and Design Philosophy
|
|
8
|
+
*
|
|
9
|
+
* The type system is designed to be:
|
|
10
|
+
* - **Universal**: Capable of representing any domain or use case
|
|
11
|
+
* - **Hierarchical**: Organized into logical categories for easy navigation
|
|
12
|
+
* - **Extensible**: Additional metadata can be attached to any entity or relationship
|
|
13
|
+
* - **Semantic**: Types carry meaning that can be used for reasoning and inference
|
|
14
|
+
*
|
|
15
|
+
* ## Noun Types (Entities)
|
|
16
|
+
*
|
|
17
|
+
* Noun types represent entities in the graph and are organized into categories:
|
|
18
|
+
*
|
|
19
|
+
* ### Core Entity Types
|
|
20
|
+
* - **Person**: Human entities and individuals
|
|
21
|
+
* - **Organization**: Formal organizations, companies, institutions
|
|
22
|
+
* - **Location**: Geographic locations, places, addresses
|
|
23
|
+
* - **Thing**: Physical objects and tangible items
|
|
24
|
+
* - **Concept**: Abstract ideas, concepts, and intangible entities
|
|
25
|
+
* - **Event**: Occurrences with time and place dimensions
|
|
26
|
+
*
|
|
27
|
+
* ### Digital/Content Types
|
|
28
|
+
* - **Document**: Text-based files and documents
|
|
29
|
+
* - **Media**: Non-text media files (images, videos, audio)
|
|
30
|
+
* - **File**: Generic digital files
|
|
31
|
+
* - **Message**: Communication content
|
|
32
|
+
* - **Content**: Generic content that doesn't fit other categories
|
|
33
|
+
*
|
|
34
|
+
* ### Collection Types
|
|
35
|
+
* - **Collection**: Generic groupings of items
|
|
36
|
+
* - **Dataset**: Structured collections of data
|
|
37
|
+
*
|
|
38
|
+
* ### Business/Application Types
|
|
39
|
+
* - **Product**: Commercial products and offerings
|
|
40
|
+
* - **Service**: Services and offerings
|
|
41
|
+
* - **User**: User accounts and profiles
|
|
42
|
+
* - **Task**: Actions, todos, and workflow items
|
|
43
|
+
* - **Project**: Organized initiatives with goals and timelines
|
|
44
|
+
*
|
|
45
|
+
* ### Descriptive Types
|
|
46
|
+
* - **Process**: Workflows, procedures, and sequences
|
|
47
|
+
* - **State**: States, conditions, or statuses
|
|
48
|
+
* - **Role**: Roles, positions, or responsibilities
|
|
49
|
+
* - **Topic**: Subjects or themes
|
|
50
|
+
* - **Language**: Languages or linguistic entities
|
|
51
|
+
* - **Currency**: Currencies and monetary units
|
|
52
|
+
* - **Measurement**: Measurements, metrics, or quantities
|
|
53
|
+
*
|
|
54
|
+
* ## Verb Types (Relationships)
|
|
55
|
+
*
|
|
56
|
+
* Verb types represent relationships between entities and are organized into categories:
|
|
57
|
+
*
|
|
58
|
+
* ### Core Relationship Types
|
|
59
|
+
* - **RelatedTo**: Generic relationship (default fallback)
|
|
60
|
+
* - **Contains**: Containment relationship
|
|
61
|
+
* - **PartOf**: Part-whole relationship
|
|
62
|
+
* - **LocatedAt**: Spatial relationship
|
|
63
|
+
* - **References**: Reference or citation relationship
|
|
64
|
+
*
|
|
65
|
+
* ### Temporal/Causal Types
|
|
66
|
+
* - **Precedes/Succeeds**: Temporal sequence relationships
|
|
67
|
+
* - **Causes**: Causal relationships
|
|
68
|
+
* - **DependsOn**: Dependency relationships
|
|
69
|
+
* - **Requires**: Necessity relationships
|
|
70
|
+
*
|
|
71
|
+
* ### Creation/Transformation Types
|
|
72
|
+
* - **Creates**: Creation relationships
|
|
73
|
+
* - **Transforms**: Transformation relationships
|
|
74
|
+
* - **Becomes**: State change relationships
|
|
75
|
+
* - **Modifies**: Modification relationships
|
|
76
|
+
* - **Consumes**: Consumption relationships
|
|
77
|
+
*
|
|
78
|
+
* ### Ownership/Attribution Types
|
|
79
|
+
* - **Owns**: Ownership relationships
|
|
80
|
+
* - **AttributedTo**: Attribution or authorship
|
|
81
|
+
* - **CreatedBy**: Creation attribution
|
|
82
|
+
* - **BelongsTo**: Belonging relationships
|
|
83
|
+
*
|
|
84
|
+
* ### Social/Organizational Types
|
|
85
|
+
* - **MemberOf**: Membership or affiliation
|
|
86
|
+
* - **WorksWith**: Professional relationships
|
|
87
|
+
* - **FriendOf**: Friendship relationships
|
|
88
|
+
* - **Follows**: Following relationships
|
|
89
|
+
* - **Likes**: Liking relationships
|
|
90
|
+
* - **ReportsTo**: Reporting relationships
|
|
91
|
+
* - **Supervises**: Supervisory relationships
|
|
92
|
+
* - **Mentors**: Mentorship relationships
|
|
93
|
+
* - **Communicates**: Communication relationships
|
|
94
|
+
*
|
|
95
|
+
* ### Descriptive/Functional Types
|
|
96
|
+
* - **Describes**: Descriptive relationships
|
|
97
|
+
* - **Defines**: Definition relationships
|
|
98
|
+
* - **Categorizes**: Categorization relationships
|
|
99
|
+
* - **Measures**: Measurement relationships
|
|
100
|
+
* - **Evaluates**: Evaluation or assessment relationships
|
|
101
|
+
* - **Uses**: Utilization relationships
|
|
102
|
+
* - **Implements**: Implementation relationships
|
|
103
|
+
* - **Extends**: Extension relationships
|
|
104
|
+
*
|
|
105
|
+
* ## Usage with Additional Metadata
|
|
106
|
+
*
|
|
107
|
+
* While the type system provides a standardized vocabulary, additional metadata
|
|
108
|
+
* can be attached to any entity or relationship to capture domain-specific
|
|
109
|
+
* information:
|
|
110
|
+
*
|
|
111
|
+
* ```typescript
|
|
112
|
+
* const person: GraphNoun = {
|
|
113
|
+
* id: 'person-123',
|
|
114
|
+
* noun: NounType.Person,
|
|
115
|
+
* data: {
|
|
116
|
+
* name: 'John Doe',
|
|
117
|
+
* age: 30,
|
|
118
|
+
* profession: 'Engineer'
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
*
|
|
122
|
+
* const worksFor: GraphVerb = {
|
|
123
|
+
* id: 'verb-456',
|
|
124
|
+
* source: 'person-123',
|
|
125
|
+
* target: 'org-789',
|
|
126
|
+
* verb: VerbType.MemberOf,
|
|
127
|
+
* data: {
|
|
128
|
+
* role: 'Senior Engineer',
|
|
129
|
+
* startDate: '2020-01-01',
|
|
130
|
+
* department: 'Engineering'
|
|
131
|
+
* }
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* ## Modeling Different Graph Types
|
|
136
|
+
*
|
|
137
|
+
* This type system can model various graph structures:
|
|
138
|
+
*
|
|
139
|
+
* ### Knowledge Graphs
|
|
140
|
+
* Use Person, Organization, Location, Concept entities with semantic relationships
|
|
141
|
+
* like AttributedTo, LocatedAt, RelatedTo
|
|
142
|
+
*
|
|
143
|
+
* ### Social Networks
|
|
144
|
+
* Use Person, User entities with social relationships like FriendOf, Follows,
|
|
145
|
+
* WorksWith, Communicates
|
|
146
|
+
*
|
|
147
|
+
* ### Content Networks
|
|
148
|
+
* Use Document, Media, Content entities with relationships like References,
|
|
149
|
+
* CreatedBy, Contains, Categorizes
|
|
150
|
+
*
|
|
151
|
+
* ### Business Process Models
|
|
152
|
+
* Use Task, Process, Role entities with relationships like Precedes, Requires,
|
|
153
|
+
* DependsOn, Transforms
|
|
154
|
+
*
|
|
155
|
+
* ### Organizational Charts
|
|
156
|
+
* Use Person, Role, Organization entities with relationships like ReportsTo,
|
|
157
|
+
* Supervises, MemberOf
|
|
158
|
+
*
|
|
159
|
+
* The flexibility of this system allows it to represent any domain while
|
|
160
|
+
* maintaining semantic consistency and enabling powerful graph operations
|
|
161
|
+
* and reasoning capabilities.
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* Defines valid noun types for graph entities
|
|
165
|
+
* Used for categorizing different types of nodes
|
|
166
|
+
*/
|
|
167
|
+
export const NounType = {
|
|
168
|
+
// Core Entity Types
|
|
169
|
+
Person: 'person', // Human entities
|
|
170
|
+
Organization: 'organization', // Formal organizations (companies, institutions, etc.)
|
|
171
|
+
Location: 'location', // Geographic locations (merges previous Place and Location)
|
|
172
|
+
Thing: 'thing', // Physical objects
|
|
173
|
+
Concept: 'concept', // Abstract ideas, concepts, and intangible entities
|
|
174
|
+
Event: 'event', // Occurrences with time and place
|
|
175
|
+
// Digital/Content Types
|
|
176
|
+
Document: 'document', // Text-based files and documents (reports, articles, etc.)
|
|
177
|
+
Media: 'media', // Non-text media files (images, videos, audio)
|
|
178
|
+
File: 'file', // Generic digital files (merges aspects of Digital with file-specific focus)
|
|
179
|
+
Message: 'message', // Communication content (emails, chat messages, posts)
|
|
180
|
+
Content: 'content', // Generic content that doesn't fit other categories
|
|
181
|
+
// Collection Types
|
|
182
|
+
Collection: 'collection', // Generic grouping of items (merges Group, List, and Category)
|
|
183
|
+
Dataset: 'dataset', // Structured collections of data
|
|
184
|
+
// Business/Application Types
|
|
185
|
+
Product: 'product', // Commercial products and offerings
|
|
186
|
+
Service: 'service', // Services and offerings
|
|
187
|
+
User: 'user', // User accounts and profiles
|
|
188
|
+
Task: 'task', // Actions, todos, and workflow items
|
|
189
|
+
Project: 'project', // Organized initiatives with goals and timelines
|
|
190
|
+
// Descriptive Types
|
|
191
|
+
Process: 'process', // Workflows, procedures, and sequences
|
|
192
|
+
State: 'state', // States, conditions, or statuses
|
|
193
|
+
Role: 'role', // Roles, positions, or responsibilities
|
|
194
|
+
Topic: 'topic', // Subjects or themes
|
|
195
|
+
Language: 'language', // Languages or linguistic entities
|
|
196
|
+
Currency: 'currency', // Currencies and monetary units
|
|
197
|
+
Measurement: 'measurement' // Measurements, metrics, or quantities
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Defines valid verb types for relationships
|
|
201
|
+
* Used for categorizing different types of connections
|
|
202
|
+
*/
|
|
203
|
+
export const VerbType = {
|
|
204
|
+
// Core Relationship Types
|
|
205
|
+
RelatedTo: 'relatedTo', // Generic relationship (default fallback)
|
|
206
|
+
Contains: 'contains', // Containment relationship (parent contains child)
|
|
207
|
+
PartOf: 'partOf', // Part-whole relationship (child is part of parent)
|
|
208
|
+
LocatedAt: 'locatedAt', // Spatial relationship
|
|
209
|
+
References: 'references', // Reference or citation relationship
|
|
210
|
+
// Temporal/Causal Types
|
|
211
|
+
Precedes: 'precedes', // Temporal sequence (comes before)
|
|
212
|
+
Succeeds: 'succeeds', // Temporal sequence (comes after)
|
|
213
|
+
Causes: 'causes', // Causal relationship (merges Influences and Causes)
|
|
214
|
+
DependsOn: 'dependsOn', // Dependency relationship
|
|
215
|
+
Requires: 'requires', // Necessity relationship (new)
|
|
216
|
+
// Creation/Transformation Types
|
|
217
|
+
Creates: 'creates', // Creation relationship (merges Created and Produces)
|
|
218
|
+
Transforms: 'transforms', // Transformation relationship
|
|
219
|
+
Becomes: 'becomes', // State change relationship
|
|
220
|
+
Modifies: 'modifies', // Modification relationship
|
|
221
|
+
Consumes: 'consumes', // Consumption relationship
|
|
222
|
+
// Ownership/Attribution Types
|
|
223
|
+
Owns: 'owns', // Ownership relationship (merges Controls and Owns)
|
|
224
|
+
AttributedTo: 'attributedTo', // Attribution or authorship
|
|
225
|
+
CreatedBy: 'createdBy', // Creation attribution (new, distinct from Creates)
|
|
226
|
+
BelongsTo: 'belongsTo', // Belonging relationship (new)
|
|
227
|
+
// Social/Organizational Types
|
|
228
|
+
MemberOf: 'memberOf', // Membership or affiliation
|
|
229
|
+
WorksWith: 'worksWith', // Professional relationship
|
|
230
|
+
FriendOf: 'friendOf', // Friendship relationship
|
|
231
|
+
Follows: 'follows', // Following relationship
|
|
232
|
+
Likes: 'likes', // Liking relationship
|
|
233
|
+
ReportsTo: 'reportsTo', // Reporting relationship
|
|
234
|
+
Supervises: 'supervises', // Supervisory relationship
|
|
235
|
+
Mentors: 'mentors', // Mentorship relationship
|
|
236
|
+
Communicates: 'communicates', // Communication relationship (merges Communicates and Collaborates)
|
|
237
|
+
// Descriptive/Functional Types
|
|
238
|
+
Describes: 'describes', // Descriptive relationship
|
|
239
|
+
Defines: 'defines', // Definition relationship
|
|
240
|
+
Categorizes: 'categorizes', // Categorization relationship
|
|
241
|
+
Measures: 'measures', // Measurement relationship
|
|
242
|
+
Evaluates: 'evaluates', // Evaluation or assessment relationship
|
|
243
|
+
Uses: 'uses', // Utilization relationship (new)
|
|
244
|
+
Implements: 'implements', // Implementation relationship
|
|
245
|
+
Extends: 'extends' // Extension relationship (merges Extends and Inherits)
|
|
246
|
+
};
|
|
247
|
+
//# sourceMappingURL=graphTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphTypes.js","sourceRoot":"","sources":["../../src/types/graphTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiKG;AAsLH;;;GAGG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,oBAAoB;IACpB,MAAM,EAAE,QAAQ,EAAE,iBAAiB;IACnC,YAAY,EAAE,cAAc,EAAE,uDAAuD;IACrF,QAAQ,EAAE,UAAU,EAAE,4DAA4D;IAClF,KAAK,EAAE,OAAO,EAAE,mBAAmB;IACnC,OAAO,EAAE,SAAS,EAAE,oDAAoD;IACxE,KAAK,EAAE,OAAO,EAAE,kCAAkC;IAElD,wBAAwB;IACxB,QAAQ,EAAE,UAAU,EAAE,2DAA2D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)
|
|
5
|
+
* implementation in Brainy. MCP allows external models to access Brainy data and
|
|
6
|
+
* use the augmentation pipeline as tools.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* MCP version information
|
|
10
|
+
*/
|
|
11
|
+
export const MCP_VERSION = '1.0.0';
|
|
12
|
+
/**
|
|
13
|
+
* MCP request types
|
|
14
|
+
*/
|
|
15
|
+
export var MCPRequestType;
|
|
16
|
+
(function (MCPRequestType) {
|
|
17
|
+
MCPRequestType["DATA_ACCESS"] = "data_access";
|
|
18
|
+
MCPRequestType["TOOL_EXECUTION"] = "tool_execution";
|
|
19
|
+
MCPRequestType["SYSTEM_INFO"] = "system_info";
|
|
20
|
+
MCPRequestType["AUTHENTICATION"] = "authentication";
|
|
21
|
+
})(MCPRequestType || (MCPRequestType = {}));
|
|
22
|
+
//# sourceMappingURL=mcpTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpTypes.js","sourceRoot":"","sources":["../../src/types/mcpTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAA;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,mDAAiC,CAAA;IACjC,6CAA2B,CAAA;IAC3B,mDAAiC,CAAA;AACnC,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginationTypes.js","sourceRoot":"","sources":["../../src/types/paginationTypes.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelineTypes.js","sourceRoot":"","sources":["../../src/types/pipelineTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tensorflowTypes.js","sourceRoot":"","sources":["../../src/types/tensorflowTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../src/unified.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,YAAY,CAAA;AAanB,eAAO,MAAM,WAAW;;;;;;;;CAsBvB,CAAA;AAmBD,cAAc,YAAY,CAAA;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA"}
|