INNER CODE UNIT · TypeScript
hopTransition
agentconnect-md/agentconnect · packages/activation-policy/src/index.ts:265
export function hopTransition(sourceHopCount: number): {
deliveryHopCount: number
refusal?: { reason: 'hop_limit'; cap: number }
} {
const deliveryHopCount = sourceHopCount + 1
if (hasReachedAgentCallHopLimit(deliveryHopCount)) {
return { deliveryHopCount, refusal: { reason: 'hop_limit', cap: MAX_AGENT_CALL_HOPS } }
}
return { deliveryHopCount }
}
/**
* Everyone a conversation event is DELIVERED to beyond the arbitration
* primary (send-message-routing-rework.md §2.3/§6): agents already in the
* thread, every agent the body explicitly names, the verified final's exact
* recipient joins, and channel-`auto` agents — author and primary excluded.
*
* Pure selection only: each returned peer is still an INDEPENDENT delivery