Commit Graph

199 Commits

Author SHA1 Message Date
jango-blockchained
10bf5919e4 refactor: enhance middleware and security with advanced protection mechanisms
- Upgraded rate limiter configuration with more granular control and detailed headers
- Improved authentication middleware with enhanced token validation and error responses
- Implemented advanced input sanitization using sanitize-html with comprehensive XSS protection
- Replaced manual security headers with helmet for robust web security configuration
- Enhanced error handling middleware with more detailed logging and specific error type handling
- Updated SSE rate limiting with burst and window-based restrictions
- Improved token validation with more precise signature and claim verification
2025-02-03 22:29:41 +01:00
jango-blockchained
89f2278c25 refactor: improve SSE types and testing utilities
- Enhanced SSE event type definitions with more precise typing
- Added type guard and safe type assertion functions for mock objects
- Updated security test suite to use new type utilities
- Improved type safety for token validation and mock function handling
- Refined event data type to support more flexible event structures
2025-02-03 22:22:26 +01:00
jango-blockchained
a53cec7b28 chore: migrate project to Bun testing framework and update configuration
- Replace Jest with Bun's native testing framework
- Update test configuration and utilities to support Bun test environment
- Add mock implementations for SSE and security testing
- Refactor test setup to use Bun's testing utilities
- Update package dependencies and scripts to align with Bun testing
- Enhance type definitions for Bun test mocking
2025-02-03 22:19:43 +01:00
jango-blockchained
b7856e9d05 Updated .gitignore 2025-02-03 22:10:24 +01:00
jango-blockchained
7891115ebe test: add comprehensive test suite for security and SSE components
- Implemented detailed Jest test configurations for project
- Added test configuration with robust environment setup
- Created comprehensive test suites for:
  * Security middleware
  * Token management
  * SSE security features
