暂无描述
查找文件
YokiiroBW 828f7c586d fix(chat): accept null in runtime event contracts
Rust serializes `Option<String>` without `skip_serializing_if`, so absent
fields arrive as `null`. Zod's `.optional()` accepts only `undefined`, so
`safeParse` failed and three chains silently died:

- `boundRuntimeEventSchema.sessionId/messageId`: desktop-v1 and mock events
  carry no session id, so every one of them was discarded; AstrBot error and
  heartbeat frames were discarded too.
- `remoteChatSessionSchema.displayName/updatedAt`: one null field threw for
  the whole array, leaving the remote session list permanently empty.
- `astrbotModelOptionSchema.name`: a null name failed capability parsing,
  which permanently disabled the file upload button.

The sibling `slotRuntimeSnapshotSchema` in the same file already used
`.nullish()` throughout, which is what makes this look like a miss during the
de-enveloping change rather than a deliberate choice.

`formatSessionTime` widens with it: `updatedAt` is now `string | null` and the
existing falsy guard already handled null.

Refs P1-7a / F-06.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 22:31:44 +08:00
.forgejo/workflows ci(forgejo): add portable and windows quality workflows 2026-07-18 20:43:20 +08:00
assets feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
crates fix(chat): prevent duplicate history on session switch 2026-07-22 02:52:31 +08:00
docs docs(progress): record roadmap audit commit 2026-07-22 03:09:49 +08:00
src fix(chat): accept null in runtime event contracts 2026-07-26 22:31:44 +08:00
src-tauri fix(tauri): allow blob images in production csp 2026-07-26 22:28:35 +08:00
tests refactor(ui): complete desktop frontend redesign 2026-07-22 00:27:06 +08:00
.editorconfig chore(repo): initialize repository and ignore rules 2026-07-18 20:22:52 +08:00
.gitignore chore(repo): initialize repository and ignore rules 2026-07-18 20:22:52 +08:00
.node-version feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
.npmrc feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
.prettierignore feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
AGENTS.md docs(project): add architecture and implementation specifications 2026-07-18 20:21:19 +08:00
AstrBot_Desktop_Codex_Forgejo_Predevelopment_Workflow.md docs(project): add architecture and implementation specifications 2026-07-18 20:21:19 +08:00
Cargo.lock feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
Cargo.toml feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
CHANGELOG.md chore(roadmap): sync roadmap status and acceptance gate 2026-07-22 03:09:35 +08:00
eslint.config.js feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
index.html feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
package.json feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
playwright.config.ts test(p00): add frontend browser rust and windows checks 2026-07-18 20:42:40 +08:00
pnpm-lock.yaml feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
pnpm-workspace.yaml feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
README.md docs(p00): record spike results and unresolved boundaries 2026-07-18 21:00:49 +08:00
rust-toolchain.toml feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
tsconfig.app.json feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
tsconfig.json feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
tsconfig.node.json feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
vite.config.ts fix(pet): add stable desktop rendering and context menu 2026-07-20 20:50:27 +08:00

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:

  • companion for chat, proactive messages, voice, and game companionship;
  • operations for 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 -> commit and 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.md
  • docs/01_Architecture_Design.md
  • docs/02_Codex_Implementation_Tasks.md
  • AstrBot_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.