DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

dsh-better-edit

Better Edit

面向 DeepSeek Harness (dsh) 的基于哈希锚点的 read/edit/undo_last_edit 工具。每行都有一个唯一的 3 字符哈希(A-Za-z0-9),在编辑过程中保持稳定;过时或有歧义的锚点会被拒绝,绝不会进行模糊匹配。撤销状态会在重启后保留。

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

npx -y @deepseek-ai/dsh plugin --profile web add dsh-better-edit@0.8.2
README兼容性版本

兼容性与来源证明

Better Edit 以 dsh-better-edit 发布,当前版本为 0.8.2。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

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

版本

0.8.2stable
2026/9/14
0.8.1stable
2026/9/11
0.8.0stable
2026/9/9
查看其余 27 个版本收起版本
0.7.1stable
2026/9/6
0.7.0stable
2026/9/6
0.6.3stable
2026/9/5
0.6.2stable
2026/9/3
0.6.1stable
2026/9/1
0.6.0stable
2026/8/31
0.5.1stable
2026/8/30
0.5.0stable
2026/8/29
0.4.1stable
2026/8/27
0.4.0stable
2026/8/24
0.4.0-rc.1prerelease
2026/8/24
0.3.2stable
2026/8/24
0.3.1stable
2026/8/21
0.3.0stable
2026/8/20
0.2.2stable
2026/8/19
0.2.1stable
2026/8/18
0.2.0stable
2026/8/16
0.1.9stable
2026/8/15

相关插件

正在加载相关插件…

最新版
0.8.2
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
588.8 kB
文件数
138
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 0
周下载
655
安全扫描
✓ v0.8.2 扫描通过
查看源码 ↗项目主页 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题
0.1.8
stable
2026/8/15
0.1.7stable
2026/8/15
0.1.6stable
2026/8/15
0.1.5stable
2026/8/15
0.1.4stable
2026/8/15
0.1.3stable
2026/8/15
0.1.2stable
2026/8/15
0.1.1stable
2026/8/15
0.1.0stable
2026/8/14

相关插件

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

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Sdk Minimal@deepseek-ai/dsh-sdk-minimal独立的最小 SDK 配置包:JSON-RPC、一个 DeepSeek 适配器、持久化 Shell 和 JSONL 会话Sdk App@deepseek-ai/dsh-sdk-appdsh SDK 配置包:基于 dsh-base 提供 stdio JSON-RPC 服务和进程生命周期管理Subagent Codex@deepseek-ai/dsh-subagent-codex基于官方 app-server 协议的一次性 Codex 子代理提供程序

README

dsh-better-edit

dsh-better-edit

A better edit tool for DeepSeek Harness
Position-free hashes — one read, many edits, fewer tokens, more room for real work.

English · 简体中文

Quick Start • Why Hashline • Tools • Benchmark • How Anchors Work • Development

file.ts → read → hashed lines → edit by hash → diff


"The harness — not the model — is the bottleneck." — Can Bölük, The Harness Problem

This is the harness fix. Hashes replace line numbers — edits above don't shift anchors below. One read serves many edits; drift outside your range passes with a notice, true conflicts retry with fresh anchors — no full read needed.

3 calls vs 6 · -55.8% tokens · 23/23 correctness. Same external-drift refactor, same file (single stochastic run; method). Payload numbers are deterministic — see Benchmark.

Why you need this

If you've watched line 47 → 74 corrupt a file after an insert — this is for you.

Before: str_replace / line numbersAfter: hashline edit
Re-types old code (~5-6× billed)Two 3-char hashes, old text never echoed
One insert shifts every number → silent wrong lineContent addresses — edits above don't move anchors below
No check against what was shownEvery line verified; [E_STALE_RANGE]/[E_UNSERVED_RANGE] reject before write, then reject-and-serve returns fresh HASH│content

[!TIP] Shining points — honest:

  • Position-free. read 1..5 → insert @0 → edit 10..12 still lands at 10..12. Anchors are canon(line) hashes, not positions (ADR-0013). Exterior drift is a notice, not a re-read.
  • Fewer round-trips. Single-session 1 read → N edits — no ritual re-reads. Multi-session exterior A:10..12 / B:20..30 also passes; only overlapping A∩B≠∅ retries once via servedRows (no full read). Harness 9/9 green.
  • Fewer tokens. Compact payload {path, edits:[[from,to,text]]} + never echoing old_string; diff/echo/rejection rows count as serves. Envelope -40% pinned 12-edit corpus, session -55.8% on external-drift.
  • Concurrent-safe, not silent. retired anchor per (session,path) epoch blocks re-bound S@3→@3; retired + canon + hash + changed∩[L,R] makes pos-free single-thread and strict only on true overlap. One retry vs silent wrong-line.

Not for one-line touch-ups (near parity) or new files (write). Pays off in long sessions and structural edits.

Quick Start — install to verified edit in 30s

Install (pick one)

npx @deepseek-ai/dsh plugin --profile web add github:Rianico/dsh-better-edit   # from github
npx @deepseek-ai/dsh plugin --profile web add dsh-better-edit                 # from npm
npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-better-edit       # local

No config. Next session runs with hashline tools. Verify:

dsh --profile <name> --dump-config   # shows "# == dsh-better-edit" layer
Requirement
Node^22.19.0 || >=24.0.0
Profiledsh profile (dsh plugin creates one)
Backendssandboxed / remote ctx.fs

See it work

read serves HASH│content — the hash is the address:

ve7│function hello() {
szJ│  console.log("world");
kQm│}

edit by hashes — always lands where you meant:

{ "path": "src/main.ts", "edits": [["szJ", "szJ", "  console.log('hi');"]] }

Returns a diff with fresh anchors — next edit needs no read:

- szJ │   console.log("world");
+ a3m │   console.log('hi');
  kQm │ }

Position-free in one line: read 1..5 → insert @0 → edit 10..12 still verifies 10..12 (resist mode). Multi-session honesty: A:10..12+1 shifts B:20..30→21..31 → B passes (drift notice); B:12..13 overlapping A → E_STALE_RANGE + fresh rows, one retry.

Batch atomically — one edit, up to 32 same-file ranges:

{
  "path": "src/main.ts",
  "edits": [
    ["a1b", "a1b", "new line 1\n"],
    ["c3d", "c3d", "new line 2"]
  ]
}

One fails → none write ([E_BATCH_ABORT]).

[!TIP] Want proof before you install? Upstream 23/23 battery runs no LLM — stale edits are rejected every run. Same algorithm.

Configuration

Tenancy and prompt guidance declare once, read at agent/session-start, no code change.

Store central by default $DSH_HOME/plugins/dsh-better-edit/runtime/<name>-<hash8>/ (ls-readable + .wsPath sidecar). DBs are disposable caches — rm -rf runtime/<name>-<hash8>/ is safe, rebuilt on next read.

# $DSH_HOME/plugins/dsh-better-edit/config.yaml
storeDir: central # central | workspace | /abs
autoGitignore: false
undo_ttl_s: 604800 # 7d, -1 forever
storeMaxAgeS: 2592000 # 30d janitor
storeMaxTotalBytes: 524288000 # 500 MB LRU

Env overrides yaml (DSH_BETTER_EDIT_STORE_DIR, DSH_BETTER_EDIT_AUTO_GITIGNORE).

Guidance per preset — tool:read / tool:edit / tool:undo_last_edit are plain markdown per preset at $DSH_HOME/plugins/dsh-better-edit/<preset>/<section>.md (orders 130/131/133). Delete or empty a file → default re-seeds at next boot; keep a --- fence to blank on purpose.

Why Hashline

Verified against what was served. Every resolved line checked against read/diff/rejection rows. Stale or unseen → [E_STALE_RANGE]/[E_UNSERVED_RANGE] + fresh HASH│content, retry needs no read. Session-scoped — sub-agent serves never validate main edits.

Content-addressed. canon(line) strips ASCII whitespace, xxh32 → 62³=238,328 anchors. Re-inserting identical text keeps its hash; prettier/eslint --fix between edits doesn't invalidate. Unique by bitset probing — }/import repeats never collide; cap 238,328 lines ([E_LARGE_FILE]).

No loop, no ritual. No-op → No changes made; same no-op ×3 → [E_NOOP_LOOP]. Diff/echo/rejection rows count as serves — read is recovery, not ritual.

Token economics

Envelope change: hoist path, edits:[[from,to,text]], never repeat old_string.

snapshotstr_replaceeditedit multiOMP per-editOMP batch
pinned 12-edit corpus1,015609 -40.0%582 -42.7%590 -41.9%480 -52.7%
local snapshot358272 -24.0%241 -32.7%268 -25.1%180 -49.7%

Percent vs str_replace. External row pinned corpus, cl100k_base; local npm run benchmark in upstream.

enginecallstokenssavedok
OMP628,467—✅
hashline edit312,593-55.8%✅

Single stochastic run, opencode-go/gpt-5.6-luna high. Artifact.

Scope & honesty. Payload deterministic; practical run stochastic. We measure payload + round-trips, not throughput. Retries are where the gap is largest — see edge cases.

Tools

ToolWhat it does
readHASH│content with offset/limit; [Showing N-M of T] paging; >200KB lines show marker
read_skillPlain text, no hashes, no serves — editing after it needs a serve
edit{path, edits:[[from,to,text]]} path:string|null inference, "" deletes, atomic ≤32, verify-then-write
undo_last_edit{path} restores last edit (BOM/line endings/anchors), persisted

write stays, but refuses an exact HASH│ echo for same session/path/line before dispatch.

Error codes

CodeMeaning
[E_BAD_PAYLOAD]Bad tuple shape (payload must be {path, edits} with 3-position tuples)
[E_STALE_ANCHOR]No line (hash/retired/canon miss) / multi-line → read
[E_BAD_ANCHOR]Not bare 3-char, or replacement_text carries HASH│/diff-preview prefixes — refused, remove and retry
[E_SERVED_ECHO]Copied HASH│ from same session/path/line — refused, remove and retry
[E_EMPTY_RANGE]/[E_NOT_FOUND]/[E_ACCESS]/[E_UNSUPPORTED_FILE]/[E_LARGE_FILE]Empty guard / missing / access / binary / >238,328 lines
[E_REVERSED_ANCHORS]Swapped range — healed with dimmed [USER] notice on success, otherwise refused
[E_BAD_ENCODING]/[E_DECODE_FAILED]Encoding / decode failed
[E_NOT_OBSERVED]/[E_STALE_RANGE]/[E_UNSERVED_RANGE]Served-state miss — echoed fresh HASH│content
[E_UNDO_STALE]/[E_UNDO_UNAVAILABLE]Undo stale / unavailable
[E_NOOP_LOOP]/[E_BATCH_ABORT]3× same no-op / atomic batch fail → nothing written

Full list in src/ — every rejection echoes fresh rows, no read needed.

Comparison

dsh-better-edit@oh-my-pi/hashlinestr_replace
AddressHASH│ 3-char canon[path#tag] + linetext match
Whitespace-insen.✅~ n/a❌
Duplicate lines✅ unique~ pos❌ first
Verified vs served✅ every line~ file tag❌
Blind edit✅ reject~❌
Batch atomic✅✅❌
Undo✅❌❌
Battery23/2310/10—

~ partial, — n/a. Same lineage — patch library vs dsh tool pair; pick by seam.

Edge cases: wrong anchor impossible (verified), disk drift → reject+serve, shift above → nothing moves, repeats → unique/ambiguous, unseen → reject, batch → atomic. See upstream benchmarks.

Battery: 23/23 tool, 10/10 library (upstream npm run eval, same algorithm).

How Anchors Work

canon(line) strips ASCII whitespace → xxHash32 → A-Za-z0-9 3-char (62³). Stable across prettier; Unicode/strings stay significant except ASCII whitespace inside strings (linter-only). stride=62²+62+1 probes bitset → unique; cap 238,328. Store hash-store.sqlite per workspace (central, honoring XDG_CONFIG_HOME); 7-day served TTL, janitor storeMaxAgeS/LRU + wal_checkpoint.

How It Replaces Built-ins

dsh resolves agent → preset → global; built-ins live on preset. Plugin via cordis.patch.yml: at agent/session-start registers read/edit on agent layer (shadows, auto-unwinds); write stays with pre-execute guard + post-execute auto-read.

Project Structure

dsh-better-edit/
├── src/hashline/     # hash + served core
├── src/tool-*.ts     # read / edit / undo
├── src/served-store.ts # SQLite store
├── benchmark/corpus/ # 103-line fixture
├── test/             # 108 files, 1222 tests
├── assets/           # logo + banner
└── cordis.patch.yml

Development

pnpm install
pnpm typecheck   # tsc --noEmit
pnpm test        # vitest run
pnpm benchmark   # hash probe + session envelope (reads/retries/tokens)

Benchmark

103-line file, 12 replacements (8×1 + 4×3/6/10/15), cl100k_base. hashline vs str_replace vs oh-my-pi seq/batch. Upstream is source of truth — same algorithm byte-for-byte.

Criterionhashlinestr_replaceseq / batch
old_string echoedneverevery editnever
12-edit saved31%0%42% / 53%
multi-line saved29–47%0%40–53%
5× output cost~1.4× less1×~1.7×/~2.1× less
Verified100%nonetag only
Scenariohashlinestr_replace
1×8309324
3–15×4393691
TOTAL ×127021015

Saved 313 (31%). Reproduce: upstream npm run benchmark. See pi-better-edit/benchmark/README.md.

Scope & honesty. Benchmark is request-payload tokens (reads cancel, replacement text identical). No transcription-failure model — real gap larger; see edge cases.

Roadmap

Current 0.7.0: pos-free resist/strict + retired anchor/canons/epoch, per-session (session,path) store, 1222 tests, 9/9 harness.

Next
  • Keep benchmark/run.mjs in sync with ADR-0013 (reads/retries/tokens per session)
  • Re-check wiring vs next dsh (pinned 0.1.0-rc.6)
  • README.zh.md parity

Contributing

See CONTRIBUTING.md. Most valuable: more served-state edge-case tests.

License

MIT — see LICENSE.

Acknowledgments

From Can Bölük's The Harness Problem. Thanks to pi-hashline-edit, pi-hashline-edit-pro, pi-better-edit, @oh-my-pi/hashline. Reading: hash-anchors.


Star History

Star History Chart


⭐ If hashline made your agent edit better, give it a star!