MCPcopy
hub / github.com/CodebuffAI/codebuff / getLoadedAgentsMessage

Function getLoadedAgentsMessage

cli/src/utils/local-agent-registry.ts:415–436  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

413}
414
415export const getLoadedAgentsMessage = (): string | null => {
416 const agents = loadLocalAgents()
417 const agentsDir = findAgentsDirectory()
418
419 if (!agentsDir || !agents.length) {
420 return null
421 }
422
423 const agentCount = agents.length
424 const header = `Loaded ${pluralize(agentCount, 'local agent')} from ${agentsDir}`
425 const agentList = agents
426 .map((agent) => {
427 const identifier =
428 agent.displayName && agent.displayName !== agent.id
429 ? `${agent.displayName} (${agent.id})`
430 : agent.displayName || agent.id
431 return ` - ${identifier}`
432 })
433 .join('\n')
434
435 return `${header}\n${agentList}`
436}
437
438export const getLoadedAgentsData = (): {
439 agents: LocalAgentInfo[]

Callers 1

Calls 3

loadLocalAgentsFunction · 0.90
pluralizeFunction · 0.90
findAgentsDirectoryFunction · 0.85

Tested by

no test coverage detected