dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
English | 简体中文
A plugin for manually reducing context usage in DeepSeek Harness (DSH). It replaces old tool output and large code and XML blocks in assistant replies with short placeholders. When needed, the model can retrieve the original text through shake_read.
Third-party plugin notice: dsh-shake is an independently maintained third-party plugin for DeepSeek Harness (DSH), not an official DeepSeek product. References to DeepSeek Harness indicate compatibility only and do not imply recognition, sponsorship, or endorsement by DeepSeek.
No model-generated summaries. No deletion of original logs. /shake only schedules cleanup; the actual replacements happen before the model request in the next normal conversation turn.
Installation · Usage · Cleanup Scope · Configuration · Reading the Original Text · Limitations and Recovery
Component · Declared support range · Verified baseline DeepSeek Harness (@deepseek-ai/dsh and the corresponding @deepseek-ai/dsh-* host services) · 0.2.1-rc.2 · 0.2.1-rc.2 The Cordis fork used by DSH (@deepseek-ai/cordis) · ~4.0.5 (>=4.0.5 <4.1.0) · 4.0.5
The supported host service versions are defined by peerDependencies in package.json. Cordis refers to @deepseek-ai/cordis, not the unscoped cordis package. Compatibility outside the ranges above is not guaranteed.
^22.23.4 || ^24.22.1 || >=26.12.1. CI pins 24.22.1; use a patched runtime with its normal CA verification enabled. Development retains pnpm 11.7.0, while publishing uses npm 12.2.1.Install dsh-shake@latest from npm.
Check the DSH version, then install dsh-shake@latest from npm:
dsh --version
dsh plugin --profile web add dsh-shake@latest --ignore-scripts
dsh --profile web --dump-configConfirm that the configuration output includes dsh-shake. If DSH is already running, stop it first, then start Web:
dsh webInstalling the prebuilt package does not require linking source code or running build scripts. The default configuration is ready to use.
/shakeIf execution has not started, you can cancel:
/shake cancelCancellation applies only to pending requests. It cannot undo completed replacements.
Situation · Meaning and action “No cleanup needed” message · There is currently no eligible text that would save tokens. No further action is needed. The session is busy or under maintenance · Wait until the session is idle and retry. The command neither interrupts existing work nor queues itself. A request is already pending · Each session can have at most one pending request. Repeating /shake does not reselect content. Cancel first if you want to schedule a new selection. Attachments or other arguments are included · Only /shake and /shake cancel are supported; neither accepts attachments.
By default, the plugin counts backward from the newest history and protects approximately the most recent 4,000 tokens. Any message that crosses this boundary is also kept in full. Only earlier history is searched for the following content:
Content · Default eligibility criteria Successful tool results · The combined text within a single result must contain at least 1,000 tokens. Only text is replaced; non-text content such as images and the original metadata are preserved. Plain-text assistant replies · A single complete fenced code block or XML block must contain at least 400 tokens. Text outside the block and its order are preserved.
Placeholders also have a cost, so content is skipped if replacing it would not produce a net saving. Eligibility is checked again during execution; fragments that have already been replaced by another operation or are no longer suitable for cleanup are also skipped.
The following content is never cleaned up:
shake_read results, and this plugin's control records, history excerpts, and content carrying those origins.Note: Skill and plan text returned by ordinary read tools receives no extra protection and may still be cleaned up as tool results. The mandatory protections above cannot be disabled through configuration.
Keep the defaults unless you need to change them. To adjust settings, add a configuration override to the target profile's cordis.patch.yml. Do not insert a second plugin instance.
The default configuration is shown below:
- id: dsh-shake
config:
protectedTokens: 4000
toolTextMinTokens: 1000
assistantBlockMinTokens: 400
readDefaultLimit: 2048
readMaxLimit: 4096Parameter · Default · Purpose protectedTokens · 4000 · The amount of recent history to protect, counted using locally estimated tokens, with whole messages preserved. toolTextMinTokens · 1000 · A tool result is considered for cleanup only when its total text reaches this threshold. assistantBlockMinTokens · 400 · An individual code or XML block in an assistant reply is considered for cleanup only when it reaches this threshold. readDefaultLimit · 2048 · The page size for shake_read when limit is omitted, measured in Unicode code points. readMaxLimit · 4096 · The maximum page size allowed by shake_read, in the same units.
The first three values must be non-negative safe integers. Pagination settings must be integers satisfying 1 ≤ readDefaultLimit ≤ readMaxLimit ≤ 4096. No other configuration fields are accepted.
Restart DSH after making changes. Requests that have already been scheduled retain the configuration and candidate fragments saved when they were scheduled.
Replaced text leaves a placeholder containing a ref. The model can call the `shake_read` tool to retrieve that fragment; it is not a slash command for users to enter.
Example arguments (replace the sample ref value with the full reference from the placeholder):
{
"ref": "<copy the full ref from the placeholder>",
"offset": 0,
"limit": 2048
}The response contains the current page's text, the current offset, the fragment's totalLength, the next page's nextOffset, and the completion flag done.
ref and set offset to the previously returned nextOffset.done: true and nextOffset: null indicate that reading is complete.offset must be a non-negative safe integer and cannot exceed the fragment's total length. An empty page is allowed when the offset is exactly at the end. limit must be a positive integer no greater than the configured readMaxLimit.A reference is a locator, not permission to read. The tool verifies the original text, actual replacement records, and checksums in the current session. Only fragments that were actually removed can be read. File paths and other session IDs are not accepted.
user/message. Unselected text is preserved, but the original assistant-role semantics are not.Situation · Behavior Restarting DSH or reopening a session · Pending requests are recovered from the log and wait for the next normal input before executing. No model call is made automatically. Forking a session · Pending requests inherited from the parent session are not executed automatically. Reading is limited to the original text and replacement evidence inherited by the child session itself; parent and sibling sessions are not queried. Cancellation or failure during execution · Committed replacements remain; there is no automatic rollback. Recovery determines progress from the actual log and does not silently send model requests. Cleanup that has been recorded as failed is not retried automatically. Session persistence cannot be confirmed · The command does not report success, and execution does not allow subsequent model requests to proceed. Check the host's save capability and logs.
Stop DSH first, then remove the plugin:
dsh plugin --profile web remove dsh-shakeIf you added a custom configuration override, remove it as well, then restart:
dsh webUninstalling does not undo completed replacements or delete the original text. DSH can still open the session, but shake_read is no longer available. Pending requests remain and can be recovered when the plugin is loaded again.
Implementation and persistence details
dsh.bundle.patch. The plugin manager adds the bundle to the profile's dsh.profile.bundles; the bundled patch explicitly supplies config: {} to enable defaults. The pinned host rejects plugin configurations that omit config entirely.shake:1:::. Persisted ranges use half-open UTF-16 indices and UTF-16LE SHA-256 checksums; they cannot be used as pagination offsets for shake_read.flush first while the latest result in the same session remains completed. This is not a one-time retry.dispose return does not mean saving succeeded, nor does it imply a hardware-level fsync guarantee.MIT. See THIRD_PARTY_LICENSES for attribution of the adapted OMP scanner, the pinned upstream commit, and the full license notices.