Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(brain): add voice capture for thought input via Web Speech API
Adam Eivy4b2392f4af72
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex a83c479cc6..aac9157450 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -22,6 +22,7 @@- `/api/browser/downloads` endpoint for listing downloaded files- Genome markers: summary dashboard with tappable status filter pills, "Attention Needed" section surfacing concerns first, category quick-jump dropdown, categories collapsed by default for mobile- Genome markers: friendlier card UX with "What this means for you" framing, status-colored backgrounds, and renamed labels (Details, Your Notes, Learn More)+- Voice capture for Brain — microphone button on inbox uses Web Speech API to transcribe speech into thoughts## Changeddiff --git a/PLAN.md b/PLAN.mdindex 3d87d92223..92acae5dbf 100644--- a/PLAN.md+++ b/PLAN.md@@ -35,7 +35,7 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [DONE.md]- **Workspace Contexts** — Project context syncing across shell, git, tasks- **Inline Code Review Annotations** — One-click fix from self-improvement findings- **Major Dependency Upgrades** — React 19, Zod 4, PM2 6, Vite 8-- **Voice Capture for Brain** — Microphone + Web Speech API transcription+- [x] **Voice Capture for Brain** — Microphone + Web Speech API transcription- **RSS/Feed Ingestion** — Passive feed ingestion classified by interests- [x] **Ambient Dashboard Mode** — Live status board for wall-mounted displays- **Dynamic Skill Marketplace** — Self-generating skill templates from task patternsdiff --git a/client/src/components/brain/VoiceCapture.jsx b/client/src/components/brain/VoiceCapture.jsxnew file mode 100644index 0000000000..276eadf273--- /dev/null+++ b/client/src/components/brain/VoiceCapture.jsx@@ -0,0 +1,112 @@+import { useState, useRef, useCallback, useEffect } from 'react';+import { Mic, MicOff, Square } from 'lucide-react';+import toast from 'react-hot-toast';++const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;++export default function VoiceCapture({ onTranscript, disabled }) {+ const [listening, setListening] = useState(false);+ const [interimText, setInterimText] = useState('');+ const recognitionRef = useRef(null);+ const supported = !!SpeechRecognition;++ const stop = useCallback(() => {+ recognitionRef.current?.stop();+ setListening(false);+ setInterimText('');+ }, []);++ // Cleanup on unmount+ useEffect(() => {+ return () => {+ recognitionRef.current?.stop();+ };+ }, []);++ const toggle = useCallback(() => {+ if (!supported) {+ toast.error('Speech recognition not supported in this browser');+ return;+ }++ if (listening) {+ stop();+ return;+ }++ const recognition = new SpeechRecognition();+ recognition.continuous = true;+ recognition.interimResults = true;+ recognition.lang = 'en-US';++ let finalTranscript = '';++ recognition.onresult = (event) => {+ let interim = '';+ for (let i = event.resultIndex; i < event.results.length; i++) {+ const text = event.results[i][0].transcript;+ if (event.results[i].isFinal) {+ finalTranscript += text;+ } else {+ interim += text;+ }+ }+ setInterimText(interim);+ if (finalTranscript) {+ onTranscript(finalTranscript);+ finalTranscript = '';+ }+ };++ recognition.onerror = (event) => {+ if (event.error === 'not-allowed') {+ toast.error('Microphone access denied');+ } else if (event.error !== 'aborted') {+ toast.error(`Speech error: ${event.error}`);+ }+ setListening(false);+ setInterimText('');+ };++ recognition.onend = () => {+ setListening(false);+ setInterimText('');+ };++ recognitionRef.current = recognition;+ recognition.start();+ setListening(true);+ }, [listening, supported, stop, onTranscript]);++ if (!supported) return null;++ return (+ <div className="flex items-center gap-1">+ <button+ type="button"+ onClick={toggle}+ disabled={disabled}+ className={`px-3 py-3 rounded-lg transition-colors flex items-center gap-1 ${+ listening+ ? 'bg-port-error hover:bg-port-error/80 text-white'+ : 'bg-port-card border border-port-border hover:border-port-accent text-gray-400 hover:text-white'+ } disabled:opacity-50 disabled:cursor-not-allowed`}+ title={listening ? 'Stop recording' : 'Voice capture'}+ >+ {listening ? (+ <>+ <Square className="w-5 h-5" />+ <span className="text-xs animate-pulse">REC</span>+ </>+ ) : (+ <Mic className="w-5 h-5" />+ )}+ </button>+ {interimText && (+ <span className="text-xs text-gray-500 italic max-w-[200px] truncate">+ {interimText}+ </span>+ )}+ </div>+ );+}diff --git a/client/src/components/brain/tabs/InboxTab.jsx b/client/src/components/brain/tabs/InboxTab.jsxindex f247d31c78..0aea9f72c8 100644--- a/client/src/components/brain/tabs/InboxTab.jsx+++ b/client/src/components/brain/tabs/InboxTab.jsx@@ -23,6 +23,7 @@ import {getConfidenceColor} from '../constants';import { timeAgo } from '../../../utils/formatters';+import VoiceCapture from '../VoiceCapture';export default function InboxTab({ onRefresh, settings }) {const [inputText, setInputText] = useState('');@@ -192,6 +193,10 @@ export default function InboxTab({ onRefresh, settings }) {}};+ const handleVoiceTranscript = useCallback((text) => {+ setInputText(prev => prev ? `${prev} ${text}` : text);+ }, []);+const classifyingEntries = entries.filter(e => e.status === 'classifying');const needsReviewEntries = entries.filter(e => e.status === 'needs_review');const filedEntries = entries.filter(e => e.status === 'filed' || e.status === 'corrected');@@ -220,6 +225,7 @@ export default function InboxTab({ onRefresh, settings }) {className="flex-1 px-4 py-3 bg-port-card border border-port-border rounded-lg text-white placeholder-gray-500 focus:outline-hidden focus:border-port-accent"disabled={sending}/>+ <VoiceCapture onTranscript={handleVoiceTranscript} disabled={sending} /><buttontype="submit"disabled={sending || !inputText.trim()}@@ -234,7 +240,7 @@ export default function InboxTab({ onRefresh, settings }) {</button></div><p className="mt-2 text-xs text-gray-500">- Capture a thought. AI will classify and route it automatically.+ Capture a thought — type or use the mic. AI will classify and route it automatically.{settings?.confidenceThreshold && (<span> Confidence threshold: {Math.round(settings.confidenceThreshold * 100)}%</span>)}