Skip to content

Development and Build EN

zhenhun edited this page Sep 4, 2026 · 1 revision

中文 | English

Local Development

Prerequisites: Node.js, the Rust toolchain, and Tauri's system dependencies.

npm install          # Install frontend dependencies
npm run tauri dev    # Dev mode (hot reload)
npm run tauri build  # Build release (NSIS / MSI / dmg / AppImage / deb)

Project Structure

src/               React frontend
  pages/           Chat / AI Settings / Tools / Skills / Memory / Audit / Remote
  components/      Markdown, tool cards, title bar, icons, etc.
src-tauri/         Tauri (Rust) backend
  src/             ai (protocols & streaming), agent (orchestration), registry (tool registration),
                   mcp, http_api (remote API), update (auto-update), audit …
e2e/               E2E tests (mock-ai, tui, update, remote, etc.)
.github/workflows/ CI: release / e2e / auto-release / mirror-pages / sync-gitee
packaging/         flatpak, exotic (loongarch64/riscv64) packaging scripts

Testing

Suite Command Coverage
Unit tests cargo test (under src-tauri) 70+ cases: protocol parsing, fuzzy detection, SSE streams, MCP, etc.
TUI E2E node e2e/tui.cjs (start node e2e/mock-ai.cjs first) 28 scenarios: chat / tools / sessions / memory / invalid input / very long lines / multilingual / corrupted config / connection failure / input storms / variant formats / AI self-correction / streaming edge cases
Update E2E node e2e/update.cjs Mock update source: detection / download / idempotent cache / status / no update / auto download at startup
Remote E2E node e2e/remote-default.cjs Disabled by default / listening when enabled / credential rejection

Mock AI server: node e2e/mock-ai.cjs, listening on 127.0.0.1:9901, with dozens of built-in scenario markers (e.g. E2E-AI-RETRY, E2E-STREAM-MULTIBYTE) — see the comments in the file.

CI runs the E2E suite on Ubuntu (xvfb) / Windows / macOS on every push.

Release Process (auto-release)

Fully automated — no manual version bumping:

  1. GitHub → Actions → auto-release → Run workflow
  2. Fill in bump (patch/minor/major) or an explicit version (e.g. 0.5.0)
  3. The workflow then automatically:
    • Validates that the new version is greater than the current one and the tag doesn't exist
    • Bumps all 4 version files in one pass (package.json / tauri.conf.json / Cargo.toml / Cargo.lock)
    • Commits and tags (chore(release): vX.Y.Z)
    • Dispatches release (full-platform builds: Windows ×2 architectures, macOS ×2, Linux ×3 package formats, loongarch64/riscv64 QEMU cross-compilation)
    • Dispatches e2e (three-platform E2E)
    • Dispatches sync-gitee (full Gitee mirror)
  4. release finalization: generates latest.json (with the 6-platform asset map), uploads it to the Release, and refreshes the GitHub Pages mirror (yxpil.github.io/bit/)
  5. A failed QEMU architecture build does not block the release; artifacts are re-uploaded automatically once it succeeds

Mirrors and Distribution

Target Mechanism
GitHub Pages mirror mirror-pages: syncs Release assets to yxpil.github.io/bit/ (direct links via the Fastly CDN)
osbt.space Official website, referencing the Pages mirror
Gitee mirror sync-gitee: full sync after pushing main / tags (credentials via GitHub Secrets)
APT / DNF / pacman repos yxpil.github.io/apt-repo / dnf-repo / pacman-repo
winget Manual PR submission (pre-checked locally by the validation workflow)
Homebrew / Scoop / npm Separate tap / bucket / bit-agent package

Conventions

  • All model-visible strings (tool descriptions, parameter schemas, tool errors, result wrappers) are in English, for compatibility with older models
  • User-facing UI text is in Chinese
  • MCP integration tests depend on BIT_FAKE_MCP_URL; update tests depend on BIT_FAKE_UPDATE_URL (injected by e2e)

Clone this wiki locally