Skip to main content

Module http_file_rename

Module http_file_rename 

Source
Expand description

POST /api/v1/file/rename: an agent renames a file or folder in its folder (Pane action rename with target file). It is the Files pane’s and the Editor tab’s fs.rename, so the name rules, the refusals and the fs:renamed event are the same, and every Editor tab open on the file follows (docs/specs/SPEC_EDITOR_TAB_RENAME_2026_11_14.md §8).

A container agent names a path in its /workspace: the entry is renamed there and nowhere else, and the answer names the new path as the container sees it. An SSH host is reached as the user, so it takes the agent’s signed identity and the user’s consent for that host, as pane.open does; a container agent has no such identity to give, and is told so.

Constants§

NO_REMOTE_FOR_CONTAINERS 🔒
A container agent asked for a file on an SSH host.
NO_WORKSPACE 🔒
The container agent’s pane has no folder recorded.
NO_WSL 🔒
A WSL distribution was named as the connection.

Functions§

forbidden 🔒
handle_file_rename 🔒
POST /api/v1/file/rename. agentmux-mcp’s Pane (rename, target file) calls it.
not_done 🔒
fs.rename said no: a name that exists, a name the platform refuses, no permission, a protected place.
rename_file 🔒
Renames req.path to req.name in its folder, for a container agent (container is its pane) or for a caller on the host. The new path, as the caller names paths.
rename_in_workspace 🔒
A container agent’s rename: raw is renamed where it lies in workspace (its /workspace on the host), and the answer is the container’s own name for the new path.
ssh_host 🔒
The SSH host connection names, in its canonical form; None for this computer. A WSL distribution is refused: its files are renamed by their Windows path.

Type Aliases§

Refusal 🔒
A refusal: its status, and the sentence the caller is told.