ystyle/dsh-tool-terminal-search ↗★ 0
dsh-tool-terminal-search
terminal_search tool for dsh: locate lines in large persistent-terminal scrollback by regular expression, composed over the public terminal read seam.
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-tool-terminal-search
A terminal_search tool plugin for DeepSeek Harness (dsh): locate lines in large retained terminal scrollback by literal substring or regular expression, without paging backward blindly through tens of thousands of log lines.
The tool is composed only over the public ctx.terminals.read seam — no upstream package changes, so it runs on published dsh releases today.
Why
terminal_read pages retained scrollback by newest-relative offset/count. With backend log output running to tens of thousands of lines, a model cannot tell where the interesting lines are: it has to page backward from the newest output one page at a time, and totalLines alone does not locate a needle in the retained buffer. terminal_search closes that gap by finding lines by content.
Install
In your dsh profile directory (e.g. ~/.dsh/profiles/web), add the dependency and the patch entry:
npm install dsh-tool-terminal-search
# ~/.dsh/profiles/web/cordis.patch.yml
- insert:
- id: terminal
name: '@deepseek-ai/dsh-terminal'
- id: terminal-bash
name: '@deepseek-ai/dsh-terminal-bash'
- id: tool-terminal
name: '@deepseek-ai/dsh-tool-terminal'
- id: tool-terminal-search
name: 'dsh-tool-terminal-search'
Restart your dsh profile. The model gains terminal_search next to the official terminal_open / terminal_send / terminal_read tools.
Behavior
terminal_search(sessionId, pattern, regex?, offset?, limit?):
- Pages the whole retained scrollback (newest → oldest) through
terminal_readand matches each line. patternis a literal substring by default (grep-Fstyle) — no regex metacharacters to escape; passregex: trueto treat it as a JavaScript regular expression. Compiled regexes go through a process-wide bounded FIFO cache (oldest entries evicted first), so repeated patterns never recompile.- Returns matching lines newest first, each with a newest-relative
offsetthat is directly usable as a offset (jump to a match's context in one follow-up call).