Commit graph

2962 commits

Author SHA1 Message Date
Till JS
6d7e4d0fb1 docs(brain): comprehensive status update — 29 modules, TODOs, architecture review
Updates the architecture doc with:
- Full module rollout table (29 modules with event/tool counts)
- List of 11 remaining modules with priority assessment
- Known technical debt: _activity table duplication, old trigger
  system overlap, streak query performance
- Optimization opportunities: parallel DaySnapshot queries,
  streak caching, Context Document expansion
- Feature gaps: no Goal editor UI, no in-app Nudge display,
  no WebGPU fallback for Companion Chat

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:28:01 +02:00
Till JS
c95aaa4d48 feat(brain): add domain events + tools for remaining 9 modules
Batches 5+6: extends to 29 modules. Adds events and tools for cycles,
firsts, guides, inventory, photos, plants, news, recipes, questions.

New domain events (12 types):
- Cycles: CycleDayLogged
- Firsts: FirstCreated
- Guides: GuideCreated
- Inventory: InventoryItemCreated
- Photos: PhotoDeleted
- Plants: PlantCreated, PlantDeleted
- News: ArticleSaved
- Recipes: RecipeCreated, RecipeDeleted
- Questions: QuestionAsked

New tools (7 tools):
- Cycles: log_cycle_day
- Firsts: create_first
- Guides: create_guide
- Inventory: create_inventory_item
- Plants: create_plant
- Recipes: create_recipe

Skipped (no simple create API): context (read-only), news (complex
LocalCachedArticle input), questions (requires questionId).

Totals: 67 event types, 47 tools across 29 modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:26:57 +02:00
Till JS
c7de86282b feat(brain): add domain events + tools for music, storage, chat, memoro, skilltree
Batch 4: extends to 20 modules. Adds events and tools for music
(song added, playlist created), storage (folder created), chat
(message sent, conversation created), memoro (memo created), and
skilltree (skill created, XP added).

New domain events (10 types):
- Music: SongAdded, PlaylistCreated
- Storage: FolderCreated, FileDeleted
- Chat: ChatMessageSent, ChatConversationCreated
- Memoro: MemoCreated, MemoDeleted
- Skilltree: SkillXpAdded, SkillCreated

New tools (8 tools):
- Music: create_playlist
- Storage: create_folder
- Chat: create_chat_conversation
- Memoro: create_memo
- Skilltree: add_skill_xp, create_skill

Totals: 55 event types, 40 tools across 20 modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:07:34 +02:00
Till JS
7752ba9ff9 feat(brain): add domain events + tools for finance, dreams, cards, times, events
Extends the Companion Brain to 15 modules. Adds semantic domain events
and LLM tools for finance, dreams, cards, times, and social events.

New domain events (10 types):
- Finance: TransactionCreated, TransactionDeleted
- Dreams: DreamCreated, DreamDeleted
- Cards: CardCreated, CardStudied
- Times: TimerStarted, TimerStopped
- Social Events: SocialEventCreated, SocialEventDeleted

New tools (7 tools):
- Finance: add_transaction
- Dreams: create_dream
- Cards: create_card
- Times: start_timer, stop_timer
- Events: create_social_event

Totals: 45 event types, 32 tools across 15 modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:00:01 +02:00
Till JS
c51382a76e feat(brain): add domain events + tools for habits, journal, notes, contacts, body
Extends the Companion Brain to 10 modules (from 5). Adds semantic
domain events and LLM tools for the next 5 most valuable modules.

New domain events (15 types):
- Habits: HabitLogged, HabitCreated, HabitDeleted
- Journal: JournalEntryCreated, JournalMoodSet, JournalEntryDeleted
- Notes: NoteCreated, NoteDeleted
- Contacts: ContactCreated, ContactDeleted
- Body: WorkoutStarted, WorkoutFinished, SetLogged,
  MeasurementLogged, EnergyCheckLogged

New tools (12 tools):
- Habits: log_habit, get_habits, create_habit
- Journal: create_journal_entry, set_mood
- Notes: create_note
- Contacts: create_contact, get_contacts
- Body: start_workout, finish_workout, log_measurement

Totals: 35 event types, 25 tools across 10 modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:48:15 +02:00
Till JS
4211ce68da feat(brain): add 4 Companion Brain workbench pages
Registers Mein Tag, Event Stream, Companion Chat, and Ziele as
workbench apps so they can be added to scenes alongside existing
modules like Todo, Calendar, etc.

New workbench pages:
- Mein Tag (myday): DaySnapshot overview — tasks, events, water
  progress, nutrition, streaks at a glance
- Events (eventstream): live domain event feed with icons, labels,
  and timestamps — shows the system "pulse" in real-time
