Skip to main content

Module browser_sessions

Module browser_sessions 

Source
Expand description

An agent’s background browser sessions: which browser panes it holds, and show, which turns a background session into a floating pane the person sees (docs/specs/SPEC_BACKGROUND_BROWSER_SESSIONS_2026_11_28.md §4, §6).

A background session is a browser pane in a floating window kept above every display (app_api::floater_place, pane_openers). It is the agent’s, as any pane it opened is: the opener record decides who may list and show it.

Structs§

BrowserSessionShowResult
The answer to browser.session.show.
CommandBrowserSessionShowData
Data for browser.session.show: the session’s pane.

Constants§

COMMAND_BROWSER_SESSION_SHOW
browser.session.show: the person shows an agent’s background session, from the strip in the agent’s pane.
META_SESSIONS 🔒
The agent pane’s meta key that lists its background sessions (pane ids), which the strip in the pane shows.

Functions§

agent_of 🔒
The agent a request is from: its token’s uid, else the signed id (as floater_place::for_browser reads it).
audit 🔒
The Audit row for something done to a background session: what (open, show, hide), by agent, naming the pane and the site it is on (the host and no more: never a path, a query or anything typed).
audit_by 🔒
The same row, by agent, or by the person when there is none (their own Show from the strip).
audit_closed 🔒
The row for a pane that is already closed: its site was read before it went.
audit_step 🔒
The row for a step in a session (a navigation, a click, a fill): the site is the page the step is about when it has an address, else the one the pane is on.
bring_into_view 🔒
Move the window of background session pane into the work area, on the right, keeping the size it has.
handle_ui_browser_hide 🔒
POST /api/v1/ui/browser/hide — put a floating browser pane back in the background.
handle_ui_browser_list 🔒
POST /api/v1/ui/browser/list — the browser panes the caller opened and still has: each pane’s id, address and title, whether it floats and whether it is a background session.
handle_ui_browser_show 🔒
POST /api/v1/ui/browser/show — show a background session.
handoff_float 🔒
What a hand-off does about where its pane is: a background session is shown first (the person is asked to work in a page they can see, whoever the caller is: it is the caller’s hand-off to make), and the hand-off is refused when it cannot be, since its banner would wait on a window above every display. Any other pane is as float_for_handoff says.
hide 🔒
Put the caller’s floating browser pane pane back in the background: its window goes above every display, at the size it has, and it counts against the background caps again.
not_background 🔒
The refusal for a pane that is not the caller’s background session, or none.
not_hideable 🔒
The refusal for a pane that is not a browser pane the caller opened and can put back in the background, or none.
note_opened 🔒
Record agent as the opener of the floating pane pane (a background session when cmd says so, opened from the agent’s pane cmd.split_reference_block_id), and, for a session, write its Audit row.
register
Register browser.session.show, accepted only from the proven AgentMux window: the person’s own choice to see the page, never an agent’s.
reveal_for_prompt 🔒
A prompt for the person (an approval, a sign-in, a request for a value, a navigation to ask about) was raised in pane: when it is a background session its window is above every display, so it is shown, and the prompt is where the person can see it. Nothing else changes for a pane the person already sees.
row 🔒
One pane of list: where it is and what it shows.
show 🔒
Make the caller’s background session pane a floating pane the person sees, on the right of the work area, at the size it has. It counts as a floating pane from then on, so it is refused when the caller already has the most of those.
show_to_ask 🔒
Before a committing click asks the person: a background session is shown first, so the question is on a screen, and the click is refused at once when it cannot be (a question in a window above every display would wait unseen for its ten minutes). Any other pane is as it is.
shown_site 🔒
The host of url (no scheme, sign-in, path or query). An address with no host (data:, about:, javascript:) shows its scheme only, since the rest of it can be anything the page or the agent wrote; text that is not an address shows nothing.
site_of 🔒
The site pane is on now (the host, as the Audit names it), or nothing when it is not a pane with an address.
sync_strips 🔒
Make each agent pane’s agent:bgsessions say which background sessions it holds, writing only what changed. The first call also clears a list a previous run left on a pane. Run whenever the sessions may have changed (browser_owner::changed).
wanted 🔒
What each agent pane’s agent:bgsessions should be: the sessions it opened that are still background ones and still there. A pane with none has no list.
write_audit 🔒
written 🔒
What agent:bgsessions was last set to on each agent pane, so a change is written once.

Type Aliases§

Lists 🔒