feat: consume worktree field from status line hook events

Parse structured WorktreeInfo (name, path, branch, original_repo_directory)
from WorktreeCreate/Remove hook events and emit a dedicated claude:worktree
event. Store per-conversation worktree state and display an emerald branch
badge in the status bar so users can see at a glance which worktree and
branch each session is running on.

Closes #206
This commit is contained in:
2026-03-11 12:51:04 -07:00
committed by Naomi Carrigan
parent 31d156d768
commit d7b1ff44c4
8 changed files with 246 additions and 15 deletions
+18
View File
@@ -296,6 +296,24 @@ pub struct AgentStartEvent {
pub model: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorktreeInfo {
pub name: String,
pub path: String,
pub branch: String,
pub original_repo_directory: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorktreeEvent {
#[serde(skip_serializing_if = "Option::is_none")]
pub conversation_id: Option<String>,
/// "create" or "remove"
pub event_type: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub worktree: Option<WorktreeInfo>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentEndEvent {
pub tool_use_id: String,