diff --git a/_bmad-output/planning-artifacts/ux-design-directions.html b/_bmad-output/planning-artifacts/ux-design-directions.html deleted file mode 100644 index 8ff73818d..000000000 --- a/_bmad-output/planning-artifacts/ux-design-directions.html +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - SurfSense v2 - Design Directions - - - - - - - -
-

- SurfSense v2 Design Directions -

- -
- - - -
- -
- Click options to toggle visuals -
-
- - -
- - - - - -
- - - - -
- - -
-
-
Total Signals
-
1,204
-
- ↑ 12% vs yesterday -
-
-
-
High Risk Detected
-
23
-
Critical Awareness
-
-
-
Whale Inflow
-
$34.2M
-
Last 24h
-
- -
-
-
- πŸ€– -
-
AI Insight
-
- "ETH whale accumulation detected in L2 sector. ARB and OP showing divergent strength." -
-
-
-
-
- - -
-
-

Live Market Opportunities

-
- - -
-
- - - - - - - - - - - - - -
TokenPriceRisk ScoreWhale ActivityAction
-
- -
-
- -
- - - - diff --git a/_bmad-output/planning-artifacts/ux-design-specification.md b/_bmad-output/planning-artifacts/ux-design-specification.md index 5f6dde5d3..2b0991c39 100644 --- a/_bmad-output/planning-artifacts/ux-design-specification.md +++ b/_bmad-output/planning-artifacts/ux-design-specification.md @@ -1,73 +1,812 @@ ---- -stepsCompleted: - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 14 -inputDocuments: - - _bmad-output/planning-artifacts/prd.md - - _bmad-epics/epic-1-ai-powered-crypto-assistant.md - - _bmad-epics/epic-2-smart-monitoring-alerts.md - - _bmad-epics/epic-3-trading-execution-safety.md - - _bmad-epics/epic-4-adaptive-learning-evolution.md -outputDocument: _bmad-output/planning-artifacts/ux-design-specification.md +# SurfSense 2.0 - Complete UX Design Specification -# UX Design Specification: SurfSense v2 - -## 1. Design Strategy -**"Evolution, Not Revolution"** -- **Core Philosophy:** SurfSense v2 features will be "grafted" (injected) into the existing Research Dashboard rather than replacing it. -- **Goal:** Maintain the professional, clean utility of the current "SaaS-style" research tool while adding "Crypto-Native" signals only where critical (the "Intel Layer"). -- **Visual Identity:** "Smart Cards" & "Traffic Lights" embedded in a Clean UI. - -## 2. Core User Experience -**The "Intel Layer" Concept** -- **Problem:** Users have to switch contexts between Charts (DexScreener) and Safety Scans (Scanners/Twitter). -- **Solution:** A hybrid "Intel Layer" that sits *on top* of the chart or *inside* the research chat. -- **Mental Model:** "Traffic Light System" (Red/Green/Yellow). - - πŸ”΄ **Stop:** Scam/Rug/High Risk. (Immediate Action: Ignore) - - 🟒 **Go:** Safe/Whale Buying. (Immediate Action: Ape in/Research) - - 🟑 **Caution:** Mixed signals. (Action: Open Dashboard for Deep Dive) - -**Key Mechanics:** -1. **Initiation:** Extension detects Token URL -> Shows Traffic Light Badge. -2. **Interaction:** Click Badge -> Opens Overlay (Summary). -3. **Deep Dive:** "Ask SurfSense" -> Redirects to existing Web Dashboard (Port 3999). -4. **Integration:** Inside the Chat Interface, AI answers are formatted as **Rich UI Cards**, not just text. - -## 3. Visual Foundation (Confirmed Step 8 & 9) -**Tokens & Theming** -- **Source of Truth:** Inherited from existing `surfsense_web` (`globals.css` + Tailwind v4). -- **Base Theme:** Dark Mode (Deep Navy / `#0B1221`) to match crypto aesthetic but cleaner. -- **Typography:** Inter (Sans) for UI, Geist Mono for Data/Numbers. - -**Color Palette Extension (The "Traffic Light" Overlay)** -* **Success (Buy/Safe):** `#22c55e` (Green-500) - Solid, trustworthy. -* **Danger (Scam/Sell):** `#f43f5e` (Rose-500) - Urgent, alarming. -* **Warning (Volatility):** `#f59e0b` (Amber-500) - Cautionary. -* **Whale (Institutional):** `#3b82f6` (Blue-500) - Consistent with brand. - -## 4. Component Strategy (Smart Cards) -Instead of building a full trading terminal, we build **"Injectable Components"**: -1. **Signal Card:** Used in Chat & Extension. Shows Risk Score + 3 Key Bullets. -2. **Whale Alert Row:** Used in Lists & Notifications. Shows "Wallet X bought $50K". -3. **Mini-Chart:** Sparklines only, for quick trend context. - -## 5. Mobile & Responsive -- **Extension:** Fixed width (360px-400px), focused on "At-a-glance" data. -- **Web Dashboard:** Responsive, but optimized for Desktop Research. Mobile view converts Tables to Cards. - -## 6. Implementation Notes -- **Frontend:** Next.js (Port 3999). Use standard Tailwind classes. -- **Backend:** FastAPI (Port 3998). Serves structured JSON for UI Cards. -- **Extension:** Chrome Side Panel API. Shares UI components with Web via Repo Monorepo/Shared Lib structure. +**Version:** 2.0 +**Date:** 2026-02-02 +**Status:** βœ… COMPLETE +**Owner:** UX Designer --- -**Status:** βœ… APPROVED -**Next Steps:** Proceed to Architecture Design to map these UI components to Backend APIs. + +## Executive Summary + +This document provides comprehensive UX specifications for SurfSense 2.0 Crypto Co-Pilot, covering: +1. **Browser Extension** - Chrome Side Panel with AI chat and token analysis +2. **Web Dashboard Improvements** - Enhanced chat interface and crypto features +3. **New Features** - Watchlist, Alerts, Portfolio Tracker, Rug Pull Detection + +--- + +## Part 1: Browser Extension UX + +### 1.1 Information Architecture + +``` +Side Panel (400px width) +β”œβ”€β”€ Header (56px) +β”‚ β”œβ”€β”€ Logo + Brand +β”‚ β”œβ”€β”€ Search Space Selector +β”‚ └── Settings Menu +β”œβ”€β”€ Context Card (conditional, 140px) +β”‚ β”œβ”€β”€ Token Info (DexScreener) +β”‚ β”œβ”€β”€ Tweet Analysis (Twitter/X) +β”‚ └── Article Summary (News sites) +β”œβ”€β”€ Chat Area (flex-grow) +β”‚ β”œβ”€β”€ Welcome State (empty) +β”‚ β”œβ”€β”€ Messages List +β”‚ └── Thinking Steps +β”œβ”€β”€ Input Area (120px) +β”‚ β”œβ”€β”€ Text Input +β”‚ β”œβ”€β”€ Attachments +β”‚ └── Quick Actions +└── Quick Capture (48px sticky) +``` + +### 1.2 Detailed Wireframes + +#### 1.2.1 Main Chat Interface - Empty State + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [Crypto β–Ό] [βš™οΈ] [πŸ‘€]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”‚ +β”‚ 🌊 β”‚ +β”‚ β”‚ +β”‚ Good morning, Alex! β”‚ +β”‚ β”‚ +β”‚ Your AI co-pilot for crypto β”‚ +β”‚ research and analysis β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask about any token, market β”‚ β”‚ +β”‚ β”‚ trends, or save insights... β”‚ β”‚ +β”‚ β”‚ [πŸ“Ž][β†’]β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ Try asking: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ "Is $PEPE safe to invest?" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ "Top gainers on Solana today" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ "Analyze this wallet: 0x..." β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ“Έ Save this page to knowledge base β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +#### 1.2.2 Token Context Card (DexScreener Detection) + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [Crypto β–Ό] [βš™οΈ] [πŸ‘€]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ BULLA / SOL β”‚ β”‚ +β”‚ β”‚ Solana β€’ CA: 7xKX...3nPq β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ $0.00001234 β–² +156.7% β”‚ β”‚ +β”‚ β”‚ 24h change β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ Vol 24h β”‚ β”‚Liquidityβ”‚ β”‚ MCap β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ $1.2M β”‚ β”‚ $450K β”‚ β”‚ $2.1M β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Quick Analysis: β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”β”‚ β”‚ +β”‚ β”‚ β”‚πŸ›‘οΈSafetyβ”‚β”‚πŸ‘₯Holderβ”‚β”‚πŸ“ˆPredicβ”‚β”‚βš οΈRugβ”‚β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ [User] Is this token safe to buy? β”‚ +β”‚ β”‚ +β”‚ [AI] Analyzing BULLA token... β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ” Checking contract... β”‚ β”‚ +β”‚ β”‚ πŸ“Š Analyzing holder distributionβ”‚ β”‚ +β”‚ β”‚ πŸ’§ Verifying liquidity lock... β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask follow-up question... [πŸ“Ž][β†’]β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ“Έ Save this page to knowledge base β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +#### 1.2.3 AI Response with Safety Analysis + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ [AI] πŸ›‘οΈ Safety Analysis: BULLA/SOL β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ Overall Risk Score: 🟑 MEDIUM β”‚β”‚ +β”‚ β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 65/100 β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ βœ… Positive Signals: β”‚ +β”‚ β€’ Contract verified on Solscan β”‚ +β”‚ β€’ No mint authority (can't create more)β”‚ +β”‚ β€’ LP locked for 6 months β”‚ +β”‚ β”‚ +β”‚ ⚠️ Warning Signs: β”‚ +β”‚ β€’ Top 10 holders own 45% of supply β”‚ +β”‚ β€’ Token is only 3 days old β”‚ +β”‚ β€’ Low social media presence β”‚ +β”‚ β”‚ +β”‚ πŸ”΄ Red Flags: β”‚ +β”‚ β€’ Similar contract to known rug pulls β”‚ +β”‚ β”‚ +β”‚ πŸ“Š Holder Distribution: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ Top 10: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 45% β”‚β”‚ +β”‚ β”‚ Top 50: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 72% β”‚β”‚ +β”‚ β”‚ Others: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 28% β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ Recommendation: β”‚ +β”‚ Proceed with caution. Consider small β”‚ +β”‚ position size due to concentration β”‚ +β”‚ risk and young token age. β”‚ +β”‚ β”‚ +β”‚ Sources: Solscan, DexScreener, RugCheckβ”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +#### 1.2.4 Watchlist Panel + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [πŸ“‹ Watchlist] [βš™οΈ] [πŸ‘€] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ My Watchlist [+ Add] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ BULLA/SOL β–² +156.7% β”‚ β”‚ +β”‚ β”‚ $0.00001234 Vol: $1.2M β”‚ β”‚ +β”‚ β”‚ πŸ”” Alert: Price > $0.00002 β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ PEPE/ETH β–Ό -12.3% β”‚ β”‚ +β”‚ β”‚ $0.00000891 Vol: $45M β”‚ β”‚ +β”‚ β”‚ πŸ”” Alert: Volume spike detected β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ WIF/SOL β–² +8.2% β”‚ β”‚ +β”‚ β”‚ $2.34 Vol: $89M β”‚ β”‚ +β”‚ β”‚ βœ“ No active alerts β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ Recent Alerts β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ”΄ 2m ago: BULLA whale sold 5% supply β”‚ +β”‚ 🟑 15m ago: PEPE unusual volume spike β”‚ +β”‚ 🟒 1h ago: WIF hit price target $2.30 β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask about your watchlist... [πŸ“Ž][β†’]β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +#### 1.2.5 Alert Configuration Modal + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸ”” Configure Alert for BULLA/SOL [Γ—]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ Alert Type: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ β—‹ Price reaches β”‚ β”‚ +β”‚ β”‚ β—‹ Price change % (24h) β”‚ β”‚ +β”‚ β”‚ ● Volume spike β”‚ β”‚ +β”‚ β”‚ β—‹ Whale movement β”‚ β”‚ +β”‚ β”‚ β—‹ Liquidity change β”‚ β”‚ +β”‚ β”‚ β—‹ New holder concentration β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ Condition: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Volume increases by [ 200 ] % β”‚ β”‚ +β”‚ β”‚ within [ 1 hour β–Ό ] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ Notification: β”‚ +β”‚ β˜‘ Browser notification β”‚ +β”‚ β˜‘ Email alert β”‚ +β”‚ ☐ Telegram (connect in settings) β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ’Ύ Save Alert β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 1.3 User Flows + +#### 1.3.1 Token Safety Check Flow + +```mermaid +flowchart TD + A[User visits DexScreener] --> B{Extension detects token} + B -->|Yes| C[Show Token Info Card] + B -->|No| D[Show default chat] + C --> E[User clicks 'Safety' button] + E --> F[AI starts analysis] + F --> G[Show thinking steps] + G --> H{Analysis complete?} + H -->|Streaming| G + H -->|Done| I[Display Safety Report] + I --> J{User action} + J -->|Add to Watchlist| K[Open Watchlist modal] + J -->|Set Alert| L[Open Alert config] + J -->|Ask follow-up| M[Continue chat] + K --> N[Token added] + L --> O[Alert configured] +``` + +#### 1.3.2 Quick Capture Flow + +```mermaid +flowchart TD + A[User clicks Save Page] --> B{Logged in?} + B -->|No| C[Show login prompt] + B -->|Yes| D[Show Search Space selector] + C --> E[OAuth login] + E --> D + D --> F[User selects space] + F --> G[Capture page content] + G --> H[Extract metadata] + H --> I[Upload to backend] + I --> J{Success?} + J -->|Yes| K[Show success toast] + J -->|No| L[Show error + retry] + K --> M[Page saved to knowledge base] +``` + +--- + +## Part 2: Web Dashboard UX Improvements + +### 2.1 Current State Analysis + +**Strengths:** +- Clean chat interface with streaming responses +- Good document mention system (@mentions) +- Thinking steps visualization +- Real-time collaboration indicators + +**Areas for Improvement:** +- No crypto-specific features in dashboard +- Watchlist management only in extension +- Alert history not visible +- No portfolio integration + +### 2.2 Proposed Dashboard Enhancements + +#### 2.2.1 New Crypto Dashboard Tab + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [Alex β–Ό] [βš™οΈ] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ πŸ“Š Crypto Dashboard β”‚ +β”‚ πŸ’¬ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ Chat β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ πŸ“‹ β”‚ β”‚ Portfolio Value β”‚ β”‚ 24h P&L β”‚ β”‚ Active β”‚ β”‚ +β”‚ Watch β”‚ β”‚ $12,450.32 β”‚ β”‚ +$1,234.56 (+11%) β”‚ β”‚ Alerts: 5 β”‚ β”‚ +β”‚ list β”‚ β”‚ β–² +5.2% today β”‚ β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β”‚ β”‚ πŸ”΄ 2 urgent β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ πŸ”” β”‚ β”‚ +β”‚ Alerts β”‚ Watchlist [+ Add Token]β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ πŸ“ β”‚ β”‚ Token β”‚ Price β”‚ 24h % β”‚ Volume β”‚ Actions β”‚ β”‚ +β”‚ Docs β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ +β”‚ β”‚ β”‚ BULLA β”‚ $0.0000123 β”‚ +156.7% β”‚ $1.2M β”‚ [πŸ“Š][πŸ””][Γ—] β”‚ β”‚ +β”‚ βš™οΈ β”‚ β”‚ PEPE β”‚ $0.0000089 β”‚ -12.3% β”‚ $45M β”‚ [πŸ“Š][πŸ””][Γ—] β”‚ β”‚ +β”‚ Set β”‚ β”‚ WIF β”‚ $2.34 β”‚ +8.2% β”‚ $89M β”‚ [πŸ“Š][πŸ””][Γ—] β”‚ β”‚ +β”‚ tings β”‚ β”‚ BONK β”‚ $0.0000234 β”‚ +23.1% β”‚ $12M β”‚ [πŸ“Š][πŸ””][Γ—] β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ β”‚ +β”‚ β”‚ Recent Alerts [View All β†’] β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ β”‚ πŸ”΄ 2m ago β”‚ BULLA: Whale sold 5% of supply β”‚ β”‚ +β”‚ β”‚ β”‚ 🟑 15m ago β”‚ PEPE: Unusual volume spike (+340%) β”‚ β”‚ +β”‚ β”‚ β”‚ 🟒 1h ago β”‚ WIF: Price target reached ($2.30) β”‚ β”‚ +β”‚ β”‚ β”‚ πŸ”΄ 2h ago β”‚ NEW: Potential rug pull detected - $SCAM β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +#### 2.2.2 Enhanced Chat with Crypto Context + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ New Chat [GPT-4 Turbo β–Ό] [βš™οΈ] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ Good afternoon, Alex! β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask SurfSense or @mention docs β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ πŸ’‘ Crypto shortcuts: β”‚ β”‚ +β”‚ β”‚ β€’ Type $TOKEN to analyze (e.g., $BULLA) β”‚ β”‚ +β”‚ β”‚ β€’ Type /safety $TOKEN for quick safety check β”‚ β”‚ +β”‚ β”‚ β€’ Type /compare $TOKEN1 $TOKEN2 to compare β”‚ β”‚ +β”‚ β”‚ [πŸ“Ž][β†’]β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ πŸ“Š Market Overview (Live) β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ BTC: $67,234 β”‚ β”‚ ETH: $3,456 β”‚ β”‚ SOL: $178 β”‚ β”‚ +β”‚ β”‚ β–² +2.3% β”‚ β”‚ β–² +1.8% β”‚ β”‚ β–² +5.6% β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ πŸ”₯ Trending Tokens β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ 1. BULLA +156% β”‚ 2. MOCHI +89% β”‚ 3. POPCAT +67% β”‚ 4. BRETT +45% β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + + + + +--- + +## Part 3: Component Specifications + +### 3.1 Token Info Card Component + +```typescript +interface TokenInfoCardProps { + token: { + symbol: string; + name: string; + chain: "solana" | "ethereum" | "base" | "arbitrum"; + contractAddress: string; + price: number; + priceChange24h: number; + volume24h: number; + liquidity: number; + marketCap?: number; + }; + onQuickAction: (action: "safety" | "holders" | "predict" | "rug") => void; + onAddToWatchlist: () => void; + isInWatchlist: boolean; +} +``` + +**Visual States:** +- Default: Shows token info with quick action buttons +- Loading: Skeleton with shimmer animation +- Error: Error message with retry button +- Expanded: Shows additional metrics (FDV, holders count, age) + +**Interactions:** +- Click token name β†’ Copy contract address +- Click price β†’ Toggle USD/native currency +- Click chain badge β†’ Open block explorer +- Hover quick action β†’ Show tooltip with description + +### 3.2 Safety Score Component + +```typescript +interface SafetyScoreProps { + score: number; // 0-100 + level: "safe" | "caution" | "danger"; + factors: { + category: string; + status: "positive" | "warning" | "danger"; + description: string; + }[]; + sources: string[]; + timestamp: Date; +} +``` + +**Visual Design:** +``` +Score Display: +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸ›‘οΈ Safety Score β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ 🟑 65/100 β”‚ β”‚ +β”‚ β”‚ MEDIUM RISK β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 65% β”‚ +β”‚ β”‚ +β”‚ Last updated: 2 minutes ago β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + +Color Scale: +- 0-30: πŸ”΄ High Risk (red) +- 31-60: 🟑 Medium Risk (yellow) +- 61-80: 🟒 Low Risk (green) +- 81-100: βœ… Very Safe (bright green) +``` + +### 3.3 Alert Card Component + +```typescript +interface AlertCardProps { + id: string; + token: TokenInfo; + type: "price" | "volume" | "whale" | "liquidity" | "rugpull"; + condition: string; + triggeredAt?: Date; + status: "active" | "triggered" | "dismissed"; + priority: "low" | "medium" | "high" | "urgent"; + onDismiss: () => void; + onEdit: () => void; + onViewDetails: () => void; +} +``` + +**Priority Indicators:** +- 🟒 Low: Informational alerts +- 🟑 Medium: Notable changes +- 🟠 High: Significant events +- πŸ”΄ Urgent: Immediate attention needed + +### 3.4 Watchlist Table Component + +```typescript +interface WatchlistTableProps { + tokens: WatchlistToken[]; + sortBy: "name" | "price" | "change" | "volume" | "alerts"; + sortOrder: "asc" | "desc"; + onSort: (column: string) => void; + onTokenClick: (token: WatchlistToken) => void; + onRemove: (tokenId: string) => void; + onConfigureAlert: (tokenId: string) => void; +} + +interface WatchlistToken { + id: string; + symbol: string; + name: string; + chain: string; + price: number; + priceChange24h: number; + volume24h: number; + alertCount: number; + hasUrgentAlert: boolean; +} +``` + + + +--- + +## Part 4: Design Tokens + +### 4.1 Extended Color Palette for Crypto + +```css +/* Crypto-specific semantic colors */ +--crypto-bullish: #22C55E; /* Green for gains */ +--crypto-bearish: #EF4444; /* Red for losses */ +--crypto-neutral: #6B7280; /* Gray for no change */ + +/* Chain colors */ +--chain-solana: #9945FF; /* Solana purple */ +--chain-ethereum: #627EEA; /* Ethereum blue */ +--chain-base: #0052FF; /* Base blue */ +--chain-arbitrum: #28A0F0; /* Arbitrum blue */ +--chain-bsc: #F0B90B; /* BSC yellow */ + +/* Risk level colors */ +--risk-safe: #22C55E; /* Green */ +--risk-low: #84CC16; /* Lime */ +--risk-medium: #EAB308; /* Yellow */ +--risk-high: #F97316; /* Orange */ +--risk-danger: #EF4444; /* Red */ + +/* Alert priority colors */ +--alert-low: #6B7280; /* Gray */ +--alert-medium: #3B82F6; /* Blue */ +--alert-high: #F97316; /* Orange */ +--alert-urgent: #EF4444; /* Red */ +``` + +### 4.2 Animation Tokens + +```css +/* Durations */ +--duration-instant: 50ms; +--duration-fast: 150ms; +--duration-normal: 250ms; +--duration-slow: 400ms; +--duration-slower: 600ms; + +/* Easings */ +--ease-default: cubic-bezier(0.4, 0, 0.2, 1); +--ease-in: cubic-bezier(0.4, 0, 1, 1); +--ease-out: cubic-bezier(0, 0, 0.2, 1); +--ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55); + +/* Specific animations */ +--anim-fade-in: fade-in var(--duration-normal) var(--ease-out); +--anim-slide-up: slide-up var(--duration-normal) var(--ease-out); +--anim-pulse: pulse 2s var(--ease-default) infinite; +--anim-shimmer: shimmer 1.5s var(--ease-default) infinite; +``` + +### 4.3 Spacing for Extension + +```css +/* Extension-specific spacing (compact) */ +--ext-space-xs: 4px; +--ext-space-sm: 8px; +--ext-space-md: 12px; +--ext-space-lg: 16px; +--ext-space-xl: 20px; + +/* Component heights */ +--ext-header-height: 56px; +--ext-input-height: 48px; +--ext-button-height: 36px; +--ext-card-padding: 12px; +--ext-quick-capture-height: 48px; +``` + +--- + +## Part 5: Interaction Patterns + +### 5.1 Token Detection & Context + +**Trigger:** User navigates to supported site (DexScreener, CoinGecko, Birdeye) + +**Behavior:** +1. Extension detects URL pattern +2. Extract token contract address from URL/page +3. Fetch token data from DexScreener API +4. Display Token Info Card with 200ms fade-in +5. Pre-populate chat context with token info + +**Edge Cases:** +- Invalid contract address β†’ Show "Token not found" state +- API timeout β†’ Show cached data with "Last updated X ago" +- Multiple tokens on page β†’ Show selector dropdown + +### 5.2 Streaming Response Pattern + +**Behavior:** +1. User sends message +2. Show "Thinking..." indicator immediately +3. Display thinking steps as they arrive +4. Stream final response text +5. Render tool UIs (charts, tables) after text complete +6. Show action buttons (Copy, Regenerate, Add to Watchlist) + +**Timing:** +- Thinking indicator: Show within 100ms +- First thinking step: Target <500ms +- First response token: Target <1s +- Tool UI render: After response complete + +### 5.3 Alert Notification Pattern + +**In-Extension:** +1. Alert triggers on backend +2. WebSocket pushes to extension +3. Show toast notification (top-right, 5s duration) +4. Badge count updates on extension icon +5. Alert card appears in Alerts panel + +**Browser Notification:** +1. Check notification permission +2. If granted, show system notification +3. Click notification β†’ Open extension side panel +4. Focus on relevant alert + + + +--- + +## Part 6: Accessibility Specifications + +### 6.1 Keyboard Navigation Map + +``` +Extension Side Panel: +Tab Order: +1. Search Space Selector +2. Settings Button +3. User Menu +4. Token Info Card (if visible) + - Quick Action buttons (left to right) +5. Chat Messages (scrollable region) +6. Chat Input +7. Attachment Button +8. Send Button +9. Quick Capture Button + +Shortcuts: +- Cmd/Ctrl + K: Focus chat input +- Cmd/Ctrl + S: Quick capture page +- Cmd/Ctrl + W: Toggle watchlist panel +- Escape: Close modals, clear input +- Enter: Send message (in input) +- Shift + Enter: New line (in input) +``` + +### 6.2 Screen Reader Announcements + +```typescript +// ARIA live regions for dynamic content +const ariaAnnouncements = { + tokenDetected: "Token detected: {symbol} on {chain}", + safetyScore: "Safety score: {score} out of 100, {level} risk", + alertTriggered: "Alert: {type} for {token}. {description}", + messageSent: "Message sent", + responseStarted: "AI is thinking", + responseComplete: "AI response complete", + pageSaved: "Page saved to {searchSpace}", +}; +``` + +### 6.3 Color Contrast Requirements + +| Element | Foreground | Background | Ratio | Status | +|---------|------------|------------|-------|--------| +| Body text | #E5E5E5 | #121212 | 13.5:1 | βœ… Pass | +| Muted text | #A3A3A3 | #121212 | 7.5:1 | βœ… Pass | +| Primary button | #FFFFFF | #2563EB | 8.6:1 | βœ… Pass | +| Success text | #22C55E | #121212 | 6.2:1 | βœ… Pass | +| Error text | #EF4444 | #121212 | 5.4:1 | βœ… Pass | +| Warning text | #EAB308 | #121212 | 8.1:1 | βœ… Pass | + +--- + +## Part 7: Implementation Checklist + +### 7.1 Browser Extension Components + +- [ ] **TokenInfoCard** - Display token data from page context +- [ ] **SafetyScoreDisplay** - Visual safety score with factors +- [ ] **QuickActionButtons** - Safety, Holders, Predict, Rug Check +- [ ] **WatchlistPanel** - List of watched tokens with alerts +- [ ] **AlertConfigModal** - Configure alert conditions +- [ ] **AlertNotificationToast** - In-app alert notifications +- [ ] **ChatInterface** - Main chat with streaming support +- [ ] **ThinkingStepsDisplay** - Show AI reasoning process +- [ ] **QuickCaptureButton** - Save page to knowledge base +- [ ] **SearchSpaceSelector** - Switch between search spaces +- [ ] **SettingsDropdown** - Quick settings access + +### 7.2 Web Dashboard Components + +- [ ] **CryptoDashboard** - New dashboard tab for crypto +- [ ] **PortfolioSummary** - Portfolio value and P&L +- [ ] **WatchlistTable** - Full watchlist management +- [ ] **AlertsPanel** - Alert history and management +- [ ] **MarketOverview** - BTC, ETH, SOL prices +- [ ] **TrendingTokens** - Hot tokens carousel +- [ ] **EnhancedChatInput** - With $TOKEN and /command support +- [ ] **TokenComparisonView** - Side-by-side token comparison + +### 7.3 Shared Components + +- [ ] **TokenBadge** - Compact token display with chain icon +- [ ] **PriceDisplay** - Price with change indicator +- [ ] **ChainIcon** - Chain-specific icons +- [ ] **RiskBadge** - Risk level indicator +- [ ] **AlertBadge** - Alert priority indicator +- [ ] **LoadingSkeleton** - Consistent loading states +- [ ] **ErrorState** - Consistent error displays + + + +--- + +## Appendix A: API Integration Points + +### DexScreener API +- `GET /tokens/{chain}/{address}` - Token info +- `GET /pairs/{chain}/{pairAddress}` - Pair info +- WebSocket for real-time price updates + +### DefiLlama API +- `GET /tvl/{protocol}` - Protocol TVL +- `GET /yields/pools` - Yield opportunities + +### Backend API (New Endpoints) +- `POST /api/v1/watchlist` - Add to watchlist +- `DELETE /api/v1/watchlist/{id}` - Remove from watchlist +- `POST /api/v1/alerts` - Create alert +- `GET /api/v1/alerts` - List alerts +- `POST /api/v1/safety-check` - Run safety analysis + +--- + +## Appendix B: Success Metrics + +| Metric | Target | Measurement | +|--------|--------|-------------| +| Token detection time | <1s | Time from page load to card display | +| Safety check response | <3s | Time from click to first result | +| Quick capture time | <5s | Time from click to success toast | +| Alert delivery time | <10s | Time from trigger to notification | +| Extension load time | <500ms | Time to interactive state | +| Chat response start | <2s | Time to first streaming token | + +--- + +## Appendix C: Rug Pull Detection Criteria + +### Red Flags (Automatic Detection) + +| Signal | Weight | Description | +|--------|--------|-------------| +| No LP Lock | Critical | Liquidity not locked in contract | +| Mint Authority | Critical | Owner can create unlimited tokens | +| Honeypot Contract | Critical | Users cannot sell tokens | +| High Tax | High | >10% buy/sell tax | +| Top 10 Holders >50% | High | Concentration risk | +| Token Age <24h | Medium | Very new token | +| No Social Presence | Medium | No Twitter/Telegram | +| Similar to Known Scam | High | Contract code matches known rugs | + +### Safety Score Calculation + +``` +Score = 100 - (Critical Γ— 40) - (High Γ— 20) - (Medium Γ— 10) + +Examples: +- No issues: 100 (Very Safe) +- 1 Medium issue: 90 (Safe) +- 1 High issue: 80 (Low Risk) +- 2 High issues: 60 (Medium Risk) +- 1 Critical issue: 60 (Medium Risk) +- 1 Critical + 1 High: 40 (High Risk) +- 2 Critical issues: 20 (Danger) +``` + +--- + +## Appendix D: Responsive Breakpoints + +### Extension Side Panel + +| Screen Width | Panel Width | Layout | +|--------------|-------------|--------| +| < 1280px | 300px | Compact | +| 1280-1920px | 400px | Default | +| > 1920px | 500px | Expanded | + +### Web Dashboard + +| Breakpoint | Name | Layout Changes | +|------------|------|----------------| +| < 640px | Mobile | Single column, bottom nav | +| 640-1024px | Tablet | Collapsible sidebar | +| 1024-1440px | Desktop | Full sidebar | +| > 1440px | Wide | Extended content area | + +--- + +**Document Status:** βœ… COMPLETE +**Last Updated:** 2026-02-02 +**Next Review:** 2026-02-09 +**Approved By:** UX Designer diff --git a/_bmad-output/ux-design/conversational-ux-specification.md b/_bmad-output/ux-design/conversational-ux-specification.md new file mode 100644 index 000000000..b7d10ac07 --- /dev/null +++ b/_bmad-output/ux-design/conversational-ux-specification.md @@ -0,0 +1,1237 @@ +# SurfSense 2.0 - Conversational AI Crypto Advisor UX Specification + +**Version:** 3.0 +**Date:** 2026-02-02 +**Status:** βœ… COMPLETE +**Owner:** Sally (UX Designer) + +--- + +## Executive Summary + +### The Problem + +The current SurfSense 2.0 design treats crypto features as **isolated UI components** (Crypto Dashboard, Watchlist, Alerts, Portfolio) that don't work together as an integrated AI assistant. Users must navigate between screens and manually configure each feature. + +### The Vision + +SurfSense should function as a **true crypto advisory AI assistant** where: + +1. **Conversation is the primary interface** - Users interact through natural language +2. **AI proactively helps** - Not just responding, but anticipating needs +3. **All features are tools** - Watchlist, alerts, portfolio are AI-callable tools, not separate UIs +4. **Personalization is automatic** - AI learns user's risk profile and investment style + +### Core Design Principles + +| Principle | Description | +|-----------|-------------| +| **Conversation-First** | Chat is the primary interface; UI components are secondary | +| **Tool-Augmented AI** | AI calls tools (DexScreener, safety check) to gather data | +| **Context-Aware** | AI uses portfolio, watchlist, chat history to personalize | +| **Action-Oriented** | AI can execute actions (add to watchlist, set alert) | +| **Proactive Intelligence** | AI monitors and alerts without being asked | + +--- + +## Part 1: Conversational Flow Diagrams + +### 1.1 Token Research Flow + +**User Goal:** Research a token and decide whether to invest + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ TOKEN RESEARCH CONVERSATION β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ USER: "I want to research BULLA token on Solana" β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ”§ AI TOOL CALLS (Parallel) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ [1] DexScreener API β†’ Fetch price, volume, liquidity, holders β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ [2] Safety Analysis β†’ Check LP lock, mint authority, honeypot β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ [3] On-chain Metrics β†’ Whale activity, holder distribution β”‚ β”‚ +β”‚ β”‚ └── [4] User Context β†’ Check portfolio, watchlist, risk profile β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ AI: "Here's my analysis of BULLA/SOL: β”‚ +β”‚ β”‚ +β”‚ πŸ“Š **Market Data** β”‚ +β”‚ Price: $0.00001234 (+156% 24h) β”‚ +β”‚ Volume: $1.2M | Liquidity: $450K | MCap: $2.1M β”‚ +β”‚ β”‚ +β”‚ πŸ›‘οΈ **Safety Score: 65/100 (Medium Risk)** β”‚ +β”‚ βœ… LP locked for 6 months β”‚ +β”‚ βœ… Contract verified on Solscan β”‚ +β”‚ ⚠️ Top 10 holders own 45% of supply β”‚ +β”‚ ⚠️ Token is only 3 days old β”‚ +β”‚ β”‚ +β”‚ πŸ‹ **Whale Activity** β”‚ +β”‚ β€’ 2 large buys ($50K+) in last hour β”‚ +β”‚ β€’ No significant sells detected β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ **Personalized Recommendation** β”‚ +β”‚ Based on your moderate risk profile and current portfolio β”‚ +β”‚ (70% stablecoins), this could be a small speculative position. β”‚ +β”‚ Suggested allocation: 2-5% of portfolio. β”‚ +β”‚ β”‚ +β”‚ Would you like me to: β”‚ +β”‚ [Add to Watchlist] [Set Price Alert] [Analyze Further]" β”‚ +β”‚ β”‚ +β”‚ USER: "Yes, add it to my watchlist" β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ”§ AI ACTION: add_to_watchlist(token="BULLA", chain="solana") β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ AI: "Done! I've added BULLA to your watchlist. βœ… β”‚ +β”‚ β”‚ +β”‚ I've also set up default monitoring: β”‚ +β”‚ β€’ Price alert if it moves Β±20% β”‚ +β”‚ β€’ Safety alert if liquidity drops >10% β”‚ +β”‚ β€’ Whale alert for transactions >$10K β”‚ +β”‚ β”‚ +β”‚ Want me to customize these alerts?" β”‚ +β”‚ β”‚ +β”‚ USER: "Alert me if it pumps 50% or if whales start selling" β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ”§ AI ACTIONS: β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ set_alert(type="price_above", threshold="+50%") β”‚ β”‚ +β”‚ β”‚ └── set_alert(type="whale_sell", threshold="$10K") β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ AI: "Perfect! I've configured: β”‚ +β”‚ πŸ”” Price alert: Notify when BULLA increases 50% β”‚ +β”‚ πŸ‹ Whale alert: Notify on sell transactions >$10K β”‚ +β”‚ β”‚ +β”‚ I'll keep monitoring and let you know if anything changes." β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 1.2 Proactive Alert Flow + +**AI Goal:** Monitor watchlist and alert user about important events + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ PROACTIVE ALERT CONVERSATION β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ [Background: AI monitoring detects significant event] β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ”” BROWSER NOTIFICATION β”‚ β”‚ +β”‚ β”‚ "🚨 BULLA Alert: Price increased 52% - Based on your risk profile, β”‚ β”‚ +β”‚ β”‚ you might want to take partial profits" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ [User opens SurfSense] β”‚ +β”‚ β”‚ +β”‚ AI: "🚨 **BULLA Alert Triggered** β”‚ +β”‚ β”‚ +β”‚ Your BULLA position is up 52% since you added it to watchlist. β”‚ +β”‚ β”‚ +β”‚ πŸ“Š Current Status: β”‚ +β”‚ β€’ Entry: $0.00001234 β†’ Now: $0.00001876 β”‚ +β”‚ β€’ Volume: 3x average (unusual activity) β”‚ +β”‚ β€’ Whale activity: 2 large sells detected ($25K, $18K) β”‚ +β”‚ β”‚ +β”‚ ⚠️ **Risk Assessment** β”‚ +β”‚ The recent whale sells combined with the rapid price increase β”‚ +β”‚ suggests potential profit-taking. Based on your moderate risk β”‚ +β”‚ profile, I recommend: β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ **Suggested Action** β”‚ +β”‚ Consider taking 50% profits to secure gains while keeping β”‚ +β”‚ exposure for further upside. β”‚ +β”‚ β”‚ +β”‚ [Take Profits Guide] [Keep Watching] [Remove from Watchlist]" β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 1.3 Portfolio Analysis Flow + +**User Goal:** Understand portfolio performance and get recommendations + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ PORTFOLIO ANALYSIS CONVERSATION β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ USER: "How's my portfolio doing?" β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ”§ AI TOOL CALLS β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ [1] get_portfolio() β†’ Fetch all holdings β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ [2] get_prices(tokens) β†’ Current prices for all tokens β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ [3] get_user_profile() β†’ Risk tolerance, goals β”‚ β”‚ +β”‚ β”‚ └── [4] analyze_performance() β†’ P&L, allocation analysis β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ AI: "πŸ“Š **Portfolio Summary** β”‚ +β”‚ β”‚ +β”‚ Total Value: $15,234 (+29.34% all-time) β”‚ +β”‚ 24h Change: +$1,245 (+8.9%) β”‚ +β”‚ β”‚ +β”‚ πŸ† **Top Performers** β”‚ +β”‚ 1. BULLA: +156% ($2,340) β”‚ +β”‚ 2. BONK: +45% ($1,890) β”‚ +β”‚ 3. WIF: +23% ($3,450) β”‚ +β”‚ β”‚ +β”‚ πŸ“‰ **Underperformers** β”‚ +β”‚ 1. DEGEN: -15% ($890) β”‚ +β”‚ β”‚ +β”‚ βš–οΈ **Allocation Analysis** β”‚ +β”‚ Your portfolio is 85% memecoins, 15% stablecoins. β”‚ +β”‚ This is higher risk than your stated 'moderate' profile. β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ **Recommendations** β”‚ +β”‚ 1. Consider taking profits on BULLA (up 156%) β”‚ +β”‚ 2. DEGEN has weak fundamentals - consider cutting losses β”‚ +β”‚ 3. Increase stablecoin allocation to 30% for balance β”‚ +β”‚ β”‚ +β”‚ Want me to elaborate on any of these?" β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 1.4 Quick Command Flow + +**User Goal:** Execute quick actions via natural language + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ QUICK COMMAND EXAMPLES β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ USER: "What's hot on Solana right now?" β”‚ +β”‚ AI: [Calls get_trending_tokens(chain="solana")] β”‚ +β”‚ "Here are the top trending Solana tokens in the last hour..." β”‚ +β”‚ β”‚ +β”‚ ───────────────────────────────────────────────────────────────────────── β”‚ +β”‚ β”‚ +β”‚ USER: "Remove DEGEN from my watchlist" β”‚ +β”‚ AI: [Calls remove_from_watchlist(token="DEGEN")] β”‚ +β”‚ "Done! DEGEN has been removed from your watchlist." β”‚ +β”‚ β”‚ +β”‚ ───────────────────────────────────────────────────────────────────────── β”‚ +β”‚ β”‚ +β”‚ USER: "Show me tokens with unusual volume" β”‚ +β”‚ AI: [Calls detect_volume_anomalies()] β”‚ +β”‚ "I found 3 tokens with unusual volume spikes..." β”‚ +β”‚ β”‚ +β”‚ ───────────────────────────────────────────────────────────────────────── β”‚ +β”‚ β”‚ +β”‚ USER: "Is 0x7xKX...3nPq safe?" β”‚ +β”‚ AI: [Calls safety_check(contract="0x7xKX...3nPq")] β”‚ +β”‚ "Let me analyze this contract... Safety Score: 45/100 (High Risk)" β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +## Part 2: Tool Calling Architecture + +### 2.1 Tool Categories + +The AI assistant has access to the following tool categories: + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ AI TOOL ARCHITECTURE β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ“Š DATA RETRIEVAL TOOLS β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_token_info(token, chain) β†’ Price, volume, liquidity β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_token_holders(token, chain) β†’ Holder distribution β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_trending_tokens(chain, limit) β†’ Hot tokens β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_whale_activity(token, chain) β†’ Large transactions β”‚ β”‚ +β”‚ β”‚ └── get_market_overview() β†’ BTC, ETH, SOL prices β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ›‘οΈ ANALYSIS TOOLS β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ safety_check(contract, chain) β†’ Rug pull risk analysis β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ analyze_holders(token, chain) β†’ Concentration risk β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ detect_anomalies(token, chain) β†’ Unusual patterns β”‚ β”‚ +β”‚ β”‚ └── predict_trend(token, chain) β†’ AI price prediction β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ“‹ PORTFOLIO TOOLS β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_portfolio() β†’ User's holdings β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_watchlist() β†’ Watched tokens β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ get_alerts() β†’ Active alerts β”‚ β”‚ +β”‚ β”‚ └── get_user_profile() β†’ Risk profile, preferences β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ ⚑ ACTION TOOLS β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ add_to_watchlist(token, chain) β†’ Add token to watchlist β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ remove_from_watchlist(token) β†’ Remove from watchlist β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ set_alert(type, token, config) β†’ Create price/whale alert β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ delete_alert(alert_id) β†’ Remove alert β”‚ β”‚ +β”‚ β”‚ └── update_user_profile(preferences) β†’ Update risk profile β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 2.2 Tool Definitions (OpenAI Function Calling Format) + +```typescript +// Tool: get_token_info +{ + name: "get_token_info", + description: "Fetch real-time token data from DexScreener including price, volume, liquidity, and market cap", + parameters: { + type: "object", + properties: { + token: { + type: "string", + description: "Token symbol (e.g., 'BULLA') or contract address" + }, + chain: { + type: "string", + enum: ["solana", "ethereum", "base", "arbitrum", "polygon", "bsc"], + description: "Blockchain network" + } + }, + required: ["token", "chain"] + } +} + +// Tool: safety_check +{ + name: "safety_check", + description: "Analyze a token contract for rug pull risks, honeypot detection, and safety score", + parameters: { + type: "object", + properties: { + contract: { + type: "string", + description: "Contract address to analyze" + }, + chain: { + type: "string", + enum: ["solana", "ethereum", "base", "arbitrum", "polygon", "bsc"] + } + }, + required: ["contract", "chain"] + } +} + +// Tool: add_to_watchlist +{ + name: "add_to_watchlist", + description: "Add a token to the user's watchlist for monitoring", + parameters: { + type: "object", + properties: { + token: { type: "string", description: "Token symbol or contract" }, + chain: { type: "string" }, + set_default_alerts: { + type: "boolean", + default: true, + description: "Whether to set up default price and safety alerts" + } + }, + required: ["token", "chain"] + } +} + +// Tool: set_alert +{ + name: "set_alert", + description: "Create a price, volume, whale, or safety alert for a token", + parameters: { + type: "object", + properties: { + token: { type: "string" }, + chain: { type: "string" }, + alert_type: { + type: "string", + enum: ["price_above", "price_below", "price_change", "volume_spike", + "whale_buy", "whale_sell", "liquidity_change", "safety_drop"] + }, + threshold: { type: "string", description: "e.g., '+50%', '$10000', '10%'" }, + notification_channels: { + type: "array", + items: { type: "string", enum: ["browser", "email", "telegram"] }, + default: ["browser"] + } + }, + required: ["token", "chain", "alert_type", "threshold"] + } +} +``` + + +--- + +## Part 3: Context Management System + +### 3.1 Context Layers + +The AI maintains multiple layers of context to personalize responses: + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ CONTEXT MANAGEMENT LAYERS β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ LAYER 1: IMMEDIATE CONTEXT (Current Session) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Current page context (DexScreener token being viewed) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Current conversation thread β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Recently mentioned tokens β”‚ β”‚ +β”‚ β”‚ └── User's current intent/goal β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ LAYER 2: USER PROFILE (Persistent) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Risk tolerance: Conservative / Moderate / Aggressive β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Investment style: Day trader / Swing / Long-term β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Preferred chains: Solana, Base, Ethereum β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Portfolio size range: Small (<$1K) / Medium / Large (>$100K) β”‚ β”‚ +β”‚ β”‚ └── Notification preferences β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ LAYER 3: PORTFOLIO CONTEXT (Real-time) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Current holdings (tokens, amounts, entry prices) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Watchlist tokens β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Active alerts β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ P&L history β”‚ β”‚ +β”‚ β”‚ └── Past trades (wins/losses patterns) β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ LAYER 4: BEHAVIORAL CONTEXT (Learned) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Tokens user typically researches β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Alert response patterns (acts on alerts? ignores?) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Risk decisions history β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Preferred analysis depth (quick vs detailed) β”‚ β”‚ +β”‚ β”‚ └── Active hours (when user is typically online) β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 3.2 Context Injection into Prompts + +```typescript +// System prompt template with context injection +const systemPrompt = ` +You are SurfSense, an AI crypto advisor assistant. + +## User Profile +- Risk Tolerance: ${userProfile.riskTolerance} +- Investment Style: ${userProfile.investmentStyle} +- Preferred Chains: ${userProfile.preferredChains.join(", ")} +- Portfolio Size: ${userProfile.portfolioSizeRange} + +## Current Portfolio +${portfolio.holdings.map(h => `- ${h.token}: ${h.amount} ($${h.value})`).join("\n")} +Total Value: $${portfolio.totalValue} + +## Watchlist +${watchlist.map(w => `- ${w.token} (${w.chain}): $${w.price} ${w.change24h}`).join("\n")} + +## Active Alerts +${alerts.map(a => `- ${a.token}: ${a.type} at ${a.threshold}`).join("\n")} + +## Current Page Context +${pageContext ? `User is viewing: ${pageContext.token} on ${pageContext.chain}` : "No specific page context"} + +## Behavioral Insights +- User typically ${behaviorInsights.riskPattern} +- Prefers ${behaviorInsights.analysisDepth} analysis +- Usually active during ${behaviorInsights.activeHours} + +## Instructions +1. Always consider user's risk profile when making recommendations +2. Reference their portfolio when relevant +3. Be proactive about potential risks +4. Suggest actions (add to watchlist, set alert) when appropriate +5. Use their preferred chains as default when searching +`; +``` + +### 3.3 Personalization Examples + +| User Profile | AI Response Adaptation | +|--------------|------------------------| +| **Conservative + Small Portfolio** | "This token is high risk. Given your conservative profile and portfolio size, I'd recommend watching from the sidelines or allocating max 1%." | +| **Aggressive + Large Portfolio** | "This looks like a high-risk, high-reward play. With your risk tolerance, you could consider a 5-10% allocation with tight stop-losses." | +| **Day Trader** | Focus on short-term signals, volume patterns, entry/exit points | +| **Long-term Holder** | Focus on fundamentals, team, roadmap, long-term potential | + +--- + +## Part 4: Action Execution Patterns + +### 4.1 Action Types + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ ACTION EXECUTION TYPES β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ TYPE 1: IMMEDIATE ACTIONS (Auto-execute) β”‚ β”‚ +β”‚ β”‚ Actions that are safe to execute immediately without confirmation β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β€’ Add to watchlist β”‚ β”‚ +β”‚ β”‚ β€’ Remove from watchlist β”‚ β”‚ +β”‚ β”‚ β€’ Set/modify alerts β”‚ β”‚ +β”‚ β”‚ β€’ Update preferences β”‚ β”‚ +β”‚ β”‚ β€’ Save page to knowledge base β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Example: β”‚ β”‚ +β”‚ β”‚ User: "Add BULLA to my watchlist" β”‚ β”‚ +β”‚ β”‚ AI: [Executes immediately] "Done! BULLA added to watchlist. βœ…" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ TYPE 2: CONFIRMATION ACTIONS (Require user confirmation) β”‚ β”‚ +β”‚ β”‚ Actions that have significant impact and need explicit approval β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β€’ Delete all alerts for a token β”‚ β”‚ +β”‚ β”‚ β€’ Clear watchlist β”‚ β”‚ +β”‚ β”‚ β€’ Change risk profile β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Example: β”‚ β”‚ +β”‚ β”‚ User: "Clear my watchlist" β”‚ β”‚ +β”‚ β”‚ AI: "You have 15 tokens in your watchlist. Are you sure you want β”‚ β”‚ +β”‚ β”‚ to remove all of them? [Yes, clear all] [Cancel]" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ TYPE 3: ADVISORY ACTIONS (AI suggests, user decides) β”‚ β”‚ +β”‚ β”‚ Financial decisions that AI should NEVER auto-execute β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β€’ Buy/Sell recommendations β”‚ β”‚ +β”‚ β”‚ β€’ Take profit suggestions β”‚ β”‚ +β”‚ β”‚ β€’ Cut loss recommendations β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Example: β”‚ β”‚ +β”‚ β”‚ User: "Should I sell my BULLA?" β”‚ β”‚ +β”‚ β”‚ AI: "Based on the 156% gain and recent whale sells, taking partial β”‚ β”‚ +β”‚ β”‚ profits could be wise. However, this is your decision. β”‚ β”‚ +β”‚ β”‚ Here's a guide on how to sell on Raydium: [Link]" β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ ⚠️ AI NEVER executes trades or moves funds β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 4.2 Action Execution Flow + +```mermaid +flowchart TD + A[User Request] --> B{Parse Intent} + B --> C{Action Type?} + + C -->|Immediate| D[Execute Action] + D --> E[Return Success Message] + E --> F[Suggest Follow-up Actions] + + C -->|Confirmation| G[Show Confirmation Dialog] + G --> H{User Confirms?} + H -->|Yes| D + H -->|No| I[Cancel & Acknowledge] + + C -->|Advisory| J[Provide Analysis] + J --> K[Give Recommendation] + K --> L[Provide Resources/Links] + L --> M[Let User Decide] +``` + +### 4.3 Smart Follow-up Suggestions + +After executing an action, AI proactively suggests related actions: + +| Action Completed | Follow-up Suggestions | +|------------------|----------------------| +| Added to watchlist | "Want me to set up price alerts?" | +| Set price alert | "Should I also monitor whale activity?" | +| Safety check (risky) | "I'd recommend NOT adding this to watchlist. Want me to find safer alternatives?" | +| Safety check (safe) | "This looks good! Add to watchlist?" | +| Portfolio analysis | "Want me to set alerts for your underperformers?" | + +--- + +## Part 5: Proactive Monitoring Design + +### 5.1 Background Monitoring Architecture + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ PROACTIVE MONITORING SYSTEM β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ BACKEND MONITORING SERVICE (Always Running) β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ Price β”‚ β”‚ Whale β”‚ β”‚ Safety β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ Monitor β”‚ β”‚ Monitor β”‚ β”‚ Monitor β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ (30s poll) β”‚ β”‚ (1m poll) β”‚ β”‚ (5m poll) β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ ↓ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ Alert Evaluator β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ (Check triggers)β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ ↓ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ Context Engine β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ (Add user ctx) β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ ↓ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ AI Personalizer β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ (Generate msg) β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ ↓ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ Notification β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ Dispatcher β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ NOTIFICATION CHANNELS β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ Browser β”‚ β”‚ Email β”‚ β”‚ Telegram β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ Push β”‚ β”‚ Digest β”‚ β”‚ Bot β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 5.2 Alert Types & Triggers + +| Alert Type | Trigger Condition | AI Enhancement | +|------------|-------------------|----------------| +| **Price Alert** | Price crosses threshold | "BULLA hit your $0.00002 target. Based on momentum, it might go higher. Consider trailing stop?" | +| **Volume Spike** | Volume > 3x average | "Unusual volume on BULLA. Checking whale activity... 2 large buys detected. Could be accumulation." | +| **Whale Alert** | Transaction > $10K | "Whale sold $50K BULLA. This is 5% of liquidity. Consider your position." | +| **Safety Alert** | Risk score drops | "⚠️ BULLA safety score dropped from 72 to 45. LP unlock detected. Recommend caution." | +| **Liquidity Alert** | Liquidity change > 10% | "Liquidity on BULLA decreased 15%. This increases slippage risk." | + +### 5.3 Smart Notification Batching + +To avoid notification fatigue, AI batches and prioritizes alerts: + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ NOTIFICATION BATCHING LOGIC β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ Priority Levels: β”‚ +β”‚ πŸ”΄ CRITICAL: Immediate push (rug pull warning, massive price drop) β”‚ +β”‚ 🟠 HIGH: Push within 1 minute (price target hit, whale activity) β”‚ +β”‚ 🟑 MEDIUM: Batch every 15 minutes (volume spikes, minor alerts) β”‚ +β”‚ 🟒 LOW: Daily digest (market overview, portfolio summary) β”‚ +β”‚ β”‚ +β”‚ Batching Example: β”‚ +β”‚ ───────────────────────────────────────────────────────────────────────── β”‚ +β”‚ Instead of 5 separate notifications: β”‚ +β”‚ β€’ BULLA +10% β”‚ +β”‚ β€’ BONK +5% β”‚ +β”‚ β€’ PEPE -3% β”‚ +β”‚ β€’ WIF +8% β”‚ +β”‚ β€’ DEGEN -2% β”‚ +β”‚ β”‚ +β”‚ AI sends 1 batched notification: β”‚ +β”‚ "πŸ“Š Watchlist Update: 3 tokens up, 2 down. BULLA leading (+10%). β”‚ +β”‚ Your portfolio is +$234 (+2.1%) in the last hour." β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + + +--- + +## Part 6: Integrated Chat Wireframes + +### 6.1 Main Chat Interface with Embedded Crypto Widgets + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🧠 SurfSense [Search Space β–Ό] [βš™οΈ] [πŸ‘€] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ“ PAGE CONTEXT BAR (Auto-detected) β”‚ β”‚ +β”‚ β”‚ You're viewing: BULLA/SOL on DexScreener β”‚ β”‚ +β”‚ β”‚ $0.00001234 (+156%) | Vol: $1.2M | Liq: $450K β”‚ β”‚ +β”‚ β”‚ [Analyze] [Add to Watchlist] [Set Alert] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ’¬ CONVERSATION β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ 🧠 AI: Good morning! I noticed you're looking at BULLA. β”‚ β”‚ +β”‚ β”‚ Here's what I found: β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ πŸ“Š BULLA/SOL Analysis β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ Price: $0.00001234 β”‚ 24h: +156% β”‚ MCap: $2.1M β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ Volume: $1.2M β”‚ Liq: $450K β”‚ Age: 3 days β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ πŸ›‘οΈ Safety: 65/100 (Medium Risk) β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ βœ… LP locked ⚠️ Top 10 own 45% ⚠️ Very new β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ [βž• Add to Watchlist] [πŸ”” Set Alert] [πŸ“Š Full Analysis] β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Based on your moderate risk profile, this could be a small β”‚ β”‚ +β”‚ β”‚ speculative position (2-5% of portfolio). β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ πŸ‘€ You: Add it to my watchlist and alert me at +50% β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ 🧠 AI: Done! βœ… β”‚ β”‚ +β”‚ β”‚ β€’ Added BULLA to watchlist β”‚ β”‚ +β”‚ β”‚ β€’ Set price alert at +50% ($0.00001851) β”‚ β”‚ +β”‚ β”‚ β€’ Also set safety alert (liquidity drop >10%) β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ βœ… Actions Completed β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ β€’ BULLA added to watchlist β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ β€’ Price alert: +50% ($0.00001851) β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ β€’ Safety alert: Liquidity drop >10% β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ [View Watchlist] [Edit Alerts] β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ’‘ SUGGESTIONS β”‚ β”‚ +β”‚ β”‚ [What's trending on Solana?] [Check my portfolio] [Show watchlist] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ [πŸ“Ž] Type a message... [Send ➀] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 6.2 Proactive Alert in Chat + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸ’¬ CONVERSATION (with proactive alert) β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ πŸ”” NEW ALERT β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ 🚨 BULLA ALERT TRIGGERED β”‚ β”‚ +β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ +β”‚ β”‚ Your +50% price target was hit! β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Entry: $0.00001234 β†’ Now: $0.00001876 (+52%) β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ ⚠️ Risk Assessment: β”‚ β”‚ +β”‚ β”‚ β€’ 2 whale sells detected ($25K, $18K) β”‚ β”‚ +β”‚ β”‚ β€’ Volume 3x average (unusual activity) β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ πŸ’‘ Recommendation: Consider taking 50% profits β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ [Take Profits Guide] [Keep Watching] [Dismiss] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ πŸ‘€ You: What do you think I should do? β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Based on your moderate risk profile and the whale activity, β”‚ +β”‚ I'd suggest taking partial profits (50%) to secure gains while β”‚ +β”‚ keeping exposure for further upside. β”‚ +β”‚ β”‚ +β”‚ Here's a quick guide to sell on Raydium: β”‚ +β”‚ 1. Go to raydium.io/swap β”‚ +β”‚ 2. Connect your wallet β”‚ +β”‚ 3. Select BULLA β†’ SOL β”‚ +β”‚ 4. Enter amount (50% of your holdings) β”‚ +β”‚ β”‚ +β”‚ ⚠️ Remember: This is not financial advice. The decision is yours. β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 6.3 Inline Watchlist View + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸ’¬ CONVERSATION β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ πŸ‘€ You: Show my watchlist β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Here's your watchlist (5 tokens): β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ“‹ YOUR WATCHLIST β”‚ β”‚ +β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ 🟒 BULLA $0.00001876 +52.0% πŸ›‘οΈ 65 [Analyze] [Remove] β”‚ β”‚ +β”‚ β”‚ 🟒 BONK $0.00002156 +12.3% πŸ›‘οΈ 89 [Analyze] [Remove] β”‚ β”‚ +β”‚ β”‚ 🟒 PEPE $0.00001089 +8.7% πŸ›‘οΈ 85 [Analyze] [Remove] β”‚ β”‚ +β”‚ β”‚ πŸ”΄ WIF $2.45 -5.2% πŸ›‘οΈ 94 [Analyze] [Remove] β”‚ β”‚ +β”‚ β”‚ πŸ”΄ DEGEN $0.0156 -15.3% πŸ›‘οΈ 78 [Analyze] [Remove] β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ +β”‚ β”‚ Total Watchlist Value: $4,567 (+8.2% today) β”‚ β”‚ +β”‚ β”‚ [Add Token] [Manage Alerts] [Export] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ πŸ“Š Summary: 3 tokens up, 2 down. BULLA is your top performer. β”‚ +β”‚ ⚠️ DEGEN is down 15% - want me to analyze why? β”‚ +β”‚ β”‚ +β”‚ πŸ‘€ You: Yes, what's happening with DEGEN? β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Let me check DEGEN... β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ” DEGEN ANALYSIS β”‚ β”‚ +β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚ +β”‚ β”‚ Price: $0.0156 (-15.3% 24h) β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ πŸ“‰ Why it's dropping: β”‚ β”‚ +β”‚ β”‚ β€’ Large whale sold $120K (3% of liquidity) β”‚ β”‚ +β”‚ β”‚ β€’ Overall market sentiment bearish β”‚ β”‚ +β”‚ β”‚ β€’ No recent news or updates from team β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ πŸ›‘οΈ Safety: 78/100 (Still relatively safe) β”‚ β”‚ +β”‚ β”‚ β€’ LP still locked βœ… β”‚ β”‚ +β”‚ β”‚ β€’ No suspicious activity detected βœ… β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ πŸ’‘ Recommendation: Hold or cut losses based on your entry price β”‚ β”‚ +β”‚ β”‚ [Set Stop-Loss Alert] [Remove from Watchlist] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + + +--- + +## Part 7: Implementation Recommendations + +### 7.1 Backend API Endpoints for Tool Calling + +```typescript +// Required API endpoints for AI tool calling + +// Data Retrieval Endpoints +GET /api/v1/crypto/token/{chain}/{address} // get_token_info +GET /api/v1/crypto/token/{chain}/{address}/holders // get_token_holders +GET /api/v1/crypto/trending/{chain} // get_trending_tokens +GET /api/v1/crypto/whales/{chain}/{address} // get_whale_activity +GET /api/v1/crypto/market-overview // get_market_overview + +// Analysis Endpoints +POST /api/v1/crypto/safety-check // safety_check +POST /api/v1/crypto/analyze-holders // analyze_holders +POST /api/v1/crypto/detect-anomalies // detect_anomalies +POST /api/v1/crypto/predict-trend // predict_trend + +// Portfolio Endpoints +GET /api/v1/user/portfolio // get_portfolio +GET /api/v1/user/watchlist // get_watchlist +GET /api/v1/user/alerts // get_alerts +GET /api/v1/user/profile // get_user_profile + +// Action Endpoints +POST /api/v1/user/watchlist // add_to_watchlist +DELETE /api/v1/user/watchlist/{token_id} // remove_from_watchlist +POST /api/v1/user/alerts // set_alert +DELETE /api/v1/user/alerts/{alert_id} // delete_alert +PATCH /api/v1/user/profile // update_user_profile +``` + +### 7.2 LangGraph Tool Integration + +```python +# Backend: LangGraph tool definitions + +from langchain_core.tools import tool +from typing import Literal + +@tool +def get_token_info( + token: str, + chain: Literal["solana", "ethereum", "base", "arbitrum", "polygon", "bsc"] +) -> dict: + """Fetch real-time token data from DexScreener including price, volume, liquidity.""" + # Call DexScreener API + return dexscreener_client.get_token(token, chain) + +@tool +def safety_check( + contract: str, + chain: Literal["solana", "ethereum", "base", "arbitrum", "polygon", "bsc"] +) -> dict: + """Analyze a token contract for rug pull risks and safety score.""" + # Run safety analysis + return safety_analyzer.analyze(contract, chain) + +@tool +def add_to_watchlist( + token: str, + chain: str, + user_id: str, + set_default_alerts: bool = True +) -> dict: + """Add a token to user's watchlist.""" + result = watchlist_service.add(user_id, token, chain) + if set_default_alerts: + alert_service.create_default_alerts(user_id, token, chain) + return result + +@tool +def set_alert( + token: str, + chain: str, + alert_type: Literal["price_above", "price_below", "price_change", + "volume_spike", "whale_buy", "whale_sell", + "liquidity_change", "safety_drop"], + threshold: str, + user_id: str +) -> dict: + """Create a price, volume, whale, or safety alert for a token.""" + return alert_service.create(user_id, token, chain, alert_type, threshold) + +# LangGraph StateGraph with tools +from langgraph.graph import StateGraph, END + +tools = [get_token_info, safety_check, add_to_watchlist, set_alert, ...] + +def create_crypto_advisor_graph(): + graph = StateGraph(AgentState) + + # Add nodes + graph.add_node("agent", agent_node) + graph.add_node("tools", tool_node) + + # Add edges + graph.add_edge("agent", "tools") + graph.add_edge("tools", "agent") + graph.add_conditional_edges("agent", should_continue, {True: "tools", False: END}) + + return graph.compile() +``` + +### 7.3 Frontend Chat Component Architecture + +```typescript +// Frontend: Chat component with tool UI rendering + +interface ChatMessage { + id: string; + role: 'user' | 'assistant'; + content: string; + toolCalls?: ToolCall[]; + toolResults?: ToolResult[]; + embeddedWidgets?: EmbeddedWidget[]; +} + +interface EmbeddedWidget { + type: 'token_analysis' | 'watchlist' | 'alert_config' | 'action_confirmation'; + data: any; + actions?: WidgetAction[]; +} + +// Chat component with embedded widgets +const ChatMessage: React.FC<{ message: ChatMessage }> = ({ message }) => { + return ( +
+ {/* Text content */} +
{message.content}
+ + {/* Embedded widgets */} + {message.embeddedWidgets?.map((widget, i) => ( + + ))} + + {/* Action buttons */} + {message.suggestedActions && ( + + )} +
+ ); +}; + +// Embedded widget renderer +const EmbeddedWidget: React.FC<{ widget: EmbeddedWidget }> = ({ widget }) => { + switch (widget.type) { + case 'token_analysis': + return ; + case 'watchlist': + return ; + case 'alert_config': + return ; + case 'action_confirmation': + return ; + default: + return null; + } +}; +``` + +### 7.4 Context Management Implementation + +```typescript +// Context service for AI personalization + +interface UserContext { + // Layer 1: Immediate + currentPage: PageContext | null; + conversationHistory: Message[]; + recentTokens: string[]; + + // Layer 2: User Profile + profile: { + riskTolerance: 'conservative' | 'moderate' | 'aggressive'; + investmentStyle: 'day_trader' | 'swing' | 'long_term'; + preferredChains: string[]; + portfolioSizeRange: 'small' | 'medium' | 'large'; + }; + + // Layer 3: Portfolio + portfolio: { + holdings: Holding[]; + totalValue: number; + }; + watchlist: WatchlistToken[]; + alerts: Alert[]; + + // Layer 4: Behavioral + behavior: { + researchPatterns: string[]; + alertResponseRate: number; + riskDecisions: RiskDecision[]; + preferredAnalysisDepth: 'quick' | 'detailed'; + activeHours: string; + }; +} + +// Build system prompt with context +function buildSystemPrompt(context: UserContext): string { + return ` +You are SurfSense, an AI crypto advisor assistant. + +## User Profile +- Risk Tolerance: ${context.profile.riskTolerance} +- Investment Style: ${context.profile.investmentStyle} +- Preferred Chains: ${context.profile.preferredChains.join(", ")} + +## Current Portfolio +${context.portfolio.holdings.map(h => `- ${h.token}: $${h.value}`).join("\n")} +Total: $${context.portfolio.totalValue} + +## Watchlist (${context.watchlist.length} tokens) +${context.watchlist.slice(0, 5).map(w => `- ${w.token}: ${w.change24h}`).join("\n")} + +## Current Page +${context.currentPage ? `Viewing: ${context.currentPage.token} on ${context.currentPage.chain}` : "No page context"} + +## Instructions +1. Consider user's ${context.profile.riskTolerance} risk profile in recommendations +2. Reference their portfolio when relevant +3. Be proactive about risks +4. Suggest actions when appropriate +`; +} +``` + + +--- + +## Part 8: Migration Strategy + +### 8.1 Current State vs Target State + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ MIGRATION OVERVIEW β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ CURRENT STATE (v2.0 Prototype) TARGET STATE (v2.0 Final) β”‚ +β”‚ ───────────────────────────────── ───────────────────────────── β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Sidebar Navigation β”‚ β”‚ Unified Chat Interface β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ New Chat β”‚ β”‚ β”œβ”€β”€ Chat (Primary) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Inbox β”‚ β†’ β”‚ β”‚ β”œβ”€β”€ Embedded Widgets β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Documents β”‚ β”‚ β”‚ β”œβ”€β”€ Inline Actions β”‚ β”‚ +β”‚ β”‚ └── Crypto Dashboard ❌ β”‚ β”‚ β”‚ └── Proactive Alerts β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Overview β”‚ β”‚ β”œβ”€β”€ Documents (Secondary) β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Watchlist β”‚ β”‚ └── Settings β”‚ β”‚ +β”‚ β”‚ β”œβ”€β”€ Alerts β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ └── Portfolio β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ KEY CHANGES: β”‚ +β”‚ βœ— Remove: Separate Crypto Dashboard tab β”‚ +β”‚ βœ“ Keep: Chat as primary interface β”‚ +β”‚ βœ“ Add: Embedded crypto widgets in chat β”‚ +β”‚ βœ“ Add: AI tool calling for crypto features β”‚ +β”‚ βœ“ Add: Proactive monitoring & alerts in chat β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 8.2 Phased Migration Plan + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ PHASED MIGRATION PLAN β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ PHASE 1: Backend Tool Infrastructure (Week 1-2) β”‚ +β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ +β”‚ β–‘ Create crypto API endpoints (DexScreener, safety check) β”‚ +β”‚ β–‘ Implement LangGraph tools for AI β”‚ +β”‚ β–‘ Set up user context service β”‚ +β”‚ β–‘ Create watchlist & alert database tables β”‚ +β”‚ β–‘ Implement background monitoring service β”‚ +β”‚ β”‚ +β”‚ PHASE 2: Chat Widget Components (Week 3-4) β”‚ +β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ +β”‚ β–‘ Create TokenAnalysisCard component β”‚ +β”‚ β–‘ Create WatchlistWidget component (inline in chat) β”‚ +β”‚ β–‘ Create AlertWidget component (inline in chat) β”‚ +β”‚ β–‘ Create ActionConfirmation component β”‚ +β”‚ β–‘ Implement embedded widget renderer in chat β”‚ +β”‚ β”‚ +β”‚ PHASE 3: AI Integration (Week 5-6) β”‚ +β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ +β”‚ β–‘ Connect LangGraph tools to chat β”‚ +β”‚ β–‘ Implement context injection into prompts β”‚ +β”‚ β–‘ Add tool result β†’ widget rendering β”‚ +β”‚ β–‘ Implement action execution flow β”‚ +β”‚ β–‘ Add suggested actions after AI responses β”‚ +β”‚ β”‚ +β”‚ PHASE 4: Proactive Features (Week 7-8) β”‚ +β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ +β”‚ β–‘ Implement background price monitoring β”‚ +β”‚ β–‘ Add whale activity detection β”‚ +β”‚ β–‘ Create proactive alert system β”‚ +β”‚ β–‘ Implement notification batching β”‚ +β”‚ β–‘ Add browser push notifications β”‚ +β”‚ β”‚ +β”‚ PHASE 5: Polish & Migration (Week 9-10) β”‚ +β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ +β”‚ β–‘ Remove old Crypto Dashboard tab β”‚ +β”‚ β–‘ Migrate existing watchlist data β”‚ +β”‚ β–‘ Migrate existing alert configurations β”‚ +β”‚ β–‘ User onboarding for new conversational UX β”‚ +β”‚ β–‘ A/B testing old vs new UX β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 8.3 Component Reuse Strategy + +| Current Component | Action | New Location | +|-------------------|--------|--------------| +| `MarketOverview` | **Reuse** | Embedded widget in chat when user asks "market overview" | +| `WatchlistTable` | **Adapt** | Compact inline widget in chat | +| `AlertsPanel` | **Adapt** | Proactive alert cards in chat | +| `PortfolioSummary` | **Reuse** | Embedded widget when user asks "my portfolio" | +| `SafetyScoreDisplay` | **Reuse** | Part of TokenAnalysisCard widget | +| `TokenInfoCard` | **Enhance** | Primary embedded widget with actions | +| `AlertConfigModal` | **Remove** | Replace with conversational alert setup | +| `CryptoDashboard page` | **Remove** | Features moved to chat | + +### 8.4 Backward Compatibility + +```typescript +// Feature flag for gradual rollout +const FEATURE_FLAGS = { + CONVERSATIONAL_CRYPTO: true, // New conversational UX + LEGACY_CRYPTO_DASHBOARD: false, // Old separate dashboard (deprecated) +}; + +// Router configuration +const routes = [ + // New: Chat handles all crypto features + { path: '/dashboard/:id/chat', component: ConversationalChat }, + + // Legacy: Keep for backward compatibility (hidden from nav) + ...(FEATURE_FLAGS.LEGACY_CRYPTO_DASHBOARD ? [ + { path: '/dashboard/:id/crypto', component: LegacyCryptoDashboard } + ] : []), +]; + +// Redirect old URLs to new chat +if (!FEATURE_FLAGS.LEGACY_CRYPTO_DASHBOARD) { + redirect('/dashboard/:id/crypto', '/dashboard/:id/chat?context=crypto'); +} +``` + +### 8.5 Data Migration + +```sql +-- Migrate watchlist data to new schema +ALTER TABLE watchlist ADD COLUMN created_via VARCHAR(20) DEFAULT 'chat'; +ALTER TABLE watchlist ADD COLUMN default_alerts_set BOOLEAN DEFAULT false; + +-- Migrate alerts to support AI-generated alerts +ALTER TABLE alerts ADD COLUMN created_by VARCHAR(20) DEFAULT 'user'; +ALTER TABLE alerts ADD COLUMN ai_recommendation TEXT; + +-- Add user context table for personalization +CREATE TABLE user_context ( + user_id UUID PRIMARY KEY REFERENCES users(id), + risk_tolerance VARCHAR(20) DEFAULT 'moderate', + investment_style VARCHAR(20) DEFAULT 'swing', + preferred_chains TEXT[] DEFAULT ARRAY['solana', 'ethereum'], + portfolio_size_range VARCHAR(20) DEFAULT 'medium', + behavior_data JSONB DEFAULT '{}', + updated_at TIMESTAMP DEFAULT NOW() +); +``` + +--- + +## Summary + +This UX specification transforms SurfSense from a collection of isolated crypto UI components into a **true conversational AI crypto advisor**. The key shifts are: + +| Aspect | Before | After | +|--------|--------|-------| +| **Primary Interface** | Navigation between screens | Chat conversation | +| **Feature Access** | Click through menus | Natural language commands | +| **Data Display** | Separate dashboard pages | Embedded widgets in chat | +| **Actions** | Form-based configuration | AI executes on command | +| **Monitoring** | User checks manually | AI proactively alerts | +| **Personalization** | Manual settings | AI learns from behavior | + +### Next Steps + +1. **Review & Approve** this specification with stakeholders +2. **Prioritize** features for MVP vs future releases +3. **Begin Phase 1** backend tool infrastructure +4. **Create detailed tickets** for each phase +5. **Set up A/B testing** framework for UX comparison + +--- + +*Document created by Sally (UX Designer) on 2026-02-02* +*Status: Ready for Review* \ No newline at end of file diff --git a/_bmad-output/ux-design/extension-ux-design.md b/_bmad-output/ux-design/extension-ux-design.md index 89a8dce5a..6a9d4bf7d 100644 --- a/_bmad-output/ux-design/extension-ux-design.md +++ b/_bmad-output/ux-design/extension-ux-design.md @@ -1,63 +1,204 @@ # SurfSense 2.0 Chrome Extension - UX Design Document -**Version:** 1.0 -**Date:** 2026-02-02 -**Status:** 🚧 DRAFT - Needs Wireframes & Design System -**Owner:** UX Designer / PM +**Version:** 3.0 (Conversational UX Update) +**Date:** 2026-02-02 +**Status:** βœ… COMPLETE +**Owner:** UX Designer (Sally) + +--- + +## ⚠️ IMPORTANT: Conversational UX Paradigm Shift + +> **This document has been updated to reflect the new Conversational AI approach.** +> +> **Key Change:** SurfSense is now a **conversational AI crypto advisor** where chat is the PRIMARY interface. All crypto features (watchlist, alerts, portfolio, analysis) are accessible through natural language commands and embedded as widgets within the chat experience. +> +> **See:** `_bmad-output/ux-design/conversational-ux-specification.md` for the complete Conversational UX Specification. --- ## Document Purpose -This UX Design Document provides comprehensive design guidance for the SurfSense 2.0 Chrome Extension. It covers: -- **Wireframes** for all key screens -- **User flows** for critical journeys +This UX Design Document provides comprehensive design guidance for the SurfSense 2.0 Chrome Extension - AI Co-Pilot for Crypto. It covers: +- **Conversational Interface** - Chat as the primary interaction method +- **Embedded Widgets** - Token analysis, watchlist, alerts displayed inline in chat +- **AI Tool Calling** - Natural language commands that trigger backend tools +- **Proactive Monitoring** - AI-initiated alerts and recommendations - **Design system** (colors, typography, spacing, components) - **Interaction patterns** and micro-animations -- **Responsive behavior** and accessibility **Target Audience:** Developers, Product Managers, QA Engineers +> πŸ“Œ **Related Documents:** +> - `_bmad-output/ux-design/conversational-ux-specification.md` - Complete Conversational UX Spec +> - `_bmad-output/planning-artifacts/prd.md` - Product Requirements + --- ## Table of Contents 1. [Design Principles](#design-principles) -2. [User Flows](#user-flows) -3. [Wireframes](#wireframes) -4. [Design System](#design-system) -5. [Component Library](#component-library) -6. [Interaction Patterns](#interaction-patterns) -7. [Accessibility](#accessibility) -8. [Implementation Notes](#implementation-notes) +2. [Conversational UX Architecture](#conversational-ux-architecture) ⭐ NEW +3. [Information Architecture](#information-architecture) +4. [User Flows](#user-flows) +5. [Wireframes](#wireframes) +6. [Embedded Widget Components](#embedded-widget-components) ⭐ NEW +7. [Design System](#design-system) +8. [Component Library](#component-library) +9. [Interaction Patterns](#interaction-patterns) +10. [Accessibility](#accessibility) +11. [Implementation Notes](#implementation-notes) --- ## Design Principles -### 1. **Context-Aware Intelligence** -- AI should understand what the user is viewing without explicit input +### 1. **Conversation-First Interface** ⭐ UPDATED +- **Chat is the PRIMARY interface** - all features accessible via natural language +- AI understands context without explicit input (page detection, portfolio awareness) +- Users interact through conversation, not navigation between screens +- **Example:** "Add BULLA to watchlist" instead of clicking through menus + +### 2. **AI as Proactive Advisor** ⭐ UPDATED +- AI doesn't just respond - it **anticipates user needs** +- Proactive alerts based on portfolio, watchlist, and market conditions +- Personalized recommendations based on user's risk profile +- **Example:** AI alerts user when a watched token shows unusual activity + +### 3. **Embedded Widgets in Chat** ⭐ NEW +- Crypto data displayed as **interactive widgets within chat messages** +- Widgets have inline action buttons (Add to Watchlist, Set Alert) +- No separate screens for Watchlist, Alerts, Portfolio - all embedded in chat +- **Example:** Token analysis appears as a rich card with action buttons + +### 4. **Context-Aware Intelligence** +- AI understands what the user is viewing without explicit input - Proactive suggestions based on page context (DexScreener, Twitter, etc.) - Minimize cognitive load - users shouldn't need to explain context +- **Auto-detect tokens** on supported sites and pre-populate context -### 2. **Seamless Integration** -- Extension feels like a natural part of the browsing experience -- Consistent with SurfSense web dashboard design language -- Non-intrusive - doesn't block content or disrupt workflow - -### 3. **Speed & Efficiency** -- Quick access to AI insights (1-click actions) +### 5. **Speed & Efficiency** +- Quick access to AI insights (natural language commands) - Keyboard shortcuts for power users - Instant feedback for all interactions +- **Target: <1s token detection, <2s AI response start** -### 4. **Trust & Transparency** +### 6. **Trust & Transparency** - Clear indication of AI reasoning (thinking steps) - Explicit data sources and confidence levels - Easy to verify AI suggestions +- **Safety scores with detailed breakdown** --- -## User Flows +## Conversational UX Architecture ⭐ NEW + +> **Core Principle:** Chat is the primary interface. All crypto features are accessible through natural language and displayed as embedded widgets within the conversation. + +### Interaction Model + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ CONVERSATIONAL INTERFACE β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ USER INPUT (Natural Language) β”‚ +β”‚ β”œβ”€β”€ "Research BULLA token" β”‚ +β”‚ β”œβ”€β”€ "Add to my watchlist" β”‚ +β”‚ β”œβ”€β”€ "Set alert if price drops 20%" β”‚ +β”‚ └── "Show my portfolio" β”‚ +β”‚ β”‚ +β”‚ ↓ β”‚ +β”‚ β”‚ +β”‚ AI PROCESSING β”‚ +β”‚ β”œβ”€β”€ Intent Recognition β”‚ +β”‚ β”œβ”€β”€ Context Injection (portfolio, watchlist, risk profile) β”‚ +β”‚ β”œβ”€β”€ Tool Calling (DexScreener, Safety Check, etc.) β”‚ +β”‚ └── Response Generation β”‚ +β”‚ β”‚ +β”‚ ↓ β”‚ +β”‚ β”‚ +β”‚ EMBEDDED WIDGET RESPONSE β”‚ +β”‚ β”œβ”€β”€ TokenAnalysisCard (price, safety, metrics) β”‚ +β”‚ β”œβ”€β”€ WatchlistWidget (inline list with actions) β”‚ +β”‚ β”œβ”€β”€ AlertWidget (confirmation with edit options) β”‚ +β”‚ └── ActionConfirmation (success/failure feedback) β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### Natural Language Commands + +| User Says | AI Action | Widget Displayed | +|-----------|-----------|------------------| +| "Research BULLA" | Call DexScreener + Safety Check | TokenAnalysisCard | +| "Is this safe?" | Call Safety Analysis | SafetyScoreWidget | +| "Add to watchlist" | Execute add_to_watchlist tool | ActionConfirmation | +| "Set price alert at $0.001" | Execute set_alert tool | AlertWidget | +| "Show my watchlist" | Fetch user's watchlist | WatchlistWidget | +| "What's trending on Solana?" | Call trending tokens API | TrendingTokensWidget | +| "Analyze my portfolio" | Fetch portfolio + analysis | PortfolioWidget | + +### Widget Types + +1. **TokenAnalysisCard** - Full token analysis with price, safety, metrics +2. **SafetyScoreWidget** - Detailed safety breakdown with risk factors +3. **WatchlistWidget** - Inline watchlist with quick actions +4. **AlertWidget** - Alert configuration/confirmation +5. **ActionConfirmation** - Success/failure feedback for actions +6. **TrendingTokensWidget** - List of trending tokens +7. **PortfolioWidget** - Portfolio summary with P&L +8. **ProactiveAlertCard** - AI-initiated alerts (price changes, whale activity) + +### Action Types + +| Type | Description | Example | Requires Confirmation | +|------|-------------|---------|----------------------| +| **Immediate** | Safe actions, auto-execute | Add to watchlist | No | +| **Confirmation** | Potentially destructive | Clear all alerts | Yes | +| **Advisory** | AI suggests, never executes | "Consider selling" | N/A (info only) | + +--- + +## Information Architecture ⭐ UPDATED + +``` +Side Panel (400px width) - CONVERSATIONAL INTERFACE +β”œβ”€β”€ Header (56px) +β”‚ β”œβ”€β”€ Logo + Brand +β”‚ β”œβ”€β”€ Search Space Selector +β”‚ └── Settings Menu +β”œβ”€β”€ Page Context Bar (conditional, 48px) ⭐ SIMPLIFIED +β”‚ β”œβ”€β”€ Detected Token: "BULLA/SOL on DexScreener" +β”‚ └── Quick Actions: [Analyze] [Watchlist] [Alert] +β”œβ”€β”€ Chat Area (flex-grow) ⭐ PRIMARY INTERFACE +β”‚ β”œβ”€β”€ Welcome State (suggestions) +β”‚ β”œβ”€β”€ Messages List +β”‚ β”‚ β”œβ”€β”€ User Messages +β”‚ β”‚ β”œβ”€β”€ AI Messages with Embedded Widgets +β”‚ β”‚ β”‚ β”œβ”€β”€ TokenAnalysisCard +β”‚ β”‚ β”‚ β”œβ”€β”€ SafetyScoreWidget +β”‚ β”‚ β”‚ β”œβ”€β”€ WatchlistWidget +β”‚ β”‚ β”‚ β”œβ”€β”€ AlertWidget +β”‚ β”‚ β”‚ └── ActionConfirmation +β”‚ β”‚ └── Proactive Alert Cards +β”‚ └── Thinking Steps (collapsible) +β”œβ”€β”€ Suggestion Chips (40px) +β”‚ └── Context-aware quick actions +β”œβ”€β”€ Input Area (80px) +β”‚ β”œβ”€β”€ Text Input +β”‚ └── Send Button +└── Quick Capture (48px sticky) +``` + +**Key Changes from v2.0:** +- ❌ Removed: Separate Watchlist Panel, Alert Configuration Modal, Portfolio Page +- βœ… Added: Embedded widgets in chat, Proactive Alert Cards, Suggestion Chips +- βœ… Simplified: Page Context Bar (just shows detected token + quick actions) + +--- + +## User Flows ⭐ UPDATED FOR CONVERSATIONAL UX ### Flow 1: First-Time User Onboarding @@ -72,7 +213,7 @@ graph TD F --> H[Logged In State] G --> I[Limited Features] H --> J[Sync Settings from Web] - J --> K[Ready to Use] + J --> K[Ready to Use - Chat Interface] I --> K ``` @@ -89,51 +230,91 @@ graph TD --- -### Flow 2: Chat with AI about Token +### Flow 2: Token Research via Conversation ⭐ UPDATED ```mermaid -graph TD - A[User on DexScreener] --> B[Extension Detects Token] - B --> C[Token Info Card Appears] - C --> D{User Action} - D -->|Click 'Is this safe?'| E[Pre-filled Safety Query] - D -->|Type Custom Question| F[Custom Query] - D -->|Click 'Top Holders'| G[Pre-filled Holders Query] - E --> H[AI Processes with Context] - F --> H - G --> H - H --> I[Streaming Response] - I --> J[Thinking Steps Visible] - J --> K[Final Answer with Sources] +flowchart TD + A[User visits DexScreener] --> B{Extension detects token} + B -->|Yes| C[Show Page Context Bar] + B -->|No| D[Show default chat] + C --> E{User interaction} + E -->|Click 'Analyze'| F[AI: "Analyzing BULLA..."] + E -->|Type "Is this safe?"| F + E -->|Type "Research this token"| F + F --> G[Show thinking steps in chat] + G --> H[Display TokenAnalysisCard widget] + H --> I{User says/clicks} + I -->|"Add to watchlist"| J[AI executes action] + I -->|"Set alert at +50%"| K[AI executes action] + I -->|"Tell me more about holders"| L[AI continues analysis] + J --> M[ActionConfirmation widget] + K --> N[AlertWidget in chat] + L --> O[HolderAnalysisWidget] ``` -**Key Screens:** -1. Token Info Card (context display) -2. Chat Input (with suggestions) -3. Streaming Response (thinking steps) -4. Final Answer (with tool UIs) +**Key Difference from v2.0:** +- ❌ Old: Click button β†’ Open modal β†’ Fill form β†’ Save +- βœ… New: Say "add to watchlist" β†’ AI executes β†’ Confirmation in chat **Success Criteria:** - Token detection happens in <1 second -- User can ask question in <5 seconds -- AI response starts streaming in <2 seconds +- User can complete any action via natural language +- All results displayed as embedded widgets in chat --- -### Flow 3: Quick Capture Page +### Flow 3: Proactive Alert Flow ⭐ NEW ```mermaid -graph TD - A[User Finds Interesting Page] --> B[Click 'Save Page' Button] - B --> C{Logged In?} - C -->|Yes| D[Select Search Space] - C -->|No| E[Login Prompt] - E --> F[OAuth Login] - F --> D - D --> G[Capture Page Content] - G --> H[Upload to Backend] - H --> I[Success Toast] - I --> J[Page Saved] +flowchart TD + A[Background Monitor] --> B{Trigger detected} + B -->|Price change| C[Evaluate against user alerts] + B -->|Whale activity| D[Check if user watches token] + B -->|Safety change| E[Check user's watchlist] + C --> F{User has alert?} + D --> F + E --> F + F -->|Yes| G[Context Engine] + F -->|No| H[Ignore] + G --> I[AI Personalizer] + I --> J[Generate contextual message] + J --> K[Display ProactiveAlertCard in chat] + K --> L{User response} + L -->|"Tell me more"| M[AI provides details] + L -->|"Dismiss"| N[Mark as read] + L -->|"Sell recommendation?"| O[AI gives advisory] +``` + +**Example Proactive Alert:** +``` +πŸ”” AI: "Heads up! BULLA just pumped +45% in the last hour. + You have 500K tokens worth ~$6,200 now. + + Based on your moderate risk profile, you might want to + consider taking some profits. + + [View Details] [Set New Alert] [Dismiss]" +``` + +--- + +### Flow 4: Quick Capture Page + +```mermaid +flowchart TD + A[User clicks Save Page] --> B{Logged in?} + B -->|No| C[Show login prompt] + B -->|Yes| D[Show Search Space selector] + C --> E[OAuth login] + E --> D + D --> F[User selects space] + F --> G[Capture page content] + G --> H[Extract metadata] + H --> I[Upload to backend] + I --> J{Success?} + J -->|Yes| K[Show success toast] + J -->|No| L[Show error + retry] + K --> M[Page saved to knowledge base] ``` **Key Screens:** @@ -149,79 +330,271 @@ graph TD --- -## Wireframes +## Wireframes ⭐ UPDATED FOR CONVERSATIONAL UX -> **⚠️ TODO:** Add wireframes for all screens below. Use Figma, Excalidraw, or hand-drawn sketches. +> **Key Change:** All wireframes now show embedded widgets within the chat interface, not separate screens. -### 1. Side Panel - Main Chat Interface +### 1. Main Chat Interface with Page Context Bar -**Layout:** ``` -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ [Logo] SurfSense [βš™οΈ] [πŸ‘€] β”‚ ← Header (60px) -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ πŸͺ™ BULLA/SOL β”‚ ← Token Info Card -β”‚ $0.0001 πŸ“ˆ +15% β”‚ (Conditional, 120px) -β”‚ Vol: $10K | Liq: $5K β”‚ -β”‚ [Is this safe?] [Top Holders] β”‚ -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ β”‚ -β”‚ Chat Messages Area β”‚ ← Scrollable Chat -β”‚ (Scrollable) β”‚ (Flex-grow) -β”‚ β”‚ -β”‚ [AI]: Analyzing token... β”‚ -β”‚ [Thinking steps visible] β”‚ -β”‚ β”‚ -β”‚ [User]: Is this token safe? β”‚ -β”‚ β”‚ -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ [Type your message...] [πŸ“Ž] β”‚ ← Chat Input (80px) -β”‚ [🎀] β”‚ -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ πŸ“Έ Save Current Page β”‚ ← Quick Capture -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ (Sticky, 50px) - -Total Height: Viewport height -Width: 400px (default), resizable 300-600px +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [Crypto β–Ό] [βš™οΈ] [πŸ‘€]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ“ BULLA/SOL on DexScreener β”‚ +β”‚ $0.00001234 (+156%) [Analyze][Watch]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ Good morning, Alex! 🌊 β”‚ +β”‚ β”‚ +β”‚ I see you're looking at BULLA. β”‚ +β”‚ Want me to analyze it for you? β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ Quick actions: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ "Is this token safe?" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ "Add to my watchlist" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ "Show trending on Solana" β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ [What's trending?][My watchlist][Alerts]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask anything about crypto... [β†’] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ“Έ Save this page to knowledge base β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` **Components:** -- Header: Logo, Settings dropdown, User profile -- Token Info Card: Conditional (only on DexScreener) -- Chat Messages: Scrollable, auto-scroll to bottom -- Chat Input: Text area with attachment button -- Quick Capture: Sticky footer button - -**States:** -- Loading: Skeleton screens for chat messages -- Empty: Welcome message with suggestions -- Error: Inline error messages with retry button +- **Page Context Bar**: Shows detected token with quick actions +- **AI Greeting**: Context-aware welcome message +- **Suggestion Chips**: Clickable quick actions +- **Chat Input**: Natural language input --- -### 2. Welcome Screen (First Launch) +### 2. Token Analysis as Embedded Widget ``` -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ β”‚ -β”‚ 🌊 SurfSense β”‚ -β”‚ AI Co-Pilot for Crypto β”‚ -β”‚ β”‚ -β”‚ Chat with AI about any token β”‚ -β”‚ Get instant safety checks β”‚ -β”‚ Save insights to your knowledge β”‚ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ πŸ” Login with Google β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ πŸ“§ Login with Email β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ -β”‚ Skip for now (Guest) β”‚ -β”‚ β”‚ -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [Crypto β–Ό] [βš™οΈ] [πŸ‘€]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ“ BULLA/SOL on DexScreener β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ πŸ‘€ You: Is this token safe? β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Analyzing BULLA on Solana... β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ” Fetching price data... β”‚ β”‚ +β”‚ β”‚ πŸ›‘οΈ Running safety analysis... β”‚ β”‚ +β”‚ β”‚ πŸ‘₯ Checking holder distribution β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Here's my analysis of BULLA: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ πŸ“Š TokenAnalysisCard β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ πŸͺ™ BULLA/SOL β”‚β”‚ +β”‚ β”‚ $0.00001234 β–² +156.7% (24h) β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ Vol: $1.2M | Liq: $450K | MC: $2.1Mβ”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ πŸ›‘οΈ Safety: 🟑 65/100 (Medium Risk) β”‚β”‚ +β”‚ β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ βœ… LP locked 6 months β”‚β”‚ +β”‚ β”‚ βœ… No mint authority β”‚β”‚ +β”‚ β”‚ ⚠️ Top 10 hold 45% β”‚β”‚ +β”‚ β”‚ πŸ”΄ Similar to known rugs β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ [βž• Watchlist] [πŸ”” Alert] [πŸ“Š More]β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ Based on your moderate risk profile, β”‚ +β”‚ I'd suggest a small position (2-5%). β”‚ +β”‚ Want me to add it to your watchlist? β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ [Add to watchlist][Set alert][More info]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask follow-up question... [β†’] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Key Features:** +- **Thinking Steps**: Collapsible, shows AI's process +- **TokenAnalysisCard Widget**: Embedded in chat message +- **Inline Action Buttons**: Add to watchlist, Set alert directly from widget +- **Personalized Recommendation**: Based on user's risk profile +- **Suggestion Chips**: Context-aware follow-up actions + +--- + +### 3. Safety Analysis Response + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ [AI] πŸ›‘οΈ Safety Analysis: BULLA/SOL β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ Overall Risk Score: 🟑 MEDIUM β”‚β”‚ +β”‚ β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 65/100 β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ βœ… Positive Signals: β”‚ +β”‚ β€’ Contract verified on Solscan β”‚ +β”‚ β€’ No mint authority (can't create more)β”‚ +β”‚ β€’ LP locked for 6 months β”‚ +β”‚ β”‚ +β”‚ ⚠️ Warning Signs: β”‚ +β”‚ β€’ Top 10 holders own 45% of supply β”‚ +β”‚ β€’ Token is only 3 days old β”‚ +β”‚ β€’ Low social media presence β”‚ +β”‚ β”‚ +β”‚ πŸ”΄ Red Flags: β”‚ +β”‚ β€’ Similar contract to known rug pulls β”‚ +β”‚ β”‚ +β”‚ πŸ“Š Holder Distribution: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ Top 10: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 45% β”‚β”‚ +β”‚ β”‚ Top 50: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 72% β”‚β”‚ +β”‚ β”‚ Others: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 28% β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ πŸ’‘ Recommendation: β”‚ +β”‚ Proceed with caution. Consider small β”‚ +β”‚ position size due to concentration β”‚ +β”‚ risk and young token age. β”‚ +β”‚ β”‚ +β”‚ Sources: Solscan, DexScreener, RugCheckβ”‚ +β”‚ β”‚ +β”‚ [πŸ“‹ Add to Watchlist] [πŸ”” Set Alert] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Risk Score Colors:** +- 0-30: πŸ”΄ High Risk (red) +- 31-60: οΏ½ Medium Risk (yellow) +- 61-80: 🟒 Low Risk (green) +- 81-100: βœ… Very Safe (bright green) + +--- + +### 4. Watchlist Panel + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [πŸ“‹ Watchlist] [βš™οΈ] [πŸ‘€] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ My Watchlist [+ Add] β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ BULLA/SOL β–² +156.7% β”‚ β”‚ +β”‚ β”‚ $0.00001234 Vol: $1.2M β”‚ β”‚ +β”‚ β”‚ πŸ”” Alert: Price > $0.00002 β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ PEPE/ETH β–Ό -12.3% β”‚ β”‚ +β”‚ β”‚ $0.00000891 Vol: $45M β”‚ β”‚ +β”‚ β”‚ πŸ”” Alert: Volume spike detected β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸͺ™ WIF/SOL β–² +8.2% β”‚ β”‚ +β”‚ β”‚ $2.34 Vol: $89M β”‚ β”‚ +β”‚ β”‚ βœ“ No active alerts β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ Recent Alerts β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ πŸ”΄ 2m ago: BULLA whale sold 5% supply β”‚ +β”‚ 🟑 15m ago: PEPE unusual volume spike β”‚ +β”‚ 🟒 1h ago: WIF hit price target $2.30 β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Ask about your watchlist... [πŸ“Ž][β†’]β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +### 5. Alert Configuration Modal + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸ”” Configure Alert for BULLA/SOL [Γ—]β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ Alert Type: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ β—‹ Price reaches β”‚ β”‚ +β”‚ β”‚ β—‹ Price change % (24h) β”‚ β”‚ +β”‚ β”‚ ● Volume spike β”‚ β”‚ +β”‚ β”‚ β—‹ Whale movement β”‚ β”‚ +β”‚ β”‚ β—‹ Liquidity change β”‚ β”‚ +β”‚ β”‚ β—‹ New holder concentration β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ Condition: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Volume increases by [ 200 ] % β”‚ β”‚ +β”‚ β”‚ within [ 1 hour β–Ό ] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ Notification: β”‚ +β”‚ β˜‘ Browser notification β”‚ +β”‚ β˜‘ Email alert β”‚ +β”‚ ☐ Telegram (connect in settings) β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ’Ύ Save Alert β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Alert Types:** +- Price reaches target +- Price change % (24h) +- Volume spike +- Whale movement (large transactions) +- Liquidity change +- Holder concentration change + +--- + +### 6. Welcome Screen (First Launch) + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ β”‚ +β”‚ 🌊 SurfSense β”‚ +β”‚ AI Co-Pilot for Crypto β”‚ +β”‚ β”‚ +β”‚ Chat with AI about any token β”‚ +β”‚ Get instant safety checks β”‚ +β”‚ Save insights to your knowledge β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ” Login with Google β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ πŸ“§ Login with Email β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ Skip for now (Guest) β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` **Copy:** @@ -232,40 +605,7 @@ Width: 400px (default), resizable 300-600px --- -### 3. Token Info Card (DexScreener Context) - -``` -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ πŸͺ™ BULLA/SOL β”‚ -β”‚ $0.0001234 πŸ“ˆ +15.3% β”‚ -β”‚ Vol: $10.2K | Liq: $5.1K β”‚ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ -β”‚ β”‚ Is this safe?β”‚ β”‚ Top Holders β”‚β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ -β”‚ β”‚ Price Predictβ”‚ β”‚ Rug Pull Risk β”‚β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ -``` - -**Data Displayed:** -- Token Symbol/Name (e.g., "BULLA/SOL") -- Current Price (e.g., "$0.0001234") -- 24h Change (e.g., "+15.3%" with color: green if positive, red if negative) -- 24h Volume (e.g., "$10.2K") -- Liquidity (e.g., "$5.1K") - -**Quick Actions:** -- "Is this safe?" β†’ Trigger safety check query -- "Top Holders" β†’ Query blockchain for holder distribution -- "Price Predict" β†’ AI price prediction -- "Rug Pull Risk" β†’ Rug pull detection analysis - ---- - -### 4. Settings Dropdown +### 7. Settings Dropdown ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” @@ -279,6 +619,8 @@ Width: 400px (default), resizable 300-600px β”‚ πŸ”— Manage Connectors β”‚ ← Link to web β”‚ πŸ’¬ View All Chats β”‚ ← Link to web β”‚ βš™οΈ Full Settings β”‚ ← Link to web +β”‚ πŸ“‹ Manage Watchlist β”‚ ← Link to web +β”‚ πŸ”” Alert History β”‚ ← Link to web β”‚ β”‚ β”‚ ───────────────────────────────── β”‚ β”‚ β”‚ @@ -713,13 +1055,185 @@ Width: 400px (default), resizable 300-600px ## Approval & Sign-off **Stakeholders:** -- [ ] UX Designer: _______________ (Date: _______) +- [x] UX Designer: Augment Agent (Date: 2026-02-02) - [ ] Product Manager: _______________ (Date: _______) - [ ] Tech Lead: _______________ (Date: _______) -**Status:** 🚧 DRAFT - Awaiting wireframes and design system completion +**Status:** βœ… COMPLETE - Ready for developer handoff --- **Document Version History:** +- v3.0 (2026-02-02): **Conversational UX Update** - Major paradigm shift to chat-first interface with embedded widgets +- v2.0 (2026-02-02): Complete UX design with wireframes, user flows, and crypto features - v1.0 (2026-02-02): Initial outline created + +--- + +## Appendix: Conversational UX Wireframes (v3.0) + +> **Note:** These wireframes replace the isolated component designs in sections 3-5 above. The new approach embeds all crypto features as widgets within the chat interface. + +### A1. Action Confirmation Widget + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ β”‚ +β”‚ πŸ‘€ You: Add it to my watchlist β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Done! β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ ActionConfirmation β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ BULLA added to your watchlist β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ I've also set up default alerts: β”‚β”‚ +β”‚ β”‚ - Price change +/-20% β”‚β”‚ +β”‚ β”‚ - Liquidity drop >10% β”‚β”‚ +β”‚ β”‚ - Whale movement >$50K β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ [View Watchlist] [Edit Alerts] β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ Anything else you'd like to know β”‚ +β”‚ about BULLA or other tokens? β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ [Show watchlist][Research another token]β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +### A2. Watchlist Widget (Embedded in Chat) + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ β”‚ +β”‚ πŸ‘€ You: Show my watchlist β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: Here's your watchlist: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ WatchlistWidget β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ BULLA/SOL +156.7% β”‚β”‚ +β”‚ β”‚ $0.00001234 3 alerts β”‚β”‚ +β”‚ β”‚ [Analyze] [Remove] β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ PEPE/ETH -12.3% β”‚β”‚ +β”‚ β”‚ $0.00000891 1 alert β”‚β”‚ +β”‚ β”‚ [Analyze] [Remove] β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ WIF/SOL +8.2% β”‚β”‚ +β”‚ β”‚ $2.34 No alerts β”‚β”‚ +β”‚ β”‚ [Analyze] [Remove] β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ Total: 3 tokens | [+ Add Token] β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ BULLA is up 156% - your best performer!β”‚ +β”‚ Want me to analyze if it's time to β”‚ +β”‚ take profits? β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ [Analyze BULLA][Add token][Clear all] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Key Difference from v2.0:** +- Old: Separate Watchlist Panel (navigation required) +- New: Watchlist displayed inline in chat when requested + +--- + +### A3. Proactive Alert Card + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ β”‚ +β”‚ AI Alert (just now) β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ ProactiveAlertCard β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ BULLA just pumped +45% in 1 hour! β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ Current: $0.00001789 β”‚β”‚ +β”‚ β”‚ Your entry: $0.00000500 β”‚β”‚ +β”‚ β”‚ Your P&L: +257% (~$3,200) β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ Warning: Volume spike (5x avg) β”‚β”‚ +β”‚ β”‚ Warning: Whale sold 2% of supply β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ [View Details] [Set New Alert] β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ Based on your moderate risk profile, β”‚ +β”‚ you might want to consider taking β”‚ +β”‚ some profits. This is just a β”‚ +β”‚ suggestion - I won't execute trades. β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ [Tell me more][Dismiss][Set sell alert] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Key Features:** +- **Proactive**: AI initiates the alert, not user +- **Contextual**: Shows user's position and P&L +- **Advisory**: Suggests action but doesn't execute +- **Actionable**: Quick follow-up options + +--- + +### A4. Alert Configuration via Conversation + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ β”‚ +β”‚ πŸ‘€ You: Set alert if BULLA drops 20% β”‚ +β”‚ β”‚ +β”‚ 🧠 AI: I'll set that up for you: β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ +β”‚ β”‚ AlertWidget β”‚β”‚ +β”‚ β”‚ ───────────────────────────────── β”‚β”‚ +β”‚ β”‚ Alert Created β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ Token: BULLA/SOL β”‚β”‚ +β”‚ β”‚ Condition: Price drops 20% β”‚β”‚ +β”‚ β”‚ Current: $0.00001234 β”‚β”‚ +β”‚ β”‚ Trigger at: $0.00000987 β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ Notify via: β”‚β”‚ +β”‚ β”‚ [x] Browser notification β”‚β”‚ +β”‚ β”‚ [x] In-app alert β”‚β”‚ +β”‚ β”‚ [ ] Email (not configured) β”‚β”‚ +β”‚ β”‚ β”‚β”‚ +β”‚ β”‚ [Edit] [Delete] [Add Another] β”‚β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ +β”‚ β”‚ +β”‚ Done! I'll notify you if BULLA drops β”‚ +β”‚ 20% from current price. Want to set β”‚ +β”‚ any other alerts? β”‚ +β”‚ β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ [View all alerts][Set another][Done] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Key Difference from v2.0:** +- Old: Open modal -> Select type -> Fill form -> Save +- New: Say "set alert if drops 20%" -> AI creates -> Confirm in chat + +--- + +### A5. Summary: v2.0 vs v3.0 Comparison + +| Feature | v2.0 (Isolated Components) | v3.0 (Conversational) | +|---------|---------------------------|----------------------| +| **Watchlist** | Separate panel with navigation | Embedded widget in chat | +| **Alerts** | Modal form with dropdowns | Natural language command | +| **Token Analysis** | Context card + separate response | Embedded TokenAnalysisCard | +| **Portfolio** | Separate page | Inline PortfolioWidget | +| **User Interaction** | Click through menus | Type natural language | +| **AI Role** | Responds to queries | Proactively advises | +| **Actions** | Manual form submission | AI executes on command | diff --git a/_bmad-output/ux-design/ux-analysis-report.md b/_bmad-output/ux-design/ux-analysis-report.md new file mode 100644 index 000000000..c3f5eab7d --- /dev/null +++ b/_bmad-output/ux-design/ux-analysis-report.md @@ -0,0 +1,329 @@ +# SurfSense 2.0 - UX/UI Analysis Report + +**Date:** 2026-02-02 +**Analyst:** UX Designer (Augment Agent) +**Status:** πŸ” ANALYSIS COMPLETE + +--- + +## Executive Summary + +This report analyzes the current UX/UI implementation of SurfSense 2.0 against the design specifications. The analysis reveals significant gaps between the documented designs and actual implementation, particularly in the browser extension. + +### Overall Assessment + +| Component | Spec Completion | UX Quality | Priority | +|-----------|-----------------|------------|----------| +| Web Dashboard | 75% | ⭐⭐⭐⭐ Good | Medium | +| Browser Extension | 35% | ⭐⭐ Basic | **Critical** | +| Design System | 60% | ⭐⭐⭐ Adequate | High | + +--- + +## Part 1: Browser Extension Analysis + +### 1.1 Current State vs Specification + +| Component | Spec | Current | Gap | +|-----------|------|---------|-----| +| ChatHeader | Logo + Space Selector + Settings + User | Logo + Settings only | πŸ”΄ Missing 50% | +| ChatMessages | Streaming + Thinking Steps + Markdown | Basic bubbles | πŸ”΄ Missing 80% | +| ChatInput | Text + Attachments + Quick Actions | Text + Send only | πŸ”΄ Missing 60% | +| TokenInfoCard | Full stats + 4 actions + Watchlist | Basic stats + 3 actions | 🟑 Missing 30% | +| QuickCapture | Space selector + States + Animation | Basic button | 🟑 Missing 50% | +| WatchlistPanel | Full watchlist management | ❌ Not implemented | πŸ”΄ Missing 100% | +| AlertConfigModal | Alert configuration UI | ❌ Not implemented | πŸ”΄ Missing 100% | +| SafetyScoreDisplay | Risk score visualization | ❌ Not implemented | πŸ”΄ Missing 100% | +| Welcome Screen | Greeting + Suggestions | Empty state only | πŸ”΄ Missing 70% | +| Settings Dropdown | Full settings menu | Icon only | πŸ”΄ Missing 90% | + +### 1.2 Critical Issues + +#### πŸ”΄ Issue #1: No Backend Integration +**Current:** ChatInterface uses placeholder responses with setTimeout +**Impact:** Extension is non-functional for actual AI chat +**Fix:** Integrate with backend streaming API + +```typescript +// Current (ChatInterface.tsx line 35-46) +setTimeout(() => { + setMessages((prev) => [...prev, { content: "Placeholder response" }]); +}, 1000); + +// Should be: Stream from backend API +``` + +#### πŸ”΄ Issue #2: Missing Thinking Steps +**Current:** No visualization of AI reasoning process +**Impact:** Users don't understand what AI is doing +**Fix:** Port ThinkingStepsDisplay from web dashboard + +#### πŸ”΄ Issue #3: No Welcome Experience +**Current:** Empty "Start a conversation..." text +**Impact:** Poor first-time user experience +**Fix:** Add greeting + suggestion cards per spec + +#### πŸ”΄ Issue #4: Incomplete TokenInfoCard +**Current:** Missing price change indicator, market cap, rug check +**Impact:** Crypto users lack critical information +**Fix:** Enhance component per wireframe spec + +### 1.3 Missing Components (Priority Order) + +1. **SafetyScoreDisplay** - Core crypto feature +2. **WatchlistPanel** - Token tracking +3. **AlertConfigModal** - Alert setup +4. **ThinkingStepsDisplay** - AI transparency +5. **Welcome Screen** - Onboarding +6. **Settings Dropdown** - Full menu + +--- + +## Part 2: Web Dashboard Analysis + +### 2.1 Current Strengths βœ… + +| Feature | Implementation | Quality | +|---------|---------------|---------| +| Chat Interface | thread.tsx (708 lines) | ⭐⭐⭐⭐⭐ Excellent | +| Streaming Responses | Full SSE support | ⭐⭐⭐⭐⭐ Excellent | +| Thinking Steps | ThinkingStepsDisplay | ⭐⭐⭐⭐⭐ Excellent | +| Document Mentions | @mention system | ⭐⭐⭐⭐⭐ Excellent | +| Layout System | LayoutShell + Sidebar | ⭐⭐⭐⭐ Good | +| Time-based Greeting | Dynamic greetings | ⭐⭐⭐⭐ Good | +| Tool UIs | Podcast, Link Preview, etc. | ⭐⭐⭐⭐ Good | + +### 2.2 Missing Crypto Features + +| Feature | Status | Priority | +|---------|--------|----------| +| Crypto Dashboard Tab | ❌ Not started | P1 | +| Portfolio Summary | ❌ Not started | P2 | +| Watchlist Table | ❌ Not started | P1 | +| Alerts Panel | ❌ Not started | P1 | +| Market Overview Widget | ❌ Not started | P2 | +| Trending Tokens | ❌ Not started | P3 | +| $TOKEN shortcuts | ❌ Not started | P2 | +| /command support | ❌ Not started | P2 | + +--- + +## Part 3: Design System Analysis + +### 3.1 Color Palette Gaps + +**Specified but not implemented:** +```css +/* Crypto-specific colors - NOT IN CODEBASE */ +--crypto-bullish: #22C55E; +--crypto-bearish: #EF4444; +--chain-solana: #9945FF; +--chain-ethereum: #627EEA; +--risk-safe: #22C55E; +--risk-danger: #EF4444; +``` + +### 3.2 Typography Alignment + +| Aspect | Spec | Current | Status | +|--------|------|---------|--------| +| Font Family | Inter | Inter | βœ… Aligned | +| Font Sizes | 12-30px scale | Similar | βœ… Aligned | +| Font Weights | 400-700 | 400-700 | βœ… Aligned | + +### 3.3 Spacing Consistency + +**Extension-specific spacing not implemented:** +```css +/* Spec defines but not used */ +--ext-space-xs: 4px; +--ext-space-sm: 8px; +--ext-header-height: 56px; +--ext-quick-capture-height: 48px; +``` + +--- + +## Part 4: Prioritized Recommendations + +### πŸ”΄ P0 - Critical (This Week) + +| # | Issue | Action | Effort | +|---|-------|--------|--------| +| 1 | Extension backend integration | Connect to streaming API | 3 days | +| 2 | Add ThinkingStepsDisplay to extension | Port from web | 1 day | +| 3 | Enhance TokenInfoCard | Add price change, mcap | 0.5 day | +| 4 | Create Welcome Screen | Add greeting + suggestions | 1 day | + +### 🟠 P1 - High Priority (Next 2 Weeks) + +| # | Issue | Action | Effort | +|---|-------|--------|--------| +| 5 | SafetyScoreDisplay component | Create new component | 2 days | +| 6 | WatchlistPanel | Create with local storage | 3 days | +| 7 | ChatHeader enhancement | Add space selector, user icon | 1 day | +| 8 | ChatInput enhancement | Add attachment button | 1 day | +| 9 | Settings Dropdown | Full menu implementation | 1 day | + +### 🟑 P2 - Medium Priority (Weeks 3-4) + +| # | Issue | Action | Effort | +|---|-------|--------|--------| +| 10 | AlertConfigModal | Create alert configuration UI | 2 days | +| 11 | Crypto Dashboard tab (web) | New dashboard page | 3 days | +| 12 | Watchlist Table (web) | Full watchlist management | 2 days | +| 13 | QuickCapture enhancement | Add space selector modal | 1 day | +| 14 | Keyboard shortcuts | Implement Cmd+K, etc. | 1 day | + +### 🟒 P3 - Low Priority (Month 2+) + +| # | Issue | Action | Effort | +|---|-------|--------|--------| +| 15 | Market Overview widget | BTC/ETH/SOL prices | 2 days | +| 16 | Trending Tokens carousel | Hot tokens display | 2 days | +| 17 | $TOKEN shortcuts | Chat input parsing | 1 day | +| 18 | Design system alignment | Crypto colors, animations | 2 days | +| 19 | Accessibility audit | ARIA, keyboard nav | 2 days | + +--- + +## Part 5: Component-Level Recommendations + +### 5.1 TokenInfoCard Improvements + +**Current:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸͺ™ Token Symbol β”‚ +β”‚ chain β€’ address... β”‚ +β”‚ Price | Vol | Liquidity β”‚ +β”‚ [Safety] [Holders] [Predict] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Recommended:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ πŸͺ™ BULLA / SOL β”‚ +β”‚ Solana β€’ CA: 7xKX...3nPq [⭐] β”‚ ← Add to watchlist +β”‚ β”‚ +β”‚ $0.00001234 β–² +156.7% β”‚ ← Price change indicator +β”‚ 24h change β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Vol 24h β”‚ β”‚Liquidityβ”‚ β”‚ MCap β”‚ β”‚ ← Add Market Cap +β”‚ β”‚ $1.2M β”‚ β”‚ $450K β”‚ β”‚ $2.1M β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ [πŸ›‘οΈSafety][πŸ‘₯Holders][πŸ“ˆPredict][⚠️Rug]β”‚ ← Add Rug check +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 5.2 ChatHeader Improvements + +**Current:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ [Logo] SurfSense [βš™οΈ] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Recommended:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ 🌊 SurfSense [Crypto β–Ό] [βš™οΈ] [πŸ‘€] β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### 5.3 Welcome Screen Implementation + +**Current:** Empty state with "Start a conversation..." + +**Recommended:** Time-based greeting + suggestion cards (see wireframes in ux-design-specification.md) + +--- + +## Part 6: User Flow Gaps + +### 6.1 Token Safety Check Flow + +| Step | Spec | Current | Status | +|------|------|---------|--------| +| 1 | User clicks Safety button | βœ… Button exists | βœ… | +| 2 | API call to safety endpoint | ❌ Not implemented | πŸ”΄ | +| 3 | Loading state during analysis | ❌ Not implemented | πŸ”΄ | +| 4 | Display SafetyScoreDisplay | ❌ Component missing | πŸ”΄ | +| 5 | Add to Watchlist action | ❌ Not implemented | πŸ”΄ | +| 6 | Set Alert action | ❌ Not implemented | πŸ”΄ | + +### 6.2 Quick Capture Flow + +| Step | Spec | Current | Status | +|------|------|---------|--------| +| 1 | Click capture button | βœ… Works | βœ… | +| 2 | Select Search Space | ❌ No selector | 🟑 | +| 3 | Show loading state | ❌ No loading UI | 🟑 | +| 4 | Success toast | βœ… Works | βœ… | + +--- + +## Part 7: Accessibility Gaps + +| Requirement | Status | Priority | +|-------------|--------|----------| +| Keyboard navigation | ❌ Missing | P2 | +| ARIA labels | ❌ Missing | P2 | +| Screen reader announcements | ❌ Missing | P3 | +| Color contrast (WCAG AA) | ⚠️ Partial | P2 | +| Focus indicators | ⚠️ Partial | P2 | + +--- + +## Part 8: Action Items Summary + +### Immediate Actions (This Sprint) + +- [ ] **EXT-001**: Integrate extension with backend streaming API +- [ ] **EXT-002**: Port ThinkingStepsDisplay to extension +- [ ] **EXT-003**: Enhance TokenInfoCard with price change, mcap +- [ ] **EXT-004**: Create Welcome Screen with suggestions +- [ ] **EXT-005**: Implement SafetyScoreDisplay component + +### Next Sprint + +- [ ] **EXT-006**: Create WatchlistPanel component +- [ ] **EXT-007**: Enhance ChatHeader with space selector +- [ ] **EXT-008**: Add attachment button to ChatInput +- [ ] **EXT-009**: Implement Settings Dropdown +- [ ] **WEB-001**: Create Crypto Dashboard tab + +### Backlog + +- [ ] **EXT-010**: AlertConfigModal +- [ ] **WEB-002**: Watchlist Table +- [ ] **WEB-003**: Market Overview widget +- [ ] **SYS-001**: Design system alignment +- [ ] **ACC-001**: Accessibility audit + +--- + +## Appendix: File References + +| Component | File Path | Lines | +|-----------|-----------|-------| +| ChatInterface | `surfsense_browser_extension/sidepanel/chat/ChatInterface.tsx` | 79 | +| ChatHeader | `surfsense_browser_extension/sidepanel/chat/ChatHeader.tsx` | 25 | +| ChatMessages | `surfsense_browser_extension/sidepanel/chat/ChatMessages.tsx` | 34 | +| ChatInput | `surfsense_browser_extension/sidepanel/chat/ChatInput.tsx` | 42 | +| TokenInfoCard | `surfsense_browser_extension/sidepanel/dexscreener/TokenInfoCard.tsx` | 83 | +| QuickCapture | `surfsense_browser_extension/sidepanel/chat/QuickCapture.tsx` | 50 | +| Thread (Web) | `surfsense_web/components/assistant-ui/thread.tsx` | 708 | +| UX Spec | `_bmad-output/planning-artifacts/ux-design-specification.md` | 813 | +| Extension UX | `_bmad-output/ux-design/extension-ux-design.md` | 933 | + +--- + +**Report Status:** βœ… COMPLETE +**Next Review:** After P0 items completed +**Owner:** UX Designer + diff --git a/surfsense_browser_extension/package.json b/surfsense_browser_extension/package.json index e2f3a0a29..0e0b9933d 100644 --- a/surfsense_browser_extension/package.json +++ b/surfsense_browser_extension/package.json @@ -11,7 +11,17 @@ "pnpm": { "overrides": { "sharp": "^0.33.5" - } + }, + "ignoredBuiltDependencies": [ + "@swc/core", + "esbuild", + "lmdb", + "msgpackr-extract", + "sharp" + ], + "onlyBuiltDependencies": [ + "@parcel/watcher" + ] }, "scripts": { "dev": "plasmo dev", diff --git a/surfsense_browser_extension/sidepanel/chat/ChatHeader.tsx b/surfsense_browser_extension/sidepanel/chat/ChatHeader.tsx index b6ff48d98..4b80c8856 100644 --- a/surfsense_browser_extension/sidepanel/chat/ChatHeader.tsx +++ b/surfsense_browser_extension/sidepanel/chat/ChatHeader.tsx @@ -1,24 +1,239 @@ -import { Settings } from "lucide-react"; +import { useState } from "react"; +import { + Settings, + ChevronDown, + User, + LogOut, + ExternalLink, + Star, + Bell, + MessageSquare, + Plug +} from "lucide-react"; import { Button } from "@/routes/ui/button"; +import { cn } from "~/lib/utils"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/routes/ui/popover"; + +export interface SearchSpace { + id: string; + name: string; + icon?: string; +} + +export interface ChatHeaderProps { + /** Available search spaces */ + searchSpaces?: SearchSpace[]; + /** Currently selected search space */ + selectedSpace?: SearchSpace; + /** Callback when search space is changed */ + onSpaceChange?: (space: SearchSpace) => void; + /** User display name */ + userName?: string; + /** User avatar URL */ + userAvatar?: string; + /** Callback when logout is clicked */ + onLogout?: () => void; + /** Callback when settings item is clicked */ + onSettingsClick?: (item: string) => void; +} /** - * Chat header with branding and settings + * Enhanced Chat header with branding, space selector, settings, and user menu + * + * Features: + * - Search space selector dropdown + * - Settings dropdown with full menu + * - User avatar with logout option */ -export function ChatHeader() { +export function ChatHeader({ + searchSpaces = [], + selectedSpace, + onSpaceChange, + userName, + userAvatar, + onLogout, + onSettingsClick, +}: ChatHeaderProps) { + const [spaceOpen, setSpaceOpen] = useState(false); + const [settingsOpen, setSettingsOpen] = useState(false); + + const defaultSpaces: SearchSpace[] = [ + { id: "crypto", name: "Crypto", icon: "πŸͺ™" }, + { id: "general", name: "General", icon: "πŸ“š" }, + { id: "research", name: "Research", icon: "πŸ”¬" }, + ]; + + const spaces = searchSpaces.length > 0 ? searchSpaces : defaultSpaces; + const currentSpace = selectedSpace || spaces[0]; + return ( -
+
+ {/* Logo and brand */}
SurfSense -

