@@ -19,11 +19,12 @@ const cbterminal = {
19
19
* @param {string } command - The command to be executed.
20
20
* @returns {Promise<CommandOutput|CommandError> } A promise that resolves with the command's output, error, or finish signal.
21
21
*/
22
- executeCommand : async ( command : string ) : Promise < CommandOutput | CommandError > => {
22
+ executeCommand : async ( command : string , executeInMain = false ) : Promise < CommandOutput | CommandError > => {
23
23
return new Promise ( ( resolve , reject ) => {
24
24
cbws . getWebsocket . send ( JSON . stringify ( {
25
25
"type" : "executeCommand" ,
26
26
"message" : command ,
27
+ executeInMain
27
28
} ) ) ;
28
29
cbws . getWebsocket . on ( 'message' , ( data : string ) => {
29
30
const response = JSON . parse ( data ) ;
@@ -41,11 +42,12 @@ const cbterminal = {
41
42
* @param {string } command - The command to be executed.
42
43
* @returns {Promise<CommandError> } A promise that resolves when an error occurs during command execution.
43
44
*/
44
- executeCommandRunUntilError : async ( command : string ) : Promise < CommandError > => {
45
+ executeCommandRunUntilError : async ( command : string , executeInMain = false ) : Promise < CommandError > => {
45
46
return new Promise ( ( resolve , reject ) => {
46
47
cbws . getWebsocket . send ( JSON . stringify ( {
47
48
"type" : "executeCommandRunUntilError" ,
48
49
"message" : command ,
50
+ executeInMain
49
51
} ) ) ;
50
52
cbws . getWebsocket . on ( 'message' , ( data : string ) => {
51
53
const response = JSON . parse ( data ) ;
@@ -84,11 +86,12 @@ const cbterminal = {
84
86
* @param {string } command - The command to be executed.
85
87
* @returns {EventEmitter } A promise that streams the output data during command execution.
86
88
*/
87
- executeCommandWithStream ( command : string ) :EventEmitter {
89
+ executeCommandWithStream ( command : string , executeInMain = false ) :EventEmitter {
88
90
// Send the process started message
89
91
cbws . getWebsocket . send ( JSON . stringify ( {
90
92
"type" : "executeCommandWithStream" ,
91
- "message" : command ,
93
+ "message" : command
94
+ , executeInMain
92
95
} ) ) ;
93
96
// Register event listener for WebSocket messages
94
97
cbws . getWebsocket . on ( 'message' , ( data : string ) => {
0 commit comments