Commit graph

1293 commits

Author SHA1 Message Date
Till-JS
e357f9f292 feat(matrix-stt-bot): add speech-to-text Matrix bot
- New bot that transcribes voice messages to text
- Uses mana-stt service (Whisper/Voxtral) for transcription
- Supports German and English with auto-detection
- Commands: !language, !model, !status, !help
- Runs on port 3024

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:29:34 +01:00
Till-JS
d7236d61fa debug: add detailed logging for gift redemption 2026-02-14 14:28:37 +01:00
Till-JS
79f1155dfd feat(nutriphi-bot): auto-analyze text meal descriptions
- Add looksLikeMealDescription() heuristic to detect meal descriptions
- Add autoAnalyzeText() to handle automatic text analysis
- Text messages with food keywords or numbers are now auto-analyzed
- Skip greetings and questions to avoid false positives
2026-02-14 14:18:10 +01:00
Till-JS
43ac782892 docs(matrix-bot-common): document bot-to-bot loop prevention
Added documentation for the isBot() method and automatic bot message
filtering that prevents infinite loops when multiple bots share a room.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:05:34 +01:00
Till-JS
97264cd849 🔧 chore(clock-bot): add detailed topic update logging 2026-02-14 14:03:04 +01:00
Till-JS
ab677b28c8 🐛 fix(gifts): explicitly set nullable fields to null in DB inserts
Drizzle ORM requires explicit null values for optional fields instead of
leaving them undefined. Added explicit null for organizationId,
idempotencyKey, portionNumber, and creditTransactionId.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:02:46 +01:00
Till-JS
102f0df518 🔧 chore(clock-bot): improve room topic error logging 2026-02-14 13:52:20 +01:00
Till-JS
72b162524c 🐛 fix(gifts): convert undefined sourceAppId to null for Drizzle
Drizzle ORM throws "UNDEFINED_VALUE" error when inserting undefined values.
Convert dto.sourceAppId to null using nullish coalescing operator.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:50:01 +01:00
Till-JS
ba818ef256 fix(clock-bot): improve room topic error logging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:47:15 +01:00
Till-JS
5ef04eabb2 🐛 fix(nutriphi-backend): change user_id from uuid to text
Better Auth generates string IDs, not UUIDs. Updated schema to match
other apps like Calendar that use text for user_id.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:44:05 +01:00
Till-JS
2e8b3b903b fix(matrix-bot-common): ignore messages from other bots
Prevents infinite message loops when multiple bots are in the same room.
Checks if sender has '-bot' in their Matrix user ID localpart.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:40:59 +01:00
Till-JS
c8ab4bbcbe 🐛 fix(nutriphi-web): fix i18n hydration error
- Don't call $t() before i18n is loaded
- Use loading spinner instead of translated text during load
- Conditionally render title in svelte:head

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:39:35 +01:00
Till-JS
992181cc87 feat(clock-bot): add timer status to room topic (Phase 3)
- Store original room topic when timer starts
- Update room topic with timer progress every 10 seconds
- Show status icon, remaining time, percentage, and label
- Restore original topic when timer finishes or is deleted

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:36:08 +01:00
Till-JS
db7f2dfe08 🐛 fix(nutriphi-web): add shared-api-client to Dockerfile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:32:52 +01:00
Till-JS
1052dcafca 🐛 fix(nutriphi-web): add missing shared packages to Dockerfile
Add shared-vite-config and shared-tsconfig to Dockerfile COPY statements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:50:01 +01:00
Till-JS
8dad8a8302 🐛 fix(manacore-web): use runtime auth URL instead of hardcoded localhost
Added shared config.ts with getManaAuthUrl() that reads the auth URL from
window.__PUBLIC_MANA_CORE_AUTH_URL__ (injected by hooks.server.ts) instead
of hardcoded localhost:3001. Fixes API calls failing on production.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:47:40 +01:00
Till-JS
5025bfa883 fix(clock-bot): optimize widget styling for Element info panel
- Use transparent background to adapt to Element theme
- Remove min-height and centering (content starts at top)
- Reduce font sizes and spacing for compact display
- Use semi-transparent backgrounds for theme compatibility
- Add flex-wrap for narrow panels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:46:19 +01:00
Till-JS
0a41640c19 chore(onboarding-bot): add bot user creation script
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:43:29 +01:00
Till-JS
a6fc1cb66e feat(onboarding): add Matrix onboarding bot for profile setup
- Add matrix-onboarding-bot service that guides users through profile setup
- Extend mana-core-auth GlobalSettings with displayName, interests, onboardingCompleted fields
- Implement state machine for onboarding flow (NAME → INTERESTS → LANGUAGE → SUMMARY)
- Support commands: !start, !profile, !edit, !skip, !help
- Add German and English localization
- Integrate with mana-core-auth Settings API for profile persistence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:42:41 +01:00
Till-JS
531ed3e215 📝 docs(nutriphi): update Gemini model version to 2.5 Flash
- Updated Technology Stack to reflect gemini-2.5-flash model
- Added note about getting API key from Google AI Studio

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:41:32 +01:00
Till-JS
e4ac539495 chore: update pnpm-lock.yaml for clock-bot @types/express
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:39:16 +01:00
Till-JS
c13c313886 🐛 fix(gifts): reorder controller routes to fix 'me/*' matching
NestJS matches routes in declaration order. The dynamic :code route was
matching before me/created and me/received, treating 'me' as a gift code.
Moved specific routes before the dynamic parameter route.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:38:23 +01:00
Till-JS
b1eaa88e6e 📝 docs(stats-bot): add Redis and Matrix-SSO-Link environment variables
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:35:15 +01:00
Till-JS
07ac2e845e 🔧 fix(stats-bot): add Redis and Matrix-SSO-Link for auto-login
- Add REDIS_HOST, REDIS_PASSWORD for session storage
- Add MANA_CORE_AUTH_URL, MANA_CORE_SERVICE_KEY for Matrix-SSO-Link
- Add redis dependency to depends_on
- Use local image build instead of GHCR

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:31:35 +01:00
Till-JS
139c04040d refactor(stats-bot): swap commands - !stats for personal, !global for global
- !stats now shows personal stats (requires login)
- !global now shows global Umami analytics
- Update keywords and help text accordingly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:26:52 +01:00
Till-JS
12451092f1 📝 docs(tts): document German voice support (Piper/Kerstin)
- Add Piper TTS section to mana-tts CLAUDE.md
- Document available German voices (local and cloud)
- Update matrix-tts-bot CLAUDE.md with new default voice
- Add language auto-detection documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:21:40 +01:00
Till-JS
209a474f17 🩹 fix(gifts): add duplicate claim check to first_come type
Users can now only redeem first_come gift codes once, making it
suitable for promo codes that should be unlimited but once per user.
2026-02-14 12:19:43 +01:00
Till-JS
acf4512e90 fix(session): add auto-refresh for expired JWT tokens
- Add isTokenValid() to decode JWT and check exp claim
- Refresh tokens 60 seconds before expiry (buffer)
- Auto-fetch fresh token via SSO-Link when cached token expires
- Clear invalid sessions when refresh fails
- Prevents "exp claim timestamp check failed" errors

