feat: AI-output Markdown, live SSE fixes, faster builds

- render assistant Markdown with gpt_markdown (the same renderer dsh-Go
  uses): streaming, syntax-highlighted code with copy, tables, LaTeX and
  task lists, replacing flutter_markdown
- fix the event stream: Dart's Map collapsed the repeated `types` query
  into one value, so only one event type was subscribed and chats never
  updated; build the query by hand
- keep the optimistic prompt on failure out of the transcript and put the
  text back for a retry
- clamp negative turn durations
- build: Aliyun Maven mirrors, pre-seeded Gradle 9.5.0, and a complete
  NDK 28.2 install to avoid multi-hour downloads
This commit is contained in:
blumia committed 2026-11-18 20:11:49 +08:00
1 parent aee560172c
commit 885a27c6a9
7 files changed
+186 -46

No files matched your search

+5 -2
View File
@@ -18,10 +18,13 @@ revert, attachments (photos/files), permissions. Android 7.0 (API 24)+.
| `lib/api/` | Dart OpenChamber client: auth, sessions, messages, SSE, models/agents, permissions, prompt/interrupt/fork/revert, `/api/fs/raw`; HTTP proxy via `HttpClient.findProxy`, SOCKS5 via dart:io's SOCKS, pinning/self-signed via `badCertificateCallback` |
| `lib/storage.dart` | Saved servers in `shared_preferences`, tokens in `flutter_secure_storage` (Android Keystore) |
| `lib/state.dart` | The app state: connections, live sessions, the open chat, and SSE event folding |
| `lib/screens/` | Servers, sessions, chat (streaming Markdown via `flutter_markdown`, composer, sheets) |
| `lib/screens/` | Servers, sessions, chat (streaming Markdown via `gpt_markdown`, composer, sheets) |
| `lib/widgets/` | The context usage ring |
Read-aloud (TTS) is intentionally **not** implemented (matching the original).
Markdown rendering reuses **`gpt_markdown`** (BSD-3), the Flutter AI-output renderer
that [dsh-Go](https://github.com/ccch1mneyyy/dsh-go) uses: streaming-friendly,
syntax-highlighted code blocks with copy, tables, LaTeX and task lists. Read-aloud
(TTS) is intentionally **not** implemented (matching the original).
## Run