dsh-web-search-ddg
aooyoo
Zero-token DuckDuckGo search provider for the DeepSeek Harness (DSH) web seam — local headless browser, no API key, no m…
PROJECT TOPICS
PROJECT README
Token usage & cost statistics plugin for DeepSeek Harness (DSH).
Tracks token consumption per model, per date, and per session with cost estimation in USD / CNY, served as a native page under Settings → 📊 Token Stats. Installed as an external DSH plugin, it loads automatically at DSH startup — no manual activation needed.

The plugin is installed as an external DSH profile dependency.
Clone / copy this repository to a local folder, e.g. D:\dev\dsh-token-stats
In your DSH profile manifest (~/.dsh/profiles/web/package.json):
{
"dependencies": {
"dsh-token-stats": "file:D:/dev/dsh-token-stats"
},
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-token-stats"]
}
}
}
cd ~/.dsh/profiles/web && pnpm install
Restart DSH web. Open Settings → 📊 Token Stats.
cordis.patch.ymldeclares the bundle-layer mount point so the plugin auto-loads at startup.
assistant/message events carry real usage
(input / output / cache-read / cache-write / reasoning tokens), request/header events carry provider/model.sessionQuery) rebuilds the in-memory aggregation index from all history
(bounded concurrency).llm/stream usage chunks are captured for live (display-only) in-flight totals.tokenMeter.estimateMessage is used and the record is flagged estimated./token-stats/api)| op | description |
|---|---|
summary |
today / week / month / total aggregates |
query |
time series (day/week/month) + per-model / per-session aggregates; filters: model, sessionId, from, to |
models |
built-in pricing table (USD per 1M tokens) + USD→CNY rate |
sessions |
session list (id + title) |
export |
CSV / JSON dump (format=csv\|json, optional model / sessionId) |
node --check index.js # server half
node --check client.js # browser half
node test-plugin.js # standalone mock tests: correctness + performance benchmarks
.\sync-deploy.ps1 # re-sync sources into the DSH profile (then restart DSH web)
Measured on the author's machine (14 sessions / ~10k records):
| endpoint | before | after |
|---|---|---|
sessions |
~1700 ms (N serial readTitle calls) |
~12 ms (one batched readTitleSnapshots + cache) |
summary |
~110 ms (4× full-array filters) | <1 ms (single pass) |
query |
~10 ms | ~18 ms at 10k records (memoized cost) |
MIT © 2026 quansheng
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。