JWT tokens from mana-core-auth expire after 15 minutes, but sessions
were cached for 7 days. Now tokens are transparently refreshed when
they expire, keeping users authenticated.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:19:08 +01:00
Till-JS
4b950b7083 feat(tts): add de_kerstin female German voice and set as default
- Download and configure Kerstin Piper voice (63MB, local)
- Update piper_service.py to support multiple voice models
- Set de_kerstin as default voice for TTS bot
- Update help text with new voice options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:16:58 +01:00
Till-JS
01b011235f 🩹 fix(mana-tts): add Piper/German voice support to /synthesize/auto endpoint
The auto endpoint now properly routes German voices (de_thorsten, de_katja, etc.)
to Piper TTS instead of falling back to English Kokoro voices.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:08:17 +01:00
Till-JS
5af965ea90 feat(clock-bot): add live timer progress with message editing
- Add editMessage() method to BaseMatrixService for Matrix message editing
- Implement live timer updates every 10 seconds using background interval
- Display progress bar using Unicode block characters (█░)
- Track active timers and update messages with current state
- Show percentage completion and remaining time
- Handle timer pause/resume/finish states
- Clean up tracking on timer completion or errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:07:28 +01:00
Till-JS
c221f92da2 🩹 fix(nutriphi): update Gemini model from expired gemini-2.0-flash-exp to gemini-2.5-flash
The experimental model gemini-2.0-flash-exp no longer exists. Updated to
the stable gemini-2.5-flash model.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:06:40 +01:00
Till-JS
a4ef703761 feat(manacore): add gift code web UI
Add web interface for redeeming and managing gift codes:
- API service for all gift operations (create, redeem, list, cancel)
- Public preview page at /g/[code] for gift info before login
- Protected redemption flow with riddle support
- Dashboard with tabs: received gifts, created codes, create new
- Gift icon added to navigation and shared-ui
2026-02-14 12:01:24 +01:00
Till-JS
acd8d02ec8 🔧 fix(clock-bot): use local build with SSO-Link auth
- Switch from GHCR image to local build
- Add MANA_CORE_AUTH_URL, MANA_CORE_SERVICE_KEY for SSO-Link
- Add Redis config for session storage
- Add dependencies on mana-auth and redis

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:57:53 +01:00
Till-JS
0099e1eebc chore(matrix-tts-bot): set German (de_thorsten) as default voice
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:55:47 +01:00
Till-JS
67f3d3020a fix(matrix-tts-bot): use /synthesize/auto endpoint for German voices
The /synthesize/piper endpoint doesn't exist - use /synthesize/auto
which automatically routes to the correct TTS backend based on voice.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:30:37 +01:00
Till-JS
2521a1ea73 feat(matrix): sync recent emojis across apps via mana-core-auth
- Add recentEmojis field to GlobalSettings in shared-theme
- Create userSettings store for Matrix app with JWT token management
- Exchange session cookie for JWT after SSO login
- Update MessageInput to use userSettings instead of localStorage
- Add recentEmojis support to mana-core-auth settings API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:30:17 +01:00
Till-JS
83c75ce90e 🩹 fix(nutriphi-bot): use correct API field name for image analysis
Change 'image' to 'imageBase64' to match the NutriPhi backend API spec.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:28:46 +01:00
Till-JS
d81b8aebf2 🔒 refactor(bots): remove !login command and enforce OIDC-only auth
- Remove !login and !logout commands from all 16+ Matrix bots
- Remove login/logout references from all help/welcome messages
- Disable password login in Synapse (password_config.enabled: false)
- System is now OIDC-only via Mana Core authentication

