Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(speech): Settings → Speech — engine, models, language (desktop-dictation Task 11)
enesae6b595cfcbc
diff --git a/src/renderer/components/settings/SettingsIcons.tsx b/src/renderer/components/settings/SettingsIcons.tsxindex b01cafd2a..f0669ff40 100644--- a/src/renderer/components/settings/SettingsIcons.tsx+++ b/src/renderer/components/settings/SettingsIcons.tsx@@ -29,6 +29,12 @@ const PATHS: Record<SettingsSectionId, React.JSX.Element> = {<path d="M7 12h2" /></>),+ speech: (+ <>+ <rect x="6" y="2.2" width="4" height="7" rx="2" />+ <path d="M4 8.2a4 4 0 0 0 8 0M8 12.2v1.6M6.2 13.8h3.6" />+ </>+ ),agents: (<path d="M8 2.3 9.4 5.9 13 7.3 9.4 8.7 8 12.3 6.6 8.7 3 7.3 6.6 5.9z" />),diff --git a/src/renderer/components/settings/SettingsPage.tsx b/src/renderer/components/settings/SettingsPage.tsxindex 2831f1b17..be5beda46 100644--- a/src/renderer/components/settings/SettingsPage.tsx+++ b/src/renderer/components/settings/SettingsPage.tsx@@ -9,6 +9,7 @@ import { ShellSection } from './sections/ShellSection'import { BehaviorSection } from './sections/BehaviorSection'import { AppearanceSection } from './sections/AppearanceSection'import { PhoneSection } from './sections/PhoneSection'+import { SpeechSection } from './sections/SpeechSection'import { AgentsSection } from './sections/AgentsSection'import { AccountsSection } from './sections/AccountsSection'import { CustomAgentsSection } from './sections/CustomAgentsSection'@@ -68,6 +69,7 @@ export function SettingsPage({<BehaviorSection isActive={active === 'behavior'} /><AppearanceSection isActive={active === 'appearance'} /><PhoneSection isActive={active === 'phone'} />+ <SpeechSection isActive={active === 'speech'} onNavigate={setActive} /><AgentsSection isActive={active === 'agents'} /><AccountsSection isActive={active === 'accounts'} /><CustomAgentsSection isActive={active === 'custom-agents'} />diff --git a/src/renderer/components/settings/nav.test.ts b/src/renderer/components/settings/nav.test.tsindex 49d6204df..d2ea92969 100644--- a/src/renderer/components/settings/nav.test.ts+++ b/src/renderer/components/settings/nav.test.ts@@ -2,10 +2,10 @@ import { describe, it, expect } from 'vitest'import { SETTINGS_GROUPS, allSectionIds, FIRST_SECTION_ID } from './nav'describe('SETTINGS_GROUPS', () => {- it('lists exactly 17 sections with no duplicates', () => {+ it('lists exactly 18 sections with no duplicates', () => {const ids = allSectionIds()- expect(ids).toHaveLength(17)- expect(new Set(ids).size).toBe(17)+ expect(ids).toHaveLength(18)+ expect(new Set(ids).size).toBe(18)})it('starts at a section that exists in the groups', () => {expect(allSectionIds()).toContain(FIRST_SECTION_ID)diff --git a/src/renderer/components/settings/nav.ts b/src/renderer/components/settings/nav.tsindex 8863794dc..8c4e4ece6 100644--- a/src/renderer/components/settings/nav.ts+++ b/src/renderer/components/settings/nav.ts@@ -4,6 +4,7 @@ export type SettingsSectionId =| 'behavior'| 'appearance'| 'phone'+ | 'speech'| 'agents'| 'accounts'| 'custom-agents'@@ -32,7 +33,8 @@ export const SETTINGS_GROUPS: SettingsGroup[] = [{ id: 'shell', title: 'Shell' },{ id: 'behavior', title: 'Behavior' },{ id: 'appearance', title: 'Appearance' },- { id: 'phone', title: 'Phone' }+ { id: 'phone', title: 'Phone' },+ { id: 'speech', title: 'Speech' }]},{diff --git a/src/renderer/components/settings/sections/SpeechSection.tsx b/src/renderer/components/settings/sections/SpeechSection.tsxnew file mode 100644index 000000000..928d177d4--- /dev/null+++ b/src/renderer/components/settings/sections/SpeechSection.tsx@@ -0,0 +1,289 @@+import { useCallback, useEffect, useState } from 'react'+import type { SpeechModelInfo } from '@shared/types'+import { useSettings } from '../../../state/settings'+import { useEntitlement } from '../../../state/entitlement'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Select } from '@renderer/ui/Select'+import { SegmentedPill } from '@renderer/ui/SegmentedPill'+import { Button } from '@renderer/ui/Button'+import type { SettingsSectionId } from '../nav'++const ROWS = {+ engine: {+ title: 'Speech engine',+ keywords: ['speech', 'dictation', 'whisper', 'cloud', 'engine', 'voice', 'microphone']+ },+ models: {+ title: 'Whisper models',+ keywords: ['whisper', 'model', 'download', 'delete', 'tiny', 'base', 'small', 'large', 'pro']+ },+ language: {+ title: 'Language',+ keywords: [+ 'language',+ 'locale',+ 'auto',+ 'english',+ 'turkish',+ 'german',+ 'french',+ 'spanish',+ 'japanese'+ ]+ }+}+const ENTRIES = Object.values(ROWS)++const LANGUAGES: { value: string; label: string }[] = [+ { value: 'auto', label: 'Auto-detect' },+ { value: 'en', label: 'English' },+ { value: 'tr', label: 'Turkish' },+ { value: 'de', label: 'German' },+ { value: 'fr', label: 'French' },+ { value: 'es', label: 'Spanish' },+ { value: 'ja', label: 'Japanese' }+]++/** `1600` -> `"1.6 GB"`, `142` -> `"142 MB"`. Used for both the approximate (undownloaded) and+ * real (downloaded) size, so the two read consistently in the same row. */+function formatSize(mb: number): string {+ return mb >= 1000 ? `${(mb / 1000).toFixed(1)} GB` : `${Math.round(mb)} MB`+}++/** `large-v3-turbo` -> `"Large V3 Turbo"`. */+function modelLabel(id: string): string {+ return id+ .split('-')+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))+ .join(' ')+}++export function SpeechSection({+ isActive,+ onNavigate+}: {+ isActive: boolean+ /** Switches the active settings tab — used to route a free user who clicks a PRO model's+ * select/download to the License section (the sales surface; there is no paywall dialog). */+ onNavigate: (id: SettingsSectionId) => void+}): React.JSX.Element {+ const settings = useSettings((s) => s.settings)+ const update = useSettings((s) => s.update)+ const isPremium = useEntitlement((s) => s.isPremium)++ const [models, setModels] = useState<SpeechModelInfo[]>([])+ const [progress, setProgress] = useState<Record<string, number>>({})+ const [busy, setBusy] = useState<Record<string, boolean>>({})+ const [rowError, setRowError] = useState<Record<string, string>>({})++ const refreshModels = useCallback(async (): Promise<void> => {+ try {+ setModels(await window.nodeTerminal.speech.models())+ } catch {+ // leave the last-known list on a transient read error+ }+ }, [])++ // Fetch once on mount (this component always renders — SettingsSection just hides its own+ // subtree when inactive — so this isn't re-run on every tab switch).+ useEffect(() => {+ void refreshModels()+ }, [refreshModels])++ // Subscribe on mount, unsubscribe on unmount; a completed download (pct 100) refreshes the+ // model list so the row flips to "downloaded" with its real on-disk size.+ useEffect(() => {+ const unsub = window.nodeTerminal.speech.onProgress(({ id, pct }) => {+ setProgress((p) => ({ ...p, [id]: pct }))+ if (pct >= 100) {+ setProgress((p) => {+ const next = { ...p }+ delete next[id]+ return next+ })+ setBusy((b) => ({ ...b, [id]: false }))+ void refreshModels()+ }+ })+ return unsub+ }, [refreshModels])++ const setEngine = (engine: 'whisper' | 'cloud'): void => {+ update({ speech: { ...settings.speech, engine } })+ }+ const setLanguage = (language: string): void => {+ update({ speech: { ...settings.speech, language } })+ }++ const selectModel = (m: SpeechModelInfo): void => {+ if (m.pro && !isPremium) {+ onNavigate('license')+ return+ }+ update({ speech: { ...settings.speech, model: m.id } })+ }++ const downloadModel = async (m: SpeechModelInfo): Promise<void> => {+ if (m.pro && !isPremium) {+ onNavigate('license')+ return+ }+ setRowError((e) => ({ ...e, [m.id]: '' }))+ setBusy((b) => ({ ...b, [m.id]: true }))+ setProgress((p) => ({ ...p, [m.id]: 0 }))+ try {+ await window.nodeTerminal.speech.downloadModel(m.id)+ await refreshModels()+ } catch (err) {+ setRowError((e) => ({+ ...e,+ [m.id]: err instanceof Error ? err.message : 'Download failed.'+ }))+ } finally {+ setBusy((b) => ({ ...b, [m.id]: false }))+ setProgress((p) => {+ const next = { ...p }+ delete next[m.id]+ return next+ })+ }+ }++ const deleteModel = async (m: SpeechModelInfo): Promise<void> => {+ setRowError((e) => ({ ...e, [m.id]: '' }))+ setBusy((b) => ({ ...b, [m.id]: true }))+ try {+ await window.nodeTerminal.speech.deleteModel(m.id)+ await refreshModels()+ } catch (err) {+ setRowError((e) => ({ ...e, [m.id]: err instanceof Error ? err.message : 'Delete failed.' }))+ } finally {+ setBusy((b) => ({ ...b, [m.id]: false }))+ }+ }++ return (+ <SettingsSection+ id="speech"+ title="Speech"+ description="Dictate into any terminal or chat node. Local Whisper runs fully on-device — nothing leaves this machine."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.engine}>+ <FieldRow+ label="Engine"+ description="Local Whisper transcribes on-device. Cloud requires the nodeterm backend · not available yet."+ control={+ <SegmentedPill<'whisper' | 'cloud'>+ value={settings.speech.engine}+ ariaLabel="Speech engine"+ options={[+ { value: 'whisper', label: 'Local Whisper' },+ { value: 'cloud', label: 'Cloud' }+ ]}+ onChange={setEngine}+ />+ }+ />+ </SearchableRow>++ <SearchableRow {...ROWS.models}>+ <div className="space-y-3">+ <h4 className="text-[13px] font-medium text-text">Whisper models</h4>+ {models.length === 0 ? (+ <p className="text-[12px] text-muted">Loading models…</p>+ ) : (+ <div className="space-y-2">+ {models.map((m) => {+ const pct = progress[m.id]+ const downloading = busy[m.id] && pct !== undefined+ const locked = m.pro && !isPremium+ return (+ <div+ key={m.id}+ className="flex items-center justify-between gap-3 rounded-md border border-border p-3"+ >+ <label className="flex min-w-0 flex-1 cursor-pointer items-center gap-3">+ <input+ type="radio"+ name="speech-model"+ className="shrink-0"+ checked={settings.speech.model === m.id}+ onChange={() => selectModel(m)}+ />+ <div className="min-w-0">+ <div className="flex items-center gap-2">+ <span className="text-[13px] font-medium text-text">+ {modelLabel(m.id)}+ </span>+ <span+ className={+ m.pro+ ? 'rounded-full bg-[#0a84ff]/15 px-2 py-0.5 text-[11px] font-medium text-[#0a84ff]'+ : 'rounded-full bg-white/10 px-2 py-0.5 text-[11px] font-medium text-muted'+ }+ >+ {m.pro ? 'PRO' : 'FREE'}+ </span>+ </div>+ <p className="text-[12px] text-muted">+ {m.downloaded ? formatSize(m.sizeMB ?? m.approxMB) : `~${formatSize(m.approxMB)}`}+ {downloading ? ` · downloading ${pct}%` : ''}+ </p>+ {rowError[m.id] ? (+ <p className="text-[12px]" style={{ color: '#ff9f0a' }}>+ {rowError[m.id]}+ </p>+ ) : null}+ </div>+ </label>+ <div className="flex shrink-0 items-center gap-2">+ {m.downloaded ? (+ <Button+ variant="ghost"+ disabled={busy[m.id]}+ onClick={() => void deleteModel(m)}+ >+ Delete+ </Button>+ ) : locked ? (+ <Button onClick={() => onNavigate('license')}>Unlock with Pro</Button>+ ) : (+ <Button disabled={busy[m.id]} onClick={() => void downloadModel(m)}>+ {downloading ? `${pct}%` : 'Download'}+ </Button>+ )}+ </div>+ </div>+ )+ })}+ </div>+ )}+ </div>+ </SearchableRow>++ <SearchableRow {...ROWS.language}>+ <FieldRow+ label="Language"+ description="A hint for transcription; auto-detect works well for mixed speech."+ control={+ <Select+ aria-label="Speech language"+ value={settings.speech.language}+ onChange={(e) => setLanguage(e.target.value)}+ >+ {LANGUAGES.map((l) => (+ <option key={l.value} value={l.value}>+ {l.label}+ </option>+ ))}+ </Select>+ }+ />+ </SearchableRow>+ </SettingsSection>+ )+}