@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 +2 -2
- package/custom/ChatSurface.vue +9 -3
- package/custom/ToolRenderer.vue +1 -1
- package/custom/ToolsGroup.vue +3 -3
- package/custom/composables/useAgentStore.ts +15 -1
- package/dist/custom/ChatSurface.vue +9 -3
- package/dist/custom/ToolRenderer.vue +1 -1
- package/dist/custom/ToolsGroup.vue +3 -3
- package/dist/custom/composables/useAgentStore.ts +15 -1
- package/package.json +1 -1
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,
|
|
35
|
-
total size is
|
|
34
|
+
sent 184,918 bytes received 428 bytes 370,692.00 bytes/sec
|
|
35
|
+
total size is 183,164 speedup is 0.99
|
package/custom/ChatSurface.vue
CHANGED
|
@@ -125,14 +125,20 @@
|
|
|
125
125
|
>
|
|
126
126
|
<button
|
|
127
127
|
aria-label="Select mode"
|
|
128
|
-
class="flex
|
|
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
|
-
|
|
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,
|
|
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';
|
package/custom/ToolRenderer.vue
CHANGED
|
@@ -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
|
|
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">
|
package/custom/ToolsGroup.vue
CHANGED
|
@@ -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
|
|
5
|
-
<
|
|
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,
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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,
|
|
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
|
|
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
|
|
5
|
-
<
|
|
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,
|
|
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
|
-
|
|
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');
|