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.
@@ -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: Array<{ alias: string; category?: AudioModelCategory }>
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: Array<{ alias: string; category?: AudioModelCategory }> = []
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({ alias: model.alias, ...(model.category === undefined ? {} : { category: model.category }) })
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 }