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§
- Askpass
Request 🔒 POST /api/v1/askpassbody, fromagentmux-bashwrapas ssh’s askpass.- Conn
Entry 🔒 - One row of the agent
ConnListtool. - User
Answer 🔒 - The user’s answer to
ask_user.answeredis false when the window was closed, timed out, or could not be opened.
Enums§
- Agent
Target 🔒 - Where an agent’s
ShellorPtyShellruns.
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 paneblock_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/cefssh_approval), and wait for the answer. - confirm_
session_ 🔒end - The user’s yes to ending session
idonconn, asked in paneblock.Errunless they said yes. - conn_
disconnect 🔒 conndisconnect;datais 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
localand 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
connconnectdoes (a Remotes row’s Connect, a pane’s Reconnect): log in to an SSH host; for anything else, whatconnensuredoes. - consent_
for_ 🔒ssh - Tell the user that the agent
agent_id(verified,verified_agent) inagent_block_idwants to runwhaton the SSHconnectionwith the user’s identity (spec §8.2), and whether it may.connectionis 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
connensuredoes: acceptlocal; accept a WSL distro that is installed (Windows only), which is then connected; accept an SSH destination where the systemsshis, claiming nothing (only a login connects it: a pane’s ssh, orconnconnect); refuse a bad name with the reason, recorded as the status the pane’s overlay shows. - ensure_
with 🔒 ensurewith the installed distros, the platform and whethersshwas found given, so it is testable anywhere.- for_
agent 🔒 - The connection an agent’s
ShellorPtyShellcall asked for, checked the same way a pane’s is (ensure),Errwith 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 agentConnListtool (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:helperfrom the settings. - known_
ssh_ 🔒host ssh_hostfor 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(aknown_ssh_host) and runtrue, with ssh’s prompts going to the user in the window of paneblock, 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
agentonconnectionunderconfig_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
localor somethingConnTargetrefuses. - 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 paneblock, 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
connectionand runtrue(§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.Errunless that pane isagent_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_agentfor a caller whose token is known (caller): a container agent has a token and no signing key, and is proven by the token asBrowserproves it. An SSH connection keeps the signature alone (verified_agent): it runs with the person’s own identity.