Commit graph

22 commits

Author SHA1 Message Date
Till-JS
b6925e0b63 feat(matrix-bots): enable cross-bot SSO via Redis sessions
All 19 Matrix bots now use SessionModule.forRoot({ storageMode: 'redis' })
to share user sessions across all bots via Redis. Users only need to
login once with any bot to be authenticated with all bots.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:16:22 +01:00
Till-JS
60d2f6422c fix(matrix-bots): update all bots for async SessionService methods
Update all Matrix bots to properly await async SessionService methods
after the migration to Redis-backed session storage. This includes:

- Adding await to getSessionData, getSession, getToken, isLoggedIn calls
- Making requireAuth helper methods async and return Promise<string>
- Making session data helper methods async (getCurrentConversation, etc.)
- Fixing handleLogout and other methods that use session operations

Affected bots:
- matrix-chat-bot (extensive changes for session helpers)
- matrix-clock-bot (getToken helper + session calls)
- matrix-contacts-bot, matrix-manadeck-bot, matrix-nutriphi-bot
- matrix-ollama-bot, matrix-picture-bot, matrix-planta-bot
- matrix-presi-bot, matrix-project-doc-bot, matrix-skilltree-bot
- matrix-storage-bot, matrix-zitare-bot, matrix-tts-bot
- matrix-mana-bot (help handler)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 15:04:30 +01:00
Till-JS
ea0198cc18 fix(bots): install wget for Docker health checks
node:20-slim doesn't include wget or curl, which is required
for the HEALTHCHECK commands in the Dockerfiles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:19:08 +01:00
Till-JS
a8521d7acd 🐛 fix(matrix-bots): disable E2EE crypto module via pnpm override
Add root-level pnpm override to replace @matrix-org/matrix-sdk-crypto-nodejs
with empty-npm-package. This disables E2EE support but allows matrix bots
to run without native module compilation issues.

The bots don't need E2EE since Matrix Synapse handles encryption at
the server level for our use case.

Also removes the explicit pnpm add commands from Dockerfiles since the
override handles the module replacement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:08:28 +01:00
Till-JS
dc0d425f61 🐛 fix(matrix-web): handle Matrix SSO loginToken callback
Add loginWithLoginToken function to exchange Matrix SSO loginToken for credentials.
The app layout now detects the loginToken URL parameter and completes the SSO flow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:02:47 +01:00
Till-JS
38101bca00 🐛 fix(matrix-bots): add pnpm rebuild for native crypto module
The @matrix-org/matrix-sdk-crypto-nodejs package needs a rebuild step
after install to properly select the platform-specific prebuilt binary.
Without this, the module fails to find the correct binding at runtime.

Adds `pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true` after
both the dev and prod install steps in all matrix bot Dockerfiles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:58:05 +01:00
Till-JS
6c937b6c80 🐛 fix(matrix-bots): restore --ignore-scripts to skip root postinstall
The root package.json has postinstall hooks (generate-env, build:packages,
husky) that fail in Docker context. --ignore-scripts prevents these from
running while still allowing the build to complete.

Using node:20-slim (glibc) should handle matrix-sdk crypto modules via
prebuilt binaries without needing install scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:47:04 +01:00
Till-JS
a384bed181 🐛 fix(matrix-bots): switch to node:20-slim for native module support
- Changed base images from Alpine to Debian slim (glibc vs musl)
- Removed --ignore-scripts to allow native module builds
- Fixed user creation commands for Debian-based images

The matrix-bot-sdk requires @matrix-org/matrix-sdk-crypto-nodejs which
needs platform-specific native binaries. Alpine's musl libc causes
compatibility issues with these modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:41:34 +01:00
Till-JS
45152ee954 🚀 feat(matrix-bots): add CI/CD pipeline for automated GHCR deployment
- Update 10 Matrix Bot Dockerfiles for monorepo builds with pnpm
- Add shared package support (bot-services, matrix-bot-common)
- Extend CI pipeline with change detection and build jobs
- Update docker-compose.macmini.yml to use GHCR images
- Enable Watchtower auto-updates for Matrix Bots

