@soulcraft/brainy 2.7.1 → 2.7.3

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
@@ -5,6 +5,13 @@ All notable changes to Brainy will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.7.3] - 2025-08-29
9
+
10
+ ### Fixed
11
+ - Allow automatic model downloads without requiring BRAINY_ALLOW_REMOTE_MODELS environment variable
12
+ - Models now download automatically when not present locally
13
+ - Fixed environment variable check to only block downloads when explicitly set to 'false'
14
+
8
15
  ## [2.0.0] - 2025-08-26
9
16
 
10
17
  ### 🎉 Major Release - Triple Intelligence™ Engine
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export { NeuralImport } from './cortex/neuralImport.js';
16
16
  export type { NeuralAnalysisResult, DetectedEntity, DetectedRelationship, NeuralInsight, NeuralImportOptions } from './cortex/neuralImport.js';
17
17
  import { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance, getStatistics } from './utils/index.js';
18
18
  export { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance, getStatistics };
19
+ export { getBrainyVersion } from './utils/version.js';
19
20
  import { UniversalSentenceEncoder, TransformerEmbedding, createEmbeddingFunction, defaultEmbeddingFunction, batchEmbed, embeddingFunctions } from './utils/embedding.js';
20
21
  import { executeInThread, cleanupWorkerPools } from './utils/workerUtils.js';
21
22
  import { logger, LogLevel, configureLogger, createModuleLogger } from './utils/logger.js';
package/dist/index.js CHANGED
@@ -19,6 +19,8 @@ export { NeuralImport } from './cortex/neuralImport.js';
19
19
  // Export distance functions for convenience
20
20
  import { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance, getStatistics } from './utils/index.js';
21
21
  export { euclideanDistance, cosineDistance, manhattanDistance, dotProductDistance, getStatistics };
22
+ // Export version utilities
23
+ export { getBrainyVersion } from './utils/version.js';
22
24
  // Export embedding functionality
23
25
  import { UniversalSentenceEncoder, TransformerEmbedding, createEmbeddingFunction, defaultEmbeddingFunction, batchEmbed, embeddingFunctions } from './utils/embedding.js';
24
26
  // Export worker utilities
@@ -76,9 +76,9 @@ export class TransformerEmbedding {
76
76
  // 1. Explicit option takes highest priority
77
77
  localFilesOnly = options.localFilesOnly;
78
78
  }
79
- else if (process.env.BRAINY_ALLOW_REMOTE_MODELS !== undefined) {
80
- // 2. Environment variable override
81
- localFilesOnly = process.env.BRAINY_ALLOW_REMOTE_MODELS !== 'true';
79
+ else if (process.env.BRAINY_ALLOW_REMOTE_MODELS === 'false') {
80
+ // 2. Environment variable explicitly disables remote models
81
+ localFilesOnly = true;
82
82
  }
83
83
  else if (process.env.NODE_ENV === 'development') {
84
84
  // 3. Development mode allows remote models
@@ -1,14 +1,30 @@
1
1
  /**
2
2
  * Version utilities for Brainy
3
3
  */
4
- // Package version - this should be updated during the build process
5
- const BRAINY_VERSION = '0.41.0';
4
+ import { readFileSync } from 'fs';
5
+ import { join, dirname } from 'path';
6
+ import { fileURLToPath } from 'url';
7
+ // Get package.json path relative to this file
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+ const packageJsonPath = join(__dirname, '../../package.json');
11
+ let cachedVersion = null;
6
12
  /**
7
13
  * Get the current Brainy package version
8
14
  * @returns The current version string
9
15
  */
10
16
  export function getBrainyVersion() {
11
- return BRAINY_VERSION;
17
+ if (!cachedVersion) {
18
+ try {
19
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
20
+ cachedVersion = packageJson.version;
21
+ }
22
+ catch {
23
+ // Fallback version if package.json can't be read
24
+ cachedVersion = '2.7.1';
25
+ }
26
+ }
27
+ return cachedVersion;
12
28
  }
13
29
  /**
14
30
  * Get version information for augmentation metadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
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",