feat: generate socket protocol schema
This commit is contained in:
Generated
+63
@@ -373,6 +373,12 @@ version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
|
||||
|
||||
[[package]]
|
||||
name = "dyn-clone"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.15.0"
|
||||
@@ -550,6 +556,7 @@ dependencies = [
|
||||
"portable-pty",
|
||||
"ratatui",
|
||||
"regex",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
@@ -1243,6 +1250,26 @@ dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ref-cast"
|
||||
version = "1.0.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d"
|
||||
dependencies = [
|
||||
"ref-cast-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ref-cast-impl"
|
||||
version = "1.0.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.12.3"
|
||||
@@ -1306,6 +1333,31 @@ version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc"
|
||||
dependencies = [
|
||||
"dyn-clone",
|
||||
"ref-cast",
|
||||
"schemars_derive",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schemars_derive"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde_derive_internals",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
@@ -1348,6 +1400,17 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive_internals"
|
||||
version = "0.29.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.149"
|
||||
|
||||
@@ -31,6 +31,7 @@ toml = "0.8"
|
||||
tracing = "0.1.44"
|
||||
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
|
||||
unicode-width = "0.2"
|
||||
schemars = { version = "1.2.1", features = ["derive"] }
|
||||
|
||||
[patch.crates-io]
|
||||
portable-pty = { path = "vendor/portable-pty" }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -11,7 +11,7 @@ pub struct AgentSessionRef {
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum AgentSessionRefKind {
|
||||
Id,
|
||||
|
||||
+2
-2
@@ -30,14 +30,14 @@ fn is_false(value: &bool) -> bool {
|
||||
!*value
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct Request {
|
||||
pub id: String,
|
||||
#[serde(flatten)]
|
||||
pub method: Method,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "method", content = "params")]
|
||||
// Request enums are short-lived wire values; keeping variants direct preserves
|
||||
// the simple serde shape and avoids boxing churn across every caller.
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::common::{AgentStatus, ReadFormat, ReadSource, SplitDirection};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentReadParams {
|
||||
pub target: String,
|
||||
pub source: ReadSource,
|
||||
@@ -16,20 +16,20 @@ pub struct AgentReadParams {
|
||||
pub strip_ansi: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentSendParams {
|
||||
pub target: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentRenameParams {
|
||||
pub target: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentStartParams {
|
||||
pub name: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -47,7 +47,7 @@ pub struct AgentStartParams {
|
||||
pub env: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentInfo {
|
||||
pub terminal_id: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -78,7 +78,7 @@ pub struct AgentInfo {
|
||||
pub revision: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentSessionInfo {
|
||||
pub source: String,
|
||||
pub agent: String,
|
||||
|
||||
+19
-15
@@ -1,41 +1,41 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct EmptyParams {}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorkspaceTarget {
|
||||
pub workspace_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneTarget {
|
||||
pub pane_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct TabTarget {
|
||||
pub tab_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentTarget {
|
||||
pub target: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct ClientWindowTitleSetParams {
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SplitDirection {
|
||||
Right,
|
||||
Down,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ReadSource {
|
||||
Visible,
|
||||
@@ -44,7 +44,9 @@ pub enum ReadSource {
|
||||
Detection,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ReadFormat {
|
||||
#[default]
|
||||
@@ -52,7 +54,7 @@ pub enum ReadFormat {
|
||||
Ansi,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct NotificationShowParams {
|
||||
pub title: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -63,7 +65,9 @@ pub struct NotificationShowParams {
|
||||
pub sound: NotificationShowSound,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum NotificationShowSound {
|
||||
#[default]
|
||||
@@ -86,7 +90,7 @@ impl NotificationShowSound {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum NotificationShowReason {
|
||||
Shown,
|
||||
@@ -96,7 +100,7 @@ pub enum NotificationShowReason {
|
||||
Busy,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ClientWindowTitleReason {
|
||||
Set,
|
||||
@@ -104,7 +108,7 @@ pub enum ClientWindowTitleReason {
|
||||
NoForegroundClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneAgentState {
|
||||
Idle,
|
||||
@@ -113,7 +117,7 @@ pub enum PaneAgentState {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum AgentStatus {
|
||||
Idle,
|
||||
|
||||
+14
-14
@@ -8,12 +8,12 @@ use super::tabs::TabInfo;
|
||||
use super::workspaces::WorkspaceInfo;
|
||||
use super::worktrees::WorktreeInfo;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct EventsSubscribeParams {
|
||||
pub subscriptions: Vec<Subscription>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Subscription {
|
||||
#[serde(rename = "workspace.created")]
|
||||
@@ -74,14 +74,14 @@ pub enum Subscription {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct EventsWaitParams {
|
||||
pub match_event: EventMatch,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub timeout_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneWaitForOutputParams {
|
||||
pub pane_id: String,
|
||||
pub source: ReadSource,
|
||||
@@ -94,14 +94,14 @@ pub struct PaneWaitForOutputParams {
|
||||
pub strip_ansi: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum OutputMatch {
|
||||
Substring { value: String },
|
||||
Regex { value: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "event", rename_all = "snake_case")]
|
||||
pub enum EventMatch {
|
||||
WorkspaceCreated {
|
||||
@@ -179,7 +179,7 @@ pub enum EventMatch {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum EventKind {
|
||||
WorkspaceCreated,
|
||||
@@ -332,13 +332,13 @@ mod known_event_name_tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct EventEnvelope {
|
||||
pub event: EventKind,
|
||||
pub data: EventData,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub enum SubscriptionEventKind {
|
||||
#[serde(rename = "pane.output_matched")]
|
||||
PaneOutputMatched,
|
||||
@@ -346,27 +346,27 @@ pub enum SubscriptionEventKind {
|
||||
PaneAgentStatusChanged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct SubscriptionEventEnvelope {
|
||||
pub event: SubscriptionEventKind,
|
||||
pub data: SubscriptionEventData,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(untagged)]
|
||||
pub enum SubscriptionEventData {
|
||||
PaneOutputMatched(PaneOutputMatchedEvent),
|
||||
PaneAgentStatusChanged(PaneAgentStatusChangedEvent),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneOutputMatchedEvent {
|
||||
pub pane_id: String,
|
||||
pub matched_line: String,
|
||||
pub read: PaneReadResult,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneAgentStatusChangedEvent {
|
||||
pub pane_id: String,
|
||||
pub workspace_id: String,
|
||||
@@ -383,7 +383,7 @@ pub struct PaneAgentStatusChangedEvent {
|
||||
pub state_labels: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum EventData {
|
||||
WorkspaceCreated {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct IntegrationInstallParams {
|
||||
pub target: IntegrationTarget,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct IntegrationUninstallParams {
|
||||
pub target: IntegrationTarget,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum IntegrationTarget {
|
||||
Pi,
|
||||
@@ -28,12 +28,12 @@ pub enum IntegrationTarget {
|
||||
Cursor,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct IntegrationInstallResult {
|
||||
pub messages: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct IntegrationUninstallResult {
|
||||
pub messages: Vec<String>,
|
||||
}
|
||||
|
||||
+53
-51
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||
use super::agents::AgentSessionInfo;
|
||||
use super::common::{AgentStatus, PaneAgentState, ReadFormat, ReadSource, SplitDirection};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneSplitParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -22,7 +22,7 @@ pub struct PaneSplitParams {
|
||||
pub env: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneDirection {
|
||||
Left,
|
||||
@@ -31,7 +31,7 @@ pub enum PaneDirection {
|
||||
Down,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneSwapParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
@@ -43,7 +43,7 @@ pub struct PaneSwapParams {
|
||||
pub target_pane_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneMoveParams {
|
||||
pub pane_id: String,
|
||||
pub destination: PaneMoveDestination,
|
||||
@@ -51,7 +51,7 @@ pub struct PaneMoveParams {
|
||||
pub focus: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum PaneMoveDestination {
|
||||
Tab {
|
||||
@@ -76,7 +76,7 @@ pub enum PaneMoveDestination {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneZoomParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
@@ -84,7 +84,9 @@ pub struct PaneZoomParams {
|
||||
pub mode: PaneZoomMode,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneZoomMode {
|
||||
#[default]
|
||||
@@ -93,19 +95,19 @@ pub enum PaneZoomMode {
|
||||
Off,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneLayoutParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneProcessInfoParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct LayoutExportParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub tab_id: Option<String>,
|
||||
@@ -113,7 +115,7 @@ pub struct LayoutExportParams {
|
||||
pub pane_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct LayoutApplyParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -126,7 +128,7 @@ pub struct LayoutApplyParams {
|
||||
pub root: LayoutNode,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct LayoutSetSplitRatioParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub tab_id: Option<String>,
|
||||
@@ -136,7 +138,7 @@ pub struct LayoutSetSplitRatioParams {
|
||||
pub ratio: f32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct LayoutDescription {
|
||||
pub workspace_id: String,
|
||||
pub tab_id: String,
|
||||
@@ -145,7 +147,7 @@ pub struct LayoutDescription {
|
||||
pub root: LayoutNode,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum LayoutNode {
|
||||
Pane {
|
||||
@@ -160,7 +162,7 @@ pub enum LayoutNode {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct LayoutPane {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
@@ -174,27 +176,27 @@ pub struct LayoutPane {
|
||||
pub env: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneNeighborParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
pub direction: PaneDirection,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneEdgesParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneFocusDirectionParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
pub direction: PaneDirection,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneResizeParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pane_id: Option<String>,
|
||||
@@ -203,38 +205,38 @@ pub struct PaneResizeParams {
|
||||
pub amount: Option<f32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneListParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PaneCurrentParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub caller_pane_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneRenameParams {
|
||||
pub pane_id: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub label: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneSendTextParams {
|
||||
pub pane_id: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneSendKeysParams {
|
||||
pub pane_id: String,
|
||||
pub keys: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneSendInputParams {
|
||||
pub pane_id: String,
|
||||
#[serde(default, skip_serializing_if = "String::is_empty")]
|
||||
@@ -243,7 +245,7 @@ pub struct PaneSendInputParams {
|
||||
pub keys: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneReadParams {
|
||||
pub pane_id: String,
|
||||
pub source: ReadSource,
|
||||
@@ -255,7 +257,7 @@ pub struct PaneReadParams {
|
||||
pub strip_ansi: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneReportAgentParams {
|
||||
pub pane_id: String,
|
||||
pub source: String,
|
||||
@@ -273,7 +275,7 @@ pub struct PaneReportAgentParams {
|
||||
pub agent_session_path: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneReportAgentSessionParams {
|
||||
pub pane_id: String,
|
||||
pub source: String,
|
||||
@@ -288,7 +290,7 @@ pub struct PaneReportAgentSessionParams {
|
||||
pub session_start_source: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneReportMetadataParams {
|
||||
pub pane_id: String,
|
||||
pub source: String,
|
||||
@@ -318,7 +320,7 @@ pub struct PaneReportMetadataParams {
|
||||
pub ttl_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneClearAgentAuthorityParams {
|
||||
pub pane_id: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -327,7 +329,7 @@ pub struct PaneClearAgentAuthorityParams {
|
||||
pub seq: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneReleaseAgentParams {
|
||||
pub pane_id: String,
|
||||
pub source: String,
|
||||
@@ -336,7 +338,7 @@ pub struct PaneReleaseAgentParams {
|
||||
pub seq: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneInfo {
|
||||
pub pane_id: String,
|
||||
pub terminal_id: String,
|
||||
@@ -365,7 +367,7 @@ pub struct PaneInfo {
|
||||
pub revision: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneProcessInfo {
|
||||
pub pane_id: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -378,7 +380,7 @@ pub struct PaneProcessInfo {
|
||||
pub foreground_processes: Vec<PaneProcessInfoProcess>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneProcessInfoProcess {
|
||||
pub pid: u32,
|
||||
pub name: String,
|
||||
@@ -392,7 +394,7 @@ pub struct PaneProcessInfoProcess {
|
||||
pub cwd: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneSwapResult {
|
||||
pub changed: bool,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -404,7 +406,7 @@ pub struct PaneSwapResult {
|
||||
pub layout: PaneLayoutSnapshot,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneSwapReason {
|
||||
NoNeighbor,
|
||||
@@ -413,7 +415,7 @@ pub enum PaneSwapReason {
|
||||
CrossTab,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneMoveResult {
|
||||
pub changed: bool,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -436,14 +438,14 @@ pub struct PaneMoveResult {
|
||||
pub focused_pane_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneMoveReason {
|
||||
SameTab,
|
||||
ZoomedTab,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneZoomResult {
|
||||
pub changed: bool,
|
||||
pub zoom_changed: bool,
|
||||
@@ -456,7 +458,7 @@ pub struct PaneZoomResult {
|
||||
pub layout: PaneLayoutSnapshot,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneZoomReason {
|
||||
SinglePane,
|
||||
@@ -464,7 +466,7 @@ pub enum PaneZoomReason {
|
||||
AlreadyUnzoomed,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneLayoutSnapshot {
|
||||
pub workspace_id: String,
|
||||
pub tab_id: String,
|
||||
@@ -475,7 +477,7 @@ pub struct PaneLayoutSnapshot {
|
||||
pub splits: Vec<PaneLayoutSplit>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneLayoutRect {
|
||||
pub x: u16,
|
||||
pub y: u16,
|
||||
@@ -483,14 +485,14 @@ pub struct PaneLayoutRect {
|
||||
pub height: u16,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneLayoutPane {
|
||||
pub pane_id: String,
|
||||
pub focused: bool,
|
||||
pub rect: PaneLayoutRect,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneLayoutSplit {
|
||||
pub id: String,
|
||||
pub direction: SplitDirection,
|
||||
@@ -498,7 +500,7 @@ pub struct PaneLayoutSplit {
|
||||
pub rect: PaneLayoutRect,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneNeighborResult {
|
||||
pub pane_id: String,
|
||||
pub direction: PaneDirection,
|
||||
@@ -507,7 +509,7 @@ pub struct PaneNeighborResult {
|
||||
pub layout: PaneLayoutSnapshot,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneEdgesResult {
|
||||
pub pane_id: String,
|
||||
pub left: bool,
|
||||
@@ -517,7 +519,7 @@ pub struct PaneEdgesResult {
|
||||
pub layout: PaneLayoutSnapshot,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneFocusDirectionResult {
|
||||
pub changed: bool,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -528,13 +530,13 @@ pub struct PaneFocusDirectionResult {
|
||||
pub layout: PaneLayoutSnapshot,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneFocusDirectionReason {
|
||||
NoNeighbor,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneResizeResult {
|
||||
pub changed: bool,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -544,13 +546,13 @@ pub struct PaneResizeResult {
|
||||
pub layout: PaneLayoutSnapshot,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneResizeReason {
|
||||
Unchanged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PaneReadResult {
|
||||
pub pane_id: String,
|
||||
pub workspace_id: String,
|
||||
|
||||
+30
-26
@@ -7,7 +7,7 @@ use super::common::SplitDirection;
|
||||
use super::panes::PaneInfo;
|
||||
use super::workspaces::WorkspaceWorktreeInfo;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginLinkParams {
|
||||
pub path: String,
|
||||
#[serde(default = "super::common::default_true")]
|
||||
@@ -16,23 +16,23 @@ pub struct PluginLinkParams {
|
||||
pub source: Option<PluginSourceInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PluginListParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub plugin_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginUnlinkParams {
|
||||
pub plugin_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginSetEnabledParams {
|
||||
pub plugin_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct InstalledPluginInfo {
|
||||
pub plugin_id: String,
|
||||
pub name: String,
|
||||
@@ -64,7 +64,7 @@ pub struct InstalledPluginInfo {
|
||||
pub warnings: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginSourceInfo {
|
||||
#[serde(default)]
|
||||
pub kind: PluginSourceKind,
|
||||
@@ -99,7 +99,9 @@ impl Default for PluginSourceInfo {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PluginSourceKind {
|
||||
#[default]
|
||||
@@ -221,14 +223,14 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginManifestBuild {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub platforms: Option<Vec<PluginPlatform>>,
|
||||
pub command: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginManifestAction {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
@@ -241,7 +243,7 @@ pub struct PluginManifestAction {
|
||||
pub command: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginManifestEventHook {
|
||||
pub on: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -249,7 +251,7 @@ pub struct PluginManifestEventHook {
|
||||
pub command: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginManifestPane {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
@@ -262,7 +264,7 @@ pub struct PluginManifestPane {
|
||||
pub command: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginManifestLinkHandler {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
@@ -272,13 +274,13 @@ pub struct PluginManifestLinkHandler {
|
||||
pub platforms: Option<Vec<PluginPlatform>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PluginActionListParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub plugin_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PluginLogListParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub plugin_id: Option<String>,
|
||||
@@ -286,7 +288,7 @@ pub struct PluginLogListParams {
|
||||
pub limit: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginActionInvokeParams {
|
||||
pub action_id: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -295,7 +297,7 @@ pub struct PluginActionInvokeParams {
|
||||
pub context: Option<PluginInvocationContext>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginCommandLogInfo {
|
||||
pub log_id: String,
|
||||
pub plugin_id: String,
|
||||
@@ -318,7 +320,7 @@ pub struct PluginCommandLogInfo {
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PluginCommandStatus {
|
||||
Running,
|
||||
@@ -326,7 +328,7 @@ pub enum PluginCommandStatus {
|
||||
Failed,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PluginPlatform {
|
||||
Linux,
|
||||
@@ -334,7 +336,7 @@ pub enum PluginPlatform {
|
||||
Windows,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PluginActionContext {
|
||||
Global,
|
||||
@@ -344,7 +346,7 @@ pub enum PluginActionContext {
|
||||
Selection,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginInvocationContext {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -378,7 +380,7 @@ pub struct PluginInvocationContext {
|
||||
pub link_handler_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginActionInfo {
|
||||
pub plugin_id: String,
|
||||
pub action_id: String,
|
||||
@@ -398,7 +400,7 @@ impl PluginActionInfo {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginPaneOpenParams {
|
||||
pub plugin_id: String,
|
||||
pub entrypoint: String,
|
||||
@@ -418,7 +420,9 @@ pub struct PluginPaneOpenParams {
|
||||
pub env: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PluginPanePlacement {
|
||||
#[default]
|
||||
@@ -428,17 +432,17 @@ pub enum PluginPanePlacement {
|
||||
Zoomed,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginPaneFocusParams {
|
||||
pub pane_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginPaneCloseParams {
|
||||
pub pane_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct PluginPaneInfo {
|
||||
pub plugin_id: String,
|
||||
pub entrypoint: String,
|
||||
|
||||
@@ -21,25 +21,25 @@ use super::tabs::TabInfo;
|
||||
use super::workspaces::WorkspaceInfo;
|
||||
use super::worktrees::{WorktreeInfo, WorktreeSourceInfo};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct SuccessResponse {
|
||||
pub id: String,
|
||||
pub result: ResponseResult,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct ErrorResponse {
|
||||
pub id: String,
|
||||
pub error: ErrorBody,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct ErrorBody {
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum ResponseResult {
|
||||
Pong {
|
||||
@@ -234,7 +234,7 @@ pub enum ResponseResult {
|
||||
Ok {},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct AgentManifestInfo {
|
||||
pub agent: String,
|
||||
pub source: String,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct PingParams {}
|
||||
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct ServerLiveHandoffParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub import_exe: Option<String>,
|
||||
@@ -13,7 +13,7 @@ pub struct ServerLiveHandoffParams {
|
||||
pub expected_version: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct ServerCapabilities {
|
||||
pub live_handoff: bool,
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ use super::panes::{PaneInfo, PaneLayoutSnapshot};
|
||||
use super::tabs::TabInfo;
|
||||
use super::workspaces::WorkspaceInfo;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct SessionSnapshot {
|
||||
pub version: String,
|
||||
pub protocol: u32,
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::common::AgentStatus;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct TabCreateParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -18,25 +18,25 @@ pub struct TabCreateParams {
|
||||
pub env: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct TabListParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct TabRenameParams {
|
||||
pub tab_id: String,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct TabMoveParams {
|
||||
pub tab_id: String,
|
||||
pub insert_index: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct TabInfo {
|
||||
pub tab_id: String,
|
||||
pub workspace_id: String,
|
||||
|
||||
@@ -2,6 +2,49 @@ use std::collections::HashMap;
|
||||
|
||||
use super::*;
|
||||
|
||||
fn protocol_schema_entry<T: schemars::JsonSchema>(name: &str) -> serde_json::Value {
|
||||
let mut schema = serde_json::to_value(schemars::schema_for!(T)).unwrap();
|
||||
rewrite_schema_refs(&mut schema, name);
|
||||
schema
|
||||
}
|
||||
|
||||
fn rewrite_schema_refs(value: &mut serde_json::Value, schema_name: &str) {
|
||||
match value {
|
||||
serde_json::Value::Object(object) => {
|
||||
if let Some(serde_json::Value::String(reference)) = object.get_mut("$ref") {
|
||||
if let Some(path) = reference.strip_prefix("#/") {
|
||||
*reference = format!("#/schemas/{schema_name}/{path}");
|
||||
}
|
||||
}
|
||||
for child in object.values_mut() {
|
||||
rewrite_schema_refs(child, schema_name);
|
||||
}
|
||||
}
|
||||
serde_json::Value::Array(items) => {
|
||||
for item in items {
|
||||
rewrite_schema_refs(item, schema_name);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn protocol_schema_document() -> serde_json::Value {
|
||||
serde_json::json!({
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Herdr API",
|
||||
"schema_version": 1,
|
||||
"protocol": crate::protocol::PROTOCOL_VERSION,
|
||||
"schemas": {
|
||||
"request": protocol_schema_entry::<Request>("request"),
|
||||
"success_response": protocol_schema_entry::<SuccessResponse>("success_response"),
|
||||
"error_response": protocol_schema_entry::<ErrorResponse>("error_response"),
|
||||
"event": protocol_schema_entry::<EventEnvelope>("event"),
|
||||
"subscription_event": protocol_schema_entry::<SubscriptionEventEnvelope>("subscription_event"),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn request_uses_dot_method_names() {
|
||||
let request = Request {
|
||||
@@ -18,6 +61,61 @@ fn request_uses_dot_method_names() {
|
||||
assert_eq!(json["method"], "workspace.create");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bundled_protocol_schema_refs_resolve_inside_bundle() {
|
||||
fn assert_no_standalone_refs(value: &serde_json::Value) {
|
||||
match value {
|
||||
serde_json::Value::Object(object) => {
|
||||
if let Some(serde_json::Value::String(reference)) = object.get("$ref") {
|
||||
assert!(
|
||||
!reference.starts_with("#/$defs/"),
|
||||
"schema bundle contains standalone ref {reference}"
|
||||
);
|
||||
}
|
||||
for child in object.values() {
|
||||
assert_no_standalone_refs(child);
|
||||
}
|
||||
}
|
||||
serde_json::Value::Array(items) => {
|
||||
for item in items {
|
||||
assert_no_standalone_refs(item);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
assert_no_standalone_refs(&protocol_schema_document());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_protocol_schema_artifact_is_current() {
|
||||
let actual = format!(
|
||||
"{}\n",
|
||||
serde_json::to_string_pretty(&protocol_schema_document()).unwrap()
|
||||
);
|
||||
let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("docs/next/api/herdr-api.schema.json");
|
||||
|
||||
if std::env::var_os("HERDR_UPDATE_API_SCHEMA").is_some() {
|
||||
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
|
||||
std::fs::write(&path, &actual).unwrap();
|
||||
return;
|
||||
}
|
||||
|
||||
let expected = std::fs::read_to_string(&path).unwrap_or_else(|err| {
|
||||
panic!(
|
||||
"failed to read {}; run `HERDR_UPDATE_API_SCHEMA=1 just test-one generated_protocol_schema_artifact_is_current`: {err}",
|
||||
path.display()
|
||||
)
|
||||
});
|
||||
assert_eq!(
|
||||
expected,
|
||||
actual,
|
||||
"generated API schema artifact is stale; run `HERDR_UPDATE_API_SCHEMA=1 just test-one generated_protocol_schema_artifact_is_current`"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn request_round_trips_for_server_stop() {
|
||||
let request = Request {
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::common::AgentStatus;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorkspaceCreateParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub cwd: Option<String>,
|
||||
@@ -16,19 +16,19 @@ pub struct WorkspaceCreateParams {
|
||||
pub env: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorkspaceRenameParams {
|
||||
pub workspace_id: String,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorkspaceMoveParams {
|
||||
pub workspace_id: String,
|
||||
pub insert_index: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorkspaceInfo {
|
||||
pub workspace_id: String,
|
||||
pub number: usize,
|
||||
@@ -42,7 +42,7 @@ pub struct WorkspaceInfo {
|
||||
pub worktree: Option<WorkspaceWorktreeInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorkspaceWorktreeInfo {
|
||||
pub repo_key: String,
|
||||
pub repo_name: String,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct WorktreeListParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -8,7 +8,7 @@ pub struct WorktreeListParams {
|
||||
pub cwd: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct WorktreeCreateParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -26,7 +26,7 @@ pub struct WorktreeCreateParams {
|
||||
pub focus: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
|
||||
pub struct WorktreeOpenParams {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workspace_id: Option<String>,
|
||||
@@ -42,14 +42,14 @@ pub struct WorktreeOpenParams {
|
||||
pub focus: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorktreeRemoveParams {
|
||||
pub workspace_id: String,
|
||||
#[serde(default)]
|
||||
pub force: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorktreeSourceInfo {
|
||||
pub repo_key: String,
|
||||
pub repo_name: String,
|
||||
@@ -59,7 +59,7 @@ pub struct WorktreeSourceInfo {
|
||||
pub source_workspace_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
pub struct WorktreeInfo {
|
||||
pub path: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
|
||||
+4
-2
@@ -64,7 +64,9 @@ pub enum ToastDelivery {
|
||||
System,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Default)]
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, schemars::JsonSchema, Default,
|
||||
)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum ToastHerdrPosition {
|
||||
TopLeft,
|
||||
@@ -238,7 +240,7 @@ impl Default for SessionConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ConfigReloadStatus {
|
||||
Applied,
|
||||
|
||||
Reference in New Issue
Block a user