const browser = require('../browser'); module.exports = async ({ message = 'Action', duration = 2000 }) => { await browser.start(); const p = await browser.ensurePage(); await p.evaluate(({ msg, dur }) => { let toast = document.getElementById('mcp-action-toast'); if (!toast) { const toastEl = document.createElement('div'); toastEl.id = 'mcp-action-toast'; toastEl.style.cssText = ` position: fixed; top: 20px; right: 20px; padding: 12px 20px; background: rgba(16, 185, 129, 0.95); color: white; border-radius: 8px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px; z-index: 999999; transform: translateX(120%); transition: transform 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.2); `; document.body.appendChild(toastEl); toast = toastEl; } toast.textContent = msg; toast.style.transform = 'translateX(0)'; setTimeout(() => { toast.style.transform = 'translateX(120%)'; }, dur); }, { msg: message, dur: duration }); return { success: true, action: 'show_toast', message }; };