feat(stage-*): store chat session to indexdb (#987)
* feat(stage-*): store chat session to indexdb * refactor: remove prompt hash * fix(stage-ui): enhance type guard for chat sessions export validation * refactor(stage-ui): simplify chat session export and import logic * refactor(stage-ui): update chat session management to use new data structure and improve export/import functionality * refactor(stage-ui): enhance chat session persistence and management methods * refactor(stage-ui): set and get idb value raw * fix: type
This commit is contained in:
@@ -4,6 +4,7 @@ import { themeColorFromValue, useThemeColor } from '@proj-airi/stage-layouts/com
|
||||
import { ToasterRoot } from '@proj-airi/stage-ui/components'
|
||||
import { useSharedAnalyticsStore } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { useCharacterOrchestratorStore } from '@proj-airi/stage-ui/stores/character'
|
||||
import { useChatSessionStore } from '@proj-airi/stage-ui/stores/chat/session-store'
|
||||
import { useDisplayModelsStore } from '@proj-airi/stage-ui/stores/display-models'
|
||||
import { useModsServerChannelStore } from '@proj-airi/stage-ui/stores/mods/api/channel-server'
|
||||
import { useContextBridgeStore } from '@proj-airi/stage-ui/stores/mods/api/context-bridge'
|
||||
@@ -33,6 +34,7 @@ const onboardingStore = useOnboardingStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const cardStore = useAiriCardStore()
|
||||
const chatSessionStore = useChatSessionStore()
|
||||
const serverChannelStore = useModsServerChannelStore()
|
||||
const characterOrchestratorStore = useCharacterOrchestratorStore()
|
||||
const analyticsStore = useSharedAnalyticsStore()
|
||||
@@ -53,6 +55,7 @@ onMounted(async () => {
|
||||
cardStore.initialize()
|
||||
onboardingStore.initializeSetupCheck()
|
||||
|
||||
await chatSessionStore.initialize()
|
||||
await displayModelsStore.loadDisplayModelsFromIndexedDB()
|
||||
await settingsStore.initializeStageModel()
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { OnboardingDialog, ToasterRoot } from '@proj-airi/stage-ui/components'
|
||||
import { useSharedAnalyticsStore } from '@proj-airi/stage-ui/stores/analytics'
|
||||
import { useCharacterOrchestratorStore } from '@proj-airi/stage-ui/stores/character'
|
||||
import { useChatSessionStore } from '@proj-airi/stage-ui/stores/chat/session-store'
|
||||
import { useDisplayModelsStore } from '@proj-airi/stage-ui/stores/display-models'
|
||||
import { useModsServerChannelStore } from '@proj-airi/stage-ui/stores/mods/api/channel-server'
|
||||
import { useContextBridgeStore } from '@proj-airi/stage-ui/stores/mods/api/context-bridge'
|
||||
@@ -28,6 +29,7 @@ const displayModelsStore = useDisplayModelsStore()
|
||||
const settingsStore = useSettings()
|
||||
const settings = storeToRefs(settingsStore)
|
||||
const onboardingStore = useOnboardingStore()
|
||||
const chatSessionStore = useChatSessionStore()
|
||||
const serverChannelStore = useModsServerChannelStore()
|
||||
const characterOrchestratorStore = useCharacterOrchestratorStore()
|
||||
const { shouldShowSetup } = storeToRefs(onboardingStore)
|
||||
@@ -76,6 +78,7 @@ onMounted(async () => {
|
||||
|
||||
onboardingStore.initializeSetupCheck()
|
||||
|
||||
await chatSessionStore.initialize()
|
||||
await serverChannelStore.initialize({ possibleEvents: ['ui:configure'] }).catch(err => console.error('Failed to initialize Mods Server Channel in App.vue:', err))
|
||||
await contextBridgeStore.initialize()
|
||||
characterOrchestratorStore.initialize()
|
||||
|
||||
Reference in New Issue
Block a user