'use client'; import { useEffect, useState } from 'react'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { DatabaseIcon, GitBranchIcon, FileEditIcon, BookOpenIcon, CloudIcon, MessageSquareIcon, ZapIcon, X, ExternalLink, NetworkIcon } from 'lucide-react'; import Link from 'next/link'; import Logo from '@/components/icons/Logo'; import { LangGraphIcon, AgnoIcon } from '@/components/icons'; import MCPLogo from '@/components/icons/MCPLogo'; interface PatchNote { icon: React.ReactNode; title: string; description: string; link?: { href: string; text: string; }; } interface PatchNotesModalProps { version?: string; patchNotes?: PatchNote[]; changelogUrl?: string; open?: boolean; onOpenChange?: (open: boolean) => void; } const defaultPatchNotes: PatchNote[] = [ { icon: , title: 'MCP (Model Context Protocol) Launch', description: 'Chat with your traces using the new MCP integration. Compatible with Cursor, Windsurf, Claude, and more.', link: { href: '/mcp', text: 'Learn more' } }, { icon: , title: 'LangGraph Integration', description: 'Connect AgentOps workflows to LangGraph for richer automation & visualization', link: { href: 'https://docs.agentops.ai/v2/integrations/langgraph', text: 'View docs' } }, { icon: , title: 'Instrumentation & Agno UX Upgrades', description: 'Higher-accuracy metrics and a cleaner interface' }, { icon: , title: 'New Graph View', description: 'Visualize agent traces as interactive execution graphs for better debugging and insights' }, { icon: , title: 'Public API Launched & Refined', description: 'Easier external integrations with greater stability', link: { href: 'https://docs.agentops.ai/v2/usage/public-api', text: 'API docs' } }, { icon: , title: 'Dynamic Trace Metadata', description: 'Edit and monitor traces on the fly in the Python SDK with `update_trace_metadata`' }, { icon: , title: 'Stronger Concurrency Handling', description: 'Smoother, more reliable parallel operations' }, { icon: , title: 'Span Resource Attributes Capped', description: 'Leaner traces and faster processing' }, { icon: , title: 'Revamped Notebooks & Docs', description: 'Clearer examples, fixed links, and new session-management guides' }, { icon: , title: 'Oversized-Chat Truncation', description: 'Lightning-fast loading of very long conversations' }, { icon: , title: 'General Performance Boosts', description: 'Quicker page loads plus auto-save protection' } ]; export function PatchNotesModal({ version = '0.4.17', patchNotes = defaultPatchNotes, changelogUrl = 'https://agentops.ai/blog/v0.4.17', open, onOpenChange }: PatchNotesModalProps) { const [isOpen, setIsOpen] = useState(false); const storageKey = `patch-notes-dismissed-${version}`; const controlledOpen = open !== undefined ? open : isOpen; const handleOpenChange = (newOpen: boolean) => { if (onOpenChange) { onOpenChange(newOpen); } else { setIsOpen(newOpen); } }; useEffect(() => { // Only auto-open if not controlled if (open === undefined) { // Check if this version's patch notes have already been dismissed const isDismissed = localStorage.getItem(storageKey) === 'true'; if (!isDismissed) { // Add a small delay to ensure the page has loaded const timer = setTimeout(() => { setIsOpen(true); }, 500); return () => clearTimeout(timer); } } }, [storageKey, open]); const handleDismiss = () => { localStorage.setItem(storageKey, 'true'); handleOpenChange(false); }; return ( Close What's New in v{version} {patchNotes.map((note, index) => ( {note.icon} {note.title} {note.description} {note.link && ( handleOpenChange(false)} target={note.link.href.startsWith('http') ? '_blank' : undefined} rel={note.link.href.startsWith('http') ? 'noopener noreferrer' : undefined} > {note.link.text} )} ))} View Changelog Continue ); }
{note.description}