DeepSeek Harness 插件

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.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
ystyle/dsh-tool-terminal-search
最近更新
2026年8月16日
分类
文档与渲染
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/ystyle/dsh-tool-terminal-search
插件名:dsh-tool-terminal-search
作者:ystyle

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-tool-terminal-search

![powered by dsh](https://github.com/deepseek-ai/deepseek-harness)

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

Install with the dsh CLI — it forwards pnpm into the profile directory — then add the package to the profile's bundles list. The bundle's own patch then contributes terminal_search automatically:

# Installs into the profile's node_modules (dsh plugin forwards to pnpm).
dsh plugin --profile web add dsh-tool-terminal-search

# Verify the install.
dsh plugin --profile web ls
// ~/.dsh/profiles/web/package.json
{
  "dependencies": {
    "@deepseek-ai/dsh-tool-terminal": "0.1.0-rc.6",
    "dsh-tool-terminal-search": "^0.3.0"
  },
  "dsh": {
    "profile": {
      "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-tool-terminal-search"]
    }
  }
}

The official @deepseek-ai/dsh-tool-terminal plugin (and the dsh-terminal / dsh-terminal-bash services) must still be present for terminal_open / terminal_send / terminal_read.

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_read and matches each line.
  • pattern is a literal substring by default (grep -F style) — no regex metacharacters to escape; pass regex: true to 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 offset that is directly usable as a terminal_read offset (jump to a match's context in one follow-up call).
  • Returns the exact matchCount, the retained totalLines, and truncated; offset/limit page over matches.
  • Renders [offset N] line per match plus [search: X of Y matches, Z retained lines]; results are capped by maxResultBytes (default 262144).

Known limitations

  • One search pages the bounded scrollback in memory (scrollbackLines 10 000 / scrollbackMaxBytes 4 MiB by default), so it only sees retained lines — same contract as terminal_read.
  • A page whose bytes exceed the backend maxReadBytes is reread with a smaller page size so line offsets stay exact; a single line larger than maxReadBytes degrades to a truncated line and sets truncated.
  • No surrounding-context lines are returned; read around a match's offset for context.
  • Requires dsh 0.1.0-rc.6 (or a release whose dsh-terminal/dsh-tools keep the read contract).

Development

npm install
npm run typecheck   # tsc --noEmit
npm test            # vitest
npm run build       # esbuild bundle + tsc declarations into lib/

Relationship to upstream

An equivalent native implementation (same tool name, schema, and coordinate space) is tracked upstream in deepseek-harness discussion #1025. This plugin lets deployments use the capability today; switching to the native backend later is transparent.