DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

dsh-pty-session

Pty Session

DSH 插件将按所有者限定的 PTY 接口作为与协议无关的 pty_open/send/tail/close 工具公开——第 0 层核心。

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

npx -y @deepseek-ai/dsh plugin --profile web add github:ch1bug/dsh-pty-session#d94547d211d6183d4615c8aafa7a22076caf857c
README兼容性版本

兼容性与来源证明

Pty Session 以 dsh-pty-session 发布,当前版本为 0.2.1-alpha.1-r1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
github
Registry 更新时间
2026/10/3

版本

0.2.1-alpha.1-r1prerelease
2026/10/3
0.1.0stable
2026/10/2
查看其余 1 个版本收起版本
0.2.0-rc.2-r1prerelease
2026/10/3

相关插件

正在加载相关插件…

最新版
0.2.1-alpha.1-r1
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
any
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/10/3
查看源码 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Ssh@linxin666/dsh-sshdsh Web GUI 的远程 SSH 操作:主机配置存储(~/.dsh/dsh-ssh.json,可从 ~/.ssh/config 导入)、支持跳板主机的持久化 ssh2 连接池、exec / PTY Web 终端 / SFTP 传输 / 本地端口转发隧道 / 集群执行Update@linxin666/dsh-update用于 dsh Web GUI 的自更新插件:探测 npm 上是否有更新的系列版本,并在原地运行所属配置的 pnpm 更新;可通过设置图标旁侧边栏中的触发器启动,并显示发布说明面板Tui@deepseek-harness-tui/dsh-tui用于 DeepSeek Harness 智能体、会话和工具的交互式终端界面。Cc Safety Netcc-safety-net编码代理 CLI 钩子——阻止破坏性命令和访问机密文件

README

dsh-pty-session

DSH plugin exposing the harness's owner-scoped PTY seam (ctx.terminals — the same seam @deepseek-ai/dsh-tool-bash-persistent runs on) as four protocol-agnostic tools: pty_open / pty_send / pty_tail / pty_close.

Layer 0 core: byte-stream sessions with zero protocol knowledge. Line framing, REPL prompts, and protocol parsing (gdb/MI, ssh banners) belong to consumer-layer plugins built on top of this surface.

API

ToolArgsReturnsNotes
pty_opencommand (required), cwd?, env?sessionId, pid?, status, initialOutputSpawns on a PTY; env vars are exported (POSIX quoting) before the command on shell-type backends. Session survives turns.
pty_sendid, data (required), submit? (default true)delta, statusWrites bytes; returns output read while the write settled.
pty_tailid (required), lines?text, lines, truncatedIncremental cursor: returns only new output since the last tail — repeated tails never resend. Backlog beyond lines returns the newest lines and sets truncated: true.
pty_closeid (required)closedClean termination + reclaim. Idempotent per close.

Lifetime & ownership

  • Every call is authorized against the calling agent (exec.agent); another agent touching your session gets FOREIGN_SESSION.
  • Sessions live with the plugin instance, not the turn: a fresh turn on the same agent sees all its open sessions.
  • The owner-scoped registry closes all sessions when the owning agent disposes; the plugin additionally installs a dispose effect that closes every session it opened.

Semantics worth knowing

  • Lines, not bytes: pty_tail inherits the seam's line-based scrollback contract (totalLines/lineBegin/lineEnd). Output without a trailing newline (a REPL prompt, a password prompt) becomes visible once its line completes. Byte-exact tail is the consumer layer's job if a consumer ever needs it.
  • pty_send submit: defaults to true (backend Enter after the data) so interactive sessions behave; pass submit: false for byte-exact writes.
  • pty_close delegates termination to the seam's awaited, idempotent cleanup (process-tree kill + quiescence) — the seam owns the mechanics.
  • env is best-effort POSIX export lines and only meaningful on shell-type backends (the seam's spawn request has no env field); don't pass env against non-shell backends.

Configuration

backendType: shell   # registered PTY backend type passed to terminals.spawn
tailLines: 200       # default pty_tail budget

Consumer-plugin facade (ctx.pty)

Consumer plugins (dsh-embedded-debug T5, later ssh) do not shell out through the four tools — they inject the same core as a cordis service:

const inject = ["tools", "pty"];          // add "pty" to the plugin's inject
// inside apply(ctx): ctx.pty is provided by dsh-pty-session
const opened = await ctx.pty.open(exec.agent, { command: "gdb -q -i=mi2" }, exec.signal);
await ctx.pty.send(exec.agent, opened.sessionId, { data: "-gdb-exit" });
const page = await ctx.pty.tail(exec.agent, opened.sessionId, 100);
await ctx.pty.close(exec.agent, opened.sessionId);

The facade exposes open/send/tail/close/dispose with EXACTLY the tool semantics (same cursors, same seam reads — one core, two surfaces). The owner is passed explicitly and must be the consumer's own exec.agent; the seam enforces ownership (FOREIGN_SESSION). close is idempotent (closed:false for an already-gone session). Loading this plugin becomes a hard startup dependency of any consumer that injects "pty".

Instance matrix

ConsumerStatusWhy
gdb (dsh-embedded-debug T5/T6)first consumer — injects ctx.ptyMI framing lives in the consumer; API shape is being pressed out by gdb's needs.
sshplanned — second consumerValidates the abstraction once a second consumer exists.
serial (tio) / probe server / RTTexplicitly excludedNon-PTY long-running processes: job + tail is already the correct pattern.

Development

npm install        # vitest
npm test           # vitest run

Tests are the reference implementation: they drive the real tool surface against a fake terminals registry whose backend runs real interactive child processes (echo round-trips, no protocol parsing).

Harness deps (important)

@deepseek-ai/dsh-tools, @deepseek-ai/schemastery, and @deepseek-ai/cordis must be junctions/symlinks into the installed harness's node_modules (never copies): duplicated module instances make the DSH plugin loader fail the entry with failed to import. On Windows:

New-Item -ItemType Junction -Path node_modules/@deepseek-ai/dsh-tools -Target <harness>\node_modules\@deepseek-ai\dsh-tools
# same for schemastery and cordis