@codebolt/codeboltjs 2.0.7 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agentlib/agent.js +12 -4
- package/dist/agentlib/promptbuilder.d.ts +228 -0
- package/dist/agentlib/promptbuilder.js +487 -0
- package/dist/agentlib/taskInstruction.d.ts +3 -25
- package/dist/agentlib/usermessage.d.ts +13 -43
- package/dist/agentlib/usermessage.js +8 -8
- package/dist/core/messageManager.d.ts +4 -6
- package/dist/core/messageManager.js +24 -17
- package/dist/core/websocket.d.ts +10 -0
- package/dist/core/websocket.js +92 -8
- package/dist/index.d.ts +97 -95
- package/dist/index.js +63 -57
- package/dist/modules/agent.d.ts +9 -8
- package/dist/modules/agent.js +4 -4
- package/dist/modules/browser.d.ts +17 -17
- package/dist/modules/browser.js +7 -7
- package/dist/modules/chat.d.ts +1 -1
- package/dist/modules/codeparsers.d.ts +1 -16
- package/dist/modules/codeutils.d.ts +3 -18
- package/dist/modules/dbmemory.d.ts +1 -1
- package/dist/modules/debug.d.ts +1 -1
- package/dist/modules/fs.d.ts +1 -1
- package/dist/modules/git.d.ts +21 -20
- package/dist/modules/git.js +10 -10
- package/dist/modules/history.d.ts +6 -8
- package/dist/modules/history.js +4 -1
- package/dist/modules/llm.d.ts +13 -5
- package/dist/modules/llm.js +29 -4
- package/dist/modules/{tools.d.ts → mcp.d.ts} +9 -8
- package/dist/modules/{tools.js → mcp.js} +6 -6
- package/dist/modules/project.d.ts +1 -1
- package/dist/modules/state.d.ts +2 -1
- package/dist/modules/task.js +0 -1
- package/dist/modules/terminal.d.ts +1 -1
- package/dist/modules/tokenizer.d.ts +1 -1
- package/dist/modules/utils.d.ts +11 -1
- package/dist/modules/utils.js +9 -0
- package/dist/modules/vectordb.d.ts +1 -1
- package/dist/types/InternalTypes.d.ts +501 -0
- package/dist/types/InternalTypes.js +30 -0
- package/dist/types/commonTypes.d.ts +346 -0
- package/dist/types/commonTypes.js +37 -0
- package/dist/types/libFunctionTypes.d.ts +589 -0
- package/dist/types/libFunctionTypes.js +11 -0
- package/dist/types/socketMessageTypes.d.ts +951 -0
- package/dist/types/socketMessageTypes.js +51 -0
- package/dist/utils/{toolBox.d.ts → mcpServer.d.ts} +1 -1
- package/dist/utils/{toolBox.js → mcpServer.js} +36 -36
- package/dist/utils/parse-source-code/languageParser.d.ts +1 -7
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +3 -3
- package/package.json +7 -2
|
@@ -0,0 +1,951 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript interfaces for WebSocket message types
|
|
3
|
+
*
|
|
4
|
+
* This file contains all types related to WebSocket messages:
|
|
5
|
+
* - Incoming message types (from client to server)
|
|
6
|
+
* - Outgoing response types (from server to client)
|
|
7
|
+
* - WebSocket communication protocols
|
|
8
|
+
*/
|
|
9
|
+
/// <reference types="node" />
|
|
10
|
+
/// <reference types="node" />
|
|
11
|
+
export interface BaseWebSocketMessage {
|
|
12
|
+
type: string;
|
|
13
|
+
messageId?: string;
|
|
14
|
+
threadId?: string;
|
|
15
|
+
requestId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface BaseWebSocketResponse extends BaseWebSocketMessage {
|
|
18
|
+
success?: boolean;
|
|
19
|
+
message?: string;
|
|
20
|
+
data?: any;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BaseExecuteToolResponse extends BaseWebSocketResponse {
|
|
24
|
+
result?: any;
|
|
25
|
+
status?: 'pending' | 'executing' | 'success' | 'error' | 'rejected';
|
|
26
|
+
}
|
|
27
|
+
export interface UserMessage {
|
|
28
|
+
type: "messageResponse";
|
|
29
|
+
message: {
|
|
30
|
+
type: "messageResponse";
|
|
31
|
+
userMessage: string;
|
|
32
|
+
currentFile: string;
|
|
33
|
+
selectedAgent: {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
lastMessage: Record<string, any>;
|
|
37
|
+
};
|
|
38
|
+
mentionedFiles: string[];
|
|
39
|
+
mentionedFullPaths: string[];
|
|
40
|
+
mentionedFolders: string[];
|
|
41
|
+
mentionedMultiFile: string[];
|
|
42
|
+
mentionedMCPs: string[];
|
|
43
|
+
uploadedImages: string[];
|
|
44
|
+
actions: any[];
|
|
45
|
+
mentionedAgents: any[];
|
|
46
|
+
mentionedDocs: any[];
|
|
47
|
+
links: any[];
|
|
48
|
+
universalAgentLastMessage: string;
|
|
49
|
+
selection: any | null;
|
|
50
|
+
controlFiles: any[];
|
|
51
|
+
feedbackMessage: string;
|
|
52
|
+
terminalMessage: string;
|
|
53
|
+
messageId: string;
|
|
54
|
+
threadId: string;
|
|
55
|
+
templateType: string;
|
|
56
|
+
processId: string;
|
|
57
|
+
shadowGitHash: string;
|
|
58
|
+
};
|
|
59
|
+
sender: {
|
|
60
|
+
senderType: string;
|
|
61
|
+
senderInfo: Record<string, any>;
|
|
62
|
+
};
|
|
63
|
+
templateType: string;
|
|
64
|
+
data: {
|
|
65
|
+
text: string;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
};
|
|
68
|
+
messageId: string;
|
|
69
|
+
timestamp: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ChatMessageFromUser {
|
|
72
|
+
type: "messageResponse";
|
|
73
|
+
userMessage: string;
|
|
74
|
+
currentFile: string;
|
|
75
|
+
selectedAgent: {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
lastMessage: Record<string, any>;
|
|
79
|
+
};
|
|
80
|
+
mentionedFiles: string[];
|
|
81
|
+
mentionedFullPaths: string[];
|
|
82
|
+
mentionedFolders: string[];
|
|
83
|
+
mentionedMultiFile: string[];
|
|
84
|
+
mentionedMCPs: string[];
|
|
85
|
+
uploadedImages: string[];
|
|
86
|
+
actions: any[];
|
|
87
|
+
mentionedAgents: any[];
|
|
88
|
+
mentionedDocs: any[];
|
|
89
|
+
links: any[];
|
|
90
|
+
universalAgentLastMessage: string;
|
|
91
|
+
selection: any | null;
|
|
92
|
+
controlFiles: any[];
|
|
93
|
+
feedbackMessage: string;
|
|
94
|
+
terminalMessage: string;
|
|
95
|
+
messageId: string;
|
|
96
|
+
threadId: string;
|
|
97
|
+
templateType: string;
|
|
98
|
+
processId: string;
|
|
99
|
+
shadowGitHash: string;
|
|
100
|
+
}
|
|
101
|
+
export interface ChatMessage extends BaseWebSocketResponse {
|
|
102
|
+
id: string;
|
|
103
|
+
content: string;
|
|
104
|
+
sender: string;
|
|
105
|
+
timestamp: string;
|
|
106
|
+
type: string;
|
|
107
|
+
role?: 'user' | 'assistant' | 'system';
|
|
108
|
+
metadata?: Record<string, any>;
|
|
109
|
+
}
|
|
110
|
+
export interface BaseFsResponse extends BaseWebSocketResponse {
|
|
111
|
+
path?: string;
|
|
112
|
+
success: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface FsReadFileResponse extends BaseFsResponse {
|
|
115
|
+
type: 'readFileResponse';
|
|
116
|
+
content?: string;
|
|
117
|
+
encoding?: string;
|
|
118
|
+
result?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface FsWriteToFileResponse extends BaseFsResponse {
|
|
121
|
+
type: 'writeToFileResponse';
|
|
122
|
+
result?: string;
|
|
123
|
+
bytesWritten?: number;
|
|
124
|
+
}
|
|
125
|
+
export interface FsListFilesResponse extends BaseFsResponse {
|
|
126
|
+
type: 'fileListResponse';
|
|
127
|
+
files?: string[];
|
|
128
|
+
result?: string;
|
|
129
|
+
isRecursive?: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface FsListCodeDefinitionsResponse extends BaseFsResponse {
|
|
132
|
+
type: 'listCodeDefinitionNamesResponse';
|
|
133
|
+
definitions?: string[];
|
|
134
|
+
result?: string;
|
|
135
|
+
}
|
|
136
|
+
export interface FsSearchFilesResponse extends BaseFsResponse {
|
|
137
|
+
type: 'searchFilesResponse';
|
|
138
|
+
query?: string;
|
|
139
|
+
results?: Array<{
|
|
140
|
+
path: string;
|
|
141
|
+
matches: Array<{
|
|
142
|
+
line: number;
|
|
143
|
+
content: string;
|
|
144
|
+
lineNumber: number;
|
|
145
|
+
}>;
|
|
146
|
+
}>;
|
|
147
|
+
result?: string;
|
|
148
|
+
filePattern?: string;
|
|
149
|
+
}
|
|
150
|
+
export interface FsGrepSearchResponse extends BaseFsResponse {
|
|
151
|
+
type: 'grepSearchResponse';
|
|
152
|
+
query?: string;
|
|
153
|
+
includePattern?: string;
|
|
154
|
+
excludePattern?: string;
|
|
155
|
+
caseSensitive?: boolean;
|
|
156
|
+
results?: Array<{
|
|
157
|
+
file: string;
|
|
158
|
+
line: number;
|
|
159
|
+
content: string;
|
|
160
|
+
match: string;
|
|
161
|
+
}>;
|
|
162
|
+
result?: string;
|
|
163
|
+
}
|
|
164
|
+
export interface FsFileSearchResponse extends BaseFsResponse {
|
|
165
|
+
type: 'fileSearchResponse';
|
|
166
|
+
query?: string;
|
|
167
|
+
results?: string[];
|
|
168
|
+
result?: string;
|
|
169
|
+
}
|
|
170
|
+
export interface FsCreateFileResponse extends BaseFsResponse {
|
|
171
|
+
type: 'createFileResponse';
|
|
172
|
+
fileName?: string;
|
|
173
|
+
source?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface FsCreateFolderResponse extends BaseFsResponse {
|
|
176
|
+
type: 'createFolderResponse';
|
|
177
|
+
folderName?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface FsUpdateFileResponse extends BaseFsResponse {
|
|
180
|
+
type: 'updateFileResponse';
|
|
181
|
+
newContent?: string;
|
|
182
|
+
bytesWritten?: number;
|
|
183
|
+
}
|
|
184
|
+
export interface FsDeleteFileResponse extends BaseFsResponse {
|
|
185
|
+
type: 'deleteFileResponse';
|
|
186
|
+
filename?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface FsDeleteFolderResponse extends BaseFsResponse {
|
|
189
|
+
type: 'deleteFolderResponse';
|
|
190
|
+
foldername?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface FsEditFileAndApplyDiffResponse extends BaseFsResponse {
|
|
193
|
+
type: 'editFileAndApplyDiffResponse';
|
|
194
|
+
filePath?: string;
|
|
195
|
+
diff?: string;
|
|
196
|
+
diffIdentifier?: string;
|
|
197
|
+
prompt?: string;
|
|
198
|
+
applyModel?: string;
|
|
199
|
+
result?: string | {
|
|
200
|
+
status: 'success' | 'error' | 'review_started' | 'rejected';
|
|
201
|
+
file: string;
|
|
202
|
+
message: string;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export interface FsExecuteToolResponse extends BaseExecuteToolResponse {
|
|
206
|
+
type: 'fsExecuteToolResponse';
|
|
207
|
+
toolName?: 'read_file' | 'write_file' | 'list_files' | 'list_code_definitions' | 'search_files' | 'grep_search' | 'edit_file';
|
|
208
|
+
params?: {
|
|
209
|
+
path?: string;
|
|
210
|
+
content?: string;
|
|
211
|
+
isRecursive?: string | boolean;
|
|
212
|
+
askForPermission?: boolean;
|
|
213
|
+
regex?: string;
|
|
214
|
+
filePattern?: string;
|
|
215
|
+
query?: string;
|
|
216
|
+
includePattern?: string;
|
|
217
|
+
excludePattern?: string;
|
|
218
|
+
caseSensitive?: boolean;
|
|
219
|
+
target_file?: string;
|
|
220
|
+
code_edit?: string;
|
|
221
|
+
diffIdentifier?: string;
|
|
222
|
+
prompt?: string;
|
|
223
|
+
applyModel?: string;
|
|
224
|
+
};
|
|
225
|
+
data?: [boolean, string] | {
|
|
226
|
+
success: boolean;
|
|
227
|
+
data?: any;
|
|
228
|
+
error?: string;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export interface CommandError extends BaseWebSocketResponse {
|
|
232
|
+
type: 'commandError';
|
|
233
|
+
error: string;
|
|
234
|
+
exitCode?: number;
|
|
235
|
+
stderr?: string;
|
|
236
|
+
}
|
|
237
|
+
export interface CommandFinish extends BaseWebSocketResponse {
|
|
238
|
+
type: 'commandFinish';
|
|
239
|
+
exitCode: number;
|
|
240
|
+
stdout?: string;
|
|
241
|
+
stderr?: string;
|
|
242
|
+
}
|
|
243
|
+
export interface CommandOutput extends BaseWebSocketResponse {
|
|
244
|
+
type: 'commandOutput';
|
|
245
|
+
output: string;
|
|
246
|
+
stdout?: string;
|
|
247
|
+
stderr?: string;
|
|
248
|
+
}
|
|
249
|
+
export interface TerminalInterruptResponse {
|
|
250
|
+
type: 'terminalInterrupted';
|
|
251
|
+
success: boolean;
|
|
252
|
+
message?: string;
|
|
253
|
+
}
|
|
254
|
+
export interface TerminalInterrupted extends BaseWebSocketResponse {
|
|
255
|
+
type: 'terminalInterrupted';
|
|
256
|
+
interrupted: boolean;
|
|
257
|
+
}
|
|
258
|
+
export interface TerminalExecuteResponse extends BaseWebSocketResponse {
|
|
259
|
+
type: 'terminalExecuteResponse' | 'executeCommandResponse';
|
|
260
|
+
status_code?: number;
|
|
261
|
+
result?: string;
|
|
262
|
+
output?: string;
|
|
263
|
+
exitCode?: number;
|
|
264
|
+
stdout?: string;
|
|
265
|
+
stderr?: string;
|
|
266
|
+
}
|
|
267
|
+
export interface BrowserViewportInfo {
|
|
268
|
+
width: number;
|
|
269
|
+
height: number;
|
|
270
|
+
devicePixelRatio: number;
|
|
271
|
+
scrollX: number;
|
|
272
|
+
scrollY: number;
|
|
273
|
+
pageYOffset: number;
|
|
274
|
+
pageXOffset: number;
|
|
275
|
+
windowWidth: number;
|
|
276
|
+
windowHeight: number;
|
|
277
|
+
offsetHeight: number;
|
|
278
|
+
scrollHeight: number;
|
|
279
|
+
}
|
|
280
|
+
export interface BrowserSnapshot {
|
|
281
|
+
tree: {
|
|
282
|
+
strings: string[];
|
|
283
|
+
documents: Array<{
|
|
284
|
+
nodes: {
|
|
285
|
+
backendNodeId: number[];
|
|
286
|
+
attributes: Array<{
|
|
287
|
+
name: string;
|
|
288
|
+
value: string;
|
|
289
|
+
}>;
|
|
290
|
+
nodeValue: string[];
|
|
291
|
+
parentIndex: number[];
|
|
292
|
+
nodeType: number[];
|
|
293
|
+
nodeName: string[];
|
|
294
|
+
isClickable: {
|
|
295
|
+
index: number[];
|
|
296
|
+
};
|
|
297
|
+
textValue: {
|
|
298
|
+
index: number[];
|
|
299
|
+
value: string[];
|
|
300
|
+
};
|
|
301
|
+
inputValue: {
|
|
302
|
+
index: number[];
|
|
303
|
+
value: string[];
|
|
304
|
+
};
|
|
305
|
+
inputChecked: {
|
|
306
|
+
index: number[];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
}>;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
export interface BrowserActionResponsePayload {
|
|
313
|
+
action?: string;
|
|
314
|
+
success?: boolean;
|
|
315
|
+
content?: string;
|
|
316
|
+
html?: string;
|
|
317
|
+
markdown?: string;
|
|
318
|
+
text?: string;
|
|
319
|
+
url?: string;
|
|
320
|
+
viewport?: BrowserViewportInfo;
|
|
321
|
+
info?: BrowserViewportInfo;
|
|
322
|
+
tree?: BrowserSnapshot['tree'];
|
|
323
|
+
screenshot?: string;
|
|
324
|
+
pdf?: Buffer | string;
|
|
325
|
+
elements?: Array<{
|
|
326
|
+
id: string;
|
|
327
|
+
tag: string;
|
|
328
|
+
text: string;
|
|
329
|
+
attributes: Record<string, string>;
|
|
330
|
+
}>;
|
|
331
|
+
selector?: string;
|
|
332
|
+
fullPage?: boolean;
|
|
333
|
+
options?: Record<string, any>;
|
|
334
|
+
}
|
|
335
|
+
export interface BrowserActionResponseData extends BaseWebSocketResponse {
|
|
336
|
+
type: 'browserActionResponse' | 'screenshotResponse' | 'getContentResponse' | 'getMarkdownResponse' | 'getBrowserInfoResponse' | 'getSnapShotResponse' | 'goToPageResponse' | 'goBackResponse' | 'goForwardResponse' | 'refreshResponse' | 'getHTMLResponse' | 'extractTextResponse';
|
|
337
|
+
payload?: BrowserActionResponsePayload;
|
|
338
|
+
eventId?: string;
|
|
339
|
+
}
|
|
340
|
+
export interface BrowserScreenshotResponse extends BrowserActionResponseData {
|
|
341
|
+
type: 'screenshotResponse';
|
|
342
|
+
payload?: BrowserActionResponsePayload & {
|
|
343
|
+
screenshot: string;
|
|
344
|
+
fullPage?: boolean;
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
export interface BrowserNavigationResponse extends BrowserActionResponseData {
|
|
348
|
+
type: 'goToPageResponse' | 'goBackResponse' | 'goForwardResponse' | 'refreshResponse';
|
|
349
|
+
payload?: BrowserActionResponsePayload & {
|
|
350
|
+
url?: string;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
export interface BrowserContentResponse extends BrowserActionResponseData {
|
|
354
|
+
type: 'getContentResponse' | 'getMarkdownResponse' | 'getHTMLResponse' | 'extractTextResponse';
|
|
355
|
+
payload?: BrowserActionResponsePayload & {
|
|
356
|
+
content?: string;
|
|
357
|
+
html?: string;
|
|
358
|
+
markdown?: string;
|
|
359
|
+
text?: string;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
export interface BrowserInfoResponse extends BrowserActionResponseData {
|
|
363
|
+
type: 'getBrowserInfoResponse';
|
|
364
|
+
payload?: BrowserActionResponsePayload & {
|
|
365
|
+
info: BrowserViewportInfo;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
export interface BrowserSnapshotResponse extends BrowserActionResponseData {
|
|
369
|
+
type: 'getSnapShotResponse';
|
|
370
|
+
payload?: BrowserActionResponsePayload & {
|
|
371
|
+
tree: BrowserSnapshot['tree'];
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
export interface GoToPageResponse extends BaseWebSocketResponse {
|
|
375
|
+
type: 'goToPageResponse';
|
|
376
|
+
url?: string;
|
|
377
|
+
success?: boolean;
|
|
378
|
+
}
|
|
379
|
+
export interface UrlResponse extends BaseWebSocketResponse {
|
|
380
|
+
type: 'urlResponse';
|
|
381
|
+
url?: string;
|
|
382
|
+
currentUrl?: string;
|
|
383
|
+
}
|
|
384
|
+
export interface GetMarkdownResponse extends BaseWebSocketResponse {
|
|
385
|
+
type: 'getMarkdownResponse';
|
|
386
|
+
markdown?: string;
|
|
387
|
+
content?: string;
|
|
388
|
+
}
|
|
389
|
+
export interface HtmlReceived extends BaseWebSocketResponse {
|
|
390
|
+
type: 'htmlReceived';
|
|
391
|
+
html?: string;
|
|
392
|
+
content?: string;
|
|
393
|
+
}
|
|
394
|
+
export interface ExtractTextResponse extends BaseWebSocketResponse {
|
|
395
|
+
type: 'extractTextResponse';
|
|
396
|
+
text?: string;
|
|
397
|
+
content?: string;
|
|
398
|
+
}
|
|
399
|
+
export interface GetContentResponse extends BaseWebSocketResponse {
|
|
400
|
+
type: 'getContentResponse';
|
|
401
|
+
content?: string;
|
|
402
|
+
html?: string;
|
|
403
|
+
text?: string;
|
|
404
|
+
}
|
|
405
|
+
export interface GitInitResponse extends BaseWebSocketResponse {
|
|
406
|
+
type: 'gitInitResponse';
|
|
407
|
+
}
|
|
408
|
+
export interface GitCommitResponse extends BaseWebSocketResponse {
|
|
409
|
+
type: 'gitCommitResponse';
|
|
410
|
+
content?: string;
|
|
411
|
+
hash?: string;
|
|
412
|
+
}
|
|
413
|
+
export interface GitPushResponse extends BaseWebSocketResponse {
|
|
414
|
+
type: 'gitPushResponse';
|
|
415
|
+
success?: boolean;
|
|
416
|
+
}
|
|
417
|
+
export interface GitPullResponse extends BaseWebSocketResponse {
|
|
418
|
+
type: 'gitPullResponse';
|
|
419
|
+
success?: boolean;
|
|
420
|
+
changes?: number;
|
|
421
|
+
insertions?: number;
|
|
422
|
+
deletions?: number;
|
|
423
|
+
}
|
|
424
|
+
export interface GitStatusResponse extends BaseWebSocketResponse {
|
|
425
|
+
type: 'gitStatusResponse';
|
|
426
|
+
data?: import('./commonTypes').StatusResult;
|
|
427
|
+
}
|
|
428
|
+
export interface GitLogsResponse extends BaseWebSocketResponse {
|
|
429
|
+
type: 'gitLogsResponse';
|
|
430
|
+
data?: import('./commonTypes').CommitSummary[];
|
|
431
|
+
}
|
|
432
|
+
export interface GitDiffResponse extends BaseWebSocketResponse {
|
|
433
|
+
type: 'gitDiffResponse';
|
|
434
|
+
data?: import('./commonTypes').DiffResult | string;
|
|
435
|
+
commitHash?: string;
|
|
436
|
+
}
|
|
437
|
+
export interface GitCheckoutResponse extends BaseWebSocketResponse {
|
|
438
|
+
type: 'gitCheckoutResponse';
|
|
439
|
+
branch?: string;
|
|
440
|
+
}
|
|
441
|
+
export interface GitBranchResponse extends BaseWebSocketResponse {
|
|
442
|
+
type: 'gitBranchResponse';
|
|
443
|
+
branch?: string;
|
|
444
|
+
}
|
|
445
|
+
export interface GitCloneResponse extends BaseWebSocketResponse {
|
|
446
|
+
type: 'gitCloneResponse';
|
|
447
|
+
url?: string;
|
|
448
|
+
}
|
|
449
|
+
export interface AddResponse extends BaseWebSocketResponse {
|
|
450
|
+
type: 'AddResponse';
|
|
451
|
+
content?: string;
|
|
452
|
+
}
|
|
453
|
+
export interface LLMResponse extends BaseWebSocketResponse {
|
|
454
|
+
type: 'llmResponse';
|
|
455
|
+
content: string;
|
|
456
|
+
role: 'assistant';
|
|
457
|
+
model?: string;
|
|
458
|
+
usage?: {
|
|
459
|
+
prompt_tokens: number;
|
|
460
|
+
completion_tokens: number;
|
|
461
|
+
total_tokens: number;
|
|
462
|
+
};
|
|
463
|
+
finish_reason?: string;
|
|
464
|
+
choices?: Array<{
|
|
465
|
+
message: {
|
|
466
|
+
role: string;
|
|
467
|
+
content: string;
|
|
468
|
+
};
|
|
469
|
+
finish_reason: string;
|
|
470
|
+
}>;
|
|
471
|
+
}
|
|
472
|
+
export interface MemorySetResponse extends BaseWebSocketResponse {
|
|
473
|
+
type: 'memorySetResponse';
|
|
474
|
+
key?: string;
|
|
475
|
+
value?: any;
|
|
476
|
+
}
|
|
477
|
+
export interface MemoryGetResponse extends BaseWebSocketResponse {
|
|
478
|
+
type: 'memoryGetResponse';
|
|
479
|
+
key?: string;
|
|
480
|
+
value?: any;
|
|
481
|
+
}
|
|
482
|
+
export interface MemoryDeleteResponse extends BaseWebSocketResponse {
|
|
483
|
+
type: 'memoryDeleteResponse';
|
|
484
|
+
key?: string;
|
|
485
|
+
}
|
|
486
|
+
export interface MemoryListResponse extends BaseWebSocketResponse {
|
|
487
|
+
type: 'memoryListResponse';
|
|
488
|
+
keys?: string[];
|
|
489
|
+
entries?: Record<string, any>;
|
|
490
|
+
}
|
|
491
|
+
export interface MemoryClearResponse extends BaseWebSocketResponse {
|
|
492
|
+
type: 'memoryClearResponse';
|
|
493
|
+
}
|
|
494
|
+
export interface AddTaskResponse extends BaseWebSocketResponse {
|
|
495
|
+
type: 'addTaskResponse';
|
|
496
|
+
task?: import('./commonTypes').Task;
|
|
497
|
+
}
|
|
498
|
+
export interface GetTasksResponse extends BaseWebSocketResponse {
|
|
499
|
+
type: 'getTasksResponse';
|
|
500
|
+
tasks?: import('./commonTypes').Task[];
|
|
501
|
+
}
|
|
502
|
+
export interface UpdateTasksResponse extends BaseWebSocketResponse {
|
|
503
|
+
type: 'updateTasksResponse';
|
|
504
|
+
task?: import('./commonTypes').Task;
|
|
505
|
+
}
|
|
506
|
+
export interface AddVectorItemResponse extends BaseWebSocketResponse {
|
|
507
|
+
type: 'addVectorItemResponse';
|
|
508
|
+
item?: import('./commonTypes').VectorItem;
|
|
509
|
+
}
|
|
510
|
+
export interface GetVectorResponse extends BaseWebSocketResponse {
|
|
511
|
+
type: 'getVectorResponse';
|
|
512
|
+
vector?: number[];
|
|
513
|
+
item?: import('./commonTypes').VectorItem;
|
|
514
|
+
}
|
|
515
|
+
export interface QueryVectorItemResponse extends BaseWebSocketResponse {
|
|
516
|
+
type: 'qeryVectorItemResponse' | 'queryVectorItemResponse';
|
|
517
|
+
item?: import('./commonTypes').VectorItem;
|
|
518
|
+
results?: import('./commonTypes').VectorQueryResult;
|
|
519
|
+
}
|
|
520
|
+
export interface QueryVectorItemsResponse extends BaseWebSocketResponse {
|
|
521
|
+
type: 'qeryVectorItemsResponse' | 'queryVectorItemsResponse';
|
|
522
|
+
items?: import('./commonTypes').VectorItem[];
|
|
523
|
+
results?: import('./commonTypes').VectorQueryResult;
|
|
524
|
+
}
|
|
525
|
+
export interface DebugAddLogResponse extends BaseWebSocketResponse {
|
|
526
|
+
type: 'debugAddLogResponse';
|
|
527
|
+
logId?: string;
|
|
528
|
+
timestamp?: string;
|
|
529
|
+
}
|
|
530
|
+
export interface OpenDebugBrowserResponse extends BaseWebSocketResponse {
|
|
531
|
+
type: 'openDebugBrowserResponse';
|
|
532
|
+
url?: string;
|
|
533
|
+
port?: number;
|
|
534
|
+
}
|
|
535
|
+
export interface DebugGetLogsResponse extends BaseWebSocketResponse {
|
|
536
|
+
type: 'debugGetLogsResponse';
|
|
537
|
+
logs?: Array<{
|
|
538
|
+
id: string;
|
|
539
|
+
message: string;
|
|
540
|
+
level: string;
|
|
541
|
+
timestamp: string;
|
|
542
|
+
metadata?: Record<string, any>;
|
|
543
|
+
}>;
|
|
544
|
+
}
|
|
545
|
+
export interface GetAllFilesMarkdownResponse extends BaseWebSocketResponse {
|
|
546
|
+
type: 'getAllFilesMarkdownResponse';
|
|
547
|
+
markdown?: string;
|
|
548
|
+
files?: Array<{
|
|
549
|
+
path: string;
|
|
550
|
+
content: string;
|
|
551
|
+
language?: string;
|
|
552
|
+
}>;
|
|
553
|
+
}
|
|
554
|
+
export interface MatchProblemResponse extends BaseWebSocketResponse {
|
|
555
|
+
type: 'matchProblemResponse';
|
|
556
|
+
matches?: Array<{
|
|
557
|
+
file: string;
|
|
558
|
+
line: number;
|
|
559
|
+
column: number;
|
|
560
|
+
message: string;
|
|
561
|
+
severity: 'error' | 'warning' | 'info';
|
|
562
|
+
}>;
|
|
563
|
+
}
|
|
564
|
+
export interface AnalyzeCodeResponse extends BaseWebSocketResponse {
|
|
565
|
+
type: 'analyzeCodeResponse';
|
|
566
|
+
analysis?: {
|
|
567
|
+
complexity: number;
|
|
568
|
+
maintainability: number;
|
|
569
|
+
issues: Array<{
|
|
570
|
+
type: string;
|
|
571
|
+
severity: string;
|
|
572
|
+
message: string;
|
|
573
|
+
file: string;
|
|
574
|
+
line: number;
|
|
575
|
+
}>;
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
export interface GetMatcherListTreeResponse extends BaseWebSocketResponse {
|
|
579
|
+
type: 'getMatcherListTreeResponse';
|
|
580
|
+
matchers?: Array<{
|
|
581
|
+
name: string;
|
|
582
|
+
description: string;
|
|
583
|
+
language: string;
|
|
584
|
+
pattern: string;
|
|
585
|
+
}>;
|
|
586
|
+
}
|
|
587
|
+
export interface getMatchDetail extends BaseWebSocketResponse {
|
|
588
|
+
type: 'getMatchDetailResponse';
|
|
589
|
+
matcher?: {
|
|
590
|
+
name: string;
|
|
591
|
+
description: string;
|
|
592
|
+
language: string;
|
|
593
|
+
pattern: string;
|
|
594
|
+
examples?: string[];
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
export interface FindAgentByTaskResponse extends BaseWebSocketResponse {
|
|
598
|
+
type: 'findAgentByTaskResponse';
|
|
599
|
+
agents?: import('./commonTypes').AgentFunction[];
|
|
600
|
+
}
|
|
601
|
+
export interface ListAgentsResponse extends BaseWebSocketResponse {
|
|
602
|
+
type: 'listAgentsResponse';
|
|
603
|
+
agents?: import('./commonTypes').AgentFunction[];
|
|
604
|
+
}
|
|
605
|
+
export interface AgentsDetailResponse extends BaseWebSocketResponse {
|
|
606
|
+
type: 'agentsDetailResponse';
|
|
607
|
+
payload?: {
|
|
608
|
+
agents: import('./commonTypes').AgentDetail[];
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
export interface TaskCompletionResponse extends BaseWebSocketResponse {
|
|
612
|
+
type: 'taskCompletionResponse';
|
|
613
|
+
from?: string;
|
|
614
|
+
agentId?: string;
|
|
615
|
+
task?: string;
|
|
616
|
+
result?: any;
|
|
617
|
+
}
|
|
618
|
+
export interface GetAppStateResponse extends BaseWebSocketResponse {
|
|
619
|
+
type: 'getAppStateResponse';
|
|
620
|
+
state?: Record<string, any>;
|
|
621
|
+
}
|
|
622
|
+
export interface UpdateProjectStateResponse extends BaseWebSocketResponse {
|
|
623
|
+
type: 'updateProjectStateResponse';
|
|
624
|
+
state?: Record<string, any>;
|
|
625
|
+
}
|
|
626
|
+
export interface GetAgentStateResponse extends BaseWebSocketResponse {
|
|
627
|
+
type: 'getAgentStateResponse';
|
|
628
|
+
payload?: Record<string, any>;
|
|
629
|
+
}
|
|
630
|
+
export interface AddToAgentStateResponse extends BaseWebSocketResponse {
|
|
631
|
+
type: 'addToAgentStateResponse';
|
|
632
|
+
payload?: {
|
|
633
|
+
success: boolean;
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
export interface GetChatHistoryResponse extends BaseWebSocketResponse {
|
|
637
|
+
type: 'getChatHistoryResponse';
|
|
638
|
+
messages?: Array<{
|
|
639
|
+
id: string;
|
|
640
|
+
content: string;
|
|
641
|
+
sender: string;
|
|
642
|
+
timestamp: string;
|
|
643
|
+
type: string;
|
|
644
|
+
}>;
|
|
645
|
+
agentId?: string;
|
|
646
|
+
}
|
|
647
|
+
export interface ChatSummaryResponse extends BaseWebSocketResponse {
|
|
648
|
+
type: 'chatSummaryResponse';
|
|
649
|
+
summary?: string;
|
|
650
|
+
messageCount?: number;
|
|
651
|
+
agentId?: string;
|
|
652
|
+
}
|
|
653
|
+
export interface GetSummarizeAllResponse extends BaseWebSocketResponse {
|
|
654
|
+
type: 'getSummarizeAllResponse';
|
|
655
|
+
payload?: string;
|
|
656
|
+
summary?: string;
|
|
657
|
+
}
|
|
658
|
+
export interface GetSummarizeResponse extends BaseWebSocketResponse {
|
|
659
|
+
type: 'getSummarizeResponse';
|
|
660
|
+
payload?: string;
|
|
661
|
+
summary?: string;
|
|
662
|
+
depth?: number;
|
|
663
|
+
}
|
|
664
|
+
export interface AddTokenResponse extends BaseWebSocketResponse {
|
|
665
|
+
type: 'addTokenResponse';
|
|
666
|
+
token?: string;
|
|
667
|
+
count?: number;
|
|
668
|
+
}
|
|
669
|
+
export interface GetTokenResponse extends BaseWebSocketResponse {
|
|
670
|
+
type: 'getTokenResponse';
|
|
671
|
+
tokens?: string[];
|
|
672
|
+
count?: number;
|
|
673
|
+
}
|
|
674
|
+
export interface GetProjectPathResponse extends BaseWebSocketResponse {
|
|
675
|
+
type: 'getProjectPathResponse';
|
|
676
|
+
projectPath?: string;
|
|
677
|
+
projectName?: string;
|
|
678
|
+
}
|
|
679
|
+
export interface GetProjectSettingsResponse extends BaseWebSocketResponse {
|
|
680
|
+
type: 'getProjectSettingsResponse';
|
|
681
|
+
projectSettings?: Record<string, any>;
|
|
682
|
+
}
|
|
683
|
+
export interface GetRepoMapResponse extends BaseWebSocketResponse {
|
|
684
|
+
type: 'getRepoMapResponse';
|
|
685
|
+
repoMap?: any;
|
|
686
|
+
}
|
|
687
|
+
export interface GetProjectStateResponse extends BaseWebSocketResponse {
|
|
688
|
+
type: 'getProjectStateResponse';
|
|
689
|
+
projectState?: Record<string, any>;
|
|
690
|
+
}
|
|
691
|
+
export interface CrawlerResponse extends BaseWebSocketResponse {
|
|
692
|
+
type: 'crawlerResponse';
|
|
693
|
+
url?: string;
|
|
694
|
+
content?: string;
|
|
695
|
+
links?: string[];
|
|
696
|
+
metadata?: {
|
|
697
|
+
title?: string;
|
|
698
|
+
description?: string;
|
|
699
|
+
images?: string[];
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
export interface ExecuteToolResponse extends BaseExecuteToolResponse {
|
|
703
|
+
type: 'executeToolResponse';
|
|
704
|
+
toolName?: string;
|
|
705
|
+
serverName?: string;
|
|
706
|
+
params?: any;
|
|
707
|
+
data?: [boolean, any] | {
|
|
708
|
+
error?: string;
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
export interface GetToolsResponse extends BaseWebSocketResponse {
|
|
712
|
+
type: 'getToolsResponse';
|
|
713
|
+
tools?: Array<{
|
|
714
|
+
name: string;
|
|
715
|
+
description: string;
|
|
716
|
+
parameters: Record<string, any>;
|
|
717
|
+
}>;
|
|
718
|
+
serverName?: string;
|
|
719
|
+
data?: any[];
|
|
720
|
+
}
|
|
721
|
+
export interface ConfigureToolBoxResponse extends BaseWebSocketResponse {
|
|
722
|
+
type: 'configureToolBoxResponse';
|
|
723
|
+
configuration?: Record<string, any>;
|
|
724
|
+
data?: any;
|
|
725
|
+
error?: string;
|
|
726
|
+
}
|
|
727
|
+
export interface GetEnabledToolBoxesResponse extends BaseWebSocketResponse {
|
|
728
|
+
type: 'getEnabledToolBoxesResponse';
|
|
729
|
+
data?: any[];
|
|
730
|
+
}
|
|
731
|
+
export interface GetAvailableToolBoxesResponse extends BaseWebSocketResponse {
|
|
732
|
+
type: 'getAvailableToolBoxesResponse';
|
|
733
|
+
data?: any[];
|
|
734
|
+
}
|
|
735
|
+
export interface GetLocalToolBoxesResponse extends BaseWebSocketResponse {
|
|
736
|
+
type: 'getLocalToolBoxesResponse';
|
|
737
|
+
data?: any[];
|
|
738
|
+
}
|
|
739
|
+
export interface SearchAvailableToolBoxesResponse extends BaseWebSocketResponse {
|
|
740
|
+
type: 'searchAvailableToolBoxesResponse';
|
|
741
|
+
data?: Record<string, any>;
|
|
742
|
+
}
|
|
743
|
+
export interface ListToolsFromToolBoxesResponse extends BaseWebSocketResponse {
|
|
744
|
+
type: 'listToolsFromToolBoxesResponse';
|
|
745
|
+
data?: any[];
|
|
746
|
+
error?: string;
|
|
747
|
+
}
|
|
748
|
+
export interface GetMcpToolsResponse extends BaseWebSocketResponse {
|
|
749
|
+
type: 'getMcpToolsResponse';
|
|
750
|
+
data?: any[];
|
|
751
|
+
}
|
|
752
|
+
export interface GetMcpListResponse extends BaseWebSocketResponse {
|
|
753
|
+
type: 'getMcpListResponse';
|
|
754
|
+
data?: any[];
|
|
755
|
+
}
|
|
756
|
+
export interface GetAllMCPToolsResponse extends BaseWebSocketResponse {
|
|
757
|
+
type: 'getAllMCPToolsResponse';
|
|
758
|
+
data?: any[];
|
|
759
|
+
}
|
|
760
|
+
export interface GetEnabledMCPSResponse extends BaseWebSocketResponse {
|
|
761
|
+
type: 'getEnabledMCPSResponse';
|
|
762
|
+
data?: any;
|
|
763
|
+
}
|
|
764
|
+
export interface ConfigureMCPToolResponse extends BaseWebSocketResponse {
|
|
765
|
+
type: 'configureMCPToolResponse';
|
|
766
|
+
data?: any;
|
|
767
|
+
error?: string;
|
|
768
|
+
}
|
|
769
|
+
export interface NotificationSendResponse extends BaseWebSocketResponse {
|
|
770
|
+
type: 'notificationSendResponse';
|
|
771
|
+
eventType?: string;
|
|
772
|
+
componentType?: string;
|
|
773
|
+
result?: string;
|
|
774
|
+
}
|
|
775
|
+
export interface JsTreeParseResponse extends BaseWebSocketResponse {
|
|
776
|
+
type: 'jsTreeParseResponse';
|
|
777
|
+
filePath?: string;
|
|
778
|
+
tree?: any;
|
|
779
|
+
data?: any;
|
|
780
|
+
}
|
|
781
|
+
export interface GetJsTreeResponse extends BaseWebSocketResponse {
|
|
782
|
+
type: 'getJsTreeResponse';
|
|
783
|
+
payload?: any;
|
|
784
|
+
trees?: any[];
|
|
785
|
+
}
|
|
786
|
+
export interface ProblemMatcherResponse extends BaseWebSocketResponse {
|
|
787
|
+
type: 'problemMatcherResponse';
|
|
788
|
+
problems?: Array<{
|
|
789
|
+
file: string;
|
|
790
|
+
line: number;
|
|
791
|
+
column: number;
|
|
792
|
+
message: string;
|
|
793
|
+
severity: 'error' | 'warning' | 'info';
|
|
794
|
+
}>;
|
|
795
|
+
}
|
|
796
|
+
export interface GetMatcherListResponse extends BaseWebSocketResponse {
|
|
797
|
+
type: 'getMatcherListResponse';
|
|
798
|
+
matchers?: Array<{
|
|
799
|
+
name: string;
|
|
800
|
+
description: string;
|
|
801
|
+
language: string;
|
|
802
|
+
pattern: string;
|
|
803
|
+
}>;
|
|
804
|
+
}
|
|
805
|
+
export interface GetMatchDetailResponse extends BaseWebSocketResponse {
|
|
806
|
+
type: 'getMatchDetailResponse';
|
|
807
|
+
matcher?: {
|
|
808
|
+
name: string;
|
|
809
|
+
description: string;
|
|
810
|
+
language: string;
|
|
811
|
+
pattern: string;
|
|
812
|
+
examples?: string[];
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
export interface ReadFileResponse extends BaseWebSocketResponse {
|
|
816
|
+
type: 'readFileResponse';
|
|
817
|
+
content?: string;
|
|
818
|
+
path?: string;
|
|
819
|
+
encoding?: string;
|
|
820
|
+
}
|
|
821
|
+
export interface CreateFileResponse extends BaseWebSocketResponse {
|
|
822
|
+
type: 'createFileResponse';
|
|
823
|
+
path?: string;
|
|
824
|
+
}
|
|
825
|
+
export interface WriteToFileResponse extends BaseWebSocketResponse {
|
|
826
|
+
type: 'writeToFileResponse';
|
|
827
|
+
path?: string;
|
|
828
|
+
bytesWritten?: number;
|
|
829
|
+
}
|
|
830
|
+
export interface DeleteFileResponse extends BaseWebSocketResponse {
|
|
831
|
+
type: 'deleteFileResponse';
|
|
832
|
+
path?: string;
|
|
833
|
+
}
|
|
834
|
+
export interface ListDirectoryResponse extends BaseWebSocketResponse {
|
|
835
|
+
type: 'listDirectoryResponse';
|
|
836
|
+
path?: string;
|
|
837
|
+
files?: string[];
|
|
838
|
+
directories?: string[];
|
|
839
|
+
entries?: Array<{
|
|
840
|
+
name: string;
|
|
841
|
+
isDirectory: boolean;
|
|
842
|
+
size?: number;
|
|
843
|
+
modified?: string;
|
|
844
|
+
}>;
|
|
845
|
+
}
|
|
846
|
+
export interface CreateDirectoryResponse extends BaseWebSocketResponse {
|
|
847
|
+
type: 'createDirectoryResponse';
|
|
848
|
+
path?: string;
|
|
849
|
+
}
|
|
850
|
+
export interface SearchFilesResponse extends BaseWebSocketResponse {
|
|
851
|
+
type: 'searchFilesResponse';
|
|
852
|
+
query?: string;
|
|
853
|
+
results?: Array<{
|
|
854
|
+
path: string;
|
|
855
|
+
matches: Array<{
|
|
856
|
+
line: number;
|
|
857
|
+
content: string;
|
|
858
|
+
lineNumber: number;
|
|
859
|
+
}>;
|
|
860
|
+
}>;
|
|
861
|
+
}
|
|
862
|
+
export interface GetFileInfoResponse extends BaseWebSocketResponse {
|
|
863
|
+
type: 'getFileInfoResponse';
|
|
864
|
+
path?: string;
|
|
865
|
+
size?: number;
|
|
866
|
+
modified?: string;
|
|
867
|
+
created?: string;
|
|
868
|
+
isDirectory?: boolean;
|
|
869
|
+
permissions?: string;
|
|
870
|
+
}
|
|
871
|
+
export interface MoveFileResponse extends BaseWebSocketResponse {
|
|
872
|
+
type: 'moveFileResponse';
|
|
873
|
+
from?: string;
|
|
874
|
+
to?: string;
|
|
875
|
+
}
|
|
876
|
+
export interface CopyFileResponse extends BaseWebSocketResponse {
|
|
877
|
+
type: 'copyFileResponse';
|
|
878
|
+
from?: string;
|
|
879
|
+
to?: string;
|
|
880
|
+
}
|
|
881
|
+
export interface GetWorkingDirectoryResponse extends BaseWebSocketResponse {
|
|
882
|
+
type: 'getWorkingDirectoryResponse';
|
|
883
|
+
path?: string;
|
|
884
|
+
}
|
|
885
|
+
export interface WatchFileResponse extends BaseWebSocketResponse {
|
|
886
|
+
type: 'watchFileResponse';
|
|
887
|
+
path?: string;
|
|
888
|
+
event?: 'change' | 'add' | 'unlink';
|
|
889
|
+
}
|
|
890
|
+
export interface CreateFolderResponse extends BaseWebSocketResponse {
|
|
891
|
+
type: 'createFolderResponse';
|
|
892
|
+
path?: string;
|
|
893
|
+
}
|
|
894
|
+
export interface UpdateFileResponse extends BaseWebSocketResponse {
|
|
895
|
+
type: 'updateFileResponse';
|
|
896
|
+
path?: string;
|
|
897
|
+
bytesWritten?: number;
|
|
898
|
+
}
|
|
899
|
+
export interface DeleteFolderResponse extends BaseWebSocketResponse {
|
|
900
|
+
type: 'deleteFolderResponse';
|
|
901
|
+
path?: string;
|
|
902
|
+
}
|
|
903
|
+
export interface ErrorResponse extends BaseWebSocketResponse {
|
|
904
|
+
type: 'error';
|
|
905
|
+
success: false;
|
|
906
|
+
error: string;
|
|
907
|
+
code?: string;
|
|
908
|
+
details?: any;
|
|
909
|
+
}
|
|
910
|
+
export type CLIWebSocketResponse = ReadFileResponse | CreateFileResponse | WriteToFileResponse | DeleteFileResponse | ListDirectoryResponse | CreateDirectoryResponse | SearchFilesResponse | GetFileInfoResponse | MoveFileResponse | CopyFileResponse | GetWorkingDirectoryResponse | WatchFileResponse | CreateFolderResponse | UpdateFileResponse | DeleteFolderResponse | FsReadFileResponse | FsWriteToFileResponse | FsListFilesResponse | FsListCodeDefinitionsResponse | FsSearchFilesResponse | FsGrepSearchResponse | FsFileSearchResponse | FsCreateFileResponse | FsCreateFolderResponse | FsUpdateFileResponse | FsDeleteFileResponse | FsDeleteFolderResponse | FsEditFileAndApplyDiffResponse | FsExecuteToolResponse | BrowserActionResponseData | BrowserScreenshotResponse | BrowserNavigationResponse | BrowserContentResponse | BrowserInfoResponse | BrowserSnapshotResponse | GoToPageResponse | UrlResponse | GetMarkdownResponse | HtmlReceived | ExtractTextResponse | GetContentResponse | TerminalExecuteResponse | CommandError | CommandFinish | CommandOutput | TerminalInterruptResponse | TerminalInterrupted | GitInitResponse | GitCommitResponse | GitStatusResponse | GitLogsResponse | GitPushResponse | GitPullResponse | GitDiffResponse | GitCheckoutResponse | GitBranchResponse | GitCloneResponse | AddResponse | MemorySetResponse | MemoryGetResponse | MemoryDeleteResponse | MemoryListResponse | MemoryClearResponse | AddTaskResponse | GetTasksResponse | UpdateTasksResponse | AddVectorItemResponse | GetVectorResponse | QueryVectorItemResponse | QueryVectorItemsResponse | DebugAddLogResponse | OpenDebugBrowserResponse | DebugGetLogsResponse | GetAllFilesMarkdownResponse | MatchProblemResponse | AnalyzeCodeResponse | GetMatcherListTreeResponse | getMatchDetail | GetJsTreeResponse | ProblemMatcherResponse | GetMatcherListResponse | GetMatchDetailResponse | JsTreeParseResponse | NotificationSendResponse | FindAgentByTaskResponse | ListAgentsResponse | AgentsDetailResponse | TaskCompletionResponse | GetAppStateResponse | UpdateProjectStateResponse | GetAgentStateResponse | AddToAgentStateResponse | GetChatHistoryResponse | ChatSummaryResponse | ChatMessage | UserMessage | GetSummarizeAllResponse | GetSummarizeResponse | LLMResponse | AddTokenResponse | GetTokenResponse | GetProjectPathResponse | GetProjectSettingsResponse | GetRepoMapResponse | GetProjectStateResponse | CrawlerResponse | ExecuteToolResponse | GetToolsResponse | ConfigureToolBoxResponse | GetEnabledToolBoxesResponse | GetAvailableToolBoxesResponse | GetLocalToolBoxesResponse | SearchAvailableToolBoxesResponse | ListToolsFromToolBoxesResponse | GetMcpToolsResponse | GetMcpListResponse | GetAllMCPToolsResponse | GetEnabledMCPSResponse | ConfigureMCPToolResponse | ErrorResponse;
|
|
911
|
+
export interface ServiceResponseTypeMap {
|
|
912
|
+
filesystem: ReadFileResponse | CreateFileResponse | WriteToFileResponse | DeleteFileResponse | ListDirectoryResponse;
|
|
913
|
+
fsService: FsReadFileResponse | FsWriteToFileResponse | FsListFilesResponse | FsListCodeDefinitionsResponse | FsSearchFilesResponse | FsGrepSearchResponse | FsFileSearchResponse | FsCreateFileResponse | FsCreateFolderResponse | FsUpdateFileResponse | FsDeleteFileResponse | FsDeleteFolderResponse | FsEditFileAndApplyDiffResponse | FsExecuteToolResponse;
|
|
914
|
+
browser: BrowserActionResponseData | BrowserScreenshotResponse | BrowserNavigationResponse;
|
|
915
|
+
terminal: TerminalExecuteResponse;
|
|
916
|
+
git: GitInitResponse | GitCommitResponse | GitStatusResponse | GitLogsResponse | GitPushResponse | GitPullResponse | GitDiffResponse;
|
|
917
|
+
memory: MemorySetResponse | MemoryGetResponse | MemoryDeleteResponse;
|
|
918
|
+
tasks: AddTaskResponse | GetTasksResponse | UpdateTasksResponse;
|
|
919
|
+
vectordb: AddVectorItemResponse | GetVectorResponse | QueryVectorItemResponse;
|
|
920
|
+
debug: DebugAddLogResponse | OpenDebugBrowserResponse;
|
|
921
|
+
codeutils: GetAllFilesMarkdownResponse | MatchProblemResponse | GetJsTreeResponse;
|
|
922
|
+
agents: FindAgentByTaskResponse | ListAgentsResponse | AgentsDetailResponse;
|
|
923
|
+
state: GetAppStateResponse | UpdateProjectStateResponse | GetAgentStateResponse | AddToAgentStateResponse;
|
|
924
|
+
chat: GetChatHistoryResponse | ChatSummaryResponse | GetSummarizeAllResponse | GetSummarizeResponse;
|
|
925
|
+
crawler: CrawlerResponse;
|
|
926
|
+
mcp: ExecuteToolResponse | GetToolsResponse | ConfigureToolBoxResponse | GetEnabledToolBoxesResponse | GetAvailableToolBoxesResponse | GetLocalToolBoxesResponse | SearchAvailableToolBoxesResponse | ListToolsFromToolBoxesResponse | GetMcpToolsResponse | GetMcpListResponse | GetAllMCPToolsResponse | GetEnabledMCPSResponse | ConfigureMCPToolResponse;
|
|
927
|
+
project: GetProjectPathResponse | GetProjectSettingsResponse | GetRepoMapResponse | GetProjectStateResponse;
|
|
928
|
+
notification: NotificationSendResponse;
|
|
929
|
+
problemMatcher: ProblemMatcherResponse | GetMatcherListResponse | GetMatchDetailResponse;
|
|
930
|
+
jsTreeParser: JsTreeParseResponse;
|
|
931
|
+
}
|
|
932
|
+
export type SuccessResponse<T = any> = CLIWebSocketResponse & {
|
|
933
|
+
success: true;
|
|
934
|
+
data?: T;
|
|
935
|
+
};
|
|
936
|
+
export type FailureResponse = CLIWebSocketResponse & {
|
|
937
|
+
success: false;
|
|
938
|
+
error: string;
|
|
939
|
+
};
|
|
940
|
+
export type WebSocketMessageHandler<T extends CLIWebSocketResponse = CLIWebSocketResponse> = (response: T) => void | Promise<void>;
|
|
941
|
+
export type ServiceWebSocketHandler<K extends keyof ServiceResponseTypeMap> = WebSocketMessageHandler<ServiceResponseTypeMap[K]>;
|
|
942
|
+
export declare function isSuccessResponse(response: CLIWebSocketResponse): response is CLIWebSocketResponse & {
|
|
943
|
+
success: true;
|
|
944
|
+
};
|
|
945
|
+
export declare function isFailureResponse(response: CLIWebSocketResponse): response is CLIWebSocketResponse & {
|
|
946
|
+
success: false;
|
|
947
|
+
};
|
|
948
|
+
export declare function isErrorResponse(response: CLIWebSocketResponse): response is ErrorResponse;
|
|
949
|
+
export declare function isBrowserResponse(response: CLIWebSocketResponse): response is BrowserActionResponseData;
|
|
950
|
+
export declare function isGitResponse(response: CLIWebSocketResponse): response is GitInitResponse | GitCommitResponse | GitStatusResponse;
|
|
951
|
+
export declare function isFsServiceResponse(response: CLIWebSocketResponse): response is FsReadFileResponse | FsWriteToFileResponse | FsListFilesResponse | FsListCodeDefinitionsResponse | FsSearchFilesResponse | FsGrepSearchResponse | FsFileSearchResponse | FsCreateFileResponse | FsCreateFolderResponse | FsUpdateFileResponse | FsDeleteFileResponse | FsDeleteFolderResponse | FsEditFileAndApplyDiffResponse | FsExecuteToolResponse;
|