dsh-xiaomi-tts 3.0.1 → 3.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.
Files changed (134) hide show
  1. package/NOTICE +5 -0
  2. package/README.en.md +108 -158
  3. package/README.md +90 -114
  4. package/assets/audio/off02.mp3 +0 -0
  5. package/assets/audio/off03.mp3 +0 -0
  6. package/assets/audio/on03.mp3 +0 -0
  7. package/assets/audio/volume-01.mp3 +0 -0
  8. package/assets/audio/volume-02.mp3 +0 -0
  9. package/assets/mimo.svg +27 -0
  10. package/assets/setting.png +0 -0
  11. package/assets/social.webp +0 -0
  12. package/assets/ui/api-key-whale.webp +0 -0
  13. package/assets/ui/mixer-whale.webp +0 -0
  14. package/assets/ui/preview-whale.webp +0 -0
  15. package/assets/ui/sound-effect-cues.webp +0 -0
  16. package/assets/ui/sound-effects-toggle-characters.webp +0 -0
  17. package/assets/ui/sound-effects-whale.webp +0 -0
  18. package/assets/ui/toggle-characters.webp +0 -0
  19. package/assets/whale-girls.webp +0 -0
  20. package/cordis.patch.yml +22 -22
  21. package/lib/client/conversation/read-aloud.d.ts +33 -0
  22. package/lib/client/conversation/read-aloud.d.ts.map +1 -0
  23. package/lib/client/host-route.d.ts +2 -0
  24. package/lib/client/host-route.d.ts.map +1 -0
  25. package/lib/client/index.d.ts +2 -2
  26. package/lib/client/index.d.ts.map +1 -1
  27. package/lib/client/localization.d.ts +37 -2
  28. package/lib/client/localization.d.ts.map +1 -1
  29. package/lib/client/{playback.d.ts → playback/index.d.ts} +2 -2
  30. package/lib/client/playback/index.d.ts.map +1 -0
  31. package/lib/client/{live-speech-controller.d.ts → playback/live-speech-controller.d.ts} +5 -2
  32. package/lib/client/playback/live-speech-controller.d.ts.map +1 -0
  33. package/lib/client/{local-speech-controller.d.ts → playback/local-speech-controller.d.ts} +7 -2
  34. package/lib/client/playback/local-speech-controller.d.ts.map +1 -0
  35. package/lib/client/{pcm-audio-queue.d.ts → playback/pcm-audio-queue.d.ts} +6 -0
  36. package/lib/client/playback/pcm-audio-queue.d.ts.map +1 -0
  37. package/lib/client/{pcm-play-service.d.ts → playback/pcm-play-service.d.ts} +5 -4
  38. package/lib/client/playback/pcm-play-service.d.ts.map +1 -0
  39. package/lib/client/{playback-controller.d.ts → playback/playback-controller.d.ts} +6 -2
  40. package/lib/client/playback/playback-controller.d.ts.map +1 -0
  41. package/lib/client/{preview-player.d.ts → playback/preview-player.d.ts} +6 -3
  42. package/lib/client/playback/preview-player.d.ts.map +1 -0
  43. package/lib/client/{playback-types.d.ts → playback/types.d.ts} +1 -1
  44. package/lib/client/playback/types.d.ts.map +1 -0
  45. package/lib/client/playback/voice-rate.d.ts +5 -0
  46. package/lib/client/playback/voice-rate.d.ts.map +1 -0
  47. package/lib/client/settings/api-key-module.d.ts +13 -0
  48. package/lib/client/settings/api-key-module.d.ts.map +1 -0
  49. package/lib/client/settings/card.d.ts +17 -0
  50. package/lib/client/settings/card.d.ts.map +1 -0
  51. package/lib/client/settings/collapsible-module.d.ts +17 -0
  52. package/lib/client/settings/collapsible-module.d.ts.map +1 -0
  53. package/lib/client/settings/controls/built-in-voice-picker.d.ts.map +1 -0
  54. package/lib/client/settings/controls/energy-volume-slider.d.ts +15 -0
  55. package/lib/client/settings/controls/energy-volume-slider.d.ts.map +1 -0
  56. package/lib/client/settings/controls/local-voice-picker.d.ts.map +1 -0
  57. package/lib/client/settings/controls/voice-design-picker.d.ts.map +1 -0
  58. package/lib/client/settings/details-module.d.ts +43 -0
  59. package/lib/client/settings/details-module.d.ts.map +1 -0
  60. package/lib/client/settings/field-heading.d.ts +13 -0
  61. package/lib/client/settings/field-heading.d.ts.map +1 -0
  62. package/lib/client/settings/preview-module.d.ts +13 -0
  63. package/lib/client/settings/preview-module.d.ts.map +1 -0
  64. package/lib/client/settings/scope.d.ts +6 -0
  65. package/lib/client/settings/scope.d.ts.map +1 -0
  66. package/lib/client/settings/sound-effects-module.d.ts +23 -0
  67. package/lib/client/settings/sound-effects-module.d.ts.map +1 -0
  68. package/lib/client/settings/switch-module.d.ts +14 -0
  69. package/lib/client/settings/switch-module.d.ts.map +1 -0
  70. package/lib/client/settings/types.d.ts +12 -0
  71. package/lib/client/settings/types.d.ts.map +1 -0
  72. package/lib/client/sound-effects/click-classifier.d.ts +3 -0
  73. package/lib/client/sound-effects/click-classifier.d.ts.map +1 -0
  74. package/lib/client/sound-effects/index.d.ts +6 -0
  75. package/lib/client/sound-effects/index.d.ts.map +1 -0
  76. package/lib/client/sound-effects/task-watcher.d.ts +4 -0
  77. package/lib/client/sound-effects/task-watcher.d.ts.map +1 -0
  78. package/lib/client/sound-effects/toggle-sound-player.d.ts +20 -0
  79. package/lib/client/sound-effects/toggle-sound-player.d.ts.map +1 -0
  80. package/lib/client/sound-effects/types.d.ts +21 -0
  81. package/lib/client/sound-effects/types.d.ts.map +1 -0
  82. package/lib/client/style/index.d.ts +2 -0
  83. package/lib/client/style/index.d.ts.map +1 -0
  84. package/lib/client.js +3983 -1450
  85. package/lib/client.js.map +1 -1
  86. package/lib/index.d.ts +19 -3
  87. package/lib/index.d.ts.map +1 -1
  88. package/lib/index.js +156 -33
  89. package/lib/pcm-stream.js +1 -1
  90. package/lib/{shared-BxsP6NKT.js → shared-DJtQ85KH.js} +99 -15
  91. package/lib/shared.d.ts +65 -11
  92. package/lib/shared.d.ts.map +1 -1
  93. package/lib/shared.js +2 -2
  94. package/package.json +191 -129
  95. package/scripts/prepare-package.mjs +12 -0
  96. package/assets/audio/on04.mp3 +0 -0
  97. package/assets/social.png +0 -0
  98. package/assets/ui/api-key-whale.png +0 -0
  99. package/assets/ui/mixer-whale.png +0 -0
  100. package/assets/ui/preview-whale.png +0 -0
  101. package/assets/ui/toggle-characters.png +0 -0
  102. package/lib/client/built-in-voice-picker.d.ts.map +0 -1
  103. package/lib/client/conversation-state.d.ts +0 -39
  104. package/lib/client/conversation-state.d.ts.map +0 -1
  105. package/lib/client/conversation.d.ts +0 -39
  106. package/lib/client/conversation.d.ts.map +0 -1
  107. package/lib/client/dsh-compat.d.ts +0 -28
  108. package/lib/client/dsh-compat.d.ts.map +0 -1
  109. package/lib/client/live-speech-controller.d.ts.map +0 -1
  110. package/lib/client/local-speech-controller.d.ts.map +0 -1
  111. package/lib/client/local-voice-picker.d.ts.map +0 -1
  112. package/lib/client/pcm-audio-queue.d.ts.map +0 -1
  113. package/lib/client/pcm-play-service.d.ts.map +0 -1
  114. package/lib/client/playback-controller.d.ts.map +0 -1
  115. package/lib/client/playback-types.d.ts.map +0 -1
  116. package/lib/client/playback.d.ts.map +0 -1
  117. package/lib/client/preview-player.d.ts.map +0 -1
  118. package/lib/client/settings-card.d.ts +0 -15
  119. package/lib/client/settings-card.d.ts.map +0 -1
  120. package/lib/client/settings-scope.d.ts +0 -6
  121. package/lib/client/settings-scope.d.ts.map +0 -1
  122. package/lib/client/styles.d.ts +0 -2
  123. package/lib/client/styles.d.ts.map +0 -1
  124. package/lib/client/toggle-sound-player.d.ts +0 -13
  125. package/lib/client/toggle-sound-player.d.ts.map +0 -1
  126. package/lib/client/voice-design-picker.d.ts.map +0 -1
  127. package/lib/conversation-state.js +0 -25
  128. package/lib/settings-compat-B_MTrCCL.js +0 -18
  129. package/lib/settings-compat.d.ts +0 -16
  130. package/lib/settings-compat.d.ts.map +0 -1
  131. package/lib/settings-compat.js +0 -3
  132. /package/lib/client/{built-in-voice-picker.d.ts → settings/controls/built-in-voice-picker.d.ts} +0 -0
  133. /package/lib/client/{local-voice-picker.d.ts → settings/controls/local-voice-picker.d.ts} +0 -0
  134. /package/lib/client/{voice-design-picker.d.ts → settings/controls/voice-design-picker.d.ts} +0 -0
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ This project includes code derived from uisfx 0.4.0.
2
+
3
+ uisfx: https://github.com/romainsimon/uisfx
4
+ Copyright (c) Yuki Capital
5
+ Licensed under the MIT License.
package/README.en.md CHANGED
@@ -5,130 +5,128 @@
5
5
  [![npm version](https://img.shields.io/npm/v/dsh-xiaomi-tts.svg)](https://www.npmjs.com/package/dsh-xiaomi-tts)
6
6
  [![GitHub stars](https://img.shields.io/github/stars/ppy-web/dsh-plugin-xiaomi-mimo-tts.svg)](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts)
7
7
 
8
- <p><a href="README.md"><strong>中文说明 →</strong></a></p>
9
-
10
- Add Xiaomi MiMo TTS read-aloud playback to assistant replies in DeepSeek Harness Web.
11
-
12
- > Powered by Xiaomi MiMo TTS models to turn assistant replies into smooth, clear natural speech. MiMo TTS is currently free for a limited time; refer to Xiaomi MiMo for the current policy.
8
+ Add Xiaomi MiMo TTS read-aloud playback to DeepSeek Harness Web.
13
9
 
14
- ## Preview
10
+ > Powered by Xiaomi MiMo TTS to turn text into smooth, clear natural speech. MiMo TTS is currently free for a limited time; see the official platform for the latest policy.
15
11
 
16
- ![Xiaomi MiMo settings menu](assets/menu.png)
17
-
18
- ![Preset](assets/preset.png)
12
+ <p><a href="README.md"><strong>中文说明 →</strong></a></p>
19
13
 
20
- ![Button](assets/image.png)
14
+ ## 🎨 Preview
21
15
 
22
- ## Features
16
+ | Preset voices | Custom voices |
17
+ |:---:|:---:|
18
+ | ![Xiaomi MiMo settings menu](assets/menu.png) | ![Custom voice](assets/preset.png) |
19
+ | Settings | UI example |
20
+ | ![UI](assets/setting.png) | ![UI](assets/image.png) |
23
21
 
24
- - Shows a read-aloud button below each completed assistant reply body when needed; enabled by default.
25
- - Uses Xiaomi MiMo's currently limited-time-free TTS models: `mimo-v2.5-tts` outputs smooth, clear audio with selectable PCM streaming or complete MP3/WAV playback.
26
- - Uses `mimo-v2.5-tts-voicedesign` Voice Design to create the voice you want from a text description.
27
- - Supports bidirectional browser-speech fallback for both MiMo models, using every offline or online voice exposed by the browser with MiMo first, local first, or disabled strategies.
28
- - Lets you switch between the preset-voice model and the custom voice-design model under **Settings → Plugins → Plugin configuration**, and configure the API key, autoplay, voice, audio format, and voice description.
29
- - Presents built-in voices in a two-column selector using Xiaomi MiMo's official avatars, names, and summaries.
30
- - Keeps the API key on the DSH Host. The browser sends only the reply body text to a same-origin Host route.
31
- - Supports pause, resume, regeneration, and autoplay-blocked prompts. Automatic playback only triggers for the latest reply newly completed in the current run; opening messages from history does not play them.
32
- - Aggressively cleans speech text before sending it to TTS: URLs, file paths, code blocks, emoji, icons, and control characters are removed, and common Chinese punctuation is converted to ASCII punctuation.
22
+ ## ✨ Features
33
23
 
34
- ## Requirements
24
+ - One-click read-aloud: adds a **Read aloud** button to the conversation action bar (enabled by default).
25
+ - Built-in voices: uses `mimo-v2.5-tts` for smooth, clear audio with streaming playback.
26
+ - Playback speed: adjustable from 0.5× to 2.0× for both MiMo and browser-local speech.
27
+ - Custom voices: uses `mimo-v2.5-tts-voicedesign` to create a voice from a text description.
28
+ - Browser-local voices: uses offline or online voices provided by the browser host.
29
+ - Automatic text cleaning: removes URLs, file paths, code blocks, emoji, icons, and control characters before synthesis.
30
+ - Sound Effects: semantic click sounds plus start, success, failure, and pending sounds for the current task.
35
31
 
36
- - `@deepseek-ai/dsh` `0.1.1-rc.2` or `0.1.2-rc.1` (`V3.0.1` is compatible with both)
37
- - Node.js 22+
38
- - Xiaomi MiMo API Key
39
-
40
- `V3.0.1` supports DSH `0.1.1-rc.2` and `0.1.2-rc.1`; the same packed plugin artifact passes the automated compatibility checks on both versions. The older `V3.0.0` release is recommended only with DSH `0.1.1-rc.2`.
32
+ ## 📋 Requirements
41
33
 
42
- Official Xiaomi MiMo TTS API reference: <https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts>
34
+ - `@deepseek-ai/dsh` `0.1.5-rc.1` (the plugin currently supports this version only)
35
+ - Node.js 22+
36
+ - Xiaomi MiMo API Key
37
+ - [Official TTS API documentation](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
43
38
 
44
- ## Install
39
+ ## 🚀 Install and use
45
40
 
46
- Install from npm:
41
+ - Install from npm **(recommended)**:
47
42
 
48
43
  ```bash
49
44
  dsh plugin --profile web add dsh-xiaomi-tts
50
45
  ```
51
46
 
52
- Install from a local directory:
47
+ - Install from the [DSH plugin marketplace](https://github.com/dsh-market/dsh-market) **(recommended)**:
53
48
 
54
- ```bash
55
- dsh plugin --profile web add ./dsh-plugin-xiaomi-mimo-tts
49
+ Open **Settings → Plugin marketplace**, search for `xiaomi-mimo-tts`, and click **Install**.
50
+
51
+ - Ask DSH or any AI agent to install it for you:
52
+
53
+ ```text
54
+ Install the dsh-xiaomi-tts plugin on this computer's DSH.
55
+ 1. Prefer: dsh plugin --profile web add dsh-xiaomi-tts@latest
56
+ 2. If that fails, try the source repository: https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
56
57
  ```
57
58
 
58
- Install from GitHub:
59
+ - Install from GitHub:
59
60
 
60
61
  ```bash
61
62
  dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
62
63
  ```
63
64
 
64
- After installation, restart `dsh web`, then open **Settings → Plugins → Plugin configuration → Xiaomi MiMo Read Aloud**, enter the API key, and save. The plugin automatically selects the endpoint from the API key prefix: `sk-` uses the standard endpoint and `tp-` uses the Token Plan-compatible endpoint.
65
+ - Install a `.tgz` downloaded from GitHub Releases:
66
+
67
+ ```powershell
68
+ dsh plugin --profile web add "<download-path>/dsh-xiaomi-tts-<version>.tgz"
69
+ ```
70
+
71
+ Release tarballs already contain the built files and do not require `pnpm approve-builds`.
65
72
 
66
- When updating or switching from the local development link to the npm package, stop DSH Web before changing the profile dependencies. This prevents a running Node process from holding the Windows Junction that pnpm needs to replace:
73
+ After installation, restart `dsh web`, then open **Settings → Plugins → Plugin configuration → Xiaomi MiMo Read Aloud** and [get and enter your API Key](https://platform.xiaomimimo.com/console/api-keys). Standard API Keys and Token Plan-specific API Keys are supported.
67
74
 
68
- ```powershell
69
- .\start\dsh-plugin-reinstall.bat 3.0.1
70
- ```
71
-
72
- `3.0.1` is published to npm. The first argument also accepts a complete npm spec; a plain version resolves to the matching `dsh-xiaomi-tts@<version>`. The script strictly stops DSH Web, removes old packages and residual links, installs, checks `dump-config`, starts DSH Web, and runs HTTP/profile validation. If you run the steps manually, keep the same order:
75
+ Click **Save** after changing any setting.
76
+
77
+ ### Sound Effects
78
+
79
+ Below **Broadcast Studio** in the voice settings card, control the master switch, volume, sound pack, click sounds, and task sounds, and preview common cues. Sounds are synthesized with browser Web Audio; no network request or audio file persistence is used.
80
+
81
+ When switching from a local development version to the npm package on Windows, stop DSH Web first and run:
73
82
 
74
83
  ```powershell
75
- .\start\dsh-web-stop.bat
76
- dsh plugin --profile web remove dsh-xiaomi-tts
77
- dsh plugin --profile web add dsh-xiaomi-tts@3.0.1
78
- .\start\dsh-web-start.bat
79
- pnpm profile:check
80
- ```
81
-
82
- These helpers default to the `web` profile at `127.0.0.1:3080`; override them with `DSH_HOME`, `DSH_WEB_HOST`, and `DSH_WEB_PORT`. In development Junction mode, set `DSH_PROFILE_EXPECT_CHECKOUT` before `pnpm profile:check` to also compare the on-disk and served client-bundle SHA256 values.
84
+ .\start\dsh-plugin-reinstall.bat 3.0.3
85
+ ```
83
86
 
84
- ## Configuration
87
+ ## ⚙️ Configuration
85
88
 
86
- Available built-in voices for `mimo-v2.5-tts`:
89
+ **Official built-in voices (`mimo-v2.5-tts`):**
87
90
 
88
91
  - Chinese female: `冰糖`, `茉莉`
89
92
  - Chinese male: `苏打`, `白桦`
90
93
  - English female: `Mia`, `Chloe`
91
94
  - English male: `Milo`, `Dean`
92
95
 
93
- Preset voices default to **PCM (streaming)**. A complete reply starts playing as soon as audio chunks arrive, reducing the wait, but pause and resume are unavailable; a failure before the first chunk falls back to MP3. **MP3 (complete audio)** and **WAV (complete audio)** wait for the whole file and support pause and resume. MP3 is smaller, while WAV preserves lossless audio at a larger size.
96
+ Preset voices use streaming playback to reduce the wait before speech starts.
94
97
 
95
- Custom voice design with `mimo-v2.5-tts-voicedesign`
98
+ **Custom voices (`mimo-v2.5-tts-voicedesign`)**
96
99
 
97
- The plugin provides common voice-description templates. The selector defaults to **Custom**, so users can edit and save the description directly. After switching to another template and back to **Custom**, the previously saved custom content is restored.
100
+
101
+ Common voice-description templates are provided, and you can edit and save the description directly:
98
102
 
99
103
  ```text
100
104
  Young adult woman, bright and approachable voice, clear articulation, moderate pace, gentle and restrained emotional tone.
101
105
  ```
102
106
 
103
- It is recommended to describe age and gender, vocal texture, speaking pace, and emotional baseline, while avoiding scenes or actions. Preset-voice mode still uses the built-in voice configuration.
104
-
105
- **Browser local fallback speech**
107
+ **Browser-local fallback speech**
106
108
 
107
- The browser voice and fallback strategy stay at the bottom of the settings card for both models. MiMo first falls back from the currently selected MiMo model to the browser voice; local first tries the current MiMo model if browser speech fails; disabling local speech uses only MiMo. The picker lists every voice exposed by the browser Web Speech API and labels each one Offline or Online from its `localService` flag. Available online voices depend on the browser, operating system, and network speech services.
108
-
109
- The list orders all offline voices first, followed by online Chinese (`zh-*`), online English (`en-*`), and other online voices. Each browser-speech segment waits for 2 minutes by default; a timeout stops it and falls back to MiMo when the selected strategy permits.
110
-
111
- Browsers may block autoplay. If that happens, click the read-aloud button first.
112
-
113
- ### Speech text preprocessing
114
-
115
- Read-aloud uses only the cleaned reply body and does not modify the assistant message shown in the chat. Markdown links keep their readable labels while their targets are removed; URLs, file paths, complete code blocks, emoji, icons, zero-width characters, and control characters are not sent to Xiaomi MiMo. Parentheses, brackets, book-title marks, quotation marks, and other non-boundary punctuation are removed; retained sentence-boundary punctuation is converted to ASCII. Only preset voices configured for PCM stream partial replies after accumulating at least 20 speakable characters. Completed replies are sent in one PCM/SSE request and play as chunks arrive. MP3 and WAV always request complete audio.
116
-
117
- Complete-audio responses are limited to 32 MiB for MP3 and 128 MiB for WAV by default. Advanced Cordis configuration can override these limits with `maxMp3AudioBytes` and `maxWavAudioBytes`. The Host enforces the response limit before JSON parsing and Base64 decoding.
109
+ Three strategies are available: **MiMo first** falls back to browser speech when MiMo fails; **Local first** prefers browser speech; **Disable local speech** uses MiMo only. Voices come from the browser Web Speech API. Offline availability and the actual voice list depend on the browser, operating system, and network speech services.
110
+
111
+ **Read-aloud range**
112
+
113
+ - **Smart selection**: automatic playback prefers the opening semantic segment, while manual playback reads the full reply. Short replies without a separable segment are read in full.
114
+ - **Full mode**: both automatic and manual playback read the full reply.
115
+ - **First-segment mode**: both automatic and manual playback read only the opening semantic segment.
116
+
117
+ Keyboard support is available in the settings panel: press `Tab` to move between controls, use the arrow keys to adjust sliders or switch options, and press `Space` to confirm the focused control.
118
118
 
119
- ## Third-party plugin integration
119
+ ## 🔌 Third-party plugin integration
120
120
 
121
- Web client plugins can optionally use this plugin's PCM streaming playback capability. The recommended integration is one line at the point where speech is needed:
121
+ This plugin exposes PCM streaming playback for Web plugins. At the point where speech is needed, call:
122
122
 
123
123
  ```ts
124
124
  ctx.get('xiaomiMimoTts')?.play('Welcome back')
125
125
  ```
126
126
 
127
- Do not declare `xiaomiMimoTts` as a required `inject` service, and do not import `dsh-xiaomi-tts` at runtime. `ctx.get()` resolves the capability on every call. If this plugin is not installed, is not ready yet, or is later removed, it returns `undefined` and the third-party plugin remains fully available.
128
-
129
- `play()` returns immediately and is best effort; it never throws to the caller. It always uses `/plugins/xiaomi-mimo-tts/synthesize-stream` with the `mimo-v2.5-tts` PCM16 stream and reuses the API key, built-in voice, base URL, timeout, and text-length limit saved in this plugin. A disabled plugin, settings that are not ready, empty text, missing configuration, network errors, or browser autoplay blocking are silently skipped or logged by this plugin. New third-party speech interrupts current read-aloud playback, and normal read-aloud playback that starts later stops the third-party speech. To stop it explicitly, call `ctx.get('xiaomiMimoTts')?.stop()`.
127
+ Use `ctx.get()` dynamically rather than declaring a required `inject` service. If this plugin is not installed or not ready, the call safely does nothing. `play()` uses the saved MiMo settings for PCM playback, and `stop()` stops it explicitly. New playback interrupts the current read-aloud session.
130
128
 
131
- For TypeScript hints, a third-party project may use a type-only import and declare this package as an optional peer dependency. Neither is required for the one-line call above:
129
+ For TypeScript hints, import the type only:
132
130
 
133
131
  ```ts
134
132
  import type { XiaomiMimoTtsService } from 'dsh-xiaomi-tts/client-api'
@@ -137,93 +135,47 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
137
135
  tts?.play('Welcome back')
138
136
  ```
139
137
 
140
- ```json
141
- {
142
- "peerDependencies": { "dsh-xiaomi-tts": "^3.0.1" },
143
- "peerDependenciesMeta": { "dsh-xiaomi-tts": { "optional": true } }
144
- }
145
- ```
138
+ ## 🔒 Privacy
146
139
 
147
- ## Privacy
140
+ - The API Key is stored on the DSH Host and is not sent to the browser.
141
+ - The reply body is sent to Xiaomi MiMo when speech is generated.
142
+ - Audio is played in browser memory through Web Audio or a temporary Blob URL and is not persisted to disk.
143
+ - The sound core is migrated from [uisfx 0.4.0](https://github.com/romainsimon/uisfx) under the MIT License; see `NOTICE`.
148
144
 
149
- - The API key stays on the DSH Host and is never sent to the browser.
150
- - Reply text is sent to Xiaomi MiMo when speech is generated.
151
- - Audio stays in browser memory and is played through Web Audio or a temporary Blob URL; it is not persisted to disk.
145
+ ## 🏗️ Architecture
152
146
 
153
- ## Feedback and support
147
+ - **Shared layer**: common configuration, text cleaning, segmentation, and SSE contract.
148
+ - **Host plugin**: manages settings and static assets, and proxies complete-audio and PCM streaming requests to MiMo.
149
+ - **Web Client**: provides settings and read-aloud entry points, playback state, browser-speech fallback, and the third-party playback service.
154
150
 
155
- Please use [GitHub Issues](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts/issues) for bug reports, feature requests, or feedback.
151
+ ```mermaid
152
+ flowchart LR
153
+ DSH["DSH Web"] --> CLIENT["Web Client<br/>Settings and playback"]
154
+ THIRD["Third-party Web plugin"] -. "ctx.get('xiaomiMimoTts')" .-> CLIENT
155
+ CLIENT -->|"Complete audio / PCM stream"| HOST["Host plugin<br/>Settings and API proxy"]
156
+ HOST --> MIMO["Xiaomi MiMo API"]
157
+ CLIENT -->|"Browser-local fallback"| SPEECH["Browser Web Speech API"]
158
+ SHARED["Shared layer<br/>Configuration, text processing, SSE"] -.-> CLIENT
159
+ SHARED -.-> HOST
160
+ ```
156
161
 
157
- ## Architecture
162
+ ## 🛠️ Development
158
163
 
159
- - `src/index.ts`: Host entry; registers Schemastery settings, both voice-asset groups, and complete-audio plus PCM/SSE synthesis routes.
160
- - `src/shared.ts`: Shared Host/Client domain contracts, including settings types, defaults, text cleaning, sentence splitting, stream batching, and SSE parsing.
161
- - `src/client-api.ts`: Optional PCM playback Service type contract for third-party Web client plugins.
162
- - `src/client/index.tsx`: Web Client composition entry; binds DSH services, registers slots, injects styles, and owns controller lifecycles.
163
- - `src/client/conversation.tsx`: React conversation adapter; observes DSH conversation snapshots and renders read-aloud actions.
164
- - `src/client/settings-card.tsx`, `built-in-voice-picker.tsx`, and `voice-design-picker.tsx`: Plugin settings form, official built-in voice panel, and Voice Design voice selector UI.
165
- - `src/client/live-speech-controller.ts`, `pcm-audio-queue.ts`, and `playback-controller.ts`: Realtime speech state machine, Web Audio PCM scheduling, and complete-audio playback.
166
- - `src/client/settings-scope.ts`: Connects the DSH Settings Scope to React safely with `useSyncExternalStore`.
164
+ When editing the settings panel, run:
167
165
 
168
- ```mermaid
169
- flowchart TD
170
- DSH["DeepSeek Harness"]
171
-
172
- subgraph Host["Host plugin"]
173
- HI["src/index.ts<br/>Settings and routes"]
174
- SETTINGS["DSH Settings"]
175
- ROUTES["Complete audio / PCM SSE routes"]
176
- ASSETS["Voice assets"]
177
- end
178
-
179
- subgraph Shared["Shared domain layer"]
180
- SH["src/shared.ts<br/>Settings, text processing, sentence splitting, and SSE"]
181
- end
182
-
183
- subgraph Client["Web Client"]
184
- ENTRY["client/index.tsx<br/>Composition entry"]
185
- LOCALE["localization.ts"]
186
- STYLE["styles.ts"]
187
- SCOPE["settings-scope.ts<br/>useSyncExternalStore"]
188
- FORM["settings-card.tsx"]
189
- BUILTIN["built-in-voice-picker.tsx"]
190
- PICKER["voice-design-picker.tsx"]
191
- CONV["conversation.tsx<br/>Conversation observer and read-aloud button"]
192
-
193
- subgraph Audio["Audio runtime"]
194
- LIVE["live-speech-controller.ts<br/>Realtime speech state machine"]
195
- PCM["pcm-audio-queue.ts<br/>Web Audio PCM scheduling"]
196
- COMPLETE["playback-controller.ts<br/>Complete-audio playback"]
197
- end
198
- end
199
-
200
- API["Xiaomi MiMo API"]
201
-
202
- DSH --> HI
203
- DSH --> ENTRY
204
- SH --> HI
205
- SH --> SCOPE
206
- SH --> CONV
207
- SH --> LIVE
208
- HI --> SETTINGS
209
- HI --> ROUTES
210
- HI --> ASSETS
211
- ROUTES --> API
212
- ENTRY --> LOCALE
213
- ENTRY --> STYLE
214
- ENTRY --> SCOPE
215
- ENTRY --> FORM
216
- ENTRY --> CONV
217
- FORM --> BUILTIN
218
- FORM --> PICKER
219
- CONV --> LIVE
220
- CONV --> COMPLETE
221
- LIVE --> PCM
222
- LIVE --> ROUTES
223
- COMPLETE --> ROUTES
166
+ ```bash
167
+ pnpm dev
168
+ ```
169
+
170
+ This opens a local UI preview shell that renders `src/client/settings-card.tsx` directly with hot updates. It uses in-memory settings and local mock APIs, so it does not call MiMo or uninstall the plugin. Run `pnpm dev:build` to check that the preview shell builds independently.
171
+
172
+ Run the settings UI lab while editing the panel:
173
+
174
+ ```bash
175
+ pnpm dev
224
176
  ```
225
177
 
226
- ## Development
178
+ It opens a local Vite shell that renders `src/client/settings-card.tsx` directly with hot updates, so reinstalling the plugin or restarting DSH is unnecessary. The shell uses in-memory settings and local mock endpoints; it does not call the MiMo API or uninstall the plugin. Use `pnpm dev:build` to verify that the shell also builds on its own.
227
179
 
228
180
  ```bash
229
181
  pnpm install
@@ -232,12 +184,10 @@ pnpm test
232
184
  pnpm pack:check
233
185
  ```
234
186
 
235
- Before release, use isolated `DSH_HOME` directories and validate DSH `0.1.1-rc.2` and `0.1.2-rc.1` sequentially with the same packed `V3.0.1` artifact. CI checks both DSH versions for installation, Host composition, the status route, the settings namespace, and client-bundle registration. Browser menus and audio playback remain manual pre-release checks.
236
-
237
- Use `pnpm build` for release output; it does not emit MiMoTTS Host or browser console traces. Use `pnpm build:debug` when diagnosing the PCM streaming path; that build enables the `[MiMoTTS Host]`, `[MiMoTTS Stream]`, `[MiMoTTS Audio]`, and `[MiMoTTS Service]` logs on both sides.
238
-
239
- `lib/` is generated output and is not committed during day-to-day development. Feature commits update source and tests only; when a version is packaged or published, `prepack` regenerates the release output. GitHub installs build it during installation through `prepare`.
187
+ Use `pnpm build` for normal builds and `pnpm build:debug` when diagnosing the PCM streaming path.
240
188
 
241
- ## License
189
+ ## 🤝 Recommended companion plugins
242
190
 
243
- MIT
191
+ - [dsh-whale-musume](https://github.com/Sutera-Diffusus/dsh-whale-musume#readme): energetic whale-girl desktop pet.
192
+ - [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme): semantic UI sound effects.
193
+ - [dsh-dream-skin](https://github.com/RevolutionLA/dsh-dream-skin#readme): native skins, wallpapers, accent colors, and theme packs.