@adminforth/agent 1.16.1 → 1.16.3

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
@@ -31,5 +31,5 @@ custom/skills/fetch_data/SKILL.md
31
31
  custom/skills/mutate_data/
32
32
  custom/skills/mutate_data/SKILL.md
33
33
 
34
- sent 184,388 bytes received 436 bytes 369,648.00 bytes/sec
35
- total size is 182,599 speedup is 0.99
34
+ sent 184,918 bytes received 428 bytes 370,692.00 bytes/sec
35
+ total size is 183,164 speedup is 0.99
@@ -125,14 +125,20 @@
125
125
  >
126
126
  <button
127
127
  aria-label="Select mode"
128
- class="flex h-9 w-9 items-center justify-center rounded-md border border-gray-200 bg-white text-lightNavbarIcons transition-colors duration-200 hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-darkNavbarIcons dark:hover:bg-gray-700"
128
+ class="flex px-2 py-1 items-center text-sm justify-center
129
+ rounded-md bg-white text-lightListTableHeadingText
130
+ transition-colors duration-200 hover:bg-gray-100
131
+ dark:text-darkListTableHeadingText dark:bg-gray-700 dark:hover:bg-gray-800"
129
132
  :class="isModeMenuOpen ? 'bg-gray-100 dark:bg-gray-700' : ''"
130
133
  :disabled="agentStore.isResponseInProgress"
131
134
  title="Select mode"
132
135
  type="button"
133
136
  @click="toggleModeMenu"
134
137
  >
135
- <IconBrainOutline class="h-4 w-4" />
138
+ {{ agentStore.activeModeName }}
139
+ <IconAngleDownOutline
140
+ class="w-4 h-4 ml-1"
141
+ />
136
142
  </button>
137
143
 
138
144
  <div
@@ -171,7 +177,7 @@
171
177
 
172
178
  <script setup lang="ts">
173
179
  import { IconChatBubbleLeft20Solid, IconSparklesSolid, IconArrowsPointingOut, IconArrowsPointingIn } from '@iconify-prerendered/vue-heroicons';
