Skip to content

armgit / Wake

Public Imported from GitHub
0

All your AI agent sessions in one place — browse, search, resume. Rust + GPUI.

Rust

Release v0.2.10: add Qoder and updates

Corey Chiuee8623d28a36
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0e0521f..801628d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,6 +39,10 @@ jobs:
- name: Test wake-core
run: cargo test -p wake-core
- # UI 层无测试套件(gpui),编译通过即门槛
+ # UI crate 内不启动窗口的纯逻辑单测;联网测试标为 ignored
+ - name: Test app logic
+ run: cargo test -p wake
+
+ # GPUI 窗口层仍以三平台编译通过为门槛
- name: Build app
run: cargo build -p wake
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a01f87..acea992 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,12 @@
## Unreleased
+## [0.2.10] — 2026-08-26
+
- New: Qoder CLI support — sessions under `~/.qoder/projects` are searchable, branch-aware, and resumable with `qoder --resume`; `QODER_CONFIG_DIR` and custom locations are supported
+- New: Settings has a dedicated Updates page that checks the latest GitHub Release on demand and opens the release page when an update is available; the macOS Wake menu can start the same check
+- Update: the View Update action now uses a taller primary button so available releases are easier to spot
+- Fix: update checks run outside GPUI's async runtime instead of getting stuck at Checking
## [0.2.9] — 2026-08-25
diff --git a/Cargo.lock b/Cargo.lock
index dee0991..9875490 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6804,7 +6804,7 @@ dependencies = [
[[package]]
name = "wake"
-version = "0.2.9"
+version = "0.2.10"
dependencies = [
"anyhow",
"chrono",
@@ -6812,15 +6812,17 @@ dependencies = [
"futures",
"gpui",
"gpui-component",
+ "semver",
"serde",
"serde_json",
"wake-core",
"winresource",
+ "zed-reqwest",
]
[[package]]
name = "wake-core"
-version = "0.2.9"
+version = "0.2.10"
dependencies = [
"anyhow",
"chrono",
@@ -7976,6 +7978,7 @@ dependencies = [
"base64",
"bytes",
"encoding_rs",
+ "futures-channel",
"futures-core",
"futures-util",
"h2",
diff --git a/Cargo.toml b/Cargo.toml
index e482958..94ab5fa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/wake-core", "crates/wake"]
[workspace.package]
-version = "0.2.9"
+version = "0.2.10"
edition = "2021"
license = "MIT"
@@ -17,6 +17,8 @@ walkdir = "2"
notify = "7"
chrono = { version = "0.4", features = ["serde"] }
zstd = "0.13"
+semver = "1"
+reqwest = { package = "zed-reqwest", version = "0.12.15-zed", default-features = false, features = ["blocking", "json", "rustls-tls-native-roots"] }
[profile.dev]
# gpui 依赖树巨大,dev 依赖开优化让 UI 不卡
diff --git a/DESIGN.md b/DESIGN.md
index 684c811..d9274c0 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -134,7 +134,7 @@ macOS 不设置横跨三栏的自定义 header。系统交通灯保留在侧栏
- 行内容 = 行首元素 + 标题 + 计数;计数一律 Label 档 muted。
- 组头 "Agents"/"Projects" 用 Body 档常规字重 + muted 色(与主导航同字号同字重,仅靠颜色和"无行首图标"区分——加粗会让组头压过它统辖的行),带 13px chevron 可折叠。
- 底部工具条常驻,顶部 hairline 分隔,按钮靠右排列(次要操作区:透明底、hover 才出色,不与导航行选中态抢注意力)——左为齿轮 "Settings",右为 refresh。Settings 同时进入 Wake 菜单并绑定 `⌘,`(其他平台 `Ctrl+,`),保持单例窗口。
-- Settings 采用固定窄侧栏 + 内容页结构,固定为 General / Locations / Data / About 四项;About 与功能设置分离并钉在侧栏底部,Wake 菜单的 About Wake 直达同一页。About 沿用 Kooky/Birth 的信息顺序:产品图标、名称、版本、tagline、GitHub、短分隔线、版权/许可证与作者署名。内部文字按钮统一沿用主界面的 24px 高、6px 圆角和主题交互色,页面动作一律使用 muted 填充 + hairline;高饱和 primary 只留给确认弹窗里的最终提交,不在轻量设置页标题区抢注意力。Appearance 分段选择器也使用同一材质。General 只放真实可用的全局偏好,当前为持久化的 System / Light / Dark 外观选择;不提供默认 “Open In” 终端。Data 只展示 Wake 本地存储位置、会话数与磁盘占用并提供文件管理器入口,不重复放刷新或清库动作;常规 Refresh 的唯一入口仍是主侧栏底部。Locations 页按 AgentId 声明序以 agent 分组,品牌名只在组头出现一次;本机有数据的组优先,未检测到的 agent 默认收进可展开区。每条路径以路径为主信息、会话数/不可用状态为 muted 副信息,最右为逐路径开关;停用行整体降噪,不再重复显示 Disabled badge。行本身不承担编辑,`…` 菜单集中 Edit / Show in Finder / 自定义 Remove。顶部操作为低强调的 Add location,Restore defaults 收进页级 `…` 菜单且无偏离时禁用。添加/编辑仍复用 agent 下拉 + 可手输路径 + 目录选择表单;关闭 location 后保留配置、停止扫描/监听并从会话与搜索结果排除,重新开启即增量扫回;纯路径管理不做内容校验。
+- Settings 采用固定窄侧栏 + 内容页结构,固定为 General / Locations / Data / Updates / About 五项;About 与功能设置分离并钉在侧栏底部,Wake 菜单的 About Wake 直达同一页。About 沿用 Kooky/Birth 的信息顺序:产品图标、名称、版本、tagline、GitHub、短分隔线、版权/许可证与作者署名。Updates 是独立功能页,仅在用户点击页面按钮或 macOS Wake 菜单的 Check for Updates 时读取 GitHub 最新正式 Release 元数据,明确呈现检查中/最新版/有新版/失败四种状态;有新版时打开 Release 页供用户下载,不后台检查、不自行覆盖应用包。内部常规文字按钮统一沿用主界面的 24px 高、6px 圆角和主题交互色,普通页面动作使用 muted 填充 + hairline;发现新版后的 View Update 是需要用户继续完成的主操作,使用 32px 高 primary 填充和轻阴影。Appearance 分段选择器也使用同一材质。General 只放真实可用的全局偏好,当前为持久化的 System / Light / Dark 外观选择;不提供默认 “Open In” 终端。Data 只展示 Wake 本地存储位置、会话数与磁盘占用并提供文件管理器入口,不重复放刷新或清库动作;常规 Refresh 的唯一入口仍是主侧栏底部。Locations 页按 AgentId 声明序以 agent 分组,品牌名只在组头出现一次;本机有数据的组优先,未检测到的 agent 默认收进可展开区。每条路径以路径为主信息、会话数/不可用状态为 muted 副信息,最右为逐路径开关;停用行整体降噪,不再重复显示 Disabled badge。行本身不承担编辑,`…` 菜单集中 Edit / Show in Finder / 自定义 Remove。顶部操作为低强调的 Add location,Restore defaults 收进页级 `…` 菜单且无偏离时禁用。添加/编辑仍复用 agent 下拉 + 可手输路径 + 目录选择表单;关闭 location 后保留配置、停止扫描/监听并从会话与搜索结果排除,重新开启即增量扫回;纯路径管理不做内容校验。
- 工具条内的**状态行"常态沉默"**:仅刷新中或监听不可用时出现在按钮行上方;文案须可 truncate,窄侧栏放不下长句(故为 "Live updates off" 而非带操作建议的整句)。
- 不把项目包装成卡片,不堆叠分支、时间或重复图标。项目行不加彩色标识——同一图标重复十几次不传递信息。
diff --git a/PRODUCT.md b/PRODUCT.md
index a9fcffc..a78d0d1 100644
--- a/PRODUCT.md
+++ b/PRODUCT.md
@@ -12,7 +12,7 @@ Rust + gpui 0.2 + gpui-component 0.5(用户既定,workspace: crates/wake-core
## Users
-Corey 本人(独立开发者,主力工具 Claude Code 与 Codex,中文为主)。已开源(2026-08-18 v0.1.0 首发,当前 v0.2.9 2026-08-25,github.com/iAmCorey/Wake,MIT):面向同时使用多个 coding agent 的开发者。
+Corey 本人(独立开发者,主力工具 Claude Code 与 Codex,中文为主)。已开源(2026-08-18 v0.1.0 首发,当前 v0.2.10 2026-08-26,github.com/iAmCorey/Wake,MIT):面向同时使用多个 coding agent 的开发者。
## Product Purpose
@@ -20,7 +20,7 @@ Corey 本人(独立开发者,主力工具 Claude Code 与 Codex,中文为主)。
## Positioning
-唯一以"本地文件为唯一事实源"的多 agent 会话管理器:全程只读原始数据、零网络请求、索引可随时重建;竞品要么单一 agent 要么云端。
+唯一以"本地文件为唯一事实源"的多 agent 会话管理器:全程只读原始数据、无后台网络请求、索引可随时重建;仅在用户于 Updates 页或 macOS Wake 菜单主动检查更新时读取 Wake 的公开 GitHub Release 元数据,不发送任何会话数据。竞品要么单一 agent 要么云端。
## Operating Context
@@ -28,13 +28,13 @@ Corey 本人(独立开发者,主力工具 Claude Code 与 Codex,中文为主)。
## Capabilities and Constraints
-已实现:十四家 adapter、FTS5 trigram 搜索(<3 码点 LIKE 降级)、**搜索跳转定位**(2026-08-18:⌘K 命中直达详情页对应消息并高亮,seq 契约保证)、详情页逐消息渲染(气泡/工具折叠簇/thinking/tree-sitter 高亮;2026-08-17 由整篇 markdown 方案升级)、恢复/收藏/置顶/导出/删除(废纸篓+墓碑)、文件监听增量、测试套件(adapter 契约、DB 往返、scanner 回归 + CI 三平台 + pre-commit,合成 fixture)、三端桌面(macOS 主平台;Linux/Windows experimental,终端恢复/废纸篓·回收站/剪贴板按平台原生实现,发版 CI 自动出六产物)。
+已实现:十四家 adapter、FTS5 trigram 搜索(<3 码点 LIKE 降级)、**搜索跳转定位**(2026-08-18:⌘K 命中直达详情页对应消息并高亮,seq 契约保证)、详情页逐消息渲染(气泡/工具折叠簇/thinking/tree-sitter 高亮;2026-08-17 由整篇 markdown 方案升级)、恢复/收藏/置顶/导出/删除(废纸篓+墓碑)、文件监听增量、Updates 页与 macOS Wake 菜单手动检查 GitHub 最新正式版并打开 Release 页更新(不后台联网、不自动替换应用包)、测试套件(adapter 契约、DB 往返、scanner 回归 + CI 三平台 + pre-commit,合成 fixture)、三端桌面(macOS 主平台;Linux/Windows experimental,终端恢复/废纸篓·回收站/剪贴板按平台原生实现,发版 CI 自动出六产物)。
约束:对 agent 数据目录只读;绝不写 Codex 的 SQLite;不读凭证;GPUI 无 SF Symbols(图标用 lucide SVG 自备)。
已支持十四家 agent:Claude Code、Codex、Qoder CLI(`~/.qoder/projects` JSONL,active-leaf 分支恢复、tool result 回挂、`QODER_CONFIG_DIR`)、Copilot CLI、Cursor(CLI transcripts)、OpenCode(含 OpenCode 2 next,stable 的 `opencode.db` 与 next 的 `opencode-next.db` 同时扫描;逐会话兼容 `message+part`、真实 `session+session_message` 及早期 `session_v2` schema;preview 会话标 opencode2 徽章)、Kiro、Gemini CLI(2026-08-17 P1 五家落地)+ Pi、Oh My Pi、Grok Build、Kimi Code、Antigravity CLI(2026-08-19 对齐 kooky 内置 roster;Antigravity 正文加密仅元数据卡片)+ DeepSeek Harness(dsh,2026-08-20,zstd 事件日志透明解压;格式由源码推断,当天用户跑出真实会话完成首验)。做不了的:Cursor IDE chats 正文加密,Windsurf/Trae 加密,Amp/Factory(Droid)/Warp 云端无本地数据,Reasonix 本机零会话格式未实测。
## Brand Commitments
-名称 Wake(2026-08-14 由 Vibex 更名;取「船迹」——agent 驶过的痕迹,兼「唤醒」恢复会话之意)。界面语言英文(2026-08-14 由中文切换,用户反馈中文 UI 词汇观感生硬)。视觉基准(用户 2026-08-14 确认):现代 macOS 原生规范,工艺对标 Things / Bear(优雅轻盈的原生感);支持跟随系统或固定浅/深外观。agent 品牌色作为功能性识别色保留(Claude 橙 #D97757、Codex 绿 #12A06B 等,见 models.rs)。Session locations 自 0.2.9 起归入独立 Settings 窗口,主界面只保留齿轮入口;Settings 固定为 General / Locations / Data / About,不提供默认 “Open In” 终端选择。
+名称 Wake(2026-08-14 由 Vibex 更名;取「船迹」——agent 驶过的痕迹,兼「唤醒」恢复会话之意)。界面语言英文(2026-08-14 由中文切换,用户反馈中文 UI 词汇观感生硬)。视觉基准(用户 2026-08-14 确认):现代 macOS 原生规范,工艺对标 Things / Bear(优雅轻盈的原生感);支持跟随系统或固定浅/深外观。agent 品牌色作为功能性识别色保留(Claude 橙 #D97757、Codex 绿 #12A06B 等,见 models.rs)。Session locations 自 0.2.9 起归入独立 Settings 窗口,主界面只保留齿轮入口;Settings 固定为 General / Locations / Data / Updates / About,不提供默认 “Open In” 终端选择。
## Evidence on Hand
diff --git a/README.md b/README.md
index c408483..6cb5492 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
A native desktop app that gathers every coding-agent session on your machine into one place — browse, full-text search, and resume any conversation in seconds. Built with **Rust + GPUI** (gpui 0.2 + gpui-component 0.5). macOS first; experimental Linux support since v0.2.5, experimental Windows support since v0.2.7.
-Your agent history is scattered across `~/.claude`, `~/.codex`, and a dozen other private directories. Wake reads them all, read-only, and gives you one fast window into it. Everything stays local: no network requests, ever.
+Your agent history is scattered across `~/.claude`, `~/.codex`, and a dozen other private directories. Wake reads them all, read-only, and gives you one fast window into it. Everything stays local; Wake only contacts GitHub when you explicitly check for an update.
![Wake — sessions list and transcript view](imgs/screenshot-1.webp)
@@ -51,7 +51,7 @@ Cursor IDE chats, Windsurf, and Trae encrypt their local data; Amp, Factory (Dro
- Agent data directories are opened **read-only**; Wake never writes to another tool's files or databases
- Credential files (`auth.json` and friends) are never read
-- Zero network requests — Wake never constructs or calls an HTTP client (GPUI's dependency tree bundles one; Wake doesn't reach for it)
+- No background network requests — the only network action is a user-initiated update check against Wake's public GitHub Release metadata; session data is never sent
- Wake's own index lives at `~/Library/Application Support/wake/wake.db` (Linux: `~/.local/share/wake`, Windows: `%LOCALAPPDATA%\wake`) and can be rebuilt from scratch at any time (stars/pins live in a separate table and survive rebuilds)
## Performance
diff --git a/crates/wake/Cargo.toml b/crates/wake/Cargo.toml
index a553299..98090a6 100644
--- a/crates/wake/Cargo.toml
+++ b/crates/wake/Cargo.toml
@@ -19,6 +19,8 @@ gpui-component = { version = "0.5", features = ["tree-sitter-languages"] }
futures = "0.3"
chrono.workspace = true
dirs.workspace = true
+semver.workspace = true
+reqwest.workspace = true
# exe 图标 + 版本资源(build.rs 里按 CARGO_CFG_TARGET_OS 判目标生效)。
# 不做 target 门控:build-dependencies 的 [target.*] 匹配语义在 host/target
diff --git a/crates/wake/src/main.rs b/crates/wake/src/main.rs
index 583874f..243693e 100644
--- a/crates/wake/src/main.rs
+++ b/crates/wake/src/main.rs
@@ -11,14 +11,15 @@ mod format;
mod settings;
mod theme;
mod ui;
+mod update;
mod workbench;
use assets::Assets;
use gpui::*;
use gpui_component::Root;
use workbench::{
- OpenAbout, OpenSettings, PaletteDown, PaletteUp, RefreshSessions, ToggleSearch, Workbench,
- KEY_CONTEXT, PALETTE_CONTEXT,
+ OpenAbout, OpenSettings, OpenUpdates, PaletteDown, PaletteUp, RefreshSessions, ToggleSearch,
+ Workbench, KEY_CONTEXT, PALETTE_CONTEXT,
};
actions!(wake_app, [Quit, CloseWindow]);
@@ -47,16 +48,19 @@ fn main() {
KeyBinding::new("up", PaletteUp, Some(PALETTE_CONTEXT)),
KeyBinding::new("down", PaletteDown, Some(PALETTE_CONTEXT)),
]);
+ let mut wake_menu_items = vec![MenuItem::action("About Wake", OpenAbout)];
+ #[cfg(target_os = "macos")]
+ wake_menu_items.push(MenuItem::action("Check for Updates…", OpenUpdates));
+ wake_menu_items.extend([
+ MenuItem::separator(),
+ MenuItem::action("Settings…", OpenSettings),
+ MenuItem::separator(),
+ MenuItem::action("Quit Wake", Quit),
+ ]);
cx.set_menus(vec![
Menu {
name: "Wake".into(),
- items: vec![
- MenuItem::action("About Wake", OpenAbout),
- MenuItem::separator(),
- MenuItem::action("Settings…", OpenSettings),
- MenuItem::separator(),
- MenuItem::action("Quit Wake", Quit),
- ],
+ items: wake_menu_items,
},
Menu {
name: "File".into(),
diff --git a/crates/wake/src/settings.rs b/crates/wake/src/settings.rs
index 6738b37..0ab7bab 100644
--- a/crates/wake/src/settings.rs
+++ b/crates/wake/src/settings.rs
@@ -4,8 +4,8 @@ use gpui_component::button::{Button, ButtonCustomVariant, ButtonVariants as _};
use gpui_component::menu::{DropdownMenu as _, PopupMenuItem};
use gpui_component::switch::Switch;
use gpui_component::{
- h_flex, v_flex, ActiveTheme as _, Icon, Root, Selectable as _, Sizable as _, StyledExt as _,
- TitleBar, WindowExt as _,
+ h_flex, v_flex, ActiveTheme as _, Disableable as _, Icon, Root, Selectable as _, Sizable as _,
+ StyledExt as _, TitleBar, WindowExt as _,
};
use wake_core::models::AgentId;
@@ -14,7 +14,8 @@ use crate::ui::{
BUTTON_SM_H, FONT_BODY, FONT_CAPTION, FONT_DISPLAY, FONT_HEADING, FONT_LABEL, FONT_TITLE,
RADIUS_BUTTON, SHOW_IN_FM, SPACE_LG, SPACE_MD, SPACE_SM, SPACE_XL, SPACE_XS, SPACE_XXL,
};
-use crate::workbench::{DataSourceRow, OpenAbout, OpenSettings, Workbench};
+use crate::update::{self, UpdateStatus};
+use crate::workbench::{DataSourceRow, OpenAbout, OpenSettings, OpenUpdates, Workbench};
use crate::{theme, theme::AppearancePreference};
const SETTINGS_SIDEBAR_W: Pixels = px(188.);
@@ -44,12 +45,12 @@ pub(crate) enum SettingsPage {
General,
Locations,
Data,
+ Updates,
About,
}
-/// Settings 内所有文字按钮共用一套尺寸和材质;避免页面各自混用
-/// outline / primary / 默认 ButtonGroup 后形成多套视觉语言。设置页里的
-/// 页面动作都保持低强调,确认弹窗里的最终提交才使用 primary。
+/// Settings 内常规文字按钮共用一套尺寸和材质;避免页面各自混用
+/// outline / primary / 默认 ButtonGroup 后形成多套视觉语言。
fn settings_button(button: Button, cx: &App) -> Button {
let theme = cx.theme();
button
@@ -65,6 +66,23 @@ fn settings_button(button: Button, cx: &App) -> Button {
.rounded(RADIUS_BUTTON)
}
+/// 设置页里真正需要用户继续完成的主操作。保持 6px 圆角,但使用中号高度、
+/// primary 填充和轻阴影,让它与普通的重试 / 再检查动作拉开层级。
+fn settings_primary_button(button: Button, cx: &App) -> Button {
+ let theme = cx.theme();
+ button
+ .custom(
+ ButtonCustomVariant::new(cx)
+ .color(theme.primary)
+ .foreground(theme.primary_foreground)
+ .border(theme.primary)
+ .hover(theme.primary_hover)
+ .active(theme.primary_active)
+ .shadow(true),
+ )
+ .rounded(RADIUS_BUTTON)
+}
+
pub(crate) struct SettingsView {
focus_handle: FocusHandle,
workbench: Entity<Workbench>,
@@ -181,13 +199,26 @@ impl SettingsView {
cx,
)),
)
- .child(div().px(SPACE_SM).pb(SPACE_SM).child(self.render_nav_item(
- "settings-about-nav",
- "About",
- "icons/info.svg",
- SettingsPage::About,
- cx,
- )))
+ .child(
+ v_flex()
+ .px(SPACE_SM)
+ .pb(SPACE_SM)
+ .gap(px(2.))
+ .child(self.render_nav_item(
+ "settings-updates-nav",
+ "Updates",
+ "icons/download.svg",
+ SettingsPage::Updates,
+ cx,
+ ))
+ .child(self.render_nav_item(
+ "settings-about-nav",
+ "About",
+ "icons/info.svg",
+ SettingsPage::About,
+ cx,
+ )),
+ )
.into_any_element()
}
@@ -544,6 +575,114 @@ impl SettingsView {
.into_any_element()
}
+ fn render_updates(&mut self, cx: &mut Context<Self>) -> AnyElement {
+ let theme = cx.theme();
+ let status = self.workbench.read(cx).update_status().clone();
+ let checking = matches!(status, UpdateStatus::Checking);
+ let update_available = matches!(status, UpdateStatus::Available { .. });
+ let status_message: SharedString = match &status {
+ UpdateStatus::Idle => "Check GitHub Releases for a newer version.".into(),
+ UpdateStatus::Checking => "Checking GitHub Releases…".into(),
+ UpdateStatus::UpToDate { latest } => {
+ format!("No newer release is available (latest: {latest}).").into()
+ }
+ UpdateStatus::Available { latest } => {
+ format!("Wake {latest} is available. Open the release page to download it.").into()
+ }
+ UpdateStatus::Failed => {
+ "Couldn't check for updates. Check your connection and try again.".into()
+ }
+ };
+ let button_label = match status {
+ UpdateStatus::Idle => "Check for Updates",
+ UpdateStatus::Checking => "Checking…",
+ UpdateStatus::UpToDate { .. } => "Check Again",
+ UpdateStatus::Available { .. } => "View Update",
+ UpdateStatus::Failed => "Try Again",
+ };
+ let button = Button::new("settings-check-updates")
+ .label(button_label)
+ .disabled(checking);
+ let mut action = if update_available {
+ settings_primary_button(button, cx)
+ } else {
+ settings_button(button, cx)
+ };
+ if update_available {
+ action = action.on_click(|_, _, cx| cx.open_url(update::LATEST_RELEASE_PAGE));
+ } else {
+ let workbench = self.workbench.clone();
+ action = action.on_click(move |_, _, cx| {
+ workbench.update(cx, |this, cx| this.check_for_updates(cx));
+ });
+ }
+
+ v_flex()
+ .flex_1()
+ .min_w_0()
+ .h_full()
+ .bg(theme.background)
+ .child(
+ v_flex()
+ .flex_shrink_0()
+ .px(SPACE_XXL)
+ .pt(px(44.))
+ .pb(SPACE_XL)
+ .gap(px(5.))
+ .child(
+ div()
+ .text_size(FONT_TITLE)
+ .font_semibold()
+ .text_color(theme.foreground)
+ .child("Updates"),
+ )
+ .child(
+ div()
+ .text_size(FONT_CAPTION)
+ .text_color(theme.muted_foreground)
+ .child("Keep Wake up to date."),
+ ),
+ )
+ .child(
+ v_flex().px(SPACE_XXL).child(
+ h_flex()
+ .min_h(px(84.))
+ .w_full()
+ .px(SPACE_LG)
+ .gap(SPACE_LG)
+ .items_center()
+ .rounded(theme.radius_lg)
+ .border_1()
+ .border_color(theme.border)
+ .bg(theme.popover)
+ .child(
+ v_flex()
+ .flex_1()
+ .min_w_0()
+ .gap(px(3.))
+ .child(
+ div()
+ .text_size(FONT_BODY)
+ .text_color(theme.foreground)
+ .child(format!("Wake {}", env!("CARGO_PKG_VERSION"))),
+ )
+ .child(
+ div()
+ .text_size(FONT_CAPTION)
+ .text_color(if matches!(status, UpdateStatus::Failed) {
+ theme.danger
+ } else {
+ theme.muted_foreground
+ })
+ .child(status_message),
+ ),
+ )
+ .child(action),
+ ),
+ )
+ .into_any_element()
+ }
+
fn render_location_row(&self, row: DataSourceRow, ix: usize, cx: &Context<Self>) -> AnyElement {
let theme = cx.theme();
let enabled = row.enabled;
@@ -866,6 +1005,7 @@ impl Render for SettingsView {
SettingsPage::General => self.render_general(cx),
SettingsPage::Locations => self.render_locations(cx).into_any_element(),
SettingsPage::Data => self.render_data(cx),
+ SettingsPage::Updates => self.render_updates(cx),
SettingsPage::About => self.render_about(cx),
};
div()
@@ -879,6 +1019,10 @@ impl Render for SettingsView {
this.workbench
.update(cx, |workbench, cx| workbench.open_about(cx));
}))
+ .on_action(cx.listener(|this, _: &OpenUpdates, _window, cx| {
+ this.workbench
+ .update(cx, |workbench, cx| workbench.open_updates(cx));
+ }))
.size_full()
.bg(background)
.text_color(foreground)
diff --git a/crates/wake/src/update.rs b/crates/wake/src/update.rs
new file mode 100644
index 0000000..e5abdc6
--- /dev/null
+++ b/crates/wake/src/update.rs
@@ -0,0 +1,112 @@
+use std::time::Duration;
+
+use anyhow::{Context as _, Result};
+use semver::Version;
+use serde::Deserialize;
+
+const LATEST_RELEASE_API: &str = "https://api.github.com/repos/iAmCorey/Wake/releases/latest";
+pub(crate) const LATEST_RELEASE_PAGE: &str = "https://github.com/iAmCorey/Wake/releases/latest";
+
+#[derive(Clone, Default)]
+pub(crate) enum UpdateStatus {
+ #[default]
+ Idle,
+ Checking,
+ UpToDate {
+ latest: String,
+ },
+ Available {
+ latest: String,
+ },
+ Failed,
+}
+
+#[derive(Debug, PartialEq, Eq)]
+pub(crate) struct UpdateInfo {
+ pub latest_version: Version,
+ pub update_available: bool,
+}
+
+#[derive(Deserialize)]
+struct GithubRelease {
+ tag_name: String,
+}
+
+fn evaluate_release(current_version: &str, tag_name: &str) -> Result<UpdateInfo> {
+ let current = Version::parse(current_version)
+ .with_context(|| format!("invalid current version {current_version:?}"))?;
+ let latest_text = tag_name
+ .strip_prefix('v')
+ .or_else(|| tag_name.strip_prefix('V'))
+ .unwrap_or(tag_name);
+ let latest = Version::parse(latest_text)
+ .with_context(|| format!("invalid GitHub release tag {tag_name:?}"))?;
+
+ Ok(UpdateInfo {
+ update_available: latest > current,
+ latest_version: latest,
+ })
+}
+
+/// Only called from the explicit Settings action. Wake never checks in the
+/// background, so opening the app still performs no network request.
+pub(crate) fn check_latest_release(current_version: &str) -> Result<UpdateInfo> {
+ let client = reqwest::blocking::Client::builder()
+ .timeout(Duration::from_secs(10))
+ .build()
+ .context("building update client")?;
+ let release = client
+ .get(LATEST_RELEASE_API)
+ .header("Accept", "application/vnd.github+json")
+ .header("X-GitHub-Api-Version", "2026-03-10")
+ .header("User-Agent", format!("Wake/{current_version}"))
+ .send()
+ .context("requesting the latest Wake release")?
+ .error_for_status()
+ .context("GitHub returned an error while checking for updates")?
+ .json::<GithubRelease>()
+ .context("reading the latest Wake release")?;
+
+ evaluate_release(current_version, &release.tag_name)
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn newer_release_is_available() {
+ let info = evaluate_release("0.2.9", "v0.3.0").unwrap();
+ assert_eq!(info.latest_version, Version::new(0, 3, 0));
+ assert!(info.update_available);
+ }
+
+ #[test]
+ fn current_or_older_release_is_not_an_update() {
+ assert!(
+ !evaluate_release("0.2.9", "v0.2.9")
+ .unwrap()
+ .update_available
+ );
+ assert!(
+ !evaluate_release("0.3.0", "v0.2.9")
+ .unwrap()
+ .update_available
+ );
+ }
+
+ #[test]
+ fn malformed_release_tag_is_rejected() {
+ assert!(evaluate_release("0.2.9", "latest").is_err());
+ }
+
+ #[test]
+ #[ignore = "performs a live GitHub request"]
+ fn live_latest_release_check_runs_on_a_plain_thread() {
+ let info = std::thread::spawn(|| check_latest_release("0.2.8"))
+ .join()
+ .expect("update check thread should not panic")
+ .expect("GitHub release request should succeed");
+ assert!(info.update_available);
+ }
+}
diff --git a/crates/wake/src/workbench.rs b/crates/wake/src/workbench.rs
index 5f0cfaf..003cf2d 100644
--- a/crates/wake/src/workbench.rs
+++ b/crates/wake/src/workbench.rs
@@ -51,6 +51,7 @@ use crate::format::{
};
use crate::settings::{SettingsPage, SettingsView};
use crate::ui::*;
+use crate::update::{self, UpdateStatus};
actions!(
wake,
@@ -58,6 +59,7 @@ actions!(
ToggleSearch,
RefreshSessions,
OpenSettings,
+ OpenUpdates,
OpenAbout,
PaletteUp,
PaletteDown
@@ -433,6 +435,7 @@ pub struct Workbench {
/// Settings 是单例窗口;句柄不保活,关闭后下次点击会检测失败并重建。
settings_window: Option<AnyWindowHandle>,
settings_page: SettingsPage,
+ update_status: UpdateStatus,
/// 全量解析进度 (done, total);None = 仍在枚举文件。
/// 用 Rc<Cell> 而非 entity 字段:进度弹窗 builder 在本 entity 的
/// render 期间执行,entity.read(cx) 会 double-lease panic。
@@ -615,6 +618,7 @@ impl Workbench {
pending_rescan: false,
settings_window: None,
settings_page: SettingsPage::General,
+ update_status: UpdateStatus::Idle,
refresh_progress: Rc::new(Cell::new(None)),
total_sessions: 0,
list_state,
@@ -839,6 +843,10 @@ impl Workbench {
self.settings_page
}
+ pub(crate) fn update_status(&self) -> &UpdateStatus {
+ &self.update_status
+ }
+
pub(crate) fn select_settings_page(&mut self, page: SettingsPage, cx: &mut Context<Self>) {
self.settings_page = page;
cx.notify();
@@ -850,6 +858,50 @@ impl Workbench {
self.open_settings(cx);
}
+ pub(crate) fn open_updates(&mut self, cx: &mut Context<Self>) {
+ self.settings_page = SettingsPage::Updates;
+ cx.notify();
+ self.open_settings(cx);
+ self.check_for_updates(cx);
+ }
+
+ pub(crate) fn check_for_updates(&mut self, cx: &mut Context<Self>) {
+ if matches!(self.update_status, UpdateStatus::Checking) {
+ return;
+ }
+ self.update_status = UpdateStatus::Checking;
+ cx.notify();
+
+ // reqwest::blocking 会自行创建 Tokio runtime;若直接放进 GPUI 的异步
+ // executor,runtime 嵌套会 panic,界面便会永远停在 Checking。让阻塞
+ // 请求待在独立系统线程里,再用 oneshot 把结果送回 UI executor。
+ let (sender, receiver) = futures::channel::oneshot::channel();
+ std::thread::spawn(|| {
+ let _ = sender.send(update::check_latest_release(env!("CARGO_PKG_VERSION")));
+ });
+ cx.spawn(async move |this, cx| {
+ let status = match receiver.await {
+ Ok(Ok(info)) if info.update_available => UpdateStatus::Available {
+ latest: info.latest_version.to_string(),
+ },
+ Ok(Ok(info)) => UpdateStatus::UpToDate {
+ latest: info.latest_version.to_string(),
+ },
+ Ok(Err(error)) => {
+ eprintln!("update check failed: {error:#}");
+ UpdateStatus::Failed
+ }
+ Err(_) => UpdateStatus::Failed,
+ };
+ this.update(cx, |this, cx| {
+ this.update_status = status;
+ cx.notify();
+ })
+ .ok();
+ })
+ .detach();
+ }
+
/// 打开单例 Settings 窗口。开窗必须 defer 到当前 Workbench update 退出
/// 之后:Settings 首帧会读取 location 快照,同步开窗会反读仍被独占借用
/// 的 Workbench,触发 GPUI double lease。
@@ -3613,6 +3665,7 @@ impl Render for Workbench {
this.refresh_sessions(window, cx)
}))
.on_action(cx.listener(|this, _: &OpenSettings, _window, cx| this.open_settings(cx)))
+ .on_action(cx.listener(|this, _: &OpenUpdates, _window, cx| this.open_updates(cx)))
.on_action(cx.listener(|this, _: &OpenAbout, _window, cx| this.open_about(cx)))
.size_full()
.bg(theme.background)
diff --git a/scripts/test.sh b/scripts/test.sh
index 1d27979..433d1e9 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -1,7 +1,7 @@
#!/bin/zsh
# Wake 本地测试入口——改完代码跑一跑(对齐 kooky 的 `swift test` 习惯)。
#
-# scripts/test.sh # 数据层 50 测试 + UI 编译门槛,~秒级
+# scripts/test.sh # 数据层 + UI 单元测试 + UI 编译门槛,~秒级
# scripts/test.sh --smoke # 追加真实数据冒烟:全量扫描统计(人眼对量级,
# # 基准见 CLAUDE.md;只读你本机的 agent 数据)
set -euo pipefail
@@ -10,7 +10,10 @@ cd "$(dirname "$0")/.."
echo "── cargo test -p wake-core(adapter 契约 / seq 一致性 / FTS / 扫描终态)"
cargo test -p wake-core --quiet
-echo "── cargo check -p wake(UI 编译门槛,gpui 无测试套件)"
+echo "── cargo test -p wake(UI 单元逻辑;联网测试默认忽略)"
+cargo test -p wake --quiet
+
+echo "── cargo check -p wake(UI 编译门槛)"
cargo check -p wake --quiet
if [[ "${1:-}" == "--smoke" ]]; then