Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.
TypeScript agent-teamagentic-aiai-agentsai-assistantclaude-codecodexcursorelectrongrokgrok-bot-alternativelinuxlocal-firstmacosmcpmulti-agentopenclaw-alternativeopencodewindows
Add a setting to turn the notification sounds off (#67)
Eduardo Machadoffbfea83c135
diff --git a/src/core/index.ts b/src/core/index.tsindex 9c0e6ba..8299a62 100644--- a/src/core/index.ts+++ b/src/core/index.ts@@ -188,7 +188,7 @@ function toPhone(e: CoreEvent): void {// Desktop notification, and the same on the phone.const notifyAll = (title: string, body: string, conversationId?: string): void => {- toMain({ type: 'notify', title, body, conversationId })+ toMain({ type: 'notify', title, body, conversationId, sound: settings().sounds !== false })void telegram?.notice(title, body)}@@ -196,7 +196,7 @@ const notifyAll = (title: string, body: string, conversationId?: string): void =type ToMain =| { type: 'open'; url: string }| { type: 'open_path'; path: string }- | { type: 'notify'; title: string; body: string; conversationId?: string; kind?: 'approval' | 'question' | 'done' }+ | { type: 'notify'; title: string; body: string; conversationId?: string; kind?: 'approval' | 'question' | 'done'; sound?: boolean }| { type: 'login_item'; open: boolean }| { type: 'busy'; busy: boolean }| { type: 'lang'; lang: Lang }@@ -401,7 +401,7 @@ const runner = new Runner({skills,models: () => availableModels(settings(), listed),// Approvals and questions reach the phone with their buttons, through toPhone; a finished reply stays on the Mac.- notify: (title, body, conversationId, kind) => (kind ? toMain({ type: 'notify', title, body, conversationId, kind }) : notifyAll(title, body, conversationId)),+ notify: (title, body, conversationId, kind) => (kind ? toMain({ type: 'notify', title, body, conversationId, kind, sound: settings().sounds !== false }) : notifyAll(title, body, conversationId)),jev: { key: () => secrets.get(JEV_SECRET) },github,onBusy: (busy) => toMain({ type: 'busy', busy }),diff --git a/src/main/index.ts b/src/main/index.tsindex 84b2ac0..de6c879 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -4,7 +4,7 @@ import { mkdirSync, rmSync, writeFileSync } from 'node:fs'import { dirname, join, normalize, sep } from 'node:path'import { pathToFileURL } from 'node:url'import { L, langOf, setLang, type Lang } from '../shared/lang'-import type { BrowserOp } from '../shared/types'+import { chirpOf, type BrowserOp } from '../shared/types'import { Browsers } from './browser'import { bundleOf, moveFromAgentDesk, type Moved } from './migrate'import { Updates } from './updates'@@ -65,7 +65,7 @@ type CoreRequest =| { type: 'secret'; id: string; op: 'encrypt' | 'decrypt'; data: string }| { type: 'open'; url: string }| { type: 'open_path'; path: string }- | { type: 'notify'; title: string; body: string; conversationId?: string; kind?: 'approval' | 'question' | 'done' }+ | { type: 'notify'; title: string; body: string; conversationId?: string; kind?: 'approval' | 'question' | 'done'; sound?: boolean }| { type: 'login_item'; open: boolean }| { type: 'busy'; busy: boolean }| { type: 'lang'; lang: Lang }@@ -182,7 +182,8 @@ function handleCore(child: UtilityProcess, msg: CoreRequest): void {} else if (msg.type === 'notify') {// Already looking at that conversation: nothing to tell.if (msg.conversationId && msg.conversationId === viewing && mainWindow?.isFocused()) return- chirp(msg.kind === 'approval' || msg.kind === 'question' ? 'chama' : 'pronto')+ const sound = chirpOf(msg.kind, msg.sound)+ if (sound) chirp(sound)if (!Notification.isSupported()) returnconst n = new Notification({ title: msg.title, body: msg.body, silent: true, ...noteIcon() })n.on('click', () => showWindow(msg.conversationId))diff --git a/src/renderer/src/components/Pages.tsx b/src/renderer/src/components/Pages.tsxindex 57b04cb..5377840 100644--- a/src/renderer/src/components/Pages.tsx+++ b/src/renderer/src/components/Pages.tsx@@ -1510,6 +1510,19 @@ export function SettingsPage(): ReactNode {</Card>)}+ {pane('geral') && (+ <Card title={L('Notificações', 'Notifications')}>+ <div className="key-row">+ <Icon name="volume" />+ <div className="grow">+ <strong>{L('Sons', 'Sounds')}</strong>+ <p className="muted small">{L('O toque quando um agente precisa de você e quando termina. Desligado, as notificações continuam aparecendo, em silêncio.', 'The chirp when an agent needs you and when it’s done. Off, notifications still show up, silently.')}</p>+ </div>+ <Toggle on={settings.sounds !== false} onChange={(v) => updateSettings({ sounds: v })} />+ </div>+ </Card>+ )}+{pane('geral') && (<Card title={L('Atualizações', 'Updates')}><UpdateSettings />diff --git a/src/renderer/src/components/ui.tsx b/src/renderer/src/components/ui.tsxindex e48c2e6..006a646 100644--- a/src/renderer/src/components/ui.tsx+++ b/src/renderer/src/components/ui.tsx@@ -112,6 +112,7 @@ const PATHS: Record<string, ReactNode> = {<path d="M2.5 20a6.5 6.5 0 0 1 13 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.2a6.5 6.5 0 0 1 3.5 5.8" /></>),+ volume: <path d="M4 9v6h4l5 4V5L8 9H4ZM16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12" />,trash: <path d="M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v6M14 11v6" />}diff --git a/src/shared/types.ts b/src/shared/types.tsindex 8d26f6b..d704b6d 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -209,6 +209,15 @@ export interface Settings {// The first-run introduction: unset on an existing install (no intro), done:false to show it (a new install, or "Rever a introdução")onboarding?: { done: boolean; checklistHidden?: boolean }folded?: string[] // the ids of what I folded in the sidebar+ sounds?: boolean // the toucan's chirp on a notification; unset: on+}++// Which chirp a notification plays: a knock when an agent needs me, two notes when the work+// is done, none when I turned the sounds off. The system's own notification is always silent,+// so this is the only sound the app makes.+export function chirpOf(kind: 'approval' | 'question' | 'done' | undefined, sounds: boolean | undefined): 'chama' | 'pronto' | null {+ if (sounds === false) return null+ return kind === 'approval' || kind === 'question' ? 'chama' : 'pronto'}// What the main process does in an agent's browser for the core, and what it answers (spec §24).diff --git a/test/sounds.test.ts b/test/sounds.test.tsnew file mode 100644index 0000000..60613b3--- /dev/null+++ b/test/sounds.test.ts@@ -0,0 +1,15 @@+import { describe, expect, it } from 'vitest'+import { chirpOf } from '../src/shared/types'++describe('the toucan’s chirp', () => {+ it('knocks when an agent needs me and plays two notes when the work is done', () => {+ expect(chirpOf('approval', undefined)).toBe('chama')+ expect(chirpOf('question', true)).toBe('chama')+ expect(chirpOf('done', true)).toBe('pronto')+ expect(chirpOf(undefined, undefined)).toBe('pronto')+ })++ it('stays quiet when the sounds are off', () => {+ for (const kind of ['approval', 'question', 'done', undefined] as const) expect(chirpOf(kind, false)).toBeNull()+ })+})