DeepSeek Harness × Shengwang Voice Bridge
An isolated DeepSeek Harness plugin with a bilingual configuration page, browser microphone controls, and the streamed OpenAI Chat Completions endpoint required by Shengwang (Agora) Conversational AI.
Harness Settings → Plugins → Voice
↕ browser microphone and call controls
Shengwang RTC → managed ASR → Conversational AI → managed TTS
↓ HTTPS OpenAI SSE
Public path-restricted tunnel → 127.0.0.1:54120
↓
This plugin ↔ one private, tool-disabled DeepSeek Harness session
This is an MVP/PoC. It is not an ACP frontend, an audio codec plugin, or a public network server.
What the PoC implements
- Configure App ID, service area, public route, speech language, greeting and instructions inside Harness Settings.
- Accept App Certificate and bridge bearer token as write-only fields backed by Harness credentials.
- Enable or disable the loopback bridge without editing YAML or restarting Harness.
- Create a real Shengwang Conversational AI session and a one-hour, channel-scoped browser RTC token.
- Publish one browser microphone track, play remote agent audio, mute, stop and clean up partial failures.
- Stream Shengwang Custom LLM requests into a real Harness turn and return token-level OpenAI-compatible SSE chunks.
- Cancel on disconnect, explicit cancel or a newer turn, with stale-turn fencing.
- Give the owned Harness agent an empty tool allow-list.
The deterministic suite and packed-browser smoke do not prove a live Shengwang account, a live DeepSeek model route, voice quality, or production latency. Those claims require the final microphone call with a credentialed account.
Requirements
- DeepSeek Harness
0.1.1-rc.2-compatible packages
- Node.js
^22.19.0 or >=24
- A Shengwang/Agora project with Conversational AI enabled
- A configured DeepSeek Harness model route
- A public HTTPS relay exposing only
/v1/chat/completions
Build and install the exact package
corepack pnpm install
corepack pnpm test
corepack pnpm run typecheck
npm pack
dsh plugin --profile web add ./dsh-shengwang-voice-bridge-0.2.0.tgz
dsh --profile web
Open Settings → Plugins → Voice:
- Enter the Shengwang App ID and choose the service area. Use
CN for a shengwang.cn mainland project.
- Paste the App Certificate and a freshly generated bridge token containing at least 32 URL-safe characters. The password fields clear after save and the values cannot be read back through the page.
- Enter a public HTTPS URL ending in
/v1/chat/completions. It must forward only that path to 127.0.0.1:54120.
- Adjust the language, greeting and spoken-response instructions, enable the bridge, and save.
- Configure the desired Harness model under Settings → Models.
- When all four live prerequisites are green, choose Start live voice and allow microphone access.
Advanced deployments can still override port, tokenEnv, appCertificateEnv, provider, model, cwd and request bounds in Cordis config. Normal browser setup does not require editing YAML.
Live voice flow
The Start button asks the plugin host to create a Shengwang agent using managed Deepgram STT, this plugin's Custom LLM endpoint, and managed MiniMax TTS. The App Certificate stays on the Harness host; only a one-hour RTC capability reaches browser JavaScript. The browser joins that channel and owns exactly one microphone track until End call, page disposal or a failed start.
Shengwang sends the configured bridge token as Authorization: Bearer .... A client interruption normally closes the LLM stream; the plugin maps that disconnect to agent.cancel({ kind: 'user' }).
The public callback URL is not created by this package. Use a path-restricted relay or tunnel; never expose the Harness Web UI or the bridge control endpoints.
Local protocol smoke
curl --fail http://127.0.0.1:54120/health
curl --no-buffer \
-H "Authorization: Bearer $DSH_SHENGWANG_BRIDGE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"model":"deepseek-harness","stream":true,"messages":[{"role":"user","content":"Say hello briefly."}]}' \
http://127.0.0.1:54120/v1/chat/completions
Endpoint contract
| Route | Auth | Purpose |
|---|
GET /health | No | Listener readiness only |
POST /v1/chat/completions | Bearer | Stream one text turn |
POST /v1/cancel | Bearer | Local cancellation probe |
POST /v1/reset | Bearer | Dispose owned Harness conversation state |
GET /api/shengwang-voice/config | Same origin | Redacted settings and credential status |
PUT /api/shengwang-voice/config | Same origin | Settings plus write-only credential replacement |
POST /api/shengwang-voice/session/start | Same origin | Create Shengwang agent and browser RTC capability |
POST /api/shengwang-voice/session/stop | Same origin | Stop a plugin-owned Shengwang agent |
Only the last user message is admitted because the Harness session already owns conversation history. Images, audio request parts, non-streaming replies and tool/function requests are rejected.
Design and verification
Primary references
License
MIT