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-state-sync

v0.1.0

Published

DSH web plugin: one-click DSH state pack & sync — export portable state (settings, profile plugin manifests, lockfiles, skills, optional sessions) to a tar.gz under $DSH_HOME/backups, and restore with per-profile plugin reinstall. Settings page (Settings

Readme

dsh-state-sync

给 DeepSeek Harness(dsh)提供一键状态打包与同步:把可移植的 dsh 状态导出为一个 .tar.gz,在新机器上恢复并按 profile 重装插件。

  • 设置页 — 设置 → DSH 状态打包与同步:导出、导入、浏览历史备份。
  • 斜杠命令 — /dsh-state export|import|list|home,可在输入框直接使用。
  • 独立脚本 — scripts/dsh-state-export.sh / scripts/dsh-state-restore.sh,不装插件也能用。

打包内容

| 路径 | 是否打包 | 说明 | | --- | --- | --- | | settings.yaml | ✅ | 偏好设置(主题 / 语言 / 模型 / 各插件设置) | | profiles/*/package.json | ✅ | 插件依赖 + dsh.profile.bundles 激活列表 | | profiles/*/cordis.patch.yml | ✅ | 每个 profile 的用户覆盖层 | | profiles/*/pnpm-lock.yaml | ✅ | 依赖锁文件 | | profiles/*/pnpm-workspace.yaml | ✅ | profile 的 pnpm 配置 | | 全局 cordis.patch.yml | ✅ | 存在时打包 | | skills/ | ✅ | 自定义技能 | | sessions/ | 可选 | --with-sessions 或设置页勾选 | | .credentials.yaml | ❌ | 永不打包 — 请单独、加密复制 | | profiles/*/node_modules/ | ❌ | 恢复时用 dsh plugin install 重建 | | storages/ | ❌ | 派生数据(索引、缓存),可重建 |

安装

与本仓库其他插件一样走 npm / bundle 通道:

dsh plugin --profile web add dsh-state-sync
# 本地 checkout:
dsh plugin --profile web add ./plugins/dsh-state-sync

下次启动 dsh 生效。卸载:dsh plugin --profile web remove dsh-state-sync。

设置页

打开 设置 → DSH 状态打包与同步。

  • 导出并打包 — 生成 $DSH_HOME/backups/dsh-state-<timestamp>.tar.gz。需要完整会话历史时勾选“同时打包 sessions/”(体积较大)。
  • 导入并恢复 — 输入备份包路径或从“历史备份”列表选择,确认后执行:先校验包内条目(拒绝绝对路径与 .. 穿越),再解包到 $DSH_HOME,最后对包内每个 profile 运行 dsh plugin --profile <name> install。只想解包不重装时,取消勾选“导入后立即重装各 profile 插件”。

凭据不会被包含。请手动复制 $DSH_HOME/.credentials.yaml,或单独加密:

tar -C "$DSH_HOME" -czf - .credentials.yaml | gpg -c > dsh-credentials.tar.gz.gpg

斜杠命令

在输入框使用:

/dsh-state export [--with-sessions] [target.tar.gz]
/dsh-state import [--no-install] [archive.tar.gz]
/dsh-state list
/dsh-state home

import 不带路径时使用 $DSH_HOME/backups 下最新的备份。

独立脚本

与插件行为一致,适合无 UI 环境或尚未安装 dsh 时使用:

# 导出到 $DSH_HOME/backups/
scripts/dsh-state-export.sh --with-sessions

# 恢复并重装插件
scripts/dsh-state-restore.sh ~/.dsh/backups/dsh-state-20250816-120000.tar.gz

# 只解包、不重装
scripts/dsh-state-restore.sh --no-install ~/.dsh/backups/dsh-state-20250816-120000.tar.gz

配置

bundle 行支持两个可选配置键(profile cordis.patch.yml,id 为 state-sync):

- insert:
    - id: state-sync
      name: dsh-state-sync
      config:
        backupDir: /Volumes/Backup/dsh-state   # 默认:$DSH_HOME/backups
        includeSessions: true                   # 默认:false

安全说明

  • JSON API 仅接受同源 POST,且 Host 地址必须是本机回环(或 web runtime 的 trustedHosts 列表内);跨站请求会被拒绝。
  • 解包前会检查归档条目,绝对路径与包含 .. 的条目会被拒绝。
  • 导入会按设计覆盖 $DSH_HOME 下的同名文件。只导入本插件自己创建的备份包。

License

MIT — 见 LICENSE。