MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / announceLoadedAgents

Function announceLoadedAgents

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

Source from the content-addressed store, hash-verified

387// ============================================================================
388
389export const announceLoadedAgents = (): void => {
390 const agents = loadLocalAgents()
391 const agentsDir = findAgentsDirectory()
392
393 if (!agentsDir) {
394 logger.debug('[agents] No .agents directory found in this project.')
395 return
396 }
397
398 if (!agents.length) {
399 logger.debug({ agentsDir }, '[agents] No agent files found')
400 return
401 }
402
403 const agentIdentifiers = agents.map((agent) =>
404 agent.displayName && agent.displayName !== agent.id
405 ? `${agent.displayName} (${agent.id})`
406 : agent.displayName || agent.id,
407 )
408
409 logger.debug(
410 { agentsDir, agents: agentIdentifiers },
411 `[agents] Loaded ${pluralize(agents.length, 'local agent')}`,
412 )
413}
414
415export const getLoadedAgentsMessage = (): string | null => {
416 const agents = loadLocalAgents()

Callers 1

Calls 3

loadLocalAgentsFunction · 0.90
pluralizeFunction · 0.90
findAgentsDirectoryFunction · 0.85

Tested by

no test coverage detected