refactor(replay-port): own the replay backend contract in contracts
Ā
TH
1h ago+444+444+012345678901234567890123456789-348-348-012345678901234567890123456789
Summary
First half of the #3377 replay-backend prep, split from the original PR to stay under the diff budget. Behavior, wire shapes and help text are unchanged; the adapter stays in replay-port. Layer 2 (stacked on this) moves it into the Maestro package as a create(host) plugin.
- New
@agent-device/contracts/replay-backend: the replay session and command types (moved from replay-portcommand-types), the backend capability type, the failure descriptor, and the key-lockedReplayBackendDispatchOptions(aPickofReplayDispatchOptions, includingkillAppfrom #2749). ReplayCommandis derived fromReplayBackendCommand, so the shared fields have one definition; importers were repointed.- The divergence-failure response moved out of the Maestro failure module into
replay-backend-failure.tsin replay-port; the Maestro failure module builds the descriptor and calls it. Existing daemon failure tests cover it unchanged. - The engine's
MaestroDaemonDispatchOptionsaliases the contracts type, so the dependency points from the engine to core.
The contracts module is the only place the plugin contract can live: a type import of replay-port from maestro would be a circular tsc -b project reference.
30 files touched. Refs #3377.
Validation
Tested SHA: e59514f4ec.
pnpm check:affected --run: all runnable checks passed.pnpm check:quickand focused vitest (replay-port, maestro, daemon sessions, contracts, CLI, closure budgets) passed.- Diff: +444/ā348 against origin/main.
- Coverage and provider integration are CI-authoritative.
š¤ Generated with Claude Code