Skip to content

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

Turn off a bot's Meetings, Data, Pages, Images or Email tools to cut its requests (#5934)

Milind Sonia1a1b040bca4
diff --git a/packages/phone-protocol/src/tool-groups.ts b/packages/phone-protocol/src/tool-groups.ts
new file mode 100644
index 0000000000..297b5e5364
--- /dev/null
+++ b/packages/phone-protocol/src/tool-groups.ts
@@ -0,0 +1,33 @@
+/** Groups of built-in tools a person can turn off for one bot (`Bot.toolsOff`), so its model is not sent their
+ * definitions on every request. A trim, not a permission: a bot with a group on is held to the same rules as before. */
+export const TOOL_GROUPS = ["meetings", "data", "pages", "images", "email"] as const;
+export type ToolGroup = (typeof TOOL_GROUPS)[number];
+
+/** How a group is named where the server writes to the bot or the person in English. */
+export const TOOL_GROUP_LABELS: Readonly<Record<ToolGroup, string>> = {
+ meetings: "Meetings", data: "Data", pages: "Pages and apps", images: "Images", email: "Email",
+};
+
+/** About how many tokens each group's tool definitions add to every request where the workspace has the group. */
+export const TOOL_GROUP_TOKENS: Readonly<Record<ToolGroup, number>> = {
+ meetings: 900, data: 1600, pages: 1500, images: 200, email: 1300,
+};
+
+/** The agents server's environment variable that carries `toolsOff`: group ids joined with commas. */
+export const TOOLS_OFF_ENV = "OMB_TOOLS_OFF";
+
+export function isToolGroup(value: unknown): value is ToolGroup {
+ return typeof value === "string" && (TOOL_GROUPS as readonly string[]).includes(value);
+}
+
+/** A saved or sent `toolsOff`: known groups only, each once, in TOOL_GROUPS order; null when it is not a list of them. */
+export function parseToolsOff(value: unknown): ToolGroup[] | null {
+ if (!Array.isArray(value) || !value.every(isToolGroup)) return null;
+ return TOOL_GROUPS.filter((group) => value.includes(group));
+}
+
+/** The groups OMB_TOOLS_OFF names; an unknown name is ignored, so an older proxy never fails a turn. */
+export function toolsOffFromEnv(value: string | undefined): ToolGroup[] {
+ const named = (value ?? "").split(",");
+ return TOOL_GROUPS.filter((group) => named.includes(group));
+}
diff --git a/packages/phone-protocol/src/wire.ts b/packages/phone-protocol/src/wire.ts
index 0c297c35ec..0a6b47f65c 100644
--- a/packages/phone-protocol/src/wire.ts
+++ b/packages/phone-protocol/src/wire.ts
@@ -4,7 +4,7 @@
import type { PresenceFrame } from "./team-presence.ts";
import type { DataBroadcast } from "./data-surface.ts";
import type { ApprovalMode } from "./approval-mode.ts";
-import type { ToolScope } from "./tool-scope.ts";
+import type { ToolScope } from "./tool-scope.ts"; import type { ToolGroup } from "./tool-groups.ts";
import type { CommandAllowlistCandidate } from "./command-allowlist.ts";
import type { TurnDigest } from "./digest.ts";
import type { BotAvatarCrop, MascotFaceColor } from "./bot-avatar.ts";
@@ -334,6 +334,8 @@ export interface WireBot extends DefaultBotFields, BotAccessFields {
xResearch?: boolean;
/** Whether this bot uses native memory. Absent/true = enabled. */
memoryEnabled?: boolean;
+ /** Built-in tool groups turned off for this bot (shared/tool-groups.ts). Absent or empty: all on. */
+ toolsOff?: ToolGroup[];
/** Queue direct-chat messages behind outstanding delegated work. */
parkDirectMessages?: boolean;
/** true after an edit/branch-switch rewound the visible conversation. */
diff --git a/server/agents-turn.test.ts b/server/agents-turn.test.ts
index a85df51c0e..08314e6621 100644
--- a/server/agents-turn.test.ts
+++ b/server/agents-turn.test.ts
@@ -85,6 +85,23 @@ describe("one conversation's agents tools", () => {
expect(await names({ ...CHAT, bot: { ...CHAT.bot, xResearch: false } })).toEqual([]);
});
+ it("leaves out the tool groups the bot's person turned off, on every kind of turn, and only for that bot", async () => {
+ const off = { ...CHAT, host: { ...HOST, meetings: true, imageGeneration: true }, bot: { ...CHAT.bot, toolsOff: ["meetings", "pages"] } };
+ const turns = await everyTurn(off);
+ for (const { kind, env, wire } of turns) {
+ expect(env.OMB_TOOLS_OFF, kind).toBe("meetings,pages");
+ expect(wire, kind).toBe(turns[0]!.wire);
+ }
+ const names = (wire: string) => (JSON.parse(wire) as { tools: Array<{ name: string }> }).tools.map((tool) => tool.name);
+ const kept = names(turns[0]!.wire), everything = names((await everyTurn({ ...off, bot: CHAT.bot }))[0]!.wire);
+ for (const tool of ["join_meeting", "show_html", "publish_page"]) {
+ expect(everything).toContain(tool);
+ expect(kept).not.toContain(tool);
+ }
+ expect(kept).toContain("generate_image");
+ expect((await everyTurn(CHAT))[0]!.env.OMB_TOOLS_OFF).toBe("");
+ });
+
it("leaves select_computer out only where the conversation can never pick a computer", async () => {
const selects = async (conversation: AgentsConversation) => (await everyTurn(conversation))[0]!.wire.includes('"name":"select_computer"');
expect(await selects({ ...CHAT, bot: { ...CHAT.bot, computer: "off" } })).toBe(false);
diff --git a/server/agents-turn.ts b/server/agents-turn.ts
index f77c3e08de..67b1c1f992 100644
--- a/server/agents-turn.ts
+++ b/server/agents-turn.ts
@@ -4,11 +4,12 @@
// when it calls it.
import { AGENTS_PROXY_ENV } from "./agents-bridge-switch.ts";
import { roleToolEnv } from "./chief-level.ts";
+import { TOOLS_OFF_ENV } from "../shared/tool-groups.ts";
/** The facts of a conversation that decide its agents tools. A settings change may change them; a turn never does. */
export interface AgentsConversation {
threadId: string;
- bot: NonNullable<Parameters<typeof roleToolEnv>[0]> & { id: string; computer?: string; memoryEnabled?: boolean; xResearch?: boolean };
+ bot: NonNullable<Parameters<typeof roleToolEnv>[0]> & { id: string; computer?: string; memoryEnabled?: boolean; xResearch?: boolean; toolsOff?: readonly string[] };
/** A room's thread: rooms refuse widgets, pages and a computer pick. */
room: boolean;
/** The bot works on its team's cloud computer, so it has no computer of its own to pick. */
@@ -52,6 +53,7 @@ export function agentsServerEnv(conversation: AgentsConversation, turn: AgentsTu
OMB_MEETINGS: flag(host.meetings === true && !conversation.room),
OMB_APP_HOSTING: flag(host.appHosting === true),
OMB_COMPUTER_SELECTION: flag(!conversation.room && bot.computer !== "off" && !conversation.teamComputer && !conversation.botDriven),
+ [TOOLS_OFF_ENV]: (bot.toolsOff ?? []).join(","),
};
}
diff --git a/server/app-settings/host.test.ts b/server/app-settings/host.test.ts
index 442ecd1d8e..72e8d970c8 100644
--- a/server/app-settings/host.test.ts
+++ b/server/app-settings/host.test.ts
@@ -481,6 +481,23 @@ describe("every other setting applies at once with Undo, Full access or not", ()
expect(fx.botPatches).toEqual([{ botId: "kiwi", body: { memoryEnabled: false, computer: "local" } }, { botId: "kiwi", body: { memoryEnabled: true, computer: null } }]);
});
+ it("turns one bot's tool groups off and on by name, keeps the rest as they were, and Undo puts the list back", async () => {
+ const fx = fixture();
+ (fx.bots.find((bot) => bot.id === "kiwi") as { toolsOff?: string[] }).toolsOff = ["images"];
+ await fx.set("bots.tools", JSON.stringify({ botId: "kiwi", turnOff: ["pages", "meetings"] }));
+ expect(fx.cards()[0]!.card.subtitle).toBe("Kiwi: turn off Pages and apps, Meetings");
+ await fx.set("bots.tools", JSON.stringify({ botId: "kiwi", turnOn: ["images"] }));
+ expect(await fx.undo()).toEqual({ claimed: true, state: "undone" });
+ expect(fx.botPatches).toEqual([
+ { botId: "kiwi", body: { toolsOff: ["meetings", "pages", "images"] } },
+ { botId: "kiwi", body: { toolsOff: ["meetings", "pages"] } },
+ { botId: "kiwi", body: { toolsOff: ["meetings", "pages", "images"] } },
+ ]);
+ expect((await fx.set("bots.tools", JSON.stringify({ botId: "kiwi", turnOff: ["browser"] }))).status).toBe(400);
+ expect((await fx.set("bots.tools", JSON.stringify({ botId: "kiwi", turnOff: ["data"], turnOn: ["data"] }))).status).toBe(400);
+ expect((await fx.set("bots.tools", JSON.stringify({ botId: "kiwi" }))).status).toBe(400);
+ });
+
it("the browser proxy takes only a socks5 address, reads as set or not set, and Undo clears it", async () => {
const fx = fixture();
expect((await fx.set("desktops.browserProxy", "http://proxy.example:8080")).status).toBe(400);
diff --git a/server/app-settings/registry-bots.ts b/server/app-settings/registry-bots.ts
index 712d682051..5625c40b16 100644
--- a/server/app-settings/registry-bots.ts
+++ b/server/app-settings/registry-bots.ts
@@ -4,6 +4,7 @@ import { z } from "zod";
import { approvalModeFor, type ApprovalMode } from "../../shared/approval-mode.ts";
import { BOT_PROFILE_LIMITS } from "../../shared/bot-profile.ts";
+import { TOOL_GROUP_LABELS, TOOL_GROUPS, type ToolGroup } from "../../shared/tool-groups.ts";
import { EFFORT_LEVELS, MAUS_COLOR_NAMES } from "../../shared/wire.ts";
import type { BotRecord } from "../store.ts";
import { withoutKeys, type RegistryDeps, type SettingEntry, type WritableSpec } from "./registry.ts";
@@ -51,6 +52,9 @@ const OTHER = {
computer: { label: "computer", value: z.enum(["auto", "cloud", "vm", "local", "browser", "off"]), shown: (kind: unknown) => COMPUTER[kind as keyof typeof COMPUTER], was: (one: BotRecord) => one.computer ?? "auto" },
} as const;
type OtherField = keyof typeof OTHER;
+const toolGroups = z.array(z.enum(TOOL_GROUPS)).max(TOOL_GROUPS.length).optional();
+const offNow = (one: BotRecord): ToolGroup[] => TOOL_GROUPS.filter((group) => one.toolsOff?.includes(group));
+const groupNames = (groups: readonly ToolGroup[]) => groups.map((group) => TOOL_GROUP_LABELS[group]).join(", ");
export function botEntries(deps: Pick<RegistryDeps, "bots" | "engines" | "patchBot">, writable: (spec: WritableSpec) => SettingEntry): SettingEntry[] {
const bot = (id: string) => deps.bots().find((candidate) => candidate.id === id);
@@ -121,6 +125,19 @@ export function botEntries(deps: Pick<RegistryDeps, "bots" | "engines" | "patchB
describe: (show: boolean) => (deps.bots().some((one) => one.defaultBot) ? { change: show ? "Show MausBot in the sidebar" : "Take MausBot out of the sidebar; it keeps working" } : { refusal: "This place has no MausBot of its own." }),
write: (show: boolean) => { const helper = deps.bots().find((one) => one.defaultBot); return helper ? deps.patchBot(helper.id, { sidebarHidden: !show }) : Promise.resolve("This place has no MausBot of its own."); },
}),
+ perBot({
+ id: "bots.tools", label: "Bot tool groups", where: "a bot's Settings",
+ help: `Turn groups of one bot's built-in tools off to make every request smaller, or back on: ${TOOL_GROUPS.map((group) => `${group} (${TOOL_GROUP_LABELS[group]})`).join(", ")}. Memory, X research, the browser and connected apps have their own settings.`,
+ synonyms: ["tools", "tool groups", "turn off tools", "meetings", "data", "pages", "publish", "images", "email", "tokens", "smaller requests"],
+ value: forBot({ turnOff: toolGroups, turnOn: toolGroups })
+ .refine((value) => Boolean(value.turnOff?.length || value.turnOn?.length), "name a group in turnOff or turnOn")
+ .refine((value) => !value.turnOff?.some((group) => value.turnOn?.includes(group)), "a group can't be in both turnOff and turnOn"),
+ allowed: `{"botId","turnOff"?:[...],"turnOn"?:[...]} with groups from ${TOOL_GROUPS.join(", ")}`,
+ read: everyBot((one) => (offNow(one).length ? `off: ${groupNames(offNow(one))}` : "all on")),
+ effect: (one, { turnOff = [], turnOn = [] }) => ({ change: `${one.name}: ${[turnOff.length ? `turn off ${groupNames(turnOff)}` : "", turnOn.length ? `turn on ${groupNames(turnOn)}` : ""].filter(Boolean).join("; ")}` }),
+ was: (one, { botId }) => ({ botId, turnOff: offNow(one), turnOn: TOOL_GROUPS.filter((group) => !offNow(one).includes(group)) }),
+ patch: (one, { turnOff = [], turnOn = [] }) => ({ toolsOff: TOOL_GROUPS.filter((group) => turnOff.includes(group) || (offNow(one).includes(group) && !turnOn.includes(group))) }),
+ }),
perBot({
id: "bots.settings", label: "Other bot settings", help: `More of one bot's own settings: ${Object.values(OTHER).map((field) => field.label).join(", ")}.`, where: "a bot's Settings",
synonyms: ["voice", "voice notes", "memory", "notifications", "browser", "instructions", "soul", "title", "description", "reply style", "computer", "desktop", "composio", "x research", "keep warm"],
diff --git a/server/bot-access.test.ts b/server/bot-access.test.ts
index f36e3d1f51..edd925f7f4 100644
--- a/server/bot-access.test.ts
+++ b/server/bot-access.test.ts
@@ -102,7 +102,8 @@ describe("what a request needs", () => {
expect(memberBotPatchViolation({ color: "teal", name: "Mine" }, "chat", true, true)).toBeNull();
expect(memberBotPatchViolation({ color: "teal" }, "edit", false, true)).toBeNull();
expect(memberBotPatchViolation({ soul: "x" }, "chat")).toBe("soul");
- expect(memberBotPatchViolation({ soul: "x", modelSelection: {}, threadId: "t", composio: true, connectorTools: {}, mcpServers: [] }, "edit")).toBeNull();
+ expect(memberBotPatchViolation({ soul: "x", modelSelection: {}, threadId: "t", composio: true, connectorTools: {}, mcpServers: [], toolsOff: ["data"] }, "edit")).toBeNull();
+ expect(memberBotPatchViolation({ toolsOff: ["data"] }, "chat")).toBe("toolsOff");
for (const field of ["approvalMode", "autoApprove", "alwaysAllow", "cwd", "computer", "section", "chiefOfStaff", "peers", "visibility", "access", "reportsTo", "browserProfile"]) {
expect(memberBotPatchViolation({ [field]: null }, "edit"), field).toBe(field);
}
diff --git a/server/bot-box/env.ts b/server/bot-box/env.ts
index 020e640f0a..cbe8ce03c3 100644
--- a/server/bot-box/env.ts
+++ b/server/bot-box/env.ts
@@ -20,7 +20,7 @@ export const BOX_ENV_OMB_NAMES: ReadonlySet<string> = new Set([
"OMB_HARNESS_URL", "OMB_BOT_ID", "OMB_THREAD_ID", "OMB_COMMS_TOKEN", "OMB_EXTERNAL_RUNTIME",
"OMB_CHIEF_OF_STAFF", "OMB_MAUSBOT", "OMB_SKILL_AUTHORING_ENABLED", "OMB_MEMORY_ENABLED", "OMB_SHARED_COMPUTERS_ENABLED",
"OMB_VOICE_NOTES", "OMB_X_RESEARCH", "OMB_RESEARCH", "OMB_TEAM_PEOPLE", "OMB_COMPUTER_SELECTION", "OMB_ROOM",
- "OMB_IMAGE_GENERATION", "OMB_MEETINGS", "OMB_APP_HOSTING", "OMB_AGENTS_TOOL_BRIDGE", "OMB_AGENTS_DEFER_TOOLS", "OMB_TOOL_LIMIT", "OMB_TOOL_SCHEMA_PROFILE",
+ "OMB_IMAGE_GENERATION", "OMB_MEETINGS", "OMB_APP_HOSTING", "OMB_TOOLS_OFF", "OMB_AGENTS_TOOL_BRIDGE", "OMB_AGENTS_DEFER_TOOLS", "OMB_TOOL_LIMIT", "OMB_TOOL_SCHEMA_PROFILE",
"OMB_MCP_CONFIG", "OMB_MCP_RESTART", "OMB_MCP_RESULT_BUDGET",
"OMB_HOOK_URL", "OMB_HOOK_TOKEN_FILE", "OMB_HOOK_TIMEOUT_MS", "OMB_PERMISSION_TOOL_SCOPE",
"OMB_CONNECTOR_UPSTREAM_URL", "OMB_CONNECTOR_UPSTREAM_HEADERS", "OMB_CONNECTOR_TOKEN", "OMB_CONNECTOR_ALLOWED_TOOLS",
diff --git a/server/drivers/agents-bridge-wire.test.ts b/server/drivers/agents-bridge-wire.test.ts
index 3f9944fcfa..09239caaea 100644
--- a/server/drivers/agents-bridge-wire.test.ts
+++ b/server/drivers/agents-bridge-wire.test.ts
@@ -26,6 +26,8 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { waitForExit } from "../testing/cleanup.ts";
import { FIND_TOOL, USE_TOOL, createToolBridge, type BridgeTool } from "./agents-bridge.ts";
import { availableTools, catalogProfileFromEnv } from "./agents-catalog.ts";
+import { toolsOffNames } from "./agents-tool-groups.ts";
+import { toolsOffFromEnv } from "../../shared/tool-groups.ts";
const HERE = dirname(fileURLToPath(import.meta.url));
const PROXY_SOURCE = join(HERE, "agents-proxy.ts");
@@ -70,6 +72,7 @@ function profiles(): Record<string, Record<string, string>> {
all["default+images"] = { ...all.default!, OMB_IMAGE_GENERATION: "1" };
all["skills+shared+voice+x+team+images+hosting"] = { ...all["skills+shared+voice+x+team+images"]!, OMB_APP_HOSTING: "1" };
all["default+hosting"] = { ...all.default!, OMB_APP_HOSTING: "1" };
+ all["default+tools-off"] = { ...all.default!, OMB_TOOLS_OFF: "pages,meetings" };
return all;
}
@@ -114,6 +117,7 @@ const BUDGET_BASELINE: Record<string, number> = {
"default+images": 18410,
"skills+shared+voice+x+team+images+hosting": 20683,
"default+hosting": 19758,
+ "default+tools-off": 17781,
};
type RpcAnswer = { id: number; result?: { tools?: unknown[]; content?: Array<{ text: string }>; isError?: boolean }; error?: { code: number; message: string } };
@@ -285,8 +289,9 @@ describe("agents proxy tools/list golden with the tool bridge on", () => {
expect(base).toEqual(["tool_result_read", "list_room_targets", "coordinate_bots", "list_bots", "list_rooms", "select_computer", "attach_file", "publish_page", "post_to_room", "post_to_thread", "request_credential", "request_sign_in", "fill_login", "message_person", "memory_update"]);
for (const name of Object.keys(PROFILES)) {
const selects = PROFILES[name]!.OMB_COMPUTER_SELECTION === "1";
+ const off = toolsOffNames(toolsOffFromEnv(PROFILES[name]!.OMB_TOOLS_OFF));
// publish_app puts an app on the public web, so the host counts it as outbound and it is never behind use_tool.
- expect(hotOf(name).filter((tool) => tool !== "send_voice_note" && tool !== "publish_app"), name).toEqual(selects ? base : base.filter((tool) => tool !== "select_computer"));
+ expect(hotOf(name).filter((tool) => tool !== "send_voice_note" && tool !== "publish_app"), name).toEqual(base.filter((tool) => (selects || tool !== "select_computer") && !off.has(tool)));
expect(hotOf(name).includes("publish_app"), name).toBe(PROFILES[name]!.OMB_APP_HOSTING === "1");
expect(hotOf(name).includes("send_voice_note"), name).toBe(PROFILES[name]!.OMB_VOICE_NOTES === "1");
}
diff --git a/server/drivers/agents-catalog-goldens/bridged.profiles.json b/server/drivers/agents-catalog-goldens/bridged.profiles.json
index 9b0785ce6e..744559494a 100644
--- a/server/drivers/agents-catalog-goldens/bridged.profiles.json
+++ b/server/drivers/agents-catalog-goldens/bridged.profiles.json
@@ -702,5 +702,27 @@
"find_tool",
"use_tool"
]
+ },
+ "default+tools-off": {
+ "bytes": 17781,
+ "sha256": "553eb4ff5e7d8a212618a6014c6d9df35f27e37625c86cf219118ba7ad7f5d9c",
+ "tools": [
+ "tool_result_read",
+ "list_room_targets",
+ "coordinate_bots",
+ "list_bots",
+ "list_rooms",
+ "select_computer",
+ "attach_file",
+ "post_to_room",
+ "post_to_thread",
+ "request_credential",
+ "request_sign_in",
+ "fill_login",
+ "message_person",
+ "memory_update",
+ "find_tool",
+ "use_tool"
+ ]
}
}
diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.json
index a39426934d..dd99aad730 100644
--- a/server/drivers/agents-catalog-goldens/profiles.json
+++ b/server/drivers/agents-catalog-goldens/profiles.json
@@ -1697,5 +1697,58 @@
"mcp_server",
"app_settings"
]
+ },
+ "default+tools-off": {
+ "bytes": 61550,
+ "sha256": "58fda49e0afe88d2baf269ff4fc0294b9b9012671f711e219f2412023579a548",
+ "tools": [
+ "tool_result_read",
+ "list_room_targets",
+ "coordinate_bots",
+ "assignment_status",
+ "list_bots",
+ "usage_limits",
+ "list_rooms",
+ "select_computer",
+ "list_threads",
+ "close_thread",
+ "rename_thread",
+ "start_thread",
+ "burst",
+ "list_models",
+ "vm_exec",
+ "attach_file",
+ "show_widget",
+ "post_to_room",
+ "post_to_thread",
+ "create_bot",
+ "list_team_setup",
+ "list_team_library",
+ "propose_team_setup",
+ "propose_bot_deletion",
+ "manage_room",
+ "request_credential",
+ "request_sign_in",
+ "fill_login",
+ "decide",
+ "extract",
+ "message_person",
+ "report_bug",
+ "memory_update",
+ "retry_thread",
+ "memory_log",
+ "session_search",
+ "trigger_info",
+ "trigger",
+ "delete_trigger",
+ "wait_until",
+ "list_waits",
+ "cancel_wait",
+ "propose_profile",
+ "propose_model",
+ "propose_team_memory",
+ "mcp_server",
+ "app_settings"
+ ]
}
}
diff --git a/server/drivers/agents-catalog-profile.ts b/server/drivers/agents-catalog-profile.ts
index d997d5dd05..e2d7ea62dd 100644
--- a/server/drivers/agents-catalog-profile.ts
+++ b/server/drivers/agents-catalog-profile.ts
@@ -1,3 +1,5 @@
+import { toolsOffFromEnv, type ToolGroup } from "../../shared/tool-groups.ts";
+
// The OMB_* switches the harness gives the agents proxy, read into the profile agents-catalog.ts lists tools for.
/** Which tools a conversation is shown, the same on every one of its turns. Presentation only: the server still
@@ -32,6 +34,8 @@ export interface CatalogProfile {
meetings?: boolean;
/** The plan's included app hosting reaches this server: publish_app is mounted. */
appHosting?: boolean;
+ /** The tool groups this bot's person turned off: none of their tools is mounted. */
+ toolsOff?: readonly ToolGroup[];
}
/** Everything is off unless the harness says "1". */
@@ -53,5 +57,6 @@ export function catalogProfileFromEnv(env: NodeJS.ProcessEnv): CatalogProfile {
imageGeneration: env.OMB_IMAGE_GENERATION === "1",
meetings: env.OMB_MEETINGS === "1",
appHosting: env.OMB_APP_HOSTING === "1",
+ toolsOff: toolsOffFromEnv(env.OMB_TOOLS_OFF),
};
}
diff --git a/server/drivers/agents-catalog-wire.test.ts b/server/drivers/agents-catalog-wire.test.ts
index caaf2b99ab..169bba826d 100644
--- a/server/drivers/agents-catalog-wire.test.ts
+++ b/server/drivers/agents-catalog-wire.test.ts
@@ -66,6 +66,8 @@ function profiles(): Record<string, Profile> {
// The plan's included app hosting reaches only a Cloud home the Admin wired for it; the fullest profile carries it.
all["skills+shared+voice+x+team+images+hosting"] = { env: { ...all["skills+shared+voice+x+team+images"]!.env, OMB_APP_HOSTING: "1" } };
all["default+hosting"] = { env: { ...all.default!.env, OMB_APP_HOSTING: "1" } };
+ // A bot whose person turned groups off; the fullest profile has every group on.
+ all["default+tools-off"] = { env: { ...all.default!.env, OMB_TOOLS_OFF: "pages,meetings" } };
return all;
}
@@ -115,6 +117,7 @@ const BUDGET_BASELINE: Record<string, number> = {
"default+images": 65825,
"skills+shared+voice+x+team+images+hosting": 77649,
"default+hosting": 66915,
+ "default+tools-off": 61242,
};
const RPC_PREFIX = '{"jsonrpc":"2.0","id":1,"result":';
@@ -282,6 +285,15 @@ describe("agents proxy tools/list golden", () => {
}
});
+ it("leaves out only the tools of the groups a bot has off", () => {
+ const names = (wire: string) => toolsOf(wire).map((tool) => tool.name);
+ const PAGE_TOOLS = ["show_html", "publish_page", "unpublish_page"];
+ expect(names(wires["default+tools-off"]!)).toEqual(names(wires.default!).filter((tool) => !PAGE_TOOLS.includes(tool)));
+ for (const [name, profile] of Object.entries(PROFILES)) {
+ expect(names(wires[name]!).includes("show_html"), name).toBe(profile.env.OMB_TOOLS_OFF === undefined);
+ }
+ });
+
it("ignores the switches that once picked a catalog profile", () => {
expect(wires["default+legacy-switches"]).toBe(wires.default);
const profile = catalogProfileFromEnv({ OMB_BOT_ID: "bot-golden", OMB_CHIEF_OF_STAFF: "1", OMB_COMPUTER_SELECTION: "1", OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1", OMB_ACTIVE_WAITS: "0" });
@@ -347,7 +359,7 @@ describe("agents proxy tools/list golden", () => {
for (const [name, profile] of Object.entries(PROFILES)) {
expect(names(name).includes("select_computer"), name).toBe(profile.env.OMB_COMPUTER_SELECTION === "1");
expect(names(name).includes("show_widget"), name).toBe(true);
- expect(names(name).includes("show_html"), name).toBe(true);
+ expect(names(name).includes("show_html"), name).toBe(profile.env.OMB_TOOLS_OFF === undefined);
expect(names(name).includes("wait_until"), name).toBe(profile.env.OMB_ROOM !== "1");
}
});
diff --git a/server/drivers/agents-catalog.ts b/server/drivers/agents-catalog.ts
index 6a8e6ca218..ba0b95bec8 100644
--- a/server/drivers/agents-catalog.ts
+++ b/server/drivers/agents-catalog.ts
@@ -20,7 +20,7 @@ import { MAUSBOT_TOOL_DEFINITIONS } from "./agents-mausbot-tools.ts";
import { PERSON_TOOL_DEFINITIONS } from "./agents-person-tools.ts";
import { RESEARCH_TOOL_DEFINITIONS, RESEARCH_TOOL_NAMES, X_TOOL_NAMES } from "./agents-research-tools.ts";
import type { CatalogProfile } from "./agents-catalog-profile.ts";
-import { advertisedSchema } from "./agents-schema.ts";
+import { advertisedSchema } from "./agents-schema.ts"; import { withoutToolsOff } from "./agents-tool-groups.ts";
export { catalogProfileFromEnv, type CatalogProfile } from "./agents-catalog-profile.ts";
export const WEEKDAYS = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] as const;
@@ -953,7 +953,7 @@ const CLOUD_HOME_SURFACE = {
};
export function availableTools(profile: CatalogProfile) {
- const tools = catalogTools(profile);
+ const tools = withoutToolsOff(catalogTools(profile), profile.toolsOff ?? []);
const placed = profile.cloudHome
? tools.filter(tool => !LOCAL_VM_TOOL_NAMES.has(tool.name)).map(tool => tool.name === "select_computer"
? { ...tool, inputSchema: { ...tool.inputSchema, properties: { surface: CLOUD_HOME_SURFACE } } }
diff --git a/server/drivers/agents-mcp-env.ts b/server/drivers/agents-mcp-env.ts
index 3d68f0f86c..d3bc5d53f4 100644
--- a/server/drivers/agents-mcp-env.ts
+++ b/server/drivers/agents-mcp-env.ts
@@ -4,4 +4,4 @@ import { TOOL_LIMIT_ENV } from "../tool-count-limit.ts";
/** The settings the harness gives the agents MCP server, and the only ones a request may carry over HTTP. */
export const AGENTS_MCP_ENV = ["OMB_BOT_ID", "OMB_THREAD_ID", "OMB_EXTERNAL_RUNTIME", "OMB_CHIEF_OF_STAFF",
"OMB_SKILL_AUTHORING_ENABLED", "OMB_MEMORY_ENABLED", "OMB_SHARED_COMPUTERS_ENABLED", "OMB_CLOUD_HOME", "OMB_VOICE_NOTES",
- "OMB_X_RESEARCH", "OMB_RESEARCH", "OMB_TEAM_PEOPLE", "OMB_MAUSBOT", "OMB_COMPUTER_SELECTION", "OMB_ROOM", "OMB_IMAGE_GENERATION", "OMB_MEETINGS", "OMB_APP_HOSTING", TOOL_BRIDGE_ENV, TOOL_LIMIT_ENV] as const;
+ "OMB_X_RESEARCH", "OMB_RESEARCH", "OMB_TEAM_PEOPLE", "OMB_MAUSBOT", "OMB_COMPUTER_SELECTION", "OMB_ROOM", "OMB_IMAGE_GENERATION", "OMB_MEETINGS", "OMB_APP_HOSTING", "OMB_TOOLS_OFF", TOOL_BRIDGE_ENV, TOOL_LIMIT_ENV] as const;
diff --git a/server/drivers/agents-tool-groups.test.ts b/server/drivers/agents-tool-groups.test.ts
new file mode 100644
index 0000000000..81fec759f8
--- /dev/null
+++ b/server/drivers/agents-tool-groups.test.ts
@@ -0,0 +1,87 @@
+// Every agents tool sits in exactly one switchable group or in the core, and turning a group off takes out that group's
+// tools and nothing else, byte for byte.
+import { describe, expect, it } from "vitest";
+
+import { TOOL_GROUP_TOKENS, TOOL_GROUPS, type ToolGroup } from "../../shared/tool-groups.ts";
+import { WATCHER_OPTIONS_CARD_BOT_ID } from "../../shared/options-card.ts";
+import { DATA_TOOLS } from "../data/tools.ts";
+import { EMAIL_TOOLS } from "../email/tools.ts";
+import { availableTools, catalogProfileFromEnv } from "./agents-catalog.ts";
+import { CORE_TOOLS, OWN_SWITCH_TOOLS, serverTurnedOff, TOOL_GROUP_MEMBERS, toolsOffNames } from "./agents-tool-groups.ts";
+
+/** Every host switch on: a Chief's MausBot on a server with a cloud computer, images, hosting and research. */
+const FULLEST = {
+ OMB_BOT_ID: "bot-full", OMB_SKILL_AUTHORING_ENABLED: "1", OMB_SHARED_COMPUTERS_ENABLED: "1", OMB_VOICE_NOTES: "1", OMB_CHIEF_OF_STAFF: "1",
+ OMB_COMPUTER_SELECTION: "1", OMB_X_RESEARCH: "1", OMB_RESEARCH: "1", OMB_TEAM_PEOPLE: "1", OMB_IMAGE_GENERATION: "1", OMB_APP_HOSTING: "1",
+ OMB_MEETINGS: "1", OMB_MAUSBOT: "1",
+};
+const listed = (env: Record<string, string>) => availableTools(catalogProfileFromEnv(env));
+const names = (env: Record<string, string>) => listed(env).map((tool) => tool.name);
+/** The catalog's every tool, across the profiles that between them mount all of it. */
+const EVERY_TOOL = new Set([
+ ...names(FULLEST),
+ ...names({ ...FULLEST, OMB_TEAM_PEOPLE: "0", OMB_CLOUD_HOME: "1" }),
+ ...names({ ...FULLEST, OMB_BOT_ID: WATCHER_OPTIONS_CARD_BOT_ID }),
+]);
+const buckets: Array<[string, ReadonlySet<string>]> = [
+ ...TOOL_GROUPS.map((group): [string, ReadonlySet<string>] => [group, TOOL_GROUP_MEMBERS[group].tools]),
+ ...Object.entries(OWN_SWITCH_TOOLS),
+ ["core", CORE_TOOLS],
+];
+
+describe("tool groups on the agents server", () => {
+ it("puts every catalog tool in exactly one group or the core, and names no tool the catalog lacks", () => {
+ for (const tool of EVERY_TOOL) {
+ expect(buckets.filter(([, members]) => members.has(tool)).map(([bucket]) => bucket), tool).toHaveLength(1);
+ }
+ for (const [bucket, members] of buckets) for (const tool of members) expect(EVERY_TOOL.has(tool), `${bucket}: ${tool}`).toBe(true);
+ });
+
+ it("leaves out each group's tools and nothing else, the rest byte for byte", () => {
+ const full = listed(FULLEST);
+ for (const group of TOOL_GROUPS) {
+ const without = listed({ ...FULLEST, OMB_TOOLS_OFF: group });
+ expect(JSON.stringify(without), group).toBe(JSON.stringify(full.filter((tool) => !TOOL_GROUP_MEMBERS[group].tools.has(tool.name))));
+ if (TOOL_GROUP_MEMBERS[group].tools.size) expect(without.length, group).toBeLessThan(full.length);
+ }
+ });
+
+ it("with every group off keeps the core and the tools with switches of their own", () => {
+ const left = names({ ...FULLEST, OMB_TOOLS_OFF: TOOL_GROUPS.join(",") });
+ expect(left).toEqual(names(FULLEST).filter((tool) => !toolsOffNames(TOOL_GROUPS).has(tool)));
+ for (const tool of ["show_html", "publish_page", "unpublish_page", "publish_app", "check_app_hosting", "join_meeting", "post_meeting_notes", "generate_image"]) {
+ expect(left).not.toContain(tool);
+ }
+ expect(left).toEqual(expect.arrayContaining(["show_widget", "memory_update", "x_search", "message_person", "app_settings"]));
+ });
+
+ it("is the same list for a variable naming no group, an unknown one or none", () => {
+ const full = JSON.stringify(listed(FULLEST));
+ for (const value of ["", "browser", ",,"]) expect(JSON.stringify(listed({ ...FULLEST, OMB_TOOLS_OFF: value })), value).toBe(full);
+ });
+
+ it("stands Data and Email for their own servers", () => {
+ expect(serverTurnedOff(["data"], "data")).toBe(true);
+ expect(serverTurnedOff(["data"], "email")).toBe(false);
+ expect(serverTurnedOff(["email", "pages"], "email")).toBe(true);
+ expect(serverTurnedOff(["browser"], "data")).toBe(false);
+ expect(serverTurnedOff(undefined, "data")).toBe(false);
+ });
+
+ it("says roughly what each group costs a request, a token being about four bytes of definitions", () => {
+ const full = listed(FULLEST);
+ const bytes: Record<ToolGroup, number> = {
+ meetings: 0, pages: 0, images: 0,
+ data: JSON.stringify(DATA_TOOLS).length,
+ email: JSON.stringify(EMAIL_TOOLS).length,
+ };
+ for (const group of ["meetings", "pages", "images"] as const) {
+ bytes[group] = full.filter((tool) => TOOL_GROUP_MEMBERS[group].tools.has(tool.name)).reduce((sum, tool) => sum + JSON.stringify(tool).length, 0);
+ }
+ for (const group of TOOL_GROUPS) {
+ const tokens = bytes[group] / 4;
+ expect(TOOL_GROUP_TOKENS[group], `${group}: about ${Math.round(tokens)}`).toBeGreaterThan(tokens * 0.8);
+ expect(TOOL_GROUP_TOKENS[group], `${group}: about ${Math.round(tokens)}`).toBeLessThan(tokens * 1.25);
+ }
+ });
+});
diff --git a/server/drivers/agents-tool-groups.ts b/server/drivers/agents-tool-groups.ts
new file mode 100644
index 0000000000..93074bbe05
--- /dev/null
+++ b/server/drivers/agents-tool-groups.ts
@@ -0,0 +1,52 @@
+// Every built-in tool a bot can be shown, by the switch that leaves it out. agents-tool-groups.test.ts holds every
+// catalog tool to exactly one entry here, so a new tool is placed on purpose.
+import { isToolGroup, type ToolGroup } from "../../shared/tool-groups.ts";
+import { HOSTING_TOOL_NAMES } from "./agents-hosting-tools.ts";
+import { IMAGE_TOOL_NAMES } from "./agents-image-tools.ts";
+import { MEETING_TOOL_NAMES } from "./agents-meeting-tools.ts";
+import { PAGE_TOOL_NAMES } from "./agents-pages-tools.ts";
+import { RESEARCH_TOOL_NAMES } from "./agents-research-tools.ts";
+
+/** Each group's tools on the agents server, and the whole MCP servers (turn integrations) it stands for. */
+export const TOOL_GROUP_MEMBERS: Readonly<Record<ToolGroup, { tools: ReadonlySet<string>; servers: readonly ("data" | "email")[] }>> = {
+ meetings: { tools: MEETING_TOOL_NAMES, servers: [] },
+ data: { tools: new Set(), servers: ["data"] },
+ pages: { tools: new Set(["show_html", ...PAGE_TOOL_NAMES, ...HOSTING_TOOL_NAMES]), servers: [] },
+ images: { tools: IMAGE_TOOL_NAMES, servers: [] },
+ email: { tools: new Set(), servers: ["email"] },
+};
+
+/** Groups with a bot switch of their own, kept where it was: Memory (`memoryEnabled`), Research (`xResearch`), and
+ * Connected apps (`composio`) and the built-in browser (`browser`), which are whole servers. */
+export const OWN_SWITCH_TOOLS: Readonly<Record<"memory" | "research", ReadonlySet<string>>> = {
+ memory: new Set(["memory_update", "memory_log"]),
+ research: RESEARCH_TOOL_NAMES,
+};
+
+/** What every bot keeps: talking to the person and its team, its own setup, routines and waits, and its computer. */
+export const CORE_TOOLS: ReadonlySet<string> = new Set([
+ "tool_result_read", "list_shared_computers", "shared_computer", "ask_for_computer", "list_room_targets", "coordinate_bots",
+ "assignment_status", "list_bots", "usage_limits", "list_rooms", "select_computer", "reset_cloud_computer", "list_threads",
+ "close_thread", "rename_thread", "start_thread", "burst", "list_models", "vm_exec", "attach_file", "show_widget", "create_options_card",
+ "post_to_room", "post_to_thread", "create_bot", "list_team_setup", "list_team_library", "propose_team_setup",
+ "propose_bot_deletion", "manage_room", "request_credential", "request_sign_in", "fill_login", "send_voice_note", "decide",
+ "extract", "message_person", "report_bug", "retry_thread", "session_search", "trigger_info", "trigger", "delete_trigger",
+ "wait_until", "list_waits", "cancel_wait", "propose_profile", "propose_model", "propose_team_memory", "skills_list",
+ "skill_manage", "mcp_server", "app_settings", "list_unread_notifications", "mark_notifications_read",
+]);
+
+/** The agents tools the groups in `off` leave out. */
+export function toolsOffNames(off: readonly ToolGroup[]): ReadonlySet<string> {
+ return new Set(off.flatMap((group) => [...TOOL_GROUP_MEMBERS[group].tools]));
+}
+
+/** `tools` without the ones the groups in `off` leave out. */
+export function withoutToolsOff<T extends { name: string }>(tools: T[], off: readonly ToolGroup[]): T[] {
+ const names = toolsOffNames(off);
+ return names.size ? tools.filter((tool) => !names.has(tool.name)) : tools;
+}
+
+/** Whether the groups in `off` leave out the whole MCP server `server`. */
+export function serverTurnedOff(off: readonly string[] | undefined, server: "data" | "email"): boolean {
+ return (off ?? []).filter(isToolGroup).some((group) => TOOL_GROUP_MEMBERS[group].servers.includes(server));
+}
diff --git a/server/email/host.test.ts b/server/email/host.test.ts
index 37a3ce9114..7520822bd9 100644
--- a/server/email/host.test.ts
+++ b/server/email/host.test.ts
@@ -178,6 +178,16 @@ describe("a turn's Email tools", () => {
expect(host.prompt({ id: "b", name: "A" })).toContain("[email protected]");
expect(host.prompt({ id: "b", name: "A" })).not.toContain(PASSWORD);
expect(host.prompt({ id: "b", name: "A", composio: false })).toBe("");
+ expect(empty.host.available()).toBe(false);
+ expect(host.available()).toBe(true);
+ });
+
+ it("a bot with Email turned off is neither given the tools nor told about them", async () => {
+ const { host } = await fixture();
+ const off = { id: "b", name: "A", toolsOff: ["email"] };
+ expect(host.integration(off, () => "cap", "http://127.0.0.1:1")).toBeNull();
+ expect(host.prompt(off)).toBe("");
+ expect(host.integration({ ...off, toolsOff: ["data", "pages"] }, () => "cap", "http://127.0.0.1:1")).not.toBeNull();
});
});
diff --git a/server/email/host.ts b/server/email/host.ts
index 06a0885e5c..1df2269027 100644
--- a/server/email/host.ts
+++ b/server/email/host.ts
@@ -18,6 +18,7 @@ import { EMAIL_CANT_SEND_PROMPT, EMAIL_CANT_SEND_TEXT, EMAIL_INSTRUCTIONS, EMAIL
import { sendingProblem, type EmailService } from "./service.ts";
import type { EmailAccount } from "./store.ts";
import { EMAIL_TOOLS, emailError, emailText, emailToolCallProblem, isEmailRead, isEmailToolName, type EmailTool, type EmailToolResult } from "./tools.ts";
+import { serverTurnedOff } from "../drivers/agents-tool-groups.ts";
export const EMAIL_INTERNAL_MCP_PATH = "/api/internal/email/mcp";
@@ -28,6 +29,7 @@ export interface EmailBot {
composio?: boolean;
connectorTools?: Record<string, ConnectorToolGrant>;
connectorScopes?: ConnectorScopes;
+ toolsOff?: readonly string[];
}
export interface EmailHostDeps {
@@ -83,7 +85,8 @@ export function createEmailHost(deps: EmailHostDeps) {
});
const run = { listMailboxes, listMessages, readMessage, searchMessages, sendMessage, ...deps.run };
const allowedHere = () => deps.appAllowed?.() ?? true;
- const mounts = (bot: EmailBot) => allowedHere() && service.mounted() && emailAllowedFor(bot);
+ const shown = (bot: EmailBot) => emailAllowedFor(bot) && !serverTurnedOff(bot.toolsOff, "email");
+ const mounts = (bot: EmailBot) => allowedHere() && service.mounted() && shown(bot);
function account(address: unknown): EmailAccount | EmailToolResult {
const accounts = service.store.list();
@@ -116,12 +119,14 @@ export function createEmailHost(deps: EmailHostDeps) {
return {
mounts,
+ /** A mailbox is connected here, so a bot can be given the Email tools. */
+ available: () => allowedHere() && service.mounted(),
integration(bot: EmailBot, mint: () => string, harnessUrl: string): { command: string; args: string[]; env: Record<string, string> } | null {
if (!mounts(bot)) return null;
return { command: process.execPath, args: [SPAWNED_PROXIES.harnessMcp, EMAIL_MCP_SERVER], env: { ...AGENTS_NODE_FLAG, [harnessMcpTokenEnv("email")]: mint(), OMB_HARNESS_URL: harnessUrl } };
},
prompt(bot: EmailBot): string {
- if (!allowedHere() || service.status().state === "unavailable" || !emailAllowedFor(bot)) return "";
+ if (!allowedHere() || service.status().state === "unavailable" || !shown(bot)) return "";
if (!service.mounted()) return EMAIL_TO_CONNECT_PROMPT;
const scopes = bot.connectorScopes ? { apps: { [EMAIL_SLUG]: bot.connectorScopes.apps[EMAIL_SLUG]! } } : undefined;
const grant = bot.connectorTools?.[EMAIL_SLUG];
diff --git a/server/index.ts b/server/index.ts
index 66f476b4b3..f6f6d6c71f 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -486,7 +486,7 @@ import { WebhookManager } from "./webhooks.ts";
import { tieAutomationsToBots } from "./bot-automations.ts"; import { WaitManager } from "./waits.ts"; import { cancelWaitFromCard, createWaitHost, waitRunChat } from "./wait-host.ts"; import { continuedConversation } from "./routine-same-conversation.ts"; import { createWaitRoutes, findWaitPeer, handedAssignment, hostWaitRefusal, waitSourceRefusal, type WaitRouteContext } from "./routes/waits.ts";
import type { WebhookTrigger } from "../shared/webhooks.ts";
import { AGENTS_NODE_FLAG, SPAWNED_PROXIES } from "./proxy-paths.ts";
-import { agentsProxyLaunch, agentsToolBridgeEnv, applyAgentsBridge, bridgedToolTitle, turnEngine } from "./agents-bridge-switch.ts"; import { agentsServerEnv, botDrivenConversation, COMPUTER_OFF_REFUSAL, computerPickRefusal, directTurnKind, roomSkillsRefusal, type TurnKind } from "./agents-turn.ts";
+import { agentsProxyLaunch, agentsToolBridgeEnv, applyAgentsBridge, bridgedToolTitle, turnEngine } from "./agents-bridge-switch.ts"; import { serverTurnedOff } from "./drivers/agents-tool-groups.ts"; import { availableToolGroups, toolsOffPart } from "./tool-groups.ts"; import { agentsServerEnv, botDrivenConversation, COMPUTER_OFF_REFUSAL, computerPickRefusal, directTurnKind, roomSkillsRefusal, type TurnKind } from "./agents-turn.ts";
import { harnessMcpTokenEnv } from "./harness-mcp-token.ts";
import {
loadBundledSkills,
@@ -2406,7 +2406,7 @@ function dataExportRoots(bot: { id: string; cwd?: string }): string[] {
}
let dataUnavailableLogged = false;
function dataIntegration(botId: string, turn: { threadId: string; generation: string }) {
- const unavailable = dataEngine.unavailable();
+ const unavailable = dataEngine.unavailable(); if (serverTurnedOff(store.bot(botId)?.toolsOff, "data")) return null;
if (unavailable !== null) {
if (!dataUnavailableLogged) {
dataUnavailableLogged = true;
@@ -2991,7 +2991,7 @@ function previewSystemPrompt(bot: BotRecord) {
}, { note: previewPlan.note, cloudHome: Boolean(CLOUD_HOME), ownComputer: CLOUD_HOME && agentsMounted && lendingEnabled() ? sharedComputers.known(CLOUD_HOME_LENDER) : undefined }) },
{ id: "cloud-home", label: "My Cloud", text: CLOUD_HOME ? cloudHomePrompt(agentsMounted && lendingEnabled(), syncedFolders(DATA_DIR), sharedComputers.known(CLOUD_HOME_LENDER), CLOUD_PERSONAL) + firstHourHooks.prompt(bot.id, bot.threadId) : "" }, phoneLinkPart(),
{ id: "composio", label: "Connected apps", text: caps?.composioMcp && bot.composio !== false && composio.configured(cfg) ? composioSystemPrompt(bot.connectorTools) + describeConnectorScopes(bot.connectorScopes) : "" },
- { id: "email", label: "Email", text: caps?.emailMcp === true ? emailHost.prompt(bot) : "" }, { id: "meetings", label: "Meetings", text: meetingsUnavailablePrompt({ agentsTools: agentsMounted, cloudComputer: boat.boatConfigured(cfg) }) },
+ { id: "email", label: "Email", text: caps?.emailMcp === true ? emailHost.prompt(bot) : "" }, { id: "meetings", label: "Meetings", text: meetingsUnavailablePrompt({ agentsTools: agentsMounted, cloudComputer: boat.boatConfigured(cfg) }) }, toolsOffPart(bot),
...phones.previewParts(bot, caps?.deviceMcp === true),
{ id: "mcp", label: "MCP servers", text: caps?.customMcp ? customMcpPrompt(Object.keys(engineMcpServers(bot)), mcpServersHost.off(bot)) : "" }, { id: "to-connect", label: "Connections to make", text: cloudConnections.prompt(bot) },
{ id: "browser", label: "Browser", text: previewPlan.browser ? browserPromptFor(bot, agentsMounted) : "" },
@@ -8377,7 +8377,7 @@ async function beginTurn(
{ id: "mcp", label: "MCP servers", text: customMcpPrompt(Object.keys(integrations.custom ?? {}), mcpServersHost.off(bot)) }, { id: "to-connect", label: "Connections to make", text: cloudConnections.prompt(liveBot ?? bot, lentMcp.lines(liveBot ?? bot, { botId: bot.id, threadId, generation: dispatchClaimId })) + teamConnections.prompt(threadId, dispatchClaimId, integrations) },
{ id: "browser", label: "Browser", text: integrations.browser ? browserPromptFor(bot, Boolean(integrations.agents)) : "" },
{ id: "data", label: "Data", text: integrations.data ? BUILT_IN_DATA_SYSTEM_PROMPT : "" },
- { id: "email", label: "Email", text: instance.adapter.capabilities.emailMcp === true ? emailHost.prompt(liveBot ?? bot) : "" }, { id: "meetings", label: "Meetings", text: meetingsUnavailablePrompt({ agentsTools: Boolean(integrations.agents), cloudComputer: boat.boatConfigured(cfg) }) },
+ { id: "email", label: "Email", text: instance.adapter.capabilities.emailMcp === true ? emailHost.prompt(liveBot ?? bot) : "" }, { id: "meetings", label: "Meetings", text: meetingsUnavailablePrompt({ agentsTools: Boolean(integrations.agents), cloudComputer: boat.boatConfigured(cfg) }) }, toolsOffPart(liveBot ?? bot),
...phones.promptParts(liveBot ?? bot, {
mounted: Boolean(integrations.device), offered: instance.adapter.capabilities.deviceMcp === true, turn: { botId: bot.id, threadId, generation: dispatchClaimId },
place: phones.place(threadId, !(commsDepth > 0 || opts?.automationSource !== undefined || opts?.unattended || opts?.peerAsk || opts?.coordination)),
@@ -10155,7 +10155,7 @@ async function runClaimedGroupMemberTurn(
{ id: "cloud-home", label: "My Cloud", text: CLOUD_HOME ? cloudHomePrompt(Boolean(integrations.agents) && lendingEnabled(), syncedFolders(DATA_DIR), sharedComputers.known(CLOUD_HOME_LENDER), CLOUD_PERSONAL) : "" }, phoneLinkPart(),
{ id: "browser", label: "Browser", text: integrations.browser ? browserPromptFor(bot, Boolean(integrations.agents)) : "" },
{ id: "data", label: "Data", text: integrations.data ? BUILT_IN_DATA_SYSTEM_PROMPT : "" },
- { id: "email", label: "Email", text: instance.adapter.capabilities.emailMcp === true ? emailHost.prompt(readyBot) : "" },
+ { id: "email", label: "Email", text: instance.adapter.capabilities.emailMcp === true ? emailHost.prompt(readyBot) : "" }, toolsOffPart(readyBot),
...phones.promptParts(readyBot, {
mounted: Boolean(integrations.device), offered: instance.adapter.capabilities.deviceMcp === true,
turn: { botId: readyBot.id, threadId, generation: internalGeneration }, place: "computer",
@@ -11702,7 +11702,7 @@ function configStatus() {
anthropic: { ...keyStatus(cfg.anthropic?.key), everyClaudeBot: cfg.anthropic?.everyClaudeBot !== false },
openai: keyStatus(cfg.openai?.key),
openrouter: keyStatus(cfg.openrouter?.key),
- fleet: { available: fleetAvailable(fleetSocketPath()) },
+ fleet: { available: fleetAvailable(fleetSocketPath()) }, toolGroups: availableToolGroups({ meetings: boat.boatConfigured(cfg), data: dataEngine.unavailable() === null, images: imageGenerationReady(cfg), email: emailHost.available() }),
edition: editionForSettings(editionStatus()),
budgets: {
...(cfg.budgets?.monthlyUsd !== undefined ? { monthlyUsd: cfg.budgets.monthlyUsd } : {}),
diff --git a/server/request-auth.ts b/server/request-auth.ts
index 93be040019..17f5f95182 100644
--- a/server/request-auth.ts
+++ b/server/request-auth.ts
@@ -539,11 +539,11 @@ export function botProfileSettings(fields: Record<string, unknown>): Record<stri
return Object.fromEntries(Object.entries(fields).filter(([key]) => BOT_PROFILE_SETTINGS.has(key)));
}
-/** What a Team Cloud member who can edit a bot may change: its profile and model (as a bot they bring in), and which of
- * the team's connected apps and MCP servers it uses. Never what it may do on its computer, where it runs, its department
- * or whom it answers to or directs: those stay an admin's. */
+/** What a Team Cloud member who can edit a bot may change: its profile and model (as a bot they bring in), which of the
+ * team's connected apps and MCP servers it uses, and which built-in tool groups it is shown. Never what it may do on its
+ * computer, where it runs, its department or whom it answers to or directs: those stay an admin's. */
const EDITOR_BOT_PATCH_FIELDS: ReadonlySet<string> = new Set([
- ...BOT_PROFILE_SETTINGS, "threadId", "composio", "connectorTools", "connectorScopes", "mcpServers",
+ ...BOT_PROFILE_SETTINGS, "threadId", "composio", "connectorTools", "connectorScopes", "mcpServers", "toolsOff",
]);
/** A member who can only view a bot marks it read, nothing else. */
const VIEWER_BOT_PATCH_FIELDS: ReadonlySet<string> = new Set(["unread"]);
diff --git a/server/routes/bot-patch.test.ts b/server/routes/bot-patch.test.ts
index 544f09d5a8..9e5a99e17b 100644
--- a/server/routes/bot-patch.test.ts
+++ b/server/routes/bot-patch.test.ts
@@ -245,6 +245,24 @@ describe("PATCH /api/bots/:id vpsAlias relocation guard", () => {
});
});
+describe("PATCH /api/bots/:id toolsOff", () => {
+ it("stores known groups once each in one order, clears them with null or an empty list, and refuses anything else", async () => {
+ const { store, bot, patch } = fixture();
+ expect((await patch(bot.id, { toolsOff: ["pages", "meetings", "pages"] })).status).toBe(200);
+ expect(store.bot(bot.id)?.toolsOff).toEqual(["meetings", "pages"]);
+ const refused = await patch(bot.id, { toolsOff: ["browser"] });
+ expect(refused.status).toBe(400);
+ expect(refused.body.error).toBe("toolsOff must be a list of meetings, data, pages, images, email");
+ expect((await patch(bot.id, { toolsOff: "meetings" })).status).toBe(400);
+ expect(store.bot(bot.id)?.toolsOff).toEqual(["meetings", "pages"]);
+ expect((await patch(bot.id, { toolsOff: [] })).status).toBe(200);
+ expect(store.bot(bot.id)?.toolsOff).toBeUndefined();
+ await patch(bot.id, { toolsOff: ["data"] });
+ expect((await patch(bot.id, { toolsOff: null })).status).toBe(200);
+ expect(store.bot(bot.id)?.toolsOff).toBeUndefined();
+ });
+});
+
describe("PATCH /api/bots/:id phoneApps", () => {
it("stores phoneApps and clears it with null", async () => {
const { store, bot, patch } = fixture();
diff --git a/server/routes/bot-patch.ts b/server/routes/bot-patch.ts
index 251109f568..2bed4c9e65 100644
--- a/server/routes/bot-patch.ts
+++ b/server/routes/bot-patch.ts
@@ -5,6 +5,7 @@ import { normalizeConnectorScopes } from "../../shared/connector-scopes.ts";
import { normalizeOutboundPolicy } from "../../shared/outbound.ts";
import { normalizePhoneApps } from "../../shared/phone-apps.ts";
import { parseToolScope, toolScopeWidens } from "../../shared/tool-scope.ts";
+import { parseToolsOff, TOOL_GROUPS } from "../../shared/tool-groups.ts";
import { isMausColor, MAUS_COLOR_NAMES, type BotUpdateResponse, type WireBot, type WireGroup } from "../../shared/wire.ts";
import { checkBrowserProfileChange, settleBrowserChange } from "../bot-browser-profile.ts";
import { validateBotCwd } from "../bot-cwd.ts";
@@ -297,6 +298,11 @@ export function createBotPatchRoutes(deps: BotPatchRouteDeps): RouteHandler {
if (typeof body.xResearch !== "boolean") return json(res, 400, { error: "xResearch must be true or false" });
patch.xResearch = body.xResearch;
}
+ if (body.toolsOff !== undefined) {
+ const toolsOff = body.toolsOff === null ? [] : parseToolsOff(body.toolsOff);
+ if (!toolsOff) return json(res, 400, { error: `toolsOff must be a list of ${TOOL_GROUPS.join(", ")}` });
+ patch.toolsOff = toolsOff.length ? toolsOff : undefined;
+ }
if (body.memoryEnabled !== undefined) {
if (typeof body.memoryEnabled !== "boolean") return json(res, 400, { error: "memoryEnabled must be true or false" });
if (existingBot && (existingBot.busy || activeGroupTurnForBot(existingBot.id)) &&
diff --git a/server/tool-groups.e2e.test.ts b/server/tool-groups.e2e.test.ts
new file mode 100644
index 0000000000..c6ecb77e46
--- /dev/null
+++ b/server/tool-groups.e2e.test.ts
@@ -0,0 +1,71 @@
+// End to end on a disposable server and the real agents proxy: a bot's person turns Meetings and Pages off, and that
+// bot's next turn is listed neither while its teammate keeps both; turning Data off takes its server out of the turn.
+// One loopback stub stands in for Boat (so this server has meetings) and for the image provider. No network.
+import { createServer } from "node:http";
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import { join } from "node:path";
+import { expect, it } from "vitest";
+import { launchVerificationServer, runControlOmb } from "../scripts/control-omb.ts";
+import { request } from "../scripts/mcp-server.ts";
+
+const MEETINGS = ["join_meeting", "meeting_status", "post_in_meeting_chat", "leave_meeting", "post_meeting_notes"];
+const PAGES = ["show_html", "publish_page", "unpublish_page"];
+
+it("lists a bot none of the groups its person turned off, from its next turn, and leaves other bots alone", async () => {
+ const stub = createServer((_req, res) => { res.writeHead(404, { "content-type": "application/json" }); res.end("{}"); });
+ await new Promise<void>((resolve) => stub.listen(0, "127.0.0.1", resolve));
+ const stubUrl = `http://127.0.0.1:${(stub.address() as { port: number }).port}`;
+ const session = await launchVerificationServer({ ...process.env, OMB_FAKE_IMAGE_API_URL: `${stubUrl}/v1` }, undefined, undefined, undefined, undefined, { scripted: true }, [], stubUrl);
+ const cli = (...args: string[]) => runControlOmb(args, { env: { OPENMAUSBOT_URL: session.info.url } }) as Promise<any>;
+ const api = (path: string, body?: unknown, method = "POST") =>
+ request(path, body === undefined ? {} : { method, body: JSON.stringify(body) }, session.info.url) as Promise<any>;
+ const planPath = join(session.info.dataDir, "room-plan.json");
+ const evidenceFor = (botId: string) => {
+ const lines = existsSync(`${planPath}.evidence.jsonl`) ? readFileSync(`${planPath}.evidence.jsonl`, "utf8").trim().split("\n").filter(Boolean) : [];
+ return lines.map((line) => JSON.parse(line)).filter((entry: any) => entry.botId === botId).at(-1);
+ };
+ /** One turn with no tool steps: the tools its agents server listed, and what its engine was started with. */
+ const turn = async (bot: any) => {
+ writeFileSync(planPath, JSON.stringify({ [bot.id]: { steps: [], reply: "Done." } }));
+ await cli("send", "--bot", bot.id, "--task", bot.activeTaskId, "--text", "Hello.");
+ expect((await cli("wait", "--bot", bot.id, "--task", bot.activeTaskId, "--timeout", "30")).status).toBe("settled");
+ const launch = JSON.parse(readFileSync(session.fixtureDumpPath, "utf8"));
+ return { tools: evidenceFor(bot.id).evidence[0].result.tools.map((tool: any) => tool.name) as string[], launch };
+ };
+ try {
+ const groups = (await api("/api/config", undefined, "GET")).toolGroups as string[];
+ expect(groups).toEqual(expect.arrayContaining(["meetings", "pages", "images"]));
+ expect(groups).not.toContain("email");
+ const quiet = (await cli("new-bot", "--name", "Quiet")).bot, busy = (await cli("new-bot", "--name", "Busy")).bot;
+ for (const bot of [quiet, busy]) await api(`/api/bots/${bot.id}`, { computer: "off" }, "PATCH");
+
+ const before = await turn(quiet);
+ expect(before.tools).toEqual(expect.arrayContaining([...MEETINGS, ...PAGES, "generate_image"]));
+ expect(before.launch.systemPrompt).not.toContain("turned off some of your tools");
+
+ const saved = await api(`/api/bots/${quiet.id}`, { toolsOff: ["pages", "meetings"] }, "PATCH");
+ expect(saved.bot.toolsOff).toEqual(["meetings", "pages"]);
+ const after = await turn(quiet);
+ for (const tool of [...MEETINGS, ...PAGES]) expect(after.tools).not.toContain(tool);
+ expect(after.tools).toEqual(before.tools.filter((tool) => !MEETINGS.includes(tool) && !PAGES.includes(tool)));
+ expect(after.launch.systemPrompt).toContain("turned off some of your tools to keep requests small: Meetings, Pages and apps.");
+
+ const other = await turn(busy);
+ expect(other.tools).toEqual(before.tools);
+ expect(other.launch.systemPrompt).not.toContain("turned off some of your tools");
+
+ if (groups.includes("data")) {
+ expect(Object.keys(after.launch.mcpConfig.mcpServers)).toContain("data");
+ await api(`/api/bots/${quiet.id}`, { toolsOff: ["data"] }, "PATCH");
+ const dataOff = await turn(quiet);
+ expect(Object.keys(dataOff.launch.mcpConfig.mcpServers)).not.toContain("data");
+ expect(dataOff.tools).toEqual(expect.arrayContaining([...MEETINGS, ...PAGES]));
+ }
+
+ await api(`/api/bots/${quiet.id}`, { toolsOff: [] }, "PATCH");
+ expect((await turn(quiet)).tools).toEqual(before.tools);
+ } finally {
+ stub.close();
+ await session.close();
+ }
+}, 180_000);
diff --git a/server/tool-groups.test.ts b/server/tool-groups.test.ts
new file mode 100644
index 0000000000..d12c4bf91e
--- /dev/null
+++ b/server/tool-groups.test.ts
@@ -0,0 +1,20 @@
+import { describe, expect, it } from "vitest";
+
+import { availableToolGroups, toolsOffPart } from "./tool-groups.ts";
+
+describe("tool groups a bot has off", () => {
+ it("tells the bot which groups are off and where they come back, and says nothing when none is", () => {
+ const part = toolsOffPart({ toolsOff: ["pages", "meetings"] });
+ expect(part.id).toBe("tools-off");
+ expect(part.text).toContain("Meetings, Pages and apps.");
+ expect(part.text).toContain("Settings (Access, Tools)");
+ expect(toolsOffPart({ toolsOff: [] }).text).toBe("");
+ expect(toolsOffPart({ toolsOff: ["browser"] }).text).toBe("");
+ expect(toolsOffPart(undefined).text).toBe("");
+ });
+
+ it("offers the groups this workspace has, Pages and apps always", () => {
+ expect(availableToolGroups({ meetings: false, data: false, images: false, email: false })).toEqual(["pages"]);
+ expect(availableToolGroups({ meetings: true, data: true, images: true, email: true })).toEqual(["meetings", "data", "pages", "images", "email"]);
+ });
+});
diff --git a/server/tool-groups.ts b/server/tool-groups.ts
new file mode 100644
index 0000000000..818b8b6903
--- /dev/null
+++ b/server/tool-groups.ts
@@ -0,0 +1,14 @@
+// The tool groups a person turned off for a bot, as the bot's prompt and the app's Settings see them.
+import { TOOL_GROUP_LABELS, TOOL_GROUPS, type ToolGroup } from "../shared/tool-groups.ts";
+
+/** The prompt part that tells a bot which of its tools the person turned off, so it can say so instead of guessing. */
+export function toolsOffPart(bot: { toolsOff?: readonly string[] } | null | undefined): { id: string; label: string; text: string } {
+ const off = TOOL_GROUPS.filter((group) => bot?.toolsOff?.includes(group));
+ const text = off.length === 0 ? "" : ` The person turned off some of your tools to keep requests small: ${off.map((group) => TOOL_GROUP_LABELS[group]).join(", ")}. When they ask for something those tools do, tell them in one line that it is turned off for you and that they can turn it back on in your Settings (Access, Tools), or ask you to.`;
+ return { id: "tools-off", label: "Tools turned off", text };
+}
+
+/** The groups this workspace has, the ones its bots' Settings offer to turn off. */
+export function availableToolGroups(has: { meetings: boolean; data: boolean; images: boolean; email: boolean }): ToolGroup[] {
+ return TOOL_GROUPS.filter((group) => group === "pages" || has[group]);
+}
diff --git a/shared/tool-groups.test.ts b/shared/tool-groups.test.ts
new file mode 100644
index 0000000000..2d2256b6f7
--- /dev/null
+++ b/shared/tool-groups.test.ts
@@ -0,0 +1,18 @@
+import { describe, expect, it } from "vitest";
+
+import { parseToolsOff, TOOL_GROUPS, toolsOffFromEnv } from "./tool-groups.ts";
+
+describe("tool groups", () => {
+ it("saves a list of known groups once each, in one order, and refuses anything else", () => {
+ expect(parseToolsOff(["pages", "meetings", "pages"])).toEqual(["meetings", "pages"]);
+ expect(parseToolsOff([])).toEqual([]);
+ for (const bad of [["browser"], "meetings", null, [1], { meetings: true }]) expect(parseToolsOff(bad)).toBeNull();
+ });
+
+ it("reads the proxy's variable, ignoring a name it does not know", () => {
+ expect(toolsOffFromEnv("email,future,meetings")).toEqual(["meetings", "email"]);
+ expect(toolsOffFromEnv(undefined)).toEqual([]);
+ expect(toolsOffFromEnv("")).toEqual([]);
+ expect(toolsOffFromEnv(TOOL_GROUPS.join(","))).toEqual([...TOOL_GROUPS]);
+ });
+});
diff --git a/shared/tool-groups.ts b/shared/tool-groups.ts
new file mode 100644
index 0000000000..1f68236699
--- /dev/null
+++ b/shared/tool-groups.ts
@@ -0,0 +1 @@
+export * from "../packages/phone-protocol/src/tool-groups.ts";
diff --git a/src/components/bot-settings/AccessSection.tsx b/src/components/bot-settings/AccessSection.tsx
index d42382cce4..242390d277 100644
--- a/src/components/bot-settings/AccessSection.tsx
+++ b/src/components/bot-settings/AccessSection.tsx
@@ -18,6 +18,7 @@ import { placeManagedBy, worksOnChoices, WorksOnGrid, worksOnSelected, type Work
import { Switch } from "../SettingsPrimitives";
import { PhoneAppsCard } from "./PhoneAppsCard";
import { ProposalStatus } from "./ProposalStatus";
+import { ToolGroupsCard } from "./ToolGroupsCard";
import { ToolSelectionCard } from "./ToolSelectionCard";
import { BotApiCard } from "./BotApiCard";
import { ToolBudgetLine } from "./ToolBudgetLine";
@@ -785,6 +786,7 @@ export function AccessSection({
{shows("phone") && <PhoneAppsCard bot={bot} patch={patch} />}
{shows("mcp") && <McpServersCard bot={bot} patch={patch} />}
+ {!draft && shows("tools") && <ToolGroupsCard bot={bot} patch={patch} />}
{shows("tools") && <ToolSelectionCard key={bot.id} bot={bot} engineKind={derived.engine?.driverKind} />}
{shows("browser") && <div className="rounded-xl bg-card p-4">
diff --git a/src/components/bot-settings/ToolGroupsCard.test.ts b/src/components/bot-settings/ToolGroupsCard.test.ts
new file mode 100644
index 0000000000..eb9fdfcb7a
--- /dev/null
+++ b/src/components/bot-settings/ToolGroupsCard.test.ts
@@ -0,0 +1,11 @@
+import { describe, expect, it } from "vitest";
+
+import { shownToolGroups } from "./ToolGroupsCard";
+
+describe("the Tools card", () => {
+ it("shows the groups this workspace has, and a group a bot has off even where the workspace lost it", () => {
+ expect(shownToolGroups(["pages", "data"], [])).toEqual(["data", "pages"]);
+ expect(shownToolGroups(["pages"], ["meetings"])).toEqual(["meetings", "pages"]);
+ expect(shownToolGroups(undefined, undefined)).toEqual([]);
+ });
+});
diff --git a/src/components/bot-settings/ToolGroupsCard.tsx b/src/components/bot-settings/ToolGroupsCard.tsx
new file mode 100644
index 0000000000..1b37caaccc
--- /dev/null
+++ b/src/components/bot-settings/ToolGroupsCard.tsx
@@ -0,0 +1,49 @@
+import { t } from "@/lib/i18n";
+import type { LocaleKey } from "@/locales";
+import { useStore, type Bot } from "@/state/store";
+import { TOOL_GROUP_TOKENS, TOOL_GROUPS, type ToolGroup } from "../../../shared/tool-groups";
+import { Switch } from "../SettingsPrimitives";
+
+const GROUP_WORDS: Record<ToolGroup, [LocaleKey, LocaleKey]> = {
+ meetings: ["botAccess.toolGroups.meetings", "botAccess.toolGroups.meetingsHint"],
+ data: ["botAccess.toolGroups.data", "botAccess.toolGroups.dataHint"],
+ pages: ["botAccess.toolGroups.pages", "botAccess.toolGroups.pagesHint"],
+ images: ["botAccess.toolGroups.images", "botAccess.toolGroups.imagesHint"],
+ email: ["botAccess.toolGroups.email", "botAccess.toolGroups.emailHint"],
+};
+
+/** The groups this workspace has, in TOOL_GROUPS order, with the ones this bot has off still listed so they can come back. */
+export function shownToolGroups(available: readonly ToolGroup[] | undefined, off: readonly ToolGroup[] | undefined): ToolGroup[] {
+ return TOOL_GROUPS.filter((group) => available?.includes(group) || off?.includes(group));
+}
+
+export function ToolGroupsCard({ bot, patch }: { bot: Bot; patch: (patch: { toolsOff: ToolGroup[] }) => void }) {
+ const { state } = useStore();
+ const off = bot.toolsOff ?? [];
+ const groups = shownToolGroups(state.config?.toolGroups, off);
+ if (groups.length === 0) return null;
+ const toggle = (group: ToolGroup) => patch({ toolsOff: off.includes(group) ? off.filter((one) => one !== group) : [...off, group] });
+ return (
+ <div className="rounded-xl bg-card p-4" data-testid="access-tool-groups">
+ <div className="text-[15px] font-medium text-ink">{t("botAccess.toolGroups.title")}</div>
+ <p className="mt-0.5 text-[13px] text-ink-secondary">{t("botAccess.toolGroups.description")}</p>
+ <div className="mt-3 flex flex-col gap-3">
+ {groups.map((group) => {
+ const [label, hint] = GROUP_WORDS[group];
+ return (
+ <div key={group} data-tool-group={group} className="flex items-center justify-between gap-4">
+ <div className="min-w-0">
+ <div className="text-[13px] font-medium text-ink">{t(label)}</div>
+ <div className="text-[12px] text-ink-tertiary">
+ {t(hint)} · <span className="tabular-nums">{t("botAccess.toolGroups.size", { tokens: TOOL_GROUP_TOKENS[group].toLocaleString() })}</span>
+ </div>
+ </div>
+ <Switch checked={!off.includes(group)} aria-label={t(label)} onClick={() => toggle(group)} />
+ </div>
+ );
+ })}
+ </div>
+ <p className="mt-3 text-[12px] text-ink-tertiary">{t("botAccess.toolGroups.elsewhere")}</p>
+ </div>
+ );
+}
diff --git a/src/components/bot-settings/useBotSettingsDerived.ts b/src/components/bot-settings/useBotSettingsDerived.ts
index d10ed5bb3c..d7d19ad90d 100644
--- a/src/components/bot-settings/useBotSettingsDerived.ts
+++ b/src/components/bot-settings/useBotSettingsDerived.ts
@@ -34,6 +34,7 @@ export type BotPatch = Partial<
| "replyStyle"
| "memoryEnabled"
| "xResearch"
+ | "toolsOff"
| "voice"
| "chiefOfStaff"
| "managedSections"
diff --git a/src/lib/config-status-frame.ts b/src/lib/config-status-frame.ts
index 84ede750aa..7355ef9ba7 100644
--- a/src/lib/config-status-frame.ts
+++ b/src/lib/config-status-frame.ts
@@ -3,7 +3,7 @@ import type { ConfigStatus } from "@/state/config-status";
// A section left out here is wiped from state.config whenever a config frame lands.
export type ConfigStatusFrame = Pick<
ConfigStatus,
- "awakeLimit" | "pausedBots" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta" | "deepseek" | "xResearch" | "treg" | "postiz" | "anthropic" | "openai" | "openrouter" | "openaiCompat" | "fleet" | "composio" | "box" | "vps" | "rooms" | "mcp" | "threads" | "automaticRecovery" | "cacheKeepWarm" | "localVm" | "opencodeGo" | "tts" | "decider" | "helpers" | "imageGen" | "live" | "savedKeys" | "profile" | "everyBotRules" | "language" | "features" | "onboarding" | "browserEngine" | "browserProfiles" | "edition" | "budgets" | "billing" | "managedPolicy" | "cloudHome" | "team" | "workspaceBanner"
+ "awakeLimit" | "pausedBots" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta" | "deepseek" | "xResearch" | "treg" | "postiz" | "anthropic" | "openai" | "openrouter" | "openaiCompat" | "fleet" | "composio" | "box" | "vps" | "rooms" | "mcp" | "threads" | "automaticRecovery" | "cacheKeepWarm" | "localVm" | "opencodeGo" | "tts" | "decider" | "helpers" | "imageGen" | "live" | "savedKeys" | "profile" | "everyBotRules" | "language" | "features" | "onboarding" | "browserEngine" | "browserProfiles" | "edition" | "budgets" | "billing" | "managedPolicy" | "cloudHome" | "team" | "workspaceBanner" | "toolGroups"
>;
export function configStatusFromFrame(frame: ConfigStatusFrame): ConfigStatus {
@@ -17,7 +17,7 @@ export function configStatusFromFrame(frame: ConfigStatusFrame): ConfigStatus {
openai: frame.openai,
openrouter: frame.openrouter,
openaiCompat: frame.openaiCompat,
- fleet: frame.fleet,
+ fleet: frame.fleet, toolGroups: frame.toolGroups,
composio: frame.composio,
box: frame.box,
vps: frame.vps,
diff --git a/src/locales/en.json b/src/locales/en.json
index 62365ccb51..d480e9c506 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -7085,6 +7085,20 @@
"botAccess.tools.none": "No tools selected",
"botAccess.tools.all": "All current tools",
"botAccess.tools.customSaved": "Custom selection saved",
+ "botAccess.toolGroups.title": "Tools",
+ "botAccess.toolGroups.description": "Turn off what this bot doesn't need, so every message to its AI is smaller.",
+ "botAccess.toolGroups.size": "about {tokens} tokens a message",
+ "botAccess.toolGroups.meetings": "Meetings",
+ "botAccess.toolGroups.meetingsHint": "Join online meetings and take notes",
+ "botAccess.toolGroups.data": "Data",
+ "botAccess.toolGroups.dataHint": "Load files and sheets into tables and query them",
+ "botAccess.toolGroups.pages": "Pages and apps",
+ "botAccess.toolGroups.pagesHint": "Show pages in chat and publish them to a link",
+ "botAccess.toolGroups.images": "Images",
+ "botAccess.toolGroups.imagesHint": "Make pictures",
+ "botAccess.toolGroups.email": "Email",
+ "botAccess.toolGroups.emailHint": "Read and send mail from the connected mailbox",
+ "botAccess.toolGroups.elsewhere": "Memory, Browser, Connected apps and Research have their own switches.",
"botAccess.tools.mode": "Available tools",
"botAccess.tools.custom": "Custom selection",
"botAccess.tools.onlyListed": "Only allow listed tools",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index f8ddd885cf..0d631da9c0 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -6747,6 +6747,20 @@
"botAccess.tools.none": "Nenhuma ferramenta selecionada",
"botAccess.tools.all": "Todas as ferramentas atuais",
"botAccess.tools.customSaved": "Seleção personalizada salva",
+ "botAccess.toolGroups.title": "Ferramentas",
+ "botAccess.toolGroups.description": "Desative o que este bot não usa. Assim, cada mensagem para a IA dele fica menor.",
+ "botAccess.toolGroups.size": "cerca de {tokens} tokens por mensagem",
+ "botAccess.toolGroups.meetings": "Reuniões",
+ "botAccess.toolGroups.meetingsHint": "Entrar em reuniões online e fazer anotações",
+ "botAccess.toolGroups.data": "Dados",
+ "botAccess.toolGroups.dataHint": "Carregar arquivos e planilhas em tabelas e consultá-las",
+ "botAccess.toolGroups.pages": "Páginas e apps",
+ "botAccess.toolGroups.pagesHint": "Mostrar páginas no chat e publicá-las em um link",
+ "botAccess.toolGroups.images": "Imagens",
+ "botAccess.toolGroups.imagesHint": "Criar imagens",
+ "botAccess.toolGroups.email": "E-mail",
+ "botAccess.toolGroups.emailHint": "Ler e enviar e-mails da caixa de entrada conectada",
+ "botAccess.toolGroups.elsewhere": "Memória, Navegador, Apps conectados e Pesquisa têm seus próprios botões de ligar e desligar.",
"botAccess.tools.mode": "Ferramentas disponíveis",
"botAccess.tools.custom": "Seleção personalizada",
"botAccess.tools.onlyListed": "Permitir só as ferramentas listadas",
diff --git a/src/state/bot-patch-queue.ts b/src/state/bot-patch-queue.ts
index 173a1a1d9e..f9aeb71d27 100644
--- a/src/state/bot-patch-queue.ts
+++ b/src/state/bot-patch-queue.ts
@@ -29,6 +29,7 @@ export type BotUpdatePatch = Partial<
| "voiceNotes"
| "voiceNoteEveryReply"
| "xResearch"
+ | "toolsOff"
| "pinned"
| "hidden"
| "sidebarHidden"
diff --git a/src/state/config-status.ts b/src/state/config-status.ts
index 221dbd39b9..d367fce3a2 100644
--- a/src/state/config-status.ts
+++ b/src/state/config-status.ts
@@ -1,6 +1,7 @@
// What GET /api/config tells the app about the server and its settings (re-exported by store.tsx).
import type { EffortLevel, LiveSettings } from "../../shared/wire";
import type { ImageProvider } from "../../shared/image-generation";
+import type { ToolGroup } from "../../shared/tool-groups";
import type { OnboardingStatus } from "@/lib/onboarding";
import type { ModelSelection } from "./store";
@@ -26,6 +27,8 @@ export interface ConfigStatus {
/** X research comes with MausBot Cloud plans: `included` while this server holds the plan's relay credential;
* `unavailable` when the Admin said no to this desktop's paid sign-in. */
xResearch?: { included: boolean; unavailable?: boolean };
+ /** The built-in tool groups this workspace has, the ones a bot's Settings offer to turn off. */
+ toolGroups?: ToolGroup[];
/** The person's own treg key for research: configured or not, never the key. */
treg?: SavedKey;
/** The Postiz organisation API key, and the Postiz server it belongs to when it is not Postiz Cloud. */
diff --git a/src/state/store.tsx b/src/state/store.tsx
index b5a19ece3b..6ef51c91b2 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -309,7 +309,7 @@ export interface Bot extends DefaultBotFields, Pick<WireBot, "mascotFaceColor" |
speakReplies?: boolean;
replyStyle?: import("../../shared/wire").WireBot["replyStyle"];
voice?: string;
- voiceNotes?: boolean; xResearch?: boolean; voiceNoteEveryReply?: boolean | null; // null or absent: follows the Voice setting
+ voiceNotes?: boolean; xResearch?: boolean; toolsOff?: import("../../shared/tool-groups").ToolGroup[]; voiceNoteEveryReply?: boolean | null; // null or absent: follows the Voice setting
memoryEnabled?: boolean;
pinned?: boolean;
hidden?: boolean;