jmj 998327df53 feat(android): add ai-speaker music player preset page
A self-contained page that drives the ai-speaker MCP server over
Streamable HTTP, so playback can be controlled from the TV remote.

Player state
- player_status is the single source of truth. Polling syncs playing,
  source, title, elapsed, duration, progress and remaining once per
  second while playing, and stops when playback ends.
- Switching tracks opens a short freeze window (pendingSource): the
  server keeps reporting the previous source for a few hundred ms, and
  without the freeze the list highlight would snap back to the old row
  and then jump forward again. While frozen only progress is updated.
- Clicking the row that is already playing is a no-op instead of
  restarting it. force=true is reserved for repeat-one and manual
  prev/next, which must replay even when the source is unchanged.

List rendering
- The list is rebuilt only on boot, after list_music, and on explicit
  refresh. Play state changes go through refreshPlayingMark, which
  toggles classes on existing nodes. Rebuilding on every poll popped the
  entrance animation and reset the remote focus once per second.
- A loading overlay covers the list during the initial load and manual
  refresh, with an 8s timeout so a hung request cannot leave it stuck.

Playback modes
- List loop, shuffle and repeat-one, cycling from one button. prev/next
  use pickByManual so they still move when repeat-one is active.
- Natural end of a track advances according to the mode; the check
  requires elapsed to be within 3s of duration so a manual stop does not
  trigger it.

UI notes
- Volume uses the 0-100 scale the server reports, with remote left/right
  stepping by 1. The UI keeps the requested value rather than the
  returned actual, which the speaker quantizes to roughly 5% steps and
  would otherwise make +1 appear to fall back.
- Icons are inline SVG instead of emoji to match the dark theme.
- Avoids CSS the bundled WebView 84 does not support: inset shorthand
  collapsed the overlay to a small box, and filter on a gradient element
  made the play button disappear when focused.

mcp.sh is a small helper for calling a single MCP tool from the shell.
2026-11-30 11:06:35 +08:00

PulseWall

AI-driven Android 11 live information wall, real-time device status monitor, and bidirectional MCP interactive terminal.

Repository Layout

  • protocol/ — Canonical architecture, MCP schema, and WebSocket protocol specs:
    • protocol/architecture.md
    • protocol/mcp-schema.md
    • protocol/ws-protocol.md
  • hub/ — Python Central Bridge (FastAPI + official MCP Streamable HTTP + WebSocket device gateway + SQLite + Web Admin Panel + LAN-only ADB Debug controller)
  • android/ — Android 11 (minSdk = 30) native Kotlin client with layered basic/root telemetry, offline Vue 3 + PulseWall CSS framework, offscreen pre-render validation sandbox, runtime console watchdog, OpenAI-compatible on-device Repair Sentinel, and unbreakable native alert/alarm layer.

Quick Start

1. Start the Python Hub

cd /data/working/PulseWall/hub
./run_hub.sh
  • Web Admin Panel: http://<hub-ip>:8765/admin
  • Generic MCP Endpoint (Streamable HTTP): http://<hub-ip>:8765/mcp/
  • Upstream Plugin Event Stream (SSE): http://<hub-ip>:8765/api/events/stream
  • Android WebSocket Gateway: ws://<hub-ip>:8765/ws/device/{device_id}
  • LAN-Only Developer Debug / ADB API: POST http://<hub-ip>:8765/api/lan-debug/{device_id}/action

2. Build the Android 11 APK

/data/working/PulseWall/android/build_apk.sh

Output APK: android/app/build/outputs/apk/debug/app-debug.apk

3. First-Time Pairing

  1. Install app-debug.apk onto your Android 11 device.
  2. Tap the top-right floating status pill (⚙) to set your Hub WebSocket URL (ws://<hub-ip>:8765) and device name.
  3. Open http://<hub-ip>:8765/admin to verify live device telemetry & DisplayProfile, configure your OpenAI-compatible end-side Repair AI model (pushed live to the device), and test feed/alarm/dynamic canvas rendering.
S
Description
No description provided
Readme
1 MiB
0 Stars 1 Watchers 0 Forks
Languages
Python 38.8%
Vue 19%
Kotlin 17.5%
HTML 16.6%
JavaScript 5.8%
Other 2.3%