Download codex-rs/app-server-protocol/src/protocol/v2/remote_control.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 6.51 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-protocol/src/protocol/v2/remote_control.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/app-server-protocol/src/protocol/v2/remote_control.rs
-
curl -L -o remote_control.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-protocol/src/protocol/v2/remote_control.rs
6.51 kB
| use crate::JsonSchema; | |
| use crate::TS; | |
| use serde::Deserialize; | |
| use serde::Serialize; | |
| pub struct RemoteControlEnableParams { | |
| pub ephemeral: bool, | |
| } | |
| pub type NullableRemoteControlEnableParams = Option<RemoteControlEnableParams>; | |
| pub struct RemoteControlDisableParams { | |
| pub ephemeral: bool, | |
| } | |
| pub type NullableRemoteControlDisableParams = Option<RemoteControlDisableParams>; | |
| /// Current remote-control connection status and remote identity exposed to clients. | |
| pub struct RemoteControlStatusChangedNotification { | |
| pub status: RemoteControlConnectionStatus, | |
| pub server_name: String, | |
| pub installation_id: String, | |
| pub environment_id: Option<String>, | |
| } | |
| pub struct RemoteControlEnableResponse { | |
| pub status: RemoteControlConnectionStatus, | |
| pub server_name: String, | |
| pub installation_id: String, | |
| pub environment_id: Option<String>, | |
| } | |
| pub struct RemoteControlDisableResponse { | |
| pub status: RemoteControlConnectionStatus, | |
| pub server_name: String, | |
| pub installation_id: String, | |
| pub environment_id: Option<String>, | |
| } | |
| pub struct RemoteControlStatusReadResponse { | |
| pub status: RemoteControlConnectionStatus, | |
| pub server_name: String, | |
| pub installation_id: String, | |
| pub environment_id: Option<String>, | |
| } | |
| pub struct RemoteControlPairingStartParams { | |
| pub manual_code: bool, | |
| } | |
| pub struct RemoteControlPairingStartResponse { | |
| pub pairing_code: String, | |
| pub manual_pairing_code: Option<String>, | |
| pub environment_id: String, | |
| pub expires_at: i64, | |
| } | |
| pub struct RemoteControlPairingStatusParams { | |
| pub pairing_code: Option<String>, | |
| pub manual_pairing_code: Option<String>, | |
| } | |
| pub struct RemoteControlPairingStatusResponse { | |
| pub claimed: bool, | |
| } | |
| pub struct RemoteControlClientsListParams { | |
| pub environment_id: String, | |
| pub cursor: Option<String>, | |
| pub limit: Option<u32>, | |
| pub order: Option<RemoteControlClientsListOrder>, | |
| } | |
| pub enum RemoteControlClientsListOrder { | |
| Asc, | |
| Desc, | |
| } | |
| pub struct RemoteControlClientsListResponse { | |
| pub data: Vec<RemoteControlClient>, | |
| pub next_cursor: Option<String>, | |
| } | |
| pub struct RemoteControlClient { | |
| pub client_id: String, | |
| pub display_name: Option<String>, | |
| pub device_type: Option<String>, | |
| pub platform: Option<String>, | |
| pub os_version: Option<String>, | |
| pub device_model: Option<String>, | |
| pub app_version: Option<String>, | |
| pub last_seen_at: Option<i64>, | |
| } | |
| pub struct RemoteControlClientsRevokeParams { | |
| pub environment_id: String, | |
| pub client_id: String, | |
| } | |
| pub struct RemoteControlClientsRevokeResponse {} | |
| pub enum RemoteControlConnectionStatus { | |
| Disabled, | |
| Connecting, | |
| Connected, | |
| Errored, | |
| } | |
| impl From<RemoteControlStatusChangedNotification> for RemoteControlEnableResponse { | |
| fn from(notification: RemoteControlStatusChangedNotification) -> Self { | |
| let RemoteControlStatusChangedNotification { | |
| status, | |
| server_name, | |
| installation_id, | |
| environment_id, | |
| } = notification; | |
| Self { | |
| status, | |
| server_name, | |
| installation_id, | |
| environment_id, | |
| } | |
| } | |
| } | |
| impl From<RemoteControlStatusChangedNotification> for RemoteControlDisableResponse { | |
| fn from(notification: RemoteControlStatusChangedNotification) -> Self { | |
| let RemoteControlStatusChangedNotification { | |
| status, | |
| server_name, | |
| installation_id, | |
| environment_id, | |
| } = notification; | |
| Self { | |
| status, | |
| server_name, | |
| installation_id, | |
| environment_id, | |
| } | |
| } | |
| } | |
| mod tests; | |