fix tsc
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import type { RelayConnection } from './relayConnection'
|
||||
|
||||
export type ConnectionState = 'disconnected' | 'reconnecting' | 'connected' | 'error'
|
||||
export type TabState = 'connecting' | 'connected' | 'error'
|
||||
|
||||
export interface TabInfo {
|
||||
targetId: string
|
||||
state: TabState
|
||||
errorText?: string
|
||||
}
|
||||
|
||||
export interface ExtensionState {
|
||||
connection: RelayConnection | undefined
|
||||
connectedTabs: Map<number, TabInfo>
|
||||
connectionState: ConnectionState
|
||||
currentTabId: number | undefined
|
||||
errorText: string | undefined
|
||||
}
|
||||
Reference in New Issue
Block a user