| 595 | /** Match `token` as a separator-bounded run inside a URL hostname or path, |
| 596 | * used as a low-confidence detection hint when wire-shape detection fails. */ |
| 597 | const urlMatchesToken = (url: URL, token: string): boolean => { |
| 598 | const re = new RegExp(`(?:^|[^a-z0-9])${token}(?:$|[^a-z0-9])`, "i"); |
| 599 | return re.test(url.hostname) || re.test(url.pathname); |
| 600 | }; |
| 601 | |
| 602 | /** Translate a hard-stop probe outcome into a message a user can act on. |
| 603 | * Auth-required shapes are routed to the auth editor upstream, so they never |