Files
evotraders/backend/agents/__init__.py
cillin 45c3996434 refactor(cleanup): remove legacy agent classes and complete EvoAgent migration
Remove deprecated AnalystAgent, PMAgent, and RiskAgent classes.
All agent creation now goes through UnifiedAgentFactory creating EvoAgent instances.

- Delete backend/agents/analyst.py (169 lines)
- Delete backend/agents/portfolio_manager.py (420 lines)
- Delete backend/agents/risk_manager.py (139 lines)
- Update all imports to use EvoAgent exclusively
- Clean up unused imports across 25 files
- Update tests to work with simplified agent structure

Constraint: EvoAgent is now the single source of truth for all agent roles
Constraint: UnifiedAgentFactory handles runtime agent creation
Rejected: Keep legacy aliases | creates maintenance burden
Confidence: high
Scope-risk: moderate (affects agent instantiation paths)
Directive: All new agent features must be added to EvoAgent, not legacy classes
Not-tested: Kubernetes sandbox executor (marked with TODO)
2026-04-02 10:51:14 +08:00

47 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
"""
Agents package for the EvoAgent-based runtime.
Exports:
- EvoAgent: Core agent with workspace support
- ToolGuardMixin: Tool call approval/denial flow
- CommandHandler: System command handling
- AgentFactory: Design-time agent creation under `workspaces/`
- WorkspaceManager: Alias for the persistent `workspaces/` registry
- WorkspaceRegistry: Explicit design-time `workspaces/` registry
- RunWorkspaceManager: Run-scoped workspace asset manager
- AgentRegistry: Central agent registry
- UnifiedAgentFactory: Runtime agent factory for creating EvoAgent instances
"""
# EvoAgent architecture
from .agent_core import EvoAgent, ToolGuardMixin, CommandHandler
from .factory import AgentFactory, ModelConfig
from .unified_factory import UnifiedAgentFactory, get_agent_factory, clear_factory_cache
from .workspace import WorkspaceManager, WorkspaceRegistry, WorkspaceConfig
from .workspace_manager import RunWorkspaceManager
from .registry import AgentRegistry, AgentInfo, get_registry, reset_registry
__all__ = [
# Core EvoAgent
"EvoAgent",
"ToolGuardMixin",
"CommandHandler",
# Factories
"AgentFactory",
"ModelConfig",
"UnifiedAgentFactory",
"get_agent_factory",
"clear_factory_cache",
# Workspace
"WorkspaceManager",
"WorkspaceRegistry",
"WorkspaceConfig",
"RunWorkspaceManager",
# Registry
"AgentRegistry",
"AgentInfo",
"get_registry",
"reset_registry",
]