@adminforth/agent 1.22.0 → 1.22.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/build.log CHANGED
@@ -38,5 +38,5 @@ custom/skills/fetch_data/SKILL.md
38
38
  custom/skills/mutate_data/
39
39
  custom/skills/mutate_data/SKILL.md
40
40
 
41
- sent 199,171 bytes received 562 bytes 399,466.00 bytes/sec
42
- total size is 196,867 speedup is 0.99
41
+ sent 199,157 bytes received 562 bytes 399,438.00 bytes/sec
42
+ total size is 196,887 speedup is 0.99
@@ -195,6 +195,7 @@ const props = defineProps<{
195
195
  defaultModeName: string | null;
196
196
  stickByDefault: boolean;
197
197
  }
198
+ adminUser: any
198
199
  }>();
199
200
 
200
201
  const chatSurface = useTemplateRef('chatSurface');
@@ -8,7 +8,7 @@
8
8
  <h3 :class="h3Style">{{ $t('Chat history') }}</h3>
9
9
  <div class="w-full flex items-center justify-center">
10
10
  <Button
11
- @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();"
11
+ @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput(); recalculateScroll();"
12
12
  :disabled="agentStore.isResponseInProgress"
13
13
  class="w-[90%] my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200"
14
14
  >
@@ -34,7 +34,7 @@
34
34
  'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId,
35
35
  'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress,
36
36
  }"
37
- @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
37
+ @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false); recalculateScroll();"
38
38
  :disabled="agentStore.isResponseInProgress"
39
39
  >
40
40
  <p class="truncate">{{ session.title || session.sessionId }}</p>
@@ -99,4 +99,13 @@ const groupedSessions = computed(() => {
99
99
  return Array.from(groups.values());
100
100
  });
101
101
 
102
+ const emit = defineEmits<{
103
+ (e: 'recalculateScroll'): void
104
+ }>()
105
+
106
+ function recalculateScroll() {
107
+ // Emit an event to notify the parent component to recalculate scroll
108
+ emit('recalculateScroll');
109
+ }
110
+
102
111
  </script>
