Reach the first-party mobile client's everyday features: - sessions: a search button opens a field; typing asks the server with its search parameter (350 ms settle) and clearing restores the list - composer: attach photos or files (up to five, 10 MB each) as data URLs with the prompt; attachments show as removable chips and are named under the sent message - turn menu: read the answer aloud with the system voice, or stop it - chat: a "latest" button appears after scrolling up and returns to the end of the conversation - reset a live search when a connection ends Bump version to 0.2.0 (build 14).
76 lines
3.1 KiB
Markdown
76 lines
3.1 KiB
Markdown
# OpenChamber Native
|
|
|
|
A lightweight OpenChamber client for phones, written in Go with
|
|
[Asuka](https://asuka.egoist.dev/)'s native widgets. Android first.
|
|
|
|
Status: 0.2 — multiple saved servers with a connect list (add, edit, delete,
|
|
switch; password prompt; HTTP or SOCKS5 proxy and self-signed certificates per
|
|
server), session search, live session list, chat with streaming Markdown,
|
|
attachments, permissions, model/agent switching, turn and prompt actions
|
|
(copy, fork, read aloud), new sessions, archive/delete/rename, and a
|
|
UI-independent API client.
|
|
|
|
## What is here
|
|
|
|
| Path | What |
|
|
| --- | --- |
|
|
| `internal/ocapi/` | OpenChamber HTTP client: auth (password → device token), sessions, messages, prompt/interrupt/model/agent, permissions, SSE events, HTTP/SOCKS5 proxy, certificate pinning |
|
|
| `internal/storage/` | Saved servers in `asuka/sdk/store`, one device token per server in `asuka/sdk/secure` (Android Keystore), per-install id for device dedupe, migration from the single-server record |
|
|
| `internal/appui/` | Screens: connect, sessions, chat (streaming Markdown, reasoning/tool folding, permissions) |
|
|
| `cmd/ocprobe/` | Terminal probe used to validate the API without a device |
|
|
| `PLAN.md` | Research, API contract, architecture, milestones, risks |
|
|
|
|
## Run
|
|
|
|
```bash
|
|
# terminal probe against a running server
|
|
go run ./cmd/ocprobe -url http://127.0.0.1:3000 health
|
|
go run ./cmd/ocprobe -url http://127.0.0.1:3000 -limit 5 sessions
|
|
go run ./cmd/ocprobe -url http://127.0.0.1:3000 -password secret sessions
|
|
go run ./cmd/ocprobe -url http://127.0.0.1:3000 -seconds 20 events
|
|
|
|
# the app on this computer (browser / GTK window)
|
|
asuka dev --platform web
|
|
asuka dev
|
|
|
|
# headless tests, including the UI
|
|
go test ./... -race
|
|
```
|
|
|
|
`asuka` must be installed from `main`; the v0.1.1 release does not build on
|
|
Linux:
|
|
|
|
```bash
|
|
go install github.com/egoist/asuka/cmd/asuka@main
|
|
```
|
|
|
|
## Android
|
|
|
|
The SDK lives at `~/SDK/AndroidSDK`, the JDKs at `~/SDK/jdk-21` (Gradle) and
|
|
`~/SDK/jdk-17` (the Android toolchain; registered in
|
|
`~/.gradle/gradle.properties` via `org.gradle.java.installations.paths`).
|
|
|
|
```bash
|
|
export ANDROID_HOME=$HOME/SDK/AndroidSDK
|
|
export JAVA_HOME=$HOME/SDK/jdk-21
|
|
export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$JAVA_HOME/bin:$PATH
|
|
|
|
asuka dev --platform android --device emulator-5554 # hot reload
|
|
asuka dev --platform android --once --no-vet # build in, launch once
|
|
|
|
# release: a keystore is required
|
|
export ASUKA_KEYSTORE=$HOME/SDK/test-upload.jks ASUKA_KEY_ALIAS=upload
|
|
export ASUKA_KEYSTORE_PASSWORD=… ASUKA_KEY_PASSWORD=…
|
|
asuka build --platform android # dist/OpenChamber.aab
|
|
```
|
|
|
|
`netcfg/` is a native module whose only job is the Android manifest: it merges
|
|
`android:usesCleartextTraffic="true"` into **release** builds too, because
|
|
self-hosted OpenChamber servers are often plain HTTP on a LAN. Asuka enables it
|
|
for debug only. Delete the package (and its blank import in `main.go`) to
|
|
require HTTPS everywhere.
|
|
|
|
Proxies are entered as `http://host:port` or `socks5://host:port`
|
|
(no proxy authentication). Plain `http://` works in debug builds; the release
|
|
cleartext policy is decided in M5 (see `PLAN.md`).
|