diff --git a/CHANGELOG.md b/CHANGELOG.md index bf17ea6d..16dee0f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 6f7e85dc..281fdc91 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ $ tokenme daily --days 3 | **Hermes** | — | — | ✅ | ✅ | ⏳ | | **FunIDE** | GLM 套餐点数 | ✅ | ✅ | ✅ | ⏳ | | **妙手**(原 CatPaw) | 积分余额 | — | ✅ | ✅ | ✅ | -| **DSH** | DeepSeek 账户余额 | — | ✅ | ✅ | ✅ | +| **DeepSeek Harness** | DeepSeek 账户余额 | — | ✅ | ✅ | ✅ | | **Crow5** | — | — | ✅ | ✅ | ⏳ | | **Mimocode** | — | — | ✅ | ✅ | ⏳ | | **Cola** | 套餐配额 | — | ✅ | ✅ | ⏳ | @@ -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 时间则无此指标。主动测试点击后才发一条短提示(消耗套餐额度),结果与被动均值分开显示,提示词与回复一概不留。 ## 设备同步(主从互备) diff --git a/README_EN.md b/README_EN.md index 7fd06eec..bc08a94a 100644 --- a/README_EN.md +++ b/README_EN.md @@ -169,7 +169,7 @@ Every tool below ships as a built-in adapter — 30 of them, indexed straight fr | **Hermes** | — | — | ✅ | ✅ | ⏳ | | **FunIDE** | GLM-plan points | — | ✅ | ✅ | ⏳ | | **妙手** (formerly CatPaw) | points balance | — | ✅ | ✅ | ✅ | -| **DSH** | DeepSeek account balance | — | ✅ | ✅ | ✅ | +| **DeepSeek Harness** | DeepSeek account balance | — | ✅ | ✅ | ✅ | | **Crow5** | — | — | ✅ | ✅ | ⏳ | | **Mimocode** | — | — | ✅ | ✅ | ⏳ | | **Cola** | plan quota | — | ✅ | ✅ | ⏳ | @@ -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 diff --git a/apps/tokenme-bar/src-tauri/src/notify.rs b/apps/tokenme-bar/src-tauri/src/notify.rs index 13c6927c..8bbddc5f 100644 --- a/apps/tokenme-bar/src-tauri/src/notify.rs +++ b/apps/tokenme-bar/src-tauri/src/notify.rs @@ -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. diff --git a/apps/tokenme-bar/src/App.tsx b/apps/tokenme-bar/src/App.tsx index 4b1eb086..66b5b44f 100644 --- a/apps/tokenme-bar/src/App.tsx +++ b/apps/tokenme-bar/src/App.tsx @@ -651,7 +651,7 @@ const [page, setPage] = useState(() => { {page === "tools" ? : null} {page === "ranks" ? ( <> - + diff --git a/apps/tokenme-bar/src/components/RankedList.tsx b/apps/tokenme-bar/src/components/RankedList.tsx index d9945130..f69952d7 100644 --- a/apps/tokenme-bar/src/components/RankedList.tsx +++ b/apps/tokenme-bar/src/components/RankedList.tsx @@ -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"; @@ -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. @@ -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 (
  • @@ -56,13 +66,13 @@ export function RankRows({ to the name cell and must not inherit its overflow clip */} {head ? {head} : null} - {tail} + {tool ? name : tail} {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) */ - = shown.length - 2 ? " up" : ""}`}>{i.label} + = shown.length - 2 ? " up" : ""}`}>{name} ) : null} {/* The ranking is a bar in its own column — one shared origin, so @@ -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("default"); const showMoney = useMoney(); @@ -144,7 +156,7 @@ export function RankedList({ label, items, limit = 5, weight = "cost", unpriced, {items.length === 0 ? (

    {emptyText ?? t("rank.empty")}

    ) : ( - + )} setAll((v) => !v)} /> {listed.length > 0 ? ( diff --git a/apps/tokenme-bar/src/lib/format.ts b/apps/tokenme-bar/src/lib/format.ts index b430d26d..3bb51454 100644 --- a/apps/tokenme-bar/src/lib/format.ts +++ b/apps/tokenme-bar/src/lib/format.ts @@ -64,7 +64,7 @@ const DISPLAY: Record = { // 妙手 — 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", diff --git a/apps/tokenme-bar/src/lib/i18n.ts b/apps/tokenme-bar/src/lib/i18n.ts index 9ce8e859..27a6b7a8 100644 --- a/apps/tokenme-bar/src/lib/i18n.ts +++ b/apps/tokenme-bar/src/lib/i18n.ts @@ -735,10 +735,10 @@ 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", @@ -746,7 +746,7 @@ const zh = { "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": "本机", @@ -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 采集设置未能保存。", /* 悬浮球 ---------------------------------------------------------------- */ @@ -1472,10 +1472,10 @@ const en: Record = { "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", @@ -1483,7 +1483,7 @@ const en: Record = { "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", @@ -1498,7 +1498,7 @@ const en: Record = { "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", diff --git a/crates/adapters/dsh/src/lib.rs b/crates/adapters/dsh/src/lib.rs index c8c10d50..a6a28c3e 100644 --- a/crates/adapters/dsh/src/lib.rs +++ b/crates/adapters/dsh/src/lib.rs @@ -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; diff --git a/crates/usage-core/assets/dsh.png b/crates/usage-core/assets/dsh.png index ad2f84e1..0f378636 100644 Binary files a/crates/usage-core/assets/dsh.png and b/crates/usage-core/assets/dsh.png differ diff --git a/docs/ARCHITECTURE_EN.md b/docs/ARCHITECTURE_EN.md index a34784a7..2eaf9d37 100644 --- a/docs/ARCHITECTURE_EN.md +++ b/docs/ARCHITECTURE_EN.md @@ -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 diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index 6a75a4fe..49d9d539 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -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 diff --git a/docs/COMMANDS_EN.md b/docs/COMMANDS_EN.md index 18fd3e33..79f190a4 100644 --- a/docs/COMMANDS_EN.md +++ b/docs/COMMANDS_EN.md @@ -76,7 +76,7 @@ Most probes only read credentials. Exactly three write a rotated one back, each ## dsh-doctor -DSH accuracy audit: the desktop app's own projection ledger (`tokenUsage`) printed next to what the index holds, per session, with a `status` of `ok`, `MISMATCH`, `v3 stream`, `not indexed` or `indexed but no projection`. Notes carry the structural reasons for honest drift — inherited pre-v4 events, subagent spend that lives outside `tokenUsage`. No flags. +DeepSeek Harness accuracy audit: the desktop app's own projection ledger (`tokenUsage`) printed next to what the index holds, per session, with a `status` of `ok`, `MISMATCH`, `v3 stream`, `not indexed` or `indexed but no projection`. Notes carry the structural reasons for honest drift — inherited pre-v4 events, subagent spend that lives outside `tokenUsage`. No flags. ```bash tokenme dsh-doctor diff --git a/docs/USER_GUIDE_EN.md b/docs/USER_GUIDE_EN.md index 348fce2b..7df12f9d 100644 --- a/docs/USER_GUIDE_EN.md +++ b/docs/USER_GUIDE_EN.md @@ -62,7 +62,7 @@ Built by `scripts/build-macos.sh` on macOS and by `pnpm tauri build --bundles ns ### 3.1 The five pages - **Overview** — today's tokens, cost and cache hit rate, with usage charted by hour; the **Activity** tab is a GitHub-style year heatmap, and swiping right walks back through last week, last month and last year. The vendors' quota bars and notifications sit below. -- **Speed** — passive TTFT (time to first token) and TPS measurement: Codex is read from its local rollout stream, Claude Code comes through OpenTelemetry spans, DSH from local session logs; Codex and Claude Code can also fire one short live request to measure for real. +- **Speed** — passive TTFT (time to first token) and TPS measurement: Codex is read from its local rollout stream, Claude Code comes through OpenTelemetry spans, DeepSeek Harness from local session logs; Codex and Claude Code can also fire one short live request to measure for real. - **Tools** — per-tool requests, sessions, tokens and cache rate, one row each, the row colour taken from the app's icon; tools that support check-in claim right from the row header. - **Rankings** — sessions ranked, so the expensive ones stand out at a glance. - **Details** — request-level records, filterable by model and project. @@ -217,7 +217,7 @@ tokenme budget set zcode --daily 5 --monthly 50 | Qoder | Credits + Tokens | `~/.qoder/projects/**/*.jsonl` (credits) · `~/Library/Application Support/Qoder/SharedClientCache/cache/db/local.db` (tokens) | | WorkBuddy AI | Tokens + credits | `~/.workbuddy-ai/projects/**/.jsonl` | | WorkBuddy (China) | Tokens + credits | `~/.workbuddy/projects/**/.jsonl` | -| AgnesCode / AtomCode / Crow5 / Mimocode / Cola / DSH | Tokens | auto-discovered, same shape as their parent tools | +| AgnesCode / AtomCode / Crow5 / Mimocode / Cola / DeepSeek Harness | Tokens | auto-discovered, same shape as their parent tools | | Kimi Code | Tokens | `~/.kimi-code/sessions/**/wire.jsonl` (legacy `~/.kimi`; the desktop app's embedded runtime home under `~/Library/Application Support/kimi-desktop/daimon-share/daimon/runtime/kimi-code/home` is read too) | | MiniMax Code | Tokens | `~/.minimax/v2/sessions/**/messages.jsonl` (legacy `~/.mavis`) |