@allmodels/dsh-speech 0.1.0
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/LICENSE +21 -0
- package/README.md +131 -0
- package/cordis.patch.yml +4 -0
- package/lib/client.js +1803 -0
- package/lib/index.d.ts +77 -0
- package/lib/index.js +717 -0
- package/package.json +110 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-speech contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# @allmodels/dsh-speech
|
|
2
|
+
|
|
3
|
+
Streaming microphone transcription for the DeepSeek Harness web client, powered by [AllModels.io](https://allmodels.io/).
|
|
4
|
+
|
|
5
|
+
`@allmodels/dsh-speech` adds a microphone beside Send, a live amplitude bar below the composer, partial and final transcription, an AllModels account flow, and a dedicated Speech settings page. It is a standalone Cordis bundle and does not patch DeepSeek Harness.
|
|
6
|
+
|
|
7
|
+
## Compatibility
|
|
8
|
+
|
|
9
|
+
- DeepSeek Harness web profile `0.1.1-rc.2`
|
|
10
|
+
- Node.js `^22.19.0 || >=24.0.0`
|
|
11
|
+
- A browser with `getUserMedia`, `AudioContext`, and `AudioWorklet`
|
|
12
|
+
- Loopback-hosted Harness web UI
|
|
13
|
+
|
|
14
|
+
The Harness extension surface is currently prerelease, so this package pins its Harness peer dependencies to the tested release.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
From npm after publication:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
dsh plugin --profile web add @allmodels/dsh-speech
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
From this checkout:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pnpm install
|
|
28
|
+
pnpm build
|
|
29
|
+
dsh plugin --profile web add .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or create a portable tarball:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
pnpm pack
|
|
36
|
+
dsh plugin --profile web add ./allmodels-dsh-speech-0.1.0.tgz
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Restart the profile after adding or removing the bundle.
|
|
40
|
+
|
|
41
|
+
## Connect AllModels
|
|
42
|
+
|
|
43
|
+
Open **Settings → Speech** and choose either:
|
|
44
|
+
|
|
45
|
+
1. Enter an email address, request the six-digit code, and verify it. This is the AllModels agentic signup/login flow and works for both new and existing accounts.
|
|
46
|
+
2. Paste an existing AllModels API key.
|
|
47
|
+
|
|
48
|
+
The key is sent to the local plugin host once and stored through the Harness credential service. It is never returned to the browser. You can also provide `ALLMODELS_API_KEY` in the Harness environment; an environment-managed key is read-only in the settings UI.
|
|
49
|
+
|
|
50
|
+
See the [AllModels agentic setup documentation](https://docs.allmodels.io/agentic-setup) for account details.
|
|
51
|
+
|
|
52
|
+
## Use voice input
|
|
53
|
+
|
|
54
|
+
1. Click the microphone next to Send.
|
|
55
|
+
2. Speak while the amplitude bar and partial transcription update.
|
|
56
|
+
3. While recording, choose **System default** or another input from the microphone selector beside TTFT. On a new chat, the selector appears beside the mode selector in the hero controls row.
|
|
57
|
+
4. Click Stop. The plugin waits briefly for the last final transcript, unlocks the composer, and leaves the text as an editable draft.
|
|
58
|
+
|
|
59
|
+
Voice input never sends the message automatically. Existing draft text is preserved and the transcript is appended. Composer editing and Send are disabled while the microphone is active.
|
|
60
|
+
|
|
61
|
+
Only one microphone may be active at a time. Leaving the originating session immediately stops capture, closes the speech socket, clears the transient composer lock, and preserves the latest draft text.
|
|
62
|
+
|
|
63
|
+
A specifically selected microphone is remembered for this browser and reused on the next recording. Choosing **System default** clears that preference. If a remembered device is no longer available, capture safely falls back to the current system default.
|
|
64
|
+
|
|
65
|
+
The microphone selector is hidden on mobile layouts, where the browser's system-default input or previously remembered device is used automatically.
|
|
66
|
+
|
|
67
|
+
## Recognition settings
|
|
68
|
+
|
|
69
|
+
- **Model**, then **provider**: populated from the live AllModels provider catalog. Only streaming bindings accepting mono PCM16 at 16 kHz are shown.
|
|
70
|
+
- **Default model**: a Chinese Harness locale uses Soniox's current advertised streaming default; other locales use AssemblyAI's current advertised streaming default. An explicit saved choice always wins.
|
|
71
|
+
- **Language**: Auto, a common language code, or a custom BCP-47 tag such as `zh-CN`.
|
|
72
|
+
- **Context**: sent only when the selected binding advertises context support. A saved value remains intact when switching to a provider that does not support it.
|
|
73
|
+
- **Balance**: paid plus eligible, unexpired promotional funds applicable to the selected binding. A warning appears below $0.50; a known zero balance disables recording.
|
|
74
|
+
- **Top-up**: creates an AllModels-hosted checkout link for $5–$1,000. The default amount is $10.
|
|
75
|
+
|
|
76
|
+
Model and streaming details come from the [AllModels provider catalog](https://docs.allmodels.io/models) and [native streaming STT API](https://docs.allmodels.io/api-reference/native-tts/stt/nativeSttStream).
|
|
77
|
+
|
|
78
|
+
## Operator configuration
|
|
79
|
+
|
|
80
|
+
The bundle row may be given composition-level defaults in a Harness patch:
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
- insert:
|
|
84
|
+
- id: ui-speech
|
|
85
|
+
name: '@allmodels/dsh-speech'
|
|
86
|
+
config:
|
|
87
|
+
apiKeyEnv: ALLMODELS_API_KEY
|
|
88
|
+
baseURL: https://api.allmodels.io
|
|
89
|
+
lowBalanceUsd: 0.5
|
|
90
|
+
defaultTopUpUsd: 10
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`baseURL` is deliberately operator-only; it is not editable in the browser. User model, provider, language, and context overrides are stored through the Harness settings service and take effect on the next recording.
|
|
94
|
+
|
|
95
|
+
## Privacy and session safety
|
|
96
|
+
|
|
97
|
+
- Audio is resampled in the browser and relayed through the local plugin host only while recording. It is never written to disk or retained for retry.
|
|
98
|
+
- API keys remain host-side in the Harness credential service and are inserted only into authenticated AllModels requests.
|
|
99
|
+
- Transcripts exist only in the browser's existing unsent composer draft until the user sends them normally.
|
|
100
|
+
- The preferred microphone device ID is kept only in plugin-namespaced browser-local storage. It is not written to Harness sessions.
|
|
101
|
+
- The host plugin does not inject Harness session services, import session packages, read session files, or write session files. A build check fails if a session/filesystem persistence dependency is introduced.
|
|
102
|
+
- The plugin's custom HTTP and WebSocket routes accept only same-origin loopback requests and enforce bounded request/frame sizes.
|
|
103
|
+
|
|
104
|
+
The only durable plugin data is its namespaced settings, credential, and browser-local microphone preference. See the [AllModels balance](https://docs.allmodels.io/api-reference/account/getAccountBalance) and [top-up](https://docs.allmodels.io/api-reference/account/createAccountTopUpLink) documentation for account-side data.
|
|
105
|
+
|
|
106
|
+
## Troubleshooting
|
|
107
|
+
|
|
108
|
+
- **Microphone is disabled:** connect AllModels in Settings → Speech and confirm the usable balance is not zero.
|
|
109
|
+
- **Browser denied the microphone:** grant microphone permission to the local Harness page, then retry.
|
|
110
|
+
- **No models appear:** use Refresh in Speech settings. The catalog keeps a five-minute in-memory cache and falls back to its last successful value during that process lifetime.
|
|
111
|
+
- **Context is disabled:** the chosen provider/model binding does not advertise the portable `context` option.
|
|
112
|
+
- **Environment key cannot be disconnected:** remove or change `ALLMODELS_API_KEY` in the Harness environment; read-only sources cannot be overwritten from the UI.
|
|
113
|
+
- **Balance cannot be fetched:** recording remains enabled unless the last known balance is exactly zero. Provider-side insufficient-balance errors stop safely and preserve the draft.
|
|
114
|
+
|
|
115
|
+
## Development
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
pnpm install
|
|
119
|
+
pnpm check
|
|
120
|
+
pnpm pack --dry-run
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`pnpm check` runs the no-session-access boundary, TypeScript, unit/protocol tests, and both production bundles. Tests cover catalog defaults, provider capabilities, targeted promotional balances, transcript sequencing/CJK spacing, route security, credential redaction behavior, and the AllModels streaming wire mapping.
|
|
124
|
+
|
|
125
|
+
## Release
|
|
126
|
+
|
|
127
|
+
Pull requests run the full check and package dry run. A `v*` GitHub release tag runs the same gates and publishes with npm provenance after the package owner configures this repository as an npm trusted publisher.
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT
|
package/cordis.patch.yml
ADDED