Skip to main content

Module agents_tool

Module agents_tool 

Source
Expand description

Agents: one tool for the other agents (who is reachable, what they are doing, opening them) and the caller’s own history, with an action (docs/specs/SPEC_MUXAPI_TOOL_CONSOLIDATION_2026_10_15.md §4.2, slice S4). It replaces DiscoverAgents, FleetList (the same call), ListConversations, GetAgentTranscript, OpenAgent and SearchHistory; their handlers (fleet.rs, history.rs, panes.rs) run each action unchanged. spawn (the agent-initiated action that makes a worker, not the CLI’s process start) is its own (SPEC_AGENT_WORKERS_2026_10_15.md §3.1): srv launches the worker, then this process sends it the brief, signed as the caller.

Constants§

ACTS 🔒
DEFINITION_FIELDS 🔒
The fields update may change (/api/v1/agent/update); the name, provider, environment, accounts and seat have their own actions.
OPERATOR_FIELDS 🔒
What decides what an agent runs, where its traffic goes or which project files it reads: the operator’s to set in My Agents, as env_set refuses the same.
SPAWN_WAIT 🔒
How long spawn waits for srv: the person’s 30 s countdown in the pane (srv’s agent_notice), then an agent.open that may install the worker’s CLI (150 s), with room to spare. A wait that ran out while srv carried on would launch a worker that never gets its brief.

Functions§

ask_go_ahead 🔒
ask_go_ahead: asks the person to go ahead with a host agent that shares a folder with a container agent (/api/v1/agent/folder-overlap-ask); srv shows them the ask in this agent’s pane and answers where it stands.
ask_pin_change 🔒
ask_pin_change: asks the person to move or forget one pin (/api/v1/agent/pin-ask); srv builds the card from its own record of the pin, shows it in this agent’s pane, and answers where the ask stands.
brief_message 🔒
The worker’s first message: who it is, who it reports to, then the leader’s brief. It names the tool exactly: a worker that went looking for “SendMessage” found Claude Code’s own cross-session tool, whose message reaches the leader unverified and isn’t counted as a report.
call 🔒
capitalised 🔒
container_ask 🔒
Where the new agent runs, as spawn, a worker of workers and create ask for it.
container_caches 🔒
container_caches: a container agent’s cache volumes, read (their sizes) or, with clear, removed, by srv as the agent this process’s token names (/api/v1/agent/container/caches).
create_agent 🔒
create: a named agent from a seeded template (/api/v1/agent/create), not started. srv may wait on the user’s answer, so it has the same wait as spawn.
definition_action 🔒
update, bundles, hide and unhide: srv acts on the definition of the agent in agent (a picker template in template for hide and unhide) as the agent this process’s token names, and records it under that agent (/api/v1/agent/{update,bundles,hide,unhide}).
definition_params 🔒
The body of an update request: the agent and each update field given.
env 🔒
env_get and env_set: a definition’s extra environment variables, read or changed by srv as the agent this process’s token names, which records the change under that agent (/api/v1/agent/env).
env_request 🔒
What env_get and env_set send srv (/api/v1/agent/env): the definition (the caller’s own when none is named) and, for a set, the whole text or the variables to set and unset. lines goes as written, not trimmed. A number or a boolean given as a value is sent as its text.
export_agent 🔒
export: one agent saved as a portable archive file under the caller’s own working folder (POST /api/v1/agent/export). srv writes the file; nothing of it passes through here.
handover_action 🔒
bring_back and move_status: the hand-over state of an agent saved to move (POST /api/v1/agent/<action>).
import_agent 🔒
import: an agent archive put in My Agents (POST /api/v1/agent/import). srv reads the file; it asks the user as create does unless this is a dry_run.
lifecycle 🔒
start, stop, detach, delete and rotate_token: srv acts on the agent in agent as the agent this process’s token names, and records it under that agent (/api/v1/agent/{start,stop,detach,delete,rotate-token}).
message_stats 🔒
Agents message_stats: what messages cost per agent per day, from srv’s audit file (read-only).
migrate_ids 🔒
migrate_ids: the agent id update, one step at a time (/api/v1/agent/migrate-ids). step is plan (the default; changes nothing), stop, apply or rollback (the latest finished run); srv acts as the agent this process’s token names and records every step but plan under it.
move_action 🔒
move: one agent moved to another computer on the LAN (POST /api/v1/agent/move). srv does the whole move; the answer says where it ended, and a move that stopped says how to continue it.
mute_quiet 🔒
mute_quiet: a leader tells the quiet watch that one of its agents will be quiet for minutes (/api/v1/agent/mute-quiet).
open_many 🔒
open with agents: srv opens them all or none (/api/v1/agent/open_many).
open_view 🔒
Agents open with host and view: true: srv puts a watching pane over agent of the paired computer host on this agent’s own window (/api/v1/agent/open_view). Nothing runs on the other computer as a result, and the pane can’t be made to drive: only its person’s click in the pane does that.
own_context 🔒
context and compact: the caller’s own pane only, which srv resolves from this process’s agent token (X-Agent-Token, sent on every request), never from a name (SPEC_AGENT_SELF_COMPACTION_2026_10_23.md §3.3).
ready 🔒
ready: the caller answers the note that asked it to prepare for a change, as its own pane, which srv resolves from this process’s agent token like context and compact (/api/v1/agent/self/ready).
refuse_operator_fields 🔒
Refuses what decides what an agent runs, where its traffic goes or which project files it reads: before a local request is made, and before a remote one is sent (over host it would otherwise be dropped without notice).
remote_agents 🔒
start, open, stop, set_seat, rename, env_get or env_set on another machine (host): srv signs the request as this agent and the other machine’s srv carries it out (agents.<action>, spec §4.3). Any other action refuses a host, so a call never quietly runs here when it was meant for there.
rename_agent 🔒
rename: the agent in agent gets the displayed name in name, by srv as the agent this process’s token names, which records it under that agent (/api/v1/agent/rename).
route_ask 🔒
The harness and model route the new agent runs on, as spawn, a worker of workers and create ask for them.
routes 🔒
routes: the model routes a spawn or create may name (/api/v1/agent/routes), read-only.
set_container_limits 🔒
set_container_limits: a container agent’s CPU and memory limits, read or changed by srv as the agent this process’s token names (/api/v1/agent/container/limits). Neither memory_mb nor cpus reads them.
set_seats 🔒
set_seat: seats set or cleared by srv as the agent this process’s token names, which records each change under that agent (/api/v1/agent/seats). seats goes as given; srv checks the shape and every seat.
spawn 🔒
spawn: srv builds a worker from this agent’s definition and opens it next to it (/api/v1/agent/spawn), then the brief goes to the worker as this agent’s own message, signed with its key, so it arrives host-verified and the worker can answer with Message send.
spawn_many 🔒
spawn with workers: srv checks them all, tells the user once, and launches all or none (/api/v1/agent/spawn_many); only then does each brief go to its worker, so a refused or failed batch has sent nothing.
update_container 🔒
update_container: srv removes the named container agent’s container, so its next message starts it from the current agent image. With container_image it first changes which of the two shipped images the agent runs. Refused while that agent has a turn running.
wants_view 🔒
open with view: true: show another computer’s agent in a pane on this window, watching only.
watch 🔒
watch: the recent transcript of an agent, then what it wrote since after (/api/v1/agent/watch). With wait_seconds srv holds the call until a line arrives, so the client waits a little longer.
workers 🔒
workers: this agent’s own workers, from srv (/api/v1/agent/workers).