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

Function getCompanionIntroAttachment

src/buddy/prompt.ts:15–36  ·  view source on GitHub ↗
(
  messages: Message[] | undefined,
)

Source from the content-addressed store, hash-verified

13}
14
15export function getCompanionIntroAttachment(
16 messages: Message[] | undefined,
17): Attachment[] {
18 if (!feature('BUDDY')) return []
19 const companion = getCompanion()
20 if (!companion || getGlobalConfig().companionMuted) return []
21
22 // Skip if already announced for this companion.
23 for (const msg of messages ?? []) {
24 if (msg.type !== 'attachment') continue
25 if (msg.attachment.type !== 'companion_intro') continue
26 if (msg.attachment.name === companion.name) return []
27 }
28
29 return [
30 {
31 type: 'companion_intro',
32 name: companion.name,
33 species: companion.species,
34 },
35 ]
36}
37
38

Callers 1

getAttachmentsFunction · 0.85

Calls 3

featureFunction · 0.85
getCompanionFunction · 0.85
getGlobalConfigFunction · 0.85

Tested by

no test coverage detected