From fbd20ad6e488fb3b9efc1612fdffee6e672976c1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 14 Jun 2026 02:43:45 +0300 Subject: feat: add plugin v1 system Add manifest-driven plugin actions, event hooks, pane entrypoints, link handlers, and host APIs. Support plugin link, GitHub install, build commands, installed plugin registry, pane movement, runtime context, and plugin docs. --- src/api/schema/panes.rs | 110 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 102 insertions(+), 8 deletions(-) (limited to 'src/api/schema/panes.rs') diff --git a/src/api/schema/panes.rs b/src/api/schema/panes.rs index de330993..638829b0 100644 --- a/src/api/schema/panes.rs +++ b/src/api/schema/panes.rs @@ -2,7 +2,8 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; -use super::{AgentSessionInfo, AgentStatus, PaneAgentState, ReadFormat, ReadSource}; +use super::agents::AgentSessionInfo; +use super::common::{AgentStatus, PaneAgentState, ReadFormat, ReadSource, SplitDirection}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct PaneSplitParams { @@ -17,13 +18,8 @@ pub struct PaneSplitParams { pub cwd: Option, #[serde(default)] pub focus: bool, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum SplitDirection { - Right, - Down, + #[serde(default, skip_serializing_if = "HashMap::is_empty")] + pub env: HashMap, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] @@ -103,6 +99,71 @@ pub struct PaneLayoutParams { pub pane_id: Option, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +pub struct PaneProcessInfoParams { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pane_id: Option, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +pub struct LayoutExportParams { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tab_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pane_id: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LayoutApplyParams { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tab_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tab_label: Option, + #[serde(default)] + pub focus: bool, + pub root: LayoutNode, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LayoutDescription { + pub workspace_id: String, + pub tab_id: String, + pub zoomed: bool, + pub focused_pane_id: String, + pub root: LayoutNode, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(tag = "type", rename_all = "snake_case")] +pub enum LayoutNode { + Pane { + #[serde(flatten)] + pane: LayoutPane, + }, + Split { + direction: SplitDirection, + ratio: f32, + first: Box, + second: Box, + }, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] +pub struct LayoutPane { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pane_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cwd: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub command: Option>, + #[serde(default, skip_serializing_if = "HashMap::is_empty")] + pub env: HashMap, +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct PaneNeighborParams { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -138,6 +199,12 @@ pub struct PaneListParams { pub workspace_id: Option, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +pub struct PaneCurrentParams { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub caller_pane_id: Option, +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct PaneRenameParams { pub pane_id: String, @@ -286,6 +353,33 @@ pub struct PaneInfo { pub revision: u64, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PaneProcessInfo { + pub pane_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub shell_pid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub foreground_process_group_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tty: Option, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub foreground_processes: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PaneProcessInfoProcess { + pub pid: u32, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub argv0: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub argv: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cmdline: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cwd: Option, +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct PaneSwapResult { pub changed: bool, -- cgit v1.2.3