DeepSHPlugins
dsh-wsl-tray 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-wsl-tray

工具與整合TypeScriptMIT

為執行在 WSL 的 DSH 提供 Windows 桌面快捷方式和系統托盤啟動器:完全隱藏啟動,托盤選單支援開啟/重啟/退出,外掛配置頁可管理快捷方式。

2 Starsliyu34 更新時間 2026-08-30
訪問 GitHub 倉庫
dsh-wsl-tray 專案預覽

專案介紹

中文

為執行在 WSL 的 DSH 提供 Windows 桌面快捷方式和系統托盤啟動器:完全隱藏啟動,托盤選單支援開啟/重啟/退出,外掛配置頁可管理快捷方式。

English

Windows desktop shortcut and system-tray launcher for DSH running in WSL, with fully hidden startup, tray open/restart/exit menu, and a plugin-configuration card to manage the shortcut.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
liyu34
倉庫
liyu34/dsh-wsl-tray
GitHub Stars
2
Forks
0
開發語言
TypeScript
許可證
MIT
最近推送
2026-08-30
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

60/ 100
維護活躍
93
文件與實用資訊
100
生態關注度
14
安裝便捷訊號
100
專案宣告訊號
100

近 12 天仍在更新;README 含完整安裝與使用說明;關注度尚低(2)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add github:liyu34/dsh-wsl-tray

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-wsl-tray

中文 | English

A DeepSeek Harness plugin for WSL deployments: it puts a Windows desktop shortcut and a system-tray launcher in front of the DSH web server running inside WSL.

Features

  • Double-click the DeepSeek Harness desktop shortcut to start DSH in the

background (or reuse an already-running instance). The default browser opens exactly once when DSH is ready (the built-in DSH browser-open is disabled by --no-open; only the tray opens it).

  • A DSH fish tray icon appears. Right-click menu:
  • 打开 DeepSeek Harness / open the DSH web page
  • 重新生成桌面快捷方式 / recreate the desktop shortcut
  • 重启 DSH 服务 / restart the DSH service
  • 暂停守护进程 / 恢复守护进程 / pause or resume the watchdog
  • 退出 / exit the tray icon
  • Double-clicking the tray icon also opens the DSH web page.
  • A watchdog daemon runs inside the tray: it probes the DSH URL on a

timer, restarts DSH when the probes fail, gives up after a bounded number of consecutive failed restarts, and writes a full audit trail to watchdog.log (see Watchdog below).

  • The plugin-configuration card shows live status (tray files + watchdog

state) and a button that recreates the desktop shortcut without touching WSL by hand. The card can also show the tail of the watchdog log.

  • No console window is shown: the shortcut goes through wscript.exe + VBS and

the entire chain is launched with window style 0.

Requirements

  • DSH itself must be running inside WSL (WSL_DISTRO_NAME set, /mnt/c

accessible).

  • Windows must be able to run wscript.exe, powershell.exe, and wsl.exe.
  • DSH web 0.1.0-rc.7 or newer (settings cards + client bundle machinery).

Install

Once published to npm:

dsh plugin --profile web add dsh-wsl-tray

Or add it manually to a DSH web profile:

cd ~/.dsh/profiles/web
pnpm add dsh-wsl-tray

and add "dsh-wsl-tray" to package.json:

"dsh": {
  "profile": {
    "bundles": [
      "@deepseek-ai/dsh-base",
      "@deepseek-ai/dsh-web-app",
      "dsh-wsl-tray"
    ]
  }
}

Restart dsh web and open Settings → Plugins → Plugin configuration to see the WSL 桌面与托盘 card.

Generated files

The plugin writes five generated files:

FileLocation
dsh.ico%USERPROFILE%\.dsh\dsh-wsl-tray\dsh.ico
dsh-tray.ps1%USERPROFILE%\.dsh\dsh-wsl-tray\dsh-tray.ps1
dsh-tray.vbs%USERPROFILE%\.dsh\dsh-wsl-tray\dsh-tray.vbs
start.sh~/.dsh/dsh-wsl-tray/start.sh
stop.sh~/.dsh/dsh-wsl-tray/stop.sh

