"""Contract every tool implements so the harness/agent can use it uniformly.""" from __future__ import annotations from dataclasses import dataclass, field @dataclass class ToolResult: ok: bool summary: str # short human-readable line for the chat UI data: dict = field(default_factory=dict) class Tool: """A capability/machine plugged into the system. Subclasses set `name`, `description` (what it does + WHEN to use it — the router reads this), and implement `run(task)`. """ name: str = "tool" description: str = "" def run(self, task: str, **ctx) -> ToolResult: raise NotImplementedError def __repr__(self) -> str: return f""