Commit graph

1154 commits

Author SHA1 Message Date
Chr1st1anG
b29a0190ed 🐛 fix(figgos): resolve storage key to URL before downloading fusion parent images
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:01:03 +01:00
Chr1st1anG
08c90d57f0 📝 docs(figgos): update TODO with fusion endpoint details for Till
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:48:12 +01:00
Chr1st1anG
be8e41fece feat(figgos): share card via native share sheet with styled message
Add "Share It" button (neo-brutalist style) to carousel and collection
card overlays. Downloads card image, shares with Unicode-styled message
including bold rarity, stat bars, drop rate and serial number.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:46:16 +01:00
Chr1st1anG
3caf731afd feat(figgos): add fusion endpoint — merge two figures into one
POST /api/v1/figures/fuse takes two figure IDs, merges their profiles
via Gemini LLM, generates a combined card image using both source images
as references, and produces a new fusion figure with dedicated purple/gold
card style. Rarity based on higher parent with upgrade chance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 22:35:19 +01:00
Chr1st1anG
ed1dfd7472 ♻️ refactor(figgos): remove feathered bg removal, RMBG-1.4 only
Drop the threshold-based method and BG_REMOVAL_METHOD config toggle.
RMBG-1.4 is now the sole background removal pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:58:13 +01:00
Chr1st1anG
3dd97a0e81 feat(figgos): clean peg-hole artifact from RMBG background removal
After RMBG + trim, apply white-threshold cleanup to the top 12% middle
50% of the card image to remove the hang-tab hole that RMBG sometimes
preserves.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:53:19 +01:00
Chr1st1anG
072c37ae30 📝 docs(figgos): add auth + credits and merge concept to TODO
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:52:41 +01:00
Chr1st1anG
13787ceadf 📝 docs(figgos): add TODO list for Till
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:49:31 +01:00
Chr1st1anG
f5b3eeb36b 🎨 fix(figgos): improve face reference adherence in generation prompts
- Tell LLM to skip facial features in visualDescription when face photo is provided
- Simplify image prompt face instruction to focus on identity and face shape
- Pass hasFace flag through to profile generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:41:22 +01:00
Chr1st1anG
e29de50b11 🐛 fix(figgos): use contain resizeMode to prevent card side cropping
Thumbnails in showcase and collection used resizeMode="cover" which
cropped the sides of portrait-oriented card images after bg trimming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:29:42 +01:00
Chr1st1anG
a117d5479b feat(figgos): face image upload, loading/reveal screens + error handling
- Add optional face photo upload (expo-image-picker + expo-image-manipulator)
- Wire face image through backend to Gemini as inline base64 data
- Add loading screen with blurred placeholder card + pulsing animation
- Add reveal/unboxing screen with aligned banner layout
- Handle generation failures (check figure.status, show error on form)
- Add Gemini safety settings (BLOCK_NONE) to reduce false rejections
- Increase body limit to 5mb for base64 image payloads
- Add errorMessage to FigureResponse shared type
- Extract FlippableCard to reusable component

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:22:39 +01:00
Chr1st1anG
0eac48cdc4 📝 docs(figgos): update CLAUDE.md with generation pipeline + bg removal config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:31:11 +01:00
Chr1st1anG
9d189b1331 feat(figgos): AI generation pipeline + frontend API integration
Backend:
- Add Gemini-powered profile generation (text + image)
- Add image processing with background removal (sharp)
- Add S3 storage service for figure images
- Extend figures schema with generatedProfile, language, status columns
- Wire up synchronous generation pipeline on POST /api/v1/figures

Frontend (Mobile + Web):
- Replace all mock data with real API calls
- Show generatedProfile data (subtitle, backstory, stats, items, specialAttack)
- Display generated images from S3 or name placeholders
- Create web API service ($lib/api.ts)
- Delete mock cards data files

Infrastructure:
- Add CORS origin for web dev port (5196)
- Add GEMINI_API_KEY + FIGGOS_STORAGE_PUBLIC_URL to env generation
- Add figgos-storage bucket to shared-storage factory
- Add .gitignore for workbench/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:22:51 +01:00
Chr1st1anG
49c6ecc377 feat(figgos): port collection, showcase + card detail to SvelteKit web
- Add card images to static/images/ and shared card data module
- Collection grid with 2-column layout linking to card detail
- Showcase carousel with scroll-snap, drag-to-scroll, scale/rotation effects
- Card detail with CSS 3D flip (drag to rotate, double-click to flip)
- Back side shows backstory, stats bars, rarity badge (sized to match front)
- Layout with 3 tabs (Create, Collection, Showcase), hidden on card detail
- Scale up Create + Collection screens for better visual presence

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:12:28 +01:00
Chr1st1anG
9462dfac43 feat(figgos): add card detail screens, collection views + gesture 3D flip
- Root layout: Stack navigator with GestureHandlerRootView
- Tab layout: Create, Shelf, Stack, Showcase tabs with NativeTabs
- Card V1: tap-to-flip with Reanimated spring animation
- Card V2: gesture-based 3D rotation (pan to rotate Y-axis, double-tap flip)
- Collection views: grid, shelf (by rarity), stack (deck), carousel (showcase)
- Card images: Detective Cole in 5 rarity variants (kraft, common, rare, epic, legendary)
- Back face: backstory, stats bars, rarity badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:16:07 +01:00
Chr1st1anG
95dd1d3e9e feat(figgos): scaffold SvelteKit web app with neo-brutalist theme
SvelteKit 2 + Svelte 5 + Tailwind CSS 4 on port 5196.
Create and Collection pages matching the mobile neo-brutalist design system.
Follows monorepo patterns (adapter-node, shared-vite-config, type-check).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:18:50 +01:00
Chr1st1anG
1c24ad9d5c 🎨 feat(figgos): neo-brutalist game UI design system
Replace old corporate design with neo-brutalist game style:
- Electric yellow primary, hot pink secondary, teal accent
- Hard offset shadow layers on all interactive elements
- Thick 3px borders as core design language
- Restructure to flat tab layout (Create + Collection)
- Remove old auth/tabs/shelf screens
- Keep retro-pixel variant as reference (hidden tab)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:41:36 +01:00
Chr1st1anG
9992b32e3e 🔧 fix(figgos): align mobile setup with other SDK 54 apps
- Reanimated v4 + react-native-worklets (matches ManaDeck/Picture)
- newArchEnabled: true
- Add tsconfigPaths, baseUrl, jsx: react-jsx
- Remove worklets: false workaround from babel config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:19:53 +01:00
Chr1st1anG
76c69a10b1 feat(figgos): add figure generation V1 + re-scaffold mobile app
Backend: figures CRUD API with rarity system and random stats
Mobile: re-scaffolded with create-expo-app (SDK 54), NativeWind 4 design system,
create form + shelf grid. Auth disabled for faster iteration.
Shared: types inlined for Node v24 ESM compat.

See CLAUDE.md for current status, known issues, and next steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:10:53 +01:00
Chr1st1anG
8836dfa6b1 feat(figgos): add NativeWind design system with semantic color tokens
CSS-variable-based design system (ManaDeck pattern) with light/dark mode,
semantic tokens (primary, secondary, accent, destructive, surface, muted),
and game-specific rarity colors (common, rare, epic, legendary).
Also adds FEATURES.md with game concept and data model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:15:03 +01:00
Chr1st1anG
1cffc6de81 feat(figgos): scaffold backend + mobile app
Add new Figgos project under apps/figgos/ with:
- NestJS backend (port 3025) with Drizzle ORM, health check, metrics
- Expo React Native mobile app with Mana Core Auth, tab navigation
- Shared types package (@figgos/shared)
- Root integration: env generation, dev:figgos:full script, MinIO bucket

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:53:54 +01:00
Till-JS
5b6f231e1a 🐛 fix(todo,matrix): improve click targets and type safety
- todo: Make task-content button fill full height for better click target
- matrix: Fix TypeScript errors by using Boolean() for template expressions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 14:53:49 +01:00
Till-JS
bf0e788cba ♻️ refactor(todo,contacts): remove sidebar mode from PillNavigation
Simplify navigation by removing unused sidebar mode from both apps:

Todo App:
- Remove isSidebarMode state, handlers, and localStorage persistence
- Remove sidebar-related CSS classes and styles
- Simplify TodoToolbar to pure wrapper component

Contacts App:
- Remove isSidebarMode state, handlers, and localStorage persistence
- Remove sidebar-related CSS from ContactsToolbar and ContactAlphabetView
- Always show view-mode-pill (no longer conditional on sidebar mode)

This removes ~250 lines of unused code across 5 files.
2026-02-02 19:16:56 +01:00
Till-JS
12a900346c ♻️ refactor(calendar): remove sidebar mode from PillNavigation
Simplify the bottom bars by removing the unused sidebar mode:
- Remove isSidebarMode prop from all components
- Remove sidebar-related CSS classes and styles
- Simplify CalendarToolbar to pure wrapper component
- Remove localStorage persistence for sidebar mode

This removes ~230 lines of unused code across 8 files.
2026-02-02 19:06:32 +01:00
Till-JS
c475923864 fix(mana-media): simplify Dockerfile to single build stage
Use simpler approach that handles pnpm install failures gracefully.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:03:05 +01:00
Till-JS
b3dd3c51d3 fix(mana-media): fix Dockerfile build and health check paths
- Use --ignore-scripts to skip postinstall builds during install
- Remove unnecessary shared-builder stage
- Fix health check URL to /api/v1/health

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:57:50 +01:00
Till-JS
c965f7e440 fix(mana-media): simplify Dockerfile for pnpm hoisted dependencies
pnpm hoists dependencies to root node_modules, so we don't need to copy
service-level node_modules that don't exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:55:49 +01:00
Till-JS
bd9bd556f4 🚸 feat(calendar): hide tasks by default and scroll to midday on load
- Add showTasksInCalendar setting (default: false) to hide task blocks
- Auto-scroll time-grid views to 12:00 on initial load for better UX
- Tasks can be re-enabled via settings toggle
2026-02-02 18:54:05 +01:00
Till-JS
5c19500748 fix(mana-media): change userId from UUID to TEXT for Matrix user IDs
Matrix user IDs like @user:matrix.org are not UUIDs, so the schema
needs to accept text strings for the userId field in media_references.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:45:40 +01:00
Till-JS
cee30ff7ed feat(matrix-todo-bot): improve UX with German commands without ! prefix
- heute command now shows both today's tasks AND inbox tasks
- All commands work without ! prefix (e.g., 'heute' instead of '!heute')
- Updated all help text and messages to show German commands
- Added direct command recognition for: neu, heute, erledigt, löschen, etc.
- Commands still work with ! prefix for backwards compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:32:00 +01:00
Till-JS
d4663b5643 feat(mana-media): add centralized media storage with NutriPhi integration
- 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>
2026-02-02 17:30:14 +01:00
Till-JS
171cf7a854 fix(contacts-web): use runtime URLs instead of build-time baked values
- user-settings.svelte.ts: use getAuthUrl() for settings API
- contacts.ts: use getAuthUrl() for tags API client
- feedback.ts: use getAuthUrl() for feedback service

