use std::path::PathBuf;
use strop_core::id::{BufferRevision, DocumentId};
use strop_core::worker::{Ticket, WorkerId};
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum ShellKey {
Display {
origin: DocumentId,
revision: BufferRevision,
focus: WorkerId,
},
Pipe {
document: DocumentId,
revision: BufferRevision,
start: usize,
end: usize,
},
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ShellIntent {
pub ticket: Ticket<ShellKey>,
pub command: String,
#[serde(with = "strop_core::path_serde")]
pub cwd: PathBuf,
pub original: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ProcessOutput {
pub stdout: String,
pub stderr: String,
}
pub type ShellResult = strop_core::worker::Completion<ShellKey, ProcessOutput>;