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§
- Trust
Inputs 🔒 - 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’sopen_new_window { workspace_id }, the tear-off attach path). - layout_
open_ 🔒impl - Add the file’s tabs to
window_id’s workspace — or, withnew_window, to a new workspace for the caller to open a window onto — then launch each agent into its placeholder throughagent.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=Nonemeans “as trusted”. - register