Skip to content

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

Email: keep claude.ts and wire.ts within their size limits; the mailbox card's test follows a superseded card

milind-sonidee9d31238ab
diff --git a/server/drivers/claude.ts b/server/drivers/claude.ts
index e9a8bebbb6..ae27c3f5be 100644
--- a/server/drivers/claude.ts
+++ b/server/drivers/claude.ts
@@ -17,7 +17,7 @@ import { botSettingsFor, withBotSettings } from "./claude-bot-settings.ts";
import { claudeBilling, claudeCallUsage } from "./claude-billing.ts";
import { claudeAuthFailure, claudeAuthRecovery } from "./claude-auth-recovery.ts";
import { claudeModelExtras } from "./claude-model-extras.ts";
-import { claudeToolSearchSetting } from "./claude-tool-search.ts"; import { unusableBuiltIns } from "./claude-unusable-tools.ts";
+import { claudeToolSearchSetting } from "./claude-tool-search.ts"; import { unusableBuiltIns } from "./claude-unusable-tools.ts"; import { EMAIL_READ_TOOL_NAMES } from "../../shared/email.ts";
import { claudeElicitations } from "./claude-elicitation.ts";
import { readCostHistory, recordCostState } from "./claude-cost-history.ts";
import { classifyResumeFailure, mayReplay, rebuiltSessionNotice, recoveryPromptFor } from "../resume-recovery.ts";
@@ -35,7 +35,6 @@ import type {
SteerOutcome,
TextGenerationOptions,
} from "../contracts.ts";
-import { EMAIL_READ_TOOL_NAMES } from "../../shared/email.ts";
import { appMountFor, customServerGate, gateQueryTools, gateServer } from "../mcp-gate-config.ts";
import { canUseMcpServer } from "../../shared/tool-scope.ts";
import { assertToolScopeSupported } from "../../shared/tool-scope-support.ts";
@@ -1095,8 +1094,7 @@ export const ClaudeDriver: ProviderDriver<ClaudeConfig> = {
for (const name of ["data", "highlevel", "device"] as const) {
if (turn.integrations?.[name]) { mcpServers[name] = { ...turn.integrations[name] }; allowed.push(`mcp__${name}`); }
}
- // Only its reads: a send asks as any tool of a person's own server does.
- if (turn.integrations?.email) { mcpServers.email = { ...turn.integrations.email }; allowed.push(...EMAIL_READ_TOOL_NAMES.map((tool) => `mcp__email__${tool}`)); }
+ if (turn.integrations?.email) { mcpServers.email = { ...turn.integrations.email }; allowed.push(...EMAIL_READ_TOOL_NAMES.map((tool) => `mcp__email__${tool}`)); } // Only its reads: a send asks as any tool of a person's own server does.
if (turn.integrations?.dweb) {
mcpServers.dweb = {
command: process.execPath,
diff --git a/server/host/secret-cards.test.ts b/server/host/secret-cards.test.ts
index 9b754924cb..56532a6701 100644
--- a/server/host/secret-cards.test.ts
+++ b/server/host/secret-cards.test.ts
@@ -81,7 +81,7 @@ describe("the mailbox card", () => {
const cards = createSecretCards({
store: store as never, cfg: {} as never, botLogins: { credentialConfig: (config) => ({ ...config, onePassword: { connected: false } }) },
phoneSecrets: { provide: async () => {}, open: async () => PASSWORD } as never, phoneSecretSubmissions: { has: () => false, run: async (_card: unknown, _op: unknown, work: () => Promise<void>) => work() } as never,
- connectorThread: () => ({ bot, group: undefined }), answerCardNode: (_thread, _id, text) => { resumed.push(text); return true; }, dataDir, providerKeysRefused: false,
+ connectorThread: () => ({ bot, group: undefined }), answerCardNode: (_thread, _id, text) => { resumed.push(text); return true; }, followCard: () => {}, dataDir, providerKeysRefused: false,
layerFolder: () => dataDir, turnVm: () => undefined,
email: {
connect: async (request) => { connects.push(request as never); return (options.connect?.(request as never) ?? { ok: true, account: ACCOUNT, inbox: { messages: 3 }, sending: { ok: true } }) as never; },
diff --git a/shared/wire.ts b/shared/wire.ts
index 8a90629e70..ae08c1f7f6 100644
--- a/shared/wire.ts
+++ b/shared/wire.ts
@@ -740,11 +740,8 @@ export interface SecretRequestCardData {
description: string;
placeholder: string;
helpUrl: string;
- /** A custom secret's use the person agrees to: "ref", OpenMausBot's own tools only; "file", the bot's commands; "email",
- * the Email connector, which keeps it and never gives it to a bot. */
- delivery?: SecretDelivery | "email";
- /** An email card: the mailbox it is for, when known. Off a phone the person can type or change it on the card. */
- address?: string;
+ /** A custom secret's use: "ref", OpenMausBot's own tools only; "file", the bot's commands; "email", the Email connector, never a bot. */ delivery?: SecretDelivery | "email";
+ /** An email card: the mailbox it is for, when known; off a phone the person can change it on the card. */ address?: string;
/** A custom secret: the bot's own words on why; `description` adds what the bot may do with it, and helpUrl is empty. */
reason?: string;
/** A file secret's Local VM target key, when the asking turn ran in one. */