1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//! Blocking cross-platform self-update, hosted on GitHub Releases, static JSON
//! manifests, or Sparkle appcasts. This core has no GPUI dependencies.
//!
//! GPUI ships no updater of its own, and Zed's `auto_update` is GPL-licensed and
//! wired to Zed's private update server. This crate is an independent, MIT/Apache
//! implementation of the same idea: a small state machine that checks a release
//! source, downloads the platform artifact, verifies it, and swaps it into place.
//!
//! # Layers
//!
//! - [`UpdateSource`] — where releases come from. [`GitHubSource`],
//! [`StaticManifestSource`], and [`AppcastSource`] are built in.
//! - [`UpdateEngine`] — the blocking pipeline: [`check`](UpdateEngine::check) →
//! [`download`](UpdateEngine::download) (with SHA-256, minisign, and
//! Sparkle-compatible Ed25519 verification) → [`install`](UpdateEngine::install).
//! - [`install`] / [`verify`] — the platform install strategies and integrity
//! checks, usable on their own.
//! - [`UpdateDriver`] — the contract for handing the whole flow to an external
//! updater instead of the engine; `gpui-updater-sparkle` implements it with
//! Sparkle on macOS.
//! - `delta` (behind the `delta` feature) — binary delta updates: create a
//! per-file bsdiff delta in release CI, and let the engine rebuild the new
//! version from the installed one, falling back to the full download on any
//! problem.
//! - [`UpdateStatus`] — backend-independent state used by the separate
//! `gpui-updater` (official GPUI) and `gpui-updater-pre` adapters, whichever
//! backend (engine or driver) they run.
//!
//! # Guides
//!
//! | Topic | Page |
//! | --- | --- |
//! | Choosing a source, the static manifest format, appcasts, proxies and request headers | [`source`] |
//! | Verification and trust: transport, the checks, policies, key rotation, signed manifests | [`verify`] |
//! | Install strategies, the install location check, installs a package manager owns, platform notes | [`install`] |
//! | Delta updates: enabling, generating, publishing, measurements (feature `delta`) | [delta module](delta/index.html) |
//! | Error kinds and what to show the user | [`ErrorKind`] |
//! | Status values for a user interface | [`UpdateStatus`] |
//!
//! For a GPUI app, start with the `gpui-updater` or `gpui-updater-pre` crate,
//! which wraps the engine in an observable entity.
//!
//! # Example (blocking engine)
//!
//! ```no_run
//! use gpui_updater_core::{EngineConfig, GitHubSource, UpdateEngine};
//! use semver::Version;
//!
//! let source = GitHubSource::new("AprilNEA", "OpenLogi")
//! .asset_contains("macos")
//! .asset_contains(".dmg")
//! .with_checksums("SHA256SUMS")
//! .with_minisig();
//!
//! let engine = UpdateEngine::new(
//! source,
//! EngineConfig::new(Version::parse(env!("CARGO_PKG_VERSION")).unwrap())
//! .minisign_public_key("RWQ…"),
//! );
//!
//! if let Some(release) = engine.check()? {
//! let artifact = engine.download(&release, |done, total| {
//! if let Some(total) = total {
//! eprintln!("{done}/{total}");
//! }
//! })?;
//! engine.install(&artifact)?;
//! }
//! # Ok::<_, gpui_updater_core::Error>(())
//! ```
//!
//! [GPUI]: https://www.gpui.rs/
// Panicking on failure is the point of a test assertion.
pub use CancelToken;
pub use ;
pub use ;
pub use ;
pub use HttpOptions;
pub use ;
pub use ;
/// Re-exported so consumers can build an [`EngineConfig`] without depending on
/// `semver` directly (e.g. `Version::parse(env!("CARGO_PKG_VERSION"))`).
pub use Version;
pub use ;
pub use ;