openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
16 lines (15 loc) • 680 B
JavaScript
import { o as normalizeLowercaseStringOrEmpty } from "./string-coerce-CCIiB4H7.mjs";
import { f as isLoopbackIpAddress, h as isRfc1918Ipv4Address } from "./ip-BUyyYvdK.mjs";
//#region src/agents/model-provider-local.ts
/** Shared local model-provider URL classification. */
function isLocalProviderBaseUrl(e, t) {
try {
let n = normalizeLowercaseStringOrEmpty(new URL(e).hostname);
if (n.startsWith("[") && n.endsWith("]")) n = n.slice(1, -1);
return n === "localhost" || n === "0.0.0.0" || n.endsWith(".local") || t?.has(n) === true || isLoopbackIpAddress(n) || isRfc1918Ipv4Address(n);
} catch {
return false;
}
}
//#endregion
export { isLocalProviderBaseUrl as t };