better-dsh-pet 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/package.json +1 -1
- package/runtime/electron-helper/renderer.js +12 -0
package/README.md
CHANGED
|
@@ -202,6 +202,14 @@
|
|
|
202
202
|
dsh plugin --profile web add better-dsh-pet
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
+
> 如果刚发布新版本不到 24 小时,pnpm 11 的 `minimumReleaseAge` 安全策略可能不会自动选最新版,而是退回旧版。此时请指定精确版本安装:
|
|
206
|
+
>
|
|
207
|
+
> ```bash
|
|
208
|
+
> dsh plugin --profile web add better-dsh-pet@0.2.5
|
|
209
|
+
> ```
|
|
210
|
+
>
|
|
211
|
+
> pnpm 会自动把该版本加入 `minimumReleaseAgeExclude` 并完成安装;也可以等待 24 小时后直接用上面的普通命令。
|
|
212
|
+
|
|
205
213
|
### 启动
|
|
206
214
|
|
|
207
215
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-dsh-pet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "A desktop-native pet bubble driven by DeepSeek Harness session events: transparent always-on-top Electron window, status-aware animations, balance, pomodoro, roast, and DSH settings card.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -331,6 +331,7 @@ function playIdle() {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
function playState(state, { pulse = false } = {}) {
|
|
334
|
+
clearIdleDelay()
|
|
334
335
|
stopMove()
|
|
335
336
|
currentMode = pulse ? 'pulse' : 'state'
|
|
336
337
|
const pool = STATE_ANIMS[state] || STATE_ANIMS.IDLE
|
|
@@ -343,6 +344,7 @@ function playState(state, { pulse = false } = {}) {
|
|
|
343
344
|
}
|
|
344
345
|
|
|
345
346
|
function playClick() {
|
|
347
|
+
clearIdleDelay()
|
|
346
348
|
stopMove()
|
|
347
349
|
currentMode = 'click'
|
|
348
350
|
const next = pick(CLICKS, anim)
|
|
@@ -354,6 +356,7 @@ function playClick() {
|
|
|
354
356
|
}
|
|
355
357
|
|
|
356
358
|
function playDrag() {
|
|
359
|
+
clearIdleDelay()
|
|
357
360
|
stopMove()
|
|
358
361
|
currentMode = 'drag'
|
|
359
362
|
anim = DRAG
|
|
@@ -447,6 +450,13 @@ function clearIdleDelay() {
|
|
|
447
450
|
function scheduleNextIdle() {
|
|
448
451
|
clearIdleDelay()
|
|
449
452
|
if (CONFIG.actionDelayMs > 0) {
|
|
453
|
+
// 等待“动作切换间隔”时不要定格在上一动作的最后一帧:
|
|
454
|
+
// 先播放循环待机呼吸,等间隔结束再进入下一个随机/自定义动作。
|
|
455
|
+
currentMode = 'idle'
|
|
456
|
+
anim = IDLE
|
|
457
|
+
animOnce = false
|
|
458
|
+
animLoop = true
|
|
459
|
+
switchTo(IDLE, { loop: true })
|
|
450
460
|
idleDelayTimer = setTimeout(() => {
|
|
451
461
|
idleDelayTimer = null
|
|
452
462
|
playIdle()
|
|
@@ -602,6 +612,7 @@ function showManualBubble(message, detail, ttl = 2200) {
|
|
|
602
612
|
}
|
|
603
613
|
|
|
604
614
|
function feedPet() {
|
|
615
|
+
clearIdleDelay()
|
|
605
616
|
const next = pick(EAT_ANIMS, anim)
|
|
606
617
|
anim = next
|
|
607
618
|
animOnce = true
|
|
@@ -766,6 +777,7 @@ document.addEventListener('mousemove', (e) => {
|
|
|
766
777
|
})
|
|
767
778
|
|
|
768
779
|
function startDrag(e) {
|
|
780
|
+
clearIdleDelay()
|
|
769
781
|
stopMove()
|
|
770
782
|
e.currentTarget.classList.add('dragging')
|
|
771
783
|
try { e.currentTarget.setPointerCapture(e.pointerId) } catch { /* 忽略捕获失败 */ }
|