@soulcraft/brainy 3.29.0 → 3.30.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 CHANGED
@@ -2,6 +2,55 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.30.0](https://github.com/soulcraftlabs/brainy/compare/v3.29.1...v3.30.0) (2025-10-09)
6
+
7
+ - feat: remove legacy ImportManager, standardize getStats() API (58daf09)
8
+
9
+
10
+ ### [3.30.0] - BREAKING CHANGES - API Cleanup (2025-10-09)
11
+
12
+ #### ⚠️ BREAKING CHANGES
13
+
14
+ **1. Removed ImportManager**
15
+ - The legacy `ImportManager` and `createImportManager` exports have been removed
16
+ - Use `brain.import()` instead (available since v3.28.0 - newer, simpler, better)
17
+
18
+ **Migration:**
19
+ ```typescript
20
+ // ❌ OLD (removed):
21
+ import { createImportManager } from '@soulcraft/brainy'
22
+ const importer = createImportManager(brain)
23
+ await importer.init()
24
+ const result = await importer.import(data)
25
+
26
+ // ✅ NEW (use this):
27
+ const result = await brain.import(data, options)
28
+ // Same functionality, simpler API, available on all Brainy instances!
29
+ ```
30
+
31
+ **2. Documentation Fix: getStats() Not getStatistics()**
32
+ - Corrected all documentation to use `brain.getStats()` (the actual method)
33
+ - ⚠️ `brain.getStatistics()` **never existed** - this was a documentation error
34
+ - No code changes needed - just documentation corrections
35
+ - Note: `history.getStatistics()` still exists and is correct (different API)
36
+
37
+ **Why These Changes:**
38
+ - Eliminates API confusion reported by Soulcraft Studio team
39
+ - Single, consistent import API - no more dual systems
40
+ - Accurate documentation matching actual implementation
41
+ - Cleaner, simpler developer experience
42
+
43
+ **Impact:** LOW - Most users already using `brain.import()` (the newer API)
44
+
45
+ ---
46
+
47
+ ### [3.29.1](https://github.com/soulcraftlabs/brainy/compare/v3.29.0...v3.29.1) (2025-10-09)
48
+
49
+
50
+ ### 🐛 Bug Fixes
51
+
52
+ * pass entire storage config to createStorage (gcsNativeStorage now detected) ([7a58dd7](https://github.com/soulcraftlabs/brainy/commit/7a58dd774d956cb3b548064724f9f86c0754f82e))
53
+
5
54
  ## [3.29.0](https://github.com/soulcraftlabs/brainy/compare/v3.28.0...v3.29.0) (2025-10-09)
6
55
 
7
56
 
@@ -444,7 +444,7 @@ async function showStatistics(brain) {
444
444
  const spinner = ora('Gathering statistics...').start()
445
445
 
446
446
  try {
447
- const stats = await brain.getStatistics()
447
+ const stats = brain.getStats()
448
448
  spinner.succeed('Statistics loaded')
449
449
 
450
450
  console.log(boxen(
@@ -216,7 +216,7 @@ export class APIServerAugmentation extends BaseAugmentation {
216
216
  // Statistics endpoint
217
217
  app.get('/api/stats', async (_req, res) => {
218
218
  try {
219
- const stats = await this.context.brain.getStatistics();
219
+ const stats = this.context.brain.getStats();
220
220
  res.json({ success: true, stats });
221
221
  }
222
222
  catch (error) {
package/dist/brainy.js CHANGED
@@ -2227,10 +2227,9 @@ export class Brainy {
2227
2227
  * Setup storage
2228
2228
  */
2229
2229
  async setupStorage() {
2230
- const storage = await createStorage({
2231
- type: this.config.storage?.type || 'auto',
2232
- ...this.config.storage?.options
2233
- });
2230
+ // Pass the entire storage config object to createStorage
2231
+ // This ensures all storage-specific configs (gcsNativeStorage, s3Storage, etc.) are passed through
2232
+ const storage = await createStorage(this.config.storage);
2234
2233
  return storage;
2235
2234
  }
2236
2235
  /**
package/dist/index.d.ts CHANGED
@@ -15,8 +15,6 @@ export { PresetName, ModelPrecision, StorageOption, FeatureSet, DistributedRole,
15
15
  export { Cortex, cortex } from './cortex.js';
16
16
  export { NeuralImport } from './cortex/neuralImport.js';
17
17
  export type { NeuralAnalysisResult, DetectedEntity, DetectedRelationship, NeuralInsight, NeuralImportOptions } from './cortex/neuralImport.js';
18
- export { ImportManager, createImportManager } from './importManager.js';
19
- export type { ImportOptions, ImportResult } from './importManager.js';
20
18
  import { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance } from './utils/index.js';
21
19
  export { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance };
22
20
  export { getBrainyVersion } from './utils/version.js';
package/dist/index.js CHANGED
@@ -31,8 +31,7 @@ getPreset, isValidPreset, getPresetsByCategory, getAllPresetNames, getPresetDesc
31
31
  export { Cortex, cortex } from './cortex.js';
32
32
  // Export Neural Import (AI data understanding)
33
33
  export { NeuralImport } from './cortex/neuralImport.js';
34
- // Export Import Manager (comprehensive data import)
35
- export { ImportManager, createImportManager } from './importManager.js';
34
+ // Import Manager removed - use brain.import() instead (available on all Brainy instances)
36
35
  // Augmentation types are already exported later in the file
37
36
  // Export distance functions for convenience
38
37
  import { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance } from './utils/index.js';
@@ -125,8 +125,8 @@ export class NeuralAPI {
125
125
  */
126
126
  async outliers(threshold = 0.3) {
127
127
  // Get all items
128
- const stats = await this.brain.getStatistics();
129
- const totalItems = stats.nounCount;
128
+ const stats = this.brain.getStats();
129
+ const totalItems = stats.entities.total;
130
130
  if (totalItems === 0)
131
131
  return [];
132
132
  // For large datasets, use sampling
@@ -325,8 +325,8 @@ export class NeuralAPI {
325
325
  // Enterprise clustering implementations
326
326
  async getOptimalClusteringLevel() {
327
327
  // Analyze dataset size and return optimal HNSW level
328
- const stats = await this.brain.getStatistics();
329
- const itemCount = stats.nounCount;
328
+ const stats = this.brain.getStats();
329
+ const itemCount = stats.entities.total;
330
330
  if (itemCount < 1000)
331
331
  return 0;
332
332
  if (itemCount < 10000)
@@ -338,8 +338,8 @@ export class NeuralAPI {
338
338
  async getHNSWLevelNodes(level) {
339
339
  // Get nodes from specific HNSW level
340
340
  // For now, use search to get a representative sample
341
- const stats = await this.brain.getStatistics();
342
- const sampleSize = Math.min(100, Math.floor(stats.nounCount / (level + 1)));
341
+ const stats = this.brain.getStats();
342
+ const sampleSize = Math.min(100, Math.floor(stats.entities.total / (level + 1)));
343
343
  // Use search with a general query to get representative items
344
344
  const queryVector = await this.brain.embed('data information content');
345
345
  const allItems = await this.brain.search(queryVector, sampleSize * 2);
@@ -352,8 +352,8 @@ export class NeuralAPI {
352
352
  }
353
353
  async getSample(size, strategy) {
354
354
  // Use search to get a sample of items
355
- const stats = await this.brain.getStatistics();
356
- const maxSize = Math.min(size * 3, stats.nounCount); // Get more than needed for sampling
355
+ const stats = this.brain.getStats();
356
+ const maxSize = Math.min(size * 3, stats.entities.total); // Get more than needed for sampling
357
357
  const queryVector = await this.brain.embed('sample data content');
358
358
  const allItems = await this.brain.search(queryVector, maxSize);
359
359
  switch (strategy) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "3.29.0",
3
+ "version": "3.30.0",
4
4
  "description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",