Bots: mana, ollama, stats, project-doc, todo, calendar, nutriphi, zitare, clock, tts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:02:09 +01:00
Till-JS
8370005b25 fix(matrix-mana-bot): make service modules global for DI
Register TodoModule, CalendarModule, AiModule, and ClockModule as
global modules so their services are available throughout the app.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:42:36 +01:00
Till-JS
2a03a7ce41 fix(matrix-mana-bot): import service modules in OrchestrationModule
AiService, TodoService, and CalendarService require their modules
to be imported for dependency injection to work.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:41:13 +01:00
Till-JS
a23430f210 feat: add KeywordCommandDetector to all 19 Matrix bots
All bots now support natural language commands via KeywordCommandDetector:
- matrix-chat-bot (gespraeche, modelle, verlauf, etc.)
- matrix-mana-bot (todo, timer, kalender, summary, etc.)
- matrix-manadeck-bot (decks, karten, lernen, mana, etc.)
- matrix-planta-bot (pflanzen, giessen, faellig, etc.)
- matrix-presi-bot (presis, folien, themes, teilen, etc.)
- matrix-project-doc-bot (projekte, generate, export, etc.)
- matrix-questions-bot (fragen, recherche, antwort, etc.)
- matrix-skilltree-bot (skills, xp, stats, aktivitaeten, etc.)
- matrix-stats-bot (stats, heute, woche, realtime, etc.)
- matrix-storage-bot (dateien, ordner, teilen, suche, etc.)
- matrix-tts-bot (voice, voices, speed, etc.)

All bots include COMMON_KEYWORDS (hilfe, help, status).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:26:25 +01:00
Till-JS
867a1a7fb6 ♻️ refactor: migrate 5 bots to KeywordCommandDetector
Migrated to KeywordCommandDetector from @manacore/matrix-bot-common:
- matrix-calendar-bot (termine, kalender keywords)
- matrix-clock-bot (timer, zeit keywords)
- matrix-picture-bot (modelle, verlauf keywords)
- matrix-todo-bot (aufgaben, projekte keywords)
- matrix-zitare-bot (zitat, kategorien keywords)

Removed duplicate KEYWORD_COMMANDS arrays and detectKeywordCommand()
methods from all 5 bots.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:11:58 +01:00
Till-JS
462ef006f0 feat(matrix-mana-bot): add persistent voice preferences (Phase 4)
- Create VoicePreferencesStore for file-based persistence
- Preferences saved to data/voice-preferences.json
- Add autoVoiceReply setting for voice message auto-response
- Add !speed command for speech speed control (0.5-2.0x)
- Add !voice auto an/aus for auto-reply toggle
- Update HELP_TEXT with voice command documentation
- Debounced save with 1s delay for performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:08:52 +01:00
Till-JS
e892e8db35 feat(matrix-mana-bot): add smart voice formatting (Phase 3)
- Create VoiceFormatterService for intelligent speech formatting
- Convert numbers to German words (eins, zwei, drei...)
- Convert times to natural speech (10:00 → zehn Uhr, 14:30 → halb drei)
- Convert dates to German format (15.02. → 15. Februar)
- Format task metadata (!p1 → mit höchster Priorität, @heute → fällig heute)
- Summarize long lists (top 3 + "und X weitere")
- Convert numbered lists to ordinals (Erstens, Zweitens, Drittens)
- Smart truncation at sentence boundaries
- Remove inline prepareTextForSpeech(), use formatter service

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:05:51 +01:00
Till-JS
48dfcd180f feat(matrix-mana-bot): add voice output/TTS support (Phase 2)
- Add VoiceHandler for voice commands (!voice, !stimme, !stimmen)
- Extend MatrixService with TTS response generation
- Add prepareTextForSpeech() for German natural speech formatting
- Send audio responses non-blocking after text response
- Register voice commands in command router

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:02:37 +01:00
Till-JS
db07b5613d feat(matrix-mana-bot): add voice input support (Phase 1)
- Add VoiceModule and VoiceService for STT integration
- Override handleAudioMessage to process voice notes
- Transcribe audio via mana-stt (Whisper)
- Route transcribed text through CommandRouter
- Add voice configuration and environment variables
- Update help text and documentation