Users must authenticate via "Sign in with Mana Core" in Element.
Existing bot access tokens remain valid.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:26:58 +01:00
Till-JS
c698318c91 chore(deploy): add PROMETHEUS_URL to stats-bot config
Connect stats-bot to VictoriaMetrics for infrastructure
monitoring commands (!system, !services, !traffic, !db, !growth)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:25:18 +01:00
Till-JS
bd7f19718c feat(stats-bot): add infrastructure monitoring commands
Add 5 new commands powered by Prometheus/VictoriaMetrics:
- !system: Mac Mini status (CPU, RAM, Disk, Uptime, Load)
- !services: Backend service health (UP/DOWN)
- !traffic: HTTP traffic & latency per service
- !db: PostgreSQL & Redis status
- !growth: User growth statistics

New modules:
- PrometheusService: Query Prometheus/VictoriaMetrics API
- InfrastructureService: Generate infrastructure reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:24:31 +01:00
Till-JS
e88597cd20 feat(gifts): add gift code creation script and initial codes
- Add create-gift-codes.mjs script for batch gift code generation
- Create 10 gift codes with 1000 Mana each for distribution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:23:08 +01:00
Till-JS
4a26926fae 🩹 fix(bot-services): export LOGIN_MESSAGES and auth error helpers
Export the following from @manacore/bot-services:
- LOGIN_MESSAGES: Pre-defined auth error messages for all bot types
- AUTH_ERROR_MESSAGES: Same as LOGIN_MESSAGES (preferred name)
- formatAuthErrorMessage(): Helper to create custom auth error messages

These are used by bots to show consistent error messages when token
refresh fails and the user needs to re-authenticate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:19:55 +01:00
Till-JS
ff1affb268 🩹 fix(nutriphi-bot): add automatic token refresh on JWT expiration
When the JWT token expires (15 min), the bot now automatically:
1. Detects the 401 "exp claim" error
2. Clears the expired session
3. Attempts to fetch a new token via Matrix-SSO-Link
4. Retries the failed operation with the new token

This prevents users from getting authentication errors after 15 minutes
of inactivity.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:18:19 +01:00
Till-JS
c843531595 feat(analytics): update Umami tracking IDs for all web apps
Update all 15 web apps with correct Umami website IDs:
- calendar, chat, clock, contacts, manacore, manadeck, picture, planta, todo: updated IDs
- zitare, storage, nutriphi, skilltree, photos, presi: added tracking

All IDs now match the websites configured in Umami.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:14:16 +01:00
Till-JS
0f234a0ce6 fix(matrix-tts-bot): use WAV format for better Matrix compatibility
MP3 format was causing "no supported sources" error in Element.
Switch to WAV which has broader browser/client support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:09:56 +01:00
Till-JS
aff2db9f9c feat(matrix): add recently used emojis section in emoji picker
- Store recently used emojis in localStorage (max 16 = 2 rows)
- Display "Häufig benutzt" section at top of emoji picker
- Most recently used emoji moves to front of list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:08:31 +01:00
Till-JS
e013384d29 chore(docker): build matrix-tts-bot locally instead of from registry
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:04:44 +01:00
Till-JS
fa7fb3c294 🩹 fix(matrix-bots): use authenticated media download for all bots
The Matrix Media API now requires authentication (spec v1.11+). Updated
all 5 affected bots to use downloadMedia() from BaseMatrixService which
handles authenticated downloads via /_matrix/client/v1/media/download/.

Affected bots:
- matrix-nutriphi-bot (images + audio)
- matrix-zitare-bot (audio)
- matrix-todo-bot (audio)
- matrix-ollama-bot (images)
- matrix-project-doc-bot (images + audio)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:04:13 +01:00
Till-JS
70e45ed82e fix(matrix-stats-bot): adapt to Umami v2 API response format
The Umami API returns stats in a different format than expected:
- Before: { pageviews: { value, change } }
- After: { pageviews: number, comparison: { pageviews: number } }

Transform the raw API response to the expected format and calculate
percentage change from comparison values.

Also update URL_SCHEMA.md with complete list of all mana.how services.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 11:03:03 +01:00