ai-devkit
ai-devkit copied to clipboard
feat(agent-manager): Rex agent runtime provider
Summary
Add Rex as an InteractiveAgentRuntime provider so ai-devkit agent start/send/wait/kill/console work natively in Rex. This is the foundation for #460, #462, #463.
Context
packages/agent-manager/src/runtime/types.tsdefinesInteractiveAgentRuntime; tmux and herdr implement it today.runtime/herdr/HerdrAgentRuntime.ts(+HerdrCliClient,HerdrRuntimeRef, response parsers) is the closest template, including the optionalwait/readOutput.utils/AgentRegistry.ts:AGENT_RUNTIME_PROVIDERS = ["tmux", "herdr"].
Proposed mapping
| Runtime method | Rex |
|---|---|
isAvailable |
rex version / rex whoami --json; insideRuntime from REX_SESSION, currentPaneId from REX_BLOCK |
startAgent |
rex run (new tab) or rex split -b $REX_BLOCK with --label <name> -c <cwd> --focus=false --json -- <cmd>; pid from rex block call -b <block> process |
send |
paste via block.event (bracketed paste) then rex send-key enter |
focus |
session.focus_block; optionally rex -C <client> do session.select (needs Remote Control) |
stop |
rex block close <block> |
readOutput |
rex capture -b <block> --trim --unwrap |
wait |
rex wait / program_status (see status issue) |
Runtime ref: { sessionId, windowId?, blockId, server? }.
Acceptance criteria
- [ ]
RexAgentRuntime+RexCliClient+RexRuntimeRefunderruntime/rex/, wired intoRuntimeFactoryandAGENT_RUNTIME_PROVIDERS - [ ]
agent start --runtime rex(or equivalent config) starts an agent in a labelled Rex pane, and list/send/open/kill work against it - [ ] Clear errors for
binary-missing/backend-unreachable - [ ] Unit tests in
packages/agent-manager/tests/with an injected command runner (no real Rex required)
Notes / risks
- Rex is preview (
0.1.0-preview.20, API revision 16); checkserver.versionand fail clearly on an unsupported revision. rex resize/rex block neware not implemented in the CLI yet; userex api callwhere needed.- Panes started with
--keep-openstay visible after exit;stopmust close the block.