@adminforth/agent 1.38.0 → 1.39.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/build.log +5 -4
- package/custom/composables/useAgentAudio.ts +18 -9
- package/dist/custom/composables/useAgentAudio.ts +18 -9
- package/package.json +1 -1
- /package/custom/{composables → public}/agentAudio/agent-processing.mp3 +0 -0
- /package/dist/custom/{composables → public}/agentAudio/agent-processing.mp3 +0 -0
package/build.log
CHANGED
|
@@ -18,8 +18,6 @@ custom/composables/
|
|
|
18
18
|
custom/composables/useAgentAudio.ts
|
|
19
19
|
custom/composables/useAgentStore.ts
|
|
20
20
|
custom/composables/useAgentTransitions.ts
|
|
21
|
-
custom/composables/agentAudio/
|
|
22
|
-
custom/composables/agentAudio/agent-processing.mp3
|
|
23
21
|
custom/composables/agentStore/
|
|
24
22
|
custom/composables/agentStore/constants.ts
|
|
25
23
|
custom/composables/agentStore/pageContext.ts
|
|
@@ -41,6 +39,9 @@ custom/incremark_code_renderers/IncremarkShikiCodeBlock.vue
|
|
|
41
39
|
custom/incremark_code_renderers/incremarkCodeHighlight.ts
|
|
42
40
|
custom/incremark_code_renderers/incremarkRenderer.ts
|
|
43
41
|
custom/incremark_code_renderers/renderIncremarkMarkdown.ts
|
|
42
|
+
custom/public/
|
|
43
|
+
custom/public/agentAudio/
|
|
44
|
+
custom/public/agentAudio/agent-processing.mp3
|
|
44
45
|
custom/skills/
|
|
45
46
|
custom/skills/analyze_data/
|
|
46
47
|
custom/skills/analyze_data/SKILL.md
|
|
@@ -57,5 +58,5 @@ custom/speech_recognition_frontend/voiceActivityDetection.ts
|
|
|
57
58
|
custom/speech_recognition_frontend/types/
|
|
58
59
|
custom/speech_recognition_frontend/types/voice-activity-detection.d.ts
|
|
59
60
|
|
|
60
|
-
sent 1,
|
|
61
|
-
total size is 1,652,
|
|
61
|
+
sent 1,656,225 bytes received 860 bytes 3,314,170.00 bytes/sec
|
|
62
|
+
total size is 1,652,309 speedup is 1.00
|
|
@@ -14,28 +14,36 @@ type StreamingAudioState = {
|
|
|
14
14
|
isDone: boolean;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
let standByAudio: HTMLAudioElement | null = null;
|
|
18
18
|
|
|
19
19
|
function playStandByAudio() {
|
|
20
|
+
if (!standByAudio) {
|
|
21
|
+
standByAudio = new Audio(`/plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3`);
|
|
22
|
+
standByAudio.addEventListener('ended', () => {
|
|
23
|
+
if (!standByAudio.paused) {
|
|
24
|
+
restartStandByAudio();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
20
28
|
standByAudio.currentTime = 0;
|
|
21
29
|
standByAudio.play()
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
function stopStandByAudio() {
|
|
33
|
+
if (!standByAudio) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
25
36
|
standByAudio.pause();
|
|
26
37
|
standByAudio.currentTime = 0;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
function restartStandByAudio() {
|
|
30
|
-
standByAudio
|
|
41
|
+
if (standByAudio) {
|
|
42
|
+
standByAudio.currentTime = 0;
|
|
43
|
+
}
|
|
31
44
|
playStandByAudio();
|
|
32
45
|
}
|
|
33
46
|
|
|
34
|
-
standByAudio.addEventListener('ended', () => {
|
|
35
|
-
if (!standByAudio.paused) {
|
|
36
|
-
restartStandByAudio();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
47
|
|
|
40
48
|
export const useAgentAudio = defineStore('agentAudio', () => {
|
|
41
49
|
const agentStore = useAgentStore();
|
|
@@ -164,7 +172,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
|
|
|
164
172
|
}
|
|
165
173
|
|
|
166
174
|
if (event.type === 'speech-response') {
|
|
167
|
-
|
|
175
|
+
stopStandByAudio();
|
|
168
176
|
agentStore.setCurrentChatStatus('ready');
|
|
169
177
|
agentStore.addAgentMessage(event.data.response.text);
|
|
170
178
|
agentAudioMode.value = 'playingAgentResponse';
|
|
@@ -189,7 +197,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
|
|
|
189
197
|
}
|
|
190
198
|
|
|
191
199
|
if (event.type === 'data-tool-call') {
|
|
192
|
-
|
|
200
|
+
playStandByAudio();
|
|
193
201
|
agentStore.addDataToolCallMessage(event.data);
|
|
194
202
|
}
|
|
195
203
|
}
|
|
@@ -330,6 +338,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
|
|
|
330
338
|
}
|
|
331
339
|
|
|
332
340
|
function stopCurrentAudioPlayback(dontResetMode = false) {
|
|
341
|
+
stopStandByAudio();
|
|
333
342
|
bufferedAudioChunks = [];
|
|
334
343
|
bufferedAudioMimeType = 'audio/mpeg';
|
|
335
344
|
detachStreamingAudio();
|
|
@@ -14,28 +14,36 @@ type StreamingAudioState = {
|
|
|
14
14
|
isDone: boolean;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
let standByAudio: HTMLAudioElement | null = null;
|
|
18
18
|
|
|
19
19
|
function playStandByAudio() {
|
|
20
|
+
if (!standByAudio) {
|
|
21
|
+
standByAudio = new Audio(`/plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3`);
|
|
22
|
+
standByAudio.addEventListener('ended', () => {
|
|
23
|
+
if (!standByAudio.paused) {
|
|
24
|
+
restartStandByAudio();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
20
28
|
standByAudio.currentTime = 0;
|
|
21
29
|
standByAudio.play()
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
function stopStandByAudio() {
|
|
33
|
+
if (!standByAudio) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
25
36
|
standByAudio.pause();
|
|
26
37
|
standByAudio.currentTime = 0;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
function restartStandByAudio() {
|
|
30
|
-
standByAudio
|
|
41
|
+
if (standByAudio) {
|
|
42
|
+
standByAudio.currentTime = 0;
|
|
43
|
+
}
|
|
31
44
|
playStandByAudio();
|
|
32
45
|
}
|
|
33
46
|
|
|
34
|
-
standByAudio.addEventListener('ended', () => {
|
|
35
|
-
if (!standByAudio.paused) {
|
|
36
|
-
restartStandByAudio();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
47
|
|
|
40
48
|
export const useAgentAudio = defineStore('agentAudio', () => {
|
|
41
49
|
const agentStore = useAgentStore();
|
|
@@ -164,7 +172,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
|
|
|
164
172
|
}
|
|
165
173
|
|
|
166
174
|
if (event.type === 'speech-response') {
|
|
167
|
-
|
|
175
|
+
stopStandByAudio();
|
|
168
176
|
agentStore.setCurrentChatStatus('ready');
|
|
169
177
|
agentStore.addAgentMessage(event.data.response.text);
|
|
170
178
|
agentAudioMode.value = 'playingAgentResponse';
|
|
@@ -189,7 +197,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
|
|
|
189
197
|
}
|
|
190
198
|
|
|
191
199
|
if (event.type === 'data-tool-call') {
|
|
192
|
-
|
|
200
|
+
playStandByAudio();
|
|
193
201
|
agentStore.addDataToolCallMessage(event.data);
|
|
194
202
|
}
|
|
195
203
|
}
|
|
@@ -330,6 +338,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
|
|
|
330
338
|
}
|
|
331
339
|
|
|
332
340
|
function stopCurrentAudioPlayback(dontResetMode = false) {
|
|
341
|
+
stopStandByAudio();
|
|
333
342
|
bufferedAudioChunks = [];
|
|
334
343
|
bufferedAudioMimeType = 'audio/mpeg';
|
|
335
344
|
detachStreamingAudio();
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|