@eslaykey/dsh-breeze-tts 1.0.2 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), version
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.0.3] - 2026-10-31
9
+
10
+ ### Fixed
11
+ - Auto-speak dropped emotion tags before synthesis, so tagged replies lost their per-segment tone; the per-message button was unaffected because it used a different text path
12
+ - Auto-speak could fire while the reply was still being generated; it now waits until the text has been stable for a few seconds
13
+
14
+
8
15
  ## [1.0.1] - 2026-10-30
9
16
 
10
17
  ### Added
package/README.md CHANGED
@@ -4,13 +4,25 @@
4
4
 
5
5
  ## 安装
6
6
 
7
- 装进当前 profile,然后重启 DSH:
8
-
9
7
  ```bash
10
- dsh plugin --profile <profile> add <package-name>
8
+ dsh plugin --profile desktop add @eslaykey/dsh-breeze-tts
9
+ ```
10
+
11
+ 如果提示 `dsh : 无法将“dsh”项识别为 cmdlet…`,说明 CLI 不在 PATH 上。DSH 桌面版自带的 CLI 在:
12
+
13
+ ```
14
+ D:\ds\resources\runtime\cli\bin\dsh.cmd
15
+ ```
16
+
17
+ 两条路任选:把 `D:\ds\resources\runtime\cli\bin` 加进用户 PATH(加完重开终端),或者直接用完整路径:
18
+
19
+ ```powershell
20
+ & "D:\ds\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add @eslaykey/dsh-breeze-tts
11
21
  ```
12
22
 
13
- 首次使用需要在设置里填 Breeze 的 API key(`brz_` 开头),获取地址:<https://breezeblue.ai/app/developer/api-keys>。
23
+ 装完**重启 DSH**。然后进「设置 → 语音朗读」,在顶部填入 Breeze 的 API key(`brz_` 开头)点「连接」,成功会显示当前余额。
24
+
25
+ API key 在这里申请:<https://breezeblue.ai/app/developer/api-keys>
14
26
 
15
27
  ## 能做什么
16
28
 
@@ -78,7 +90,21 @@ allowBuilds:
78
90
 
79
91
  **合成返回 401 / 403**
80
92
 
81
- API key 无效或已过期。到 <https://breezeblue.ai/app/developer/api-keys> 重新生成,写进 `~/.dsh/breeze.json` 的 `apiKey`。
93
+ API key 无效或已过期。到 <https://breezeblue.ai/app/developer/api-keys> 重新生成,回到设置页重新「连接」,或者直接写进 `~/.dsh/breeze.json` 的 `apiKey`。
94
+
95
+ **合成返回 502 / 503 / 504**
96
+
97
+ 这是 Breeze 服务端的问题,不是本机故障:网关在时限内没等到源站响应。插件会自动重试一次;仍然失败就稍后再试。余额和音色列表这类免费接口此时通常仍然可用,所以「余额正常但试听报错」不代表 key 有问题。
98
+
99
+ ## 开发
100
+
101
+ ```bash
102
+ git clone <this repo>
103
+ cd dsh-breeze-tts
104
+ dsh plugin --profile desktop add . # 以链接方式装进 profile,改完重启生效
105
+ ```
106
+
107
+ 改 Host 代码必须重启 DSH;改 Client 代码同样要重启(DSH 桌面版没有页面刷新)。
82
108
 
83
109
  ## License
84
110
 
package/client.js CHANGED
@@ -480,9 +480,9 @@ function stripEmoji(text) {
480
480
  return out
481
481
  }
482
482
 
483
- function cleanForSpeech(text) {
483
+ function cleanForSpeech(text, keepTags) {
484
484
  let value = String(text ?? '')
485
- value = value.replace(/<!--[\s\S]*?-->/g, ' ')
485
+ if (!keepTags) value = value.replace(/<!--[\s\S]*?-->/g, ' ')
486
486
  value = value.replace(/!\[[^\]]*\]\([^)]*\)/g, ' ')
487
487
  value = value.replace(/\[([^\]]*)\]\([^)]*\)/g, '$1')
488
488
  value = value.replace(/https?:\/\/[^\s)]+/g, ' ')
