async function renderChat() {
const content = document.getElementById('pageContent');
content.innerHTML = `
${escapeHtml(msg.content)}
`;
container.appendChild(div);
});
container.scrollTop = container.scrollHeight;
}
function clearChat() {
document.querySelectorAll('#chatMessages .chat-message').forEach(el => el.remove());
const welcome = document.querySelector('.chat-welcome');
if (welcome) welcome.style.display = '';
window._chatHistory = [];
}
function sendQuickPrompt(agent, message) {
selectAgent(agent);
document.getElementById('chatInput').value = message;
sendChatMessage();
}