Commit graph

1025 commits

Author SHA1 Message Date
04477fef84 refactor: replace Brainy with TransformerEmbedding in buildEmbeddedPatterns
- Replace Brainy with TransformerEmbedding for embedding patterns
- Update initialization logic to support TransformerEmbedding features like `localFilesOnly`
- Adjust embedding logic to use TransformerEmbedding's embed method
- Remove unused Brainy-related code (e.g., close method)
2025-09-29 10:05:46 -07:00
797839c135 chore: enforce consistent coding style and semicolon removal
- Update ESLint configuration to enforce no semicolons (`semi: ['error', 'never']`)
- Fix all instances of semicolons in `*.ts` files to align with style rules
- Adjust related ESLint rules for `no-extra-semi`
- Simplify unnecessary semicolon patterns in global variable assignments
2025-09-29 09:50:59 -07:00
cfd74adcb3 feat: fix critical storage and VFS sharding bugs for production scale
- Fix FileSystemStorage sharding: getAllShardedFiles() for proper directory traversal
- Fix getNode() metadata: was filtering out metadata causing VFS entity failures
- Add production-scale streaming pagination for millions of entities
- Optimize sharding threshold from 1000 to 100 files for better performance
- Fix VFS readdir() and tree operations for complete directory structure support
- Add verb count tracking and persistence for performance optimizations

🚀 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 17:01:56 -07:00
7a0e385c35 chore(release): 3.16.0 2025-09-26 15:45:33 -07:00
0e972525b6 fix: complete VFS root directory and Contains relationship fixes
- Fix root directory metadata to always have vfsType: 'directory'
- Add compatibility layer for malformed entity metadata
- Ensure Contains relationships are maintained for all file operations
- Fix resolvePath() special case for root directory
- Add comprehensive documentation for VFS troubleshooting
- Document proper usage of standard NounType and VerbType enums

Resolves critical VFS bugs reported by brain-cloud team
2025-09-26 15:45:13 -07:00
40715226fa chore(release): 3.15.0 2025-09-26 15:12:23 -07:00
a20418bca9 fix: ensure Contains relationships are maintained when updating files in VFS
- Add Contains relationship verification when updating existing files
- Create missing relationships to prevent orphaned files
- Fix resolvePath to return entity IDs instead of path strings
- Improve error handling in ensureDirectory method
- Add comprehensive tests for Contains relationship integrity

Resolves critical bug where vfs.readdir() returned empty arrays
2025-09-26 15:12:04 -07:00
493fc48603 chore(release): 3.14.2 2025-09-26 14:28:00 -07:00
1259b66525 fix: improve VFS initialization error messages and documentation
- Add helpful error message when VFS not initialized
- Include example code in error message showing correct initialization
- Add VFS_INITIALIZATION.md documentation guide
- Add tests for VFS initialization patterns
- Clarify that brain.vfs() is a method, not a property
2025-09-26 14:27:46 -07:00
29ecf8c271 fix: update hardcoded version references to use dynamic version
- Update DEFAULT_VERSION in version.ts from 3.5.1 to 3.14.0
- Replace hardcoded version in sharedConfigManager with getBrainyVersion()
- Replace hardcoded CLI version display with dynamic version
- Ensures all user-facing version displays stay current automatically

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 13:41:16 -07:00
ab4c8d82f5 chore(release): 3.14.0 2025-09-26 13:32:51 -07:00
3c72afd41a docs: comprehensive API documentation and examples overhaul
- Add comprehensive JSDoc @example tags to all core methods (add, get, relate, find, similar, embed)
- Add @deprecated warnings with migration paths for all v2.x APIs
- Create VFS Quick Start Guide addressing brain-cloud integration issues
- Create VFS Common Patterns guide preventing infinite recursion mistakes
- Create Core API Patterns guide with modern v3.x usage examples
- Create Neural API Patterns guide for AI-powered features
- Create comprehensive API Decision Tree for choosing right methods
- Update README with prominent VFS examples and file explorer patterns
- Follow 2025 npm package documentation standards throughout

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 13:32:44 -07:00
f80ed5e8aa fix: handle symlink type in TreeNode creation 2025-09-26 10:19:37 -07:00
4984303f90 chore(release): 3.13.0 2025-09-26 10:18:40 -07:00
72590d52b0 feat: add tree-aware VFS methods to prevent recursion in file explorers
Add safe tree operations that guarantee no directory appears as its own child:
- getDirectChildren() returns only immediate children
- getTreeStructure() builds safe tree with recursion protection
- getDescendants() gets all descendants efficiently
- inspect() provides comprehensive path information