- Companion (companion): embedded chat interface that auto-creates
  a conversation on first use
- Ziele (goals): goal cards with progress bars, template picker
  for quick goal creation, pause/resume/delete

Each page registered in both app-registry (workbench views) and
shared-branding (app metadata, icons, descriptions, tier=guest).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:33:53 +02:00
Till JS
e1884cfbd1 fix(brain): fix companion page not rendering — schema version + query robustness
- Bump companion tables to db.version(14) so the schema upgrade
  runs even on browsers that already saw v10 with only _events
- Add try/catch to useConversations() and useMessages() queries
  to prevent silent crashes if tables don't exist yet
- Use db.table() directly in chat store instead of collections.ts
  module-level references (avoids eager table resolution issues)
- Add min-height to empty state and companion page container

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:19:59 +02:00
Till JS
0847ec86e8 docs(brain): update architecture plan with Phase 5-7 completion and testing guide
Marks all 7 phases as completed with commit hashes, implementation
notes, and decisions made during implementation. Adds comprehensive
manual testing section covering Event Bus, Projections, Companion Chat,
Rituals, Goals, Memory, Correlations, and Pulse Rules — with code
snippets for DevTools Console and IndexedDB inspection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:11:04 +02:00
Till JS
87a1dd6829 feat(brain): add Semantic Memory, Pattern Extractors, and Correlation Engine
Phase 7 (final) of the Companion Brain architecture.

Semantic Memory (companion/memory/):
- MemoryFact model with confidence lifecycle (0.3 initial, +0.15 confirm,
  -0.15 contradict, weekly decay after 30 days, delete below 0.1)
- Store with recordFact (upsert by factKey), contradictFact, applyDecay
- 3 pattern extractors: day-of-week (recurring days), time-of-day
  (peak 4h window), frequency (daily average) — all rule-based, no LLM
- Runs across all 5 pilot modules (11 extraction rules total)

Correlation Engine (data/projections/correlations.ts):
- Pearson correlation between 7 daily metrics across 4 modules
- Metrics: tasks completed, water ml, coffee count, calories, meals,
  calendar events, places visited
- Only returns cross-module correlations with |r| >= 0.3 and >= 14 days
- Natural language sentence generation for each correlation

Context Document updated:
- Now accepts optional memory facts + correlations
- Appends "Bekannte Muster" section (top 6 high-confidence facts)
- Appends "Zusammenhaenge" section (top 3 correlations with r-value)

This completes all 7 phases of the Companion Brain architecture.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:07:46 +02:00
Till JS
41357b2541 feat(brain): add Ritual system with guided routines and step execution
Phase 6 of the Companion Brain. Introduces guided routines ("rituals")
that walk users through multi-step sequences, executing tools and
displaying projection data at each step.

Data layer (companion/rituals/):
- LocalRitual + LocalRitualStep + LocalRitualLog types
- 6 step types: tool_call, number_input, text_input, mood_picker,
  info_display, checklist
- 3 templates: Morning routine (water + events + tasks + streaks),
  Evening routine (progress + reflection), Hydration check
- Store with createFromTemplate, CRUD, step management, completion logs
- Reactive queries for active/all rituals

UI:
- RitualRunner.svelte: step-by-step card UI with progress bar,
  tool execution, number/text input, projection data display,
  skip/next navigation
- /companion/rituals route: ritual list, template picker, play/pause

Adds rituals + ritualSteps + ritualLogs tables (v10 schema).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:01:37 +02:00
Till JS
46db527f8c feat(brain): add Companion Chat module with LLM tool calling
Phase 5 of the Companion Brain. Introduces the Companion Chat that
ties together all previous phases into a conversational interface.

Module (modules/companion/):
- types.ts: LocalConversation + LocalMessage with tool call/result fields
- collections.ts: companionConversations + companionMessages tables
- stores/chat.svelte.ts: conversation + message CRUD
- queries.ts: reactive useConversations() + useMessages()
- engine.ts: chat orchestration — builds system prompt from Context
  Document, sends to local LLM (Gemma via @mana/local-llm), handles
  tool calls via JSON extraction + executeTool(), supports multi-round
  tool calling (max 3 rounds)

UI:
- CompanionChat.svelte: message list, streaming output, tool result
  display, keyboard submit (Enter)
- /companion route: sidebar with conversation list + chat area

Also updates the architecture plan with Phase 1-4 completion status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:23:38 +02:00
Till JS
1e992d3c92 feat(sleep): add sleep module with tracking, hygiene checklists, and stats
New "Sleep/Schlaf" module for daily sleep tracking with morning quick-log,
quality ratings, sleep hygiene evening checklists, and comprehensive stats.

