@soulcraft/brainy 0.9.36 → 0.10.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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/augmentationFactory.d.ts +0 -1
- package/dist/augmentationPipeline.d.ts +0 -1
- package/dist/augmentationRegistry.d.ts +0 -1
- package/dist/augmentationRegistryLoader.d.ts +0 -1
- package/dist/augmentations/conduitAugmentations.d.ts +0 -1
- package/dist/augmentations/memoryAugmentations.d.ts +0 -1
- package/dist/augmentations/serverSearchAugmentations.d.ts +0 -1
- package/dist/brainy.js +338 -28
- package/dist/brainy.min.js +749 -748
- package/dist/brainyData.d.ts +0 -1
- package/dist/coreTypes.d.ts +0 -1
- package/dist/examples/basicUsage.d.ts +0 -1
- package/dist/hnsw/hnswIndex.d.ts +0 -1
- package/dist/hnsw/hnswIndexOptimized.d.ts +0 -1
- package/dist/index.d.ts +2 -2
- package/dist/mcp/brainyMCPAdapter.d.ts +0 -1
- package/dist/mcp/brainyMCPService.d.ts +0 -1
- package/dist/mcp/index.d.ts +0 -1
- package/dist/mcp/mcpAugmentationToolset.d.ts +0 -1
- package/dist/pipeline.d.ts +0 -1
- package/dist/sequentialPipeline.d.ts +0 -1
- package/dist/storage/fileSystemStorage.d.ts +0 -1
- package/dist/storage/opfsStorage.d.ts +0 -1
- package/dist/storage/opfsStorage.d.ts.map +1 -1
- package/dist/storage/s3CompatibleStorage.d.ts +0 -1
- package/dist/types/augmentations.d.ts +0 -1
- package/dist/types/brainyDataInterface.d.ts +0 -1
- package/dist/types/fileSystemTypes.d.ts +0 -1
- package/dist/types/graphTypes.d.ts +0 -1
- package/dist/types/mcpTypes.d.ts +0 -1
- package/dist/types/pipelineTypes.d.ts +0 -1
- package/dist/types/tensorflowTypes.d.ts +0 -1
- package/dist/unified.d.ts +0 -1
- package/dist/unified.js +339 -29
- package/dist/unified.min.js +749 -748
- package/dist/utils/distance.d.ts +0 -1
- package/dist/utils/embedding.d.ts +0 -1
- package/dist/utils/environment.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/tensorflowUtils.d.ts +0 -1
- package/dist/utils/tensorflowUtils.d.ts.map +1 -1
- package/dist/utils/textEncoderPolyfill.d.ts +6 -0
- package/dist/utils/textEncoderPolyfill.d.ts.map +1 -0
- package/dist/utils/textEncoding.d.ts +67 -0
- package/dist/utils/textEncoding.d.ts.map +1 -0
- package/dist/utils/version.d.ts +1 -2
- package/dist/utils/workerUtils.d.ts +0 -1
- package/dist/utils/workerUtils.d.ts.map +1 -1
- package/dist/worker.d.ts +1 -0
- package/package.json +6 -5
package/dist/utils/distance.d.ts
CHANGED
|
@@ -40,4 +40,3 @@ export declare const dotProductDistance: DistanceFunction;
|
|
|
40
40
|
* @returns Promise resolving to array of distances
|
|
41
41
|
*/
|
|
42
42
|
export declare function calculateDistancesBatch(queryVector: Vector, vectors: Vector[], distanceFunction?: DistanceFunction): Promise<number[]>;
|
|
43
|
-
//# sourceMappingURL=distance.d.ts.map
|
|
@@ -62,4 +62,3 @@ export declare const defaultBatchEmbeddingFunction: (dataArray: string[]) => Pro
|
|
|
62
62
|
* @param model Embedding model to use
|
|
63
63
|
*/
|
|
64
64
|
export declare function createThreadedEmbeddingFunction(model: EmbeddingModel): EmbeddingFunction;
|
|
65
|
-
//# sourceMappingURL=embedding.d.ts.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tensorflowUtils.d.ts","sourceRoot":"","sources":["../../src/utils/tensorflowUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"tensorflowUtils.d.ts","sourceRoot":"","sources":["../../src/utils/tensorflowUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAElD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextEncoder/TextDecoder Polyfill for Node.js and Browser environments
|
|
3
|
+
* This module provides a consistent way to use TextEncoder/TextDecoder across all environments
|
|
4
|
+
*/
|
|
5
|
+
export declare function ensureTextEncoderPolyfill(): boolean;
|
|
6
|
+
//# sourceMappingURL=textEncoderPolyfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textEncoderPolyfill.d.ts","sourceRoot":"","sources":["../../src/utils/textEncoderPolyfill.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+FH,wBAAgB,yBAAyB,YAGxC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Text Encoding Utilities
|
|
3
|
+
*
|
|
4
|
+
* This module provides a consistent way to handle text encoding/decoding across all environments
|
|
5
|
+
* without relying on TextEncoder/TextDecoder polyfills or patches.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A simple text encoder that works in all environments
|
|
9
|
+
* This avoids the need for TextEncoder polyfills and patches
|
|
10
|
+
*/
|
|
11
|
+
export declare class SimpleTextEncoder {
|
|
12
|
+
/**
|
|
13
|
+
* Encode a string to a Uint8Array
|
|
14
|
+
* @param input - The string to encode
|
|
15
|
+
* @returns A Uint8Array containing the encoded string
|
|
16
|
+
*/
|
|
17
|
+
encode(input: string): Uint8Array;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A simple text decoder that works in all environments
|
|
21
|
+
* This avoids the need for TextDecoder polyfills and patches
|
|
22
|
+
*/
|
|
23
|
+
export declare class SimpleTextDecoder {
|
|
24
|
+
/**
|
|
25
|
+
* Decode a Uint8Array to a string
|
|
26
|
+
* @param input - The Uint8Array to decode
|
|
27
|
+
* @returns The decoded string
|
|
28
|
+
*/
|
|
29
|
+
decode(input: Uint8Array): string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Interface for UniversalTextEncoder instance
|
|
33
|
+
*/
|
|
34
|
+
interface IUniversalTextEncoder {
|
|
35
|
+
encode: (input: string) => Uint8Array;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A constructor function for TextEncoder that works in all environments
|
|
39
|
+
*/
|
|
40
|
+
export declare function UniversalTextEncoder(this: IUniversalTextEncoder): any;
|
|
41
|
+
/**
|
|
42
|
+
* Interface for UniversalTextDecoder instance
|
|
43
|
+
*/
|
|
44
|
+
interface IUniversalTextDecoder {
|
|
45
|
+
decode: (input: Uint8Array) => string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A constructor function for TextDecoder that works in all environments
|
|
49
|
+
*/
|
|
50
|
+
export declare function UniversalTextDecoder(this: IUniversalTextDecoder): any;
|
|
51
|
+
/**
|
|
52
|
+
* Get a text encoder that works in the current environment
|
|
53
|
+
* @returns A text encoder object with an encode method
|
|
54
|
+
*/
|
|
55
|
+
export declare function getTextEncoder(): IUniversalTextEncoder;
|
|
56
|
+
/**
|
|
57
|
+
* Get a text decoder that works in the current environment
|
|
58
|
+
* @returns A text decoder object with a decode method
|
|
59
|
+
*/
|
|
60
|
+
export declare function getTextDecoder(): IUniversalTextDecoder;
|
|
61
|
+
/**
|
|
62
|
+
* Apply the TensorFlow.js platform patch if needed
|
|
63
|
+
* This function patches the global object to provide a PlatformNode class
|
|
64
|
+
* that uses our text encoding utilities instead of relying on TextEncoder/TextDecoder
|
|
65
|
+
*/
|
|
66
|
+
export declare function applyTensorFlowPatch(): void;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textEncoding.d.ts","sourceRoot":"","sources":["../../src/utils/textEncoding.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;CAIlC;AAED;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAIlC;AAKD;;GAEG;AACH,UAAU,qBAAqB;IAC7B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,UAAU,CAAC;CACvC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,OAc/D;AAED;;GAEG;AACH,UAAU,qBAAqB;IAC7B,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;CACvC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,OAc/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,qBAAqB,CAEtD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,qBAAqB,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAmD3C"}
|
package/dist/utils/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerUtils.d.ts","sourceRoot":"","sources":["../../src/utils/workerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"workerUtils.d.ts","sourceRoot":"","sources":["../../src/utils/workerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAiD1E;AAkRD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAYzC"}
|
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A vector graph database using HNSW indexing with Origin Private File System storage",
|
|
5
5
|
"main": "dist/unified.js",
|
|
6
6
|
"module": "dist/unified.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"prebuild": "node scripts/generate-version.js",
|
|
32
|
-
"build": "BUILD_TYPE=unified rollup -c rollup.config.js",
|
|
32
|
+
"build": "BUILD_TYPE=unified rollup -c rollup.config.js && node scripts/patch-textencoder.js",
|
|
33
33
|
"build:browser": "BUILD_TYPE=browser rollup -c rollup.config.js",
|
|
34
34
|
"build:cli": "cd cli-package && npm run build",
|
|
35
35
|
"start": "node dist/unified.js",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"check-style": "node scripts/check-code-style.js",
|
|
46
46
|
"prepare": "npm run build",
|
|
47
47
|
"deploy": "npm run build && npm publish && node scripts/create-github-release.js",
|
|
48
|
-
"deploy:cli": "node scripts/generate-version.js && cd cli-package && npm run build && npm publish
|
|
49
|
-
"deploy:both": "node scripts/publish-cli.js",
|
|
48
|
+
"deploy:cli": "node scripts/generate-version.js && cd cli-package && npm run build && npm publish",
|
|
50
49
|
"deploy:cloud:aws": "cd cloud-wrapper && npm run build && npm run deploy:aws",
|
|
51
50
|
"deploy:cloud:gcp": "cd cloud-wrapper && npm run build && npm run deploy:gcp",
|
|
52
51
|
"deploy:cloud:cloudflare": "cd cloud-wrapper && npm run build && npm run deploy:cloudflare",
|
|
53
52
|
"deploy:cloud": "echo 'Please use one of the following commands to deploy to a specific cloud provider:' && echo ' npm run deploy:cloud:aws' && echo ' npm run deploy:cloud:gcp' && echo ' npm run deploy:cloud:cloudflare'",
|
|
54
53
|
"postinstall": "echo 'Note: If you encounter dependency conflicts with TensorFlow.js packages, please use: npm install --legacy-peer-deps'",
|
|
55
54
|
"dry-run": "npm pack --dry-run",
|
|
56
|
-
"test-cli": "node scripts/test-cli-locally.js"
|
|
55
|
+
"test-cli": "node scripts/test-cli-locally.js",
|
|
56
|
+
"test-all": "node scripts/test-all-environments.js"
|
|
57
57
|
},
|
|
58
58
|
"keywords": [
|
|
59
59
|
"vector-database",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
108
108
|
"@typescript-eslint/parser": "^7.4.0",
|
|
109
109
|
"eslint": "^8.57.0",
|
|
110
|
+
"puppeteer": "^22.5.0",
|
|
110
111
|
"rollup": "^4.13.0",
|
|
111
112
|
"rollup-plugin-terser": "^7.0.2",
|
|
112
113
|
"tslib": "^2.6.2",
|