A user installed the Day card and found it looked nothing like the receipt in https://x.com/jasonaxb/status/2119432517170430196, and asked for the same look. The card is now that receipt, with magpie's words in place of the original's own: - cream paper over a teal-to-mint ground, a zigzag torn bottom edge and a soft shadow; heavy monospace, letter-spaced labels and dashed rules; - DATE and ISSUED, then the TOTAL API COST (API-equivalent, not an invoice), then STREAK, REQUESTS, ERRORS (only when there were any) and VS AVERAGE DAY (cost against the mean of the active days before this one; tokens when nothing was priced); - AGENT / MODEL with logos printed in ink, by cost; then TOTAL TOKENS, INPUT, OUTPUT and CACHE HIT RATE; - the original's tagline and App Store footer are magpie's own lines, and its RANK is left out: magpie has no ranking to read. The frame can't fetch a font file (sandboxed, opaque origin), so the face is a subset of JetBrains Mono 2.304 (OFL, license beside it) as woff2 data in page/fonts.js, loaded with FontFace. About 13.5KB per weight, 400/700/800. The average now leaves out the day itself, and money(0) reads $0.00. Run, on mote at this tree: - bun test packages/day-card: 12 pass (tests rewritten for the receipt: fields, cost order, versus, dates with a held clock, fonts.js is woff2 and loads before app.js, only usage:day is read). - bun test scripts: 22 pass; bun scripts/check.mjs: exit 0. - The page in a sandboxed frame under the page CSP, with the reference's numbers and real magpie icons, in Chromium and WebKit (Playwright 1.62.0), en, zh, de and ja: all three weights load, no page errors, the long German title shrinks to fit; the English card checked side by side with the tweet's image. Not tried: the real magpie app's WKWebView, and Copy/Save from it.
20 lines
870 B
JSON
20 lines
870 B
JSON
{
|
|
"name": "@magpie-community/page-day-card",
|
|
"version": "0.1.1",
|
|
"description": "A page in magpie's window that draws a day of your AI usage as a card: tokens, cost, each agent and its models, your streak and your average day. Copy it as a picture or save it as a PNG",
|
|
"files": ["page", "README.md"],
|
|
"keywords": ["magpie", "magpie-page", "usage", "tokens", "cost", "card"],
|
|
"license": "MIT",
|
|
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/day-card" },
|
|
"engines": { "magpie": ">=0.1.3427" },
|
|
"magpie": {
|
|
"page": {
|
|
"title": "Day card",
|
|
"titles": { "zh": "每日用量卡", "zh-TW": "每日用量卡", "ja": "1日の使用量カード", "de": "Tageskarte" },
|
|
"file": "page/index.html",
|
|
"icon": "page/icon.svg"
|
|
},
|
|
"permissions": ["usage:day"]
|
|
}
|
|
}
|