Files
plugins/packages/agent-office/package.json
T
yetone 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 (5403c21 + this commit, = origin/main just fetched):
- mote: packages/agent-office HOME=$(mktemp -d) bun test 168 pass 0 fail;
  stamp-page.mjs --check 0; bun scripts/check.mjs agent-office 0; full
  HOME=$(mktemp -d) bun test 4470 pass 9 skip 0 fail.
- wsl-run (magpie-desktop): packages/agent-office 168 pass 0 fail; full
  bun test 4471 pass 8 skip 0 fail.
Broken by hand:
- origin/main's scan.mjs with the new test on WSL: both #580's test
  (line 162) and the new one (line 206) red.
- on mote, digest and ino both removed: the new test red at line 206;
  ino kept, digest removed: red at 206; digest kept, ino removed: green
  (the digest catches the rename too; ino is belt and braces).
Not tried: a real Grok Build session writing usage.json; Windows.
Not changed: the session files themselves (Gemini .json, dsh .zstd,
JSONL, Codex session_index.jsonl) have the same stamp-only check;
filed as #581.
2026-11-01 08:02:29 +08:00

91 lines
2.2 KiB
JSON

{
"name": "@magpie-community/page-agent-office",
"version": "0.2.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 six scenes.",
"type": "module",
"files": [
"page/index.html",
"page/style.css",
"page/agents.js",
"page/model.js",
"page/icons.js",
"page/scene.js",
"page/app.js",
"page/icon.svg",
"page/scene3d.js",
"page/three.min.js",
"page/icons",
"lib",
"office.hooks.mjs",
"CHANGELOG.md",
"README.md",
"LICENSE",
"bin",
"SKILL.md"
],
"keywords": [
"magpie",
"magpie-plugin",
"magpie-page",
"agents",
"status",
"office",
"dashboard",
"opencode",
"3d",
"threejs",
"webgl",
"scenes"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/agent-office"
},
"bugs": {
"url": "https://github.com/magpie-community/plugins/issues"
},
"homepage": "https://github.com/magpie-community/plugins/tree/main/packages/agent-office#readme",
"engines": {
"magpie": ">=0.1.1318"
},
"scripts": {
"test": "bun test"
},
"magpie": {
"page": {
"title": "Agent Office",
"titles": {
"zh": "Agent 办公室",
"zh-TW": "Agent 辦公室",
"ja": "エージェントオフィス",
"de": "Agent-Büro"
},
"file": "page/index.html",
"icon": "page/icon.svg"
},
"hooks": "./office.hooks.mjs",
"permissions": [],
"options": {
"mode": "office",
"dim": "3d",
"demo": false,
"showDone": true,
"hideAfter": "6h",
"text": true,
"remote": false,
"scene": "office",
"quality": "medium",
"agents": [],
"showSub": true,
"showIdle": true,
"side": false,
"lang": "auto"
}
},
"bin": {
"agent-office": "bin/agent-office.mjs"
}
}