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.
- package/NOTICE +5 -0
- package/README.en.md +108 -158
- package/README.md +90 -114
- package/assets/audio/off02.mp3 +0 -0
- package/assets/audio/off03.mp3 +0 -0
- package/assets/audio/on03.mp3 +0 -0
- package/assets/audio/volume-01.mp3 +0 -0
- package/assets/audio/volume-02.mp3 +0 -0
- package/assets/mimo.svg +27 -0
- package/assets/setting.png +0 -0
- package/assets/social.webp +0 -0
- package/assets/ui/api-key-whale.webp +0 -0
- package/assets/ui/mixer-whale.webp +0 -0
- package/assets/ui/preview-whale.webp +0 -0
- package/assets/ui/sound-effect-cues.webp +0 -0
- package/assets/ui/sound-effects-toggle-characters.webp +0 -0
- package/assets/ui/sound-effects-whale.webp +0 -0
- package/assets/ui/toggle-characters.webp +0 -0
- package/assets/whale-girls.webp +0 -0
- package/cordis.patch.yml +22 -22
- package/lib/client/conversation/read-aloud.d.ts +33 -0
- package/lib/client/conversation/read-aloud.d.ts.map +1 -0
- package/lib/client/host-route.d.ts +2 -0
- package/lib/client/host-route.d.ts.map +1 -0
- package/lib/client/index.d.ts +2 -2
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/localization.d.ts +37 -2
- package/lib/client/localization.d.ts.map +1 -1
- package/lib/client/{playback.d.ts → playback/index.d.ts} +2 -2
- package/lib/client/playback/index.d.ts.map +1 -0
- package/lib/client/{live-speech-controller.d.ts → playback/live-speech-controller.d.ts} +5 -2
- package/lib/client/playback/live-speech-controller.d.ts.map +1 -0
- package/lib/client/{local-speech-controller.d.ts → playback/local-speech-controller.d.ts} +7 -2
- package/lib/client/playback/local-speech-controller.d.ts.map +1 -0
- package/lib/client/{pcm-audio-queue.d.ts → playback/pcm-audio-queue.d.ts} +6 -0
- package/lib/client/playback/pcm-audio-queue.d.ts.map +1 -0
- package/lib/client/{pcm-play-service.d.ts → playback/pcm-play-service.d.ts} +5 -4
- package/lib/client/playback/pcm-play-service.d.ts.map +1 -0
- package/lib/client/{playback-controller.d.ts → playback/playback-controller.d.ts} +6 -2
- package/lib/client/playback/playback-controller.d.ts.map +1 -0
- package/lib/client/{preview-player.d.ts → playback/preview-player.d.ts} +6 -3
- package/lib/client/playback/preview-player.d.ts.map +1 -0
- package/lib/client/{playback-types.d.ts → playback/types.d.ts} +1 -1
- package/lib/client/playback/types.d.ts.map +1 -0
- package/lib/client/playback/voice-rate.d.ts +5 -0
- package/lib/client/playback/voice-rate.d.ts.map +1 -0
- package/lib/client/settings/api-key-module.d.ts +13 -0
- package/lib/client/settings/api-key-module.d.ts.map +1 -0
- package/lib/client/settings/card.d.ts +17 -0
- package/lib/client/settings/card.d.ts.map +1 -0
- package/lib/client/settings/collapsible-module.d.ts +17 -0
- package/lib/client/settings/collapsible-module.d.ts.map +1 -0
- package/lib/client/settings/controls/built-in-voice-picker.d.ts.map +1 -0
- package/lib/client/settings/controls/energy-volume-slider.d.ts +15 -0
- package/lib/client/settings/controls/energy-volume-slider.d.ts.map +1 -0
- package/lib/client/settings/controls/local-voice-picker.d.ts.map +1 -0
- package/lib/client/settings/controls/voice-design-picker.d.ts.map +1 -0
- package/lib/client/settings/details-module.d.ts +43 -0
- package/lib/client/settings/details-module.d.ts.map +1 -0
- package/lib/client/settings/field-heading.d.ts +13 -0
- package/lib/client/settings/field-heading.d.ts.map +1 -0
- package/lib/client/settings/preview-module.d.ts +13 -0
- package/lib/client/settings/preview-module.d.ts.map +1 -0
- package/lib/client/settings/scope.d.ts +6 -0
- package/lib/client/settings/scope.d.ts.map +1 -0
- package/lib/client/settings/sound-effects-module.d.ts +23 -0
- package/lib/client/settings/sound-effects-module.d.ts.map +1 -0
- package/lib/client/settings/switch-module.d.ts +14 -0
- package/lib/client/settings/switch-module.d.ts.map +1 -0
- package/lib/client/settings/types.d.ts +12 -0
- package/lib/client/settings/types.d.ts.map +1 -0
- package/lib/client/sound-effects/click-classifier.d.ts +3 -0
- package/lib/client/sound-effects/click-classifier.d.ts.map +1 -0
- package/lib/client/sound-effects/index.d.ts +6 -0
- package/lib/client/sound-effects/index.d.ts.map +1 -0
- package/lib/client/sound-effects/task-watcher.d.ts +4 -0
- package/lib/client/sound-effects/task-watcher.d.ts.map +1 -0
- package/lib/client/sound-effects/toggle-sound-player.d.ts +20 -0
- package/lib/client/sound-effects/toggle-sound-player.d.ts.map +1 -0
- package/lib/client/sound-effects/types.d.ts +21 -0
- package/lib/client/sound-effects/types.d.ts.map +1 -0
- package/lib/client/style/index.d.ts +2 -0
- package/lib/client/style/index.d.ts.map +1 -0
- package/lib/client.js +3983 -1450
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +19 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +156 -33
- package/lib/pcm-stream.js +1 -1
- package/lib/{shared-BxsP6NKT.js → shared-DJtQ85KH.js} +99 -15
- package/lib/shared.d.ts +65 -11
- package/lib/shared.d.ts.map +1 -1
- package/lib/shared.js +2 -2
- package/package.json +191 -129
- package/scripts/prepare-package.mjs +12 -0
- package/assets/audio/on04.mp3 +0 -0
- package/assets/social.png +0 -0
- package/assets/ui/api-key-whale.png +0 -0
- package/assets/ui/mixer-whale.png +0 -0
- package/assets/ui/preview-whale.png +0 -0
- package/assets/ui/toggle-characters.png +0 -0
- package/lib/client/built-in-voice-picker.d.ts.map +0 -1
- package/lib/client/conversation-state.d.ts +0 -39
- package/lib/client/conversation-state.d.ts.map +0 -1
- package/lib/client/conversation.d.ts +0 -39
- package/lib/client/conversation.d.ts.map +0 -1
- package/lib/client/dsh-compat.d.ts +0 -28
- package/lib/client/dsh-compat.d.ts.map +0 -1
- package/lib/client/live-speech-controller.d.ts.map +0 -1
- package/lib/client/local-speech-controller.d.ts.map +0 -1
- package/lib/client/local-voice-picker.d.ts.map +0 -1
- package/lib/client/pcm-audio-queue.d.ts.map +0 -1
- package/lib/client/pcm-play-service.d.ts.map +0 -1
- package/lib/client/playback-controller.d.ts.map +0 -1
- package/lib/client/playback-types.d.ts.map +0 -1
- package/lib/client/playback.d.ts.map +0 -1
- package/lib/client/preview-player.d.ts.map +0 -1
- package/lib/client/settings-card.d.ts +0 -15
- package/lib/client/settings-card.d.ts.map +0 -1
- package/lib/client/settings-scope.d.ts +0 -6
- package/lib/client/settings-scope.d.ts.map +0 -1
- package/lib/client/styles.d.ts +0 -2
- package/lib/client/styles.d.ts.map +0 -1
- package/lib/client/toggle-sound-player.d.ts +0 -13
- package/lib/client/toggle-sound-player.d.ts.map +0 -1
- package/lib/client/voice-design-picker.d.ts.map +0 -1
- package/lib/conversation-state.js +0 -25
- package/lib/settings-compat-B_MTrCCL.js +0 -18
- package/lib/settings-compat.d.ts +0 -16
- package/lib/settings-compat.d.ts.map +0 -1
- package/lib/settings-compat.js +0 -3
- /package/lib/client/{built-in-voice-picker.d.ts → settings/controls/built-in-voice-picker.d.ts} +0 -0
- /package/lib/client/{local-voice-picker.d.ts → settings/controls/local-voice-picker.d.ts} +0 -0
- /package/lib/client/{voice-design-picker.d.ts → settings/controls/voice-design-picker.d.ts} +0 -0
package/NOTICE
ADDED
package/README.en.md
CHANGED
|
@@ -5,130 +5,128 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-xiaomi-tts)
|
|
6
6
|
[](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts)
|
|
7
7
|
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-

