Files
plugins/packages/agent-office/page/index.html
T
Zhaoji Wang 5150142eb2 agent-office: a Settings switch for agents from other computers and gateway keys (#741)
agent-office: a Settings switch, "Include agents from other computers
and gateway keys", sets options.remote, so the gateway hook keeps
requests that are not local. It is off by default (package default
remote:false, the page reads opts.remote === true, the hook
opts?.remote === true). While it is off the hook counts the non-local
requests it drops (capped at 9999) into the snapshot, and an empty
office says they were ignored and where the switch is, in all nine
languages. Adapted by frederick-wang from QingJ01/magpie-agent-office#5.
Merged onto #740 with the page stamps taken again (a7a5bce6).

Run at the reviewed head a7a5bce6, on mote:
- HOME=<scratch> bun test packages/agent-office: 183 pass, 0 fail,
  34 more times (20 of them four at a time, load ~30). The first run
  of this head had 2 fails whose names were lost to tail; not seen
  again in the 34.
- stamp-page.mjs --check: 0 (every ?v= checked against sha256);
  bun scripts/check.mjs agent-office: 0.
- Broken by hand: dropping the dropped++ turns 2 tests red. Turning
  remote on by default in the hook's track() turned nothing red; a
  guard test follows in the version bump.
- Playwright 1.62.0, Chromium and WebKit, light and dark, stub bridge,
  live.js with dropped:2 and no sessions: the empty state gives the
  hint; ticking the switch hides it, options.set receives remote:true
  after the 2.5s save, and a reload with those options shows the box
  ticked and no hint.

Not tried: a real remote agent or gateway key through a real magpie.
2026-11-05 09:42:49 +08:00

118 lines
6.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Agent Office</title>
<link rel="stylesheet" href="style.css?v=f600355d91db">
<script src="_magpie/bridge.js"></script>
<script src="agents.js?v=d958111cd669"></script>
<script src="model.js?v=b04e2020da2a"></script>
<script src="icons.js?v=e918b44d46c2"></script>
<script src="scene.js?v=097cc0a3eec6"></script>
<script src="three.min.js?v=5b5a0ae404b6"></script>
<script src="scene3d.js?v=b666062a087d"></script>
<script src="app.js?v=54035e24dbb8" defer></script>
</head>
<body>
<main class="card" id="card">
<header class="top">
<h1><span class="eyes" aria-hidden="true"><i></i><i></i></span><span data-t="title">What are my agents doing</span><span class="live" id="live"><i></i><span data-t="live">live</span></span></h1>
<div class="counts" id="counts">
<span class="count need"><i></i><span data-t="needYou">Need you</span> <b id="nNeed">0</b></span>
<span class="count work"><i></i><span data-t="working">Working</span> <b id="nWork">0</b></span>
<span class="count done"><i></i><span data-t="doneN">Done</span> <b id="nDone">0</b></span>
</div>
</header>
<nav class="bar">
<div class="seg dark" role="tablist" id="modes">
<button type="button" role="tab" data-mode="office" data-t="office">Office</button>
<button type="button" role="tab" data-mode="list" data-t="list">List</button>
</div>
<div class="seg plain" role="tablist" id="dims">
<button type="button" role="tab" data-dim="2d">2D</button>
<button type="button" role="tab" data-dim="iso">ISO</button>
<button type="button" role="tab" data-dim="3d">3D</button>
</div>
<span class="note" id="note"></span>
<span class="grow"></span>
<div class="tools">
<div class="menu-wrap">
<button type="button" class="btn" id="todayBtn" aria-haspopup="true" aria-expanded="false"><span data-t="today">Today</span> <span class="today-tokens" id="todayTokens"></span></button>
<div class="menu today-panel" id="todayMenu" hidden></div>
</div>
<button type="button" class="btn" id="sideBtn" aria-pressed="true"><span data-t="panel">Panel</span></button>
<button type="button" class="btn" id="pip" data-t="pip">Picture in picture</button>
<div class="menu-wrap">
<button type="button" class="btn" id="settingsBtn" aria-haspopup="true" aria-expanded="false"><span data-t="settings">Settings</span><svg class="chev" viewBox="0 0 10 6" width="10" height="6" aria-hidden="true"><path d="M1.25 1.25L5 4.75L8.75 1.25" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
<div class="menu wide" id="settings" hidden>
<label class="row"><input type="checkbox" id="optDemo"> <span data-t="demo">Sample agents</span></label>
<label class="row"><input type="checkbox" id="optDone"> <span data-t="showDone">Show finished agents</span></label>
<label class="row"><input type="checkbox" id="optRemote"> <span data-t="remote">Include agents from other computers and gateway keys</span></label>
<label class="row"><input type="checkbox" id="optText"> <span data-t="showText">Show prompts and replies</span></label>
<label class="row"><input type="checkbox" id="optSub"> <span data-t="showSub">Show subagents</span></label>
<label class="row"><input type="checkbox" id="optIdle"> <span data-t="showIdle">Show idle agents</span></label>
<div class="row col">
<span data-t="agents">Agents</span>
<div class="agent-filter" id="optAgents"></div>
</div>
<div class="row col">
<span data-t="language">Language</span>
<select class="lang-select" id="optLang"></select>
</div>
<div class="row col">
<span data-t="scene">Scene</span>
<select class="lang-select" id="optScene"></select>
</div>
<div class="row col">
<span data-t="quality">Quality</span>
<select class="lang-select" id="optQuality">
<option value="low" data-t="qLow">Low</option>
<option value="medium" data-t="qMedium">Medium</option>
<option value="high" data-t="qHigh">High</option>
</select>
</div>
<div class="row col">
<span data-t="hideAfter">Leave the office after</span>
<div class="seg small" id="optHide">
<button type="button" data-hide="1h" data-t="h1">1 hour</button>
<button type="button" data-hide="6h" data-t="h6">6 hours</button>
<button type="button" data-hide="24h" data-t="h24">24 hours</button>
<button type="button" data-hide="never" data-t="never">Never</button>
</div>
</div>
</div>
</div>
</div>
</nav>
<section class="stage" id="stage">
<canvas id="office" tabindex="0" aria-label="Agent office"></canvas>
<canvas id="office3d" tabindex="0" aria-label="3D Agent office" hidden></canvas>
<div class="tags" id="tags"></div>
<div class="empty" id="empty" hidden></div>
</section>
<section class="listview" id="listview" hidden>
<table>
<thead><tr><th data-t="agent">Agent</th><th data-t="task">Task</th><th data-t="status">Status</th><th data-t="project">Folder</th><th data-t="model">Model</th><th data-t="last">Last active</th></tr></thead>
<tbody id="rows"></tbody>
</table>
<p class="empty-list" id="emptyList" hidden></p>
</section>
<aside class="rail" id="rail" hidden>
<div class="rail-head"><span data-t="agents">Agents</span> <b id="railCount">0</b><span class="grow"></span><button type="button" class="px" id="railClose" aria-label="Close">✕</button></div>
<div class="rail-groups" id="railGroups"></div>
</aside>
<aside class="pop" id="pop" hidden></aside>
<footer>
<div class="legend" id="statusLegend"></div>
<div class="legend brands" id="brandLegend"></div>
</footer>
</main>
<div class="float" id="float" hidden>
<div class="floatbar" id="floatbar"><span class="fdots" aria-hidden="true"><i></i><i></i></span><span data-t="pip">Picture in picture</span><button type="button" class="fclose" id="floatClose" aria-label="Close">✕</button></div>
<div class="floatslot" id="floatslot"></div>
</div>
<div class="toasts" id="toasts" aria-live="polite"></div>
</body>
</html>