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-heightCSS variable on<html>; the conversation column consumes it viamargin-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.2or later (the peer range is declared inpackage.json). - A browser-side runtime:
dsh.client.platformisweb. - The host terminal service (
@deepseek-ai/dsh-api-terminal-controller) is optional — it ships withdsh webby default, but the panel degrades cleanly without it. - The
@xterm/xtermand@xterm/addon-fitdependencies are bundled; the platform does not provide xterm to third-party plugins.