Split 1161-line monolith into agent/ package: auth, llm, types, process, runtime, api, and nodes/ (base, sensor, input, output, thinker, memorizer). No logic changes — pure structural split. uvicorn agent:app entrypoint unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
30 lines
649 B
Python
30 lines
649 B
Python
"""Message types flowing between nodes."""
|
|
|
|
from dataclasses import dataclass, field
|
|
|
|
|
|
@dataclass
|
|
class Envelope:
|
|
"""What flows between nodes."""
|
|
text: str
|
|
user_id: str = "anon"
|
|
session_id: str = ""
|
|
timestamp: str = ""
|
|
|
|
|
|
@dataclass
|
|
class Command:
|
|
"""Input node's perception — describes what was heard."""
|
|
instruction: str
|
|
source_text: str
|
|
metadata: dict = field(default_factory=dict)
|
|
|
|
|
|
@dataclass
|
|
class ThoughtResult:
|
|
"""Thinker node's output — either a direct answer or tool results."""
|
|
response: str
|
|
tool_used: str = ""
|
|
tool_output: str = ""
|
|
controls: list = field(default_factory=list)
|