brainy/src/utils/environment.ts

84 lines
3.2 KiB
TypeScript
Raw Normal View History

🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
/**
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
* @module utils/environment
* @description Runtime environment detection helpers. 8.0 supports Node.js,
* Bun, and Deno on the server side only browsers were dropped from the
* support matrix in 8.0, so the helpers here assume a Node-like runtime.
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
*/
/**
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
* @description True when running inside a Node-compatible runtime
* (Node.js, Bun, Deno node-compat). 8.0 has no browser path, so this is
* effectively always true in a deployed brain the function is kept for
* defensive checks at runtime boundaries.
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
*/
export function isNode(): boolean {
return (
typeof process !== 'undefined' &&
process.versions != null &&
process.versions.node != null
)
}
/**
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
* @description Auto-detect a production deployment. Returns true when any
* common managed-runtime indicator is present (Cloud Run, Lambda, Azure
* Functions, Vercel, Netlify, Heroku, Railway, Fly.io, Docker prod), or
* when `NODE_ENV=production`. Used to silence verbose logging in prod.
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
*/
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
export function isProductionEnvironment(): boolean {
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
if (!isNode()) return false
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
const nodeEnv = process.env.NODE_ENV?.toLowerCase()
if (nodeEnv === 'production' || nodeEnv === 'prod') return true
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
if (process.env.K_SERVICE || process.env.GOOGLE_CLOUD_PROJECT) return true
if (process.env.AWS_LAMBDA_FUNCTION_NAME || process.env.AWS_EXECUTION_ENV) return true
if (process.env.AZURE_FUNCTIONS_ENVIRONMENT || process.env.WEBSITE_SITE_NAME) return true
if (process.env.VERCEL || process.env.VERCEL_ENV === 'production') return true
if (process.env.NETLIFY && process.env.CONTEXT === 'production') return true
if (process.env.DYNO && process.env.NODE_ENV !== 'development') return true
if (process.env.RAILWAY_ENVIRONMENT === 'production') return true
if (process.env.FLY_APP_NAME && process.env.FLY_REGION) return true
if (process.env.DOCKER_ENV === 'production' || process.env.ENVIRONMENT === 'production') return true
if (process.env.PROD === 'true' || process.env.PRODUCTION === 'true') return true
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
return false
}
/**
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
* @description Resolve a log level from BRAINY_LOG_LEVEL, NODE_ENV, and
* deployment-environment heuristics. Production defaults to 'error' so a
* busy app doesn't pay for verbose logging.
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
*/
export function getLogLevel(): 'silent' | 'error' | 'warn' | 'info' | 'verbose' {
const explicitLevel = process.env.BRAINY_LOG_LEVEL?.toLowerCase()
if (explicitLevel && ['silent', 'error', 'warn', 'info', 'verbose'].includes(explicitLevel)) {
return explicitLevel as 'silent' | 'error' | 'warn' | 'info' | 'verbose'
}
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
if (isProductionEnvironment()) return 'error'
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'dev') {
return 'verbose'
}
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
if (process.env.NODE_ENV === 'test') return 'warn'
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
return 'info'
}
/**
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
* @description True when a log message at the requested level should be
* emitted given the current configured log level. Returns false in 'silent'.
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
*/
export function shouldLog(level: 'error' | 'warn' | 'info' | 'verbose'): boolean {
const currentLevel = getLogLevel()
if (currentLevel === 'silent') return false
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
const levels = ['error', 'warn', 'info', 'verbose']
const currentIndex = levels.indexOf(currentLevel)
const messageIndex = levels.indexOf(level)
chore(8.0)!: drop browser support, cloud SDKs, legacy pipeline, dead threading Brainy 8.0 is server-only. This commit takes the consequences seriously and removes everything that was only there to keep browser/cloud/threading surfaces alive. Browser support drop (per the @deprecated notes in environment.ts): - isBrowser, isWebWorker, areWebWorkersAvailable, navigator.deviceMemory paths, window/document/self.onmessage code. - browser console.log in unified.ts, the 'browser' branch in autoConfiguration.ts (env enum + scaleUp cases), 'browser-cache' model path, MCP service environment value. - package.json browser field. - src/worker.ts (Web Worker entrypoint) deleted. Cloud SDK removal (the four adapters were dropped in Phase 7; the SDKs were the lingering tax): - @aws-sdk/client-s3, @azure/identity, @azure/storage-blob, and @google-cloud/storage removed from package.json. Lockfile drops the entire @aws/@azure/@google-cloud/@smithy transitive tree. - EnhancedS3Clear class deleted from enhancedClearOperations.ts (the only @aws-sdk/client-s3 consumer; the dynamic import sites went with it). EnhancedFileSystemClear stays. - src/utils/adaptiveSocketManager.ts deleted entirely (474 LOC of HTTPS socket-pool management for the dropped cloud HTTP handler). performanceMonitor.ts no longer reports a socketConfig; socket utilization is fixed at 0. Dead threading subsystem: - executeInThread was imported by distance.ts and hnswIndex.ts but never called. It was scaffolding for a future "off-main-thread distance batch" optimization that never shipped. - src/utils/workerUtils.ts deleted (Web Worker code path + an unreachable Node Worker Threads code path). - environment.ts loses isThreadingAvailable, isThreadingAvailableAsync, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync. All exports purged from index.ts and unified.ts. - autoConfiguration.ts drops AutoConfigResult.threadingAvailable. Legacy plugin/augmentation pipeline: - src/pipeline.ts deleted. The whole file was a no-op stub for backwards compat — Pipeline class had no methods, no lifecycle hooks, no before/after callbacks. AugmentationPipeline, augmentationPipeline, createPipeline, createStreamingPipeline, StreamlinedPipelineOptions, StreamlinedPipelineResult, StreamlinedExecutionMode were all aliases for the same stub. - src/mcp/mcpAugmentationToolset.ts deleted. executePipeline always threw "deprecated", isValidAugmentationType always returned false, getAvailableTools always returned []. Dead surface. - BrainyMCPService no longer instantiates a toolset. TOOL_EXECUTION requests now return the standard UNSUPPORTED_REQUEST_TYPE error. 'availableTools' system-info returns [] (was the same in practice). Net: 22 files changed, ~6400 LOC deleted (including legacy code + mechanical lockfile churn). Build clean, 1409/1409 tests pass.
2026-06-09 16:38:30 -07:00
🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ MAJOR RELEASE: Complete evolution of Brainy with groundbreaking features and performance. 🎯 KEY FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Triple Intelligence™ Engine - Unified Vector + Metadata + Graph search - O(log n) performance on all operations - 3ms average search latency at any scale ✨ API Consolidation - 15+ search methods → 2 clean APIs - search() for vector similarity - find() for natural language queries ✨ Natural Language Processing - 220+ pre-computed NLP patterns - Instant context understanding - "Show me recent React components with tests" ✨ Zero Configuration - Works instantly, no setup required - Built-in embedding models (no API keys) - Smart defaults for everything - Automatic optimization ✨ Enterprise Features (Free for Everyone) - Scales to 10M+ items - Write-Ahead Logging (WAL) for durability - Distributed architecture with sharding - Read/write separation - Connection pooling & request deduplication - Built-in monitoring & health checks ✨ Universal Compatibility - Node.js, Browser, Edge Workers - 4 Storage Adapters (Memory, FileSystem, OPFS, S3) - TypeScript with full type safety - Worker-based embeddings 📦 WHAT'S INCLUDED: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Core AI Database with HNSW indexing • 19 Production-ready augmentations • Universal Memory Manager • Complete CLI with all commands • Brain Cloud integration (soulcraft.com) • Comprehensive documentation • 52 test files with 400+ tests • Migration guide from 1.x 📊 PERFORMANCE: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Initialize: 450ms (24MB memory) • Search: 3ms average (up to 10M items) • Metadata Filter: 0.8ms (O(log n)) • Bulk Import: 2.3s per 1000 items • Production Scale: 5.8ms at 10M items 🔧 TECHNICAL IMPROVEMENTS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • TypeScript compilation: 153 errors → 0 • Memory usage: 200MB → 24MB baseline • Circular dependencies resolved • Worker thread communication fixed • Storage adapter consistency • Request coalescing for 3x performance 🛠️ CLI FEATURES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • brainy add - Smart data ingestion • brainy find - Natural language search • brainy search - Vector similarity • brainy chat - AI conversation mode • brainy cloud - Brain Cloud integration • brainy augment - Manage extensions • 100% API compatibility 📚 DOCUMENTATION: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Professional README with examples • Quick Start guide (5 minutes) • Enterprise Features guide • Migration guide from 1.x • API reference • Architecture documentation 🌟 USE CASES: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • AI memory layer for chatbots • Semantic document search • Code intelligence platforms • Knowledge management systems • Real-time recommendation engines • Customer support automation MIT License - Enterprise features included free for everyone. No premium tiers, no paywalls, no limits. Built with ❤️ by the Brainy community. Visit https://soulcraft.com for Brain Cloud integration.
2025-08-26 12:32:21 -07:00
return messageIndex <= currentIndex
}