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-archive-restore

v0.1.2

Published

归档管理:在设置页列出已归档会话(显示标题、支持多选),一键恢复并自动重启 Web GUI。Restore archived DSH sessions from the settings page with title list, multi-select and auto-restart.

Downloads

99

Readme

dsh-archive-restore

归档管理插件:把 DSH Web GUI 里"归档的会话"拿回来。

npm version npm downloads License: MIT

原名 dsh-archive-manager(npm 已被占用),发布名改为 dsh-archive-restore。

快速开始(npm 安装)

dsh plugin --profile web add dsh-archive-restore

然后重启 dsh web 服务(关闭 start-harness 窗口重新运行),刷新浏览器即可。

使用入口

设置页 → Agent 预设下方 →「归档管理」(归档箱图标)

更新

dsh plugin --profile web update dsh-archive-restore

卸载

dsh plugin --profile web remove dsh-archive-restore

需要 dsh(npm 全局)与 pnpm。安装后由 dsh plugin 自动把插件 加入 profile 的 bundles 层,无需手改配置。

功能

  • 设置页新增「归档管理」大菜单(位于 Agent 预设下方,归档箱图标)。
  • 右侧面板列出所有已归档会话,显示标题(会话 ID 作为次要信息),支持多选。
  • 点击「恢复所选并重启」:宿主端先把所选会话从归档名单中移除(写入 ~/.dsh/storages/workspace.json,与归档操作走同一条持久化通道),然后关闭 Web GUI、用原命令行重启服务,并在端口就绪后自动打开浏览器。

原理

归档只是把会话 id 记入 workspace 域的 archivedSessionIds 集合(~/.dsh/storages/workspace.json);会话日志与工作区槽位原样保留。本插件的宿主半在 webServer 上注册两个路由:

  • POST /__dsh-archive-manager/unarchive — 仅取消归档(不重启)。
  • POST /__dsh-archive-manager/restore — 取消归档 + 重启 + 自动打开浏览器。

重启由一个 detach 的 trampoline 进程驱动:等待旧进程退出 → 用 process.argv[1] 与剩余参数重建原命令行 → 在新控制台窗口启动 → 轮询端口后打开浏览器。日志写在 %TEMP%\dsh-archive-manager-restart.log。

可选:设置菜单归档箱图标补丁

DSH 设置导航的图标是硬编码映射(dsh-client-ui-settings-general),未知菜单项会落到默认齿轮。 为让「归档管理」显示归档箱图标,运行仓库内的补丁脚本(幂等,可重复执行):

node patch-nav-icon.cjs
# 或指定 bundle 路径:
node patch-nav-icon.cjs --file <path-to-dsh-client-ui-settings-general/lib/client.js>

该补丁修改的是 node_modules 里的文件,DSH 升级后如被还原,重新运行一次即可。 不运行也不影响功能,只是菜单显示默认齿轮图标。

项目结构

dsh-archive-restore/
├── package.json          双半声明(client inject slots/sessions/workspaces)
├── cordis.patch.yml      host 行注入 webServer/workspaceRegistry
├── patch-nav-icon.cjs    设置图标补丁脚本
├── test-spawn-forms.cjs  trampoline argv 形式测试
└── lib/
    ├── index.js          host 半:两条路由 + trampoline 重启驱动
    └── client.js         browser 半:归档管理设置区块

本地开发

# 1. cd 到 web profile,在 package.json 的 dependencies 加入
#    "dsh-archive-restore": "link:<本机仓库路径>"
#    并在 dsh.profile.bundles 加入 "dsh-archive-restore"
# 2. 在 profile 目录执行 pnpm install
# 3. 重启 Web GUI(dsh web)

详细设计与实现见 docs/实施文档.md。

License

MIT