174
- import { IconCloseOutline, IconBarsOutline, IconArrowUpOutline, IconCloseSidebarSolid, IconOpenSidebarSolid, IconBrainOutline } from '@iconify-prerendered/vue-flowbite';
180
+ import { IconCloseOutline, IconBarsOutline, IconArrowUpOutline, IconCloseSidebarSolid, IconOpenSidebarSolid, IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
175
181
  import { useTemplateRef, onMounted, ref,computed } from 'vue';
176
182
  import { onClickOutside } from '@vueuse/core'
177
183
  import ConversationArea from './ConversationArea.vue';
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl p-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
3
+ class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl px-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
4
4
  @click="isInputOutputExpanded = !isInputOutputExpanded"
5
5
  >
6
6
  <div class="flex items-center gap-3">
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <template v-for="group in props.toolGroup" :key="group.title">
3
3
  <div v-if="group.groupedTools.length > 1" class="flex flex-col">
4
- <div class="flex items-center gap-2 p-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5
- <IconMinusOutline class="w-6 h-6 p-1"/>
4
+ <div class="flex items-center gap-2 px-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5
+ <IconCheckOutline class="w-6 h-6 p-1"/>
6
6
  {{ group.title }} {{ 'x' + group.groupedTools.length }}
7
7
  <IconAngleDownOutline
8
8
  class="transition-transform duration-200 hover:scale-105 hover:opacity-75"
@@ -24,7 +24,7 @@
24
24
  import ToolRenderer from './ToolRenderer.vue';
25
25
  import type { IPart } from './types';
26
26
  import { ref } from 'vue';
27
- import { IconAngleDownOutline, IconMinusOutline } from '@iconify-prerendered/vue-flowbite';
27
+ import { IconAngleDownOutline, IconCheckOutline } from '@iconify-prerendered/vue-flowbite';
28
28
 
29
29
  const props = defineProps<{
30
30
  toolGroup: {
@@ -7,6 +7,7 @@ import { Chat } from '../chat';
7
7
  import { DefaultChatTransport } from 'ai';
8
8
  import { useCoreStore } from '@/stores/core';
9
9
  import { useAgentTransitions } from './useAgentTransitions';
10
+ import { useWindowSize } from '@vueuse/core';
10
11
 
11
12
  type AgentMode = {
12
13
  name: string;
@@ -48,6 +49,7 @@ export const useAgentStore = defineStore('agent', () => {
48
49
  const availableModes = ref<AgentMode[]>([]);
49
50
  const activeModeName = ref<string | null>(null);
50
51
  const hasTypedMessageInPageSession = ref(false);
52
+ const { width: windowWidth } = useWindowSize();
51
53
  let placeholderAnimationTimer: ReturnType<typeof setTimeout> | null = null;
52
54
 
53
55
  function setLocalStorageItem(key: string, value: string) {
@@ -56,6 +58,11 @@ export const useAgentStore = defineStore('agent', () => {
56
58
  function getLocalStorageItem(key: string) {
57
59
  return window.localStorage.getItem(`${coreStore.config.brandName || 'adminforth'}-${key}`);
58
60
  }
61
+ watch(windowWidth, (newWidth: number) => {
62
+ if (isFullScreen.value) {
63
+ setChatWidth(newWidth, false);
64
+ }
65
+ })
59
66
  watch(isTeleportedToBody, (newVal: boolean) => {
60
67
  setLocalStorageItem('isTeleportedToBody', newVal ? 'true' : 'false');
61
68
  })
@@ -85,7 +92,14 @@ export const useAgentStore = defineStore('agent', () => {
85
92
  if (chatWidthBeforeFullScreen) {
86
93
  chatWidth.value = chatWidthBeforeFullScreen;
87
94
  } else {
88
- chatWidth.value = parseInt(getLocalStorageItem('chatWidth') || DEFAULT_CHAT_WIDTH.toString(), 10);
95
+ const savedChatWidth = parseInt(getLocalStorageItem('chatWidth') || '0', 10);
96
+ if (savedChatWidth) {
97
+ if (savedChatWidth > MAX_WIDTH || savedChatWidth < MIN_WIDTH) {
98
+ chatWidth.value = DEFAULT_CHAT_WIDTH;
99
+ } else {
100
+ chatWidth.value = savedChatWidth;
101
+ }
102
+ }
89
103
  }
90
104
  isTeleportedToBody.value = getLocalStorageItem('isTeleportedToBody') === 'true';
91
105
  lastSessionId.value = getLocalStorageItem('lastSessionId');
@@ -125,14 +125,20 @@
125
125
  >
126
126
  <button
127
127
  aria-label="Select mode"
128
- class="flex h-9 w-9 items-center justify-center rounded-md border border-gray-200 bg-white text-lightNavbarIcons transition-colors duration-200 hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-darkNavbarIcons dark:hover:bg-gray-700"
128
+ class="flex px-2 py-1 items-center text-sm justify-center
129
+ rounded-md bg-white text-lightListTableHeadingText
130
+ transition-colors duration-200 hover:bg-gray-100
131
+ dark:text-darkListTableHeadingText dark:bg-gray-700 dark:hover:bg-gray-800"
129
132
  :class="isModeMenuOpen ? 'bg-gray-100 dark:bg-gray-700' : ''"
130
133
  :disabled="agentStore.isResponseInProgress"
131
134
  title="Select mode"
132
135
  type="button"
133
136
  @click="toggleModeMenu"
134
137
  >
135
- <IconBrainOutline class="h-4 w-4" />
138
+ {{ agentStore.activeModeName }}
139
+ <IconAngleDownOutline
140
+ class="w-4 h-4 ml-1"
141
+ />
136
142
  </button>
137
143
 
138
144
  <div
@@ -171,7 +177,7 @@
171
177
 
172
178
  <script setup lang="ts">
173
179
  import { IconChatBubbleLeft20Solid, IconSparklesSolid, IconArrowsPointingOut, IconArrowsPointingIn } from '@iconify-prerendered/vue-heroicons';
174
- import { IconCloseOutline, IconBarsOutline, IconArrowUpOutline, IconCloseSidebarSolid, IconOpenSidebarSolid, IconBrainOutline } from '@iconify-prerendered/vue-flowbite';
180
+ import { IconCloseOutline, IconBarsOutline, IconArrowUpOutline, IconCloseSidebarSolid, IconOpenSidebarSolid, IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
175
181
  import { useTemplateRef, onMounted, ref,computed } from 'vue';
176
182
  import { onClickOutside } from '@vueuse/core'
177
183
  import ConversationArea from './ConversationArea.vue';
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl p-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
3
+ class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl px-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
4
4
  @click="isInputOutputExpanded = !isInputOutputExpanded"
5
5
  >
6
6
  <div class="flex items-center gap-3">
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <template v-for="group in props.toolGroup" :key="group.title">
3
3
  <div v-if="group.groupedTools.length > 1" class="flex flex-col">
4
- <div class="flex items-center gap-2 p-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5
- <IconMinusOutline class="w-6 h-6 p-1"/>
4
+ <div class="flex items-center gap-2 px-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5
+ <IconCheckOutline class="w-6 h-6 p-1"/>
6
6
  {{ group.title }} {{ 'x' + group.groupedTools.length }}
7
7
  <IconAngleDownOutline
8
8
  class="transition-transform duration-200 hover:scale-105 hover:opacity-75"
@@ -24,7 +24,7 @@
24
24
  import ToolRenderer from './ToolRenderer.vue';
25
25
  import type { IPart } from './types';
26
26
  import { ref } from 'vue';
27
- import { IconAngleDownOutline, IconMinusOutline } from '@iconify-prerendered/vue-flowbite';
27
+ import { IconAngleDownOutline, IconCheckOutline } from '@iconify-prerendered/vue-flowbite';
28
28
 
29
29
  const props = defineProps<{
30
30
  toolGroup: {
@@ -7,6 +7,7 @@ import { Chat } from '../chat';
7
7
  import { DefaultChatTransport } from 'ai';
8
8
  import { useCoreStore } from '@/stores/core';
9
9
  import { useAgentTransitions } from './useAgentTransitions';
10
+ import { useWindowSize } from '@vueuse/core';
10
11
 
11
12
  type AgentMode = {
12
13
  name: string;
@@ -48,6 +49,7 @@ export const useAgentStore = defineStore('agent', () => {
48
49
  const availableModes = ref<AgentMode[]>([]);
49
50
  const activeModeName = ref<string | null>(null);
50
51
  const hasTypedMessageInPageSession = ref(false);
52
+ const { width: windowWidth } = useWindowSize();
51
53
  let placeholderAnimationTimer: ReturnType<typeof setTimeout> | null = null;
52
54
 
53
55
  function setLocalStorageItem(key: string, value: string) {
@@ -56,6 +58,11 @@ export const useAgentStore = defineStore('agent', () => {
56
58
  function getLocalStorageItem(key: string) {
57
59
  return window.localStorage.getItem(`${coreStore.config.brandName || 'adminforth'}-${key}`);
58
60
  }
61
+ watch(windowWidth, (newWidth: number) => {
62
+ if (isFullScreen.value) {
63
+ setChatWidth(newWidth, false);
64
+ }
65
+ })
59
66
  watch(isTeleportedToBody, (newVal: boolean) => {
60
67
  setLocalStorageItem('isTeleportedToBody', newVal ? 'true' : 'false');
61
68
  })
@@ -85,7 +92,14 @@ export const useAgentStore = defineStore('agent', () => {
85
92
  if (chatWidthBeforeFullScreen) {
86
93
  chatWidth.value = chatWidthBeforeFullScreen;
87
94
  } else {
88
- chatWidth.value = parseInt(getLocalStorageItem('chatWidth') || DEFAULT_CHAT_WIDTH.toString(), 10);
95
+ const savedChatWidth = parseInt(getLocalStorageItem('chatWidth') || '0', 10);
96
+ if (savedChatWidth) {
97
+ if (savedChatWidth > MAX_WIDTH || savedChatWidth < MIN_WIDTH) {
98
+ chatWidth.value = DEFAULT_CHAT_WIDTH;
99
+ } else {
100
+ chatWidth.value = savedChatWidth;
101
+ }
102
+ }
89
103
  }
90
104
  isTeleportedToBody.value = getLocalStorageItem('isTeleportedToBody') === 'true';
91
105
  lastSessionId.value = getLocalStorageItem('lastSessionId');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.16.1",
3
+ "version": "1.16.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",