This commit is contained in:
Tommy D. Rossi
2025-11-24 16:40:07 +01:00
parent 5d93b977d1
commit 7eb5060d71
6 changed files with 31 additions and 26 deletions
+1 -17
View File
@@ -1,26 +1,10 @@
import { RelayConnection, logger } from './relayConnection'
import { createStore } from 'zustand/vanilla'
import type { ExtensionState, ConnectionState, TabState, TabInfo } from './types'
// Relay URL - fixed port for MCP bridge
const RELAY_URL = 'ws://localhost:19988/extension'
type ConnectionState = 'disconnected' | 'reconnecting' | 'connected' | 'error'
type TabState = 'connecting' | 'connected' | 'error'
interface TabInfo {
targetId: string
state: TabState
errorText?: string
}
interface ExtensionState {
connection: RelayConnection | undefined
connectedTabs: Map<number, TabInfo>
connectionState: ConnectionState
currentTabId: number | undefined
errorText: string | undefined
}
const useExtensionStore = createStore<ExtensionState>((set) => ({
connection: undefined,
connectedTabs: new Map(),