Loomi/UAA — 手机端 Hermes 控制入口
Find a file
2026-11-30 02:20:32 +00:00
android init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
branding init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
docs init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
loomi-dsh-plugin init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
loomi-plugin init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
scripts init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
tests init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
.gitignore init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
CHANGELOG.md init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
CONTRIBUTING.md init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
INSTALL.md init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
install.sh init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
LICENSE init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
README.md init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00
SECURITY.md init: Loomi/UAA 手机端 Hermes 控制入口(Android 源码、插件、文档与测试) 2026-11-30 02:20:32 +00:00

Loomi

Your Android phone, as a first-class surface for a self-hosted Hermes Agent.

Loomi is a Hermes Agent platform plugin plus an Android app. It turns a phone into a native control and notification surface for an agent running on your own machine: live streamed answers, tool-call timelines, exec approvals you can answer from the lock screen, cron and background-task notifications, and two-way file transfer.

No Loomi account, no FCM, no Google Play Services, and no Loomi-operated cloud. The phone talks to your gateway over a WebSocket, optionally through your own TLS reverse proxy, with an application-layer encrypted envelope (LMP v3) on top of TLS.

Status: pre-1.0, self-hosted, and not yet published with a release signature. The installable 0.6.0 APK in this tree is debug-signed; a separate unsigned release APK exists for verification. The build consumes the release-keystore environment contract described in docs/RELEASE.md, but no signed 0.6.0 artifact has been produced or verified yet. Do not distribute a debug or unsigned APK as a production build.


What it does

Capability Details
Live conversation The first screen is a normal chat. Messages you send go into one continuous Hermes session; the answer streams into bubbles as it is produced. History is local to the phone.
Tasks with timeline detail Every run, tool call, approval and completion is rendered as structured events. The Tasks tab is the index; opening a task shows its timeline. Cron and background jobs appear here without polluting the conversation.
Exec approvals When Hermes asks for permission, the phone gets an approval card with once / session / always / deny. The first surface to answer wins; other devices get approval.resolved.
Notifications without FCM Gateway notifications, cron results, background-task completions and kanban wakes are pushed over the existing socket. There is no push service in the middle.
Files both ways Send photos and documents from the phone; receive images, audio, video and documents from the agent or with hermes loomi send-file. Transfers are chunked, SHA-256 verified, and capped at 64 MiB.
Host + balance cards On LMP v2/v3 connections the Settings screen can show host CPU/memory/disk/temperature, gateway uptime, paired devices, and the configured DeepSeek balance. The provider key is read on the server and never sent to the phone.
Multiple phones Pair more than one device. Events are broadcast; approvals are first-come-first-served. Devices can be revoked individually.
Encrypted by default on v3 Authenticated ephemeral ECDH (P-256), HKDF-SHA256, AES-256-GCM, per-connection keys and counters. See Security.
No GMS required Works on Android 8.0+ without Google services. The long-lived connection runs in a foreground service with a boot receiver.

The UI is currently Chinese; commands and protocol/API names are English. The app is intentionally small: Kotlin, Jetpack Compose, OkHttp, ZXing for QR scanning, and no analytics SDK.

Architecture

Loomi is not a separate agent server. The plugin runs inside the Hermes gateway process and registers a platform adapter. Everything else reuses existing gateway machinery.

┌──────────────────────┐        WSS (TLS) + LMP v3 envelope        ┌──────────────────────────────┐
│  Loomi Android app   │  ───────────────────────────────────────▶  │  loomi-plugin                │
│  Compose UI          │                                            │  aiohttp WebSocket :8788/ws  │
│  foreground service  │  ◀───────────────────────────────────────  │  pairing / device store      │
└──────────────────────┘   run.*, approval.*, notification, file.*  │  E2EE, files, sysinfo        │
                                                                    └──────────────┬───────────────┘
                                                                                   │ platform adapter
                                                                                   │ + gateway hooks
                                                                    ┌──────────────▼───────────────┐
                                                                    │  Hermes Gateway / core       │
                                                                    │  sessions, approvals, cron   │
                                                                    └──────────────┬───────────────┘
                                                                                   │ model + tool calls
                                                                    ┌──────────────▼───────────────┐
                                                                    │  Your model provider/tools   │
                                                                    └──────────────────────────────┘

The plugin uses only public Hermes extension points: ctx.register_platform, ctx.register_hook, and ctx.register_cli_command. No Hermes core file is modified.

Quickstart

1. Server

Prerequisites: a working Hermes Agent installation, Python 3.12+ in its runtime environment, and a reachable URL for the phone (LAN address or public HTTPS hostname). See INSTALL.md for every deployment shape.

# From the unpacked release directory
./install.sh --public-url wss://hermes.example.com/ws --restart --yes

