qwen-audio-agent 1.1.0 → 1.1.1
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/cli/package.json
CHANGED
package/package.json
CHANGED
package/server/package.json
CHANGED
|
@@ -263,8 +263,7 @@ export class Coordinator {
|
|
|
263
263
|
return {
|
|
264
264
|
content: decision.presentation.speech,
|
|
265
265
|
metadata: {
|
|
266
|
-
|
|
267
|
-
decision,
|
|
266
|
+
presentation: decision.presentation,
|
|
268
267
|
},
|
|
269
268
|
}
|
|
270
269
|
}
|
|
@@ -289,8 +288,7 @@ export class Coordinator {
|
|
|
289
288
|
return {
|
|
290
289
|
content: decision.presentation.speech,
|
|
291
290
|
metadata: {
|
|
292
|
-
|
|
293
|
-
decision,
|
|
291
|
+
presentation: decision.presentation,
|
|
294
292
|
},
|
|
295
293
|
}
|
|
296
294
|
}
|
|
@@ -12,11 +12,14 @@ const sourceRoot = resolve(here, '../../..')
|
|
|
12
12
|
const root = process.env.QWEN_AUDIO_AGENT_RUNTIME_ROOT || sourceRoot
|
|
13
13
|
const runtimeEnvironment = loadRuntimeEnvironment({ root })
|
|
14
14
|
|
|
15
|
-
function numberSetting(value, fallback, {
|
|
15
|
+
export function numberSetting(value, fallback, {
|
|
16
16
|
min = Number.NEGATIVE_INFINITY,
|
|
17
17
|
max = Number.POSITIVE_INFINITY,
|
|
18
18
|
} = {}) {
|
|
19
|
-
|
|
19
|
+
if (value === null || value === undefined) return fallback
|
|
20
|
+
const source = typeof value === 'string' ? value.trim() : value
|
|
21
|
+
if (source === '') return fallback
|
|
22
|
+
const parsed = Number(source)
|
|
20
23
|
if (!Number.isFinite(parsed)) return fallback
|
|
21
24
|
return Math.min(max, Math.max(min, parsed))
|
|
22
25
|
}
|
|
@@ -13,6 +13,28 @@ const ACTIVE = new Set([
|
|
|
13
13
|
const CANCELLABLE = new Set(['queued', 'running', 'delegated', 'finalizing'])
|
|
14
14
|
const TERMINAL = new Set(['completed', 'failed', 'cancelled'])
|
|
15
15
|
|
|
16
|
+
function publicResultMetadata(metadata) {
|
|
17
|
+
if (!metadata || typeof metadata !== 'object') return null
|
|
18
|
+
const source = metadata.presentation || metadata.decision?.presentation
|
|
19
|
+
if (!source || typeof source !== 'object') return null
|
|
20
|
+
const inline = source.inline && typeof source.inline === 'object'
|
|
21
|
+
&& typeof source.inline.content === 'string'
|
|
22
|
+
&& source.inline.content.trim()
|
|
23
|
+
? {
|
|
24
|
+
title: typeof source.inline.title === 'string'
|
|
25
|
+
? source.inline.title.slice(0, 120)
|
|
26
|
+
: '',
|
|
27
|
+
format: ['markdown', 'code', 'link'].includes(source.inline.format)
|
|
28
|
+
? source.inline.format
|
|
29
|
+
: 'markdown',
|
|
30
|
+
content: source.inline.content,
|
|
31
|
+
}
|
|
32
|
+
: null
|
|
33
|
+
const speech = typeof source.speech === 'string' ? source.speech : ''
|
|
34
|
+
if (!speech && !inline) return null
|
|
35
|
+
return { presentation: { speech, inline } }
|
|
36
|
+
}
|
|
37
|
+
|
|
16
38
|
function publicTask(task) {
|
|
17
39
|
const now = Date.now()
|
|
18
40
|
return {
|
|
@@ -34,7 +56,7 @@ function publicTask(task) {
|
|
|
34
56
|
: task.elapsedMs,
|
|
35
57
|
result: task.result,
|
|
36
58
|
error: task.error,
|
|
37
|
-
resultMetadata: task.resultMetadata
|
|
59
|
+
resultMetadata: publicResultMetadata(task.resultMetadata),
|
|
38
60
|
activity: [...(task.activity || [])],
|
|
39
61
|
delegation: task.delegation
|
|
40
62
|
? {
|