Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(chat): label the add-a-key card as an OpenMausBot tip and say what Jev is
AdityaUmaleed4c797a5c39
diff --git a/server/records-block.ts b/server/records-block.tsindex 82eb3aea97..9c7a44faf5 100644--- a/server/records-block.ts+++ b/server/records-block.ts@@ -43,7 +43,9 @@ export function recordsText(source: string, text: string, max = 48_000): string}export const CARD_RECORDS_SOURCE = "a card shown to the person in this chat, built from their mail, calendar or other bots' work; not your own words";-export const SETUP_RECORDS_SOURCE = "a suggestion the app itself showed to the person in this chat; not your own words";+/** The app's own tip: say so, so the bot neither disowns it as a stranger's message nor calls it suspicious when asked about it. */+export const SETUP_RECORDS_SOURCE =+ "a tip OpenMausBot (the app) itself showed to the person in this chat, labelled as such; genuine, not your own words and not from a stranger. Jev (typesafe.ai) and Cloudflare Workers AI are helper-model services whose key is added in Settings";/** Security invariant: a card the server built from records replays into a turn only through this block. */export function cardRecords(text: string, source = CARD_RECORDS_SOURCE): string {diff --git a/server/replies.test.ts b/server/replies.test.tsindex 0ffd6a918e..ad91d79a14 100644--- a/server/replies.test.ts+++ b/server/replies.test.ts@@ -30,6 +30,9 @@ describe("the app's own add-a-key suggestion", () => {const card = message({ text, setupSuggestion: { kind: "helperKey" } });const records = cardRecords(text, SETUP_RECORDS_SOURCE);expect(records).not.toContain("mail, calendar");+ expect(records).toContain("a tip OpenMausBot (the app) itself showed");+ expect(records).toContain("genuine, not your own words and not from a stranger");+ expect(records).toContain("Jev (typesafe.ai)");expect(transcriptText(card, new Map())).toBe(records);const reply = message({ id: "m2", role: "user", text: "what is this?", replyToId: "m1" });expect(transcriptText(reply, new Map([["m1", card]]))).toBe(`[answering a card shown in this chat]\n${records}\nwhat is this?`);diff --git a/src/components/HelperKeySuggestion.test.ts b/src/components/HelperKeySuggestion.test.tsindex 048373076d..cc45274ce9 100644--- a/src/components/HelperKeySuggestion.test.ts+++ b/src/components/HelperKeySuggestion.test.ts@@ -60,4 +60,12 @@ describe("the add-a-key suggestion card", () => {expect(answered.add).toBeUndefined();expect(answered.notNow).toBeUndefined();});++ it("says it is a tip from OpenMausBot and what the key and Jev are, so it never looks like a stranger's message", () => {+ for (const view of [render(message()), render(message("notNow"))]) {+ expect(view.html).toContain('data-testid="helper-suggestion-from"');+ expect(view.html).toContain("Tip from OpenMausBot");+ expect(view.html).toContain("A helper key lets a small model sort your mail without using your main AI. Jev (typesafe.ai) and Cloudflare Workers AI both offer one.");+ }+ });});diff --git a/src/components/HelperKeySuggestion.tsx b/src/components/HelperKeySuggestion.tsxindex 54b43ffc7b..3742ae639e 100644--- a/src/components/HelperKeySuggestion.tsx+++ b/src/components/HelperKeySuggestion.tsx@@ -1,7 +1,8 @@// The proactive bot's one suggestion to add a helper-model key (server/host/helper-suggestion.ts), in the person's own-// language. A suggestion, not an approval: Add key opens Settings on this device, Not now is kept and ends it.+// language. A suggestion, not an approval: Add key opens Settings on this device, Not now is kept and ends it. Labelled as+// the app's own tip, with what the key and Jev are, so it never reads as an unattributed message from a stranger.import { useState } from "react";-import { Loader2 } from "lucide-react";+import { Lightbulb, Loader2 } from "lucide-react";import { cn } from "@/lib/cn";import { t } from "@/lib/i18n";@@ -29,7 +30,12 @@ export function HelperKeySuggestion({ threadId, message }: { threadId?: string;return (<div data-setup-suggestion="helperKey" className="max-w-[600px] text-[15px] leading-relaxed text-ink">+ <p data-testid="helper-suggestion-from" dir="auto" className="mb-1 flex items-center gap-1 text-[12px] font-medium text-ink-secondary">+ <Lightbulb size={13} aria-hidden="true" />+ {t("chat.helperSuggestion.from")}+ </p><p dir="auto">{t("chat.helperSuggestion.text")}</p>+ <p dir="auto" className="mt-1 text-[13px] text-ink-secondary">{t("chat.helperSuggestion.about")}</p>{declined ? (<p dir="auto" className="mt-1 text-[13px] text-ink-secondary">{t("chat.helperSuggestion.declined")}</p>) : (diff --git a/src/locales/en.json b/src/locales/en.jsonindex bf963b7654..cc70b18110 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -7716,6 +7716,8 @@"chat.preview.removePoint": "Remove {label}","chat.preview.pointedAt": "Pointed at {parts}","chat.helperSuggestion.text": "Want me to sort your email for free? Add a Cloudflare Workers AI key (free tier) or a Jev key.",+ "chat.helperSuggestion.from": "Tip from OpenMausBot",+ "chat.helperSuggestion.about": "A helper key lets a small model sort your mail without using your main AI. Jev (typesafe.ai) and Cloudflare Workers AI both offer one.","chat.helperSuggestion.addKey": "Add key","chat.helperSuggestion.notNow": "Not now","chat.helperSuggestion.declined": "Okay, I won't ask again.",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex c0b918a2a6..2afb6387ec 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -7526,6 +7526,8 @@"chat.preview.removePoint": "Remover {label}","chat.preview.pointedAt": "Você apontou para {parts}","chat.helperSuggestion.text": "Quer que eu organize seus e-mails de graça? Adicione uma chave do Cloudflare Workers AI (plano grátis) ou do Jev.",+ "chat.helperSuggestion.from": "Dica do OpenMausBot",+ "chat.helperSuggestion.about": "Uma chave auxiliar deixa um modelo pequeno organizar seus e-mails sem usar sua IA principal. O Jev (typesafe.ai) e o Cloudflare Workers AI oferecem um.","chat.helperSuggestion.addKey": "Adicionar chave","chat.helperSuggestion.notNow": "Agora não","chat.helperSuggestion.declined": "Tudo bem, não vou perguntar novamente.",diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.jsonindex aefdc23670..8fd482e3a0 100644--- a/src/locales/source-hashes.json+++ b/src/locales/source-hashes.json@@ -36470,7 +36470,9 @@"settings.domain.httpsFirst": "41486ac1d5f39e25ccf3835d520137ecac15a0f49a9dcb5b73f7523fe6df330f","settings.backTo": "ea37ec29c3865c359d3efb005bd252c35457976140bb718824f39d157ea32567","devices.route.httpsAccount": "518ed79b3110cf735bc507bd796cf5c9cd701c3b2dc72bd764e599d411e3baf5",- "backup.importAction": "ea94509e38cf6d6427db3a1b5a3b5816cba1e8f89b08f9739f6077ade188163c"+ "backup.importAction": "ea94509e38cf6d6427db3a1b5a3b5816cba1e8f89b08f9739f6077ade188163c",+ "chat.helperSuggestion.from": "338d86d437daa564bbad98f115c5cf2fef5c34206d9a81c637cd6e8a8b13990e",+ "chat.helperSuggestion.about": "90a8c616bbb161c27ffad72536c2ba545bbe837e31c70c581a19c0d0d5bb0bbf"},"zh": {"pro.fromPrice": "a48a04a457d60b08b54fc83e7a6c4584ffedb1e23621859084900c8521a3af7b",@@ -54696,7 +54698,9 @@"settings.domain.httpsFirst": "41486ac1d5f39e25ccf3835d520137ecac15a0f49a9dcb5b73f7523fe6df330f","settings.backTo": "ea37ec29c3865c359d3efb005bd252c35457976140bb718824f39d157ea32567","devices.route.httpsAccount": "518ed79b3110cf735bc507bd796cf5c9cd701c3b2dc72bd764e599d411e3baf5",- "backup.importAction": "ea94509e38cf6d6427db3a1b5a3b5816cba1e8f89b08f9739f6077ade188163c"+ "backup.importAction": "ea94509e38cf6d6427db3a1b5a3b5816cba1e8f89b08f9739f6077ade188163c",+ "chat.helperSuggestion.from": "338d86d437daa564bbad98f115c5cf2fef5c34206d9a81c637cd6e8a8b13990e",+ "chat.helperSuggestion.about": "90a8c616bbb161c27ffad72536c2ba545bbe837e31c70c581a19c0d0d5bb0bbf"},"uk": {"pro.fromPrice": "a48a04a457d60b08b54fc83e7a6c4584ffedb1e23621859084900c8521a3af7b",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 0367326096..6df98640e3 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -7348,6 +7348,8 @@"chat.preview.removePoint": "移除 {label}","chat.preview.pointedAt": "指出了 {parts}","chat.helperSuggestion.text": "要我免費幫你整理郵件嗎?新增一個 Cloudflare Workers AI 金鑰(免費額度)或 Jev 金鑰就行。",+ "chat.helperSuggestion.from": "來自 OpenMausBot 的提示",+ "chat.helperSuggestion.about": "輔助金鑰讓一個小型模型幫你整理郵件,不會用到你的主要 AI。Jev(typesafe.ai)和 Cloudflare Workers AI 都有提供。","chat.helperSuggestion.addKey": "新增金鑰","chat.helperSuggestion.notNow": "暫時不要","chat.helperSuggestion.declined": "好的,我不會再問了。",