INNER CODE UNIT · TypeScript

covers

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

  const covers = (scopeChannel: string | undefined): boolean => scopeChannel === undefined || scopeChannel === channel
  if (agentRules.some((rule) => rule.mutedChannels?.some((muted) => covers(muted)))) return false
  return agentRules.some((rule) => covers(rule.scope.channel))
}

/** Is a stamped source depth usable at all? §4.1 rule 1 / §5.2a fail-closed: a
 *  missing, non-integer, or negative depth must never coerce to zero — the
 *  message stays transcript-only instead. */
export function isUsableSourceDepth(value: number | undefined): value is number {
  return value !== undefined && Number.isInteger(value) && value >= 0
}

/**
 * The §4.1 trusted hop transition: ONE +1 per agent-to-agent delivery, against
 * the SAME `MAX_AGENT_CALL_HOPS` cap an internal call spends — so a mention
 * chain, a `messageAgent` chain, and a webchat continuation all consume the
 * one budget at the same rate. `refusal` is set when the edge must not run;
 * the caller records the message transcript-only and logs the refusal.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…