Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
import { t } from "@/lib/i18n";
import { useAdvancedMode } from "@/lib/interface-mode";
import type { Bot } from "@/state/store";
import { useStoreSelector } from "@/state/store-select";
import { Switch } from "../SettingsPrimitives";
import { useBotEditor } from "./BotEditorContext";
import type { useBotSettingsDerived } from "./useBotSettingsDerived";
/** Advanced, for a saved bot on its own Local VM: keep that desktop running through the idle timer. Off unless chosen,
* since a running desktop keeps using this computer's memory. */
export function KeepDesktopRunning({ bot, patch }: { bot: Bot; patch: ReturnType<typeof useBotSettingsDerived>["patch"] }) {
const advanced = useAdvancedMode();
const { draft } = useBotEditor();
const perBot = useStoreSelector((state) => state.config?.localVm?.mode === "per-bot");
if (!advanced || draft || !perBot || bot.computer !== "vm") return null;
const on = bot.localVm?.keepDesktopRunning === true;
return (
<div className="mt-3 flex items-center justify-between gap-4 rounded-lg bg-inset px-3 py-2.5" data-testid="keep-desktop-running">
<div className="min-w-0">
<div className="text-[13px] text-ink">{t("botAccess.keepDesktop.title")}</div>
<div className="mt-0.5 text-[12px] text-ink-secondary">{t("botAccess.keepDesktop.description")}</div>
</div>
<Switch checked={on} aria-label={t("botAccess.keepDesktop.title")} onClick={() => patch({ localVm: { keepDesktopRunning: !on } })} />
</div>
);
}