@adminforth/agent 1.2.0 → 1.2.1

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
@@ -10,6 +10,7 @@ custom/Message.vue
10
10
  custom/SessionsHistory.vue
11
11
  custom/ToolRenderer.vue
12
12
  custom/ToolsGroup.vue
13
+ custom/chat.ts
13
14
  custom/package.json
14
15
  custom/pnpm-lock.yaml
15
16
  custom/tsconfig.json
@@ -28,5 +29,5 @@ custom/skills/fetch_data/SKILL.md
28
29
  custom/skills/mutate_data/
29
30
  custom/skills/mutate_data/SKILL.md
30
31
 
31
- sent 166,886 bytes received 394 bytes 334,560.00 bytes/sec
32
- total size is 165,300 speedup is 0.99
32
+ sent 167,715 bytes received 413 bytes 336,256.00 bytes/sec
33
+ total size is 166,041 speedup is 0.99
@@ -80,8 +80,8 @@
80
80
 
81
81
  const props = defineProps<{
82
82
  type: string,
83
- message: string
84
- state: string
83
+ message: string | undefined,
84
+ state: string | undefined,
85
85
  data?: any
86
86
  role: 'user' | 'assistant'
87
87
  }>();
package/custom/chat.ts ADDED
@@ -0,0 +1,69 @@
1
+ import {
2
+ AbstractChat,
3
+ ChatInit as BaseChatInit,
4
+ ChatState,
5
+ ChatStatus,
6
+ UIMessage,
7
+ } from 'ai';
8
+ import { Ref, ref } from 'vue';
9
+
10
+ class VueChatState<
11
+ UI_MESSAGE extends UIMessage,
12
+ > implements ChatState<UI_MESSAGE> {
13
+ private messagesRef: Ref<UI_MESSAGE[]>;
14
+ private statusRef = ref<ChatStatus>('ready');
15
+ private errorRef = ref<Error | undefined>(undefined);
16
+
17
+ constructor(messages?: UI_MESSAGE[]) {
18
+ this.messagesRef = ref(messages ?? []) as Ref<UI_MESSAGE[]>;
19
+ }
20
+
21
+ get messages(): UI_MESSAGE[] {
22
+ return this.messagesRef.value;
23
+ }
24
+
25
+ set messages(messages: UI_MESSAGE[]) {
26
+ this.messagesRef.value = messages;
27
+ }
28
+
29
+ get status(): ChatStatus {
30
+ return this.statusRef.value;
31
+ }
32
+
33
+ set status(status: ChatStatus) {
34
+ this.statusRef.value = status;
35
+ }
36
+
37
+ get error(): Error | undefined {
38
+ return this.errorRef.value;
39
+ }
40
+
41
+ set error(error: Error | undefined) {
42
+ this.errorRef.value = error;
43
+ }
44
+
45
+ pushMessage = (message: UI_MESSAGE) => {
46
+ this.messagesRef.value = [...this.messagesRef.value, message];
47
+ };
48
+
49
+ popMessage = () => {
50
+ this.messagesRef.value = this.messagesRef.value.slice(0, -1);
51
+ };
52
+
53
+ replaceMessage = (index: number, message: UI_MESSAGE) => {
54
+ this.messagesRef.value[index] = { ...message };
55
+ };
56
+
57
+ snapshot = <T>(value: T): T => value;
58
+ }
59
+
60
+ export class Chat<
61
+ UI_MESSAGE extends UIMessage,
62
+ > extends AbstractChat<UI_MESSAGE> {
63
+ constructor({ messages, ...init }: BaseChatInit<UI_MESSAGE>) {
64
+ super({
65
+ ...init,
66
+ state: new VueChatState(messages),
67
+ });
68
+ }
69
+ }
@@ -11,14 +11,13 @@
11
11
  "license": "ISC",
12
12
  "packageManager": "pnpm@10.33.0",
