Skip to main content

Module desktop

Module desktop 

Source
Expand description

The routes behind Desktop (docs/specs/SPEC_DESKTOP_DRIVING_2026_10_20.md §5.4–5.10, §6). srv is the single gate: the MCP tool asks authorize before it looks at or touches a native app, and srv answers from the grants, the blocklist, the limits and the Stop flag in backend::desktop_gate. The user’s answers (a prompt, Stop) come only through the host (/api/v1/host/desktop_request, /desktop_stop), which agents can’t impersonate.

Structs§

GrantTarget 🔒
What a desktop-control request was filed for, by the request’s id: the agent, its pane, the app and the minutes, which the countdown’s end turns into the grant.
HostDesktopStop 🔒
Policy 🔒

Constants§

ACTIONS 🔒
Actions authorize is asked about.
MAX_TARGETS 🔒
The most targets remembered at once.
OFF 🔒

Statics§

ASKING 🔒
TARGETS 🔒

Functions§

asker_uid 🔒
The uid of the agent that is calling: from its token, else from the running agent of that name.
audit_line 🔒
caller_block 🔒
forget_pane 🔒
The person pressed Stop on the agent in block_id: nothing already asked for may bring its access back.
grant_after_countdown 🔒
The grants a countdown that ended unvetoed makes (one for each agent that asked), and the audit lines saying who approved them.
grouped_pending_message 🔒
What a call that asked for several apps answers for each app that had to be asked.
handle_authorize 🔒
POST /api/v1/agent/desktop/authorize: may this agent do action on that window now? Waits while the user is asked.
handle_host_request 🔒
POST /api/v1/host/desktop_request: the user’s answer to a prompt, relayed by the CEF host with its own token. The instance auth key, which every agent has, isn’t enough.
handle_host_stop 🔒
POST /api/v1/host/desktop_stop: the user’s Stop on the agent in a pane.
handle_policy 🔒
POST /api/v1/agent/desktop/policy: whether Desktop is on, and each listed window’s state (blocked with a reason, or granted).
handle_record 🔒
POST /api/v1/agent/desktop/record: what an authorized action did.
handle_release 🔒
POST /api/v1/agent/desktop/release: the agent gives its grant back.
holds_progress_notes 🔒
Whether the notes about this request’s progress (approved, counting down) are left out, because its call asked for several apps and says it once at the end.
host_only 🔒
names 🔒
open_ask 🔒
The open request this agent already asked for to control app from this pane, if it still waits. Asking again while it does answers the same, without a new audit row for each call.
pending_message 🔒
What a call that asked answers.
policy 🔒
publish 🔒
Tell every window what is waiting and what is granted, and ask for the user’s attention while a prompt is open.
register
remember_target 🔒
Remember that request_id was asked for by this agent in this pane. Agents that join the request each leave their own, so each gets its grant when the countdown ends.
reply 🔒
settled 🔒
A request of a call that asked for several apps has ended. Records how, and returns whether the request belongs to such a call, so its own note is not sent: when the last one ends, the agent is told once about all of them.
snapshot 🔒
start_group_deadline 🔒
End a call’s group when its time is up, so a request that ends in a way nothing reported can’t hold its agent’s notes back: the agent is told what is known, and what is still waiting sends its own note.
still_asking 🔒
The targets of agents that still ask: one that withdrew while the others’ request went on is left out.
take_targets 🔒
Everything remembered for request_id, taken.
tell 🔒
Tell the agent in pane block_id something, as an [AgentMux] note.