Files
evotraders/backend/process/models.py
cillin 59b44545d0 feat: Add agent workspace system and runtime management
- Add agent core modules (agent_core, factory, registry, skill_loader)
- Add runtime system for agent execution management
- Add REST API for agents, workspaces, and runtime control
- Add process supervisor for agent lifecycle management
- Add workspace template system with agent profiles
- Add frontend RuntimeView and runtime API integration
- Add per-agent skill workspaces for smoke_fullstack run
- Refactor skill system with active/installed separation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 16:43:29 +08:00

42 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
"""Data models for lightweight process supervision."""
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import Any, Dict
class ProcessRunState(str, Enum):
"""Execution state for supervised runs."""
PENDING = "pending"
RUNNING = "running"
COMPLETED = "completed"
FAILED = "failed"
CANCELLED = "cancelled"
@dataclass
class ProcessRun:
"""Represents a supervised process run."""
run_id: str
command: str
scope_key: str
state: ProcessRunState = ProcessRunState.PENDING
metadata: Dict[str, Any] = field(default_factory=dict)
created_at: datetime = field(default_factory=datetime.utcnow)
updated_at: datetime = field(default_factory=datetime.utcnow)
def to_dict(self) -> Dict[str, Any]:
return {
"run_id": self.run_id,
"command": self.command,
"scope_key": self.scope_key,
"state": self.state.value,
"metadata": self.metadata,
"created_at": self.created_at.isoformat(),
"updated_at": self.updated_at.isoformat(),
}