@adminforth/agent 1.2.1 → 1.2.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 +2 -2
- package/custom/SessionsHistory.vue +1 -1
- package/custom/chat.ts +13 -0
- package/custom/useAgentStore.ts +6 -1
- package/dist/custom/SessionsHistory.vue +1 -1
- package/dist/custom/chat.ts +13 -0
- package/dist/custom/useAgentStore.ts +6 -1
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -29,5 +29,5 @@ custom/skills/fetch_data/SKILL.md
|
|
|
29
29
|
custom/skills/mutate_data/
|
|
30
30
|
custom/skills/mutate_data/SKILL.md
|
|
31
31
|
|
|
32
|
-
sent
|
|
33
|
-
total size is 166,
|
|
32
|
+
sent 168,508 bytes received 413 bytes 337,842.00 bytes/sec
|
|
33
|
+
total size is 166,859 speedup is 0.99
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"
|
|
7
7
|
>
|
|
8
8
|
<h3 :class="h3Style">{{ $t('Chat history') }}</h3>
|
|
9
|
-
<Button @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false)" :disabled="agentStore.isResponseInProgress" class="w-[360px] mx-4 my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200">
|
|
9
|
+
<Button @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();" :disabled="agentStore.isResponseInProgress" class="w-[360px] mx-4 my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200">
|
|
10
10
|
<IconPlusOutline class="w-5 h-5" />
|
|
11
11
|
{{ $t('New chat') }}
|
|
12
12
|
</Button>
|
package/custom/chat.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is used to fix circular module initialization between ai and @ai-sdk/vue
|
|
3
|
+
* These files are depending on each other, but vite put them in different chunks, so they are not initialized at the same time, which causes the circular module initialization issue
|
|
4
|
+
* So I get rid of the @ai-sdk/vue only fixes are:
|
|
5
|
+
* 1) Change vite config to put these files in the same chunk
|
|
6
|
+
* 2) Get rid of the circular module initialization by moving the Chat class to this file
|
|
7
|
+
*
|
|
8
|
+
* Maybe there is a better way to fix this issue
|
|
9
|
+
*
|
|
10
|
+
* If you were updating "ai" package and plugin broke, probably you need to update this file as well
|
|
11
|
+
* Or resolve the circular module initialization issue in a better way
|
|
12
|
+
*/
|
|
13
|
+
|
|
1
14
|
import {
|
|
2
15
|
AbstractChat,
|
|
3
16
|
ChatInit as BaseChatInit,
|
package/custom/useAgentStore.ts
CHANGED
|
@@ -155,10 +155,14 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
155
155
|
function openChat() {
|
|
156
156
|
isChatOpen.value = true;
|
|
157
157
|
nextTick(() => {
|
|
158
|
-
|
|
158
|
+
focusTextInput();
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
function focusTextInput() {
|
|
163
|
+
textInput.value?.focus();
|
|
164
|
+
}
|
|
165
|
+
|
|
162
166
|
function setIsChatOpen(isOpen: boolean) {
|
|
163
167
|
isOpen ? openChat() : closeChat();
|
|
164
168
|
}
|
|
@@ -354,5 +358,6 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
354
358
|
setIsTeleportedToBody,
|
|
355
359
|
chatWidth,
|
|
356
360
|
setChatWidth,
|
|
361
|
+
focusTextInput
|
|
357
362
|
}
|
|
358
363
|
})
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"
|
|
7
7
|
>
|
|
8
8
|
<h3 :class="h3Style">{{ $t('Chat history') }}</h3>
|
|
9
|
-
<Button @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false)" :disabled="agentStore.isResponseInProgress" class="w-[360px] mx-4 my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200">
|
|
9
|
+
<Button @click="agentStore.createPreSession(); agentStore.setSessionHistoryOpen(false); agentStore.focusTextInput();" :disabled="agentStore.isResponseInProgress" class="w-[360px] mx-4 my-2 mb-4 rounded-3xl text-gray-800 dark:text-gray-200">
|
|
10
10
|
<IconPlusOutline class="w-5 h-5" />
|
|
11
11
|
{{ $t('New chat') }}
|
|
12
12
|
</Button>
|
package/dist/custom/chat.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is used to fix circular module initialization between ai and @ai-sdk/vue
|
|
3
|
+
* These files are depending on each other, but vite put them in different chunks, so they are not initialized at the same time, which causes the circular module initialization issue
|
|
4
|
+
* So I get rid of the @ai-sdk/vue only fixes are:
|
|
5
|
+
* 1) Change vite config to put these files in the same chunk
|
|
6
|
+
* 2) Get rid of the circular module initialization by moving the Chat class to this file
|
|
7
|
+
*
|
|
8
|
+
* Maybe there is a better way to fix this issue
|
|
9
|
+
*
|
|
10
|
+
* If you were updating "ai" package and plugin broke, probably you need to update this file as well
|
|
11
|
+
* Or resolve the circular module initialization issue in a better way
|
|
12
|
+
*/
|
|
13
|
+
|
|
1
14
|
import {
|
|
2
15
|
AbstractChat,
|
|
3
16
|
ChatInit as BaseChatInit,
|
|
@@ -155,10 +155,14 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
155
155
|
function openChat() {
|
|
156
156
|
isChatOpen.value = true;
|
|
157
157
|
nextTick(() => {
|
|
158
|
-
|
|
158
|
+
focusTextInput();
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
function focusTextInput() {
|
|
163
|
+
textInput.value?.focus();
|
|
164
|
+
}
|
|
165
|
+
|
|
162
166
|
function setIsChatOpen(isOpen: boolean) {
|
|
163
167
|
isOpen ? openChat() : closeChat();
|
|
164
168
|
}
|
|
@@ -354,5 +358,6 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
354
358
|
setIsTeleportedToBody,
|
|
355
359
|
chatWidth,
|
|
356
360
|
setChatWidth,
|
|
361
|
+
focusTextInput
|
|
357
362
|
}
|
|
358
363
|
})
|