13
13
  "dependencies": {
14
- "@ai-sdk/vue": "^3.0.158",
15
14
  "@incremark/core": "^1.0.2",
16
15
  "@incremark/theme": "^1.0.2",
17
16
  "@incremark/vue": "^1.0.2",
18
17
  "@shikijs/langs": "^4.0.2",
19
18
  "@shikijs/themes": "^4.0.2",
20
19
  "@vueuse/core": "^14.2.1",
21
- "ai": "^6.0.158",
20
+ "ai": "^6.0.168",
22
21
  "dompurify": "^3.3.3",
23
22
  "katex": "^0.16.45",
24
23
  "marked": "^18.0.0",
@@ -8,9 +8,6 @@ importers:
8
8
 
9
9
  .:
10
10
  dependencies:
11
- '@ai-sdk/vue':
12
- specifier: ^3.0.158
13
- version: 3.0.158(vue@3.5.32)(zod@4.3.6)
14
11
  '@incremark/core':
15
12
  specifier: ^1.0.2
16
13
  version: 1.0.2
@@ -30,8 +27,8 @@ importers:
30
27
  specifier: ^14.2.1
31
28
  version: 14.2.1(vue@3.5.32)
32
29
  ai:
33
- specifier: ^6.0.158
34
- version: 6.0.158(zod@4.3.6)
30
+ specifier: ^6.0.168
31
+ version: 6.0.168(zod@4.3.6)
35
32
  dompurify:
36
33
  specifier: ^3.3.3
37
34
  version: 3.3.3
@@ -47,8 +44,8 @@ importers:
47
44
 
48
45
  packages:
49
46
 
50
- '@ai-sdk/gateway@3.0.95':
51
- resolution: {integrity: sha512-ZmUNNbZl3V42xwQzPaNUi+s8eqR2lnrxf0bvB6YbLXpLjHYv0k2Y78t12cNOfY0bxGeuVVTLyk856uLuQIuXEQ==}
47
+ '@ai-sdk/gateway@3.0.104':
48
+ resolution: {integrity: sha512-ZKX5n74io8VIRlhIMSLWVlvT3sXC8Z7cZ9GHuWBWZDVi96+62AIsWuLGvMfcBA1STYuSoDrp6rIziZmvrTq0TA==}
52
49
  engines: {node: '>=18'}
53
50
  peerDependencies:
54
51
  zod: ^3.25.76 || ^4.1.8
@@ -63,12 +60,6 @@ packages:
63
60
  resolution: {integrity: sha512-oGMAgGoQdBXbZqNG0Ze56CHjDZ1IDYOwGYxYjO5KLSlz5HiNQ9udIXsPZ61VWaHGZ5XW/jyjmr6t2xz2jGVwbQ==}
64
61
  engines: {node: '>=18'}
65
62
 
66
- '@ai-sdk/vue@3.0.158':
67
- resolution: {integrity: sha512-1uOXnekM9/V8vOhKfEkFOrZYHJKiDmf20FaQJAJK/9tRBEclVCm6L4yOyVqqWhVVodaHrUSpYbAKWVKeP8iatA==}
68
- engines: {node: '>=18'}
69
- peerDependencies:
70
- vue: ^3.3.4
71
-
72
63
  '@antfu/utils@9.3.0':
73
64
  resolution: {integrity: sha512-9hFT4RauhcUzqOE4f1+frMKLZrgNog5b06I7VmZQV1BkvwvqrbC8EBZf3L1eEL2AKb6rNKjER0sEvJiSP1FXEA==}
74
65
 
@@ -217,8 +208,8 @@ packages:
217
208
  '@ungap/structured-clone@1.3.0':
218
209
  resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
219
210
 
220
- '@vercel/oidc@3.1.0':
221
- resolution: {integrity: sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w==}
211
+ '@vercel/oidc@3.2.0':
212
+ resolution: {integrity: sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug==}
222
213
  engines: {node: '>= 20'}
223
214
 
224
215
  '@vue/compiler-core@3.5.32':
@@ -263,8 +254,8 @@ packages:
263
254
  peerDependencies:
264
255
  vue: ^3.5.0
265
256
 
266
- ai@6.0.158:
267
- resolution: {integrity: sha512-gLTp1UXFtMqKUi3XHs33K7UFglbvojkxF/aq337TxnLGOhHIW9+GyP2jwW4hYX87f1es+wId3VQoPRRu9zEStQ==}
257
+ ai@6.0.168:
258
+ resolution: {integrity: sha512-2HqCJuO+1V2aV7vfYs5LFEUfxbkGX+5oa54q/gCCTL7KLTdbxcCu5D7TdLA5kwsrs3Szgjah9q6D9tpjHM3hUQ==}
268
259
  engines: {node: '>=18'}
269
260
  peerDependencies:
270
261
  zod: ^3.25.76 || ^4.1.8
@@ -665,8 +656,8 @@ packages:
665
656
  picocolors@1.1.1:
666
657
  resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
667
658
 
668
- postcss@8.5.9:
669
- resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==}
659
+ postcss@8.5.10:
660
+ resolution: {integrity: sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==}
670
661
  engines: {node: ^10 || ^12 || >=14}
