DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

@ya8d/dsh-directive-compact

Directive Compact

面向 DeepSeek Harness 的纯增量、指令驱动压缩:/compact-directive <requirement> 根据您的要求总结会话中段,/trim-directive <requirement> 根据您的要求裁剪整个对话

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

npx -y @deepseek-ai/dsh plugin --profile web add @ya8d/dsh-directive-compact@0.1.0-rc.1
README兼容性版本

兼容性与来源证明

Directive Compact 以 @ya8d/dsh-directive-compact 发布,当前版本为 0.1.0-rc.1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

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

版本

0.1.0-rc.1prerelease
2026/8/16
查看其余 1 个版本收起版本
0.1.0-rc.0prerelease
2026/8/15

相关插件

正在加载相关插件…

最新版
0.1.0-rc.1
DSH
*
HMR
重启进程
Tree shaking
已声明 sideEffects: false
解包体积
100 kB
文件数
18
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 1
周下载
54
最近提交
2026/8/16
查看源码 ↗项目主页 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题

README

@ya8d/dsh-directive-compact

A natural-language compaction plugin for DeepSeek Harness: tell the agent — in plain language — what to keep, what to drop, and how to compress an existing conversation. Designed for large-context models (1M-token window, e.g. deepseek-v4-flash).

Commands

CommandWhat it does
/compact-directive <requirement>Compresses the middle of the conversation. Keeps the session's fixed head (first user message + injected agent-instructions / system-prompt / skill-catalog) and the recent turns verbatim; summarizes everything between them per your requirement. The requirement is mandatory — an empty one returns a usage error.
/trim-directive <requirement>Trims the whole conversation per your requirement, with no region protection and no system-node protection — any content can be deleted by natural-language instruction, including the head, the injected skeleton, and anything /compact-directive cannot reach.

⚠️ Destructive — fork first. A trim/compaction permanently removes content from the model-visible conversation. There is no undo and no minimum retention. The original text is not lost (the session log is append-only and records every removed node), but restoring it needs tooling. Fork the session before destructive experiments.

Install

The dsh CLI is the entry point. How you invoke it depends on your setup:

  • If dsh is on your PATH (a global install), call it directly: dsh plugin ....
  • In a DeepSeek Harness checkout, use the workspace wrapper: pnpm dsh ... (or npx dsh ...).

Install into a profile (replace <name> with web, headless, or your own):

dsh plugin --profile <name> add @ya8d/dsh-directive-compact        # npm registry (latest)
dsh plugin --profile <name> add @ya8d/dsh-directive-compact@rc     # npm registry (release candidate)
dsh plugin --profile <name> add ./dsh-directive-compact            # local checkout

The package declares dsh.bundle, so the plugin row is activated automatically and nothing from the upstream composition is disabled — the plugin is a pure increment (it never touches the upstream ctx.compaction slot or /compact). Remove with dsh plugin --profile <name> remove @ya8d/dsh-directive-compact (or the matching pnpm dsh ... / npx dsh ... form).

Usage

Both requirements are plain free text in any natural language. Examples:

/compact-directive keep the login-related errors, compress the rest of the middle process
/trim-directive delete all git-operation records, keep the user's original instructions and the plugin-development goal

How the two differ

/compact-directive/trim-directive
RegionMiddle only; head + recent turns protectedThe whole surface; nothing protected
BaselineRequirement layered over a four-point summary baselineRequirement is the sole instruction (no baseline)
ResultOne checkpoint replacing the middleOne checkpoint replacing the whole surface
Use caseRoutine context compression with a focusAggressive / surgical deletion the head-protected command cannot reach

Operation mode (how a trim actually cuts)

/trim-directive runs every chunk in operation mode: the model sees each node numbered with its global event seq ([seq 28039] [user] …) and replies with a small operation manifest:

delete: 28039, 28045          remove whole nodes
delete-text: 28039, "..."     delete an exact fragment inside one node
rewrite: 28039                replace one node (partial edits) → its full new text
summarize: 28040-28045        replace a range with a short summary
---content--- … ---end---     (the replacement text for rewrite/summarize)
<<NO_CHANGE>>                 nothing to change in this chunk

