Commit graph

143 commits

Author SHA1 Message Date
Till-JS
3d4402ad9b fix(mana-core-auth): allow inline scripts in CSP for OIDC login page
The login page uses inline JavaScript for the form submission handler.
Helmet's default CSP was blocking this, preventing users from logging in
via OIDC/SSO flows (e.g., Matrix Synapse).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:35:42 +01:00
Till-JS
ad7f875c5f feat(matrix-manadeck-bot): add Matrix bot for card/deck management
- Full NestJS bot with matrix-bot-sdk integration
- Deck CRUD: list, create, view, delete decks
- Card management: view cards and card details
- AI generation: generate decks with AI (30 Mana)
- Study sessions: start learning sessions
- Progress tracking: due cards, statistics
- Public features: featured decks, leaderboard
- Credit system: mana balance display
- German/English command aliases
- Number-based reference system for decks and cards
- JWT auth via mana-core-auth
- Runs on port 3321

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:29:12 +01:00
Till-JS
64535373ac feat(matrix-contacts-bot): add Matrix bot for contact management
- List, search, and view contact details
- Create, edit, and delete contacts
- Toggle favorites and archive status
- Number-based reference system for easy commands
- German and English command aliases
- Login/logout via mana-core-auth

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:20:11 +01:00
Till-JS
8950692cfd feat(matrix-picture-bot): add Matrix bot for AI image generation
- Generate images via Picture backend with `!generate` command
- Support prompt options (--width, --height, --steps, --negative)
- Model selection with `!models` and `!model [id]`
- Image history and deletion
- Login/logout via mana-core-auth
- Credit balance display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:15:08 +01:00
Till-JS
b8ecdb8eb7 🔧 chore(mana-notify): disable email notifications by default
Email alerts were causing too many notifications. Changed default
from true to false so new users won't receive email notifications
unless explicitly enabled. Push notifications remain enabled.
2026-01-30 16:06:24 +01:00
Till-JS
971e269fbd 🔧 chore: update pnpm-lock and bot sync token 2026-01-29 22:59:41 +01:00
Till-JS
f4c49fe8f2 fix(mana-notify): resolve BullMQ circular import issue
Move queue name constants to separate file (queue-names.ts) to avoid
circular dependency between queue.module.ts and processor files.

The @Processor decorator evaluates at module load time, and importing
constants from queue.module.ts created a circular dependency that
resulted in undefined queue names.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 22:58:47 +01:00
Till-JS
384244fe50 ♻️ refactor: migrate bots and chat-backend to mana-llm
Migrate all LLM consumers from direct Ollama calls to centralized
mana-llm service with OpenAI-compatible API.

Migrated services:
- matrix-ollama-bot
- telegram-ollama-bot
- chat-backend
- telegram-project-doc-bot

New env vars: MANA_LLM_URL, LLM_MODEL, LLM_TIMEOUT
Replaces: OLLAMA_URL, OLLAMA_MODEL, OLLAMA_TIMEOUT
2026-01-29 22:56:26 +01:00
Till-JS
b5fa0f42b6 feat(mana-notify): add central notification service
NestJS notification microservice for email, push, Matrix, and webhook
notifications across all ManaCore apps.

Features:
- Multi-channel delivery (email, push, Matrix, webhook)
- Handlebars template engine with defaults
- User notification preferences
- BullMQ async job processing
- Delivery tracking and logging
- Prometheus metrics

Includes @manacore/notify-client package for NestJS integration.
2026-01-29 22:07:38 +01:00
Till-JS
1495dbe476 feat(mana-llm): add central LLM abstraction service
Python/FastAPI service providing unified OpenAI-compatible API for
Ollama and cloud LLM providers (OpenRouter, Groq, Together).

Features:
- Chat completions with streaming (SSE)
- Vision/multimodal support
- Embeddings generation
- Multi-provider routing (provider/model format)
- Prometheus metrics
- Optional Redis caching
2026-01-29 22:01:00 +01:00
Till-JS
4a3295d1d0 feat(mana-crawler): add web crawler service
NestJS-based web crawler service for structured content extraction.

Features:
- Depth-controlled crawling with URL pattern filtering
- robots.txt compliance
- HTML/PDF/Markdown content extraction
- BullMQ job queue for async processing
- Redis caching layer
- Prometheus metrics
2026-01-29 22:00:36 +01:00
Till-JS
c3e340f859 🔧 chore: fix missing shared package dependencies
Add missing workspace dependencies:
- telegram-nutriphi-bot: @manacore/shared-drizzle-config
- telegram-todo-bot: @manacore/shared-drizzle-config
- questions/backend: @manacore/shared-tsconfig + fix tsconfig paths

