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

Function formatTeammateMessages

src/utils/teammateMailbox.ts:373–389  ·  view source on GitHub ↗
(
  messages: Array<{
    from: string
    text: string
    timestamp: string
    color?: string
    summary?: string
  }>,
)

Source from the content-addressed store, hash-verified

371 * Format teammate messages as XML for attachment display
372 */
373export function formatTeammateMessages(
374 messages: Array<{
375 from: string
376 text: string
377 timestamp: string
378 color?: string
379 summary?: string
380 }>,
381): string {
382 return messages
383 .map(m => {
384 const colorAttr = m.color ? ` color="${m.color}"` : ''
385 const summaryAttr = m.summary ? ` summary="${m.summary}"` : ''
386 return `<${TEAMMATE_MESSAGE_TAG} teammate_id="${m.from}"${colorAttr}${summaryAttr}>\n${m.text}\n</${TEAMMATE_MESSAGE_TAG}>`
387 })
388 .join('\n\n')
389}
390
391/**
392 * Structured message sent when a teammate becomes idle (via Stop hook)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected