MCPcopy Create free account
hub / github.com/codeaashu/claude-code / parseDirectMemberMessage

Function parseDirectMemberMessage

src/utils/directMemberMessage.ts:6–20  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

4 * Parse `@agent-name message` syntax for direct team member messaging.
5 */
6export function parseDirectMemberMessage(input: string): {
7 recipientName: string
8 message: string
9} | null {
10 const match = input.match(/^@([\w-]+)\s+(.+)$/s)
11 if (!match) return null
12
13 const [, recipientName, message] = match
14 if (!recipientName || !message) return null
15
16 const trimmedMessage = message.trim()
17 if (!trimmedMessage) return null
18
19 return { recipientName, message: trimmedMessage }
20}
21
22export type DirectMessageResult =
23 | { success: true; recipientName: string }

Callers 1

PromptInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected