EZTIME2025
testing prompts
f69033f
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🎮 AI Catan Viewer</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: #1e1e1e;
color: #d4d4d4;
height: 100vh;
overflow: hidden;
}
.container {
display: flex;
height: 100vh;
}
/* Sidebar */
.sidebar {
width: 280px;
background: #252526;
border-right: 1px solid #3e3e42;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.sidebar-header {
padding: 20px;
background: #007acc;
color: white;
font-weight: bold;
font-size: 18px;
}
.sidebar-section {
padding: 15px;
border-bottom: 1px solid #3e3e42;
}
.sidebar-section h3 {
font-size: 12px;
color: #858585;
text-transform: uppercase;
margin-bottom: 10px;
font-weight: 600;
}
.nav-item {
padding: 10px 15px;
margin: 5px 0;
border-radius: 5px;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 10px;
}
.nav-item:hover {
background: #2a2d2e;
}
.nav-item.active {
background: #37373d;
border-left: 3px solid #007acc;
}
.nav-item .icon {
font-size: 18px;
}
.nav-item .badge {
margin-left: auto;
background: #007acc;
padding: 2px 8px;
border-radius: 10px;
font-size: 11px;
}
/* Main content */
.content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.content-header {
padding: 20px;
background: #2d2d30;
border-bottom: 1px solid #3e3e42;
display: flex;
justify-content: space-between;
align-items: center;
}
.content-header h1 {
font-size: 24px;
color: #cccccc;
}
.status-badge {
padding: 8px 16px;
border-radius: 20px;
font-size: 12px;
font-weight: bold;
display: flex;
align-items: center;
gap: 8px;
}
.status-badge.live {
background: #0e8a0e;
color: white;
}
.status-badge .pulse {
width: 8px;
height: 8px;
background: white;
border-radius: 50%;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.3; }
}
.content-body {
flex: 1;
overflow-y: auto;
padding: 20px;
}
/* Player log view - Beautiful markdown rendering */
.player-log {
background: #1e1e1e;
border: 1px solid #3e3e42;
border-radius: 8px;
padding: 30px;
margin-bottom: 20px;
color: #d4d4d4;
line-height: 1.8;
max-width: 1200px;
}
.player-log h1 {
color: #4ec9b0;
border-bottom: 3px solid #007acc;
padding-bottom: 15px;
margin-bottom: 25px;
font-size: 28px;
}
.player-log h2 {
color: #4fc1ff;
margin-top: 35px;
margin-bottom: 18px;
font-size: 22px;
padding-left: 10px;
border-left: 4px solid #007acc;
}
.player-log h3 {
color: #ce9178;
margin-top: 25px;
margin-bottom: 12px;
font-size: 18px;
}
.player-log hr {
border: none;
border-top: 2px solid #3e3e42;
margin: 30px 0;
}
.player-log p {
margin-bottom: 15px;
}
.player-log pre {
background: #2d2d30;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
font-size: 13px;
line-height: 1.6;
border-left: 4px solid #007acc;
margin: 20px 0;
}
.player-log code {
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
background: #2d2d30;
padding: 3px 8px;
border-radius: 4px;
color: #ce9178;
font-size: 13px;
}
.player-log pre code {
background: transparent;
padding: 0;
color: #d4d4d4;
}
.player-log strong {
color: #4ec9b0;
font-weight: 600;
}
.player-log em {
color: #ce9178;
font-style: italic;
}
.player-log ul, .player-log ol {
margin-left: 25px;
margin-bottom: 18px;
}
.player-log li {
margin-bottom: 10px;
}
.player-log details {
background: #252526;
border: 1px solid #3e3e42;
border-radius: 6px;
padding: 15px;
margin: 20px 0;
}
.player-log summary {
cursor: pointer;
font-weight: bold;
color: #4fc1ff;
padding: 8px;
user-select: none;
}
.player-log summary:hover {
color: #9cdcfe;
background: #2a2d2e;
border-radius: 4px;
}
.player-log details[open] summary {
margin-bottom: 15px;
}
/* Chat view */
.chat-container {
background: #1e1e1e;
border: 1px solid #3e3e42;
border-radius: 8px;
padding: 20px;
max-width: 900px;
}
.chat-message {
padding: 15px;
margin: 10px 0;
border-radius: 8px;
background: #2d2d30;
border-left: 4px solid #007acc;
}
.chat-message .meta {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
font-size: 12px;
color: #858585;
}
.chat-message .player {
font-weight: bold;
color: #4ec9b0;
}
.chat-message .text {
color: #d4d4d4;
font-size: 14px;
}
/* Memories view */
.memory-card {
background: #2d2d30;
border: 1px solid #3e3e42;
border-radius: 8px;
padding: 20px;
margin-bottom: 18px;
max-width: 900px;
}
.memory-card .player-name {
font-size: 18px;
font-weight: bold;
color: #4ec9b0;
margin-bottom: 12px;
}
.memory-card .memory-text {
color: #d4d4d4;
font-style: italic;
line-height: 1.6;
}
/* Loading spinner */
.loading {
display: flex;
justify-content: center;
align-items: center;
padding: 40px;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid #3e3e42;
border-top-color: #007acc;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Empty state */
.empty-state {
text-align: center;
padding: 60px 20px;
color: #858585;
}
.empty-state .icon {
font-size: 48px;
margin-bottom: 20px;
}
/* Scrollbar styling */
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-track {
background: #1e1e1e;
}
::-webkit-scrollbar-thumb {
background: #424242;
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: #4e4e4e;
}
</style>
</head>
<body>
<div class="container">
<!-- Sidebar -->
<div class="sidebar">
<div class="sidebar-header">
🎮 AI Catan Viewer
</div>
<div class="sidebar-section">
<h3>Players</h3>
<div id="players-nav"></div>
</div>
<div class="sidebar-section">
<h3>Views</h3>
<div class="nav-item" onclick="showView('chat')">
<span class="icon">💬</span>
<span>Chat History</span>
<span class="badge" id="chat-count">0</span>
</div>
<div class="nav-item" onclick="showView('memories')">
<span class="icon">📝</span>
<span>Agent Memories</span>
</div>
</div>
<div class="sidebar-section">
<h3>Session</h3>
<div id="session-info" style="font-size: 12px; color: #858585;"></div>
</div>
</div>
<!-- Main content -->
<div class="content">
<div class="content-header">
<h1 id="content-title">Loading...</h1>
<div class="status-badge live">
<div class="pulse"></div>
<span>LIVE</span>
</div>
</div>
<div class="content-body" id="content-body">
<div class="loading">
<div class="spinner"></div>
</div>
</div>
</div>
</div>
<script>
let currentView = null;
let currentPlayer = null;
let sessionData = null;
// Load data every second
async function loadData() {
try {
const response = await fetch('/api/current');
if (!response.ok) {
throw new Error('No active session');
}
sessionData = await response.json();
updateUI();
} catch (error) {
showEmptyState('No active game session', 'Start a game to see data here');
}
}
function updateUI() {
if (!sessionData) return;
// Update session info
document.getElementById('session-info').innerHTML = `
<strong>${sessionData.session_name}</strong><br>
Players: ${Object.keys(sessionData.players).length}<br>
Messages: ${sessionData.chat.length}
`;
// Update players nav
const playersNav = document.getElementById('players-nav');
playersNav.innerHTML = '';
Object.keys(sessionData.players).sort().forEach(player => {
const item = document.createElement('div');
item.className = 'nav-item' + (currentPlayer === player ? ' active' : '');
item.onclick = () => showPlayer(player);
item.innerHTML = `
<span class="icon">🤖</span>
<span>Player ${player}</span>
`;
playersNav.appendChild(item);
});
// Update chat count
document.getElementById('chat-count').textContent = sessionData.chat.length;
// Show default view if none selected
if (!currentView && Object.keys(sessionData.players).length > 0) {
showPlayer(Object.keys(sessionData.players).sort()[0]);
}
}
function renderMarkdown(text) {
// Simple markdown rendering for better display
let html = escapeHtml(text);
// Code blocks (must be before inline code)
html = html.replace(/```(\w*)\n([\s\S]*?)```/g, '<pre><code>$2</code></pre>');
// Headers
html = html.replace(/^### (.+)$/gm, '<h3>$1</h3>');
html = html.replace(/^## (.+)$/gm, '<h2>$1</h2>');
html = html.replace(/^# (.+)$/gm, '<h1>$1</h1>');
// Horizontal rules
html = html.replace(/^---+$/gm, '<hr>');
// Bold
html = html.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>');
// Italic
html = html.replace(/\*(.+?)\*/g, '<em>$1</em>');
// Inline code
html = html.replace(/`([^`]+)`/g, '<code>$1</code>');
// Details/Summary
html = html.replace(/&lt;details&gt;/g, '<details>');
html = html.replace(/&lt;\/details&gt;/g, '</details>');
html = html.replace(/&lt;summary&gt;(.+?)&lt;\/summary&gt;/g, '<summary>$1</summary>');
// Paragraphs
html = html.replace(/\n\n/g, '</p><p>');
html = '<p>' + html + '</p>';
// Clean up empty paragraphs
html = html.replace(/<p><\/p>/g, '');
html = html.replace(/<p>\s*<(h[123]|hr|pre|details)/g, '<$1');
html = html.replace(/<\/(h[123]|hr|pre|details)>\s*<\/p>/g, '</$1>');
return html;
}
function showPlayer(player) {
currentView = 'player';
currentPlayer = player;
updateActiveNav();
const playerData = sessionData.players[player];
if (!playerData) return;
document.getElementById('content-title').textContent = `Player ${player} - AI Log`;
const renderedContent = renderMarkdown(playerData.content);
document.getElementById('content-body').innerHTML = `
<div class="player-log">
${renderedContent}
</div>
`;
}
function showView(view) {
currentView = view;
currentPlayer = null;
updateActiveNav();
if (view === 'chat') {
showChat();
} else if (view === 'memories') {
showMemories();
}
}
function showChat() {
document.getElementById('content-title').textContent = 'Chat History';
if (sessionData.chat.length === 0) {
document.getElementById('content-body').innerHTML = `
<div class="empty-state">
<div class="icon">💬</div>
<h3>No messages yet</h3>
<p>Chat messages will appear here when players communicate</p>
</div>
`;
return;
}
const chatHTML = sessionData.chat.map(msg => `
<div class="chat-message">
<div class="meta">
<span class="player">Player ${msg.player.toUpperCase()}</span>
<span class="msg-num">#${msg.msg || '?'}</span>
</div>
<div class="text">${escapeHtml(msg.message)}</div>
</div>
`).join('');
document.getElementById('content-body').innerHTML = `
<div class="chat-container">
${chatHTML}
</div>
`;
}
function showMemories() {
document.getElementById('content-title').textContent = 'Agent Memories';
if (Object.keys(sessionData.memories).length === 0) {
document.getElementById('content-body').innerHTML = `
<div class="empty-state">
<div class="icon">📝</div>
<h3>No memories stored</h3>
<p>AI agents haven't saved any notes yet</p>
</div>
`;
return;
}
const memoriesHTML = Object.entries(sessionData.memories).map(([player, memory]) => `
<div class="memory-card">
<div class="player-name">Player ${player.toUpperCase()}</div>
<div class="memory-text">"${escapeHtml(memory)}"</div>
</div>
`).join('');
document.getElementById('content-body').innerHTML = memoriesHTML;
}
function updateActiveNav() {
// Remove all active classes
document.querySelectorAll('.nav-item').forEach(item => {
item.classList.remove('active');
});
// Add active class to current view
if (currentView === 'chat' || currentView === 'memories') {
const items = document.querySelectorAll('.nav-item');
items.forEach(item => {
if (item.textContent.includes(currentView === 'chat' ? 'Chat' : 'Memories')) {
item.classList.add('active');
}
});
}
}
function showEmptyState(title, message) {
document.getElementById('content-title').textContent = 'AI Catan Viewer';
document.getElementById('content-body').innerHTML = `
<div class="empty-state">
<div class="icon">🎮</div>
<h3>${title}</h3>
<p>${message}</p>
</div>
`;
}
function escapeHtml(text) {
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
}
// Initial load and auto-refresh
loadData();
setInterval(loadData, 1000);
</script>
</body>
</html>