Commit graph

328 commits

Author SHA1 Message Date
Till JS
97d5b13a38 feat(versioning): add semantic versioning and changesets to all apps
Assign version numbers based on app maturity: Calendar/Contacts/Todo (1.0.0),
Chat/Picture (0.3.0), 11 beta apps (0.2.0), Context/Planta/Questions (0.1.0),
Traces (0.0.1). Set up @changesets/cli for future version management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 16:20:18 +01:00
Till JS
3b8931090f fix(auth): scope pnpm install to auth service in Dockerfile
Use --filter to only install mana-core-auth and shared-storage deps,
avoiding missing workspace package errors from root package.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:10:08 +01:00
Till JS
baf96cbe03 fix(auth): copy patches dir in Dockerfile to fix pnpm install
pnpm resolves patch references from root package.json even for
partial workspace installs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:09:03 +01:00
Till JS
2c21f6c2bc fix(auth): use --no-frozen-lockfile in Dockerfile
The partial workspace copy causes lockfile mismatches since not all
referenced packages are present in the Docker build context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:08:15 +01:00
Till JS
817ccfea31 fix(auth): improve email verification error detection in signIn
Better Auth may return error objects instead of throwing for unverified
emails. Now checks result.error before hasUser(), uses case-insensitive
matching, and re-throws NestJS HTTP exceptions to avoid masking them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:05:04 +01:00
Till JS
6e1af0d889 feat(calendar): add Playwright E2E tests for web app
Add 22 E2E tests across 5 test suites covering auth, calendar views,
settings, event CRUD, and calendar management. Tests that require the
calendar backend gracefully skip when it's not running.

Also fixes: hooks.server.ts env fallbacks, ThrottlerGuard DI error,
and auth metrics service TypeScript error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:08:09 +01:00
Till JS
f922d2c4a1 fix(auth): return proper 403 for unverified email on login
Better Auth throws APIError("FORBIDDEN") when email is not verified,
but the signIn catch block didn't handle this case, causing a 500.
Now returns ForbiddenException with EMAIL_NOT_VERIFIED code so the
client can show the resend verification link.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 12:33:27 +01:00
Till JS
14ca0ae0b5 fix(auth): align reset-password min length to 8 characters
The ResetPasswordDto required 12 characters while registration and
change-password only required 8, causing a mismatch with frontend UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 12:22:56 +01:00
Till JS
bd1178edf8 feat(traces): integrate traces app into monorepo with NestJS backend and AI city guides
Restructure standalone traces app into monorepo pattern with mobile + backend + shared types.
Add NestJS backend with Drizzle ORM schema for locations, cities, places, POIs, and AI guides.
Add mobile sync layer, cities tab, and guide generation UI. Fix pre-existing type errors across
mobile codebase, matrix-mana-bot (sendDirectMessage), llm-playground, and all web auth stores
(signUp call signature).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 08:12:42 +01:00
Till-JS
a336cc2381 fix(nutriphi-bot): make I18nService optional to fix DI error
Same fix as planta-bot - I18nService injection was failing because
the service couldn't be resolved in the BotModule context despite
I18nModule having global: true.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 14:14:07 +01:00
Till-JS
5c630c3fa4 feat(nutriphi-bot): add smart meal feedback with positive aspects and improvement suggestions
- Generate automatic feedback based on nutritional values
- Show positive aspects (fiber, protein, whole grains, nuts, fruits/vegetables)
- Suggest improvements (portion size, fat content, missing nutrients)
- Detect multiple oils and suggest simplification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 14:09:33 +01:00
Till-JS
1d44f918c5 fix(manacore-web): add missing packages to Dockerfile
Add shared-pwa, qr-export, and wallpaper-generator packages
to the Docker build context for manacore-web.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 13:43:08 +01:00
Till-JS
c480231128 fix(planta-bot): make I18nService optional to diagnose DI issue
Also restore @Global() decorator to I18nModule while keeping
global: true in DynamicModule config for consistency with other
modules like CreditModule.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 12:51:04 +01:00
Till-JS
9faa1fcc68 debug: add detailed logging to planta bot handleTextMessage 2026-02-17 12:40:57 +01:00
Till-JS
dcf4438804 feat(mana-bot): add daily morning summary feature
Add configurable morning summaries that aggregate data from multiple sources:
- Weather forecast via Open-Meteo API (free, no API key needed)
- Today's calendar events
- Today's tasks + overdue tasks
- Birthdays from contacts
- Plants needing water from Planta