Voice flow:
1. User sends voice note
2. Bot downloads and transcribes audio
3. Shows transcription: 🎤 *"text"*
4. Routes as normal text command
5. Returns text response

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 02:59:13 +01:00
Till-JS
2567ea622c ♻️ refactor: migrate all 18 Matrix bots to extend BaseMatrixService
All Matrix bots now extend BaseMatrixService from @manacore/matrix-bot-common:
- matrix-calendar-bot
- matrix-chat-bot
- matrix-clock-bot
- matrix-contacts-bot
- matrix-mana-bot
- matrix-manadeck-bot
- matrix-nutriphi-bot
- matrix-ollama-bot
- matrix-picture-bot
- matrix-planta-bot
- matrix-presi-bot
- matrix-project-doc-bot
- matrix-questions-bot
- matrix-skilltree-bot
- matrix-storage-bot
- matrix-todo-bot
- matrix-tts-bot
- matrix-zitare-bot

Consolidated code:
- Matrix client initialization (onModuleInit)
- Graceful shutdown (onModuleDestroy)
- sendMessage/sendReply/sendNotice methods
- markdownToHtml conversion
- Room permission checking
- Media upload/download

Estimated code reduction: ~1,500+ lines of duplicate code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 02:47:11 +01:00
Till-JS
83f2d63f56 ♻️ refactor: migrate 19 Matrix bots to shared HealthController
- All bots now use HealthController from @manacore/matrix-bot-common
- Deleted 19 duplicate health.controller.ts files
- Added IConfigService interface for @nestjs/config v3/v4 compatibility
- matrix-stats-bot migrated to use BaseMatrixService as example
- All 19 bots pass type-check

This consolidation eliminates ~400 lines of duplicate health check code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:17:01 +01:00
Till-JS
1733580d05 fix(types): resolve TypeScript errors across multiple packages
- bot-services: Add registerAsync to AI, Calendar, Clock, Todo modules
- bot-services: Add convenience methods to ClockService for bot handlers
- bot-services: Make CreateEventInput.endTime optional with sensible defaults
- bot-services: Fix empty interface ESLint errors (use type aliases)
- questions-backend: Add missing schema columns (isDefault, sortOrder, deletedAt)
- questions-backend: Fix or() return type handling in question service
- questions-web: Add guard for undefined question ID in route params
- skilltree-web: Fix DBSchema type by not extending idb interface directly
- calendar-web: Fix Check icon prop (use weight instead of strokeWidth)
- matrix-mana-bot: Update clock handler to use new service methods

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:33:01 +01:00
Claude
370b5d3196
fix(matrix-mana-bot): correct service method calls and add deploy script
- Fix AiHandler to use correct service methods:
  - setSessionModel instead of setModel
  - clearSessionHistory instead of clearHistory
  - compareModels for model comparison
- Fix TodoHandler to use index-based methods:
  - completeTaskByIndex instead of completeTask
  - deleteTaskByIndex instead of deleteTask
- Add deploy-mana-bot.sh script for full deployment automation

https://claude.ai/code/session_015bwcqVRiFmSydYTjvDJGTc
2026-01-29 00:42:50 +00:00
Claude
2d879b327e
feat(services): add matrix-mana-bot unified gateway
Introduces a unified Matrix bot that combines all features:
- AI Chat (Ollama integration)
- Todo management
- Calendar events
- Timers & Alarms
- Cross-feature orchestration (!summary, !ai-todo)

Architecture:
- Uses @manacore/bot-services for shared business logic
- Command router with natural language support
- Handlers delegate to shared services
- Orchestration layer for cross-feature AI features

This enables users to interact with a single bot for all features,
while standalone bots remain available for dedicated use cases.

https://claude.ai/code/session_015bwcqVRiFmSydYTjvDJGTc
2026-01-29 00:23:46 +00:00