@codebolt/codeboltjs 1.1.26 → 1.1.27
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 +3 -1
- package/modules/chat.d.ts +1 -0
- package/modules/chat.js +8 -0
- package/modules/codeutils.d.ts +1 -1
- package/modules/codeutils.js +11 -2
- package/modules/debug.d.ts +1 -0
- package/modules/debug.js +19 -0
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/modules/chat.ts +8 -0
- package/src/modules/codeutils.ts +11 -2
- package/src/modules/debug.ts +20 -0
package/index.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ declare class Codebolt {
|
|
|
86
86
|
event: import("./modules/chat").CustomEventEmitter;
|
|
87
87
|
stopProcess: () => void;
|
|
88
88
|
};
|
|
89
|
+
stopProcess: () => void;
|
|
89
90
|
};
|
|
90
91
|
terminal: {
|
|
91
92
|
eventEmitter: import("./modules/terminal").CustomEventEmitter;
|
|
@@ -95,7 +96,7 @@ declare class Codebolt {
|
|
|
95
96
|
executeCommandWithStream(command: string): import("./modules/terminal").CustomEventEmitter;
|
|
96
97
|
};
|
|
97
98
|
codeutils: {
|
|
98
|
-
getCodeTree: (
|
|
99
|
+
getCodeTree: () => Promise<any>;
|
|
99
100
|
getAllFilesAsMarkDown: () => Promise<unknown>;
|
|
100
101
|
};
|
|
101
102
|
docutils: {
|
|
@@ -155,6 +156,7 @@ declare class Codebolt {
|
|
|
155
156
|
};
|
|
156
157
|
debug: {
|
|
157
158
|
debug(log: string, type: import("./modules/debug").logType): Promise<unknown>;
|
|
159
|
+
openDebugBrowser(url: string, port: number): Promise<unknown>;
|
|
158
160
|
};
|
|
159
161
|
tokenizer: {
|
|
160
162
|
addToken: (key: string) => Promise<any>;
|
package/modules/chat.d.ts
CHANGED
package/modules/chat.js
CHANGED
|
@@ -90,6 +90,14 @@ const cbchat = {
|
|
|
90
90
|
}));
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
+
},
|
|
94
|
+
stopProcess: () => {
|
|
95
|
+
// Implement the logic to stop the process here
|
|
96
|
+
console.log("Stopping process...");
|
|
97
|
+
// For example, you might want to send a specific message to the server to stop the process
|
|
98
|
+
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
99
|
+
"type": "processStoped"
|
|
100
|
+
}));
|
|
93
101
|
}
|
|
94
102
|
};
|
|
95
103
|
exports.default = cbchat;
|
package/modules/codeutils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare const cbcodeutils: {
|
|
|
9
9
|
* @param {any} filePath - The file path where the source code is located.
|
|
10
10
|
* @returns {Promise<any>} A promise that resolves with the code tree.
|
|
11
11
|
*/
|
|
12
|
-
getCodeTree: (
|
|
12
|
+
getCodeTree: () => Promise<any>;
|
|
13
13
|
getAllFilesAsMarkDown: () => Promise<unknown>;
|
|
14
14
|
};
|
|
15
15
|
export default cbcodeutils;
|
package/modules/codeutils.js
CHANGED
|
@@ -15,9 +15,18 @@ const cbcodeutils = {
|
|
|
15
15
|
* @param {any} filePath - The file path where the source code is located.
|
|
16
16
|
* @returns {Promise<any>} A promise that resolves with the code tree.
|
|
17
17
|
*/
|
|
18
|
-
getCodeTree: (
|
|
18
|
+
getCodeTree: () => {
|
|
19
19
|
return new Promise((resolve, reject) => {
|
|
20
|
-
|
|
20
|
+
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
21
|
+
"type": "codeEvent",
|
|
22
|
+
"action": "getCodeTree"
|
|
23
|
+
}));
|
|
24
|
+
websocket_1.default.getWebsocket.on('message', (data) => {
|
|
25
|
+
const response = JSON.parse(data);
|
|
26
|
+
if (response.type === "getCodeTreeResponse") {
|
|
27
|
+
resolve(response.markdown); // Resolve the Promise with the response data
|
|
28
|
+
}
|
|
29
|
+
});
|
|
21
30
|
});
|
|
22
31
|
},
|
|
23
32
|
getAllFilesAsMarkDown: () => {
|
package/modules/debug.d.ts
CHANGED
package/modules/debug.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.debug = {
|
|
|
16
16
|
return new Promise((resolve, reject) => {
|
|
17
17
|
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
18
18
|
"type": "debugEvent",
|
|
19
|
+
"action": "addLog",
|
|
19
20
|
message: {
|
|
20
21
|
log,
|
|
21
22
|
type
|
|
@@ -28,6 +29,24 @@ exports.debug = {
|
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
});
|
|
32
|
+
},
|
|
33
|
+
openDebugBrowser(url, port) {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
36
|
+
"type": "debugEvent",
|
|
37
|
+
"action": "openDebugBrowser",
|
|
38
|
+
message: {
|
|
39
|
+
url,
|
|
40
|
+
port
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
websocket_1.default.getWebsocket.on('message', (data) => {
|
|
44
|
+
const response = JSON.parse(data);
|
|
45
|
+
if (response.type === "openDebugBrowserResponse") {
|
|
46
|
+
resolve(response); // Resolve the Promise with the response data
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
31
50
|
}
|
|
32
51
|
};
|
|
33
52
|
exports.default = exports.debug;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/modules/chat.ts
CHANGED
|
@@ -92,6 +92,14 @@ const cbchat = {
|
|
|
92
92
|
}));
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
+
},
|
|
96
|
+
stopProcess: () => {
|
|
97
|
+
// Implement the logic to stop the process here
|
|
98
|
+
console.log("Stopping process...");
|
|
99
|
+
// For example, you might want to send a specific message to the server to stop the process
|
|
100
|
+
cbws.getWebsocket.send(JSON.stringify({
|
|
101
|
+
"type": "processStoped"
|
|
102
|
+
}));
|
|
95
103
|
}
|
|
96
104
|
};
|
|
97
105
|
|
package/src/modules/codeutils.ts
CHANGED
|
@@ -11,9 +11,18 @@ const cbcodeutils = {
|
|
|
11
11
|
* @param {any} filePath - The file path where the source code is located.
|
|
12
12
|
* @returns {Promise<any>} A promise that resolves with the code tree.
|
|
13
13
|
*/
|
|
14
|
-
getCodeTree: (
|
|
14
|
+
getCodeTree: (): Promise<any> => {
|
|
15
15
|
return new Promise((resolve, reject) => {
|
|
16
|
-
|
|
16
|
+
cbws.getWebsocket.send(JSON.stringify({
|
|
17
|
+
"type": "codeEvent",
|
|
18
|
+
"action":"getCodeTree"
|
|
19
|
+
}));
|
|
20
|
+
cbws.getWebsocket.on('message', (data: string) => {
|
|
21
|
+
const response = JSON.parse(data);
|
|
22
|
+
if (response.type === "getCodeTreeResponse") {
|
|
23
|
+
resolve(response.markdown); // Resolve the Promise with the response data
|
|
24
|
+
}
|
|
25
|
+
});
|
|
17
26
|
});
|
|
18
27
|
},
|
|
19
28
|
getAllFilesAsMarkDown:()=>{
|
package/src/modules/debug.ts
CHANGED
|
@@ -12,6 +12,7 @@ export const debug={
|
|
|
12
12
|
return new Promise((resolve, reject) => {
|
|
13
13
|
cbws.getWebsocket.send(JSON.stringify({
|
|
14
14
|
"type": "debugEvent",
|
|
15
|
+
"action":"addLog",
|
|
15
16
|
message:{
|
|
16
17
|
log,
|
|
17
18
|
type
|
|
@@ -26,6 +27,25 @@ export const debug={
|
|
|
26
27
|
})
|
|
27
28
|
|
|
28
29
|
|
|
30
|
+
},
|
|
31
|
+
openDebugBrowser(url:string,port:number){
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
cbws.getWebsocket.send(JSON.stringify({
|
|
34
|
+
"type": "debugEvent",
|
|
35
|
+
"action":"openDebugBrowser",
|
|
36
|
+
message:{
|
|
37
|
+
url,
|
|
38
|
+
port
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
cbws.getWebsocket.on('message', (data: string) => {
|
|
42
|
+
const response = JSON.parse(data);
|
|
43
|
+
if (response.type === "openDebugBrowserResponse") {
|
|
44
|
+
resolve(response); // Resolve the Promise with the response data
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
29
49
|
}
|
|
30
50
|
}
|
|
31
51
|
|