aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/mod.rs2
-rw-r--r--src/api/schema.rs22
2 files changed, 24 insertions, 0 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs
index 9a4134ab..4893c295 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -41,6 +41,7 @@ pub(crate) fn request_changes_ui(request: &Request) -> bool {
| Method::TabClose(_)
| Method::AgentRename(_)
| Method::AgentFocus(_)
+ | Method::AgentStart(_)
| Method::PaneSplit(_)
| Method::PaneRename(_)
| Method::PaneReportAgent(_)
@@ -407,6 +408,7 @@ fn api_method_name(method: &Method) -> &'static str {
Method::AgentSend(_) => "agent.send",
Method::AgentRename(_) => "agent.rename",
Method::AgentFocus(_) => "agent.focus",
+ Method::AgentStart(_) => "agent.start",
Method::PaneSplit(_) => "pane.split",
Method::PaneList(_) => "pane.list",
Method::PaneGet(_) => "pane.get",
diff --git a/src/api/schema.rs b/src/api/schema.rs
index e6d24aaf..a82070e0 100644
--- a/src/api/schema.rs
+++ b/src/api/schema.rs
@@ -52,6 +52,8 @@ pub enum Method {
AgentRename(AgentRenameParams),
#[serde(rename = "agent.focus")]
AgentFocus(AgentTarget),
+ #[serde(rename = "agent.start")]
+ AgentStart(AgentStartParams),
#[serde(rename = "pane.split")]
PaneSplit(PaneSplitParams),
#[serde(rename = "pane.list")]
@@ -180,6 +182,22 @@ pub struct AgentRenameParams {
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct AgentStartParams {
+ pub name: String,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub cwd: Option<String>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub workspace_id: Option<String>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub tab_id: Option<String>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub split: Option<SplitDirection>,
+ #[serde(default)]
+ pub focus: bool,
+ pub argv: Vec<String>,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PaneSplitParams {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub workspace_id: Option<String>,
@@ -523,6 +541,10 @@ pub enum ResponseResult {
AgentInfo {
agent: AgentInfo,
},
+ AgentStarted {
+ agent: AgentInfo,
+ argv: Vec<String>,
+ },
AgentList {
agents: Vec<AgentInfo>,
},