671
662
 
672
663
  property-information@7.1.0:
@@ -730,11 +721,6 @@ packages:
730
721
  resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==}
731
722
  engines: {node: '>=12'}
732
723
 
733
- swrv@1.2.0:
734
- resolution: {integrity: sha512-lH/g4UcNyj+7lzK4eRGT4C68Q4EhQ6JtM9otPRIASfhhzfLWtbZPHcMuhuba7S9YVYuxkMUGImwMyGpfbkH07A==}
735
- peerDependencies:
736
- vue: '>=3.2.26 < 4'
737
-
738
724
  topojson-client@3.1.0:
739
725
  resolution: {integrity: sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==}
740
726
  hasBin: true
@@ -919,11 +905,11 @@ packages:
919
905
 
920
906
  snapshots:
921
907
 
922
- '@ai-sdk/gateway@3.0.95(zod@4.3.6)':
908
+ '@ai-sdk/gateway@3.0.104(zod@4.3.6)':
923
909
  dependencies:
924
910
  '@ai-sdk/provider': 3.0.8
925
911
  '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6)
926
- '@vercel/oidc': 3.1.0
912
+ '@vercel/oidc': 3.2.0
927
913
  zod: 4.3.6
928
914
 
929
915
  '@ai-sdk/provider-utils@4.0.23(zod@4.3.6)':
@@ -937,15 +923,6 @@ snapshots:
937
923
  dependencies:
938
924
  json-schema: 0.4.0
939
925
 
940
- '@ai-sdk/vue@3.0.158(vue@3.5.32)(zod@4.3.6)':
941
- dependencies:
942
- '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6)
943
- ai: 6.0.158(zod@4.3.6)
944
- swrv: 1.2.0(vue@3.5.32)
945
- vue: 3.5.32
946
- transitivePeerDependencies:
947
- - zod
948
-
949
926
  '@antfu/utils@9.3.0': {}
950
927
 
951
928
  '@babel/helper-string-parser@7.27.1': {}
@@ -1124,7 +1101,7 @@ snapshots:
1124
1101
 
1125
1102
  '@ungap/structured-clone@1.3.0': {}
1126
1103
 
1127
- '@vercel/oidc@3.1.0': {}
1104
+ '@vercel/oidc@3.2.0': {}
1128
1105
 
1129
1106
  '@vue/compiler-core@3.5.32':
1130
1107
  dependencies:
@@ -1148,7 +1125,7 @@ snapshots:
1148
1125
  '@vue/shared': 3.5.32
1149
1126
  estree-walker: 2.0.2
1150
1127
  magic-string: 0.30.21
1151
- postcss: 8.5.9
1128
+ postcss: 8.5.10
1152
1129
  source-map-js: 1.2.1
1153
1130
 
1154
1131
  '@vue/compiler-ssr@3.5.32':
@@ -1193,9 +1170,9 @@ snapshots:
1193
1170
  dependencies:
1194
1171
  vue: 3.5.32
1195
1172
 
1196
- ai@6.0.158(zod@4.3.6):
1173
+ ai@6.0.168(zod@4.3.6):
1197
1174
  dependencies:
1198
- '@ai-sdk/gateway': 3.0.95(zod@4.3.6)
1175
+ '@ai-sdk/gateway': 3.0.104(zod@4.3.6)
1199
1176
  '@ai-sdk/provider': 3.0.8
1200
1177
  '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6)
1201
1178
  '@opentelemetry/api': 1.9.0
