Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
fix(plugins): Optimus never asks to link an account; voice settings start with the engine (0.4.6)
Salman Qureshia805366fc0f4
diff --git a/plugins/optimus/companion/Cargo.toml b/plugins/optimus/companion/Cargo.tomlindex 886e1548..6483f2ec 100644--- a/plugins/optimus/companion/Cargo.toml+++ b/plugins/optimus/companion/Cargo.toml@@ -1,6 +1,6 @@[package]name = "mercury-optimus"-version = "0.4.5"+version = "0.4.6"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 554aed1d..0f89c28e 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.5",+ "version": "0.4.6","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",@@ -215,59 +215,6 @@"f10"]},- "bargeIn": {- "type": "boolean",- "default": false,- "label": "Headphones",- "description": "With speakers, Optimus mutes the mic while Mercury talks so it doesn't hear itself; press the key to interrupt. With headphones, turn this on to interrupt just by talking.",- "group": "voice",- "when": {- "mode": [- "voice",- "both"- ]- },- "optionLabels": {- "true": "On: I use headphones, so I can interrupt just by talking",- "false": "Off: speakers, so the mic waits while Mercury talks (press the talk key to interrupt)"- }- },- "thinkingSound": {- "type": "boolean",- "default": true,- "label": "Tick-tock while working",- "description": "A quiet wooden tick-tock while Mercury searches or works on your screen and nobody is talking, so you know it's still going. It's well below speech level and never mutes your mic.",- "group": "voice",- "when": {- "mode": [- "voice",- "both"- ]- },- "optionLabels": {- "true": "On: a soft tick… tock while Mercury searches or works",- "false": "Off: silence while it works"- }- },- "idleStopSeconds": {- "type": "number",- "default": 60,- "label": "Stop listening after silence (seconds)",- "description": "The mic closes by itself when you haven't spoken for this long and Mercury isn't working on something, so it never streams (and costs) for nothing. 0 keeps listening until you press the key or say bye.",- "group": "voice",- "when": {- "mode": [- "voice",- "both"- ]- },- "examples": [- "30",- "60",- "120",- "0"- ]- },"voiceEngine": {"type": "enum","label": "Who listens and speaks?",@@ -821,6 +768,59 @@},"group": "voice"},+ "bargeIn": {+ "type": "boolean",+ "default": false,+ "label": "Headphones",+ "description": "With speakers, Optimus mutes the mic while Mercury talks so it doesn't hear itself; press the key to interrupt. With headphones, turn this on to interrupt just by talking.",+ "group": "voice",+ "when": {+ "mode": [+ "voice",+ "both"+ ]+ },+ "optionLabels": {+ "true": "On: I use headphones, so I can interrupt just by talking",+ "false": "Off: speakers, so the mic waits while Mercury talks (press the talk key to interrupt)"+ }+ },+ "thinkingSound": {+ "type": "boolean",+ "default": true,+ "label": "Tick-tock while working",+ "description": "A quiet wooden tick-tock while Mercury searches or works on your screen and nobody is talking, so you know it's still going. It's well below speech level and never mutes your mic.",+ "group": "voice",+ "when": {+ "mode": [+ "voice",+ "both"+ ]+ },+ "optionLabels": {+ "true": "On: a soft tick… tock while Mercury searches or works",+ "false": "Off: silence while it works"+ }+ },+ "idleStopSeconds": {+ "type": "number",+ "default": 60,+ "label": "Stop listening after silence (seconds)",+ "description": "The mic closes by itself when you haven't spoken for this long and Mercury isn't working on something, so it never streams (and costs) for nothing. 0 keeps listening until you press the key or say bye.",+ "group": "voice",+ "when": {+ "mode": [+ "voice",+ "both"+ ]+ },+ "examples": [+ "30",+ "60",+ "120",+ "0"+ ]+ },"maxSessionMinutes": {"type": "number","default": 30,diff --git a/src/plugins/dialog.test.ts b/src/plugins/dialog.test.tsindex 6526546e..eacbd1ae 100644--- a/src/plugins/dialog.test.ts+++ b/src/plugins/dialog.test.ts@@ -175,6 +175,17 @@ describe('/plugins <id> menu', () => {expect(after.at(-1)).toMatch(/🎙 Voice[\s\S]*Who listens and speaks\?: Google Gemini Live[\s\S]*Gemini API key: set ✓/);});+ it('a desktop plugin (Optimus) has nothing to link: no link step in setup or the menu', async () => {+ const { svc } = fakeService({ id: 'optimus', name: 'Optimus', channel: { type: 'desktop', state: 'connected', detail: 'Press Control+Option+M to talk.' } });+ const setup = (await PluginDialog.setup(svc, 'optimus'))!;+ const all = (await say(setup, '+15550001111', '1', '1')).join('\n');+ expect(all).not.toMatch(/Link the|Pairing code|spare number/);+ expect(all).toMatch(/is set up/);+ const menu = renderPrompt((await (await PluginDialog.menu(svc, 'optimus', true))!.current())!, false);+ expect(menu).toMatch(/Press Control\+Option\+M to talk\./);+ expect(menu).not.toMatch(/Account:|Link the account|test message|Unlink/);+ });+it('members see status only, with no actions', async () => {const { svc } = fakeService();const d = (await PluginDialog.menu(svc, 'whatsapp', false))!;diff --git a/src/plugins/dialog.ts b/src/plugins/dialog.tsindex ea563101..28a35bd5 100644--- a/src/plugins/dialog.ts+++ b/src/plugins/dialog.ts@@ -60,10 +60,12 @@ export class PluginDialog {// A setting with setupWhenMissing is only asked while that requirement is// missing (with an OpenAI key, the default voice just works).const fields = (info.settings ?? []).filter((s) => s.setup && (!s.setupWhenMissing || missing.has(s.setupWhenMissing)));- fields.forEach((f, i) => d.steps.push(d.settingStep(f, { index: i + 1, total: fields.length + (info.channel ? 1 : 0), setup: true })));- if (info.channel) d.steps.push(d.linkStep(info, true));+ // Only chat apps (WhatsApp) have an account to link; a desktop channel (Optimus) doesn't.+ const linkable = !!info.channel && info.channel.type !== 'desktop';+ fields.forEach((f, i) => d.steps.push(d.settingStep(f, { index: i + 1, total: fields.length + (linkable ? 1 : 0), setup: true })));+ if (linkable) d.steps.push(d.linkStep(info, true));d.steps.push(d.finishStep(info));- if (d.steps.length === 1 && !info.channel && !fields.length) return null;+ if (d.steps.length === 1 && !linkable && !fields.length) return null;return d;}@@ -273,7 +275,11 @@ export class PluginDialog {const lines = [`🧩 *${i.name}* ${i.installedVersion ?? i.latestVersion ?? ''}`, i.description];const status = i.installedVersion ? (i.enabled ? (i.status === 'enabled' ? 'on' : i.status) : 'off') : 'not installed';lines.push('', `Status: ${status}`);- if (i.channel) lines.push(`Account: ${i.channel.state === 'connected' ? `linked${i.channel.account ? ` as +${i.channel.account}` : ''}` : (i.channel.state ?? 'not linked')}`);+ if (i.channel?.type === 'desktop') {+ if (i.channel.detail) lines.push(i.channel.detail);+ } else if (i.channel) {+ lines.push(`Account: ${i.channel.state === 'connected' ? `linked${i.channel.account ? ` as +${i.channel.account}` : ''}` : (i.channel.state ?? 'not linked')}`);+ }for (const m of i.missing ?? []) lines.push(`⚠️ ${m.unlocks} is off: needs ${m.needs}.`);const options: DialogOption[] = [];if (!this.admin) return { text: lines.join('\n') };@@ -291,7 +297,7 @@ export class PluginDialog {if (loose.length > MENU_SETTINGS || (i.settings ?? []).some((x) => !x.group && !x.setup && !x.label && settingApplies(x, i.settings ?? []))) {options.push({ label: 'More settings', value: 'settings' });}- if (i.channel && i.enabled) {+ if (i.channel && i.channel.type !== 'desktop' && i.enabled) {if (i.channel.state === 'connected') {options.push({ label: 'Send me a test message', value: 'test' });options.push({ label: 'Unlink the account', value: 'unlink' });