feat(macos): wire remote-control status + machine registry management#181
Open
andrei-hasna wants to merge 1 commit into
Open
Conversation
The macOS Machines screen was list/pairing-only and never surfaced remote-control availability, trust management, or the remoteDispatch actions the app-server already exposes. Wire the missing client surface: - AppServerAPI: remoteControl/status/read, remoteControl/enable|disable; machineRegistry/read|updateTrust|disable|forget; remoteDispatch/ negotiate|submit — with static camelCase param builders matching the Rust serde defs in app-server-protocol/v2. - BackendModels: RemoteControlStatusInfo, RemoteDispatchNegotiationInfo, RemoteDispatchSubmitInfo, MachineTrustState; MachineInfo.trustState. Submit status is kept verbatim so the camelCase `dryRun` value survives. - AppModel: remoteControlStatus state + loadRemoteControlStatus() (run from refreshAll and the Machines settings tab); setRemoteControlEnabled, updateMachineTrust/disableMachine/forgetMachine; and a remoteControl/status/changed notification handler that refreshes status and the fleet. All new paths degrade gracefully on older servers via the existing isUnsupportedMethodError handling. - MachinesView: remote-control availability/status banner with an enable/disable toggle, plus a per-machine context menu for trust / disable / forget (omitted for the local machine). Remote control is enabled at runtime through remoteControl/enable rather than a spawn-time `--remote-control` flag: the app-server always stands up its remote-control handle for stdio, and passing the hidden flag would both hard-crash older bundled builds (clap rejects unknown args at launch, killing the whole JSON-RPC connection) and force remote control on with no user opt-in. Adds BackendTests param-builder/decoder coverage for the new surface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The macOS Machines screen was list/pairing-only and never surfaced remote-control availability/status, machine trust management, or the
remoteDispatchactions the app-server already exposes. This wires the missing client surface end-to-end.App-server API (
Backend/AppServerAPI.swift)remoteControl/status/read,remoteControl/enable,remoteControl/disablemachineRegistry/read,machineRegistry/updateTrust,machineRegistry/disable,machineRegistry/forgetremoteDispatch/negotiate,remoteDispatch/submitapp-server-protocol/src/protocol/v2/{remote_control,machine_registry,remote_dispatch}.rsand the method-name registrations incommon.rs.Models (
Backend/BackendModels.swift)RemoteControlStatusInfo,RemoteDispatchNegotiationInfo,RemoteDispatchSubmitInfo,MachineTrustStateMachineInfo.trustStatedryRunvalue survives (not lowercased).App model (
App/AppModel.swift)remoteControlStatusstate +loadRemoteControlStatus()(run fromrefreshAlland the Machines settings tab)setRemoteControlEnabled,updateMachineTrust,disableMachine,forgetMachineremoteControl/status/changednotification handler that applies the new status and refreshes the fleetisUnsupportedMethodErrorhandling.UI (
Screens/MachinesView.swift)Design note: no spawn-time
--remote-controlflagRemote control is enabled at runtime via
remoteControl/enablerather than the hidden--remote-controlspawn flag. The app-server always stands up its remote-control handle for the stdio transport (and the websocket task lazily derives its target from the URL when enabled flips true), so the flag is unnecessary. Passing it would (1) hard-crash older bundled/installed builds — clap rejects unknown args at launch, killing the whole JSON-RPC connection, not just remote control — and (2) force remote control on at every launch with no user opt-in (server-side enable/disable is in-memory only).Testing
BackendTestscoverage for the new param builders and decoders (exact camelCase keys, trust-state raw values,dryRunstatus preservation).swift build/swift testcould not be run here; validation was static cross-checking of every method string and field name against the Rust protocol source, plus the added XCTest coverage for macOS CI/reviewers.🤖 Generated with Claude Code