dsh-desktop-window
其他 活跃维护

dsh-desktop-window

hxwi1/dsh-desktop-window

Cordis框架开发的桌面窗口插件,可将对应WebUI直接封装为独立桌面应用,无需通过浏览器打开,支持原生窗口置顶、尺寸自定义调节,操作轻便流畅。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
22 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:hxwi1/dsh-desktop-window
git clone https://github.com/hxwi1/dsh-desktop-window.git
git clone git@github.com:hxwi1/dsh-desktop-window.git
README.md main

# dsh-desktop-window

DSH 的 WebUI 变成桌面窗口,双击就能用。
Turn the DSH WebUI into a desktop window — double-click and go.

无需开浏览器 · 双击即用 · 关窗即退 · 一次构建永久使用
No browser · double-click · close-to-exit · build once, use forever

Quick start 快速开始


快速开始 · Quick start

三步,之后每次都是双击。

① 下载 / Download

从 GitHub 下载本仓库,解压成一个文件夹。

Download this repo and extract it into a folder.

② 粘贴 / Paste

把整个文件夹放进 DSH 源码根目录(放哪都行,自动识别)。

Copy the folder into the DSH source tree (anywhere works).

③ 双击 / Double-click

双击启动入口,桌面窗口就出来了。

Double-click the entry for your OS — the window opens.

平台(OS) 启动(Start) 停止(Stop)
Windows start-desktop-window.bat stop-desktop-window.bat
macOS start-desktop-window.command stop-desktop-window.command
Linux start-desktop-window.sh stop-desktop-window.sh

macOS/Linux 若提示无权限,执行一次 chmod +x *.command *.sh(一般无需,仓库已带执行位)。

If you hit "permission denied" on macOS/Linux: chmod +x *.command *.sh (usually not needed).


为什么用它 · Why use it

你需要什么(What you get) 它怎么满足(How)
不用每次开浏览器 双击图标,WebUI 直接变成桌面窗口 / Double-click and it's a desktop app
不想留后台进程 关窗即退,无残留 / Close = exit, no residue
习惯用浏览器 两者共存,互不干扰 / Coexists with the browser
出了故障能收拾 stop-desktop-window.* 一键清理 / Force-clean on demand
不想反复折腾 构建一次,永久使用 / Build once, use forever
担心动源码 零侵入,完全兼容 / Zero-intrusion, fully compatible

兼容性 · Compatibility

  • 不改源码:本仓库只是 --patch 注入的一个配置层,DSH 本体零改动,升级 DSH 也不会冲突。No source is modified — a single --patch layer, the harness stays untouched.
  • 只用窗口内 WebUI 就完全兼容:所有功能在窗口内使用与浏览器里完全一致,无任何限制。As long as you stay inside the WebUI, everything works exactly as in the browser.

前置准备 · One-time setup

缺哪样启动脚本都会明确报错;以下每步只需做一次,约 3 分钟。

第一步 / Step 1 — 装好 DSH 本体,在 DSH 源码根目录执行:

pnpm install   # 安装全部依赖 / install all dependencies
pnpm run build # 构建网页界面(只需这一次) / build the Web UI (once)

第二步 / Step 2 — 安装窗口引擎 Electron,在粘贴好的 <desktop> 文件夹里执行:

npm install    # 下载 Electron(约 100MB) / ~100 MB;国内可用 ELECTRON_MIRROR 镜像

第三步 / Step 3 — 配置 API Key:WebUI 设置页,或在家目录放 .env

DEEPSEEK_API_KEY=sk-...

没有 Key,窗口能打开,但对话无法回复 / Without a key the window opens, but conversations stay silent.


常见问题 · FAQ

会改动 DSH 源码吗?兼容性怎么样? · Does it change DSH's source? How compatible is it? 完全不改动源码——本仓库只是 `--patch` 注入的一个配置层,DSH 本体一行不改,兼容性良好。只要不跳出 WebUI(在窗口内使用),就完全兼容,与浏览器里用 WebUI 完全一致;所有功能都在窗口内使用也完全没有限制。 It changes no source — this repo is only a `--patch` config layer; the harness stays untouched and compatibility is good. As long as you stay inside the WebUI, it is fully compatible — identical to using the WebUI in a browser, with no feature restrictions in the window.
关掉窗口,DSH 还在后台跑吗? · Does DSH keep running in the background?
能一边用浏览器一边用窗口吗? · Can I use the browser and the window at once? 可以,两者是同一个 WebUI 的独立入口,互不干扰。 Yes — they are independent entries to the same WebUI, so both work concurrently.
双击没反应? · Double-click does nothing? 按顺序检查:① 在 DSH 根目录跑过 `pnpm install` 与 `pnpm run build`;② 在 `` 里跑过 `npm install`;③ 已配置 API Key。 In order: ① `pnpm install` + `pnpm run build` at the source root; ② `npm install` in ``; ③ an API key is set.
每次都要重新构建吗? · Do I need to rebuild every time? 不用,构建一次即可,之后都是双击启动。 No — once is enough; every later launch is a double-click.
--- ## 开发者 · For developers 目录结构与配置细节,普通使用可以跳过。 ### 目录结构 / Layout ``` plugin/index.js Cordis 插件本体(纯 ESM,零构建) electron-app/ 被插件拉起的 Electron 主进程 start.mjs / stop.mjs 跨平台核心逻辑(自动判断 pnpm dsh / 全局 dsh) start-desktop-window.* 各平台启动入口 stop-desktop-window.* 各平台停止入口 ``` ### 运行方式 / Run modes(脚本自动选择) | 场景(Scenario) | 命令(Command) | |---|---| | 在 DSH 源码内(检测到 `apps/cli/src`) | `pnpm dsh web --patch ` | | 独立运行(DSH 源码外) | `dsh web --patch `(需 `npm i -g @deepseek-ai/dsh`) | ### 配置 / Configuration 覆盖 patch 行的 `config`(默认值如下): ```yaml - insert: - id: desktop-window name: '' config: title: DeepSeek Harness WebUI # 默认 width: 1280 # 默认 height: 860 # 默认 quitOnClose: true # 默认 ``` - 需要 **Node.js ≥ 18**;跨平台逻辑为纯 Node,不依赖 PowerShell / Requires **Node.js ≥ 18**; plain Node, no PowerShell dependency. - 本仓库只做插件壳;DSH 本体见 [deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness)(MIT) / This repo is only the plugin shell; the harness lives at [deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness) (MIT). --- ## License MIT