feat(maestro): add SessionView to the protocol and sidecar

Adds `SessionView { Terminal, Structured }` to maestro-protocol, a
defaulted `view` field on `Session` and `CreateSessionRequest`, and
sidecar round-trip tests for both a legacy payload with no `view` key
and a `Structured` session. Nothing reads the field yet; every other
struct literal across the workspace picks up `Default::default()`
(Terminal) to keep compiling.

Gitea #133.
This commit is contained in:
Miguel Palhas
2026-09-04 19:41:29 +01:00
parent f0c272e0b1
commit f02168ffd5
22 changed files with 149 additions and 1 deletions
+4
View File
@@ -478,6 +478,7 @@ impl SessionManager {
// fresh tree has nothing in the way anyway.
blocked_work: None,
last_focused_at: None,
view: req.view,
};
if let Err(e) = self.inner.sidecar.write(&session) {
@@ -683,6 +684,9 @@ impl SessionManager {
current_cwd: None,
blocked_work: None,
last_focused_at: None,
// Unknown on adoption without a sidecar; matches every
// other field's forward-compat default.
view: maestro_protocol::SessionView::Terminal,
},
};
let fifo_path = self.inner.fifo_dir.join(format!("{id}.fifo"));