mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-01 09:49:03 +08:00
BREAKING CHANGE: Major refactoring of agents service structure - Split monolithic db.ts into focused query modules (agent, session, sessionLog) - Implement comprehensive migration system with transaction support - Reorganize services into dedicated services/ subdirectory - Add production-ready schema versioning with rollback capability ### New Architecture: - database/migrations/: Version-controlled schema evolution - database/queries/: Entity-specific CRUD operations - database/schema/: Table and index definitions - services/: Business logic layer (AgentService, SessionService, SessionLogService) ### Key Features: - ✅ Migration system with atomic transactions and checksums - ✅ Modular query organization by entity type - ✅ Backward compatibility maintained for existing code - ✅ Production-ready rollback support - ✅ Comprehensive validation and testing ### Benefits: - Single responsibility: Each file handles one specific concern - Better maintainability: Easy to locate and modify entity-specific code - Team-friendly: Reduced merge conflicts with smaller focused files - Scalable: Simple to add new entities without cluttering existing code - Production-ready: Safe schema evolution with migration tracking All existing functionality preserved. Comprehensive testing completed (1420 tests pass).
30 lines
964 B
TypeScript
30 lines
964 B
TypeScript
/**
|
|
* Agents Service Module
|
|
*
|
|
* This module provides a complete autonomous agent management system with:
|
|
* - Agent lifecycle management (CRUD operations)
|
|
* - Session handling with conversation history
|
|
* - Comprehensive logging and audit trails
|
|
* - Database operations with migration support
|
|
* - RESTful API endpoints for external integration
|
|
*/
|
|
|
|
// === Core Services ===
|
|
// Main service classes and singleton instances
|
|
export * from './services'
|
|
|
|
// === Base Infrastructure ===
|
|
// Shared database utilities and base service class
|
|
export { BaseService } from './BaseService'
|
|
|
|
// === Database Layer ===
|
|
// New modular database structure (recommended for new code)
|
|
export * as Database from './database'
|
|
|
|
// === Legacy Compatibility ===
|
|
// Backward compatibility layer - use Database exports for new code
|
|
export { AgentQueries_Legacy as AgentQueries } from './database'
|
|
|
|
// === Type Re-exports ===
|
|
// Main service types are available through service exports
|