Skip to main content

muster/domain/pty/
request.rs

1use std::{collections::BTreeMap, ffi::OsString, path::PathBuf};
2
3use getset::{CopyGetters, Getters};
4use typed_builder::TypedBuilder;
5
6use crate::domain::{agent_session::AgentSessionId, pty::PtySize, value::CommandLine};
7
8/// A request to spawn one process under a PTY.
9#[derive(Clone, Debug, Getters, CopyGetters, TypedBuilder)]
10pub struct SpawnRequest {
11    /// Command to run, or the user's login shell when absent.
12    #[getset(get = "pub")]
13    #[builder(default)]
14    command: Option<CommandLine>,
15    /// Directory to launch in; inherits the parent's cwd when absent.
16    #[getset(get = "pub")]
17    #[builder(default)]
18    working_dir: Option<PathBuf>,
19    /// Project config path exported to the process, letting the `muster` CLI
20    /// target the current project without a flag. Absent leaves it unset.
21    #[getset(get = "pub")]
22    #[builder(default)]
23    project: Option<PathBuf>,
24    /// Additional environment exported only to this child process.
25    #[getset(get = "pub")]
26    #[builder(default)]
27    environment: BTreeMap<OsString, OsString>,
28    /// Durable session whose provider process must bind before it starts.
29    #[getset(get = "pub")]
30    #[builder(default)]
31    agent_session_id: Option<AgentSessionId>,
32    /// Initial PTY size.
33    #[getset(get_copy = "pub")]
34    size: PtySize,
35}