A new kind of package: a page in magpie's window (magpie.page), with magpie.permissions ["usage:summary"] and nothing else. Today, 7 or 30 days; models by tokens, calls or cost; the picks are saved through magpie.options.set (debounced past the bridge's once-a-second limit). Theme from --magpie-* variables; en and zh text. Run: - bun test packages/usage: 6 tests (permissions are exactly what the scripts read; no fetch/XHR/WebSocket; no inline scripts; every local reference exists; what tiles and rows say). - Sandbox magpie from yetone/magpie origin/main b03031738: `magpie plugin` lists "page Usage glance (reads usage:summary)". `magpie web` on 127.0.0.1:3595 serves every page file under the sandbox CSP (connect-src 'none'); /api/plugin-pages/read usage:summary answers the sandbox's 10 calls; providers:list is refused 403. Headless Chromium and WebKit (playwright 1.62.0) opened the sidebar tab: tiles "Calls 10, Errors 0, Tokens 70, Cost $0", row "stub-1 70 · 10 calls", no console errors; picking 7 days wrote "period": "7d" to plugins.json.
15 lines
683 B
JSON
15 lines
683 B
JSON
{
|
|
"name": "@magpie-community/page-usage",
|
|
"version": "0.1.0",
|
|
"description": "A page in magpie's window with your usage at a glance: calls, errors, tokens and cost for today, 7 or 30 days, and the models that took them",
|
|
"files": ["page", "README.md"],
|
|
"keywords": ["magpie", "magpie-page", "usage", "tokens", "cost"],
|
|
"license": "MIT",
|
|
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/usage" },
|
|
"magpie": {
|
|
"page": { "title": "Usage glance", "file": "page/index.html", "icon": "page/icon.svg" },
|
|
"permissions": ["usage:summary"],
|
|
"options": { "period": "today", "sort": "tokens" }
|
|
}
|
|
}
|