INNER CODE UNIT · TypeScript
participantAgents
agentconnect-md/agentconnect · packages/activation-policy/src/index.ts:122
export function participantAgents(
msg: ActivationMessageFacts,
rules: ActivationRule[],
participants: readonly string[],
exclude?: string
): string[] {
if (participants.length === 0) return []
const servable = new Set(rules.filter((r) => scopeMatches(r, msg)).map((r) => r.agentId))
return participants.filter((id) => id !== exclude && servable.has(id))
}
/** Every agent whose `auto` rule (or, for a human, `decision` rule) covers the conversation — a set, not an arbitration. */
export function automaticAgents(msg: ActivationMessageFacts, rules: ActivationRule[], exclude?: string): string[] {
return [
...new Set(
rules
.filter(
(r) =>