### Changes:
- **mcpService.ts**:
- Updated `type` in `/mcp/tools` route to use `MCPRequestType.SYSTEM_INFO` enum instead of hardcoded string `'SYSTEM_INFO'`.
- Removed redundant `infoType: 'availableTools'` from the MCP request payload.
- Added `MCPRequestType` import from `@soulcraft/brainy`.
### Purpose:
Replaced hardcoded request type string with an enum for improved type safety and maintainability. Removed unnecessary `infoType` parameter, aligning the request payload with updated requirements.
### Changes:
- **package.json** & **package-lock.json**:
- Upgraded `@soulcraft/brainy` dependency from `^0.7.5` to `^0.9.2`.
- Updated dependencies within `@soulcraft/brainy`, including:
- Added `@tensorflow/tfjs-converter` and `buffer` as new dependencies.
- Adjusted peer dependencies for `@tensorflow/tfjs-core`.
- Included `base64-js` and `ieee754` packages.
- **package.json**:
- Refined `demo` script by replacing `demo.html` with `index.html` under `/demo/`.
### Purpose:
Upgraded `@soulcraft/brainy` to the latest version, ensuring compatibility with the new features and performance enhancements. Adjusted related dependencies to align with the updated version. Improved demo path structure for better organization.
### Changes:
- Introduced `initializeMCPService` in `cloud-wrapper/src/index.ts` to support initializing Model Control Protocol (MCP) services.
- Enabled configuration for WebSocket and REST APIs with customizable options like ports, authentication, rate limiting, and CORS.
- Exported MCP modules, types, and services (`BrainyMCPAdapter`, `BrainyMCPService`, etc.) in `src/index.ts`.
- Enhanced `unified.ts` to include global environment detection by populating `globalThis.__ENV__`.
- Added environment-specific logging for browser, Node.js, and serverless scenarios.
- Improved the structure of `environment` object and its global accessibility.
### Purpose:
Implemented MCP service integration to expand Brainy's external compatibility via WebSocket and REST interfaces. Enhanced environment detection provides better global access and debugging insights, ensuring robust operation across various runtime environments.
### Changes:
- **README Enhancements**:
- Added detection capabilities for browser, Node.js, and serverless environments with optimized configuration.
- Expanded details on adaptive storage strategies based on the detected environment.
- Included new information on the Model Control Protocol (MCP), including components like `BrainyMCPAdapter` and `MCPAugmentationToolset`.
- **Terminology Updates**:
- Replaced "restore sparse data" terminology with "import sparse data" in code samples and CLI commands for clarity (e.g., `importSparseData` method and `brainy import-sparse` command).
- Updated related examples for consistency with new term usage.
- **Cross-Environment Compatibility**:
- Highlighted dynamic imports and storage migration for seamless operation in different environments.
- Described augmented browser support and streamlined development practices.
- **MCP Documentation**:
- Detailed REST and WebSocket APIs for interacting with Brainy through MCP.
- Outlined configuration options like rate limiting and authentication for MCP services.
- **cloud-wrapper/README.md**:
- Added configuration details for MCP services, including specific usage of ports, API keys, and CORS settings.
- Expanded API scopes by introducing MCP-related endpoints for real-time and batch interactions.
### Purpose:
Enhanced documentation to reflect recent updates to environment detection, storage optimization, and MCP services. The changes improve clarity, usability, and developer understanding across environments and interaction protocols.
### Changes:
- Disabled the `@typescript-eslint/no-explicit-any` rule in `cloud-wrapper/package.json`.
- Reformatted ESLint rule configurations for `semi` and `@typescript-eslint/semi`.
- Reorganized dependencies in `package.json` for better readability:
- Moved `buffer`, `commander`, `omelette`, and `uuid` to the end of the list to match alphabetical order.
### Purpose:
Improved code clarity and maintainability by updating ESLint configurations and reordering dependencies in `package.json`. These adjustments ensure consistent formatting and easier navigation of dependencies.
### Changes:
- **Core MCP Components**:
- Introduced `BrainyMCPAdapter`, `BrainyMCPService`, and `MCPAugmentationToolset` for handling data access, tool execution, system information, and authentication via MCP.
- Added asynchronous handlers to process requests for Brainy data, augmentations, and relationships.
- Built pipelines to expose Brainy augmentation capabilities as tools.
- **Server Implementations**:
- Added WebSocket and REST interfaces in `initializeMCPService` for external MCP requests.
- Included rate limiting, authentication, and CORS support for REST API.
- **Type Definitions**:
- Defined MCP-related types such as `MCPRequestType`, `MCPResponse`, and `MCPToolExecutionRequest` in `src/types/mcpTypes.ts`.
- Incorporated augmentation-type-specific methods from `augmentationPipeline`.
- **Exports**:
- Exposed MCP modules (`BrainyMCPAdapter`, `BrainyMCPService`, `MCPAugmentationToolset`) via `src/mcp/index.ts`.
### Purpose:
Introduced a Model Control Protocol (MCP) framework to enable seamless integration of Brainy data and augmentation tools with external models. The implementation provides structured, scalable access to data and tools through both WebSocket and REST APIs.
### Changes:
- Added explicit `.js` extensions to imports in `cloud-wrapper/src/index.ts` for Node.js compatibility.
- Refactored `setupRoutes` usage by introducing an `apiRouter` variable for clarity and consistency in middleware.
- Simplified environment detection in `src/unified.ts` by delegating it to build-time logic:
- Removed inline environment detection (`isBrowser`, `isNode`, `isServerless`).
- Updated `environment` export with build-generated properties.
### Purpose:
Enhanced compatibility with Node.js module resolution, improved code clarity in route handling, and streamlined environment detection by consolidating it into the build process. These changes reduce redundancy, improve maintainability, and align with modern JavaScript practices.
### Changes:
- Introduced `asyncHandler` utility to simplify error handling in asynchronous route handlers.
- Updated all route definitions in `cloud-wrapper/src/routes.ts` to use the new `asyncHandler` wrapper:
- Standardized error management across CRUD operations for nouns, verbs, and search functionality.
- Replaced redundant `try-catch` blocks with the `asyncHandler` wrapper to streamline code.
- Added `NextFunction` and adjusted TypeScript typings for improved clarity and error handling.
### Purpose:
Refactored route handlers to enhance maintainability, readability, and consistency by centralizing asynchronous error handling with a reusable `asyncHandler` utility. This reduces redundancy and simplifies debugging for API routes.
### Changes:
- Introduced `package-lock.json` file for the `cloud-wrapper` package.
- Includes configuration details for dependencies:
- Runtime dependencies: `@soulcraft/brainy`, `cors`, `dotenv`, `express`, `helmet`, `morgan`, `uuid`, `ws`.
- Development dependencies: TypeScript, nodemon, and type definitions for key libraries.
- Specifies supported Node.js version (`>=23.11.0`).
### Purpose:
Committed the `package-lock.json` to ensure consistency in dependency resolution during installation. This facilitates improved reliability across development and production environments.
### Changes:
- Introduced `ExtendedBrainyDataConfig` interface to include `rootDirectory` in the storage configuration.
- Enhanced S3 storage setup:
- Added support for `customS3Storage` when `S3_ENDPOINT` is provided.
- Retained standard `s3Storage` configuration for AWS S3 without custom endpoints.
- Updated fallback logic for default storage types (`filesystem`, `memory`) with consistent handling for `rootDirectory`.
- Refined `initializeBrainy` function to improve readability and configuration extensibility.
- Updated TypeScript typings for improved clarity and maintainability.
### Purpose:
Improved the `initializeBrainy` function by extending storage configuration capabilities, allowing seamless integration of custom S3 endpoints alongside standard AWS S3 settings. Enhanced overall code readability and adaptability for diverse storage configurations.
### Changes:
- Removed conditional configuration for `USE_SIMPLE_EMBEDDING` as Universal Sentence Encoder is now the sole embedding option.
- Updated comments to reflect the exclusive use of TensorFlow.js for embedding functionality.
- Cleaned up unnecessary blank lines and whitespace for improved code readability.
### Purpose:
Simplified the `initializeBrainy` function by consolidating embedding configuration and eliminating outdated options. This refinement aligns with the project's transition to TensorFlow-based embeddings and improves code clarity.
Standardized documentation by adding a centered Brainy logo across README files, examples, and guides. Adjusted text formatting for consistency, improved alignment, and readability of feature descriptions and examples.
Implemented a WebSocket API for real-time communication and REST API routes for CRUD operations on nouns and verbs. Added a server initialization script with WebSocket server integration and improved application structure with modularized routing and services.
Introduced a cloud deployment wrapper for Brainy supporting AWS Lambda, Google Cloud Run, and Cloudflare Workers. Added configuration options, deployment scripts, and API reference. Updated `README.md` with contribution guidelines and cloud deployment documentation.