DeepSeek Harness plugin

dsh-md-table-formatter

Aligns markdown tables in assistant replies after each turn and adds a /clear-history command.

Jump to install

Source facts

Repository
Hyna-hla/dsh-md-table-formatter
Latest update
Aug 14, 2026
Category
UI Enhancements
GitHub stars
1
Format
bundle
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Hyna-hla/dsh-md-table-formatter
Plugin: dsh-md-table-formatter
Author: Hyna-hla

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-md-table-formatter

DeepSeek Harness 插件:两个功能,都建立在会话 surface-replace 机制上(与内置 compaction 同一套,可安全回放):

1. 自动对齐 Markdown 表格:每个回合结束后,把助手回复里没对齐的 GFM 表格在「模型可见表面」上替换为对齐版本。原始输出仍完整保留在仅追加的会话日志里。 - 支持 :---(左)、---:(右)、:---:(居中)对齐标记。 - 宽度按 Unicode 码点计算,CJK/全角字符按 2 列计算。 - 代码围栏(`` 内)的表格不动;连续两张表不会互相吞行。 2. /clear-history` 命令:把模型可见的对话记录整体替换为一条占位消息(原始日志保留,可继续对话)。回合进行中会拒绝执行。

移植思路来源:@franlol/opencode-md-table-formatter(OpenCode 的 experimental.text.complete 钩子 → DSH 的 turn/end + surface-replace)。

配置(cordis.patch.yml 可覆写)

- insert:
    - id: dsh-md-table-formatter
      name: dsh-md-table-formatter
      config:
        autoFormat: true      # 是否回合后自动格式化
        minColumns: 2         # 少于该列数的表格不动
        clearMarker: '(对话记录已清除)'  # /clear-history 的占位文本

构建与安装

pnpm install
pnpm build
pnpm test
# 安装到 profile(拷 node_modules + 注册 cordis.patch.yml):
.\scripts\install-to-profile.ps1 -Name dsh-md-table-formatter -SourceDir .
# 然后重启 DeepSeek Harness

实现要点

  • 替换事件 = assistant/message + { surfaceOp: { op: 'replace', start: seq, end: seq }, sourceEventSeqs: [seq] },与 dsh-compaction-tool-result-pruner 完全同款;替换副本保留原消息 id(freezeMessage),usage 只留在原始事件上避免重复计数。
  • 格式化 pass 由 session/event 观察者里的 turn/end 触发,用 queueMicrotask 逃出刚提交 append 的接纳边界后再写替换。
  • apply 是箭头函数(cordis 4 会把带 prototype 的 function 当类构造器)。