@adminforth/agent 1.43.0 → 1.43.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/build.log CHANGED
@@ -58,5 +58,5 @@ custom/speech_recognition_frontend/voiceActivityDetection.ts
58
58
  custom/speech_recognition_frontend/types/
59
59
  custom/speech_recognition_frontend/types/voice-activity-detection.d.ts
60
60
 
61
- sent 1,661,103 bytes received 860 bytes 3,323,926.00 bytes/sec
62
- total size is 1,657,187 speedup is 1.00
61
+ sent 1,661,185 bytes received 860 bytes 3,324,090.00 bytes/sec
62
+ total size is 1,657,269 speedup is 1.00
@@ -16,7 +16,7 @@ type StreamingAudioState = {
16
16
 
17
17
  let standByAudio: HTMLAudioElement | null = null;
18
18
  let isStandByAudioPlaying = false;
19
- function playStandByAudio() {
19
+ async function playStandByAudio() {
20
20
  if (!standByAudio) {
21
21
  standByAudio = new Audio(`/plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3`);
22
22
  standByAudio.addEventListener('ended', () => {
@@ -26,7 +26,7 @@ function playStandByAudio() {
26
26
  });
27
27
  }
28
28
  standByAudio.currentTime = 0;
29
- standByAudio.play()
29
+ await standByAudio.play();
30
30
  isStandByAudioPlaying = true;
31
31
  }
32
32
 
@@ -215,7 +215,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
215
215
  }
216
216
  }
217
217
 
218
- function setIsPlaying(value: boolean) {
218
+ async function setIsPlaying(value: boolean) {
219
219
  isPlaying = value;
220
220
 
221
221
  if (!currentAudio) {
@@ -228,7 +228,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
228
228
  return;
229
229
  }
230
230
  agentAudioMode.value = 'playingAgentResponse';
231
- void currentAudio.play().catch((error) => {
231
+ await void currentAudio.play().catch((error) => {
232
232
  console.error('Failed to play audio:', error);
233
233
  });
234
234
  }
@@ -43,8 +43,10 @@ export const useAgentStore = defineStore('agent', () => {
43
43
  const chatWidth = ref(DEFAULT_CHAT_WIDTH);
44
44
  const availableModes = ref<AgentMode[]>([]);
45
45
  const activeModeName = ref<string | null>(null);
46
- const { width: windowWidth } = useWindowSize();
47
-
46
+ const { width: viewportWidth } = useWindowSize({
47
+ type: 'visual',
48
+ includeScrollbar: false,
49
+ });
48
50
  const {
49
51
  currentChat,
50
52
  setCurrentChat,
@@ -131,7 +133,7 @@ export const useAgentStore = defineStore('agent', () => {
131
133
  setCurrentChat,
132
134
  });
133
135
 
134
- watch(() => windowWidth.value, (newWidth) => {
136
+ watch(() => viewportWidth.value, (newWidth) => {
135
137
  if (isFullScreen.value) {
136
138
  setChatWidth(newWidth, false);
137
139
  }
@@ -16,7 +16,7 @@ type StreamingAudioState = {
16
16
 
17
17
  let standByAudio: HTMLAudioElement | null = null;
18
18
  let isStandByAudioPlaying = false;
19
- function playStandByAudio() {
19
+ async function playStandByAudio() {
20
20
  if (!standByAudio) {
21
21
  standByAudio = new Audio(`/plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3`);
22
22
  standByAudio.addEventListener('ended', () => {
@@ -26,7 +26,7 @@ function playStandByAudio() {
26
26
  });
27
27
  }
28
28
  standByAudio.currentTime = 0;
29
- standByAudio.play()
29
+ await standByAudio.play();
30
30
  isStandByAudioPlaying = true;
31
31
  }
32
32
 
@@ -215,7 +215,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
215
215
  }
216
216
  }
217
217
 
218
- function setIsPlaying(value: boolean) {
218
+ async function setIsPlaying(value: boolean) {
219
219
  isPlaying = value;
220
220
 
221
221
  if (!currentAudio) {
@@ -228,7 +228,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
228
228
  return;
229
229
  }
230
230
  agentAudioMode.value = 'playingAgentResponse';
231
- void currentAudio.play().catch((error) => {
231
+ await void currentAudio.play().catch((error) => {
232
232
  console.error('Failed to play audio:', error);
233
233
  });
234
234
  }
@@ -43,8 +43,10 @@ export const useAgentStore = defineStore('agent', () => {
43
43
  const chatWidth = ref(DEFAULT_CHAT_WIDTH);
44
44
  const availableModes = ref<AgentMode[]>([]);
45
45
  const activeModeName = ref<string | null>(null);
46
- const { width: windowWidth } = useWindowSize();
47
-
46
+ const { width: viewportWidth } = useWindowSize({
47
+ type: 'visual',
48
+ includeScrollbar: false,
49
+ });
48
50
  const {
49
51
  currentChat,
50
52
  setCurrentChat,
@@ -131,7 +133,7 @@ export const useAgentStore = defineStore('agent', () => {
131
133
  setCurrentChat,
132
134
  });
133
135
 
134
- watch(() => windowWidth.value, (newWidth) => {
136
+ watch(() => viewportWidth.value, (newWidth) => {
135
137
  if (isFullScreen.value) {
136
138
  setChatWidth(newWidth, false);
137
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.43.0",
3
+ "version": "1.43.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",