Jiyr0119/dsh-service-console
Local development service console for DeepSeek Harness: discovers listening ports, shows service ownership, and safely inspects/stops/restarts services. DSH
This is a DeepSeek Harness (DSH) plugin. Review its GitHub README, installation information, maintenance status, and public security signals here.
DSH Service Console
English | 简体中文
A local development service console for DSH: discover listening ports, identify services related to the current conversation or workspace, and safely inspect, stop, or restart them.
DSH 本地开发服务控制台:发现监听端口,识别与当前对话或工作区相关的服务,并安全地查看、停止和重启。
面向 DeepSeek Harness Web UI 的单职责插件。当模型(或你)启动本地开发服务(npm run dev、Vite、Next.js、Uvicorn、Express、Rust 等)时,Service Console 在一个地方把它们展示出来:监听了哪些端口、由什么命令和目录启动、是否属于当前对话或工作区、能否安全停止或重启。
功能
- 服务发现 — 扫描监听 TCP 端口,关联 PID、PPID、命令、工作目录、进程组与启动时间(macOS/Linux)。
- 归属与风险 — 五级归属:
本次对话(与会话启动台账匹配)、工作区、本机其他、未知、受保护。 - 受控操作 — 对进程组优雅停止;对保存了安全启动命令的服务重启。每个动作均二次确认,并在操作前重新校验快照。
- 安全防护 — 任何信号前校验 PID 复用 / fingerprint;未知与受保护服务只读;强制终止默认关闭;无隐式自动清理;命令输出脱敏。
- 全量本机服务 — 展示本机全部监听服务;归属只作为安全提示,不再隐藏端口分类,用户可自行选择要查看或停止的服务。
- 搜索 / 配置 / 国际化 — 支持关键字过滤、优雅超时 / 强制终止设置;中英文界面自动跟随 DSH 当前语言。
- 按需扫描 — 打开控制台时获取一次当前快照;点击刷新按钮才会主动重新扫描,不进行后台定时轮询。
- DSH 原生检查卡片 — 展开详情采用 DSH Web token 化视觉风格,展示进程身份、端口、命令、工作目录和归属证据。
安装
原生安装(推荐):
dsh plugin --profile web add -w @jiyr0119/dsh-service-console@latest
安装后刷新 DSH Web UI——会话头部出现 🖥 SC 入口,点击打开控制台面板。
注意:插件被 dsh-market/awesome 收录 ≠ 浏览器自动出现 UI。本包同时提供 Host 路由与浏览器 bundle,
dsh plugin add后面板即可用。支持 macOS / Linux;Windows 暂不支持。
备用方式——动态粘贴(零构建、进程级):通过动态 Cordis 插件流程粘贴 dynamic/host.js + dynamic/client.js。
界面预览

预览展示本机完整监听服务列表与展开后的检查卡片。归属徽标仍作为安全提示保留,但列表不再按对话 / 工作区 / 本机拆分隐藏服务。
权限与安全
- Client 不直接传任意 PID 或 Shell 命令,只以 service ID 为目标,Host 在操作前重新校验 PID / 启动时间 / fingerprint。
- 优先优雅终止(SIGTERM 到进程组);SIGKILL 仅在显式开启并确认后使用。
- 命令摘要中的敏感 token/密码会脱敏。
- 本插件不是通用进程管理器:系统关键、高权限、未知和受保护进程一律只读。
开发
pnpm install
npm run typecheck
npm run build
npm test # 单元 + 集成测试(node --test)
测试
npm test 会先构建一次,再用 Node 内置测试运行器(node --test)执行整个测试套件,无需额外测试框架。
| 文件 | 类型 | 覆盖内容 |
|---|---|---|
test/process-inspector.test.mjs | 单元测试 | 平台输出解析(parseLstart、parseListenRows、parsePsRows、parseAddress)、命令脱敏、五级归属分类 |
test/host-more.test.mjs | 单元测试 | 配置校验、会话台账、基于 fake 依赖的生命周期状态机(停止/重启)、服务聚合与 fingerprint 稳定性 |
test/integration.test.mjs | 集成测试 | 真实系统命令 + 测试自建的临时 HTTP 服务;只对测试自有进程发信号 |
npm test # 全部用例
npm run build && node --test test/process-inspector.test.mjs # 单独运行某个文件
单元测试直接 import 构建产物(lib/),因此需要先编译源码——npm test 会自动完成。
许可证
MIT
Security & install evidence
This score is based solely on public repository metadata and the install evidence registered here — it is not a code security audit.
From a public plugin catalog, linked to a public GitHub repository.
The repository declares the MIT license.
Code updates within the last 180 days.
No verifiable install metadata registered yet — please review the repository instructions manually.
The inspected package metadata declares no install lifecycle scripts.