@@ -23,21 +23,28 @@ data:
2323
2424### Response Structure
2525
26- The method returns a Promise that resolves to an ` AgentsDetailResponse ` object with:
27- - ` type ` : "agentsDetailResponse"
28- - ` messageId ` : Unique message identifier string
29- - ` threadId ` : Thread identifier string
30- - ` success ` : Boolean indicating if the request was successful
31- - ` payload ` : Object containing the actual data:
32- - ` agents ` : Array of detailed agent objects, each containing:
33- - ` id ` : Unique agent identifier
34- - ` name ` : Agent display name
35- - ` description ` : Agent description text
36- - ` capabilities ` : Array of agent capabilities (may be empty)
37- - ` isLocal ` : Boolean indicating if the agent is local
38- - ` version ` : Version string of the agent
39- - ` status ` : Numeric status code (1 = active)
40- - ` unique_id ` : Unique identifier string for the agent
26+ The method returns a Promise that resolves to an ` AgentsDetailResponse ` object with the following properties:
27+
28+ ** Response Properties:**
29+ - ` type ` : Always "agentsDetailResponse"
30+ - ` payload ` : Optional object containing the actual agent details data
31+ - ` agents ` : Array of agent detail objects with detailed agent information
32+ - ` success ` : Optional boolean indicating if the operation was successful
33+ - ` message ` : Optional string with additional information
34+ - ` error ` : Optional string containing error details if the operation failed
35+ - ` messageId ` : Optional unique identifier for the message
36+ - ` threadId ` : Optional thread identifier
37+
38+ ** Agent Detail Structure:**
39+ Each agent in the ` payload.agents ` array has the following structure:
40+ - ` id ` : Unique agent identifier
41+ - ` name ` : Agent display name
42+ - ` description ` : Agent description text
43+ - ` capabilities ` : Optional array of agent capabilities
44+ - ` isLocal ` : Boolean indicating if the agent is local
45+ - ` version ` : Version string of the agent
46+ - ` status ` : String status of the agent
47+ - ` unique_id ` : Unique identifier string for the agent
4148
4249### Examples
4350
@@ -54,8 +61,9 @@ if (agentsList?.agents && agentsList.agents.length > 0) {
5461 // Get detailed information for the selected agents
5562 const agentsDetailResult = await codebolt .agent .getAgentsDetail (agentIds);
5663 console .log (' Agent details result type:' , agentsDetailResult? .type ); // "agentsDetailResponse"
57- console .log (' Message ID:' , agentsDetailResult? .messageId );
5864 console .log (' Success:' , agentsDetailResult? .success );
65+ console .log (' Message ID:' , agentsDetailResult? .messageId );
66+ console .log (' Thread ID:' , agentsDetailResult? .threadId );
5967 console .log (' Details count:' , agentsDetailResult? .payload ? .agents ? .length || 0 );
6068 console .log (' Agent details:' , agentsDetailResult);
6169
@@ -64,15 +72,20 @@ if (agentsList?.agents && agentsList.agents.length > 0) {
6472 const firstAgent = agentsDetailResult .payload .agents [0 ];
6573 console .log (' First agent ID:' , firstAgent .id );
6674 console .log (' First agent name:' , firstAgent .name );
75+ console .log (' First agent description:' , firstAgent .description );
6776 console .log (' First agent version:' , firstAgent .version );
6877 console .log (' First agent is local:' , firstAgent .isLocal );
78+ console .log (' First agent status:' , firstAgent .status );
79+ console .log (' First agent unique_id:' , firstAgent .unique_id );
80+ console .log (' First agent capabilities:' , firstAgent .capabilities );
6981 }
7082}
7183
7284// Example 2: Get details for all agents (using empty array)
7385const allAgentDetails = await codebolt .agent .getAgentsDetail ([]);
7486console .log (' All agent details:' , allAgentDetails);
7587console .log (' Success:' , allAgentDetails? .success );
88+ console .log (' Type:' , allAgentDetails? .type );
7689console .log (' Total agents:' , allAgentDetails? .payload ? .agents ? .length || 0 );
7790
7891// Display each agent's key information
@@ -81,15 +94,18 @@ if (allAgentDetails?.payload?.agents) {
8194 console .log (` Agent ${ index + 1 } :` );
8295 console .log (` - ID: ${ agent .id } ` );
8396 console .log (` - Name: ${ agent .name } ` );
97+ console .log (` - Description: ${ agent .description } ` );
8498 console .log (` - Version: ${ agent .version } ` );
8599 console .log (` - Status: ${ agent .status } ` );
86100 console .log (` - Is Local: ${ agent .isLocal } ` );
87101 console .log (` - Unique ID: ${ agent .unique_id } ` );
102+ console .log (` - Capabilities: ${ agent .capabilities || ' None' } ` );
88103 });
89104}
90105` ` `
91106
92107### Usage Notes
93108
94109- Agent IDs can be obtained from the ` getAgentsList ()` method using ` agent .function ? .name `
95- - Pass an empty array ` []` to get details for all available agents
110+ - Pass an empty array ` []` to get details for all available agents
111+ - The response includes both basic WebSocket response properties and detailed agent information in the ` payload` field
0 commit comments