MCPcopy
hub / github.com/codeaashu/claude-code / getActiveAgentsFromList

Function getActiveAgentsFromList

src/tools/AgentTool/loadAgentsDir.ts:193–221  ·  view source on GitHub ↗
(
  allAgents: AgentDefinition[],
)

Source from the content-addressed store, hash-verified

191}
192
193export function getActiveAgentsFromList(
194 allAgents: AgentDefinition[],
195): AgentDefinition[] {
196 const builtInAgents = allAgents.filter(a => a.source === 'built-in')
197 const pluginAgents = allAgents.filter(a => a.source === 'plugin')
198 const userAgents = allAgents.filter(a => a.source === 'userSettings')
199 const projectAgents = allAgents.filter(a => a.source === 'projectSettings')
200 const managedAgents = allAgents.filter(a => a.source === 'policySettings')
201 const flagAgents = allAgents.filter(a => a.source === 'flagSettings')
202
203 const agentGroups = [
204 builtInAgents,
205 pluginAgents,
206 userAgents,
207 projectAgents,
208 flagAgents,
209 managedAgents,
210 ]
211
212 const agentMap = new Map<string, AgentDefinition>()
213
214 for (const agents of agentGroups) {
215 for (const agent of agents) {
216 agentMap.set(agent.agentType, agent)
217 }
218 }
219
220 return Array.from(agentMap.values())
221}
222
223/**
224 * Checks if an agent's required MCP servers are available.

Callers 10

runFunction · 0.85
loadAgentsDir.tsFile · 0.85
AgentsMenuFunction · 0.85
AgentEditorFunction · 0.85
ConfirmStepWrapperFunction · 0.85
onSelectFunction · 0.85
REPLFunction · 0.85
loadInitialMessagesFunction · 0.85
agentsHandlerFunction · 0.85

Calls 2

valuesMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected