7b42e404f5f656d7bfb4aa5c7ddbcd1031264a86
13
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
61adb384fc |
agent-office 0.3.5: Cursor's editor and CLI chats show in the office (WaiooT on X)
WaiooT asked to see Cursor in Agent Office. It read no Cursor files: Cursor showed only through the gateway hook, which never sees Cursor's own requests (they go to Cursor's servers). It now reads <CURSOR_DATA_DIR or ~/.cursor>/projects/<slug>/agent-transcripts/ <chat>/<chat>.jsonl (and the older agent-transcripts/<chat>.jsonl). A chat with cursor-agent's chats/*/<chat>/meta.json (CURSOR_CONFIG_DIR, else $XDG_CONFIG_HOME/cursor, else ~/.cursor) is "Cursor CLI" with that cwd; the rest are the editor's, a new "cursor-app" agent named "Cursor", with the cwd found by matching the slug against real folders (bounded, cached), else the slug's last part. Lines carry no time, so the file's mtime is used, and the user line's <timestamp>. turn_ended ends a turn (success done, error with its text, else stopped). The editor writes no turn_ended, so its chat counts as done 30s after a last answer with no tool pending. No token counts: Cursor doesn't record them locally. Run on mote at this tree (Bun 1.4.2, HOME=mktemp -d): repo bun test 7866 tests, 7846 pass, 20 skip, 0 fail; bun scripts/check.mjs exit 0; stamp-page.mjs --check exit 0 (agents.js restamped). The fixtures are the bytes a sandboxed cursor-agent wrote here (a Read tool run that ended "WritableIterable is closed", and "Say ok."). Broken by hand: without the editor's quiet-done rule the chat stays "thinking" (red); without meta.json's agent the CLI chat is cursor-app (red). Not tried: a real Cursor editor writing a transcript (no editor in a sandbox here; the format is cursor-agent's, which the editor shares per magpie's Sessions reader), subagent transcripts, the page in a real magpie window. |
||
|
|
89ddfb9cb3 |
agent-office 0.3.4: Settings pickers read their value and stay open on overscroll (#778)
Bumps agent-office to 0.3.4 so #778 (frederick-wang: the pickers' accessible name carries the value, overscroll no longer closes a picker, magpie's thin scrollbar; fixes #773) reaches users; dist stops at 0.3.3. Notes it in the changelog and moves cli.test.mjs's pinned ping version with it. Run on mote at this tree (Bun 1.4.2, HOME=mktemp -d): repo bun test 6255 tests, 20 skip, 0 fail; bun scripts/check.mjs exit 0; stamp-page.mjs --check exit 0. Not tried: the page in a real magpie window. |
||
|
|
42331f64d8 |
agent-office 0.3.3: Settings pickers are app menus (#771)
Bumps agent-office to 0.3.3 so #771 (frederick-wang: Language, Scene and Quality are in-page listbox menus, not native <select>s, #744) reaches users; dist and npm stop at 0.3.2. Notes it in the changelog, and moves cli.test.mjs's pinned ping version with it. Run on mote at this tree (Bun 1.4.2, HOME=mktemp -d): packages/ agent-office bun test 183 pass; repo bun test 6184 pass, 20 skip, 0 fail; bun scripts/check.mjs exit 0; stamp-page.mjs --check 0. Broken by hand: before the cli.test.mjs edit, the bump alone turned "the authenticated standalone page..." red (0.3.2 vs 0.3.3). Not tried: the page in a real magpie window. #773 has the two small follow-ups from the review. |
||
|
|
73362966e7 |
agent-office: 0.3.2, with a guard that the hook keeps only local requests
Bumps agent-office to 0.3.2 so #740 (SVG chevrons) and #741 (the remote switch and its empty-office line) reach users, and notes both in the changelog with the asset stamps they fixed (stale since 0.3.0). Adds a guard to "the host part writes what it reads": with no remote option set, a gateway-key request leaves ctx.state.office null, adds no session and counts as dropped. Before this nothing failed when the hook's track() defaulted remote on. Run on mote: HOME=<scratch> bun test packages/agent-office, 183 pass; bun scripts/check.mjs agent-office ok; stamp-page.mjs --check ok. Broken by hand: office.hooks.mjs remote default `!== false` turns the new guard red (1 fail), restored green. Not tried: the page in a real magpie window, a real remote agent. |
||
|
|
fa46c0764f |
agent-office 0.3.1: README says eleven scenes
0.3.0 (#637) added five scenes, but the README still said six. It now says eleven in the English image caption, in the zh 3D feature line (which lists the five new scenes too) and in the file list's scene3d.js line. The patch bump puts the README into the dist tarball. No code changed. Run at this commit on mote (Bun 1.4.2): bun test in packages/agent-office 181 pass, 0 fail; bun scripts/check.mjs agent-office ok. |
||
|
|
87561b3fc3 |
agent-office 0.3.0: library, cyberlab, greenhouse, arctic and rainy night scenes (#637)
Adds five scenes to agent-office: library, cyberlab, greenhouse, arctic and rainy night. Each has themed 3D decorations and an ISO/2D canvas palette, and its name is in all 9 languages. Bumps the package to 0.3.0, and the registry summary now says eleven scenes in en and zh. The six existing scenes keep their ISO/2D palette: `scene2.theme` is set only for the five new ids. By kongtou20070406. Run at the reviewed head 8986d2f on macOS (mote, Bun 1.4.2, Playwright 1.62.0): - `bun test` in packages/agent-office: 180 pass, 1 fail. The fail is jump.test.mjs's host-restart jumpRequest test: herdr.log was never written at load ~70. It passes 6 of 6 alone at this head and 3 of 3 on main |
||
|
|
11e0acd9b1 |
agent-office 0.2.4: a jumpRequest.at ahead of the clock no longer blocks every later jump (#583)
0.2.3's host acted on any jumpRequest no older than 15 s, a future one
too, and kept its time in $XDG_CACHE_HOME/agent-office/last-jump.json;
every later click had at <= that time and was dropped until the clock
got there. The decision is now judgeJump(at, seen, now) in lib/jump.mjs:
- A request fires only from 15 s old to 5 s ahead, once.
- One stamped further ahead is set aside and recorded, so it never
fires when the clock reaches it.
- A seen time ahead of now (0.2.3's file for such a request, or a clock
that stepped back) blocks only that same request (at === seen); any
other fresh click fires and rewrites the file. With seen in the past,
an older or equal request is still never acted on, so nothing is
replayed across restarts.
- The target is still worked out by the host from the session id; a
page-stamped time can only make a request be skipped, not fire it
later or elsewhere. Non-finite times are ignored and never written.
Existing bad last-jump.json from 0.2.3: read as before, no migration
needed; it no longer blocks, and the next click replaces it.
Run at this tree (base
|
||
|
|
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).
|
||
|
|
044313a9d0 |
agent-office 0.2.2: a same-size sidecar rewrite inside one timestamp tick is read again (#580)
The scanner judged a Grok usage.json / summary.json revision by
"size:mtime:ctime" alone. Linux stamps a write with the coarse kernel
clock: on the WSL2 box 199 of 200 same-size in-place rewrites kept all
three (mote, APFS: 0 of 200). So "midnight and metadata-only changes do
not read JSONL again" was red there (usage 100 -> 200 serialize to the
same length, written ms apart) and green on mote and CI. A user's
usage.json rewritten that way kept the old token count. This is a
product bug, not a test assumption.
A sidecar's revision is now "size:mtime:ctime:ino", plus "#sha1" of
its bytes while its stamp is under 2.5 s old (RACY_MS, git's racy-index
idea). sameSidecar compares the stamps, and the digests where both
carry one, so a stamp aging out of the window is not a new revision and
the same bytes written again are not parsed again. Cost: a sidecar
(<= 256 KiB meta, <= 32 MiB usage) is read and hashed on each tick for
2.5 s after a write. createScanner takes statSync (sidecars only) so a
test can freeze the stamps.
New test: "a same-size usage.json or summary.json rewrite inside one
timestamp tick is read again" (frozen mtime/ctime; in place, temp and
rename, same bytes again with no parse).
Run at this tree (
|
||
|
|
62ba6d7267 |
agent-office 0.2.1: cold image scans frame only the unfinished EOF record (#559)
Bumps the version for #559's scanner change and moves its changelog
lines from 0.2.0 into a 0.2.1 section; cli.test's ping expects 0.2.1.
Run on mote at this tree (
|
||
|
|
7714b617c7 |
agent-office 0.2.0: real 3D office, workbench, incremental session scan
Agent Office 0.2.0 (QingJ01, #551): a real 3D office, the workbench, and the earlier review's fixes. The session scanner now reads growing JSONL logs incrementally. It keeps a saved offset with 128 guard bytes, carries UTF-8 and partial JSON across ticks, applies a record complete at EOF once, and resets on truncation, inode or birthtime change and same-size rewrites. Readers update per kind (Claude response usage replaced, Grok sidecar daily totals replaced, metadata refreshed apart from logs).
Run at the reviewed head 3bf522f, merged on main
|
||
|
|
659967c9bc |
agent-office 0.1.1: an agent another agent killed is stopped, and any agent not at work can be cleared
flying_crp (X, 2026-10-31): when one agent hands work to another and then
interrupts it from the command line, the delegated session hangs in the
Agent Office as abnormal and can't be cleaned up; it only goes once the
session is deleted in magpie.
The cause: a killed agent writes no end of turn. Reproduced in a sandbox
HOME with the real CLIs:
- Codex 0.165 under SIGTERM or SIGKILL: the rollout ends at the
function_call (on SIGINT it writes turn_aborted, which was fine).
- Claude Code 2.1.314 `claude -p` under SIGTERM: a tool_result
("Exit code 137") and no end_turn, and it removes its
sessions/<pid>.json. Under SIGKILL: the file ends at tool_use, and the
pid file stays with a dead pid.
The office read each file as at work, then "error · stuck" once quiet for
ten minutes, until hideAfter (6h, or never; a waiting session never
leaves). The page had no way to take one out.
The fix:
- lib/scan.mjs: for a source with a process folder (Claude Code's
<config>/sessions, also Qoder, WorkBuddy and CodeBuddy), a session
quiet mid-turn for 10s with no live process named in that folder is
read as aborted ("stopped"). A folder that can't be read, a
half-written file, or one that has never held a pid file means
unknown, and nothing changes. A pid file from another pidDomain (WSL)
counts as alive.
- page: Clear (清除) in the panel of any agent not at work (stuck,
error, stopped, done, waiting) hides it until its session moves again.
It is kept in the page's options as {key: at}, pruned to sessions
live.js still has. This covers Codex and every agent with no process
registry.
Run:
- On mote (mote-run): bun test in packages/agent-office gives 54 pass,
0 fail. bun scripts/check.mjs exits 0.
- killed.test.mjs uses the real killed files (test/killed, trimmed and
with paths replaced). With the old scan.mjs, 3 tests fail. With the old
model.js, 2 fail.
- End to end: the real office.hooks.mjs over a sandbox HOME holding the
killed Claude and Codex files and a live lead pid file. live.js had
claude "aborted" and codex "tool". Then the real page in list mode, zh,
at widths 1100 and 420: the Codex row shows 已 N 分 没有动静, its
panel shows 清除, clicking it removes the row, and options.set gets
cleared. Chromium ran on mote. WebKit ran on the Linux box (wsl-run),
because WebKit on mote didn't launch within 180s while ~108 WebKit
processes from other sessions were running. Screenshots were checked
at both widths.
Not tried:
- A Codex liveness signal: its thread-writer-locks are flock-only files,
which Node can't check. Codex relies on Clear.
- Windows: the pidDomain value and process.kill(pid, 0) there.
- Whether Qoder, WorkBuddy or CodeBuddy write pid files at all. Without
them, nothing changes for those agents.
- Gemini, Qwen, dsh and pi killed mid-turn: they have no registry and
rely on Clear.
- The page inside the real magpie window, and WebKitGTK.
|
||
|
|
1e04c1d324 |
agent-office 0.1.0: live agent activity office page (#478)
A new community page plugin by QingJ01: Agent Office, a page in magpie's window that shows each local agent session as a worker in an office (3D/2D) or a list, with status, current step and a resume command.
- Its host part (office.hooks.mjs, an async gateway hook) reads the session files of Claude Code, Codex, dsh, Gemini CLI, Qwen Code, Pi, omp, Qoder, WorkBuddy and CodeBuddy every 1.5 s and writes page/live.js beside the page. It opens no socket and sends nothing off the machine. The page makes no magpie.read calls and loads only its own files.
- Text switch: with text off, the host writes no prompt, reply, error or tool argument (the title falls back to the folder, the step to the tool name), and the page redacts whatever live.js holds.
- Options are read at module load from plugins.json in the host's cwd (magpie's config folder), with the XDG path as a fallback. npm specs are matched with @tag/@version stripped, a path spec by realpath against the package's own folder. It fails closed: text stays off until an install's options or a request's ctx.options turn it on.
- The disclosure (package description, registry summary, root README) says which session files it reads. magpie's install sheet still says "reads nothing" for such a page (yetone/magpie#4187).
Run at the reviewed head e76d1a3, on mote:
- bun test in packages/agent-office: 44 pass, 0 fail.
- The whole repo at origin/main
|