@soulcraft/brainy 0.41.0 → 0.44.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.
Files changed (205) hide show
  1. package/README.md +605 -194
  2. package/dist/augmentationFactory.d.ts.map +1 -0
  3. package/dist/augmentationFactory.js +342 -0
  4. package/dist/augmentationFactory.js.map +1 -0
  5. package/dist/augmentationPipeline.d.ts.map +1 -0
  6. package/dist/augmentationPipeline.js +472 -0
  7. package/dist/augmentationPipeline.js.map +1 -0
  8. package/dist/augmentationRegistry.d.ts.map +1 -0
  9. package/dist/augmentationRegistry.js +105 -0
  10. package/dist/augmentationRegistry.js.map +1 -0
  11. package/dist/augmentationRegistryLoader.d.ts.map +1 -0
  12. package/dist/augmentationRegistryLoader.js +213 -0
  13. package/dist/augmentationRegistryLoader.js.map +1 -0
  14. package/dist/augmentations/conduitAugmentations.js +1158 -0
  15. package/dist/augmentations/conduitAugmentations.js.map +1 -0
  16. package/dist/augmentations/memoryAugmentations.d.ts +2 -0
  17. package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
  18. package/dist/augmentations/memoryAugmentations.js +270 -0
  19. package/dist/augmentations/memoryAugmentations.js.map +1 -0
  20. package/dist/augmentations/serverSearchAugmentations.js +531 -0
  21. package/dist/augmentations/serverSearchAugmentations.js.map +1 -0
  22. package/dist/brainyData.d.ts.map +1 -0
  23. package/dist/brainyData.js +3999 -0
  24. package/dist/brainyData.js.map +1 -0
  25. package/dist/browserFramework.d.ts +15 -0
  26. package/dist/browserFramework.d.ts.map +1 -0
  27. package/dist/browserFramework.js +31 -0
  28. package/dist/browserFramework.js.map +1 -0
  29. package/dist/coreTypes.d.ts.map +1 -0
  30. package/dist/coreTypes.js +5 -0
  31. package/dist/coreTypes.js.map +1 -0
  32. package/dist/demo.d.ts +106 -0
  33. package/dist/demo.d.ts.map +1 -0
  34. package/dist/demo.js +201 -0
  35. package/dist/demo.js.map +1 -0
  36. package/dist/distributed/configManager.d.ts.map +1 -0
  37. package/dist/distributed/configManager.js +322 -0
  38. package/dist/distributed/configManager.js.map +1 -0
  39. package/dist/distributed/domainDetector.d.ts.map +1 -0
  40. package/dist/distributed/domainDetector.js +307 -0
  41. package/dist/distributed/domainDetector.js.map +1 -0
  42. package/dist/distributed/hashPartitioner.d.ts.map +1 -0
  43. package/dist/distributed/hashPartitioner.js +146 -0
  44. package/dist/distributed/hashPartitioner.js.map +1 -0
  45. package/dist/distributed/healthMonitor.d.ts.map +1 -0
  46. package/dist/distributed/healthMonitor.js +244 -0
  47. package/dist/distributed/healthMonitor.js.map +1 -0
  48. package/dist/distributed/index.d.ts.map +1 -0
  49. package/dist/distributed/index.js +9 -0
  50. package/dist/distributed/index.js.map +1 -0
  51. package/dist/distributed/operationalModes.d.ts.map +1 -0
  52. package/dist/distributed/operationalModes.js +201 -0
  53. package/dist/distributed/operationalModes.js.map +1 -0
  54. package/dist/errors/brainyError.d.ts.map +1 -0
  55. package/dist/errors/brainyError.js +113 -0
  56. package/dist/errors/brainyError.js.map +1 -0
  57. package/dist/examples/basicUsage.js +118 -0
  58. package/dist/examples/basicUsage.js.map +1 -0
  59. package/dist/hnsw/distributedSearch.js +452 -0
  60. package/dist/hnsw/distributedSearch.js.map +1 -0
  61. package/dist/hnsw/hnswIndex.js +602 -0
  62. package/dist/hnsw/hnswIndex.js.map +1 -0
  63. package/dist/hnsw/hnswIndexOptimized.js +471 -0
  64. package/dist/hnsw/hnswIndexOptimized.js.map +1 -0
  65. package/dist/hnsw/optimizedHNSWIndex.js +313 -0
  66. package/dist/hnsw/optimizedHNSWIndex.js.map +1 -0
  67. package/dist/hnsw/partitionedHNSWIndex.js +304 -0
  68. package/dist/hnsw/partitionedHNSWIndex.js.map +1 -0
  69. package/dist/hnsw/scaledHNSWSystem.js +559 -0
  70. package/dist/hnsw/scaledHNSWSystem.js.map +1 -0
  71. package/dist/index.d.ts +3 -2
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +81 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/mcp/brainyMCPAdapter.js +142 -0
  76. package/dist/mcp/brainyMCPAdapter.js.map +1 -0
  77. package/dist/mcp/brainyMCPService.js +248 -0
  78. package/dist/mcp/brainyMCPService.js.map +1 -0
  79. package/dist/mcp/index.js +17 -0
  80. package/dist/mcp/index.js.map +1 -0
  81. package/dist/mcp/mcpAugmentationToolset.js +180 -0
  82. package/dist/mcp/mcpAugmentationToolset.js.map +1 -0
  83. package/dist/pipeline.d.ts.map +1 -0
  84. package/dist/pipeline.js +590 -0
  85. package/dist/pipeline.js.map +1 -0
  86. package/dist/sequentialPipeline.d.ts.map +1 -0
  87. package/dist/sequentialPipeline.js +417 -0
  88. package/dist/sequentialPipeline.js.map +1 -0
  89. package/dist/setup.d.ts.map +1 -0
  90. package/dist/setup.js +46 -0
  91. package/dist/setup.js.map +1 -0
  92. package/dist/storage/adapters/baseStorageAdapter.js +349 -0
  93. package/dist/storage/adapters/baseStorageAdapter.js.map +1 -0
  94. package/dist/storage/adapters/batchS3Operations.js +287 -0
  95. package/dist/storage/adapters/batchS3Operations.js.map +1 -0
  96. package/dist/storage/adapters/fileSystemStorage.js +846 -0
  97. package/dist/storage/adapters/fileSystemStorage.js.map +1 -0
  98. package/dist/storage/adapters/memoryStorage.js +532 -0
  99. package/dist/storage/adapters/memoryStorage.js.map +1 -0
  100. package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
  101. package/dist/storage/adapters/opfsStorage.js +1118 -0
  102. package/dist/storage/adapters/opfsStorage.js.map +1 -0
  103. package/dist/storage/adapters/optimizedS3Search.js +248 -0
  104. package/dist/storage/adapters/optimizedS3Search.js.map +1 -0
  105. package/dist/storage/adapters/s3CompatibleStorage.js +2026 -0
  106. package/dist/storage/adapters/s3CompatibleStorage.js.map +1 -0
  107. package/dist/storage/baseStorage.js +603 -0
  108. package/dist/storage/baseStorage.js.map +1 -0
  109. package/dist/storage/cacheManager.js +1306 -0
  110. package/dist/storage/cacheManager.js.map +1 -0
  111. package/dist/storage/enhancedCacheManager.js +520 -0
  112. package/dist/storage/enhancedCacheManager.js.map +1 -0
  113. package/dist/storage/readOnlyOptimizations.js +425 -0
  114. package/dist/storage/readOnlyOptimizations.js.map +1 -0
  115. package/dist/storage/storageFactory.d.ts +0 -1
  116. package/dist/storage/storageFactory.d.ts.map +1 -1
  117. package/dist/storage/storageFactory.js +227 -0
  118. package/dist/storage/storageFactory.js.map +1 -0
  119. package/dist/types/augmentations.js +16 -0
  120. package/dist/types/augmentations.js.map +1 -0
  121. package/dist/types/brainyDataInterface.js +8 -0
  122. package/dist/types/brainyDataInterface.js.map +1 -0
  123. package/dist/types/distributedTypes.js +6 -0
  124. package/dist/types/distributedTypes.js.map +1 -0
  125. package/dist/types/fileSystemTypes.js +8 -0
  126. package/dist/types/fileSystemTypes.js.map +1 -0
  127. package/dist/types/graphTypes.js +247 -0
  128. package/dist/types/graphTypes.js.map +1 -0
  129. package/dist/types/mcpTypes.js +22 -0
  130. package/dist/types/mcpTypes.js.map +1 -0
  131. package/dist/types/paginationTypes.js +5 -0
  132. package/dist/types/paginationTypes.js.map +1 -0
  133. package/dist/types/pipelineTypes.js +7 -0
  134. package/dist/types/pipelineTypes.js.map +1 -0
  135. package/dist/types/tensorflowTypes.js +6 -0
  136. package/dist/types/tensorflowTypes.js.map +1 -0
  137. package/dist/unified.d.ts.map +1 -0
  138. package/dist/unified.js +52 -128251
  139. package/dist/unified.js.map +1 -0
  140. package/dist/utils/autoConfiguration.js +341 -0
  141. package/dist/utils/autoConfiguration.js.map +1 -0
  142. package/dist/utils/cacheAutoConfig.js +261 -0
  143. package/dist/utils/cacheAutoConfig.js.map +1 -0
  144. package/dist/utils/crypto.js +45 -0
  145. package/dist/utils/crypto.js.map +1 -0
  146. package/dist/utils/distance.js +239 -0
  147. package/dist/utils/distance.js.map +1 -0
  148. package/dist/utils/embedding.d.ts.map +1 -1
  149. package/dist/utils/embedding.js +702 -0
  150. package/dist/utils/embedding.js.map +1 -0
  151. package/dist/utils/environment.js +75 -0
  152. package/dist/utils/environment.js.map +1 -0
  153. package/dist/utils/fieldNameTracking.js +90 -0
  154. package/dist/utils/fieldNameTracking.js.map +1 -0
  155. package/dist/utils/index.d.ts +1 -0
  156. package/dist/utils/index.d.ts.map +1 -1
  157. package/dist/utils/index.js +8 -0
  158. package/dist/utils/index.js.map +1 -0
  159. package/dist/utils/jsonProcessing.js +179 -0
  160. package/dist/utils/jsonProcessing.js.map +1 -0
  161. package/dist/utils/logger.js +129 -0
  162. package/dist/utils/logger.js.map +1 -0
  163. package/dist/utils/operationUtils.js +126 -0
  164. package/dist/utils/operationUtils.js.map +1 -0
  165. package/dist/utils/robustModelLoader.d.ts +14 -0
  166. package/dist/utils/robustModelLoader.d.ts.map +1 -1
  167. package/dist/utils/robustModelLoader.js +537 -0
  168. package/dist/utils/robustModelLoader.js.map +1 -0
  169. package/dist/utils/searchCache.js +248 -0
  170. package/dist/utils/searchCache.js.map +1 -0
  171. package/dist/utils/statistics.js +25 -0
  172. package/dist/utils/statistics.js.map +1 -0
  173. package/dist/utils/statisticsCollector.js +224 -0
  174. package/dist/utils/statisticsCollector.js.map +1 -0
  175. package/dist/utils/textEncoding.js +309 -0
  176. package/dist/utils/textEncoding.js.map +1 -0
  177. package/dist/utils/typeUtils.js +40 -0
  178. package/dist/utils/typeUtils.js.map +1 -0
  179. package/dist/utils/version.d.ts +15 -3
  180. package/dist/utils/version.d.ts.map +1 -1
  181. package/dist/utils/version.js +24 -0
  182. package/dist/utils/version.js.map +1 -0
  183. package/dist/utils/workerUtils.js +458 -0
  184. package/dist/utils/workerUtils.js.map +1 -0
  185. package/dist/worker.d.ts.map +1 -0
  186. package/dist/worker.js +54 -0
  187. package/dist/worker.js.map +1 -0
  188. package/package.json +30 -29
  189. package/dist/brainy.js +0 -90220
  190. package/dist/brainy.min.js +0 -12511
  191. package/dist/patched-platform-node.d.ts +0 -17
  192. package/dist/statistics/statisticsManager.d.ts +0 -121
  193. package/dist/storage/fileSystemStorage.d.ts +0 -73
  194. package/dist/storage/fileSystemStorage.d.ts.map +0 -1
  195. package/dist/storage/opfsStorage.d.ts +0 -236
  196. package/dist/storage/opfsStorage.d.ts.map +0 -1
  197. package/dist/storage/s3CompatibleStorage.d.ts +0 -157
  198. package/dist/storage/s3CompatibleStorage.d.ts.map +0 -1
  199. package/dist/testing/prettyReporter.d.ts +0 -23
  200. package/dist/testing/prettySummaryReporter.d.ts +0 -22
  201. package/dist/unified.min.js +0 -16153
  202. package/dist/utils/environmentDetection.d.ts +0 -47
  203. package/dist/utils/environmentDetection.d.ts.map +0 -1
  204. package/dist/utils/tensorflowUtils.d.ts +0 -17
  205. package/dist/utils/tensorflowUtils.d.ts.map +0 -1
