Commit graph

12 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
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
c29939e7bc feat: add voice transcription support to Matrix bots
Add TranscriptionModule and handleAudioMessage to enable voice message
transcription across all Matrix bots. Users can now send voice messages
which are automatically transcribed and processed as text commands.

Affected bots:
- matrix-calendar-bot
- matrix-chat-bot
- matrix-contacts-bot
- matrix-manadeck-bot
- matrix-ollama-bot
- matrix-picture-bot
- matrix-planta-bot
- matrix-presi-bot
- matrix-questions-bot
- matrix-skilltree-bot
- matrix-stats-bot
- matrix-storage-bot
- matrix-tts-bot

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:37:30 +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
7a2e037cd5 ♻️ refactor: migrate 4 more bots to use UserListMapper
Migrated to UserListMapper<T> from @manacore/matrix-bot-common:
- matrix-manadeck-bot (decksMapper, cardsMapper)
- matrix-planta-bot (plantsMapper)
- matrix-questions-bot (questionsMapper, collectionsMapper, answersMapper)
- matrix-storage-bot (filesMapper, foldersMapper, sharesMapper, trashMapper)

Benefits:
- Consistent API for user-specific list storage
- Type-safe getByNumber(), setList(), hasList(), clearList()
- Reduced boilerplate code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:03:10 +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
2b979d5548 ♻️ refactor: migrate all remaining bots to shared services
Completed migration of all Matrix bots to @manacore/bot-services:

**SessionService (11 bots migrated):**
- matrix-chat-bot (with conversation/model mapping via setSessionData)
- matrix-contacts-bot
- matrix-skilltree-bot
- matrix-presi-bot
- matrix-questions-bot
- matrix-storage-bot
- matrix-planta-bot
- matrix-manadeck-bot
- matrix-nutriphi-bot (with pendingImage via setSessionData)
- matrix-picture-bot (previous commit)
- matrix-zitare-bot (previous commit)

**TranscriptionService (5 bots migrated):**
- matrix-todo-bot (previous commit)
- matrix-clock-bot (previous commit)
- matrix-zitare-bot (previous commit)
- matrix-nutriphi-bot
- matrix-project-doc-bot

**Code Reduction:**
- Deleted 22 local module files (session + transcription)
- ~1100 lines of duplicate code removed total
- All bots now share identical auth and STT logic

**Special handling:**
- matrix-chat-bot: Extended methods converted to setSessionData/getSessionData
- matrix-nutriphi-bot: pendingImage state via setSessionData
- matrix-project-doc-bot: TranscriptionService used by MediaService

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:50:48 +01:00
Till-JS
df47dafeb5 chore(matrix-bots): standardize package.json across all 9 bots
- Unified package scope to @mana-bots/*
- Added private: true to all packages
- Added pnpm overrides for matrix-sdk-crypto-nodejs
- Added prebuild script to clean dist folder
- Updated all dependencies to latest versions:
  - @nestjs/*: ^10.4.15
  - @nestjs/config: ^3.3.0
  - reflect-metadata: ^0.2.2
  - @types/node: ^22.10.2
  - typescript: ^5.7.2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:49:15 +01:00
Till-JS
004fe85799 fix(matrix-bots): resolve TypeScript strict null check errors
- Fix parseInt undefined errors in configuration files
- Add fallbacks for Matrix client constructor parameters
- Fix possibly undefined data accesses with non-null assertions
- Update setCurrentConversation to accept null

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:32:09 +01:00
Till-JS
369415527f 🔧 chore(shared-vite-config): add build step for Docker compatibility
- Add build script to compile TypeScript to dist/
- Update exports to point to compiled files
- Update calendar-web Dockerfile to build shared-vite-config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:41:48 +01:00