@adminforth/agent 1.16.2 → 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,526 bytes received 436 bytes 369,924.00 bytes/sec
35
- total size is 182,737 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
@@ -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');
@@ -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.2",
3
+ "version": "1.16.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",