3 Commits
Author SHA1 Message Date
法助 3d691e6e15 page-usage-board 0.1.1: WorkBuddy token estimates no longer set credit expiry (#1050)
WorkBuddy's daily `tokens (est.)` window is a token-rate allowance with an
estimated cap, set beside the credits meter (packages/workbuddy README). On
the quota wall it was picked as the card's soonest-expiring row and drove
the expiry sort, so a WorkBuddy card read as credits lapsing today. Now
quotaWins() drops that window for WorkBuddy providers (workbuddy,
workbuddy-ai) before soonWin, the total fallback and the sort. Every other
provider keeps every window.

Run at the reviewed head 628b6baa, in a Linux VM (Ubuntu 24.04, Node 22,
Bun 1.4.2, temp HOME):
- node --test in packages/page-usage-board: 37 pass, 0 fail.
- bun scripts/check.mjs page-usage-board: ok.
- git merge-tree against origin/main: clean.
Broken by hand: quotaWins returning every window turns the new test red
(1 fail), restored after.
Not tried: the page in a real magpie window with a WorkBuddy account; no
macOS or Windows run.

Co-authored-by: fazhu4 <166514093+fazhu4@users.noreply.github.com>
2026-11-12 19:28:13 +08:00
yetone 2025e8ac89 tests: mail-watch puts MAGPIE_CONFIG_DIR back; page-usage-board's children drop it
bun test runs every package in one process. mail-watch's test set
MAGPIE_CONFIG_DIR to its temp dir at module level and never restored it,
so page-usage-board's spawned service inherited it through ...process.env.
MAGPIE_CONFIG_DIR wins over the cwd probe, and "config dir: the host cwd
carrying magpie markers wins" read /tmp/mail-watch-test-*/usage.jsonl on
CI, which kept every publish run red after #844.

mail-watch's afterAll now restores the variable. page-usage-board's test
spawns build their env without an inherited MAGPIE_CONFIG_DIR or
USAGE_JSONL.

Run:
- On main (545ed66), mote: `bun test packages/mail-watch
  packages/page-usage-board` failed this one test (79 pass, 1 fail).
- With the fix, WSL Ubuntu 24.04: full-repo `HOME=$(mktemp -d) bun test`,
  as in CI, gave 7835 pass and 0 fail.

Not tried: the full repo on macOS. mote's suite lock was queued for hours.

Supersedes #921, which chdir'd the child and left the env as it was.
2026-11-10 11:52:34 +08:00
orinsid 545ed66e74 page-usage-board: a usage dashboard page (#844)
Adds @magpie-community/page-usage-board: a usage dashboard page with its
own zero-dependency local service (quota cards with expiry tiers, TTFT,
7x24 heatmap, optional remote attribution).

Reviewed at 8ca2562: the author's 80137b0 plus a maintainer merge of main
(registry entry re-appended after upstream's newer packages).
Since the 6b2625d review: [::1] in MAGPIE_ADDR stays IPv6 loopback (only
0.0.0.0/[::] map to 127.0.0.1), the config-dir test compares real paths
so it passes on macOS, and the registry-block test tolerates CRLF.

Run on mote at 8ca2562: packages/page-usage-board `bun test` 36 pass,
`node --test test/*.test.mjs` 36 pass; `bun scripts/check.mjs` all ok.
Not tried this round: the page in a live magpie window.
2026-11-10 10:36:04 +08:00