feat: add MCP run status query tools

This commit is contained in:
root
2026-04-07 11:17:05 +08:00
parent 7563aa8fea
commit d9173fbe0f
5 changed files with 499 additions and 3 deletions
+5
View File
@@ -39,6 +39,11 @@ class RunStore:
)
return cls(path=path, state=state, repo_root=repo_root)
@classmethod
def load(cls, *, path: Path, repo_root: Path | None = None) -> "RunStore":
state = RunState.model_validate(json.loads(path.read_text(encoding="utf-8-sig")))
return cls(path=path, state=state, repo_root=repo_root)
def save(self) -> None:
self.state.updated_at = datetime.now(tz=self.state.started_at.tzinfo)
self.path.parent.mkdir(parents=True, exist_ok=True)