diff --git a/pyproject.toml b/pyproject.toml index 4193f85..cf5fd88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "ratatoskr" -version = "0.14.0" +version = "0.14.1" description = "Worldtree Conversation API debug TUI — multi-pane observability dashboard" readme = "README.md" requires-python = ">=3.12" diff --git a/src/ratatoskr/cli.py b/src/ratatoskr/cli.py index 592d88b..e0b6bee 100644 --- a/src/ratatoskr/cli.py +++ b/src/ratatoskr/cli.py @@ -18,6 +18,8 @@ import httpx from ratatoskr.sessions import AgentNotFound, SessionApiFailed, create_session from ratatoskr.sse_client import ( + AffectUpdate, + AwaitingLlmFirstToken, CancelAlreadyCompleted, CancelFailed, Cancelled, @@ -205,6 +207,7 @@ class CliPresenterState: ( WorkerPhase, Thinking, Text, TextBoundary, ToolStart, ToolResult, Done, Error, Cancelled, + AffectUpdate, AwaitingLlmFirstToken, ), ) # Thinking events accumulate into the open run. @@ -275,6 +278,28 @@ class CliPresenterState: f". text_boundary: kind={event.kind} char_offset={event.char_offset}\n" ) return + if isinstance(event, AffectUpdate): + # Worldtree #204 / v0.28.0. CLI surface is debug telemetry — + # one line to stderr with status + (for current) dominant_emotion. + if event.snapshot is not None: + dom = event.snapshot.get("dominant_emotion") + stderr.write( + f". affect_update: status={event.status} turn_id={event.turn_id} " + f"dominant_emotion={dom!r}\n" + ) + else: + stderr.write( + f". affect_update: status={event.status} turn_id={event.turn_id}\n" + ) + return + if isinstance(event, AwaitingLlmFirstToken): + # Worldtree #201 / v0.29.0. Heartbeat during BuildingPrompt → + # CallingLLM gap. Stderr surface, one line per heartbeat. + secs = event.elapsed_ms_since_building_prompt / 1000.0 + stderr.write( + f". awaiting_llm_first_token: turn_id={event.turn_id} elapsed={secs:.1f}s\n" + ) + return async def _cancel_and_log( diff --git a/uv.lock b/uv.lock index 1cf9d32..365f074 100644 --- a/uv.lock +++ b/uv.lock @@ -968,7 +968,7 @@ wheels = [ [[package]] name = "ratatoskr" -version = "0.14.0" +version = "0.14.1" source = { editable = "." } dependencies = [ { name = "httpx" },