diff --git a/src/sharer.rs b/src/sharer.rs index 01ecd9d..283cbff 100644 --- a/src/sharer.rs +++ b/src/sharer.rs @@ -230,6 +230,15 @@ pub enum Lifetime { Lingering, } +/// The reasons the sharer may request extended retention for a shared session. +#[derive(Serialize, Deserialize, Clone, Copy, Debug, Default)] +pub enum SessionRetentionReason { + /// Environment setup failed. The session should remain available so users can inspect setup + /// command output from the shared session link after the sandbox shuts down. + #[default] + SetupFailed, +} + /// The initial state that the sharer must supply when starting /// a shared session. #[derive(Debug, Deserialize, Serialize)] @@ -499,6 +508,13 @@ pub enum UpstreamMessage { /// and notify viewers before the websocket closes. EndSession { reason: SessionEndedReason }, + /// The client sends this message to request that the server retain session data longer than + /// normal after sharing ends. + ExtendSessionRetention { + #[serde(default)] + reason: SessionRetentionReason, + }, + /// Update to the sharer's active prompt. UpdateActivePrompt(ActivePromptUpdate),