Commit graph

9 commits

Author SHA1 Message Date
5f61b1ebe1 Overlay reloads itself after a deploy (boot ID), versioned asset URLs
OBS kept running the old alert scripts after a deploy, so TTS redeems fell
back to the cassette with no voice. The server now sends a boot ID on every
WebSocket connect; an overlay built with a different ID reloads itself.
Asset URLs carry ?v=<boot ID> so the reload never uses cached files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 15:22:44 +02:00
9e356b0875 TTS blocklist: starter list of slurs/TOS phrases, whole-word matching
- src/tts-blocklist.txt: slurs, self-harm/threat phrases, sexual violence,
  hate slogans (no normal swearing); merged into Settings once
  (tts_blocklist_seeded), editable there afterwards
- Matching is now whole words/phrases with plurals, look-alike swaps and
  spaced-out letters, so raccoon / spicy / therapist / grape are fine

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 15:09:12 +02:00
060b2351f7 TTS redeems: envelope letter with words inked in as spoken
- TTS alerts use the new `tts` style: envelope opens, the letter rises out
  and settles in front near the top, words ink in as the voice says them
  (timed from a loudness curve the server sends: tts.loudness, tts_env,
  tts_prefix); if the voice fails, the full text shows
- Highlight my message keeps its taped note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:42:36 +02:00
4fda6060bf TTS redeems, skip button, per-source chat placement
- Redeem variations can have a TTS voice: the viewer's text is cleaned
  (links out, repeats collapsed, max length, blocked words -> not read),
  spoken as "<name> says: ..." and shown as the big paper note; the
  variation's sound is not played when TTS is on (picker greyed out)
- Settings: TTS max length, say-the-name, blocked words (never sent to
  overlay pages: db.getOverlaySettings)
- Dashboard "Skip current alert" -> /alerts/skip -> overlay skips it
- db.migrate()/addColumn: new columns on existing databases
- Chat: ?chat=left,top,width,height and ?chatflow=up per browser source
  (e.g. the Intermission panel); default unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:34:41 +02:00
b5a81bdb15 Add TTS voice builder (/tts): Piper + espeak, layers, effects
- src/tts.js: synth(config, text) -> cached mp3 in public/tts; up to 3 layers
  (engine, voice, speaker, speed, pitch, volume, delay) mixed with ffmpeg,
  8 effects (stadium, echo, 8-bit, radio, robot, choir, warp, shaky), loudnorm;
  config is clamped and voice/speaker names are restricted to plain names
- tools/tts/worker.py: long-running Python worker (JSON lines), Piper models
  kept loaded (LRU of 4), espeak-ng via libespeak-ng + ctypes
- tools/tts/setup.sh: venv + piper-tts + default voice set
- /tts page: presets, layers, effects, test playback, save/load/delete named
  voices (tts_voices table); TTS link in the nav
- public/tts, tools/tts/venv and tools/tts/voices are gitignored

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 13:06:32 +02:00
463c6580f4 Chat: paper slips under the camera, Twitch + 7TV emotes
- public/chat/chat.css + chat.js (window.HSChat): cream paper slips with the
  name on a washi-tape label, newest on top sliding out from under the webcam,
  older ones glide down and fade at the bottom; message_timeout / max_messages
- Emotes: Twitch (tags.emotes) and 7TV global + channel sets (refreshed every
  10 min), zero-width 7TV emotes stack, emote-only messages get bigger emotes
- Deleted messages, timeouts, bans and /clear remove slips at once
- overlay.ejs: old chat CSS/JS removed, new files load only for ?parts=chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:08:12 +02:00
cdcd3737a7 Wire it up: Twitch events, dashboard, overlay parts, layout editor removed
Twitch / server
- bits via channel.bits.use (cheers + Power-ups, replaces channel.cheer); built-in
  channel point rewards; polls; Hype Train v2; outgoing raids. New scopes:
  channel:read:polls, channel:read:hype_train, channel:manage:raids (log in again).
- Hype Train: alerts on start / each new level / end, plus the progress bar.
- Raid send-off: start/cancel raids from the dashboard (Helix /raids); the card
  stays until channel.raid reports the raid happened.
- StreamElements client started on boot; tip alerts.

Dashboard
- Twitch + StreamElements status, test buttons (poll, Hype Train bar, raid card),
  Raid box, activity Reload + auto-refresh, Redeems in the nav.
- Two-click delete instead of browser confirm() on Media and Actions.

Overlay
- ?parts= splits the overlay into OBS sources: chat, alerts, poll, hypebar, raid,
  or exclusions like ?parts=nochat. Recommended: ?parts=chat (audio Monitor Only,
  chat sounds stay off stream) + ?parts=nochat.
- Now playing switched off (commented, see CLAUDE.md to re-enable).

Removed the layout editor and preview page; chat position/style is baked into
overlay.ejs from the last saved layout (overlay_layout table kept, unused).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 23:18:15 +02:00
d481fc4f69 Add polaroid alerts for follows, subs, gifts, streaks, raids and bits
Overlay
- public/alerts/polaroid.js + .css: animated polaroid (photo drops in, tape
  and heart stick on, caption writes in), randomized angles, per-event art,
  caption, tape colour, badge and sound, fanned photo stack for multi-month
  subs / community gifts / raids, and a queue so alerts never overlap.
- Bits: no alert under 5; sound tiers at 5/50/75/100/150/250.
- Watch streaks are read from chat (USERNOTICE viewermilestone) and reported
  to the server over the overlay WebSocket.

Server
- Subscribe to channel.chat.notification instead of channel.subscribe /
  subscription.message / subscription.gift / channel.raid: one event with
  Prime, months bought at once, gift recipient, resub message and community
  gift totals. Per-recipient gift notices of a gift bomb are skipped, so a
  bomb is one alert (was N+1). Needs the user:read:chat scope (log in again).
- src/alerts.js maps Twitch events to alerts, broadcasts them and still runs
  them through dispatch (activity log + existing actions).
- EventSub starts on boot from the stored login (alerts survive restarts),
  validates the token hourly and refreshes it on expiry or 401, follows
  session_reconnect without dropping events, and reconnects when keepalives
  stop.
- The overlay WebSocket only accepts chat_notice messages from connections
  that pass the overlay UUID; streak notices are deduped by message id.

Dashboard
- Twitch connection status and a test button per alert (POST /alerts/test/:key).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:57:36 +02:00
9e0ddb8182 Update gitignore 2026-11-20 18:55:47 +01:00