DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Context Triage — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
C

dsh-context-triage

Context Triage

会话上下文分诊插件:为 DeepSeek Harness (dsh) 自动筛查过期与冗余的上下文内容,以判决式处理节约 token 预算。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add dsh-context-triage@0.1.0
README兼容性版本

兼容性与来源证明

Context Triage 以 dsh-context-triage 发布,当前版本为 0.1.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
npm
Registry 更新时间
2026/8/21

版本

0.1.0stable
2026/8/21

相关插件

正在加载相关插件…

最新版
0.1.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
119.9 kB
文件数
56
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 0
周下载
0
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 memory-context 分类下经过校验的插件。

Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Mnemondsh-mnemon面向 DeepSeek Harness 的可组合三层记忆控制平面:持久化运行时上下文、可搜索的项目文档、可插拔的长期记忆、受保护的策略、WebUI 和无头工具。Memsearch Dsh@zilliz/memsearch-dsh适用于 DeepSeek Harness 的 MemSearch 插件:在多个代理之间共享 Markdown 记忆,支持捕获、步骤前上下文注入、记忆召回技能和技能候选审核面板。Memory@furongjun1999/dsh-memory灵枢(Lingshu·líng shū)DeepSeek Harness 插件:完整大脑——长期记忆/知识飞轮/自我认知/递归反思接入 DSH,对话自动沉淀进 md_cg 认知图(md 文档)

README

简体中文

dsh-context-triage

A session context triage plugin for DeepSeek Harness (dsh) that automatically manages context volume during long sessions: it identifies and handles stale, duplicate, failed, oversized, and low-value message content to save token budget and curb context bloat.

Features

  • Deterministic, zero model dependency: all verdicts and rewrites are produced by heuristic rules—no LLM calls, no extra services; behavior is predictable and testable offline.
  • Five Screeners, each independently switchable:
    ScreenerVerdict ruleHandling action
    Stale output staleOutputTool call pairs more than N turns after the latest user message, with results still completeCall block rewritten to an archive summary, result block removed
    Repeated call repeatedCallCall pairs with the same tool and same arguments (JSON key order irrelevant)Only the most recent is kept; older call pairs are cut
    Failed call failedCallStale error results (isError)Input arguments replaced with a failure stub (prevents leakage / saves space), error text kept and trimmed
    Oversized block oversizedBlockTool result text exceeds the character capHead/tail trimmed, middle annotated with the omitted amount
    Stale reasoning staleReasoningReasoning blocks beyond the retention turns; kept blocks exceeding the length capRemoved; or trimmed (within the reserve region only trim, never delete)
  • Reserve area (reserve): content within the most recent N user turns is never touched, avoiding disruption of context the model is currently using.
  • Exemption list (exempt): two-dimensional tool-name and file-path glob exemption (protects stateful tools like task/skill/todowrite/todoread/write/edit/batch by default).
  • "Worth it" check: any archive/stub action requires the rewrite to be strictly smaller than the original, ruling out changes that cost more; call-pair-level actions (archive = rewrite + cut) take effect or are abandoned as atomic groups.
  • Audit report: every triage outputs structured statistics—counts and savings per reason, per-item details, and suggested compression ranges; visible through the tool, the command, and the CLI.
  • Native integration with the dsh compression seam: implements ctx.compaction (CompactionEngine); auto-pressure, context overflow, manual, and forced region compression all go through the official harness mechanism. Replacement summary messages use a checkpoint source recognized by any backend-agnostic consumer.

Installation and mounting

The plugin is distributed as a bundle: dsh.bundle.patch in package.json points to cordis.patch.yml (the patch inserts the plugin line; config can be overridden on the line).

Installing in DSH

dsh plugin --profile demo add github:JohnXu22786/context-pruner

Option 1 (mount from a local directory, recommended):

dsh plugin --profile web add link:/absolute/path/context-pruner

Option 2 (manual patch): merge the entry in cordis.patch.yml into the profile's cordis.patch.yml, or launch it directly as an overlay:

dsh web --patch ./cordis.patch.yml

Option 3 (git source):

dsh plugin --profile web add "github:your-repo/context-pruner#main"

After mounting, use dsh --profile web --dump-config to check whether the plugin line reaches the startup tree.

Note: ctx.compaction allows only one provider per context. If your profile already loads another compression implementation (e.g., the built-in base compression backend), disable one of them via the patch's disabled: true—they cannot coexist.

Interface

Entry point (manifest)

ItemValue
Package namedsh-context-triage (dsh.bundle.patch in package.json declares the bundle)
Main entrylib/index.js (main/exports; ./core and ./dsh subpaths available for embedders)
Plugin namecontext-triage
Dependency injectiontools (required); the command registry is optionally probed via ctx.get('commands'), silently skipped if absent
ConfigExports Config (Schemastery Schema); defaults in the config table below

