Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Quit from the lending tray icon on Windows
Ryan Wake5f11e25ae596
diff --git a/electron/lend-automatically.node-test.mjs b/electron/lend-automatically.node-test.mjsindex c2c16788e8..33c706e516 100644--- a/electron/lend-automatically.node-test.mjs+++ b/electron/lend-automatically.node-test.mjs@@ -553,6 +553,24 @@ test("the menu-bar item: which Clouds are using this Mac, Pause or Resume, the t{ line: "A, B and C are using this PC", title: "3 Clouds are using this PC", screen: null });});+test("the PC's tray item ends with Quit, paused or not, when the app gives it one", () => {+ const trays = [];+ class Tray {+ constructor() { trays.push(this); }+ on() {} setToolTip() {} setContextMenu(menu) { this.menu = menu; } isDestroyed() { return false; } destroy() {}+ }+ let quits = 0;+ const indicator = createLendingIndicator({ Tray, Menu: { buildFromTemplate: items => items }, nativeImage: { createFromPath: () => ({ resize: () => ({}) }) }, iconPath: "icon.png",+ onPause() {}, onResume() {}, onActivity() {}, onTerminal() {}, onQuit: () => quits++, device: "PC" });+ const labels = () => trays[0].menu.map(item => item.type === "separator" ? "-" : item.label);+ indicator.update({ clouds: ["Rocky"], using: [], paused: true });+ assert.deepEqual(labels(), ["Paused: Rocky can't use this PC", "-", "Resume", "See activity", "-", "Quit OpenMaus Bot"]);+ indicator.update({ clouds: ["Rocky"], using: [], paused: false });+ assert.deepEqual(labels().slice(-2), ["-", "Quit OpenMaus Bot"]);+ trays[0].menu.at(-1).click();+ assert.equal(quits, 1);+});+test("See activity shows this computer's own record in the app's language: every value escaped, no script, nothing loaded", async () => {const entries = [{ at: Date.UTC(2026, 9, 28, 14, 2), server: "Client <A>", origin: OTHER, action: "read_file", detail: "Notes/<img src=x onerror=alert(1)>.md", ok: true },diff --git a/electron/lending-indicator.mjs b/electron/lending-indicator.mjsindex 6ce5a575f0..0b3cbda0fc 100644--- a/electron/lending-indicator.mjs+++ b/electron/lending-indicator.mjs@@ -33,7 +33,7 @@ export function indicatorText({ clouds, using, paused, pauseError, screen = null/** How long lending has to stay broken before a notification says so: a blip is no news. */const NOTICE_AFTER_MS = 10 * 60_000;-export function createLendingIndicator({ Tray, Menu, nativeImage, iconPath, onPause, onResume, onActivity, onTerminal, onStartScreen = () => {}, device = deviceWord(), t = nativeText.englishText.t, Notification = null, setTimer = setTimeout, clearTimer = clearTimeout }) {+export function createLendingIndicator({ Tray, Menu, nativeImage, iconPath, onPause, onResume, onActivity, onTerminal, onStartScreen = () => {}, onQuit = null, device = deviceWord(), t = nativeText.englishText.t, Notification = null, setTimer = setTimeout, clearTimer = clearTimeout }) {let tray = null;let shown = null;/** Each problem now, by what it says, until the notification for it goes out or it clears. */@@ -77,6 +77,7 @@ export function createLendingIndicator({ Tray, Menu, nativeImage, iconPath, onPa// Electron 43 ticks a checkbox on click by itself: the menu keeps the saved choice until the person confirms one.click: () => { draw(view); onTerminal(!view.terminal); } }],{ label: t("native.lendTray.activity"), click: () => onActivity() },+ ...onQuit ? [{ type: "separator" }, { label: t("native.tray.quit"), click: () => onQuit() }] : [],]));};return {diff --git a/electron/main.mjs b/electron/main.mjsindex 4e5d546f79..e5f5f980ad 100644--- a/electron/main.mjs+++ b/electron/main.mjs@@ -1490,6 +1490,7 @@ function lendingIndicator() {Tray, Menu, nativeImage, Notification, iconPath: APP_ICON, t: nativeT, onPause: () => sharingController().pause(), onActivity: () => lendingActivity.show(),onResume: () => void sharingController().resume()?.catch(error => slog(`lending resume: ${error?.message ?? error}`)), onStartScreen: () => void screenControl.start(),onTerminal: on => void lendingDialogs.lendTerminal(on, () => sharingController().lendTerminal(on)).catch(error => slog(`lending terminal: ${error?.message ?? error}`)),+ onQuit: process.platform === "win32" ? () => app.quit() : null,});return lendingTray;}