- Configured test utilities with mock request/response objects
- Implemented extensive test scenarios covering authentication, rate limiting, and error handling
2025-02-03 22:08:16 +01:00
jango-blockchained
a814c427e9 feat: enhance security configuration and SSE management with robust token validation and client tracking
- Refactored `.env.example` with comprehensive security and configuration parameters
- Added new `security.config.ts` for centralized security configuration management
- Improved middleware with enhanced authentication, request validation, and error handling
- Updated SSE routes and manager with advanced client tracking, rate limiting, and connection management
- Implemented more granular token validation with IP-based rate limiting and connection tracking
- Added detailed error responses and improved logging for security-related events
2025-02-03 22:02:12 +01:00
jango-blockchained
840927998e docs: enhance README with comprehensive project status and Bun runtime details
- Updated project status section with current achievements and upcoming features
- Added detailed performance benefits and optimization sections
- Expanded development workflow and testing instructions
- Included version history and advanced feature descriptions
- Refined Bun runtime documentation and performance highlights
- Improved overall readability and project presentation
2025-02-03 19:32:38 +01:00
jango-blockchained
cf7fb2422e Migrate from BUN_ENV to NODE_ENV and update Home Assistant implementation 2025-02-03 19:18:52 +01:00
jango-blockchained
d46a19c698 docs: update README with Bun runtime migration and comprehensive workflow details
- Replaced Node.js and npm references with Bun runtime configuration
- Updated badges to reflect Bun version
- Added new sections on Bun performance benefits and development workflow
- Expanded troubleshooting and performance optimization guidelines
- Simplified installation, build, and testing instructions
- Included Bun-specific commands for development and testing
2025-02-03 19:07:31 +01:00
jango-blockchained
d7c12676f5 feat: migrate project to Bun runtime with comprehensive configuration updates
- Updated Dockerfile to use Bun 1.0.26 as base image
- Replaced npm/yarn scripts with Bun equivalents in package.json
- Modernized .dockerignore with expanded file and directory exclusions
- Simplified jest.config.cjs to use Bun's native testing framework
- Added new ha-analyzer-cli.ts and health-check.ts utility scripts
- Configured package manager to use Bun 1.0.26
2025-02-03 19:02:42 +01:00
jango-blockchained
25e9025105 refactor: modernize log rotation utility with improved error handling and glob import
- Updated glob import to use modern ES module syntax
- Simplified log file retrieval and cleanup methods
- Added error logging for log rotation interval tasks
- Removed deprecated callback-based glob usage
- Improved type safety and error handling in log rotation functions
2025-02-03 18:52:14 +01:00
jango-blockchained
d17d881e7b test: enhance security middleware and token management tests
- Added comprehensive test coverage for TokenManager encryption and validation methods
- Implemented detailed test scenarios for security middleware functions
- Updated test cases to handle edge cases and improve input validation
- Refactored test mocks to provide more robust and realistic testing environment
- Improved error handling and input validation in security-related components
2025-02-03 18:44:38 +01:00
jango-blockchained
4e89e5458c feat: add Claude mode support with conditional Express server initialization
- Modify index.ts to conditionally start Express server based on PROCESSOR_TYPE
- Add logic to skip server initialization when in Claude mode
- Update file comments to reflect new conditional server startup behavior
- Log informative message when running in Claude mode
2025-02-03 16:46:22 +01:00
jango-blockchained
5082f0d9fd chore: update dependencies and refactor import paths
- Updated package.json with latest dependency versions
- Added winston-daily-rotate-file type definitions
- Refactored import paths in tools and routes to use .js extensions
- Modified SSE routes to use getStatistics method
- Improved log rotation utility with more robust file cleanup
2025-02-03 16:28:06 +01:00
jango-blockchained
5362ed18ee chore: add env template and update gitignore 2025-02-03 15:50:27 +01:00
jango-blockchained
ea5c377fa2 Refactor project structure and remove unused modules
- Removed performance monitoring, tools service, and polyfills modules
- Moved formatToolCall helper function to test file
- Simplified imports in index.ts by removing polyfills import
- Cleaned up unnecessary files and consolidated code structure
2025-02-03 15:47:59 +01:00
jango-blockchained
51c1594f2f Add log rotation utility with file management and cleanup
- Implemented log rotation module with configurable size and age-based log management
- Added utility functions to parse log file sizes and retention durations
- Created methods for identifying, filtering, and cleaning up old log files
- Integrated log rotation initialization in the main application entry point
- Added periodic checks for log file size and age-based cleanup
2025-02-03 15:43:27 +01:00
jango-blockchained
1753e35cd3 Add comprehensive logging infrastructure with configuration and middleware
- Implemented centralized logging utility using Winston with daily log rotation
- Added logging middleware for request and error tracking
- Extended .env.example with logging configuration options
- Updated app configuration to support flexible logging settings
- Replaced console.log with structured logging in main application entry point
- Created logging middleware to capture request details and response times
2025-02-03 15:41:06 +01:00
jango-blockchained
397355c1ad Restructure Project Architecture with Modular Routes and Configuration
- Refactored main application entry point to use centralized configuration
- Created modular route structure with separate files for different API endpoints
- Introduced app.config.ts for centralized environment variable management
- Moved tools and route logic into dedicated files
- Simplified index.ts and improved overall project organization
- Added comprehensive type definitions for tools and API interactions
2025-02-03 15:39:19 +01:00
jango-blockchained
18f09bb5ce Add comprehensive documentation for Home Assistant MCP project
- Created detailed getting started guide with installation and configuration instructions
- Added main documentation README with structured table of contents
- Developed troubleshooting guide with common issues, debugging tips, and FAQ
- Included development guide with project structure, setup, and contribution guidelines
- Added tools documentation with overview of available management tools
2025-02-03 15:38:55 +01:00
jango-blockchained
47ca0444b7 Enhance SSE Statistics and Home Assistant Type Management
- Improved SSE statistics endpoint with comprehensive error handling and structured response
- Refined Home Assistant type exports in interfaces
- Updated SSE manager to provide more detailed subscription statistics
- Added timestamp and success status to SSE stats endpoint
- Introduced .env.development configuration file with detailed model and processor settings
2025-02-03 15:24:57 +01:00
jango-blockchained
149d3a585e Refactor SSE and Home Assistant Integration with Enhanced Configuration
- Simplified SSE statistics retrieval in routes
- Extended Home Assistant configuration with additional connection parameters
- Implemented comprehensive Home Assistant instance methods for services, states, and events
- Cleaned up and type-refined Home Assistant interfaces
- Improved WebSocket event handling and type conversion
2025-02-03 15:11:46 +01:00
jango-blockchained
f049f439b9 Refactor Home Assistant WebSocket Integration with Enhanced Type Safety
- Implemented a new HomeAssistantInstance class with comprehensive WebSocket handling
- Added robust authentication and message management for Home Assistant connections
- Created type-safe interfaces for states, services, and event subscriptions
- Updated import paths and simplified configuration loading
- Improved error handling and connection management for Home Assistant interactions
2025-02-03 00:52:35 +01:00
jango-blockchained
2da617c2d9 Add core API routes, Home Assistant interfaces, and device management tools
- Implemented comprehensive API routes for MCP schema, device execution, and control
- Created Home Assistant entity and event interfaces with detailed type definitions
- Added tools for listing and controlling Home Assistant devices
- Introduced SSE (Server-Sent Events) subscription and management endpoints
- Implemented flexible device control with support for multiple domains and parameters
2025-02-03 00:32:24 +01:00
jango-blockchained
cee8cf8b1e Enhance configuration management with comprehensive environment setup
- Added detailed .env.example with extensive configuration options
- Created centralized configuration module with type-safe environment variable loading
- Implemented configuration validation and default value handling
- Added support for different environment modes (development, production, test)
- Introduced interfaces for robust type definitions across the project
- Implemented middleware for request validation, security, and input sanitization
2025-02-03 00:32:14 +01:00
jango-blockchained
f81cb1af62 Simplify README by removing detailed API and CLI documentation
- Removed extensive Home Assistant Analyzer CLI section
- Condensed API Reference to point to external documentation files
- Simplified development commands section
- Kept core sections like OpenAI Integration and Troubleshooting
- Improved overall readability by reducing technical depth in README
2025-02-03 00:29:38 +01:00
jango-blockchained
cb6b16546b Refactor API Documentation with Comprehensive MCP Schema and Endpoint Details
- Completely restructured API.md with a more modular and detailed approach
- Added comprehensive schema documentation for MCP endpoint
- Expanded sections on device control, add-on management, and core functions
- Included WebSocket event handling and real-time update mechanisms
- Enhanced error handling and rate limiting documentation
- Added example usage sections with curl and JavaScript demonstrations
- Improved overall readability and technical depth of API reference
2025-02-03 00:28:07 +01:00
jango-blockchained
bd7e206b96 Remove Jest configuration and setup files
- Deleted Jest configuration file (jest.config.js)
- Removed Jest setup files for CommonJS and ES modules
- Added .mypy_cache/ to .gitignore for Python type checking cache
2025-02-03 00:21:55 +01:00
jango-blockchained
11cea5b200 Expand MCP Schema with Home Assistant Management Tools
- Added new schema definitions for Home Assistant management tools
- Included automation configuration management
- Added support for add-on, package, scene, and notification controls
- Integrated history retrieval for entity data
- Appended HACS documentation reference
2025-02-03 00:19:06 +01:00
jango-blockchained
c0364fac27 Add Home Assistant Analyzer CLI with Advanced AI-Powered Analysis
- Implemented comprehensive Home Assistant system analysis tool
- Added multi-model support for OpenAI and DeepSeek language models
- Created detailed system, performance, security, and automation analysis capabilities
- Enhanced README with in-depth documentation of CLI features and usage
- Integrated advanced XML-based response parsing and intelligent insights generation
- Implemented flexible analysis modes: standard, custom prompt, and automation optimization
2025-02-03 00:04:26 +01:00
jango-blockchained
92bafbdaa7 Enhance OpenAI Test Script with Advanced Model Selection and Error Handling
- Added comprehensive model configuration and selection mechanism
- Implemented dynamic model handling for OpenAI and DeepSeek providers
- Enhanced error handling and retry logic for API interactions
- Expanded system analysis with more detailed XML-based response parsing
- Updated configuration loading with improved model selection and validation
- Added colored logging and more informative console output
- Integrated new test suite for API endpoints
2025-02-02 23:29:37 +01:00
jango-blockchained
2987837321 Add Claude processor type to .env.example configuration 2025-02-02 23:27:19 +01:00
jango-blockchained
d7f127af4d Merge remote changes and resolve conflicts 2025-02-01 13:55:07 +01:00
jango-blockchained
8f0b9eb909 Enhance Jest Configuration and Resolver for ESM and TypeScript Support
- Updated Jest configuration to handle .mts and .mjs file extensions
- Improved Jest resolver to better support ESM modules and @digital-alchemy packages
- Added comprehensive test coverage for AI router, Home Assistant integration, and WebSocket client
- Expanded test scenarios for error handling, event subscriptions, and service interactions
2025-02-01 13:53:55 +01:00
Tevon Strand-Brown
99c66099c6 Update package.json with project name, dependencies, and package manager
- Corrected package name from `jango-blockchained/homeassistant-mcp` to `homeassistant-mcp`
- Added `@types/supertest` and `supertest` for testing
- Updated package manager specification to Yarn 1.22.22
2025-02-01 12:41:00 +01:00
jango-blockchained
675f6e3942 Add OpenAI-powered Home Assistant Analysis Tool
- Implemented comprehensive AI-driven system analysis using OpenAI's GPT-4
- Created interactive CLI tool for Home Assistant device and system insights
- Added support for standard and custom prompt-based analysis
- Integrated MCP server data collection with intelligent AI processing
- Updated package.json with new OpenAI and XML dependencies
- Enhanced README with detailed OpenAI integration documentation
2025-02-01 12:35:13 +01:00
jango-blockchained
9037cffcfe Add MCP Execute Endpoint with Secure Authentication and Tool Execution
- Implemented `/mcp/execute` endpoint for tool execution
- Added token-based authentication using HASS_TOKEN
- Supports dynamic tool selection and parameter passing
- Includes comprehensive error handling for unauthorized access and tool not found scenarios
- Provides flexible execution workflow with detailed response handling
2025-02-01 12:29:42 +01:00
jango-blockchained
431a68d690 Refactor SSE Endpoint with Enhanced Token Validation and Client Management
- Replaced direct token comparison with TokenManager validation
- Implemented robust SSE client connection and event subscription workflow
- Added detailed client authentication and connection status reporting
- Improved SSE endpoint with flexible event, entity, and domain subscription
- Enhanced error handling and client disconnect management
2025-02-01 07:50:54 +01:00
jango-blockchained
d3da46d5d5 Enhance Claude Desktop MCP Setup Script with Robust Installation and Configuration Management
- Added comprehensive error handling and validation functions
- Implemented backup and upgrade/clean install workflow
- Enhanced system requirements and dependency checks
- Improved configuration management with secure token and URL validation
- Added detailed user interaction and informative console output
- Implemented flexible installation modes with existing configuration preservation
2025-02-01 06:45:57 +01:00
jango-blockchained
155a6ea5ba Add MCP Schema Endpoint for API Discovery
- Implemented `/mcp` endpoint to expose server capabilities
- Created `src/mcp/schema.ts` with comprehensive tool and resource definitions
- Updated README.md with MCP Schema documentation
- Modified security middleware to allow unauthenticated access to schema endpoint
- Included detailed tool descriptions for list_devices, control, and event subscription
2025-02-01 06:42:16 +01:00
Tevon Strand-Brown
281cf29158 Update README.md with Claude use 2025-01-31 20:56:35 -08:00
Tevon Strand-Brown
61d4af5a06 Yarn refuses to illegal characters in package name 2025-01-31 20:43:09 -08:00
Tevon Strand-Brown
9682642733 Merge pull request #5 from jango-blockchained/main
Comprehensive Home Assistant MCP Enhancement
2025-01-31 20:38:01 -08:00
jango-blockchained
aa911c179d Merge branch 'main' of https://github.com/jango-blockchained/homeassistant-mcp 2025-02-01 04:23:30 +01:00
jango-blockchained
13773d2977 Add Docker support and enhance server configuration
- Created Dockerfile for containerized deployment
- Added .dockerignore to optimize Docker build context
- Updated README with comprehensive Docker setup instructions
- Implemented new server endpoints:
  * Health check endpoint
  * Device listing
  * Device control
  * SSE event subscription
