When the JWT token expires (15 min), the bot now automatically:
1. Detects the 401 "exp claim" error
2. Clears the expired session
3. Attempts to fetch a new token via Matrix-SSO-Link
4. Retries the failed operation with the new token
This prevents users from getting authentication errors after 15 minutes
of inactivity.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Umami API returns stats in a different format than expected:
- Before: { pageviews: { value, change } }
- After: { pageviews: number, comparison: { pageviews: number } }
Transform the raw API response to the expected format and calculate
percentage change from comparison values.
Also update URL_SCHEMA.md with complete list of all mana.how services.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Implement mana-media service with PostgreSQL/Drizzle ORM persistence
- Add content-addressable storage (SHA-256) for automatic deduplication
- Add Matrix MXC URL import endpoint to copy images from Matrix
- Create @manacore/media-client package for service consumption
- Integrate mana-media into NutriPhi bot for persistent image storage
- Update pnpm-workspace.yaml to include nested service packages
- Add mana-media to docker-compose with port 3015
Images sent to NutriPhi bot are now stored in mana-media after analysis,
providing persistent storage with deduplication across all apps.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Images are now automatically analyzed when sent to the bot, removing
the need for the !analyze command after sending a photo.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
- 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>
- 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>
- 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>
- 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)
- 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>