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-pet-sound

v0.1.0

Published

DeepSeek Harness (dsh) desktop pet click sound patcher — idempotent apply/revert CLI, zero dependencies.

Readme

dsh-pet-sound

CI License: MIT Node.js

给 DSH 桌面桌宠(dsh-pet) 加上点击音效的小工具。幂等、可回滚、不改任何 DSH 配置。

A tiny, idempotent patcher that gives the DeepSeek Harness desktop pet (dsh-pet) a soft click sound — no asset files, no DSH config changes, fully reversible.


为什么需要它

dsh-pet 的点击回应是一段 无声的 webm 动画:源码里没有任何音频调用,素材也没有音轨。想让桌宠"戳一下有反应声",只能改它的渲染层。

这个工具把那点改动做成 可重复、可撤销 的操作,而不是手改 node_modules。

特性

| 能力 | 说明 | |---|---| | 幂等 | 重复 apply 不会叠加,第二次直接返回 already-patched | | 可回滚 | revert 精确删除注入块,测试保证逐字节还原原文件 | | 自动备份 | 每次写入前生成 sprite.js.dsh-pet-sound.<时间戳>.bak | | 外部补丁检测 | 检测到已有其它音效钩子时拒绝执行(避免叠成两声),需 --force 才覆盖 | | 零依赖 | 只用 Node 内置模块 + Web Audio API,不需要安装任何包 | | 多 profile | 自动扫描 $DSH_HOME/profiles/*,也可 --profile 指定 | | 可脚本化 | --dry-run 预演、--json 机器可读输出 |

安装

git clone https://github.com/LY3LY333/dsh-pet-sound.git
cd dsh-pet-sound

要求 Node.js ≥ 18.17,零第三方依赖。(尚未发布到 npm,所以请用下面的本地命令。)

使用

下文的 dsh-pet-sound 都指 node bin/dsh-pet-sound.js,也可以先 npm link 再直接用命令名。

# 查看状态(不写入任何东西)
node bin/dsh-pet-sound.js status

# 打补丁(默认音量 0.16)
node bin/dsh-pet-sound.js apply

# 自定义音量(0 < v <= 1)
node bin/dsh-pet-sound.js apply --volume 0.1

# 只预演,不写文件
node bin/dsh-pet-sound.js apply --dry-run

# 撤销
node bin/dsh-pet-sound.js revert

打完补丁后 重启桌宠 才会生效(右键桌宠 → 重载配置,或重启 DSH)。

指定 profile:

node bin/dsh-pet-sound.js apply --profile "C:\Users\you\.dsh\profiles\desktop"

输出示例

$ dsh-pet-sound status
PROFILE             PET       STATE       FILE
desktop             0.3.8     clean       C:\Users\you\.dsh\profiles\desktop\node_modules\dsh-pet\runtime\electron-helper\sprite.js

$ dsh-pet-sound apply
✓ desktop: patched — restart dsh-pet to hear it
  backup: C:\Users\you\.dsh\profiles\desktop\node_modules\dsh-pet\runtime\electron-helper\sprite.js.dsh-pet-sound.2026-10-27T14-00-00-000Z.bak

实现原理

只做两处字符串插入(源码可见 src/patch.js):

  1. 在 'use strict' 之后插入一个 __dshPetSound() 函数(Web Audio 合成"叮咚",带标记注释)
  2. 在 onClick(e) { 之后插入一行 __dshPetSound(); // dsh-pet-sound

revert 按标记删除这两处。整个过程不碰 DSH 的 profile 配置、锁文件或其它插件。

兼容性

| 项目 | 版本 | |---|---| | dsh-pet | 0.3.x(在 0.3.8 上验证) | | DSH Desktop | 0.2.x | | Node.js | ≥ 18.17 |

只作用于桌面模式(runtime/electron-helper/sprite.js)。浏览器里的网页版桌宠不走这个文件。

已知限制

  • dsh-pet 升级会覆盖补丁 —— 升级后重新 apply 即可。
  • 锚点依赖 onClick(e) { 这一行;上游若改写法会返回 anchor-not-found 而不是乱改文件。
  • 音效是纯合成音(正弦波 880→1318 Hz),没有内置素材;想换音色改 src/snippet.js 即可。

开发

node --test        # 10 个测试:幂等、回滚、CRLF、外部补丁检测…
npm run lint       # 三个入口文件的语法检查

License

MIT © 2026 六月风