Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(runtime): unblock model downloads, surface ONNX worker errors, dedupe hotkey re-register (#716)

Gabriel Stein1f5da2a79653
diff --git a/src/components/CliIntegrationCard.tsx b/src/components/CliIntegrationCard.tsx
new file mode 100644
index 000000000..ab0d4f08e
--- /dev/null
+++ b/src/components/CliIntegrationCard.tsx
@@ -0,0 +1,129 @@
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
+import { Check, Copy, ExternalLink, Terminal } from "lucide-react";
+import { Badge } from "./ui/badge";
+import { Button } from "./ui/button";
+import { CopyableCommand } from "./ui/CopyableCommand";
+import { LogoTile } from "./ui/LogoTile";
+import { useToast } from "./ui/useToast";
+import logo from "../assets/logo.svg";
+
+const CLI_DOCS_URL = "https://docs.openwhispr.com/cli/install";
+const INSTALL_CMD = "npm install -g @openwhispr/cli";
+const LOCAL_EXAMPLE = "openwhispr --local notes list";
+const CLOUD_LOGIN_CMD = "openwhispr auth login";
+
+interface CliIntegrationCardProps {
+ isPaid: boolean;
+ onUpgrade: () => void;
+}
+
+export default function CliIntegrationCard({ isPaid, onUpgrade }: CliIntegrationCardProps) {
+ const { t } = useTranslation();
+ const { toast } = useToast();
+ const [docsLinkCopied, setDocsLinkCopied] = useState(false);
+
+ const handleCopyDocsLink = async () => {
+ try {
+ await navigator.clipboard.writeText(CLI_DOCS_URL);
+ setDocsLinkCopied(true);
+ toast({
+ title: t("integrations.cli.docsLinkCopied"),
+ variant: "success",
+ duration: 2000,
+ });
+ setTimeout(() => setDocsLinkCopied(false), 2000);
+ } catch {
+ /* noop */
+ }
+ };
+
+ return (
+ <div className="rounded-lg border border-border/50 dark:border-border-subtle/70 bg-card/50 dark:bg-surface-2/50 backdrop-blur-sm p-4">
+ <div className="flex items-center gap-2 mb-4">
+ <LogoTile src={logo} alt="OpenWhispr" />
+ <div className="w-9 h-9 rounded-lg bg-white dark:bg-surface-raised shadow-[0_0_0_1px_rgba(0,0,0,0.04)] dark:shadow-none dark:border dark:border-white/5 flex items-center justify-center shrink-0">
+ <Terminal className="w-4 h-4 text-foreground/70" strokeWidth={2} />
+ </div>
+ </div>
+
+ <h3 className="text-sm font-semibold text-foreground mb-1">
+ {t("integrations.cli.title")}
+ </h3>
+ <p className="text-xs text-muted-foreground/70 mb-4 leading-relaxed">
+ {t("integrations.cli.description")}
+ </p>
+
+ <div className="mb-3">
+ <div className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground/50 mb-1.5">
+ {t("integrations.cli.installLabel")}
+ </div>
+ <CopyableCommand command={INSTALL_CMD} />
+ </div>
+
+ <div className="flex items-center gap-2 mb-5">
+ <Button
+ size="sm"
+ onClick={() => window.electronAPI?.openExternal?.(CLI_DOCS_URL)}
+ className="gap-1.5"
+ >
+ {t("integrations.cli.learnMore")}
+ <ExternalLink className="h-3 w-3" />
+ </Button>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={handleCopyDocsLink}
+ className="gap-1.5"
+ >
+ {docsLinkCopied ? (
+ <Check className="h-3 w-3 text-success" />
+ ) : (
+ <Copy className="h-3 w-3" />
+ )}
+ {t("integrations.cli.copyDocsLink")}
+ </Button>
+ </div>
+
+ <div className="mb-4">
+ <div className="flex items-center gap-1.5 mb-1">
+ <h4 className="text-xs font-semibold text-foreground">
+ {t("integrations.cli.local.label")}
+ </h4>
+ <Badge variant="outline" className="text-[10px] px-1.5 py-0 font-normal">
+ {t("integrations.cli.local.freeBadge")}
+ </Badge>
+ </div>
+ <p className="text-xs text-muted-foreground/70 mb-2 leading-relaxed">
+ {t("integrations.cli.local.description")}
+ </p>
+ <CopyableCommand command={LOCAL_EXAMPLE} />
+ </div>
+
+ <div>
+ <div className="flex items-center gap-1.5 mb-1">
+ <h4 className="text-xs font-semibold text-foreground">
+ {t("integrations.cli.cloud.label")}
+ </h4>
+ {!isPaid && (
+ <Badge variant="outline" className="text-[10px] px-1.5 py-0 font-normal">
+ {t("integrations.plan.pro")}
+ </Badge>
+ )}
+ </div>
+ <p className="text-xs text-muted-foreground/70 mb-2 leading-relaxed">
+ {isPaid
+ ? t("integrations.cli.cloud.description")
+ : t("integrations.cli.cloud.proRequired")}
+ </p>
+ {isPaid ? (
+ <CopyableCommand command={CLOUD_LOGIN_CMD} />
+ ) : (
+ <Button size="sm" onClick={onUpgrade}>
+ {t("integrations.cli.viewPlans")}
+ </Button>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/src/components/IntegrationsView.tsx b/src/components/IntegrationsView.tsx
index 28055a09f..6e63aed1e 100644
--- a/src/components/IntegrationsView.tsx
+++ b/src/components/IntegrationsView.tsx
@@ -16,6 +16,7 @@ import { useSettingsStore } from "../stores/settingsStore";
import { useSystemAudioPermission } from "../hooks/useSystemAudioPermission";
import { canManageSystemAudioInApp } from "../utils/systemAudioAccess";
import ApiKeysSection from "./ApiKeysSection";
+import CliIntegrationCard from "./CliIntegrationCard";
import McpIntegrationCard from "./McpIntegrationCard";
import googleCalendarIcon from "../assets/icons/google-calendar.svg";
@@ -242,6 +243,11 @@ export default function IntegrationsView({ isPaid, onUpgrade }: IntegrationsView
<McpIntegrationCard isPaid={isPaid} onUpgrade={onUpgrade} />
</div>
+ <div>
+ <SectionLabel>{t("integrations.sections.cli")}</SectionLabel>
+ <CliIntegrationCard isPaid={isPaid} onUpgrade={onUpgrade} />
+ </div>
+
{!hasAccounts && (
<div className="rounded-lg border border-border/40 dark:border-border-subtle/40 bg-muted/20 dark:bg-surface-2/30 p-4 flex items-start gap-3">
<Info size={15} className="text-primary/60 shrink-0 mt-0.5" />
diff --git a/src/components/McpIntegrationCard.tsx b/src/components/McpIntegrationCard.tsx
index 364ac716a..67eb1921b 100644
--- a/src/components/McpIntegrationCard.tsx
+++ b/src/components/McpIntegrationCard.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
import { Check, Copy, ExternalLink, Plus } from "lucide-react";
import { Badge } from "./ui/badge";
import { Button } from "./ui/button";
+import { LogoTile } from "./ui/LogoTile";
import { useToast } from "./ui/useToast";
import logo from "../assets/logo.svg";
import claudeIcon from "../assets/icons/providers/claude.svg";
@@ -17,14 +18,6 @@ interface McpIntegrationCardProps {
onUpgrade: () => void;
}
-function LogoTile({ src, alt }: { src: string; alt: string }) {
- return (
- <div className="w-9 h-9 rounded-lg bg-white dark:bg-surface-raised shadow-[0_0_0_1px_rgba(0,0,0,0.04)] dark:shadow-none dark:border dark:border-white/5 flex items-center justify-center shrink-0">
- <img src={src} alt={alt} className="w-5 h-5" />
- </div>
- );
-}
-
export default function McpIntegrationCard({ isPaid, onUpgrade }: McpIntegrationCardProps) {
const { t } = useTranslation();
const { toast } = useToast();
@@ -47,9 +40,9 @@ export default function McpIntegrationCard({ isPaid, onUpgrade }: McpIntegration
<LogoTile src={logo} alt="OpenWhispr" />
<Plus className="h-3 w-3 text-muted-foreground/40 shrink-0" />
<div className="flex items-center gap-1">
- <LogoTile src={claudeIcon} alt="Claude" />
- <LogoTile src={openaiIcon} alt="ChatGPT" />
- <LogoTile src={cursorIcon} alt="Cursor" />
+ <LogoTile src={claudeIcon} alt="Claude" monochrome />
+ <LogoTile src={openaiIcon} alt="ChatGPT" monochrome />
+ <LogoTile src={cursorIcon} alt="Cursor" monochrome />
</div>
</div>
diff --git a/src/components/MeetingRecordingMount.tsx b/src/components/MeetingRecordingMount.tsx
index 46a809d6d..ceea32d61 100644
--- a/src/components/MeetingRecordingMount.tsx
+++ b/src/components/MeetingRecordingMount.tsx
@@ -5,11 +5,8 @@ import {
useMeetingRecordingStore,
} from "../stores/meetingRecordingStore";
-// EMA factor 0.7 prefers the previous level so visual bars don't twitch on
-// noisy sub-frame samples. The 0.3 weight on the new RMS is enough to track
-// fast onsets (vowels, plosives) without lag.
-const EMA_PREV = 0.7;
-const EMA_NEXT = 0.3;
+const EMA_PREV = 0.5;
+const EMA_NEXT = 0.5;
export default function MeetingRecordingMount(): null {
const isRecording = useMeetingRecordingStore((s) => s.isRecording);
@@ -23,20 +20,21 @@ export default function MeetingRecordingMount(): null {
let rafId = 0;
let smoothed = 0;
- const buf = new Float32Array(128);
+ let buf = new Float32Array(256);
const tick = () => {
const analyser = getMicAnalyser();
if (analyser) {
- const len = Math.min(buf.length, analyser.fftSize);
- const view = len === buf.length ? buf : buf.subarray(0, len);
- analyser.getFloatTimeDomainData(view);
+ if (buf.length !== analyser.fftSize) {
+ buf = new Float32Array(analyser.fftSize);
+ }
+ analyser.getFloatTimeDomainData(buf);
let sumSquares = 0;
- for (let i = 0; i < len; i++) {
- const v = view[i];
+ for (let i = 0; i < buf.length; i++) {
+ const v = buf[i];
sumSquares += v * v;
}
- const rms = Math.sqrt(sumSquares / len);
+ const rms = Math.sqrt(sumSquares / buf.length);
smoothed = EMA_PREV * smoothed + EMA_NEXT * rms;
const clamped = smoothed < 0 ? 0 : smoothed > 1 ? 1 : smoothed;
useMeetingRecordingStore.setState({ currentMicLevel: clamped });
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index b45556e24..15f68477e 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -54,7 +54,6 @@ import {
import { Alert, AlertTitle, AlertDescription } from "./ui/alert";
import { useSettings } from "../hooks/useSettings";
import { useDialogs } from "../hooks/useDialogs";
-import { useAgentName } from "../utils/agentName";
import { useWhisper } from "../hooks/useWhisper";
import { usePermissions } from "../hooks/usePermissions";
import { useSystemAudioPermission } from "../hooks/useSystemAudioPermission";
@@ -726,8 +725,6 @@ export default function SettingsPage({
const permissionsHook = usePermissions(showAlertDialog);
const systemAudio = useSystemAudioPermission();
useClipboard(showAlertDialog);
- const { agentName, setAgentName } = useAgentName();
- const [agentNameInput, setAgentNameInput] = useState(agentName);
const [audioStorageUsage, setAudioStorageUsage] = useState<{
fileCount: number;
totalBytes: number;
@@ -783,38 +780,6 @@ export default function SettingsPage({
refreshYdotoolStatus();
}, [refreshYdotoolStatus]);
- const handleSaveAgentName = useCallback(() => {
- const trimmed = agentNameInput.trim();
- const previousName = agentName;
-
- setAgentName(trimmed);
- setAgentNameInput(trimmed);
-
- let nextDictionary = customDictionary.filter((w) => w !== previousName);
- if (trimmed) {
- const hasName = nextDictionary.some((w) => w.toLowerCase() === trimmed.toLowerCase());
- if (!hasName) {
- nextDictionary = [trimmed, ...nextDictionary];
- }
- }
- setCustomDictionary(nextDictionary);
-
- showAlertDialog({
- title: t("settingsPage.agentConfig.dialogs.updatedTitle"),
- description: t("settingsPage.agentConfig.dialogs.updatedDescription", {
- name: trimmed,
- }),
- });
- }, [
- agentNameInput,
- agentName,
- customDictionary,
- setAgentName,
- setCustomDictionary,
- showAlertDialog,
- t,
- ]);
-
const { theme, setTheme } = useTheme();
const usage = useUsage();
const hasShownApproachingToast = useRef(false);
@@ -3069,108 +3034,7 @@ EOF`,
return (
<LlmsTabs
initialTab={initialSubTab as LlmTab | undefined}
- renderChatIntelligence={() => (
- <div className="space-y-6">
- <ChatAgentSettings />
-
- <div className="border-t border-border/40 pt-6 space-y-5">
- <SectionHeader
- title={t("settingsPage.agentConfig.title")}
- description={t("settingsPage.agentConfig.description")}
- />
-
- <div>
- <p className="text-xs font-medium text-foreground mb-3">
- {t("settingsPage.agentConfig.agentName")}
- </p>
- <SettingsPanel>
- <SettingsPanelRow>
- <div className="space-y-3">
- <div className="flex gap-2">
- <Input
- placeholder={t("settingsPage.agentConfig.placeholder")}
- value={agentNameInput}
- onChange={(e) => setAgentNameInput(e.target.value)}
- className="flex-1 text-center text-base font-mono"
- />
- <Button
- onClick={handleSaveAgentName}
- disabled={!agentNameInput.trim()}
- size="sm"
- >
- {t("settingsPage.agentConfig.save")}
- </Button>
- </div>
- <p className="text-xs text-muted-foreground/60">
- {t("settingsPage.agentConfig.helper")}
- </p>
- </div>
- </SettingsPanelRow>
- </SettingsPanel>
- </div>
-
- <div>
- <SectionHeader title={t("settingsPage.agentConfig.howItWorksTitle")} />
- <SettingsPanel>
- <SettingsPanelRow>
- <p className="text-xs text-muted-foreground leading-relaxed">
- {t("settingsPage.agentConfig.howItWorksDescription", { agentName })}
- </p>
- </SettingsPanelRow>
- </SettingsPanel>
- </div>
-
- <div>
- <SectionHeader title={t("settingsPage.agentConfig.examplesTitle")} />
- <SettingsPanel>
- <SettingsPanelRow>
- <div className="space-y-2.5">
- {[
- {
- input: t("settingsPage.agentConfig.examples.formalEmail", {
- agentName,
- }),
- mode: t("settingsPage.agentConfig.instructionMode"),
- },
- {
- input: t("settingsPage.agentConfig.examples.professional", {
- agentName,
- }),
- mode: t("settingsPage.agentConfig.instructionMode"),
- },
- {
- input: t("settingsPage.agentConfig.examples.bulletPoints", {
- agentName,
- }),
- mode: t("settingsPage.agentConfig.instructionMode"),
- },
- {
- input: t("settingsPage.agentConfig.cleanupExample"),
- mode: t("settingsPage.agentConfig.cleanupMode"),
- },
- ].map((example, i) => (
- <div key={i} className="flex items-start gap-3">
- <span
- className={`shrink-0 mt-0.5 text-xs font-medium uppercase tracking-wider px-1.5 py-px rounded ${
- example.mode === t("settingsPage.agentConfig.instructionMode")
- ? "bg-primary/10 text-primary dark:bg-primary/15"
- : "bg-muted text-muted-foreground"
- }`}
- >
- {example.mode}
- </span>
- <p className="text-xs text-muted-foreground leading-relaxed">
- "{example.input}"
- </p>
- </div>
- ))}
- </div>
- </SettingsPanelRow>
- </SettingsPanel>
- </div>
- </div>
- </div>
- )}
+ renderChatIntelligence={() => <ChatAgentSettings />}
renderDictationCleanup={() => (
<div className="space-y-6">
<AiModelsSection
diff --git a/src/components/notes/MeetingRecordingPill.tsx b/src/components/notes/MeetingRecordingPill.tsx
index 5b6946c9f..52a72d6bb 100644
--- a/src/components/notes/MeetingRecordingPill.tsx
+++ b/src/components/notes/MeetingRecordingPill.tsx
@@ -12,7 +12,7 @@ interface MeetingRecordingPillProps {
}
const BAR_COUNT = 4;
-const BAR_FLOOR = 20;
+const BAR_FLOOR = 12;
const isControlPanelWindow = () => {
if (typeof window === "undefined") return false;
@@ -25,8 +25,10 @@ const truncateTitle = (title: string) =>
const computeBarHeight = (level: number, index: number) => {
// Per-bar phase keeps the stack from moving in lockstep at sustained levels.
+ // sqrt curve maps small RMS values (typical speech ~0.05-0.1) into a
+ // visible range — linear scaling kept bars clamped at the floor.
const phase = 0.7 + 0.3 * Math.sin(index * 1.7);
- const scaled = level * 100 * phase;
+ const scaled = Math.sqrt(level) * 180 * phase;
return `${Math.max(BAR_FLOOR, Math.min(100, scaled))}%`;
};
@@ -65,7 +67,7 @@ export default function MeetingRecordingPill({
return createPortal(
<div
- className="fixed top-12 left-1/2 -translate-x-1/2 z-20"
+ className="fixed top-2 left-1/2 -translate-x-1/2 z-30"
style={
{
WebkitAppRegion: "no-drag",
@@ -76,9 +78,9 @@ export default function MeetingRecordingPill({
<div
className={cn(
"flex items-center gap-2 h-9 px-3 rounded-xl",
- "bg-primary/6 dark:bg-primary/10",
+ "bg-card/95 dark:bg-surface-2/95",
"backdrop-blur-xl",
- "border border-primary/20 dark:border-primary/25",
+ "border border-primary/25 dark:border-primary/30",
"shadow-elevated"
)}
>
diff --git a/src/components/notes/PersonalNotesView.tsx b/src/components/notes/PersonalNotesView.tsx
index c049859cd..412f547a8 100644
--- a/src/components/notes/PersonalNotesView.tsx
+++ b/src/components/notes/PersonalNotesView.tsx
@@ -943,7 +943,7 @@ export default function PersonalNotesView({
onTitleChange={handleTitleChange}
onContentChange={handleContentChange}
isSaving={isSaving}
- isRecording={isTranscribing}
+ isRecording={isActiveNoteRecording}
isProcessing={false}
onStartRecording={startRecording}
onStopRecording={stopRecording}
diff --git a/src/components/settings/DictationAgentSettings.tsx b/src/components/settings/DictationAgentSettings.tsx
index 176631d22..e5f1afce5 100644
--- a/src/components/settings/DictationAgentSettings.tsx
+++ b/src/components/settings/DictationAgentSettings.tsx
@@ -1,10 +1,17 @@
+import { useCallback, useState } from "react";
import { useTranslation } from "react-i18next";
+import { useShallow } from "zustand/react/shallow";
import {
useSettingsStore,
selectResolvedLLMConfig,
setResolvedLLMConfig,
} from "../../stores/settingsStore";
+import { useAgentName } from "../../utils/agentName";
+import { useSettings } from "../../hooks/useSettings";
+import { useDialogs } from "../../hooks/useDialogs";
import { Toggle } from "../ui/toggle";
+import { Input } from "../ui/input";
+import { Button } from "../ui/button";
import { SettingsPanel, SettingsPanelRow, SettingsRow, SectionHeader } from "../ui/SettingsSection";
import PromptStudio from "../ui/PromptStudio";
import InferenceConfigEditor from "./InferenceConfigEditor";
@@ -13,10 +20,19 @@ export default function DictationAgentSettings() {
const { t } = useTranslation();
const useDictationAgent = useSettingsStore((s) => s.useDictationAgent);
const setUseDictationAgent = useSettingsStore((s) => s.setUseDictationAgent);
- const agentConfig = useSettingsStore((s) => selectResolvedLLMConfig(s, "dictationAgent"));
- const cleanupConfig = useSettingsStore((s) => selectResolvedLLMConfig(s, "dictationCleanup"));
+ const agentConfig = useSettingsStore(
+ useShallow((s) => selectResolvedLLMConfig(s, "dictationAgent"))
+ );
+ const cleanupConfig = useSettingsStore(
+ useShallow((s) => selectResolvedLLMConfig(s, "dictationCleanup"))
+ );
const showUseCleanup = !agentConfig.provider && !agentConfig.model && !!cleanupConfig.provider;
+ const { agentName, setAgentName } = useAgentName();
+ const [agentNameInput, setAgentNameInput] = useState(agentName);
+ const { customDictionary, setCustomDictionary } = useSettings();
+ const { showAlertDialog } = useDialogs();
+
const useCleanupModel = () => {
setResolvedLLMConfig("dictationAgent", {
provider: cleanupConfig.provider,
@@ -27,6 +43,128 @@ export default function DictationAgentSettings() {
});
};
+ const handleSaveAgentName = useCallback(() => {
+ const trimmed = agentNameInput.trim();
+ const previousName = agentName;
+
+ setAgentName(trimmed);
+ setAgentNameInput(trimmed);
+
+ let nextDictionary = customDictionary.filter((w) => w !== previousName);
+ if (trimmed) {
+ const hasName = nextDictionary.some((w) => w.toLowerCase() === trimmed.toLowerCase());
+ if (!hasName) {
+ nextDictionary = [trimmed, ...nextDictionary];
+ }
+ }
+ setCustomDictionary(nextDictionary);
+
+ showAlertDialog({
+ title: t("settingsPage.agentConfig.dialogs.updatedTitle"),
+ description: t("settingsPage.agentConfig.dialogs.updatedDescription", {
+ name: trimmed,
+ }),
+ });
+ }, [
+ agentNameInput,
+ agentName,
+ customDictionary,
+ setAgentName,
+ setCustomDictionary,
+ showAlertDialog,
+ t,
+ ]);
+
+ const instructionMode = t("settingsPage.agentConfig.instructionMode");
+ const examples = [
+ {
+ input: t("settingsPage.agentConfig.examples.formalEmail", { agentName }),
+ mode: instructionMode,
+ },
+ {
+ input: t("settingsPage.agentConfig.examples.professional", { agentName }),
+ mode: instructionMode,
+ },
+ {
+ input: t("settingsPage.agentConfig.examples.bulletPoints", { agentName }),
+ mode: instructionMode,
+ },
+ {
+ input: t("settingsPage.agentConfig.cleanupExample"),
+ mode: t("settingsPage.agentConfig.cleanupMode"),
+ },
+ ];
+
+ const voiceAgentSection = (
+ <div className="border-t border-border/40 pt-6 space-y-5">
+ <SectionHeader
+ title={t("settingsPage.agentConfig.title")}
+ description={t("settingsPage.agentConfig.description")}
+ />
+
+ <div>
+ <p className="text-xs font-medium text-foreground mb-3">
+ {t("settingsPage.agentConfig.agentName")}
+ </p>
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="space-y-3">
+ <div className="flex gap-2">
+ <Input
+ placeholder={t("settingsPage.agentConfig.placeholder")}
+ value={agentNameInput}
+ onChange={(e) => setAgentNameInput(e.target.value)}
+ className="flex-1 text-center text-base font-mono"
+ />
+ <Button onClick={handleSaveAgentName} disabled={!agentNameInput.trim()} size="sm">
+ {t("settingsPage.agentConfig.save")}
+ </Button>
+ </div>
+ <p className="text-xs text-muted-foreground/60">
+ {t("settingsPage.agentConfig.helper")}
+ </p>
+ </div>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+
+ <div>
+ <SectionHeader title={t("settingsPage.agentConfig.howItWorksTitle")} />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <p className="text-xs text-muted-foreground leading-relaxed">
+ {t("settingsPage.agentConfig.howItWorksDescription", { agentName })}
+ </p>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+
+ <div>
+ <SectionHeader title={t("settingsPage.agentConfig.examplesTitle")} />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="space-y-2.5">
+ {examples.map((example, i) => (
+ <div key={i} className="flex items-start gap-3">
+ <span
+ className={`shrink-0 mt-0.5 text-xs font-medium uppercase tracking-wider px-1.5 py-px rounded ${
+ example.mode === instructionMode
+ ? "bg-primary/10 text-primary dark:bg-primary/15"
+ : "bg-muted text-muted-foreground"
+ }`}
+ >
+ {example.mode}
+ </span>
+ <p className="text-xs text-muted-foreground leading-relaxed">"{example.input}"</p>
+ </div>
+ ))}
+ </div>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+ </div>
+ );
+
return (
<div className="space-y-6">
<SettingsPanel>
@@ -62,16 +200,20 @@ export default function DictationAgentSettings() {
)}
<InferenceConfigEditor scope="dictationAgent" />
-
- <div className="border-t border-border/40 pt-6">
- <SectionHeader
- title={t("dictationAgent.prompt.title")}
- description={t("dictationAgent.prompt.description")}
- />
- <PromptStudio kind="dictationAgent" />
- </div>
</>
)}
+
+ {voiceAgentSection}
+
+ {useDictationAgent && (
+ <div className="border-t border-border/40 pt-6">
+ <SectionHeader
+ title={t("dictationAgent.prompt.title")}
+ description={t("dictationAgent.prompt.description")}
+ />
+ <PromptStudio kind="dictationAgent" />
+ </div>
+ )}
</div>
);
}
diff --git a/src/components/settings/InferenceConfigEditor.tsx b/src/components/settings/InferenceConfigEditor.tsx
index ddbf29343..c658f9b9c 100644
--- a/src/components/settings/InferenceConfigEditor.tsx
+++ b/src/components/settings/InferenceConfigEditor.tsx
@@ -1,4 +1,5 @@
import { useCallback } from "react";
+import { useShallow } from "zustand/react/shallow";
import { useTranslation } from "react-i18next";
import { Cloud, Key, Cpu, Network, Building2 } from "lucide-react";
import {
@@ -55,7 +56,7 @@ interface InferenceConfigEditorProps {
export default function InferenceConfigEditor({ scope, onModeChange }: InferenceConfigEditorProps) {
const { t } = useTranslation();
- const config = useSettingsStore((s) => selectResolvedLLMConfig(s, scope));
+ const config = useSettingsStore(useShallow((s) => selectResolvedLLMConfig(s, scope)));
const isSignedIn = useSettingsStore((s) => s.isSignedIn);
const prefix = MODE_LABEL_PREFIX[scope];
diff --git a/src/components/ui/LogoTile.tsx b/src/components/ui/LogoTile.tsx
new file mode 100644
index 000000000..3858e59bb
--- /dev/null
+++ b/src/components/ui/LogoTile.tsx
@@ -0,0 +1,13 @@
+interface LogoTileProps {
+ src: string;
+ alt: string;
+ monochrome?: boolean;
+}
+
+export function LogoTile({ src, alt, monochrome }: LogoTileProps) {
+ return (
+ <div className="w-9 h-9 rounded-lg bg-white dark:bg-surface-raised shadow-[0_0_0_1px_rgba(0,0,0,0.04)] dark:shadow-none dark:border dark:border-white/5 flex items-center justify-center shrink-0">
+ <img src={src} alt={alt} className={`w-5 h-5${monochrome ? " icon-monochrome" : ""}`} />
+ </div>
+ );
+}
diff --git a/src/helpers/ModelManager.ts b/src/helpers/ModelManager.ts
index e284598ff..20125e11f 100644
--- a/src/helpers/ModelManager.ts
+++ b/src/helpers/ModelManager.ts
@@ -2,12 +2,12 @@ import path from "path";
import { spawn } from "child_process";
import fs from "fs";
import { promises as fsPromises } from "fs";
-import https from "https";
import { app } from "electron";
import { modelRegistry } from "../models/ModelRegistry";
import { inferenceConfig } from "../config/InferenceConfig";
import { MODEL_CONSTRAINTS } from "../config/constants";
import { parseLlamaCppOutput } from "../utils/llamaOutputParser";
+const { downloadFile: runtimeDownloadFile } = require("./downloadUtils");
// Error types
export class ModelError extends Error {
@@ -83,7 +83,6 @@ class ModelManager {
const { model, provider } = modelInfo;
const modelPath = path.join(this.modelsDir, model.fileName);
- const tempPath = `${modelPath}.tmp`;
if (await this.isModelDownloaded(modelId)) {
return modelPath;
@@ -93,43 +92,31 @@ class ModelManager {
this.activeDownloads.set(modelId, true);
try {
- await this.downloadFile(downloadUrl, tempPath, (downloadedSize, totalSize) => {
- const progress = (downloadedSize / totalSize) * 100;
- this.downloadProgress.set(modelId, {
- modelId,
- progress,
- downloadedSize,
- totalSize,
- });
- if (onProgress) {
- onProgress(progress, downloadedSize, totalSize);
- }
+ await runtimeDownloadFile(downloadUrl, modelPath, {
+ onProgress: (downloadedSize: number, totalSize: number) => {
+ const progress = totalSize > 0 ? (downloadedSize / totalSize) * 100 : 0;
+ this.downloadProgress.set(modelId, {
+ modelId,
+ progress,
+ downloadedSize,
+ totalSize,
+ });
+ onProgress?.(progress, downloadedSize, totalSize);
+ },
});
- const stats = await fsPromises.stat(tempPath);
+ const stats = await fsPromises.stat(modelPath);
if (stats.size < MODEL_CONSTRAINTS.MIN_FILE_SIZE) {
+ await fsPromises.unlink(modelPath).catch(() => {});
throw new ModelError("Downloaded file appears to be corrupted", "DOWNLOAD_CORRUPTED", {
size: stats.size,
});
}
- await fsPromises.rename(tempPath, modelPath);
-
- this.downloadProgress.delete(modelId);
- this.activeDownloads.delete(modelId);
-
return modelPath;
- } catch (error) {
+ } finally {
this.downloadProgress.delete(modelId);
this.activeDownloads.delete(modelId);
-
- try {
- await fsPromises.unlink(tempPath);
- } catch {
- // Ignore cleanup errors
- }
-
- throw error;
}
}
@@ -168,53 +155,6 @@ class ModelManager {
return this.downloadProgress.get(modelId);
}
- private async downloadFile(
- url: string,
- destPath: string,
- onProgress: (downloaded: number, total: number) => void
- ): Promise<void> {
- return new Promise((resolve, reject) => {
- const file = fs.createWriteStream(destPath);
-
- const request = https.get(url, (response) => {
- if (response.statusCode === 301 || response.statusCode === 302) {
- const redirectUrl = response.headers.location;
- if (redirectUrl) {
- this.downloadFile(redirectUrl, destPath, onProgress).then(resolve).catch(reject);
- return;
- }
- }
-
- if (response.statusCode !== 200) {
- reject(new Error(`Download failed: ${response.statusCode}`));
- return;
- }
-
- const totalSize = parseInt(response.headers["content-length"] || "0", 10);
- let downloadedSize = 0;
-
- response.on("data", (chunk) => {
- downloadedSize += chunk.length;
- onProgress(downloadedSize, totalSize);
- });
-
- response.pipe(file);
-
- file.on("finish", () => {
- file.close();
- resolve();
- });
-
- file.on("error", (err) => {
- fs.unlink(destPath, () => {});
- reject(err);
- });
- });
-
- request.on("error", reject);
- });
- }
-
async ensureLlamaCpp(): Promise<boolean> {
if (this.llamaCppPath) return true;
diff --git a/src/helpers/audioTapManager.js b/src/helpers/audioTapManager.js
index f85021c9d..fbd2aac83 100644
--- a/src/helpers/audioTapManager.js
+++ b/src/helpers/audioTapManager.js
@@ -43,7 +43,6 @@ class AudioTapManager {
this.isStopping = false;
this.permissionStatus = this._loadPermissionStatus();
this._requestPromise = null;
- this._verifiedGranted = false;
}
isSupported() {
@@ -70,7 +69,6 @@ class AudioTapManager {
return this.permissionStatus;
}
- /** Cached status check — never spawns processes or triggers system dialogs. */
checkAccess() {
if (!this.isSupported()) {
return { granted: false, status: "unsupported" };
@@ -79,41 +77,6 @@ class AudioTapManager {
return { granted: status === "granted", status };
}
- /**
- * Async check that verifies a cached "granted" status by probing the binary
- * once per session. Detects permission revocations that the disk cache misses.
- */
- async verifyAccess() {
- if (!this.isSupported()) {
- return { granted: false, status: "unsupported" };
- }
-
- // Active process means definitely granted.
- if (this.process) {
- return { granted: true, status: "granted" };
- }
-
- // Only probe when cached status is "granted" — trust "denied" and "unknown".
- if (this.permissionStatus !== "granted" || this._verifiedGranted) {
- const status = this.getPermissionStatus();
- return { granted: status === "granted", status };
- }
-
- // Cached says "granted" but no process running — verify once per session.
- try {
- const result = await this._probeForAccess();
- if (result.granted) {
- this._verifiedGranted = true;
- }
- return result;
- } catch {
- // Probe rejected — permission was likely revoked.
- // _probeForAccess already persisted the updated status.
- const status = this.getPermissionStatus();
- return { granted: status === "granted", status };
- }
- }
-
_statusFilePath() {
const { app } = require("electron");
return path.join(app.getPath("userData"), ".system-audio-permission");
diff --git a/src/helpers/debugLogger.js b/src/helpers/debugLogger.js
index 5c50d9b6b..8fbbe7d01 100644
--- a/src/helpers/debugLogger.js
+++ b/src/helpers/debugLogger.js
@@ -136,13 +136,26 @@ class DebugLogger {
return LOG_LEVELS[normalized] >= this.levelValue;
}
+ serializeValue(value) {
+ if (value instanceof Error) {
+ return {
+ name: value.name,
+ message: value.message,
+ ...(value.code ? { code: value.code } : {}),
+ ...(value.stack ? { stack: value.stack } : {}),
+ ...value,
+ };
+ }
+ return value;
+ }
+
formatArgs(args) {
return args
.map((arg) => {
- if (typeof arg === "object") {
+ if (arg !== null && typeof arg === "object") {
try {
- return JSON.stringify(arg, null, 2);
- } catch (error) {
+ return JSON.stringify(this.serializeValue(arg), null, 2);
+ } catch {
return String(arg);
}
}
@@ -155,8 +168,8 @@ class DebugLogger {
if (meta === undefined) return "";
if (typeof meta === "string") return meta;
try {
- return JSON.stringify(meta, null, 2);
- } catch (error) {
+ return JSON.stringify(this.serializeValue(meta), null, 2);
+ } catch {
return String(meta);
}
}
diff --git a/src/helpers/downloadUtils.js b/src/helpers/downloadUtils.js
index 705971a14..29d75d59d 100644
--- a/src/helpers/downloadUtils.js
+++ b/src/helpers/downloadUtils.js
@@ -8,7 +8,6 @@ const debugLogger = require("./debugLogger");
const USER_AGENT = "OpenWhispr/1.0";
const PROGRESS_THROTTLE_MS = 100;
-const MAX_REDIRECTS = 5;
const DEFAULT_MAX_RETRIES = 3;
const MAX_BACKOFF_MS = 30000;
const STALL_TIMEOUT_MS = 30000;
@@ -60,7 +59,7 @@ function sleep(ms) {
}
function downloadAttempt(url, tempPath, options) {
- const { onProgress, signal, startOffset = 0, expectedSize = 0, _redirects = 0 } = options;
+ const { onProgress, signal, startOffset = 0, expectedSize = 0 } = options;
return new Promise((resolve, reject) => {
if (signal?.aborted) {
@@ -68,11 +67,6 @@ function downloadAttempt(url, tempPath, options) {
return;
}
- if (_redirects > MAX_REDIRECTS) {
- reject(Object.assign(new Error("Too many redirects"), { isHttpError: true }));
- return;
- }
-
const headers = { "User-Agent": USER_AGENT };
if (startOffset > 0) {
headers["Range"] = `bytes=${startOffset}-`;
@@ -109,8 +103,7 @@ function downloadAttempt(url, tempPath, options) {
signal.onAbort = onAbort;
}
- // Manual redirects so we can reset startOffset when the new origin ignores Range.
- request = net.request({ url, method: "GET", redirect: "manual" });
+ request = net.request({ url, method: "GET" });
for (const [name, value] of Object.entries(headers)) {
request.setHeader(name, value);
}
@@ -125,28 +118,6 @@ function downloadAttempt(url, tempPath, options) {
const statusCode = response.statusCode;
- if (statusCode >= 300 && statusCode < 400) {
- response.resume();
- if (signal) signal.onAbort = null;
- if (request) {
- request.abort();
- request = null;
- }
- const redirectUrl = headerValue(response.headers, "location");
- if (!redirectUrl) {
- reject(
- Object.assign(new Error("Redirect without location header"), { isHttpError: true })
- );
- return;
- }
- downloadAttempt(redirectUrl, tempPath, { ...options, _redirects: _redirects + 1 }).then(
- resolve,
- reject
- );
- return;
- }
-
- // Content response — create write stream
if (statusCode === 200 && startOffset > 0) {
// Server doesn't support Range — restart from beginning
downloadedSize = 0;
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 8f8922f06..058eec178 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -308,6 +308,7 @@ class IPCHandlers {
this._dictationIdleTimer = null;
this._meetingMicStreaming = null;
this._meetingSystemStreaming = null;
+ this._hotkeyCaptureMode = false;
this._autoLearnEnabled = true; // Default on, synced from renderer
this._autoLearnDebounceTimer = null;
this._autoLearnLatestData = null;
@@ -2041,6 +2042,8 @@ class IPCHandlers {
});
ipcMain.handle("set-hotkey-listening-mode", async (event, enabled, newHotkey = null) => {
+ if (this._hotkeyCaptureMode === enabled) return { success: true, skipped: true };
+ this._hotkeyCaptureMode = enabled;
this.windowManager.setHotkeyListeningMode(enabled);
const hotkeyManager = this.windowManager.hotkeyManager;
@@ -3213,7 +3216,7 @@ class IPCHandlers {
return buildSystemAudioAccess();
}
- const result = await this.audioTapManager.verifyAccess();
+ const result = this.audioTapManager.checkAccess();
return buildSystemAudioAccess({
granted: result.granted,
status: result.status,
diff --git a/src/helpers/onnxWorkerClient.js b/src/helpers/onnxWorkerClient.js
index 253d15004..a3222ff8c 100644
--- a/src/helpers/onnxWorkerClient.js
+++ b/src/helpers/onnxWorkerClient.js
@@ -5,6 +5,7 @@ const debugLogger = require("./debugLogger");
const REQUEST_TIMEOUT_MS = 30_000;
const MAX_PENDING_REQUESTS = 1000;
const RESPAWN_BACKOFF_MS = [1000, 2000, 4000, 8000, 16000, 30000];
+const MAX_RESPAWN_ATTEMPTS = 5;
const SHUTDOWN_TIMEOUT_MS = 5000;
const WORKER_SCRIPT = path.join(__dirname, "..", "workers", "onnxWorker.js");
@@ -31,6 +32,7 @@ class OnnxWorkerClient {
this.nextRequestId = 1;
this.crashCount = 0;
this.shuttingDown = false;
+ this.gaveUp = false;
this.spawnPromise = null;
this.respawnTimer = null;
}
@@ -54,11 +56,20 @@ class OnnxWorkerClient {
const child = utilityProcess.fork(WORKER_SCRIPT, [], {
serviceName: "openwhispr-onnx",
- stdio: "ignore",
+ stdio: "pipe",
env,
execArgv: ["--max-old-space-size=512"],
});
+ const forwardStderr = (chunk) => {
+ const text = chunk.toString();
+ for (const line of text.split(/\r?\n/)) {
+ if (line) debugLogger.warn("onnx worker stderr", { line });
+ }
+ };
+ child.stderr?.on("data", forwardStderr);
+ child.stdout?.on("data", forwardStderr);
+
await new Promise((resolve, reject) => {
const onSpawn = () => {
child.removeListener("error", onError);
@@ -133,6 +144,11 @@ class OnnxWorkerClient {
if (code !== 0) {
this.crashCount += 1;
+ if (this.crashCount > MAX_RESPAWN_ATTEMPTS) {
+ this.gaveUp = true;
+ debugLogger.error("onnx worker giving up", { crashCount: this.crashCount });
+ return;
+ }
const delay =
RESPAWN_BACKOFF_MS[Math.min(this.crashCount - 1, RESPAWN_BACKOFF_MS.length - 1)];
debugLogger.info("onnx worker respawn scheduled", {
@@ -153,6 +169,10 @@ class OnnxWorkerClient {
throw new WorkerCrashedError("worker shutting down");
}
+ if (this.gaveUp) {
+ throw new WorkerCrashedError("worker unavailable");
+ }
+
if (this.respawnTimer) {
throw new WorkerCrashedError("worker restarting");
}
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index 0f21838f7..b5466c22d 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -1202,6 +1202,10 @@ class WindowManager {
this.updateNotificationWindow.close();
this.updateNotificationWindow = null;
}
+ if (this._updateNotificationAutoDismiss) {
+ clearTimeout(this._updateNotificationAutoDismiss);
+ this._updateNotificationAutoDismiss = null;
+ }
const display = screen.getPrimaryDisplay();
const position = WindowPositionUtil.getNotificationPosition(display);
@@ -1241,8 +1245,16 @@ class WindowManager {
}
}, 3000);
+ this._updateNotificationAutoDismiss = setTimeout(() => {
+ this.dismissUpdateNotification({ persistent: false });
+ }, 5000);
+
this.updateNotificationWindow.on("closed", () => {
this.updateNotificationWindow = null;
+ if (this._updateNotificationAutoDismiss) {
+ clearTimeout(this._updateNotificationAutoDismiss);
+ this._updateNotificationAutoDismiss = null;
+ }
});
}
@@ -1256,13 +1268,17 @@ class WindowManager {
}
}
- dismissUpdateNotification() {
+ dismissUpdateNotification({ persistent = true } = {}) {
this._pendingUpdateNotificationData = null;
- this._updateNotificationDismissed = true;
+ if (persistent) this._updateNotificationDismissed = true;
if (this._updateNotificationReadyFallback) {
clearTimeout(this._updateNotificationReadyFallback);
this._updateNotificationReadyFallback = null;
}
+ if (this._updateNotificationAutoDismiss) {
+ clearTimeout(this._updateNotificationAutoDismiss);
+ this._updateNotificationAutoDismiss = null;
+ }
if (this.updateNotificationWindow && !this.updateNotificationWindow.isDestroyed()) {
this.updateNotificationWindow.close();
}
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index c153482f4..1f5f7b7d6 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -2235,7 +2235,8 @@
"sections": {
"calendar": "Kalender",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "API-Schlüssel",
@@ -2257,6 +2258,25 @@
"proRequired": "Upgrade auf einen kostenpflichtigen Plan, um OpenWhispr mit Claude, ChatGPT und Cursor zu verbinden.",
"copied": "Kopiert"
},
+ "cli": {
+ "title": "Kommandozeilen-Zugriff",
+ "description": "Gib deinem Agenten über das Terminal Zugriff auf deine Notizen.",
+ "installLabel": "Installieren",
+ "learnMore": "Dokumentation lesen",
+ "copyDocsLink": "Doku-Link kopieren",
+ "docsLinkCopied": "Doku-Link kopiert",
+ "viewPlans": "Pläne ansehen",
+ "local": {
+ "label": "Lokal",
+ "freeBadge": "Kostenlos",
+ "description": "Greife direkt auf deine lokalen Notizen zu. Kein Login oder API-Key — funktioniert, solange OpenWhispr läuft."
+ },
+ "cloud": {
+ "label": "Cloud",
+ "description": "Synchronisiere geräteübergreifend mit deinem API-Key.",
+ "proRequired": "Upgrade auf einen kostenpflichtigen Plan, um die CLI im Cloud-Modus zu nutzen."
+ }
+ },
"plan": {
"title": "Dein Plan",
"current": "Aktuell",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index b4f76fa91..9d525a083 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -2331,7 +2331,8 @@
"sections": {
"calendar": "Calendar",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "API keys",
@@ -2353,6 +2354,25 @@
"proRequired": "Upgrade to a paid plan to connect OpenWhispr to Claude, ChatGPT, and Cursor.",
"copied": "Copied"
},
+ "cli": {
+ "title": "Command-line access",
+ "description": "Give your agent access to your notes from the terminal.",
+ "installLabel": "Install",
+ "learnMore": "Read the docs",
+ "copyDocsLink": "Copy docs link",
+ "docsLinkCopied": "Docs link copied",
+ "viewPlans": "View Plans",
+ "local": {
+ "label": "Local",
+ "freeBadge": "Free",
+ "description": "Read your local notes directly. No login or API key — works while OpenWhispr is running."
+ },
+ "cloud": {
+ "label": "Cloud",
+ "description": "Sync across machines using your API key.",
+ "proRequired": "Upgrade to a paid plan to use the CLI in cloud mode."
+ }
+ },
"plan": {
"title": "Your Plan",
"current": "Current",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 14076efbd..539bec817 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -2283,7 +2283,8 @@
"sections": {
"calendar": "Calendario",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "Claves API",
@@ -2305,6 +2306,25 @@
"proRequired": "Actualiza a un plan de pago para conectar OpenWhispr con Claude, ChatGPT y Cursor.",
"copied": "Copiado"
},
+ "cli": {
+ "title": "Acceso por línea de comandos",
+ "description": "Dale a tu agente acceso a tus notas desde la terminal.",
+ "installLabel": "Instalar",
+ "learnMore": "Leer la documentación",
+ "copyDocsLink": "Copiar enlace de la documentación",
+ "docsLinkCopied": "Enlace de la documentación copiado",
+ "viewPlans": "Ver planes",
+ "local": {
+ "label": "Local",
+ "freeBadge": "Gratis",
+ "description": "Lee tus notas locales directamente. Sin inicio de sesión ni clave API — funciona mientras OpenWhispr esté abierto."
+ },
+ "cloud": {
+ "label": "Nube",
+ "description": "Sincroniza entre dispositivos con tu clave API.",
+ "proRequired": "Actualiza a un plan de pago para usar la CLI en modo nube."
+ }
+ },
"plan": {
"title": "Tu Plan",
"current": "Actual",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 5cbc72404..d60a60ac4 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -2283,7 +2283,8 @@
"sections": {
"calendar": "Calendrier",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "Clés API",
@@ -2305,6 +2306,25 @@
"proRequired": "Passez à un plan payant pour connecter OpenWhispr à Claude, ChatGPT et Cursor.",
"copied": "Copié"
},
+ "cli": {
+ "title": "Accès en ligne de commande",
+ "description": "Donnez à votre agent l'accès à vos notes depuis le terminal.",
+ "installLabel": "Installer",
+ "learnMore": "Lire la documentation",
+ "copyDocsLink": "Copier le lien de la documentation",
+ "docsLinkCopied": "Lien de la documentation copié",
+ "viewPlans": "Voir les forfaits",
+ "local": {
+ "label": "Local",
+ "freeBadge": "Gratuit",
+ "description": "Lisez vos notes locales directement. Aucun compte ni clé API — fonctionne tant qu'OpenWhispr est ouvert."
+ },
+ "cloud": {
+ "label": "Cloud",
+ "description": "Synchronisez vos appareils avec votre clé API.",
+ "proRequired": "Passez à un plan payant pour utiliser la CLI en mode cloud."
+ }
+ },
"plan": {
"title": "Votre forfait",
"current": "Actuel",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 71876ea44..9aa3e18c5 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -2235,7 +2235,8 @@
"sections": {
"calendar": "Calendario",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "Chiavi API",
@@ -2257,6 +2258,25 @@
"proRequired": "Passa a un piano a pagamento per collegare OpenWhispr a Claude, ChatGPT e Cursor.",
"copied": "Copiato"
},
+ "cli": {
+ "title": "Accesso da riga di comando",
+ "description": "Dai al tuo agente l'accesso alle note dal terminale.",
+ "installLabel": "Installa",
+ "learnMore": "Leggi la documentazione",
+ "copyDocsLink": "Copia link della documentazione",
+ "docsLinkCopied": "Link della documentazione copiato",
+ "viewPlans": "Visualizza i piani",
+ "local": {
+ "label": "Locale",
+ "freeBadge": "Gratis",
+ "description": "Leggi le tue note locali direttamente. Nessun login o chiave API — funziona mentre OpenWhispr è aperto."
+ },
+ "cloud": {
+ "label": "Cloud",
+ "description": "Sincronizza tra dispositivi usando la tua chiave API.",
+ "proRequired": "Passa a un piano a pagamento per usare la CLI in modalità cloud."
+ }
+ },
"plan": {
"title": "Il tuo Piano",
"current": "Attuale",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 6fbabf32d..fa93e4c62 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -2235,7 +2235,8 @@
"sections": {
"calendar": "カレンダー",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "APIキー",
@@ -2257,6 +2258,25 @@
"proRequired": "OpenWhispr を Claude、ChatGPT、Cursor に接続するには、有料プランへのアップグレードが必要です。",
"copied": "コピーしました"
},
+ "cli": {
+ "title": "コマンドラインアクセス",
+ "description": "ターミナルからエージェントにメモへのアクセスを許可します。",
+ "installLabel": "インストール",
+ "learnMore": "ドキュメントを読む",
+ "copyDocsLink": "ドキュメントリンクをコピー",
+ "docsLinkCopied": "ドキュメントリンクをコピーしました",
+ "viewPlans": "プランを表示",
+ "local": {
+ "label": "ローカル",
+ "freeBadge": "無料",
+ "description": "ローカルのメモに直接アクセスできます。ログインや API キーは不要 — OpenWhispr の起動中に利用できます。"
+ },
+ "cloud": {
+ "label": "クラウド",
+ "description": "API キーを使ってデバイス間で同期します。",
+ "proRequired": "クラウドモードで CLI を利用するには有料プランへのアップグレードが必要です。"
+ }
+ },
"plan": {
"title": "プラン",
"current": "現在",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index a1718875b..9e5d3c2da 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -2235,7 +2235,8 @@
"sections": {
"calendar": "Calendário",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "Chaves de API",
@@ -2257,6 +2258,25 @@
"proRequired": "Atualize para um plano pago para conectar o OpenWhispr ao Claude, ChatGPT e Cursor.",
"copied": "Copiado"
},
+ "cli": {
+ "title": "Acesso pela linha de comando",
+ "description": "Dê ao seu agente acesso às suas notas pelo terminal.",
+ "installLabel": "Instalar",
+ "learnMore": "Ler a documentação",
+ "copyDocsLink": "Copiar link da documentação",
+ "docsLinkCopied": "Link da documentação copiado",
+ "viewPlans": "Ver planos",
+ "local": {
+ "label": "Local",
+ "freeBadge": "Grátis",
+ "description": "Leia suas notas locais diretamente. Sem login ou chave de API — funciona enquanto o OpenWhispr estiver aberto."
+ },
+ "cloud": {
+ "label": "Nuvem",
+ "description": "Sincronize entre máquinas usando sua chave de API.",
+ "proRequired": "Atualize para um plano pago para usar a CLI no modo nuvem."
+ }
+ },
"plan": {
"title": "Seu Plano",
"current": "Atual",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index a791fee6f..0efeb5eb1 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -2237,7 +2237,8 @@
"sections": {
"calendar": "Календарь",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "API-ключи",
@@ -2259,6 +2260,25 @@
"proRequired": "Перейдите на платный план, чтобы подключить OpenWhispr к Claude, ChatGPT и Cursor.",
"copied": "Скопировано"
},
+ "cli": {
+ "title": "Доступ через командную строку",
+ "description": "Дайте своему агенту доступ к заметкам из терминала.",
+ "installLabel": "Установить",
+ "learnMore": "Открыть документацию",
+ "copyDocsLink": "Скопировать ссылку на документацию",
+ "docsLinkCopied": "Ссылка на документацию скопирована",
+ "viewPlans": "Посмотреть планы",
+ "local": {
+ "label": "Локально",
+ "freeBadge": "Бесплатно",
+ "description": "Читайте свои локальные заметки напрямую. Без входа в аккаунт и API-ключа — работает, пока OpenWhispr запущен."
+ },
+ "cloud": {
+ "label": "Облако",
+ "description": "Синхронизируйте устройства с помощью API-ключа.",
+ "proRequired": "Перейдите на платный план, чтобы использовать CLI в облачном режиме."
+ }
+ },
"plan": {
"title": "Ваш план",
"current": "Текущий",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 55a9f276d..d995bfb93 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1067,7 +1067,12 @@
"annualEquivalent": "$16.67",
"includesPrefix": "所有 Pro 功能 +",
"badge": "最受欢迎",
- "features": ["无限会议录制", "代理模式", "与您的数据对话", "优先支持"],
+ "features": [
+ "无限会议录制",
+ "代理模式",
+ "与您的数据对话",
+ "优先支持"
+ ],
"cta": "开始使用",
"switchToAnnual": "切换为年付"
},
@@ -2230,7 +2235,8 @@
"sections": {
"calendar": "日历",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "API 密钥",
@@ -2252,6 +2258,25 @@
"proRequired": "升级到付费计划,以将 OpenWhispr 连接到 Claude、ChatGPT 和 Cursor。",
"copied": "已复制"
},
+ "cli": {
+ "title": "命令行访问",
+ "description": "让你的智能助手通过终端访问你的笔记。",
+ "installLabel": "安装",
+ "learnMore": "查看文档",
+ "copyDocsLink": "复制文档链接",
+ "docsLinkCopied": "已复制文档链接",
+ "viewPlans": "查看套餐",
+ "local": {
+ "label": "本地",
+ "freeBadge": "免费",
+ "description": "直接读取你的本地笔记。无需登录或 API 密钥 — 在 OpenWhispr 运行时即可使用。"
+ },
+ "cloud": {
+ "label": "云端",
+ "description": "使用 API 密钥在多台设备之间同步。",
+ "proRequired": "升级到付费计划以在云端模式下使用 CLI。"
+ }
+ },
"plan": {
"title": "您的方案",
"current": "当前",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 44b46cac3..9945f9c86 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1067,7 +1067,12 @@
"annualEquivalent": "$16.67",
"includesPrefix": "所有 Pro 功能 +",
"badge": "最熱門",
- "features": ["無限會議錄製", "代理模式", "與您的資料對話", "優先支援"],
+ "features": [
+ "無限會議錄製",
+ "代理模式",
+ "與您的資料對話",
+ "優先支援"
+ ],
"cta": "開始使用",
"switchToAnnual": "切換為年付"
},
@@ -2230,7 +2235,8 @@
"sections": {
"calendar": "行事曆",
"api": "API",
- "mcp": "MCP"
+ "mcp": "MCP",
+ "cli": "CLI"
},
"api": {
"title": "API 金鑰",
@@ -2252,6 +2258,25 @@
"proRequired": "升級到付費方案,以將 OpenWhispr 連接到 Claude、ChatGPT 和 Cursor。",
"copied": "已複製"
},
+ "cli": {
+ "title": "命令列存取",
+ "description": "讓你的智慧助手透過終端機存取你的筆記。",
+ "installLabel": "安裝",
+ "learnMore": "查看文件",
+ "copyDocsLink": "複製文件連結",
+ "docsLinkCopied": "已複製文件連結",
+ "viewPlans": "查看方案",
+ "local": {
+ "label": "本機",
+ "freeBadge": "免費",
+ "description": "直接讀取你的本機筆記。無需登入或 API 金鑰 — OpenWhispr 執行時即可使用。"
+ },
+ "cloud": {
+ "label": "雲端",
+ "description": "使用 API 金鑰在多台裝置間同步。",
+ "proRequired": "升級到付費方案以在雲端模式下使用 CLI。"
+ }
+ },
"plan": {
"title": "您的方案",
"current": "目前",
diff --git a/src/stores/meetingRecordingStore.ts b/src/stores/meetingRecordingStore.ts
index ca07dc2d6..83e1c8a5a 100644
--- a/src/stores/meetingRecordingStore.ts
+++ b/src/stores/meetingRecordingStore.ts
@@ -1027,9 +1027,16 @@ export async function startRecording(args: StartRecordingArgs): Promise<void> {
micSource = source;
micProcessor = processor;
+ // AnalyserNode must reach the destination for Chrome's pull-based
+ // renderer to update its internal buffer; route through a muted gain.
const analyser = ctx.createAnalyser();
analyser.fftSize = 256;
+ analyser.smoothingTimeConstant = 0.4;
+ const analyserSink = ctx.createGain();
+ analyserSink.gain.value = 0;
source.connect(analyser);
+ analyser.connect(analyserSink);
+ analyserSink.connect(ctx.destination);
micAnalyser = analyser;
const micTrack = micResult.getAudioTracks()[0];
diff --git a/src/workers/onnxWorker.js b/src/workers/onnxWorker.js
index 20adc281e..3c56feaf3 100644
--- a/src/workers/onnxWorker.js
+++ b/src/workers/onnxWorker.js
@@ -2,6 +2,21 @@ const fs = require("fs");
const os = require("os");
const path = require("path");
+let logStream = null;
+
+function openLog() {
+ const logPath = process.env.OPENWHISPR_ONNX_WORKER_LOG;
+ if (!logPath) return;
+ try {
+ fs.mkdirSync(path.dirname(logPath), { recursive: true });
+ logStream = fs.createWriteStream(logPath, { flags: "a" });
+ } catch {
+ logStream = null;
+ }
+}
+
+openLog();
+
const FBANK_SAMPLE_RATE = 16000;
const FBANK_FRAME_LENGTH_MS = 25;
const FBANK_FRAME_SHIFT_MS = 10;
@@ -23,7 +38,6 @@ let speakerSession = null;
let speakerInputName = null;
let textSession = null;
let textTokenizer = null;
-let logStream = null;
function log(level, message, extra) {
if (!logStream) return;
@@ -41,17 +55,6 @@ function log(level, message, extra) {
}
}
-function openLog() {
- const logPath = process.env.OPENWHISPR_ONNX_WORKER_LOG;
- if (!logPath) return;
- try {
- fs.mkdirSync(path.dirname(logPath), { recursive: true });
- logStream = fs.createWriteStream(logPath, { flags: "a" });
- } catch {
- logStream = null;
- }
-}
-
function loadOrt() {
if (ort) return;
ort = require("onnxruntime-node");
@@ -364,6 +367,22 @@ async function dispatch({ id, method, payload }) {
}
}
+process.on("uncaughtException", (err) => {
+ log("fatal", "uncaughtException", { error: err?.message, stack: err?.stack });
+ process.stderr.write(`onnx worker uncaughtException: ${err?.stack || err?.message}\n`);
+ process.exit(1);
+});
+process.on("unhandledRejection", (err) => {
+ log("fatal", "unhandledRejection", { error: err?.message, stack: err?.stack });
+ process.stderr.write(`onnx worker unhandledRejection: ${err?.stack || err?.message}\n`);
+ process.exit(1);
+});
+
+if (!process.parentPort) {
+ process.stderr.write("onnx worker: process.parentPort is undefined\n");
+ process.exit(1);
+}
+
process.parentPort.once("message", ({ data, ports }) => {
if (data === "init" && ports?.length) {
port = ports[0];
@@ -381,13 +400,4 @@ process.parentPort.once("message", ({ data, ports }) => {
}
});
-process.on("uncaughtException", (err) => {
- log("fatal", "uncaughtException", { error: err?.message, stack: err?.stack });
- process.exit(1);
-});
-process.on("unhandledRejection", (err) => {
- log("fatal", "unhandledRejection", { error: err?.message, stack: err?.stack });
- process.exit(1);
-});
-
-openLog();
+log("info", "worker boot", { intraOpNumThreads, pid: process.pid });