acpmux protocol: type attach, events, detach, view, markUnread, watch and _acpmux/event
Summary
No capture: no visible UI change; the pane only swaps untyped requests for typed ones over generated protocol types.
This is PR2 of the typed acpmux protocol. PR1 was #20576.
New typed methods. The Rust registry now types the session-log methods and their notification. The types live in protocol/events.rs:
| Method | Params | Result |
|---|---|---|
_acpmux/attach | AttachParams | AttachResult, with SessionDetail (the summary plus modes, config options, models, agent info and capabilities, usage, rules and pending permissions) |
_acpmux/events | EventsParams | EventsResult |
_acpmux/detach, _acpmux/markUnread | SessionRef | Done |
_acpmux/view | ViewParams | Done |
_acpmux/watch | WatchParams | SessionsResult |
_acpmux/event (notification) | SessionEvent | n/a |
One definition of the event shape. server::event_value now builds its record from SessionEvent, so the wire shape and the schema can't drift apart. The keys are unchanged: sessionId, seq, at, dir, kind, msg.
Paging correction. Since PR1 landed, _acpmux/sessions and _acpmux/watch page with limit and cursor and return nextCursor. SessionsParams and SessionsResult now describe that. PR1 had SessionsParams closed to {}.
Registry completeness. Base now serves _acpmux/harness/update and _acpmux/sessions/restart_harness, so both are registered as untyped requests. The completeness test caught them.
Web client.
- The pane sends these methods through a typed
typed()helper. - Its
EventRecordderives from the generatedSessionEvent. Onlymsgstays loose, and the cast for it lives in a singlerecords()helper. - There are no behavior changes.
Verification
All results are from the Linux builder, at feat-cmux-next 82e0e8c26258 plus this change.
Rust:
cargo test -p acpmux --lib protocol: 3 pass. That covers the IR being current, unique names and every served method being named.cargo clippy -p acpmux --all-targets -D warningsis clean.crash_ratchet.py: ok.cargo test -p acpmux --no-fail-fast: every suite passes except 5harness_healthtests. Those fail the same way on an unmodified base checkout on the builder.
Web:
- Typecheck and lint have no warnings or errors.
acpmux-codegen.test.ts: 4 pass.- The drift check is current.
bun run checkfails only atcheck:browser-lanes. That is a base red that also fails other feat PRs, and this PR does not touch it.
Changelog
none
š¤ Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Types the session-log methods _acpmux/attach, _acpmux/events, _acpmux/detach, _acpmux/view, _acpmux/markUnread, _acpmux/watch and the _acpmux/event notification in the acpmux registry (protocol/events.rs), replacing the prior untyped entries. No visible UI change; the pane only swaps untyped requests for typed ones over generated protocol types.
AttachResultcarries aSessionDetailthat flattens the currentSessionSummary, keeping the IR current with base's summary fields after the latest merges (includingbackgroundsWork).server::event_valuebuilds its record fromSessionEvent, so the wire shape and the schema share one source.- The web client sends these methods through a typed helper, and its
EventRecordderives from the generatedSessionEventvia one cast, with no behavior changes. - The
_acpmux/sessionspaging correction and theharness/updateandsessions/restart_harnessregistrations landed in base (#21807), so this PR drops its copies. - A merge dropped the registry line a local hook added for
test_media_auto_tour.py, which base leaves unregistered.