@codebolt/codeboltjs 1.1.63 → 1.1.64
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/index.d.ts +1 -1
- package/modules/chat.d.ts +1 -1
- package/modules/chat.js +3 -2
- package/modules/terminal.js +15 -1
- package/package.json +1 -1
- package/src/modules/browser.ts +0 -0
- package/src/modules/chat.ts +8 -7
- package/src/modules/codeparsers.ts +0 -0
- package/src/modules/codeutils.ts +0 -0
- package/src/modules/crawler.ts +0 -0
- package/src/modules/dbmemory.ts +0 -0
- package/src/modules/debug.ts +0 -0
- package/src/modules/docutils.ts +0 -0
- package/src/modules/fs.ts +0 -0
- package/src/modules/git.ts +0 -0
- package/src/modules/history.ts +0 -0
- package/src/modules/knowledge.ts +0 -0
- package/src/modules/llm.ts +0 -0
- package/src/modules/outputparsers.ts +0 -0
- package/src/modules/project.ts +0 -0
- package/src/modules/rag.ts +0 -0
- package/src/modules/search.ts +0 -0
- package/src/modules/state.ts +0 -0
- package/src/modules/task.ts +0 -0
- package/src/modules/terminal.ts +13 -1
- package/src/modules/tokenizer.ts +0 -0
- package/src/modules/vectordb.ts +0 -0
package/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ declare class Codebolt {
|
|
|
83
83
|
prependOnceListener<K_11>(eventName: string | symbol, listener: (...args: any[]) => void): any;
|
|
84
84
|
eventNames(): (string | symbol)[];
|
|
85
85
|
} | undefined;
|
|
86
|
-
sendMessage: (message: string) => void;
|
|
86
|
+
sendMessage: (message: string, payload: any) => void;
|
|
87
87
|
waitforReply: (message: string) => Promise<import("@codebolt/types").UserMessage>;
|
|
88
88
|
processStarted: () => {
|
|
89
89
|
event: {
|
package/modules/chat.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare const cbchat: {
|
|
|
24
24
|
* Sends a message through the WebSocket connection.
|
|
25
25
|
* @param {string} message - The message to be sent.
|
|
26
26
|
*/
|
|
27
|
-
sendMessage: (message: string) => void;
|
|
27
|
+
sendMessage: (message: string, payload: any) => void;
|
|
28
28
|
/**
|
|
29
29
|
* Waits for a reply to a sent message.
|
|
30
30
|
* @param {string} message - The message for which a reply is expected.
|
package/modules/chat.js
CHANGED
|
@@ -58,11 +58,12 @@ const cbchat = {
|
|
|
58
58
|
* Sends a message through the WebSocket connection.
|
|
59
59
|
* @param {string} message - The message to be sent.
|
|
60
60
|
*/
|
|
61
|
-
sendMessage: (message) => {
|
|
61
|
+
sendMessage: (message, payload) => {
|
|
62
62
|
console.log(message);
|
|
63
63
|
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
64
64
|
"type": "sendMessage",
|
|
65
|
-
"message": message
|
|
65
|
+
"message": message,
|
|
66
|
+
payload
|
|
66
67
|
}));
|
|
67
68
|
},
|
|
68
69
|
/**
|
package/modules/terminal.js
CHANGED
|
@@ -30,10 +30,24 @@ const cbterminal = {
|
|
|
30
30
|
"message": command,
|
|
31
31
|
executeInMain
|
|
32
32
|
}));
|
|
33
|
+
let result = "";
|
|
33
34
|
websocket_1.default.getWebsocket.on('message', (data) => {
|
|
34
35
|
const response = JSON.parse(data);
|
|
35
36
|
if (response.type === "commandOutput" || response.type === "commandError" || response.type === "commandFinish") {
|
|
36
|
-
|
|
37
|
+
if (response.type === "commandOutput") {
|
|
38
|
+
// Initialize result as an empty string
|
|
39
|
+
result += response.stdout + "/n"; // Append the output
|
|
40
|
+
}
|
|
41
|
+
else if (response.type === "commandError") {
|
|
42
|
+
result = response.stderr + "/n";
|
|
43
|
+
; // Set result to the error
|
|
44
|
+
response.result = result;
|
|
45
|
+
resolve(response); // Resolve with the result string
|
|
46
|
+
}
|
|
47
|
+
else if (response.type === "commandFinish") {
|
|
48
|
+
response.result = result;
|
|
49
|
+
resolve(response); // Resolve with the result string
|
|
50
|
+
}
|
|
37
51
|
}
|
|
38
52
|
});
|
|
39
53
|
});
|
package/package.json
CHANGED
package/src/modules/browser.ts
CHANGED
|
File without changes
|
package/src/modules/chat.ts
CHANGED
|
@@ -58,11 +58,12 @@ const cbchat = {
|
|
|
58
58
|
* Sends a message through the WebSocket connection.
|
|
59
59
|
* @param {string} message - The message to be sent.
|
|
60
60
|
*/
|
|
61
|
-
sendMessage: (message: string) => {
|
|
61
|
+
sendMessage: (message: string, payload: any) => {
|
|
62
62
|
console.log(message);
|
|
63
63
|
cbws.getWebsocket.send(JSON.stringify({
|
|
64
64
|
"type": "sendMessage",
|
|
65
|
-
"message": message
|
|
65
|
+
"message": message,
|
|
66
|
+
payload
|
|
66
67
|
}));
|
|
67
68
|
},
|
|
68
69
|
|
|
@@ -130,10 +131,10 @@ const cbchat = {
|
|
|
130
131
|
"type": "processStoped"
|
|
131
132
|
}));
|
|
132
133
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Stops the ongoing process.
|
|
136
|
+
* Sends a specific message to the server to stop the process.
|
|
137
|
+
*/
|
|
137
138
|
processFinished: () => {
|
|
138
139
|
// Implement the logic to stop the process here
|
|
139
140
|
console.log("Process Finished ...");
|
|
@@ -171,7 +172,7 @@ const cbchat = {
|
|
|
171
172
|
cbws.getWebsocket.send(JSON.stringify({
|
|
172
173
|
"type": "notificationEvent",
|
|
173
174
|
"message": notificationMessage,
|
|
174
|
-
"eventType":type
|
|
175
|
+
"eventType": type
|
|
175
176
|
}));
|
|
176
177
|
},
|
|
177
178
|
|
|
File without changes
|
package/src/modules/codeutils.ts
CHANGED
|
File without changes
|
package/src/modules/crawler.ts
CHANGED
|
File without changes
|
package/src/modules/dbmemory.ts
CHANGED
|
File without changes
|
package/src/modules/debug.ts
CHANGED
|
File without changes
|
package/src/modules/docutils.ts
CHANGED
|
File without changes
|
package/src/modules/fs.ts
CHANGED
|
File without changes
|
package/src/modules/git.ts
CHANGED
|
File without changes
|
package/src/modules/history.ts
CHANGED
|
File without changes
|
package/src/modules/knowledge.ts
CHANGED
|
File without changes
|
package/src/modules/llm.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/modules/project.ts
CHANGED
|
File without changes
|
package/src/modules/rag.ts
CHANGED
|
File without changes
|
package/src/modules/search.ts
CHANGED
|
File without changes
|
package/src/modules/state.ts
CHANGED
|
File without changes
|
package/src/modules/task.ts
CHANGED
|
File without changes
|
package/src/modules/terminal.ts
CHANGED
|
@@ -26,10 +26,22 @@ const cbterminal = {
|
|
|
26
26
|
"message": command,
|
|
27
27
|
executeInMain
|
|
28
28
|
}));
|
|
29
|
+
let result = "";
|
|
29
30
|
cbws.getWebsocket.on('message', (data: string) => {
|
|
30
31
|
const response = JSON.parse(data);
|
|
32
|
+
|
|
31
33
|
if (response.type === "commandOutput" || response.type === "commandError" || response.type === "commandFinish") {
|
|
32
|
-
|
|
34
|
+
if (response.type === "commandOutput") {
|
|
35
|
+
// Initialize result as an empty string
|
|
36
|
+
result += response.stdout + "/n"; // Append the output
|
|
37
|
+
} else if (response.type === "commandError") {
|
|
38
|
+
result = response.stderr + "/n";; // Set result to the error
|
|
39
|
+
response.result = result;
|
|
40
|
+
resolve(response); // Resolve with the result string
|
|
41
|
+
} else if (response.type === "commandFinish") {
|
|
42
|
+
response.result = result;
|
|
43
|
+
resolve(response); // Resolve with the result string
|
|
44
|
+
}
|
|
33
45
|
}
|
|
34
46
|
});
|
|
35
47
|
});
|
package/src/modules/tokenizer.ts
CHANGED
|
File without changes
|
package/src/modules/vectordb.ts
CHANGED
|
File without changes
|