INNER CODE UNIT · TypeScript
kindMatches
agentconnect-md/agentconnect · packages/activation-policy/src/index.ts:83
function kindMatches(r: ActivationRule, msg: ActivationMessageFacts): boolean {
switch (r.match.kind) {
case 'mention':
return r.botUserId !== '' && msg.mentionedBots.includes(r.botUserId)
case 'dm':
return msg.isDm
case 'keyword':
return msg.text.toLowerCase().includes(r.match.value.toLowerCase())
case 'auto':
return true
case 'decision':
return !msg.sender.isBot // human-only Any-message candidate, never a bot-to-bot rung
}
}
/** Which ladder rung matched. `mention` is the only *explicit address* — the daemon
* uses it to clear (and bypass) a `!stop` thread mute; everything else is implicit
* routing and is suppressed while the session is muted. */