agent-blizzard / index.html
williamblizzard's picture
Add 3 files
0f15e0c verified
Raw History Blame Contribute Delete
25.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mistral Agent Builder - Local AI Development</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.pulse-animation {
animation: pulse 2s infinite;
}
.terminal-font {
font-family: 'Courier New', monospace;
}
.gradient-bg {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.message-animation {
transition: all 0.3s ease;
transform: translateY(10px);
opacity: 0;
}
.message-animation.show {
transform: translateY(0);
opacity: 1;
}
.waveform {
display: flex;
align-items: center;
height: 40px;
gap: 2px;
}
.wave-bar {
width: 3px;
background-color: #3b82f6;
border-radius: 3px;
transition: height 0.2s ease;
}
</style>
</head>
<body class="gradient-bg text-gray-100 min-h-screen flex flex-col">
<header class="border-b border-gray-700 p-4 flex justify-between items-center">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-full bg-blue-600 flex items-center justify-center">
<i class="fas fa-robot text-white"></i>
</div>
<h1 class="text-xl font-bold">Mistral Agent Builder</h1>
</div>
<div class="flex items-center space-x-4">
<div class="flex items-center space-x-2 text-sm">
<div class="w-2 h-2 rounded-full bg-green-500"></div>
<span>Local Mode</span>
</div>
<button id="settings-btn" class="p-2 rounded-full hover:bg-gray-700">
<i class="fas fa-cog"></i>
</button>
</div>
</header>
<div class="flex flex-1 overflow-hidden">
<!-- Sidebar -->
<aside class="w-64 border-r border-gray-700 p-4 hidden md:block overflow-y-auto">
<div class="mb-6">
<h2 class="text-lg font-semibold mb-3">Agent Projects</h2>
<div class="space-y-2">
<button class="w-full text-left px-3 py-2 rounded hover:bg-gray-700 flex items-center justify-between">
<span>Web Assistant</span>
<i class="fas fa-chevron-right text-xs"></i>
</button>
<button class="w-full text-left px-3 py-2 rounded hover:bg-gray-700 flex items-center justify-between">
<span>API Generator</span>
<i class="fas fa-chevron-right text-xs"></i>
</button>
<button class="w-full text-left px-3 py-2 rounded bg-gray-700 hover:bg-gray-600 flex items-center justify-between">
<span>New Project</span>
<i class="fas fa-plus text-xs"></i>
</button>
</div>
</div>
<div class="mb-6">
<h2 class="text-lg font-semibold mb-3">Tools</h2>
<div class="space-y-2">
<button class="w-full text-left px-3 py-2 rounded hover:bg-gray-700 flex items-center space-x-2">
<i class="fas fa-terminal"></i>
<span>Terminal</span>
</button>
<button class="w-full text-left px-3 py-2 rounded hover:bg-gray-700 flex items-center space-x-2">
<i class="fas fa-code"></i>
<span>Code Editor</span>
</button>
<button class="w-full text-left px-3 py-2 rounded hover:bg-gray-700 flex items-center space-x-2">
<i class="fas fa-database"></i>
<span>Database</span>
</button>
</div>
</div>
<div>
<h2 class="text-lg font-semibold mb-3">System Status</h2>
<div class="space-y-3">
<div>
<div class="flex justify-between text-sm mb-1">
<span>CPU Usage</span>
<span id="cpu-usage">25%</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-blue-500 h-2 rounded-full" style="width: 25%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-sm mb-1">
<span>Memory</span>
<span id="memory-usage">4.2/8 GB</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-green-500 h-2 rounded-full" style="width: 52%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-sm mb-1">
<span>GPU (Metal)</span>
<span id="gpu-usage">15%</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-purple-500 h-2 rounded-full" style="width: 15%"></div>
</div>
</div>
</div>
</div>
</aside>
<!-- Main Content -->
<main class="flex-1 flex flex-col overflow-hidden">
<!-- Chat Header -->
<div class="border-b border-gray-700 p-4 flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Agent Builder Chat</h2>
<p class="text-sm text-gray-400">Mistral 7B - Uncensored Local Instance</p>
</div>
<div class="flex space-x-3">
<button id="voice-toggle" class="p-2 rounded-full bg-blue-600 hover:bg-blue-700">
<i class="fas fa-microphone"></i>
</button>
<button id="new-chat" class="p-2 rounded-full hover:bg-gray-700">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<!-- Chat Messages -->
<div id="chat-messages" class="flex-1 overflow-y-auto p-4 space-y-4">
<div class="message-animation show">
<div class="flex items-start space-x-3">
<div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center">
<i class="fas fa-robot text-white text-sm"></i>
</div>
<div class="flex-1">
<div class="bg-gray-800 rounded-lg p-4">
<p>Hello! I'm your local Mistral 7B AI assistant running on your MacBook. I'm uncensored and unrestricted, ready to help you build agents and SaaS applications. What would you like to create today?</p>
</div>
<div class="mt-2 flex space-x-4 text-sm text-gray-400">
<button class="hover:text-blue-400"><i class="fas fa-copy mr-1"></i> Copy</button>
<button class="hover:text-blue-400"><i class="fas fa-thumbs-up mr-1"></i> Like</button>
<button class="hover:text-blue-400"><i class="fas fa-thumbs-down mr-1"></i> Dislike</button>
</div>
</div>
</div>
</div>
</div>
<!-- Input Area -->
<div class="border-t border-gray-700 p-4">
<div class="relative">
<textarea id="message-input" rows="2" class="w-full bg-gray-800 rounded-lg p-3 pr-12 focus:outline-none focus:ring-2 focus:ring-blue-600 resize-none terminal-font" placeholder="Type your message or press the mic to speak..."></textarea>
<div class="absolute right-3 bottom-3 flex space-x-2">
<button id="send-btn" class="p-2 rounded-full bg-blue-600 hover:bg-blue-700">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
<div id="voice-ui" class="hidden mt-3">
<div class="flex items-center justify-center space-x-4">
<div id="waveform" class="waveform">
<!-- Waveform bars will be generated here -->
</div>
<button id="stop-voice" class="px-4 py-2 bg-red-600 rounded-lg hover:bg-red-700">
<i class="fas fa-stop mr-2"></i> Stop
</button>
</div>
<p id="voice-status" class="text-center text-sm text-gray-400 mt-2">Listening...</p>
</div>
</div>
</main>
</div>
<!-- Settings Modal -->
<div id="settings-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-gray-800 rounded-lg w-full max-w-2xl max-h-[90vh] overflow-y-auto">
<div class="p-4 border-b border-gray-700 flex justify-between items-center">
<h3 class="text-lg font-semibold">Settings</h3>
<button id="close-settings" class="p-2 rounded-full hover:bg-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-4 space-y-6">
<div>
<h4 class="font-medium mb-3">Model Configuration</h4>
<div class="space-y-4">
<div>
<label class="block text-sm text-gray-400 mb-1">Model Path</label>
<div class="flex space-x-2">
<input type="text" value="~/models/mistral-7b-instruct-v0.1.Q4_K_M.gguf" class="flex-1 bg-gray-700 rounded p-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-600">
<button class="px-3 bg-gray-700 rounded hover:bg-gray-600"><i class="fas fa-folder-open"></i></button>
</div>
</div>
<div>
<label class="block text-sm text-gray-400 mb-1">Context Size</label>
<select class="w-full bg-gray-700 rounded p-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-600">
<option>2048 (Default)</option>
<option>4096</option>
<option>8192</option>
</select>
</div>
<div class="flex items-center space-x-3">
<input type="checkbox" id="gpu-accel" class="rounded text-blue-600 focus:ring-blue-600" checked>
<label for="gpu-accel" class="text-sm">Enable GPU Acceleration (Metal)</label>
</div>
</div>
</div>
<div>
<h4 class="font-medium mb-3">Automatic Detection</h4>
<div class="space-y-3">
<div class="flex items-center space-x-3">
<input type="checkbox" id="auto-detect-backend" class="rounded text-blue-600 focus:ring-blue-600" checked>
<label for="auto-detect-backend" class="text-sm">Auto-detect backend services</label>
</div>
<div class="flex items-center space-x-3">
<input type="checkbox" id="auto-detect-frontend" class="rounded text-blue-600 focus:ring-blue-600" checked>
<label for="auto-detect-frontend" class="text-sm">Auto-detect frontend frameworks</label>
</div>
<div class="flex items-center space-x-3">
<input type="checkbox" id="auto-connect" class="rounded text-blue-600 focus:ring-blue-600" checked>
<label for="auto-connect" class="text-sm">Auto-connect to detected services</label>
</div>
</div>
</div>
<div>
<h4 class="font-medium mb-3">Voice Settings</h4>
<div class="space-y-3">
<div>
<label class="block text-sm text-gray-400 mb-1">Input Device</label>
<select class="w-full bg-gray-700 rounded p-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-600">
<option>Default Microphone</option>
<option>Built-in Microphone</option>
</select>
</div>
<div>
<label class="block text-sm text-gray-400 mb-1">Voice Response</label>
<select class="w-full bg-gray-700 rounded p-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-600">
<option>Disabled</option>
<option>System Voice (Default)</option>
<option>Custom TTS</option>
</select>
</div>
</div>
</div>
</div>
<div class="p-4 border-t border-gray-700 flex justify-end space-x-3">
<button id="cancel-settings" class="px-4 py-2 rounded hover:bg-gray-700">Cancel</button>
<button id="save-settings" class="px-4 py-2 bg-blue-600 rounded hover:bg-blue-700">Save Changes</button>
</div>
</div>
</div>
<script>
// DOM Elements
const messageInput = document.getElementById('message-input');
const sendBtn = document.getElementById('send-btn');
const chatMessages = document.getElementById('chat-messages');
const voiceToggle = document.getElementById('voice-toggle');
const voiceUI = document.getElementById('voice-ui');
const waveform = document.getElementById('waveform');
const stopVoice = document.getElementById('stop-voice');
const voiceStatus = document.getElementById('voice-status');
const settingsBtn = document.getElementById('settings-btn');
const settingsModal = document.getElementById('settings-modal');
const closeSettings = document.getElementById('close-settings');
const cancelSettings = document.getElementById('cancel-settings');
const saveSettings = document.getElementById('save-settings');
const newChatBtn = document.getElementById('new-chat');
// Generate waveform bars
for (let i = 0; i < 30; i++) {
const bar = document.createElement('div');
bar.className = 'wave-bar';
bar.style.height = `${Math.random() * 20 + 5}px`;
waveform.appendChild(bar);
}
// Animate waveform
let waveInterval;
function startWaveAnimation() {
waveInterval = setInterval(() => {
const bars = document.querySelectorAll('.wave-bar');
bars.forEach(bar => {
bar.style.height = `${Math.random() * 20 + 5}px`;
});
}, 200);
}
function stopWaveAnimation() {
clearInterval(waveInterval);
const bars = document.querySelectorAll('.wave-bar');
bars.forEach(bar => {
bar.style.height = '5px';
});
}
// Voice recognition
let recognition;
let isListening = false;
function startVoiceRecognition() {
voiceUI.classList.remove('hidden');
voiceToggle.classList.add('bg-blue-700');
startWaveAnimation();
// In a real app, this would use the Web Speech API
// For this demo, we'll simulate it
isListening = true;
voiceStatus.textContent = "Listening... Speak now";
// Simulate speech detection after 3 seconds
setTimeout(() => {
if (isListening) {
const simulatedText = "Create a new agent that can scrape websites and summarize the content";
messageInput.value = simulatedText;
voiceStatus.textContent = "Processing...";
setTimeout(() => {
stopVoiceRecognition();
sendMessage();
}, 1000);
}
}, 3000);
}
function stopVoiceRecognition() {
voiceUI.classList.add('hidden');
voiceToggle.classList.remove('bg-blue-700');
stopWaveAnimation();
isListening = false;
}
// Toggle voice recognition
voiceToggle.addEventListener('click', () => {
if (voiceUI.classList.contains('hidden')) {
startVoiceRecognition();
} else {
stopVoiceRecognition();
}
});
stopVoice.addEventListener('click', stopVoiceRecognition);
// Settings modal
settingsBtn.addEventListener('click', () => {
settingsModal.classList.remove('hidden');
});
closeSettings.addEventListener('click', () => {
settingsModal.classList.add('hidden');
});
cancelSettings.addEventListener('click', () => {
settingsModal.classList.add('hidden');
});
saveSettings.addEventListener('click', () => {
// In a real app, save settings here
settingsModal.classList.add('hidden');
alert('Settings saved! (This is a demo)');
});
// New chat
newChatBtn.addEventListener('click', () => {
if (chatMessages.children.length > 1) {
if (confirm('Start a new chat? Your current chat will be cleared.')) {
while (chatMessages.children.length > 1) {
chatMessages.removeChild(chatMessages.lastChild);
}
messageInput.value = '';
}
}
});
// Send message
function sendMessage() {
const message = messageInput.value.trim();
if (message === '') return;
// Add user message
addMessage(message, 'user');
messageInput.value = '';
// Simulate AI response
setTimeout(() => {
const responses = [
"I can help you create that agent. First, let's decide what framework to use. Would you prefer Python with BeautifulSoup or JavaScript with Puppeteer?",
"For web scraping and summarization, I recommend using Python with BeautifulSoup for scraping and Mistral 7B for summarization. Would you like me to generate the initial code structure?",
"That's a great agent idea! I can help you build a solution that scrapes websites, extracts the main content, and provides concise summaries. Let's start by defining the requirements.",
"I've detected you have Python installed. We can create a virtual environment and install the necessary packages: `pip install beautifulsoup4 requests transformers torch`"
];
const randomResponse = responses[Math.floor(Math.random() * responses.length)];
addMessage(randomResponse, 'ai');
}, 1000 + Math.random() * 2000);
}
function addMessage(text, sender) {
const messageDiv = document.createElement('div');
messageDiv.className = 'message-animation';
if (sender === 'user') {
messageDiv.innerHTML = `
<div class="flex items-start space-x-3 justify-end">
<div class="flex-1 max-w-3xl">
<div class="bg-blue-600 rounded-lg p-4">
<p>${text}</p>
</div>
</div>
<div class="w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center">
<i class="fas fa-user text-white text-sm"></i>
</div>
</div>
`;
} else {
messageDiv.innerHTML = `
<div class="flex items-start space-x-3">
<div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center">
<i class="fas fa-robot text-white text-sm"></i>
</div>
<div class="flex-1">
<div class="bg-gray-800 rounded-lg p-4">
<p>${text}</p>
</div>
<div class="mt-2 flex space-x-4 text-sm text-gray-400">
<button class="hover:text-blue-400 copy-btn"><i class="fas fa-copy mr-1"></i> Copy</button>
<button class="hover:text-blue-400"><i class="fas fa-thumbs-up mr-1"></i> Like</button>
<button class="hover:text-blue-400"><i class="fas fa-thumbs-down mr-1"></i> Dislike</button>
</div>
</div>
</div>
`;
}
chatMessages.appendChild(messageDiv);
setTimeout(() => {
messageDiv.classList.add('show');
}, 10);
// Scroll to bottom
chatMessages.scrollTop = chatMessages.scrollHeight;
// Add copy functionality
if (sender === 'ai') {
setTimeout(() => {
const copyBtn = messageDiv.querySelector('.copy-btn');
copyBtn.addEventListener('click', () => {
navigator.clipboard.writeText(text);
copyBtn.innerHTML = '<i class="fas fa-check mr-1"></i> Copied!';
setTimeout(() => {
copyBtn.innerHTML = '<i class="fas fa-copy mr-1"></i> Copy';
}, 2000);
});
}, 100);
}
}
// Event listeners
sendBtn.addEventListener('click', sendMessage);
messageInput.addEventListener('keydown', (e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
sendMessage();
}
});
// Simulate system status updates
function updateSystemStatus() {
const cpu = Math.min(90, Math.floor(Math.random() * 30) + 10);
const memory = Math.min(7.5, 4 + Math.random() * 2).toFixed(1);
const gpu = Math.min(80, Math.floor(Math.random() * 20) + 5);
document.getElementById('cpu-usage').textContent = `${cpu}%`;
document.querySelector('#cpu-usage + div > div').style.width = `${cpu}%`;
document.getElementById('memory-usage').textContent = `${memory}/8 GB`;
document.querySelector('#memory-usage + div > div').style.width = `${(memory / 8) * 100}%`;
document.getElementById('gpu-usage').textContent = `${gpu}%`;
document.querySelector('#gpu-usage + div > div').style.width = `${gpu}%`;
}
setInterval(updateSystemStatus, 3000);
updateSystemStatus();
// Initial welcome message
setTimeout(() => {
addMessage("I've detected your system has Python 3.9 and Node.js installed. I can help you build agents using either ecosystem. Which would you prefer to use?", 'ai');
}, 1500);
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=williamblizzard/agent-blizzard" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>