@zhangzhian/dsh-devtools-workbench

中文文档
0.3.1发布于 2026/11/03MITTypeScriptES Module

DSH 开发工具:底部工作台(终端 + 输出)

原始使用文档
文档目录7 节
  1. 安装
  2. 提供什么
  3. 要求
  4. English
  5. Install
  6. What it provides
  7. Requirements

English | 简体中文

@zhangzhian/dsh-devtools-workbench

DSH 开发工具的底部工作台组件:贴在窗口底部、可拖动、可收起的一块面板, 里面跑真正的终端,另有一个输出页签显示插件自己的运行轨迹。

安装

不要单独装它。装清单包 —— 它会作为依赖自动拉下来,并在插件页上给你一个可开关的组件行。

dsh plugin --profile web add @zhangzhian/dsh-devtools

提供什么

  • 宿主半:一条路由 GET /devtools-workbench/bundle/chunk-terminal.js,把懒加载的 xterm 产物发出去。终端本身用的是宿主的 PTY(ctx.webTerminals),所以宿主的 并发上限、空闲回收、崩溃恢复三套机制照常生效 —— 本插件从不自己起进程。
  • 客户端半:body 层的固定宿主 + 面板本体,开关在会话标题栏右侧的终端图标上。
  • 终端页签:真正的 PTY,可开多个、各选自己的 shell,带重试/重连,以及一个会 真的回收进程的关闭动作。右侧的终端实例列表默认收起(只有一个终端时它只写 一行「终端 1」,白占宽度),页签条右边有一颗图标切换,状态跟着会话记住; 新建终端会自动展开它。
  • 输出页签:插件自己的运行轨迹 —— 终端阶段迁移、几何测量降级、持久化失败。 "终端打不开"的时候看这里。
  • 只挤高度,绝不写宽度:面板只在 <html> 上写一个 --devtools-workbench-height 变量,会话列用 margin-bottom 消费它。写宽度就得 自己接管左右两侧的开合与动画。
  • 缺依赖会降级:宿主没有终端服务时,终端页签显示一句提示,其余功能照常。

要求

  • DSH 0.2.0-rc.2 或更新(peer 区间写在 package.json 里)。
  • 浏览器侧运行时:dsh.client.platform 是 web。
  • 宿主的终端服务(@deepseek-ai/dsh-api-terminal-controller)是可选的 —— dsh web 默认带它,但没有它面板也能干净降级。
  • @xterm/xterm 与 @xterm/addon-fit 会打进产物;平台不向第三方插件提供 xterm。

English

@zhangzhian/dsh-devtools-workbench

The bottom workbench component of DSH devtools: a resizable, collapsible panel pinned to the bottom of the window that runs a real PTY through the host's terminal service, plus an Output tab showing the plugin's own diagnostics.

Install

Do not install this package directly. Install the bundle package — it pulls this in as a dependency and gives you a switchable component row on the plugin page.

dsh plugin --profile web add @zhangzhian/dsh-devtools

What it provides

  • Host half: one route, GET /devtools-workbench/bundle/chunk-terminal.js, which ships the lazily loaded xterm bundle. The terminal itself uses the host's PTY (ctx.webTerminals), so the host's concurrency cap, idle reclamation and crash recovery all still apply — this plugin never spawns a process of its own.
  • Client half: a body-level fixed layer plus the panel, opened from the terminal icon in the session header.
  • Terminal tab: a real PTY, several tabs, per-tab shell picker, reconnect/retry, and a close action that actually reaps the process.
  • Output tab: the plugin's own trace — terminal phase transitions, geometry fallbacks, persistence failures. This is where you look when "the terminal will not open".
  • Height squeeze, never width: the panel writes a single --devtools-workbench-height CSS variable on <html>; the conversation column consumes it via margin-bottom. Writing width would mean taking over both side columns' layout and animations.
  • Graceful degradation: without the host terminal service the Terminal tab shows a hint and everything else keeps working.

Requirements

  • DSH 0.2.0-rc.2 or later (the peer range is declared in package.json).
  • A browser-side runtime: dsh.client.platform is web.
  • The host terminal service (@deepseek-ai/dsh-api-terminal-controller) is optional — it ships with dsh web by default, but the panel degrades cleanly without it.
  • The @xterm/xterm and @xterm/addon-fit dependencies are bundled; the platform does not provide xterm to third-party plugins.

版本与发布记录

@zhangzhian/dsh-devtools-workbench 共发布 6 个版本,首次发布于 2026/10/20;过去 12 个月发布了 6 个版本。

版本发布日期距今
0.3.1latest2026/11/03今天
0.3.02026/11/012 天前
0.2.22026/10/2113 天前
0.2.12026/10/2014 天前
0.2.02026/10/2014 天前
0.0.0-stage2026/10/2014 天前

关于 @zhangzhian/dsh-devtools-workbench 的常见问题

@zhangzhian/dsh-devtools-workbench 是什么?

DSH 开发工具:底部工作台(终端 + 输出)

如何安装 @zhangzhian/dsh-devtools-workbench?

在项目目录运行 npm install @zhangzhian/dsh-devtools-workbench,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@deepseek-ai/cordis(~4.0.4)、@deepseek-ai/dsh-session(^0.2.0-rc.2)、@deepseek-ai/schemastery(~3.18.4)、@deepseek-ai/dsh-api-gateway(^0.2.0-rc.2)、@deepseek-ai/dsh-host-webserver(^0.2.0-rc.2)、@deepseek-ai/dsh-client-ui-slots(^0.2.0-rc.2)、@deepseek-ai/dsh-client-ui-primitives(^0.2.0-rc.2)、@deepseek-ai/dsh-client-ui-conversation(^0.2.0-rc.2)、@deepseek-ai/dsh-client-ui-sidebar-right(^0.2.0-rc.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@zhangzhian/dsh-devtools-workbench 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@zhangzhian/dsh-devtools-workbench 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@zhangzhian/dsh-devtools-workbench 可以商用吗?

@zhangzhian/dsh-devtools-workbench 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@zhangzhian/dsh-devtools-workbench 还在维护吗?

最新版本 0.3.1 发布于 2026/11/03(今天);至今共发布 6 个版本,其中过去 12 个月发布了 6 个;首次发布于 2026/10/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。