Files
t3code/packages/client-runtime
Theo BrowneandClaude Fable 5 63e07db893 Add PR monitoring: server-driven babysit mode for agent threads
Threads can now formally monitor a PR after creating it. The agent calls a
new monitor_start MCP tool; a dedicated PullRequestMonitor service polls
GitHub every 30s, diffs review comments / reviews / check runs against a
per-thread cursor, and wakes the thread with a self-contained prompt when
there is something to address. The server — never the agent — declares the
PR ready from head-SHA-anchored GitHub state.

- GitHub monitor snapshot fetch (reviews, threads, check runs, mergeability)
  with pure cursor-diff and readiness modules
- thread.monitor.start/update/end domain events through decider/projector,
  monitor state on the thread shell, migration 034 (monitor_json)
- Wake dispatch protocol: claim → fresh terminal revalidation at the send
  boundary → dispatch → cursor ack only after accepted start; user turns
  always win and rewind in-flight wake cursors so events re-diff; 10-wake
  circuit breaker ends as needs-attention
- Monitoring holds the thread unsettled; user settle ends the monitor;
  session teardown ends it as session-ended
- UI: steady cyan Monitoring pill (never masks approval/input/failed),
  blockers sub-line, header MonitorStrip with Stop, emerald Ready-to-merge
  state with confirm dialog; clients can only end a monitor as "stopped"

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 19:39:42 -07:00
..

Client Runtime

Shared client behavior for web and mobile. Public APIs are organized by package subpath. The package intentionally has no root export.

Public subpaths

Subpath Responsibility
authorization Bearer and DPoP authorization plus token persistence contracts
connection Targets, catalog, supervision, retries, registry, and onboarding
environment Environment identity, descriptors, endpoints, and scoped keys
errors Shared client error inspection
operations Multi-step application workflows
operations/projects Multi-step project creation workflows
platform Platform capability and persistence service contracts
relay Managed relay API and environment discovery
rpc HTTP/RPC clients, protocol, sessions, and subscriptions
state/<domain> Focused shared state, retention, reducers, and Atom constructors

Dependency direction

Platform applications provide platform services. connection composes those capabilities with authorization, relay, and rpc to supervise environment sessions. Independent state modules consume the connection registry and expose focused state or Atom constructors to application-owned runtimes.

Applications should import the narrowest relevant subpath. There is no broad state export: use domain paths such as state/shell, state/threads, state/terminal, or state/vcs. Subpath indices and explicitly exported domain files are public API boundaries; all other files remain implementation details.