Also includes VFSTreeUtils for building and validating tree structures.

This resolves the common infinite recursion issue when building file
explorers, as discovered by the Soulcraft Studio team.

Co-Authored-By: User <noreply@user.local>
2025-09-26 10:17:59 -07:00
0b20fd24da chore(release): 3.12.0 2025-09-25 14:51:48 -07:00
4f76dac7be feat: refactor VFS to use proper Brainy graph relationships
- Replace metadata path queries with brain.getRelations() API
- Use graph traversal for parent-child relationships via VerbType.Contains
- Remove fallback metadata queries - trust graph relationships completely
- Fix getChildren() to properly query relationship graph
- Update getRelated() and getRelationships() to use native Brainy APIs

This enables full graph benefits: indexes, optimizations, and visualizations
now work correctly with VFS. The filesystem structure is now a true graph
using Brainy's native relationship system.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 14:51:08 -07:00
cc6fa00f30 fix: Knowledge Layer EntityManager integration
* Add EntityManager base class for standardized entity operations
* Update SemanticVersioning to extend EntityManager
* Update EventRecorder to extend EntityManager
* Update PersistentEntitySystem to extend EntityManager
* Update ConceptSystem to extend EntityManager
* Fix entity ID mismatch patterns across all Knowledge Layer components
* Add proper domain ID to Brainy ID mapping
* Replace direct brain.add/find calls with EntityManager methods
* Ensure all entity interfaces extend ManagedEntity
* Add proper metadata fields for querying (eventType, conceptType, entityType)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 12:54:35 -07:00
6e6da5011f fix: resolve TypeScript error in exportToJSON method 2025-09-25 12:15:25 -07:00
b60debe013 chore(release): 3.10.0 2025-09-25 12:14:30 -07:00
7730b88618 feat: add VFS methods and fix documentation accuracy
- Add exportToJSON() for directory structure export
- Add searchEntities() for advanced entity filtering
- Add bulkWrite() for efficient batch operations
- Fix VFS documentation to accurately reflect implementation
- Add USER_FUNCTIONS.md with domain-specific templates
- Clarify Knowledge Layer augmentation pattern
- Correct GitBridge integration examples
2025-09-25 12:12:20 -07:00
a4ed075e5f feat: implement core VFS and Knowledge Layer methods
- Add setUser/getCurrentUser for collaboration tracking
- Add getAllTodos to recursively collect todos
- Add getProjectStats for project statistics
- Add findByConcept to search files by concept
- Add getTimeline for temporal event views
- Add getCollaborationHistory to track edits by user
- Add exportToMarkdown for directory export
- Add getEvents method to EventRecorder
- Update Knowledge Layer docs to remove unimplementable AI features
- Make all documented features real and production-ready

All core VFS and Knowledge Layer documentation now reflects 100% real,
working code. AI-powered features have been moved to future augmentations.
2025-09-25 11:04:36 -07:00
581f9906fd feat: complete VFS with Knowledge Layer integration
- Add importFile() method for single file imports
- Implement entity helper methods (linkEntities, findEntityOccurrences)
- Fix critical embedding tokenizer bug (char.charCodeAt error)
- Fix removeRelationship to actually remove using brain.unrelate()
- Add setMetadata/getMetadata methods
- Fix GitBridge to query real relationships and events
- Enable background Knowledge Layer processing
- Rewrite README to emphasize knowledge over files
- Add comprehensive VFS documentation (core, knowledge layer, examples)
- Add complete test suite covering all VFS methods

This completes the VFS implementation with full Knowledge Layer support,
enabling files as living knowledge that understand themselves, evolve
over time, and connect to everything related.
2025-09-25 10:47:44 -07:00
b3c4f348ab feat: implement complete VFS with Knowledge Layer integration
Add production-ready Virtual File System with intelligent Knowledge Layer:

Core VFS Features:
- Complete file system operations (read, write, mkdir, etc.)
- Intelligent PathResolver with 4-layer caching system
- Chunked storage for large files with real compression
- Embedding generation for semantic operations
- File relationships and metadata tracking
- Import functionality from local filesystem

