DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-pet-sound

L

dsh-pet-sound

Discovered★ 3

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

dsh-pet-sound

CI npm 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 机器可读输出

安装

npx dsh-pet-sound status     # 直接用,不用安装

# 或者克隆下来
git clone https://github.com/LY3LY333/dsh-pet-sound.git
cd dsh-pet-sound
node bin/dsh-pet-sound.js status

要求 Node.js ≥ 18.17,零第三方依赖。已发布到 npm:https://www.npmjs.com/package/dsh-pet-sound

使用

下文命令里的 dsh-pet-sound 可以直接换成 npx dsh-pet-sound;克隆后则用 node bin/dsh-pet-sound.js。

# 查看状态(不写入任何东西)
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-pet0.3.x(在 0.3.8 上验证)
DSH Desktop0.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 六月风

Comments

Loading…

Similar plugins

dsh-token-pet

by Jimmy0123-ux

Bilingual floating DeepSeek Harness pet with live context, lifetime token ledger, trends, opt-in completion sound, and editable Prompt Optimizer enhancement.

UI & ExperienceManifest valid

★ 56

↓ 361/wk

MIT

TypeScript

Sep 21, 2026

dsh plugin --profile web add dsh-token-pet

by AGImentu

DSH (DeepSeek Harness) Web 插件:任务完成后播放提示音(可开关、可调音量、可上传自己的音频;内置提示音由脚本合成)

Development & InfrastructureManifest valid

★ 0

MIT

TypeScript

Sep 12, 2026

dsh plugin --profile web add dsh-turn-chime

by YangShen-SWE

A Windows desktop pet for official DeepSeek API balance, usage, and animated reactions in DSH.

UI & ExperienceManifest valid

★ 8

NOASSERTION

PowerShell

Oct 21, 2026

dsh plugin --profile web add dsh-plugin-simple-pet

by mhlywxl

Generative background music and notification chimes for DeepSeek Harness.

Vision & MultimodalManifest valid

★ 0

MIT

JavaScript

Oct 21, 2026

dsh plugin --profile web add dsh-coding-sound

by minybear

Codex-style desktop pet plugin for DeepSeek Harness

UI & ExperienceManifest valid

★ 7

MIT

JavaScript

Aug 18, 2026

dsh plugin --profile web add @minybear/dsh-pet

by dakeshui123

A chibi Frieren desktop pet for the DeepSeek Harness Web GUI: install with `dsh plugin --profile web add github:dakeshui123/dsh-pet-frieren`

Terminal & ClientsManifest valid

★ 0

MIT

JavaScript

Aug 19, 2026

dsh plugin --profile web add dsh-pet-frieren