@soulcraft/brainy 2.7.1 → 2.7.2

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/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
@@ -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.2",
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",