Repository navigation
Rust rewrite: multi-account agent, QEMU launcher and web GUI - #1
Merged
Merged
Conversation
Introduce a Cargo workspace with the `wrapper` binary and the `wrapper-agent` library, merging wrapper-manager's multi-account features into wrapper-lite: - one supervised lite process per account (startup gating, /status readiness, health checks, exponential backoff, FairPlay circuit breaker) - two-phase 2FA login via 2fa.txt; credentials passed through LITE_ARGS_FILE instead of argv - region-aware routing with catalog/lyrics probes and retry policy - wrapper-lite compatible resource API, aggregated /status, wrapper-manager compatible /login and /logout, /api management API with optional bearer token and SSE events - `wrapper sandbox-exec`: user/mount/PID namespace chroot helper that replaces wrapper-lite.c and wrapper-lite-rootless.c - migration of a legacy single-account /data layout lite: add --code-timeout so the 2FA wait is configurable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/host: QEMU lookup (explicit > QEMU_BIN > bundled > PATH), per-host acceleration (KVM/WHPX/HVF/TCG) with TCG fallback when the accelerator fails at boot, bundled firmware/library paths, fw_cfg agent arguments with a kernel-cmdline fallback, graceful shutdown through the agent API - `wrapper qemu` replaces wrapper-lite-qemu; `wrapper login` and `wrapper accounts` manage a running agent from the terminal - guest init runs `wrapper agent`, sets up DNS, formats a blank data disk on first boot (no data.img is shipped any more) and powers off cleanly - agent: POST /api/system/shutdown, NO_COLOR support, and drain lite output after a login exits so the failure reason is not lost - qemu/build.sh embeds the static musl wrapper and handles busybox in /usr/bin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- web/: new Svelte 5 + Vite panel (dashboard, accounts with two-phase 2FA login dialog, logs with source/level filters, settings, components and package download, API tester), light/dark themes, zh/en, mobile layout - crates/host gui server: embeds web/dist via build.rs, persistent settings with a generated management token, engine controller for the QEMU and native engines, console buffer and SSE events, platform package download with zip-slip protection that keeps user data, /api/agent and /api/public proxies, optional access token for non-loopback listening - `wrapper` without a subcommand opens the panel; children are killed with the GUI (job object on Windows) and closing the console stops the engine gracefully - agent: explain "unknown argument" login failures as a lite/wrapper version mismatch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CI: Rust checks on Linux and Windows, web panel build, lite (NDK), QEMU guest with a rootless-sandbox and native-agent smoke test, wrapper-<os>-<arch> packages (QEMU bundled; linux-x86_64 also ships the rootfs for the native engine), Android binary + APK - Android: Kotlin reduced to a WebView plus a foreground service that runs the bundled libwrapper.so (`wrapper gui`) with wake/Wi-Fi locks - Docker: builds lite and wrapper and runs the native agent - remove wrapper-lite.c, wrapper-lite-rootless.c, wrapper-lite-qemu.cpp, the Go GUI and its duplicated web assets, unused cmdline.c/h, entrypoint.sh and qemu/mkdata.sh; CMake now only builds lite - agent creates the Android app data dir on boot - GUI installs downloaded packages next to the assets dir (writable on Android) - .gitattributes forces LF for shell scripts and the guest init - README rewritten for the multi-account workflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merges wrapper-manager's multi-account features into wrapper-lite and replaces every host-side component (C launchers, C++ QEMU launcher, Go GUI) with one Rust binary,
wrapper, plus a new web panel.lite(C++, links Apple's Android libraries) keeps its role and HTTP API; it only gains--code-timeout.Delivered in four commits:
crates/agent): one supervised lite process per account (readiness via/status, health checks, exponential backoff, FairPlay circuit breaker), two-phase 2FA login through2fa.txt(credentials passed viaLITE_ARGS_FILE, not argv), region-aware routing with catalog/lyrics probes and retries, wrapper-manager compatible/status/login/logout,/apimanagement API with optional bearer token and SSE,wrapper sandbox-exec(userns chroot) replacingwrapper-lite.c/wrapper-lite-rootless.c, migration of the legacy single-account layout.crates/host):wrapper qemureplaceswrapper-lite-qemu; the guest init runswrapper agent, formats a blank data disk on first boot (nodata.imgshipped), passes args via fw_cfg, shuts down cleanly through the API.wrapper login/wrapper accountsCLI.web/, embedded bybuild.rs;wrapperwith no subcommand opens it. Dashboard, accounts with 2FA dialog, logs, settings, package download, API tester; light/dark, zh/en, mobile layout.libwrapper.so), Docker on the native agent, old launchers and Go GUI removed.Design notes: docs/ARCHITECTURE.md.
Breaking changes
wrapper-<os>-<arch>(wrapper-android-apkfor the APK); old nightly links stop working.wrapper-lite,wrapper-lite-rootless,wrapper-lite-qemubinaries are gone. An existingdata.img/rootfs/datais migrated to the first account.--code-timeout; the agent reports this as a version mismatch.Testing
Done locally:
cargo test(28 tests, incl. HTTP tests against fake lite upstreams) andcargo clippy --all-targetsclean on Windows and Linux.Verified by CI (run 38126123368, all jobs green):
/statusanswers (guestjob)aarch64-linux-androidbinary and APK buildStill to verify by hand:
/key/m3u8through multi-account routing🤖 Generated with Claude Code