Zum Hauptinhalt springen

Zurück zum Devlog

Samstag, 31. Januar 2026

Feature

52 Commits

18 min Lesezeit

Matrix Bot Konsolidierung, Voice Support & Manalink PWA

Massive Konsolidierung aller 19 Matrix Bots mit @manacore/matrix-bot-common, Voice Input/Output für mana-mana-bot, Manalink PWA Rebrand, und Telegram-zu-Matrix Migration

T

Till Schneider

Autor

Intensiver Tag (und Nacht!) mit 52 Commits - der Fokus lag auf der Konsolidierung der Matrix Bot Infrastruktur:

  • @manacore/matrix-bot-common - Neues Shared Package für alle 19 Matrix Bots
  • Voice Support - 4-Phasen-Implementierung für Voice Input/Output im mana-mana-bot
  • Manalink PWA - Rebrand des Matrix Web Clients mit PWA-Support
  • Telegram Removal - Migration zu Matrix-only Strategie
  • mana-media MVP - Unified Media Processing Platform
  • Docker Restructure - Neues Port-Schema und Naming Convention

@manacore/matrix-bot-common

Neues Shared Package, das gemeinsame Funktionalität für alle Matrix Bots bereitstellt.

Komponenten

packages/matrix-bot-common/
├── src/
│   ├── base/
│   │   └── BaseMatrixService.ts      # Abstrakte Basisklasse
│   ├── health/
│   │   └── HealthController.ts       # Shared Health Endpoint
│   ├── utils/
│   │   ├── KeywordCommandDetector.ts # Command Detection ohne !
│   │   └── UserListMapper.ts         # User-Formatierung
│   └── index.ts
└── package.json

BaseMatrixService

Abstrakte Basisklasse mit Matrix-Verbindungslogik:

export abstract class BaseMatrixService implements OnModuleInit {
	protected client: MatrixClient;

	async onModuleInit() {
		this.client = new MatrixClient(this.config.homeserverUrl, this.config.accessToken);
		await this.client.start();
		this.client.on('room.message', this.handleMessage.bind(this));
	}

	protected abstract handleMessage(roomId: string, event: any): Promise<void>;
}

KeywordCommandDetector

Erkennt natürlichsprachliche Befehle ohne !-Prefix:

const detector = new KeywordCommandDetector({
	keywords: ['todo', 'aufgabe', 'task'],
	patterns: [/(?:erinnere mich|remind me)/i],
});

// "Füge Einkaufen zur Todo-Liste" → detected
// "Was steht auf meiner Aufgabenliste?" → detected

Migration

Alle 19 Matrix Bots wurden migriert:

PhaseBotsÄnderungen
15HealthController
25BaseMatrixService
34UserListMapper
45KeywordCommandDetector

Voice Support für matrix-mana-bot

4-Phasen-Implementierung von Voice Input/Output.

Phase 1: Voice Input

// Sprachnachrichten via mana-stt transkribieren
async handleVoiceMessage(event: MatrixEvent): Promise<string> {
  const audioUrl = event.content.url;
  const audioBuffer = await this.downloadMedia(audioUrl);
  const transcription = await this.sttClient.transcribe(audioBuffer);
  return transcription.text;
}

Phase 2: Voice Output (TTS)

// Text-zu-Sprache für Antworten
async sendVoiceReply(roomId: string, text: string): Promise<void> {
  const audioBuffer = await this.ttsClient.synthesize(text, {
    voice: 'de-DE-FlorianNeural',
    speed: 1.0,
  });
  await this.client.sendAudio(roomId, audioBuffer, 'response.mp3');
}

Phase 3: Smart Voice Formatting

Intelligente Aufbereitung von Text für Sprachausgabe:

InputVoice Output
15:30”fünfzehn Uhr dreißig”
3.5kg”drei Komma fünf Kilogramm”
URLsWerden übersprungen
MarkdownWird entfernt

Phase 4: Persistent Voice Preferences

// User-Präferenzen in Redis speichern
interface VoicePreferences {
	enabled: boolean;
	voice: string;
	speed: number;
	autoTranscribe: boolean;
}

await this.redis.hset(`voice:${userId}`, preferences);

Rebrand des Matrix Web Clients zu “Manalink” mit PWA-Support.

PWA-Features

FeatureBeschreibung
InstallierbarAdd to Home Screen
OfflineService Worker Caching
Push NotificationsWeb Push API
App-IconCustom Manalink Icon

Manifest

