Commit graph

120 commits

Author SHA1 Message Date
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
Till-JS
677eb823e3 🐛 fix(mana-search): fix SearXNG docker config for local development
- Remove :ro flag from volume mounts (SearXNG needs write access)
- Simplify limiter.toml to match current SearXNG schema
- Disable link_token for API usage without browser
2026-01-29 13:07:21 +01:00
Till-JS
b150a16497 docs(auth): add Matrix SSO integration documentation
- Document OIDC endpoints and authentication flow
- Add Synapse configuration examples
- Include troubleshooting guide
- Remove debug logging from OIDC handlers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:57:48 +01:00
Till-JS
29c5d2b29a feat(auth): add OIDC login page for Matrix SSO
Add a simple login page at /login for OIDC authorization flows.
When users access the authorization endpoint without being logged in,
Better Auth redirects them to this page. After successful login,
users are redirected back to continue the authorization flow.

- Create OidcLoginController with login page HTML
- Add controller to AuthModule
- Exclude /login from global prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:55:02 +01:00
Till-JS
0c1008d725 debug(auth): add detailed logging for OIDC handler response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:51:56 +01:00
Till-JS
baea194677 fix(auth): add OAuth2 routes for OIDC discovery compatibility
Better Auth's OIDC discovery document advertises endpoints at
/api/auth/oauth2/* paths. Add routes for these native paths to
ensure Matrix Synapse and other OIDC clients can complete the
authorization flow.

Routes added:
- GET /api/auth/oauth2/authorize
- POST /api/auth/oauth2/token
- GET /api/auth/oauth2/userinfo
- GET /api/auth/jwks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:48:50 +01:00
Till-JS
42dafe593b fix(auth): fix global prefix exclusion for OIDC routes
Add explicit path exclusions and path-to-regexp wildcard patterns
to ensure /api/auth/jwks and other OIDC routes are excluded from
the /api/v1 global prefix. This fixes JWKS endpoint accessibility
for Matrix Synapse OIDC integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:31:25 +01:00
Till-JS
e46a4c96df fix(auth): expose JWKS at /api/auth/jwks for OIDC discovery
Better Auth's discovery document points to /api/auth/jwks,
so we need to expose this route directly in NestJS.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:21:39 +01:00
Till JS
a930e285b2
Merge pull request #27 from Memo-2023/claude/plan-questions-app-UKqD5
Add Mana Search Service design document and architecture
2026-01-29 12:12:29 +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
Claude
c0802af67f
fix(search): fix TypeScript errors in extract service
- Remove unsupported signal option from article-extractor
- Use Promise.race for timeout handling instead
- Remove non-existent language property from ArticleData

https://claude.ai/code/session_01Rk3YVJCU3nM8uvVPghRz6r
2026-01-28 23:38:00 +00:00
Claude
bd72b4d6d5
feat(search): implement mana-search microservice
Central search microservice for all ManaCore apps featuring:

- NestJS API on port 3021
- SearXNG meta-search engine integration (40+ search engines)
- Redis caching layer for search results and extracted content
- Content extraction with markdown conversion
- Prometheus metrics for monitoring

API Endpoints:
- POST /api/v1/search - Web search with categories/engines
- POST /api/v1/extract - Content extraction from URLs
- POST /api/v1/extract/bulk - Bulk extraction
- GET /health - Health check
- GET /metrics - Prometheus metrics

Search categories: general, news, science, it, images, videos
Supported engines: Google, Bing, DuckDuckGo, Wikipedia, arXiv,
GitHub, StackOverflow, and many more.

https://claude.ai/code/session_01Rk3YVJCU3nM8uvVPghRz6r
2026-01-28 20:41:59 +00:00
Till-JS
bea066c7f8 fix(auth): correct JWKS route mapping for OIDC
JWKS is at /api/auth/jwks, not /api/auth/oauth2/jwks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:13:28 +01:00
Till-JS
f6382ead87 fix(auth): map OIDC routes to Better Auth's /api/auth/oauth2/* paths
Better Auth's OIDC Provider plugin uses routes under /api/auth/oauth2/
rather than /api/oidc/. This commit maps incoming routes correctly:
- /.well-known/openid-configuration → /api/auth/.well-known/openid-configuration
- /api/oidc/* → /api/auth/oauth2/*

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:10:41 +01:00
Till-JS
ef7f906215 debug(auth): add OIDC request logging
Add console.log statements to debug OIDC routing issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:05:45 +01:00
Till-JS
e2a3277fa1 feat(matrix-clock-bot): add Matrix bot for time tracking
- Add Docker build configuration with npm overrides for matrix-sdk
- Update port from 3317 to 3318 to avoid conflict with Zitare bot
- Add tsconfig.build.json for production builds
- Add clock-bot service to docker-compose.macmini.yml
- Bot supports timers, alarms, and world clocks via Matrix chat

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:04:45 +01:00
Till-JS
9a7afea7fe fix(auth): use object syntax for global prefix excludes
Use { path, method } syntax for NestJS global prefix excludes to ensure
OIDC routes (.well-known/*, api/oidc/*) are properly excluded from the
/api/v1 prefix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:52:27 +01:00
Till-JS
00d28bc522 feat(auth): add OIDC Controller for Matrix SSO endpoints
- Add OidcController to expose Better Auth OIDC Provider endpoints
- Add handleOidcRequest method to BetterAuthService
- Exclude OIDC routes from global /api/v1 prefix
- Register OidcController in AuthModule

Endpoints:
- GET /.well-known/openid-configuration
- GET /api/oidc/authorize
- POST /api/oidc/token
- GET /api/oidc/userinfo
- GET /api/oidc/jwks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:49:26 +01:00
Till-JS
a532790d99 feat(matrix-zitare-bot): add Matrix bot for daily inspiration quotes
Features:
- Random quotes and daily quote of the day
- 10 categories (motivation, wisdom, love, life, success, etc.)
- Search functionality
- Login integration with Zitare backend
- Favorites and lists management
- Voice note transcription via mana-stt
- Natural language command support (German/English)
2026-01-28 16:45:11 +01:00
Till-JS
158aaf7e67 feat(auth): add OIDC Provider for Matrix SSO integration
- Add OIDC Provider plugin to Better Auth configuration
- Add OIDC database tables (oauth_applications, oauth_access_tokens,
  oauth_authorization_codes, oauth_consents)
- Configure Synapse as OIDC client in homeserver.yaml
- Update Element Web config for SSO support
- Add seed script for OIDC clients (db:seed:oidc)
- Update Cloudflare tunnel config with Matrix URLs

This enables Single Sign-On between Mana Core Auth and Matrix/Synapse,
allowing users to authenticate via their existing Mana account.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:40:33 +01:00
Till-JS
dbd14f7134 feat(matrix-clock-bot): add Matrix bot for time tracking
Features:
- Timer commands: !timer 25m, !stop, !resume, !reset, !status
- Alarm commands: !alarm 07:30, !alarms
- World clock: !zeit, !weltuhr Berlin, !weltuhren
- Voice note support via mana-stt transcription
- Natural language parsing for German time formats
2026-01-28 16:27:49 +01:00
Till-JS
1f5df44cb0 🙈 chore(matrix-nutriphi-bot): add dockerignore 2026-01-28 16:13:32 +01:00
Till-JS
3b9d99ccd9 feat(matrix-bots): add voice note transcription via mana-stt
- Switch matrix-project-doc-bot from OpenAI Whisper to local mana-stt
- Add voice note support to matrix-nutriphi-bot (auto-analyze meals)
- Add voice note support to matrix-todo-bot (create todos via voice)
- All bots now use STT_URL config for the mana-stt service (port 3020)
2026-01-28 16:10:20 +01:00
Till-JS
57b9d4cb37 feat(matrix-nutriphi-bot): add Matrix bot for nutrition tracking
- NestJS bot with matrix-bot-sdk integration
- Commands: !help, !login, !analyze, !today, !week, !goals, !favorites, !tips
- Integrates with NutriPhi backend API (port 3023)
- User session management with JWT authentication
- Image analysis via Gemini AI (NutriPhi backend)
- Port 3316

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:57:49 +01:00
Till-JS
111fc473d9 🐛 fix(auth): implement password reset email link handler
- Add GET /api/auth/reset-password/:token endpoint to handle email links
- Create password-reset-redirect store to track source app URLs
- Include callbackURL in reset emails for proper app redirection
- Add redirectTo parameter to forgotPassword in shared-auth
- Create /reset-password page in calendar app with DE/EN translations
- Update calendar authStore with resetPasswordWithToken method

Fixes 404 error when clicking password reset link from email
2026-01-28 15:49:33 +01:00
Till-JS
2c341b5328 feat(matrix): add Matrix Todo Bot service
GDPR-compliant task management bot for Matrix with:
- Task CRUD: !add, !list, !done, !delete
- Priority support: !p1 to !p4
- Date shortcuts: @heute, @morgen, @übermorgen
- Project tags: #projektname
- Natural language keywords: hilfe, zeige aufgaben, heute
- Welcome messages and auto-pin help on room join
- Per-user task isolation via Matrix user ID
- Local JSON storage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:47:33 +01:00
Till-JS
ee630158c5 feat(matrix-ollama-bot): add natural language commands and welcome messages
- Add keyword detection for German/English commands (hilfe, modelle, status)
- Send welcome message when users join the room
- Send bot introduction when invited to new rooms
- Add !pin command to pin help message
- Auto-pin help when joining new rooms
- Update help text with simpler command overview

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:56:32 +01:00
Till-JS
e4145324b2 feat(matrix-ollama-bot): add vision commands and filter non-chat models
- Add !vision command to analyze images with vision models
- Add !vision:all command to compare all vision models
- Filter out specialized models (deepseek-r1) from !all comparison
- Add chatWithImage method to OllamaService for vision requests
- Switch Dockerfile from pnpm to npm for better compatibility
- Add .dockerignore and tsconfig.build.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:23:30 +01:00
Till-JS
836b341b3e feat(matrix-ollama-bot): add !all command for model comparison
- Add !all [question] command to query all models and compare responses
- Show response times for each model
- Update help text with new command and rename to Mana Chat

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:43:58 +01:00
Till-JS
8eac78599d fix(matrix-project-doc-bot): fix main.js path in Dockerfile
The dist output is at dist/src/main.js due to drizzle.config.ts at root level.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:01:06 +01:00
Till-JS
96e64b2a37 fix(matrix-bots): exclude crypto-nodejs module that fails on Alpine
Use pnpm overrides to replace @matrix-org/matrix-sdk-crypto-nodejs with
an empty package since E2E encryption is not needed for these bots.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:57:12 +01:00
Till-JS
8e6adfdb10 feat(services): add Telegram bot services for NutriPhi, Todo, and Zitare
Add three new Telegram bot services:

- telegram-nutriphi-bot: Nutrition tracking bot with Gemini AI analysis
  - Photo meal analysis
  - Daily nutrition goals and tracking
  - Statistics and reports

- telegram-todo-bot: Todo list management bot
  - Integration with Todo backend API
  - Reminder scheduling
  - User preferences per chat

- telegram-zitare-bot: Daily inspiration quotes bot
  - Scheduled daily quotes
  - Quote database with authors
  - User subscription management

All bots use NestJS with nestjs-telegraf for Telegram integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:52:01 +01:00
Till-JS
f778e95455 🐛 fix(auth): use node:20-slim for DuckDB glibc compatibility 2026-01-28 12:44:04 +01:00
Till-JS
53653743f0 fix(matrix-bots): add --ignore-scripts to Dockerfiles
Skip postinstall scripts for matrix-sdk-crypto-nodejs which
doesn't build on Alpine Linux. E2E encryption not needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:42:11 +01:00
Till-JS
b50376dfdb fix(matrix-bots): update to matrix-bot-sdk v0.7 API
- Import LogLevel separately instead of LogService.LogLevel
- Change sendTyping to setTyping
- Use any type for event handler to avoid generic type issues
- Fix Buffer to Uint8Array conversion for OpenAI File API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:40:28 +01:00
Till-JS
9dfad0128a 📈 feat(monitoring): upgrade to VictoriaMetrics + DuckDB analytics
- Replace Prometheus with VictoriaMetrics (2-year retention)
- Add DuckDB analytics module for business KPIs (unlimited retention)
- Add master overview dashboard combining all metrics
- Add business metrics dashboard for user growth tracking
- Add backup script for VictoriaMetrics snapshots and DuckDB
- Add ADR documentation for monitoring stack decision

Analytics API endpoints:
- GET /api/v1/analytics/health - Service health
- GET /api/v1/analytics/latest - Latest metrics snapshot
- GET /api/v1/analytics/growth - User growth over time
- GET /api/v1/analytics/monthly - Monthly aggregates
- POST /api/v1/analytics/snapshot - Manual snapshot trigger
2026-01-28 12:38:04 +01:00
Claude
7c5e9e3c49
feat(matrix): add Stats Bot and Project Doc Bot services
Complete GDPR-compliant bot suite for Matrix:

matrix-stats-bot (port 3312):
- Analytics reports from Umami
- Commands: !stats, !today, !week, !realtime, !users
- Scheduled daily/weekly reports to Matrix room

matrix-project-doc-bot (port 3313):
- Project documentation with photos, voice, text
- Voice transcription via OpenAI Whisper
- Blog generation with 5 styles (casual, technical, tutorial, social, story)
- Commands: !new, !projects, !switch, !status, !generate, !export
- Uses PostgreSQL + S3 (MinIO) for storage

Changes:
- docker-compose.macmini.yml: Added both Matrix bots
- health-check.sh: Added health checks for both bots

Environment variables required:
- MATRIX_STATS_BOT_TOKEN, MATRIX_PROJECT_DOC_BOT_TOKEN
- OPENAI_API_KEY (for Project Doc Bot)

https://claude.ai/code/session_01E3r5aFW3YLAhEJfsL2ryhv
2026-01-28 00:44:28 +00:00
Claude
aabe328b51
feat(matrix): add Matrix Ollama Bot service
GDPR-compliant replacement for telegram-ollama-bot using Matrix protocol:

New service: services/matrix-ollama-bot/
- NestJS application with matrix-bot-sdk
- Same functionality as telegram-ollama-bot
- Commands: !help, !models, !model, !mode, !clear, !status
- System prompts: default, classify, summarize, translate, code
- Chat history per user (last 10 messages)

Changes:
- docker-compose.macmini.yml: Added matrix-ollama-bot service
- health-check.sh: Added Matrix Ollama Bot health check

Environment variables required:
- MATRIX_OLLAMA_BOT_TOKEN: Bot access token
- MATRIX_OLLAMA_BOT_ROOMS: Optional room restrictions

https://claude.ai/code/session_01E3r5aFW3YLAhEJfsL2ryhv
2026-01-28 00:35:35 +00:00
Till-JS
e72f3b7865 🧑‍💻 feat(dx): improve local development experience
- Add dev credentials pre-fill on login page (dev@manacore.local)
- Add initialPassword prop to LoginPage component
- Add seed script for dev user (pnpm db:seed:dev in mana-core-auth)
- Add OLLAMA_URL to .env.development for Mac Mini connection
2026-01-27 16:58:11 +01:00
Till-JS
6402f287e8 feat(telegram-bot): add local STT support and Prometheus metrics
- Fix telegram_user_id column type (integer -> bigint) for large user IDs
- Add local STT support via mana-stt service (Whisper MLX + Voxtral)
- Add STT provider config (local/openai) with fallback support
- Add Grafana dashboard for mana-stt service metrics
- Add ollama-metrics-proxy for LLM metrics collection
- Add Grafana dashboard for Ollama LLM metrics

Services added/updated:
- telegram-project-doc-bot: local STT integration
- mana-stt: Grafana dashboard
- ollama-metrics-proxy: new service for Ollama metrics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:51:09 +01:00
Till-JS
7c20d88649 feat(services): add telegram-project-doc-bot service
Add new NestJS-based Telegram bot for project documentation with:
- Drizzle ORM for database access
- OpenAI integration for AI features
- S3 storage support via AWS SDK
- Monorepo integration (dev scripts, database setup, MinIO bucket)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 03:29:08 +01:00
Till-JS
bff80b552a fix(stt): remove unsupported add_generation_prompt kwarg 2026-01-27 03:24:43 +01:00
Till-JS
a2233dc366 fix(stt): properly encode audio as base64 for Voxtral 2026-01-27 02:13:34 +01:00
Till-JS
49255ac794 fix(stt): use correct AutoModel for Voxtral multimodal architecture 2026-01-27 01:58:32 +01:00
Till-JS
92a700ac7e fix(stt): change default model to large-v3 (large-v3-turbo not supported by lightning-whisper-mlx) 2026-01-27 01:36:49 +01:00
Till-JS
bf0fa04e7e feat(stt): add speech-to-text service for Mac Mini
Add mana-stt service with Whisper and Voxtral support for local
transcription. Includes setup script and launchd integration for
automatic startup on Mac Mini server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:33:10 +01:00
Till-JS
2ccd063628 feat(auth): redirect users to source app after email verification
Add sourceAppUrl tracking during registration to redirect users back
to the app they registered from after email verification. Includes
URL validation for security (only *.mana.how, mana.how, localhost).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:31:31 +01:00
Till-JS
ad4ae93f29 feat(auth): add email verification endpoint for Better Auth
Better Auth generates verification URLs with /api/auth/verify-email path,
but NestJS uses /api/v1 prefix. This adds a passthrough controller to
handle the native Better Auth routes and properly verify user emails.

- Add BetterAuthPassthroughController for /api/auth/* routes
- Add verifyEmail method to BetterAuthService
- Exclude /api/auth/* from global prefix in main.ts
- Register passthrough controller in AuthModule

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 20:28:30 +01:00
Till-JS
14aaf01fa3 fix(auth): move email verification config to correct location
Better Auth requires emailVerification config to be a separate top-level
option, not under emailAndPassword. Added sendOnSignUp: true to trigger
verification emails on registration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:54:35 +01:00