MCPcopy Index your code
hub / github.com/CopilotKit/OpenTag / senderContext

Function senderContext

app/sender-context.ts:12–22  ·  view source on GitHub ↗
(
  user: PlatformUser | undefined,
  platform: string,
)

Source from the content-addressed store, hash-verified

10 * Telegram, and WhatsApp alike.
11 */
12export function senderContext(
13 user: PlatformUser | undefined,
14 platform: string,
15): ContextEntry[] {
16 // `createBot` substitutes `{ id: "" }` for an unresolved sender (a truthy
17 // object), so guard on a usable id — not mere object presence — otherwise we
18 // emit a "Requesting <platform> user (... id )" entry with nothing to attribute.
19 if (!user?.id) return [];
20 const label = `${user.name ?? user.id}${user.email ? ` <${user.email}>` : ""} (${platform} id ${user.id})`;
21 return [{ description: `Requesting ${platform} user`, value: label }];
22}

Callers 4

mainFunction · 0.85
fileIssueSubmitFunction · 0.85
handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected