dsh-music-player 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 +71 -0
- package/cordis.patch.yml +8 -0
- package/lib/client.js +867 -0
- package/lib/index.js +330 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kendu76
|
|
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,71 @@
|
|
|
1
|
+
# dsh-music-player
|
|
2
|
+
|
|
3
|
+
DeepSeek Harness 本地音乐库播放器插件(bundle)。
|
|
4
|
+
|
|
5
|
+
在 Host 进程里扫描本地音乐目录(默认 `~/Music`,可在面板里改),以 HTTP 流式(支持 Range/拖进度)给浏览器提供音频;浏览器侧给聊天输入区注入**正在播放条**,并提供一个浮动的**播放面板**(曲目列表 / 循环模式 / 音量 / 实时频谱 / 音乐目录设置)。同时注册 `music_play` 模型工具,让 agent 可以直接按关键词播放本地音乐。
|
|
6
|
+
|
|
7
|
+
## 特性
|
|
8
|
+
|
|
9
|
+
- 本地音频流式播放,支持 seek / 断点续播
|
|
10
|
+
- 顺序播放、单曲循环、乱序播放三种模式
|
|
11
|
+
- 实时 7 段频谱可视化(解码音频包络驱动)
|
|
12
|
+
- `music_play` 模型工具:agent 可按关键词让浏览器播放
|
|
13
|
+
- 支持的格式:`mp3 / m4a / m4b / aac / flac / wav / ogg / opus / webm / aiff`(自动递归扫描子目录,上限 500 首)
|
|
14
|
+
|
|
15
|
+
## 安装
|
|
16
|
+
|
|
17
|
+
需要已安装 `dsh` CLI。
|
|
18
|
+
|
|
19
|
+
直接从一个 git 托管安装(推荐,无构建步骤):
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
# 安装到你的 profile(把 <profile> 换成实际 profile 名,如 web)
|
|
23
|
+
dsh plugin --profile <profile> add github:kendu76/dsh-music-player
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> 项目是手写的纯 JS(`lib/` 直接是发布产物),**没有**需要从源码构建的步骤,因此从 GitHub 直装即可使用,无需像 TypeScript 包那样为构建脚本授权。
|
|
27
|
+
|
|
28
|
+
安装后重启 DSH,打开 Web GUI:
|
|
29
|
+
- 聊天输入区下方会出现「本地音乐播放器」播放条
|
|
30
|
+
- 点击右侧「列表」按钮打开播放面板
|
|
31
|
+
- 在面板顶部点击「选择音乐目录」并选定音乐目录(默认 `~/Music`),自动递归扫描
|
|
32
|
+
- 之后可直接在对话框里让 agent 播放,例如「播放周杰伦的歌」
|
|
33
|
+
|
|
34
|
+
### 从本地目录 / tarball 安装
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
# 本地目录
|
|
38
|
+
dsh plugin --profile <profile> add /path/to/dsh-music-player
|
|
39
|
+
|
|
40
|
+
# 或先打包再安装
|
|
41
|
+
pnpm pack
|
|
42
|
+
dsh plugin --profile <profile> add ./dsh-music-player-0.1.0.tgz
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 配置
|
|
46
|
+
|
|
47
|
+
插件为「Host 端 + Web 端」双面结构:
|
|
48
|
+
|
|
49
|
+
- Host 端(`lib/index.js`):音乐扫描、HTTP 流式、`music_play` 工具
|
|
50
|
+
- Web 端(`lib/client.js`):浏览器里的播放条 / 播放面板 / 频谱
|
|
51
|
+
|
|
52
|
+
两者由一个 `cordis.patch.yml` 插入 `music-player` 行并自动组对(在 Web 端 `dsh.client` 声明即指回该行名并加载浏览器半体):
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
- insert:
|
|
56
|
+
- id: music-player
|
|
57
|
+
name: 'dsh-music-player'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
播放模式与音量保存在浏览器 `localStorage`,当前曲目与进度也会在刷新后恢复(浏览器的自动播放可能被拦截,点一次 ▶ 即可解锁)。
|
|
61
|
+
|
|
62
|
+
## 开发
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
# 修改 lib/ 后,在本机 profile 里用 link 方式本地调试
|
|
66
|
+
dsh plugin --profile <profile> add ./ # 或直接改 profile 里的 link 目标
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
[MIT](LICENSE) © kendu76
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# dsh-music-player bundle patch: inserts the dual-face plugin row into the web
|
|
2
|
+
# profile roster. The node half (exports ".") runs in the host process (audio
|
|
3
|
+
# streaming, music-library scan, and the music_play model tool), and the
|
|
4
|
+
# dsh.client declaration in package.json loads the browser half (exports
|
|
5
|
+
# "./client") in the web GUI.
|
|
6
|
+
- insert:
|
|
7
|
+
- id: music-player
|
|
8
|
+
name: 'dsh-music-player'
|