DeepSeek Harness (dsh) 终端搜索工具插件
A terminal_search tool plugin for DeepSeek Harness (dsh)
安装
dsh plugin --profile web add github:ystyle/dsh-tool-terminal-searchGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
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_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 aterminal_readoffset (jump to a match's context in one follow-up call). - Returns the exact
matchCount, the retainedtotalLines, andtruncated;offset/limitpage over matches. - Renders
[offset N] lineper match plus[search: X of Y matches, Z retained lines]; results are capped bymaxResultBytes(default262144).
Known limitations
- One search pages the bounded scrollback in memory (
scrollbackLines10 000 /scrollbackMaxBytes4 MiB by default), so it only sees retained lines — same contract asterminal_read. - A page whose bytes exceed the backend
maxReadBytesis reread with a smaller page size so line offsets stay exact; a single line larger thanmaxReadBytesdegrades to a truncated line and setstruncated. - No surrounding-context lines are returned; read around a match's offset for context.
- Requires dsh
0.1.0-rc.6(or a release whosedsh-terminal/dsh-toolskeep thereadcontract).
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.
原始 README: https://github.com/ystyle/dsh-tool-terminal-search/blob/main/README.md ↗
同类插件
查看全部 →
k8e
k8e.sh — 开源 Agentic AI 沙箱矩阵

hol-guard
开源AI代理防病毒:运行时拦截风险工具、秘密访问、提示注入、恶意软件包、MCP服务器、插件和技能。

anolisa
ANOLISA(Agentic Nexus Operating Layer & Interface System Architecture):具备运行时、安全性、可观测性和 Tokenless 响应压缩能力的 Agentic OS,可降低 Token 使用量与成本。

mobius
首个自我演进的开源 Agent OS:连接你的团队、AI agent、设备与算力

deepseek-harness-desktop
DeepSeek Harness Tauri 桌面版 | Only 5mb installer, zero environment setup. Windows / macOS / Linux.

open-managed-agents
开源Claude管理代理API实现和自托管Claude标签式代理运行时。即插即用;在Cloudflare Workers/Durable Objects或Node.js上运行。Apache 2.0。