63 Commits

Author SHA1 Message Date
jango-blockchained
8f8e3bd85e refactor: improve device control and listing tool error handling and filtering
- Enhance error handling in control tool with more specific domain validation
- Modify list devices tool to use direct filtering instead of manual iteration
- Add more descriptive success messages for different device domains and services
- Simplify device state filtering logic in list devices tool
2025-02-05 09:37:20 +01:00
jango-blockchained
c42f981f55 feat: enhance intent classification with advanced confidence scoring and keyword matching
- Improve intent confidence calculation with more nuanced scoring
- Add comprehensive keyword and pattern matching for better intent detection
- Refactor confidence calculation to handle various input scenarios
- Implement more aggressive boosting for specific action keywords
- Adjust parameter extraction logic for more robust intent parsing
2025-02-05 09:26:02 +01:00
jango-blockchained
4e9ebbbc2c refactor: update TypeScript configuration and test utilities for improved type safety
- Modify tsconfig.json to relax strict type checking for gradual migration
- Update test files to use more flexible type checking and mocking
- Add type-safe mock and test utility functions
- Improve error handling and type inference in test suites
- Export Tool interface and tools list for better testing support
2025-02-05 09:16:21 +01:00
jango-blockchained
eefbf790c3 test: migrate test suite from Jest to Bun test framework
- Convert test files to use Bun's test framework and mocking utilities
- Update import statements and test syntax
- Add comprehensive test utilities and mock implementations
- Create test migration guide documentation
- Implement helper functions for consistent test setup and teardown
- Add type definitions for improved type safety in tests
2025-02-05 04:41:13 +01:00
jango-blockchained
e1db799b1d chore(dependencies): update Bun lockfile and package configuration
- Update bun.lock with latest package versions
- Modify Dockerfile to improve dependency installation
- Remove preinstall script from package.json
- Add winston logging dependencies
- Adjust Docker build process for cleaner dependency management
2025-02-04 21:42:50 +01:00
jango-blockchained
3a6f79c9a8 feat(speech): enhance speech configuration and example integration
- Add comprehensive speech configuration in .env.example and app config
- Update Docker speech Dockerfile for more flexible model handling
- Create detailed README for speech-to-text examples
- Implement example script demonstrating speech features
- Improve speech service initialization and configuration management
2025-02-04 19:35:50 +01:00
jango-blockchained
60f18f8e71 feat(speech): add speech-to-text and wake word detection modules
- Implement SpeechToText class with Docker-based transcription capabilities
- Add wake word detection using OpenWakeWord and fast-whisper models
- Create Dockerfile for speech processing container
- Develop comprehensive test suite for speech recognition functionality
- Include audio processing and event-driven transcription features
2025-02-04 19:08:01 +01:00
jango-blockchained
08e408d68d test: enhance security module with comprehensive token validation and rate limiting tests
- Expanded TokenManager test suite with advanced token encryption and decryption scenarios
- Added detailed rate limiting tests with IP-based tracking and window-based expiration
- Improved test coverage for token validation, tampering detection, and error handling
- Implemented mock configurations for faster test execution
- Enhanced security test scenarios with unique IP addresses and edge case handling
2025-02-04 04:09:40 +01:00
jango-blockchained
790a37e49f refactor: migrate to Elysia and enhance security middleware
- Replaced Express with Elysia for improved performance and type safety
- Integrated Elysia middleware for rate limiting, security headers, and request validation
- Refactored security utilities to work with Elysia's context and request handling
- Updated token management and validation logic
- Added comprehensive security headers and input sanitization
- Simplified server initialization and error handling
- Updated documentation with new setup and configuration details
2025-02-04 03:09:35 +01:00
jango-blockchained
bc1dc8278a refactor: optimize configuration and tool implementations
- Standardized error handling across tool implementations
- Improved return type consistency for tool execution results
- Simplified configuration parsing and type definitions
- Enhanced type safety for various configuration schemas
- Cleaned up and normalized tool response structures
- Updated SSE and event subscription tool implementations
2025-02-04 00:56:45 +01:00
jango-blockchained
9a02bdaf11 feat: add Bun polyfills and refactor LiteMCP implementation
- Introduced polyfills for Node.js compatibility in Bun runtime
- Moved LiteMCP implementation to a dedicated module
- Updated package.json to include @digital-alchemy/hass dependency
- Refactored import for LiteMCP to use local module path
2025-02-03 22:55:36 +01:00
jango-blockchained
04123a5740 test: enhance security middleware and token validation tests
- Refactored security middleware tests with improved type safety and mock configurations
- Updated token validation tests with more precise token generation and expiration scenarios
- Improved input sanitization and request validation test coverage
- Added comprehensive test cases for error handling and security header configurations
- Enhanced test setup with better environment and secret management
2025-02-03 22:52:18 +01:00
jango-blockchained
481dc5b1a8 chore: add Bun types and update TypeScript configuration for Bun runtime
- Added `bun-types` to package.json dev dependencies
- Updated tsconfig.json to include Bun types and test directory
- Updated README.md with correct author attribution
- Enhanced test configurations to support Bun testing environment
2025-02-03 22:41:22 +01:00
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
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
cf7fb2422e Migrate from BUN_ENV to NODE_ENV and update Home Assistant implementation 2025-02-03 19:18:52 +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
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
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
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
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
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
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
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
96aaffd952 Update project configuration and testing infrastructure
- Refactored Jest configuration for improved ESM and TypeScript support
- Updated `jest.setup.ts` with comprehensive test environment configuration
- Enhanced mocking for WebSocket, console, and external dependencies
- Adjusted package.json dependencies and scripts
- Updated tsconfig.json with decorator and test exclusion settings
- Improved test coverage configuration and reporting
- Simplified test file structure and mocking strategies
2025-01-30 20:06:40 +01:00
jango-blockchained
64e619252c Add Server-Sent Events (SSE) support for Home Assistant integration
- Implemented comprehensive SSE manager with advanced client management
- Added dynamic event subscription and broadcasting capabilities
- Created robust rate limiting and client connection tracking
- Enhanced Home Assistant event handling with new SSE endpoints
- Updated package.json with UUID dependency for client identification
- Expanded test coverage for SSE and WebSocket event handling
- Improved type definitions for Home Assistant events and entities
2025-01-30 11:42:19 +01:00
jango-blockchained
43cd320a92 Refactor Home Assistant WebSocket client and configuration management
- Completely rewrote HassWebSocketClient with enhanced event handling and connection management
- Added environment-specific configuration support for Home Assistant connection
- Implemented robust WebSocket connection, authentication, and event subscription methods
- Created more flexible HassInstance interface with improved type definitions
- Added support for dynamic environment configuration and error handling
2025-01-30 11:03:13 +01:00
jango-blockchained
8152313f52 Refactor Home Assistant API and schema validation
- Completely rewrote HassInstance class with fetch-based API methods
- Updated Home Assistant schemas to be more precise and flexible
- Removed deprecated test environment configuration file
- Enhanced WebSocket client implementation
- Improved test coverage for Home Assistant API and schema validation
- Simplified type definitions and error handling
2025-01-30 10:51:25 +01:00
jango-blockchained
732a727d27 Add comprehensive Home Assistant schema validation tests
- Created detailed test suite for Home Assistant schema validation
- Implemented schemas for entities, services, events, configurations, automations, and device controls
- Added robust validation for complex Home Assistant data structures
- Enhanced type safety and validation for Home Assistant-related interfaces
- Expanded schema definitions to support multiple use cases and edge scenarios
2025-01-30 10:42:39 +01:00
jango-blockchained
c64dc4334b Add AI NLP and router modules for advanced natural language processing
- Introduced comprehensive NLP processing modules for intent classification, entity extraction, and context analysis
- Created AI router with rate-limited endpoints for command interpretation and execution
- Added prompt templates for different AI models with configurable system and user prompts
- Implemented robust type definitions for AI-related interfaces and schemas
- Enhanced security and error handling in AI processing pipeline
2025-01-30 10:05:57 +01:00
jango-blockchained
b3fa5f729e Enhance test infrastructure and add comprehensive WebSocket and security mocking
- Updated test suite with more robust mocking for WebSocket and security modules
- Expanded test coverage for performance monitoring and optimization utilities
- Added detailed type definitions for WebSocket and test response interfaces
- Improved error handling and type safety in test scenarios
- Updated package dependencies to include WebSocket and security-related libraries
2025-01-30 09:43:19 +01:00
jango-blockchained
f5f756f71e Simplify security middleware configuration
- Replaced detailed Helmet configuration with default settings
- Added rate limiting middleware with standard configuration
- Streamlined security middleware chain for improved readability and maintainability
2025-01-30 09:27:35 +01:00
jango-blockchained
585b8d1f91 Enhance security middleware and package dependencies
- Updated security headers configuration with stricter settings
- Modified rate limiting and helmet middleware setup
- Added TypeScript type definitions for Express, rate-limit, and Helmet
- Refined referrer policy and HSTS configuration
- Improved security middleware chain for better protection
2025-01-30 09:27:22 +01:00
jango-blockchained
110f2a308c Add comprehensive WebSocket, context, performance, and security modules
- Introduced WebSocket client for real-time Home Assistant event streaming
- Created context management system for tracking resource relationships and state
- Implemented performance monitoring and optimization utilities
- Added security middleware with token validation, rate limiting, and input sanitization
- Extended tool registry with enhanced tool registration and execution capabilities
- Expanded test coverage for new modules and added comprehensive test scenarios
- Improved type safety and added robust error handling across new modules
2025-01-30 09:18:17 +01:00