@@ -7,18 +7,18 @@ async function testAgent() {
77 try {
88 await codebolt . waitForConnection ( ) ;
99
10- // console.log('\n1. Testing agent list retrieval...');
11- // try {
12- // const agentsListResult = await codebolt.agent.getAgentsList('downloaded');
13- // console.log('✅ Agents list result:', agentsListResult);
14- // console.log(' - Type:', agentsListResult?.type);
15- // console.log(' - Agents count:', agentsListResult?.agents?.length || 0);
16- // if (agentsListResult?.agents?.length > 0) {
17- // console.log(' - First agent:', agentsListResult.agents[0]);
18- // }
19- // } catch (error) {
20- // console.log('⚠️ Agent list retrieval failed:', error.message);
21- // }
10+ console . log ( '\n1. Testing agent list retrieval...' ) ;
11+ try {
12+ const agentsListResult = await codebolt . agent . getAgentsList ( 'downloaded' ) ;
13+ console . log ( '✅ Agents list result:' , agentsListResult ) ;
14+ console . log ( ' - Type:' , agentsListResult ?. type ) ;
15+ console . log ( ' - Agents count:' , agentsListResult ?. agents ?. length || 0 ) ;
16+ if ( agentsListResult ?. agents ?. length > 0 ) {
17+ console . log ( ' - First agent:' , agentsListResult . agents [ 0 ] ) ;
18+ }
19+ } catch ( error ) {
20+ console . log ( '⚠️ Agent list retrieval failed:' , error . message ) ;
21+ }
2222
2323 // console.log('\n2. Testing all agents list...');
2424 // try {
@@ -69,25 +69,25 @@ async function testAgent() {
6969 console . log ( '⚠️ getAgentsDetail failed:' , error . message ) ;
7070 }
7171
72- // console.log('\n5. Testing agent finding by task...');
73- // const testTask = 'Run project ';
74- // try {
75- // const findAgentResult = await codebolt.agent.findAgent(
76- // testTask,
77- // 3, // maxResult
78- // [], // agents filter
79- // 'all ', // agentLocation
80- // 'use_both' // getFrom
81- // );
82- // console.log('✅ Find agent result:', findAgentResult);
83- // console.log(' - Task:', testTask);
84- // console.log(' - Found agents count:', findAgentResult?.agents?.length || 0);
85- // if (findAgentResult?.agents?.length > 0) {
86- // console.log(' - Best match:', findAgentResult.agents[0]);
87- // }
88- // } catch (error) {
89- // console.log('⚠️ Agent finding failed:', error.message);
90- // }
72+ console . log ( '\n5. Testing agent finding by task...' ) ;
73+ const testTask = 'create node js app ' ;
74+ try {
75+ const findAgentResult = await codebolt . agent . findAgent (
76+ testTask ,
77+ 3 , // maxResult
78+ [ ] , // agents filter
79+ 'remote_only ', // agentLocation
80+ 'use_both' // getFrom
81+ ) ;
82+ console . log ( '✅ Find agent result:' , findAgentResult ) ;
83+ console . log ( ' - Task:' , testTask ) ;
84+ console . log ( ' - Found agents count:' , findAgentResult ?. agents ?. length || 0 ) ;
85+ if ( findAgentResult ?. agents ?. length > 0 ) {
86+ console . log ( ' - Best match:' , findAgentResult . agents [ 0 ] ) ;
87+ }
88+ } catch ( error ) {
89+ console . log ( '⚠️ Agent finding failed:' , error . message ) ;
90+ }
9191
9292 // console.log('\n6. Testing agent finding with different parameters...');
9393 // const analysisTask = 'Analyze data and provide insights';
0 commit comments