This fixes Mixed Content errors where the app was trying to reach
internal Docker URLs (http://mana-auth:3001) instead of production
URLs (https://auth.mana.how).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:22:59 +01:00
Till-JS
30f0dbef5d feat(contacts-web): add hooks.server.ts for runtime URL injection
Fixes contacts-web using localhost URLs instead of production URLs.
SvelteKit bakes environment variables at build time, so we need to
inject runtime URLs via hooks.server.ts for Docker deployments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:14:03 +01:00
Till-JS
1fe498e758 fix(shared-ui): export calculateFadeOpacity from index
This utility function was used by contacts-web skeletons but wasn't
exported from the main shared-ui package entry point.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:07:49 +01:00
Till-JS
49c5873af1 chore(docker): build contacts-web locally instead of using GHCR image
GHCR image was outdated (2026-01-29), missing:
- Demo mode removal (2026-01-30)
- SSO implementation (2026-02-02)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:06:12 +01:00
Till-JS
5b3c87b245 fix(docker): use monorepo root as build context for mana-auth
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:52:09 +01:00
Till-JS
ce5f3b5384 chore(docker): build mana-auth locally instead of using GHCR image
Allows faster iteration on auth fixes without needing to push to GHCR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:51:25 +01:00
Till-JS
85df234ff2 feat(mana-core-auth): auto-link Matrix users on OIDC login
When users log into Matrix via OIDC (Sign in with Mana Core), their
Matrix user ID is now automatically linked to their Mana account.
This enables automatic bot authentication without requiring a
separate !login command.

- Add autoLinkOnOidcLogin() method to MatrixSessionService
- Hook into OIDC userinfo endpoint to create links automatically
- Calculate Matrix user ID from email using Synapse's template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:50:28 +01:00
Till-JS
75937d6ce9 fix(mana-core-auth): align JWT issuer validation with Better Auth signing config
Better Auth signs JWTs with issuer=BASE_URL (https://auth.mana.how) for OIDC
compatibility, but validation was using jwt.issuer config which defaults to
'manacore'. This caused "unexpected iss claim value" errors.

Fixed in:
- better-auth.service.ts validateToken()
- jwt-auth.guard.ts
- optional-auth.guard.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:50:04 +01:00
Till-JS
0538a6ca10 fix(mana-core-auth): use Better Auth signJWT in refresh endpoint
The refresh endpoint was using manual jwt.sign with RSA keys, but the
server doesn't have JWT_PRIVATE_KEY configured. Changed to use Better
Auth's signJWT method which uses the JWKS/EdDSA keys from the database.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:40:37 +01:00
Till-JS
c196144d1c fix(mana-core-auth): return real refreshToken from signIn endpoint
Same issue as sessionToToken - the signIn method was returning the
session cookie token as refreshToken, but the /api/v1/auth/refresh
endpoint expects the actual refreshToken field from the sessions table.

Now signIn:
- Fetches the session from database after Better Auth creates it
- Uses existing refreshToken if available
- Generates and stores a new refreshToken if missing
- Returns the actual refreshToken that works with token refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:37:54 +01:00
Till-JS
d64016d1e5 fix(mana-core-auth): exclude /api/auth/get-session from global prefix
The get-session endpoint needs to be accessible at /api/auth/get-session
(without the /api/v1 prefix) for SSO to work.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:29:17 +01:00
Till-JS
95e9b3764d feat(mana-core-auth): add /api/auth/get-session endpoint for SSO
The SSO flow in client apps calls /api/auth/get-session with cookies
to check if the user has a valid session. This endpoint was missing
from the NestJS passthrough controller.

Now the endpoint forwards the request with cookies to Better Auth's
native handler and returns the session data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:27:39 +01:00
Till-JS
9c45879363 feat(nutriphi-bot): auto-analyze images when received
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>
2026-02-02 16:27:03 +01:00
Till-JS
f556665ac2 fix(shared-nestjs-setup): export compiled JS instead of TypeScript
The package was incorrectly exporting src/index.ts which causes runtime
errors when used with plain Node.js. Changed to export from dist/.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:19:39 +01:00
Till-JS
ad22d264aa fix(nutriphi): add shared-drizzle-config and make db:push non-fatal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:17:22 +01:00
Till-JS
b6925e0b63 feat(matrix-bots): enable cross-bot SSO via Redis sessions
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>
2026-02-02 16:16:22 +01:00
Till-JS
0cafd4f94f chore: update pnpm-lock.yaml for express dependency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:14:51 +01:00
Till-JS
ac477aae24 fix(nutriphi): add missing shared packages to Dockerfile
Added shared-tsconfig, shared-nestjs-setup, and shared-nestjs-health
packages required for the backend build.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:14:04 +01:00
Till-JS
509bbb9920 fix(nutriphi): add shared-nestjs-setup to Dockerfile
The package is required for the bodyLimit configuration.

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