- Enhanced security middleware with request validation and input sanitization
- Added error handling and token-based authentication for new endpoints
2025-02-01 04:21:45 +01:00
Tevon Strand-Brown
79f1418f6f Merge branch 'main' into main 2025-01-31 16:52:34 -08:00
jango-blockchained
b855b05dca Remove coverage directory and update .gitignore 2025-01-31 23:16:21 +01:00
jango-blockchained
3b2e9640db Refactor Home Assistant server initialization with Express and comprehensive endpoint management
- Added Express server with security middleware
- Implemented dynamic tool registration and API endpoint generation
- Enhanced logging with structured initialization messages
- Created centralized tools tracking for automatic endpoint discovery
- Added explicit Express server startup alongside MCP server
- Improved initialization logging with detailed endpoint information
2025-01-31 23:05:14 +01:00
jango-blockchained
662cb1b2fb Update get_hass function to use proper bootstrap initialization for consistent logging 2025-01-31 22:42:07 +01:00
jango-blockchained
59cbd2552b Add comprehensive Home Assistant WebSocket and API tests
- Created detailed test suite for Home Assistant WebSocket client
- Implemented tests for WebSocket connection, authentication, and error handling
- Added comprehensive test coverage for HassInstanceImpl API methods
- Mocked WebSocket and fetch to simulate various connection scenarios
- Covered authentication, state retrieval, service calls, and environment configuration
- Improved test infrastructure for Home Assistant integration
2025-01-31 20:29:24 +01:00