Back to home

GHJIVHIDD

dsh-plugin-session-terminal

原生UI界面。在会话视图环中新增“终端”页签,实时展示当前会话执行的bash命令、结果与执行时间(精确到秒)。纯前端观察,不提供执行/交互能力,不会修改命令。

Stars
1
Language
JavaScript
Created
Aug 15, 2026
Updated
Aug 15, 2026

Introduction

dsh-plugin-session-terminal

DeepSeek Harness 的会话终端观察页签(Web 部署级插件)。

在会话视图环中新增「终端」页签,实时展示当前会话执行的 bash 命令、结果与执行时间(精确到秒)。纯前端观察,不提供执行/交互能力,不会修改命令。

功能

  • 会话视图环中新增「终端」页签
  • 实时展示 bash 命令、工作目录、描述、开始/结束时间、耗时
  • 成功/失败/运行中状态标识
  • 点击命令可展开查看完整输出
  • 支持清空当前会话的展示记录
  • 仅观察当前会话,不跨会话

文件说明

├── package.json               # 仓库根即插件包(含 dsh.bundle / dsh.client 声明)
├── scripts/
│   └── prepare.mjs            # 根包 prepare:构建 dsh-plugin-session-terminal/lib
├── install.sh                 # 免 pnpm 安装脚本
└── dsh-plugin-session-terminal/
    ├── package.json           # 内层插件包(用于 tarball / 手动安装)
    ├── cordis.patch.yml       # 自动插入「终端」页签的 patch 层
    ├── src/
    │   ├── index.js           # Host 侧空实现(源文件)
    │   └── client.js          # 浏览器端终端页签实现(源文件)
    ├── lib/                   # prepare 生成的发布入口(已提交,便于手动安装)
    │   ├── index.js
    │   └── client.js
    └── scripts/
        └── prepare.mjs        # 内层包 prepare:构建 lib/

安装包(tgz / zip)通过 GitHub Releases 发布,不存放在源码仓库中。 仓库根目录本身也是可安装的 bundle,因此也支持 dsh plugin add github:... 源码安装。

安装

方式 A:使用 dsh plugin 安装预构建 tarball(推荐,需要已安装 pnpm)

从 Releases 下载 tgz 后,在插件包/tgz 所在目录执行:

# 下载地址:https://github.com/GHJIVHIDD/dsh-plugin-session-terminal/releases
dsh plugin --profile web add ./dsh-plugin-session-terminal-0.0.2.tgz

因为本插件同时带有 dsh.bundle 声明,dsh plugin 会自动把它加入 profile 的 bundles 层,并应用 cordis.patch.yml 自动插入终端页签。

如果看到类似 declares no dsh.bundle 的提示,说明你拿到的是旧版包;请使用带 dsh.bundle 的版本,或改用方式 C。

方式 B:从 GitHub 源码直接安装(dsh plugin add github:...

仓库根目录已经是标准的 DeepSeek Harness 组合包(bundle),可以直接从 GitHub 源码安装:

dsh plugin --profile web add github:GHJIVHIDD/dsh-plugin-session-terminal

pnpm 拉取源码后会执行本仓库的 prepare 脚本,自动把 src/ 构建到 lib/

pnpm ≥ 10 构建授权:pnpm 10 默认拒绝运行 git 依赖的 prepare 脚本。第一次执行上面的命令如果失败,请把 pnpm 提示的包键加入该 profile 的 pnpm-workspace.yaml

# 文件位置:~/.dsh/profiles/web/pnpm-workspace.yaml
allowBuilds:
  "@deepseek-ai/dsh-plugin-session-terminal": true

然后重新执行:

dsh plugin --profile web add github:GHJIVHIDD/dsh-plugin-session-terminal

建议同时锁定 commit,避免后续推送悄悄改变实际安装的代码:

dsh plugin --profile web add github:GHJIVHIDD/dsh-plugin-session-terminal#<commit-sha>

方式 C:免 pnpm 手动安装

克隆源码后,在仓库根目录运行:

git clone https://github.com/GHJIVHIDD/dsh-plugin-session-terminal.git
cd dsh-plugin-session-terminal
./install.sh

脚本会:

  1. 将插件文件复制到 ~/.dsh/profiles/web/node_modules/@deepseek-ai/dsh-plugin-session-terminal
  2. ~/.dsh/profiles/web/cordis.patch.yml 还没有 ui-session-terminal,则自动追加 patch 条目

也可以用环境变量指定自定义位置:

DSH_HOME=/path/to/.dsh DSH_PROFILE=web ./install.sh

方式 D:手动复制 + patch

# 1. 复制插件包到 profile 的 node_modules
mkdir -p ~/.dsh/profiles/web/node_modules/@deepseek-ai
cp -R dsh-plugin-session-terminal ~/.dsh/profiles/web/node_modules/@deepseek-ai/

# 2. 确认 ~/.dsh/profiles/web/cordis.patch.yml 中包含:
# - insert:
#     - id: ui-session-terminal
#       name: '@deepseek-ai/dsh-plugin-session-terminal'

使用

安装后重启/刷新:

dsh --profile web

打开 Web 界面进入任意会话,在会话视图环中点击「终端」即可看到该会话实时执行的 bash 命令记录。

兼容性

  • 面向 DeepSeek Harness web profile
  • 需要 Web 端已启用 @deepseek-ai/dsh-client-runtime@deepseek-ai/dsh-client-ui-conversation(标准 web profile 自带)
  • 插件版本:0.0.2