The plugin then executes the manifest programmatically: untouched nodes keep their original text, deleted nodes drop, delete-text fragments are removed by exact string match, rewritten nodes take the model's content, summarized ranges take the summary. Any malformed or uncertain manifest (prose, unknown ops, out-of-range seqs, overlaps, a split tool call/result pair, missing content) falls back to a plain rewrite of the chunk — the plugin never half-executes.

When there is nothing to remove

A trim/compaction that finds nothing worth changing is a normal outcome, not a failure:

  • Per-chunk declaration (trim). If the requirement changes nothing in a chunk, the model replies with exactly <<NO_CHANGE>> (or an empty manifest); the command layer keeps that chunk's original rendering verbatim in the checkpoint. A marker buried in other output is treated as content, not a declaration — a model that misuses the marker can only fail to shrink, never silently drop content.
  • Shrink validation. If the assembled checkpoint is still not smaller than the span it replaces (e.g. every chunk declared no change), the command reports a no-change success — Nothing to trim: … / Nothing to compact: … — and leaves the conversation exactly as it was. It never loops, retries, or hangs. (This is why a directive like "delete all telemetry mentions" on a session with no telemetry returns with a message instead of churning for many minutes.)

Where the command and its effect appear

  • Commands are log-only, not dialogue. Like every dsh slash command (including upstream /compact), these commands do not appear as messages in the conversation UI. The invocation, result, and compaction lifecycle are visible in the session trace/log.
  • The original dialogue stays visible in the UI after a trim/compaction. The conversation transcript never erases what you already saw (dsh's design; upstream /compact behaves the same). The model uses the checkpointed context on its next request — to verify the effect, read the session trace, not the chat transcript.

Configuration

All fields are validated through the Cordis Config schema and settable from cordis.yml:

FieldDefaultMeaning
keepHeadUsers3User turns kept verbatim at the head (after the fixed skeleton) when planning the compact middle.
keepTailUsers3User turns kept verbatim at the tail; the last user utterance is always kept regardless.
summarizationProvider''Provider for the summarization call; falls back to the routed provider when empty.
summarizationModel''Model for the summarization call; falls back to the routed model when empty.
maxTokens8192Generation cap for the /compact-directive summarization call.

Known Limitations

  • A trim can take minutes. The model reasons about your requirement before cutting (deliberately — disabling reasoning would hurt the cut decisions). A small conversation trims in about three minutes; a large one (~180K+ tokens, several parallel 50K chunks) can take 5–10+ minutes.
  • Model judgment is the trim's engine — and its limit. The model decides what survives from the rendered dialogue. It generally follows the requirement, but it is not a deterministic per-node delete: a surgical instruction ("delete exactly this one message") can be interpreted as a broader compression, and an ambiguous requirement may yield an unexpected result. Check the session trace after a trim.
  • The injected skeleton is trim-able, and regenerates. /trim-directive can remove the injected agent-instructions / system-prompt / skill-catalog nodes. They are re-created on the next request by the agent loop, so the model keeps its environment; nothing needs manual re-injection.
  • A trim whose total input exceeds 20 × 50K heuristic tokens fails loud with "compact the session first" — before any model call opens. Compact the session first, then trim again.

Further reading

  • docs/observability.md — what each log line means, enabling debug output, diagnosing a slow or stalled run.
  • docs/model-experience.md — what the model sees and the token / KV-cache effects of each command.
  • docs/testing.md — running the test suites.

License

MIT

相关插件

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

Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件Weknora@wxg-prc-cpg/dsh-weknora适用于 DeepSeek Harness (dsh) 的 WeKnora 知识检索工具:通过自有知识库进行语义搜索、文档阅读以及 RAG/代理回答。Memsearch Dsh@zilliz/memsearch-dsh适用于 DeepSeek Harness 的 MemSearch 插件:在多个代理之间共享 Markdown 记忆,支持捕获、步骤前上下文注入、记忆召回技能和技能候选审核面板。Reme@agentscope-ai/reme面向 TypeScript 代理的 ReMe 客户端和记忆集成