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

Function fireHatchReaction

src/buddy/observer.ts:484–508  ·  view source on GitHub ↗
(
  companion: Companion,
  onReaction: (reaction: string) => void,
)

Source from the content-addressed store, hash-verified

482}
483
484export async function fireHatchReaction(
485 companion: Companion,
486 onReaction: (reaction: string) => void,
487): Promise<void> {
488 if (getGlobalConfig().companionMuted) {
489 return
490 }
491
492 lastReactionAt = Date.now()
493 try {
494 const reaction = await postBuddyReaction(
495 companion,
496 (await buildHatchContext()) || '(fresh project, nothing to see yet)',
497 'hatch',
498 [],
499 false,
500 AbortSignal.timeout(BUDDY_REQUEST_TIMEOUT_MS),
501 )
502 if (!reaction) {
503 return
504 }
505 pushRecentReaction(reaction)
506 onReaction(reaction)
507 } catch {}
508}
509
510export async function firePetReaction(
511 onReaction: (reaction: string) => void,

Callers 1

callFunction · 0.85

Calls 4

postBuddyReactionFunction · 0.85
buildHatchContextFunction · 0.85
pushRecentReactionFunction · 0.85
getGlobalConfigFunction · 0.50

Tested by

no test coverage detected