Skip to content

feat: remote agent control (v1 up-lane)#6

Merged
guohai merged 2 commits into
mainfrom
feature/remote-agent-control
May 30, 2026
Merged

feat: remote agent control (v1 up-lane)#6
guohai merged 2 commits into
mainfrom
feature/remote-agent-control

Conversation

@guohai

@guohai guohai commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the Astation side of Remote Agent Control v1 per docs/specs/2026-05-28-remote-agent-control-design.md. Astation acts as a remote control that sends text and control keys to the focused Atem's agent over the existing channel (direct or relay). Voice reuses the existing PTT/hands-free path unchanged.

What's new

  • AstationMessage.agentInput(agentId:kind:text:key:) — new message case with encode/decode. Matches the wire contract: atem_id stays in the relay envelope; the payload carries agentId + kind + text/key, with nil fields omitted.
  • HubManager.sendAgentText / sendAgentKey — mirror sendVoiceCommand, route through routeToFocusedAtem() + sendHandler.
  • RemoteControlWindowController — panel with a text field + Send and a key bar (Enter / Esc / Ctrl-C / ↑ / ↓ / y / n). Shows the target Atem; warns when none connected.
  • Menu item "🎮 Remote Agent Control" (⌘R) in the status bar.

Wire contract

{ "atem_id": "<host>", "payload": {
  "type": "agentInput",
  "data": { "agentId": null, "kind": "text"|"key", "text": "...", "key": "enter|esc|ctrl-c|up|down|y|n" }
}}

Not in this PR

  • Atem side (AstationMessage::AgentInput + PTY write) — separate repo; not yet implemented there, so the round-trip acceptance test can't pass until the Atem counterpart lands.
  • agentId selection UI (v1 leaves it nil → Atem targets its focused/only agent).
  • Screen mirroring / down-lane (later phase, mobile).

Test plan

  • swift build succeeds
  • 124 tests pass (was 119)
    • AgentInputMessageTests (5): text/key encode-decode, nil-field omission, round-trip
    • AgentInputRoutingTests (5): routes to connected Atem, correct payload per kind, explicit agentId, drop-when-no-Atem, pinned-client preference
  • End-to-end requires the Atem-side AgentInput handler

Also fixes a stale RTCJoinOptions test that still expected aes256Gcm2 after the encryption default changed to .none.

Generated with SMT smt@agora.build

guohai added 2 commits May 29, 2026 12:21
v1 up-lane remote agent control (Astation → Atem):
- AstationMessage.agentInput(agentId:kind:text:key:) with encode/decode
  matching the wire contract (atem_id stays in the relay envelope; the
  payload carries agentId + kind + text/key, nil fields omitted).
- HubManager.sendAgentText / sendAgentKey mirror sendVoiceCommand,
  routing through routeToFocusedAtem() + sendHandler.
- RemoteControlWindowController: text field + Send and a key bar
  (Enter/Esc/Ctrl-C/↑/↓/y/n). Menu item "🎮 Remote Agent Control".
- Voice reuses the existing PTT/hands-free path (unchanged).

Also fix a stale RTCJoinOptions test that still expected aes256Gcm2
after the encryption default changed to .none.

🤖 Built with SMT <smt@agora.build>
Cover HubManager.sendAgentText / sendAgentKey: routes to the connected
Atem, emits the correct agentInput payload (text vs key), honors an
explicit agentId, drops when no Atem is connected, and prefers the
pinned client. 124 Swift tests pass (was 119).

🤖 Built with SMT <smt@agora.build>
@guohai guohai merged commit c45ff22 into main May 30, 2026
3 checks passed
@guohai guohai deleted the feature/remote-agent-control branch May 30, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant