Build a client
Write a thin client that reads the session catalog, streams conversation events over SSE, and submits idempotent commands.
Build your client as a view and command layer over H's local /api/v1 endpoints. Start with a read-only client that lists sessions from the catalog, renders the latest committed entries in a conversation, and reconnects cleanly across disconnects.
Implement one read-only view
- Start a test daemon against a disposable data directory and run the authenticated catalog query (
GET /api/v1/sessions). Render the returned session titles and status fields as plain text. - When the user picks a session, fetch
GET /api/v1/sessions/:sidto list its conversations, then subscribe toGET /api/v1/sessions/:sid/conversations/:cid/events. Store the selectedsession_id,conversation_id, page window, and reconnect cursor in your client's local state. - Apply
snapshot,commit, andephemeralevents according to the conversation stream rules. When the user switches to another branch, close the old SSE stream first so late frames from the previous branch cannot overwrite the new view.
Test your stream reducer against a recorded fixture containing an initial snapshot, a committed frame, a transient ephemeral progress frame, and a second committed frame. Simulate a disconnect after the ephemeral frame and verify that your client reconnects with Last-Event-ID set to the last committed sequence number. Test both ring-buffer replay and full snapshot replacement, and verify that closing the client window leaves the session running.
Add a write without inference
Implement the submit command with type: "write" using the JSON command envelope. Generate a request_id and keep the normalized payload in memory until the receipt arrives. Simulate a dropped HTTP response and retry with the same request_id and payload: confirm that H deduplicates the retry and commits a single note entry to the transcript stream. Once read streaming and idempotent writes pass, add type: "input" for model turns.
Inspect the Rust TUI transcript reducer for a reference state machine and the HTTP/SSE integration tests for wire examples.