{
	"name": "Manalink",
	"short_name": "Manalink",
	"description": "ManaCore Matrix Client",
	"start_url": "/",
	"display": "standalone",
	"theme_color": "#6366f1",
	"background_color": "#0f172a"
}

UX-Änderungen

  • SSO als primärer Login (manueller Login versteckt)
  • Vereinfachte Login-Seite
  • Dark Mode als Default

Telegram Removal

Strategische Entscheidung: Fokus auf Matrix als einzige Chat-Plattform.

Entfernte Services

services/
├── telegram-ollama-bot/        # ENTFERNT
├── telegram-project-doc-bot/   # ENTFERNT
├── telegram-nutriphi-bot/      # ENTFERNT
├── telegram-todo-bot/          # ENTFERNT
└── telegram-zitare-bot/        # ENTFERNT

Begründung

AspektTelegramMatrix
Self-HostedNeinJa
E2EEOptionalStandard
Bot PlatformLimitiertFlexibel
IntegrationExternNative

mana-media MVP

Unified Media Processing Platform für alle ManaCore Apps.

Features

services/mana-media/
├── src/
│   ├── processing/
│   │   ├── image.service.ts     # Resize, Crop, Format
│   │   ├── video.service.ts     # Transcode, Thumbnail
│   │   └── audio.service.ts     # Convert, Normalize
│   ├── storage/
│   │   └── s3.service.ts        # MinIO/S3 Storage
│   └── metadata/
│       └── exif.service.ts      # EXIF Extraction
└── Dockerfile

API Endpoints

EndpointBeschreibung
POST /process/imageBildverarbeitung
POST /process/videoVideokonvertierung
GET /metadata/:idEXIF/Metadaten abrufen

Docker Restructure

Neue Port-Schema und Naming Convention für alle Services.

Port Ranges

RangeTyp
3001-3099Core Services (Auth, Search, LLM)
3100-3199App Backends
3300-3399Matrix Bots
5100-5199Web Apps
8000-8099Infrastructure

Naming Convention

# Vorher
container_name: chat-backend
container_name: todo-backend

# Nachher
container_name: mana-chat-backend
container_name: mana-todo-backend

Bot Services Consolidation

Konsolidierung von SessionService und TranscriptionService.

@manacore/bot-services Updates

// Vorher: In jedem Bot
class SessionService {
	private sessions = new Map();
}

// Nachher: Shared Package
import { SessionService } from '@manacore/bot-services';

Shared Services

ServiceFunktion
SessionServiceUser Sessions über Redis
TranscriptionServiceSTT via mana-stt
CreditServiceCredit-Verbrauch tracken

Model Comparison Feature

Neues Feature im LLM Playground für Modellvergleiche.

UI

// Gleichzeitig mehrere Modelle abfragen
const models = ['gemma3:4b', 'llama3.2:3b', 'mistral:7b'];
const responses = await Promise.all(models.map((model) => llmClient.chat(model, prompt)));

Metriken

MetrikBeschreibung
LatencyTime to first token
ThroughputTokens per second
QualitySubjektive Bewertung

Grafana & Prometheus Fixes

Zahlreiche Fixes für das Monitoring-System.

Fixes

FixBeschreibung
VictoriaMetrics Port8428 → 9090
Backend PortsKorrekte Scrape Targets
Missing ServicesNeu hinzugefügt
Home DashboardMaster Overview als Default

Bugfixes

FixBeschreibung
matrix-bot-common ESMExplicit Imports für Node.js v25
bot-services BuildCompile Step hinzugefügt
Type ErrorsWeb Apps, mana-media, calendar
tsconfig IssuesAlle NestJS Backends
matrix-mana-bot DIService Modules als Global

Zusammenfassung

BereichCommitsHighlights
matrix-bot-common8Neues Shared Package
Bot Migration1219 Bots konsolidiert
Voice Support44 Phasen implementiert
Manalink PWA2Rebrand + PWA
Telegram Removal1Matrix-only Strategie
mana-media2MVP implementiert
Docker Restructure1Neues Port-Schema
Grafana/Prometheus8Monitoring Fixes
Bugfixes14Build, Types, ESM

Nächste Schritte

  1. Matrix E2EE aktivieren
  2. Voice Preferences UI im Manalink Client
  3. mana-media mit NutriPhi integrieren
  4. Matrix Bots CI/CD Pipeline

Tags

#matrix-bots #voice #pwa #manalink #consolidation #shared-packages #mana-media #telegram #refactoring #docker