Includes: 10 preset hygiene checks, upsert-by-date entries, week bar chart
with goal line, sleep debt calculation, consistency score (stddev-based),
streak tracking, 30-day quality heatmap, and hygiene-quality correlation.

Dashboard shows last night summary, week overview, stats grid, and hygiene
impact. Morning log has smart defaults, star rating, interruption counter,
tag chips. Hygiene checklist supports custom user-created checks.

Registered in module-registry, encryption registry (4 tables), database v13,
seed-registry, app-icons (moon icon, indigo), mana-apps, and workbench.

Also updates MODULE_IDEAS.md with stretch (built), posture, skin, eyes entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:19:52 +02:00
Till JS
66dd684bba feat(brain): add Tool Layer with LLM-accessible module operations
Phase 4 of the Companion Brain. Introduces a standardized tool
interface that gives LLMs read/write access to module operations
via function calling.

Core (data/tools/):
- ModuleTool interface with typed parameters and execute function
- Registry with dynamic registration and LLM schema generator
- Executor with parameter validation and error handling
- Init function wired into app layout startup

Module tools (13 tools across 5 modules):
- Todo: create_task, complete_task, get_task_stats
- Calendar: create_event, get_todays_events
- Drink: log_drink, get_drink_progress, undo_last_drink
- Nutriphi: log_meal, get_nutrition_summary
- Places: create_place, record_visit, get_places, get_current_location

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:47:32 +02:00
Till JS
777810d0d2 docs(mail): add TODO checklist for remaining Phase 1-4 work
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:46:00 +02:00
Till JS
a2f05409a4 chore(mail): add infra — port 3042, DB schema setup, pnpm install
Reserves port 3042 in PORT_SCHEMA.md, adds mail pgSchema to
setup-databases.sh and init-db scripts, installs mana-mail workspace
dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:42:12 +02:00
Till JS
9066b6c9ae feat(brain): add Goal system, Pulse Rule Engine, and Feedback Loop
Phase 3 of the Companion Brain architecture.

Goal System (companion/goals/):
- LocalGoal model with metric + target definitions
- Event bus subscriber that auto-tracks progress per period
- 6 goal templates (water, tasks, meals, calories, places, coffee)
- CRUD store with pause/resume/complete/abandon lifecycle

Pulse Rule Engine (companion/rules/):
- 5 deterministic rules: water reminder (90min interval), streak
  warning (18:00), morning summary (08:00), overdue tasks (10+15:00),
  meal reminder (12+19:00)
- ReminderSource adapter for existing reminder scheduler
- Interval + schedule triggers with per-rule last-run tracking
- Dismissal tracking via localStorage

Feedback Loop (companion/feedback/):
- NudgeOutcome model (acted/dismissed/snoozed/expired + latency)
- Persisted to _nudgeOutcomes IndexedDB table
- Stats + action rate queries for future rule optimization

Also adds companionGoals, _memory, _nudgeOutcomes tables (v10 schema).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:40:42 +02:00
Till JS
a3de6b3d81 feat(mail): add mana-mail service and frontend module (Phase 1 MVP)
Backend: Hono/Bun service on port 3042 with JMAP client for Stalwart,
account provisioning (@mana.how addresses on user registration),
thread/message/send/label API endpoints, and JWT + service-key auth.

Frontend: Mail module with 3-column inbox UI (mailboxes, thread list,
detail/compose), local-first encrypted drafts in Dexie, and API-driven
thread fetching. Scoped CSS with theme tokens.

Integration: Dexie v11 schema, mail pgSchema in mana_platform,
mana-auth fire-and-forget hook for account provisioning,
getManaMailUrl() in API config, app registry + branding update.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:35:54 +02:00
Till JS
40e1145e9f feat(brain): add Projection Engine with DaySnapshot, Streaks, and Context Document
Phase 2 of the Companion Brain. Adds live-reactive projections that
aggregate data across all 5 pilot modules into high-level views:

- DaySnapshot: today's tasks (total/completed/overdue/due), calendar
  events (upcoming/next), drink intake (water/coffee/total with goals),
  nutrition (meals/calories/protein with goals), places visited
- Streaks: consecutive-day tracking for water goal, task completion,
  and meal logging with active/at_risk/broken status (90-day lookback)
- Context Document: ~500 token markdown generator combining DaySnapshot
  + Streaks for LLM system prompts

Also wires startEventStore() into the app layout so domain events
from Phase 1 are persisted to IndexedDB on every module mutation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:35:36 +02:00
Till JS
aabf130480 feat(stretch): add stretch module with guided routines, assessment, and reminders
New "Dehnen/Stretch" module for guided stretching with timer-based sessions,
mobility self-assessments, streak tracking, and configurable reminders.

