Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to TokenMe are documented in this file. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Fixed

- **DSH 在界面上改叫 DeepSeek Harness,图标换成官方那只鲸鱼** — 名字只改用户看得到的地方:面板与气泡的工具名(适配器的 `DISPLAY_NAME` 与前端兑底表)、测速页与通知标题、设置里的提示文案、README 与 docs;工具 id 仍是 `dsh`(索引、同步 bundle、主题色槽位、进程名匹配、`dsh-doctor` 命令名均不变),所以不需数据迁移。图标取自本机 `/Applications/DeepSeek Harness.app/Contents/Resources/icon.icns`(1024px),裁到圆角方块边界后缩为 128×128 覆盖 `assets/dsh.png`(文件名与映射不变)。名字变长后列表行沿用既有的 ellipsis + 点击看全名行为。

- **排行页的工具名也改叫 DeepSeek Harness** — 排行页的“工具”分组直接用引擎给的 label,而那是工具 id(`dsh`),于是其它页面已经显示为 DeepSeek Harness 而这里仍是小写 `dsh`。现在 `RankedList` 多了一个 `tool` 开关,只对工具分组把 key 过一遍显示名映射;模型与项目分组仍用引擎发的 label(项目要的就是原路径、模型要的就是原始模型名)。工具列表与排行页现在读同一个名字,截断时点开看的全名也跟着一致。

## [0.1.9] — 2026-10-26

