@codebolt/codeboltjs 2.2.1 → 2.2.3

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.
Files changed (72) hide show
  1. package/Readme.md +3 -0
  2. package/dist/core/Codebolt.d.ts +212 -165
  3. package/dist/core/Codebolt.js +267 -6
  4. package/dist/core/websocket.js +9 -11
  5. package/dist/index.d.ts +1 -1
  6. package/dist/modules/agent.d.ts +2 -16
  7. package/dist/modules/agent.js +15 -33
  8. package/dist/modules/browser.d.ts +1 -1
  9. package/dist/modules/browser.js +52 -51
  10. package/dist/modules/chat.d.ts +2 -2
  11. package/dist/modules/chat.js +20 -18
  12. package/dist/modules/codeutils.d.ts +1 -9
  13. package/dist/modules/codeutils.js +13 -111
  14. package/dist/modules/dbmemory.d.ts +3 -3
  15. package/dist/modules/dbmemory.js +8 -7
  16. package/dist/modules/debug.d.ts +1 -1
  17. package/dist/modules/fs.d.ts +59 -28
  18. package/dist/modules/fs.js +86 -45
  19. package/dist/modules/git.d.ts +1 -1
  20. package/dist/modules/git.js +31 -30
  21. package/dist/modules/history.d.ts +1 -1
  22. package/dist/modules/history.js +7 -6
  23. package/dist/modules/llm.d.ts +13 -20
  24. package/dist/modules/llm.js +16 -15
  25. package/dist/modules/mcp.d.ts +4 -4
  26. package/dist/modules/mcp.js +25 -25
  27. package/dist/modules/outputparsers.d.ts +22 -22
  28. package/dist/modules/outputparsers.js +7 -5
  29. package/dist/modules/project.d.ts +1 -1
  30. package/dist/modules/project.js +15 -13
  31. package/dist/modules/state.d.ts +1 -1
  32. package/dist/modules/state.js +16 -15
  33. package/dist/modules/task.d.ts +136 -92
  34. package/dist/modules/task.js +354 -205
  35. package/dist/modules/terminal.d.ts +1 -1
  36. package/dist/modules/terminal.js +12 -11
  37. package/dist/modules/tokenizer.d.ts +1 -1
  38. package/dist/modules/tokenizer.js +7 -6
  39. package/dist/modules/user-message-manager.d.ts +165 -0
  40. package/dist/modules/user-message-manager.js +308 -0
  41. package/dist/modules/user-message-utilities.d.ts +111 -0
  42. package/dist/modules/user-message-utilities.js +115 -0
  43. package/dist/modules/utils.d.ts +1 -1
  44. package/dist/modules/utils.js +4 -3
  45. package/dist/modules/vectordb.d.ts +1 -1
  46. package/dist/modules/vectordb.js +13 -12
  47. package/dist/notificationfunctions/agent.js +7 -6
  48. package/dist/notificationfunctions/browser.js +9 -8
  49. package/dist/notificationfunctions/chat.js +9 -8
  50. package/dist/notificationfunctions/codeutils.js +9 -8
  51. package/dist/notificationfunctions/crawler.js +9 -8
  52. package/dist/notificationfunctions/dbmemory.js +9 -8
  53. package/dist/notificationfunctions/fs.js +45 -44
  54. package/dist/notificationfunctions/git.d.ts +2 -2
  55. package/dist/notificationfunctions/git.js +111 -51
  56. package/dist/notificationfunctions/history.js +9 -8
  57. package/dist/notificationfunctions/llm.js +9 -8
  58. package/dist/notificationfunctions/mcp.js +17 -16
  59. package/dist/notificationfunctions/search.js +13 -12
  60. package/dist/notificationfunctions/system.js +5 -4
  61. package/dist/notificationfunctions/terminal.js +5 -4
  62. package/dist/notificationfunctions/todo.js +13 -12
  63. package/dist/types/commonTypes.d.ts +4 -0
  64. package/dist/types/index.d.ts +1 -1
  65. package/dist/types/libFunctionTypes.d.ts +918 -29
  66. package/dist/types/libFunctionTypes.js +33 -0
  67. package/dist/types/notificationFunctions/git.d.ts +40 -1
  68. package/dist/types/notificationFunctions/index.d.ts +1 -0
  69. package/dist/types/notificationFunctions/index.js +1 -0
  70. package/package.json +17 -25
  71. package/dist/modules/codeparsers.d.ts +0 -37
  72. package/dist/modules/codeparsers.js +0 -329
package/Readme.md CHANGED
@@ -121,6 +121,9 @@ For detailed type usage examples, see [TYPES.md](./TYPES.md).
121
121
  - `codebolt.agent` - Agent operations
122
122
  - `codebolt.vectordb` - Vector database operations
123
123
  - `codebolt.mcp` - MCP (Model Context Protocol) tools
124
+ - `codebolt.codeparsers` - Code parsing and AST generation (migrated from internal module)
125
+
126
+ > **Note**: The `codeparsers` functions have been migrated to the `@codebolt/codeparser` package for better modularity. You can still access them through `codebolt.codeparsers` or import directly from `@codebolt/codeparser`. See [CODEPARSERS_MIGRATION.md](./CODEPARSERS_MIGRATION.md) for details.
124
127
 
125
128
  ### Example Usage
126
129
 
@@ -1,6 +1,7 @@
1
1
  import WebSocket from 'ws';
2
2
  import { type NotificationFunctions } from '../notificationfunctions';
3
- import type { UserMessage } from '../types/libFunctionTypes';
3
+ import type { FlatUserMessage } from '@codebolt/types/sdk';
4
+ import { RawMessageForAgent, ProviderInitVars } from '@codebolt/types/provider';
4
5
  /**
5
6
  * @class Codebolt
6
7
  * @description This class provides a unified interface to interact with various modules.
@@ -34,87 +35,87 @@ declare class Codebolt {
34
35
  */
35
36
  get ready(): boolean;
36
37
  fs: {
37
- createFile: (fileName: string, source: string, filePath: string) => Promise<import("../types/socketMessageTypes").CreateFileResponse>;
38
- createFolder: (folderName: string, folderPath: string) => Promise<import("../types/socketMessageTypes").CreateFolderResponse>;
39
- readFile: (filePath: string) => Promise<import("../types/socketMessageTypes").ReadFileResponse>;
40
- updateFile: (filename: string, filePath: string, newContent: string) => Promise<import("../types/socketMessageTypes").UpdateFileResponse>;
41
- deleteFile: (filename: string, filePath: string) => Promise<import("../types/socketMessageTypes").DeleteFileResponse>;
42
- deleteFolder: (foldername: string, folderpath: string) => Promise<import("../types/socketMessageTypes").DeleteFolderResponse>;
43
- listFile: (folderPath: string, isRecursive?: boolean) => Promise<any>;
44
- listCodeDefinitionNames: (path: string) => Promise<{
45
- success: boolean;
46
- result: any;
47
- }>;
48
- searchFiles: (path: string, regex: string, filePattern: string) => Promise<{
49
- success: boolean;
50
- result: any;
51
- }>;
38
+ createFile: (fileName: string, source: string, filePath: string) => Promise<import("@codebolt/types/sdk").CreateFileResponse>;
39
+ createFolder: (folderName: string, folderPath: string) => Promise<import("@codebolt/types/sdk").CreateFolderResponse>;
40
+ readFile: (filePath: string) => Promise<import("@codebolt/types/sdk").ReadFileResponse>;
41
+ updateFile: (filename: string, filePath: string, newContent: string) => Promise<import("@codebolt/types/sdk").UpdateFileResponse>;
42
+ deleteFile: (filename: string, filePath: string) => Promise<import("@codebolt/types/sdk").DeleteFileResponse>;
43
+ deleteFolder: (foldername: string, folderpath: string) => Promise<import("@codebolt/types/sdk").DeleteFolderResponse>;
44
+ listFile: (folderPath: string, isRecursive?: boolean) => Promise<import("@codebolt/types/sdk").FileListResponse>;
45
+ listCodeDefinitionNames: (path: string) => Promise<import("@codebolt/types/sdk").ListCodeDefinitionsResponse>;
46
+ searchFiles: (path: string, regex: string, filePattern: string) => Promise<import("@codebolt/types/sdk").SearchFilesResponse>;
52
47
  writeToFile: (relPath: string, newContent: string) => Promise<any>;
53
- grepSearch: (path: string, query: string, includePattern?: string, excludePattern?: string, caseSensitive?: boolean) => Promise<{
54
- success: boolean;
55
- result: any;
56
- }>;
57
- fileSearch: (query: string) => Promise<{
58
- success: boolean;
59
- result: any;
60
- }>;
61
- editFileWithDiff: (targetFile: string, codeEdit: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<{
62
- success: boolean;
63
- result: any;
64
- }>;
48
+ grepSearch: (path: string, query: string, includePattern?: string, excludePattern?: string, caseSensitive?: boolean) => Promise<import("@codebolt/types/sdk").GrepSearchResponse>;
49
+ fileSearch: (query: string) => Promise<import("@codebolt/types/sdk").FileSearchResponse>;
50
+ editFileWithDiff: (targetFile: string, codeEdit: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<import("@codebolt/types/sdk").EditFileAndApplyDiffResponse>;
51
+ readManyFiles: (params: {
52
+ paths: string[];
53
+ include?: string[];
54
+ exclude?: string[];
55
+ recursive?: boolean;
56
+ use_default_excludes?: boolean;
57
+ max_files?: number;
58
+ max_total_size?: number;
59
+ include_metadata?: boolean;
60
+ separator_format?: string;
61
+ notifyUser?: boolean;
62
+ }) => Promise<import("@codebolt/types/sdk").ReadManyFilesResponse>;
63
+ listDirectory: (params: {
64
+ path: string;
65
+ ignore?: string[];
66
+ show_hidden?: boolean;
67
+ detailed?: boolean;
68
+ limit?: number;
69
+ notifyUser?: boolean;
70
+ }) => Promise<import("@codebolt/types/sdk").ListDirectoryResponse>;
65
71
  };
66
72
  git: {
67
- init: (path: string) => Promise<import("../types/socketMessageTypes").GitInitResponse>;
68
- pull: () => Promise<import("../types/socketMessageTypes").GitPullResponse>;
69
- push: () => Promise<import("../types/socketMessageTypes").GitPushResponse>;
70
- status: () => Promise<import("../types/socketMessageTypes").GitStatusResponse>;
71
- addAll: () => Promise<import("../types/socketMessageTypes").AddResponse>;
72
- commit: (message: string) => Promise<import("../types/socketMessageTypes").GitCommitResponse>;
73
- checkout: (branch: string) => Promise<import("../types/socketMessageTypes").GitCheckoutResponse>;
74
- branch: (branch: string) => Promise<import("../types/socketMessageTypes").GitBranchResponse>;
75
- logs: (path: string) => Promise<import("../types/socketMessageTypes").GitLogsResponse>;
76
- diff: (commitHash: string) => Promise<import("../types/socketMessageTypes").GitDiffResponse>;
73
+ init: (path: string) => Promise<import("@codebolt/types/sdk").GitInitResponse>;
74
+ pull: () => Promise<import("@codebolt/types/sdk").GitPullResponse>;
75
+ push: () => Promise<import("@codebolt/types/sdk").GitPushResponse>;
76
+ status: () => Promise<import("@codebolt/types/sdk").GitStatusResponse>;
77
+ addAll: () => Promise<import("@codebolt/types/sdk").AddResponse>;
78
+ commit: (message: string) => Promise<import("@codebolt/types/sdk").GitCommitResponse>;
79
+ checkout: (branch: string) => Promise<import("@codebolt/types/sdk").GitCheckoutResponse>;
80
+ branch: (branch: string) => Promise<import("@codebolt/types/sdk").GitBranchResponse>;
81
+ logs: (path: string) => Promise<import("@codebolt/types/sdk").GitLogsResponse>;
82
+ diff: (commitHash: string) => Promise<import("@codebolt/types/sdk").GitDiffResponse>;
77
83
  };
78
84
  llm: {
79
- inference: (params: {
80
- messages: import("../types/libFunctionTypes").Message[];
81
- tools?: any[];
82
- tool_choice?: string;
83
- full?: boolean;
84
- llmrole?: string;
85
- max_tokens?: number;
86
- temperature?: number;
87
- stream?: boolean;
88
- }, llmrole?: string) => Promise<{
89
- completion: any;
85
+ inference: (params: import("@codebolt/types/sdk").LLMInferenceParams) => Promise<{
86
+ completion: import("@codebolt/types/sdk").LLMCompletion;
87
+ }>;
88
+ getModelConfig: (modelId?: string) => Promise<{
89
+ config: import("@codebolt/types/sdk").LLMModelConfig | null;
90
+ success: boolean;
91
+ error?: string;
90
92
  }>;
91
- legacyInference: (message: string, llmrole: string) => Promise<import("../types/socketMessageTypes").LLMResponse>;
92
93
  };
93
94
  browser: {
94
- newPage: () => Promise<import("../types/socketMessageTypes").BrowserActionResponseData>;
95
- getUrl: () => Promise<import("../types/socketMessageTypes").UrlResponse>;
96
- goToPage: (url: string) => Promise<import("../types/socketMessageTypes").GoToPageResponse>;
97
- screenshot: () => Promise<import("../types/socketMessageTypes").BrowserScreenshotResponse>;
98
- getHTML: () => Promise<import("../types/socketMessageTypes").HtmlReceived>;
99
- getMarkdown: () => Promise<import("../types/socketMessageTypes").GetMarkdownResponse>;
95
+ newPage: () => Promise<import("@codebolt/types/sdk").BrowserActionResponseData>;
96
+ getUrl: () => Promise<import("@codebolt/types/sdk").UrlResponse>;
97
+ goToPage: (url: string) => Promise<import("@codebolt/types/sdk").GoToPageResponse>;
98
+ screenshot: () => Promise<import("@codebolt/types/sdk").BrowserScreenshotResponse>;
99
+ getHTML: () => Promise<import("@codebolt/types/sdk").HtmlReceived>;
100
+ getMarkdown: () => Promise<import("@codebolt/types/sdk").GetMarkdownResponse>;
100
101
  getPDF: () => void;
101
102
  pdfToText: () => void;
102
- getContent: () => Promise<import("../types/socketMessageTypes").GetContentResponse>;
103
- getSnapShot: () => Promise<import("../types/socketMessageTypes").BrowserSnapshotResponse>;
104
- getBrowserInfo: () => Promise<import("../types/socketMessageTypes").BrowserInfoResponse>;
105
- extractText: () => Promise<import("../types/socketMessageTypes").ExtractTextResponse>;
103
+ getContent: () => Promise<import("@codebolt/types/sdk").GetContentResponse>;
104
+ getSnapShot: () => Promise<import("@codebolt/types/sdk").BrowserSnapshotResponse>;
105
+ getBrowserInfo: () => Promise<import("@codebolt/types/sdk").BrowserInfoResponse>;
106
+ extractText: () => Promise<import("@codebolt/types/sdk").ExtractTextResponse>;
106
107
  close: () => void;
107
- scroll: (direction: string, pixels: string) => Promise<import("../types/socketMessageTypes").BrowserActionResponseData>;
108
- type: (elementid: string, text: string) => Promise<import("../types/socketMessageTypes").BrowserActionResponseData>;
109
- click: (elementid: string) => Promise<import("../types/socketMessageTypes").BrowserActionResponseData>;
110
- enter: () => Promise<import("../types/socketMessageTypes").BrowserActionResponseData>;
111
- search: (elementid: string, query: string) => Promise<import("../types/socketMessageTypes").BrowserActionResponseData>;
108
+ scroll: (direction: string, pixels: string) => Promise<import("@codebolt/types/sdk").BrowserActionResponseData>;
109
+ type: (elementid: string, text: string) => Promise<import("@codebolt/types/sdk").BrowserActionResponseData>;
110
+ click: (elementid: string) => Promise<import("@codebolt/types/sdk").BrowserActionResponseData>;
111
+ enter: () => Promise<import("@codebolt/types/sdk").BrowserActionResponseData>;
112
+ search: (elementid: string, query: string) => Promise<import("@codebolt/types/sdk").BrowserActionResponseData>;
112
113
  };
113
114
  chat: {
114
- getChatHistory: () => Promise<import("../types/socketMessageTypes").ChatMessage[]>;
115
+ getChatHistory: (threadId: string) => Promise<import("@codebolt/types/sdk").ChatMessage>;
115
116
  setRequestHandler: (handler: (request: any, response: (data: any) => void) => Promise<void> | void) => void;
116
117
  sendMessage: (message: string, payload: any) => void;
117
- waitforReply: (message: string) => Promise<import("../types/socketMessageTypes").UserMessage>;
118
+ waitforReply: (message: string) => Promise<import("@codebolt/types/sdk").UserMessage>;
118
119
  processStarted: (onStopClicked?: (message: any) => void) => {
119
120
  stopProcess: () => void;
120
121
  cleanup: () => void;
@@ -149,8 +150,8 @@ declare class Codebolt {
149
150
  eventNames(): (string | symbol)[];
150
151
  };
151
152
  executeCommand: (command: string, returnEmptyStringOnSuccess?: boolean) => Promise<any>;
152
- executeCommandRunUntilError: (command: string, executeInMain?: boolean) => Promise<import("../types/socketMessageTypes").CommandError>;
153
- sendManualInterrupt(): Promise<import("../types/socketMessageTypes").TerminalInterruptResponse>;
153
+ executeCommandRunUntilError: (command: string, executeInMain?: boolean) => Promise<import("@codebolt/types/sdk").CommandError>;
154
+ sendManualInterrupt(): Promise<import("@codebolt/types/sdk").TerminalInterruptResponse>;
154
155
  executeCommandWithStream(command: string, executeInMain?: boolean): {
155
156
  cleanup?: () => void;
156
157
  [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
@@ -172,11 +173,10 @@ declare class Codebolt {
172
173
  };
173
174
  };
174
175
  codeutils: {
175
- getJsTree: (filePath?: string) => Promise<import("../types/InternalTypes").JSTreeResponse>;
176
176
  getAllFilesAsMarkDown: () => Promise<string>;
177
- performMatch: (matcherDefinition: object, problemPatterns: any[], problems?: any[]) => Promise<import("../types/socketMessageTypes").MatchProblemResponse>;
178
- getMatcherList: () => Promise<import("../types/socketMessageTypes").GetMatcherListTreeResponse>;
179
- matchDetail: (matcher: string) => Promise<import("../types/socketMessageTypes").getMatchDetail>;
177
+ performMatch: (matcherDefinition: object, problemPatterns: any[], problems?: any[]) => Promise<import("@codebolt/types/sdk").MatchProblemResponse>;
178
+ getMatcherList: () => Promise<import("@codebolt/types/sdk").GetMatcherListTreeResponse>;
179
+ matchDetail: (matcher: string) => Promise<import("@codebolt/types/sdk").getMatchDetail>;
180
180
  };
181
181
  crawler: {
182
182
  start: () => void;
@@ -196,130 +196,134 @@ declare class Codebolt {
196
196
  add_file: (filename: string, file_path: string) => void;
197
197
  retrieve_related_knowledge: (query: string, filename: string) => void;
198
198
  };
199
- codeparsers: {
200
- getClassesInFile: (file: string) => Promise<{
201
- error: string;
202
- } | {
203
- name: any;
204
- location: string;
205
- }[]>;
206
- getFunctionsinClass: (file: string, className: string) => Promise<{
207
- error: string;
208
- } | {
209
- name: string;
210
- class: string;
211
- location: string;
212
- }[]>;
213
- getAstTreeInFile: (file: string, className?: string) => Promise<import("..").ASTNode | {
214
- error: string;
215
- }>;
216
- };
217
199
  outputparsers: {
218
- parseJSON: (jsonString: string) => {
219
- success: boolean;
220
- parsed?: any;
221
- error?: Error;
222
- };
223
- parseXML: (xmlString: string) => {
224
- success: boolean;
225
- parsed?: any;
226
- };
227
- parseCSV: (csvString: string) => {
228
- success: boolean;
229
- parsed?: any[];
230
- error?: Error;
231
- };
232
- parseText: (text: string) => {
233
- success: boolean;
234
- parsed: string[];
235
- };
236
- parseErrors: (output: any) => string[];
237
- parseWarnings: (output: any) => string[];
200
+ parseJSON: (jsonString: string) => import("../modules/outputparsers").ParseResult<unknown>;
201
+ parseXML: (xmlString: string) => import("../modules/outputparsers").ParseResult<{
202
+ rootElement: string;
203
+ [key: string]: unknown;
204
+ }>;
205
+ parseCSV: (csvString: string) => import("../modules/outputparsers").ParseResult<import("../modules/outputparsers").CSVRow[]>;
206
+ parseText: (text: string) => import("../modules/outputparsers").ParseResult<string[]>;
207
+ parseErrors: (output: import("../modules/outputparsers").ParsableOutput) => string[];
208
+ parseWarnings: (output: import("../modules/outputparsers").ParsableOutput) => string[];
238
209
  };
239
210
  project: {
240
- getProjectSettings: () => Promise<import("../types/socketMessageTypes").GetProjectSettingsResponse>;
241
- getProjectPath: () => Promise<import("../types/socketMessageTypes").GetProjectPathResponse>;
242
- getRepoMap: (message: any) => Promise<import("../types/socketMessageTypes").GetProjectPathResponse>;
211
+ getProjectSettings: () => Promise<import("@codebolt/types/sdk").GetProjectSettingsResponse>;
212
+ getProjectPath: () => Promise<import("@codebolt/types/sdk").GetProjectPathResponse>;
213
+ getRepoMap: (message: any) => Promise<import("@codebolt/types/sdk").GetProjectPathResponse>;
243
214
  runProject: () => void;
244
215
  getEditorFileStatus: () => Promise<any>;
245
216
  };
246
217
  dbmemory: {
247
- addKnowledge: (key: string, value: any) => Promise<import("../types/socketMessageTypes").MemorySetResponse>;
248
- getKnowledge: (key: string) => Promise<import("../types/socketMessageTypes").MemoryGetResponse>;
218
+ addKnowledge: (key: string, value: import("@codebolt/types/sdk").MemoryValue) => Promise<import("@codebolt/types/sdk").MemorySetResponse>;
219
+ getKnowledge: (key: string) => Promise<import("@codebolt/types/sdk").MemoryGetResponse>;
249
220
  };
250
221
  cbstate: {
251
222
  getApplicationState: () => Promise<import("../types/commonTypes").ApplicationState>;
252
- addToAgentState: (key: string, value: string) => Promise<import("../types/socketMessageTypes").AddToAgentStateResponse>;
253
- getAgentState: () => Promise<import("../types/socketMessageTypes").GetAgentStateResponse>;
254
- getProjectState: () => Promise<import("../types/socketMessageTypes").GetProjectStateResponse>;
255
- updateProjectState: (key: string, value: any) => Promise<import("../types/socketMessageTypes").UpdateProjectStateResponse>;
223
+ addToAgentState: (key: string, value: string) => Promise<import("@codebolt/types/sdk").AddToAgentStateResponse>;
224
+ getAgentState: () => Promise<import("@codebolt/types/sdk").GetAgentStateResponse>;
225
+ getProjectState: () => Promise<import("@codebolt/types/sdk").GetProjectStateResponse>;
226
+ updateProjectState: (key: string, value: any) => Promise<import("@codebolt/types/sdk").UpdateProjectStateResponse>;
256
227
  };
257
- taskplaner: {
258
- addTask: (params: import("../types/libFunctionTypes").TaskCreateOptions) => Promise<import("../types/commonTypes").TaskResponse>;
259
- addSimpleTask: (task: string, agentId?: string) => Promise<import("../types/commonTypes").TaskResponse>;
260
- getTasks: (filters?: import("../types/libFunctionTypes").TaskFilterOptions) => Promise<import("../types/commonTypes").TaskResponse>;
261
- getTasksByAgent: (agentId: string) => Promise<import("../types/commonTypes").TaskResponse>;
262
- getTasksByCategory: (category: string) => Promise<import("../types/commonTypes").TaskResponse>;
263
- getAllAgents: () => Promise<import("../types/commonTypes").TaskResponse>;
264
- updateTask: (params: import("../types/libFunctionTypes").TaskUpdateOptions) => Promise<import("../types/commonTypes").TaskResponse>;
265
- updateSimpleTask: (taskId: string, task: string) => Promise<import("../types/commonTypes").TaskResponse>;
266
- deleteTask: (taskId: string) => Promise<import("../types/commonTypes").TaskResponse>;
267
- addSubTask: (params: import("../types/libFunctionTypes").AddSubTaskOptions) => Promise<import("../types/commonTypes").TaskResponse>;
268
- updateSubTask: (params: import("../types/libFunctionTypes").UpdateSubTaskOptions) => Promise<import("../types/commonTypes").TaskResponse>;
269
- deleteSubTask: (taskId: string, subtaskId: string) => Promise<import("../types/commonTypes").TaskResponse>;
270
- createTasksFromMarkdown: (params: import("../types/libFunctionTypes").TaskMarkdownImportOptions) => Promise<import("../types/commonTypes").TaskResponse>;
271
- exportTasksToMarkdown: (params?: import("../types/libFunctionTypes").TaskMarkdownExportOptions) => Promise<import("../types/commonTypes").TaskResponse>;
272
- toggleTaskCompletion: (taskId: string, completed: boolean) => Promise<import("../types/commonTypes").TaskResponse>;
273
- toggleSubTaskCompletion: (taskId: string, subtaskId: string, completed: boolean) => Promise<import("../types/commonTypes").TaskResponse>;
274
- moveTaskToAgent: (taskId: string, newAgentId: string) => Promise<import("../types/commonTypes").TaskResponse>;
275
- setTaskPriority: (taskId: string, priority: "low" | "medium" | "high") => Promise<import("../types/commonTypes").TaskResponse>;
276
- addTaskTags: (taskId: string, tags: string[]) => Promise<import("../types/commonTypes").TaskResponse>;
277
- createQuickTask: (title: string, agentId?: string, category?: string) => Promise<import("../types/commonTypes").TaskResponse>;
228
+ task: {
229
+ createTask: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").CreateTaskOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
230
+ createSimpleTask: (taskName: string, threadId?: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
231
+ getTaskList: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskListOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
232
+ getTaskDetail: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskDetailOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskDetailResponse>;
233
+ addStepToTask: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").AddStepToTaskOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").AddStepToTaskResponse>;
234
+ getTaskMessages: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskMessagesOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskMessagesResponse>;
235
+ updateTask: (taskId: string, updates: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").UpdateTaskOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateTaskResponse>;
236
+ updateSimpleTask: (taskId: string, taskName: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateTaskResponse>;
237
+ deleteTask: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").DeleteTaskResponse>;
238
+ completeTask: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CompleteTaskResponse>;
239
+ startTask: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").StartTaskResponse>;
240
+ getAllSteps: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetAllStepsOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetAllStepsResponse>;
241
+ getCurrentRunningStep: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetActiveStepOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetCurrentRunningStepResponse>;
242
+ updateStepStatus: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").UpdateStepStatusOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateStepStatusResponse>;
243
+ completeStep: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").CompleteStepOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CompleteStepResponse>;
244
+ sendSteeringMessage: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").SendSteeringMessageOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").SendSteeringMessageResponse>;
245
+ canTaskStart: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CanTaskStartResponse>;
246
+ getTasksDependentOn: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTasksDependentOnResponse>;
247
+ getTasksReadyToStart: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTasksReadyToStartOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTasksReadyToStartResponse>;
248
+ getTaskDependencyChain: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskDependencyChainResponse>;
249
+ getTaskStats: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskStatsOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskStatsResponse>;
250
+ toggleTaskCompletion: (taskId: string, completed: boolean) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateTaskResponse>;
251
+ createQuickTask: (name: string, threadId?: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
252
+ getTasksStartedByMe: (userId: string, options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskListOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
253
+ addTask: (params: import("../types/libFunctionTypes").TaskCreateOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
254
+ getTasks: (filters?: import("../types/libFunctionTypes").TaskFilterOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
255
+ getTasksByAgent: (agentId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
256
+ getTasksByCategory: (category: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
278
257
  };
279
258
  vectordb: {
280
- getVector: (key: string) => Promise<import("../types/socketMessageTypes").GetVectorResponse>;
281
- addVectorItem: (item: any) => Promise<import("../types/socketMessageTypes").AddVectorItemResponse>;
282
- queryVectorItem: (key: string) => Promise<import("../types/socketMessageTypes").QueryVectorItemResponse>;
283
- queryVectorItems: (items: [], dbPath: string) => Promise<import("../types/socketMessageTypes").QueryVectorItemResponse>;
259
+ getVector: (key: string) => Promise<import("@codebolt/types/sdk").GetVectorResponse>;
260
+ addVectorItem: (item: any) => Promise<import("@codebolt/types/sdk").AddVectorItemResponse>;
261
+ queryVectorItem: (key: string) => Promise<import("@codebolt/types/sdk").QueryVectorItemResponse>;
262
+ queryVectorItems: (items: [], dbPath: string) => Promise<import("@codebolt/types/sdk").QueryVectorItemResponse>;
284
263
  };
285
264
  debug: {
286
- debug: (log: string, type: import("../modules/debug").logType) => Promise<import("../types/socketMessageTypes").DebugAddLogResponse>;
287
- openDebugBrowser: (url: string, port: number) => Promise<import("../types/socketMessageTypes").OpenDebugBrowserResponse>;
265
+ debug: (log: string, type: import("../modules/debug").logType) => Promise<import("@codebolt/types/sdk").DebugAddLogResponse>;
266
+ openDebugBrowser: (url: string, port: number) => Promise<import("@codebolt/types/sdk").OpenDebugBrowserResponse>;
288
267
  };
289
268
  tokenizer: {
290
- addToken: (key: string) => Promise<import("../types/socketMessageTypes").AddTokenResponse>;
291
- getToken: (key: string) => Promise<import("../types/socketMessageTypes").GetTokenResponse>;
269
+ addToken: (key: string) => Promise<import("@codebolt/types/sdk").AddTokenResponse>;
270
+ getToken: (key: string) => Promise<import("@codebolt/types/sdk").GetTokenResponse>;
292
271
  };
293
272
  chatSummary: {
294
- summarizeAll: () => Promise<import("../types/socketMessageTypes").GetSummarizeAllResponse>;
273
+ summarizeAll: () => Promise<import("@codebolt/types/sdk").GetSummarizeAllResponse>;
295
274
  summarize: (messages: {
296
275
  role: string;
297
276
  content: string;
298
- }[], depth: number) => Promise<import("../types/socketMessageTypes").GetSummarizeResponse>;
277
+ }[], depth: number) => Promise<import("@codebolt/types/sdk").GetSummarizeResponse>;
299
278
  };
300
279
  mcp: {
301
- getEnabledMCPServers: () => Promise<import("../types/socketMessageTypes").GetEnabledToolBoxesResponse>;
302
- getLocalMCPServers: () => Promise<import("../types/socketMessageTypes").GetLocalToolBoxesResponse>;
303
- getMentionedMCPServers: (userMessage: any) => Promise<import("../types/socketMessageTypes").GetAvailableToolBoxesResponse>;
304
- searchAvailableMCPServers: (query: string) => Promise<import("../types/socketMessageTypes").SearchAvailableToolBoxesResponse>;
305
- listMcpFromServers: (toolBoxes: string[]) => Promise<import("../types/socketMessageTypes").ListToolsFromToolBoxesResponse>;
306
- configureMCPServer: (name: string, config: any) => Promise<import("../types/socketMessageTypes").ConfigureToolBoxResponse>;
280
+ getEnabledMCPServers: () => Promise<import("@codebolt/types/sdk").GetEnabledToolBoxesResponse>;
281
+ getLocalMCPServers: () => Promise<import("@codebolt/types/sdk").GetLocalToolBoxesResponse>;
282
+ getMentionedMCPServers: (userMessage: import("@codebolt/types/sdk").MCPUserMessage) => Promise<import("@codebolt/types/sdk").GetAvailableToolBoxesResponse>;
283
+ searchAvailableMCPServers: (query: string) => Promise<import("@codebolt/types/sdk").SearchAvailableToolBoxesResponse>;
284
+ listMcpFromServers: (toolBoxes: string[]) => Promise<import("@codebolt/types/sdk").ListToolsFromToolBoxesResponse>;
285
+ configureMCPServer: (name: string, config: import("@codebolt/types/sdk").MCPConfiguration) => Promise<import("@codebolt/types/sdk").ConfigureToolBoxResponse>;
307
286
  getTools: (tools: {
308
287
  toolbox: string;
309
288
  toolName: string;
310
- }[]) => Promise<import("../types/socketMessageTypes").GetToolsResponse>;
311
- executeTool: (toolbox: string, toolName: string, params: any) => Promise<import("../types/socketMessageTypes").ExecuteToolResponse>;
289
+ }[]) => Promise<import("@codebolt/types/sdk").GetToolsResponse>;
290
+ executeTool: (toolbox: string, toolName: string, params: import("@codebolt/types/sdk").ToolParameters) => Promise<import("@codebolt/types/sdk").ExecuteToolResponse>;
312
291
  };
313
292
  agent: {
314
- findAgent: (task: string, maxResult: number | undefined, agents: never[] | undefined, agentLocaltion: import("../modules/agent").AgentLocation | undefined, getFrom: import("../modules/agent").FilterUsing.USE_VECTOR_DB) => Promise<import("../types/socketMessageTypes").FindAgentByTaskResponse>;
315
- startAgent: (agentId: string, task: string) => Promise<import("../types/socketMessageTypes").TaskCompletionResponse>;
316
- getAgentsList: (type?: import("../modules/agent").Agents) => Promise<import("../types/socketMessageTypes").ListAgentsResponse>;
317
- getAgentsDetail: (agentList?: never[]) => Promise<import("../types/socketMessageTypes").AgentsDetailResponse>;
293
+ findAgent: (task: string, maxResult: number | undefined, agents: never[] | undefined, agentLocaltion: import("@codebolt/types/enum").AgentLocation | undefined, getFrom: import("@codebolt/types/enum").FilterUsing.USE_VECTOR_DB) => Promise<import("@codebolt/types/sdk").FindAgentByTaskResponse>;
294
+ startAgent: (agentId: string, task: string) => Promise<import("@codebolt/types/sdk").TaskCompletionResponse>;
295
+ getAgentsList: (type?: import("@codebolt/types/enum").Agents) => Promise<import("@codebolt/types/sdk").ListAgentsResponse>;
296
+ getAgentsDetail: (agentList?: never[]) => Promise<import("@codebolt/types/sdk").AgentsDetailResponse>;
318
297
  };
319
298
  utils: {
320
- editFileAndApplyDiff: (filePath: string, diff: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<import("../types/socketMessageTypes").FsEditFileAndApplyDiffResponse>;
299
+ editFileAndApplyDiff: (filePath: string, diff: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<import("@codebolt/types/sdk").FsEditFileAndApplyDiffResponse>;
321
300
  };
322
301
  notify: NotificationFunctions;
302
+ /**
303
+ * User message utilities for accessing current user message and context
304
+ */
305
+ userMessage: {
306
+ getCurrent: () => FlatUserMessage | undefined;
307
+ getText: () => string;
308
+ getMentionedMCPs: () => string[];
309
+ getMentionedFiles: () => string[];
310
+ getMentionedFolders: () => string[];
311
+ getMentionedAgents: () => any[];
312
+ getRemixPrompt: () => string | undefined;
313
+ getUploadedImages: () => any[];
314
+ getCurrentFile: () => string | undefined;
315
+ getSelection: () => string | undefined;
316
+ getMessageId: () => string | undefined;
317
+ getThreadId: () => string | undefined;
318
+ getProcessingConfig: () => import("@codebolt/types/sdk").AgentProcessingConfig;
319
+ isProcessingEnabled: (type: "processMentionedMCPs" | "processRemixPrompt" | "processMentionedFiles" | "processMentionedAgents") => boolean;
320
+ setSessionData: (key: string, value: any) => void;
321
+ getSessionData: (key: string) => any;
322
+ getTimestamp: () => string | undefined;
323
+ hasMessage: () => boolean;
324
+ updateProcessingConfig: (config: any) => void;
325
+ clear: () => void;
326
+ };
323
327
  /**
324
328
  * Sets up a handler function to be executed when the WebSocket connection is established.
325
329
  * If the connection is already established, the handler will be executed immediately.
@@ -332,6 +336,49 @@ declare class Codebolt {
332
336
  * @param {Function} handler - The handler function to call when a message is received.
333
337
  * @returns {void}
334
338
  */
335
- onMessage(handler: (userMessage: UserMessage) => void | Promise<void> | any | Promise<any>): void;
339
+ onMessage(handler: (userMessage: FlatUserMessage) => void | Promise<void> | any | Promise<any>): void;
340
+ onRawMessage(handler: (userMessage: RawMessageForAgent) => void | Promise<void> | any | Promise<any>): void;
341
+ /**
342
+ * Sets up a listener for provider start events.
343
+ * @param {Function} handler - The handler function to call when provider starts.
344
+ * @returns {void}
345
+ */
346
+ onProviderStart(handler: (initvars: ProviderInitVars) => void | Promise<void> | any | Promise<any>): void;
347
+ /**
348
+ * Sets up a listener for provider agent start events.
349
+ * @param {Function} handler - The handler function to call when provider agent starts.
350
+ * @returns {void}
351
+ */
352
+ onProviderAgentStart(handler: (userMessage: any) => void | Promise<void> | any | Promise<any>): void;
353
+ /**
354
+ * Sets up a listener for provider stop events.
355
+ * @param {Function} handler - The handler function to call when provider stops.
356
+ * @returns {void}
357
+ */
358
+ onProviderStop(handler: (initvars: ProviderInitVars) => void | Promise<void> | any | Promise<any>): void;
359
+ /**
360
+ * Sets up a listener for get diff files events.
361
+ * @param {Function} handler - The handler function to call when diff files are requested.
362
+ * @returns {void}
363
+ */
364
+ onGetDiffFiles(handler: () => void | Promise<void> | any | Promise<any>): void;
365
+ /**
366
+ * Sets up a listener for close signal events.
367
+ * @param {Function} handler - The handler function to call when close signal is received.
368
+ * @returns {void}
369
+ */
370
+ onCloseSignal(handler: () => void | Promise<void> | any | Promise<any>): void;
371
+ /**
372
+ * Sets up a listener for create patch request events.
373
+ * @param {Function} handler - The handler function to call when patch request is created.
374
+ * @returns {void}
375
+ */
376
+ onCreatePatchRequest(handler: () => void | Promise<void> | any | Promise<any>): void;
377
+ /**
378
+ * Sets up a listener for create pull request events.
379
+ * @param {Function} handler - The handler function to call when pull request is created.
380
+ * @returns {void}
381
+ */
382
+ onCreatePullRequestRequest(handler: () => void | Promise<void> | any | Promise<any>): void;
336
383
  }
337
384
  export default Codebolt;