New commands:
- !morning / !morgen - Get summary now
- !morning-on/off - Enable/disable automatic delivery
- !morning-time HH:MM - Set delivery time
- !morning-location [city] - Set weather location
- !morning-timezone [zone] - Set timezone
- !morning-format [kompakt|ausfuehrlich] - Set format
- !morning-settings - Show current settings

New shared services in @manacore/bot-services:
- WeatherService - Open-Meteo integration with geocoding
- ContactsApiService - Birthday fetching
- PlantaApiService - Watering schedule
- MorningSummaryService - Aggregates all sources
- MorningPreferencesService - User preferences storage

Includes scheduler for automatic daily delivery at user-configured time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 11:01:47 +01:00
Till-JS
ceac5444ca fix(planta-bot): rewrite Dockerfile to use pnpm workspace pattern
- Use node:20-slim like other bots
- Copy and build shared packages (bot-services, matrix-bot-common)
- Use pnpm instead of npm
- Add non-root user for security
- Fix healthcheck port to 4022

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 10:48:55 +01:00
Till-JS
9704e88e78 feat(planta-bot): add AI plant identification via image upload
- Add handleImageMessage() to BaseMatrixService for image support
- Implement photo upload and Gemini Vision analysis in PlantaService
- Add image handler in MatrixService that downloads, uploads, and analyzes
- Format analysis results with health status, care tips, and confidence
- Update CLAUDE.md documentation with new feature
- Fix type mismatch in onboarding-bot (fullName → displayName)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 10:40:08 +01:00
Till-JS
20db01628a fix(auth): remove conflicting JSON body parser middleware
The manual bodyParser.json() middleware conflicts with NestJS rawBody mode.
When rawBody: true is enabled, NestJS consumes the body stream first, then
the manual parser tries to read it again causing "stream is not readable".

NestJS handles JSON parsing internally, so the manual middleware was redundant
and causing 500 errors on login requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 14:30:06 +01:00
Till-JS
14da5a28ef 📝 docs(auth): update organization endpoint documentation
- Add all new organization management endpoints to API table
- Add new Invitations section for invitation endpoints
- Update controller JSDoc with complete endpoint list
- Update last updated date
2026-02-16 12:57:29 +01:00
Till-JS
5fe16b5eec feat(auth): add organization management endpoints
Add missing organization features for Teams functionality:
- PUT /auth/organizations/:id - update organization
- DELETE /auth/organizations/:id - delete organization
- PATCH /auth/organizations/:orgId/members/:memberId/role - update member role
- GET /auth/organizations/:id/invitations - list org invitations
- GET /auth/invitations - list user invitations
- DELETE /auth/invitations/:id - cancel or reject invitation
2026-02-16 12:47:49 +01:00
Till-JS
b5d7524c77 💳 feat(stripe): add SEPA Direct Debit payment option
- Add sepa_debit to payment_method_types for credit purchases
- Add sepa_debit to subscription checkout sessions
- Handle payment_intent.processing webhook for SEPA status tracking
- Add blueprint article analyzing payment options (Stripe vs LSV+/FinTS)

SEPA offers lower fees (0.8% vs 1.5%+€0.25) for DACH customers.
Payments are confirmed 3-14 days after checkout (bank processing).
2026-02-16 12:05:19 +01:00
Till-JS
0e8f6f134e 📝 docs(credits): update documentation for simplified credit system
- Remove free credits and signup bonus references
- Remove B2B organization credits documentation
- Update API responses (no freeCreditsRemaining, dailyFreeCredits)
- Update environment variables (remove CREDITS_SIGNUP_BONUS, CREDITS_DAILY_FREE)
- Update JWT info to reflect EdDSA via Better Auth
- Simplify DATABASE_SCHEMA.md to B2C-only flow
2026-02-16 12:03:35 +01:00
Till-JS
d86e9031bb 🐛 fix(auth): skip body parser for Stripe webhooks
The JSON body parser was consuming the request body before NestJS
could access the rawBody needed for Stripe webhook signature
verification. Now webhooks to /api/v1/webhooks/stripe skip the
body parser middleware.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 12:01:24 +01:00
Till-JS
bfc2737ce5 ♻️ refactor(credits): simplify credit system by removing free credits and B2B
Remove free credits system (signup bonus, daily credits) and B2B organization
credits to simplify the codebase. Credits now only come from purchases or gifts.

