Skip to main content

Module pane

Module pane 

Source

Constants§

META_PENDING_OPEN_FILES 🔒
Block-meta key carrying an ARRAY of files the reused pane should open — the sole delivery path (see below for why an earlier version’s second, “live MPS event” path was removed). Drained (all entries, in order) reactively by EditorViewModel’s createEffect over its own block meta, then cleared immediately after — covers both “not yet mounted when this was written” and “already mounted, reacts as soon as the write lands” uniformly through the same MuxObj sync path the pane already depends on for everything else.

Functions§

build_pane_meta 🔒
Build the metadata map for a pane.open request, validating required args.
close_pane_as 🔒
Close the pane that holds target_block_id on behalf of caller_agent_id (whose own pane is own_block_id), the way ClosePane does: a pane the caller is in closes at once; another agent’s pane waits 15 s for its user to keep it (§6.5) and answers 202 with the pending request. Audited as pane.close. Shared by ClosePane and RunCommand’s pane:close (server/ui_shortcuts.rs), so both carry the same protection. via names the tool in the pending request and the audit.
handle_close_pane 🔒
handle_quit_self 🔒
POST /api/v1/agent/pane/close — backs the ClosePane MCP tool. See docs/specs/SPEC_AGENT_PANE_LIFECYCLE_CONTROL_2026_09_10.md.
handle_shutdown_status 🔒
GET /api/v1/agent/shutdown/{request_id} — where a shutdown waiting on the user’s override stands (§6.5): pending, kept_by_user, proceeding, shut_down, superseded or failed.
maybe_reuse_editor_pane 🔒
If the calling agent (identified by its own block id, caller_block_id) already has an Editor pane open in its own tab, push file into that pane as a new tab instead of creating another Editor pane. Returns Ok(None) when there’s no existing Editor pane to reuse (or the caller’s tab can’t be resolved) — the normal create-new-block path handles that case unchanged.
move_tab 🔒
Core pane.moveTab logic — reorder cmd.block_id within its own pane, or move it into a different pane (Command::LayoutStackMove). Queues a stackmove layout action so any OTHER window/tab viewing the same db_layout sees the change (mirrors stack_onto_block_id’s stackpush queue above); the calling frontend applies its own optimistic local edit directly and does not wait on the queue for itself. SPEC_PANE_TAB_DRAG_AND_DROP_2026_09_19.md §4.1, Phase 3.
open_pane
Core pane.open logic, shared by the WebSocket RPC handler (register_pane_open) and the HTTP route POST /api/v1/pane/open (agentmux-mcp’s OpenEditor tool). Creates a block for the requested view, enqueues a layout action (split or insert), and broadcasts the block/tab/layout updates so the frontend renders the new pane.
open_pane_floating 🔒
Floating-pane branch of open_pane. The block already exists in source_tab_id’s blockids (created by the caller, with no layout node). This moves it into a fresh floating workspace via the tear_off_block saga, sets up the new tab’s layout, broadcasts the new MuxObjs, and asks the source window’s frontend to materialize the chromeless floating OS window via the host open_floating_pane_window command (srv cannot open windows itself). See docs/specs/SPEC_OPENEDITOR_FLOATING_AND_COLLAPSED_TREE_2026_06_16.md.
pending_body 🔒
The 202 answer for a shutdown waiting on the user (§6.5).
quit_self 🔒
An agent ending its own session — QuitSelf, or ClosePane with no arguments (§7), which has no quote and so always asks the user. A user-started, untainted turn with the user’s quote quits when the turn ends; anything else waits 15 s for the user to keep it (§6.5).
register
register_pane_move_tab 🔒
SPEC_PANE_TAB_DRAG_AND_DROP_2026_09_19.md §4.1, Phase 3.
register_pane_open 🔒
resolve_placement 🔒
Translate split_direction + split_reference_block_id into the backend layout action triple. Returns (actiontype, targetblockid, position). Falls back to a plain insert if direction/reference are missing.