Skip to content

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

Always-on home: keep trying after a stuck child or a first start, offers-only Make home, plainer copy

milind-soni59c768893ae7
diff --git a/electron/bridge-contract.json b/electron/bridge-contract.json
index e2f4db5fd7..a011af7861 100644
--- a/electron/bridge-contract.json
+++ b/electron/bridge-contract.json
@@ -249,6 +249,7 @@
"workspaces",
"workspaces.add",
"workspaces.color",
+ "workspaces.homeOffers",
"workspaces.line",
"workspaces.look",
"workspaces.makeHome",
diff --git a/electron/cloud-rail.mjs b/electron/cloud-rail.mjs
index 2f9bd7bd3a..999e1e8220 100644
--- a/electron/cloud-rail.mjs
+++ b/electron/cloud-rail.mjs
@@ -213,6 +213,8 @@ export function installCloudRail({ ipcMain, guard, trusted, lists = trusted, bes
if (!place || !makeHome) throw new Error(t("native.home.notAvailable"));
return makeHome(place.id);
});
+ // The servers main offers Make … my home for now, by id: Settings → Phone & devices shows the button only for those.
+ handle("workspaces:home-offers", () => (makeHome ? places().filter(entry => entry.makeHome).map(entry => entry.id) : []));
// A workspace of this computer's own: a new one from + (on the rail's page, or this computer's own from the Server menu),
// and a name, a colour or its removal from its circle's menu, only for one main listed.
handle("workspaces:local-new", (_event, name, color) => {
diff --git a/electron/cloud-rail.node-test.mjs b/electron/cloud-rail.node-test.mjs
index a53127bc72..7b484b4ddb 100644
--- a/electron/cloud-rail.node-test.mjs
+++ b/electron/cloud-rail.node-test.mjs
@@ -339,12 +339,16 @@ test("Make … my home: only on a server connected by hand that main offers it f
assert.deepEqual(made, ["vps"]);
offered.clear();
assert.throws(() => r.call("workspaces:make-home", "vps"), /can't be your bots' home/, "no longer offered: refused");
+ assert.deepEqual(await r.call("workspaces:home-offers"), [], "Settings shows the button for nothing main no longer offers");
offered.add("vps");
r.w.lists = false;
+ assert.deepEqual(await r.call("workspaces:home-offers"), ["vps"], "this computer's own page reads the rail's offers");
assert.deepEqual(await r.call("workspaces:make-home", "vps"), { started: true }, "this computer's own page (Settings → Phone & devices)");
r.w.trusted = false;
assert.throws(() => r.call("workspaces:make-home", "vps"), /only available/, "any other page: refused");
+ assert.throws(() => r.call("workspaces:home-offers"), /only available/, "nor are the offers listed there");
assert.throws(() => rail().call("workspaces:make-home", "vps"), /can't be your bots' home/, "a main that offers it nowhere");
+ assert.deepEqual(await rail().call("workspaces:home-offers"), []);
});
const PRELOAD = readFileSync(new URL("./preload.cjs", import.meta.url), "utf8");
@@ -361,7 +365,7 @@ function preload(origin, { activation = false } = {}) {
test("a Cloud's page gets the rail and the add sheet's narrow bridges; a circle, + and checkout open only from the person's click", async () => {
const page = preload(HOME);
- assert.deepEqual(Object.keys(page.bridge.workspaces), ["state", "menu", "line", "places", "open", "add", "probe", "look", "color", "recolor", "remove", "makeHome", "onChanged", "local", "onNewLocal"]);
+ assert.deepEqual(Object.keys(page.bridge.workspaces), ["state", "menu", "line", "places", "open", "add", "probe", "look", "color", "recolor", "remove", "makeHome", "homeOffers", "onChanged", "local", "onNewLocal"]);
assert.deepEqual(Object.keys(page.bridge.cloudAdd), ["state", "start", "reopen", "copyLink", "open", "interest", "sheet", "organization"]);
await page.bridge.workspaces.places();
await page.bridge.cloudAdd.state();
diff --git a/electron/computer-sharing.mjs b/electron/computer-sharing.mjs
index d88a093668..5d8a74d270 100644
--- a/electron/computer-sharing.mjs
+++ b/electron/computer-sharing.mjs
@@ -899,10 +899,8 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, lo
if (lent?.enabled !== true || !Array.isArray(lent.folders)) return { off: true };
return { lendingId: lent.id, folders: lent.folders.map(({ id, path: where, name, write }) => ({ id, path: where, name, write: write === true })), protectedPaths: protectedRoots, ...(paused ? { paused: true } : {}) };
},
- /** Lending to My Cloud is running, so it calls My Cloud whenever it is awake. */
- lendingToCloud: () => [...running.keys()].some(id => Boolean(records[id]?.cloud)),
- /** Anything is lent now (to a Cloud or a server of the person's own, running or not): what its login item follows. */
- lendingSomewhere: () => summary().lending.length > 0,
+ /** Lending to My Cloud is running, so it calls My Cloud whenever it is awake. `lendingSomewhere`: anything is lent now. */
+ lendingToCloud: () => [...running.keys()].some(id => Boolean(records[id]?.cloud)), lendingSomewhere: () => summary().lending.length > 0,
/** A server is using this computer now: a job running on it, or its browsing going through this computer. */
busy: () => summary().busy !== null,
saveCloud,
diff --git a/electron/error-pages.mjs b/electron/error-pages.mjs
index 3fdd7fb58f..5ca3e32ffa 100644
--- a/electron/error-pages.mjs
+++ b/electron/error-pages.mjs
@@ -19,7 +19,8 @@ function around(template, name) {
}
/** The page the main window shows when the background server never came up, in `text`'s language. */
-export function buildErrorPage({ allPortsOccupied, logDir }, text = nativeText.englishText) {
+/** `keepTrying`: this computer is an always-on home, so the app tries again by itself; the page says so in one line. */
+export function buildErrorPage({ allPortsOccupied, logDir, keepTrying = false }, text = nativeText.englishText) {
const serverLogPath = path.join(logDir, "server.log");
const serverLogHref = pathToFileURL(serverLogPath).href;
const reason = text.t(allPortsOccupied ? "native.dialog.serverFailed.portsTaken" : "native.dialog.serverFailed.slow");
@@ -27,7 +28,7 @@ export function buildErrorPage({ allPortsOccupied, logDir }, text = nativeText.e
return (
"data:text/html;charset=utf-8," +
encodeURIComponent(
- `<body style="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;background:#121212;color:#fcfcfc;font:15px -apple-system,system-ui"><div style="text-align:center;max-width:360px"><div style="font-size:40px">🐭</div><h2 style="font-weight:600;margin:12px 0 6px">${escapeText(text.t("native.dialog.serverFailed.title"))}</h2><p style="color:#fcfcfc99;line-height:1.5">${escapeHtml(reason)} ${escapeText(before)}<a target="_blank" rel="noopener" href="${serverLogHref}" style="color:#fcfcfc">${escapeHtml(serverLogPath)}</a>${escapeText(after)}</p></div></body>`,
+ `<body style="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;background:#121212;color:#fcfcfc;font:15px -apple-system,system-ui"><div style="text-align:center;max-width:360px"><div style="font-size:40px">🐭</div><h2 style="font-weight:600;margin:12px 0 6px">${escapeText(text.t("native.dialog.serverFailed.title"))}</h2><p style="color:#fcfcfc99;line-height:1.5">${escapeHtml(reason)} ${escapeText(before)}<a target="_blank" rel="noopener" href="${serverLogHref}" style="color:#fcfcfc">${escapeHtml(serverLogPath)}</a>${escapeText(after)}</p>${keepTrying ? `<p style="color:#fcfcfc99;line-height:1.5">${escapeText(text.t("native.dialog.serverFailed.keepTrying"))}</p>` : ""}</div></body>`,
)
);
}
diff --git a/electron/error-pages.node-test.mjs b/electron/error-pages.node-test.mjs
index 564c9d5117..c5f3cda63b 100644
--- a/electron/error-pages.node-test.mjs
+++ b/electron/error-pages.node-test.mjs
@@ -27,3 +27,12 @@ test("the page speaks the app's language, with the log's link where the sentence
'<p style="color:#fcfcfc99;line-height:1.5">Outro processo respondeu às verificações de integridade em todas as portas do OpenMausBot — provavelmente uma segunda cópia do app ou outro programa nas portas 8799–28799. Feche esse programa. Depois, saia do OpenMausBot e abra novamente. '
+ `Se isso continuar acontecendo, confira ${logLink}.</p>`);
});
+
+test("on an always-on home the page says, in one more line, that it keeps trying; without it the page is as before", () => {
+ const plainPage = page(buildErrorPage({ allPortsOccupied: true, logDir }));
+ const home = page(buildErrorPage({ allPortsOccupied: true, logDir, keepTrying: true }));
+ assert.equal(page(buildErrorPage({ allPortsOccupied: true, logDir, keepTrying: false })), plainPage);
+ assert.equal(home, plainPage.replace("</p></div>", "</p><p style=\"color:#fcfcfc99;line-height:1.5\">This computer is an always-on home, so it keeps trying to start the server every 5 minutes.</p></div>"));
+ const text = nativeText.createNativeText({ saved: "pt-br" });
+ assert.ok(page(buildErrorPage({ allPortsOccupied: false, logDir, keepTrying: true }, text)).includes("continua tentando iniciar o servidor a cada 5 minutos"));
+});
diff --git a/electron/main.mjs b/electron/main.mjs
index 603fa3c0b1..4f2470f572 100644
--- a/electron/main.mjs
+++ b/electron/main.mjs
@@ -325,7 +325,7 @@ const serverSupervisor = createServerSupervisor({
routineWake.stop();
},
onExhausted() {
- slog("server recovery paused after repeated failures; quit and reopen to retry"); if (alwaysOnHome.on()) return;
+ slog("server recovery paused after repeated failures; quit and reopen to retry");
dialog.showErrorBox(
nativeT("native.dialog.serverStopped.title"),
nativeT("native.dialog.serverStopped.body", { log: path.join(LOG_DIR, "server.log") }),
@@ -2164,7 +2164,7 @@ function createWindow({ deferNavigation = false } = {}) {
} else if (remote) {
void win.loadURL(remote.origin).catch(() => {});
} else if (app.isPackaged) {
- win.loadURL(serverReady ? `http://127.0.0.1:${SERVER_PORT}` : buildErrorPage({ allPortsOccupied: serverStartConflictOnly, logDir: LOG_DIR }, nativeText));
+ win.loadURL(serverReady ? `http://127.0.0.1:${SERVER_PORT}` : buildErrorPage({ allPortsOccupied: serverStartConflictOnly, logDir: LOG_DIR, keepTrying: alwaysOnHome.on() }, nativeText));
} else {
win.loadURL(DEV_URL);
}
@@ -2996,6 +2996,7 @@ app.whenReady().then(async () => {
app.quit();
}
}
+ if (!serverReady && !desktopShutdownStarted) serverSupervisor.startLater(startServerPackaged); // an always-on home keeps trying
}
if (desktopShutdownStarted) return;
if (app.isPackaged && !desktopRemoteAccess) { void ensureManagedDesktop().start().then(() => companyBackupSchedule.start()).catch(() => {}); void managedDesktop.whenRestored().then(() => tailnetShare.recheck()); }
diff --git a/electron/preload.cjs b/electron/preload.cjs
index fac80adac3..d8c0301fd5 100644
--- a/electron/preload.cjs
+++ b/electron/preload.cjs
@@ -188,6 +188,8 @@ const bridge = {
// Make a server of the person's own their bots' home, from a click on the rail's own page (main refuses any other page).
makeHome: (id) => isLocalPage || navigator.userActivation?.isActive === true
? ipcRenderer.invoke("workspaces:make-home", String(id)) : Promise.reject(new Error("Choose Make my home.")),
+ // The ids of the servers main offers Make … my home for now (this computer's own page and the rail's only).
+ homeOffers: () => ipcRenderer.invoke("workspaces:home-offers"),
onChanged: (cb) => {
const handler = () => cb();
ipcRenderer.on("workspaces:changed", handler);
diff --git a/electron/server-supervisor.mjs b/electron/server-supervisor.mjs
index c0f2687440..0ce52ae6be 100644
--- a/electron/server-supervisor.mjs
+++ b/electron/server-supervisor.mjs
@@ -1,5 +1,6 @@
// Owns one child, including while its health probe is pending; recovery retries the established port. `keepTrying()`:
-// the computer is an always-on home, so a spent budget waits `longRetryMs` and starts over instead of giving up.
+// the computer is an always-on home, so a spent budget, or a start that had to stop (`abort`), waits `longRetryMs` and
+// starts over instead of giving up; a child that is still owned then is waited out, never given a sibling.
export function createServerSupervisor({
restart,
stop,
@@ -30,10 +31,10 @@ export function createServerSupervisor({
return true;
}
- function schedule() {
+ function schedule(long = false) {
if (stopped || paused) return;
let delay;
- if (attempts < retryDelaysMs.length) {
+ if (!long && attempts < retryDelaysMs.length) {
delay = retryDelaysMs[attempts++];
log(`server recovery attempt ${attempts}/${retryDelaysMs.length} in ${delay}ms`);
} else if (keepTrying()) {
@@ -47,6 +48,7 @@ export function createServerSupervisor({
timer = setTimeout(async () => {
timer = null;
if (paused) return;
+ if (long && current !== null) { schedule(true); return; }
let result;
try {
result = await restart();
@@ -57,8 +59,10 @@ export function createServerSupervisor({
}
if (stopped || paused) return;
if (result?.proc && ready(result.proc)) return;
- if (result?.abort) onExhausted();
- else schedule();
+ if (result?.abort) {
+ if (keepTrying()) schedule(true);
+ else onExhausted();
+ } else schedule();
}, delay);
timer.unref?.();
}
@@ -78,6 +82,25 @@ export function createServerSupervisor({
});
}
+ /** A first start that never got ready (every port taken after a power cut, say), on an always-on home: `start()`, true
+ * once it is ready, again after each long wait while `keepTrying()`; not while an earlier child is still owned. */
+ function startLater(start) {
+ if (stopped || paused || timer || !keepTrying()) return false;
+ log(`server start: always-on home, trying again in ${longRetryMs}ms`);
+ timer = setTimeout(async () => {
+ timer = null;
+ if (stopped || paused) return;
+ if (current === null) {
+ let started = false;
+ try { started = await start(); } catch (error) { log(`server start failed: ${error?.message ?? error}`); }
+ if (started || stopped || paused) return;
+ }
+ startLater(start);
+ }, longRetryMs);
+ timer.unref?.();
+ return true;
+ }
+
// Pause drops any queued retry and holds recovery until resume(); exits and onUnavailable still publish.
function pause() {
if (stopped) return;
@@ -103,5 +126,5 @@ export function createServerSupervisor({
return shutdownPromise;
}
- return { watch, ready, isCurrent, pause, resume, shutdown };
+ return { watch, ready, isCurrent, pause, resume, shutdown, startLater };
}
diff --git a/electron/server-supervisor.node-test.mjs b/electron/server-supervisor.node-test.mjs
index 6ee77a91b6..cb4c21c2a0 100644
--- a/electron/server-supervisor.node-test.mjs
+++ b/electron/server-supervisor.node-test.mjs
@@ -101,6 +101,59 @@ test("an always-on home never gives up: a spent budget waits the long delay and
assert.equal(f.children.length, 8);
});
+const settle = () => new Promise((resolve) => setImmediate(resolve));
+
+test("an always-on home waits out a child that would not stop, then tries again: no dialog, and never a sibling", async (t) => {
+ let stuck = true;
+ const f = fixture(t, { keepTrying: () => true, longRetryMs: 500, retryDelaysMs: [10],
+ restart: async () => {
+ const proc = f.spawn();
+ if (stuck) { stuck = false; return { proc: null, abort: true }; }
+ return { proc };
+ } });
+ const first = f.spawn();
+ f.supervisor.ready(first);
+ first.emit("exit", 1);
+ await f.tick(10);
+ await settle();
+ assert.equal(f.children.length, 2);
+ assert.equal(f.events.some(([kind]) => kind === "exhausted"), false, "no dialog");
+ await f.tick(500);
+ await settle();
+ assert.equal(f.children.length, 2, "still owned: it waits again");
+ f.children[1].emit("exit", 0);
+ await f.tick(500);
+ await settle();
+ assert.equal(f.children.length, 3);
+ assert.equal(f.events.filter(([kind]) => kind === "ready").length, 2);
+});
+
+test("an always-on home whose first start never got ready tries again after the long wait, never beside a child still owned", async (t) => {
+ let home = true, succeed = false, starts = 0;
+ const f = fixture(t, { keepTrying: () => home, longRetryMs: 500 });
+ const start = async () => { starts++; if (!succeed) return false; f.supervisor.ready(f.spawn()); return true; };
+ assert.equal(f.supervisor.startLater(start), true);
+ await f.tick(499);
+ assert.equal(starts, 0);
+ await f.tick(1);
+ await settle();
+ assert.equal(starts, 1);
+ const owned = f.spawn();
+ await f.tick(500);
+ await settle();
+ assert.equal(starts, 1, "waited, not started beside it");
+ owned.emit("exit", 1);
+ succeed = true;
+ await f.tick(500);
+ await settle();
+ assert.equal(starts, 2);
+ assert.equal(f.events.filter(([kind]) => kind === "ready").length, 1);
+ await f.tick(5000);
+ assert.equal(starts, 2, "started: no more tries");
+ home = false;
+ assert.equal(f.supervisor.startLater(start), false, "not an always-on home: nothing waits");
+});
+
test("only a stable ready uptime resets the recovery budget", async (t) => {
const f = fixture(t);
f.supervisor.ready(f.spawn());
diff --git a/src/components/AlwaysOnHomeSection.dom.test.ts b/src/components/AlwaysOnHomeSection.dom.test.ts
index 5dced9adae..e0eb66dc75 100644
--- a/src/components/AlwaysOnHomeSection.dom.test.ts
+++ b/src/components/AlwaysOnHomeSection.dom.test.ts
@@ -18,7 +18,7 @@ vi.mock("./PlaceAddSheet", async () => {
};
});
-const { AlwaysOnHomeSection, alwaysOnLines, homeStatusLine, systemSettingLines } = await import("./AlwaysOnHomeSection");
+const { AlwaysOnHomeSection, alwaysOnLines, homeStatusLine, recentSessions, RECENT_SESSION_MS, systemSettingLines } = await import("./AlwaysOnHomeSection");
const off = { on: false, since: null };
const companionState = (devices = 0, computers = false): CompanionState => ({
@@ -70,6 +70,17 @@ describe("what the switch says it did", () => {
expect(systemSettingLines("linux")).toEqual([]);
});
+ it("on Linux, the window line says how to get the window back and how to quit", () => {
+ expect(alwaysOnLines(home({ on: true, platform: "linux" })).map((line) => line.key)).toContain("alwaysOn.windowClosedLinux");
+ expect(alwaysOnLines(home({ on: true, platform: "win32" })).map((line) => line.key)).toContain("alwaysOn.windowClosed");
+ });
+
+ it("only sessions seen lately count as reaching it", () => {
+ const now = 100 * RECENT_SESSION_MS;
+ expect(recentSessions([{ lastSeenAt: now - 1000 }, { lastSeenAt: now - RECENT_SESSION_MS - 1 }, { id: "no time" }, null], now)).toBe(1);
+ expect(recentSessions(undefined, now)).toBe(0);
+ });
+
it("the status line counts what reaches it", () => {
expect(homeStatusLine(0)).toBe("Home is on · nothing paired yet");
expect(homeStatusLine(1)).toBe("Home is on · reachable from 1 device");
@@ -82,7 +93,7 @@ describe("on the spare computer", () => {
let saved = home();
const set = vi.fn(async (on: boolean) => (saved = home({ on, openAtLogin: on, awake: on ? "holding" : "off" })));
(globalThis as { ogb?: unknown }).ogb = { platform: "darwin", alwaysOnHome: { state: vi.fn(async () => saved), set } };
- sessions.list = [{ id: "laptop" }];
+ sessions.list = [{ id: "laptop", lastSeenAt: Date.now() }, { id: "old", lastSeenAt: Date.now() - 2 * RECENT_SESSION_MS }];
const { onAddPhone } = render(companionState(1));
await vi.waitFor(() => expect($("[data-always-on-switch] [role=switch]")).not.toBeNull());
expect(text()).toContain("Use this Mac as an always-on home");
@@ -92,13 +103,14 @@ describe("on the spare computer", () => {
expect(set).toHaveBeenCalledWith(true);
expect(text()).toContain("Opens at login");
expect(text()).toContain("Stays awake while plugged in");
- expect(text()).toContain("Installs updates by itself when nobody is using it");
+ expect(text()).toContain("Installs updates by itself at a quiet moment. While its bots are busy, an update waits.");
expect(text()).toContain("Starts its server again if it crashes");
expect(text()).toContain("Keeps running when its window is closed");
await vi.waitFor(() => expect($("[data-always-on-status]")?.textContent).toBe("Home is on · reachable from 2 devices"));
- expect($("[data-always-on-system]")?.textContent).toContain("System Settings → Energy");
+ expect($("[data-always-on-system]")?.textContent).toContain("System Settings → Energy → Start up automatically after a power failure");
+ expect($("[data-always-on-system]")?.textContent).not.toContain("power is connected");
expect($("[data-always-on-system]")?.textContent).toContain("Automatically log in as");
- expect($("[data-always-on-system]")?.textContent).toContain("Accessibility and Screen Recording");
+ expect($("[data-always-on-system]")?.textContent).toContain("Accessibility and Screen & System Audio Recording");
expect($("[data-always-on-steps]"), "a home doesn't offer adding another").toBeNull();
flushSync(() => $<HTMLButtonElement>("[data-always-on-add-phone]")!.click());
expect(onAddPhone).toHaveBeenCalledOnce();
@@ -140,6 +152,7 @@ describe("on the spare computer", () => {
await vi.waitFor(() => expect($("[data-always-on-details]")).not.toBeNull());
expect(text()).toContain("Use this computer as an always-on home");
expect(text()).toContain("Updates come through your package manager");
+ expect(text()).toMatch(/Keeps running when its window is closed\. Open \S+ again to bring the window back; to quit, press Alt and choose File → Quit\./);
expect($("[data-always-on-system]")).toBeNull();
});
});
@@ -151,6 +164,10 @@ describe("on the main computer", () => {
switch: vi.fn(async () => {}),
onStatus: () => () => {},
});
+ const unfold = async () => {
+ await vi.waitFor(() => expect($("[data-settings-disclosure=add-always-on] button")).not.toBeNull());
+ flushSync(() => $<HTMLButtonElement>("[data-settings-disclosure=add-always-on] button")!.click());
+ };
it("walks through adding one: the steps, Connect opens the existing pairing sheet", async () => {
const env = environments([{ id: "local", name: "This computer", kind: "local" }]);
@@ -165,16 +182,17 @@ describe("on the main computer", () => {
expect($("[data-rail-sheet] [data-own-server-link]")).not.toBeNull();
});
- it("once added: how it is doing, Open its bots, and Make … my home in one tap, as on the rail", async () => {
+ it("once added: how it is doing, Open its bots, and Make … my home in one tap while main offers it, as on the rail", async () => {
const env = environments([
{ id: "local", name: "This computer", kind: "local" },
{ id: "cloud", name: "My Cloud", kind: "remote", origin: "https://cloud.example.test", home: true },
{ id: "mini", name: "Mac mini", kind: "remote", origin: "http://mini.tail1234.ts.net:8799" },
], [{ id: "mini", state: "connected", since: 1, version: "0.1.166", behind: false, install: null }]);
const makeHome = vi.fn(async () => ({ started: true }));
- (globalThis as { ogb?: unknown }).ogb = { platform: "darwin", environments: env, workspaces: { probe: vi.fn(), makeHome, places: vi.fn(async () => ({ places: [], add: {} })) } };
+ (globalThis as { ogb?: unknown }).ogb = { platform: "darwin", environments: env, workspaces: { probe: vi.fn(), makeHome, places: vi.fn(async () => ({ places: [], add: {} })), homeOffers: vi.fn(async () => ["mini"]) } };
render(companionState(0));
- await vi.waitFor(() => expect($("[data-always-on-computer=mini]")).not.toBeNull());
+ await unfold();
+ await vi.waitFor(() => expect($("[data-always-on-move]")).not.toBeNull());
expect($("[data-always-on-computer=cloud]"), "My Cloud is not a computer added by hand").toBeNull();
await vi.waitFor(() => expect($("[data-always-on-health]")?.textContent).toBe("Online"));
expect(text()).toContain("Mac mini has its own circle at the left edge of the window");
@@ -190,13 +208,44 @@ describe("on the main computer", () => {
it("says main's own words when it can't move there", async () => {
const env = environments([{ id: "mini", name: "Mac mini", kind: "remote", origin: "http://mini.tail1234.ts.net:8799" }]);
const makeHome = vi.fn(async () => { throw new Error("This server can't be your bots' home."); });
- (globalThis as { ogb?: unknown }).ogb = { platform: "darwin", environments: env, workspaces: { probe: vi.fn(), makeHome, places: vi.fn(async () => ({ places: [], add: {} })) } };
+ (globalThis as { ogb?: unknown }).ogb = { platform: "darwin", environments: env, workspaces: { probe: vi.fn(), makeHome, places: vi.fn(async () => ({ places: [], add: {} })), homeOffers: vi.fn(async () => ["mini"]) } };
render(companionState(0));
+ await unfold();
await vi.waitFor(() => expect($("[data-always-on-move]")).not.toBeNull());
flushSync(() => $<HTMLButtonElement>("[data-always-on-move]")!.click());
await vi.waitFor(() => expect($("[role=alert]")?.textContent).toBe("This server can't be your bots' home."));
});
+ it("a server main doesn't offer it for (or no longer, once the move is done): no Make … my home; the fold stays closed until asked", async () => {
+ const env = environments([{ id: "mini", name: "Mac mini", kind: "remote", origin: "http://mini.tail1234.ts.net:8799" }],
+ [{ id: "mini", state: "connected", since: 1, version: "0.1.166", behind: false, install: null }]);
+ let offers = ["mini"];
+ let changed = () => {};
+ const homeOffers = vi.fn(async () => offers);
+ (globalThis as { ogb?: unknown }).ogb = { platform: "darwin", environments: env,
+ workspaces: { probe: vi.fn(), makeHome: vi.fn(), homeOffers, onChanged: (cb: () => void) => { changed = cb; return () => {}; } } };
+ render(companionState(0));
+ await vi.waitFor(() => expect(homeOffers).toHaveBeenCalled());
+ expect($("[data-always-on-steps]"), "a saved server doesn't open the fold by itself").toBeNull();
+ await unfold();
+ await vi.waitFor(() => expect($("[data-always-on-move]")).not.toBeNull());
+ offers = [];
+ changed();
+ await vi.waitFor(() => expect($("[data-always-on-move]")).toBeNull());
+ expect($("[data-always-on-computer=mini]")).not.toBeNull();
+ expect(text()).not.toContain("Make Mac mini my home");
+ expect(text()).toContain("Mac mini has its own circle");
+ });
+
+ it("an older app with no offers to read shows no Make … my home", async () => {
+ const env = environments([{ id: "mini", name: "Mac mini", kind: "remote", origin: "http://mini.tail1234.ts.net:8799" }]);
+ (globalThis as { ogb?: unknown }).ogb = { platform: "darwin", environments: env, workspaces: { probe: vi.fn(), makeHome: vi.fn() } };
+ render(companionState(0));
+ await unfold();
+ await vi.waitFor(() => expect($("[data-always-on-computer=mini]")).not.toBeNull());
+ expect($("[data-always-on-move]")).toBeNull();
+ });
+
it("nothing at all where neither part can run (an older app, or a browser)", () => {
(globalThis as { ogb?: unknown }).ogb = {};
render(companionState(0));
diff --git a/src/components/AlwaysOnHomeSection.tsx b/src/components/AlwaysOnHomeSection.tsx
index 8448c52d69..eff1b1b78a 100644
--- a/src/components/AlwaysOnHomeSection.tsx
+++ b/src/components/AlwaysOnHomeSection.tsx
@@ -29,7 +29,7 @@ export function alwaysOnLines(state: AlwaysOnHomeState): Line[] {
{ key: state.openAtLogin ? "alwaysOn.login.on" : state.available ? "alwaysOn.login.off" : "alwaysOn.login.unavailable", good: state.openAtLogin },
{ key: state.awake === "holding" ? "alwaysOn.awake.on" : "alwaysOn.awake.battery", good: state.awake === "holding" },
{ key: UPDATE_LINE[state.updates], good: state.updates === "by-itself" },
- { key: "alwaysOn.windowClosed", good: true },
+ { key: state.platform === "linux" ? "alwaysOn.windowClosedLinux" : "alwaysOn.windowClosed", good: true },
{ key: "alwaysOn.restarts", good: true },
];
}
@@ -45,14 +45,26 @@ export function homeStatusLine(devices: number): string {
return devices === 1 ? t("alwaysOn.status.one") : t("alwaysOn.status.many", { count: devices });
}
-/** Phones paired with this computer, and other computers and browsers signed in to it with a pairing code. */
+/** A computer or browser signed in here counts while it was seen within this long; an old sign-in nobody uses doesn't. */
+export const RECENT_SESSION_MS = 14 * 24 * 60 * 60 * 1000;
+
+/** Sessions seen recently, of what /api/auth/sessions lists. */
+export function recentSessions(sessions: unknown, now: number): number {
+ if (!Array.isArray(sessions)) return 0;
+ return sessions.filter((session) => {
+ const seen = (session as { lastSeenAt?: unknown } | null)?.lastSeenAt;
+ return typeof seen === "number" && now - seen <= RECENT_SESSION_MS;
+ }).length;
+}
+
+/** Phones paired with this computer, and other computers and browsers signed in to it with a pairing code and seen lately. */
function usePairedCount(state: CompanionState, on: boolean): number {
const [signedIn, setSignedIn] = useState(0);
const phones = state.devices.length;
useEffect(() => {
if (!on) return;
let alive = true;
- void api("/api/auth/sessions").then((body) => { if (alive) setSignedIn(Array.isArray(body?.sessions) ? body.sessions.length : 0); }).catch(() => {});
+ void api("/api/auth/sessions").then((body) => { if (alive) setSignedIn(recentSessions(body?.sessions, Date.now())); }).catch(() => {});
return () => { alive = false; };
}, [on, phones]);
return phones + signedIn;
@@ -121,28 +133,33 @@ function AlwaysOnDetails({ home, c, onAddPhone, canAddComputer, blocked }: { hom
);
}
-/** The servers saved by hand on this computer, read again whenever the Connect sheet closes. */
-function useSavedServers(version: number): { servers: SavedServer[]; status: ServerStatus[] } {
+/** The servers saved by hand on this computer, and those main offers Make … my home for now, read again whenever the
+ * Connect sheet closes or main says the places changed. */
+function useSavedServers(version: number): { servers: SavedServer[]; status: ServerStatus[]; offers: string[] } {
const environments = ogb()?.environments;
+ const workspaces = ogb()?.workspaces;
const [servers, setServers] = useState<SavedServer[]>([]);
const [status, setStatus] = useState<ServerStatus[]>([]);
+ const [offers, setOffers] = useState<string[]>([]);
useEffect(() => {
if (!environments) return;
let alive = true;
const read = () => {
void environments.state().then((saved) => { if (alive) setServers(saved.environments.filter(byHand)); }).catch(() => {});
void environments.status?.().then((rows) => { if (alive) setStatus(rows); }).catch(() => {});
+ void workspaces?.homeOffers?.().then((ids) => { if (alive) setOffers(Array.isArray(ids) ? ids : []); }).catch(() => {});
};
read();
const off = environments.onStatus?.(read);
- return () => { alive = false; off?.(); };
- }, [environments, version]);
- return { servers, status };
+ const offChanged = workspaces?.onChanged?.(read);
+ return () => { alive = false; off?.(); offChanged?.(); };
+ }, [environments, workspaces, version]);
+ return { servers, status, offers };
}
/** One computer added here: how it is doing, and one tap each for what it can do. Make … my home is the rail menu's own
- * one-tap move, with what it does said under it. */
-function AddedComputer({ server, status }: { server: SavedServer; status: ServerStatus | undefined }) {
+ * one-tap move, with what it does said under it, shown only while main offers it for this server (`offered`). */
+function AddedComputer({ server, status, offered }: { server: SavedServer; status: ServerStatus | undefined; offered: boolean }) {
const [moving, setMoving] = useState(false);
const [said, setSaid] = useState<string | null>(null);
const move = () => {
@@ -162,12 +179,12 @@ function AddedComputer({ server, status }: { server: SavedServer; status: Server
<div data-always-on-health={status?.state ?? "checking"} className="text-[12px] leading-4 text-ink-secondary">{health}</div>
</div>
<button type="button" className="ui-button" data-always-on-open="" onClick={() => void ogb()?.environments?.switch(server.id)}>{t("alwaysOn.added.open")}</button>
- <button type="button" className="ui-button" data-always-on-move="" disabled={moving} aria-busy={moving || undefined} onClick={move}>{t("rail.makeHome", { name: server.name })}</button>
+ {offered && <button type="button" className="ui-button" data-always-on-move="" disabled={moving} aria-busy={moving || undefined} onClick={move}>{t("rail.makeHome", { name: server.name })}</button>}
</div>
{said && <p role="alert" className="text-[12px] leading-4 text-danger">{said}</p>}
<ul className="flex list-disc flex-col gap-1 pl-4 text-[12px] leading-4 text-ink-secondary">
<li>{t("alwaysOn.added.sidebar", { name: server.name })}</li>
- <li>{t("alwaysOn.added.keepRunning", { name: server.name })}</li>
+ {offered && <li>{t("alwaysOn.added.keepRunning", { name: server.name })}</li>}
<li>{t("alwaysOn.added.screen", { app: productName() })}</li>
</ul>
</div>
@@ -176,12 +193,11 @@ function AddedComputer({ server, status }: { server: SavedServer; status: Server
/** On the person's main computer: the steps to add a spare computer, then each one added and what it can do. */
function AddAlwaysOnComputer() {
- const [asked, setOpen] = useState<boolean | null>(null);
+ const [open, setOpen] = useState(false);
const [connecting, setConnecting] = useState(false);
const [version, setVersion] = useState(0);
- const { servers, status } = useSavedServers(version);
+ const { servers, status, offers } = useSavedServers(version);
const title = t("alwaysOn.add.title");
- const open = asked ?? servers.length > 0;
return (
<>
<SettingsFoldRow id="add-always-on" title={title} subtitle={t("alwaysOn.add.line")} open={open} onToggle={() => setOpen(!open)}>
@@ -193,7 +209,7 @@ function AddAlwaysOnComputer() {
<button type="button" className="ui-button ui-button-primary" data-always-on-connect="" onClick={() => setConnecting(true)}>{t("alwaysOn.add.connect")}</button>
</li>
</ol>
- {servers.map((server) => <AddedComputer key={server.id} server={server} status={status.find((row) => row.id === server.id)} />)}
+ {servers.map((server) => <AddedComputer key={server.id} server={server} status={status.find((row) => row.id === server.id)} offered={offers.includes(server.id)} />)}
</SettingsFoldRow>
{connecting && <RailSheet focusKey="connect" onClose={() => { setConnecting(false); setVersion((n) => n + 1); }}>
<OwnServerLink onBack={null} onConnected={() => { setConnecting(false); setVersion((n) => n + 1); }} />
diff --git a/src/components/settings/SettingsNav.tsx b/src/components/settings/SettingsNav.tsx
index f988501c9b..5fa35510fb 100644
--- a/src/components/settings/SettingsNav.tsx
+++ b/src/components/settings/SettingsNav.tsx
@@ -17,6 +17,7 @@ import { usePhonePlaceState } from "./phone-status";
import type { SettingsPlace } from "./settings-context";
import { OWNERS, pageById, type SearchHit, type SettingsContext, type SettingsOwner, type SettingsPage, type SettingsPageId } from "./settings-index";
import { useUpdaterState } from "@/lib/updater";
+import { isMacPlatform } from "@/lib/keyboard-shortcuts";
import { keySection, type KeyEntry } from "../keys/key-catalog";
import { HELP_CENTER_URL, desktopAppVersion } from "@/lib/app-links";
@@ -283,7 +284,7 @@ export function hitLabel(hit: SearchHit, place: SettingsPlace, desktop: boolean)
if (hit.entry.id === "page:overview") return place.name;
if (hit.entry.id === "page:account") return t("settings.page.account");
if (hit.entry.id === "page:app") return desktop ? t("settings.page.app") : t("settings.page.browser");
- return t(hit.entry.labelKey, { app: productName(), helper: "" });
+ return t(hit.entry.macLabelKey && isMacPlatform() ? hit.entry.macLabelKey : hit.entry.labelKey, { app: productName(), helper: "" });
}
function HitRow({ ctx, place, hit, query, onHit }: { ctx: SettingsContext; place: SettingsPlace; hit: SearchHit; query: string; onHit: (hit: SearchHit) => void }) {
diff --git a/src/components/settings/hit-label.dom.test.ts b/src/components/settings/hit-label.dom.test.ts
new file mode 100644
index 0000000000..6f58595b28
--- /dev/null
+++ b/src/components/settings/hit-label.dom.test.ts
@@ -0,0 +1,19 @@
+// @vitest-environment happy-dom
+// A search hit's label is the row's own name as this computer shows it: on a Mac, "Use this Mac …".
+import { afterEach, expect, it } from "vitest";
+import { setLocale } from "@/lib/i18n";
+import { hitLabel } from "./SettingsNav";
+import { SETTINGS_INDEX } from "./settings-index";
+import type { SettingsPlace } from "./settings-context";
+
+const entry = SETTINGS_INDEX.find((row) => row.id === "always-on")!;
+const label = () => hitLabel({ entry, elsewhere: false, score: 0 }, { name: "This computer" } as SettingsPlace, true);
+afterEach(() => { delete (window as { ogb?: unknown }).ogb; });
+
+it("says Mac on a Mac and computer elsewhere, as the row itself does", () => {
+ setLocale("en");
+ (window as { ogb?: unknown }).ogb = { platform: "darwin" };
+ expect(label()).toBe("Use this Mac as an always-on home");
+ (window as { ogb?: unknown }).ogb = { platform: "win32" };
+ expect(label()).toBe("Use this computer as an always-on home");
+});
diff --git a/src/components/settings/settings-index.ts b/src/components/settings/settings-index.ts
index 875adb9087..03e7b9dbec 100644
--- a/src/components/settings/settings-index.ts
+++ b/src/components/settings/settings-index.ts
@@ -154,6 +154,8 @@ export interface SettingsIndexEntry {
page: SettingsPageId;
anchor?: string;
labelKey: LocaleKey;
+ /** the row's own name on a Mac, where it says Mac rather than computer */
+ macLabelKey?: LocaleKey;
/** the section the row sits in, for its location line */
sectionKey?: LocaleKey;
synonyms?: string[];
@@ -179,7 +181,7 @@ export const SETTINGS_INDEX: readonly SettingsIndexEntry[] = [
{ id: "relay", page: "phone", anchor: "reach", labelKey: "devices.route.relay", sectionKey: "phone.reach.title", when: hereOnly, synonyms: ["anywhere", "relay", "away"] },
{ id: "keep-awake", page: "phone", anchor: "reach", labelKey: "remote.keepAwake", sectionKey: "phone.reach.title", when: hereOnly, synonyms: ["sleep", "awake", "overnight", "scheduled"] },
{ id: "wake-automations", page: "phone", labelKey: "settings.search.wakeAutomations", jump: "automations", when: hereOnly, topFor: ["sleep", "overnight", "scheduled"], synonyms: ["awake"] },
- { id: "always-on", page: "phone", anchor: "always-on", labelKey: "alwaysOn.title", sectionKey: "alwaysOn.section", when: hereOnly,
+ { id: "always-on", page: "phone", anchor: "always-on", labelKey: "alwaysOn.title", macLabelKey: "alwaysOn.titleMac", sectionKey: "alwaysOn.section", when: hereOnly,
topFor: ["always on", "always-on", "home server", "spare computer", "mac mini"], synonyms: ["mini", "server at home", "run all day", "24/7", "open at login", "awake"] },
{ id: "add-always-on", page: "phone", anchor: "always-on", labelKey: "alwaysOn.add.title", sectionKey: "alwaysOn.section", when: hereOnly,
topFor: ["add a mac mini", "add mac mini", "add a computer", "add always-on computer"], synonyms: ["mac mini", "mini", "home server", "spare computer", "move my bots"] },
diff --git a/src/locales/en.json b/src/locales/en.json
index 51cea199bb..5609ce57c3 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -9648,6 +9648,7 @@
"native.dialog.serverFailed.portsTaken": "Every OpenMausBot port answered health checks from another process — likely a second copy of the app, or another program on ports 8799–28799. Quit that program, then quit and reopen OpenMausBot.",
"native.dialog.serverFailed.slow": "The background server didn't come up in time — this is usually slow startup, not a port conflict. Quit and reopen OpenMausBot.",
"native.dialog.serverFailed.keepsHappening": "If it keeps happening, check {log}.",
+ "native.dialog.serverFailed.keepTrying": "This computer is an always-on home, so it keeps trying to start the server every 5 minutes.",
"native.viewer.title": "Desktop unavailable",
"native.viewer.heading": "Couldn't open the live desktop",
"native.viewer.open": "Open in browser",
@@ -11083,14 +11084,14 @@
"alwaysOn.sectionLine": "A spare computer, like a Mac mini, that runs your bots all day: your own Cloud at home, reachable from your laptop and phone.",
"alwaysOn.titleMac": "Use this Mac as an always-on home",
"alwaysOn.title": "Use this computer as an always-on home",
- "alwaysOn.line": "Opens at login, stays awake while plugged in, updates itself and starts its server again if it stops.",
+ "alwaysOn.line": "Opens at login, stays awake while plugged in and starts its server again if it stops.",
"alwaysOn.failed": "Could not change this. Try again.",
"alwaysOn.login.on": "Opens at login",
"alwaysOn.login.off": "Open at login is off. Turn it on in Login Items in your system's settings.",
"alwaysOn.login.unavailable": "Open at login works only in the installed app.",
"alwaysOn.awake.on": "Stays awake while plugged in",
"alwaysOn.awake.battery": "On battery now: it sleeps as usual until it's plugged in",
- "alwaysOn.updates.byItself": "Installs updates by itself when nobody is using it",
+ "alwaysOn.updates.byItself": "Installs updates by itself at a quiet moment. While its bots are busy, an update waits.",
"alwaysOn.updates.restart": "Updates wait for you to choose Restart in {app}",
"alwaysOn.updates.package": "Updates come through your package manager",
"alwaysOn.updates.none": "This copy of {app} doesn't update itself",
@@ -11102,10 +11103,10 @@
"alwaysOn.addPhone": "Add your phone",
"alwaysOn.addComputer": "Add your other computer",
"alwaysOn.addComputerOn": "To add your other computer, choose Pair a computer under Your other computers below.",
- "alwaysOn.mac.power": "After a power cut: System Settings → Energy → Start up when power is connected: Always (on older macOS, Start up automatically after a power failure).",
+ "alwaysOn.mac.power": "After a power cut: System Settings → Energy → Start up automatically after a power failure.",
"alwaysOn.mac.login": "To start without anyone signing in: System Settings → Users & Groups → Automatically log in as. macOS offers it only while FileVault is off.",
"alwaysOn.mac.locked": "Bots can't use the screen while it's locked. Locking is set in System Settings → Lock Screen.",
- "alwaysOn.mac.permissions": "For bots to use its screen, allow {app} under Accessibility and Screen Recording in System Settings → Privacy & Security.",
+ "alwaysOn.mac.permissions": "For bots to use its screen, allow {app} under Accessibility and Screen & System Audio Recording in System Settings → Privacy & Security.",
"alwaysOn.add.title": "Add a Mac mini or other always-on computer",
"alwaysOn.add.line": "Your bots keep running there while this computer sleeps or travels.",
"alwaysOn.add.step1": "On that computer, install {app}, open Settings → Phone & devices and turn on Use this Mac as an always-on home (on Windows or Linux: Use this computer as an always-on home).",
@@ -11120,5 +11121,6 @@
"alwaysOn.added.keepRunning": "Make {name} my home moves this computer's bots, chats, memory and routines there, so they keep running while this computer is off.",
"alwaysOn.added.screen": "Bots there use its screen, browser and files, once {app} is allowed to use that computer.",
"alwaysOn.windowClosed": "Keeps running when its window is closed",
+ "alwaysOn.windowClosedLinux": "Keeps running when its window is closed. Open {app} again to bring the window back; to quit, press Alt and choose File → Quit.",
"alwaysOn.status.noWay": "Home is on · no phone or computer can reach it yet"
}
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 01cc587fde..99cb2f131a 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -9565,6 +9565,7 @@
"native.dialog.serverFailed.portsTaken": "Outro processo respondeu às verificações de integridade em todas as portas do OpenMausBot — provavelmente uma segunda cópia do app ou outro programa nas portas 8799–28799. Feche esse programa. Depois, saia do OpenMausBot e abra novamente.",
"native.dialog.serverFailed.slow": "O servidor em segundo plano não iniciou a tempo — geralmente é só uma demora na inicialização, não um conflito de portas. Saia e abra o OpenMausBot novamente.",
"native.dialog.serverFailed.keepsHappening": "Se isso continuar acontecendo, confira {log}.",
+ "native.dialog.serverFailed.keepTrying": "Este computador é uma casa sempre ligada, então ele continua tentando iniciar o servidor a cada 5 minutos.",
"native.viewer.title": "Desktop indisponível",
"native.viewer.heading": "Não foi possível abrir o desktop ao vivo",
"native.viewer.open": "Abrir no navegador",
@@ -11083,14 +11084,14 @@
"alwaysOn.sectionLine": "Um computador sobrando, como um Mac mini, que roda seus bots o dia todo: sua própria Cloud em casa, acessível do seu notebook e do seu celular.",
"alwaysOn.titleMac": "Usar este Mac como casa sempre ligada",
"alwaysOn.title": "Usar este computador como casa sempre ligada",
- "alwaysOn.line": "Abre ao iniciar a sessão, fica acordado enquanto está na tomada, se atualiza sozinho e reinicia o servidor se ele parar.",
+ "alwaysOn.line": "Abre ao iniciar a sessão, fica acordado enquanto está na tomada e reinicia o servidor se ele parar.",
"alwaysOn.failed": "Não foi possível mudar isso. Tente de novo.",
"alwaysOn.login.on": "Abre ao iniciar a sessão",
"alwaysOn.login.off": "Abrir ao iniciar a sessão está desligado. Ative em Itens de Início nos ajustes do sistema.",
"alwaysOn.login.unavailable": "Abrir ao iniciar a sessão só funciona no app instalado.",
"alwaysOn.awake.on": "Fica acordado enquanto está na tomada",
"alwaysOn.awake.battery": "Na bateria agora: dorme normalmente até ser ligado na tomada",
- "alwaysOn.updates.byItself": "Instala atualizações sozinho quando ninguém está usando",
+ "alwaysOn.updates.byItself": "Instala atualizações sozinho num momento tranquilo. Enquanto os bots estão ocupados, a atualização espera.",
"alwaysOn.updates.restart": "As atualizações esperam você escolher Reiniciar no {app}",
"alwaysOn.updates.package": "As atualizações chegam pelo seu gerenciador de pacotes",
"alwaysOn.updates.none": "Esta cópia do {app} não se atualiza sozinha",
@@ -11102,10 +11103,10 @@
"alwaysOn.addPhone": "Adicionar seu celular",
"alwaysOn.addComputer": "Adicionar seu outro computador",
"alwaysOn.addComputerOn": "Para adicionar seu outro computador, escolha Parear um computador em Seus outros computadores, abaixo.",
- "alwaysOn.mac.power": "Depois de uma queda de energia: Ajustes do Sistema → Energia → Iniciar quando a alimentação estiver conectada: Sempre (em versões mais antigas do macOS, a opção de iniciar automaticamente após falta de energia).",
+ "alwaysOn.mac.power": "Depois de uma queda de energia: Ajustes do Sistema → Energia → Iniciar automaticamente após falta de energia.",
"alwaysOn.mac.login": "Para iniciar sem ninguém entrar na sessão: Ajustes do Sistema → Usuários e Grupos → Iniciar sessão automaticamente como. O macOS só oferece isso com o FileVault desligado.",
"alwaysOn.mac.locked": "Os bots não podem usar a tela enquanto ela está bloqueada. O bloqueio é ajustado em Ajustes do Sistema → Tela Bloqueada.",
- "alwaysOn.mac.permissions": "Para os bots usarem a tela, permita o {app} em Acessibilidade e Gravação de Tela em Ajustes do Sistema → Privacidade e Segurança.",
+ "alwaysOn.mac.permissions": "Para os bots usarem a tela, permita o {app} em Acessibilidade e Gravação de Tela e Áudio do Sistema em Ajustes do Sistema → Privacidade e Segurança.",
"alwaysOn.add.title": "Adicionar um Mac mini ou outro computador sempre ligado",
"alwaysOn.add.line": "Seus bots continuam rodando lá enquanto este computador dorme ou viaja.",
"alwaysOn.add.step1": "Naquele computador, instale o {app}, abra Configurações → Celular e dispositivos e ative Usar este Mac como casa sempre ligada (no Windows ou Linux: Usar este computador como casa sempre ligada).",
@@ -11120,5 +11121,6 @@
"alwaysOn.added.keepRunning": "Definir {name} como base dos meus bots leva os bots, conversas, memória e rotinas deste computador para lá, para que continuem rodando enquanto este computador está desligado.",
"alwaysOn.added.screen": "Os bots de lá usam a tela, o navegador e os arquivos daquele computador, depois que o {app} tiver permissão para usá-lo.",
"alwaysOn.windowClosed": "Continua rodando quando a janela é fechada",
+ "alwaysOn.windowClosedLinux": "Continua rodando quando a janela é fechada. Abra o {app} de novo para trazer a janela de volta; para sair, pressione Alt e escolha Arquivo → Sair do OpenMausBot.",
"alwaysOn.status.noWay": "Casa ligada · nenhum celular ou computador consegue alcançá-la ainda"
}
diff --git a/src/types/ogb.d.ts b/src/types/ogb.d.ts
index 238d133a2c..2bcf3b3df2 100644
--- a/src/types/ogb.d.ts
+++ b/src/types/ogb.d.ts
@@ -208,6 +208,8 @@ const __APP_VERSION__: string;
remove?: (id: string) => Promise<{ outcome: import("../../electron/cloud-account.mjs").CloudRemoveOutcome }>;
/** Make a server of the person's own, which the rail lists with `makeHome`, their bots' home: the move starts. */
makeHome?: (id: string) => Promise<{ started: true }>;
+ /** The ids of the servers main offers Make … my home for now (none once a move is done). Absent on an older app. */
+ homeOffers?: () => Promise<string[]>;
/** Main's word that the places or the sign-in changed: read them again. */
onChanged?: (callback: () => void) => () => void;
/** A workspace of this computer's own (main refuses any page but the rail's and this computer's own): a new one,