dsh-xiaomi-tts 3.0.1-alpha → 3.0.2

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 (131) hide show
  1. package/NOTICE +5 -0
  2. package/README.en.md +100 -159
  3. package/README.md +82 -112
  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-whale.webp +0 -0
  17. package/assets/ui/toggle-characters.webp +0 -0
  18. package/assets/whale-girls.webp +0 -0
  19. package/cordis.patch.yml +22 -22
  20. package/lib/client/conversation/read-aloud.d.ts +33 -0
  21. package/lib/client/conversation/read-aloud.d.ts.map +1 -0
  22. package/lib/client/host-route.d.ts +2 -0
  23. package/lib/client/host-route.d.ts.map +1 -0
  24. package/lib/client/index.d.ts +2 -2
  25. package/lib/client/index.d.ts.map +1 -1
  26. package/lib/client/localization.d.ts +47 -6
  27. package/lib/client/localization.d.ts.map +1 -1
  28. package/lib/client/{playback.d.ts → playback/index.d.ts} +2 -2
  29. package/lib/client/playback/index.d.ts.map +1 -0
  30. package/lib/client/{live-speech-controller.d.ts → playback/live-speech-controller.d.ts} +3 -2
  31. package/lib/client/playback/live-speech-controller.d.ts.map +1 -0
  32. package/lib/client/{local-speech-controller.d.ts → playback/local-speech-controller.d.ts} +4 -2
  33. package/lib/client/playback/local-speech-controller.d.ts.map +1 -0
  34. package/lib/client/{pcm-audio-queue.d.ts → playback/pcm-audio-queue.d.ts} +4 -0
  35. package/lib/client/playback/pcm-audio-queue.d.ts.map +1 -0
  36. package/lib/client/{pcm-play-service.d.ts → playback/pcm-play-service.d.ts} +5 -4
  37. package/lib/client/playback/pcm-play-service.d.ts.map +1 -0
  38. package/lib/client/{playback-controller.d.ts → playback/playback-controller.d.ts} +3 -1
  39. package/lib/client/playback/playback-controller.d.ts.map +1 -0
  40. package/lib/client/{preview-player.d.ts → playback/preview-player.d.ts} +4 -1
  41. package/lib/client/playback/preview-player.d.ts.map +1 -0
  42. package/lib/client/{playback-types.d.ts → playback/types.d.ts} +1 -1
  43. package/lib/client/playback/types.d.ts.map +1 -0
  44. package/lib/client/settings/api-key-module.d.ts +13 -0
  45. package/lib/client/settings/api-key-module.d.ts.map +1 -0
  46. package/lib/client/settings/card.d.ts +17 -0
  47. package/lib/client/settings/card.d.ts.map +1 -0
  48. package/lib/client/settings/collapsible-module.d.ts +17 -0
  49. package/lib/client/settings/collapsible-module.d.ts.map +1 -0
  50. package/lib/client/settings/controls/built-in-voice-picker.d.ts.map +1 -0
  51. package/lib/client/settings/controls/energy-volume-slider.d.ts +11 -0
  52. package/lib/client/settings/controls/energy-volume-slider.d.ts.map +1 -0
  53. package/lib/client/settings/controls/local-voice-picker.d.ts.map +1 -0
  54. package/lib/client/settings/controls/voice-design-picker.d.ts.map +1 -0
  55. package/lib/client/settings/details-module.d.ts +42 -0
  56. package/lib/client/settings/details-module.d.ts.map +1 -0
  57. package/lib/client/settings/field-heading.d.ts +13 -0
  58. package/lib/client/settings/field-heading.d.ts.map +1 -0
  59. package/lib/client/settings/preview-module.d.ts +13 -0
  60. package/lib/client/settings/preview-module.d.ts.map +1 -0
  61. package/lib/client/settings/scope.d.ts +6 -0
  62. package/lib/client/settings/scope.d.ts.map +1 -0
  63. package/lib/client/settings/sound-effects-module.d.ts +23 -0
  64. package/lib/client/settings/sound-effects-module.d.ts.map +1 -0
  65. package/lib/client/settings/switch-module.d.ts +12 -0
  66. package/lib/client/settings/switch-module.d.ts.map +1 -0
  67. package/lib/client/settings/types.d.ts +12 -0
  68. package/lib/client/settings/types.d.ts.map +1 -0
  69. package/lib/client/sound-effects/click-classifier.d.ts +3 -0
  70. package/lib/client/sound-effects/click-classifier.d.ts.map +1 -0
  71. package/lib/client/sound-effects/index.d.ts +6 -0
  72. package/lib/client/sound-effects/index.d.ts.map +1 -0
  73. package/lib/client/sound-effects/task-watcher.d.ts +4 -0
  74. package/lib/client/sound-effects/task-watcher.d.ts.map +1 -0
  75. package/lib/client/sound-effects/toggle-sound-player.d.ts +20 -0
  76. package/lib/client/sound-effects/toggle-sound-player.d.ts.map +1 -0
  77. package/lib/client/sound-effects/types.d.ts +18 -0
  78. package/lib/client/sound-effects/types.d.ts.map +1 -0
  79. package/lib/client/style/index.d.ts +2 -0
  80. package/lib/client/style/index.d.ts.map +1 -0
  81. package/lib/client.js +3752 -1391
  82. package/lib/client.js.map +1 -1
  83. package/lib/index.d.ts +15 -3
  84. package/lib/index.d.ts.map +1 -1
  85. package/lib/index.js +198 -19
  86. package/lib/pcm-stream.js +1 -1
  87. package/lib/{shared-BfEte3bu.js → shared-DDS4h0Vc.js} +63 -11
  88. package/lib/shared.d.ts +49 -7
  89. package/lib/shared.d.ts.map +1 -1
  90. package/lib/shared.js +2 -2
  91. package/package.json +69 -35
  92. package/scripts/prepare-package.mjs +12 -0
  93. package/assets/audio/on04.mp3 +0 -0
  94. package/assets/social.png +0 -0
  95. package/assets/ui/api-key-whale.png +0 -0
  96. package/assets/ui/mixer-whale.png +0 -0
  97. package/assets/ui/preview-whale.png +0 -0
  98. package/assets/ui/toggle-characters.png +0 -0
  99. package/lib/client/built-in-voice-picker.d.ts.map +0 -1
  100. package/lib/client/conversation-state.d.ts +0 -39
  101. package/lib/client/conversation-state.d.ts.map +0 -1
  102. package/lib/client/conversation.d.ts +0 -39
  103. package/lib/client/conversation.d.ts.map +0 -1
  104. package/lib/client/dsh-compat.d.ts +0 -28
  105. package/lib/client/dsh-compat.d.ts.map +0 -1
  106. package/lib/client/live-speech-controller.d.ts.map +0 -1
  107. package/lib/client/local-speech-controller.d.ts.map +0 -1
  108. package/lib/client/local-voice-picker.d.ts.map +0 -1
  109. package/lib/client/pcm-audio-queue.d.ts.map +0 -1
  110. package/lib/client/pcm-play-service.d.ts.map +0 -1
  111. package/lib/client/playback-controller.d.ts.map +0 -1
  112. package/lib/client/playback-types.d.ts.map +0 -1
  113. package/lib/client/playback.d.ts.map +0 -1
  114. package/lib/client/preview-player.d.ts.map +0 -1
  115. package/lib/client/settings-card.d.ts +0 -11
  116. package/lib/client/settings-card.d.ts.map +0 -1
  117. package/lib/client/settings-scope.d.ts +0 -6
  118. package/lib/client/settings-scope.d.ts.map +0 -1
  119. package/lib/client/styles.d.ts +0 -2
  120. package/lib/client/styles.d.ts.map +0 -1
  121. package/lib/client/toggle-sound-player.d.ts +0 -13
  122. package/lib/client/toggle-sound-player.d.ts.map +0 -1
  123. package/lib/client/voice-design-picker.d.ts.map +0 -1
  124. package/lib/conversation-state.js +0 -25
  125. package/lib/settings-compat-B_MTrCCL.js +0 -18
  126. package/lib/settings-compat.d.ts +0 -16
  127. package/lib/settings-compat.d.ts.map +0 -1
  128. package/lib/settings-compat.js +0 -3
  129. /package/lib/client/{built-in-voice-picker.d.ts → settings/controls/built-in-voice-picker.d.ts} +0 -0
  130. /package/lib/client/{local-voice-picker.d.ts → settings/controls/local-voice-picker.d.ts} +0 -0
  131. /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,131 +5,120 @@
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 PCM streaming playback.
26
+ - Custom voices: uses `mimo-v2.5-tts-voicedesign` to create a voice from a text description.
27
+ - Browser-local voices: uses offline or online voices provided by the browser host.
28
+ - Automatic text cleaning: removes URLs, file paths, code blocks, emoji, icons, and control characters before synthesis.
29
+ - Sound Effects: semantic click sounds plus start, success, failure, and pending sounds for the current task.
35
30
 
