Execute the full AIUI product roadmap from PLAN.md. Work through milestones M1→M7 in priority order. For each task: read the detailed spec from PLAN.md, develop the feature, run tests, fix issues, verify with `pnpm test && pnpm lint && pnpm typecheck`, commit, and move on.
- [x]**M1.3: Unit tests for contentExtraction** — Create `packages/app/src/__tests__/contentExtraction.test.ts`. Test all 10 extraction functions (films, songs, podcasts, books, TV, places, magazine, stripTags, boldLinks). See PLAN.md for full test list.
- [x]**M1.1: IndexedDB Persistent Storage** — Create `packages/app/src/utils/idb-storage.ts`. Modify `packages/app/src/stores/chat.ts` to persist conversations in IndexedDB. Keep dev-chats middleware as fallback. See PLAN.md Task M1.1.
- [x]**M1.4: Unit tests for useAI** — Create `packages/app/src/__tests__/useAI.test.ts`. Mock fetch/SSE. Test provider selection, context injection, sendMessage, stopGeneration. See PLAN.md Task M1.4.
- [ ]**M1.5: E2E Test Expansion** — Add 8 new E2E tests to `packages/app/e2e/content-surfaces.spec.ts`: streaming response, film cards, detail view, mobile overlay, stop button, web search toggle, new conversation, panel toggle. See PLAN.md Task M1.5.
## Phase 2: M2 — Content Experience (UX)
- [x]**M2.1: Markdown Rendering in Chat** — `pnpm add markdown-it @types/markdown-it` in packages/app. Modify ChatMessage.vue to render markdown after stripping content tags. No raw HTML passthrough (XSS safe). Add CSS for code blocks, lists, links. See PLAN.md Task M2.1.
- [x]**M2.3: Music Source Resolution** — Fix usePlayer.ts: add queue (ShallowRef<Song[]>), currentIndex, playNext/playPrevious/addToQueue. Fix iframe playback. Update PlayerBar.vue with next/prev buttons and queue panel. See PLAN.md Task M2.3.
- [x]**M2.2: Virtual Scrolling for Chat** — `pnpm add @tanstack/vue-virtual` in packages/app. Replace message v-for in ChatWindow.vue with useVirtualizer. Dynamic row heights, scroll-to-bottom during streaming, overscan 5. See PLAN.md Task M2.2.
- [x]**M2.4: Nostr Feed Integration** — Create `packages/app/src/composables/useNostr.ts`. Raw WebSocket to public relays (relay.damus.io, nos.lol, relay.snort.social). Subscribe kind:1 limit 50. Update NostrGrid.vue to use composable. Lazy-load on tab activation. See PLAN.md Task M2.4.
## Phase 3: M3 — Plugin System
- [x]**M3.1: Activate Plugin Registry** — Create `packages/app/src/plugins/index.ts` (bootstrap) and `claude-provider.ts` (AI provider adapter wrapping useAI). Call `initializePlugins()` in main.ts. See PLAN.md Task M3.1.
- [x]**M3.2: Renderer Plugin Registration** — Create film-renderer.ts and song-renderer.ts in `packages/app/src/plugins/renderers/`. Register via plugin system. Migrate ContentPanel.vue to look up renderers from registry (gradual — film/song first). See PLAN.md Task M3.2.
## Phase 4: M4 — Social & Discovery
- [x]**M4.1: Social Embeds** — Create NostrEmbed.vue. Detect `nostr:note1...`, `nostr:npub1...`, `nostr:nevent1...` in ChatMessage.vue. Render as embedded cards using useNostr composable. Handle bech32 NIP-19 decoding. See PLAN.md Task M4.1.
- [x]**M4.2: Federated Search** — Create `useFederatedSearch.ts`. Add `/search` command to ChatInput.vue. Create SearchResults.vue overlay with results grouped by type (film, song, podcast, web). Keyboard navigation. See PLAN.md Task M4.2.
- [x]**M4.3: Bookmarks/Favorites** — Create `packages/app/src/stores/favorites.ts` (Pinia + IndexedDB). Create FavoriteButton.vue (heart toggle), FavoritesGrid.vue (new tab in ContentPanel). Add favorite button to FilmCard, SongCard, BookCard, etc. See PLAN.md Task M4.3.
## Phase 5: M5 — Security & Privacy
- [x]**M5.1: E2E Encryption** — Create `packages/app/src/utils/crypto.ts` using Web Crypto API. AES-256-GCM encryption, PBKDF2 key derivation (100K+ iterations). Modify idb-storage.ts to encrypt/decrypt on write/read. Skip in dev mode (`VITE_DISABLE_CRYPTO=true`). See PLAN.md Task M5.1.
- [x]**M5.2: Encrypted Storage Layer** — Create PassphraseDialog.vue. Wire encryption to all stores (conversations, favorites). Session key held in memory only. Create/enter passphrase flow. See PLAN.md Task M5.2.
- [x]**M5.3: API Key Vault** — Create `packages/app/src/utils/key-vault.ts`. Encrypted IndexedDB store for API keys. Create ApiKeyManager.vue (list providers, add/remove keys, masked display, test connection). Modify useAI.ts to read from vault. See PLAN.md Task M5.3.
## Phase 6: M6 — Payments & Identity
- [x]**M6.1: Lightning Wallet Deep-links** — Create `packages/app/src/utils/lightning.ts` (LNURL-pay, BIP21, Lightning: URIs). Create PaymentButton.vue and LightningInvoice.vue (QR code, copy, expiry countdown). Deep-link to external wallets. See PLAN.md Task M6.1.
- [x]**M6.2: Cashu Token Support** — Create `packages/app/src/utils/cashu.ts` (parse cashuA... tokens). Create CashuToken.vue inline component. Detect in ChatMessage.vue. Display amount, mint, copy/open-in-wallet buttons. AIUI is never a wallet. See PLAN.md Task M6.2.
- [x]**M7.1: MCP Server Integration** — Create `packages/app/src/plugins/mcp-server.ts`. Expose AIUI capabilities as MCP tools (search_films, search_songs, search_web, get_nostr_feed). Handle tool_use in useAI.ts. See PLAN.md Task M7.1.
- [x]**M7.2: Multi-provider AI Normalization** — Create adapter pattern: `adapters/types.ts` (AIAdapter interface), `claude-adapter.ts`, `openrouter-adapter.ts`, `ollama-adapter.ts`. Refactor useAI.ts to use adapters. See PLAN.md Task M7.2.
- [x]**M7.3: Tauri Desktop Build** — Create `src-tauri/` with tauri.conf.json and main.rs. Frameless window, transparent background for glass morphism, system tray, global shortcut (Cmd+Shift+A). See PLAN.md Task M7.3.
- [x]**M7.4: Offline Mode** — Create `packages/app/src/composables/useOffline.ts`. PWA cache strategies (app shell cache-first, API network-first, images stale-while-revalidate). Offline banner, disable chat input, show cached content. See PLAN.md Task M7.4.