INNER CODE UNIT · TypeScript

conversationPeers

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

export function conversationPeers(
  msg: ActivationMessageFacts,
  rules: ActivationRule[],
  /** Agents with an open session in this thread (the caller's session state). */
  participants: readonly string[],
  options: {
    /** The arbitration primary, excluded from the peer set. */
    primaryAgentId?: string | undefined
    /** Verified agent authorship: the author is excluded absolutely, and the
     *  final's exact resolved recipients JOIN even where provider bot-user
     *  metadata alone cannot map the mention back to an agent. */
    verified?: { authorAgentId: string; recipients: readonly string[] } | undefined
  } = {}
): { peers: string[]; explicitlyMentioned: ReadonlySet<string> } {
  const explicitlyMentioned = new Set(mentionedAgents(msg, rules, options.primaryAgentId))
  // A verified final carries the exact agent ids resolved before provider
  // splitting/echo. They are joins, not the complete delivery set: include them
  // so a shared-bot peer with an unscoped slug route can enter the room even when

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…