@codebolt/codeboltjs 1.1.70 → 1.1.72

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 (82) hide show
  1. package/package.json +3 -3
  2. package/src/index.ts +3 -1
  3. package/webpack.config.js +1 -1
  4. package/docs/modules/_internal_.EventEmitter.html +0 -6
  5. package/docs/modules/_internal_.WebSocket.html +0 -21
  6. package/docs/modules/_internal_._node_stream_consumers_.html +0 -6
  7. package/docs/modules/_internal_._node_stream_promises_.html +0 -3
  8. package/docs/modules/_internal_.html +0 -228
  9. package/docs/modules/_internal_.internal.finished.html +0 -2
  10. package/docs/modules/_internal_.internal.html +0 -36
  11. package/docs/modules/_internal_.internal.pipeline.html +0 -2
  12. package/index.d.ts +0 -238
  13. package/index.js +0 -90
  14. package/modules/browser.d.ts +0 -108
  15. package/modules/browser.js +0 -331
  16. package/modules/chat.d.ts +0 -63
  17. package/modules/chat.js +0 -174
  18. package/modules/codeparsers.d.ts +0 -23
  19. package/modules/codeparsers.js +0 -30
  20. package/modules/codeutils.d.ts +0 -37
  21. package/modules/codeutils.js +0 -166
  22. package/modules/crawler.d.ts +0 -45
  23. package/modules/crawler.js +0 -123
  24. package/modules/dbmemory.d.ts +0 -20
  25. package/modules/dbmemory.js +0 -54
  26. package/modules/debug.d.ts +0 -23
  27. package/modules/debug.js +0 -64
  28. package/modules/docutils.d.ts +0 -12
  29. package/modules/docutils.js +0 -19
  30. package/modules/fs.d.ts +0 -94
  31. package/modules/fs.js +0 -264
  32. package/modules/git.d.ts +0 -76
  33. package/modules/git.js +0 -240
  34. package/modules/history.d.ts +0 -19
  35. package/modules/history.js +0 -46
  36. package/modules/knowledge.d.ts +0 -2
  37. package/modules/knowledge.js +0 -6
  38. package/modules/llm.d.ts +0 -18
  39. package/modules/llm.js +0 -39
  40. package/modules/outputparsers.d.ts +0 -24
  41. package/modules/outputparsers.js +0 -32
  42. package/modules/project.d.ts +0 -21
  43. package/modules/project.js +0 -72
  44. package/modules/rag.d.ts +0 -22
  45. package/modules/rag.js +0 -30
  46. package/modules/search.d.ts +0 -23
  47. package/modules/search.js +0 -37
  48. package/modules/state.d.ts +0 -21
  49. package/modules/state.js +0 -68
  50. package/modules/task.d.ts +0 -23
  51. package/modules/task.js +0 -75
  52. package/modules/terminal.d.ts +0 -46
  53. package/modules/terminal.js +0 -108
  54. package/modules/tokenizer.d.ts +0 -19
  55. package/modules/tokenizer.js +0 -56
  56. package/modules/vectordb.d.ts +0 -33
  57. package/modules/vectordb.js +0 -103
  58. package/modules/websocket.d.ts +0 -27
  59. package/modules/websocket.js +0 -88
  60. package/src/modules/browser.ts +0 -352
  61. package/src/modules/chat.ts +0 -182
  62. package/src/modules/codeparsers.ts +0 -30
  63. package/src/modules/codeutils.ts +0 -181
  64. package/src/modules/crawler.ts +0 -121
  65. package/src/modules/dbmemory.ts +0 -52
  66. package/src/modules/debug.ts +0 -68
  67. package/src/modules/docutils.ts +0 -18
  68. package/src/modules/fs.ts +0 -263
  69. package/src/modules/git.ts +0 -237
  70. package/src/modules/history.ts +0 -61
  71. package/src/modules/knowledge.ts +0 -5
  72. package/src/modules/llm.ts +0 -36
  73. package/src/modules/outputparsers.ts +0 -30
  74. package/src/modules/project.ts +0 -68
  75. package/src/modules/rag.ts +0 -28
  76. package/src/modules/search.ts +0 -35
  77. package/src/modules/state.ts +0 -69
  78. package/src/modules/task.ts +0 -73
  79. package/src/modules/terminal.ts +0 -114
  80. package/src/modules/tokenizer.ts +0 -56
  81. package/src/modules/vectordb.ts +0 -102
  82. package/src/modules/websocket.ts +0 -89
package/modules/fs.js DELETED
@@ -1,264 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const websocket_1 = __importDefault(require("./websocket"));
7
- /**
8
- * @module cbfs
9
- * @description This module provides functionality to interact with the filesystem.
10
- */
11
- const cbfs = {
12
- /**
13
- * @function createFile
14
- * @description Creates a new file.
15
- * @param {string} fileName - The name of the file to create.
16
- * @param {string} source - The source content to write into the file.
17
- * @param {string} filePath - The path where the file should be created.
18
- * @returns {Promise<CreateFileResponse>} A promise that resolves with the server response.
19
- */
20
- createFile: (fileName, source, filePath) => {
21
- return new Promise((resolve, reject) => {
22
- websocket_1.default.getWebsocket.send(JSON.stringify({
23
- "type": "fsEvent",
24
- "action": "createFile",
25
- "message": {
26
- fileName,
27
- source,
28
- filePath
29
- },
30
- }));
31
- websocket_1.default.getWebsocket.on('message', (data) => {
32
- const response = JSON.parse(data);
33
- if (response.type === "createFileResponse") {
34
- resolve(response);
35
- }
36
- });
37
- });
38
- },
39
- /**
40
- * @function createFolder
41
- * @description Creates a new folder.
42
- * @param {string} folderName - The name of the folder to create.
43
- * @param {string} folderPath - The path where the folder should be created.
44
- * @returns {Promise<CreateFolderResponse>} A promise that resolves with the server response.
45
- */
46
- createFolder: (folderName, folderPath) => {
47
- return new Promise((resolve, reject) => {
48
- websocket_1.default.getWebsocket.send(JSON.stringify({
49
- "type": "fsEvent",
50
- "action": "createFolder",
51
- "message": {
52
- folderName,
53
- folderPath
54
- },
55
- }));
56
- websocket_1.default.getWebsocket.on('message', (data) => {
57
- const response = JSON.parse(data);
58
- if (response.type === "createFolderResponse") {
59
- resolve(response);
60
- }
61
- });
62
- });
63
- },
64
- /**
65
- * @function readFile
66
- * @description Reads the content of a file.
67
- * @param {string} filename - The name of the file to read.
68
- * @param {string} filePath - The path of the file to read.
69
- * @returns {Promise<ReadFileResponse>} A promise that resolves with the server response.
70
- */
71
- readFile: (filePath) => {
72
- return new Promise((resolve, reject) => {
73
- websocket_1.default.getWebsocket.send(JSON.stringify({
74
- "type": "fsEvent",
75
- "action": "readFile",
76
- "message": {
77
- filePath
78
- },
79
- }));
80
- websocket_1.default.getWebsocket.on('message', (data) => {
81
- const response = JSON.parse(data);
82
- if (response.type === "readFileResponse") {
83
- resolve(response);
84
- }
85
- });
86
- });
87
- },
88
- /**
89
- * @function updateFile
90
- * @description Updates the content of a file.
91
- * @param {string} filename - The name of the file to update.
92
- * @param {string} filePath - The path of the file to update.
93
- * @param {string} newContent - The new content to write into the file.
94
- * @returns {Promise<UpdateFileResponse>} A promise that resolves with the server response.
95
- */
96
- updateFile: (filename, filePath, newContent) => {
97
- return new Promise((resolve, reject) => {
98
- websocket_1.default.getWebsocket.send(JSON.stringify({
99
- "type": "fsEvent",
100
- "action": "updateFile",
101
- "message": {
102
- filename,
103
- filePath,
104
- newContent
105
- },
106
- }));
107
- websocket_1.default.getWebsocket.on('message', (data) => {
108
- const response = JSON.parse(data);
109
- if (response.type === "commandOutput") {
110
- resolve(response);
111
- }
112
- });
113
- });
114
- },
115
- /**
116
- * @function deleteFile
117
- * @description Deletes a file.
118
- * @param {string} filename - The name of the file to delete.
119
- * @param {string} filePath - The path of the file to delete.
120
- * @returns {Promise<DeleteFileResponse>} A promise that resolves with the server response.
121
- */
122
- deleteFile: (filename, filePath) => {
123
- return new Promise((resolve, reject) => {
124
- websocket_1.default.getWebsocket.send(JSON.stringify({
125
- "type": "fsEvent",
126
- "action": "deleteFile",
127
- "message": {
128
- filename,
129
- filePath
130
- },
131
- }));
132
- websocket_1.default.getWebsocket.on('message', (data) => {
133
- const response = JSON.parse(data);
134
- if (response.type === "deleteFileResponse") {
135
- resolve(response);
136
- }
137
- });
138
- });
139
- },
140
- /**
141
- * @function deleteFolder
142
- * @description Deletes a folder.
143
- * @param {string} foldername - The name of the folder to delete.
144
- * @param {string} folderpath - The path of the folder to delete.
145
- * @returns {Promise<DeleteFolderResponse>} A promise that resolves with the server response.
146
- */
147
- deleteFolder: (foldername, folderpath) => {
148
- return new Promise((resolve, reject) => {
149
- websocket_1.default.getWebsocket.send(JSON.stringify({
150
- "type": "fsEvent",
151
- "action": "deleteFolder",
152
- "message": {
153
- foldername,
154
- folderpath
155
- },
156
- }));
157
- websocket_1.default.getWebsocket.on('message', (data) => {
158
- const response = JSON.parse(data);
159
- if (response.type === "deleteFolderResponse") {
160
- resolve(response);
161
- }
162
- });
163
- });
164
- },
165
- /**
166
- * @function listFile
167
- * @description Lists all files.
168
- * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
169
- */
170
- listFile: (folderPath, isRecursive = false) => {
171
- return new Promise((resolve, reject) => {
172
- websocket_1.default.getWebsocket.send(JSON.stringify({
173
- "type": "fsEvent",
174
- "action": "fileList",
175
- message: {
176
- folderPath,
177
- isRecursive
178
- }
179
- }));
180
- websocket_1.default.getWebsocket.on('message', (data) => {
181
- const response = JSON.parse(data);
182
- if (response.type === "fileListResponse") {
183
- resolve(response);
184
- }
185
- });
186
- });
187
- },
188
- /**
189
- * @function listCodeDefinitionNames
190
- * @description Lists all code definition names in a given path.
191
- * @param {string} path - The path to search for code definitions.
192
- * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the list of code definition names.
193
- */
194
- listCodeDefinitionNames: (path) => {
195
- return new Promise((resolve, reject) => {
196
- websocket_1.default.getWebsocket.send(JSON.stringify({
197
- "type": "fsEvent",
198
- "action": "listCodeDefinitionNames",
199
- "message": {
200
- path
201
- }
202
- }));
203
- websocket_1.default.getWebsocket.on('message', (data) => {
204
- const response = JSON.parse(data);
205
- if (response.type === "listCodeDefinitionNamesResponse") {
206
- resolve(response);
207
- }
208
- });
209
- });
210
- },
211
- /**
212
- * @function searchFiles
213
- * @description Searches files in a given path using a regex pattern.
214
- * @param {string} path - The path to search within.
215
- * @param {string} regex - The regex pattern to search for.
216
- * @param {string} filePattern - The file pattern to match files.
217
- * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the search results.
218
- */
219
- searchFiles: (path, regex, filePattern) => {
220
- return new Promise((resolve, reject) => {
221
- websocket_1.default.getWebsocket.send(JSON.stringify({
222
- "type": "fsEvent",
223
- "action": "searchFiles",
224
- "message": {
225
- path,
226
- regex,
227
- filePattern
228
- }
229
- }));
230
- websocket_1.default.getWebsocket.on('message', (data) => {
231
- const response = JSON.parse(data);
232
- if (response.type === "searchFilesResponse") {
233
- resolve(response);
234
- }
235
- });
236
- });
237
- },
238
- /**
239
- * @function writeToFile
240
- * @description Writes content to a file.
241
- * @param {string} relPath - The relative path of the file to write to.
242
- * @param {string} newContent - The new content to write into the file.
243
- * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the write operation result.
244
- */
245
- writeToFile: (relPath, newContent) => {
246
- return new Promise((resolve, reject) => {
247
- websocket_1.default.getWebsocket.send(JSON.stringify({
248
- "type": "fsEvent",
249
- "action": "writeToFile",
250
- "message": {
251
- relPath,
252
- newContent
253
- }
254
- }));
255
- websocket_1.default.getWebsocket.on('message', (data) => {
256
- const response = JSON.parse(data);
257
- if (response.type === "writeToFileResponse") {
258
- resolve(response);
259
- }
260
- });
261
- });
262
- },
263
- };
264
- exports.default = cbfs;
package/modules/git.d.ts DELETED
@@ -1,76 +0,0 @@
1
- /**
2
- * A service for interacting with Git operations via WebSocket messages.
3
- */
4
- declare const gitService: {
5
- /**
6
- * Initializes a new Git repository at the given path.
7
- * @param {string} path - The file system path where the Git repository should be initialized.
8
- * @returns {Promise<any>} A promise that resolves with the response from the init event.
9
- */
10
- init: (path: string) => Promise<any>;
11
- /**
12
- * Clones a Git repository from the given URL to the specified path.
13
- * @param {string} url - The URL of the Git repository to clone.
14
- * @param {string} path - The file system path where the repository should be cloned to.
15
- * @returns {Promise<any>} A promise that resolves with the response from the clone event.
16
- */
17
- clone: (url: string, path: string) => Promise<any>;
18
- /**
19
- * Pulls the latest changes from the remote repository to the local repository at the given path.
20
- * @param {string} path - The file system path of the local Git repository.
21
- * @returns {Promise<any>} A promise that resolves with the response from the pull event.
22
- */
23
- pull: (path: string) => Promise<any>;
24
- /**
25
- * Pushes local repository changes to the remote repository at the given path.
26
- * @param {string} path - The file system path of the local Git repository.
27
- * @returns {Promise<any>} A promise that resolves with the response from the push event.
28
- */
29
- push: (path: string) => Promise<any>;
30
- /**
31
- * Retrieves the status of the local repository at the given path.
32
- * @param {string} path - The file system path of the local Git repository.
33
- * @returns {Promise<any>} A promise that resolves with the response from the status event.
34
- */
35
- status: (path: string) => Promise<any>;
36
- /**
37
- * Adds changes in the local repository to the staging area at the given path.
38
- * @param {string} path - The file system path of the local Git repository.
39
- * @returns {Promise<any>} A promise that resolves with the response from the add event.
40
- */
41
- add: (path: string) => Promise<any>;
42
- /**
43
- * Commits the staged changes in the local repository with the given commit message.
44
- * @param {string} message - The commit message to use for the commit.
45
- * @returns {Promise<any>} A promise that resolves with the response from the commit event.
46
- */
47
- commit: (message: string) => Promise<any>;
48
- /**
49
- * Checks out a branch or commit in the local repository at the given path.
50
- * @param {string} path - The file system path of the local Git repository.
51
- * @param {string} branch - The name of the branch or commit to check out.
52
- * @returns {Promise<any>} A promise that resolves with the response from the checkout event.
53
- */
54
- checkout: (path: string, branch: string) => Promise<any>;
55
- /**
56
- * Creates a new branch in the local repository at the given path.
57
- * @param {string} path - The file system path of the local Git repository.
58
- * @param {string} branch - The name of the new branch to create.
59
- * @returns {Promise<any>} A promise that resolves with the response from the branch event.
60
- */
61
- branch: (path: string, branch: string) => Promise<any>;
62
- /**
63
- * Retrieves the commit logs for the local repository at the given path.
64
- * @param {string} path - The file system path of the local Git repository.
65
- * @returns {Promise<any>} A promise that resolves with the response from the logs event.
66
- */
67
- logs: (path: string) => Promise<any>;
68
- /**
69
- * Retrieves the diff of changes for a specific commit in the local repository.
70
- * @param {string} commitHash - The hash of the commit to retrieve the diff for.
71
- * @param {string} path - The file system path of the local Git repository.
72
- * @returns {Promise<any>} A promise that resolves with the response from the diff event.
73
- */
74
- diff: (commitHash: string, path: string) => Promise<any>;
75
- };
76
- export default gitService;
package/modules/git.js DELETED
@@ -1,240 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const websocket_1 = __importDefault(require("./websocket"));
7
- /**
8
- * A service for interacting with Git operations via WebSocket messages.
9
- */
10
- const gitService = {
11
- /**
12
- * Initializes a new Git repository at the given path.
13
- * @param {string} path - The file system path where the Git repository should be initialized.
14
- * @returns {Promise<any>} A promise that resolves with the response from the init event.
15
- */
16
- init: async (path) => {
17
- return new Promise((resolve, reject) => {
18
- websocket_1.default.getWebsocket.send(JSON.stringify({
19
- "type": "gitEvent",
20
- "action": "Init",
21
- "path": path
22
- }));
23
- websocket_1.default.getWebsocket.on('message', (data) => {
24
- const response = JSON.parse(data);
25
- if (response.type === "InitResponse") {
26
- resolve(response);
27
- }
28
- });
29
- });
30
- },
31
- /**
32
- * Clones a Git repository from the given URL to the specified path.
33
- * @param {string} url - The URL of the Git repository to clone.
34
- * @param {string} path - The file system path where the repository should be cloned to.
35
- * @returns {Promise<any>} A promise that resolves with the response from the clone event.
36
- */
37
- clone: async (url, path) => {
38
- return new Promise((resolve, reject) => {
39
- websocket_1.default.getWebsocket.send(JSON.stringify({
40
- "type": "gitEvent",
41
- "action": "Clone",
42
- "url": url,
43
- "path": path
44
- }));
45
- websocket_1.default.getWebsocket.on('message', (data) => {
46
- const response = JSON.parse(data);
47
- if (response.type === "CloneResponse") {
48
- resolve(response);
49
- }
50
- });
51
- });
52
- },
53
- /**
54
- * Pulls the latest changes from the remote repository to the local repository at the given path.
55
- * @param {string} path - The file system path of the local Git repository.
56
- * @returns {Promise<any>} A promise that resolves with the response from the pull event.
57
- */
58
- pull: async (path) => {
59
- return new Promise((resolve, reject) => {
60
- websocket_1.default.getWebsocket.send(JSON.stringify({
61
- "type": "gitEvent",
62
- "action": "Pull",
63
- "path": path
64
- }));
65
- websocket_1.default.getWebsocket.on('message', (data) => {
66
- const response = JSON.parse(data);
67
- if (response.type === "PullResponse") {
68
- resolve(response);
69
- }
70
- });
71
- });
72
- },
73
- /**
74
- * Pushes local repository changes to the remote repository at the given path.
75
- * @param {string} path - The file system path of the local Git repository.
76
- * @returns {Promise<any>} A promise that resolves with the response from the push event.
77
- */
78
- push: async (path) => {
79
- return new Promise((resolve, reject) => {
80
- websocket_1.default.getWebsocket.send(JSON.stringify({
81
- "type": "gitEvent",
82
- "action": "Push",
83
- "path": path
84
- }));
85
- websocket_1.default.getWebsocket.on('message', (data) => {
86
- const response = JSON.parse(data);
87
- if (response.type === "PushResponse") {
88
- resolve(response);
89
- }
90
- });
91
- });
92
- },
93
- /**
94
- * Retrieves the status of the local repository at the given path.
95
- * @param {string} path - The file system path of the local Git repository.
96
- * @returns {Promise<any>} A promise that resolves with the response from the status event.
97
- */
98
- status: async (path) => {
99
- return new Promise((resolve, reject) => {
100
- websocket_1.default.getWebsocket.send(JSON.stringify({
101
- "type": "gitEvent",
102
- "action": "Status",
103
- "path": path
104
- }));
105
- websocket_1.default.getWebsocket.on('message', (data) => {
106
- const response = JSON.parse(data);
107
- if (response.type === "StatusResponse") {
108
- resolve(response);
109
- }
110
- });
111
- });
112
- },
113
- /**
114
- * Adds changes in the local repository to the staging area at the given path.
115
- * @param {string} path - The file system path of the local Git repository.
116
- * @returns {Promise<any>} A promise that resolves with the response from the add event.
117
- */
118
- add: async (path) => {
119
- return new Promise((resolve, reject) => {
120
- websocket_1.default.getWebsocket.send(JSON.stringify({
121
- "type": "gitEvent",
122
- "action": "Add",
123
- "path": path
124
- }));
125
- websocket_1.default.getWebsocket.on('message', (data) => {
126
- const response = JSON.parse(data);
127
- if (response.type === "AddResponse") {
128
- resolve(response);
129
- }
130
- });
131
- });
132
- },
133
- /**
134
- * Commits the staged changes in the local repository with the given commit message.
135
- * @param {string} message - The commit message to use for the commit.
136
- * @returns {Promise<any>} A promise that resolves with the response from the commit event.
137
- */
138
- commit: async (message) => {
139
- return new Promise((resolve, reject) => {
140
- websocket_1.default.getWebsocket.send(JSON.stringify({
141
- "type": "gitEvent",
142
- "action": "Commit",
143
- "message": message
144
- }));
145
- websocket_1.default.getWebsocket.on('message', (data) => {
146
- const response = JSON.parse(data);
147
- if (response.type === "gitCommitResponse") {
148
- resolve(response);
149
- }
150
- });
151
- });
152
- },
153
- /**
154
- * Checks out a branch or commit in the local repository at the given path.
155
- * @param {string} path - The file system path of the local Git repository.
156
- * @param {string} branch - The name of the branch or commit to check out.
157
- * @returns {Promise<any>} A promise that resolves with the response from the checkout event.
158
- */
159
- checkout: async (path, branch) => {
160
- return new Promise((resolve, reject) => {
161
- websocket_1.default.getWebsocket.send(JSON.stringify({
162
- "type": "gitEvent",
163
- "action": "Checkout",
164
- "path": path,
165
- "branch": branch
166
- }));
167
- websocket_1.default.getWebsocket.on('message', (data) => {
168
- const response = JSON.parse(data);
169
- if (response.type === "CheckoutResponse") {
170
- resolve(response);
171
- }
172
- });
173
- });
174
- },
175
- /**
176
- * Creates a new branch in the local repository at the given path.
177
- * @param {string} path - The file system path of the local Git repository.
178
- * @param {string} branch - The name of the new branch to create.
179
- * @returns {Promise<any>} A promise that resolves with the response from the branch event.
180
- */
181
- branch: async (path, branch) => {
182
- return new Promise((resolve, reject) => {
183
- websocket_1.default.getWebsocket.send(JSON.stringify({
184
- "type": "gitEvent",
185
- "action": "Branch",
186
- "path": path,
187
- "branch": branch
188
- }));
189
- websocket_1.default.getWebsocket.on('message', (data) => {
190
- const response = JSON.parse(data);
191
- if (response.type === "BranchResponse") {
192
- resolve(response);
193
- }
194
- });
195
- });
196
- },
197
- /**
198
- * Retrieves the commit logs for the local repository at the given path.
199
- * @param {string} path - The file system path of the local Git repository.
200
- * @returns {Promise<any>} A promise that resolves with the response from the logs event.
201
- */
202
- logs: async (path) => {
203
- return new Promise((resolve, reject) => {
204
- websocket_1.default.getWebsocket.send(JSON.stringify({
205
- "type": "gitEvent",
206
- "action": "Logs",
207
- "path": path
208
- }));
209
- websocket_1.default.getWebsocket.on('message', (data) => {
210
- const response = JSON.parse(data);
211
- if (response.type === "LogsResponse") {
212
- resolve(response);
213
- }
214
- });
215
- });
216
- },
217
- /**
218
- * Retrieves the diff of changes for a specific commit in the local repository.
219
- * @param {string} commitHash - The hash of the commit to retrieve the diff for.
220
- * @param {string} path - The file system path of the local Git repository.
221
- * @returns {Promise<any>} A promise that resolves with the response from the diff event.
222
- */
223
- diff: async (commitHash, path) => {
224
- return new Promise((resolve, reject) => {
225
- websocket_1.default.getWebsocket.send(JSON.stringify({
226
- "type": "gitEvent",
227
- "action": "Diff",
228
- "path": path,
229
- "commitHash": commitHash
230
- }));
231
- websocket_1.default.getWebsocket.on('message', (data) => {
232
- const response = JSON.parse(data);
233
- if (response.type === "DiffResponse") {
234
- resolve(response);
235
- }
236
- });
237
- });
238
- }
239
- };
240
- exports.default = gitService;
@@ -1,19 +0,0 @@
1
- export declare enum logType {
2
- info = "info",
3
- error = "error",
4
- warning = "warning"
5
- }
6
- export declare const chatSummary: {
7
- summarizeAll: () => Promise<{
8
- role: string;
9
- content: string;
10
- }[]>;
11
- summarize: (messages: {
12
- role: string;
13
- content: string;
14
- }[], depth: number) => Promise<{
15
- role: string;
16
- content: string;
17
- }[]>;
18
- };
19
- export default chatSummary;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.chatSummary = exports.logType = void 0;
7
- const websocket_1 = __importDefault(require("./websocket"));
8
- var logType;
9
- (function (logType) {
10
- logType["info"] = "info";
11
- logType["error"] = "error";
12
- logType["warning"] = "warning";
13
- })(logType || (exports.logType = logType = {}));
14
- exports.chatSummary = {
15
- summarizeAll: () => {
16
- return new Promise((resolve, reject) => {
17
- websocket_1.default.getWebsocket.send(JSON.stringify({
18
- "type": "chatSummaryEvent",
19
- "action": "summarizeAll",
20
- }));
21
- websocket_1.default.getWebsocket.on('message', (data) => {
22
- const response = JSON.parse(data);
23
- if (response.type === "getSummarizeAllResponse") {
24
- resolve(response.payload); // Resolve the Promise with the response data
25
- }
26
- });
27
- });
28
- },
29
- summarize: (messages, depth) => {
30
- return new Promise((resolve, reject) => {
31
- websocket_1.default.getWebsocket.send(JSON.stringify({
32
- "type": "chatSummaryEvent",
33
- "action": "summarize",
34
- messages,
35
- depth
36
- }));
37
- websocket_1.default.getWebsocket.on('message', (data) => {
38
- const response = JSON.parse(data);
39
- if (response.type === "getSummarizeResponse") {
40
- resolve(response.payload); // Resolve the Promise with the response data
41
- }
42
- });
43
- });
44
- }
45
- };
46
- exports.default = exports.chatSummary;
@@ -1,2 +0,0 @@
1
- declare const cbKnowledge: {};
2
- export default cbKnowledge;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cbKnowledge = {
4
- // Methods related to knowledge handling can be added here
5
- };
6
- exports.default = cbKnowledge;
package/modules/llm.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { LLMResponse } from '@codebolt/types';
2
- /**
3
- * A module for interacting with language learning models (LLMs) via WebSocket.
4
- */
5
- declare const cbllm: {
6
- /**
7
- * Sends an inference request to the LLM and returns the model's response.
8
- * The model is selected based on the provided `llmrole`. If the specific model
9
- * for the role is not found, it falls back to the default model for the current agent,
10
- * and ultimately to the default application-wide LLM if necessary.
11
- *
12
- * @param {string} message - The input message or prompt to be sent to the LLM.
13
- * @param {string} llmrole - The role of the LLM to determine which model to use.
14
- * @returns {Promise<LLMResponse>} A promise that resolves with the LLM's response.
15
- */
16
- inference: (message: string, llmrole: string) => Promise<LLMResponse>;
17
- };
18
- export default cbllm;