| use crate::JsonSchema; |
| use crate::TS; |
| use codex_utils_absolute_path::AbsolutePathBuf; |
| use serde::Deserialize; |
| use serde::Serialize; |
| use std::collections::HashMap; |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessTerminalSize { |
| |
| pub rows: u16, |
| |
| pub cols: u16, |
| } |
|
|
| |
| |
| |
| |
| |
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessSpawnParams { |
| |
| pub command: Vec<String>, |
| |
| |
| |
| |
| pub process_handle: String, |
| |
| pub cwd: AbsolutePathBuf, |
| |
| |
| |
| #[serde(default, skip_serializing_if = "std::ops::Not::not")] |
| pub tty: bool, |
| |
| #[serde(default, skip_serializing_if = "std::ops::Not::not")] |
| pub stream_stdin: bool, |
| |
| |
| |
| #[serde(default, skip_serializing_if = "std::ops::Not::not")] |
| pub stream_stdout_stderr: bool, |
| |
| |
| |
| |
| #[serde( |
| default, |
| deserialize_with = "crate::protocol::serde_helpers::deserialize_double_option", |
| serialize_with = "crate::protocol::serde_helpers::serialize_double_option", |
| skip_serializing_if = "Option::is_none" |
| )] |
| #[ts(type = "number | null")] |
| #[ts(optional = nullable)] |
| pub output_bytes_cap: Option<Option<usize>>, |
| |
| |
| |
| |
| #[serde( |
| default, |
| deserialize_with = "crate::protocol::serde_helpers::deserialize_double_option", |
| serialize_with = "crate::protocol::serde_helpers::serialize_double_option", |
| skip_serializing_if = "Option::is_none" |
| )] |
| #[ts(type = "number | null")] |
| #[ts(optional = nullable)] |
| pub timeout_ms: Option<Option<i64>>, |
| |
| |
| |
| |
| |
| #[ts(optional = nullable)] |
| pub env: Option<HashMap<String, Option<String>>>, |
| |
| |
| #[ts(optional = nullable)] |
| pub size: Option<ProcessTerminalSize>, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessSpawnResponse {} |
|
|
| |
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessWriteStdinParams { |
| |
| pub process_handle: String, |
| |
| #[ts(optional = nullable)] |
| pub delta_base64: Option<String>, |
| |
| #[serde(default, skip_serializing_if = "std::ops::Not::not")] |
| pub close_stdin: bool, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessWriteStdinResponse {} |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessKillParams { |
| |
| pub process_handle: String, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessKillResponse {} |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessResizePtyParams { |
| |
| pub process_handle: String, |
| |
| pub size: ProcessTerminalSize, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessResizePtyResponse {} |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub enum ProcessOutputStream { |
| |
| Stdout, |
| |
| Stderr, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessOutputDeltaNotification { |
| |
| pub process_handle: String, |
| |
| pub stream: ProcessOutputStream, |
| |
| pub delta_base64: String, |
| |
| |
| pub cap_reached: bool, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ProcessExitedNotification { |
| |
| pub process_handle: String, |
| |
| pub exit_code: i32, |
| |
| |
| |
| pub stdout: String, |
| |
| |
| |
| |
| pub stdout_cap_reached: bool, |
| |
| |
| |
| pub stderr: String, |
| |
| |
| |
| |
| pub stderr_cap_reached: bool, |
| } |
|
|