diff --git a/app.js b/app.js index 21c5c222..e9de42b7 100644 --- a/app.js +++ b/app.js @@ -1,3 +1,5 @@ +shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory +chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory import * as THREE from 'three'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; @@ -1982,24 +1984,67 @@ function setupControls() { document.getElementById('chat-quick-actions').addEventListener('click', (e) => { const btn = e.target.closest('.quick-action-btn'); if (!btn) return; - - const action = btn.dataset.action; - - switch(action) { - case 'status': - sendChatMessage("Timmy, what is the current system status?"); - break; - case 'agents': - sendChatMessage("Timmy, check on all active agents."); - break; - case 'portals': - openPortalAtlas(); - break; - case 'help': - sendChatMessage("Timmy, I need assistance with Nexus navigation."); - break; - } + handleQuickAction(btn.dataset.action); }); + +// ═══ QUICK ACTION HANDLER ═══ +function handleQuickAction(action) { + switch(action) { + case 'status': { + const portalCount = portals.length; + const onlinePortals = portals.filter(p => p.userData && p.userData.status === 'online').length; + const agentCount = agents.length; + const wsState = wsConnected ? 'ONLINE' : 'OFFLINE'; + const wsColor = wsConnected ? '#4af0c0' : '#ff4466'; + addChatMessage('system', `[SYSTEM STATUS]`); + addChatMessage('timmy', `Nexus operational. ${portalCount} portals registered (${onlinePortals} online). ${agentCount} agent presences active. Hermes WebSocket: ${wsState}. Navigation mode: ${NAV_MODES[navModeIdx].toUpperCase()}. Performance tier: ${performanceTier.toUpperCase()}.`); + break; + } + case 'agents': { + addChatMessage('system', `[AGENT ROSTER]`); + if (agents.length === 0) { + addChatMessage('timmy', 'No active agent presences detected in the Nexus. The thought stream and harness pulse are the primary indicators of system activity.'); + } else { + const roster = agents.map(a => `- ${(a.userData && a.userData.name) || a.name || 'Unknown'}: ${(a.userData && a.userData.status) || 'active'}`).join('\n'); + addChatMessage('timmy', `Active agents:\n${roster}`); + } + break; + } + case 'portals': + openPortalAtlas(); + break; + case 'heartbeat': { + const agentLog = document.getElementById('agent-log-content'); + const recentEntries = agentLog ? agentLog.querySelectorAll('.agent-log-entry') : []; + const entryCount = recentEntries.length; + addChatMessage('system', `[HEARTBEAT INSPECTION]`); + addChatMessage('timmy', `Hermes heartbeat ${wsConnected ? 'active' : 'inactive'}. ${entryCount} recent entries in thought stream. WebSocket reconnect timer: ${wsReconnectTimer ? 'active' : 'idle'}. Harness pulse mesh: ${harnessPulseMesh ? 'rendering' : 'standby'}.`); + break; + } + case 'thoughts': { + const agentLog = document.getElementById('agent-log-content'); + const entries = agentLog ? Array.from(agentLog.querySelectorAll('.agent-log-entry')).slice(0, 5) : []; + addChatMessage('system', `[THOUGHT STREAM]`); + if (entries.length === 0) { + addChatMessage('timmy', 'The thought stream is quiet. No recent agent entries detected.'); + } else { + const summary = entries.map(e => '> ' + e.textContent.trim()).join('\n'); + addChatMessage('timmy', `Recent thoughts:\n${summary}`); + } + break; + } + case 'help': { + addChatMessage('system', `[NEXUS HELP]`); + addChatMessage('timmy', `Navigation: WASD to move, mouse to look around.\n` + + `Press V to cycle: Walk / Orbit / Fly mode.\n` + + `Enter to chat. Escape to close overlays.\n` + + `Press F near a portal to enter. Press E near a vision point to read.\n` + + `Press Tab for Portal Atlas.\n` + + `The Batcave Terminal shows system logs. The Workshop Terminal shows tool output.`); + break; + } + } +} document.getElementById('portal-close-btn').addEventListener('click', closePortalOverlay); document.getElementById('vision-close-btn').addEventListener('click', closeVisionOverlay); diff --git a/index.html b/index.html index 54ada489..eb7db81f 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,5 @@ +shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory +chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
@@ -143,10 +145,39 @@