@soulcraft/brainy 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/CHANGELOG.md +53 -3
  2. package/README.md +353 -110
  3. package/bin/brainy.js +340 -62
  4. package/dist/api/ConfigAPI.d.ts +67 -0
  5. package/dist/api/ConfigAPI.js +166 -0
  6. package/dist/api/DataAPI.d.ts +123 -0
  7. package/dist/api/DataAPI.js +391 -0
  8. package/dist/api/SecurityAPI.d.ts +50 -0
  9. package/dist/api/SecurityAPI.js +139 -0
  10. package/dist/api/UniversalImportAPI.d.ts +134 -0
  11. package/dist/api/UniversalImportAPI.js +615 -0
  12. package/dist/augmentationManager.js +12 -7
  13. package/dist/augmentationPipeline.d.ts +0 -61
  14. package/dist/augmentationPipeline.js +0 -87
  15. package/dist/augmentationRegistry.d.ts +1 -1
  16. package/dist/augmentationRegistry.js +1 -1
  17. package/dist/augmentations/apiServerAugmentation.d.ts +27 -1
  18. package/dist/augmentations/apiServerAugmentation.js +290 -9
  19. package/dist/augmentations/auditLogAugmentation.d.ts +109 -0
  20. package/dist/augmentations/auditLogAugmentation.js +358 -0
  21. package/dist/augmentations/batchProcessingAugmentation.d.ts +3 -2
  22. package/dist/augmentations/batchProcessingAugmentation.js +123 -22
  23. package/dist/augmentations/brainyAugmentation.d.ts +142 -8
  24. package/dist/augmentations/brainyAugmentation.js +179 -2
  25. package/dist/augmentations/cacheAugmentation.d.ts +8 -5
  26. package/dist/augmentations/cacheAugmentation.js +116 -17
  27. package/dist/augmentations/conduitAugmentations.d.ts +2 -2
  28. package/dist/augmentations/conduitAugmentations.js +2 -2
  29. package/dist/augmentations/configResolver.d.ts +122 -0
  30. package/dist/augmentations/configResolver.js +440 -0
  31. package/dist/augmentations/connectionPoolAugmentation.d.ts +3 -1
  32. package/dist/augmentations/connectionPoolAugmentation.js +37 -12
  33. package/dist/augmentations/defaultAugmentations.d.ts +14 -10
  34. package/dist/augmentations/defaultAugmentations.js +16 -11
  35. package/dist/augmentations/discovery/catalogDiscovery.d.ts +142 -0
  36. package/dist/augmentations/discovery/catalogDiscovery.js +249 -0
  37. package/dist/augmentations/discovery/localDiscovery.d.ts +84 -0
  38. package/dist/augmentations/discovery/localDiscovery.js +246 -0
  39. package/dist/augmentations/discovery/runtimeLoader.d.ts +97 -0
  40. package/dist/augmentations/discovery/runtimeLoader.js +337 -0
  41. package/dist/augmentations/discovery.d.ts +152 -0
  42. package/dist/augmentations/discovery.js +441 -0
  43. package/dist/augmentations/display/cache.d.ts +130 -0
  44. package/dist/augmentations/display/cache.js +319 -0
  45. package/dist/augmentations/display/fieldPatterns.d.ts +52 -0
  46. package/dist/augmentations/display/fieldPatterns.js +393 -0
  47. package/dist/augmentations/display/iconMappings.d.ts +57 -0
  48. package/dist/augmentations/display/iconMappings.js +68 -0
  49. package/dist/augmentations/display/intelligentComputation.d.ts +109 -0
  50. package/dist/augmentations/display/intelligentComputation.js +462 -0
  51. package/dist/augmentations/display/types.d.ts +203 -0
  52. package/dist/augmentations/display/types.js +7 -0
  53. package/dist/augmentations/entityRegistryAugmentation.d.ts +3 -1
  54. package/dist/augmentations/entityRegistryAugmentation.js +5 -1
  55. package/dist/augmentations/indexAugmentation.d.ts +5 -3
  56. package/dist/augmentations/indexAugmentation.js +5 -2
  57. package/dist/augmentations/intelligentVerbScoringAugmentation.d.ts +24 -7
  58. package/dist/augmentations/intelligentVerbScoringAugmentation.js +111 -27
  59. package/dist/augmentations/manifest.d.ts +176 -0
  60. package/dist/augmentations/manifest.js +8 -0
  61. package/dist/augmentations/marketplace/AugmentationMarketplace.d.ts +168 -0
  62. package/dist/augmentations/marketplace/AugmentationMarketplace.js +329 -0
  63. package/dist/augmentations/marketplace/cli.d.ts +47 -0
  64. package/dist/augmentations/marketplace/cli.js +265 -0
  65. package/dist/augmentations/metricsAugmentation.d.ts +3 -3
  66. package/dist/augmentations/metricsAugmentation.js +2 -2
  67. package/dist/augmentations/monitoringAugmentation.d.ts +3 -3
  68. package/dist/augmentations/monitoringAugmentation.js +2 -2
  69. package/dist/augmentations/neuralImport.d.ts +1 -1
  70. package/dist/augmentations/neuralImport.js +4 -4
  71. package/dist/augmentations/rateLimitAugmentation.d.ts +82 -0
  72. package/dist/augmentations/rateLimitAugmentation.js +321 -0
  73. package/dist/augmentations/requestDeduplicatorAugmentation.d.ts +2 -2
  74. package/dist/augmentations/requestDeduplicatorAugmentation.js +1 -1
  75. package/dist/augmentations/storageAugmentation.d.ts +1 -1
  76. package/dist/augmentations/storageAugmentation.js +2 -2
  77. package/dist/augmentations/storageAugmentations.d.ts +37 -8
  78. package/dist/augmentations/storageAugmentations.js +204 -15
  79. package/dist/augmentations/synapseAugmentation.d.ts +1 -1
  80. package/dist/augmentations/synapseAugmentation.js +35 -16
  81. package/dist/augmentations/typeMatching/brainyTypes.d.ts +83 -0
  82. package/dist/augmentations/typeMatching/brainyTypes.js +425 -0
  83. package/dist/augmentations/typeMatching/intelligentTypeMatcher.d.ts +39 -59
  84. package/dist/augmentations/typeMatching/intelligentTypeMatcher.js +103 -389
  85. package/dist/augmentations/universalDisplayAugmentation.d.ts +191 -0
  86. package/dist/augmentations/universalDisplayAugmentation.js +371 -0
  87. package/dist/brainy-unified.d.ts +106 -0
  88. package/dist/brainy-unified.js +327 -0
  89. package/dist/brainy.d.ts +273 -0
  90. package/dist/brainy.js +1181 -0
  91. package/dist/brainyData.d.ts +56 -111
  92. package/dist/brainyData.js +912 -756
  93. package/dist/brainyDataV3.d.ts +186 -0
  94. package/dist/brainyDataV3.js +337 -0
  95. package/dist/browserFramework.d.ts +6 -6
  96. package/dist/browserFramework.js +11 -8
  97. package/dist/browserFramework.minimal.d.ts +5 -5
  98. package/dist/browserFramework.minimal.js +11 -8
  99. package/dist/config/distributedPresets-new.d.ts +118 -0
  100. package/dist/config/distributedPresets-new.js +318 -0
  101. package/dist/config/distributedPresets.d.ts +118 -0
  102. package/dist/config/distributedPresets.js +318 -0
  103. package/dist/config/extensibleConfig.d.ts +99 -0
  104. package/dist/config/extensibleConfig.js +268 -0
  105. package/dist/config/index.d.ts +17 -0
  106. package/dist/config/index.js +35 -0
  107. package/dist/config/modelAutoConfig.d.ts +32 -0
  108. package/dist/config/modelAutoConfig.js +139 -0
  109. package/dist/config/modelPrecisionManager.d.ts +42 -0
  110. package/dist/config/modelPrecisionManager.js +98 -0
  111. package/dist/config/sharedConfigManager.d.ts +67 -0
  112. package/dist/config/sharedConfigManager.js +215 -0
  113. package/dist/config/storageAutoConfig.d.ts +41 -0
  114. package/dist/config/storageAutoConfig.js +328 -0
  115. package/dist/config/zeroConfig.d.ts +68 -0
  116. package/dist/config/zeroConfig.js +301 -0
  117. package/dist/cortex/backupRestore.d.ts +2 -2
  118. package/dist/cortex/backupRestore.js +85 -27
  119. package/dist/cortex/healthCheck.d.ts +2 -2
  120. package/dist/cortex/neuralImport.d.ts +2 -2
  121. package/dist/cortex/neuralImport.js +18 -13
  122. package/dist/cortex/performanceMonitor.d.ts +2 -2
  123. package/dist/critical/model-guardian.d.ts +4 -0
  124. package/dist/critical/model-guardian.js +31 -11
  125. package/dist/demo.d.ts +4 -4
  126. package/dist/demo.js +7 -7
  127. package/dist/distributed/cacheSync.d.ts +112 -0
  128. package/dist/distributed/cacheSync.js +265 -0
  129. package/dist/distributed/coordinator.d.ts +193 -0
  130. package/dist/distributed/coordinator.js +548 -0
  131. package/dist/distributed/httpTransport.d.ts +120 -0
  132. package/dist/distributed/httpTransport.js +446 -0
  133. package/dist/distributed/index.d.ts +8 -0
  134. package/dist/distributed/index.js +5 -0
  135. package/dist/distributed/networkTransport.d.ts +132 -0
  136. package/dist/distributed/networkTransport.js +633 -0
  137. package/dist/distributed/queryPlanner.d.ts +104 -0
  138. package/dist/distributed/queryPlanner.js +327 -0
  139. package/dist/distributed/readWriteSeparation.d.ts +134 -0
  140. package/dist/distributed/readWriteSeparation.js +350 -0
  141. package/dist/distributed/shardManager.d.ts +114 -0
  142. package/dist/distributed/shardManager.js +357 -0
  143. package/dist/distributed/shardMigration.d.ts +110 -0
  144. package/dist/distributed/shardMigration.js +289 -0
  145. package/dist/distributed/storageDiscovery.d.ts +160 -0
  146. package/dist/distributed/storageDiscovery.js +551 -0
  147. package/dist/embeddings/CachedEmbeddings.d.ts +40 -0
  148. package/dist/embeddings/CachedEmbeddings.js +146 -0
  149. package/dist/embeddings/EmbeddingManager.d.ts +102 -0
  150. package/dist/embeddings/EmbeddingManager.js +291 -0
  151. package/dist/embeddings/SingletonModelManager.d.ts +95 -0
  152. package/dist/embeddings/SingletonModelManager.js +220 -0
  153. package/dist/embeddings/index.d.ts +12 -0
  154. package/dist/embeddings/index.js +16 -0
  155. package/dist/embeddings/lightweight-embedder.d.ts +0 -1
  156. package/dist/embeddings/lightweight-embedder.js +4 -12
  157. package/dist/embeddings/model-manager.d.ts +11 -0
  158. package/dist/embeddings/model-manager.js +43 -7
  159. package/dist/embeddings/universal-memory-manager.d.ts +1 -1
  160. package/dist/embeddings/universal-memory-manager.js +27 -67
  161. package/dist/embeddings/worker-embedding.js +4 -8
  162. package/dist/errors/brainyError.d.ts +5 -1
  163. package/dist/errors/brainyError.js +12 -0
  164. package/dist/examples/basicUsage.js +7 -4
  165. package/dist/graph/graphAdjacencyIndex.d.ts +96 -0
  166. package/dist/graph/graphAdjacencyIndex.js +288 -0
  167. package/dist/graph/pathfinding.js +4 -2
  168. package/dist/hnsw/scaledHNSWSystem.js +11 -2
  169. package/dist/importManager.js +8 -5
  170. package/dist/index.d.ts +17 -22
  171. package/dist/index.js +37 -23
  172. package/dist/mcp/brainyMCPAdapter.d.ts +4 -4
  173. package/dist/mcp/brainyMCPAdapter.js +5 -5
  174. package/dist/mcp/brainyMCPService.d.ts +3 -3
  175. package/dist/mcp/brainyMCPService.js +3 -11
  176. package/dist/mcp/mcpAugmentationToolset.js +20 -30
  177. package/dist/neural/embeddedPatterns.d.ts +1 -1
  178. package/dist/neural/embeddedPatterns.js +2 -2
  179. package/dist/neural/entityExtractor.d.ts +65 -0
  180. package/dist/neural/entityExtractor.js +316 -0
  181. package/dist/neural/improvedNeuralAPI.d.ts +357 -0
  182. package/dist/neural/improvedNeuralAPI.js +2628 -0
  183. package/dist/neural/naturalLanguageProcessor.d.ts +155 -10
  184. package/dist/neural/naturalLanguageProcessor.js +941 -66
  185. package/dist/neural/naturalLanguageProcessorStatic.d.ts +2 -2
  186. package/dist/neural/naturalLanguageProcessorStatic.js +3 -3
  187. package/dist/neural/neuralAPI.js +8 -2
  188. package/dist/neural/patternLibrary.d.ts +57 -3
  189. package/dist/neural/patternLibrary.js +348 -13
  190. package/dist/neural/staticPatternMatcher.d.ts +2 -2
  191. package/dist/neural/staticPatternMatcher.js +2 -2
  192. package/dist/neural/types.d.ts +287 -0
  193. package/dist/neural/types.js +24 -0
  194. package/dist/shared/default-augmentations.d.ts +3 -3
  195. package/dist/shared/default-augmentations.js +5 -5
  196. package/dist/storage/adapters/baseStorageAdapter.d.ts +42 -0
  197. package/dist/storage/adapters/fileSystemStorage.d.ts +26 -2
  198. package/dist/storage/adapters/fileSystemStorage.js +218 -15
  199. package/dist/storage/adapters/memoryStorage.d.ts +4 -4
  200. package/dist/storage/adapters/memoryStorage.js +17 -12
  201. package/dist/storage/adapters/opfsStorage.d.ts +2 -2
  202. package/dist/storage/adapters/opfsStorage.js +2 -2
  203. package/dist/storage/adapters/s3CompatibleStorage.d.ts +2 -2
  204. package/dist/storage/adapters/s3CompatibleStorage.js +2 -2
  205. package/dist/storage/backwardCompatibility.d.ts +10 -78
  206. package/dist/storage/backwardCompatibility.js +17 -132
  207. package/dist/storage/baseStorage.d.ts +18 -2
  208. package/dist/storage/baseStorage.js +74 -3
  209. package/dist/storage/cacheManager.js +2 -2
  210. package/dist/storage/readOnlyOptimizations.js +8 -3
  211. package/dist/streaming/pipeline.d.ts +154 -0
  212. package/dist/streaming/pipeline.js +551 -0
  213. package/dist/triple/TripleIntelligence.d.ts +25 -110
  214. package/dist/triple/TripleIntelligence.js +4 -574
  215. package/dist/triple/TripleIntelligenceSystem.d.ts +159 -0
  216. package/dist/triple/TripleIntelligenceSystem.js +519 -0
  217. package/dist/types/apiTypes.d.ts +278 -0
  218. package/dist/types/apiTypes.js +33 -0
  219. package/dist/types/brainy.types.d.ts +308 -0
  220. package/dist/types/brainy.types.js +8 -0
  221. package/dist/types/brainyDataInterface.d.ts +5 -8
  222. package/dist/types/brainyDataInterface.js +2 -2
  223. package/dist/types/graphTypes.js +2 -2
  224. package/dist/utils/brainyTypes.d.ts +217 -0
  225. package/dist/utils/brainyTypes.js +261 -0
  226. package/dist/utils/cacheAutoConfig.d.ts +3 -3
  227. package/dist/utils/embedding.d.ts +9 -4
  228. package/dist/utils/embedding.js +89 -26
  229. package/dist/utils/enhancedLogger.d.ts +104 -0
  230. package/dist/utils/enhancedLogger.js +232 -0
  231. package/dist/utils/hybridModelManager.d.ts +19 -28
  232. package/dist/utils/hybridModelManager.js +36 -200
  233. package/dist/utils/index.d.ts +1 -1
  234. package/dist/utils/index.js +1 -1
  235. package/dist/utils/intelligentTypeMapper.d.ts +60 -0
  236. package/dist/utils/intelligentTypeMapper.js +349 -0
  237. package/dist/utils/metadataIndex.d.ts +118 -1
  238. package/dist/utils/metadataIndex.js +539 -16
  239. package/dist/utils/nodeVersionCheck.d.ts +24 -0
  240. package/dist/utils/nodeVersionCheck.js +65 -0
  241. package/dist/utils/paramValidation.d.ts +39 -0
  242. package/dist/utils/paramValidation.js +192 -0
  243. package/dist/utils/rateLimiter.d.ts +160 -0
  244. package/dist/utils/rateLimiter.js +271 -0
  245. package/dist/utils/statistics.d.ts +4 -4
  246. package/dist/utils/statistics.js +3 -3
  247. package/dist/utils/structuredLogger.d.ts +146 -0
  248. package/dist/utils/structuredLogger.js +394 -0
  249. package/dist/utils/textEncoding.js +2 -1
  250. package/dist/utils/typeValidation.d.ts +59 -0
  251. package/dist/utils/typeValidation.js +374 -0
  252. package/dist/utils/version.js +19 -3
  253. package/package.json +15 -4
  254. package/scripts/download-models.cjs +94 -20
  255. package/dist/augmentations/walAugmentation.d.ts +0 -109
  256. package/dist/augmentations/walAugmentation.js +0 -516
  257. package/dist/chat/BrainyChat.d.ts +0 -121
  258. package/dist/chat/BrainyChat.js +0 -396
  259. package/dist/chat/ChatCLI.d.ts +0 -61
  260. package/dist/chat/ChatCLI.js +0 -351
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Extended Distributed Configuration Presets
3
+ * Common patterns for distributed and multi-service architectures
4
+ * All strongly typed with enums for compile-time safety
5
+ */
6
+ /**
7
+ * Strongly typed enum for preset names
8
+ */
9
+ export declare enum PresetName {
10
+ PRODUCTION = "production",
11
+ DEVELOPMENT = "development",
12
+ MINIMAL = "minimal",
13
+ ZERO = "zero",
14
+ WRITER = "writer",
15
+ READER = "reader",
16
+ INGESTION_SERVICE = "ingestion-service",
17
+ SEARCH_API = "search-api",
18
+ ANALYTICS_SERVICE = "analytics-service",
19
+ EDGE_CACHE = "edge-cache",
20
+ BATCH_PROCESSOR = "batch-processor",
21
+ STREAMING_SERVICE = "streaming-service",
22
+ ML_TRAINING = "ml-training",
23
+ SIDECAR = "sidecar"
24
+ }
25
+ /**
26
+ * Preset categories for organization
27
+ */
28
+ export declare enum PresetCategory {
29
+ BASIC = "basic",
30
+ DISTRIBUTED = "distributed",
31
+ SERVICE = "service"
32
+ }
33
+ /**
34
+ * Model precision options
35
+ */
36
+ export declare enum ModelPrecision {
37
+ FP32 = "fp32",
38
+ Q8 = "q8",
39
+ AUTO = "auto",
40
+ FAST = "fast",
41
+ SMALL = "small"
42
+ }
43
+ /**
44
+ * Storage options
45
+ */
46
+ export declare enum StorageOption {
47
+ AUTO = "auto",
48
+ MEMORY = "memory",
49
+ DISK = "disk",
50
+ CLOUD = "cloud"
51
+ }
52
+ /**
53
+ * Feature set options
54
+ */
55
+ export declare enum FeatureSet {
56
+ MINIMAL = "minimal",
57
+ DEFAULT = "default",
58
+ FULL = "full",
59
+ CUSTOM = "custom"
60
+ }
61
+ /**
62
+ * Distributed role options
63
+ */
64
+ export declare enum DistributedRole {
65
+ WRITER = "writer",
66
+ READER = "reader",
67
+ HYBRID = "hybrid"
68
+ }
69
+ /**
70
+ * Preset configuration interface
71
+ */
72
+ export interface PresetConfig {
73
+ storage: StorageOption;
74
+ model: ModelPrecision;
75
+ features: FeatureSet | string[];
76
+ distributed: boolean;
77
+ role?: DistributedRole;
78
+ readOnly?: boolean;
79
+ writeOnly?: boolean;
80
+ allowDirectReads?: boolean;
81
+ lazyLoadInReadOnlyMode?: boolean;
82
+ cache?: {
83
+ hotCacheMaxSize?: number;
84
+ autoTune?: boolean;
85
+ batchSize?: number;
86
+ };
87
+ verbose?: boolean;
88
+ description: string;
89
+ category: PresetCategory;
90
+ }
91
+ /**
92
+ * Strongly typed preset configurations
93
+ */
94
+ export declare const PRESET_CONFIGS: Readonly<Record<PresetName, PresetConfig>>;
95
+ /**
96
+ * Type-safe preset getter
97
+ */
98
+ export declare function getPreset(name: PresetName): PresetConfig;
99
+ /**
100
+ * Check if a string is a valid preset name
101
+ */
102
+ export declare function isValidPreset(name: string): name is PresetName;
103
+ /**
104
+ * Get presets by category
105
+ */
106
+ export declare function getPresetsByCategory(category: PresetCategory): PresetName[];
107
+ /**
108
+ * Get all preset names
109
+ */
110
+ export declare function getAllPresetNames(): PresetName[];
111
+ /**
112
+ * Get preset description
113
+ */
114
+ export declare function getPresetDescription(name: PresetName): string;
115
+ /**
116
+ * Convert preset config to Brainy config
117
+ */
118
+ export declare function presetToBrainyConfig(preset: PresetConfig): any;
@@ -0,0 +1,318 @@
1
+ /**
2
+ * Extended Distributed Configuration Presets
3
+ * Common patterns for distributed and multi-service architectures
4
+ * All strongly typed with enums for compile-time safety
5
+ */
6
+ /**
7
+ * Strongly typed enum for preset names
8
+ */
9
+ export var PresetName;
10
+ (function (PresetName) {
11
+ // Basic presets
12
+ PresetName["PRODUCTION"] = "production";
13
+ PresetName["DEVELOPMENT"] = "development";
14
+ PresetName["MINIMAL"] = "minimal";
15
+ PresetName["ZERO"] = "zero";
16
+ // Distributed presets
17
+ PresetName["WRITER"] = "writer";
18
+ PresetName["READER"] = "reader";
19
+ // Service-specific presets
20
+ PresetName["INGESTION_SERVICE"] = "ingestion-service";
21
+ PresetName["SEARCH_API"] = "search-api";
22
+ PresetName["ANALYTICS_SERVICE"] = "analytics-service";
23
+ PresetName["EDGE_CACHE"] = "edge-cache";
24
+ PresetName["BATCH_PROCESSOR"] = "batch-processor";
25
+ PresetName["STREAMING_SERVICE"] = "streaming-service";
26
+ PresetName["ML_TRAINING"] = "ml-training";
27
+ PresetName["SIDECAR"] = "sidecar";
28
+ })(PresetName || (PresetName = {}));
29
+ /**
30
+ * Preset categories for organization
31
+ */
32
+ export var PresetCategory;
33
+ (function (PresetCategory) {
34
+ PresetCategory["BASIC"] = "basic";
35
+ PresetCategory["DISTRIBUTED"] = "distributed";
36
+ PresetCategory["SERVICE"] = "service";
37
+ })(PresetCategory || (PresetCategory = {}));
38
+ /**
39
+ * Model precision options
40
+ */
41
+ export var ModelPrecision;
42
+ (function (ModelPrecision) {
43
+ ModelPrecision["FP32"] = "fp32";
44
+ ModelPrecision["Q8"] = "q8";
45
+ ModelPrecision["AUTO"] = "auto";
46
+ ModelPrecision["FAST"] = "fast";
47
+ ModelPrecision["SMALL"] = "small";
48
+ })(ModelPrecision || (ModelPrecision = {}));
49
+ /**
50
+ * Storage options
51
+ */
52
+ export var StorageOption;
53
+ (function (StorageOption) {
54
+ StorageOption["AUTO"] = "auto";
55
+ StorageOption["MEMORY"] = "memory";
56
+ StorageOption["DISK"] = "disk";
57
+ StorageOption["CLOUD"] = "cloud";
58
+ })(StorageOption || (StorageOption = {}));
59
+ /**
60
+ * Feature set options
61
+ */
62
+ export var FeatureSet;
63
+ (function (FeatureSet) {
64
+ FeatureSet["MINIMAL"] = "minimal";
65
+ FeatureSet["DEFAULT"] = "default";
66
+ FeatureSet["FULL"] = "full";
67
+ FeatureSet["CUSTOM"] = "custom"; // For custom feature arrays
68
+ })(FeatureSet || (FeatureSet = {}));
69
+ /**
70
+ * Distributed role options
71
+ */
72
+ export var DistributedRole;
73
+ (function (DistributedRole) {
74
+ DistributedRole["WRITER"] = "writer";
75
+ DistributedRole["READER"] = "reader";
76
+ DistributedRole["HYBRID"] = "hybrid";
77
+ })(DistributedRole || (DistributedRole = {}));
78
+ /**
79
+ * Strongly typed preset configurations
80
+ */
81
+ export const PRESET_CONFIGS = {
82
+ // Basic presets
83
+ [PresetName.PRODUCTION]: {
84
+ storage: StorageOption.DISK,
85
+ model: ModelPrecision.AUTO,
86
+ features: FeatureSet.DEFAULT,
87
+ distributed: false,
88
+ verbose: false,
89
+ description: 'Optimized for production use',
90
+ category: PresetCategory.BASIC
91
+ },
92
+ [PresetName.DEVELOPMENT]: {
93
+ storage: StorageOption.MEMORY,
94
+ model: ModelPrecision.FP32,
95
+ features: FeatureSet.FULL,
96
+ distributed: false,
97
+ verbose: true,
98
+ description: 'Optimized for development with verbose logging',
99
+ category: PresetCategory.BASIC
100
+ },
101
+ [PresetName.MINIMAL]: {
102
+ storage: StorageOption.MEMORY,
103
+ model: ModelPrecision.Q8,
104
+ features: FeatureSet.MINIMAL,
105
+ distributed: false,
106
+ verbose: false,
107
+ description: 'Minimal footprint configuration',
108
+ category: PresetCategory.BASIC
109
+ },
110
+ [PresetName.ZERO]: {
111
+ storage: StorageOption.AUTO,
112
+ model: ModelPrecision.AUTO,
113
+ features: FeatureSet.DEFAULT,
114
+ distributed: false,
115
+ verbose: false,
116
+ description: 'True zero configuration with auto-detection',
117
+ category: PresetCategory.BASIC
118
+ },
119
+ // Distributed basic presets
120
+ [PresetName.WRITER]: {
121
+ storage: StorageOption.AUTO,
122
+ model: ModelPrecision.AUTO,
123
+ features: FeatureSet.MINIMAL,
124
+ distributed: true,
125
+ role: DistributedRole.WRITER,
126
+ writeOnly: true,
127
+ allowDirectReads: true,
128
+ verbose: false,
129
+ description: 'Write-only instance for distributed setups',
130
+ category: PresetCategory.DISTRIBUTED
131
+ },
132
+ [PresetName.READER]: {
133
+ storage: StorageOption.AUTO,
134
+ model: ModelPrecision.AUTO,
135
+ features: FeatureSet.DEFAULT,
136
+ distributed: true,
137
+ role: DistributedRole.READER,
138
+ readOnly: true,
139
+ lazyLoadInReadOnlyMode: true,
140
+ verbose: false,
141
+ description: 'Read-only instance for distributed setups',
142
+ category: PresetCategory.DISTRIBUTED
143
+ },
144
+ // Service-specific presets
145
+ [PresetName.INGESTION_SERVICE]: {
146
+ storage: StorageOption.CLOUD,
147
+ model: ModelPrecision.Q8,
148
+ features: ['core', 'batch-processing', 'entity-registry'],
149
+ distributed: true,
150
+ role: DistributedRole.WRITER,
151
+ writeOnly: true,
152
+ allowDirectReads: true,
153
+ verbose: false,
154
+ description: 'High-throughput data ingestion service',
155
+ category: PresetCategory.SERVICE
156
+ },
157
+ [PresetName.SEARCH_API]: {
158
+ storage: StorageOption.CLOUD,
159
+ model: ModelPrecision.FP32,
160
+ features: ['core', 'search', 'cache', 'triple-intelligence'],
161
+ distributed: true,
162
+ role: DistributedRole.READER,
163
+ readOnly: true,
164
+ lazyLoadInReadOnlyMode: true,
165
+ cache: {
166
+ hotCacheMaxSize: 10000,
167
+ autoTune: true
168
+ },
169
+ verbose: false,
170
+ description: 'Low-latency search API service',
171
+ category: PresetCategory.SERVICE
172
+ },
173
+ [PresetName.ANALYTICS_SERVICE]: {
174
+ storage: StorageOption.CLOUD,
175
+ model: ModelPrecision.AUTO,
176
+ features: ['core', 'search', 'metrics', 'monitoring'],
177
+ distributed: true,
178
+ role: DistributedRole.HYBRID,
179
+ verbose: false,
180
+ description: 'Analytics and data processing service',
181
+ category: PresetCategory.SERVICE
182
+ },
183
+ [PresetName.EDGE_CACHE]: {
184
+ storage: StorageOption.AUTO,
185
+ model: ModelPrecision.Q8,
186
+ features: ['core', 'search', 'cache'],
187
+ distributed: true,
188
+ role: DistributedRole.READER,
189
+ readOnly: true,
190
+ lazyLoadInReadOnlyMode: true,
191
+ cache: {
192
+ hotCacheMaxSize: 1000,
193
+ autoTune: false
194
+ },
195
+ verbose: false,
196
+ description: 'Edge location cache with minimal footprint',
197
+ category: PresetCategory.SERVICE
198
+ },
199
+ [PresetName.BATCH_PROCESSOR]: {
200
+ storage: StorageOption.CLOUD,
201
+ model: ModelPrecision.Q8,
202
+ features: ['core', 'batch-processing', 'neural-api'],
203
+ distributed: true,
204
+ role: DistributedRole.HYBRID,
205
+ cache: {
206
+ hotCacheMaxSize: 5000,
207
+ batchSize: 500
208
+ },
209
+ verbose: false,
210
+ description: 'Batch processing and bulk operations',
211
+ category: PresetCategory.SERVICE
212
+ },
213
+ [PresetName.STREAMING_SERVICE]: {
214
+ storage: StorageOption.CLOUD,
215
+ model: ModelPrecision.Q8,
216
+ features: ['core', 'batch-processing', 'wal'],
217
+ distributed: true,
218
+ role: DistributedRole.WRITER,
219
+ writeOnly: true,
220
+ allowDirectReads: false,
221
+ verbose: false,
222
+ description: 'Real-time data streaming service',
223
+ category: PresetCategory.SERVICE
224
+ },
225
+ [PresetName.ML_TRAINING]: {
226
+ storage: StorageOption.CLOUD,
227
+ model: ModelPrecision.FP32,
228
+ features: FeatureSet.FULL,
229
+ distributed: true,
230
+ role: DistributedRole.HYBRID,
231
+ cache: {
232
+ hotCacheMaxSize: 20000,
233
+ autoTune: true
234
+ },
235
+ verbose: true,
236
+ description: 'Machine learning training service',
237
+ category: PresetCategory.SERVICE
238
+ },
239
+ [PresetName.SIDECAR]: {
240
+ storage: StorageOption.AUTO,
241
+ model: ModelPrecision.Q8,
242
+ features: FeatureSet.MINIMAL,
243
+ distributed: false,
244
+ verbose: false,
245
+ description: 'Lightweight sidecar for microservices',
246
+ category: PresetCategory.SERVICE
247
+ }
248
+ };
249
+ /**
250
+ * Type-safe preset getter
251
+ */
252
+ export function getPreset(name) {
253
+ return PRESET_CONFIGS[name];
254
+ }
255
+ /**
256
+ * Check if a string is a valid preset name
257
+ */
258
+ export function isValidPreset(name) {
259
+ return Object.values(PresetName).includes(name);
260
+ }
261
+ /**
262
+ * Get presets by category
263
+ */
264
+ export function getPresetsByCategory(category) {
265
+ return Object.entries(PRESET_CONFIGS)
266
+ .filter(([_, config]) => config.category === category)
267
+ .map(([name]) => name);
268
+ }
269
+ /**
270
+ * Get all preset names
271
+ */
272
+ export function getAllPresetNames() {
273
+ return Object.values(PresetName);
274
+ }
275
+ /**
276
+ * Get preset description
277
+ */
278
+ export function getPresetDescription(name) {
279
+ return PRESET_CONFIGS[name].description;
280
+ }
281
+ /**
282
+ * Convert preset config to Brainy config
283
+ */
284
+ export function presetToBrainyConfig(preset) {
285
+ const config = {
286
+ storage: preset.storage,
287
+ model: preset.model,
288
+ verbose: preset.verbose
289
+ };
290
+ // Handle features
291
+ if (Array.isArray(preset.features)) {
292
+ config.features = preset.features;
293
+ }
294
+ else {
295
+ config.features = preset.features; // Will be expanded by processZeroConfig
296
+ }
297
+ // Handle distributed settings
298
+ if (preset.distributed) {
299
+ config.distributed = {
300
+ enabled: true,
301
+ role: preset.role
302
+ };
303
+ if (preset.readOnly)
304
+ config.readOnly = true;
305
+ if (preset.writeOnly)
306
+ config.writeOnly = true;
307
+ if (preset.allowDirectReads)
308
+ config.allowDirectReads = true;
309
+ if (preset.lazyLoadInReadOnlyMode)
310
+ config.lazyLoadInReadOnlyMode = true;
311
+ }
312
+ // Handle cache settings
313
+ if (preset.cache) {
314
+ config.cache = preset.cache;
315
+ }
316
+ return config;
317
+ }
318
+ //# sourceMappingURL=distributedPresets-new.js.map
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Extended Distributed Configuration Presets
3
+ * Common patterns for distributed and multi-service architectures
4
+ * All strongly typed with enums for compile-time safety
5
+ */
6
+ /**
7
+ * Strongly typed enum for preset names
8
+ */
9
+ export declare enum PresetName {
10
+ PRODUCTION = "production",
11
+ DEVELOPMENT = "development",
12
+ MINIMAL = "minimal",
13
+ ZERO = "zero",
14
+ WRITER = "writer",
15
+ READER = "reader",
16
+ INGESTION_SERVICE = "ingestion-service",
17
+ SEARCH_API = "search-api",
18
+ ANALYTICS_SERVICE = "analytics-service",
19
+ EDGE_CACHE = "edge-cache",
20
+ BATCH_PROCESSOR = "batch-processor",
21
+ STREAMING_SERVICE = "streaming-service",
22
+ ML_TRAINING = "ml-training",
23
+ SIDECAR = "sidecar"
24
+ }
25
+ /**
26
+ * Preset categories for organization
27
+ */
28
+ export declare enum PresetCategory {
29
+ BASIC = "basic",
30
+ DISTRIBUTED = "distributed",
31
+ SERVICE = "service"
32
+ }
33
+ /**
34
+ * Model precision options
35
+ */
36
+ export declare enum ModelPrecision {
37
+ FP32 = "fp32",
38
+ Q8 = "q8",
39
+ AUTO = "auto",
40
+ FAST = "fast",
41
+ SMALL = "small"
42
+ }
43
+ /**
44
+ * Storage options
45
+ */
46
+ export declare enum StorageOption {
47
+ AUTO = "auto",
48
+ MEMORY = "memory",
49
+ DISK = "disk",
50
+ CLOUD = "cloud"
51
+ }
52
+ /**
53
+ * Feature set options
54
+ */
55
+ export declare enum FeatureSet {
56
+ MINIMAL = "minimal",
57
+ DEFAULT = "default",
58
+ FULL = "full",
59
+ CUSTOM = "custom"
60
+ }
61
+ /**
62
+ * Distributed role options
63
+ */
64
+ export declare enum DistributedRole {
65
+ WRITER = "writer",
66
+ READER = "reader",
67
+ HYBRID = "hybrid"
68
+ }
69
+ /**
70
+ * Preset configuration interface
71
+ */
72
+ export interface PresetConfig {
73
+ storage: StorageOption;
74
+ model: ModelPrecision;
75
+ features: FeatureSet | string[];
76
+ distributed: boolean;
77
+ role?: DistributedRole;
78
+ readOnly?: boolean;
79
+ writeOnly?: boolean;
80
+ allowDirectReads?: boolean;
81
+ lazyLoadInReadOnlyMode?: boolean;
82
+ cache?: {
83
+ hotCacheMaxSize?: number;
84
+ autoTune?: boolean;
85
+ batchSize?: number;
86
+ };
87
+ verbose?: boolean;
88
+ description: string;
89
+ category: PresetCategory;
90
+ }
91
+ /**
92
+ * Strongly typed preset configurations
93
+ */
94
+ export declare const PRESET_CONFIGS: Readonly<Record<PresetName, PresetConfig>>;
95
+ /**
96
+ * Type-safe preset getter
97
+ */
98
+ export declare function getPreset(name: PresetName): PresetConfig;
99
+ /**
100
+ * Check if a string is a valid preset name
101
+ */
102
+ export declare function isValidPreset(name: string): name is PresetName;
103
+ /**
104
+ * Get presets by category
105
+ */
106
+ export declare function getPresetsByCategory(category: PresetCategory): PresetName[];
107
+ /**
108
+ * Get all preset names
109
+ */
110
+ export declare function getAllPresetNames(): PresetName[];
111
+ /**
112
+ * Get preset description
113
+ */
114
+ export declare function getPresetDescription(name: PresetName): string;
115
+ /**
116
+ * Convert preset config to Brainy config
117
+ */
118
+ export declare function presetToBrainyConfig(preset: PresetConfig): any;