The core architecture of DeepSeek Harness (DSH) allows extending the Web interface through plugins. dsh-audio-input is a Web plugin that adds a microphone button to the message editor. It runs a small helper process using the macOS native Speech framework (SFSpeechRecognizer), requires no cloud API key, and audio does not leave the machine.
Core Features¶
- Adds a microphone button to the message editor.
- Uses the native Apple Speech framework (SFSpeechRecognizer).
- Runs a small helper process on a Mac.
- Supports local and remote modes.
- Requires no cloud API key; audio does not leave the machine.
Prerequisites¶
- Run the dsh server on macOS (Web profile).
- Remote clients require macOS for remote speech recognition.
- Xcode command-line tools (only for rebuilding from source).
Installation and Configuration¶
Perform the following steps on the server Mac.
1. Install the Plugin¶
Run the install command to add the plugin to the Web profile.
dsh plugin --profile web add link:/path/to/dsh-audio-input
2. Configure the Remote Token¶
Edit ~/.dsh/profiles/web/cordis.patch.yml and add the remoteToken configuration. This is the secret key for remote mode.
- id: audio-input
config:
remoteToken: 'choose-any-secret-string'
3. Restart the Service¶
After modifying the configuration, you must restart the dsh web service.
# 停止服务 (Ctrl-C)
# 然后重新启动
dsh web
Remote Endpoint Setup¶
If you need to perform voice input from another Mac, you must configure the helper process on the remote Mac.
1. Download the Helper Binary¶
Download the compiled binary file from the server.
curl -o ~/dsh-audio-speech http://<SERVER-IP>:3080/audio-input/helper
chmod +x ~/dsh-audio-speech
2. Run the Helper Process¶
Start the helper process on the remote Mac, specifying the server address and token.
~/dsh-audio-speech --remote http://<SERVER-IP>:3080 --token 'choose-any-secret-string'
3. Grant System Permissions¶
On first run, macOS prompts you to authorize microphone and speech recognition permissions. Go to Privacy & Security in System Settings and allow them.
Typical Usage¶
- Click the microphone button on the right side of the message editor toolbar.
- Speak; the transcribed text appears in real time in the preview bar above the editor.
- Click the microphone button again to stop recording.
- The text is automatically inserted into the editor draft. Review it and send it when ready.
Configuration Reference¶
Under the config node in cordis.patch.yml, the following options can be configured:
| Key | Default | Meaning |
|---|---|---|
| locale | ‘en-US’ | BCP 47 recognizer locale, for example ‘zh-CN’ |
| onDevice | false | Force on-device recognition (fully offline, fewer languages supported) |
| remoteToken | ’‘ | Shared secret for the remote helper process; leave empty to disable remote functionality |
Troubleshooting¶
- Syntax error at runtime: The downloaded file may be an HTML page instead of a binary file. Use
file ~/dsh-audio-speechto check whether it isMach-O 64-bit executable arm64. - Remote is offline: Check whether the helper process on the remote Mac is running, and whether the
--remoteaddress and--tokenmatch the server configuration. - Permission denied: Go to System Settings → Privacy & Security and manually enable microphone and speech recognition permissions.
- Repeated click prompt: After updating the plugin, restart the
dsh webservice to load the new client package.
Security Notes¶
remoteToken is the only security barrier used to verify the connection between the remote helper process and the server. Ensure the key is strong enough to protect your dsh service.