@adminforth/agent 1.33.1 → 1.34.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 CHANGED
@@ -40,5 +40,5 @@ custom/skills/fetch_data/SKILL.md
40
40
  custom/skills/mutate_data/
41
41
  custom/skills/mutate_data/SKILL.md
42
42
 
43
- sent 211,007 bytes received 585 bytes 423,184.00 bytes/sec
44
- total size is 208,637 speedup is 0.99
43
+ sent 210,673 bytes received 585 bytes 422,516.00 bytes/sec
44
+ total size is 208,263 speedup is 0.99
@@ -88,7 +88,6 @@
88
88
  <div class="flex items-center justify-center">
89
89
  <Button
90
90
  @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();"
91
- :disabled="agentStore.isResponseInProgress"
92
91
  class="!py-1 !px-2 rounded-3xl text-gray-800 dark:text-gray-200 max-w-64 mr-2"
93
92
  >
94
93
  <IconPlusOutline class="w-5 h-5" />
@@ -9,10 +9,6 @@
9
9
  <div class="w-full flex items-center justify-center">
10
10
  </div>
11
11
  <div class="w-full border-b border-gray-200 dark:border-gray-700"/>
12
- <div class="absolute w-full h-full flex flex-col items-center justify-center bg-gray-100/50 dark:bg-gray-700/50 z-10" v-if="agentStore.isResponseInProgress">
13
- <Spinner class="w-8 h-8" v-if="agentStore.isResponseInProgress" />
14
- <p class="mt-2 text-gray-800 dark:text-gray-200">{{ $t('Generation in progress...') }}</p>
15
- </div>
16
12
  <div v-for="group in groupedSessions" :key="group.dayKey" class="w-full py-2">
17
13
  <div class="px-4 pb-2 text-xs font-semibold uppercase tracking-[0.2em] text-gray-500 dark:text-gray-400">
18
14
  {{ group.label }}
@@ -24,10 +20,8 @@
24
20
  class=" flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200"
25
21
  :class="{
26
22
  'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId,
27
- 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress,
28
23
  }"
29
24
  @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
30
- :disabled="agentStore.isResponseInProgress"
31
25
  >
32
26
  <p class="truncate">{{ session.title || session.sessionId }}</p>
33
27
  <div @click.stop="agentStore.deleteSession(session.sessionId)" class="w-7 h-7 p-1 hover:scale-110 hover:bg-gray-200 dark:hover:bg-gray-500 flex items-center justify-center rounded">
