npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-desktop-watchdog

v0.2.20

Published

Desktop window control for the DeepSeek Harness app: a detached close-and-relaunch watchdog and a startup maximize restorer, both with no console window.

Readme

dsh-desktop-watchdog

DeepSeek Harness 桌面端的重启看门狗:先温和关窗(CloseMainWindow),超时再强杀, 然后 detached 重新拉起,全程不弹命令行窗口。

做什么

  1. 写一个隐藏 VBS(sh.Run(cmd, 0, False) 走 STARTF_USESHOWWINDOW,零窗口)
  2. 由 Node 直接 spawn('wscript.exe', ['//B','//NoLogo', vbs], { detached: true }) —— wscript 是 GUI 子系统宿主,不创建 conhost
  3. VBS 里的 PowerShell 脚本执行:关窗 → 等进程退净 → 重新拉起 → 写日志到 %LOCALAPPDATA%\AI-Agent-Hub\dsh-restart.log

关键经验(2026-11-09 实测)

  • windowsHide: true 只隐藏窗口,不阻止 conhost.exe 被创建;每调一次 execFileSync('schtasks', …) 就多一个 conhost
  • 所以本项目弃用 schtasks,改 spawn('wscript.exe'):控制台子进程从 4 个降到 0 个
  • 看门狗必须 detached: true + stdio: 'ignore',否则 DSH 退出时会被一起杀掉

状态

  • index.js:scheduleDesktopRestart() —— 重启看门狗(从 hub-desktop-ui 搬入)。
  • window-state.js:maximizeDesktopWindowOnStart() —— 应用启动后把主窗口恢复为最大化。

窗口状态(window-state.js)

外壳 createWindow() 写死 1280×820 且不持久化窗口状态(resources/app.asar 内 lib/main.js:20103),所以每次重启都回到普通窗口态。这里用 Win32 ShowWindow(SW_MAXIMIZE) 兜底:Host 启动后起一个零窗口 wscript → PowerShell,等主窗口可见再最大化。

  • 只对「应用刚启动」生效(窗口宿主进程启动超过 180 s 就跳过),Host 单独重启不会重置窗口。
  • 结论写 %LOCALAPPDATA%\AI-Agent-Hub\dsh-window-state.log(含 pid/hwnd/appAge/maximized)。
  • 关掉:profile 的插件 config 配 windowMaximizeOnStart: false。

License

MIT