Knowledge Layer Integration:
- EventRecorder for complete file history and temporal coupling
- SemanticVersioning with content-based change detection
- PersistentEntitySystem for character/entity tracking across files
- ConceptSystem for universal concept mapping and graphs
- GitBridge for import/export between VFS and Git repositories

Architecture:
- KnowledgeAugmentation properly integrated into Brainy augmentation system
- KnowledgeLayer wrapper provides real-time VFS operation interception
- Background processing ensures VFS operations remain fast
- All components use real Brainy embed() method for embeddings
- Support for creative writing, coding projects, and project management

Technical Implementation:
- Fixed all stub/mock implementations with real working code
- TypeScript compilation passes without errors
- Comprehensive test suite demonstrating all features
- Documentation covering architecture and usage patterns
- Backwards compatible with existing Brainy functionality

This enables scenarios like writing books with persistent characters,
managing coding projects with concept tracking, and complete project
coordination with intelligent file relationships.
2025-09-24 17:31:48 -07:00
afd1d71d47 chore(release): 3.9.1 2025-09-22 16:19:46 -07:00
8508cfc97d docs: update documentation for accurate v3.9.0 API examples and technical claims
- Fix all API examples to use proper enum syntax (NounType.Concept vs "concept")
- Correct noun/verb type counts (31 noun types × 40 verb types = 1,240 combinations)
- Update package references from 'brainy' to '@soulcraft/brainy'
- Standardize version references to be version-agnostic
- Ensure all examples match actual v3.9.0 implementation
- Add proper TypeScript imports throughout documentation
2025-09-22 16:19:27 -07:00
6113b39109 chore: add .brainy runtime folder to gitignore 2025-09-22 16:01:31 -07:00
8b714eda1f chore(release): 3.9.0 2025-09-22 15:45:50 -07:00
ed64c266ec feat: add distributed architecture with sharding and coordination
- Wire up distributed components (Coordinator, ShardManager, CacheSync)
- Implement automatic sharding for S3 storage (256 shards)
- Add read/write separation for operational modes
- Zero-config automatic detection for distributed mode
- Add mutex implementation for thread safety
- Fix metadata filtering in find operations
- Fix neural API vector similarity calculations
- Improve batch operations performance
- Add Bluesky distributed setup example

BREAKING CHANGE: None - backward compatible
2025-09-22 15:45:35 -07:00
8aafc769a3 chore(release): 3.8.3 2025-09-17 17:20:19 -07:00
340123b3b6 fix: remove top-level node:path imports to fix browser bundler compatibility
- Convert static imports to dynamic imports with environment checks
- Prevents 'Module externalized for browser compatibility' errors
- Maintains Node.js functionality while enabling browser usage
2025-09-17 17:20:05 -07:00
0cde950c03 fix: exclude cortex modules from browser bundles to prevent CLI dependency issues
- Add cortex module exclusions in browser field
- Prevents chalk, ora, boxen imports from being bundled in browsers
- Resolves process.stderr.isTTY error in browser environments
- Cortex functionality remains available in Node.js environments
2025-09-17 17:06:19 -07:00
972fb9197f fix: resolve browser compatibility by avoiding Node.js process access in nodeVersionCheck
- Add environment detection using isNode() check
- Skip Node.js version validation in browser environments
- Return browser-friendly defaults when not in Node.js
- Prevents "Cannot read properties of undefined (reading 'isTTY')" error
- Ensures external bundlers (Vite, Webpack) work correctly with Brainy

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 16:59:59 -07:00
fddb296f34 chore(release): 3.8.0
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 16:49:24 -07:00
909e3d3ee0 feat: add intelligent storage auto-detection as default
- Change default storage from 'memory' to 'auto' for smart environment detection
- Add 'auto' support to storage type validation and TypeScript types
- Browser: auto-selects OPFS → memory fallback
- Node.js: auto-selects filesystem → memory fallback
- Cloud: auto-detects S3/GCS/R2 → disk → memory fallback
- Eliminates need for manual storage configuration in most cases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 16:48:57 -07:00
ec8781a976 chore(release): 3.7.1 2025-09-17 16:22:14 -07:00
b295370c9b fix: prevent fs adapter from throwing on import in browser
- Add BrowserFS no-op implementation instead of throwing immediately
- Methods still throw when called (not at import time)
- exists() returns false instead of throwing
- readdir() returns empty arrays instead of throwing

