dsh-audiogen 0.4.9 → 0.4.11

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/README.md CHANGED
@@ -1,84 +1,109 @@
1
- # dsh-audiogen
2
-
3
- DeepSeek HarnessDSH)AI 音频插件:让 Agent 不只会回答,还能生成语音、音乐与音效。
4
-
5
- - 侧边栏新增「AI 音频」模块,与 dsh-imagegen 的「AI 生图」类似。
6
- - 在「设置 → 插件 → AI 音频」中可添加多个音频厂商渠道:
7
- - OpenAI 兼容 TTS
8
- - ElevenLabs
9
- - MiniMax
10
- - Stability AI(音乐/音效)
11
- - 自定义 OpenAI 兼容或通用 POST 接口
12
- - Agent 可通过 `generate_audio` 工具生成音频,并在对话工具结果中直接播放 / 下载。
13
- - API 密钥保存在 DSH 宿主侧,浏览器与 Agent 不接触明文密钥。
14
- - 生成历史持久化在 `~/.dsh/dsh-audiogen/`。
15
- - **资源库**:生成的音频可勾选「加入资源库」(或设置中开启自动保存),按类型分目录存放
16
- (`voice/male|female|custom`、`music`、`sfx`、`tts/<音色键>`),每条资源都带完整溯源
17
- (渠道、模型与上游 ID、音色 voiceId、提示词、参数快照)。资源库支持搜索、标签、
18
- 重命名、移动分类、批量管理与详情抽屉(可复制参数 / 复用音色)。
19
- - **模型对比**:生成页勾选「模型对比」后选择 2-4 个模型,用相同参数逐个生成,
20
- 结果按模型分组并列展示,便于对比音质/风格。
21
- - Agent 亦可调用 `search_audio_library` 检索本地资源库,复用已有音色/配乐/音效。
22
-
23
- ## 安装
24
-
25
- 已发布到 npm:
1
+ # 🎧 dsh-audiogen
2
+
3
+ **AI audio generation for DeepSeek Harness (DSH)** turn your DSH web GUI into an audio studio: text-to-speech, music, sound effects and voice design, from a sidebar panel or straight from the Agent.
4
+
5
+ [English](README.md) | [简体中文](README.zh-CN.md)
6
+
7
+ ![npm version](https://img.shields.io/npm/v/dsh-audiogen?style=flat-square&color=8B5CF6)
8
+ ![license](https://img.shields.io/npm/l/dsh-audiogen?style=flat-square)
9
+ ![DSH plugin](https://img.shields.io/badge/DSH-plugin-brightgreen?style=flat-square)
10
+ ![Node](https://img.shields.io/badge/node-%3E%3D20-blue?style=flat-square)
11
+
12
+ ![Main panel](docs/images/panel-compare.png)
13
+
14
+ ## Features
15
+
16
+ - **Four generation modes**: 文本转语音 (TTS) · 音乐生成 (Music) · 音效生成 (Sound effects) · 音色设计 (Voice design)
17
+ - **Multi-vendor channels in one place**: OpenAI-compatible TTS, MiniMax, ElevenLabs, Stability AI, or any custom OpenAI-compatible / generic POST endpoint
18
+ - **Per-channel model & voice catalogs** with one-click discovery, aliases, capability categories and per-model advanced fields (duration, seed, steps, cfg_scale, loop, prompt influence, …)
19
+ - **Model comparison**: same prompt across 24 models with per-model parameter overrides — results grouped side by side
20
+ - **✨ Prompt enhancement**: rewrite any rough idea into a ready-to-generate description with an LLM (choose any model from *Settings → Models*; falls back to the agent default model)
21
+ - **History with one-click restore**: prompt, config, model set *and the original audio* come back into the panel — no regeneration, no extra cost
22
+ - **Resource library**: auto-save generated audio (or opt-in per run), organized by type — voices / music / sfx / TTS — with search, tags, rename, category moves, and full provenance (channel, model, voiceId, prompt, params snapshot). Reuse a voice or music bed instead of regenerating
23
+ - **Agent tools**: `generate_audio` and `search_audio_library`, plus bundled session skills — the Agent can generate and find audio on demand
24
+ - **Keys stay local**: API keys live in the local DSH settings document and generation is proxied by the local host; the browser and the Agent never touch plaintext credentials
25
+
26
+ ## 📸 Screenshots
27
+
28
+ | Generation panel | Model comparison |
29
+ | --- | --- |
30
+ | ![Generation](docs/images/panel-music.png) | ![Compare](docs/images/panel-compare.png) |
31
+
32
+ | History & restore | Channels settings |
33
+ | --- | --- |
34
+ | ![History](docs/images/history-panel.png) | ![Settings](docs/images/settings-channels.png) |
35
+
36
+ | Channel editor (model catalog & auto capabilities) | LLM models (Settings → Models) |
37
+ | --- | --- |
38
+ | ![Channel editor](docs/images/settings-stability.png) | ![Models page](docs/images/models-page.png) |
39
+
40
+ ## 📦 Installation
41
+
42
+ The plugin is published on npm. DSH host (Node ≥ 20) required.
26
43
 
27
44
  ```bash
28
45
  dsh plugin --profile web add dsh-audiogen
29
- # 或指定版本
30
- dsh plugin --profile web add dsh-audiogen@0.1.0
31
46
  ```
32
47
 
33
- 本地开发安装:
48
+ Local development install:
34
49
 
35
50
  ```bash
36
51
  dsh plugin --profile web add /path/to/dsh-audiogen
37
52
  ```
38
53
 
39
- 安装后重启 `dsh web`,侧边栏出现「AI 音频」。打开「设置 插件 AI 音频」,添加一个厂商渠道并填写 API 地址、密钥、模型/音色后即可使用。
54
+ Restart `dsh web` after install the sidebar will show **AI 音频**.
55
+
56
+ ## 🚀 Quick start
57
+
58
+ 1. Open **Settings → Plugins → AI 音频**
59
+ 2. Add a channel: pick a preset provider (+ Add provider) or a custom endpoint (+ Add custom provider)
60
+ 3. Fill in the API URL, API key, and the model/voice catalog (use *Fetch available models* to import them)
61
+ 4. Save, then open the **AI 音频** sidebar panel:
62
+ - choose a mode (TTS / Music / SFX / Voice design)
63
+ - type your text or prompt (optional: ✨ 增强提示词)
64
+ - pick a model — or tick 模型对比 for 2–4 models at once
65
+ - hit **开始生成** and play the results, download them, or add them to the 资源库
66
+
67
+ ## 🎛 Modes supported by each vendor
68
+
69
+ | Mode | MiniMax | ElevenLabs | Stability AI | OpenAI-compatible / custom |
70
+ | --- | --- | --- | --- | --- |
71
+ | TTS | ✅ (8 voices) | ✅ (voices + streams) | — | ✅ |
72
+ | Music | ✅ (`music-3.0` / `music-2.6` / `music-cover`) | ✅ (`music_v2`) | ✅ (`stable-audio-*`) | ✅ (generic POST) |
73
+ | Sound effects | — | ✅ (`eleven_text_to_sound_v2`, loop / prompt_influence) | ✅ (`stable-audio-*` — same text-to-audio protocol, auto-detected in music + SFX) | ✅ (generic POST) |
74
+ | Voice design | ✅ (`/v1/voice_design`) | ✅ (`/v1/text-to-voice/design`) | — | — |
40
75
 
41
- ## Agent 工具
76
+ ## 🤖 Agent usage
42
77
 
43
- | 工具 | 用途 |
78
+ | Tool | Purpose |
44
79
  | --- | --- |
45
- | `generate_audio` | 提交 TTS / 音乐 / 音效生成,等待完成后返回同源音频 URL;可选 `save_to_library` 入库。 |
46
- | `search_audio_library` | 检索本地资源库(类型/分类/关键词),返回资源、溯源与音频 URL。 |
80
+ | `generate_audio` | Submit a TTS / music / SFX / voice-design task; waits for completion and returns same-origin audio URLs. Optional `enhance_prompt`, `save_to_library`, per-vendor params. |
81
+ | `search_audio_library` | Search the local resource library (type / category / keyword) and reuse an existing voice, music bed or effect. |
47
82
 
48
- 示例:
83
+ Typical session commands (skills bundled with the plugin):
49
84
 
50
85
  ```text
51
- /audiogen 生成一段 30 秒的 Lo-fi 背景音乐
52
86
  /audio:tts 用温暖的声音朗读这句话
87
+ /audio:music 生成一段 30 秒的 Lo-fi 背景音乐
53
88
  /audio:sfx 生成一声科幻风格的 UI 提示音
89
+ /audio:design 一个温暖复古的合成器音色
54
90
  ```
55
91
 
56
- ## 开发
92
+ ## 🔐 Security & data notes
93
+
94
+ - API keys are stored in the local DSH settings document; requests are proxied by the local host (`/api/dsh-audiogen/*`, loopback-only routes)
95
+ - Generation consumes your upstream provider quota; audio content is produced by the upstream model
96
+ - History & library persist under `~/.dsh/dsh-audiogen/`
97
+ - Prompt enhancement calls the LLM model you choose (default: agent default model) — no extra API key
98
+
99
+ ## 🛠 Development
57
100
 
58
101
  ```bash
59
102
  pnpm install
60
103
  pnpm run typecheck
61
- pnpm run build
62
- ```
63
-
64
- ## 目录
65
-
66
- ```text
67
- dsh-audiogen/
68
- ├── package.json # dsh.bundle + dsh.client 声明
69
- ├── cordis.patch.yml # 插件行
70
- ├── src/
71
- │ ├── index.ts # 宿主插件
72
- │ ├── protocol.ts # 共享协议
73
- │ ├── audio-engine.ts # 多厂商生成引擎
74
- │ ├── audio-presets.ts # 预置厂商
75
- │ ├── audio-store.ts # 音频/历史持久化
76
- │ ├── routes.ts # /api/dsh-audiogen/*
77
- │ ├── agent-audio-tools.ts
78
- │ └── client/ # 浏览器端:侧边栏、设置卡片、面板、工具视图
79
- └── skills/ # 建议的会话技能定义(TTS / music / sfx / design)
104
+ pnpm run build # outputs lib/ (host + client bundles)
80
105
  ```
81
106
 
82
- ## 许可证
107
+ ## 📄 License
83
108
 
84
- Apache-2.0
109
+ [Apache-2.0](LICENSE)
@@ -0,0 +1,109 @@
1
+ # 🎧 dsh-audiogen
2
+
3
+ **DeepSeek Harness(DSH)AI 音频插件** —— 让 DSH Web 变成一个音频工作台:文本转语音、音乐生成、音效生成、音色设计,侧边栏面板和 Agent 都能直接用。
4
+
5
+ [English](README.md) | [简体中文](README.zh-CN.md)
6
+
7
+ ![npm version](https://img.shields.io/npm/v/dsh-audiogen?style=flat-square&color=8B5CF6)
8
+ ![license](https://img.shields.io/npm/l/dsh-audiogen?style=flat-square)
9
+ ![DSH plugin](https://img.shields.io/badge/DSH-plugin-brightgreen?style=flat-square)
10
+ ![Node](https://img.shields.io/badge/node-%3E%3D20-blue?style=flat-square)
11
+
12
+ ![主面板](docs/images/panel-compare.png)
13
+
14
+ ## ✨ 功能特性
15
+
16
+ - **四种生成模式**:文本转语音(TTS)· 音乐生成 · 音效生成 · 音色设计
17
+ - **多厂商渠道统一管理**:OpenAI 兼容 TTS、MiniMax、ElevenLabs、Stability AI,以及任意自定义 OpenAI 兼容 / 通用 POST 接口
18
+ - **每渠道模型/音色目录**:一键「获取可用模型」、显示名称(alias)、能力分类(语音/音乐/音效/音色设计),按模型展示完整参数(时长、seed、steps、cfg_scale、loop、提示词影响度……)
19
+ - **模型对比**:同一提示词并发生成 2–4 个模型,支持每模型参数覆盖,结果按模型分组并列对比
20
+ - **✨ 提示词增强**:把一句粗略想法扩写成适合生成模型的完整描述,LLM 模型可在「设置 → 模型」中任选(缺省跟随 Agent 默认模型,无需额外 API Key)
21
+ - **历史记录一键恢复**:prompt、配置、模型组合**以及当时的音频**全部回到面板——可直接试听/下载,无需重新生成、不额外消耗
22
+ - **资源库**:生成后可一键入库(或设置自动保存),按类型分目录——音色 voice / 音乐 music / 音效 sfx / TTS——支持搜索、标签、重命名、移动分类,并保留完整溯源(渠道、模型、voiceId、提示词、参数快照)。同款音色/配乐/音效直接复用,不必重复生成
23
+ - **Agent 工具**:`generate_audio` 与 `search_audio_library`,并随包分发 TTS/音乐/音效/音色设计会话技能
24
+ - **密钥留在本机**:API 密钥存于本地 DSH 设置文档,生成请求由本地宿主代理转发,浏览器与 Agent 全程不接触明文密钥
25
+
26
+ ## 📸 截图
27
+
28
+ | 生成面板 | 模型对比 |
29
+ | --- | --- |
30
+ | ![生成](docs/images/panel-music.png) | ![对比](docs/images/panel-compare.png) |
31
+
32
+ | 历史记录与恢复 | 渠道设置 |
33
+ | --- | --- |
34
+ | ![历史](docs/images/history-panel.png) | ![设置](docs/images/settings-channels.png) |
35
+
36
+ | 渠道编辑(模型目录与自动能力识别) | LLM 模型(设置 → 模型) |
37
+ | --- | --- |
38
+ | ![渠道编辑](docs/images/settings-stability.png) | ![模型页](docs/images/models-page.png) |
39
+
40
+ ## 📦 安装
41
+
42
+ 插件已发布到 npm,需要 DSH 宿主(Node ≥ 20):
43
+
44
+ ```bash
45
+ dsh plugin --profile web add dsh-audiogen
46
+ ```
47
+
48
+ 本地开发安装:
49
+
50
+ ```bash
51
+ dsh plugin --profile web add /path/to/dsh-audiogen
52
+ ```
53
+
54
+ 安装后重启 `dsh web`,侧边栏出现 **AI 音频**。
55
+
56
+ ## 🚀 快速开始
57
+
58
+ 1. 打开 **设置 → 插件 → AI 音频**
59
+ 2. 添加渠道:选择预置提供方(+ 添加提供方)或自定义端点(+ 添加自定义提供方)
60
+ 3. 填写 API 地址、API 密钥与模型/音色目录(可用「获取可用模型」一键导入)
61
+ 4. 保存后打开侧边栏 **AI 音频** 面板:
62
+ - 选择模式(文本转语音 / 音乐生成 / 音效生成 / 音色设计)
63
+ - 输入文本或提示词(可选:✨ 增强提示词)
64
+ - 选择模型;或勾选「模型对比」一次生成 2–4 个模型
65
+ - 点击 **开始生成**,试听、下载,或一键加入资源库
66
+
67
+ ## 🎛 各厂商支持的模式
68
+
69
+ | 模式 | MiniMax | ElevenLabs | Stability AI | OpenAI 兼容 / 自定义 |
70
+ | --- | --- | --- | --- | --- |
71
+ | TTS | ✅(8 种音色) | ✅(音色 + 流式) | — | ✅ |
72
+ | 音乐 | ✅(`music-3.0` / `music-2.6` / `music-cover`) | ✅(`music_v2`) | ✅(`stable-audio-*`) | ✅(通用 POST) |
73
+ | 音效 | — | ✅(`eleven_text_to_sound_v2`,loop / prompt_influence) | ✅(`stable-audio-*`,同一 text-to-audio 协议,自动识别为音乐+音效双模式) | ✅(通用 POST) |
74
+ | 音色设计 | ✅(`/v1/voice_design`) | ✅(`/v1/text-to-voice/design`) | — | — |
75
+
76
+ ## 🤖 Agent 使用
77
+
78
+ | 工具 | 用途 |
79
+ | --- | --- |
80
+ | `generate_audio` | 提交 TTS / 音乐 / 音效 / 音色设计任务,等待完成后返回同源音频 URL;支持 `enhance_prompt`、`save_to_library` 与各厂商参数。 |
81
+ | `search_audio_library` | 检索本地资源库(类型/分类/关键词),复用已有音色、配乐或音效。 |
82
+
83
+ 会话内常用指令(插件自带技能):
84
+
85
+ ```text
86
+ /audio:tts 用温暖的声音朗读这句话
87
+ /audio:music 生成一段 30 秒的 Lo-fi 背景音乐
88
+ /audio:sfx 生成一声科幻风格的 UI 提示音
89
+ /audio:design 一个温暖复古的合成器音色
90
+ ```
91
+
92
+ ## 🔐 安全与数据说明
93
+
94
+ - API 密钥存于本地 DSH 设置文档;生成请求由本地宿主代理转发(`/api/dsh-audiogen/*`,仅回环地址可访问)
95
+ - 生成会消耗上游 API 额度;音频内容由上游模型生成
96
+ - 历史与资源库持久化在 `~/.dsh/dsh-audiogen/`
97
+ - 提示词增强使用所选 LLM 模型(默认跟随 Agent 默认模型),无需额外 API Key
98
+
99
+ ## 🛠 开发
100
+
101
+ ```bash
102
+ pnpm install
103
+ pnpm run typecheck
104
+ pnpm run build # 输出 lib/(宿主 + 浏览器 bundle)
105
+ ```
106
+
107
+ ## 📄 许可证
108
+
109
+ [Apache-2.0](LICENSE)
Binary file
Binary file
Binary file
Binary file