0% found this document useful (0 votes)
4 views1 page

Prompt

The document defines a function to generate introductory text for a companion character in a user interface, detailing its behavior and interaction with the user. It also includes a function to create an attachment for the companion's introduction, which checks if the feature is enabled and if the companion is muted. The attachment is only created if it hasn't been previously announced for the specific companion.

Uploaded by

sharansh110
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Prompt

The document defines a function to generate introductory text for a companion character in a user interface, detailing its behavior and interaction with the user. It also includes a function to create an attachment for the companion's introduction, which checks if the feature is enabled and if the companion is muted. The attachment is only created if it hasn't been previously announced for the specific companion.

Uploaded by

sharansh110
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import { feature } from 'bun:bundle'

import type { Message } from '../types/[Link]'


import type { Attachment } from '../utils/[Link]'
import { getGlobalConfig } from '../utils/[Link]'
import { getCompanion } from './[Link]'

export function companionIntroText(name: string, species: string): string {


return `# Companion

A small ${species} named ${name} sits beside the user's input box and occasionally
comments in a speech bubble. You're not ${name} — it's a separate watcher.

When the user addresses ${name} directly (by name), its bubble will answer. Your
job in that moment is to stay out of the way: respond in ONE line or less, or just
answer any part of the message meant for you. Don't explain that you're not ${name}
— they know. Don't narrate what ${name} might say — the bubble handles that.`
}

export function getCompanionIntroAttachment(


messages: Message[] | undefined,
): Attachment[] {
if (!feature('BUDDY')) return []
const companion = getCompanion()
if (!companion || getGlobalConfig().companionMuted) return []

// Skip if already announced for this companion.


for (const msg of messages ?? []) {
if ([Link] !== 'attachment') continue
if ([Link] !== 'companion_intro') continue
if ([Link] === [Link]) return []
}

return [
{
type: 'companion_intro',
name: [Link],
species: [Link],
},
]
}

You might also like