agentmux_common/file_rename_types.rs
1// Copyright 2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3
4//! The request of `POST /api/v1/file/rename`, which agentmux-mcp's `Pane` (`rename` with target
5//! `file`) sends to srv. Kept out of `api_types.rs`, which re-exports it, for that file's size.
6
7use serde::{Deserialize, Serialize};
8
9use crate::api_types::UiAutomationAuth;
10
11/// `POST /api/v1/file/rename` — rename a file or folder in its folder. Editor tabs open on it follow.
12#[derive(Debug, Clone, Serialize, Deserialize)]
13pub struct FileRenameRequest {
14 /// The file or folder: absolute on this computer, the host's own on an SSH host, in
15 /// `/workspace` for a container agent.
16 pub path: String,
17 /// The new name: a plain name, with no folder.
18 pub name: String,
19 /// The SSH host the file is on; absent for this computer. Needs `block_id` and `auth`.
20 #[serde(default, skip_serializing_if = "Option::is_none")]
21 pub connection: Option<String>,
22 /// The calling agent's pane, which shows the consent for an SSH host.
23 #[serde(default, skip_serializing_if = "Option::is_none")]
24 pub block_id: Option<String>,
25 /// The calling agent's signed identity, for an SSH `connection`.
26 #[serde(default, skip_serializing_if = "Option::is_none")]
27 pub auth: Option<UiAutomationAuth>,
28}