File tree Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codebolt/codeboltjs" ,
3
- "version" : " 1.1.20 " ,
3
+ "version" : " 1.1.21 " ,
4
4
"description" : " " ,
5
5
"keywords" : [],
6
6
"author" : " " ,
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ import git from './modules/git';
17
17
import dbmemory from './modules/dbmemory' ;
18
18
import cbstate from './modules/state' ;
19
19
import task from './modules/task' ;
20
-
21
20
import vectorDB from './modules/vectordb' ;
21
+ import debug from './modules/debug'
22
22
import WebSocket from 'ws' ;
23
23
24
24
@@ -94,6 +94,7 @@ class Codebolt {
94
94
cbstate = cbstate ;
95
95
taskplaner = task ;
96
96
vectordb = vectorDB ;
97
+ debug = debug ;
97
98
}
98
99
99
100
// export default new Codebolt();
Original file line number Diff line number Diff line change
1
+ import cbws from './websocket' ;
2
+
3
+ enum logType {
4
+ info = "info" ,
5
+ error = "error" ,
6
+ warning = "warning"
7
+ }
8
+
9
+
10
+ export const debug = {
11
+ debug ( log :string , type :logType ) {
12
+ return new Promise ( ( resolve , reject ) => {
13
+ cbws . getWebsocket . send ( JSON . stringify ( {
14
+ "type" : "debugEvent" ,
15
+ message :{
16
+ log,
17
+ type
18
+ }
19
+ } ) ) ;
20
+ cbws . getWebsocket . on ( 'message' , ( data : string ) => {
21
+ const response = JSON . parse ( data ) ;
22
+ if ( response . type === "debugEventResponse" ) {
23
+ resolve ( response ) ; // Resolve the Promise with the response data
24
+ }
25
+ } )
26
+ } )
27
+
28
+
29
+ }
30
+ }
31
+
32
+
33
+ export default debug ;
34
+
35
+
36
+
You can’t perform that action at this time.
0 commit comments