Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
feat(lending): let your own Clouds run commands on this computer from the menu-bar icon (#3933)
Aditya Umale29b9400fa00a
diff --git a/electron/cloud-lending.node-test.mjs b/electron/cloud-lending.node-test.mjsindex 13ea8d8bb9..60fad4e423 100644--- a/electron/cloud-lending.node-test.mjs+++ b/electron/cloud-lending.node-test.mjs@@ -349,7 +349,7 @@ test("Pause is instant: the Cloud is told, running work is cancelled, nothing mohome.push({ action: "computer_call", tool_name: "click", arguments: {} });await delay(300);assert.equal((await readFile(driver.calls, "utf8")).trim(), "drag");- assert.deepEqual(summaries.at(-1), { lending: [], clouds: ["My Cloud"], using: [], paused: true, busy: null });+ assert.deepEqual(summaries.at(-1), { lending: [], clouds: ["My Cloud"], using: [], paused: true, terminal: false, busy: null });assert.equal(sharing.cloudState(env).problem, "paused");});diff --git a/electron/computer-sharing.mjs b/electron/computer-sharing.mjsindex 768d04d6aa..f77ef23305 100644--- a/electron/computer-sharing.mjs+++ b/electron/computer-sharing.mjs@@ -145,16 +145,16 @@ export function saidNo(record) {/** What each Cloud of the person's own gets by itself: the internet connection, their Chrome, apps and screen once* computer control works here (`screen`), and the home folder with editing (`home`, null when it can't be lent), on top- * of the folders lent to it already (`kept`, which Files may keep copies of) and the project folders the move adds. Never- * the terminal. At most 20 folders, the home folder first. */-export function automaticGrant({ kept = [], home = null, screen = false, projects = [] }) {+ * of the folders lent to it already (`kept`, which Files may keep copies of) and the project folders the move adds. The+ * terminal only when the person turned it on (`terminal`). At most 20 folders, the home folder first. */+export function automaticGrant({ kept = [], home = null, screen = false, projects = [], terminal = false }) {const byPath = new Map();const keptHome = home ? kept.find(folder => folder.path === home.path) : null;for (const folder of [...(home ? [keptHome ? { ...keptHome, write: true, home: true } : home] : []), ...kept, ...projects]) {const known = byPath.get(folder.path);byPath.set(folder.path, known ? { ...known, write: known.write || folder.write === true } : folder);}- return { folders: [...byPath.values()].slice(0, 20), screen: screen === true, internet: true, chrome: true, terminal: false };+ return { folders: [...byPath.values()].slice(0, 20), screen: screen === true, internet: true, chrome: true, terminal: terminal === true };}const lentAs = folder => `${folder.path}\n${folder.write === true}`;@@ -162,7 +162,7 @@ const lentAs = folder => `${folder.path}\n${folder.write === true}`;export function lendsAsWanted(record, wanted) {if (record?.enabled !== true || !record.cloud || !Array.isArray(record.folders)) return false;const have = new Set(record.folders.map(lentAs));- return record.internet === true && record.chrome === true && (record.computer === true) === wanted.screen && record.terminal !== true+ return record.internet === true && record.chrome === true && (record.computer === true) === wanted.screen && (record.terminal === true) === wanted.terminal&& have.size === wanted.folders.length && wanted.folders.every(folder => have.has(lentAs(folder)));}@@ -194,10 +194,13 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, cuconst presence = createLentScreenPresence({ idleSeconds, now });let records = {};let paused = false;+ /** The Cloud account that confirmed lending the terminal; another account signed in here gets none until it confirms. */+ let terminalAccount = null;try {const parsed = JSON.parse(fs.readFileSync(file, "utf8"));if (parsed?.version === 1 && parsed.records && typeof parsed.records === "object") records = parsed.records;paused = parsed?.automatic ? parsed.automatic.paused === true : Object.values(records).some(saidNo);+ if (typeof parsed?.automatic?.terminalAccount === "string") terminalAccount = parsed.automatic.terminalAccount;} catch {}const running = new Map();const grantVersions = new Map();@@ -220,6 +223,7 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, cuclouds: (paused ? ownClouds() : lent).map(env => env.name),using: using.map(env => env.name),paused,+ terminal: terminalAccount !== null && terminalAccount === signedInAccount(),busy: executing ?? (browsing ? { env: browsing, action: "internet" } : null),};};@@ -271,7 +275,7 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, cuconst store = next => {fs.mkdirSync(path.dirname(file), { recursive: true });const temporary = `${file}.tmp`;- fs.writeFileSync(temporary, JSON.stringify({ version: 1, records: next, automatic: { paused } }), { mode: 0o600 });+ fs.writeFileSync(temporary, JSON.stringify({ version: 1, records: next, automatic: { paused, ...(terminalAccount ? { terminalAccount } : {}) } }), { mode: 0o600 });fs.chmodSync(temporary, 0o600);fs.renameSync(temporary, file); records = next;};@@ -545,6 +549,7 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, cuconst current = cloud(env);return current?.status === "connected" && current.accountId && current.origin === env.origin ? current : null;};+ const signedInAccount = () => ownClouds().map(verifiedCloud).find(Boolean)?.accountId ?? null;/** The Cloud account and its machine must be verified now. A terminal (unrestricted commands as this user) only when* `input.terminal === true`. */const saveCloud = async (env, input, version = changeGrant(env.id)) => {@@ -586,7 +591,7 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, cuconst kept = records[env.id], current = verifiedCloud(env);if (closed || paused || !current) continue;const keptFolders = kept?.cloud?.accountId === current.accountId && Array.isArray(kept.folders) ? await lendable(kept.folders) : [];- const wanted = automaticGrant({ kept: keptFolders, home: homeFolder, screen: screenLent, projects: env.id === myCloud()?.id ? projectFolders : [] });+ const wanted = automaticGrant({ kept: keptFolders, home: homeFolder, screen: screenLent, projects: env.id === myCloud()?.id ? projectFolders : [], terminal: terminalAccount === current.accountId });if (closed || paused || records[env.id] !== kept) continue;if (!lendsAsWanted(kept, wanted)) lendNow(env, current, kept, wanted);else if (!running.has(env.id) && validRecord(kept) && cloudLendingVerdict(kept.cloud, cloud(env), env).allow) run(env, kept);@@ -675,6 +680,19 @@ export function createComputerSharing({ file, fetch: fetchImpl, environments, cuchanged();return lendAutomatically();},+ /** Whether every Cloud of the signed-in account's own may run commands here as this user, across restarts too. */+ lendTerminal(on) {+ const account = on === true ? signedInAccount() : null;+ if (closed || terminalAccount === account) return;+ if (on === true && !account) throw new Error("Sign in to your Cloud before lending it the terminal.");+ const before = terminalAccount;+ terminalAccount = account;+ try { store(records); } catch (error) { terminalAccount = before; throw error; }+ // A Cloud the pass can't verify now keeps its grant until it can, so its commands stop here.+ if (!account) for (const [id, grant] of Object.entries(records)) if (grant?.cloud && grant.terminal === true) stop(id);+ changed();+ return lendAutomatically();+ },/** Computer control started or stopped: apps and screen follow. */screenChanged: () => lendAutomatically(),revoke(env) {diff --git a/electron/lend-automatically.node-test.mjs b/electron/lend-automatically.node-test.mjsindex 5ad0263b7f..837c77e374 100644--- a/electron/lend-automatically.node-test.mjs+++ b/electron/lend-automatically.node-test.mjs@@ -70,7 +70,8 @@ function session() {state: () => state,isOwnCloud: origin => state.status === "connected" && (state.machine?.origin === origin || state.clouds.some(cloud => ownCloud(cloud) && cloud.origin === origin)),};- return { account, signOut: () => { state = { status: "signed-out", account: null, machine: null, clouds: [] }; }, signIn: () => { state = { ...session().account.state() }; } };+ return { account, signOut: () => { state = { status: "signed-out", account: null, machine: null, clouds: [] }; }, signIn: () => { state = { ...session().account.state() }; },+ signInAs: id => { state = { ...session().account.state(), account: { id } }; } };}/** This computer lending to every saved place the way main wires it: the session's own Clouds, its home folder, and@@ -98,7 +99,7 @@ async function computer(t, { places = [myCloud, clientA, acme], screen = () => freturn { dir, file, target, summaries, dials, signedIn, get sharing() { return sharing; }, restart: () => { sharing.close(); sharing = make(); return sharing; } };}-test("each Cloud of the person's own is lent this computer by itself: the internet connection, their Chrome and the home folder with editing; never the terminal", async t => {+test("each Cloud of the person's own is lent this computer by itself: the internet connection, their Chrome and the home folder with editing; not the terminal unless turned on", async t => {const homes = { [HOME]: cloudHome(), [OTHER]: cloudHome() };const dir = await scratch(t);const home = path.join(dir, "me");@@ -169,7 +170,7 @@ test("Pause stops every Cloud at once and lasts across restarts; Resume lends agawait until(() => homes[HOME].connects.length === 1 && homes[OTHER].connects.length === 1, "both Clouds to be lent");mac.sharing.pause();await until(() => homes[HOME].disconnects.length === 1 && homes[OTHER].disconnects.length === 1, "both Clouds to be told");- assert.deepEqual(mac.summaries.at(-1), { lending: [], clouds: ["My Cloud", "Client A"], using: [], paused: true, busy: null });+ assert.deepEqual(mac.summaries.at(-1), { lending: [], clouds: ["My Cloud", "Client A"], using: [], paused: true, terminal: false, busy: null });assert.equal(mac.sharing.lentToCloud(myCloud).paused, true, "Files keeps My Cloud's copies, and holds bots' changes there");const plans = path.join(mac.dir, "Plans");await mkdir(plans);@@ -241,6 +242,64 @@ test("a grant kept from before keeps its folders, which Files keeps copies of; tassert.equal(homes[HOME].results[0].isError, true, "no command runs here");});+test("the terminal is lent only once the person turns it on: every own Cloud gets it, it lasts across restarts, and turning it off takes it back", async t => {+ const homes = { [HOME]: cloudHome() };+ const mac = await computer(t, { homes, places: [myCloud] });+ mac.sharing.start();+ await until(() => homes[HOME].connects.length === 1, "the automatic grant to reach My Cloud");+ assert.equal(homes[HOME].connects[0].terminal, false, "off by default");+ assert.equal(mac.summaries.at(-1).terminal, false);+ await mac.sharing.lendTerminal(true);+ await until(() => homes[HOME].connects.length === 2, "the grant with the terminal to reach My Cloud");+ assert.equal(homes[HOME].connects[1].terminal, true);+ assert.equal(mac.summaries.at(-1).terminal, true);+ homes[HOME].push({ action: "run_command", command: "echo lent" });+ await until(() => homes[HOME].results.length === 1, "the command's answer");+ assert.notEqual(homes[HOME].results[0].isError, true, "the command ran here");+ const restarted = mac.restart();+ restarted.start();+ await until(() => homes[HOME].connects.length === 3, "the kept grant to reach My Cloud after a restart");+ assert.equal(homes[HOME].connects[2].terminal, true, "still lent after a restart");+ await restarted.lendTerminal(false);+ await until(() => homes[HOME].connects.length === 4, "the grant without the terminal to reach My Cloud");+ assert.equal(homes[HOME].connects[3].terminal, false);+});++test("a terminal choice that can't be saved is not kept, so nothing lends it later", async t => {+ const homes = { [HOME]: cloudHome() };+ const mac = await computer(t, { homes, places: [myCloud] });+ mac.sharing.start();+ await until(() => homes[HOME].connects.length === 1, "the automatic grant to reach My Cloud");+ // A folder where the file goes makes the save's rename fail on every platform.+ await rm(mac.file);+ await mkdir(mac.file);+ assert.throws(() => mac.sharing.lendTerminal(true));+ await rm(mac.file, { recursive: true });+ await mac.sharing.screenChanged();+ await delay(100);+ assert.equal(homes[HOME].connects.length, 1, "no grant with the terminal reached My Cloud");+ assert.equal(mac.summaries.at(-1).terminal, false);+});++test("the terminal is lent only to the account that turned it on: another account signed in here gets none until it does", async t => {+ const homes = { [HOME]: cloudHome() };+ const mac = await computer(t, { homes, places: [myCloud] });+ mac.sharing.start();+ await until(() => homes[HOME].connects.length === 1, "the automatic grant to reach My Cloud");+ await mac.sharing.lendTerminal(true);+ await until(() => homes[HOME].connects.length === 2, "the grant with the terminal to reach My Cloud");+ assert.equal(homes[HOME].connects[1].terminal, true);+ mac.signedIn.signInAs("acct_2");+ await mac.sharing.screenChanged();+ await until(() => homes[HOME].connects.length === 3, "the other account's grant to reach My Cloud");+ assert.equal(homes[HOME].connects[2].terminal, false, "the other account did not confirm");+ assert.equal(mac.summaries.at(-1).terminal, false);+ const restarted = mac.restart();+ restarted.start();+ await delay(200);+ assert.ok(homes[HOME].connects.slice(3).every(connect => connect.terminal === false), "not after a restart either");+});+test("the automatic grant, piece by piece: the home folder first with editing, folders kept as they were, project folders with editing, at most 20", () => {const folder = (name, write = false, extra = {}) => ({ id: randomUUID(), path: `/Users/me/${name}`, name, write, ...extra });const home = { id: randomUUID(), path: "/Users/me", name: "me", write: true, home: true };@@ -255,6 +314,8 @@ test("the automatic grant, piece by piece: the home folder first with editing, fassert.deepEqual(automaticGrant({}).folders, [], "no home folder where it can't be lent");const record = { enabled: true, cloud: { accountId: "a", origin: HOME }, folders: wanted.folders, internet: true, chrome: true, computer: true, terminal: false };assert.equal(lendsAsWanted(record, wanted), true);+ assert.equal(automaticGrant({ terminal: true }).terminal, true, "the terminal only when the person turned it on");+ assert.equal(lendsAsWanted({ ...record, terminal: true }, { ...wanted, terminal: true }), true);for (const changed of [{ terminal: true }, { chrome: false }, { internet: false }, { computer: false }, { enabled: false }, { cloud: undefined }, { folders: wanted.folders.slice(1) }]) {assert.equal(lendsAsWanted({ ...record, ...changed }, wanted), false, JSON.stringify(Object.keys(changed)));}@@ -330,7 +391,7 @@ test("the move's project folders are lent to My Cloud with editing on top; whileawait assert.rejects(mac.sharing.lendProjects([app]), /waits/);});-test("the menu-bar item: which Clouds are using this Mac, Pause or Resume, See activity, and nothing else to set", () => {+test("the menu-bar item: which Clouds are using this Mac, Pause or Resume, the terminal switch and See activity", () => {const trays = [];class Tray {constructor() { this.destroyed = false; trays.push(this); }@@ -338,17 +399,18 @@ test("the menu-bar item: which Clouds are using this Mac, Pause or Resume, See asetContextMenu(menu) { this.menu = menu; } isDestroyed() { return this.destroyed; } destroy() { this.destroyed = true; }}const clicked = [];+ const turned = [];const indicator = createLendingIndicator({ Tray, Menu: { buildFromTemplate: items => items }, nativeImage: { createFromPath: () => ({ resize: () => ({}) }) }, iconPath: "icon.png",- onPause: () => clicked.push("pause"), onResume: () => clicked.push("resume"), onActivity: () => clicked.push("activity"), device: "Mac" });+ onPause: () => clicked.push("pause"), onResume: () => clicked.push("resume"), onActivity: () => clicked.push("activity"), onTerminal: on => turned.push(on), device: "Mac" });const labels = () => trays.at(-1).menu.map(item => item.type === "separator" ? "-" : item.label);indicator.update({ clouds: [], using: [], paused: false });assert.equal(trays.length, 0, "nothing in the menu bar without a Cloud of the person's own");indicator.update({ clouds: ["My Cloud", "Client A"], using: [], paused: false });- assert.deepEqual(labels(), ["My Cloud and Client A can use this Mac", "-", "Pause", "See activity"]);+ assert.deepEqual(labels(), ["My Cloud and Client A can use this Mac", "-", "Pause", "Let Clouds run commands on this Mac", "See activity"]);assert.equal(trays[0].title, "");indicator.update({ clouds: ["My Cloud", "Client A"], using: ["Client A"], paused: false });assert.equal(trays.length, 1);- assert.deepEqual(labels(), ["Client A is using this Mac", "-", "Pause", "See activity"]);+ assert.deepEqual(labels(), ["Client A is using this Mac", "-", "Pause", "Let Clouds run commands on this Mac", "See activity"]);assert.equal(trays[0].title, "Client A is using this Mac");assert.equal(trays[0].tip, "OpenMausBot: Client A is using this Mac");trays[0].menu.find(item => item.label === "Pause").click();@@ -358,7 +420,17 @@ test("the menu-bar item: which Clouds are using this Mac, Pause or Resume, See aassert.equal(trays[0].title, "Paused");trays[0].menu.find(item => item.label === "Resume").click();assert.deepEqual(clicked, ["pause", "activity", "resume"]);- assert.ok(trays[0].menu.every(item => item.type !== "checkbox"), "no switch in it");+ indicator.update({ clouds: ["My Cloud"], using: [], paused: false, terminal: true });+ const terminal = () => trays[0].menu.find(item => item.label === "Let Clouds run commands on this Mac");+ assert.equal(terminal().checked, true);+ terminal().click();+ indicator.update({ clouds: ["My Cloud"], using: [], paused: false, terminal: false });+ assert.equal(terminal().checked, false);+ terminal().click();+ assert.deepEqual(turned, [false, true]);+ terminal().checked = true;+ terminal().click();+ assert.equal(terminal().checked, false, "a click the person cancels leaves the box as it was");indicator.update({ clouds: [], using: [], paused: true });assert.equal(trays[0].destroyed, true, "gone once there is no Cloud to resume");assert.deepEqual(indicatorText({ clouds: ["A", "B", "C"], using: ["A", "B", "C"], paused: false }, "PC"),diff --git a/electron/lending-dialogs.mjs b/electron/lending-dialogs.mjsindex ee57c52637..630bed36ff 100644--- a/electron/lending-dialogs.mjs+++ b/electron/lending-dialogs.mjs@@ -22,7 +22,24 @@ export function serverAccessDetail(env, { folders, terminal, computer }) {* }} deps*/export function createLendingDialogs({ dialog, window, validate, isHome = async () => false }) {+ let askingTerminal = false;return {+ /** Turning the terminal on runs `lend` only once the person confirms, one question at a time; turning it off never asks. */+ async lendTerminal(on, lend) {+ if (on) {+ if (askingTerminal) return;+ askingTerminal = true;+ try {+ const { response } = await dialog.showMessageBox({+ type: "warning", buttons: ["Let them run commands", "Cancel"], defaultId: 1, cancelId: 1,+ message: "Let your Clouds run commands on this computer?",+ detail: "Bots on your own Clouds could run any command on this computer as you, including reading and changing any file you can. You can turn this off from the OpenMausBot icon's menu.",+ });+ if (response !== 0) return;+ } finally { askingTerminal = false; }+ }+ await lend();+ },/** The folder or drive the person picks, read only and checked as every lent folder is; null when they cancel. The* home folder is lent only when it is picked here and confirmed here: the folders above it and the system disk never are. */async chooseFolder(title) {diff --git a/electron/lending-dialogs.node-test.mjs b/electron/lending-dialogs.node-test.mjsindex 4492a28504..2a4de694b3 100644--- a/electron/lending-dialogs.node-test.mjs+++ b/electron/lending-dialogs.node-test.mjs@@ -35,6 +35,29 @@ test("a picked folder is checked and lent read only; a cancelled picker lends noassert.deepEqual({ path: folder.path, name: folder.name, write: folder.write }, { path: "/Users/me/Plans", name: "Plans", write: false });});+test("the terminal is lent only after its warning's own yes, one question at a time; turning it off never asks", async () => {+ for (const [response, lent] of [[0, true], [1, false], [-1, false]]) {+ const { dialog, calls } = fakeDialog({ response });+ let lends = 0;+ await createLendingDialogs({ dialog, window: liveWindow, validate: named }).lendTerminal(true, async () => { lends += 1; });+ assert.equal(lends, lent ? 1 : 0, `response ${response}`);+ assert.equal(calls[0][1].defaultId, 1, "Cancel is the default");+ }+ let answer;+ const slow = { showMessageBox: () => new Promise(resolve => { answer = resolve; }) };+ const dialogs = createLendingDialogs({ dialog: slow, window: liveWindow, validate: named });+ let lends = 0;+ const first = dialogs.lendTerminal(true, async () => { lends += 1; });+ await dialogs.lendTerminal(true, async () => { lends += 1; });+ answer({ response: 0 });+ await first;+ assert.equal(lends, 1, "a second click while the question is open lends nothing more");+ const off = fakeDialog();+ let stopped = 0;+ await createLendingDialogs({ dialog: off.dialog, window: liveWindow, validate: named }).lendTerminal(false, async () => { stopped += 1; });+ assert.deepEqual([stopped, off.calls.length], [1, 0]);+});+test("the whole home folder is lent only after its own warning, and is named in the access dialog", async () => {const win = liveWindow(), isHome = async (path) => path === "/Users/me";for (const [response, lent] of [[0, true], [1, false], [-1, false]]) {diff --git a/electron/lending-indicator.mjs b/electron/lending-indicator.mjsindex c8046d5995..2600f377b0 100644--- a/electron/lending-indicator.mjs+++ b/electron/lending-indicator.mjs@@ -12,10 +12,11 @@ export function indicatorText({ clouds, using, paused }, device) {return { line: `${listed(clouds)} can use ${it}`, title: "" };}-export function createLendingIndicator({ Tray, Menu, nativeImage, iconPath, onPause, onResume, onActivity, device = deviceWord() }) {+export function createLendingIndicator({ Tray, Menu, nativeImage, iconPath, onPause, onResume, onActivity, onTerminal, device = deviceWord() }) {let tray = null;let shown = null;const draw = view => {+ if (!tray || tray.isDestroyed()) return;const { line, title } = indicatorText(view, device);tray.setToolTip(`OpenMausBot: ${line}`);// Electron shows a tray title beside the icon on macOS only.@@ -24,12 +25,15 @@ export function createLendingIndicator({ Tray, Menu, nativeImage, iconPath, onPa{ label: line, enabled: false },{ type: "separator" },view.paused ? { label: "Resume", click: () => onResume() } : { label: "Pause", click: () => onPause() },+ ...view.paused ? [] : [{ label: `Let Clouds run commands on this ${device}`, type: "checkbox", checked: view.terminal,+ // Electron 43 ticks a checkbox on click by itself: the menu keeps the saved choice until the person confirms one.+ click: () => { draw(view); onTerminal(!view.terminal); } }],{ label: "See activity", click: () => onActivity() },]));};return {- update({ clouds = [], using = [], paused = false }) {- const next = { clouds: [...clouds], using: paused ? [] : [...using], paused: paused === true };+ update({ clouds = [], using = [], paused = false, terminal = false }) {+ const next = { clouds: [...clouds], using: paused ? [] : [...using], paused: paused === true, terminal: terminal === true };if (shown && JSON.stringify(next) === JSON.stringify(shown)) return;shown = next;if (!next.clouds.length) { if (tray && !tray.isDestroyed()) tray.destroy(); tray = null; return; }diff --git a/electron/main.mjs b/electron/main.mjsindex 040abcb7dd..7f738a69b0 100644--- a/electron/main.mjs+++ b/electron/main.mjs@@ -1514,10 +1514,9 @@ const lendingActivity = createActivityWindow({ BrowserWindow, icon: APP_ICON, balet lendingTray = null;function lendingIndicator() {lendingTray ??= createLendingIndicator({- Tray, Menu, nativeImage, iconPath: APP_ICON,- onPause: () => sharingController().pause(),+ Tray, Menu, nativeImage, iconPath: APP_ICON, onPause: () => sharingController().pause(), onActivity: () => lendingActivity.show(),onResume: () => void sharingController().resume()?.catch(error => slog(`lending resume: ${error?.message ?? error}`)),- onActivity: () => lendingActivity.show(),+ onTerminal: on => void lendingDialogs.lendTerminal(on, () => sharingController().lendTerminal(on)).catch(error => slog(`lending terminal: ${error?.message ?? error}`)),});return lendingTray;}diff --git a/server/shared-computers.ts b/server/shared-computers.tsindex 474641283d..167238edbb 100644--- a/server/shared-computers.ts+++ b/server/shared-computers.ts@@ -73,7 +73,7 @@ export function responseGone(res: { once(event: "close", listener: () => void):export function sharedComputerScopeRefusal(registration: Registration, operation: Pick<Operation, "action" | "folder_id">): string | null {switch (operation.action) {case "run_command":- return registration.terminal ? null : `${registration.name} does not lend its terminal, so commands cannot run there. Do not try to run the command another way or anywhere else; use its folders, or tell the person in one sentence what to run themselves.`;+ return registration.terminal ? null : `${registration.name} does not lend its terminal, so commands cannot run there. Do not try to run the command another way or anywhere else; use its folders, or tell the person in one sentence what to run themselves, or, when it is their own Cloud, that they can turn on "Let Clouds run commands on this ${deviceWord(registration.platform)}" from the OpenMausBot icon in its menu bar or taskbar.`;case "computer_tools":case "computer_call":return registration.computer ? null : `Apps and screen are not lent to this server. ${lendScreenSteps(deviceWord(registration.platform))}`;