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 pane cmd.blockid.
agent_label 🔒
How a dialog names an agent: its id, as one plain capped line.
ask_in_pane 🔒
Ask the person question, the confirmation of their own click in pane block_id, as a modal over that pane (sagas::pane_confirm). With no pane named there is nowhere of its own to ask it, so it goes to the approval window (ask_user) as before. Either way an agent calling the command can’t give the answer.
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 pane block. Err unless they said yes.
conn_disconnect 🔒
conndisconnect; data is the connection name, as a bare string.
conn_list 🔒
The picker’s “Remote” section: the user’s ssh config hosts and any other SSH connection used this session. The typeahead adds local and the WSL distros itself.
conn_session_end 🔒
connsessionend: ends one durable session, after the user says yes in the asking pane’s window.
conn_sessions 🔒
A host’s durable sessions, for Connectors → Remotes’ “Sessions…” (spec §7.6). Listing runs one fixed, read-only command over ssh, as the UI’s other connection calls do. Ending one is the user’s decision, made in the host’s own window (ask_user): anything holding srv’s auth key can send this RPC, an agent included, but none can answer that window.
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 🔒
Tell the user that the agent agent_id (verified, verified_agent) in agent_block_id wants to run what on the SSH connection with the user’s identity (spec §8.2), and whether it may. 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 shows nothing again; otherwise the agent’s pane shows a card with a countdown that goes ahead on its own (agent_notice), which the user can stop, hurry or turn into “Always”.
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): asked in the pane that needs it, 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
remember_always_in 🔒
Remember “always” for agent on connection under config_home, and tell every open Connectors → Remotes, whose host rows list these grants.
remote_agent_revoke 🔒
remote.agentrevoke. Revoking only takes access away (the agent is asked again on its next use of the host), so it needs no question.
remote_forget 🔒
remote.forget.
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.
remote_set_config 🔒
remote.setconfig.
remote_ssh_locate 🔒
remote.sshlocate: where in the user’s ssh config a connection is defined.
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 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”.
verified_agent_as 🔒
verified_agent for a caller whose token is known (caller): a container agent has a token and no signing key, and is proven by the token as Browser proves it. An SSH connection keeps the signature alone (verified_agent): it runs with the person’s own identity.