File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ declare class Codebolt {
243243 } ;
244244 AGENT : {
245245 getAgent : ( task : string ) => Promise < any > ;
246- startAgent : ( task : string ) => Promise < any > ;
246+ startAgent : ( agentId : string , task : string ) => Promise < any > ;
247247 } ;
248248}
249249declare const _default : Codebolt ;
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ declare const codeboltAgent: {
1010 * @param {string } task - The task for which the agent should be started.
1111 * @returns {Promise<void> } A promise that resolves when the agent has been successfully started.
1212 */
13- startAgent : ( task : string ) => Promise < any > ;
13+ startAgent : ( agentId : string , task : string ) => Promise < any > ;
1414} ;
1515export default codeboltAgent ;
Original file line number Diff line number Diff line change @@ -30,16 +30,17 @@ const codeboltAgent = {
3030 * @param {string } task - The task for which the agent should be started.
3131 * @returns {Promise<void> } A promise that resolves when the agent has been successfully started.
3232 */
33- startAgent : ( task ) => {
33+ startAgent : ( agentId , task ) => {
3434 return new Promise ( ( resolve , reject ) => {
3535 websocket_1 . default . getWebsocket . send ( JSON . stringify ( {
3636 "type" : "agentEvent" ,
3737 "action" : "startAgent" ,
38+ "agentId" : agentId ,
3839 "task" : task
3940 } ) ) ;
4041 websocket_1 . default . getWebsocket . on ( 'message' , ( data ) => {
4142 const response = JSON . parse ( data ) ;
42- if ( response . type === "startAgentResponse" && response . task === task ) {
43+ if ( response . type === "taskCompletionResponse" ) {
4344 resolve ( response ) ; // Resolve the Promise when the agent has been successfully started
4445 }
4546 } ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @codebolt/codeboltjs" ,
3- "version" : " 1.1.83 " ,
3+ "version" : " 1.1.84 " ,
44 "description" : " " ,
55 "keywords" : [],
66 "author" : " " ,
Original file line number Diff line number Diff line change @@ -28,16 +28,17 @@ const codeboltAgent = {
2828 * @param {string } task - The task for which the agent should be started.
2929 * @returns {Promise<void> } A promise that resolves when the agent has been successfully started.
3030 */
31- startAgent : ( task : string ) : Promise < any > => {
31+ startAgent : ( agentId : string , task : string ) : Promise < any > => {
3232 return new Promise ( ( resolve , reject ) => {
3333 cbws . getWebsocket . send ( JSON . stringify ( {
3434 "type" : "agentEvent" ,
3535 "action" : "startAgent" ,
36+ "agentId" : agentId ,
3637 "task" : task
3738 } ) ) ;
3839 cbws . getWebsocket . on ( 'message' , ( data : string ) => {
3940 const response = JSON . parse ( data ) ;
40- if ( response . type === "startAgentResponse" && response . task === task ) {
41+ if ( response . type === "taskCompletionResponse" ) {
4142 resolve ( response ) ; // Resolve the Promise when the agent has been successfully started
4243 }
4344 } ) ;
You can’t perform that action at this time.
0 commit comments