This allows Brainy to be imported in browser environments without errors
2025-09-17 16:22:02 -07:00
1b47cd51f0 chore(release): 3.7.0 2025-09-17 15:48:16 -07:00
c303ead318 feat: add browser environment compatibility support
- Remove top-level Node.js imports that break bundlers
- Use universal adapters for crypto operations
- Add dynamic imports for Node.js-specific modules
- Add browser field to package.json for bundler hints
- Maintain full Node.js functionality while enabling browser usage

This allows Brainy to be used with modern bundlers (Vite, Webpack, etc.)
without requiring Node.js polyfills. Browser environments get core features
while Node.js retains all capabilities including filesystem and networking.
2025-09-17 15:48:02 -07:00
2793cef197 chore(release): 3.6.0 2025-09-17 14:54:24 -07:00
7ab090fedf feat: add browser environment compatibility support
- Remove Node.js-specific imports from module level
- Use dynamic imports with isNode() environment checks
- Wrap all file system operations in conditional blocks
- Add fallback values for browser environments
- Ensure code works in both Node.js and browser contexts

This change enables Brainy to run in browser environments without
requiring Node.js polyfills, making it truly universal.

Co-Authored-By: dpsifr <noreply@dpsifr.com>
2025-09-17 14:53:54 -07:00
14ccbf6556 chore(release): 3.5.1 2025-09-17 14:34:51 -07:00
098703d2dc fix: resolve bundler compatibility by avoiding fs/promises subpath import
Replace direct import of 'node:fs/promises' with 'node:fs' and access promises property. This fixes bundler issues with Vite/Webpack while maintaining full Node.js compatibility.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:34:24 -07:00
7bfed925b3 chore(release): 3.5.0 2025-09-17 14:22:50 -07:00
fcb7197fb0 feat: add node: protocol to all Node.js built-in imports for bundler compatibility
- Updated all fs, path, crypto, os, url, util, events, http, https, net, child_process, stream, and zlib imports
- Changed both static imports and dynamic imports to use node: protocol
- This makes Brainy more bundler-friendly by explicitly marking Node.js built-ins
- Prevents bundlers from attempting to polyfill or bundle these modules
- Reduces bundle size for web applications using Brainy
- Improves tree-shaking and dead code elimination

Benefits for external bundlers:
- Clear distinction between Node.js built-ins and external dependencies
- No ambiguity about what needs polyfilling
- Smaller bundles for browser builds
- Better compatibility with modern bundlers (Webpack 5, Vite, Rollup, esbuild)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:20:21 -07:00
1b32870e43 feat: modernize API architecture and deprecation handling
- Modernize BrainyInterface to only contain current API methods (add, relate, find, get)
- Update all interface consumers to use modern API patterns
- Make Brainy class implement clean modernized interface
- Update CLI commands to use add() and relate() instead of deprecated methods
- Update all source code components to use modern API consistently
- Update examples and integration tests to modern patterns
- Improve architectural consistency across the entire codebase

BREAKING: BrainyInterface no longer contains deprecated methods
Migration: Use add() instead of addNoun(), relate() instead of addVerb()
2025-09-17 11:54:20 -07:00
2128ef5607 docs: add deprecation warnings for addNoun and addVerb methods
- Add @deprecated JSDoc tags to TypeScript definitions
- Update all documentation examples to use modern add() and relate() API
- Preserve batch operations (addNouns, addVerbs) as they remain current
- Mark deprecated methods in both source and compiled definitions

Migration guide:
- addNoun(data, type, metadata) → add(data, { nounType: type, ...metadata })
- addVerb(source, target, type, metadata) → relate(source, target, type, metadata)
2025-09-17 10:48:41 -07:00
20a54fbb7e release: version 3.3.0 2025-09-16 13:20:22 -07:00
27fb3ef905 feat: add complete silent mode for TUI applications
- Add silent option to BrainyConfig to suppress ALL console output
- Override console methods (log, info, warn, error) when silent=true
- Add LogLevel.SILENT to Logger for proper silent mode support
- Propagate silent mode to all augmentations automatically
- Update augmentation configs to support silent property
- Restore console methods properly on brain.close()
- Perfect for terminal UI applications that need clean output

Usage:
```javascript
const brain = new Brainy({
  storage: { type: 'filesystem', path: './data' },
  silent: true  // Complete silence - zero console output
})
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 13:18:49 -07:00
4d3e21a0f7 chore(release): 3.2.0
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 11:24:42 -07:00