Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
feat(optimus): decline games with anti-cheat (0.4.7); 1.4.0 docs, release notes and blog post
Salman Qureshi928e805493b8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cb82f55b..cc949252 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,11 +16,11 @@ The first stable release since 1.3.8. It also carries the 1.3.9 hotfix below, wh- **Voice calls in both directions.** Mercury can call you ("call me at 9pm", "call me when it's done"), keeps you posted while it works, takes approvals by voice or in the chat, and sends links, photos and documents mid-call.- Choose the voice engine (OpenAI by default, Gemini, Grok, ElevenLabs, Azure, Qwen, or your own Mercury model), access levels (General / Extended), and link or unlink from the dashboard.-### Optimus plugin 0.4.6 (new)+### Optimus plugin 0.4.7 (new)- **Mercury uses your computer.** It looks at the screen, then moves the pointer, scrolls and types the way a person does, with a "Mercury is driving" overlay while it has control. macOS, Windows and Linux; no developer certificates needed.- **Talk to it.** A talk key starts listening mode with spoken replies, a mute key stops listening without stopping the work, and saying "stop" halts every action at once. Silence ends a session, so nothing is captured or spent while you're away.- **Honest about results.** Optimus checks the screen before it reports something as done, and failed actions are reported as failed.-- Consequential actions ask first; games with anti-cheat are refused. The TUI status bar shows when Optimus is listening or working, and a soft tick-tock plays while it works.+- Consequential actions ask first; Mercury declines to play or automate games that use anti-cheat (Vanguard, Easy Anti-Cheat, BattlEye), since automated input there can get your account banned. The TUI status bar shows when Optimus is listening or working, and a soft tick-tock plays while it works.- Voice settings are shared with WhatsApp.### Also newdiff --git a/RELEASE.md b/RELEASE.mdindex 600f6636..d0fc25f9 100644--- a/RELEASE.md+++ b/RELEASE.md@@ -1,47 +1,65 @@-# Release v1.3.0+# Release v1.4.0-## ☿ Mercury Agent v1.3.0 — Mercury Bots+## ☿ Mercury Agent v1.4.0 — Mercury Plugins-Mercury stops being one agent and becomes **a fleet**. This release introduces **Mercury Bots** — persistent, persona-scoped agents that run *outside your conversation*: each with its own persona, private sandbox workspace, skill library, permission scopes, token budget, and a durable job queue. Onboard a researcher, a writer, a watchtower — chain them into multi-level fleets where a lead bot recruits and manages its own crew. They work 24/7, stream their thinking into their own threads, and escalate only what truly needs you.+Mercury gets plugins. Install what you need with `/plugins install <id>`: each plugin runs in its own process, comes from a checksum-verified catalog, and asks for exactly the access it needs. Two official plugins ship today on macOS, Windows and Linux:-### What's New+- **WhatsApp**: chat with Mercury, and talk to it on voice calls. It can call you, or listen to you on the go.+- **Optimus**: Mercury uses your computer. It sees the screen, moves, scrolls and types like a person, talks back, and stops the moment you say "stop".-- **Persistent bot runtime** — Bots are long-lived persona agents, not temp sub-agents: `bot.yaml` manifest + `permissions.yaml`, private sandbox at `~/.mercury/bots/<id>/`, journal-backed thread history that hydrates on reopen. A wake turns them on; they work through a durable job queue that survives restarts.-- **Fleets — leads + crews** — Promote any bot to **fleet lead**; it recruits, organizes, and manages its own crew (imperative self-organization). Multi-level hierarchies supported; crew results bubble up through the lead. Onboarding tiers: solo → lead auto-build → lead manual.-- **Durable queue + DLQ** — Jobs survive restarts, lease-heartbeat while running, classify to `timed out` on worker death, and replay non-destructively from the DLQ (`/bots replay`). Nothing dies silently.-- **Web cockpit** — The local dashboard gained a **Mercury Bots section**: live roster states, per-bot threads, needs-you escalation badges, and a fleet step view that mirrors the TUI.-- **Sandbox + deliverables** — Per-bot isolated workspace; final artifacts go out via `bot_deliver`; retention janitor caps disk; fleet-shared folder for cross-bot files with implicit grants.-- **Bundles** — `/bots export` produces a shareable bundle (manifests + personas + permissions + skills; a lead's bundle carries its whole crew). `/bots import` recreates bots — imported bots start **disabled** by design; sandbox, journals, and `.env` never travel.-- **Permission tiers at onboarding** — `ask` / `allow` per capability, set explicitly. Per-bot shell allow-lists flow from `permissions.yaml autoApproveCommands`; malformed scopes skip + warn, never crash turns.-- **Bot-facing tools** — `dispatch_bot`, `bot_schedule`, `bot_deliver`, `fleet_status`, `journal_append` + native/per-bot skill libraries with auto-synthesis. Bots can schedule their own future runs.-- **`mercury bots` CLI** — `doctor` (exit 1 when actionable), `list`, `storage`.+The first stable release since 1.3.8. It also carries the 1.3.9 hotfix below, which only shipped on the dev channel.-### Fixed+### Plugins (#203)+- **Optional plugins.** `/plugins install|enable|disable|update|rollback|uninstall`, from a checksum-verified catalog at mercuryagent.sh. Plugins run out of process, so a crashing plugin can't take Mercury down, and they declare their network hosts, secrets and permissions up front.+- **Plugin API 1.2.** Plugins can return images to the model (kept out of chat history), request desktop access (`permissions.desktop`), and add `whatsapp` or `desktop` channels.+- **Plugins use Mercury's own providers.** You set a key once; plugins borrow it. A missing optional key is explained once, with what it turns off.+- **Guided setup and a flatter `/plugins <id>` menu.** Settings are listed on the menu itself, yes/no options say what each answer does, and the follow-up settings appear right after you save. No dead ends.+- Installing a plugin into a running Mercury now starts it immediately (it used to wait for a restart).++### WhatsApp plugin 0.1.1 (#202)+- Chat with Mercury on WhatsApp from a spare number, as a linked device.+- **Voice calls in both directions.** Mercury can call you ("call me at 9pm", "call me when it's done"), keeps you posted while it works, takes approvals by voice or in the chat, and sends links, photos and documents mid-call.+- Choose the voice engine (OpenAI by default, Gemini, Grok, ElevenLabs, Azure, Qwen, or your own Mercury model), access levels (General / Extended), and link or unlink from the dashboard.-- Fleet duplication on reopen; `/bots` stays inside the bot thread it opened.-- Bot thinking streams live into its thread; fleet speed fixes (single-provider lease wait, batched roster fetches).-- Bot-thread results no longer sliced at 800 chars; durable retries + durable mailboxes close delivery-contract gaps.-- Windows hardening: SQLite queue teardown EBUSY, heartbeat-test EBUSY, retention EINVAL, separator-agnostic traversal guard; post-close queue ops degrade to no-ops.-- JSON backend lease-expiry race closed; doctor flags routines registered in schedules but missing from `bot.yaml` (the silently-never-fires failure).-- Telegram member installs no longer surface `install_skill`.+### Optimus plugin 0.4.7 (new)+- **Mercury uses your computer.** It looks at the screen, then moves the pointer, scrolls and types the way a person does, with a "Mercury is driving" overlay while it has control. macOS, Windows and Linux; no developer certificates needed.+- **Talk to it.** A talk key starts listening mode with spoken replies, a mute key stops listening without stopping the work, and saying "stop" halts every action at once. Silence ends a session, so nothing is captured or spent while you're away.+- **Honest about results.** Optimus checks the screen before it reports something as done, and failed actions are reported as failed.+- Consequential actions ask first; Mercury declines to play or automate games that use anti-cheat (Vanguard, Easy Anti-Cheat, BattlEye), since automated input there can get your account banned. The TUI status bar shows when Optimus is listening or working, and a soft tick-tock plays while it works.+- Voice settings are shared with WhatsApp.++### Also new+- **Built-in `web_search`.**+- **Mercury reads photos and PDFs, and listens to voice notes, from chat.**+- Mercury always knows it comes from Cosmic Stack.+- Web dashboard: plain-language model names, renaming, a reasoning picker, every local Ollama model, ChatGPT Plus/Pro plan models.++### Fixed+- **The desktop channel no longer loops broadcasts.** One failing alert used to fan out into hundreds of WhatsApp messages; repeated alerts are now sent once.+- ChatGPT OAuth turns no longer fail after a tool call.+- Long messages no longer fail memory search ("Expression tree is too large").+- New dashboard chats no longer land in the previous conversation; dashboard permission prompts render and resolve.+- Plugin tar calls work with GNU tar on Windows.+- **The web dashboard works on the Windows standalone binary.** Mercury looked for its `web/` folder inside the binary's virtual filesystem, because it only recognised Bun's macOS/Linux marker (`$bunfs`) and not Windows' (`~BUN`), so the dashboard reported "web UI not found". Found and fixed by @farena-ai in #189; the same check is now shared by the login page and the memory-graph fallback.### Upgrade**npm:**```-npm install -g @cosmicstack/[email protected]+npm install -g @cosmicstack/[email protected]mercury restart```-**Standalone binary:** re-run the one-line installer from mercuryagent.sh, then `mercury restart`.+**Standalone binary:** `mercury upgrade`, or re-run the one-line installer from mercuryagent.sh.-No config migrations. Bots are opt-in: `/bots create <id> "Name" "Description"` onboards your first bot.+Then try a plugin:+```+/plugins install optimus+/plugins install whatsapp+```-### Files Touched (highlights)+No config migrations. Plugins are opt-in.-- `src/bots/*` — the entire fleet module (new): store, queue (SQLite+JSON), bot-manager, bot-turn, journal, bundle, doctor, persona-template, fleet-*, skill-synthesis, retention, tools/.-- `src/core/agent.ts`, `src/cli/*`, `src/channels/cli.ts` — /bots chat surface, CLI command group, bot-thread region, thinking streams.-- `src/web/*` — Mercury Bots cockpit section on the dashboard.-- PRs: #131–#139, #117 (RevShare).+Docs: https://mercuryagent.sh/docs/integrations/optimus · https://mercuryagent.sh/docs/integrations/whatsapp · https://mercuryagent.sh/docs/releases/1.4.0-**Full Changelog**: https://github.com/cosmicstack-labs/mercury-agent/compare/v1.2.7...v1.3.0\ No newline at end of file+**Full Changelog**: https://github.com/cosmicstack-labs/mercury-agent/compare/v1.3.8...v1.4.0diff --git a/plugins/optimus/companion/Cargo.lock b/plugins/optimus/companion/Cargo.lockindex bf8d0e97..f50cb831 100644--- a/plugins/optimus/companion/Cargo.lock+++ b/plugins/optimus/companion/Cargo.lock@@ -1280,7 +1280,7 @@ dependencies = [[[package]]name = "mercury-optimus"-version = "0.4.4"+version = "0.4.7"dependencies = ["base64 0.22.1","core-foundation",diff --git a/plugins/optimus/companion/Cargo.toml b/plugins/optimus/companion/Cargo.tomlindex 6483f2ec..2015b46b 100644--- a/plugins/optimus/companion/Cargo.toml+++ b/plugins/optimus/companion/Cargo.toml@@ -1,6 +1,6 @@[package]name = "mercury-optimus"-version = "0.4.6"+version = "0.4.7"edition = "2024"rust-version = "1.94"description = "Optimus: full computer control for Mercury (screen, mouse, keyboard, apps, voice)"diff --git a/plugins/optimus/mercury-plugin.template.json b/plugins/optimus/mercury-plugin.template.jsonindex 0f89c28e..011fd6b4 100644--- a/plugins/optimus/mercury-plugin.template.json+++ b/plugins/optimus/mercury-plugin.template.json@@ -2,7 +2,7 @@"manifestVersion": 1,"id": "optimus","name": "Optimus",- "version": "0.4.6",+ "version": "0.4.7","description": "Mercury uses your computer like a person: sees the screen, moves the mouse, types and opens apps, by chat or out loud with a talk key. macOS, Windows and Linux. Asks before anything that submits, sends, pays or deletes.","kind": "out-of-process","author": "Cosmic Stack",@@ -32,7 +32,7 @@},{"name": "act",- "description": "Use the mouse and keyboard like a person: click, type, paste, press keys, scroll, drag, draw freehand. Returns a fresh screenshot. Pass `actions` as a list. To write text (posts, emails, articles) click the box, then use type: it types key by key like a person, so it works in every editor (up to 3,000 characters per type action; longer text in parts). Use paste only if typing fails. \"Sent\" means the input was sent, not that it worked: check the returned screenshot, and before telling the owner a task is done, look and confirm the result. FAILED means nothing (or not everything) happened. Only for ordinary, reversible steps. Anything that submits, sends, posts, pays, buys, deletes, installs or changes settings must go through act_consequential instead. Never type passwords, card numbers or 2FA codes: ask the owner to do that part.",+ "description": "Use the mouse and keyboard like a person: click, type, paste, press keys, scroll, drag, draw freehand. Returns a fresh screenshot. Pass `actions` as a list. To write text (posts, emails, articles) click the box, then use type: it types key by key like a person, so it works in every editor (up to 3,000 characters per type action; longer text in parts). Use paste only if typing fails. \"Sent\" means the input was sent, not that it worked: check the returned screenshot, and before telling the owner a task is done, look and confirm the result. FAILED means nothing (or not everything) happened. Only for ordinary, reversible steps. Anything that submits, sends, posts, pays, buys, deletes, installs or changes settings must go through act_consequential instead. Never type passwords, card numbers or 2FA codes: ask the owner to do that part. Never use it to play or automate a game with anti-cheat (Valorant, Fortnite, Call of Duty, Counter-Strike 2, or anything running Vanguard, Easy Anti-Cheat or BattlEye): automated input breaks those games' rules and can get the owner banned, so decline and say why.","readOnly": true,"timeoutMs": 300000},diff --git a/src/plugins/channel-bridge.ts b/src/plugins/channel-bridge.tsindex 5ef82329..435132a3 100644--- a/src/plugins/channel-bridge.ts+++ b/src/plugins/channel-bridge.ts@@ -633,6 +633,7 @@ export class PluginChannel extends BaseChannel {'You\'re talking with the owner, out loud, at their own computer. Your answer is spoken: one to three short sentences, no markdown, lists, links or code.',`To see their screen use ${this.manifest.id}__look; to do things on it use ${this.manifest.id}__open and ${this.manifest.id}__act, and ${this.manifest.id}__act_consequential for the step that submits, sends, posts, pays, deletes or installs (e.g. the final Post or Send button). Give every open/act call a short \`say\` ("Opening Gmail", "Typing your post"): it is spoken the moment it happens, so the owner hears each step live. Look after each step and check it worked before the next. To write text, click the box and use a type action (it types like a person); paste only if typing fails.`,'Never say a task is done unless you saw it done: before answering, take a fresh look and check the exact result (the post is published, the emails are gone, the file is saved), and say what you saw. If any step came back FAILED, was stopped, or you could not confirm the result, say that plainly and offer to try again. A step reply that says "Sent" only means the input reached the screen.',+ 'Never play or automate a game that uses anti-cheat (online competitive games such as Valorant, Fortnite, Call of Duty, Apex Legends, Counter-Strike 2, League of Legends, PUBG or Rainbow Six Siege, or anything running Vanguard, Easy Anti-Cheat, BattlEye or Ricochet): automated input there breaks the game\'s rules and can get the owner banned. Say so in a sentence and offer something else. Single-player and offline games without anti-cheat are fine.','Access: Extended. Use your tools, skills, files and memory as you would anywhere else. Approvals are asked out loud and answered by voice.',].join('\n');}diff --git a/website/blog/2026-10-23-mercury-1-4/cover.jpg b/website/blog/2026-10-23-mercury-1-4/cover.jpgnew file mode 100644index 00000000..1bb61363Binary files /dev/null and b/website/blog/2026-10-23-mercury-1-4/cover.jpg differdiff --git a/website/blog/2026-10-23-mercury-1-4/index.md b/website/blog/2026-10-23-mercury-1-4/index.mdnew file mode 100644index 00000000..1975f881--- /dev/null+++ b/website/blog/2026-10-23-mercury-1-4/index.md@@ -0,0 +1,114 @@+---+slug: mercury-1-4+title: "Mercury 1.4: plugins, WhatsApp calls, and an agent at your desk"+description: "Mercury 1.4 adds isolated plugins and two official ones: WhatsApp chat with voice calls both ways, and Optimus, which sees your screen and uses your mouse."+authors: [salman]+tags: [news, releases, product]+image: ./cover.jpg+keywords: [mercury agent, mercury 1.4, ai agent plugins, whatsapp ai agent, ai voice calls, computer use agent, optimus]+---++Mercury 1.4 is out. It adds a plugin system, and two official plugins built on it. The WhatsApp plugin lets you chat with Mercury and talk to it by voice call: you can call it, and it can call you. Optimus lets Mercury use your computer. It looks at the screen, moves the pointer and types the way a person does, and you can drive it by chat or by pressing a key and talking.++{/* truncate */}++This is the first stable release since 1.3.8. The [release notes](/docs/releases/1.4.0) have the full list. This post is about why we built it this way.++## Why plugins++WhatsApp calling needs a WhatsApp protocol stack, a realtime audio pipeline and a handful of voice providers. Computer control needs screen capture, synthetic input and, on macOS, its own signed app bundle. Many people who run Mercury want neither. Putting both into the single Mercury binary would have made the download bigger for everyone and put more native code into every install.++So we wrote down a rule in [ADR-025](https://github.com/cosmicstack-labs/mercury-agent/blob/main/DECISIONS.md): features only some people want ship as plugins, and a bad plugin must never take Mercury down with it. The work started in [#203](https://github.com/cosmicstack-labs/mercury-agent/issues/203).++You manage plugins from any chat:++```text+/plugins install whatsapp+/plugins disable whatsapp+/plugins update+/plugins rollback whatsapp+/plugins uninstall whatsapp+```++The same commands work in a shell as `mercury plugins ...`, and in the dashboard under Configure, then Plugins. The catalog lives at `https://mercuryagent.sh/plugins/catalog.json`. Every entry pins a version to a SHA-256 checksum, and Mercury checks the download against it before installing anything.++## How a plugin is kept at arm's length++Both official plugins are out-of-process. Each is a separate Rust program that Mercury starts and talks to over stdio using MCP, plus a small channel extension for chat and voice. That boundary does most of the work:++- **A crash is the plugin's problem.** Mercury restarts it. After five failures in a row, or too many crashes, the plugin is turned off and you get a message saying why.+- **It gets only what it declared.** The manifest lists the network hosts a plugin may reach and the secrets it may read. Install shows you that list before you confirm. A plugin that controls the computer carries a new `permissions.desktop` flag, and `/plugins info` shows it as a warning.+- **It can't widen access.** For a chat channel, Mercury decides who gets through, not the plugin. Unknown numbers are dropped before they reach the agent.+- **Changes are reversible.** The previous version is kept, so `/plugins rollback` brings it back with its old settings. If Mercury fails to start twice right after a plugin change, it turns that plugin off. `mercury start --safe-mode` starts with every plugin off.++Plugins also borrow Mercury's own AI providers. If you already set up OpenAI in Mercury, both plugins' voice features use that key. You don't paste it again. Keys a plugin needs for itself, such as a Gemini or Deepgram key, are stored with Mercury's keys and shared with any other plugin that declares them.++The plugin menu took two rounds. In the first version, the main settings sat behind a "Change a setting" entry, the voice section forced you through every field, yes/no questions didn't say what each answer meant, and picking a voice engine didn't lead you to the key it needed. Now `/plugins whatsapp` lists every setting with its current value. A yes/no setting says what each answer does ("On: Mercury picks up when you call it"). Change the voice engine to Gemini and Mercury asks for the Gemini key straight away. Every question has a way back.++The plugin API is now at 1.2. The main addition is that a tool can return images to the model, which Optimus needs for screenshots. The images go to the model with that one tool result and are never written to chat history, logs or memory. The [author guide](/docs/reference/plugins) covers the rest.++## WhatsApp: it can call you, or listen to you on the go++The WhatsApp plugin runs Mercury on a spare number as a linked device, the same way WhatsApp Web connects. You chat with it from your own number. One warning up front: this uses an unofficial, reverse-engineered protocol. A WhatsApp update can break it, and automated use can get a number restricted. Link a number you can afford to lose, not your main one.++Text works the way you'd expect. Photos and PDFs you send are passed to the model if it accepts them, and voice notes are transcribed with your OpenAI provider. Two access levels decide how much Mercury can do in the chat. General, the default, is conversation only, with no tools, files or memory. Extended is the full agent.++Calls are where it gets useful. You can ring the spare number while you're out and ask Mercury to look something up, check on a task, or draft a reply. It can also ring you. Say "call me at 9pm about the deploy" in any chat, or on a call. The time is parsed in code, not by a model, and confirmed back to you as an exact time. If you miss the call, it tries once more five minutes later and then sends a message. "Call me when it's done" means it does the work first and then calls. Mercury won't call more than four times an hour by default, so a task stuck in a loop can't keep ringing your phone.++During a call, Mercury uses its tools as usual and keeps you posted while it works. Anything that needs approval is asked out loud and posted in the chat at the same moment, and whichever answer arrives first wins. A spoken yes only counts if your own transcribed words say yes, and it never turns into "always". Mercury doesn't read links aloud. It sends them to the chat and tells you it did.++OpenAI Realtime is the default voice engine, and the one we recommend for the best calls. Gemini Live, Grok Voice, ElevenLabs, Azure, Qwen-Omni, or your own Mercury model with separate speech-to-text and text-to-speech providers all work too. Setup only asks about the engine if you don't have an OpenAI provider already.++The full setup is in the [WhatsApp docs](/docs/integrations/whatsapp).++## Optimus: Mercury at your desk++Optimus is the big one. You ask, and Mercury does it on your screen, in whatever app you use.++**How it sees.** The `look` tool takes a screenshot of the display the mouse is on, scaled to fit 1280 by 800, and can zoom into part of it. Screenshots are taken only when Mercury looks or acts. Nothing captures in the background.++**How it acts.** We wanted you to be able to follow what it's doing. In the default Natural pace, the pointer glides along a gentle curve, scrolling arrives in small steps, and text is typed key by key with an uneven rhythm. Typing key by key means it works in every editor, and paste is only a fallback. While it drives, a ring and the label "Mercury is driving" follow the pointer. On macOS and Windows that overlay is excluded from capture, so it never shows up in Optimus's own screenshots.++**How it stays honest.** This was the hardest part. The logs from one early build showed 29 `act` calls rejected because the model sent its steps in a shape Optimus couldn't read. Nothing happened on screen, and Mercury reported success anyway. Optimus now reads steps in every shape we've seen models send. Every step reports "Sent", meaning the input reached the screen, not "done", and returns a fresh screenshot. Failures start with FAILED. Mercury is told to look again and confirm the result before it says a task is finished. Optimus also records every step that failed or was stopped. In a voice session, the answer is checked against that record before you hear it, so a failed task is reported as failed.++**How you stay in control.**++- Optimus does nothing until you turn on "Control this computer" in setup.+- Ordinary, reversible steps run straight away. The step that submits, sends, posts, pays, deletes, installs or changes a setting goes through a separate tool that needs your approval.+- Move the mouse while it works and it stops at the next step and hands control back.+- It's told never to type passwords, card numbers or 2FA codes. It asks you to do that part.++Press the talk key (`ctrl+alt+m` by default, Control+Option+M on a Mac), hear a chime, and talk. Mercury answers out loud and narrates each step as it happens. A quiet tick-tock plays while it works. Say "stop", or press the talk key while it's working, and every action halts at once. The mute key (`ctrl+alt+shift+m`) stops listening without stopping the work, and nothing you say is sent while muted. After 60 seconds of silence with nothing running, the mic closes by itself. The terminal status bar shows when Optimus is listening, working or muted. Voice settings are shared with the WhatsApp plugin, so a key you added there works here too.++Optimus runs on macOS, Windows and Linux, and no Apple Developer ID is involved. On macOS, privacy permissions are charged to the app that launched a process, so if Optimus ran under your terminal, the grant would cover every script that terminal runs. Instead, Optimus builds its own `Optimus.app` and signs it with a certificate made on your Mac. You grant it Accessibility, Screen Recording and Microphone once, and because the certificate stays the same, the grants survive updates. On Windows there's nothing to grant, though windows running as administrator can't be controlled. On Linux, X11 gets full control. Wayland is limited for now: input and the talk key reach only XWayland apps.++The [Optimus docs](/docs/integrations/optimus) cover every setting and permission.++## The rest of 1.4++- A built-in `web_search` tool, free and keyless. In testing, asking for the news on a WhatsApp call made zero tool calls, partly because Mercury had no search tool to call.+- Mercury always knows it comes from Cosmic Stack.+- The dashboard model picker shows plain-language names, every local Ollama model and ChatGPT Plus/Pro plan models, and has a reasoning picker.+- Fixes for ChatGPT OAuth turns failing after a tool call, memory search failing on long messages, and the dashboard on the Windows standalone binary (found and fixed by @farena-ai in #189). The 1.3.9 fix, where `mercury doctor` restarts the daemon when your configuration changed, is folded in.++## Upgrading++```bash+# npm+npm install -g @cosmicstack/[email protected]+mercury restart++# standalone binary: rerun the installer, or+mercury upgrade+```++Then install what you want:++```text+/plugins install whatsapp+/plugins install optimus+```++Your `~/.mercury` folder carries over untouched. If something breaks, open an issue or find us on [Discord](https://discord.gg/5emMpMJy5J).++https://github.com/cosmicstack-labs/mercury-agentdiff --git a/website/docs/cli-commands/plugins.mdx b/website/docs/cli-commands/plugins.mdxindex d0b97a91..2a71b8e7 100644--- a/website/docs/cli-commands/plugins.mdx+++ b/website/docs/cli-commands/plugins.mdx@@ -8,9 +8,25 @@ Plugins add features to Mercury that not everyone needs, without making theMercury download bigger for everyone. You install the ones you want; the restnever touch your machine.-A plugin can add **tools** the agent can use and, for some plugins, **slash-commands** you can type. Every plugin can be turned off or removed at any-time, and Mercury keeps running if a plugin breaks.+A plugin can add **tools** the agent can use, a **chat channel** (such as+WhatsApp) and, for some plugins, **slash commands** you can type. Every plugin+can be turned off or removed at any time, and Mercury keeps running if a+plugin breaks. Plugins are available from Mercury 1.4.0.++## Official plugins++These are in the plugin catalog for macOS (Apple silicon and Intel),+Windows x64 and Linux (x64 and arm64):++| Plugin | Install | What it does |+|--------|---------|--------------|+| [WhatsApp](../integrations/whatsapp) | `/plugins install whatsapp` | Chat with Mercury on WhatsApp from a spare number, and talk to it by voice call in both directions |+| [Optimus](../integrations/optimus) | `/plugins install optimus` | Mercury uses your computer: sees the screen, moves the pointer, types and opens apps, by chat or out loud |++The catalog is published at+[mercuryagent.sh/plugins/catalog.json](https://mercuryagent.sh/plugins/catalog.json).+Each entry pins a version and a SHA-256 checksum, and Mercury checks the+download against it before installing.## Four ways to manage plugins@@ -41,11 +57,51 @@ away without a restart.| `/plugins rollback ID` | `mercury plugins rollback ID` | Go back to the version you had before || `/plugins uninstall ID` | `mercury plugins uninstall ID` | Remove it. Add `--purge` to delete its data too || `/plugins set ID KEY VALUE` | `mercury plugins set ID KEY VALUE` | Change a plugin setting |+| `/plugins pair ID PHONE` | `mercury plugins pair ID` (QR code) or `--code PHONE` | Link a channel plugin's account, such as the spare WhatsApp number |+| `/plugins unlink ID` | `mercury plugins unlink ID` | Log a channel plugin out of its account |+| `/plugins test ID` | `mercury plugins test ID` | Send yourself a test message through a channel plugin |After install, Mercury walks you through the plugin's setup, one questionat a time, in the same chat. For WhatsApp that's your number, what Mercury-may do in your chat, and linking the spare number. You never need to-remember a plugin's settings: open `/plugins ID` and pick from the list.+may do in your chat, and linking the spare number. For Optimus it's whether+it may control the computer, how you want to talk to it, and the talk key.+Setup skips questions that don't apply: with an OpenAI provider already set+up in Mercury, neither plugin asks which voice to use.+`mercury plugins install ID --no-setup` installs without the walk-through.++## The plugin menu++You never need to remember a plugin's settings. `/plugins ID` (or+`mercury plugins open ID`, or the dashboard) opens its menu:++- **Every setting is listed on the menu** with its current value. Pick one to+ change it. Related settings are grouped into sections, such as+ **🎙 Voice calls**, each marked ✓ when it's ready or "needs setup" when it+ isn't.+- **Choices say what they do.** A yes/no setting shows, for example,+ "On: Mercury picks up when you call it" and "Off: your calls to Mercury ring+ out", and after you save, the reply repeats what your choice does.+- **Follow-up settings come next.** Change the voice engine to Gemini and+ Mercury asks for the Gemini key and model straight away, instead of leaving+ you to find them.+- **No dead ends.** Every question offers a way back with no change, and+ `cancel` closes the menu.+- The menu also has **Link** / **Unlink** and **Send me a test message** for+ channel plugins, **Run setup again**, **Update**, **Turn off** and+ **Uninstall**.++In a chat, reply with the option's number (or tap a button on Telegram).+Members see the status only.++## Plugins use Mercury's providers++A plugin that needs an AI provider (the voice engines in WhatsApp and Optimus+use OpenAI or Grok) borrows the one you already set up in Mercury+(dashboard → Providers, or `mercury doctor`). You set a key in one place.+Keys a plugin asks for itself (a Gemini or Deepgram key, say) are stored with+Mercury's own keys, shown only as "set", and readable only by plugins that+declare them, so a key added for WhatsApp also works for Optimus. If a key+is missing, Mercury tells you once what it turns off and how to fix it.`install` accepts a catalog id, a folder, a `.tgz` file, an `https://` URL,or `github:owner/repo` (latest release). Only catalog plugins are verified@@ -63,7 +119,8 @@ computer Mercury runs on.they do.- **Only what it declared.** A plugin can reach only the websites and readonly the secrets listed in its manifest. `/plugins info` shows both, and- install shows them before you confirm.+ install shows them before you confirm. A plugin that controls the computer+ (Optimus) is flagged with a warning.- **Tools ask first.** A plugin tool that changes anything asks for yourapproval like any built-in tool. Bots never see plugin tools unless youallow them in the bot's tool list (`weather__forecast`, or `weather__*` for@@ -76,7 +133,8 @@ computer Mercury runs on.- it isn't compatible with your Mercury version;- Mercury failed to start twice right after it was installed or updated.- **Clean removal.** Disable or uninstall stops its timers, network requests- and tools straight away. No restart needed.+ and tools straight away. No restart needed. Installing into a running+ Mercury starts the plugin straight away too.- **Updates you can undo.** The previous version is kept, so`/plugins rollback ID` brings it back, with its settings.diff --git a/website/docs/integrations/optimus.mdx b/website/docs/integrations/optimus.mdxnew file mode 100644index 00000000..ae476f33--- /dev/null+++ b/website/docs/integrations/optimus.mdx@@ -0,0 +1,223 @@+---+id: optimus+title: Optimus (computer use)+sidebar_label: Optimus+description: "Optimus lets Mercury use your computer like a person: it sees the screen, moves the pointer, types and opens apps, by chat or out loud with a talk key. Install, permissions, hotkeys, settings and safety."+keywords: [mercury, optimus, computer use, desktop agent, voice, talk key, plugin, screen control]+---++Optimus is a plugin that lets Mercury use your computer. It looks at the screen, then moves the pointer, scrolls and types the way a person does, and opens apps, URLs and files. Ask in any Mercury chat ("look at my screen", "open Safari and search for…"), or press a **talk key**, say what you want, and hear Mercury answer while it works.++It's an optional [plugin](../cli-commands/plugins), version **0.4.7**, from the official plugin catalog. It needs Mercury **1.4.0** or newer.++## Platform support++| Platform | Support |+|---|---|+| **macOS** (Apple silicon and Intel) | Full. You grant Accessibility, Screen Recording and Microphone once. |+| **Windows** x64 | Full. Nothing to grant. Windows running as administrator (Task Manager, installers) can't be controlled. |+| **Linux** x64 and arm64, **X11** | Full. |+| **Linux, Wayland** | Limited. Screenshots go through the desktop's screen-sharing prompt. Mouse, keyboard and the talk key only reach X11 (XWayland) apps for now, and the "Mercury is driving" overlay isn't shown. Use chat, or ask Mercury to start listening. An X11 session gives Optimus full control. |++## Install++In any Mercury chat:++```text+/plugins install optimus+```++Or from a shell:++```bash+mercury plugins install optimus+```++Install shows a warning that this plugin controls the computer, lists what it needs, and asks you to confirm. No Apple Developer ID, code-signing certificate or developer account is needed on any platform.++Setup then asks, one question at a time:++1. **Control this computer.** Optimus does nothing until you say yes. While it's off, every tool except `permissions` replies that Optimus is off.+2. **How you talk to Optimus.** Both (recommended), Chat only, or Listening.+3. **Talk key.** Default `ctrl+alt+m` (Control+Option+M on a Mac). Asked only in Listening or Both.+4. **Who listens and speaks?** Asked only when Mercury has no OpenAI provider. With one, OpenAI Realtime is used and this step is skipped.++Change any of it later in `/plugins optimus`. Optimus has no account to link.++## Permissions++### macOS++macOS charges Accessibility and Screen Recording to the app that started a process, so if Optimus ran under your terminal, the grant would cover every script that terminal runs. Instead, Optimus builds its own `Optimus.app` in the plugin's data folder and signs it with a certificate made on your Mac ("Mercury Optimus (local)"). No Apple account is involved, your login keychain isn't touched, and there's no password prompt.++On first use it asks for these, in **System Settings → Privacy & Security**:++| Permission | Why |+|---|---|+| **Accessibility** | Moving the mouse, typing, and the talk key |+| **Screen Recording** | Seeing the screen |+| **Microphone** | Listening mode only, asked once |++Turn on **Optimus** under each one. If Screen Recording asks to quit and reopen, Optimus restarts by itself the next time it's used. Because the certificate stays the same across updates, the permissions survive plugin updates. macOS asks you to confirm Screen Recording again about once a month.++To check at any time, ask Mercury to check Optimus's permissions (the `permissions` tool). It reports each one and, when asked to fix them, shows the system prompts and opens the right Settings page.++### Windows++Nothing to grant. Optimus can't control windows that run as administrator, such as Task Manager and installers.++### Linux++On **X11** nothing to grant. On **Wayland**, see the limits in [Platform support](#platform-support). Pasting uses `xclip` on X11 and `wl-copy` on Wayland, so install the one for your session if you want the paste fallback.++## Chat and listening++**Chat.** Ask Mercury in any chat (terminal, dashboard, Telegram, WhatsApp) to use the screen. Mercury takes a look, acts, and looks again to check.++**Listening.** Press the talk key. You hear a rising chime, then talk. Mercury answers out loud while it works on your screen and says each step as it happens ("Opening Gmail", "Typing your post"). From a chat you can also say "let's talk" and Mercury starts listening for you (the `listen` tool).++The **How you talk to Optimus** setting decides which of these you get:++| Mode (`mode`) | What it does |+|---|---|+| `both` (default) | Chat, plus a key to talk out loud |+| `chat` | Type to Mercury as usual. No talk key, no microphone. |+| `voice` | Press a key, talk, and hear Mercury answer |++In a listening session, links, lists and other details aren't read out. They go to your Mercury chat. A file Mercury makes during a session is shown in Finder or Explorer.++### The talk key++Default **`ctrl+alt+m`** (Control+Option+M on a Mac). What a press does depends on the moment:++| When | Pressing the talk key |+|---|---|+| Not listening | Starts listening (rising chime) |+| Optimus is working | **Stops everything.** Every action halts and the session stays open, so you can keep talking. |+| Mercury is speaking | Interrupts it |+| All quiet | Ends the session (falling chime) |+| Muted | Unmutes |++A key is modifiers plus one key: a letter, a digit, `space`, `enter`, `tab`, `esc` or `f1` to `f12`. Modifiers are `ctrl`, `alt` (Option on a Mac), `shift` and `cmd` (Command on a Mac, Win on Windows). A plain letter isn't allowed, because it would fire while you type: add `ctrl`, `alt` or `cmd`, or use an F key. Examples: `ctrl+alt+m`, `ctrl+shift+space`, `f9`.++### The mute key++Default **`ctrl+alt+shift+m`** (Control+Option+Shift+M on a Mac). Muting stops listening but not working: Mercury keeps doing the task and still talks, and **nothing you say is sent anywhere**. Saying "mute" also mutes. Press the mute key again, or the talk key, to unmute. A session doesn't time out while muted.++### Saying "stop"++Say **"stop"** (also "cancel", "halt", "abort", "enough", "never mind", "ruko", "bas") and every screen action halts at once, along with the Mercury task the session started. Mercury says "Stopped." and waits. New screen actions are refused for a few seconds while the task is cancelled; your next request lifts the stop.++Say **"bye"** ("goodbye", "that's all", "stop listening") to stop everything and end the session.++### When a session ends by itself++- **Silence.** When you haven't spoken for **60 seconds** and Mercury isn't working on anything, the mic closes by itself, so it never streams (and costs) for nothing. Change it with **Stop listening after silence**; `0` keeps listening until you press the key or say bye.+- **Length.** A session ends after **30 minutes** at most (**Longest listening session**).++### Speakers or headphones++With speakers, Optimus mutes the mic while Mercury talks so it doesn't hear itself; press the talk key to interrupt. With headphones, turn on **Headphones** in `/plugins optimus` → **🎙 Voice** to interrupt just by talking.++### Tick-tock++While Mercury searches or works and nobody is talking, a quiet wooden tick-tock plays, so you know it's still going. It's well below speech level and never mutes the mic, so you can say "stop" over it. Turn it off with **Tick-tock while working**.++## What you see++- **"Mercury is driving."** While Optimus moves the mouse, a ring follows the pointer with the label *☿ Mercury · Optimus is driving*, and fades a moment after the last action. On macOS and Windows it's excluded from screen capture; on Linux X11 it's hidden while a screenshot is taken, so it never appears in Optimus's own screenshots. Wayland doesn't allow it. Turn it off with **"Mercury is driving" ring by the pointer**.+- **Status bar.** The terminal UI's status bar shows when Optimus is listening (🎙), working (🖱) or muted (🔇).+- **Pace.** In **Natural** pace the pointer glides along a gentle curve, scrolling arrives in small steps, and text is typed key by key at an uneven human rhythm. Typing (not pasting) means it works in every editor. **Fast** does the same moves with less waiting.++## Staying honest about "done"++An action reaching the screen doesn't mean it worked. Optimus reports each step as *Sent*, not *done*, and returns a fresh screenshot. Mercury is told to look again and check the exact result (the post is published, the file is saved) before it says a task is done.++Every step that failed or was stopped is recorded. In a listening session, Mercury's answer is checked against that record before you hear it: if steps failed, the voice is told which ones and not to call the task done unless Mercury confirmed it on the screen. With your own Mercury model as the voice, an answer that doesn't admit the failure starts with "Heads up, some steps didn't work."++## You stay in control++- **Off until you allow it.** Nothing works until you turn on **Control this computer**.+- **Approvals.** Ordinary, reversible steps (clicking, typing, scrolling) run straight away. The step that commits something (submit a form, send a message or email, post, pay or buy, delete, install, change a setting) goes through `act_consequential`, which needs your approval like any other Mercury action. In a listening session the approval is asked out loud and you answer by voice.+- **Move the mouse to take over.** If you move the mouse while Optimus is working, it stops at the next step and hands control back.+- **No secrets.** Optimus is told never to type passwords, card numbers or 2FA codes. It asks you to do that part.+- **Stop.** The talk key while it's working, or saying "stop", halts everything at once.+- **No anti-cheat games.** Mercury declines to play or automate games that use anti-cheat (Valorant, Fortnite, Call of Duty, Counter-Strike 2, or anything running Vanguard, Easy Anti-Cheat or BattlEye). Automated input breaks those games' rules and can get your account banned. Single-player and offline games without anti-cheat are fine. This is an instruction Mercury follows, not a technical block.++## Privacy++- **Screenshots** are taken only when Mercury looks at the screen or acts on it, never in the background. Each is the display the mouse is on, scaled to fit 1280×800. They go to your model for that step only, and are kept out of chat history, logs and memory. If your model can't take images, the screenshot is left out and Mercury is told so.+- **The microphone** is open only during a listening session. It closes on silence, when you press the key or say bye, and at the session limit. While muted, nothing is sent. In **Chat only** mode the microphone is never used.+- **Voice audio** goes only to the voice engine you chose.++## Voice engines++Pick who listens and speaks in `/plugins optimus` → **🎙 Voice**. The options, settings and defaults are the same as for [WhatsApp calls](./whatsapp#voice-engines): OpenAI Realtime (default, uses your Mercury OpenAI provider), Gemini Live, Grok Voice (your Mercury Grok provider), ElevenLabs Realtime (experimental), Azure OpenAI Realtime, Qwen-Omni Realtime, or your own Mercury model with a speech-to-text and a text-to-speech provider. Voice keys are shared with the WhatsApp plugin: a key added for one works for the other.++## Settings++Open `/plugins optimus`. Settings are listed on the menu with their current values. Voice settings appear only in Listening or Both mode.++| Setting | Key | Default | What it does |+|---|---|---|---|+| Control this computer | `allowControl` | off | On: Optimus can see your screen and use the mouse and keyboard. Off: it does nothing. |+| How you talk to Optimus | `mode` | `both` | `both`, `chat` or `voice` (see above). |+| How Optimus moves and types | `pace` | `natural` | `natural` (like a person) or `fast` (same moves, less waiting). |+| "Mercury is driving" ring by the pointer | `showOverlay` | on | The ring and label while Optimus moves the mouse. |+| Talk key | `hotkey` | `ctrl+alt+m` | Start and stop listening, interrupt, or stop work. |+| Mute key | `muteHotkey` | `ctrl+alt+shift+m` | Stop listening while Mercury keeps working. |++Under **🎙 Voice**:++| Setting | Key | Default | What it does |+|---|---|---|---|+| Who listens and speaks? | `voiceEngine` | `openai` | The voice engine. Engine-specific keys, models and voices follow, as for [WhatsApp](./whatsapp#voice-calls-1). |+| Headphones | `bargeIn` | off | On: interrupt just by talking. Off: the mic waits while Mercury talks. |+| Tick-tock while working | `thinkingSound` | on | The soft tick-tock while Mercury searches or works. |+| Stop listening after silence (seconds) | `idleStopSeconds` | `60` | `0` keeps listening until you press the key or say bye. |+| Longest listening session (minutes) | `maxSessionMinutes` | `30` | A session ends by itself after this long. |++The engine settings (`voiceModel`, `voice`, `geminiKey`, `geminiModel`, `geminiVoice`, `grokModel`, `grokVoice`, `elevenlabsKey`, `elevenlabsModel`, `elevenlabsVoice`, `azureKey`, `azureEndpoint`, `azureDeployment`, `qwenKey`, `qwenEndpoint`, `qwenModel`, `qwenVoice`, `sttProvider`, `sttLanguage`, `ttsProvider`, `ttsVoice` and the provider keys) have the same names and defaults as in the WhatsApp plugin.++## Tools++These are what Mercury uses. You don't call them yourself.++| Tool | What it does | Approval |+|---|---|---|+| `optimus__look` | Screenshot of the display the mouse is on (or display N), with an optional zoom | No |+| `optimus__act` | Click, double-click, right-click, drag, draw, type, paste, key combos, scroll, wait; returns a fresh screenshot | No |+| `optimus__act_consequential` | The same, for the step that submits, sends, pays, deletes, installs or changes a setting | **Yes** |+| `optimus__open` | Open an app by name, a URL, or a file or folder | No |+| `optimus__windows` | List open windows, front first | No |+| `optimus__permissions` | Check (and request) the OS permissions | No |+| `optimus__listen` | Start a listening session from chat | No |++## Troubleshooting++**"Optimus is off".**+Turn on **Control this computer** in `/plugins optimus`.++**"Can't take a screenshot" or "can't control the mouse and keyboard" on macOS.**+Open System Settings → Privacy & Security and turn on **Optimus** under Screen Recording and Accessibility. Or ask Mercury to check Optimus's permissions; it opens the right page.++**The talk key does nothing.**+Open `/plugins optimus`: the menu shows whether the talk key is working, or why not (for example a key it couldn't parse). Make sure the mode is Listening or Both. On macOS the key needs Accessibility. On Wayland, the key only works while an XWayland app has focus; use chat, or ask Mercury to start listening.++**"Optimus can't listen yet: voice calls need an OpenAI provider".**+The default engine uses Mercury's OpenAI provider. Add your OpenAI key once in the dashboard (Providers) or with `mercury doctor`, or pick another engine in `/plugins optimus` → **🎙 Voice**.++**It stops halfway with "you moved the mouse".**+That's the takeover check. Keep your hands off the mouse while Optimus is working, or take over on purpose and ask it to carry on.++**It can't click in Task Manager or an installer (Windows).**+Windows blocks input to apps running as administrator.++**Mercury keeps hearing itself.**+Use headphones and turn on **Headphones**, or leave it off so the mic waits while Mercury talks.++## Remove it++`/plugins disable optimus` turns it off and keeps its settings. `/plugins uninstall optimus` removes it; add `--purge` to delete its data too (on macOS, including `Optimus.app` and its local certificate). You can then remove Optimus from the macOS privacy lists.++See also: [Plugins](../cli-commands/plugins), [WhatsApp](./whatsapp), [Writing plugins](../reference/plugins).diff --git a/website/docs/integrations/whatsapp.mdx b/website/docs/integrations/whatsapp.mdxnew file mode 100644index 00000000..0576da12--- /dev/null+++ b/website/docs/integrations/whatsapp.mdx@@ -0,0 +1,236 @@+---+id: whatsapp+title: WhatsApp+description: "Chat with Mercury on WhatsApp and talk to it by voice call, in both directions. Install, link a spare number, voice engines, scheduled calls, approvals and access levels."+keywords: [mercury, whatsapp, voice calls, plugin, ai agent on whatsapp, linked device]+---++The WhatsApp plugin lets you chat with Mercury on WhatsApp and talk to it by voice call. You call Mercury, or Mercury calls you ("call me at 9pm", "call me when it's done"). Mercury runs on a **spare number** as a linked device, the same way WhatsApp Web connects, so you don't need a WhatsApp Business account.++It's an optional [plugin](../cli-commands/plugins), version **0.1.1**, from the official plugin catalog. It needs Mercury **1.4.0** or newer.++:::warning[Unofficial protocol: use a spare number]++The plugin uses an **unofficial, reverse-engineered WhatsApp protocol** ([whatsapp-rust](https://github.com/oxidezap/whatsapp-rust)). A WhatsApp update can break it, and automated use can get the number restricted or banned. Link a spare number you can afford to lose, **not your main one**. You chat with Mercury *from* your own number; Mercury runs *on* the spare one.++:::++## Requirements++- Mercury 1.4.0 or newer, on macOS (Apple silicon or Intel), Windows x64, or Linux (x64 or arm64).+- A spare phone number with WhatsApp installed on a phone, to link as Mercury's account.+- Your own WhatsApp number, to chat and call from.+- For voice calls, one voice engine (see [Voice engines](#voice-engines)). The default uses the OpenAI provider you already set up in Mercury, so there may be nothing extra to configure. Text chat works without any of this.++## Install++In any Mercury chat:++```text+/plugins install whatsapp+```++Or from a shell:++```bash+mercury plugins install whatsapp+```++Install shows what the plugin needs (network hosts, the secrets it may read, the Mercury providers it uses) and asks you to confirm. The plugin runs in its own process, so if it crashes, Mercury keeps running and restarts it.++Mercury then walks you through setup, one question at a time, in the same chat (or in the dashboard under **Configure → Plugins**):++1. **Which number will you chat from?** Your own number, with the country code. Only this number can talk to Mercury.+2. **What can Mercury do in your chat?** General or Extended (see [Access levels](#access-levels)).+3. **Who handles your calls?** Asked only when Mercury has no OpenAI provider. With one, OpenAI Realtime is used and this step is skipped. Picking an engine then asks for that engine's key and options.+4. **Link the spare number** with a pairing code or a QR code (see below).++Run the setup again anytime with `/plugins setup whatsapp`.++## Link the spare number++You can link with a pairing code or a QR code.++**Pairing code** (works from any chat, including Telegram):++1. Choose **Pairing code** in setup, or run `/plugins pair whatsapp +15551234567` with the **spare** number.+2. On the spare phone: **WhatsApp → Settings → Linked devices → Link a device → Link with phone number instead**, then type the 8-character code.+3. The code is valid for about 3 minutes. Mercury confirms in the chat when the link is up.++**QR code:**++- **Dashboard:** Configure → Plugins → WhatsApp → **Link with QR code**. The QR refreshes about every 20 seconds.+- **Terminal:** `mercury plugins pair whatsapp` prints a QR code. `mercury plugins pair whatsapp --code +15551234567` gets a pairing code instead.++On the spare phone: **Linked devices → Link a device**, then scan.++Once it's linked, message the spare number from your own number to talk to Mercury. To check the link, open `/plugins whatsapp` and pick **Send me a test message**, or run `mercury plugins test whatsapp`.++If WhatsApp logs the device out, Mercury tells you on another channel and how to link it again.++### Unlink++Use **Unlink the account** in `/plugins whatsapp`, the **Unlink** button in the dashboard, or:++```bash+mercury plugins unlink whatsapp+```++Then remove "Mercury" from **Linked devices** on the spare phone if it's still listed.++## What works in chat++- Text both ways. Long replies are split, and Markdown is converted to WhatsApp formatting.+- Files from Mercury arrive as attachments: images as photos, everything else as documents.+- **Photos and PDFs you send** are passed to the model along with your message, when the model in use accepts them. Text-only models are told the file is there but can't see it.+- **Voice notes you send** are transcribed with your Mercury OpenAI provider (`gpt-4o-mini-transcribe`, falling back to `whisper-1`) and reach Mercury as text. Without an OpenAI provider, Mercury tells you how to turn this on and asks you to type instead.+- Mercury knows it's on WhatsApp and writes like a text message: short, no tables or code blocks. Long output goes into a file it sends you.+- Built-in `web_search` (Extended access) means questions about news and current events get looked up, not guessed.+- Groups are ignored unless you turn on **Answer in WhatsApp groups**.++## Access levels++Access decides what Mercury may do in your WhatsApp chat. Change it anytime in `/plugins whatsapp`.++| Level | What Mercury can do |+|---|---|+| **General** (default) | Chat and general knowledge only. No tools, files or personal memory. If something needs them, Mercury says so in one line. |+| **Extended** | Memory, files, tools and actions, as anywhere else. Anything risky still asks you first. |++Other numbers you add under **Other numbers allowed to chat** are *members*. They get their own level (**What can those numbers do?**), which is never more than yours, and they can't run admin commands such as `/plugins`. Members never get your private details (memory, files, contacts, accounts) unless you told Mercury to share them. Unknown numbers are ignored.++Mercury only learns from calls (adds what you said to its memory) at Extended access.++## Approvals++When something needs your go-ahead in the chat, Mercury asks with a prompt you answer by reply:++- **1** yes+- **2** no+- **3** always for this chat++No reply within 2 minutes counts as no.++## Voice calls++Call the spare number from your own number and talk to Mercury. Mercury can also ring you when something matters (the `call_owner` tool), or at a time you set ([Scheduled calls](#scheduled-calls)).++- **Who can call:** only the owner. Calls from anyone else, and group calls, are declined.+- **During a call** Mercury can look things up and act, using its tools, memory and files (at Extended access). While it works it keeps you posted instead of going silent.+- **Approvals on a call:** Mercury asks out loud and also posts the request in the chat. Say yes on the call, or reply **1** (yes) or **2** (no) in the chat. The first answer wins. A spoken yes only counts when your own transcribed words say yes, and it never becomes "always". No answer within 2 minutes is no.+- **Links, photos and details:** Mercury doesn't read links or long lists aloud. It sends them to the chat (the `send_to_chat` tool) and says so, or offers to. Photos and documents you send in the chat during a call are visible to Mercury, so you can ask about them on the call.+- **After the call** you get a message with the duration and the transcript. A missed or declined call from Mercury is followed by a written version of what it wanted.+- **Limits:** Mercury calls you at most **4 times an hour** and a call lasts at most **15 minutes** by default (see the settings below).+- Say goodbye to hang up, or just hang up.++To turn off incoming calls without uninstalling, set **Answer your voice calls** to off. Your calls to the spare number then ring out.++### Voice engines++The engine is who listens to you and speaks back on a call. Pick it in `/plugins whatsapp` → **🎙 Voice calls**. Voice keys are shared: a key you add for the [Optimus](./optimus) plugin works here too, and the other way round.++| Engine (`voiceEngine`) | What it needs |+|---|---|+| `openai`, **OpenAI Realtime** (default, recommended) | The OpenAI provider you already set up in Mercury (dashboard → Providers, or `mercury doctor`). Nothing extra. |+| `gemini`, Google Gemini Live | A Gemini API key (from aistudio.google.com/apikey). Cheapest, has a free tier, speaks Hindi and Urdu. |+| `grok`, xAI Grok Voice | The Grok provider you set up in Mercury. |+| `elevenlabs`, ElevenLabs Realtime (experimental) | An ElevenLabs API key. |+| `azure`, Azure OpenAI Realtime | An Azure OpenAI key, endpoint and realtime deployment name. |+| `qwen`, Alibaba Qwen-Omni Realtime | A DashScope (Alibaba Model Studio) key. |+| `mercury`, **My own model** | Your Mercury model does the thinking. You pick who listens (speech to text) and who speaks (text to speech), each with its own key. |++When you change the engine in the menu, Mercury asks right away for what the new choice needs (its key, model, voice).++Call audio goes only to the voice engine you chose. With **My own model**, audio goes to the speech-to-text and text-to-speech providers you picked, and the words go to your Mercury model.++## Scheduled calls++Ask in any chat, or on a call: "call me at 9pm about the deploy", "call me back in 20 minutes", "call me tomorrow 8:30am". The time is worked out in code, in the computer's time zone, and Mercury confirms the exact time so a misunderstanding shows up straight away. For "call me when it's done", Mercury does the work first and then calls.++You can also use commands:++| Command | What it does |+|---|---|+| `/call 9pm about the deploy` | Schedule a call (also: `in 20m`, `tomorrow 8:30am`, `tonight 8`, `now`) |+| `/calls` | List scheduled calls |+| `/calls cancel 2` or `/calls cancel all` | Cancel one by number, or all |++- Calls can be scheduled up to 30 days ahead.+- If you don't pick up, Mercury tries once more 5 minutes later, then sends you a message.+- Scheduled calls survive restarts. A call that came due while Mercury wasn't running is placed when it's back (up to 2 hours late); after that you get a "missed" note instead.+- Only the owner can schedule calls.++## Settings++Open `/plugins whatsapp` (or `mercury plugins open whatsapp`, or the dashboard). Settings are listed on the menu with their current values; pick one to change it. You can also set one directly with `/plugins set whatsapp <key> <value>`.++### Chat++| Setting | Key | Default | What it does |+|---|---|---|---|+| Which number will you chat from? | `owner` | (none, asked in setup) | Your own number. Only it can talk to Mercury and call it. |+| What can Mercury do in your chat? | `access` | `general` | General (chat only) or Extended (memory, files, tools). |+| Other numbers allowed to chat | `members` | (empty) | Comma-separated numbers that may also chat. They can't run admin commands. |+| What can those numbers do? | `memberAccess` | `general` | General or Extended for members, never more than you. |+| Answer in WhatsApp groups | `allowGroups` | off | On: Mercury answers in groups when someone mentions it (owner and members only). Off: one-to-one chats only. |++### Voice calls++These live under **🎙 Voice calls** in the menu. Engine-specific settings only appear when that engine is selected.++| Setting | Key | Default | What it does |+|---|---|---|---|+| Answer your voice calls | `answerCalls` | on | Off: your calls to Mercury ring out. |+| Who handles your calls? | `voiceEngine` | `openai` | The voice engine (table above). |+| Most calls from Mercury per hour | `maxCallsPerHour` | `4` | Mercury won't ring you more often than this, so a looping task can't spam you. |+| Longest call, in minutes | `maxCallMinutes` | `15` | A call ends after this long. |+| OpenAI voice model | `voiceModel` | `gpt-realtime-2.1` | Or `gpt-realtime-2.1-mini`, about 3x cheaper. OpenAI engine. |+| OpenAI voice | `voice` | `marin` | `marin`, `cedar`, `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`. OpenAI and Azure engines. |+| Gemini API key | `geminiKey` | | Gemini engine. |+| Gemini Live model | `geminiModel` | `gemini-3.8-live` | Gemini engine. |+| Gemini voice | `geminiVoice` | `Kore` | For example Kore, Puck, Charon, Aoede. |+| Grok voice model | `grokModel` | `grok-voice-latest` | Grok engine. |+| Grok voice | `grokVoice` | `eve` | `eve`, `ara`, `leo`, `rex`, `sal`, `atlas`, `naksh`, `celeste`, `ursa`, `sirius`, `lumen`. |+| ElevenLabs API key | `elevenlabsKey` | | ElevenLabs engine, or ElevenLabs as the listener or speaker for My own model. |+| ElevenLabs Realtime model | `elevenlabsModel` | `eleven_realtime_v1_mini` | Or `eleven_realtime_v1_max`. |+| ElevenLabs voice | `elevenlabsVoice` | `brian` | ElevenLabs engine. |+| Azure OpenAI API key | `azureKey` | | Azure engine. |+| Azure endpoint | `azureEndpoint` | | For example `myresource.openai.azure.com`. |+| Azure realtime deployment name | `azureDeployment` | `gpt-realtime-2.1` | Azure engine. |+| DashScope API key | `qwenKey` | | Qwen engine. |+| Qwen endpoint host | `qwenEndpoint` | `dashscope-intl.aliyuncs.com` | Your workspace host, for example `{workspace}.ap-southeast-1.maas.aliyuncs.com`. |+| Qwen model | `qwenModel` | `qwen3.8-omni-flash-realtime` | Qwen engine. |+| Qwen voice | `qwenVoice` | `Tina` | Qwen engine. |+| Who listens (speech to text) | `sttProvider` | `deepgram` | My own model: `deepgram` (Nova-3), `assemblyai` (Universal-3.6 Pro), `elevenlabs` (Scribe v2), `sarvam` (Saaras, Indian languages incl. Urdu). |+| Language you'll speak | `sttLanguage` | `auto` | My own model: detect automatically, English, Hindi or Urdu. |+| Who speaks (voice) | `ttsProvider` | `cartesia` | My own model: `cartesia` (Sonic-3.6), `elevenlabs` (Flash), `minimax` (speech-2.8), `sarvam` (Bulbul), `deepgram` (Aura-2). |+| Voice ID | `ttsVoice` | (empty) | My own model. Empty uses the provider's default voice. |+| Deepgram, AssemblyAI, Sarvam, Cartesia, MiniMax API keys | `deepgramKey`, `assemblyaiKey`, `sarvamKey`, `cartesiaKey`, `minimaxKey` | | Asked only when you pick that provider for My own model. |++API keys you paste are stored with Mercury's own keys, never shown again, and readable only by plugins that declare them.++## Troubleshooting++**Mercury doesn't answer my messages.**+Check that you're messaging the spare number *from* the number in **Which number will you chat from?** (with the country code). Open `/plugins whatsapp` and look at **Account**: it should say *linked*. If not, pick **Link the account**. Run `mercury doctor --plugins` to see whether the plugin is running, and why it was turned off if it was.++**"I couldn't answer your call: voice calls need an OpenAI provider".**+The default engine uses Mercury's OpenAI provider. Add your OpenAI key once in the dashboard (Providers) or with `mercury doctor`, or pick another engine in `/plugins whatsapp` → **🎙 Voice calls**. The menu marks the section *needs setup* until it's ready.++**Mercury says it can't listen to voice notes.**+Voice notes are transcribed with Mercury's OpenAI provider. Add one, or type the message.++**"Not calling: already called the owner 4 times in the last hour".**+That's the `maxCallsPerHour` limit. Raise it in the voice settings if you want more calls.++**The device was logged out.**+WhatsApp can log linked devices out. Link again with `/plugins pair whatsapp` or the dashboard. If it keeps happening, WhatsApp may be restricting the number.++**Something broke after a WhatsApp update.**+Update the plugin with `/plugins update whatsapp`. If the new version is worse, `/plugins rollback whatsapp` restores the previous one with its settings.++## Remove it++`/plugins disable whatsapp` turns it off and keeps its data and settings. `/plugins uninstall whatsapp` removes it; add `--purge` to delete its data (including the WhatsApp session) too.++See also: [Plugins](../cli-commands/plugins), [Optimus](./optimus), [Writing plugins](../reference/plugins).diff --git a/website/docs/reference/plugins.mdx b/website/docs/reference/plugins.mdxindex 8a83737c..b736ab1a 100644--- a/website/docs/reference/plugins.mdx+++ b/website/docs/reference/plugins.mdx@@ -19,6 +19,14 @@ mercury plugins pack . # .tgz + checksum + catalog enNo npm package is needed: `init` writes the API types next to your code as`mercury-plugin.d.ts`.+Mercury 1.4 implements **plugin API 1.2**. Minor versions only add, so a+plugin written for 1.0 or 1.1 keeps working. The two official plugins are+full examples of an out-of-process plugin written in Rust:+[WhatsApp](../integrations/whatsapp) (a chat channel with voice calls, API 1.1)+and [Optimus](../integrations/optimus) (a desktop channel with tool images,+API 1.2). Their source is in+[`plugins/`](https://github.com/cosmicstack-labs/mercury-agent/tree/main/plugins).+## Which kind?| | In-process | Out-of-process |@@ -26,7 +34,7 @@ No npm package is needed: `init` writes the API types next to your code as| Runs | Inside Mercury, loaded with `import()` | As a child process speaking MCP over stdio || Good for | Small, fast tools; slash commands | Native code, heavy work, existing MCP servers, other languages || If it crashes | Errors are contained and counted; repeated failures turn it off | Mercury restarts it; repeated crashes turn it off |-| Slash commands | Yes | Not in plugin API 1.0 |+| Slash commands | Yes | Not yet (plugin API 1.2) |## The manifest@@ -54,14 +62,37 @@ No npm package is needed: `init` writes the API types next to your code as```- **Settings** can carry setup metadata. Settings with `"setup": true` are- asked in order right after install, in chat or in the terminal, and appear- in the plugin's `/plugins ID` menu. The metadata fields are:+ asked in order right after install, in chat or in the terminal. Every+ setting with a `label` is listed on the plugin's `/plugins ID` menu with its+ current value. The metadata fields are:- `label`: a plain question, such as "Which number will you chat from?";- - `required`;- - `optionLabels` for enum choices;- - `"format": "phone"`, which is validated and normalised to `+digits`.-- Channel plugins also get a linking step at the end of setup.+ - `required`: setup can't finish without a value;+ - `optionLabels`: what each choice does, for enum options and for booleans+ under `"true"` and `"false"` ("On: Mercury picks up when you call it").+ The menu repeats the chosen label after saving, so the owner reads what+ the choice does, not just "yes";+ - `examples`: one-tap suggestions for a string or number setting (typing+ your own still works);+ - `"format": "phone"`, which is validated and normalised to `+digits`;+ - `when`: show the setting only when other settings have these values,+ such as `{ "voiceEngine": ["gemini"] }`. A list of conditions means any of+ them. After the owner changes a setting in the menu, Mercury asks straight+ away for the settings that now apply (pick Gemini, then the Gemini key);+ - `group`: put the setting in a menu section declared under+ `settings.groups`, each with a `label`, an optional `description`, and+ `readyUnless` (requirements such as `"provider:openai"` that mark the+ section "needs setup");+ - `setupWhenMissing`: ask this in setup only while a requirement is+ missing. With an OpenAI provider set up, the default voice just works, so+ setup doesn't ask which voice to use.++ A setting of `"type": "secret"` is an API key the owner pastes once. It is+ stored with Mercury's own keys (never in the plugin's settings file), shown+ only as "set", and passed to the plugin as the environment variable named+ by its `secret` field, which must also be listed in `permissions.secrets`.++ Chat channel plugins (WhatsApp) also get a linking step at the end of+ setup. A `desktop` channel has no account to link.- **Tools** are shown to the model as `ID__name` (for example`weather__forecast`). `readOnly` tools skip approval and are available inplan mode; every other tool asks the owner first.@@ -69,7 +100,14 @@ No npm package is needed: `init` writes the API types next to your code as- **permissions.network** lists the hosts `ctx.fetch` may reach (`*.example.com`works). Private and loopback addresses are always blocked.- **permissions.secrets** lists the names from `~/.mercury/.env` the plugin- may read. Nothing else is visible to it.+ may read. Nothing else is visible to it. `permissions.optionalSecrets` maps+ the ones it works without to what they turn on; a missing one is explained+ to the owner once.+- **permissions.desktop** (plugin API 1.2) says the plugin controls the+ computer: it sees the screen, moves the mouse and types. `/plugins info`+ and install show it as a warning. The plugin must also ask for consent in+ its own setup, as [Optimus](../integrations/optimus) does with+ "Control this computer".- Out-of-process plugins use `"server": { "command": "node", "args": ["server.mjs"] }`.`node` means Mercury's own runtime, so users don't need Node installed.It can also be a binary inside the package, with per-platform variants@@ -130,7 +168,7 @@ These are checked by `mercury plugins validate`:Saved values then carry over on update. Rolling back restores the olderversion's settings.-6. **No plugin-to-plugin dependencies** in plugin API 1.0. Each plugin stands+6. **No plugin-to-plugin dependencies** (as of plugin API 1.2). Each plugin standsalone.## Out-of-process (MCP)@@ -152,16 +190,38 @@ What your server receives:Write logs to stderr. Stdout is the protocol channel.+## Tool images (plugin API 1.2)++An out-of-process tool can return images to the model next to its text, as+standard MCP `image` content:++```json+{ "content": [+ { "type": "text", "text": "Sent: click (640, 380)." },+ { "type": "image", "data": "<base64>", "mimeType": "image/jpeg" }+] }+```++- **Types:** `image/png`, `image/jpeg`, `image/webp`, `image/gif`.+- **Limits:** 4 images per result, about 6 MB each.+- **Kept out of history.** The images go to the model with that one tool+ result. Chat history, logs and memory only ever see the text.+- **Text-only models** get the text plus a note that an image was left out.++Require `"pluginApi": "^1.2.0"` to use it.+## Chat channels (plugin API 1.1)-An out-of-process plugin can provide a chat channel (today: `whatsapp`).-Declare it and require API 1.1:+An out-of-process plugin can provide a chat channel. The channel types are+`whatsapp` (plugin API 1.1, see [WhatsApp](../integrations/whatsapp)) and+`desktop` (plugin API 1.2, see [Optimus](../integrations/optimus)). Declare+it and require the matching API:```json"engines": { "mercury": ">=1.4.0 <2.0.0", "pluginApi": "^1.1.0" },"contributes": { "channel": { "type": "whatsapp" } },"settings": { "version": 1, "fields": {- "owner": { "type": "string", "description": "The owner's phone number" },+ "owner": { "type": "string", "description": "The owner's phone number", "format": "phone" },"members": { "type": "string", "description": "Other numbers allowed to chat, comma separated" },"allowGroups": { "type": "boolean", "default": false }} }@@ -175,41 +235,80 @@ messages.|---|---|---|| plugin → Mercury (notification) | `mercury/channel/status` | `state` (`starting`, `needs-pairing`, `pairing`, `connected`, `disconnected`, `logged-out`, `error`), `detail?`, `account?`, `qr?`, `pairCode?` || plugin → Mercury (notification) | `mercury/channel/message` | `id`, `chatId`, `senderId`, `senderPhone?`, `senderName?`, `isGroup?`, `fromMe?`, `text?`, `attachments?` (each with `kind`, `path`, `mime?`, `name?`), `timestamp?` |+| plugin → Mercury (notification) | `mercury/channel/activity` | `listening`, `working`, `muted` (API 1.2, desktop: shown in the terminal status bar) || Mercury → plugin (request) | `mercury/channel/send` | `chatId`, `text` || Mercury → plugin (request) | `mercury/channel/sendFile` | `chatId`, `path`, `caption?` || Mercury → plugin (request) | `mercury/channel/typing` | `chatId`, `on` || Mercury → plugin (request) | `mercury/channel/pair` | `method` (`qr` or `code`), `phone?` || Mercury → plugin (request) | `mercury/channel/unlink` | none |-A channel plugin can also carry **voice calls**. Here the plugin sends-requests to Mercury, and Mercury replies:+Photos and PDFs in `attachments` are passed to the model when it accepts+them. Voice notes are transcribed with the owner's OpenAI provider before the+message reaches the agent.++### Voice sessions++A channel plugin can also carry **voice**: calls on WhatsApp, or listening+mode at the computer for a `desktop` channel. Both use the same messages.| Direction | Message | Params → result ||---|---|---|| plugin → Mercury (request) | `mercury/call/incoming` | `callId`, `from`, `fromPhone?`, `voiceReady` → `accept`, `instructions?` || plugin → Mercury (request) | `mercury/call/briefing` | `callId` → `instructions` |-| plugin → Mercury (request) | `mercury/call/ask` | `callId`, `question` → `answer` |+| plugin → Mercury (request) | `mercury/call/ask` | `callId`, `question` → `answer` (runs a normal Mercury turn) |+| plugin → Mercury (request) | `mercury/call/approve` | `callId`, `approvalId`, `approved` → `ok` |+| plugin → Mercury (request) | `mercury/call/schedule` | `when`, `topic` → `ok`, `text` |+| plugin → Mercury (request) | `mercury/call/stop` | `callId` → `stopped` || plugin → Mercury (notification) | `mercury/call/ended` | `callId`, `direction`, `outcome`, `durationSec`, `transcript`, `reason?` |+| Mercury → plugin (notification) | `mercury/call/progress` | `callId`, `activity` (what the running turn is doing now) |+| Mercury → plugin (notification) | `mercury/call/context` | `callId`, `text` (something happened in the chat, such as a photo arriving) |+| Mercury → plugin (notification) | `mercury/call/approval` | `callId`, `approvalId`, `prompt` (ask the owner out loud) |+| Mercury → plugin (notification) | `mercury/call/approval-resolved` | `callId`, `approvalId`, `decision`, `via` |How these work:-- **`incoming`:** Mercury answers only the owner, and only if a voice- provider is set up.-- **`ask`:** runs a normal Mercury turn. Anything that would need approval is- refused during a call.-- **`ended`:** sends the owner a summary of the call.+- **`incoming`:** Mercury answers only the owner, and only when the plugin+ says its voice engine is ready.+- **`ask`:** runs a normal Mercury turn whose answer is spoken back.+- **Approvals:** a turn that needs approval during a call sends+ `approval`. On WhatsApp it is also posted in the chat; the first answer+ wins. The plugin sends `approve` only after checking that the owner's own+ transcribed words said yes, and a spoken yes never becomes "always". No+ answer within 2 minutes is no.+- **`schedule`:** "call me back at 9" on a call. The time is worked out by+ Mercury, not by a model.+- **`stop`:** the owner said stop or goodbye: Mercury ends the work the+ session started.+- **`ended`:** on WhatsApp, sends the owner a summary with the transcript.+ A desktop session reports only failures.++### Mercury's providers++A plugin that needs one of Mercury's AI providers (`openai` or `grok`)+declares it, so the owner sets a key in one place:++```json+"permissions": { "providers": {+ "openai": { "unlocks": "Voice calls", "when": { "voiceEngine": "openai" },+ "alternative": "Or pick another voice in /plugins whatsapp → Voice calls." }+} }+```++The short form `{ "openai": "Voice calls" }` also works. Mercury passes the+key the owner already set up as `MERCURY_PROVIDER_OPENAI_API_KEY` and+`MERCURY_PROVIDER_OPENAI_BASE_URL` (`MERCURY_PROVIDER_GROK_…` for Grok). With+`when`, the provider is only required while the settings match. If it isn't+set up, the owner is told once what it turns off, and `/plugins info` shows+it.-A plugin that needs one of Mercury's AI providers declares it with-`"permissions": { "providers": { "openai": "Voice calls" } }`. Mercury then-passes the key the owner already set up as-`MERCURY_PROVIDER_OPENAI_API_KEY` and `MERCURY_PROVIDER_OPENAI_BASE_URL`.-If the provider isn't set up, the owner is told once.+### Who can talk to the agent-Mercury, not the plugin, decides who can talk to the agent:+Mercury, not the plugin, decides:- **Access:** only the `owner` number and listed `members` get through.Unknown senders are dropped, groups are ignored unless `allowGroups` is- on, and your own messages are never answered.+ on, and your own messages are never answered. A `desktop` channel only+ ever talks to the owner at the computer.- **Formatting:** Mercury converts Markdown to the channel's formatting andsplits long replies.- **Approvals:** prompts are answered by a text reply: 1 for yes, 2 for no,diff --git a/website/docs/releases/1.4.0.mdx b/website/docs/releases/1.4.0.mdxnew file mode 100644index 00000000..23743070--- /dev/null+++ b/website/docs/releases/1.4.0.mdx@@ -0,0 +1,136 @@+---+title: "v1.4.0 — Hands-on Mercury"+sidebar_label: "v1.4.0"+description: "Mercury gets a plugin system and two official plugins: WhatsApp chat and voice calls in both directions, and Optimus, which lets Mercury use your computer by chat or out loud. Plus built-in web search and photos, PDFs and voice notes from chat."+keywords: [mercury, mercury-agent, release, 1.4.0, plugins, whatsapp, voice calls, optimus, computer use, web search]+---++import Head from '@docusaurus/Head';++<Head>+ <meta property="og:title" content="Mercury Agent v1.4.0 — Hands-on Mercury" />+ <meta property="og:description" content="Plugins · WhatsApp chat and voice calls · Optimus: Mercury uses your computer · Built-in web search · Photos, PDFs and voice notes from chat" />+ <meta property="og:type" content="article" />+ <meta property="og:url" content="https://mercuryagent.sh/docs/releases/1.4.0" />+ <meta property="og:site_name" content="Mercury Agent — Soul-driven" />+ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:site" content="@mercuryagent" />+ <meta name="twitter:title" content="Mercury Agent v1.4.0 — Hands-on Mercury" />+ <meta name="twitter:description" content="Plugins · WhatsApp chat and voice calls · Optimus: Mercury uses your computer · Built-in web search · Photos, PDFs and voice notes from chat" />+ <link rel="canonical" href="https://mercuryagent.sh/docs/releases/1.4.0" />+</Head>++# v1.4.0 — Hands-on Mercury++> **Mercury picks up the phone, and picks up the mouse.**++`1.4.0` is the first stable release since `1.3.8`. Its headline is the **plugin system**: optional features you install only if you want them, each running in its own process so a bad plugin can't take Mercury down. Two official plugins ship with it. **WhatsApp** lets you chat with Mercury and talk to it by voice call, and Mercury can call you. **Optimus** lets Mercury use your computer: it sees the screen, moves the pointer and types like a person, by chat or out loud with a talk key. Both are in the stable plugin catalog for macOS (Apple silicon and Intel), Windows x64 and Linux (x64 and arm64).++`1.3.9` only shipped on the dev channel; its fix is folded in here.++## At a glance++| | |+|---|---|+| **Plugins** (#203, ADR-025) | `/plugins install`, `enable`, `disable`, `update`, `rollback`, `uninstall`, from a checksum-verified catalog. Out-of-process plugins can't crash Mercury. |+| **Plugin API 1.2** | Tools can return images to the model (kept out of chat history), `permissions.desktop`, and `whatsapp` and `desktop` channel types. |+| **One place for keys** | Plugins use Mercury's own providers. Set an OpenAI key once and voice works everywhere. |+| **Guided setup, flatter menus** | Setup on install. `/plugins <id>` lists every setting, explains what each choice does, and asks for follow-up settings right after you save. |+| **WhatsApp 0.1.1** (#202) | Chat from a spare number, voice calls in both directions, scheduled calls, approvals by voice or chat, access levels. |+| **Optimus 0.4.7** (new) | Mercury uses your computer: sees, points, scrolls and types like a person, with a talk key, a mute key, "stop", and an honest "done". |+| **Built-in `web_search`** | Free and keyless. News and current events get looked up, not guessed. |+| **Photos, PDFs, voice notes** | Mercury sees photos and PDFs you send in chat, and listens to voice notes. |++## Plugins++Features only some people want were heading into the single binary, making it bigger and riskier for everyone. Now they're plugins ([ADR-025](https://github.com/cosmicstack-labs/mercury-agent/blob/main/DECISIONS.md)):++- **Install from the catalog.** `/plugins install whatsapp` in any chat, `mercury plugins install whatsapp` in a shell, or **Configure → Plugins** in the dashboard. The catalog at `https://mercuryagent.sh/plugins/catalog.json` pins each version to a SHA-256 checksum.+- **Isolated.** An out-of-process plugin is a separate program speaking MCP over stdio. If it crashes, Mercury restarts it; after repeated crashes or 5 failures in a row it's turned off and you're told why. A plugin reaches only the network hosts and reads only the secrets it declared, and install shows them before you confirm.+- **Hot-plugged and reversible.** Install, enable, disable and uninstall take effect without a restart. Installing into a running Mercury now starts the plugin immediately. `/plugins rollback <id>` brings back the previous version with its settings. `mercury start --safe-mode` starts with every plugin off.+- **Guided setup and a flatter menu.** Setup runs right after install, one question at a time, and skips questions that don't apply. `/plugins <id>` lists every setting with its current value. Yes/no options say what each answer does ("On: Mercury picks up when you call it"), follow-up settings appear right after you save (pick Gemini, then the Gemini key), and every question has a way back.+- **Mercury's own providers.** A plugin that needs OpenAI or Grok uses the provider you already set up in Mercury. Keys a plugin asks for itself are stored with Mercury's keys and shared with other plugins that declare them. A missing key is explained once, with what it turns off.+- **Plugin API 1.2.** Tools can return images to the model, sent with that tool result only and never stored in history, logs or memory. `permissions.desktop` flags a plugin that controls the computer. Channel types are `whatsapp` and `desktop`. See [Writing plugins](/docs/reference/plugins).++Docs: [Plugins](/docs/cli-commands/plugins).++## WhatsApp 0.1.1++Chat with Mercury on WhatsApp, with Mercury running on a **spare number** as a linked device. It uses an unofficial protocol, so don't link your main number.++- **Voice calls both ways.** Call the spare number and talk to Mercury, or let Mercury call you when something matters. Only your number can call.+- **Scheduled calls.** "Call me at 9pm about the deploy", "call me back in 20 minutes", from chat, the terminal or a call. Also `/call` and `/calls`. Times are worked out in code and confirmed exactly; one retry if you miss it; calls survive restarts. "Call me when it's done" does the work, then calls.+- **Mercury works during the call.** It looks things up with `web_search`, uses its tools and memory, and keeps you posted while it works. Approvals are asked by voice and posted in the chat at once; the first answer wins, and a spoken yes only counts in your own words.+- **Links and files during a call.** Mercury sends links and details to the chat instead of reading them out, and can see photos and documents you send while you talk.+- **Voice engine choice.** OpenAI Realtime by default (your Mercury OpenAI provider), or Gemini Live, Grok Voice, ElevenLabs, Azure, Qwen-Omni, or your own Mercury model with a speech-to-text and a text-to-speech provider.+- **Access levels.** General (chat only) or Extended (memory, files, tools). Members never get more than you.+- **Link, check and unlink from the dashboard**, with a QR code or a pairing code.+- **Voice notes, photos and PDFs** you send are understood.++Docs: [WhatsApp](/docs/integrations/whatsapp).++## Optimus 0.4.7++Mercury uses your computer. Ask in any chat, or press the talk key and say it.++- **Sees and acts like a person.** Screenshots of the display the mouse is on; the pointer glides, scrolling is smooth, and text is typed key by key, so it works in every editor. A "Mercury is driving" ring and label follow the pointer, and never appear in its own screenshots.+- **Listening mode.** The talk key (default `ctrl+alt+m`, Control+Option+M on a Mac) starts a voice session with spoken replies and live narration of each step. Press it while Optimus works and everything stops.+- **Mute key** (default `ctrl+alt+shift+m`): stop listening, keep working. Nothing you say is sent while muted.+- **"Stop" stops.** Saying "stop" halts every screen action and the task at once. Silence (60 seconds by default) ends a session, so the mic never streams for nothing.+- **A soft tick-tock while it works**, and the TUI status bar shows when Optimus is listening, working or muted.+- **Honest about "done".** Steps report *Sent*, not *done*; Mercury checks the screen before saying a task is finished, and failed steps are reported as failed.+- **You stay in control.** Off until you allow it. Anything that submits, sends, pays, deletes or installs needs your approval. Move the mouse and it hands control back. It never types passwords or card numbers.+- **Voice settings shared with WhatsApp**: the same engines, and a key added for one works for the other.+- **No signing hassle.** Installs locally with no Apple Developer ID. On macOS, Optimus builds `Optimus.app` signed with a certificate made on your Mac, and you grant Accessibility, Screen Recording and Microphone once.++Docs: [Optimus](/docs/integrations/optimus).++## Also new++- **Built-in `web_search`**, free and keyless (web and news), through the SSRF guard. The built-in web-search skill uses it.+- **Photos and PDFs** from chat are attached to the turn for models that accept them, and **voice notes** are transcribed with your OpenAI provider.+- **Mercury always knows it comes from Cosmic Stack.**+- **Model picker** in the web dashboard: plain-language model names, renaming, a reasoning picker, every local Ollama model, and ChatGPT Plus/Pro plan models.+- **Blog "Listen to article"** player, using the reader's built-in voices.++## Fixed++- **`mercury doctor` applies what you changed** (from 1.3.9). Doctor restarts the running daemon when the configuration actually changed, and dashboard saves say "restart to apply" with a **Restart** button.+- **The web dashboard works on the Windows standalone binary.** Mercury didn't recognise the Windows marker for its embedded files and reported "web UI not found". Found and fixed by @farena-ai in #189.+- ChatGPT OAuth turns no longer fail after a tool call.+- Long messages no longer fail memory search ("Expression tree is too large").+- New dashboard chats no longer land in the previous conversation; dashboard permission prompts render and resolve.+- One failing alert no longer fans out into hundreds of repeated messages on a plugin channel.+- Plugin installs work with GNU tar on Windows.++## Known limitations++- **WhatsApp uses an unofficial protocol.** A WhatsApp update can break it, and automated use can get the number restricted. Use a spare number.+- **Optimus on Linux Wayland** is limited: screenshots go through the desktop's screen-sharing prompt, and mouse, keyboard and the talk key only reach X11 (XWayland) apps. X11 sessions get full control.+- **Optimus on Windows** can't control windows running as administrator (Task Manager, installers).+- **Out-of-process plugins can't add slash commands** yet.++## Upgrade++**npm:**++```bash+npm install -g @cosmicstack/[email protected]+mercury restart+```++**Standalone binaries:** rerun the installer from [mercuryagent.sh](https://mercuryagent.sh), or run `mercury upgrade`.++```bash+curl -fsSL https://mercuryagent.sh/install.sh | sh # macOS / Linux+irm https://mercuryagent.sh/install.ps1 | iex # Windows+```++Then add the plugins you want:++```text+/plugins install whatsapp+/plugins install optimus+```++`~/.mercury` carries over untouched. Plugins live in `~/.mercury/plugins/`.diff --git a/website/docs/releases/releases.mdx b/website/docs/releases/releases.mdxindex 6fde8fff..86e5c822 100644--- a/website/docs/releases/releases.mdx+++ b/website/docs/releases/releases.mdx@@ -9,6 +9,7 @@ This section tracks Mercury release notes by version.## Available release notes+- [**v1.4.0 — Hands-on Mercury**](/docs/releases/1.4.0) — The plugin system, WhatsApp chat and voice calls in both directions, and Optimus: Mercury uses your computer, by chat or out loud. Plus built-in web search, photos, PDFs and voice notes from chat.- [**v1.3.1 — Steady Mercury**](/docs/releases/1.3.1) — One runtime, instant attach, bots that do work and stay online, fleets with typed tasks and pipelines, Telegram control with buttons and files, Node 22 and a patched Ink 8 — plus the whole "Honest Mercury" line.- [**v1.3.0 — Mercury Bots**](/docs/releases/1.3.0) — Mercury becomes a fleet: persistent persona-scoped bots with private sandboxes and durable queues, lead bots that recruit their own crews, portable bundles, a web cockpit, and honest failure observability.- [**v1.2.3 — Unstoppable Mercury**](/docs/releases/1.2.3) — Mercury Code stops dying and starts telling the truth: completion contract, AUTO mode, the mechanical escalation harness, compact-on-pressure, live plan checklist, wheel scrolling, and security hardening.diff --git a/website/sidebars.ts b/website/sidebars.tsindex 902411de..2a04ac86 100644--- a/website/sidebars.ts+++ b/website/sidebars.ts@@ -53,6 +53,8 @@ const sidebars: SidebarsConfig = {'integrations/discord','integrations/slack','integrations/signal',+ 'integrations/whatsapp',+ 'integrations/optimus','integrations/spotify','integrations/coding-workspace','integrations/sub-agents',@@ -81,6 +83,7 @@ const sidebars: SidebarsConfig = {collapsed: false,items: ['releases/releases',+ 'releases/1.4.0','releases/1.3.1','releases/1.3.0','releases/1.2.3',