Includes: 22 seed exercises, 5 preset routines (morning, desk break, evening,
upper body, lower body), fullscreen session player with Performance.now() timer
and Wake Lock, 6-step mobility assessment wizard with scoring, 30-day heatmap,
body region balance chart, custom routine builder, and reminder management.

Registered in module-registry, encryption registry (5 tables), database v9,
seed-registry, app-icons, mana-apps, and workbench app-registry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:29:06 +02:00
Till JS
e927c1f10f feat(brain): add Domain Event Bus and emit events from 5 pilot modules
Phase 1 of the Companion Brain architecture. Introduces a typed,
synchronous event bus with microtask-scheduled handlers, an append-only
event store persisted to IndexedDB (_events table, v10 schema), and
semantic domain events emitted from module stores.

Pilot modules with emit() calls:
- Todo: TaskCreated, TaskCompleted, TaskUncompleted, TaskDeleted, SubtasksUpdated
- Calendar: CalendarEventCreated, CalendarEventUpdated, CalendarEventDeleted
- Drink: DrinkLogged, DrinkEntryDeleted, DrinkEntryUndone
- Nutriphi: MealLogged, MealFromPhotoLogged, MealDeleted
- Places: PlaceCreated, PlaceDeleted, PlaceVisited, LocationLogged,
  TrackingStarted, TrackingStopped

Also includes the full architecture plan at
docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:25:46 +02:00
Till JS
f5b9d0a31f feat(recipes): add recipe module with local-first data, encryption, and card UI
New "Rezepte" module following the established scoped-CSS + theme-token
pattern. Includes Dexie schema (v8), encryption for user-typed fields,
3 German seed recipes, search/filter/tag UI, inline creation form, and
expanded detail view with ingredients checklist and numbered steps.

Also documents the frontend styling inconsistency (13/40 ListViews use
Tailwind instead of scoped CSS) in docs/optimizable/ for future cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:45:41 +02:00
Till JS
65160024f7 feat(workbench): improve fullscreen, scene bar styling, and inline scene creation
- PageShell maximized: fill viewport edge-to-edge (max-width none, z-index 95
  above bottom bar, border none), constrain body/header to 48rem centered, Esc
  exits fullscreen
- SceneAppBar: pill-shaped bar and items, match TagStrip font size (0.9375rem),
  visual group bracket for active scene with separator, tab count on all scenes,
  inline name input for new scenes instead of modal dialog
- SceneRenameDialog: remove icon field, simplify to name-only

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:45:09 +02:00
Till JS
971ad37b4a style(landing): use generic tool categories instead of brand names
Some checks are pending
CI / Build mana-api-gateway (push) Blocked by required conditions
CI / Build mana-crawler (push) Blocked by required conditions
CI / Build mana-media (push) Blocked by required conditions
CI / Build mana-credits (push) Blocked by required conditions
CI / Build mana-web (push) Blocked by required conditions
CI / Build chat-backend (push) Blocked by required conditions
CI / Build chat-web (push) Blocked by required conditions
CI / Build todo-backend (push) Blocked by required conditions
CI / Build todo-web (push) Blocked by required conditions
CI / Build calendar-backend (push) Blocked by required conditions
CI / Build calendar-web (push) Blocked by required conditions
CI / Build clock-web (push) Blocked by required conditions
CI / Build contacts-backend (push) Blocked by required conditions
CI / Build contacts-web (push) Blocked by required conditions
CI / Build presi-web (push) Blocked by required conditions
CI / Build storage-backend (push) Blocked by required conditions
CI / Build storage-web (push) Blocked by required conditions
CI / Build telegram-stats-bot (push) Blocked by required conditions
CI / Build nutriphi-backend (push) Blocked by required conditions
CI / Build nutriphi-web (push) Blocked by required conditions
CI / Build skilltree-web (push) Blocked by required conditions
Docker Validate / Validate Dockerfiles (push) Waiting to run
Docker Validate / Build calendar-web (push) Blocked by required conditions
Docker Validate / Build todo-backend (push) Blocked by required conditions
Docker Validate / Build todo-web (push) Blocked by required conditions
Docker Validate / Build zitare-web (push) Blocked by required conditions
Docker Validate / Build mana-auth (push) Blocked by required conditions
Docker Validate / Build mana-sync (push) Blocked by required conditions
Docker Validate / Build mana-media (push) Blocked by required conditions
Mirror to Forgejo / Push to Forgejo (push) Waiting to run
Replaces specific tool names (Todoist, Notion, ChatGPT, etc.) with
generic categories (Aufgaben-App, KI-Assistent, etc.) in the
comparison section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:43:35 +02:00
Till JS
bfa237d88e style(landing): make flow links subtler with underline instead of pills
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:39:22 +02:00
Till JS
e97d7d10e2 refactor(landing): replace star ratings with flowing text summary
Removes all star ratings from the features page. Replaces the card
grid summary with a flowing paragraph of clickable keyword links
that scroll to each feature section. Both simple and tech views
updated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:35:02 +02:00
Till JS
ca3087446b feat(landing): add simple/tech toggle on features page
Rewrites all USP texts for non-technical users (no jargon like
IndexedDB, tables, AES-GCM-256). Adds a "Für alle / Technik" toggle
switch that swaps between user-friendly marketing copy and deep
technical architecture details. Toggle state persists in localStorage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:26:39 +02:00
Till JS
aa3f5d6407 feat(landing): add /features USP page with ratings and comparison
Adds a comprehensive features page listing all 12 USPs of the Mana
platform with usefulness ratings (3-5 stars), detail bullet points,
and a cost comparison section (Mana vs individual tools). Also fixes
a devlog content schema error (category 'fix' -> 'bugfix') and adds
a footer link to the new page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:07:42 +02:00
Till JS
03bcd5e7f3 fix(ui): update app icons for 12 modules
playground→PencilRuler, questions→Binoculars, skilltree→ArrowsInCardinal,
events→CalendarStar, finance→MoneyWavy, uload→DownloadSimple

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:48:09 +02:00
Till JS
55b7a8a2ef feat(pillnav): compact nav with user menu overlay panel
Replace inline PillDropdownBar for user menu with a centered overlay
panel (UserMenuPanel). Move AI tier, theme, and language selectors
into the panel. Make app switcher and user pill icon-only. AI section
split into "Textgenerierung" and "Spracherkennung" subsections.