@@ -524,10 +524,8 @@ export const useAgentStore = defineStore('agent', () => {
524
524
  if (!sessions.value[sessionId]) {
525
525
  await fetchSession(sessionId);
526
526
  }
527
- console.log('Set active session from sessions', sessionId, sessions.value[sessionId]);
528
527
  currentSession.value = sessions.value[sessionId];
529
528
  setCurrentChat(sessionId);
530
- console.log('Set active session chat', sessionId, currentSession.value);
531
529
  currentChat.value.messages = currentSession.value?.messages.map((m: any) => ({
532
530
  role: m.role,
533
531
  parts:[{
@@ -9,6 +9,7 @@
9
9
 
10
10
  <SessionsHistory
11
11
  :class="agentStore.isSessionHistoryOpen ? 'translate-x-0' : '-translate-x-full'"
12
+ @recalculateScroll="recalculateScroll"
12
13
  />
13
14
  <div
14
15
  v-if="agentStore.isSessionHistoryOpen"
@@ -51,18 +52,19 @@
51
52
 
52
53
 
53
54
  <script setup lang="ts">
54
- import Message from './Message.vue';
55
55
  import type { IMessage, IPart } from '../types';
56
- import { useTemplateRef, ref, defineAsyncComponent, onMounted, onUnmounted, watch, computed } from 'vue';
56
+ import { useTemplateRef, ref, defineAsyncComponent, onMounted, onUnmounted, watch, computed, nextTick } from 'vue';
57
57
  import { IconArrowDownOutline } from '@iconify-prerendered/vue-flowbite';
58
58
  import SessionsHistory from '../SessionsHistory.vue';
59
59
  import { useAgentStore } from '../composables/useAgentStore';
60
- import ToolsGroup from './ToolsGroup.vue';
61
60
  import { useAgentTransitions } from '../composables/useAgentTransitions';
62
- import { getMessageParts } from '../utils';
63
61
  import MessageRenderer from './MessageRenderer.vue';
64
62
  import CustomAutoScrollContainer from '../CustomAutoScrollContainer.vue';
65
63
 
64
+ const props = defineProps<{
65
+ messages: IMessage[]
66
+ }>();
67
+
66
68
  const scrollContainer = useTemplateRef('scrollContainer');
67
69
  const showScrollToBottomButton = ref(false);
68
70
  const innerScrollContainerRef = ref(null);
@@ -101,9 +103,4 @@ watch(clicks, () => {
101
103
  })
102
104
 
103
105
 
104
-
105
- const props = defineProps<{
106
- messages: IMessage[]
107
- }>();
108
-
109
106
  </script>
@@ -195,6 +195,7 @@ const props = defineProps<{
195
195
  defaultModeName: string | null;
196
196
  stickByDefault: boolean;
197
197
  }
198
+ adminUser: any
198
199
  }>();
199
200
 
200
201
  const chatSurface = useTemplateRef('chatSurface');
@@ -8,7 +8,7 @@
8
8
  <h3 :class="h3Style">{{ $t('Chat history') }}</h3>
9
9
  <div class="w-full flex items-center justify-center">
10
10
  <Button
11
- @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();"
11
+ @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput(); recalculateScroll();"
12
12
  :disabled="agentStore.isResponseInProgress"
13
13
  class="w-[90%] my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200"
14
14
  >
@@ -34,7 +34,7 @@
34
34
  'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId,
35
35
  'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress,
36
36
  }"
37
- @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
37
+ @click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false); recalculateScroll();"
38
38
  :disabled="agentStore.isResponseInProgress"
39
39
  >
40
40
  <p class="truncate">{{ session.title || session.sessionId }}</p>
@@ -99,4 +99,13 @@ const groupedSessions = computed(() => {
99
99
  return Array.from(groups.values());
100
100
  });
101
101
 
102
+ const emit = defineEmits<{
103
+ (e: 'recalculateScroll'): void
104
+ }>()
105
+
106
+ function recalculateScroll() {
107
+ // Emit an event to notify the parent component to recalculate scroll
108
+ emit('recalculateScroll');
109
+ }
110
+
102
111
  </script>
@@ -524,10 +524,8 @@ export const useAgentStore = defineStore('agent', () => {
524
524
  if (!sessions.value[sessionId]) {
525
525
  await fetchSession(sessionId);
526
526
  }
527
- console.log('Set active session from sessions', sessionId, sessions.value[sessionId]);
528
527
  currentSession.value = sessions.value[sessionId];
529
528
  setCurrentChat(sessionId);
530
- console.log('Set active session chat', sessionId, currentSession.value);
531
529
  currentChat.value.messages = currentSession.value?.messages.map((m: any) => ({
532
530
  role: m.role,
533
531
  parts:[{
@@ -9,6 +9,7 @@
9
9
 
10
10
  <SessionsHistory
11
11
  :class="agentStore.isSessionHistoryOpen ? 'translate-x-0' : '-translate-x-full'"
12
+ @recalculateScroll="recalculateScroll"
12
13
  />
13
14
  <div
14
15
  v-if="agentStore.isSessionHistoryOpen"
@@ -51,18 +52,19 @@
51
52
 
52
53
 
53
54
  <script setup lang="ts">
54
- import Message from './Message.vue';
55
55
  import type { IMessage, IPart } from '../types';
56
- import { useTemplateRef, ref, defineAsyncComponent, onMounted, onUnmounted, watch, computed } from 'vue';
56
+ import { useTemplateRef, ref, defineAsyncComponent, onMounted, onUnmounted, watch, computed, nextTick } from 'vue';
57
57
  import { IconArrowDownOutline } from '@iconify-prerendered/vue-flowbite';
58
58
  import SessionsHistory from '../SessionsHistory.vue';
59
59
  import { useAgentStore } from '../composables/useAgentStore';
60
- import ToolsGroup from './ToolsGroup.vue';
61
60
  import { useAgentTransitions } from '../composables/useAgentTransitions';
62
- import { getMessageParts } from '../utils';
63
61
  import MessageRenderer from './MessageRenderer.vue';
64
62
  import CustomAutoScrollContainer from '../CustomAutoScrollContainer.vue';
65
63
 
64
+ const props = defineProps<{
65
+ messages: IMessage[]
66
+ }>();
67
+
66
68
  const scrollContainer = useTemplateRef('scrollContainer');
67
69
  const showScrollToBottomButton = ref(false);
68
70
  const innerScrollContainerRef = ref(null);
@@ -101,9 +103,4 @@ watch(clicks, () => {
101
103
  })
102
104
 
103
105
 
104
-
105
- const props = defineProps<{
106
- messages: IMessage[]
107
- }>();
108
-
109
106
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",