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

Function processAgentMentions

src/utils/attachments.ts:1966–1993  ·  view source on GitHub ↗
(
  input: string,
  agents: AgentDefinition[],
)

Source from the content-addressed store, hash-verified

1964}
1965
1966function processAgentMentions(
1967 input: string,
1968 agents: AgentDefinition[],
1969): Attachment[] {
1970 const agentMentions = extractAgentMentions(input)
1971 if (agentMentions.length === 0) return []
1972
1973 const results = agentMentions.map(mention => {
1974 const agentType = mention.replace('agent-', '')
1975 const agentDef = agents.find(def => def.agentType === agentType)
1976
1977 if (!agentDef) {
1978 logEvent('tengu_at_mention_agent_not_found', {})
1979 return null
1980 }
1981
1982 logEvent('tengu_at_mention_agent_success', {})
1983
1984 return {
1985 type: 'agent_mention' as const,
1986 agentType: agentDef.agentType,
1987 }
1988 })
1989
1990 return results.filter(
1991 (result): result is NonNullable<typeof result> => result !== null,
1992 )
1993}
1994
1995async function processMcpResourceAttachments(
1996 input: string,

Callers 1

getAttachmentsFunction · 0.85

Calls 2

extractAgentMentionsFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected