@adminforth/agent 1.43.13 → 1.43.15

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
@@ -60,5 +60,5 @@ custom/speech_recognition_frontend/voiceActivityDetection.ts
60
60
  custom/speech_recognition_frontend/types/
61
61
  custom/speech_recognition_frontend/types/voice-activity-detection.d.ts
62
62
 
63
- sent 1,664,000 bytes received 875 bytes 3,329,750.00 bytes/sec
64
- total size is 1,659,985 speedup is 1.00
63
+ sent 1,665,464 bytes received 883 bytes 3,332,694.00 bytes/sec
64
+ total size is 1,661,449 speedup is 1.00
@@ -25,7 +25,7 @@ export async function unlockAudio() {
25
25
  if (isAudioUnlocked) {
26
26
  return;
27
27
  }
28
-
28
+ console.log('Unlocking audio context by playing silent audio');
29
29
  await ctx.resume();
30
30
 
31
31
  const buffer = ctx.createBuffer(1, 1, 22050);
@@ -35,13 +35,15 @@ export async function unlockAudio() {
35
35
  source.connect(ctx.destination);
36
36
  source.start(0);
37
37
  isAudioUnlocked = true;
38
+ console.log('Audio context unlocked');
38
39
  }
39
40
 
40
41
  export async function startStandByAudio() {
42
+ console.log('Starting standby audio');
41
43
  const response = await fetch(
42
44
  loadFile('plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3')
43
45
  );
44
-
46
+ console.log('Standby audio file loaded:, response:', response);
45
47
  const arrayBuffer = await response.arrayBuffer();
46
48
  const audioBuffer = await ctx.decodeAudioData(arrayBuffer);
47
49
 
@@ -50,7 +52,7 @@ export async function startStandByAudio() {
50
52
 
51
53
  source.buffer = audioBuffer;
52
54
  source.connect(ctx.destination);
53
-
55
+ console.log('Playing standby audio');
54
56
  source.start();
55
57
  }
56
58
 
@@ -81,6 +83,7 @@ export function playChatResponseCurrentChunks({
81
83
  playback: ChatResponseAudioPlayback;
82
84
  chunks: ArrayBuffer[];
83
85
  }) {
86
+ console.log('Playing chat response audio chunks:', chunks.length);
84
87
  void ctx.resume().catch(() => undefined);
85
88
 
86
89
  for (const chunk of chunks) {
@@ -133,7 +136,7 @@ export function finishChatResponseAudio(playback: ChatResponseAudioPlayback | nu
133
136
  if (!playback || playback.isStopped) {
134
137
  return;
135
138
  }
136
-
139
+ console.log('Finishing chat response audio playback');
137
140
  playback.isDone = true;
138
141
 
139
142
  if (playback.pendingSourceCount === 0) {
@@ -145,7 +148,7 @@ export function stopChatResponseAudio(playback: ChatResponseAudioPlayback | null
145
148
  if (!playback || playback.isStopped) {
146
149
  return;
147
150
  }
148
-
151
+ console.log('Stopping chat response audio playback');
149
152
  playback.isStopped = true;
150
153
 
151
154
  for (const source of playback.activeSources) {
@@ -207,6 +210,7 @@ function concatUint8Arrays(left: Uint8Array, right: Uint8Array) {
207
210
 
208
211
  export function endStandByAudio() {
209
212
  if (standbySource) {
213
+ console.log('Ending standby audio');
210
214
  standbySource.stop();
211
215
  standbySource = null;
212
216
  }
@@ -57,6 +57,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
57
57
  const fullPath = `${import.meta.env.VITE_ADMINFORTH_PUBLIC_PATH || ''}/adminapi/v1/agent/speech-response`;
58
58
  try {
59
59
  agentAudioMode.value = 'transcribing';
60
+ console.log('Sending audio to server for transcription and response generation');
60
61
  const res = await fetch(fullPath, {
61
62
  method: 'POST',
62
63
  body: formData,
@@ -137,12 +138,12 @@ export const useAgentAudio = defineStore('agentAudio', () => {
137
138
  .filter((line) => line.startsWith('data:'))
138
139
  .map((line) => line.slice(5).trimStart())
139
140
  .join('\n');
140
-
141
141
  if (!data || data === '[DONE]') {
142
142
  return;
143
143
  }
144
144
 
145
145
  const event = JSON.parse(data) as SpeechStreamEvent;
146
+ console.log('Received speech stream event type:', event.type);
146
147
 
147
148
  if (event.type === 'error') {
148
149
 
@@ -68,13 +68,14 @@
68
68
 
69
69
  <script setup lang="ts">
70
70
  import type { IMessage } from '../types';
71
- import { useTemplateRef, ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
71
+ import { useTemplateRef, ref, onMounted, onUnmounted, watch, nextTick, defineAsyncComponent } from 'vue';
72
72
  import { IconArrowDownOutline } from '@iconify-prerendered/vue-flowbite';
73
73
  import SessionsHistory from '../SessionsHistory.vue';
74
74
  import { useAgentStore } from '../composables/useAgentStore';
75
75
  import { useAgentTransitions } from '../composables/useAgentTransitions';
76
76
  import MessageRenderer from './MessageRenderer.vue';
77
- import CustomAutoScrollContainer from '../CustomAutoScrollContainer.vue';
77
+
78
+ const CustomAutoScrollContainer = defineAsyncComponent(() => import('../CustomAutoScrollContainer.vue'));
78
79
 
79
80
  const props = defineProps<{
80
81
  messages: IMessage[]
@@ -1,12 +1,22 @@
1
1
  <template>
2
- <template v-if="ToolOrReasoningParts.length > 0 || isResponseInProgress || showFakeThinkingMessage">
2
+ <template v-if="ToolOrReasoningParts.length > 0 || inProgress">
3
3
  <div
4
- class="ml-2 px-4 flex items-center gap-1 cursor-pointer select-none hover:opacity-80 tracking-wide font-medium text-sm text-listTableHeadingText dark:text-darkListTableHeadingText"
4
+ class="shine-text-container ml-2 px-4 flex items-center gap-1 cursor-pointer select-none hover:opacity-80 tracking-wide font-medium text-sm text-listTableHeadingText dark:text-darkListTableHeadingText"
5
5
  @click="isExpanded = !isExpanded"
6
6
  >
7
- {{ $t('Thoughts') }}
7
+ <p
8
+ :class="[
9
+ inProgress ? `
10
+ shine-text text-listTableHeadingText dark:text-darkListTableHeadingText
11
+ bg-[linear-gradient(-65deg,currentColor,_rgb(120,120,120)_50%,currentColor)]
12
+ dark:bg-[linear-gradient(-65deg,currentColor,_rgb(250,250,250,0.8)_70%,currentColor)]
13
+ `
14
+ : '']"
15
+ >
16
+ {{ $t('Thoughts') }}
17
+ </p>
8
18
  <span v-if="thinkingDuration > 0">({{ (thinkingDuration/1000).toFixed(2) }} s)</span>
9
- <ThreeDotsAnimation v-if="isResponseInProgress || showFakeThinkingMessage" />
19
+ <!-- <ThreeDotsAnimation v-if="inProgress" /> -->
10
20
  <IconAngleDownOutline
11
21
  :class="isExpanded ? 'rotate-180' : 'rotate-0'"
12
22
  class="transition-transform duration-200"
@@ -40,14 +50,15 @@
40
50
 
41
51
  <script setup lang="ts">
42
52
  import type { IFormattedToolCallPart, IMessage, IPart, IToolGroup } from '../types';
43
- import { ref, computed, watch, onUnmounted, onMounted } from 'vue';
53
+ import { ref, computed, watch, onUnmounted, onMounted, defineAsyncComponent } from 'vue';
44
54
  import ReasoningRenderer from './ReasoningRenderer.vue';
45
55
  import { IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
46
56
  import ThreeDotsAnimation from './ThreeDotsAnimation.vue';
47
57
  import { useAgentStore } from '../composables/useAgentStore';
48
58
  import { getMessageParts } from '../utils';
49
59
  import ToolsGroup from './ToolsGroup.vue';
50
- import CustomAutoScrollContainer from '../CustomAutoScrollContainer.vue';
60
+
61
+ const CustomAutoScrollContainer = defineAsyncComponent(() => import('../CustomAutoScrollContainer.vue'));
51
62
 
52
63
  const props = defineProps<{
53
64
  message: IMessage
@@ -73,6 +84,10 @@
73
84
  return false;
74
85
  })
75
86
 
87
+ const inProgress = computed(() => {
88
+ return isResponseInProgress.value || showFakeThinkingMessage.value;
89
+ })
90
+
76
91
  onMounted(() => {
77
92
  thinkingStartTime.value = Date.now();
78
93
  if (isResponseInProgress.value) {
@@ -224,5 +239,24 @@
224
239
  max-height: 192px;
225
240
  }
226
241
  }
227
-
242
+
243
+
244
+ .shine-text {
245
+
246
+ background-clip: text;
247
+ -webkit-background-clip: text;
248
+ -webkit-text-fill-color: transparent;
249
+ background-position: -12rem;
250
+ }
251
+
252
+ .shine-text {
253
+ animation: shineText 6s infinite linear;
254
+ }
255
+
256
+ @keyframes shineText {
257
+ to {
258
+ background-position: -100%;
259
+ }
260
+ }
261
+
228
262
  </style>
@@ -25,7 +25,7 @@ export async function unlockAudio() {
25
25
  if (isAudioUnlocked) {
26
26
  return;
27
27
  }
28
-
28
+ console.log('Unlocking audio context by playing silent audio');
29
29
  await ctx.resume();
30
30
 
31
31
  const buffer = ctx.createBuffer(1, 1, 22050);
@@ -35,13 +35,15 @@ export async function unlockAudio() {
35
35
  source.connect(ctx.destination);
36
36
  source.start(0);
37
37
  isAudioUnlocked = true;
38
+ console.log('Audio context unlocked');
38
39
  }
39
40
 
40
41
  export async function startStandByAudio() {
42
+ console.log('Starting standby audio');
41
43
  const response = await fetch(
42
44
  loadFile('plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3')
43
45
  );
44
-
46
+ console.log('Standby audio file loaded:, response:', response);
45
47
  const arrayBuffer = await response.arrayBuffer();
46
48
  const audioBuffer = await ctx.decodeAudioData(arrayBuffer);
47
49
 
@@ -50,7 +52,7 @@ export async function startStandByAudio() {
50
52
 
51
53
  source.buffer = audioBuffer;
52
54
  source.connect(ctx.destination);
53
-
55
+ console.log('Playing standby audio');
54
56
  source.start();
55
57
  }
56
58
 
@@ -81,6 +83,7 @@ export function playChatResponseCurrentChunks({
81
83
  playback: ChatResponseAudioPlayback;
82
84
  chunks: ArrayBuffer[];
83
85
  }) {
86
+ console.log('Playing chat response audio chunks:', chunks.length);
84
87
  void ctx.resume().catch(() => undefined);
85
88
 
86
89
  for (const chunk of chunks) {
@@ -133,7 +136,7 @@ export function finishChatResponseAudio(playback: ChatResponseAudioPlayback | nu
133
136
  if (!playback || playback.isStopped) {
134
137
  return;
135
138
  }
136
-
139
+ console.log('Finishing chat response audio playback');
137
140
  playback.isDone = true;
138
141
 
139
142
  if (playback.pendingSourceCount === 0) {
@@ -145,7 +148,7 @@ export function stopChatResponseAudio(playback: ChatResponseAudioPlayback | null
145
148
  if (!playback || playback.isStopped) {
146
149
  return;
147
150
  }
148
-
151
+ console.log('Stopping chat response audio playback');
149
152
  playback.isStopped = true;
150
153
 
151
154
  for (const source of playback.activeSources) {
@@ -207,6 +210,7 @@ function concatUint8Arrays(left: Uint8Array, right: Uint8Array) {
207
210
 
208
211
  export function endStandByAudio() {
209
212
  if (standbySource) {
213
+ console.log('Ending standby audio');
210
214
  standbySource.stop();
211
215
  standbySource = null;
212
216
  }
@@ -57,6 +57,7 @@ export const useAgentAudio = defineStore('agentAudio', () => {
57
57
  const fullPath = `${import.meta.env.VITE_ADMINFORTH_PUBLIC_PATH || ''}/adminapi/v1/agent/speech-response`;
58
58
  try {
59
59
  agentAudioMode.value = 'transcribing';
60
+ console.log('Sending audio to server for transcription and response generation');
60
61
  const res = await fetch(fullPath, {
61
62
  method: 'POST',
62
63
  body: formData,
@@ -137,12 +138,12 @@ export const useAgentAudio = defineStore('agentAudio', () => {
137
138
  .filter((line) => line.startsWith('data:'))
138
139
  .map((line) => line.slice(5).trimStart())
139
140
  .join('\n');
140
-
141
141
  if (!data || data === '[DONE]') {
142
142
  return;
143
143
  }
144
144
 
145
145
  const event = JSON.parse(data) as SpeechStreamEvent;
146
+ console.log('Received speech stream event type:', event.type);
146
147
 
147
148
  if (event.type === 'error') {
148
149
 
@@ -68,13 +68,14 @@
68
68
 
69
69
  <script setup lang="ts">
70
70
  import type { IMessage } from '../types';
71
- import { useTemplateRef, ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
71
+ import { useTemplateRef, ref, onMounted, onUnmounted, watch, nextTick, defineAsyncComponent } from 'vue';
72
72
  import { IconArrowDownOutline } from '@iconify-prerendered/vue-flowbite';
73
73
  import SessionsHistory from '../SessionsHistory.vue';
74
74
  import { useAgentStore } from '../composables/useAgentStore';
75
75
  import { useAgentTransitions } from '../composables/useAgentTransitions';
76
76
  import MessageRenderer from './MessageRenderer.vue';
77
- import CustomAutoScrollContainer from '../CustomAutoScrollContainer.vue';
77
+
78
+ const CustomAutoScrollContainer = defineAsyncComponent(() => import('../CustomAutoScrollContainer.vue'));
78
79
 
79
80
  const props = defineProps<{
80
81
  messages: IMessage[]
@@ -1,12 +1,22 @@
1
1
  <template>
2
- <template v-if="ToolOrReasoningParts.length > 0 || isResponseInProgress || showFakeThinkingMessage">
2
+ <template v-if="ToolOrReasoningParts.length > 0 || inProgress">
3
3
  <div
4
- class="ml-2 px-4 flex items-center gap-1 cursor-pointer select-none hover:opacity-80 tracking-wide font-medium text-sm text-listTableHeadingText dark:text-darkListTableHeadingText"
4
+ class="shine-text-container ml-2 px-4 flex items-center gap-1 cursor-pointer select-none hover:opacity-80 tracking-wide font-medium text-sm text-listTableHeadingText dark:text-darkListTableHeadingText"
5
5
  @click="isExpanded = !isExpanded"
6
6
  >
7
- {{ $t('Thoughts') }}
7
+ <p
8
+ :class="[
9
+ inProgress ? `
10
+ shine-text text-listTableHeadingText dark:text-darkListTableHeadingText
11
+ bg-[linear-gradient(-65deg,currentColor,_rgb(120,120,120)_50%,currentColor)]
12
+ dark:bg-[linear-gradient(-65deg,currentColor,_rgb(250,250,250,0.8)_70%,currentColor)]
13
+ `
14
+ : '']"
15
+ >
16
+ {{ $t('Thoughts') }}
17
+ </p>
8
18
  <span v-if="thinkingDuration > 0">({{ (thinkingDuration/1000).toFixed(2) }} s)</span>
9
- <ThreeDotsAnimation v-if="isResponseInProgress || showFakeThinkingMessage" />
19
+ <!-- <ThreeDotsAnimation v-if="inProgress" /> -->
10
20
  <IconAngleDownOutline
11
21
  :class="isExpanded ? 'rotate-180' : 'rotate-0'"
12
22
  class="transition-transform duration-200"
@@ -40,14 +50,15 @@
40
50
 
41
51
  <script setup lang="ts">
42
52
  import type { IFormattedToolCallPart, IMessage, IPart, IToolGroup } from '../types';
43
- import { ref, computed, watch, onUnmounted, onMounted } from 'vue';
53
+ import { ref, computed, watch, onUnmounted, onMounted, defineAsyncComponent } from 'vue';
44
54
  import ReasoningRenderer from './ReasoningRenderer.vue';
45
55
  import { IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
46
56
  import ThreeDotsAnimation from './ThreeDotsAnimation.vue';
47
57
  import { useAgentStore } from '../composables/useAgentStore';
48
58
  import { getMessageParts } from '../utils';
49
59
  import ToolsGroup from './ToolsGroup.vue';
50
- import CustomAutoScrollContainer from '../CustomAutoScrollContainer.vue';
60
+
61
+ const CustomAutoScrollContainer = defineAsyncComponent(() => import('../CustomAutoScrollContainer.vue'));
51
62
 
52
63
  const props = defineProps<{
53
64
  message: IMessage
@@ -73,6 +84,10 @@
73
84
  return false;
74
85
  })
75
86
 
87
+ const inProgress = computed(() => {
88
+ return isResponseInProgress.value || showFakeThinkingMessage.value;
89
+ })
90
+
76
91
  onMounted(() => {
77
92
  thinkingStartTime.value = Date.now();
78
93
  if (isResponseInProgress.value) {
@@ -224,5 +239,24 @@
224
239
  max-height: 192px;
225
240
  }
226
241
  }
227
-
242
+
243
+
244
+ .shine-text {
245
+
246
+ background-clip: text;
247
+ -webkit-background-clip: text;
248
+ -webkit-text-fill-color: transparent;
249
+ background-position: -12rem;
250
+ }
251
+
252
+ .shine-text {
253
+ animation: shineText 6s infinite linear;
254
+ }
255
+
256
+ @keyframes shineText {
257
+ to {
258
+ background-position: -100%;
259
+ }
260
+ }
261
+
228
262
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.43.13",
3
+ "version": "1.43.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",