Skip to content

Commit d0e8921

Browse files
changes in tools
1 parent 6f9a9ea commit d0e8921

File tree

8 files changed

+315
-472
lines changed

8 files changed

+315
-472
lines changed

src/modules/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const codeboltAgent = {
8787
"action": "agentsDetail",
8888
"agentList": agentList
8989
},
90-
"listAgentsResponse"
90+
"agentsDetailResponse"
9191
);
9292
}
9393
}

src/modules/terminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const cbterminal = {
5959
sendManualInterrupt(): Promise<TerminalInterruptResponse> {
6060
return cbws.messageManager.sendAndWaitForResponse(
6161
{
62-
"type": "sendInterruptToTerminal"
62+
"type": "sendInterruptToTerminal",
6363
},
6464
"terminalInterrupted"
6565
);

testcases/tests/agent-test.js

Lines changed: 166 additions & 154 deletions
Large diffs are not rendered by default.

testcases/tests/chat-test.js

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,76 +8,76 @@ async function testChatOperations() {
88

99
await codebolt.waitForConnection();
1010

11-
console.log('\n1. Testing get chat history...');
12-
const chatHistory = await codebolt.chat.getChatHistory();
13-
console.log('✅ Chat history retrieved:', {
14-
type: typeof chatHistory,
15-
isArray: Array.isArray(chatHistory),
16-
data: chatHistory,
17-
length: Array.isArray(chatHistory) ? chatHistory.length : 'N/A',
18-
sample: Array.isArray(chatHistory) ? chatHistory.slice(0, 2) : 'Not an array'
19-
});
20-
21-
console.log('\n2. Testing notification events...');
22-
const notificationTypes = ['debug', 'git', 'planner', 'browser', 'editor', 'terminal', 'preview'];
23-
24-
for (const type of notificationTypes) {
25-
codebolt.chat.sendNotificationEvent(`Test ${type} notification from CodeboltJS`, type);
26-
console.log(`✅ Sent ${type} notification`);
27-
}
28-
29-
console.log('\n3. Testing send message...');
30-
codebolt.chat.sendMessage('Test message from CodeboltJS', {
31-
timestamp: new Date().toISOString(),
32-
source: 'codeboltjs-test'
33-
});
34-
console.log('✅ Message sent');
35-
36-
console.log('\n4. Testing process lifecycle...');
37-
const processControl = codebolt.chat.processStarted();
38-
console.log('✅ Process started');
39-
40-
// Test event listener for stop process clicked
41-
processControl.event.on('stopProcessClicked', (data) => {
42-
console.log('🛑 Stop process clicked event received:', data);
43-
});
44-
console.log('✅ Stop process event listener set up');
45-
46-
// Simulate some work
47-
await new Promise(resolve => setTimeout(resolve, 1000));
48-
49-
processControl.stopProcess();
50-
console.log('✅ Process stopped via processControl');
51-
52-
// Test standalone stopProcess function
53-
codebolt.chat.stopProcess();
54-
console.log('✅ Process stopped via standalone function');
55-
56-
codebolt.chat.processFinished();
57-
console.log('✅ Process finished');
58-
59-
console.log('\n5. Testing action message listener...');
60-
const actionEmitter = codebolt.chat.onActionMessage();
61-
62-
actionEmitter.on('userMessage', (data, callback) => {
63-
console.log('📨 Received user message:', data);
64-
if (callback && typeof callback === 'function') {
65-
callback('Message processed by CodeboltJS test');
66-
}
67-
});
68-
69-
console.log('✅ Action message listener set up');
70-
71-
console.log('\n6. Testing request handler...');
72-
codebolt.chat.setRequestHandler((request, response) => {
73-
console.log('📥 Received request:', request);
74-
response({
75-
status: 'success',
76-
message: 'Request handled by CodeboltJS test',
77-
timestamp: new Date().toISOString()
78-
});
79-
});
80-
console.log('✅ Request handler set up');
11+
// console.log('\n1. Testing get chat history...');
12+
// const chatHistory = await codebolt.chat.getChatHistory();
13+
// console.log('✅ Chat history retrieved:', {
14+
// type: typeof chatHistory,
15+
// isArray: Array.isArray(chatHistory),
16+
// data: chatHistory,
17+
// length: Array.isArray(chatHistory) ? chatHistory.length : 'N/A',
18+
// sample: Array.isArray(chatHistory) ? chatHistory.slice(0, 2) : 'Not an array'
19+
// });
20+
21+
// console.log('\n2. Testing notification events...');
22+
// const notificationTypes = ['debug', 'git', 'planner', 'browser', 'editor', 'terminal', 'preview'];
23+
24+
// for (const type of notificationTypes) {
25+
// codebolt.chat.sendNotificationEvent(`Test ${type} notification from CodeboltJS`, type);
26+
// console.log(`✅ Sent ${type} notification`);
27+
// }
28+
29+
// console.log('\n3. Testing send message...');
30+
// codebolt.chat.sendMessage('Test message from CodeboltJS', {
31+
// timestamp: new Date().toISOString(),
32+
// source: 'codeboltjs-test'
33+
// });
34+
// console.log('✅ Message sent');
35+
36+
// console.log('\n4. Testing process lifecycle...');
37+
// const processControl = codebolt.chat.processStarted();
38+
// console.log('✅ Process started');
39+
40+
// // Test event listener for stop process clicked
41+
// processControl.event.on('stopProcessClicked', (data) => {
42+
// console.log('🛑 Stop process clicked event received:', data);
43+
// });
44+
// console.log('✅ Stop process event listener set up');
45+
46+
// // Simulate some work
47+
// await new Promise(resolve => setTimeout(resolve, 1000));
48+
49+
// processControl.stopProcess();
50+
// console.log('✅ Process stopped via processControl');
51+
52+
// // Test standalone stopProcess function
53+
// codebolt.chat.stopProcess();
54+
// console.log('✅ Process stopped via standalone function');
55+
56+
// codebolt.chat.processFinished();
57+
// console.log('✅ Process finished');
58+
59+
// console.log('\n5. Testing action message listener...');
60+
// const actionEmitter = codebolt.chat.onActionMessage();
61+
62+
// actionEmitter.on('userMessage', (data, callback) => {
63+
// console.log('📨 Received user message:', data);
64+
// if (callback && typeof callback === 'function') {
65+
// callback('Message processed by CodeboltJS test');
66+
// }
67+
// });
68+
69+
// console.log('✅ Action message listener set up');
70+
71+
// console.log('\n6. Testing request handler...');
72+
// codebolt.chat.setRequestHandler((request, response) => {
73+
// console.log('📥 Received request:', request);
74+
// response({
75+
// status: 'success',
76+
// message: 'Request handled by CodeboltJS test',
77+
// timestamp: new Date().toISOString()
78+
// });
79+
// });
80+
// console.log('✅ Request handler set up');
8181

8282
console.log('\n7. Testing waitforReply (non-interactive)...');
8383
// Note: This would normally wait for a user reply, but we'll just test the function call

testcases/tests/task-test.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ async function testTask() {
5555
console.log('❌ Getting tasks failed:', error.message);
5656
}
5757

58-
// Test 4: Update a task
59-
console.log('\n📋 Test 4: Update a task');
60-
try {
61-
const updateResult = await codebolt.taskplaner.updateTask('Complete project documentation - UPDATED with new requirements');
62-
console.log('✅ Task updated successfully');
63-
console.log(' - Response type:', updateResult?.type);
64-
console.log(' - Success:', !!updateResult?.success);
65-
console.log(' - Updated task includes new requirements');
66-
} catch (error) {
67-
console.log('❌ Updating task failed:', error.message);
68-
}
58+
// // Test 4: Update a task
59+
// console.log('\n📋 Test 4: Update a task');
60+
// try {
61+
// const updateResult = await codebolt.taskplaner.updateTask('Complete project documentation - UPDATED with new requirements');
62+
// console.log('✅ Task updated successfully');
63+
// console.log(' - Response type:', updateResult?.type);
64+
// console.log(' - Success:', !!updateResult?.success);
65+
// console.log(' - Updated task includes new requirements');
66+
// } catch (error) {
67+
// console.log('❌ Updating task failed:', error.message);
68+
// }
6969

7070
// Test 5: Add tasks with different complexity levels
7171
console.log('\n📋 Test 5: Add tasks with different complexity levels');
@@ -89,27 +89,27 @@ async function testTask() {
8989
console.log('❌ Adding complex tasks failed:', error.message);
9090
}
9191

92-
// Test 6: Update multiple tasks
93-
console.log('\n📋 Test 6: Update multiple tasks');
94-
try {
95-
const taskUpdates = [
96-
'Review code changes - COMPLETED',
97-
'Update unit tests - IN PROGRESS',
98-
'Fix bug in authentication module - ASSIGNED to John',
99-
'Prepare release notes - PENDING review',
100-
'Deploy to staging environment - SCHEDULED for tomorrow'
101-
];
92+
// // Test 6: Update multiple tasks
93+
// console.log('\n📋 Test 6: Update multiple tasks');
94+
// try {
95+
// const taskUpdates = [
96+
// 'Review code changes - COMPLETED',
97+
// 'Update unit tests - IN PROGRESS',
98+
// 'Fix bug in authentication module - ASSIGNED to John',
99+
// 'Prepare release notes - PENDING review',
100+
// 'Deploy to staging environment - SCHEDULED for tomorrow'
101+
// ];
102102

103-
for (const update of taskUpdates) {
104-
await codebolt.taskplaner.updateTask(update);
105-
}
103+
// for (const update of taskUpdates) {
104+
// await codebolt.taskplaner.updateTask(update);
105+
// }
106106

107-
console.log('✅ Multiple task updates completed');
108-
console.log(` - Updates applied: ${taskUpdates.length}`);
109-
console.log(' - Status updates: completed, in progress, assigned, pending, scheduled');
110-
} catch (error) {
111-
console.log('❌ Updating multiple tasks failed:', error.message);
112-
}
107+
// console.log('✅ Multiple task updates completed');
108+
// console.log(` - Updates applied: ${taskUpdates.length}`);
109+
// console.log(' - Status updates: completed, in progress, assigned, pending, scheduled');
110+
// } catch (error) {
111+
// console.log('❌ Updating multiple tasks failed:', error.message);
112+
// }
113113

114114
// Test 7: Add tasks with special characters and formatting
115115
console.log('\n📋 Test 7: Add tasks with special characters and formatting');

testcases/tests/terminal-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ async function testTerminalOperations() {
66

77
try {
88

9-
await codebolt.activate();
109
await codebolt.waitForConnection();
1110

1211
console.log('\n1. Testing basic echo command...');

0 commit comments

Comments
 (0)