sandbox connected and streaming
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { wsManager } from '../composables/useWebSocket'
|
||||
|
||||
export interface ChannelInfo {
|
||||
type: string
|
||||
@@ -20,5 +21,12 @@ export interface ChannelState {
|
||||
export const useChannelStore = defineStore('channelState', () => {
|
||||
const connected = ref<Record<string, ChannelInfo>>({})
|
||||
|
||||
return { connected }
|
||||
// Session readiness — computed getters backed by wsManager refs.
|
||||
// Using computed (not ref) keeps these out of $state so useStateSync won't
|
||||
// pick them up and try to send patches to the gateway.
|
||||
const sessionStatus = computed(() => wsManager.sessionStatus.value)
|
||||
const statusMessage = computed(() => wsManager.statusMessage.value)
|
||||
const isReady = computed(() => wsManager.sessionStatus.value === 'ready')
|
||||
|
||||
return { connected, sessionStatus, statusMessage, isReady }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user