Introduction

The philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When a user needs to play music during a conversation, opening a local player directly interrupts the contextual flow, while having the model output a text link lacks interactivity. dsh-music solves this problem: it renders an interactive player card in the conversation flow. The model only needs to output one dsh-music fence, and the card immediately appears and takes over playback control.

Plugin Positioning

  • Name: jh-evil/dsh-music
  • Maintainer: jh-Evil
  • Type: Client-side plugin
  • Function: Renders dsh-music code blocks in DSH sessions into a music player card with dual backend support for NetEase Cloud Music/QQ Music, providing visual effects and complete playback controls.

Core Features

1. Dual Backends and Automatic Fallback

The plugin integrates two backends: NetEase Cloud Music and QQ Music.
* NetEase Cloud Music: Supports search, playback via direct links (default 320kbps), lyrics, and translation.
* QQ Music: In a no-login environment, due to Tencent signature restrictions, direct links cannot be obtained for most songs. The plugin automatically falls back across backends to NetEase Cloud Music to find and play the same title and artist, and marks the fallback reason in the status bar.
* Fault Tolerance: If both backends fail, the card is marked as “unplayable” and automatically skips to the next track.

2. Visuals and Interaction

  • Themes: Provides four preset themes—glass (glassmorphism), neon (neon glow), paper (paper texture), and vapor (vaporwave)—as well as support for custom theme objects.
  • Lyric modes:
    • bubble: Floating glass lyric bubbles that float and reflow with playback (default).
    • bar: An embedded three-line scrolling lyric bar (with translation).
    • none: Do not display lyrics.
  • Effects: During playback, bubbles rise from the edge of the record in time with the beat (driven by real-time WebAudio spectrum analysis; falls back to simulated beats when cross-origin access is unavailable). Clicking anywhere on the card triggers a bubble burst. The record rotates during playback.

3. Playback Control and State

  • Complete Controls: Supports changing tracks, switching between loop/single-track/shuffle modes, volume adjustment, and progress dragging.
  • Local Management: Supports local favorites and radio mode (automatically searches for similar tracks and adds them to the queue after playback finishes).
  • System Integration: Integrates MediaSession to support lock-screen controls and media key operations.
  • State Persistence: After refreshing the page, the queue and preferences are automatically restored, and direct links are automatically re-resolved when they expire.

Installation and Enablement

The installation command is as follows:

dsh plugin --profile web add dsh-music

After installation, restart the DSH Web interface. The plugin requires a Node.js runtime environment, Node >= 20, and has no runtime dependencies.

Usage Examples

A model can trigger the card by outputting a dsh-music fence in its response. The following are several typical use cases:

  1. Search and Play:
    Input:
    {"theme":"glass","backend":"netease","keyword":"周杰伦 晴天","autoplay":true,"lyricMode":"bubble"}
  1. Specify Theme and Playlist:
    Input:
    {"theme":"vapor","playlist":[
      {"title":"晴天","artist":"周杰伦"},
      {"title":"Lemon","artist":"米津玄師"}
    ]}
  1. Custom Theme:
    Input:
    {"theme":{"accent":"#f9a8d4","bg":"#3b0764"}}
  1. AI Recommendation:
    Click the “AI Recommendation” button in the card’s status bar. The current track is sent back to the model, which can then respond with a new playback command.

Configuration and Environment Variables

Variable Description
DSH_MUSIC_NETEASE_COOKIE NetEase Cloud Music Cookie. Filling this in can improve the success rate for VIP tracks and high-bitrate direct links (an anonymous Cookie is used by default).
DSH_MUSIC_QQ_COOKIE QQ Music Cookie. Filling in a user Cookie gives QQ-side free tracks a chance to obtain direct links directly, reducing automatic fallback.

Notes:
* Browser autoplay policy limitations: The first autoplay may require the user to click the play button.
* For personal learning use only. Music copyrights are owned by their respective platforms.

Conclusion

dsh-music provides search and proxy services through the Node-side portion, while the browser-side portion handles rendering and interaction, enabling seamless music playback within the conversation flow. For developers who need to introduce audio experiences into agent scenarios, this is a lightweight and feature-complete solution.

  • Directory page: https://www.skillhub.cn/plugins/jh-Evil/dsh-music
  • Source code: https://github.com/jh-Evil/dsh-music