@@ -515,7 +515,7 @@ function cleanForSpeech(text) {
515
515
  if (!target) return ""
516
516
  const message = target.message && typeof target.message === "object" ? target.message : target
517
517
  const direct = textBlocks(message.content, [])
518
- if (direct.length) return cleanForSpeech(direct.join(String.fromCharCode(10)))
518
+ if (direct.length) return cleanForSpeech(direct.join(String.fromCharCode(10)), true)
519
519
  const typed = collectText(message, [], 0).join(String.fromCharCode(10)).trim()
520
520
  if (typed) return typed
521
521
  return collectAnyText(message, [], 0).join(String.fromCharCode(10)).trim()
@@ -593,6 +593,7 @@ function cleanForSpeech(text) {
593
593
  }
594
594
  const primed = React.useRef(false)
595
595
  const debounce = React.useRef(null)
596
+ const pendingRef = React.useRef(null)
596
597
  const focused = React.useRef(true)
597
598
  const snapshot = typeof props.useChat === 'function'
598
599
  ? props.useChat((value) => (value && typeof value === 'object' ? value.legacy : undefined))
@@ -637,11 +638,12 @@ function cleanForSpeech(text) {
637
638
  }
638
639
 
639
640
  if (debounce.current) window.clearTimeout(debounce.current)
640
- debounce.current = window.setTimeout(evaluate, 600)
641
+ debounce.current = window.setTimeout(evaluate, 1000)
641
642
  return
642
643
 
643
644
  function evaluate() {
644
645
  let text = ''
646
+ let measure = ''
645
647
  let id = ''
646
648
  for (let index = nodes.length - 1; index >= 0; index -= 1) {
647
649
  const node = nodes[index]
@@ -656,14 +658,29 @@ function cleanForSpeech(text) {
656
658
  } catch {
657
659
  raw = ''
658
660
  }
659
- const cleaned = cleanForSpeech(raw)
660
- if (!cleaned) continue
661
- const recent = played.current.texts.get(cleaned.slice(0, 80))
661
+ const spokenText = cleanForSpeech(raw, true)
662
+ const plain = cleanForSpeech(raw)
663
+ if (!plain) continue
664
+ const recent = played.current.texts.get(plain.slice(0, 80))
662
665
  if (recent && Date.now() - recent < 60000) {
663
666
  markSpoken(candidateId, '')
664
667
  continue
665
668
  }
666
- text = cleaned
669
+ const pending = pendingRef.current
670
+ if (!pending || pending.id !== candidateId || pending.text !== spokenText) {
671
+ pendingRef.current = { id: candidateId, text: spokenText, at: Date.now() }
672
+ if (debounce.current) window.clearTimeout(debounce.current)
673
+ debounce.current = window.setTimeout(evaluate, 1200)
674
+ return
675
+ }
676
+ if (Date.now() - pending.at < 2500) {
677
+ if (debounce.current) window.clearTimeout(debounce.current)
678
+ debounce.current = window.setTimeout(evaluate, 1200)
679
+ return
680
+ }
681
+ pendingRef.current = null
682
+ text = spokenText
683
+ measure = plain
667
684
  id = candidateId
668
685
  break
669
686
  }
@@ -684,7 +701,7 @@ function cleanForSpeech(text) {
684
701
  const limit = Number((data && data.autoSpeakMaxChars) || 0)
685
702
  if (!data || !data.autoSpeak) return null
686
703
  if (limit <= 0) return null
687
- if (text.length > limit) return null
704
+ if (measure.length > limit) return null
688
705
  if (!data.backgroundPlay && !focused.current) return null
689
706
  return speakRemotely({ text }, { host: true })
690
707
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslaykey/dsh-breeze-tts",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Breeze Blue text-to-speech for DeepSeek Harness: agent tools, reply playback, voice design and a settings page.",
5
5
  "author": "eslaykey",
6
6
  "license": "MIT",
@@ -45,5 +45,13 @@
45
45
  "text-to-speech",
46
46
  "breeze",
47
47
  "voice"
48
- ]
48
+ ],
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/EslayKey/dsh-breeze-tts.git"
52
+ },
53
+ "homepage": "https://github.com/EslayKey/dsh-breeze-tts#readme",
54
+ "bugs": {
55
+ "url": "https://github.com/EslayKey/dsh-breeze-tts/issues"
56
+ }
49
57
  }