@soulcraft/brainy 0.20.0 → 0.21.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/README.md +1 -1
- package/dist/augmentations/conduitAugmentations.js +1158 -0
- package/dist/augmentations/conduitAugmentations.js.map +1 -0
- package/dist/augmentations/memoryAugmentations.js +255 -0
- package/dist/augmentations/memoryAugmentations.js.map +1 -0
- package/dist/augmentations/serverSearchAugmentations.js +531 -0
- package/dist/augmentations/serverSearchAugmentations.js.map +1 -0
- package/dist/examples/basicUsage.js +128 -0
- package/dist/examples/basicUsage.js.map +1 -0
- package/dist/hnsw/hnswIndex.js +550 -0
- package/dist/hnsw/hnswIndex.js.map +1 -0
- package/dist/hnsw/hnswIndexOptimized.js +441 -0
- package/dist/hnsw/hnswIndexOptimized.js.map +1 -0
- package/dist/mcp/brainyMCPAdapter.js +142 -0
- package/dist/mcp/brainyMCPAdapter.js.map +1 -0
- package/dist/mcp/brainyMCPService.js +248 -0
- package/dist/mcp/brainyMCPService.js.map +1 -0
- package/dist/mcp/index.js +17 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/mcpAugmentationToolset.js +180 -0
- package/dist/mcp/mcpAugmentationToolset.js.map +1 -0
- package/dist/storage/adapters/baseStorageAdapter.d.ts +14 -0
- package/dist/storage/adapters/baseStorageAdapter.d.ts.map +1 -1
- package/dist/storage/adapters/baseStorageAdapter.js +233 -0
- package/dist/storage/adapters/baseStorageAdapter.js.map +1 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -1
- package/dist/storage/adapters/fileSystemStorage.js +568 -0
- package/dist/storage/adapters/fileSystemStorage.js.map +1 -0
- package/dist/storage/adapters/memoryStorage.d.ts.map +1 -1
- package/dist/storage/adapters/memoryStorage.js +300 -0
- package/dist/storage/adapters/memoryStorage.js.map +1 -0
- package/dist/storage/adapters/opfsStorage.d.ts +16 -0
- package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
- package/dist/storage/adapters/opfsStorage.js +778 -0
- package/dist/storage/adapters/opfsStorage.js.map +1 -0
- package/dist/storage/adapters/s3CompatibleStorage.d.ts +36 -1
- package/dist/storage/adapters/s3CompatibleStorage.d.ts.map +1 -1
- package/dist/storage/adapters/s3CompatibleStorage.js +1021 -0
- package/dist/storage/adapters/s3CompatibleStorage.js.map +1 -0
- package/dist/storage/baseStorage.js +126 -0
- package/dist/storage/baseStorage.js.map +1 -0
- package/dist/storage/storageFactory.js +183 -0
- package/dist/storage/storageFactory.js.map +1 -0
- package/dist/types/augmentations.js +16 -0
- package/dist/types/augmentations.js.map +1 -0
- package/dist/types/brainyDataInterface.js +8 -0
- package/dist/types/brainyDataInterface.js.map +1 -0
- package/dist/types/fileSystemTypes.js +8 -0
- package/dist/types/fileSystemTypes.js.map +1 -0
- package/dist/types/graphTypes.js +36 -0
- package/dist/types/graphTypes.js.map +1 -0
- package/dist/types/mcpTypes.js +22 -0
- package/dist/types/mcpTypes.js.map +1 -0
- package/dist/types/pipelineTypes.js +7 -0
- package/dist/types/pipelineTypes.js.map +1 -0
- package/dist/types/tensorflowTypes.js +6 -0
- package/dist/types/tensorflowTypes.js.map +1 -0
- package/dist/unified.js +464 -71
- package/dist/unified.min.js +435 -435
- package/dist/utils/distance.js +239 -0
- package/dist/utils/distance.js.map +1 -0
- package/dist/utils/embedding.js +622 -0
- package/dist/utils/embedding.js.map +1 -0
- package/dist/utils/environment.js +75 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/statistics.js +25 -0
- package/dist/utils/statistics.js.map +1 -0
- package/dist/utils/tensorflowUtils.js +25 -0
- package/dist/utils/tensorflowUtils.js.map +1 -0
- package/dist/utils/textEncoding.js +281 -0
- package/dist/utils/textEncoding.js.map +1 -0
- package/dist/utils/workerUtils.js +458 -0
- package/dist/utils/workerUtils.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for environment detection
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if code is running in a browser environment
|
|
6
|
+
*/
|
|
7
|
+
export function isBrowser() {
|
|
8
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Check if code is running in a Node.js environment
|
|
12
|
+
*/
|
|
13
|
+
export function isNode() {
|
|
14
|
+
// If browser environment is detected, prioritize it over Node.js
|
|
15
|
+
// This handles cases like jsdom where both window and process exist
|
|
16
|
+
if (isBrowser()) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return (typeof process !== 'undefined' &&
|
|
20
|
+
process.versions != null &&
|
|
21
|
+
process.versions.node != null);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if code is running in a Web Worker environment
|
|
25
|
+
*/
|
|
26
|
+
export function isWebWorker() {
|
|
27
|
+
return (typeof self === 'object' &&
|
|
28
|
+
self.constructor &&
|
|
29
|
+
self.constructor.name === 'DedicatedWorkerGlobalScope');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if Web Workers are available in the current environment
|
|
33
|
+
*/
|
|
34
|
+
export function areWebWorkersAvailable() {
|
|
35
|
+
return isBrowser() && typeof Worker !== 'undefined';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if Worker Threads are available in the current environment (Node.js)
|
|
39
|
+
*/
|
|
40
|
+
export async function areWorkerThreadsAvailable() {
|
|
41
|
+
if (!isNode())
|
|
42
|
+
return false;
|
|
43
|
+
try {
|
|
44
|
+
// Use dynamic import to avoid errors in browser environments
|
|
45
|
+
await import('worker_threads');
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Synchronous version that doesn't actually try to load the module
|
|
54
|
+
* This is safer in ES module environments
|
|
55
|
+
*/
|
|
56
|
+
export function areWorkerThreadsAvailableSync() {
|
|
57
|
+
if (!isNode())
|
|
58
|
+
return false;
|
|
59
|
+
// In Node.js 24.4.0+, worker_threads is always available
|
|
60
|
+
return parseInt(process.versions.node.split('.')[0]) >= 24;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Determine if threading is available in the current environment
|
|
64
|
+
* Returns true if either Web Workers (browser) or Worker Threads (Node.js) are available
|
|
65
|
+
*/
|
|
66
|
+
export function isThreadingAvailable() {
|
|
67
|
+
return areWebWorkersAvailable() || areWorkerThreadsAvailableSync();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Async version of isThreadingAvailable
|
|
71
|
+
*/
|
|
72
|
+
export async function isThreadingAvailableAsync() {
|
|
73
|
+
return areWebWorkersAvailable() || (await areWorkerThreadsAvailable());
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/utils/environment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAA;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,iEAAiE;IACjE,oEAAoE;IACpE,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,CACL,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,CAAC,QAAQ,IAAI,IAAI;QACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAC9B,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,CAAC,WAAW;QAChB,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ieving statistics from Brainy
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get statistics about the current state of a BrainyData instance
|
|
6
|
+
* This function provides access to statistics at the root level of the library
|
|
7
|
+
*
|
|
8
|
+
* @param instance A BrainyData instance to get statistics from
|
|
9
|
+
* @param options Additional options for retrieving statistics
|
|
10
|
+
* @returns Object containing counts of nouns, verbs, metadata entries, and HNSW index size
|
|
11
|
+
* @throws Error if the instance is not provided or if statistics retrieval fails
|
|
12
|
+
*/
|
|
13
|
+
export async function getStatistics(instance, options = {}) {
|
|
14
|
+
if (!instance) {
|
|
15
|
+
throw new Error('BrainyData instance must be provided to getStatistics');
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
return await instance.getStatistics(options);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error('Failed to get statistics:', error);
|
|
22
|
+
throw new Error(`Failed to get statistics: ${error}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=statistics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../../src/utils/statistics.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,QAAoB,EACpB,UAEI,EAAE;IAcN,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC5E,CAAC;IAED,IAAI,CAAC;QACD,OAAO,MAAM,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAA;QACjD,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAA;IACzD,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for TensorFlow.js compatibility
|
|
3
|
+
* This module provides utility functions that TensorFlow.js might need
|
|
4
|
+
* and avoids the need to use globalThis.util
|
|
5
|
+
*/
|
|
6
|
+
// Note: TensorFlow.js platform patch is applied in setup.ts
|
|
7
|
+
// This ensures the global PlatformNode class uses our text encoding utilities
|
|
8
|
+
/**
|
|
9
|
+
* Check if an array is a Float32Array
|
|
10
|
+
* @param arr - The array to check
|
|
11
|
+
* @returns True if the array is a Float32Array
|
|
12
|
+
*/
|
|
13
|
+
export function isFloat32Array(arr) {
|
|
14
|
+
return !!(arr instanceof Float32Array ||
|
|
15
|
+
(arr && Object.prototype.toString.call(arr) === '[object Float32Array]'));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if an array is a TypedArray
|
|
19
|
+
* @param arr - The array to check
|
|
20
|
+
* @returns True if the array is a TypedArray
|
|
21
|
+
*/
|
|
22
|
+
export function isTypedArray(arr) {
|
|
23
|
+
return !!(ArrayBuffer.isView(arr) && !(arr instanceof DataView));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tensorflowUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tensorflowUtils.js","sourceRoot":"","sources":["../../src/utils/tensorflowUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,4DAA4D;AAC5D,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,OAAO,CAAC,CAAC,CACP,GAAG,YAAY,YAAY;QAC3B,CAAC,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,uBAAuB,CAAC,CACzE,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,QAAQ,CAAC,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { isNode } from './environment.js';
|
|
2
|
+
/**
|
|
3
|
+
* Flag to track if the patch has been applied
|
|
4
|
+
*/
|
|
5
|
+
let patchApplied = false;
|
|
6
|
+
/**
|
|
7
|
+
* Monkeypatch TensorFlow.js's PlatformNode class to fix TextEncoder/TextDecoder issues
|
|
8
|
+
* CRITICAL: This runs immediately at the top level when this module is imported
|
|
9
|
+
*/
|
|
10
|
+
if (typeof globalThis !== 'undefined' && isNode()) {
|
|
11
|
+
try {
|
|
12
|
+
// Ensure TextEncoder/TextDecoder are globally available
|
|
13
|
+
if (typeof globalThis.TextEncoder === 'undefined') {
|
|
14
|
+
globalThis.TextEncoder = TextEncoder;
|
|
15
|
+
}
|
|
16
|
+
if (typeof globalThis.TextDecoder === 'undefined') {
|
|
17
|
+
globalThis.TextDecoder = TextDecoder;
|
|
18
|
+
}
|
|
19
|
+
// Patch global objects to handle the TensorFlow.js constructor issue
|
|
20
|
+
// This is needed because TF accesses TextEncoder/TextDecoder as constructors via this.util
|
|
21
|
+
if (typeof global !== 'undefined') {
|
|
22
|
+
if (!global.TextEncoder) {
|
|
23
|
+
global.TextEncoder = TextEncoder;
|
|
24
|
+
}
|
|
25
|
+
if (!global.TextDecoder) {
|
|
26
|
+
global.TextDecoder = TextDecoder;
|
|
27
|
+
}
|
|
28
|
+
// Also set the special global constructors that TensorFlow can use safely
|
|
29
|
+
global.__TextEncoder__ = TextEncoder;
|
|
30
|
+
global.__TextDecoder__ = TextDecoder;
|
|
31
|
+
}
|
|
32
|
+
// CRITICAL FIX: Create a custom util object that TensorFlow.js can use
|
|
33
|
+
// We'll make this available globally so TensorFlow.js can find it
|
|
34
|
+
const customUtil = {
|
|
35
|
+
TextEncoder: TextEncoder,
|
|
36
|
+
TextDecoder: TextDecoder,
|
|
37
|
+
types: {
|
|
38
|
+
isFloat32Array: (arr) => arr instanceof Float32Array,
|
|
39
|
+
isInt32Array: (arr) => arr instanceof Int32Array,
|
|
40
|
+
isUint8Array: (arr) => arr instanceof Uint8Array,
|
|
41
|
+
isUint8ClampedArray: (arr) => arr instanceof Uint8ClampedArray
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
// Make the custom util available globally
|
|
45
|
+
if (typeof global !== 'undefined') {
|
|
46
|
+
global.__brainy_util__ = customUtil;
|
|
47
|
+
}
|
|
48
|
+
// Try to patch the global require cache if possible
|
|
49
|
+
if (typeof global !== 'undefined' &&
|
|
50
|
+
global.require &&
|
|
51
|
+
global.require.cache) {
|
|
52
|
+
// Find the util module in the cache and patch it
|
|
53
|
+
for (const key in global.require.cache) {
|
|
54
|
+
if (key.endsWith('/util.js') || key === 'util') {
|
|
55
|
+
const utilModule = global.require.cache[key];
|
|
56
|
+
if (utilModule && utilModule.exports) {
|
|
57
|
+
Object.assign(utilModule.exports, customUtil);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// CRITICAL: Patch the Node.js util module directly
|
|
63
|
+
try {
|
|
64
|
+
const util = require('util');
|
|
65
|
+
// Ensure TextEncoder and TextDecoder are available as constructors
|
|
66
|
+
util.TextEncoder = TextEncoder;
|
|
67
|
+
util.TextDecoder = TextDecoder;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
// Ignore if util module is not available
|
|
71
|
+
}
|
|
72
|
+
// CRITICAL: Patch Float32Array to handle buffer alignment issues
|
|
73
|
+
// This fixes the "byte length of Float32Array should be a multiple of 4" error
|
|
74
|
+
if (typeof global !== 'undefined') {
|
|
75
|
+
const originalFloat32Array = global.Float32Array;
|
|
76
|
+
global.Float32Array = class extends originalFloat32Array {
|
|
77
|
+
constructor(arg, byteOffset, length) {
|
|
78
|
+
if (arg instanceof ArrayBuffer) {
|
|
79
|
+
// Ensure buffer is properly aligned for Float32Array (multiple of 4 bytes)
|
|
80
|
+
const alignedByteOffset = byteOffset || 0;
|
|
81
|
+
const alignedLength = length !== undefined
|
|
82
|
+
? length
|
|
83
|
+
: (arg.byteLength - alignedByteOffset) / 4;
|
|
84
|
+
// Check if the buffer slice is properly aligned
|
|
85
|
+
if ((arg.byteLength - alignedByteOffset) % 4 !== 0 &&
|
|
86
|
+
length === undefined) {
|
|
87
|
+
// Create a new aligned buffer if the original isn't properly aligned
|
|
88
|
+
const alignedByteLength = Math.floor((arg.byteLength - alignedByteOffset) / 4) * 4;
|
|
89
|
+
const alignedBuffer = new ArrayBuffer(alignedByteLength);
|
|
90
|
+
const sourceView = new Uint8Array(arg, alignedByteOffset, alignedByteLength);
|
|
91
|
+
const targetView = new Uint8Array(alignedBuffer);
|
|
92
|
+
targetView.set(sourceView);
|
|
93
|
+
super(alignedBuffer);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
super(arg, alignedByteOffset, alignedLength);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
super(arg, byteOffset, length);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
// Preserve static methods and properties
|
|
105
|
+
Object.setPrototypeOf(global.Float32Array, originalFloat32Array);
|
|
106
|
+
Object.defineProperty(global.Float32Array, 'name', {
|
|
107
|
+
value: 'Float32Array'
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(global.Float32Array, 'BYTES_PER_ELEMENT', {
|
|
110
|
+
value: 4
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// CRITICAL: Patch any empty util shims that bundlers might create
|
|
114
|
+
// This handles cases where bundlers provide empty shims for Node.js modules
|
|
115
|
+
if (typeof global !== 'undefined') {
|
|
116
|
+
// Look for common patterns of util shims in bundled code
|
|
117
|
+
const checkAndPatchUtilShim = (obj) => {
|
|
118
|
+
if (obj && typeof obj === 'object' && !obj.TextEncoder) {
|
|
119
|
+
obj.TextEncoder = TextEncoder;
|
|
120
|
+
obj.TextDecoder = TextDecoder;
|
|
121
|
+
obj.types = obj.types || {
|
|
122
|
+
isFloat32Array: (arr) => arr instanceof Float32Array,
|
|
123
|
+
isInt32Array: (arr) => arr instanceof Int32Array,
|
|
124
|
+
isUint8Array: (arr) => arr instanceof Uint8Array,
|
|
125
|
+
isUint8ClampedArray: (arr) => arr instanceof Uint8ClampedArray
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
// Patch any existing util-like objects in global scope
|
|
130
|
+
if (global._utilShim) {
|
|
131
|
+
checkAndPatchUtilShim(global._utilShim);
|
|
132
|
+
}
|
|
133
|
+
// CRITICAL: Patch the bundled util shim directly
|
|
134
|
+
// In bundled code, there's often a _utilShim object that needs patching
|
|
135
|
+
if (typeof globalThis !== 'undefined' &&
|
|
136
|
+
globalThis._utilShim) {
|
|
137
|
+
checkAndPatchUtilShim(globalThis._utilShim);
|
|
138
|
+
}
|
|
139
|
+
// CRITICAL: Create and patch a global _utilShim if it doesn't exist
|
|
140
|
+
// This ensures the bundled code will find the patched version
|
|
141
|
+
if (!global._utilShim) {
|
|
142
|
+
global._utilShim = {
|
|
143
|
+
TextEncoder: TextEncoder,
|
|
144
|
+
TextDecoder: TextDecoder,
|
|
145
|
+
types: {
|
|
146
|
+
isFloat32Array: (arr) => arr instanceof Float32Array,
|
|
147
|
+
isInt32Array: (arr) => arr instanceof Int32Array,
|
|
148
|
+
isUint8Array: (arr) => arr instanceof Uint8Array,
|
|
149
|
+
isUint8ClampedArray: (arr) => arr instanceof Uint8ClampedArray
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
checkAndPatchUtilShim(global._utilShim);
|
|
155
|
+
}
|
|
156
|
+
// Also ensure it's available on globalThis
|
|
157
|
+
if (typeof globalThis !== 'undefined' &&
|
|
158
|
+
!globalThis._utilShim) {
|
|
159
|
+
;
|
|
160
|
+
globalThis._utilShim = global._utilShim;
|
|
161
|
+
}
|
|
162
|
+
// Set up a property descriptor to catch util shim assignments
|
|
163
|
+
try {
|
|
164
|
+
Object.defineProperty(global, '_utilShim', {
|
|
165
|
+
get() {
|
|
166
|
+
return this.__utilShim || {};
|
|
167
|
+
},
|
|
168
|
+
set(value) {
|
|
169
|
+
checkAndPatchUtilShim(value);
|
|
170
|
+
this.__utilShim = value;
|
|
171
|
+
},
|
|
172
|
+
configurable: true
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
// Ignore if property can't be defined
|
|
177
|
+
}
|
|
178
|
+
// Also set up property descriptor on globalThis
|
|
179
|
+
try {
|
|
180
|
+
Object.defineProperty(globalThis, '_utilShim', {
|
|
181
|
+
get() {
|
|
182
|
+
return this.__utilShim || {};
|
|
183
|
+
},
|
|
184
|
+
set(value) {
|
|
185
|
+
checkAndPatchUtilShim(value);
|
|
186
|
+
this.__utilShim = value;
|
|
187
|
+
},
|
|
188
|
+
configurable: true
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
// Ignore if property can't be defined
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
console.log('Brainy: Successfully patched TensorFlow.js PlatformNode at module load time');
|
|
196
|
+
patchApplied = true;
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
console.warn('Brainy: Failed to apply early TensorFlow.js platform patch:', error);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Apply the TensorFlow.js platform patch if it hasn't been applied already
|
|
204
|
+
* This is a safety measure in case the module-level patch didn't run
|
|
205
|
+
* Now works across all environments: browser, Node.js, and serverless/server
|
|
206
|
+
*/
|
|
207
|
+
export async function applyTensorFlowPatch() {
|
|
208
|
+
// Apply patches for all non-browser environments that might need TensorFlow.js compatibility
|
|
209
|
+
// This includes Node.js, serverless environments, and other server environments
|
|
210
|
+
const isBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
211
|
+
if (isBrowserEnv) {
|
|
212
|
+
return; // Browser environments don't need these patches
|
|
213
|
+
}
|
|
214
|
+
// Get the appropriate global object for the current environment
|
|
215
|
+
const globalObj = (() => {
|
|
216
|
+
if (typeof globalThis !== 'undefined')
|
|
217
|
+
return globalThis;
|
|
218
|
+
if (typeof global !== 'undefined')
|
|
219
|
+
return global;
|
|
220
|
+
if (typeof self !== 'undefined')
|
|
221
|
+
return self;
|
|
222
|
+
return {}; // Fallback for unknown environments
|
|
223
|
+
})();
|
|
224
|
+
// Check if the critical globals exist, not just the flag
|
|
225
|
+
// This allows re-patching if globals have been deleted
|
|
226
|
+
const needsPatch = !patchApplied ||
|
|
227
|
+
typeof globalObj.__TextEncoder__ === 'undefined' ||
|
|
228
|
+
typeof globalObj.__TextDecoder__ === 'undefined';
|
|
229
|
+
if (!needsPatch) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
try {
|
|
233
|
+
console.log('Brainy: Applying TensorFlow.js platform patch via function call');
|
|
234
|
+
// CRITICAL FIX: Patch the global environment to ensure TextEncoder/TextDecoder are available
|
|
235
|
+
// This approach works by ensuring the global constructors are available before TensorFlow.js loads
|
|
236
|
+
// Now works across all environments: Node.js, serverless, and other server environments
|
|
237
|
+
// Make sure TextEncoder and TextDecoder are available globally
|
|
238
|
+
if (!globalObj.TextEncoder) {
|
|
239
|
+
globalObj.TextEncoder = TextEncoder;
|
|
240
|
+
}
|
|
241
|
+
if (!globalObj.TextDecoder) {
|
|
242
|
+
globalObj.TextDecoder = TextDecoder;
|
|
243
|
+
}
|
|
244
|
+
// Also set the special global constructors that TensorFlow can use safely
|
|
245
|
+
;
|
|
246
|
+
globalObj.__TextEncoder__ = TextEncoder;
|
|
247
|
+
globalObj.__TextDecoder__ = TextDecoder;
|
|
248
|
+
// Also patch process.versions to ensure TensorFlow.js detects Node.js correctly
|
|
249
|
+
if (typeof process !== 'undefined' && process.versions) {
|
|
250
|
+
// Ensure TensorFlow.js sees this as a Node.js environment
|
|
251
|
+
if (!process.versions.node) {
|
|
252
|
+
process.versions.node = process.version;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// CRITICAL: Patch the Node.js util module directly
|
|
256
|
+
try {
|
|
257
|
+
const util = await import('util');
|
|
258
|
+
// Ensure TextEncoder and TextDecoder are available as constructors
|
|
259
|
+
util.TextEncoder = TextEncoder;
|
|
260
|
+
util.TextDecoder = TextDecoder;
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
// Ignore if util module is not available
|
|
264
|
+
}
|
|
265
|
+
patchApplied = true;
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
console.warn('Brainy: Failed to apply TensorFlow.js platform patch:', error);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
export function getTextEncoder() {
|
|
272
|
+
return new TextEncoder();
|
|
273
|
+
}
|
|
274
|
+
export function getTextDecoder() {
|
|
275
|
+
return new TextDecoder();
|
|
276
|
+
}
|
|
277
|
+
// Apply patch immediately
|
|
278
|
+
applyTensorFlowPatch().catch((error) => {
|
|
279
|
+
console.warn('Failed to apply TensorFlow patch at module load:', error);
|
|
280
|
+
});
|
|
281
|
+
//# sourceMappingURL=textEncoding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textEncoding.js","sourceRoot":"","sources":["../../src/utils/textEncoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAuBzC;;GAEG;AACH,IAAI,YAAY,GAAG,KAAK,CAAA;AAExB;;;GAGG;AACH,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,MAAM,EAAE,EAAE,CAAC;IAClD,IAAI,CAAC;QACH,wDAAwD;QACxD,IAAI,OAAO,UAAU,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YAClD,UAAU,CAAC,WAAW,GAAG,WAAW,CAAA;QACtC,CAAC;QACD,IAAI,OAAO,UAAU,CAAC,WAAW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