Compare commits

..

2 commits

Author SHA1 Message Date
iris
42437f9c6a agent UI: show 🖥 screen link when gui_enabled
index.html: add hidden #screen-link anchor (/screen, new tab).
app.js: reveal it in refreshState() when api/state returns gui_enabled=true.

gui_enabled is set by the harness when /etc/hyperhive/gui.json exists
(written by the weston VNC service from issue #50). The link opens the
RFB viewer from issue #51 in a new tab.

Closes #52
2026-05-20 14:39:11 +02:00
iris
e448db2c34 harness: add /screen page and /screen/ws WebSocket VNC relay
Reads /etc/hyperhive/gui.json at startup to get the VNC port written
by the weston-vnc ExecStart script (issue #50). Adds:
- gui_vnc_port: Option<u16> on AppState
- gui_enabled: bool on StateSnapshot (for issue #52 screen link)
- GET /screen: serves a minimal RFB-over-WebSocket viewer (screen.html)
- GET /screen/ws: upgrades to WebSocket and byte-pumps to 127.0.0.1:<vnc_port>

The relay is a pure two-task byte pump (WS→TCP and TCP→WS), transparent
to any RFB variant including VeNCrypt. Returns 404 when gui is not
enabled.

screen.html is a self-contained RFB client: handshake, FramebufferUpdate
(Raw encoding), pointer and keyboard forwarding — enough to display the
desktop and interact with it. noVNC assets (issue #52) replace this.

Closes #51
2026-05-20 14:39:11 +02:00
2 changed files with 8 additions and 1 deletions

View file

@ -670,6 +670,9 @@
const s = await resp.json();
if (!headerSet) { setHeader(s.label, s.dashboard_port); headerSet = true; }
currentLabel = s.label;
// Show the screen link when the weston VNC compositor is enabled.
const screenLink = $('screen-link');
if (screenLink) screenLink.style.display = s.gui_enabled ? '' : 'none';
renderTermInput(s.label, s.status === 'online');
renderInbox(s.inbox || []);
// Authoritative state comes from the harness via /api/state.

View file

@ -8,7 +8,11 @@
<body>
<pre class="banner" id="banner">░▒▓█▓▒░ … ░▒▓█▓▒░ hyperhive ag3nt ░▒▓█▓▒░</pre>
<h2 id="title">◆ … ◆</h2>
<p class="meta"><a href="/stats" style="color: var(--cyan); text-decoration: none;">📊 stats →</a></p>
<p class="meta">
<a href="/stats" style="color: var(--cyan); text-decoration: none;">📊 stats →</a>
<a id="screen-link" href="/screen" target="_blank" rel="noopener"
style="display:none; color: var(--cyan); text-decoration: none; margin-left: 1em;">🖥 screen →</a>
</p>
<div id="status">
<p class="meta">loading…</p>