mo commited on
Commit ·
241f98c
1
Parent(s): 352ddbd
feat(dashboard): single-key enterprise UI — mona.expert only
Browse filesRemoves all provider-key machinery from the control plane UI: no
provider vault, no Add Key flow, no third-party keys anywhere. One key
(mona.expert) and one brain (mona.expert engine) — the engine assigns
models and issues all direction. Dashboard shows engine branding and a
security panel stating the invariant.
- platform/dashboard/app.js +32 -124
- platform/dashboard/index.html +21 -72
- platform/dashboard/style.css +7 -0
platform/dashboard/app.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
*
|
| 4 |
-
* Single
|
| 5 |
-
*
|
|
|
|
| 6 |
*/
|
| 7 |
|
| 8 |
const API = '/api';
|
|
@@ -28,7 +29,6 @@ function setupNavigation() {
|
|
| 28 |
}
|
| 29 |
|
| 30 |
function setupForms() {
|
| 31 |
-
// Create agent
|
| 32 |
document.getElementById('create-agent-form').addEventListener('submit', async (e) => {
|
| 33 |
e.preventDefault();
|
| 34 |
const form = e.target;
|
|
@@ -54,31 +54,6 @@ function setupForms() {
|
|
| 54 |
alert(`Failed to create agent: ${err.message}`);
|
| 55 |
}
|
| 56 |
});
|
| 57 |
-
|
| 58 |
-
// Add key
|
| 59 |
-
document.getElementById('add-key-form').addEventListener('submit', async (e) => {
|
| 60 |
-
e.preventDefault();
|
| 61 |
-
const form = e.target;
|
| 62 |
-
const data = {
|
| 63 |
-
provider: form.provider.value,
|
| 64 |
-
label: form.label.value || `${form.provider.value}-key`,
|
| 65 |
-
key: form.key.value
|
| 66 |
-
};
|
| 67 |
-
|
| 68 |
-
try {
|
| 69 |
-
const res = await fetch(`${API}/keys`, {
|
| 70 |
-
method: 'POST',
|
| 71 |
-
headers: { 'Content-Type': 'application/json' },
|
| 72 |
-
body: JSON.stringify(data)
|
| 73 |
-
});
|
| 74 |
-
if (!res.ok) throw new Error((await res.json()).error);
|
| 75 |
-
hideAddKey();
|
| 76 |
-
form.reset();
|
| 77 |
-
loadKeys();
|
| 78 |
-
} catch (err) {
|
| 79 |
-
alert(`Failed to add key: ${err.message}`);
|
| 80 |
-
}
|
| 81 |
-
});
|
| 82 |
}
|
| 83 |
|
| 84 |
// ── WebSocket ──────────────────────────────────────────────────────
|
|
@@ -88,27 +63,19 @@ function connectWS() {
|
|
| 88 |
|
| 89 |
ws = new WebSocket(wsUrl);
|
| 90 |
|
| 91 |
-
ws.onopen = () =>
|
| 92 |
-
updateStatus('connected', 'Connected');
|
| 93 |
-
};
|
| 94 |
-
|
| 95 |
ws.onmessage = (event) => {
|
| 96 |
try {
|
| 97 |
-
|
| 98 |
-
handleWSMessage(msg);
|
| 99 |
} catch (err) {
|
| 100 |
console.error('WS parse error:', err);
|
| 101 |
}
|
| 102 |
};
|
| 103 |
-
|
| 104 |
ws.onclose = () => {
|
| 105 |
updateStatus('disconnected', 'Disconnected');
|
| 106 |
setTimeout(connectWS, 3000);
|
| 107 |
};
|
| 108 |
-
|
| 109 |
-
ws.onerror = () => {
|
| 110 |
-
updateStatus('disconnected', 'Connection error');
|
| 111 |
-
};
|
| 112 |
}
|
| 113 |
|
| 114 |
function handleWSMessage(msg) {
|
|
@@ -118,31 +85,22 @@ function handleWSMessage(msg) {
|
|
| 118 |
break;
|
| 119 |
case 'agent:registered':
|
| 120 |
case 'agent:disconnected':
|
| 121 |
-
if (currentPage === 'dashboard') loadDashboard();
|
| 122 |
-
if (currentPage === 'agents') loadAgents();
|
| 123 |
-
break;
|
| 124 |
case 'agent:status':
|
| 125 |
if (currentPage === 'dashboard') loadDashboard();
|
| 126 |
if (currentPage === 'agents') loadAgents();
|
| 127 |
break;
|
| 128 |
case 'agent:chat':
|
| 129 |
-
if (chatAgentId === msg.agentId)
|
| 130 |
-
addChatMessage('agent', msg.message);
|
| 131 |
-
}
|
| 132 |
break;
|
| 133 |
case 'agent:error':
|
| 134 |
-
if (chatAgentId === msg.agentId)
|
| 135 |
-
addChatMessage('error', msg.error);
|
| 136 |
-
}
|
| 137 |
break;
|
| 138 |
}
|
| 139 |
}
|
| 140 |
|
| 141 |
function updateStatus(status, text) {
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
dot.className = 'status-dot ' + status;
|
| 145 |
-
label.textContent = text;
|
| 146 |
}
|
| 147 |
|
| 148 |
// ── Navigation ─────────────────────────────────────────────────────
|
|
@@ -158,7 +116,6 @@ function loadPage(page) {
|
|
| 158 |
switch (page) {
|
| 159 |
case 'dashboard': loadDashboard(); break;
|
| 160 |
case 'agents': loadAgents(); break;
|
| 161 |
-
case 'keys': loadKeys(); break;
|
| 162 |
case 'audit': loadAudit(); break;
|
| 163 |
case 'settings': loadSettings(); break;
|
| 164 |
}
|
|
@@ -172,23 +129,22 @@ async function loadDashboard() {
|
|
| 172 |
|
| 173 |
document.getElementById('stat-agents').textContent = sys.agentsRunning || 0;
|
| 174 |
document.getElementById('stat-total').textContent = sys.agentsTotal || 0;
|
| 175 |
-
document.getElementById('stat-
|
| 176 |
-
|
| 177 |
-
const uptime = sys.uptime ? formatUptime(sys.uptime) : '—';
|
| 178 |
-
document.getElementById('stat-uptime').textContent = uptime;
|
| 179 |
|
| 180 |
-
// Recent activity
|
| 181 |
const auditRes = await fetch(`${API}/audit?limit=10`);
|
| 182 |
const audit = await auditRes.json();
|
| 183 |
const container = document.getElementById('recent-activity');
|
|
|
|
| 184 |
if (audit.length === 0) {
|
| 185 |
-
container.innerHTML = '<p class="muted">No activity yet. Create an agent
|
|
|
|
| 186 |
} else {
|
|
|
|
| 187 |
container.innerHTML = audit.map(entry => `
|
| 188 |
<div class="activity-item">
|
| 189 |
<span class="activity-icon">${eventIcon(entry.type)}</span>
|
| 190 |
<span>${formatEvent(entry)}</span>
|
| 191 |
-
<span
|
| 192 |
</div>
|
| 193 |
`).join('');
|
| 194 |
}
|
|
@@ -214,7 +170,7 @@ async function loadAgents() {
|
|
| 214 |
<div class="agent-card-header">
|
| 215 |
<div>
|
| 216 |
<div class="agent-name">${esc(agent.name)}</div>
|
| 217 |
-
<div class="agent-model">${esc(agent.model)}</div>
|
| 218 |
</div>
|
| 219 |
<span class="agent-status ${agent.status}">${agent.status}</span>
|
| 220 |
</div>
|
|
@@ -263,8 +219,8 @@ function hideCreateAgent() {
|
|
| 263 |
// ── Chat ───────────────────────────────────────────────────────────
|
| 264 |
function openChat(agentId, name) {
|
| 265 |
chatAgentId = agentId;
|
| 266 |
-
document.getElementById('chat-title').textContent =
|
| 267 |
-
document.getElementById('chat-messages').innerHTML = '';
|
| 268 |
document.getElementById('chat-panel').classList.add('open');
|
| 269 |
document.getElementById('chat-input').focus();
|
| 270 |
}
|
|
@@ -289,11 +245,8 @@ async function sendChat() {
|
|
| 289 |
body: JSON.stringify({ message })
|
| 290 |
});
|
| 291 |
const data = await res.json();
|
| 292 |
-
if (data.error)
|
| 293 |
-
|
| 294 |
-
} else if (data.reply) {
|
| 295 |
-
addChatMessage('agent', data.reply);
|
| 296 |
-
}
|
| 297 |
} catch (err) {
|
| 298 |
addChatMessage('error', `Connection error: ${err.message}`);
|
| 299 |
}
|
|
@@ -301,6 +254,8 @@ async function sendChat() {
|
|
| 301 |
|
| 302 |
function addChatMessage(role, text) {
|
| 303 |
const container = document.getElementById('chat-messages');
|
|
|
|
|
|
|
| 304 |
const div = document.createElement('div');
|
| 305 |
div.className = `chat-msg ${role}`;
|
| 306 |
div.textContent = text;
|
|
@@ -308,47 +263,6 @@ function addChatMessage(role, text) {
|
|
| 308 |
container.scrollTop = container.scrollHeight;
|
| 309 |
}
|
| 310 |
|
| 311 |
-
// ── Keys ───────────────────────────────────────────────────────────
|
| 312 |
-
async function loadKeys() {
|
| 313 |
-
try {
|
| 314 |
-
const res = await fetch(`${API}/keys`);
|
| 315 |
-
const keys = await res.json();
|
| 316 |
-
const container = document.getElementById('keys-list');
|
| 317 |
-
|
| 318 |
-
if (keys.length === 0) {
|
| 319 |
-
container.innerHTML = '<p class="muted">No API keys stored. Add your first key to enable agents.</p>';
|
| 320 |
-
return;
|
| 321 |
-
}
|
| 322 |
-
|
| 323 |
-
container.innerHTML = keys.map(key => `
|
| 324 |
-
<div class="key-card">
|
| 325 |
-
<div class="key-info">
|
| 326 |
-
<div class="key-provider">${esc(key.provider)}</div>
|
| 327 |
-
<div class="key-label">${esc(key.label)}</div>
|
| 328 |
-
</div>
|
| 329 |
-
<div class="key-masked">${esc(key.masked)}</div>
|
| 330 |
-
<button class="btn btn-danger btn-sm" onclick="deleteKey('${key.id}')">Remove</button>
|
| 331 |
-
</div>
|
| 332 |
-
`).join('');
|
| 333 |
-
} catch (err) {
|
| 334 |
-
console.error('Keys error:', err);
|
| 335 |
-
}
|
| 336 |
-
}
|
| 337 |
-
|
| 338 |
-
async function deleteKey(id) {
|
| 339 |
-
if (!confirm('Remove this API key? Agents using it will fail.')) return;
|
| 340 |
-
await fetch(`${API}/keys/${id}`, { method: 'DELETE' });
|
| 341 |
-
loadKeys();
|
| 342 |
-
}
|
| 343 |
-
|
| 344 |
-
function showAddKey() {
|
| 345 |
-
document.getElementById('add-key-modal').classList.add('open');
|
| 346 |
-
}
|
| 347 |
-
|
| 348 |
-
function hideAddKey() {
|
| 349 |
-
document.getElementById('add-key-modal').classList.remove('open');
|
| 350 |
-
}
|
| 351 |
-
|
| 352 |
// ── Audit ──────────────────────────────────────────────────────────
|
| 353 |
async function loadAudit() {
|
| 354 |
try {
|
|
@@ -382,8 +296,8 @@ async function loadSettings() {
|
|
| 382 |
const sys = await res.json();
|
| 383 |
|
| 384 |
document.getElementById('setting-docker').textContent = sys.docker?.available
|
| 385 |
-
? `
|
| 386 |
-
: '
|
| 387 |
|
| 388 |
document.getElementById('setting-url').textContent = location.origin;
|
| 389 |
document.getElementById('setting-data-dir').textContent = 'data/ (SQLite)';
|
|
@@ -417,17 +331,15 @@ function timeAgo(ts) {
|
|
| 417 |
}
|
| 418 |
|
| 419 |
function eventIcon(type) {
|
| 420 |
-
if (type.startsWith('llm:')) return '
|
| 421 |
-
if (type.startsWith('agent:')) return '
|
| 422 |
-
if (type.startsWith('key:')) return '🔑';
|
| 423 |
if (type.startsWith('tool:')) return '🔧';
|
| 424 |
-
return '
|
| 425 |
}
|
| 426 |
|
| 427 |
function eventTypeClass(type) {
|
| 428 |
if (type.startsWith('llm:')) return 'llm';
|
| 429 |
if (type.startsWith('agent:')) return 'agent';
|
| 430 |
-
if (type.startsWith('key:')) return 'key';
|
| 431 |
if (type.startsWith('tool:')) return 'tool';
|
| 432 |
if (type.includes('error')) return 'error';
|
| 433 |
return '';
|
|
@@ -437,11 +349,11 @@ function formatEvent(entry) {
|
|
| 437 |
const d = entry.data || {};
|
| 438 |
switch (entry.type) {
|
| 439 |
case 'llm:call':
|
| 440 |
-
return `
|
| 441 |
case 'llm:proxy':
|
| 442 |
-
return `
|
| 443 |
case 'llm:proxy:error':
|
| 444 |
-
return `
|
| 445 |
case 'agent:create':
|
| 446 |
return `Agent "${d.name}" created`;
|
| 447 |
case 'agent:start':
|
|
@@ -456,10 +368,6 @@ function formatEvent(entry) {
|
|
| 456 |
return `Error: ${d.error}`;
|
| 457 |
case 'tool:executed':
|
| 458 |
return `Tool "${d.tool}" executed`;
|
| 459 |
-
case 'key:create':
|
| 460 |
-
return `API key added for ${d.provider}`;
|
| 461 |
-
case 'key:delete':
|
| 462 |
-
return `API key removed (${d.id})`;
|
| 463 |
default:
|
| 464 |
return JSON.stringify(d).substring(0, 100);
|
| 465 |
}
|
|
|
|
| 1 |
/**
|
| 2 |
+
* mona.expert — Dashboard SPA
|
| 3 |
*
|
| 4 |
+
* Single brain. Single key.
|
| 5 |
+
* All reasoning and direction comes from the mona.expert engine.
|
| 6 |
+
* This UI never asks for or stores any provider key.
|
| 7 |
*/
|
| 8 |
|
| 9 |
const API = '/api';
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
function setupForms() {
|
|
|
|
| 32 |
document.getElementById('create-agent-form').addEventListener('submit', async (e) => {
|
| 33 |
e.preventDefault();
|
| 34 |
const form = e.target;
|
|
|
|
| 54 |
alert(`Failed to create agent: ${err.message}`);
|
| 55 |
}
|
| 56 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
// ── WebSocket ──────────────────────────────────────────────────────
|
|
|
|
| 63 |
|
| 64 |
ws = new WebSocket(wsUrl);
|
| 65 |
|
| 66 |
+
ws.onopen = () => updateStatus('connected', 'Connected');
|
|
|
|
|
|
|
|
|
|
| 67 |
ws.onmessage = (event) => {
|
| 68 |
try {
|
| 69 |
+
handleWSMessage(JSON.parse(event.data));
|
|
|
|
| 70 |
} catch (err) {
|
| 71 |
console.error('WS parse error:', err);
|
| 72 |
}
|
| 73 |
};
|
|
|
|
| 74 |
ws.onclose = () => {
|
| 75 |
updateStatus('disconnected', 'Disconnected');
|
| 76 |
setTimeout(connectWS, 3000);
|
| 77 |
};
|
| 78 |
+
ws.onerror = () => updateStatus('disconnected', 'Connection error');
|
|
|
|
|
|
|
|
|
|
| 79 |
}
|
| 80 |
|
| 81 |
function handleWSMessage(msg) {
|
|
|
|
| 85 |
break;
|
| 86 |
case 'agent:registered':
|
| 87 |
case 'agent:disconnected':
|
|
|
|
|
|
|
|
|
|
| 88 |
case 'agent:status':
|
| 89 |
if (currentPage === 'dashboard') loadDashboard();
|
| 90 |
if (currentPage === 'agents') loadAgents();
|
| 91 |
break;
|
| 92 |
case 'agent:chat':
|
| 93 |
+
if (chatAgentId === msg.agentId) addChatMessage('agent', msg.message);
|
|
|
|
|
|
|
| 94 |
break;
|
| 95 |
case 'agent:error':
|
| 96 |
+
if (chatAgentId === msg.agentId) addChatMessage('error', msg.error);
|
|
|
|
|
|
|
| 97 |
break;
|
| 98 |
}
|
| 99 |
}
|
| 100 |
|
| 101 |
function updateStatus(status, text) {
|
| 102 |
+
document.getElementById('status-dot').className = 'status-dot ' + status;
|
| 103 |
+
document.getElementById('status-text').textContent = text;
|
|
|
|
|
|
|
| 104 |
}
|
| 105 |
|
| 106 |
// ── Navigation ─────────────────────────────────────────────────────
|
|
|
|
| 116 |
switch (page) {
|
| 117 |
case 'dashboard': loadDashboard(); break;
|
| 118 |
case 'agents': loadAgents(); break;
|
|
|
|
| 119 |
case 'audit': loadAudit(); break;
|
| 120 |
case 'settings': loadSettings(); break;
|
| 121 |
}
|
|
|
|
| 129 |
|
| 130 |
document.getElementById('stat-agents').textContent = sys.agentsRunning || 0;
|
| 131 |
document.getElementById('stat-total').textContent = sys.agentsTotal || 0;
|
| 132 |
+
document.getElementById('stat-uptime').textContent = sys.uptime ? formatUptime(sys.uptime) : '—';
|
|
|
|
|
|
|
|
|
|
| 133 |
|
|
|
|
| 134 |
const auditRes = await fetch(`${API}/audit?limit=10`);
|
| 135 |
const audit = await auditRes.json();
|
| 136 |
const container = document.getElementById('recent-activity');
|
| 137 |
+
const count = document.getElementById('activity-count');
|
| 138 |
if (audit.length === 0) {
|
| 139 |
+
container.innerHTML = '<p class="muted">No activity yet. Create an agent to get started.</p>';
|
| 140 |
+
count.textContent = '';
|
| 141 |
} else {
|
| 142 |
+
count.textContent = `${audit.length} latest`;
|
| 143 |
container.innerHTML = audit.map(entry => `
|
| 144 |
<div class="activity-item">
|
| 145 |
<span class="activity-icon">${eventIcon(entry.type)}</span>
|
| 146 |
<span>${formatEvent(entry)}</span>
|
| 147 |
+
<span class="activity-time">${timeAgo(entry.timestamp)}</span>
|
| 148 |
</div>
|
| 149 |
`).join('');
|
| 150 |
}
|
|
|
|
| 170 |
<div class="agent-card-header">
|
| 171 |
<div>
|
| 172 |
<div class="agent-name">${esc(agent.name)}</div>
|
| 173 |
+
<div class="agent-model">engine · ${esc(agent.model)}</div>
|
| 174 |
</div>
|
| 175 |
<span class="agent-status ${agent.status}">${agent.status}</span>
|
| 176 |
</div>
|
|
|
|
| 219 |
// ── Chat ───────────────────────────────────────────────────────────
|
| 220 |
function openChat(agentId, name) {
|
| 221 |
chatAgentId = agentId;
|
| 222 |
+
document.getElementById('chat-title').textContent = name;
|
| 223 |
+
document.getElementById('chat-messages').innerHTML = '<p class="muted chat-empty">Send a message to start talking with this agent.</p>';
|
| 224 |
document.getElementById('chat-panel').classList.add('open');
|
| 225 |
document.getElementById('chat-input').focus();
|
| 226 |
}
|
|
|
|
| 245 |
body: JSON.stringify({ message })
|
| 246 |
});
|
| 247 |
const data = await res.json();
|
| 248 |
+
if (data.error) addChatMessage('error', data.error);
|
| 249 |
+
else if (data.reply) addChatMessage('agent', data.reply);
|
|
|
|
|
|
|
|
|
|
| 250 |
} catch (err) {
|
| 251 |
addChatMessage('error', `Connection error: ${err.message}`);
|
| 252 |
}
|
|
|
|
| 254 |
|
| 255 |
function addChatMessage(role, text) {
|
| 256 |
const container = document.getElementById('chat-messages');
|
| 257 |
+
const empty = container.querySelector('.chat-empty');
|
| 258 |
+
if (empty) empty.remove();
|
| 259 |
const div = document.createElement('div');
|
| 260 |
div.className = `chat-msg ${role}`;
|
| 261 |
div.textContent = text;
|
|
|
|
| 263 |
container.scrollTop = container.scrollHeight;
|
| 264 |
}
|
| 265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
// ── Audit ──────────────────────────────────────────────────────────
|
| 267 |
async function loadAudit() {
|
| 268 |
try {
|
|
|
|
| 296 |
const sys = await res.json();
|
| 297 |
|
| 298 |
document.getElementById('setting-docker').textContent = sys.docker?.available
|
| 299 |
+
? `Available (${sys.docker.containers || 0} containers)`
|
| 300 |
+
: 'Not running — agents run as local processes';
|
| 301 |
|
| 302 |
document.getElementById('setting-url').textContent = location.origin;
|
| 303 |
document.getElementById('setting-data-dir').textContent = 'data/ (SQLite)';
|
|
|
|
| 331 |
}
|
| 332 |
|
| 333 |
function eventIcon(type) {
|
| 334 |
+
if (type.startsWith('llm:')) return '◈';
|
| 335 |
+
if (type.startsWith('agent:')) return '✦';
|
|
|
|
| 336 |
if (type.startsWith('tool:')) return '🔧';
|
| 337 |
+
return '≡';
|
| 338 |
}
|
| 339 |
|
| 340 |
function eventTypeClass(type) {
|
| 341 |
if (type.startsWith('llm:')) return 'llm';
|
| 342 |
if (type.startsWith('agent:')) return 'agent';
|
|
|
|
| 343 |
if (type.startsWith('tool:')) return 'tool';
|
| 344 |
if (type.includes('error')) return 'error';
|
| 345 |
return '';
|
|
|
|
| 349 |
const d = entry.data || {};
|
| 350 |
switch (entry.type) {
|
| 351 |
case 'llm:call':
|
| 352 |
+
return `Engine call to ${d.model || 'brain'} — ${d.messageCount || 0} messages, ${d.tokenUsage?.total || 0} tokens`;
|
| 353 |
case 'llm:proxy':
|
| 354 |
+
return `Engine reasoning for agent ${d.agentId} — ${d.messageCount || 0} messages`;
|
| 355 |
case 'llm:proxy:error':
|
| 356 |
+
return `Engine error for ${d.agentId}: ${d.error}`;
|
| 357 |
case 'agent:create':
|
| 358 |
return `Agent "${d.name}" created`;
|
| 359 |
case 'agent:start':
|
|
|
|
| 368 |
return `Error: ${d.error}`;
|
| 369 |
case 'tool:executed':
|
| 370 |
return `Tool "${d.tool}" executed`;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
default:
|
| 372 |
return JSON.stringify(d).substring(0, 100);
|
| 373 |
}
|
platform/dashboard/index.html
CHANGED
|
@@ -27,9 +27,6 @@
|
|
| 27 |
<li class="nav-item" data-page="agents">
|
| 28 |
<span class="nav-icon">✦</span><span class="nav-label">Agents</span>
|
| 29 |
</li>
|
| 30 |
-
<li class="nav-item" data-page="keys">
|
| 31 |
-
<span class="nav-icon">🔑</span><span class="nav-label">Provider Keys</span>
|
| 32 |
-
</li>
|
| 33 |
<li class="nav-item" data-page="audit">
|
| 34 |
<span class="nav-icon">≡</span><span class="nav-label">Audit Log</span>
|
| 35 |
</li>
|
|
@@ -52,7 +49,7 @@
|
|
| 52 |
<div class="page-head">
|
| 53 |
<div>
|
| 54 |
<h1>Dashboard</h1>
|
| 55 |
-
<p class="page-sub">
|
| 56 |
</div>
|
| 57 |
<span class="live-badge"><span class="live-dot"></span> LIVE</span>
|
| 58 |
</div>
|
|
@@ -69,9 +66,9 @@
|
|
| 69 |
<div class="stat-label">Total Agents</div>
|
| 70 |
</div>
|
| 71 |
<div class="stat-card">
|
| 72 |
-
<div class="stat-icon stat-icon-cyan">
|
| 73 |
-
<div class="stat-value
|
| 74 |
-
<div class="stat-label">
|
| 75 |
</div>
|
| 76 |
<div class="stat-card">
|
| 77 |
<div class="stat-icon stat-icon-amber">◔</div>
|
|
@@ -96,7 +93,7 @@
|
|
| 96 |
<div class="page-head">
|
| 97 |
<div>
|
| 98 |
<h1>Agents</h1>
|
| 99 |
-
<p class="page-sub">
|
| 100 |
</div>
|
| 101 |
<button class="btn btn-primary" onclick="showCreateAgent()">+ New Agent</button>
|
| 102 |
</div>
|
|
@@ -115,17 +112,9 @@
|
|
| 115 |
<label>Name</label>
|
| 116 |
<input type="text" name="name" placeholder="My Agent" required>
|
| 117 |
|
| 118 |
-
<label>
|
| 119 |
-
<
|
| 120 |
-
|
| 121 |
-
<option value="openai/gpt-4.5-preview">OpenAI GPT-4.5</option>
|
| 122 |
-
<option value="openai/o4-mini">OpenAI o4-mini</option>
|
| 123 |
-
<option value="anthropic/claude-sonnet-4-20250514">Claude Sonnet 4</option>
|
| 124 |
-
<option value="anthropic/claude-opus-4-20250514">Claude Opus 4</option>
|
| 125 |
-
<option value="google/gemini-2.5-flash">Gemini 2.5 Flash</option>
|
| 126 |
-
<option value="google/gemini-2.5-pro">Gemini 2.5 Pro</option>
|
| 127 |
-
<option value="deepseek/deepseek-chat">DeepSeek V4</option>
|
| 128 |
-
</select>
|
| 129 |
|
| 130 |
<label>System Prompt <span class="opt">optional</span></label>
|
| 131 |
<textarea name="systemPrompt" rows="3" placeholder="You are a helpful AI agent…"></textarea>
|
|
@@ -165,62 +154,12 @@
|
|
| 165 |
</div>
|
| 166 |
</div>
|
| 167 |
|
| 168 |
-
<!-- Provider Keys Page -->
|
| 169 |
-
<div class="page" id="page-keys">
|
| 170 |
-
<div class="page-head">
|
| 171 |
-
<div>
|
| 172 |
-
<h1>Provider Keys</h1>
|
| 173 |
-
<p class="page-sub">Cloud vault — devices never see these</p>
|
| 174 |
-
</div>
|
| 175 |
-
<button class="btn btn-primary" onclick="showAddKey()">+ Add Key</button>
|
| 176 |
-
</div>
|
| 177 |
-
<div class="key-note">
|
| 178 |
-
<span class="key-note-icon">🛡</span>
|
| 179 |
-
<div>
|
| 180 |
-
Keys are encrypted at rest and stay in the cloud vault. The platform proxies every LLM call —
|
| 181 |
-
<strong>the only key a device ever holds is its MONA key.</strong>
|
| 182 |
-
</div>
|
| 183 |
-
</div>
|
| 184 |
-
<div id="keys-list" class="keys-list">
|
| 185 |
-
<p class="muted">Loading keys…</p>
|
| 186 |
-
</div>
|
| 187 |
-
|
| 188 |
-
<div class="modal" id="add-key-modal">
|
| 189 |
-
<div class="modal-backdrop" onclick="hideAddKey()"></div>
|
| 190 |
-
<div class="modal-content">
|
| 191 |
-
<div class="modal-head">
|
| 192 |
-
<h3>Add Provider Key</h3>
|
| 193 |
-
<button class="btn-close" onclick="hideAddKey()">✕</button>
|
| 194 |
-
</div>
|
| 195 |
-
<form id="add-key-form">
|
| 196 |
-
<label>Provider</label>
|
| 197 |
-
<select name="provider">
|
| 198 |
-
<option value="openai">OpenAI</option>
|
| 199 |
-
<option value="anthropic">Anthropic</option>
|
| 200 |
-
<option value="google">Google</option>
|
| 201 |
-
<option value="deepseek">DeepSeek</option>
|
| 202 |
-
<option value="openrouter">OpenRouter</option>
|
| 203 |
-
</select>
|
| 204 |
-
<label>Label <span class="opt">optional</span></label>
|
| 205 |
-
<input type="text" name="label" placeholder="My OpenAI key">
|
| 206 |
-
<label>API Key</label>
|
| 207 |
-
<input type="password" name="key" placeholder="sk-…" required autocomplete="off">
|
| 208 |
-
<p class="form-hint">Encrypted before storage. It never leaves the platform.</p>
|
| 209 |
-
<div class="modal-actions">
|
| 210 |
-
<button type="button" class="btn btn-ghost" onclick="hideAddKey()">Cancel</button>
|
| 211 |
-
<button type="submit" class="btn btn-primary">Save Key</button>
|
| 212 |
-
</div>
|
| 213 |
-
</form>
|
| 214 |
-
</div>
|
| 215 |
-
</div>
|
| 216 |
-
</div>
|
| 217 |
-
|
| 218 |
<!-- Audit Page -->
|
| 219 |
<div class="page" id="page-audit">
|
| 220 |
<div class="page-head">
|
| 221 |
<div>
|
| 222 |
<h1>Audit Log</h1>
|
| 223 |
-
<p class="page-sub">Every
|
| 224 |
</div>
|
| 225 |
<select id="audit-filter-type" class="filter-select" onchange="loadAudit()">
|
| 226 |
<option value="">All Events</option>
|
|
@@ -230,8 +169,6 @@
|
|
| 230 |
<option value="agent:start">Agent Started</option>
|
| 231 |
<option value="agent:stop">Agent Stopped</option>
|
| 232 |
<option value="tool:executed">Tool Executed</option>
|
| 233 |
-
<option value="key:create">Key Added</option>
|
| 234 |
-
<option value="key:delete">Key Removed</option>
|
| 235 |
<option value="agent:log">Agent Log</option>
|
| 236 |
<option value="agent:error">Agent Error</option>
|
| 237 |
</select>
|
|
@@ -264,10 +201,22 @@
|
|
| 264 |
<span class="setting-value" id="setting-data-dir">—</span>
|
| 265 |
</div>
|
| 266 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
<div class="card">
|
| 268 |
<div class="card-head"><h3>About</h3></div>
|
| 269 |
<p>mona.expert control plane v1.0.0</p>
|
| 270 |
<p class="muted">Open-source AI agent platform. MIT licensed.</p>
|
|
|
|
| 271 |
</div>
|
| 272 |
</div>
|
| 273 |
</main>
|
|
|
|
| 27 |
<li class="nav-item" data-page="agents">
|
| 28 |
<span class="nav-icon">✦</span><span class="nav-label">Agents</span>
|
| 29 |
</li>
|
|
|
|
|
|
|
|
|
|
| 30 |
<li class="nav-item" data-page="audit">
|
| 31 |
<span class="nav-icon">≡</span><span class="nav-label">Audit Log</span>
|
| 32 |
</li>
|
|
|
|
| 49 |
<div class="page-head">
|
| 50 |
<div>
|
| 51 |
<h1>Dashboard</h1>
|
| 52 |
+
<p class="page-sub">Powered by the mona.expert engine</p>
|
| 53 |
</div>
|
| 54 |
<span class="live-badge"><span class="live-dot"></span> LIVE</span>
|
| 55 |
</div>
|
|
|
|
| 66 |
<div class="stat-label">Total Agents</div>
|
| 67 |
</div>
|
| 68 |
<div class="stat-card">
|
| 69 |
+
<div class="stat-icon stat-icon-cyan">◈</div>
|
| 70 |
+
<div class="stat-value stat-static">mona.expert</div>
|
| 71 |
+
<div class="stat-label">AI Engine</div>
|
| 72 |
</div>
|
| 73 |
<div class="stat-card">
|
| 74 |
<div class="stat-icon stat-icon-amber">◔</div>
|
|
|
|
| 93 |
<div class="page-head">
|
| 94 |
<div>
|
| 95 |
<h1>Agents</h1>
|
| 96 |
+
<p class="page-sub">Directed by the mona.expert engine</p>
|
| 97 |
</div>
|
| 98 |
<button class="btn btn-primary" onclick="showCreateAgent()">+ New Agent</button>
|
| 99 |
</div>
|
|
|
|
| 112 |
<label>Name</label>
|
| 113 |
<input type="text" name="name" placeholder="My Agent" required>
|
| 114 |
|
| 115 |
+
<label>Brain</label>
|
| 116 |
+
<div class="brain-note">mona.expert engine — model auto-assigned</div>
|
| 117 |
+
<input type="hidden" name="model" value="openai/gpt-4o">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
<label>System Prompt <span class="opt">optional</span></label>
|
| 120 |
<textarea name="systemPrompt" rows="3" placeholder="You are a helpful AI agent…"></textarea>
|
|
|
|
| 154 |
</div>
|
| 155 |
</div>
|
| 156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
<!-- Audit Page -->
|
| 158 |
<div class="page" id="page-audit">
|
| 159 |
<div class="page-head">
|
| 160 |
<div>
|
| 161 |
<h1>Audit Log</h1>
|
| 162 |
+
<p class="page-sub">Every command from the engine, every execution</p>
|
| 163 |
</div>
|
| 164 |
<select id="audit-filter-type" class="filter-select" onchange="loadAudit()">
|
| 165 |
<option value="">All Events</option>
|
|
|
|
| 169 |
<option value="agent:start">Agent Started</option>
|
| 170 |
<option value="agent:stop">Agent Stopped</option>
|
| 171 |
<option value="tool:executed">Tool Executed</option>
|
|
|
|
|
|
|
| 172 |
<option value="agent:log">Agent Log</option>
|
| 173 |
<option value="agent:error">Agent Error</option>
|
| 174 |
</select>
|
|
|
|
| 201 |
<span class="setting-value" id="setting-data-dir">—</span>
|
| 202 |
</div>
|
| 203 |
</div>
|
| 204 |
+
<div class="card">
|
| 205 |
+
<div class="card-head"><h3>Security</h3></div>
|
| 206 |
+
<div class="setting-row">
|
| 207 |
+
<span class="setting-label">Device key</span>
|
| 208 |
+
<span class="setting-value">mona.expert key only</span>
|
| 209 |
+
</div>
|
| 210 |
+
<div class="setting-row">
|
| 211 |
+
<span class="setting-label">Provider keys</span>
|
| 212 |
+
<span class="setting-value setting-good">none — engine handles everything</span>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
<div class="card">
|
| 216 |
<div class="card-head"><h3>About</h3></div>
|
| 217 |
<p>mona.expert control plane v1.0.0</p>
|
| 218 |
<p class="muted">Open-source AI agent platform. MIT licensed.</p>
|
| 219 |
+
<p class="muted">One key. One brain. mona.expert.</p>
|
| 220 |
</div>
|
| 221 |
</div>
|
| 222 |
</main>
|
platform/dashboard/style.css
CHANGED
|
@@ -384,3 +384,10 @@ body {
|
|
| 384 |
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
|
| 385 |
|
| 386 |
.muted { color: var(--muted); font-size: 13px; padding: 8px 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
|
| 385 |
|
| 386 |
.muted { color: var(--muted); font-size: 13px; padding: 8px 0; }
|
| 387 |
+
|
| 388 |
+
.brain-note {
|
| 389 |
+
background: rgba(124,92,255,0.08); border: 1px dashed rgba(124,92,255,0.35);
|
| 390 |
+
color: var(--violet); border-radius: var(--radius-sm);
|
| 391 |
+
padding: 9px 12px; font-size: 12.5px; font-weight: 500;
|
| 392 |
+
}
|
| 393 |
+
.setting-good { color: var(--green); }
|