Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
A computer frozen for a Cloud that is gone comes home by itself (#4158)
Milind Soni2ee778b75335
diff --git a/electron/cloud-account-clouds.node-test.mjs b/electron/cloud-account-clouds.node-test.mjsindex 45f8f13b91..7d6a395df4 100644--- a/electron/cloud-account-clouds.node-test.mjs+++ b/electron/cloud-account-clouds.node-test.mjs@@ -20,7 +20,7 @@ async function admin(t) {const f = { requests: [], browsers: [], timer: null, delay: null,session: { cloud: { state: "ready", origin: HOME, pairingAvailable: true } },pairing: () => [200, grant(HOME)], add: () => [404, { error: "not_found" }], patch: () => [404, { error: "not_found" }], organization: () => [404, { error: "not_found" }],- hide: () => [404, { error: "Not found." }] };+ hide: () => [404, { error: "Not found." }], movedTo: () => [404, { error: "not_found" }] };const server = createServer(async (req, res) => {let body = ""; for await (const chunk of req) body += chunk;const parsed = body ? JSON.parse(body) : undefined;@@ -34,6 +34,7 @@ async function admin(t) {if (req.url === "/api/cloud/desktop/organizations" && req.method === "POST") return send(f.organization(parsed));if (req.url.startsWith("/api/cloud/desktop/clouds/") && req.method === "PATCH") return send(f.patch(decodeURIComponent(req.url.slice("/api/cloud/desktop/clouds/".length)), parsed));if (req.url.startsWith("/api/cloud/desktop/clouds/") && req.url.endsWith("/hide") && req.method === "POST") return send(f.hide(decodeURIComponent(req.url.slice("/api/cloud/desktop/clouds/".length, -"/hide".length)), parsed));+ if (req.url === "/api/cloud/desktop/moved-to" && req.method === "POST") return send(f.movedTo(parsed));if (req.url === "/api/public/config") return send([200, { plans: [{ tier: "pro", price: { currency: "USD", interval: "month", amount: 4900 } }], trial: { days: 7 } }]);send([404, { error: "not_found" }]);});@@ -293,3 +294,29 @@ test("the Admin's word on a new organization: the name is taken, the plan has as}assert.deepEqual(f.browsers, []);});++test("the Admin's word on a Cloud this computer moved to: only a word it knows, none signed out or from an Admin that can't say", async t => {+ const f = await admin(t), gone = "https://omb-trial-1.fly.dev";+ assert.equal(await f.client.movedTo(gone), null, "not verified yet: nothing is asked");+ assert.equal(f.requests.some(row => row.route === "/api/cloud/desktop/moved-to"), false);+ await f.client.start();+ assert.equal(await f.client.movedTo(gone), null, "an Admin that can't say yet");+ for (const state of ["deleted", "ended", "live", "unknown"]) {+ f.movedTo = () => [200, { cloudContractVersion: 1, state }];+ assert.equal(await f.client.movedTo(gone), state);+ }+ assert.deepEqual(f.requests.at(-1), { route: "/api/cloud/desktop/moved-to", method: "POST", body: { origin: gone } });+ f.movedTo = () => [200, { cloudContractVersion: 1, state: "gone-ish" }];+ assert.equal(await f.client.movedTo(gone), null, "a word this app doesn't know is no word");+ f.movedTo = () => [429, { error: "rate_limited" }];+ await assert.rejects(f.client.movedTo(gone), { status: 429 });+});++test("starting a sign-in over a good one is refused, and goes once that one has ended: what the home screen's Sign in does for another account", async t => {+ const f = await admin(t);+ await f.client.start();+ await assert.rejects(f.client.begin(), /Sign out before/);+ await f.client.signOut();+ await f.client.begin();+ assert.equal(f.requests.some(row => row.route === "/api/cloud/desktop/authorize"), true);+});diff --git a/electron/cloud-account.d.mts b/electron/cloud-account.d.mtsindex ce0f583411..5b22abb4e9 100644--- a/electron/cloud-account.d.mts+++ b/electron/cloud-account.d.mts@@ -311,6 +311,10 @@ export interface CloudAccountClient {reportMove(options: { installation: string }): Promise<boolean>;/** This computer keeps its bots on itself again: it no longer counts as moved. False when the Admin can't take it yet. */reportKept(options: { installation: string }): Promise<boolean>;+ /** The Admin's word on this account's own Cloud at `origin` (POST /api/cloud/desktop/moved-to): deleted, ended (stopped and+ * kept only until it is deleted), live, or unknown (none of this account's). Null without a verified sign-in, or from an+ * Admin that doesn't say. */+ movedTo(origin: string): Promise<"deleted" | "ended" | "live" | "unknown" | null>;/** Tells the Admin where this computer's move to My Cloud stands (POST /api/cloud/desktop/move-status); false without a* sign-in or when the Admin doesn't take it yet. */reportMoveStatus(report: import("./move-status.mjs").MoveStatusReport): Promise<boolean>;diff --git a/electron/cloud-account.mjs b/electron/cloud-account.mjsindex ec627e2364..a13bbbd84f 100644--- a/electron/cloud-account.mjs+++ b/electron/cloud-account.mjs@@ -17,6 +17,8 @@ export function cloudTarget(env = process.env) {const TOKEN = /^omc_[A-Za-z0-9_-]{43}$/;const CODE = /^[A-HJ-NP-Z2-9]{5}-[A-HJ-NP-Z2-9]{5}$/;const PRIVATE_CODE = /^[A-Za-z0-9_-]{43}$/;+/** What the Admin says of a Cloud of this account's a computer moved to (POST moved-to). */+const MOVED_TO = Object.freeze(["deleted", "ended", "live", "unknown"]);const TIER = /^[a-z][a-z0-9-]{0,23}$/;const REFRESH_MS = 60_000;const STEADY_MS = 15 * 60_000;@@ -847,6 +849,17 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNtry { await request("kept", { method: "POST", body: { installation }, token: current.token }); return true; }catch (error) { if (error?.status === 404 && !error.opaque) return false; throw error; }},+ /** The Admin's word on this account's own Cloud at `origin` (POST /api/cloud/desktop/moved-to), for a computer frozen+ * for a Cloud that is not My Cloud now: "deleted", "ended" (stopped and kept only until it is deleted), "live", or+ * "unknown" (none of this account's ever was). Null without a verified sign-in, or from an Admin that doesn't say (404). */+ async movedTo(cloudOrigin) {+ const current = grant;+ if (!current || value.status !== "connected" || typeof cloudOrigin !== "string") return null;+ let result;+ try { result = await request("moved-to", { method: "POST", body: { origin: cloudOrigin }, token: current.token }); }+ catch (error) { if (error?.status === 404 && !error.opaque) return null; throw error; }+ return grant === current && result?.cloudContractVersion === 1 && MOVED_TO.includes(result.state) ? result.state : null;+ },/** Tells the Admin where this computer's move to My Cloud stands (POST /api/cloud/desktop/move-status; move-status.mjs* builds `report`). False when there is no sign-in or the Admin doesn't take it yet (404). */async reportMoveStatus(report) {diff --git a/electron/fixtures/home-window-world.mjs b/electron/fixtures/home-window-world.mjsindex 55312aa862..982e5b95ac 100644--- a/electron/fixtures/home-window-world.mjs+++ b/electron/fixtures/home-window-world.mjs@@ -67,6 +67,8 @@ export function world({ journal = done(), marker = null, state = connected(), po},signInAgain: async () => { w.signIns.push("again"); },begin: async () => { w.signIns.push("begin"); },+ signOut: async () => { w.signIns.push("out"); w.state = { status: "signed-out" }; },+ reopen: async () => { w.signIns.push("reopen"); },async hideCloud(cloudId) {w.hides.push(cloudId);if (w.removeAnswer === "removed") w.state = { ...w.state, clouds: (w.state?.clouds ?? []).filter((cloud) => cloud.id !== cloudId) };diff --git a/electron/home-window-states.node-test.mjs b/electron/home-window-states.node-test.mjsindex eec59ba65b..2e41c52f38 100644--- a/electron/home-window-states.node-test.mjs+++ b/electron/home-window-states.node-test.mjs@@ -119,3 +119,44 @@ test("Remove from list on this computer's screen: the Admin first, then the windw.url = `${CLOUD}/`;assert.throws(() => handlers.get("home:remove")({ sender: w.contents, senderFrame: w.contents.mainFrame }), /only available/);});++// A computer whose bots moved to one Cloud of the person's while My Cloud is now another (several Clouds per account).+const MOVED_TO = "https://omb-trial-1.fly.dev";+test("a freeze that names another Cloud on the person's own list is theirs, never another account's; one not on it is said to be another account's", async () => {+ const listed = world({ journal: null, marker: { frozen: true, cloud: CLIENT }, state: { ...connected(), clouds: [CLIENT_A] } });+ await listed.home.show();+ assert.deepEqual(listed.home.current(), { kind: "cloud", origin: CLIENT });+ const unlisted = world({ journal: null, marker: { frozen: true, cloud: MOVED_TO }, state: { ...connected(), clouds: [CLIENT_A] } });+ await unlisted.home.show();+ assert.deepEqual(unlisted.home.view(), { screen: "signin", other: true });+});++test("My Cloud ending sends home only a computer that moved to that Cloud", async () => {+ const held = connected({ status: "stopped", hold: { until: 1_900_000_000_000 } });+ const elsewhere = world({ journal: { v: 1, phase: "done", cloud: { origin: CLIENT, account: "acct-1", machine: CLIENT }, doneAt: 1 }, state: held });+ await elsewhere.home.show();+ assert.deepEqual(elsewhere.home.current(), { kind: "cloud", origin: CLIENT }, "its Cloud goes on: still home");+ const here = world({ state: held });+ await here.home.show();+ assert.deepEqual(here.home.current(), { kind: "computer" });+ const unnamed = world({ state: { ...connected(), machine: { status: "stopped", hold: { until: 1_900_000_000_000 } } } });+ await unnamed.home.show();+ assert.deepEqual(unnamed.home.current(), { kind: "computer" }, "a hold that names no address is taken for the Cloud moved to");+});++test("Sign in never dead-ends: another account's sign-in ends first, then the browser signs in; one still good only looks again; one open in the browser opens again", async () => {+ const other = world({ state: { ...connected(), account: { id: "acct-2", email: "[email protected]" } } });+ await other.home.show();+ assert.deepEqual(other.home.view(), { screen: "signin", other: true });+ await other.home.signIn();+ assert.deepEqual(other.signIns, ["out", "begin"]);+ const good = world({ journal: null, marker: { frozen: true, cloud: MOVED_TO }, state: { ...connected(), clouds: [] } });+ await good.home.show();+ good.state = { ...good.state, clouds: [{ ...CLIENT_A, origin: MOVED_TO }] };+ await good.home.signIn();+ assert.deepEqual(good.signIns, [], "the same account never signs out");+ assert.deepEqual(good.home.current(), { kind: "cloud", origin: MOVED_TO }, "it looked again");+ const opening = world({ state: { status: "connecting", account: null } });+ await opening.home.signIn();+ assert.deepEqual(opening.signIns, ["reopen"]);+});diff --git a/electron/home-window.d.mts b/electron/home-window.d.mtsindex 91857e26d1..5e48934992 100644--- a/electron/home-window.d.mts+++ b/electron/home-window.d.mts@@ -99,7 +99,7 @@ export function createHomeWindow(deps: {journal(): unknown;frozen(): Promise<{ frozen: boolean; cloud?: string } | null>;account(): { state(): any; power(): any; wakeHome(): Promise<unknown>; setWaking(on: boolean): void; pairHome(cloudId?: string | null): Promise<{ origin: string; code: string; expiresAt: number }>;- pairTeam?(teamId: string): Promise<{ origin: string; code: string; expiresAt: number }>; signInAgain(): Promise<unknown>; begin(): Promise<unknown>;+ pairTeam?(teamId: string): Promise<{ origin: string; code: string; expiresAt: number }>; signInAgain(): Promise<unknown>; begin(): Promise<unknown>; signOut?(): Promise<unknown>; reopen?(): Promise<unknown>;hideCloud?(cloudId: string): Promise<{ outcome: import("./cloud-account.mjs").CloudRemoveOutcome }> } | null;restored?(): Promise<unknown>;window(): WindowLike | null;diff --git a/electron/home-window.mjs b/electron/home-window.mjsindex d1e70ae326..705201e279 100644--- a/electron/home-window.mjs+++ b/electron/home-window.mjs@@ -9,7 +9,7 @@// shown place's verified origin, nothing else. A team is only ever one the Admin's session lists, paired through the// Admin's team pairing (its claims are the Admin's), never an address a page supplied.import { cloudHomeConnectUrl, cloudSetupOf, cloudUnreachableText, machineSetup, readyCloudOrigin } from "./cloud-home.mjs";-import { cloudMachine, cloudState, otherOwnClouds } from "./cloud-list.mjs";+import { cloudMachine, cloudState, otherOwnClouds, ownCloud } from "./cloud-list.mjs";import { asleepAnswer, BACKGROUND_HEADERS, openSleepingCloud, SIGNED_IN_MS } from "./cloud-power.mjs";import { awayIn, parseJournal } from "./one-home.mjs";@@ -62,7 +62,9 @@ const originOf = (url) => { try { return new URL(url).origin; } catch { return n/*** Who the window opens. `journal`: one-home.json read back; `frozenCloud`: this computer's freeze marker when there is no- * journal (its Cloud's origin, or true when it names none); `state`: the MausBot Cloud sign-in's state.+ * journal (its Cloud's origin, or true when it names none); `state`: the MausBot Cloud sign-in's state. An ended My Cloud+ * sends home only a computer that moved to that Cloud; a freeze that names another Cloud of the signed-in person's own list+ * is theirs, and opens that Cloud.* @returns {{ kind: "computer" } | { kind: "cloud", origin: string } | { kind: "signin", other?: true }}*/export function homeOf({ journal = null, frozenCloud = null, state = null }) {@@ -70,14 +72,15 @@ export function homeOf({ journal = null, frozenCloud = null, state = null }) {: frozenCloud ? { origin: typeof frozenCloud === "string" ? frozenCloud : null, account: null } : null;if (!moved) return { kind: "computer" };const connected = state?.status === "connected";- if (connected && state.machine?.hold) return { kind: "computer" };+ if (connected && state.machine?.hold && (!moved.origin || !state.machine.origin || state.machine.origin === moved.origin)) return { kind: "computer" };const signedIn = state?.account?.id ?? null;if (!signedIn || state.status === "signed-out" || state.status === "connecting") return { kind: "signin" };if (moved.account && moved.account !== signedIn) return { kind: "signin", other: true };const theirs = connected ? state.machine?.origin ?? null : null;const origin = moved.origin ?? theirs;if (!origin) return { kind: "signin" };- if (!moved.account && theirs && theirs !== origin) return { kind: "signin", other: true };+ const listed = connected && Array.isArray(state.clouds) && state.clouds.some((cloud) => ownCloud(cloud) && cloud.origin === origin);+ if (!moved.account && theirs && theirs !== origin && !listed) return { kind: "signin", other: true };return { kind: "cloud", origin };}@@ -166,7 +169,7 @@ export function routeOf(url, origin) {* journal(): unknown,* frozen(): Promise<{ frozen: boolean, cloud?: string } | null>,* account(): { state(): any, power(): any, wakeHome(): Promise<unknown>, setWaking(on: boolean): void, pairHome(cloudId?: string | null): Promise<{ origin: string, code: string, expiresAt: number }>,- * pairTeam?(teamId: string): Promise<{ origin: string, code: string, expiresAt: number }>, signInAgain(): Promise<unknown>, begin(): Promise<unknown> } | null,+ * pairTeam?(teamId: string): Promise<{ origin: string, code: string, expiresAt: number }>, signInAgain(): Promise<unknown>, begin(): Promise<unknown>, signOut?(): Promise<unknown>, reopen?(): Promise<unknown> } | null,* restored?(): Promise<unknown>,* window(): { isDestroyed(): boolean, webContents: { id: number, getURL(): string, reload(): void } } | null,* ensureWindow(): void,@@ -611,11 +614,21 @@ export function createHomeWindow(deps) {shown: () => shown,/** The person asked again (the screen's timer, back online, or the window focused). */retry: () => show(),- /** The screen's one button: this device's MausBot Cloud sign-in, again. */+ /** The screen's one button: this device's MausBot Cloud sign-in, again. A sign-in already open in the browser opens+ * again; one with an account My Cloud isn't (`other`) ends first, so the browser can sign in another; one that is still+ * good only looks again. */async signIn() {const client = account();if (!client) return;- await (client.state().status === "reauth-required" ? client.signInAgain() : client.begin());+ const status = client.state().status;+ if (status === "reauth-required") return void await client.signInAgain();+ if (status === "connecting") return void await client.reopen?.();+ if (status !== "signed-out") {+ const current = await refresh();+ if (!(current.kind === "signin" && current.other)) return void await show();+ await client.signOut?.();+ }+ await client.begin();},repair,/** The MausBot Cloud sign-in changed: a window that waits on it, a home that changed, or a team shown that thediff --git a/electron/home-window.node-test.mjs b/electron/home-window.node-test.mjsindex 9741013191..786b03c5a7 100644--- a/electron/home-window.node-test.mjs+++ b/electron/home-window.node-test.mjs@@ -349,6 +349,7 @@ test("the window's IPC: the screen reads and retries, My Cloud's page renews itsw.url = `${LOCAL}${HOME_SCREEN_PATH}`;assert.deepEqual(handlers.get("home:state")(page), { screen: "opening" });assert.throws(() => handlers.get("home:repair")(page), /only available/);+ w.state = { status: "signed-out" };await handlers.get("home:sign-in")(page);w.url = "https://other.example.test/";assert.throws(() => handlers.get("home:sign-in")(page), /only available/);diff --git a/electron/one-home-gone.node-test.mjs b/electron/one-home-gone.node-test.mjsnew file mode 100644index 0000000000..a96ac94efa--- /dev/null+++ b/electron/one-home-gone.node-test.mjs@@ -0,0 +1,262 @@+import assert from "node:assert/strict";+import test from "node:test";++import { createOneHome, QUIET_MS } from "./one-home.mjs";+import { createGoneCheck, GONE_ASK_MS, installOneHome, oneHomeCloud } from "./one-home-main.mjs";+import { moveStatus } from "./move-status.mjs";++// A computer whose bots moved to one Cloud of the person's, while the account has others: that Cloud ends or is deleted and+// another becomes My Cloud. The Admin's word on the Cloud moved to brings this computer home by itself, with every+// automation off; nothing else does (an Admin that can't say, a session not verified, another account, a server of the+// person's own). Every side is faked; nothing reaches the network.+const GONE = "https://omb-trial-1.fly.dev", MINE = "https://omb-other-2.fly.dev";+const reply = (status, body = {}) => ({ ok: status < 400, status, body });++function computer({ journal = null, marker = { frozen: true, cloud: GONE }, admin = { [GONE]: "deleted" }, cloud = {} } = {}) {+ let clock = 2_000_000;+ const timers = [];+ const w = {+ journal, keep: null, admin, asked: [], passes: [], opened: [], unfreezeFails: 0,+ server: { marker: structuredClone(marker), on: { "routine:r1": true, "webhook:w1": true }, thaws: [] },+ cloud: { origin: MINE, account: "acct-1", machine: MINE, ready: true, moves: true, ended: false, paid: true, verified: true, ...cloud },+ advance(ms) { clock += ms; },+ async tick() { const due = timers.splice(0); for (const timer of due) timer.work(); await w.home.kick(); },+ };+ const frozen = () => Boolean(w.server.marker?.frozen);+ w.home = createOneHome({+ journal: { read: () => structuredClone(w.journal), write: (value) => { w.journal = structuredClone(value); } },+ keep: { read: () => w.keep, write: (value) => { w.keep = value; } },+ cloud: () => (w.cloud ? { ...w.cloud } : null),+ gone: async (origin) => { w.asked.push(origin); const said = w.admin?.[origin]; return said === "deleted" || said === "ended" ? said : null; },+ send: { move: async (options) => { w.passes.push(options?.final ? "final" : "copy"); }, check: async () => ({ ok: true }), switches: () => ({ ...w.server.on }), snapshot: () => ({ running: null }) },+ local: {+ async freeze(origin) { w.server.marker = { frozen: true, cloud: origin }; return { frozen: true }; },+ async unfreeze(options) {+ if (w.unfreezeFails > 0) { w.unfreezeFails--; throw new Error("OpenMausBot on this computer could not go on again."); }+ w.server.thaws.push(options ?? null);+ if (options?.automations === "off") for (const key of Object.keys(w.server.on)) w.server.on[key] = false;+ w.server.marker = { frozen: false };+ },+ frozen: async () => frozen(),+ marker: async () => structuredClone(w.server.marker),+ async json(route) { if (route.startsWith("/api/bots")) return { bots: [] }; return { items: [], conversations: [], automations: [] }; },+ call: async () => reply(200),+ },+ session: async () => ({ call: async () => reply(200, { v: 1 }), close: async () => {} }),+ openHome: () => w.opened.push("cloud"),+ openLocal: () => w.opened.push("local"),+ lastInput: () => 0,+ version: "0.1.138",+ now: () => clock,+ timers: { set: (work, ms) => { const timer = { work, ms }; timers.push(timer); return timer; }, clear: (timer) => { const at = timers.indexOf(timer); if (at >= 0) timers.splice(at, 1); } },+ });+ return w;+}++const doneTo = (origin, extra = {}) => ({ v: 1, phase: "done", cloud: { origin, account: "acct-1", machine: origin }, startedAt: 1_000, doneAt: 1_500, frozenAt: 1_400, version: "0.1.138", lent: true, phoneStopped: true, ...extra });++test("a computer stuck today (no journal, the freeze names a deleted Cloud of the same account, My Cloud another Cloud) comes home by itself once, with every automation off", async () => {+ const w = computer();+ await w.home.kick();+ assert.deepEqual(w.asked, [GONE], "the Admin is asked about the Cloud the freeze names, not My Cloud");+ assert.deepEqual(w.server.thaws, [{ automations: "off" }]);+ assert.equal(w.server.marker.frozen, false);+ assert.deepEqual(w.server.on, { "routine:r1": false, "webhook:w1": false }, "nothing runs twice");+ assert.equal(w.journal.phase, "back");+ assert.equal(w.journal.gone, "deleted");+ assert.deepEqual(w.journal.cloud, { origin: GONE, account: "acct-1", machine: GONE });+ assert.deepEqual(w.opened, ["local"]);+ assert.equal(w.keep?.on, true, "its bots stay here: no move to My Cloud starts by itself");+ assert.deepEqual(w.home.view(), { phase: "back", gone: true });+ // Said once: closed, it is gone for good, and nothing loops.+ w.home.seen();+ assert.equal(w.home.view(), null);+ for (let launch = 0; launch < 3; launch++) { w.advance(QUIET_MS + 1); await w.tick(); }+ assert.deepEqual(w.server.thaws, [{ automations: "off" }], "lifted once");+ assert.deepEqual(w.passes, [], "nothing of this computer goes to My Cloud");+ assert.equal(w.journal.phase, "back");+ assert.equal(moveStatus({ journal: w.journal, state: { status: "connected", account: { id: "acct-1" }, machine: { status: "ready", origin: MINE, moves: true } }, kept: w.home.keeps(), now: 0 }).reason, "keep_here");+});++test("a Cloud that ended and is not My Cloud any more brings this computer home too", async () => {+ const w = computer({ admin: { [GONE]: "ended" } });+ await w.home.kick();+ assert.equal(w.journal.gone, "ended");+ assert.deepEqual(w.server.thaws, [{ automations: "off" }]);+});++test("the freeze is never lifted without the Admin's verified word: an Admin that can't say, a session not verified, signed out, or a Cloud none of this account's", async () => {+ for (const [name, setup] of [+ ["an older Admin, or one that can't be reached", { admin: {} }],+ ["the Cloud is still there", { admin: { [GONE]: "live" } }],+ ["another account's Cloud (unknown to this one)", { admin: { [GONE]: "unknown" } }],+ ["a session not verified now", { cloud: { verified: false } }],+ ]) {+ const w = computer(setup);+ await w.home.kick();+ assert.deepEqual(w.server.thaws, [], name);+ assert.equal(w.server.marker.frozen, true, name);+ assert.equal(w.journal, null, name);+ assert.equal(w.home.facts().noted, "frozen_without_move", name);+ }+ const out = computer();+ out.cloud = null;+ await out.home.kick();+ assert.deepEqual([out.asked, out.server.thaws], [[], []], "signed out: nothing is asked");+});++test("a freeze for a server of the person's own, one that names no Cloud, or one for My Cloud itself is never asked about", async () => {+ for (const marker of [{ frozen: true, cloud: GONE, place: "Home box" }, { frozen: true }, { frozen: true, cloud: MINE }]) {+ const w = computer({ marker, admin: { [GONE]: "deleted", [MINE]: "deleted" } });+ await w.home.kick();+ assert.deepEqual([w.asked, w.server.thaws], [[], []], JSON.stringify(marker));+ }+});++test("the journal's Cloud deleted while My Cloud is another: home with every automation off, and no top-up ever goes to the other Cloud", async () => {+ const w = computer({ journal: doneTo(GONE, { version: "0.1.120" }) });+ w.admin = {};+ await w.home.kick();+ assert.deepEqual(w.passes, [], "a newer app's top-up only ever goes to the Cloud this computer moved to");+ assert.deepEqual(w.server.thaws, []);+ w.admin = { [GONE]: "deleted" };+ w.advance(GONE_ASK_MS);+ await w.home.kick();+ assert.deepEqual(w.server.thaws, [{ automations: "off" }]);+ assert.equal(w.journal.phase, "back");+ assert.equal(w.journal.gone, "deleted");+ assert.equal(w.journal.frozenAt, 1_400, "what the journal knew stays");+ assert.deepEqual(w.home.view(), { phase: "back", gone: true });+});++test("My Cloud ended, but this computer moved to another Cloud that goes on: it stays moved, and nothing comes home", async () => {+ const w = computer({ journal: doneTo(GONE), admin: { [GONE]: "live" }, cloud: { ended: true, ready: false, homecoming: { installationId: "x".repeat(43), name: "MacBook Air" } } });+ await w.home.kick();+ assert.deepEqual(w.server.thaws, []);+ assert.equal(w.journal.phase, "done");+});++test("My Cloud ending is still the one signal for the Cloud this computer moved to itself", async () => {+ const w = computer({ journal: doneTo(MINE), marker: { frozen: true, cloud: MINE }, cloud: { ended: true, ready: false } });+ await w.home.kick();+ assert.deepEqual(w.asked, [], "My Cloud's own word, as before");+ assert.equal(w.journal.phase, "back");+ assert.equal(w.journal.lost, true);+ assert.equal(w.journal.gone, undefined);+ assert.deepEqual(w.server.thaws, [null], "its automations come back as they were, as before");+});++test("another account signed in: the journal's account decides, as before, and nothing is asked", async () => {+ const w = computer({ journal: doneTo(GONE), cloud: { account: "acct-2" } });+ await w.home.kick();+ assert.deepEqual([w.asked, w.server.thaws, w.journal.phase], [[], [], "done"]);+});++test("a move not switched over yet, while My Cloud became another Cloud: the freeze lifts and the move stops, as when My Cloud ends", async () => {+ const w = computer({ journal: { ...doneTo(GONE), phase: "final", frozenAt: 1_400 }, admin: {} });+ await w.home.kick();+ assert.deepEqual(w.server.thaws, [null]);+ assert.equal(w.journal, null);+ assert.deepEqual(w.passes, [], "nothing more goes to the other Cloud in that move");+});++test("already home and waiting for a gone Cloud's things: it stops waiting", async () => {+ const w = computer({ journal: { ...doneTo(GONE), phase: "home-again", endedAt: 1_600, retryAt: 9_999_999 }, marker: { frozen: false } });+ await w.home.kick();+ assert.equal(w.journal.phase, "back");+ assert.equal(w.journal.lost, true);+ assert.deepEqual(w.server.thaws, [], "already open: its automations are left as they are");+});++test("a copy that can't open yet is tried again a minute later, and then once only", async () => {+ const w = computer();+ w.unfreezeFails = 1;+ await w.home.kick();+ assert.equal(w.server.marker.frozen, true);+ assert.equal(w.journal, null);+ w.advance(60_000);+ await w.tick();+ assert.deepEqual(w.server.thaws, [{ automations: "off" }]);+ assert.equal(w.journal.phase, "back");+});++test("the Admin is asked about a Cloud at most every GONE_ASK_MS while it says nothing that brings this computer home, per account; gone stays gone", async () => {+ let clock = 0, said = "live", who = "acct-1";+ const asks = [];+ const gone = createGoneCheck({ ask: async (origin) => { asks.push(origin); if (said === "throw") throw new Error("offline"); return said; }, account: () => who, now: () => clock });+ assert.equal(await gone(GONE), null);+ assert.equal(await gone(GONE), null);+ assert.equal(asks.length, 1);+ said = "throw"; clock += GONE_ASK_MS;+ assert.equal(await gone(GONE), null, "an Admin that can't be asked is no word");+ said = "deleted"; clock += GONE_ASK_MS;+ assert.equal(await gone(GONE), "deleted");+ said = "live"; clock += GONE_ASK_MS;+ assert.equal(await gone(GONE), "deleted", "gone stays gone");+ who = "acct-2";+ assert.equal(await gone(GONE), null, "another account's answer is its own");+ who = null;+ assert.equal(await gone(GONE), null);+ assert.equal(asks.length, 4);+});++test("one home's view of the session says when it is the Admin's verified word", () => {+ const state = { status: "connected", account: { id: "acct-1" }, machine: { status: "ready", origin: MINE } };+ assert.equal(oneHomeCloud(state).verified, true);+ assert.equal(oneHomeCloud({ ...state, status: "unavailable" }).verified, false);+});++test("on their way home by the person's choice when the Cloud goes: what that way home would have switched on stays off", async () => {+ const w = computer({ journal: { ...doneTo(GONE), phase: "keeping", keptFrom: "done", keptAt: 1_700, switchBack: { "routine:r1": true }, webhooks: ["w1"], offThere: true } });+ w.keep = { v: 1, on: true };+ await w.home.kick();+ assert.deepEqual(w.server.thaws, [{ automations: "off" }]);+ assert.equal(w.journal.phase, "back");+ for (const field of ["switchBack", "webhooks", "keptFrom", "offThere"]) assert.equal(w.journal[field], undefined, field);+ await w.home.kick();+ assert.deepEqual(w.server.on, { "routine:r1": false, "webhook:w1": false });+});++test("a copy this computer already deleted still opens, and is not said to be back as it was", async () => {+ const w = computer({ journal: doneTo(GONE, { forgot: true }) });+ await w.home.kick();+ assert.equal(w.server.marker.frozen, false);+ assert.equal(w.journal.phase, "back");+ assert.equal(w.home.view(), null);+});++test("wired up for real: a stuck computer's own server is asked, the Admin's word comes from the sign-in, and the freeze lifts with automations off", async () => {+ const state = { status: "connected", deviceId: "device-2", account: { id: "acct-1" }, machine: { status: "ready", origin: MINE, moves: true } };+ const asked = [], requests = [];+ let frozen = true, kept = null, choice = null, opened = 0;+ const main = installOneHome({+ ipcMain: { handle: () => {} }, cloudPage: () => "local", server: () => null, home: () => null, cookieFetch: async () => new Response("{}", { status: 401 }),+ reconnect: async () => false, power: { asleep: () => false }, file: () => "/nonexistent/cloud-send.json", window: () => null, localOrigin: () => "http://127.0.0.1:4100",+ fetch: async () => new Response("{}", { status: 404 }),+ localRequest: async (route, init) => {+ requests.push([init?.method ?? "GET", route, init?.body ?? null]);+ if (route === "/api/move/freeze" && init?.method === "DELETE") { frozen = false; return new Response(JSON.stringify({ frozen: false })); }+ if (route === "/api/move/freeze") return new Response(JSON.stringify(frozen ? { frozen: true, cloud: GONE } : { frozen: false }));+ return new Response("{}", { status: 404 });+ },+ account: () => ({ state: () => state, movedTo: async (origin) => { asked.push(origin); return "deleted"; } }),+ journalFile: () => "/nonexistent/one-home.json", tempRoot: () => "/nonexistent", openLocal: () => { opened++; },+ journal: { read: () => kept, write: (value) => { kept = value; } }, keep: { read: () => choice, write: (value) => { choice = value; } },+ });+ try {+ await main.kick();+ assert.deepEqual(asked, [GONE]);+ assert.deepEqual(requests.find(([method]) => method === "DELETE"), ["DELETE", "/api/move/freeze", JSON.stringify({ automations: "off" })]);+ assert.equal(frozen, false);+ assert.deepEqual([kept.phase, kept.gone, kept.cloud.account, choice?.on, opened], ["back", "deleted", "acct-1", true, 1]);+ } finally { main.close(); }+});++test("My Cloud held with no address gives no sign of being another Cloud: it comes home as it always did, with its automations as they were", async () => {+ const w = computer({ journal: doneTo(GONE), admin: { [GONE]: "ended" }, cloud: { origin: null, machine: null, ready: false, ended: true } });+ await w.home.kick();+ assert.deepEqual(w.asked, []);+ assert.deepEqual(w.server.thaws, [null]);+ assert.equal(w.journal.gone, undefined);+ assert.equal(w.journal.phase, "back");+});diff --git a/electron/one-home-main.d.mts b/electron/one-home-main.d.mtsindex 0abefc5e21..c33911d509 100644--- a/electron/one-home-main.d.mts+++ b/electron/one-home-main.d.mts@@ -7,6 +7,9 @@ export function oneHomeCloud(state: unknown): OneHomeCloud | null;export function freezeAnswer(got: { ok: boolean; status: number; body: any }): { frozen: true } | { busy: string; what?: string };export type KeepHereState = import("./cloud-send.mjs").KeepHereState;export function installationOf(environmentId: string): string;+export declare const GONE_ASK_MS: number;+/** One home's `gone(origin)`, from the Admin's word (`ask`), kept per account. */+export function createGoneCheck(deps: { ask(origin: string): Promise<string | null>; account(): string | null; now?(): number }): (origin: string) => Promise<"deleted" | "ended" | null>;type SendDeps = Parameters<typeof installCloudSend>[0];@@ -16,6 +19,7 @@ export function installOneHome(deps: Omit<SendDeps, "local" | "move" | "moveSess/** The MausBot Cloud sign-in (cloud-account.mjs). */account(): { state(): any; pairHome(): Promise<{ origin: string; code: string; expiresAt?: number }>; exportHome(options?: { installation?: string }): Promise<any>;reportMove?(options: { installation: string }): Promise<boolean>; reportKept?(options: { installation: string }): Promise<boolean>;+ movedTo?(origin: string): Promise<"deleted" | "ended" | "live" | "unknown" | null>;reportMoveStatus?(report: import("./move-status.mjs").MoveStatusReport): Promise<boolean>;pairTeam(teamId: string): Promise<{ origin: string; code: string; expiresAt?: number }> } | null;journalFile(): string;diff --git a/electron/one-home-main.mjs b/electron/one-home-main.mjsindex 5a3b4626a0..039fa50c0f 100644--- a/electron/one-home-main.mjs+++ b/electron/one-home-main.mjs@@ -1,7 +1,8 @@// Main's side of the one-time move to My Cloud (one-home.mjs) and of the send it runs (cloud-send-main.mjs): its// journal, this computer's server's freeze, My Cloud's owner sessions, the person's typing, and coming home when My// Cloud ends (one-home-again.mjs). The Admin's word decides: a move starts only for an account it lets move, to a Cloud-// that is ready, and a Cloud it holds after it ended is the one signal that brings everything home. The person's own+// that is ready, and a Cloud it holds after it ended brings everything home, as does its word that the Cloud this computer+// moved to is gone while My Cloud is another (`gone`). The person's own// choice to keep this computer's bots here (Settings → MausBot Cloud, Advanced) is kept beside the journal.import { createHash } from "node:crypto";import { createReadStream, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";@@ -52,6 +53,30 @@ export function oneHomeCloud(state) {paid: connected && state.entitlement?.status === "active" && !trialOn && !teamPlan(state),...(homecoming ? { homecoming: { installationId: homecoming.installationId, name: homecoming.name } } : {}),...(connected && typeof state.deviceId === "string" && state.deviceId ? { signIn: state.deviceId } : {}),+ verified: connected,+ };+}++/** How long an answer that leaves this computer where it is ("live", "unknown", none) stands before the Admin is asked+ * again about the same Cloud. */+export const GONE_ASK_MS = 10 * 60_000;++/** One home's `gone(origin)`: `ask(origin)` is the Admin's word on this account's Cloud at `origin` (cloud-account.mjs+ * `movedTo`), kept per account (`account()`): a Cloud found gone stays gone; any other answer, or a failed ask, is asked+ * again only after GONE_ASK_MS. */+export function createGoneCheck({ ask, account, now = Date.now }) {+ const asked = new Map();+ return async (origin) => {+ const who = account();+ if (!who) return null;+ const key = `${who} ${origin}`, last = asked.get(key);+ if (last?.gone) return last.gone;+ if (last && now() - last.at < GONE_ASK_MS) return null;+ asked.set(key, { at: now(), gone: null });+ const said = await ask(origin).catch(() => null);+ const gone = said === "deleted" || said === "ended" ? said : null;+ asked.set(key, { at: now(), gone });+ return gone;};}@@ -204,11 +229,13 @@ export function installOneHome({ localRequest, account, journalFile, tempRoot, lif (!got.ok) throw Object.assign(new Error("OpenMausBot on this computer could not go on again."), { status: got.status });},frozen: async () => (await local.json("/api/move/freeze"))?.frozen === true,+ marker: () => local.json("/api/move/freeze"),async forget() {const got = await local.call("POST", "/api/move/forget");if (!got.ok) throw Object.assign(new Error("This computer's copy could not be deleted."), { status: got.status });},},+ gone: createGoneCheck({ ask: async (origin) => (await account()?.movedTo?.(origin)) ?? null, account: () => account()?.state()?.account?.id ?? null }),session: () => moveSession.open(target()),release: () => moveSession.end(),lend, phone, openHome, openLocal, restart, version, log,diff --git a/electron/one-home.d.mts b/electron/one-home.d.mtsindex c8d6118713..d004fa3a7d 100644--- a/electron/one-home.d.mts+++ b/electron/one-home.d.mts@@ -16,8 +16,10 @@ type OneHomePhase =| { phase: "keeping"; updating?: true }/** My Cloud ended: this computer is home again; `back`: My Cloud's own changes came back too, unless `lost`; or, with* `elsewhere`, they came back to that other computer and this one keeps its own copy from `since`, with automations off.- * `kept`: My Cloud goes on, and this computer's bots came home because the person keeps them here. */- | { phase: "home-again" | "back"; lost?: true; elsewhere?: { name: string; since?: number }; kept?: true };+ * `kept`: My Cloud goes on, and this computer's bots came home because the person keeps them here. `gone`: the Cloud this+ * computer moved to was deleted, or ended while another Cloud is My Cloud; its own copy is open as it was at the move, with+ * every automation off. */+ | { phase: "home-again" | "back"; lost?: true; elsewhere?: { name: string; since?: number }; kept?: true; gone?: true };export interface OneHomeCounts { bots: number; skills: number; logins: number; onePassword: boolean; chats: number; routines: number }export interface OneHomeCloud {@@ -28,6 +30,8 @@ export interface OneHomeCloud {homecoming?: { installationId: string; name: string };/** This app's sign-in (the Admin's device id), while connected. */signIn?: string;+ /** The Admin answered this sign-in just now (connected), so its word on the person's Clouds counts. */+ verified?: boolean;}type Answer = { ok: boolean; status: number; body: any };@@ -60,7 +64,12 @@ export function createOneHome(deps: {json(route: string): Promise<any>;call(method: string, route: string, body?: unknown): Promise<Answer>;forget?(): Promise<void>;+ /** This computer's freeze marker: the Cloud it names (`cloud`), or the server of the person's own (`place`). */+ marker?(): Promise<{ frozen: boolean; cloud?: string; place?: string }>;};+ /** The Admin's word that this account's Cloud at `origin` is gone: deleted, or ended (stopped and kept only until it is+ * deleted); null for anything else, and while it can't be asked. */+ gone?(origin: string): Promise<"deleted" | "ended" | null>;session(): Promise<{ call(method: string, route: string, body?: unknown): Promise<Answer>; close(): Promise<void> }>;/** My Cloud's session is no longer needed: the move is done, paused, or not this account's. */release?(): Promise<void>;diff --git a/electron/one-home.mjs b/electron/one-home.mjsindex 9d5f56597c..4a5159fc39 100644--- a/electron/one-home.mjs+++ b/electron/one-home.mjs@@ -14,7 +14,11 @@// back what was done on My Cloud while the Admin still holds it (one-home-again.mjs) and switches on what was on there// (`back`). Once done, the Admin is told once per sign-in that this computer moved, so it can be the one an ended Cloud's// things come home to. When the Admin names another computer as that one, this one only opens its own copy, with every-// automation off, and says where the bots went (`back` with `elsewhere`).+// automation off, and says where the bots went (`back` with `elsewhere`). When the Cloud this computer moved to is gone and+// is not My Cloud any more (deleted, or ended while another Cloud is My Cloud), by the Admin's word on that Cloud, this+// computer opens its own copy as it was at the move, with every automation off, keeps its bots here, and says so once+// (`back` with `gone`). That word is asked for the journal's Cloud, or for the Cloud the freeze names when this app kept no+// journal.//// A person may keep this computer's bots on this computer (`keep`, its own choice, kept on this computer). Then no move// starts, and one under way stops before the switch as the Admin's kill switch stops it. Once this computer has moved,@@ -78,6 +82,10 @@ const stageOf = (phase) => (phase === "freeze" ? "wait" : phase);/** A failure of the move's own, with the code it is reported by. */const tagged = (message, code, extra = {}) => Object.assign(new Error(message), { code, ...extra });+/** The session's My Cloud is known to be another Cloud than the one at `origin`. A held Cloud that names no address gives no+ * sign of being another, so it is taken for that one. */+const anotherCloud = (cloud, origin) => cloud.origin !== origin && !(cloud.ended && !cloud.origin);+/** A journal read back, kept to its known shape; null when there is none. */export function parseJournal(value) {if (!record(value) || value.v !== 1 || !PHASES.has(value.phase) || !record(value.cloud) || typeof value.cloud.origin !== "string" || typeof value.cloud.account !== "string") return null;@@ -138,10 +146,12 @@ export function arrivedCounts(here, there) {* @param {{* journal: { read(): unknown, write(value: unknown): void },* cloud(): null | { origin: string | null, account: string, machine: string | null, ready: boolean, moves: boolean, ended: boolean, paid: boolean,- * homecoming?: { installationId: string, name: string }, signIn?: string },+ * homecoming?: { installationId: string, name: string }, signIn?: string, verified?: boolean },* send: { move(options?: { final?: boolean }): Promise<unknown>, check(): Promise<{ ok: boolean }>, switches(): Record<string, boolean>, snapshot(): any },* local: { freeze(origin: string): Promise<{ frozen: true } | { busy: string, what?: string }>, unfreeze(options?: { automations?: "off" }): Promise<void>, frozen(): Promise<boolean>, json(route: string): Promise<any>,- * call(method: string, route: string, body?: unknown): Promise<{ ok: boolean, status: number, body: any }>, forget?(): Promise<void> },+ * call(method: string, route: string, body?: unknown): Promise<{ ok: boolean, status: number, body: any }>, forget?(): Promise<void>,+ * marker?(): Promise<{ frozen: boolean, cloud?: string, place?: string }> },+ * gone?(origin: string): Promise<"deleted" | "ended" | null>,* session(): Promise<{ call(method: string, route: string, body?: unknown): Promise<{ ok: boolean, status: number, body: any }>, close(): Promise<void> }>,* release?(): Promise<void>,* lend?(projects: string[]): Promise<unknown>,@@ -162,7 +172,9 @@ export function arrivedCounts(here, there) {* now?(): number,* timers?: { set(work: () => void, ms: number): unknown, clear(timer: unknown): void },* log?(line: string): void,- * }} deps+ * }} deps `gone(origin)`: the Admin's word that this account's Cloud at `origin` is gone ("deleted", or "ended": stopped+ * and kept only until it is deleted); null for anything else, and while it can't be asked. `cloud().verified`: the Admin+ * answered this sign-in just now (connected). `local.marker()`: this computer's freeze marker.*/export function createOneHome(deps) {const now = deps.now ?? Date.now;@@ -202,7 +214,8 @@ export function createOneHome(deps) {if (journal.phase === "done") return { phase: "done", ...(Number.isSafeInteger(journal.doneAt) ? { at: journal.doneAt } : {}), ...(journal.counts ? { counts: journal.counts } : {}), phone: journal.phone === true, held: journal.held ?? [] };if (journal.phase === "keeping") return { phase: "keeping", ...(journal.updating ? { updating: true } : {}) };if (journal.phase === "home-again" || journal.phase === "back") {- return { phase: journal.phase, ...(journal.lost ? { lost: true } : {}), ...(journal.elsewhere ? { elsewhere: journal.elsewhere } : {}), ...(journal.kept ? { kept: true } : {}) };+ return { phase: journal.phase, ...(journal.lost ? { lost: true } : {}), ...(journal.elsewhere ? { elsewhere: journal.elsewhere } : {}), ...(journal.kept ? { kept: true } : {}),+ ...(journal.phase === "back" && journal.gone ? { gone: true } : {}) };}const running = deps.send.snapshot?.()?.running;const chats = journal.phase === "copy" && running?.phase === "chats" && running.progress ? { done: running.progress.done, total: running.progress.total } : null;@@ -402,6 +415,56 @@ export function createOneHome(deps) {return null;}+ /** The Cloud this computer is frozen for (`from`: the journal, or what the freeze names) is gone and My Cloud is another+ * Cloud or none, by the Admin's word on that Cloud: this computer opens its own copy as it was at the move, with every+ * automation off (the person may have set things up again elsewhere), keeps its bots here so no move starts by itself,+ * and says so once. Nothing is asked of a Cloud that no longer exists. One already home, bringing that Cloud's things+ * back, only stops waiting for them. */+ async function cameHomeGone(from, gone) {+ if (from.phase === "home-again") { write({ ...from, phase: "back", lost: true, retryAt: undefined }); return; }+ try { await deps.local.unfreeze({ automations: "off" }); }+ catch (error) { log(`one home: could not open this computer's copy yet (${error?.message ?? error})`); later(MINUTE); return; }+ try { deps.keep?.write({ v: 1, on: true, at: now() }); } catch {}+ // A way home already under way ends here: what it would have switched on here stays off.+ const { retryAt: _retry, switchBack: _back, webhooks: _hooks, keptFrom: _from, keptAt: _at, offThere: _off, thawed: _thawed, updating: _updating, ...rest } = from;+ log(`one home: the Cloud this computer moved to is ${gone}; its own copy is open again, with every automation off`);+ // A copy already deleted has nothing to say "as they were" about.+ write({ ...rest, v: 1, phase: "back", gone, endedAt: from.endedAt ?? now(), told: from.forgot ? true : undefined });+ deps.openLocal?.();+ }++ /** The Cloud this computer is frozen for, when it is not My Cloud now and the Admin's verified word on it may bring this+ * computer home: the journal's while home is there (or on its way back from it), else the Cloud the freeze names when+ * this app kept no journal of it. Never a server of the person's own (`place`), nor one another account moved to. */+ async function frozenFor(journal, cloud) {+ if (!cloud?.verified || !deps.gone) return null;+ if (journal && (awayIn(journal) || journal.phase === "home-again")) return anotherCloud(cloud, journal.cloud.origin) ? journal : null;+ if (journal && journal.phase !== "back") return null;+ const marker = await deps.local.marker?.().catch(() => null);+ if (!marker?.frozen || marker.place || typeof marker.cloud !== "string" || marker.cloud === cloud.origin) return null;+ return { v: 1, cloud: { origin: marker.cloud, account: cloud.account, machine: marker.cloud }, startedAt: now() };+ }++ /** Whether the Cloud this computer is frozen for is gone, so this run only brings it home (cameHomeGone). */+ async function goneHome(journal, cloud) {+ const from = await frozenFor(journal, cloud);+ if (!from) return false;+ const gone = await deps.gone(from.cloud.origin).catch(() => null);+ if (gone !== "deleted" && gone !== "ended") return false;+ await cameHomeGone(from, gone);+ return true;+ }++ /** My Cloud's word as it bears on this journal: what the session says of My Cloud is said of the Cloud this computer+ * moved to only while they are the same Cloud. While My Cloud is another Cloud (or none), the one moved to neither ends+ * nor takes a top-up by that word, and a move not yet switched over stops as it does when My Cloud ends (nothing runs+ * there yet). Only a verified session's word, for the journal's own account. */+ function judged(cloud, journal) {+ if (!cloud?.verified || !journal || journal.phase === "back" || cloud.account !== journal.cloud.account || !anotherCloud(cloud, journal.cloud.origin)) return cloud;+ const { homecoming: _, ...rest } = cloud;+ return awayIn(journal) || journal.phase === "home-again" ? { ...rest, ready: false, ended: false } : { ...rest, ended: true };+ }+/** My Cloud ended: this computer is home again at once, as it was at the move, then brings back what was done there. */async function homeAgain(journal) {let next = journal;@@ -530,7 +593,7 @@ export function createOneHome(deps) {async function run() {noted = null;let journal = read();- const cloud = deps.cloud();+ const said = deps.cloud(), cloud = judged(said, journal);// A move left off while My Cloud was away goes on as soon as it is back, unless it failed frozen: that waits its hour.const cameBack = cloud?.ready === true && wasReady === false;wasReady = cloud ? cloud.ready : null;@@ -541,6 +604,7 @@ export function createOneHome(deps) {await deps.release?.();return;}+ if (await goneHome(journal, said)) return;if (journal?.phase === "back" && journal.switchBack) {await switchBack(journal);journal = read();diff --git a/electron/one-home.node-test.mjs b/electron/one-home.node-test.mjsindex ace13e803f..7cd8e110f3 100644--- a/electron/one-home.node-test.mjs+++ b/electron/one-home.node-test.mjs@@ -371,7 +371,7 @@ test("a newer app tops up once from the frozen copy, which is deleted 30 days aftest("one home reads the Admin's word: a ready Cloud the account may move to, and a held one that ended", () => {const state = (machine, extra = {}) => ({ status: "connected", account: { id: "acct-1" }, entitlement: { status: "active" }, machine, ...extra });assert.equal(oneHomeCloud({ status: "signed-out" }), null);- assert.deepEqual(oneHomeCloud(state({ status: "ready", origin: CLOUD, moves: true })), { origin: CLOUD, account: "acct-1", machine: CLOUD, ready: true, moves: true, ended: false, paid: true });+ assert.deepEqual(oneHomeCloud(state({ status: "ready", origin: CLOUD, moves: true })), { origin: CLOUD, account: "acct-1", machine: CLOUD, ready: true, moves: true, ended: false, paid: true, verified: true });assert.equal(oneHomeCloud(state({ status: "ready", origin: CLOUD })).moves, false, "no move unless the Admin lets this account move");assert.equal(oneHomeCloud(state({ status: "stopped", hold: { until: 5 } })).ended, true);assert.equal(oneHomeCloud(state({ status: "stopped" })).ended, false, "stopped alone is not ended");@@ -379,7 +379,7 @@ test("one home reads the Admin's word: a ready Cloud the account may move to, anassert.equal(oneHomeCloud({ ...state({ status: "ready", origin: CLOUD, moves: true }), status: "unavailable" }).ready, false);const team = [{ id: "team-acme", name: "Acme", role: "owner", machine: { status: "ready", origin: "https://omb-t-2.fly.dev", moves: true } }];assert.deepEqual(oneHomeCloud(state(undefined, { entitlement: { plan: "pro", tier: "team", status: "active" }, teams: team })),- { origin: null, account: "acct-1", machine: null, ready: false, moves: false, ended: false, paid: false }, "a Team plan has no My Cloud: nothing moves, and nothing here counts as paid for");+ { origin: null, account: "acct-1", machine: null, ready: false, moves: false, ended: false, paid: false, verified: true }, "a Team plan has no My Cloud: nothing moves, and nothing here counts as paid for");});test("automations switch on through their own routes, and the done line counts only what both sides hold", () => {diff --git a/src/lib/cloud-send.test.ts b/src/lib/cloud-send.test.tsindex e5f44885b9..0abf5c2c7a 100644--- a/src/lib/cloud-send.test.ts+++ b/src/lib/cloud-send.test.ts@@ -88,3 +88,11 @@ describe("the line on a computer whose bots come home because the person keeps texpect(moveLine({ phase: "back", kept: true }, "cloud")).toBeNull();});});++describe("the line on a computer whose Cloud is gone while My Cloud is another", () => {+ it("says once, on this computer only, that the bots are back as they were at the move, with their automations off", () => {+ expect(moveLine({ phase: "back", gone: true }, "local")).toEqual({ kind: "done", extra: [],+ text: "The Cloud your bots moved to has ended, so they're back on this computer as they were when they moved. Their automations are off: switch on the ones you want." });+ expect(moveLine({ phase: "back", gone: true }, "cloud")).toBeNull();+ });+});diff --git a/src/lib/cloud-send.ts b/src/lib/cloud-send.tsindex c0749930f7..9cd0ef7189 100644--- a/src/lib/cloud-send.ts+++ b/src/lib/cloud-send.ts@@ -68,6 +68,7 @@ export function moveLine(move: OneHomeView, page: "local" | "cloud"): { kind: "sif (move.phase === "home-again" || move.phase === "back") {if (page !== "local") return null;if (move.phase === "back" && move.kept) return { kind: "done", text: t("cloudSend.move.kept"), extra: [] };+ if (move.phase === "back" && move.gone) return { kind: "done", text: t("cloudSend.move.backGone"), extra: [] };const elsewhere = move.phase === "back" ? move.elsewhere : undefined;if (elsewhere) {return { kind: "done", extra: [], text: elsewhere.sincediff --git a/src/locales/de.json b/src/locales/de.jsonindex 5117acbcc5..c50fabdcc3 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -2339,6 +2339,7 @@"cloudSend.move.homeAgain": "Deine Cloud ist beendet, deshalb sind deine Bots wieder auf diesem Computer. Was du in der Cloud gemacht hast, kommt auch zurück.","cloudSend.move.back": "Deine Cloud ist beendet, deshalb sind deine Bots wieder auf diesem Computer, mit allem, was du in der Cloud gemacht hast. Logins und Schlüssel, die du in der Cloud hinzugefügt hast, sind nicht zurückgekommen: Füge sie hier wieder hinzu, wenn du sie brauchst.","cloudSend.move.backLost": "Deine Cloud ist beendet, deshalb sind deine Bots wieder auf diesem Computer, so wie sie beim Umzug waren. Was du seitdem in der Cloud gemacht hast, konnte nicht zurückkommen.",+ "cloudSend.move.backGone": "Die Cloud, in die deine Bots umgezogen sind, ist beendet, deshalb sind sie wieder auf diesem Computer, so wie sie beim Umzug waren. Ihre Automatisierungen sind ausgeschaltet: Schalte die ein, die du willst.","cloudSend.move.elsewhere": "Deine Bots sind zurück auf {name}. Dieser Computer behält seine Kopie vom {date}, mit ausgeschalteten Automatisierungen.","cloudSend.move.elsewhereEmpty": "Deine Bots sind zurück auf {name}.","homeScreen.openingNamed": "{name} wird geöffnet…",diff --git a/src/locales/en.json b/src/locales/en.jsonindex 7818d0286b..312f702f85 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -1206,6 +1206,7 @@"cloudSend.move.homeAgain": "My Cloud has ended, so your bots are back on this computer. What you did on My Cloud is on its way back too.","cloudSend.move.back": "My Cloud has ended, so your bots are back on this computer, with what you did on My Cloud. Logins and keys you added on My Cloud didn't come back: add them here again if you need them.","cloudSend.move.backLost": "My Cloud has ended, so your bots are back on this computer as they were when they moved. What you did on My Cloud since couldn't come back.",+ "cloudSend.move.backGone": "The Cloud your bots moved to has ended, so they're back on this computer as they were when they moved. Their automations are off: switch on the ones you want.","cloudSend.move.elsewhere": "Your bots came back to {name}. This computer keeps its copy from {date}, with automations off.","cloudSend.move.elsewhereEmpty": "Your bots came back to {name}.","cloudSend.move.keeping": "Bringing this computer's bots back from My Cloud…",diff --git a/src/locales/es.json b/src/locales/es.jsonindex 72199ae542..2e789d2165 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -5449,6 +5449,7 @@"cloudSend.move.homeAgain": "Tu Cloud terminó, así que tus bots volvieron a este equipo. Lo que hiciste en la Cloud también está volviendo.","cloudSend.move.back": "Tu Cloud terminó, así que tus bots volvieron a este equipo, con lo que hiciste en la Cloud. Los inicios de sesión y las claves que agregaste en la Cloud no volvieron: agrégalos aquí de nuevo si los necesitas.","cloudSend.move.backLost": "Tu Cloud terminó, así que tus bots volvieron a este equipo tal como estaban cuando se fueron. Lo que hiciste en la Cloud desde entonces no pudo volver.",+ "cloudSend.move.backGone": "La Cloud a la que se fueron tus bots terminó, así que volvieron a este equipo tal como estaban cuando se fueron. Sus automatizaciones están apagadas: activa las que quieras.","cloudSend.move.elsewhere": "Tus bots volvieron a {name}. Este equipo conserva su copia del {date}, con las automatizaciones apagadas.","cloudSend.move.elsewhereEmpty": "Tus bots volvieron a {name}.","homeScreen.openingNamed": "Abriendo {name}…",diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex a767fa7537..2f5eef1c5b 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -2311,6 +2311,7 @@"cloudSend.move.homeAgain": "Ton Cloud a pris fin, donc tes bots sont de retour sur cet ordinateur. Ce que tu as fait dans le Cloud revient aussi.","cloudSend.move.back": "Ton Cloud a pris fin, donc tes bots sont de retour sur cet ordinateur, avec ce que tu as fait dans le Cloud. Les identifiants et les clés ajoutés dans le Cloud ne sont pas revenus : ajoute-les ici à nouveau si tu en as besoin.","cloudSend.move.backLost": "Ton Cloud a pris fin, donc tes bots sont de retour sur cet ordinateur tels qu'ils étaient au moment du déménagement. Ce que tu as fait dans le Cloud depuis n'a pas pu revenir.",+ "cloudSend.move.backGone": "Le Cloud où tes bots avaient déménagé a pris fin, donc ils sont de retour sur cet ordinateur tels qu'ils étaient au moment du déménagement. Leurs automatisations sont désactivées : active celles que tu veux.","cloudSend.move.elsewhere": "Tes bots sont revenus sur {name}. Cet ordinateur garde sa copie du {date}, avec les automatisations désactivées.","cloudSend.move.elsewhereEmpty": "Tes bots sont revenus sur {name}.","homeScreen.openingNamed": "Ouverture de {name}…",diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex 5db336b475..6b410e9edf 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -2311,6 +2311,7 @@"cloudSend.move.homeAgain": "आपका Cloud खत्म हो गया है, इसलिए आपके बॉट वापस इस कंप्यूटर पर हैं। आपने Cloud पर जो किया, वह भी वापस आ रहा है।","cloudSend.move.back": "आपका Cloud खत्म हो गया है, इसलिए आपके बॉट वापस इस कंप्यूटर पर हैं, Cloud पर किए गए आपके काम के साथ। Cloud पर जोड़े गए लॉगिन और की वापस नहीं आए: ज़रूरत हो तो उन्हें यहाँ फिर से जोड़ें।","cloudSend.move.backLost": "आपका Cloud खत्म हो गया है, इसलिए आपके बॉट वापस इस कंप्यूटर पर वैसे ही हैं जैसे जाते समय थे। उसके बाद Cloud पर आपने जो किया, वह वापस नहीं आ सका।",+ "cloudSend.move.backGone": "जिस Cloud पर आपके बॉट गए थे, वह खत्म हो गया है, इसलिए वे वापस इस कंप्यूटर पर वैसे ही हैं जैसे जाते समय थे। उनके स्वचालन बंद हैं: जो चाहिए उन्हें चालू करें।","cloudSend.move.elsewhere": "आपके बॉट {name} पर वापस आ गए हैं। यह कंप्यूटर {date} वाली अपनी कॉपी रखता है, जिसमें स्वचालन बंद हैं।","cloudSend.move.elsewhereEmpty": "आपके बॉट {name} पर वापस आ गए हैं।","homeScreen.openingNamed": "{name} खोला जा रहा है…",diff --git a/src/locales/it.json b/src/locales/it.jsonindex 8e0ee90285..a9c0b3dbe5 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -1050,6 +1050,7 @@"cloudSend.move.homeAgain": "My Cloud è terminato, quindi i bot sono di nuovo su questo computer. Anche quello che hai fatto su My Cloud sta tornando.","cloudSend.move.back": "My Cloud è terminato, quindi i bot sono di nuovo su questo computer, con quello che hai fatto su My Cloud. Gli accessi e le chiavi che hai aggiunto su My Cloud non sono tornati: aggiungili di nuovo qui se ti servono.","cloudSend.move.backLost": "My Cloud è terminato, quindi i bot sono di nuovo su questo computer come erano quando si sono spostati. Quello che hai fatto su My Cloud da allora non è potuto tornare.",+ "cloudSend.move.backGone": "Il Cloud in cui si erano spostati i bot è terminato, quindi sono di nuovo su questo computer come erano quando si sono spostati. Le loro automazioni sono disattivate: attiva quelle che vuoi.","cloudSend.move.elsewhere": "I bot sono tornati su {name}. Questo computer conserva la sua copia del {date}, con le automazioni disattivate.","cloudSend.move.elsewhereEmpty": "I bot sono tornati su {name}.","cloudSend.move.keeping": "I bot di questo computer stanno tornando da My Cloud…",diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex 69c733c9e8..afc2693202 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -1071,6 +1071,7 @@"cloudSend.move.homeAgain": "Cloud が終了したため、ボットはこのコンピューターに戻りました。Cloud で行ったことも戻ってきています。","cloudSend.move.back": "Cloud が終了したため、ボットは Cloud で行ったことと一緒にこのコンピューターに戻りました。Cloud で追加したログインとキーは戻っていません。必要ならここでもう一度追加してください。","cloudSend.move.backLost": "Cloud が終了したため、ボットは移したときのままこのコンピューターに戻りました。その後 Cloud で行ったことは戻せませんでした。",+ "cloudSend.move.backGone": "ボットの移動先の Cloud が終了したため、ボットは移したときのままこのコンピューターに戻りました。自動化はオフになっています。使いたいものをオンにしてください。","cloudSend.move.elsewhere": "ボットは {name} に戻りました。このコンピューターには {date} 時点のコピーが残り、自動化はオフになっています。","cloudSend.move.elsewhereEmpty": "ボットは {name} に戻りました。","cloudSend.move.keeping": "このコンピュータのボットを My Cloud から戻しています…",diff --git a/src/locales/ko.json b/src/locales/ko.jsonindex 5cc9b2ad62..5ee6a336e3 100644--- a/src/locales/ko.json+++ b/src/locales/ko.json@@ -1125,6 +1125,7 @@"cloudSend.move.homeAgain": "내 클라우드가 종료되어 봇이 이 컴퓨터로 돌아왔어요. 내 클라우드에서 한 작업도 돌아오는 중이에요.","cloudSend.move.back": "내 클라우드가 종료되어 봇이 내 클라우드에서 한 작업을 가지고 이 컴퓨터로 돌아왔어요. 내 클라우드에서 추가한 로그인과 키는 돌아오지 않았으니 필요하면 여기서 다시 추가하세요.","cloudSend.move.backLost": "내 클라우드가 종료되어 봇이 옮겨 가던 때 모습 그대로 이 컴퓨터로 돌아왔어요. 그 뒤 내 클라우드에서 한 작업은 가져오지 못했어요.",+ "cloudSend.move.backGone": "봇이 옮겨 간 클라우드가 종료되어, 봇이 옮겨 가던 때 모습 그대로 이 컴퓨터로 돌아왔어요. 자동화는 꺼져 있어요. 원하는 것만 켜 주세요.","cloudSend.move.elsewhere": "봇이 {name}(으)로 돌아왔어요. 이 컴퓨터에는 {date} 시점의 사본이 자동화가 꺼진 상태로 남아 있어요.","cloudSend.move.elsewhereEmpty": "봇이 {name}(으)로 돌아왔어요.","cloudSend.move.keeping": "이 컴퓨터의 봇을 내 클라우드에서 다시 가져오는 중…",diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex 0f835a3cd3..d571e2595e 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -1064,6 +1064,7 @@"cloudSend.move.homeAgain": "My Cloud zakończyło działanie, więc boty wróciły na ten komputer. To, co powstało w My Cloud, też wraca.","cloudSend.move.back": "My Cloud zakończyło działanie, więc boty wróciły na ten komputer wraz z tym, co powstało w My Cloud. Loginy i klucze dodane w My Cloud nie wróciły: dodaj je tutaj ponownie, jeśli są potrzebne.","cloudSend.move.backLost": "My Cloud zakończyło działanie, więc boty wróciły na ten komputer w stanie z chwili przeniesienia. Późniejszych zmian z My Cloud nie udało się przywrócić.",+ "cloudSend.move.backGone": "Cloud, do którego przeniosły się boty, zakończył działanie, więc wróciły na ten komputer w stanie z chwili przeniesienia. Ich automatyzacje są wyłączone: włącz te, których chcesz.","cloudSend.move.elsewhere": "Boty wróciły do: {name}. Ten komputer zachowuje swoją kopię z {date}, z wyłączonymi automatyzacjami.","cloudSend.move.elsewhereEmpty": "Boty wróciły do: {name}.","cloudSend.move.keeping": "Przywracanie botów tego komputera z My Cloud…",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 677bdc3517..d2af64a0e2 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -6131,6 +6131,7 @@"cloudSend.move.homeAgain": "Seu Cloud terminou, então seus bots voltaram para este computador. O que você fez no Cloud também está voltando.","cloudSend.move.back": "Seu Cloud terminou, então seus bots voltaram para este computador, com o que você fez no Cloud. Os logins e as chaves que você adicionou no Cloud não voltaram: adicione-os aqui de novo se precisar.","cloudSend.move.backLost": "Seu Cloud terminou, então seus bots voltaram para este computador como estavam quando foram. O que você fez no Cloud desde então não pôde voltar.",+ "cloudSend.move.backGone": "O Cloud para onde seus bots foram terminou, então eles voltaram para este computador como estavam quando foram. As automações deles estão desligadas: ligue as que você quiser.","cloudSend.move.elsewhere": "Seus bots voltaram para {name}. Este computador mantém a própria cópia de {date}, com as automações desligadas.","cloudSend.move.elsewhereEmpty": "Seus bots voltaram para {name}.","homeScreen.openingNamed": "Abrindo {name}…",diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex 0c29033a7c..3f434af276 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -1070,6 +1070,7 @@"cloudSend.move.homeAgain": "Сеанс My Cloud завершён, поэтому ваши боты снова на этом компьютере. Всё, что вы сделали в My Cloud, тоже возвращается.","cloudSend.move.back": "Сеанс My Cloud завершён, поэтому ваши боты снова на этом компьютере — вместе со всем, что вы сделали в My Cloud. Данные для входа и ключи, добавленные в My Cloud, не вернулись: добавьте их здесь снова, если они нужны.","cloudSend.move.backLost": "Сеанс My Cloud завершён, поэтому ваши боты снова на этом компьютере — в том состоянии, в котором они были на момент переноса. Всё, что вы сделали в My Cloud после этого, вернуть не удалось.",+ "cloudSend.move.backGone": "Cloud, в который переехали ваши боты, закрыт, поэтому они снова на этом компьютере — в том состоянии, в котором были на момент переноса. Их автоматизации отключены: включите те, которые нужны.","cloudSend.move.elsewhere": "Ваши боты вернулись на {name}. Этот компьютер хранит свою копию от {date} с отключёнными автоматизациями.","cloudSend.move.elsewhereEmpty": "Ваши боты вернулись на {name}.","cloudSend.move.keeping": "Возвращаем ботов этого компьютера из My Cloud…",diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex 85680619cb..ad7cf35e38 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -4804,6 +4804,7 @@"cloudSend.move.homeAgain": "Cloud'un sona erdi, bu yüzden botların bu bilgisayara geri döndü. Cloud'da yaptıkların da geri geliyor.","cloudSend.move.back": "Cloud'un sona erdi, bu yüzden botların Cloud'da yaptıklarınla birlikte bu bilgisayara geri döndü. Cloud'da eklediğin girişler ve anahtarlar geri gelmedi: gerekiyorsa onları burada yeniden ekle.","cloudSend.move.backLost": "Cloud'un sona erdi, bu yüzden botların taşındıkları andaki hâliyle bu bilgisayara geri döndü. O zamandan beri Cloud'da yaptıkların geri gelemedi.",+ "cloudSend.move.backGone": "Botlarının taşındığı Cloud sona erdi, bu yüzden taşındıkları andaki hâliyle bu bilgisayara geri döndüler. Otomasyonları kapalı: istediklerini aç.","cloudSend.move.elsewhere": "Botların {name} cihazına geri döndü. Bu bilgisayar {date} tarihli kendi kopyasını tutuyor ve otomasyonlar kapalı.","cloudSend.move.elsewhereEmpty": "Botların {name} cihazına geri döndü.","homeScreen.openingNamed": "{name} açılıyor…",diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex fb1fb8c255..426226159f 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -2785,6 +2785,7 @@"cloudSend.move.homeAgain": "Твій Cloud завершився, тож твої боти знову на цьому комп’ютері. Те, що ти робив у Cloud, теж повертається.","cloudSend.move.back": "Твій Cloud завершився, тож твої боти знову на цьому комп’ютері разом із тим, що ти робив у Cloud. Логіни й ключі, які ти додав у Cloud, не повернулися: додай їх тут знову, якщо вони потрібні.","cloudSend.move.backLost": "Твій Cloud завершився, тож твої боти знову на цьому комп’ютері такими, якими були під час переїзду. Те, що ти робив у Cloud відтоді, не вдалося повернути.",+ "cloudSend.move.backGone": "Cloud, куди переїхали твої боти, завершився, тож вони знову на цьому комп’ютері такими, якими були під час переїзду. Їхні автоматизації вимкнені: увімкни ті, що потрібні.","cloudSend.move.elsewhere": "Твої боти повернулися на {name}. Цей комп’ютер зберігає свою копію від {date}, з вимкненими автоматизаціями.","cloudSend.move.elsewhereEmpty": "Твої боти повернулися на {name}.","homeScreen.openingNamed": "Відкриваємо {name}…",diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 1474e7670f..c4641a5aab 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -4804,6 +4804,7 @@"cloudSend.move.homeAgain": "Cloud của bạn đã kết thúc nên bot của bạn đã quay về máy tính này. Những gì bạn đã làm trên Cloud cũng đang quay về.","cloudSend.move.back": "Cloud của bạn đã kết thúc nên bot của bạn đã quay về máy tính này, cùng với những gì bạn đã làm trên Cloud. Thông tin đăng nhập và khóa bạn thêm trên Cloud chưa quay về: hãy thêm lại ở đây nếu cần.","cloudSend.move.backLost": "Cloud của bạn đã kết thúc nên bot của bạn đã quay về máy tính này như lúc chuyển đi. Những gì bạn làm trên Cloud từ đó không thể quay về.",+ "cloudSend.move.backGone": "Cloud mà bot của bạn đã chuyển đến đã kết thúc nên chúng đã quay về máy tính này như lúc chuyển đi. Tự động hóa của chúng đang tắt: hãy bật những cái bạn muốn.","cloudSend.move.elsewhere": "Bot của bạn đã quay về {name}. Máy tính này giữ bản sao của riêng nó từ {date}, và tự động hóa đã tắt.","cloudSend.move.elsewhereEmpty": "Bot của bạn đã quay về {name}.","homeScreen.openingNamed": "Đang mở {name}…",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 8701d59f8f..71ca5dc135 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -4185,6 +4185,7 @@"cloudSend.move.homeAgain": "你的 Cloud 已結束,所以你的機器人回到了這台電腦。你在 Cloud 上做的事也正在搬回來。","cloudSend.move.back": "你的 Cloud 已結束,所以你的機器人回到了這台電腦,連同你在 Cloud 上做的事。你在 Cloud 上新增的登入資訊和金鑰沒有回來:如有需要,請在這裡重新新增。","cloudSend.move.backLost": "你的 Cloud 已結束,所以你的機器人以搬走時的樣子回到了這台電腦。之後你在 Cloud 上做的事無法搬回來。",+ "cloudSend.move.backGone": "你的機器人搬去的 Cloud 已結束,所以它們以搬走時的樣子回到了這台電腦。它們的自動化已關閉:打開你想要的那些。","cloudSend.move.elsewhere": "你的機器人回到了 {name}。這台電腦保留它在 {date} 的副本,自動化已關閉。","cloudSend.move.elsewhereEmpty": "你的機器人回到了 {name}。","homeScreen.openingNamed": "正在開啟 {name}…",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex 9f6f56632f..0ca4fd8b6a 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -1203,6 +1203,7 @@"cloudSend.move.homeAgain": "你的 Cloud 已结束,所以你的机器人回到了这台电脑。你在 Cloud 上做的事也会一起迁回来。","cloudSend.move.back": "你的 Cloud 已结束,所以你的机器人回到了这台电脑,连同你在 Cloud 上做的事。你在 Cloud 上添加的登录信息和密钥没有回来:如有需要,请在这里重新添加。","cloudSend.move.backLost": "你的 Cloud 已结束,所以你的机器人按迁移时的样子回到了这台电脑。之后你在 Cloud 上做的事无法迁回来。",+ "cloudSend.move.backGone": "你的机器人搬去的 Cloud 已结束,所以它们按搬走时的样子回到了这台电脑。它们的自动化已关闭:打开你想要的那些。","cloudSend.move.elsewhere": "你的机器人回到了 {name}。这台电脑保留它在 {date} 的副本,自动化已关闭。","cloudSend.move.elsewhereEmpty": "你的机器人回到了 {name}。","cloudSend.move.keeping": "正在把这台电脑的机器人从 My Cloud 带回…",