Fixes pre-commit type-check failures.
2026-01-29 20:41:39 +01:00
Till-JS
9ffbf35f25 🔧 fix(docker): update Dockerfiles for monorepo-aware builds
- Update mana-search Dockerfile to use monorepo root context
- Update api-gateway Dockerfile to use monorepo root context
- Fix CI workflow to use context: . for mana-search
- Use pnpm --filter for proper workspace package installation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:39:05 +01:00
Till-JS
60b7cad508 🔧 chore: gitignore build artifacts and misc updates
- Add drizzle.config.* compiled files to gitignore
- Add packages/*/src/*.js patterns for compiled TS
- Update picture design tokens
- Update matrix-tts-bot storage state
- Add microservices API overview doc
2026-01-29 18:37:42 +01:00
Till-JS
59d5d20e0a ♻️ refactor: migrate 12 backends to shared-nestjs-health module
- Create @manacore/shared-nestjs-health package with HealthModule.forRoot()
- Migrate 12 backends: calendar, chat, clock, contacts, nutriphi, picture,
  planta, presi, skilltree, storage, todo, zitare
- Delete 24 local health controller/module files (~312 LOC removed)
- Support custom route (storage uses 'api/v1/health')
- Skip questions backend (has extended DB health check)
- Fix telegram-zitare-bot missing shared-drizzle-config dependency
- Update CONSOLIDATION_OPPORTUNITIES.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:35:10 +01:00
Till-JS
fc0ed636fc feat(api-gateway): add Swagger, admin endpoints, and scheduler
- Add Swagger/OpenAPI documentation at /docs endpoint
- Add admin module for system-wide API key management
- Add scheduler for monthly credit reset and usage cleanup
- Add Docker Compose entry for Mac Mini deployment
- Document all endpoints with descriptions and examples
2026-01-29 18:03:16 +01:00
Till-JS
6f1b2654f1 feat: add mana-api-gateway for monetizing core services
Implement custom NestJS API Gateway for mana-search, mana-stt, and mana-tts:

- API Key management with CRUD operations and key regeneration
- Redis-based sliding window rate limiting
- Credit-based billing with tier support (free, pro, enterprise)
- Usage tracking with daily aggregates
- Proxy services to backend microservices
- Prometheus metrics endpoint
- JWT auth for management API, API key auth for public API

Database schema uses separate `api_gateway` schema in shared manacore DB.
2026-01-29 17:30:21 +01:00
Till-JS
6807543d60 🔧 chore: create @manacore/shared-drizzle-config and migrate 16 configs
- Create factory function with dbName, schemaPath, outDir, schemaFilter options
- Migrate 12 app backends: calendar, chat, clock, contacts, nutriphi, picture,
  planta, presi, questions, skilltree, storage, todo
- Migrate 4 services: mana-core-auth, telegram-zitare-bot, telegram-todo-bot,
  telegram-nutriphi-bot
- Update consolidation docs with completed Drizzle config task

Savings: ~160 LOC (16 configs × ~10 LOC each)
2026-01-29 16:54:44 +01:00
Till-JS
f0adea04fd fix(tts-bot): use MP3 format and prevent duplicate messages
- Changed audio output from WAV to MP3 for better browser compatibility
- Added event ID tracking to prevent processing same message twice
2026-01-29 16:20:26 +01:00
Till-JS
41354d58ee fix(matrix-tts-bot): fix Dockerfile pnpm install 2026-01-29 16:04:08 +01:00
Till-JS
58a051645b feat(matrix): add TTS bot for text-to-speech conversion
- NestJS bot that converts text messages to speech via mana-tts
- Commands: !voice, !voices, !speed, !status, !help
- User settings stored in-memory (voice, speed per user)
- Docker config for Mac Mini deployment
- Setup script for bot registration

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-29 16:03:26 +01:00
Till-JS
0c150df0f1 feat(auth): add resend verification email to all login pages
Add ability to resend verification email when login fails with
"Email not verified" error. Implemented across all 14 apps using
Mana Core Auth.

Changes:
- Add POST /api/v1/auth/resend-verification endpoint to mana-core-auth
- Add resendVerificationEmail method to shared-auth client
- Update LoginPage component with resend UI and translations
- Add resendVerificationEmail to all app auth stores
- Add translations for de, en, fr, es, it
- Add PlantaLogo to shared-branding
- Migrate planta login to shared LoginPage component
2026-01-29 14:55:49 +01:00
Till-JS
5a0815708c 🌐 feat: add i18n support to 6 web apps
Add internationalization (DE + EN) to previously missing apps:
- todo: task management translations
- skilltree: skill/XP system translations
- nutriphi: nutrition tracking translations
- planta: plant care translations
- questions: research app translations
- matrix: chat client translations (layout integration)

Each app includes:
- svelte-i18n setup with SSR support
- localStorage persistence ({app}_locale pattern)
- i18n loading state in +layout.svelte
- German (default) and English translations

Updated CONSISTENCY_REPORT.md to mark i18n task as complete.

Also includes:
- mana-tts service placeholder files
2026-01-29 14:48:35 +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
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