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>
83 lines
3.3 KiB
JSON
83 lines
3.3 KiB
JSON
{
|
|
"name": "@magpie-community/page-usage-board",
|
|
"version": "0.1.1",
|
|
"description": "在 magpie 窗口里查看用量:额度到期卡片墙 + 每日/模型/provider 用量图表 + 可选远端归因,由插件自带的本机服务供数。A usage dashboard page in magpie's window: quota cards with expiry tiers, daily and per-provider charts, optional remote attribution, served by the plugin's own local service.",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"files": [
|
|
"index.mjs",
|
|
"server.mjs",
|
|
"page",
|
|
"static",
|
|
"build",
|
|
"LICENSE",
|
|
"README.md",
|
|
"scripts",
|
|
"NOTICE",
|
|
"docs",
|
|
"LICENSES"
|
|
],
|
|
"scripts": {
|
|
"start": "node server.mjs",
|
|
"test": "node --test",
|
|
"build:echarts": "node scripts/build-echarts.mjs",
|
|
"prepack": "node scripts/prepack.mjs"
|
|
},
|
|
"engines": {
|
|
"node": ">=22",
|
|
"magpie": ">=0.1.1340"
|
|
},
|
|
"keywords": [
|
|
"magpie",
|
|
"magpie-page",
|
|
"magpie-plugin",
|
|
"usage",
|
|
"dashboard",
|
|
"quota",
|
|
"charts",
|
|
"token"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/page-usage-board"
|
|
},
|
|
"homepage": "https://github.com/magpie-community/plugins/tree/main/packages/page-usage-board",
|
|
"bugs": {
|
|
"url": "https://github.com/magpie-community/plugins/issues"
|
|
},
|
|
"magpie": {
|
|
"name": "Usage Board",
|
|
"summary": {
|
|
"en": "A quota card wall with expiry tiers, daily/per-provider charts, 24h cache-hit and token curves, optional remote attribution and account detail. Runs its own zero-dependency local service reading this machine's Magpie usage data; optional remote attribution queries the configured remote magpie.",
|
|
"zh": "额度到期卡片墙 + 每日与 provider 用量图表 + 24 小时缓存命中与 token 曲线,可选远端归因与账号明细。自带零依赖本机服务,读本机 Magpie 用量数据;远端归因会查询所配置的远端 magpie。"
|
|
},
|
|
"page": {
|
|
"title": "Usage Board",
|
|
"titles": {
|
|
"en": "Usage Board",
|
|
"zh": "用量看板"
|
|
},
|
|
"file": "page/index.html",
|
|
"icon": "page/icon.svg",
|
|
"service": {
|
|
"port": 3455,
|
|
"option": "port"
|
|
}
|
|
},
|
|
"permissions": [],
|
|
"options": {
|
|
"port": 3455,
|
|
"attribution": "local",
|
|
"remoteCallers": "",
|
|
"remoteProviders": "magpie-direct,magpie-cf,remote-magpie"
|
|
},
|
|
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8IS0tIFVzYWdlIGJvYXJkOiBkYXJrIHJvdW5kZWQgcGxhdGUsIGJsdWUgdXNhZ2UgbGluZSwgb25lIGFtYmVyIGJhciAtLT4KICA8cmVjdCB4PSI0IiB5PSI0IiB3aWR0aD0iOTIiIGhlaWdodD0iOTIiIHJ4PSIyMCIgZmlsbD0iIzFlMjQzMCIvPgogIDwhLS0gYW1iZXIgYmFyIChxdW90YSB0b2RheSkgLS0+CiAgPHJlY3QgeD0iMjQiIHk9IjU2IiB3aWR0aD0iMTAiIGhlaWdodD0iMjQiIHJ4PSIzIiBmaWxsPSIjZjVhNjIzIi8+CiAgPCEtLSBibHVlIHVzYWdlIGxpbmUgb3ZlciB0aGUgbGFzdCBob3VycyAtLT4KICA8cG9seWxpbmUgcG9pbnRzPSIyMiw2NiAzNiw1MiA1MCw1OCA2NCwzOCA3OCwzMCIKICAgIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzRjOWZmZSIgc3Ryb2tlLXdpZHRoPSI3IgogICAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CiAgPCEtLSBlbmRwb2ludCBkb3QgLS0+CiAgPGNpcmNsZSBjeD0iNzgiIGN5PSIzMCIgcj0iNS41IiBmaWxsPSIjNGM5ZmZlIi8+Cjwvc3ZnPgo="
|
|
},
|
|
"devDependencies": {
|
|
"echarts": "5.5.1",
|
|
"esbuild": "0.28.2"
|
|
}
|
|
}
|