interface / externals / clockwork_ghost

PyQt6 desktop client (Raspberry Pi cyberdeck) with 3D visualisation, voice I/O, camera capture, and TTS playback.

client.py

Outbound HTTP

EndpointPurpose
POST /api/chatStreaming chat. SSE chunks accumulated in conversation_history; sentence boundaries (.?!) push to TTS queue.
POST /api/workspace/save · /loadState zip.
POST $STT_SERVER_URL/sttmultipart audio upload.
POST $TTS_SERVER_URL/ttsJSON text → audio bytes.
GET /api/download/{image_path}Fetch agent-generated images.

UI layout

Voice queues

Camera

CameraPreviewDialog via OpenCV VideoCapture on /dev/video0 at 1920×1080 60 fps MJPG. Ctrl+Esc snaps a frame; the user can optionally upload + add a prompt.

Input shortcuts

Stats

Timer every 5 s reads battery from /sys/class/power_supply/*/capacity and shows time + battery + network icon.

Concurrency

qasync.QEventLoop wraps the QApplication so asyncio and Qt cooperate. Async tasks for audio_fetch_task(), audio_worker_task(), send_chat_request(). Signal/slot pattern for cross-thread UI updates.

matrix_face.py — 3D Animated Visualization

External dependencies

Heads-up: URLs and the X-Ghost-Key in client.py are hardcoded placeholders ("YOUR_KEY_HERE", "http://eva:8000", "http://192.168.0.24:8000"). These should be wired to env vars before deployment.