ai-app: a phone interface to Claude Code and llama.cpp sessions
A Rust backend that owns the sessions and an Android app that reads them. The server spawns and adopts CLI processes, normalises everything they emit into one event model, keeps the transcript, and serves it over pinned TLS on a WireGuard interface; the phone streams that, replies, sends images, and imports conversations the machine already has. `AGENTS.md` is the working guide -- what runs where, what has been measured, and the faults that were expensive to find. `PLAN.md` is the design record. History before this point was squashed away. It was a personal project's running commentary and carried a name and a couple of machine paths that have no business in a public repository; the tree is what mattered and the tree is here.
This commit is contained in:
commit
b172c464ea
100 files changed
+31795
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package com.example.aiapp
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.example.wgapplink.ServerStore
|
||||
|
||||
/**
|
||||
* Where the backend is and how to authenticate to it. Absent until the phone is enrolled -- by
|
||||
* scanning the server's terminal QR (an `aiapp://enroll` URI the camera app hands to MainActivity)
|
||||
* or by typing the fields into the settings screen.
|
||||
*/
|
||||
typealias ServerSettings = com.example.wgapplink.ServerSettings
|
||||
|
||||
/**
|
||||
* This app's enrollment, which is the whole of what is product-specific about it.
|
||||
*
|
||||
* Both values are load-bearing and neither may be changed casually. The scheme is what routes a
|
||||
* scanned QR here rather than to Dev Updater, and the key alias names the Android Keystore key the
|
||||
* token is already sealed under on every enrolled phone -- changing it would leave those phones
|
||||
* reading as not enrolled, with no error to explain why.
|
||||
*/
|
||||
private val store = ServerStore(scheme = "aiapp", keyAlias = "aiapp-token-key")
|
||||
|
||||
fun loadServerSettings(context: Context): ServerSettings? = store.load(context)
|
||||
|
||||
fun saveServerSettings(context: Context, settings: ServerSettings) = store.save(context, settings)
|
||||
|
||||
fun parseEnrollmentUri(uri: Uri): ServerSettings? = store.parseEnrollmentUri(uri)
|
||||
Reference in new issue
Block a user