@soulcraft/brainy 3.0.0 → 3.1.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/CHANGELOG.md +53 -3
- package/README.md +427 -111
- package/bin/brainy.js +340 -62
- package/dist/api/ConfigAPI.d.ts +67 -0
- package/dist/api/ConfigAPI.js +166 -0
- package/dist/api/DataAPI.d.ts +123 -0
- package/dist/api/DataAPI.js +391 -0
- package/dist/api/SecurityAPI.d.ts +50 -0
- package/dist/api/SecurityAPI.js +139 -0
- package/dist/api/UniversalImportAPI.d.ts +134 -0
- package/dist/api/UniversalImportAPI.js +615 -0
- package/dist/augmentationManager.js +12 -7
- package/dist/augmentationPipeline.d.ts +0 -61
- package/dist/augmentationPipeline.js +0 -87
- package/dist/augmentationRegistry.d.ts +1 -1
- package/dist/augmentationRegistry.js +1 -1
- package/dist/augmentations/apiServerAugmentation.d.ts +27 -1
- package/dist/augmentations/apiServerAugmentation.js +290 -9
- package/dist/augmentations/auditLogAugmentation.d.ts +109 -0
- package/dist/augmentations/auditLogAugmentation.js +358 -0
- package/dist/augmentations/batchProcessingAugmentation.d.ts +3 -2
- package/dist/augmentations/batchProcessingAugmentation.js +123 -22
- package/dist/augmentations/brainyAugmentation.d.ts +142 -8
- package/dist/augmentations/brainyAugmentation.js +179 -2
- package/dist/augmentations/cacheAugmentation.d.ts +8 -5
- package/dist/augmentations/cacheAugmentation.js +116 -17
- package/dist/augmentations/conduitAugmentations.d.ts +2 -2
- package/dist/augmentations/conduitAugmentations.js +2 -2
- package/dist/augmentations/configResolver.d.ts +122 -0
- package/dist/augmentations/configResolver.js +440 -0
- package/dist/augmentations/connectionPoolAugmentation.d.ts +3 -1
- package/dist/augmentations/connectionPoolAugmentation.js +37 -12
- package/dist/augmentations/defaultAugmentations.d.ts +14 -10
- package/dist/augmentations/defaultAugmentations.js +16 -11
- package/dist/augmentations/discovery/catalogDiscovery.d.ts +142 -0
- package/dist/augmentations/discovery/catalogDiscovery.js +249 -0
- package/dist/augmentations/discovery/localDiscovery.d.ts +84 -0
- package/dist/augmentations/discovery/localDiscovery.js +246 -0
- package/dist/augmentations/discovery/runtimeLoader.d.ts +97 -0
- package/dist/augmentations/discovery/runtimeLoader.js +337 -0
- package/dist/augmentations/discovery.d.ts +152 -0
- package/dist/augmentations/discovery.js +441 -0
- package/dist/augmentations/display/cache.d.ts +130 -0
- package/dist/augmentations/display/cache.js +319 -0
- package/dist/augmentations/display/fieldPatterns.d.ts +52 -0
- package/dist/augmentations/display/fieldPatterns.js +393 -0
- package/dist/augmentations/display/iconMappings.d.ts +57 -0
- package/dist/augmentations/display/iconMappings.js +68 -0
- package/dist/augmentations/display/intelligentComputation.d.ts +109 -0
- package/dist/augmentations/display/intelligentComputation.js +462 -0
- package/dist/augmentations/display/types.d.ts +203 -0
- package/dist/augmentations/display/types.js +7 -0
- package/dist/augmentations/entityRegistryAugmentation.d.ts +3 -1
- package/dist/augmentations/entityRegistryAugmentation.js +5 -1
- package/dist/augmentations/indexAugmentation.d.ts +5 -3
- package/dist/augmentations/indexAugmentation.js +5 -2
- package/dist/augmentations/intelligentVerbScoringAugmentation.d.ts +24 -7
- package/dist/augmentations/intelligentVerbScoringAugmentation.js +111 -27
- package/dist/augmentations/manifest.d.ts +176 -0
- package/dist/augmentations/manifest.js +8 -0
- package/dist/augmentations/marketplace/AugmentationMarketplace.d.ts +168 -0
- package/dist/augmentations/marketplace/AugmentationMarketplace.js +329 -0
- package/dist/augmentations/marketplace/cli.d.ts +47 -0
- package/dist/augmentations/marketplace/cli.js +265 -0
- package/dist/augmentations/metricsAugmentation.d.ts +3 -3
- package/dist/augmentations/metricsAugmentation.js +2 -2
- package/dist/augmentations/monitoringAugmentation.d.ts +3 -3
- package/dist/augmentations/monitoringAugmentation.js +2 -2
- package/dist/augmentations/neuralImport.d.ts +1 -1
- package/dist/augmentations/neuralImport.js +4 -4
- package/dist/augmentations/rateLimitAugmentation.d.ts +82 -0
- package/dist/augmentations/rateLimitAugmentation.js +321 -0
- package/dist/augmentations/requestDeduplicatorAugmentation.d.ts +2 -2
- package/dist/augmentations/requestDeduplicatorAugmentation.js +1 -1
- package/dist/augmentations/storageAugmentation.d.ts +1 -1
- package/dist/augmentations/storageAugmentation.js +2 -2
- package/dist/augmentations/storageAugmentations.d.ts +37 -8
- package/dist/augmentations/storageAugmentations.js +204 -15
- package/dist/augmentations/synapseAugmentation.d.ts +1 -1
- package/dist/augmentations/synapseAugmentation.js +35 -16
- package/dist/augmentations/typeMatching/brainyTypes.d.ts +83 -0
- package/dist/augmentations/typeMatching/brainyTypes.js +425 -0
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.d.ts +39 -59
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.js +103 -389
- package/dist/augmentations/universalDisplayAugmentation.d.ts +191 -0
- package/dist/augmentations/universalDisplayAugmentation.js +371 -0
- package/dist/brainy-unified.d.ts +106 -0
- package/dist/brainy-unified.js +327 -0
- package/dist/brainy.d.ts +277 -0
- package/dist/brainy.js +1241 -0
- package/dist/brainyData.d.ts +56 -111
- package/dist/brainyData.js +912 -756
- package/dist/brainyDataV3.d.ts +186 -0
- package/dist/brainyDataV3.js +337 -0
- package/dist/config/distributedPresets-new.d.ts +118 -0
- package/dist/config/distributedPresets-new.js +318 -0
- package/dist/config/distributedPresets.d.ts +118 -0
- package/dist/config/distributedPresets.js +318 -0
- package/dist/config/extensibleConfig.d.ts +99 -0
- package/dist/config/extensibleConfig.js +268 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.js +35 -0
- package/dist/config/modelAutoConfig.d.ts +32 -0
- package/dist/config/modelAutoConfig.js +139 -0
- package/dist/config/modelPrecisionManager.d.ts +42 -0
- package/dist/config/modelPrecisionManager.js +98 -0
- package/dist/config/sharedConfigManager.d.ts +67 -0
- package/dist/config/sharedConfigManager.js +215 -0
- package/dist/config/storageAutoConfig.d.ts +41 -0
- package/dist/config/storageAutoConfig.js +328 -0
- package/dist/config/zeroConfig.d.ts +68 -0
- package/dist/config/zeroConfig.js +301 -0
- package/dist/cortex/backupRestore.d.ts +2 -2
- package/dist/cortex/backupRestore.js +85 -27
- package/dist/cortex/healthCheck.d.ts +2 -2
- package/dist/cortex/neuralImport.d.ts +2 -2
- package/dist/cortex/neuralImport.js +18 -13
- package/dist/cortex/performanceMonitor.d.ts +2 -2
- package/dist/critical/model-guardian.d.ts +4 -0
- package/dist/critical/model-guardian.js +31 -11
- package/dist/demo.d.ts +4 -4
- package/dist/demo.js +7 -7
- package/dist/distributed/cacheSync.d.ts +112 -0
- package/dist/distributed/cacheSync.js +265 -0
- package/dist/distributed/coordinator.d.ts +193 -0
- package/dist/distributed/coordinator.js +548 -0
- package/dist/distributed/httpTransport.d.ts +120 -0
- package/dist/distributed/httpTransport.js +446 -0
- package/dist/distributed/index.d.ts +8 -0
- package/dist/distributed/index.js +5 -0
- package/dist/distributed/networkTransport.d.ts +132 -0
- package/dist/distributed/networkTransport.js +633 -0
- package/dist/distributed/queryPlanner.d.ts +104 -0
- package/dist/distributed/queryPlanner.js +327 -0
- package/dist/distributed/readWriteSeparation.d.ts +134 -0
- package/dist/distributed/readWriteSeparation.js +350 -0
- package/dist/distributed/shardManager.d.ts +114 -0
- package/dist/distributed/shardManager.js +357 -0
- package/dist/distributed/shardMigration.d.ts +110 -0
- package/dist/distributed/shardMigration.js +289 -0
- package/dist/distributed/storageDiscovery.d.ts +160 -0
- package/dist/distributed/storageDiscovery.js +551 -0
- package/dist/embeddings/CachedEmbeddings.d.ts +40 -0
- package/dist/embeddings/CachedEmbeddings.js +146 -0
- package/dist/embeddings/EmbeddingManager.d.ts +102 -0
- package/dist/embeddings/EmbeddingManager.js +291 -0
- package/dist/embeddings/SingletonModelManager.d.ts +95 -0
- package/dist/embeddings/SingletonModelManager.js +220 -0
- package/dist/embeddings/index.d.ts +12 -0
- package/dist/embeddings/index.js +16 -0
- package/dist/embeddings/lightweight-embedder.d.ts +0 -1
- package/dist/embeddings/lightweight-embedder.js +4 -12
- package/dist/embeddings/model-manager.d.ts +11 -0
- package/dist/embeddings/model-manager.js +43 -7
- package/dist/embeddings/universal-memory-manager.d.ts +1 -1
- package/dist/embeddings/universal-memory-manager.js +27 -67
- package/dist/embeddings/worker-embedding.js +4 -8
- package/dist/errors/brainyError.d.ts +5 -1
- package/dist/errors/brainyError.js +12 -0
- package/dist/examples/basicUsage.js +7 -4
- package/dist/graph/graphAdjacencyIndex.d.ts +96 -0
- package/dist/graph/graphAdjacencyIndex.js +288 -0
- package/dist/graph/pathfinding.js +4 -2
- package/dist/hnsw/scaledHNSWSystem.js +11 -2
- package/dist/importManager.js +8 -5
- package/dist/index.d.ts +17 -22
- package/dist/index.js +37 -23
- package/dist/mcp/brainyMCPAdapter.d.ts +4 -4
- package/dist/mcp/brainyMCPAdapter.js +5 -5
- package/dist/mcp/brainyMCPService.d.ts +3 -3
- package/dist/mcp/brainyMCPService.js +3 -11
- package/dist/mcp/mcpAugmentationToolset.js +20 -30
- package/dist/neural/embeddedPatterns.d.ts +1 -1
- package/dist/neural/embeddedPatterns.js +2 -2
- package/dist/neural/entityExtractor.d.ts +65 -0
- package/dist/neural/entityExtractor.js +316 -0
- package/dist/neural/improvedNeuralAPI.d.ts +357 -0
- package/dist/neural/improvedNeuralAPI.js +2628 -0
- package/dist/neural/naturalLanguageProcessor.d.ts +155 -10
- package/dist/neural/naturalLanguageProcessor.js +941 -66
- package/dist/neural/naturalLanguageProcessorStatic.d.ts +2 -2
- package/dist/neural/naturalLanguageProcessorStatic.js +3 -3
- package/dist/neural/neuralAPI.js +8 -2
- package/dist/neural/patternLibrary.d.ts +57 -3
- package/dist/neural/patternLibrary.js +348 -13
- package/dist/neural/staticPatternMatcher.d.ts +2 -2
- package/dist/neural/staticPatternMatcher.js +2 -2
- package/dist/neural/types.d.ts +287 -0
- package/dist/neural/types.js +24 -0
- package/dist/shared/default-augmentations.d.ts +3 -3
- package/dist/shared/default-augmentations.js +5 -5
- package/dist/storage/adapters/baseStorageAdapter.d.ts +42 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts +26 -2
- package/dist/storage/adapters/fileSystemStorage.js +218 -15
- package/dist/storage/adapters/memoryStorage.d.ts +4 -4
- package/dist/storage/adapters/memoryStorage.js +17 -12
- package/dist/storage/adapters/opfsStorage.d.ts +2 -2
- package/dist/storage/adapters/opfsStorage.js +2 -2
- package/dist/storage/adapters/s3CompatibleStorage.d.ts +2 -2
- package/dist/storage/adapters/s3CompatibleStorage.js +2 -2
- package/dist/storage/backwardCompatibility.d.ts +10 -78
- package/dist/storage/backwardCompatibility.js +17 -132
- package/dist/storage/baseStorage.d.ts +18 -2
- package/dist/storage/baseStorage.js +74 -3
- package/dist/storage/cacheManager.js +2 -2
- package/dist/storage/readOnlyOptimizations.js +8 -3
- package/dist/streaming/pipeline.d.ts +154 -0
- package/dist/streaming/pipeline.js +551 -0
- package/dist/triple/TripleIntelligence.d.ts +25 -110
- package/dist/triple/TripleIntelligence.js +4 -574
- package/dist/triple/TripleIntelligenceSystem.d.ts +159 -0
- package/dist/triple/TripleIntelligenceSystem.js +519 -0
- package/dist/types/apiTypes.d.ts +278 -0
- package/dist/types/apiTypes.js +33 -0
- package/dist/types/brainy.types.d.ts +308 -0
- package/dist/types/brainy.types.js +8 -0
- package/dist/types/brainyDataInterface.d.ts +5 -8
- package/dist/types/brainyDataInterface.js +2 -2
- package/dist/types/graphTypes.js +2 -2
- package/dist/universal/crypto.d.ts +11 -1
- package/dist/universal/crypto.js +24 -93
- package/dist/universal/events.d.ts +3 -2
- package/dist/universal/events.js +6 -75
- package/dist/universal/fs.d.ts +2 -3
- package/dist/universal/fs.js +5 -211
- package/dist/universal/path.d.ts +3 -2
- package/dist/universal/path.js +22 -78
- package/dist/universal/uuid.d.ts +1 -1
- package/dist/universal/uuid.js +1 -1
- package/dist/utils/brainyTypes.d.ts +217 -0
- package/dist/utils/brainyTypes.js +261 -0
- package/dist/utils/cacheAutoConfig.d.ts +3 -3
- package/dist/utils/embedding.d.ts +9 -4
- package/dist/utils/embedding.js +89 -26
- package/dist/utils/enhancedLogger.d.ts +104 -0
- package/dist/utils/enhancedLogger.js +232 -0
- package/dist/utils/hybridModelManager.d.ts +19 -28
- package/dist/utils/hybridModelManager.js +36 -200
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/intelligentTypeMapper.d.ts +60 -0
- package/dist/utils/intelligentTypeMapper.js +349 -0
- package/dist/utils/metadataIndex.d.ts +118 -1
- package/dist/utils/metadataIndex.js +539 -16
- package/dist/utils/nodeVersionCheck.d.ts +24 -0
- package/dist/utils/nodeVersionCheck.js +65 -0
- package/dist/utils/paramValidation.d.ts +39 -0
- package/dist/utils/paramValidation.js +192 -0
- package/dist/utils/rateLimiter.d.ts +160 -0
- package/dist/utils/rateLimiter.js +271 -0
- package/dist/utils/statistics.d.ts +4 -4
- package/dist/utils/statistics.js +3 -3
- package/dist/utils/structuredLogger.d.ts +146 -0
- package/dist/utils/structuredLogger.js +394 -0
- package/dist/utils/textEncoding.js +2 -1
- package/dist/utils/typeValidation.d.ts +59 -0
- package/dist/utils/typeValidation.js +374 -0
- package/dist/utils/version.js +19 -3
- package/package.json +15 -17
- package/scripts/download-models.cjs +94 -20
- package/dist/augmentations/walAugmentation.d.ts +0 -109
- package/dist/augmentations/walAugmentation.js +0 -516
- package/dist/browserFramework.d.ts +0 -15
- package/dist/browserFramework.js +0 -31
- package/dist/browserFramework.minimal.d.ts +0 -14
- package/dist/browserFramework.minimal.js +0 -31
- package/dist/chat/BrainyChat.d.ts +0 -121
- package/dist/chat/BrainyChat.js +0 -396
- package/dist/chat/ChatCLI.d.ts +0 -61
- package/dist/chat/ChatCLI.js +0 -351
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal Neural Import API
|
|
3
|
+
*
|
|
4
|
+
* ALWAYS uses neural matching to map ANY data to our strict NounTypes and VerbTypes
|
|
5
|
+
* Never falls back to rules - neural matching is MANDATORY
|
|
6
|
+
*
|
|
7
|
+
* Handles:
|
|
8
|
+
* - Strings (text, JSON, CSV, YAML, Markdown)
|
|
9
|
+
* - Files (local paths, any format)
|
|
10
|
+
* - URLs (web pages, APIs, documents)
|
|
11
|
+
* - Objects (structured data)
|
|
12
|
+
* - Binary data (images, PDFs via extraction)
|
|
13
|
+
*/
|
|
14
|
+
import { getBrainyTypes } from '../augmentations/typeMatching/brainyTypes.js';
|
|
15
|
+
import { NeuralImportAugmentation } from '../augmentations/neuralImport.js';
|
|
16
|
+
export class UniversalImportAPI {
|
|
17
|
+
constructor(brain) {
|
|
18
|
+
this.embedCache = new Map();
|
|
19
|
+
this.brain = brain;
|
|
20
|
+
this.neuralImport = new NeuralImportAugmentation({
|
|
21
|
+
confidenceThreshold: 0.0, // Accept ALL confidence levels - never reject
|
|
22
|
+
enableWeights: true,
|
|
23
|
+
skipDuplicates: false // Process everything
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Initialize the neural import system
|
|
28
|
+
*/
|
|
29
|
+
async init() {
|
|
30
|
+
this.typeMatcher = await getBrainyTypes();
|
|
31
|
+
// Neural import initializes itself
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Universal import - handles ANY data source
|
|
35
|
+
* ALWAYS uses neural matching, NEVER falls back
|
|
36
|
+
*/
|
|
37
|
+
async import(source) {
|
|
38
|
+
const startTime = Date.now();
|
|
39
|
+
// Normalize source
|
|
40
|
+
const normalizedSource = this.normalizeSource(source);
|
|
41
|
+
// Extract data based on source type
|
|
42
|
+
const extractedData = await this.extractData(normalizedSource);
|
|
43
|
+
// Neural processing - MANDATORY
|
|
44
|
+
const neuralResults = await this.neuralProcess(extractedData);
|
|
45
|
+
// Store in brain
|
|
46
|
+
const result = await this.storeInBrain(neuralResults);
|
|
47
|
+
result.stats.processingTimeMs = Date.now() - startTime;
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Import from URL - fetches and processes
|
|
52
|
+
*/
|
|
53
|
+
async importFromURL(url) {
|
|
54
|
+
const response = await fetch(url);
|
|
55
|
+
const contentType = response.headers.get('content-type') || 'text/plain';
|
|
56
|
+
let data;
|
|
57
|
+
if (contentType.includes('json')) {
|
|
58
|
+
data = await response.json();
|
|
59
|
+
}
|
|
60
|
+
else if (contentType.includes('text') || contentType.includes('html')) {
|
|
61
|
+
data = await response.text();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// Binary data
|
|
65
|
+
const buffer = await response.arrayBuffer();
|
|
66
|
+
data = new Uint8Array(buffer);
|
|
67
|
+
}
|
|
68
|
+
return this.import({
|
|
69
|
+
type: 'url',
|
|
70
|
+
data,
|
|
71
|
+
format: contentType,
|
|
72
|
+
metadata: { url, fetchedAt: Date.now() }
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Import from file - reads and processes
|
|
77
|
+
* Note: In browser environment, use File API instead
|
|
78
|
+
*/
|
|
79
|
+
async importFromFile(filePath) {
|
|
80
|
+
// Read the actual file content
|
|
81
|
+
const { readFileSync } = await import('fs');
|
|
82
|
+
const ext = filePath.split('.').pop()?.toLowerCase() || 'txt';
|
|
83
|
+
try {
|
|
84
|
+
const fileContent = readFileSync(filePath, 'utf-8');
|
|
85
|
+
return this.import({
|
|
86
|
+
type: 'file',
|
|
87
|
+
data: fileContent, // Actual file content
|
|
88
|
+
format: ext,
|
|
89
|
+
metadata: {
|
|
90
|
+
path: filePath,
|
|
91
|
+
importedAt: Date.now(),
|
|
92
|
+
fileSize: fileContent.length
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
throw new Error(`Failed to read file ${filePath}: ${error.message}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Normalize any input to ImportSource
|
|
102
|
+
*/
|
|
103
|
+
normalizeSource(source) {
|
|
104
|
+
// Already normalized
|
|
105
|
+
if (source && typeof source === 'object' && 'type' in source && 'data' in source) {
|
|
106
|
+
return source;
|
|
107
|
+
}
|
|
108
|
+
// String input
|
|
109
|
+
if (typeof source === 'string') {
|
|
110
|
+
// Check if it's a URL
|
|
111
|
+
if (source.startsWith('http://') || source.startsWith('https://')) {
|
|
112
|
+
return { type: 'url', data: source };
|
|
113
|
+
}
|
|
114
|
+
// Check if it looks like a file path
|
|
115
|
+
if (source.includes('/') || source.includes('\\') || source.includes('.')) {
|
|
116
|
+
// Assume it's a file path reference
|
|
117
|
+
return { type: 'file', data: source };
|
|
118
|
+
}
|
|
119
|
+
// Treat as raw string data
|
|
120
|
+
return { type: 'string', data: source };
|
|
121
|
+
}
|
|
122
|
+
// Object/Array input
|
|
123
|
+
if (typeof source === 'object') {
|
|
124
|
+
return { type: 'object', data: source };
|
|
125
|
+
}
|
|
126
|
+
// Default to string
|
|
127
|
+
return { type: 'string', data: String(source) };
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Extract structured data from source
|
|
131
|
+
*/
|
|
132
|
+
async extractData(source) {
|
|
133
|
+
switch (source.type) {
|
|
134
|
+
case 'url':
|
|
135
|
+
// URL is in data field, need to fetch
|
|
136
|
+
return this.extractFromURL(source.data);
|
|
137
|
+
case 'file':
|
|
138
|
+
// File path is in data field, need to read
|
|
139
|
+
return this.extractFromFile(source.data);
|
|
140
|
+
case 'string':
|
|
141
|
+
return this.extractFromString(source.data, source.format);
|
|
142
|
+
case 'object':
|
|
143
|
+
return Array.isArray(source.data) ? source.data : [source.data];
|
|
144
|
+
case 'binary':
|
|
145
|
+
return this.extractFromBinary(source.data, source.format);
|
|
146
|
+
default:
|
|
147
|
+
// Unknown type, treat as object
|
|
148
|
+
return [source.data];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Extract data from URL
|
|
153
|
+
*/
|
|
154
|
+
async extractFromURL(url) {
|
|
155
|
+
const result = await this.importFromURL(url);
|
|
156
|
+
return result.entities.map(e => e.data);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Extract data from file
|
|
160
|
+
*/
|
|
161
|
+
async extractFromFile(filePath) {
|
|
162
|
+
const result = await this.importFromFile(filePath);
|
|
163
|
+
return result.entities.map(e => e.data);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Extract data from string based on format
|
|
167
|
+
*/
|
|
168
|
+
extractFromString(data, format) {
|
|
169
|
+
// Try to detect format if not provided
|
|
170
|
+
const detectedFormat = format || this.detectFormat(data);
|
|
171
|
+
switch (detectedFormat) {
|
|
172
|
+
case 'json':
|
|
173
|
+
try {
|
|
174
|
+
const parsed = JSON.parse(data);
|
|
175
|
+
return Array.isArray(parsed) ? parsed : [parsed];
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// Not valid JSON, treat as text
|
|
179
|
+
return this.extractFromText(data);
|
|
180
|
+
}
|
|
181
|
+
case 'csv':
|
|
182
|
+
return this.parseCSV(data);
|
|
183
|
+
case 'yaml':
|
|
184
|
+
case 'yml':
|
|
185
|
+
return this.parseYAML(data);
|
|
186
|
+
case 'markdown':
|
|
187
|
+
case 'md':
|
|
188
|
+
return this.parseMarkdown(data);
|
|
189
|
+
case 'xml':
|
|
190
|
+
case 'html':
|
|
191
|
+
return this.parseHTML(data);
|
|
192
|
+
default:
|
|
193
|
+
return this.extractFromText(data);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Extract from binary data (images, PDFs, etc)
|
|
198
|
+
*/
|
|
199
|
+
async extractFromBinary(data, format) {
|
|
200
|
+
// For now, create a single entity representing the binary data
|
|
201
|
+
// In production, would use OCR, image recognition, PDF extraction, etc.
|
|
202
|
+
return [{
|
|
203
|
+
type: 'binary',
|
|
204
|
+
format: format || 'unknown',
|
|
205
|
+
size: data.length,
|
|
206
|
+
hash: await this.hashBinary(data),
|
|
207
|
+
extractedAt: Date.now()
|
|
208
|
+
}];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Extract entities from plain text
|
|
212
|
+
*/
|
|
213
|
+
extractFromText(text) {
|
|
214
|
+
// Split into meaningful chunks
|
|
215
|
+
const chunks = [];
|
|
216
|
+
// Split by paragraphs
|
|
217
|
+
const paragraphs = text.split(/\n\n+/);
|
|
218
|
+
for (const para of paragraphs) {
|
|
219
|
+
if (para.trim()) {
|
|
220
|
+
chunks.push({
|
|
221
|
+
text: para.trim(),
|
|
222
|
+
type: 'paragraph',
|
|
223
|
+
length: para.length
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// If no paragraphs, split by sentences
|
|
228
|
+
if (chunks.length === 0) {
|
|
229
|
+
const sentences = text.match(/[^.!?]+[.!?]+/g) || [text];
|
|
230
|
+
for (const sentence of sentences) {
|
|
231
|
+
if (sentence.trim()) {
|
|
232
|
+
chunks.push({
|
|
233
|
+
text: sentence.trim(),
|
|
234
|
+
type: 'sentence',
|
|
235
|
+
length: sentence.length
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return chunks;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Neural processing - CORE of the system
|
|
244
|
+
* ALWAYS uses embeddings and neural matching
|
|
245
|
+
*/
|
|
246
|
+
async neuralProcess(data) {
|
|
247
|
+
const entities = new Map();
|
|
248
|
+
const relationships = new Map();
|
|
249
|
+
for (const item of data) {
|
|
250
|
+
// Generate embedding for the item
|
|
251
|
+
const embedding = await this.generateEmbedding(item);
|
|
252
|
+
// Neural type matching - MANDATORY
|
|
253
|
+
const nounMatch = await this.typeMatcher.matchNounType(item);
|
|
254
|
+
// Never reject based on confidence - we ALWAYS accept the best match
|
|
255
|
+
const entityId = this.generateId(item);
|
|
256
|
+
entities.set(entityId, {
|
|
257
|
+
id: entityId,
|
|
258
|
+
type: nounMatch.type, // Always use the neural match
|
|
259
|
+
data: item,
|
|
260
|
+
vector: embedding,
|
|
261
|
+
confidence: nounMatch.confidence,
|
|
262
|
+
metadata: {
|
|
263
|
+
...item,
|
|
264
|
+
_neuralMatch: nounMatch,
|
|
265
|
+
_importedAt: Date.now()
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
// Detect relationships using neural matching
|
|
269
|
+
await this.detectNeuralRelationships(item, entityId, entities, relationships);
|
|
270
|
+
}
|
|
271
|
+
return { entities, relationships };
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Generate embedding for any data
|
|
275
|
+
*/
|
|
276
|
+
async generateEmbedding(data) {
|
|
277
|
+
// Convert to string for embedding
|
|
278
|
+
const text = this.dataToText(data);
|
|
279
|
+
// Check cache
|
|
280
|
+
if (this.embedCache.has(text)) {
|
|
281
|
+
return this.embedCache.get(text);
|
|
282
|
+
}
|
|
283
|
+
// Generate new embedding
|
|
284
|
+
const embedding = await this.brain.embed(text);
|
|
285
|
+
// Cache it
|
|
286
|
+
this.embedCache.set(text, embedding);
|
|
287
|
+
return embedding;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Convert any data to text for embedding
|
|
291
|
+
*/
|
|
292
|
+
dataToText(data) {
|
|
293
|
+
if (typeof data === 'string')
|
|
294
|
+
return data;
|
|
295
|
+
if (typeof data === 'object') {
|
|
296
|
+
// Extract meaningful text from object
|
|
297
|
+
const parts = [];
|
|
298
|
+
// Priority fields
|
|
299
|
+
const priorityFields = ['name', 'title', 'description', 'text', 'content', 'label', 'value'];
|
|
300
|
+
for (const field of priorityFields) {
|
|
301
|
+
if (data[field]) {
|
|
302
|
+
parts.push(String(data[field]));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// Add other fields
|
|
306
|
+
for (const [key, value] of Object.entries(data)) {
|
|
307
|
+
if (!priorityFields.includes(key) && value) {
|
|
308
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
309
|
+
parts.push(`${key}: ${value}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return parts.join(' ');
|
|
314
|
+
}
|
|
315
|
+
return JSON.stringify(data);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Detect relationships using neural matching
|
|
319
|
+
*/
|
|
320
|
+
async detectNeuralRelationships(item, sourceId, entities, relationships) {
|
|
321
|
+
if (typeof item !== 'object')
|
|
322
|
+
return;
|
|
323
|
+
// Look for references to other entities
|
|
324
|
+
for (const [key, value] of Object.entries(item)) {
|
|
325
|
+
// Check if this looks like a reference
|
|
326
|
+
if (this.looksLikeReference(key, value)) {
|
|
327
|
+
// Find or predict target entity
|
|
328
|
+
const targetId = String(value);
|
|
329
|
+
// Neural verb type matching
|
|
330
|
+
const verbMatch = await this.typeMatcher.matchVerbType(item, // source object
|
|
331
|
+
{ id: targetId }, // target (we may not have full data)
|
|
332
|
+
key // field name as context
|
|
333
|
+
);
|
|
334
|
+
// Always create relationship with neural match
|
|
335
|
+
const relationId = `${sourceId}_${verbMatch.type}_${targetId}`;
|
|
336
|
+
relationships.set(relationId, {
|
|
337
|
+
id: relationId,
|
|
338
|
+
from: sourceId,
|
|
339
|
+
to: targetId,
|
|
340
|
+
type: verbMatch.type,
|
|
341
|
+
weight: verbMatch.confidence, // Use confidence as weight
|
|
342
|
+
confidence: verbMatch.confidence,
|
|
343
|
+
metadata: {
|
|
344
|
+
field: key,
|
|
345
|
+
_neuralMatch: verbMatch,
|
|
346
|
+
_importedAt: Date.now()
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
// Handle arrays of references
|
|
351
|
+
if (Array.isArray(value)) {
|
|
352
|
+
for (const item of value) {
|
|
353
|
+
if (this.looksLikeReference(key, item)) {
|
|
354
|
+
const targetId = String(item);
|
|
355
|
+
const verbMatch = await this.typeMatcher.matchVerbType(item, { id: targetId }, key);
|
|
356
|
+
const relationId = `${sourceId}_${verbMatch.type}_${targetId}`;
|
|
357
|
+
relationships.set(relationId, {
|
|
358
|
+
id: relationId,
|
|
359
|
+
from: sourceId,
|
|
360
|
+
to: targetId,
|
|
361
|
+
type: verbMatch.type,
|
|
362
|
+
weight: verbMatch.confidence,
|
|
363
|
+
confidence: verbMatch.confidence,
|
|
364
|
+
metadata: {
|
|
365
|
+
field: key,
|
|
366
|
+
array: true,
|
|
367
|
+
_neuralMatch: verbMatch,
|
|
368
|
+
_importedAt: Date.now()
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Check if a field looks like a reference
|
|
378
|
+
*/
|
|
379
|
+
looksLikeReference(key, value) {
|
|
380
|
+
// Field name patterns that suggest references
|
|
381
|
+
const refPatterns = [
|
|
382
|
+
/[Ii]d$/, // ends with Id or id
|
|
383
|
+
/_id$/, // ends with _id
|
|
384
|
+
/^parent/i, // starts with parent
|
|
385
|
+
/^child/i, // starts with child
|
|
386
|
+
/^related/i, // starts with related
|
|
387
|
+
/^ref/i, // starts with ref
|
|
388
|
+
/^link/i, // starts with link
|
|
389
|
+
/^target/i, // starts with target
|
|
390
|
+
/^source/i, // starts with source
|
|
391
|
+
];
|
|
392
|
+
// Check if field name matches patterns
|
|
393
|
+
const fieldLooksLikeRef = refPatterns.some(pattern => pattern.test(key));
|
|
394
|
+
// Check if value looks like an ID
|
|
395
|
+
const valueLooksLikeId = (typeof value === 'string' ||
|
|
396
|
+
typeof value === 'number') && String(value).length > 0;
|
|
397
|
+
return fieldLooksLikeRef && valueLooksLikeId;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Store processed data in brain
|
|
401
|
+
*/
|
|
402
|
+
async storeInBrain(neuralResults) {
|
|
403
|
+
const result = {
|
|
404
|
+
entities: [],
|
|
405
|
+
relationships: [],
|
|
406
|
+
stats: {
|
|
407
|
+
totalProcessed: neuralResults.entities.size + neuralResults.relationships.size,
|
|
408
|
+
entitiesCreated: 0,
|
|
409
|
+
relationshipsCreated: 0,
|
|
410
|
+
averageConfidence: 0,
|
|
411
|
+
processingTimeMs: 0
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
let totalConfidence = 0;
|
|
415
|
+
// Store entities
|
|
416
|
+
for (const entity of neuralResults.entities.values()) {
|
|
417
|
+
const id = await this.brain.add({
|
|
418
|
+
data: entity.data,
|
|
419
|
+
type: entity.type,
|
|
420
|
+
metadata: entity.metadata,
|
|
421
|
+
vector: entity.vector
|
|
422
|
+
});
|
|
423
|
+
// Update entity ID for relationship mapping
|
|
424
|
+
entity.id = id;
|
|
425
|
+
result.entities.push({
|
|
426
|
+
...entity,
|
|
427
|
+
id
|
|
428
|
+
});
|
|
429
|
+
result.stats.entitiesCreated++;
|
|
430
|
+
totalConfidence += entity.confidence;
|
|
431
|
+
}
|
|
432
|
+
// Store relationships
|
|
433
|
+
for (const relation of neuralResults.relationships.values()) {
|
|
434
|
+
// Map to actual entity IDs
|
|
435
|
+
const sourceEntity = Array.from(neuralResults.entities.values())
|
|
436
|
+
.find(e => e.id === relation.from);
|
|
437
|
+
const targetEntity = Array.from(neuralResults.entities.values())
|
|
438
|
+
.find(e => e.id === relation.to);
|
|
439
|
+
if (sourceEntity && targetEntity) {
|
|
440
|
+
const id = await this.brain.relate({
|
|
441
|
+
from: sourceEntity.id,
|
|
442
|
+
to: targetEntity.id,
|
|
443
|
+
type: relation.type,
|
|
444
|
+
weight: relation.weight,
|
|
445
|
+
metadata: relation.metadata
|
|
446
|
+
});
|
|
447
|
+
result.relationships.push({
|
|
448
|
+
...relation,
|
|
449
|
+
id,
|
|
450
|
+
from: sourceEntity.id,
|
|
451
|
+
to: targetEntity.id
|
|
452
|
+
});
|
|
453
|
+
result.stats.relationshipsCreated++;
|
|
454
|
+
totalConfidence += relation.confidence;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
// Calculate average confidence
|
|
458
|
+
const totalItems = result.stats.entitiesCreated + result.stats.relationshipsCreated;
|
|
459
|
+
result.stats.averageConfidence = totalItems > 0 ? totalConfidence / totalItems : 0;
|
|
460
|
+
return result;
|
|
461
|
+
}
|
|
462
|
+
// Helper methods for parsing different formats
|
|
463
|
+
detectFormat(data) {
|
|
464
|
+
const trimmed = data.trim();
|
|
465
|
+
// JSON
|
|
466
|
+
if ((trimmed.startsWith('{') && trimmed.endsWith('}')) ||
|
|
467
|
+
(trimmed.startsWith('[') && trimmed.endsWith(']'))) {
|
|
468
|
+
return 'json';
|
|
469
|
+
}
|
|
470
|
+
// CSV (has commas and newlines)
|
|
471
|
+
if (trimmed.includes(',') && trimmed.includes('\n')) {
|
|
472
|
+
return 'csv';
|
|
473
|
+
}
|
|
474
|
+
// YAML (has colons and indentation)
|
|
475
|
+
if (trimmed.includes(':') && (trimmed.includes('\n ') || trimmed.includes('\n\t'))) {
|
|
476
|
+
return 'yaml';
|
|
477
|
+
}
|
|
478
|
+
// Markdown (has headers)
|
|
479
|
+
if (trimmed.includes('#') || trimmed.includes('```')) {
|
|
480
|
+
return 'markdown';
|
|
481
|
+
}
|
|
482
|
+
// HTML/XML
|
|
483
|
+
if (trimmed.includes('<') && trimmed.includes('>')) {
|
|
484
|
+
return trimmed.toLowerCase().includes('<!doctype html') ? 'html' : 'xml';
|
|
485
|
+
}
|
|
486
|
+
return 'text';
|
|
487
|
+
}
|
|
488
|
+
parseCSV(data) {
|
|
489
|
+
// Reuse the CSV parser from neural import
|
|
490
|
+
const lines = data.split('\n').filter(l => l.trim());
|
|
491
|
+
if (lines.length === 0)
|
|
492
|
+
return [];
|
|
493
|
+
const headers = lines[0].split(',').map(h => h.trim());
|
|
494
|
+
const results = [];
|
|
495
|
+
for (let i = 1; i < lines.length; i++) {
|
|
496
|
+
const values = lines[i].split(',').map(v => v.trim());
|
|
497
|
+
const obj = {};
|
|
498
|
+
headers.forEach((header, index) => {
|
|
499
|
+
obj[header] = values[index] || '';
|
|
500
|
+
});
|
|
501
|
+
results.push(obj);
|
|
502
|
+
}
|
|
503
|
+
return results;
|
|
504
|
+
}
|
|
505
|
+
parseYAML(data) {
|
|
506
|
+
// Simple YAML parser
|
|
507
|
+
const results = [];
|
|
508
|
+
const lines = data.split('\n');
|
|
509
|
+
let current = null;
|
|
510
|
+
for (const line of lines) {
|
|
511
|
+
const trimmed = line.trim();
|
|
512
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
513
|
+
continue;
|
|
514
|
+
if (trimmed.startsWith('- ')) {
|
|
515
|
+
// Array item
|
|
516
|
+
const value = trimmed.substring(2);
|
|
517
|
+
if (!current) {
|
|
518
|
+
results.push(value);
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
if (!current._items)
|
|
522
|
+
current._items = [];
|
|
523
|
+
current._items.push(value);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
else if (trimmed.includes(':')) {
|
|
527
|
+
// Key-value
|
|
528
|
+
const [key, ...valueParts] = trimmed.split(':');
|
|
529
|
+
const value = valueParts.join(':').trim();
|
|
530
|
+
if (!current) {
|
|
531
|
+
current = {};
|
|
532
|
+
results.push(current);
|
|
533
|
+
}
|
|
534
|
+
current[key.trim()] = value;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return results.length > 0 ? results : [{ text: data }];
|
|
538
|
+
}
|
|
539
|
+
parseMarkdown(data) {
|
|
540
|
+
const results = [];
|
|
541
|
+
const lines = data.split('\n');
|
|
542
|
+
let current = null;
|
|
543
|
+
let inCodeBlock = false;
|
|
544
|
+
for (const line of lines) {
|
|
545
|
+
if (line.startsWith('```')) {
|
|
546
|
+
inCodeBlock = !inCodeBlock;
|
|
547
|
+
if (inCodeBlock && current) {
|
|
548
|
+
current.code = '';
|
|
549
|
+
}
|
|
550
|
+
continue;
|
|
551
|
+
}
|
|
552
|
+
if (inCodeBlock && current) {
|
|
553
|
+
current.code += line + '\n';
|
|
554
|
+
}
|
|
555
|
+
else if (line.startsWith('#')) {
|
|
556
|
+
// Header
|
|
557
|
+
const level = line.match(/^#+/)?.[0].length || 1;
|
|
558
|
+
const text = line.replace(/^#+\s*/, '');
|
|
559
|
+
current = {
|
|
560
|
+
type: 'heading',
|
|
561
|
+
level,
|
|
562
|
+
text
|
|
563
|
+
};
|
|
564
|
+
results.push(current);
|
|
565
|
+
}
|
|
566
|
+
else if (line.trim()) {
|
|
567
|
+
// Paragraph
|
|
568
|
+
if (!current || current.type !== 'paragraph') {
|
|
569
|
+
current = {
|
|
570
|
+
type: 'paragraph',
|
|
571
|
+
text: ''
|
|
572
|
+
};
|
|
573
|
+
results.push(current);
|
|
574
|
+
}
|
|
575
|
+
current.text += line + ' ';
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return results;
|
|
579
|
+
}
|
|
580
|
+
parseHTML(data) {
|
|
581
|
+
// Simple HTML text extraction
|
|
582
|
+
const text = data
|
|
583
|
+
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '') // Remove scripts
|
|
584
|
+
.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, '') // Remove styles
|
|
585
|
+
.replace(/<[^>]+>/g, ' ') // Remove tags
|
|
586
|
+
.replace(/\s+/g, ' ') // Normalize whitespace
|
|
587
|
+
.trim();
|
|
588
|
+
return this.extractFromText(text);
|
|
589
|
+
}
|
|
590
|
+
generateId(data) {
|
|
591
|
+
// Generate deterministic ID based on content
|
|
592
|
+
const text = this.dataToText(data);
|
|
593
|
+
const hash = this.simpleHash(text);
|
|
594
|
+
return `import_${hash}_${Date.now()}`;
|
|
595
|
+
}
|
|
596
|
+
simpleHash(text) {
|
|
597
|
+
let hash = 0;
|
|
598
|
+
for (let i = 0; i < text.length; i++) {
|
|
599
|
+
const char = text.charCodeAt(i);
|
|
600
|
+
hash = ((hash << 5) - hash) + char;
|
|
601
|
+
hash = hash & hash;
|
|
602
|
+
}
|
|
603
|
+
return Math.abs(hash).toString(36);
|
|
604
|
+
}
|
|
605
|
+
async hashBinary(data) {
|
|
606
|
+
// Simple binary hash
|
|
607
|
+
let hash = 0;
|
|
608
|
+
for (let i = 0; i < Math.min(data.length, 1000); i++) {
|
|
609
|
+
hash = ((hash << 5) - hash) + data[i];
|
|
610
|
+
hash = hash & hash;
|
|
611
|
+
}
|
|
612
|
+
return Math.abs(hash).toString(36);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
//# sourceMappingURL=UniversalImportAPI.js.map
|
|
@@ -16,7 +16,8 @@ export class AugmentationManager {
|
|
|
16
16
|
* @returns Array of augmentation information
|
|
17
17
|
*/
|
|
18
18
|
list() {
|
|
19
|
-
|
|
19
|
+
// Deprecated: use brain.augmentations instead
|
|
20
|
+
return [];
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Get information about a specific augmentation
|
|
@@ -42,7 +43,8 @@ export class AugmentationManager {
|
|
|
42
43
|
* @returns True if successfully enabled
|
|
43
44
|
*/
|
|
44
45
|
enable(name) {
|
|
45
|
-
|
|
46
|
+
// Deprecated: use brain.augmentations instead
|
|
47
|
+
return false;
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* Disable a specific augmentation
|
|
@@ -50,7 +52,8 @@ export class AugmentationManager {
|
|
|
50
52
|
* @returns True if successfully disabled
|
|
51
53
|
*/
|
|
52
54
|
disable(name) {
|
|
53
|
-
|
|
55
|
+
// Deprecated: use brain.augmentations instead
|
|
56
|
+
return false;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Remove an augmentation from the pipeline
|
|
@@ -58,7 +61,7 @@ export class AugmentationManager {
|
|
|
58
61
|
* @returns True if successfully removed
|
|
59
62
|
*/
|
|
60
63
|
remove(name) {
|
|
61
|
-
|
|
64
|
+
// Deprecated: use brain.augmentations instead
|
|
62
65
|
return true;
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
@@ -67,7 +70,8 @@ export class AugmentationManager {
|
|
|
67
70
|
* @returns Number of augmentations enabled
|
|
68
71
|
*/
|
|
69
72
|
enableType(type) {
|
|
70
|
-
|
|
73
|
+
// Deprecated: use brain.augmentations instead
|
|
74
|
+
return 0;
|
|
71
75
|
}
|
|
72
76
|
/**
|
|
73
77
|
* Disable all augmentations of a specific type
|
|
@@ -75,7 +79,8 @@ export class AugmentationManager {
|
|
|
75
79
|
* @returns Number of augmentations disabled
|
|
76
80
|
*/
|
|
77
81
|
disableType(type) {
|
|
78
|
-
|
|
82
|
+
// Deprecated: use brain.augmentations instead
|
|
83
|
+
return 0;
|
|
79
84
|
}
|
|
80
85
|
/**
|
|
81
86
|
* Get all augmentations of a specific type
|
|
@@ -104,7 +109,7 @@ export class AugmentationManager {
|
|
|
104
109
|
* @param augmentation The augmentation to register
|
|
105
110
|
*/
|
|
106
111
|
register(augmentation) {
|
|
107
|
-
|
|
112
|
+
// Deprecated: use brain.augmentations instead
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
// Export types for external use
|