@adminforth/agent 1.22.0 → 1.22.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
@@ -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,703 bytes received 562 bytes 400,530.00 bytes/sec
42
+ total size is 197,399 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>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <template v-if="ToolOrReasoningParts.length > 0 || isResponseInProgress || showFakeThinkingMessage">
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"
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"
5
5
  @click="isExpanded = !isExpanded"
6
6
  >
7
7
  Thoughts
@@ -20,7 +20,7 @@
20
20
  v-show="isExpanded"
21
21
  class="mask-y"
22
22
  >
23
- <ol class="ml-8 relative border-l border-l-2 border-black border-default">
23
+ <ol class="ml-8 relative border-l border-l-2 border-black border-default border-listTableHeadingText dark:border-darkListTableHeadingText">
24
24
  <li class="mb-6 ms-2 z-50" v-for="(part, index) in ToolOrReasoningParts" :key="index">
25
25
  <ReasoningRenderer v-if="part.type === 'reasoning'" :state="part.state" :text="part.text" />
26
26
  <ToolsGroup v-else :toolGroup="groupToolCallParts(message, part)" />
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <span class="bg-lightNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar ring-default">
2
+ <span class="bg-lightNavbar dark:bg-darkNavbar absolute flex items-center text-listTableHeadingText dark:text-darkListTableHeadingText justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar ring-default">
3
3
  <div class="w-5 h-5 rounded-full flex items-center justify-center">
4
4
  <IconBrainOutline class="w-4 h-4" />
5
5
  </div>
6
6
  </span>
7
7
  <h3
8
- class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 cursor-pointer select-none hover:opacity-80"
8
+ class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 cursor-pointer select-none hover:opacity-80 text-listTableHeadingText dark:text-darkListTableHeadingText"
9
9
  @click="isExpanded = !isExpanded"
10
10
  >
11
11
  <span class="font-semibold">{{ reasoningTitle }}</span>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <span class="bounce-dot1 rounded-full w-2 h-2 bg-lightPrimary"></span>
3
- <span class="bounce-dot2 rounded-full w-2 h-2 bg-lightPrimary"></span>
4
- <span class="bounce-dot3 rounded-full w-2 h-2 bg-lightPrimary"></span>
2
+ <span class="bounce-dot1 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
3
+ <span class="bounce-dot2 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
4
+ <span class="bounce-dot3 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
5
5
  </template>
6
6
 
7
7
  <style scoped>
@@ -19,7 +19,7 @@
19
19
  class="flex items-center gap-1 cursor-pointer"
20
20
  @click="toggleInputOutput()"
21
21
  >
22
- <div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-white/70 dark:bg-blue-700/20">
22
+ <div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-lightNavbar dark:bg-darkNavbar">
23
23
  <Spinner v-if="isRunning" class="h-4 w-4" />
24
24
  <IconCheckOutline v-else class="h-4 w-4 text-lightPrimary dark:text-darkPrimary" />
25
25
  </div>
@@ -1,12 +1,12 @@
1
1
  <template >
2
2
  <template v-if="toolGroup.length > 0">
3
- <span class="bg-lightNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar ring-default">
3
+ <span class="text-listTableHeadingText dark:text-darkListTableHeadingText bg-lightNavbar dark:bg-darkNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar ring-default">
4
4
  <div class="w-5 h-5 rounded-full flex items-center justify-center">
5
5
  <IconWrenchSolid class="w-4 h-4" />
6
6
  </div>
7
7
  </span>
8
8
  <h3
9
- class="flex items-center mb-1 text-sm my-2 ml-3 gap-1"
9
+ class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 text-listTableHeadingText dark:text-darkListTableHeadingText"
10
10
  >
11
11
  <span class="font-semibold select-none ">Call tools</span>
12
12
  </h3>
@@ -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>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <template v-if="ToolOrReasoningParts.length > 0 || isResponseInProgress || showFakeThinkingMessage">
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"
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"
5
5
  @click="isExpanded = !isExpanded"
6
6
  >
7
7
  Thoughts
@@ -20,7 +20,7 @@
20
20
  v-show="isExpanded"
21
21
  class="mask-y"
22
22
  >
23
- <ol class="ml-8 relative border-l border-l-2 border-black border-default">
23
+ <ol class="ml-8 relative border-l border-l-2 border-black border-default border-listTableHeadingText dark:border-darkListTableHeadingText">
24
24
  <li class="mb-6 ms-2 z-50" v-for="(part, index) in ToolOrReasoningParts" :key="index">
25
25
  <ReasoningRenderer v-if="part.type === 'reasoning'" :state="part.state" :text="part.text" />
26
26
  <ToolsGroup v-else :toolGroup="groupToolCallParts(message, part)" />
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <span class="bg-lightNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar ring-default">
2
+ <span class="bg-lightNavbar dark:bg-darkNavbar absolute flex items-center text-listTableHeadingText dark:text-darkListTableHeadingText justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar ring-default">
3
3
  <div class="w-5 h-5 rounded-full flex items-center justify-center">
4
4
  <IconBrainOutline class="w-4 h-4" />
5
5
  </div>
6
6
  </span>
7
7
  <h3
8
- class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 cursor-pointer select-none hover:opacity-80"
8
+ class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 cursor-pointer select-none hover:opacity-80 text-listTableHeadingText dark:text-darkListTableHeadingText"
9
9
  @click="isExpanded = !isExpanded"
10
10
  >
11
11
  <span class="font-semibold">{{ reasoningTitle }}</span>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <span class="bounce-dot1 rounded-full w-2 h-2 bg-lightPrimary"></span>
3
- <span class="bounce-dot2 rounded-full w-2 h-2 bg-lightPrimary"></span>
4
- <span class="bounce-dot3 rounded-full w-2 h-2 bg-lightPrimary"></span>
2
+ <span class="bounce-dot1 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
3
+ <span class="bounce-dot2 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
4
+ <span class="bounce-dot3 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
5
5
  </template>
6
6
 
7
7
  <style scoped>
@@ -19,7 +19,7 @@
19
19
  class="flex items-center gap-1 cursor-pointer"
20
20
  @click="toggleInputOutput()"
21
21
  >
22
- <div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-white/70 dark:bg-blue-700/20">
22
+ <div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-lightNavbar dark:bg-darkNavbar">
23
23
  <Spinner v-if="isRunning" class="h-4 w-4" />
24
24
  <IconCheckOutline v-else class="h-4 w-4 text-lightPrimary dark:text-darkPrimary" />
25
25
  </div>
@@ -1,12 +1,12 @@
1
1
  <template >
2
2
  <template v-if="toolGroup.length > 0">
3
- <span class="bg-lightNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar ring-default">
3
+ <span class="text-listTableHeadingText dark:text-darkListTableHeadingText bg-lightNavbar dark:bg-darkNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar ring-default">
4
4
  <div class="w-5 h-5 rounded-full flex items-center justify-center">
5
5
  <IconWrenchSolid class="w-4 h-4" />
6
6
  </div>
7
7
  </span>
8
8
  <h3
9
- class="flex items-center mb-1 text-sm my-2 ml-3 gap-1"
9
+ class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 text-listTableHeadingText dark:text-darkListTableHeadingText"
10
10
  >
11
11
  <span class="font-semibold select-none ">Call tools</span>
12
12
  </h3>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.22.0",
3
+ "version": "1.22.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",