Skip to main content

Module layout

Module layout 

Source
Expand description

layout.save — write one window as an agentmux.layout file (docs/specs/SPEC_LAYOUT_FILES_2026_09_25.md §6.1). The walk and the per-view allowlist live in backend::layout_file; this is the RPC shell.

The destination normally comes from the host’s Save dialog. The handler still refuses anything but an absolute *.agentmux-layout.json path: a caller holding the auth key could otherwise use this to overwrite any file the user can write.

Structs§

TrustInputs 🔒
What decides whether a file is trusted (spec §3.5), injected for tests.

Functions§

create_empty_workspace 🔒
A workspace with no tabs yet, for “Open in a new window”: unlike CreateWindow’s fresh workspace it gets no default tab, so the new window shows only the layout. The caller opens the window onto it afterwards (the host’s open_new_window { workspace_id }, the tear-off attach path).
layout_open_impl 🔒
Add the file’s tabs to window_id’s workspace — or, with new_window, to a new workspace for the caller to open a window onto — then launch each agent into its placeholder through agent.open (spec §3.5). Nothing already open is touched. An agent that can’t start (not installed, live elsewhere, …) leaves its pane as the agent picker and adds a note.
layout_preview_impl 🔒
layout_save_impl 🔒
live_trust_inputs 🔒
load_plan 🔒
Parse the file and build its plan. run_commands = None means “as trusted”.
register