* fix(agent): add error handling and plugin tools
Replace useless try/catch with streaming-aware error
callbacks. streamText is lazy so errors occur during
streaming, not at call time. Now unwraps RetryError
to extract the actual APICallError with status code
and response body from OpenRouter.
Also adds API key validation, model ID fallback, and
includes plugin tools in the streamText call.
* chore(db): fix file permissions on 0015 snapshot
---------
Co-authored-by: Nicholai <nicholaivogelfilms@gmail.com>
* feat(theme): visual theme system with presets, custom themes, and AI tools
Runtime theming engine with 10 preset palettes, user custom themes
persisted to D1, animated circle-reveal transitions via View Transition
API, and AI agent tools for generating/editing themes incrementally.
- Theme library: types, presets, CSS injection, font loading, animation
- Theme provider with localStorage cache for instant load (no FOUC)
- Server actions for theme CRUD and user preference persistence
- Agent tools: listThemes, setTheme, generateTheme, editTheme
- Appearance tab extracted from settings modal
- Migration 0015: custom_themes + user_theme_preference tables
- Developer documentation in docs/theme-system.md
* fix(db): make migration 0016 idempotent
tables were already created as 0015 before renumber.
use IF NOT EXISTS so the migration is safe to re-run.
---------
Co-authored-by: Nicholai <nicholaivogelfilms@gmail.com>