and creates:

%USERPROFILE%\Desktop\DeepSeek Harness.lnk

While the tray runs, the watchdog maintains two runtime files (both are shown on the config card):

FileLocation
watchdog.log%USERPROFILE%\.dsh\dsh-wsl-tray\watchdog.log (rotated at 512 KB)
watchdog-status.json%USERPROFILE%\.dsh\dsh-wsl-tray\watchdog-status.json (latest tick)

The shortcut points at wscript.exe, which runs dsh-tray.vbs; the VBS starts the tray PowerShell hidden, and the tray starts start.sh inside WSL through WScript.Shell.Run(..., 0, false).

Watchdog

The watchdog lives inside the tray helper (the one process that is deliberately independent of DSH), and answers the three questions a restart daemon has to:

  1. How liveness is judged — an HTTP Invoke-WebRequest probe of the DSH

web URL every probeIntervalSec (default 10 s, probe timeout 3 s). Each probe records its status code or error text, so a *refused* connection (nothing listening), a *timeout* (hung server) and a *bad status* stay distinguishable in the log. DSH is only considered DOWN after downThreshold (3) consecutive failed probes.

  1. Restart success & giving up — a restart is triggered (stop + start via

wsl.exe) and the watchdog waits up to restartWaitSec (180 s) for the URL to answer again: an answer = success, which resets the failure counter; an unanswered window = one failed restart. After maxRestartFailures (3) consecutive failures the watchdog pauses instead of looping forever. It resumes from the tray menu (恢复守护进程), or automatically as soon as DSH answers again.

  1. Logging — every probe transition, restart trigger, success/failure and

pause/resume is appended to watchdog.log with a timestamp, level and the probe detail; the current state machine snapshot goes to watchdog-status.json every tick. The plugin card exposes both through /dsh-wsl-tray/watchdog and /dsh-wsl-tray/watchdog-log.

Phases: starting (initial boot grace) → probing (steady state) → restarting (waiting after a restart) → backoff (cooldown) or paused (give-up / manual pause). The tuning values above are baked into dsh-tray.ps1; change them in src/artifacts.ts (DEFAULT_WATCHDOG_CONFIG) and regenerate.

Install without npm publishing

If npm publishing is not an option, install the prebuilt tarball that is included in this repository:

cd ~/.dsh/profiles/web
pnpm add /path/to/dsh-wsl-tray-github/dist/dsh-wsl-tray-0.1.4.tgz

Then add "dsh-wsl-tray" to the profile bundle list as above.

How it works

  1. Hidden launch: shortcut → wscript.exe → VBS → hidden PowerShell tray.
  2. DSH stays alive: start.sh runs DSH in the foreground of the hidden

wsl.exe session, so WSL does not recycle the process after the one-shot launcher exits.

  1. Automatic browser open: a Windows-side timer in the tray polls the DSH

URL every 2 seconds and calls Start-Process $webUrl once DSH answers.

  1. Watchdog: a second tray timer probes the URL every 10 seconds and runs

the state machine described above.

  1. Regeneration: the config card and the tray menu both run

dsh-tray.ps1 -Regenerate.

Development

npm install
npm run typecheck
npm test
npm run build
npm pack --dry-run

Known limitations

  • Only enabled inside WSL; on non-WSL hosts the card reports that the feature

is unavailable.

  • The watchdog runs only while the tray icon is up: choosing 退出 stops the

watchdog and the DSH instance (via the generated stop.sh: a PID file tracks the instance start.sh launched, then a pattern fallback covers bin.js web launches from source checkouts, npm global installs and npx). Add the shortcut to the Windows Startup folder if you want the watchdog to follow Windows boot.

  • A DSH web instance started any other way (different flags, another tool) is

not tracked by the PID file; stop it by hand (Windows Task Manager or wsl --shutdown) if the pattern fallback does not reach it.

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案