Introduction¶
DeepSeek Harness (DSH) focuses on a plugin-based architecture. During use, developers often encounter two specific pain points: first, the inability to intuitively estimate the token consumption of a single request; second, the lack of cross-session consumption statistics and cost tracking, as well as repeated prompt optimization work. dsh-plugins is a personally maintained plugin collection package intended to install three commonly used plugins from one repository to solve the above problems.
Core Features¶
This plugin collection includes the following three main components:
* tokprev: Single-turn token input preview and actual consumption badge.
* tokstats: Cross-session token consumption statistics panel.
* promptopt: AI prompt rewriting tool for Composer drafts.
Feature Details¶
tokprev: Token Preview and Actual Report¶
This plugin provides a closed loop of “preview before sending + actual report after sending” for single-turn token consumption.
1. Pre-send Preview
Displays the estimated value for the next input at the bottom of the Composer. This value consists of three parts: context baseline, queued messages, and draft content. It updates in real time as the user types. It also displays the input proportion and the estimated output range.
2. Actual Consumption Badge
On the final assistant message at the end of each turn, a line of de-emphasized small text is rendered to show the actual consumption of all calls in that turn. The billable input scope includes inputTokens, cacheReadTokens, and cacheWriteTokens.
tokstats: Cross-session Statistics¶
The DSH host’s StatsLine only supports single-session statistics. This plugin opens an overlay panel via a sidebar footer button to display detailed cross-session data.
1. Statistical Dimensions
Supports viewing request counts and token buckets by time period (today, this week, cumulative). Supports aggregation by workspace (sub-sessions are merged along the parent chain to the root workspace), and cost estimation grouped by model.
2. Initialization
After the first installation, the panel displays “Statistics in progress…” until any session is opened or a statistics push arrives.
promptopt: Prompt Optimization¶
Provides a star button inside the Composer card’s internal tool row (between model selection and the send button). Clicking it invokes the model to rewrite the draft. The original text and optimized text are displayed for comparison, and the optimized result is written back to the input box only after “Adopting” it.
1. Language and Limitations
The optimized output follows the draft language and does not go through the dictionary. If the draft contains quote chips, images, or / commands, the button will be greyed out and disabled.
2. Performance and Overhead
This is a side-channel model call. It is not included in the cross-session statistics log, and model selection in the configuration panel is not supported.
Installation and Activation¶
This plugin package uses pnpm as an installation adapter and supports direct installation from a GitHub repository.
npx @deepseek-ai/dsh plugin --profile web add github:PlusQi/dsh-plugins
After installation, the dsh web process must be restarted. Profile combinations only take effect at startup.
Single Plugin Toggle¶
To temporarily disable a single plugin without modifying the code, edit the host configuration file:
# 编辑 ~/.dsh/profiles/web/cordis.patch.yml
- id: tokprev
disabled: true
Restart to apply. Note that disabling a plugin only removes the host-side fiber. For pure UI plugins (such as tokprev), the browser-side UI may not disappear immediately and will be unloaded only when no other active plugins remain in the package.
Notes¶
- Locale Dependency: The plugins depend on the host’s locale service. If the host has not enabled it or it has been disabled, the entire package will not be loaded, resulting in the plugin UI disappearing and no logs.
- Cost Estimation: The amount shown in tokstats is an estimate based on DeepSeek’s official peak unit price, and can be overridden via a patch file.
- Promptopt Behavior: The optimized output is not persisted to disk, and there is no checkpoint. When adopted, the draft snapshot at the time of invocation is used, and subsequent changes will be overwritten.