brainy/package.json

206 lines
6.7 KiB
JSON
Raw Normal View History

2025-06-24 11:41:30 -07:00
{
"name": "@soulcraft/brainy",
2025-08-07 11:07:14 -07:00
"version": "0.54.4",
2025-06-24 11:41:30 -07:00
"description": "A vector graph database using HNSW indexing with Origin Private File System storage",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
2025-06-24 11:41:30 -07:00
"type": "module",
"sideEffects": [
"./dist/setup.js",
"./dist/utils/textEncoding.js",
"./src/setup.ts",
"./src/utils/textEncoding.ts"
],
2025-06-24 11:41:30 -07:00
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
2025-06-24 11:41:30 -07:00
},
"./setup": {
"import": "./dist/setup.js",
"types": "./dist/setup.d.ts"
},
2025-06-24 11:41:30 -07:00
"./types/graphTypes": {
"import": "./dist/types/graphTypes.js",
"types": "./dist/types/graphTypes.d.ts"
},
"./types/augmentations": {
"import": "./dist/types/augmentations.js",
"types": "./dist/types/augmentations.d.ts"
},
"./utils/textEncoding": {
"import": "./dist/utils/textEncoding.js",
"types": "./dist/utils/textEncoding.d.ts"
},
"./dist/utils/textEncoding.js": {
"import": "./dist/utils/textEncoding.js",
"types": "./dist/utils/textEncoding.d.ts"
},
"./dist/setup.js": {
"import": "./dist/setup.js",
"types": "./dist/setup.d.ts"
2025-06-24 11:41:30 -07:00
}
},
"engines": {
"node": ">=24.4.0"
2025-06-24 11:41:30 -07:00
},
"scripts": {
"prebuild": "echo 'Prebuild step - no version generation needed'",
"build": "tsc",
2025-08-05 16:10:18 -07:00
"build:framework": "tsc",
"start": "node dist/framework.js",
"demo": "npm run build && cd demo/brainy-angular-demo && npm run build && npm run serve",
"prepare": "npm run build",
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:node": "vitest run tests/environment.node.test.ts tests/core.test.ts tests/vector-operations.test.ts tests/tensorflow-patch.test.ts",
"test:browser": "vitest run tests/environment.browser.test.ts --environment jsdom",
"test:core": "vitest run tests/core.test.ts",
"test:coverage": "vitest run --coverage",
"test:size": "vitest run tests/package-size-limit.test.ts",
"test:all": "npm run build && vitest run",
"test:report:json": "vitest run --reporter json",
"test:error-handling": "vitest run tests/error-handling.test.ts",
"test:edge-cases": "vitest run tests/edge-cases.test.ts",
"test:storage": "vitest run tests/storage-adapter-coverage.test.ts",
"test:environments": "vitest run tests/multi-environment.test.ts",
"test:specialized": "vitest run tests/specialized-scenarios.test.ts",
"test:performance": "vitest run tests/performance.test.ts",
"test:install": "vitest run tests/package-install.test.ts",
"test:docker": "vitest run tests/custom-models-path.test.ts",
"test:extraction": "node tests/auto-extraction.test.js",
"extract-models": "node scripts/extract-models.js",
"test:comprehensive": "npm run test:error-handling && npm run test:edge-cases && npm run test:storage && npm run test:environments && npm run test:specialized",
"_generate-pdf": "node dev/scripts/generate-architecture-pdf.js",
"_release": "standard-version",
"_release:patch": "standard-version --release-as patch",
"_release:minor": "standard-version --release-as minor",
"_release:major": "standard-version --release-as major",
"_release:dry-run": "standard-version --dry-run",
"_github-release": "node scripts/create-github-release.js",
"_changelog:check": "echo 'Changelog is now automatically generated from commit messages'",
"_lint": "eslint --ext .ts,.js src/",
"_lint:fix": "eslint --ext .ts,.js src/ --fix",
"_format": "prettier --write \"src/**/*.{ts,js}\"",
"_check:format": "prettier --check \"src/**/*.{ts,js}\"",
"_check:style": "node scripts/check-code-style.js",
"_deploy": "npm run build && npm publish",
"_workflow": "node scripts/release-workflow.js",
"_workflow:patch": "node scripts/release-workflow.js patch",
"_workflow:minor": "node scripts/release-workflow.js minor",
"_workflow:major": "node scripts/release-workflow.js major",
"_workflow:dry-run": "npm run build && npm test && npm run _release:dry-run",
feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime BREAKING CHANGE: Complete migration from TensorFlow.js to Transformers.js for embedding generation This is a major architectural change that replaces TensorFlow.js (USE model) with Transformers.js (all-MiniLM-L6-v2) for significantly improved performance and reduced complexity. Key Changes: - Replace TensorFlow.js Universal Sentence Encoder with Transformers.js all-MiniLM-L6-v2 - Reduce model size from 525MB to 87MB (83% reduction) - Reduce embedding dimensions from 512 to 384 (faster distance calculations) - Remove TensorFlow.js Float32Array patching (caused ONNX conflicts) - Implement smart bundled model detection for offline operation - Add explicit model download script for Docker deployments - Remove complex environment variables in favor of simple configuration - Update all distance functions to use optimized pure JavaScript - Remove TensorFlow-specific utilities and type definitions Performance Improvements: - Model loading: 5x faster (87MB vs 525MB) - Memory usage: 75% reduction (~200-400MB vs ~1.5GB) - Distance calculations: Faster pure JS vs GPU overhead for small vectors - Cold start performance: Significantly improved Files Changed: - Updated package.json: New dependencies, simplified scripts - Rewrote src/utils/embedding.ts: Complete Transformers.js implementation - Updated src/utils/distance.ts: Optimized JavaScript distance functions - Simplified src/setup.ts: Removed TensorFlow-specific patching - Simplified src/utils/textEncoding.ts: Only Node.js TextEncoder/Decoder patches - Deleted src/utils/robustModelLoader.ts: TensorFlow-specific loader - Deleted src/types/tensorflowTypes.ts: TensorFlow type definitions - Added scripts/download-models.cjs: Docker-compatible model downloader - Added comprehensive documentation: README.md, OFFLINE_MODELS.md, analysis docs Testing: - All 19 tests passing - Removed test mocking in favor of real implementation testing - Updated test environment for Transformers.js compatibility - Performance tests validate improved efficiency This migration resolves production issues with Docker egress limitations and provides a more robust, performant foundation for vector operations.
2025-08-05 19:29:59 -07:00
"_dry-run": "npm pack --dry-run",
"download-models": "node scripts/download-models.cjs"
2025-06-24 11:41:30 -07:00
},
"keywords": [
"vector-database",
"hnsw",
"opfs",
"origin-private-file-system",
"embeddings",
"graph-database",
"streaming-data"
],
"author": "David Snelling (david@soulcraft.com)",
"license": "MIT",
"private": false,
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/soulcraft-research/brainy",
"bugs": {
"url": "https://github.com/soulcraft-research/brainy/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/soulcraft-research/brainy.git"
2025-06-24 11:41:30 -07:00
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
2025-06-24 11:41:30 -07:00
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"!dist/framework.js",
"!dist/framework.js.map",
"!dist/framework.min.js",
"!dist/framework.min.js.map",
2025-06-24 11:41:30 -07:00
"LICENSE",
"README.md",
feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime BREAKING CHANGE: Complete migration from TensorFlow.js to Transformers.js for embedding generation This is a major architectural change that replaces TensorFlow.js (USE model) with Transformers.js (all-MiniLM-L6-v2) for significantly improved performance and reduced complexity. Key Changes: - Replace TensorFlow.js Universal Sentence Encoder with Transformers.js all-MiniLM-L6-v2 - Reduce model size from 525MB to 87MB (83% reduction) - Reduce embedding dimensions from 512 to 384 (faster distance calculations) - Remove TensorFlow.js Float32Array patching (caused ONNX conflicts) - Implement smart bundled model detection for offline operation - Add explicit model download script for Docker deployments - Remove complex environment variables in favor of simple configuration - Update all distance functions to use optimized pure JavaScript - Remove TensorFlow-specific utilities and type definitions Performance Improvements: - Model loading: 5x faster (87MB vs 525MB) - Memory usage: 75% reduction (~200-400MB vs ~1.5GB) - Distance calculations: Faster pure JS vs GPU overhead for small vectors - Cold start performance: Significantly improved Files Changed: - Updated package.json: New dependencies, simplified scripts - Rewrote src/utils/embedding.ts: Complete Transformers.js implementation - Updated src/utils/distance.ts: Optimized JavaScript distance functions - Simplified src/setup.ts: Removed TensorFlow-specific patching - Simplified src/utils/textEncoding.ts: Only Node.js TextEncoder/Decoder patches - Deleted src/utils/robustModelLoader.ts: TensorFlow-specific loader - Deleted src/types/tensorflowTypes.ts: TensorFlow type definitions - Added scripts/download-models.cjs: Docker-compatible model downloader - Added comprehensive documentation: README.md, OFFLINE_MODELS.md, analysis docs Testing: - All 19 tests passing - Removed test mocking in favor of real implementation testing - Updated test environment for Transformers.js compatibility - Performance tests validate improved efficiency This migration resolves production issues with Docker egress limitations and provides a more robust, performant foundation for vector operations.
2025-08-05 19:29:59 -07:00
"brainy.png",
"scripts/download-models.cjs",
"OFFLINE_MODELS.md"
2025-06-24 11:41:30 -07:00
],
"devDependencies": {
"@types/express": "^5.0.3",
"@types/jsdom": "^21.1.7",
"@types/node": "^20.11.30",
2025-06-24 11:41:30 -07:00
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"eslint": "^9.0.0",
"express": "^5.1.0",
"happy-dom": "^18.0.1",
"jsdom": "^26.1.0",
"node-fetch": "^3.3.2",
"puppeteer": "^22.15.0",
"standard-version": "^9.5.0",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"vitest": "^3.2.4"
2025-06-24 11:41:30 -07:00
},
"dependencies": {
"@aws-sdk/client-s3": "^3.540.0",
feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime BREAKING CHANGE: Complete migration from TensorFlow.js to Transformers.js for embedding generation This is a major architectural change that replaces TensorFlow.js (USE model) with Transformers.js (all-MiniLM-L6-v2) for significantly improved performance and reduced complexity. Key Changes: - Replace TensorFlow.js Universal Sentence Encoder with Transformers.js all-MiniLM-L6-v2 - Reduce model size from 525MB to 87MB (83% reduction) - Reduce embedding dimensions from 512 to 384 (faster distance calculations) - Remove TensorFlow.js Float32Array patching (caused ONNX conflicts) - Implement smart bundled model detection for offline operation - Add explicit model download script for Docker deployments - Remove complex environment variables in favor of simple configuration - Update all distance functions to use optimized pure JavaScript - Remove TensorFlow-specific utilities and type definitions Performance Improvements: - Model loading: 5x faster (87MB vs 525MB) - Memory usage: 75% reduction (~200-400MB vs ~1.5GB) - Distance calculations: Faster pure JS vs GPU overhead for small vectors - Cold start performance: Significantly improved Files Changed: - Updated package.json: New dependencies, simplified scripts - Rewrote src/utils/embedding.ts: Complete Transformers.js implementation - Updated src/utils/distance.ts: Optimized JavaScript distance functions - Simplified src/setup.ts: Removed TensorFlow-specific patching - Simplified src/utils/textEncoding.ts: Only Node.js TextEncoder/Decoder patches - Deleted src/utils/robustModelLoader.ts: TensorFlow-specific loader - Deleted src/types/tensorflowTypes.ts: TensorFlow type definitions - Added scripts/download-models.cjs: Docker-compatible model downloader - Added comprehensive documentation: README.md, OFFLINE_MODELS.md, analysis docs Testing: - All 19 tests passing - Removed test mocking in favor of real implementation testing - Updated test environment for Transformers.js compatibility - Performance tests validate improved efficiency This migration resolves production issues with Docker egress limitations and provides a more robust, performant foundation for vector operations.
2025-08-05 19:29:59 -07:00
"@huggingface/transformers": "^3.1.0",
"@smithy/node-http-handler": "^4.1.1",
2025-06-24 11:41:30 -07:00
"buffer": "^6.0.3",
"dotenv": "^16.4.5",
"uuid": "^9.0.1"
2025-06-24 11:41:30 -07:00
},
"prettier": {
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"printWidth": 80,
"proseWrap": "preserve",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"eslintConfig": {
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"semi": "off",
"@typescript-eslint/semi": [
"error",
"never"
],
"no-extra-semi": "off"
}
}
}