Skip to content

Commit 7b0e8ff

Browse files
new release
1 parent bd73e19 commit 7b0e8ff

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}
249249
declare const _default: Codebolt;

modules/agent.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
};
1515
export default codeboltAgent;

modules/agent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codebolt/codeboltjs",
3-
"version": "1.1.83",
3+
"version": "1.1.84",
44
"description": "",
55
"keywords": [],
66
"author": "",

src/modules/agent.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)