INNER CODE UNIT · TypeScript

automaticAgents

agentconnect-md/agentconnect · packages/activation-policy/src/index.ts:134

export function automaticAgents(msg: ActivationMessageFacts, rules: ActivationRule[], exclude?: string): string[] {
  return [
    ...new Set(
      rules
        .filter(
          (r) =>
            (r.match.kind === 'auto' || (r.match.kind === 'decision' && !msg.sender.isBot)) &&
            scopeMatches(r, msg) &&
            r.agentId !== exclude
        )
        .map((r) => r.agentId)
    )
  ]
}

/**
 * Arbitrate the merged (local ∪ CP) rule set for an inbound message (design §8.2/§8.3).
 * Ladder: explicit @bot mention → thread affinity → CP per-sessionKey override → kind

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…