- AppDrawer trigger: icon-only (no label/chevron)
- User pill: icon-only, opens overlay panel instead of bar
- Theme + AI pills removed from nav bar (now in user panel)
- UserMenuPanel: centered on desktop, bottom-sheet on mobile
- Login button in footer, structured sections with subsection headers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:46:39 +02:00
Till JS
f47ea966df fix(ui): update app icons and add missing i18n labels
Icons: moodlit→SunHorizon, body→Person, cycles→GenderFemale,
notes→Notepad, guides→Books, context→File, who→PersonSimpleCircle,
memoro→Microphone, firsts→NumberCircleOne

Add missing app labels (cycles, body, dreams, journal, firsts, who,
events) in all 5 locales (de/en/fr/it/es).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:32:38 +02:00
Till JS
16fef572bf fix(auth): use getValidToken() instead of getAccessToken() for API calls
getAccessToken() reads the stored JWT without checking expiry, causing
401s when the token ages out — especially for services not covered by
the fetch interceptor (credits, events, api, etc.). getValidToken()
checks validity first and refreshes automatically when needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:26:10 +02:00
Till JS
4616798d34 fix(calc): use safe evaluate engine in ListView, add error logging
The workbench ListView was using Function() (effectively eval) with
aggressive sanitizing that stripped valid characters, causing every
calculation to fail with a generic "Fehler". Now uses the same safe
parser as the standard calculator page. Also adds console.error
logging and shows result before persisting to DB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:57:46 +02:00
Till JS
a91a6076cc refactor: rename planta → plants, clean up codebase
- Rename planta module to plants everywhere (routes, modules, API,
  branding, i18n, docker, docs, shared packages)
- Fix package name collisions: @mana/credits-service, @mana/subscriptions-service
  (unblocks turbo)
- Extract layout composables: use-ai-tier-items, use-sync-status-items,
  RouteTierGate (layout 1345→1015 lines)
- Create shared DB pool for apps/api (lib/db.ts), migrate 5 modules
- Add automations module queries.ts with useAllAutomations/useEnabledAutomations
- Remove debug console.log statements from production code
- Rename storage display name: Ablage → Speicher

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:59:44 +02:00
Till JS
c6c19dbc77 feat(moodlit): fullscreen mood on click with visual card redesign
Clicking a mood now opens it immediately in fullscreen (browser
Fullscreen API, z-index above all UI). Preview step removed.
Cards redesigned with full gradient backgrounds, live animations,
gradient overlays, and hover border highlight.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:45:31 +02:00
Till JS
d6a1c9fd8b feat(drink): add beverage tracking module with inline editing
New module for tracking all beverages (water, coffee, tea, juice, alcohol, etc.)
with daily progress bar, quick-tap presets, and inline editing of quantity/date/time.

