dsh-audiogen 0.4.0 → 0.4.2
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 +2 -0
- package/lib/client.js +1700 -760
- package/lib/client.js.map +1 -1
- package/lib/index.js +412 -162
- package/package.json +1 -1
- package/skills/design/SKILL.md +5 -0
- package/skills/music/SKILL.md +5 -0
- package/skills/sfx/SKILL.md +5 -0
- package/skills/tts/SKILL.md +5 -0
- package/src/agent-audio-tools.ts +265 -149
- package/src/audio-scheduler.ts +73 -0
- package/src/client/SettingsCard.tsx +18 -0
- package/src/client/api.ts +24 -25
- package/src/client/audio-panel.module.css +328 -0
- package/src/client/field-specs.ts +186 -0
- package/src/client/library-view.tsx +6 -1
- package/src/client/locales.ts +2 -0
- package/src/client/settings-scope.ts +18 -3
- package/src/client/studio-view.tsx +772 -254
- package/src/index.ts +46 -0
- package/src/protocol.ts +10 -1
- package/src/routes.ts +50 -2
package/src/client/locales.ts
CHANGED
|
@@ -36,6 +36,7 @@ export const zh = {
|
|
|
36
36
|
'settings.announceToAgent': '向 Agent 播报本插件',
|
|
37
37
|
'settings.allowAgentAudio': '允许 Agent 调用音频生成',
|
|
38
38
|
'settings.autoSaveLibrary': '生成后自动保存到资源库',
|
|
39
|
+
'settings.maxConcurrent': '最大并发生成数(同时打到上游的请求数,默认 5)',
|
|
39
40
|
'settings.save': '保存',
|
|
40
41
|
'settings.saving': '保存中…',
|
|
41
42
|
'settings.discard': '放弃修改',
|
|
@@ -140,6 +141,7 @@ export const en: Record<AudioGenKey, string> = {
|
|
|
140
141
|
'settings.announceToAgent': 'Announce this plugin to agents',
|
|
141
142
|
'settings.allowAgentAudio': 'Allow agents to generate audio',
|
|
142
143
|
'settings.autoSaveLibrary': 'Auto-save generated audio to the library',
|
|
144
|
+
'settings.maxConcurrent': 'Max concurrent generations (in-flight upstream calls, default 5)',
|
|
143
145
|
'settings.save': 'Save',
|
|
144
146
|
'settings.saving': 'Saving…',
|
|
145
147
|
'settings.discard': 'Discard',
|
|
@@ -271,8 +271,17 @@ export function bindAudiogenScope(fetchFn: typeof fetch = fetch): AudiogenScope
|
|
|
271
271
|
* Falls back to the legacy flat allow-list while no channels exist (upgrade
|
|
272
272
|
* path). Pure projection — no host calls.
|
|
273
273
|
*/
|
|
274
|
+
export interface ModelOption {
|
|
275
|
+
alias: string
|
|
276
|
+
category?: AudioModelCategory
|
|
277
|
+
/** 所属渠道 id/名称/preset(面板按渠道渲染参数与分组下拉)。 */
|
|
278
|
+
channelId: string
|
|
279
|
+
channelName: string
|
|
280
|
+
preset: string
|
|
281
|
+
}
|
|
282
|
+
|
|
274
283
|
export function audioModelOptions(config: AudiogenConfig | undefined): {
|
|
275
|
-
models:
|
|
284
|
+
models: ModelOption[]
|
|
276
285
|
defaultChannelId?: string
|
|
277
286
|
} {
|
|
278
287
|
const channels = config?.channels ?? []
|
|
@@ -283,14 +292,20 @@ export function audioModelOptions(config: AudiogenConfig | undefined): {
|
|
|
283
292
|
? config.defaultChannelId
|
|
284
293
|
: channels[0]!.id
|
|
285
294
|
const ordered = [defaultId, ...channels.filter(channel => channel.id !== defaultId).map(channel => channel.id)]
|
|
286
|
-
const models:
|
|
295
|
+
const models: ModelOption[] = []
|
|
287
296
|
const seen = new Set<string>()
|
|
288
297
|
for (const id of ordered) {
|
|
289
298
|
const channel = channels.find(candidate => candidate.id === id)!
|
|
290
299
|
for (const model of channel.models) {
|
|
291
300
|
if (model.alias === '' || seen.has(model.alias)) continue
|
|
292
301
|
seen.add(model.alias)
|
|
293
|
-
models.push({
|
|
302
|
+
models.push({
|
|
303
|
+
alias: model.alias,
|
|
304
|
+
...(model.category === undefined ? {} : { category: model.category }),
|
|
305
|
+
channelId: channel.id,
|
|
306
|
+
channelName: channel.name,
|
|
307
|
+
preset: channel.preset,
|
|
308
|
+
})
|
|
294
309
|
}
|
|
295
310
|
}
|
|
296
311
|
return models.length > 0 ? { models, defaultChannelId: defaultId } : { models: [], defaultChannelId: defaultId }
|