Skip to content

The agent that grows with you

feat(desktop): first-run shared-metrics consent and Settings › Privacy toggles

teknium1520f0e9ed5e4
diff --git a/apps/desktop/src/app/contrib/wiring.tsx b/apps/desktop/src/app/contrib/wiring.tsx
index 2ff8b9eab51..43d8ded5d70 100644
--- a/apps/desktop/src/app/contrib/wiring.tsx
+++ b/apps/desktop/src/app/contrib/wiring.tsx
@@ -34,6 +34,7 @@ import {
import { FloatingPet } from '@/components/pet/floating-pet'
import { RemoteDisplayBanner } from '@/components/remote-display-banner'
import { SendDiagnosticsHost } from '@/components/send-diagnostics-dialog'
+import { SharedMetricsConsentDialog } from '@/components/shared-metrics/consent-dialog'
import { TipHost } from '@/components/tips'
import { emitGatewayEvent } from '@/contrib/events'
import { translateNow } from '@/i18n'
@@ -1352,6 +1353,13 @@ export function ContribWiring({ children }: { children: ReactNode }) {
requestGateway={requestGateway}
/>
)}
+ {!isAuxiliaryWindow() && (
+ <SharedMetricsConsentDialog
+ enabled={gatewayState === 'open'}
+ profile={activeGatewayProfile}
+ requestGateway={requestGateway}
+ />
+ )}
{/* One host for every free-tier sign-in entry point (Settings › Billing,
the statusbar chip, the first-launch intro). It owns the flow; the
entry points only record the intent. */}
diff --git a/apps/desktop/src/app/settings/config-settings.tsx b/apps/desktop/src/app/settings/config-settings.tsx
index 085e6a21186..0af976ed781 100644
--- a/apps/desktop/src/app/settings/config-settings.tsx
+++ b/apps/desktop/src/app/settings/config-settings.tsx
@@ -53,6 +53,7 @@ import { EmptyState, ListRow, SettingsContent, SettingsSkeleton, ToggleRow } fro
import { SettingsProfileScope } from './profile-scope'
import { QuickEntrySettings } from './quick-entry-settings'
import { SETTING_IDS, settingElementId } from './settings-manifest'
+import { SharedMetricsSettings } from './shared-metrics-settings'
import { useSettingDeepLink } from './use-setting-deep-link'
export function ConfigSettings({
@@ -300,6 +301,7 @@ function ConfigSettingsInner({
const showDesktopSettings = activeSectionId === 'advanced' && (subpage === undefined || subpage === 'desktop')
const showAttachments = activeSectionId === 'chat' && (subpage === undefined || subpage === 'attachments')
+ const showSharedMetrics = activeSectionId === 'safety' && subpage === 'privacy'
// Deep-link target from the command palette (?field=<key>): scroll the row
// into view and flash it, then drop the param so it doesn't re-fire.
@@ -432,7 +434,7 @@ function ConfigSettingsInner({
visibleFields.length === 0 &&
(subpage === undefined
? activeSectionId !== 'chat'
- : !showModelSettings && !showDesktopSettings && !showAttachments)
+ : !showModelSettings && !showDesktopSettings && !showAttachments && !showSharedMetrics)
return renderPage(
<>
@@ -469,6 +471,9 @@ function ConfigSettingsInner({
where image-attachment behavior already lives, so this sits above the
schema fields for that section. */}
{showAttachments ? <AttachmentSizeSetting /> : null}
+ {/* Shared metrics are two coupled opt-ins with a consent side effect, so they
+ go through their own RPC rather than the generic field autosave. */}
+ {showSharedMetrics ? <SharedMetricsSettings /> : null}
{activeSectionId === 'voice' ? (
<ListRow description={c.voiceShortcutHintDesc} title={c.voiceShortcutHintTitle} />
) : null}
diff --git a/apps/desktop/src/app/settings/shared-metrics-settings.tsx b/apps/desktop/src/app/settings/shared-metrics-settings.tsx
new file mode 100644
index 00000000000..d6090e34029
--- /dev/null
+++ b/apps/desktop/src/app/settings/shared-metrics-settings.tsx
@@ -0,0 +1,97 @@
+import { useStore } from '@nanostores/react'
+import { useCallback, useEffect, useState } from 'react'
+
+import { DocsLink } from '@/components/onboarding/flow'
+import { useI18n } from '@/i18n'
+import { $activeConnectionId } from '@/store/connections'
+import { requestGatewayForAgent } from '@/store/gateway'
+import { notifyError } from '@/store/notifications'
+import { $settingsScopeProfile } from '@/store/settings-scope'
+import {
+ readSharedMetricsConsent,
+ saveSharedMetricsConsent,
+ SHARED_METRICS_DOCS_URL,
+ type SharedMetricsConsent
+} from '@/store/shared-metrics'
+
+import { ToggleRow } from './primitives'
+
+/**
+ * Settings › Safety › Privacy: the same two opt-ins the first-run dialog and
+ * `hermes setup` write, for the profile this page applies to. Collection off
+ * turns sending off with it (the backend enforces it too), so the send switch
+ * is disabled until collection is on. Optimistic, rolled back on failure.
+ */
+export function SharedMetricsSettings() {
+ const { t } = useI18n()
+ const copy = t.sharedMetrics
+ const scopeProfile = useStore($settingsScopeProfile)
+ const connectionId = useStore($activeConnectionId)
+ const [consent, setConsent] = useState<SharedMetricsConsent | null>(null)
+ const [loaded, setLoaded] = useState(false)
+ const [busy, setBusy] = useState(false)
+
+ const request = useCallback(
+ <T,>(method: string, params: Record<string, unknown> = {}) =>
+ requestGatewayForAgent<T>(connectionId, scopeProfile, method, params, undefined, undefined, {
+ spawnPriority: 'foreground'
+ }),
+ [connectionId, scopeProfile]
+ )
+
+ useEffect(() => {
+ let cancelled = false
+
+ setLoaded(false)
+ void readSharedMetricsConsent(request).then(next => {
+ if (!cancelled) {
+ setConsent(next)
+ setLoaded(true)
+ }
+ })
+
+ return () => void (cancelled = true)
+ }, [request])
+
+ const save = async (flags: { enabled: boolean; send: boolean }) => {
+ const previous = consent
+
+ setBusy(true)
+ setConsent({ ...flags, send: flags.enabled && flags.send, decided: true })
+
+ try {
+ setConsent(await saveSharedMetricsConsent(request, flags))
+ } catch (err) {
+ setConsent(previous)
+ notifyError(err, copy.saveFailed)
+ } finally {
+ setBusy(false)
+ }
+ }
+
+ // An older backend has no shared_metrics.* methods: keep the controls, disabled and explained.
+ const unavailable = loaded && consent === null
+ const enabled = consent?.enabled ?? false
+ const send = consent?.send ?? false
+
+ return (
+ <div className="grid gap-1" id="setting-shared-metrics">
+ <ToggleRow
+ checked={enabled}
+ description={copy.collectDesc}
+ disabled={!consent || busy}
+ hint={unavailable ? copy.unavailable : undefined}
+ label={copy.collectLabel}
+ onChange={on => void save({ enabled: on, send: on && send })}
+ />
+ <ToggleRow
+ below={<DocsLink href={SHARED_METRICS_DOCS_URL}>{copy.whatIsCollected}</DocsLink>}
+ checked={send}
+ description={copy.sendDesc}
+ disabled={!consent || busy || !enabled}
+ label={copy.sendLabel}
+ onChange={on => void save({ enabled, send: on })}
+ />
+ </div>
+ )
+}
diff --git a/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsx b/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsx
new file mode 100644
index 00000000000..4ed954d6cda
--- /dev/null
+++ b/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsx
@@ -0,0 +1,69 @@
+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { afterEach, beforeEach, describe, expect, it } from 'vitest'
+
+import { en } from '@/i18n/en'
+import { $desktopOnboarding } from '@/store/onboarding'
+import type { SharedMetricsConsent } from '@/store/shared-metrics'
+
+import { SharedMetricsConsentDialog } from './consent-dialog'
+
+const copy = en.sharedMetrics
+
+function backend(initial: SharedMetricsConsent) {
+ const calls: { method: string; params?: Record<string, unknown> }[] = []
+ let stored = initial
+
+ const requestGateway = async <T,>(method: string, params?: Record<string, unknown>): Promise<T> => {
+ calls.push({ method, params })
+
+ if (method === 'shared_metrics.set') {
+ const enabled = params?.enabled === true
+ stored = { enabled, send: enabled && params?.send === true, decided: true }
+ }
+
+ return stored as T
+ }
+
+ return { calls, requestGateway }
+}
+
+const initialOnboarding = $desktopOnboarding.get()
+
+beforeEach(() => {
+ $desktopOnboarding.set({ ...initialOnboarding, configured: true })
+})
+
+afterEach(() => {
+ cleanup()
+ $desktopOnboarding.set(initialOnboarding)
+})
+
+describe('SharedMetricsConsentDialog', () => {
+ it('stays hidden when the profile already answered (e.g. in hermes setup)', async () => {
+ const { calls, requestGateway } = backend({ enabled: false, send: false, decided: true })
+
+ render(<SharedMetricsConsentDialog enabled profile="default" requestGateway={requestGateway} />)
+
+ await waitFor(() => expect(calls.map(c => c.method)).toContain('shared_metrics.status'))
+ expect(screen.queryByText(copy.consentTitle)).toBeNull()
+ })
+
+ it('asks an undecided profile once and records the answer as both opt-ins', async () => {
+ const { calls, requestGateway } = backend({ enabled: false, send: false, decided: false })
+
+ render(<SharedMetricsConsentDialog enabled profile="default" requestGateway={requestGateway} />)
+
+ const keepLocal = await screen.findByRole('button', { name: copy.local })
+ // Nothing is preselected: no choice holds focus when the dialog opens.
+ expect(keepLocal.ownerDocument.activeElement).not.toBe(keepLocal)
+
+ fireEvent.click(keepLocal)
+
+ await waitFor(() => expect(screen.queryByText(copy.consentTitle)).toBeNull())
+ expect(calls.find(c => c.method === 'shared_metrics.set')?.params).toEqual({
+ enabled: true,
+ send: false,
+ first_run: true
+ })
+ })
+})
diff --git a/apps/desktop/src/components/shared-metrics/consent-dialog.tsx b/apps/desktop/src/components/shared-metrics/consent-dialog.tsx
new file mode 100644
index 00000000000..a4b53fd5798
--- /dev/null
+++ b/apps/desktop/src/components/shared-metrics/consent-dialog.tsx
@@ -0,0 +1,161 @@
+import { useStore } from '@nanostores/react'
+import { useEffect, useId, useState } from 'react'
+
+import { DocsLink } from '@/components/onboarding/flow'
+import { Button } from '@/components/ui/button'
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+ preventCloseButtonAutoFocus
+} from '@/components/ui/dialog'
+import { useI18n } from '@/i18n'
+import { ChevronDown } from '@/lib/icons'
+import { cn } from '@/lib/utils'
+import { $introReveal } from '@/store/intro-reveal'
+import { notifyError } from '@/store/notifications'
+import { $desktopOnboarding } from '@/store/onboarding'
+import { $onboardingSurfaces } from '@/store/onboarding-presence'
+import {
+ readSharedMetricsConsent,
+ saveSharedMetricsConsent,
+ SHARED_METRICS_CHOICES,
+ SHARED_METRICS_DOCS_URL,
+ type SharedMetricsChoice,
+ type SharedMetricsConsent,
+ type SharedMetricsRequester
+} from '@/store/shared-metrics'
+
+interface SharedMetricsConsentDialogProps {
+ /** The focused gateway is open. */
+ enabled: boolean
+ /** Re-ask per profile: each profile keeps its own opt-ins and install ID. */
+ profile: string
+ requestGateway: SharedMetricsRequester
+}
+
+const CHOICE_ORDER: readonly SharedMetricsChoice[] = ['share', 'local', 'off']
+
+/**
+ * The one-time shared-metrics question, the Desktop twin of `hermes setup`'s
+ * Shared Metrics section. It waits until first-run onboarding is out of the way
+ * and asks only when the profile's config.yaml carries no answer yet — an
+ * answer given in the CLI (or here, or in Settings) is the same config keys,
+ * so nobody is asked twice. Three equal choices, none preselected or focused;
+ * Esc is the refusal and is recorded like "No thanks".
+ */
+export function SharedMetricsConsentDialog({ enabled, profile, requestGateway }: SharedMetricsConsentDialogProps) {
+ const { t } = useI18n()
+ const copy = t.sharedMetrics
+ const onboarding = useStore($desktopOnboarding)
+ const intro = useStore($introReveal)
+ const surfaces = useStore($onboardingSurfaces)
+ const detailsId = useId()
+ const [consent, setConsent] = useState<SharedMetricsConsent | null>(null)
+ const [expanded, setExpanded] = useState(false)
+ const [saving, setSaving] = useState(false)
+
+ // Never over the provider picker, the free-tier welcome, the intro film or
+ // the guided chat: the question belongs to the moment after setup.
+ const onboardingSettled =
+ (onboarding.configured === true || onboarding.firstRunSkipped) &&
+ !onboarding.manual &&
+ !onboarding.freeTierReady &&
+ intro.phase === 'hidden' &&
+ surfaces.size === 0
+
+ const ready = enabled && onboardingSettled
+
+ useEffect(() => {
+ if (!ready) {
+ return
+ }
+
+ let cancelled = false
+
+ setConsent(null)
+ void readSharedMetricsConsent(requestGateway).then(next => {
+ if (!cancelled) {
+ setConsent(next)
+ }
+ })
+
+ return () => void (cancelled = true)
+ }, [ready, profile, requestGateway])
+
+ if (!ready || !consent || consent.decided) {
+ return null
+ }
+
+ const choose = async (choice: SharedMetricsChoice) => {
+ if (saving) {
+ return
+ }
+
+ setSaving(true)
+
+ try {
+ setConsent(await saveSharedMetricsConsent(requestGateway, SHARED_METRICS_CHOICES[choice], { firstRun: true }))
+ } catch (err) {
+ notifyError(err, copy.saveFailed)
+ } finally {
+ setSaving(false)
+ }
+ }
+
+ return (
+ <Dialog onOpenChange={open => !open && void choose('off')} open>
+ <DialogContent className="max-w-md" onOpenAutoFocus={preventCloseButtonAutoFocus}>
+ <DialogHeader>
+ <DialogTitle>{copy.consentTitle}</DialogTitle>
+ <DialogDescription>{copy.consentBody}</DialogDescription>
+ </DialogHeader>
+
+ <div className="grid gap-2">
+ <button
+ aria-controls={detailsId}
+ aria-expanded={expanded}
+ className="flex w-fit items-center gap-1 text-sm font-medium text-(--ui-text-secondary) hover:text-(--ui-text-primary)"
+ onClick={() => setExpanded(value => !value)}
+ type="button"
+ >
+ <ChevronDown className={cn('size-3.5 transition-transform', expanded ? 'rotate-0' : '-rotate-90')} />
+ {copy.whatIsCollected}
+ </button>
+ {expanded ? (
+ <div
+ className="grid gap-2 rounded-lg bg-(--ui-bg-tertiary)/40 px-3 py-2.5 text-[0.8125rem] leading-5 text-(--ui-text-secondary)"
+ id={detailsId}
+ >
+ <p>{copy.collectedIntro}</p>
+ <ul className="list-disc space-y-0.5 pl-5">
+ <li>{copy.collectedActivity}</li>
+ <li>{copy.collectedModels}</li>
+ <li>{copy.collectedNames}</li>
+ <li>{copy.collectedMilestones}</li>
+ <li>{copy.collectedConfig}</li>
+ </ul>
+ <p className="font-medium text-(--ui-text-primary)">{copy.neverCollected}</p>
+ <p>{copy.installId}</p>
+ <p>{copy.consentWindow}</p>
+ <div>
+ <DocsLink href={SHARED_METRICS_DOCS_URL}>{copy.readDocs}</DocsLink>
+ </div>
+ </div>
+ ) : null}
+ </div>
+
+ <div className="grid gap-2">
+ {CHOICE_ORDER.map(choice => (
+ <Button disabled={saving} key={choice} onClick={() => void choose(choice)} type="button" variant="outline">
+ {copy[choice]}
+ </Button>
+ ))}
+ </div>
+ <p className="text-xs text-(--ui-text-tertiary)">{copy.changeLater}</p>
+ </DialogContent>
+ </Dialog>
+ )
+}
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 8db8a519bce..aab7cefa57d 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -1,6 +1,33 @@
import { defineLocale } from './define-locale'
export const ar = defineLocale({
+ sharedMetrics: {
+ consentTitle: 'هل تساعد في تحسين Hermes؟',
+ consentBody:
+ 'يمكن لـ Hermes إحصاء طريقة استخدامه — وليس ما تقوله أبدًا — وإرسال ملخص يومي إلى Nous Research إذا اخترت ذلك. لا تتم مشاركة أي شيء ما لم تختره هنا.',
+ whatIsCollected: 'ما الذي يُجمع',
+ collectedIntro: 'عدّادات محدودة فقط، مثل:',
+ collectedActivity: 'النشاط والجلسات والنتائج وأنواع الأخطاء',
+ collectedModels: 'أسماء النماذج والمزوّدين وأحجام الرموز',
+ collectedNames: 'أسماء الأدوات والأوامر والمهارات المدمجة',
+ collectedMilestones: 'مراحل الإعداد واستخدام الميزات',
+ collectedConfig: 'ملخص يومي لإعداداتك (أعداد فقط)',
+ neverCollected: 'لا يشمل أبدًا مطالباتك أو الردود أو الملفات أو المسارات أو نصوص الأخطاء.',
+ installId: 'تحمل الملخصات معرّف تثبيت عشوائيًا أُنشئ لهذا الملف الشخصي، ولا يحدد هويتك.',
+ consentWindow: 'لا تُرسل إلا البيانات المسجلة أثناء تفعيل المشاركة. يمكنك إيقافها في أي وقت.',
+ readDocs: 'اقرأ التفاصيل الكاملة',
+ share: 'مشاركة إحصاءات الاستخدام مع Nous',
+ local: 'الاحتفاظ بها على هذا الجهاز فقط',
+ off: 'لا، شكرًا',
+ changeLater: 'يمكنك تغيير ذلك في أي وقت من الإعدادات ← الأمان.',
+ saveFailed: 'تعذّر حفظ اختيارك',
+ collectLabel: 'جمع إحصاءات الاستخدام',
+ collectDesc:
+ 'الاحتفاظ بعدّادات استخدام محدودة على هذا الجهاز. دون مطالبات أو ردود أو ملفات أو مسارات أو نصوص أخطاء.',
+ sendLabel: 'إرسال إحصاءات الاستخدام إلى Nous',
+ sendDesc: 'رفع ملخص يومي إلى Nous Research للمساعدة في تحسين Hermes. يتطلب تفعيل الجمع.',
+ unavailable: 'حدّث واجهة Hermes الخلفية لتغيير هذا الإعداد.'
+ },
externalOpenFailed: {
title: 'تعذّر فتح هذا الرابط',
message: 'لا يوجد متصفح مسجل لفتح هذا العنوان. انسخ الرابط وافتحه يدويًا.',
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index 4675d1a30d0..99326df5552 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -4,6 +4,36 @@ import { defineLocale, type TranslationOverrides } from './define-locale'
import { introDe } from './intro-de'
export const deOverrides = {
+ sharedMetrics: {
+ consentTitle: 'Hermes verbessern helfen?',
+ consentBody:
+ 'Hermes kann zählen, wie es genutzt wird – nie, was Sie schreiben – und auf Wunsch eine tägliche Zusammenfassung an Nous Research senden. Nichts wird geteilt, solange Sie es hier nicht auswählen.',
+ whatIsCollected: 'Was erfasst wird',
+ collectedIntro: 'Nur begrenzte Zähler, zum Beispiel:',
+ collectedActivity: 'Aktivität, Sessions, Ergebnisse und Fehlerarten',
+ collectedModels: 'Modell- und Anbieternamen sowie Token-Mengen',
+ collectedNames: 'Namen integrierter Tools, Befehle und Skills',
+ collectedMilestones: 'Meilensteine bei Einrichtung und Funktionen',
+ collectedConfig: 'Eine tägliche Übersicht Ihrer Einrichtung (nur Anzahlen)',
+ neverCollected: 'Niemals Ihre Prompts, Antworten, Dateien, Pfade oder Fehlertexte.',
+ installId:
+ 'Zusammenfassungen tragen eine zufällige Installations-ID für dieses Profil. Sie identifiziert Sie nicht.',
+ consentWindow:
+ 'Gesendet werden nur Daten, die bei aktivierter Freigabe erfasst wurden. Sie können sie jederzeit abschalten.',
+ readDocs: 'Alle Details lesen',
+ share: 'Nutzungsstatistiken mit Nous teilen',
+ local: 'Nur auf diesem Gerät behalten',
+ off: 'Nein, danke',
+ changeLater: 'Sie können das jederzeit unter Einstellungen → Sicherheit ändern.',
+ saveFailed: 'Ihre Auswahl konnte nicht gespeichert werden',
+ collectLabel: 'Nutzungsstatistiken erfassen',
+ collectDesc:
+ 'Begrenzte Nutzungszähler auf diesem Gerät speichern. Nie Prompts, Antworten, Dateien, Pfade oder Fehlertexte.',
+ sendLabel: 'Nutzungsstatistiken an Nous senden',
+ sendDesc:
+ 'Täglich eine Zusammenfassung an Nous Research hochladen, um Hermes zu verbessern. Erfordert aktive Erfassung.',
+ unavailable: 'Aktualisieren Sie das Hermes-Backend, um diese Einstellung zu ändern.'
+ },
intro: introDe,
connectors: {
title: 'Verbinden Sie Ihre Apps',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 40867ead06c..da53ac9bdf7 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -13,6 +13,32 @@ export const en: Translations = {
message: 'This file does not exist — it may have been deleted or moved, or it lives on another machine.'
}
},
+ sharedMetrics: {
+ consentTitle: 'Help improve Hermes?',
+ consentBody:
+ 'Hermes can count how it is used — never what you say — and, if you choose, send a daily summary to Nous Research. Nothing is shared unless you pick it here.',
+ whatIsCollected: 'What is collected',
+ collectedIntro: 'Only bounded counters, such as:',
+ collectedActivity: 'Activity, sessions, outcomes and error types',
+ collectedModels: 'Model and provider names, and token volumes',
+ collectedNames: 'Names of built-in tools, commands and skills',
+ collectedMilestones: 'Setup and feature milestones',
+ collectedConfig: 'A daily summary of your setup (counts only)',
+ neverCollected: 'Never your prompts, responses, files, paths or error text.',
+ installId: 'Summaries carry a random install ID made for this profile. It does not identify you.',
+ consentWindow: 'Only data recorded while sharing is on is ever sent. You can turn it off any time.',
+ readDocs: 'Read the full details',
+ share: 'Share usage stats with Nous',
+ local: 'Keep them on this device',
+ off: 'No thanks',
+ changeLater: 'You can change this any time in Settings → Safety.',
+ saveFailed: 'Couldn’t save your choice',
+ collectLabel: 'Collect usage stats',
+ collectDesc: 'Keep bounded usage counters on this device. Never prompts, responses, files, paths or error text.',
+ sendLabel: 'Send usage stats to Nous',
+ sendDesc: 'Upload a daily summary to Nous Research to help improve Hermes. Needs collection on.',
+ unavailable: 'Update the Hermes backend to change this setting.'
+ },
// English editorial copy stays in the shipped JSONL; other locales override it.
intro: { stock: {}, custom: () => [] },
catalog: {
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index 4373b06fb82..ae55e8336df 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -4,6 +4,34 @@ import { defineLocale, type TranslationOverrides } from './define-locale'
import { introEs } from './intro-es'
export const esOverrides = {
+ sharedMetrics: {
+ consentTitle: '¿Nos ayudas a mejorar Hermes?',
+ consentBody:
+ 'Hermes puede contar cómo se usa —nunca lo que escribes— y, si lo eliges, enviar un resumen diario a Nous Research. No se comparte nada a menos que lo elijas aquí.',
+ whatIsCollected: 'Qué se recopila',
+ collectedIntro: 'Solo contadores acotados, como:',
+ collectedActivity: 'Actividad, sesiones, resultados y tipos de error',
+ collectedModels: 'Nombres de modelos y proveedores, y volumen de tokens',
+ collectedNames: 'Nombres de herramientas, comandos y habilidades integrados',
+ collectedMilestones: 'Hitos de configuración y de uso de funciones',
+ collectedConfig: 'Un resumen diario de tu configuración (solo recuentos)',
+ neverCollected: 'Nunca tus prompts, respuestas, archivos, rutas ni textos de error.',
+ installId: 'Los resúmenes llevan un ID de instalación aleatorio creado para este perfil. No te identifica.',
+ consentWindow:
+ 'Solo se envían los datos registrados mientras compartir está activado. Puedes desactivarlo cuando quieras.',
+ readDocs: 'Leer todos los detalles',
+ share: 'Compartir estadísticas de uso con Nous',
+ local: 'Guardarlas solo en este dispositivo',
+ off: 'No, gracias',
+ changeLater: 'Puedes cambiarlo cuando quieras en Ajustes → Seguridad.',
+ saveFailed: 'No se pudo guardar tu elección',
+ collectLabel: 'Recopilar estadísticas de uso',
+ collectDesc:
+ 'Guarda contadores de uso acotados en este dispositivo. Nunca prompts, respuestas, archivos, rutas ni textos de error.',
+ sendLabel: 'Enviar estadísticas de uso a Nous',
+ sendDesc: 'Sube un resumen diario a Nous Research para ayudar a mejorar Hermes. Requiere la recopilación activada.',
+ unavailable: 'Actualiza el backend de Hermes para cambiar este ajuste.'
+ },
intro: introEs,
connectors: {
title: 'Conecta tus apps',
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index 2c22d87b9d5..fbacc36404f 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -4,6 +4,36 @@ import { defineLocale, type TranslationOverrides } from './define-locale'
import { introFr } from './intro-fr'
export const frOverrides = {
+ sharedMetrics: {
+ consentTitle: 'Aider à améliorer Hermes ?',
+ consentBody:
+ 'Hermes peut compter comment il est utilisé — jamais ce que vous écrivez — et, si vous le souhaitez, envoyer un résumé quotidien à Nous Research. Rien n’est partagé tant que vous ne le choisissez pas ici.',
+ whatIsCollected: 'Ce qui est collecté',
+ collectedIntro: 'Uniquement des compteurs bornés, par exemple :',
+ collectedActivity: 'Activité, sessions, résultats et types d’erreur',
+ collectedModels: 'Noms des modèles et fournisseurs, et volumes de tokens',
+ collectedNames: 'Noms des outils, commandes et compétences intégrés',
+ collectedMilestones: 'Étapes de configuration et d’utilisation des fonctionnalités',
+ collectedConfig: 'Un résumé quotidien de votre configuration (comptes uniquement)',
+ neverCollected: 'Jamais vos prompts, réponses, fichiers, chemins ni textes d’erreur.',
+ installId:
+ 'Les résumés portent un identifiant d’installation aléatoire créé pour ce profil. Il ne vous identifie pas.',
+ consentWindow:
+ 'Seules les données enregistrées pendant que le partage est actif sont envoyées. Vous pouvez le désactiver à tout moment.',
+ readDocs: 'Lire tous les détails',
+ share: 'Partager les statistiques d’utilisation avec Nous',
+ local: 'Les garder sur cet appareil',
+ off: 'Non merci',
+ changeLater: 'Vous pouvez changer cela à tout moment dans Réglages → Sécurité.',
+ saveFailed: 'Impossible d’enregistrer votre choix',
+ collectLabel: 'Collecter les statistiques d’utilisation',
+ collectDesc:
+ 'Conserver des compteurs d’utilisation bornés sur cet appareil. Jamais de prompts, réponses, fichiers, chemins ni textes d’erreur.',
+ sendLabel: 'Envoyer les statistiques d’utilisation à Nous',
+ sendDesc:
+ 'Envoyer chaque jour un résumé à Nous Research pour aider à améliorer Hermes. Nécessite la collecte activée.',
+ unavailable: 'Mettez à jour le backend Hermes pour modifier ce réglage.'
+ },
intro: introFr,
connectors: {
title: 'Connectez vos applications',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index bbb95184166..8912415c142 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -10,6 +10,35 @@ export const ja = defineLocale({
copyUrl: 'リンクをコピー',
close: '閉じる'
},
+ sharedMetrics: {
+ consentTitle: 'Hermes の改善に協力しますか?',
+ consentBody:
+ 'Hermes は使われ方を集計できます(話した内容は記録しません)。選択した場合は、1 日 1 回の概要を Nous Research に送信します。ここで選ばない限り、何も共有されません。',
+ whatIsCollected: '収集される内容',
+ collectedIntro: '上限付きのカウンターのみ。例:',
+ collectedActivity: 'アクティビティ、セッション、結果、エラーの種類',
+ collectedModels: 'モデル名とプロバイダー名、トークン量',
+ collectedNames: '組み込みツール、コマンド、スキルの名前',
+ collectedMilestones: 'セットアップと機能のマイルストーン',
+ collectedConfig: '設定の日次サマリー(件数のみ)',
+ neverCollected: 'プロンプト、応答、ファイル、パス、エラーテキストは一切含みません。',
+ installId:
+ '概要にはこのプロファイル用に作られたランダムなインストール ID が付きます。あなたを特定するものではありません。',
+ consentWindow: '共有がオンの間に記録されたデータだけが送信されます。いつでもオフにできます。',
+ readDocs: '詳細を読む',
+ share: '利用統計を Nous と共有する',
+ local: 'このデバイスにのみ保存する',
+ off: '共有しない',
+ changeLater: '設定 → 安全性 からいつでも変更できます。',
+ saveFailed: '選択を保存できませんでした',
+ collectLabel: '利用統計を収集する',
+ collectDesc:
+ '上限付きの利用カウンターをこのデバイスに保存します。プロンプト、応答、ファイル、パス、エラーテキストは含みません。',
+ sendLabel: '利用統計を Nous に送信する',
+ sendDesc:
+ 'Hermes の改善のため、1 日 1 回の概要を Nous Research にアップロードします。収集がオンである必要があります。',
+ unavailable: 'この設定を変更するには Hermes バックエンドを更新してください。'
+ },
intro: introJa,
catalog: {
add: '追加',
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 8632814ee62..9e18a7cfc54 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -24,6 +24,34 @@ const RU_NOUN = (count: number | string, one: string, few: string, many: string)
}
export const ru = defineLocale({
+ sharedMetrics: {
+ consentTitle: 'Помочь улучшить Hermes?',
+ consentBody:
+ 'Hermes может подсчитывать, как им пользуются, — но никогда не то, что вы пишете, — и, если вы согласитесь, раз в день отправлять сводку в Nous Research. Ничего не передаётся, пока вы не выберете это здесь.',
+ whatIsCollected: 'Что собирается',
+ collectedIntro: 'Только ограниченные счётчики, например:',
+ collectedActivity: 'Активность, сеансы, результаты и типы ошибок',
+ collectedModels: 'Названия моделей и провайдеров, объёмы токенов',
+ collectedNames: 'Названия встроенных инструментов, команд и навыков',
+ collectedMilestones: 'Этапы настройки и использования функций',
+ collectedConfig: 'Ежедневная сводка настроек (только количества)',
+ neverCollected: 'Никогда — ваши запросы, ответы, файлы, пути или тексты ошибок.',
+ installId:
+ 'Сводки содержат случайный идентификатор установки, созданный для этого профиля. Он не указывает на вас.',
+ consentWindow: 'Отправляются только данные, записанные, пока отправка включена. Её можно выключить в любой момент.',
+ readDocs: 'Подробнее',
+ share: 'Делиться статистикой с Nous',
+ local: 'Хранить только на этом устройстве',
+ off: 'Нет, спасибо',
+ changeLater: 'Это можно изменить в любой момент в разделе Настройки → Безопасность.',
+ saveFailed: 'Не удалось сохранить выбор',
+ collectLabel: 'Собирать статистику использования',
+ collectDesc:
+ 'Хранить ограниченные счётчики использования на этом устройстве. Без запросов, ответов, файлов, путей и текстов ошибок.',
+ sendLabel: 'Отправлять статистику в Nous',
+ sendDesc: 'Раз в день загружать сводку в Nous Research, чтобы улучшать Hermes. Требует включённого сбора.',
+ unavailable: 'Обновите бэкенд Hermes, чтобы изменить этот параметр.'
+ },
catalog: {
add: 'Добавить',
added: 'Добавлено',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 53e962cf71a..9fef6e82256 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -59,6 +59,32 @@ interface AuxTaskCopy {
}
export interface Translations {
+ /** Shared-metrics consent: first-run dialog + Settings › Safety toggles. */
+ sharedMetrics: {
+ consentTitle: string
+ consentBody: string
+ whatIsCollected: string
+ collectedIntro: string
+ collectedActivity: string
+ collectedModels: string
+ collectedNames: string
+ collectedMilestones: string
+ collectedConfig: string
+ neverCollected: string
+ installId: string
+ consentWindow: string
+ readDocs: string
+ share: string
+ local: string
+ off: string
+ changeLater: string
+ saveFailed: string
+ collectLabel: string
+ collectDesc: string
+ sendLabel: string
+ sendDesc: string
+ unavailable: string
+ }
externalOpenFailed: {
title: string
message: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index a5558ab69d5..6e19d0cbf85 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -10,6 +10,32 @@ export const zhHant = defineLocale({
copyUrl: '複製連結',
close: '關閉'
},
+ sharedMetrics: {
+ consentTitle: '協助改進 Hermes?',
+ consentBody:
+ 'Hermes 可以統計它的使用方式(絕不記錄你說的內容),並在你同意時每天向 Nous Research 傳送一份摘要。除非你在此選擇,否則不會分享任何內容。',
+ whatIsCollected: '收集哪些內容',
+ collectedIntro: '僅限有上限的計數,例如:',
+ collectedActivity: '活動、工作階段、結果和錯誤類型',
+ collectedModels: '模型與供應商名稱,以及 token 用量',
+ collectedNames: '內建工具、指令和技能的名稱',
+ collectedMilestones: '設定與功能里程碑',
+ collectedConfig: '每日設定摘要(僅計數)',
+ neverCollected: '絕不包含你的提示詞、回覆、檔案、路徑或錯誤文字。',
+ installId: '摘要附帶為此設定檔產生的隨機安裝 ID,它無法識別你的身分。',
+ consentWindow: '只會傳送在分享開啟期間記錄的資料。你可以隨時關閉。',
+ readDocs: '查看完整說明',
+ share: '與 Nous 分享使用統計',
+ local: '僅保存在此裝置上',
+ off: '不用了',
+ changeLater: '你可以隨時在 設定 → 安全性 中變更。',
+ saveFailed: '無法儲存你的選擇',
+ collectLabel: '收集使用統計',
+ collectDesc: '在此裝置上保存有上限的使用計數。絕不包含提示詞、回覆、檔案、路徑或錯誤文字。',
+ sendLabel: '向 Nous 傳送使用統計',
+ sendDesc: '每天向 Nous Research 上傳摘要,協助改進 Hermes。需要先開啟收集。',
+ unavailable: '請更新 Hermes 後端以變更此設定。'
+ },
intro: introZhHant,
catalog: {
add: '新增',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 3fbdd973ce7..89c0848a71a 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -10,6 +10,32 @@ export const zh = defineLocale({
copyUrl: '复制链接',
close: '关闭'
},
+ sharedMetrics: {
+ consentTitle: '帮助改进 Hermes?',
+ consentBody:
+ 'Hermes 可以统计它的使用方式(绝不记录你说的内容),并在你同意时每天向 Nous Research 发送一份摘要。除非你在此选择,否则不会共享任何内容。',
+ whatIsCollected: '收集哪些内容',
+ collectedIntro: '仅限有上限的计数,例如:',
+ collectedActivity: '活动、会话、结果和错误类型',
+ collectedModels: '模型与提供商名称,以及 token 用量',
+ collectedNames: '内置工具、命令和技能的名称',
+ collectedMilestones: '设置与功能里程碑',
+ collectedConfig: '每日配置摘要(仅计数)',
+ neverCollected: '绝不包含你的提示词、回复、文件、路径或错误文本。',
+ installId: '摘要附带为此配置文件生成的随机安装 ID,它无法识别你的身份。',
+ consentWindow: '只会发送在共享开启期间记录的数据。你可以随时关闭。',
+ readDocs: '查看完整说明',
+ share: '与 Nous 共享使用统计',
+ local: '仅保存在此设备上',
+ off: '不用了',
+ changeLater: '你可以随时在 设置 → 安全 中更改。',
+ saveFailed: '无法保存你的选择',
+ collectLabel: '收集使用统计',
+ collectDesc: '在此设备上保存有上限的使用计数。绝不包含提示词、回复、文件、路径或错误文本。',
+ sendLabel: '向 Nous 发送使用统计',
+ sendDesc: '每天向 Nous Research 上传摘要,帮助改进 Hermes。需要先开启收集。',
+ unavailable: '请更新 Hermes 后端以更改此设置。'
+ },
intro: introZh,
catalog: {
add: '添加',
diff --git a/apps/desktop/src/store/shared-metrics.ts b/apps/desktop/src/store/shared-metrics.ts
new file mode 100644
index 00000000000..a584179c172
--- /dev/null
+++ b/apps/desktop/src/store/shared-metrics.ts
@@ -0,0 +1,53 @@
+import type { SharedMetricsConsentResult } from '@hermes/shared'
+
+/** Public page describing exactly what shared metrics contain and how consent windows work. */
+export const SHARED_METRICS_DOCS_URL = 'https://hermes-agent.nousresearch.com/docs/developer-guide/relay-shared-metrics'
+
+export type SharedMetricsConsent = SharedMetricsConsentResult
+
+/** The first-run answers, as the two config opt-ins `hermes setup` writes. */
+export type SharedMetricsChoice = 'local' | 'off' | 'share'
+
+export const SHARED_METRICS_CHOICES: Record<SharedMetricsChoice, { enabled: boolean; send: boolean }> = {
+ share: { enabled: true, send: true },
+ local: { enabled: true, send: false },
+ off: { enabled: false, send: false }
+}
+
+export type SharedMetricsRequester = <T = unknown>(method: string, params?: Record<string, unknown>) => Promise<T>
+
+function isConsent(value: unknown): value is SharedMetricsConsent {
+ return typeof value === 'object' && value !== null && typeof (value as SharedMetricsConsent).decided === 'boolean'
+}
+
+/**
+ * The profile's opt-ins, straight from its config.yaml (the backend is the
+ * only authority; nothing is latched in the renderer, so an answer given in
+ * `hermes setup` and one given here are the same answer). `null` when the
+ * backend could not say — an older backend without the method, or a flap —
+ * which every caller treats as "don't ask".
+ */
+export async function readSharedMetricsConsent(request: SharedMetricsRequester): Promise<SharedMetricsConsent | null> {
+ try {
+ const consent = await request<SharedMetricsConsent>('shared_metrics.status')
+
+ return isConsent(consent) ? consent : null
+ } catch {
+ return null
+ }
+}
+
+/** Write both opt-ins; the backend forces `send` off without `enabled` and reconciles consent. */
+export async function saveSharedMetricsConsent(
+ request: SharedMetricsRequester,
+ flags: { enabled: boolean; send: boolean },
+ { firstRun = false }: { firstRun?: boolean } = {}
+): Promise<SharedMetricsConsent> {
+ const consent = await request<SharedMetricsConsent>('shared_metrics.set', { ...flags, first_run: firstRun })
+
+ if (!isConsent(consent)) {
+ throw new Error('Unexpected shared_metrics.set response')
+ }
+
+ return consent
+}