Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/archastro/phx_channel/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ async def register_scenario(self, scenario: dict[str, Any]) -> None:
if r.status_code != 201:
raise HarnessServiceError(f"register_scenario failed: {r.status_code} {r.text}")

async def register_stream_scenario(self, scenario: dict[str, Any]) -> None:
"""Register a scenario for an SSE streaming route (``"METHOD /path"``).

See the TS ``StreamScenarioRequest`` / ``StreamAction`` types for the
JSON shape — the server validates and returns 400 on invalid bodies.
"""
r = await self._http.post(f"{self.control_url}/stream-scenarios", json=scenario)
if r.status_code != 201:
raise HarnessServiceError(f"register_stream_scenario failed: {r.status_code} {r.text}")

async def observations(
self, topic: str | None = None, event: str | None = None
) -> list[dict[str, Any]]:
Expand Down
Loading