bowenliang123/dsh-context
bowenliang123/dsh-contextDSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
为 DeepSeek Harness 提供右侧悬浮栏以及 /context 命令,用环形图实时展示当前上下文 token 用量与分配及消费估算。
中文 · English
See your context window at a glance — token usage, compaction savings, and cost estimates, all in one view.
A /context slash command for DeepSeek Harness that shows the current context token usage and allocation as a donut chart. A mini floating card also stays on the right side of the conversation area, showing occupancy and estimated cost live — draggable and collapsible.
npx @deepseek-ai/dsh plugin --profile web add github:GooodWei/context-vista
npx @deepseek-ai/dsh web
Install pnpm first (
dsh plugin addinvokes it internally). If dsh is installed globally,npx @deepseek-ai/dshcan be shortened todsh.
Type /context and press Enter to see a card: a context composition donut (system / tools / messages / free), an occupancy bar, session totals, and an estimated cost.
The mini donut card on the right updates live with no input; drag its title bar to move it vertically (position is remembered), and click the arrow to collapse/expand. A "Compact context" button at the bottom of the card triggers /compact (same effect as typing the command); it shows "Compacting…" and disables while the compaction runs.
Built-in DeepSeek official pricing (CNY ¥, with peak/off-peak). To override or add, edit ~/.dsh/settings.yaml (hot-reloaded, no restart). Currency and peak/off-peak definitions both follow the API (route) — each route can set its own.
context-vista:
pricing:
"https://api.deepseek.com":
models:
deepseek-v4-pro:
peak: { hit: 0.3, miss: 9, output: 27 }
offpeak: { hit: 0.15, miss: 4.5, output: 13.5 }
context-vista:
pricing: # pricing table: outer key = route name or baseURL
"https://api.deepseek.com": # route 1: DeepSeek, CNY + Beijing-time peak/off-peak
currency: "¥" # this API's currency symbol (omit for default "¥")
timezone: 8 # timezone of peak/off-peak windows (UTC offset; omit for default 8)
peakWindows: # peak windows, HH:MM, inclusive start, exclusive end; start > end = crossing midnight
- start: "09:00" # peak start
end: "12:00" # peak end
- start: "14:00" # second peak start
end: "18:00" # second peak end
models: # models under this API (required)
deepseek-v4-pro: # model name
peak: # form 1 (peak/off-peak split) · peak price
hit: 0.3 # cached input, per 1M tokens
miss: 9 # uncached input, per 1M tokens
output: 27 # output, per 1M tokens
offpeak: # off-peak price
hit: 0.15 # cached input
miss: 4.5 # uncached input
output: 13.5 # output
"https://api.openai.com/v1": # route 2: OpenAI (ChatGPT), USD + no peak/off-peak
currency: "$" # this API's currency symbol
models: # no timezone/peakWindows → flat pricing
"gpt-5.5": # model name
hit: 2.5 # cached input, per 1M tokens
miss: 10 # uncached input, per 1M tokens
output: 30 # output, per 1M tokens
Prices are per 1M tokens in each API's billing currency;
currencyonly changes the displayed symbol, with no rate conversion. For APIs without peak/off-peak, just omittimezone/peakWindows. The numbers above are illustrative.
deepseek-official) or a baseURL (quote keys containing :).currency / timezone / peakWindows (each overrides the global default); models is required.{ hit, miss, output }, or peak/off-peak { peak, offpeak }.* is supported as a wildcard for the route name or model name.flash use the flash tier, otherwise pro).MIT