Files
galaxy/crates/local_control/src/selectors.rs
T
rkw6086 dbfa8bcd48 Complete agent monitoring and Galaxy Control integration
- expose command-monitor conversations and preserve visible agent transcripts
- add bounded polling and a dedicated shell interrupt tool
- improve direct-provider images, skills, tool history, and usage handling
- package and brand Galaxy Control across releases, installers, persistence, and docs
2026-07-29 15:04:58 -05:00

74 lines
2.4 KiB
Rust

//! Serializable selectors for targeting windows, tabs, and panes.
use serde::{Deserialize, Serialize};
/// Opaque window identifier supplied by Galaxy metadata.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct WindowSelector(pub String);
/// Opaque tab identifier supplied by Galaxy metadata.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct TabSelector(pub String);
/// Opaque pane identifier supplied by Galaxy metadata.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct PaneSelector(pub String);
/// Opaque session identifier supplied by Galaxy metadata.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct SessionSelector(pub String);
/// Hierarchical target for actions that operate on a specific Galaxy surface.
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct TargetSelector {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub window: Option<WindowTarget>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tab: Option<TabTarget>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pane: Option<PaneTarget>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session: Option<SessionTarget>,
}
/// Window-level target selector.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum WindowTarget {
Active,
Id { id: WindowSelector },
Index { index: u32 },
Title { title: String },
}
/// Tab-level target selector.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum TabTarget {
Active,
Id { id: TabSelector },
Index { index: u32 },
Title { title: String },
}
/// Pane-level target selector.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum PaneTarget {
Active,
Id { id: PaneSelector },
Index { index: u32 },
}
/// Session-level target selector.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum SessionTarget {
Active,
Id { id: SessionSelector },
}