|
|
12
|
+
<p><a href="README.md"><strong>中文说明 →</strong></a></p>
|
|
19
13
|
|
|
20
|
-
|
|
14
|
+
## 🎨 Preview
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
| Preset voices | Custom voices |
|
|
17
|
+
|:---:|:---:|
|
|
18
|
+
|  |  |
|
|
19
|
+
| Settings | UI example |
|
|
20
|
+
|  |  |
|
|
23
21
|
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
47
|
+
- Install from the [DSH plugin marketplace](https://github.com/dsh-market/dsh-market) **(recommended)**:
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
|
96
|
+
Preset voices use streaming playback to reduce the wait before speech starts.
|
|
94
97
|
|
|
95
|
-
Custom
|
|
98
|
+
**Custom voices (`mimo-v2.5-tts-voicedesign`)**
|
|
96
99
|
|
|
97
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
**Browser local fallback speech**
|
|
107
|
+
**Browser-local fallback speech**
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
141
|
-
{
|
|
142
|
-
"peerDependencies": { "dsh-xiaomi-tts": "^3.0.1" },
|
|
143
|
-
"peerDependenciesMeta": { "dsh-xiaomi-tts": { "optional": true } }
|
|
144
|
-
}
|
|
145
|
-
```
|
|
138
|
+
## 🔒 Privacy
|
|
146
139
|
|
|
147
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
162
|
+
## 🛠️ Development
|
|
158
163
|
|
|
159
|
-
|
|
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
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
189
|
+
## 🤝 Recommended companion plugins
|
|
242
190
|
|
|
243
|
-
|
|
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.
|