MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / processAgentMentions

Function processAgentMentions

source code/utils/attachments.ts:1968–1995  ·  view source on GitHub ↗
(
  input: string,
  agents: AgentDefinition[],
)

Source from the content-addressed store, hash-verified

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

Callers 1

getAttachmentsFunction · 0.85

Calls 2

extractAgentMentionsFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected