Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
desktop: turn on and show the end-to-end phone connection
milind-sonicc4ba43141ce
diff --git a/electron/companion-e2e.test.mjs b/electron/companion-e2e.test.mjsindex ac652198ad..2e5961b97a 100644--- a/electron/companion-e2e.test.mjs+++ b/electron/companion-e2e.test.mjs@@ -26,7 +26,6 @@ describe("the connection key", () => {const identity = createE2EIdentity();const curve = createECDH("prime256v1");curve.setPrivateKey(Buffer.from(identity.privateKey, "base64url"));- expect(curve.getPublicKey(undefined, "base64url")).toBeDefined();expect(Buffer.from(identity.publicKey, "base64url")).toEqual(curve.getPublicKey(undefined, "uncompressed"));const document = withE2EIdentity({ other: 1 }, identity);expect(readE2EIdentity(document)).toEqual(identity);@@ -76,8 +75,8 @@ describe("relay tokens", () => {it("fetch at once, refresh after refreshAfter, and keep a valid token through a failed refresh", async () => {const timers = manualTimers();const grants = [];- const answers = [grant(), Promise.reject(Object.assign(new Error("down"), { code: "network_unavailable" })), grant({ token: "eyJ2IjoyfQ.c2ln" })];- const fetchGrant = vi.fn(() => answers.shift());+ const answers = [() => grant(), () => Promise.reject(Object.assign(new Error("down"), { code: "network_unavailable" })), () => grant({ token: "eyJ2IjoyfQ.c2ln" })];+ const fetchGrant = vi.fn(async () => answers.shift()());const service = createRelayTokenService({ fetchGrant, onGrant: (next) => grants.push(next), ...timers, now: () => 0, random: () => 0.5 });service.start();await new Promise((resolve) => setImmediate(resolve));@@ -95,8 +94,8 @@ describe("relay tokens", () => {it("drop the token and wait half an hour when the relay is off for this computer", async () => {const timers = manualTimers();const grants = [];- const answers = [grant(), Promise.reject(Object.assign(new Error("off"), { code: "relay_unavailable", status: 503 }))];- const service = createRelayTokenService({ fetchGrant: () => answers.shift(), onGrant: (next) => grants.push(next), ...timers, now: () => 0, random: () => 0.5 });+ const answers = [() => grant(), () => Promise.reject(Object.assign(new Error("off"), { code: "relay_unavailable", status: 503 }))];+ const service = createRelayTokenService({ fetchGrant: async () => answers.shift()(), onGrant: (next) => grants.push(next), ...timers, now: () => 0, random: () => 0.5 });service.start();await new Promise((resolve) => setImmediate(resolve));await service.refreshNow();diff --git a/phone-relay-preview.html b/phone-relay-preview.htmlnew file mode 100644index 0000000000..84f311137d--- /dev/null+++ b/phone-relay-preview.html@@ -0,0 +1,12 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Phone Connection Preview</title>+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="/src/phone-relay-preview.tsx"></script>+ </body>+</html>diff --git a/scripts/complete-locales.json b/scripts/complete-locales.jsonindex d7f0e22139..b7e5d3438a 100644--- a/scripts/complete-locales.json+++ b/scripts/complete-locales.json@@ -117,7 +117,10 @@"Wi-Fi","X (Twitter)","x.ai/bot/…",- "Zoom"+ "Zoom",+ "MausBot Relay",+ "Relay",+ "Tailscale"]}}diff --git a/shared/pairing-link.test.ts b/shared/pairing-link.test.tsindex 4f8c678071..51f98bcff7 100644--- a/shared/pairing-link.test.ts+++ b/shared/pairing-link.test.ts@@ -1,3 +1,4 @@+import { createECDH } from "node:crypto";import { describe, expect, it } from "vitest";import { phonePairingLink } from "./pairing-link";@@ -174,4 +175,20 @@ describe("phonePairingLink", () => {expect(phonePairingLink({ address: "https://mini.example/?x=1", token })).toBeNull();expect(phonePairingLink({ address: "https://mini.example/#pair", token })).toBeNull();});++ it("carries the end-to-end descriptor a phone parses, and leaves out one it would refuse", async () => {+ const { parseDescriptor } = await import("../companion/src/e2e/descriptor.ts");+ const k = Buffer.from(createECDH("prime256v1").generateKeys()).toString("base64url");+ const e2e = { v: 1 as const, k, h: "lz81isB3BuNV6rHgYgG3Wg", r: ["relay1.openmausbot.com", "relay2.openmausbot.com"] };+ const link = phonePairingLink({ address: "192.168.1.5", port: 8810, token, e2e })!;+ const parsed = parseDescriptor(new URL(link).searchParams.get("e2e"));+ expect(parsed).toMatchObject({ outcome: "ok", descriptor: e2e });+ const direct = phonePairingLink({ address: "192.168.1.5", port: 8810, token, e2e: { v: 1, k } })!;+ expect(parseDescriptor(new URL(direct).searchParams.get("e2e"))).toMatchObject({ outcome: "ok", descriptor: { v: 1, k } });+ for (const bad of [{ v: 1 as const, k: "short" }, { ...e2e, r: ["relay.example.com"] }]) {+ const fallback = phonePairingLink({ address: "192.168.1.5", port: 8810, token, e2e: bad })!;+ expect(rawField(fallback, "e2e") === undefined || parseDescriptor(new URL(fallback).searchParams.get("e2e")).outcome === "ok").toBe(true);+ }+ expect(rawField(phonePairingLink({ address: "192.168.1.5", port: 8810, token, e2e: { v: 1, k: "short" } })!, "e2e")).toBeUndefined();+ });});diff --git a/shared/pairing-link.ts b/shared/pairing-link.tsindex 41833ba290..4c9c822868 100644--- a/shared/pairing-link.ts+++ b/shared/pairing-link.ts@@ -10,6 +10,29 @@ export interface CompanionEndpoint {priority: number;}+export interface PairingE2EDescriptor {+ v: 1;+ k: string;+ h?: string;+ r?: string[];+}++const B64U_FIELD = /^[A-Za-z0-9_-]+$/;+const RELAY_HOST = /^relay[1-9][0-9]?\.openmausbot\.com$/;++/** The QR's `e2e` value, or null for anything a phone would refuse: then the link goes out without it, as from a+ * computer without the encrypted connection. A QR never says "local": a restriction is set per phone, later. */+export function encodePairingE2E(descriptor: PairingE2EDescriptor | null | undefined): string | null {+ if (!descriptor || descriptor.v !== 1 || typeof descriptor.k !== "string" || descriptor.k.length !== 87 || !B64U_FIELD.test(descriptor.k)) return null;+ const relay = typeof descriptor.h === "string" && Array.isArray(descriptor.r) && descriptor.r.length >= 1 && descriptor.r.length <= 4+ && descriptor.h.length === 22 && B64U_FIELD.test(descriptor.h) && descriptor.r.every((node) => RELAY_HOST.test(node))+ ? { h: descriptor.h, r: descriptor.r }+ : {};+ const json = JSON.stringify({ v: 1, k: descriptor.k, ...relay });+ const encoded = btoa(json).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");+ return encoded.length <= 1024 ? encoded : null;+}+export interface PhonePairingLinkOptions {/** Where the phone dials first: a host or IP literal together with `port`* (the desktop companion), or a complete http(s) origin (a server). */@@ -25,6 +48,9 @@ export interface PhonePairingLinkOptions {/** Complete base URLs, encoded apart from `address`/`hosts` so HTTPS and* port 443 stay unambiguous. */endpoints?: CompanionEndpoint[];+ /** The end-to-end descriptor `{v, k, h?, r?}`: the computer's transport key, pinned by the scan, and its relay+ * identity. Sent as `e2e=<base64url JSON>`; a phone that can't parse it refuses the whole link. */+ e2e?: PairingE2EDescriptor | null;/** P-256 HPKE recipient key pinned by the camera scan. Its private half* remains in the desktop's OS-encrypted credential store. */secretPublicKey?: string;@@ -145,6 +171,7 @@ export function phonePairingLink({hosts,endpoints,secretPublicKey,+ e2e,}: PhonePairingLinkOptions): string | null {const dial = linkAddress(address, port);if (!dial || !/^omb_pair_[A-Za-z0-9_-]{43}$/.test(token)) return null;@@ -164,6 +191,8 @@ export function phonePairingLink({if (routes.length) fields.push(["endpoints", encodeEndpoints(routes)]);const secretKey = validSecretPublicKey(secretPublicKey);if (secretKey) fields.push(["secretKey", secretKey]);+ const descriptor = encodePairingE2E(e2e);+ if (descriptor) fields.push(["e2e", descriptor]);return `openmausbot://pair?${fields.map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join("&")}`;}diff --git a/src/components/CompanionSection.reveal.test.ts b/src/components/CompanionSection.reveal.test.tsindex cef6c4dd92..2c27dc4692 100644--- a/src/components/CompanionSection.reveal.test.ts+++ b/src/components/CompanionSection.reveal.test.ts@@ -52,17 +52,6 @@ it("a plain visit reveals nothing", () => {expect(f.revealed).toEqual([]);});-it("keeps browser access separately off until granted, including old sidecar snapshots", () => {- for (const browserControlAccess of [undefined, false, true]) {- f.state = { enabled: true, devices: [{ id: "phone-1", name: "Ada", lastSeenAt: Date.now(), cloudDesktopAccess: true, browserControlAccess }], port: 8810 };- const markup = renderToStaticMarkup(createElement(() => CompanionSection({})));- const browser = markup.match(/<button[^>]*aria-label="Browser control access for Ada"[^>]*>/)?.[0];- const computer = markup.match(/<button[^>]*aria-label="Computer view access for Ada"[^>]*>/)?.[0];- expect(browser).toContain(`aria-checked="${browserControlAccess === true}"`);- expect(computer).toContain('aria-checked="true"');- }-});-it("reveals again after Settings went elsewhere and came back on a new request", () => {f.state = { enabled: true, devices: [], port: 8810 };render(1);diff --git a/src/components/CompanionSection.tsx b/src/components/CompanionSection.tsxindex 6f557e86ab..a94c90c1da 100644--- a/src/components/CompanionSection.tsx+++ b/src/components/CompanionSection.tsx@@ -5,8 +5,6 @@ import {Loader2,LogOut,ShieldCheck,- Smartphone,- Trash2,Wifi,} from "lucide-react";import {@@ -22,6 +20,7 @@ import {import { companionPairingMode } from "../lib/phone-setup";import { revealPhonePairing } from "../lib/phone-pairing";import { PhonesList } from "./PhonesList";+import { PairedPhones, relayStatusLine } from "./PairedPhones";import { ConnectionDetail } from "./ConnectionDetail";import { Card, Switch } from "./SettingsPrimitives";import { productName } from "../lib/brand";@@ -224,7 +223,7 @@ export function CompanionSection({ profileEmail = "", focusRequest = 0 }: { prof<div className="min-w-0"><div className="text-[13px] text-ink">{t("remote.title")}</div><div className="mt-0.5 text-[12px] leading-relaxed text-ink-secondary">- {t("remote.toggleDetail")}+ {relayStatusLine(state) ?? t("remote.toggleDetail")}</div></div><Switch@@ -239,59 +238,7 @@ export function CompanionSection({ profileEmail = "", focusRequest = 0 }: { prof<div className="text-[13px] text-ink">{t("remote.devices.title")}</div><div className="mt-0.5 text-[12px] leading-relaxed text-ink-secondary">{pairedCount ? t("remote.devices.subtitle", { app: productName() }) : t("remote.devices.empty")}</div><div className="mt-3">- {pairedCount > 0 && (- <ul className="flex flex-col gap-2">- {state.devices.map((device) => (- <li key={device.id} className="rounded-xl bg-inset px-3 py-3">- <div className="flex items-center gap-3">- <div className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-control text-ink-secondary">- <Smartphone size={15} />- </div>- <div className="min-w-0 flex-1">- <div className="truncate text-[14px] font-medium text-ink">{device.name}</div>- <div className="text-[12px] text-ink-secondary">{t("remote.devices.lastSeen", { when: relative(device.lastSeenAt) })}</div>- </div>- <button- disabled={c.busy}- onClick={() => void c.act((companion) => companion.revoke(device.id))}- aria-label={t("remote.devices.remove", { name: device.name })}- className="shrink-0 rounded p-1.5 text-ink-secondary hover:bg-control hover:text-danger disabled:opacity-40"- >- <Trash2 size={14} />- </button>- </div>- <div className="mt-3 flex items-center justify-between gap-3 border-t border-hairline/30 pt-3">- <div>- <div className="text-[12px] text-ink">{t("remote.devices.allowView")}</div>- <div className="mt-0.5 text-[11px] text-ink-secondary">{t("remote.devices.allowViewDetail")}</div>- </div>- <Switch- checked={device.cloudDesktopAccess}- aria-label={t("remote.devices.viewAria", { name: device.name })}- disabled={c.busy}- onClick={() =>- void c.act((companion) =>- companion.cloudDesktop(device.id, !device.cloudDesktopAccess),- )- }- />- </div>- <div className="mt-3 flex items-center justify-between gap-3 border-t border-hairline/30 pt-3">- <div>- <div className="text-[12px] text-ink">{t("remote.devices.allowBrowser")}</div>- <div className="mt-0.5 text-[11px] text-ink-secondary">{t("remote.devices.allowBrowserDetail")}</div>- </div>- <Switch- checked={device.browserControlAccess === true}- aria-label={t("remote.devices.browserAria", { name: device.name })}- disabled={c.busy}- onClick={() => void c.act((companion) => companion.browserControl(device.id, !device.browserControlAccess))}- />- </div>- </li>- ))}- </ul>- )}+ <PairedPhones c={c} state={state} /></div></div>diff --git a/src/components/PairedPhones.test.ts b/src/components/PairedPhones.test.tsnew file mode 100644index 0000000000..0837ed109f--- /dev/null+++ b/src/components/PairedPhones.test.ts@@ -0,0 +1,55 @@+import { createElement } from "react";+import { renderToStaticMarkup } from "react-dom/server";+import { describe, expect, it } from "vitest";++import { PhoneRow, phoneSubtitle, relayStatusLine, sortPhones } from "./PairedPhones";+import type { CompanionState, PhoneDevice, PhoneSetupController } from "./PhoneSetupFlow";++const NOW = Date.now();+const phone = (extra: Partial<PhoneDevice> = {}): PhoneDevice => ({ id: "phone-1", name: "Ada", createdAt: NOW, lastSeenAt: NOW - 3 * 86_400_000, cloudDesktopAccess: true, ...extra });+const state = (extra: Partial<CompanionState> = {}): CompanionState => ({ enabled: true, keepAwake: false, port: 8810, devices: [], pairing: null, ...extra });+const c = { busy: false, act: async () => {} } as unknown as PhoneSetupController;+const row = (device: PhoneDevice, companion: CompanionState) =>+ renderToStaticMarkup(createElement(PhoneRow, { device, connected: false, state: companion, c, onRemoved: () => {}, defaultOpen: true }));++describe("paired phones", () => {+ it("keeps browser access separately off until granted, including old sidecar snapshots", () => {+ for (const browserControlAccess of [undefined, false, true]) {+ const markup = row(phone({ browserControlAccess }), state());+ expect(markup.match(/<button[^>]*aria-label="Browser control access for Ada"[^>]*>/)?.[0]).toContain(`aria-checked="${browserControlAccess === true}"`);+ expect(markup.match(/<button[^>]*aria-label="Computer view access for Ada"[^>]*>/)?.[0]).toContain('aria-checked="true"');+ }+ });++ it("offers Connect from only once the computer serves the encrypted connection", () => {+ const e2e = { enabled: true, relay: "connected" as const, node: "relay1.openmausbot.com", descriptor: null };+ expect(row(phone(), state())).not.toContain("Connect from");+ const markup = row(phone({ routes: "local" }), state({ e2e }));+ expect(markup).toContain("Connect from");+ expect(markup).toMatch(/aria-checked="true"[^>]*>Wi-Fi and Tailscale only</);+ });++ it("says the live route, or when it was last seen, in one line", () => {+ expect(phoneSubtitle(phone({ route: "relay", e2eAt: NOW }), true, true)).toBe("Connected · Relay");+ expect(phoneSubtitle(phone({ route: "tailscale", routes: "local", e2eAt: NOW }), true, true)).toBe("Connected · Tailscale · Wi-Fi and Tailscale only");+ expect(phoneSubtitle(phone(), true, true)).toBe("Connected · update the app to encrypt");+ expect(phoneSubtitle(phone(), true, false)).toBe("Connected");+ expect(phoneSubtitle(phone(), false, true)).toMatch(/^Last seen /);+ });++ it("lists connected phones first, then the most recently seen", () => {+ const order = sortPhones(+ [phone({ id: "a", lastSeenAt: 3 }), phone({ id: "b", lastSeenAt: 1 }), phone({ id: "c", lastSeenAt: 2 })],+ new Set(["b"]),+ ).map((each) => each.id);+ expect(order).toEqual(["b", "a", "c"]);+ });++ it("names where phones can reach this computer from", () => {+ const e2e = (relay: "connected" | "connecting" | "off") => ({ enabled: true, relay, node: null, descriptor: null });+ expect(relayStatusLine(state())).toBeNull();+ expect(relayStatusLine(state({ e2e: e2e("connected") }))).toBe("Reachable from anywhere · end-to-end encrypted");+ expect(relayStatusLine(state({ e2e: e2e("off") }))).toBe("On this Wi-Fi and Tailscale · end-to-end encrypted");+ expect(relayStatusLine(state({ enabled: false, e2e: e2e("connected") }))).toBeNull();+ });+});diff --git a/src/components/PairedPhones.tsx b/src/components/PairedPhones.tsxnew file mode 100644index 0000000000..bb6b8adefe--- /dev/null+++ b/src/components/PairedPhones.tsx@@ -0,0 +1,142 @@+import { useState } from "react";+import { MoreHorizontal } from "lucide-react";++import { t } from "@/lib/i18n";+import type { CompanionState, PhoneDevice, PhoneSetupController } from "./PhoneSetupFlow";+import { Switch } from "./SettingsPrimitives";+import { relative } from "./CompanionSection";++const ROUTE_LABEL = { wifi: "remote.devices.route.wifi", tailscale: "remote.devices.route.tailscale", relay: "remote.devices.route.relay" } as const;++/** Connected first, then the most recently seen. */+export function sortPhones(devices: PhoneDevice[], connected: ReadonlySet<string>): PhoneDevice[] {+ return [...devices].sort((a, b) => Number(connected.has(b.id)) - Number(connected.has(a.id)) || b.lastSeenAt - a.lastSeenAt);+}++/** One line under the name: the live route, or when it was last seen. An old app connected over plain HTTP says so. */+export function phoneSubtitle(device: PhoneDevice, connected: boolean, e2eEnabled: boolean): string {+ const parts: string[] = [];+ if (device.route) parts.push(t("remote.devices.connected", { route: t(ROUTE_LABEL[device.route]) }));+ else if (connected) parts.push(e2eEnabled && !device.e2eAt ? t("remote.devices.connectedLegacy") : t("remote.devices.connectedNow"));+ else parts.push(t("remote.devices.lastSeen", { when: relative(device.lastSeenAt) }));+ if (e2eEnabled && device.routes === "local") parts.push(t("remote.devices.localOnly"));+ return parts.join(" · ");+}++export function PhoneRow({ device, connected, state, c, onRemoved, defaultOpen = false }: {+ device: PhoneDevice;+ connected: boolean;+ state: CompanionState;+ c: PhoneSetupController;+ onRemoved: (name: string) => void;+ defaultOpen?: boolean;+}) {+ const [open, setOpen] = useState(defaultOpen);+ const e2eEnabled = state.e2e?.enabled === true;+ const live = connected || Boolean(device.route);+ return (+ <li className="border-t border-hairline/30 first:border-t-0">+ <div className="flex items-center gap-2.5 px-3 py-3">+ <span className="flex size-3 shrink-0 items-center justify-center" title={phoneSubtitle(device, connected, e2eEnabled)}>+ <span className={`size-2 rounded-full ${live ? "bg-success" : "bg-ink-tertiary/40"}`} />+ </span>+ <div className="min-w-0 flex-1">+ <div className="truncate text-[14px] font-medium text-ink">{device.name}</div>+ <div className="truncate text-[12px] text-ink-secondary">{phoneSubtitle(device, connected, e2eEnabled)}</div>+ </div>+ <button+ onClick={() => setOpen((value) => !value)}+ aria-expanded={open}+ aria-label={t("remote.devices.more", { name: device.name })}+ className="shrink-0 rounded p-1.5 text-ink-secondary hover:bg-control"+ >+ <MoreHorizontal size={15} />+ </button>+ </div>+ {open && (+ <div className="flex flex-col gap-3 border-t border-hairline/30 px-3 py-3">+ {e2eEnabled && (+ <div className="flex items-center justify-between gap-3">+ <div className="text-[12px] text-ink">{t("remote.devices.connectFrom")}</div>+ <div role="radiogroup" aria-label={t("remote.devices.connectFrom")} className="flex rounded-lg bg-inset p-0.5 text-[12px]">+ {(["any", "local"] as const).map((routes) => (+ <button+ key={routes}+ role="radio"+ aria-checked={(device.routes ?? "any") === routes}+ disabled={c.busy}+ onClick={() => void c.act((companion) => (companion.routes ? companion.routes(device.id, routes) : companion.state()))}+ className={`rounded-md px-2.5 py-1 ${(device.routes ?? "any") === routes ? "bg-card text-ink shadow-sm" : "text-ink-secondary"}`}+ >+ {routes === "any" ? t("remote.devices.anywhere") : t("remote.devices.localOnly")}+ </button>+ ))}+ </div>+ </div>+ )}+ <div className="flex items-center justify-between gap-3">+ <div>+ <div className="text-[12px] text-ink">{t("remote.devices.allowView")}</div>+ <div className="mt-0.5 text-[11px] text-ink-secondary">{t("remote.devices.allowViewDetail")}</div>+ </div>+ <Switch+ checked={device.cloudDesktopAccess}+ aria-label={t("remote.devices.viewAria", { name: device.name })}+ disabled={c.busy}+ onClick={() => void c.act((companion) => companion.cloudDesktop(device.id, !device.cloudDesktopAccess))}+ />+ </div>+ <div className="flex items-center justify-between gap-3">+ <div>+ <div className="text-[12px] text-ink">{t("remote.devices.allowBrowser")}</div>+ <div className="mt-0.5 text-[11px] text-ink-secondary">{t("remote.devices.allowBrowserDetail")}</div>+ </div>+ <Switch+ checked={device.browserControlAccess === true}+ aria-label={t("remote.devices.browserAria", { name: device.name })}+ disabled={c.busy}+ onClick={() => void c.act((companion) => companion.browserControl(device.id, !device.browserControlAccess))}+ />+ </div>+ <button+ disabled={c.busy}+ onClick={() => void c.act((companion) => companion.revoke(device.id)).then(() => onRemoved(device.name))}+ aria-label={t("remote.devices.remove", { name: device.name })}+ className="self-start text-[12px] text-danger hover:underline disabled:opacity-40"+ >+ {t("remote.devices.removePhone")}+ </button>+ </div>+ )}+ </li>+ );+}++/** One grouped card: a dot, the name and one line per phone. Remove acts at once. */+export function PairedPhones({ c, state }: { c: PhoneSetupController; state: CompanionState }) {+ const [removed, setRemoved] = useState<string | null>(null);+ const connected = new Set(state.connectedDeviceIds ?? []);+ if (state.devices.length === 0 && !removed) return null;+ return (+ <>+ {state.devices.length > 0 && (+ <ul className="rounded-xl border border-hairline/40 bg-card">+ {sortPhones(state.devices, connected).map((device) => (+ <PhoneRow key={device.id} device={device} connected={connected.has(device.id)} state={state} c={c} onRemoved={setRemoved} />+ ))}+ </ul>+ )}+ {removed && (+ <div role="status" className="mt-2 text-[12px] text-ink-secondary">{t("remote.devices.removed", { name: removed })}</div>+ )}+ </>+ );+}++/** The line under Remote access: where phones can reach this computer from, once it is end-to-end encrypted. */+export function relayStatusLine(state: Pick<CompanionState, "enabled" | "e2e">): string | null {+ if (!state.enabled || state.e2e?.enabled !== true) return null;+ if (state.e2e.relay === "connected") return t("remote.e2e.anywhere");+ if (state.e2e.relay === "connecting") return t("remote.e2e.connecting");+ return t("remote.e2e.local");+}diff --git a/src/components/PhonePairingQr.tsx b/src/components/PhonePairingQr.tsxnew file mode 100644index 0000000000..46df9ca94e--- /dev/null+++ b/src/components/PhonePairingQr.tsx@@ -0,0 +1,96 @@+import { useEffect, useState } from "react";+import { Check, Lock, Minus } from "lucide-react";+import { QRCodeSVG } from "qrcode.react";++import { t } from "@/lib/i18n";+import { copyText } from "@/lib/copy-text";+import { ANDROID_APK_URL, IOS_APP_STORE_URL } from "@/lib/app-links";+import { productName } from "@/lib/brand";+import type { PhoneSetupController } from "./PhoneSetupFlow";++/** A fresh code while this screen is open; the previous one stays valid to its two-minute end, so a phone mid-scan+ * never misses. */+export const PAIRING_RENEW_MS = 100_000;++function RouteRow({ on, label, value }: { on: boolean; label: string; value: string }) {+ return (+ <div className="flex h-7 items-center gap-2 text-left">+ {on ? <Check size={14} className="shrink-0 text-success" /> : <Minus size={14} className="shrink-0 text-ink-tertiary" />}+ <span className="w-[120px] shrink-0 text-[13px] text-ink">{label}</span>+ <span className="min-w-0 truncate text-[12px] text-ink-secondary">{value}</span>+ </div>+ );+}++/** The pairing screen once this computer serves the encrypted connection: one QR carries every route, renews itself,+ * and has no countdown, no code and no cancel. */+export function PhonePairingQr({ c, signedIn }: { c: PhoneSetupController; signedIn: boolean }) {+ const [copied, setCopied] = useState(false);+ const [storeOpen, setStoreOpen] = useState(false);+ const state = c.state;+ const renewing = Boolean(state?.pairing);+ useEffect(() => {+ if (!renewing) return;+ const timer = setInterval(() => {+ void c.act((companion) => (companion.renewPairing ? companion.renewPairing() : companion.pairing(true)));+ }, PAIRING_RENEW_MS);+ return () => clearInterval(timer);+ }, [renewing, c]);+ if (!state || !c.pairingLink) return null;+ const lan = state.lan ?? state.addresses?.[0] ?? null;+ const relay = state.e2e?.descriptor?.r?.length ? state.e2e.relay : null;+ const copy = () => {+ void copyText(c.pairingLink ?? "").then(() => {+ setCopied(true);+ setTimeout(() => setCopied(false), 2_500);+ });+ };+ return (+ <div className="flex w-full max-w-[440px] flex-col items-center text-center">+ <div className="rounded-2xl bg-white p-3.5 transition-opacity duration-150" aria-label={t("phone.code.qrAria")}>+ <QRCodeSVG key={state.pairing?.token} value={c.pairingLink} size={320} level="L" marginSize={1} bgColor="#ffffff" fgColor="#111111" />+ </div>+ <p className="mt-4 text-[13px] text-ink-secondary">{t("phone.code.e2e.scan", { app: productName() })}</p>+ <div className="mt-5 w-full px-2">+ <RouteRow on={Boolean(lan)} label={t("phone.code.e2e.wifi")} value={lan ?? ""} />+ <RouteRow on={Boolean(state.tailnetName)} label={t("phone.code.e2e.tailscale")} value={state.tailnetName ?? t("phone.code.e2e.tailscaleOff")} />+ <RouteRow+ on={Boolean(relay)}+ label={t("phone.code.e2e.relay")}+ value={relay ? t("phone.code.e2e.fromAnywhere") : signedIn ? t("phone.code.e2e.relayOff") : t("phone.code.e2e.signIn")}+ />+ </div>+ {c.localFallback && state.publicNetwork && (+ <p role="note" className="mt-3 w-full rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-left text-[12px] leading-relaxed text-warning">+ {t("phone.code.publicNetwork", { network: state.publicNetwork })}+ </p>+ )}+ <p className="mt-4 flex items-start gap-1.5 px-2 text-left text-[12px] text-ink-tertiary">+ <Lock size={12} className="mt-0.5 shrink-0" />+ {t("phone.code.e2e.encrypted")}+ </p>+ <div className="relative mt-5 flex w-full items-center justify-between px-2">+ <button onClick={copy} className="text-[12px] text-ink-secondary hover:text-ink">{t("phone.code.e2e.copyLink")}</button>+ <button onClick={() => setStoreOpen((open) => !open)} aria-expanded={storeOpen} className="text-[12px] text-ink-secondary hover:text-ink">+ {t("phone.code.e2e.getApp")}+ </button>+ {storeOpen && (+ <div className="absolute bottom-8 right-0 z-10 rounded-xl border border-hairline/40 bg-card p-4 shadow-lg">+ <div className="flex gap-4">+ {[["App Store", IOS_APP_STORE_URL], ["Android", ANDROID_APK_URL]].map(([label, url]) => (+ <div key={label} className="flex flex-col items-center gap-2">+ <div className="rounded-lg bg-white p-2"><QRCodeSVG value={url} size={128} level="M" bgColor="#ffffff" fgColor="#111111" /></div>+ <span className="text-[12px] text-ink">{label}</span>+ </div>+ ))}+ </div>+ <p className="mt-3 text-center text-[12px] text-ink-secondary">{t("phone.code.e2e.getAppDetail")}</p>+ </div>+ )}+ </div>+ {copied && (+ <div role="status" className="mt-3 rounded-lg bg-inset px-3 py-1.5 text-[12px] text-ink">{t("phone.code.e2e.copied")}</div>+ )}+ </div>+ );+}diff --git a/src/components/PhoneSetupFlow.tsx b/src/components/PhoneSetupFlow.tsxindex fdcf359895..c9bca1c0ff 100644--- a/src/components/PhoneSetupFlow.tsx+++ b/src/components/PhoneSetupFlow.tsx@@ -26,7 +26,6 @@ import {companionPairingRoute,companionPairingRoutePin,companionPairingRoutePinAvailable,- type CompanionEndpoint,type CompanionPairingRoutePin,type CompanionPairingRouteMode,} from "../lib/companion-pairing";@@ -65,49 +64,11 @@ import {phonePairingManualCodeMode,} from "../lib/companion-state";import { ConnectionDetail } from "./ConnectionDetail";+import { PhonePairingQr } from "./PhonePairingQr";import { productName } from "../lib/brand";-export interface PhoneDevice {- id: string;- name: string;- createdAt: number;- lastSeenAt: number;- cloudDesktopAccess: boolean;- /** Absent (older sidecars) means no browser access. */- browserControlAccess?: boolean;-}--export interface CompanionState {- enabled: boolean;- keepAwake: boolean;- port: number;- devices: PhoneDevice[];- connectedDeviceIds?: string[];- pairing: { code: string; token: string; expiresAt: number } | null;- addresses?: string[];- tailscale?: string;- tailnetName?: string;- lan?: string | null;- hosts?: string[];- endpoints?: CompanionEndpoint[];- secretPublicKey?: string;- discovery?: { advertising: boolean; name: string };- /** Windows has that network down as Public, where its firewall drops a phone's connection. */- publicNetwork?: string;- error?: string;-}--export type CompanionBridge = {- state: () => Promise<CompanionState>;- start: () => Promise<CompanionState>;- stop: () => Promise<CompanionState>;- keepAwake: (enabled: boolean) => Promise<CompanionState>;- refreshTailscale: () => Promise<CompanionState>;- pairing: (open: boolean, expectedToken?: string) => Promise<CompanionState>;- cloudDesktop: (deviceId: string, allowed: boolean) => Promise<CompanionState>;- browserControl: (deviceId: string, allowed: boolean) => Promise<CompanionState>;- revoke: (deviceId: string) => Promise<CompanionState>;-};+import type { CompanionBridge, CompanionState } from "../lib/companion-types";+export type { CompanionBridge, CompanionState, PhoneDevice } from "../lib/companion-types";type AccountBridge = NonNullable<NonNullable<Window["ogb"]>["companionAccount"]>;type StateBridge<T> = { state: () => Promise<T> };@@ -779,13 +740,9 @@ export function usePhoneSetupController(profileEmail = ""): PhoneSetupController);const pairingLink = useMemo(() => {if (!state?.pairing || !pairingRoute) return null;- return phonePairingLink({- ...pairingRoute,- code: state.pairing.code,- token: state.pairing.token,- name: state.discovery?.name,- secretPublicKey: state.secretPublicKey,- });+ // An encrypted-connection QR carries no six-digit code: phones pair by the QR or a pasted link only.+ return phonePairingLink({ ...pairingRoute, code: state.e2e?.enabled ? undefined : state.pairing.code, token: state.pairing.token,+ name: state.discovery?.name, secretPublicKey: state.secretPublicKey, e2e: state.e2e?.descriptor });}, [pairingRoute, state]);const cancel = useCallback(() => {@@ -902,6 +859,7 @@ export function PhoneSetupFlowView({ controller }: { controller: PhoneSetupContrconst actionError = companionAccountActionError(c.account, c.accountError);const canSubmitEmail = /^\S+@\S+\.\S+$/.test(c.email.trim());const manualCodeMode = phonePairingManualCodeMode(Boolean(c.state?.pairing), c.pairingLink);+ if (c.phase === "qr" && c.state?.e2e?.enabled && c.pairingLink) return <PhonePairingQr c={c} signedIn={Boolean(c.account?.email)} />;if (c.phase === "intro") {return (diff --git a/src/lib/companion-types.ts b/src/lib/companion-types.tsnew file mode 100644index 0000000000..31ddd6de8f--- /dev/null+++ b/src/lib/companion-types.ts@@ -0,0 +1,55 @@+import type { PairingE2EDescriptor } from "../../shared/pairing-link";+import type { CompanionEndpoint } from "./companion-pairing";++export interface PhoneDevice {+ id: string;+ name: string;+ createdAt: number;+ lastSeenAt: number;+ cloudDesktopAccess: boolean;+ /** Absent (older sidecars) means no browser access. */+ browserControlAccess?: boolean;+ /** "local": Wi-Fi and Tailscale only. Absent on older sidecars. */+ routes?: "any" | "local";+ /** Its first end-to-end session; a device without one is on the old, unencrypted connection. */+ e2eAt?: number;+ /** Its best live encrypted route right now. */+ route?: "wifi" | "tailscale" | "relay" | null;+}++export interface CompanionState {+ enabled: boolean;+ keepAwake: boolean;+ port: number;+ devices: PhoneDevice[];+ connectedDeviceIds?: string[];+ pairing: { code: string; token: string; expiresAt: number } | null;+ addresses?: string[];+ tailscale?: string;+ tailnetName?: string;+ lan?: string | null;+ hosts?: string[];+ endpoints?: CompanionEndpoint[];+ secretPublicKey?: string;+ discovery?: { advertising: boolean; name: string };+ /** Windows has that network down as Public, where its firewall drops a phone's connection. */+ publicNetwork?: string;+ /** The end-to-end connection; absent or `enabled: false` until this computer serves it. */+ e2e?: { enabled: boolean; relay: "connected" | "connecting" | "off"; node: string | null; descriptor: PairingE2EDescriptor | null };+ error?: string;+}++export type CompanionBridge = {+ state: () => Promise<CompanionState>;+ start: () => Promise<CompanionState>;+ stop: () => Promise<CompanionState>;+ keepAwake: (enabled: boolean) => Promise<CompanionState>;+ refreshTailscale: () => Promise<CompanionState>;+ pairing: (open: boolean, expectedToken?: string) => Promise<CompanionState>;+ cloudDesktop: (deviceId: string, allowed: boolean) => Promise<CompanionState>;+ browserControl: (deviceId: string, allowed: boolean) => Promise<CompanionState>;+ revoke: (deviceId: string) => Promise<CompanionState>;+ /** Absent on an app build before the encrypted connection. */+ renewPairing?: () => Promise<CompanionState>;+ routes?: (deviceId: string, routes: "any" | "local") => Promise<CompanionState>;+};diff --git a/src/locales/de.json b/src/locales/de.jsonindex 9b10f5c15f..2b9901f961 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -3181,5 +3181,33 @@"canvas.botCountOne": "1 Bot","server.lendingLift.chooseAnswer": "Wähle Erlauben oder Nicht jetzt.","server.lendingLift.ownerDeviceOnly": "Nur du kannst dies erlauben, von einem deiner eigenen Geräte aus.",- "server.teammates.waitCardClosed": "Die Karte, auf die gewartet wurde, wurde ersetzt oder geschlossen"+ "server.teammates.waitCardClosed": "Die Karte, auf die gewartet wurde, wurde ersetzt oder geschlossen",+ "phone.code.e2e.scan": "Öffne die {app}-App auf deinem Handy und scanne.",+ "phone.code.e2e.wifi": "Dieses WLAN",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "von überall",+ "phone.code.e2e.tailscaleOff": "läuft nicht auf diesem Computer",+ "phone.code.e2e.signIn": "Melde dich an, um ihn von überall zu erreichen",+ "phone.code.e2e.relayOff": "gerade nicht verfügbar",+ "phone.code.e2e.encrypted": "Ende-zu-Ende-verschlüsselt. Nur dein Handy und dieser Computer können es lesen.",+ "phone.code.e2e.copyLink": "Link kopieren",+ "phone.code.e2e.copied": "Link kopiert. Öffne ihn auf deinem Handy.",+ "phone.code.e2e.getApp": "Noch keine App? Hier holen",+ "phone.code.e2e.getAppDetail": "Mit der Handykamera scannen.",+ "remote.devices.connected": "Verbunden · {route}",+ "remote.devices.connectedLegacy": "Verbunden · App aktualisieren, um zu verschlüsseln",+ "remote.devices.connectedNow": "Verbunden",+ "remote.devices.route.wifi": "WLAN",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Nur WLAN und Tailscale",+ "remote.devices.connectFrom": "Verbinden von",+ "remote.devices.anywhere": "Überall",+ "remote.devices.more": "Optionen für {name}",+ "remote.devices.removePhone": "Handy entfernen",+ "remote.devices.removed": "{name} entfernt.",+ "remote.e2e.anywhere": "Von überall erreichbar · Ende-zu-Ende-verschlüsselt",+ "remote.e2e.connecting": "Verbindung zu MausBot Relay…",+ "remote.e2e.local": "In diesem WLAN und über Tailscale · Ende-zu-Ende-verschlüsselt"}diff --git a/src/locales/en.json b/src/locales/en.jsonindex c816725a47..b13490f4ca 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -9598,5 +9598,33 @@"imageGen.key.xai": "Grok (xAI) API key","imageGen.key.openrouter": "OpenRouter API key","server.voice.noNoteNoVoice": "No voice note with this reply: this bot has no voice set up yet.",- "server.voice.noNoteFailed": "No voice note with this reply: the voice couldn't be made ({reason})."+ "server.voice.noNoteFailed": "No voice note with this reply: the voice couldn't be made ({reason}).",+ "phone.code.e2e.scan": "Open the {app} app on your phone and scan.",+ "phone.code.e2e.wifi": "This Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "from anywhere",+ "phone.code.e2e.tailscaleOff": "not running on this computer",+ "phone.code.e2e.signIn": "Sign in to reach it from anywhere",+ "phone.code.e2e.relayOff": "not available right now",+ "phone.code.e2e.encrypted": "End-to-end encrypted. Only your phone and this computer can read it.",+ "phone.code.e2e.copyLink": "Copy link",+ "phone.code.e2e.copied": "Link copied. Open it on your phone.",+ "phone.code.e2e.getApp": "No app yet? Get it",+ "phone.code.e2e.getAppDetail": "Scan with your phone camera.",+ "remote.devices.connected": "Connected · {route}",+ "remote.devices.connectedLegacy": "Connected · update the app to encrypt",+ "remote.devices.connectedNow": "Connected",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Wi-Fi and Tailscale only",+ "remote.devices.connectFrom": "Connect from",+ "remote.devices.anywhere": "Anywhere",+ "remote.devices.more": "Options for {name}",+ "remote.devices.removePhone": "Remove phone",+ "remote.devices.removed": "Removed {name}.",+ "remote.e2e.anywhere": "Reachable from anywhere · end-to-end encrypted",+ "remote.e2e.connecting": "Connecting to MausBot Relay…",+ "remote.e2e.local": "On this Wi-Fi and Tailscale · end-to-end encrypted"}diff --git a/src/locales/es.json b/src/locales/es.jsonindex 0f8de02f27..1d4cb8add9 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -5847,5 +5847,33 @@"botApi.call.failed": "El bot no pudo responder","botApi.starter": "Bot API viene con un plan superior.","botApi.password": "Una clave es como una contraseña: quien la tenga puede leer lo que este bot puede leer.",- "botApi.cantTake": "La IA de este bot no puede recibir llamadas de Bot API. Elige otra IA para usarlas."+ "botApi.cantTake": "La IA de este bot no puede recibir llamadas de Bot API. Elige otra IA para usarlas.",+ "phone.code.e2e.scan": "Abre la app {app} en tu teléfono y escanea.",+ "phone.code.e2e.wifi": "Este Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "desde cualquier lugar",+ "phone.code.e2e.tailscaleOff": "no se está ejecutando en este equipo",+ "phone.code.e2e.signIn": "Inicia sesión para acceder desde cualquier lugar",+ "phone.code.e2e.relayOff": "no disponible ahora",+ "phone.code.e2e.encrypted": "Cifrado de extremo a extremo. Solo tu teléfono y este equipo pueden leerlo.",+ "phone.code.e2e.copyLink": "Copiar enlace",+ "phone.code.e2e.copied": "Enlace copiado. Ábrelo en tu teléfono.",+ "phone.code.e2e.getApp": "¿Aún sin la app? Consíguela",+ "phone.code.e2e.getAppDetail": "Escanea con la cámara del teléfono.",+ "remote.devices.connected": "Conectado · {route}",+ "remote.devices.connectedLegacy": "Conectado · actualiza la app para cifrar",+ "remote.devices.connectedNow": "Conectado",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Solo Wi-Fi y Tailscale",+ "remote.devices.connectFrom": "Conectar desde",+ "remote.devices.anywhere": "Cualquier lugar",+ "remote.devices.more": "Opciones de {name}",+ "remote.devices.removePhone": "Quitar teléfono",+ "remote.devices.removed": "Se quitó {name}.",+ "remote.e2e.anywhere": "Accesible desde cualquier lugar · cifrado de extremo a extremo",+ "remote.e2e.connecting": "Conectando con MausBot Relay…",+ "remote.e2e.local": "En este Wi-Fi y Tailscale · cifrado de extremo a extremo"}diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex e5e0682604..c8749f0cf2 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -3047,5 +3047,33 @@"teamMemory.you": "vous","teamSettings.general": "Général","canvas.botCount": "{count} bots",- "canvas.botCountOne": "1 bot"+ "canvas.botCountOne": "1 bot",+ "phone.code.e2e.scan": "Ouvrez l’app {app} sur votre téléphone et scannez.",+ "phone.code.e2e.wifi": "Ce Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "de partout",+ "phone.code.e2e.tailscaleOff": "pas lancé sur cet ordinateur",+ "phone.code.e2e.signIn": "Connectez-vous pour y accéder de partout",+ "phone.code.e2e.relayOff": "indisponible pour l’instant",+ "phone.code.e2e.encrypted": "Chiffré de bout en bout. Seuls votre téléphone et cet ordinateur peuvent le lire.",+ "phone.code.e2e.copyLink": "Copier le lien",+ "phone.code.e2e.copied": "Lien copié. Ouvrez-le sur votre téléphone.",+ "phone.code.e2e.getApp": "Pas encore l’app ? L’obtenir",+ "phone.code.e2e.getAppDetail": "Scannez avec l’appareil photo du téléphone.",+ "remote.devices.connected": "Connecté · {route}",+ "remote.devices.connectedLegacy": "Connecté · mettez à jour l’app pour chiffrer",+ "remote.devices.connectedNow": "Connecté",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Wi-Fi et Tailscale uniquement",+ "remote.devices.connectFrom": "Se connecter depuis",+ "remote.devices.anywhere": "Partout",+ "remote.devices.more": "Options pour {name}",+ "remote.devices.removePhone": "Retirer le téléphone",+ "remote.devices.removed": "{name} retiré.",+ "remote.e2e.anywhere": "Accessible de partout · chiffré de bout en bout",+ "remote.e2e.connecting": "Connexion à MausBot Relay…",+ "remote.e2e.local": "Sur ce Wi-Fi et Tailscale · chiffré de bout en bout"}diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex 890aa8a00f..9952153b41 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -2899,5 +2899,33 @@"botApi.call.failed": "बॉट जवाब नहीं दे सका","botApi.starter": "Bot API ऊँचे प्लान के साथ आता है।","botApi.password": "कुंजी पासवर्ड जैसी है: जिसके पास यह है, वह वह सब पढ़ सकता है जो यह बॉट पढ़ सकता है।",- "botApi.cantTake": "इस बॉट का AI Bot API कॉल नहीं ले सकता। इन्हें इस्तेमाल करने के लिए कोई दूसरा AI चुनें।"+ "botApi.cantTake": "इस बॉट का AI Bot API कॉल नहीं ले सकता। इन्हें इस्तेमाल करने के लिए कोई दूसरा AI चुनें।",+ "phone.code.e2e.scan": "अपने फ़ोन पर {app} ऐप खोलें और स्कैन करें।",+ "phone.code.e2e.wifi": "यह वाई-फ़ाई",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "कहीं से भी",+ "phone.code.e2e.tailscaleOff": "इस कंप्यूटर पर नहीं चल रहा",+ "phone.code.e2e.signIn": "कहीं से भी पहुँचने के लिए साइन इन करें",+ "phone.code.e2e.relayOff": "अभी उपलब्ध नहीं",+ "phone.code.e2e.encrypted": "एंड-टू-एंड एन्क्रिप्टेड। केवल आपका फ़ोन और यह कंप्यूटर इसे पढ़ सकते हैं।",+ "phone.code.e2e.copyLink": "लिंक कॉपी करें",+ "phone.code.e2e.copied": "लिंक कॉपी हो गया। इसे अपने फ़ोन पर खोलें।",+ "phone.code.e2e.getApp": "अभी ऐप नहीं है? पाएँ",+ "phone.code.e2e.getAppDetail": "अपने फ़ोन के कैमरे से स्कैन करें।",+ "remote.devices.connected": "कनेक्टेड · {route}",+ "remote.devices.connectedLegacy": "कनेक्टेड · एन्क्रिप्ट करने के लिए ऐप अपडेट करें",+ "remote.devices.connectedNow": "कनेक्टेड",+ "remote.devices.route.wifi": "वाई-फ़ाई",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "केवल वाई-फ़ाई और Tailscale",+ "remote.devices.connectFrom": "यहाँ से कनेक्ट करें",+ "remote.devices.anywhere": "कहीं से भी",+ "remote.devices.more": "{name} के विकल्प",+ "remote.devices.removePhone": "फ़ोन हटाएँ",+ "remote.devices.removed": "{name} हटाया गया।",+ "remote.e2e.anywhere": "कहीं से भी पहुँच योग्य · एंड-टू-एंड एन्क्रिप्टेड",+ "remote.e2e.connecting": "MausBot Relay से कनेक्ट हो रहा है…",+ "remote.e2e.local": "इस वाई-फ़ाई और Tailscale पर · एंड-टू-एंड एन्क्रिप्टेड"}diff --git a/src/locales/it.json b/src/locales/it.jsonindex 5d72049127..4fa4578588 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -6473,5 +6473,33 @@"botApi.call.failed": "Il bot non ha potuto rispondere","botApi.starter": "Bot API è incluso in un piano superiore.","botApi.password": "Una chiave è come una password: chi la possiede può leggere ciò che questo bot può leggere.",- "botApi.cantTake": "L’IA di questo bot non può ricevere chiamate Bot API. Scegli un’altra IA per usarle."+ "botApi.cantTake": "L’IA di questo bot non può ricevere chiamate Bot API. Scegli un’altra IA per usarle.",+ "phone.code.e2e.scan": "Apri l’app {app} sul telefono e scansiona.",+ "phone.code.e2e.wifi": "Questa rete Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "da ovunque",+ "phone.code.e2e.tailscaleOff": "non attivo su questo computer",+ "phone.code.e2e.signIn": "Accedi per raggiungerlo da ovunque",+ "phone.code.e2e.relayOff": "non disponibile al momento",+ "phone.code.e2e.encrypted": "Crittografia end-to-end. Solo il tuo telefono e questo computer possono leggerlo.",+ "phone.code.e2e.copyLink": "Copia link",+ "phone.code.e2e.copied": "Link copiato. Aprilo sul telefono.",+ "phone.code.e2e.getApp": "Non hai ancora l’app? Scaricala",+ "phone.code.e2e.getAppDetail": "Scansiona con la fotocamera del telefono.",+ "remote.devices.connected": "Connesso · {route}",+ "remote.devices.connectedLegacy": "Connesso · aggiorna l’app per crittografare",+ "remote.devices.connectedNow": "Connesso",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Solo Wi-Fi e Tailscale",+ "remote.devices.connectFrom": "Connetti da",+ "remote.devices.anywhere": "Ovunque",+ "remote.devices.more": "Opzioni per {name}",+ "remote.devices.removePhone": "Rimuovi telefono",+ "remote.devices.removed": "{name} rimosso.",+ "remote.e2e.anywhere": "Raggiungibile da ovunque · crittografia end-to-end",+ "remote.e2e.connecting": "Connessione a MausBot Relay…",+ "remote.e2e.local": "Su questa rete Wi-Fi e Tailscale · crittografia end-to-end"}diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex 475ac6027c..1e96fcf353 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -7532,5 +7532,33 @@"botApi.call.failed": "ボットは返事できませんでした","botApi.starter": "Bot API は上位プランで使えます。","botApi.password": "キーはパスワードと同じです。持っている人は、このボットが読めるものを読めます。",- "botApi.cantTake": "このボットの AI は Bot API の呼び出しを受けられません。使うには別の AI を選んでください。"+ "botApi.cantTake": "このボットの AI は Bot API の呼び出しを受けられません。使うには別の AI を選んでください。",+ "phone.code.e2e.scan": "スマホで {app} アプリを開いてスキャンしてください。",+ "phone.code.e2e.wifi": "このWi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "どこからでも",+ "phone.code.e2e.tailscaleOff": "このコンピュータで実行されていません",+ "phone.code.e2e.signIn": "サインインするとどこからでも接続できます",+ "phone.code.e2e.relayOff": "現在利用できません",+ "phone.code.e2e.encrypted": "エンドツーエンドで暗号化。読めるのはあなたのスマホとこのコンピュータだけです。",+ "phone.code.e2e.copyLink": "リンクをコピー",+ "phone.code.e2e.copied": "リンクをコピーしました。スマホで開いてください。",+ "phone.code.e2e.getApp": "アプリをお持ちでない場合はこちら",+ "phone.code.e2e.getAppDetail": "スマホのカメラでスキャンしてください。",+ "remote.devices.connected": "接続中 · {route}",+ "remote.devices.connectedLegacy": "接続中 · 暗号化するにはアプリを更新してください",+ "remote.devices.connectedNow": "接続中",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Wi-FiとTailscaleのみ",+ "remote.devices.connectFrom": "接続元",+ "remote.devices.anywhere": "どこからでも",+ "remote.devices.more": "{name} のオプション",+ "remote.devices.removePhone": "スマホを削除",+ "remote.devices.removed": "{name} を削除しました。",+ "remote.e2e.anywhere": "どこからでも接続可能 · エンドツーエンド暗号化",+ "remote.e2e.connecting": "MausBot Relay に接続中…",+ "remote.e2e.local": "このWi-FiとTailscale · エンドツーエンド暗号化"}diff --git a/src/locales/ko.json b/src/locales/ko.jsonindex aba845e535..fca33c33f3 100644--- a/src/locales/ko.json+++ b/src/locales/ko.json@@ -7198,5 +7198,33 @@"botApi.call.failed": "봇이 답할 수 없었음","botApi.starter": "Bot API는 상위 요금제에 포함됩니다.","botApi.password": "키는 비밀번호와 같습니다. 키를 가진 사람은 이 봇이 읽을 수 있는 것을 읽을 수 있습니다.",- "botApi.cantTake": "이 봇의 AI는 Bot API 호출을 받을 수 없습니다. 사용하려면 다른 AI를 선택하세요."+ "botApi.cantTake": "이 봇의 AI는 Bot API 호출을 받을 수 없습니다. 사용하려면 다른 AI를 선택하세요.",+ "phone.code.e2e.scan": "휴대폰에서 {app} 앱을 열고 스캔하세요.",+ "phone.code.e2e.wifi": "이 Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "어디서나",+ "phone.code.e2e.tailscaleOff": "이 컴퓨터에서 실행 중이 아님",+ "phone.code.e2e.signIn": "어디서나 연결하려면 로그인하세요",+ "phone.code.e2e.relayOff": "지금은 사용할 수 없음",+ "phone.code.e2e.encrypted": "종단 간 암호화됨. 휴대폰과 이 컴퓨터만 읽을 수 있습니다.",+ "phone.code.e2e.copyLink": "링크 복사",+ "phone.code.e2e.copied": "링크를 복사했습니다. 휴대폰에서 여세요.",+ "phone.code.e2e.getApp": "아직 앱이 없나요? 받기",+ "phone.code.e2e.getAppDetail": "휴대폰 카메라로 스캔하세요.",+ "remote.devices.connected": "연결됨 · {route}",+ "remote.devices.connectedLegacy": "연결됨 · 암호화하려면 앱을 업데이트하세요",+ "remote.devices.connectedNow": "연결됨",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Wi-Fi 및 Tailscale만",+ "remote.devices.connectFrom": "연결 위치",+ "remote.devices.anywhere": "어디서나",+ "remote.devices.more": "{name} 옵션",+ "remote.devices.removePhone": "휴대폰 제거",+ "remote.devices.removed": "{name}을(를) 제거했습니다.",+ "remote.e2e.anywhere": "어디서나 연결 가능 · 종단 간 암호화",+ "remote.e2e.connecting": "MausBot Relay에 연결 중…",+ "remote.e2e.local": "이 Wi-Fi 및 Tailscale · 종단 간 암호화"}diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex 1c4a1aa0bc..7c5e89193e 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -6613,5 +6613,33 @@"botApi.call.failed": "Bot nie mógł odpowiedzieć","botApi.starter": "Bot API jest dostępne w wyższym planie.","botApi.password": "Klucz jest jak hasło: kto go ma, może czytać to, co może czytać ten bot.",- "botApi.cantTake": "AI tego bota nie może przyjmować wywołań Bot API. Wybierz inne AI, aby z nich korzystać."+ "botApi.cantTake": "AI tego bota nie może przyjmować wywołań Bot API. Wybierz inne AI, aby z nich korzystać.",+ "phone.code.e2e.scan": "Otwórz aplikację {app} na telefonie i zeskanuj.",+ "phone.code.e2e.wifi": "Ta sieć Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "z dowolnego miejsca",+ "phone.code.e2e.tailscaleOff": "nie działa na tym komputerze",+ "phone.code.e2e.signIn": "Zaloguj się, by łączyć się z dowolnego miejsca",+ "phone.code.e2e.relayOff": "teraz niedostępne",+ "phone.code.e2e.encrypted": "Szyfrowanie end-to-end. Odczytać mogą je tylko Twój telefon i ten komputer.",+ "phone.code.e2e.copyLink": "Kopiuj link",+ "phone.code.e2e.copied": "Skopiowano link. Otwórz go na telefonie.",+ "phone.code.e2e.getApp": "Nie masz jeszcze aplikacji? Pobierz",+ "phone.code.e2e.getAppDetail": "Zeskanuj aparatem telefonu.",+ "remote.devices.connected": "Połączono · {route}",+ "remote.devices.connectedLegacy": "Połączono · zaktualizuj aplikację, by szyfrować",+ "remote.devices.connectedNow": "Połączono",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Tylko Wi-Fi i Tailscale",+ "remote.devices.connectFrom": "Łącz z",+ "remote.devices.anywhere": "Z dowolnego miejsca",+ "remote.devices.more": "Opcje dla {name}",+ "remote.devices.removePhone": "Usuń telefon",+ "remote.devices.removed": "Usunięto {name}.",+ "remote.e2e.anywhere": "Dostępny z dowolnego miejsca · szyfrowanie end-to-end",+ "remote.e2e.connecting": "Łączenie z MausBot Relay…",+ "remote.e2e.local": "W tej sieci Wi-Fi i przez Tailscale · szyfrowanie end-to-end"}diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 6590d7359d..0dff36dd42 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -9598,5 +9598,33 @@"connectedWorkspaces.switchError": "Não foi possível trocar de ambiente. Tente novamente.","connectedWorkspaces.forgetName": "Esquecer {name}","connectedWorkspaces.forgetError": "Não foi possível esquecer o ambiente. Tente novamente.",- "connectedWorkspaces.createError": "Não foi possível criar o ambiente. Confira a pasta de dados e tente novamente."+ "connectedWorkspaces.createError": "Não foi possível criar o ambiente. Confira a pasta de dados e tente novamente.",+ "phone.code.e2e.scan": "Abra o app {app} no celular e escaneie.",+ "phone.code.e2e.wifi": "Este Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "de qualquer lugar",+ "phone.code.e2e.tailscaleOff": "não está em execução neste computador",+ "phone.code.e2e.signIn": "Entre para acessar de qualquer lugar",+ "phone.code.e2e.relayOff": "indisponível no momento",+ "phone.code.e2e.encrypted": "Criptografia de ponta a ponta. Só seu celular e este computador podem ler.",+ "phone.code.e2e.copyLink": "Copiar link",+ "phone.code.e2e.copied": "Link copiado. Abra no seu celular.",+ "phone.code.e2e.getApp": "Ainda não tem o app? Baixe",+ "phone.code.e2e.getAppDetail": "Escaneie com a câmera do celular.",+ "remote.devices.connected": "Conectado · {route}",+ "remote.devices.connectedLegacy": "Conectado · atualize o app para criptografar",+ "remote.devices.connectedNow": "Conectado",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Só Wi-Fi e Tailscale",+ "remote.devices.connectFrom": "Conectar de",+ "remote.devices.anywhere": "Qualquer lugar",+ "remote.devices.more": "Opções de {name}",+ "remote.devices.removePhone": "Remover celular",+ "remote.devices.removed": "{name} removido.",+ "remote.e2e.anywhere": "Acessível de qualquer lugar · criptografia de ponta a ponta",+ "remote.e2e.connecting": "Conectando ao MausBot Relay…",+ "remote.e2e.local": "Neste Wi-Fi e Tailscale · criptografia de ponta a ponta"}diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex 1a0357f4d9..e7ee3c2648 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -6675,5 +6675,33 @@"botApi.call.failed": "Бот не смог ответить","botApi.starter": "Bot API входит в более высокий тариф.","botApi.password": "Ключ — как пароль: у кого он есть, тот может читать то, что может читать этот бот.",- "botApi.cantTake": "ИИ этого бота не может принимать вызовы Bot API. Выберите другой ИИ, чтобы их использовать."+ "botApi.cantTake": "ИИ этого бота не может принимать вызовы Bot API. Выберите другой ИИ, чтобы их использовать.",+ "phone.code.e2e.scan": "Откройте приложение {app} на телефоне и отсканируйте.",+ "phone.code.e2e.wifi": "Эта сеть Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "откуда угодно",+ "phone.code.e2e.tailscaleOff": "не запущен на этом компьютере",+ "phone.code.e2e.signIn": "Войдите, чтобы подключаться откуда угодно",+ "phone.code.e2e.relayOff": "сейчас недоступно",+ "phone.code.e2e.encrypted": "Сквозное шифрование. Прочитать могут только ваш телефон и этот компьютер.",+ "phone.code.e2e.copyLink": "Скопировать ссылку",+ "phone.code.e2e.copied": "Ссылка скопирована. Откройте её на телефоне.",+ "phone.code.e2e.getApp": "Ещё нет приложения? Скачать",+ "phone.code.e2e.getAppDetail": "Отсканируйте камерой телефона.",+ "remote.devices.connected": "Подключено · {route}",+ "remote.devices.connectedLegacy": "Подключено · обновите приложение для шифрования",+ "remote.devices.connectedNow": "Подключено",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Только Wi-Fi и Tailscale",+ "remote.devices.connectFrom": "Подключение из",+ "remote.devices.anywhere": "Откуда угодно",+ "remote.devices.more": "Параметры: {name}",+ "remote.devices.removePhone": "Удалить телефон",+ "remote.devices.removed": "{name} удалён.",+ "remote.e2e.anywhere": "Доступен откуда угодно · сквозное шифрование",+ "remote.e2e.connecting": "Подключение к MausBot Relay…",+ "remote.e2e.local": "В этой сети Wi-Fi и через Tailscale · сквозное шифрование"}diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex 371e366b4d..3d032c4c6e 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -5330,5 +5330,33 @@"botApi.call.failed": "Bot yanıtlayamadı","botApi.starter": "Bot API daha yüksek bir planla gelir.","botApi.password": "Anahtar parola gibidir: ona sahip olan, bu botun okuyabildiğini okuyabilir.",- "botApi.cantTake": "Bu botun yapay zekâsı Bot API çağrılarını alamaz. Kullanmak için başka bir yapay zekâ seçin."+ "botApi.cantTake": "Bu botun yapay zekâsı Bot API çağrılarını alamaz. Kullanmak için başka bir yapay zekâ seçin.",+ "phone.code.e2e.scan": "Telefonunda {app} uygulamasını aç ve tara.",+ "phone.code.e2e.wifi": "Bu Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "her yerden",+ "phone.code.e2e.tailscaleOff": "bu bilgisayarda çalışmıyor",+ "phone.code.e2e.signIn": "Her yerden erişmek için oturum aç",+ "phone.code.e2e.relayOff": "şu an kullanılamıyor",+ "phone.code.e2e.encrypted": "Uçtan uca şifreli. Yalnızca telefonun ve bu bilgisayar okuyabilir.",+ "phone.code.e2e.copyLink": "Bağlantıyı kopyala",+ "phone.code.e2e.copied": "Bağlantı kopyalandı. Telefonunda aç.",+ "phone.code.e2e.getApp": "Uygulama yok mu? İndir",+ "phone.code.e2e.getAppDetail": "Telefon kamerasıyla tara.",+ "remote.devices.connected": "Bağlı · {route}",+ "remote.devices.connectedLegacy": "Bağlı · şifrelemek için uygulamayı güncelle",+ "remote.devices.connectedNow": "Bağlı",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Yalnızca Wi-Fi ve Tailscale",+ "remote.devices.connectFrom": "Bağlantı yeri",+ "remote.devices.anywhere": "Her yerden",+ "remote.devices.more": "{name} seçenekleri",+ "remote.devices.removePhone": "Telefonu kaldır",+ "remote.devices.removed": "{name} kaldırıldı.",+ "remote.e2e.anywhere": "Her yerden erişilebilir · uçtan uca şifreli",+ "remote.e2e.connecting": "MausBot Relay'e bağlanılıyor…",+ "remote.e2e.local": "Bu Wi-Fi ve Tailscale'de · uçtan uca şifreli"}diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex afa02222cb..50f0232943 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -3340,5 +3340,33 @@"botApi.call.failed": "Бот не зміг відповісти","botApi.starter": "Bot API входить до вищого плану.","botApi.password": "Ключ — як пароль: хто його має, може читати те, що може читати цей бот.",- "botApi.cantTake": "ШІ цього бота не може приймати виклики Bot API. Виберіть інший ШІ, щоб ними користуватися."+ "botApi.cantTake": "ШІ цього бота не може приймати виклики Bot API. Виберіть інший ШІ, щоб ними користуватися.",+ "phone.code.e2e.scan": "Відкрийте застосунок {app} на телефоні та відскануйте.",+ "phone.code.e2e.wifi": "Ця мережа Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "звідусіль",+ "phone.code.e2e.tailscaleOff": "не запущено на цьому комп’ютері",+ "phone.code.e2e.signIn": "Увійдіть, щоб під’єднуватися звідусіль",+ "phone.code.e2e.relayOff": "зараз недоступно",+ "phone.code.e2e.encrypted": "Наскрізне шифрування. Прочитати можуть лише ваш телефон і цей комп’ютер.",+ "phone.code.e2e.copyLink": "Скопіювати посилання",+ "phone.code.e2e.copied": "Посилання скопійовано. Відкрийте його на телефоні.",+ "phone.code.e2e.getApp": "Ще немає застосунку? Завантажити",+ "phone.code.e2e.getAppDetail": "Відскануйте камерою телефона.",+ "remote.devices.connected": "Під’єднано · {route}",+ "remote.devices.connectedLegacy": "Під’єднано · оновіть застосунок для шифрування",+ "remote.devices.connectedNow": "Під’єднано",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Лише Wi-Fi і Tailscale",+ "remote.devices.connectFrom": "Під’єднання з",+ "remote.devices.anywhere": "Звідусіль",+ "remote.devices.more": "Параметри: {name}",+ "remote.devices.removePhone": "Видалити телефон",+ "remote.devices.removed": "{name} видалено.",+ "remote.e2e.anywhere": "Доступний звідусіль · наскрізне шифрування",+ "remote.e2e.connecting": "Під’єднання до MausBot Relay…",+ "remote.e2e.local": "У цій мережі Wi-Fi і через Tailscale · наскрізне шифрування"}diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 7ecb675564..4ccc6df864 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -5330,5 +5330,33 @@"botApi.call.failed": "Bot không trả lời được","botApi.starter": "Bot API có trong gói cao hơn.","botApi.password": "Khóa giống như mật khẩu: ai giữ khóa đều đọc được những gì bot này đọc được.",- "botApi.cantTake": "AI của bot này không nhận được lượt gọi Bot API. Hãy chọn AI khác để dùng."+ "botApi.cantTake": "AI của bot này không nhận được lượt gọi Bot API. Hãy chọn AI khác để dùng.",+ "phone.code.e2e.scan": "Mở ứng dụng {app} trên điện thoại và quét.",+ "phone.code.e2e.wifi": "Wi-Fi này",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "từ mọi nơi",+ "phone.code.e2e.tailscaleOff": "không chạy trên máy tính này",+ "phone.code.e2e.signIn": "Đăng nhập để truy cập từ mọi nơi",+ "phone.code.e2e.relayOff": "hiện không khả dụng",+ "phone.code.e2e.encrypted": "Mã hóa đầu cuối. Chỉ điện thoại của bạn và máy tính này đọc được.",+ "phone.code.e2e.copyLink": "Sao chép liên kết",+ "phone.code.e2e.copied": "Đã sao chép liên kết. Mở trên điện thoại.",+ "phone.code.e2e.getApp": "Chưa có ứng dụng? Tải về",+ "phone.code.e2e.getAppDetail": "Quét bằng camera điện thoại.",+ "remote.devices.connected": "Đã kết nối · {route}",+ "remote.devices.connectedLegacy": "Đã kết nối · cập nhật ứng dụng để mã hóa",+ "remote.devices.connectedNow": "Đã kết nối",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "Relay",+ "remote.devices.localOnly": "Chỉ Wi-Fi và Tailscale",+ "remote.devices.connectFrom": "Kết nối từ",+ "remote.devices.anywhere": "Mọi nơi",+ "remote.devices.more": "Tùy chọn cho {name}",+ "remote.devices.removePhone": "Gỡ điện thoại",+ "remote.devices.removed": "Đã gỡ {name}.",+ "remote.e2e.anywhere": "Truy cập được từ mọi nơi · mã hóa đầu cuối",+ "remote.e2e.connecting": "Đang kết nối MausBot Relay…",+ "remote.e2e.local": "Trên Wi-Fi này và Tailscale · mã hóa đầu cuối"}diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 055237c6f1..9cc1401a4b 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -4722,5 +4722,33 @@"botApi.call.failed": "機器人無法回答","botApi.starter": "Bot API 包含在更高的方案中。","botApi.password": "金鑰就像密碼:持有它的人可以讀取此機器人能讀取的內容。",- "botApi.cantTake": "此機器人的 AI 無法接收 Bot API 呼叫。請選擇其他 AI 來使用。"+ "botApi.cantTake": "此機器人的 AI 無法接收 Bot API 呼叫。請選擇其他 AI 來使用。",+ "phone.code.e2e.scan": "在手機上開啟 {app} App 並掃描。",+ "phone.code.e2e.wifi": "此 Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "隨時隨地",+ "phone.code.e2e.tailscaleOff": "未在此電腦上執行",+ "phone.code.e2e.signIn": "登入後可隨時隨地存取",+ "phone.code.e2e.relayOff": "目前無法使用",+ "phone.code.e2e.encrypted": "端對端加密。只有你的手機和這台電腦能讀取。",+ "phone.code.e2e.copyLink": "複製連結",+ "phone.code.e2e.copied": "已複製連結。請在手機上開啟。",+ "phone.code.e2e.getApp": "還沒有 App?取得",+ "phone.code.e2e.getAppDetail": "用手機相機掃描。",+ "remote.devices.connected": "已連線 · {route}",+ "remote.devices.connectedLegacy": "已連線 · 更新 App 以加密",+ "remote.devices.connectedNow": "已連線",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "中繼",+ "remote.devices.localOnly": "僅限 Wi-Fi 和 Tailscale",+ "remote.devices.connectFrom": "連線來源",+ "remote.devices.anywhere": "任何地方",+ "remote.devices.more": "{name} 的選項",+ "remote.devices.removePhone": "移除手機",+ "remote.devices.removed": "已移除 {name}。",+ "remote.e2e.anywhere": "隨時隨地可存取 · 端對端加密",+ "remote.e2e.connecting": "正在連線 MausBot Relay…",+ "remote.e2e.local": "在此 Wi-Fi 和 Tailscale 上 · 端對端加密"}diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex c243403667..2a9dd22496 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -7418,5 +7418,33 @@"botApi.call.failed": "机器人无法回答","botApi.starter": "Bot API 包含在更高的套餐中。","botApi.password": "密钥就像密码:持有它的人可以读取此机器人能读取的内容。",- "botApi.cantTake": "此机器人的 AI 无法接收 Bot API 调用。请选择其他 AI 来使用。"+ "botApi.cantTake": "此机器人的 AI 无法接收 Bot API 调用。请选择其他 AI 来使用。",+ "phone.code.e2e.scan": "在手机上打开 {app} 应用并扫描。",+ "phone.code.e2e.wifi": "此 Wi-Fi",+ "phone.code.e2e.tailscale": "Tailscale",+ "phone.code.e2e.relay": "MausBot Relay",+ "phone.code.e2e.fromAnywhere": "随时随地",+ "phone.code.e2e.tailscaleOff": "未在此电脑上运行",+ "phone.code.e2e.signIn": "登录后可随时随地访问",+ "phone.code.e2e.relayOff": "暂不可用",+ "phone.code.e2e.encrypted": "端到端加密。只有你的手机和这台电脑能读取。",+ "phone.code.e2e.copyLink": "复制链接",+ "phone.code.e2e.copied": "链接已复制。请在手机上打开。",+ "phone.code.e2e.getApp": "还没有应用?获取",+ "phone.code.e2e.getAppDetail": "用手机相机扫描。",+ "remote.devices.connected": "已连接 · {route}",+ "remote.devices.connectedLegacy": "已连接 · 更新应用以加密",+ "remote.devices.connectedNow": "已连接",+ "remote.devices.route.wifi": "Wi-Fi",+ "remote.devices.route.tailscale": "Tailscale",+ "remote.devices.route.relay": "中继",+ "remote.devices.localOnly": "仅限 Wi-Fi 和 Tailscale",+ "remote.devices.connectFrom": "连接来源",+ "remote.devices.anywhere": "任何地方",+ "remote.devices.more": "{name} 的选项",+ "remote.devices.removePhone": "移除手机",+ "remote.devices.removed": "已移除 {name}。",+ "remote.e2e.anywhere": "随时随地可访问 · 端到端加密",+ "remote.e2e.connecting": "正在连接 MausBot Relay…",+ "remote.e2e.local": "在此 Wi-Fi 和 Tailscale 上 · 端到端加密"}diff --git a/src/phone-relay-preview.tsx b/src/phone-relay-preview.tsxnew file mode 100644index 0000000000..4d8c01373f--- /dev/null+++ b/src/phone-relay-preview.tsx@@ -0,0 +1,86 @@+// Dev-only gallery of Remote access with the end-to-end phone connection, served at /phone-relay-preview.html; not in+// the packaged app. It mounts the real settings section and pairing screen over a fake companion bridge.+// ?view=phones|qr&e2e=on|off&relay=connected|off&skin=midnight|daylight&lang=de+import { StrictMode } from "react";+import { createRoot } from "react-dom/client";+import { CompanionSection } from "@/components/CompanionSection";+import { PhoneSetupFlowView, type CompanionState, type PhoneSetupController } from "@/components/PhoneSetupFlow";+import { phonePairingLink } from "../shared/pairing-link";+import { loadLocale } from "@/lib/i18n";+import { applySkinChoice, SKIN_IDS, type SkinId } from "@/lib/skins";+import { initialState, StoreContext } from "@/state/store";+import "./styles.css";++const params = new URLSearchParams(location.search);+const view = params.get("view") ?? "phones";+const e2eOn = params.get("e2e") !== "off";+const relayOn = params.get("relay") !== "off";+const skin = params.get("skin") ?? "midnight";+applySkinChoice(SKIN_IDS.includes(skin as SkinId) ? (skin as SkinId) : "midnight");+await loadLocale(params.get("lang") ?? "en");++const now = Date.now();+const K = "BJiFmi3bzpQUayMJErl6eqt24mUOvHEUR6uzutPTHfundIgyZxs3bSzUMydGOfgbWdwQshIyzzlMWqxMkNHnmd0";+const TOKEN = `omb_pair_${"Q".repeat(43)}`;+const device = (id: string, name: string, extra: object) => ({ id, name, createdAt: now - 9e8, lastSeenAt: now - 60_000, cloudDesktopAccess: false, ...extra });+let state: CompanionState = {+ enabled: true,+ keepAwake: false,+ port: 8810,+ devices: [+ device("ipad", "iPad", { lastSeenAt: now - 2 * 86_400_000, e2eAt: now - 5e8, routes: "any", route: null }),+ device("iphone", "Ada's iPhone 16", { e2eAt: now - 5e8, routes: "any", route: e2eOn ? "wifi" : null }),+ device("old", "Old Android", { routes: "any", route: null }),+ device("pixel", "Pixel 9", { e2eAt: now - 5e8, routes: "local", route: e2eOn ? "tailscale" : null }),+ ],+ connectedDeviceIds: ["iphone", "pixel", "old"],+ pairing: view === "qr" ? { code: "482913", token: TOKEN, expiresAt: now + 110_000 } : null,+ addresses: ["192.168.1.20", "100.101.102.103"],+ lan: "192.168.1.20",+ tailscale: "100.101.102.103",+ tailnetName: "ada-mac.tail1234.ts.net",+ discovery: { advertising: true, name: "Ada's MacBook" },+ ...(e2eOn+ ? { e2e: { enabled: true, relay: relayOn ? "connected" : "off", node: relayOn ? "relay1.openmausbot.com" : null, descriptor: relayOn ? { v: 1, k: K, h: "lz81isB3BuNV6rHgYgG3Wg", r: ["relay1.openmausbot.com", "relay2.openmausbot.com"] } : { v: 1, k: K } } }+ : {}),+};+const answer = async (next?: Partial<CompanionState>) => {+ state = { ...state, ...next };+ return state;+};+const bridge = {+ state: () => answer(),+ start: () => answer({ enabled: true }),+ stop: () => answer({ enabled: false }),+ keepAwake: () => answer(),+ refreshTailscale: () => answer(),+ pairing: () => answer(),+ renewPairing: () => answer(),+ cloudDesktop: () => answer(),+ browserControl: () => answer(),+ revoke: (id: string) => answer({ devices: state.devices.filter((each) => each.id !== id) }),+ routes: (id: string, routes: "any" | "local") => answer({ devices: state.devices.map((each) => (each.id === id ? { ...each, routes } : each)) }),+};+const account = { state: async () => ({ available: true, status: "ready", email: "[email protected]" }) };+(globalThis as unknown as { ogb: unknown }).ogb = { companion: bridge, companionAccount: account };++const link = phonePairingLink({ address: "192.168.1.20", port: 8810, token: TOKEN, code: e2eOn ? undefined : "482913", name: "Ada's MacBook",+ e2e: state.e2e?.descriptor });+const controller = {+ state, account: { available: true, status: "ready", email: "[email protected]" }, phase: "qr", email: "", code: "", codeSent: false,+ busy: false, accountBusy: false, error: null, accountError: null, pairingLink: link, secondsLeft: 110, address: "192.168.1.20",+ pairingPort: 8810, addressText: "192.168.1.20:8810", hostedReady: false, localFallback: true, tailscaleFallback: false,+ tailscaleAvailable: true, pairingExpired: false, setupTimedOut: false, act: async () => {}, accountAct: async () => {},+} as unknown as PhoneSetupController;++createRoot(document.getElementById("root")!).render(+ <StrictMode>+ <StoreContext.Provider value={{ state: initialState, dispatch: () => {} } as never}>+ <div className="min-h-screen bg-app p-8 text-ink">+ <div className={view === "qr" ? "mx-auto max-w-[520px] rounded-2xl border border-hairline/40 bg-card p-6" : "mx-auto max-w-[640px]"}>+ {view === "qr" ? <PhoneSetupFlowView controller={controller} /> : <CompanionSection profileEmail="[email protected]" />}+ </div>+ </div>+ </StoreContext.Provider>+ </StrictMode>,+);