Files
plugins/packages/agent-office/bin
Jixing Liu 3303225dc9 agent-office 0.2.3: jump to a session's live terminal tab, pane or window on macOS, by jixing475 (#552)
On macOS, Agent Office now finds the terminal tab, multiplexer pane or desktop
window where a live session runs (Terminal.app, iTerm2, tmux, Herdr, Otty,
Claude Desktop, Cursor, VS Code). The panel has a jump button, or you can
double-click a worker, name tag or row. The page sends only
{key, session, preferredHostId, at} through options.set. The hooks host
resolves the target from its own ps/herdr/otty/tmux snapshot, and runs fixed
binaries with args it derived itself. TTYs are checked against
^/dev/ttys?\d+$ and quoted before they go into AppleScript. Nothing resolves
on Linux or Windows. When magpie restarts the host after options.set, a fresh
request (15s or newer) runs once. The last handled time is kept in
$XDG_CACHE_HOME/agent-office/last-jump.json, and plugins.json is never
written. The standalone server never reads plugins.json. Version 0.2.3.

By jixing475 (#552).

Run at b4654a2:
- mote (macOS 27.2, Bun 1.4.2), sandbox HOME: packages/agent-office bun test
  177 pass 0 fail; stamp-page --check 0; root scripts/check.mjs 0.
- WSL magpie-desktop: 177 pass 0 fail. Windows 11 xiaomi-gpu: 177 pass 0 fail.
- Broken by hand, each red: lastJumpAt seeded from the request (restart
  test), no last-jump.json write (replay check), all plugins.json options
  merged (--private test), req.target trusted (crafted-target test).
- Real magpie at main 4179cf2d8 on mote, sandbox HOME, plugin added from a
  folder, magpie web, fake herdr. The page's options.set sent by curl gave
  workspace/tab/agent focus after the host restart. plugins.json stayed 0600
  with another plugin's apiKey. A second restart with the same request did
  not replay it. A click within 1s of a save got 429, and the next click
  jumped.
- Not tried: a real iTerm2, Terminal, Herdr.app, Otty or Claude Desktop
  window, or the page clicked in a browser.

Follow-up: #583 (a future jumpRequest.at blocks later jumps).
2026-11-01 08:52:04 +08:00
..