hermes loomi status     # expect: running, bind 127.0.0.1:8788
hermes loomi pair       # prints a one-time QR code
  • If the gateway is already running, the installer refuses to replace the plugin unless you pass --restart (or stop the gateway yourself). This is deliberate: copying plugin files under a live process is not a supported upgrade path.
  • --public-url is the exact URL the phone will dial. It must be reachable from the phone and must use wss:// unless you are deliberately pairing over a trusted LAN with --allow-insecure-bind.
  • Behind a TLS reverse proxy, keep the plugin on 127.0.0.1. The proxy must forward WebSocket upgrades and should block /internal/; the server also requires a local per-process control token. See INSTALL.md.

For a LAN-only direct-TLS setup, pass your certificate and a LAN URL:

./install.sh \
  --host 0.0.0.0 --port 8788 \
  --tls-cert /etc/loomi/fullchain.pem \
  --tls-key  /etc/loomi/privkey.pem \
  --public-url wss://192.168.1.20:8788/ws \
  --restart --yes

2. Android

  1. For testing, install Loomi-0.6.0-debug.apk. That artifact is debug-signed; 0.6.0 adds the release-signing contract, but a signed release artifact has not been produced yet. See the warning above.
  2. Open Loomi, allow notifications, and grant camera access for pairing.
  3. Run hermes loomi pair on the server and scan the QR code.
  4. Send a message or ask the agent to run a command and approve it from the approval card.

Local 0.6.0 artifacts (not a release):

  • Loomi-0.6.0-debug.apk — installable, debug key.
  • Loomi-0.6.0-unsigned.apk — release variant, must be signed before install.
  • Loomi-0.6.0-source.tar.gz — source snapshot (no build outputs, APKs or backups).
  • Loomi-0.6.0-SHA256SUMS — verify with sha256sum -c Loomi-0.6.0-SHA256SUMS.

Building from source instead:

cd android
./gradlew assembleDebug
# app/build/outputs/apk/debug/app-debug.apk

The debug build uses application ID suffix .debug, so it can coexist with a release build but has separate app data and must be paired separately.

3. Verify

hermes loomi status
hermes loomi devices
curl -fsS http://127.0.0.1:8788/health    # local check; do not expose /internal/

The phone's Settings screen has a connection diagnostics card. See INSTALL.md for the full checklist.

Compatibility

Component Current / tested Notes
Hermes Agent v0.21.6+387.gdce1e9b (2026.9.24) The plugin manifest does not declare requires_hermes. Re-run hermes plugins doctor ./loomi-plugin after a Hermes upgrade.
Loomi plugin manifest 0.6.0 Aligned with the app in the 0.6.0 working tree.
Loomi Android 0.6.0 (versionCode 15) minSdk 26 (Android 8.0), targetSdk 36, compileSdk 37.
Python 3.12+ recommended; tested on 3.14.7 The gateway's runtime venv is the supported interpreter. The smoke suite uses 3.12+ f-string syntax.
Python packages aiohttp, qrcode, cryptography Declared in loomi-plugin/plugin.yaml; the installer can install them into the gateway venv.
Android 8.0 (API 26) and newer No Google Play Services, no FCM.
APK signing debug APK + unsigned release APK built; no signed release yet Release builds read LOOMI_KEYSTORE, LOOMI_KEYSTORE_PASSWORD, LOOMI_KEY_ALIAS and LOOMI_KEY_PASSWORD; without them the release variant is unsigned. A signed release artifact is still required before distribution.

LMP protocol matrix

LMP (Loomi Protocol) is negotiated per connection. The 0.6.0 server defaults to a minimum of v3; v1 and v2 are opt-in for legacy clients (LOOMI_MIN_PROTOCOL=1 or 2). The current app prefers v3 and rejects a negotiated v2/v1 downgrade when it has pinned a v3 identity from the QR.

Version Transport protection What it adds Status
v1 TLS (or trusted LAN plaintext) only Frames, pairing, events, approvals, notifications, task list Legacy compatibility; no E2EE
v2 Static ECDH P-256 + HKDF + AES-256-GCM Application-layer envelope, files, system info, balance Legacy compatibility; no forward secrecy or server authentication
v3 Authenticated ephemeral ECDH per connection, ECDSA-signed transcript, sid-bound AAD, deterministic nonce Forward secrecy; cross-connection replay rejected; server identity verified against the key pinned from the QR (e2ee_fp) Default and normative

The authoritative contract is docs/PROTOCOL.md. docs/LMP-v2-SPEC.md is the historical v2 spec and the design rationale for v3; it is not a second normative source.

Version alignment

