getAgentsList
codebolt.agent.getAgentsList(type: Agents): Promise<any>
Retrieves a list of agents based on the specified type.
Parameters
Name | Type | Description |
---|---|---|
type | Agents | The type of agents to list (LOCAL, ALL, DOWNLOADED). Default is DOWNLOADED. |
Returns:
Promise<any>
A promise that resolves with the list of agentsExample
// Example 1: Getting list of downloaded agents (default)
const downloadedAgents = await codebolt.agent.getAgentsList();
console.log("Downloaded Agents:", downloadedAgents);
// Example 2: Getting list of local agents
const localAgents = await codebolt.agent.getAgentsList("local");
console.log("Local Agents:", localAgents);
// Example 3: Getting list of all agents
const allAgents = await codebolt.agent.getAgentsList("ALL");
console.log("All Agents:", allAgents);