diff --git a/.gitignore b/.gitignore index 8209b0a..579d39b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,13 +7,19 @@ # ── 构建产物 ───────────────────────────────────────────────────────── # cargo 的输出(debug / release / 各 target triple 都在它下面)。 /target/ +/src-tauri/target/ +/artifacts/ # scripts/release.sh 的产物:通用二进制 + tar.gz + sha256。 # 发布走 GitHub Release 附件和 Homebrew formula,不进仓库。 /dist/ +node_modules/ +.vite/ +src-tauri/gen/ *.tar.gz *.sha256 *.dmg *.zip +*.exe # ── 只读参考代码 ───────────────────────────────────────────────────── # 本地 clone 的第三方参考项目(自带 .git,数百 MB),不打包、不提交、不发版。 @@ -52,3 +58,7 @@ __pycache__/ .env.* !.env.example *.local + +# ── 显式纳管的发布产物 ─────────────────────────────────────────────── +!release/0.1.3/Squid-0.1.3-macOS-universal.dmg +!release/0.1.3/Squid-Setup-0.1.3-win-x64.exe diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ae2c49..97df468 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,3 +51,41 @@ windows-build-test: allow_failure: true script: - pwsh -File scripts/ci-windows.ps1 + +desktop-frontend: + stage: check + image: node:22-bookworm + cache: + key: + files: [pnpm-lock.yaml] + paths: [.pnpm-store] + before_script: + - corepack enable + - corepack prepare pnpm@8.6.6 --activate + - pnpm config set store-dir .pnpm-store + script: + - pnpm install --frozen-lockfile + - pnpm check + - pnpm build + artifacts: + paths: + - dist/ + expire_in: 1 day + +desktop-rust-check: + stage: check + image: rust:1.85 + needs: + - job: desktop-frontend + artifacts: true + cache: + key: + files: [src-tauri/Cargo.lock] + paths: [.cargo/registry, .cargo/index, src-tauri/target/] + before_script: + - apt-get update + - apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + script: + - cargo fmt --manifest-path src-tauri/Cargo.toml -- --check + - cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings + - cargo test --manifest-path src-tauri/Cargo.toml --lib diff --git a/Cargo.lock b/Cargo.lock index 96eb66d..176551c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -967,7 +967,7 @@ checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b" [[package]] name = "squid-cli" -version = "0.1.0" +version = "0.1.3" dependencies = [ "anyhow", "chrono", @@ -986,7 +986,7 @@ dependencies = [ [[package]] name = "squid-core" -version = "0.1.0" +version = "0.1.3" dependencies = [ "anyhow", "chrono", @@ -1005,7 +1005,7 @@ dependencies = [ [[package]] name = "squid-engine" -version = "0.1.0" +version = "0.1.3" dependencies = [ "anyhow", "chrono", @@ -1025,7 +1025,7 @@ dependencies = [ [[package]] name = "squid-platform" -version = "0.1.0" +version = "0.1.3" dependencies = [ "dirs", "libc", @@ -1042,7 +1042,7 @@ dependencies = [ [[package]] name = "squid-rules" -version = "0.1.0" +version = "0.1.3" dependencies = [ "globset", "serde", @@ -1054,7 +1054,7 @@ dependencies = [ [[package]] name = "squid-stats" -version = "0.1.0" +version = "0.1.3" dependencies = [ "chrono", "libc", @@ -1066,7 +1066,7 @@ dependencies = [ [[package]] name = "squid-tui" -version = "0.1.0" +version = "0.1.3" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 1394657..3d1b5d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,10 @@ [workspace] resolver = "2" members = ["crates/*"] +exclude = ["src-tauri"] [workspace.package] -version = "0.1.0" +version = "0.1.3" edition = "2021" rust-version = "1.80" license = "GPL-3.0-only" diff --git a/README.md b/README.md index b76ede8..cb8e17d 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,40 @@ macOS / Windows 磁盘清理与系统监控工具:清理缓存与系统垃圾 分析磁盘占用、实时监控资源。命令行与内置 TUI 共用同一套引擎,产物是一个静态二进制, 不装后台进程、不写 shell 配置、不需要 root。 +## 桌面应用 + +仓库现在同时提供 macOS / Windows 原生桌面程序 **Squid**。桌面端沿用 `nex_shift` 的技术栈 +(Tauri 2 + React 19 + TypeScript + Vite)和更新通道,直接复用本仓库现有 Rust 清理引擎: + +- 界面:CleanMyMac 风格的概览、清理、应用卸载、深度清理、存储空间、系统状态、历史记录和设置; +- 安全:GUI 只能选择后端扫描缓存中的索引,删除前仍由 Rust 引擎重新校验路径、锚点、白名单和锁定状态; +- 更新:`releases` 分支中的 `squid-update.json` + 安装包,文件大小与 SHA256 始终校验,可选 Ed25519 清单签名; +- 本地化:中英双语,跟随现有 `Settings` 语言偏好。 + +开发与构建: + +```bash +pnpm install +pnpm desktop:dev # 开发窗口 +pnpm desktop:build # 当前平台安装包 +bash scripts/build-macos-release.sh +bash scripts/build-windows-release.sh +``` + +完整的桌面架构、权限和发布说明见 [`docs/DESKTOP.md`](docs/DESKTOP.md) 与 +[`docs/RELEASE.md`](docs/RELEASE.md)。Nex 系列应用的统一主色与设计常量见 +[`docs/DESIGN.md`](docs/DESIGN.md)。下面的 CLI / TUI 文档仍然有效,三个入口共用同一套扫描与删除核心。 + ## 特性 -| 能力 | 说明 | 入口 | +| 能力 | 说明 | 桌面 / CLI | | --- | --- | --- | -| 清理 | 内置规则 macOS 39 条 / Windows 30 条:应用与浏览器缓存、日志与崩溃报告、Xcode DerivedData、Windows Update 残留、废纸篓 / 回收站等 | `squid clean` | -| 卸载 | 按名称定位 App(macOS 扫 `/Applications` 与 bundle id,Windows 读注册表卸载表),本体与散落的偏好、缓存、容器 / AppData 残留一起进入删除计划 | `squid uninstall` | -| 深度清理 | `node_modules` 等项目构建产物、磁盘镜像、陈旧安装包与下载 | `squid purge` | -| 存储分析 | 体积树与最大文件,可逐层下钻 | `squid analyze`、`state` 存储面板 | -| 系统监控 | CPU / 内存 / 网络 / 磁盘 / 电池 / 温度 / 进程,并可结束选中的进程 | `squid status`、`state` 系统面板 | -| 历史与撤销 | 每次真实删除写一条 JSON 账本,可将仍在废纸篓 / 回收站里的文件原样放回 | `squid history`、`squid undo` | +| 清理 | 内置规则 macOS 39 条 / Windows 30 条:应用与浏览器缓存、日志与崩溃报告、Xcode DerivedData、Windows Update 残留、废纸篓 / 回收站等 | 桌面“清理” / `squid clean` | +| 卸载 | 按名称定位 App(macOS 扫 `/Applications` 与 bundle id,Windows 读注册表卸载表),本体与散落的偏好、缓存、容器 / AppData 残留一起进入删除计划 | 桌面“应用程序” / `squid uninstall` | +| 深度清理 | `node_modules` 等项目构建产物、磁盘镜像、陈旧安装包与下载 | 桌面“深度清理” / `squid purge` | +| 存储分析 | 体积树与最大文件,可逐层下钻 | 桌面“存储空间” / `squid analyze` | +| 系统监控 | CPU / 内存 / 网络 / 磁盘 / 电池 / 温度 / 进程,并可结束选中的进程 | 桌面“系统状态” / `squid status` | +| 历史与撤销 | 每次真实删除写一条 JSON 账本,可将仍在废纸篓 / 回收站里的文件原样放回 | 桌面“历史记录” / `squid history`、`squid undo` | - 语言:Rust 1.80+,workspace 由 7 个 crate 组成 - 界面:中英双语文案,跟随系统语言;真彩色 / 256 色 / 无色三档自动适配 diff --git a/crates/squid-core/src/settings.rs b/crates/squid-core/src/settings.rs index 71a2a19..af534ca 100644 --- a/crates/squid-core/src/settings.rs +++ b/crates/squid-core/src/settings.rs @@ -33,6 +33,9 @@ pub struct Settings { pub language: Option, /// Number of history sessions to keep. pub history_keep: usize, + /// Whether the desktop app's first-run permission card has been dismissed. + /// Older configs have no such field and therefore see the card once. + pub desktop_setup_reviewed: bool, } impl Default for Settings { @@ -63,6 +66,7 @@ impl Default for Settings { show_allocated: true, language: None, history_keep: 60, + desktop_setup_reviewed: false, } } } @@ -477,4 +481,11 @@ mod tests { Locale::detect(&Settings::default()) ); } + + #[test] + fn an_existing_config_has_not_reviewed_the_desktop_setup() { + let older = "history_keep = 60\n"; + let restored: Settings = toml::from_str(older).unwrap(); + assert!(!restored.desktop_setup_reviewed); + } } diff --git a/crates/squid-rules/rules/macos.toml b/crates/squid-rules/rules/macos.toml index cce5fae..1b93aac 100644 --- a/crates/squid-rules/rules/macos.toml +++ b/crates/squid-rules/rules/macos.toml @@ -455,16 +455,6 @@ select_by_default = false risky = true note = "Eject instead of deleting; squid never removes a mounted volume." -[[rule]] -id = "old-downloads" -category = "system" -title = "Downloads older than 30 days" -patterns = ["~/Downloads/*.dmg", "~/Downloads/*.pkg", "~/Downloads/*.zip"] -mode = "files" -os = ["macos"] -min_age_days = 30 -select_by_default = false - [[rule]] id = "user-trash" category = "trash" diff --git a/crates/squid-stats/src/lib.rs b/crates/squid-stats/src/lib.rs index ad4ddb1..0eb8b31 100644 --- a/crates/squid-stats/src/lib.rs +++ b/crates/squid-stats/src/lib.rs @@ -12,7 +12,8 @@ use std::collections::VecDeque; use std::path::PathBuf; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use sysinfo::{ - DiskUsage, Disks, Networks, ProcessRefreshKind, ProcessesToUpdate, RefreshKind, System, + DiskRefreshKind, DiskUsage, Disks, Networks, ProcessRefreshKind, ProcessesToUpdate, + RefreshKind, System, }; mod battery; @@ -198,7 +199,13 @@ impl Sampler { ); Sampler { networks: Networks::new_with_refreshed_list(), - disks: Disks::new_with_refreshed_list(), + // Capacity comes from squid-platform's statvfs path. Asking + // sysinfo for storage here uses CoreFoundation's + // `AvailableCapacityForImportantUsage`, which enumerates every + // CacheDelete provider on macOS and can prompt for media access. + disks: Disks::new_with_refreshed_list_specifics( + DiskRefreshKind::nothing().with_io_usage(), + ), system, last: Instant::now(), host: HostInfo::gather(), @@ -247,7 +254,8 @@ impl Sampler { ProcessRefreshKind::nothing().with_cpu().with_memory(), ); self.networks.refresh(true); - self.disks.refresh(true); + self.disks + .refresh_specifics(true, DiskRefreshKind::nothing().with_io_usage()); let seconds = elapsed.as_secs_f64(); let cpu = cpu_stats(&self.system); diff --git a/docs/DESIGN.md b/docs/DESIGN.md new file mode 100644 index 0000000..e968e44 --- /dev/null +++ b/docs/DESIGN.md @@ -0,0 +1,112 @@ +# Nex 应用视觉规范 + +版本:1.0 +状态:Nex 系列应用统一标准 +基准实现:`nex_shift` 的主色系 + +## 1. 原则 + +Nex 系列应用共用一套暖色品牌体系。Shift 已经使用的橙色是主品牌色, +Squid 以及后续 Nex 应用不得再各自定义蓝色或其它颜色的主操作色。 + +- 主操作、选中态、焦点环和进度使用 Nex 主色。 +- 页面底色、卡片和正文使用暖中性色,不使用冷蓝色底。 +- 绿色、红色、黄色只表达成功、危险和警告,不作为品牌主色。 +- 分类色可以保留各自的语义色,但不得替代主操作色。 +- 新界面必须引用 `src/styles.css` 中的 `--nex-*` 常量,不写新的主色十六进制值。 + +## 2. 品牌常量 + +这些值同时写在 `src/styles.css` 的 `:root` 中,是运行时唯一来源。 + +| 常量 | 值 | 用途 | +| --- | --- | --- | +| `--nex-primary` | `#F26A33` | 主按钮、选中态、焦点、进度 | +| `--nex-primary-hover` | `#E45C2A` | 主色悬停 | +| `--nex-primary-strong` | `#D94F1F` | 主色深阶、主按钮渐变终点 | +| `--nex-primary-pressed` | `#C94A1D` | 按下态 | +| `--nex-primary-soft` | `#FFF0E7` | 主色浅底、权限提示 | +| `--nex-primary-tint` | `#FFF7F2` | 选中卡片、弱高亮 | +| `--nex-ink` | `#342019` | 正文 | +| `--nex-ink-strong` | `#24120A` | 标题 | +| `--nex-muted` | `#7D6256` | 次级文字 | +| `--nex-muted-soft` | `#A98F80` | 说明文字 | +| `--nex-line` | `rgba(89, 51, 34, 0.10)` | 分隔线 | +| `--nex-paper` | `#FBF7F2` | 面板 | +| `--nex-cream` | `#FFF6EE` | 浅色表面 | +| `--nex-canvas` | `#F5EEE7` | 应用底色 | + +主色高亮需要透明度时使用 `rgba(var(--nex-primary-rgb), α)`,其中 +`--nex-primary-rgb` 为 `242, 106, 51`。 + +## 3. 图标渐变 + +应用图标的品牌渐变沿用 Shift: + +- 起点 `#FFB25C` +- 中段 `#FF6B35` +- 终点 `#C66BFF` + +图标主体的描边和阴影必须使用暖色,不得保留旧版蓝色。 + +### 侧栏品牌锁定 + +侧栏标识直接使用打包进应用的 `src-tauri/icons/128x128.png`,不得维护第二份 +图标资源。默认视觉为 37 × 37 px、12 px 圆角。 + +- 一级标题固定为 `Squid`,使用 `--nex-text-lg` / `--nex-weight-display`。 +- 中文二级标题固定为 `给你的电脑洗个澡`;英文为 + `Give your computer a bath`,使用 `--nex-text-3xs` / `--nex-weight-body`。 +- 所有 Nex 应用使用同一锁定结构:应用图标、产品名、产品定位短句。 + +## 4. 字体规范 + +字体与 Shift 使用同一套系统字体栈和字号阶梯。所有新界面必须引用下面的 +常量,不得再写 7–10px 等阶梯外的字号。 + +| 常量 | 值 | 用途 | +| --- | --- | --- | +| `--nex-font-sans` | `-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif` | 界面正文 | +| `--nex-font-mono` | `"SF Mono", "Cascadia Code", ui-monospace, monospace` | 路径、哈希、配置值 | +| `--nex-text-3xs` | `11px` | 最小辅助文字与标签 | +| `--nex-text-2xs` | `12.5px` | 正文说明、列表文字 | +| `--nex-text-xs` | `13.5px` | 面板标题 | +| `--nex-text-sm` | `14.5px` | 强调正文 | +| `--nex-text-md` | `16px` | 区块标题 | +| `--nex-text-lg` | `18px` | 品牌与重点标题 | +| `--nex-text-xl` | `21px` | 对话框标题 | +| `--nex-text-hero` | `clamp(28px, 3vw, 38px)` | 页面主标题 | + +字重沿用 Shift 的层级:`540` 正文、`620` 中等、`650` 半粗、`680` 粗体、 +`720` 重体、`760` 品牌展示。对应常量为 `--nex-weight-body`、 +`--nex-weight-medium`、`--nex-weight-semibold`、`--nex-weight-bold`、 +`--nex-weight-heavy`、`--nex-weight-display`。 + +行高常量:`--nex-leading-tight: 1.1` 用于标题, +`--nex-leading-body: 1.55` 用于说明正文。 + +## 5. 组件规则 + +- 主按钮:`#FF9664 → --nex-primary → --nex-primary-strong` 的暖色渐变。 +- 次按钮:暖白表面、暖棕文字,悬停时使用主色描边。 +- 选中卡片:`--nex-primary-tint` 背景与 10% 主色描边。 +- 焦点环:`rgba(var(--nex-primary-rgb), 0.55)`,宽度 2px。 +- 进度条、开关、勾选框:主色或主色渐变。 +- 正文不使用纯黑;标题使用 `--nex-ink-strong`。 +- 更新面板面向使用者,只展示当前系统版本、版本状态、更新说明、进度与操作; + 更新地址、安装包文件名和哈希留在后端校验流程中,不进入常规界面。 + +## 6. 旧变量兼容 + +现有组件仍引用 `--blue`、`--blue-deep`、`--blue-soft`。这三个变量已经 +分别别名为 `--nex-primary`、`--nex-primary-strong`、`--nex-primary-soft`, +因此不会再渲染蓝色。新增代码应直接使用 `--nex-*` 常量;迁移旧组件时 +可以逐步移除 `--blue-*` 别名,但不得改回独立颜色值。 + +## 7. 验收 + +- 全应用不出现蓝色主按钮、蓝色选中态或蓝色焦点环。 +- 页面底色为 `#F5EEE7`,面板为暖白,不使用冷蓝渐变。 +- Settings、首次启动权限卡和更新面板共享同一套主色。 +- 应用图标与界面使用同一组暖色品牌常量。 +- 正文和标签不小于 11px,标题使用统一字号阶梯,不出现 7–10px 的正文。 diff --git a/docs/DESKTOP.md b/docs/DESKTOP.md new file mode 100644 index 0000000..63ac894 --- /dev/null +++ b/docs/DESKTOP.md @@ -0,0 +1,130 @@ +# Squid desktop + +Squid has two native desktop builds, macOS and Windows, built with the same +technology stack as `nex_shift`: + +- Tauri 2 shell and updater handoff +- React 19 + TypeScript UI +- Vite 6 development and asset pipeline +- The existing `squid-core`, `squid-engine`, `squid-platform` and `squid-stats` + Rust workspace + +The desktop application is a second frontend over the same engine used by the +CLI and TUI. It does not maintain a separate cleanup implementation. + +The shared Nex colour and component standard lives in +[`DESIGN.md`](DESIGN.md). Squid uses the same primary palette as `nex_shift`. + +## Run locally + +Prerequisites: + +- Node.js 20+ and pnpm +- Rust toolchain and Cargo +- macOS: Xcode Command Line Tools +- Windows: MSVC build tools and WebView2 + +```bash +pnpm install +pnpm desktop:dev +``` + +The Vite-only development page cannot call Tauri commands. Use `desktop:dev` +when exercising scans, deletes, storage analysis, system data, or updates. + +Useful checks: + +```bash +pnpm check +pnpm build +cargo test --manifest-path src-tauri/Cargo.toml --lib +cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings +``` + +## Screens + +| Screen | What it does | +| --- | --- | +| Computer overview | Smart scan entry, disk health, cleanup result categories and live CPU/memory/storage summaries | +| Daily cleanup | Runs the normal cleanup rule set, groups results by category, supports per-item and per-category selection, Trash or permanent deletion, then offers undo through History | +| Uninstall apps | Reads installed apps, builds an app-specific removal plan, shows leftover paths and warnings, then uninstalls selected items | +| Deep Clean | Searches chosen project roots for regenerable build artefacts with Git and file-age protections | +| Storage | Measures a chosen folder, exposes the largest children, drills down, and finds the largest files | +| System | Live CPU, memory, network, disk, battery, volume and process data; process termination asks for confirmation | +| History | Lists cleanup sessions, shows the ledger, restores files that are still in Trash/Recycle Bin, and opens the bin | +| Settings | Language, deletion mode, history retention, protected paths, local file locations, and software updates | + +`⌘1`–`⌘8` on macOS and `Ctrl+1`–`Ctrl+8` on Windows switch screens. + +## Tray + +Squid keeps running after its main window is closed. The tray menu can reopen +the window and jump directly to Daily cleanup, Uninstall apps or Deep Clean. +Use **Quit Squid** in the same menu to stop the background process. + +## Safety boundary + +The UI never submits a path for deletion. A scan returns an array of items and a +process-local scan ID. Delete commands accept only indices into that cached scan +or removal plan. The Rust command layer then: + +1. Rejects out-of-range indices. +2. Forces locked items to remain unselected. +3. Reconstructs the same `CleanupItem` set the scanner produced. +4. Calls `squid-engine::delete`, which re-validates ownership, safety anchors, + protected locations and the user whitelist before removing anything. + +Locked items remain visible but cannot be selected. A permanent delete always +requires the confirm sheet; the default mode comes from the same `Settings` +file used by the CLI and TUI. + +## Storage permissions on macOS + +Squid measures file metadata only. The normal cleanup scan does not cover +`~/Downloads`, and disk capacity is read with `statvfs` rather than through +CoreFoundation's CacheDelete-aware volume API, so neither path asks for access +to downloads or the media library. + +Full Disk Access is optional. On first launch Squid shows one setup card that +reports whether the app can read TCC-protected locations such as Safari, Mail and +Messages data. It does not force a permission prompt and does not block the app: +without access those locations are skipped. The same status and a link to +**System Settings › Privacy & Security › Full Disk Access** remain in +**Settings › System permissions**. The check runs again when the window regains +focus, and the card can be reopened by setting `desktop_setup_reviewed = false` +in `config.toml`. + +Folder-dependent tools remain explicit. Storage analysis starts only after you +choose a folder. macOS may still show a folder permission prompt when a folder +you selected contains protected locations. Deny any access you do not want +Squid to have; the rest of the application still works. Deep Clean's default +project roots can include Desktop and Documents, so edit that list before +scanning if you do not want those prompts. + +## Updates + +The update implementation mirrors `nex_shift`: + +- A build derives its feed from the git `origin` remote or `SQUID_UPDATE_URL`. +- The feed is an orphan `releases` branch containing installers and + `squid-update.json`. +- The manifest always provides exact byte size and SHA256; both are checked + before an installer can run. +- A build made with `SQUID_UPDATE_PUBKEY` additionally requires and verifies + `squid-update.sig`, a detached Ed25519 signature over the manifest's exact + bytes. +- The application checks at most once a day when automatic checks are enabled; + the last-check day lives in `updates.json`. +- macOS mounts the DMG after exit and swaps `Squid.app` with rollback on failure. +- Windows waits for `squid-desktop.exe` to exit, runs the same NSIS installer + silently, then relaunches it from `%LOCALAPPDATA%\Programs\Squid`. + +See [`RELEASE.md`](RELEASE.md) for the publishing commands, artifact names, and +signing setup. + +## Native CLI remains separate + +The desktop binary is `squid-desktop`. The existing `squid` binary continues to +contain the CLI/TUI and is not replaced by the desktop package. Both use the same +configuration and history directories, so a cleanup made in either entry point +appears in the other one's history. diff --git a/docs/RELEASE.md b/docs/RELEASE.md new file mode 100644 index 0000000..c415f41 --- /dev/null +++ b/docs/RELEASE.md @@ -0,0 +1,175 @@ +# Desktop release and update channel + +Squid uses the same release model as `nex_shift`: a git branch is the update +server. No object storage or release API is required. + +## Artifact names + +Both installers must carry the exact version from `src-tauri/tauri.conf.json`: + +```text +artifacts/Squid--macOS-universal.dmg +artifacts/Squid-Setup--win-x64.exe +``` + +Additional readmes and checksum files may travel with them, but +`scripts/publish-release.sh` rejects any other installer-like file. This prevents +an old DMG or stale EXE from silently entering a new release. + +## macOS + +```bash +scripts/build-macos-release.sh +``` + +The script installs both Apple Rust targets, builds a universal app and DMG, +verifies the code signature and image, then copies the result to the versioned +artifact name. Use `--skip-build` to re-verify and repackage an existing build. + +For distribution outside local testing, replace the ad-hoc identity in +`src-tauri/tauri.conf.json` with a Developer ID identity and notarize the app. +The CI configuration does not hold Apple credentials. + +## Windows + +On macOS: + +```bash +pnpm add -g cargo-xwin +scripts/build-windows-release.sh +``` + +The script builds the React bundle for the WebView2 target, cross-compiles +`x86_64-pc-windows-msvc`, checks the PE machine and embedded frontend, then uses +NSIS to produce `Squid-Setup--win-x64.exe`. + +On Windows, run the same script from Git Bash or MSYS2. It uses the native MSVC +toolchain instead of `cargo-xwin`. The installer is per-user and installs to: + +```text +%LOCALAPPDATA%\Programs\Squid +``` + +The executable inside is `squid-desktop.exe`, matching both the NSIS installer +and the update handoff script. + +## Signing key + +Create the Ed25519 key once, outside the repository: + +```bash +python3 -m pip install cryptography +python3 scripts/release-key.py keygen ~/.config/squid-release/release.ed25519 +``` + +Build with the public key so the binary refuses a manifest that is missing or +incorrectly signed: + +```bash +export SQUID_RELEASE_KEY=~/.config/squid-release/release.ed25519 +scripts/build-macos-release.sh +scripts/build-windows-release.sh +``` + +Both build scripts derive `SQUID_UPDATE_PUBKEY` from +`${SQUID_RELEASE_KEY%.ed25519}.pub`. Keep the private key out of git. + +## Publish + +Build both installers first. The publish script rebuilds the `releases` branch +as one fresh root commit, so old installers never accumulate in history: + +```bash +scripts/publish-release.sh \ + --notes RELEASE_NOTES.md \ + --key ~/.config/squid-release/release.ed25519 +``` + +Useful checks: + +```bash +scripts/publish-release.sh --dry-run --key ~/.config/squid-release/release.ed25519 +scripts/publish-release.sh --no-push --key ~/.config/squid-release/release.ed25519 +``` + +The branch contains: + +```text +squid-update.json +squid-update.sig +Squid--macOS-universal.dmg +Squid-Setup--win-x64.exe +``` + +## Feed URL + +`src-tauri/build.rs` derives the manifest URL from `origin`: + +| Remote | Feed | +| --- | --- | +| Gitea / Forgejo | `https://host/owner/repo/raw/branch/releases/squid-update.json` | +| GitHub | `https://github.com/owner/repo/raw/releases/squid-update.json` | +| GitLab | `https://gitlab.example/owner/repo/-/raw/releases/squid-update.json` | + +`SQUID_UPDATE_URL` overrides it at build time. The same variable at runtime +overrides the baked value, which is useful for staging feeds: + +```bash +SQUID_UPDATE_URL=https://host/owner/repo/raw/branch/staging/squid-update.json \ + open Squid.app +``` + +## Manifest + +Schema version 1: + +```json +{ + "schema": 1, + "version": "0.2.0", + "date": "2026-11-03", + "notes": "Release notes shown in Settings.", + "artifacts": { + "macos": { + "file": "Squid-0.2.0-macOS-universal.dmg", + "sha256": "<64 lowercase hex characters>", + "size": 123456789 + }, + "windows": { + "file": "Squid-Setup-0.2.0-win-x64.exe", + "sha256": "<64 lowercase hex characters>", + "size": 45678901 + } + } +} +``` + +Windows ARM64 first looks for `windows-arm64`, then falls back to `windows`. +Unknown artifact keys are ignored. A larger manifest schema is refused. + +## Update flow and trust + +1. The app fetches the manifest from the release branch. +2. If the build has a public key, `squid-update.sig` must verify over the + manifest's exact bytes. +3. Version comparison follows semver, including prerelease precedence. +4. The platform installer is downloaded to a temporary directory. +5. Exact byte size and SHA256 are checked. Any mismatch deletes the download. +6. Only a verified file can reach **Install and restart**. +7. The helper waits for Squid to exit, applies the update, and reopens the app. + +The signature proves the manifest came from the release key. SHA256 and size +prove the downloaded installer is the file that manifest names. HTTPS protects +the transport; it is not treated as a substitute for either check. + +## Version bump + +Keep these four values equal: + +- `Cargo.toml` workspace version +- `src-tauri/Cargo.toml` +- `src-tauri/tauri.conf.json` +- `package.json` + +Then run frontend checks, Rust tests (including `src-tauri`), build both +installers, and publish. diff --git a/index.html b/index.html new file mode 100644 index 0000000..179561b --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Squid + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..4129b97 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "squid-desktop", + "private": true, + "version": "0.1.3", + "type": "module", + "scripts": { + "dev": "vite --port 1420 --strictPort", + "build": "tsc && vite build", + "preview": "vite preview", + "check": "tsc --noEmit", + "tauri": "tauri", + "desktop:dev": "tauri dev", + "desktop:build": "tauri build", + "mac:release": "bash scripts/build-macos-release.sh", + "windows:release": "bash scripts/build-windows-release.sh" + }, + "dependencies": { + "@tauri-apps/api": "^2.12.4", + "@tauri-apps/plugin-dialog": "^2.8.3", + "@tauri-apps/plugin-opener": "^2.7.2", + "lucide-react": "^0.468.0", + "react": "^19.1.0", + "react-dom": "^19.1.0" + }, + "devDependencies": { + "@tauri-apps/cli": "^2.12.3", + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", + "@vitejs/plugin-react": "^4.4.0", + "typescript": "~5.8.3", + "vite": "^6.3.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..9ae14db --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1241 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + '@tauri-apps/api': + specifier: ^2.12.4 + version: 2.12.4 + '@tauri-apps/plugin-dialog': + specifier: ^2.8.3 + version: 2.8.3 + '@tauri-apps/plugin-opener': + specifier: ^2.7.2 + version: 2.7.2 + lucide-react: + specifier: ^0.468.0 + version: 0.468.0(react@19.1.0) + react: + specifier: ^19.1.0 + version: 19.1.0 + react-dom: + specifier: ^19.1.0 + version: 19.1.0(react@19.1.0) + +devDependencies: + '@tauri-apps/cli': + specifier: ^2.12.3 + version: 2.12.3 + '@types/react': + specifier: ^19.1.0 + version: 19.1.0 + '@types/react-dom': + specifier: ^19.1.0 + version: 19.1.0(@types/react@19.1.0) + '@vitejs/plugin-react': + specifier: ^4.4.0 + version: 4.4.0(vite@6.3.0) + typescript: + specifier: ~5.8.3 + version: 5.8.3 + vite: + specifier: ^6.3.0 + version: 6.3.0 + +packages: + + /@babel/code-frame@7.29.7: + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.29.7 + js-tokens: 4.0.0 + picocolors: 1.1.1 + dev: true + + /@babel/compat-data@7.29.7: + resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/core@7.29.7: + resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.12 + '@babel/helper-compilation-targets': 7.29.7 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) + '@babel/helpers': 7.29.10 + '@babel/parser': 7.29.12 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.12 + '@babel/types': 7.29.11 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator@7.29.12: + resolution: {integrity: sha512-2W76mhjrpQFO1lK5e8IvGYB2D0YZ7S2R1Z2BjO2ZUYuW+amcpK/z60U6ZZmzskwoa7sJ6XohP/Wg8H5KxXI/IA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/parser': 7.29.12 + '@babel/types': 7.29.11 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + dev: true + + /@babel/helper-compilation-targets@7.29.7: + resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/compat-data': 7.29.7 + '@babel/helper-validator-option': 7.29.7 + browserslist: 4.29.5 + lru-cache: 5.1.1 + semver: 6.3.2 + dev: true + + /@babel/helper-globals@7.29.7: + resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-module-imports@7.29.7: + resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/traverse': 7.29.12 + '@babel/types': 7.29.11 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7): + resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.12 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-plugin-utils@7.29.7: + resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-string-parser@7.29.11: + resolution: {integrity: sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-identifier@7.29.7: + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option@7.29.7: + resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helpers@7.29.10: + resolution: {integrity: sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.29.7 + '@babel/types': 7.29.11 + dev: true + + /@babel/parser@7.29.12: + resolution: {integrity: sha512-WJ7JBp/Q4+z/ImydtI7jS6NVco5++632ExBemSX+Ysb+G1lCwQ5BVo3SY+jGGOcZXI4ZccbZSUSJLNBW6eEpJg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.29.11 + dev: true + + /@babel/plugin-transform-react-jsx-self@7.29.7(@babel/core@7.29.7): + resolution: {integrity: sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + dev: true + + /@babel/plugin-transform-react-jsx-source@7.29.7(@babel/core@7.29.7): + resolution: {integrity: sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + dev: true + + /@babel/template@7.29.7: + resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/parser': 7.29.12 + '@babel/types': 7.29.11 + dev: true + + /@babel/traverse@7.29.12: + resolution: {integrity: sha512-MscXe/NAZcOkYEsRajHZFt3ynsb22PUi6CTrp5U7+RYycR9By84mn9mFN54YgfITiqK4hFx3Ju3tZSyzfpS5ew==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.12 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.12 + '@babel/template': 7.29.7 + '@babel/types': 7.29.11 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types@7.29.11: + resolution: {integrity: sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.29.11 + '@babel/helper-validator-identifier': 7.29.7 + dev: true + + /@esbuild/aix-ppc64@0.25.12: + resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.25.12: + resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.25.12: + resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.25.12: + resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.25.12: + resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.25.12: + resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.25.12: + resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.25.12: + resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.25.12: + resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.25.12: + resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.25.12: + resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.25.12: + resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.25.12: + resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.25.12: + resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.25.12: + resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.25.12: + resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.25.12: + resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-arm64@0.25.12: + resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.25.12: + resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-arm64@0.25.12: + resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.25.12: + resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openharmony-arm64@0.25.12: + resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.25.12: + resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.25.12: + resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.25.12: + resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.25.12: + resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@jridgewell/gen-mapping@0.3.13: + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + '@jridgewell/trace-mapping': 0.3.31 + dev: true + + /@jridgewell/remapping@2.3.5: + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + dev: true + + /@jridgewell/resolve-uri@3.1.2: + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec@1.6.0: + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + dev: true + + /@jridgewell/trace-mapping@0.3.31: + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.6.0 + dev: true + + /@napi-rs/lzma-linux-x64-gnu@1.5.1: + resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==} + engines: {node: ^22.20 || ^24.12 || >=25} + cpu: [x64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm-eabi@4.67.4: + resolution: {integrity: sha512-/v/pUAPOcwp+r1Hjjdg0cBV1TE89CzGKrKh2FgkIQw2QBcIMmVPOCSfuOZStCn4Xh/98HXfo/ht6ztcssctPNg==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64@4.67.4: + resolution: {integrity: sha512-6tmmB/P52Vt167FXXEw5auiEUgTtZz7aqUgWHqYXToIUE0HFDY6fTdAyeekjjsNk6O/8dtpSKtClxSj1mMneKQ==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-x64@4.67.4: + resolution: {integrity: sha512-8Z9Q4RmotVmuL4llOvqX814JNiOK1oqoBv+glG5KbpRfUiypqzz2/fxIzK4Pq129l4dT5a8Gszmpc0/XPYoFuQ==} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64@4.67.4: + resolution: {integrity: sha512-pnq6hssxTtwuRAl6Kdi/+IDY+b1IhkUetjhUkdLAAJCssjfqtL2Oqy/FXJVJFtAWOu1oRlArIvf0Yk1O92x2HQ==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64@4.67.4: + resolution: {integrity: sha512-BeIrGZvHMVdJg/N+ohZfFywG/gF41684YhDj2wBvouj7m9ziP1tZDUNwzXRiDY+3WIKngaC4hiUBqVtBPGP5og==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-freebsd-arm64@4.67.4: + resolution: {integrity: sha512-fRFX/oqNg/g780DKoS8RIfYcZD59Ru5O/bSeK1N7gQljBFrTxJY/q5EX4eMs5SrJf32VgVBVVYCdfPpzAwPPnQ==} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-freebsd-x64@4.67.4: + resolution: {integrity: sha512-bSrBRopG1q+0RuOsW0NtYTtIODlvNA3T3ebx5WnQVdSxWIoXFmj+rZdHUHdSLgFdZ5M6VGmekYE7r4RMGQXjfg==} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.67.4: + resolution: {integrity: sha512-L8IvdrJVtl65g1ozwDSyjGPG+FmibhCdFUwmqTItJLw0S3+Oj4QzFs7rfgTUiK7rsPjkCLdG1/GApFxoynXFJQ==} + cpu: [arm] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-musleabihf@4.67.4: + resolution: {integrity: sha512-h7PcoQOzC31jshNpQ48J0akB9tsghjkSjSl5AZ6XsVGTxVsln7t7C4SQyw62tNVSaz2SeHgk4VT2ELbL17BSHQ==} + cpu: [arm] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.67.4: + resolution: {integrity: sha512-KSPuOBNHoOl7AsVjeY1KZci8+0up0U4TFAHU5IzBYN8P+Z6cB9DZq28+JQycZW7f6WLLa/tSzhV7Rdy95bVi+g==} + cpu: [arm64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl@4.67.4: + resolution: {integrity: sha512-0E/mKmVk1PlQeQYygIwQm0jlwjANTzGSiNBMPrFx+rdFGFj/2Axh4p6XwcrystQIqXZVudTaGsdbDpzYgJ4wSA==} + cpu: [arm64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-loong64-gnu@4.67.4: + resolution: {integrity: sha512-Fvw7dOSc2Sa9UOipRZVI0zOgdLCzsjVyD/6JuHXzUHTXFu7mMgmeX/0/bCVBIut1dz+nWz3pV4WpS/Qg0XVnxw==} + cpu: [loong64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-loong64-musl@4.67.4: + resolution: {integrity: sha512-jzxbVHaE7V3F+P0wEK7UydQtvv7Twfdtx58jI5/3VRx1jJxyrn+qFwfXmqjVFxPhBl+zjaRs+ZJMFJw7vdHaQA==} + cpu: [loong64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-ppc64-gnu@4.67.4: + resolution: {integrity: sha512-fhtrzp9p4GjEJVaigaap9g6X9nP6xgJtKiLLXSDgpE18HXufA5aqfltGn+KAqMtVZReJZfOrXm//y5YSA9BWbA==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-ppc64-musl@4.67.4: + resolution: {integrity: sha512-uynaF7IUHwAckV0S+yC1f5esy9gB+aqCBsPH5BOck32TYdCuAn2lVG5tvUcFnEsrviGEmRZxE1NHSOieUPYJEg==} + cpu: [ppc64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu@4.67.4: + resolution: {integrity: sha512-uaqRFdfb8eIa2bVHN/FE3ndCvR0zV2xv0AwjCfxrqSu6l6fp/54VhjfhslKlf2RIik9L1jwlt4E56PeVX6tQtQ==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-musl@4.67.4: + resolution: {integrity: sha512-JZRow7kmxUDEASnxHuVG5itTm+nTXi9BQUABcVUnUEngC+OPwMrpx1uJ9hIA/v+IcAEBL52ktCSPXk5OJn9Jqg==} + cpu: [riscv64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-s390x-gnu@4.67.4: + resolution: {integrity: sha512-rdrh4e+Lq9fCNKoDPaCqeHXbQCe7yl77Ukl45tlSClwYdZ1gpFGZz1XLJdYtY++FRlfL5aHvb6/0n3GDW/Nxsw==} + cpu: [s390x] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.67.4: + resolution: {integrity: sha512-wL7MS4r0fYcxluF3ne2plofHZiB/LsqNCnyaUlyiKpAJLb6agPSFz7DEFCfkonWAZXMrLwCmC08b2ZEnEdJkog==} + cpu: [x64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.67.4: + resolution: {integrity: sha512-4H0XHfd2VufGjX7NjUyeue78sD0bRIoKSGjGqO+F5nSvL6jN48NAU7esdmtFEYxZXwObLtt3MJ/kHS0jASMW3g==} + cpu: [x64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-openbsd-x64@4.67.4: + resolution: {integrity: sha512-osRHQbE55pZpCLetpMsFmhkapyZnAUH73qRKMh+npi3boUom6u6hdaTTPSxlInXxwJHsn9r2uDhdz0V7Yoxx2A==} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-openharmony-arm64@4.67.4: + resolution: {integrity: sha512-95+exYEyOwrZePsE0czi4q7X5lxKPa21+lmyAZlwbYENITQ0Unk4HAQAFp/p+KhXBHBx9mUABXRYjOC5A1wY3Q==} + cpu: [arm64] + os: [openharmony] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.67.4: + resolution: {integrity: sha512-FOXOcKhNQpO4Po+Ynan6IbtM67SrXZbgpRJWVYwz53CT5veI7sVzDwVBmWS65N5Imv+wK3SVhIPAl+C5DXXNCg==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.67.4: + resolution: {integrity: sha512-cklKh0gJOkAZQcWziQa3hrjxZKN+PCHZ7SPTyGJDAiBVr05ZXlEjGFCG7zFJMaVibxsmzAe1FimN4u/HBns9+Q==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-gnu@4.67.4: + resolution: {integrity: sha512-AegwxJPc9bvUp8fQtlsUHkFMOMkGylWU7glyL+YD4vwG+QaYoGXYLSsQoeTD7kvoLZrVlMWNVhTg1dedY5C1VQ==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.67.4: + resolution: {integrity: sha512-RJZnrwTWj7Iq2ooBwoGbDdC65tDwYawneGcAfFMJqVUrRZMcskka6nTkBpXR/47G7kzn3EW2qupExnaBy11vwg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/api@2.12.4: + resolution: {integrity: sha512-pVmfis+4zT8H0Qhp3xPZx9Ju7kpzvA6rr/PSJPyuwfvucTQ8sVt61NYU9KMkK703UFlYadFmjKA4HhybOtN0gg==} + dev: false + + /@tauri-apps/cli-darwin-arm64@2.12.3: + resolution: {integrity: sha512-xmVNoJOOKzKLj7GLHXmXLimRby9M42aBIJa0sB80N7o24eKV5JiVmToKTRLVH9yhL05GZ/B6rSSOmbzNFJwBAA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-darwin-x64@2.12.3: + resolution: {integrity: sha512-URd+0usfmUQQyb5kNPiKt2OT8gp7oGU7QR+qOppB6e35mpVBFFVNhWc9oWb3p0u71fDJ09DpF4T6m9xYxoIB8g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-linux-arm-gnueabihf@2.12.3: + resolution: {integrity: sha512-0kwUVx2LbmOoTRlwF1oDww7th4/NSluv4ZBQ6KRZsFKg4g0TlTcIiJ0VehqkQYUeC9xIT1Mk6XtF52mI155VSQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-linux-arm64-gnu@2.12.3: + resolution: {integrity: sha512-gKSGDx6fx+HBLQmG6guChFdisbrCSdx9Yli+j5teOa64gm1CeM+C6NLru5Pj3ZkkEep05BmCFjxvX+cjqAycZQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-linux-arm64-musl@2.12.3: + resolution: {integrity: sha512-Yr59qMy/gcvAfBuFdCGlAmGiLsYWMFDbsP4bAI6iNBzcJTGrYWZGeiQhGDo29MQwfF/NUBqyM2qljXu5tZ6wjQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-linux-riscv64-gnu@2.12.3: + resolution: {integrity: sha512-jKr0/REBMnLKC0OwPQZkyge0mKDaNZ0b/AbfGwVyCgFfwS730EVLfVDo3nt7MUu6jJaytRq08+xSj5qfy+U1+Q==} + engines: {node: '>= 10'} + cpu: [riscv64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-linux-x64-gnu@2.12.3: + resolution: {integrity: sha512-gTkEqJAGCMROGanxHnzaJzQ+/rXl39HWVg0/hDODS1wDWBGqoceqGC6Qm1+mQbyT11xnsB8mKu/gyVID/YpFIw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-linux-x64-musl@2.12.3: + resolution: {integrity: sha512-T2dTxL1svRym71fZtaW4pZYXbthbfFsEJr1NeOUg/p7laWXZbUt/8DMSZf8recu9f7+1F/Lv00HtzsEu6vDO9w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-win32-arm64-msvc@2.12.3: + resolution: {integrity: sha512-eoiQwpEZWbpsVHcM9BAzqqe4TCHszvr3rsM7pUQ4ofLK0lF1i1d/jX0Qo5DYMqcrUtwQuDdDuOCbcT0Izf1VwQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-win32-ia32-msvc@2.12.3: + resolution: {integrity: sha512-kE+KUg6Dbbkgvcw0m99wJVIToFQzJqpMBAXah74WqxaLzssNwSTUccrHp6+QVzMhjQP330tvekFmnQF+0NbE6Q==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli-win32-x64-msvc@2.12.3: + resolution: {integrity: sha512-L7wndWAgX2mLW7alswpL3d1R0P9FN2WYBgHaQkAYEBxHHGkY4vFX9CjcRQ1LAxDAMIJxrY7/aDziFJeChS84NQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@tauri-apps/cli@2.12.3: + resolution: {integrity: sha512-f7/LsY74SVb1ChmOPw1ajOpxii0GSzDAgmWHRci8JUYuuai04rXsSbFobpmB0sP2DdlvMD/B5ZotEn8GOGMRUg==} + engines: {node: '>= 10'} + hasBin: true + optionalDependencies: + '@tauri-apps/cli-darwin-arm64': 2.12.3 + '@tauri-apps/cli-darwin-x64': 2.12.3 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.12.3 + '@tauri-apps/cli-linux-arm64-gnu': 2.12.3 + '@tauri-apps/cli-linux-arm64-musl': 2.12.3 + '@tauri-apps/cli-linux-riscv64-gnu': 2.12.3 + '@tauri-apps/cli-linux-x64-gnu': 2.12.3 + '@tauri-apps/cli-linux-x64-musl': 2.12.3 + '@tauri-apps/cli-win32-arm64-msvc': 2.12.3 + '@tauri-apps/cli-win32-ia32-msvc': 2.12.3 + '@tauri-apps/cli-win32-x64-msvc': 2.12.3 + dev: true + + /@tauri-apps/plugin-dialog@2.8.3: + resolution: {integrity: sha512-Hd/yBfk2R5v2MFrz/0VArSXeh8xKLLXGunqSiTtcHKn1zNZwaKujuA0VSwUvNfwC4hDoF1PveS+gBDNe3nHspw==} + dependencies: + '@tauri-apps/api': 2.12.4 + dev: false + + /@tauri-apps/plugin-opener@2.7.2: + resolution: {integrity: sha512-LyybP1VSzTMQiaFYcsbAse47KpivlyXdLZMQzGLEnkgQacGESnpjAfFoQ6h5sqWgAdZDH9szYjPzHMpv0Sz+TQ==} + dependencies: + '@tauri-apps/api': 2.12.4 + dev: false + + /@types/babel__core@7.20.5: + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + dependencies: + '@babel/parser': 7.29.12 + '@babel/types': 7.29.11 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.28.0 + dev: true + + /@types/babel__generator@7.27.0: + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + dependencies: + '@babel/types': 7.29.11 + dev: true + + /@types/babel__template@7.4.4: + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + dependencies: + '@babel/parser': 7.29.12 + '@babel/types': 7.29.11 + dev: true + + /@types/babel__traverse@7.28.0: + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + dependencies: + '@babel/types': 7.29.11 + dev: true + + /@types/estree@1.0.10: + resolution: {integrity: sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==} + dev: true + + /@types/react-dom@19.1.0(@types/react@19.1.0): + resolution: {integrity: sha512-21E2zejNNRtjG4hKIyJz4aWswGEcNFTgttA0bZIRGjj1HA/tbSUxIJnIcYbn98pwJck0cS1bsQhn6eaKqbcFWw==} + peerDependencies: + '@types/react': ^19.0.0 + dependencies: + '@types/react': 19.1.0 + dev: true + + /@types/react@19.1.0: + resolution: {integrity: sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==} + dependencies: + csstype: 3.2.3 + dev: true + + /@vitejs/plugin-react@4.4.0(vite@6.3.0): + resolution: {integrity: sha512-x/EztcTKVj+TDeANY1WjNeYsvZjZdfWRMP/KXi5Yn8BoTzpa13ZltaQqKfvWYbX8CE10GOHHdC5v86jY9x8i/g==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^4.2.0 || ^5.0.0 || ^6.0.0 + dependencies: + '@babel/core': 7.29.7 + '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7) + '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/core@7.29.7) + '@types/babel__core': 7.20.5 + react-refresh: 0.17.0 + vite: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /baseline-browser-mapping@2.11.35: + resolution: {integrity: sha512-GNk8KX52CHqeNKGk8+7tZnQab/2k1t/BgrUHPKNdijzpEhF1saPQZHVKb6m5loSAxB39gyrTYw34Qf9CQ3u1qQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dev: true + + /browserslist@4.29.5: + resolution: {integrity: sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + baseline-browser-mapping: 2.11.35 + caniuse-lite: 1.0.30001820 + electron-to-chromium: 1.5.473 + node-releases: 2.0.63 + update-browserslist-db: 1.3.4(browserslist@4.29.5) + dev: true + + /caniuse-lite@1.0.30001820: + resolution: {integrity: sha512-gfWD6MxqVCqAOwmODfZf7DchWvlrA+SRdNX7ceLfg3xRqe5ssjjpF7EgslC/0tiLiNTajdaNN/q8c/5u/7Gz8w==} + dev: true + + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + + /csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + dev: true + + /debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + + /electron-to-chromium@1.5.473: + resolution: {integrity: sha512-9njcRQK+6FOXNAWw5g+h2RPiyazqo5RFMVJ39ZMHjDHUNnnFlhnOGV7O0WmJetODDx19ES5p+FLi+KCVFQGugw==} + dev: true + + /esbuild@0.25.12: + resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + engines: {node: '>=18'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.12 + '@esbuild/android-arm': 0.25.12 + '@esbuild/android-arm64': 0.25.12 + '@esbuild/android-x64': 0.25.12 + '@esbuild/darwin-arm64': 0.25.12 + '@esbuild/darwin-x64': 0.25.12 + '@esbuild/freebsd-arm64': 0.25.12 + '@esbuild/freebsd-x64': 0.25.12 + '@esbuild/linux-arm': 0.25.12 + '@esbuild/linux-arm64': 0.25.12 + '@esbuild/linux-ia32': 0.25.12 + '@esbuild/linux-loong64': 0.25.12 + '@esbuild/linux-mips64el': 0.25.12 + '@esbuild/linux-ppc64': 0.25.12 + '@esbuild/linux-riscv64': 0.25.12 + '@esbuild/linux-s390x': 0.25.12 + '@esbuild/linux-x64': 0.25.12 + '@esbuild/netbsd-arm64': 0.25.12 + '@esbuild/netbsd-x64': 0.25.12 + '@esbuild/openbsd-arm64': 0.25.12 + '@esbuild/openbsd-x64': 0.25.12 + '@esbuild/openharmony-arm64': 0.25.12 + '@esbuild/sunos-x64': 0.25.12 + '@esbuild/win32-arm64': 0.25.12 + '@esbuild/win32-ia32': 0.25.12 + '@esbuild/win32-x64': 0.25.12 + dev: true + + /escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + dev: true + + /fdir@6.5.0(picomatch@4.0.7): + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + dependencies: + picomatch: 4.0.7 + dev: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + dev: true + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + dev: true + + /json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + dev: true + + /lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + + /lucide-react@0.468.0(react@19.1.0): + resolution: {integrity: sha512-6koYRhnM2N0GGZIdXzSeiNwguv1gt/FAjZOiPl76roBi3xKEXa4WmfpxgQwTTL4KipXjefrnf3oV4IsYhi4JFA==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc + dependencies: + react: 19.1.0 + dev: false + + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + + /nanoid@3.3.20: + resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + + /node-releases@2.0.63: + resolution: {integrity: sha512-6li2QanLsAXpIH2R6j77MzRyvOyrvdTqlKtO4CgBdHGNvN99ZZfyxszHc5o5+IZBWD5u6Hzwg83JoGXmqZNG9Q==} + engines: {node: '>=18'} + dev: true + + /picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + dev: true + + /picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + dev: true + + /postcss@8.5.32: + resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.20 + picocolors: 1.1.1 + source-map-js: 1.2.2 + dev: true + + /react-dom@19.1.0(react@19.1.0): + resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==} + peerDependencies: + react: ^19.1.0 + dependencies: + react: 19.1.0 + scheduler: 0.26.0 + dev: false + + /react-refresh@0.17.0: + resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==} + engines: {node: '>=0.10.0'} + dev: true + + /react@19.1.0: + resolution: {integrity: sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==} + engines: {node: '>=0.10.0'} + dev: false + + /rollup@4.67.4: + resolution: {integrity: sha512-Lsv3oKcz5jgOQJej/p7nfwbVEdAbDT+z6OPf/SCdI+nF+q2ENp0pTKT35ZwXAmH8g45mfrIiJeEyAqKYSYoL9Q==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + dependencies: + '@types/estree': 1.0.10 + optionalDependencies: + '@napi-rs/lzma-linux-x64-gnu': 1.5.1 + '@rollup/rollup-android-arm-eabi': 4.67.4 + '@rollup/rollup-android-arm64': 4.67.4 + '@rollup/rollup-android-x64': 4.67.4 + '@rollup/rollup-darwin-arm64': 4.67.4 + '@rollup/rollup-darwin-x64': 4.67.4 + '@rollup/rollup-freebsd-arm64': 4.67.4 + '@rollup/rollup-freebsd-x64': 4.67.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.67.4 + '@rollup/rollup-linux-arm-musleabihf': 4.67.4 + '@rollup/rollup-linux-arm64-gnu': 4.67.4 + '@rollup/rollup-linux-arm64-musl': 4.67.4 + '@rollup/rollup-linux-loong64-gnu': 4.67.4 + '@rollup/rollup-linux-loong64-musl': 4.67.4 + '@rollup/rollup-linux-ppc64-gnu': 4.67.4 + '@rollup/rollup-linux-ppc64-musl': 4.67.4 + '@rollup/rollup-linux-riscv64-gnu': 4.67.4 + '@rollup/rollup-linux-riscv64-musl': 4.67.4 + '@rollup/rollup-linux-s390x-gnu': 4.67.4 + '@rollup/rollup-linux-x64-gnu': 4.67.4 + '@rollup/rollup-linux-x64-musl': 4.67.4 + '@rollup/rollup-openbsd-x64': 4.67.4 + '@rollup/rollup-openharmony-arm64': 4.67.4 + '@rollup/rollup-win32-arm64-msvc': 4.67.4 + '@rollup/rollup-win32-ia32-msvc': 4.67.4 + '@rollup/rollup-win32-x64-gnu': 4.67.4 + '@rollup/rollup-win32-x64-msvc': 4.67.4 + fsevents: 2.3.3 + dev: true + + /scheduler@0.26.0: + resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==} + dev: false + + /semver@6.3.2: + resolution: {integrity: sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==} + hasBin: true + dev: true + + /source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} + dev: true + + /tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + dev: true + + /typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /update-browserslist-db@1.3.4(browserslist@4.29.5): + resolution: {integrity: sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.29.5 + escalade: 3.2.0 + picocolors: 1.1.1 + dev: true + + /vite@6.3.0: + resolution: {integrity: sha512-9aC0n4pr6hIbvi1YOpFjwQ+QOTGssvbJKoeYkuHHGWwlXfdxQlI8L2qNMo9awEEcCPSiS+5mJZk5jH1PAqoDeQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + dependencies: + esbuild: 0.25.12 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + postcss: 8.5.32 + rollup: 4.67.4 + tinyglobby: 0.2.17 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true diff --git a/release/0.1.3/README-Windows-x64.txt b/release/0.1.3/README-Windows-x64.txt new file mode 100644 index 0000000..519d92b --- /dev/null +++ b/release/0.1.3/README-Windows-x64.txt @@ -0,0 +1,27 @@ +Squid 0.1.3 - Windows x64 + +系统要求 +-------- +- Windows 10 或 Windows 11(x64;ARM64 设备通过系统兼容层运行)。 +- Microsoft Edge WebView2 Runtime。Windows 10/11 通常已内置;如果 Squid + 启动后窗口空白,请从微软官方页面安装 WebView2 Evergreen Runtime: + https://developer.microsoft.com/microsoft-edge/webview2/ +- 安装与运行都不需要管理员权限。安装位置为 + %LOCALAPPDATA%\Programs\Squid。 + +安装 +---- +1. 运行 Squid-Setup-0.1.3-win-x64.exe。 +2. 这是未签名构建。若 SmartScreen 显示警告,请选择“更多信息” > “仍要运行”。 +3. 卸载请在 Windows“设置 > 应用”中移除 Squid。 + +更新 +---- +Squid 使用与 nex_shift 一致的 releases 分支更新通道。更新包会先校验 +文件大小与 SHA256,再在退出后运行同一个安装程序。若构建时写入发布公钥, +还会验证清单的 Ed25519 签名。 + +校验 +---- +PowerShell: + Get-FileHash .\Squid-Setup-0.1.3-win-x64.exe -Algorithm SHA256 diff --git a/release/0.1.3/SHA256SUMS.txt b/release/0.1.3/SHA256SUMS.txt new file mode 100644 index 0000000..7585e70 --- /dev/null +++ b/release/0.1.3/SHA256SUMS.txt @@ -0,0 +1,3 @@ +d44c41f88496652384380ceca1bff24656acb815f78fc32a57a35f29dce5c6d7 Squid-0.1.3-macOS-universal.dmg +64619e91347b64c3fa3e1ac69b1148667e06c920e756a473b370a4abaf82de2b Squid-Setup-0.1.3-win-x64.exe +56fc98cb26b7ea24959eea9b043e96d9dfa0b635ee049d3c263f0be58d9b3960 README-Windows-x64.txt diff --git a/release/0.1.3/Squid-0.1.3-macOS-universal.dmg b/release/0.1.3/Squid-0.1.3-macOS-universal.dmg new file mode 100644 index 0000000..bcbe852 Binary files /dev/null and b/release/0.1.3/Squid-0.1.3-macOS-universal.dmg differ diff --git a/release/0.1.3/Squid-Setup-0.1.3-win-x64.exe b/release/0.1.3/Squid-Setup-0.1.3-win-x64.exe new file mode 100644 index 0000000..2f741a1 Binary files /dev/null and b/release/0.1.3/Squid-Setup-0.1.3-win-x64.exe differ diff --git a/release/0.1.3/squid-update.json b/release/0.1.3/squid-update.json new file mode 100644 index 0000000..ae7d0e1 --- /dev/null +++ b/release/0.1.3/squid-update.json @@ -0,0 +1,18 @@ +{ + "schema": 1, + "version": "0.1.3", + "date": "2026-11-05", + "notes": "Squid 0.1.3\n\n- 软件更新仅在发现新版本时显示版本变化与更新说明。\n- 左侧导航精简为「电脑概览、日常清理、应用卸载」。\n- 关闭主窗口后常驻托盘;托盘菜单提供「日常清理、应用卸载、深度清理」及退出。\n- macOS 与 Windows 同步发布 0.1.3。", + "artifacts": { + "macos": { + "file": "Squid-0.1.3-macOS-universal.dmg", + "sha256": "d44c41f88496652384380ceca1bff24656acb815f78fc32a57a35f29dce5c6d7", + "size": 10688482 + }, + "windows": { + "file": "Squid-Setup-0.1.3-win-x64.exe", + "sha256": "64619e91347b64c3fa3e1ac69b1148667e06c920e756a473b370a4abaf82de2b", + "size": 3343118 + } + } +} diff --git a/scripts/build-macos-release.sh b/scripts/build-macos-release.sh new file mode 100755 index 0000000..af2b588 --- /dev/null +++ b/scripts/build-macos-release.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Build the universal macOS DMG and copy it to the versioned release name. +# +# scripts/build-macos-release.sh [--skip-build] +# +# Produces artifacts/Squid--macOS-universal.dmg. +set -euo pipefail +cd "$(dirname "$0")/.." + +if [ "$(uname -s)" != "Darwin" ]; then + echo "macOS release must be built on macOS." >&2 + exit 1 +fi + +export PATH="$HOME/.cargo/bin:$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin:$PATH" +export RUSTUP_TOOLCHAIN=stable-aarch64-apple-darwin + +if [ -z "${SQUID_UPDATE_PUBKEY:-}" ] && [ -n "${SQUID_RELEASE_KEY:-}" ]; then + SQUID_UPDATE_PUBKEY=$(python3 scripts/release-key.py pubkey "${SQUID_RELEASE_KEY%.ed25519}.pub") + export SQUID_UPDATE_PUBKEY +fi + +SKIP_BUILD=0 +while [ $# -gt 0 ]; do + case "$1" in + --skip-build) SKIP_BUILD=1 ;; + *) echo "usage: $0 [--skip-build]" >&2; exit 2 ;; + esac + shift +done + +VERSION=$(python3 -c "import json;print(json.load(open('src-tauri/tauri.conf.json'))['version'])") +BUNDLE_DIR="src-tauri/target/universal-apple-darwin/release/bundle" +APP="$BUNDLE_DIR/macos/Squid.app" +OUTPUT="artifacts/Squid-$VERSION-macOS-universal.dmg" + +rustup target add x86_64-apple-darwin aarch64-apple-darwin + +if [ "$SKIP_BUILD" != "1" ]; then + if [ -n "${SQUID_UPDATE_PUBKEY:-}" ]; then + echo "== release key baked in: ${SQUID_UPDATE_PUBKEY:0:12}… ==" + else + echo "== no release key: this build will report the feed as unsigned ==" + fi + pnpm tauri build --target universal-apple-darwin --bundles app,dmg +fi + +test -d "$APP" +DMG=$(find "$BUNDLE_DIR/dmg" -maxdepth 1 -type f -name '*.dmg' -print -quit) +test -n "$DMG" + +codesign --verify --deep --strict "$APP" +hdiutil verify "$DMG" >/dev/null +mkdir -p artifacts +cp -f "$DMG" "$OUTPUT" +hdiutil verify "$OUTPUT" >/dev/null + +echo "== macOS release ==" +ls -lh "$OUTPUT" diff --git a/scripts/build-windows-release.sh b/scripts/build-windows-release.sh new file mode 100755 index 0000000..58b674d --- /dev/null +++ b/scripts/build-windows-release.sh @@ -0,0 +1,178 @@ +#!/bin/bash +# Build the Windows x64 installer and refresh artifacts/SHA256SUMS.txt. +# +# scripts/build-windows-release.sh [--skip-build] +# +# On macOS this cross-compiles with cargo-xwin. On Windows (Git Bash/MSYS2) it +# uses the native MSVC toolchain. Both paths feed the same NSIS installer. +set -euo pipefail +cd "$(dirname "$0")/.." + +ROOT="$PWD" +VERSION=$(python3 -c "import json;print(json.load(open('src-tauri/tauri.conf.json'))['version'])") +TARGET=x86_64-pc-windows-msvc +INSTALLER="artifacts/Squid-Setup-$VERSION-win-x64.exe" +NOTES="artifacts/README-Windows-x64.txt" +HOST=$(uname -s) + +if [ "$HOST" = "Darwin" ]; then + export PATH="$HOME/.cargo/bin:$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin:/opt/homebrew/opt/llvm/bin:$PATH" + export RUSTUP_TOOLCHAIN=stable-aarch64-apple-darwin + export RUSTC="$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc" +fi + +SKIP_BUILD=0 +while [ $# -gt 0 ]; do + case "$1" in + --skip-build) SKIP_BUILD=1 ;; + *) echo "usage: $0 [--skip-build]" >&2; exit 2 ;; + esac + shift +done + +if [ -z "${SQUID_UPDATE_PUBKEY:-}" ] && [ -n "${SQUID_RELEASE_KEY:-}" ]; then + SQUID_UPDATE_PUBKEY=$(python3 scripts/release-key.py pubkey "${SQUID_RELEASE_KEY%.ed25519}.pub") + export SQUID_UPDATE_PUBKEY +fi +if [ -n "${SQUID_UPDATE_PUBKEY:-}" ]; then + echo "== release key baked in: ${SQUID_UPDATE_PUBKEY:0:12}… ==" +else + echo "== no release key: this build will report the feed as unsigned ==" +fi + +if [ "$SKIP_BUILD" != "1" ]; then + echo "== frontend (Windows target: chrome105) ==" + TAURI_ENV_PLATFORM=windows pnpm build + + echo "== rust build ($TARGET) ==" + CROSS_LOG=$(mktemp /tmp/squid-win-build.XXXXXX) + if [ "$HOST" = "Darwin" ]; then + if ! ( + cd src-tauri + cargo xwin build --target "$TARGET" --release \ + --features tauri/custom-protocol >"$CROSS_LOG" 2>&1 + ); then + sed -n '1,240p' "$CROSS_LOG" + exit 1 + fi + else + if ! ( + cd src-tauri + cargo build --target "$TARGET" --release \ + --features tauri/custom-protocol >"$CROSS_LOG" 2>&1 + ); then + sed -n '1,240p' "$CROSS_LOG" + exit 1 + fi + fi + grep -Ev "^warning:|^\s+\||^\s+=|LNK4099|failed to load|^$|^\s+-->|^note:" \ + "$CROSS_LOG" || true +fi + +EXE="src-tauri/target/$TARGET/release/squid-desktop.exe" +test -f "$EXE" + +echo "== PE machine check (x64) ==" +python3 - "$EXE" <<'PY' +import pathlib, struct, sys +exe = pathlib.Path(sys.argv[1]).read_bytes() +machine = struct.unpack_from(" “仍要运行”。 +3. 卸载请在 Windows“设置 > 应用”中移除 Squid。 + +更新 +---- +Squid 使用与 nex_shift 一致的 releases 分支更新通道。更新包会先校验 +文件大小与 SHA256,再在退出后运行同一个安装程序。若构建时写入发布公钥, +还会验证清单的 Ed25519 签名。 + +校验 +---- +PowerShell: + Get-FileHash .\\Squid-Setup-{version}-win-x64.exe -Algorithm SHA256 +""" +(stage / "README-Windows.txt").write_bytes(text.replace("\n", "\r\n").encode("utf-8")) +PY + +echo "== NSIS installer (x64) ==" +mkdir -p artifacts +SIZE_KB=$(( ($(stat -f%z "$EXE" 2>/dev/null || stat -c%s "$EXE") + 1023) / 1024 )) +makensis -V2 \ + -DSQUID_EXE="$ROOT/$EXE" \ + -DLICENSE_FILE="$ROOT/LICENSE" \ + -DREADME_FILE="$STAGE/README-Windows.txt" \ + -DICONS_DIR="$ROOT/src-tauri/icons" \ + -DOUT_FILE="$ROOT/$INSTALLER" \ + -DVERSION="$VERSION" \ + -DEST_SIZE_KB="$SIZE_KB" \ + scripts/windows-installer.nsi +mv "$STAGE/README-Windows.txt" "$NOTES" +rm -rf "$STAGE" + +echo "== checksums ==" +python3 - "$VERSION" <<'PY' +import hashlib, pathlib, sys +version = sys.argv[1] +artifacts = pathlib.Path("artifacts") +preferred = [ + f"Squid-{version}-macOS-universal.dmg", + f"Squid-Setup-{version}-win-x64.exe", + "README-Windows-x64.txt", +] +names = [name for name in preferred if (artifacts / name).is_file()] +lines = [ + f"{hashlib.sha256((artifacts / name).read_bytes()).hexdigest()} {name}" + for name in names +] +(artifacts / "SHA256SUMS.txt").write_text("".join(line + "\n" for line in lines), encoding="utf-8") +print("\n".join(lines)) +PY + +echo "== result ==" +ls -lh artifacts/ diff --git a/scripts/publish-release.sh b/scripts/publish-release.sh new file mode 100755 index 0000000..54bdd0b --- /dev/null +++ b/scripts/publish-release.sh @@ -0,0 +1,153 @@ +#!/bin/bash +# Publish installers to the orphan git branch that is Squid's update channel. +# +# scripts/publish-release.sh [--notes FILE] [--key FILE] [--dry-run] +# [--no-push] [--branch NAME] +# +# The branch contains `squid-update.json`, the exact installers it names, and +# optionally `squid-update.sig` over the manifest's bytes. Rebuilding the branch +# from scratch on every run prevents installers from accumulating in history. +set -euo pipefail +cd "$(dirname "$0")/.." + +BRANCH="${SQUID_RELEASE_BRANCH:-releases}" +MANIFEST="squid-update.json" +SIGNATURE="squid-update.sig" +NOTES_FILE="" +KEY_FILE="${SQUID_RELEASE_KEY:-}" +DRY_RUN=0 +NO_PUSH=0 + +while [ $# -gt 0 ]; do + case "$1" in + --notes) NOTES_FILE="$2"; shift 2 ;; + --dry-run) DRY_RUN=1; shift ;; + --no-push) NO_PUSH=1; shift ;; + --branch) BRANCH="$2"; shift 2 ;; + --key) KEY_FILE="$2"; shift 2 ;; + *) echo "unknown argument: $1" >&2; exit 2 ;; + esac +done + +VERSION=$(python3 -c "import json;print(json.load(open('src-tauri/tauri.conf.json'))['version'])") +PLAN=$(mktemp /tmp/squid-release-plan.XXXXXX) +INDEX_FILE=$(mktemp /tmp/squid-release-index.XXXXXX) +MANIFEST_PATH=$(mktemp /tmp/squid-manifest.XXXXXX) +SIGNATURE_PATH=$(mktemp /tmp/squid-signature.XXXXXX) +trap 'rm -f "$PLAN" "$INDEX_FILE" "$MANIFEST_PATH" "$SIGNATURE_PATH"' EXIT + +python3 - "$VERSION" "$MANIFEST" "$NOTES_FILE" > "$PLAN" <<'PY' +import datetime, hashlib, json, pathlib, re, sys + +version, manifest_name, notes_file = sys.argv[1:4] +artifacts = pathlib.Path("artifacts") +if not artifacts.is_dir(): + sys.exit("artifacts/ is missing; build a release first.") +notes = pathlib.Path(notes_file).read_text(encoding="utf-8").strip() if notes_file else "" + +patterns = [ + ("macos", rf"^Squid-{re.escape(version)}-macOS-universal\.dmg$"), + ("windows", rf"^Squid-Setup-{re.escape(version)}-win-x64\.exe$"), +] +candidates = sorted(p.name for p in artifacts.iterdir() if p.is_file()) + +def digest(name): + path = artifacts / name + return hashlib.sha256(path.read_bytes()).hexdigest(), path.stat().st_size + +manifest = { + "schema": 1, + "version": version, + "date": datetime.date.today().isoformat(), + "notes": notes, + "artifacts": {}, +} +chosen = [] +for platform, pattern in patterns: + match = next((name for name in candidates if re.search(pattern, name)), None) + if not match: + sys.exit( + f"missing installer for {platform} at version {version}; expected " + f"Squid-{version}-macOS-universal.dmg and " + f"Squid-Setup-{version}-win-x64.exe" + ) + digest_value, size = digest(match) + manifest["artifacts"][platform] = { + "file": match, + "sha256": digest_value, + "size": size, + } + chosen.append(match) + +unexpected = [ + name + for name in candidates + if re.search(r"\.(dmg|exe|msi|pkg|zip|AppImage|deb)$", name, re.IGNORECASE) + and name not in chosen +] +if unexpected: + sys.exit("only versioned release installers may be published; remove: " + ", ".join(unexpected)) + +sys.stdout.write(json.dumps(manifest, indent=2, ensure_ascii=False) + "\n") +sys.stdout.write("\0") +for name in candidates: + if name in {manifest_name, "squid-update.sig"} or name.startswith("."): + continue + digest_value, size = digest(name) + sys.stdout.write(f"{name}\t{digest_value}\t{size}\0") +PY + +MANIFEST_JSON=$(python3 -c "import sys;print(sys.stdin.read().split('\0')[0],end='')" < "$PLAN") +echo "== manifest for $VERSION ==" +printf '%s\n' "$MANIFEST_JSON" +printf '%s\n' "$MANIFEST_JSON" > "$MANIFEST_PATH" + +if [ -n "$KEY_FILE" ]; then + python3 scripts/release-key.py sign "$KEY_FILE" "$MANIFEST_PATH" > "$SIGNATURE_PATH" + PUBLIC_FILE="${KEY_FILE%.ed25519}.pub" + if [ "$PUBLIC_FILE" != "$KEY_FILE" ] && [ -f "$PUBLIC_FILE" ]; then + python3 scripts/release-key.py verify "$PUBLIC_FILE" "$MANIFEST_PATH" "$SIGNATURE_PATH" + fi + echo "== manifest signed with $KEY_FILE ==" +fi + +echo "== building the $BRANCH tree ==" +export GIT_INDEX_FILE="$INDEX_FILE" +git read-tree --empty +git update-index --add --cacheinfo "100644,$(git hash-object -w "$MANIFEST_PATH"),$MANIFEST" +if [ -s "$SIGNATURE_PATH" ]; then + git update-index --add --cacheinfo "100644,$(git hash-object -w "$SIGNATURE_PATH"),$SIGNATURE" +fi +while IFS=$'\t' read -r -d '' name digest_value size; do + [ -n "$name" ] || continue + git update-index --add --cacheinfo "100644,$(git hash-object -w "artifacts/$name"),$name" + printf ' %-42s %10s B %s…\n' "$name" "$size" "${digest_value:0:16}" +done < <(python3 -c " +import sys +for entry in sys.stdin.read().split('\0')[1:]: + if entry.strip(): + sys.stdout.write(entry + '\0') +" < "$PLAN") +TREE=$(git write-tree) +COMMIT=$(git commit-tree "$TREE" -m "release $VERSION") +unset GIT_INDEX_FILE + +if [ "$DRY_RUN" = 1 ]; then + echo "== dry run: $COMMIT would become $BRANCH ==" + git ls-tree -rl "$COMMIT" | while read -r mode type hash size name; do + printf ' %12s B %s\n' "$size" "$name" + done + exit 0 +fi + +git update-ref "refs/heads/$BRANCH" "$COMMIT" +echo "committed $VERSION as $(git rev-parse --short "$BRANCH")" + +if [ "$NO_PUSH" = 1 ]; then + echo "--no-push: committed locally on $BRANCH" + exit 0 +fi + +echo "== pushing $BRANCH ==" +git push --force origin "$BRANCH" +echo "published $VERSION" diff --git a/scripts/release-key.py b/scripts/release-key.py new file mode 100755 index 0000000..d82c795 --- /dev/null +++ b/scripts/release-key.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +"""Ed25519 signing for Squid's git-backed update channel. + + scripts/release-key.py keygen KEY_FILE + scripts/release-key.py pubkey KEY_FILE + scripts/release-key.py sign KEY_FILE FILE + scripts/release-key.py verify PUBKEY FILE SIG_FILE + +The signature covers the manifest file's exact bytes, so verification does not +depend on JSON canonicalisation. Keep the private key outside this repository. +""" +import base64 +import pathlib +import sys + +try: + from cryptography.hazmat.primitives import serialization + from cryptography.hazmat.primitives.asymmetric.ed25519 import ( + Ed25519PrivateKey, + Ed25519PublicKey, + ) +except ImportError: + sys.exit("needs cryptography: python3 -m pip install cryptography") + +USAGE = __doc__ + + +def public_hex(path): + if path.suffix == ".pub": + key = Ed25519PublicKey.from_public_bytes(path.read_bytes()) + else: + key = Ed25519PrivateKey.from_private_bytes(path.read_bytes()).public_key() + return key.public_bytes( + serialization.Encoding.Raw, serialization.PublicFormat.Raw + ).hex() + + +def main(argv): + if len(argv) < 2: + sys.exit(USAGE) + command, key_file = argv[0], pathlib.Path(argv[1]) + + if command == "keygen": + if key_file.exists(): + sys.exit(f"{key_file} exists; refusing to overwrite a release key") + key = Ed25519PrivateKey.generate() + key_file.parent.mkdir(parents=True, exist_ok=True) + key_file.write_bytes( + key.private_bytes( + serialization.Encoding.Raw, + serialization.PrivateFormat.Raw, + serialization.NoEncryption(), + ) + ) + key_file.chmod(0o600) + public = key_file.with_suffix(".pub") + public.write_bytes( + key.public_key().public_bytes( + serialization.Encoding.Raw, serialization.PublicFormat.Raw + ) + ) + print(f"key: {key_file} (keep this private, never commit it)") + print(f"pubkey: {public}") + print(f"build with SQUID_UPDATE_PUBKEY={public_hex(public)}") + return 0 + + if command == "pubkey": + print(public_hex(key_file)) + return 0 + + if command == "sign": + if len(argv) < 3: + sys.exit(USAGE) + key = Ed25519PrivateKey.from_private_bytes(key_file.read_bytes()) + signature = key.sign(pathlib.Path(argv[2]).read_bytes()) + sys.stdout.write(base64.b64encode(signature).decode() + "\n") + return 0 + + if command == "verify": + if len(argv) < 4: + sys.exit(USAGE) + signature = base64.b64decode(pathlib.Path(argv[3]).read_text().strip()) + Ed25519PublicKey.from_public_bytes(key_file.read_bytes()).verify( + signature, pathlib.Path(argv[2]).read_bytes() + ) + print("signature ok") + return 0 + + sys.exit(f"unknown command: {command}\n\n{USAGE}") + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv[1:])) diff --git a/scripts/windows-installer.nsi b/scripts/windows-installer.nsi new file mode 100644 index 0000000..35aee47 --- /dev/null +++ b/scripts/windows-installer.nsi @@ -0,0 +1,186 @@ +; Squid - Windows installer (NSIS 3, per-user, no administrator rights). +; +; makensis -DSQUID_EXE= -DLICENSE_FILE= -DREADME_FILE= \ +; -DICONS_DIR= -DOUT_FILE= -DVERSION=0.1.0 \ +; -DEST_SIZE_KB= scripts/windows-installer.nsi +; +; The x64 package also runs on Windows 11 ARM64 through the system's x64 +; compatibility layer. Install scope is per-user: Squid writes to HKCU and its +; own LocalAppData folder only. + +!include "MUI2.nsh" +!include "LogicLib.nsh" +!include "WinVer.nsh" +!include "x64.nsh" + +!ifndef VERSION + !error "VERSION is required (for example -DVERSION=0.1.0)" +!endif +!ifndef SQUID_EXE + !error "SQUID_EXE is required" +!endif +!ifndef OUT_FILE + !define OUT_FILE "Squid-Setup.exe" +!endif +!ifndef EST_SIZE_KB + !define EST_SIZE_KB "40000" +!endif + +!define APP_NAME "Squid" +!define APP_ID "app.nex.squid" +!define APP_VERSION "${VERSION}" +!define PUBLISHER "Squid Contributors" +!define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_ID}" +!define WEBVIEW_KEY "SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" + +Unicode true +Name "${APP_NAME}" +OutFile "${OUT_FILE}" +InstallDir "$LOCALAPPDATA\Programs\${APP_NAME}" +InstallDirRegKey HKCU "Software\${APP_NAME}" "InstallDirectory" +RequestExecutionLevel user +SetCompressor /SOLID lzma + +!define /date BUILD_YEAR "%Y" +VIProductVersion "${APP_VERSION}.0" +VIAddVersionKey ProductName "${APP_NAME}" +VIAddVersionKey ProductVersion "${APP_VERSION}" +VIAddVersionKey CompanyName "${PUBLISHER}" +VIAddVersionKey LegalCopyright "Copyright ${BUILD_YEAR} ${PUBLISHER}" +VIAddVersionKey FileDescription "${APP_NAME} installer" +VIAddVersionKey FileVersion "${APP_VERSION}.0" +VIAddVersionKey OriginalFilename "Squid-Setup-${VERSION}-win-x64.exe" + +!define MUI_ICON "${ICONS_DIR}\icon.ico" +!define MUI_UNICON "${ICONS_DIR}\icon.ico" +!define MUI_ABORTWARNING +!define MUI_FINISHPAGE_RUN "$INSTDIR\squid-desktop.exe" +!define MUI_FINISHPAGE_RUN_TEXT "$(run_squid)" +!define MUI_FINISHPAGE_SHOWREADME +!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(read_me)" +!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED +!define MUI_FINISHPAGE_SHOWREADME_FUNCTION show_readme + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "SimpChinese" + +LangString run_squid 1033 "Launch Squid when the installer closes." +LangString run_squid 2052 "安装完成后启动 Squid。" +LangString read_me 1033 "Open the Windows notes." +LangString read_me 2052 "打开 Windows 使用说明。" +LangString close_squid 1033 "${APP_NAME} is running and must close before it can be updated.$\r$\n$\r$\nClick OK to close it now, or Cancel to keep things as they are." +LangString close_squid 2052 "${APP_NAME} 正在运行,需要先退出才能更新。$\r$\n$\r$\n点击“确定”立即退出,点击“取消”保持现状。" +LangString webview_missing 1033 "${APP_NAME} uses Microsoft Edge WebView2, which this installer did not find.$\r$\n$\r$\nIf Squid opens a blank window, install the WebView2 Evergreen Runtime from Microsoft and launch Squid again.$\r$\n$\r$\nhttps://developer.microsoft.com/microsoft-edge/webview2/" +LangString webview_missing 2052 "${APP_NAME} 的界面依赖 Microsoft Edge WebView2,安装程序没有检测到它。$\r$\n$\r$\n如果 Squid 启动后窗口空白,请从微软官网安装 WebView2 Evergreen Runtime,然后重新启动 Squid。$\r$\n$\r$\nhttps://developer.microsoft.com/microsoft-edge/webview2/" + +Var ReadmePath + +Function .onInit + SetShellVarContext current + ${IfNot} ${AtLeastWin10} + MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} needs Windows 10 or later." + Abort + ${EndIf} + + ${IfNot} ${IsNativeAMD64} + ${IfNot} ${IsNativeARM64} + MessageBox MB_OK|MB_ICONSTOP "This package requires 64-bit Windows (x64 or ARM64)." + Abort + ${EndIf} + ${EndIf} + + ${If} ${FileExists} "$INSTDIR\squid-desktop.exe" + FindWindow $0 "" "${APP_NAME}" + ${If} $0 != 0 + ${IfNot} ${Silent} + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(close_squid)" IDOK +2 + Abort + ${EndIf} + ${EndIf} + ${EndIf} + + nsExec::Exec 'taskkill /IM squid-desktop.exe /F' + Pop $0 +FunctionEnd + +Function un.onInit + SetShellVarContext current + nsExec::Exec 'taskkill /IM squid-desktop.exe /F' + Pop $0 +FunctionEnd + +Section "Install" + SetOutPath "$INSTDIR" + File "${SQUID_EXE}" +!ifdef LICENSE_FILE + File /oname=LICENSE.txt "${LICENSE_FILE}" +!endif +!ifdef README_FILE + File /oname=README-Windows.txt "${README_FILE}" +!endif + + WriteUninstaller "$INSTDIR\Uninstall.exe" + StrCpy $ReadmePath "$INSTDIR\README-Windows.txt" + + WriteRegStr HKCU "Software\${APP_NAME}" "InstallDirectory" "$INSTDIR" + + CreateDirectory "$SMPROGRAMS\${APP_NAME}" + CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\squid-desktop.exe" + CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\squid-desktop.exe" + + WriteRegStr HKCU "${UNINSTALL_KEY}" "DisplayName" "${APP_NAME}" + WriteRegStr HKCU "${UNINSTALL_KEY}" "DisplayVersion" "${APP_VERSION}" + WriteRegStr HKCU "${UNINSTALL_KEY}" "Publisher" "${PUBLISHER}" + WriteRegStr HKCU "${UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\squid-desktop.exe" + WriteRegStr HKCU "${UNINSTALL_KEY}" "InstallLocation" "$INSTDIR" + WriteRegStr HKCU "${UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\Uninstall.exe"' + WriteRegStr HKCU "${UNINSTALL_KEY}" "QuietUninstallString" '"$INSTDIR\Uninstall.exe" /S' + WriteRegDWORD HKCU "${UNINSTALL_KEY}" "NoModify" 1 + WriteRegDWORD HKCU "${UNINSTALL_KEY}" "NoRepair" 1 + WriteRegDWORD HKCU "${UNINSTALL_KEY}" "EstimatedSize" ${EST_SIZE_KB} +SectionEnd + +Section "PostInstall" + ClearErrors + ReadRegStr $0 HKLM "${WEBVIEW_KEY}" "pv" + ${If} $0 == "" + ReadRegStr $0 HKCU "${WEBVIEW_KEY}" "pv" + ${EndIf} + ${If} $0 == "" + MessageBox MB_OK|MB_ICONINFORMATION "$(webview_missing)" + ${EndIf} +SectionEnd + +Function show_readme + ${If} ${FileExists} "$ReadmePath" + Exec 'notepad.exe "$ReadmePath"' + ${EndIf} +FunctionEnd + +Section "Uninstall" + nsExec::Exec 'taskkill /IM squid-desktop.exe /F' + Pop $0 + + Delete "$INSTDIR\squid-desktop.exe" + Delete "$INSTDIR\LICENSE.txt" + Delete "$INSTDIR\README-Windows.txt" + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR" + + Delete "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" + Delete "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" + RMDir "$SMPROGRAMS\${APP_NAME}" + Delete "$DESKTOP\${APP_NAME}.lnk" + + DeleteRegKey HKCU "${UNINSTALL_KEY}" + DeleteRegValue HKCU "Software\${APP_NAME}" "InstallDirectory" + DeleteRegKey /ifempty HKCU "Software\${APP_NAME}" +SectionEnd diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock new file mode 100644 index 0000000..41ec268 --- /dev/null +++ b/src-tauri/Cargo.lock @@ -0,0 +1,5586 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" + +[[package]] +name = "alloc-stdlib" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0876700b0d007ad25d5508865a4259c3af9af6d296bf663a0d586d0bc3369f6f" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", +] + +[[package]] +name = "async-recursion" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64" +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.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "brotli" +version = "9.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "627b7cfb0578f0eafce087a90fcd40add1231900b69e4d4de2d456260a4f5d81" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34c6783f42c21c952ad7112b354f0ba2f10760e9decea5b1b60523d6e270faaf" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr", + "serde_core", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.13.2", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbad30e4b4c14a39e3cc8aed085a12a327257c316619c93581e017bc52be591" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "cargo_toml" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f4b26e751e711a5302649417f2da046dce6391b2ea30a4820f37462314f0b9" +dependencies = [ + "semver", + "serde", + "toml 1.1.8+spec-1.1.0", +] + +[[package]] +name = "cc" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "375989decec1a0fa424442bed520fa12ede43a48475ce8c7417d2c69b32b5f6b" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a347dcabdae9c31b0825fd6a8bed285ec9c2acb89c47827126d52fa4f59cece3" +dependencies = [ + "fnv", + "uuid", + "web-time", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "combine" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + +[[package]] +name = "cookie" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.13.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.13.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f97d3416d5337d15c4b0d78c8c91df922ca143f57ec20e2d1c188333047ef04" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "cssparser" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" +dependencies = [ + "quote", + "syn 3.0.9", +] + +[[package]] +name = "ctor" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" + +[[package]] +name = "curve25519-dalek" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5eed333089e2e1c1ac8c6c0398e5e2497b4c9926ca6d0365ed1e099afa5bc23" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.1", + "curve25519-dalek-derive", + "digest 0.11.3", + "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 = "darling" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 3.0.9", +] + +[[package]] +name = "darling_macro" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" +dependencies = [ + "darling_core", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "dbus" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e" +dependencies = [ + "libc", + "libdbus-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "defmt" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366" +dependencies = [ + "defmt-parser", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "defmt-parser" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0" +dependencies = [ + "thiserror 2.0.21", +] + +[[package]] +name = "der" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a996a108feb8b427a6e12fcf6af4aa83409b79d72c15337d7741368131ee004" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", +] + +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "crypto-common 0.2.2", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.13.2", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dom_query" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fac5fca71e65e94cc718a6e2af65d6e0f9c6027751c2aa562fbb5087fda639bc" +dependencies = [ + "bit-set", + "cssparser", + "foldhash", + "html5ever", + "precomputed-hash", + "selectors", + "tendril", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ed25519" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29fcf32e6c73d1079f83ab4d782de2d81620346a5f38c6237a86a22f8368980a" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ebaa1a2bf1290ab3bfe5a7b771d050ebffab2711c19a81691c683a5144a25de" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2 0.11.1", + "signature", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" + +[[package]] +name = "embed-resource" +version = "3.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 1.1.8+spec-1.1.0", + "vswhom", + "winreg 0.56.0", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "erased-serde" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e59b668157f32d3459d4bd634861a06ffa2503a461ca5f0916b9f0252605e66" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "event-listener" +version = "5.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" +dependencies = [ + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "fiat-crypto" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + +[[package]] +name = "flate2" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" +dependencies = [ + "crc32fast", + "miniz_oxide 0.9.1", + "zlib-rs", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.13.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "globset" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98b0d85522dc0a824cfebbc9594ff4a9b289c568bea0370319dfbdf20ccdd2d" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8" +dependencies = [ + "log", + "markup5ever", +] + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hybrid-array" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17" +dependencies = [ + "typenum", +] + +[[package]] +name = "hyper" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c" +dependencies = [ + "atomic-waker", + "bytes", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" +dependencies = [ + "base64 0.23.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75e94d66081e4d8dcd098bd8dc5254800fea14a26389b298410158d834de167" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "icu_collections" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" + +[[package]] +name = "icu_properties" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" + +[[package]] +name = "icu_provider" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" +dependencies = [ + "bytemuck", + "byteorder-lite", + "moxcms", + "num-traits", + "png", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4200d433cbd5178df7797c9c2e75b348b728e39631cf14520d1e2fc424201f4" +dependencies = [ + "cfb", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jiff" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ac703058abac89e5c39b0b879dce2b6b14a4ba36600c7e7e3d0c60a6883ef3c" +dependencies = [ + "defmt", + "jiff-core", + "jiff-static", + "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link", +] + +[[package]] +name = "jiff-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee43309eb53bafb8c36d35d6e444769c8f8e6206a9fbf7546f5db9d7d4a0e93" +dependencies = [ + "defmt", + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dc32470c67eb7d0e9ccb74303fa925313dc04cecb1aa048beaa6f391e36a93d" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8377070c6bae868759445e5a77f66d84f0b72f3a054bfb00e6d038b8282da7" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "js-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "jsonptr" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" +dependencies = [ + "bitflags 2.13.2", + "serde", +] + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libdbus-sys" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "markup5ever" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de" +dependencies = [ + "log", + "tendril", + "web_atoms", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "moxcms" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] +name = "muda" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca139e57da4383727f189e43e66e84fa372347027fc996f9f1a007ec0a37996" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.13.2", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-location" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.13.2", + "block2", + "libc", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image", + "objc2-core-location", + "objc2-core-text", + "objc2-foundation", + "objc2-quartz-core", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "open" +version = "5.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" +dependencies = [ + "dunce", + "is-wsl", + "libc", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkcs8" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "plist" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327a4cb2ad49dc48adfdc9da89e22c64d488b508c67a044d71ba729e4521a285" +dependencies = [ + "base64 0.23.1", + "indexmap 2.14.2", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags 2.13.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.17+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + +[[package]] +name = "quick-xml" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "redox_users" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" +dependencies = [ + "libredox", + "thiserror 2.0.21", +] + +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" +dependencies = [ + "base64 0.23.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "rfd" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220" +dependencies = [ + "block2", + "dispatch2", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "libc", + "log", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "percent-encoding", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" +dependencies = [ + "bitflags 2.13.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.119", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adfa1c298912827b8a28b223b3b874357397ae706e6190acd9bf28cee99114d" +dependencies = [ + "bitflags 2.13.2", + "cssparser", + "derive_more", + "log", + "new_debug_unreachable", + "phf", + "phf_codegen", + "precomputed-hash", + "rustc-hash", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_with" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f" +dependencies = [ + "base64 0.23.1", + "bs58", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.14.2", + "jiff", + "schemars 0.9.0", + "schemars 1.2.3", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.1", + "digest 0.11.3", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "siphasher" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "spki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef958a98b9d5da290cfc78946e9f3e61e1e62a18db0d92cac0b83cc161491a9" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "squid-core" +version = "0.1.3" +dependencies = [ + "anyhow", + "chrono", + "crossbeam-channel", + "dirs 6.0.0", + "globset", + "libc", + "rayon", + "serde", + "serde_json", + "thiserror 2.0.21", + "toml 0.8.2", + "walkdir", + "windows 0.58.0", +] + +[[package]] +name = "squid-desktop" +version = "0.1.3" +dependencies = [ + "base64 0.22.1", + "chrono", + "ed25519-dalek", + "globset", + "hex", + "serde", + "serde_json", + "sha2 0.10.9", + "squid-core", + "squid-engine", + "squid-platform", + "squid-stats", + "tauri", + "tauri-build", + "tauri-plugin-dialog", + "tauri-plugin-opener", + "tauri-plugin-single-instance", + "uuid", +] + +[[package]] +name = "squid-engine" +version = "0.1.3" +dependencies = [ + "anyhow", + "chrono", + "crossbeam-channel", + "dirs 6.0.0", + "globset", + "libc", + "rayon", + "serde", + "serde_json", + "squid-core", + "squid-platform", + "squid-rules", + "squid-stats", + "walkdir", +] + +[[package]] +name = "squid-platform" +version = "0.1.3" +dependencies = [ + "dirs 6.0.0", + "libc", + "plist", + "rayon", + "serde", + "squid-core", + "sysinfo", + "unicode-width", + "walkdir", + "windows-sys 0.59.0", + "winreg 0.52.0", +] + +[[package]] +name = "squid-rules" +version = "0.1.3" +dependencies = [ + "globset", + "serde", + "serde_json", + "squid-core", + "squid-platform", + "toml 0.8.2", +] + +[[package]] +name = "squid-stats" +version = "0.1.3" +dependencies = [ + "chrono", + "libc", + "serde", + "squid-core", + "squid-platform", + "sysinfo", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_vcruntime" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7" + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "swift-rs" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "sysinfo" +version = "0.34.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b93974b3d3aeaa036504b8eefd4c039dced109171c1ae973f1dc63b2c7e4b2" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "windows 0.57.0", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5777b06fe6435126ae8d816eba269e050e1e10d302cf5461e9c49eccabc3548" +dependencies = [ + "bitflags 2.13.2", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dbus", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows 0.62.2", + "windows-core 0.62.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7eeb6d99155545da6150a1795945f16ac9c178deb2a5f2e74d776107bd5849" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb0244332cfb9cee7e2a568bf5da29a36ed8fdbd717f6f47a66b6b7b358c072" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs 7.0.0", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "image", + "jni", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.21", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows 0.62.2", +] + +[[package]] +name = "tauri-build" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adddb0e648752aaac5da9c3c3c6a68e1e87cab55e3b757b18a9441ef8c3ac614" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs 7.0.0", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "static_vcruntime", + "strsim", + "tauri-utils", + "tauri-winres", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37631cf71dab5e8ab55e1bdd701e18a52653d90b78e71d0e5598b1e0a61316" +dependencies = [ + "base64 0.23.1", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2 0.10.9", + "syn 2.0.119", + "tauri-utils", + "thiserror 2.0.21", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc38db58854c10fb5f91a887ed8bf82d3239bb92b5d8db86eda09e96d9963d1" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fb21a77e8f94e8beb3325e583102488659365af0a3948b7ea244c5b779c291" +dependencies = [ + "anyhow", + "glob", + "plist", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri-utils", + "walkdir", +] + +[[package]] +name = "tauri-plugin-dialog" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce0fb9c2b6d34a9720627ed930ebc8af26f61e648695aecaeb03d5c33c5896f5" +dependencies = [ + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror 2.0.21", + "url", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b" +dependencies = [ + "anyhow", + "dunce", + "glob", + "log", + "objc2-foundation", + "percent-encoding", + "schemars 0.8.22", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "tauri-utils", + "thiserror 2.0.21", + "toml 1.1.8+spec-1.1.0", + "url", +] + +[[package]] +name = "tauri-plugin-opener" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53810be1b4fed22bb6ac3f4cab5a2b80d9391d1af436bda145607532bc0bb219" +dependencies = [ + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation", + "open", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.21", + "url", + "windows 0.62.2", + "zbus", +] + +[[package]] +name = "tauri-plugin-single-instance" +version = "2.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726b6da0dd5bd1344f84f4108a622c07d01923baacb5c803a605189672c5352f" +dependencies = [ + "serde", + "serde_json", + "tauri", + "thiserror 2.0.21", + "tokio", + "tracing", + "windows-sys 0.61.2", + "zbus", +] + +[[package]] +name = "tauri-runtime" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.21", + "url", + "webkit2gtk", + "webview2-com", + "windows 0.62.2", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f" +dependencies = [ + "gtk", + "http", + "jni", + "log", + "objc2", + "objc2-app-kit", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows 0.62.2", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dom_query", + "dunce", + "glob", + "http", + "infer", + "json-patch", + "log", + "memchr", + "phf", + "plist", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.21", + "toml 1.1.8+spec-1.1.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52bb6904475a6ca662f15ef787f18ade61d5740a1ee12c45d3b748efdb6f796" +dependencies = [ + "dunce", + "embed-resource", + "toml 1.1.8+spec-1.1.0", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "tendril" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08" +dependencies = [ + "new_debug_unreachable", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl 2.0.21", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "time" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + +[[package]] +name = "tokio" +version = "1.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-util" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml" +version = "1.1.8+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" +dependencies = [ + "indexmap 2.14.2", + "serde_core", + "serde_spanned 1.1.2", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.14.2", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "toml_writer" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.2", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tray-icon" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72" +dependencies = [ + "crossbeam-channel", + "dirs 7.0.0", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-width" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlpattern" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b" +dependencies = [ + "icu_properties", + "regex", + "serde", + "url", +] + +[[package]] +name = "utf8_iter" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" +dependencies = [ + "utf_types", +] + +[[package]] +name = "utf_types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" + +[[package]] +name = "uuid" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" +dependencies = [ + "cfg-if", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501" +dependencies = [ + "js-sys", + "tokio", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.9", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f89fca7a704cee10dcb3654c1dbb8941d1783132f1917358af75bec37a7d7e6" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.62.2", + "windows-core 0.62.2", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "webview2-com-sys" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb" +dependencies = [ + "thiserror 2.0.21", + "windows 0.62.2", + "windows-core 0.62.2", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111e51caca442cafd9bab396628ac4d814880eaea4e63dfd76a12e9f342b5580" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "windows-sys 0.61.2", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core 0.62.2", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core 0.62.2", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core 0.62.2", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core 0.62.2", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "winreg" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" +dependencies = [ + "cfg-if", + "windows-sys 0.61.2", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "wry" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c50ddad0ef9913bb5496cb9d509a50433a3b78cb0238d61105526589cf0e9" +dependencies = [ + "base64 0.23.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs 7.0.0", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "gtk", + "http", + "javascriptcore-rs", + "jni", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "raw-window-handle", + "sha2 0.10.9", + "soup3", + "tao-macros", + "thiserror 2.0.21", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.62.2", + "windows-core 0.62.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.4", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 3.0.9", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" +dependencies = [ + "serde", + "winnow 1.0.4", + "zvariant", +] + +[[package]] +name = "zcheapstr" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939f186d9ecebe044315a5cb6d6f78568bbc21152adc954d5a0c2f58bdbc9920" +dependencies = [ + "serde", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879" + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zvariant" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow 1.0.4", + "zcheapstr", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 3.0.9", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 3.0.9", + "winnow 1.0.4", +] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml new file mode 100644 index 0000000..fa45f30 --- /dev/null +++ b/src-tauri/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "squid-desktop" +version = "0.1.3" +description = "Squid — a CleanMyMac-inspired cleaner, uninstaller and system monitor." +authors = ["squid contributors"] +edition = "2021" +rust-version = "1.80" +license = "GPL-3.0-only" +default-run = "squid-desktop" + +[lib] +name = "squid_desktop_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[[bin]] +name = "squid-desktop" +path = "src/main.rs" + +[build-dependencies] +tauri-build = { version = "2", features = [] } + +[dependencies] +squid-core = { path = "../crates/squid-core" } +squid-engine = { path = "../crates/squid-engine" } +squid-platform = { path = "../crates/squid-platform" } +squid-stats = { path = "../crates/squid-stats" } +tauri = { version = "2.11", features = ["tray-icon", "image-png", "macos-private-api"] } +tauri-plugin-dialog = "2" +tauri-plugin-opener = "2" +tauri-plugin-single-instance = "2" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +chrono = { version = "0.4", features = ["clock"] } +uuid = { version = "1", features = ["v4"] } +base64 = "0.22" +sha2 = "0.10" +hex = "0.4" +ed25519-dalek = { version = "3.0.0", default-features = false, features = ["alloc", "fast"] } +globset = "0.4" + +[profile.dev] +debug = 1 + +[profile.dev.package."*"] +debug = false diff --git a/src-tauri/Info.plist b/src-tauri/Info.plist new file mode 100644 index 0000000..91bef57 --- /dev/null +++ b/src-tauri/Info.plist @@ -0,0 +1,18 @@ + + + + + NSDocumentsFolderUsageDescription + Squid analyzes the folder you choose and removes only the items you approve. + NSDownloadsFolderUsageDescription + Squid analyzes your Downloads folder only when you choose it. + NSDesktopFolderUsageDescription + Squid analyzes your Desktop folder only when you choose it. + NSPicturesFolderUsageDescription + Squid measures picture folder sizes only when you choose that folder. + NSRemovableVolumesUsageDescription + Squid can analyze removable volumes you select. + NSNetworkVolumesUsageDescription + Squid can analyze network volumes you select. + + diff --git a/src-tauri/build.rs b/src-tauri/build.rs new file mode 100644 index 0000000..f6bd454 --- /dev/null +++ b/src-tauri/build.rs @@ -0,0 +1,94 @@ +//! Build-time wiring for the git-backed update channel. +//! +//! The feed lives in this repository's `releases` branch. The manifest URL is +//! derived from the `origin` remote, matching the mechanism used by nex_shift. +//! `SQUID_UPDATE_URL` and `SQUID_UPDATE_PUBKEY` are the two explicit overrides. + +use std::{path::Path, process::Command}; + +const RELEASE_BRANCH: &str = "releases"; +const MANIFEST: &str = "squid-update.json"; +const PUBKEY_ENV: &str = "SQUID_UPDATE_PUBKEY"; + +fn git(args: &[&str]) -> Option { + let output = Command::new("git") + .args(args) + .current_dir(Path::new(env!("CARGO_MANIFEST_DIR")).parent()?) + .output() + .ok()?; + if !output.status.success() { + return None; + } + let text = String::from_utf8(output.stdout).ok()?; + let text = text.trim().to_string(); + (!text.is_empty()).then_some(text) +} + +fn parse_remote(url: &str) -> Option<(String, String)> { + let url = url.trim().trim_end_matches('/').trim_end_matches(".git"); + let (host, path) = if let Some(rest) = url.strip_prefix("ssh://") { + rest.split_once('/')? + } else if let Some(rest) = url.find("://").map(|index| &url[index + 3..]) { + rest.split_once('/')? + } else if let Some((host, path)) = url.split_once(':') { + (host.strip_prefix("git@")?, path) + } else { + return None; + }; + (!host.is_empty() && !path.is_empty()).then(|| (format!("https://{host}"), path.to_string())) +} + +fn raw_directory(host: &str, path: &str) -> String { + let domain = host.replace("https://", ""); + let segment = if domain.ends_with("github.com") { + format!("raw/{RELEASE_BRANCH}") + } else if domain.contains("gitlab") { + format!("-/raw/{RELEASE_BRANCH}") + } else { + format!("raw/branch/{RELEASE_BRANCH}") + }; + format!("{host}/{path}/{segment}") +} + +fn manifest_url() -> Option { + if let Ok(url) = std::env::var("SQUID_UPDATE_URL") { + if !url.trim().is_empty() { + return Some(url.trim().to_string()); + } + } + let (host, path) = parse_remote(&git(&["remote", "get-url", "origin"])?)?; + Some(format!("{}/{}", raw_directory(&host, &path), MANIFEST)) +} + +fn public_key() -> Result { + let raw = match std::env::var(PUBKEY_ENV) { + Ok(value) => value, + Err(_) => return Ok(String::new()), + }; + let value: String = raw + .trim() + .chars() + .filter(|character| !character.is_whitespace() && *character != ':') + .collect::() + .to_ascii_lowercase(); + if value.len() != 64 || !value.chars().all(|c| c.is_ascii_hexdigit()) { + return Err(format!("{PUBKEY_ENV} must be 64 hex characters (32 bytes)")); + } + Ok(value) +} + +fn main() { + println!("cargo:rerun-if-changed=../dist"); + println!("cargo:rerun-if-env-changed=SQUID_UPDATE_URL"); + println!("cargo:rerun-if-env-changed={PUBKEY_ENV}"); + println!("cargo:rerun-if-changed=../.git/config"); + println!( + "cargo:rustc-env=SQUID_UPDATE_URL={}", + manifest_url().unwrap_or_default() + ); + match public_key() { + Ok(key) => println!("cargo:rustc-env=SQUID_UPDATE_PUBKEY={key}"), + Err(error) => panic!("{error}"), + } + tauri_build::build() +} diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json new file mode 100644 index 0000000..7b03bb0 --- /dev/null +++ b/src-tauri/capabilities/default.json @@ -0,0 +1,12 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Default permissions for the Squid main window.", + "windows": ["main"], + "permissions": [ + "core:default", + "core:window:allow-start-dragging", + "dialog:default", + "opener:default" + ] +} diff --git a/src-tauri/icon.svg b/src-tauri/icon.svg new file mode 100644 index 0000000..c28f051 --- /dev/null +++ b/src-tauri/icon.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png new file mode 100644 index 0000000..2cd63d8 Binary files /dev/null and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..dc34759 Binary files /dev/null and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png new file mode 100644 index 0000000..50d017d Binary files /dev/null and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/64x64.png b/src-tauri/icons/64x64.png new file mode 100644 index 0000000..d51268a Binary files /dev/null and b/src-tauri/icons/64x64.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..6f04e5a Binary files /dev/null and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..6182438 Binary files /dev/null and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..dc15a26 Binary files /dev/null and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..123238a Binary files /dev/null and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..ccad109 Binary files /dev/null and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..e753c33 Binary files /dev/null and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..7753114 Binary files /dev/null and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..2e73017 Binary files /dev/null and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..15b5d95 Binary files /dev/null and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..177476e Binary files /dev/null and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..2ffbf24 --- /dev/null +++ b/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..0a877c1 Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..39bf0b2 Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..e3ae30e Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..de4c00e Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..1c5352f Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..84e67ff Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..1e980b7 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a0a602b Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..24eafa6 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..8463ae6 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..ef978ff Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..8c9edf8 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..cbb11f3 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..ff4dab8 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e0506cd Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/values/ic_launcher_background.xml b/src-tauri/icons/android/values/ic_launcher_background.xml new file mode 100644 index 0000000..16cdd5a --- /dev/null +++ b/src-tauri/icons/android/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns new file mode 100644 index 0000000..60adc18 Binary files /dev/null and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico new file mode 100644 index 0000000..57dbcce Binary files /dev/null and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png new file mode 100644 index 0000000..71af131 Binary files /dev/null and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@1x.png b/src-tauri/icons/ios/AppIcon-20x20@1x.png new file mode 100644 index 0000000..5e2e2be Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/src-tauri/icons/ios/AppIcon-20x20@2x-1.png new file mode 100644 index 0000000..96f11ac Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@2x.png b/src-tauri/icons/ios/AppIcon-20x20@2x.png new file mode 100644 index 0000000..96f11ac Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@3x.png b/src-tauri/icons/ios/AppIcon-20x20@3x.png new file mode 100644 index 0000000..a39d755 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@1x.png b/src-tauri/icons/ios/AppIcon-29x29@1x.png new file mode 100644 index 0000000..38bb411 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/src-tauri/icons/ios/AppIcon-29x29@2x-1.png new file mode 100644 index 0000000..92942d5 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@2x.png b/src-tauri/icons/ios/AppIcon-29x29@2x.png new file mode 100644 index 0000000..92942d5 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@3x.png b/src-tauri/icons/ios/AppIcon-29x29@3x.png new file mode 100644 index 0000000..86e699f Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@1x.png b/src-tauri/icons/ios/AppIcon-40x40@1x.png new file mode 100644 index 0000000..96f11ac Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/src-tauri/icons/ios/AppIcon-40x40@2x-1.png new file mode 100644 index 0000000..48ff97e Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@2x.png b/src-tauri/icons/ios/AppIcon-40x40@2x.png new file mode 100644 index 0000000..48ff97e Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@3x.png b/src-tauri/icons/ios/AppIcon-40x40@3x.png new file mode 100644 index 0000000..cb22dac Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-512@2x.png b/src-tauri/icons/ios/AppIcon-512@2x.png new file mode 100644 index 0000000..bab48ef Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-512@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-60x60@2x.png b/src-tauri/icons/ios/AppIcon-60x60@2x.png new file mode 100644 index 0000000..cb22dac Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-60x60@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-60x60@3x.png b/src-tauri/icons/ios/AppIcon-60x60@3x.png new file mode 100644 index 0000000..89ffdb5 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-60x60@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-76x76@1x.png b/src-tauri/icons/ios/AppIcon-76x76@1x.png new file mode 100644 index 0000000..6b552cc Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-76x76@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-76x76@2x.png b/src-tauri/icons/ios/AppIcon-76x76@2x.png new file mode 100644 index 0000000..678f413 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-76x76@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png new file mode 100644 index 0000000..0221cc7 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png differ diff --git a/src-tauri/src/app.rs b/src-tauri/src/app.rs new file mode 100644 index 0000000..1aa2f12 --- /dev/null +++ b/src-tauri/src/app.rs @@ -0,0 +1,989 @@ +//! Tauri command surface for the desktop application. +//! +//! The UI never invents a deletion target. Scans are held in this process and +//! a delete command can only select indices from the scan that produced them. +//! The engine still re-validates every path against the same safety policy and +//! whitelist used by the CLI and TUI. + +use squid_core::ledger::{self, Session}; +use squid_core::paths; +use squid_core::progress::{CancelToken, Event, Progress}; +use squid_core::{ + AppInfo, Bytes, Category, CleanupItem, DeleteMode, ItemKind, LockReason, ScanReport, Settings, + UninstallPlan, +}; +use squid_engine::analyze::{self, FileEntry, Node}; +use squid_engine::delete::{self, DeleteJob, DeleteOutcome}; +use squid_engine::{clean, purge, uninstall, Engine}; +use squid_platform::PlatformId; +use squid_stats::{ProcessSample, Sampler, SystemSnapshot}; +use std::collections::{HashMap, HashSet}; +use std::path::PathBuf; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::{Arc, Mutex, MutexGuard}; +use std::thread::{self, JoinHandle}; +use std::time::{Duration, Instant}; +use tauri::{AppHandle, Emitter, Manager}; + +#[derive(Default)] +pub struct AppState { + jobs: Mutex>, + scans: Mutex>, + plans: Mutex>, + apps: Mutex>, + sampler: Mutex, +} + +impl AppState { + fn lock(value: &Mutex) -> Result, String> { + value + .lock() + .map_err(|_| "The application state is unavailable; restart Squid.".to_string()) + } + + fn begin(&self, job_id: &str) -> Result { + if job_id.trim().is_empty() { + return Err("A job identifier is required.".into()); + } + let token = CancelToken::new(); + let mut jobs = Self::lock(&self.jobs)?; + jobs.insert(job_id.to_string(), token.clone()); + Ok(token) + } + + fn finish(&self, job_id: &str) { + if let Ok(mut jobs) = self.jobs.lock() { + jobs.remove(job_id); + } + } +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +struct ProgressView { + job_id: String, + kind: String, + event: String, + phase: Option, + detail: Option, + done: Option, + total: Option, + subject: Option, + freed: Option, +} + +struct ProgressReporter { + stop: Arc, + handle: Option>, +} + +impl ProgressReporter { + fn start(app: AppHandle, job_id: String, kind: &'static str, progress: Progress) -> Self { + let stop = Arc::new(AtomicBool::new(false)); + let stopped = stop.clone(); + let handle = thread::spawn(move || { + while !stopped.load(Ordering::Relaxed) { + if let Some(event) = progress.recv(Duration::from_millis(80)) { + emit_progress(&app, &job_id, kind, event); + } + } + for event in progress.drain() { + emit_progress(&app, &job_id, kind, event); + } + }); + Self { + stop, + handle: Some(handle), + } + } + + fn finish(mut self) { + self.stop.store(true, Ordering::Relaxed); + if let Some(handle) = self.handle.take() { + let _ = handle.join(); + } + } +} + +impl Drop for ProgressReporter { + fn drop(&mut self) { + self.stop.store(true, Ordering::Relaxed); + if let Some(handle) = self.handle.take() { + let _ = handle.join(); + } + } +} + +fn emit_progress(app: &AppHandle, job_id: &str, kind: &str, event: Event) { + let payload = match event { + Event::Phase { phase, detail } => ProgressView { + job_id: job_id.into(), + kind: kind.into(), + event: "phase".into(), + phase: Some(phase.into()), + detail: Some(detail), + done: None, + total: None, + subject: None, + freed: None, + }, + Event::Tick { + done, + total, + subject, + } => ProgressView { + job_id: job_id.into(), + kind: kind.into(), + event: "tick".into(), + phase: None, + detail: None, + done: Some(done), + total, + subject: subject.map(|path| paths::pretty(&path)), + freed: None, + }, + Event::Note(note) => ProgressView { + job_id: job_id.into(), + kind: kind.into(), + event: "note".into(), + phase: None, + detail: Some(note), + done: None, + total: None, + subject: None, + freed: None, + }, + Event::Warning(warning) => ProgressView { + job_id: job_id.into(), + kind: kind.into(), + event: "warning".into(), + phase: None, + detail: Some(warning), + done: None, + total: None, + subject: None, + freed: None, + }, + Event::Deleted { path, freed } => ProgressView { + job_id: job_id.into(), + kind: kind.into(), + event: "deleted".into(), + phase: None, + detail: Some(paths::pretty(&path)), + done: None, + total: None, + subject: None, + freed: Some(freed.as_u64()), + }, + Event::Bucket { + category, + total, + count, + } => ProgressView { + job_id: job_id.into(), + kind: kind.into(), + event: "bucket".into(), + phase: None, + detail: Some(format!("{}:{}:{}", category.id(), count, total.as_u64())), + done: None, + total: None, + subject: None, + freed: None, + }, + Event::Done(_) => return, + }; + let _ = app.emit("squid://progress", payload); +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CleanupItemView { + path: String, + display_path: String, + kind: ItemKind, + size: u64, + allocated: u64, + on_disk: u64, + category: Category, + label: String, + rule_id: String, + selected: bool, + lock: Option, + note: Option, +} + +impl From<&CleanupItem> for CleanupItemView { + fn from(item: &CleanupItem) -> Self { + Self { + path: item.path.to_string_lossy().to_string(), + display_path: item.display_path(), + kind: item.kind, + size: item.size.as_u64(), + allocated: item.allocated.as_u64(), + on_disk: item.on_disk().as_u64(), + category: item.category, + label: item.label.clone(), + rule_id: item.rule_id.clone(), + selected: item.selected, + lock: item.lock, + note: item.note.clone(), + } + } +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ScanView { + scan_id: String, + items: Vec, + total: u64, + total_selected: u64, + selected_count: usize, + unreadable: u32, + elapsed_ms: u64, +} + +fn scan_view(scan_id: String, report: &ScanReport, elapsed_ms: u64) -> ScanView { + let selected_total = report + .items + .iter() + .filter(|item| item.selected && item.lock.is_none()) + .map(|item| item.on_disk().as_u64()) + .sum(); + ScanView { + scan_id, + items: report.items.iter().map(CleanupItemView::from).collect(), + total: report.total_all().as_u64(), + total_selected: selected_total, + selected_count: report + .items + .iter() + .filter(|item| item.selected && item.lock.is_none()) + .count(), + unreadable: report.unreadable, + elapsed_ms, + } +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct SkippedView { + path: String, + reason: String, +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DeleteResultView { + freed: u64, + freed_allocated: u64, + removed: usize, + failed: usize, + errors: Vec, + mode: Option, + session_id: Option, + skipped: Vec, +} + +impl DeleteResultView { + fn from_outcome(outcome: DeleteOutcome) -> Self { + Self { + freed: outcome.summary.freed.as_u64(), + freed_allocated: outcome.summary.freed_allocated.as_u64(), + removed: outcome.summary.removed, + failed: outcome.summary.failed, + errors: outcome.summary.errors, + mode: outcome.summary.mode, + session_id: outcome.summary.session_id, + skipped: outcome + .skipped + .into_iter() + .map(|(path, reason)| SkippedView { + path: paths::pretty(&path), + reason, + }) + .collect(), + } + } +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct SettingsView { + delete_mode: DeleteMode, + whitelist: Vec, + purge_roots: Vec, + purge_min_age_days: u64, + show_allocated: bool, + language: Option, + history_keep: usize, + setup_reviewed: bool, + errors: Vec, +} + +impl SettingsView { + fn from_settings(settings: &Settings, errors: Vec) -> Self { + Self { + delete_mode: settings.delete_mode, + whitelist: settings.whitelist.clone(), + purge_roots: settings.purge_roots.clone(), + purge_min_age_days: settings.purge_min_age_days, + show_allocated: settings.show_allocated, + language: settings.language.clone(), + history_keep: settings.history_keep, + setup_reviewed: settings.desktop_setup_reviewed, + errors, + } + } +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct BootstrapView { + version: String, + platform: String, + os_name: String, + os_version: String, + hardware: String, + arch: String, + device: String, + language: String, + bin_noun: String, + config_path: String, + history_path: String, + update_feed_url: String, + update_check_enabled: bool, + settings: SettingsView, +} + +#[tauri::command] +pub fn bootstrap() -> BootstrapView { + let (settings, errors) = Settings::load(); + let engine = Engine::new(); + let locale = squid_core::Locale::detect(&settings); + let prefs = crate::update::load_prefs(); + BootstrapView { + version: env!("CARGO_PKG_VERSION").into(), + platform: PlatformId::current().as_str().into(), + os_name: engine.platform().display_name(), + os_version: engine.platform().os_version(), + hardware: engine.platform().hardware_model(), + arch: std::env::consts::ARCH.into(), + device: match engine.platform().device() { + squid_platform::Device::Mac => "mac".into(), + squid_platform::Device::Pc => "pc".into(), + squid_platform::Device::Machine => "machine".into(), + }, + language: locale.code().into(), + bin_noun: match engine.platform().bin_noun() { + squid_platform::BinNoun::Trash => "trash".into(), + squid_platform::BinNoun::RecycleBin => "recycle-bin".into(), + }, + config_path: Settings::path().to_string_lossy().to_string(), + history_path: ledger::history_dir().to_string_lossy().to_string(), + update_feed_url: crate::update::manifest_url(), + update_check_enabled: prefs.update_check_enabled, + settings: SettingsView::from_settings(&settings, errors), + } +} + +#[tauri::command] +pub fn cancel_job(app: AppHandle, job_id: String) -> bool { + let state = app.state::(); + let Ok(jobs) = AppState::lock(&state.jobs) else { + return false; + }; + let Some(token) = jobs.get(&job_id) else { + return false; + }; + token.cancel(); + true +} + +fn parse_categories(values: &[String]) -> Result, String> { + let mut categories = Vec::new(); + for value in values { + let category = + Category::parse(value).ok_or_else(|| format!("Unknown cleanup category: {value}"))?; + if !categories.contains(&category) { + categories.push(category); + } + } + Ok(categories) +} + +#[tauri::command] +pub async fn cleanup_scan( + app: AppHandle, + job_id: String, + categories: Vec, + min_age_days: Option, + orphans: bool, +) -> Result { + let token = app.state::().begin(&job_id)?; + let categories = parse_categories(&categories)?; + let progress = Progress::new(); + let reporter = + ProgressReporter::start(app.clone(), job_id.clone(), "cleanup", progress.clone()); + let started = Instant::now(); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + let options = clean::CleanOptions { + categories, + skip_admin_rules: true, + min_age_days, + orphans, + fast: false, + }; + let report = clean::scan(&engine, &options, &progress, &token)?; + clean::publish_buckets(&report, &progress); + Ok::(clean::sort_for_display(report)) + }) + .await + .map_err(|error| format!("Cleanup scan failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let report = task.map_err(|error| error.to_string())?; + let view = scan_view( + job_id.clone(), + &report, + started.elapsed().as_millis() as u64, + ); + app.state::() + .scans + .lock() + .map_err(|_| "The scan cache is unavailable.".to_string())? + .insert(job_id, report); + Ok(view) +} + +fn select_indices(report: &mut ScanReport, selected: &[usize]) -> Result<(), String> { + let selected: HashSet = selected.iter().copied().collect(); + if let Some(index) = selected.iter().find(|index| **index >= report.items.len()) { + return Err(format!("Selected item {index} is not in this scan.")); + } + for (index, item) in report.items.iter_mut().enumerate() { + item.selected = selected.contains(&index) && item.lock.is_none(); + } + Ok(()) +} + +#[tauri::command] +pub async fn cleanup_delete( + app: AppHandle, + job_id: String, + scan_id: String, + selected: Vec, + mode: DeleteMode, +) -> Result { + let token = app.state::().begin(&job_id)?; + let mut report = app + .state::() + .scans + .lock() + .map_err(|_| "The scan cache is unavailable.".to_string())? + .get(&scan_id) + .cloned() + .ok_or_else(|| "This scan has expired. Run it again.".to_string())?; + select_indices(&mut report, &selected)?; + let items = report.items; + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "delete", progress.clone()); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + let job = DeleteJob::new(items, mode, "Squid · Cleanup"); + delete::execute(&engine, &job, &progress, &token) + }) + .await + .map_err(|error| format!("Cleanup failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let outcome = task.map_err(|error| error.to_string())?; + if let Ok(mut scans) = app.state::().scans.lock() { + scans.remove(&scan_id); + } + Ok(DeleteResultView::from_outcome(outcome)) +} + +#[tauri::command] +pub async fn purge_scan( + app: AppHandle, + job_id: String, + roots: Vec, + min_age_days: Option, + force: bool, +) -> Result { + let token = app.state::().begin(&job_id)?; + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "purge", progress.clone()); + let started = Instant::now(); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + let options = purge::PurgeOptions { + roots: roots.into_iter().map(|root| paths::expand(&root)).collect(), + min_age_days, + force, + max_depth: None, + }; + let mut report = purge::scan(&engine, &options, &progress, &token)?; + report.items.sort_by(|a, b| { + b.on_disk() + .cmp(&a.on_disk()) + .then_with(|| a.path.cmp(&b.path)) + }); + Ok::(report) + }) + .await + .map_err(|error| format!("Deep clean scan failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let report = task.map_err(|error| error.to_string())?; + let view = scan_view( + job_id.clone(), + &report, + started.elapsed().as_millis() as u64, + ); + app.state::() + .scans + .lock() + .map_err(|_| "The scan cache is unavailable.".to_string())? + .insert(job_id, report); + Ok(view) +} + +#[tauri::command] +pub async fn purge_delete( + app: AppHandle, + job_id: String, + scan_id: String, + selected: Vec, + mode: DeleteMode, +) -> Result { + let token = app.state::().begin(&job_id)?; + let mut report = app + .state::() + .scans + .lock() + .map_err(|_| "The scan cache is unavailable.".to_string())? + .get(&scan_id) + .cloned() + .ok_or_else(|| "This scan has expired. Run it again.".to_string())?; + select_indices(&mut report, &selected)?; + let items = report.items; + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "delete", progress.clone()); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + let job = DeleteJob::new(items, mode, "Squid · Deep Clean"); + delete::execute(&engine, &job, &progress, &token) + }) + .await + .map_err(|error| format!("Deep clean failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let outcome = task.map_err(|error| error.to_string())?; + if let Ok(mut scans) = app.state::().scans.lock() { + scans.remove(&scan_id); + } + Ok(DeleteResultView::from_outcome(outcome)) +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct AppsView { + apps: Vec, + total: u64, +} + +#[tauri::command] +pub async fn apps_scan(app: AppHandle, job_id: String) -> Result { + let token = app.state::().begin(&job_id)?; + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "apps", progress.clone()); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + uninstall::scan_apps(&engine, true, &progress, &token) + }) + .await + .map_err(|error| format!("Application scan failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let apps = task.map_err(|error| error.to_string())?; + let total = apps.iter().map(|app| app.size.as_u64()).sum(); + if let Ok(mut cache) = app.state::().apps.lock() { + *cache = apps.clone(); + } + Ok(AppsView { apps, total }) +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct PlanView { + plan_id: String, + app: AppInfo, + items: Vec, + warnings: Vec, + total: u64, + selected_count: usize, + selected_total: u64, +} + +fn plan_view(plan_id: String, plan: &UninstallPlan) -> PlanView { + PlanView { + plan_id, + app: plan.app.clone(), + items: plan.items.iter().map(CleanupItemView::from).collect(), + warnings: plan.warnings.clone(), + total: plan.total().as_u64(), + selected_count: plan + .items + .iter() + .filter(|item| item.selected && item.lock.is_none()) + .count(), + selected_total: plan + .items + .iter() + .filter(|item| item.selected && item.lock.is_none()) + .map(|item| item.on_disk().as_u64()) + .sum(), + } +} + +#[tauri::command] +pub async fn app_plan(app: AppHandle, job_id: String, app_key: String) -> Result { + let chosen = app + .state::() + .apps + .lock() + .map_err(|_| "The application inventory is unavailable.".to_string())? + .iter() + .find(|candidate| candidate.key() == app_key) + .cloned() + .ok_or_else(|| "That application is no longer in the inventory.".to_string())?; + let token = app.state::().begin(&job_id)?; + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "plan", progress.clone()); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + uninstall::build_plan(&engine, &chosen, &progress, &token) + }) + .await + .map_err(|error| format!("Removal plan failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let plan = task.map_err(|error| error.to_string())?; + let view = plan_view(job_id.clone(), &plan); + app.state::() + .plans + .lock() + .map_err(|_| "The removal plan cache is unavailable.".to_string())? + .insert(job_id, plan); + Ok(view) +} + +#[tauri::command] +pub async fn app_uninstall( + app: AppHandle, + job_id: String, + plan_id: String, + selected: Vec, + mode: DeleteMode, +) -> Result { + let token = app.state::().begin(&job_id)?; + let mut plan = app + .state::() + .plans + .lock() + .map_err(|_| "The removal plan cache is unavailable.".to_string())? + .get(&plan_id) + .cloned() + .ok_or_else(|| "This removal plan has expired. Build it again.".to_string())?; + let chosen: HashSet = selected.into_iter().collect(); + if let Some(index) = chosen.iter().find(|index| **index >= plan.items.len()) { + return Err(format!("Selected item {index} is not in this plan.")); + } + for (index, item) in plan.items.iter_mut().enumerate() { + item.selected = chosen.contains(&index) && item.lock.is_none(); + } + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "delete", progress.clone()); + let task = tauri::async_runtime::spawn_blocking(move || { + let engine = Engine::new(); + uninstall::remove_plan(&engine, &plan, mode, &progress, &token) + }) + .await + .map_err(|error| format!("Uninstall failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + let outcome = task.map_err(|error| error.to_string())?; + if let Ok(mut plans) = app.state::().plans.lock() { + plans.remove(&plan_id); + } + Ok(DeleteResultView::from_outcome(outcome)) +} + +#[tauri::command] +pub async fn storage_explore( + app: AppHandle, + job_id: String, + path: Option, + depth: Option, + top: Option, +) -> Result { + let token = app.state::().begin(&job_id)?; + let progress = Progress::new(); + let reporter = + ProgressReporter::start(app.clone(), job_id.clone(), "storage", progress.clone()); + let root = path + .filter(|path| !path.trim().is_empty()) + .map(|path| paths::expand(&path)) + .unwrap_or_else(paths::home_dir); + if !root.is_dir() { + app.state::().finish(&job_id); + reporter.finish(); + return Err(format!("{} is not a folder.", root.display())); + } + let task = tauri::async_runtime::spawn_blocking(move || { + analyze::explore( + &root, + depth.unwrap_or(1).clamp(1, 3), + top.unwrap_or(16), + &token, + &progress, + ) + }) + .await + .map_err(|error| format!("Storage analysis failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + task.map_err(|error| error.to_string()) +} + +#[tauri::command] +pub async fn storage_largest_files( + app: AppHandle, + job_id: String, + path: String, + limit: Option, +) -> Result, String> { + let token = app.state::().begin(&job_id)?; + let progress = Progress::new(); + let reporter = ProgressReporter::start(app.clone(), job_id.clone(), "files", progress.clone()); + let root = paths::expand(&path); + let task = tauri::async_runtime::spawn_blocking(move || { + analyze::largest_files( + &root, + limit.unwrap_or(40).clamp(1, 200), + Bytes(1_000_000), + &token, + &progress, + ) + }) + .await + .map_err(|error| format!("Large-file scan failed: {error}"))?; + reporter.finish(); + app.state::().finish(&job_id); + task.map_err(|error| error.to_string()) +} + +#[tauri::command] +pub fn system_snapshot(app: AppHandle) -> Result { + let state = app.state::(); + let mut sampler = AppState::lock(&state.sampler)?; + Ok(sampler.refresh()) +} + +#[tauri::command] +pub fn stop_process(app: AppHandle, process: ProcessSample) -> Result<(), String> { + let state = app.state::(); + let mut sampler = AppState::lock(&state.sampler)?; + sampler.stop(&process).map_err(|error| error.to_string()) +} + +#[tauri::command] +pub fn history_list(limit: Option) -> Vec { + ledger::load_sessions(limit.unwrap_or(60).clamp(1, 500)) +} + +#[derive(Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct UndoResultView { + restored: usize, + skipped: usize, +} + +#[tauri::command] +pub async fn history_undo(session_id: String) -> Result { + tauri::async_runtime::spawn_blocking(move || { + let (restored, skipped) = + delete::restore_session(&session_id).map_err(|e| e.to_string())?; + Ok(UndoResultView { restored, skipped }) + }) + .await + .map_err(|error| error.to_string())? +} + +#[derive(Clone, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SettingsPatch { + delete_mode: Option, + language: Option, + show_allocated: Option, + purge_min_age_days: Option, + history_keep: Option, + setup_reviewed: Option, +} + +#[tauri::command] +pub async fn settings_save(patch: SettingsPatch) -> Result { + tauri::async_runtime::spawn_blocking(move || { + let (mut settings, mut errors) = Settings::load(); + if let Some(mode) = patch.delete_mode { + settings.delete_mode = mode; + } + if let Some(language) = patch.language { + let trimmed = language.trim(); + settings.language = (!trimmed.is_empty()).then(|| trimmed.to_string()); + } + if let Some(show) = patch.show_allocated { + settings.show_allocated = show; + } + if let Some(days) = patch.purge_min_age_days { + settings.purge_min_age_days = days.min(3650); + } + if let Some(keep) = patch.history_keep { + settings.history_keep = keep.clamp(5, 500); + } + if let Some(reviewed) = patch.setup_reviewed { + settings.desktop_setup_reviewed = reviewed; + } + settings + .save() + .map_err(|error| format!("Could not save settings: {error}"))?; + errors.retain(|error| !error.contains("config.toml")); + Ok(SettingsView::from_settings(&settings, errors)) + }) + .await + .map_err(|error| error.to_string())? +} + +fn escape_glob(text: &str) -> String { + let mut escaped = String::with_capacity(text.len()); + for character in text.chars() { + if matches!(character, '*' | '?' | '[' | ']' | '{' | '}' | '!') { + escaped.push('\\'); + } + escaped.push(character); + } + escaped +} + +#[tauri::command] +pub async fn whitelist_add(path: String) -> Result { + tauri::async_runtime::spawn_blocking(move || { + let (mut settings, errors) = Settings::load(); + let expanded = paths::expand(&path); + if expanded.as_os_str().is_empty() { + return Err("Choose a path to protect.".into()); + } + settings.add_whitelist(escape_glob(&paths::pretty(&expanded))); + settings + .save() + .map_err(|error| format!("Could not save settings: {error}"))?; + Ok(SettingsView::from_settings(&settings, errors)) + }) + .await + .map_err(|error| error.to_string())? +} + +#[tauri::command] +pub async fn whitelist_remove(pattern: String) -> Result { + tauri::async_runtime::spawn_blocking(move || { + let (mut settings, errors) = Settings::load(); + settings.remove_whitelist(&pattern); + settings + .save() + .map_err(|error| format!("Could not save settings: {error}"))?; + Ok(SettingsView::from_settings(&settings, errors)) + }) + .await + .map_err(|error| error.to_string())? +} + +#[tauri::command] +pub fn reveal_path(app: AppHandle, path: String) -> Result<(), String> { + let target = PathBuf::from(path); + if !target.exists() { + return Err(format!("{} no longer exists.", target.display())); + } + #[cfg(target_os = "macos")] + { + crate::process::command("/usr/bin/open") + .arg("-R") + .arg(&target) + .status() + .map_err(|error| error.to_string())?; + } + #[cfg(windows)] + { + crate::process::command("explorer.exe") + .arg(format!("/select,{}", target.display())) + .status() + .map_err(|error| error.to_string())?; + } + #[cfg(not(any(target_os = "macos", windows)))] + { + crate::process::command("xdg-open") + .arg(target.parent().unwrap_or(Path::new("/"))) + .status() + .map_err(|error| error.to_string())?; + } + let _ = app; + Ok(()) +} + +#[tauri::command] +pub fn open_trash() -> Result<(), String> { + let platform = squid_platform::current(); + platform.reveal_trash(); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_selected_index_can_never_select_a_locked_item() { + let mut report = ScanReport::default(); + report.items.push(CleanupItem::new( + PathBuf::from("/tmp/keep"), + ItemKind::File, + Category::Logs, + "keep", + )); + report.items.push( + CleanupItem::new( + PathBuf::from("/tmp/locked"), + ItemKind::File, + Category::Logs, + "locked", + ) + .locked(LockReason::Protected), + ); + select_indices(&mut report, &[0, 1]).unwrap(); + assert!(report.items[0].selected); + assert!(!report.items[1].selected); + } + + #[test] + fn an_out_of_range_selection_is_refused() { + let mut report = ScanReport::default(); + assert!(select_indices(&mut report, &[0]).is_err()); + } + + #[test] + fn whitelist_paths_are_taken_literally() { + assert_eq!(escape_glob("~/Caches/[demo]*"), "~/Caches/\\[demo\\]\\*"); + } +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs new file mode 100644 index 0000000..db3e79a --- /dev/null +++ b/src-tauri/src/lib.rs @@ -0,0 +1,136 @@ +mod app; +mod permissions; +mod process; +mod update; + +use tauri::{ + menu::{Menu, MenuItem, PredefinedMenuItem}, + tray::TrayIconBuilder, + AppHandle, Emitter, Manager, WindowEvent, +}; + +#[cfg(target_os = "macos")] +use tauri::RunEvent; + +fn show_main_window(app: &AppHandle) { + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.unminimize(); + let _ = window.set_focus(); + } +} + +fn navigate_to(app: &AppHandle, page: &'static str) { + show_main_window(app); + let _ = app.emit("squid://navigate", page); +} + +fn create_tray(app: &AppHandle) -> tauri::Result<()> { + let open = MenuItem::with_id(app, "open", "打开 Squid", true, None::<&str>)?; + let cleanup = MenuItem::with_id(app, "cleanup", "日常清理", true, None::<&str>)?; + let apps = MenuItem::with_id(app, "applications", "应用卸载", true, None::<&str>)?; + let purge = MenuItem::with_id(app, "purge", "深度清理", true, None::<&str>)?; + let quit = MenuItem::with_id(app, "quit", "退出 Squid", true, None::<&str>)?; + let first_separator = PredefinedMenuItem::separator(app)?; + let last_separator = PredefinedMenuItem::separator(app)?; + let menu = Menu::with_items( + app, + &[ + &open, + &first_separator, + &cleanup, + &apps, + &purge, + &last_separator, + &quit, + ], + )?; + let icon = app + .default_window_icon() + .cloned() + .ok_or_else(|| tauri::Error::AssetNotFound("default window icon".into()))?; + + TrayIconBuilder::with_id("squid-tray") + .icon(icon) + .tooltip("Squid") + .menu(&menu) + .show_menu_on_left_click(true) + .on_menu_event(|app, event| match event.id.as_ref() { + "open" => show_main_window(app), + "cleanup" => navigate_to(app, "cleanup"), + "applications" => navigate_to(app, "applications"), + "purge" => navigate_to(app, "purge"), + "quit" => app.exit(0), + _ => {} + }) + .build(app)?; + Ok(()) +} + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + let app = tauri::Builder::default() + .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| { + show_main_window(app); + })) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_opener::init()) + .on_window_event(|window, event| { + if let WindowEvent::CloseRequested { api, .. } = event { + api.prevent_close(); + let _ = window.hide(); + } + }) + .manage(app::AppState::default()) + .manage(update::UpdateState::default()) + .invoke_handler(tauri::generate_handler![ + app::bootstrap, + app::cancel_job, + app::cleanup_scan, + app::cleanup_delete, + app::purge_scan, + app::purge_delete, + app::apps_scan, + app::app_plan, + app::app_uninstall, + app::storage_explore, + app::storage_largest_files, + app::system_snapshot, + app::stop_process, + app::history_list, + app::history_undo, + app::settings_save, + app::whitelist_add, + app::whitelist_remove, + app::reveal_path, + app::open_trash, + permissions::permission_status, + permissions::open_full_disk_access_settings, + update::update_check, + update::update_status, + update::update_download, + update::update_install, + update::update_clear, + update::set_update_check_enabled, + ]) + .setup(|app| { + create_tray(app.handle())?; + update::spawn_startup_check(app.handle()); + Ok(()) + }) + .build(tauri::generate_context!()) + .expect("error while running Squid"); + + app.run(|app_handle, event| { + #[cfg(target_os = "macos")] + if let RunEvent::Reopen { + has_visible_windows: false, + .. + } = event + { + show_main_window(app_handle); + } + #[cfg(not(target_os = "macos"))] + let _ = (app_handle, event); + }); +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs new file mode 100644 index 0000000..cfea7c3 --- /dev/null +++ b/src-tauri/src/main.rs @@ -0,0 +1,5 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + squid_desktop_lib::run(); +} diff --git a/src-tauri/src/permissions.rs b/src-tauri/src/permissions.rs new file mode 100644 index 0000000..b3b1590 --- /dev/null +++ b/src-tauri/src/permissions.rs @@ -0,0 +1,111 @@ +//! Optional macOS privacy access used by the guided first-run check and Settings. +//! +//! macOS has no public API that reports Full Disk Access. The app probes a small +//! set of TCC-protected locations that a system-care tool normally reads. The probe +//! only opens a file or lists a directory; it never reads their contents. + +use serde::Serialize; + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct PermissionStatus { + /// `granted`, `denied`, `unknown`, or `not-required`. + pub full_disk_access: String, +} + +impl PermissionStatus { + fn new(state: &str) -> Self { + Self { + full_disk_access: state.into(), + } + } +} + +#[tauri::command] +pub fn permission_status() -> PermissionStatus { + #[cfg(target_os = "macos")] + { + PermissionStatus::new(full_disk_access_state()) + } + #[cfg(not(target_os = "macos"))] + { + PermissionStatus::new("not-required") + } +} + +#[tauri::command] +pub fn open_full_disk_access_settings() -> Result<(), String> { + #[cfg(target_os = "macos")] + { + let status = crate::process::command("/usr/bin/open") + .arg("x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles") + .status() + .map_err(|error| format!("Could not open Full Disk Access settings: {error}"))?; + if status.success() { + return Ok(()); + } + Err("Could not open Full Disk Access settings.".into()) + } + #[cfg(not(target_os = "macos"))] + { + Err("Full Disk Access is macOS-specific.".into()) + } +} + +#[cfg(target_os = "macos")] +fn full_disk_access_state() -> &'static str { + let home = squid_core::paths::home_dir(); + let probes = [ + home.join("Library/Application Support/com.apple.TCC/TCC.db"), + home.join("Library/Safari"), + home.join("Library/Mail"), + home.join("Library/Messages"), + ]; + + let mut readable = false; + let mut denied = false; + for path in probes { + match probe(&path) { + Probe::Readable => readable = true, + Probe::Denied => denied = true, + Probe::Missing | Probe::Unknown => {} + } + } + if readable { + "granted" + } else if denied { + "denied" + } else { + "unknown" + } +} + +#[cfg(target_os = "macos")] +enum Probe { + Readable, + Denied, + Missing, + Unknown, +} + +#[cfg(target_os = "macos")] +fn probe(path: &std::path::Path) -> Probe { + use std::io::ErrorKind; + + let metadata = match std::fs::metadata(path) { + Ok(metadata) => metadata, + Err(error) if error.kind() == ErrorKind::NotFound => return Probe::Missing, + Err(error) if error.kind() == ErrorKind::PermissionDenied => return Probe::Denied, + Err(_) => return Probe::Unknown, + }; + let result = if metadata.is_dir() { + std::fs::read_dir(path).map(|_| ()) + } else { + std::fs::File::open(path).map(|_| ()) + }; + match result { + Ok(()) => Probe::Readable, + Err(error) if error.kind() == ErrorKind::PermissionDenied => Probe::Denied, + Err(_) => Probe::Unknown, + } +} diff --git a/src-tauri/src/process.rs b/src-tauri/src/process.rs new file mode 100644 index 0000000..bf27cd2 --- /dev/null +++ b/src-tauri/src/process.rs @@ -0,0 +1,34 @@ +//! Child-process helpers for a GUI app. +//! +//! Every helper is spawned without a console window on Windows. The updater +//! also relies on the same hidden spawn path so a background download never +//! flashes a terminal over the main window. + +use std::ffi::OsStr; +use std::process::{Command, Stdio}; + +#[cfg(target_os = "windows")] +const CREATE_NO_WINDOW: u32 = 0x0800_0000; +#[cfg(target_os = "windows")] +const CREATE_NEW_PROCESS_GROUP: u32 = 0x0000_0200; + +pub fn hidden(command: &mut Command) -> &mut Command { + #[cfg(target_os = "windows")] + { + use std::os::windows::process::CommandExt; + command.creation_flags(CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP); + } + #[cfg(not(target_os = "windows"))] + let _ = command; + command +} + +pub fn command(program: impl AsRef) -> Command { + let mut command = Command::new(program); + command + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()); + hidden(&mut command); + command +} diff --git a/src-tauri/src/update.rs b/src-tauri/src/update.rs new file mode 100644 index 0000000..c22660f --- /dev/null +++ b/src-tauri/src/update.rs @@ -0,0 +1,1026 @@ +//! Git-backed update channel, matching the model used by nex_shift. +//! +//! Installers and a `squid-update.json` manifest live on an orphan `releases` +//! branch in this repository. A checkout over HTTPS is the whole update server. +//! The app verifies the installer's exact byte length and SHA256 before it can +//! run, and verifies a detached Ed25519 signature when a release key was baked +//! into the build. A helper replaces the app after it exits. + +use std::{ + collections::BTreeMap, + fs, + io::Read, + path::{Path, PathBuf}, + process::{Command, Stdio}, + thread, + time::{Duration, Instant}, +}; + +use base64::{engine::general_purpose::STANDARD as BASE64, Engine as _}; +use ed25519_dalek::{Signature, VerifyingKey}; +use serde::{Deserialize, Serialize}; +use sha2::{Digest, Sha256}; +use squid_core::settings::Settings; +use tauri::{AppHandle, Emitter, Manager}; + +const BAKED_MANIFEST_URL: &str = match option_env!("SQUID_UPDATE_URL") { + Some(url) => url, + None => "", +}; +const SIGNATURE_FILE: &str = "squid-update.sig"; +const ENV_MANIFEST_URL: &str = "SQUID_UPDATE_URL"; +const BAKED_PUBLIC_KEY: &str = match option_env!("SQUID_UPDATE_PUBKEY") { + Some(key) => key, + None => "", +}; +const FETCH_TIMEOUT: Duration = Duration::from_secs(20); +const DOWNLOAD_TIMEOUT: Duration = Duration::from_secs(600); +pub const CHECK_INTERVAL: Duration = Duration::from_secs(24 * 60 * 60); +const SUPPORTED_SCHEMA: u32 = 1; + +#[derive(Debug, Clone, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +struct Artifact { + file: String, + sha256: String, + size: u64, +} + +#[derive(Debug, Clone, Deserialize, Serialize, Default)] +#[serde(rename_all = "camelCase")] +struct ReleaseManifest { + schema: u32, + version: String, + date: String, + notes: String, + artifacts: BTreeMap, +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct UpdateStatus { + pub state: String, + pub current_version: String, + pub available_version: String, + pub file_name: String, + pub size: u64, + pub sha256: String, + pub notes: String, + pub date: String, + pub path: Option, + pub message: String, + pub feed_url: String, + pub signed: bool, + pub artifact_key: String, +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct UpdateProgress { + downloaded: u64, + total: u64, + state: String, +} + +#[derive(Default)] +pub struct UpdateState { + status: std::sync::Mutex>, + manifest: std::sync::Mutex>, + signed: std::sync::Mutex, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(default, rename_all = "camelCase")] +pub struct UpdatePrefs { + pub update_check_enabled: bool, + last_update_check_day: i64, +} + +impl Default for UpdatePrefs { + fn default() -> Self { + Self { + update_check_enabled: true, + last_update_check_day: 0, + } + } +} + +fn prefs_path() -> PathBuf { + Settings::config_dir().join("updates.json") +} + +pub fn load_prefs() -> UpdatePrefs { + fs::read_to_string(prefs_path()) + .ok() + .and_then(|text| serde_json::from_str(&text).ok()) + .unwrap_or_default() +} + +fn save_prefs(prefs: &UpdatePrefs) -> Result<(), String> { + let path = prefs_path(); + if let Some(parent) = path.parent() { + fs::create_dir_all(parent).map_err(|error| error.to_string())?; + } + let text = serde_json::to_string_pretty(prefs).map_err(|error| error.to_string())?; + fs::write(path, text).map_err(|error| error.to_string()) +} + +fn unix_day() -> i64 { + chrono::Utc::now().timestamp() / 86_400 +} + +fn update_check_due(interval: Duration) -> bool { + let prefs = load_prefs(); + if !prefs.update_check_enabled { + return false; + } + let elapsed = unix_day().saturating_sub(prefs.last_update_check_day); + elapsed >= (interval.as_secs() / 86_400).max(1) as i64 +} + +fn note_update_check() { + let mut prefs = load_prefs(); + prefs.last_update_check_day = unix_day(); + let _ = save_prefs(&prefs); +} + +#[tauri::command] +pub async fn set_update_check_enabled(enabled: bool) -> Result { + tauri::async_runtime::spawn_blocking(move || { + let mut prefs = load_prefs(); + prefs.update_check_enabled = enabled; + save_prefs(&prefs)?; + Ok(enabled) + }) + .await + .map_err(|error| error.to_string())? +} + +fn current_version() -> String { + env!("CARGO_PKG_VERSION").to_string() +} + +pub fn manifest_url() -> String { + std::env::var(ENV_MANIFEST_URL) + .ok() + .map(|value| value.trim().to_string()) + .filter(|value| !value.is_empty()) + .or_else(|| (!BAKED_MANIFEST_URL.is_empty()).then(|| BAKED_MANIFEST_URL.to_string())) + .unwrap_or_default() +} + +fn platform_key() -> &'static str { + std::env::consts::OS +} + +fn artifact_keys_for(platform: &str, arch: &str) -> Vec { + if platform == "windows" && arch == "aarch64" { + return vec!["windows-arm64".to_string(), "windows".to_string()]; + } + vec![platform.to_string()] +} + +fn select_artifact<'a>( + manifest: &'a ReleaseManifest, + platform: &str, + arch: &str, +) -> Option<(String, &'a Artifact)> { + artifact_keys_for(platform, arch) + .into_iter() + .find_map(|key| manifest.artifacts.get(&key).map(|item| (key, item))) +} + +fn artifact_for(manifest: &ReleaseManifest) -> Option<(String, &Artifact)> { + select_artifact(manifest, platform_key(), std::env::consts::ARCH) +} + +pub fn version_is_newer(candidate: &str, current: &str) -> bool { + let (candidate_number, candidate_pre) = split_version(candidate); + let (current_number, current_pre) = split_version(current); + for index in 0..candidate_number.len().max(current_number.len()) { + let left = candidate_number.get(index).copied().unwrap_or(0); + let right = current_number.get(index).copied().unwrap_or(0); + if left != right { + return left > right; + } + } + match (&candidate_pre, ¤t_pre) { + (None, Some(_)) => true, + (Some(_), None) => false, + (None, None) => false, + (Some(left), Some(right)) => prerelease_is_newer(left, right), + } +} + +fn split_version(value: &str) -> (Vec, Option>) { + let trimmed = value.trim().trim_start_matches('v'); + let core = trimmed.split('+').next().unwrap_or(trimmed); + let (numbers, pre_release) = match core.split_once('-') { + Some((head, tail)) => (head, (!tail.is_empty()).then(|| tail.split('.').collect())), + None => (core, None), + }; + ( + numbers + .split('.') + .map(|part| part.parse::().unwrap_or(0)) + .collect(), + pre_release, + ) +} + +fn prerelease_is_newer(candidate: &[&str], current: &[&str]) -> bool { + for index in 0..candidate.len().max(current.len()) { + match (candidate.get(index), current.get(index)) { + (None, Some(_)) => return false, + (Some(_), None) => return true, + (None, None) => return false, + (Some(left), Some(right)) => { + if left == right { + continue; + } + return match (left.parse::(), right.parse::()) { + (Ok(left), Ok(right)) => left > right, + (Ok(_), Err(_)) => false, + (Err(_), Ok(_)) => true, + (Err(_), Err(_)) => left > right, + }; + } + } + } + false +} + +fn public_key() -> Result, String> { + key_from_hex(BAKED_PUBLIC_KEY) +} + +fn key_from_hex(value: &str) -> Result, String> { + let key = value.trim(); + if key.is_empty() { + return Ok(None); + } + let mut bytes = [0u8; 32]; + hex::decode_to_slice(key, &mut bytes) + .map_err(|_| "The configured release key is not 32 bytes of hex.".to_string())?; + VerifyingKey::from_bytes(&bytes) + .map_err(|_| "The configured release key is not an ed25519 public key.".to_string()) + .map(Some) +} + +fn signature_url() -> Option { + let url = manifest_url(); + (!url.is_empty()).then(|| { + let base = match url.rsplit_once('/') { + Some((head, _)) => head, + None => url.as_str(), + }; + format!("{base}/{SIGNATURE_FILE}") + }) +} + +fn verify_manifest(text: &str, signature: Option<&str>) -> Result { + verify_against(public_key()?.as_ref(), text, signature) +} + +fn verify_against( + key: Option<&VerifyingKey>, + text: &str, + signature: Option<&str>, +) -> Result { + let Some(key) = key else { + return Ok(false); + }; + let encoded = signature.ok_or_else(|| { + "This feed has no squid-update.sig, but this build requires a signed manifest.".to_string() + })?; + let decoded = BASE64 + .decode(encoded.trim().as_bytes()) + .map_err(|error| format!("The feed's signature is not valid base64: {error}"))?; + let signature = Signature::from_slice(&decoded) + .map_err(|error| format!("The feed's signature is malformed: {error}"))?; + key.verify_strict(text.as_bytes(), &signature) + .map_err(|_| "The manifest signature does not match the release key.".to_string())?; + Ok(true) +} + +fn is_safe_artifact_name(name: &str) -> bool { + !name.is_empty() + && Path::new(name) + .file_name() + .map(|part| part == name) + .unwrap_or(false) + && name + .chars() + .all(|character| character.is_ascii_alphanumeric() || " ._+-".contains(character)) +} + +fn parse_manifest(text: &str) -> Result { + let manifest: ReleaseManifest = + serde_json::from_str(text).map_err(|error| format!("Malformed manifest: {error}"))?; + if manifest.version.trim().is_empty() { + return Err("The manifest carries no version.".into()); + } + if manifest.schema > SUPPORTED_SCHEMA { + return Err(format!( + "Manifest schema {} is newer than this build understands.", + manifest.schema + )); + } + for artifact in manifest.artifacts.values() { + if !is_sha256_hex(&artifact.sha256) { + return Err(format!("{} has no usable SHA256.", artifact.file)); + } + if !is_safe_artifact_name(&artifact.file) { + return Err(format!( + "{} is not a safe artifact file name.", + artifact.file + )); + } + } + Ok(manifest) +} + +fn is_sha256_hex(value: &str) -> bool { + value.len() == 64 && value.chars().all(|character| character.is_ascii_hexdigit()) +} + +fn raw_asset_url(file: &str) -> Result { + let base = manifest_url(); + if base.is_empty() { + return Err("No update feed is configured.".into()); + } + let directory = base.rsplit_once('/').map(|(head, _)| head).unwrap_or(&base); + Ok(format!("{directory}/{}", file.trim_start_matches('/'))) +} + +fn download( + url: &str, + destination: &Path, + timeout: Duration, + mut on_tick: impl FnMut(), +) -> Result<(), String> { + if let Some(parent) = destination.parent() { + fs::create_dir_all(parent).map_err(|error| error.to_string())?; + } + let _ = fs::remove_file(destination); + + #[cfg(not(target_os = "windows"))] + let (program, args): (&str, Vec) = ( + "/usr/bin/curl", + vec![ + "--fail".into(), + "--silent".into(), + "--show-error".into(), + "--location".into(), + "--max-time".into(), + timeout.as_secs().to_string(), + "--output".into(), + destination.to_string_lossy().to_string(), + url.to_string(), + ], + ); + #[cfg(target_os = "windows")] + let (program, args): (&str, Vec) = { + let escaped = destination.to_string_lossy().replace('\'', "''"); + let script = format!( + "$ProgressPreference='SilentlyContinue'; Invoke-WebRequest -UseBasicParsing -TimeoutSec {} -Uri '{}' -OutFile '{}'", + timeout.as_secs(), + url.replace('\'', "''"), + escaped + ); + ( + "powershell.exe", + vec![ + "-NoProfile".into(), + "-NonInteractive".into(), + "-ExecutionPolicy".into(), + "Bypass".into(), + "-Command".into(), + script, + ], + ) + }; + + let mut command: Command = crate::process::command(program); + command + .args(&args) + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::piped()); + let mut child = command + .spawn() + .map_err(|error| format!("Could not start the download: {error}"))?; + let deadline = Instant::now() + timeout + Duration::from_secs(10); + let status = loop { + match child.try_wait() { + Ok(Some(status)) => break status, + Ok(None) if Instant::now() >= deadline => { + let _ = child.kill(); + let _ = child.wait(); + return Err(format!("The download stalled for {timeout:?}.")); + } + Ok(None) => { + on_tick(); + thread::sleep(Duration::from_millis(250)); + } + Err(error) => { + let _ = child.kill(); + let _ = child.wait(); + return Err(error.to_string()); + } + } + }; + if !status.success() { + let mut detail = String::new(); + if let Some(mut stderr) = child.stderr.take() { + let _ = stderr.read_to_string(&mut detail); + } + let detail = detail.trim().to_string(); + return Err(if detail.is_empty() { + format!( + "The download failed (exit {}).", + status.code().unwrap_or(-1) + ) + } else { + detail + }); + } + if destination.is_file() { + Ok(()) + } else { + Err("The download produced no file.".into()) + } +} + +fn fetch_text(url: &str) -> Result { + let target = std::env::temp_dir().join(format!( + "squid-manifest-{}-{}.json", + std::process::id(), + uuid::Uuid::new_v4() + )); + download(url, &target, FETCH_TIMEOUT, || {})?; + let text = fs::read_to_string(&target).map_err(|error| error.to_string())?; + let _ = fs::remove_file(&target); + Ok(text) +} + +fn download_directory() -> PathBuf { + std::env::temp_dir().join("Squid Updates") +} + +pub fn sha256_of(path: &Path) -> Result { + let mut file = fs::File::open(path).map_err(|error| error.to_string())?; + let mut digest = Sha256::new(); + let mut buffer = vec![0_u8; 128 * 1024]; + loop { + let read = file.read(&mut buffer).map_err(|error| error.to_string())?; + if read == 0 { + break; + } + digest.update(&buffer[..read]); + } + Ok(hex::encode(digest.finalize())) +} + +fn emit_progress(app: &AppHandle, downloaded: u64, total: u64, state: &str) { + let _ = app.emit( + "update://progress", + UpdateProgress { + downloaded, + total, + state: state.to_string(), + }, + ); +} + +fn publish(app: &AppHandle, status: UpdateStatus) -> UpdateStatus { + if let Ok(mut guard) = app.state::().status.lock() { + *guard = Some(status.clone()); + } + let _ = app.emit("update://status", status.clone()); + status +} + +fn error_status(message: impl Into) -> UpdateStatus { + UpdateStatus { + state: "error".into(), + current_version: current_version(), + available_version: String::new(), + file_name: String::new(), + size: 0, + sha256: String::new(), + notes: String::new(), + date: String::new(), + path: None, + message: message.into(), + feed_url: manifest_url(), + signed: false, + artifact_key: String::new(), + } +} + +fn status_for(manifest: &ReleaseManifest, path: Option, signed: bool) -> UpdateStatus { + let artifact = artifact_for(manifest); + let (file_name, size, sha256, artifact_key) = match artifact.as_ref() { + Some((key, item)) => ( + item.file.clone(), + item.size, + item.sha256.clone(), + key.clone(), + ), + None => (String::new(), 0, String::new(), String::new()), + }; + let newer = version_is_newer(&manifest.version, ¤t_version()); + let message = if newer && artifact.is_none() { + format!( + "Release {} has no artifact for this platform ({}).", + manifest.version, + artifact_keys_for(platform_key(), std::env::consts::ARCH).join(" or ") + ) + } else { + String::new() + }; + UpdateStatus { + state: match (newer, artifact) { + (true, Some(_)) => "available", + (true, None) => "unavailable", + (false, _) => "current", + } + .to_string(), + current_version: current_version(), + available_version: manifest.version.clone(), + file_name, + size, + sha256, + notes: manifest.notes.clone(), + date: manifest.date.clone(), + path: path.map(|value| value.to_string_lossy().to_string()), + message, + feed_url: manifest_url(), + signed, + artifact_key, + } +} + +fn remembered_signed(app: &AppHandle) -> bool { + app.state::() + .signed + .lock() + .map(|guard| *guard) + .unwrap_or(false) +} + +fn remembered_manifest(app: &AppHandle) -> Option { + app.state::() + .manifest + .lock() + .ok() + .and_then(|guard| guard.clone()) +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct UpdateCheckOutcome { + pub status: UpdateStatus, + pub download_ready: bool, +} + +#[tauri::command] +pub async fn update_check(app: AppHandle) -> UpdateCheckOutcome { + let outcome = tauri::async_runtime::spawn_blocking({ + let app = app.clone(); + move || { + let url = manifest_url(); + if url.is_empty() { + return Err("This build has no update feed configured.".to_string()); + } + let text = fetch_text(&url)?; + let signature = signature_url().and_then(|candidate| fetch_text(&candidate).ok()); + let signed = verify_manifest(&text, signature.as_deref())?; + let manifest = parse_manifest(&text)?; + if let Ok(mut guard) = app.state::().manifest.lock() { + *guard = Some(manifest.clone()); + } + if let Ok(mut guard) = app.state::().signed.lock() { + *guard = signed; + } + Ok::(manifest) + } + }) + .await; + + match outcome.unwrap_or_else(|error| Err(error.to_string())) { + Ok(manifest) => { + let status = status_for(&manifest, None, remembered_signed(&app)); + let download_ready = status.state == "available"; + UpdateCheckOutcome { + download_ready, + status: publish(&app, status), + } + } + Err(error) => UpdateCheckOutcome { + download_ready: false, + status: publish(&app, error_status(error)), + }, + } +} + +#[tauri::command] +pub fn update_status(state: tauri::State<'_, UpdateState>) -> Option { + state.status.lock().ok().and_then(|guard| guard.clone()) +} + +#[tauri::command] +pub async fn update_download(app: AppHandle) -> Result { + let manifest = + remembered_manifest(&app).ok_or_else(|| "Run a check for updates first.".to_string())?; + let artifact = artifact_for(&manifest) + .map(|(_, item)| item.clone()) + .ok_or_else(|| { + format!( + "Release {} has no artifact for this platform.", + manifest.version + ) + })?; + let target = download_directory().join(&artifact.file); + let reporter = app.clone(); + let expected = artifact.sha256.clone(); + let total = artifact.size; + tauri::async_runtime::spawn_blocking(move || { + emit_progress(&reporter, 0, total, "downloading"); + let written = std::sync::atomic::AtomicU64::new(0); + download( + &raw_asset_url(&artifact.file)?, + &target, + DOWNLOAD_TIMEOUT, + || { + let size = fs::metadata(&target).map(|meta| meta.len()).unwrap_or(0); + if size > written.load(std::sync::atomic::Ordering::Relaxed) { + written.store(size, std::sync::atomic::Ordering::Relaxed); + emit_progress(&reporter, size, total, "downloading"); + } + }, + )?; + let actual_size = fs::metadata(&target).map(|meta| meta.len()).unwrap_or(0); + if total > 0 && actual_size != total { + let _ = fs::remove_file(&target); + return Err(format!( + "Expected {} bytes but received {actual_size}. The download was discarded.", + total + )); + } + emit_progress(&reporter, actual_size, total, "verifying"); + let actual = sha256_of(&target)?; + if !actual.eq_ignore_ascii_case(&expected) { + let _ = fs::remove_file(&target); + return Err(format!( + "SHA256 mismatch: expected {expected}, got {actual}. The download was discarded." + )); + } + let mut status = status_for( + &manifest, + Some(target.clone()), + remembered_signed(&reporter), + ); + status.state = "ready".into(); + status.message = actual; + Ok(publish(&reporter, status)) + }) + .await + .map_err(|error| format!("Update download failed: {error}"))? +} + +fn bundle_path(exe: &Path) -> Option { + let contents = exe.parent()?.parent()?; + let bundle = contents.parent()?; + if contents.file_name()? != "Contents" { + return None; + } + bundle + .extension() + .filter(|ext| ext.eq_ignore_ascii_case("app"))?; + Some(bundle.to_path_buf()) +} + +#[cfg(target_os = "macos")] +fn can_replace(bundle: &Path) -> bool { + let parent = match bundle.parent() { + Some(parent) => parent, + None => return false, + }; + let probe = parent.join(format!(".squid-replace-{}", std::process::id())); + match fs::File::create(&probe) { + Ok(_) => { + let _ = fs::remove_file(&probe); + true + } + Err(_) => false, + } +} + +#[cfg(target_os = "macos")] +fn macos_handoff(pid: u32, image: &Path, bundle: &Path, log: &Path) -> String { + format!( + r#"#!/bin/sh +pid="{pid}" +image="{image}" +bundle="{bundle}" +log="{log}" +while kill -0 "$pid" 2>/dev/null; do sleep 0.2; done +mount="$TMPDIR/Squid Updates/mount.$$" +[ -n "$TMPDIR" ] || mount="/tmp/Squid Updates/mount.$$" +mkdir -p "${{mount%/*}}" +if ! /usr/bin/hdiutil attach -nobrowse -readonly -mountpoint "$mount" "$image" >>"$log" 2>&1; then + echo "mount failed" >>"$log" + /usr/bin/open "$bundle" + exit 1 +fi +status=0 +if ! /usr/bin/ditto "$mount/Squid.app" "$bundle.new" >>"$log" 2>&1; then + status=1 +else + /usr/bin/xattr -dr com.apple.quarantine "$bundle.new" 2>/dev/null + if mv "$bundle" "$bundle.old" >>"$log" 2>&1 && mv "$bundle.new" "$bundle" >>"$log" 2>&1; then + /bin/rm -rf "$bundle.old" + else + status=1 + [ -d "$bundle.old" ] && [ ! -d "$bundle" ] && mv "$bundle.old" "$bundle" >>"$log" 2>&1 + /bin/rm -rf "$bundle.new" + fi +fi +/usr/bin/hdiutil detach "$mount" -quiet >>"$log" 2>&1 +[ "$status" -eq 0 ] || echo "handoff failed; reopening the previous copy" >>"$log" +/usr/bin/open "$bundle" +exit "$status" +"#, + pid = pid, + image = image.display(), + bundle = bundle.display(), + log = log.display(), + ) +} + +#[cfg(target_os = "windows")] +fn windows_handoff(pid: u32, installer: &Path, log: &Path) -> String { + format!( + r#"@echo off +setlocal EnableExtensions +set "WAIT_FOR={pid}" +set "INSTALLER={installer}" +set "LOG={log}" +set /a TRIES=0 +:waitloop +tasklist /FI "PID eq %WAIT_FOR%" /NH /FO CSV 2>nul | find /I "squid-desktop.exe" >nul || goto install +set /a TRIES+=1 +if %TRIES% LSS 100 (ping -n 2 127.0.0.1 >nul & goto waitloop) +:install +set "TARGET=%LOCALAPPDATA%\Programs\Squid\squid-desktop.exe" +for /f "tokens=1,2,*" %%a in ('reg query "HKCU\Software\Squid" /v InstallDirectory 2^>nul ^| find "InstallDirectory"') do set "TARGET=%%c\squid-desktop.exe" +start /wait "" "%INSTALLER%" /S +if errorlevel 1 echo installer exited with %ERRORLEVEL% >> "%LOG%" +if exist "%TARGET%" start "" "%TARGET%" +"#, + pid = pid, + installer = installer.display(), + log = log.display(), + ) +} + +fn spawn_handoff(name: &str, script: &str) -> Result<(), String> { + let path = download_directory().join(name); + if let Some(parent) = path.parent() { + fs::create_dir_all(parent).map_err(|error| error.to_string())?; + } + let _ = fs::remove_file(&path); + fs::write(&path, script).map_err(|error| error.to_string())?; + #[cfg(target_os = "windows")] + let mut command = crate::process::command("cmd.exe"); + #[cfg(target_os = "windows")] + command.args(["/D", "/C", &path.to_string_lossy().to_string()]); + #[cfg(not(target_os = "windows"))] + let mut command = crate::process::command("/bin/sh"); + #[cfg(not(target_os = "windows"))] + command.arg(&path); + command + .spawn() + .map_err(|error| format!("Could not start the updater: {error}"))?; + Ok(()) +} + +fn quit_for_update(app: &AppHandle) { + let app = app.clone(); + thread::spawn(move || { + thread::sleep(Duration::from_millis(600)); + app.exit(0); + }); +} + +fn open_artifact(path: &Path) -> Result<(), String> { + #[cfg(target_os = "macos")] + { + crate::process::command("/usr/bin/open") + .arg(path) + .status() + .map_err(|error| format!("Could not open the update: {error}"))?; + } + #[cfg(target_os = "windows")] + { + crate::process::command("cmd.exe") + .args(["/C", "start", "", &path.to_string_lossy()]) + .status() + .map_err(|error| format!("Could not open the update: {error}"))?; + } + #[cfg(not(any(target_os = "macos", target_os = "windows")))] + { + crate::process::command("xdg-open") + .arg(path) + .status() + .map_err(|error| format!("Could not open the update: {error}"))?; + } + Ok(()) +} + +#[tauri::command] +pub async fn update_install(app: AppHandle) -> Result { + let path = app + .state::() + .status + .lock() + .ok() + .and_then(|guard| guard.as_ref().and_then(|status| status.path.clone())) + .ok_or_else(|| "Download and verify an update first.".to_string())?; + tauri::async_runtime::spawn_blocking(move || { + let artifact = PathBuf::from(&path); + let log = download_directory().join("handoff.log"); + let pid = std::process::id(); + + #[cfg(target_os = "macos")] + { + let exe = std::env::current_exe().map_err(|error| error.to_string())?; + if let Some(bundle) = bundle_path(&exe) { + if !can_replace(&bundle) { + let folder = bundle + .parent() + .map_or_else(|| "its folder".to_string(), |parent| { + parent.to_string_lossy().to_string() + }); + return Err(format!( + "Squid cannot replace itself in {folder}. Open the downloaded installer to update by hand." + )); + } + let script = macos_handoff(pid, &artifact, &bundle, &log); + spawn_handoff("Squid-update.sh", &script)?; + quit_for_update(&app); + return Ok(path); + } + } + #[cfg(target_os = "windows")] + { + let script = windows_handoff(pid, &artifact, &log); + spawn_handoff("Squid-update.cmd", &script)?; + quit_for_update(&app); + return Ok(path); + } + #[cfg(not(any(target_os = "macos", target_os = "windows")))] + { + open_artifact(&artifact)?; + } + #[cfg(target_os = "macos")] + open_artifact(&artifact)?; + Ok(path) + }) + .await + .map_err(|error| format!("Update install failed: {error}"))? +} + +#[tauri::command] +pub fn update_clear(app: AppHandle) { + if let Ok(mut guard) = app.state::().status.lock() { + if let Some(path) = guard.as_ref().and_then(|status| status.path.as_ref()) { + let _ = fs::remove_file(path); + } + *guard = None; + } + let _ = app.emit("update://status", serde_json::Value::Null); +} + +pub fn spawn_startup_check(app: &AppHandle) { + let app = app.clone(); + tauri::async_runtime::spawn(async move { + if manifest_url().is_empty() || !update_check_due(CHECK_INTERVAL) { + return; + } + note_update_check(); + let _ = update_check(app).await; + }); +} + +#[cfg(test)] +mod tests { + use super::*; + use std::sync::Mutex as StdMutex; + + fn feed_guard() -> std::sync::MutexGuard<'static, ()> { + static GUARD: StdMutex<()> = StdMutex::new(()); + GUARD + .lock() + .unwrap_or_else(|poisoned| poisoned.into_inner()) + } + + #[test] + fn semver_releases_outrank_prereleases() { + assert!(version_is_newer("0.2.0", "0.1.9")); + assert!(version_is_newer("0.2.0", "0.2.0-beta.2")); + assert!(!version_is_newer("0.2.0-beta.2", "0.2.0")); + assert!(version_is_newer("0.2.0-beta.10", "0.2.0-beta.2")); + assert!(!version_is_newer("0.2.0+build.9", "0.2.0")); + } + + #[test] + fn the_platform_ladder_never_crosses_operating_systems() { + assert_eq!( + artifact_keys_for("windows", "aarch64"), + vec!["windows-arm64", "windows"] + ); + assert_eq!(artifact_keys_for("macos", "aarch64"), vec!["macos"]); + assert_eq!(artifact_keys_for("windows", "x86_64"), vec!["windows"]); + } + + fn manifest() -> ReleaseManifest { + ReleaseManifest { + schema: 1, + version: "0.2.0".into(), + date: "2026-11-03".into(), + notes: String::new(), + artifacts: BTreeMap::from([ + ( + "windows".into(), + Artifact { + file: "Squid-Setup-0.2.0-win-x64.exe".into(), + sha256: "a".repeat(64), + size: 12, + }, + ), + ( + "windows-arm64".into(), + Artifact { + file: "Squid-Setup-0.2.0-win-arm64.exe".into(), + sha256: "b".repeat(64), + size: 13, + }, + ), + ]), + } + } + + #[test] + fn arm_windows_prefers_its_native_artifact_then_falls_back() { + let mut manifest = manifest(); + let (key, artifact) = select_artifact(&manifest, "windows", "aarch64").unwrap(); + assert_eq!(key, "windows-arm64"); + assert_eq!(artifact.size, 13); + manifest.artifacts.remove("windows-arm64"); + let (key, artifact) = select_artifact(&manifest, "windows", "aarch64").unwrap(); + assert_eq!(key, "windows"); + assert_eq!(artifact.size, 12); + } + + #[test] + fn a_manifest_artifact_cannot_escape_the_update_folder() { + let mut value = serde_json::json!({ + "schema": 1, + "version": "0.2.0", + "date": "2026-11-03", + "notes": "", + "artifacts": { + "macos": { + "file": "../../evil.dmg", + "sha256": "a".repeat(64), + "size": 1 + } + } + }); + assert!(parse_manifest(&serde_json::to_string(&value).unwrap()).is_err()); + value["artifacts"]["macos"]["file"] = serde_json::json!("Squid-0.2.0-macOS-universal.dmg"); + assert!(parse_manifest(&serde_json::to_string(&value).unwrap()).is_ok()); + } + + #[test] + fn a_newer_manifest_schema_is_refused() { + let text = serde_json::to_string(&serde_json::json!({ + "schema": 2, + "version": "9.0.0", + "artifacts": {} + })) + .unwrap(); + assert!(parse_manifest(&text).is_err()); + } + + #[test] + fn the_runtime_override_wins_over_the_baked_feed() { + let _guard = feed_guard(); + std::env::set_var(ENV_MANIFEST_URL, "https://example.test/squid-update.json"); + assert_eq!(manifest_url(), "https://example.test/squid-update.json"); + std::env::remove_var(ENV_MANIFEST_URL); + } +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json new file mode 100644 index 0000000..0f4b40e --- /dev/null +++ b/src-tauri/tauri.conf.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "Squid", + "version": "0.1.3", + "identifier": "app.nex.squid", + "mainBinaryName": "squid-desktop", + "build": { + "beforeDevCommand": "pnpm dev", + "devUrl": "http://localhost:1420", + "beforeBuildCommand": "pnpm build", + "frontendDist": "../dist" + }, + "app": { + "macOSPrivateApi": true, + "windows": [ + { + "label": "main", + "title": "Squid", + "url": "index.html", + "width": 1220, + "height": 800, + "minWidth": 1000, + "minHeight": 680, + "center": true, + "visible": true, + "titleBarStyle": "Overlay", + "hiddenTitle": true, + "acceptFirstMouse": true + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": ["app", "dmg", "nsis"], + "category": "Utility", + "shortDescription": "Clean, uninstall, purge and monitor your Mac or PC.", + "longDescription": "Squid is a cross-platform system care app for macOS and Windows. It scans caches and system junk, removes applications with their leftovers, finds project build artefacts, maps disk usage and monitors live system health.", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "macOS": { + "minimumSystemVersion": "12.0", + "infoPlist": "Info.plist", + "signingIdentity": "-", + "hardenedRuntime": false + }, + "windows": { + "nsis": { + "installMode": "currentUser", + "displayLanguageSelector": false + } + } + } +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..059fccc --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,419 @@ +import { + AppWindow, + ChevronDown, + Eraser, + History, + LayoutDashboard, + RefreshCw, + Settings, + ShieldCheck, + Sparkles, +} from "lucide-react"; +import { useCallback, useEffect, useState, type ReactNode } from "react"; +import { useAppsWorkspace } from "./hooks/useAppsWorkspace"; +import { useScanWorkspace } from "./hooks/useScanWorkspace"; +import { useSystemSnapshot } from "./hooks/useSystemSnapshot"; +import { useUpdateFlow } from "./hooks/useUpdateFlow"; +import { detectLanguage, I18nProvider, useI18n } from "./i18n"; +import { api } from "./lib/api"; +import { messageFrom } from "./lib/format"; +import type { + Bootstrap, + DeleteMode, + Language, + PageId, + SettingsView, +} from "./types"; +import { useToast } from "./components/ui"; +import { SetupPanel } from "./components/SetupPanel"; +import appIconUrl from "../src-tauri/icons/128x128.png"; +import { ApplicationsPage } from "./pages/ApplicationsPage"; +import { CleanupPage } from "./pages/CleanupPage"; +import { HistoryPage } from "./pages/HistoryPage"; +import { OverviewPage } from "./pages/OverviewPage"; +import { PurgePage } from "./pages/PurgePage"; +import { SettingsPage } from "./pages/SettingsPage"; +import { StoragePage } from "./pages/StoragePage"; +import { SystemPage } from "./pages/SystemPage"; + +const NAV_ITEMS: { + id: PageId; + labelEn: string; + labelZh: string; + icon: typeof LayoutDashboard; +}[] = [ + { + id: "overview", + labelEn: "Computer overview", + labelZh: "电脑概览", + icon: LayoutDashboard, + }, + { + id: "cleanup", + labelEn: "Daily cleanup", + labelZh: "日常清理", + icon: Eraser, + }, + { + id: "applications", + labelEn: "Uninstall apps", + labelZh: "应用卸载", + icon: AppWindow, + }, +]; + +const PAGE_TITLES: Record = { + overview: ["Computer overview", "电脑概览"], + cleanup: ["Daily cleanup", "日常清理"], + applications: ["Uninstall apps", "应用卸载"], + purge: ["Deep Clean", "深度清理"], + storage: ["Storage", "存储空间"], + system: ["System", "系统状态"], + history: ["History", "历史记录"], + settings: ["Settings", "设置"], +}; + +function BrandMark({ small = false }: { small?: boolean }) { + return ( + + ); +} + +function LoadingScreen() { + return ( +
+
+ +
+ Squid + Preparing your computer care workspace… +
+ +
+
+ ); +} + +function BootstrapError({ message }: { message: string }) { + return ( +
+
+ +
+ Squid could not start + {message} + +
+ ); +} + +export default function App() { + const { push } = useToast(); + const [bootstrap, setBootstrap] = useState(null); + const [bootError, setBootError] = useState(null); + const [page, setPage] = useState("overview"); + const [lang, setLang] = useState(detectLanguage); + const [settings, setSettings] = useState(null); + const [autoCheck, setAutoCheck] = useState(true); + const [setupOpen, setSetupOpen] = useState(false); + const cleanup = useScanWorkspace("cleanup"); + const purge = useScanWorkspace("purge"); + const apps = useAppsWorkspace(); + const systemActive = page === "overview" || page === "system"; + const system = useSystemSnapshot(systemActive); + const update = useUpdateFlow(bootstrap?.updateFeedUrl ?? "", autoCheck); + + useEffect(() => { + let cancelled = false; + void api + .bootstrap() + .then((next) => { + if (cancelled) return; + setBootstrap(next); + setSettings(next.settings); + setLang(next.language); + setAutoCheck(next.updateCheckEnabled); + setSetupOpen(!next.settings.setupReviewed); + document.documentElement.lang = next.language === "zh" ? "zh-CN" : "en"; + }) + .catch((reason) => { + if (!cancelled) setBootError(messageFrom(reason)); + }); + return () => { + cancelled = true; + }; + }, []); + + useEffect(() => { + let cancelled = false; + let unlisten: (() => void) | null = null; + void api + .onNavigate((next) => { + if (!cancelled) setPage(next); + }) + .then((stop) => { + if (cancelled) stop(); + else unlisten = stop; + }); + return () => { + cancelled = true; + unlisten?.(); + }; + }, []); + + useEffect(() => { + const order: PageId[] = [ + "overview", + "cleanup", + "applications", + "purge", + "storage", + "system", + "history", + "settings", + ]; + const onKey = (event: KeyboardEvent) => { + if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey) return; + const index = Number(event.key) - 1; + if (!Number.isInteger(index) || index < 0 || index >= order.length) return; + event.preventDefault(); + setPage(order[index]); + }; + window.addEventListener("keydown", onKey); + return () => window.removeEventListener("keydown", onKey); + }, []); + + const changeLanguage = useCallback( + async (nextLanguage: Language) => { + setLang(nextLanguage); + document.documentElement.lang = nextLanguage === "zh" ? "zh-CN" : "en"; + try { + const next = await api.settingsSave({ language: nextLanguage }); + setSettings(next); + } catch (reason) { + push(messageFrom(reason), "danger"); + } + }, + [push], + ); + + const changeAutoCheck = useCallback( + (enabled: boolean) => { + setAutoCheck(enabled); + void api + .setUpdateCheckEnabled(enabled) + .catch((reason) => { + setAutoCheck(!enabled); + push(messageFrom(reason), "danger"); + }); + }, + [push], + ); + + const finishSetup = useCallback(async () => { + setSetupOpen(false); + try { + const next = await api.settingsSave({ setupReviewed: true }); + setSettings(next); + } catch (reason) { + push(messageFrom(reason), "danger"); + } + }, [push]); + + if (bootError) return ; + if (!bootstrap || !settings) return ; + + const deleteMode: DeleteMode = settings.deleteMode; + const activeUpdate = + update.status?.state === "available" || update.status?.state === "ready" + ? update.status + : null; + + return ( + + + {page === "overview" ? ( + + ) : null} + {page === "cleanup" ? ( + setPage("history")} + /> + ) : null} + {page === "applications" ? ( + setPage("history")} /> + ) : null} + {page === "purge" ? ( + setPage("history")} + /> + ) : null} + {page === "storage" ? : null} + {page === "system" ? ( + + ) : null} + {page === "history" ? : null} + {page === "settings" ? ( + + ) : null} + + {setupOpen ? void finishSetup()} /> : null} + + ); +} + +function AppChrome({ + bootstrap, + page, + setPage, + updateVersion, + children, +}: { + bootstrap: Bootstrap; + page: PageId; + setPage: (page: PageId) => void; + updateVersion: string | null; + children: ReactNode; +}) { + const { t, lang } = useI18n(); + const title = PAGE_TITLES[page][lang === "zh" ? 1 : 0]; + + return ( +
+ + +
+
+
+ {title} + + {bootstrap.hardware} +
+
+ + + {t("Local & private", "本地与私密")} + + {updateVersion ? ( + + ) : null} +
+
+
+ {children} +
+
+
+ ); +} diff --git a/src/components/CleanupView.tsx b/src/components/CleanupView.tsx new file mode 100644 index 0000000..5b1181b --- /dev/null +++ b/src/components/CleanupView.tsx @@ -0,0 +1,406 @@ +import { + ArrowUpRight, + FolderOpen, + LockKeyhole, + RotateCcw, + ShieldCheck, + Trash2, +} from "lucide-react"; +import { useEffect, useMemo, useState } from "react"; +import { useI18n } from "../i18n"; +import { api } from "../lib/api"; +import { formatBytes, formatCount, shortPath } from "../lib/format"; +import type { Category, CleanupItem, DeleteMode, ScanResult } from "../types"; +import type { ScanWorkspace } from "../hooks/useScanWorkspace"; +import { + Button, + CATEGORY_META, + CATEGORY_ORDER, + CategoryCard, + Checkbox, + ConfirmDialog, + InlineError, + ProgressCard, + ResultSummary, + SectionTitle, + categoryLabel, + lockLabel, + useToast, +} from "./ui"; + +type CategoryGroup = { total: number; count: number; items: number[]; selected: number }; + +function grouped(result: ScanResult) { + const groups = new Map(); + result.items.forEach((item, index) => { + const group = groups.get(item.category) ?? { + total: 0, + count: 0, + items: [], + selected: 0, + }; + group.total += item.onDisk; + group.count += 1; + group.items.push(index); + group.selected += 1; + groups.set(item.category, group); + }); + return groups; +} + +export function CategorySummary({ + result, + selected, + onToggle, + onInspect, +}: { + result: ScanResult; + selected: Set; + onToggle: (category: Category) => void; + onInspect: (category: Category) => void; +}) { + const groups = useMemo(() => grouped(result), [result]); + return ( +
+ {CATEGORY_ORDER.filter((category) => groups.has(category)).map((category) => { + const group = groups.get(category)!; + const indexes = group.items.filter((index) => !result.items[index].lock); + const allSelected = indexes.length > 0 && indexes.every((index) => selected.has(index)); + return ( + onToggle(category)} + onInspect={() => onInspect(category)} + /> + ); + })} +
+ ); +} + +function ItemRow({ + item, + checked, + onToggle, +}: { + item: CleanupItem; + checked: boolean; + onToggle: () => void; +}) { + const { lang, t } = useI18n(); + const Icon = CATEGORY_META[item.category].icon; + return ( +
+ + + + + + + {item.label} + {categoryLabel(item.category, lang)} + + + {shortPath(item.displayPath, 90)} + + {item.lock || item.note ? ( + + {item.lock ? : null} + {item.lock ? lockLabel(item.lock, t) : item.note} + + ) : null} + + {formatBytes(item.onDisk)} + +
+ ); +} + +export function CleanupInventory({ + workspace, + defaultMode, + onHistory, +}: { + workspace: ScanWorkspace; + defaultMode: DeleteMode; + onHistory: () => void; +}) { + const { t, lang, bin } = useI18n(); + const { push } = useToast(); + const [focus, setFocus] = useState(null); + const [confirming, setConfirming] = useState(false); + const [mode, setMode] = useState(defaultMode); + + useEffect(() => setMode(defaultMode), [defaultMode]); + + const result = workspace.result; + const groups = useMemo( + () => (result ? grouped(result) : new Map()), + [result], + ); + const visibleItems = useMemo(() => { + if (!result) return []; + return result.items + .map((item, index) => ({ item, index })) + .filter(({ item }) => !focus || item.category === focus); + }, [focus, result]); + const removables = result?.items.filter((item) => !item.lock).length ?? 0; + + if (workspace.scanning) { + return ( + void workspace.cancel()} + /> + ); + } + + if (workspace.summary) { + return ( + void workspace.runScan()} + onHistory={onHistory} + /> + ); + } + + if (!result) return null; + + const confirm = async () => { + const summary = await workspace.clean(mode); + setConfirming(false); + if (summary) { + push( + t( + `${formatBytes(summary.freedAllocated || summary.freed)} cleaned`, + `已清理 ${formatBytes(summary.freedAllocated || summary.freed)}`, + ), + "success", + ); + } + }; + + return ( + <> +
+
+ + + {t("Scan complete", "扫描完成")} + +

+ {formatBytes(workspace.selectedTotal)} + {t(" ready to clean", " 可安全清理")} +

+

+ {t( + `${formatCount(workspace.selectedCount)} of ${formatCount( + removables, + )} available items selected`, + `已选择 ${formatCount(workspace.selectedCount)} / ${formatCount( + removables, + )} 个可清理项目`, + )} + {result.unreadable > 0 + ? t( + ` · ${formatCount(result.unreadable)} could not be read`, + ` · ${formatCount(result.unreadable)} 项无法读取`, + ) + : ""} +

+
+
+ + +
+
+ + {workspace.error ? ( + + ) : null} + +
+ {CATEGORY_ORDER.filter((category) => groups.has(category)).map((category) => { + const group = groups.get(category); + if (!group) return null; + const indexes = group.items.filter((index) => !result.items[index].lock); + const allSelected = + indexes.length > 0 && indexes.every((index) => workspace.selected.has(index)); + return ( + workspace.toggleCategory(category)} + onInspect={() => setFocus(focus === category ? null : category)} + /> + ); + })} +
+ +
+ setFocus(null)}> + {t("Show all", "显示全部")} + + ) : ( + + ) + } + /> +
+ {visibleItems.map(({ item, index }) => ( + workspace.toggleItem(index)} + /> + ))} +
+
+ +
+
+ {t("Selected for cleanup", "已选择清理")} + {formatBytes(workspace.selectedTotal)} +
+
+ + +
+
+ + + {t( + `${formatCount(workspace.selectedCount)} items · ${formatBytes( + workspace.selectedTotal, + )}`, + `${formatCount(workspace.selectedCount)} 项 · ${formatBytes( + workspace.selectedTotal, + )}`, + )} + + } + note={ + mode === "trash" + ? t( + `Items will move to the ${bin}. You can restore them from History.`, + `文件将移入${bin},之后可从历史记录中还原。`, + ) + : t( + "Permanent removal cannot be undone. Squid re-checks every path before deleting it.", + "永久删除无法撤销。Squid 会在删除前重新检查每一个路径。", + ) + } + confirmLabel={ + mode === "trash" + ? t(`Move to ${bin}`, `移入${bin}`) + : t("Remove permanently", "永久删除") + } + cancelLabel={t("Keep files", "保留文件")} + onConfirm={() => void confirm()} + onClose={() => setConfirming(false)} + busy={workspace.deleting} + icon={} + > +
+ + +
+
+ + ); +} diff --git a/src/components/SetupPanel.tsx b/src/components/SetupPanel.tsx new file mode 100644 index 0000000..c272820 --- /dev/null +++ b/src/components/SetupPanel.tsx @@ -0,0 +1,169 @@ +import { + Check, + LoaderCircle, + LockKeyhole, + RefreshCw, + ShieldCheck, + X, +} from "lucide-react"; +import { useCallback, useEffect, useState } from "react"; +import { useI18n } from "../i18n"; +import { api } from "../lib/api"; +import type { PermissionStatus } from "../types"; +import { Button } from "./ui"; + +type State = "checking" | "granted" | "denied" | "unknown" | "not-required" | "error"; + +const SYSTEM_SETTINGS_COPY = { + en: "System Settings › Privacy & Security › Full Disk Access", + zh: "系统设置 › 隐私与安全性 › 完全磁盘访问权限", +}; + +export function SetupPanel({ onDone }: { onDone: () => void }) { + const { t, lang } = useI18n(); + const [state, setState] = useState("checking"); + + const refresh = useCallback(async () => { + setState("checking"); + try { + const status: PermissionStatus = await api.permissionStatus(); + setState(status.fullDiskAccess); + } catch { + setState("error"); + } + }, []); + + useEffect(() => { + void refresh(); + const onFocus = () => void refresh(); + const onKey = (event: KeyboardEvent) => { + if (event.key === "Escape") onDone(); + }; + window.addEventListener("focus", onFocus); + window.addEventListener("keydown", onKey); + return () => { + window.removeEventListener("focus", onFocus); + window.removeEventListener("keydown", onKey); + }; + }, [onDone, refresh]); + + const checking = state === "checking"; + const ready = state === "granted" || state === "not-required"; + const needsAttention = state === "denied" || state === "unknown" || state === "error"; + const stateLabel = checking + ? t("Checking…", "检查中…") + : ready + ? t("Ready", "已就绪") + : state === "denied" + ? t("Needs you", "需要你处理") + : t("Not confirmed", "未确认"); + const detail = checking + ? t("Reading this Mac's privacy state…", "正在读取这台 Mac 的隐私权限状态…") + : state === "granted" + ? t( + "Squid can include protected app caches and leftovers in its scans.", + "Squid 可以扫描受保护的 App 缓存与卸载残留。", + ) + : state === "not-required" + ? t( + "Windows needs no extra privacy permission for Squid.", + "Windows 上使用 Squid 不需要额外隐私权限。", + ) + : state === "denied" + ? t( + "Optional. Without it Squid still works, but skips protected app data.", + "这是可选项。未授权时 Squid 仍可正常工作,只会跳过受保护的 App 数据。", + ) + : t( + "Open System Settings to review access, then come back and recheck.", + "请到系统设置中确认权限,然后返回重新检查。", + ); + + return ( +
+
+
+ + + +
+
NEX · SQUID
+

{t("Before you start", "开始之前")}

+

+ {t( + "Squid runs entirely on this computer. One optional macOS permission improves scan coverage.", + "Squid 完全在这台电脑上运行。macOS 上有一项可选权限可以提升扫描覆盖范围。", + )} +

+
+
+ +
+ + + +
+ + {t("Full Disk Access", "完全磁盘访问权限")} + + {ready ? : needsAttention ? : null} + {stateLabel} + + + {detail} + {state === "denied" || state === "unknown" || state === "error" ? ( + {SYSTEM_SETTINGS_COPY[lang]} + ) : null} +
+
+ +

+ {t( + "You can skip this now. Permissions and the same check remain available in Settings at any time.", + "现在可以跳过;之后随时都能在设置中检查权限或重新授权。", + )} +

+ +
+
+ + {needsAttention ? ( + + ) : null} +
+
+ + +
+
+
+
+ ); +} diff --git a/src/components/UpdatePanel.tsx b/src/components/UpdatePanel.tsx new file mode 100644 index 0000000..d519e71 --- /dev/null +++ b/src/components/UpdatePanel.tsx @@ -0,0 +1,214 @@ +import { + Check, + Download, + LoaderCircle, + Monitor, + RefreshCw, + Sparkles, + X, +} from "lucide-react"; +import { useI18n } from "../i18n"; +import { formatBytes } from "../lib/format"; +import type { UpdateFlow } from "../hooks/useUpdateFlow"; +import type { Bootstrap } from "../types"; +import { Button, Toggle } from "./ui"; + +function architectureLabel(arch: string): string { + if (arch === "aarch64") return "ARM64"; + if (arch === "x86_64") return "x64"; + return arch; +} + +export function UpdatePanel({ + flow, + autoCheck, + onAutoCheckChange, + bootstrap, +}: { + flow: UpdateFlow; + autoCheck: boolean; + onAutoCheckChange: (enabled: boolean) => void; + bootstrap: Bootstrap; +}) { + const { t } = useI18n(); + const status = flow.status; + const verified = status?.state === "ready"; + const available = status?.state === "available" || verified; + const updateStateLabel = verified + ? t("Downloaded and verified", "已下载并校验") + : t("Update available", "发现新版本"); + const statusError = + status?.message && + (status.state === "error" || status.state === "unavailable") + ? status.message + : null; + + return ( +
+
+
+

+ + {t("Software updates", "软件更新")} +

+

+ {t( + "Check for a new version, then download and verify it before installing.", + "发现新版本后,下载并自动校验,确认无误再安装。", + )} +

+
+ +
+ +
+ + + +
+ {t("Current system", "当前系统")} + + {bootstrap.osName} {bootstrap.osVersion} + +
+
+ {architectureLabel(bootstrap.arch)} + Squid {bootstrap.version} +
+
+ + {available && status ? ( +
+
+ + {updateStateLabel} + + + Squid {status.currentVersion} + + {status.availableVersion} + +
+ {status.date ? : null} +
+ ) : null} + + {available && status?.notes ? ( +

{status.notes}

+ ) : null} + + {flow.percent !== null ? ( +
+
+ + {flow.progress?.state === "verifying" + ? t("Verifying download…", "正在校验下载…") + : t("Downloading update…", "正在下载更新…")} + + {flow.percent}% +
+
+ +
+ + {flow.progress + ? `${formatBytes(flow.progress.downloaded)} / ${formatBytes( + flow.progress.total, + )}` + : ""} + +
+ ) : null} + + {statusError ? ( +
+ {statusError} +
+ ) : null} + {flow.installError ? ( +
+ {flow.installError} +
+ ) : null} + +
+ {available && !verified ? ( + + ) : null} + {verified ? ( + + ) : null} + {verified && !flow.installing ? ( + + ) : null} +
+ +
+
+ {t("Check for updates daily", "每天自动检查更新")} + + {t( + "Checks at most once a day when Squid starts.", + "启动 Squid 时每天最多检查一次。", + )} + +
+ +
+
+ ); +} diff --git a/src/components/ui.tsx b/src/components/ui.tsx new file mode 100644 index 0000000..a8945ae --- /dev/null +++ b/src/components/ui.tsx @@ -0,0 +1,824 @@ +import { + AlertTriangle, + AppWindow, + Boxes, + Check, + ChevronDown, + Code2, + FileWarning, + Globe2, + Languages, + LoaderCircle, + PackageOpen, + Puzzle, + Trash2, + X, +} from "lucide-react"; +import { + createContext, + useCallback, + useContext, + useEffect, + useMemo, + useRef, + useState, + type CSSProperties, + type ReactNode, +} from "react"; +import { useI18n } from "../i18n"; +import { formatBytes, formatCount, percent, shortPath } from "../lib/format"; +import type { Category, JobProgress, LockReason } from "../types"; + +export interface CategoryMeta { + en: string; + zh: string; + blurbEn: string; + blurbZh: string; + icon: typeof Boxes; + tone: string; +} + +export const CATEGORY_META: Record = { + "system-junk": { + en: "System junk", + zh: "系统垃圾", + blurbEn: "Temporary files and system scratch data", + blurbZh: "临时文件与系统缓存", + icon: Trash2, + tone: "blue", + }, + "app-caches": { + en: "App caches", + zh: "应用缓存", + blurbEn: "Caches apps can rebuild", + blurbZh: "应用可自动重建的缓存", + icon: AppWindow, + tone: "cyan", + }, + "browser-caches": { + en: "Browser caches", + zh: "浏览器缓存", + blurbEn: "Web content and offline data", + blurbZh: "网页内容与离线数据", + icon: Globe2, + tone: "violet", + }, + logs: { + en: "Logs & reports", + zh: "日志与报告", + blurbEn: "Rotated logs and crash reports", + blurbZh: "旧日志与崩溃报告", + icon: FileWarning, + tone: "orange", + }, + developer: { + en: "Developer files", + zh: "开发文件", + blurbEn: "Simulators, archives and tool caches", + blurbZh: "模拟器、归档与工具缓存", + icon: Code2, + tone: "indigo", + }, + "project-artifacts": { + en: "Build artefacts", + zh: "构建产物", + blurbEn: "Regenerable project build folders", + blurbZh: "可重新生成的构建目录", + icon: PackageOpen, + tone: "teal", + }, + trash: { + en: "Trash", + zh: "废纸篓", + blurbEn: "Files waiting to be emptied", + blurbZh: "等待清空的文件", + icon: Trash2, + tone: "slate", + }, + "language-packs": { + en: "Language packs", + zh: "语言包", + blurbEn: "Unused voice and localisation data", + blurbZh: "未使用的语音与本地化数据", + icon: Languages, + tone: "pink", + }, + leftovers: { + en: "Leftovers", + zh: "卸载残留", + blurbEn: "Data left by removed applications", + blurbZh: "已删除应用留下的数据", + icon: Puzzle, + tone: "amber", + }, +}; + +export const CATEGORY_ORDER = Object.keys(CATEGORY_META) as Category[]; + +export function categoryLabel(category: Category, language: "zh" | "en"): string { + return language === "zh" ? CATEGORY_META[category].zh : CATEGORY_META[category].en; +} + +export function lockLabel( + lock: LockReason | null, + t: (en: string, zh: string) => string, +): string { + if (!lock) return ""; + switch (lock) { + case "app-running": + return t("App is running", "应用正在运行"); + case "shared-with-other-install": + return t("Shared with another install", "与其他安装共用"); + case "whitelisted": + return t("Protected by you", "已加入保护名单"); + case "not-owned": + return t("Needs administrator rights", "需要管理员权限"); + case "protected": + return t("Protected by the safety policy", "受安全策略保护"); + } +} + +export function PageHeader({ + eyebrow, + title, + description, + actions, +}: { + eyebrow?: string; + title: string; + description: string; + actions?: ReactNode; +}) { + return ( +
+
+ {eyebrow ?
{eyebrow}
: null} +

{title}

+

{description}

+
+ {actions ?
{actions}
: null} +
+ ); +} + +export function Button({ + children, + variant = "secondary", + size = "md", + icon, + className = "", + ...props +}: React.ButtonHTMLAttributes & { + variant?: "primary" | "secondary" | "ghost" | "danger"; + size?: "sm" | "md" | "lg"; + icon?: ReactNode; +}) { + return ( + + ); +} + +export function IconButton({ + label, + children, + className = "", + ...props +}: React.ButtonHTMLAttributes & { label: string }) { + return ( + + ); +} + +export function Toggle({ + checked, + onChange, + disabled, + label, +}: { + checked: boolean; + onChange: (next: boolean) => void; + disabled?: boolean; + label: string; +}) { + return ( + + ); +} + +export function Checkbox({ + checked, + indeterminate = false, + disabled = false, + onChange, + label, +}: { + checked: boolean; + indeterminate?: boolean; + disabled?: boolean; + onChange: () => void; + label: string; +}) { + return ( + + ); +} + +export function ProgressCard({ + progress, + title, + onCancel, + compact = false, +}: { + progress: JobProgress | null; + title: string; + onCancel?: () => void; + compact?: boolean; +}) { + const { t, lang } = useI18n(); + const phase = useMemo(() => { + if (!progress?.phase) return title; + const labels: Record = { + match: ["Finding candidates", "正在查找可清理项目"], + measure: ["Measuring sizes", "正在计算大小"], + purge: ["Searching for build artefacts", "正在查找构建产物"], + verify: ["Checking Git and file ages", "正在核对 Git 与文件年龄"], + delete: ["Removing approved items", "正在删除已确认项目"], + apps: ["Reading installed applications", "正在读取已安装应用"], + plan: ["Finding application leftovers", "正在查找应用残留"], + storage: ["Measuring folders", "正在测量文件夹"], + files: ["Finding the largest files", "正在查找大文件"], + orphans: ["Finding unused leftovers", "正在查找孤立残留"], + }; + const pair = labels[progress.phase]; + return pair ? (lang === "zh" ? pair[1] : pair[0]) : title; + }, [lang, progress?.phase, t, title]); + const denominator = progress?.total ?? 0; + const done = progress?.done ?? 0; + const ratio = + denominator > 0 ? Math.min(100, Math.max(0, (done / denominator) * 100)) : null; + const detail = progress?.detail || progress?.subject || ""; + + return ( +
+ +
+
+ {phase} + {denominator > 0 ? ( + + {formatCount(done)} / {formatCount(denominator)} + + ) : null} +
+
+ +
+
+ {detail || t("Working safely in the background…", "正在后台安全处理…")} +
+
+ {onCancel ? ( + + ) : null} +
+ ); +} + +export function InlineError({ + message, + onDismiss, +}: { + message: string; + onDismiss?: () => void; +}) { + const { t } = useI18n(); + return ( +
+ + {message} + {onDismiss ? ( + + + + ) : null} +
+ ); +} + +export function Modal({ + open, + onClose, + title, + subtitle, + children, + footer, + size = "md", + tone = "default", + dismissible = true, +}: { + open: boolean; + onClose: () => void; + title: ReactNode; + subtitle?: ReactNode; + children: ReactNode; + footer?: ReactNode; + size?: "sm" | "md" | "lg" | "drawer"; + tone?: "default" | "danger" | "success"; + dismissible?: boolean; +}) { + const { t } = useI18n(); + const panel = useRef(null); + + useEffect(() => { + if (!open) return; + const onKey = (event: KeyboardEvent) => { + if (event.key === "Escape" && dismissible) onClose(); + }; + document.addEventListener("keydown", onKey); + const timer = window.setTimeout(() => { + panel.current?.querySelector( + "button:not([disabled]), input:not([disabled]), select:not([disabled])", + )?.focus(); + }, 30); + return () => { + document.removeEventListener("keydown", onKey); + window.clearTimeout(timer); + }; + }, [dismissible, onClose, open]); + + if (!open) return null; + return ( +
{ + if (event.target === event.currentTarget && dismissible) onClose(); + }} + > +
+
+
+

{title}

+ {subtitle ?

{subtitle}

: null} +
+ {dismissible ? ( + + + + ) : null} +
+
{children}
+ {footer ?
{footer}
: null} +
+
+ ); +} + +export function ConfirmDialog({ + open, + title, + message, + note, + confirmLabel, + cancelLabel, + tone = "danger", + icon, + onConfirm, + onClose, + busy = false, + children, +}: { + open: boolean; + title: string; + message: ReactNode; + note?: ReactNode; + confirmLabel: string; + cancelLabel: string; + tone?: "danger" | "default"; + icon?: ReactNode; + onConfirm: () => void; + onClose: () => void; + busy?: boolean; + children?: ReactNode; +}) { + return ( + + + + + } + > +
+
{icon ?? }
+
+
{message}
+ {note ?
{note}
: null} +
+
+ {children ?
{children}
: null} +
+ ); +} + +export function Gauge({ + value, + size = 160, + stroke = 12, + tone = "blue", + children, + label, +}: { + value: number; + size?: number; + stroke?: number; + tone?: "blue" | "green" | "orange" | "violet" | "red"; + children?: ReactNode; + label?: string; +}) { + const normalized = Math.max(0, Math.min(100, value)); + const radius = (size - stroke) / 2; + const circumference = Math.PI * 2 * radius; + return ( +
+ + + + +
{children}
+
+ ); +} + +export function MetricBar({ + value, + tone = "blue", +}: { + value: number; + tone?: "blue" | "green" | "orange" | "violet" | "red"; +}) { + return ( +
+ +
+ ); +} + +export function EmptyState({ + icon, + title, + description, + action, +}: { + icon: ReactNode; + title: string; + description: string; + action?: ReactNode; +}) { + return ( +
+
{icon}
+

{title}

+

{description}

+ {action} +
+ ); +} + +export function SectionTitle({ + title, + subtitle, + action, +}: { + title: string; + subtitle?: string; + action?: ReactNode; +}) { + return ( +
+
+

{title}

+ {subtitle ?

{subtitle}

: null} +
+ {action} +
+ ); +} + +export function CategoryCard({ + category, + total, + count, + selected, + disabled, + onToggle, + onInspect, + focused = false, +}: { + category: Category; + total: number; + count: number; + selected: boolean; + disabled?: boolean; + onToggle: () => void; + onInspect: () => void; + focused?: boolean; +}) { + const { lang, t } = useI18n(); + const meta = CATEGORY_META[category]; + const Icon = meta.icon; + return ( +
+
+ + + + +
+
+ {categoryLabel(category, lang)} + {lang === "zh" ? meta.blurbZh : meta.blurbEn} +
+
+ {formatBytes(total)} + +
+
+ ); +} + +type ToastTone = "default" | "success" | "danger"; +interface ToastItem { + id: number; + message: string; + tone: ToastTone; +} + +const ToastContext = createContext<{ + push: (message: string, tone?: ToastTone) => void; +} | null>(null); + +export function ToastProvider({ children }: { children: ReactNode }) { + const [toasts, setToasts] = useState([]); + const sequence = useRef(0); + + const remove = useCallback((id: number) => { + setToasts((current) => current.filter((toast) => toast.id !== id)); + }, []); + + const push = useCallback( + (message: string, tone: ToastTone = "default") => { + const id = ++sequence.current; + setToasts((current) => [...current.slice(-3), { id, message, tone }]); + window.setTimeout(() => remove(id), 4200); + }, + [remove], + ); + + return ( + + {children} +
+ {toasts.map((toast) => ( +
+ {toast.tone === "success" ? : null} + {toast.tone === "danger" ? : null} + {toast.message} + +
+ ))} +
+
+ ); +} + +export function useToast() { + const value = useContext(ToastContext); + if (!value) throw new Error("useToast must be used inside ToastProvider"); + return value; +} + +export function ResultSummary({ + removed, + freed, + failed, + mode, + onAgain, + onHistory, +}: { + removed: number; + freed: number; + failed: number; + mode: string | null; + onAgain: () => void; + onHistory: () => void; +}) { + const { t, lang, bin } = useI18n(); + return ( +
+ +
+ {t("Cleanup complete", "清理完成")} +

+ {t( + `${formatBytes(freed)} reclaimed`, + `已释放 ${formatBytes(freed)}`, + )} +

+

+ {t( + `${formatCount(removed)} items removed${ + failed > 0 ? ` · ${failed} could not be removed` : "" + }.`, + `已处理 ${formatCount(removed)} 项${ + failed > 0 ? ` · ${failed} 项未能删除` : "" + }。`, + )} + {mode === "trash" + ? t( + ` Items are in the ${bin} and can still be restored from History.`, + ` 文件已移入${bin},可在历史记录中还原。`, + ) + : ""} +

+
+
+ + +
+
+ ); +} + +export function PathRow({ + path, + note, + size, + selected, + disabled, + onToggle, + onReveal, +}: { + path: string; + note?: string | null; + size: number; + selected: boolean; + disabled: boolean; + onToggle: () => void; + onReveal: () => void; +}) { + const { t, lang } = useI18n(); + return ( +
+ +
+ + {shortPath(path, 78)} + + {note ? ( + {note} + ) : null} +
+ {formatBytes(size)} + + + +
+ ); +} + +export function UsageBar({ + used, + total, + tone = "blue", +}: { + used: number; + total: number; + tone?: "blue" | "green" | "orange" | "violet" | "red"; +}) { + return ( +
+ +
+ ); +} diff --git a/src/hooks/useAppsWorkspace.ts b/src/hooks/useAppsWorkspace.ts new file mode 100644 index 0000000..39834f7 --- /dev/null +++ b/src/hooks/useAppsWorkspace.ts @@ -0,0 +1,216 @@ +import { useCallback, useMemo, useState } from "react"; +import { api, subscribeJobProgress } from "../lib/api"; +import { isCancelled, messageFrom } from "../lib/format"; +import type { + AppInfo, + DeleteMode, + DeleteResult, + JobProgress, + PlanResult, +} from "../types"; + +function jobId(): string { + return crypto.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`; +} + +export interface AppsWorkspace { + apps: AppInfo[]; + total: number; + scanned: boolean; + scanning: boolean; + planning: boolean; + deleting: boolean; + progress: JobProgress | null; + error: string | null; + selectedApp: AppInfo | null; + plan: PlanResult | null; + planSelected: Set; + summary: DeleteResult | null; + planSelectedTotal: number; + scan: () => Promise; + chooseApp: (app: AppInfo | null) => void; + buildPlan: (app: AppInfo) => Promise; + togglePlanItem: (index: number) => void; + togglePlanAll: () => void; + uninstall: (mode: DeleteMode) => Promise; + cancel: () => Promise; + resetPlan: () => void; + clearError: () => void; + clearSummary: () => void; +} + +export function useAppsWorkspace(): AppsWorkspace { + const [apps, setApps] = useState([]); + const [total, setTotal] = useState(0); + const [scanned, setScanned] = useState(false); + const [scanning, setScanning] = useState(false); + const [planning, setPlanning] = useState(false); + const [deleting, setDeleting] = useState(false); + const [progress, setProgress] = useState(null); + const [error, setError] = useState(null); + const [selectedApp, setSelectedApp] = useState(null); + const [plan, setPlan] = useState(null); + const [planSelected, setPlanSelected] = useState>(new Set()); + const [summary, setSummary] = useState(null); + const [activeJob, setActiveJob] = useState(null); + + const scan = useCallback(async () => { + if (scanning || deleting) return; + const id = jobId(); + setActiveJob(id); + setScanning(true); + setError(null); + setSummary(null); + const stop = await subscribeJobProgress(id, setProgress); + try { + const result = await api.appsScan(id); + setApps(result.apps); + setTotal(result.total); + setScanned(true); + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + } finally { + stop(); + setScanning(false); + setProgress(null); + setActiveJob(null); + } + }, [deleting, scanning]); + + const chooseApp = useCallback((app: AppInfo | null) => { + setSelectedApp(app); + setPlan(null); + setPlanSelected(new Set()); + }, []); + + const buildPlan = useCallback( + async (app: AppInfo) => { + if (planning) return; + const id = jobId(); + setActiveJob(id); + setPlanning(true); + setSelectedApp(app); + setPlan(null); + setError(null); + const stop = await subscribeJobProgress(id, setProgress); + try { + const next = await api.appPlan(id, app.bundle_id || app.path); + setPlan(next); + setPlanSelected( + new Set( + next.items + .map((item, index) => ({ item, index })) + .filter(({ item }) => item.selected && !item.lock) + .map(({ index }) => index), + ), + ); + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + } finally { + stop(); + setPlanning(false); + setProgress(null); + setActiveJob(null); + } + }, + [planning], + ); + + const togglePlanItem = useCallback((index: number) => { + setPlanSelected((current) => { + const next = new Set(current); + if (next.has(index)) next.delete(index); + else next.add(index); + return next; + }); + }, []); + + const togglePlanAll = useCallback(() => { + if (!plan) return; + setPlanSelected((current) => { + const all = plan.items + .map((item, index) => ({ item, index })) + .filter(({ item }) => !item.lock) + .map(({ index }) => index); + if (all.length > 0 && all.every((index) => current.has(index))) return new Set(); + return new Set(all); + }); + }, [plan]); + + const planSelectedTotal = useMemo(() => { + if (!plan) return 0; + let total = 0; + for (const index of planSelected) total += plan.items[index]?.onDisk ?? 0; + return total; + }, [plan, planSelected]); + + const uninstall = useCallback( + async (mode: DeleteMode) => { + if (!plan || planSelected.size === 0 || deleting) return null; + const id = jobId(); + setActiveJob(id); + setDeleting(true); + setError(null); + const stop = await subscribeJobProgress(id, setProgress); + try { + const result = await api.appUninstall(id, plan.planId, [...planSelected], mode); + setSummary(result); + setApps((current) => + current.filter( + (app) => + (app.bundle_id || app.path) !== + (plan.app.bundle_id || plan.app.path), + ), + ); + setPlan(null); + setPlanSelected(new Set()); + setSelectedApp(null); + return result; + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + return null; + } finally { + stop(); + setDeleting(false); + setProgress(null); + setActiveJob(null); + } + }, + [deleting, plan, planSelected], + ); + + const cancel = useCallback(async () => { + if (activeJob) await api.cancelJob(activeJob).catch(() => false); + }, [activeJob]); + + const resetPlan = useCallback(() => { + setPlan(null); + setPlanSelected(new Set()); + }, []); + + return { + apps, + total, + scanned, + scanning, + planning, + deleting, + progress, + error, + selectedApp, + plan, + planSelected, + summary, + planSelectedTotal, + scan, + chooseApp, + buildPlan, + togglePlanItem, + togglePlanAll, + uninstall, + cancel, + resetPlan, + clearError: () => setError(null), + clearSummary: () => setSummary(null), + }; +} diff --git a/src/hooks/useScanWorkspace.ts b/src/hooks/useScanWorkspace.ts new file mode 100644 index 0000000..0dd1f01 --- /dev/null +++ b/src/hooks/useScanWorkspace.ts @@ -0,0 +1,226 @@ +import { useCallback, useMemo, useRef, useState } from "react"; +import { api, subscribeJobProgress } from "../lib/api"; +import { isCancelled, messageFrom } from "../lib/format"; +import type { + Category, + DeleteMode, + DeleteResult, + JobProgress, + ScanResult, +} from "../types"; + +function jobId(): string { + return crypto.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`; +} + +export type ScanKind = "cleanup" | "purge"; + +export interface ScanWorkspace { + kind: ScanKind; + result: ScanResult | null; + selected: Set; + progress: JobProgress | null; + scanning: boolean; + deleting: boolean; + error: string | null; + summary: DeleteResult | null; + currentJob: string | null; + selectedTotal: number; + selectedCount: number; + runScan: (options?: { + force?: boolean; + minAgeDays?: number | null; + roots?: string[]; + }) => Promise; + cancel: () => Promise; + toggleItem: (index: number) => void; + toggleCategory: (category: Category) => void; + selectAll: () => void; + clearSelection: () => void; + clean: (mode: DeleteMode) => Promise; + clearError: () => void; + reset: () => void; +} + +export function useScanWorkspace(kind: ScanKind): ScanWorkspace { + const [result, setResult] = useState(null); + const [selected, setSelected] = useState>(new Set()); + const [progress, setProgress] = useState(null); + const [scanning, setScanning] = useState(false); + const [deleting, setDeleting] = useState(false); + const [error, setError] = useState(null); + const [summary, setSummary] = useState(null); + const [currentJob, setCurrentJob] = useState(null); + const activeJob = useRef(null); + + const runScan = useCallback( + async (options?: { + force?: boolean; + minAgeDays?: number | null; + roots?: string[]; + }) => { + if (scanning || deleting) return; + const id = jobId(); + activeJob.current = id; + setCurrentJob(id); + setScanning(true); + setError(null); + setSummary(null); + setProgress(null); + const stop = await subscribeJobProgress(id, setProgress); + try { + const next = + kind === "cleanup" + ? await api.cleanupScan(id, [], options?.minAgeDays ?? null, false) + : await api.purgeScan( + id, + options?.roots ?? [], + options?.minAgeDays ?? null, + options?.force ?? false, + ); + if (activeJob.current !== id) return; + setResult(next); + setSelected( + new Set( + next.items + .map((item, index) => ({ item, index })) + .filter(({ item }) => item.selected && !item.lock) + .map(({ index }) => index), + ), + ); + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + } finally { + stop(); + if (activeJob.current === id) { + setScanning(false); + setProgress(null); + setCurrentJob(null); + } + } + }, + [deleting, kind, scanning], + ); + + const cancel = useCallback(async () => { + if (activeJob.current) await api.cancelJob(activeJob.current).catch(() => false); + }, []); + + const toggleItem = useCallback((index: number) => { + setSelected((current) => { + const next = new Set(current); + if (next.has(index)) next.delete(index); + else next.add(index); + return next; + }); + }, []); + + const toggleCategory = useCallback( + (category: Category) => { + if (!result) return; + const indexes = result.items + .map((item, index) => ({ item, index })) + .filter(({ item }) => item.category === category && !item.lock) + .map(({ index }) => index); + setSelected((current) => { + const next = new Set(current); + const allSelected = indexes.length > 0 && indexes.every((index) => next.has(index)); + for (const index of indexes) { + if (allSelected) next.delete(index); + else next.add(index); + } + return next; + }); + }, + [result], + ); + + const selectAll = useCallback(() => { + if (!result) return; + setSelected((current) => { + const all = result.items + .map((item, index) => ({ item, index })) + .filter(({ item }) => !item.lock) + .map(({ index }) => index); + if (all.length > 0 && all.every((index) => current.has(index))) return new Set(); + return new Set(all); + }); + }, [result]); + + const clearSelection = useCallback(() => setSelected(new Set()), []); + + const selectedTotal = useMemo(() => { + if (!result) return 0; + let total = 0; + for (const index of selected) total += result.items[index]?.onDisk ?? 0; + return total; + }, [result, selected]); + + const selectedCount = selected.size; + + const clean = useCallback( + async (mode: DeleteMode) => { + if (!result || selected.size === 0 || deleting) return null; + const id = jobId(); + activeJob.current = id; + setCurrentJob(id); + setDeleting(true); + setError(null); + setProgress(null); + const stop = await subscribeJobProgress(id, setProgress); + try { + const next = + kind === "cleanup" + ? await api.cleanupDelete(id, result.scanId, [...selected], mode) + : await api.purgeDelete(id, result.scanId, [...selected], mode); + if (activeJob.current !== id) return null; + setResult(null); + setSelected(new Set()); + setSummary(next); + return next; + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + return null; + } finally { + stop(); + if (activeJob.current === id) { + setDeleting(false); + setProgress(null); + setCurrentJob(null); + } + } + }, + [deleting, kind, result, selected], + ); + + const reset = useCallback(() => { + setResult(null); + setSelected(new Set()); + setSummary(null); + setError(null); + setProgress(null); + }, []); + + return { + kind, + result, + selected, + progress, + scanning, + deleting, + error, + summary, + currentJob, + selectedTotal, + selectedCount, + runScan, + cancel, + toggleItem, + toggleCategory, + selectAll, + clearSelection, + clean, + clearError: () => setError(null), + reset, + }; +} diff --git a/src/hooks/useStorageWorkspace.ts b/src/hooks/useStorageWorkspace.ts new file mode 100644 index 0000000..73299f5 --- /dev/null +++ b/src/hooks/useStorageWorkspace.ts @@ -0,0 +1,103 @@ +import { useCallback, useRef, useState } from "react"; +import { api, subscribeJobProgress } from "../lib/api"; +import { isCancelled, messageFrom } from "../lib/format"; +import type { JobProgress, LargestFile, StorageNode } from "../types"; + +function jobId(): string { + return crypto.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`; +} + +export interface StorageWorkspace { + node: StorageNode | null; + files: LargestFile[]; + progress: JobProgress | null; + exploring: boolean; + scanningFiles: boolean; + error: string | null; + explore: (path?: string | null) => Promise; + largestFiles: (path: string) => Promise; + cancel: () => Promise; + clearError: () => void; + clearFiles: () => void; +} + +export function useStorageWorkspace(): StorageWorkspace { + const [node, setNode] = useState(null); + const [files, setFiles] = useState([]); + const [progress, setProgress] = useState(null); + const [exploring, setExploring] = useState(false); + const [scanningFiles, setScanningFiles] = useState(false); + const [error, setError] = useState(null); + const activeJob = useRef(null); + + const explore = useCallback(async (path?: string | null) => { + if (exploring || scanningFiles) return; + const id = jobId(); + activeJob.current = id; + setExploring(true); + setError(null); + setProgress(null); + setFiles([]); + const stop = await subscribeJobProgress(id, setProgress); + try { + const next = await api.storageExplore(id, path ?? null, 1, 16); + if (activeJob.current !== id) return; + setNode(next); + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + } finally { + stop(); + if (activeJob.current === id) { + setExploring(false); + setProgress(null); + activeJob.current = null; + } + } + }, [exploring, scanningFiles]); + + const largestFiles = useCallback( + async (path: string) => { + if (exploring || scanningFiles) return; + const id = jobId(); + activeJob.current = id; + setScanningFiles(true); + setError(null); + setProgress(null); + setFiles([]); + const stop = await subscribeJobProgress(id, setProgress); + try { + const next = await api.storageLargestFiles(id, path, 40); + if (activeJob.current !== id) return; + setFiles(next); + } catch (reason) { + if (!isCancelled(reason)) setError(messageFrom(reason)); + } finally { + stop(); + if (activeJob.current === id) { + setScanningFiles(false); + setProgress(null); + activeJob.current = null; + } + } + }, + [exploring, scanningFiles], + ); + + const cancel = useCallback(async () => { + if (activeJob.current) await api.cancelJob(activeJob.current).catch(() => false); + }, []); + + return { + node, + files, + progress, + exploring, + scanningFiles, + error, + explore, + largestFiles, + cancel, + clearError: () => setError(null), + clearFiles: () => setFiles([]), + }; +} diff --git a/src/hooks/useSystemSnapshot.ts b/src/hooks/useSystemSnapshot.ts new file mode 100644 index 0000000..58593a2 --- /dev/null +++ b/src/hooks/useSystemSnapshot.ts @@ -0,0 +1,35 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { api } from "../lib/api"; +import { messageFrom } from "../lib/format"; +import type { SystemSnapshot } from "../types"; + +export function useSystemSnapshot(active: boolean, intervalMs = 1800) { + const [snapshot, setSnapshot] = useState(null); + const [error, setError] = useState(null); + const [loading, setLoading] = useState(false); + const inFlight = useRef(false); + + const refresh = useCallback(async () => { + if (inFlight.current) return; + inFlight.current = true; + setLoading(true); + try { + setSnapshot(await api.systemSnapshot()); + setError(null); + } catch (reason) { + setError(messageFrom(reason)); + } finally { + inFlight.current = false; + setLoading(false); + } + }, []); + + useEffect(() => { + if (!active) return; + void refresh(); + const timer = window.setInterval(() => void refresh(), intervalMs); + return () => window.clearInterval(timer); + }, [active, intervalMs, refresh]); + + return { snapshot, error, loading, refresh }; +} diff --git a/src/hooks/useUpdateFlow.ts b/src/hooks/useUpdateFlow.ts new file mode 100644 index 0000000..811a2a0 --- /dev/null +++ b/src/hooks/useUpdateFlow.ts @@ -0,0 +1,145 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { api } from "../lib/api"; +import { messageFrom } from "../lib/format"; +import type { UpdateProgress, UpdateStatus } from "../types"; + +export interface UpdateFlow { + status: UpdateStatus | null; + checking: boolean; + downloading: boolean; + installing: boolean; + installError: string | null; + progress: UpdateProgress | null; + percent: number | null; + check: () => Promise; + download: () => Promise; + install: () => Promise; + clear: () => Promise; +} + +export function useUpdateFlow(feedUrl: string, autoCheck = true): UpdateFlow { + const [status, setStatus] = useState(null); + const [checking, setChecking] = useState(false); + const [downloading, setDownloading] = useState(false); + const [installing, setInstalling] = useState(false); + const [installError, setInstallError] = useState(null); + const [progress, setProgress] = useState(null); + const [percent, setPercent] = useState(null); + const mounted = useRef(true); + const statusRef = useRef(null); + + const publish = useCallback((next: UpdateStatus | null) => { + statusRef.current = next; + if (mounted.current) setStatus(next); + }, []); + + const check = useCallback(async () => { + if (checking) return; + setChecking(true); + try { + const outcome = await api.updateCheck(); + publish(outcome.status); + } catch { + publish(await api.updateStatus().catch(() => null)); + } finally { + if (mounted.current) setChecking(false); + } + }, [checking, publish]); + + const download = useCallback(async () => { + if (downloading) return; + setDownloading(true); + setInstallError(null); + setProgress(null); + setPercent(null); + try { + const ready = await api.updateDownload(); + publish(ready); + } catch (error) { + if (mounted.current) setInstallError(messageFrom(error)); + publish(await api.updateStatus().catch(() => null)); + } finally { + if (mounted.current) { + setDownloading(false); + setProgress(null); + setPercent(null); + } + } + }, [downloading, publish]); + + const install = useCallback(async () => { + if (installing || !statusRef.current?.path) return; + setInstalling(true); + try { + await api.updateInstall(); + } catch (error) { + if (mounted.current) { + setInstallError(messageFrom(error)); + setInstalling(false); + } + } + }, [installing]); + + const clear = useCallback(async () => { + setInstallError(null); + await api.updateClear().catch(() => undefined); + publish(null); + }, [publish]); + + useEffect(() => { + mounted.current = true; + void api + .updateStatus() + .then((last) => { + if (last) publish(last); + }) + .catch(() => undefined); + const unlisteners: (() => void)[] = []; + void api + .onUpdateProgress((next) => { + if (!mounted.current) return; + setProgress(next); + setPercent( + next.total > 0 + ? Math.min(100, Math.round((next.downloaded / next.total) * 100)) + : null, + ); + }) + .then((stop) => unlisteners.push(stop)); + void api + .onUpdateStatus((next) => { + if (!mounted.current) return; + statusRef.current = next; + setStatus(next); + }) + .then((stop) => unlisteners.push(stop)); + return () => { + mounted.current = false; + unlisteners.forEach((stop) => stop()); + }; + }, [publish]); + + useEffect(() => { + if (!feedUrl || !autoCheck) return; + // A startup check runs in Rust. This is a quiet fallback for builds whose + // first check is due but whose event was emitted before the webview mounted. + const timer = window.setTimeout(() => { + if (!statusRef.current) void check(); + }, 1200); + return () => window.clearTimeout(timer); + }, [autoCheck, check, feedUrl]); + + return { + status, + checking, + downloading, + installing, + installError, + progress, + percent, + check, + download, + install, + clear, + }; +} diff --git a/src/i18n.tsx b/src/i18n.tsx new file mode 100644 index 0000000..6763299 --- /dev/null +++ b/src/i18n.tsx @@ -0,0 +1,44 @@ +import { createContext, useContext, type ReactNode } from "react"; +import type { Language } from "./types"; + +interface I18nValue { + lang: Language; + setLang: (language: Language) => void; + t: (en: string, zh: string) => string; + bin: string; + binLower: string; + currency: string; +} + +const I18nContext = createContext(null); + +export function I18nProvider({ + lang, + setLang, + children, +}: { + lang: Language; + setLang: (language: Language) => void; + children: ReactNode; +}) { + const value: I18nValue = { + lang, + setLang, + t: (en, zh) => (lang === "zh" ? zh : en), + bin: lang === "zh" ? "废纸篓" : "Trash", + binLower: lang === "zh" ? "废纸篓" : "trash", + currency: lang === "zh" ? "zh-CN" : "en-US", + }; + return {children}; +} + +export function useI18n(): I18nValue { + const value = useContext(I18nContext); + if (!value) throw new Error("useI18n must be used inside I18nProvider"); + return value; +} + +export function detectLanguage(): Language { + const candidate = navigator.language || "en"; + return candidate.toLowerCase().startsWith("zh") ? "zh" : "en"; +} diff --git a/src/lib/api.ts b/src/lib/api.ts new file mode 100644 index 0000000..e7cb36f --- /dev/null +++ b/src/lib/api.ts @@ -0,0 +1,98 @@ +import { invoke } from "@tauri-apps/api/core"; +import { listen, type UnlistenFn } from "@tauri-apps/api/event"; +import type { + AppsResult, + Bootstrap, + DeleteMode, + DeleteResult, + HistorySession, + JobProgress, + LargestFile, + PageId, + PermissionStatus, + PlanResult, + ScanResult, + SettingsView, + StorageNode, + SystemSnapshot, + UndoResult, + UpdateCheckResult, + UpdateProgress, + UpdateStatus, +} from "../types"; + +export interface SettingsPatch { + deleteMode?: DeleteMode; + language?: string; + showAllocated?: boolean; + purgeMinAgeDays?: number; + historyKeep?: number; + setupReviewed?: boolean; +} + +export const api = { + bootstrap: () => invoke("bootstrap"), + cancelJob: (jobId: string) => invoke("cancel_job", { jobId }), + cleanupScan: ( + jobId: string, + categories: string[] = [], + minAgeDays: number | null = null, + orphans = false, + ) => + invoke("cleanup_scan", { + jobId, + categories, + minAgeDays, + orphans, + }), + cleanupDelete: (jobId: string, scanId: string, selected: number[], mode: DeleteMode) => + invoke("cleanup_delete", { jobId, scanId, selected, mode }), + purgeScan: (jobId: string, roots: string[] = [], minAgeDays: number | null = null, force = false) => + invoke("purge_scan", { jobId, roots, minAgeDays, force }), + purgeDelete: (jobId: string, scanId: string, selected: number[], mode: DeleteMode) => + invoke("purge_delete", { jobId, scanId, selected, mode }), + appsScan: (jobId: string) => invoke("apps_scan", { jobId }), + appPlan: (jobId: string, appKey: string) => invoke("app_plan", { jobId, appKey }), + appUninstall: (jobId: string, planId: string, selected: number[], mode: DeleteMode) => + invoke("app_uninstall", { jobId, planId, selected, mode }), + storageExplore: (jobId: string, path?: string | null, depth = 1, top = 16) => + invoke("storage_explore", { jobId, path, depth, top }), + storageLargestFiles: (jobId: string, path: string, limit = 40) => + invoke("storage_largest_files", { jobId, path, limit }), + systemSnapshot: () => invoke("system_snapshot"), + stopProcess: (process: SystemSnapshot["top_processes"][number]) => + invoke("stop_process", { process }), + historyList: (limit = 60) => invoke("history_list", { limit }), + historyUndo: (sessionId: string) => invoke("history_undo", { sessionId }), + settingsSave: (patch: SettingsPatch) => invoke("settings_save", { patch }), + whitelistAdd: (path: string) => invoke("whitelist_add", { path }), + whitelistRemove: (pattern: string) => invoke("whitelist_remove", { pattern }), + revealPath: (path: string) => invoke("reveal_path", { path }), + openTrash: () => invoke("open_trash"), + permissionStatus: () => invoke("permission_status"), + openFullDiskAccessSettings: () => invoke("open_full_disk_access_settings"), + updateCheck: () => invoke("update_check"), + updateStatus: () => invoke("update_status"), + updateDownload: () => invoke("update_download"), + updateInstall: () => invoke("update_install"), + updateClear: () => invoke("update_clear"), + setUpdateCheckEnabled: (enabled: boolean) => + invoke("set_update_check_enabled", { enabled }), + onProgress: (handler: (progress: JobProgress) => void) => + listen("squid://progress", (event) => handler(event.payload)), + onUpdateProgress: (handler: (progress: UpdateProgress) => void) => + listen("update://progress", (event) => handler(event.payload)), + onUpdateStatus: (handler: (status: UpdateStatus | null) => void) => + listen("update://status", (event) => handler(event.payload)), + onNavigate: (handler: (page: PageId) => void) => + listen("squid://navigate", (event) => handler(event.payload)), +}; + +export async function subscribeJobProgress( + jobId: string, + handler: (progress: JobProgress) => void, +): Promise { + return api.onProgress((progress) => { + if (progress.jobId === jobId) handler(progress); + }); +} diff --git a/src/lib/format.ts b/src/lib/format.ts new file mode 100644 index 0000000..41e1526 --- /dev/null +++ b/src/lib/format.ts @@ -0,0 +1,84 @@ +export function formatBytes(value: number, fractionDigits = 1): string { + if (!Number.isFinite(value) || value <= 0) return "0 B"; + const units = ["B", "KB", "MB", "GB", "TB", "PB"]; + let remaining = value; + let unit = 0; + while (remaining >= 1000 && unit < units.length - 1) { + remaining /= 1000; + unit += 1; + } + if (unit === 0) return `${Math.round(remaining)} B`; + const digits = remaining >= 100 ? 0 : fractionDigits; + return `${remaining.toFixed(digits)} ${units[unit]}`; +} + +export function formatBytesExact(value: number): string { + if (value <= 0) return "0 B"; + const formatted = formatBytes(value, 2); + return `${formatted} (${Math.round(value).toLocaleString()} bytes)`; +} + +export function formatRate(value: number): string { + return `${formatBytes(value)}/s`; +} + +export function formatCount(value: number): string { + return Math.max(0, Math.round(value)).toLocaleString(); +} + +export function formatDate(iso: string, language: "zh" | "en"): string { + const date = new Date(iso); + if (Number.isNaN(date.getTime())) return iso; + return new Intl.DateTimeFormat(language === "zh" ? "zh-CN" : "en-US", { + month: "short", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + }).format(date); +} + +export function formatUptime(seconds: number, language: "zh" | "en"): string { + const days = Math.floor(seconds / 86_400); + const hours = Math.floor((seconds % 86_400) / 3_600); + const minutes = Math.floor((seconds % 3_600) / 60); + if (language === "zh") { + if (days > 0) return `${days} 天 ${hours} 小时`; + if (hours > 0) return `${hours} 小时 ${minutes} 分钟`; + return `${minutes} 分钟`; + } + if (days > 0) return `${days}d ${hours}h`; + if (hours > 0) return `${hours}h ${minutes}m`; + return `${minutes}m`; +} + +export function percent(part: number, total: number): number { + if (!Number.isFinite(part) || !Number.isFinite(total) || total <= 0) return 0; + return Math.max(0, Math.min(100, (part / total) * 100)); +} + +export function shortPath(path: string, length = 48): string { + if (path.length <= length) return path; + const head = Math.max(8, Math.floor(length * 0.35)); + const tail = Math.max(10, length - head - 1); + return `${path.slice(0, head)}…${path.slice(-tail)}`; +} + +export function basename(path: string): string { + const pieces = path.split(/[\\/]/).filter(Boolean); + return pieces[pieces.length - 1] || path; +} + +export function messageFrom(error: unknown): string { + if (typeof error === "string") return error; + if (error instanceof Error) return error.message; + try { + return JSON.stringify(error); + } catch { + return String(error); + } +} + +export function isCancelled(error: unknown): boolean { + const text = messageFrom(error).toLowerCase(); + return text.includes("cancel") || text.includes("取消"); +} diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..b0227a4 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,13 @@ +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App"; +import { ToastProvider } from "./components/ui"; +import "./styles.css"; + +ReactDOM.createRoot(document.getElementById("root")!).render( + + + + + , +); diff --git a/src/pages/ApplicationsPage.tsx b/src/pages/ApplicationsPage.tsx new file mode 100644 index 0000000..719a5af --- /dev/null +++ b/src/pages/ApplicationsPage.tsx @@ -0,0 +1,392 @@ +import { + AppWindow, + ChevronRight, + FolderOpen, + PackageX, + Play, + Search, + ShieldCheck, + Trash2, +} from "lucide-react"; +import { useMemo, useState } from "react"; +import { useI18n } from "../i18n"; +import { formatBytes, formatCount, shortPath } from "../lib/format"; +import type { AppInfo, DeleteMode } from "../types"; +import type { AppsWorkspace } from "../hooks/useAppsWorkspace"; +import { + Button, + Checkbox, + ConfirmDialog, + EmptyState, + InlineError, + PageHeader, + ProgressCard, + ResultSummary, + categoryLabel, + lockLabel, + useToast, +} from "../components/ui"; + +function AppRow({ + app, + selected, + onSelect, +}: { + app: AppInfo; + selected: boolean; + onSelect: () => void; +}) { + const { t } = useI18n(); + const letter = app.name.trim().slice(0, 1).toUpperCase() || "?"; + return ( + + ); +} +export function ApplicationsPage({ + workspace, + onHistory, +}: { + workspace: AppsWorkspace; + onHistory: () => void; +}) { + const { t, lang, bin } = useI18n(); + const { push } = useToast(); + const [query, setQuery] = useState(""); + const [confirming, setConfirming] = useState(false); + const [mode, setMode] = useState("trash"); + + const apps = useMemo(() => { + const needle = query.trim().toLowerCase(); + if (!needle) return workspace.apps; + return workspace.apps.filter( + (app) => + app.name.toLowerCase().includes(needle) || + app.bundle_id?.toLowerCase().includes(needle) || + app.publisher?.toLowerCase().includes(needle), + ); + }, [query, workspace.apps]); + + const uninstall = async () => { + const result = await workspace.uninstall(mode); + setConfirming(false); + if (result) { + push( + t( + `${result.removed} items removed`, + `已移除 ${result.removed} 个项目`, + ), + result.failed > 0 ? "danger" : "success", + ); + } + }; + + return ( +
+ } + onClick={() => void workspace.scan()} + disabled={workspace.scanning || workspace.deleting} + > + {workspace.scanned ? t("Scan again", "重新扫描") : t("Find applications", "查找应用")} + + } + /> + + {workspace.error ? ( + + ) : null} + + {workspace.scanning ? ( + void workspace.cancel()} + /> + ) : null} + + {workspace.summary && !workspace.scanning ? ( + void workspace.scan()} + onHistory={onHistory} + /> + ) : null} + + {workspace.scanned && !workspace.scanning && !workspace.summary ? ( +
+
+
+
+

{t("Installed applications", "已安装应用")}

+

+ {t( + `${formatCount(workspace.apps.length)} apps · ${formatBytes( + workspace.total, + )}`, + `${formatCount(workspace.apps.length)} 个应用 · ${formatBytes( + workspace.total, + )}`, + )} +

+
+ +
+
+ {apps.map((app) => ( + void workspace.buildPlan(app)} + /> + ))} + {apps.length === 0 ? ( +
+ + {t("No application matches that search.", "没有匹配的应用。")} +
+ ) : null} +
+
+ + +
+ ) : null} + + {!workspace.scanned && !workspace.scanning ? ( + } + title={t("See what is installed", "查看已安装的应用")} + description={t( + "Scan your applications to remove an app completely, including files that would otherwise stay behind.", + "扫描应用后可连同原本会遗留的文件一起移除。", + )} + action={ + + } + /> + ) : null} + + setConfirming(false)} + onConfirm={() => void uninstall()} + busy={workspace.deleting} + icon={} + > +
+ + +
+
+ + {workspace.deleting ? ( +
+ +
+ ) : null} +
+ ); +} diff --git a/src/pages/CleanupPage.tsx b/src/pages/CleanupPage.tsx new file mode 100644 index 0000000..e2ac163 --- /dev/null +++ b/src/pages/CleanupPage.tsx @@ -0,0 +1,84 @@ +import { ScanSearch, Sparkles } from "lucide-react"; +import { useI18n } from "../i18n"; +import { formatBytes } from "../lib/format"; +import type { DeleteMode } from "../types"; +import type { ScanWorkspace } from "../hooks/useScanWorkspace"; +import { CleanupInventory } from "../components/CleanupView"; +import { Button, EmptyState, PageHeader } from "../components/ui"; + +export function CleanupPage({ + workspace, + deleteMode, + onHistory, +}: { + workspace: ScanWorkspace; + deleteMode: DeleteMode; + onHistory: () => void; +}) { + const { t } = useI18n(); + return ( +
+ } + onClick={() => void workspace.runScan()} + disabled={workspace.scanning || workspace.deleting} + > + {t("Scan again", "重新扫描")} + + ) : null + } + /> + + {workspace.error && !workspace.scanning ? ( +
{workspace.error}
+ ) : null} + + + + {!workspace.result && !workspace.scanning && !workspace.summary ? ( + } + title={t("Ready when you are", "随时可以开始")} + description={t( + "Squid checks known cache and log locations, measures what can be reclaimed, and locks anything it cannot remove safely.", + "Squid 会检查已知缓存与日志位置,统计可释放空间,并锁定任何无法安全删除的项目。", + )} + action={ + + } + /> + ) : null} + + {workspace.result && workspace.selectedTotal > 0 ? ( +

+ + {t( + `${formatBytes(workspace.selectedTotal)} selected. Nothing is removed until you confirm.`, + `已选择 ${formatBytes(workspace.selectedTotal)},在您确认前不会删除任何内容。`, + )} + +

+ ) : null} +
+ ); +} diff --git a/src/pages/HistoryPage.tsx b/src/pages/HistoryPage.tsx new file mode 100644 index 0000000..7d9d5d8 --- /dev/null +++ b/src/pages/HistoryPage.tsx @@ -0,0 +1,286 @@ +import { + ChevronDown, + Clock3, + ExternalLink, + FolderOpen, + History, + RotateCcw, + Trash2, +} from "lucide-react"; +import { useEffect, useMemo, useState } from "react"; +import { useI18n } from "../i18n"; +import { api } from "../lib/api"; +import { + formatBytes, + formatCount, + formatDate, + messageFrom, + shortPath, +} from "../lib/format"; +import type { HistorySession } from "../types"; +import { + Button, + ConfirmDialog, + EmptyState, + InlineError, + PageHeader, + useToast, +} from "../components/ui"; + +export function HistoryPage() { + const { t, lang, bin } = useI18n(); + const { push } = useToast(); + const [sessions, setSessions] = useState([]); + const [error, setError] = useState(null); + const [loading, setLoading] = useState(true); + const [expanded, setExpanded] = useState(null); + const [restore, setRestore] = useState(null); + const [restoring, setRestoring] = useState(false); + + const load = async () => { + setLoading(true); + try { + setSessions(await api.historyList(100)); + setError(null); + } catch (reason) { + setError(messageFrom(reason)); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + void load(); + // The history page has no live source; load once when it opens. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const totalKept = useMemo( + () => + sessions.reduce( + (sum, session) => + sum + (session.restored ? 0 : session.allocated_freed || session.logical_freed), + 0, + ), + [sessions], + ); + + const undo = async () => { + if (!restore) return; + setRestoring(true); + try { + const result = await api.historyUndo(restore.id); + push( + t( + `${result.restored} items restored${result.skipped ? `, ${result.skipped} skipped` : ""}`, + `已还原 ${result.restored} 项${result.skipped ? `,${result.skipped} 项跳过` : ""}`, + ), + result.restored > 0 ? "success" : "danger", + ); + setRestore(null); + await load(); + } catch (reason) { + push(messageFrom(reason), "danger"); + } finally { + setRestoring(false); + } + }; + + return ( +
+ } + onClick={() => void api.openTrash().catch((reason) => push(messageFrom(reason), "danger"))} + > + {t(`Open ${bin}`, `打开${bin}`)} + + } + /> + + {error ? : null} + + {sessions.length > 0 ? ( +
+
+ {t("Space kept clean", "当前已释放")} + {formatBytes(totalKept)} +
+
+ {t("Cleanup sessions", "清理记录")} + {formatCount(sessions.length)} +
+
+ {t("Restorable sessions", "可还原记录")} + + {formatCount( + sessions.filter( + (session) => session.mode === "trash" && !session.restored, + ).length, + )} + +
+
+ ) : null} + + {loading ? ( +
+ + {t("Reading cleanup history…", "正在读取清理历史…")} +
+ ) : sessions.length === 0 ? ( + } + title={t("No cleanups yet", "还没有清理记录")} + description={t( + "Each confirmed cleanup will appear here with its size, result and restore option.", + "每次确认的清理都会记录在这里,并提供大小、结果与还原选项。", + )} + /> + ) : ( +
+ {sessions.map((session) => { + const bytes = session.allocated_freed || session.logical_freed; + const canRestore = + session.mode === "trash" && + !session.restored && + session.entries.some((entry) => entry.trash_path); + const isOpen = expanded === session.id; + return ( +
+ + + {isOpen ? ( +
+
+ + {t( + `${session.entries.length} ledger entries`, + `${session.entries.length} 条记录`, + )} + + {canRestore ? ( + + ) : null} +
+
+ {session.entries.slice(0, 40).map((entry, index) => ( +
+ + + {shortPath(entry.path, 78)} + + {entry.category || entry.kind} + {entry.trash_path + ? ` · ${t("in Trash", "位于废纸篓")}` + : ""} + + + {formatBytes(entry.allocated || entry.logical)} + +
+ ))} +
+
+ ) : null} +
+ ); + })} +
+ )} + + setRestore(null)} + onConfirm={() => void undo()} + busy={restoring} + tone="default" + icon={} + /> +
+ ); +} diff --git a/src/pages/OverviewPage.tsx b/src/pages/OverviewPage.tsx new file mode 100644 index 0000000..12c0b55 --- /dev/null +++ b/src/pages/OverviewPage.tsx @@ -0,0 +1,311 @@ +import { + AppWindow, + ArrowRight, + Boxes, + ChevronRight, + CircleGauge, + HardDrive, + ScanSearch, + Sparkles, + WandSparkles, +} from "lucide-react"; +import { useI18n } from "../i18n"; +import { formatBytes, formatCount, percent } from "../lib/format"; +import type { Bootstrap, SystemSnapshot } from "../types"; +import type { ScanWorkspace } from "../hooks/useScanWorkspace"; +import type { PageId } from "../types"; +import { CategorySummary } from "../components/CleanupView"; +import { + Button, + Gauge, + PageHeader, + ProgressCard, + SectionTitle, + UsageBar, +} from "../components/ui"; + +function greeting(lang: "zh" | "en"): string { + const hour = new Date().getHours(); + if (lang === "zh") { + if (hour < 6) return "夜深了"; + if (hour < 12) return "早上好"; + if (hour < 18) return "下午好"; + return "晚上好"; + } + if (hour < 12) return "Good morning"; + if (hour < 18) return "Good afternoon"; + return "Good evening"; +} + +export function OverviewPage({ + bootstrap, + snapshot, + cleanup, + onNavigate, +}: { + bootstrap: Bootstrap; + snapshot: SystemSnapshot | null; + cleanup: ScanWorkspace; + onNavigate: (page: PageId) => void; +}) { + const { t, lang } = useI18n(); + const volume = + snapshot?.volumes.find((candidate) => candidate.is_root) ?? snapshot?.volumes[0] ?? null; + const used = volume ? volume.total - volume.free : 0; + const usedPercent = volume ? percent(used, volume.total) : 0; + const memoryPercent = snapshot + ? percent(snapshot.memory.used, snapshot.memory.total) + : 0; + const found = cleanup.result + ? cleanup.result.items + .filter((item) => !item.lock) + .reduce((sum, item) => sum + item.onDisk, 0) + : 0; + + return ( +
+ } + onClick={() => { + if (cleanup.result) onNavigate("cleanup"); + else void cleanup.runScan(); + }} + disabled={cleanup.scanning} + > + {cleanup.result + ? t("Review scan", "查看扫描结果") + : t("Smart scan", "智能扫描")} + + } + /> + +
+
+
+ + {t("Smart Care", "智能维护")} +
+

+ {cleanup.result + ? t( + `${formatBytes(found)} found safely.`, + `安全发现 ${formatBytes(found)} 可清理空间。`, + ) + : t("A lighter, faster machine.", "更轻盈,更顺畅。")} +

+

+ {cleanup.result + ? t( + "Review each category before anything is removed. Locked files stay untouched.", + "清理前可逐项检查,锁定文件始终不会被处理。", + ) + : t( + "Squid looks for rebuildable caches, old logs and build leftovers without touching your documents.", + "Squid 会查找可重建的缓存、旧日志与构建残留,不会触碰您的文档。", + )} +

+
+ + +
+
+ {t("Local only", "仅在本地")} + {t("Policy checked", "安全策略校验")} + {t("Undo available", "支持还原")} +
+
+ +
+
+ 85 ? "red" : "blue"}> + {t("Disk in use", "磁盘已用")} + {Math.round(usedPercent)}% + + {volume + ? t( + `${formatBytes(volume.free)} free`, + `剩余 ${formatBytes(volume.free)}`, + ) + : t("Reading volume…", "正在读取磁盘…")} + + +
+ + {bootstrap.hardware} +
+
+
+ + {cleanup.scanning ? ( + void cleanup.cancel()} + /> + ) : null} + + {cleanup.result && !cleanup.scanning ? ( +
+ onNavigate("cleanup")}> + {t("Open cleanup", "打开清理")} + + + } + /> + onNavigate("cleanup")} + /> +
+ ) : null} + +
+ +
+ + + +
+
+ +
+
+
+ + + +
+ {t("Processor", "处理器")} + + {snapshot + ? `${snapshot.cpu.logical_cores} ${t("cores", "核心")}` + : t("Sampling…", "正在采样…")} + +
+ {Math.round(snapshot?.cpu.total ?? 0)}% +
+ + + {snapshot?.cpu.brand || t("Processor details unavailable", "暂无处理器信息")} + +
+
+
+ + + +
+ {t("Memory", "内存")} + + {snapshot + ? `${formatBytes(snapshot.memory.used)} / ${formatBytes( + snapshot.memory.total, + )}` + : t("Sampling…", "正在采样…")} + +
+ {Math.round(memoryPercent)}% +
+ + + {snapshot + ? t( + `${formatCount(snapshot.processes)} processes running`, + `${formatCount(snapshot.processes)} 个进程正在运行`, + ) + : t("Reading activity", "正在读取活动")} + +
+
+
+ + + +
+ {t("Storage", "存储空间")} + + {volume + ? `${formatBytes(volume.free)} ${t("available", "可用")}` + : t("Reading volume…", "正在读取磁盘…")} + +
+ {Math.round(usedPercent)}% +
+ 85 ? "red" : "green"} + /> + {volume?.mount_point || bootstrap.configPath} +
+
+
+ ); +} diff --git a/src/pages/PurgePage.tsx b/src/pages/PurgePage.tsx new file mode 100644 index 0000000..abaebb3 --- /dev/null +++ b/src/pages/PurgePage.tsx @@ -0,0 +1,150 @@ +import { + AlertTriangle, + FolderSearch, + GitBranch, + ScanSearch, + ShieldAlert, +} from "lucide-react"; +import { useState } from "react"; +import { useI18n } from "../i18n"; +import type { Bootstrap, DeleteMode } from "../types"; +import type { ScanWorkspace } from "../hooks/useScanWorkspace"; +import { CleanupInventory } from "../components/CleanupView"; +import { Button, PageHeader, Toggle } from "../components/ui"; + +export function PurgePage({ + workspace, + bootstrap, + deleteMode, + onHistory, +}: { + workspace: ScanWorkspace; + bootstrap: Bootstrap; + deleteMode: DeleteMode; + onHistory: () => void; +}) { + const { t } = useI18n(); + const [roots, setRoots] = useState(bootstrap.settings.purgeRoots.join("\n")); + const [minAge, setMinAge] = useState(bootstrap.settings.purgeMinAgeDays); + const [force, setForce] = useState(false); + + const run = () => + void workspace.runScan({ + roots: roots + .split(/\r?\n/) + .map((root) => root.trim()) + .filter(Boolean), + minAgeDays: minAge > 0 ? minAge : null, + force, + }); + + return ( +
+ } onClick={run}> + {t("Start deep scan", "开始深度扫描")} + + } + /> + +
+
+ +