import { platformRuntime } from "./runtime.js";

export function resolveRuntimeChannel({ isNative = false, explicit = "", dev = false } = {}) {
  if (isNative) return "native";
  if (explicit === "development") return "development";
  if (explicit === "windows") return "windows";
  return dev ? "development" : "windows";
}

export const runtimeChannel = resolveRuntimeChannel({
  isNative: platformRuntime.isNative,
  explicit: import.meta.env?.VITE_CODE_REMOTE_MANAGER_RUNTIME,
  dev: Boolean(import.meta.env?.DEV)
});