Changes:
- Remove freeCreditsRemaining, dailyFreeCredits, lastDailyResetAt from balances
- Remove organizationBalances and creditAllocations tables from schema
- Simplify transaction types to: purchase, usage, refund, gift
- Remove B2B endpoints from credits controller
- Remove checkDailyReset, allocateCredits, deductCredits from service
- Add redeemPendingGifts method to auto-redeem gifts on registration
- Update frontend to remove free credits display
- Add database migration for the changes
- Update all related tests to match simplified system
2026-02-16 11:54:32 +01:00
Till-JS
2e660391ce 💳 feat(stripe): add ManaCore unified subscription plans
- Create Plus/Pro/Ultra subscription tiers with Stripe products & prices
- Add credit packs (100/500/1000) for one-time purchases
- Update seed script with new plan structure and Stripe IDs
- Configure webhook secret and customer portal
- Add all Stripe environment variables to .env.development

Plans:
- Free: 50 credits/month (default)
- Plus: 100 credits/month @ €4.99/mo or €49.99/yr
- Pro: 500 credits/month @ €11.99/mo or €119.99/yr
- Ultra: 2000 credits/month @ €24.99/mo or €249.99/yr

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:43:04 +01:00
Till-JS
52f88af4c5 🐛 fix(clock-bot): enable Redis session storage for widget
Widget module now uses Redis storage mode to share sessions with
the bot module. This enables Matrix-SSO-Link auto-login for widget.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:20:54 +01:00
Till-JS
78c7383d54 feat(lightwrite): add Beat/Lyrics Editor app
- Add NestJS backend with project, beat, marker, lyrics, export modules
- Add SvelteKit web app with wavesurfer.js waveform visualization
- Add BPM detection using Web Audio API peak detection
- Add marker timeline for parts, hooks, bridges
- Add lyrics editor with timestamp sync
- Add export to LRC, SRT, JSON formats
- Add shared-storage support for lightwrite
- Fix mana-core-auth env loading (add dotenv before validation)
- Add lightwrite to setup-databases.sh
- Fix matrix-onboarding-bot type errors (displayName → fullName)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:13:08 +01:00
Till-JS
9bb8d3a21f 🔥 chore(gifts): remove debug logging after fixing userId undefined 2026-02-16 00:02:49 +01:00
Till-JS
670073e3c2 🐛 fix(gifts): fix userId undefined - guard used userId but controller expected sub 2026-02-15 23:55:42 +01:00
Till-JS
ec8395858b fix(matrix-stt-bot): use same Dockerfile pattern as TTS bot 2026-02-14 14:34:14 +01:00
Till-JS
0a439bb802 fix(matrix-stt-bot): fix Dockerfile build order and port 2026-02-14 14:32:23 +01:00
Till-JS
e357f9f292 feat(matrix-stt-bot): add speech-to-text Matrix bot
- New bot that transcribes voice messages to text
- Uses mana-stt service (Whisper/Voxtral) for transcription
- Supports German and English with auto-detection
- Commands: !language, !model, !status, !help
- Runs on port 3024

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:29:34 +01:00
Till-JS
d7236d61fa debug: add detailed logging for gift redemption 2026-02-14 14:28:37 +01:00
Till-JS
79f1155dfd feat(nutriphi-bot): auto-analyze text meal descriptions
- Add looksLikeMealDescription() heuristic to detect meal descriptions
- Add autoAnalyzeText() to handle automatic text analysis
- Text messages with food keywords or numbers are now auto-analyzed
- Skip greetings and questions to avoid false positives
2026-02-14 14:18:10 +01:00
Till-JS
97264cd849 🔧 chore(clock-bot): add detailed topic update logging 2026-02-14 14:03:04 +01:00
Till-JS
ab677b28c8 🐛 fix(gifts): explicitly set nullable fields to null in DB inserts
Drizzle ORM requires explicit null values for optional fields instead of
leaving them undefined. Added explicit null for organizationId,
idempotencyKey, portionNumber, and creditTransactionId.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:02:46 +01:00
Till-JS
102f0df518 🔧 chore(clock-bot): improve room topic error logging 2026-02-14 13:52:20 +01:00
Till-JS
72b162524c 🐛 fix(gifts): convert undefined sourceAppId to null for Drizzle
Drizzle ORM throws "UNDEFINED_VALUE" error when inserting undefined values.
Convert dto.sourceAppId to null using nullish coalescing operator.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:50:01 +01:00
Till-JS
ba818ef256 fix(clock-bot): improve room topic error logging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:47:15 +01:00
Till-JS
992181cc87 feat(clock-bot): add timer status to room topic (Phase 3)
- Store original room topic when timer starts
- Update room topic with timer progress every 10 seconds
- Show status icon, remaining time, percentage, and label
- Restore original topic when timer finishes or is deleted

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:36:08 +01:00
Till-JS
5025bfa883 fix(clock-bot): optimize widget styling for Element info panel
- Use transparent background to adapt to Element theme
- Remove min-height and centering (content starts at top)
- Reduce font sizes and spacing for compact display
- Use semi-transparent backgrounds for theme compatibility
- Add flex-wrap for narrow panels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:46:19 +01:00
Till-JS
0a41640c19 chore(onboarding-bot): add bot user creation script
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:43:29 +01:00
Till-JS
a6fc1cb66e feat(onboarding): add Matrix onboarding bot for profile setup
- Add matrix-onboarding-bot service that guides users through profile setup
- Extend mana-core-auth GlobalSettings with displayName, interests, onboardingCompleted fields
- Implement state machine for onboarding flow (NAME → INTERESTS → LANGUAGE → SUMMARY)
- Support commands: !start, !profile, !edit, !skip, !help
- Add German and English localization
- Integrate with mana-core-auth Settings API for profile persistence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:42:41 +01:00
Till-JS
c13c313886 🐛 fix(gifts): reorder controller routes to fix 'me/*' matching
NestJS matches routes in declaration order. The dynamic :code route was
matching before me/created and me/received, treating 'me' as a gift code.
Moved specific routes before the dynamic parameter route.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:38:23 +01:00
Till-JS
b1eaa88e6e 📝 docs(stats-bot): add Redis and Matrix-SSO-Link environment variables
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:35:15 +01:00
Till-JS
139c04040d refactor(stats-bot): swap commands - !stats for personal, !global for global
- !stats now shows personal stats (requires login)
- !global now shows global Umami analytics
- Update keywords and help text accordingly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:26:52 +01:00
Till-JS
12451092f1 📝 docs(tts): document German voice support (Piper/Kerstin)
- Add Piper TTS section to mana-tts CLAUDE.md
- Document available German voices (local and cloud)
- Update matrix-tts-bot CLAUDE.md with new default voice
- Add language auto-detection documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:21:40 +01:00
Till-JS
209a474f17 🩹 fix(gifts): add duplicate claim check to first_come type
Users can now only redeem first_come gift codes once, making it
suitable for promo codes that should be unlimited but once per user.
2026-02-14 12:19:43 +01:00
Till-JS
acf4512e90 fix(session): add auto-refresh for expired JWT tokens
- Add isTokenValid() to decode JWT and check exp claim
- Refresh tokens 60 seconds before expiry (buffer)
- Auto-fetch fresh token via SSO-Link when cached token expires
- Clear invalid sessions when refresh fails
- Prevents "exp claim timestamp check failed" errors

JWT tokens from mana-core-auth expire after 15 minutes, but sessions
were cached for 7 days. Now tokens are transparently refreshed when
they expire, keeping users authenticated.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:19:08 +01:00
Till-JS
4b950b7083 feat(tts): add de_kerstin female German voice and set as default
- Download and configure Kerstin Piper voice (63MB, local)
- Update piper_service.py to support multiple voice models
- Set de_kerstin as default voice for TTS bot
- Update help text with new voice options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:16:58 +01:00