@soulcraft/brainy 0.54.7 → 0.56.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 (117) hide show
  1. package/README.md +174 -669
  2. package/bin/cortex.js +592 -0
  3. package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
  4. package/dist/augmentations/neuralImportSense.d.ts +196 -0
  5. package/dist/augmentations/neuralImportSense.js +747 -0
  6. package/dist/augmentations/neuralImportSense.js.map +1 -0
  7. package/dist/brainyData.d.ts +40 -0
  8. package/dist/brainyData.d.ts.map +1 -1
  9. package/dist/brainyData.js +88 -0
  10. package/dist/brainyData.js.map +1 -1
  11. package/dist/chat/brainyChat.d.ts +42 -0
  12. package/dist/chat/brainyChat.js +340 -0
  13. package/dist/chat/brainyChat.js.map +1 -0
  14. package/dist/connectors/interfaces/IConnector.d.ts +143 -0
  15. package/dist/connectors/interfaces/IConnector.js +8 -0
  16. package/dist/connectors/interfaces/IConnector.js.map +1 -0
  17. package/dist/coreTypes.d.ts.map +1 -1
  18. package/dist/cortex/backupRestore.d.ts +85 -0
  19. package/dist/cortex/backupRestore.js +326 -0
  20. package/dist/cortex/backupRestore.js.map +1 -0
  21. package/dist/cortex/cortex.d.ts +249 -0
  22. package/dist/cortex/cortex.js +2304 -0
  23. package/dist/cortex/cortex.js.map +1 -0
  24. package/dist/cortex/healthCheck.d.ts +85 -0
  25. package/dist/cortex/healthCheck.js +546 -0
  26. package/dist/cortex/healthCheck.js.map +1 -0
  27. package/dist/cortex/licensingSystem.d.ts +126 -0
  28. package/dist/cortex/licensingSystem.js +474 -0
  29. package/dist/cortex/licensingSystem.js.map +1 -0
  30. package/dist/cortex/neuralImport.d.ts +145 -0
  31. package/dist/cortex/neuralImport.js +620 -0
  32. package/dist/cortex/neuralImport.js.map +1 -0
  33. package/dist/cortex/performanceMonitor.d.ts +150 -0
  34. package/dist/cortex/performanceMonitor.js +371 -0
  35. package/dist/cortex/performanceMonitor.js.map +1 -0
  36. package/dist/cortex/serviceIntegration.d.ts +156 -0
  37. package/dist/cortex/serviceIntegration.js +384 -0
  38. package/dist/cortex/serviceIntegration.js.map +1 -0
  39. package/dist/cortex/webhookManager.d.ts +39 -0
  40. package/dist/cortex/webhookManager.js +326 -0
  41. package/dist/cortex/webhookManager.js.map +1 -0
  42. package/dist/hnsw/hnswIndex.d.ts.map +1 -1
  43. package/dist/hnsw/hnswIndexOptimized.d.ts.map +1 -1
  44. package/dist/index.d.ts +4 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +5 -0
  47. package/dist/index.js.map +1 -1
  48. package/dist/patched-platform-node.d.ts +17 -0
  49. package/dist/patched-platform-node.d.ts.map +1 -0
  50. package/dist/shared/default-augmentations.d.ts +41 -0
  51. package/dist/shared/default-augmentations.js +112 -0
  52. package/dist/shared/default-augmentations.js.map +1 -0
  53. package/dist/storage/adapters/baseStorageAdapter.d.ts.map +1 -1
  54. package/dist/storage/adapters/fileSystemStorage.d.ts +14 -0
  55. package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -1
  56. package/dist/storage/adapters/fileSystemStorage.js +68 -0
  57. package/dist/storage/adapters/fileSystemStorage.js.map +1 -1
  58. package/dist/storage/adapters/memoryStorage.d.ts +13 -0
  59. package/dist/storage/adapters/memoryStorage.d.ts.map +1 -1
  60. package/dist/storage/adapters/memoryStorage.js +19 -0
  61. package/dist/storage/adapters/memoryStorage.js.map +1 -1
  62. package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
  63. package/dist/storage/adapters/s3CompatibleStorage.d.ts.map +1 -1
  64. package/dist/storage/baseStorage.d.ts.map +1 -1
  65. package/dist/storage/storageFactory.d.ts.map +1 -1
  66. package/dist/testing/prettyReporter.d.ts +23 -0
  67. package/dist/testing/prettyReporter.d.ts.map +1 -0
  68. package/dist/testing/prettySummaryReporter.d.ts +22 -0
  69. package/dist/testing/prettySummaryReporter.d.ts.map +1 -0
  70. package/dist/types/augmentations.d.ts +48 -1
  71. package/dist/unified.min.js +12511 -0
  72. package/dist/unified.min.js.map +1 -0
  73. package/dist/utils/embedding.d.ts.map +1 -1
  74. package/dist/utils/embedding.js +1 -0
  75. package/dist/utils/embedding.js.map +1 -1
  76. package/dist/utils/index.d.ts.map +1 -1
  77. package/dist/utils/tensorflowUtils.d.ts +17 -0
  78. package/dist/utils/tensorflowUtils.d.ts.map +1 -0
  79. package/dist/webhooks/webhookSystem.d.ts +114 -0
  80. package/dist/webhooks/webhookSystem.js +321 -0
  81. package/dist/webhooks/webhookSystem.js.map +1 -0
  82. package/package.json +11 -1
  83. package/dist/browserFramework.d.ts.map +0 -1
  84. package/dist/demo.d.ts.map +0 -1
  85. package/dist/distributed/configManager.d.ts.map +0 -1
  86. package/dist/distributed/domainDetector.d.ts.map +0 -1
  87. package/dist/distributed/hashPartitioner.d.ts.map +0 -1
  88. package/dist/distributed/healthMonitor.d.ts.map +0 -1
  89. package/dist/distributed/index.d.ts.map +0 -1
  90. package/dist/distributed/operationalModes.d.ts.map +0 -1
  91. package/dist/hnsw/distributedSearch.d.ts.map +0 -1
  92. package/dist/hnsw/optimizedHNSWIndex.d.ts.map +0 -1
  93. package/dist/hnsw/partitionedHNSWIndex.d.ts.map +0 -1
  94. package/dist/hnsw/scaledHNSWSystem.d.ts.map +0 -1
  95. package/dist/storage/adapters/batchS3Operations.d.ts.map +0 -1
  96. package/dist/storage/adapters/optimizedS3Search.d.ts.map +0 -1
  97. package/dist/storage/cacheManager.d.ts.map +0 -1
  98. package/dist/storage/enhancedCacheManager.d.ts.map +0 -1
  99. package/dist/storage/readOnlyOptimizations.d.ts.map +0 -1
  100. package/dist/types/distributedTypes.d.ts.map +0 -1
  101. package/dist/types/paginationTypes.d.ts.map +0 -1
  102. package/dist/types/tensorflowTypes.js +0 -6
  103. package/dist/types/tensorflowTypes.js.map +0 -1
  104. package/dist/utils/autoConfiguration.d.ts.map +0 -1
  105. package/dist/utils/cacheAutoConfig.d.ts.map +0 -1
  106. package/dist/utils/crypto.d.ts.map +0 -1
  107. package/dist/utils/fieldNameTracking.d.ts.map +0 -1
  108. package/dist/utils/jsonProcessing.d.ts.map +0 -1
  109. package/dist/utils/logger.d.ts.map +0 -1
  110. package/dist/utils/robustModelLoader.d.ts +0 -112
  111. package/dist/utils/robustModelLoader.d.ts.map +0 -1
  112. package/dist/utils/robustModelLoader.js +0 -624
  113. package/dist/utils/robustModelLoader.js.map +0 -1
  114. package/dist/utils/searchCache.d.ts.map +0 -1
  115. package/dist/utils/statisticsCollector.d.ts.map +0 -1
  116. package/dist/utils/typeUtils.d.ts.map +0 -1
  117. package/dist/utils/version.d.ts.map +0 -1
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Neural Import SENSE Augmentation - Atomic Age AI-Powered Data Understanding
3
+ *
4
+ * 🧠 The brain-in-jar's sensory system for perceiving and structuring data
5
+ * ⚛️ Complete with confidence scoring and relationship weight calculation
6
+ */
7
+ import { ISenseAugmentation, AugmentationResponse } from '../types/augmentations.js';
8
+ import { BrainyData } from '../brainyData.js';
9
+ export interface NeuralAnalysisResult {
10
+ detectedEntities: DetectedEntity[];
11
+ detectedRelationships: DetectedRelationship[];
12
+ confidence: number;
13
+ insights: NeuralInsight[];
14
+ }
15
+ export interface DetectedEntity {
16
+ originalData: any;
17
+ nounType: string;
18
+ confidence: number;
19
+ suggestedId: string;
20
+ reasoning: string;
21
+ alternativeTypes: Array<{
22
+ type: string;
23
+ confidence: number;
24
+ }>;
25
+ }
26
+ export interface DetectedRelationship {
27
+ sourceId: string;
28
+ targetId: string;
29
+ verbType: string;
30
+ confidence: number;
31
+ weight: number;
32
+ reasoning: string;
33
+ context: string;
34
+ metadata?: Record<string, any>;
35
+ }
36
+ export interface NeuralInsight {
37
+ type: 'hierarchy' | 'cluster' | 'pattern' | 'anomaly' | 'opportunity';
38
+ description: string;
39
+ confidence: number;
40
+ affectedEntities: string[];
41
+ recommendation?: string;
42
+ }
43
+ export interface NeuralImportSenseConfig {
44
+ confidenceThreshold: number;
45
+ enableWeights: boolean;
46
+ skipDuplicates: boolean;
47
+ categoryFilter?: string[];
48
+ }
49
+ /**
50
+ * Neural Import SENSE Augmentation - The Brain's Perceptual System
51
+ */
52
+ export declare class NeuralImportSenseAugmentation implements ISenseAugmentation {
53
+ readonly name: string;
54
+ readonly description: string;
55
+ enabled: boolean;
56
+ private brainy;
57
+ private config;
58
+ constructor(brainy: BrainyData, config?: Partial<NeuralImportSenseConfig>);
59
+ initialize(): Promise<void>;
60
+ shutDown(): Promise<void>;
61
+ getStatus(): Promise<'active' | 'inactive' | 'error'>;
62
+ /**
63
+ * Process raw data into structured nouns and verbs using neural analysis
64
+ */
65
+ processRawData(rawData: Buffer | string, dataType: string, options?: Record<string, unknown>): Promise<AugmentationResponse<{
66
+ nouns: string[];
67
+ verbs: string[];
68
+ confidence?: number;
69
+ insights?: Array<{
70
+ type: string;
71
+ description: string;
72
+ confidence: number;
73
+ }>;
74
+ metadata?: Record<string, unknown>;
75
+ }>>;
76
+ /**
77
+ * Listen to real-time data feeds and process them
78
+ */
79
+ listenToFeed(feedUrl: string, callback: (data: {
80
+ nouns: string[];
81
+ verbs: string[];
82
+ confidence?: number;
83
+ }) => void): Promise<void>;
84
+ /**
85
+ * Analyze data structure without processing (preview mode)
86
+ */
87
+ analyzeStructure(rawData: Buffer | string, dataType: string, options?: Record<string, unknown>): Promise<AugmentationResponse<{
88
+ entityTypes: Array<{
89
+ type: string;
90
+ count: number;
91
+ confidence: number;
92
+ }>;
93
+ relationshipTypes: Array<{
94
+ type: string;
95
+ count: number;
96
+ confidence: number;
97
+ }>;
98
+ dataQuality: {
99
+ completeness: number;
100
+ consistency: number;
101
+ accuracy: number;
102
+ };
103
+ recommendations: string[];
104
+ }>>;
105
+ /**
106
+ * Validate data compatibility with current knowledge base
107
+ */
108
+ validateCompatibility(rawData: Buffer | string, dataType: string): Promise<AugmentationResponse<{
109
+ compatible: boolean;
110
+ issues: Array<{
111
+ type: string;
112
+ description: string;
113
+ severity: 'low' | 'medium' | 'high';
114
+ }>;
115
+ suggestions: string[];
116
+ }>>;
117
+ /**
118
+ * Get the full neural analysis result (custom method for Cortex integration)
119
+ */
120
+ getNeuralAnalysis(rawData: Buffer | string, dataType: string): Promise<NeuralAnalysisResult>;
121
+ /**
122
+ * Parse raw data based on type
123
+ */
124
+ private parseRawData;
125
+ /**
126
+ * Basic CSV parser
127
+ */
128
+ private parseCSV;
129
+ /**
130
+ * Perform neural analysis on parsed data
131
+ */
132
+ private performNeuralAnalysis;
133
+ /**
134
+ * Neural Entity Detection - The Core AI Engine
135
+ */
136
+ private detectEntitiesWithNeuralAnalysis;
137
+ /**
138
+ * Calculate entity type confidence using AI
139
+ */
140
+ private calculateEntityTypeConfidence;
141
+ /**
142
+ * Field-based confidence calculation
143
+ */
144
+ private calculateFieldBasedConfidence;
145
+ /**
146
+ * Pattern-based confidence calculation
147
+ */
148
+ private calculatePatternBasedConfidence;
149
+ /**
150
+ * Generate reasoning for entity type selection
151
+ */
152
+ private generateEntityReasoning;
153
+ /**
154
+ * Neural Relationship Detection
155
+ */
156
+ private detectRelationshipsWithNeuralAnalysis;
157
+ /**
158
+ * Calculate relationship confidence
159
+ */
160
+ private calculateRelationshipConfidence;
161
+ /**
162
+ * Calculate relationship weight/strength
163
+ */
164
+ private calculateRelationshipWeight;
165
+ /**
166
+ * Generate Neural Insights - The Intelligence Layer
167
+ */
168
+ private generateNeuralInsights;
169
+ /**
170
+ * Helper methods for the neural system
171
+ */
172
+ private extractMainText;
173
+ private generateSmartId;
174
+ private extractRelationshipContext;
175
+ private calculateTypeCompatibility;
176
+ private getVerbSpecificity;
177
+ private getRelevantFields;
178
+ private getMatchedPatterns;
179
+ private pruneRelationships;
180
+ private detectHierarchies;
181
+ private detectClusters;
182
+ private detectPatterns;
183
+ private calculateOverallConfidence;
184
+ private storeNeuralAnalysis;
185
+ private getDataTypeFromPath;
186
+ private generateRelationshipReasoning;
187
+ private extractRelationshipMetadata;
188
+ /**
189
+ * Assess data quality metrics
190
+ */
191
+ private assessDataQuality;
192
+ /**
193
+ * Generate recommendations based on analysis
194
+ */
195
+ private generateRecommendations;
196
+ }