Add rage table-flip state; wire gateway to live Speaches; add CI pipeline
- Face: new 'rage' state — 3-frame kaomoji loop (stare, flip the table, put it back) for in-flight request failures; 'error' stays the quiet persistent face for a dead link. Sim + artifact + design doc updated. - Gateway: stt.py/tts.py are now pluggable backends. Default 'speaches' talks OpenAI-format HTTP to the live container on :8601 (faster-whisper-small STT, Kokoro bm_george TTS with 24->16 kHz audioop resample); 'embedded' fallback kept behind the [speech] extra. Verified with a live TTS->STT round trip (warm: STT 0.27s, TTS 1.9s). Docker image is now slim (no CUDA/ML deps). Python pinned to 3.12 (system 3.8 too old, audioop gone in 3.13). - CI: .gitea/workflows/build.yml — lint+test on main pushes; on v* tags test, build gateway image, push to registry, release, and trigger Watchtower (tatlock pattern; needs REGISTRY_USER/REGISTRY_PASSWORD/ WATCHTOWER_TOKEN secrets). Runtime stack in deploy/desklock-gateway.yml. - architecture.md: measured speech latencies, deployed-Speaches status, CI & deployment section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+24
-2
@@ -74,6 +74,9 @@
|
||||
body[data-state="effort"] #elapsed { display: block; }
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
body[data-state="rage"] #eyes { font-size: 70px; }
|
||||
body[data-state="rage"] #mouth { display: none; }
|
||||
|
||||
@keyframes breathe { 0%,100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
|
||||
@keyframes jitter { 0% { transform: translate(1px,-1px); } 100% { transform: translate(-1px,1px); } }
|
||||
|
||||
@@ -116,9 +119,13 @@ const STATES = {
|
||||
effort: { eyes: "> <", mouth: "~", blink: false, rain: { streams: 40, speed: 16 } },
|
||||
speaking: { eyes: "^ ^", mouth: "o", blink: true, talk: true,
|
||||
rain: { streams: 14, speed: 9 } },
|
||||
rage: { mouth: "", blink: false, rain: { streams: 34, speed: 20 },
|
||||
frames: [ { t: "(°□°) ┬─┬", ms: 900 },
|
||||
{ t: "(╯°□°)╯︵ ┻━┻", ms: 1300 },
|
||||
{ t: "┬─┬ ノ( º_º ノ)", ms: 1400 } ] },
|
||||
error: { eyes: "x x", mouth: "-", blink: false, rain: { streams: 0, speed: 0 } },
|
||||
};
|
||||
const ORDER = ["idle", "listening", "pensive", "effort", "speaking", "error"];
|
||||
const ORDER = ["idle", "listening", "pensive", "effort", "speaking", "rage", "error"];
|
||||
const TALK = ["o", "O", "-", "O", "=", "o"];
|
||||
const GLYPHS = "アイウエオカキクケコサシスセソタチツテトナニヌネノ0123456789ACEFHKZ$#%*+=<>";
|
||||
|
||||
@@ -161,12 +168,27 @@ function frame(now) {
|
||||
|
||||
/* ---- face behaviour ---- */
|
||||
function applyFace() {
|
||||
eyesEl.textContent = st().eyes;
|
||||
eyesEl.textContent = st().eyes || "";
|
||||
mouthEl.textContent = st().mouth;
|
||||
thoughtEl.textContent = "";
|
||||
document.body.dataset.state = cur;
|
||||
document.querySelectorAll("#controls button[data-state]").forEach(
|
||||
(b) => b.classList.toggle("active", b.dataset.state === cur));
|
||||
playFrames();
|
||||
}
|
||||
|
||||
/* whole-line kaomoji sequences (rage) render through the eyes slot */
|
||||
let animGen = 0;
|
||||
function playFrames() {
|
||||
const gen = ++animGen;
|
||||
const frames = st().frames;
|
||||
if (!frames) return;
|
||||
let i = 0;
|
||||
(function step() {
|
||||
if (gen !== animGen) return;
|
||||
eyesEl.textContent = frames[i % frames.length].t;
|
||||
setTimeout(step, frames[i++ % frames.length].ms);
|
||||
})();
|
||||
}
|
||||
function setState(name) { cur = name; stateSince = performance.now(); applyFace(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user