The 0.6.0 working tree aligns the plugin manifest (0.6.0) and the Android app (0.6.0, versionCode 15). Earlier 0.1.0–0.5.5 debug APKs are archived under backup/apk-history/; none of them contains the 0.6.0 security fixes. A release must still produce and verify a signed 0.6.0 APK before it can be called a public release.

Security posture

Loomi is built for a personal gateway, not a multi-tenant service.

  • v3 by default. The adapter refuses clients below LMP v3 unless the operator explicitly sets LOOMI_MIN_PROTOCOL to 1 or 2. Legacy modes are for older phones and are labelled as such in the app.
  • Loopback by default. The listener binds 127.0.0.1:8788 unless you change it. A non-loopback bind without TLS is refused at startup (LOOMI_ALLOW_INSECURE_BIND=true is the explicit, dangerous override).
  • Local CLI control plane. /internal/* requires a random per-process token written to $HERMES_HOME/loomi-control-token (mode 0600); a reverse proxy that forwards a forged Host cannot mint pairing tokens.
  • TLS is still required. LMP v3 encrypts application frames, but TLS protects the pairing token, request metadata and the transport itself. Do not run a public deployment on ws://.
  • E2EE protects phone ↔ plugin. The plugin decrypts before handing content to Hermes. The gateway, anyone with root on the server, and your model provider can see plaintext. E2EE does not hide traffic timing or sizes.
  • Pairing is a one-time secret. hermes loomi pair mints a single-use token with a 300-second default TTL, renders it as a QR code, and talks to the gateway over a loopback-only internal endpoint. Only a SHA-256 hash of the device credential is stored on disk; the plaintext credential appears once in the hello.ok frame.
  • The QR pins the server identity. The 0.6.0 pairing payload carries e2ee_fp; the app stores it before the first handshake and rejects a server whose static key does not match. A QR from an older server has no e2ee_fp, so the app marks that connection unverified rather than pretending it is pinned. Do not use an unverified legacy QR for sensitive work.
  • Revocation works immediately. hermes loomi revoke <device_id> marks the credential revoked and closes the live connection. The device must be paired again. See SECURITY.md for the full threat model, storage map and hardening checklist.
  • Reverse proxies must block /internal/. Internal endpoints require a loopback peer, a loopback Host header and JSON POSTs. Still block them at the proxy: a misconfigured proxy that rewrites Host to loopback could otherwise expose the CLI control plane. The nginx/Caddy examples in INSTALL.md block them.
  • Only debug APKs exist today. Debug keys are not secret and are not a release trust anchor. The 0.6.0 release build is wired to a real keystore contract, but a signed artifact and signature verification are still required before distribution.

Repository layout

loomi-plugin/          Hermes platform plugin (Python, aiohttp, no core changes)
android/               Kotlin + Compose Android app
tests/                 Server smoke / contract / diagnostic harnesses
docs/                  Protocol, release and deployment documentation
install.sh             Universal server installer (dry-run, backup, restart/uninstall)
scripts/               Maintainer helpers

Documentation

Tests

scripts/run-server-tests.sh all    # 193 server checks + contract checks
cd android && ./gradlew testDebugUnitTest

The server harness creates a throwaway HERMES_HOME; it does not touch a live gateway. The installer can be checked without side effects:

bash -n install.sh
./install.sh --dry-run --public-url wss://hermes.example.com/ws --yes

Status and roadmap

Loomi is usable today for a personal gateway, but it is not a finished public release. The remaining release blockers are tracked in CHANGELOG.md and docs/RELEASE.md:

  • produce and verify a release-signed 0.6.0 APK (the contract is wired, but no signed artifact exists yet);
  • reproducible CI for the server and Android test suites;
  • test the legacy-QR path that remains unverified (a QR without e2ee_fp);
  • publish a public repository URL and security contact for the private-advisory flow.

中文快速开始

Loomi = Hermes Agent 的 Android 原生入口。手机不是独立客户端,而是网关里的一个平台适配器。

# 1. 服务端(在 Loomi 发布目录中执行)
./install.sh --public-url wss://hermes.example.com/ws --restart --yes
hermes loomi status
hermes loomi pair        # 终端出现一次性二维码
  1. 手机安装发布页的 APK(目前只有 debug 包;0.6.0 已接入 release 签名环境变量,但还需要产出并校验签名包)。
  2. 打开 Loomi,允许通知与相机,扫描 hermes loomi pair 输出的二维码。
  3. 在对话页发消息;需要审批时,在通知或审批页选择「仅一次 / 本会话 / 始终 / 拒绝」。

默认只监听 127.0.0.1;公网部署请用 nginx/Caddy 终止 TLS,并在反代上封禁 /internal/。 完整步骤见 INSTALL.md,安全边界见 SECURITY.md。

License

MIT — see LICENSE. Copyright (c) 2026 Loomi contributors.