From 73362966e7e8f431d4001f0127c2dd98f4a9ded4 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 5 Nov 2026 09:45:19 +0800 Subject: [PATCH] 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= 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. --- packages/agent-office/CHANGELOG.md | 14 ++++++++++++++ packages/agent-office/agent-office.test.mjs | 6 ++++++ packages/agent-office/cli.test.mjs | 2 +- packages/agent-office/package.json | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/agent-office/CHANGELOG.md b/packages/agent-office/CHANGELOG.md index 30149ac..0231194 100644 --- a/packages/agent-office/CHANGELOG.md +++ b/packages/agent-office/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.3.2 · 2026-11-05 + +### Added + +- Settings has a switch, "Include agents from other computers and gateway keys", for `remote`. It stays off by default. While it is off, an empty office that had such requests says they were ignored because the switch is off, in all nine languages. By frederick-wang, from QingJ01/magpie-agent-office#5 (#741). + +### Changed + +- The Settings button's chevron is drawn as an SVG that sits on the label's centre line and turns over while the menu is open; the Language, Scene and Quality pickers draw the same chevron. By frederick-wang (#740). + +### Fixed + +- The page's asset stamps match their files again. Since 0.3.0 four of them were stale, so a same-version cache could pair the new page with an old model.js, scene.js, scene3d.js or app.js. + ## 0.3.1 · 2026-11-03 ### Fixed diff --git a/packages/agent-office/agent-office.test.mjs b/packages/agent-office/agent-office.test.mjs index 4237f98..079c2e1 100644 --- a/packages/agent-office/agent-office.test.mjs +++ b/packages/agent-office/agent-office.test.mjs @@ -316,6 +316,12 @@ test("the host part writes what it reads, and changes no request", async () => { hook.stop() const c = { origin: "local", protocol: "anthropic", agent: "cursor", session: "cu1", cwd: "/x", model: "m", query: "hi", options: {}, state: {}, report() {} } expect(await hook.onRequest({ model: "m", tools: [{ name: "x" }], messages: [{ role: "user", content: "hi" }] }, c)).toBeUndefined() + // with no remote option set, a request from another computer is only counted + const far = { ...c, origin: "gateway-key", agent: "opencode", session: "far1", state: {} } + await hook.onRequest({ model: "m", tools: [{ name: "x" }], messages: [{ role: "user", content: "hi" }] }, far) + expect(far.state.office).toBeNull() + expect(hook.snapshot().sessions.some((s) => s.session === "far1")).toBe(false) + expect(hook.snapshot().dropped).toBeGreaterThanOrEqual(1) hook.write() const live = readFileSync(join(out, "live.js"), "utf8") const snap = JSON.parse(live.slice("globalThis.AgentOfficeLive = ".length).replace(/;\s*$/, "")) diff --git a/packages/agent-office/cli.test.mjs b/packages/agent-office/cli.test.mjs index 5107125..7c12766 100644 --- a/packages/agent-office/cli.test.mjs +++ b/packages/agent-office/cli.test.mjs @@ -119,7 +119,7 @@ test("the authenticated standalone page, bridge, live data and JSON options work try { const ping = await (await fetch(s.url + "api/ping")).json() expect(ping.name).toBe("agent-office") - expect(ping.version).toBe("0.3.1") + expect(ping.version).toBe("0.3.2") const page = await fetch(s.url) expect(page.status).toBe(200) expect(await page.text()).toContain('src="_magpie/bridge.js"') diff --git a/packages/agent-office/package.json b/packages/agent-office/package.json index a299afe..ff7cb75 100644 --- a/packages/agent-office/package.json +++ b/packages/agent-office/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/page-agent-office", - "version": "0.3.1", + "version": "0.3.2", "description": "我的 Agent 在干嘛:读取本机 Claude Code、Codex、Copilot CLI、Kimi Code、DeepSeek Harness、Gemini CLI、Qwen Code、Pi、omp、Qoder、WorkBuddy、CodeBuddy、Grok Build 的会话文件,把每个会话画成真 3D / 等距 / 2D 办公室里的小人,或分组工作台。Live agent activity dashboard for magpie, with a real WebGL office and eleven scenes.", "type": "module", "files": [