An audit of the destroy→hide change across four lenses raised 17 findings; 14 survived adversarial verification. Two of them were regressions that change introduced, and both had the same shape: code that only worked because the pet window used to not exist. show_pet_context_menu picked the pet window and fell back to main. While the pet rendered inside the app its window had been destroyed at startup, so the fallback happened to select the visible main window. Now that the window merely hides, the menu was being anchored to a hidden HWND, which Win32 cannot bring to the foreground. The visibility test is explicit now rather than incidental. DesktopPetView read the connection state in a mount effect and nothing emitted connection events, so destroy-and-rebuild was what re-read it. Without a remount the floating pet showed whatever was true at startup for the rest of the session. reveal_pet_window now emits pet-window-revealed and the view re-reads on it. The rest were already there. Every pet setting was decorative: the preferences were applied and then dropped, so reveal_pet_window had to invent an answer and hard-coded the first monitor, the safe edge and always-on-top — reverting the user's choices on every show. The pet view re-sent a fully hard-coded payload whenever game mode toggled, and the settings page initialised its controls from literals, so returning to the page and changing one thing pushed three stale defaults back onto the window. There is a session-scoped store now, a command to read it, and both frontends read before they write. Persisting it across restarts is F-75. Always-on-top is off by default, which is what the Q6 acceptance criterion asked for (F-35), and the window no longer takes focus when shown — it was activating on show and swallowing keystrokes meant for the main window. focusable is left alone on purpose: clearing it adds WS_EX_NOACTIVATE, which would re-break the context menu now anchored to that window. That is F-79. The pet also painted a solid dark rectangle before its assets arrived. The transparency rule is gated on a class that an effect inside the 5.2 MB lazy chunk added, so until that chunk ran the app's opaque background won. This is why the earlier hunt for "the rule that beats !important" found nothing: the class was not applied yet, so specificity was never the question. The pet now has its own entry document carrying the class statically. An inline script would not do — tauri-utils only nonces script[src^='http'], so it would pass in dev and be blocked by script-src 'self' in a release build. Rust tests 92 → 97, frontend 30 → 35. All 11 mutations of the new assertions were confirmed to fail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| assets | ||
| crates | ||
| docs | ||
| src | ||
| src-tauri | ||
| tests | ||
| .editorconfig | ||
| .gitignore | ||
| .node-version | ||
| .npmrc | ||
| .prettierignore | ||
| AGENTS.md | ||
| AstrBot_Desktop_Codex_Forgejo_Predevelopment_Workflow.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| eslint.config.js | ||
| index.html | ||
| package.json | ||
| pet.html | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| rust-toolchain.toml | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
AstrBot Desktop
AstrBot Desktop is a Windows companion and local-assistance client built with Tauri 2, React, TypeScript, Vite, and Rust.
The MVP supports two isolated active AstrBot connection slots:
companionfor chat, proactive messages, voice, and game companionship;operationsfor user-authorized, policy-controlled diagnostics and recoverable file operations.
Security boundaries
- Credentials remain in Windows secure storage and are never exposed to React.
- Server tool requests are proposals; the Rust policy layer makes the final decision.
- The application does not provide arbitrary PowerShell, CMD, or shell execution.
- NAS transfers use
plan -> dry run -> copy -> verify -> commitand preserve source files on failure.
Current phase
The repository is in the P00 bootstrap and high-risk Spike phase. See docs/implementation-plan.md and docs/progress.md.
Authoritative documents
AGENTS.mddocs/01_Architecture_Design.mddocs/02_Codex_Implementation_Tasks.mdAstrBot_Desktop_Codex_Forgejo_Predevelopment_Workflow.md
Development prerequisites
- Windows 11
- Node.js and pnpm
- Rust stable with the MSVC target
- Visual Studio 2022 Build Tools with Desktop development with C++
- WebView2 Evergreen Runtime
Local commands
pnpm install --frozen-lockfile
pnpm check:frontend
pnpm test:e2e
pnpm rust:fmt
pnpm rust:clippy
pnpm rust:test
pnpm rust:check
pnpm tauri:dev
pnpm tauri:build
On Windows, Cargo build output can be redirected away from a NAS workspace:
$env:CARGO_TARGET_DIR = "$env:LOCALAPPDATA\Temp\AstrBot-Desktop-target"
The 30-minute connection soak and the controlled Windows UIA/capture smoke are ignored by the normal suite and must be invoked explicitly as documented in tests/README.md. The UIA/capture smoke opens only a generated, non-sensitive standard dialog and never writes captured pixels to disk.
P00 results and unresolved environment boundaries are recorded in docs/spikes and docs/progress.md.