@soulcraft/brainy 3.8.0 → 3.8.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.
|
@@ -4,10 +4,21 @@
|
|
|
4
4
|
* Brainy requires Node.js 22.x LTS for maximum stability with ONNX Runtime.
|
|
5
5
|
* This prevents V8 HandleScope locking issues in worker threads.
|
|
6
6
|
*/
|
|
7
|
+
import { isNode } from './environment.js';
|
|
7
8
|
/**
|
|
8
9
|
* Check if the current Node.js version is supported
|
|
9
10
|
*/
|
|
10
11
|
export function checkNodeVersion() {
|
|
12
|
+
// In browser environment, skip version check
|
|
13
|
+
if (!isNode()) {
|
|
14
|
+
return {
|
|
15
|
+
current: 'browser',
|
|
16
|
+
major: 0,
|
|
17
|
+
isSupported: true, // Always supported in browser
|
|
18
|
+
recommendation: 'Browser environment'
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
// Only access process.version in Node.js environment
|
|
11
22
|
const nodeVersion = process.version;
|
|
12
23
|
const majorVersion = parseInt(nodeVersion.split('.')[0].substring(1));
|
|
13
24
|
const versionInfo = {
|
|
@@ -23,6 +34,10 @@ export function checkNodeVersion() {
|
|
|
23
34
|
*/
|
|
24
35
|
export function enforceNodeVersion() {
|
|
25
36
|
const versionInfo = checkNodeVersion();
|
|
37
|
+
// Skip enforcement in browser environment
|
|
38
|
+
if (!isNode()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
26
41
|
if (!versionInfo.isSupported) {
|
|
27
42
|
const errorMessage = [
|
|
28
43
|
'🚨 BRAINY COMPATIBILITY ERROR',
|
|
@@ -50,6 +65,10 @@ export function enforceNodeVersion() {
|
|
|
50
65
|
*/
|
|
51
66
|
export function warnNodeVersion() {
|
|
52
67
|
const versionInfo = checkNodeVersion();
|
|
68
|
+
// Skip warning in browser environment
|
|
69
|
+
if (!isNode()) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
53
72
|
if (!versionInfo.isSupported) {
|
|
54
73
|
console.warn([
|
|
55
74
|
'⚠️ BRAINY VERSION WARNING',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
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",
|