### Added
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ $ tokenme daily --days 3
| <img src="crates/usage-core/assets/hermes.png" width="20" alt=""> **Hermes** | — | — | ✅ | ✅ | ⏳ |
| <img src="crates/usage-core/assets/funide.png" width="20" alt=""> **FunIDE** | GLM 套餐点数 | ✅ | ✅ | ✅ | ⏳ |
| <img src="crates/usage-core/assets/catpaw.png" width="20" alt=""> **妙手**(原 CatPaw) | 积分余额 | — | ✅ | ✅ | ✅ |
| <img src="crates/usage-core/assets/dsh.png" width="20" alt=""> **DSH** | DeepSeek 账户余额 | — | ✅ | ✅ | ✅ |
| <img src="crates/usage-core/assets/dsh.png" width="20" alt=""> **DeepSeek Harness** | DeepSeek 账户余额 | — | ✅ | ✅ | ✅ |
| <img src="crates/usage-core/assets/crow5.png" width="20" alt=""> **Crow5** | — | — | ✅ | ✅ | ⏳ |
| **Mimocode** | — | — | ✅ | ✅ | ⏳ |
| <img src="crates/usage-core/assets/cola.png" width="20" alt=""> **Cola** | 套餐配额 | — | ✅ | ✅ | ⏳ |
Expand All @@ -195,9 +195,9 @@ TokenMe 可以从本地客户端活动中被动测量 **TTFT**(首 token 延
| :--- | :--- | :--- |
| **Codex** | 从本地 Codex rollout 流中读取轮次级 TTFT;流中提供输出 token 数和计时信息时计算 TPS | 支持:通过 Codex CLI app-server 发起一次短请求 |
| **Claude Code CLI** | 从 Claude Code OpenTelemetry span 读取请求级 TTFT 和 TPS;首段内容耗时单独标记,不等同于 TTFT | 支持:通过临时、仅对该进程生效的遥测配置发起一次短请求 |
| **DSH(DeepSeek Harness)** | 从本地压缩会话日志读取请求级 TTFT 和 TPS;日志包含首 token 时间时才可测量 | 暂不支持,仅被动采集 |
| **DeepSeek Harness** | 从本地压缩会话日志读取请求级 TTFT 和 TPS;日志包含首 token 时间时才可测量 | 暂不支持,仅被动采集 |

DSH 按会话汇总:TTFT 取请求均值,TPS 按输出 token 除以解码耗时;旧日志缺首 token 时间则无此指标。主动测试点击后才发一条短提示(消耗套餐额度),结果与被动均值分开显示,提示词与回复一概不留。
DeepSeek Harness 按会话汇总:TTFT 取请求均值,TPS 按输出 token 除以解码耗时;旧日志缺首 token 时间则无此指标。主动测试点击后才发一条短提示(消耗套餐额度),结果与被动均值分开显示,提示词与回复一概不留。


## 设备同步(主从互备)
Expand Down
6 changes: 3 additions & 3 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Every tool below ships as a built-in adapter — 30 of them, indexed straight fr
| <img src="crates/usage-core/assets/hermes.png" width="20" alt=""> **Hermes** | — | — | ✅ | ✅ | ⏳ |
| <img src="crates/usage-core/assets/funide.png" width="20" alt=""> **FunIDE** | GLM-plan points | — | ✅ | ✅ | ⏳ |
| <img src="crates/usage-core/assets/catpaw.png" width="20" alt=""> **妙手** (formerly CatPaw) | points balance | — | ✅ | ✅ | ✅ |
| <img src="crates/usage-core/assets/dsh.png" width="20" alt=""> **DSH** | DeepSeek account balance | — | ✅ | ✅ | ✅ |
| <img src="crates/usage-core/assets/dsh.png" width="20" alt=""> **DeepSeek Harness** | DeepSeek account balance | — | ✅ | ✅ | ✅ |
| <img src="crates/usage-core/assets/crow5.png" width="20" alt=""> **Crow5** | — | — | ✅ | ✅ | ⏳ |
| **Mimocode** | — | — | ✅ | ✅ | ⏳ |
| <img src="crates/usage-core/assets/cola.png" width="20" alt=""> **Cola** | plan quota | — | ✅ | ✅ | ⏳ |
Expand All @@ -196,9 +196,9 @@ TokenMe can passively measure **TTFT** (time to first token) and **TPS** (genera
| :--- | :--- | :--- |
| **Codex** | Turn-level TTFT from local Codex rollout streams; TPS when the stream provides output-token and timing data | Yes — one short request through the Codex CLI app-server |
| **Claude Code CLI** | Request-level TTFT and TPS from Claude Code OpenTelemetry spans; first-content timing is labeled separately and is not TTFT | Yes — one short CLI request with temporary, process-scoped telemetry |
| **DSH (DeepSeek Harness)** | Request-level TTFT and TPS from local compressed session logs, when the stream contains first-token timestamps | No — passive collection only |
| **DeepSeek Harness** | Request-level TTFT and TPS from local compressed session logs, when the stream contains first-token timestamps | No — passive collection only |

DSH follows its session stats: TTFT averaged per request, TPS as output tokens over decode time; older logs without first-token timestamps yield neither. An active test sends one short prompt only after you click (uses plan quota), is kept separate from passive averages, and retains no prompt or response text.
DeepSeek Harness follows its session stats: TTFT averaged per request, TPS as output tokens over decode time; older logs without first-token timestamps yield neither. An active test sends one short prompt only after you click (uses plan quota), is kept separate from passive averages, and retains no prompt or response text.


## What's new in 0.1.7
Expand Down
4 changes: 2 additions & 2 deletions apps/tokenme-bar/src-tauri/src/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,8 @@ mod tests {
let (title, _) = copy_for("AgnesCode", Some("剩余 8578 点 · 限时 1240 · 每日刷新 7338"), 40.0, 1, Lang::En);
assert_eq!(title, "AgnesCode · 8578 pts left · limited 1240 · daily refresh 7338");
// Balance heads and the auto-claimed marker.
let (title, _) = copy_for("DSH", Some("余额 ¥26.70"), 0.0, 1, Lang::En);
assert_eq!(title, "DSH · Balance ¥26.70");
let (title, _) = copy_for("DeepSeek Harness", Some("余额 ¥26.70"), 0.0, 1, Lang::En);
assert_eq!(title, "DeepSeek Harness · Balance ¥26.70");
let (title, _) = copy_for("MiniMax Code", Some("已自动签到 · +30"), 0.0, 1, Lang::En);
assert_eq!(title, "MiniMax Code · Auto-claimed · +30");
// A limit-less window.
Expand Down
2 changes: 1 addition & 1 deletion apps/tokenme-bar/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ const [page, setPage] = useState<PageKey>(() => {
{page === "tools" ? <ToolsSection tools={tools} /> : null}
{page === "ranks" ? (
<>
<RankedList label={t("sec.tools")} items={win.breakdown.tools} limit={8} weight="tokens" />
<RankedList label={t("sec.tools")} items={win.breakdown.tools} limit={8} weight="tokens" tool />
<RankedList label={t("sec.models")} items={win.breakdown.models} limit={8} unpriced={win.summary.unpriced} />
<RankedList label={t("sec.projects")} items={win.breakdown.projects} limit={8} />
<CallTabs mcps={win.breakdown.mcps} skills={win.breakdown.skills} />
Expand Down
22 changes: 17 additions & 5 deletions apps/tokenme-bar/src/components/RankedList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useState } from "react";
import type { Item, UnpricedModel } from "../types";
import { compactTokens, credits as creditText, money } from "../lib/format";
import { compactTokens, credits as creditText, money, toolDisplay } from "../lib/format";
import { useMoney } from "../lib/display";
import { t } from "../lib/i18n";
import { MoreRow, Section } from "./Section";
Expand All @@ -16,13 +16,22 @@ export function RankRows({
items,
limit = 5,
weight = "cost",
tool = false,
}: {
items: Item[];
limit?: number;
weight?: "cost" | "tokens";
/** Render the item key through the tool display map (tools page naming). */
tool?: boolean;
}) {
const showMoney = useMoney();
const shown = items.slice(0, limit);
// The engine labels the tool group with its raw id (`dsh`), because that id is
// the key in the index, the sync bundles and the theme slots. Only the rendered
// name goes through the display map, so a tool row reads DeepSeek Harness here
// the way it already does on the tools page; model and project rows keep the
// label the engine sent.
const nameOf = (i: Item) => (tool ? toolDisplay(i.key) : i.label);
// One tooltip at a time, keyed on the row: click the truncated name to see
// the full path — hover titles exist but a non-activating panel is exactly
// where nobody waits for a hover delay.
Expand All @@ -40,6 +49,7 @@ export function RankRows({
const measure = rankingByCost ? i.cost : i.total_tokens;
const share = max > 0 ? Math.max((measure / max) * 100, measure > 0 ? 2 : 0) : 0;
const [head, tail] = splitPath(i.label);
const name = nameOf(i);
return (
<li className="rank-row" key={i.key}>
<div className="rank-line">
Expand All @@ -56,13 +66,13 @@ export function RankRows({
to the name cell and must not inherit its overflow clip */}
<span className="rank-text">
{head ? <span className="rank-dir">{head}</span> : null}
{tail}
{tool ? name : tail}
</span>
{tipKey === i.key ? (
/* bottom rows flip the tip above the row — a below-tip
there would leave the panel (same rule as the sources
list: last two visible rows go up) */
<span className={`rank-tip${idx >= shown.length - 2 ? " up" : ""}`}>{i.label}</span>
<span className={`rank-tip${idx >= shown.length - 2 ? " up" : ""}`}>{name}</span>
) : null}
</span>
{/* The ranking is a bar in its own column — one shared origin, so
Expand Down Expand Up @@ -113,9 +123,11 @@ interface RankedProps {
weight?: "cost" | "tokens";
unpriced?: UnpricedModel[];
emptyText?: string;
/** Tool names go through the display map; model/project rows keep their label. */
tool?: boolean;
}

export function RankedList({ label, items, limit = 5, weight = "cost", unpriced, emptyText }: RankedProps) {
export function RankedList({ label, items, limit = 5, weight = "cost", unpriced, emptyText, tool = false }: RankedProps) {
const [all, setAll] = useState(false);
const [sort, setSort] = useState<SortState>("default");
const showMoney = useMoney();
Expand Down Expand Up @@ -144,7 +156,7 @@ export function RankedList({ label, items, limit = 5, weight = "cost", unpriced,
{items.length === 0 ? (
<p className="empty-row">{emptyText ?? t("rank.empty")}</p>
) : (
<RankRows items={ordered} limit={shown} weight={weight} />
<RankRows items={ordered} limit={shown} weight={weight} tool={tool} />
)}
<MoreRow open={all} total={items.length} preview={limit} onToggle={() => setAll((v) => !v)} />
{listed.length > 0 ? (
Expand Down
2 changes: 1 addition & 1 deletion apps/tokenme-bar/src/lib/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const DISPLAY: Record<string, string> = {
// 妙手 — the product's own current name (the engine's displays map wins
// when a report is loaded; this is the pre-report fallback).
catpaw: "妙手",
dsh: "DSH",
dsh: "DeepSeek Harness",
cola: "Cola",
trae: "Trae",
trae_cn: "Trae CN",
Expand Down
16 changes: 8 additions & 8 deletions apps/tokenme-bar/src/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,18 +735,18 @@ const zh = {
/* TTFT ------------------------------------------------------------------ */
"ttft.title": "速度",
"ttft.about.label": "TTFT 指标说明",
"ttft.about": "这些数据来自客户端实际使用记录,不是独立测速。Codex 按整轮统计,Claude Code 和 DSH 按请求统计,口径不同。Claude 的首段内容时间不等同于 TTFT;DSH 只有会话流包含首 token 时间时才会显示 TTFT 和 TPS,旧格式可能没有样本。结果会受样本量和模型记录字段影响;采集启用前的活动不会补录。",
"ttft.about": "这些数据来自客户端实际使用记录,不是独立测速。Codex 按整轮统计,Claude Code 和 DeepSeek Harness 按请求统计,口径不同。Claude 的首段内容时间不等同于 TTFT;DeepSeek Harness 只有会话流包含首 token 时间时才会显示 TTFT 和 TPS,旧格式可能没有样本。结果会受样本量和模型记录字段影响;采集启用前的活动不会补录。",
"ttft.codex": "Codex",
"ttft.claude": "Claude Code",
"ttft.dsh": "DSH",
"ttft.dsh": "DeepSeek Harness",
"ttft.turn": "每轮",
"ttft.request": "每请求",
"ttft.ttft": "首 token",
"ttft.first_content": "首段内容",
"ttft.no_data": "暂无样本",
"ttft.head.avg": "平均",
"ttft.head.tps": "TPS",
"ttft.no_host": "没有检测到运行中的工具 —— 打开 Codex、Claude Code 或 DSH 后,这里会显示采集到的速度。",
"ttft.no_host": "没有检测到运行中的工具 —— 打开 Codex、Claude Code 或 DeepSeek Harness 后,这里会显示采集到的速度。",
"ttft.scoped": "访问速度只采集本机数据 —— 当前显示的是 {name} 的用量,切回「本机」或「全部机器」可查看速度。",
"ttft.samples": "{n} 个样本",
"ttft.local": "本机",
Expand All @@ -761,7 +761,7 @@ const zh = {
"ttft.active.result": "主动测试 · {provider} · {age}",
"ttft.active.error": "测试未完成。请确认 CLI 已安装、已登录且支持所需的速度遥测。",
"set.ttft": "TTFT 探测",
"set.ttft.hint": "被动记录 Codex、Claude Code 与 DSH 的首 token 时间和生成速度。",
"set.ttft.hint": "被动记录 Codex、Claude Code 与 DeepSeek Harness 的首 token 时间和生成速度。",
"set.ttft.failed": "TTFT 采集设置未能保存。",

/* 悬浮球 ---------------------------------------------------------------- */
Expand Down Expand Up @@ -1472,18 +1472,18 @@ const en: Record<StrKey, string> = {

"ttft.title": "Speed",
"ttft.about.label": "About TTFT measurements",
"ttft.about": "These are measurements from actual client usage, not benchmarks. Codex reports per turn; Claude Code and DSH report per request, so compare them with care. Claude Code's first-content time differs from TTFT. DSH shows TTFT and TPS only when its session stream contains first-token timing; older formats may not provide samples. Results depend on available model fields and sample size. Collection starts when enabled; earlier activity is not backfilled.",
"ttft.about": "These are measurements from actual client usage, not benchmarks. Codex reports per turn; Claude Code and DeepSeek Harness report per request, so compare them with care. Claude Code's first-content time differs from TTFT. DeepSeek Harness shows TTFT and TPS only when its session stream contains first-token timing; older formats may not provide samples. Results depend on available model fields and sample size. Collection starts when enabled; earlier activity is not backfilled.",
"ttft.codex": "Codex",
"ttft.claude": "Claude Code",
"ttft.dsh": "DSH",
"ttft.dsh": "DeepSeek Harness",
"ttft.turn": "per turn",
"ttft.request": "per request",
"ttft.ttft": "First token",
"ttft.first_content": "First content",
"ttft.no_data": "No samples yet",
"ttft.head.avg": "Avg",
"ttft.head.tps": "TPS",
"ttft.no_host": "No supported tool is running — open Codex, Claude Code, or DSH to see collected speed data.",
"ttft.no_host": "No supported tool is running — open Codex, Claude Code, or DeepSeek Harness to see collected speed data.",
"ttft.scoped": "Access speed is collected on this machine only — you are viewing {name}; switch to 本机 or 全部机器 to see it.",
"ttft.samples": "{n} samples",
"ttft.local": "Local",
Expand All @@ -1498,7 +1498,7 @@ const en: Record<StrKey, string> = {
"ttft.active.result": "Active test · {provider} · {age}",
"ttft.active.error": "The test did not complete. Check that the CLI is installed, signed in, and supports the required speed telemetry.",
"set.ttft": "TTFT collection",
"set.ttft.hint": "Passively records time to first token and generation speed for Codex, Claude Code, and DSH.",
"set.ttft.hint": "Passively records time to first token and generation speed for Codex, Claude Code, and DeepSeek Harness.",
"set.ttft.failed": "Could not save the TTFT collection setting.",

"bubble.today": "Today",
Expand Down
5 changes: 4 additions & 1 deletion crates/adapters/dsh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ pub const TOOL_ID: &str = "dsh";
pub use doctor::ledger;
pub use paths::diagnostic_candidates;
pub use speed::{read_speed_samples, DshSpeedSample};
pub(crate) const DISPLAY_NAME: &str = "DSH";
/// The name users see. The tool id stays `dsh` — it keys the index, the sync
/// bundles, the theme slot and the host-process match — so only the display name
/// follows the vendor's own spelling.
pub(crate) const DISPLAY_NAME: &str = "DeepSeek Harness";

#[derive(Debug, Default, Clone, Copy)]
pub struct DshAdapter;
Expand Down
Binary file modified crates/usage-core/assets/dsh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Cold start is ordered so the panel never waits on work it does not need. The eng

## TTFT and speed (off by default)

Passive sampling reads local records only: Codex rollout completion records and DSH's local compressed session streams; Claude Code gets a loopback-only OTLP/HTTP JSON receiver (port 4319) — enabling merges the trace variables into the user's Claude settings, disabling removes only what TokenMe wrote, and only while it has not been touched since. Active checks are one-shot: a single fixed, short prompt fired only after an explicit click (Codex through an ephemeral read-only app-server thread, Claude Code with per-process OTLP settings, DSH timed by its own CLI), and nothing — prompt, response, credentials, active result — is persisted. Speed is this-machine only: under a remote origin's scope the speed page says so and asks to switch back to This machine or All machines.
Passive sampling reads local records only: Codex rollout completion records and DeepSeek Harness's local compressed session streams; Claude Code gets a loopback-only OTLP/HTTP JSON receiver (port 4319) — enabling merges the trace variables into the user's Claude settings, disabling removes only what TokenMe wrote, and only while it has not been touched since. Active checks are one-shot: a single fixed, short prompt fired only after an explicit click (Codex through an ephemeral read-only app-server thread, Claude Code with per-process OTLP settings, DeepSeek Harness timed by its own CLI), and nothing — prompt, response, credentials, active result — is persisted. Speed is this-machine only: under a remote origin's scope the speed page says so and asks to switch back to This machine or All machines.

## Key invariants

Expand Down
2 changes: 1 addition & 1 deletion docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Open Design 配额读 `~/.amr/config.json` 的 `profiles.prod`(`OPEN_DESIGN_HO

## dsh-doctor

DSH 精度审计:把桌面应用自己的投影台账(`tokenUsage`)与索引里的数字并排打印,逐会话给出 `ok`、`MISMATCH`、`v3 stream`、`not indexed`、`indexed but no projection` 之一的 `status`。备注里是如实偏差的结构性原因——继承的 v4 之前事件、活在 `tokenUsage` 之外的子代理开销。无参数。
DeepSeek Harness 精度审计:把桌面应用自己的投影台账(`tokenUsage`)与索引里的数字并排打印,逐会话给出 `ok`、`MISMATCH`、`v3 stream`、`not indexed`、`indexed but no projection` 之一的 `status`。备注里是如实偏差的结构性原因——继承的 v4 之前事件、活在 `tokenUsage` 之外的子代理开销。无参数。

```bash
tokenme dsh-doctor
Expand Down
Loading
Loading