36
- - `@deepseek-ai/dsh` `0.1.2-rc.1` (the verified host for `V3.0.1-alpha`)
37
- - Node.js 22+
38
- - Xiaomi MiMo API Key
39
-
40
- Verified reliable combinations: `V3.0.0` + `0.1.1-rc.2`, and `V3.0.1-alpha` + `0.1.2-rc.1`. `V3.0.0` cannot show or play the read-aloud button on `0.1.2-rc.1`; `V3.0.1-alpha` cannot show the settings menu on `0.1.1-rc.2`. Do not mix these combinations.
31
+ ## 📋 Requirements
41
32
 
42
- Official Xiaomi MiMo TTS API reference: <https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts>
33
+ - `@deepseek-ai/dsh` `0.1.5-rc.1` (the plugin currently supports this version only)
34
+ - Node.js 22+
35
+ - Xiaomi MiMo API Key
36
+ - [Official TTS API documentation](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
43
37
 
44
- ## Install
38
+ ## 🚀 Install and use
45
39
 
46
- Install from npm:
40
+ - Install from npm **(recommended)**:
47
41
 
48
42
  ```bash
49
43
  dsh plugin --profile web add dsh-xiaomi-tts
50
44
  ```
51
45
 
52
- Install from a local directory:
46
+ - Install from the [DSH plugin marketplace](https://github.com/dsh-market/dsh-market) **(recommended)**:
53
47
 
54
- ```bash
55
- dsh plugin --profile web add ./dsh-plugin-xiaomi-mimo-tts
48
+ Open **Settings → Plugin marketplace**, search for `xiaomi-mimo-tts`, and click **Install**.
49
+
50
+ - Ask DSH or any AI agent to install it for you:
51
+
52
+ ```text
53
+ Install the dsh-xiaomi-tts plugin on this computer's DSH.
54
+ 1. Prefer: dsh plugin --profile web add dsh-xiaomi-tts@latest
55
+ 2. If that fails, try the source repository: https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
56
56
  ```
57
57
 
58
- Install from GitHub:
58
+ - Install from GitHub:
59
59
 
60
60
  ```bash
61
61
  dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
62
62
  ```
63
63
 
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.
64
+ - Install a `.tgz` downloaded from GitHub Releases:
65
65
 
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:
66
+ ```powershell
67
+ dsh plugin --profile web add "<download-path>/dsh-xiaomi-tts-<version>.tgz"
68
+ ```
69
+
70
+ Release tarballs already contain the built files and do not require `pnpm approve-builds`.
71
+
72
+ 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.
73
+
74
+ Click **Save** after changing any setting.
75
+
76
+ ### Sound Effects
67
77
 
68
- ```powershell
69
- pnpm pack
70
- .\start\dsh-plugin-reinstall.bat .\dsh-xiaomi-tts-3.0.1-alpha.tgz
71
- ```
72
-
73
- `3.0.1-alpha` is not published to npm yet, so validate it from the local tarball. The first argument also accepts a complete npm spec; a plain version such as `3.0.0` remains shorthand for `dsh-xiaomi-tts@3.0.0`. 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:
78
+ 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.
79
+
80
+ When switching from a local development version to the npm package on Windows, stop DSH Web first and run:
74
81
 
75
82
  ```powershell
76
- .\start\dsh-web-stop.bat
77
- dsh plugin --profile web remove dsh-xiaomi-tts
78
- dsh plugin --profile web add .\dsh-xiaomi-tts-3.0.1-alpha.tgz
79
- .\start\dsh-web-start.bat
80
- pnpm profile:check
81
- ```
82
-
83
- 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.
83
+ .\start\dsh-plugin-reinstall.bat 3.0.2
84
+ ```
84
85
 
85
- ## Configuration
86
+ ## ⚙️ Configuration
86
87
 
87
- Available built-in voices for `mimo-v2.5-tts`:
88
+ **Official built-in voices (`mimo-v2.5-tts`):**
88
89
 
89
90
  - Chinese female: `冰糖`, `茉莉`
90
91
  - Chinese male: `苏打`, `白桦`
91
92
  - English female: `Mia`, `Chloe`
92
93
  - English male: `Milo`, `Dean`
93
94
 
94
- 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.
95
+ Preset voices default to **PCM (streaming)**. Playback starts as audio chunks arrive, reducing wait time. **MP3 (complete audio)** and **WAV (complete audio)** wait for the complete file; MP3 is smaller, while WAV preserves lossless audio at a larger size.
95
96
 
96
- Custom voice design with `mimo-v2.5-tts-voicedesign`
97
+ **Custom voices (`mimo-v2.5-tts-voicedesign`)**
97
98
 
98
- 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.
99
+ Voice Design currently does not support PCM. It will be adapted when Xiaomi officially enables it.
100
+
101
+ Common voice-description templates are provided, and you can edit and save the description directly:
99
102
 
100
103
  ```text
101
104
  Young adult woman, bright and approachable voice, clear articulation, moderate pace, gentle and restrained emotional tone.
102
105
  ```
103
106
 
104
- 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.
105
-
106
- **Browser local fallback speech**
107
+ **Browser-local fallback speech**
107
108
 
108
- 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.
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.
109
110
 
110
- 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.
111
+ ## 🔌 Third-party plugin integration
111
112
 
112
- Browsers may block autoplay. If that happens, click the read-aloud button first.
113
-
114
- ### Speech text preprocessing
115
-
116
- 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.
117
-
118
- 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.
119
-
120
- ## Third-party plugin integration
121
-
122
- 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:
113
+ This plugin exposes PCM streaming playback for Web plugins. At the point where speech is needed, call:
123
114
 
124
115
  ```ts
125
116
  ctx.get('xiaomiMimoTts')?.play('Welcome back')
126
117
  ```
127
118
 
128
- 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.
119
+ 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.
129
120
 
130
- `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()`.
131
-
132
- 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:
121
+ For TypeScript hints, import the type only:
133
122
 
134
123
  ```ts
135
124
  import type { XiaomiMimoTtsService } from 'dsh-xiaomi-tts/client-api'
@@ -138,93 +127,47 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
138
127
  tts?.play('Welcome back')
139
128
  ```
140
129
 
141
- ```json
142
- {
143
- "peerDependencies": { "dsh-xiaomi-tts": "^3.0.1-alpha" },
144
- "peerDependenciesMeta": { "dsh-xiaomi-tts": { "optional": true } }
145
- }
146
- ```
130
+ ## 🔒 Privacy
131
+
132
+ - The API Key is stored on the DSH Host and is not sent to the browser.
133
+ - The reply body is sent to Xiaomi MiMo when speech is generated.
134
+ - Audio is played in browser memory through Web Audio or a temporary Blob URL and is not persisted to disk.
135
+ - The sound core is migrated from [uisfx 0.4.0](https://github.com/romainsimon/uisfx) under the MIT License; see `NOTICE`.
136
+
137
+ ## 🏗️ Architecture
147
138
 
148
- ## Privacy
139
+ - **Shared layer**: common configuration, text cleaning, segmentation, and SSE contract.
140
+ - **Host plugin**: manages settings and static assets, and proxies complete-audio and PCM streaming requests to MiMo.
141
+ - **Web Client**: provides settings and read-aloud entry points, playback state, browser-speech fallback, and the third-party playback service.
149
142
 
150
- - The API key stays on the DSH Host and is never sent to the browser.
151
- - Reply text is sent to Xiaomi MiMo when speech is generated.
152
- - Audio stays in browser memory and is played through Web Audio or a temporary Blob URL; it is not persisted to disk.
143
+ ```mermaid
144
+ flowchart LR
145
+ DSH["DSH Web"] --> CLIENT["Web Client<br/>Settings and playback"]
146
+ THIRD["Third-party Web plugin"] -. "ctx.get('xiaomiMimoTts')" .-> CLIENT
147
+ CLIENT -->|"Complete audio / PCM stream"| HOST["Host plugin<br/>Settings and API proxy"]
148
+ HOST --> MIMO["Xiaomi MiMo API"]
149
+ CLIENT -->|"Browser-local fallback"| SPEECH["Browser Web Speech API"]
150
+ SHARED["Shared layer<br/>Configuration, text processing, SSE"] -.-> CLIENT
151
+ SHARED -.-> HOST
152
+ ```
153
153
 
154
- ## Feedback and support
154
+ ## 🛠️ Development
155
155
 
156
- Please use [GitHub Issues](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts/issues) for bug reports, feature requests, or feedback.
156
+ When editing the settings panel, run:
157
157
 
158
- ## Architecture
158
+ ```bash
159
+ pnpm dev
160
+ ```
159
161
 
160
- - `src/index.ts`: Host entry; registers Schemastery settings, both voice-asset groups, and complete-audio plus PCM/SSE synthesis routes.
161
- - `src/shared.ts`: Shared Host/Client domain contracts, including settings types, defaults, text cleaning, sentence splitting, stream batching, and SSE parsing.
162
- - `src/client-api.ts`: Optional PCM playback Service type contract for third-party Web client plugins.
163
- - `src/client/index.tsx`: Web Client composition entry; binds DSH services, registers slots, injects styles, and owns controller lifecycles.
164
- - `src/client/conversation.tsx`: React conversation adapter; observes DSH conversation snapshots and renders read-aloud actions.
165
- - `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.
166
- - `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.
167
- - `src/client/settings-scope.ts`: Connects the DSH Settings Scope to React safely with `useSyncExternalStore`.
162
+ 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.
168
163
 
169
- ```mermaid
170
- flowchart TD
171
- DSH["DeepSeek Harness"]
172
-
173
- subgraph Host["Host plugin"]
174
- HI["src/index.ts<br/>Settings and routes"]
175
- SETTINGS["DSH Settings"]
176
- ROUTES["Complete audio / PCM SSE routes"]
177
- ASSETS["Voice assets"]
178
- end
179
-
180
- subgraph Shared["Shared domain layer"]
181
- SH["src/shared.ts<br/>Settings, text processing, sentence splitting, and SSE"]
182
- end
183
-
184
- subgraph Client["Web Client"]
185
- ENTRY["client/index.tsx<br/>Composition entry"]
186
- LOCALE["localization.ts"]
187
- STYLE["styles.ts"]
188
- SCOPE["settings-scope.ts<br/>useSyncExternalStore"]
189
- FORM["settings-card.tsx"]
190
- BUILTIN["built-in-voice-picker.tsx"]
191
- PICKER["voice-design-picker.tsx"]
192
- CONV["conversation.tsx<br/>Conversation observer and read-aloud button"]
193
-
194
- subgraph Audio["Audio runtime"]
195
- LIVE["live-speech-controller.ts<br/>Realtime speech state machine"]
196
- PCM["pcm-audio-queue.ts<br/>Web Audio PCM scheduling"]
197
- COMPLETE["playback-controller.ts<br/>Complete-audio playback"]
198
- end
199
- end
200
-
201
- API["Xiaomi MiMo API"]
202
-
203
- DSH --> HI
204
- DSH --> ENTRY
205
- SH --> HI
206
- SH --> SCOPE
207
- SH --> CONV
208
- SH --> LIVE
209
- HI --> SETTINGS
210
- HI --> ROUTES
211
- HI --> ASSETS
212
- ROUTES --> API
213
- ENTRY --> LOCALE
214
- ENTRY --> STYLE
215
- ENTRY --> SCOPE
216
- ENTRY --> FORM
217
- ENTRY --> CONV
218
- FORM --> BUILTIN
219
- FORM --> PICKER
220
- CONV --> LIVE
221
- CONV --> COMPLETE
222
- LIVE --> PCM
223
- LIVE --> ROUTES
224
- COMPLETE --> ROUTES
164
+ Run the settings UI lab while editing the panel:
165
+
166
+ ```bash
167
+ pnpm dev
225
168
  ```
226
169
 
227
- ## Development
170
+ 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.
228
171
 
229
172
  ```bash
230
173
  pnpm install
@@ -233,12 +176,10 @@ pnpm test
233
176
  pnpm pack:check
234
177
  ```
235
178
 
236
- Before release, use isolated `DSH_HOME` directories and validate the reliable combinations: `V3.0.0` + `0.1.1-rc.2`, and `V3.0.1-alpha` + `0.1.2-rc.1`. CI uses one packed artifact and sequentially 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.
237
-
238
- 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.
239
-
240
- `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`.
179
+ Use `pnpm build` for normal builds and `pnpm build:debug` when diagnosing the PCM streaming path.
241
180
 
242
- ## License
181
+ ## 🤝 Recommended companion plugins
243
182
 
244
- MIT
183
+ - [dsh-whale-musume](https://github.com/Sutera-Diffusus/dsh-whale-musume#readme): energetic whale-girl desktop pet.
184
+ - [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme): semantic UI sound effects.
185
+ - [dsh-dream-skin](https://github.com/RevolutionLA/dsh-dream-skin#readme): native skins, wallpapers, accent colors, and theme packs.
package/README.md CHANGED
@@ -1,153 +1,122 @@
1
- ![social](assets/social.png)
1
+ ![social](assets/social.webp)
2
2
 
3
3
  # dsh-xiaomi-tts
4
4
 
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
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-xiaomi-tts.svg)](https://www.npmjs.com/package/dsh-xiaomi-tts)
8
+ [![dsh](https://img.shields.io/badge/dsh-0.1.5--rc.1-2563eb)](https://github.com/deepseek-ai)
9
+ ![Xiaomi MiMo](https://img.shields.io/badge/Xiaomi-Mimo?logo=xiaomi&logoColor=%23ff6900&label=power%20by&color=%23ff6900&link=https%3A%2F%2Fmimo.mi.com%2F)
7
10
 
8
- 为 DeepSeek Harness Web 的助手回复添加 Xiaomi MiMo TTS 语音朗读。
11
+ 为 DSH Web 添加 Xiaomi MiMo TTS 语音朗读。
9
12
 
10
- > 基于 Xiaomi MiMo TTS 大模型,将助手回复转为流畅、清晰的自然语音。MiMo TTS 当前为限时免费服务,具体政策以 Xiaomi MiMo 平台为准。
13
+ > 基于 Xiaomi MiMo TTS,将文字转为流畅、清晰的自然语音。MiMo TTS 当前为限时免费服务,具体政策请关注官方平台。
11
14
 
12
15
  <p><a href="README.en.md"><strong>English README →</strong></a></p>
13
16
 
14
- ## 目录
15
-
16
- - [预览](#预览)
17
- - [功能](#功能)
18
- - [环境要求](#环境要求)
19
- - [安装与使用](#安装与使用)
20
- - [配置](#配置)
21
- - [朗读文本处理](#朗读文本处理)
22
- - [三方插件联动](#三方插件联动)
23
- - [隐私](#隐私)
24
- - [反馈与支持](#反馈与支持)
25
- - [架构](#架构)
26
- - [开发](#开发)
27
- - [推荐插件](#推荐插件)
28
- - [许可证](#许可证)
29
-
30
- ## 预览
31
- | 预置音色 | 自定义音色 |
32
- |:---:|:---:|
33
- | ![Xiaomi MiMo 设置菜单](assets/menu.png) | ![自定义音色](assets/preset.png) |
17
+ ## 🎨 预览
18
+
19
+ > [🧐 Preview Pages 预览本插件](https://ppy-web.github.io/dsh-plugin-xiaomi-mimo-tts)
20
+
34
21
  | 设置界面 | UI示例 |
22
+ |:---:|:---:|
35
23
  | ![UI](assets/setting.png) | ![UI](assets/image.png) |
36
24
 
37
- ## 功能
38
-
39
- - 在对话操作栏中显示“朗读”按钮(默认开启)。
40
- - 使用 `mimo-v2.5-tts` 输出流畅、清晰的音频;可选择 PCM 流式播放或 MP3/WAV 完整音频。
41
- - 使用 `mimo-v2.5-tts-voicedesign` 通过文字描述创造你想要的声音。
42
- - 两种 MiMo 模型都支持浏览器语音双向兜底,使用浏览器提供的离线或在线音色,并支持“MiMo 优先 / 本地优先 / 关闭本地语音”三种策略。
43
- - 支持切换预置音色/自定义音色模型,配置 API Key、自动播报、音色、音频格式和音色描述。
44
- - 丰富的自定义音色模板,自由切换和修改。
45
- - 自动清洗需要朗读的文本:移除网址、文件路径、代码块、表情符号、图标和控制字符等。
25
+ ## ✨ 功能
46
26
 
47
- ## 环境要求
27
+ - 一键播报:在对话操作栏中显示“朗读”按钮(默认开启)。
28
+ - 内置音色:使用 `mimo-v2.5-tts` 输出流畅、清晰的音频;支持 PCM 流式播放。
29
+ - 自定义音色:使用 `mimo-v2.5-tts-voicedesign` 通过文字描述创造你想要的声音。
30
+ - 浏览器本地音色:使用浏览器宿主提供的离线或在线音色。
31
+ - 自动清洗文本:移除网址、文件路径、代码块、表情符号、图标和控制字符等。
32
+ - 音效库:提供全局语义点击音效,以及当前任务开始、成功、失败和待处理提醒音效。
48
33
 
49
- - `@deepseek-ai/dsh` `0.1.2-rc.1`(与插件 `V3.0.1-alpha` 配套)
50
- - Node.js 22+
51
- - Xiaomi MiMo API Key
52
-
53
- 已验证的可靠组合:`V3.0.0` + `0.1.1-rc.2`;`V3.0.1-alpha` + `0.1.2-rc.1`。`V3.0.0` 在 `0.1.2-rc.1` 下无法显示播放按钮或播放,`V3.0.1-alpha` 在 `0.1.1-rc.2` 下无法显示设置菜单,因此不要交叉组合。
34
+ ## 📋 环境要求
54
35
 
55
- 官方 TTS API 文档:<https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts>
36
+ - `@deepseek-ai/dsh` `0.1.5-rc.1`(当前插件仅适配此版本)
37
+ - Node.js 22+
38
+ - Xiaomi MiMo API Key
39
+ - [官方 TTS API 文档](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
56
40
 
57
- ## 安装与使用
41
+ ## 🚀 安装与使用
58
42
 
59
- 从 [DSH 插件市场](https://github.com/dsh-market/dsh-market) 安装 **(推荐)**:
43
+ - 从 npm 安装 **(推荐)**:
60
44
 
61
- 1. 尚未安装插件市场时,先执行以下命令并重启 `dsh web`:
45
+ ```bash
46
+ dsh plugin --profile web add dsh-xiaomi-tts
47
+ ```
62
48
 
63
- ```bash
64
- dsh plugin --profile web add dshmarket
65
- ```
49
+ - 从 [DSH 插件市场](https://github.com/dsh-market/dsh-market) 安装 **(推荐)**:
66
50
 
67
- 2. 打开 **设置 → 插件市场**,搜索 `dsh-xiaomi-tts` 并点击安装。
51
+ 打开 **设置 → 插件市场**,搜索 `xiaomi-mimo-tts` 并点击安装。
68
52
 
69
- 从 npm 安装 **(推荐)**:
53
+ - 让 DSH 或 任意AI Agent 帮你装——把下面这段提示词发给AI
70
54
 
71
- ```bash
72
- dsh plugin --profile web add dsh-xiaomi-tts
55
+ ```text
56
+ 帮我给此电脑上的dsh安装 dsh-xiaomi-tts 插件。
57
+ 1. 优先通过命令安装 dsh plugin --profile web add dsh-xiaomi-tts@latest
58
+ 2. 如果失败,请尝试源码 https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
73
59
  ```
74
60
 
75
- 从本地目录安装:
61
+ - 从 GitHub 安装:
76
62
 
77
63
  ```bash
78
- dsh plugin --profile web add ./dsh-plugin-xiaomi-mimo-tts
64
+ dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
79
65
  ```
80
66
 
81
- 从 GitHub 安装:
67
+ - 从 GitHub Release 下载 `.tgz` 后安装:
82
68
 
83
- ```bash
84
- dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
69
+ ```powershell
70
+ dsh plugin --profile web add "<下载路径>\dsh-xiaomi-tts-<版本>.tgz"
85
71
  ```
86
72
 
87
- 安装后重启 `dsh web`,打开 **设置 → 插件 → 插件配置 → 语音朗读(Xiaomi MiMo)**,[获取并填写 API Key](https://platform.xiaomimimo.com/console/api-keys) 。插件会根据 API Key 前缀自动选择服务端点:`sk-` 使用标准端点,`tp-` 使用 Token Plan 兼容端点,无需额外配置。
73
+ Release tgz 已包含构建产物,无需执行 `pnpm approve-builds`。
88
74
 
89
- 点击 **保存** 即可愉快滴使用啦
75
+ 安装后重启 `dsh web`,打开 **设置 → 插件 → 插件配置 → 语音朗读(Xiaomi MiMo)**
76
+ [获取并填写 API Key](https://platform.xiaomimimo.com/console/api-keys) 。支持标准API Key / Token Plan 专属 API key
90
77
 
91
- > 更新或从本地开发版切换到 npm 版时,必须先停止 DSH Web,避免 Windows Junction 被运行中的 Node 进程占用:
78
+ 修改任意设置后需要点击 **保存** 生效。
92
79
 
93
- ```powershell
94
- pnpm pack
95
- .\start\dsh-plugin-reinstall.bat .\dsh-xiaomi-tts-3.0.1-alpha.tgz
96
- ```
97
-
98
- `3.0.1-alpha` 尚未发布到 npm,验证该版本必须使用本地 tarball。脚本第一参数也接受完整 npm spec;纯版本号(例如 `3.0.0`)会继续解析为 `dsh-xiaomi-tts@3.0.0`。脚本会严格执行停止、清理旧包/残留链接、安装、`dump-config`、启动及 HTTP/profile 校验。若手动操作,请保持相同顺序:
80
+ ### 音效间
99
81
 
100
- ```powershell
101
- .\start\dsh-web-stop.bat
102
- dsh plugin --profile web remove dsh-xiaomi-tts
103
- dsh plugin --profile web add .\dsh-xiaomi-tts-3.0.1-alpha.tgz
104
- .\start\dsh-web-start.bat
105
- pnpm profile:check
106
- ```
107
-
108
- 这些辅助脚本默认使用 `web` profile、`127.0.0.1:3080`;可用 `DSH_HOME`、`DSH_WEB_HOST` 和 `DSH_WEB_PORT` 覆盖。开发 Junction 模式下,设置 `DSH_PROFILE_EXPECT_CHECKOUT` 后运行 `pnpm profile:check`,还会核对磁盘和服务端客户端 bundle 的 SHA256。
82
+ 在语音设置卡的 **演播厅** 下方,可以控制音效开关、音量、音色包、点击音效和任务音效,并试听常用提示音。音效由浏览器 Web Audio 合成,不会请求网络或保存音频文件。
109
83
 
110
- ## 配置
84
+ ## ⚙️ 配置
111
85
 
112
- **内置音色(`mimo-v2.5-tts`)**:
86
+ **官方内置音色(`mimo-v2.5-tts`)**:
113
87
 
114
88
  - 中文女声:`冰糖`、`茉莉`
115
89
  - 中文男声:`苏打`、`白桦`
116
90
  - 英文女声:`Mia`、`Chloe`
117
91
  - 英文男声:`Milo`、`Dean`
118
92
 
119
- 预置模型默认选择 `PCM(流式播放)`:完整回复会在音频分片到达时立即开始播放,等待更短,但暂不支持暂停和续播;首个分片前失败时会回退 MP3。选择 `MP3(完整音频)` 或 `WAV(完整音频)` 时,会等待完整文件生成后播放,并支持暂停和继续;MP3 体积更小,WAV 保留无损音频但体积更大。
93
+ 预置模型默认选择 `PCM(流式播放)`:会在音频分片到达时立即开始播放,等待时间更短。
94
+ 选择 `MP3(完整音频)` 或 `WAV(完整音频)` 时,会等待完整文件生成后播放。MP3 体积更小,WAV 保留无损音频但体积更大。
120
95
 
121
96
  **自定义音色(`mimo-v2.5-tts-voicedesign`)**
122
97
 
123
- 为你提供了常用音色描述模板;下拉框默认选择“自定义”,用户可以直接修改并保存描述。切换到其他模板后再切回“自定义”时,会恢复之前保存的自定义内容。
124
-
98
+ 暂不支持PCM,待官方上线后可适配。
99
+ 提供了常用音色描述模板;用户可以直接修改并保存描述。
125
100
  ```text
126
101
  青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。
127
102
  ```
128
103
 
129
- 建议包含年龄段与性别、声音质感、语速节奏和情绪底色,不写场景或动作。预置音色模式仍使用原来的内置音色配置。
130
-
131
104
  **浏览器本地兜底语音**
132
105
 
133
- 预置音色和 Voice Design 均支持三种策略:“MiMo 优先”在 MiMo 失败时改用浏览器语音;“本地优先”先用浏览器语音,失败时再尝试 MiMo;“关闭本地语音”仅使用 MiMo。可选音色来自浏览器 Web Speech API,是否离线及实际可用范围取决于浏览器、操作系统和网络服务。
134
-
135
-
136
- ## 朗读文本处理
137
-
138
- 插件只朗读清理后的正文,不会修改聊天记录。处理时会保留 Markdown 链接标题,移除链接地址、文件路径、代码块、表情及不可见字符,并统一朗读标点。
139
-
140
- PCM 模式会在回复生成时分段流式朗读,已完成的回复则一次请求并边接收边播放;MP3 和 WAV 会等待完整音频。默认响应上限为 MP3 32 MiB、WAV 128 MiB,可通过 `maxMp3AudioBytes` 和 `maxWavAudioBytes` 调整。
106
+ 支持三种策略:“MiMo 优先”在 MiMo 失败时改用浏览器语音;“本地优先”优先使用浏览器语音;“关闭本地语音”仅使用 MiMo。
107
+ 可选音色来自浏览器 Web Speech API,是否离线及实际可用范围取决于浏览器、操作系统和网络服务。
141
108
 
142
- ## 三方插件联动
109
+ ## 🔌 三方插件联动
110
+ ![whale-girls](assets/whale-girls.webp)
143
111
 
144
- Web 客户端插件可以按需调用本插件的 PCM 流式播放能力。推荐直接在需要播放的位置写一行:
112
+ > 我们对外暴露了PCM流式播放能力。
113
+ Web 插件可以直接调用本插件的服务进行流式播放。可直接在需要播放的位置写一行:
145
114
 
146
115
  ```ts
147
116
  ctx.get('xiaomiMimoTts')?.play('欢迎回来')
148
117
  ```
149
118
 
150
- 请通过 `ctx.get()` 动态获取这项可选能力,不要声明为必需的 `inject` 服务。插件未安装或未就绪时调用会安全跳过;`play()` 使用用户已保存的 MiMo 设置播放 PCM 流,`stop()` 可主动停止。新播放会自动打断当前朗读。
119
+ 建议通过 `ctx.get()` 动态获取这项能力,不必声明为必需的 `inject` 服务。插件未安装或未就绪时调用会安全跳过;`play()` 使用用户已保存的 MiMo 设置播放 PCM 流,`stop()` 可主动停止。新播放会自动打断当前朗读。
151
120
 
152
121
  需要 TypeScript 类型提示时可仅导入类型:
153
122
 
@@ -158,17 +127,14 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
158
127
  tts?.play('欢迎回来')
159
128
  ```
160
129
 
161
- ## 隐私
130
+ ## 🔒 隐私
162
131
 
163
- - API Key 仅保存在 DSH Host,不会发送给浏览器。
164
- - 生成语音时,回复正文会发送给 Xiaomi MiMo 服务。
165
- - 音频只在浏览器内存中通过 Web Audio 或临时 Blob URL 播放,不会持久化到磁盘。
132
+ - API Key 保存在 DSH Host,不会发送给浏览器。
133
+ - 生成语音时,正文会被发送给 Xiaomi MiMo 服务。
134
+ - 音频在浏览器内存中通过 Web Audio 或临时 Blob URL 播放,不会持久化到磁盘。
135
+ - 音效核心移植自 [uisfx 0.4.0](https://github.com/romainsimon/uisfx),遵循 MIT License,详见 `NOTICE`。
166
136
 
167
- ## 反馈与支持
168
-
169
- 欢迎通过 [GitHub Issues](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts/issues) 提交问题反馈、功能建议或使用体验。
170
-
171
- ## 架构
137
+ ## 🏗️ 架构
172
138
 
173
139
  - **共享层**:统一配置、文本清理、分段和 SSE 契约。
174
140
  - **Host 插件**:管理设置与静态资源,并代理 MiMo 完整音频和 PCM 流式请求。
@@ -185,7 +151,14 @@ flowchart LR
185
151
  SHARED -.-> HOST
186
152
  ```
187
153
 
188
- ## 开发
154
+ ## 🛠️ 开发
155
+
156
+ 修改设置面板时运行:
157
+
158
+ ```bash
159
+ pnpm dev
160
+ ```
161
+ 命令会打开本地 UI 预览壳,直接渲染 `src/client/settings-card.tsx` 并热更新。
189
162
 
190
163
  ```bash
191
164
  pnpm install
@@ -194,22 +167,19 @@ pnpm test
194
167
  pnpm pack:check
195
168
  ```
196
169
 
197
- 发布前使用互相隔离的 `DSH_HOME`,按可靠组合验证:`V3.0.0` + `0.1.1-rc.2`,以及 `V3.0.1-alpha` + `0.1.2-rc.1`。CI 使用同一个打包产物依次对两个 DSH 版本执行自动安装、Host、状态路由、settings namespace 和客户端 bundle smoke;浏览器菜单与音频播放仍需发布前人工验证。
170
+ 日常构建使用 `pnpm build`。
171
+ 排查 PCM 流式链路时使用 `pnpm build:debug`。
198
172
 
199
- 日常发布构建使用 `pnpm build`,不会输出 MiMoTTS 的 Host 或浏览器控制台追踪。排查 PCM 流式链路时使用 `pnpm build:debug`,该构建会同时启用 `[MiMoTTS Host]`、`[MiMoTTS Stream]`、`[MiMoTTS Audio]` 和 `[MiMoTTS Service]` 日志。
173
+ > windows用户从本地开发版切换到 npm 版时,请先停止 DSH Web,避免 Windows Junction 被运行中的 Node 进程占用:
200
174
 
201
- `lib/` 是构建产物,不纳入日常代码提交。提交功能时只更新源码和测试;升级版本并执行 `pnpm pack` 或 `pnpm publish` 时,`prepack` 会自动重新生成发布包。直接从 GitHub 安装时,`prepare` 会在安装阶段构建该产物。
202
-
203
- ## 推荐插件
175
+ ```powershell
176
+ .\start\dsh-plugin-reinstall.bat 3.0.2
177
+ ```
204
178
 
205
- 推荐配合本插件一起食用:
179
+ ## 🤝 推荐
180
+ > 本插件的鲸鱼娘形象参考 `dsh-deep-whale` `dsh-whale-musume`由GPT生成。本插件的uisfx音效参考 `dsh-plugin-uisfx`实现
206
181
 
182
+ - [dsh-deep-whale](https://github.com/Small-tailqwq/dsh-deep-whale#readme):鲸鱼娘主题皮肤系列。
207
183
  - [dsh-whale-musume](https://github.com/Sutera-Diffusus/dsh-whale-musume#readme):元气鲸鱼娘桌宠。
208
184
  - [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme):语义化 UI 音效。
209
- - [dsh-codex-timeline](https://github.com/Wine-Red/dsh-codex-timeline#readme):Codex 风格时间线与会话搜索。
210
185
  - [dsh-dream-skin](https://github.com/RevolutionLA/dsh-dream-skin#readme):原生换肤、背景壁纸、强调色、主题包 。
211
-
212
-
213
- ## 许可证
214
-
215
- MIT
Binary file
Binary file