Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Extract VPS idle host and loopback helpers to satisfy file-size ratchet

Adacb1d803f30ce
diff --git a/server/config.ts b/server/config.ts
index b718ba2667..3dad1bfc12 100644
--- a/server/config.ts
+++ b/server/config.ts
@@ -390,8 +390,7 @@ const appConfigSchema = z.object({
decisions: z.object({ retentionDays: z.number().int().min(1).max(3650).optional() }).strict().optional(),
loopGuard: loopGuardConfigSchema.optional(),
safetyFloor: z.object({ enabled: z.boolean().optional() }).strict().optional(), // off by default: safetyFloorEnabled in server/safety-floor-gate.ts
- vpsIdle: vpsIdleConfigSchema.optional(),
- localVm: localVmConfigSchema.optional(),
+ vpsIdle: vpsIdleConfigSchema.optional(), localVm: localVmConfigSchema.optional(),
features: featureConfigSchema.optional(),
onboarding: onboardingConfigSchema.optional(),
browserEngine: browserEngineConfigSchema.optional(),
@@ -467,8 +466,7 @@ export interface AppConfig extends HelperConfig {
threads?: { maxConcurrentPerBot: number; eventLogMaxBytes?: number; eventLogRetentionDays?: number }; burst?: { maxParallel?: number };
context?: { rebuildBytes?: number; compactAt?: number; autoCompact?: boolean; roomCompactAt?: number; roomSessions?: boolean; replayToolHistory?: boolean };
memory?: { captureQuietMs?: number; tidyHour?: number };
- vpsIdle?: z.infer<typeof vpsIdleConfigSchema>;
- localVm?: { mode?: "shared" | "per-bot" | "pool"; maxInstances?: number; idleTimeoutMinutes?: number; preserveInstalledApps?: boolean; memoryGb?: number; cpus?: number };
+ vpsIdle?: z.infer<typeof vpsIdleConfigSchema>; localVm?: { mode?: "shared" | "per-bot" | "pool"; maxInstances?: number; idleTimeoutMinutes?: number; preserveInstalledApps?: boolean; memoryGb?: number; cpus?: number };
features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; llmThreadTitles?: boolean; smartSetupChoices?: boolean; autoRecall?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; parallelRoomJobs?: boolean; acpPlanLines?: boolean; agentsToolBridge?: boolean; savedSteps?: boolean; usbPhoneTakeover?: boolean; cloudComputerAutoReplace?: boolean; phonePush?: boolean; skillBurger?: boolean; threadTabs?: boolean; roomFeed?: boolean; teamBoard?: boolean };
onboarding?: { completedAt?: string; version?: number; reelSeen?: boolean; hintsSeen?: string[]; firstTurnAt?: string };
browserProfiles?: BrowserProfile[];
diff --git a/server/host/vps-idle.ts b/server/host/vps-idle.ts
new file mode 100644
index 0000000000..f5a27910a6
--- /dev/null
+++ b/server/host/vps-idle.ts
@@ -0,0 +1,104 @@
+import { ComputerIdleTimer } from "../computer-idle.ts";
+import { vpsIdleTimeoutMinutes, type AppConfig } from "../config.ts";
+import type { BotRecord } from "../store.ts";
+import * as vps from "../vps-computer.ts";
+import { vpsAliasesInPlay, vpsSshAliasForBot } from "../vps-hosts.ts";
+
+export interface VpsIdleHostDeps {
+ cfg: AppConfig;
+ store: { bots: BotRecord[]; bot: (id: string) => BotRecord | null | undefined };
+ botHasActiveTurn: (botId: string) => boolean;
+ hasActiveRoutine: (botId: string) => boolean;
+ isSharedVmHeld: (botId: string) => boolean;
+ hasComputerPreview: (botId: string) => boolean;
+ isVpsConfigTransitioning: () => boolean;
+ isLifecycleBusy: (botId: string) => boolean;
+ claimBotComputerLifecycle: (botId: string) => () => void;
+ isShuttingDown: () => boolean;
+}
+
+export function createVpsIdleHost(deps: VpsIdleHostDeps) {
+ const activeVpsThreads = new Map<string, Set<string>>();
+ const vpsIdles = new Map<string, ComputerIdleTimer>();
+ const vpsIdleGenerations = new Map<string, number>();
+ const vpsIdleMs = () => vpsIdleTimeoutMinutes(deps.cfg) * 60_000;
+
+ function vpsThreadStarted(botId: string, threadId: string): void {
+ const threads = activeVpsThreads.get(botId) ?? new Set<string>();
+ threads.add(threadId);
+ activeVpsThreads.set(botId, threads);
+ }
+
+ function vpsThreadEnded(botId: string, threadId: string): void {
+ const threads = activeVpsThreads.get(botId);
+ if (!threads) return;
+ if (threads.delete(threadId)) vpsIdles.get(botId)?.touch();
+ if (!threads.size) activeVpsThreads.delete(botId);
+ }
+
+ function cancelVpsIdle(botId: string): number {
+ const generation = (vpsIdleGenerations.get(botId) ?? 0) + 1;
+ vpsIdleGenerations.set(botId, generation);
+ vpsIdles.get(botId)?.cancel();
+ vpsIdles.delete(botId);
+ return generation;
+ }
+
+ function touchVpsIdle(bot: BotRecord): void {
+ const alias = vpsSshAliasForBot(deps.cfg, bot);
+ if (!alias) return;
+ const id = bot.id;
+ cancelVpsIdle(id);
+ const current = () => {
+ const owner = deps.store.bot(id);
+ return owner && vpsSshAliasForBot(deps.cfg, owner) === alias && vpsIdles.get(id) === timer;
+ };
+ const inUse = () => activeVpsThreads.has(id) || deps.botHasActiveTurn(id) || deps.hasActiveRoutine(id)
+ || deps.isSharedVmHeld(id) || Boolean(vps.vpsDesktopConnection(id)) || deps.hasComputerPreview(id)
+ || deps.isVpsConfigTransitioning();
+ const timer: ComputerIdleTimer = new ComputerIdleTimer(vpsIdleMs(), () => inUse() || deps.isLifecycleBusy(id), async () => {
+ if (!current()) return;
+ const release = deps.claimBotComputerLifecycle(id);
+ try {
+ const status = await vps.vpsComputerAction("stop", { vps: { sshAlias: alias } }, id, undefined, () => Boolean(current()) && !inUse());
+ if (status.container === "running") return "busy";
+ if (vpsIdles.get(id) === timer) vpsIdles.delete(id);
+ } finally {
+ release();
+ }
+ });
+ vpsIdles.set(id, timer);
+ timer.touch();
+ }
+
+ function vpsServerSwitched(bot: BotRecord): void {
+ const id = bot.id;
+ vps.stopVpsDesktopTunnel(id);
+ const generation = cancelVpsIdle(id);
+ if (bot.cloudBackend !== "vps") return;
+ const alias = vpsSshAliasForBot(deps.cfg, bot);
+ if (!alias) return;
+ void vps.vpsComputerRunning({ vps: { sshAlias: alias } }, id).then((running) => {
+ if (!running || deps.isShuttingDown() || vpsIdleGenerations.get(id) !== generation) return;
+ const current = deps.store.bot(id);
+ if (current && current.cloudBackend === "vps" && vpsSshAliasForBot(deps.cfg, current) === alias && !vpsIdles.has(id)) {
+ touchVpsIdle(current);
+ }
+ });
+ }
+
+ function recover(): void {
+ void vps.listManagedVpsComputers(deps.cfg, deps.store.bots.map(bot => ({ botId: bot.id, name: bot.name, inUse: false })), undefined, vpsAliasesInPlay(deps.cfg, deps.store.bots)).then(inventory => {
+ for (const instance of inventory.instances) {
+ const bot = instance.ownerBotId && deps.store.bot(instance.ownerBotId);
+ if (bot && instance.state === "running" && instance.vpsAlias === vpsSshAliasForBot(deps.cfg, bot) && !vpsIdles.has(bot.id)) touchVpsIdle(bot);
+ }
+ }).catch(error => console.warn("Could not recover VPS idle timers", error));
+ }
+
+ function cancelAll(): void {
+ for (const botId of new Set([...vpsIdles.keys(), ...vpsIdleGenerations.keys()])) cancelVpsIdle(botId);
+ }
+
+ return { activeVpsThreads, vpsThreadStarted, vpsThreadEnded, vpsIdles, vpsIdleMs, cancelVpsIdle, touchVpsIdle, vpsServerSwitched, recover, cancelAll };
+}
diff --git a/server/index.ts b/server/index.ts
index 3e60d34e62..f4b30c7f6e 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -435,7 +435,7 @@ import { loopGuardSettings } from "./host/loop-guard.ts"; import { createUnatten
import { claudeUserSkillsEnabled } from "./turn-settings.ts";
import { addHeldSecretScrubber, redactSecretsInText, scrubHeldSecrets } from "./redact.ts";
import * as vps from "./vps-computer.ts";
-import { vpsAliasesInPlay, vpsConfigForBot, vpsSshAliasForBot } from "./vps-hosts.ts"; import { vpsContainerExec } from "./vps-exec.ts";
+import { vpsConfigForBot, vpsSshAliasForBot } from "./vps-hosts.ts"; import { vpsContainerExec } from "./vps-exec.ts"; import { createVpsIdleHost } from "./host/vps-idle.ts";
import { ROUTINE_RESTARTED, RoutineManager, type Routine, type RoutineRun, type RoutineRunOn, type RoutineRunTrigger } from "./routines.ts"; import { routineModelRefusal, routineThreadModel, type RoutineModelChecks } from "./routine-input.ts"; import { routineHistoryFor, routineRunsFor } from "./routine-run-window.ts"; import { routineRunLimits } from "./routine-run-limits.ts"; import { runTurnLive } from "./routine-turn-live.ts"; import { batchSaves, flushLaterSaves } from "./save-batch.ts"; import { restartCutStop } from "./memory-freeze-restart.ts";
import { CalendarCallManager, type CalendarCall } from "./calendar-calls.ts";
import { BROWSER_UPLOAD_TOOL, browserRuntimeEnv } from "./browser-runtime.ts";
@@ -5583,18 +5583,6 @@ function waitForLocalVmUpdate(target: LocalVmTarget, threadId: string, isCurrent
return localVmUpdates.waitFor(target, { isCurrent, cancelled: () => new DirectTurnSetupCancelled("turn stopped while its desktop was being updated"),
announce: (text) => { store.appendMessage(threadId, { role: "bot", kind: "activity", ...(from ? { from } : {}), tool: { name: text } }); } });
}
-const activeVpsThreads = new Map<string, Set<string>>();
-function vpsThreadStarted(botId: string, threadId: string): void {
- const threads = activeVpsThreads.get(botId) ?? new Set<string>();
- threads.add(threadId);
- activeVpsThreads.set(botId, threads);
-}
-function vpsThreadEnded(botId: string, threadId: string): void {
- const threads = activeVpsThreads.get(botId);
- if (!threads) return;
- if (threads.delete(threadId)) vpsIdles.get(botId)?.touch();
- if (!threads.size) activeVpsThreads.delete(botId);
-}
const boatLifecycleBusyBots = new Set<string>();
const computerPreviews = createComputerPreviews();
const vpsJoinRequests = new Map<string, Promise<void>>();
@@ -5602,63 +5590,10 @@ const orphanBoatLifecycleBusyIds = new Set<string>();
const boatInventoryRequestsBusyIds = new Set<string>();
type RemoteComputerProvider = "box" | "vps";
const computerProviderConfigTransitions = new Set<RemoteComputerProvider>();
-const vpsIdleMs = () => vpsIdleTimeoutMinutes(cfg) * 60_000;
const localVmIdleMs = () => localVmIdleTimeoutMinutes(cfg) * 60_000;
const LOCAL_VM_DESKTOP_WAIT_MS = 90_000;
const localVmIdles = new Map<string, ComputerIdleTimer>();
-const vpsIdles = new Map<string, ComputerIdleTimer>();
-const vpsIdleGenerations = new Map<string, number>();
-
-function cancelVpsIdle(botId: string): number {
- const generation = (vpsIdleGenerations.get(botId) ?? 0) + 1;
- vpsIdleGenerations.set(botId, generation);
- vpsIdles.get(botId)?.cancel();
- vpsIdles.delete(botId);
- return generation;
-}
-
-function touchVpsIdle(bot: BotRecord): void {
- const alias = vpsSshAliasForBot(cfg, bot);
- if (!alias) return;
- const id = bot.id;
- cancelVpsIdle(id);
- const current = () => {
- const owner = store.bot(id);
- return owner && vpsSshAliasForBot(cfg, owner) === alias && vpsIdles.get(id) === timer;
- };
- const inUse = () => activeVpsThreads.has(id) || botHasActiveTurn(id) || Boolean(routines?.activeRunForBot(id))
- || sharedVm.snapshot(id).held || Boolean(vps.vpsDesktopConnection(id)) || computerPreviews.has(id)
- || computerProviderConfigTransitions.has("vps");
- const timer: ComputerIdleTimer = new ComputerIdleTimer(vpsIdleMs(), () => inUse() || boatLifecycleBusyBots.has(id), async () => {
- if (!current()) return;
- const release = claimBotComputerLifecycle(id);
- try {
- const status = await vps.vpsComputerAction("stop", { vps: { sshAlias: alias } }, id, undefined, () => Boolean(current()) && !inUse());
- if (status.container === "running") return "busy";
- if (vpsIdles.get(id) === timer) vpsIdles.delete(id);
- } finally {
- release();
- }
- });
- vpsIdles.set(id, timer);
- timer.touch();
-}
-
-function vpsServerSwitched(bot: BotRecord): void {
- const id = bot.id;
- vps.stopVpsDesktopTunnel(id);
- const generation = cancelVpsIdle(id);
- if (bot.cloudBackend !== "vps") return;
- const alias = vpsSshAliasForBot(cfg, bot);
- if (!alias) return;
- void vps.vpsComputerRunning({ vps: { sshAlias: alias } }, id).then((running) => {
- if (!running || companyShutdown || vpsIdleGenerations.get(id) !== generation) return;
- const current = store.bot(id);
- if (current && current.cloudBackend === "vps" && vpsSshAliasForBot(cfg, current) === alias && !vpsIdles.has(id)) {
- touchVpsIdle(current);
- }
- });
-}
+const { activeVpsThreads, vpsThreadStarted, vpsThreadEnded, vpsIdles, vpsIdleMs, cancelVpsIdle, touchVpsIdle, vpsServerSwitched, recover: recoverVpsIdles, cancelAll: cancelAllVpsIdles } = createVpsIdleHost({ cfg, store, botHasActiveTurn, hasActiveRoutine: (id) => Boolean(routines?.activeRunForBot(id)), isSharedVmHeld: (id) => sharedVm.snapshot(id).held, hasComputerPreview: (id) => computerPreviews.has(id), isVpsConfigTransitioning: () => computerProviderConfigTransitions.has("vps"), isLifecycleBusy: (id) => boatLifecycleBusyBots.has(id), claimBotComputerLifecycle, isShuttingDown: () => companyShutdown });
const meetingsHost = createMeetingsHost({ cfg, dataDir: DATA_DIR, store, startTurn: (botId, text, opts) => startTurn(botId, text, opts), threadBusy, power: () => cloudComputerPower, computerOwner: (bot) => botComputerControlKey(bot), routines: () => routines, log: (line) => console.warn(line) }, () => ({ personName: personNameIn, sendsFreely: (botId, threadId) => roomTurnLevels.forRequest(threadId, botId, () => sourceApprovalMode(botId, threadId)) === "full", outbound: () => outboundHold, markOutside: (threadId) => outsideLineage.mark(threadId), folder: (botId, threadId) => messageFileRootsForThread(botId, threadId).filter((root) => root !== ATTACHMENTS_DIR)[0] ?? null })); const cloudComputerPower = createCloudComputerPower({
cfg, owners: managedBoatOwners, broadcast, log: line => console.warn(line), routines: () => routines?.listRoutines() ?? [], wakeTimedOut: (owner, boxId, ctx) => boatRecovery.wakeTimedOut(owner, boxId, ctx),
@@ -6268,13 +6203,7 @@ function releaseLocalVmThread(threadId: string): void {
localVmThreadTargets.delete(threadId);
}
-void vps.listManagedVpsComputers(cfg, store.bots.map(bot => ({ botId: bot.id, name: bot.name, inUse: false })), undefined, vpsAliasesInPlay(cfg, store.bots)).then(inventory => {
- for (const instance of inventory.instances) {
- const bot = instance.ownerBotId && store.bot(instance.ownerBotId);
- if (bot && instance.state === "running" && instance.vpsAlias === vpsSshAliasForBot(cfg, bot) && !vpsIdles.has(bot.id)) touchVpsIdle(bot);
- }
-}).catch(error => console.warn("Could not recover VPS idle timers", error));
-
+recoverVpsIdles();
void recoverLocalVms({ // at once: a queued or channel turn sent as the server listens finds a running VM
mode: localVmMode(cfg), seats: localVmMaxInstances(cfg), bots: store.bots, seen: localVmSeen,
status: (target) => containerComputerStatus(undefined, undefined, target).catch(() => null),
@@ -9081,8 +9010,7 @@ async function deleteBotWithLifecycle(botId: string, revalidate: () => void = ()
// Re-check the reviewed receipt at the final durable mutation, so a concurrent profile edit cannot be erased under a stale approval.
revalidate();
store.deleteBot(bot.id, setupRequest); sharedVm.botDeleted(bot.id); computerControlRevision.delete(bot.id);
- vps.stopVpsDesktopTunnel(bot.id);
- cancelVpsIdle(bot.id);
+ vps.stopVpsDesktopTunnel(bot.id); cancelVpsIdle(bot.id);
skillReview.dropBot(bot.id);
memoryUpkeep.forgetBot(bot.id);
calendarCalls!.removeBot(bot.id);
@@ -15048,8 +14976,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
}
const action = m[2] === "provision" ? "provision" : m[2] === "remove" ? "remove" : "stop";
const status = await vps.vpsComputerAction(action, vpsConfigForBot(cfg, bot), botId);
- if (status.container === "running") touchVpsIdle(bot);
- else cancelVpsIdle(botId);
+ if (status.container === "running") touchVpsIdle(bot); else cancelVpsIdle(botId);
return json(res, 200, status);
} finally {
releaseComputerLifecycle();
@@ -15269,7 +15196,7 @@ const gracefulShutdown = createGracefulShutdown({
desktopViewer.closeAll();
upgrades.close();
for (const idle of localVmIdles.values()) idle.cancel();
- for (const botId of new Set([...vpsIdles.keys(), ...vpsIdleGenerations.keys()])) cancelVpsIdle(botId);
+ cancelAllVpsIdles();
cloudComputerPower.close(); boatRecovery.close();
vps.closeAllVpsDesktopTunnels();
watchdog.stop();
diff --git a/server/vps-computer.ts b/server/vps-computer.ts
index 97be939d85..a4124f80ea 100644
--- a/server/vps-computer.ts
+++ b/server/vps-computer.ts
@@ -1,7 +1,7 @@
// BYO Linux VPS: Docker's SSH transport reaches the user's daemon; one Cua MCP container per bot.
import { createHash, randomBytes } from "node:crypto";
import { spawn } from "node:child_process";
-import { createConnection, createServer, type AddressInfo } from "node:net";
+import { loopbackAnswers, unusedLoopbackPort } from "./vps-loopback.ts";
import { OWN_GROUP, stopGroup } from "./group-exec.ts";
import {
BASE_IMAGE,
@@ -190,38 +190,6 @@ export function vpsSshTunnelArgs(alias: string, localPort: number, privateIp: st
];
}
-function unusedLoopbackPort(): Promise<number> {
- return new Promise((resolve, reject) => {
- const probe = createServer();
- probe.once("error", reject);
- probe.listen(0, "127.0.0.1", () => {
- // SAFETY: bound to an IPv4 TCP address above, so Node returns AddressInfo, not a socket path.
- const port = (probe.address() as AddressInfo).port;
- probe.close((error) => {
- if (error) reject(error);
- else if (port >= 1024) resolve(port);
- else reject(new Error("could not reserve a VPS viewer port"));
- });
- });
- });
-}
-
-function loopbackAnswers(port: number): Promise<boolean> {
- return new Promise((resolve) => {
- const socket = createConnection({ host: "127.0.0.1", port });
- let settled = false;
- const finish = (answer: boolean) => {
- if (settled) return;
- settled = true;
- socket.destroy();
- resolve(answer);
- };
- socket.once("connect", () => finish(true));
- socket.once("error", () => finish(false));
- socket.setTimeout(250, () => finish(false));
- });
-}
-
function stopDesktopTunnel(botId: string, expected?: DesktopTunnel): boolean {
if (!expected) {
const pending = pendingDesktopTunnels.get(botId);
@@ -552,31 +520,16 @@ async function computeVpsComputerStatus(
return status;
}
-export async function vpsComputerRunning(
- cfg: AppConfig,
- botId: string,
- runner: VpsCommandRunner = defaultRunner,
-): Promise<boolean> {
+export async function vpsComputerRunning(cfg: AppConfig, botId: string, runner: VpsCommandRunner = defaultRunner): Promise<boolean> {
const alias = vpsSshAlias(snapshotVpsConfig(cfg));
if (!alias) return false;
const name = vpsContainerName(botId);
try {
- const inspected = JSON.parse((await runner(vpsDockerArgs(alias, ["inspect", name]), { timeoutMs: 10_000 })).stdout) as Array<{
- Config?: { Labels?: Record<string, string> };
- State?: { Running?: boolean };
- }>;
- const detail = inspected[0];
+ const detail = (JSON.parse((await runner(vpsDockerArgs(alias, ["inspect", name]), { timeoutMs: 10_000 })).stdout) as Array<{ Config?: { Labels?: Record<string, string> }; State?: { Running?: boolean } }>)[0];
const labels = detail?.Config?.Labels;
const environmentLabel = labels?.[VPS_ENVIRONMENT_LABEL];
- return Boolean(
- detail?.State?.Running &&
- labels?.[VPS_MANAGED_LABEL] === "1" &&
- labels?.[VPS_CONTAINER_LABEL] === name &&
- (environmentLabel === undefined || environmentLabel === vpsEnvironmentId()),
- );
- } catch {
- return false;
- }
+ return Boolean(detail?.State?.Running && labels?.[VPS_MANAGED_LABEL] === "1" && labels?.[VPS_CONTAINER_LABEL] === name && (environmentLabel === undefined || environmentLabel === vpsEnvironmentId()));
+ } catch { return false; }
}
export async function vpsComputerStatus(
diff --git a/server/vps-loopback.ts b/server/vps-loopback.ts
new file mode 100644
index 0000000000..b5d3d232c7
--- /dev/null
+++ b/server/vps-loopback.ts
@@ -0,0 +1,33 @@
+import { createConnection, createServer, type AddressInfo } from "node:net";
+
+export function unusedLoopbackPort(): Promise<number> {
+ return new Promise((resolve, reject) => {
+ const probe = createServer();
+ probe.once("error", reject);
+ probe.listen(0, "127.0.0.1", () => {
+ // SAFETY: bound to an IPv4 TCP address above, so Node returns AddressInfo, not a socket path.
+ const port = (probe.address() as AddressInfo).port;
+ probe.close((error) => {
+ if (error) reject(error);
+ else if (port >= 1024) resolve(port);
+ else reject(new Error("could not reserve a VPS viewer port"));
+ });
+ });
+ });
+}
+
+export function loopbackAnswers(port: number): Promise<boolean> {
+ return new Promise((resolve) => {
+ const socket = createConnection({ host: "127.0.0.1", port });
+ let settled = false;
+ const finish = (answer: boolean) => {
+ if (settled) return;
+ settled = true;
+ socket.destroy();
+ resolve(answer);
+ };
+ socket.once("connect", () => finish(true));
+ socket.once("error", () => finish(false));
+ socket.setTimeout(250, () => finish(false));
+ });
+}
diff --git a/src/components/LocalComputerSection.tsx b/src/components/LocalComputerSection.tsx
index f9740d77a0..8a6fc4c689 100644
--- a/src/components/LocalComputerSection.tsx
+++ b/src/components/LocalComputerSection.tsx
@@ -666,15 +666,11 @@ export function parseLocalVmIdleTimeoutMinutes(value: string): number | null {
export function LocalVmIdleTimeoutSetting({
minutes,
disabled,
- onSave,
- id = "local-vm-idle-timeout",
- detail = t("vm.idle.detail"),
+ onSave, id = "local-vm-idle-timeout", detail = t("vm.idle.detail"),
}: {
minutes: number;
disabled: boolean;
- onSave: (minutes: number) => Promise<void>;
- id?: string;
- detail?: string;
+ onSave: (minutes: number) => Promise<void>; id?: string; detail?: string;
}) {
const [value, setValue] = useState(String(minutes));
const [dirty, setDirty] = useState(false);