跳到主要内容

dsh-start-exit

已验证

@kesike/dsh-start-exit · v0.2.6 · MIT · Web 界面

在 dsh web 界面提供启动、退出与重新启动按钮:通过可见 Windows Terminal(PowerShell 7)管理宿主进程

安装

dsh plugin add @kesike/dsh-start-exit

用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。

源码

发布到 npm 但没有公开仓库。安装前请检查包内容。

标签

说明文档

dsh-exit

为 DeepSeek Harness Web 界面提供一个明确、可确认的退出控制。

dsh Web 插件 平台 版本 依赖

简体中文 | English

[!IMPORTANT] 确认退出后会结束 dsh 宿主进程并释放其占用的端口;宿主终端窗口和当前浏览器标签页会被刻意保留。

✨ 功能概览

dsh-exit 在 dsh Web 界面右下角增加一个紧凑的悬浮退出按钮。

  • 先弹出确认弹窗,确认前不会执行退出动作。
  • 确认后调用类型化的 dshExit/exit Remote 方法。
  • 先返回调用应答,再等待短暂窗口结束宿主进程。
  • 释放该进程占用的全部端口,包括常见的 127.0.0.1:3080。
  • 保留宿主终端窗口和浏览器标签页,方便后续操作。
  • 使用 dsh 现有设计令牌与 Lucide power 电源图标。

🧭 界面预览

dsh-exit 在 dsh Web 界面中的实际效果

🧱 项目组成

层次 文件 职责
宿主侧 lib/index.js 注册 dshExit Cordis 服务和类型化 exit() Remote 方法。
客户端 lib/client.js 自包含浏览器 bundle:按钮、样式、弹窗、键盘交互和 Remote 挂载。
Bundle 补丁 cordis.patch.yml 向 dsh profile 插入插件行。
包元数据 package.json 声明宿主入口、Web 客户端和 Bundle 补丁。

🚀 从 npm 安装

直接将已发布的 npm 包加入 dsh 的 Web profile:

dsh plugin --profile web add @kesike/dsh-exit

安装后重启 profile。裸导入由 dsh 宿主加载器解析,因此本包不声明运行时依赖。更新或移除:

dsh plugin --profile web update @kesike/dsh-exit
dsh plugin --profile web remove @kesike/dsh-exit

🖥️ 交互说明

操作 结果
点击悬浮电源按钮 打开确认弹窗。
点击取消、按 Esc 或点击弹窗外部 关闭弹窗,不改变宿主状态。
点击确认退出 禁用重复操作并调用宿主 Remote 方法。
Remote 调用失败 恢复控件并显示行内错误信息。
Remote 调用成功 关闭弹窗,宿主随后退出。

🔌 Remote 接口

宿主侧公开一个严格校验、无参数的 Remote 方法:

namespace: dshExit
method:    exit
result:    true
gateway:   /api/dshExit/exit

dsh 客户端网关成功时返回标准 envelope:{ ok: true, value: true }。服务端通过 exiting 标志防止重复调用,并在应答有机会完成后延迟执行 process.exit(0)。

🧪 开发检查

在项目根目录执行轻量语法检查:

node --check lib/index.js
node --check lib/client.js

🗺️ 快速信息

  • 目标: DeepSeek Harness Web profile
  • 安装方式: npm 包
  • 界面位置: 右下角悬浮控件
  • 执行动作: 结束 dsh 宿主进程
  • dsh 常见端口: 127.0.0.1:3080
  • 仓库主题: dsh · deepseek-harness · dsh-plugin · plugin · javascript · web

电源图标来自 Lucide,遵循其 ISC 许可使用。

📄 许可证

MIT

界面小而专注,退出动作明确且可预期。