Includes: module config, types, collections with guest seed (5 presets),
queries, store, ListView with context menus, route, app-registry registration,
Dexie schema v7, encryption registry, shared-branding icon/app entry.

Also extends docs/future/MODULE_IDEAS.md with additional module ideas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:41:06 +02:00
Till JS
7314e9b763 fix(docker): add local-stt package to mana-web Dockerfile
Some checks are pending
CI / Build mana-api-gateway (push) Blocked by required conditions
CI / Build mana-crawler (push) Blocked by required conditions
CI / Build mana-media (push) Blocked by required conditions
CI / Build mana-credits (push) Blocked by required conditions
CI / Build mana-web (push) Blocked by required conditions
CI / Build chat-backend (push) Blocked by required conditions
CI / Build chat-web (push) Blocked by required conditions
CI / Build todo-backend (push) Blocked by required conditions
CI / Build todo-web (push) Blocked by required conditions
CI / Build calendar-backend (push) Blocked by required conditions
CI / Build calendar-web (push) Blocked by required conditions
CI / Build clock-web (push) Blocked by required conditions
CI / Build contacts-backend (push) Blocked by required conditions
CI / Build contacts-web (push) Blocked by required conditions
CI / Build presi-web (push) Blocked by required conditions
CI / Build storage-backend (push) Blocked by required conditions
CI / Build storage-web (push) Blocked by required conditions
CI / Build telegram-stats-bot (push) Blocked by required conditions
CI / Build nutriphi-backend (push) Blocked by required conditions
CI / Build nutriphi-web (push) Blocked by required conditions
CI / Build skilltree-web (push) Blocked by required conditions
Docker Validate / Validate Dockerfiles (push) Waiting to run
Docker Validate / Build calendar-web (push) Blocked by required conditions
Docker Validate / Build todo-backend (push) Blocked by required conditions
Docker Validate / Build todo-web (push) Blocked by required conditions
Docker Validate / Build zitare-web (push) Blocked by required conditions
Docker Validate / Build mana-auth (push) Blocked by required conditions
Docker Validate / Build mana-sync (push) Blocked by required conditions
Docker Validate / Build mana-media (push) Blocked by required conditions
Mirror to Forgejo / Push to Forgejo (push) Waiting to run
The Docker build failed because @mana/local-stt was added as a
workspace dependency but not COPYed into the build context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:26:50 +02:00
Till JS
631cdafdb5 feat(voice): route STT through local Whisper when model is loaded
transcribeAudio() now checks localSTT.isReady before falling back to
the server-side mana-stt proxy. When local STT is active, audio blobs
are decoded to Float32Array via AudioContext.decodeAudioData() and
transcribed entirely on-device. The returned model field shows
"Whisper Tiny (lokal)" or similar so every module (dreams, memoro,
habits) displays which backend was used — no module code changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:17:56 +02:00
Till JS
14d11272c9 fix(calendar): use button for event rows to fix a11y warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:12:37 +02:00
Till JS
949795c267 feat(web): shared FloatingInputBar, migrate 7 modules
Extract the floating pill-shaped input bar (text + optional voice)
into a shared component at $lib/components/FloatingInputBar.svelte.
Migrate todo, calendar, dreams, notes, journal, memoro and contacts
from inline forms / VoiceCaptureBar to the unified bottom bar.

