ai-devkit icon indicating copy to clipboard operation
ai-devkit copied to clipboard

feat(agent-manager): Rex terminal backend for agent discovery and send

Open codeaholicguy opened this issue 2 weeks ago • 0 comments

Summary

Add a Rex TerminalBackend so agents the user started manually inside a Rex pane (not via ai-devkit agent start) can be found, focused, and messaged with ai-devkit agent send/open.

Context

  • packages/agent-manager/src/terminal/types.ts defines TerminalBackend (find(tty), focus, send, sendKey).
  • Existing backends: tmux, wezterm, ghostty, iterm2, terminal-app (terminal/backends/). No Rex backend, so agents running in Rex fall back to the outer terminal app (or nothing).

Proposed approach

  • find: list blocks (rex block ls --json across sessions) and match the agent pid / tty against each block's process result.
  • focus: session.focus_block (+ client session.select when Remote Control is enabled).
  • send: paste + enter; sendKey: rex send-key (map ESC to escape).
  • Add TerminalType.REX; register before the GUI terminal backends so the multiplexer wins over the host app (same as tmux).

Acceptance criteria

  • [ ] terminal/backends/rex.ts registered in TERMINAL_BACKENDS
  • [ ] ai-devkit agent list shows Rex-hosted agents with a Rex location; agent send / agent open work for them
  • [ ] Unit tests in packages/agent-manager/tests/

Related: #459 (shares the Rex CLI client).

codeaholicguy avatar Nov 18 '26 09:11 codeaholicguy