@@ -60,6 +60,10 @@ export const useAgentStore = defineStore('agent', () => {
60
60
  const activeModeName = ref<string | null>(null);
61
61
  const hasTypedMessageInPageSession = ref(false);
62
62
  const { width: windowWidth } = useWindowSize();
63
+
64
+ const chats = new Map<string, Chat<any>>();
65
+ const currentChat = shallowRef<Chat<any>>();
66
+
63
67
  let placeholderAnimationTimer: ReturnType<typeof setTimeout> | null = null;
64
68
 
65
69
  function setLocalStorageItem(key: string, value: string) {
@@ -189,8 +193,6 @@ export const useAgentStore = defineStore('agent', () => {
189
193
  }
190
194
  }
191
195
  })
192
- const chats = new Map<string, Chat<any>>();
193
- const currentChat = shallowRef<Chat<any>>();
194
196
 
195
197
  function setAvailableModes(modes: AgentMode[], defaultModeName?: string | null) {
196
198
  availableModes.value = modes;
@@ -549,14 +551,16 @@ export const useAgentStore = defineStore('agent', () => {
549
551
  }
550
552
  currentSession.value = sessions.value[sessionId];
551
553
  setCurrentChat(sessionId);
552
- currentChat.value.messages = currentSession.value?.messages.map((m: any) => ({
553
- role: m.role,
554
- parts:[{
555
- type: 'text',
556
- text: m.text,
557
- state: 'done',
558
- }]
559
- }));
554
+ if (currentChat.value.messages.length === 0) {
555
+ currentChat.value.messages = currentSession.value?.messages.map((m: any) => ({
556
+ role: m.role,
557
+ parts:[{
558
+ type: 'text',
559
+ text: m.text,
560
+ state: 'done',
561
+ }]
562
+ }));
563
+ }
560
564
  }
561
565
 
562
566
  async function fetchSessionsList() {
@@ -74,6 +74,11 @@
74
74
 
75
75
  onMounted(() => {
76
76
  thinkingStartTime.value = Date.now();
77
+ if (isResponseInProgress.value) {
78
+ isExpanded.value = true;
79
+ } else {
80
+ isExpanded.value = false;
81
+ }
77
82
  })
78
83
 
79
84
  onUnmounted(() => {
@@ -17,12 +17,12 @@
17
17
  :incremark-options="incremarkOptions"
18
18
  />
19
19
  <p v-else class="text-red-500 py-2">
20
- {{ $t('Error occurred') }}
20
+ {{ $t('No content to render') }}
21
21
  </p>
22
22
  </div>
23
23
  </template>
24
24
 
25
- <script setup lang="ts">const isExpanded = ref(true);
25
+ <script setup lang="ts">
26
26
 
27
27
  import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
28
28
  import { useRouter } from 'vue-router';
@@ -88,7 +88,6 @@
88
88
  <div class="flex items-center justify-center">
89
89
  <Button
90
90
  @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();"
91
- :disabled="agentStore.isResponseInProgress"
92
91
  class="!py-1 !px-2 rounded-3xl text-gray-800 dark:text-gray-200 max-w-64 mr-2"
93
92
  >
94
93
  <IconPlusOutline class="w-5 h-5" />
@@ -9,10 +9,6 @@
9
9
  <div class="w-full flex items-center justify-center">
10
10
  </div>
11
11
  <div class="w-full border-b border-gray-200 dark:border-gray-700"/>
12
- <div class="absolute w-full h-full flex flex-col items-center justify-center bg-gray-100/50 dark:bg-gray-700/50 z-10" v-if="agentStore.isResponseInProgress">
13
- <Spinner class="w-8 h-8" v-if="agentStore.isResponseInProgress" />
14
- <p class="mt-2 text-gray-800 dark:text-gray-200">{{ $t('Generation in progress...') }}</p>
15
- </div>
16
12
  <div v-for="group in groupedSessions" :key="group.dayKey" class="w-full py-2">
17
13
  <div class="px-4 pb-2 text-xs font-semibold uppercase tracking-[0.2em] text-gray-500 dark:text-gray-400">
18
14
  {{ group.label }}
@@ -24,10 +20,8 @@
24
20
  class=" flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200"
25
21
  :class="{
26
22
  'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId,
27
- 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress,
28
23
  }"
29
24
  @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
30
- :disabled="agentStore.isResponseInProgress"
31
25
  >
32
26
  <p class="truncate">{{ session.title || session.sessionId }}</p>
33
27
  <div @click.stop="agentStore.deleteSession(session.sessionId)" class="w-7 h-7 p-1 hover:scale-110 hover:bg-gray-200 dark:hover:bg-gray-500 flex items-center justify-center rounded">
@@ -60,6 +60,10 @@ export const useAgentStore = defineStore('agent', () => {
60
60
  const activeModeName = ref<string | null>(null);
61
61
  const hasTypedMessageInPageSession = ref(false);
62
62
  const { width: windowWidth } = useWindowSize();
63
+
64
+ const chats = new Map<string, Chat<any>>();
65
+ const currentChat = shallowRef<Chat<any>>();
66
+
63
67
  let placeholderAnimationTimer: ReturnType<typeof setTimeout> | null = null;
64
68
 
65
69
  function setLocalStorageItem(key: string, value: string) {
@@ -189,8 +193,6 @@ export const useAgentStore = defineStore('agent', () => {
189
193
  }
190
194
  }
191
195
  })
192
- const chats = new Map<string, Chat<any>>();
193
- const currentChat = shallowRef<Chat<any>>();
194
196
 
195
197
  function setAvailableModes(modes: AgentMode[], defaultModeName?: string | null) {
196
198
  availableModes.value = modes;
@@ -549,14 +551,16 @@ export const useAgentStore = defineStore('agent', () => {
549
551
  }
550
552
  currentSession.value = sessions.value[sessionId];
551
553
  setCurrentChat(sessionId);
552
- currentChat.value.messages = currentSession.value?.messages.map((m: any) => ({
553
- role: m.role,
554
- parts:[{
555
- type: 'text',
556
- text: m.text,
557
- state: 'done',
558
- }]
559
- }));
554
+ if (currentChat.value.messages.length === 0) {
555
+ currentChat.value.messages = currentSession.value?.messages.map((m: any) => ({
556
+ role: m.role,
557
+ parts:[{
558
+ type: 'text',
559
+ text: m.text,
560
+ state: 'done',
561
+ }]
562
+ }));
563
+ }
560
564
  }
561
565
 
562
566
  async function fetchSessionsList() {
@@ -74,6 +74,11 @@
74
74
 
75
75
  onMounted(() => {
76
76
  thinkingStartTime.value = Date.now();
77
+ if (isResponseInProgress.value) {
78
+ isExpanded.value = true;
79
+ } else {
80
+ isExpanded.value = false;
81
+ }
77
82
  })
78
83
 
79
84
  onUnmounted(() => {
@@ -17,12 +17,12 @@
17
17
  :incremark-options="incremarkOptions"
18
18
  />
19
19
  <p v-else class="text-red-500 py-2">
20
- {{ $t('Error occurred') }}
20
+ {{ $t('No content to render') }}
21
21
  </p>
22
22
  </div>
23
23
  </template>
24
24
 
25
- <script setup lang="ts">const isExpanded = ref(true);
25
+ <script setup lang="ts">
26
26
 
27
27
  import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
28
28
  import { useRouter } from 'vue-router';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.33.1",
3
+ "version": "1.34.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",