verbose live UI + tool-level SSE events + Groq default + regression tests

This commit is contained in:
2026-06-03 05:04:29 -03:00
parent 131f4d9b86
commit e124a8a7d9
69 changed files with 3030 additions and 137 deletions

37
api/plan/types.py Normal file
View File

@@ -0,0 +1,37 @@
"""Public data shapes for the Plan layer."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
@dataclass
class PlanStep:
analysis: str
args: dict[str, Any] = field(default_factory=dict)
why: str = ""
@classmethod
def from_dict(cls, raw: dict[str, Any]) -> "PlanStep":
return cls(
analysis=raw["analysis"],
args=raw.get("args") or {},
why=raw.get("why", ""),
)
def to_dict(self) -> dict[str, Any]:
return {"analysis": self.analysis, "args": self.args, "why": self.why}
@dataclass
class Plan:
rationale: str
steps: list[PlanStep]
@classmethod
def from_dict(cls, raw: dict[str, Any]) -> "Plan":
return cls(
rationale=raw.get("rationale", ""),
steps=[PlanStep.from_dict(s) for s in raw.get("steps", [])],
)