Compare commits
1 Commits
mimo/build
...
mimo/build
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff3691e81e |
89
app.js
89
app.js
@@ -55,6 +55,11 @@ let _clickStartX = 0, _clickStartY = 0; // Mnemosyne: click-vs-drag detection
|
||||
let loadProgress = 0;
|
||||
let performanceTier = 'high';
|
||||
|
||||
/** Escape HTML entities for safe innerHTML insertion. */
|
||||
function escHtml(s) {
|
||||
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
||||
}
|
||||
|
||||
// ═══ HERMES WS STATE ═══
|
||||
let hermesWs = null;
|
||||
let wsReconnectTimer = null;
|
||||
@@ -65,6 +70,8 @@ let evenniaConnected = false;
|
||||
let evenniaStaleTimer = null;
|
||||
const EVENNIA_STALE_MS = 60000; // mark stale after 60s without update
|
||||
let recentToolOutputs = [];
|
||||
let actionStreamEntries = []; // Evennia command/result flow for action stream panel
|
||||
let actionStreamRoom = ''; // Current room from movement events
|
||||
let workshopPanelCtx = null;
|
||||
let workshopPanelTexture = null;
|
||||
let workshopPanelCanvas = null;
|
||||
@@ -72,9 +79,6 @@ let workshopScanMat = null;
|
||||
let workshopPanelRefreshTimer = 0;
|
||||
let lastFocusedPortal = null;
|
||||
|
||||
// ═══ VISITOR / OPERATOR MODE ═══
|
||||
let uiMode = 'visitor'; // 'visitor' | 'operator'
|
||||
|
||||
// ═══ NAVIGATION SYSTEM ═══
|
||||
const NAV_MODES = ['walk', 'orbit', 'fly'];
|
||||
let navModeIdx = 0;
|
||||
@@ -781,7 +785,6 @@ async function init() {
|
||||
|
||||
enterPrompt.addEventListener('click', () => {
|
||||
enterPrompt.classList.add('fade-out');
|
||||
document.body.classList.add('visitor-mode');
|
||||
document.getElementById('hud').style.display = 'block';
|
||||
const erpPanel = document.getElementById('evennia-room-panel');
|
||||
if (erpPanel) erpPanel.style.display = 'block';
|
||||
@@ -1874,18 +1877,6 @@ function createAmbientStructures() {
|
||||
}
|
||||
|
||||
// ═══ NAVIGATION MODE ═══
|
||||
// ═══ VISITOR / OPERATOR MODE TOGGLE ═══
|
||||
function toggleUIMode() {
|
||||
uiMode = uiMode === 'visitor' ? 'operator' : 'visitor';
|
||||
document.body.classList.remove('visitor-mode', 'operator-mode');
|
||||
document.body.classList.add(uiMode + '-mode');
|
||||
const label = document.getElementById('mode-label');
|
||||
const icon = document.querySelector('#mode-toggle-btn .hud-icon');
|
||||
if (label) label.textContent = uiMode === 'visitor' ? 'VISITOR' : 'OPERATOR';
|
||||
if (icon) icon.textContent = uiMode === 'visitor' ? '👁' : '⚙';
|
||||
addChatMessage('system', `Switched to ${uiMode.toUpperCase()} mode.`);
|
||||
}
|
||||
|
||||
function cycleNavMode() {
|
||||
navModeIdx = (navModeIdx + 1) % NAV_MODES.length;
|
||||
const mode = NAV_MODES[navModeIdx];
|
||||
@@ -2082,7 +2073,6 @@ function setupControls() {
|
||||
document.getElementById('portal-close-btn').addEventListener('click', closePortalOverlay);
|
||||
document.getElementById('vision-close-btn').addEventListener('click', closeVisionOverlay);
|
||||
|
||||
document.getElementById('mode-toggle-btn').addEventListener('click', toggleUIMode);
|
||||
document.getElementById('atlas-toggle-btn').addEventListener('click', openPortalAtlas);
|
||||
document.getElementById('atlas-close-btn').addEventListener('click', closePortalAtlas);
|
||||
initAtlasControls();
|
||||
@@ -2233,6 +2223,71 @@ function handleHermesMessage(data) {
|
||||
}
|
||||
} else if (data.type && data.type.startsWith('evennia.')) {
|
||||
handleEvenniaEvent(data);
|
||||
// Evennia event bridge — process command/result/room fields if present
|
||||
handleEvenniaEvent(data);
|
||||
}
|
||||
|
||||
|
||||
// ═══════════════════════════════════════════
|
||||
// TIMMY ACTION STREAM — EVENNIA COMMAND FLOW
|
||||
// ═══════════════════════════════════════════
|
||||
|
||||
const MAX_ACTION_STREAM = 8;
|
||||
|
||||
/**
|
||||
* Add an entry to the action stream panel.
|
||||
* @param {'cmd'|'result'|'room'} type
|
||||
* @param {string} text
|
||||
*/
|
||||
function addActionStreamEntry(type, text) {
|
||||
const entry = { type, text, ts: Date.now() };
|
||||
actionStreamEntries.unshift(entry);
|
||||
if (actionStreamEntries.length > MAX_ACTION_STREAM) actionStreamEntries.pop();
|
||||
renderActionStream();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the current room display in the action stream.
|
||||
* @param {string} room
|
||||
*/
|
||||
function setActionStreamRoom(room) {
|
||||
actionStreamRoom = room;
|
||||
const el = document.getElementById('action-stream-room');
|
||||
if (el) el.textContent = room ? `◈ ${room}` : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the action stream panel entries.
|
||||
*/
|
||||
function renderActionStream() {
|
||||
const el = document.getElementById('action-stream-content');
|
||||
if (!el) return;
|
||||
el.innerHTML = actionStreamEntries.map(e => {
|
||||
const ts = new Date(e.ts).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
||||
const cls = e.type === 'cmd' ? 'as-cmd' : e.type === 'result' ? 'as-result' : 'as-room';
|
||||
const prefix = e.type === 'cmd' ? '>' : e.type === 'result' ? '←' : '◈';
|
||||
return `<div class="as-entry ${cls}"><span class="as-prefix">${prefix}</span> <span class="as-text">${escHtml(e.text)}</span> <span class="as-ts">${ts}</span></div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Evennia-specific fields from Hermes WS messages.
|
||||
* Called from handleHermesMessage for any message carrying evennia metadata.
|
||||
*/
|
||||
function handleEvenniaEvent(data) {
|
||||
if (data.evennia_command) {
|
||||
addActionStreamEntry('cmd', data.evennia_command);
|
||||
}
|
||||
if (data.evennia_result) {
|
||||
const excerpt = typeof data.evennia_result === 'string'
|
||||
? data.evennia_result.substring(0, 120)
|
||||
: JSON.stringify(data.evennia_result).substring(0, 120);
|
||||
addActionStreamEntry('result', excerpt);
|
||||
}
|
||||
if (data.evennia_room) {
|
||||
setActionStreamRoom(data.evennia_room);
|
||||
addActionStreamEntry('room', `Moved to: ${data.evennia_room}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
12
index.html
12
index.html
@@ -155,9 +155,6 @@
|
||||
<button id="soul-toggle-btn" class="hud-icon-btn" title="Timmy's SOUL">
|
||||
<span class="hud-icon">✦</span>
|
||||
<span class="hud-btn-label">SOUL</span>
|
||||
<button id="mode-toggle-btn" class="hud-icon-btn mode-toggle" title="Toggle Mode">
|
||||
<span class="hud-icon">👁</span>
|
||||
<span class="hud-btn-label" id="mode-label">VISITOR</span>
|
||||
</button>
|
||||
<button id="atlas-toggle-btn" class="hud-icon-btn" title="Portal Atlas">
|
||||
<span class="hud-icon">🌐</span>
|
||||
@@ -173,6 +170,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Timmy Action Stream (Evennia command/result flow) -->
|
||||
<div id="action-stream" class="action-stream">
|
||||
<div class="action-stream-header">
|
||||
<span class="action-stream-icon">⚡</span> TIMMY ACTION STREAM
|
||||
</div>
|
||||
<div id="action-stream-room" class="action-stream-room"></div>
|
||||
<div id="action-stream-content" class="action-stream-content"></div>
|
||||
</div>
|
||||
|
||||
<!-- Bottom: Chat Interface -->
|
||||
<div id="chat-panel" class="chat-panel">
|
||||
<div class="chat-header">
|
||||
|
||||
140
style.css
140
style.css
@@ -849,6 +849,70 @@ canvas#nexus-canvas {
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
/* Timmy Action Stream (Evennia command/result flow) — issue #729 */
|
||||
.action-stream {
|
||||
position: absolute;
|
||||
bottom: 200px;
|
||||
right: var(--space-3);
|
||||
width: 320px;
|
||||
max-height: 260px;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
backdrop-filter: blur(8px);
|
||||
border-left: 2px solid var(--color-gold);
|
||||
padding: var(--space-3);
|
||||
font-size: 10px;
|
||||
font-family: var(--font-mono);
|
||||
pointer-events: none;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.action-stream-header {
|
||||
font-family: var(--font-display);
|
||||
color: var(--color-gold);
|
||||
letter-spacing: 0.1em;
|
||||
font-size: 10px;
|
||||
margin-bottom: var(--space-2);
|
||||
opacity: 0.9;
|
||||
}
|
||||
.action-stream-icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.action-stream-room {
|
||||
color: var(--color-primary);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
margin-bottom: var(--space-1);
|
||||
opacity: 0.9;
|
||||
}
|
||||
.action-stream-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
.as-entry {
|
||||
animation: log-fade-in 0.4s ease-out forwards;
|
||||
opacity: 0;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.as-cmd .as-prefix { color: var(--color-gold); font-weight: 700; }
|
||||
.as-cmd .as-text { color: var(--color-gold); opacity: 0.85; }
|
||||
.as-result .as-prefix { color: var(--color-primary); font-weight: 700; }
|
||||
.as-result .as-text { color: var(--color-text-muted); }
|
||||
.as-room .as-prefix { color: var(--color-secondary); font-weight: 700; }
|
||||
.as-room .as-text { color: var(--color-secondary); opacity: 0.8; }
|
||||
.as-ts {
|
||||
color: var(--color-text-muted);
|
||||
opacity: 0.4;
|
||||
font-size: 9px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Vision Hint */
|
||||
.vision-hint {
|
||||
position: absolute;
|
||||
@@ -1252,6 +1316,10 @@ canvas#nexus-canvas {
|
||||
.hud-agent-log {
|
||||
width: 220px;
|
||||
}
|
||||
.action-stream {
|
||||
width: 240px;
|
||||
bottom: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@@ -2497,75 +2565,3 @@ canvas#nexus-canvas {
|
||||
.soul-link a:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════
|
||||
VISITOR / OPERATOR MODE
|
||||
═══════════════════════════════════════════════════════ */
|
||||
|
||||
.mode-toggle {
|
||||
border-color: #4af0c0 !important;
|
||||
}
|
||||
|
||||
.mode-toggle .hud-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#mode-label {
|
||||
color: #4af0c0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Visitor mode: hide operator-only panels */
|
||||
body.visitor-mode .gofai-hud,
|
||||
body.visitor-mode .hud-debug,
|
||||
body.visitor-mode .hud-agent-log,
|
||||
body.visitor-mode .archive-health-dashboard,
|
||||
body.visitor-mode .memory-feed,
|
||||
body.visitor-mode .memory-inspect-panel,
|
||||
body.visitor-mode .memory-connections-panel,
|
||||
body.visitor-mode .memory-filter,
|
||||
body.visitor-mode #mem-palace-container,
|
||||
body.visitor-mode #mem-palace-controls,
|
||||
body.visitor-mode #mempalace-results,
|
||||
body.visitor-mode .nexus-footer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Visitor mode: simplify bannerlord status */
|
||||
body.visitor-mode #bannerlord-status {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Visitor mode: add a subtle visitor badge */
|
||||
body.visitor-mode .hud-location::after {
|
||||
content: '⬡ VISITOR';
|
||||
margin-left: 12px;
|
||||
font-size: 9px;
|
||||
letter-spacing: 0.15em;
|
||||
color: #4af0c0;
|
||||
opacity: 0.7;
|
||||
font-family: 'Orbitron', sans-serif;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Operator mode: add operator badge */
|
||||
body.operator-mode .hud-location::after {
|
||||
content: '⬢ OPERATOR';
|
||||
margin-left: 12px;
|
||||
font-size: 9px;
|
||||
letter-spacing: 0.15em;
|
||||
color: #ffd700;
|
||||
opacity: 0.8;
|
||||
font-family: 'Orbitron', sans-serif;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Operator mode: golden accent on toggle */
|
||||
body.operator-mode .mode-toggle {
|
||||
border-color: #ffd700 !important;
|
||||
}
|
||||
|
||||
body.operator-mode #mode-label {
|
||||
color: #ffd700;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user