import { normalizeOllamaBaseUrl } from "./ollama.js";
const localHosts = new Set(["127.0.0.1", "localhost", "::1", "[::1]"]);
export function describeComputeTarget(value) {
    const url = normalizeOllamaBaseUrl(value);
    const parsedUrl = new URL(url);
    const host = parsedUrl.host;
    const kind = localHosts.has(parsedUrl.hostname.toLowerCase()) ? "local" : "remote";
    return {
        kind,
        url,
        host,
        label: kind === "local" ? "local Ollama" : `remote Ollama at ${host}`
    };
}
export function isLocalComputeTarget(value) {
    return describeComputeTarget(value).kind === "local";
}
//# sourceMappingURL=compute.js.map