diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ac102f4a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Signatures verify exact bytes; checkout must not convert signed TOML to CRLF. +/crates/core/tests/fixtures/hosted-catalog.toml -text diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 276618a4..cad2115d 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -29,6 +29,10 @@ jobs: permissions: contents: read steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -49,6 +53,10 @@ jobs: name: Windows installation policy (no app build) runs-on: windows-latest steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 033a7316..d8a3cfe7 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -63,3 +63,11 @@ licensed like those apps. Refresh them from the source path, never redraw them. |---|---|---|---|---| | `docs/brand/` (all files) | ArtCraft name, wordmark and mark | ArtCraft Team | getartcraft.com | Not open source; trademarks of the ArtCraft Team, [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt) | | README app icons (linked, not copied) | Each Craft app's 64 px icon | ArtCraft Team and each app's contributors | `raw.githubusercontent.com/storytold//main/assets/app-icon/hicolor/64x64/apps/ai.storyteller..png` | MIT OR Apache-2.0 (each app's license) | + +## Hosted catalog verification + +| Path | Title | Author | Source | License | +| ---------------------------------------------------- | ----------------------------------------- | ------------- | ---------------------------------------------------- | ----------------- | +| `crates/core/assets/launcher-catalog-public-key.pem` | Launcher catalog Ed25519 verification key | ArtCraft Team | Maintainer-supplied website catalog signing keypair | MIT OR Apache-2.0 | +| `crates/core/catalog.toml` | Bundled launcher catalog | ArtCraft Team | `storytold/artcraft-services` PR #205 | MIT OR Apache-2.0 | +| `crates/core/tests/fixtures/hosted-catalog.toml.sig` | Detached catalog signature test fixture | ArtCraft Team | Signature of the bundled catalog with its pinned key | MIT OR Apache-2.0 | diff --git a/Cargo.lock b/Cargo.lock index 233d7f33..08a95f39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -272,7 +272,7 @@ checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "artcraft-launcher" -version = "0.14.0" +version = "0.19.2" dependencies = [ "artcraft-launcher-core", "artcraft-launcher-native", @@ -298,17 +298,21 @@ dependencies = [ [[package]] name = "artcraft-launcher-core" -version = "0.14.0" +version = "0.19.2" dependencies = [ + "base64 0.22.1", + "ed25519-dalek", "jiff", "semver", "serde", "serde_json", + "sha2", + "toml 1.1.8+spec-1.1.0", ] [[package]] name = "artcraft-launcher-native" -version = "0.14.0" +version = "0.19.2" dependencies = [ "artcraft-launcher-core", "craft-update", @@ -332,7 +336,7 @@ dependencies = [ [[package]] name = "artcraft-launcher-ui-egui" -version = "0.14.0" +version = "0.19.2" dependencies = [ "artcraft-launcher-core", "craft-ui", @@ -352,7 +356,7 @@ dependencies = [ [[package]] name = "artcraft-launcher-web" -version = "0.14.0" +version = "0.19.2" dependencies = [ "artcraft-launcher-core", "artcraft-launcher-ui-egui", @@ -360,6 +364,7 @@ dependencies = [ "egui", "js-sys", "log", + "serde_json", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -595,6 +600,12 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + [[package]] name = "bit-set" version = "0.10.0" @@ -903,6 +914,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation" version = "0.9.4" @@ -1024,7 +1041,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=1b34eba41e62138fc2438d2734523b302840b45d#1b34eba41e62138fc2438d2734523b302840b45d" +source = "git+https://github.com/storytold/craft-libs?rev=6e03f65bf45181db77ba6229716e6624db9eb25b#6e03f65bf45181db77ba6229716e6624db9eb25b" dependencies = [ "chrono", "dunce", @@ -1032,6 +1049,7 @@ dependencies = [ "getrandom 0.3.4", "log", "plist", + "rustix 1.1.5", "semver", "serde", "serde_json", @@ -1110,6 +1128,33 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "data-url" version = "0.3.2" @@ -1147,6 +1192,17 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.5.8" @@ -1203,7 +1259,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1281,6 +1337,30 @@ dependencies = [ "serde", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + [[package]] name = "eframe" version = "0.37.0" @@ -1574,7 +1654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1639,6 +1719,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693" +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "field-offset" version = "0.3.6" @@ -3538,7 +3624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -3601,6 +3687,15 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "peniko" version = "0.6.1" @@ -3717,6 +3812,16 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.34" @@ -3970,6 +4075,15 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + [[package]] name = "range-alloc" version = "0.1.5" @@ -4225,7 +4339,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4282,7 +4396,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4482,6 +4596,15 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core", +] + [[package]] name = "simd-adler32" version = "0.3.10" @@ -4634,6 +4757,16 @@ dependencies = [ "bitflags 2.13.2", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.1" @@ -4782,10 +4915,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix 1.1.5", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -5788,7 +5921,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -6222,7 +6355,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" [[package]] name = "xtask" -version = "0.14.0" +version = "0.19.2" dependencies = [ "jiff", "semver", diff --git a/Cargo.toml b/Cargo.toml index 305314b9..034ef0d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/*", "apps/*", "xtask"] [workspace.package] -version = "0.14.0" +version = "0.19.2" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" @@ -33,7 +33,7 @@ semver = { version = "1", features = ["serde"] } log = "0.4" # All date/time conversion goes through jiff (no hand-rolled calendar code beyond the 400-year range extension; AGENTS.md). jiff = "0.2" -craft-update = { version = "=0.1.0", git = "https://github.com/storytold/craft-libs", rev = "1b34eba41e62138fc2438d2734523b302840b45d" } +craft-update = { version = "=0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6e03f65bf45181db77ba6229716e6624db9eb25b" } craft-ui = { version = "=0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" } [profile.dev.package."*"] diff --git a/apps/artcraft-launcher-web/Cargo.toml b/apps/artcraft-launcher-web/Cargo.toml index 76a7b9cb..56ab76df 100644 --- a/apps/artcraft-launcher-web/Cargo.toml +++ b/apps/artcraft-launcher-web/Cargo.toml @@ -19,6 +19,7 @@ artcraft-launcher-core = { workspace = true } artcraft-launcher-ui-egui = { workspace = true } egui = { workspace = true } log = { workspace = true } +serde_json = { workspace = true } [target.'cfg(target_arch = "wasm32")'.dependencies] # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. @@ -26,4 +27,4 @@ eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", " wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" js-sys = "0.3" -web-sys = { version = "0.3", features = ["Window", "Document", "Element", "HtmlCanvasElement", "MediaQueryList", "Navigator", "Request", "RequestInit", "RequestMode", "Response", "Headers"] } +web-sys = { version = "0.3", features = ["Window", "Document", "Element", "HtmlCanvasElement", "MediaQueryList", "Navigator", "Request", "RequestInit", "RequestMode", "Response", "Headers", "Storage", "AbortSignal", "ReadableStream", "ReadableStreamDefaultReader", "RequestRedirect"] } diff --git a/apps/artcraft-launcher-web/src/hosted_catalog.rs b/apps/artcraft-launcher-web/src/hosted_catalog.rs new file mode 100644 index 00000000..fb97a806 --- /dev/null +++ b/apps/artcraft-launcher-web/src/hosted_catalog.rs @@ -0,0 +1,112 @@ +//! Browser startup catalog refresh. Storage failures leave the compiled fallback usable. +use std::collections::HashMap; +use std::sync::atomic::{AtomicBool, Ordering}; + +use artcraft_launcher_core::hosted_catalog::{ + CATALOG_URL, MAX_CATALOG_BYTES, MAX_ICON_BYTES, MAX_SIGNATURE_BYTES, SIGNATURE_URL, VerifiedCatalog, valid_icon, +}; +use wasm_bindgen::JsCast; +use wasm_bindgen_futures::JsFuture; + +const CACHE_KEY: &str = "artcraft-launcher.signed-catalog.v1"; +static CHECKED: AtomicBool = AtomicBool::new(false); + +pub async fn refresh_once() { + if CHECKED.swap(true, Ordering::SeqCst) { + return; + } + let storage = web_sys::window().and_then(|w| w.local_storage().ok().flatten()); + let remote = fetch_pair().await; + let catalog = match remote { + Ok((catalog, signature)) => match VerifiedCatalog::verify(&catalog, &signature) { + Ok(verified) => { + if let (Some(storage), Ok(text), Ok(sig)) = (&storage, String::from_utf8(catalog), String::from_utf8(signature)) + && let Ok(json) = serde_json::to_string(&(text, sig)) + { + let _ = storage.set_item(CACHE_KEY, &json); + } + Some(verified) + } + Err(why) => { + log::warn!("hosted catalog rejected: {why}"); + None + } + }, + Err(why) => { + log::warn!("hosted catalog unavailable: {why}"); + None + } + } + .or_else(|| { + let saved = storage.as_ref()?.get_item(CACHE_KEY).ok()??; + if saved.len() > MAX_CATALOG_BYTES * 6 + MAX_SIGNATURE_BYTES + 128 { + return None; + } + let (text, sig): (String, String) = serde_json::from_str(&saved).ok()?; + VerifiedCatalog::verify(text.as_bytes(), sig.as_bytes()).ok() + }); + if let Some(catalog) = catalog { + if catalog.rejected_entries > 0 { + log::warn!("ignored {} invalid catalog entries", catalog.rejected_entries); + } + let mut icons = HashMap::new(); + for (id, url, digest) in catalog.icons() { + if artcraft_launcher_core::catalog::app_icon_png(id).is_some_and(|b| valid_icon(b, digest)) { + continue; + } + // The browser's HTTP cache keeps content-addressed icons; hashes are checked every time. + match fetch_bytes(url, MAX_ICON_BYTES).await { + Ok(bytes) if valid_icon(&bytes, digest) => { + icons.insert(id.to_string(), bytes); + } + Ok(_) => {} + Err(_) => break, // An offline browser must not wait one timeout for every icon. + } + } + catalog.activate(icons); + } +} + +async fn fetch_pair() -> Result<(Vec, Vec), String> { + let catalog = fetch_bytes(CATALOG_URL, MAX_CATALOG_BYTES).await?; + let signature = fetch_bytes(SIGNATURE_URL, MAX_SIGNATURE_BYTES).await?; + Ok((catalog, signature)) +} + +/// Stream and cap the actual body, even if content-length is missing or dishonest. +async fn fetch_bytes(url: &str, max: usize) -> Result, String> { + let window = web_sys::window().ok_or("no browser window")?; + let init = web_sys::RequestInit::new(); + init.set_mode(web_sys::RequestMode::Cors); + init.set_redirect(web_sys::RequestRedirect::Error); + init.set_signal(Some(&web_sys::AbortSignal::timeout_with_u32(20_000))); + let request = web_sys::Request::new_with_str_and_init(url, &init).map_err(|_| "invalid catalog request")?; + let response: web_sys::Response = JsFuture::from(window.fetch_with_request(&request)) + .await + .map_err(|_| "catalog request failed")? + .dyn_into() + .map_err(|_| "invalid catalog response")?; + if response.status() != 200 { + return Err(format!("catalog server answered {}", response.status())); + } + let announced = response.headers().get("content-length").ok().flatten().and_then(|v| v.parse::().ok()); + if announced.is_some_and(|n| n > max) { + return Err("catalog response is too large".into()); + } + let reader: web_sys::ReadableStreamDefaultReader = + response.body().ok_or("catalog response has no body")?.get_reader().dyn_into().map_err(|_| "catalog response cannot be streamed")?; + let mut bytes = Vec::new(); + loop { + let chunk = JsFuture::from(reader.read()).await.map_err(|_| "catalog stream failed")?; + if js_sys::Reflect::get(&chunk, &"done".into()).ok().and_then(|v| v.as_bool()) == Some(true) { + return Ok(bytes); + } + let value = js_sys::Reflect::get(&chunk, &"value".into()).map_err(|_| "invalid catalog stream chunk")?; + let chunk = js_sys::Uint8Array::new(&value); + if chunk.length() as usize > max.saturating_sub(bytes.len()) { + let _ = reader.cancel(); + return Err("catalog response is too large".into()); + } + bytes.extend_from_slice(&chunk.to_vec()); + } +} diff --git a/apps/artcraft-launcher-web/src/main.rs b/apps/artcraft-launcher-web/src/main.rs index 76aa23e8..d708452f 100644 --- a/apps/artcraft-launcher-web/src/main.rs +++ b/apps/artcraft-launcher-web/src/main.rs @@ -6,6 +6,8 @@ #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] +#[cfg(target_arch = "wasm32")] +mod hosted_catalog; #[cfg(target_arch = "wasm32")] mod web; diff --git a/apps/artcraft-launcher-web/src/web.rs b/apps/artcraft-launcher-web/src/web.rs index 34c93f99..bb9df0cd 100644 --- a/apps/artcraft-launcher-web/src/web.rs +++ b/apps/artcraft-launcher-web/src/web.rs @@ -6,7 +6,7 @@ use std::rc::Rc; use artcraft_launcher_core::details::{AppDetails, MAX_SCREENSHOT_BYTES, looks_like_jpeg}; use artcraft_launcher_core::protocol::{Backend, Capabilities, Command, Event, LatestRelease, Origin, Source}; use artcraft_launcher_core::release::{self, Release}; -use artcraft_launcher_core::{Arch, Os, Platform, SUITE, catalog, version}; +use artcraft_launcher_core::{Arch, Os, Platform, catalog, version}; use artcraft_launcher_ui_egui::{Host, LauncherUi, Settings, i18n}; use wasm_bindgen::JsCast; use wasm_bindgen_futures::JsFuture; @@ -173,8 +173,11 @@ impl WebBackend { let pre = self.prereleases; wasm_bindgen_futures::spawn_local(async move { events.borrow_mut().push(Event::CheckStarted); + crate::hosted_catalog::refresh_once().await; + events.borrow_mut().push(Event::CatalogUpdated); + ctx.request_repaint(); let mut limited = None; - for app in &SUITE { + for app in artcraft_launcher_core::hosted_catalog::apps() { let latest = latest(app.repo, pre).await; if let Err(Some(reset)) = &latest { limited = Some(*reset); diff --git a/apps/artcraft-launcher/src/main.rs b/apps/artcraft-launcher/src/main.rs index dc8488d2..12819aef 100644 --- a/apps/artcraft-launcher/src/main.rs +++ b/apps/artcraft-launcher/src/main.rs @@ -16,7 +16,7 @@ mod spaces; mod system_theme; mod tray; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::process::ExitCode; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{Receiver, RecvTimeoutError, SyncSender, channel, sync_channel}; @@ -26,6 +26,7 @@ use std::time::Duration; use artcraft_launcher_core::protocol::Backend; use artcraft_launcher_native::single_instance::{self, Instance}; use artcraft_launcher_native::{NativeBackend, login}; +use artcraft_launcher_ui_egui::i18n; use artcraft_launcher_ui_egui::theme::Tokens; use artcraft_launcher_ui_egui::{Host, LauncherUi, Settings, TitleBar}; use eframe::wgpu::rwh::{HasDisplayHandle, RawDisplayHandle}; @@ -132,19 +133,24 @@ fn main() -> ExitCode { // so no window flashes up. Without a tray to come back from, the window opens after all. let mut window = true; if hidden && !window_can_hide_here(|name| std::env::var_os(name)) { - let settings = settings_path.as_deref().and_then(|p| settings_file::load(p, SETTINGS_KEY)); + let settings = saved_settings(settings_path.as_deref()); launcher.start(settings, &waker); window = launcher.tray.is_none(); } + // A renderer that can't start on the first-choice backend is tried again on the next one + // (`StartupBackends`), so a graphics driver that fails the UI pipeline doesn't end the + // launcher before its window appears. + let mut backends = StartupBackends::new(eframe::wgpu::Backends::from_env().is_some()); // One pass per window: where a window can't hide, closing to the tray ends its pass and the // launcher carries on without one until the window is asked for again. loop { if window { + let attempt = backends.current(); let result = { let (waker, launcher) = (waker.clone(), &mut launcher); eframe::run_native( "ArtCraft Launcher", - native_options(hidden), + native_options(hidden, attempt), Box::new(move |cc| { launcher.open(cc, &waker); Ok(Box::new(Shell::new(cc, launcher, hidden))) @@ -153,7 +159,11 @@ fn main() -> ExitCode { }; waker.set_window(None); if let Err(e) = result { - log::error!("{e}"); + if let Some(next) = backends.after_failure(&e) { + log::warn!("the window didn't start: {e}; trying {next:?} instead"); + continue; + } + report_startup_failure(attempt, &e, startup_language(saved_settings(settings_path.as_deref()))); return ExitCode::FAILURE; } if !std::mem::take(&mut launcher.closed_to_tray) { @@ -169,12 +179,13 @@ fn main() -> ExitCode { } /// The native window and renderer setup. `hidden` only sets the initial visibility; the shell -/// shows the window after a tray start. Non-macOS windows are undecorated because the header -/// draws the title bar, while macOS keeps its bundle icon and hides the system title. Window -/// state persists to the portable-aware settings path, system font fallback is off so the -/// deliberate bundled faces stay in charge, and wgpu limits are clamped to the adapter so a -/// short adapter cannot fail device creation. -fn native_options(hidden: bool) -> eframe::NativeOptions { +/// shows the window after a tray start. `backends` overrides wgpu's backend list for this attempt +/// (`StartupBackends`). Non-macOS windows are undecorated because the header draws the title bar, +/// while macOS keeps its bundle icon and hides the system title. Window state persists to the +/// portable-aware settings path, system font fallback is off so the deliberate bundled faces stay +/// in charge, and wgpu limits are clamped to the adapter so a short adapter cannot fail device +/// creation. +fn native_options(hidden: bool, backends: Option) -> eframe::NativeOptions { let icon = eframe::icon_data::from_png_bytes(include_bytes!("../../../assets/app-icon/hicolor/256x256/apps/ai.storyteller.artcraft-launcher.png")).ok(); let mut viewport = egui::ViewportBuilder::default() @@ -203,7 +214,7 @@ fn native_options(hidden: bool) -> eframe::NativeOptions { viewport, persist_window: true, persistence_path: settings_file::path(APP_ID), - wgpu_options: within_adapter_limits(wgpu_options()), + wgpu_options: within_adapter_limits(wgpu_options(backends)), // The launcher's typography is deliberate (its bundled Latin and monochrome emoji faces // plus, for a CJK language, the one system face read by `theme`). eframe's system-font // provider would enumerate and select fonts asynchronously, changing which face draws Han @@ -235,6 +246,148 @@ fn fit_limits(requested: eframe::wgpu::Limits, adapter: &eframe::wgpu::Limits) - requested.or_worse_values_from(adapter) } +/// The backends a start tries for its window, in order, before it gives up. +/// +/// The first attempt uses wgpu's own backend list. If the renderer can't be created on it — the +/// driver refuses the UI pipeline — the next attempt uses [`fallback_backends`] instead. Without +/// this the launcher exits before its window appears and looks like it never started at all: +/// Direct3D 12 fails to create `egui_pipeline` on some drivers (#111, #1081), and a 32-bit build +/// fails it on every Direct3D 12 adapter even where the 64-bit build of the same commit draws +/// fine (reproduced here: `windows-x86` from v0.14.0 on Windows 10 22H2, NVIDIA 32.0.16.1742 and +/// the AMD integrated GPU alike). +/// +/// `WGPU_BACKEND` is the user's own choice, so a start that names one tries that alone. +struct StartupBackends { + /// What to try next, in order. An entry of `None` means wgpu's own backend list. + remaining: Vec>, +} + +impl StartupBackends { + /// The plan for a start, where `named_by_env` says `WGPU_BACKEND` picked the backend itself. + fn new(named_by_env: bool) -> Self { + Self { remaining: startup_plan(named_by_env) } + } + + /// The backends to start with, or `None` for wgpu's own list. + fn current(&self) -> Option { + self.remaining.first().copied().flatten() + } + + /// The backends to try after `error` ended the attempt, or `None` when there is nothing left + /// to try and the launcher should report the failure and exit. + fn after_failure(&mut self, error: &eframe::Error) -> Option { + // Only a renderer that couldn't be created is worth another backend. A window that failed + // for another reason — no event loop, no display — fails the same way on all of them, and + // retrying would only hide the first error. + if !matches!(error, eframe::Error::Wgpu(_)) { + self.remaining.clear(); + return None; + } + if !self.remaining.is_empty() { + self.remaining.remove(0); + } + self.current() + } +} + +/// The settings the launcher saved, for the places that need them without a window having loaded +/// them (a tray start, and a start that never got a window at all). +fn saved_settings(path: Option<&Path>) -> Option { + path.and_then(|path| settings_file::load(path, SETTINGS_KEY)) +} + +/// The language the startup-failure dialog speaks. +/// +/// The UI's language is set per frame from the saved preference (`LauncherUi::logic` calls +/// `i18n::set_current`), so a start that never got a frame has set nothing and `i18n::current()` +/// is still English: the dialog would answer a German user in English. Read the preference itself +/// instead. +/// +/// It is used as saved, without the UI's CJK-font gate (`effective_lang`): this dialog is a native +/// one, drawn with the system's own faces, so a language egui could not have drawn is readable. +fn startup_language(saved: Option) -> i18n::Lang { + saved.map(|settings| i18n::Lang::from_pref(&settings.language)).unwrap_or_else(i18n::current) +} + +/// Tells the user why no window appeared: the backend that was tried and the error wgpu reported +/// (#1081). The log file says the same thing, but someone whose launcher only ever fails to start +/// never sees a log, and a silent exit code 1 reads as "the launcher is broken" with nothing to +/// act on. +fn report_startup_failure(backend: Option, error: &eframe::Error, lang: i18n::Lang) { + let message = startup_failure_message(lang, &backend_label(backend), &error.to_string()); + log::error!("{message}"); + rfd::MessageDialog::new() + .set_title("ArtCraft Launcher") + .set_description(message) + .set_level(rfd::MessageLevel::Error) + .set_buttons(rfd::MessageButtons::Ok) + .show(); +} + +/// The startup-failure dialog's text in `lang`: the English message is the lookup key, and the +/// `@msg` row carries the placeholders over into the translation, as every status message does. +fn startup_failure_message(lang: i18n::Lang, backend: &str, error: &str) -> String { + let english = format!("ArtCraft Launcher couldn't start its window on {backend}: {error}"); + i18n::message(lang, &english) +} + +/// Names the backend set a start asked wgpu for, for the dialog. `WGPU_BACKEND` outranks the +/// fallback, so a start that names one is described by it. +fn backend_label(backends: Option) -> String { + match backends.or_else(eframe::wgpu::Backends::from_env) { + Some(backends) => name_backends(backends), + None => DEFAULT_BACKENDS_LABEL.to_owned(), + } +} + +/// "Direct3D 12 and OpenGL": the names users of the platform's graphics stack know. These are +/// proper names, so they stay in English in every language, like the app names. +fn name_backends(backends: eframe::wgpu::Backends) -> String { + use eframe::wgpu::Backends; + let names: Vec<&str> = [(Backends::VULKAN, "Vulkan"), (Backends::DX12, "Direct3D 12"), (Backends::METAL, "Metal"), (Backends::GL, "OpenGL")] + .into_iter() + .filter(|(backend, _)| backends.contains(*backend)) + .map(|(_, name)| name) + .collect(); + if names.is_empty() { "the graphics backend".to_owned() } else { names.join(" and ") } +} + +/// wgpu's own backend list, as [`wgpu_options`] configures it. The only other place that knows +/// which backends a start with no override asks for. +#[cfg(windows)] +const DEFAULT_BACKENDS_LABEL: &str = "Direct3D 12 and OpenGL"; +#[cfg(not(any(windows, target_os = "macos")))] +const DEFAULT_BACKENDS_LABEL: &str = "Vulkan and OpenGL"; +/// macOS leaves egui-wgpu's `PRIMARY | GL` mask alone, but that doesn't put OpenGL in reach: wgpu's +/// GL backend loads `libEGL.dylib`, which macOS doesn't ship, so it finds no OpenGL adapter to pick +/// and Metal is what a start there can use. The label names what can actually be tried. +#[cfg(target_os = "macos")] +const DEFAULT_BACKENDS_LABEL: &str = "Metal"; + +/// [`StartupBackends`]' order: wgpu's own list, then the fallback. +fn startup_plan(named_by_env: bool) -> Vec> { + match (named_by_env, fallback_backends()) { + (true, _) | (false, None) => vec![None], + (false, Some(fallback)) => vec![None, Some(fallback)], + } +} + +/// The backend a start falls back to when wgpu's own list can't create the UI pipeline, if the +/// platform has one to offer. +#[cfg(target_os = "macos")] +fn fallback_backends() -> Option { + // Metal is the only backend macOS has; a Metal failure has no second backend to fall back to. + None +} + +/// OpenGL, which draws the launcher everywhere else: it needs no vendor ICDs and no overlay +/// layers, and on Windows it is already the launcher's second choice (`wgpu_options`). Vulkan is +/// deliberately not tried, for the reason given there. +#[cfg(not(target_os = "macos"))] +fn fallback_backends() -> Option { + Some(eframe::wgpu::Backends::GL) +} + /// wgpu's backend list. On Windows that is Direct3D 12 with GL as the fallback, not Vulkan: /// Vulkan goes through vendor ICDs and third-party overlay layers, and on hybrid AMD laptops whose /// integrated and discrete GPUs run different driver packages (common on OEM machines, where the @@ -247,17 +400,16 @@ fn fit_limits(requested: eframe::wgpu::Limits, adapter: &eframe::wgpu::Limits) - /// the window is then stretched over it vertically by the compositor, blurring every horizontal /// edge and line of text. `WGPU_DX12_PRESENTATION_SYSTEM` still overrides it. #[cfg(windows)] -fn wgpu_options() -> eframe::WgpuConfiguration { +fn wgpu_options(backends: Option) -> eframe::WgpuConfiguration { use eframe::wgpu::{Backends, Dx12Compiler, Dx12SwapchainKind, PowerPreference}; let mut config = eframe::WgpuConfiguration::default(); pin_dx12_compiler(&mut config, Dx12Compiler::from_env()); if let eframe::egui_wgpu::WgpuSetup::CreateNew(setup) = &mut config.wgpu_setup { setup.instance_descriptor.backend_options.dx12.presentation_system = Dx12SwapchainKind::from_env().unwrap_or(Dx12SwapchainKind::DxgiFromVisual); - if let Some(backends) = Backends::from_env() { - setup.instance_descriptor.backends = backends; - } else { - setup.instance_descriptor.backends = Backends::DX12 | Backends::GL; + let named = Backends::from_env(); + setup.instance_descriptor.backends = named.or(backends).unwrap_or(Backends::DX12 | Backends::GL); + if named.is_none() { let integrated = setup.power_preference == PowerPreference::LowPower; setup.native_adapter_selector = Some(Arc::new(move |adapters, surface| { adapters @@ -315,10 +467,13 @@ fn adapter_rank(backend: eframe::wgpu::Backend, device_type: eframe::wgpu::Devic /// software rasterizer only wins when nothing else can draw. `WGPU_POWER_PREF` (`low`, `high` or /// `none`) still overrides it, and then wgpu picks the adapter itself. #[cfg(not(any(windows, target_os = "macos")))] -fn wgpu_options() -> eframe::WgpuConfiguration { +fn wgpu_options(backends: Option) -> eframe::WgpuConfiguration { use eframe::wgpu::{DeviceType, PowerPreference}; let mut config = eframe::WgpuConfiguration::default(); if let eframe::egui_wgpu::WgpuSetup::CreateNew(setup) = &mut config.wgpu_setup { + if let Some(backends) = backends { + setup.instance_descriptor.backends = backends; + } if let Some(preference) = PowerPreference::from_env() { setup.power_preference = preference; } else { @@ -339,13 +494,16 @@ fn wgpu_options() -> eframe::WgpuConfiguration { /// Returns wgpu's defaults, except that Intel Macs skip the indirect-call validation shaders /// ([`skips_indirect_validation`]). #[cfg(target_os = "macos")] -fn wgpu_options() -> eframe::WgpuConfiguration { +fn wgpu_options(backends: Option) -> eframe::WgpuConfiguration { use eframe::wgpu::InstanceFlags; let mut config = eframe::WgpuConfiguration::default(); - if let eframe::egui_wgpu::WgpuSetup::CreateNew(setup) = &mut config.wgpu_setup - && skips_indirect_validation(std::env::consts::OS, cfg!(target_arch = "x86_64")) - { - setup.instance_descriptor.flags = setup.instance_descriptor.flags.difference(InstanceFlags::VALIDATION_INDIRECT_CALL).with_env(); + if let eframe::egui_wgpu::WgpuSetup::CreateNew(setup) = &mut config.wgpu_setup { + if let Some(backends) = backends { + setup.instance_descriptor.backends = backends; + } + if skips_indirect_validation(std::env::consts::OS, cfg!(target_arch = "x86_64")) { + setup.instance_descriptor.flags = setup.instance_descriptor.flags.difference(InstanceFlags::VALIDATION_INDIRECT_CALL).with_env(); + } } config } @@ -1181,6 +1339,128 @@ mod tests { assert!(!shell.launcher.closed_to_tray); } + /// The failure dialog speaks the saved preference. A start that never got a frame has set no + /// language, so reading `i18n::current()` there would answer every user in English. + #[test] + fn the_failure_dialog_speaks_the_saved_language() { + let german = Settings { language: "de".to_owned(), ..Settings::default() }; + assert_eq!(startup_language(Some(german)), i18n::Lang::DE); + // `auto` follows the system, as the UI's own preference handling does. + let automatic = Settings { language: "auto".to_owned(), ..Settings::default() }; + assert_eq!(startup_language(Some(automatic)), i18n::system_lang()); + // Nothing saved: whatever this process already speaks. + assert_eq!(startup_language(None), i18n::current()); + } + + /// The dialog names the backend and the error, and a catalog translates the sentence while + /// carrying both placeholders' text over (#1081). + #[test] + fn the_startup_failure_message_names_the_backend_and_the_error() { + let error = "The parameter is incorrect. (0x80070057)"; + // English is the lookup key, so the dialog reads the same before a catalog has the row. + assert_eq!( + startup_failure_message(i18n::Lang::EN, "Direct3D 12", error), + "ArtCraft Launcher couldn't start its window on Direct3D 12: The parameter is incorrect. (0x80070057)" + ); + // A catalog translates the sentence and carries the two placeholders' text over. + assert_eq!( + startup_failure_message(i18n::Lang::DE, "Direct3D 12", error), + "ArtCraft Launcher konnte sein Fenster auf Direct3D 12 nicht starten: The parameter is incorrect. (0x80070057)" + ); + assert_eq!( + startup_failure_message(i18n::Lang::JA, "OpenGL", error), + "ArtCraft Launcher のウィンドウを OpenGL で起動できませんでした: The parameter is incorrect. (0x80070057)" + ); + } + + /// The dialog names what the attempt actually asked wgpu for, not a fixed list. + #[test] + fn the_dialog_names_the_backend_it_tried() { + use eframe::wgpu::Backends; + assert_eq!(name_backends(Backends::GL), "OpenGL"); + assert_eq!(name_backends(Backends::DX12 | Backends::GL), "Direct3D 12 and OpenGL"); + assert_eq!(name_backends(Backends::VULKAN | Backends::GL), "Vulkan and OpenGL"); + // An attempt that names no backend is the platform's own list (`wgpu_options`). + if Backends::from_env().is_none() { + assert_eq!(backend_label(None), DEFAULT_BACKENDS_LABEL); + } + // The fallback names itself. + assert_eq!(backend_label(Some(Backends::GL)), "OpenGL"); + } + + /// A renderer that couldn't be created is retried once, on the fallback, and then the + /// launcher reports the failure. macOS has no second backend, so it retries nothing. + #[test] + fn a_renderer_that_cannot_start_is_retried_on_the_fallback() { + // What eframe returns when the driver refuses the UI pipeline (#111, #1081). + let failure = || eframe::Error::Wgpu(eframe::egui_wgpu::WgpuError::NoSurfaceFormatsAvailable); + let mut backends = StartupBackends::new(false); + assert_eq!(backends.current(), None, "the first attempt uses wgpu's own backend list"); + match fallback_backends() { + Some(fallback) => { + assert_eq!(backends.after_failure(&failure()), Some(fallback)); + // The fallback is the last try: a driver that fails it too ends the launcher. + assert_eq!(backends.after_failure(&failure()), None); + } + // Metal is the only backend macOS has. + None => assert_eq!(backends.after_failure(&failure()), None), + } + } + + /// `WGPU_BACKEND` is the user's own choice, so a failure on it ends the start rather than + /// being overruled by the fallback. + #[test] + fn a_start_that_names_a_backend_is_not_overruled() { + // `WGPU_BACKEND` is the user's own choice, so a failure on it ends the start. + assert_eq!(startup_plan(true), vec![None]); + let mut backends = StartupBackends::new(true); + let failure = eframe::Error::Wgpu(eframe::egui_wgpu::WgpuError::NoSurfaceFormatsAvailable); + assert_eq!(backends.after_failure(&failure), None); + } + + /// Only a renderer failure earns another backend: a window that failed for another reason + /// fails the same way on all of them, and retrying would bury its error. + #[test] + fn a_window_that_fails_for_another_reason_is_not_retried() { + // No event loop, no display: every backend fails the same way, and retrying would only + // bury the first error. + let mut backends = StartupBackends::new(false); + let error = eframe::Error::AppCreation(Box::new(std::io::Error::other("no window"))); + assert_eq!(backends.after_failure(&error), None); + } + + /// The fallback is OpenGL wherever it exists, never Vulkan (`wgpu_options` says why). + #[cfg(not(target_os = "macos"))] + #[test] + fn the_fallback_backend_is_opengl() { + // Direct3D 12 and Vulkan both fail the UI pipeline on drivers where OpenGL draws fine + // (#111, #1081), and Vulkan is deliberately not a Windows backend (see `wgpu_options`). + assert_eq!(fallback_backends(), Some(eframe::wgpu::Backends::GL)); + } + + /// A fallback attempt configures wgpu with GL alone, rather than the default list — read + /// through `native_options`, so a regression that drops the attempt before `run_native` fails + /// here instead of retrying the backend that just failed. + #[cfg(windows)] + #[test] + fn a_fallback_attempt_starts_only_that_backend() { + use eframe::egui_wgpu::WgpuSetup; + /// The backend list `native_options` asks wgpu for: the path a start actually takes. + fn backends(requested: Option) -> eframe::wgpu::Backends { + match native_options(false, requested).wgpu_options.wgpu_setup { + WgpuSetup::CreateNew(setup) => setup.instance_descriptor.backends, + WgpuSetup::Existing(_) => panic!("the launcher creates its own wgpu instance"), + } + } + if eframe::wgpu::Backends::from_env().is_some() { + // `WGPU_BACKEND` outranks the fallback, and `a_start_that_names_a_backend_is_not_overruled` + // covers that it is then the only attempt. + return; + } + assert_eq!(backends(None), eframe::wgpu::Backends::DX12 | eframe::wgpu::Backends::GL); + assert_eq!(backends(Some(eframe::wgpu::Backends::GL)), eframe::wgpu::Backends::GL); + } + #[test] fn intel_macs_skip_the_indirect_validation_shaders() { // Metal's compiler fails on them on Intel Iris Macs, losing the device (#344). @@ -1202,7 +1482,7 @@ mod tests { WgpuSetup::Existing(_) => panic!("the launcher creates its own wgpu instance"), } } - let launcher = flags(wgpu_options()); + let launcher = flags(wgpu_options(None)); if !cfg!(target_arch = "x86_64") { // Apple silicon keeps wgpu's flags. assert_eq!(launcher, flags(eframe::WgpuConfiguration::default())); @@ -1266,7 +1546,7 @@ mod tests { #[test] fn linux_draws_on_the_desktops_gpu_unless_told_otherwise() { use eframe::wgpu::PowerPreference; - let config = wgpu_options(); + let config = wgpu_options(None); let eframe::egui_wgpu::WgpuSetup::CreateNew(setup) = &config.wgpu_setup else { panic!("the launcher creates its own wgpu instance"); }; diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index c518d780..de9b083f 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -16,3 +16,13 @@ serde_json = { workspace = true } semver = { workspace = true } # Calendar conversion (jiff); see AGENTS.md. Only civil-date math is used, no time zone. jiff = { workspace = true } + +# Signed website catalog (all dependencies are on the licence allowlist). +base64 = "0.22" +ed25519-dalek = { version = "2.2", default-features = false, features = ["std", "fast", "pem"] } +sha2 = "0.10" +toml = { version = "=1.1.8", default-features = false, features = ["parse", "serde", "std"] } + +[build-dependencies] +serde = { workspace = true } +toml = { version = "=1.1.8", default-features = false, features = ["parse", "serde", "std"] } diff --git a/crates/core/assets/launcher-catalog-public-key.pem b/crates/core/assets/launcher-catalog-public-key.pem new file mode 100644 index 00000000..d4dded92 --- /dev/null +++ b/crates/core/assets/launcher-catalog-public-key.pem @@ -0,0 +1,3 @@ +-----BEGIN PUBLIC KEY----- +MCowBQYDK2VwAyEASIYrY9GbHPPdZ/URfx25unSh+FHvcQoayxfVvyga4WY= +-----END PUBLIC KEY----- diff --git a/crates/core/build.rs b/crates/core/build.rs new file mode 100644 index 00000000..e07706ae --- /dev/null +++ b/crates/core/build.rs @@ -0,0 +1,111 @@ +#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] + +use serde::Deserialize; +use std::{env, error::Error, fmt::Write as _, fs, path::PathBuf}; + +#[derive(Deserialize)] +struct Manifest { + apps: Vec, +} +#[derive(Deserialize)] +struct App { + id: String, + name: String, + tagline: String, + color: [u8; 3], + ink_light: [u8; 3], + ink_dark: [u8; 3], + repo: String, + former_ids: Vec, + former_names: Vec, + kind: String, + publisher: String, + msi_publisher: Option, + bundle: Option, + former_bundles: Vec, + site: Option, + mac_team: Option, + mac_bundle_name: Option, + details: Option
, +} +#[derive(Deserialize)] +struct Details { + headline: String, + about: String, + platforms: String, + #[serde(default)] + features: Vec, + #[serde(default)] + shots: Vec, +} +#[derive(Deserialize)] +struct Feature { + title: String, + text: String, +} +#[derive(Deserialize)] +struct Shot { + key: String, + caption: String, +} +fn optional(s: &Option) -> String { + s.as_ref().map_or_else(|| "None".to_owned(), |v| format!("Some({v:?})")) +} +fn slice(items: &[String]) -> String { + format!("&{items:?}") +} +fn main() -> Result<(), Box> { + println!("cargo:rerun-if-changed=catalog.toml"); + let manifest: Manifest = toml::from_str(&fs::read_to_string("catalog.toml")?)?; + let mut apps = format!("pub const SUITE: [CraftApp; {}] = [\n", manifest.apps.len()); + let count = manifest.apps.iter().filter(|a| a.details.is_some()).count(); + let mut details = format!("pub const DETAILS: [AppDetails; {count}] = [\n"); + for app in &manifest.apps { + let kind = match app.kind.as_str() { + "official" => "Official", + "community" => "Community", + _ => return Err(format!("unknown app kind for {}", app.id).into()), + }; + writeln!( + apps, + "CraftApp {{ id: {:?}, name: {:?}, tagline: {:?}, color: {:?}, ink_light: {:?}, ink_dark: {:?}, repo: {:?}, former_ids: {}, former_names: {}, kind: AppKind::{kind}, publisher: {:?}, msi_publisher: {}, bundle: {}, former_bundles: {}, site: {}, mac_team: {}, mac_bundle_name: {} }},", + app.id, + app.name, + app.tagline, + app.color, + app.ink_light, + app.ink_dark, + app.repo, + slice(&app.former_ids), + slice(&app.former_names), + app.publisher, + optional(&app.msi_publisher), + optional(&app.bundle), + slice(&app.former_bundles), + optional(&app.site), + optional(&app.mac_team), + optional(&app.mac_bundle_name) + )?; + if let Some(d) = &app.details { + write!( + details, + "AppDetails {{ id: {:?}, headline: {:?}, about: {:?}, platforms: {:?}, features: &[", + app.id, d.headline, d.about, d.platforms + )?; + for f in &d.features { + write!(details, "feature({:?}, {:?}),", f.title, f.text)?; + } + write!(details, "], shots: &[")?; + for s in &d.shots { + write!(details, "shot({:?}, {:?}),", s.key, s.caption)?; + } + writeln!(details, "] }},")?; + } + } + apps.push_str("];\n"); + details.push_str("];\n"); + let out = PathBuf::from(env::var_os("OUT_DIR").ok_or("OUT_DIR missing")?); + fs::write(out.join("catalog.rs"), apps)?; + fs::write(out.join("details.rs"), details)?; + Ok(()) +} diff --git a/crates/core/catalog.toml b/crates/core/catalog.toml new file mode 100644 index 00000000..b87699ce --- /dev/null +++ b/crates/core/catalog.toml @@ -0,0 +1,1045 @@ +# ArtCraft Launcher catalog, served at https://getartcraft.com/launcher-catalog.toml. +# Source: storytold/craft-launcher at c6362817864df42d1fbfa105d3aaca9f728d434c +# Generated by scripts/sync-launcher-catalog.py; preserve the existing TOML schema. +# Verify launcher-catalog.toml.sig with the launcher's pinned Ed25519 key before use. +# Install sources must still follow the launcher's approved-source policy. + +[[apps]] +color = [47, 123, 245] +former_bundles = [] +former_ids = [] +former_names = [] +id = "photocraft" +binary = "photocraft" +flatpak_id = "ai.storyteller.photocraft" +mac_bundle_id = "ai.storyteller.photocraft" +mac_bundle_name = "PhotoCraft" +website = "https://getartcraft.com/apps/photocraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "photocraft" +rpm_package = "photocraft" +desktop_categories = ["Graphics", "2DGraphics", "RasterGraphics", "Photography"] +startup_wm_class = "photocraft" +icon_url = "https://getartcraft.com/launcher-app-icons/photocraft-f1afe9ccdb125a34089babecb6c1533f3fbf41ddffe81e0856f158c5b5fb9389.png" +icon_sha256 = "f1afe9ccdb125a34089babecb6c1533f3fbf41ddffe81e0856f158c5b5fb9389" +ink_dark = [127, 176, 255] +ink_light = [26, 91, 196] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "PhotoCraft" +publisher = "ArtCraft" +repo = "storytold/photocraft" +tagline = "Image editing" +[apps.details] +headline = "The image editor you already know how to use." +about = "Layers, masks, adjustment layers, layer styles, type, vectors and brushes in a native app. Open source, offline, and yours.\n\nPhotoCraft keeps the menus, shortcuts and panels your hands already know, so there is nothing to relearn." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "No Electron and no web view: a fast native compositor." +title = "Native GPU canvas" +[[apps.details.features]] +text = "Opens and saves layered PSD and PSB documents." +title = "Real layered files" +[[apps.details.features]] +text = "Adjustment layers, live-preview filters, smart objects and layer styles." +title = "Non-destructive editing" +[[apps.details.features]] +text = "Subject and object selection and mask refinement run locally." +title = "On-device selection" +[[apps.details.features]] +text = "8-, 16- and 32-bit RGB, CMYK, Lab and Grayscale, with ICC color management and soft proofing." +title = "Serious color" +[[apps.details.shots]] +caption = "Curves and type layers" +key = "demo" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/demo.jpg" +[[apps.details.shots]] +caption = "Levels with a live histogram" +key = "adjustments" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/adjustments.jpg" +[[apps.details.shots]] +caption = "Layer styles on live type" +key = "layer-styles" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/layer-styles.jpg" +[[apps.details.shots]] +caption = "Selections and masked adjustments" +key = "masks" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/masks.jpg" + +[[apps]] +color = [232, 87, 63] +former_bundles = [] +former_ids = [] +former_names = [] +id = "vectorcraft" +binary = "vectorcraft" +flatpak_id = "ai.storyteller.vectorcraft" +mac_bundle_id = "ai.storyteller.vectorcraft" +mac_bundle_name = "VectorCraft" +website = "https://getartcraft.com/apps/vectorcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "vectorcraft" +rpm_package = "vectorcraft" +desktop_categories = ["Graphics", "2DGraphics", "VectorGraphics"] +startup_wm_class = "ai.storyteller.vectorcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/vectorcraft-47f2061e3683ba8e7241c4783ca02207d29dfef0a7c94cd0eb8ea0a88dfc0b1e.png" +icon_sha256 = "47f2061e3683ba8e7241c4783ca02207d29dfef0a7c94cd0eb8ea0a88dfc0b1e" +ink_dark = [255, 138, 112] +ink_light = [184, 58, 36] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "VectorCraft" +publisher = "ArtCraft" +repo = "storytold/vectorcraft" +tagline = "Vector illustration" +[apps.details] +headline = "Vector illustration, with familiar tools and editable effects." +about = "A native vector illustration app with the pen, panels and shortcuts illustrators expect. Open source, and it also runs in a browser." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Pen, direct selection, shape booleans, snapping guides and an appearance panel, laid out the way you expect." +title = "The workflow you know" +[[apps.details.features]] +text = "Drawings with thousands of shapes stay responsive on a retina display." +title = "Genuinely fast" +[[apps.details.features]] +text = "Shape booleans work on the exact curves, so there is no \"cannot perform operation\", and undo is unlimited." +title = "Booleans that don't fail" +[[apps.details.features]] +text = "Blends, envelope distort, gradient mesh, repeats, glows and drop shadows all stay editable." +title = "Live, editable effects" +[[apps.details.features]] +text = "Turn raster images into clean vector paths, with presets for the common cases." +title = "Image tracing" +[[apps.details.features]] +text = "Native JSON documents, SVG and PDF import and export, and PNG, JPEG and WebP output." +title = "Open formats" +[[apps.details.shots]] +caption = "The Neon Drive poster" +key = "neon" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/neon.jpg" +[[apps.details.shots]] +caption = "Live blends" +key = "ribbons" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/ribbons.jpg" +[[apps.details.shots]] +caption = "A feature sheet and the Layers panel" +key = "sheet" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/sheet.jpg" +[[apps.details.shots]] +caption = "Pathfinder and exact booleans" +key = "bezier" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/bezier.jpg" + +[[apps]] +color = [139, 92, 246] +former_bundles = [] +former_ids = [] +former_names = [] +id = "filmcraft" +binary = "filmcraft" +flatpak_id = "ai.storyteller.filmcraft" +mac_bundle_id = "ai.storyteller.filmcraft" +mac_bundle_name = "FilmCraft" +website = "https://getartcraft.com/apps/filmcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "filmcraft" +rpm_package = "filmcraft" +desktop_categories = ["AudioVideo", "Video", "AudioVideoEditing"] +startup_wm_class = "ai.storyteller.filmcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/filmcraft-7ca8adb57a34d1f4bff8c7e976ac5fe73e69a89b4268d15b3b861c7e51c45a74.png" +icon_sha256 = "7ca8adb57a34d1f4bff8c7e976ac5fe73e69a89b4268d15b3b861c7e51c45a74" +ink_dark = [182, 156, 255] +ink_light = [106, 63, 214] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "FilmCraft" +publisher = "ArtCraft" +repo = "storytold/filmcraft" +tagline = "Video editing, color and sound" +[apps.details] +headline = "Professional video editing, rebuilt from scratch." +about = "A native video editor with source and program monitors, a real timeline and every trim mode." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Source and program monitors, three-point editing, every trim mode and J/K/L trimming." +title = "A timeline you already know" +[[apps.details.features]] +text = "An integer timebase keeps 23.976 and 29.97 drop-frame footage exact, with no drift." +title = "Frame-exact time" +[[apps.details.features]] +text = "No FFmpeg inside: native support for H.264, HEVC, ProRes, VP9, AAC and Opus." +title = "Its own codecs" +[[apps.details.features]] +text = "Curves, color wheels, HSL secondaries, LUTs and HDR and log workflows, with scopes to check the result." +title = "Color grading" +[[apps.details.features]] +text = "Video effects and transitions, keyframes with value and velocity graphs, and a linear-light GPU compositor." +title = "Effects and keyframes" +[[apps.details.features]] +text = "EBU R128 loudness meters, a mixer with automation and native audio effects." +title = "Broadcast-ready audio" +[[apps.details.shots]] +caption = "The Color workspace, with scopes" +key = "color" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/filmcraft/color.jpg" +[[apps.details.shots]] +caption = "The Assembly workspace" +key = "assembly" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/filmcraft/assembly.jpg" +[[apps.details.shots]] +caption = "Keyframes in Effect Controls" +key = "keyframes" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/filmcraft/keyframes.jpg" + +[[apps]] +color = [242, 165, 22] +former_bundles = [] +former_ids = [] +former_names = [] +id = "lightcraft" +binary = "lightcraft" +flatpak_id = "ai.storyteller.lightcraft" +mac_bundle_id = "ai.storyteller.lightcraft" +mac_bundle_name = "LightCraft" +website = "https://getartcraft.com/apps/lightcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "lightcraft" +rpm_package = "lightcraft" +desktop_categories = ["Graphics", "2DGraphics", "RasterGraphics", "Photography"] +startup_wm_class = "ai.storyteller.lightcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/lightcraft-a1fc54a714b769fa627eb44b0dcc1230e5fc3643890fd3504811b4c05c4a913a.png" +icon_sha256 = "a1fc54a714b769fa627eb44b0dcc1230e5fc3643890fd3504811b4c05c4a913a" +ink_dark = [255, 193, 77] +ink_light = [138, 88, 0] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "LightCraft" +publisher = "ArtCraft" +repo = "storytold/lightcraft" +tagline = "Photo library and raw development" +[apps.details] +headline = "Your photos. Your pixels. Your machine." +about = "A fast photo library and non-destructive raw developer. No account, no cloud, no telemetry and no subscription." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "A wide-gamut, 32-bit float pipeline that never touches your originals." +title = "Non-destructive by design" +[[apps.details.features]] +text = "Light, color, effects, tone curve, a color mixer, color grading wheels and built-in presets." +title = "Every control you reach for" +[[apps.details.features]] +text = "Brush, gradient and range masks, plus sky, subject and background masks." +title = "Precise masking" +[[apps.details.features]] +text = "Support for the main camera raw formats: DNG, CR2, ARW, NEF, RAF, RW2, PEF and ORF." +title = "Native raw decoding" +[[apps.details.features]] +text = "Albums, ratings, flags and search, with grids that stay smooth on large catalogs." +title = "A library that keeps up" +[[apps.details.features]] +text = "The GPU pipeline updates the preview as you move a slider, even on large raw files." +title = "Instant feedback" +[[apps.details.shots]] +caption = "The Edit view" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/hero.jpg" +[[apps.details.shots]] +caption = "The tone curve" +key = "curve" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/curve.jpg" +[[apps.details.shots]] +caption = "Color grading wheels" +key = "grading" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/grading.jpg" +[[apps.details.shots]] +caption = "A radial mask over a sky mask" +key = "masking" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/masking.jpg" + +[[apps]] +color = [232, 32, 79] +former_bundles = [] +former_ids = ["printcraft"] +former_names = ["PrintCraft"] +id = "pdfcraft" +binary = "pdfcraft" +flatpak_id = "ai.storyteller.pdfcraft" +mac_bundle_id = "ai.storyteller.pdfcraft" +mac_bundle_name = "PdfCraft" +website = "https://getartcraft.com/apps/pdfcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "pdfcraft" +rpm_package = "pdfcraft" +desktop_categories = ["Office", "Viewer"] +startup_wm_class = "pdfcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/pdfcraft-1933bbeaea290497facd328e917dafcc433d0c0caa9f1e207aa45ac1e430898c.png" +icon_sha256 = "1933bbeaea290497facd328e917dafcc433d0c0caa9f1e207aa45ac1e430898c" +ink_dark = [242, 58, 98] +ink_light = [183, 2, 40] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "PdfCraft" +publisher = "ArtCraft" +repo = "storytold/pdfcraft" +tagline = "Reading, organizing and protecting PDFs" +[apps.details] +headline = "The open-source PDF workbench." +about = "Read, organize, combine, split and secure PDFs in a fast, native app. No account, no telemetry and no cloud." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "World scripts, vertical Japanese, color emoji and transparency." +title = "Faithful rendering" +[[apps.details.features]] +text = "Instant find, and text selection that follows the document's real reading order." +title = "Search as you type" +[[apps.details.features]] +text = "Rotate, delete, insert and reorder pages, with deep undo behind every change." +title = "Organize like cards" +[[apps.details.features]] +text = "Assemble and break apart documents while keeping links, form fields, layers and bookmarks intact." +title = "Combine, extract, split" +[[apps.details.features]] +text = "Incremental, atomic saves with autosave and crash recovery." +title = "Fearless saves" +[[apps.details.features]] +text = "Opens files from RC4 to AES-256 encryption and honors the author's permissions." +title = "Built-in security" + +[[apps]] +color = [224, 54, 143] +former_bundles = [] +former_ids = [] +former_names = [] +id = "effectcraft" +binary = "effectcraft" +flatpak_id = "ai.storyteller.effectcraft" +mac_bundle_id = "ai.storyteller.effectcraft" +mac_bundle_name = "EffectCraft" +website = "https://getartcraft.com/apps/effectcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "effectcraft" +rpm_package = "effectcraft" +desktop_categories = ["AudioVideo", "Video", "Graphics", "2DGraphics"] +startup_wm_class = "ai.storyteller.effectcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/effectcraft-4ad7caa4f43b4cbf3bcddda0ed23e471d392efbe8d0b4ce18107b5849f20dd2d.png" +icon_sha256 = "4ad7caa4f43b4cbf3bcddda0ed23e471d392efbe8d0b4ce18107b5849f20dd2d" +ink_dark = [255, 122, 184] +ink_light = [176, 32, 108] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "EffectCraft" +publisher = "ArtCraft" +repo = "storytold/effectcraft" +tagline = "Motion graphics and visual effects" +[apps.details] +headline = "Motion graphics and visual effects." +about = "A native compositor with compositions, layers, keyframes, effects, expressions, 3D cameras and lights, and a render queue. Young, moving fast, and already usable." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Familiar panels and keyframes (linear, bezier, hold and eased), with a graph editor for value and speed curves." +title = "Animate the way you know" +[[apps.details.features]] +text = "Solids, shapes, text, footage, nested compositions, nulls and adjustment layers, with parenting, track mattes and blend modes." +title = "Layers of every kind" +[[apps.details.features]] +text = "Blur, color correction, distortion, generators, keying, particles and simulation, stylize and time effects." +title = "A large effects library" +[[apps.details.features]] +text = "3D layers with cameras, depth of field, and lights that cast soft ray-traced shadows." +title = "Real 3D" +[[apps.details.features]] +text = "JavaScript expressions with wiggle, loops and layer references, edited inline." +title = "Expressions" +[[apps.details.features]] +text = "H.264 and ProRes with alpha, PNG, TIFF and EXR sequences, GIF, and Lottie import and export." +title = "Export anywhere" +[[apps.details.shots]] +caption = "An animated composition" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/hero.jpg" +[[apps.details.shots]] +caption = "The Graph Editor" +key = "graph" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/graph.jpg" +[[apps.details.shots]] +caption = "Particles and Effect Controls" +key = "effects" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/effects.jpg" +[[apps.details.shots]] +caption = "3D layers with cameras and lights" +key = "3d" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/3d.jpg" + +[[apps]] +color = [218, 198, 4] +former_bundles = [] +former_ids = [] +former_names = [] +id = "anicraft" +binary = "anicraft" +flatpak_id = "ai.storyteller.anicraft" +mac_bundle_id = "ai.storyteller.anicraft" +mac_bundle_name = "AniCraft" +website = "https://github.com/storytold/anicraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "anicraft" +rpm_package = "anicraft" +desktop_categories = ["Graphics", "2DGraphics", "VectorGraphics", "AudioVideo"] +startup_wm_class = "anicraft" +icon_url = "https://getartcraft.com/launcher-app-icons/anicraft-e6754980d8a2a4acd429f6e3e3ba5569c4a761a45102a81d7edc0ef35210ce47.png" +icon_sha256 = "e6754980d8a2a4acd429f6e3e3ba5569c4a761a45102a81d7edc0ef35210ce47" +ink_dark = [232, 216, 74] +ink_light = [112, 101, 0] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "AniCraft" +publisher = "ArtCraft" +repo = "storytold/anicraft" +site = "https://github.com/storytold/anicraft" +tagline = "2D vector animation" +[apps.details] +headline = "Vector animation on a timeline you know." +about = "Open-source 2D vector animation, built in pure Rust." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening." +title = "Familiar by design" +[[apps.details.features]] +text = "Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another." +title = "Tweens that ease" +[[apps.details.features]] +text = "Graphic symbols and movie clips with nested timelines and loop modes, mask and guide layers, filters, blend modes and scenes." +title = "Symbols and scenes" +[[apps.details.features]] +text = "Pen, Pencil with curve fitting, shapes, text, Paint Bucket and Ink Bottle, with Bézier anchors and handles you edit point by point." +title = "Real vector tools" +[[apps.details.features]] +text = "Opens .fla and .xfl documents and imports SVG. Exports PNG sequences, GIF, SVG frames, sprite sheets, Lottie, and WebM or MP4 through your own FFmpeg." +title = "Open formats" +[[apps.details.features]] +text = "Every action is an engine command, so the CLI, a JSON-lines channel and an MCP server can draw, animate and export the way a person does." +title = "Agent-ready" + +[[apps]] +color = [123, 181, 28] +former_bundles = [] +former_ids = [] +former_names = [] +id = "designcraft" +binary = "designcraft" +flatpak_id = "ai.storyteller.designcraft" +mac_bundle_id = "ai.storyteller.designcraft" +mac_bundle_name = "DesignCraft" +website = "https://getartcraft.com/apps/designcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "designcraft" +rpm_package = "designcraft" +desktop_categories = ["Graphics", "Publishing"] +startup_wm_class = "ai.storyteller.designcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/designcraft-0895763da92947cb6b1d38a018a6c7ffcda1cbb714a58f2e9bc08e0e2a2b94b4.png" +icon_sha256 = "0895763da92947cb6b1d38a018a6c7ffcda1cbb714a58f2e9bc08e0e2a2b94b4" +ink_dark = [166, 224, 74] +ink_light = [69, 112, 8] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "DesignCraft" +publisher = "ArtCraft" +repo = "storytold/designcraft" +tagline = "Page layout and publishing" +[apps.details] +headline = "Page layout and publishing." +about = "A native layout app with spreads, parent pages, threaded stories, styles, swatches, text wrap and a paragraph composer. No subscription, no license server and no telemetry." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Spreads and parent pages, frames and threaded stories, with paragraph and character styles." +title = "The layout tools you know" +[[apps.details.features]] +text = "A Knuth–Plass paragraph composer, dictionary hyphenation, optical margin alignment and baseline grids, with line breaks that match on screen and in PDF." +title = "Beautiful type" +[[apps.details.features]] +text = "Real selectable text with embedded fonts, CMYK and spot colors, bleed, crop marks and PDF/A output." +title = "Print-ready PDF" +[[apps.details.features]] +text = "Multithreaded rendering, instant undo and cached text composition." +title = "Fast" +[[apps.details.features]] +text = "A documented native format, PNG export and layout interchange import and export." +title = "Open formats" +[[apps.details.features]] +text = "Every menu item, tool, panel and dialog can be driven over a JSON control channel and an MCP server." +title = "Built for automation" +[[apps.details.shots]] +caption = "A magazine spread with a threaded story" +key = "spread" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/designcraft/spread.jpg" + +[[apps]] +color = [2, 218, 150] +former_bundles = [] +former_ids = [] +former_names = [] +id = "figcraft" +binary = "figcraft" +flatpak_id = "ai.storyteller.figcraft" +mac_bundle_id = "ai.storyteller.figcraft" +mac_bundle_name = "FigCraft" +website = "https://getartcraft.com/apps/figcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "figcraft" +rpm_package = "figcraft" +desktop_categories = ["Graphics", "2DGraphics", "VectorGraphics", "X-Design"] +startup_wm_class = "figcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/figcraft-13d5236adb30c2bd4ff3eb7bcb7bb5a70d8de2ef36a81a5ffaf43ea171c7f51b.png" +icon_sha256 = "13d5236adb30c2bd4ff3eb7bcb7bb5a70d8de2ef36a81a5ffaf43ea171c7f51b" +ink_dark = [79, 232, 182] +ink_light = [4, 122, 86] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "FigCraft" +publisher = "ArtCraft" +repo = "storytold/figcraft" +tagline = "Interface design and prototyping" +[apps.details] +headline = "Interface design and prototyping." +about = "Design screens, components and prototypes in a native app that opens instantly and works offline, with no account and no telemetry. Early alpha." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Rows, columns, wrap and grids with padding, gaps and Hug, Fill or Fixed sizing, plus constraints and layout grids." +title = "Auto layout" +[[apps.details.features]] +text = "Instances with overrides, variants and properties, styles, and variables with modes bound to fills, strokes and effects." +title = "Components" +[[apps.details.features]] +text = "Real vector networks, the pen and pencil, the shape builder, editable booleans and variable width strokes." +title = "Vectors" +[[apps.details.features]] +text = "Connections, triggers and animated transitions, variables with conditionals, flows and a presentation view with device frames." +title = "Prototypes" +[[apps.details.features]] +text = "Inspect mode with measurements, annotations, ready-for-dev status, and code for CSS, HTML, React, SwiftUI and Compose." +title = "Hand off" +[[apps.details.features]] +text = "Plain .figcraft files on your own disk. SVG, PNG, JPEG, WebP and PDF in and out, and .fig files open, best effort." +title = "Your files" + +[[apps]] +color = [31, 165, 201] +former_bundles = [] +former_ids = [] +former_names = [] +id = "soundcraft" +binary = "soundcraft" +flatpak_id = "ai.storyteller.soundcraft" +mac_bundle_id = "ai.storyteller.soundcraft" +mac_bundle_name = "SoundCraft" +website = "https://getartcraft.com/apps/soundcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "soundcraft" +rpm_package = "soundcraft" +desktop_categories = ["AudioVideo", "Audio", "Midi", "Mixer", "Sequencer", "Recorder"] +startup_wm_class = "ai.storyteller.soundcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/soundcraft-0e7f4f83d82f5539530f62f85ccf8717dcc00c6d25a3dba57e2a65111e3b248b.png" +icon_sha256 = "0e7f4f83d82f5539530f62f85ccf8717dcc00c6d25a3dba57e2a65111e3b248b" +ink_dark = [95, 208, 238] +ink_light = [14, 114, 144] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "SoundCraft" +publisher = "ArtCraft" +repo = "storytold/soundcraft" +tagline = "Recording, editing and mixing audio" +[apps.details] +headline = "Record, edit and mix your audio." +about = "A digital audio workstation that follows the workflow audio engineers already know: an Edit window for arranging and editing, and a Mix window for balancing. Pre-alpha." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Shuffle, Slip, Spot and Grid modes, Smart, Grabber, Trim and other tools, fades and crossfades, playlists with comping lanes and clip gain." +title = "Editing" +[[apps.details.features]] +text = "Faders and pans with automation, sends, busses, aux inputs, VCA masters, routing folders and automatic plugin delay compensation." +title = "Mixing" +[[apps.details.features]] +text = "Volume, pan, mute, send and every plugin parameter, with Write, Touch, Latch and Trim passes recorded live from the faders." +title = "Automation" +[[apps.details.features]] +text = "EQ, dynamics, reverbs, modulation effects, a subtractive synth and a drum synth, all original, and CLAP plugins load too." +title = "Plugins" +[[apps.details.shots]] +caption = "The Edit window with a nine-track session" +key = "edit" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/edit.jpg" +[[apps.details.shots]] +caption = "The Mix window" +key = "mix" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/mix.jpg" +[[apps.details.shots]] +caption = "Automation and memory locations" +key = "automation" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/automation.jpg" +[[apps.details.shots]] +caption = "The Score Editor" +key = "score" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/score.jpg" + +[[apps]] +color = [63, 95, 224] +former_bundles = [] +former_ids = [] +former_names = [] +id = "wordcraft" +binary = "wordcraft" +flatpak_id = "ai.storyteller.wordcraft" +mac_bundle_id = "ai.storyteller.wordcraft" +mac_bundle_name = "WordCraft" +website = "https://getartcraft.com/apps/wordcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "wordcraft" +rpm_package = "wordcraft" +desktop_categories = ["Office", "WordProcessor"] +startup_wm_class = "ai.storyteller.wordcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/wordcraft-96505c7153c1b8a7e0cf0f90353fae669f4ed9de5524ba50ba99af79003cff43.png" +icon_sha256 = "96505c7153c1b8a7e0cf0f90353fae669f4ed9de5524ba50ba99af79003cff43" +ink_dark = [142, 162, 255] +ink_light = [42, 68, 184] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "WordCraft" +publisher = "ArtCraft" +repo = "storytold/wordcraft" +tagline = "Writing and document design" +[apps.details] +headline = "The familiar word processor, native and offline." +about = "A word processor with the ribbon, shortcuts and behavior you already know. Open source, and built from public specifications." +platforms = "macOS, Windows, Linux, BSD, web" +[[apps.details.features]] +text = "Ribbon tabs and groups, a live Styles gallery and the editing behavior you expect, from list continuation to Format Painter." +title = "Familiar" +[[apps.details.features]] +text = "Opens and saves .docx, and also .odt, .rtf, .html, .md, .tex and .txt. Opens older .doc files and exports PDF with real, selectable text." +title = "Your files" +[[apps.details.features]] +text = "Paragraph layout is cached, so typing stays responsive even in long documents." +title = "Fast" +[[apps.details.features]] +text = "Spelling, grammar and everything else work offline." +title = "Private" +[[apps.details.features]] +text = "Work on macOS, Windows, Linux, BSD and the web." +title = "Everywhere" +[[apps.details.features]] +text = "Every action is a command, driven from the ribbon, shortcuts, a command-line tool, a JSON control channel or an MCP server." +title = "Built for agents" +[[apps.details.shots]] +caption = "The Home tab and the Navigation pane" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/hero.jpg" +[[apps.details.shots]] +caption = "Track Changes and comments" +key = "review" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/review.jpg" +[[apps.details.shots]] +caption = "The Design tab" +key = "design" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/design.jpg" +[[apps.details.shots]] +caption = "The Layout tab" +key = "layout" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/layout.jpg" + +[[apps]] +color = [240, 122, 30] +former_bundles = [] +former_ids = [] +former_names = [] +id = "deckcraft" +binary = "deckcraft" +flatpak_id = "ai.storyteller.deckcraft" +mac_bundle_id = "ai.storyteller.deckcraft" +mac_bundle_name = "DeckCraft" +website = "https://getartcraft.com/apps/deckcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "deckcraft" +rpm_package = "deckcraft" +desktop_categories = ["Office", "Presentation"] +startup_wm_class = "ai.storyteller.deckcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/deckcraft-1bf98b43bb0b21cb038ce063e71b9922e7f48c10d5b99afd046aa6c30642ca69.png" +icon_sha256 = "1bf98b43bb0b21cb038ce063e71b9922e7f48c10d5b99afd046aa6c30642ca69" +ink_dark = [255, 160, 96] +ink_light = [168, 79, 10] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "DeckCraft" +publisher = "ArtCraft" +repo = "storytold/deckcraft" +tagline = "Presentations and slide shows" +[apps.details] +headline = "Create slides, tell stories and present." +about = "A presentation app with slide masters, shapes, animations and a presenter view. In alpha, heading for beta." +platforms = "macOS, Windows, Linux, BSD, web" +[[apps.details.features]] +text = "Slide masters and layouts with placeholders that inherit formatting, themes, sections, notes and comments." +title = "Make decks" +[[apps.details.features]] +text = "Preset shapes with adjust handles, connectors that stay glued to shapes, freeform tools, merged shapes, gradients, shadows and glow." +title = "Draw" +[[apps.details.features]] +text = "In-place text editing with full font and paragraph formatting, bullets and numbering, columns and autofit." +title = "Write" +[[apps.details.features]] +text = "Pictures with crop and corrections, styled tables, charts, audio and video." +title = "Add content" +[[apps.details.features]] +text = "Transitions including Morph, animations and motion paths, a full-screen slide show, presenter view and rehearsed timings." +title = "Present" +[[apps.details.features]] +text = "Opens and saves .pptx presentation files and exports PDF (slides, notes pages and handouts), PNG and JPEG." +title = "Exchange files" +[[apps.details.shots]] +caption = "Editing a slide, with sections and notes" +key = "editor" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/editor.jpg" +[[apps.details.shots]] +caption = "The Shape Format tab" +key = "shape" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/shape.jpg" +[[apps.details.shots]] +caption = "The slide sorter" +key = "sorter" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/sorter.jpg" +[[apps.details.shots]] +caption = "The Format Shape pane" +key = "format" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/format.jpg" + +[[apps]] +color = [62, 166, 232] +former_bundles = [] +former_ids = [] +former_names = [] +id = "cadcraft" +binary = "cadcraft" +flatpak_id = "ai.storyteller.cadcraft" +mac_bundle_id = "ai.storyteller.cadcraft" +mac_bundle_name = "CADCraft" +website = "https://getartcraft.com/apps/cadcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "cadcraft" +rpm_package = "cadcraft" +desktop_categories = ["Graphics", "Engineering", "VectorGraphics"] +startup_wm_class = "ai.storyteller.cadcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/cadcraft-c126ff5030d0a0f3e63f039bae81ca63ba71230da2e6fca54e08df1119ea3443.png" +icon_sha256 = "c126ff5030d0a0f3e63f039bae81ca63ba71230da2e6fca54e08df1119ea3443" +ink_dark = [124, 200, 255] +ink_light = [26, 111, 168] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "CADCraft" +publisher = "ArtCraft" +repo = "storytold/cadcraft" +tagline = "Computer-aided design and drafting" +[apps.details] +headline = "Computer-aided drafting, with a familiar workflow." +about = "A drafting app with the command line, object snaps and workflow that drafters already know. Free, with no account and no subscription. In early, fast development." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Type L, click two points, type @5<45 and press Enter. Prompts with clickable keywords, polar tracking, direct distance entry and grips work the way drafting habit expects." +title = "The workflow you know" +[[apps.details.features]] +text = "Reads and writes DXF natively (R12 through 2018) and opens and saves DWG (R13 through 2018). Exports SVG and PNG." +title = "Open files" +[[apps.details.features]] +text = "A responsive, native drafting workspace." +title = "Fast and native" +[[apps.details.features]] +text = "Draw, modify, dimension, hatch and block commands, layers with a properties manager, paper-space layouts and PDF plotting." +title = "A full drafting toolset" +[[apps.details.features]] +text = "Every menu item, tool and prompt is a command, available over MCP, a JSON control channel or the CLI." +title = "Built for agents" +[[apps.details.shots]] +caption = "An apartment floor plan" +key = "apartment" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/cadcraft/apartment.jpg" +[[apps.details.shots]] +caption = "A mechanical bracket drawing" +key = "bracket" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/cadcraft/bracket.jpg" +[[apps.details.shots]] +caption = "A layout sheet" +key = "layout" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/cadcraft/layout.jpg" + +[[apps]] +color = [31, 157, 85] +former_bundles = [] +former_ids = [] +former_names = [] +id = "gridcraft" +binary = "gridcraft" +flatpak_id = "ai.storyteller.gridcraft" +mac_bundle_id = "ai.storyteller.gridcraft" +mac_bundle_name = "GridCraft" +website = "https://getartcraft.com/apps/gridcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "gridcraft" +rpm_package = "gridcraft" +desktop_categories = ["Office", "Spreadsheet"] +startup_wm_class = "ai.storyteller.gridcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/gridcraft-01ef35442b8d466b52068fda67ab740309321c8bc813b62b9207dfc4116208e7.png" +icon_sha256 = "01ef35442b8d466b52068fda67ab740309321c8bc813b62b9207dfc4116208e7" +ink_dark = [79, 214, 138] +ink_light = [18, 112, 58] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "GridCraft" +publisher = "ArtCraft" +repo = "storytold/gridcraft" +tagline = "Spreadsheets and data" +[apps.details] +headline = "Spreadsheets you already know how to use." +about = "A spreadsheet with the ribbon, formula bar, sheet tabs and shortcuts you know. No subscription, no license server and no telemetry." +platforms = "macOS, Windows, Linux, BSD, web" +[[apps.details.features]] +text = "The ribbon, formula bar, Name Box, fill handle, point-mode formulas, Format Cells, Paste Special, conditional formatting, tables and charts." +title = "Familiar" +[[apps.details.features]] +text = "XLSX is the native format, with formulas, tables, conditional formats, charts, pivot tables and print settings round-tripping. CSV and TSV too." +title = "Compatible" +[[apps.details.features]] +text = "A dependency-graph calculation engine with dynamic arrays, LET and LAMBDA, structured table references, sort, AutoFilter and Flash Fill." +title = "Capable" +[[apps.details.features]] +text = "Copy-on-write workbooks, incremental recalculation and a grid that only lays out what is on screen." +title = "Fast" +[[apps.details.features]] +text = "Every ribbon button, menu item, dialog and keystroke is a command, available over a JSON control channel, an MCP server or the CLI." +title = "Agent-native" +[[apps.details.features]] +text = "Work on the desktop and the web." +title = "Everywhere" +[[apps.details.shots]] +caption = "A quarterly sales dashboard" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/hero.jpg" +[[apps.details.shots]] +caption = "A household budget" +key = "budget" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/budget.jpg" +[[apps.details.shots]] +caption = "A pivot table" +key = "pivot" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/pivot.jpg" +[[apps.details.shots]] +caption = "Formatting a chart" +key = "chart" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/chart.jpg" + +[[apps]] +color = [194, 103, 43] +former_bundles = [] +former_ids = [] +former_names = [] +id = "texturecraft" +binary = "texturecraft" +flatpak_id = "ai.storyteller.texturecraft" +mac_bundle_id = "ai.storyteller.texturecraft" +mac_bundle_name = "TextureCraft" +website = "https://getartcraft.com/apps/texturecraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "texturecraft" +rpm_package = "texturecraft" +desktop_categories = ["Graphics", "3DGraphics"] +startup_wm_class = "texturecraft" +icon_url = "https://getartcraft.com/launcher-app-icons/texturecraft-ac629a038a215a13d86172286142502b6efd17618869652050f291d9745346d2.png" +icon_sha256 = "ac629a038a215a13d86172286142502b6efd17618869652050f291d9745346d2" +ink_dark = [229, 138, 78] +ink_light = [156, 74, 21] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "TextureCraft" +publisher = "ArtCraft" +repo = "storytold/texturecraft" +tagline = "3D texture painting" +[apps.details] +headline = "Paint textures on 3D models." +about = "Paint materials on 3D models and export textures." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Paint materials on 3D models and export textures." +title = "Materials" +[[apps.details.features]] +text = "Bake mesh maps and use smart materials." +title = "Mesh maps" + +[[apps]] +color = [23, 138, 156] +former_bundles = [] +former_ids = [] +former_names = [] +id = "materialcraft" +binary = "materialcraft" +flatpak_id = "ai.storyteller.materialcraft" +mac_bundle_id = "ai.storyteller.materialcraft" +mac_bundle_name = "MaterialCraft" +website = "https://github.com/storytold/materialcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "materialcraft" +rpm_package = "materialcraft" +desktop_categories = ["Graphics", "3DGraphics"] +startup_wm_class = "materialcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/materialcraft-2844f2a4cf2b1d06c7eeaec8bddf13c69a0a1c3356e6767e8e97eb6b540a2c7c.png" +icon_sha256 = "2844f2a4cf2b1d06c7eeaec8bddf13c69a0a1c3356e6767e8e97eb6b540a2c7c" +ink_dark = [99, 197, 211] +ink_light = [16, 101, 115] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "MaterialCraft" +publisher = "ArtCraft" +repo = "storytold/materialcraft" +site = "https://github.com/storytold/materialcraft" +tagline = "Procedural material design" +[apps.details] +headline = "Build materials with node graphs." +about = "Create tileable PBR materials and export texture maps." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Combine noises, patterns and filters." +title = "Node graphs" +[[apps.details.features]] +text = "Preview materials in 2D and on 3D models." +title = "Live previews" + +[[apps]] +color = [78, 123, 251] +former_bundles = [] +former_ids = [] +former_names = [] +id = "craft-anything" +binary = "craft-anything" +flatpak_id = "ai.storyteller.craft-anything" +mac_bundle_id = "ai.storyteller.craft-anything" +mac_bundle_name = "Craft Anything" +website = "https://getartcraft.com/apps/craft-anything" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "craft-anything" +rpm_package = "craft-anything" +desktop_categories = ["Development", "Debugger"] +startup_wm_class = "ai.storyteller.craft-anything" +icon_url = "https://getartcraft.com/launcher-app-icons/craft-anything-ddab399079b3a0a28a6584fb2ffd209bb0407896f20a8084551b5feb3060deb1.png" +icon_sha256 = "ddab399079b3a0a28a6584fb2ffd209bb0407896f20a8084551b5feb3060deb1" +ink_dark = [116, 170, 255] +ink_light = [22, 89, 196] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "Craft Anything" +publisher = "ArtCraft" +repo = "storytold/craft-anything" +tagline = "Find out how any software works, then craft your own" +[apps.details] +headline = "See how any website, app or game works, then build your own." +about = "Point it at a target and say what you want. It studies the original with real inspection tools, has a coding agent build a new project in the stack you ask for, checks the result against the original and refines it. Open source and clean-room." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Websites, desktop apps, phone apps, games and files: find out how they're built, with the evidence behind every answer." +title = "Study anything" +[[apps.details.features]] +text = "Say what you want and a coding agent builds a new project in the language or engine you name." +title = "Build your own" +[[apps.details.features]] +text = "Every build is compared with the original, at three screen widths for a page, and refined until it's close." +title = "Checked, not guessed" +[[apps.details.features]] +text = "Every tool is a CLI command and an MCP tool, and no AI is needed just to inspect." +title = "Agent-ready" + +[[apps]] +bundle = "io.tangencylabs.solidcraft" +color = [70, 161, 251] +former_bundles = ["ai.storyteller.solidcraft", "ai.storyteller.solvecraft"] +former_ids = [] +former_names = [] +id = "solidcraft" +binary = "solidcraft" +flatpak_id = "io.tangencylabs.solidcraft" +mac_bundle_id = "io.tangencylabs.solidcraft" +mac_bundle_name = "SolidCraft" +website = "https://solidcraft.io" +windows_msi_publisher = "SolidCraft contributors" +deb_package = "solidcraft" +rpm_package = "solidcraft" +desktop_categories = ["Graphics"] +startup_wm_class = "io.tangencylabs.solidcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/solidcraft-46e019499579b2f477228021dd91b187303921da5d4cd14f1002a10976cf0475.png" +icon_sha256 = "46e019499579b2f477228021dd91b187303921da5d4cd14f1002a10976cf0475" +ink_dark = [140, 196, 255] +ink_light = [22, 83, 174] +kind = "community" +mac_team = "G5QA5U5X2S" +msi_publisher = "SolidCraft contributors" +name = "SolidCraft" +publisher = "Tangency Labs" +repo = "tangency-labs/solidcraft" +site = "https://solidcraft.io" +tagline = "Parametric 3D CAD" +[apps.details] +headline = "Parametric 3D CAD, with editable sketches and solids." +about = "A parametric solid modeller by Tangency Labs. Sketch, constrain and build solids on an editable feature timeline: change a dimension and the model rebuilds. Early, but usable for simple parts. Open source, and it can be driven by AI agents through its MCP server." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Lines, arcs, splines and text, solved by SolidCraft's own constraint solver, with parameter-driven dimensions." +title = "Sketches and constraints" +[[apps.details.features]] +text = "Extrude, revolve, sweep, loft, fillet, chamfer, shell, holes, threads and patterns on a parametric timeline." +title = "Features" +[[apps.details.features]] +text = "STEP, IGES, 3MF, STL, OBJ and glTF in and out where supported, and .sc designs." +title = "Files" +[[apps.details.features]] +text = "A desktop app, a browser app, a headless CLI and an MCP server, all running the same commands." +title = "Desktop, web and agents" + +[[apps]] +bundle = "io.github.billsecond.mailcraft" +color = [15, 104, 240] +former_bundles = [] +former_ids = [] +former_names = [] +id = "mailcraft" +binary = "mailcraft" +flatpak_id = "io.github.billsecond.mailcraft" +mac_bundle_id = "io.github.billsecond.mailcraft" +mac_bundle_name = "MailCraft" +website = "https://mailcraft.work" +windows_msi_publisher = "MailCraft contributors" +deb_package = "mailcraft" +rpm_package = "mailcraft" +desktop_categories = ["Graphics"] +startup_wm_class = "io.github.billsecond.mailcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/mailcraft-dd0e62a27b0066ae5f461d5f829cfa143b49ca6a1b9dc9b47686818edd664bf7.png" +icon_sha256 = "dd0e62a27b0066ae5f461d5f829cfa143b49ca6a1b9dc9b47686818edd664bf7" +ink_dark = [143, 191, 255] +ink_light = [6, 52, 196] +kind = "community" +msi_publisher = "MailCraft contributors" +name = "MailCraft" +publisher = "UCS Care Group" +repo = "UCS-Care-Group/mailcraft" +site = "https://mailcraft.work" +tagline = "Mail, calendar and contacts" +[apps.details] +headline = "Mail, calendar, contacts and tasks, in one native app." +about = "An open-source mail program by UCS Care Group, written from scratch in Rust: the folder pane, message list and reading pane people already know, with a calendar, people and to-dos. Works with Microsoft 365, Outlook.com and IMAP. In public beta, and it can be driven by AI agents through its MCP server." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Conversations, flags, categories, rules, search with a query language, and HTML mail shown without running anything in it." +title = "Mail" +[[apps.details.features]] +text = "Day, week and month views, recurring meetings, invitations and reminders, kept in step with Microsoft 365." +title = "Calendar" +[[apps.details.features]] +text = ".eml, .mbox, .ics and .vcf in and out, and the mail and contacts of an Outlook .pst file in." +title = "Files" +[[apps.details.features]] +text = "A desktop app, a browser app, a CLI and an MCP server, all running the same commands." +title = "Desktop, web and agents" diff --git a/crates/core/src/catalog.rs b/crates/core/src/catalog.rs index 4855bc51..02b4911c 100644 --- a/crates/core/src/catalog.rs +++ b/crates/core/src/catalog.rs @@ -1,4 +1,4 @@ -//! The Craft App Suite: the eighteen apps the launcher knows about. +//! The Craft App Suite: bundled data with a signed hosted startup snapshot. //! //! The list is data so a later version can fetch it from an API; [`SUITE`] is the built-in copy. //! @@ -114,7 +114,7 @@ impl CraftApp { } pub fn by_id(id: &str) -> Option<&'static CraftApp> { - SUITE.iter().find(|a| a.id == id) + crate::hosted_catalog::apps().iter().find(|a| a.id == id) } } @@ -146,145 +146,8 @@ const fn app( } } -/// The Craft App Suite, in display order matching getartcraft.com, then the community apps: -pub const SUITE: [CraftApp; 19] = [ - app("photocraft", "PhotoCraft", "Image editing", [[0x2f, 0x7b, 0xf5], [0x1a, 0x5b, 0xc4], [0x7f, 0xb0, 0xff]], "storytold/photocraft"), - app("vectorcraft", "VectorCraft", "Vector illustration", [[0xe8, 0x57, 0x3f], [0xb8, 0x3a, 0x24], [0xff, 0x8a, 0x70]], "storytold/vectorcraft"), - app( - "filmcraft", - "FilmCraft", - "Video editing, color and sound", - [[0x8b, 0x5c, 0xf6], [0x6a, 0x3f, 0xd6], [0xb6, 0x9c, 0xff]], - "storytold/filmcraft", - ), - app( - "lightcraft", - "LightCraft", - "Photo library and raw development", - [[0xf2, 0xa5, 0x16], [0x8a, 0x58, 0x00], [0xff, 0xc1, 0x4d]], - "storytold/lightcraft", - ), - CraftApp { - former_ids: &["printcraft"], - former_names: &["PrintCraft"], - ..app( - "pdfcraft", - "PdfCraft", - "Reading, organizing and protecting PDFs", - [[0xe8, 0x20, 0x4f], [0xb7, 0x02, 0x28], [0xf2, 0x3a, 0x62]], - "storytold/pdfcraft", - ) - }, - app( - "effectcraft", - "EffectCraft", - "Motion graphics and visual effects", - [[0xe0, 0x36, 0x8f], [0xb0, 0x20, 0x6c], [0xff, 0x7a, 0xb8]], - "storytold/effectcraft", - ), - CraftApp { - // Use the project repository until its getartcraft.com page is published. - site: Some("https://github.com/storytold/anicraft"), - ..app("anicraft", "AniCraft", "2D vector animation", [[0xda, 0xc6, 0x04], [0x70, 0x65, 0x00], [0xe8, 0xd8, 0x4a]], "storytold/anicraft") - }, - app( - "designcraft", - "DesignCraft", - "Page layout and publishing", - [[0x7b, 0xb5, 0x1c], [0x45, 0x70, 0x08], [0xa6, 0xe0, 0x4a]], - "storytold/designcraft", - ), - app( - "figcraft", - "FigCraft", - "Interface design and prototyping", - [[0x02, 0xda, 0x96], [0x04, 0x7a, 0x56], [0x4f, 0xe8, 0xb6]], - "storytold/figcraft", - ), - app("wordcraft", "WordCraft", "Writing and document design", [[0x3f, 0x5f, 0xe0], [0x2a, 0x44, 0xb8], [0x8e, 0xa2, 0xff]], "storytold/wordcraft"), - app( - "soundcraft", - "SoundCraft", - "Recording, editing and mixing audio", - [[0x1f, 0xa5, 0xc9], [0x0e, 0x72, 0x90], [0x5f, 0xd0, 0xee]], - "storytold/soundcraft", - ), - app( - "deckcraft", - "DeckCraft", - "Presentations and slide shows", - [[0xf0, 0x7a, 0x1e], [0xa8, 0x4f, 0x0a], [0xff, 0xa0, 0x60]], - "storytold/deckcraft", - ), - app( - "cadcraft", - "CADCraft", - "Computer-aided design and drafting", - [[0x3e, 0xa6, 0xe8], [0x1a, 0x6f, 0xa8], [0x7c, 0xc8, 0xff]], - "storytold/cadcraft", - ), - app("gridcraft", "GridCraft", "Spreadsheets and data", [[0x1f, 0x9d, 0x55], [0x12, 0x70, 0x3a], [0x4f, 0xd6, 0x8a]], "storytold/gridcraft"), - app( - "texturecraft", - "TextureCraft", - "3D texture painting", - [[0xc2, 0x67, 0x2b], [0x9c, 0x4a, 0x15], [0xe5, 0x8a, 0x4e]], - "storytold/texturecraft", - ), - CraftApp { - // Use the project repository until its getartcraft.com page is published. - site: Some("https://github.com/storytold/materialcraft"), - ..app( - "materialcraft", - "MaterialCraft", - "Procedural material design", - [[0x17, 0x8a, 0x9c], [0x10, 0x65, 0x73], [0x63, 0xc5, 0xd3]], - "storytold/materialcraft", - ) - }, - // The raven's tile blue, with its README's deep (#1659c4) and light (#74aaff) accents for text. - app( - "craft-anything", - "Craft Anything", - "Find out how any software works, then craft your own", - [[0x4e, 0x7b, 0xfb], [0x16, 0x59, 0xc4], [0x74, 0xaa, 0xff]], - "storytold/craft-anything", - ), - CraftApp { - kind: AppKind::Community, - publisher: "Tangency Labs", - msi_publisher: Some("SolidCraft contributors"), - bundle: Some("io.tangencylabs.solidcraft"), - former_bundles: &["ai.storyteller.solidcraft", "ai.storyteller.solvecraft"], - site: Some("https://solidcraft.io"), - // Signed by its own developer's team, not ArtCraft's (since 0.27, per its README). - mac_team: Some("G5QA5U5X2S"), - ..app( - "solidcraft", - "SolidCraft", - "Parametric 3D CAD", - [[0x46, 0xa1, 0xfb], [0x16, 0x53, 0xae], [0x8c, 0xc4, 0xff]], - "tangency-labs/solidcraft", - ) - }, - CraftApp { - kind: AppKind::Community, - publisher: "UCS Care Group", - msi_publisher: Some("MailCraft contributors"), - bundle: Some("io.github.billsecond.mailcraft"), - site: Some("https://mailcraft.work"), - // ponytail: its macOS builds are unsigned (per its README), so the launcher opens a copy - // that's there but installs nothing; set its Developer ID team here once it signs them. - mac_team: None, - ..app( - "mailcraft", - "MailCraft", - "Mail, calendar and contacts", - [[0x0f, 0x68, 0xf0], [0x06, 0x34, 0xc4], [0x8f, 0xbf, 0xff]], - "UCS-Care-Group/mailcraft", - ) - }, -]; +// The bundled suite, in website display order, then the approved community apps. +include!(concat!(env!("OUT_DIR"), "/catalog.rs")); /// The Apple Developer team that signs every official Craft App and ArtCraft Launcher (Learning /// Machines LLC): the macOS side of the Windows publisher check. @@ -330,6 +193,9 @@ pub const LAUNCHER_ID: &str = "artcraft-launcher"; /// A Craft App's 128 px icon (PNG), as copied from its repo into `assets/app-icons`: the UI /// draws it, and the Linux install puts it in the desktop menu. pub fn app_icon_png(id: &str) -> Option<&'static [u8]> { + if let Some(icon) = crate::hosted_catalog::icon(id) { + return Some(icon); + } Some(match id { "artcraft" => include_bytes!("../../../assets/app-icons/artcraft.png"), "photocraft" => include_bytes!("../../../assets/app-icons/photocraft.png"), diff --git a/crates/core/src/details.rs b/crates/core/src/details.rs index 86d091c3..128d0757 100644 --- a/crates/core/src/details.rs +++ b/crates/core/src/details.rs @@ -1,7 +1,6 @@ //! Hand-written product pages: what each app is, in the launcher's own words. //! -//! The text is compiled in, so it works offline and on the web, and nothing from the network is -//! ever shown as page copy. What changes with every release (version, date, size, notes) comes +//! Bundled text works offline and on the web; a verified hosted snapshot may replace it. What changes with every release (version, date, size, notes) comes //! from the GitHub release instead. An app without an entry here simply has no details page. //! //! The pictures are not compiled in: they are fetched when a page is opened (see @@ -136,454 +135,7 @@ pub fn screenshot_within_budget(bytes: &[u8]) -> bool { } } -/// Where every Craft App runs (getartcraft.com lists the same for each of them). -const PLATFORMS: &str = "macOS, Windows, Linux, FreeBSD, web"; - -pub const DETAILS: [AppDetails; 19] = [ - AppDetails { - id: "photocraft", - headline: "The image editor you already know how to use.", - about: "Layers, masks, adjustment layers, layer styles, type, vectors and brushes in a native app. Open source, offline, and yours.\n\n\ - PhotoCraft keeps the menus, shortcuts and panels your hands already know, so there is \ - nothing to relearn.", - features: &[ - feature("Native GPU canvas", "No Electron and no web view: a fast native compositor."), - feature("Real layered files", "Opens and saves layered PSD and PSB documents."), - feature("Non-destructive editing", "Adjustment layers, live-preview filters, smart objects and layer styles."), - feature("On-device selection", "Subject and object selection and mask refinement run locally."), - feature("Serious color", "8-, 16- and 32-bit RGB, CMYK, Lab and Grayscale, with ICC color management and soft proofing."), - ], - shots: &[ - shot("demo", "Curves and type layers"), - shot("adjustments", "Levels with a live histogram"), - shot("layer-styles", "Layer styles on live type"), - shot("masks", "Selections and masked adjustments"), - ], - platforms: PLATFORMS, - }, - AppDetails { - id: "vectorcraft", - headline: "Vector illustration, with familiar tools and editable effects.", - about: "A native vector illustration app with the pen, panels and shortcuts illustrators expect. \ - Open source, and it also runs in a browser.", - features: &[ - feature( - "The workflow you know", - "Pen, direct selection, shape booleans, snapping guides and an appearance panel, laid out the way you expect.", - ), - feature("Genuinely fast", "Drawings with thousands of shapes stay responsive on a retina display."), - feature( - "Booleans that don't fail", - "Shape booleans work on the exact curves, so there is no \"cannot perform operation\", and undo is unlimited.", - ), - feature("Live, editable effects", "Blends, envelope distort, gradient mesh, repeats, glows and drop shadows all stay editable."), - feature("Image tracing", "Turn raster images into clean vector paths, with presets for the common cases."), - feature("Open formats", "Native JSON documents, SVG and PDF import and export, and PNG, JPEG and WebP output."), - ], - shots: &[ - shot("neon", "The Neon Drive poster"), - shot("ribbons", "Live blends"), - shot("sheet", "A feature sheet and the Layers panel"), - shot("bezier", "Pathfinder and exact booleans"), - ], - platforms: PLATFORMS, - }, - AppDetails { - id: "filmcraft", - headline: "Professional video editing, rebuilt from scratch.", - about: "A native video editor with source and program monitors, a real timeline and \ - every trim mode.", - features: &[ - feature("A timeline you already know", "Source and program monitors, three-point editing, every trim mode and J/K/L trimming."), - feature("Frame-exact time", "An integer timebase keeps 23.976 and 29.97 drop-frame footage exact, with no drift."), - feature("Its own codecs", "No FFmpeg inside: native support for H.264, HEVC, ProRes, VP9, AAC and Opus."), - feature("Color grading", "Curves, color wheels, HSL secondaries, LUTs and HDR and log workflows, with scopes to check the result."), - feature( - "Effects and keyframes", - "Video effects and transitions, keyframes with value and velocity graphs, and a linear-light GPU compositor.", - ), - feature("Broadcast-ready audio", "EBU R128 loudness meters, a mixer with automation and native audio effects."), - ], - shots: &[ - shot("color", "The Color workspace, with scopes"), - shot("assembly", "The Assembly workspace"), - shot("keyframes", "Keyframes in Effect Controls"), - ], - platforms: PLATFORMS, - }, - AppDetails { - id: "lightcraft", - headline: "Your photos. Your pixels. Your machine.", - about: "A fast photo library and non-destructive raw developer. \ - No account, no cloud, no telemetry and no subscription.", - features: &[ - feature("Non-destructive by design", "A wide-gamut, 32-bit float pipeline that never touches your originals."), - feature("Every control you reach for", "Light, color, effects, tone curve, a color mixer, color grading wheels and built-in presets."), - feature("Precise masking", "Brush, gradient and range masks, plus sky, subject and background masks."), - feature("Native raw decoding", "Support for the main camera raw formats: DNG, CR2, ARW, NEF, RAF, RW2, PEF and ORF."), - feature("A library that keeps up", "Albums, ratings, flags and search, with grids that stay smooth on large catalogs."), - feature("Instant feedback", "The GPU pipeline updates the preview as you move a slider, even on large raw files."), - ], - shots: &[ - shot("hero", "The Edit view"), - shot("curve", "The tone curve"), - shot("grading", "Color grading wheels"), - shot("masking", "A radial mask over a sky mask"), - ], - platforms: PLATFORMS, - }, - AppDetails { - id: "pdfcraft", - headline: "The open-source PDF workbench.", - about: "Read, organize, combine, split and secure PDFs in a fast, native app. No account, no telemetry and no cloud.", - features: &[ - feature("Faithful rendering", "World scripts, vertical Japanese, color emoji and transparency."), - feature("Search as you type", "Instant find, and text selection that follows the document's real reading order."), - feature("Organize like cards", "Rotate, delete, insert and reorder pages, with deep undo behind every change."), - feature("Combine, extract, split", "Assemble and break apart documents while keeping links, form fields, layers and bookmarks intact."), - feature("Fearless saves", "Incremental, atomic saves with autosave and crash recovery."), - feature("Built-in security", "Opens files from RC4 to AES-256 encryption and honors the author's permissions."), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "effectcraft", - headline: "Motion graphics and visual effects.", - about: "A native compositor with compositions, layers, keyframes, effects, expressions, 3D cameras and \ - lights, and a render queue. Young, moving fast, and already usable.", - features: &[ - feature( - "Animate the way you know", - "Familiar panels and keyframes (linear, bezier, hold and eased), with a graph editor for value and speed curves.", - ), - feature( - "Layers of every kind", - "Solids, shapes, text, footage, nested compositions, nulls and adjustment layers, with parenting, track mattes and blend modes.", - ), - feature( - "A large effects library", - "Blur, color correction, distortion, generators, keying, particles and simulation, stylize and time effects.", - ), - feature("Real 3D", "3D layers with cameras, depth of field, and lights that cast soft ray-traced shadows."), - feature("Expressions", "JavaScript expressions with wiggle, loops and layer references, edited inline."), - feature("Export anywhere", "H.264 and ProRes with alpha, PNG, TIFF and EXR sequences, GIF, and Lottie import and export."), - ], - shots: &[ - shot("hero", "An animated composition"), - shot("graph", "The Graph Editor"), - shot("effects", "Particles and Effect Controls"), - shot("3d", "3D layers with cameras and lights"), - ], - platforms: PLATFORMS, - }, - AppDetails { - id: "anicraft", - headline: "Vector animation on a timeline you know.", - about: "Open-source 2D vector animation, built in pure Rust.", - features: &[ - feature( - "Familiar by design", - "Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening.", - ), - feature( - "Tweens that ease", - "Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another.", - ), - feature( - "Symbols and scenes", - "Graphic symbols and movie clips with nested timelines and loop modes, mask and guide layers, filters, blend modes and scenes.", - ), - feature( - "Real vector tools", - "Pen, Pencil with curve fitting, shapes, text, Paint Bucket and Ink Bottle, with Bézier anchors and handles you edit point by point.", - ), - feature( - "Open formats", - "Opens .fla and .xfl documents and imports SVG. Exports PNG sequences, GIF, SVG frames, sprite sheets, Lottie, and WebM or MP4 through your own FFmpeg.", - ), - feature( - "Agent-ready", - "Every action is an engine command, so the CLI, a JSON-lines channel and an MCP server can draw, animate and export the way a person does.", - ), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "designcraft", - headline: "Page layout and publishing.", - about: "A native layout app with spreads, parent pages, threaded stories, styles, swatches, text wrap and \ - a paragraph composer. No subscription, no license server and no telemetry.", - features: &[ - feature("The layout tools you know", "Spreads and parent pages, frames and threaded stories, with paragraph and character styles."), - feature( - "Beautiful type", - "A Knuth–Plass paragraph composer, dictionary hyphenation, optical margin alignment and baseline grids, with line breaks that match on screen and in PDF.", - ), - feature("Print-ready PDF", "Real selectable text with embedded fonts, CMYK and spot colors, bleed, crop marks and PDF/A output."), - feature("Fast", "Multithreaded rendering, instant undo and cached text composition."), - feature("Open formats", "A documented native format, PNG export and layout interchange import and export."), - feature("Built for automation", "Every menu item, tool, panel and dialog can be driven over a JSON control channel and an MCP server."), - ], - shots: &[shot("spread", "A magazine spread with a threaded story")], - platforms: PLATFORMS, - }, - AppDetails { - id: "wordcraft", - headline: "The familiar word processor, native and offline.", - about: "A word processor with the ribbon, shortcuts and behavior you already know. \ - Open source, and built from public specifications.", - features: &[ - feature( - "Familiar", - "Ribbon tabs and groups, a live Styles gallery and the editing behavior you expect, from list continuation to Format Painter.", - ), - feature( - "Your files", - "Opens and saves .docx, and also .odt, .rtf, .html, .md, .tex and .txt. Opens older .doc files and exports PDF with real, selectable text.", - ), - feature("Fast", "Paragraph layout is cached, so typing stays responsive even in long documents."), - feature("Private", "Spelling, grammar and everything else work offline."), - feature("Everywhere", "Work on macOS, Windows, Linux, BSD and the web."), - feature( - "Built for agents", - "Every action is a command, driven from the ribbon, shortcuts, a command-line tool, a JSON control channel or an MCP server.", - ), - ], - shots: &[ - shot("hero", "The Home tab and the Navigation pane"), - shot("review", "Track Changes and comments"), - shot("design", "The Design tab"), - shot("layout", "The Layout tab"), - ], - platforms: "macOS, Windows, Linux, BSD, web", - }, - AppDetails { - id: "deckcraft", - headline: "Create slides, tell stories and present.", - about: "A presentation app with slide masters, shapes, animations and a presenter view. \ - In alpha, heading for beta.", - features: &[ - feature("Make decks", "Slide masters and layouts with placeholders that inherit formatting, themes, sections, notes and comments."), - feature( - "Draw", - "Preset shapes with adjust handles, connectors that stay glued to shapes, freeform tools, merged shapes, gradients, shadows and glow.", - ), - feature("Write", "In-place text editing with full font and paragraph formatting, bullets and numbering, columns and autofit."), - feature("Add content", "Pictures with crop and corrections, styled tables, charts, audio and video."), - feature( - "Present", - "Transitions including Morph, animations and motion paths, a full-screen slide show, presenter view and rehearsed timings.", - ), - feature("Exchange files", "Opens and saves .pptx presentation files and exports PDF (slides, notes pages and handouts), PNG and JPEG."), - ], - shots: &[ - shot("editor", "Editing a slide, with sections and notes"), - shot("shape", "The Shape Format tab"), - shot("sorter", "The slide sorter"), - shot("format", "The Format Shape pane"), - ], - platforms: "macOS, Windows, Linux, BSD, web", - }, - AppDetails { - id: "gridcraft", - headline: "Spreadsheets you already know how to use.", - about: "A spreadsheet with the ribbon, formula bar, sheet tabs and shortcuts you know. No subscription, no license server and no telemetry.", - features: &[ - feature( - "Familiar", - "The ribbon, formula bar, Name Box, fill handle, point-mode formulas, Format Cells, Paste Special, conditional formatting, tables and charts.", - ), - feature( - "Compatible", - "XLSX is the native format, with formulas, tables, conditional formats, charts, pivot tables and print settings round-tripping. CSV and TSV too.", - ), - feature( - "Capable", - "A dependency-graph calculation engine with dynamic arrays, LET and LAMBDA, structured table references, sort, AutoFilter and Flash Fill.", - ), - feature("Fast", "Copy-on-write workbooks, incremental recalculation and a grid that only lays out what is on screen."), - feature( - "Agent-native", - "Every ribbon button, menu item, dialog and keystroke is a command, available over a JSON control channel, an MCP server or the CLI.", - ), - feature("Everywhere", "Work on the desktop and the web."), - ], - shots: &[ - shot("hero", "A quarterly sales dashboard"), - shot("budget", "A household budget"), - shot("pivot", "A pivot table"), - shot("chart", "Formatting a chart"), - ], - platforms: "macOS, Windows, Linux, BSD, web", - }, - AppDetails { - id: "cadcraft", - headline: "Computer-aided drafting, with a familiar workflow.", - about: "A drafting app with the command line, object snaps and workflow that drafters already know. Free, with no \ - account and no subscription. In early, fast development.", - features: &[ - feature( - "The workflow you know", - "Type L, click two points, type @5<45 and press Enter. Prompts with clickable keywords, polar tracking, direct distance entry and grips work the way drafting habit expects.", - ), - feature( - "Open files", - "Reads and writes DXF natively (R12 through 2018) and opens and saves DWG (R13 through 2018). Exports SVG and PNG.", - ), - feature("Fast and native", "A responsive, native drafting workspace."), - feature( - "A full drafting toolset", - "Draw, modify, dimension, hatch and block commands, layers with a properties manager, paper-space layouts and PDF plotting.", - ), - feature("Built for agents", "Every menu item, tool and prompt is a command, available over MCP, a JSON control channel or the CLI."), - ], - shots: &[shot("apartment", "An apartment floor plan"), shot("bracket", "A mechanical bracket drawing"), shot("layout", "A layout sheet")], - platforms: PLATFORMS, - }, - AppDetails { - id: "soundcraft", - headline: "Record, edit and mix your audio.", - about: "A digital audio workstation that follows the workflow audio engineers already know: an Edit window for \ - arranging and editing, and a Mix window for balancing. Pre-alpha.", - features: &[ - feature( - "Editing", - "Shuffle, Slip, Spot and Grid modes, Smart, Grabber, Trim and other tools, fades and crossfades, playlists with comping lanes and clip gain.", - ), - feature( - "Mixing", - "Faders and pans with automation, sends, busses, aux inputs, VCA masters, routing folders and automatic plugin delay compensation.", - ), - feature( - "Automation", - "Volume, pan, mute, send and every plugin parameter, with Write, Touch, Latch and Trim passes recorded live from the faders.", - ), - feature( - "Plugins", - "EQ, dynamics, reverbs, modulation effects, a subtractive synth and a drum synth, all original, and CLAP plugins load too.", - ), - ], - shots: &[ - shot("edit", "The Edit window with a nine-track session"), - shot("mix", "The Mix window"), - shot("automation", "Automation and memory locations"), - shot("score", "The Score Editor"), - ], - platforms: PLATFORMS, - }, - AppDetails { - id: "figcraft", - headline: "Interface design and prototyping.", - about: "Design screens, components and prototypes in a native app that opens instantly and works offline, \ - with no account and no telemetry. Early alpha.", - features: &[ - feature( - "Auto layout", - "Rows, columns, wrap and grids with padding, gaps and Hug, Fill or Fixed sizing, plus constraints and layout grids.", - ), - feature( - "Components", - "Instances with overrides, variants and properties, styles, and variables with modes bound to fills, strokes and effects.", - ), - feature("Vectors", "Real vector networks, the pen and pencil, the shape builder, editable booleans and variable width strokes."), - feature( - "Prototypes", - "Connections, triggers and animated transitions, variables with conditionals, flows and a presentation view with device frames.", - ), - feature( - "Hand off", - "Inspect mode with measurements, annotations, ready-for-dev status, and code for CSS, HTML, React, SwiftUI and Compose.", - ), - feature( - "Your files", - "Plain .figcraft files on your own disk. SVG, PNG, JPEG, WebP and PDF in and out, and .fig files open, best effort.", - ), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "texturecraft", - headline: "Paint textures on 3D models.", - about: "Paint materials on 3D models and export textures.", - features: &[ - feature("Materials", "Paint materials on 3D models and export textures."), - feature("Mesh maps", "Bake mesh maps and use smart materials."), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "materialcraft", - headline: "Build materials with node graphs.", - about: "Create tileable PBR materials and export texture maps.", - features: &[ - feature("Node graphs", "Combine noises, patterns and filters."), - feature("Live previews", "Preview materials in 2D and on 3D models."), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "craft-anything", - headline: "See how any website, app or game works, then build your own.", - about: "Point it at a target and say what you want. It studies the original with real inspection tools, has a \ - coding agent build a new project in the stack you ask for, checks the result against the original and \ - refines it. Open source and clean-room.", - features: &[ - feature( - "Study anything", - "Websites, desktop apps, phone apps, games and files: find out how they're built, with the evidence behind every answer.", - ), - feature("Build your own", "Say what you want and a coding agent builds a new project in the language or engine you name."), - feature( - "Checked, not guessed", - "Every build is compared with the original, at three screen widths for a page, and refined until it's close.", - ), - feature("Agent-ready", "Every tool is a CLI command and an MCP tool, and no AI is needed just to inspect."), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "solidcraft", - headline: "Parametric 3D CAD, with editable sketches and solids.", - about: "A parametric solid modeller by Tangency Labs. Sketch, constrain and build solids on an editable feature \ - timeline: change a dimension and the model rebuilds. Early, but usable for simple parts. Open source, \ - and it can be driven by AI agents through its MCP server.", - features: &[ - feature( - "Sketches and constraints", - "Lines, arcs, splines and text, solved by SolidCraft's own constraint solver, with parameter-driven dimensions.", - ), - feature("Features", "Extrude, revolve, sweep, loft, fillet, chamfer, shell, holes, threads and patterns on a parametric timeline."), - feature("Files", "STEP, IGES, 3MF, STL, OBJ and glTF in and out where supported, and .sc designs."), - feature("Desktop, web and agents", "A desktop app, a browser app, a headless CLI and an MCP server, all running the same commands."), - ], - shots: &[], - platforms: PLATFORMS, - }, - AppDetails { - id: "mailcraft", - headline: "Mail, calendar, contacts and tasks, in one native app.", - about: "An open-source mail program by UCS Care Group, written from scratch in Rust: the folder pane, message \ - list and reading pane people already know, with a calendar, people and to-dos. Works with Microsoft 365, \ - Outlook.com and IMAP. In public beta, and it can be driven by AI agents through its MCP server.", - features: &[ - feature( - "Mail", - "Conversations, flags, categories, rules, search with a query language, and HTML mail shown without running anything in it.", - ), - feature("Calendar", "Day, week and month views, recurring meetings, invitations and reminders, kept in step with Microsoft 365."), - feature("Files", ".eml, .mbox, .ics and .vcf in and out, and the mail and contacts of an Outlook .pst file in."), - feature("Desktop, web and agents", "A desktop app, a browser app, a CLI and an MCP server, all running the same commands."), - ], - shots: &[], - platforms: PLATFORMS, - }, -]; +include!(concat!(env!("OUT_DIR"), "/details.rs")); impl AppDetails { /// Where the picture `key` of this app is published, or `None` if the page has no such picture. @@ -593,7 +145,7 @@ impl AppDetails { } pub fn by_id(id: &str) -> Option<&'static AppDetails> { - DETAILS.iter().find(|d| d.id == id) + crate::hosted_catalog::details(id).or_else(|| DETAILS.iter().find(|d| d.id == id)) } pub fn paragraphs(&self) -> impl Iterator { diff --git a/crates/core/src/hosted_catalog.rs b/crates/core/src/hosted_catalog.rs new file mode 100644 index 00000000..dfb7c0b3 --- /dev/null +++ b/crates/core/src/hosted_catalog.rs @@ -0,0 +1,498 @@ +//! Signed website catalog. The bundled catalog remains available without any network. +//! +//! One bounded, immutable snapshot is activated per process. Its strings are interned only +//! inside `OnceLock::get_or_init`, preserving the existing static app handles used by jobs. +//! No repeated refresh can leak another snapshot or change a running install's identity. + +use std::collections::{HashMap, HashSet}; +use std::sync::OnceLock; + +use base64::{Engine, engine::general_purpose::STANDARD}; +use ed25519_dalek::{Signature, VerifyingKey, pkcs8::DecodePublicKey}; +use serde::Deserialize; +use sha2::{Digest, Sha256}; + +use crate::catalog::{ARTCRAFT_TEAM_ID, AppKind, CraftApp, SUITE}; +use crate::details::{AppDetails, Feature, Shot}; + +pub const CATALOG_URL: &str = "https://getartcraft.com/launcher-catalog.toml"; +pub const SIGNATURE_URL: &str = "https://getartcraft.com/launcher-catalog.toml.sig"; +pub const PUBLIC_KEY_PEM: &str = include_str!("../assets/launcher-catalog-public-key.pem"); +pub const MAX_CATALOG_BYTES: usize = 1 << 20; +pub const MAX_SIGNATURE_BYTES: usize = 128; +pub const MAX_ICON_BYTES: usize = 256 << 10; +const MAX_APPS: usize = 64; + +static ACTIVE: OnceLock = OnceLock::new(); + +struct Snapshot { + apps: Vec, + details: Vec, + metadata: HashMap, + icons: HashMap>, +} + +/// Only desktop metadata consumed by existing integration. Package identities stay pinned. +pub struct Metadata { + pub desktop_categories: String, + pub startup_wm_class: String, + pub icon_sha256: String, +} + +#[derive(Deserialize)] +struct Document { + apps: Vec, +} + +#[derive(Deserialize)] +struct Record { + id: String, + name: String, + tagline: String, + color: [u8; 3], + ink_light: [u8; 3], + ink_dark: [u8; 3], + repo: String, + #[serde(default)] + former_ids: Vec, + #[serde(default)] + former_names: Vec, + #[serde(default)] + former_bundles: Vec, + kind: String, + publisher: String, + msi_publisher: Option, + bundle: Option, + site: Option, + mac_team: Option, + mac_bundle_name: Option, + icon_url: String, + icon_sha256: String, + desktop_categories: Vec, + startup_wm_class: String, + details: Option, +} + +#[derive(Deserialize)] +struct Page { + headline: String, + about: String, + platforms: String, + #[serde(default)] + features: Vec, + #[serde(default)] + shots: Vec, +} + +#[derive(Deserialize)] +struct PageFeature { + title: String, + text: String, +} + +#[derive(Deserialize)] +struct PageShot { + key: String, + caption: String, + url: String, +} + +/// A verified, policy-checked catalog, not yet made visible to running jobs. +pub struct VerifiedCatalog { + records: Vec, + pub rejected_entries: usize, +} + +impl VerifiedCatalog { + /// Signature verification always precedes parsing; even cached bytes are reverified. + pub fn verify(bytes: &[u8], signature: &[u8]) -> Result { + let key = VerifyingKey::from_public_key_pem(PUBLIC_KEY_PEM).map_err(|_| "invalid compiled catalog key")?; + Self::verify_with_key(bytes, signature, &key) + } + + fn verify_with_key(bytes: &[u8], signature: &[u8], key: &VerifyingKey) -> Result { + if bytes.len() > MAX_CATALOG_BYTES || signature.len() > MAX_SIGNATURE_BYTES { + return Err("catalog or signature exceeds its byte limit".into()); + } + let encoded = std::str::from_utf8(signature).map_err(|_| "signature is not UTF-8")?.trim(); + let decoded = STANDARD.decode(encoded).map_err(|_| "invalid base64 catalog signature")?; + let signature = Signature::from_slice(&decoded).map_err(|_| "invalid Ed25519 signature length")?; + key.verify_strict(bytes, &signature).map_err(|_| "catalog signature does not match the pinned key")?; + Self::parse(bytes) + } + + fn parse(bytes: &[u8]) -> Result { + let text = std::str::from_utf8(bytes).map_err(|_| "catalog is not UTF-8")?; + let document: Document = toml::from_str(text).map_err(|e| format!("invalid catalog TOML: {e}"))?; + if document.apps.is_empty() || document.apps.len() > MAX_APPS { + return Err("catalog app count is outside the limit".into()); + } + let mut records = Vec::new(); + let mut seen = HashSet::new(); + let mut rejected_entries = 0; + for value in document.apps { + let record: Record = match value.try_into() { + Ok(record) => record, + Err(_) => { + rejected_entries += 1; + continue; + } + }; + if !valid_record(&record) || !seen.insert(record.id.clone()) { + rejected_entries += 1; + continue; + } + records.push(record); + } + if records.is_empty() { + return Err("catalog has no acceptable apps".into()); + } + Ok(Self { records, rejected_entries }) + } + + /// URLs/hashes are already validated. Fetchers may use a cached or bundled matching icon. + pub fn icons(&self) -> impl Iterator { + self.records.iter().map(|r| (r.id.as_str(), r.icon_url.as_str(), r.icon_sha256.as_str())) + } + + /// Publishes once per process; omitted bundled apps stay manageable after a remote removal. + pub fn activate(self, icons: HashMap>) { + ACTIVE.get_or_init(|| self.into_snapshot(icons)); + } + + fn into_snapshot(self, icons: HashMap>) -> Snapshot { + let mut apps = Vec::new(); + let mut details = Vec::new(); + let mut metadata = HashMap::new(); + let mut kept_icons = HashMap::new(); + for record in self.records { + if let Some(icon) = icons.get(&record.id).filter(|b| valid_icon(b, &record.icon_sha256)) { + kept_icons.insert(record.id.clone(), icon.clone()); + } + metadata.insert( + record.id.clone(), + Metadata { + desktop_categories: record.desktop_categories.join(";") + ";", + startup_wm_class: record.startup_wm_class.clone(), + icon_sha256: record.icon_sha256.clone(), + }, + ); + if let Some(page) = record.details { + details.push(AppDetails { + id: intern(record.id.clone()), + headline: intern(page.headline), + about: intern(page.about), + platforms: intern(page.platforms), + features: Box::leak( + page.features + .into_iter() + .map(|f| Feature { title: intern(f.title), text: intern(f.text) }) + .collect::>() + .into_boxed_slice(), + ), + shots: Box::leak( + page.shots + .into_iter() + .map(|s| Shot { key: intern(s.key), caption: intern(s.caption) }) + .collect::>() + .into_boxed_slice(), + ), + }); + } + apps.push(CraftApp { + id: intern(record.id), + name: intern(record.name), + tagline: intern(record.tagline), + color: record.color, + ink_light: record.ink_light, + ink_dark: record.ink_dark, + repo: intern(record.repo), + former_ids: intern_list(record.former_ids), + former_names: intern_list(record.former_names), + former_bundles: intern_list(record.former_bundles), + mac_bundle_name: record.mac_bundle_name.map(intern), + kind: if record.kind == "official" { AppKind::Official } else { AppKind::Community }, + publisher: intern(record.publisher), + msi_publisher: record.msi_publisher.map(intern), + bundle: record.bundle.map(intern), + site: record.site.map(intern), + mac_team: record.mac_team.map(intern), + }); + } + for app in &SUITE { + if !apps.iter().any(|a| a.id == app.id) { + apps.push(*app); + } + } + Snapshot { apps, details, metadata, icons: kept_icons } + } +} + +/// Runtime catalog, with the compiled suite as the offline/invalid-response fallback. +pub fn apps() -> &'static [CraftApp] { + ACTIVE.get().map_or(&SUITE, |s| s.apps.as_slice()) +} +pub fn details(id: &str) -> Option<&'static AppDetails> { + ACTIVE.get()?.details.iter().find(|p| p.id == id) +} +pub fn metadata(id: &str) -> Option<&'static Metadata> { + ACTIVE.get()?.metadata.get(id) +} +pub fn icon(id: &str) -> Option<&'static [u8]> { + ACTIVE.get()?.icons.get(id).map(Vec::as_slice) +} + +/// Bound decoded allocation before handing an authenticated PNG to an image loader. +pub fn valid_icon(bytes: &[u8], digest: &str) -> bool { + if bytes.len() > MAX_ICON_BYTES || bytes.get(..8) != Some(b"\x89PNG\r\n\x1a\n") || bytes.get(12..16) != Some(b"IHDR") { + return false; + } + let Some(size) = bytes.get(16..24) else { return false }; + let Ok(size) = <&[u8; 8]>::try_from(size) else { return false }; + let [a, b, c, d, e, f, g, h] = *size; + let (w, h) = (u32::from_be_bytes([a, b, c, d]), u32::from_be_bytes([e, f, g, h])); + w > 0 && h > 0 && w <= 512 && h <= 512 && format!("{:x}", Sha256::digest(bytes)) == digest +} + +fn valid_record(r: &Record) -> bool { + if !identifier(&r.id) + || r.id.as_bytes().first().is_none_or(|c| !c.is_ascii_lowercase()) + || r.id == "artcraft-launcher" + || r.name.is_empty() + || r.name.len() > 128 + || r.name.chars().any(char::is_control) + || !r.id.bytes().all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == b'-') + || r.name.contains(['/', '\\']) + || !matches!(r.kind.as_str(), "official" | "community") + { + return false; + } + let bundle = r.bundle.clone().unwrap_or_else(|| format!("ai.storyteller.{}", r.id)); + if !bundle.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '.' | '-' | '_')) || bundle.is_empty() { + return false; + } + // A signature cannot expand the compiled community allowlist or change existing install + // identities. These checks keep native detection/uninstall and publisher verification pinned. + if let Some(pinned) = SUITE.iter().find(|a| a.id == r.id) { + if r.repo != pinned.repo + || (r.kind == "official") != (pinned.kind == AppKind::Official) + || r.publisher != pinned.publisher + || r.msi_publisher.as_deref() != pinned.msi_publisher + || bundle != pinned.bundle_id() + || r.former_ids != pinned.former_ids + || r.former_names != pinned.former_names + || r.former_bundles != pinned.former_bundles + || r.mac_team.as_deref() != pinned.mac_team + || r.mac_bundle_name.as_deref().unwrap_or(&r.name) != pinned.mac_bundle_name() + || r.name != pinned.name + { + return false; + } + } else if r.kind != "official" + || r.repo != format!("storytold/{}", r.id) + || r.publisher != "ArtCraft" + || r.msi_publisher.is_some() + || r.bundle.is_some() + || r.mac_team.as_deref() != Some(ARTCRAFT_TEAM_ID) + || !r.former_ids.is_empty() + || !r.former_names.is_empty() + || !r.former_bundles.is_empty() + || r.mac_bundle_name.as_deref().is_some_and(|name| name != r.name) + { + return false; + } + if r.desktop_categories.len() > 16 + || !r.desktop_categories.iter().all(|c| identifier(c)) + || r.startup_wm_class.is_empty() + || r.startup_wm_class.chars().any(char::is_control) + { + return false; + } + if r.site.as_ref().is_some_and(|s| !s.starts_with("https://") || s.chars().any(char::is_control)) { + return false; + } + if r.icon_sha256.len() != 64 + || !r.icon_sha256.bytes().all(|c| c.is_ascii_hexdigit()) + || r.icon_url != format!("https://getartcraft.com/launcher-app-icons/{}-{}.png", r.id, r.icon_sha256) + { + return false; + } + r.details.as_ref().is_none_or(|p| { + p.features.len() <= 16 + && p.shots.len() <= 16 + && p.shots.iter().all(|s| { + identifier(&s.key) + && s.url == format!("{}/{}/{}/{}.jpg", crate::details::SCREENSHOTS_BASE, crate::details::SCREENSHOTS_REV, r.id, s.key) + }) + }) +} + +fn identifier(value: &str) -> bool { + !value.is_empty() && value.len() <= 80 && value.bytes().all(|c| c.is_ascii_alphanumeric() || matches!(c, b'-' | b'_')) +} +fn intern(value: String) -> &'static str { + Box::leak(value.into_boxed_str()) +} +fn intern_list(values: Vec) -> &'static [&'static str] { + Box::leak(values.into_iter().map(intern).collect::>().into_boxed_slice()) +} + +#[cfg(test)] +mod tests { + use super::*; + use ed25519_dalek::{Signer, SigningKey}; + + const BUNDLED: &[u8] = include_bytes!("../catalog.toml"); + const WEBSITE: &[u8] = include_bytes!("../tests/fixtures/hosted-catalog.toml"); + const SIGNATURE: &[u8] = include_bytes!("../tests/fixtures/hosted-catalog.toml.sig"); + + fn signed(bytes: &[u8]) -> Result { + let key = SigningKey::from_bytes(&[7; 32]); + let signature = STANDARD.encode(key.sign(bytes).to_bytes()); + VerifiedCatalog::verify_with_key(bytes, signature.as_bytes(), &key.verifying_key()) + } + + fn first_record() -> Record { + let document: Document = toml::from_str(std::str::from_utf8(BUNDLED).unwrap()).unwrap(); + document.apps.into_iter().next().unwrap().try_into().unwrap() + } + + #[test] + fn website_fixture_verifies_with_the_actual_pinned_public_key() { + let catalog = VerifiedCatalog::verify(WEBSITE, SIGNATURE).unwrap(); + assert_eq!(catalog.records.len(), SUITE.len()); + assert_eq!(catalog.rejected_entries, 0); + for record in &catalog.records { + let bundled = SUITE.iter().find(|app| app.id == record.id).unwrap(); + assert_eq!(record.repo, bundled.repo); + } + } + + #[test] + fn tampered_wrong_key_missing_and_oversized_signatures_are_rejected() { + let mut tampered = WEBSITE.to_vec(); + tampered.push(b'\n'); + assert!(VerifiedCatalog::verify(&tampered, SIGNATURE).is_err()); + let wrong = STANDARD.encode(SigningKey::from_bytes(&[7; 32]).sign(WEBSITE).to_bytes()); + assert!(VerifiedCatalog::verify(WEBSITE, wrong.as_bytes()).is_err()); + for signature in [b"".as_slice(), b"not-base64", &[b'a'; MAX_SIGNATURE_BYTES + 1]] { + assert!(VerifiedCatalog::verify(BUNDLED, signature).is_err()); + } + assert!(VerifiedCatalog::verify(&vec![0; MAX_CATALOG_BYTES + 1], SIGNATURE).is_err()); + } + + #[test] + fn signed_fixture_keeps_lf_bytes_on_every_platform() { + assert!(!WEBSITE.contains(&b'\r')); + assert!(VerifiedCatalog::verify(WEBSITE, SIGNATURE).is_ok()); + let crlf = std::str::from_utf8(WEBSITE).unwrap().replace("\n", "\r\n"); + assert!(VerifiedCatalog::verify(crlf.as_bytes(), SIGNATURE).is_err()); + } + + #[test] + fn malformed_entries_and_unknown_fields_do_not_spoil_valid_apps() { + let text = std::str::from_utf8(BUNDLED).unwrap(); + let text = format!("unknown_top_level = true\n{text}\n[[apps]]\nid = 42\n"); + let verified = signed(text.as_bytes()).unwrap(); + assert_eq!(verified.records.len(), SUITE.len()); + assert_eq!(verified.rejected_entries, 1); + assert!(signed(b"not = [valid").is_err()); + assert!(signed(b"apps = []").is_err()); + } + + #[test] + fn signature_cannot_expand_community_or_change_pinned_install_identity() { + let mut r = first_record(); + r.repo = "attacker/photocraft".into(); + assert!(!valid_record(&r)); + r = first_record(); + r.mac_team = Some("OTHERTEAM1".into()); + assert!(!valid_record(&r)); + r = first_record(); + r.bundle = Some("other.bundle".into()); + assert!(!valid_record(&r)); + r = first_record(); + r.msi_publisher = Some("Other Publisher".into()); + assert!(!valid_record(&r)); + r = first_record(); + r.former_ids.push("unrelated".into()); + assert!(!valid_record(&r)); + r = first_record(); + r.name = "../other".into(); + assert!(!valid_record(&r)); + r = future_app(); + r.kind = "community".into(); + r.repo = "unapproved/examplecraft".into(); + assert!(!valid_record(&r)); + } + + fn future_app() -> Record { + let mut r = first_record(); + r.id = "examplecraft".into(); + r.name = "ExampleCraft".into(); + r.repo = "storytold/examplecraft".into(); + r.mac_bundle_name = Some(r.name.clone()); + r.startup_wm_class = "ai.storyteller.examplecraft".into(); + r.icon_url = format!("https://getartcraft.com/launcher-app-icons/{}-{}.png", r.id, r.icon_sha256); + r.details = None; + r + } + + #[test] + fn future_official_app_needs_no_launcher_release_but_stays_within_policy() { + let mut r = future_app(); + assert!(valid_record(&r)); + r.id = "../escape".into(); + assert!(!valid_record(&r)); + r = future_app(); + r.id = "-option".into(); + r.repo = "storytold/-option".into(); + r.icon_url = format!("https://getartcraft.com/launcher-app-icons/{}-{}.png", r.id, r.icon_sha256); + assert!(!valid_record(&r)); + r = future_app(); + r.icon_url = "https://other.example/icon.png".into(); + assert!(!valid_record(&r)); + r = future_app(); + r.startup_wm_class = "example\nExec=other".into(); + assert!(!valid_record(&r)); + r = future_app(); + r.desktop_categories.push("Graphics;\nExec=other".into()); + assert!(!valid_record(&r)); + r = first_record(); + r.details.as_mut().unwrap().shots[0].url = "https://other.example/shot.jpg".into(); + assert!(!valid_record(&r)); + } + + #[test] + fn icon_hashes_and_decode_dimensions_are_checked() { + let bytes = crate::catalog::app_icon_png("photocraft").unwrap(); + let digest = format!("{:x}", Sha256::digest(bytes)); + assert!(valid_icon(bytes, &digest)); + assert!(!valid_icon(bytes, &"0".repeat(64))); + assert!(!valid_icon(&bytes[..20], &digest)); + let mut huge = bytes.to_vec(); + huge[16..20].copy_from_slice(&u32::MAX.to_be_bytes()); + assert!(!valid_icon(&huge, &format!("{:x}", Sha256::digest(&huge)))); + } + #[test] + fn runtime_snapshot_adds_apps_details_icons_and_retains_omitted_bundled_apps() { + let mut record = future_app(); + record.details = Some(Page { + headline: "New app".into(), + about: "Signed copy".into(), + platforms: "Linux".into(), + features: vec![PageFeature { title: "Feature".into(), text: "Description".into() }], + shots: vec![], + }); + let icon = crate::catalog::app_icon_png("photocraft").unwrap().to_vec(); + let snapshot = + VerifiedCatalog { records: vec![record], rejected_entries: 0 }.into_snapshot(HashMap::from([("examplecraft".into(), icon.clone())])); + assert_eq!(snapshot.apps.len(), SUITE.len() + 1); + assert_eq!(snapshot.apps[0].id, "examplecraft"); + assert_eq!(snapshot.apps[0].repo, "storytold/examplecraft"); + assert_eq!(snapshot.details[0].headline, "New app"); + assert_eq!(snapshot.metadata["examplecraft"].startup_wm_class, "ai.storyteller.examplecraft"); + assert_eq!(snapshot.icons["examplecraft"], icon); + assert!(SUITE.iter().all(|app| snapshot.apps.iter().any(|a| a.id == app.id))); + } +} diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index f1489768..76c81705 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -11,6 +11,7 @@ pub mod catalog; pub mod details; pub mod distro; pub mod feed; +pub mod hosted_catalog; pub mod platform; pub mod protocol; pub mod release; diff --git a/crates/core/src/protocol.rs b/crates/core/src/protocol.rs index d699f24c..b8ab9bb9 100644 --- a/crates/core/src/protocol.rs +++ b/crates/core/src/protocol.rs @@ -204,6 +204,8 @@ impl Source { /// Something the backend wants the UI to know. #[derive(Clone, Debug, PartialEq)] pub enum Event { + /// A signed startup catalog has replaced the bundled app list. + CatalogUpdated, Latest { app: String, latest: LatestRelease, @@ -293,8 +295,9 @@ pub struct Capabilities { /// What "show in file manager" is called here (`Show in Finder`). pub reveal_label: &'static str, /// The launcher can update itself in place and restart (an installed build, not a dev build or - /// a Flatpak from anywhere but the release bundle). Without it the UI offers the download - /// instead. A backend may only know this once it has found a newer launcher, so the UI reads + /// a Flatpak from anywhere but the release bundle), and the newer release has the file this copy + /// updates from. Without it the UI offers the download instead. A backend may only know this + /// once it has found a newer launcher, so the UI reads /// it again on [`Event::LauncherUpdate`]. pub self_update: bool, } diff --git a/crates/core/tests/fixtures/hosted-catalog.toml b/crates/core/tests/fixtures/hosted-catalog.toml new file mode 100644 index 00000000..693abed8 --- /dev/null +++ b/crates/core/tests/fixtures/hosted-catalog.toml @@ -0,0 +1,1045 @@ +# ArtCraft Launcher catalog, served at https://getartcraft.com/launcher-catalog.toml. +# Source: storytold/craft-launcher at c6362817864df42d1fbfa105d3aaca9f728d434c +# Generated by scripts/sync-launcher-catalog.py; preserve the existing TOML schema. +# Verify launcher-catalog.toml.sig with the launcher's pinned Ed25519 key before use. +# Install sources must still follow the launcher's approved-source policy. + +[[apps]] +color = [47, 123, 245] +former_bundles = [] +former_ids = [] +former_names = [] +id = "photocraft" +binary = "photocraft" +flatpak_id = "ai.storyteller.photocraft" +mac_bundle_id = "ai.storyteller.photocraft" +mac_bundle_name = "PhotoCraft" +website = "https://getartcraft.com/apps/photocraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "photocraft" +rpm_package = "photocraft" +desktop_categories = ["Graphics", "2DGraphics", "RasterGraphics", "Photography"] +startup_wm_class = "photocraft" +icon_url = "https://getartcraft.com/launcher-app-icons/photocraft-f1afe9ccdb125a34089babecb6c1533f3fbf41ddffe81e0856f158c5b5fb9389.png" +icon_sha256 = "f1afe9ccdb125a34089babecb6c1533f3fbf41ddffe81e0856f158c5b5fb9389" +ink_dark = [127, 176, 255] +ink_light = [26, 91, 196] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "PhotoCraft" +publisher = "ArtCraft" +repo = "storytold/photocraft" +tagline = "Image editing" +[apps.details] +headline = "The image editor you already know how to use." +about = "Layers, masks, adjustment layers, layer styles, type, vectors and brushes in a native app. Open source, offline, and yours.\n\nPhotoCraft keeps the menus, shortcuts and panels your hands already know, so there is nothing to relearn." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "No Electron and no web view: a fast native compositor." +title = "Native GPU canvas" +[[apps.details.features]] +text = "Opens and saves layered PSD and PSB documents." +title = "Real layered files" +[[apps.details.features]] +text = "Adjustment layers, live-preview filters, smart objects and layer styles." +title = "Non-destructive editing" +[[apps.details.features]] +text = "Subject and object selection and mask refinement run locally." +title = "On-device selection" +[[apps.details.features]] +text = "8-, 16- and 32-bit RGB, CMYK, Lab and Grayscale, with ICC color management and soft proofing." +title = "Serious color" +[[apps.details.shots]] +caption = "Curves and type layers" +key = "demo" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/demo.jpg" +[[apps.details.shots]] +caption = "Levels with a live histogram" +key = "adjustments" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/adjustments.jpg" +[[apps.details.shots]] +caption = "Layer styles on live type" +key = "layer-styles" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/layer-styles.jpg" +[[apps.details.shots]] +caption = "Selections and masked adjustments" +key = "masks" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/photocraft/masks.jpg" + +[[apps]] +color = [232, 87, 63] +former_bundles = [] +former_ids = [] +former_names = [] +id = "vectorcraft" +binary = "vectorcraft" +flatpak_id = "ai.storyteller.vectorcraft" +mac_bundle_id = "ai.storyteller.vectorcraft" +mac_bundle_name = "VectorCraft" +website = "https://getartcraft.com/apps/vectorcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "vectorcraft" +rpm_package = "vectorcraft" +desktop_categories = ["Graphics", "2DGraphics", "VectorGraphics"] +startup_wm_class = "ai.storyteller.vectorcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/vectorcraft-47f2061e3683ba8e7241c4783ca02207d29dfef0a7c94cd0eb8ea0a88dfc0b1e.png" +icon_sha256 = "47f2061e3683ba8e7241c4783ca02207d29dfef0a7c94cd0eb8ea0a88dfc0b1e" +ink_dark = [255, 138, 112] +ink_light = [184, 58, 36] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "VectorCraft" +publisher = "ArtCraft" +repo = "storytold/vectorcraft" +tagline = "Vector illustration" +[apps.details] +headline = "Vector illustration, with familiar tools and editable effects." +about = "A native vector illustration app with the pen, panels and shortcuts illustrators expect. Open source, and it also runs in a browser." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Pen, direct selection, shape booleans, snapping guides and an appearance panel, laid out the way you expect." +title = "The workflow you know" +[[apps.details.features]] +text = "Drawings with thousands of shapes stay responsive on a retina display." +title = "Genuinely fast" +[[apps.details.features]] +text = "Shape booleans work on the exact curves, so there is no \"cannot perform operation\", and undo is unlimited." +title = "Booleans that don't fail" +[[apps.details.features]] +text = "Blends, envelope distort, gradient mesh, repeats, glows and drop shadows all stay editable." +title = "Live, editable effects" +[[apps.details.features]] +text = "Turn raster images into clean vector paths, with presets for the common cases." +title = "Image tracing" +[[apps.details.features]] +text = "Native JSON documents, SVG and PDF import and export, and PNG, JPEG and WebP output." +title = "Open formats" +[[apps.details.shots]] +caption = "The Neon Drive poster" +key = "neon" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/neon.jpg" +[[apps.details.shots]] +caption = "Live blends" +key = "ribbons" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/ribbons.jpg" +[[apps.details.shots]] +caption = "A feature sheet and the Layers panel" +key = "sheet" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/sheet.jpg" +[[apps.details.shots]] +caption = "Pathfinder and exact booleans" +key = "bezier" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/vectorcraft/bezier.jpg" + +[[apps]] +color = [139, 92, 246] +former_bundles = [] +former_ids = [] +former_names = [] +id = "filmcraft" +binary = "filmcraft" +flatpak_id = "ai.storyteller.filmcraft" +mac_bundle_id = "ai.storyteller.filmcraft" +mac_bundle_name = "FilmCraft" +website = "https://getartcraft.com/apps/filmcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "filmcraft" +rpm_package = "filmcraft" +desktop_categories = ["AudioVideo", "Video", "AudioVideoEditing"] +startup_wm_class = "ai.storyteller.filmcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/filmcraft-7ca8adb57a34d1f4bff8c7e976ac5fe73e69a89b4268d15b3b861c7e51c45a74.png" +icon_sha256 = "7ca8adb57a34d1f4bff8c7e976ac5fe73e69a89b4268d15b3b861c7e51c45a74" +ink_dark = [182, 156, 255] +ink_light = [106, 63, 214] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "FilmCraft" +publisher = "ArtCraft" +repo = "storytold/filmcraft" +tagline = "Video editing, color and sound" +[apps.details] +headline = "Professional video editing, rebuilt from scratch." +about = "A native video editor with source and program monitors, a real timeline and every trim mode." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Source and program monitors, three-point editing, every trim mode and J/K/L trimming." +title = "A timeline you already know" +[[apps.details.features]] +text = "An integer timebase keeps 23.976 and 29.97 drop-frame footage exact, with no drift." +title = "Frame-exact time" +[[apps.details.features]] +text = "No FFmpeg inside: native support for H.264, HEVC, ProRes, VP9, AAC and Opus." +title = "Its own codecs" +[[apps.details.features]] +text = "Curves, color wheels, HSL secondaries, LUTs and HDR and log workflows, with scopes to check the result." +title = "Color grading" +[[apps.details.features]] +text = "Video effects and transitions, keyframes with value and velocity graphs, and a linear-light GPU compositor." +title = "Effects and keyframes" +[[apps.details.features]] +text = "EBU R128 loudness meters, a mixer with automation and native audio effects." +title = "Broadcast-ready audio" +[[apps.details.shots]] +caption = "The Color workspace, with scopes" +key = "color" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/filmcraft/color.jpg" +[[apps.details.shots]] +caption = "The Assembly workspace" +key = "assembly" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/filmcraft/assembly.jpg" +[[apps.details.shots]] +caption = "Keyframes in Effect Controls" +key = "keyframes" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/filmcraft/keyframes.jpg" + +[[apps]] +color = [242, 165, 22] +former_bundles = [] +former_ids = [] +former_names = [] +id = "lightcraft" +binary = "lightcraft" +flatpak_id = "ai.storyteller.lightcraft" +mac_bundle_id = "ai.storyteller.lightcraft" +mac_bundle_name = "LightCraft" +website = "https://getartcraft.com/apps/lightcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "lightcraft" +rpm_package = "lightcraft" +desktop_categories = ["Graphics", "2DGraphics", "RasterGraphics", "Photography"] +startup_wm_class = "ai.storyteller.lightcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/lightcraft-a1fc54a714b769fa627eb44b0dcc1230e5fc3643890fd3504811b4c05c4a913a.png" +icon_sha256 = "a1fc54a714b769fa627eb44b0dcc1230e5fc3643890fd3504811b4c05c4a913a" +ink_dark = [255, 193, 77] +ink_light = [138, 88, 0] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "LightCraft" +publisher = "ArtCraft" +repo = "storytold/lightcraft" +tagline = "Photo library and raw development" +[apps.details] +headline = "Your photos. Your pixels. Your machine." +about = "A fast photo library and non-destructive raw developer. No account, no cloud, no telemetry and no subscription." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "A wide-gamut, 32-bit float pipeline that never touches your originals." +title = "Non-destructive by design" +[[apps.details.features]] +text = "Light, color, effects, tone curve, a color mixer, color grading wheels and built-in presets." +title = "Every control you reach for" +[[apps.details.features]] +text = "Brush, gradient and range masks, plus sky, subject and background masks." +title = "Precise masking" +[[apps.details.features]] +text = "Support for the main camera raw formats: DNG, CR2, ARW, NEF, RAF, RW2, PEF and ORF." +title = "Native raw decoding" +[[apps.details.features]] +text = "Albums, ratings, flags and search, with grids that stay smooth on large catalogs." +title = "A library that keeps up" +[[apps.details.features]] +text = "The GPU pipeline updates the preview as you move a slider, even on large raw files." +title = "Instant feedback" +[[apps.details.shots]] +caption = "The Edit view" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/hero.jpg" +[[apps.details.shots]] +caption = "The tone curve" +key = "curve" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/curve.jpg" +[[apps.details.shots]] +caption = "Color grading wheels" +key = "grading" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/grading.jpg" +[[apps.details.shots]] +caption = "A radial mask over a sky mask" +key = "masking" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/lightcraft/masking.jpg" + +[[apps]] +color = [232, 32, 79] +former_bundles = [] +former_ids = ["printcraft"] +former_names = ["PrintCraft"] +id = "pdfcraft" +binary = "pdfcraft" +flatpak_id = "ai.storyteller.pdfcraft" +mac_bundle_id = "ai.storyteller.pdfcraft" +mac_bundle_name = "PdfCraft" +website = "https://getartcraft.com/apps/pdfcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "pdfcraft" +rpm_package = "pdfcraft" +desktop_categories = ["Office", "Viewer"] +startup_wm_class = "pdfcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/pdfcraft-1933bbeaea290497facd328e917dafcc433d0c0caa9f1e207aa45ac1e430898c.png" +icon_sha256 = "1933bbeaea290497facd328e917dafcc433d0c0caa9f1e207aa45ac1e430898c" +ink_dark = [242, 58, 98] +ink_light = [183, 2, 40] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "PdfCraft" +publisher = "ArtCraft" +repo = "storytold/pdfcraft" +tagline = "Reading, organizing and protecting PDFs" +[apps.details] +headline = "The open-source PDF workbench." +about = "Read, organize, combine, split and secure PDFs in a fast, native app. No account, no telemetry and no cloud." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "World scripts, vertical Japanese, color emoji and transparency." +title = "Faithful rendering" +[[apps.details.features]] +text = "Instant find, and text selection that follows the document's real reading order." +title = "Search as you type" +[[apps.details.features]] +text = "Rotate, delete, insert and reorder pages, with deep undo behind every change." +title = "Organize like cards" +[[apps.details.features]] +text = "Assemble and break apart documents while keeping links, form fields, layers and bookmarks intact." +title = "Combine, extract, split" +[[apps.details.features]] +text = "Incremental, atomic saves with autosave and crash recovery." +title = "Fearless saves" +[[apps.details.features]] +text = "Opens files from RC4 to AES-256 encryption and honors the author's permissions." +title = "Built-in security" + +[[apps]] +color = [224, 54, 143] +former_bundles = [] +former_ids = [] +former_names = [] +id = "effectcraft" +binary = "effectcraft" +flatpak_id = "ai.storyteller.effectcraft" +mac_bundle_id = "ai.storyteller.effectcraft" +mac_bundle_name = "EffectCraft" +website = "https://getartcraft.com/apps/effectcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "effectcraft" +rpm_package = "effectcraft" +desktop_categories = ["AudioVideo", "Video", "Graphics", "2DGraphics"] +startup_wm_class = "ai.storyteller.effectcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/effectcraft-4ad7caa4f43b4cbf3bcddda0ed23e471d392efbe8d0b4ce18107b5849f20dd2d.png" +icon_sha256 = "4ad7caa4f43b4cbf3bcddda0ed23e471d392efbe8d0b4ce18107b5849f20dd2d" +ink_dark = [255, 122, 184] +ink_light = [176, 32, 108] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "EffectCraft" +publisher = "ArtCraft" +repo = "storytold/effectcraft" +tagline = "Motion graphics and visual effects" +[apps.details] +headline = "Motion graphics and visual effects." +about = "A native compositor with compositions, layers, keyframes, effects, expressions, 3D cameras and lights, and a render queue. Young, moving fast, and already usable." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Familiar panels and keyframes (linear, bezier, hold and eased), with a graph editor for value and speed curves." +title = "Animate the way you know" +[[apps.details.features]] +text = "Solids, shapes, text, footage, nested compositions, nulls and adjustment layers, with parenting, track mattes and blend modes." +title = "Layers of every kind" +[[apps.details.features]] +text = "Blur, color correction, distortion, generators, keying, particles and simulation, stylize and time effects." +title = "A large effects library" +[[apps.details.features]] +text = "3D layers with cameras, depth of field, and lights that cast soft ray-traced shadows." +title = "Real 3D" +[[apps.details.features]] +text = "JavaScript expressions with wiggle, loops and layer references, edited inline." +title = "Expressions" +[[apps.details.features]] +text = "H.264 and ProRes with alpha, PNG, TIFF and EXR sequences, GIF, and Lottie import and export." +title = "Export anywhere" +[[apps.details.shots]] +caption = "An animated composition" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/hero.jpg" +[[apps.details.shots]] +caption = "The Graph Editor" +key = "graph" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/graph.jpg" +[[apps.details.shots]] +caption = "Particles and Effect Controls" +key = "effects" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/effects.jpg" +[[apps.details.shots]] +caption = "3D layers with cameras and lights" +key = "3d" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/effectcraft/3d.jpg" + +[[apps]] +color = [218, 198, 4] +former_bundles = [] +former_ids = [] +former_names = [] +id = "anicraft" +binary = "anicraft" +flatpak_id = "ai.storyteller.anicraft" +mac_bundle_id = "ai.storyteller.anicraft" +mac_bundle_name = "AniCraft" +website = "https://github.com/storytold/anicraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "anicraft" +rpm_package = "anicraft" +desktop_categories = ["Graphics", "2DGraphics", "VectorGraphics", "AudioVideo"] +startup_wm_class = "anicraft" +icon_url = "https://getartcraft.com/launcher-app-icons/anicraft-e6754980d8a2a4acd429f6e3e3ba5569c4a761a45102a81d7edc0ef35210ce47.png" +icon_sha256 = "e6754980d8a2a4acd429f6e3e3ba5569c4a761a45102a81d7edc0ef35210ce47" +ink_dark = [232, 216, 74] +ink_light = [112, 101, 0] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "AniCraft" +publisher = "ArtCraft" +repo = "storytold/anicraft" +site = "https://github.com/storytold/anicraft" +tagline = "2D vector animation" +[apps.details] +headline = "Vector animation on a timeline you know." +about = "Open-source 2D vector animation, built in pure Rust." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening." +title = "Familiar by design" +[[apps.details.features]] +text = "Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another." +title = "Tweens that ease" +[[apps.details.features]] +text = "Graphic symbols and movie clips with nested timelines and loop modes, mask and guide layers, filters, blend modes and scenes." +title = "Symbols and scenes" +[[apps.details.features]] +text = "Pen, Pencil with curve fitting, shapes, text, Paint Bucket and Ink Bottle, with Bézier anchors and handles you edit point by point." +title = "Real vector tools" +[[apps.details.features]] +text = "Opens .fla and .xfl documents and imports SVG. Exports PNG sequences, GIF, SVG frames, sprite sheets, Lottie, and WebM or MP4 through your own FFmpeg." +title = "Open formats" +[[apps.details.features]] +text = "Every action is an engine command, so the CLI, a JSON-lines channel and an MCP server can draw, animate and export the way a person does." +title = "Agent-ready" + +[[apps]] +color = [123, 181, 28] +former_bundles = [] +former_ids = [] +former_names = [] +id = "designcraft" +binary = "designcraft" +flatpak_id = "ai.storyteller.designcraft" +mac_bundle_id = "ai.storyteller.designcraft" +mac_bundle_name = "DesignCraft" +website = "https://getartcraft.com/apps/designcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "designcraft" +rpm_package = "designcraft" +desktop_categories = ["Graphics", "Publishing"] +startup_wm_class = "ai.storyteller.designcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/designcraft-0895763da92947cb6b1d38a018a6c7ffcda1cbb714a58f2e9bc08e0e2a2b94b4.png" +icon_sha256 = "0895763da92947cb6b1d38a018a6c7ffcda1cbb714a58f2e9bc08e0e2a2b94b4" +ink_dark = [166, 224, 74] +ink_light = [69, 112, 8] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "DesignCraft" +publisher = "ArtCraft" +repo = "storytold/designcraft" +tagline = "Page layout and publishing" +[apps.details] +headline = "Page layout and publishing." +about = "A native layout app with spreads, parent pages, threaded stories, styles, swatches, text wrap and a paragraph composer. No subscription, no license server and no telemetry." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Spreads and parent pages, frames and threaded stories, with paragraph and character styles." +title = "The layout tools you know" +[[apps.details.features]] +text = "A Knuth–Plass paragraph composer, dictionary hyphenation, optical margin alignment and baseline grids, with line breaks that match on screen and in PDF." +title = "Beautiful type" +[[apps.details.features]] +text = "Real selectable text with embedded fonts, CMYK and spot colors, bleed, crop marks and PDF/A output." +title = "Print-ready PDF" +[[apps.details.features]] +text = "Multithreaded rendering, instant undo and cached text composition." +title = "Fast" +[[apps.details.features]] +text = "A documented native format, PNG export and layout interchange import and export." +title = "Open formats" +[[apps.details.features]] +text = "Every menu item, tool, panel and dialog can be driven over a JSON control channel and an MCP server." +title = "Built for automation" +[[apps.details.shots]] +caption = "A magazine spread with a threaded story" +key = "spread" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/designcraft/spread.jpg" + +[[apps]] +color = [2, 218, 150] +former_bundles = [] +former_ids = [] +former_names = [] +id = "figcraft" +binary = "figcraft" +flatpak_id = "ai.storyteller.figcraft" +mac_bundle_id = "ai.storyteller.figcraft" +mac_bundle_name = "FigCraft" +website = "https://getartcraft.com/apps/figcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "figcraft" +rpm_package = "figcraft" +desktop_categories = ["Graphics", "2DGraphics", "VectorGraphics", "X-Design"] +startup_wm_class = "figcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/figcraft-13d5236adb30c2bd4ff3eb7bcb7bb5a70d8de2ef36a81a5ffaf43ea171c7f51b.png" +icon_sha256 = "13d5236adb30c2bd4ff3eb7bcb7bb5a70d8de2ef36a81a5ffaf43ea171c7f51b" +ink_dark = [79, 232, 182] +ink_light = [4, 122, 86] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "FigCraft" +publisher = "ArtCraft" +repo = "storytold/figcraft" +tagline = "Interface design and prototyping" +[apps.details] +headline = "Interface design and prototyping." +about = "Design screens, components and prototypes in a native app that opens instantly and works offline, with no account and no telemetry. Early alpha." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Rows, columns, wrap and grids with padding, gaps and Hug, Fill or Fixed sizing, plus constraints and layout grids." +title = "Auto layout" +[[apps.details.features]] +text = "Instances with overrides, variants and properties, styles, and variables with modes bound to fills, strokes and effects." +title = "Components" +[[apps.details.features]] +text = "Real vector networks, the pen and pencil, the shape builder, editable booleans and variable width strokes." +title = "Vectors" +[[apps.details.features]] +text = "Connections, triggers and animated transitions, variables with conditionals, flows and a presentation view with device frames." +title = "Prototypes" +[[apps.details.features]] +text = "Inspect mode with measurements, annotations, ready-for-dev status, and code for CSS, HTML, React, SwiftUI and Compose." +title = "Hand off" +[[apps.details.features]] +text = "Plain .figcraft files on your own disk. SVG, PNG, JPEG, WebP and PDF in and out, and .fig files open, best effort." +title = "Your files" + +[[apps]] +color = [63, 95, 224] +former_bundles = [] +former_ids = [] +former_names = [] +id = "wordcraft" +binary = "wordcraft" +flatpak_id = "ai.storyteller.wordcraft" +mac_bundle_id = "ai.storyteller.wordcraft" +mac_bundle_name = "WordCraft" +website = "https://getartcraft.com/apps/wordcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "wordcraft" +rpm_package = "wordcraft" +desktop_categories = ["Office", "WordProcessor"] +startup_wm_class = "ai.storyteller.wordcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/wordcraft-96505c7153c1b8a7e0cf0f90353fae669f4ed9de5524ba50ba99af79003cff43.png" +icon_sha256 = "96505c7153c1b8a7e0cf0f90353fae669f4ed9de5524ba50ba99af79003cff43" +ink_dark = [142, 162, 255] +ink_light = [42, 68, 184] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "WordCraft" +publisher = "ArtCraft" +repo = "storytold/wordcraft" +tagline = "Writing and document design" +[apps.details] +headline = "The familiar word processor, native and offline." +about = "A word processor with the ribbon, shortcuts and behavior you already know. Open source, and built from public specifications." +platforms = "macOS, Windows, Linux, BSD, web" +[[apps.details.features]] +text = "Ribbon tabs and groups, a live Styles gallery and the editing behavior you expect, from list continuation to Format Painter." +title = "Familiar" +[[apps.details.features]] +text = "Opens and saves .docx, and also .odt, .rtf, .html, .md, .tex and .txt. Opens older .doc files and exports PDF with real, selectable text." +title = "Your files" +[[apps.details.features]] +text = "Paragraph layout is cached, so typing stays responsive even in long documents." +title = "Fast" +[[apps.details.features]] +text = "Spelling, grammar and everything else work offline." +title = "Private" +[[apps.details.features]] +text = "Work on macOS, Windows, Linux, BSD and the web." +title = "Everywhere" +[[apps.details.features]] +text = "Every action is a command, driven from the ribbon, shortcuts, a command-line tool, a JSON control channel or an MCP server." +title = "Built for agents" +[[apps.details.shots]] +caption = "The Home tab and the Navigation pane" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/hero.jpg" +[[apps.details.shots]] +caption = "Track Changes and comments" +key = "review" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/review.jpg" +[[apps.details.shots]] +caption = "The Design tab" +key = "design" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/design.jpg" +[[apps.details.shots]] +caption = "The Layout tab" +key = "layout" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/wordcraft/layout.jpg" + +[[apps]] +color = [31, 165, 201] +former_bundles = [] +former_ids = [] +former_names = [] +id = "soundcraft" +binary = "soundcraft" +flatpak_id = "ai.storyteller.soundcraft" +mac_bundle_id = "ai.storyteller.soundcraft" +mac_bundle_name = "SoundCraft" +website = "https://getartcraft.com/apps/soundcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "soundcraft" +rpm_package = "soundcraft" +desktop_categories = ["AudioVideo", "Audio", "Midi", "Mixer", "Sequencer", "Recorder"] +startup_wm_class = "ai.storyteller.soundcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/soundcraft-0e7f4f83d82f5539530f62f85ccf8717dcc00c6d25a3dba57e2a65111e3b248b.png" +icon_sha256 = "0e7f4f83d82f5539530f62f85ccf8717dcc00c6d25a3dba57e2a65111e3b248b" +ink_dark = [95, 208, 238] +ink_light = [14, 114, 144] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "SoundCraft" +publisher = "ArtCraft" +repo = "storytold/soundcraft" +tagline = "Recording, editing and mixing audio" +[apps.details] +headline = "Record, edit and mix your audio." +about = "A digital audio workstation that follows the workflow audio engineers already know: an Edit window for arranging and editing, and a Mix window for balancing. Pre-alpha." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Shuffle, Slip, Spot and Grid modes, Smart, Grabber, Trim and other tools, fades and crossfades, playlists with comping lanes and clip gain." +title = "Editing" +[[apps.details.features]] +text = "Faders and pans with automation, sends, busses, aux inputs, VCA masters, routing folders and automatic plugin delay compensation." +title = "Mixing" +[[apps.details.features]] +text = "Volume, pan, mute, send and every plugin parameter, with Write, Touch, Latch and Trim passes recorded live from the faders." +title = "Automation" +[[apps.details.features]] +text = "EQ, dynamics, reverbs, modulation effects, a subtractive synth and a drum synth, all original, and CLAP plugins load too." +title = "Plugins" +[[apps.details.shots]] +caption = "The Edit window with a nine-track session" +key = "edit" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/edit.jpg" +[[apps.details.shots]] +caption = "The Mix window" +key = "mix" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/mix.jpg" +[[apps.details.shots]] +caption = "Automation and memory locations" +key = "automation" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/automation.jpg" +[[apps.details.shots]] +caption = "The Score Editor" +key = "score" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/soundcraft/score.jpg" + +[[apps]] +color = [240, 122, 30] +former_bundles = [] +former_ids = [] +former_names = [] +id = "deckcraft" +binary = "deckcraft" +flatpak_id = "ai.storyteller.deckcraft" +mac_bundle_id = "ai.storyteller.deckcraft" +mac_bundle_name = "DeckCraft" +website = "https://getartcraft.com/apps/deckcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "deckcraft" +rpm_package = "deckcraft" +desktop_categories = ["Office", "Presentation"] +startup_wm_class = "ai.storyteller.deckcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/deckcraft-1bf98b43bb0b21cb038ce063e71b9922e7f48c10d5b99afd046aa6c30642ca69.png" +icon_sha256 = "1bf98b43bb0b21cb038ce063e71b9922e7f48c10d5b99afd046aa6c30642ca69" +ink_dark = [255, 160, 96] +ink_light = [168, 79, 10] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "DeckCraft" +publisher = "ArtCraft" +repo = "storytold/deckcraft" +tagline = "Presentations and slide shows" +[apps.details] +headline = "Create slides, tell stories and present." +about = "A presentation app with slide masters, shapes, animations and a presenter view. In alpha, heading for beta." +platforms = "macOS, Windows, Linux, BSD, web" +[[apps.details.features]] +text = "Slide masters and layouts with placeholders that inherit formatting, themes, sections, notes and comments." +title = "Make decks" +[[apps.details.features]] +text = "Preset shapes with adjust handles, connectors that stay glued to shapes, freeform tools, merged shapes, gradients, shadows and glow." +title = "Draw" +[[apps.details.features]] +text = "In-place text editing with full font and paragraph formatting, bullets and numbering, columns and autofit." +title = "Write" +[[apps.details.features]] +text = "Pictures with crop and corrections, styled tables, charts, audio and video." +title = "Add content" +[[apps.details.features]] +text = "Transitions including Morph, animations and motion paths, a full-screen slide show, presenter view and rehearsed timings." +title = "Present" +[[apps.details.features]] +text = "Opens and saves .pptx presentation files and exports PDF (slides, notes pages and handouts), PNG and JPEG." +title = "Exchange files" +[[apps.details.shots]] +caption = "Editing a slide, with sections and notes" +key = "editor" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/editor.jpg" +[[apps.details.shots]] +caption = "The Shape Format tab" +key = "shape" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/shape.jpg" +[[apps.details.shots]] +caption = "The slide sorter" +key = "sorter" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/sorter.jpg" +[[apps.details.shots]] +caption = "The Format Shape pane" +key = "format" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/deckcraft/format.jpg" + +[[apps]] +color = [62, 166, 232] +former_bundles = [] +former_ids = [] +former_names = [] +id = "cadcraft" +binary = "cadcraft" +flatpak_id = "ai.storyteller.cadcraft" +mac_bundle_id = "ai.storyteller.cadcraft" +mac_bundle_name = "CADCraft" +website = "https://getartcraft.com/apps/cadcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "cadcraft" +rpm_package = "cadcraft" +desktop_categories = ["Graphics", "Engineering", "VectorGraphics"] +startup_wm_class = "ai.storyteller.cadcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/cadcraft-c126ff5030d0a0f3e63f039bae81ca63ba71230da2e6fca54e08df1119ea3443.png" +icon_sha256 = "c126ff5030d0a0f3e63f039bae81ca63ba71230da2e6fca54e08df1119ea3443" +ink_dark = [124, 200, 255] +ink_light = [26, 111, 168] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "CADCraft" +publisher = "ArtCraft" +repo = "storytold/cadcraft" +tagline = "Computer-aided design and drafting" +[apps.details] +headline = "Computer-aided drafting, with a familiar workflow." +about = "A drafting app with the command line, object snaps and workflow that drafters already know. Free, with no account and no subscription. In early, fast development." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Type L, click two points, type @5<45 and press Enter. Prompts with clickable keywords, polar tracking, direct distance entry and grips work the way drafting habit expects." +title = "The workflow you know" +[[apps.details.features]] +text = "Reads and writes DXF natively (R12 through 2018) and opens and saves DWG (R13 through 2018). Exports SVG and PNG." +title = "Open files" +[[apps.details.features]] +text = "A responsive, native drafting workspace." +title = "Fast and native" +[[apps.details.features]] +text = "Draw, modify, dimension, hatch and block commands, layers with a properties manager, paper-space layouts and PDF plotting." +title = "A full drafting toolset" +[[apps.details.features]] +text = "Every menu item, tool and prompt is a command, available over MCP, a JSON control channel or the CLI." +title = "Built for agents" +[[apps.details.shots]] +caption = "An apartment floor plan" +key = "apartment" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/cadcraft/apartment.jpg" +[[apps.details.shots]] +caption = "A mechanical bracket drawing" +key = "bracket" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/cadcraft/bracket.jpg" +[[apps.details.shots]] +caption = "A layout sheet" +key = "layout" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/cadcraft/layout.jpg" + +[[apps]] +color = [31, 157, 85] +former_bundles = [] +former_ids = [] +former_names = [] +id = "gridcraft" +binary = "gridcraft" +flatpak_id = "ai.storyteller.gridcraft" +mac_bundle_id = "ai.storyteller.gridcraft" +mac_bundle_name = "GridCraft" +website = "https://getartcraft.com/apps/gridcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "gridcraft" +rpm_package = "gridcraft" +desktop_categories = ["Office", "Spreadsheet"] +startup_wm_class = "ai.storyteller.gridcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/gridcraft-01ef35442b8d466b52068fda67ab740309321c8bc813b62b9207dfc4116208e7.png" +icon_sha256 = "01ef35442b8d466b52068fda67ab740309321c8bc813b62b9207dfc4116208e7" +ink_dark = [79, 214, 138] +ink_light = [18, 112, 58] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "GridCraft" +publisher = "ArtCraft" +repo = "storytold/gridcraft" +tagline = "Spreadsheets and data" +[apps.details] +headline = "Spreadsheets you already know how to use." +about = "A spreadsheet with the ribbon, formula bar, sheet tabs and shortcuts you know. No subscription, no license server and no telemetry." +platforms = "macOS, Windows, Linux, BSD, web" +[[apps.details.features]] +text = "The ribbon, formula bar, Name Box, fill handle, point-mode formulas, Format Cells, Paste Special, conditional formatting, tables and charts." +title = "Familiar" +[[apps.details.features]] +text = "XLSX is the native format, with formulas, tables, conditional formats, charts, pivot tables and print settings round-tripping. CSV and TSV too." +title = "Compatible" +[[apps.details.features]] +text = "A dependency-graph calculation engine with dynamic arrays, LET and LAMBDA, structured table references, sort, AutoFilter and Flash Fill." +title = "Capable" +[[apps.details.features]] +text = "Copy-on-write workbooks, incremental recalculation and a grid that only lays out what is on screen." +title = "Fast" +[[apps.details.features]] +text = "Every ribbon button, menu item, dialog and keystroke is a command, available over a JSON control channel, an MCP server or the CLI." +title = "Agent-native" +[[apps.details.features]] +text = "Work on the desktop and the web." +title = "Everywhere" +[[apps.details.shots]] +caption = "A quarterly sales dashboard" +key = "hero" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/hero.jpg" +[[apps.details.shots]] +caption = "A household budget" +key = "budget" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/budget.jpg" +[[apps.details.shots]] +caption = "A pivot table" +key = "pivot" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/pivot.jpg" +[[apps.details.shots]] +caption = "Formatting a chart" +key = "chart" +url = "https://raw.githubusercontent.com/storytold/craft-launcher-assets/v1/gridcraft/chart.jpg" + +[[apps]] +color = [194, 103, 43] +former_bundles = [] +former_ids = [] +former_names = [] +id = "texturecraft" +binary = "texturecraft" +flatpak_id = "ai.storyteller.texturecraft" +mac_bundle_id = "ai.storyteller.texturecraft" +mac_bundle_name = "TextureCraft" +website = "https://getartcraft.com/apps/texturecraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "texturecraft" +rpm_package = "texturecraft" +desktop_categories = ["Graphics", "3DGraphics"] +startup_wm_class = "texturecraft" +icon_url = "https://getartcraft.com/launcher-app-icons/texturecraft-ac629a038a215a13d86172286142502b6efd17618869652050f291d9745346d2.png" +icon_sha256 = "ac629a038a215a13d86172286142502b6efd17618869652050f291d9745346d2" +ink_dark = [229, 138, 78] +ink_light = [156, 74, 21] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "TextureCraft" +publisher = "ArtCraft" +repo = "storytold/texturecraft" +tagline = "3D texture painting" +[apps.details] +headline = "Paint textures on 3D models." +about = "Paint materials on 3D models and export textures." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Paint materials on 3D models and export textures." +title = "Materials" +[[apps.details.features]] +text = "Bake mesh maps and use smart materials." +title = "Mesh maps" + +[[apps]] +color = [23, 138, 156] +former_bundles = [] +former_ids = [] +former_names = [] +id = "materialcraft" +binary = "materialcraft" +flatpak_id = "ai.storyteller.materialcraft" +mac_bundle_id = "ai.storyteller.materialcraft" +mac_bundle_name = "MaterialCraft" +website = "https://github.com/storytold/materialcraft" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "materialcraft" +rpm_package = "materialcraft" +desktop_categories = ["Graphics", "3DGraphics"] +startup_wm_class = "materialcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/materialcraft-2844f2a4cf2b1d06c7eeaec8bddf13c69a0a1c3356e6767e8e97eb6b540a2c7c.png" +icon_sha256 = "2844f2a4cf2b1d06c7eeaec8bddf13c69a0a1c3356e6767e8e97eb6b540a2c7c" +ink_dark = [99, 197, 211] +ink_light = [16, 101, 115] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "MaterialCraft" +publisher = "ArtCraft" +repo = "storytold/materialcraft" +site = "https://github.com/storytold/materialcraft" +tagline = "Procedural material design" +[apps.details] +headline = "Build materials with node graphs." +about = "Create tileable PBR materials and export texture maps." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Combine noises, patterns and filters." +title = "Node graphs" +[[apps.details.features]] +text = "Preview materials in 2D and on 3D models." +title = "Live previews" + +[[apps]] +color = [78, 123, 251] +former_bundles = [] +former_ids = [] +former_names = [] +id = "craft-anything" +binary = "craft-anything" +flatpak_id = "ai.storyteller.craft-anything" +mac_bundle_id = "ai.storyteller.craft-anything" +mac_bundle_name = "Craft Anything" +website = "https://getartcraft.com/apps/craft-anything" +windows_msi_publisher = "Learning Machines LLC" +deb_package = "craft-anything" +rpm_package = "craft-anything" +desktop_categories = ["Development", "Debugger"] +startup_wm_class = "ai.storyteller.craft-anything" +icon_url = "https://getartcraft.com/launcher-app-icons/craft-anything-ddab399079b3a0a28a6584fb2ffd209bb0407896f20a8084551b5feb3060deb1.png" +icon_sha256 = "ddab399079b3a0a28a6584fb2ffd209bb0407896f20a8084551b5feb3060deb1" +ink_dark = [116, 170, 255] +ink_light = [22, 89, 196] +kind = "official" +mac_team = "DJ6XS33FX8" +name = "Craft Anything" +publisher = "ArtCraft" +repo = "storytold/craft-anything" +tagline = "Find out how any software works, then craft your own" +[apps.details] +headline = "See how any website, app or game works, then build your own." +about = "Point it at a target and say what you want. It studies the original with real inspection tools, has a coding agent build a new project in the stack you ask for, checks the result against the original and refines it. Open source and clean-room." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Websites, desktop apps, phone apps, games and files: find out how they're built, with the evidence behind every answer." +title = "Study anything" +[[apps.details.features]] +text = "Say what you want and a coding agent builds a new project in the language or engine you name." +title = "Build your own" +[[apps.details.features]] +text = "Every build is compared with the original, at three screen widths for a page, and refined until it's close." +title = "Checked, not guessed" +[[apps.details.features]] +text = "Every tool is a CLI command and an MCP tool, and no AI is needed just to inspect." +title = "Agent-ready" + +[[apps]] +bundle = "io.tangencylabs.solidcraft" +color = [70, 161, 251] +former_bundles = ["ai.storyteller.solidcraft", "ai.storyteller.solvecraft"] +former_ids = [] +former_names = [] +id = "solidcraft" +binary = "solidcraft" +flatpak_id = "io.tangencylabs.solidcraft" +mac_bundle_id = "io.tangencylabs.solidcraft" +mac_bundle_name = "SolidCraft" +website = "https://solidcraft.io" +windows_msi_publisher = "SolidCraft contributors" +deb_package = "solidcraft" +rpm_package = "solidcraft" +desktop_categories = ["Graphics"] +startup_wm_class = "io.tangencylabs.solidcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/solidcraft-46e019499579b2f477228021dd91b187303921da5d4cd14f1002a10976cf0475.png" +icon_sha256 = "46e019499579b2f477228021dd91b187303921da5d4cd14f1002a10976cf0475" +ink_dark = [140, 196, 255] +ink_light = [22, 83, 174] +kind = "community" +mac_team = "G5QA5U5X2S" +msi_publisher = "SolidCraft contributors" +name = "SolidCraft" +publisher = "Tangency Labs" +repo = "tangency-labs/solidcraft" +site = "https://solidcraft.io" +tagline = "Parametric 3D CAD" +[apps.details] +headline = "Parametric 3D CAD, with editable sketches and solids." +about = "A parametric solid modeller by Tangency Labs. Sketch, constrain and build solids on an editable feature timeline: change a dimension and the model rebuilds. Early, but usable for simple parts. Open source, and it can be driven by AI agents through its MCP server." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Lines, arcs, splines and text, solved by SolidCraft's own constraint solver, with parameter-driven dimensions." +title = "Sketches and constraints" +[[apps.details.features]] +text = "Extrude, revolve, sweep, loft, fillet, chamfer, shell, holes, threads and patterns on a parametric timeline." +title = "Features" +[[apps.details.features]] +text = "STEP, IGES, 3MF, STL, OBJ and glTF in and out where supported, and .sc designs." +title = "Files" +[[apps.details.features]] +text = "A desktop app, a browser app, a headless CLI and an MCP server, all running the same commands." +title = "Desktop, web and agents" + +[[apps]] +bundle = "io.github.billsecond.mailcraft" +color = [15, 104, 240] +former_bundles = [] +former_ids = [] +former_names = [] +id = "mailcraft" +binary = "mailcraft" +flatpak_id = "io.github.billsecond.mailcraft" +mac_bundle_id = "io.github.billsecond.mailcraft" +mac_bundle_name = "MailCraft" +website = "https://mailcraft.work" +windows_msi_publisher = "MailCraft contributors" +deb_package = "mailcraft" +rpm_package = "mailcraft" +desktop_categories = ["Graphics"] +startup_wm_class = "io.github.billsecond.mailcraft" +icon_url = "https://getartcraft.com/launcher-app-icons/mailcraft-dd0e62a27b0066ae5f461d5f829cfa143b49ca6a1b9dc9b47686818edd664bf7.png" +icon_sha256 = "dd0e62a27b0066ae5f461d5f829cfa143b49ca6a1b9dc9b47686818edd664bf7" +ink_dark = [143, 191, 255] +ink_light = [6, 52, 196] +kind = "community" +msi_publisher = "MailCraft contributors" +name = "MailCraft" +publisher = "UCS Care Group" +repo = "UCS-Care-Group/mailcraft" +site = "https://mailcraft.work" +tagline = "Mail, calendar and contacts" +[apps.details] +headline = "Mail, calendar, contacts and tasks, in one native app." +about = "An open-source mail program by UCS Care Group, written from scratch in Rust: the folder pane, message list and reading pane people already know, with a calendar, people and to-dos. Works with Microsoft 365, Outlook.com and IMAP. In public beta, and it can be driven by AI agents through its MCP server." +platforms = "macOS, Windows, Linux, FreeBSD, web" +[[apps.details.features]] +text = "Conversations, flags, categories, rules, search with a query language, and HTML mail shown without running anything in it." +title = "Mail" +[[apps.details.features]] +text = "Day, week and month views, recurring meetings, invitations and reminders, kept in step with Microsoft 365." +title = "Calendar" +[[apps.details.features]] +text = ".eml, .mbox, .ics and .vcf in and out, and the mail and contacts of an Outlook .pst file in." +title = "Files" +[[apps.details.features]] +text = "A desktop app, a browser app, a CLI and an MCP server, all running the same commands." +title = "Desktop, web and agents" diff --git a/crates/core/tests/fixtures/hosted-catalog.toml.sig b/crates/core/tests/fixtures/hosted-catalog.toml.sig new file mode 100644 index 00000000..781a4610 --- /dev/null +++ b/crates/core/tests/fixtures/hosted-catalog.toml.sig @@ -0,0 +1 @@ +jBP6IMAHVzXER9SxsJRy8NFFD8jJkG9GxLuqJxeNDIOaQFZbmLgEwaFv9PmNFRHW5z+rj4P6rixNKSKX2/NuAg== diff --git a/crates/native/src/backend.rs b/crates/native/src/backend.rs index 5da76788..4634b351 100644 --- a/crates/native/src/backend.rs +++ b/crates/native/src/backend.rs @@ -13,7 +13,7 @@ use artcraft_launcher_core::protocol::{ Source, VersionTrack, }; use artcraft_launcher_core::release::{Asset, Release}; -use artcraft_launcher_core::{CraftApp, Installed, PackageKind, SUITE, version}; +use artcraft_launcher_core::{CraftApp, Installed, PackageKind, version}; use crate::feed_throttle::{self, FeedThrottle, Outcome}; use crate::http::{self, Http, Stop}; @@ -301,7 +301,7 @@ impl NativeBackend { let pre = options.prereleases; let feed = if pre { None } else { load_feed(&self.paths) }; let now = crate::now(); - for app in SUITE.iter().filter(|a| self.platform.is_none_or(|p| a.runs_on(p.os))) { + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| self.platform.is_none_or(|p| a.runs_on(p.os))) { let answer = match feed.as_ref().map(|f| f.answer(app, now)) { Some(FeedAnswer::Fresh(Some(r))) => Some((LatestRelease::Found(r), Origin::ArtCraftApi)), Some(FeedAnswer::Fresh(None)) => Some((LatestRelease::None, Origin::ArtCraftApi)), @@ -323,7 +323,7 @@ impl NativeBackend { let paths = self.paths.clone(); let platform = self.platform; std::thread::spawn(move || { - for app in SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { report_partial(app, &shared, &paths, platform); } }); @@ -349,12 +349,12 @@ impl NativeBackend { http::clean_downloads(&paths.downloads(), Duration::from_secs(30 * 86_400), Duration::from_secs(7 * 86_400)); let snapshot = crate::detect::Snapshot::take(); let manifest = shared.manifest.lock().unwrap_or_else(PoisonError::into_inner).clone(); - for app in SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { let found = crate::detect::detect(app, &manifest, &snapshot); publish_detected(app, found, &shared, platform); } // Downloads paused (or cut off by quitting) in an earlier run. - for app in SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { report_partial(app, &shared, &paths, platform); } drop(busy); @@ -366,7 +366,9 @@ impl NativeBackend { /// day old, or no answer at all), at most once an hour per app unless `force`. fn check(&self, force: bool) { let (Some(source), Some(http)) = (self.source.clone(), self.http.clone()) else { - for app in SUITE.iter().filter(|a| self.platform.is_none_or(|p| a.runs_on(p.os))) { + crate::hosted_catalog::load_once(None, &self.paths); + self.shared.emit(Event::CatalogUpdated); + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| self.platform.is_none_or(|p| a.runs_on(p.os))) { self.shared.emit(Event::Latest { app: app.id.to_string(), latest: LatestRelease::Failed("secure connections aren't available".into()), @@ -390,24 +392,34 @@ impl NativeBackend { std::thread::spawn(move || { let busy = busy; shared.emit(Event::CheckStarted); + crate::hosted_catalog::load_once(Some(&http), &paths); + shared.emit(Event::CatalogUpdated); let (feed, fallback) = check_plan(&http, mirror.as_ref(), pre, &paths, &shared); if let Some(f) = &feed { shared.emit(Event::Notices { announcements: f.announcements.clone(), alerts: f.alerts.clone() }); } let now = crate::now(); let queue = Mutex::new( - SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))).chain(std::iter::once(&LAUNCHER)).collect::>(), + artcraft_launcher_core::hosted_catalog::apps() + .iter() + .filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) + .chain(std::iter::once(&LAUNCHER)) + .collect::>(), ); let sources = sweep(&queue, &mirror, feed.as_ref(), fallback, &source, &shared, &paths, (platform, &options), force, now); source.save(); { let answered = shared.answered.lock().unwrap_or_else(PoisonError::into_inner); - if SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))).all(|a| answered.contains(a.id)) { + if artcraft_launcher_core::hosted_catalog::apps() + .iter() + .filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) + .all(|a| answered.contains(a.id)) + { shared.loaded.store(true, Ordering::SeqCst); } } // A newer release changes which file an install would use. - for app in SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) { report_partial(app, &shared, &paths, platform); } let source_used = source_used_of(&sources); @@ -555,17 +567,31 @@ impl NativeBackend { } } + /// What updating this launcher to the newer release takes, when this copy can replace itself + /// and the release has the file the update downloads. Otherwise the UI offers the download. + fn launcher_update_job(&self) -> Option<(crate::self_update::Install, Release, Platform)> { + let install = self.shared.self_install.get().cloned().flatten()?; + let platform = self.platform?; + let release = self.shared.launcher_release.lock().unwrap_or_else(PoisonError::into_inner).clone()?; + crate::self_update::installs_from(&install, &release, platform).then_some((install, release, platform)) + } + /// Downloads the newer launcher, puts it in place and asks the UI to quit so it can start. fn update_launcher(&self) { let id = LAUNCHER_ID.to_string(); - let (Some(install), Some(platform)) = (self.shared.self_install.get().cloned().flatten(), self.platform) else { + let refuse = || { self.shared.emit(Event::JobFinished { - app: id, + app: id.clone(), result: Err("this copy of ArtCraft Launcher can't update itself; download the new version instead".into()), }); - return; }; - let Some(release) = self.shared.launcher_release.lock().unwrap_or_else(PoisonError::into_inner).clone() else { return }; + if self.shared.self_install.get().cloned().flatten().is_none() || self.platform.is_none() { + return refuse(); + } + if self.shared.launcher_release.lock().unwrap_or_else(PoisonError::into_inner).is_none() { + return; + } + let Some((install, release, platform)) = self.launcher_update_job() else { return refuse() }; let stop = Arc::new(Stop::default()); { let mut jobs = self.shared.jobs.lock().unwrap_or_else(PoisonError::into_inner); @@ -791,7 +817,7 @@ fn run_install( let InstallPlan { release, platform, asset, kind } = install_plan(app, latest, platform, options, (existing, record), Asking::Install)?; let http = http.ok_or("secure connections aren't available on this system")?; let track = options.versions.get(app.id).unwrap_or(&VersionTrack::Stable); - // Going back to a version chosen by name. A macOS bundle or a launcher AppImage keeps the old + // Going back to a version chosen by name. A macOS bundle, a launcher AppImage or Flatpak keeps the old // copy until the new one is in place. Otherwise the installed version's own package is found // first, so a downgrade that fails can put it back. Without it nothing changes. let keeps_old_copy = install::keeps_old_copy(kind, existing, record); @@ -1609,7 +1635,7 @@ impl Backend for NativeBackend { Some(Os::Windows) => "Show in Explorer", _ => "Show in Files", }; - Capabilities { manage_apps: true, reveal_label, self_update: self.shared.self_install.get().is_some_and(Option::is_some) } + Capabilities { manage_apps: true, reveal_label, self_update: self.launcher_update_job().is_some() } } fn platform(&self) -> Option { @@ -2905,4 +2931,34 @@ mod tests { }); assert!(!restarting.load(Ordering::SeqCst)); } + + #[test] + fn a_launcher_release_without_a_file_for_this_copy_is_offered_as_a_download() { + use crate::self_update::Install; + // ArtCraft Launcher v0.17.0's macOS file: the disk image only. + let name = "artcraft-launcher-0.17.0-macos-universal.dmg"; + let release = Release { + assets: vec![Asset { name: name.into(), size: 1, url: format!("https://example.invalid/{name}"), sha256: None }], + ..Release::default() + }; + let mac = Platform { os: Os::MacOs, arch: Arch::Arm64 }; + for (install, updates) in + [(Install::MacApp("/Applications/ArtCraft Launcher.app".into()), true), (Install::Standalone("/tmp/artcraft-launcher".into()), false)] + { + let dir = tempfile::tempdir().unwrap(); + let mut backend = backend(dir.path(), mac, None); + backend.shared.self_install.set(Some(install.clone())).unwrap(); + *backend.shared.launcher_release.lock().unwrap() = Some(release.clone()); + assert_eq!(backend.capabilities().self_update, updates, "{install:?}"); + if !updates { + backend.update_launcher(); + let events = backend.poll(); + assert!( + matches!(&events[..], [Event::JobFinished { app, result: Err(_) }] if app == LAUNCHER_ID), + "it refuses without starting a download: {events:?}" + ); + assert!(backend.shared.jobs.lock().unwrap().is_empty()); + } + } + } } diff --git a/crates/native/src/desktop_entry.rs b/crates/native/src/desktop_entry.rs index 5819c6b9..04cb1deb 100644 --- a/crates/native/src/desktop_entry.rs +++ b/crates/native/src/desktop_entry.rs @@ -18,6 +18,9 @@ pub const MARKER: &str = "X-ArtCraft-Launcher=true"; /// The menu categories and the window class each app's own `.desktop` file declares. pub fn meta(app: &CraftApp) -> (&'static str, Option<&'static str>) { + if let Some(meta) = artcraft_launcher_core::hosted_catalog::metadata(app.id) { + return (meta.desktop_categories.as_str(), Some(meta.startup_wm_class.as_str())); + } match app.id { "artcraft" => ("Graphics;AudioVideo;2DGraphics;", Some("artcraft")), "photocraft" => ("Graphics;2DGraphics;RasterGraphics;Photography;", Some("photocraft")), diff --git a/crates/native/src/detect.rs b/crates/native/src/detect.rs index d9a6cd51..d6119941 100644 --- a/crates/native/src/detect.rs +++ b/crates/native/src/detect.rs @@ -465,7 +465,7 @@ pub mod linux { /// pacman, Flatpak). Read once per detection pass. pub fn packages() -> Vec { let ours = |name: &str| { - artcraft_launcher_core::SUITE.iter().any(|a| { + artcraft_launcher_core::hosted_catalog::apps().iter().any(|a| { [InstallSource::Deb, InstallSource::Rpm, InstallSource::Pacman, InstallSource::Flatpak] .iter() .any(|m| crate::packages::candidate_names(a, *m).iter().any(|n| n == name)) @@ -511,10 +511,9 @@ pub mod linux { user_ids.extend(flatpaks.iter().map(|(id, _, _, _)| id.clone())); } // Bundles built from a release tarball often list no version: ask Flatpak directly. - for (id, version, _, installation) in flatpaks - .iter_mut() - .filter(|(id, v, _, _)| v.is_empty() && artcraft_launcher_core::SUITE.iter().any(|a| a.bundle_ids().any(|b| b == *id))) - { + for (id, version, _, installation) in flatpaks.iter_mut().filter(|(id, v, _, _)| { + v.is_empty() && artcraft_launcher_core::hosted_catalog::apps().iter().any(|a| a.bundle_ids().any(|b| b == *id)) + }) { let scope_arg = packages::flatpak_scope(if scope.is_empty() { installation.as_deref() } else { Some("user") }); let info_args = ["info", &scope_arg, &arch, id]; if let Some(v) = crate::process::capture_flatpak(&info_args, t).as_deref().and_then(packages::parse_flatpak_info) { @@ -754,7 +753,7 @@ mod linux_tests { #[test] fn ours_filter_matches_rpm_packages() { let ours = |name: &str| { - artcraft_launcher_core::SUITE.iter().any(|a| { + artcraft_launcher_core::hosted_catalog::apps().iter().any(|a| { [InstallSource::Deb, InstallSource::Rpm, InstallSource::Pacman, InstallSource::Flatpak] .iter() .any(|m| crate::packages::candidate_names(a, *m).iter().any(|n| n == name)) diff --git a/crates/native/src/hosted_catalog.rs b/crates/native/src/hosted_catalog.rs new file mode 100644 index 00000000..d0a3a2ba --- /dev/null +++ b/crates/native/src/hosted_catalog.rs @@ -0,0 +1,154 @@ +//! Startup-only signed catalog refresh with an atomic, reverified disk fallback. +use std::collections::HashMap; +use std::io::Read; +use std::path::Path; +use std::sync::Once; + +use artcraft_launcher_core::hosted_catalog::{ + CATALOG_URL, MAX_CATALOG_BYTES, MAX_ICON_BYTES, MAX_SIGNATURE_BYTES, SIGNATURE_URL, VerifiedCatalog, valid_icon, +}; +use serde::{Deserialize, Serialize}; + +use crate::http::Http; +use crate::paths::{Paths, write_atomic}; + +static LOADED: Once = Once::new(); + +#[derive(Serialize, Deserialize)] +struct Saved { + catalog: String, + signature: String, +} + +pub fn load_once(http: Option<&Http>, paths: &Paths) { + LOADED.call_once(|| { + let cache = paths.feed_cache().with_file_name("launcher-catalog.json"); + let remote = http.ok_or_else(|| "HTTPS unavailable".to_string()).and_then(|h| { + let catalog = h.get_catalog_bytes(CATALOG_URL, MAX_CATALOG_BYTES)?.ok_or("hosted catalog is not published")?; + let signature = h.get_catalog_bytes(SIGNATURE_URL, MAX_SIGNATURE_BYTES)?.ok_or("catalog signature is not published")?; + let verified = VerifiedCatalog::verify(&catalog, &signature)?; + let saved = Saved { + catalog: String::from_utf8(catalog).map_err(|_| "catalog is not UTF-8")?, + signature: String::from_utf8(signature).map_err(|_| "signature is not UTF-8")?, + }; + Ok((verified, saved)) + }); + let catalog = match remote { + Ok((verified, saved)) => { + if let Ok(bytes) = serde_json::to_vec(&saved) + && let Err(why) = write_atomic(&cache, &bytes) + { + log::warn!("could not cache signed catalog: {why}"); + } + Some(verified) + } + Err(why) => { + log::warn!("hosted catalog unavailable: {why}; trying verified cache, then bundled catalog"); + saved_catalog(&cache) + } + }; + if let Some(catalog) = catalog { + if catalog.rejected_entries > 0 { + log::warn!("ignored {} invalid catalog entries", catalog.rejected_entries); + } + let mut icons = HashMap::new(); + let mut network_available = true; + for (id, url, digest) in catalog.icons() { + if artcraft_launcher_core::catalog::app_icon_png(id).is_some_and(|b| valid_icon(b, digest)) { + continue; + } + let saved = cache.with_file_name(format!("catalog-icon-{digest}.png")); + let icon = read_capped(&saved, MAX_ICON_BYTES).filter(|b| valid_icon(b, digest)).or_else(|| { + if !network_available { + return None; + } + let bytes = match http?.get_catalog_bytes(url, MAX_ICON_BYTES) { + Ok(bytes) => bytes?, + Err(_) => { + network_available = false; + return None; + } + }; + if !valid_icon(&bytes, digest) { + return None; + } + if let Err(why) = write_atomic(&saved, &bytes) { + log::warn!("could not cache catalog icon: {why}"); + } + Some(bytes) + }); + if let Some(icon) = icon { + icons.insert(id.to_string(), icon); + } + } + catalog.activate(icons); + } + }); +} + +fn saved_catalog(path: &Path) -> Option { + // JSON escaping can expand a signed TOML byte to six bytes. + let bytes = read_capped(path, MAX_CATALOG_BYTES * 6 + MAX_SIGNATURE_BYTES + 128)?; + let saved: Saved = serde_json::from_slice(&bytes).ok()?; + VerifiedCatalog::verify(saved.catalog.as_bytes(), saved.signature.as_bytes()).ok() +} + +fn read_capped(path: &Path, max: usize) -> Option> { + let file = std::fs::File::open(path).ok()?; + if file.metadata().ok()?.len() > max as u64 { + return None; + } + let mut bytes = Vec::new(); + file.take(max as u64 + 1).read_to_end(&mut bytes).ok()?; + (bytes.len() <= max).then_some(bytes) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[ignore = "requires the live signed catalog at getartcraft.com"] + fn live_catalog_is_verified_cached_and_activated() { + let dir = tempfile::tempdir().unwrap(); + let paths = Paths::under(dir.path()); + let http = Http::new().unwrap(); + load_once(Some(&http), &paths); + let cache = paths.feed_cache().with_file_name("launcher-catalog.json"); + let verified = saved_catalog(&cache).expect("live catalog must be cached and verify with the pinned key"); + assert_eq!(verified.rejected_entries, 0); + let icons: Vec<_> = verified.icons().collect(); + assert!(!icons.is_empty()); + for (id, _, digest) in icons { + assert!(artcraft_launcher_core::hosted_catalog::apps().iter().any(|app| app.id == id)); + let icon = artcraft_launcher_core::catalog::app_icon_png(id).unwrap(); + assert!(valid_icon(icon, digest), "invalid live icon for {id}"); + } + } + + #[test] + fn cached_catalog_is_reverified_and_tampered_cache_is_ignored() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("catalog.json"); + let mut saved = Saved { + catalog: include_str!("../../core/tests/fixtures/hosted-catalog.toml").into(), + signature: include_str!("../../core/tests/fixtures/hosted-catalog.toml.sig").into(), + }; + write_atomic(&path, &serde_json::to_vec(&saved).unwrap()).unwrap(); + assert!(saved_catalog(&path).is_some()); + saved.catalog.push('\n'); + write_atomic(&path, &serde_json::to_vec(&saved).unwrap()).unwrap(); + assert!(saved_catalog(&path).is_none()); + write_atomic(&path, b"not JSON").unwrap(); + assert!(saved_catalog(&path).is_none()); + } + + #[test] + fn capped_cache_reads_reject_announced_or_actual_oversize() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("cache"); + std::fs::write(&path, b"abcd").unwrap(); + assert_eq!(read_capped(&path, 4).unwrap(), b"abcd"); + assert!(read_capped(&path, 3).is_none()); + } +} diff --git a/crates/native/src/http.rs b/crates/native/src/http.rs index d27b9964..a763d15e 100644 --- a/crates/native/src/http.rs +++ b/crates/native/src/http.rs @@ -197,6 +197,18 @@ impl Http { /// on the body when the length wasn't announced or was wrong. pub fn get_bytes(&self, url: &str, max: usize) -> Result>, String> { let agent = if is_loopback(url) { &self.direct } else { &self.small }; + Self::get_bytes_with(agent, url, max) + } + + /// Catalog resources remain on the pinned HTTPS website; redirect responses are refused. + pub fn get_catalog_bytes(&self, url: &str, max: usize) -> Result>, String> { + if !url.starts_with("https://getartcraft.com/") { + return Err("catalog resources must use the pinned HTTPS website".into()); + } + Self::get_bytes_with(&self.no_redirect, url, max) + } + + fn get_bytes_with(agent: &ureq::Agent, url: &str, max: usize) -> Result>, String> { let mut resp = agent.get(url).call().map_err(|e| format!("{UNREACHABLE} {} ({e})", host(url)))?; match resp.status().as_u16() { 200 => { diff --git a/crates/native/src/install.rs b/crates/native/src/install.rs index 1db3d7f3..f4d61e52 100644 --- a/crates/native/src/install.rs +++ b/crates/native/src/install.rs @@ -86,12 +86,16 @@ pub enum Downgrade<'a> { /// Whether going back over `existing` keeps the old copy until the new one is in place, the same /// way an update does. A macOS bundle is moved aside and moved back if the swap fails. An /// AppImage the launcher installed (`previous` records it) is renamed in whole, and the old file -/// is removed only after that. A tarball is left out: its `bin` and `share` swap one at a time. +/// is removed only after that. A Flatpak bundle over the launcher's own Flatpak (same bundle +/// origin) deploys the new commit before undeploying the old one, as an update does; a Flatpak +/// from a repository is left to that repository. A tarball is left out: its `bin` and `share` +/// swap one at a time. pub fn keeps_old_copy(kind: PackageKind, existing: Option<&Installed>, previous: Option<&Record>) -> bool { let source = existing.map(|inst| inst.source); match kind { PackageKind::Dmg => source == Some(InstallSource::MacApp), PackageKind::AppImage => source == Some(InstallSource::Launcher) && previous.is_some_and(|r| r.kind == PackageKind::AppImage), + PackageKind::Flatpak => existing.is_some_and(|inst| inst.source == InstallSource::Flatpak && !inst.externally_managed), _ => false, } } @@ -2910,6 +2914,14 @@ mod tests { assert!(!keeps_old_copy(PackageKind::AppImage, Some(&installed(InstallSource::AppImage)), Some(&appimage))); assert!(!keeps_old_copy(PackageKind::AppImage, Some(&portable), Some(&tarball))); assert!(!keeps_old_copy(PackageKind::TarGz, Some(&portable), Some(&tarball))); + // A Flatpak bundle over the launcher's own Flatpak keeps it; one from a repository doesn't. + let flatpak = installed(InstallSource::Flatpak); + let managed = Installed { externally_managed: true, ..installed(InstallSource::Flatpak) }; + assert!(keeps_old_copy(PackageKind::Flatpak, Some(&flatpak), None)); + assert!(downgrade_is_safe(keep, PackageKind::Flatpak, Some(&flatpak), None)); + assert!(!keeps_old_copy(PackageKind::Flatpak, Some(&managed), None)); + assert!(!keeps_old_copy(PackageKind::Flatpak, Some(&portable), None)); + assert!(!keeps_old_copy(PackageKind::Flatpak, None, None)); // Each way back fits one kind of install; anything else is refused. assert!(downgrade_is_safe(None, PackageKind::AppImage, Some(&portable), None)); assert!(downgrade_is_safe(keep, PackageKind::Dmg, Some(&mac), None)); diff --git a/crates/native/src/install/msi_batch.rs b/crates/native/src/install/msi_batch.rs index 7136bc8c..496015fb 100644 --- a/crates/native/src/install/msi_batch.rs +++ b/crates/native/src/install/msi_batch.rs @@ -92,7 +92,8 @@ pub(super) struct Held { } /// Opens `msi` so that it cannot be changed, moved or deleted while held, and checks that it still -/// has the `sha256` it was downloaded against. +/// has the `sha256` it was downloaded against. A symbolic link is refused: a held link can still +/// be pointed at another file. #[cfg(windows)] pub(super) fn hold(msi: &Path, sha256: &str) -> Result { use std::os::windows::fs::OpenOptionsExt; @@ -101,11 +102,17 @@ pub(super) fn hold(msi: &Path, sha256: &str) -> Result { /// Others may read the file, but not write, rename or delete it. const FILE_SHARE_READ: u32 = 0x1; + /// Opens a link itself instead of the file it points at. + const FILE_FLAG_OPEN_REPARSE_POINT: u32 = 0x0020_0000; let mut file = std::fs::File::options() .read(true) .share_mode(FILE_SHARE_READ) + .custom_flags(FILE_FLAG_OPEN_REPARSE_POINT) .open(msi) .map_err(|e| format!("couldn't keep the checked package {} safe until it is installed ({e})", msi.display()))?; + if file.metadata().map_err(|e| format!("couldn't read {} ({e})", msi.display()))?.file_type().is_symlink() { + return Err(format!("{} is a link, so it wasn't installed.", msi.display())); + } let mut hasher = Sha256::new(); std::io::copy(&mut file, &mut hasher).map_err(|e| format!("couldn't read {} ({e})", msi.display()))?; let digest: String = hasher.finalize().iter().map(|byte| format!("{byte:02x}")).collect(); diff --git a/crates/native/src/install/msi_batch/tests.rs b/crates/native/src/install/msi_batch/tests.rs index 842948a5..d4318b4e 100644 --- a/crates/native/src/install/msi_batch/tests.rs +++ b/crates/native/src/install/msi_batch/tests.rs @@ -99,6 +99,20 @@ mod holding { let error = hold(&msi, &sha).err().unwrap(); assert!(error.contains("changed after it was checked"), "{error}"); } + + #[test] + fn a_link_is_not_held_because_it_can_be_pointed_elsewhere() { + let dir = tempfile::tempdir().unwrap(); + let (msi, sha) = package(dir.path()); + let link = dir.path().join("link.msi"); + // Creating a link needs Developer Mode or an elevated account. + if std::os::windows::fs::symlink_file(&msi, &link).is_err() { + return; + } + let error = hold(&link, &sha).err().unwrap(); + assert!(error.contains("is a link"), "{error}"); + assert!(hold(&msi, &sha).is_ok()); + } } /// Runs the generated elevated script for real, but not elevated and with `cmd.exe` standing in for diff --git a/crates/native/src/install/msi_session.rs b/crates/native/src/install/msi_session.rs index d05206db..50cdfada 100644 --- a/crates/native/src/install/msi_session.rs +++ b/crates/native/src/install/msi_session.rs @@ -8,19 +8,23 @@ //! window. A hidden, elevated, encoded PowerShell route did this before and was withdrawn after //! behavioural antivirus flagged it (see `docs/incident-2026-10-windows-antivirus.md`). //! -//! The elevated copy re-checks every package against the checksum its release published — with -//! the file held open, so the checked bytes are the installed ones (CWE-367) — builds each -//! installer's arguments from that held package itself (the manifest says where and in which -//! context a package installs, never *which* file installs), runs Windows Installer on each in -//! turn, and writes each app's exit code to a results file beside the manifest. A declined -//! prompt cancels the whole batch; a session that cannot start sends the members back to -//! installing one by one, the way a single app always installs. +//! The elevated copy re-checks every package against the manifest's checksum — with the file held +//! open, so the checked bytes are the installed ones (CWE-367) — and installs it only when its +//! Authenticode signature names the launcher's own publisher. It builds each installer's +//! arguments from that held package itself (the manifest says where and in which context a +//! package installs, never *which* file installs), runs Windows Installer on each in turn, and +//! writes each app's exit code to a results file beside the manifest. A declined prompt cancels +//! the whole batch; a session that cannot start sends the members back to installing one by one, +//! the way a single app always installs, and so does a package from another publisher. //! -//! The trust chain: the manifest is created anew (`create_new`) and then held open unmodified for -//! the whole session, so its checksums are the launcher's own; the elevated side re-hashes every -//! package through a held handle before Windows Installer touches it, and runs the installer on -//! that same held file. The results file is bound to its session by a random token (written as -//! the file's first line), so no leftover or planted file can pass for a session's report; the +//! The trust chain: the manifest is in a folder every process of the user can write, and any of +//! them can start the elevated copy on one, so the signature is the check the elevated side makes +//! on its own. The manifest of a real session is created anew (`create_new`) and then held open +//! unmodified for the whole session. The elevated side re-hashes every package through a held +//! handle before Windows Installer touches it, and runs the installer on that same held file. It +//! writes its process id and its results only to new files. The results file is bound to its +//! session by a random token (written as the file's first line), so no leftover or planted file +//! can pass for a session's report; the //! launcher's own re-detection after each job is the backstop against a report that lies. And //! the waiting side falls back to one-by-one installs only when the elevated session is *shown* //! to be over — its process waited out or its process id gone — never while it may still be @@ -50,11 +54,10 @@ pub(super) const NO_SESSION: &str = "no batch session"; #[cfg(windows)] const STARTED_WITHIN: std::time::Duration = std::time::Duration::from_secs(300); -/// How long a process id that cannot be opened is given the benefit of the doubt: opening a -/// just-started elevated process can fail for a moment, and "cannot open" must never be read as -/// "not running" while it keeps failing. +/// How long the installer queue is kept for a session that has started but cannot be opened or +/// waited for ([`Seen::Unwatched`]). It ends sooner when the session reports. #[cfg(windows)] -const OPEN_GRACE: std::time::Duration = std::time::Duration::from_secs(10); +const UNWATCHED_LIMIT: std::time::Duration = std::time::Duration::from_secs(4 * 60 * 60); /// One package of the batch, as both sides of the session see it. It carries no command line: /// the elevated side builds the installer's arguments from the held package itself @@ -129,26 +132,7 @@ fn sibling(manifest: &Path, extension: &str) -> PathBuf { pub(super) fn call(_command: &[OsString], targets: &[OsString]) -> Vec> { use artcraft_launcher_core::protocol::CANCELLED; - use super::msi_batch; - - // A member joins the session only if its package is held and checks out again; anything - // else falls back to installing by itself, or hears its own error. - let mut outcomes: Vec> = Vec::with_capacity(targets.len()); - let mut joined: Vec<(usize, Entry)> = Vec::new(); - let mut held: Vec = Vec::new(); - for (at, target) in targets.iter().enumerate() { - match parse(target.as_os_str()) { - Some(entry) => match msi_batch::hold(&entry.msi, &entry.sha256) { - Ok(file) => { - held.push(file); - outcomes.push(Ok(())); - joined.push((at, entry)); - } - Err(e) => outcomes.push(Err(e)), - }, - None => outcomes.push(Err(NO_SESSION.into())), - } - } + let (mut outcomes, joined, mut held) = join(targets, &signed_by_this_launcher); let Some((_, first)) = joined.first() else { return outcomes; }; @@ -212,6 +196,58 @@ pub(super) fn call(_command: &[OsString], targets: &[OsString]) -> Vec>, Vec<(usize, Entry)>, Vec); + +/// A member joins the session only if its package is held, checks out again and passes `signed`, +/// the check the elevated copy makes too. A package from another publisher installs by itself, +/// under its own prompt; any other failure is that member's own error. +#[cfg(windows)] +fn join(targets: &[OsString], signed: &dyn Fn(&Path) -> Result<(), String>) -> Joined { + let mut outcomes: Vec> = Vec::with_capacity(targets.len()); + let mut joined: Vec<(usize, Entry)> = Vec::new(); + let mut held: Vec = Vec::new(); + for (at, target) in targets.iter().enumerate() { + match parse(target.as_os_str()) { + Some(entry) => match super::msi_batch::hold(&entry.msi, &entry.sha256) { + Ok(file) => match signed(&entry.msi) { + Ok(()) => { + held.push(file); + outcomes.push(Ok(())); + joined.push((at, entry)); + } + Err(e) => { + log::info!("{}: {e}; installing it by itself", entry.app); + outcomes.push(Err(NO_SESSION.into())); + } + }, + Err(e) => outcomes.push(Err(e)), + }, + None => outcomes.push(Err(NO_SESSION.into())), + } + } + (outcomes, joined, held) +} + +/// Accepts `file` when it carries a valid Authenticode signature from the same publisher as +/// `reference`. Refuses an unsigned file, another publisher's, and every file when `reference` +/// itself isn't signed. +#[cfg(windows)] +fn signed_like(reference: &Path, file: &Path) -> Result<(), String> { + let publisher = |path: &Path| verifysign::verify_file(path).map(|signature| signature.subject_name()); + let ours = publisher(reference).map_err(|e| format!("this copy of the launcher isn't signed ({e})"))?; + let theirs = publisher(file).map_err(|e| format!("{} isn't signed ({e})", file.display()))?; + if ours == theirs { Ok(()) } else { Err(format!("{} isn't signed by the launcher's publisher", file.display())) } +} + +/// [`signed_like`] with this running program as the reference. +#[cfg(windows)] +fn signed_by_this_launcher(file: &Path) -> Result<(), String> { + let me = std::env::current_exe().map_err(|e| format!("couldn't find this program ({e})"))?; + signed_like(&me, file) +} + /// Writes the manifest the elevated copy reads, holding it and every package unchanged for as /// long as the session runs. The name is only taken once its results and process-id files are /// free too: a leftover of another session must never be mistaken for this one's. @@ -304,20 +340,28 @@ enum SessionEnd { /// It is definitely over (its process is gone) but said nothing: the members may safely /// install one by one, because nothing of the session is running any more. OverWithoutReport, - /// It was launched and cannot be shown to be over. Falling back here would race whatever it - /// may still install, so the members hear an error instead. + /// It was launched and cannot be shown to be over within the limits above, so the members + /// hear an error instead of falling back. Unknown, } +/// What a look at the elevated copy's process found. +#[cfg(windows)] +enum Seen { + /// The process ended, or its id no longer exists. + Over, + /// The process could not be opened or waited for, so it may still be running. + Unwatched, +} + /// Waits for the elevated copy: it writes its process id as its first act and its results as its /// last, so waiting for the process to end is waiting for the results. Only a session that is /// *shown* to be over (its process waited out, or its process id gone) lets the members fall /// back to installing one by one; one that merely cannot be seen is never fallen back from. +/// The installer queue stays taken until then: a session that cannot be watched keeps it until +/// it reports, its process ends, or [`UNWATCHED_LIMIT`] passes. #[cfg(windows)] fn wait_until_done(pid_file: &Path, results: &Path, token: &str) -> SessionEnd { - use winsafe::HPROCESS; - use winsafe::co; - let deadline = std::time::Instant::now() + STARTED_WITHIN; let pid = loop { if let Ok(text) = std::fs::read_to_string(pid_file) @@ -333,28 +377,64 @@ fn wait_until_done(pid_file: &Path, results: &Path, token: &str) -> SessionEnd { } std::thread::sleep(std::time::Duration::from_millis(500)); }; - // The copy exists; its handle may not be ours at once. "Cannot open" that keeps failing past - // the grace means the session is there but cannot be watched — never that it is gone. - let opened_by = std::time::Instant::now() + OPEN_GRACE; - loop { - match HPROCESS::OpenProcess(co::PROCESS::SYNCHRONIZE, false, pid) { - Ok(process) => { - // None is INFINITE: the session ends when its last progress window closes. - if !process.WaitForSingleObject(None).is_ok_and(|wait| wait == co::WAIT::OBJECT_0) { - log::warn!("waiting for the elevated session failed"); - return SessionEnd::Unknown; - } - break; + let watching_until = std::time::Instant::now() + UNWATCHED_LIMIT; + let mut pause = || { + std::thread::sleep(std::time::Duration::from_millis(500)); + std::time::Instant::now() <= watching_until + }; + watch(&mut || look_at_process(pid), pid_file, results, token, &mut pause) +} + +/// Waits for process `pid` when it can be opened. +#[cfg(windows)] +fn look_at_process(pid: u32) -> Seen { + use winsafe::HPROCESS; + use winsafe::co; + + match HPROCESS::OpenProcess(co::PROCESS::SYNCHRONIZE, false, pid) { + Ok(process) => { + // None is INFINITE: the session ends when its last progress window closes. + if process.WaitForSingleObject(None).is_ok_and(|wait| wait == co::WAIT::OBJECT_0) { + Seen::Over + } else { + log::warn!("waiting for the elevated session failed"); + Seen::Unwatched } - // ERROR_INVALID_PARAMETER is what a process id that no longer exists answers. - Err(e) if e == co::ERROR::INVALID_PARAMETER => break, - Err(e) if std::time::Instant::now() > opened_by => { - log::warn!("the elevated session could not be opened to be waited for ({e})"); - return SessionEnd::Unknown; - } - Err(_) => std::thread::sleep(std::time::Duration::from_millis(500)), + } + // ERROR_INVALID_PARAMETER is what a process id that no longer exists answers. + Err(e) if e == co::ERROR::INVALID_PARAMETER => Seen::Over, + Err(e) => { + log::debug!("the elevated session could not be opened to be waited for ({e})"); + Seen::Unwatched } } +} + +/// Keeps looking until the session is over. The copy writes its results and then removes its +/// process id, so a session that cannot be watched is over once its id is gone and its results +/// are this session's. `pause` waits before the next look; `false` gives up. +#[cfg(windows)] +fn watch(look: &mut dyn FnMut() -> Seen, pid_file: &Path, results: &Path, token: &str, pause: &mut dyn FnMut() -> bool) -> SessionEnd { + loop { + match look() { + Seen::Over => return report(results, token), + Seen::Unwatched => { + if !pid_file.exists() + && let end @ SessionEnd::Done(_) = report(results, token) + { + return end; + } + } + } + if !pause() { + return SessionEnd::Unknown; + } + } +} + +/// What a finished session's results file says. +#[cfg(windows)] +fn report(results: &Path, token: &str) -> SessionEnd { match std::fs::read_to_string(results) { Ok(reported) => match parse_results(&reported, token) { codes if codes.is_empty() => SessionEnd::OverWithoutReport, @@ -380,25 +460,31 @@ fn parse_results(text: &str, token: &str) -> Vec<(String, i32)> { .collect() } -/// Writes the results file, never over anything that already exists. -fn write_results(path: &Path, token: &str, codes: &[(String, i32)]) -> Result<(), String> { +/// Writes `text` to a new file. Anything already at `path`, a link included, is an error and is +/// left as it is. +fn write_new(path: &Path, text: &str) -> std::io::Result<()> { use std::io::Write as _; + std::fs::File::options().write(true).create_new(true).open(path)?.write_all(text.as_bytes()) +} + +/// Writes the results file, never over anything that already exists. +fn write_results(path: &Path, token: &str, codes: &[(String, i32)]) -> Result<(), String> { let mut text = String::from(token); for (app, code) in codes { text.push_str(&format!("\n{app}\t{code}")); } - let mut file = std::fs::File::options().write(true).create_new(true).open(path).map_err(|e| format!("couldn't write the batch results ({e})"))?; - file.write_all(text.as_bytes()).map_err(|e| format!("couldn't write the batch results ({e})")) + write_new(path, &text).map_err(|e| format!("couldn't write the batch results ({e})")) } /// The elevated half of the session: what the launcher runs as `--install-msis `. -/// Re-checks every package against its published checksum (held open, so the checked bytes are -/// the installed ones), builds each installer's arguments from that held package, runs Windows -/// Installer on each in turn, and writes each app's exit code to the results file beside the -/// manifest — every app's, however the others went, so one failed member never sends the whole -/// batch back to one-by-one installs and their prompts. `Ok` means the session ran, whatever the -/// installers themselves decided: their outcomes are the codes in the file. +/// Re-checks every package against the manifest's checksum and against this program's publisher +/// (held open, so the checked bytes are the installed ones), builds each installer's arguments +/// from that held package, runs Windows Installer on each in turn, and writes each app's exit code +/// to the results file beside the manifest — every app's, however the others went, so one failed +/// member never sends the whole batch back to one-by-one installs and their prompts. `Ok` means +/// the session ran, whatever the installers themselves decided: their outcomes are the codes in +/// the file. #[cfg(windows)] pub fn run_elevated(manifest: &Path) -> Result<(), String> { let text = std::fs::read_to_string(manifest).map_err(|e| format!("couldn't read the batch manifest ({e})"))?; @@ -412,7 +498,7 @@ pub fn run_elevated(manifest: &Path) -> Result<(), String> { } } let pid_file = sibling(manifest, "pid"); - std::fs::write(&pid_file, std::process::id().to_string()).map_err(|e| format!("couldn't say the batch session had started ({e})"))?; + write_new(&pid_file, &std::process::id().to_string()).map_err(|e| format!("couldn't say the batch session had started ({e})"))?; let mut codes = Vec::new(); for entry in &session.msis { codes.push((entry.app.clone(), install_one(entry))); @@ -422,21 +508,31 @@ pub fn run_elevated(manifest: &Path) -> Result<(), String> { Ok(()) } -/// One package of the session, held while its installer runs. The installer's arguments are -/// built here, from the held package itself: a manifest can say where and in which context the -/// checked file installs, never which file installs. A package that cannot be held, checked or -/// described reports "no exit code" ([`run_installer`]'s `-1`); the rest of the session carries -/// on under the one prompt. +/// One package of the session, held while its installer runs. #[cfg(windows)] fn install_one(entry: &Entry) -> i32 { + checked_install(entry, &signed_by_this_launcher, &run_installer) +} + +/// Holds `entry`'s package, checks its checksum and passes it to `signed`, and only then gives +/// `run` its installer's arguments, built here from the held package itself: a manifest can say +/// where and in which context the checked file installs, never which file installs. A package +/// that cannot be held, checked or described reports "no exit code" ([`run_installer`]'s `-1`); +/// the rest of the session carries on under the one prompt. +#[cfg(windows)] +fn checked_install(entry: &Entry, signed: &dyn Fn(&Path) -> Result<(), String>, run: &dyn Fn(&str) -> Result) -> i32 { let installed = (|| -> Result { + // Every link in the path is resolved first, so the name that is held and checked is the + // name the installer's arguments carry. + let msi = super::msi_path(&entry.msi)?; // The hold is the point: it keeps the package unchanged through the installer run, so // the checked bytes are the installed ones. Its name is never read — the file staying // open until the end of this closure is the whole job. - let _held = super::msi_batch::hold(&entry.msi, &entry.sha256)?; - let line = super::msi_batch::line(&entry.msi, entry.destination.as_deref(), entry.scope)?; + let _held = super::msi_batch::hold(&msi, &entry.sha256)?; + signed(&msi)?; + let line = super::msi_batch::line(&msi, entry.destination.as_deref(), entry.scope)?; log::info!("{}: installing under the shared prompt", entry.app); - run_installer(&line) + run(&line) })(); match installed { Ok(status) => status, @@ -519,6 +615,69 @@ mod tests { ); } + #[cfg(windows)] + mod waiting { + use super::*; + + const TOKEN: &str = "0123456789abcdef"; + + fn session_files(dir: &Path) -> (PathBuf, PathBuf) { + let pid_file = dir.join("batch.pid"); + std::fs::write(&pid_file, "4242").unwrap(); + (pid_file, dir.join("batch.results")) + } + + /// The queue stays taken while the session cannot be watched, and frees once it reports. + #[test] + fn a_session_that_cannot_be_watched_keeps_the_queue_until_it_reports() { + let dir = tempfile::tempdir().unwrap(); + let (pid_file, results) = session_files(dir.path()); + let codes = vec![(String::from("photocraft"), 0)]; + let mut pauses = 0; + let mut pause = || { + pauses += 1; + if pauses == 3 { + write_results(&results, TOKEN, &codes).unwrap(); + std::fs::remove_file(&pid_file).unwrap(); + } + true + }; + let end = watch(&mut || Seen::Unwatched, &pid_file, &results, TOKEN, &mut pause); + assert!(matches!(&end, SessionEnd::Done(reported) if *reported == codes), "the session's report was not read"); + assert_eq!(pauses, 3, "the queue was freed before the session reported"); + } + + /// A report whose process id is still there is not read: the copy removes the id last. + #[test] + fn results_are_not_read_while_the_process_id_is_there() { + let dir = tempfile::tempdir().unwrap(); + let (pid_file, results) = session_files(dir.path()); + write_results(&results, TOKEN, &[(String::from("photocraft"), 0)]).unwrap(); + let end = watch(&mut || Seen::Unwatched, &pid_file, &results, TOKEN, &mut || false); + assert!(matches!(end, SessionEnd::Unknown)); + } + + #[test] + fn a_session_that_is_over_is_read_at_once() { + let dir = tempfile::tempdir().unwrap(); + let (pid_file, results) = session_files(dir.path()); + let end = watch(&mut || Seen::Over, &pid_file, &results, TOKEN, &mut || panic!("no wait is needed")); + assert!(matches!(end, SessionEnd::OverWithoutReport)); + } + + #[test] + fn a_session_that_stays_unwatched_past_the_limit_is_unknown() { + let dir = tempfile::tempdir().unwrap(); + let (pid_file, results) = session_files(dir.path()); + let mut left = 2; + let mut pause = || { + left -= 1; + left > 0 + }; + assert!(matches!(watch(&mut || Seen::Unwatched, &pid_file, &results, TOKEN, &mut pause), SessionEnd::Unknown)); + } + } + #[test] fn session_tokens_differ() { let seen: std::collections::HashSet = (0..64).map(|_| session_token()).collect(); @@ -531,4 +690,100 @@ mod tests { assert_eq!(sibling(manifest, "results"), Path::new(r"C:\Cache\downloads\batch-123-45.results")); assert_eq!(sibling(manifest, "pid"), Path::new(r"C:\Cache\downloads\batch-123-45.pid")); } + + #[cfg(windows)] + mod elevated_checks { + use super::*; + + fn system_program(name: &str) -> PathBuf { + PathBuf::from(std::env::var_os("SystemRoot").unwrap()).join("System32").join(name) + } + + /// A package with the checksum the entry names, in a folder of its own. + fn package(dir: &Path) -> Entry { + let msi = dir.join("app.msi"); + std::fs::write(&msi, b"the checked package").unwrap(); + Entry { sha256: crate::http::sha256_file(&msi).unwrap(), destination: None, ..entry("app", &msi) } + } + + /// `cmd.exe` carries a Windows signature; `cargo test` binaries carry none. + #[test] + fn a_file_must_carry_the_reference_publishers_signature() { + let cmd = system_program("cmd.exe"); + let unsigned = std::env::current_exe().unwrap(); + assert_eq!(signed_like(&cmd, &cmd), Ok(())); + assert!(signed_like(&cmd, &unsigned).is_err_and(|e| e.contains("isn't signed"))); + assert!(signed_like(&unsigned, &cmd).is_err_and(|e| e.contains("launcher isn't signed"))); + } + + /// Windows Installer and the signature check both open a package the session holds. + #[test] + fn the_signature_of_a_held_package_can_be_read() { + let cmd = system_program("cmd.exe"); + let _held = crate::install::msi_batch::hold(&cmd, &crate::http::sha256_file(&cmd).unwrap()).unwrap(); + assert_eq!(signed_like(&cmd, &cmd), Ok(())); + } + + /// The elevated side's refusal: whatever the manifest says, an unsigned package is never + /// handed to the Windows Installer. + #[test] + fn the_elevated_side_refuses_a_package_it_cannot_verify() { + let dir = tempfile::tempdir().unwrap(); + let entry = package(dir.path()); + let run = std::cell::Cell::new(false); + let code = checked_install(&entry, &|_| Err("not signed".to_string()), &|_| { + run.set(true); + Ok(0) + }); + assert_eq!(code, -1); + assert!(!run.get(), "the installer ran on a package with no publisher"); + } + + #[test] + fn a_verified_package_reaches_the_installer_by_its_resolved_path() { + let dir = tempfile::tempdir().unwrap(); + let entry = package(dir.path()); + let seen = std::cell::RefCell::new(String::new()); + let code = checked_install(&entry, &|_| Ok(()), &|line| { + seen.replace(line.to_string()); + Ok(0) + }); + assert_eq!(code, 0); + let resolved = dunce::canonicalize(&entry.msi).unwrap(); + assert!(seen.borrow().contains(&format!("\"{}\"", resolved.display())), "{}", seen.borrow()); + } + + /// The launcher's side keeps a package from another publisher out of the session. + #[test] + fn another_publishers_package_does_not_join_the_session() { + let dir = tempfile::tempdir().unwrap(); + let target = OsString::from(serde_json::to_string(&package(dir.path())).unwrap()); + let (outcomes, joined, held) = join(&[target], &|_| Err("another publisher".to_string())); + assert_eq!(outcomes, vec![Err(NO_SESSION.to_string())]); + assert!(joined.is_empty() && held.is_empty()); + } + + #[test] + fn a_verified_package_joins_the_session() { + let dir = tempfile::tempdir().unwrap(); + let target = OsString::from(serde_json::to_string(&package(dir.path())).unwrap()); + let (outcomes, joined, held) = join(&[target], &|_| Ok(())); + assert_eq!(outcomes, vec![Ok(())]); + assert_eq!(joined.len(), 1); + assert_eq!(held.len(), 1); + } + + /// An elevated write goes only to a new file, so nothing planted at the process-id name + /// is written through. + #[test] + fn the_session_will_not_write_over_what_is_at_its_process_id_name() { + let dir = tempfile::tempdir().unwrap(); + let manifest = dir.path().join("batch.json"); + std::fs::write(&manifest, r#"{"token":"t","msis":[]}"#).unwrap(); + let pid_file = sibling(&manifest, "pid"); + std::fs::write(&pid_file, "keep").unwrap(); + assert!(run_elevated(&manifest).is_err()); + assert_eq!(std::fs::read_to_string(&pid_file).unwrap(), "keep"); + } + } } diff --git a/crates/native/src/lib.rs b/crates/native/src/lib.rs index 0bf0b570..135affd1 100644 --- a/crates/native/src/lib.rs +++ b/crates/native/src/lib.rs @@ -11,6 +11,7 @@ pub mod backend; pub mod desktop_entry; pub mod detect; pub mod feed_throttle; +pub mod hosted_catalog; pub mod http; pub mod install; pub mod login; diff --git a/crates/native/src/self_update.rs b/crates/native/src/self_update.rs index 255520fb..41ad42de 100644 --- a/crates/native/src/self_update.rs +++ b/crates/native/src/self_update.rs @@ -43,6 +43,8 @@ fn to_update_release(release: &Release) -> craft_update::Release { .iter() .map(|a| craft_update::Asset { name: a.name.clone(), size: a.size, url: a.url.clone(), sha256: a.sha256.clone() }) .collect(), + // Empty: the launcher's own repository (`suite::LAUNCHER`), the only one its releases are read from. + repo: String::new(), } } @@ -121,28 +123,40 @@ pub fn update( /// The package format updating `install` downloads: the one it was installed from. Mirrors the /// private `Install::kind` in `craft_update::self_update`, which picks the update's asset by it. pub fn kind(install: &Install) -> PackageKind { - match install { - Install::MacApp(_) => PackageKind::Dmg, - Install::Msi(_) => PackageKind::Msi, - Install::Portable(_) => PackageKind::PortableZip, - Install::AppImage(_) => PackageKind::AppImage, - Install::Package(kind, _) => match kind { - craft_update::PackageKind::Msi => PackageKind::Msi, - craft_update::PackageKind::PortableZip => PackageKind::PortableZip, - craft_update::PackageKind::Dmg => PackageKind::Dmg, - craft_update::PackageKind::AppImage => PackageKind::AppImage, - craft_update::PackageKind::Deb => PackageKind::Deb, - craft_update::PackageKind::Rpm => PackageKind::Rpm, - craft_update::PackageKind::ArchPkg => PackageKind::ArchPkg, - craft_update::PackageKind::Flatpak => PackageKind::Flatpak, - craft_update::PackageKind::TarGz => PackageKind::TarGz, - }, - Install::Flatpak => PackageKind::Flatpak, - Install::Standalone(_) if cfg!(windows) => PackageKind::PortableZip, - Install::Standalone(_) => PackageKind::TarGz, + match update_kind(install) { + craft_update::PackageKind::Msi => PackageKind::Msi, + craft_update::PackageKind::PortableZip => PackageKind::PortableZip, + craft_update::PackageKind::Dmg => PackageKind::Dmg, + craft_update::PackageKind::AppImage => PackageKind::AppImage, + craft_update::PackageKind::Deb => PackageKind::Deb, + craft_update::PackageKind::Rpm => PackageKind::Rpm, + craft_update::PackageKind::ArchPkg => PackageKind::ArchPkg, + craft_update::PackageKind::Flatpak => PackageKind::Flatpak, + craft_update::PackageKind::TarGz => PackageKind::TarGz, } } +/// [`kind`] as `craft_update` names it. +fn update_kind(install: &Install) -> craft_update::PackageKind { + match install { + Install::MacApp(_) => craft_update::PackageKind::Dmg, + Install::Msi(_) => craft_update::PackageKind::Msi, + Install::Portable(_) => craft_update::PackageKind::PortableZip, + Install::AppImage(_) => craft_update::PackageKind::AppImage, + Install::Package(kind, _) => *kind, + Install::Flatpak => craft_update::PackageKind::Flatpak, + Install::Standalone(_) if cfg!(windows) => craft_update::PackageKind::PortableZip, + Install::Standalone(_) => craft_update::PackageKind::TarGz, + } +} + +/// Whether `release` has the file that updating `install` on `platform` downloads ([`kind`]), +/// picked as [`update`] picks it. +pub fn installs_from(install: &Install, release: &Release, platform: Platform) -> bool { + let app = &craft_update::suite::LAUNCHER; + craft_update::pick_asset(&to_update_release(release), &[app.id], to_update_platform(platform), &[update_kind(install)]).is_some() +} + /// Finishes an update when this program was started as the update helper. pub fn finish(args: &[OsString]) -> Option> { craft_update::self_update::finish(&craft_update::suite::LAUNCHER, args) @@ -169,4 +183,103 @@ mod tests { let standalone = if cfg!(windows) { PackageKind::PortableZip } else { PackageKind::TarGz }; assert_eq!(kind(&Install::Standalone(PathBuf::new())), standalone); } + + #[test] + fn an_update_is_installable_only_when_the_release_has_its_file() { + use std::path::PathBuf; + + use artcraft_launcher_core::release::Asset; + use artcraft_launcher_core::{Arch, Os}; + // ArtCraft Launcher v0.19.0's files, without the signatures: macOS has only the disk + // image, and Windows has no x86 build. + let names = [ + "artcraft-launcher-0.19.0-freebsd-aarch64.tar.gz", + "artcraft-launcher-0.19.0-freebsd-x86_64.tar.gz", + "artcraft-launcher-0.19.0-linux-aarch64.AppImage", + "artcraft-launcher-0.19.0-linux-aarch64.AppImage.zsync", + "artcraft-launcher-0.19.0-linux-aarch64.deb", + "artcraft-launcher-0.19.0-linux-aarch64.flatpak", + "artcraft-launcher-0.19.0-linux-aarch64.oci-manifest.json", + "artcraft-launcher-0.19.0-linux-aarch64.pkg.tar.zst", + "artcraft-launcher-0.19.0-linux-aarch64.rpm", + "artcraft-launcher-0.19.0-linux-aarch64.tar.gz", + "artcraft-launcher-0.19.0-linux-riscv64.deb", + "artcraft-launcher-0.19.0-linux-riscv64.rpm", + "artcraft-launcher-0.19.0-linux-riscv64.tar.gz", + "artcraft-launcher-0.19.0-linux-x86_64.AppImage", + "artcraft-launcher-0.19.0-linux-x86_64.AppImage.zsync", + "artcraft-launcher-0.19.0-linux-x86_64.deb", + "artcraft-launcher-0.19.0-linux-x86_64.flatpak", + "artcraft-launcher-0.19.0-linux-x86_64.oci-manifest.json", + "artcraft-launcher-0.19.0-linux-x86_64.pkg.tar.zst", + "artcraft-launcher-0.19.0-linux-x86_64.rpm", + "artcraft-launcher-0.19.0-linux-x86_64.tar.gz", + "artcraft-launcher-0.19.0-macos-universal.dmg", + "artcraft-launcher-0.19.0-windows-arm64-portable.zip", + "artcraft-launcher-0.19.0-windows-arm64.msi", + "artcraft-launcher-0.19.0-windows-x64-portable.zip", + "artcraft-launcher-0.19.0-windows-x64.msi", + "artcraft-launcher-web-0.19.0.zip", + "SHA256SUMS.txt", + ]; + let release = Release { + assets: names.iter().map(|n| Asset { name: (*n).into(), size: 1, url: format!("https://example.invalid/{n}"), sha256: None }).collect(), + ..Release::default() + }; + let mac = Platform { os: Os::MacOs, arch: Arch::Arm64 }; + assert!(installs_from(&Install::MacApp(PathBuf::new()), &release, mac)); + if !cfg!(windows) { + assert!(!installs_from(&Install::Standalone(PathBuf::new()), &release, mac)); + let linux = Platform { os: Os::Linux, arch: Arch::X64 }; + assert!(installs_from(&Install::Standalone(PathBuf::new()), &release, linux)); + assert!(installs_from(&Install::AppImage(PathBuf::new()), &release, linux)); + assert!(installs_from(&Install::Package(craft_update::PackageKind::Deb, PathBuf::new()), &release, linux)); + let riscv = Platform { os: Os::Linux, arch: Arch::Riscv64 }; + assert!(!installs_from(&Install::AppImage(PathBuf::new()), &release, riscv)); + } + let windows = |arch| Platform { os: Os::Windows, arch }; + assert!(installs_from(&Install::Msi(PathBuf::new()), &release, windows(Arch::X64))); + assert!(installs_from(&Install::Portable(PathBuf::new()), &release, windows(Arch::X64))); + assert!(!installs_from(&Install::Msi(PathBuf::new()), &release, windows(Arch::X86))); + assert!(!installs_from(&Install::Portable(PathBuf::new()), &release, windows(Arch::X86))); + assert!(!installs_from(&Install::MacApp(PathBuf::new()), &Release::default(), mac)); + // The file is looked for by the update's own rules, which don't take this spelling. + let name = "artcraft-launcher_0.18.0_x86_64.msi"; + let other = Release { + assets: vec![Asset { name: name.into(), size: 1, url: format!("https://example.invalid/{name}"), sha256: None }], + ..Release::default() + }; + assert!(!installs_from(&Install::Msi(PathBuf::new()), &other, windows(Arch::X64))); + } + + #[test] + fn installs_from_looks_for_the_format_the_update_downloads() { + use std::path::PathBuf; + + use artcraft_launcher_core::{Arch, Os}; + // `update` names the format it looked for when the release has no file for it, so an + // empty release shows which format craft-update picks for each kind of copy. + let dir = tempfile::tempdir().unwrap(); + let paths = Paths { data: dir.path().join("data"), cache: dir.path().join("cache") }; + let http = Http::new().unwrap(); + let platform = Platform { os: Os::Linux, arch: Arch::X64 }; + let mut installs = vec![ + Install::MacApp(PathBuf::new()), + Install::Msi(PathBuf::new()), + Install::Portable(PathBuf::new()), + Install::AppImage(PathBuf::new()), + Install::Flatpak, + Install::Standalone(PathBuf::new()), + ]; + for kind in + [craft_update::PackageKind::Deb, craft_update::PackageKind::Rpm, craft_update::PackageKind::ArchPkg, craft_update::PackageKind::TarGz] + { + installs.push(Install::Package(kind, PathBuf::new())); + } + for install in installs { + let error = update(&install, &Release::default(), platform, &http, &paths, &Stop::default(), &mut |_| {}, &|| Ok(())).unwrap_err(); + let looked_for = format!(" has no {} for ", update_kind(&install).label()); + assert!(error.contains(&looked_for), "{install:?}: {error}"); + } + } } diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 5a99b68e..0f416ae0 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -7,7 +7,7 @@ use artcraft_launcher_core::protocol::{ }; use artcraft_launcher_core::release::Release; use artcraft_launcher_core::status::AppStatus; -use artcraft_launcher_core::{Arch, PackageKind, Platform, SUITE}; +use artcraft_launcher_core::{Arch, PackageKind, Platform}; use crate::i18n::set_current; use crate::model::AppEntry; @@ -111,6 +111,7 @@ pub(crate) enum UiAction { pub(crate) enum Dialog { Notes(String), ConfirmUninstall(String), + UnlockVersion { app: String, tag: String }, Install { app: String, folder: String }, Replace { app: String, path: String }, Settings, @@ -126,6 +127,7 @@ impl Dialog { match self { Dialog::Notes(id) => ("notes", id), Dialog::ConfirmUninstall(id) => ("uninstall", id), + Dialog::UnlockVersion { app, .. } => ("unlock-version", app), Dialog::Install { app, .. } => ("install", app), Dialog::Replace { app, .. } => ("replace", app), Dialog::Settings => ("settings", ""), @@ -260,7 +262,11 @@ impl LauncherUi { Self { backend, settings, - entries: SUITE.iter().filter(|a| platform.is_none_or(|p| a.runs_on(p.os))).map(AppEntry::new).collect(), + entries: artcraft_launcher_core::hosted_catalog::apps() + .iter() + .filter(|a| platform.is_none_or(|p| a.runs_on(p.os))) + .map(AppEntry::new) + .collect(), caps, platform, checking: false, @@ -554,6 +560,18 @@ impl LauncherUi { /// Returns whether app state changed. fn handle(&mut self, event: Event) -> bool { match event { + Event::CatalogUpdated => { + for app in artcraft_launcher_core::hosted_catalog::apps().iter().filter(|a| self.platform.is_none_or(|p| a.runs_on(p.os))) { + if let Some(entry) = self.entries.iter_mut().find(|e| e.app.id == app.id) { + entry.app = app; + } else { + self.entries.push(AppEntry::new(app)); + } + } + self.entries.sort_by_key(|entry| artcraft_launcher_core::hosted_catalog::apps().iter().position(|app| app.id == entry.app.id)); + self.backend.send(Command::Detect); + true + } Event::Latest { app, latest, from } => { self.on_latest(app, latest, from); true @@ -1165,6 +1183,22 @@ mod tests { sent.borrow().iter().filter(|command| matches!(command, Command::Install { .. })).count() } + #[test] + fn catalog_event_adds_entries_in_suite_order_and_keeps_current_state() { + let (mut ui, sent, _) = launcher(); + let id = ui.entries[0].app.id; + ui.entries[0].detected = true; + ui.entries.pop(); + ui.entries.reverse(); + assert!(ui.handle(Event::CatalogUpdated)); + assert_eq!( + ui.entries.iter().map(|e| e.app.id).collect::>(), + artcraft_launcher_core::hosted_catalog::apps().iter().map(|a| a.id).collect::>() + ); + assert!(ui.entry(id).unwrap().detected); + assert_eq!(sent.borrow().as_slice(), &[Command::Detect]); + } + /// A CJK preference is drawable only while that language's own face is installed: having the /// system font cached, or another script's face installed, is not enough. #[test] diff --git a/crates/ui-egui/src/details.rs b/crates/ui-egui/src/details.rs index b53c5e4f..df3574a3 100644 --- a/crates/ui-egui/src/details.rs +++ b/crates/ui-egui/src/details.rs @@ -247,7 +247,7 @@ impl LauncherUi { fn neighbour_apps(&self, id: &str) -> (Option, Option) { let mut ids: Vec<&str> = self.visible_ids().into_iter().filter(|i| AppDetails::by_id(i).is_some()).collect(); if !ids.contains(&id) { - ids = artcraft_launcher_core::SUITE + ids = artcraft_launcher_core::hosted_catalog::apps() .iter() .filter(|a| self.platform.is_none_or(|p| a.runs_on(p.os))) .map(|a| a.id) @@ -374,7 +374,10 @@ impl LauncherUi { // "Version 0.5.0 · Oct 8, 2026", or the installed-versus-latest line. let version = crate::views::version_line(entry, status); if !version.trim().is_empty() { - ui.label(RichText::new(version).size(12.5).color(t.muted)); + ui.horizontal(|ui| { + ui.label(RichText::new(version).size(12.5).color(t.muted)); + self.version_lock(ui, app.id); + }); } }); if wide { diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index ba404275..5fd5c18b 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -33,6 +33,7 @@ impl LauncherUi { let response = match &mut dialog { Dialog::Notes(id) => modal.show(ctx, |ui| close = self.notes_dialog(ui, id)), Dialog::ConfirmUninstall(id) => modal.show(ctx, |ui| close = self.uninstall_dialog(ui, id)), + Dialog::UnlockVersion { app, tag } => modal.show(ctx, |ui| close = self.unlock_version_dialog(ui, app, tag)), Dialog::Install { app, folder } => modal.show(ctx, |ui| close = self.install_dialog(ui, app, folder, host)), Dialog::Replace { app, path } => modal.show(ctx, |ui| close = self.replace_dialog(ui, app, path)), Dialog::Settings => modal.show(ctx, |ui| close = self.settings_dialog(ui, host)), @@ -45,7 +46,11 @@ impl LauncherUi { return; } if close || response.should_close() { - self.dialog = None; + self.dialog = if matches!(&dialog, Dialog::UnlockVersion { app, .. } if app == artcraft_launcher_core::catalog::LAUNCHER_ID) { + Some(Dialog::Settings) + } else { + None + }; if matches!(dialog, Dialog::Versions(_)) { // Close, Escape or a click outside: a version chosen there is dropped. self.revert_version_choice(); diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 5f1b1b43..71ddf9e3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -287,6 +287,7 @@ filter Installed Nainstalováno @plural {n} h ago|{n} h ago před {n} h|před {n} h|před {n} h @plural {n} day ago|{n} days ago před {n} dnem|před {n} dny|před {n} dny @msg Couldn't open {name}: {e} {name} nelze otevřít: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} ArtCraft Launcher nemohl spustit své okno na {backend}: {e} @msg Download cancelled Stahování zrušeno @msg {name} updated to {version} Aplikace {name} byla aktualizována na verzi {version} @msg {name} installed: {version} Aplikace {name} byla nainstalována ve verzi {version} @@ -412,3 +413,7 @@ anicraft Familiar by design Navrženo tak, jak jste zvyklí anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Scéna, nástroje, časová osa, vrstvy, klíčové snímky, Vlastnosti i Knihovna jsou tam, kde je animátoři čekají, včetně cibulového pauzáku. anicraft Tweens that ease Plynulé mezilehlé pohyby (tweens) anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Klasické mezilehlé pohyby s osmi předvolbami zpomalení a vlastními křivkami, plus tvarové mezilehlé pohyby pro morphing. + Version pinned to {version}. Click to unlock. Verze je uzamčena na {version}. Kliknutím ji odemknete. + Unlock version? Odemknout verzi? + {app} is pinned to {version}. Follow the latest release instead? Aplikace {app} je uzamčena na verzi {version}. Přejít na nejnovější vydání? + Unlock Odemknout diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 07d16406..9d3aa745 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -300,6 +300,7 @@ filter Installed Installiert # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} {name} konnte nicht geöffnet werden: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} ArtCraft Launcher konnte sein Fenster auf {backend} nicht starten: {e} @msg Download cancelled Download abgebrochen @msg {name} updated to {version} {name} auf {version} aktualisiert @msg {name} installed: {version} {name} installiert: {version} @@ -444,3 +445,7 @@ anicraft Familiar by design Gewohnt aufgebaut anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Bühne, Werkzeuge, Zeitleiste, Ebenen, Keyframes, Eigenschaften und Bibliothek genau dort, wo Animatoren sie erwarten, inklusive Zwiebelhaut. anicraft Tweens that ease Fließende Tweens anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Klassische Tweens mit acht Easing-Voreinstellungen und Kurven sowie Form-Tweens für Vektor-Morphing. + Version pinned to {version}. Click to unlock. Version auf {version} festgelegt. Zum Entsperren klicken. + Unlock version? Versionssperre aufheben? + {app} is pinned to {version}. Follow the latest release instead? {app} ist auf {version} festgelegt. Stattdessen der neuesten Version folgen? + Unlock Entsperren diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 4d843290..77274f00 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -300,6 +300,7 @@ filter Installed Instaladas @plural {n} h ago|{n} h ago hace {n} h|hace {n} h @plural {n} day ago|{n} days ago hace {n} día|hace {n} días @msg Couldn't open {name}: {e} No se pudo abrir {name}: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} No se pudo iniciar la ventana de ArtCraft Launcher con {backend}: {e} @msg Download cancelled Descarga cancelada @msg {name} updated to {version} {name} actualizada a {version} @msg {name} installed: {version} {name} instalada: {version} @@ -425,3 +426,7 @@ anicraft Familiar by design Diseño familiar anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Escenario, herramientas, línea de tiempo, capas, fotogramas clave, Propiedades y Biblioteca donde los animadores esperan, con papel cebolla. anicraft Tweens that ease Interpolaciones suaves anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Interpolaciones clásicas con ocho preajustes de aceleración y curvas personalizadas, además de interpolación de forma. + Version pinned to {version}. Click to unlock. Versión fijada en {version}. Haz clic para desbloquear. + Unlock version? ¿Desbloquear la versión? + {app} is pinned to {version}. Follow the latest release instead? {app} está fijado en la versión {version}. ¿Usar la versión más reciente? + Unlock Desbloquear diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index e1a0146f..faaf0307 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -298,6 +298,7 @@ filter Installed Installées # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} Impossible d'ouvrir {name} : {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} Impossible de démarrer la fenêtre d'ArtCraft Launcher avec {backend} : {e} @msg Download cancelled Téléchargement annulé @msg {name} updated to {version} {name} mis à jour vers {version} @msg {name} installed: {version} {name} installé : {version} @@ -442,3 +443,7 @@ anicraft Familiar by design Conception familière anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Scène, outils, chronologie, calques, images clés, Propriétés et Bibliothèque là où les animateurs les attendent, avec pelure d'oignon. anicraft Tweens that ease Interpolations fluides anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Interpolations classiques avec huit préréglages d'accélération et courbes personnalisées, plus interpolations de forme. + Version pinned to {version}. Click to unlock. Version fixée à {version}. Cliquez pour la déverrouiller. + Unlock version? Déverrouiller la version ? + {app} is pinned to {version}. Follow the latest release instead? {app} est fixé à la version {version}. Suivre plutôt la dernière version ? + Unlock Déverrouiller diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 178935f3..2295b80c 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -315,6 +315,7 @@ filter Installed Telepítve # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} {name} nem nyitható meg: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} Nem sikerült elindítani az ArtCraft Launcher ablakát ({backend}): {e} @msg Download cancelled Letöltés megszakítva @msg {name} updated to {version} {name} frissítve. Verzió: {version} @msg {name} installed: {version} {name} telepítve: {version} @@ -445,3 +446,7 @@ anicraft Familiar by design Ismerős kialakítás anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Színpad, eszközök, idővonal, rétegek, kulcsképkockák, Tulajdonságok és Könyvtár a megszokott helyen, hagymabőr funkcióval. anicraft Tweens that ease Finom mozgásinterpolációk anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Klasszikus mozgásinterpolációk nyolc görbe-előbeállítással és egyéni görbékkel, valamint alakos interpolációk. + Version pinned to {version}. Click to unlock. A verzió rögzítve: {version}. Kattintson a feloldáshoz. + Unlock version? Feloldja a verzió zárolását? + {app} is pinned to {version}. Follow the latest release instead? A(z) {app} a(z) {version} verzióra van rögzítve. Inkább a legújabb kiadást kövesse? + Unlock Feloldás diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c661cb12..345de2a2 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -317,6 +317,7 @@ filter Installed インストール済み # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} {name} を開けませんでした: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} ArtCraft Launcher のウィンドウを {backend} で起動できませんでした: {e} @msg Download cancelled ダウンロードをキャンセルしました @msg {name} updated to {version} {name} を {version} に更新しました @msg {name} installed: {version} {name} をインストールしました: {version} @@ -447,3 +448,7 @@ anicraft Familiar by design 直感的なデザイン anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. ステージ、ツール、タイムライン、レイヤー、キーフレーム、プロパティ、ライブラリが期待通りの場所に配置され、オニオンスキンも備えています。 anicraft Tweens that ease 滑らかなトゥイーン anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. 8つのイージングプリセットとカスタム曲線を持つクラシックトゥイーン、そしてシェイプトゥイーンに対応。 + Version pinned to {version}. Click to unlock. バージョンは {version} に固定されています。クリックすると固定を解除します。 + Unlock version? バージョンの固定を解除しますか? + {app} is pinned to {version}. Follow the latest release instead? {app} は {version} に固定されています。代わりに最新リリースを使用しますか? + Unlock 固定を解除 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index a66d0db8..2715c58d 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -318,6 +318,7 @@ filter Installed დაინსტალირებული # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} {name} ვერ გაიხსნა: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} ArtCraft Launcher-ის ფანჯარა ვერ გაეშვა {backend}-ზე: {e} @msg Download cancelled ჩამოტვირთვა გაუქმდა @msg {name} updated to {version} {name} განახლდა ვერსიამდე {version} @msg {name} installed: {version} {name} დაინსტალირდა: {version} @@ -443,3 +444,7 @@ anicraft Familiar by design ნაცნობი დიზაინი anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. სცენა, ხელსაწყოები, დროის ხაზი, ფენები, საკვანძო კადრები, თვისებები და ბიბლიოთეკა იქ, სადაც ანიმატორები ელიან. anicraft Tweens that ease გლუვი ანიმაცია anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. კლასიკური ანიმაციური გადასვლები რვა წინასწარ დაყენებული პარამეტრით და ფორმის გარდაქმნით. + Version pinned to {version}. Click to unlock. ვერსია ფიქსირებულია {version}-ზე. განსაბლოკად დააწკაპუნეთ. + Unlock version? განიბლოკოს ვერსია? + {app} is pinned to {version}. Follow the latest release instead? {app} ფიქსირებულია {version} ვერსიაზე. სანაცვლოდ გამოიყენოთ უახლესი გამოშვება? + Unlock განბლოკვა diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index d0307707..8f348e20 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -316,6 +316,7 @@ filter Installed Zainstalowane # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} Nie udało się otworzyć {name}: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} Nie udało się uruchomić okna ArtCraft Launcher na {backend}: {e} @msg Download cancelled Anulowano pobieranie @msg {name} updated to {version} Zaktualizowano {name} do wersji {version} @msg {name} installed: {version} Zainstalowano {name} w wersji {version} @@ -446,3 +447,7 @@ anicraft Familiar by design Znany i intuicyjny interfejs anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Scena, narzędzia, oś czasu, warstwy, klatki kluczowe, Właściwości i Biblioteka znajdują się tam, gdzie oczekują animatorzy, wraz z łuskami cebuli. anicraft Tweens that ease Płynne klatki pośrednie (tweens) anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Klasyczne animacje klatek pośrednich z ośmioma profilami dynamiki i własnymi krzywymi oraz przejścia kształtu. + Version pinned to {version}. Click to unlock. Wersja jest zablokowana na {version}. Kliknij, aby odblokować. + Unlock version? Odblokować wersję? + {app} is pinned to {version}. Follow the latest release instead? Aplikacja {app} jest przypięta do wersji {version}. Zamiast tego śledzić najnowsze wydanie? + Unlock Odblokuj diff --git a/crates/ui-egui/src/i18n/pt-BR.tsv b/crates/ui-egui/src/i18n/pt-BR.tsv index d50365ba..5b9a8dcf 100644 --- a/crates/ui-egui/src/i18n/pt-BR.tsv +++ b/crates/ui-egui/src/i18n/pt-BR.tsv @@ -288,6 +288,7 @@ filter Installed Instalados # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} Não foi possível abrir {name}: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} Não foi possível iniciar a janela do ArtCraft Launcher em {backend}: {e} @msg Download cancelled Download cancelado @msg {name} updated to {version} {name} atualizado para {version} @msg {name} installed: {version} {name} instalado: {version} @@ -432,3 +433,7 @@ anicraft Familiar by design Design familiar anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Palco, ferramentas, linha do tempo, camadas, quadros-chave, Propriedades e Biblioteca onde os animadores esperam, com papel vegetal. anicraft Tweens that ease Interpolações suaves anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Interpolações clássicas com oito predefinições de suavização e curvas personalizadas, além de interpolação de forma. + Version pinned to {version}. Click to unlock. Versão fixada em {version}. Clique para desbloquear. + Unlock version? Desbloquear versão? + {app} is pinned to {version}. Follow the latest release instead? {app} está fixado na versão {version}. Usar a versão mais recente? + Unlock Desbloquear diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index cb2c5c30..4e5b5e99 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -297,6 +297,7 @@ filter Installed Установлены # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} Не удалось открыть {name}: {e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} Не удалось открыть окно ArtCraft Launcher на {backend}: {e} @msg Download cancelled Скачивание отменено @msg {name} updated to {version} Приложение {name} обновлено до {version} @msg {name} installed: {version} Приложение {name} установлено: {version} @@ -440,3 +441,7 @@ anicraft Familiar by design Привычный интерфейс anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. Сцена, инструменты, шкала времени, слои, ключевые кадры, Свойства и Библиотека там, где их ждут аниматоры, со шлейфом калькирования. anicraft Tweens that ease Плавные твины anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. Классические твины с восемью пресетами замедления и кривыми, а также твины формы. + Version pinned to {version}. Click to unlock. Версия закреплена на {version}. Нажмите, чтобы разблокировать. + Unlock version? Разблокировать версию? + {app} is pinned to {version}. Follow the latest release instead? Для {app} закреплена версия {version}. Перейти на последнюю версию? + Unlock Разблокировать diff --git a/crates/ui-egui/src/i18n/zh-CN.tsv b/crates/ui-egui/src/i18n/zh-CN.tsv index 45587c51..a5910353 100644 --- a/crates/ui-egui/src/i18n/zh-CN.tsv +++ b/crates/ui-egui/src/i18n/zh-CN.tsv @@ -335,6 +335,7 @@ figcraft Interface design and prototyping 界面设计与原型制作 # Message templates (@msg): toasts from the backend. {placeholders} match any text. @msg Couldn't open {name}: {e} 无法打开 {name}:{e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} 无法在 {backend} 上启动 ArtCraft Launcher 的窗口:{e} @msg Download cancelled 下载已取消 @msg {name} updated to {version} {name} 已更新至 {version} @msg {name} installed: {version} {name} 已安装:{version} @@ -412,3 +413,7 @@ anicraft Familiar by design 布局熟悉自然 anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. 舞台、工具、时间线、图层、关键帧、“属性”和“库”均位于动画师熟悉的直观位置,并配有洋葱皮功能。 anicraft Tweens that ease 流畅补间缓动 anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. 经典补间具备八种缓动预设与自定义曲线,外加将一种矢量轮廓变换为另一种的形状补间。 + Version pinned to {version}. Click to unlock. 版本已固定为 {version}。点击解锁。 + Unlock version? 解锁版本? + {app} is pinned to {version}. Follow the latest release instead? {app} 已固定为 {version}。是否改为跟随最新版本? + Unlock 解锁 diff --git a/crates/ui-egui/src/i18n/zh-TW.tsv b/crates/ui-egui/src/i18n/zh-TW.tsv index b62d689a..80a636dc 100644 --- a/crates/ui-egui/src/i18n/zh-TW.tsv +++ b/crates/ui-egui/src/i18n/zh-TW.tsv @@ -331,6 +331,7 @@ figcraft Interface design and prototyping 介面設計與原型製作 Loading pictures… 正在載入圖片… Pictures couldn't be loaded. Reopen this page to try again. 無法載入圖片。請重新開啟此頁面再試一次。 @msg Couldn't open {name}: {e} 無法開啟 {name}:{e} +@msg ArtCraft Launcher couldn't start its window on {backend}: {e} 無法在 {backend} 上啟動 ArtCraft Launcher 的視窗:{e} @msg Download cancelled 已取消下載 @msg {name} updated to {version} {name} 已更新至 {version} @msg {name} installed: {version} {name} 已安裝:{version} @@ -403,3 +404,7 @@ anicraft Familiar by design 設計直觀熟悉 anicraft Stage, tools, timeline, layers, keyframes, Properties and Library sit where animators expect them, with onion skinning for in-betweening. 舞台、工具、時間軸、圖層、關鍵影格、「屬性」與「元件庫」皆位於動畫師熟悉的位置,並具備洋蔥皮功能。 anicraft Tweens that ease 平滑補間緩動 anicraft Classic tweens with eight easing presets and custom ease curves, plus shape tweens that morph one vector contour into another. 傳統補間具備八種緩動預設與自訂曲線,並支援變換向量外框的形狀補間。 + Version pinned to {version}. Click to unlock. 版本已鎖定為 {version}。按一下即可解除鎖定。 + Unlock version? 解除版本鎖定? + {app} is pinned to {version}. Follow the latest release instead? {app} 已鎖定為 {version}。是否改為使用最新版本? + Unlock 解除鎖定 diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 79ada9cc..65fde7a3 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -5,7 +5,12 @@ use egui::ImageSource; /// The 128 px icon of a Craft App ([`catalog::app_icon_png`](artcraft_launcher_core::catalog::app_icon_png)). pub fn app(id: &str) -> Option> { let png = artcraft_launcher_core::catalog::app_icon_png(id)?; - Some(ImageSource::Bytes { uri: format!("bytes://app-icons/{id}.png").into(), bytes: png.into() }) + let revision = icon_revision(id); + Some(ImageSource::Bytes { uri: format!("bytes://app-icons/{id}/{revision}.png").into(), bytes: png.into() }) +} + +fn icon_revision(id: &str) -> &'static str { + artcraft_launcher_core::hosted_catalog::metadata(id).map_or("bundled", |m| m.icon_sha256.as_str()) } /// A Craft App's icon: in colour, or in greys for an app that is not installed. The grey copy is @@ -20,7 +25,7 @@ pub fn app_image(ctx: &egui::Context, id: &str, in_colour: bool) -> Option(key)) { return Some(egui::Image::new(&texture)); } diff --git a/crates/ui-egui/src/settings_dialog.rs b/crates/ui-egui/src/settings_dialog.rs index a50c33a8..4ac740eb 100644 --- a/crates/ui-egui/src/settings_dialog.rs +++ b/crates/ui-egui/src/settings_dialog.rs @@ -199,6 +199,7 @@ impl LauncherUi { ui.checkbox(&mut self.settings.prereleases, tl!("Include pre-releases (betas and release candidates)")); row(ui, tl!("Launcher version"), 200.0, &mut |ui, label| { self.version_combo(ui, launcher_id, &artcraft_launcher_core::catalog::LAUNCHER, 200.0, label); + self.version_lock(ui, launcher_id); }); self.launcher_version_notes(ui); }); diff --git a/crates/ui-egui/src/versions.rs b/crates/ui-egui/src/versions.rs index 8b6cd273..099d210d 100644 --- a/crates/ui-egui/src/versions.rs +++ b/crates/ui-egui/src/versions.rs @@ -11,6 +11,69 @@ use crate::theme::Tokens; use crate::widgets::{self, Kind}; impl LauncherUi { + /// The exact selected version, as distinct from following stable or nightly releases. + pub(crate) fn pinned_version(&self, id: &str) -> Option<&str> { + let track = if id == LAUNCHER_ID { Some(&self.settings.launcher_version) } else { self.settings.versions.get(id) }; + match track { + Some(VersionTrack::Pinned(tag)) => Some(tag), + _ => None, + } + } + + /// A lock beside a version opens a confirmation; clicking it never changes the saved choice. + pub(crate) fn version_lock(&mut self, ui: &mut Ui, id: &str) { + let Some(tag) = self.pinned_version(id).map(str::to_string) else { return }; + let tip = crate::fmt(tl!("Version pinned to {version}. Click to unlock."), &[("version", &tag)]); + if widgets::inline_glyph_button(ui, widgets::Glyph::Lock, &tip).clicked() { + self.dialog = Some(crate::app::Dialog::UnlockVersion { app: id.to_string(), tag }); + } + } + + /// Unlock only the choice the prompt showed: a newer choice made while it was open survives. + fn unlock_version(&mut self, id: &str, tag: &str) { + if self.pinned_version(id) != Some(tag) { + return; + } + if id == LAUNCHER_ID { + self.settings.launcher_version = VersionTrack::Stable; + } else { + self.settings.versions.remove(id); + } + self.configure(); + self.check_now_from_ui(); + } + + /// Confirms returning to the latest stable release without directly installing anything. + pub(crate) fn unlock_version_dialog(&mut self, ui: &mut Ui, id: &str, tag: &str) -> bool { + let app = if id == LAUNCHER_ID { + &LAUNCHER + } else if let Some(app) = CraftApp::by_id(id) { + app + } else { + return true; + }; + ui.set_width(440.0f32.min((ui.ctx().content_rect().width() - 80.0).max(240.0))); + ui.heading(tl!("Unlock version?")); + ui.add_space(8.0); + ui.add( + egui::Label::new(crate::fmt( + tl!("{app} is pinned to {version}. Follow the latest release instead?"), + &[("app", app.name), ("version", tag)], + )) + .wrap(), + ); + ui.add_space(16.0); + let (mut cancel, mut unlock) = (false, false); + ui.horizontal(|ui| { + cancel = widgets::button(ui, tl!("Cancel"), Kind::Secondary, 100.0).clicked(); + unlock = widgets::button(ui, tl!("Unlock"), Kind::Primary, 100.0).clicked(); + }); + if unlock { + self.unlock_version(id, tag); + } + cancel || unlock + } + /// The per-app selector stays in its dialog. The launcher's selector is drawn in Settings. pub(crate) fn version_dialog(&mut self, ui: &mut Ui, id: &str) -> bool { let Some(app) = CraftApp::by_id(id) else { return true }; diff --git a/crates/ui-egui/src/views.rs b/crates/ui-egui/src/views.rs index e7c7c80c..91cd72bc 100644 --- a/crates/ui-egui/src/views.rs +++ b/crates/ui-egui/src/views.rs @@ -597,7 +597,8 @@ impl LauncherUi { ); if !version.is_empty() { let github_w = widgets::hud_galley(&strip_ui, &format!("{} ↗", tl!("GitHub")), t.muted).size().x; - let room = (strip_ui.available_width() - github_w - 16.0).max(0.0); + let lock_w = if self.pinned_version(id).is_some() { 20.0 + strip_ui.spacing().item_spacing.x } else { 0.0 }; + let room = (strip_ui.available_width() - github_w - 16.0 - lock_w).max(0.0); let highlight = if in_colour { t.app_ink(app) } else { t.muted }; let spans: Vec<(&str, egui::Color32)> = version.iter().map(|(text, lit)| (text.as_str(), if *lit { highlight } else { t.muted })).collect(); @@ -606,6 +607,7 @@ impl LauncherUi { r.on_hover_text(tip); } } + self.version_lock(&mut strip_ui, id); strip_ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { ui.spacing_mut().item_spacing.x = 16.0; widgets::hud_link(ui, tl!("GitHub"), &app.repo_url()); @@ -915,7 +917,7 @@ impl LauncherUi { /// The version column: what is installed, with an arrow to the new one (only that in the app's /// colour) when an update waits, or a quiet note of the newer release for a version kept on /// purpose; the latest, for an app not installed yet. - fn table_version_cell(&self, ui: &mut Ui, entry: &AppEntry, status: &AppStatus, t: &Tokens) { + fn table_version_cell(&mut self, ui: &mut Ui, entry: &AppEntry, status: &AppStatus, t: &Tokens) { let mono = |text: String, color| RichText::new(text).family(egui::FontFamily::Monospace).color(color); let (first, second) = match (*status == AppStatus::UpdateAvailable).then(|| entry.installed_label().zip(entry.latest_label())).flatten() { Some((from, to)) => (mono(format!("{from} → "), t.ink), Some(mono(to, t.app_ink(entry.app)))), @@ -935,7 +937,16 @@ impl LauncherUi { for part in std::iter::once(first).chain(second) { part.append_to(&mut job, &style, egui::FontSelection::Default, egui::Align::Center); } - let r = ui.label(job); + if self.pinned_version(entry.app.id).is_some() { + job.wrap = egui::text::TextWrapping::truncate_at_width((ui.available_width() - 20.0 - ui.spacing().item_spacing.x).max(0.0)); + } + let r = ui + .horizontal(|ui| { + let response = ui.label(job); + self.version_lock(ui, entry.app.id); + response + }) + .inner; if let Some(tip) = out_of_reach_tip(self.out_of_reach(entry)) { r.on_hover_text(tip); } diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index d7b1184c..c2c7a3ff 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -658,6 +658,8 @@ pub enum Glyph { Close, Settings, Refresh, + /// An exact version is locked until the user confirms unlocking it. + Lock, /// Six-dot grip for reordering pinned apps. Grip, } @@ -716,6 +718,22 @@ fn glyph_shapes(rect: Rect, glyph: Glyph, color: Color32) -> Vec { egui::Shape::convex_polygon(vec![tip + vec2(-2.4, -0.6), tip + vec2(1.6, -3.0), tip + vec2(1.2, 1.8)], color, Stroke::NONE), ] } + Glyph::Lock => { + let stroke = Stroke::new(1.4, color); + vec![ + egui::Shape::line( + vec![m + vec2(-3.0, -1.0), m + vec2(-3.0, -5.0), m + vec2(0.0, -6.0), m + vec2(3.0, -5.0), m + vec2(3.0, -1.0)], + stroke, + ), + egui::Shape::rect_stroke( + Rect::from_min_max(m + vec2(-5.0, -1.0), m + vec2(5.0, 6.0)), + CornerRadius::ZERO, + stroke, + egui::StrokeKind::Inside, + ), + egui::Shape::line_segment([m + vec2(0.0, 1.0), m + vec2(0.0, 3.5)], stroke), + ] + } Glyph::Grip => { let mut shapes = Vec::with_capacity(6); for (dx, dy) in [(-3.0, -3.5), (3.0, -3.5), (-3.0, 0.0), (3.0, 0.0), (-3.0, 3.5), (3.0, 3.5)] { @@ -761,6 +779,18 @@ pub fn glyph_button(ui: &mut Ui, glyph: Glyph, tip: &str) -> Response { resp.on_hover_text(tip).on_hover_cursor(egui::CursorIcon::PointingHand) } +/// A small glyph beside inline text, with the same accessible name and hover help as a tool button. +pub fn inline_glyph_button(ui: &mut Ui, glyph: Glyph, tip: &str) -> Response { + let t = Tokens::get(ui.ctx()); + let (rect, resp) = ui.allocate_exact_size(vec2(20.0, 20.0), Sense::click()); + if resp.hovered() || resp.has_focus() { + ui.painter().rect_filled(rect, CornerRadius::ZERO, t.sunken); + } + paint_glyph(ui.painter(), rect, glyph, t.muted); + resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, tip)); + resp.on_hover_text(tip).on_hover_cursor(egui::CursorIcon::PointingHand) +} + /// The "…" button that opens an app's menu: an outlined square like [`glyph_button`]. The visible /// dots are not a name a screen reader can use, so the button is named after the app. pub fn more_menu(ui: &mut Ui, app_name: &str, add_contents: impl FnOnce(&mut Ui) -> R) { @@ -867,8 +897,8 @@ mod tests { /// the tool-button and header-cell sizes, or a click target would draw outside its hit rect. #[test] fn every_painter_glyph_stays_inside_its_control() { - for glyph in [Glyph::Pause, Glyph::Close, Glyph::Settings, Glyph::Refresh, Glyph::Grip] { - for side in [crate::theme::CONTROL_H, 48.0] { + for glyph in [Glyph::Pause, Glyph::Close, Glyph::Settings, Glyph::Refresh, Glyph::Grip, Glyph::Lock] { + for side in [20.0, crate::theme::CONTROL_H, 48.0] { let rect = Rect::from_min_size(egui::pos2(100.0, 200.0), egui::vec2(side, side)); let shapes = glyph_shapes(rect, glyph, Color32::WHITE); assert!(!shapes.is_empty(), "{glyph:?} draws nothing at {side} px"); @@ -974,7 +1004,7 @@ mod tests { #[test] fn each_glyph_has_its_own_shapes() { let rect = Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(crate::theme::CONTROL_H, crate::theme::CONTROL_H)); - let bounds: Vec<[u32; 4]> = [Glyph::Pause, Glyph::Close, Glyph::Settings, Glyph::Refresh, Glyph::Grip] + let bounds: Vec<[u32; 4]> = [Glyph::Pause, Glyph::Close, Glyph::Settings, Glyph::Refresh, Glyph::Grip, Glyph::Lock] .into_iter() .map(|glyph| { let union = glyph_shapes(rect, glyph, Color32::WHITE) diff --git a/crates/ui-egui/tests/ui.rs b/crates/ui-egui/tests/ui.rs index ab35d549..7ee44022 100644 --- a/crates/ui-egui/tests/ui.rs +++ b/crates/ui-egui/tests/ui.rs @@ -4319,3 +4319,95 @@ fn an_apps_page_is_a_card_in_the_middle_with_next_and_previous_arrows_and_closes h.run_steps(30); assert!(!showing(&h, "photocraft"), "a click outside did not close it"); } + +/// A version pin is distinct from a favorite: the lock names the exact tag and requires confirmation. +#[test] +fn version_padlock_confirms_before_unlocking_in_grid_and_table() { + use artcraft_launcher_core::protocol::VersionTrack; + let tip = "Version pinned to v0.4.1. Click to unlock."; + for view in [ViewMode::Grid, ViewMode::Table] { + let (mut h, sent) = harness(view, egui::Theme::Dark, true); + h.run_steps(4); + h.state_mut().as_mut().unwrap().settings.versions.insert("photocraft".into(), VersionTrack::Pinned("v0.4.1".into())); + h.run_steps(4); + sent.borrow_mut().clear(); + h.get_by_label(tip).hover(); + h.run_steps(30); + snapshot(&mut h, if view == ViewMode::Grid { "version-lock-grid" } else { "version-lock-table" }); + h.query_all_by_role_and_label(egui::accesskit::Role::Button, tip).next().unwrap().click(); + h.run_steps(4); + h.get_by_label("Unlock version?"); + h.get_by_label("PhotoCraft is pinned to v0.4.1. Follow the latest release instead?"); + assert_eq!(h.state().as_ref().unwrap().settings.versions.get("photocraft"), Some(&VersionTrack::Pinned("v0.4.1".into()))); + assert!(!sent.borrow().iter().any(|c| matches!(c, Command::CheckForUpdates { force: true }))); + snapshot(&mut h, if view == ViewMode::Grid { "version-unlock-dialog" } else { "version-unlock-table-dialog" }); + h.get_by_label("Cancel").click(); + h.run_steps(4); + assert_eq!(h.state().as_ref().unwrap().settings.versions.get("photocraft"), Some(&VersionTrack::Pinned("v0.4.1".into()))); + h.get_by_label(tip).click(); + h.run_steps(4); + h.key_press(egui::Key::Escape); + h.run_steps(4); + assert_eq!(h.state().as_ref().unwrap().settings.versions.get("photocraft"), Some(&VersionTrack::Pinned("v0.4.1".into()))); + h.get_by_label(tip).click(); + h.run_steps(4); + h.get_by_label("Unlock").click(); + h.run_steps(4); + assert!(!h.state().as_ref().unwrap().settings.versions.contains_key("photocraft")); + assert!(h.query_by_label(tip).is_none()); + assert!(sent.borrow().iter().any(|c| matches!(c, Command::Configure(options) if !options.versions.contains_key("photocraft")))); + assert!(sent.borrow().iter().any(|c| matches!(c, Command::CheckForUpdates { force: true }))); + assert!(!sent.borrow().iter().any(|c| matches!(c, Command::Install { .. }))); + } +} + +#[test] +fn a_version_padlock_does_not_unlock_a_choice_changed_after_confirmation_opened() { + use artcraft_launcher_core::protocol::VersionTrack; + let (mut h, _) = harness(ViewMode::Grid, egui::Theme::Dark, true); + h.run_steps(4); + h.state_mut().as_mut().unwrap().settings.versions.insert("photocraft".into(), VersionTrack::Pinned("v0.4.1".into())); + h.run_steps(4); + h.get_by_label("Version pinned to v0.4.1. Click to unlock.").click(); + h.run_steps(4); + h.state_mut().as_mut().unwrap().settings.versions.insert("photocraft".into(), VersionTrack::Pinned("v0.3.0".into())); + h.run_steps(4); + h.get_by_label("Unlock").click(); + h.run_steps(4); + assert_eq!(h.state().as_ref().unwrap().settings.versions.get("photocraft"), Some(&VersionTrack::Pinned("v0.3.0".into()))); +} + +#[test] +fn favorite_and_nightly_choices_do_not_show_a_version_padlock() { + use artcraft_launcher_core::protocol::VersionTrack; + let (mut h, _) = harness(ViewMode::Grid, egui::Theme::Dark, true); + h.run_steps(4); + h.state_mut().as_mut().unwrap().settings.pin_app("photocraft"); + h.run_steps(4); + assert!(h.query_by_label("Version pinned to v0.4.1. Click to unlock.").is_none()); + h.state_mut().as_mut().unwrap().settings.versions.insert("photocraft".into(), VersionTrack::Nightly); + h.run_steps(4); + assert!(h.query_by_label("Version pinned to v0.4.1. Click to unlock.").is_none()); +} + +#[test] +fn launcher_version_padlock_confirms_and_returns_to_settings() { + use artcraft_launcher_core::protocol::VersionTrack; + let (mut h, sent) = harness(ViewMode::Grid, egui::Theme::Dark, true); + h.run_steps(4); + h.state_mut().as_mut().unwrap().settings.launcher_version = VersionTrack::Pinned("v0.19.0".into()); + h.get_by_label("Settings").click(); + h.run_steps(6); + h.get_by_label("Version pinned to v0.19.0. Click to unlock.").click(); + h.run_steps(4); + h.get_by_label("Cancel").click(); + h.run_steps(4); + assert_eq!(h.state().as_ref().unwrap().settings.launcher_version, VersionTrack::Pinned("v0.19.0".into())); + h.get_by_label("Version pinned to v0.19.0. Click to unlock.").click(); + h.run_steps(4); + h.get_by_label("Unlock").click(); + h.run_steps(4); + assert_eq!(h.state().as_ref().unwrap().settings.launcher_version, VersionTrack::Stable); + h.get_by_label("Launcher version"); + assert!(sent.borrow().iter().any(|c| matches!(c, Command::Configure(options) if options.launcher_version == VersionTrack::Stable))); +} diff --git a/docs/hosted-catalog.md b/docs/hosted-catalog.md new file mode 100644 index 00000000..fcba6c18 --- /dev/null +++ b/docs/hosted-catalog.md @@ -0,0 +1,77 @@ +# Signed hosted catalog + +The launcher bundles `crates/core/catalog.toml`, containing the website's +`launcher-catalog.toml` data from storytold/artcraft-services#205 with the latest +compiled display order. The signed website fixture is kept separately under +`crates/core/tests/fixtures/` with byte-preserving Git attributes for Windows. The core build script +generates the existing static app/details types from it, keeping first launch +and offline operation independent of the website. + +On the first release check of each process, desktop and web fetch: + +- `https://getartcraft.com/launcher-catalog.toml` +- `https://getartcraft.com/launcher-catalog.toml.sig` + +The signature is base64 encoding of a 64-byte Ed25519 signature over the exact +TOML bytes, with optional surrounding whitespace. Verification uses the SPKI +PEM public key in `crates/core/assets/launcher-catalog-public-key.pem` before +parsing. The corresponding private key belongs only in the website's Cloudflare +build secret `LAUNCHER_CATALOG_SIGNING_KEY`. It is never read or bundled by the +launcher. The checked-in signature fixture is public test data, not a secret. + +Desktop stores the TOML and signature together in an atomic +`launcher-catalog.json` beside the release-feed cache. Web uses the browser's +local storage (`artcraft-launcher.signed-catalog.v1`). Every cache read verifies +the signature again. Network failures, missing signatures, invalid signatures, +invalid documents or unavailable storage preserve the verified cache, then the +bundled list. The bundled list is visible while the background check runs. + +The active catalog is immutable for the process lifetime. Existing install jobs +keep their static handles; restarting refreshes the catalog again. Only one +bounded snapshot is interned per process. This avoids accumulating leaked strings +on repeated checks. Missing bundled apps are appended to the hosted list so an +installed copy remains manageable after the hosted entry disappears. + +The signed file updates app copy, colors, details, desktop categories, window +class, icons and display order. Invalid rows are skipped, unknown fields ignored, +and a document with no valid rows is rejected. New official apps can be added +without a launcher release, within the existing source policy: a lowercase safe +ID, its matching `storytold/` repository, ArtCraft publisher/team, default +bundle ID and no legacy aliases. Existing app names, aliases, bundle IDs, +repositories, publishers and macOS signing teams stay pinned to the bundled +entry. A signature cannot add an unapproved community app or change an existing +install identity. Community onboarding and identity changes still require +maintainer review and a launcher release. + +Icons must use the website's app-ID/hash filenames and pass SHA-256 and PNG +size/dimension checks before decoding. Desktop caches them by hash; web uses +its HTTP cache. Missing icons do not block a valid catalog. Screenshots remain +JPEGs at the launcher's pinned assets tag, with existing byte/pixel checks. +The currently supported installer code still derives package/binary IDs from +app IDs; arbitrary installer identities in unknown manifest fields do not +change installation behavior. + +Limits: 1 MiB catalog, 128-byte encoded signature, 64 hosted apps, 16 features +and screenshots per app, 256 KiB/512×512 PNG icons. Desktop HTTP uses its existing +bounded reader and timeouts. Browser catalog/icon requests stream with actual +byte limits and a 20-second abort signal; redirects are refused on both platforms. + +This is a single pinned key. Rotation requires a launcher update; there is no +manifest-authorized next key, signed expiry or rollback counter in this schema. +The signature authenticates content, not freshness. The existing package checksum +and macOS/Windows publisher checks continue to apply to installations. + +Validation includes a real signed website-format fixture, wrong-key/tampering +rejection, malformed rows, install-identity restrictions, new official app policy, +icon hashes/dimensions, and reverified cache fallback. The private signing key is +not required to run any test. + +To validate the published catalog through the desktop HTTP/cache/activation path +without installing any app: + +```sh +cargo test -p artcraft-launcher-native live_catalog_is_verified_cached_and_activated -- --ignored +``` + +This opt-in network test uses temporary storage and checks the pinned signature, +all accepted entries, activation and icon hashes. Normal CI stays offline.