The plugin is a functional plugin: it exports name / inject / Config / apply(ctx, config), called by cordis after validating config and filling defaults.

Provided extension points

Extension pointDescription
Service ctx.compactionTriageCompactionEngine extends CompactionEngine, implementing compactIfNeeded (auto-pressure / overflow), compactNow (manual idle compression), compactRegion (forced region compression)
Tool triage_historyModel-visible; parameter dryRun?: boolean. Runs one triage and returns the audit report to the model; with dryRun=false and a worth-handling region present, applies it directly
Command /triageHuman command, bypasses the model; outputs the audit report and applies worthwhile handling

How a compression transaction lands

Triage results are written to the session log as a standard compression transaction (append-only; history is not rewritten):

  1. compaction/start (holds the lock until the paired compaction/end)
  2. compaction/summary (summary content, masked regions, masked seq list, and heuristic token cost; llmStreamCall absent = non-model summary)
  3. user/message + surfaceOp: { op: 'replace', start, end } + sourceEventSeqs (replacement summary message, source is the checkpoint source)
  4. compaction/end

The model-visible history is derived from the session log; after the replacement, deriveMessages() naturally yields [summary message, ...retained content]—no in-place modification of historical records is needed.

Configuration

All fields have defaults; only override what you want to adjust. Invalid values (negative turns, out-of-range ratios, etc.) throw at load time. Example:

# cordis.patch.yml
- insert:
    id: context-triage
    name: dsh-context-triage
    config:
      budget:
        contextTokens: 200000   # lower for smaller-context models
        softRatio: 0.6
      screeners:
        staleOutput: { turns: 5 }
        staleReasoning: { enabled: false }
      exempt:
        tools: [task, skill, write, edit]
FieldDefaultDescription
enabledtrueMaster switch
reserve.turns3Reserve area: content within the most recent N user turns is not processed
budget.contextTokens1000000Estimated context window (tokens); determines the pressure ratio
budget.softRatio0.7Usage above this ratio → auto-compression triggers (pressure)
budget.hardRatio0.9Usage above this ratio → pressure report marked forced (hard) grade
budget.minSavingsTokens2000No action when estimated savings are below this
screeners.staleOutput.turns8Call pairs more than N turns after the latest user message are archived
screeners.repeatedCall.enabledtrueRepeated calls cut
screeners.failedCall.turns4Failed-call handling threshold (turns)
screeners.failedCall.errorKeepChars400Error text kept for failed calls (chars)
screeners.oversizedBlock.capChars6000Tool result text cap (chars); beyond it, head/tail trimmed
screeners.oversizedBlock.headChars / tailChars800 / 400Head/tail length kept during trimming
screeners.staleReasoning.keepTurns3Keep reasoning blocks within the most recent N user turns
screeners.staleReasoning.maxBlockChars2000Length cap for kept reasoning blocks; beyond it, trimmed
exempt.tools[task, skill, todowrite, todoread, write, edit, batch]Exempt tool names

Local experience (no dsh required)

src/core is a framework-agnostic engine with an offline replay CLI; it runs directly against a JSONL session file:

npm install
npm run build
node lib/cli/replay.js examples/session.sample.jsonl --config examples/demo.config.json
node lib/cli/replay.js examples/session.sample.jsonl --config examples/demo.config.json --show-transcript

Replay format (one JSON event per line; seq determined by line order):

{"type":"user/message","text":"项目构建失败了"}
{"type":"assistant/message","reasoning":"…","calls":[{"id":"c1","name":"bash","arguments":"{\"cmd\":\"npm run build\"}"}]}
{"type":"tool/result","callId":"c1","text":"…","isError":false}

Sample output in examples/report.example.md; tests cover all screeners, merge priorities, atomic groups, audit consistency, and end-to-end replay (npm test).

Design trade-offs

  • Token estimation is heuristic: CJK ≈ 1 token/char, others ≈ 4 chars/token; used only for pressure verdicts and audit statistics, not for billing. Configure budget.contextTokens per your actual model window.
  • Rewrites always yield net savings: archive summaries, failure stubs, and trimming all compare the sizes before and after the action; unattractive findings are automatically abandoned. Call-pair actions are judged as atomic groups, so there is no half-done state like "summary kept, result split."
  • Prompt caching: compression changes the message sequence, invalidating the prompt cache prefix after that point. In long sessions, saved tokens usually vastly outweigh cache recomputation cost; for pay-per-request providers (no cache billing) it is pure gain.
  • Never touches user input: the oversized-block screener only acts on tool results; user messages are never rewritten unless the whole reserve region covers them.

License

Released under the MIT License.

exempt.filePatterns[]Exempt path globs (match call arguments filePath/path), e.g. ['**/*.lock']
summary.capChars20000Compression summary char cap
summary.headRatio0.4Head retention ratio when trimming the summary