Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/build-desktop-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,8 @@ jobs:
with:
name: astrbot-desktop-tauri-${{ needs.resolve_build_context.outputs.astrbot_version }}-windows-${{ matrix.arch }}
if-no-files-found: error
# Only upload Windows installer executables.
# Keep explicit globs here so we only publish the installer plus the
# portable zip, not bundled helper executables from the embedded runtime.
# Upload NSIS installers, their updater signatures, and portable ZIPs,
# not bundled helper executables from the embedded runtime.
path: |
${{ env.WINDOWS_RELEASE_ASSET_GLOBS }}
src-tauri/target/release/bundle/nsis/*.exe.sig
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,10 @@ ASTRBOT_DASHBOARD_PORT=6185

Before enabling LAN access, make sure your system firewall allows port `6185`, and do not expose the port on untrusted networks or the public internet.

<!-- faq: macos-quarantine -->
<!-- faq: macos-install -->
### macOS says the app is damaged or cannot be opened

If you downloaded the installer from the internet, macOS may attach a quarantine flag to the app. Run:

```bash
xattr -dr com.apple.quarantine /Applications/AstrBot.app
```

Then restart the app. If the app is not located in `/Applications`, replace the path with the actual one.
Download a fresh copy of the `.dmg` for your Mac from the same channel you already use: [Stable](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest) or [Nightly](https://github.com/AstrBotDevs/AstrBot-desktop/releases/tag/nightly). Reinstall AstrBot. If macOS still blocks the app, report the exact warning on the [issue tracker](https://github.com/AstrBotDevs/AstrBot-desktop/issues).

<!-- faq: missing-runtime-tools -->
### Why do some MCP tools say `node`, `npx`, or `uvx` is missing?
Expand Down
10 changes: 2 additions & 8 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,10 @@ ASTRBOT_DASHBOARD_PORT=6185

开启局域网访问前,请确认系统防火墙允许端口 `6185`,并不要在不可信网络或公网环境暴露该端口。

<!-- faq: macos-quarantine -->
<!-- faq: macos-install -->
### macOS 提示“应用已损坏”或无法打开

如果你是从网络下载的安装包,macOS 可能会给应用打上 quarantine 标记。可执行:

```bash
xattr -dr com.apple.quarantine /Applications/AstrBot.app
```

然后重新启动应用。如果应用不在 `/Applications`,请替换为实际路径。
请从当前安装版本所属的通道([Stable](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest) 或 [Nightly](https://github.com/AstrBotDevs/AstrBot-desktop/releases/tag/nightly))重新下载适合你的 Mac 的 `.dmg` 并安装。如果 macOS 仍阻止打开应用,请在[问题反馈页](https://github.com/AstrBotDevs/AstrBot-desktop/issues)附上完整的系统提示。

<!-- faq: missing-runtime-tools -->
### 为什么某些 MCP 工具提示缺少 `node`、`npx` 或 `uvx`?
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ backend 子系统对上提供统一的“后端可否管理、如何启动、何
- 路径优先级:`ASTRBOT_ROOT/data/desktop_state.json` -> 打包根目录下的 `data/desktop_state.json`。
- `shell_locale.rs` 维护 `locale` 字段。
- `update_channel.rs` 维护 `updateChannel` 字段,并保留其他 JSON 字段。
- `desktop_settings.rs` 维护启动与窗口设置,以及插件界面扩展字段:`pluginUiExtensionsEnabled` 默认 `true`,`pluginUiExtensionGrants` 默认空数组;总开关只决定是否允许使用扩展,实际加载仍需逐个插件授权。
- `desktop_settings.rs` 维护启动与窗口设置。`startupTheme` 记录 Dashboard 的浅色、深色或跟随系统偏好;未保存时启动页跟随系统。插件界面扩展字段中,`pluginUiExtensionsEnabled` 默认 `true`,`pluginUiExtensionGrants` 默认空数组;总开关只决定是否允许使用扩展,实际加载仍需逐个插件授权。

当前维护约定是:各模块共用同一个状态文件,但只管理自己的字段;共享锁覆盖完整的读改写,避免并发更新互相覆盖,读取和损坏文件修复也使用同一把锁。Desktop 设置缓存把持久化与缓存更新串行化;未知字段保留避免丢弃其他模块的配置。

Expand Down Expand Up @@ -149,11 +149,11 @@ backend 子系统对上提供统一的“后端可否管理、如何启动、何

### 4.2 启动流程

1. `app_runtime.rs` 初始化 Tauri 插件、窗口事件、页面加载事件和托盘。
2. `startup_task.rs` 异步解析启动计划;打包态从 direct / `_up_/resources` 中选取与可执行文件绑定的完整资源根,开发态仍使用独立的 dev/custom 计划。
1. `app_runtime.rs` 初始化 Tauri 插件、窗口事件、页面加载事件和托盘,并在显示主窗口前应用启动主题。
2. 启动页加载完成或等待 2 秒后开始后端启动流程。`startup_task.rs` 异步解析启动计划;打包态从 direct / `_up_/resources` 中选取与可执行文件绑定的完整资源根,开发态仍使用独立的 dev/custom 计划。
3. backend readiness 在接受已运行或刚拉起的打包 backend 前,校验 `/api/v1/stats/versions`,并核对实际送出的 index 和 manifest 声明的入口摘要。
4. backend ready 后用 manifest 摘要生成的 `astrbot_bundle` 查询参数导航主窗口;失败时进入可见的 startup error 路径。
5. 页面加载过程中按来源策略注入 desktop bridge,并在需要时注入 startup loading mode。
5. 页面加载过程中按来源策略注入 desktop bridge,并在需要时注入 startup loading mode。Dashboard 未在 10 秒内报告加载完成时,桌面端用原生对话框提示。

### 4.3 bridge 注入与桌面交互流程

Expand Down
8 changes: 5 additions & 3 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ make prune

- `make lint`
- 执行 `cargo fmt --check`
- 执行 `cargo clippy -- -D warnings`
- 执行 `cargo clippy --locked --all-targets -- -D warnings`
- `make test`
- 执行 Rust 全量单元测试(`cargo test --locked`)
- 若本机有 `pnpm`,执行资源准备脚本行为测试(`pnpm run test:prepare-resources`)
Expand All @@ -76,6 +76,7 @@ make prune

- `package.json`
- `src-tauri/Cargo.toml`
- `src-tauri/Cargo.lock`(桌面 crate 的版本条目)
- `src-tauri/tauri.conf.json`

## 5. 常用环境变量
Expand Down Expand Up @@ -135,12 +136,13 @@ beforeBuildCommand = pnpm run prepare:resources

- stable(`tag-poll`)只选择 `vMAJOR.MINOR.PATCH` 格式的正式版本标签,忽略 beta、alpha、rc、dev、nightly 等预发布标签及其他非正式标签;没有正式标签时任务明确失败,不回退到预发布版本。
- 手动 `tag-poll` 的 `source_git_ref` 也只接受正式版本标签。需要打包预发布标签、分支或 commit 时使用 `custom`,不会更新 stable 通道。
- 定时构建(`schedule`)检测到上游新 tag 时,会先自动同步版本文件并提交,再继续构建。
- 手动触发(`workflow_dispatch`)默认只构建,不自动回写版本文件。
- 定时 `tag-poll` 检测到未发布的上游正式标签时,会先尝试同步版本文件并提交,再继续构建。
- 手动触发(`workflow_dispatch`)不会回写版本文件,默认运行 `nightly` 并在构建通过后更新 GitHub Nightly Release。Nightly 模式始终发布;`publish_release` 只控制手动 `tag-poll` 和 `custom` 是否发布。
- Desktop 使用独立 updater manifest,不复用 AstrBot Core 的 `api.soulter.top/releases` 更新索引。
- stable/nightly 的更新入口分别为 `https://releases.astrbot.app/desktop/channels/stable/latest.json` 和 `https://github.com/AstrBotDevs/AstrBot-desktop/releases/download/nightly/latest-nightly.json`。
- GitHub Actions 会把完整安装包继续发布到 GitHub Releases,仅 stable(`tag-poll`)将 updater 产物上传到 Cloudflare R2:先上传并校验不可变的版本目录,再更新 GitHub Release,最后原子提升通道 manifest。
- nightly 的更新清单与更新包仅发布到 GitHub Releases,不上传 R2。
- macOS 发布产物包括手动安装用的 `.dmg`,以及应用内更新用的 `.app.tar.gz` 和对应签名文件。Stable 和 Nightly 使用同一套 macOS 签名与公证流程。
- R2 bucket、repository variables/secrets 和对象目录约定见 [`docs/environment-variables.md`](./environment-variables.md#4-发布ci-github-actions)。
- 发布与 updater 相关行为依赖 `src-tauri/tauri.conf.json`、GitHub Actions workflow 以及 `scripts/ci/generate_tauri_latest_json.py`、`scripts/ci/publish_r2_release.py` 共同完成。

Expand Down
4 changes: 2 additions & 2 deletions docs/repository-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- `window/actions.rs`
- 主窗口动作与 tray 文案刷新联动封装。
- `window/startup_loading.rs`
- 启动页 loading mode 判定与注入逻辑。
- 启动主题与原生背景配置,以及 loading mode 判定与注入。
- `lifecycle/`
- 生命周期子系统目录。
- `lifecycle/cleanup.rs`
Expand Down Expand Up @@ -117,7 +117,7 @@
- `launch_plan.rs`
- custom/packaged/dev 启动计划构建;打包态完整资源候选选择、manifest 绑定和 WebUI 摘要校验。
- `startup_task.rs`
- 启动阶段后端就绪等待与主线程导航分发。
- 后端就绪等待、主线程导航分发及 Dashboard 加载超时处理。
- `app_runtime.rs`
- Tauri builder/run 编排与窗口/页面事件挂载。
- `app_types.rs`
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/window/startup_loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn startup_background(theme: Theme) -> Color {

pub(crate) fn apply_system_startup_background(app: &AppHandle) -> tauri::Result<()> {
if let Some(window) = app.get_webview_window("main") {
// The window starts hidden, so set both layers before setup shows it.
// Set both background layers while the startup window is still hidden.
window.set_background_color(Some(startup_background(window.theme()?)))?;
}
Ok(())
Expand Down