Add Day 1 agent runtime foundations with task and event schemas, verifier support, capability metadata, graph event tracing, and regression coverage while preserving the direct execution path.
29 lines
766 B
Python
29 lines
766 B
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime, timezone
|
|
from typing import Any, Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
AgentEventType = Literal[
|
|
"agent.tool.start",
|
|
"agent.tool.result",
|
|
"agent.verify.started",
|
|
"agent.verify.completed",
|
|
"agent.error",
|
|
]
|
|
AgentEventSeverity = Literal["info", "warning", "error"]
|
|
|
|
|
|
class AgentEvent(BaseModel):
|
|
event_id: str
|
|
event_type: AgentEventType
|
|
timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
|
conversation_id: str | None = None
|
|
agent_id: str | None = None
|
|
sub_commander_id: str | None = None
|
|
task_id: str | None = None
|
|
payload: dict[str, Any] = Field(default_factory=dict)
|
|
severity: AgentEventSeverity = "info"
|