managarten/apps/mana/apps
Till JS e885713fd0 refactor(brain): migrate Companion engine to LlmOrchestrator (4-tier system)
Replaces the ad-hoc local-first + server-fallback pattern with the
shared LlmOrchestrator, giving the Companion Chat full access to
the 4-tier system (none/browser/mana-server/cloud) and its privacy
+ user-preference enforcement.

New companionChatTask (lib/llm-tasks/companion-chat.ts):
- name: 'companion.chat'
- minTier: 'browser' (no rules fallback — needs an LLM)
- contentClass: 'personal' (allows server/cloud if user opted in;
  NOT 'sensitive' because the chat isn't restricted to browser-only,
  but the user can set it per-task via taskOverrides)
- requires: { streaming: true }

Engine changes:
- callLlm() now delegates to llmOrchestrator.run(companionChatTask, ...)
- Still preloads the local model when browser tier is available so
  the UI can show download progress
- isCompanionAvailable() now asks llmOrchestrator.canRun() which
  considers user settings + backend readiness + consent gates

User benefits:
- Tier-selector in the PillNav now applies to Companion Chat
- Users can force cloud/server/browser per-task via settings overrides
- Cloud tier only runs when cloudConsentGiven is set
- Privacy: content marked 'sensitive' in other tasks (Journal etc.)
  is still restricted to browser/rules — Companion respects the
  same orchestrator so privacy invariants hold consistently

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 14:09:57 +02:00
..
landing style(landing): use generic tool categories instead of brand names 2026-04-13 16:43:35 +02:00
mobile chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
web refactor(brain): migrate Companion engine to LlmOrchestrator (4-tier system) 2026-04-14 14:09:57 +02:00