-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipc-types.ts
More file actions
141 lines (128 loc) · 3.17 KB
/
Copy pathipc-types.ts
File metadata and controls
141 lines (128 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
export const IPC_TO_MAIN = {
CONFIG_LOAD: 'config:load',
CONFIG_SAVE: 'config:save',
SERVICE_START: 'service:start',
SERVICE_STOP: 'service:stop',
SERVER_TEST: 'server:test',
SESSION_RESET: 'session:reset',
PLAYWRIGHT_INSTALL: 'playwright:install',
PLAYWRIGHT_CHECK: 'playwright:check',
CONFIG_OPEN_FILE: 'config:open-file',
GET_INSTALLATION_ID: 'installation:get',
APP_GET_VERSION: 'app:getVersion',
} as const
export const IPC_TO_RENDERER = {
LOG_ENTRY: 'log:entry',
STATUS_CHANGED: 'status:changed',
SESSION_UPDATED: 'session:updated',
SESSION_REMOVED: 'session:removed',
STATS_UPDATED: 'stats:updated',
TOOLS_UPDATED: 'tools:updated',
TOOL_CALL_UPDATED: 'tool-call:updated',
RESOURCES_UPDATED: 'resources:updated',
RESOURCE_READ_UPDATED: 'resource-read:updated',
PLAYWRIGHT_INSTALL_PROGRESS: 'playwright:install-progress',
DEEP_LINK_CONFIG: 'deep-link:config',
} as const
export interface DeepLinkConfigPayload {
deploymentUrl: string
// Present only for quick connect: the app trades the single-use code for its
// own handshake token instead of the user copying one over by hand.
exchangeUrl?: string
code?: string
authToken?: string
}
export type LogLevel =
| 'info'
| 'success'
| 'warning'
| 'error'
| 'tool_call'
| 'tool_ok'
| 'tool_error'
| 'session'
| 'resource_read'
| 'resource_ok'
| 'resource_error'
export interface LogEntry {
seq: number
timestamp: string
level: LogLevel
message: string
sessionId?: string
}
export interface SessionRecord {
sessionId: string
servers: string[]
status: 'active' | 'ended'
callCount: number
}
export interface StatusPayload {
connected: boolean
connecting?: boolean // Socket.IO is actively trying to reach the server
deploymentUrl?: string
installationId?: string // Persistent 16-char hex ID shown in the UI
displayName?: string
isReconnect?: boolean
connectionError?: string | null // Last error message from connect_error / reconnect_failed
}
export interface StatsPayload {
activeSessions?: number
totalCalls?: number
}
export interface ToolInfo {
server: string
name: string
description?: string
inputSchema?: {
type?: string
properties?: Record<string, unknown>
required?: string[]
}
}
export interface ResourceInfo {
server: string
uri: string
name: string
description?: string
mimeType?: string
}
export interface ResourceReadRecord {
id: string
timestamp: string
server: string
uri: string
sessionId?: string
result?: unknown
error?: string
status: 'pending' | 'ok' | 'error'
durationMs?: number
}
export interface ToolCallRecord {
id: string
timestamp: string
server: string
tool: string
sessionId?: string
args?: Record<string, unknown>
result?: unknown
error?: string
status: 'pending' | 'ok' | 'error'
durationMs?: number
}
export interface ServerConfig {
type?: 'stdio' | 'http' | 'sse'
command?: string
args?: string[]
url?: string
headers?: Record<string, string>
stateful?: boolean
}
export interface AppConfig {
deployment_url: string
auth_token?: string
timeout?: number
ssl_verify?: boolean
display_name?: string
servers: Record<string, ServerConfig>
}