Calendar now shows all upcoming events with relative date labels
(Heute, Morgen, weekday name, or short date).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:08:03 +02:00
Till JS
0deab50a9c feat(todo): minimal ListView redesign with floating input
Stripped stats counters, filter tabs, and VoiceCaptureBar. Now shows
a flat list with round monochrome checkboxes, inline due-date badges
(Überfällig/Heute/date), completed tasks below a divider with
completion timestamp, and a pill-shaped FloatingInputBar at the
bottom with integrated voice input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:07:52 +02:00
Till JS
248100d490 fix(web): remove hardcoded white text, use theme tokens for light mode
PageShell header icon/title had opacity: 0.5 — removed for full
visibility. Moodlit, Zitare, Skilltree and BaseListView used
text-white/* classes that were invisible in light mode — migrated
to hsl(var(--color-foreground/muted-foreground)) tokens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:07:40 +02:00
Till JS
3deee755b3 feat(web): PillNav bar mode, fullscreen, local STT + mic button
PillNav overhaul:
- Dropdown-as-bar: theme/AI/sync/user menus render as horizontal
  bars in the bottom stack (PillDropdownBar) instead of floating
  popovers. New onOpenBar/activeBarId props on PillNavigation.
- iconOnly pills: tags/search/workbench-tabs pills show only icons.
  Home pill removed. New iconOnly flag on PillNavItem.
- Segmented toggle groups: items sharing a `group` id render as a
  single segmented pill (e.g. Light/Dark/System triple).
- Fullscreen mode: press "f" to hide all bottom chrome, Esc to exit.
- QuickInputBar + bottom bar visibility toggles via new pills.
- Progress ring on AI trigger pill during model download
  (conic-gradient ::after, follows pill border-radius).

@mana/local-stt — new package for browser-local speech-to-text:
- Whisper models via transformers.js v4 (WebGPU + WASM fallback)
- Same Web Worker architecture as @mana/local-llm
- Two models: Whisper Tiny (150 MB) and Whisper Small (950 MB)
- Reactive Svelte 5 bindings (getLocalSttStatus, loadLocalStt, transcribe)

Voice-to-text integration:
- useLocalStt() composable: mic capture via AudioContext +
  ScriptProcessor, resample to 16kHz mono, feed into Whisper worker
- Mic button in QuickInputBar (leftAction slot) with
  recording/loading/transcribing states + pulse animation
- Transcribed text injected into InputBar via new injectedText prop
- STT model selector in AI bar alongside LLM tier controls

Also: vite.config.ts server.fs.allow expanded to monorepo root
so workspace package workers resolve in dev.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:05:43 +02:00
Till JS
8c2f9306e9 feat(web): wallpaper system + sticky PageHeader
Wallpaper system with four sources (predefined images, CSS gradients,
custom uploads via mana-media, and theme default). Configurable per-scene
or globally, with overlay controls (blur + opacity) and hover preview.

Adds sticky prop to shared PageHeader component and applies it across
themes, settings, credits, subscription, help, and profile pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:00:03 +02:00
Till JS
a9c51517eb fix(presi): wire up db:push for presi schema via @mana/api
The presi module's schema was defined inline in routes.ts but had no
working db:push mechanism — the old references to @presi/server and
@presi/backend no longer exist after consolidation. Extracts schema
into its own file, adds a dedicated drizzle config, and updates the
setup script so tables are actually created.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:32:44 +02:00
Till JS
474ba93d70 feat(workbench): dynamic page height + tighter bottom-stack spacing
PageShell cards now fill the available viewport between the workbench
top padding and the bottom chrome instead of using a static 60vh.
Height is calculated via two CSS vars published by the layout <main>:

  height: calc(100dvh - var(--bottom-chrome-height) - var(--workbench-reserved-y))

--bottom-chrome-height reacts to pill-nav collapse, tag strip toggle
and bottom-bar mount state. --workbench-reserved-y (2.5rem) folds the
wrapper padding + buffer into a single non-chrome offset. dvh handles
Safari's retractable address bar. Inline height from resize-drag still
overrides as before.

Bottom-stack bars now use a uniform `gap: 0.25rem` instead of ad-hoc
per-child padding-bottom, giving consistent 4px spacing between all
bars. Wrapper vertical padding reduced from py-4/py-8 to py-2/py-3
and main's bottom buffer from +32px to +8px — cards gain ~72px of
usable vertical space on a typical viewport.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:15:47 +02:00
Till JS
68c2442419 feat(workbench): paper-grain polish — blend-mode, border, stone palette
Some checks are pending
CI / Build mana-api-gateway (push) Blocked by required conditions
CI / Build mana-crawler (push) Blocked by required conditions
CI / Build mana-media (push) Blocked by required conditions
CI / Build mana-credits (push) Blocked by required conditions
CI / Build mana-web (push) Blocked by required conditions
CI / Build chat-backend (push) Blocked by required conditions
CI / Build chat-web (push) Blocked by required conditions
CI / Build todo-backend (push) Blocked by required conditions
CI / Build todo-web (push) Blocked by required conditions
CI / Build calendar-backend (push) Blocked by required conditions
CI / Build calendar-web (push) Blocked by required conditions
CI / Build clock-web (push) Blocked by required conditions
CI / Build contacts-backend (push) Blocked by required conditions
CI / Build contacts-web (push) Blocked by required conditions
CI / Build presi-web (push) Blocked by required conditions
CI / Build storage-backend (push) Blocked by required conditions
CI / Build storage-web (push) Blocked by required conditions
CI / Build telegram-stats-bot (push) Blocked by required conditions
CI / Build nutriphi-backend (push) Blocked by required conditions
CI / Build nutriphi-web (push) Blocked by required conditions
CI / Build skilltree-web (push) Blocked by required conditions
Docker Validate / Validate Dockerfiles (push) Waiting to run
Docker Validate / Build calendar-web (push) Blocked by required conditions
Docker Validate / Build todo-backend (push) Blocked by required conditions
Docker Validate / Build todo-web (push) Blocked by required conditions
Docker Validate / Build zitare-web (push) Blocked by required conditions
Docker Validate / Build mana-auth (push) Blocked by required conditions
Docker Validate / Build mana-sync (push) Blocked by required conditions
Docker Validate / Build mana-media (push) Blocked by required conditions
Mirror to Forgejo / Push to Forgejo (push) Waiting to run
Switch PageShell's per-theme paper overlay from a ::before +
mix-blend-mode + opacity stack to direct background-blend-mode on the
element itself. The old approach had invisibility issues in dark mode
and stacking-context quirks that made the grain disappear entirely.
background-blend-mode against background-color is the simpler, more
reliable primitive.

utils.ts auto-switches multiply → overlay in dark mode (dark × dark is
essentially invisible) while leaving other blend modes as-is. The
opacityLight/opacityDark knobs are gone from the paper config since
background-blend-mode has no opacity slot — tune via blendMode choice
instead.

Visual tuning pass:
- Card border bumped from 1px box-shadow ring to a real 2px border
  with background-clip: border-box so the paper texture reads
  continuously across the edge. Alpha 0.12 light / 0.28 dark (black).
- Drop shadow deepened (0 8px 24px + 0 3px 8px) for more card lift.
- Stone theme cooled toward real slate-blue: hue 200 → 212, saturation
  bumped ~10pts across the palette. Stone was reading as warm-neutral
  grey, now it's a proper cold blue.
- Texture remap: Lume → paper-004 (strongest grain, 480px tile for
  coarser fiber), Stone → cardboard-002 (linen), Lavender → paper-001
  (freed up after Stone claimed cardboard-002).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 23:38:30 +02:00
Till JS
47aebe3c3b fix(web): improve HTTP detection for HTTPS redirect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:48:45 +02:00
Till JS
7ba058c017 fix(web): redirect HTTP to HTTPS to fix Safari CORS hang
When users type 'mana.how' (no scheme), Safari and other browsers default
to HTTP. Cloudflare/cloudflared serves the page over HTTP without
rewriting the scheme. The browser then sends 'Origin: http://mana.how'
on every fetch, but mana-auth CORS only allows 'https://mana.how'.

Result: every auth request fails, the SSO check throws, AuthGate hangs
on the loading spinner forever, and the page never finishes loading.

Fix: detect HTTP requests in hooks.server.ts via cf-visitor /
x-forwarded-proto / event.url.protocol and 301-redirect to HTTPS before
serving any content. Localhost is exempted for dev.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:38:21 +02:00
Till JS
f3cc853e08 feat(places): clickable tracking label + full address + browser proxy
Three related fixes for the workbench tracking overlay:

1. **Same-origin proxy at /api/v1/geocode/[...path]/+server.ts.**
   mana-geocoding is intentionally NOT exposed via Cloudflare, so the
   browser can't reach it directly — localhost:3018 is unreachable from
   a visitor's device. Same-origin proxy fixes this: the browser talks
   to https://mana.how/api/v1/geocode/*, SvelteKit forwards to
   http://mana-geocoding:3018 over the docker network. Pattern copied
   from the existing /api/v1/who/[...path] proxy.

2. **`formatFullAddress()` in $lib/geocoding** builds a compact line
   with street+housenumber, postal code, city, and 2-letter country
   code (DE/AT/CH) — e.g. "Hafenstraße 2, 78462 Konstanz, DE". Maps
   German and English OSM country names to ISO 3166-1 alpha-2.

3. **Clickable, inline-editable tracking label in ListView.** The
   tracking overlay used to show "47.6630, 9.1750" while tracking was
   active. Now it shows the venue name + full address with ISO country
   code, tapping it switches to an autocomplete input so the user can
   fix the location when GPS snaps to the wrong building. Debounced
   reverse-geocode on position change (1.5 s + 10 m precision), edits
   are kept local — the current tracking position drives the label
   but user corrections override until the next significant move.

The client lib now uses relative URLs in the browser (same-origin
proxy) and absolute URLs only from Node/SSR (via env var or localhost
fallback). geocoding unit tests still pass (42/42 green).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:33:48 +02:00
Till JS
0c1eb623bb feat(places): show reverse-geocoded location label during tracking
When tracking is active the workbench ListView used to show only raw
coordinates ("47.6630, 9.1750"). Now a human-readable location label
appears above the coords ("Münster Café" or "Konstanz, Germany"),
fed from the shared reverse-geocoding endpoint.

To avoid hammering the geocoding service while the user is stationary
and their GPS jitters by a few metres, the effect debounces to 1.5 s
and rounds coordinates to 4 decimal places (~10 m) before checking
whether a new reverse lookup is needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:26:49 +02:00