The full 8-step canonicalization (Punycode, percent-encoding decode,
remove_dot_segments, etc.) is delegated to Node's WHATWG URL parser
for most rules; this helper layers on the SDK-specific bits the parser
doesn't do automatically: default-port stripping (already done by
URL.host), unreserved-char percent-decoding, and fragment strip.
Exported for callers building their own per-agent matching outside the
resolver — e.g., TMP seller_agent_url validation.
Canonicalize an agent URL for
authorized_agents[].urlcomparison per the AdCP URL canonicalization rules (https://adcontextprotocol.org/docs/reference/url-canonicalization). Returns the canonical string ornullif the input is unparseable.The full 8-step canonicalization (Punycode, percent-encoding decode,
remove_dot_segments, etc.) is delegated to Node's WHATWG URL parser for most rules; this helper layers on the SDK-specific bits the parser doesn't do automatically: default-port stripping (already done byURL.host), unreserved-char percent-decoding, and fragment strip.Exported for callers building their own per-agent matching outside the resolver — e.g., TMP
seller_agent_urlvalidation.