@@ -0,0 +1,309 @@
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
+ // Get the appropriate global object for the current environment
75
+ const globalObj = (() => {
76
+ if (typeof globalThis !== 'undefined')
77
+ return globalThis;
78
+ if (typeof global !== 'undefined')
79
+ return global;
80
+ if (typeof self !== 'undefined')
81
+ return self;
82
+ if (typeof window !== 'undefined')
83
+ return window;
84
+ return {}; // Fallback for unknown environments
85
+ })();
86
+ if (globalObj && globalObj.Float32Array) {
87
+ const originalFloat32Array = globalObj.Float32Array;
88
+ // Create a patched Float32Array class that handles alignment issues
89
+ const PatchedFloat32Array = class extends originalFloat32Array {
90
+ constructor(arg, byteOffset, length) {
91
+ if (arg instanceof ArrayBuffer) {
92
+ // Ensure buffer is properly aligned for Float32Array (multiple of 4 bytes)
93
+ const alignedByteOffset = byteOffset || 0;
94
+ const alignedLength = length !== undefined
95
+ ? length
96
+ : (arg.byteLength - alignedByteOffset) / 4;
97
+ // Check if the buffer slice is properly aligned
98
+ if ((arg.byteLength - alignedByteOffset) % 4 !== 0 &&
99
+ length === undefined) {
100
+ try {
101
+ // Create a new aligned buffer if the original isn't properly aligned
102
+ const alignedByteLength = Math.floor((arg.byteLength - alignedByteOffset) / 4) * 4;
103
+ const alignedBuffer = new ArrayBuffer(alignedByteLength);
104
+ const sourceView = new Uint8Array(arg, alignedByteOffset, alignedByteLength);
105
+ const targetView = new Uint8Array(alignedBuffer);
106
+ targetView.set(sourceView);
107
+ super(alignedBuffer);
108
+ }
109
+ catch (error) {
110
+ // If alignment fails, try the original approach
111
+ console.warn('Float32Array alignment failed, using original constructor:', error);
112
+ super(arg, alignedByteOffset, alignedLength);
113
+ }
114
+ }
115
+ else {
116
+ super(arg, alignedByteOffset, alignedLength);
117
+ }
118
+ }
119
+ else {
120
+ super(arg, byteOffset, length);
121
+ }
122
+ }
123
+ };
124
+ // Apply the patch to the global object
125
+ try {
126
+ // Preserve static methods and properties
127
+ Object.setPrototypeOf(PatchedFloat32Array, originalFloat32Array);
128
+ Object.defineProperty(PatchedFloat32Array, 'name', {
129
+ value: 'Float32Array'
130
+ });
131
+ Object.defineProperty(PatchedFloat32Array, 'BYTES_PER_ELEMENT', {
132
+ value: 4
133
+ });
134
+ // Replace the global Float32Array with our patched version
135
+ globalObj.Float32Array = PatchedFloat32Array;
136
+ }
137
+ catch (error) {
138
+ console.warn('Failed to patch Float32Array:', error);
139
+ }
140
+ }
141
+ // CRITICAL: Patch any empty util shims that bundlers might create
142
+ // This handles cases where bundlers provide empty shims for Node.js modules
143
+ if (typeof global !== 'undefined') {
144
+ // Look for common patterns of util shims in bundled code
145
+ const checkAndPatchUtilShim = (obj) => {
146
+ if (obj && typeof obj === 'object' && !obj.TextEncoder) {
147
+ obj.TextEncoder = TextEncoder;
148
+ obj.TextDecoder = TextDecoder;
149
+ obj.types = obj.types || {
150
+ isFloat32Array: (arr) => arr instanceof Float32Array,
151
+ isInt32Array: (arr) => arr instanceof Int32Array,
152
+ isUint8Array: (arr) => arr instanceof Uint8Array,
153
+ isUint8ClampedArray: (arr) => arr instanceof Uint8ClampedArray
154
+ };
155
+ }
156
+ };
157
+ // Patch any existing util-like objects in global scope
158
+ if (global._utilShim) {
159
+ checkAndPatchUtilShim(global._utilShim);
160
+ }
161
+ // CRITICAL: Patch the bundled util shim directly
162
+ // In bundled code, there's often a _utilShim object that needs patching
163
+ if (typeof globalThis !== 'undefined' &&
164
+ globalThis._utilShim) {
165
+ checkAndPatchUtilShim(globalThis._utilShim);
166
+ }
167
+ // CRITICAL: Create and patch a global _utilShim if it doesn't exist
168
+ // This ensures the bundled code will find the patched version
169
+ if (!global._utilShim) {
170
+ global._utilShim = {
171
+ TextEncoder: TextEncoder,
172
+ TextDecoder: TextDecoder,
173
+ types: {
174
+ isFloat32Array: (arr) => arr instanceof Float32Array,
175
+ isInt32Array: (arr) => arr instanceof Int32Array,
176
+ isUint8Array: (arr) => arr instanceof Uint8Array,
177
+ isUint8ClampedArray: (arr) => arr instanceof Uint8ClampedArray
178
+ }
179
+ };
180
+ }
181
+ else {
182
+ checkAndPatchUtilShim(global._utilShim);
183
+ }
184
+ // Also ensure it's available on globalThis
185
+ if (typeof globalThis !== 'undefined' &&
186
+ !globalThis._utilShim) {
187
+ ;
188
+ globalThis._utilShim = global._utilShim;
189
+ }
190
+ // Set up a property descriptor to catch util shim assignments
191
+ try {
192
+ Object.defineProperty(global, '_utilShim', {
193
+ get() {
194
+ return this.__utilShim || {};
195
+ },
196
+ set(value) {
197
+ checkAndPatchUtilShim(value);
198
+ this.__utilShim = value;
199
+ },
200
+ configurable: true
201
+ });
202
+ }
203
+ catch (e) {
204
+ // Ignore if property can't be defined
205
+ }
206
+ // Also set up property descriptor on globalThis
207
+ try {
208
+ Object.defineProperty(globalThis, '_utilShim', {
209
+ get() {
210
+ return this.__utilShim || {};
211
+ },
212
+ set(value) {
213
+ checkAndPatchUtilShim(value);
214
+ this.__utilShim = value;
215
+ },
216
+ configurable: true
217
+ });
218
+ }
219
+ catch (e) {
220
+ // Ignore if property can't be defined
221
+ }
222
+ }
223
+ console.log('Brainy: Successfully patched TensorFlow.js PlatformNode at module load time');
224
+ patchApplied = true;
225
+ }
226
+ catch (error) {
227
+ console.warn('Brainy: Failed to apply early TensorFlow.js platform patch:', error);
228
+ }
229
+ }
230
+ /**
231
+ * Apply the TensorFlow.js platform patch if it hasn't been applied already
232
+ * This is a safety measure in case the module-level patch didn't run
233
+ * Now works across all environments: browser, Node.js, and serverless/server
234
+ */
235
+ export async function applyTensorFlowPatch() {
236
+ // Apply patches for all non-browser environments that might need TensorFlow.js compatibility
237
+ // This includes Node.js, serverless environments, and other server environments
238
+ const isBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
239
+ if (isBrowserEnv) {
240
+ return; // Browser environments don't need these patches
241
+ }
242
+ // Get the appropriate global object for the current environment
243
+ const globalObj = (() => {
244
+ if (typeof globalThis !== 'undefined')
245
+ return globalThis;
246
+ if (typeof global !== 'undefined')
247
+ return global;
248
+ if (typeof self !== 'undefined')
249
+ return self;
250
+ return {}; // Fallback for unknown environments
251
+ })();
252
+ // Check if the critical globals exist, not just the flag
253
+ // This allows re-patching if globals have been deleted
254
+ const needsPatch = !patchApplied ||
255
+ typeof globalObj.__TextEncoder__ === 'undefined' ||
256
+ typeof globalObj.__TextDecoder__ === 'undefined';
257
+ if (!needsPatch) {
258
+ return;
259
+ }
260
+ try {
261
+ console.log('Brainy: Applying TensorFlow.js platform patch via function call');
262
+ // CRITICAL FIX: Patch the global environment to ensure TextEncoder/TextDecoder are available
263
+ // This approach works by ensuring the global constructors are available before TensorFlow.js loads
264
+ // Now works across all environments: Node.js, serverless, and other server environments
265
+ // Make sure TextEncoder and TextDecoder are available globally
266
+ if (!globalObj.TextEncoder) {
267
+ globalObj.TextEncoder = TextEncoder;
268
+ }
269
+ if (!globalObj.TextDecoder) {
270
+ globalObj.TextDecoder = TextDecoder;
271
+ }
272
+ // Also set the special global constructors that TensorFlow can use safely
273
+ ;
274
+ globalObj.__TextEncoder__ = TextEncoder;
275
+ globalObj.__TextDecoder__ = TextDecoder;
276
+ // Also patch process.versions to ensure TensorFlow.js detects Node.js correctly
277
+ if (typeof process !== 'undefined' && process.versions) {
278
+ // Ensure TensorFlow.js sees this as a Node.js environment
279
+ if (!process.versions.node) {
280
+ process.versions.node = process.version;
281
+ }
282
+ }
283
+ // CRITICAL: Patch the Node.js util module directly
284
+ try {
285
+ const util = await import('util');
286
+ // Ensure TextEncoder and TextDecoder are available as constructors
287
+ util.TextEncoder = TextEncoder;
288
+ util.TextDecoder = TextDecoder;
289
+ }
290
+ catch (error) {
291
+ // Ignore if util module is not available
292
+ }
293
+ patchApplied = true;
294
+ }
295
+ catch (error) {
296
+ console.warn('Brainy: Failed to apply TensorFlow.js platform patch:', error);
297
+ }
298
+ }
299
+ export function getTextEncoder() {
300
+ return new TextEncoder();
301
+ }
302
+ export function getTextDecoder() {
303
+ return new TextDecoder();
304
+ }
305
+ // Apply patch immediately
306
+ applyTensorFlowPatch().catch((error) => {
307
+ console.warn('Failed to apply TensorFlow patch at module load:', error);
308
+ });
309
+ //# 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;AAczC;;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,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AI,CAAC,WAAW,GAAG,WAAsC,CAAA;YACzD,IAAI,CAAC,WAAW,GAAG,WAAsC,CAAA;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,yCAAyC;QAC3C,CAAC;QAED,YAAY,GAAG,IAAI,CAAA;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,uDAAuD,EAAE,KAAK,CAAC,CAAA;IAC9E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,WAAW,EAAE,CAAA;AAC1B,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,WAAW,EAAE,CAAA;AAC1B,CAAC;AAED,0BAA0B;AAC1B,oBAAoB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrC,OAAO,CAAC,IAAI,CAAC,kDAAkD,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC,CAAC,CAAA"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Type Utilities
3
+ *
4
+ * This module provides utility functions for working with the Brainy type system,
5
+ * particularly for accessing lists of noun and verb types.
6
+ */
7
+ import { NounType, VerbType } from '../types/graphTypes.js';
8
+ /**
9
+ * Returns an array of all available noun types
10
+ *
11
+ * @returns {string[]} Array of all noun type values
12
+ */
13
+ export function getNounTypes() {
14
+ return Object.values(NounType);
15
+ }
16
+ /**
17
+ * Returns an array of all available verb types
18
+ *
19
+ * @returns {string[]} Array of all verb type values
20
+ */
21
+ export function getVerbTypes() {
22
+ return Object.values(VerbType);
23
+ }
24
+ /**
25
+ * Returns a map of noun type keys to their string values
26
+ *
27
+ * @returns {Record<string, string>} Map of noun type keys to values
28
+ */
29
+ export function getNounTypeMap() {
30
+ return { ...NounType };
31
+ }
32
+ /**
33
+ * Returns a map of verb type keys to their string values
34
+ *
35
+ * @returns {Record<string, string>} Map of verb type keys to values
36
+ */
37
+ export function getVerbTypeMap() {
38
+ return { ...VerbType };
39
+ }
40
+ //# sourceMappingURL=typeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../src/utils/typeUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAE3D;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAA;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAA;AACxB,CAAC"}
@@ -1,5 +1,17 @@
1
1
  /**
2
- * This file is auto-generated during the build process.
3
- * Do not modify this file directly.
2
+ * Version utilities for Brainy
4
3
  */
