Skip to main content

Module connections

Module connections 

Source
Expand description

The connection RPCs the frontend’s connection UI already calls (conntypeahead.tsx, blockframe.tsx’s ConnStatusOverlay), which had no handler until now (P0 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md).

A connection AgentMux cannot run is refused with a status the pane shows, instead of the pane silently starting a local shell under a remote name: WSL off Windows or for a distro that is not installed (P1), and SSH where there is no ssh (P2).

Structs§

AskpassRequest 🔒
POST /api/v1/askpass body, from agentmux-bashwrap as ssh’s askpass.
ConnEntry 🔒
One row of the agent ConnList tool.
UserAnswer 🔒
The user’s answer to ask_user. answered is false when the window was closed, timed out, or could not be opened.

Enums§

AgentTarget 🔒
Where an agent’s Shell or PtyShell runs.

Constants§

DIALOG_TIMEOUT_MS 🔒
How long the user has to answer a consent or askpass dialog.
NOT_SSH 🔒
SSH_WITH_PROMPTS 🔒
How long an ssh run whose prompts go to the approval window may take: the dialog’s own wait, and some to spare.

Functions§

add_remote 🔒
Add a host to the user’s ssh config (§4.4 of SPEC_REMOTES_PANE_2026_10_05.md), once they confirm the exact block in the window of pane cmd.blockid.
agent_label 🔒
How a dialog names an agent: its id, as one plain capped line.
ask_user 🔒
Ask the user a question about the agent in agent_block_id, in an approval subwindow the host opens over the window showing it (crates/cef ssh_approval), and wait for the answer.
confirm_session_end 🔒
The user’s yes to ending session id on conn, asked in the window of pane block. Err unless they said yes.
connect 🔒
What connconnect does (a Remotes row’s Connect, a pane’s Reconnect): log in to an SSH host; for anything else, what connensure does.
consent_for_ssh 🔒
The user’s consent for the agent agent_id (verified, verified_agent) in agent_block_id to run what on the SSH connection with the user’s identity (spec §8.2). connection is the canonical name (ConnTarget::name), so one host is one consent however it is spelled. “Always” for that agent and host is remembered (remote::agent_access) and asks nothing again; otherwise the user is asked (ask_user).
ensure 🔒
What connensure does: accept local; accept a WSL distro that is installed (Windows only), which is then connected; accept an SSH destination where the system ssh is, claiming nothing (only a login connects it: a pane’s ssh, or connconnect); refuse a bad name with the reason, recorded as the status the pane’s overlay shows.
ensure_with 🔒
ensure with the installed distros, the platform and whether ssh was found given, so it is testable anywhere.
for_agent 🔒
The connection an agent’s Shell or PtyShell call asked for, checked the same way a pane’s is (ensure), Err with the reason when it cannot run.
handle_askpass 🔒
POST /api/v1/askpass: show an ssh prompt to the user (ask_user) and return the answer (remote::askpass). Only a live secret is answered, and the secret, not anything in the request, says which agent and host the question names.
handle_conn_list 🔒
GET /api/v1/conn/list: the agent ConnList tool (spec §8.1).
host_to_ask_user 🔒
The host that can put a question to the user and relay their answer. Only the host can: agents hold the key srv’s own routes take (see ask_user). With none connected (headless) there is no one to ask, and whatever needs the answer must not happen, nor wait for one.
install_helper_consent
Give the helper install its question (SPEC_REMOTES_PANE_2026_10_05.md §4.9): the approval window, and conn:helper from the settings.
known_ssh_host 🔒
ssh_host for a host AgentMux already lists (the user’s ssh config, settings, or a connection they made), for what logs in with the user’s keys: never to one an RPC names, since anything holding srv’s key can send one, an agent included.
list 🔒
The connections there are: this machine, each installed WSL distro, the user’s ssh config hosts, and any other connection a pane has used this session, with its status and whether an agent can use it.
log_in 🔒
Log in to SSH host name (a known_ssh_host) and run true, with ssh’s prompts going to the user in the window of pane block, if any. The connection’s status follows (link::login), and the connection stays up a while after (ControlPersist), so the next pane on it asks nothing.
one_line 🔒
One line of agent-supplied text for a dialog: shown as plain text, newlines folded and length capped, so it cannot lay out a message of its own.
register
remote_name 🔒
A connection the Remotes commands may act on: a WSL distribution or an SSH destination, never local or something ConnTarget refuses.
remote_names 🔒
The picker’s remote names: the ssh config hosts, then any other SSH connection known this session, each once.
remove_helper 🔒
Remove AgentMux’s helper from SSH host connection (Remotes, §4.9 of SPEC_REMOTES_PANE_2026_10_05.md), once the user confirms in the window of pane block, naming the sessions that will end.
ssh_host 🔒
connection’s canonical name if it is an SSH host; otherwise “ otherwise”.
str_field 🔒
test_remote 🔒
Log in to connection and run true (§4.4): success, or ssh’s message.
verified_agent 🔒
The agent an SSH request comes from, proven: its signed identity (UiAutomationAuth, made with its own jekt key, which no other agent holds) verified, and the pane derived from it, never taken from the request. Err unless that pane is agent_block_id: every agent holds srv’s auth key, so a request body alone could name another agent’s pane and borrow its “Always allow”.