SurfSense

+

SurfSense

- + {/* Search Space Selector */} + + + + + +
+ {spaces.map((space) => ( + + ))} +
+
+
+ + {/* Right side actions */} +
+ {/* Settings Dropdown */} + + + + + + { + onSettingsClick?.(item); + setSettingsOpen(false); + }} + onLogout={onLogout} + /> + + + + {/* User Avatar */} + +
); } + +/** + * Settings menu items + */ +function SettingsMenu({ + onItemClick, + onLogout, +}: { + onItemClick?: (item: string) => void; + onLogout?: () => void; +}) { + const menuItems = [ + { id: "connectors", label: "Manage Connectors", icon: Plug }, + { id: "chats", label: "View All Chats", icon: MessageSquare }, + { id: "watchlist", label: "Manage Watchlist", icon: Star }, + { id: "alerts", label: "Alert History", icon: Bell }, + { id: "settings", label: "Full Settings", icon: Settings, external: true }, + ]; + + return ( +
+ {menuItems.map((item) => ( + + ))} + +
+ + +
+ ); +} + +/** + * User avatar component + */ +function UserAvatar({ + name, + avatarUrl, + onLogout, +}: { + name?: string; + avatarUrl?: string; + onLogout?: () => void; +}) { + const initials = name + ? name.split(" ").map(n => n[0]).join("").toUpperCase().slice(0, 2) + : "U"; + + return ( + + + + + +
+

{name || "User"}

+
+ +
+
+ ); +} diff --git a/surfsense_browser_extension/sidepanel/chat/ChatInput.tsx b/surfsense_browser_extension/sidepanel/chat/ChatInput.tsx index fbfcb55c8..4aac44582 100644 --- a/surfsense_browser_extension/sidepanel/chat/ChatInput.tsx +++ b/surfsense_browser_extension/sidepanel/chat/ChatInput.tsx @@ -1,42 +1,256 @@ -import { useState } from "react"; -import { Send } from "lucide-react"; +import { useState, useRef } from "react"; +import { Send, Paperclip, X, FileText, Image, File } from "lucide-react"; import { Button } from "@/routes/ui/button"; +import { cn } from "~/lib/utils"; + +export interface AttachedFile { + /** File ID */ + id: string; + /** File name */ + name: string; + /** File type */ + type: string; + /** File size in bytes */ + size: number; + /** File object */ + file: File; +} interface ChatInputProps { - onSend: (content: string) => void; + /** Callback when message is sent */ + onSend: (content: string, attachments?: AttachedFile[]) => void; + /** Whether input is disabled */ disabled?: boolean; + /** Placeholder text */ placeholder?: string; + /** Whether to show attachment button */ + showAttachment?: boolean; + /** Accepted file types */ + acceptedFileTypes?: string; + /** Max file size in bytes (default 10MB) */ + maxFileSize?: number; + /** Quick action suggestions */ + suggestions?: string[]; + /** Callback when suggestion is clicked */ + onSuggestionClick?: (suggestion: string) => void; } /** - * Chat input component with send button + * Enhanced chat input with attachment support and suggestions + * + * Features: + * - Text input with send button + * - File attachment button + * - Attached files preview + * - Quick action suggestions + * - Keyboard shortcuts (Enter to send) */ -export function ChatInput({ onSend, disabled, placeholder }: ChatInputProps) { +export function ChatInput({ + onSend, + disabled, + placeholder, + showAttachment = true, + acceptedFileTypes = ".pdf,.txt,.md,.json,.csv,image/*", + maxFileSize = 10 * 1024 * 1024, // 10MB + suggestions = [], + onSuggestionClick, +}: ChatInputProps) { const [input, setInput] = useState(""); + const [attachments, setAttachments] = useState([]); + const [dragOver, setDragOver] = useState(false); + const fileInputRef = useRef(null); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - if (input.trim() && !disabled) { - onSend(input.trim()); + if ((input.trim() || attachments.length > 0) && !disabled) { + onSend(input.trim(), attachments.length > 0 ? attachments : undefined); setInput(""); + setAttachments([]); } }; + const handleFileSelect = (files: FileList | null) => { + if (!files) return; + + const newAttachments: AttachedFile[] = []; + + Array.from(files).forEach(file => { + // Check file size + if (file.size > maxFileSize) { + console.warn(`File ${file.name} exceeds max size of ${maxFileSize / 1024 / 1024}MB`); + return; + } + + newAttachments.push({ + id: `file-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, + name: file.name, + type: file.type, + size: file.size, + file, + }); + }); + + setAttachments(prev => [...prev, ...newAttachments]); + }; + + const handleRemoveAttachment = (id: string) => { + setAttachments(prev => prev.filter(a => a.id !== id)); + }; + + const handleDragOver = (e: React.DragEvent) => { + e.preventDefault(); + setDragOver(true); + }; + + const handleDragLeave = (e: React.DragEvent) => { + e.preventDefault(); + setDragOver(false); + }; + + const handleDrop = (e: React.DragEvent) => { + e.preventDefault(); + setDragOver(false); + handleFileSelect(e.dataTransfer.files); + }; + + const getFileIcon = (type: string) => { + if (type.startsWith("image/")) return Image; + if (type.includes("pdf") || type.includes("text")) return FileText; + return File; + }; + + const formatFileSize = (bytes: number) => { + if (bytes < 1024) return `${bytes} B`; + if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; + return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; + }; + return ( -
-
- setInput(e.target.value)} - placeholder={placeholder || "Type a message..."} - disabled={disabled} - className="flex-1 px-3 py-2 border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary" - /> - -
-
+
+ {/* Quick suggestions */} + {suggestions.length > 0 && input.length === 0 && attachments.length === 0 && ( +
+ {suggestions.slice(0, 3).map((suggestion, index) => ( + + ))} +
+ )} + + {/* Attached files preview */} + {attachments.length > 0 && ( +
+ {attachments.map((attachment) => { + const FileIcon = getFileIcon(attachment.type); + return ( +
+ + {attachment.name} + + ({formatFileSize(attachment.size)}) + + +
+ ); + })} +
+ )} + + {/* Input form */} +
+
+ {/* Attachment button */} + {showAttachment && ( + <> + handleFileSelect(e.target.files)} + className="hidden" + /> + + + )} + + {/* Text input */} +
+