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

Function getRelevantTips

src/services/tips/tipRegistry.ts:670–688  ·  view source on GitHub ↗
(context?: TipContext)

Source from the content-addressed store, hash-verified

668}
669
670export async function getRelevantTips(context?: TipContext): Promise<Tip[]> {
671 const settings = getInitialSettings()
672 const override = settings.spinnerTipsOverride
673 const customTips = getCustomTips()
674
675 // If excludeDefault is true and there are custom tips, skip built-in tips entirely
676 if (override?.excludeDefault && customTips.length > 0) {
677 return customTips
678 }
679
680 // Otherwise, filter built-in tips as before and combine with custom
681 const tips = [...externalTips, ...internalOnlyTips]
682 const isRelevant = await Promise.all(tips.map(_ => _.isRelevant(context)))
683 const filtered = tips
684 .filter((_, index) => isRelevant[index])
685 .filter(_ => getSessionsSinceLastShown(_.id) >= _.cooldownSessions)
686
687 return [...filtered, ...customTips]
688}

Callers 2

startDeferredPrefetchesFunction · 0.85
getTipToShowOnSpinnerFunction · 0.85

Calls 3

getCustomTipsFunction · 0.85
getInitialSettingsFunction · 0.50

Tested by

no test coverage detected