pub(crate) const APP_TOOL: &str = r#"{
"name": "App",
"description": "This AgentMux itself. Every call takes an action. version: the AgentMux you run in (version and how it was installed), whether a newer release is out, whether it is downloaded, and whether this install can upgrade itself. health: what a steward checks after an upgrade (version, build, MuxBus, LAN peers, free disk, how many agents are in which state). With host, version and health run on that other machine and say what it answered. upgrade: ask for AgentMux to be upgraded to the latest release, with a one-line reason. An upgrade restarts AgentMux and every agent in it, so it never happens on your word alone: if the user's own message in this turn asked for it, pass their words verbatim as user_instruction and it starts (download, then a restart once every agent has finished its turn; the user still confirms in AgentMux's dialog); otherwise it goes to the super agent as a sensitive request (see Sensitive): if it approves, the person sees a banner with a 2-minute countdown and can veto it, and you get [AgentMux] notes as it goes. Your session resumes after the restart. Only the release AgentMux found itself can be installed: you can't name a file or a URL. network: whether AgentMux can reach the internet, MuxBus and each model API right now, from its own checks, and for how long a service has been down. It reports what AgentMux has checked, not a fresh test, so \"not checked yet\" and unlisted services are unknown. history_reclaim: give the shared pane-history store's free disk space back. reclaim \"request\" asks for it at the next start of AgentMux (the store is rewritten while it starts; it is recorded as you, and the person sees it pending in History > Storage and can cancel it there), \"cancel\" withdraws it, \"status\" (the default) says whether one is asked for and how the last went. Nothing runs now. With host, upgrade asks that machine to upgrade itself: it is filed there as a sensitive request, so its super agent decides and the person at that machine can veto the countdown (it never starts on your word alone; reason is required, request_id reads where an earlier request stands). With host, version, health and history_reclaim run on that machine (history_reclaim there is recorded as you at that machine). logs: the last lines of this machine's AgentMux srv or host log, or with host another machine's (log \"srv\" (default) or \"host\", lines up to 1000, default 200), with tokens and private keys hidden. A busy log buries the lines you want, so ask for them: level (debug, info, warn or error) keeps lines at that level or above, and contains keeps lines with that text (any case, plain text, not a pattern). Both are applied first, and the last lines are taken from what is left: \"the last 100 warnings that mention store\" is level warn, contains store, lines 100. With either, more of the file is searched (the answer says how much, how many lines matched and how many came back); a line with no level is left out when level is given. Only the newest log file is read. disk: what is filling another machine's disk that AgentMux made (host required): free space of the volumes it uses, the largest build folders (cargo target) in the agents' workspaces with the clone that owns each, and the folders of older versions. It measures and deletes nothing; sizes are lower bounds when it says it stopped early. With clean true and a reason, disk asks that machine to clear its idle build folders (orphan incremental folders, and the target of clones nobody built in for days, never one with a build running; older version folders are never touched): it is filed there as a sensitive request, so its super agent decides and the person can veto the countdown (request_id reads where it stands). record: this machine's own record of how big AgentMux is over weeks (it never leaves the computer; numbers and stable keys only, no names or paths): a line every five minutes for 14 days and an hour's min, median, p95 and max for a year, by AgentMux's four parts and its largest rows. view \"summary\" (the default) says what the record holds, the newest line, AgentMux's size by the hour now, a day, a week ago, and which parts grew most (a restart of srv is said, so a drop is not read as a fix); \"series\" lists the hours (hours up to 336, or day), or with kind raw the five-minute lines; \"export\" returns those lines as stored, to attach to a bug (cut at 200 KB: ask for a shorter window). workspace: in a hosted workspace, whether it is going to stop, when and why (nothing has happened for N minutes, you asked, your credit ran out, a daily cap was reached) and whether an agent has asked for more time; the same for host and container agents. Everywhere else it says no stop is pending. keep_running: with a stop pending, ask for it to be put back by minutes (1 to 240); it is recorded as you, and the workspace's timer decides whether to honour it, so read workspace afterwards. With no stop pending there is nothing to put back and it is refused. Turning a timer off or stopping a workspace is not here.",
"inputSchema": {
"type": "object",
"properties": {
"action": { "type": "string", "enum": ["version", "health", "upgrade", "network", "history_reclaim", "logs", "disk", "record", "workspace", "keep_running"], "description": "What to do" },
"host": { "type": "string", "description": "version, health, history_reclaim, logs, disk, upgrade: another machine, by the name Agents list shows (or name/channel when it runs several AgentMux instances), to run it there instead of here. Named on each call, never remembered; it must be a LAN peer that has pinned your key (an earlier message between you does that). The answer says which machine gave it. Absent means this machine." },
"reason": { "type": "string", "description": "upgrade, disk with clean: one line, why; the user sees it" },
"user_instruction": { "type": "string", "description": "upgrade: the user's own words in this turn asking for the upgrade, verbatim; leave it out when the user didn't ask" },
"version": { "type": "string", "description": "upgrade: the release you expect (from version); refused if it isn't the latest" },
"reclaim": { "type": "string", "enum": ["request", "cancel", "status"], "description": "history_reclaim: request, cancel or read (default) the reclaim" },
"request_id": { "type": "string", "description": "upgrade or disk with host: the id an earlier request returned, to read where it stands instead of asking again" },
"log": { "type": "string", "enum": ["srv", "host"], "description": "logs: which log (default srv)" },
"lines": { "type": "integer", "description": "logs: how many of the last lines, 1 to 1000 (default 200)" },
"level": { "type": "string", "enum": ["debug", "info", "warn", "error"], "description": "logs: only lines at this level or above, applied before the last lines are taken" },
"contains": { "type": "string", "description": "logs: only lines containing this text (plain text, any case, up to 200 characters), applied before the last lines are taken" },
"clean": { "type": "boolean", "description": "disk with host: ask for the cleanup instead of reading the report; needs a reason" },
"view": { "type": "string", "enum": ["summary", "series", "export"], "description": "record: what to read (default summary)" },
"kind": { "type": "string", "enum": ["rollup", "raw", "events"], "description": "record series, export: the hourly rollups (default, a year), the five-minute lines (14 days), or the stalls of the window host and srv, each one, newest 500" },
"hours": { "type": "integer", "description": "record series, export: how far back, 1 to 336 hours (default 24)" },
"day": { "type": "string", "description": "record series, export: one UTC day, 2026-11-16, instead of hours" },
"minutes": { "type": "integer", "description": "keep_running: how many minutes to put the pending stop back by, 1 to 240" }
},
"required": ["action"]
}
}"#;Expand description
App: this AgentMux itself; upgrade restarts every agent, so it is a
tool of its own a harness can gate (like Stop).