**feat: add MCP service integration and enhance environment detection**
### 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.
This commit is contained in:
parent
830322fef9
commit
c641467854
3 changed files with 85 additions and 4 deletions
41
src/index.ts
41
src/index.ts
|
|
@ -261,3 +261,44 @@ export type {
|
|||
Content
|
||||
}
|
||||
export { NounType, VerbType }
|
||||
|
||||
// Export MCP (Model Control Protocol) components
|
||||
import {
|
||||
BrainyMCPAdapter,
|
||||
MCPAugmentationToolset,
|
||||
BrainyMCPService
|
||||
} from './mcp/index.js' // Import from mcp/index.js
|
||||
import {
|
||||
MCPRequest,
|
||||
MCPResponse,
|
||||
MCPDataAccessRequest,
|
||||
MCPToolExecutionRequest,
|
||||
MCPSystemInfoRequest,
|
||||
MCPAuthenticationRequest,
|
||||
MCPRequestType,
|
||||
MCPServiceOptions,
|
||||
MCPTool,
|
||||
MCP_VERSION
|
||||
} from './types/mcpTypes.js'
|
||||
|
||||
export {
|
||||
// MCP classes
|
||||
BrainyMCPAdapter,
|
||||
MCPAugmentationToolset,
|
||||
BrainyMCPService,
|
||||
|
||||
// MCP types
|
||||
MCPRequestType,
|
||||
MCP_VERSION
|
||||
}
|
||||
|
||||
export type {
|
||||
MCPRequest,
|
||||
MCPResponse,
|
||||
MCPDataAccessRequest,
|
||||
MCPToolExecutionRequest,
|
||||
MCPSystemInfoRequest,
|
||||
MCPAuthenticationRequest,
|
||||
MCPServiceOptions,
|
||||
MCPTool
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue