@adminforth/agent 1.3.1 → 1.4.0
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
|
@@ -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 168,
|
|
32
|
+
sent 170,096 bytes received 413 bytes 341,018.00 bytes/sec
|
|
33
|
+
total size is 168,447 speedup is 0.99
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:key="session.sessionId"
|
|
26
26
|
class="flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200 overflow-hidden text-nowrap"
|
|
27
27
|
:class="{'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId, 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress}"
|
|
28
|
-
@click="agentStore.setActiveSession(session.sessionId)"
|
|
28
|
+
@click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
|
|
29
29
|
:disabled="agentStore.isResponseInProgress"
|
|
30
30
|
>
|
|
31
31
|
{{ session.title || session.sessionId }}
|
package/custom/useAgentStore.ts
CHANGED
|
@@ -26,6 +26,7 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
26
26
|
const coreStore = useCoreStore();
|
|
27
27
|
const appRoot = ref<HTMLElement | null>(null);
|
|
28
28
|
const header = ref<HTMLElement | null>(null);
|
|
29
|
+
const lastSessionId = ref<string | null>(null);
|
|
29
30
|
const chatWidth = ref(600);
|
|
30
31
|
function setLocalStorageItem(key: string, value: string) {
|
|
31
32
|
window.localStorage.setItem(`${coreStore.config.brandName || 'adminforth'}-${key}`, value);
|
|
@@ -42,9 +43,18 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
42
43
|
watch(chatWidth, (newVal: number) => {
|
|
43
44
|
setLocalStorageItem('chatWidth', newVal.toString());
|
|
44
45
|
})
|
|
46
|
+
watch(activeSessionId, (newVal: string | null) => {
|
|
47
|
+
if (newVal) {
|
|
48
|
+
setLocalStorageItem('lastSessionId', newVal);
|
|
49
|
+
}
|
|
50
|
+
})
|
|
45
51
|
onMounted(() => {
|
|
46
52
|
chatWidth.value = parseInt(getLocalStorageItem('chatWidth') || '600', 10);
|
|
47
53
|
isTeleportedToBody.value = getLocalStorageItem('isTeleportedToBody') === 'true';
|
|
54
|
+
lastSessionId.value = getLocalStorageItem('lastSessionId');
|
|
55
|
+
if (lastSessionId.value && lastSessionId.value !== 'pre-session') {
|
|
56
|
+
setActiveSession(lastSessionId.value);
|
|
57
|
+
}
|
|
48
58
|
if (isTeleportedToBody.value) {
|
|
49
59
|
isChatOpen.value = getLocalStorageItem('isChatOpen') === 'true';
|
|
50
60
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:key="session.sessionId"
|
|
26
26
|
class="flex items-center justify-between w-full px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200 ease-in-out text-gray-800 dark:text-gray-200 overflow-hidden text-nowrap"
|
|
27
27
|
:class="{'bg-lightPrimary/20 hover:bg-lightPrimary/20 dark:bg-darkPrimary/20 dark:hover:bg-darkPrimary/20': agentStore.activeSessionId === session.sessionId, 'cursor-default opacity-50 pointer-events-none': agentStore.isResponseInProgress}"
|
|
28
|
-
@click="agentStore.setActiveSession(session.sessionId)"
|
|
28
|
+
@click="agentStore.setActiveSession(session.sessionId); agentStore.setSessionHistoryOpen(false);"
|
|
29
29
|
:disabled="agentStore.isResponseInProgress"
|
|
30
30
|
>
|
|
31
31
|
{{ session.title || session.sessionId }}
|
|
@@ -26,6 +26,7 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
26
26
|
const coreStore = useCoreStore();
|
|
27
27
|
const appRoot = ref<HTMLElement | null>(null);
|
|
28
28
|
const header = ref<HTMLElement | null>(null);
|
|
29
|
+
const lastSessionId = ref<string | null>(null);
|
|
29
30
|
const chatWidth = ref(600);
|
|
30
31
|
function setLocalStorageItem(key: string, value: string) {
|
|
31
32
|
window.localStorage.setItem(`${coreStore.config.brandName || 'adminforth'}-${key}`, value);
|
|
@@ -42,9 +43,18 @@ export const useAgentStore = defineStore('agent', () => {
|
|
|
42
43
|
watch(chatWidth, (newVal: number) => {
|
|
43
44
|
setLocalStorageItem('chatWidth', newVal.toString());
|
|
44
45
|
})
|
|
46
|
+
watch(activeSessionId, (newVal: string | null) => {
|
|
47
|
+
if (newVal) {
|
|
48
|
+
setLocalStorageItem('lastSessionId', newVal);
|
|
49
|
+
}
|
|
50
|
+
})
|
|
45
51
|
onMounted(() => {
|
|
46
52
|
chatWidth.value = parseInt(getLocalStorageItem('chatWidth') || '600', 10);
|
|
47
53
|
isTeleportedToBody.value = getLocalStorageItem('isTeleportedToBody') === 'true';
|
|
54
|
+
lastSessionId.value = getLocalStorageItem('lastSessionId');
|
|
55
|
+
if (lastSessionId.value && lastSessionId.value !== 'pre-session') {
|
|
56
|
+
setActiveSession(lastSessionId.value);
|
|
57
|
+
}
|
|
48
58
|
if (isTeleportedToBody.value) {
|
|
49
59
|
isChatOpen.value = getLocalStorageItem('isChatOpen') === 'true';
|
|
50
60
|
}
|