MCPcopy Create free account
hub / github.com/Noumena-Network/code / findTeammateColor

Function findTeammateColor

src/tools/SendMessageTool/SendMessageTool.ts:179–193  ·  view source on GitHub ↗
(
  appState: {
    teamContext?: { teammates: { [id: string]: { color?: string } } }
  },
  name: string,
)

Source from the content-addressed store, hash-verified

177 | ResponseOutput
178
179function findTeammateColor(
180 appState: {
181 teamContext?: { teammates: { [id: string]: { color?: string } } }
182 },
183 name: string,
184): string | undefined {
185 const teammates = appState.teamContext?.teammates
186 if (!teammates) return undefined
187 for (const teammate of Object.values(teammates)) {
188 if ('name' in teammate && (teammate as { name: string }).name === name) {
189 return teammate.color
190 }
191 }
192 return undefined
193}
194
195async function handleMessage(
196 recipientName: string,

Callers 1

handleMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected