DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

@mimichunterz/agent-compact

Agent Compact

上下文压缩工具(context_compact):代理自行编写替代检查点,并将其交给主机压缩引擎,从而跳过 LLM 摘要调用;自动压缩仍使用官方引擎。

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

npx -y @deepseek-ai/dsh plugin --profile web add @mimichunterz/agent-compact@0.1.4
README兼容性版本

兼容性与来源证明

Agent Compact 以 @mimichunterz/agent-compact 发布,当前版本为 0.1.4。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
npm
Registry 更新时间
2026/9/20

版本

0.1.4stable
2026/9/7

相关插件

正在加载相关插件…

最新版
0.1.4
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
264.9 kB
文件数
25
Surface
web
许可证
MIT
发布源
npm
GitHub
★ 5
周下载
109
安全扫描
✓ v0.1.4 扫描通过
最近提交
2026/9/7
查看源码 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Weknora@wxg-prc-cpg/dsh-weknora适用于 DeepSeek Harness (dsh) 的 WeKnora 知识检索工具:通过自有知识库进行语义搜索、文档阅读以及 RAG/代理回答。Memsearch Dsh@zilliz/memsearch-dsh适用于 DeepSeek Harness 的 MemSearch 插件:在多个代理之间共享 Markdown 记忆,支持捕获、步骤前上下文注入、记忆召回技能和技能候选审核面板。

README

agent-compact

English · 简体中文

Context compression for DeepSeek Harness: lets the agent autonomously call context_compact to compress a span of the conversation it chooses — the finished, no-longer-needed middle — and replace it with a checkpoint the agent writes itself.

Why

Compaction is normally a full-context sweep: the official engine only ever compresses from the start of the conversation, so the opening's task plan and direction are partially lost along with the compressed information. context_compact compresses only the span the agent selects — a finished step, a debugged log exchange, an off-track discussion — while the important opening and the recent context stay intact. Span compaction keeps information loss from compaction as small as possible — like human memory, the middle is not compressed indiscriminately: what can be summarized is consolidated into a checkpoint, and important details stay word-for-word — the agent decides what is truly dead, and only that gets condensed.

Typical moments to use it:

  • a task step is done — compress it, keep the remaining steps and the active instruction live;
  • a bug hunt or a wrong research direction is over — compress that exchange into a short "what went wrong / root cause / fix" note;
  • the opening requirements are stale — compress the start and restate the current intent.

What it does

  • The agent picks the span via startAnchor / endAnchor (unique-prefix matching, CJK punctuation-width tolerant) and passes a required summary — the Markdown checkpoint it wrote itself.
  • The raw span is archived to the spill store first (~/.dsh/spill/session-<hash>/<hex>-<seq>.txt, sequential naming, restart-safe); the path is echoed in the shadow message so the model can read the raw text back.
  • The host engine runs the stock transaction — boundary validation, tool-pair balance, surface replacement — with no separate LLM summarizer request.

The tool call itself happens inside the agent's normal turn and is billed like any other turn; what is avoided is only the extra summarizer request the official engine would make for the same span.

Install

# from a published registry package
dsh plugin --profile web add @mimichunterz/agent-compact

# or from a local checkout
dsh plugin --profile web add ./agent-compact

dsh plugin forwards to pnpm in the profile directory and appends the bundle to dsh.profile.bundles (see the official publish guide). Restart the profile — every session then sees the context_compact tool.

The bundle's own cordis.patch.yml pins the spill archive root to ~/.dsh/spill (deployments can override it again through the profile's cordis.patch.yml).

Uninstall

dsh plugin --profile web remove @mimichunterz/agent-compact

dsh plugin remove forwards to pnpm remove in the profile directory: it uninstalls the package and reconciles the bundle out of dsh.profile.bundles. Restart the profile — every session then stops seeing the context_compact tool. The same package name works whether you installed from the registry or from a local checkout.

If the plugin was additionally mounted through a row in the profile's cordis.patch.yml (dev mode), remove that row too, otherwise the patch re-mounts it on the next boot.

Configuration

fielddefaultmeaning
autoArchivetruecontext_compact saves the full raw span to a spill artifact before replacing it
volumeNudgeTokens50000Every time accumulated surface growth (heuristic token count) since the last compaction crosses another multiple of this amount, remind the model to consider context_compact. 0 disables the nudge.

Pass through the inserted row in the profile's cordis.patch.yml or a bundle patch.

How it works

  • Agent-written checkpoint: summary is mandatory, so the tool path always uses the checkpoint the agent wrote. patchEngine() (see src/optimizer.ts) wraps the engine's summarize(): when an _externalSummary is present (one-shot, keyed per session id), it returns that text directly; only when none is present does it forward to the stock implementation — a branch that serves the automatic compaction path and keeps official behavior intact.
  • System-prompt guidance: the bundle registers a global prompt section (tool:context_compact, order 118) that tells the agent to use context_compact proactively — compress finished steps at topic boundaries instead of waiting for automatic full-context compaction.
  • Proactive volume nudge: a systemPrompt.context() injection (agent-compact:volume-nudge, order 50) reminds the model once each time the session's surface has grown by another volumeNudgeTokens (default 50000) multiple since the last compaction. It measures occupancy via contextPressure.projectedTokens (falling back to tokenMeter.measure().surfaceTokens); the growth baseline resets on every compaction/summary; 0 disables it. As a tail systemPrompt.context(), unchanged text is a no-op (KV-cache friendly) and it is independent of the auto-compactor's pressure threshold.
  • Anchor matching (src/normalize.ts): normText collapses whitespace and maps CJK full-width punctuation to half-width (,→, etc.), applied to both anchors and node text. Matching keeps unique-prefix semantics: zero hits → "not found" with closest-node hints; more than one hit → "AMBIGUOUS".
  • Restart-safe sequential archives: the next number is derived by scanning the session's spill directory (max+1) — gap-free; the backend's random hex prefix makes filename collisions impossible.
  • Paired cleanup: the tool-call message (carrying the full summary argument) and its tool/result are each replaced by one tiny shadow message, so the checkpoint text never appears twice on the surface (skipped when the message holds more than one tool call).

Compatibility

  • Built and verified against DeepSeek Harness 0.1.1-rc.2 (@deepseek-ai/dsh-compaction-basic@0.1.1-rc.2).
  • Only one compaction per session at a time (the engine transaction is serialized); anchors re-resolve on every call, so later compactions never go stale after earlier checkpoints replaced old nodes.
  • With a local spill backend the root is fixed; other backends degrade gracefully (no root field → in-memory counter), and compaction itself is unaffected.

License

MIT. The patch derives from @deepseek-ai/dsh-compaction-basic and related DeepSeek Harness packages (MIT, Copyright DeepSeek) — see LICENSE.