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:
iris committed 2026-08-31 20:29:07 -04:00
commit b172c464ea
100 files changed
+31795

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
# Builds this app and runs it on this checkout's emulator.
#
# The emulator half of this -- which AVD this checkout means, creating it,
# booting it headless, and refusing to start one the machine has no room for
# -- lives in ~/repos/emulator-tools and is shared with every other Android
# checkout here. This script kept its own copy of that sequence until
# 2026-08-30, as did dev-updater's and ai-app's, and three copies of "boot an
# emulator" is three places for the memory check that was missing from all of
# them.
#
# Environment setup (SDK location, PATH, ...) lives in ./android-env.sh,
# which can also be sourced directly for one-off commands.
set -eu
APP_ID="com.example.aiapp"
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
cd "$SCRIPT_DIR"
# shellcheck source=./android-env.sh
. ./android-env.sh
if ! command -v emu >/dev/null 2>&1; then
echo "run-android.sh: no 'emu' command." >&2
echo " It comes from ~/repos/emulator-tools; run that repo's ./install.sh." >&2
exit 127
fi
# Prints the serial, having created and booted the AVD if it had to. Named
# after the checkout, so this cannot land on another session's emulator --
# and refuses rather than starting one when the machine is short of memory,
# because what an OOM kills is somebody else's work rather than the emulator
# that asked for the memory.
echo "==> Emulator"
SERIAL=$(emu up)
export ANDROID_SERIAL="$SERIAL"
echo "==> Building debug APK"
./gradlew :androidApp:assembleDebug
APK="androidApp/build/outputs/apk/debug/androidApp-debug.apk"
echo "==> Installing and launching $APK"
# ANDROID_SERIAL above is what aims these; the adb wrapper would work it out
# from the checkout anyway, but a script that says which device it means does
# not depend on being run from the right directory.
adb install -r "$APK"
adb shell am start -n "$APP_ID/.MainActivity"