vtcode_desktop_protocol/update.rs
1//! Cached updater-status DTOs.
2
3use serde::{Deserialize, Serialize};
4
5/// Cached updater status for the desktop client. The service owns update
6/// policy (channel, pin, check interval); this snapshot never triggers
7/// network I/O, it only reports the last cached check.
8#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct UpdateStatusSnapshot {
11 /// Version of the running service binary.
12 pub current_version: String,
13 /// Latest known release version, when a check has reported one.
14 #[serde(default, skip_serializing_if = "Option::is_none")]
15 pub latest_version: Option<String>,
16 /// Whether `latest_version` is newer than `current_version` and not dismissed.
17 #[serde(default)]
18 pub update_available: bool,
19 /// HTTPS release page for `latest_version`, when known.
20 #[serde(default, skip_serializing_if = "Option::is_none")]
21 pub release_url: Option<String>,
22 /// Release channel the service follows (stable/beta/nightly).
23 #[serde(default, skip_serializing_if = "Option::is_none")]
24 pub channel: Option<String>,
25 /// Whether the configured check interval has elapsed since the last check.
26 #[serde(default)]
27 pub check_due: bool,
28}