DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Dafiyu Fold — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins
D

dafiyu-fold

Dafiyu Fold

Archive the original context before DSH compaction replaces it with a summary. Wraps the official summarize() without touching the engine.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:cazhaniyyah603-ui/dafiyu-fold#c3a58257762c3a57d16d0bf30e3d8466b09fc665
READMECompatibilityVersions

Compatibility and provenance

Dafiyu Fold is published as dafiyu-fold and currently resolves to version 1.0.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
github
Registry updated
10/18/2026

Versions

1.0.0stable
10/18/2026

Related plugins

Loading related plugins…

Latest
1.0.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
any
License
MIT
Source
github
GitHub
★ 0
Weekly downloads
0
Last push
10/18/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in memory-context.

Ab Memorydsh-ab-memory--- description: "The dsh-ab-memory package: a cross-session, file-backed agent memory with five tools (remember / recall / forget / load_skill / distill) and an always-on light injection." kind: "package-reference" ---Contextdsh-contextA DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.Mnemondsh-mnemonComposable, view-based memory for DeepSeek Harness. Pluggable sources and strategies, with layered memory out of the box.Archive Manager@michengai/dsh-archive-manager归档、恢复、收藏和永久删除会话,并诊断损坏的会话日志。 · Archive, restore, favorite, and permanently delete sessions, and diagnose damaged session logs.

README

dafiyu-fold

v1.0.0 | MIT

折之前,把要被折掉的原文存一份。

DSH 的官方上下文压缩(compaction)把一大段历史压成摘要时,只留摘要,原文就没了。 被折掉的那些话——你说的、它说的、当时为什么那么想——说得再准也找不回来。

这个插件不替换官方引擎、不改它的提示词、不动任何阈值。 它只做一件事:在官方动手之前,把这一段原文整段抄到磁盘。


它做什么

每一轮折叠发生前,你会得到一份 Markdown:

~/.dsh/fold-archive/折叠-插件-2026-10-18T06-19-18.md

里面是按角色分好的一条条消息,原样保留。摘要照旧由官方生成,你照旧在会话里看到摘要——只是这一次,原文也在。

它不做什么

  • 不替换官方压缩引擎(是包一层,不是换掉)
  • 不改提示词、阈值、保留量
  • 不联网、不上传、不发任何东西出去
  • 不动会话文件本身(折叠仍然由官方完成,它只是在旁边抄一份)

安装

一键从 GitHub 装(DSH 0.2.0 实测可用,8 秒装完 v1.0.0):

dsh plugin --profile desktop add github:cazhaniyyah603-ui/dafiyu-fold

装完还要做两件事,缺一样它都不会干活:

  1. 把 dafiyu-fold 加进 profile 的 package.json → dsh.profile.bundles 数组;
  2. 在 cordis.patch.yml 里把 - id: dafiyu-fold 那一行写进 compaction 分组内(见下一节,这条最容易错)。

也可以手动装:把仓库目录放进插件目录,然后在 profile 的 package.json 的 dependencies 里写 "dafiyu-fold": "link:/绝对路径/到/dafiyu-fold"。

⚠️ 关键一步:必须放进 compaction 分组

这是唯一容易配错的地方,也是这个插件最值得说的一条经验。

DSH 把一个折叠服务关在 isolate 分组 里:

- id: compaction
  name: cordis:group
  group: true
  isolate:
    compaction: true      # ← 服务只在这间屋子里对外开放
    toolResultPruner: true
  config:
    - id: compaction-basic
      name: '@deepseek-ai/dsh-compaction-basic'
      config:
        thresholdRatio: 0.22
        retainTokens: 40000

isolate 的语义是:这个服务只对同一个分组里的插件可见。

所以插件那一行必须写成 compaction-basic 的兄弟:

  config:
    - id: compaction-basic
      name: '@deepseek-ai/dsh-compaction-basic'
      config:
        thresholdRatio: 0.22
        retainTokens: 40000
    - id: dafiyu-fold        # ← 放在这里
      name: dafiyu-fold

写在 profile 最外层是不行的——inject(['compaction']) 会永远等不到,apply 里也读不到 ctx.compaction(会报 cannot get property "compaction" without inject)。

验证它真的在跑

看日志:

tail -f ~/.dsh/dafiyu-fold.log

正常应该是这样:

[...] apply 进来了 ✓
[...] inject('compaction') 的回调进来了 ✓
[...] inject 回调:包好了 ✓ 以后每次折叠都会先把原文落盘

看到最后一行,就说明成了。之后每次折叠都会多一个 折叠-插件-*.md。

配置

环境变量默认值作用
DAFIYU_FOLD_DIR~/.dsh/fold-archive原文存哪儿
DAFIYU_FOLD_LOG~/.dsh/dafiyu-fold.log日志写哪儿

它是怎么包的

ctx.inject(['compaction'], child => {
  const proto = Object.getPrototypeOf(child.compaction);
  const original = proto.summarize;
  proto.summarize = async (input, agent, signal) => {
    存档(input);
    return original.call(this, input, agent, signal);
  };
});

拿到活着的那台引擎,只覆盖 summarize() 这一个方法。官方引擎的其余部分一动不动。

已知限制

  • 这是对内部接口的包裹(summarize 是官方引擎的子类钩子),DSH 大版本升级时可能失效。失效的表现是日志里出现 没有 summarize ✗,删掉插件那一行即可,不会影响启动。
  • 只留这一次调用收到的输入。如果官方引擎在一次折叠里分多轮调用,会得到多份文件——这正是想要的行为。
  • 存档目录会一直变大。介意的话自己定期清理,插件不做自动删除(不替人删东西)。

更新记录

v1.0.0 — 2026-10-18

  • 第一版。折之前把原文整段落盘,摘要照旧走官方。
  • 只包 summarize(),不改引擎其余部分。
  • 默认目录 ~/.dsh/fold-archive/,可用 DAFIYU_FOLD_DIR / DAFIYU_FOLD_LOG 覆盖。
  • 已知的配置坑(isolate 分组)已写进 README 上面那节。
  • 发布前验过:五份文件无 BOM;用假引擎真调过一次 summarize,原文确实落盘、返回值原样透传。

License

MIT