5
- export declare const VERSION = "0.12.0";
4
+ /**
5
+ * Get the current Brainy package version
6
+ * @returns The current version string
7
+ */
8
+ export declare function getBrainyVersion(): string;
9
+ /**
10
+ * Get version information for augmentation metadata
11
+ * @param service The service/augmentation name
12
+ * @returns Version metadata object
13
+ */
14
+ export declare function getAugmentationVersion(service: string): {
15
+ augmentation: string;
16
+ version: string;
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAKjG"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Version utilities for Brainy
3
+ */
4
+ // Package version - this should be updated during the build process
5
+ const BRAINY_VERSION = '0.41.0';
6
+ /**
7
+ * Get the current Brainy package version
8
+ * @returns The current version string
9
+ */
10
+ export function getBrainyVersion() {
11
+ return BRAINY_VERSION;
12
+ }
13
+ /**
14
+ * Get version information for augmentation metadata
15
+ * @param service The service/augmentation name
16
+ * @returns Version metadata object
17
+ */
18
+ export function getAugmentationVersion(service) {
19
+ return {
20
+ augmentation: service,
21
+ version: getBrainyVersion()
22
+ };
23
+ }
24
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oEAAoE;AACpE,MAAM,cAAc,GAAG,QAAQ,CAAA;AAE/B;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAA;AACvB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACpD,OAAO;QACL,YAAY,EAAE,OAAO;QACrB,OAAO,EAAE,gBAAgB,EAAE;KAC5B,CAAA;AACH,CAAC"}