@@ -1780,7 +1757,7 @@ snapshots:
1780
1757
 
1781
1758
  picocolors@1.1.1: {}
1782
1759
 
1783
- postcss@8.5.9:
1760
+ postcss@8.5.10:
1784
1761
  dependencies:
1785
1762
  nanoid: 3.3.11
1786
1763
  picocolors: 1.1.1
@@ -1842,10 +1819,6 @@ snapshots:
1842
1819
  dependencies:
1843
1820
  ansi-regex: 6.2.2
1844
1821
 
1845
- swrv@1.2.0(vue@3.5.32):
1846
- dependencies:
1847
- vue: 3.5.32
1848
-
1849
1822
  topojson-client@3.1.0:
1850
1823
  dependencies:
1851
1824
  commander: 2.20.3
@@ -3,7 +3,7 @@ import { IAgentSession, ISessionsListItem, IMessage } from './types';
3
3
  import { ref, nextTick, computed, watch, onMounted, shallowRef } from 'vue';
4
4
  import { callAdminForthApi } from '@/utils';
5
5
  import { useAdminforth } from '@/adminforth';
6
- import { Chat } from "@ai-sdk/vue";
6
+ import { Chat } from './chat';
7
7
  import { DefaultChatTransport } from 'ai';
8
8
  import { useCoreStore } from '@/stores/core';
9
9
 
@@ -79,8 +79,8 @@ export const useAgentStore = defineStore('agent', () => {
79
79
  }
80
80
  }
81
81
  })
82
- const chats = new Map<string, Chat>();
83
- const currentChat = shallowRef<Chat>(null);
82
+ const chats = new Map<string, Chat<any>>();
83
+ const currentChat = shallowRef<Chat<any>>();
84
84
  function setCurrentChat(sessionId: string) {
85
85
  if (chats.has(sessionId)) {
86
86
  currentChat.value = chats.get(sessionId) || null;
@@ -132,7 +132,7 @@ export const useAgentStore = defineStore('agent', () => {
132
132
  if (!currentSession.value || currentSession.value.sessionId === 'pre-session') {
133
133
  await createNewSession(message);
134
134
  }
135
- currentSession.value.timestamp = new Date().toISOString();
135
+ currentSession.value!.timestamp = new Date().toISOString();
136
136
  sessionList.value = sortSessionsListByTimestamp(sessionList.value.map((s: ISessionsListItem) => s.sessionId === currentSession.value?.sessionId ? {
137
137
  ...s,
138
138
  timestamp: currentSession.value?.timestamp || s.timestamp,
@@ -80,8 +80,8 @@
80
80
 
81
81
  const props = defineProps<{
82
82
  type: string,
83
- message: string
84
- state: string
83
+ message: string | undefined,
84
+ state: string | undefined,
85
85
  data?: any
86
86
  role: 'user' | 'assistant'
87
87
  }>();
@@ -0,0 +1,69 @@
1
+ import {
2
+ AbstractChat,
3
+ ChatInit as BaseChatInit,
4
+ ChatState,
5
+ ChatStatus,
6
+ UIMessage,
7
+ } from 'ai';
8
+ import { Ref, ref } from 'vue';
9
+
10
+ class VueChatState<
11
+ UI_MESSAGE extends UIMessage,
12
+ > implements ChatState<UI_MESSAGE> {
13
+ private messagesRef: Ref<UI_MESSAGE[]>;
14
+ private statusRef = ref<ChatStatus>('ready');
15
+ private errorRef = ref<Error | undefined>(undefined);
16
+
17
+ constructor(messages?: UI_MESSAGE[]) {
18
+ this.messagesRef = ref(messages ?? []) as Ref<UI_MESSAGE[]>;
19
+ }
20
+
21
+ get messages(): UI_MESSAGE[] {
22
+ return this.messagesRef.value;
23
+ }
24
+
25
+ set messages(messages: UI_MESSAGE[]) {
26
+ this.messagesRef.value = messages;
27
+ }
28
+
29
+ get status(): ChatStatus {
30
+ return this.statusRef.value;
31
+ }
32
+
33
+ set status(status: ChatStatus) {
34
+ this.statusRef.value = status;
35
+ }
36
+
37
+ get error(): Error | undefined {
38
+ return this.errorRef.value;
39
+ }
40
+
41
+ set error(error: Error | undefined) {
42
+ this.errorRef.value = error;
43
+ }
44
+
45
+ pushMessage = (message: UI_MESSAGE) => {
46
+ this.messagesRef.value = [...this.messagesRef.value, message];
47
+ };
48
+
49
+ popMessage = () => {
50
+ this.messagesRef.value = this.messagesRef.value.slice(0, -1);
51
+ };
52
+
53
+ replaceMessage = (index: number, message: UI_MESSAGE) => {
54
+ this.messagesRef.value[index] = { ...message };
55
+ };
56
+
57
+ snapshot = <T>(value: T): T => value;
58
+ }
59
+
60
+ export class Chat<
61
+ UI_MESSAGE extends UIMessage,
62
+ > extends AbstractChat<UI_MESSAGE> {
63
+ constructor({ messages, ...init }: BaseChatInit<UI_MESSAGE>) {
64
+ super({
65
+ ...init,
66
+ state: new VueChatState(messages),
67
+ });
68
+ }
69
+ }
@@ -11,14 +11,13 @@
11
11
  "license": "ISC",
12
12
  "packageManager": "pnpm@10.33.0",
13
13
  "dependencies": {
14
- "@ai-sdk/vue": "^3.0.158",
15
14
  "@incremark/core": "^1.0.2",
16
15
  "@incremark/theme": "^1.0.2",
17
16
  "@incremark/vue": "^1.0.2",
18
17
  "@shikijs/langs": "^4.0.2",
19
18
  "@shikijs/themes": "^4.0.2",
20
19
  "@vueuse/core": "^14.2.1",
21
- "ai": "^6.0.158",
20
+ "ai": "^6.0.168",
22
21
  "dompurify": "^3.3.3",
23
22
  "katex": "^0.16.45",
24
23
  "marked": "^18.0.0",
@@ -8,9 +8,6 @@ importers:
8
8
 
9
9
  .:
10
10
  dependencies:
11
- '@ai-sdk/vue':
12
- specifier: ^3.0.158
13
- version: 3.0.158(vue@3.5.32)(zod@4.3.6)
14
11
  '@incremark/core':
15
12
  specifier: ^1.0.2
16
13
  version: 1.0.2
@@ -30,8 +27,8 @@ importers:
30
27
  specifier: ^14.2.1
31
28
  version: 14.2.1(vue@3.5.32)
32
29
  ai:
33
- specifier: ^6.0.158
34
- version: 6.0.158(zod@4.3.6)
30
+ specifier: ^6.0.168
31
+ version: 6.0.168(zod@4.3.6)
35
32
  dompurify:
36
33
  specifier: ^3.3.3
37
34
  version: 3.3.3
@@ -47,8 +44,8 @@ importers:
47
44
 
48
45
  packages:
49
46
 
50
- '@ai-sdk/gateway@3.0.95':
51
- resolution: {integrity: sha512-ZmUNNbZl3V42xwQzPaNUi+s8eqR2lnrxf0bvB6YbLXpLjHYv0k2Y78t12cNOfY0bxGeuVVTLyk856uLuQIuXEQ==}
47
+ '@ai-sdk/gateway@3.0.104':
48
+ resolution: {integrity: sha512-ZKX5n74io8VIRlhIMSLWVlvT3sXC8Z7cZ9GHuWBWZDVi96+62AIsWuLGvMfcBA1STYuSoDrp6rIziZmvrTq0TA==}
52
49
  engines: {node: '>=18'}
53
50
  peerDependencies:
54
51
  zod: ^3.25.76 || ^4.1.8
@@ -63,12 +60,6 @@ packages:
63
60
  resolution: {integrity: sha512-oGMAgGoQdBXbZqNG0Ze56CHjDZ1IDYOwGYxYjO5KLSlz5HiNQ9udIXsPZ61VWaHGZ5XW/jyjmr6t2xz2jGVwbQ==}
64
61
  engines: {node: '>=18'}
65
62
 
66
- '@ai-sdk/vue@3.0.158':
67
- resolution: {integrity: sha512-1uOXnekM9/V8vOhKfEkFOrZYHJKiDmf20FaQJAJK/9tRBEclVCm6L4yOyVqqWhVVodaHrUSpYbAKWVKeP8iatA==}
68
- engines: {node: '>=18'}
69
- peerDependencies:
70
- vue: ^3.3.4
71
-
72
63
  '@antfu/utils@9.3.0':
73
64
  resolution: {integrity: sha512-9hFT4RauhcUzqOE4f1+frMKLZrgNog5b06I7VmZQV1BkvwvqrbC8EBZf3L1eEL2AKb6rNKjER0sEvJiSP1FXEA==}
74
65
 
@@ -217,8 +208,8 @@ packages:
217
208
  '@ungap/structured-clone@1.3.0':
218
209
  resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
219
210
 
220
- '@vercel/oidc@3.1.0':
221
- resolution: {integrity: sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w==}
211
+ '@vercel/oidc@3.2.0':
212
+ resolution: {integrity: sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug==}
222
213
  engines: {node: '>= 20'}
223
214
 
224
215
  '@vue/compiler-core@3.5.32':
@@ -263,8 +254,8 @@ packages:
263
254
  peerDependencies:
264
255
  vue: ^3.5.0
265
256
 
266
- ai@6.0.158:
267
- resolution: {integrity: sha512-gLTp1UXFtMqKUi3XHs33K7UFglbvojkxF/aq337TxnLGOhHIW9+GyP2jwW4hYX87f1es+wId3VQoPRRu9zEStQ==}
257
+ ai@6.0.168:
258
+ resolution: {integrity: sha512-2HqCJuO+1V2aV7vfYs5LFEUfxbkGX+5oa54q/gCCTL7KLTdbxcCu5D7TdLA5kwsrs3Szgjah9q6D9tpjHM3hUQ==}
268
259
  engines: {node: '>=18'}
269
260
  peerDependencies:
270
261
  zod: ^3.25.76 || ^4.1.8
@@ -665,8 +656,8 @@ packages:
665
656
  picocolors@1.1.1:
666
657
  resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
667
658
 
668
- postcss@8.5.9:
669
- resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==}
659
+ postcss@8.5.10:
660
+ resolution: {integrity: sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==}
670
661
  engines: {node: ^10 || ^12 || >=14}
671
662
 
672
663
  property-information@7.1.0:
@@ -730,11 +721,6 @@ packages:
730
721
  resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==}
731
722
  engines: {node: '>=12'}
732
723
 
733
- swrv@1.2.0:
734
- resolution: {integrity: sha512-lH/g4UcNyj+7lzK4eRGT4C68Q4EhQ6JtM9otPRIASfhhzfLWtbZPHcMuhuba7S9YVYuxkMUGImwMyGpfbkH07A==}
735
- peerDependencies:
736
- vue: '>=3.2.26 < 4'
737
-
738
724
  topojson-client@3.1.0:
739
725
  resolution: {integrity: sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==}
740
726
  hasBin: true
@@ -919,11 +905,11 @@ packages:
919
905
 
920
906
  snapshots:
921
907
 
922
- '@ai-sdk/gateway@3.0.95(zod@4.3.6)':
908
+ '@ai-sdk/gateway@3.0.104(zod@4.3.6)':
923
909
  dependencies:
924
910
  '@ai-sdk/provider': 3.0.8
925
911
  '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6)
926
- '@vercel/oidc': 3.1.0
912
+ '@vercel/oidc': 3.2.0
927
913
  zod: 4.3.6
928
914
 
929
915
  '@ai-sdk/provider-utils@4.0.23(zod@4.3.6)':
@@ -937,15 +923,6 @@ snapshots:
937
923
  dependencies:
938
924
  json-schema: 0.4.0
939
925
 
940
- '@ai-sdk/vue@3.0.158(vue@3.5.32)(zod@4.3.6)':
941
- dependencies:
942
- '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6)
943
- ai: 6.0.158(zod@4.3.6)
944
- swrv: 1.2.0(vue@3.5.32)
945
- vue: 3.5.32
946
- transitivePeerDependencies:
947
- - zod
948
-
949
926
  '@antfu/utils@9.3.0': {}
950
927
 
951
928
  '@babel/helper-string-parser@7.27.1': {}
@@ -1124,7 +1101,7 @@ snapshots:
1124
1101
 
1125
1102
  '@ungap/structured-clone@1.3.0': {}
1126
1103
 
1127
- '@vercel/oidc@3.1.0': {}
1104
+ '@vercel/oidc@3.2.0': {}
1128
1105
 
1129
1106
  '@vue/compiler-core@3.5.32':
1130
1107
  dependencies:
@@ -1148,7 +1125,7 @@ snapshots:
1148
1125
  '@vue/shared': 3.5.32
1149
1126
  estree-walker: 2.0.2
1150
1127
  magic-string: 0.30.21
1151
- postcss: 8.5.9
1128
+ postcss: 8.5.10
1152
1129
  source-map-js: 1.2.1
1153
1130
 
1154
1131
  '@vue/compiler-ssr@3.5.32':
@@ -1193,9 +1170,9 @@ snapshots:
1193
1170
  dependencies:
1194
1171
  vue: 3.5.32
1195
1172
 
1196
- ai@6.0.158(zod@4.3.6):
1173
+ ai@6.0.168(zod@4.3.6):
1197
1174
  dependencies:
1198
- '@ai-sdk/gateway': 3.0.95(zod@4.3.6)
1175
+ '@ai-sdk/gateway': 3.0.104(zod@4.3.6)
1199
1176
  '@ai-sdk/provider': 3.0.8
1200
1177
  '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6)
1201
1178
  '@opentelemetry/api': 1.9.0
@@ -1780,7 +1757,7 @@ snapshots:
1780
1757
 
1781
1758
  picocolors@1.1.1: {}
1782
1759
 
1783
- postcss@8.5.9:
1760
+ postcss@8.5.10:
1784
1761
  dependencies:
1785
1762
  nanoid: 3.3.11
1786
1763
  picocolors: 1.1.1
@@ -1842,10 +1819,6 @@ snapshots:
1842
1819
  dependencies:
1843
1820
  ansi-regex: 6.2.2
1844
1821
 
1845
- swrv@1.2.0(vue@3.5.32):
1846
- dependencies:
1847
- vue: 3.5.32
1848
-
1849
1822
  topojson-client@3.1.0:
1850
1823
  dependencies:
1851
1824
  commander: 2.20.3
@@ -3,7 +3,7 @@ import { IAgentSession, ISessionsListItem, IMessage } from './types';
3
3
  import { ref, nextTick, computed, watch, onMounted, shallowRef } from 'vue';
4
4
  import { callAdminForthApi } from '@/utils';
5
5
  import { useAdminforth } from '@/adminforth';
6
- import { Chat } from "@ai-sdk/vue";
6
+ import { Chat } from './chat';
7
7
  import { DefaultChatTransport } from 'ai';
8
8
  import { useCoreStore } from '@/stores/core';
9
9
 
@@ -79,8 +79,8 @@ export const useAgentStore = defineStore('agent', () => {
79
79
  }
80
80
  }
81
81
  })
82
- const chats = new Map<string, Chat>();
83
- const currentChat = shallowRef<Chat>(null);
82
+ const chats = new Map<string, Chat<any>>();
83
+ const currentChat = shallowRef<Chat<any>>();
84
84
  function setCurrentChat(sessionId: string) {
85
85
  if (chats.has(sessionId)) {
86
86
  currentChat.value = chats.get(sessionId) || null;
@@ -132,7 +132,7 @@ export const useAgentStore = defineStore('agent', () => {
132
132
  if (!currentSession.value || currentSession.value.sessionId === 'pre-session') {
133
133
  await createNewSession(message);
134
134
  }
135
- currentSession.value.timestamp = new Date().toISOString();
135
+ currentSession.value!.timestamp = new Date().toISOString();
136
136
  sessionList.value = sortSessionsListByTimestamp(sessionList.value.map((s: ISessionsListItem) => s.sessionId === currentSession.value?.sessionId ? {
137
137
  ...s,
138
138
  timestamp: currentSession.value?.timestamp || s.timestamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",